55 行
435 KiB
JavaScript
55 行
435 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AdvancedMaterialImportPage-DB057gcV.js","assets/AdvancedMaterialImportPage-BMAou6RS.css","assets/GalleryPage-DUcHf5nl.js","assets/GalleryPage-BYYx2bqw.css","assets/LogsPage-C3sWUIbU.js","assets/LogsPage-BUeTyehJ.css","assets/ProfilesPage-BUhp8Mbx.js","assets/ProfilesPage-B0WTnM4e.css","assets/SettingsPage-PMbwCFIc.js","assets/SettingsPage-BR5nrF_4.css","assets/WorkflowCompareDialog-B6QU9VXO.js","assets/WorkflowCompareDialog-BI_xR1pa.css","assets/WorkflowBranchPanel-BzUOh1Fe.js","assets/WorkflowBranchPanel-nMe9nW01.css","assets/WorkflowCandidatePool-xYs54DEH.js","assets/WorkflowCandidatePool-CHJiY32s.css","assets/WorkflowComposer-4G3HjilB.js","assets/WorkflowComposer-D0-o7edc.css","assets/WorkflowDependencyContextCard-Co0RbxVo.js","assets/WorkflowDependencyContextCard-WHidWt7d.css","assets/WorkflowGenerationReviewDialog-CuaoeoDj.js","assets/WorkflowGenerationReviewDialog-Dde3QtRN.css","assets/WorkflowMaterialDrawer-BzNNeBcr.js","assets/WorkflowMaterialDrawer-CzNrrMeI.css","assets/WorkflowRoundPanel-tK6RJEXx.js","assets/WorkflowRoundPanel-DxGu9gjD.css"])))=>i.map(i=>d[i]);
|
||
var Th=Object.defineProperty;var Nh=(t,n,o)=>n in t?Th(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var wc=(t,n,o)=>Nh(t,typeof n!="symbol"?n+"":n,o);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const v of c.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&i(v)}).observe(document,{childList:!0,subtree:!0});function o(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(u){if(u.ep)return;u.ep=!0;const c=o(u);fetch(u.href,c)}})();/**
|
||
* @vue/shared v3.5.39
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function nf(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const ct={},Vr=[],pl=()=>{},Cm=()=>!1,Fu=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Uu=t=>t.startsWith("onUpdate:"),Vt=Object.assign,lf=(t,n)=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)},Lh=Object.prototype.hasOwnProperty,ot=(t,n)=>Lh.call(t,n),$e=Array.isArray,jr=t=>es(t)==="[object Map]",ei=t=>es(t)==="[object Set]",Rp=t=>es(t)==="[object Date]",Ne=t=>typeof t=="function",It=t=>typeof t=="string",Tn=t=>typeof t=="symbol",rt=t=>t!==null&&typeof t=="object",$m=t=>(rt(t)||Ne(t))&&Ne(t.then)&&Ne(t.catch),Pm=Object.prototype.toString,es=t=>Pm.call(t),Bh=t=>es(t).slice(8,-1),Im=t=>es(t)==="[object Object]",of=t=>It(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Fi=nf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ku=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},qh=/-\w/g,An=Ku(t=>t.replace(qh,n=>n.slice(1).toUpperCase())),Oh=/\B([A-Z])/g,To=Ku(t=>t.replace(Oh,"-$1").toLowerCase()),Sm=Ku(t=>t.charAt(0).toUpperCase()+t.slice(1)),hc=Ku(t=>t?`on${Sm(t)}`:""),vl=(t,n)=>!Object.is(t,n),Pu=(t,...n)=>{for(let o=0;o<t.length;o++)t[o](...n)},xm=(t,n,o,i=!1)=>{Object.defineProperty(t,n,{configurable:!0,enumerable:!1,writable:i,value:o})},Vu=t=>{const n=parseFloat(t);return isNaN(n)?t:n},Dh=t=>{const n=It(t)?Number(t):NaN;return isNaN(n)?t:n};let Mp;const ju=()=>Mp||(Mp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Kt(t){if($e(t)){const n={};for(let o=0;o<t.length;o++){const i=t[o],u=It(i)?Kh(i):Kt(i);if(u)for(const c in u)n[c]=u[c]}return n}else if(It(t)||rt(t))return t}const Wh=/;(?![^(]*\))/g,Fh=/:([^]+)/,Uh=/\/\*[^]*?\*\//g;function Kh(t){const n={};return t.replace(Uh,"").split(Wh).forEach(o=>{if(o){const i=o.split(Fh);i.length>1&&(n[i[0].trim()]=i[1].trim())}}),n}function oe(t){let n="";if(It(t))n=t;else if($e(t))for(let o=0;o<t.length;o++){const i=oe(t[o]);i&&(n+=i+" ")}else if(rt(t))for(const o in t)t[o]&&(n+=o+" ");return n.trim()}const Vh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",jh=nf(Vh);function Rm(t){return!!t||t===""}function Gh(t,n){if(t.length!==n.length)return!1;let o=!0;for(let i=0;o&&i<t.length;i++)o=Mo(t[i],n[i]);return o}function Mo(t,n){if(t===n)return!0;let o=Rp(t),i=Rp(n);if(o||i)return o&&i?t.getTime()===n.getTime():!1;if(o=Tn(t),i=Tn(n),o||i)return t===n;if(o=$e(t),i=$e(n),o||i)return o&&i?Gh(t,n):!1;if(o=rt(t),i=rt(n),o||i){if(!o||!i)return!1;const u=Object.keys(t).length,c=Object.keys(n).length;if(u!==c)return!1;for(const v in t){const m=t.hasOwnProperty(v),_=n.hasOwnProperty(v);if(m&&!_||!m&&_||!Mo(t[v],n[v]))return!1}}return String(t)===String(n)}function rf(t,n){return t.findIndex(o=>Mo(o,n))}const Mm=t=>!!(t&&t.__v_isRef===!0),g=t=>It(t)?t:t==null?"":$e(t)||rt(t)&&(t.toString===Pm||!Ne(t.toString))?Mm(t)?g(t.value):JSON.stringify(t,Am,2):String(t),Am=(t,n)=>Mm(n)?Am(t,n.value):jr(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((o,[i,u],c)=>(o[kc(i,c)+" =>"]=u,o),{})}:ei(n)?{[`Set(${n.size})`]:[...n.values()].map(o=>kc(o))}:Tn(n)?kc(n):rt(n)&&!$e(n)&&!Im(n)?String(n):n,kc=(t,n="")=>{var o;return Tn(t)?`Symbol(${(o=t.description)!=null?o:n})`:t};/**
|
||
* @vue/reactivity v3.5.39
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let ra;class Hh{constructor(n=!1){this.detached=n,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!n&&ra&&(ra.active?(this.parent=ra,this.index=(ra.scopes||(ra.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let n,o;if(this.scopes)for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].pause();for(n=0,o=this.effects.length;n<o;n++)this.effects[n].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let n,o;if(this.scopes)for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].resume();for(n=0,o=this.effects.length;n<o;n++)this.effects[n].resume()}}run(n){if(this._active){const o=ra;try{return ra=this,n()}finally{ra=o}}}on(){++this._on===1&&(this.prevScope=ra,ra=this)}off(){if(this._on>0&&--this._on===0){if(ra===this)ra=this.prevScope;else{let n=ra;for(;n;){if(n.prevScope===this){n.prevScope=this.prevScope;break}n=n.prevScope}}this.prevScope=void 0}}stop(n){if(this._active){this._active=!1;let o,i;for(o=0,i=this.effects.length;o<i;o++)this.effects[o].stop();for(this.effects.length=0,o=0,i=this.cleanups.length;o<i;o++)this.cleanups[o]();if(this.cleanups.length=0,this.scopes){for(o=0,i=this.scopes.length;o<i;o++)this.scopes[o].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!n){const u=this.parent.scopes.pop();u&&u!==this&&(this.parent.scopes[this.index]=u,u.index=this.index)}this.parent=void 0}}}function zh(){return ra}let mt;const Cc=new WeakSet;class Em{constructor(n){this.fn=n,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ra&&(ra.active?ra.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Cc.has(this)&&(Cc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Nm(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ap(this),Lm(this);const n=mt,o=En;mt=this,En=!0;try{return this.fn()}finally{Bm(this),mt=n,En=o,this.flags&=-3}}stop(){if(this.flags&1){for(let n=this.deps;n;n=n.nextDep)df(n);this.deps=this.depsTail=void 0,Ap(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Cc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Kc(this)&&this.run()}get dirty(){return Kc(this)}}let Tm=0,Ui,Ki;function Nm(t,n=!1){if(t.flags|=8,n){t.next=Ki,Ki=t;return}t.next=Ui,Ui=t}function sf(){Tm++}function uf(){if(--Tm>0)return;if(Ki){let n=Ki;for(Ki=void 0;n;){const o=n.next;n.next=void 0,n.flags&=-9,n=o}}let t;for(;Ui;){let n=Ui;for(Ui=void 0;n;){const o=n.next;if(n.next=void 0,n.flags&=-9,n.flags&1)try{n.trigger()}catch(i){t||(t=i)}n=o}}if(t)throw t}function Lm(t){for(let n=t.deps;n;n=n.nextDep)n.version=-1,n.prevActiveLink=n.dep.activeLink,n.dep.activeLink=n}function Bm(t){let n,o=t.depsTail,i=o;for(;i;){const u=i.prevDep;i.version===-1?(i===o&&(o=u),df(i),Qh(i)):n=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=u}t.deps=n,t.depsTail=o}function Kc(t){for(let n=t.deps;n;n=n.nextDep)if(n.dep.version!==n.version||n.dep.computed&&(qm(n.dep.computed)||n.dep.version!==n.version))return!0;return!!t._dirty}function qm(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Hi)||(t.globalVersion=Hi,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Kc(t))))return;t.flags|=2;const n=t.dep,o=mt,i=En;mt=t,En=!0;try{Lm(t);const u=t.fn(t._value);(n.version===0||vl(u,t._value))&&(t.flags|=128,t._value=u,n.version++)}catch(u){throw n.version++,u}finally{mt=o,En=i,Bm(t),t.flags&=-3}}function df(t,n=!1){const{dep:o,prevSub:i,nextSub:u}=t;if(i&&(i.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=i,t.nextSub=void 0),o.subs===t&&(o.subs=i,!i&&o.computed)){o.computed.flags&=-5;for(let c=o.computed.deps;c;c=c.nextDep)df(c,!0)}!n&&!--o.sc&&o.map&&o.map.delete(o.key)}function Qh(t){const{prevDep:n,nextDep:o}=t;n&&(n.nextDep=o,t.prevDep=void 0),o&&(o.prevDep=n,t.nextDep=void 0)}let En=!0;const Om=[];function ml(){Om.push(En),En=!1}function gl(){const t=Om.pop();En=t===void 0?!0:t}function Ap(t){const{cleanup:n}=t;if(t.cleanup=void 0,n){const o=mt;mt=void 0;try{n()}finally{mt=o}}}let Hi=0;class Yh{constructor(n,o){this.sub=n,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class cf{constructor(n){this.computed=n,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(n){if(!mt||!En||mt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==mt)o=this.activeLink=new Yh(mt,this),mt.deps?(o.prevDep=mt.depsTail,mt.depsTail.nextDep=o,mt.depsTail=o):mt.deps=mt.depsTail=o,Dm(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const i=o.nextDep;i.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=i),o.prevDep=mt.depsTail,o.nextDep=void 0,mt.depsTail.nextDep=o,mt.depsTail=o,mt.deps===o&&(mt.deps=i)}return o}trigger(n){this.version++,Hi++,this.notify(n)}notify(n){sf();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{uf()}}}function Dm(t){if(t.dep.sc++,t.sub.flags&4){const n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let i=n.deps;i;i=i.nextDep)Dm(i)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const Vc=new WeakMap,fr=Symbol(""),jc=Symbol(""),zi=Symbol("");function ia(t,n,o){if(En&&mt){let i=Vc.get(t);i||Vc.set(t,i=new Map);let u=i.get(o);u||(i.set(o,u=new cf),u.map=i,u.key=o),u.track()}}function Dl(t,n,o,i,u,c){const v=Vc.get(t);if(!v){Hi++;return}const m=_=>{_&&_.trigger()};if(sf(),n==="clear")v.forEach(m);else{const _=$e(t),I=_&&of(o);if(_&&o==="length"){const k=Number(i);v.forEach((M,q)=>{(q==="length"||q===zi||!Tn(q)&&q>=k)&&m(M)})}else switch((o!==void 0||v.has(void 0))&&m(v.get(o)),I&&m(v.get(zi)),n){case"add":_?I&&m(v.get("length")):(m(v.get(fr)),jr(t)&&m(v.get(jc)));break;case"delete":_||(m(v.get(fr)),jr(t)&&m(v.get(jc)));break;case"set":jr(t)&&m(v.get(fr));break}}uf()}function Fr(t){const n=et(t);return n===t?n:(ia(n,"iterate",zi),pn(t)?n:n.map(Nn))}function Gu(t){return ia(t=et(t),"iterate",zi),t}function cl(t,n){return Ul(t)?Qr(vr(t)?Nn(n):n):Nn(n)}const Jh={__proto__:null,[Symbol.iterator](){return $c(this,Symbol.iterator,t=>cl(this,t))},concat(...t){return Fr(this).concat(...t.map(n=>$e(n)?Fr(n):n))},entries(){return $c(this,"entries",t=>(t[1]=cl(this,t[1]),t))},every(t,n){return El(this,"every",t,n,void 0,arguments)},filter(t,n){return El(this,"filter",t,n,o=>o.map(i=>cl(this,i)),arguments)},find(t,n){return El(this,"find",t,n,o=>cl(this,o),arguments)},findIndex(t,n){return El(this,"findIndex",t,n,void 0,arguments)},findLast(t,n){return El(this,"findLast",t,n,o=>cl(this,o),arguments)},findLastIndex(t,n){return El(this,"findLastIndex",t,n,void 0,arguments)},forEach(t,n){return El(this,"forEach",t,n,void 0,arguments)},includes(...t){return Pc(this,"includes",t)},indexOf(...t){return Pc(this,"indexOf",t)},join(t){return Fr(this).join(t)},lastIndexOf(...t){return Pc(this,"lastIndexOf",t)},map(t,n){return El(this,"map",t,n,void 0,arguments)},pop(){return Ni(this,"pop")},push(...t){return Ni(this,"push",t)},reduce(t,...n){return Ep(this,"reduce",t,n)},reduceRight(t,...n){return Ep(this,"reduceRight",t,n)},shift(){return Ni(this,"shift")},some(t,n){return El(this,"some",t,n,void 0,arguments)},splice(...t){return Ni(this,"splice",t)},toReversed(){return Fr(this).toReversed()},toSorted(t){return Fr(this).toSorted(t)},toSpliced(...t){return Fr(this).toSpliced(...t)},unshift(...t){return Ni(this,"unshift",t)},values(){return $c(this,"values",t=>cl(this,t))}};function $c(t,n,o){const i=Gu(t),u=i[n]();return i!==t&&!pn(t)&&(u._next=u.next,u.next=()=>{const c=u._next();return c.done||(c.value=o(c.value)),c}),u}const Xh=Array.prototype;function El(t,n,o,i,u,c){const v=Gu(t),m=v!==t&&!pn(t),_=v[n];if(_!==Xh[n]){const M=_.apply(t,c);return m?Nn(M):M}let I=o;v!==t&&(m?I=function(M,q){return o.call(this,cl(t,M),q,t)}:o.length>2&&(I=function(M,q){return o.call(this,M,q,t)}));const k=_.call(v,I,i);return m&&u?u(k):k}function Ep(t,n,o,i){const u=Gu(t),c=u!==t&&!pn(t);let v=o,m=!1;u!==t&&(c?(m=i.length===0,v=function(I,k,M){return m&&(m=!1,I=cl(t,I)),o.call(this,I,cl(t,k),M,t)}):o.length>3&&(v=function(I,k,M){return o.call(this,I,k,M,t)}));const _=u[n](v,...i);return m?cl(t,_):_}function Pc(t,n,o){const i=et(t);ia(i,"iterate",zi);const u=i[n](...o);return(u===-1||u===!1)&&mf(o[0])?(o[0]=et(o[0]),i[n](...o)):u}function Ni(t,n,o=[]){ml(),sf();const i=et(t)[n].apply(t,o);return uf(),gl(),i}const Zh=nf("__proto__,__v_isRef,__isVue"),Wm=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Tn));function ek(t){Tn(t)||(t=String(t));const n=et(this);return ia(n,"has",t),n.hasOwnProperty(t)}class Fm{constructor(n=!1,o=!1){this._isReadonly=n,this._isShallow=o}get(n,o,i){if(o==="__v_skip")return n.__v_skip;const u=this._isReadonly,c=this._isShallow;if(o==="__v_isReactive")return!u;if(o==="__v_isReadonly")return u;if(o==="__v_isShallow")return c;if(o==="__v_raw")return i===(u?c?dk:jm:c?Vm:Km).get(n)||Object.getPrototypeOf(n)===Object.getPrototypeOf(i)?n:void 0;const v=$e(n);if(!u){let _;if(v&&(_=Jh[o]))return _;if(o==="hasOwnProperty")return ek}const m=Reflect.get(n,o,fa(n)?n:i);if((Tn(o)?Wm.has(o):Zh(o))||(u||ia(n,"get",o),c))return m;if(fa(m)){const _=v&&of(o)?m:m.value;return u&&rt(_)?Hc(_):_}return rt(m)?u?Hc(m):vf(m):m}}class Um extends Fm{constructor(n=!1){super(!1,n)}set(n,o,i,u){let c=n[o];const v=$e(n)&&of(o);if(!this._isShallow){const I=Ul(c);if(!pn(i)&&!Ul(i)&&(c=et(c),i=et(i)),!v&&fa(c)&&!fa(i))return I||(c.value=i),!0}const m=v?Number(o)<n.length:ot(n,o),_=Reflect.set(n,o,i,fa(n)?n:u);return n===et(u)&&_&&(m?vl(i,c)&&Dl(n,"set",o,i):Dl(n,"add",o,i)),_}deleteProperty(n,o){const i=ot(n,o);n[o];const u=Reflect.deleteProperty(n,o);return u&&i&&Dl(n,"delete",o,void 0),u}has(n,o){const i=Reflect.has(n,o);return(!Tn(o)||!Wm.has(o))&&ia(n,"has",o),i}ownKeys(n){return ia(n,"iterate",$e(n)?"length":fr),Reflect.ownKeys(n)}}class tk extends Fm{constructor(n=!1){super(!0,n)}set(n,o){return!0}deleteProperty(n,o){return!0}}const ak=new Um,nk=new tk,lk=new Um(!0);const Gc=t=>t,yu=t=>Reflect.getPrototypeOf(t);function ok(t,n,o){return function(...i){const u=this.__v_raw,c=et(u),v=jr(c),m=t==="entries"||t===Symbol.iterator&&v,_=t==="keys"&&v,I=u[t](...i),k=o?Gc:n?Qr:Nn;return!n&&ia(c,"iterate",_?jc:fr),Vt(Object.create(I),{next(){const{value:M,done:q}=I.next();return q?{value:M,done:q}:{value:m?[k(M[0]),k(M[1])]:k(M),done:q}}})}}function _u(t){return function(...n){return t==="delete"?!1:t==="clear"?void 0:this}}function rk(t,n){const o={get(u){const c=this.__v_raw,v=et(c),m=et(u);t||(vl(u,m)&&ia(v,"get",u),ia(v,"get",m));const{has:_}=yu(v),I=n?Gc:t?Qr:Nn;if(_.call(v,u))return I(c.get(u));if(_.call(v,m))return I(c.get(m));c!==v&&c.get(u)},get size(){const u=this.__v_raw;return!t&&ia(et(u),"iterate",fr),u.size},has(u){const c=this.__v_raw,v=et(c),m=et(u);return t||(vl(u,m)&&ia(v,"has",u),ia(v,"has",m)),u===m?c.has(u):c.has(u)||c.has(m)},forEach(u,c){const v=this,m=v.__v_raw,_=et(m),I=n?Gc:t?Qr:Nn;return!t&&ia(_,"iterate",fr),m.forEach((k,M)=>u.call(c,I(k),I(M),v))}};return Vt(o,t?{add:_u("add"),set:_u("set"),delete:_u("delete"),clear:_u("clear")}:{add(u){const c=et(this),v=yu(c),m=et(u),_=!n&&!pn(u)&&!Ul(u)?m:u;return v.has.call(c,_)||vl(u,_)&&v.has.call(c,u)||vl(m,_)&&v.has.call(c,m)||(c.add(_),Dl(c,"add",_,_)),this},set(u,c){!n&&!pn(c)&&!Ul(c)&&(c=et(c));const v=et(this),{has:m,get:_}=yu(v);let I=m.call(v,u);I||(u=et(u),I=m.call(v,u));const k=_.call(v,u);return v.set(u,c),I?vl(c,k)&&Dl(v,"set",u,c):Dl(v,"add",u,c),this},delete(u){const c=et(this),{has:v,get:m}=yu(c);let _=v.call(c,u);_||(u=et(u),_=v.call(c,u)),m&&m.call(c,u);const I=c.delete(u);return _&&Dl(c,"delete",u,void 0),I},clear(){const u=et(this),c=u.size!==0,v=u.clear();return c&&Dl(u,"clear",void 0,void 0),v}}),["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=ok(u,t,n)}),o}function ff(t,n){const o=rk(t,n);return(i,u,c)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?i:Reflect.get(ot(o,u)&&u in i?o:i,u,c)}const ik={get:ff(!1,!1)},sk={get:ff(!1,!0)},uk={get:ff(!0,!1)};const Km=new WeakMap,Vm=new WeakMap,jm=new WeakMap,dk=new WeakMap;function ck(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function vf(t){return Ul(t)?t:pf(t,!1,ak,ik,Km)}function fk(t){return pf(t,!1,lk,sk,Vm)}function Hc(t){return pf(t,!0,nk,uk,jm)}function pf(t,n,o,i,u){if(!rt(t)||t.__v_raw&&!(n&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const c=u.get(t);if(c)return c;const v=ck(Bh(t));if(v===0)return t;const m=new Proxy(t,v===2?i:o);return u.set(t,m),m}function vr(t){return Ul(t)?vr(t.__v_raw):!!(t&&t.__v_isReactive)}function Ul(t){return!!(t&&t.__v_isReadonly)}function pn(t){return!!(t&&t.__v_isShallow)}function mf(t){return t?!!t.__v_raw:!1}function et(t){const n=t&&t.__v_raw;return n?et(n):t}function vk(t){return!ot(t,"__v_skip")&&Object.isExtensible(t)&&xm(t,"__v_skip",!0),t}const Nn=t=>rt(t)?vf(t):t,Qr=t=>rt(t)?Hc(t):t;function fa(t){return t?t.__v_isRef===!0:!1}function P(t){return pk(t,!1)}function pk(t,n){return fa(t)?t:new mk(t,n)}class mk{constructor(n,o){this.dep=new cf,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?n:et(n),this._value=o?n:Nn(n),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(n){const o=this._rawValue,i=this.__v_isShallow||pn(n)||Ul(n);n=i?n:et(n),vl(n,o)&&(this._rawValue=n,this._value=i?n:Nn(n),this.dep.trigger())}}function ne(t){return fa(t)?t.value:t}const gk={get:(t,n,o)=>n==="__v_raw"?t:ne(Reflect.get(t,n,o)),set:(t,n,o,i)=>{const u=t[n];return fa(u)&&!fa(o)?(u.value=o,!0):Reflect.set(t,n,o,i)}};function Gm(t){return vr(t)?t:new Proxy(t,gk)}class yk{constructor(n,o,i){this.fn=n,this.setter=o,this._value=void 0,this.dep=new cf(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&mt!==this)return Nm(this,!0),!0}get value(){const n=this.dep.track();return qm(this),n&&(n.version=this.dep.version),this._value}set value(n){this.setter&&this.setter(n)}}function _k(t,n,o=!1){let i,u;return Ne(t)?i=t:(i=t.get,u=t.set),new yk(i,u,o)}const bu={},Mu=new WeakMap;let dr;function bk(t,n=!1,o=dr){if(o){let i=Mu.get(o);i||Mu.set(o,i=[]),i.push(t)}}function wk(t,n,o=ct){const{immediate:i,deep:u,once:c,scheduler:v,augmentJob:m,call:_}=o,I=X=>u?X:pn(X)||u===!1||u===0?Wl(X,1):Wl(X);let k,M,q,K,ee=!1,j=!1;if(fa(t)?(M=()=>t.value,ee=pn(t)):vr(t)?(M=()=>I(t),ee=!0):$e(t)?(j=!0,ee=t.some(X=>vr(X)||pn(X)),M=()=>t.map(X=>{if(fa(X))return X.value;if(vr(X))return I(X);if(Ne(X))return _?_(X,2):X()})):Ne(t)?n?M=_?()=>_(t,2):t:M=()=>{if(q){ml();try{q()}finally{gl()}}const X=dr;dr=k;try{return _?_(t,3,[K]):t(K)}finally{dr=X}}:M=pl,n&&u){const X=M,ve=u===!0?1/0:u;M=()=>Wl(X(),ve)}const fe=zh(),ie=()=>{k.stop(),fe&&fe.active&&lf(fe.effects,k)};if(c&&n){const X=n;n=(...ve)=>{const We=X(...ve);return ie(),We}}let V=j?new Array(t.length).fill(bu):bu;const _e=X=>{if(!(!(k.flags&1)||!k.dirty&&!X))if(n){const ve=k.run();if(X||u||ee||(j?ve.some((We,Ie)=>vl(We,V[Ie])):vl(ve,V))){q&&q();const We=dr;dr=k;try{const Ie=[ve,V===bu?void 0:j&&V[0]===bu?[]:V,K];V=ve,_?_(n,3,Ie):n(...Ie)}finally{dr=We}}}else k.run()};return m&&m(_e),k=new Em(M),k.scheduler=v?()=>v(_e,!1):_e,K=X=>bk(X,!1,k),q=k.onStop=()=>{const X=Mu.get(k);if(X){if(_)_(X,4);else for(const ve of X)ve();Mu.delete(k)}},n?i?_e(!0):V=k.run():v?v(_e.bind(null,!0),!0):k.run(),ie.pause=k.pause.bind(k),ie.resume=k.resume.bind(k),ie.stop=ie,ie}function Wl(t,n=1/0,o){if(n<=0||!rt(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=n))return t;if(o.set(t,n),n--,fa(t))Wl(t.value,n,o);else if($e(t))for(let i=0;i<t.length;i++)Wl(t[i],n,o);else if(ei(t)||jr(t))t.forEach(i=>{Wl(i,n,o)});else if(Im(t)){for(const i in t)Wl(t[i],n,o);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&Wl(t[i],n,o)}return t}/**
|
||
* @vue/runtime-core v3.5.39
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function ts(t,n,o,i){try{return i?t(...i):t()}catch(u){as(u,n,o)}}function gn(t,n,o,i){if(Ne(t)){const u=ts(t,n,o,i);return u&&$m(u)&&u.catch(c=>{as(c,n,o)}),u}if($e(t)){const u=[];for(let c=0;c<t.length;c++)u.push(gn(t[c],n,o,i));return u}}function as(t,n,o,i=!0){const u=n?n.vnode:null,{errorHandler:c,throwUnhandledErrorInProduction:v}=n&&n.appContext.config||ct;if(n){let m=n.parent;const _=n.proxy,I=`https://vuejs.org/error-reference/#runtime-${o}`;for(;m;){const k=m.ec;if(k){for(let M=0;M<k.length;M++)if(k[M](t,_,I)===!1)return}m=m.parent}if(c){ml(),ts(c,null,10,[t,_,I]),gl();return}}hk(t,o,u,i,v)}function hk(t,n,o,i=!0,u=!1){if(u)throw t;console.error(t)}const ka=[];let dl=-1;const Gr=[];let Ro=null,Kr=0;const Hm=Promise.resolve();let Au=null;function Ht(t){const n=Au||Hm;return t?n.then(this?t.bind(this):t):n}function kk(t){let n=dl+1,o=ka.length;for(;n<o;){const i=n+o>>>1,u=ka[i],c=Qi(u);c<t||c===t&&u.flags&2?n=i+1:o=i}return n}function gf(t){if(!(t.flags&1)){const n=Qi(t),o=ka[ka.length-1];!o||!(t.flags&2)&&n>=Qi(o)?ka.push(t):ka.splice(kk(n),0,t),t.flags|=1,zm()}}function zm(){Au||(Au=Hm.then(Ym))}function Ck(t){$e(t)?Gr.push(...t):Ro&&t.id===-1?Ro.splice(Kr+1,0,t):t.flags&1||(Gr.push(t),t.flags|=1),zm()}function Tp(t,n,o=dl+1){for(;o<ka.length;o++){const i=ka[o];if(i&&i.flags&2){if(t&&i.id!==t.uid)continue;ka.splice(o,1),o--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function Qm(t){if(Gr.length){const n=[...new Set(Gr)].sort((o,i)=>Qi(o)-Qi(i));if(Gr.length=0,Ro){Ro.push(...n);return}for(Ro=n,Kr=0;Kr<Ro.length;Kr++){const o=Ro[Kr];o.flags&4&&(o.flags&=-2),o.flags&8||o(),o.flags&=-2}Ro=null,Kr=0}}const Qi=t=>t.id==null?t.flags&2?-1:1/0:t.id;function Ym(t){try{for(dl=0;dl<ka.length;dl++){const n=ka[dl];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),ts(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;dl<ka.length;dl++){const n=ka[dl];n&&(n.flags&=-2)}dl=-1,ka.length=0,Qm(),Au=null,(ka.length||Gr.length)&&Ym()}}let ca=null,Jm=null;function Eu(t){const n=ca;return ca=t,Jm=t&&t.type.__scopeId||null,n}function qt(t,n=ca,o){if(!n||t._n)return t;const i=(...u)=>{i._d&&Lu(-1);const c=Eu(n);let v;try{v=t(...u)}finally{Eu(c),i._d&&Lu(1)}return v};return i._n=!0,i._c=!0,i._d=!0,i}function xe(t,n){if(ca===null)return t;const o=Ju(ca),i=t.dirs||(t.dirs=[]);for(let u=0;u<n.length;u++){let[c,v,m,_=ct]=n[u];c&&(Ne(c)&&(c={mounted:c,updated:c}),c.deep&&Wl(v),i.push({dir:c,instance:o,value:v,oldValue:void 0,arg:m,modifiers:_}))}return t}function lr(t,n,o,i){const u=t.dirs,c=n&&n.dirs;for(let v=0;v<u.length;v++){const m=u[v];c&&(m.oldValue=c[v].value);let _=m.dir[i];_&&(ml(),gn(_,o,8,[t.el,m,t,n]),gl())}}function $k(t,n){if(da){let o=da.provides;const i=da.parent&&da.parent.provides;i===o&&(o=da.provides=Object.create(i)),o[t]=n}}function Iu(t,n,o=!1){const i=Yu();if(i||zr){let u=zr?zr._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(u&&t in u)return u[t];if(arguments.length>1)return o&&Ne(n)?n.call(i&&i.proxy):n}}const Pk=Symbol.for("v-scx"),Ik=()=>Iu(Pk);function lt(t,n,o){return Xm(t,n,o)}function Xm(t,n,o=ct){const{immediate:i,deep:u,flush:c,once:v}=o,m=Vt({},o),_=n&&i||!n&&c!=="post";let I;if(Yr){if(c==="sync"){const K=Ik();I=K.__watcherHandles||(K.__watcherHandles=[])}else if(!_){const K=()=>{};return K.stop=pl,K.resume=pl,K.pause=pl,K}}const k=da;m.call=(K,ee,j)=>gn(K,k,ee,j);let M=!1;c==="post"?m.scheduler=K=>{La(K,k&&k.suspense)}:c!=="sync"&&(M=!0,m.scheduler=(K,ee)=>{ee?K():gf(K)}),m.augmentJob=K=>{n&&(K.flags|=4),M&&(K.flags|=2,k&&(K.id=k.uid,K.i=k))};const q=wk(t,n,m);return Yr&&(I?I.push(q):_&&q()),q}function Sk(t,n,o){const i=this.proxy,u=It(t)?t.includes(".")?Zm(i,t):()=>i[t]:t.bind(i,i);let c;Ne(n)?c=n:(c=n.handler,o=n);const v=os(this),m=Xm(u,c.bind(i),o);return v(),m}function Zm(t,n){const o=n.split(".");return()=>{let i=t;for(let u=0;u<o.length&&i;u++)i=i[o[u]];return i}}const xk=Symbol("_vte"),eg=t=>t.__isTeleport,vn=Symbol("_leaveCb"),Li=Symbol("_enterCb");function tg(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ls(()=>{t.isMounted=!0}),ti(()=>{t.isUnmounting=!0}),t}const cn=[Function,Array],ag={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cn,onEnter:cn,onAfterEnter:cn,onEnterCancelled:cn,onBeforeLeave:cn,onLeave:cn,onAfterLeave:cn,onLeaveCancelled:cn,onBeforeAppear:cn,onAppear:cn,onAfterAppear:cn,onAppearCancelled:cn},ng=t=>{const n=t.subTree;return n.component?ng(n.component):n},Rk={name:"BaseTransition",props:ag,setup(t,{slots:n}){const o=Yu(),i=tg();return()=>{const u=n.default&&yf(n.default(),!0),c=u&&u.length?lg(u):o.subTree?ce():void 0;if(!c)return;const v=et(t),{mode:m}=v;if(i.isLeaving)return Ic(c);const _=Np(c);if(!_)return Ic(c);let I=Yi(_,v,i,o,M=>I=M);_.type!==ua&&pr(_,I);let k=o.subTree&&Np(o.subTree);if(k&&k.type!==ua&&!cr(k,_)&&ng(o).type!==ua){let M=Yi(k,v,i,o);if(pr(k,M),m==="out-in"&&_.type!==ua)return i.isLeaving=!0,M.afterLeave=()=>{i.isLeaving=!1,o.job.flags&8||o.update(),delete M.afterLeave,k=void 0},Ic(c);m==="in-out"&&_.type!==ua?M.delayLeave=(q,K,ee)=>{const j=og(i,k);j[String(k.key)]=k,q[vn]=()=>{K(),q[vn]=void 0,delete I.delayedLeave,k=void 0},I.delayedLeave=()=>{ee(),delete I.delayedLeave,k=void 0}}:k=void 0}else k&&(k=void 0);return c}}};function lg(t){let n=t[0];if(t.length>1){for(const o of t)if(o.type!==ua){n=o;break}}return n}const Mk=Rk;function og(t,n){const{leavingVNodes:o}=t;let i=o.get(n.type);return i||(i=Object.create(null),o.set(n.type,i)),i}function Yi(t,n,o,i,u){const{appear:c,mode:v,persisted:m=!1,onBeforeEnter:_,onEnter:I,onAfterEnter:k,onEnterCancelled:M,onBeforeLeave:q,onLeave:K,onAfterLeave:ee,onLeaveCancelled:j,onBeforeAppear:fe,onAppear:ie,onAfterAppear:V,onAppearCancelled:_e}=n,X=String(t.key),ve=og(o,t),We=(G,E)=>{G&&gn(G,i,9,E)},Ie=(G,E)=>{const B=E[1];We(G,E),$e(G)?G.every(N=>N.length<=1)&&B():G.length<=1&&B()},de={mode:v,persisted:m,beforeEnter(G){let E=_;if(!o.isMounted)if(c)E=fe||_;else return;G[vn]&&G[vn](!0);const B=ve[X];B&&cr(t,B)&&B.el[vn]&&B.el[vn](),We(E,[G])},enter(G){if(ve[X]===t)return;let E=I,B=k,N=M;if(!o.isMounted)if(c)E=ie||I,B=V||k,N=_e||M;else return;let Se=!1;G[Li]=ht=>{Se||(Se=!0,ht?We(N,[G]):We(B,[G]),de.delayedLeave&&de.delayedLeave(),G[Li]=void 0)};const st=G[Li].bind(null,!1);E?Ie(E,[G,st]):st()},leave(G,E){const B=String(t.key);if(G[Li]&&G[Li](!0),o.isUnmounting)return E();We(q,[G]);let N=!1;G[vn]=st=>{N||(N=!0,E(),st?We(j,[G]):We(ee,[G]),G[vn]=void 0,ve[B]===t&&delete ve[B])};const Se=G[vn].bind(null,!1);ve[B]=t,K?Ie(K,[G,Se]):Se()},clone(G){const E=Yi(G,n,o,i,u);return u&&u(E),E}};return de}function Ic(t){if(ns(t))return t=Ao(t),t.children=null,t}function Np(t){if(!ns(t))return eg(t.type)&&t.children?lg(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:n,children:o}=t;if(o){if(n&16)return o[0];if(n&32&&Ne(o.default))return o.default()}}function pr(t,n){t.shapeFlag&6&&t.component?(t.transition=n,pr(t.component.subTree,n)):t.shapeFlag&128?(t.ssContent.transition=n.clone(t.ssContent),t.ssFallback.transition=n.clone(t.ssFallback)):t.transition=n}function yf(t,n=!1,o){let i=[],u=0;for(let c=0;c<t.length;c++){let v=t[c];const m=o==null?v.key:String(o)+String(v.key!=null?v.key:c);v.type===z?(v.patchFlag&128&&u++,i=i.concat(yf(v.children,n,m))):(n||v.type!==ua)&&i.push(m!=null?Ao(v,{key:m}):v)}if(u>1)for(let c=0;c<i.length;c++)i[c].patchFlag=-2;return i}function Ln(t,n){return Ne(t)?Vt({name:t.name},n,{setup:t}):t}function Ak(){const t=Yu();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function _f(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Lp(t,n){let o;return!!((o=Object.getOwnPropertyDescriptor(t,n))&&!o.configurable)}const Tu=new WeakMap;function Vi(t,n,o,i,u=!1){if($e(t)){t.forEach((j,fe)=>Vi(j,n&&($e(n)?n[fe]:n),o,i,u));return}if(Hr(i)&&!u){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Vi(t,n,o,i.component.subTree);return}const c=i.shapeFlag&4?Ju(i.component):i.el,v=u?null:c,{i:m,r:_}=t,I=n&&n.r,k=m.refs===ct?m.refs={}:m.refs,M=m.setupState,q=et(M),K=M===ct?Cm:j=>Lp(k,j)?!1:ot(q,j),ee=(j,fe)=>!(fe&&Lp(k,fe));if(I!=null&&I!==_){if(Bp(n),It(I))k[I]=null,K(I)&&(M[I]=null);else if(fa(I)){const j=n;ee(I,j.k)&&(I.value=null),j.k&&(k[j.k]=null)}}if(Ne(_)){ml();try{ts(_,m,12,[v,k])}finally{gl()}}else{const j=It(_),fe=fa(_);if(j||fe){const ie=()=>{if(t.f){const V=j?K(_)?M[_]:k[_]:ee()||!t.k?_.value:k[t.k];if(u)$e(V)&&lf(V,c);else if($e(V))V.includes(c)||V.push(c);else if(j)k[_]=[c],K(_)&&(M[_]=k[_]);else{const _e=[c];ee(_,t.k)&&(_.value=_e),t.k&&(k[t.k]=_e)}}else j?(k[_]=v,K(_)&&(M[_]=v)):fe&&(ee(_,t.k)&&(_.value=v),t.k&&(k[t.k]=v))};if(v){const V=()=>{ie(),Tu.delete(t)};V.id=-1,Tu.set(t,V),La(V,o)}else Bp(t),ie()}}}function Bp(t){const n=Tu.get(t);n&&(n.flags|=8,Tu.delete(t))}const qp=t=>t.nodeType===8;ju().requestIdleCallback;ju().cancelIdleCallback;function Ek(t,n){if(qp(t)&&t.data==="["){let o=1,i=t.nextSibling;for(;i;){if(i.nodeType===1){if(n(i)===!1)break}else if(qp(i))if(i.data==="]"){if(--o===0)break}else i.data==="["&&o++;i=i.nextSibling}}else n(t)}const Hr=t=>!!t.type.__asyncLoader;function Ha(t){Ne(t)&&(t={loader:t});const{loader:n,loadingComponent:o,errorComponent:i,delay:u=200,hydrate:c,timeout:v,suspensible:m=!0,onError:_}=t;let I=null,k,M=0;const q=()=>(M++,I=null,K()),K=()=>{let ee;return I||(ee=I=n().catch(j=>{if(j=j instanceof Error?j:new Error(String(j)),_)return new Promise((fe,ie)=>{_(j,()=>fe(q()),()=>ie(j),M+1)});throw j}).then(j=>ee!==I&&I?I:(j&&(j.__esModule||j[Symbol.toStringTag]==="Module")&&(j=j.default),k=j,j)))};return Ln({name:"AsyncComponentWrapper",__asyncLoader:K,__asyncHydrate(ee,j,fe){let ie=!1;(j.bu||(j.bu=[])).push(()=>ie=!0);const V=()=>{ie||fe()},_e=c?()=>{const X=c(V,ve=>Ek(ee,ve));X&&(j.bum||(j.bum=[])).push(X)}:V;k?_e():K().then(()=>!j.isUnmounted&&_e())},get __asyncResolved(){return k},setup(){const ee=da;if(_f(ee),k)return()=>wu(k,ee);const j=ve=>{I=null,as(ve,ee,13,!i)};if(m&&ee.suspense||Yr)return K().then(ve=>()=>wu(ve,ee)).catch(ve=>(j(ve),()=>i?Ee(i,{error:ve}):null));const fe=P(!1),ie=P(),V=P(!!u);let _e,X;return bf(()=>{_e!=null&&clearTimeout(_e),X!=null&&clearTimeout(X)}),u&&(X=setTimeout(()=>{ee.isUnmounted||(V.value=!1)},u)),v!=null&&(_e=setTimeout(()=>{if(!ee.isUnmounted&&!fe.value&&!ie.value){const ve=new Error(`Async component timed out after ${v}ms.`);j(ve),ie.value=ve}},v)),K().then(()=>{ee.isUnmounted||(fe.value=!0,ee.parent&&ns(ee.parent.vnode)&&ee.parent.update())}).catch(ve=>{if(ee.isUnmounted){I=null;return}j(ve),ie.value=ve}),()=>{if(fe.value&&k)return wu(k,ee);if(ie.value&&i)return Ee(i,{error:ie.value});if(o&&!V.value)return wu(o,ee)}}})}function wu(t,n){const{ref:o,props:i,children:u,ce:c}=n.vnode,v=Ee(t,i,u);return v.ref=o,v.ce=c,delete n.vnode.ce,v}const ns=t=>t.type.__isKeepAlive;function Tk(t,n){rg(t,"a",n)}function Nk(t,n){rg(t,"da",n)}function rg(t,n,o=da){const i=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(Hu(n,i,o),o){let u=o.parent;for(;u&&u.parent;)ns(u.parent.vnode)&&Lk(i,n,o,u),u=u.parent}}function Lk(t,n,o,i){const u=Hu(n,t,i,!0);bf(()=>{lf(i[n],u)},o)}function Hu(t,n,o=da,i=!1){if(o){const u=o[t]||(o[t]=[]),c=n.__weh||(n.__weh=(...v)=>{ml();const m=os(o),_=gn(n,o,t,v);return m(),gl(),_});return i?u.unshift(c):u.push(c),c}}const Kl=t=>(n,o=da)=>{(!Yr||t==="sp")&&Hu(t,(...i)=>n(...i),o)},Bk=Kl("bm"),ls=Kl("m"),qk=Kl("bu"),ig=Kl("u"),ti=Kl("bum"),bf=Kl("um"),Ok=Kl("sp"),Dk=Kl("rtg"),Wk=Kl("rtc");function Fk(t,n=da){Hu("ec",t,n)}const Uk=Symbol.for("v-ndc");function ue(t,n,o,i){let u;const c=o,v=$e(t);if(v||It(t)){const m=v&&vr(t);let _=!1,I=!1;m&&(_=!pn(t),I=Ul(t),t=Gu(t)),u=new Array(t.length);for(let k=0,M=t.length;k<M;k++)u[k]=n(_?I?Qr(Nn(t[k])):Nn(t[k]):t[k],k,void 0,c)}else if(typeof t=="number"){u=new Array(t);for(let m=0;m<t;m++)u[m]=n(m+1,m,void 0,c)}else if(rt(t))if(t[Symbol.iterator])u=Array.from(t,(m,_)=>n(m,_,void 0,c));else{const m=Object.keys(t);u=new Array(m.length);for(let _=0,I=m.length;_<I;_++){const k=m[_];u[_]=n(t[k],k,_,c)}}else u=[];return u}function Op(t,n,o={},i,u){if(ca.ce||ca.parent&&Hr(ca.parent)&&ca.parent.ce){const I=Object.keys(o).length>0;return n!=="default"&&(o.name=n),y(),ut(z,null,[Ee("slot",o,i&&i())],I?-2:64)}let c=t[n];c&&c._c&&(c._d=!1),y();const v=c&&sg(c(o)),m=o.key||v&&v.key,_=ut(z,{key:(m&&!Tn(m)?m:`_${n}`)+(!v&&i?"_fb":"")},v||(i?i():[]),v&&t._===1?64:-2);return c&&c._c&&(c._d=!0),_}function sg(t){return t.some(n=>Xi(n)?!(n.type===ua||n.type===z&&!sg(n.children)):!0)?t:null}const zc=t=>t?xg(t)?Ju(t):zc(t.parent):null,ji=Vt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>zc(t.parent),$root:t=>zc(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>dg(t),$forceUpdate:t=>t.f||(t.f=()=>{gf(t.update)}),$nextTick:t=>t.n||(t.n=Ht.bind(t.proxy)),$watch:t=>Sk.bind(t)}),Sc=(t,n)=>t!==ct&&!t.__isScriptSetup&&ot(t,n),Kk={get({_:t},n){if(n==="__v_skip")return!0;const{ctx:o,setupState:i,data:u,props:c,accessCache:v,type:m,appContext:_}=t;if(n[0]!=="$"){const q=v[n];if(q!==void 0)switch(q){case 1:return i[n];case 2:return u[n];case 4:return o[n];case 3:return c[n]}else{if(Sc(i,n))return v[n]=1,i[n];if(u!==ct&&ot(u,n))return v[n]=2,u[n];if(ot(c,n))return v[n]=3,c[n];if(o!==ct&&ot(o,n))return v[n]=4,o[n];Qc&&(v[n]=0)}}const I=ji[n];let k,M;if(I)return n==="$attrs"&&ia(t.attrs,"get",""),I(t);if((k=m.__cssModules)&&(k=k[n]))return k;if(o!==ct&&ot(o,n))return v[n]=4,o[n];if(M=_.config.globalProperties,ot(M,n))return M[n]},set({_:t},n,o){const{data:i,setupState:u,ctx:c}=t;return Sc(u,n)?(u[n]=o,!0):i!==ct&&ot(i,n)?(i[n]=o,!0):ot(t.props,n)||n[0]==="$"&&n.slice(1)in t?!1:(c[n]=o,!0)},has({_:{data:t,setupState:n,accessCache:o,ctx:i,appContext:u,props:c,type:v}},m){let _;return!!(o[m]||t!==ct&&m[0]!=="$"&&ot(t,m)||Sc(n,m)||ot(c,m)||ot(i,m)||ot(ji,m)||ot(u.config.globalProperties,m)||(_=v.__cssModules)&&_[m])},defineProperty(t,n,o){return o.get!=null?t._.accessCache[n]=0:ot(o,"value")&&this.set(t,n,o.value,null),Reflect.defineProperty(t,n,o)}};function Dp(t){return $e(t)?t.reduce((n,o)=>(n[o]=null,n),{}):t}let Qc=!0;function Vk(t){const n=dg(t),o=t.proxy,i=t.ctx;Qc=!1,n.beforeCreate&&Wp(n.beforeCreate,t,"bc");const{data:u,computed:c,methods:v,watch:m,provide:_,inject:I,created:k,beforeMount:M,mounted:q,beforeUpdate:K,updated:ee,activated:j,deactivated:fe,beforeDestroy:ie,beforeUnmount:V,destroyed:_e,unmounted:X,render:ve,renderTracked:We,renderTriggered:Ie,errorCaptured:de,serverPrefetch:G,expose:E,inheritAttrs:B,components:N,directives:Se,filters:st}=n;if(I&&jk(I,i,null),v)for(const it in v){const He=v[it];Ne(He)&&(i[it]=He.bind(o))}if(u){const it=u.call(o,o);rt(it)&&(t.data=vf(it))}if(Qc=!0,c)for(const it in c){const He=c[it],Ba=Ne(He)?He.bind(o,o):Ne(He.get)?He.get.bind(o,o):pl,Bn=!Ne(He)&&Ne(He.set)?He.set.bind(o):pl,ze=S({get:Ba,set:Bn});Object.defineProperty(i,it,{enumerable:!0,configurable:!0,get:()=>ze.value,set:zt=>ze.value=zt})}if(m)for(const it in m)ug(m[it],i,o,it);if(_){const it=Ne(_)?_.call(o):_;Reflect.ownKeys(it).forEach(He=>{$k(He,it[He])})}k&&Wp(k,t,"c");function Ze(it,He){$e(He)?He.forEach(Ba=>it(Ba.bind(o))):He&&it(He.bind(o))}if(Ze(Bk,M),Ze(ls,q),Ze(qk,K),Ze(ig,ee),Ze(Tk,j),Ze(Nk,fe),Ze(Fk,de),Ze(Wk,We),Ze(Dk,Ie),Ze(ti,V),Ze(bf,X),Ze(Ok,G),$e(E))if(E.length){const it=t.exposed||(t.exposed={});E.forEach(He=>{Object.defineProperty(it,He,{get:()=>o[He],set:Ba=>o[He]=Ba,enumerable:!0})})}else t.exposed||(t.exposed={});ve&&t.render===pl&&(t.render=ve),B!=null&&(t.inheritAttrs=B),N&&(t.components=N),Se&&(t.directives=Se),G&&_f(t)}function jk(t,n,o=pl){$e(t)&&(t=Yc(t));for(const i in t){const u=t[i];let c;rt(u)?"default"in u?c=Iu(u.from||i,u.default,!0):c=Iu(u.from||i):c=Iu(u),fa(c)?Object.defineProperty(n,i,{enumerable:!0,configurable:!0,get:()=>c.value,set:v=>c.value=v}):n[i]=c}}function Wp(t,n,o){gn($e(t)?t.map(i=>i.bind(n.proxy)):t.bind(n.proxy),n,o)}function ug(t,n,o,i){let u=i.includes(".")?Zm(o,i):()=>o[i];if(It(t)){const c=n[t];Ne(c)&<(u,c)}else if(Ne(t))lt(u,t.bind(o));else if(rt(t))if($e(t))t.forEach(c=>ug(c,n,o,i));else{const c=Ne(t.handler)?t.handler.bind(o):n[t.handler];Ne(c)&<(u,c,t)}}function dg(t){const n=t.type,{mixins:o,extends:i}=n,{mixins:u,optionsCache:c,config:{optionMergeStrategies:v}}=t.appContext,m=c.get(n);let _;return m?_=m:!u.length&&!o&&!i?_=n:(_={},u.length&&u.forEach(I=>Nu(_,I,v,!0)),Nu(_,n,v)),rt(n)&&c.set(n,_),_}function Nu(t,n,o,i=!1){const{mixins:u,extends:c}=n;c&&Nu(t,c,o,!0),u&&u.forEach(v=>Nu(t,v,o,!0));for(const v in n)if(!(i&&v==="expose")){const m=Gk[v]||o&&o[v];t[v]=m?m(t[v],n[v]):n[v]}return t}const Gk={data:Fp,props:Up,emits:Up,methods:Oi,computed:Oi,beforeCreate:wa,created:wa,beforeMount:wa,mounted:wa,beforeUpdate:wa,updated:wa,beforeDestroy:wa,beforeUnmount:wa,destroyed:wa,unmounted:wa,activated:wa,deactivated:wa,errorCaptured:wa,serverPrefetch:wa,components:Oi,directives:Oi,watch:zk,provide:Fp,inject:Hk};function Fp(t,n){return n?t?function(){return Vt(Ne(t)?t.call(this,this):t,Ne(n)?n.call(this,this):n)}:n:t}function Hk(t,n){return Oi(Yc(t),Yc(n))}function Yc(t){if($e(t)){const n={};for(let o=0;o<t.length;o++)n[t[o]]=t[o];return n}return t}function wa(t,n){return t?[...new Set([].concat(t,n))]:n}function Oi(t,n){return t?Vt(Object.create(null),t,n):n}function Up(t,n){return t?$e(t)&&$e(n)?[...new Set([...t,...n])]:Vt(Object.create(null),Dp(t),Dp(n??{})):n}function zk(t,n){if(!t)return n;if(!n)return t;const o=Vt(Object.create(null),t);for(const i in n)o[i]=wa(t[i],n[i]);return o}function cg(){return{app:null,config:{isNativeTag:Cm,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Qk=0;function Yk(t,n){return function(i,u=null){Ne(i)||(i=Vt({},i)),u!=null&&!rt(u)&&(u=null);const c=cg(),v=new WeakSet,m=[];let _=!1;const I=c.app={_uid:Qk++,_component:i,_props:u,_container:null,_context:c,_instance:null,version:R1,get config(){return c.config},set config(k){},use(k,...M){return v.has(k)||(k&&Ne(k.install)?(v.add(k),k.install(I,...M)):Ne(k)&&(v.add(k),k(I,...M))),I},mixin(k){return c.mixins.includes(k)||c.mixins.push(k),I},component(k,M){return M?(c.components[k]=M,I):c.components[k]},directive(k,M){return M?(c.directives[k]=M,I):c.directives[k]},mount(k,M,q){if(!_){const K=I._ceVNode||Ee(i,u);return K.appContext=c,q===!0?q="svg":q===!1&&(q=void 0),t(K,k,q),_=!0,I._container=k,k.__vue_app__=I,Ju(K.component)}},onUnmount(k){m.push(k)},unmount(){_&&(gn(m,I._instance,16),t(null,I._container),delete I._container.__vue_app__)},provide(k,M){return c.provides[k]=M,I},runWithContext(k){const M=zr;zr=I;try{return k()}finally{zr=M}}};return I}}let zr=null;const Jk=(t,n)=>n==="modelValue"||n==="model-value"?t.modelModifiers:t[`${n}Modifiers`]||t[`${An(n)}Modifiers`]||t[`${To(n)}Modifiers`];function Xk(t,n,...o){if(t.isUnmounted)return;const i=t.vnode.props||ct;let u=o;const c=n.startsWith("update:"),v=c&&Jk(i,n.slice(7));v&&(v.trim&&(u=o.map(k=>It(k)?k.trim():k)),v.number&&(u=o.map(Vu)));let m,_=i[m=hc(n)]||i[m=hc(An(n))];!_&&c&&(_=i[m=hc(To(n))]),_&&gn(_,t,6,u);const I=i[m+"Once"];if(I){if(!t.emitted)t.emitted={};else if(t.emitted[m])return;t.emitted[m]=!0,gn(I,t,6,u)}}const Zk=new WeakMap;function fg(t,n,o=!1){const i=o?Zk:n.emitsCache,u=i.get(t);if(u!==void 0)return u;const c=t.emits;let v={},m=!1;if(!Ne(t)){const _=I=>{const k=fg(I,n,!0);k&&(m=!0,Vt(v,k))};!o&&n.mixins.length&&n.mixins.forEach(_),t.extends&&_(t.extends),t.mixins&&t.mixins.forEach(_)}return!c&&!m?(rt(t)&&i.set(t,null),null):($e(c)?c.forEach(_=>v[_]=null):Vt(v,c),rt(t)&&i.set(t,v),v)}function zu(t,n){return!t||!Fu(n)?!1:(n=n.slice(2),n=n==="Once"?n:n.replace(/Once$/,""),ot(t,n[0].toLowerCase()+n.slice(1))||ot(t,To(n))||ot(t,n))}function Kp(t){const{type:n,vnode:o,proxy:i,withProxy:u,propsOptions:[c],slots:v,attrs:m,emit:_,render:I,renderCache:k,props:M,data:q,setupState:K,ctx:ee,inheritAttrs:j}=t,fe=Eu(t);let ie,V;try{if(o.shapeFlag&4){const X=u||i,ve=X;ie=fl(I.call(ve,X,k,M,K,q,ee)),V=m}else{const X=n;ie=fl(X.length>1?X(M,{attrs:m,slots:v,emit:_}):X(M,null)),V=n.props?m:e1(m)}}catch(X){Gi.length=0,as(X,t,1),ie=Ee(ua)}let _e=ie;if(V&&j!==!1){const X=Object.keys(V),{shapeFlag:ve}=_e;X.length&&ve&7&&(c&&X.some(Uu)&&(V=t1(V,c)),_e=Ao(_e,V,!1,!0))}return o.dirs&&(_e=Ao(_e,null,!1,!0),_e.dirs=_e.dirs?_e.dirs.concat(o.dirs):o.dirs),o.transition&&pr(_e,o.transition),ie=_e,Eu(fe),ie}const e1=t=>{let n;for(const o in t)(o==="class"||o==="style"||Fu(o))&&((n||(n={}))[o]=t[o]);return n},t1=(t,n)=>{const o={};for(const i in t)(!Uu(i)||!(i.slice(9)in n))&&(o[i]=t[i]);return o};function a1(t,n,o){const{props:i,children:u,component:c}=t,{props:v,children:m,patchFlag:_}=n,I=c.emitsOptions;if(n.dirs||n.transition)return!0;if(o&&_>=0){if(_&1024)return!0;if(_&16)return i?Vp(i,v,I):!!v;if(_&8){const k=n.dynamicProps;for(let M=0;M<k.length;M++){const q=k[M];if(vg(v,i,q)&&!zu(I,q))return!0}}}else return(u||m)&&(!m||!m.$stable)?!0:i===v?!1:i?v?Vp(i,v,I):!0:!!v;return!1}function Vp(t,n,o){const i=Object.keys(n);if(i.length!==Object.keys(t).length)return!0;for(let u=0;u<i.length;u++){const c=i[u];if(vg(n,t,c)&&!zu(o,c))return!0}return!1}function vg(t,n,o){const i=t[o],u=n[o];return o==="style"&&rt(i)&&rt(u)?!Mo(i,u):i!==u}function n1({vnode:t,parent:n,suspense:o},i){for(;n;){const u=n.subTree;if(u.suspense&&u.suspense.activeBranch===t&&(u.suspense.vnode.el=u.el=i,t=u),u===t)(t=n.vnode).el=i,n=n.parent;else break}o&&o.activeBranch===t&&(o.vnode.el=i)}const pg={},mg=()=>Object.create(pg),gg=t=>Object.getPrototypeOf(t)===pg;function l1(t,n,o,i=!1){const u={},c=mg();t.propsDefaults=Object.create(null),yg(t,n,u,c);for(const v in t.propsOptions[0])v in u||(u[v]=void 0);o?t.props=i?u:fk(u):t.type.props?t.props=u:t.props=c,t.attrs=c}function o1(t,n,o,i){const{props:u,attrs:c,vnode:{patchFlag:v}}=t,m=et(u),[_]=t.propsOptions;let I=!1;if((i||v>0)&&!(v&16)){if(v&8){const k=t.vnode.dynamicProps;for(let M=0;M<k.length;M++){let q=k[M];if(zu(t.emitsOptions,q))continue;const K=n[q];if(_)if(ot(c,q))K!==c[q]&&(c[q]=K,I=!0);else{const ee=An(q);u[ee]=Jc(_,m,ee,K,t,!1)}else K!==c[q]&&(c[q]=K,I=!0)}}}else{yg(t,n,u,c)&&(I=!0);let k;for(const M in m)(!n||!ot(n,M)&&((k=To(M))===M||!ot(n,k)))&&(_?o&&(o[M]!==void 0||o[k]!==void 0)&&(u[M]=Jc(_,m,M,void 0,t,!0)):delete u[M]);if(c!==m)for(const M in c)(!n||!ot(n,M))&&(delete c[M],I=!0)}I&&Dl(t.attrs,"set","")}function yg(t,n,o,i){const[u,c]=t.propsOptions;let v=!1,m;if(n)for(let _ in n){if(Fi(_))continue;const I=n[_];let k;u&&ot(u,k=An(_))?!c||!c.includes(k)?o[k]=I:(m||(m={}))[k]=I:zu(t.emitsOptions,_)||(!(_ in i)||I!==i[_])&&(i[_]=I,v=!0)}if(c){const _=et(o),I=m||ct;for(let k=0;k<c.length;k++){const M=c[k];o[M]=Jc(u,_,M,I[M],t,!ot(I,M))}}return v}function Jc(t,n,o,i,u,c){const v=t[o];if(v!=null){const m=ot(v,"default");if(m&&i===void 0){const _=v.default;if(v.type!==Function&&!v.skipFactory&&Ne(_)){const{propsDefaults:I}=u;if(o in I)i=I[o];else{const k=os(u);i=I[o]=_.call(null,n),k()}}else i=_;u.ce&&u.ce._setProp(o,i)}v[0]&&(c&&!m?i=!1:v[1]&&(i===""||i===To(o))&&(i=!0))}return i}const r1=new WeakMap;function _g(t,n,o=!1){const i=o?r1:n.propsCache,u=i.get(t);if(u)return u;const c=t.props,v={},m=[];let _=!1;if(!Ne(t)){const k=M=>{_=!0;const[q,K]=_g(M,n,!0);Vt(v,q),K&&m.push(...K)};!o&&n.mixins.length&&n.mixins.forEach(k),t.extends&&k(t.extends),t.mixins&&t.mixins.forEach(k)}if(!c&&!_)return rt(t)&&i.set(t,Vr),Vr;if($e(c))for(let k=0;k<c.length;k++){const M=An(c[k]);jp(M)&&(v[M]=ct)}else if(c)for(const k in c){const M=An(k);if(jp(M)){const q=c[k],K=v[M]=$e(q)||Ne(q)?{type:q}:Vt({},q),ee=K.type;let j=!1,fe=!0;if($e(ee))for(let ie=0;ie<ee.length;++ie){const V=ee[ie],_e=Ne(V)&&V.name;if(_e==="Boolean"){j=!0;break}else _e==="String"&&(fe=!1)}else j=Ne(ee)&&ee.name==="Boolean";K[0]=j,K[1]=fe,(j||ot(K,"default"))&&m.push(M)}}const I=[v,m];return rt(t)&&i.set(t,I),I}function jp(t){return t[0]!=="$"&&!Fi(t)}const wf=t=>t==="_"||t==="_ctx"||t==="$stable",hf=t=>$e(t)?t.map(fl):[fl(t)],i1=(t,n,o)=>{if(n._n)return n;const i=qt((...u)=>hf(n(...u)),o);return i._c=!1,i},bg=(t,n,o)=>{const i=t._ctx;for(const u in t){if(wf(u))continue;const c=t[u];if(Ne(c))n[u]=i1(u,c,i);else if(c!=null){const v=hf(c);n[u]=()=>v}}},wg=(t,n)=>{const o=hf(n);t.slots.default=()=>o},hg=(t,n,o)=>{for(const i in n)(o||!wf(i))&&(t[i]=n[i])},s1=(t,n,o)=>{const i=t.slots=mg();if(t.vnode.shapeFlag&32){const u=n._;u?(hg(i,n,o),o&&xm(i,"_",u,!0)):bg(n,i)}else n&&wg(t,n)},u1=(t,n,o)=>{const{vnode:i,slots:u}=t;let c=!0,v=ct;if(i.shapeFlag&32){const m=n._;m?o&&m===1?c=!1:hg(u,n,o):(c=!n.$stable,bg(n,u)),v=n}else n&&(wg(t,n),v={default:1});if(c)for(const m in u)!wf(m)&&v[m]==null&&delete u[m]},La=p1;function d1(t){return c1(t)}function c1(t,n){const o=ju();o.__VUE__=!0;const{insert:i,remove:u,patchProp:c,createElement:v,createText:m,createComment:_,setText:I,setElementText:k,parentNode:M,nextSibling:q,setScopeId:K=pl,insertStaticContent:ee}=t,j=(C,x,R,D=null,F=null,W=null,H=void 0,Z=null,Q=!!x.dynamicChildren)=>{if(C===x)return;C&&!cr(C,x)&&(D=va(C),zt(C,F,W,!0),C=null),x.patchFlag===-2&&(Q=!1,x.dynamicChildren=null);const{type:U,ref:we,shapeFlag:te}=x;switch(U){case Qu:fe(C,x,R,D);break;case ua:ie(C,x,R,D);break;case Su:C==null&&V(x,R,D,H);break;case z:N(C,x,R,D,F,W,H,Z,Q);break;default:te&1?ve(C,x,R,D,F,W,H,Z,Q):te&6?Se(C,x,R,D,F,W,H,Z,Q):(te&64||te&128)&&U.process(C,x,R,D,F,W,H,Z,Q,L)}we!=null&&F?Vi(we,C&&C.ref,W,x||C,!x):we==null&&C&&C.ref!=null&&Vi(C.ref,null,W,C,!0)},fe=(C,x,R,D)=>{if(C==null)i(x.el=m(x.children),R,D);else{const F=x.el=C.el;x.children!==C.children&&I(F,x.children)}},ie=(C,x,R,D)=>{C==null?i(x.el=_(x.children||""),R,D):x.el=C.el},V=(C,x,R,D)=>{[C.el,C.anchor]=ee(C.children,x,R,D,C.el,C.anchor)},_e=({el:C,anchor:x},R,D)=>{let F;for(;C&&C!==x;)F=q(C),i(C,R,D),C=F;i(x,R,D)},X=({el:C,anchor:x})=>{let R;for(;C&&C!==x;)R=q(C),u(C),C=R;u(x)},ve=(C,x,R,D,F,W,H,Z,Q)=>{if(x.type==="svg"?H="svg":x.type==="math"&&(H="mathml"),C==null)We(x,R,D,F,W,H,Z,Q);else{const U=C.el&&C.el._isVueCE?C.el:null;try{U&&U._beginPatch(),G(C,x,F,W,H,Z,Q)}finally{U&&U._endPatch()}}},We=(C,x,R,D,F,W,H,Z)=>{let Q,U;const{props:we,shapeFlag:te,transition:ye,dirs:Pe}=C;if(Q=C.el=v(C.type,W,we&&we.is,we),te&8?k(Q,C.children):te&16&&de(C.children,Q,null,D,F,xc(C,W),H,Z),Pe&&lr(C,null,D,"created"),Ie(Q,C,C.scopeId,H,D),we){for(const at in we)at!=="value"&&!Fi(at)&&c(Q,at,null,we[at],W,D);"value"in we&&c(Q,"value",null,we.value,W),(U=we.onVnodeBeforeMount)&&il(U,D,C)}Pe&&lr(C,null,D,"beforeMount");const Fe=f1(F,ye);Fe&&ye.beforeEnter(Q),i(Q,x,R),((U=we&&we.onVnodeMounted)||Fe||Pe)&&La(()=>{try{U&&il(U,D,C),Fe&&ye.enter(Q),Pe&&lr(C,null,D,"mounted")}finally{}},F)},Ie=(C,x,R,D,F)=>{if(R&&K(C,R),D)for(let W=0;W<D.length;W++)K(C,D[W]);if(F){let W=F.subTree;if(x===W||Pg(W.type)&&(W.ssContent===x||W.ssFallback===x)){const H=F.vnode;Ie(C,H,H.scopeId,H.slotScopeIds,F.parent)}}},de=(C,x,R,D,F,W,H,Z,Q=0)=>{for(let U=Q;U<C.length;U++){const we=C[U]=Z?ql(C[U]):fl(C[U]);j(null,we,x,R,D,F,W,H,Z)}},G=(C,x,R,D,F,W,H)=>{const Z=x.el=C.el;let{patchFlag:Q,dynamicChildren:U,dirs:we}=x;Q|=C.patchFlag&16;const te=C.props||ct,ye=x.props||ct;let Pe;if(R&&or(R,!1),(Pe=ye.onVnodeBeforeUpdate)&&il(Pe,R,x,C),we&&lr(x,C,R,"beforeUpdate"),R&&or(R,!0),U&&(!C.dynamicChildren||C.dynamicChildren.length!==U.length)&&(Q=0,H=!1,U=null),(te.innerHTML&&ye.innerHTML==null||te.textContent&&ye.textContent==null)&&k(Z,""),U?E(C.dynamicChildren,U,Z,R,D,xc(x,F),W):H||He(C,x,Z,null,R,D,xc(x,F),W,!1),Q>0){if(Q&16)B(Z,te,ye,R,F);else if(Q&2&&te.class!==ye.class&&c(Z,"class",null,ye.class,F),Q&4&&c(Z,"style",te.style,ye.style,F),Q&8){const Fe=x.dynamicProps;for(let at=0;at<Fe.length;at++){const Qe=Fe[at],_t=te[Qe],Tt=ye[Qe];(Tt!==_t||Qe==="value")&&c(Z,Qe,_t,Tt,F,R)}}Q&1&&C.children!==x.children&&k(Z,x.children)}else!H&&U==null&&B(Z,te,ye,R,F);((Pe=ye.onVnodeUpdated)||we)&&La(()=>{Pe&&il(Pe,R,x,C),we&&lr(x,C,R,"updated")},D)},E=(C,x,R,D,F,W,H)=>{for(let Z=0;Z<x.length;Z++){const Q=C[Z],U=x[Z],we=Q.el&&(Q.type===z||!cr(Q,U)||Q.shapeFlag&198)?M(Q.el):R;j(Q,U,we,null,D,F,W,H,!0)}},B=(C,x,R,D,F)=>{if(x!==R){if(x!==ct)for(const W in x)!Fi(W)&&!(W in R)&&c(C,W,x[W],null,F,D);for(const W in R){if(Fi(W))continue;const H=R[W],Z=x[W];H!==Z&&W!=="value"&&c(C,W,Z,H,F,D)}"value"in R&&c(C,"value",x.value,R.value,F)}},N=(C,x,R,D,F,W,H,Z,Q)=>{const U=x.el=C?C.el:m(""),we=x.anchor=C?C.anchor:m("");let{patchFlag:te,dynamicChildren:ye,slotScopeIds:Pe}=x;Pe&&(Z=Z?Z.concat(Pe):Pe),C==null?(i(U,R,D),i(we,R,D),de(x.children||[],R,we,F,W,H,Z,Q)):te>0&&te&64&&ye&&C.dynamicChildren&&C.dynamicChildren.length===ye.length?(E(C.dynamicChildren,ye,R,F,W,H,Z),(x.key!=null||F&&x===F.subTree)&&kg(C,x,!0)):He(C,x,R,we,F,W,H,Z,Q)},Se=(C,x,R,D,F,W,H,Z,Q)=>{x.slotScopeIds=Z,C==null?x.shapeFlag&512?F.ctx.activate(x,R,D,H,Q):st(x,R,D,F,W,H,Q):ht(C,x,Q)},st=(C,x,R,D,F,W,H)=>{const Z=C.component=k1(C,D,F);if(ns(C)&&(Z.ctx.renderer=L),C1(Z,!1,H),Z.asyncDep){if(F&&F.registerDep(Z,Ze,H),!C.el){const Q=Z.subTree=Ee(ua);ie(null,Q,x,R),C.placeholder=Q.el}}else Ze(Z,C,x,R,F,W,H)},ht=(C,x,R)=>{const D=x.component=C.component;if(a1(C,x,R))if(D.asyncDep&&!D.asyncResolved){it(D,x,R);return}else D.next=x,D.update();else x.el=C.el,D.vnode=x},Ze=(C,x,R,D,F,W,H)=>{const Z=()=>{if(C.isMounted){let{next:te,bu:ye,u:Pe,parent:Fe,vnode:at}=C;{const pa=Cg(C);if(pa){te&&(te.el=at.el,it(C,te,H)),pa.asyncDep.then(()=>{La(()=>{C.isUnmounted||U()},F)});return}}let Qe=te,_t;or(C,!1),te?(te.el=at.el,it(C,te,H)):te=at,ye&&Pu(ye),(_t=te.props&&te.props.onVnodeBeforeUpdate)&&il(_t,Fe,te,at),or(C,!0);const Tt=Kp(C),Ca=C.subTree;C.subTree=Tt,j(Ca,Tt,M(Ca.el),va(Ca),C,F,W),te.el=Tt.el,Qe===null&&n1(C,Tt.el),Pe&&La(Pe,F),(_t=te.props&&te.props.onVnodeUpdated)&&La(()=>il(_t,Fe,te,at),F)}else{let te;const{el:ye,props:Pe}=x,{bm:Fe,m:at,parent:Qe,root:_t,type:Tt}=C,Ca=Hr(x);or(C,!1),Fe&&Pu(Fe),!Ca&&(te=Pe&&Pe.onVnodeBeforeMount)&&il(te,Qe,x),or(C,!0);{_t.ce&&_t.ce._hasShadowRoot()&&_t.ce._injectChildStyle(Tt,C.parent?C.parent.type:void 0);const pa=C.subTree=Kp(C);j(null,pa,R,D,C,F,W),x.el=pa.el}if(at&&La(at,F),!Ca&&(te=Pe&&Pe.onVnodeMounted)){const pa=x;La(()=>il(te,Qe,pa),F)}(x.shapeFlag&256||Qe&&Hr(Qe.vnode)&&Qe.vnode.shapeFlag&256)&&C.a&&La(C.a,F),C.isMounted=!0,x=R=D=null}};C.scope.on();const Q=C.effect=new Em(Z);C.scope.off();const U=C.update=Q.run.bind(Q),we=C.job=Q.runIfDirty.bind(Q);we.i=C,we.id=C.uid,Q.scheduler=()=>gf(we),or(C,!0),U()},it=(C,x,R)=>{x.component=C;const D=C.vnode.props;C.vnode=x,C.next=null,o1(C,x.props,D,R),u1(C,x.children,R),ml(),Tp(C),gl()},He=(C,x,R,D,F,W,H,Z,Q=!1)=>{const U=C&&C.children,we=C?C.shapeFlag:0,te=x.children,{patchFlag:ye,shapeFlag:Pe}=x;if(ye>0){if(ye&128){Bn(U,te,R,D,F,W,H,Z,Q);return}else if(ye&256){Ba(U,te,R,D,F,W,H,Z,Q);return}}Pe&8?(we&16&&St(U,F,W),te!==U&&k(R,te)):we&16?Pe&16?Bn(U,te,R,D,F,W,H,Z,Q):St(U,F,W,!0):(we&8&&k(R,""),Pe&16&&de(te,R,D,F,W,H,Z,Q))},Ba=(C,x,R,D,F,W,H,Z,Q)=>{C=C||Vr,x=x||Vr;const U=C.length,we=x.length,te=Math.min(U,we);let ye;for(ye=0;ye<te;ye++){const Pe=x[ye]=Q?ql(x[ye]):fl(x[ye]);j(C[ye],Pe,R,null,F,W,H,Z,Q)}U>we?St(C,F,W,!0,!1,te):de(x,R,D,F,W,H,Z,Q,te)},Bn=(C,x,R,D,F,W,H,Z,Q)=>{let U=0;const we=x.length;let te=C.length-1,ye=we-1;for(;U<=te&&U<=ye;){const Pe=C[U],Fe=x[U]=Q?ql(x[U]):fl(x[U]);if(cr(Pe,Fe))j(Pe,Fe,R,null,F,W,H,Z,Q);else break;U++}for(;U<=te&&U<=ye;){const Pe=C[te],Fe=x[ye]=Q?ql(x[ye]):fl(x[ye]);if(cr(Pe,Fe))j(Pe,Fe,R,null,F,W,H,Z,Q);else break;te--,ye--}if(U>te){if(U<=ye){const Pe=ye+1,Fe=Pe<we?x[Pe].el:D;for(;U<=ye;)j(null,x[U]=Q?ql(x[U]):fl(x[U]),R,Fe,F,W,H,Z,Q),U++}}else if(U>ye)for(;U<=te;)zt(C[U],F,W,!0),U++;else{const Pe=U,Fe=U,at=new Map;for(U=Fe;U<=ye;U++){const Qt=x[U]=Q?ql(x[U]):fl(x[U]);Qt.key!=null&&at.set(Qt.key,U)}let Qe,_t=0;const Tt=ye-Fe+1;let Ca=!1,pa=0;const Ja=new Array(Tt);for(U=0;U<Tt;U++)Ja[U]=0;for(U=Pe;U<=te;U++){const Qt=C[U];if(_t>=Tt){zt(Qt,F,W,!0);continue}let jt;if(Qt.key!=null)jt=at.get(Qt.key);else for(Qe=Fe;Qe<=ye;Qe++)if(Ja[Qe-Fe]===0&&cr(Qt,x[Qe])){jt=Qe;break}jt===void 0?zt(Qt,F,W,!0):(Ja[jt-Fe]=U+1,jt>=pa?pa=jt:Ca=!0,j(Qt,x[jt],R,null,F,W,H,Z,Q),_t++)}const Dn=Ca?v1(Ja):Vr;for(Qe=Dn.length-1,U=Tt-1;U>=0;U--){const Qt=Fe+U,jt=x[Qt],Wn=x[Qt+1],$a=Qt+1<we?Wn.el||$g(Wn):D;Ja[U]===0?j(null,jt,R,$a,F,W,H,Z,Q):Ca&&(Qe<0||U!==Dn[Qe]?ze(jt,R,$a,2):Qe--)}}},ze=(C,x,R,D,F=null)=>{const{el:W,type:H,transition:Z,children:Q,shapeFlag:U}=C;if(U&6){ze(C.component.subTree,x,R,D);return}if(U&128){C.suspense.move(x,R,D);return}if(U&64){H.move(C,x,R,L);return}if(H===z){i(W,x,R);for(let te=0;te<Q.length;te++)ze(Q[te],x,R,D);i(C.anchor,x,R);return}if(H===Su){_e(C,x,R);return}if(D!==2&&U&1&&Z)if(D===0)Z.persisted&&!W[vn]?i(W,x,R):(Z.beforeEnter(W),i(W,x,R),La(()=>Z.enter(W),F));else{const{leave:te,delayLeave:ye,afterLeave:Pe}=Z,Fe=()=>{C.ctx.isUnmounted?u(W):i(W,x,R)},at=()=>{const Qe=W._isLeaving||!!W[vn];W._isLeaving&&W[vn](!0),Z.persisted&&!Qe?Fe():te(W,()=>{Fe(),Pe&&Pe()})};ye?ye(W,Fe,at):at()}else i(W,x,R)},zt=(C,x,R,D=!1,F=!1)=>{const{type:W,props:H,ref:Z,children:Q,dynamicChildren:U,shapeFlag:we,patchFlag:te,dirs:ye,cacheIndex:Pe,memo:Fe}=C;if(te===-2&&(F=!1),Z!=null&&(ml(),Vi(Z,null,R,C,!0),gl()),Pe!=null&&(x.renderCache[Pe]=void 0),we&256){x.ctx.deactivate(C);return}const at=we&1&&ye,Qe=!Hr(C);let _t;if(Qe&&(_t=H&&H.onVnodeBeforeUnmount)&&il(_t,x,C),we&6)No(C.component,R,D);else{if(we&128){C.suspense.unmount(R,D);return}at&&lr(C,null,x,"beforeUnmount"),we&64?C.type.remove(C,x,R,L,D):U&&!U.hasOnce&&(W!==z||te>0&&te&64)?St(U,x,R,!1,!0):(W===z&&te&384||!F&&we&16)&&St(Q,x,R),D&&qn(C)}const Tt=Fe!=null&&Pe==null;(Qe&&(_t=H&&H.onVnodeUnmounted)||at||Tt)&&La(()=>{_t&&il(_t,x,C),at&&lr(C,null,x,"unmounted"),Tt&&(C.el=null)},R)},qn=C=>{const{type:x,el:R,anchor:D,transition:F}=C;if(x===z){Vl(R,D);return}if(x===Su){X(C);return}const W=()=>{u(R),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(C.shapeFlag&1&&F&&!F.persisted){const{leave:H,delayLeave:Z}=F,Q=()=>H(R,W);Z?Z(C.el,W,Q):Q()}else W()},Vl=(C,x)=>{let R;for(;C!==x;)R=q(C),u(C),C=R;u(x)},No=(C,x,R)=>{const{bum:D,scope:F,job:W,subTree:H,um:Z,m:Q,a:U}=C;Gp(Q),Gp(U),D&&Pu(D),F.stop(),W&&(W.flags|=8,zt(H,C,x,R)),Z&&La(Z,x),La(()=>{C.isUnmounted=!0},x)},St=(C,x,R,D=!1,F=!1,W=0)=>{for(let H=W;H<C.length;H++)zt(C[H],x,R,D,F)},va=C=>{if(C.shapeFlag&6)return va(C.component.subTree);if(C.shapeFlag&128)return C.suspense.next();const x=q(C.anchor||C.el),R=x&&x[xk];return R?q(R):x};let On=!1;const ae=(C,x,R)=>{let D;C==null?x._vnode&&(zt(x._vnode,null,null,!0),D=x._vnode.component):j(x._vnode||null,C,x,null,null,null,R),x._vnode=C,On||(On=!0,Tp(D),Qm(),On=!1)},L={p:j,um:zt,m:ze,r:qn,mt:st,mc:de,pc:He,pbc:E,n:va,o:t};return{render:ae,hydrate:void 0,createApp:Yk(ae)}}function xc({type:t,props:n},o){return o==="svg"&&t==="foreignObject"||o==="mathml"&&t==="annotation-xml"&&n&&n.encoding&&n.encoding.includes("html")?void 0:o}function or({effect:t,job:n},o){o?(t.flags|=32,n.flags|=4):(t.flags&=-33,n.flags&=-5)}function f1(t,n){return(!t||t&&!t.pendingBranch)&&n&&!n.persisted}function kg(t,n,o=!1){const i=t.children,u=n.children;if($e(i)&&$e(u))for(let c=0;c<i.length;c++){const v=i[c];let m=u[c];m.shapeFlag&1&&!m.dynamicChildren&&((m.patchFlag<=0||m.patchFlag===32)&&(m=u[c]=ql(u[c]),m.el=v.el),!o&&m.patchFlag!==-2&&kg(v,m)),m.type===Qu&&(m.patchFlag===-1&&(m=u[c]=ql(m)),m.el=v.el),m.type===ua&&!m.el&&(m.el=v.el)}}function v1(t){const n=t.slice(),o=[0];let i,u,c,v,m;const _=t.length;for(i=0;i<_;i++){const I=t[i];if(I!==0){if(u=o[o.length-1],t[u]<I){n[i]=u,o.push(i);continue}for(c=0,v=o.length-1;c<v;)m=c+v>>1,t[o[m]]<I?c=m+1:v=m;I<t[o[c]]&&(c>0&&(n[i]=o[c-1]),o[c]=i)}}for(c=o.length,v=o[c-1];c-- >0;)o[c]=v,v=n[v];return o}function Cg(t){const n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:Cg(n)}function Gp(t){if(t)for(let n=0;n<t.length;n++)t[n].flags|=8}function $g(t){if(t.placeholder)return t.placeholder;const n=t.component;return n?$g(n.subTree):null}const Pg=t=>t.__isSuspense;function p1(t,n){n&&n.pendingBranch?$e(t)?n.effects.push(...t):n.effects.push(t):Ck(t)}const z=Symbol.for("v-fgt"),Qu=Symbol.for("v-txt"),ua=Symbol.for("v-cmt"),Su=Symbol.for("v-stc"),Gi=[];let Ya=null;function y(t=!1){Gi.push(Ya=t?null:[])}function m1(){Gi.pop(),Ya=Gi[Gi.length-1]||null}let Ji=1;function Lu(t,n=!1){Ji+=t,t<0&&Ya&&n&&(Ya.hasOnce=!0)}function Ig(t){return t.dynamicChildren=Ji>0?Ya||Vr:null,m1(),Ji>0&&Ya&&Ya.push(t),t}function w(t,n,o,i,u,c){return Ig(l(t,n,o,i,u,c,!0))}function ut(t,n,o,i,u){return Ig(Ee(t,n,o,i,u,!0))}function Xi(t){return t?t.__v_isVNode===!0:!1}function cr(t,n){return t.type===n.type&&t.key===n.key}const Sg=({key:t})=>t??null,xu=({ref:t,ref_key:n,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?It(t)||fa(t)||Ne(t)?{i:ca,r:t,k:n,f:!!o}:t:null);function l(t,n=null,o=null,i=0,u=null,c=t===z?0:1,v=!1,m=!1){const _={__v_isVNode:!0,__v_skip:!0,type:t,props:n,key:n&&Sg(n),ref:n&&xu(n),scopeId:Jm,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:i,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:ca};return m?(Bu(_,o),c&128&&t.normalize(_)):o&&(_.shapeFlag|=It(o)?8:16),Ji>0&&!v&&Ya&&(_.patchFlag>0||c&6)&&_.patchFlag!==32&&Ya.push(_),_}const Ee=g1;function g1(t,n=null,o=null,i=0,u=null,c=!1){if((!t||t===Uk)&&(t=ua),Xi(t)){const m=Ao(t,n,!0);return o&&Bu(m,o),Ji>0&&!c&&Ya&&(m.shapeFlag&6?Ya[Ya.indexOf(t)]=m:Ya.push(m)),m.patchFlag=-2,m}if(S1(t)&&(t=t.__vccOpts),n){n=y1(n);let{class:m,style:_}=n;m&&!It(m)&&(n.class=oe(m)),rt(_)&&(mf(_)&&!$e(_)&&(_=Vt({},_)),n.style=Kt(_))}const v=It(t)?1:Pg(t)?128:eg(t)?64:rt(t)?4:Ne(t)?2:0;return l(t,n,o,i,u,v,c,!0)}function y1(t){return t?mf(t)||gg(t)?Vt({},t):t:null}function Ao(t,n,o=!1,i=!1){const{props:u,ref:c,patchFlag:v,children:m,transition:_}=t,I=n?b1(u||{},n):u,k={__v_isVNode:!0,__v_skip:!0,type:t.type,props:I,key:I&&Sg(I),ref:n&&n.ref?o&&c?$e(c)?c.concat(xu(n)):[c,xu(n)]:xu(n):c,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:m,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:n&&t.type!==z?v===-1?16:v|16:v,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:_,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ao(t.ssContent),ssFallback:t.ssFallback&&Ao(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return _&&i&&pr(k,_.clone(k)),k}function Bl(t=" ",n=0){return Ee(Qu,null,t,n)}function _1(t,n){const o=Ee(Su,null,t);return o.staticCount=n,o}function ce(t="",n=!1){return n?(y(),ut(ua,null,t)):Ee(ua,null,t)}function fl(t){return t==null||typeof t=="boolean"?Ee(ua):$e(t)?Ee(z,null,t.slice()):Xi(t)?ql(t):Ee(Qu,null,String(t))}function ql(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ao(t)}function Bu(t,n){let o=0;const{shapeFlag:i}=t;if(n==null)n=null;else if($e(n))o=16;else if(typeof n=="object")if(i&65){const u=n.default;u&&(u._c&&(u._d=!1),Bu(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=n._;!u&&!gg(n)?n._ctx=ca:u===3&&ca&&(ca.slots._===1?n._=1:(n._=2,t.patchFlag|=1024))}else if(Ne(n)){if(i&65){Bu(t,{default:n});return}n={default:n,_ctx:ca},o=32}else n=String(n),i&64?(o=16,n=[Bl(n)]):o=8;t.children=n,t.shapeFlag|=o}function b1(...t){const n={};for(let o=0;o<t.length;o++){const i=t[o];for(const u in i)if(u==="class")n.class!==i.class&&(n.class=oe([n.class,i.class]));else if(u==="style")n.style=Kt([n.style,i.style]);else if(Fu(u)){const c=n[u],v=i[u];v&&c!==v&&!($e(c)&&c.includes(v))?n[u]=c?[].concat(c,v):v:v==null&&c==null&&!Uu(u)&&(n[u]=v)}else u!==""&&(n[u]=i[u])}return n}function il(t,n,o,i=null){gn(t,n,7,[o,i])}const w1=cg();let h1=0;function k1(t,n,o){const i=t.type,u=(n?n.appContext:t.appContext)||w1,c={uid:h1++,vnode:t,type:i,parent:n,appContext:u,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Hh(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(u.provides),ids:n?n.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:_g(i,u),emitsOptions:fg(i,u),emit:null,emitted:null,propsDefaults:ct,inheritAttrs:i.inheritAttrs,ctx:ct,data:ct,props:ct,attrs:ct,slots:ct,refs:ct,setupState:ct,setupContext:null,suspense:o,suspenseId:o?o.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return c.ctx={_:c},c.root=n?n.root:c,c.emit=Xk.bind(null,c),t.ce&&t.ce(c),c}let da=null;const Yu=()=>da||ca;let qu,Xc;{const t=ju(),n=(o,i)=>{let u;return(u=t[o])||(u=t[o]=[]),u.push(i),c=>{u.length>1?u.forEach(v=>v(c)):u[0](c)}};qu=n("__VUE_INSTANCE_SETTERS__",o=>da=o),Xc=n("__VUE_SSR_SETTERS__",o=>Yr=o)}const os=t=>{const n=da;return qu(t),t.scope.on(),()=>{t.scope.off(),qu(n)}},Hp=()=>{da&&da.scope.off(),qu(null)};function xg(t){return t.vnode.shapeFlag&4}let Yr=!1;function C1(t,n=!1,o=!1){n&&Xc(n);const{props:i,children:u}=t.vnode,c=xg(t);l1(t,i,c,n),s1(t,u,o||n);const v=c?$1(t,n):void 0;return n&&Xc(!1),v}function $1(t,n){const o=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Kk);const{setup:i}=o;if(i){ml();const u=t.setupContext=i.length>1?I1(t):null,c=os(t),v=ts(i,t,0,[t.props,u]),m=$m(v);if(gl(),c(),(m||t.sp)&&!Hr(t)&&_f(t),m){if(v.then(Hp,Hp),n)return v.then(_=>{zp(t,_)}).catch(_=>{as(_,t,0)});t.asyncDep=v}else zp(t,v)}else Rg(t)}function zp(t,n,o){Ne(n)?t.type.__ssrInlineRender?t.ssrRender=n:t.render=n:rt(n)&&(t.setupState=Gm(n)),Rg(t)}function Rg(t,n,o){const i=t.type;t.render||(t.render=i.render||pl);{const u=os(t);ml();try{Vk(t)}finally{gl(),u()}}}const P1={get(t,n){return ia(t,"get",""),t[n]}};function I1(t){const n=o=>{t.exposed=o||{}};return{attrs:new Proxy(t.attrs,P1),slots:t.slots,emit:t.emit,expose:n}}function Ju(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Gm(vk(t.exposed)),{get(n,o){if(o in n)return n[o];if(o in ji)return ji[o](t)},has(n,o){return o in n||o in ji}})):t.proxy}function S1(t){return Ne(t)&&"__vccOpts"in t}const S=(t,n)=>_k(t,n,Yr);function x1(t,n,o){try{Lu(-1);const i=arguments.length;return i===2?rt(n)&&!$e(n)?Xi(n)?Ee(t,null,[n]):Ee(t,n):Ee(t,null,n):(i>3?o=Array.prototype.slice.call(arguments,2):i===3&&Xi(o)&&(o=[o]),Ee(t,n,o))}finally{Lu(1)}}const R1="3.5.39";/**
|
||
* @vue/runtime-dom v3.5.39
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let Zc;const Qp=typeof window<"u"&&window.trustedTypes;if(Qp)try{Zc=Qp.createPolicy("vue",{createHTML:t=>t})}catch{}const Mg=Zc?t=>Zc.createHTML(t):t=>t,M1="http://www.w3.org/2000/svg",A1="http://www.w3.org/1998/Math/MathML",Nl=typeof document<"u"?document:null,Yp=Nl&&Nl.createElement("template"),E1={insert:(t,n,o)=>{n.insertBefore(t,o||null)},remove:t=>{const n=t.parentNode;n&&n.removeChild(t)},createElement:(t,n,o,i)=>{const u=n==="svg"?Nl.createElementNS(M1,t):n==="mathml"?Nl.createElementNS(A1,t):o?Nl.createElement(t,{is:o}):Nl.createElement(t);return t==="select"&&i&&i.multiple!=null&&u.setAttribute("multiple",i.multiple),u},createText:t=>Nl.createTextNode(t),createComment:t=>Nl.createComment(t),setText:(t,n)=>{t.nodeValue=n},setElementText:(t,n)=>{t.textContent=n},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Nl.querySelector(t),setScopeId(t,n){t.setAttribute(n,"")},insertStaticContent(t,n,o,i,u,c){const v=o?o.previousSibling:n.lastChild;if(u&&(u===c||u.nextSibling))for(;n.insertBefore(u.cloneNode(!0),o),!(u===c||!(u=u.nextSibling)););else{Yp.innerHTML=Mg(i==="svg"?`<svg>${t}</svg>`:i==="mathml"?`<math>${t}</math>`:t);const m=Yp.content;if(i==="svg"||i==="mathml"){const _=m.firstChild;for(;_.firstChild;)m.appendChild(_.firstChild);m.removeChild(_)}n.insertBefore(m,o)}return[v?v.nextSibling:n.firstChild,o?o.previousSibling:n.lastChild]}},Io="transition",Bi="animation",Jr=Symbol("_vtc"),Ag={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Eg=Vt({},ag,Ag),T1=t=>(t.displayName="Transition",t.props=Eg,t),ha=T1((t,{slots:n})=>x1(Mk,Tg(t),n)),rr=(t,n=[])=>{$e(t)?t.forEach(o=>o(...n)):t&&t(...n)},Jp=t=>t?$e(t)?t.some(n=>n.length>1):t.length>1:!1;function Tg(t){const n={};for(const N in t)N in Ag||(n[N]=t[N]);if(t.css===!1)return n;const{name:o="v",type:i,duration:u,enterFromClass:c=`${o}-enter-from`,enterActiveClass:v=`${o}-enter-active`,enterToClass:m=`${o}-enter-to`,appearFromClass:_=c,appearActiveClass:I=v,appearToClass:k=m,leaveFromClass:M=`${o}-leave-from`,leaveActiveClass:q=`${o}-leave-active`,leaveToClass:K=`${o}-leave-to`}=t,ee=N1(u),j=ee&&ee[0],fe=ee&&ee[1],{onBeforeEnter:ie,onEnter:V,onEnterCancelled:_e,onLeave:X,onLeaveCancelled:ve,onBeforeAppear:We=ie,onAppear:Ie=V,onAppearCancelled:de=_e}=n,G=(N,Se,st,ht)=>{N._enterCancelled=ht,So(N,Se?k:m),So(N,Se?I:v),st&&st()},E=(N,Se)=>{N._isLeaving=!1,So(N,M),So(N,K),So(N,q),Se&&Se()},B=N=>(Se,st)=>{const ht=N?Ie:V,Ze=()=>G(Se,N,st);rr(ht,[Se,Ze]),Xp(()=>{So(Se,N?_:c),ul(Se,N?k:m),Jp(ht)||Zp(Se,i,j,Ze)})};return Vt(n,{onBeforeEnter(N){rr(ie,[N]),ul(N,c),ul(N,v)},onBeforeAppear(N){rr(We,[N]),ul(N,_),ul(N,I)},onEnter:B(!1),onAppear:B(!0),onLeave(N,Se){N._isLeaving=!0;const st=()=>E(N,Se);ul(N,M),N._enterCancelled?(ul(N,q),ef(N)):(ef(N),ul(N,q)),Xp(()=>{N._isLeaving&&(So(N,M),ul(N,K),Jp(X)||Zp(N,i,fe,st))}),rr(X,[N,st])},onEnterCancelled(N){G(N,!1,void 0,!0),rr(_e,[N])},onAppearCancelled(N){G(N,!0,void 0,!0),rr(de,[N])},onLeaveCancelled(N){E(N),rr(ve,[N])}})}function N1(t){if(t==null)return null;if(rt(t))return[Rc(t.enter),Rc(t.leave)];{const n=Rc(t);return[n,n]}}function Rc(t){return Dh(t)}function ul(t,n){n.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[Jr]||(t[Jr]=new Set)).add(n)}function So(t,n){n.split(/\s+/).forEach(i=>i&&t.classList.remove(i));const o=t[Jr];o&&(o.delete(n),o.size||(t[Jr]=void 0))}function Xp(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let L1=0;function Zp(t,n,o,i){const u=t._endId=++L1,c=()=>{u===t._endId&&i()};if(o!=null)return setTimeout(c,o);const{type:v,timeout:m,propCount:_}=Ng(t,n);if(!v)return i();const I=v+"end";let k=0;const M=()=>{t.removeEventListener(I,q),c()},q=K=>{K.target===t&&++k>=_&&M()};setTimeout(()=>{k<_&&M()},m+1),t.addEventListener(I,q)}function Ng(t,n){const o=window.getComputedStyle(t),i=ee=>(o[ee]||"").split(", "),u=i(`${Io}Delay`),c=i(`${Io}Duration`),v=em(u,c),m=i(`${Bi}Delay`),_=i(`${Bi}Duration`),I=em(m,_);let k=null,M=0,q=0;n===Io?v>0&&(k=Io,M=v,q=c.length):n===Bi?I>0&&(k=Bi,M=I,q=_.length):(M=Math.max(v,I),k=M>0?v>I?Io:Bi:null,q=k?k===Io?c.length:_.length:0);const K=k===Io&&/\b(?:transform|all)(?:,|$)/.test(i(`${Io}Property`).toString());return{type:k,timeout:M,propCount:q,hasTransform:K}}function em(t,n){for(;t.length<n.length;)t=t.concat(t);return Math.max(...n.map((o,i)=>tm(o)+tm(t[i])))}function tm(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function ef(t){return(t?t.ownerDocument:document).body.offsetHeight}function B1(t,n,o){const i=t[Jr];i&&(n=(n?[n,...i]:[...i]).join(" ")),n==null?t.removeAttribute("class"):o?t.setAttribute("class",n):t.className=n}const am=Symbol("_vod"),Lg=Symbol("_vsh"),q1=Symbol(""),O1=/(?:^|;)\s*display\s*:/;function D1(t,n,o){const i=t.style,u=It(o);let c=!1;if(o&&!u){if(n)if(It(n))for(const v of n.split(";")){const m=v.slice(0,v.indexOf(":")).trim();o[m]==null&&Di(i,m,"")}else for(const v in n)o[v]==null&&Di(i,v,"");for(const v in o){v==="display"&&(c=!0);const m=o[v];m!=null?F1(t,v,!It(n)&&n?n[v]:void 0,m)||Di(i,v,m):Di(i,v,"")}}else if(u){if(n!==o){const v=i[q1];v&&(o+=";"+v),i.cssText=o,c=O1.test(o)}}else n&&t.removeAttribute("style");am in t&&(t[am]=c?i.display:"",t[Lg]&&(i.display="none"))}const nm=/\s*!important$/;function Di(t,n,o){if($e(o))o.forEach(i=>Di(t,n,i));else if(o==null&&(o=""),n.startsWith("--"))t.setProperty(n,o);else{const i=W1(t,n);nm.test(o)?t.setProperty(To(i),o.replace(nm,""),"important"):t[i]=o}}const lm=["Webkit","Moz","ms"],Mc={};function W1(t,n){const o=Mc[n];if(o)return o;let i=An(n);if(i!=="filter"&&i in t)return Mc[n]=i;i=Sm(i);for(let u=0;u<lm.length;u++){const c=lm[u]+i;if(c in t)return Mc[n]=c}return n}function F1(t,n,o,i){return t.tagName==="TEXTAREA"&&(n==="width"||n==="height")&&It(i)&&o===i}const om="http://www.w3.org/1999/xlink";function rm(t,n,o,i,u,c=jh(n)){i&&n.startsWith("xlink:")?o==null?t.removeAttributeNS(om,n.slice(6,n.length)):t.setAttributeNS(om,n,o):o==null||c&&!Rm(o)?t.removeAttribute(n):t.setAttribute(n,c?"":Tn(o)?String(o):o)}function im(t,n,o,i,u){if(n==="innerHTML"||n==="textContent"){o!=null&&(t[n]=n==="innerHTML"?Mg(o):o);return}const c=t.tagName;if(n==="value"&&c!=="PROGRESS"&&!c.includes("-")){const m=c==="OPTION"?t.getAttribute("value")||"":t.value,_=o==null?t.type==="checkbox"?"on":"":String(o);(m!==_||!("_value"in t))&&(t.value=_),o==null&&t.removeAttribute(n),t._value=o;return}let v=!1;if(o===""||o==null){const m=typeof t[n];m==="boolean"?o=Rm(o):o==null&&m==="string"?(o="",v=!0):m==="number"&&(o=0,v=!0)}try{t[n]=o}catch{}v&&t.removeAttribute(u||n)}function Fl(t,n,o,i){t.addEventListener(n,o,i)}function U1(t,n,o,i){t.removeEventListener(n,o,i)}const sm=Symbol("_vei");function K1(t,n,o,i,u=null){const c=t[sm]||(t[sm]={}),v=c[n];if(i&&v)v.value=i;else{const[m,_]=G1(n);if(i){const I=c[n]=Q1(i,u);Fl(t,m,I,_)}else v&&(U1(t,m,v,_),c[n]=void 0)}}const V1=/(Once|Passive|Capture)$/,j1=/^on:?(?:Once|Passive|Capture)$/;function G1(t){let n,o;for(;(o=t.match(V1))&&!j1.test(t);)n||(n={}),t=t.slice(0,t.length-o[1].length),n[o[1].toLowerCase()]=!0;return[t[2]===":"?t.slice(3):To(t.slice(2)),n]}let Ac=0;const H1=Promise.resolve(),z1=()=>Ac||(H1.then(()=>Ac=0),Ac=Date.now());function Q1(t,n){const o=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=o.attached)return;const u=o.value;if($e(u)){const c=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{c.call(i),i._stopped=!0};const v=u.slice(),m=[i];for(let _=0;_<v.length&&!i._stopped;_++){const I=v[_];I&&gn(I,n,5,m)}}else gn(u,n,5,[i])};return o.value=t,o.attached=z1(),o}const um=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Y1=(t,n,o,i,u,c)=>{const v=u==="svg";n==="class"?B1(t,i,v):n==="style"?D1(t,o,i):Fu(n)?Uu(n)||K1(t,n,o,i,c):(n[0]==="."?(n=n.slice(1),!0):n[0]==="^"?(n=n.slice(1),!1):J1(t,n,i,v))?(im(t,n,i),!t.tagName.includes("-")&&(n==="value"||n==="checked"||n==="selected")&&rm(t,n,i,v,c,n!=="value")):t._isVueCE&&(X1(t,n)||t._def.__asyncLoader&&(/[A-Z]/.test(n)||!It(i)))?im(t,An(n),i,c,n):(n==="true-value"?t._trueValue=i:n==="false-value"&&(t._falseValue=i),rm(t,n,i,v))};function J1(t,n,o,i){if(i)return!!(n==="innerHTML"||n==="textContent"||n in t&&um(n)&&Ne(o));if(n==="spellcheck"||n==="draggable"||n==="translate"||n==="autocorrect"||n==="sandbox"&&t.tagName==="IFRAME"||n==="form"||n==="list"&&t.tagName==="INPUT"||n==="type"&&t.tagName==="TEXTAREA")return!1;if(n==="width"||n==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return um(n)&&It(o)?!1:n in t}function X1(t,n){const o=t._def.props;if(!o)return!1;const i=An(n);return Array.isArray(o)?o.some(u=>An(u)===i):Object.keys(o).some(u=>An(u)===i)}const Bg=new WeakMap,qg=new WeakMap,Ou=Symbol("_moveCb"),dm=Symbol("_enterCb"),Z1=t=>(delete t.props.mode,t),e0=Z1({name:"TransitionGroup",props:Vt({},Eg,{tag:String,moveClass:String}),setup(t,{slots:n}){const o=Yu(),i=tg();let u,c;return ig(()=>{if(!u.length)return;const v=t.moveClass||`${t.name||"v"}-move`;if(!l0(u[0].el,o.vnode.el,v)){u=[];return}u.forEach(t0),u.forEach(a0);const m=u.filter(n0);ef(o.vnode.el),m.forEach(_=>{const I=_.el,k=I.style;ul(I,v),k.transform=k.webkitTransform=k.transitionDuration="";const M=I[Ou]=q=>{q&&q.target!==I||(!q||q.propertyName.endsWith("transform"))&&(I.removeEventListener("transitionend",M),I[Ou]=null,So(I,v))};I.addEventListener("transitionend",M)}),u=[]}),()=>{const v=et(t),m=Tg(v);let _=v.tag||z;if(u=[],c)for(let I=0;I<c.length;I++){const k=c[I];k.el&&k.el instanceof Element&&!k.el[Lg]&&(u.push(k),pr(k,Yi(k,m,i,o)),Bg.set(k,Og(k.el)))}c=n.default?yf(n.default()):[];for(let I=0;I<c.length;I++){const k=c[I];k.key!=null&&pr(k,Yi(k,m,i,o))}return Ee(_,null,c)}}}),hu=e0;function t0(t){const n=t.el;n[Ou]&&n[Ou](),n[dm]&&n[dm]()}function a0(t){qg.set(t,Og(t.el))}function n0(t){const n=Bg.get(t),o=qg.get(t),i=n.left-o.left,u=n.top-o.top;if(i||u){const c=t.el,v=c.style,m=c.getBoundingClientRect();let _=1,I=1;return c.offsetWidth&&(_=m.width/c.offsetWidth),c.offsetHeight&&(I=m.height/c.offsetHeight),(!Number.isFinite(_)||_===0)&&(_=1),(!Number.isFinite(I)||I===0)&&(I=1),Math.abs(_-1)<.01&&(_=1),Math.abs(I-1)<.01&&(I=1),v.transform=v.webkitTransform=`translate(${i/_}px,${u/I}px)`,v.transitionDuration="0s",t}}function Og(t){const n=t.getBoundingClientRect();return{left:n.left,top:n.top}}function l0(t,n,o){const i=t.cloneNode(),u=t[Jr];u&&u.forEach(m=>{m.split(/\s+/).forEach(_=>_&&i.classList.remove(_))}),o.split(/\s+/).forEach(m=>m&&i.classList.add(m)),i.style.display="none";const c=n.nodeType===1?n:n.parentNode;c.appendChild(i);const{hasTransform:v}=Ng(i);return c.removeChild(i),v}const Eo=t=>{const n=t.props["onUpdate:modelValue"]||!1;return $e(n)?o=>Pu(n,o):n};function o0(t){t.target.composing=!0}function cm(t){const n=t.target;n.composing&&(n.composing=!1,n.dispatchEvent(new Event("input")))}const mn=Symbol("_assign");function fm(t,n,o){return n&&(t=t.trim()),o&&(t=Vu(t)),t}const Ke={created(t,{modifiers:{lazy:n,trim:o,number:i}},u){t[mn]=Eo(u);const c=i||u.props&&u.props.type==="number";Fl(t,n?"change":"input",v=>{v.target.composing||t[mn](fm(t.value,o,c))}),(o||c)&&Fl(t,"change",()=>{t.value=fm(t.value,o,c)}),n||(Fl(t,"compositionstart",o0),Fl(t,"compositionend",cm),Fl(t,"change",cm))},mounted(t,{value:n}){t.value=n??""},beforeUpdate(t,{value:n,oldValue:o,modifiers:{lazy:i,trim:u,number:c}},v){if(t[mn]=Eo(v),t.composing)return;const m=(c||t.type==="number")&&!/^0\d/.test(t.value)?Vu(t.value):t.value,_=n??"";if(m===_)return;const I=t.getRootNode();(I instanceof Document||I instanceof ShadowRoot)&&I.activeElement===t&&t.type!=="range"&&(i&&n===o||u&&t.value.trim()===_)||(t.value=_)}},vm={deep:!0,created(t,n,o){t[mn]=Eo(o),Fl(t,"change",()=>{const i=t._modelValue,u=Xr(t),c=t.checked,v=t[mn];if($e(i)){const m=rf(i,u),_=m!==-1;if(c&&!_)v(i.concat(u));else if(!c&&_){const I=[...i];I.splice(m,1),v(I)}}else if(ei(i)){const m=new Set(i);c?m.add(u):m.delete(u),v(m)}else v(Dg(t,c))})},mounted:pm,beforeUpdate(t,n,o){t[mn]=Eo(o),pm(t,n,o)}};function pm(t,{value:n,oldValue:o},i){t._modelValue=n;let u;if($e(n))u=rf(n,i.props.value)>-1;else if(ei(n))u=n.has(i.props.value);else{if(n===o)return;u=Mo(n,Dg(t,!0))}t.checked!==u&&(t.checked=u)}const $M={created(t,{value:n},o){t.checked=Mo(n,o.props.value),t[mn]=Eo(o),Fl(t,"change",()=>{t[mn](Xr(t))})},beforeUpdate(t,{value:n,oldValue:o},i){t[mn]=Eo(i),n!==o&&(t.checked=Mo(n,i.props.value))}},Mn={deep:!0,created(t,{value:n,modifiers:{number:o}},i){const u=ei(n);Fl(t,"change",()=>{const c=Array.prototype.filter.call(t.options,v=>v.selected).map(v=>o?Vu(Xr(v)):Xr(v));t[mn](t.multiple?u?new Set(c):c:c[0]),t._assigning=!0,Ht(()=>{t._assigning=!1})}),t[mn]=Eo(i)},mounted(t,{value:n}){mm(t,n)},beforeUpdate(t,n,o){t[mn]=Eo(o)},updated(t,{value:n}){t._assigning||mm(t,n)}};function mm(t,n){const o=t.multiple,i=$e(n);if(!(o&&!i&&!ei(n))){for(let u=0,c=t.options.length;u<c;u++){const v=t.options[u],m=Xr(v);if(o)if(i){const _=typeof m;_==="string"||_==="number"?v.selected=n.some(I=>String(I)===String(m)):v.selected=rf(n,m)>-1}else v.selected=n.has(m);else if(Mo(Xr(v),n)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Xr(t){return"_value"in t?t._value:t.value}function Dg(t,n){const o=n?"_trueValue":"_falseValue";return o in t?t[o]:n}const r0=["ctrl","shift","alt","meta"],i0={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,n)=>r0.some(o=>t[`${o}Key`]&&!n.includes(o))},Ot=(t,n)=>{if(!t)return t;const o=t._withMods||(t._withMods={}),i=n.join(".");return o[i]||(o[i]=((u,...c)=>{for(let v=0;v<n.length;v++){const m=i0[n[v]];if(m&&m(u,n))return}return t(u,...c)}))},s0={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ol=(t,n)=>{const o=t._withKeys||(t._withKeys={}),i=n.join(".");return o[i]||(o[i]=(u=>{if(!("key"in u))return;const c=To(u.key);if(n.some(v=>v===c||s0[v]===c))return t(u)}))},u0=Vt({patchProp:Y1},E1);let gm;function d0(){return gm||(gm=d1(u0))}const c0=((...t)=>{const n=d0().createApp(...t),{mount:o}=n;return n.mount=i=>{const u=v0(i);if(!u)return;const c=n._component;!Ne(c)&&!c.render&&!c.template&&(c.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const v=o(u,!1,f0(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),v},n});function f0(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function v0(t){return It(t)?document.querySelector(t):t}const p0="modulepreload",m0=function(t){return"/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/"+t},ym={},za=function(n,o,i){let u=Promise.resolve();if(o&&o.length>0){let v=function(I){return Promise.all(I.map(k=>Promise.resolve(k).then(M=>({status:"fulfilled",value:M}),M=>({status:"rejected",reason:M}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),_=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));u=v(o.map(I=>{if(I=m0(I),I in ym)return;ym[I]=!0;const k=I.endsWith(".css"),M=k?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${I}"]${M}`))return;const q=document.createElement("link");if(q.rel=k?"stylesheet":p0,k||(q.as="script"),q.crossOrigin="",q.href=I,_&&q.setAttribute("nonce",_),document.head.appendChild(q),k)return new Promise((K,ee)=>{q.addEventListener("load",K),q.addEventListener("error",()=>ee(new Error(`Unable to preload CSS for ${I}`)))})}))}function c(v){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=v,window.dispatchEvent(m),!m.defaultPrevented)throw v}return u.then(v=>{for(const m of v||[])m.status==="rejected"&&c(m.reason);return n().catch(c)})},g0=["data-expanded","data-pinned"],y0={class:"brand"},_0={class:"brand-copy"},b0={class:"icon-nav","aria-label":"工作台页面"},w0={class:"nav-scroll"},h0={class:"nav-group-label"},k0={class:"nav-group-items"},C0=["title","aria-label","aria-current","onClick"],$0={class:"nav-glyph","aria-hidden":"true"},P0={class:"nav-copy"},I0={class:"nav-label"},S0=["aria-pressed","title"],x0={"aria-hidden":"true"},R0={class:"rail-pin-label"},M0=Ln({__name:"AppNavigationRail",props:{items:{},activeKey:{},pluginVersion:{},expanded:{type:Boolean},pinned:{type:Boolean}},emits:["select","reveal","scheduleHide","togglePinned"],setup(t,{emit:n}){const o=t,i=n;function u(){o.pinned||i("scheduleHide")}const c=[{key:"workspace",label:"工作台"},{key:"assets",label:"资产"},{key:"system",label:"系统"}],v=S(()=>c.map(m=>({...m,items:o.items.filter(_=>_.group===m.key)})).filter(m=>m.items.length));return(m,_)=>(y(),w("aside",{class:"rail","aria-label":"ImageStudio navigation","data-expanded":o.expanded,"data-pinned":o.pinned,onMouseenter:_[1]||(_[1]=I=>i("reveal")),onMouseleave:u,onFocusin:_[2]||(_[2]=I=>i("reveal")),onFocusout:u},[l("div",y0,[_[4]||(_[4]=l("span",{class:"brand-mark"},"IS",-1)),l("div",_0,[_[3]||(_[3]=l("strong",null,"ImageStudio",-1)),l("small",null,"角色与生成工作台 · "+g(o.pluginVersion||"v3"),1)])]),l("nav",b0,[l("div",w0,[(y(!0),w(z,null,ue(v.value,I=>(y(),w("section",{key:I.key,class:"nav-group"},[l("span",h0,g(I.label),1),l("div",k0,[(y(!0),w(z,null,ue(I.items,k=>(y(),w("button",{key:k.key,type:"button",class:oe({active:o.activeKey===k.key}),title:`${k.label}:${k.description}`,"aria-label":k.label,"aria-current":o.activeKey===k.key?"page":void 0,onClick:M=>i("select",k)},[l("span",$0,g(k.icon),1),l("span",P0,[l("strong",I0,g(k.label),1),l("small",null,g(k.description),1)])],10,C0))),128))])]))),128))])]),l("button",{type:"button",class:oe(["rail-pin",{active:o.pinned}]),"aria-pressed":o.pinned,title:o.pinned?"切换为自动收起导航":"固定展开导航",onClick:_[0]||(_[0]=I=>i("togglePinned"))},[l("span",x0,g(o.pinned?"●":"○"),1),l("span",R0,g(o.pinned?"取消固定":"固定导航"),1)],10,S0)],40,g0))}});function rs(t,n=()=>!0){let o;function i(m){o=void 0,!(m.button!==0||m.target!==m.currentTarget)&&(o={pointerId:m.pointerId,x:m.clientX,y:m.clientY,moved:!1})}function u(m){!o||o.pointerId!==m.pointerId||o.moved||Math.hypot(m.clientX-o.x,m.clientY-o.y)>6&&(o.moved=!0)}function c(m){const _=o;if(o=void 0,!_||_.pointerId!==m.pointerId||_.moved||m.target!==m.currentTarget||!n())return;const I=window.getSelection();I&&!I.isCollapsed||t()}function v(){o=void 0}return{pointerDown:i,pointerMove:u,pointerUp:c,pointerCancel:v}}const A0=["onKeydown"],E0=["aria-busy"],T0={class:"confirm-dialog-eyebrow"},N0=["disabled"],L0=["disabled"],B0=Ln({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},detail:{},confirmLabel:{},cancelLabel:{default:"取消"},busy:{type:Boolean},danger:{type:Boolean}},emits:["confirm","cancel"],setup(t,{emit:n}){const o=t,i=n,u=Ak(),c=`${u}-title`,v=`${u}-detail`,m=P(null),_=P(null);let I=null;function k(){o.busy||i("cancel")}function M(){o.busy||i("confirm")}const q=rs(k,()=>!o.busy);function K(){var fe;return Array.from(((fe=m.value)==null?void 0:fe.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(ie=>!ie.hasAttribute("hidden"))}function ee(fe){var ve,We,Ie;if(fe.key!=="Tab")return;const ie=K();if(!ie.length){fe.preventDefault(),(ve=m.value)==null||ve.focus();return}const V=ie[0],_e=ie[ie.length-1],X=document.activeElement;fe.shiftKey&&(X===V||!((We=m.value)!=null&&We.contains(X)))?(fe.preventDefault(),_e.focus()):!fe.shiftKey&&(X===_e||!((Ie=m.value)!=null&&Ie.contains(X)))&&(fe.preventDefault(),V.focus())}function j(){const fe=I;I=null,fe!=null&&fe.isConnected&&fe.focus()}return lt(()=>o.open,(fe,ie)=>{fe?(I=document.activeElement instanceof HTMLElement?document.activeElement:null,Ht(()=>{var V;return(V=_.value)==null?void 0:V.focus()})):ie&&Ht(j)},{immediate:!0}),ti(j),(fe,ie)=>(y(),ut(ha,{name:"confirm-dialog-fade"},{default:qt(()=>[o.open?(y(),w("div",{key:0,class:"confirm-dialog-backdrop",role:"presentation",onPointerdown:ie[0]||(ie[0]=(...V)=>ne(q).pointerDown&&ne(q).pointerDown(...V)),onPointermove:ie[1]||(ie[1]=(...V)=>ne(q).pointerMove&&ne(q).pointerMove(...V)),onPointerup:ie[2]||(ie[2]=(...V)=>ne(q).pointerUp&&ne(q).pointerUp(...V)),onPointercancel:ie[3]||(ie[3]=(...V)=>ne(q).pointerCancel&&ne(q).pointerCancel(...V)),onKeydown:Ol(Ot(k,["stop","prevent"]),["esc"])},[l("section",{ref_key:"dialogRef",ref:m,class:oe(["confirm-dialog-card",{danger:o.danger}]),role:"dialog","aria-modal":"true","aria-labelledby":c,"aria-describedby":v,"aria-busy":o.busy,tabindex:"-1",onKeydown:ee},[l("span",T0,g(o.danger?"危险操作":"确认操作"),1),l("h2",{id:c},g(o.title),1),l("p",{id:v},g(o.detail),1),l("footer",null,[l("button",{ref_key:"cancelButton",ref:_,type:"button",disabled:o.busy,onClick:k},g(o.cancelLabel),9,N0),l("button",{type:"button",class:"confirm-dialog-submit",disabled:o.busy,onClick:M},g(o.busy?"处理中…":o.confirmLabel),9,L0)])],42,E0)],40,A0)):ce("",!0)]),_:1}))}}),ai=(t,n)=>{const o=t.__vccOpts||t;for(const[i,u]of n)o[i]=u;return o},q0=ai(B0,[["__scopeId","data-v-66c20184"]]),O0={class:"empty-state",role:"status","aria-live":"polite"},D0={key:0,class:"empty-state-actions"},W0=Ln({__name:"EmptyState",props:{title:{},detail:{}},setup(t){return(n,o)=>(y(),w("section",O0,[l("strong",null,g(t.title),1),l("span",null,g(t.detail),1),n.$slots.actions||n.$slots.default?(y(),w("div",D0,[Op(n.$slots,"actions",{},()=>[Op(n.$slots,"default",{},void 0,!0)])])):ce("",!0)]))}}),Ec=ai(W0,[["__scopeId","data-v-6a09d442"]]),F0=["aria-label"],U0={class:"image-viewer-actions"},K0={"aria-live":"polite"},V0=["src","alt"],j0=.5,G0=4,_m=.12,bm=.15,H0=2.2,z0=Ln({__name:"ImagePreviewDialog",props:{open:{type:Boolean},title:{},src:{}},emits:["close"],setup(t,{emit:n}){const o=t,i=n,u=P(1),c=P({x:0,y:0}),v=P(!1),m=P({pointerId:-1,x:0,y:0,offsetX:0,offsetY:0}),_=P(null);let I=null;const k=S(()=>`${Math.round(u.value*100)}%`),M=S(()=>`translate3d(${c.value.x}px, ${c.value.y}px, 0) scale(${u.value})`);lt(()=>[o.open,o.src],([E])=>{ee(),E?(I=document.activeElement instanceof HTMLElement?document.activeElement:null,Ht(()=>{var B;return(B=ve()[0])==null?void 0:B.focus()})):Ht(Ie)},{immediate:!0}),ls(()=>window.addEventListener("keydown",de)),ti(()=>window.removeEventListener("keydown",de));function q(){v.value=!1,i("close")}const K=rs(q);function ee(){u.value=1,c.value={x:0,y:0},v.value=!1,m.value={pointerId:-1,x:0,y:0,offsetX:0,offsetY:0}}function j(E){u.value=G(Number((u.value+E).toFixed(2)),j0,G0),u.value<=1&&(c.value={x:0,y:0})}function fe(E){j(E.deltaY<0?_m:-_m)}function ie(){if(u.value>1){ee();return}u.value=H0,c.value={x:0,y:0}}function V(E){u.value<=1||(v.value=!0,m.value={pointerId:E.pointerId,x:E.clientX,y:E.clientY,offsetX:c.value.x,offsetY:c.value.y},E.currentTarget instanceof HTMLElement&&E.currentTarget.setPointerCapture(E.pointerId))}function _e(E){!v.value||E.pointerId!==m.value.pointerId||(c.value={x:m.value.offsetX+E.clientX-m.value.x,y:m.value.offsetY+E.clientY-m.value.y})}function X(E){!v.value||E.pointerId!==m.value.pointerId||(v.value=!1,E.currentTarget instanceof HTMLElement&&E.currentTarget.hasPointerCapture(E.pointerId)&&E.currentTarget.releasePointerCapture(E.pointerId))}function ve(){var E;return Array.from(((E=_.value)==null?void 0:E.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(B=>!B.hasAttribute("hidden"))}function We(E){var st;if(E.key!=="Tab")return;const B=ve();if(!B.length){E.preventDefault(),(st=_.value)==null||st.focus();return}const N=B[0],Se=B[B.length-1];E.shiftKey&&document.activeElement===N?(E.preventDefault(),Se.focus()):!E.shiftKey&&document.activeElement===Se&&(E.preventDefault(),N.focus())}function Ie(){const E=I;I=null,E!=null&&E.isConnected&&E.focus()}function de(E){o.open&&E.key==="Escape"&&q()}function G(E,B,N){return Math.max(B,Math.min(N,E))}return(E,B)=>(y(),ut(ha,{name:"viewer-fade"},{default:qt(()=>[t.open?(y(),w("div",{key:0,class:"image-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":`${t.title||"图片"}预览`,onPointerdown:B[2]||(B[2]=(...N)=>ne(K).pointerDown&&ne(K).pointerDown(...N)),onPointermove:B[3]||(B[3]=(...N)=>ne(K).pointerMove&&ne(K).pointerMove(...N)),onPointerup:B[4]||(B[4]=(...N)=>ne(K).pointerUp&&ne(K).pointerUp(...N)),onPointercancel:B[5]||(B[5]=(...N)=>ne(K).pointerCancel&&ne(K).pointerCancel(...N)),onWheel:Ot(fe,["prevent"])},[l("section",{ref_key:"dialogRef",ref:_,class:"image-viewer-card","data-overlay-root":"imageViewer",tabindex:"-1",onKeydown:We},[l("header",null,[l("div",null,[B[6]||(B[6]=l("span",null,"图片预览",-1)),l("strong",null,g(t.title||"未命名图片"),1)]),l("div",U0,[l("button",{type:"button",title:"缩小","aria-label":"缩小",onClick:B[0]||(B[0]=N=>j(-bm))},"-"),l("span",K0,g(k.value),1),l("button",{type:"button",title:"放大","aria-label":"放大",onClick:B[1]||(B[1]=N=>j(bm))},"+"),l("button",{type:"button",title:"重置",onClick:ee},"重置"),l("button",{type:"button",title:"关闭",onClick:q},"关闭")])]),l("div",{class:oe(["image-viewer-stage",{dragging:v.value}]),onDblclick:ie,onPointerdown:V,onPointermove:_e,onPointerup:X,onPointercancel:X,onPointerleave:X},[t.src?(y(),w("img",{key:0,src:t.src,alt:t.title||"图片预览",style:Kt({transform:M.value}),draggable:"false"},null,12,V0)):ce("",!0)],34)],544)],40,F0)):ce("",!0)]),_:1}))}}),Q0=ai(z0,[["__scopeId","data-v-62786811"]]),Y0=["onKeydown"],J0={id:"material-category-create-title"},X0=["disabled"],Z0={class:"materials-category-create-body"},eC=["value","placeholder"],tC=["value"],aC={key:0,class:"materials-category-create-error",role:"alert"},nC=["disabled"],lC=["disabled"],oC=Ln({__name:"MaterialCategoryCreateDialog",props:{open:{type:Boolean},title:{},isAccessoryGroup:{type:Boolean},parentLabel:{},endpointLabel:{},busy:{type:Boolean},error:{},draftName:{},draftNote:{}},emits:["update:draftName","update:draftNote","submit","close"],setup(t,{emit:n}){const o=t,i=n,u=P(null);lt(()=>o.open,k=>{k&&Ht(()=>{var M,q;(M=u.value)==null||M.focus(),(q=u.value)==null||q.select()})},{immediate:!0});function c(){o.busy||i("close")}const v=rs(c,()=>!o.busy);function m(k){i("update:draftName",k.target.value)}function _(k){i("update:draftNote",k.target.value)}function I(){!o.busy&&o.draftName.trim()&&i("submit")}return(k,M)=>(y(),ut(ha,{name:"viewer-fade"},{default:qt(()=>[o.open?(y(),w("div",{key:0,class:"image-viewer-backdrop materials-category-create-backdrop","data-overlay-root":"materialCategoryCreate",role:"presentation",onPointerdown:M[0]||(M[0]=(...q)=>ne(v).pointerDown&&ne(v).pointerDown(...q)),onPointermove:M[1]||(M[1]=(...q)=>ne(v).pointerMove&&ne(v).pointerMove(...q)),onPointerup:M[2]||(M[2]=(...q)=>ne(v).pointerUp&&ne(v).pointerUp(...q)),onPointercancel:M[3]||(M[3]=(...q)=>ne(v).pointerCancel&&ne(v).pointerCancel(...q)),onKeydown:Ol(Ot(c,["stop","prevent"]),["esc"])},[l("form",{class:"materials-category-create-card","data-overlay-root":"materialCategoryCreate",role:"dialog","aria-modal":"true","aria-labelledby":"material-category-create-title",onSubmit:Ot(I,["prevent"])},[l("header",null,[l("div",null,[M[4]||(M[4]=l("span",null,"素材分类",-1)),l("strong",J0,g(o.title),1)]),l("button",{type:"button",title:"关闭",disabled:o.busy,onClick:c},"×",8,X0)]),l("section",Z0,[l("label",null,[M[5]||(M[5]=l("span",null,"分类名称",-1)),l("input",{ref_key:"nameInput",ref:u,"data-material-category-name":"",type:"text",maxlength:"24",value:o.draftName,placeholder:o.isAccessoryGroup?"例如:头饰、眼镜、武器":"例如:场景、动作、道具",onInput:m},null,40,eC)]),l("label",null,[M[6]||(M[6]=l("span",null,"备注",-1)),l("textarea",{rows:"4",maxlength:"120",value:o.draftNote,placeholder:"可选,写给后端或团队看的分类说明。",onInput:_},null,40,tC)]),l("dl",null,[l("div",null,[M[7]||(M[7]=l("dt",null,"创建类型",-1)),l("dd",null,g(o.isAccessoryGroup?"配饰子类":"素材主分类"),1)]),l("div",null,[M[8]||(M[8]=l("dt",null,"父级分类",-1)),l("dd",null,g(o.parentLabel),1)]),l("div",null,[M[9]||(M[9]=l("dt",null,"后端接口",-1)),l("dd",null,g(o.endpointLabel),1)])])]),o.error?(y(),w("p",aC,g(o.error),1)):ce("",!0),l("footer",null,[l("button",{type:"button",disabled:o.busy,onClick:c},"取消",8,nC),l("button",{type:"submit",disabled:!o.draftName.trim()||o.busy},g(o.busy?"创建中":"确认添加"),9,lC)])],32)],40,Y0)):ce("",!0)]),_:1}))}}),kf=[{value:"global_style",label:"全局风格"},{value:"background",label:"背景场景"},{value:"pose",label:"姿势动作"},{value:"identity",label:"角色身份"},{value:"head",label:"头部"},{value:"hair",label:"头发"},{value:"face",label:"面部"},{value:"ears",label:"耳部"},{value:"neck",label:"颈部"},{value:"upper_body",label:"上半身"},{value:"arms",label:"手臂"},{value:"hands",label:"手部"},{value:"waist",label:"腰部"},{value:"hips",label:"胯部"},{value:"upper_legs",label:"大腿"},{value:"lower_legs",label:"小腿"},{value:"feet",label:"脚部"}],rC=new Map(kf.map(t=>[t.value,t.label]));function iC(t){const n=String(t??"").trim();return rC.get(n)??n}const sC=new Map([["top","上装"],["bottom","下装"],["dress","连衣裙"],["shoes","鞋履"],["accessory","配饰"],["style","风格"],["composition","构图"],["outfit","服装"]]);function Tc(t){const n=String(t??"").trim();return sC.get(n.toLowerCase())??n}const uC=["onKeydown"],dC=["aria-label"],cC={class:"materials-detail-card-preview"},fC=["src","alt"],vC={key:1,class:"material-preview-empty"},pC={key:0,class:"detail-tabs","aria-label":"素材结构详情"},mC={key:1},gC={key:2,class:"structured-panel"},yC={key:3,class:"structured-panel"},_C={class:"profile-editor"},bC={class:"wide"},wC={class:"check"},hC={class:"check"},kC={class:"advanced-editor"},CC={key:0},$C={class:"profile-badges"},PC={key:4,class:"structured-panel"},IC={key:5,class:"structured-panel"},SC={key:0},xC=Ln({__name:"MaterialDetailDialog",props:{open:{type:Boolean},item:{},rows:{},material:{}},emits:["close","saveProfile"],setup(t,{emit:n}){const o=t,i=n,u=P(null),c=P("summary"),v=S(()=>{var E,B;return ve((B=(E=o.material)==null?void 0:E.metadata)==null?void 0:B.raw_analysis)}),m=S(()=>{var E,B;return ve((B=(E=o.material)==null?void 0:E.metadata)==null?void 0:B.normalized_asset_profile)}),_=S(()=>{var E,B;return ve((B=(E=o.material)==null?void 0:E.metadata)==null?void 0:B.generation_capsules)}),I=S(()=>{var E,B,N,Se;return Array.isArray((B=(E=o.material)==null?void 0:E.metadata)==null?void 0:B.material_schema_history)?(Se=(N=o.material)==null?void 0:N.metadata)==null?void 0:Se.material_schema_history:[]}),k=P("other"),M=P("other"),q=P(""),K=P(""),ee=P(0),j=P(!1),fe=P(!1),ie=P(""),V=P("");lt(()=>o.open,E=>{E&&(c.value="summary",Ht(()=>{var B;return(B=u.value)==null?void 0:B.focus()}))},{immediate:!0}),lt(m,E=>{k.value=String(E.category||"other"),M.value=String(E.role||"other"),q.value=Array.isArray(E.body_slots)?E.body_slots.map(String).join(", "):"",K.value=String(E.wear_layer||""),ee.value=Number(E.confidence||0),j.value=E.user_locked===!0,fe.value=E.stackable===!0,ie.value=Ie(E),V.value=""},{immediate:!0});function _e(){i("close")}const X=rs(_e);function ve(E){return E&&typeof E=="object"&&!Array.isArray(E)?E:{}}function We(E){return Array.isArray(E)?E.map(String):[]}function Ie(E){return JSON.stringify(E??{},null,2)}function de(){i("saveProfile",{...m.value,category:k.value,role:M.value,body_slots:q.value.split(/[,,]/).map(E=>E.trim()).filter(Boolean),wear_layer:K.value||null,confidence:Math.min(Math.max(ee.value,0),1),user_locked:j.value,stackable:fe.value,confirmed:!0})}function G(){try{const E=JSON.parse(ie.value);if(!E||typeof E!="object"||Array.isArray(E))throw new Error("必须是 JSON 对象");V.value="",i("saveProfile",E)}catch(E){V.value=E instanceof Error?E.message:String(E)}}return(E,B)=>(y(),ut(ha,{name:"viewer-fade"},{default:qt(()=>[o.open&&o.item?(y(),w("div",{key:0,class:"image-viewer-backdrop materials-detail-backdrop","data-overlay-root":"materialDetail",role:"presentation",onPointerdown:B[13]||(B[13]=(...N)=>ne(X).pointerDown&&ne(X).pointerDown(...N)),onPointermove:B[14]||(B[14]=(...N)=>ne(X).pointerMove&&ne(X).pointerMove(...N)),onPointerup:B[15]||(B[15]=(...N)=>ne(X).pointerUp&&ne(X).pointerUp(...N)),onPointercancel:B[16]||(B[16]=(...N)=>ne(X).pointerCancel&&ne(X).pointerCancel(...N)),onKeydown:Ol(Ot(_e,["stop","prevent"]),["esc"])},[l("section",{class:"materials-detail-card","data-overlay-root":"materialDetail",role:"dialog","aria-modal":"true","aria-label":`${o.item.label} 素材详情`},[l("figure",cC,[o.item.imageUrl?(y(),w("img",{key:0,src:o.item.imageUrl,alt:o.item.label},null,8,fC)):(y(),w("span",vC,"无缩略图")),l("figcaption",null,[l("span",null,g([o.item.category,o.item.subcategory].filter(Boolean).join(" / ")),1),l("strong",null,g(o.item.label),1)])]),l("aside",{class:oe(["materials-detail-card-info",{"has-tabs":o.material}])},[l("header",null,[l("div",null,[B[17]||(B[17]=l("span",null,"后端素材库",-1)),l("strong",null,g(o.item.label)+" / 素材详情",1)]),l("button",{ref_key:"closeButton",ref:u,type:"button",title:"关闭",onClick:_e},"×",512)]),o.material?(y(),w("nav",pC,[l("button",{class:oe({active:c.value==="summary"}),onClick:B[0]||(B[0]=N=>c.value="summary")},"基础信息",2),l("button",{class:oe({active:c.value==="raw"}),onClick:B[1]||(B[1]=N=>c.value="raw")},"原始识别",2),l("button",{class:oe({active:c.value==="profile"}),onClick:B[2]||(B[2]=N=>c.value="profile")},"标准属性",2),l("button",{class:oe({active:c.value==="capsules"}),onClick:B[3]||(B[3]=N=>c.value="capsules")},"生图胶囊",2),l("button",{class:oe({active:c.value==="history"}),onClick:B[4]||(B[4]=N=>c.value="history")},"版本历史",2)])):ce("",!0),c.value==="summary"?(y(),w("dl",mC,[(y(!0),w(z,null,ue(o.rows,N=>(y(),w("div",{key:N.label},[l("dt",null,g(N.label),1),l("dd",null,g(N.value),1)]))),128))])):c.value==="raw"?(y(),w("section",gC,[l("header",null,[B[18]||(B[18]=l("strong",null,"RawAnalysis",-1)),l("span",null,g(String(v.value.schema_version||"Legacy")),1)]),B[19]||(B[19]=l("p",null,"保留视觉模型完整结构化返回、属性来源和置信度,便于重新标准化。",-1)),l("pre",null,g(Ie(v.value)),1)])):c.value==="profile"?(y(),w("section",yC,[l("header",null,[B[20]||(B[20]=l("strong",null,"NormalizedAssetProfile",-1)),l("span",null,g(String(m.value.category||"other")),1)]),l("div",_C,[l("label",null,[B[21]||(B[21]=l("span",null,"标准分类",-1)),xe(l("select",{"onUpdate:modelValue":B[5]||(B[5]=N=>k.value=N)},[(y(),w(z,null,ue(["identity","hair","headwear","face_accessory","jewelry","top","bottom","dress","suit","outerwear","underwear","hosiery","footwear","prop","pose","background","style","other"],N=>l("option",{key:N},g(N),1)),64))],512),[[Mn,k.value]])]),l("label",null,[B[22]||(B[22]=l("span",null,"角色",-1)),xe(l("select",{"onUpdate:modelValue":B[6]||(B[6]=N=>M.value=N)},[(y(),w(z,null,ue(["identity","garment","accessory","prop","pose","background","style","other"],N=>l("option",{key:N},g(N),1)),64))],512),[[Mn,M.value]])]),l("label",bC,[B[23]||(B[23]=l("span",null,"身体槽位(逗号分隔)",-1)),xe(l("input",{"onUpdate:modelValue":B[7]||(B[7]=N=>q.value=N)},null,512),[[Ke,q.value]])]),l("label",null,[B[25]||(B[25]=l("span",null,"穿着层级",-1)),xe(l("select",{"onUpdate:modelValue":B[8]||(B[8]=N=>K.value=N)},[B[24]||(B[24]=l("option",{value:""},"无",-1)),(y(),w(z,null,ue(["skin","inner","base","middle","outer","overlay","accessory","prop"],N=>l("option",{key:N},g(N),1)),64))],512),[[Mn,K.value]])]),l("label",null,[B[26]||(B[26]=l("span",null,"总体置信度",-1)),xe(l("input",{"onUpdate:modelValue":B[9]||(B[9]=N=>ee.value=N),type:"number",min:"0",max:"1",step:"0.01"},null,512),[[Ke,ee.value,void 0,{number:!0}]])]),l("label",wC,[xe(l("input",{"onUpdate:modelValue":B[10]||(B[10]=N=>j.value=N),type:"checkbox"},null,512),[[vm,j.value]]),B[27]||(B[27]=Bl(" 锁定人工修正",-1))]),l("label",hC,[xe(l("input",{"onUpdate:modelValue":B[11]||(B[11]=N=>fe.value=N),type:"checkbox"},null,512),[[vm,fe.value]]),B[28]||(B[28]=Bl(" 允许叠加",-1))]),l("button",{type:"button",onClick:de},"保存标准属性")]),l("details",kC,[B[29]||(B[29]=l("summary",null,"高级 JSON 编辑(属性值、置信度、来源状态、锁定项)",-1)),xe(l("textarea",{"onUpdate:modelValue":B[12]||(B[12]=N=>ie.value=N),rows:"14"},null,512),[[Ke,ie.value]]),V.value?(y(),w("p",CC,g(V.value),1)):ce("",!0),l("button",{type:"button",onClick:G},"校验并保存完整档案")]),l("div",$C,[l("b",null,g(String(m.value.role||"other")),1),l("b",null,g(String(m.value.wear_layer||"无层级")),1),(y(!0),w(z,null,ue(Array.isArray(m.value.body_slots)?m.value.body_slots:[],N=>(y(),w("b",{key:String(N)},g(ne(iC)(N)),1))),128))]),l("pre",null,g(Ie(m.value)),1)])):c.value==="capsules"?(y(),w("section",PC,[B[30]||(B[30]=l("header",null,[l("strong",null,"Generation Capsule"),l("span",null,"Compact / Standard / Detailed")],-1)),(y(),w(z,null,ue(["compact","standard","detailed"],N=>l("article",{key:N},[l("b",null,g(N),1),l("p",null,g(We(ve(_.value[N]).prompt_parts).join(",")||"暂无提示词"),1)])),64))])):(y(),w("section",IC,[l("header",null,[B[31]||(B[31]=l("strong",null,"识别与标准化版本",-1)),l("span",null,g(I.value.length)+" 个历史版本",1)]),B[32]||(B[32]=l("p",null,"重新识别与批量重新标准化不会覆盖已确认结构;历史版本可用于人工对比。",-1)),(y(!0),w(z,null,ue(I.value,(N,Se)=>(y(),w("article",{key:Se},[l("b",null,g(String(ve(N).archived_at||`版本 ${Se+1}`)),1),l("p",null,g(String(ve(ve(N).normalized_asset_profile).category||"other"))+" · "+g(String(ve(ve(N).normalized_asset_profile).role||"other")),1),l("pre",null,g(Ie(N)),1)]))),128)),I.value.length?ce("",!0):(y(),w("p",SC,"暂无历史版本。"))]))],2)],8,dC)],40,uC)):ce("",!0)]),_:1}))}}),RC=ai(xC,[["__scopeId","data-v-a76a2721"]]),MC=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d+)?$/,AC=new Set(["completed","succeeded","failed","cancelled","dead_letter","superseded"]);function Be(t){return String(t||"").trim().toLowerCase()}function sl(t){return{running:"运行中",degraded:"降级",stopped:"已停止",loading:"加载中",created:"已创建",pending:"等待中",queued:"排队中",completed:"已完成",succeeded:"已成功",failed:"失败",cancelled:"已取消",dead_letter:"死信",retrying:"重试执行中",superseded:"已被重试替代"}[Be(t)]??t}function Nc(t){const n=Be(t);return["failed","dead_letter","cancelled"].includes(n)?"is-bad":["running","queued","created","pending","retrying"].includes(n)?"is-warn":["completed","succeeded"].includes(n)?"is-good":"is-idle"}function Ll(t){const n=Number.isFinite(t)&&t>0?t:0;return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:n<1024*1024*1024?`${(n/1024/1024).toFixed(1)} MB`:`${(n/1024/1024/1024).toFixed(1)} GB`}function EC(t){const n=Number(t.totals.estimated_cost),o=t.currency||"USD";try{return`${new Intl.NumberFormat("zh-CN",{style:"currency",currency:o,minimumFractionDigits:n<1?4:2,maximumFractionDigits:n<1?6:2}).format(n)} 估算`}catch{return`${o} ${n.toFixed(n<1?6:2)} 估算`}}function Tl(t){if(!t)return"-";const n=Rn(t);if(!n)return t;const o=new Date(n);return Number.isNaN(o.getTime())?t:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(o)}function Rn(t){const n=String(t||"").trim(),o=MC.test(n)?`${n.replace(" ","T")}Z`:n,i=Date.parse(o);return Number.isFinite(i)?i:0}function Lc(t){const n=Rn(t.created_at);if(!n)return"-";const o=Be(t.status),u=AC.has(o)?Rn(t.updated_at):0,c=Math.max(0,Math.round(((u||Date.now())-n)/1e3)),v=wm(c),m=TC(t);return m?`${v} / 上限 ${wm(m)}`:v}function TC(t){var c,v;const n=(c=t.request)==null?void 0:c.timeout_seconds,o=(v=t.metadata)==null?void 0:v.timeout_seconds,u=Number(n??o);if(!(!Number.isFinite(u)||u<=0))return Math.round(u)}function wm(t){const n=Math.max(0,Math.round(t));if(n<60)return n<1?"刚刚":`${n} 秒`;const o=Math.round(n/60);if(o<60)return`${o} 分钟`;const i=Math.floor(o/60),u=o%60;return u?`${i} 小时 ${u} 分钟`:`${i} 小时`}function Ta(t){return t.length>10?`${t.slice(0,6)}...${t.slice(-4)}`:t}function ku(t){const n=Number(t.progress);return Number.isFinite(n)?Math.max(0,Math.min(100,n)):0}function tf(t){return/^storage:\/\/[a-z0-9_-]+(?:\/[^?#]*)?$/i.test(t.trim())}function Wg(t){return t.trim().split(/[?#]/,1)[0].replace(/\/+$/,"").split("/").pop()??""}function NC(t){return tf(t)&&/\.(png|jpe?g|gif|webp)$/i.test(Wg(t))}const LC=["aria-label","aria-describedby","aria-busy"],BC=["aria-label","disabled"],qC=["id"],OC=["src"],DC={key:1,class:"material-upload-placeholder"},WC={key:2},FC={class:"material-upload-fields"},UC=["value"],KC=["value"],VC={class:"material-upload-note"},jC={key:0,class:"operation-warning"},GC={key:1,class:"operation-error",role:"alert"},HC=["disabled"],zC=["disabled"],QC=["disabled"],YC=["id"],JC=["value"],XC={key:0,class:"operation-warning"},ZC={key:1,class:"operation-error",role:"alert"},e$=["disabled"],t$=["disabled"],a$=["id"],n$={key:0,class:"asset-pack-summary","aria-live":"polite"},l$={key:0},o$={key:1},r$={key:2,class:"operation-warning"},i$={key:1,class:"operation-error",role:"alert"},s$=["disabled"],u$=["disabled"],d$=["disabled"],c$=["id"],f$={class:"wardrobe-target"},v$={key:0,class:"operation-error",role:"alert"},p$=["disabled"],m$=["disabled"],g$=Ln({__name:"MaterialOperationDialog",props:{mode:{},categories:{},material:{},profileId:{},profileName:{},defaultCategoryId:{},busy:{type:Boolean},error:{},assetPackPlan:{}},emits:["close","upload","register","planAssetPack","executeAssetPack","importWardrobe"],setup(t,{emit:n}){const o=t,i=n,u=P("storage://materials/"),c=P(""),v=P(""),m=P(""),_=P(""),I=P(""),k=P(0),M=P("file"),q=P(""),K=P(""),ee=P(!1),j=P(null),fe=P("storage://materials/"),ie=P("top"),V=P(""),_e=P(null),X=P(null),ve=S(()=>{const ae=new Map(o.categories.map(L=>[L.category_id,L]));return[...o.categories].sort((L,Ge)=>Ze(L.name)-Ze(Ge.name)||L.sort_order-Ge.sort_order||L.name.localeCompare(Ge.name,"zh-CN")).map(L=>{var Ge;return{value:L.category_id,label:L.parent_id?`${Tc(((Ge=ae.get(L.parent_id))==null?void 0:Ge.name)??"未分类")} / ${Tc(L.name)}`:Tc(L.name)}})}),We=S(()=>o.mode==="upload-image"?"添加并识别素材":o.mode==="register-uri"?"登记素材 URI":o.mode==="asset-pack"?"导入素材包":"导入角色衣橱"),Ie=S(()=>{var L;const ae=fe.value.trim();return((L=o.assetPackPlan)==null?void 0:L.package_uri)===ae?o.assetPackPlan:null}),de=S(()=>{var ae;return!!((ae=Ie.value)!=null&&ae.manifest.valid&&Ie.value.execution_enabled)}),G=S(()=>V.value||o.error),E=S(()=>`material-operation-${o.mode}-description`);lt(()=>o.mode,()=>{V.value="",o.mode==="upload-image"?(it(),v.value=ht()):o.mode==="register-uri"?(u.value="storage://materials/",c.value="",v.value=ht()):o.mode==="asset-pack"?fe.value="storage://materials/":ie.value="top",B()},{immediate:!0}),lt(()=>o.categories,()=>{o.categories.some(ae=>ae.category_id===v.value)||(v.value=ht())},{deep:!0}),ls(()=>{document.addEventListener("keydown",st),B()}),ti(()=>{document.removeEventListener("keydown",st)});async function B(){var ae;await Ht(),(ae=_e.value)==null||ae.focus()}function N(){o.busy||i("close")}const Se=rs(N,()=>!o.busy);function st(ae){var x;if(ae.key==="Escape"){if(o.busy)return;ae.preventDefault(),N();return}if(ae.key!=="Tab")return;const L=(x=X.value)==null?void 0:x.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(L!=null&&L.length))return;const Ge=L[0],C=L[L.length-1];ae.shiftKey&&document.activeElement===Ge?(ae.preventDefault(),C.focus()):!ae.shiftKey&&document.activeElement===C&&(ae.preventDefault(),Ge.focus())}function ht(){var ae;return o.defaultCategoryId&&o.categories.some(L=>L.category_id===o.defaultCategoryId)?o.defaultCategoryId:((ae=o.categories[0])==null?void 0:ae.category_id)??""}function Ze(ae){const L=["风格","构图","服装","鞋袜","配饰"],Ge=L.indexOf(ae.trim());return Ge<0?L.length:Ge}function it(){m.value="",_.value="",I.value="",k.value=0,c.value="",q.value="",K.value="",M.value="file",ee.value=!1,j.value&&(j.value.value="")}function He(){var ae;(ae=j.value)==null||ae.click()}function Ba(ae){var C;const Ge=(C=ae.currentTarget.files)==null?void 0:C[0];Ge&&zt(Ge,"file")}function Bn(ae){var Ge,C;if(o.mode!=="upload-image")return;const L=(C=Array.from(((Ge=ae.clipboardData)==null?void 0:Ge.items)??[]).find(x=>x.kind==="file"&&x.type.startsWith("image/")))==null?void 0:C.getAsFile();L&&(ae.preventDefault(),zt(L,"paste"))}function ze(ae){var Ge;ee.value=!1;const L=Array.from(((Ge=ae.dataTransfer)==null?void 0:Ge.files)??[]).find(C=>C.type.startsWith("image/"));L&&zt(L,"drop")}async function zt(ae,L){if(V.value="",!ae.type.startsWith("image/")){V.value="请选择 PNG、JPG、GIF 或 WEBP 图片。";return}if(ae.size>20*1024*1024){V.value="图片不能超过 20 MB。";return}try{m.value=await qn(ae),_.value=ae.name||`clipboard-${Date.now()}.${ae.type.split("/")[1]||"png"}`,I.value=ae.type,k.value=ae.size,M.value=L,c.value.trim()||(c.value=_.value.replace(/\.[^.]+$/,""))}catch{V.value="读取图片失败,请重新选择。"}}function qn(ae){return new Promise((L,Ge)=>{const C=new FileReader;C.onload=()=>typeof C.result=="string"?L(C.result):Ge(new Error("invalid result")),C.onerror=()=>Ge(C.error),C.readAsDataURL(ae)})}function Vl(){const ae=c.value.trim();if(!m.value){V.value="请粘贴图片或选择本地图片。";return}if(!ae){V.value="请填写素材名称。";return}if(!v.value){V.value="请选择素材部件或分类。";return}V.value="",i("upload",{image_data_url:m.value,display_name:ae,category_id:v.value,filename:_.value,content_type:I.value,size_bytes:k.value,upload_source:M.value,metadata:{body_slot:q.value||void 0,note:K.value.trim()||void 0}})}function No(){const ae=u.value.trim(),L=c.value.trim();if(!tf(ae)){V.value="素材 URI 必须以 storage:// 开头。";return}const Ge=Wg(ae);if(!NC(ae)){V.value="素材 URI 必须指向 PNG、JPG、JPEG、GIF 或 WEBP 文件。";return}if(!L){V.value="请填写素材名称。";return}if(!v.value){V.value="请选择素材分类。";return}V.value="",i("register",{image_uri:ae,display_name:L,category_id:v.value,filename:Ge})}function St(){const ae=fe.value.trim();if(!tf(ae)){V.value="素材包 URI 必须以 storage:// 开头。";return}V.value="",i("planAssetPack",{package_uri:ae})}function va(){const ae=Ie.value;if(!ae||!de.value){V.value="请先完成有效的 dry-run 预检查。";return}V.value="",i("executeAssetPack",{package_uri:ae.package_uri})}function On(){const ae=ie.value.trim();if(!o.profileId||!o.material){V.value="需要选中已落库角色和已确认素材。";return}if(o.material.recognition_status!=="confirmed"){V.value="只有已确认素材可以导入衣橱。";return}if(!ae){V.value="请选择或填写衣橱分类。";return}V.value="",i("importWardrobe",{wardrobe_category:ae})}return(ae,L)=>{var Ge,C,x;return y(),w("div",{class:"material-operation-backdrop","data-overlay-root":"materialOperation",role:"presentation",onPointerdown:L[12]||(L[12]=(...R)=>ne(Se).pointerDown&&ne(Se).pointerDown(...R)),onPointermove:L[13]||(L[13]=(...R)=>ne(Se).pointerMove&&ne(Se).pointerMove(...R)),onPointerup:L[14]||(L[14]=(...R)=>ne(Se).pointerUp&&ne(Se).pointerUp(...R)),onPointercancel:L[15]||(L[15]=(...R)=>ne(Se).pointerCancel&&ne(Se).pointerCancel(...R))},[l("section",{ref_key:"dialogRef",ref:X,class:"material-operation-dialog","data-overlay-root":"materialOperation",role:"dialog","aria-modal":"true","aria-label":`${We.value}素材操作对话框`,"aria-describedby":E.value,"aria-busy":t.busy},[l("header",null,[l("div",null,[L[16]||(L[16]=l("span",null,"素材真实操作",-1)),l("strong",null,g(We.value),1)]),l("button",{type:"button",title:"关闭","aria-label":`关闭${We.value}`,disabled:t.busy,onClick:N},"×",8,BC)]),t.mode==="upload-image"?(y(),w("form",{key:0,"aria-label":"添加并识别素材表单",onSubmit:Ot(Vl,["prevent"]),onPaste:Bn},[l("p",{id:E.value,class:"operation-notice"}," 选择素材部件后,可直接粘贴截图、拖入图片或从本地选择文件。保存后会自动调用素材视觉识别。 ",8,qC),l("input",{ref_key:"uploadFileInputRef",ref:j,class:"upload-file-input",type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",onChange:Ba},null,544),l("button",{type:"button",class:oe(["material-upload-dropzone",{active:ee.value,ready:m.value}]),onClick:He,onDragenter:L[0]||(L[0]=Ot(R=>ee.value=!0,["prevent"])),onDragover:L[1]||(L[1]=Ot(R=>ee.value=!0,["prevent"])),onDragleave:L[2]||(L[2]=Ot(R=>ee.value=!1,["prevent"])),onDrop:Ot(ze,["prevent"])},[m.value?(y(),w("img",{key:0,src:m.value,alt:"待添加素材预览"},null,8,OC)):(y(),w("span",DC,[...L[17]||(L[17]=[l("b",null,"粘贴、拖入或选择图片",-1),l("small",null,"PNG / JPG / GIF / WEBP,最大 20 MB",-1)])])),_.value?(y(),w("em",WC,g(_.value)+" · "+g(ne(Ll)(k.value)),1)):ce("",!0)],34),l("div",FC,[l("label",null,[L[18]||(L[18]=l("span",null,"素材名称",-1)),xe(l("input",{ref_key:"firstInputRef",ref:_e,"onUpdate:modelValue":L[3]||(L[3]=R=>c.value=R),type:"text",maxlength:"120",placeholder:"例如:黑色短款机能外套"},null,512),[[Ke,c.value]])]),l("label",null,[L[20]||(L[20]=l("span",null,"素材部件(分类)",-1)),xe(l("select",{"onUpdate:modelValue":L[4]||(L[4]=R=>v.value=R)},[L[19]||(L[19]=l("option",{value:"",disabled:""},"请选择部件",-1)),(y(!0),w(z,null,ue(ve.value,R=>(y(),w("option",{key:R.value,value:R.value},g(R.label),9,UC))),128))],512),[[Mn,v.value]])]),l("label",null,[L[22]||(L[22]=l("span",null,"身体槽位(可选)",-1)),xe(l("select",{"onUpdate:modelValue":L[5]||(L[5]=R=>q.value=R)},[L[21]||(L[21]=l("option",{value:""},"交给识别模型判断",-1)),(y(!0),w(z,null,ue(ne(kf),R=>(y(),w("option",{key:R.value,value:R.value},g(R.label),9,KC))),128))],512),[[Mn,q.value]])]),l("label",VC,[L[23]||(L[23]=l("span",null,"补充识别要求(可选)",-1)),xe(l("input",{"onUpdate:modelValue":L[6]||(L[6]=R=>K.value=R),type:"text",maxlength:"240",placeholder:"例如:重点提取袖口、材质与叠穿层级"},null,512),[[Ke,K.value]])])]),ve.value.length?ce("",!0):(y(),w("p",jC,"请先创建一个素材分类。")),G.value?(y(),w("p",GC,g(G.value),1)):ce("",!0),l("footer",null,[l("button",{type:"button",disabled:t.busy,onClick:N},"取消",8,HC),l("button",{type:"button",disabled:t.busy,onClick:He},"选择图片",8,zC),l("button",{type:"submit",disabled:t.busy||!m.value||!ve.value.length},g(t.busy?"保存并识别中":"添加并识别"),9,QC)])],32)):t.mode==="register-uri"?(y(),w("form",{key:1,"aria-label":"登记素材 URI 表单",onSubmit:Ot(No,["prevent"])},[l("p",{id:E.value,class:"operation-notice"}," 这里只登记 AstrBot 插件存储中的现有文件引用,不会从浏览器上传文件字节。 ",8,YC),l("label",null,[L[24]||(L[24]=l("span",null,"storage:// URI",-1)),xe(l("input",{ref_key:"firstInputRef",ref:_e,"onUpdate:modelValue":L[7]||(L[7]=R=>u.value=R),type:"text",autocomplete:"off","aria-label":"素材 storage URI",placeholder:"storage://materials/coat.png"},null,512),[[Ke,u.value]])]),l("label",null,[L[25]||(L[25]=l("span",null,"素材名称",-1)),xe(l("input",{"onUpdate:modelValue":L[8]||(L[8]=R=>c.value=R),type:"text",maxlength:"120","aria-label":"素材名称",placeholder:"深蓝机能外套"},null,512),[[Ke,c.value]])]),l("label",null,[L[27]||(L[27]=l("span",null,"素材分类",-1)),xe(l("select",{"onUpdate:modelValue":L[9]||(L[9]=R=>v.value=R),"aria-label":"素材分类"},[L[26]||(L[26]=l("option",{value:"",disabled:""},"请选择分类",-1)),(y(!0),w(z,null,ue(ve.value,R=>(y(),w("option",{key:R.value,value:R.value},g(R.label),9,JC))),128))],512),[[Mn,v.value]])]),ve.value.length?ce("",!0):(y(),w("p",XC,"请先在素材页创建一个后端分类。")),G.value?(y(),w("p",ZC,g(G.value),1)):ce("",!0),l("footer",null,[l("button",{type:"button",disabled:t.busy,onClick:N},"取消",8,e$),l("button",{type:"submit",disabled:t.busy||!ve.value.length},g(t.busy?"登记中":"登记 URI"),9,t$)])],32)):t.mode==="asset-pack"?(y(),w("form",{key:2,"aria-label":"素材包导入表单",onSubmit:Ot(St,["prevent"])},[l("p",{id:E.value,class:"operation-notice"}," 先执行 metadata-only dry-run,查看清单摘要;预检查通过后才能确认导入。 ",8,a$),l("label",null,[L[28]||(L[28]=l("span",null,"素材包 storage:// URI",-1)),xe(l("input",{ref_key:"firstInputRef",ref:_e,"onUpdate:modelValue":L[10]||(L[10]=R=>fe.value=R),type:"text",autocomplete:"off","aria-label":"素材包 storage URI",placeholder:"storage://materials/my-pack"},null,512),[[Ke,fe.value]])]),Ie.value?(y(),w("section",n$,[l("header",null,[L[29]||(L[29]=l("strong",null,"dry-run 摘要",-1)),l("span",{class:oe(Ie.value.manifest.valid?"good":"bad")},g(Ie.value.manifest.valid?"清单有效":"清单无效"),3)]),l("dl",null,[l("div",null,[L[30]||(L[30]=l("dt",null,"素材包",-1)),l("dd",null,g(Ie.value.manifest.name||Ie.value.package_uri),1)]),l("div",null,[L[31]||(L[31]=l("dt",null,"文件",-1)),l("dd",null,g(Ie.value.files)+" 个 / "+g(ne(Ll)(Ie.value.bytes)),1)]),l("div",null,[L[32]||(L[32]=l("dt",null,"素材",-1)),l("dd",null,g(Ie.value.manifest.materials)+" 条",1)]),l("div",null,[L[33]||(L[33]=l("dt",null,"样式",-1)),l("dd",null,g(Ie.value.manifest.styles)+" 条",1)])]),Ie.value.manifest.errors.length?(y(),w("ul",l$,[(y(!0),w(z,null,ue(Ie.value.manifest.errors,R=>(y(),w("li",{key:`${R.code}-${R.message}`},g(R.code)+":"+g(R.message),1))),128))])):ce("",!0),(Ge=Ie.value.unsupported_features)!=null&&Ge.length?(y(),w("ul",o$,[(y(!0),w(z,null,ue(Ie.value.unsupported_features,R=>(y(),w("li",{key:R.code},g(R.code)+":"+g(R.message),1))),128))])):ce("",!0),Ie.value.execution_enabled?ce("",!0):(y(),w("p",r$," 当前摘要不允许执行导入,请先修正清单错误或不支持的条目。 "))])):ce("",!0),G.value?(y(),w("p",i$,g(G.value),1)):ce("",!0),l("footer",null,[l("button",{type:"button",disabled:t.busy,onClick:N},"取消",8,s$),l("button",{type:"submit",disabled:t.busy},g(t.busy?"检查中":"dry-run 预检查"),9,u$),l("button",{type:"button",disabled:t.busy||!de.value,onClick:va},g(t.busy?"执行中":"确认导入"),9,d$)])],32)):(y(),w("form",{key:3,"aria-label":"角色衣橱导入表单",onSubmit:Ot(On,["prevent"])},[l("p",{id:E.value,class:"operation-notice"}," 将当前已确认素材导入当前选中角色的衣橱,不会复制或伪造素材记录。 ",8,c$),l("dl",f$,[l("div",null,[L[34]||(L[34]=l("dt",null,"角色",-1)),l("dd",null,g(t.profileName||"未选择"),1)]),l("div",null,[L[35]||(L[35]=l("dt",null,"素材",-1)),l("dd",null,g(((C=t.material)==null?void 0:C.display_name)||"未选择"),1)]),l("div",null,[L[36]||(L[36]=l("dt",null,"素材状态",-1)),l("dd",null,g(((x=t.material)==null?void 0:x.recognition_status)||"-"),1)])]),l("label",null,[L[37]||(L[37]=l("span",null,"wardrobe_category",-1)),xe(l("input",{ref_key:"firstInputRef",ref:_e,"onUpdate:modelValue":L[11]||(L[11]=R=>ie.value=R),list:"wardrobe-category-options",type:"text",maxlength:"48","aria-label":"衣橱分类"},null,512),[[Ke,ie.value]]),L[38]||(L[38]=_1('<datalist id="wardrobe-category-options" data-v-9870de78><option value="top" data-v-9870de78></option><option value="bottom" data-v-9870de78></option><option value="outerwear" data-v-9870de78></option><option value="dress" data-v-9870de78></option><option value="shoes" data-v-9870de78></option><option value="socks" data-v-9870de78></option><option value="accessory" data-v-9870de78></option><option value="headwear" data-v-9870de78></option></datalist>',1))]),G.value?(y(),w("p",v$,g(G.value),1)):ce("",!0),l("footer",null,[l("button",{type:"button",disabled:t.busy,onClick:N},"取消",8,p$),l("button",{type:"submit",disabled:t.busy||!t.profileId||!t.material},g(t.busy?"导入中":"导入衣橱"),9,m$)])],32))],8,LC)],32)}}}),y$=ai(g$,[["__scopeId","data-v-9870de78"]]),Cu=Ln({__name:"MetricCardGrid",props:{cards:{},sectionClass:{type:[Boolean,null,String,Object,Array],default:""},cardClass:{type:[Boolean,null,String,Object,Array],default:""}},setup(t){const n=t;return(o,i)=>(y(),w("section",{class:oe(n.sectionClass)},[(y(!0),w(z,null,ue(n.cards,u=>(y(),w("article",{key:u.label,class:oe(["metric-card",u.state,n.cardClass])},[l("span",null,g(u.label),1),l("strong",null,g(u.value),1),l("small",null,g(u.hint),1)],2))),128))],2))}}),_$=["role","aria-busy"],b$=["aria-label","disabled"],w$=Ln({__name:"StateCard",props:{tone:{},title:{},detail:{},actionLabel:{default:""},busy:{type:Boolean,default:!1}},emits:["action"],setup(t,{emit:n}){const o=t,i=n;function u(){o.busy||i("action")}return(c,v)=>(y(),w("section",{class:oe(["state-card",t.tone]),role:t.tone==="bad"?"alert":"status","aria-live":"polite","aria-busy":t.busy},[l("strong",null,g(t.title),1),l("span",null,g(t.detail),1),t.actionLabel?(y(),w("button",{key:0,type:"button","aria-label":t.actionLabel,disabled:t.busy,onClick:u},g(t.actionLabel),9,b$)):ce("",!0)],10,_$))}}),ir=ai(w$,[["__scopeId","data-v-23152ac6"]]),h$=new Set(["standard","advanced","advanced-import"]);function k$(t){return t&&h$.has(t)?t:"standard"}function PM(t){switch(Du(t)){case"pending_recognition":case"recognition_queued":case"style_source_recognition_queued":return{label:"等待识别",detail:"源图已保存,等待视觉模型提取特征。",tone:"idle",busy:!0};case"recognizing":case"recognizing_style_sources":return{label:"正在识别",detail:"正在提取关键词、提示词和视觉特征。",tone:"active",busy:!0};case"style_source_review_required":return{label:"待处理样本",detail:"部分样本识别未完成;可单独重试失败项或排除后继续。",tone:"warn",busy:!1};case"style_consensus_queued":case"style_consensus_running":return{label:"正在交叉归纳",detail:"正在对全部有效样本和逐图报告进行共性与差异分析。",tone:"active",busy:!0};case"style_consensus_failed":return{label:"交叉归纳失败",detail:"逐图结果仍已保留,可重新发起交叉归纳。",tone:"bad",busy:!1};case"pending_validation":case"ready_for_validation":return{label:"等待验证",detail:"识别完成,可以生成第一张还原度验证图。",tone:"warn",busy:!1};case"validating":case"validation_queued":return{label:"正在验证",detail:"验证图已入队,完成后可对照源图审核。",tone:"active",busy:!0};case"validation_partial_failed":return{label:"部分验证失败",detail:"已完成的验证图会保留,只需单独重试失败场景。",tone:"warn",busy:!1};case"pending_review":case"awaiting_review":return{label:"等待审核",detail:"请比较源图与验证图,决定封存或继续调整。",tone:"warn",busy:!1};case"accepted":return{label:"已封存",detail:"已作为高优先级进阶素材入库。",tone:"good",busy:!1};case"rejected":case"adjustment_required":return{label:"待调整",detail:"上一轮未通过,可补充描述重新验证。",tone:"warn",busy:!1};case"failed":case"validation_failed":case"recognition_failed":return{label:"处理失败",detail:"可以查看失败原因并重试当前阶段。",tone:"bad",busy:!1};case"cancelled":return{label:"已取消",detail:"当前导入任务已取消。",tone:"idle",busy:!1};case"archived":return{label:"已归档",detail:"当前导入记录已归档。",tone:"idle",busy:!1};default:return{label:t||"未知状态",detail:"后端返回了尚未识别的状态。",tone:"idle",busy:!1}}}function IM(t){switch(Du(t)){case"queued":return{label:"已入队",detail:"验证任务正在等待执行。",tone:"idle",busy:!0};case"running":return{label:"生成中",detail:"正在生成本轮还原度验证图。",tone:"active",busy:!0};case"succeeded":case"completed":case"awaiting_review":return{label:"待审核",detail:"验证图已生成,请判断还原度。",tone:"warn",busy:!1};case"accepted":return{label:"已采纳",detail:"本轮验证图已经封存入库。",tone:"good",busy:!1};case"rejected":return{label:"未采纳",detail:"本轮已保留,可基于反馈继续调整。",tone:"warn",busy:!1};case"failed":return{label:"生成失败",detail:"检查错误后可再次发起验证。",tone:"bad",busy:!1};case"cancelled":return{label:"已取消",detail:"本轮验证任务已取消。",tone:"idle",busy:!1};default:return{label:t||"未知状态",detail:"后端返回了尚未识别的状态。",tone:"idle",busy:!1}}}function SM(t){return[...t].sort((n,o)=>{const i=+(Du(o.status)==="active")-+(Du(n.status)==="active");if(i)return i;const u=Number(o.priority||0)-Number(n.priority||0);return u||Zr(o.accepted_at||o.updated_at)-Zr(n.accepted_at||n.updated_at)})}function xM(t){return[...t].sort((n,o)=>Zr(o.updated_at)-Zr(n.updated_at))}function RM(t){return[...t].sort((n,o)=>Number(o.attempt_number||0)-Number(n.attempt_number||0)||Zr(o.created_at)-Zr(n.created_at))}function MM(t){if(!t||typeof t!="object")return"";const n=t,o=String(n.message||n.detail||n.reason||"").trim();if(o)return o;const i=String(n.code||n.error_code||"").trim();return i?`错误代码:${i}`:""}function AM(t,n){if(!t||typeof t!="object")return null;const o=t;for(const i of n){const u=o[i];if(u&&typeof u=="object"&&!Array.isArray(u))return u}return null}function C$(t){if(Array.isArray(t))return t;if(!t||typeof t!="object")return[];const n=t;return Array.isArray(n.items)?n.items:n.data&&typeof n.data=="object"?C$(n.data):[]}function Du(t){return String(t||"").trim().toLowerCase()}function Zr(t){const n=Date.parse(String(t||""));return Number.isFinite(n)?n:0}const Wi=[{key:"overview",label:"概览",icon:"□",module:"overview",group:"workspace",description:"查看运行状态与核心指标"},{key:"generate",label:"生成",icon:"+",module:"generate",group:"workspace",description:"创建图片并配置生成参数"},{key:"queue",label:"队列",icon:"≡",module:"queue",group:"workspace",description:"管理等待中和进行中的任务"},{key:"performance",label:"性能",icon:"%",module:"performance",group:"system",description:"分析服务性能与资源使用"},{key:"gallery",label:"图库",icon:"▧",module:"images",group:"assets",description:"浏览和管理生成结果"},{key:"profiles",label:"角色",icon:"◇",module:"profiles",group:"assets",description:"管理角色档案与角色设定"},{key:"materials",label:"素材",icon:"◫",module:"images",group:"assets",description:"整理生成时使用的参考素材"},{key:"settings",label:"设置",icon:"◎",module:"settings",group:"system",description:"配置服务与插件选项"},{key:"logs",label:"日志",icon:"!",module:"logs",group:"system",description:"检查运行记录与异常信息"}],$$=["overview","generate","queue","materials","profiles","gallery","performance","settings","logs"],P$=$$.map(t=>Wi.find(n=>n.key===t)).filter(t=>!!t);function is(t){var n;return["ungenerated","quick","profile_card"].includes(t.profile_category??"")?t.profile_category:t.generation_kind==="quick"?"quick":t.generation_kind==="profile_card"||t.generation_kind==="detailed"&&(t.detailed_workflow_state==="archived"||((n=t.metadata)==null?void 0:n.source)==="sample")?"profile_card":"ungenerated"}function EM(t){return{ungenerated:"未生成",quick:"快速角色",profile_card:"档案卡"}[is(t)]}function TM(t){return{ungenerated:"只有文本设定",quick:"头像、半身、立绘与设定图",profile_card:"已封存的完整角色资产"}[is(t)]}function NM(t){const n=is(t);return n==="profile_card"?"good":n==="quick"?"warn":"idle"}function LM(t){const n={in_progress:"详细工作流进行中",ready_to_archive:"等待建立档案卡",archived:"工作流已封存"};return t.detailed_workflow_state?n[t.detailed_workflow_state]:""}function BM(t){return is(t)==="profile_card"&&t.detailed_workflow_state==="archived"}function Fg(t){return String(t||"unknown").trim().toLocaleLowerCase()}function qM(t){const n=Fg(t);return{active:"启用中",ready:"可用",enabled:"已启用",draft:"草稿",archived:"已归档",disabled:"已停用",pending:"待完善",running:"进行中",review:"待审核",completed:"已完成",confirmed:"已确认",sample:"预览",failed:"失败",error:"异常",unknown:"未知"}[n]??t??"未知"}function OM(t){const n=Fg(t);return["active","ready","enabled","completed","confirmed"].includes(n)?"good":["draft","pending","running","review"].includes(n)?"warn":["failed","error","disabled"].includes(n)?"bad":"idle"}function DM(t){return t.name.trim().slice(0,1).toLocaleUpperCase()||"?"}function I$(t,n){var i;const o=(i=t.metadata)==null?void 0:i[n];return typeof o=="string"?o.trim():""}function WM(t){const n=I$(t,"source");return n==="sample"?"预览示例":n==="import"?"外部导入":n==="quick_profile"?"快速问卷建档":n||"后端档案"}function FM(t){if(!t)return"-";const n=new Date(t);return Number.isNaN(n.getTime())?t:new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(n)}function UM(t){return{identity:"角色定位",personality:"性格特征",gender_presentation:"性别表现",age_stage:"年龄阶段",species:"物种 / 种族",body_type:"体型",distinctive_features:"显著特征",identity_lock:"角色一致性锁",identity_lock_hash:"一致性锁摘要",source:"档案来源",system_key:"系统标识",tags:"标签",aliases:"别名"}[t]??t.replaceAll("_"," ")}function KM(t){if(Array.isArray(t))return t.map(n=>String(n)).join("、")||"-";if(typeof t=="object")try{return JSON.stringify(t)}catch{return String(t)}return String(t)}function VM(t){return/^(?:https?:|data:|blob:|\/)/i.test(String(t||"").trim())}function S$(){return{roleCore:"近未来港区巡查员,负责夜间巡逻和异常记录。",genderPresentation:"female",ageStage:"adult",species:"human",bodyType:"athletic",distinctiveFeatures:"发光臂章,青绿色眼睛",personality:"冷静、可靠、行动快,外冷内热。",appearance:"黑色短发,青绿色眼睛,轻机能外套。",outfit:"短靴、发光臂章、便携通讯设备。",scene:"星港、雨夜街区、巡查终端、航灯背景。",avoid:"过度复杂、低清晰度、肢体结构错误。",worldview:"",background:"",heightBuild:"",bodyFeatures:"",likes:"",dislikes:"",habits:"",relationships:"",storyHooks:"",generationStyle:"",shotPreference:"",mood:"",extraNotes:""}}function x$(){return{roleCore:"",genderPresentation:"",ageStage:"",species:"",bodyType:"",distinctiveFeatures:"",personality:"",appearance:"",outfit:"",scene:"",avoid:"",worldview:"",background:"",heightBuild:"",bodyFeatures:"",likes:"",dislikes:"",habits:"",relationships:"",storyHooks:"",generationStyle:"",shotPreference:"",mood:"",extraNotes:""}}function R$(t){const n=new Set;if(!t)return{...x$(),recognizedKeys:[]};const o=Ru(t,["姓名","名字","角色名","名称","name","character name"]),i=Ru(t,["身份","职业","定位","种族","role","identity","occupation"]),u=Ru(t,["角色核心","人设","简介","设定","介绍","profile","summary","description","brief"]),c=Ug(t,["角色","身份","职业","来自","负责","name","role"]),v=A$([o,i,u]).join(",")||c||t.slice(0,220);v&&n.add("roleCore");const m=$t(t,["性别","性别表现","性别呈现","gender","gender presentation","sex"],["男性","女性","男生","女生","男","女","male","female","androgynous","nonbinary"],""),_=$t(t,["年龄","年龄段","年龄阶段","age","age stage"],["少年","少女","青年","成年","中年","老年","teen","young adult","adult","middle-aged","elderly"],""),I=$t(t,["种族","物种","族群","species","race"],["人类","精灵","兽人","机械","机器人","仿生人","human","elf","android","robot"],""),k=$t(t,["体型","身材","身体类型","body type","build"],["纤细","匀称","健壮","高挑","娇小","丰满","slim","athletic","muscular","petite","curvy"],""),M=$t(t,["显著特征","标志特征","视觉记忆点","记忆点","distinctive features","signature features"],["伤疤","痣","纹身","义体","异色瞳","角","尾巴","scar","tattoo","heterochromia"],""),q=$t(t,["性格","人格","个性","personality","trait","traits"],["冷静","开朗","温和","敏锐","可靠","慢热","强势","沉稳","活泼","内向","外向"],"性格关键词待从原文继续整理"),K=$t(t,["外观","外貌","长相","发色","发型","眼睛","瞳色","appearance","look","hair","eyes"],["发","眼","身高","体型","肤色","瞳","长发","短发","刘海"],"外观特征待从原文继续整理"),ee=$t(t,["服装","衣着","穿着","配饰","outfit","clothing","accessory","accessories"],["外套","裙","靴","制服","配饰","项链","手套","披风","夹克","耳饰"],"服装与配饰待从原文继续整理"),j=$t(t,["场景","背景","世界观","日常","scene","background","world","setting"],["城市","港区","学院","战场","雨夜","实验室","森林","房间","街区"],"常用场景待补充"),fe=$t(t,["避雷","禁用","负面","不要","negative","avoid"],["不要","避免","禁止","低质量","崩坏","血腥","恐怖"],"低质量、结构错误、过度复杂、与角色设定冲突"),ie=$t(t,["世界观","时代","地点","setting","world","worldview"],["现代","赛博","奇幻","末世","校园","古风","星际","王国","都市"],""),V=$t(t,["背景","经历","过去","身世","background","history","backstory"],["曾经","出生","来自","经历","过去","现在","目前"],""),_e=$t(t,["身高","身材","体型","height","build","body type"],["cm","厘米","高挑","娇小","纤细","健壮","匀称","丰满"],""),X=$t(t,["记忆点","特征","伤疤","纹身","义体","body feature","mark"],["伤疤","痣","纹身","义体","异色瞳","尖耳","机械","尾巴","角"],""),ve=$t(t,["喜好","喜欢","爱好","likes","hobby","hobbies"],["喜欢","擅长","热爱","收藏","常喝","常吃"],""),We=$t(t,["不喜欢","讨厌","害怕","dislikes","fear","fears"],["不喜欢","讨厌","害怕","排斥","恐惧"],""),Ie=$t(t,["习惯","生活习惯","日常","habit","routine"],["习惯","总是","经常","每天","熬夜","洁癖"],""),de=$t(t,["关系","同伴","亲友","敌人","relationship","relationships"],["朋友","同伴","家人","敌人","导师","搭档","组织"],""),G=$t(t,["目标","秘密","故事钩子","主线","goal","secret","plot"],["目标","秘密","寻找","保护","复仇","调查","逃亡"],""),E=$t(t,["画风","美术风格","style","art style"],["插画","厚涂","赛璐璐","写实","电影感","水彩","像素"],""),B=$t(t,["镜头","构图","视角","shot","composition"],["头像","半身","全身","立绘","正面","侧面","俯视","仰视"],""),N=$t(t,["氛围","情绪","气质","mood","atmosphere"],["明亮","压抑","柔和","危险","神圣","冷峻","温暖","孤独"],""),Se=$t(t,["补充","备注","其他","note","notes"],["补充","备注","另外","其他"],"");for(const[st,ht]of Object.entries({genderPresentation:m,ageStage:_,species:I,bodyType:k,distinctiveFeatures:M,personality:q,appearance:K,outfit:ee,scene:j,avoid:fe,worldview:ie,background:V,heightBuild:_e,bodyFeatures:X,likes:ve,dislikes:We,habits:Ie,relationships:de,storyHooks:G,generationStyle:E,shotPreference:B,mood:N,extraNotes:Se}))ht.recognized&&n.add(st);return{roleCore:v,genderPresentation:M$(m.value),ageStage:_.value,species:I.value,bodyType:k.value,distinctiveFeatures:M.value,personality:q.value,appearance:K.value,outfit:ee.value,scene:j.value,avoid:fe.value,worldview:ie.value,background:V.value,heightBuild:_e.value,bodyFeatures:X.value,likes:ve.value,dislikes:We.value,habits:Ie.value,relationships:de.value,storyHooks:G.value,generationStyle:E.value,shotPreference:B.value,mood:N.value,extraNotes:Se.value,recognizedKeys:Array.from(n)}}function M$(t){const n=t.trim().toLocaleLowerCase();return n?["男","男性","男生","male","man","boy"].some(o=>n.includes(o))?"male":["女","女性","女生","female","woman","girl"].some(o=>n.includes(o))?"female":["非二元","nonbinary","non-binary"].some(o=>n.includes(o))?"nonbinary":["中性","androgynous"].some(o=>n.includes(o))?"androgynous":n:""}function $t(t,n,o,i){const u=Ru(t,n);if(u)return{value:u,recognized:!0};const c=Ug(t,o);return c?{value:c,recognized:!0}:{value:i,recognized:!1}}function Ru(t,n){const o=t.split(/\r?\n/).map(c=>c.trim()).filter(Boolean),i=n.map(E$).join("|"),u=new RegExp(`^\\s*(?:[-*•]|\\d+[.)、])?\\s*(?:["'“”\\[【])?(?:${i})(?:["'“”\\]】])?\\s*[::=]\\s*(.+)$`,"i");for(const c of o){const v=c.match(u);if(v!=null&&v[1])return Zi(v[1])}return null}function Ug(t,n){return t.split(/\r?\n/).map(u=>u.trim()).filter(Boolean).filter(u=>n.some(c=>u.toLowerCase().includes(c.toLowerCase()))).map(u=>Zi(u.replace(/^\s*(?:[-*•]|[0-9]+[.)、])\s*/,""))).filter(Boolean).slice(0,3).join(";")}function A$(t){const n=new Set;return t.map(o=>o?Zi(o):"").filter(o=>!o||n.has(o)?!1:(n.add(o),!0))}function Zi(t){return t.replace(/^[\s"'“”`【】[\]]+/,"").replace(/[\s"'“”`,,;;]+$/,"").trim()}function E$(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const T$={half_body:"upper_body",expression_sheet:"turnaround",pose_sheet:"design_sheet",final_pack:"profile_card"};function xo(t){return T$[t]??t}const N$={profile_brief:"persona-split",prompt_plan:"prompt-plan",material_bind:"material-bind",headshot:"portrait-01",upper_body:"portrait-02",lower_body:"lower-body",full_body:"fullbody-01",turnaround:"sheet-split",design_sheet:"detail-hands-01",style_lock:"hires-fix",profile_card:"archive"},L$={fast_profile:"persona-split",fast_candidates:"portrait-01",fast_final:"archive"};function Bc(t){const n=xo(t);return N$[n]??L$[t]}const hm=[{id:"persona-split",canonicalNodeKey:"profile_brief",title:"LLM 拆解设定",detail:"把已导入的人设拆成身份、性格、外观、服装和稳定性约束。",badge:"LLM",phase:"设定拆解"},{id:"prompt-plan",canonicalNodeKey:"prompt_plan",title:"提示词规划",detail:"为头像、半身、全身和设定图规划正向提示词、负向提示词与继承规则。",badge:"Prompt",phase:"提示词规划"},{id:"material-bind",canonicalNodeKey:"material_bind",title:"参考素材绑定",detail:"绑定风格、构图、服装、鞋袜和配饰参考,并写入后续节点。",badge:"Material",phase:"素材绑定"},{id:"portrait-01",canonicalNodeKey:"headshot",title:"头像草稿",detail:"生成并确认角色五官、发型、眼睛和基础表情。",badge:"Image",phase:"头像"},{id:"portrait-02",canonicalNodeKey:"upper_body",title:"上半身像",detail:"在头像锚点基础上生成上半身服装、姿态和轮廓。",badge:"Image",phase:"上半身"},{id:"lower-body",canonicalNodeKey:"lower_body",title:"下半身像",detail:"确认腰胯、腿部比例、鞋袜与下半身服装细节。",badge:"Image",phase:"下半身"},{id:"fullbody-01",canonicalNodeKey:"full_body",title:"全身设定",detail:"生成完整服装、身体比例、鞋袜和主要配饰。",badge:"Image",phase:"全身"},{id:"sheet-split",canonicalNodeKey:"turnaround",title:"三视图",detail:"生成正面、侧面和背面视图,并保持体型与服装结构一致。",badge:"Sheet",phase:"三视图"},{id:"detail-hands-01",canonicalNodeKey:"design_sheet",title:"设定图",detail:"汇总表情、姿势、手部、配饰和可复用设计细节。",badge:"Sheet",phase:"设定图"},{id:"hires-fix",canonicalNodeKey:"style_lock",title:"高清修复与统一风格",detail:"统一角色身份和画面风格,并完成高清修复。",badge:"Hires",phase:"风格锁定"},{id:"archive",canonicalNodeKey:"profile_card",title:"建立角色档案卡",detail:"校验并封存头像、人设文档、人设图、立绘、PV 图与完整工作流记录。",badge:"Archive",phase:"档案卡"}];function Wu(t){return typeof t=="string"?t.trim():""}function B$(t){const n=[["override",t.overrideRoute],["round",t.roundRoute],["node",t.nodeRoute],["assignment",t.assignmentRoute],["profile",t.profileRoute],["system",t.systemRoute]];for(const[o,i]of n){const u=Wu(i);if(u)return{route:u,source:o,explicitOverride:o==="override"}}return{route:"",source:"backend",explicitOverride:!1}}function qc(t){const n=Wu(t);return n?{model_route:n}:{}}function q$(t,n){const o=Wu(t).toLowerCase(),u={portrait:"headshot",avatar:"headshot",half_body:"upper_body",halfbody:"upper_body",standing:"full_body",fullbody:"full_body",three_view:"turnaround",three_views:"turnaround",character_sheet:"design_sheet",expression_sheet:"design_sheet",pose_sheet:"design_sheet",hires_fix:"style_lock"}[o]||o,c={headshot:"portrait_generation",upper_body:"halfbody_generation",lower_body:"fullbody_generation",full_body:"fullbody_generation",turnaround:"sheet_generation",design_sheet:"sheet_generation",style_lock:"hires_fix"};return c[u]?c[u]:Wu(n).toLowerCase()==="generation"?u:""}function Kg(t){return typeof t=="string"?t.trim().toLowerCase():""}function Vg(t,n){const o=Kg(t);return o==="archived"||o==="cancelled"||!!(n!=null&&n.final_archive_history_id||n!=null&&n.sealed_at)}function O$(t,n,o){return Kg(t)==="selected"||Vg(n,o)}const D$="/api/v1/plugins/extensions/astrbot_plugin_imagestudio",A={uiBootstrap:"ui/bootstrap",uiActions:"ui/actions",dashboardSummary:"dashboard/summary",contract:"contract",profiles:"profiles",profile:t=>`profiles/${t}`,profileArchive:t=>`profiles/${t}/archive`,quickProfileDraft:"profiles/quick-draft",quickProfileDocumentImport:"profiles/quick-draft/from-document",quickProfileDraftSave:"profiles/quick-draft/save",profileWorkflows:t=>`profiles/${t}/workflows`,profileCards:t=>`profiles/${t}/profile-cards`,profileCard:t=>`profile-cards/${t}`,workflow:t=>`workflows/${t}`,workflowStart:t=>`workflows/${t}/start`,workflowCancel:t=>`workflows/${t}/cancel`,workflowArchive:t=>`workflows/${t}/archive`,workflowExecuteCharacter:t=>`workflows/${t}/execute-character`,workflowFinalizeCard:t=>`workflows/${t}/finalize-card`,workflowNodes:t=>`workflows/${t}/nodes`,workflowBranches:t=>`workflows/${t}/branches`,workflowSwitchBranch:t=>`workflows/${t}/switch-branch`,workflowHistory:t=>`workflows/${t}/history`,node:t=>`nodes/${t}`,nodeDependencyContext:t=>`nodes/${t}/dependency-context`,nodeMaterialBindings:t=>`nodes/${t}/material-bindings`,nodeRounds:t=>`nodes/${t}/rounds`,round:t=>`rounds/${t}`,roundFeedback:t=>`rounds/${t}/feedback`,roundNext:t=>`rounds/${t}/next`,roundConfirm:t=>`rounds/${t}/confirm`,roundGenerationCrossReview:t=>`rounds/${t}/generation-cross-review`,roundGenerationCrossReviewRegenerate:t=>`rounds/${t}/generation-cross-review/regenerate`,roundGenerationCrossReviewApprove:t=>`rounds/${t}/generation-cross-review/approve`,nodeGenerate:t=>`nodes/${t}/generate`,nodeRetry:t=>`nodes/${t}/retry`,nodeComplete:t=>`nodes/${t}/complete`,nodeMarkCompleted:t=>`nodes/${t}/mark-completed`,nodeSelectImage:t=>`nodes/${t}/select-image`,nodeAdoptImage:t=>`nodes/${t}/adopt-image`,reviewPolicy:"review/policy",reviewPolicyValidate:"review/policy/validate",reviewPolicySave:"review/policy/save",promptsExpand:"prompts/expand",promptGovernancePreview:"prompts/governance-preview",nodeReview:t=>`nodes/${t}/review`,nodeImages:t=>`nodes/${t}/images`,workflowReview:t=>`workflows/${t}/review`,images:"images",image:t=>`images/${t}`,imageSelect:t=>`images/${t}/select`,imageUnselect:t=>`images/${t}/unselect`,imageArchive:t=>`images/${t}/archive`,imageSafeDelete:t=>`images/${t}/safe-delete`,imageDelete:t=>`images/${t}`,jobs:"jobs",job:t=>`jobs/${t}`,jobDelete:t=>`jobs/${t}`,jobCancel:t=>`jobs/${t}/cancel`,jobRetry:t=>`jobs/${t}/retry`,jobRetryFailed:"jobs/failed/retry",jobClearFailed:"jobs/failed/clear",jobClearTerminal:"jobs/terminal/clear",jobDeadLetterRetry:"jobs/dead-letter/retry",jobDeadLetterMoveFailed:"jobs/dead-letter/move-failed",costUsage:"costs/usage",costGuard:"costs/guard",runtimeModels:"models/runtime",settingsSchema:"settings/schema",settingsCurrent:"settings/current",settingsValidate:"settings/validate",settingsDiff:"settings/diff",settingsSave:"settings/save",settingsReload:"settings/reload",settingsExport:"settings/export",settingsImport:"settings/import",settingsSnapshots:"settings/snapshots",settingsSnapshot:t=>`settings/snapshots/${t}`,settingsRollback:"settings/rollback",backups:"backups",backup:t=>`backups/${t}`,backupRestore:t=>`backups/${t}/restore`,storageStatus:"storage/status",storageMigrate:"storage/migrate",mediaSign:"media/sign",mediaPayload:"media/payload",mediaIndex:"media/index",mediaOrphans:"media/orphans",materialCategories:"material-categories",materialCategory:t=>`material-categories/${t}`,materials:"materials",materialUpload:"materials/upload",material:t=>`materials/${t}`,materialRecognize:t=>`materials/${t}/recognize`,materialReRecognize:t=>`materials/${t}/re-recognize`,materialConfirm:t=>`materials/${t}/confirm`,advancedMaterialImports:"advanced-material-imports",advancedMaterialImportUpload:"advanced-material-imports/upload",advancedMaterialStyleSetUpload:"advanced-material-imports/style-set/upload",advancedMaterialImport:t=>`advanced-material-imports/${t}`,advancedMaterialImportDelete:t=>`advanced-material-imports/${t}`,advancedMaterialImportRetry:t=>`advanced-material-imports/${t}/retry`,advancedMaterialStyleSourceRetry:(t,n)=>`advanced-material-imports/${t}/style-sources/${n}/retry`,advancedMaterialStyleSourceExclude:(t,n)=>`advanced-material-imports/${t}/style-sources/${n}/exclude`,advancedMaterialStyleConsensus:t=>`advanced-material-imports/${t}/style-consensus`,advancedMaterialStyleValidationCaseRetry:(t,n)=>`advanced-material-imports/${t}/style-validation-cases/${n}/retry`,advancedMaterialValidationAttempts:t=>`advanced-material-imports/${t}/validation-attempts`,advancedMaterialAttemptAccept:(t,n)=>`advanced-material-imports/${t}/attempts/${n}/accept`,advancedMaterialAttemptReject:(t,n)=>`advanced-material-imports/${t}/attempts/${n}/reject`,advancedMaterials:"advanced-materials",advancedMaterial:t=>`advanced-materials/${t}`,materialCatalog:"material-catalog",assetImportPack:"assets/import-pack",wardrobe:t=>`profiles/${t}/wardrobe`,wardrobeImportMaterial:t=>`profiles/${t}/wardrobe/import-material`,wardrobeItems:t=>`profiles/${t}/wardrobe/items`,wardrobeItem:(t,n)=>`profiles/${t}/wardrobe/items/${n}`,wardrobeLegacyItem:(t,n)=>`profiles/${t}/wardrobe/${n}`,wardrobeMatch:t=>`profiles/${t}/wardrobe/match`,wardrobeTemplates:t=>`profiles/${t}/wardrobe-templates`,wardrobeTemplate:(t,n)=>`profiles/${t}/wardrobe-templates/${n}`,wardrobeTemplateApply:(t,n)=>`profiles/${t}/wardrobe-templates/${n}/apply`,materialAnalytics:"materials/analytics",materialRenormalizeBatch:"materials/renormalize-batch",materialRenormalize:t=>`materials/${t}/renormalize`,privateCompanionDailyOutfit:"integrations/private-companion/daily-outfit",privateCompanionToken:"integrations/private-companion/token",privateCompanionTokenRotate:"integrations/private-companion/token/rotate",integrationEventLogs:"integrations/logs",apiDiscoveryDialects:"api-discovery/dialects",apiDiscoveryProbeProvider:"api-discovery/probe-provider",apiDiscoveryProbeModel:"api-discovery/probe-model",apiDiscoveryCapabilities:"api-discovery/capabilities",apiDiscoveryManualOverride:"api-discovery/manual-override",apiDiscoveryValidateRenderPlan:"api-discovery/validate-render-plan",generationLogs:"logs/generation",workflowLogs:"logs/workflows",errorLogs:"logs/errors",integrationLogs:"logs/integrations",auditLogs:"security/audit-logs",eventStream:"events/stream",webManifest:"web/manifest"},W$=900,F$=W$*1e3,U$="__imagestudio_method",K$="__imagestudio_body",V$=2500,j$=1200,G$=15e3,H$=3e4,z$=/(?:^|\/)(?:generate|retry|review|execute-character|expand|governance-preview|probe-provider|probe-model|recognize|re-recognize|renormalize|renormalize-batch|import-pack|migrate|restore)(?:\/|$)/;class sa extends Error{constructor(o,i,u={}){super(i);wc(this,"code");wc(this,"details");this.name="ApiClientError",this.code=o,this.details=u}}async function be(t,n){return Xu(t,{method:"GET",query:n})}async function ke(t,n){return Xu(t,{method:"POST",body:n})}async function sr(t,n){return Xu(t,{method:"PUT",body:n})}async function Oc(t,n){return Xu(t,{method:"DELETE",body:n})}function $u(){const t=typeof window>"u"?void 0:window.AstrBotPluginPage;return t&&(typeof t.apiGet=="function"||typeof t.apiPost=="function")?"plugin-bridge":"direct-fetch"}async function Xu(t,n={}){const o=await J$();if(o){const v=await Q$(o,t,n);if(v===void 0)throw new sa("invalid_api_response","AstrBot Plugin Page bridge returned no response",{endpoint:t,method:n.method??"GET",transport:"plugin-bridge"});return km(v)}const i=tP(t,n.query);let u;try{u=await fetch(i,{method:n.method??"GET",headers:n.body===void 0?void 0:{"Content-Type":"application/json"},body:n.body===void 0?void 0:JSON.stringify(n.body)})}catch(v){throw new sa("network_unreachable","无法连接 ImageStudio 后端接口",{endpoint:t,transport:"direct-fetch",url:i,reason:v instanceof Error?v.message:String(v)})}const c=await X$(u,t,i);if(!u.ok&&!af(c)&&!jg(c))throw new sa("http_error",`接口请求失败(HTTP ${u.status})`,{endpoint:t,transport:"direct-fetch",url:i,status:u.status,status_text:u.statusText});return km(c)}async function Q$(t,n,o){const i=o.method??"GET";if(typeof t.ready=="function")try{await Dc(Promise.resolve(t.ready()),j$,"AstrBot Plugin Page bridge readiness timed out")}catch{}if(i==="GET"&&typeof t.apiGet=="function")return Dc(t.apiGet(n,eP(o.query)),G$,"AstrBot Plugin Page GET request timed out");if(i==="POST"&&typeof t.apiPost=="function"){const u=Y$(n);return Dc(t.apiPost(n,o.body),u,`AstrBot Plugin Page POST request timed out after ${Math.round(u/1e3)} seconds`)}if(i==="PUT"&&typeof t.apiPut=="function")return t.apiPut(n,o.body);if(i==="PATCH"&&typeof t.apiPatch=="function")return t.apiPatch(n,o.body);if(i==="DELETE"&&typeof t.apiDelete=="function")return t.apiDelete(n);if(["PUT","PATCH","DELETE"].includes(i)&&typeof t.apiPost=="function")return t.apiPost(n,{[U$]:i,[K$]:i==="DELETE"?{}:o.body===void 0?{}:o.body});throw new sa("bridge_method_unavailable",`AstrBot Plugin Page bridge does not support ${i}`,{endpoint:n,method:i,transport:"plugin-bridge"})}function Y$(t){return z$.test(t)?F$:H$}async function J$(){if(typeof window>"u")return;if(window.AstrBotPluginPage)return window.AstrBotPluginPage;if(window.parent===window)return;const t=Date.now()+V$;for(;Date.now()<t;)if(await new Promise(n=>window.setTimeout(n,100)),window.AstrBotPluginPage)return window.AstrBotPluginPage}function Dc(t,n,o){return new Promise((i,u)=>{const c=window.setTimeout(()=>u(new sa("bridge_timeout",o)),n);t.then(v=>{window.clearTimeout(c),i(v)},v=>{window.clearTimeout(c),u(v)})})}function km(t){let n=t;for(let o=0;o<4;o+=1){if(af(n)){if(!n.ok)throw new sa(n.error_code,n.message,n.details??{});n=n.data;continue}if(jg(n)){if(n.status==="error"){if(af(n.data)){n=n.data;continue}throw new sa(n.error_code||"astrbot_bridge_error",n.message||n.error||"AstrBot Plugin Page bridge request failed",n.details??Z$(n.data))}n=n.data;continue}return n}throw new sa("invalid_api_response","API response wrapper nesting is too deep")}async function X$(t,n,o){const i=t.headers.get("content-type")??"";if(!(i.includes("application/json")||i.includes("+json"))){const c=(await t.text()).slice(0,240);throw new sa("invalid_api_response","接口返回了非 JSON 响应",{endpoint:n,transport:"direct-fetch",url:o,status:t.status,status_text:t.statusText,content_type:i,preview:c})}try{return await t.json()}catch(c){throw new sa("invalid_api_response","接口返回格式不正确",{endpoint:n,transport:"direct-fetch",url:o,status:t.status,status_text:t.statusText,content_type:i,reason:c instanceof Error?c.message:String(c)})}}function af(t){return!t||typeof t!="object"||!("ok"in t)||typeof t.ok!="boolean"?!1:t.ok?"data"in t:"error_code"in t&&"message"in t}function jg(t){return!t||typeof t!="object"||!("status"in t)?!1:t.status==="error"||t.status==="ok"&&"data"in t}function Z$(t){return t&&typeof t=="object"?{bridge_data:t}:{}}function eP(t){if(!t)return;const n={};for(const[o,i]of Object.entries(t))i!==void 0&&(n[o]=i);return n}function tP(t,n){const o=t.replace(/^\/+/,""),i=new URL(`${D$}/${o}`,window.location.origin);for(const[u,c]of Object.entries(n??{}))c!==void 0&&i.searchParams.set(u,String(c));return`${i.pathname}${i.search}`}function Na(t,n){const o=new Set;return t.filter(i=>{const u=n(i);return o.has(u)?!1:(o.add(u),!0)})}function ur(t){return Na(t,n=>n)}const aP=["data-theme"],nP={class:"workbench","aria-label":"ImageStudio workspace"},lP={class:"topbar"},oP={class:"active-heading"},rP={class:"search-box","data-overlay-root":"search"},iP=["aria-expanded","aria-activedescendant","onKeydown"],sP={key:0,id:"global-search-results",class:"search-results",role:"listbox"},uP=["id","aria-selected","onMouseenter","onMousedown"],dP={key:0},cP={class:"top-actions"},fP=["aria-checked","title"],vP={class:"notification-wrap","data-overlay-root":"notifications"},pP=["aria-expanded"],mP={key:0},gP={class:"notification-popover"},yP={key:0},_P=["aria-expanded"],bP={class:"log-wrap","data-overlay-root":"logs"},wP=["aria-expanded"],hP={key:0,id:"log-popover",class:"log-popover","data-overlay-root":"logs"},kP={key:"empty",class:"empty-row"},CP=["title"],$P=["disabled"],PP={key:0,id:"palette-panel",class:"palette-panel","data-overlay-root":"palette"},IP=["onClick"],SP={key:0,id:"notification-panel",class:"notification-panel","data-overlay-root":"notifications"},xP={class:"filter-tabs"},RP=["aria-pressed","onClick"],MP=["src"],AP={key:1},EP=["onClick"],TP={key:"empty",class:"empty-row"},NP={key:1,class:"generate-page","data-module":"generate"},LP={class:"generate-hero"},BP={class:"generate-mode-actions","aria-label":"生成模式入口"},qP=["aria-pressed","onClick"],OP={key:0,class:"image-generation-workspace"},DP={class:"image-generation-canvas"},WP={class:"image-preview-panel"},FP={key:0,class:"image-preview-list"},UP=["onClick"],KP={class:"preview-thumb"},VP=["src","alt"],jP={key:1},GP={key:1,class:"image-preview-empty"},HP={class:"image-display-panel"},zP={class:"image-stage"},QP=["title"],YP=["src","alt"],JP={key:1,class:"image-stage-empty"},XP={class:"image-info-card"},ZP={class:"image-chat-intro"},eI={class:"prompt-mode-switch",role:"radiogroup","aria-label":"提示词处理方式"},tI=["aria-pressed"],aI=["aria-pressed"],nI={class:"image-composer"},lI={class:"image-composer-input"},oI=["onKeydown"],rI={key:0,class:"image-composer-hint","aria-hidden":"true"},iI={class:"image-last-request"},sI={class:"image-composer-toolbar"},uI={class:"image-composer-left"},dI=["disabled"],cI={class:"model-select-control",title:"选择生图模型"},fI=["disabled"],vI=["value"],pI={key:0,class:"model-state",role:"status","aria-live":"polite"},mI={key:1,class:"model-state model-state-error",role:"alert"},gI={class:"image-composer-right"},yI=["title","disabled"],_I={key:1,class:"quick-profile-workspace"},bI={class:"quick-profile-layout"},wI={class:"quick-profile-surface quick-profile-library"},hI={class:"quick-profile-section-header"},kI={class:"quick-profile-library-list"},CI=["data-profile-card-id","onClick"],$I={class:"quick-profile-library-thumb"},PI=["src","alt"],II={class:"quick-profile-library-copy"},SI={class:"quick-profile-library-meta"},xI={class:"quick-profile-surface quick-profile-detail"},RI={class:"quick-profile-profile-card"},MI=["title"],AI=["src","alt"],EI={key:1,class:"quick-profile-image-empty"},TI={class:"quick-profile-profile-field name"},NI={class:"quick-profile-profile-field identity"},LI={class:"quick-profile-profile-field style"},BI={class:"quick-profile-profile-field summary"},qI={class:"quick-profile-surface quick-profile-image-panel"},OI={class:"quick-profile-section-header"},DI={class:"quick-profile-hero-image"},WI=["title"],FI=["src","alt"],UI={key:1,class:"quick-profile-image-empty"},KI={class:"quick-profile-image-types"},VI=["onClick"],jI=["src","alt"],GI={key:1,class:"quick-profile-image-empty"},HI={class:"quick-profile-surface quick-profile-material-zone"},zI={class:"quick-profile-section-header"},QI={class:"quick-profile-material-strip"},YI=["data-material-category","aria-expanded","onClick"],JI=["src","alt"],XI={key:1,class:"quick-profile-empty-media-mark"},ZI={class:"quick-profile-material-copy"},eS={class:"quick-profile-material-picker-header"},tS={key:0,class:"quick-profile-material-picker-groups","aria-label":"配饰分类"},aS=["onClick"],nS=["data-material-reference-id","onClick"],lS={class:"quick-profile-material-picker-media"},oS=["src","alt"],rS={key:1,class:"quick-profile-empty-media-mark"},iS={class:"quick-profile-material-picker-copy"},sS={key:0},uS={class:"quick-profile-material-picker-copy"},dS={class:"quick-profile-surface quick-profile-command-zone"},cS={class:"quick-profile-section-header"},fS={class:"quick-profile-command-list"},vS={class:"quick-profile-command-top"},pS={class:"feature-badge"},mS=["disabled"],gS=["disabled"],yS=["onClick"],_S={key:3,class:"feature-action"},bS={key:0,class:"generation-notice",role:"status","aria-live":"polite"},wS={key:1,class:"generation-error",role:"alert"},hS={key:0,class:"image-viewer-backdrop quick-profile-detail-backdrop",role:"dialog","aria-modal":"true","aria-label":"角色设定详情"},kS={class:"quick-profile-detail-card","data-overlay-root":"quickProfileDetail"},CS=["src","alt"],$S={key:1,class:"quick-profile-image-empty"},PS={class:"quick-profile-detail-card-info"},IS=["aria-label"],SS={class:"quick-profile-viewer-card","data-overlay-root":"imageViewer"},xS=["src","alt"],RS={class:"quick-profile-viewer-info"},MS={key:2,class:"workflow-workspace"},AS={class:"generate-status-grid workflow-status-grid"},ES={class:"workflow-layout"},TS={class:"workflow-surface workflow-node-flow"},NS={class:"workflow-section-header"},LS={class:"workflow-node-list"},BS=["disabled","onClick"],qS={class:"workflow-group-index"},OS={class:"workflow-group-copy"},DS={class:"workflow-node-progress","aria-hidden":"true"},WS={class:"workflow-node-meta"},FS={key:0,class:"workflow-subnode-list"},US=["aria-label","onClick"],KS={class:"workflow-subnode-index"},VS={class:"workflow-subnode-copy"},jS={key:0,"aria-hidden":"true"},GS={class:"workflow-surface workflow-preview-panel"},HS={class:"workflow-section-header"},zS={key:0,class:"workflow-preview-tools workflow-preview-tools-split"},QS={key:1,class:"workflow-preview-tools workflow-preview-tools-import"},YS={key:2,class:"workflow-preview-tools workflow-preview-tools-import"},JS={key:3,class:"workflow-preview-tools"},XS=["disabled"],ZS=["disabled"],e2={key:4,class:"workflow-preview-tools workflow-preview-tools-import"},t2={key:0,class:"workflow-profile-import-stage"},a2={class:"workflow-profile-import-card select"},n2={class:"workflow-profile-import-list"},l2=["data-profile-card-id","onClick"],o2={class:"workflow-profile-import-profile-field name"},r2={class:"workflow-profile-import-profile-field identity"},i2={class:"workflow-profile-import-profile-field style"},s2={class:"workflow-profile-import-profile-field summary"},u2={class:"workflow-profile-import-current"},d2={key:1,class:"workflow-persona-split-stage"},c2={class:"workflow-persona-split-fields"},f2={key:2,class:"workflow-prompt-plan-stage"},v2={class:"workflow-prompt-plan-list"},p2={class:"workflow-prompt-plan-guard"},m2={key:3,class:"workflow-material-bind-stage"},g2=["disabled","data-material-category","aria-expanded","onClick"],y2={class:"workflow-material-bind-copy"},_2={class:"workflow-material-bind-stages"},b2={class:"quick-profile-material-picker-header"},w2={key:0,class:"quick-profile-material-picker-groups","aria-label":"配饰分类"},h2=["onClick"],k2=["data-material-reference-id","onClick"],C2={class:"quick-profile-material-picker-media"},$2=["src","alt"],P2={key:1,class:"quick-profile-empty-media-mark"},I2={class:"quick-profile-material-picker-copy"},S2={key:0},x2={key:1},R2={class:"quick-profile-material-picker-copy"},M2={key:5,class:"workflow-preview-stage"},A2=["title"],E2=["src","alt"],T2={class:"workflow-preview-caption"},N2={key:0},L2={key:1,class:"image-stage-empty"},B2={key:6,class:"workflow-draft-board"},q2={class:"workflow-draft-grid"},O2=["disabled","aria-pressed","onClick"],D2={class:"workflow-draft-thumb"},W2=["src","alt"],F2={key:1},U2={key:2},K2={class:"workflow-draft-copy"},V2={class:"workflow-candidate-actions"},j2=["disabled","onClick"],G2=["disabled","onClick"],H2=["disabled","onClick"],z2=["disabled","aria-pressed","onClick"],Q2={class:"workflow-section-header"},Y2={class:"workflow-detail-scroll"},J2={key:0,class:"workflow-persona-split-summary detail"},X2={key:1,class:"workflow-node-info"},Z2={key:2,class:"workflow-lock-notice progression"},ex={key:3,class:"workflow-lock-notice"},tx={key:4,class:"workflow-lock-notice"},ax={class:"workflow-actions"},nx={key:0},lx={key:1},ox={key:2},rx={key:3},ix={key:4},sx={class:"workflow-lifecycle"},ux=["disabled"],dx=["disabled"],cx=["disabled"],fx=["disabled"],vx=["disabled"],px={key:0,class:"workflow-lifecycle-detail"},mx={class:"workflow-action-grid"},gx={class:"feature-badge"},yx=["disabled","onClick"],_x={key:1,class:"feature-action"},bx={key:0,class:"image-viewer-backdrop external-profile-import-backdrop",role:"dialog","aria-modal":"true","aria-label":"导入外部角色卡"},wx={class:"external-profile-import-card","data-overlay-root":"externalProfileImport"},hx={class:"external-profile-import-body"},kx={class:"external-profile-import-file-row"},Cx={class:"secondary-file-picker"},$x={key:0},Px={key:1},Ix={key:2},Sx={class:"external-profile-import-source"},xx={class:"external-profile-import-preview","aria-live":"polite"},Rx=["disabled"],Mx={key:0,class:"image-viewer-backdrop persona-questionnaire-backdrop",role:"dialog","aria-modal":"true","aria-label":"创建角色档案问卷"},Ax={class:"persona-questionnaire-card","data-overlay-root":"personaQuestionnaire"},Ex={class:"persona-questionnaire-body"},Tx={class:"compact"},Nx={class:"compact"},Lx={class:"compact"},Bx={class:"compact"},qx={class:"wide"},Ox={class:"persona-questionnaire-footer-actions"},Dx={class:"questionnaire-mode-switch",role:"group","aria-label":"问卷复杂度"},Wx=["disabled"],Fx={key:3,class:"materials-page","data-module":"images"},Ux={class:"materials-hero"},Kx={key:0,class:"materials-hero-actions"},Vx=["disabled"],jx={key:1,class:"materials-hero-actions"},Gx={class:"materials-view-tabs","aria-label":"素材库视图"},Hx=["aria-pressed"],zx=["aria-pressed"],Qx=["aria-pressed"],Yx={class:"materials-workbench"},Jx={class:"materials-main-column"},Xx={class:"panel materials-library-panel"},Zx={class:"materials-library-header-actions"},eR={class:"materials-filter-strip","aria-label":"素材分类筛选"},tR=["title","aria-pressed","onClick"],aR=["title"],nR={class:"materials-semantic-filters","aria-label":"素材语义筛选"},lR=["value"],oR=["value"],rR={key:0,class:"materials-subfilter-strip","aria-label":"配饰子分类筛选"},iR=["aria-pressed","onClick"],sR={key:1,class:"skeleton-list materials-skeleton-list"},uR={key:2,class:"materials-library-grid"},dR=["onClick"],cR={class:"materials-library-thumb"},fR=["src","alt"],vR={class:"materials-library-copy"},pR={class:"materials-library-tags"},mR={class:"materials-side-column"},gR={class:"panel materials-actions-panel"},yR={class:"materials-action-grid"},_R=["disabled","onClick"],bR={key:4,class:"queue-page"},wR={class:"queue-hero"},hR={class:"queue-hero-actions"},kR=["disabled"],CR={class:"queue-workbench"},$R={class:"panel queue-board-panel"},PR={class:"queue-filter-tabs",role:"tablist","aria-label":"队列筛选"},IR=["aria-selected","onClick"],SR={key:0,class:"skeleton-list queue-skeleton-list"},xR={key:1,class:"queue-task-list"},RR=["onClick"],MR={class:"queue-task-status"},AR={class:"queue-task-main"},ER={class:"progress-track","aria-hidden":"true"},TR={class:"queue-task-meta"},NR={key:2,class:"empty-state"},LR={class:"queue-side-column"},BR={class:"panel queue-detail-panel"},qR={class:"panel queue-actions-panel"},OR={class:"queue-action-grid"},DR=["disabled","onClick"],WR={class:"overview-strip","data-module":"overview"},FR={class:"welcome-copy"},UR={class:"dashboard-layout"},KR={class:"main-column"},VR={class:"panel monitor-panel performance-summary-panel","data-module":"monitor"},jR={class:"panel queue-panel","data-module":"queue"},GR=["disabled"],HR={key:1,class:"skeleton-list"},zR={key:2,class:"queue-list"},QR={class:"queue-main"},YR={class:"progress-track"},JR={class:"row-actions","aria-label":"任务操作"},XR=["aria-label","onClick"],ZR=["aria-label","disabled","onClick"],eM={class:"panel suggestions-panel","data-module":"suggestions"},tM={key:0,class:"suggestion-grid"},aM=["onClick"],nM={class:"monitor-column","data-module":"images"},lM={class:"panel images-panel side-images-panel"},oM={key:1,class:"side-image-list"},rM={key:2,class:"side-image-list"},iM={class:"thumb"},sM=["src","alt"],uM={key:1},dM={key:3,class:"empty-state"},cM={key:9,class:"performance-detail-page","data-module":"performance"},fM={class:"detail-hero"},vM=["disabled"],pM={class:"performance-detail-grid"},mM={class:"panel performance-breakdown"},gM={class:"panel performance-breakdown"},yM={class:"panel performance-breakdown"},Pt="配饰",Ur="全部",_M=12e3,Wc=1600,bM=34,wM=138,Fc="ImageStudio Single Image",qi="standalone_single_image",Uc="__none__",Qa="character_gradual",fn="character_fast",hM="character_gradual_sequential_v1",kM=Ln({__name:"App",setup(t){const n=Ha({loader:()=>za(()=>import("./AdvancedMaterialImportPage-DB057gcV.js"),__vite__mapDeps([0,1])),onError(e,a,r,s){var f;const d="imagestudio:asset-reload-attempt";if(s===1&&!sessionStorage.getItem(d)){sessionStorage.setItem(d,"1"),(f=window.top)==null||f.location.reload();return}sessionStorage.removeItem(d),r()}}),o=Ha(()=>za(()=>import("./GalleryPage-DUcHf5nl.js"),__vite__mapDeps([2,3]))),i=Ha(()=>za(()=>import("./LogsPage-C3sWUIbU.js"),__vite__mapDeps([4,5]))),u=Ha(()=>za(()=>import("./ProfilesPage-BUhp8Mbx.js"),__vite__mapDeps([6,7]))),c=Ha(()=>za(()=>import("./SettingsPage-PMbwCFIc.js"),__vite__mapDeps([8,9]))),v=Ha(()=>za(()=>import("./WorkflowCompareDialog-B6QU9VXO.js"),__vite__mapDeps([10,11]))),m=Ha(()=>za(()=>import("./WorkflowBranchPanel-BzUOh1Fe.js"),__vite__mapDeps([12,13]))),_=Ha(()=>za(()=>import("./WorkflowCandidatePool-xYs54DEH.js"),__vite__mapDeps([14,15]))),I=Ha(()=>za(()=>import("./WorkflowComposer-4G3HjilB.js"),__vite__mapDeps([16,17]))),k=Ha(()=>za(()=>import("./WorkflowDependencyContextCard-Co0RbxVo.js"),__vite__mapDeps([18,19]))),M=Ha(()=>za(()=>import("./WorkflowGenerationReviewDialog-CuaoeoDj.js"),__vite__mapDeps([20,21]))),q=Ha(()=>za(()=>import("./WorkflowMaterialDrawer-BzNNeBcr.js"),__vite__mapDeps([22,23]))),K=Ha(()=>za(()=>import("./WorkflowRoundPanel-tK6RJEXx.js"),__vite__mapDeps([24,25]))),ee=new Set(["draft","planned","queued","running","active","processing"]),j=new Set(["succeeded","success","completed"]),fe=[{key:"image",label:"图片生成",detail:"提示词、模型、素材和结果"},{key:"quickProfile",label:"快速角色",detail:"角色草稿、素材和衣橱"},{key:"workflow",label:"角色工作流",detail:"多节点流程、队列和审核"}],ie={image:["new-generation","prompt-compose","node-generate","model-route","material-pick","queue-control","review-select","gallery-archive"],quickProfile:["quick-profile","prompt-compose","material-pick","wardrobe-match","daily-outfit","gallery-archive"],workflow:["workflow-create","node-generate","model-route","material-pick","wardrobe-match","queue-control","review-select","gallery-archive"]},V=[{id:"material-category-style",category:"风格",colors:["#3f7edc","#d65b7f","#2ec4b6"]},{id:"material-category-composition",category:"构图",colors:["#7168f0","#2fbda8","#f5c542"]},{id:"material-category-clothing",category:"服装",colors:["#2f7a60","#111827","#d2a23a"]},{id:"material-category-footwear",category:"鞋袜",colors:["#111827","#64748b","#2fbda8"]},{id:"material-category-accessory",category:"配饰",colors:["#0f766e","#38bdf8","#f8fafc"]}],_e=["眼部","头部","手部","胸前","颈部","腰部","脸部","臂部"],X=V.map((e,a)=>({category_id:`cat_imagestudio_${e.category}`,name:e.category,parent_id:null,category_type:"material",sort_order:(a+1)*10,metadata:{source:"imagestudio_frontend",frontend_group:e.category}})),ve=_e.map((e,a)=>({category_id:`cat_imagestudio_accessory_${e}`,name:e,parent_id:`cat_imagestudio_${Pt}`,category_type:"accessory_group",sort_order:(a+1)*10,metadata:{source:"imagestudio_frontend",parent_category:Pt}})),We=[{title:"生成图片",description:"进入生成流程入口",keywords:["生成","图片","prompt","生图"],nav:"generate",module:"generate"},{title:"查看队列",description:"检查等待、运行和失败任务",keywords:["队列","任务","等待","失败","重试"],nav:"queue",module:"queue"},{title:"最近图片",description:"查看最新生成结果",keywords:["最近","图片","图库","缩略图"],nav:"gallery",module:"images"},{title:"模型设置",description:"检查模型站点和调用配置",keywords:["模型","provider","配置","站点"],nav:"settings",module:"settings"},{title:"数据库设置",description:"检查存储和数据库连接",keywords:["数据库","存储","sqlite","postgres"],nav:"settings",module:"settings"},{title:"日志审计",description:"查看错误、生成和系统事件",keywords:["日志","错误","审计","事件"],nav:"logs",module:"logs"},{title:"今日成本",description:"检查生成调用和成本提醒",keywords:["成本","费用","调用","统计"],nav:"performance",module:"performance"},{title:"性能监控",description:"查看服务、队列、调用和存储详情",keywords:["性能","监控","worker","运行","存储"],nav:"performance",module:"performance"},{title:"素材库",description:"查看素材和衣橱相关入口",keywords:["素材","衣橱","角色","材料"],nav:"materials",module:"images"}],Ie=[{name:"星图紫青",primary:"#7168f0",accent:"#2fbda8"},{name:"极光蓝青",primary:"#3f7edc",accent:"#2ec4b6"},{name:"松石玫红",primary:"#209b8d",accent:"#d65b7f"},{name:"墨绿金盏",primary:"#2f7a60",accent:"#d2a23a"}],de=P(null),G=P(iv()),E=P(null),B=P(null),N=P([]),Se=P([]),st=P(null),ht=P([]),Ze=P([]),it=P([]),He=P([]),Ba=P([]),Bn=P(null),ze=P(null),zt=P([]),qn=P(null),Vl=P([]),No=P([]),St=P([]),va=P(null),On=P([]),ae=P({}),L=P({}),Ge=P({}),C=P(""),x=P({}),R=P({}),D=P({}),F=P($_()),W=P(R_()),H=P("image"),Z=P(!1),Q=P(!1),U=P(""),we=P(""),te=P(""),ye=P("direct"),Pe=P(!1),Fe=P(""),at=P(""),Qe=P([]),_t=P({}),Tt=new Map,Ca=new Set,pa=new Map,Ja=P(!1),Dn=P(""),Qt=P(null),jt=P(""),Wn=P("active"),$a=P(""),Pa=P(""),yn=P(""),ni=P(""),li=P(""),ss=P(0),yl=P(""),xt=P(""),Xa=P(""),jl=P(null),kt=P(!1),Dt=P(""),mr=P(null),Gl=P(!1),Zu=P(!1),Cf=P(!1),_l=P("avatar"),Ye=P("brief-import"),Fn=P(""),Ia=P([]),Ct=P(""),qa=P({}),Lo=P(!1),_n=P(""),ed=P(""),td=P(""),bl=P({name:"",identity:"",genderPresentation:"",ageStage:"",species:"",bodyType:"",distinctiveFeatures:"",personality:"",hairColor:"",hairstyle:"",eyeColor:"",clothing:"",style:"",negative:""}),Bo=P(""),Un=P({}),gt=P(""),Hl=P(Ur),ad=P(null),us=P(!1),ds=P(!1),cs=P(""),fs=P(""),zl=P(""),vs=P(!1),ps=P(!1),ms=P(!1),oi=P(""),gs=P(""),nd=P(!1),qo=P(""),Kn=P("simple"),Ce=P(S$()),Yt=P([]),Sa=P([]),bn=P([]),Oo=P(M_()),ys=P("avatar"),_s=P(""),Vn=P({}),$f=P(0),ri=P(!1),ii=P(""),jn=P(""),Za=P(""),gr=P(!1),yr=P(""),_r=P(!1),Do=P(""),si=P(""),ui=P(!1),Ql=P(""),Re=P(!1),en=P(!1),Yl=P(""),ld=P(null),me=P(""),Wo=P(!1),Oa=P(""),bs=P(""),Gn=P(""),Jl=P({}),ws=P({}),hs=P(""),di=P(""),Hn=P({}),wn=P({}),od=P({}),ci=P(""),br=P(""),Je=P(""),rd=P(""),hn=P(""),wr=P(4),fi=P(""),vi=P(""),Fo=P(!1),kn=P(null),ma=P(!1),zn=P(""),ks=P(!1),Cn=P(null),Cs=P(!1),$s=P(!1),Jt=P(""),Uo=P(""),wl=P(""),Xl=P([]),Xe=P({}),pi=P({}),Rt=P({}),je=P({}),bt=P({}),Gg=[{key:"roleCore",label:"角色核心"},{key:"genderPresentation",label:"性别表现"},{key:"ageStage",label:"年龄阶段"},{key:"species",label:"物种 / 种族"},{key:"bodyType",label:"体型"},{key:"distinctiveFeatures",label:"显著特征"},{key:"personality",label:"性格关键词"},{key:"appearance",label:"外观特征"},{key:"outfit",label:"服装与配饰"},{key:"scene",label:"常用场景"},{key:"avoid",label:"避雷内容"}],Ps=P("draft"),Is=P(""),id=P(!1),hr=P(!1),tn=P(0),Pf=P(null),Qn=P("dark"),Zl=P(Ie[0].primary),eo=P(Ie[0].accent),Ss=P(!1),xs=P(!1),Rs=P(!1),to=P(!1),Ms=P("generation"),hl=P(1),ao=P({x:0,y:0}),Ko=P(!1),Vo=P({pointerId:-1,x:0,y:0,offsetX:0,offsetY:0}),kr=P(!0),$n=P(!0);let mi,Cr,jo,As=0,Es="",gi;const yi=P("all"),an=P([]),$r=P([]),kl=P(!1),sd=P(!1),ud=P(!1),Da=P(!1),Ts=P(!1),Ns=P(!1),dd=P(!1),Yn=P(!1),cd=P(!1),_i=P(!1),Wa=P(""),Ls=P(""),bi=P(""),Xt=P(""),wt=P(""),fd=P(""),xa=P(""),nn=P(""),ln=P(null),no=P(""),Jn=P(""),lo=P(""),Go=P(!1),vd=P(""),Pr=P(""),on={theme:"imagestudio.navigation.theme",primary:"imagestudio.navigation.primary",accent:"imagestudio.navigation.accent",navigationPinned:"imagestudio.navigation.pinned.v2",readNotifications:"imagestudio.navigation.readNotifications",dismissedNotifications:"imagestudio.navigation.dismissedNotifications"},If=["search","palette","notifications","logs","imageViewer","materialPicker","materialDetail","materialCategoryCreate","materialOperation","personaQuestionnaire","quickProfileDetail","externalProfileImport"],Pn=[{nodeKey:"quick_avatar",title:"快速头像",detail:"五官、表情与发型",aspectRatio:"1:1",sortOrder:10},{nodeKey:"quick_bust",title:"快速半身像",detail:"上半身服装与姿态",aspectRatio:"3:4",sortOrder:20},{nodeKey:"quick_stand",title:"快速立绘",detail:"全身比例与完整服装",aspectRatio:"2:3",sortOrder:30},{nodeKey:"quick_sheet",title:"快速设定图",detail:"多视角与细节拆分",aspectRatio:"16:9",sortOrder:40}];let Ir,Bs,qs=0;const pd=new Map,md=new Map,Sf=S(()=>kl.value||Da.value||Ts.value||Ns.value),xf=S(()=>G.value.state),Hg=S(()=>G.value.state!=="connected"),Sr=S(()=>oi.value.trim()),gd=S(()=>R$(Sr.value)),yd=S(()=>Gg.map(e=>({...e,value:gd.value[e.key],recognized:gd.value.recognizedKeys.includes(e.key)}))),zg=S(()=>yd.value.filter(e=>e.recognized).length),Qg=S(()=>Wi.find(e=>e.key===F.value)??Wi[0]),oo=S(()=>{var a;const e=(a=E.value)==null?void 0:a.queue;return e?e.pending+e.running+e.failed+e.dead_letter:0}),ta=S(()=>{var a;return(a=st.value)!=null&&a.items.length?st.value.items:Yg.value}),_d=S(()=>ta.value.slice(0,6)),Yg=S(()=>{var e;return((e=E.value)==null?void 0:e.recent_jobs.map(Mh).filter(Ah))??[]}),Jg=S(()=>new Map(Yt.value.map(e=>[e.profile_id,e]))),Xg=S(()=>{const e=[...Object.values(Xe.value),...Object.values(Rt.value).flat()];return new Map(Na(e,a=>a.workflow_id).map(a=>[a.workflow_id,a]))}),Zg=S(()=>{const e=Object.values(je.value).flat();return new Map(Na(e,a=>a.node_id).map(a=>[a.node_id,a]))}),ro=S(()=>N.value.slice(0,8)),Ho=S(()=>{const e=Qe.value.filter(Va),a=new Set;return e.filter(r=>a.has(r.image_id)?!1:(a.add(r.image_id),!0)).slice(0,10)}),Rf=S(()=>[...ko([...Qe.value,...Object.values(bt.value).flat(),...Se.value.map(Ti),...ro.value.map(Ti)]).filter(Va)].sort((a,r)=>Rn(r.created_at)-Rn(a.created_at)).map(a=>({...a,image_url:sn(a.image_url),thumbnail_url:sn(a.thumbnail_url)}))),aa=S(()=>Ho.value.length?Ho.value.find(e=>e.image_id===U.value)??Ho.value[0]:null),ey=S(()=>{const e=aa.value;return e?[{label:"状态",value:e.status},{label:"来源",value:e.source},{label:"工作流",value:e.workflow_id||"-"},{label:"节点",value:e.node_id||"-"},{label:"角色",value:e.profile_id||"-"},{label:"模型",value:e.model},{label:"尺寸",value:e.size},{label:"Seed",value:e.seed},{label:"耗时",value:e.duration},{label:"提示词",value:e.prompt},{label:"时间",value:Tl(e.created_at)}]:[{label:"来源",value:"等待生成"},{label:"状态",value:"暂无图片"},{label:"提示",value:"左侧生成结果会在这里显示"}]}),ty=S(()=>`translate3d(${ao.value.x}px, ${ao.value.y}px, 0) scale(${hl.value})`),Mf=S(()=>{var s;const e=Et((s=ze.value)==null?void 0:s.config.generation)?ze.value.config.generation:void 0,a=Array.isArray(e==null?void 0:e.adapters)?e.adapters:e!=null&&e.provider?[e.provider]:[],r=se(e,"default_model");return a.flatMap(d=>{if(!Et(d)||d.enabled===!1)return[];const f=se(d,"id")||se(d,"provider_id"),p=se(d,"model_id");if(!f||!p||p==="auto-discovery")return[];const h=Vl.value.find(O=>O.provider_id===f&&O.model_id===p&&Ih(O)),T=se(d,"route_name")||(p===r?r:f);return[{value:`${f}/${p}`,label:p,provider:se(d,"name")||se(d,"display_name")||f,status:(h==null?void 0:h.status)||"configured",routeName:T}]})}),io=S(()=>{const e=new Set;return Mf.value.filter(a=>e.has(a.value)?!1:(e.add(a.value),!0))}),xr=S(()=>io.value.find(e=>e.value===jt.value)??io.value[0]),bd=S(()=>dd.value?"同步中":Mf.value.length?"":G.value.state!=="connected"?"等待后端连接":vd.value?"模型目录读取失败":"尚未配置生图模型"),Fa=S(()=>V.reduce((e,a)=>{const r=Un.value[a.category],s=so.value.find(d=>d.id===r&&d.category===a.category);return s&&e.push(s),e},[])),wd=S(()=>so.value.find(e=>e.id===Bo.value)??Fa.value[0]??null),ay=S(()=>{const e=Fa.value.length;return e?`${e} 个已选`:"未使用"}),ny=S(()=>{const e=St.value.map(a=>[a.category_id,a.name]);return new Map(e)}),ly=S(()=>W.value==="standard"?"角色参考素材工作台":W.value==="advanced"?"高还原度进阶素材库":"进阶素材识别与验证"),oy=S(()=>W.value==="standard"?"集中管理参考图、识别结果、分类、素材包导入和角色衣橱绑定,后续角色工作流会从这里读取可确认素材。":W.value==="advanced"?"只展示经过源图与验证图人工对照、明确封存的高优先级素材;数据和图片与普通素材严格隔离。":"导入源图后自动识别并生成验证图,可根据还原度多轮调整描述,确认满意后再封存入库。"),hd=S(()=>On.value.filter(e=>Zs(e)==="advanced"&&Be(e.status)!=="archived").map(Z_)),Af=S(()=>{var e;return Na([...hd.value,...(((e=va.value)==null?void 0:e.items)??[]).filter(a=>Be(a.recognition_status)==="confirmed")],a=>a.material_id)}),ry=S(()=>Af.value.map(eb).filter(e=>!!e)),so=S(()=>[...ry.value].sort((e,a)=>+!!a.advanced-+!!e.advanced||Number(a.priority||0)-Number(e.priority||0))),wi=S(()=>{var a;return(((a=va.value)==null?void 0:a.items)??[]).map((r,s)=>lb(r))}),kd=S(()=>{var e;return Pa.value||((e=uo.value[0])==null?void 0:e.id)||""}),zo=S(()=>{var d,f;const e=wi.value,a=((d=co.value)==null?void 0:d.categoryIds)??[],r=a.length?e.filter(p=>a.includes(p.categoryId)):[];return(((f=co.value)==null?void 0:f.label)!==Pt||!yn.value?r:r.filter(p=>p.subcategory===yn.value)).filter(p=>(!ni.value||p.bodySlots.includes(ni.value))&&(!li.value||p.wearLayer===li.value)&&p.confidence>=ss.value)}),Rr=S(()=>zo.value.length?zo.value.find(e=>e.id===yl.value)??zo.value[0]:null),hi=S(()=>{var a;const e=Rr.value;return!e||e.source!=="backend"?null:((a=va.value)==null?void 0:a.items.find(r=>r.material_id===e.id))??null}),Ef=S(()=>St.value.filter(e=>!e.parent_id&&e.category_type!=="accessory_group")),iy=S(()=>{const e=Ef.value.filter(a=>Xs(a.name)===Pt).map(a=>a.category_id);return e.length?St.value.filter(a=>a.parent_id&&e.includes(a.parent_id)):[]}),uo=S(()=>{const e=wi.value,a=new Map;for(const d of e)a.set(d.categoryId,(a.get(d.categoryId)??0)+1);const r=new Map;for(const d of Ef.value){const f=Xs(d.name);r.set(f,[...r.get(f)??[],d])}return Array.from(r.entries()).map(([d,f])=>{const p=ab(f),h=p.map(O=>O.category_id),T=h.reduce((O,Y)=>O+(a.get(Y)??0),0);return{id:p[0].category_id,label:d,categoryIds:h,count:T,detail:nb(d),endpoint:p.map(O=>A.materialCategory(O.category_id)).join(" / "),tone:T?"good":"idle",source:"backend"}}).sort((d,f)=>Iv(d.label)-Iv(f.label))}),co=S(()=>uo.value.find(e=>e.id===Pa.value)??uo.value[0]??null),sy=S(()=>{var a,r;const e=(a=Os.value.find(s=>s.id===yn.value))==null?void 0:a.categoryId;return e||(((r=co.value)==null?void 0:r.categoryIds.find(s=>St.value.some(d=>d.category_id===s)))??"")}),Qo=S(()=>uo.value.find(e=>e.label===Pt)??null),Os=S(()=>{var r;if(((r=co.value)==null?void 0:r.label)!==Pt)return[];const e=co.value.categoryIds;if(!e.length)return[];const a=new Map;for(const s of wi.value.filter(d=>e.includes(d.categoryId))){const d=s.subcategory||"其他";a.set(d,(a.get(d)??0)+1)}return iy.value.map(s=>({id:s.name,label:s.name,count:a.get(s.name)??0,categoryId:s.category_id,source:"backend"}))}),Ds=S(()=>{var e;return((e=co.value)==null?void 0:e.label)===Pt}),uy=S(()=>Ds.value?"添加配饰子类":"添加素材分类"),dy=S(()=>{var e;return Ds.value?((e=Qo.value)==null?void 0:e.source)==="backend"?Qo.value.label:"配饰父分类尚未落库":"无,作为主分类创建"}),cy=S(()=>A.materialCategories),fy=S(()=>{var f;const e=wi.value,a=((f=va.value)==null?void 0:f.total)??0,r=e.filter(p=>Be(p.status)==="confirmed").length,s=e.filter(p=>!["confirmed","archived"].includes(Be(p.status))).length,d=Fa.value.length;return[{label:"素材总量",value:String(a||e.length),hint:G.value.state!=="connected"?"等待后端连接":a?"来自后端素材库":"后端素材库为空",state:e.length?"good":"idle"},{label:"分类",value:String(uo.value.length),hint:"风格、构图、服装、鞋袜、配饰等",state:uo.value.length?"good":"idle"},{label:"待确认",value:String(s),hint:r?`${r} 条已确认`:"登记 URI 后需要识别或确认的素材",state:s&&a?"warn":"idle"},{label:"已选参考",value:String(d),hint:d?"会进入角色素材绑定":"默认不使用参考",state:d?"good":"idle"}]}),vy=S(()=>{const e=Rr.value;return e?[{label:"名称",value:e.label},{label:"分类",value:e.category},{label:"子分类",value:e.subcategory||"-"},{label:"状态",value:e.statusText},{label:"来源",value:"后端素材库"},{label:"标签",value:e.tags.length?e.tags.join("、"):"-"},{label:"正向词",value:e.prompt||"-"},{label:"负向词",value:e.negativePrompt||"-"},{label:"接口",value:e.endpoint},{label:"更新时间",value:e.updatedAt}]:[{label:"状态",value:"暂无素材"},{label:"提示",value:G.value.state==="connected"?"后端素材会在这里显示详情。":"连接后端后显示素材详情。"}]}),Tf=S(()=>{var Y,J;const e=(Y=de.value)==null?void 0:Y.permissions,a=(J=de.value)==null?void 0:J.feature_flags,r=!!(e!=null&&e.can_manage_materials),s=!!(a!=null&&a.material_library),d=Rr.value,f=(d==null?void 0:d.source)==="backend"?d:null,p=hi.value,h=he.value,T=kt.value,O=!!(a!=null&&a.wardrobe&&r&&(h!=null&&h.profileId)&&p&&Be(p.recognition_status)==="confirmed"&&!T);return[{id:"refresh",title:"刷新素材库",detail:"重新读取分类和素材列表。",badge:"GET",endpoint:`${A.materialCategories} / ${A.materials}`,action:Yn.value?"同步中":"刷新",tone:"primary",enabled:!Yn.value},{id:"upload",title:"登记素材 URI",detail:"登记已有 storage:// 图片、名称和分类;不会伪装成浏览器文件上传。",badge:"URI",endpoint:A.materialUpload,action:T&&jl.value==="register-uri"?"登记中":"打开表单",tone:s&&r?"accent":"neutral",enabled:!!(s&&r&&!T)},{id:"create-category",title:"添加分类",detail:"打开添加卡片,提交后写入后端分类表。",badge:"Category",endpoint:A.materialCategories,action:Gl.value?"创建中":"打开",tone:r?"accent":"neutral",enabled:!!(r&&!Gl.value)},{id:"recognize",title:"识别当前素材",detail:"调用素材 VLM 工作流,回填提示词、标签和识别状态。",badge:"VLM",endpoint:f?A.materialRecognize(f.id):A.materialRecognize(":materialId"),action:Xa.value==="recognize"?"识别中":"识别",tone:f?"accent":"neutral",enabled:!!(s&&r&&f&&!Xa.value)},{id:"re-recognize",title:"重新识别",detail:"保留素材记录,重新跑一次识别链路。",badge:"Retry",endpoint:f?A.materialReRecognize(f.id):A.materialReRecognize(":materialId"),action:Xa.value==="re-recognize"?"重跑中":"重识别",tone:f?"warn":"neutral",enabled:!!(s&&r&&f&&!Xa.value)},{id:"confirm",title:"确认入库",detail:"把当前识别结果确认成可绑定素材。",badge:"Confirm",endpoint:f?A.materialConfirm(f.id):A.materialConfirm(":materialId"),action:Xa.value==="confirm"?"确认中":"确认",tone:f?"primary":"neutral",enabled:!!(s&&r&&f&&!Xa.value)},{id:"asset-pack",title:"导入素材包",detail:"接收素材包 URI,支持 dry-run 预检查再执行导入。",badge:"Pack",endpoint:A.assetImportPack,action:T&&jl.value==="asset-pack"?"处理中":"预检查",tone:s&&r?"accent":"neutral",enabled:!!(s&&r&&!T)},{id:"wardrobe",title:"导入角色衣橱",detail:"将确认素材并入当前角色衣橱,用于穿搭匹配。",badge:"Wardrobe",endpoint:h!=null&&h.profileId?A.wardrobeImportMaterial(h.profileId):A.wardrobeImportMaterial(":profileId"),action:T&&jl.value==="wardrobe"?"导入中":"选择分类",tone:O?"accent":"neutral",enabled:O},{id:"workflow-bind",title:"进入素材绑定",detail:"回到角色工作流的参考素材绑定节点,保存到后端工作流。",badge:"Workflow",endpoint:h!=null&&h.workflowId?A.workflow(h.workflowId):A.node(":material_bind_node_id"),action:"打开节点",tone:h!=null&&h.workflowId?"primary":"neutral",enabled:!!(h!=null&&h.workflowId),nav:"generate",module:"generate"}]}),Ws=S(()=>so.value.filter(e=>e.category===gt.value)),Nf=S(()=>[Ur,...ur(so.value.filter(e=>e.category===Pt).map(e=>e.group??"其他"))]),Cd=S(()=>gt.value!==Pt||Hl.value===Ur?Ws.value:Ws.value.filter(e=>(e.group??"其他")===Hl.value)),Lf=S(()=>{const e=Cd.value.length,a=Ws.value.length;return gt.value===Pt&&Hl.value!==Ur?`${e} / ${a} 项`:`${a} 项`}),Fs=S(()=>gt.value===Pt&&Hl.value!==Ur),Bf=S(()=>{var e;return((e=ad.value)==null?void 0:e.category)===gt.value?`${ad.value.category}添加入口已预留`:"跳转到素材库添加"}),Ue=S(()=>{const e=bl.value,a=e.name.trim()||"未命名角色",r=e.personality.trim(),s=[a,e.identity.trim(),e.genderPresentation.trim()?`gender presentation: ${e.genderPresentation.trim()}`:"",e.ageStage.trim()?`age stage: ${e.ageStage.trim()}`:"",e.species.trim()?`species: ${e.species.trim()}`:"",r?`personality: ${r}`:""].filter(Boolean).join(", "),d=[e.hairColor.trim()?`${e.hairColor.trim()} hair`:"",e.hairstyle.trim(),e.eyeColor.trim()?`${e.eyeColor.trim()} eyes`:"",e.bodyType.trim()?`body type: ${e.bodyType.trim()}`:"",e.distinctiveFeatures.trim(),e.clothing.trim(),...Fa.value.map(f=>f.prompt)].filter(Boolean).join(", ");return{name:a,basePrompt:s,appearancePrompt:d,stylePrompt:e.style.trim(),negativePrompt:e.negative.trim()}}),py=S(()=>Rl(11,Ue.value.name,Ue.value.appearancePrompt,["#7168f0","#2fbda8","#f5c542"],[1,1])),my=S(()=>[{label:"基础",value:Ue.value.basePrompt},{label:"一致性",value:[bl.value.genderPresentation,bl.value.ageStage,bl.value.species,bl.value.bodyType,bl.value.distinctiveFeatures].filter(Boolean).join(" / ")||"未设置"},{label:"外观",value:Ue.value.appearancePrompt},{label:"风格",value:Ue.value.stylePrompt||"-"},{label:"负面",value:Ue.value.negativePrompt||"-"}]),gy=S(()=>({id:"unsaved-draft",...bl.value,status:"未保存草稿",updatedAt:"尚未进入角色档案",materialId:Bo.value,colors:["#7168f0","#2fbda8","#f5c542"]})),fo=S(()=>vh([...bn.value,...Sa.value])),ki=S(()=>Yt.value),dt=S(()=>Oo.value===Uc?null:ki.value.find(e=>e.profile_id===Oo.value)??ki.value[0]??null),qf=S(()=>{const e=dt.value;return e&&(Vn.value[e.profile_id]||e.avatar_image_uri)||""}),$d=S(()=>{var a;const e=(a=dt.value)==null?void 0:a.profile_id;return e?ae.value[e]??[]:[]}),yy=S(()=>{var a;const e=(a=dt.value)==null?void 0:a.profile_id;return e?L.value[e]??"":""}),_y=S(()=>{var a;const e=(a=dt.value)==null?void 0:a.profile_id;return e?D.value[e]??"":""}),by=S(()=>{var a;const e=(a=dt.value)==null?void 0:a.profile_id;return e?R.value[e]??"":""}),wy=S(()=>{var e;return!!((e=dt.value)!=null&&e.profile_id&&Ge.value[dt.value.profile_id])}),Of=S(()=>{var e;return Na([...hd.value,...((e=va.value)==null?void 0:e.items)??[],...Object.values(x.value)],a=>a.material_id)}),hy=S(()=>{var e,a,r;return G.value.state!=="connected"||!((e=de.value)!=null&&e.feature_flags.wardrobe)||((r=(a=dt.value)==null?void 0:a.metadata)==null?void 0:r.source)==="sample"?null:de.value.permissions}),ky=S(()=>{var f;const e=dt.value;if(!e)return[];if(is(e)==="ungenerated")return[];const a=e.base_prompt||e.description||e.name,r=e.appearance_prompt||e.description||"角色外观待补充",s=e.style_prompt||"角色设定插画",d=qf.value;if(((f=e.metadata)==null?void 0:f.source)!=="sample"){const p=[],h=Rt.value[e.profile_id]??[],T=Fv(h);!T&&/^(?:https?:|data:|blob:|\/)/i.test(d)&&p.push({id:"avatar",label:"头像",detail:"角色档案头像",status:"ready",imageUrl:d,aspectRatio:[1,1],prompt:`${e.name}, portrait, ${r}`,createdAt:e.updated_at,source:"角色档案头像(无快速角色批次)"});const O=[...T?[T]:[],...h.filter(Y=>Y.workflow_type!==fn)];for(const Y of O)for(const J of je.value[Y.workflow_id]??[]){const Le=bt.value[J.node_id]??[];Le.forEach((Me,Oe)=>{const pe=ea(Me);pe&&p.push({id:Me.image_id,label:Le.length>1?`${gu(J)} ${Oe+1}`:gu(J),detail:J.description||Y.display_name,status:Me.status||J.status,imageUrl:pe,aspectRatio:Cy(Me.size),prompt:Me.prompt||J.prompt,createdAt:Me.created_at,source:Y.display_name})})}return Na(p,Y=>Y.id)}return[{id:"avatar",label:"头像",detail:"五官、表情与发型",status:"ready",imageUrl:d||Rl(81,`${e.name} 头像`,r,["#7168f0","#2fbda8","#f5c542"],[1,1]),aspectRatio:[1,1],prompt:`${e.name}, portrait, ${r}`,createdAt:e.updated_at,source:"角色档案"},{id:"bust",label:"半身像",detail:"服装、姿态与轮廓",status:"pending",imageUrl:Rl(82,`${e.name} 半身像`,r,["#3f7edc","#2ec4b6","#d65b7f"],[3,4]),aspectRatio:[3,4],prompt:`${e.name}, upper body character reference, ${r}`,createdAt:e.updated_at,source:"角色档案预览"},{id:"stand",label:"立绘",detail:"全身比例与服装细节",status:"pending",imageUrl:Rl(83,`${e.name} 立绘`,a,["#2f7a60","#111827","#d2a23a"],[2,3]),aspectRatio:[2,3],prompt:`${e.name}, full body character design, ${a}`,createdAt:e.updated_at,source:"角色档案预览"},{id:"sheet",label:"设定图",detail:"多角度与视觉规范",status:"pending",imageUrl:Rl(84,`${e.name} 设定图`,s,["#475569","#7168f0","#f5c542"],[16,9]),aspectRatio:[16,9],prompt:`${e.name}, character design sheet, ${s}`,createdAt:e.updated_at,source:"角色档案预览"}]});function Cy(e){const a=e.match(/(\d+)\s*[x×]\s*(\d+)/i);return a?[Math.max(1,Number(a[1])),Math.max(1,Number(a[2]))]:[4,5]}const $y=S(()=>{var a,r;const e=(a=dt.value)==null?void 0:a.profile_id;return e?((r=Rt.value[e])==null?void 0:r.length)??0:0}),Py=S(()=>{var f,p;const e=(f=dt.value)==null?void 0:f.profile_id,a=e?ae.value[e]:void 0;if(a)return a.length;const r=((p=dt.value)==null?void 0:p.metadata)??{},s=r.material_ids;return Array.isArray(s)?s.length:Nt(r.material_id)?1:0}),Iy=S(()=>{var a;const e=(a=dt.value)==null?void 0:a.profile_id;return e?(Rt.value[e]??[]).reduce((r,s)=>{var d;return r+(((d=je.value[s.workflow_id])==null?void 0:d.length)??0)},0):0}),he=S(()=>fo.value.find(e=>e.id===Ps.value)??fo.value[0]??gy.value),Xn=S(()=>{var a;const e=(a=he.value)==null?void 0:a.workflowId;return e?ar(e):[]}),Wt=S(()=>{var a;const e=(a=he.value)==null?void 0:a.workflowId;return e?Xe.value[e]:void 0}),Sy=S(()=>{const e=Wt.value;if(!e)return[];const a=Jl.value[e.workflow_id]??[];return a.some(r=>r.branch_name==="main")?a:[{branch_id:"branch_virtual_main",workflow_id:e.workflow_id,branch_name:"main",base_branch_name:null,base_node_id:null,status:e.current_branch==="main"?"active":"available",metadata:{},created_at:e.created_at,updated_at:e.updated_at},...a]}),xy=S(()=>{var a;const e=(a=Wt.value)==null?void 0:a.workflow_id;return e?Object.fromEntries((je.value[e]??[]).map(r=>[r.node_id,r.title||r.node_key])):{}}),Ry=S(()=>{var a;const e=(a=Ae.value)==null?void 0:a.node_id;return e?ws.value[e]??null:null}),My=S(()=>{var e;return!!(G.value.state==="connected"&&((e=de.value)!=null&&e.permissions.can_write)&&Wt.value)}),Us=S(()=>rc(Wt.value)),Df=S(()=>!0),Yo=S(()=>{const e=he.value,a=e.quickCharacterWorkflowId,r=a?je.value[a]??[]:[],s=!!e.profileId;return[{id:"avatar",nodeKey:"quick_avatar",label:"头像",detail:"五官、表情、发型",state:"1:1",aspectRatio:[1,1],placeholder:py.value,prompt:`${Ue.value.name}, face reference, ${Ue.value.basePrompt}, ${Ue.value.appearancePrompt}`},{id:"bust",nodeKey:"quick_bust",label:"半身像",detail:"上半身服装与姿态",state:"3:4",aspectRatio:[3,4],placeholder:Rl(12,`${Ue.value.name} 半身像`,Ue.value.appearancePrompt,["#3f7edc","#2ec4b6","#d65b7f"],[3,4]),prompt:`${Ue.value.name}, upper body character reference, ${Ue.value.appearancePrompt}`},{id:"stand",nodeKey:"quick_stand",label:"立绘",detail:"全身比例与轮廓",state:"2:3",aspectRatio:[2,3],placeholder:Rl(13,`${Ue.value.name} 立绘`,Ue.value.basePrompt,["#2f7a60","#111827","#d2a23a"],[2,3]),prompt:`${Ue.value.name}, full body character standing pose, ${Ue.value.basePrompt}, ${Ue.value.stylePrompt}`},{id:"sheet",nodeKey:"quick_sheet",label:"设定图",detail:"多角度与细节拆分",state:"16:9",aspectRatio:[16,9],placeholder:Rl(14,`${Ue.value.name} 设定图`,Ue.value.stylePrompt,["#475569","#7168f0","#f5c542"],[16,9]),prompt:`${Ue.value.name}, character design sheet, multi angle, outfit details, ${Ue.value.stylePrompt}`}].map(f=>{var T;const p=r.find(O=>O.node_key===f.nodeKey),h=p?Pd(p,bt.value[p.node_id]??[]):void 0;return{id:f.id,label:f.label,detail:f.detail,state:f.state,imageUrl:h?ea(h):s?"":f.placeholder,aspectRatio:f.aspectRatio,prompt:(h==null?void 0:h.prompt)||f.prompt,createdAt:(h==null?void 0:h.created_at)||e.updatedAt,source:h?"快速角色 / 已生成":s?"快速角色 / 尚未生成":"快速角色 / 预览",model:h==null?void 0:h.model,workflowId:a,batchId:a?se((T=Xe.value[a])==null?void 0:T.metadata,"quick_character_batch_id"):""}})});function Pd(e,a){const r=a.filter(Va);if(e.selected_image_id){const s=r.find(d=>d.image_id===e.selected_image_id);if(s)return s}return[...r].sort((s,d)=>Rn(d.created_at)-Rn(s.created_at))[0]}const Zt=S(()=>Yo.value.find(e=>e.id===_l.value)??Yo.value[0]),vo=S(()=>Yo.value.find(e=>e.id==="bust")??Zt.value),Ay=S(()=>{var r;const[e,a]=((r=Zt.value)==null?void 0:r.aspectRatio)??[4,3];return{"--quick-profile-target-ratio":`${e} / ${a}`}}),Ey=S(()=>{var r;const[e,a]=((r=Zt.value)==null?void 0:r.aspectRatio)??[4,3];return e>a?"landscape":"portrait"}),Wf=S(()=>{var r;const[e,a]=((r=vo.value)==null?void 0:r.aspectRatio)??[3,4];return{"--quick-profile-target-ratio":`${e} / ${a}`}}),Ty=S(()=>{var a;const e=Zt.value;return e?[{label:"类型",value:`${e.label} / ${e.state}`},{label:"说明",value:e.detail},{label:"模型",value:e.model||((a=xr.value)==null?void 0:a.label)||"未选择模型"},{label:"生成批次",value:e.batchId||"-"},{label:"来源",value:e.source},{label:"生成时间",value:Tl(e.createdAt)},{label:"提示词",value:e.prompt},{label:"负面提示词",value:Ue.value.negativePrompt||"-"}]:[]}),Ff=S(()=>{var d,f;const e=(d=de.value)==null?void 0:d.feature_flags,a=(f=de.value)==null?void 0:f.permissions,r=!!(a!=null&&a.can_write),s=!!(a!=null&&a.can_manage_materials);return[{id:"persona",title:"生成角色图片",badge:"Persona",detail:"按当前角色设定一次生成头像、半身像、立绘和设定图。",endpoint:he.value.profileId?A.profileWorkflows(he.value.profileId):A.quickProfileDraft,state:R.value[he.value.profileId??""]?"生成中":he.value.profileId?"四图批量生成":"请先保存角色",tone:"primary",action:"一键生成",enabled:!!(r&&he.value.profileId)},{id:"save",title:"保存角色",badge:"Profile",detail:"把当前人设预览归档为可复用角色。",endpoint:A.quickProfileDraftSave,state:r?"可写入":"只读",tone:r?"accent":"neutral",action:"保存档案",enabled:r,nav:"profiles",module:"suggestions"},{id:"material",title:"整理素材集",badge:"Material",detail:"把已选参考整理为角色专属素材包。",endpoint:A.materials,state:e!=null&&e.material_library?"已开启":"未开启",tone:e!=null&&e.material_library?"accent":"neutral",action:"整理素材",enabled:!!(e!=null&&e.material_library&&s),nav:"materials",module:"images"},{id:"wardrobe",title:"衣橱匹配",badge:"Wardrobe",detail:"按当前人设匹配一次性服装与配饰候选。",endpoint:A.wardrobeMatch(":profileId"),state:e!=null&&e.wardrobe?"已开启":"未开启",tone:e!=null&&e.wardrobe?"primary":"neutral",action:"匹配候选",enabled:!!(e!=null&&e.wardrobe&&s),nav:"materials",module:"images"},{id:"daily",title:"每日穿搭",badge:"Outfit",detail:"按日期、场景和状态生成长期穿搭方案。",endpoint:A.privateCompanionDailyOutfit,state:e!=null&&e.private_companion_integration?"已开启":"未开启",tone:e!=null&&e.private_companion_integration?"warn":"neutral",action:"生成方案",enabled:!!(e!=null&&e.private_companion_integration)},{id:"workflow",title:"进入工作流",badge:"Flow",detail:"把当前粗略人设转入工作流继续细化。",endpoint:A.profileWorkflows(":profileId"),state:e!=null&&e.workspace?"已开启":"未开启",tone:e!=null&&e.workspace?"primary":"neutral",action:"细化人设",enabled:!!(e!=null&&e.workspace&&r&&he.value.profileId)}]});function Ny(e){return{Persona:"人设",Profile:"档案",Material:"素材",Wardrobe:"衣橱",Outfit:"穿搭",Flow:"工作流"}[e]??e}function Ks(e){return{persona:"生成",save:"保存",material:"整理",wardrobe:"匹配",daily:"生成",workflow:"细化"}[e.id]??e.action}const Cl=S(()=>{const e=new Map([...Xn.value].sort((a,r)=>a.sort_order-r.sort_order).map(a=>[xn(a),a]));return[rh(),...hm.map((a,r)=>{const s=e.get(a.id);return s?sh(s,r):ih(a,r)})]}),Ly=[{id:"profile-prep",step:"01",title:"前期人设准备",detail:"导入粗略人设,拆解设定,并完成提示词规划和参考素材绑定。",badge:"Prep",previewNodeId:"material-bind",nodeIds:["brief-import","persona-split","prompt-plan","material-bind"]},{id:"portrait-draft",step:"02",title:"头像草稿",detail:"确认五官、发型、上半身服装和角色气质;确定后主预览显示头像草稿。",badge:"Draft",previewNodeId:"portrait-03",nodeIds:["portrait-01","portrait-02","portrait-03"]},{id:"body-sheet",step:"03",title:"全身与设定图",detail:"补齐全身比例、鞋袜配饰、细节补图和角色设定图。",badge:"Sheet",previewNodeId:"fullbody-01",nodeIds:["fullbody-01","sheet-split","detail-hands-01","detail-accessory-01","detail-accessory-02"]},{id:"review-archive",step:"04",title:"修复入库",detail:"高清修复、统一风格,并保存为可复用角色版本。",badge:"Fix",previewNodeId:"hires-fix",nodeIds:["hires-fix","archive"]}],Mr=S(()=>{const e=new Map(Cl.value.map(a=>[a.id,a]));return Ly.map(a=>{const r=a.nodeIds.map(O=>e.get(O)).filter(O=>!!O),s=r.filter(O=>O.status==="done").length,d=r.find(O=>O.status==="running"||O.status==="review"),f=r.find(O=>O.status!=="done"),p=d??f??r[r.length-1],h=_h(a.id,r,!!Xn.value.length),T=d??h.find(O=>O.status!=="done"&&!xl(O.id))??[...h].reverse().find(O=>!xl(O.id))??h[0];return{...a,previewNodeId:(T==null?void 0:T.id)??"",nodes:h,allNodeCount:r.length,visibleNodeCount:h.length,status:ph(r),progress:mh(r),eta:(p==null?void 0:p.eta)??(p==null?void 0:p.duration)??"已完成",summary:h.length?`${s} / ${r.length} 小节点`:`未展开 / ${r.length} 小节点`,outputCount:(p==null?void 0:p.outputCount)??"等待产物"}}).filter(a=>a.nodes.length>0)}),By=S(()=>Mr.value.reduce((e,a)=>e+a.visibleNodeCount,0)),Id=S(()=>Mr.value.find(e=>e.nodeIds.includes(Ye.value))??Mr.value[0]),qy=S(()=>{var e,a;return((e=Id.value)==null?void 0:e.title)??((a=qe.value)==null?void 0:a.title)??"节点预览"}),qe=S(()=>Cl.value.find(e=>e.id===Ye.value)??Cl.value[0]),Ae=S(()=>{const e=Ye.value;return Xn.value.find(a=>xn(a)===e)??null}),Sd=S(()=>{var a;const e=(a=Ae.value)==null?void 0:a.node_id;return e?Hn.value[e]??[]:[]}),Ve=S(()=>{var s;const e=(s=Ae.value)==null?void 0:s.node_id;if(!e)return null;const a=Sd.value,r=wn.value[e];return a.find(d=>d.round.round_id===r)??a[0]??null}),Ar=S(()=>{var a;const e=(a=Ae.value)==null?void 0:a.node_id;return e?od.value[e]??"":""}),Oy=S(()=>{var a;const e=Ve.value;return!e||e.legacy?"":se(e.round.prompt_snapshot,"model_route")||((a=e.candidates.find(r=>r.candidate.model_route))==null?void 0:a.candidate.model_route)||""}),Uf=S(()=>{var e,a;return q$((e=Ae.value)==null?void 0:e.node_key,(a=Ae.value)==null?void 0:a.node_type)}),Dy=S(()=>{var a;const e=Et((a=ze.value)==null?void 0:a.config.model_assignments)?ze.value.config.model_assignments:void 0;return Uf.value?se(e,Uf.value):""}),Wy=S(()=>{var a,r;const e=(a=he.value)==null?void 0:a.profileId;return e&&((r=Yt.value.find(s=>s.profile_id===e))==null?void 0:r.default_model_route)||""}),Fy=S(()=>{var a;const e=Et((a=ze.value)==null?void 0:a.config.generation)?ze.value.config.generation:void 0;return se(e,"default_model")}),po=S(()=>{var e;return B$({overrideRoute:Ar.value,roundRoute:Oy.value,nodeRoute:(e=Ae.value)==null?void 0:e.model_route,assignmentRoute:Dy.value,profileRoute:Wy.value,systemRoute:Fy.value})}),xd=S(()=>ru(po.value.route)),Kf=S(()=>({override:"本次覆盖",round:"继承父轮次",node:"节点默认",assignment:"模型分工",profile:"角色默认",system:"系统默认",backend:"后端自动"})[po.value.source]),Uy=S(()=>{var d,f;const e=Et((d=ze.value)==null?void 0:d.config.model_assignments)?ze.value.config.model_assignments:void 0,a=Et((f=ze.value)==null?void 0:f.config.prompt_governance)?ze.value.config.prompt_governance:void 0,r=Et(a==null?void 0:a.translation)?a.translation:void 0,s=se(r,"model_route")||se(e,"prompt_planning");return s?ru(s):"未配置(后端规则)"}),Vf=S(()=>{const e=[],a=new Set;for(const s of io.value){const d=tc(s);!d||a.has(d)||(a.add(d),e.push({value:d,label:`${s.provider} / ${s.label}`}))}const r=Ar.value;return r&&!a.has(r)&&e.unshift({value:r,label:ru(r)}),e}),jf=S(()=>{var r;const e=Et((r=ze.value)==null?void 0:r.config.model_assignments)?ze.value.config.model_assignments:void 0,a=Array.isArray(e==null?void 0:e.generation_cross_review_routes)?e.generation_cross_review_routes.map(String):[];return ur([...a,se(e,"generation_cross_review_primary"),se(e,"generation_cross_review_secondary")].filter(Boolean))}),Ky=S(()=>{var a;const e=kn.value??Ve.value;return e&&(se(e.round.prompt_snapshot,"model_route")||((a=e.candidates.slice().sort((r,s)=>r.candidate.candidate_index-s.candidate.candidate_index).find(r=>r.candidate.model_route))==null?void 0:a.candidate.model_route))||""}),Gf=S(()=>{const e=Ky.value;return ur([...Vf.value.map(r=>r.value),...No.value.filter(r=>r.modality==="image_generation").map(r=>r.route),...jf.value].filter(r=>!!r&&r!==e)).map(r=>({value:r,label:ru(r)||r}))}),Vy=S(()=>{const e=new Set(Gf.value.map(a=>a.value));return jf.value.filter(a=>e.has(a))}),Hf=S(()=>{var a;return xo(((a=Ae.value)==null?void 0:a.node_key)||Ye.value)==="headshot"?"cover":"contain"}),mo=S(()=>{var e;return((e=Ve.value)==null?void 0:e.candidates)??[]}),jy=S(()=>{var a,r;const e=se((a=Ae.value)==null?void 0:a.metadata,"active_round_id");return e||(((r=Sd.value.find(s=>Mi(s.round.status)))==null?void 0:r.round.round_id)??"")}),Gy=S(()=>Object.fromEntries(mo.value.map(e=>{var a,r,s,d;return[e.candidate_id,sn((a=e.image)==null?void 0:a.thumbnail_url)||sn((r=e.image)==null?void 0:r.image_url)||sn((s=e.image)==null?void 0:s.thumbnail_uri)||sn((d=e.image)==null?void 0:d.image_uri)]}))),Hy=S(()=>{var e;return((e=mo.value.find(a=>a.is_final))==null?void 0:e.candidate_id)??""}),zf=S(()=>{const e=Ve.value;if(!e||!Ct.value||!["completed","partial_success","awaiting_selection"].includes(Be(e.round.status)))return!1;const a=e.candidates.filter(r=>r.candidate_id===Ct.value);return a.length===1&&Ai(a[0])}),zy=S(()=>[fi.value,vi.value].filter(Boolean)),Ft=S(()=>{var e,a;return((e=Wt.value)==null?void 0:e.workflow_type)===Qa&&((a=Ae.value)==null?void 0:a.node_type)==="generation"}),Vs=S(()=>{var e,a;return!!((e=Ve.value)!=null&&e.read_only)||Jo.value||Be(((a=Ae.value)==null?void 0:a.status)??"")==="selected"}),Qf=S(()=>kp(Ye.value)),Ra=S(()=>!!Qf.value),$l=S(()=>{const e=Qf.value;return e?`请先完成上一节点「${e.title}」,完成并确认后会自动解锁当前节点。`:""}),Yf=S(()=>{var e,a;return Vg((e=Wt.value)==null?void 0:e.status,(a=Wt.value)==null?void 0:a.metadata)}),Jo=S(()=>{var e;return Be(((e=Ae.value)==null?void 0:e.status)??"")==="selected"||Yf.value}),Zn=S(()=>{var e,a,r;return O$((e=Ae.value)==null?void 0:e.status,(a=Wt.value)==null?void 0:a.status,(r=Wt.value)==null?void 0:r.metadata)}),Rd=S(()=>Ra.value||Zn.value),js=S(()=>{var e;return Rd.value||!!((e=kn.value)!=null&&e.read_only)}),Qy=S(()=>{const e=Ve.value;return!!(Ft.value&&e&&!e.legacy&&e.candidates.some(a=>Ai(a)))}),Pl=S(()=>Ra.value||Jo.value||Ft.value&&Vs.value),Yy=S(()=>Object.entries(qa.value).filter(([,e])=>e.kind==="liked").map(([e])=>e)),Jy=S(()=>Yy.value.length>=3),Jf=S(()=>{const e=Ve.value;return!!(Ft.value&&e&&!e.legacy&&e.candidates.length)}),Md=S(()=>mo.value.filter(e=>Ri(e.candidate_id)==="liked"&&Ai(e)).length),Xy=S(()=>{if(Zn.value||Ra.value)return!1;const e=Ve.value;if(!e)return!!po.value.route;if(e.legacy||e.read_only||!e.candidates.length)return!1;const a=Md.value;return a>=1&&a<=3||!!_n.value.trim()}),Zy=S(()=>{if(Zn.value||Ra.value)return"";const e=Ve.value;if(!e)return po.value.route?`第一轮会使用当前节点提示词与${Kf.value}:${xd.value}。`:"当前节点和后端默认均未提供生图路由,请先在下方显式覆盖或前往设置配置。";if(e.legacy||e.read_only)return"历史兼容轮次只读,不能继续生成。";if(!e.candidates.length)return"当前轮次候选尚未就绪,请等待同步完成。";const a=Md.value;return _n.value.trim()?a?`点击后会先保存对话反馈,再以 ${a} 张喜欢候选创建下一轮。`:"点击后会先保存对话反馈;保存结果必须包含 1–3 张成功且喜欢的候选。":a?`将以 ${a} 张成功且喜欢的候选创建下一轮。`:"请先把 1–3 张生成成功的候选标记为“喜欢”,再开始下一轮。"}),e_=S(()=>Af.value),t_=S(()=>{var e;return((e=Cn.value)==null?void 0:e.material_bindings.selected_material_ids)??[]}),Ad=S(()=>{var e;return!!((e=Cn.value)!=null&&e.writable&&!Zn.value&&!Ra.value)}),a_=S(()=>{var a,r;return se((r=(a=Cn.value)==null?void 0:a.lock)==null?void 0:r.details,"required_action")==="create_branch"||Zn.value}),Ed=S(()=>{var e,a,r;return Ra.value?$l.value:Zn.value?`${go.value} 当前素材绑定保持可查看;创建分支后才能修改。`:(e=Cn.value)!=null&&e.writable?"":((r=(a=Cn.value)==null?void 0:a.lock)==null?void 0:r.message)||"当前节点素材绑定为只读状态。"}),n_=S(()=>{const e=Ve.value;return e&&!e.legacy?e.round.display_code:""}),go=S(()=>{var a,r;const e=Ae.value;return e?Yf.value?`工作流已经封存,节点「${((a=qe.value)==null?void 0:a.title)??e.title}」仅可查看。要继续修改,请先创建可编辑分支。`:`节点「${((r=qe.value)==null?void 0:r.title)??e.title}」已经确认采用并锁定。要修改这里,请先从当前节点创建分支。`:""}),Td=S(()=>{var e;return((e=qe.value)==null?void 0:e.id)==="brief-import"}),Ci=S(()=>{var e;return((e=qe.value)==null?void 0:e.id)==="persona-split"}),Nd=S(()=>{var e;return((e=qe.value)==null?void 0:e.id)==="prompt-plan"}),Ld=S(()=>{var e;return((e=qe.value)==null?void 0:e.id)==="material-bind"}),l_=S(()=>Td.value||Ci.value||Nd.value||Ld.value),$i=S(()=>{const e=he.value,a=Fa.value.map(s=>s.label).join("、"),r=qe.value;return[{id:"identity",title:"身份与性格",detail:"给后续提示词规划提供角色核心和行为约束。",fields:[Ga("name","角色名",e.name,"用于所有节点保持角色一致。"),Ga("identity","身份定位",e.identity,"职业、阵营、处境或世界观身份。"),Ga("personality","性格关键词",e.personality,"外显性格、内在矛盾和行动方式。")]},{id:"appearance",title:"外观锚点",detail:"锁定头像、半身和全身节点必须继承的识别特征。",fields:[Ga("hair_color","发色",e.hairColor,"头发主色,避免后续节点漂移。"),Ga("hairstyle","发型",e.hairstyle,"长度、刘海、轮廓和辨识度。"),Ga("eye_color","眼睛",e.eyeColor,"瞳色、眼神和表情基调。"),Ga("body_feature","身形/记忆点",(r==null?void 0:r.lockedItems)??"","身高、体型、伤疤、义体等复杂问卷字段。")]},{id:"outfit",title:"服装与素材",detail:"拆成服装、配饰、参考素材和风格锁定项。",fields:[Ga("clothing","服装轮廓",e.clothing,"上衣、鞋袜、材质和层次。"),Ga("materials","参考素材",a,"当前已选素材会作为后续节点参考。"),Ga("style","风格锁定",e.style,"画风、镜头、光照、世界观氛围。")]},{id:"guard",title:"约束与负面项",detail:"用于减少跑偏、冲突和不想要的设计方向。",fields:[Ga("negative","禁用项",e.negative,"负面词、避雷内容和结构约束。"),Ga("conflict","冲突检查",(r==null?void 0:r.decision)||"暂无冲突","字段确认后可进入提示词规划。"),Ga("prompt","节点提示词",(r==null?void 0:r.prompt)??"","后端 LLM 拆解后写回的节点 prompt。")]}]}),Gs=S(()=>$i.value.reduce((e,a)=>e+a.fields.length,0)),Hs=S(()=>$i.value.reduce((e,a)=>e+a.fields.filter(r=>r.status==="ready").length,0)),o_=S(()=>{const e=qe.value;return[{label:"字段",value:`${Hs.value}/${Gs.value}`,hint:"已拆解字段"},{label:"节点",value:nr((e==null?void 0:e.status)??"waiting"),hint:(e==null?void 0:e.phase)??"persona-split"},{label:"来源",value:he.value.status,hint:he.value.updatedAt}]}),Xf=S(()=>{const e=he.value,a=e.negative||Ue.value.negativePrompt||"low quality, blurry, bad anatomy",r=[e.name,e.identity,e.personality,Nr(e),e.style].filter(Boolean).join(", ");return[{id:"portrait",title:"头像节点",target:"headshot",prompt:`${r}, face reference, clear eyes, recognizable hairstyle`,negative:a,inherits:["角色名","发色","发型","眼睛","五官识别"],weight:"身份 1.25 / 风格 0.85",status:"可写入"},{id:"bust",title:"半身节点",target:"half_body",prompt:`${r}, upper body, outfit silhouette, calm pose`,negative:a,inherits:["五官识别","发型","上身服装","姿态"],weight:"身份 1.2 / 服装 1.05",status:"可写入"},{id:"fullbody",title:"全身节点",target:"full_body",prompt:`${r}, full body standing pose, complete outfit, shoes and accessories`,negative:a,inherits:["身份","身体比例","服装","鞋袜","配饰"],weight:"比例 1.15 / 配饰 0.9",status:"可写入"},{id:"sheet",title:"设定图节点",target:"expression_sheet / pose_sheet",prompt:`${r}, character design sheet, multi angle, expression and pose references`,negative:a,inherits:["身份","服装","风格","表情","姿势"],weight:"一致性 1.3 / 细节 1.05",status:"可写入"}]}),r_=S(()=>[{label:"负面提示词",value:he.value.negative||Ue.value.negativePrompt||"-",status:"ready"},{label:"语言策略",value:"中文输入由后端 LLM 自动翻译并合并为英文提示词,不丢弃专名和禁用项。",status:"ready"},{label:"权重建议",value:"身份特征和发眼锚点优先,服装/配饰中等权重,风格低于身份。",status:"ready"}]),i_=S(()=>V.map(e=>{const a=Sn(e.category);return{category:e.category,selectedLabel:(a==null?void 0:a.label)??"不使用参考",selectedPrompt:(a==null?void 0:a.prompt)??"默认不注入参考素材,只有显式选择后才进入后端素材绑定。",stages:tp(e.category),strength:a?ap(e.category):"弱",required:!!(a&&["风格","服装"].includes(e.category)),colors:(a==null?void 0:a.colors)??e.colors}})),s_=S(()=>{var a;const e=qe.value;return Ft.value&&((a=Ve.value)!=null&&a.candidates.length)?`${e.title} / ${Ve.value.round.display_code} / 可按编号记录喜欢、拒绝、严格拒绝、待定稿和下一轮调整。`:`${e.title} / ${e.phase} / 自动识别节点上下文,交由后端 LLM 翻译为英文提示词注入。`}),Bd=S(()=>ko(Xn.value.flatMap(a=>bt.value[a.node_id]??[])).filter(a=>a.workflow_id===he.value.workflowId&&Xn.value.some(r=>r.node_id===a.node_id))),rn=S(()=>{var s,d,f;if(Ft.value&&Ve.value)return mo.value.flatMap(p=>{var O;if(!p.image)return[];const h=Ti(p.image),T=[p.candidate.provider_id,p.candidate.provider_model].filter(Boolean).join("/");return[{...h,title:p.display_code,model:T||p.candidate.model_route||h.model,status:Eb(p.candidate.generation_status),source:`${((O=Ve.value)==null?void 0:O.round.display_code)??"Round"} / ${p.display_code}`,metadata:{...p.image.metadata??{},candidate_id:p.candidate_id,candidate_display_code:p.display_code,round_id:p.round_id}}]});const e=new Map(Bd.value.map(p=>[p.image_id,p]));return((d=(s=qe.value)==null?void 0:s.imageIds)!=null&&d.length?qe.value.imageIds:(f=qe.value)!=null&&f.imageId?[qe.value.imageId]:[]).map(p=>e.get(p)).filter(p=>!!p)}),el=S(()=>rn.value.find(e=>ft(e)===Fn.value)??null),Ua=S(()=>{const e=new Map(rn.value.map(a=>[ft(a),a]));return Ia.value.map(a=>e.get(a)).filter(a=>!!a)}),u_=S(()=>rn.value.find(e=>ft(e)===Ct.value)??null),zs=S(()=>{const e=u_.value;return e&&Va(e)?e:null}),d_=S(()=>Ua.value.map((e,a)=>{var r,s;return{id:e.image_id,displayCode:se(e.metadata,"candidate_display_code")||se(e.metadata,"display_code")||`${((r=qe.value)==null?void 0:r.round)||((s=qe.value)==null?void 0:s.title)||"候选"}-${String(a+1).padStart(2,"0")}`,title:ya(e),src:ea(e),model:e.model,status:e.status}})),c_=S(()=>{const e=qe.value;return e?[{label:"阶段",value:e.phase??"-"},{label:"进度",value:`${e.progress??0}%`},{label:"队列",value:e.queue??"-"},{label:"尝试",value:e.attempt??"-"},{label:"预计",value:e.eta??"-"},{label:"依赖",value:e.dependsOn??"-"},{label:"轮次",value:e.round??"-"},{label:"锁定项",value:e.lockedItems??"-"},{label:"本轮结论",value:e.decision??"-"},{label:"输入",value:e.input??"-"},{label:"产物",value:e.result??e.outputCount??"-"},{label:"状态",value:nr(e.status)},{label:"模型",value:e.model},{label:"耗时",value:e.duration},{label:"说明",value:e.detail},{label:"提示词",value:e.prompt}]:[]}),Zf=S(()=>{var Te,Bt,la,un,oa,Aa,dn,ll,$o,ol;const e=(Te=de.value)==null?void 0:Te.feature_flags,a=(Bt=de.value)==null?void 0:Bt.permissions,r=!!(a!=null&&a.can_write),s=!!(a!=null&&a.can_retry_tasks),d=!!(e!=null&&e.workspace&&r),f=he.value,p=f==null?void 0:f.workflowId,h=p?Xe.value[p]:void 0,T=!!((h==null?void 0:h.status)==="completed"||(la=h==null?void 0:h.metadata)!=null&&la.final_archive_history_id),O=!!(d&&p),Y=!!(d&&(f!=null&&f.profileId)),J=Zn.value,Le=Ra.value,Me=!!(r&&!J&&!Le),Oe=!!(r&&!Jo.value&&!Le),pe=qe.value,De=(un=Id.value)==null?void 0:un.id,vt=Et((Aa=(oa=Ae.value)==null?void 0:oa.metadata)==null?void 0:Aa.prompt_plan),Lt=Et((ll=(dn=Ae.value)==null?void 0:dn.metadata)==null?void 0:ll.material_bindings),_a=f?Aw(ho("hires-fix",f)):[],nt=($o=zs.value)!=null&&$o.image_id&&(!Ft.value||zf.value)?zs.value.image_id:void 0,ba=_r.value?"保存中":Do.value?"保存失败":si.value?Tl(si.value):p?"可保存":"先生成档案",na={id:"version",title:"保存快照",detail:Do.value||"把当前工作流、节点和选中角色卡摘要写入后端 workflow_history。",badge:"Save",state:ba,tone:p?"accent":"neutral",action:_r.value?"保存中":"保存快照",enabled:!!(O&&!_r.value),actionKey:"workflowSaveVersion"},Ut={id:"branch-from-node",title:"从此节点创建分支",detail:Oa.value||go.value||"当前节点已锁定,修改会进入新的工作流分支。",badge:"Branch",state:Wo.value?"创建中":Gn.value?`切换 ${Gn.value}`:(ol=Ae.value)!=null&&ol.branch_name?`基于 ${Ae.value.branch_name}`:"等待后端节点",tone:"warn",action:Wo.value?"创建中":"创建分支",enabled:!!(O&&Ae.value&&!Wo.value&&!Gn.value),actionKey:"workflowCreateBranchFromNode"},$=J?[Ut,na]:[na];return Le?[{id:"progression-lock",title:"节点尚未解锁",detail:$l.value,badge:"Lock",state:"等待上一节点",tone:"neutral",action:"等待解锁",enabled:!1,actionKey:"workflowNodeGenerate"}]:Jo.value?[Ut,na]:De==="profile-prep"?(pe==null?void 0:pe.id)==="brief-import"?[{id:"new-profile",title:"创建角色档案",detail:"打开问卷,新建粗略人设并作为工作流输入。",badge:"Profile",state:"问卷入口",tone:"primary",action:"填写问卷",enabled:!0,actionKey:"personaQuestionnaire"},{id:"external-profile",title:"导入外部角色卡",detail:"粘贴外部人设文本,自动识别并填入角色档案问卷。",badge:"Paste",state:"文本识别",tone:"accent",action:"粘贴导入",enabled:!0,actionKey:"externalProfileImport"},{id:"split-next",title:"进入设定拆解",detail:yr.value||`使用当前选中的 ${f.name} 通过后端工作流进入 LLM 拆解。`,badge:"Next",state:gr.value?"拆解中":p?"已落库":f.profileId?"可创建工作流":"先生成档案",tone:"primary",action:gr.value?"拆解中":"拆解",enabled:!!(Y&&!gr.value),actionKey:"workflowPersonaSplit"},na]:(pe==null?void 0:pe.id)==="persona-split"?[{id:"split-run",title:"重新拆解设定",detail:"用当前角色档案重新生成结构化字段。",badge:"LLM",state:r?"可拆解":"只读",tone:"primary",action:"拆解",enabled:!!(Me&&!Re.value),actionKey:"workflowNodeGenerate"},{id:"field-review",title:"确认字段",detail:"检查身份、外观、服装、配饰和禁用项。",badge:"Check",state:`${Hs.value}/${Gs.value}`,tone:"accent",action:"确认",enabled:!!(Me&&!Re.value),actionKey:"workflowNodeComplete"},{id:"prompt-next",title:"进入提示词规划",detail:"把结构化字段转入提示词矩阵。",badge:"Next",state:"下一节点",tone:"primary",action:"规划",enabled:!0,actionKey:"workflowPromptPlanNext"},...$]:(pe==null?void 0:pe.id)==="prompt-plan"?[{id:"prompt-build",title:"生成提示词矩阵",detail:"生成头像、半身、全身和设定图提示词。",badge:"Prompt",state:"6 条提示词",tone:"primary",action:"生成",enabled:!!(Me&&!Re.value),actionKey:"workflowPromptPlanSave"},{id:"negative-check",title:"校验负面词",detail:"检查负面提示词、权重和冲突项。",badge:"Guard",state:"待校验",tone:"warn",action:"校验",enabled:!!(Me&&!Re.value),actionKey:"workflowPromptPlanSave"},{id:"prompt-confirm",title:"确认提示词规划",detail:vt?"确认当前提示词矩阵并完成本节点,随后解锁素材绑定。":"请先保存提示词矩阵,再确认并解锁下一节点。",badge:"Next",state:vt?"可确认":"等待保存",tone:"accent",action:"确认并解锁",enabled:!!(vt&&Me&&!Re.value),actionKey:"workflowPromptPlanComplete"},...$]:[{id:"material-bind",title:"绑定参考素材",detail:"把风格、构图、服装、鞋袜和配饰写入节点参数。",badge:"Material",state:"5 类参考",tone:"primary",action:"绑定",enabled:!!(Me&&!Re.value),actionKey:"workflowMaterialBindSave"},{id:"open-materials",title:"打开素材库",detail:"补充或替换当前角色参考素材。",badge:"Library",state:"素材入口",tone:"accent",action:"素材",enabled:!0,nav:"materials",module:"images"},{id:"draft-next",title:"确认素材绑定",detail:Lt?"确认当前素材绑定并完成本节点,随后解锁头像草稿。":"请先保存素材绑定,再确认并解锁头像草稿。",badge:"Next",state:Lt?"可确认":"等待保存",tone:"primary",action:"确认并解锁",enabled:!!(Lt&&Me&&!Re.value),actionKey:"workflowMaterialBindComplete"},...$]:De==="portrait-draft"?[{id:"portrait-generate",title:"生成头像草稿",detail:"按当前轮次生成头像和半身候选。",badge:"Draft",state:(pe==null?void 0:pe.round)??"草稿轮次",tone:"primary",action:"生成",enabled:!!(Me&&!Re.value),actionKey:"workflowNodeGenerate"},{id:"portrait-compare",title:"对比候选",detail:"平铺当前选中的草稿进行大图对比。",badge:"Compare",state:`${Ua.value.length} 已选`,tone:"accent",action:"对比",enabled:Ua.value.length>1,actionKey:"workflowCompare"},{id:"portrait-retry",title:"再跑一轮",detail:"保留锁定元素,创建下一轮头像草稿节点。",badge:"Retry",state:s?"可重试":"无权限",tone:s?"warn":"neutral",action:"重试",enabled:!!(s&&!J&&!Re.value),actionKey:"workflowNodeRetry"},{id:"portrait-review",title:"审查当前节点",detail:"读取后端同提示词多模型审查结果,记录候选评分和问题。",badge:"Review",state:Ua.value.length?`${Ua.value.length} 张候选`:"待候选",tone:"accent",action:"审查",enabled:!!(Oe&&!Re.value),actionKey:"workflowNodeReview"},{id:"portrait-adopt",title:"确认采用",detail:nt?"采用当前定稿的头像/半身候选,锁定本节点并交接到下一流程。":"请先在候选卡片上标记一张真实后端图片为定稿。",badge:"Adopt",state:nt?"可采用":"待候选",tone:"primary",action:"采用",enabled:!!(Oe&&nt&&!Re.value),actionKey:"workflowReviewAdopt"},...$]:De==="body-sheet"?[{id:"body-generate",title:"生成设定图",detail:"生成全身、手部、配饰或拆分设定图。",badge:"Sheet",state:(pe==null?void 0:pe.title)??"设定图",tone:"primary",action:"生成",enabled:!!(Me&&!Re.value),actionKey:"workflowNodeGenerate"},{id:"detail-fix",title:"细节补图",detail:"针对手部、鞋袜、配饰等局部继续补图。",badge:"Fix",state:(pe==null?void 0:pe.outputCount)??"待产物",tone:"accent",action:"补图",enabled:!!(Me&&!Re.value),actionKey:"workflowNodeGenerate"},{id:"body-retry",title:"重跑当前设定",detail:"保留人设锁定项,重跑当前设定图节点。",badge:"Retry",state:s?"可重试":"无权限",tone:s?"warn":"neutral",action:"重试",enabled:!!(s&&!J&&!Re.value),actionKey:"workflowNodeRetry"},{id:"body-review",title:"审查当前节点",detail:"按当前设定图节点拉取后端审查结果,确认可用候选和异常项。",badge:"Review",state:Ua.value.length?`${Ua.value.length} 张候选`:"待候选",tone:"accent",action:"审查",enabled:!!(Oe&&!Re.value),actionKey:"workflowNodeReview"},{id:"body-adopt",title:"确认采用",detail:nt?"采用当前定稿的设定图候选,锁定本节点并放入高清修复桶。":"请先在候选卡片上标记一张真实后端图片为定稿。",badge:"Adopt",state:nt?"可采用":"待候选",tone:"primary",action:"采用",enabled:!!(Oe&&nt&&!Re.value),actionKey:"workflowReviewAdopt"},...$]:[{id:"hires",title:"高清修复与统一风格",detail:"对选中结果进行高清修复和统一风格。",badge:"Fix",state:(pe==null?void 0:pe.title)??"修复节点",tone:"accent",action:"修复",enabled:!!(Me&&!Re.value),actionKey:"workflowNodeGenerate"},{id:"hires-adopt",title:"确认修复结果",detail:nt?"采用当前定稿修复图,锁定修复节点并交接到入库。":"请先完成高清修复并将一张真实后端图片标记为定稿。",badge:"Adopt",state:nt?"可采用":"待成品",tone:"primary",action:"采用",enabled:!!(Oe&&Ye.value==="hires-fix"&&nt&&!Re.value),actionKey:"workflowReviewAdopt"},{id:"archive",title:"入库",detail:"把最终结果保存为可复用角色版本。",badge:"Archive",state:T?"已入库":`${_a.length} 张成品`,tone:"accent",action:"入库",enabled:!!(r&&(f!=null&&f.workflowId)&&_a.length&&!T&&!Re.value),actionKey:"workflowArchiveFinal"},...$]});function f_(e){return{Save:"保存",Branch:"分支",Profile:"档案",Paste:"导入",Next:"下一步",LLM:"LLM",Check:"确认",Prompt:"提示词",Guard:"校验",Material:"素材",Library:"素材库",Draft:"草稿",Compare:"对比",Retry:"重跑",Review:"审查",Adopt:"采用",Sheet:"设定图",Fix:"修复",Pick:"选图",Archive:"入库",Gallery:"图库"}[e]??e}function ev(e){return{version:"保存","branch-from-node":"分支","new-profile":"建档","external-profile":"导入","split-next":"拆解","split-run":"拆解","field-review":"确认","prompt-next":"规划","prompt-build":"生成","negative-check":"校验","material-next":"绑定","material-bind":"绑定","open-materials":"素材","draft-next":"草稿","portrait-generate":"生成","portrait-compare":"对比","portrait-retry":"重跑","portrait-review":"审查","portrait-adopt":"采用","body-generate":"生成","detail-fix":"补图","body-retry":"重跑","body-review":"审查","body-adopt":"采用","hires-adopt":"采用",review:"审核",hires:"修复",archive:"入库"}[e.id]??e.action}const Gt=S(()=>ta.value.filter(e=>["failed","dead_letter","cancelled"].includes(Be(e.status)))),Il=S(()=>ta.value.filter(e=>["running","queued","created","pending","retrying"].includes(Be(e.status)))),yo=S(()=>ta.value.filter(e=>["completed","succeeded","superseded"].includes(Be(e.status)))),Sl=S(()=>[...Gt.value,...yo.value]),v_=S(()=>[{key:"active",label:"运行中",count:Il.value.length},{key:"failed",label:"需处理",count:Gt.value.length},{key:"done",label:"已完成",count:yo.value.length},{key:"all",label:"全部",count:ta.value.length}]),_o=S(()=>Wn.value==="active"?Il.value:Wn.value==="failed"?Gt.value:Wn.value==="done"?yo.value:ta.value),tl=S(()=>_o.value.length?_o.value.find(e=>e.task_id===$a.value)??_o.value[0]:null),p_=S(()=>{var e,a,r,s,d,f,p;return[{label:"队列总量",value:String(ta.value.length),hint:`运行 ${((e=E.value)==null?void 0:e.queue.running)??Il.value.length} / 等待 ${((a=E.value)==null?void 0:a.queue.pending)??0} / 终态 ${Sl.value.length}`,state:ta.value.length>20?"warn":ta.value.length>0?"good":"idle"},{label:"正在处理",value:String(Il.value.length||((r=E.value)==null?void 0:r.queue.running)||0),hint:Il.value[0]?Co(Il.value[0]):"当前没有运行中的任务",state:Il.value.length?"good":"idle"},{label:"异常任务",value:String(Gt.value.length||((s=E.value)==null?void 0:s.queue.failed)||0),hint:`死信 ${((d=E.value)==null?void 0:d.queue.dead_letter)??0}`,state:Gt.value.length||(((f=E.value)==null?void 0:f.queue.dead_letter)??0)>0?"bad":"good"},{label:"今日吞吐",value:String(((p=E.value)==null?void 0:p.today_generation_count)??0),hint:"生成请求统计",state:"good"}]}),m_=S(()=>{const e=tl.value;if(!e)return[{label:"任务",value:"未选中"},{label:"状态",value:"队列空闲"},{label:"提示",value:"新的生成任务会在这里显示详情"}];const a=Cp(e),r=[{label:"任务摘要",value:a.summary},{label:"业务类型",value:a.category},{label:"状态",value:sl(e.status)},{label:"模型路由",value:e.model_route||"-"},{label:"进度",value:`${ku(e)}%`},{label:"耗时 / 后端时限",value:Lc(e)},{label:"角色",value:a.profileName||"未关联角色"},{label:"工作流",value:a.workflowName||"未关联工作流"},{label:"节点",value:a.nodeName||"未关联节点"},{label:"创建",value:Tl(e.created_at)},{label:"更新",value:Tl(e.updated_at)},{label:"错误",value:e.error_message||"-"},{label:"任务 ID",value:e.task_id},{label:"后端类型",value:e.task_type||"-"}];return e.profile_id&&r.push({label:"角色 ID",value:e.profile_id}),e.workflow_id&&r.push({label:"工作流 ID",value:e.workflow_id}),e.node_id&&r.push({label:"节点 ID",value:e.node_id}),e.idempotency_key&&r.push({label:"幂等键",value:e.idempotency_key}),r}),Pi=S(()=>{var p,h,T,O;const e=!!((p=de.value)!=null&&p.permissions.can_write),a=!!((h=de.value)!=null&&h.permissions.can_retry_tasks),r=e&&a,s=tl.value,d=s?A.job(s.task_id):A.jobs,f=nn.value;return[{id:"refresh",title:"刷新队列",detail:"重新拉取任务列表、Dashboard 摘要和最新错误。",badge:"GET",endpoint:A.jobs,action:Da.value||f==="refresh"?"同步中":"刷新",tone:"good",enabled:!Da.value&&!f},{id:"retry",title:"重试选中任务",detail:r?s?Gt.value.some(Y=>Y.task_id===s.task_id)?"立即使用原请求创建并执行新任务;原任务会保留为已被重试替代。":"当前选中的任务不是失败、取消或死信状态。":"请先在任务列表中选择一条异常记录。":"当前账号缺少任务重试权限。",badge:"POST",endpoint:s?A.jobRetry(s.task_id):A.jobDeadLetterRetry,action:f==="retry"?"执行中":"立即重试",tone:"warn",enabled:!!(!f&&s&&e&&a&&Gt.value.some(Y=>Y.task_id===s.task_id))},{id:"retry-all-failed",title:"一键重试全部失败任务",detail:r?Gt.value.length?`当前检测到 ${Gt.value.length} 条失败、取消或死信记录;将逐条创建替代任务,旧记录会标记为已被重试替代。`:"当前没有可重试的失败、取消或死信记录。":"当前账号缺少任务重试权限。",badge:"BATCH",endpoint:A.jobRetryFailed,action:f==="retry-all-failed"?"批量处理中":"一键重试全部",tone:"warn",enabled:!!(!f&&e&&a&&Gt.value.length>0)},{id:"cancel",title:"取消运行任务",detail:"对 running / queued / pending 任务发送取消请求。",badge:"POST",endpoint:s?A.jobCancel(s.task_id):d,action:f==="cancel"?"取消中":"取消",tone:"bad",enabled:!!(!f&&s&&e&&Il.value.some(Y=>Y.task_id===s.task_id))},{id:"delete",title:"删除选中终态记录",detail:r?s?Sl.value.some(Y=>Y.task_id===s.task_id)?"删除选中的异常或已完成任务记录,并释放节点对旧任务的引用;不会删除图库图片。":"运行中、排队中和重试中的任务不能删除。":"请先选择一条异常或已完成记录。":"当前账号缺少任务清理权限。",badge:"DELETE",endpoint:s?A.jobDelete(s.task_id):A.jobs,action:f==="delete"?"删除中":"删除记录",tone:"bad",enabled:!!(!f&&s&&e&&a&&Sl.value.some(Y=>Y.task_id===s.task_id))},{id:"clear-failed",title:"清理异常记录",detail:r?Gt.value.length?`当前检测到 ${Gt.value.length} 条失败、取消或死信记录,单次最多清理 100 条。`:"当前没有失败、取消或死信记录,无需清理。":"当前账号缺少任务清理权限。",badge:"CLEAN",endpoint:A.jobClearFailed,action:f==="clear-failed"?"清理中":"清理异常",tone:"bad",enabled:!!(!f&&e&&a&&Gt.value.length>0)},{id:"clear-completed",title:"清理已完成记录",detail:r?yo.value.length?`当前检测到 ${yo.value.length} 条已完成、成功或已替代记录;生成图片会保留。`:"当前没有已完成记录,无需清理。":"当前账号缺少任务清理权限。",badge:"DONE",endpoint:A.jobClearTerminal,action:f==="clear-completed"?"清理中":"清理完成项",tone:"idle",enabled:!!(!f&&e&&a&&yo.value.length>0)},{id:"clear-terminal",title:"清理全部终态记录",detail:r?Sl.value.length?`当前共有 ${Sl.value.length} 条终态记录;运行中、排队中和重试中的任务不会删除。`:"当前没有可清理的终态记录。":"当前账号缺少任务清理权限。",badge:"ALL",endpoint:A.jobClearTerminal,action:f==="clear-terminal"?"清理中":"清理终态",tone:"bad",enabled:!!(!f&&e&&a&&Sl.value.length>0)},{id:"dead-letter-retry",title:"重试死信任务",detail:"顺序创建并执行最多 5 个替代任务,避免无人消费的假排队。",badge:"DLQ",endpoint:A.jobDeadLetterRetry,action:f==="dead-letter-retry"?"处理中":"重试死信",tone:"warn",enabled:!!(!f&&e&&a&&(((T=E.value)==null?void 0:T.queue.dead_letter)??0)>0)},{id:"failed-to-dead-letter",title:"失败移入死信",detail:"批量把失败任务移入死信队列,避免重复污染普通失败列表。",badge:"DLQ",endpoint:A.jobDeadLetterMoveFailed,action:f==="failed-to-dead-letter"?"移动中":"移入死信",tone:"idle",enabled:!!(!f&&e&&a&&(((O=E.value)==null?void 0:O.queue.failed)??Gt.value.length)>0)}]}),g_=S(()=>{const e=Zl.value,a=eo.value,r="#d65b7f",s="#d2a23a",d="#667085";return{"--primary":e,"--accent":a,"--primary-soft":Ml(e,.15),"--primary-strong":Ml(e,.32),"--accent-soft":Ml(a,.15),"--accent-strong":Ml(a,.34),"--rail-start":yc(e,"#ffffff",.12),"--rail-mid":yc(e,a,.16),"--rail-end":yc(e,"#111827",.18),"--danger":r,"--danger-soft":Ml(r,.14),"--danger-strong":Ml(r,.34),"--warn":s,"--warn-soft":Ml(s,.16),"--warn-strong":Ml(s,.34),"--neutral":d,"--neutral-soft":Ml(d,.14)}}),qd=S(()=>{var f,p,h,T,O,Y,J,Le,Me;const e=((f=E.value)==null?void 0:f.plugin_status)??"stopped",a=(p=B.value)==null?void 0:p.totals,r=Number((a==null?void 0:a.estimated_cost)??0)>0,s=ud.value?"读取中":bi.value?"读取失败":r&&B.value?EC(B.value):"未配置可信价格",d=a?`真实用量 ${a.task_count} 次 / ${a.image_count} 张 / ${a.total_tokens} tokens${r?";后端估算":";不按零成本展示"}`:bi.value||"等待今日用量接口";return[{label:"服务状态",value:sl(e),hint:Wa.value?"连接异常":"Dashboard summary",state:e==="running"?"good":e==="degraded"?"warn":"bad"},{label:"队列压力",value:String(oo.value),hint:`等待 ${((h=E.value)==null?void 0:h.queue.pending)??0} / 失败 ${((T=E.value)==null?void 0:T.queue.failed)??0}`,state:oo.value>20?"warn":"good"},{label:"运行任务",value:String(((O=E.value)==null?void 0:O.queue.running)??Il.value.length),hint:"当前执行负载",state:(((Y=E.value)==null?void 0:Y.queue.running)??0)>0?"good":"idle"},{label:"今日调用",value:String(((J=E.value)==null?void 0:J.today_generation_count)??0),hint:"生成请求统计",state:"good"},{label:"今日成本",value:s,hint:d,state:bi.value?"warn":r?"good":"idle"},{label:"存储占用",value:Ll(((Le=E.value)==null?void 0:Le.storage.total_bytes)??0),hint:`图片 ${Ll(((Me=E.value)==null?void 0:Me.storage.images_bytes)??0)}`,state:"good"}]}),y_=S(()=>qd.value.filter(e=>["服务状态","队列压力","存储占用"].includes(e.label))),Xo=S(()=>{const e=Is.value.trim().toLowerCase();return e?We.filter(a=>[a.title,a.description,...a.keywords].join(" ").toLowerCase().includes(e)).slice(0,6):We.slice(0,5)}),tv=S(()=>hr.value),Ii=S(()=>{var a,r,s;const e=[];for(const d of ta.value){const f=Be(d.status);["completed","succeeded"].includes(f)&&e.push({id:`job-completed-${d.task_id}`,type:"completed",title:"生图任务已完成",detail:Co(d),createdAt:d.updated_at||d.created_at}),["failed","dead_letter","cancelled"].includes(f)&&e.push({id:`job-failed-${d.task_id}`,type:"failed",title:"任务需要处理",detail:d.error_message||Co(d),createdAt:d.updated_at||d.created_at})}for(const d of ht.value){const f=Be(d.status);["completed","succeeded"].includes(f)&&e.push({id:`generation-completed-${d.task_id}`,type:"completed",title:"生成日志已完成",detail:`${d.task_id} / ${d.progress}%`,createdAt:d.updated_at||d.created_at})}for(const d of Ze.value.slice(0,6))e.push({id:`error-${d.source}-${d.id}`,type:"failed",title:d.source||"错误日志",detail:d.error_message||d.status,createdAt:d.created_at});return(((a=E.value)==null?void 0:a.queue.dead_letter)??0)>0&&e.push({id:"queue-dead-letter",type:"warning",title:"死信队列有待处理任务",detail:`${((r=E.value)==null?void 0:r.queue.dead_letter)??0} 个任务等待重试或归档`,createdAt:Pr.value}),((s=E.value)==null?void 0:s.plugin_status)==="degraded"&&e.push({id:"system-degraded",type:"system",title:"服务处于降级状态",detail:"部分接口可能暂时不可用",createdAt:Pr.value}),Eh(e).filter(d=>!$r.value.includes(d.id)).sort((d,f)=>Rn(f.createdAt)-Rn(d.createdAt)).slice(0,12)}),av=S(()=>Ii.value.filter(e=>yi.value==="all"||e.type===yi.value)),Od=S(()=>Ii.value.filter(e=>!an.value.includes(e.id)).length),nv=S(()=>Ii.value.slice(0,3)),Dd=S(()=>{var a,r,s,d,f,p;const e=[];return(Gt.value.length||(((a=E.value)==null?void 0:a.queue.failed)??0)>0||(((r=E.value)==null?void 0:r.queue.dead_letter)??0)>0)&&e.push({id:"retry-failed",tone:"retry",title:"处理失败任务",detail:`${Gt.value.length||((s=E.value)==null?void 0:s.queue.failed)||0} 条任务可能需要重试或查看错误原因`,action:"查看队列",nav:"queue",module:"queue"}),Ze.value.length&&e.push({id:"read-errors",tone:"confirm",title:"确认最新错误",detail:((d=Ze.value[0])==null?void 0:d.error_message)||"错误日志已有新条目",action:"打开日志",nav:"logs",module:"logs"}),(((f=E.value)==null?void 0:f.today_generation_count)??0)>40&&e.push({id:"cost-watch",tone:"cost",title:"今日调用偏高",detail:"建议检查模型路由和批量生成成本",action:"查看监控",nav:"performance",module:"performance"}),(p=de.value)!=null&&p.feature_flags.api_discovery||e.push({id:"config-discovery",tone:"config",title:"能力档案检查未开启",detail:"这里仅做 metadata-only 元数据检查,不会发送真实生图探测请求。",action:"检查设置",nav:"settings",module:"settings"}),!ta.value.length&&!Wa.value&&e.push({id:"continue-flow",tone:"flow",title:"队列空闲",detail:"可以开始新的角色图或素材生成",action:"进入生成",nav:"generate",module:"generate"}),e.slice(0,4)}),__=S(()=>{var f,p;const e=(f=de.value)==null?void 0:f.permissions,a=(p=de.value)==null?void 0:p.feature_flags,r=!!(e!=null&&e.can_write),s=!!(e!=null&&e.can_retry_tasks),d=!!(e!=null&&e.can_manage_materials);return[{id:"new-generation",group:"创建入口",title:"新建图片任务",detail:"从提示词、角色或节点继续生成,最终提交到任务队列。",badge:"核心入口",endpoint:A.nodeGenerate(":nodeId"),state:r?"可接入":"只读权限",tone:r?"primary":"neutral",action:"待排布表单",enabled:r},{id:"quick-profile",group:"创建入口",title:"快速角色草稿",detail:"先生成角色基础信息,再进入角色工作流补图。",badge:"角色起步",endpoint:A.quickProfileDraft,state:a!=null&&a.quick_profile?"已开启":"未开启",tone:a!=null&&a.quick_profile?"accent":"neutral",action:"放入角色入口",enabled:!!(a!=null&&a.quick_profile&&r),nav:"profiles",module:"suggestions"},{id:"workflow-create",group:"创建入口",title:"角色工作流",detail:"按角色保存多节点流程,支持启动、取消、归档和续跑。",badge:"流程",endpoint:A.profileWorkflows(":profileId"),state:a!=null&&a.workspace?"已开启":"未开启",tone:a!=null&&a.workspace?"primary":"neutral",action:"整理工作流",enabled:!!(a!=null&&a.workspace&&r),nav:"profiles",module:"suggestions"},{id:"prompt-compose",group:"创作控制",title:"提示词组合",detail:"组合基础、外观、风格、负面词和本次生成描述。",badge:"Prompt",endpoint:"local/prompt-composer",state:"待排布",tone:"primary",action:"做成主输入区",enabled:!0},{id:"node-generate",group:"创作控制",title:"节点生成与重试",detail:"对单个节点发起生成、失败重试、标记完成或补选结果。",badge:"节点",endpoint:`${A.nodeGenerate(":nodeId")} / ${A.nodeRetry(":nodeId")}`,state:s?"可重试":"无重试权限",tone:s?"accent":"neutral",action:"接入队列操作",enabled:s,nav:"queue",module:"queue"},{id:"model-route",group:"创作控制",title:"模型路由与能力档案",detail:"读取 provider 能力档案并执行 metadata-only 元数据检查,不触发真实生图。",badge:"模型",endpoint:A.apiDiscoveryCapabilities,state:a!=null&&a.api_discovery?"已开启":"未开启",tone:a!=null&&a.api_discovery?"primary":"warn",action:"放入参数侧栏",enabled:!!(a!=null&&a.api_discovery),nav:"settings",module:"settings"},{id:"material-pick",group:"资源资产",title:"素材库引用",detail:"从素材库选择参考图、导入素材包,并触发识别或确认。",badge:"素材",endpoint:A.materials,state:a!=null&&a.material_library?"已开启":"未开启",tone:a!=null&&a.material_library?"accent":"neutral",action:"做成选择器",enabled:!!(a!=null&&a.material_library&&d),nav:"materials",module:"images"},{id:"wardrobe-match",group:"资源资产",title:"衣橱搭配",detail:"把素材导入角色衣橱,匹配服装、配件和组合。",badge:"衣橱",endpoint:A.wardrobeMatch(":profileId"),state:a!=null&&a.wardrobe?"已开启":"未开启",tone:a!=null&&a.wardrobe?"accent":"neutral",action:"并入素材面板",enabled:!!(a!=null&&a.wardrobe&&d),nav:"materials",module:"images"},{id:"daily-outfit",group:"资源资产",title:"私伴每日穿搭",detail:"根据私伴集成生成每日穿搭建议,再转为素材或生成任务。",badge:"集成",endpoint:A.privateCompanionDailyOutfit,state:a!=null&&a.private_companion_integration?"已开启":"未开启",tone:a!=null&&a.private_companion_integration?"primary":"neutral",action:"保留为扩展卡",enabled:!!(a!=null&&a.private_companion_integration)},{id:"queue-control",group:"执行结果",title:"队列调度",detail:"查看等待、运行、失败、死信任务,并支持取消、重试和归档。",badge:"队列",endpoint:A.jobs,state:`${oo.value} 个任务`,tone:oo.value>0?"warn":"accent",action:"查看队列",enabled:!0,nav:"queue",module:"queue"},{id:"review-select",group:"执行结果",title:"结果审核与选图",detail:"对节点结果做审核、选择、取消选择、采用或归档。",badge:"审核",endpoint:A.nodeReview(":nodeId"),state:r?"可接入":"只读权限",tone:r?"primary":"neutral",action:"放到结果区",enabled:r},{id:"gallery-archive",group:"执行结果",title:"图库与历史",detail:"查看最近结果、节点图片、工作流历史和已归档图片。",badge:"图库",endpoint:A.image(":imageId"),state:`${ro.value.length} 张最近结果`,tone:ro.value.length?"accent":"neutral",action:"打开图库",enabled:!0,nav:"gallery",module:"images"}]}),lv=S(()=>fe.find(e=>e.key===H.value)??fe[0]),ov=S(()=>{const e=new Set(ie[H.value]);return __.value.filter(a=>e.has(a.id))}),b_=S(()=>{var r,s,d,f,p,h,T,O,Y;const e=ov.value.filter(J=>J.enabled).length,a=ov.value.length;return H.value==="quickProfile"?[{label:"当前页面",value:"快速角色",hint:"草稿、素材和衣橱入口"},{label:"角色草稿",value:(r=de.value)!=null&&r.feature_flags.quick_profile?"开启":"未开",hint:"用于快速生成角色基础信息"},{label:"素材能力",value:(s=de.value)!=null&&s.feature_flags.material_library?"开启":"未开",hint:"参考图和素材识别会放在这里"},{label:"可用卡片",value:String(e),hint:`共 ${a} 项功能`}]:H.value==="workflow"?[{label:"当前页面",value:"角色工作流",hint:"多节点流程和续跑入口"},{label:"工作流",value:(d=de.value)!=null&&d.feature_flags.workspace?"开启":"未开",hint:"支持启动、取消、归档和续跑"},{label:"当前队列",value:String(oo.value),hint:`运行 ${((f=E.value)==null?void 0:f.queue.running)??0} / 失败 ${((p=E.value)==null?void 0:p.queue.failed)??0}`},{label:"可用卡片",value:String(e),hint:`共 ${a} 项功能`}]:[{label:"当前页面",value:"图片生成",hint:"提示词、模型、素材和结果"},{label:"写入权限",value:(h=de.value)!=null&&h.permissions.can_write?"可写":"只读",hint:(T=de.value)!=null&&T.permissions.can_retry_tasks?"可重试任务":"无重试权限"},{label:"当前队列",value:String(oo.value),hint:`运行 ${((O=E.value)==null?void 0:O.queue.running)??0} / 失败 ${((Y=E.value)==null?void 0:Y.queue.failed)??0}`},{label:"最近结果",value:String(ro.value.length),hint:"图库与审核区可复用这些结果"}]}),w_=S(()=>{var e,a,r,s;return[{label:"Pending",value:((e=E.value)==null?void 0:e.queue.pending)??0},{label:"Running",value:((a=E.value)==null?void 0:a.queue.running)??0},{label:"Failed",value:((r=E.value)==null?void 0:r.queue.failed)??0},{label:"Dead",value:((s=E.value)==null?void 0:s.queue.dead_letter)??0}]}),h_=S(()=>{var e,a,r,s;return[{label:"总占用",value:Ll(((e=E.value)==null?void 0:e.storage.total_bytes)??0)},{label:"图片",value:Ll(((a=E.value)==null?void 0:a.storage.images_bytes)??0)},{label:"素材",value:Ll(((r=E.value)==null?void 0:r.storage.materials_bytes)??0)},{label:"临时",value:Ll(((s=E.value)==null?void 0:s.storage.temp_bytes)??0)}]}),k_=()=>{if(H.value!=="quickProfile"||to.value)return;const e=Yo.value;if(e.length<2)return;const a=e.findIndex(s=>s.id===_l.value),r=a>=0?(a+1)%e.length:0;_l.value=e[r].id},rv=()=>{Bs!==void 0&&(window.clearInterval(Bs),Bs=void 0)},C_=()=>{rv(),Bs=window.setInterval(k_,6500)};ls(()=>{xh(),window.history.scrollRestoration="manual",window.scrollTo({top:0,left:0,behavior:"auto"}),document.addEventListener("pointerdown",ip,!0),document.addEventListener("pointermove",sp,!0),document.addEventListener("pointerup",up,!0),document.addEventListener("pointercancel",dp,!0),document.addEventListener("pointermove",gv,!0),document.addEventListener("keydown",cp),document.addEventListener("visibilitychange",Er),window.addEventListener("focus",Er),window.addEventListener("online",Er),$n.value||Js(_M),C_(),Si(),L_()}),ti(()=>{document.removeEventListener("pointerdown",ip,!0),document.removeEventListener("pointermove",sp,!0),document.removeEventListener("pointerup",up,!0),document.removeEventListener("pointercancel",dp,!0),document.removeEventListener("pointermove",gv,!0),document.removeEventListener("keydown",cp),document.removeEventListener("visibilitychange",Er),window.removeEventListener("focus",Er),window.removeEventListener("online",Er),Hd(),rv(),mi!==void 0&&window.clearInterval(mi),jo!==void 0&&window.clearTimeout(jo),Qs();for(const e of Ca)URL.revokeObjectURL(e);Ca.clear()}),lt([Qn,Zl,eo,$n,an,$r],Rh,{deep:!0}),lt(Xo,e=>{tn.value=e.length?Math.min(tn.value,e.length-1):0}),lt(Ho,e=>{if(!e.length){U.value="";return}e.some(a=>a.image_id===U.value)||(U.value=e[0].image_id)},{immediate:!0}),lt(io,e=>{if(!e.length){jt.value="";return}e.some(a=>a.value===jt.value)||(jt.value=e[0].value)},{immediate:!0}),lt(Yo,e=>{if(!e.length){_l.value="";return}e.some(a=>a.id===_l.value)||(_l.value=e[0].id)},{immediate:!0}),lt(Cl,e=>{if(!e.length){Ye.value="";return}e.some(a=>a.id===Ye.value)||(Ye.value=e[0].id)},{immediate:!0}),lt(()=>{var e;return[G.value.state,(e=Wt.value)==null?void 0:e.workflow_id]},([e,a])=>{e!=="connected"||!a||Jl.value[a]||Br(a)},{immediate:!0}),lt(()=>{var e;return[G.value.state,(e=Ae.value)==null?void 0:e.node_id]},([e,a])=>{di.value="",!(e!=="connected"||!a)&&nc(a)},{immediate:!0}),lt(()=>{var e;return[G.value.state,(e=Ae.value)==null?void 0:e.node_id,Ft.value]},([e,a,r])=>{Bv(),Je.value="",hn.value="",!(e!=="connected"||!a||!r)&&lc(a)},{immediate:!0}),lt(()=>{var e;return[(e=Ae.value)==null?void 0:e.node_id,Ve.value]},([e,a])=>{if(!Fo.value)return;const r=kn.value;if(!e||!a||!r||a.round.node_id!==r.round.node_id){Fo.value=!1,kn.value=null,zn.value="";return}a.round.round_id===r.round.round_id&&(kn.value=a)}),lt(rn,e=>{const a=new Set(e.map(ft));a.has(Fn.value)||(Fn.value=""),Ia.value=Ia.value.filter(r=>a.has(r)),a.has(Ct.value)||(Ct.value=""),qa.value=Object.fromEntries(Object.entries(qa.value).filter(([r])=>a.has(r))),Ia.value.length<2&&(Lo.value=!1)},{immediate:!0}),lt(Rf,e=>{if(!e.length){we.value="";return}e.some(a=>a.image_id===we.value)||(we.value=e[0].image_id)},{immediate:!0}),lt([ta,_o],()=>{var e;if(!ta.value.length){$a.value="";return}ta.value.some(a=>a.task_id===$a.value)||($a.value=((e=_o.value[0])==null?void 0:e.task_id)??ta.value[0].task_id)},{immediate:!0}),lt(uo,e=>{if(!e.length){Pa.value="";return}e.some(a=>a.id===Pa.value)||(Pa.value=e[0].id)},{immediate:!0}),lt(Os,e=>{if(!e.length){yn.value="";return}e.some(a=>a.id===yn.value)||(yn.value=e[0].id)},{immediate:!0}),lt(zo,e=>{if(!e.length){yl.value="";return}e.some(a=>a.id===yl.value)||(yl.value=e[0].id)},{immediate:!0}),lt(ki,e=>{if(!e.length){Oo.value="";return}Oo.value!==Uc&&(e.some(a=>a.profile_id===Oo.value)||Yd(e[0].profile_id))},{immediate:!0}),lt(dt,e=>{e&&(fv(e),Kd(e))},{immediate:!0}),lt(he,e=>{e!=null&&e.profileId&&Dv(e)}),lt(_l,()=>{Ht(()=>{var e;(e=document.querySelector(".quick-profile-image-types button.active"))==null||e.scrollIntoView({block:"nearest",behavior:"smooth"})})});function $_(){const e=new URLSearchParams(window.location.search).get("view");return Wi.some(a=>a.key===e)?e:"overview"}function iv(){const e=$u();return{state:"checking",label:"连接中",title:"正在检测后端连接",detail:e==="plugin-bridge"?"正在通过 AstrBot 插件桥读取 ui/bootstrap。":"正在通过同源 API 读取 ui/bootstrap。",transport:e,checkedAt:""}}function P_(){G.value=iv()}function I_(e){const a=$u();G.value={state:"connected",label:"后端已连接",title:"后端已连接",detail:a==="plugin-bridge"?"已通过 AstrBot 插件桥调用后端,写入动作会进入工作流并落库。":`已通过同源 API ${e.api_base} 调用后端,写入动作会进入工作流并落库。`,transport:a,checkedAt:new Date().toISOString()}}function S_(e){const a=$u(),r=a==="direct-fetch"&&x_(e);G.value={state:r?"preview":"error",label:r?"预览模式":"连接异常",title:r?"当前未连接真实插件后端":"后端连接异常",detail:r?"当前页面只跑在前端预览里,没有拿到 ImageStudio 后端 API;需要在 AstrBot 插件页或真实 API 代理下验收落库。":sv(e),transport:a,checkedAt:new Date().toISOString()}}function x_(e){return e instanceof sa?["invalid_api_response","network_unreachable","http_error"].includes(e.code):!0}function sv(e){return e instanceof sa?e.code==="invalid_api_response"?"接口返回了页面内容或非 JSON 数据,不是 ImageStudio API 响应。":e.code==="network_unreachable"?"无法连接 ImageStudio 后端接口。":e.message||"ImageStudio 后端接口请求失败。":e instanceof Error?e.message.includes("Unexpected token")?"接口返回了页面内容或非 JSON 数据,不是 ImageStudio API 响应。":e.message.includes("Failed to fetch")||e.message.includes("NetworkError")?"无法连接 ImageStudio 后端接口。":e.message||"加载失败":"加载失败"}function yt(e){var a;return G.value.state==="checking"?`${e}需要先完成后端连接检测。`:G.value.state!=="connected"?`${e}需要连接 ImageStudio 后端后才能落库。${G.value.detail}`:(a=de.value)!=null&&a.permissions.can_write?"":`${e}需要后端写入权限。`}async function Si(){Qs(),await uv(),G.value.state==="connected"&&(await Promise.all([ga(),In(),q_(),Ud(),Ka()]),await Promise.all([Wd(),Ma(),Fd()]),Pr.value=new Date().toISOString())}function R_(){return k$(new URLSearchParams(window.location.search).get("materialView"))}function M_(){var e;return((e=new URLSearchParams(window.location.search).get("profile"))==null?void 0:e.trim())??""}async function A_(){await Promise.all([uv(),Ud()]),Pr.value=new Date().toISOString()}function E_(e,a,r){return new Promise((s,d)=>{const f=window.setTimeout(()=>d(new Error(r)),a);e.then(p=>{window.clearTimeout(f),s(p)},p=>{window.clearTimeout(f),d(p)})})}async function uv(){P_();try{de.value=await E_(be(A.uiBootstrap),6e3,"AstrBot 插件桥连接超时,正在自动重试。"),I_(de.value),As=0,Qs()}catch(e){de.value=null,S_(e),dv()}}function Qs(){Cr!==void 0&&(window.clearTimeout(Cr),Cr=void 0)}function dv(){if(Cr!==void 0||G.value.state==="connected")return;const e=Math.min(1e3*2**Math.min(As,4),15e3);As+=1,Cr=window.setTimeout(()=>{if(Cr=void 0,document.hidden){dv();return}Si()},e)}function Er(){var e,a;if(!document.hidden){if(G.value.state==="connected"){const r=(e=Ve.value)==null?void 0:e.round.round_id;r&&Mi(((a=Ve.value)==null?void 0:a.round.status)??"")&&su(r,!0);return}G.value.state!=="checking"&&(As=0,Qs(),Si())}}async function ga(){kl.value=!0,Wa.value="";const e=B_();try{const a=await be(A.dashboardSummary);E.value=a;const r=await Promise.allSettled(a.recent_images.slice(0,8).map(s=>be(A.image(s.image_id))));N.value=r.filter(s=>s.status==="fulfilled").map(s=>s.value).filter(Va)}catch(a){Wa.value=ge(a),N.value=[]}finally{await e,kl.value=!1}}async function Wd(){if(G.value.state!=="connected"){Se.value=[],Ls.value="";return}sd.value=!0,Ls.value="";try{const a=[];let r=1,s=0;do{const d=await be(A.images,{include_archived:!0,page:r,page_size:100});if(a.push(...d.items.filter(Va)),s=d.total,!d.items.length)break;r+=1}while(a.length<s);Se.value=Na(a,d=>d.image_id)}catch(e){Se.value=[],Ls.value=`完整图库读取失败:${ge(e)}`}finally{sd.value=!1}}async function T_(){await Promise.all([ga(),Wd()]),Pr.value=new Date().toISOString()}async function N_(){var a,r,s,d;const e=te.value.trim();if(!(!e||Pe.value)){Pe.value=!0;try{const f=await ke(A.promptGovernancePreview,{prompt:e,entrypoint:"web",translation_consent:!0,selection:"translated",model_route:ou()}),p=String(f.selected_prompt||((a=f.translation)==null?void 0:a.translated_text)||"").trim();if(!p||((r=f.translation)==null?void 0:r.status)==="unavailable_fallback"||((s=f.translation)==null?void 0:s.status)==="failed_fallback")throw new Error(((d=f.translation)==null?void 0:d.error)||"未找到可用的提示词扩写模型");te.value=p}catch(f){Dn.value=`提示词扩写失败:${ge(f)}`}finally{Pe.value=!1}}}function L_(){mi!==void 0&&window.clearInterval(mi);const e=async()=>{var a;if(!(G.value.state!=="connected"||document.hidden))try{const r=await be(A.eventStream,{limit:20}),s=((a=r.events.at(-1))==null?void 0:a.event_id)??"";if(!s||s===Es)return;const d=!!Es,f=d?r.events.findIndex(Le=>Le.event_id===Es):-1,p=d?r.events.slice(f>=0?f+1:-1):[];if(Es=s,!d)return;const h=p.map(Le=>String(Le.event_type||"")),T=h.some(Le=>Le.startsWith("generation.")),O=h.some(Le=>Le.startsWith("workflow.")),Y=[];T&&Y.push(In()),(T||O)&&["overview","performance"].includes(F.value)&&Y.push(ga());const J=Ve.value;T&&J&&Mi(J.round.status)&&Y.push(su(J.round.round_id,!0)),F.value==="gallery"&&T&&Y.push(Wd()),F.value==="logs"&&(T||O)&&Y.push(Ma()),await Promise.allSettled(Y)}catch{}};e(),mi=window.setInterval(e,5e3)}async function B_(){ud.value=!0,bi.value="";try{B.value=await be(A.costUsage,{days:1})}catch(e){B.value=null,bi.value=`今日用量读取失败:${ge(e)}`}finally{ud.value=!1}}async function In(){Da.value=!0,nn.value||(Xt.value="");try{st.value=await O_()}catch(e){Xt.value=ge(e)}finally{Da.value=!1}}async function Ma(){var e;if(G.value.state!=="connected"){ht.value=[],it.value=[],Ze.value=[],He.value=[],Ba.value=[],no.value="";return}Ts.value=!0,no.value="";try{const a=(e=de.value)!=null&&e.permissions.can_manage_config?be(A.auditLogs,{limit:100}):Promise.resolve([]),[r,s,d,f,p]=await Promise.all([be(A.generationLogs,{limit:100}),be(A.workflowLogs,{limit:100}),be(A.errorLogs,{limit:100}),be(A.integrationLogs,{limit:100}),a]);ht.value=r,it.value=s,Ze.value=d,He.value=f,Ba.value=p}catch(a){no.value=ge(a)}finally{Ts.value=!1}}async function q_(){dd.value=!0,vd.value="";const[e,a]=await Promise.allSettled([be(A.apiDiscoveryCapabilities),be(A.runtimeModels)]);Vl.value=e.status==="fulfilled"?e.value:[],No.value=a.status==="fulfilled"?a.value.items??[]:[],e.status==="rejected"&&(vd.value=ge(e.reason)),dd.value=!1}async function O_(){const a=await be(A.jobs,{page:1,page_size:100}),r=Math.ceil(a.total/100);if(r<=1)return a;const s=await Promise.all(Array.from({length:r-1},(f,p)=>be(A.jobs,{page:p+2,page_size:100}))),d=Na([a,...s].flatMap(f=>f.items),f=>f.task_id);return{...a,items:d,page:1,page_size:d.length}}async function Fd(){var e;if(G.value.state!=="connected"){Bn.value=null,ze.value=null,zt.value=[],qn.value=null,Jn.value="";return}Ns.value=!0,Jn.value="";try{const a=(e=de.value)!=null&&e.permissions.can_manage_config?be(A.settingsSnapshots,{limit:20}):Promise.resolve([]),[r,s,d]=await Promise.all([be(A.settingsSchema),be(A.settingsCurrent),a]);Bn.value=r,ze.value=s,zt.value=d}catch(a){Jn.value=ge(a)}finally{Ns.value=!1}}async function D_(e){Go.value=!0,Jn.value="",lo.value="";try{qn.value=await ke(A.settingsValidate,{config:e}),lo.value=qn.value.valid?"配置校验通过。":"配置校验未通过,请检查错误项。"}catch(a){Jn.value=ge(a)}finally{Go.value=!1}}async function W_(e){var a;Go.value=!0,Jn.value="",lo.value="";try{const r=await ke(A.settingsValidate,{config:e});if(qn.value=r,!r.valid){lo.value="配置校验未通过,未执行保存。";return}const s=await ke(A.settingsSave,{config:e});ze.value={config_path:((a=ze.value)==null?void 0:a.config_path)??"",config:s.config},lo.value="配置已保存并生成快照。",await Fd()}catch(r){Jn.value=ge(r)}finally{Go.value=!1}}async function F_(){var e;Go.value=!0,Jn.value="",lo.value="";try{const a=await ke(A.settingsReload);ze.value={config_path:((e=ze.value)==null?void 0:e.config_path)??"",config:a.config},lo.value="已从配置文件重新载入。"}catch(a){Jn.value=ge(a)}finally{Go.value=!1}}async function Ka(){var e;Yn.value=!0,wt.value="",Xa.value||(xt.value="");try{const[a,r,s]=await Promise.all([be(A.materialCategories),be(A.materials,{page:1,page_size:100}),cv()]),d=await U_(r);St.value=a,va.value=d,On.value=s,!Cf.value&&((e=de.value)!=null&&e.permissions.can_manage_materials)&&(Cf.value=!0,Yw(a))}catch(a){St.value=[],va.value=null,On.value=[],wt.value=ge(a)}finally{Yn.value=!1}}async function cv(){try{const e=await be(A.materialCatalog,{page:1,page_size:200});return(Array.isArray(e)?e:e.items??[]).filter(r=>Be(r.status)!=="archived").sort((r,s)=>+(Zs(s)==="advanced")-+(Zs(r)==="advanced")||Number(s.priority||0)-Number(r.priority||0))}catch{return[]}}async function U_(e){const a=Math.max(1,e.page_size),r=Math.ceil(e.total/a);if(r<=1)return e;const s=await Promise.all(Array.from({length:r-1},(f,p)=>be(A.materials,{page:p+2,page_size:a}))),d=Na([e,...s].flatMap(f=>f.items),f=>f.material_id);return{...e,items:d,page:1,page_size:d.length}}async function Ud(){cd.value=!0,fd.value="";try{const e=await be(A.profiles,{page:1,page_size:100}),r=(await K_(e)).items.filter(s=>{var d;return((d=s.metadata)==null?void 0:d.system_key)!==qi});Yt.value=r,Sa.value=r.map((s,d)=>Bw(s,void 0,void 0,d))}catch(e){Yt.value=[],Sa.value=[],fd.value=ge(e)}finally{cd.value=!1}}async function K_(e){const a=Math.max(1,e.page_size),r=Math.ceil(e.total/a);if(r<=1)return e;const s=await Promise.all(Array.from({length:r-1},(f,p)=>be(A.profiles,{page:p+2,page_size:a}))),d=Na([e,...s].flatMap(f=>f.items),f=>f.profile_id);return{...e,items:d,page:1,page_size:d.length}}async function fv(e){var s;const a=++qs,r=vv(e.profile_id);if(_i.value=!0,await V_(e),G.value.state!=="connected"||((s=e.metadata)==null?void 0:s.source)==="sample"||Rt.value[e.profile_id]){a===qs&&(_i.value=!1);return}try{const d=await be(A.profileWorkflows(e.profile_id));if(!Ys(e.profile_id,r))return;Rt.value={...Rt.value,[e.profile_id]:d};const f=await Promise.allSettled(d.map(J=>be(A.workflow(J.workflow_id))));if(!Ys(e.profile_id,r))return;const p=f.filter(J=>J.status==="fulfilled").map(J=>J.value);if(p.length){if(await er(p.flatMap(J=>J.nodes)),!Ys(e.profile_id,r))return;Xe.value={...Xe.value,...Object.fromEntries(p.map(J=>[J.workflow.workflow_id,J.workflow]))},je.value={...je.value,...Object.fromEntries(p.map(J=>[J.workflow.workflow_id,J.nodes]))}}const T=d.filter(Or).find(J=>J.workflow_type===Qa),O=Fv(d.filter(J=>!["cancelled","archived"].includes(Be(J.status)))),Y=d.find(J=>J.workflow_type==="quick_profile");Sa.value=Sa.value.map(J=>J.profileId===e.profile_id?{...J,workflowId:T==null?void 0:T.workflow_id,quickCharacterWorkflowId:O==null?void 0:O.workflow_id,quickProfileWorkflowId:Y==null?void 0:Y.workflow_id,status:T?"详细工作流就绪":O?"快速角色已生成":Y?"快速档案已落库":J.status}:J)}catch{if(!Ys(e.profile_id,r))return;Rt.value={...Rt.value,[e.profile_id]:[]}}finally{a===qs&&(_i.value=!1)}}function vv(e){const a=(pd.get(e)??0)+1;return pd.set(e,a),a}function Ys(e,a){return pd.get(e)===a}function pv(e){vv(e),qs+=1,_i.value=!1}async function V_(e){var r;const a=((r=e.avatar_image_uri)==null?void 0:r.trim())??"";if(!(!a||Vn.value[e.profile_id])){if(/^(?:https?:|data:|blob:)/i.test(a)){Vn.value={...Vn.value,[e.profile_id]:a};return}if(!(!a.startsWith("storage://")||G.value.state!=="connected"))try{const s=await be(A.mediaSign,{uri:a});Vn.value={...Vn.value,[e.profile_id]:s.url}}catch{}}}async function Kd(e,a=!1){var d,f;const r=e.profile_id;if(G.value.state!=="connected"||!((d=de.value)!=null&&d.feature_flags.wardrobe)||((f=e.metadata)==null?void 0:f.source)==="sample"){xi(r),ae.value={...ae.value,[r]:[]};return}if(!a&&Object.hasOwn(ae.value,r))return;const s=mv(r);jd(r,!0),L.value={...L.value,[r]:""};try{const p=await be(A.wardrobe(r));if(!Vd(r,s))return;ae.value={...ae.value,[r]:p},await j_(p)}catch(p){if(!Vd(r,s))return;L.value={...L.value,[r]:ge(p)}}finally{Vd(r,s)&&jd(r,!1)}}function mv(e){const a=(md.get(e)??0)+1;return md.set(e,a),a}function Vd(e,a){return md.get(e)===a}function xi(e){mv(e),jd(e,!1)}function jd(e,a){Ge.value={...Ge.value,[e]:a}}async function j_(e){var f;const a=new Set([...hd.value.map(p=>p.material_id),...(((f=va.value)==null?void 0:f.items)??[]).map(p=>p.material_id),...Object.keys(x.value)]),r=ur(e.map(p=>p.material_id).filter(p=>!a.has(p)));if(!r.length)return;const d=(await Promise.allSettled(r.map(p=>be(p.startsWith("advmat_")?A.advancedMaterial(p):A.material(p))))).filter(p=>p.status==="fulfilled").map(p=>p.value);d.length&&(x.value={...x.value,...Object.fromEntries(d.map(p=>[p.material_id,p]))})}function Mt(e,a=(r=>(r=Wi.find(s=>s.key===e))==null?void 0:r.module)()??"overview"){F.value=e;const s=new URL(window.location.href);s.searchParams.set("view",e),window.history.replaceState({},"",`${s.pathname}${s.search}`),Ht(()=>Y_(a))}function G_(e){Mt(e.key,e.module)}function Tr(e){W.value=e;const a=new URL(window.location.href);a.searchParams.set("view","materials"),a.searchParams.set("materialView",e),window.history.replaceState({},"",`${a.pathname}${a.search}`)}async function H_(){Pr.value=new Date().toISOString(),On.value=await cv()}function z_(e){we.value=e.image_id,U.value=e.image_id,te.value=e.prompt;const a=io.value.find(r=>r.value===e.model||r.label===e.model);a&&(jt.value=a.value),H.value="image",Mt("generate","generate")}function Gd(){Hd(),kr.value=!0}function Q_(){if($n.value=!$n.value,$n.value){Gd();return}Js(Wc)}function gv(e){if(!($n.value||window.matchMedia("(max-width: 900px)").matches)){if(e.clientX<=bM){Gd();return}kr.value&&e.clientX>=wM&&Ir===void 0&&Js(Wc)}}function Js(e=Wc){$n.value||(Hd(),Ir=window.setTimeout(()=>{kr.value=!1,Ir=void 0},e))}function Hd(){Ir!==void 0&&(window.clearTimeout(Ir),Ir=void 0)}function yv(e){Is.value=e.title,tn.value=0,id.value=!1,hr.value=!1,Mt(e.nav,e.module)}function Y_(e){var d;const a=document.querySelector(`[data-module="${e}"]`);if(!a)return;const r=((d=document.querySelector(".topbar"))==null?void 0:d.getBoundingClientRect().height)??0,s=window.scrollY+a.getBoundingClientRect().top-r-18;window.scrollTo({top:Math.max(0,s),behavior:"smooth"})}function J_(){Qn.value=Qn.value==="dark"?"light":"dark"}function Nr(e){return[e.genderPresentation?`gender presentation: ${e.genderPresentation}`:"",e.ageStage?`age stage: ${e.ageStage}`:"",e.species?`species: ${e.species}`:"",e.bodyType?`body type: ${e.bodyType}`:"",e.hairColor?`${e.hairColor} hair`:"",e.hairstyle,e.eyeColor?`${e.eyeColor} eyes`:"",e.distinctiveFeatures,e.clothing].filter(Boolean).join(", ")}function X_(e){return`${e.name},${e.identity},personality: ${e.personality}`}function _v(e){return{"--profile-color-a":e[0],"--profile-color-b":e[1],"--profile-color-c":e[2]}}function Sn(e){const a=Un.value[e];return a?so.value.find(r=>r.id===a&&r.category===e)??null:null}function bv(e){return Un.value[e.category]===e.id}function zd(e){const a=(e==null?void 0:e.trim())??"";return!a||a.startsWith("qp-material-")||a.startsWith("sample:")?"":a}function Qd(){return ur(Fa.value.map(e=>zd(e.id)).filter(Boolean))}function Lr(e,a=0){return e.imageUrl??""}function wv(e){return e.group??e.category}function hv(e){Hl.value=e}function kv(e){if(gt.value===e&&vp("materialPicker")){At("materialPicker");return}ja("materialPicker"),gt.value=e,e!==Pt&&(Hl.value=Ur)}function Cv(e){Un.value={...Un.value,[e.category]:e.id},Bo.value=e.id,At("materialPicker")}function $v(e){var r;const a=so.value.find(s=>s.id===Bo.value);Un.value={...Un.value,[e]:""},(!a||a.category===e)&&(Bo.value=((r=Fa.value[0])==null?void 0:r.id)??""),At("materialPicker")}function Xs(e){return{Style:"风格",Composition:"构图",Outfit:"服装",Top:"服装",Bottom:"服装",Dress:"服装",Shoes:"鞋袜",Accessory:"配饰"}[e]??e}function Z_(e){var d;const a=new Date().toISOString(),r=Zs(e),s=Number(e.priority||((d=e.metadata)==null?void 0:d.material_priority)||0);return{material_id:e.material_id,category_id:e.category_id??null,display_name:e.display_name,image_uri:e.image_uri??null,thumbnail_uri:e.thumbnail_uri??null,image_url:e.image_url||e.image_uri||null,thumbnail_url:e.thumbnail_url||e.thumbnail_uri||null,prompt:e.prompt??null,negative_prompt:e.negative_prompt??null,tags:Array.isArray(e.tags)?e.tags:[],recognition_status:"confirmed",metadata:{...e.metadata,material_type:r,advanced_material:r==="advanced",catalog_priority:s,source_image_uri:e.image_uri??null},created_at:String(e.created_at||a),updated_at:String(e.updated_at||e.created_at||a)}}function Zs(e){var a;return String(e.library_kind||e.material_type||((a=e.metadata)==null?void 0:a.library_kind)||"standard")}function eb(e,a){var T,O,Y,J,Le,Me;const r=St.value.find(Oe=>Oe.category_id===e.category_id),s=r!=null&&r.parent_id?St.value.find(Oe=>Oe.category_id===r.parent_id):void 0,d=Xs((s==null?void 0:s.name)||(r==null?void 0:r.name)||""),f=V.find(Oe=>Oe.category===d);if(!f)return null;const p=Nt((T=e.metadata)==null?void 0:T.subcategory)||Nt((O=e.metadata)==null?void 0:O.group)||Nt((Y=e.metadata)==null?void 0:Y.accessory_group),h=s?r==null?void 0:r.name:p;return{id:e.material_id,label:e.display_name||Ta(e.material_id),category:d,group:h||void 0,prompt:e.prompt??"",colors:tb(e.metadata,f.colors),imageUrl:sn(e.thumbnail_url)||sn(e.image_url),source:"backend",advanced:((J=e.metadata)==null?void 0:J.advanced_material)===!0||((Le=e.metadata)==null?void 0:Le.material_type)==="advanced",priority:Number(((Me=e.metadata)==null?void 0:Me.catalog_priority)||0)}}function tb(e,a){const r=e.colors;return Array.isArray(r)&&r.length>=3&&r.slice(0,3).every(s=>typeof s=="string")?[String(r[0]),String(r[1]),String(r[2])]:a}function ab(e){return[...e].sort((a,r)=>Pv(a)-Pv(r))}function Pv(e){return e.category_id.startsWith("cat_imagestudio_")?0:e.category_id.startsWith("cat_default_")?1:2}function Iv(e){const a=["风格","构图","服装","鞋袜","配饰"],r=a.indexOf(Xs(e));return r<0?a.length:r}function nb(e){return{风格:"画风、渲染和色彩基准",构图:"头像、半身、全身和动态参考",服装:"衣服结构、层次和材质",鞋袜:"鞋型、袜型和下身比例参考",配饰:"头部、手部、胸前、腰部等局部物件"}[e]??"素材分类"}function lb(e,a){var f,p,h,T;const r=e.category_id?ny.value.get(e.category_id):"",s=Nt((f=e.metadata)==null?void 0:f.subcategory)||Nt((p=e.metadata)==null?void 0:p.group)||Nt((h=e.metadata)==null?void 0:h.accessory_group)||"其他",d=(T=e.metadata)!=null&&T.normalized_asset_profile&&typeof e.metadata.normalized_asset_profile=="object"&&!Array.isArray(e.metadata.normalized_asset_profile)?e.metadata.normalized_asset_profile:{};return{id:e.material_id,label:e.display_name||Ta(e.material_id),category:r||"未分类",categoryId:e.category_id||"uncategorized",subcategory:s,prompt:e.prompt??"",negativePrompt:e.negative_prompt??"",tags:e.tags??[],status:e.recognition_status||"uploaded",statusText:eu(e.recognition_status),endpoint:A.material(e.material_id),imageUrl:sn(e.thumbnail_url)||sn(e.image_url),source:"backend",colors:["#64748b","#2ec4b6","#7168f0"],updatedAt:Tl(e.updated_at||e.created_at),semanticCategory:String(d.category||"other"),bodySlots:Array.isArray(d.body_slots)?d.body_slots.map(String):[],wearLayer:String(d.wear_layer||""),confidence:Number(d.confidence||0),profileConfirmed:d.confirmed===!0}}function eu(e){return{uploaded:"URI 已登记",pending:"待识别",pending_recognition:"待识别",pending_confirm:"待确认",recognizing:"识别中",recognized:"已识别",confirmed:"已确认",failed:"识别失败",archived:"已归档"}[Be(e)]??(e||"待识别")}function ob(e){const a=Be(e);return["failed"].includes(a)?"is-bad":["pending","pending_recognition","pending_confirm","uploaded","recognizing","recognized"].includes(a)?"is-warn":["confirmed"].includes(a)?"is-good":"is-idle"}function rb(e){Pa.value!==e&&(Pa.value=e,yn.value="")}function ib(e){Qo.value&&(Pa.value=Qo.value.id),yn.value=e}function bo(e,a={}){var s;wl.value=e==="upload-image"&&a.workflowTargetNodeId||"",wl.value||(Xl.value=[]),wt.value="",xt.value="",Dt.value="",mr.value=null;const r=yt(e==="upload-image"?"添加并识别素材":e==="register-uri"?"登记素材 URI":e==="asset-pack"?"导入素材包":"导入角色衣橱");if(r){wl.value="",Xl.value=[],wt.value=r;return}if(!((s=de.value)!=null&&s.permissions.can_manage_materials)){wl.value="",Xl.value=[],wt.value="该操作需要素材管理权限。";return}jl.value=e,ja("materialOperation")}function Sv(){var a;if(wt.value="",xt.value="",zl.value="",Gl.value)return;const e=yt("添加素材分类");if(e){wt.value=e;return}if(!((a=de.value)!=null&&a.permissions.can_manage_materials)){wt.value="添加素材分类需要素材管理权限。";return}cs.value="",fs.value="",ja("materialCategoryCreate"),ds.value=!0,Ht(()=>{var r;(r=document.querySelector("[data-material-category-name]"))==null||r.focus()})}async function sb(){var d,f;if(wt.value="",xt.value="",zl.value="",Gl.value)return;const e=yt("添加素材分类");if(e){zl.value=e;return}if(!((d=de.value)!=null&&d.permissions.can_manage_materials)){zl.value="添加素材分类需要素材管理权限。";return}const a=Ds.value,r=cs.value.trim();if(!r)return;const s=a&&((f=Qo.value)==null?void 0:f.source)==="backend"?Qo.value.id:null;if(a&&!s){zl.value="配饰父分类尚未落库,请先刷新素材库。";return}Gl.value=!0;try{const p=await ke(A.materialCategories,{name:r,parent_id:s,category_type:a?"accessory_group":"material",sort_order:St.value.length*10+10,metadata:{source:"imagestudio_frontend",created_from:"materials_page",parent_category:a?Pt:void 0,note:fs.value.trim()||void 0}});xt.value=a?`配饰子分类「${p.name}」已落库。`:`素材分类「${p.name}」已落库。`,At("materialCategoryCreate"),await Ka(),a?(Pa.value=s??Pa.value,yn.value=p.name):Pa.value=p.category_id}catch(p){zl.value=`添加分类失败:${ge(p)}`}finally{Gl.value=!1}}function xv(){if(!he.value.workflowId){xt.value="当前角色还没有已开启的详细工作流,请先从角色页面确认开启。";return}window.confirm("确认进入当前角色的详细工作流素材绑定节点?")&&(Z.value=!0,Q.value=!0,H.value="workflow",Ye.value="material-bind",Mt("generate","generate"))}function Rv(e){ad.value={category:e,requestedAt:new Date().toISOString()},At("materialPicker"),Mt("materials","images");const a=new URL(window.location.href);a.searchParams.set("materialAction","add"),a.searchParams.set("materialCategory",e),window.history.replaceState({},"",`${a.pathname}${a.search}`)}function Yd(e){if(!e){Oo.value=Uc;const r=new URL(window.location.href);r.searchParams.delete("profile"),window.history.replaceState({},"",`${r.pathname}${r.search}`);return}if(!ki.value.some(r=>r.profile_id===e))return;Oo.value=e,ys.value="avatar";const a=new URL(window.location.href);a.searchParams.set("profile",e),window.history.replaceState({},"",`${a.pathname}${a.search}`)}function Mv(){var e,a;return G.value.state!=="connected"?"角色衣橱需要连接 ImageStudio 后端。":(e=de.value)!=null&&e.feature_flags.wardrobe?de.value.permissions.can_manage_materials?!dt.value||((a=dt.value.metadata)==null?void 0:a.source)==="sample"?"请选择真实后端角色档案。":"":"当前账号没有素材管理权限。":"角色衣橱功能尚未开启。"}async function ub(e,a){const r=dt.value;if(!r||C.value)return;const s=Mv();if(s){L.value={...L.value,[r.profile_id]:s};return}const d=Of.value.find(p=>p.material_id===e),f=a.trim();if(!d||Be(d.recognition_status)!=="confirmed"||!f){L.value={...L.value,[r.profile_id]:"只能将已确认素材添加到有效衣橱分类。"};return}if($d.value.some(p=>p.material_id===e)){L.value={...L.value,[r.profile_id]:"该素材已经在当前角色衣橱中。"};return}xi(r.profile_id),C.value=`add:${e}`,L.value={...L.value,[r.profile_id]:""};try{const p=await ke(A.wardrobeItems(r.profile_id),{material_id:e,wardrobe_category:f});xi(r.profile_id),ae.value={...ae.value,[r.profile_id]:[p,...(ae.value[r.profile_id]??[]).filter(h=>h.wardrobe_item_id!==p.wardrobe_item_id)]},x.value={...x.value,[d.material_id]:d}}catch(p){L.value={...L.value,[r.profile_id]:`添加衣橱素材失败:${ge(p)}`}}finally{C.value=""}}async function db(e){const a=dt.value;if(!a||C.value)return;const r=Mv();if(r){L.value={...L.value,[a.profile_id]:r};return}if($d.value.some(s=>s.wardrobe_item_id===e)){xi(a.profile_id),C.value=`remove:${e}`,L.value={...L.value,[a.profile_id]:""};try{await Oc(A.wardrobeItem(a.profile_id,e)),xi(a.profile_id),ae.value={...ae.value,[a.profile_id]:(ae.value[a.profile_id]??[]).filter(s=>s.wardrobe_item_id!==e)}}catch(s){L.value={...L.value,[a.profile_id]:`移除衣橱素材失败:${ge(s)}`}}finally{C.value=""}}}function cb(){const e=dt.value;e&&Kd(e,!0)}async function fb(){const e=he.value;if(!e.profileId){Za.value="",jn.value="请先保存角色档案,再生成角色图片。";return}await Av(e)}async function Av(e){var J,Le,Me;const a=e.profileId;if(!a||R.value[a])return;const r=yt("生成快速角色");if(r){Za.value="",jn.value=r,D.value={...D.value,[a]:r};return}R.value={...R.value,[a]:"quick"},D.value={...D.value,[a]:""},jn.value="",Za.value=`已加入生成队列,正在准备 ${Pn.length} 张角色图片。`;let s="";const d=new Date().toISOString(),f=vb(a),p=f,h=`workflow_${tu(a)}_character_fast_${tu(f)}`,T=Jd(e),O=Fa.value.map(Oe=>Oe.prompt).filter(Boolean),Y=pb();try{if(!Y)throw new Error("未配置 quick_generation 统一生图路由,请先在设置 / 模型分工中选择快速角色模型");const Oe=await uu(e,fn,{forceNew:!0,workflowId:h,metadata:{quick_character_batch_id:f,batch_started_at:d,identity_fields:T,model_route:Y}});let pe=Oe.workflow;s=pe.workflow_id;let De=Oe.nodes;["active","running"].includes(Be(pe.status))||(pe=await ke(A.workflowStart(pe.workflow_id)),Xe.value={...Xe.value,[pe.workflow_id]:pe}),await er(De);const vt=[],Lt=new Map,_a=[];for(const re of Pn){const le=De.find(tt=>tt.node_key===re.nodeKey);if(!le)throw new Error(`快速角色缺少生成节点:${re.title}`);_a.push({spec:re,node:le})}const nt=async(re,le="")=>{const{spec:tt,node:Ea}=re,pt=await ke(A.nodeGenerate(Ea.node_id),{prompt_patch:mb(e,tt.nodeKey,T,O),prompt_processing_mode:"direct",translation_consent:!1,count:1,aspect_ratio:tt.aspectRatio,...Y?{model_route:Y}:{},...le?{input_images:[{image_id:le}]}:{},idempotency_key:`web-quick-${pe.workflow_id}-${p}-${tt.nodeKey}`,metadata:{source:"standalone_web_quick_character",profile_id:a,profile_name:e.name,workflow_id:pe.workflow_id,workflow_type:fn,quick_character_batch_id:f,batch_started_at:d,identity_fields:T,quick_character_target:tt.nodeKey,anchor_image_id:le||void 0,node_title:tt.title,task_summary:`快速角色 / ${e.name} / ${tt.title.replace(/^快速/,"")}`}}),Al=await ac(pt.images??[]);if(!Al.length){const xp=pt.task_id?`任务 ${Ta(pt.task_id)},状态 ${sl(pt.task_status||pt.node_status)}`:`节点状态 ${sl(pt.node_status)}`;throw new Error(`没有返回可用图片(${xp}),请在队列查看具体错误并重试`)}return bt.value={...bt.value,[Ea.node_id]:ko([...bt.value[Ea.node_id]??[],...Al])},vt.push(...Al),Lt.set(tt.nodeKey,Al),{spec:tt,node:Ea,images:Al,taskId:pt.task_id||""}},ba=_a.find(({spec:re})=>re.nodeKey==="quick_avatar");if(!ba)throw new Error("快速角色缺少头像锚点节点");Za.value="正在生成头像锚点;完成后将并行提交半身像、立绘和设定图。";let na;try{na=await nt(ba)}catch(re){throw new Error(`快速头像:${ge(re)}`)}const Ut=na.images[0];if(!Ut)throw new Error("头像锚点没有返回可用图片");const $=_a.filter(({spec:re})=>re.nodeKey!=="quick_avatar");Za.value=`头像锚点已完成,正在并行提交其余 ${$.length} 个一致性任务。`;let Te=0;const Bt=await Promise.allSettled($.map(async re=>{try{return await nt(re,Ut.image_id)}catch(le){throw new Error(`${re.spec.title}:${ge(le)}`)}finally{Te+=1,Za.value=`头像锚点已锁定,其余任务已返回 ${Te}/${$.length}。`}})),la=[];Bt.forEach(re=>{if(re.status==="rejected"){la.push(ge(re.reason));return}const{spec:le,node:tt,images:Ea}=re.value;bt.value={...bt.value,[tt.node_id]:ko([...bt.value[tt.node_id]??[],...Ea])},Lt.set(le.nodeKey,Ea)}),De=await be(A.workflowNodes(pe.workflow_id)),await er(De);const un=ko(Pn.flatMap(re=>{const le=De.find(tt=>tt.node_key===re.nodeKey);return le?bt.value[le.node_id]??[]:[]})),oa=Pn.filter(re=>{const le=De.find(Ea=>Ea.node_key===re.nodeKey),tt=le?bt.value[le.node_id]??[]:[];return!!(le&&Pd(le,tt))}).map(re=>re.nodeKey),Aa=Pn.filter(re=>{const le=De.find(tt=>tt.node_key===re.nodeKey);return!!(le&&["created","pending","queued","running","retrying"].includes(Be(le.status)))}).map(re=>re.nodeKey),dn=oa.length===Pn.length,ll=dn?"completed":Aa.length?"running":"failed";pe=(await be(A.workflow(pe.workflow_id))).workflow;const ol={current_node_id:((J=De.find(re=>re.node_key==="quick_sheet"))==null?void 0:J.node_id)??((Le=De.at(-1))==null?void 0:Le.node_id),metadata:{...pe.metadata??{},source:"standalone_web_quick_character",quick_character_schema:"character_fast_v2",quick_character_batch_id:f,batch_started_at:d,identity_fields:T,model_route:Y,anchor_image_id:Ut.image_id,quick_character_anchor_first:!0,generated_target_keys:oa,quick_character_parallel:!0,quick_character_operation_id:p,quick_character_pending_target_keys:Aa,quick_character_failure:la.length&&!Aa.length?la.join(";"):null}};Be(pe.status)!==ll&&(ol.status=ll),pe=await sr(A.workflow(pe.workflow_id),ol),je.value={...je.value,[pe.workflow_id]:De},Xe.value={...Xe.value,[pe.workflow_id]:pe},Rt.value={...Rt.value,[a]:[pe,...(Rt.value[a]??[]).filter(re=>re.workflow_id!==pe.workflow_id)]};const Po=De.find(re=>re.node_key==="quick_avatar"),rl=((Me=Lt.get("quick_avatar"))==null?void 0:Me[0])??(Po?Pd(Po,bt.value[Po.node_id]??[]):void 0);if(rl){const re=await sr(A.profile(a),{avatar_image_uri:rl.image_uri});Yt.value=Yt.value.map(le=>le.profile_id===a?re:le),Vn.value={...Vn.value,[a]:ea(rl)}}dn&&Wv(a,fn);const b=re=>re.id===e.id||re.profileId===a?{...re,quickCharacterWorkflowId:pe.workflow_id,status:dn?"快速角色已生成":Aa.length?`快速角色生成中 ${oa.length}/4`:`快速角色部分完成 ${oa.length}/4`,updatedAt:"刚刚"}:re;if(bn.value=bn.value.map(b),Sa.value=Sa.value.map(b),rl&&(ys.value=rl.image_id),dn)Za.value=`四个独立任务均已完成,共 ${un.length} 张角色图片已保存。`,jn.value="";else if(Aa.length)Za.value=`四个独立任务均已提交:已完成 ${oa.length} 个,仍在后端处理 ${Aa.length} 个。可以离开页面,稍后在队列查看。`,jn.value=la.length?`部分页面请求已超时或断开,但对应后端任务仍在运行:${la.join(";")}`:"";else{const re=la.join(";")||"部分节点没有返回可用图片";Za.value=`四个独立任务均已结束:成功 ${oa.length} 个,失败 ${Pn.length-oa.length} 个。成功结果已保留。`,jn.value=`快速角色部分生成失败:${re}`,D.value={...D.value,[a]:jn.value}}await Promise.allSettled([ga(),In(),Ma()])}catch(Oe){const pe=`快速角色生成失败:${ge(Oe)}`;if(s)try{const De=await be(A.workflow(s)),vt=await sr(A.workflow(s),{status:"failed",metadata:{...De.workflow.metadata??{},quick_character_batch_id:f,batch_started_at:d,identity_fields:T,model_route:Y,quick_character_failure:pe}});Xe.value={...Xe.value,[s]:vt}}catch{}Za.value="生成任务已停止,可前往队列查看失败记录并手动重试。",jn.value=pe,D.value={...D.value,[a]:pe}}finally{R.value={...R.value,[a]:""}}}function vb(e){return`quick-${tu(e)}-${Date.now().toString(36)}-${Math.random().toString(16).slice(2,10)}`}function tu(e){return e.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"profile"}function pb(){var r,s;const e=Et((r=ze.value)==null?void 0:r.config.model_assignments)?ze.value.config.model_assignments:void 0,a=Et((s=ze.value)==null?void 0:s.config.generation)?ze.value.config.generation:void 0;return se(e,"quick_generation")||se(a,"default_model")||ou()}function Jd(e){const a=e.profileId?Yt.value.find(r=>r.profile_id===e.profileId):void 0;return np({name:e.name,identity:e.identity,appearance:(a==null?void 0:a.appearance_prompt)||Nr(e),gender_presentation:e.genderPresentation,age_stage:e.ageStage,species:e.species,body_type:e.bodyType,distinctive_features:e.distinctiveFeatures,hair_color:e.hairColor,hairstyle:e.hairstyle,eye_color:e.eyeColor,clothing:e.clothing})}function mb(e,a,r=Jd(e),s=Fa.value.map(d=>d.prompt)){const d={quick_avatar:"square avatar, close-up portrait, clear face, stable hair and eye details",quick_bust:"half-body character reference, upper-body clothing, natural posture",quick_stand:"full-body standing character illustration, complete outfit, accurate body proportions",quick_sheet:"character design sheet, multiple views, outfit details, material callouts"},f=e.profileId?Yt.value.find(h=>h.profile_id===e.profileId):void 0;return["same single character in every image","preserve exact gender presentation, age, species, face identity, body type, hair, eyes and distinctive features",Object.entries(r).map(([h,T])=>`${h.replaceAll("_"," ")}: ${T}`).join(", "),f==null?void 0:f.base_prompt,f==null?void 0:f.appearance_prompt,e.name,e.identity,e.personality,Nr(e),e.style,d[a],...s].filter(Boolean).join(", ")}async function Xd(e){var d;const a=dt.value;if(!a||R.value[a.profile_id])return;const r=yt(e==="quick"?"生成快速角色":"创建详细工作流");if(r||((d=a.metadata)==null?void 0:d.source)==="sample"){D.value={...D.value,[a.profile_id]:r||"预览角色不能创建真实工作流。"};return}const s=fo.value.find(f=>f.id===a.profile_id||f.profileId===a.profile_id);if(!(s!=null&&s.profileId)){D.value={...D.value,[a.profile_id]:"当前角色还没有可用的后端档案标识。"};return}if(e==="quick"){await Av(s);return}pv(a.profile_id),R.value={...R.value,[a.profile_id]:e},D.value={...D.value,[a.profile_id]:""};try{const f=await uu(s,Qa);Zd(a.profile_id,"workflow"),Ye.value=qr(f.workflow,f.nodes)}catch(f){D.value={...D.value,[a.profile_id]:`详细工作流创建失败:${ge(f)}`}}finally{R.value[a.profile_id]===e&&(R.value={...R.value,[a.profile_id]:""})}}async function gb(){var d;const e=dt.value;if(!e)return;if(!e.detailed_workflow_state){Xd("detailed");return}if(R.value[e.profile_id])return;const a="detailed",r=Qa;let s=!1;R.value={...R.value,[e.profile_id]:a},D.value={...D.value,[e.profile_id]:""};try{let f=Rt.value[e.profile_id],p=f==null?void 0:f.find(h=>h.workflow_type===r&&Or(h));if(p||(f=await be(A.profileWorkflows(e.profile_id)),p=f.find(h=>h.workflow_type===r&&Or(h)),Rt.value={...Rt.value,[e.profile_id]:f}),!p)s=!0;else{let h=je.value[p.workflow_id];if(!h){const O=await be(A.workflow(p.workflow_id));p=O.workflow,h=O.nodes,Xe.value={...Xe.value,[p.workflow_id]:p},je.value={...je.value,[p.workflow_id]:h}}const T=fo.value.find(O=>O.id===e.profile_id||O.profileId===e.profile_id);T&&tr(T,p,h),Zd(e.profile_id,"workflow"),Ye.value=qr(p,h)}}catch(f){D.value={...D.value,[e.profile_id]:`工作流打开失败:${ge(f)}`}}finally{R.value[e.profile_id]===a&&(R.value={...R.value,[e.profile_id]:""})}s&&((d=dt.value)==null?void 0:d.profile_id)===e.profile_id&&Xd(a)}async function yb(){var r;const e=dt.value;if(!e||_s.value||((r=e.metadata)==null?void 0:r.source)==="sample")return;const a=yt("删除角色档案");if(a){D.value={...D.value,[e.profile_id]:a};return}if(window.confirm(`确认删除角色「${e.name}」?角色档案将从列表移除,已有图片仍保留在图库中。`)){_s.value=e.profile_id;try{await Oc(A.profile(e.profile_id));const s=new Set((Rt.value[e.profile_id]??[]).map(f=>f.workflow_id)),d=new Set([...s].flatMap(f=>(je.value[f]??[]).map(p=>p.node_id)));Yt.value=Yt.value.filter(f=>f.profile_id!==e.profile_id),Sa.value=Sa.value.filter(f=>f.profileId!==e.profile_id),bn.value=bn.value.filter(f=>f.profileId!==e.profile_id),Rt.value=au(Rt.value,e.profile_id),Vn.value=au(Vn.value,e.profile_id),R.value=au(R.value,e.profile_id),D.value=au(D.value,e.profile_id),Xe.value=Object.fromEntries(Object.entries(Xe.value).filter(([f])=>!s.has(f))),je.value=Object.fromEntries(Object.entries(je.value).filter(([f])=>!s.has(f))),bt.value=Object.fromEntries(Object.entries(bt.value).filter(([f])=>!d.has(f))),Yd(""),await Promise.allSettled([ga(),Ma()])}catch(s){D.value={...D.value,[e.profile_id]:`删除角色失败:${ge(s)}`}}finally{_s.value=""}}}function au(e,a){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==a))}function _b(e){var r;const a=(r=dt.value)==null?void 0:r.profile_id;a&&Zd(a,e)}function bb(e){if(e!=="workflow"){Z.value=!1,Q.value=!1,H.value=e;return}Z.value=!0,Q.value=!1,H.value="workflow";const a=Wt.value;Ye.value=a?qr(a,Xn.value):"brief-import"}async function wb(){const e=he.value;if(!e.profileId){Ql.value="请先保存角色档案,再开启详细工作流。";return}ui.value=!0,Ql.value="";try{const a=await uu(e,Qa);tr(e,a.workflow,a.nodes),Z.value=!0,Q.value=!0,H.value="workflow",Ye.value=qr(a.workflow,a.nodes)}catch(a){Ql.value=`详细工作流打开失败:${ge(a)}`}finally{ui.value=!1}}function Zd(e,a){const r=fo.value.find(s=>s.id===e||s.profileId===e);r&&nu(r),Z.value=a==="workflow",Q.value=a==="workflow",H.value=a,Mt("generate","generate")}function hb(){H.value="quickProfile",Mt("generate","generate"),Ht(Dr)}function kb(){H.value="quickProfile",Mt("generate","generate"),Ht(Yv)}function Cb(){Mt("materials","images")}function nu(e){Ps.value=e.id,yr.value="",Do.value="",Ql.value="",me.value="",bl.value={name:e.name,identity:e.identity,genderPresentation:e.genderPresentation,ageStage:e.ageStage,species:e.species,bodyType:e.bodyType,distinctiveFeatures:e.distinctiveFeatures,personality:e.personality,hairColor:e.hairColor,hairstyle:e.hairstyle,eyeColor:e.eyeColor,clothing:e.clothing,style:e.style,negative:e.negative},Un.value={},Bo.value="";const a=so.value.find(r=>r.id===e.materialId);if(a&&(Un.value={...Un.value,[a.category]:a.id},Bo.value=a.id),e.profileId&&(e.workflowId||e.quickCharacterWorkflowId))Dv(e);else if(e.profileId){const r=Yt.value.find(s=>s.profile_id===e.profileId);r&&fv(r)}}function Ev(e){Yo.value.some(a=>a.id===e)&&(_l.value=e)}function ft(e){return se(e.metadata,"candidate_id")||e.image_id}function $b(){Fn.value="",Ia.value=[],Ct.value="",qa.value={},Lo.value=!1}function al(e){var p;const a=Cl.value.find(h=>h.id===e);if(!a)return;Ye.value=a.id,$b(),xl(a.id)&&(gt.value="");const r=Xn.value.find(h=>xn(h)===a.id),d=((p=a.imageIds)!=null&&p.length?a.imageIds:[a.imageId]).filter(h=>Bd.value.some(T=>T.image_id===h)),f=r==null?void 0:r.selected_image_id;Be((r==null?void 0:r.status)??"")==="selected"&&f&&d.includes(f)&&(Ct.value=f)}function Tv(e){if(rn.value.some(a=>ft(a)===e)){if(Pl.value){me.value=Ra.value?$l.value:`${go.value} 已确认采用的节点不能更换选图。`;return}Fn.value=e,Ia.value=Ia.value.includes(e)?Ia.value.filter(a=>a!==e):[...Ia.value,e]}}function Pb(e){rn.value.some(a=>ft(a)===e)&&(Fn.value=e)}function Ib(e){var r,s;const a=(s=(r=mo.value.find(d=>d.candidate_id===e))==null?void 0:r.image)==null?void 0:s.image_id;a&&du(a)}function Sb(e){const a=Ct.value;if(e)Nv(e);else{if(Pl.value)return;Ct.value=""}Ct.value!==a&&xb(a)}async function xb(e){const a=Ve.value;if(!a||a.legacy||a.read_only)return;const r=Ct.value;fi.value=r||e,Je.value="";try{const s=await ke(A.roundFeedback(a.round.round_id),{updates:[],draft_final_candidate_id:r||null,idempotency_key:`web-round-draft-final-${a.round.round_id}-${r||"clear"}-${Date.now()}`});wo(a.round.node_id,s)}catch(s){Ct.value=e,Je.value=`待定稿候选保存失败:${ge(s)}`}finally{fi.value=""}}function Nv(e){if(!rn.value.some(s=>ft(s)===e))return;if(Pl.value){me.value=Ra.value?$l.value:`${go.value} 已确认采用的节点不能更换选图。`;return}const a=mo.value.find(s=>s.candidate_id===e);if(a&&!Ai(a)){Je.value="只有生成成功并返回图片的候选才能定稿。";return}const r=Ri(e);if(["rejected","strict_rejected"].includes(r)){Je.value="已拒绝的候选不能定稿;请先取消拒绝反馈。";return}Ct.value=Ct.value===e?"":e,Fn.value=e}async function lu(e,a,r){var T;if(!rn.value.some(O=>ft(O)===e)||Pl.value)return;const s=(T=qa.value[e])==null?void 0:T.kind,d=s===a?"neutral":a;if(d==="liked"&&s!=="liked"&&Jy.value){Je.value="同一轮最多保留 3 个喜欢候选;请先取消一个已喜欢候选。";return}const f=qa.value;qa.value={...f,[e]:{kind:d,note:r}};const p=Ve.value;if(!(!p||p.legacy||!p.candidates.find(O=>O.candidate_id===e))){fi.value=e,Je.value="";try{const O={updates:[{candidate_id:e,preference_status:d,...r!=null&&r.trim()?{reason:r.trim()}:{}}]},Y=await ke(A.roundFeedback(p.round.round_id),O);wo(p.round.node_id,Y)}catch(O){qa.value=f,Je.value=`候选反馈保存失败:${ge(O)}`}finally{fi.value=""}}}function Ri(e){var a;return((a=qa.value[e])==null?void 0:a.kind)??"neutral"}async function Rb(){const e=he.value,a=Ve.value,r=Ct.value;if(!(e!=null&&e.workflowId)||!a||!r||vi.value)return!1;if(Vs.value)return Je.value="该节点已经确认;如需改选,请先从当前节点创建分支。",!1;const s=a.candidates.filter(d=>d.candidate_id===r);if(!zf.value||s.length!==1||!Ai(s[0]))return Je.value="最终确认必须严格选择一张生成成功的候选。",!1;vi.value=r,Je.value="";try{const d=await ke(A.roundConfirm(a.round.round_id),{candidate_id:r,idempotency_key:`web-round-confirm-${a.round.round_id}-${r}`});wo(a.round.node_id,d),hn.value=`已确认 ${s[0].display_code}`,me.value=`${s[0].display_code} 已确认为本节点最终候选。`;const f=se(d.next_node??void 0,"node_key");return await vu(e,e.workflowId,f?Bc(f):void 0),!0}catch(d){return Je.value=`最终确认失败:${ge(d)}`,me.value=Je.value,!1}finally{vi.value=""}}async function ec(){var r;const e=te.value.trim();if(!e||Ja.value)return;if(!xr.value){Dn.value="请先在设置中配置并确认一个生图模型。";return}const a=yt("图片生成");if(a){Dn.value=a;return}Ja.value=!0,Dn.value="",Fe.value=e,at.value=((r=xr.value)==null?void 0:r.label)??jt.value;try{const s=await Mb(),d=await ke(A.nodeGenerate(s.nodeId),{prompt_patch:e,prompt_processing_mode:ye.value,translation_consent:ye.value==="llm",model_route:ou(),count:1,aspect_ratio:"1:1",idempotency_key:`web-single-${Date.now()}-${Math.random().toString(16).slice(2)}`,metadata:{source:"standalone_web",workflow_id:s.workflowId}}),f=await ac(d.images??[]);f[0]&&(U.value=f[0].image_id),te.value="",await Promise.allSettled([ga(),In(),Ma()])}catch(s){Dn.value=`生成失败:${ge(s)}`}finally{Ja.value=!1}}async function Mb(){if(Qt.value)return Qt.value;const e=await be(A.profiles,{keyword:Fc,page:1,page_size:10});let a=e.items.find(p=>{var h;return((h=p.metadata)==null?void 0:h.system_key)===qi})??e.items.find(p=>p.name===Fc);a||(a=await ke(A.profiles,{name:Fc,description:"System profile used by the standalone image generation workspace.",default_model_route:ou(),metadata:{source:"standalone_web",system_key:qi}}));let s=(await be(A.profileWorkflows(a.profile_id))).find(p=>p.workflow_type==="single_image"),d=[];if(s)d=await be(A.workflowNodes(s.workflow_id));else{const p=await ke(A.profileWorkflows(a.profile_id),{workflow_type:"single_image",display_name:"ImageStudio Single Image Flow",status:"draft",metadata:{source:"standalone_web",system_key:qi}});s=p.workflow,d=p.nodes}const f=d.find(p=>p.node_key==="virtual_single_image")??d[0];if(!f)throw new Error("单图工作流缺少可生成节点");return Qt.value={profileId:a.profile_id,workflowId:s.workflow_id,nodeId:f.node_id},Qt.value}function tc(e){if(!e)return"";if(e.routeName)return e.routeName;const a=Vl.value.find(s=>`${s.provider_id}/${s.model_id}`===e.value),r=se(a==null?void 0:a.capabilities,"route_name")||se(a==null?void 0:a.probe_result,"route_name")||se(a==null?void 0:a.capabilities,"model_route");return r||(e.status==="fallback"?"":e.value)}function ou(){return tc(xr.value)}function ru(e){const a=e.trim();if(!a)return"";const r=No.value.find(d=>d.route===a);if(r)return`${r.name||r.provider_id} / ${r.model||r.provider_id}`;const s=io.value.find(d=>d.value===a||tc(d)===a);return s?`${s.provider} / ${s.label}`:a}function Ab(e){var d;const a=(d=Ae.value)==null?void 0:d.node_id;if(!a)return;const r=e.trim(),s={...od.value};r?s[a]=r:delete s[a],od.value=s}async function ac(e){var s;const a=await Promise.all(e.map(async d=>{try{return await be(A.image(d.image_id))}catch{return d}})),r=a.filter(Va);if(a.length&&!r.length){const d=a[0];throw new sa("provider_fallback_rejected","图像提供方生成失败;后端返回的 mock/降级占位图已被拒绝。",{image_id:d.image_id,provider_error:(s=d.metadata)==null?void 0:s.provider_error})}return r.map(Ti)}function Lv(e,a){const r=Na(a,d=>d.branch_name);if(r.some(d=>d.branch_name==="main"))return r;const s=Xe.value[e];return[{branch_id:"branch_virtual_main",workflow_id:e,branch_name:"main",base_branch_name:null,base_node_id:null,status:(s==null?void 0:s.current_branch)==="main"?"active":"available",metadata:{},created_at:(s==null?void 0:s.created_at)??"",updated_at:(s==null?void 0:s.updated_at)??""},...r]}async function Br(e){if(!e)return[];bs.value=e,Oa.value="";try{const a=Lv(e,await be(A.workflowBranches(e)));return Jl.value={...Jl.value,[e]:a},a}catch(a){return Oa.value=`分支列表加载失败:${ge(a)}`,Jl.value[e]??[]}finally{bs.value===e&&(bs.value="")}}async function nc(e,a=!1){var s;if(!e)return null;const r=ws.value[e];if(r&&!a)return r;hs.value=e,di.value="";try{const d=await be(A.nodeDependencyContext(e));return ws.value={...ws.value,[e]:d},d}catch(d){return((s=Ae.value)==null?void 0:s.node_id)===e&&(di.value=`依赖上下文加载失败:${ge(d)}`),null}finally{hs.value===e&&(hs.value="")}}function Mi(e){return ee.has(Be(e))}function Ai(e){return j.has(Be(e.candidate.generation_status))}function Eb(e){return{planned:"已规划",queued:"排队中",running:"生成中",succeeded:"已成功",success:"已成功",completed:"已成功",failed:"失败",cancelled:"已取消"}[Be(e)]||e||"未知"}function iu(e,a){var f;a&&(Fn.value="",Ia.value=[],Lo.value=!1),qa.value=Object.fromEntries(e.candidates.flatMap(p=>{const h=Be(p.preference_status);return["liked","rejected","strict_rejected"].includes(h)?[[p.candidate_id,{kind:h,note:p.preference_reason||void 0}]]:[]}));const r=((f=e.candidates.find(p=>p.is_final))==null?void 0:f.candidate_id)??"",s=se(e.round.feedback_snapshot,"draft_final_candidate_id"),d=r||(e.candidates.some(p=>p.candidate_id===s)?s:"");Ct.value=d}function wo(e,a,r={}){var h;const s=Hn.value[e]??[],d=[a,...s.filter(T=>T.round.round_id!==a.round.round_id)].sort((T,O)=>O.round.round_number-T.round.round_number),f=wn.value[e],p=r.select||!f?a.round.round_id:f;Hn.value={...Hn.value,[e]:d},wn.value={...wn.value,[e]:p},((h=Ae.value)==null?void 0:h.node_id)===e&&p===a.round.round_id&&iu(a,f!==p)}function Bv(){jo!==void 0&&(window.clearTimeout(jo),jo=void 0)}function Zo(e=Ve.value){if(Bv(),!e||!Mi(e.round.status)||document.hidden)return;const a=e.round.round_id;jo=window.setTimeout(()=>{var r;jo=void 0,((r=Ve.value)==null?void 0:r.round.round_id)===a&&su(a,!0)},4e3)}async function su(e,a=!1){if(!e||br.value===e)return null;br.value=e,a||(Je.value="");try{const r=await be(A.round(e));return wo(r.round.node_id,r),Zo(r),r}catch(r){return a||(Je.value=`轮次加载失败:${ge(r)}`),a&&Zo(Ve.value),null}finally{br.value===e&&(br.value="")}}async function lc(e,a=!1){var r,s,d,f,p;if(!e)return[];if(!a&&Hn.value[e]){const h=Hn.value[e],T=wn.value[e],O=h.find(Y=>Y.round.round_id===T)??h[0]??null;return((r=Ae.value)==null?void 0:r.node_id)===e&&O&&iu(O,!0),Zo(O),h}ci.value=e,Je.value="";try{const T=(await be(A.nodeRounds(e),{include_legacy:!0})).items??[],O=wn.value[e],Y=se((s=Ae.value)==null?void 0:s.metadata,"active_round_id"),J=(O&&T.some(Me=>Me.round.round_id===O)?O:"")||(Y&&T.some(Me=>Me.round.round_id===Y)?Y:"")||((d=T[0])==null?void 0:d.round.round_id)||"";Hn.value={...Hn.value,[e]:T},wn.value={...wn.value,[e]:J};const Le=T.find(Me=>Me.round.round_id===J)??null;return((f=Ae.value)==null?void 0:f.node_id)===e&&Le&&iu(Le,O!==J),Zo(Le),T}catch(h){return((p=Ae.value)==null?void 0:p.node_id)===e&&(Je.value=`轮次列表加载失败:${ge(h)}`),Hn.value[e]??[]}finally{ci.value===e&&(ci.value="")}}function Tb(e){var d;const a=(d=Ae.value)==null?void 0:d.node_id;if(!a)return;const r=(Hn.value[a]??[]).find(f=>f.round.round_id===e);if(!r)return;const s=wn.value[a];wn.value={...wn.value,[a]:e},iu(r,s!==e),Zo(r),Mi(r.round.status)&&su(e)}function Nb(){const e=Wt.value,a=Ae.value;if(!e||!a)return null;const r=Ve.value;return{workflow_id:e.workflow_id,branch_name:a.branch_name||e.current_branch||"main",node_id:a.node_id,round_id:r&&!r.legacy?r.round.round_id:null,return_view:"generate"}}async function qv(){var s;const e=Ae.value,a=Nb();if(!e||!a||!Ft.value)return Jt.value="当前节点不是可绑定素材的详细角色图像节点。",null;const r=e.node_id;Cs.value=!0,Jt.value="";try{const d=await be(A.nodeMaterialBindings(r),{workflow_id:a.workflow_id,branch_name:a.branch_name,node_id:a.node_id,round_id:a.round_id||void 0,return_view:a.return_view});return((s=Ae.value)==null?void 0:s.node_id)!==r?null:(Cn.value=d,d)}catch(d){return Jt.value=`节点素材加载失败:${ge(d)}`,null}finally{Cs.value=!1}}async function Lb(){if(Jt.value="",Uo.value="",Cn.value=null,ks.value=!0,G.value.state!=="connected"){Jt.value="后端尚未连接,当前无法读取节点素材。";return}await Promise.allSettled([qv(),Ka()]),wt.value&&!Jt.value&&(Jt.value=`素材库加载失败:${wt.value}`)}function Bb(){Cs.value||$s.value||kt.value||(ks.value=!1,Jt.value="",Uo.value="",wl.value="",Xl.value=[])}async function qb(){Uo.value="",await Promise.allSettled([qv(),Ka()]),wt.value&&!Jt.value&&(Jt.value=`素材库加载失败:${wt.value}`)}async function Ov(e,a=(r=>(r=Ae.value)==null?void 0:r.node_id)()||""){const s=Cn.value;if(!a||!s||s.node_id!==a)return Jt.value="节点素材上下文已经变化,请重新打开抽屉后再保存。",!1;if(!Ad.value)return Jt.value=Ed.value,!1;const d={selected_material_ids:Array.from(new Set(e.map(f=>f.trim()).filter(Boolean))),navigation_context:s.navigation_context};$s.value=!0,Jt.value="",Uo.value="";try{const f=await sr(A.nodeMaterialBindings(a),d);return Cn.value=f,Uo.value=`已保存 ${f.material_bindings.selected_material_ids.length} 项当前节点素材覆盖。历史轮次快照未变更。`,await nc(a,!0),!0}catch(f){return Jt.value=`节点素材保存失败:${ge(f)}`,!1}finally{$s.value=!1}}function Ob(e){var r,s;const a=((r=Ae.value)==null?void 0:r.node_id)||"";if(!a||!Ad.value){Jt.value=Ed.value||"当前节点素材不可修改。";return}if(!((s=de.value)!=null&&s.permissions.can_manage_materials)){Jt.value="上传并确认新素材需要素材管理权限;仍可选择已有的已确认素材。";return}Xl.value=Array.from(new Set(e.map(d=>d.trim()).filter(Boolean))),bo("upload-image",{workflowTargetNodeId:a})}async function Db(){ks.value=!1,wl.value="",Xl.value=[],await Zv()}async function Wb(e){wr.value=e;const a=_n.value.trim();Jf.value&&a&&await Uv(a)!=="saved"||await fu()}function Fb(e){const a=mo.value.find(r=>r.candidate_id===e);a&&(Je.value=`${a.display_code} 未生成成功。当前稳定接口按轮次重试;请保留需要的反馈后点击“开始新一轮”。`)}async function Dv(e){if(!e.profileId)return;const a=Array.from(new Set([e.workflowId,e.quickCharacterWorkflowId].filter(s=>!!s)));if(!a.length)return;const r=a.filter(s=>{var d;return!((d=je.value[s])!=null&&d.length)});if(!r.length){e.workflowId&&await Br(e.workflowId);return}ui.value=!0,Ql.value="";try{const s=await Promise.all(r.map(f=>be(A.workflow(f))));je.value={...je.value,...Object.fromEntries(s.map(f=>[f.workflow.workflow_id,f.nodes]))},Xe.value={...Xe.value,...Object.fromEntries(s.map(f=>[f.workflow.workflow_id,f.workflow]))},await Promise.all([er(s.flatMap(f=>f.nodes)),e.workflowId?Br(e.workflowId):Promise.resolve([])]);const d=s.find(f=>f.workflow.workflow_type===Qa);d&&tr(e,d.workflow,d.nodes)}catch(s){Ql.value=`工作流加载失败:${ge(s)}`}finally{ui.value=!1}}async function uu(e,a=Qa,r={}){if(!e.profileId)throw new Error("角色卡还没有后端 profile_id");const s=r.forceNew?`${e.profileId}:${a}:${r.workflowId||se(r.metadata,"quick_character_batch_id")}`:`${e.profileId}:${a}`,d=pa.get(s);if(d)return d;const f=Ub(e,a,r);pa.set(s,f);try{return await f}finally{pa.get(s)===f&&pa.delete(s)}}async function Ub(e,a,r={}){if(!e.profileId)throw new Error("角色卡还没有后端 profile_id");const s=await be(A.profileWorkflows(e.profileId));let d=s,f=r.forceNew?void 0:s.find(h=>h.workflow_id===e.workflowId&&h.workflow_type===a&&Or(h))??s.find(h=>h.workflow_type===a&&Or(h)),p=[];if(f){const h=await be(A.workflow(f.workflow_id));f=h.workflow,p=h.nodes}else{pv(e.profileId);try{const h=await ke(A.profileWorkflows(e.profileId),{workflow_id:r.workflowId||jb(e.profileId,a,s),workflow_type:a,display_name:`${e.name} ${a===fn?"快速角色":"详细角色工作流"}`,status:"draft",metadata:{source:"standalone_web",generation_kind:a===fn?"quick":"detailed",quick_profile_workflow_id:e.quickProfileWorkflowId,...r.metadata??{}}});f=h.workflow,p=h.nodes}catch(h){if(r.forceNew)throw h;const T=await be(A.profileWorkflows(e.profileId));d=T;const O=T.find(J=>J.workflow_type===a&&Or(J));if(!O)throw h;const Y=await be(A.workflow(O.workflow_id));if(!Vb(Y.nodes,a))throw h;f=Y.workflow,p=Y.nodes}}if(a===fn&&(p=await Kb(f.workflow_id,p)),je.value={...je.value,[f.workflow_id]:p},Xe.value={...Xe.value,[f.workflow_id]:f},Rt.value={...Rt.value,[e.profileId]:[f,...d.filter(h=>h.workflow_id!==f.workflow_id)]},await Promise.all([er(p),a===Qa?Br(f.workflow_id):Promise.resolve([])]),a===Qa)tr(e,f,p);else{const h=T=>T.id===e.id||T.profileId===e.profileId?{...T,quickCharacterWorkflowId:f.workflow_id,status:"快速角色已准备"}:T;bn.value=bn.value.map(h),Sa.value=Sa.value.map(h)}return a===Qa&&Wv(e.profileId,a),{workflow:f,nodes:p}}async function Kb(e,a){const r=[...a];for(const s of Pn){if(r.some(f=>f.node_key===s.nodeKey))continue;const d=await ke(A.workflowNodes(e),{node_key:s.nodeKey,title:s.title,description:s.detail,step_name:s.nodeKey,node_type:"generation",status:"draft",branch_name:"main",sort_order:s.sortOrder,metadata:{template:"character_fast_v2",quick_character_target:s.nodeKey}});r.push(d)}return r.sort((s,d)=>s.sort_order-d.sort_order)}function Vb(e,a){const r=new Set(e.map(s=>xo(s.node_key)));return a===fn?Pn.every(s=>r.has(s.nodeKey)):["profile_brief","prompt_plan","material_bind","profile_card"].every(s=>r.has(s))}function jb(e,a,r){const s=r.filter(d=>d.workflow_type===a).length+1;return`workflow_${e}_${a}_${s}`}function Wv(e,a){const r=a===fn?"quick":"detailed";Yt.value=Yt.value.map(s=>s.profile_id!==e?s:{...s,generation_kind:s.generation_kind==="detailed"?"detailed":r})}async function er(e){const a=await Promise.all(e.map(async r=>{try{const s=await be(A.nodeImages(r.node_id));if(r.selected_image_id&&!s.some(d=>d.image_id===r.selected_image_id))try{s.unshift(await be(A.image(r.selected_image_id)))}catch{}return[r.node_id,ko(s.filter(Va).map(Ti))]}catch{return[r.node_id,bt.value[r.node_id]??[]]}}));bt.value={...bt.value,...Object.fromEntries(a)}}function tr(e,a,r){const s=d=>d.id!==e.id&&d.profileId!==e.profileId?d:{...d,workflowId:a.workflow_id,workflowNodeIds:r.map(f=>f.node_id),status:a.status==="completed"?"工作流已拆解":"工作流就绪"};bn.value=bn.value.map(s),Sa.value=Sa.value.map(s)}function oc(e){return e.workflow_type==="character_gradual"||e.workflow_type==="character_fast"}function rc(e){var r;if(!e||e.workflow_type!==Qa)return!1;const a=(r=e.metadata)==null?void 0:r.character_execution;return!Et(a)||a.import_confirmed===!1?!1:a.import_confirmed===!0||a.executor==="character_workflow"}function qr(e,a){if(!rc(e))return"brief-import";const r=a.filter(f=>f.branch_name===e.current_branch).sort((f,p)=>f.sort_order-p.sort_order),s=r.find(f=>!["completed","selected","skipped"].includes(Be(f.status))),d=r.at(-1);return s||d?xn(s??d):"brief-import"}function Fv(e){return[...e].filter(a=>a.workflow_type===fn&&!["archived","cancelled"].includes(Be(a.status))).sort((a,r)=>{const s=se(a.metadata,"batch_started_at")||a.created_at,d=se(r.metadata,"batch_started_at")||r.created_at;return Rn(d)-Rn(s)})[0]}function Or(e){const a=Be(e.status);return!oc(e)||["cancelled","archived"].includes(a)?!1:e.workflow_type!==fn||a!=="completed"}function ic(e){const a=qe.value,r=he.value,s=$i.value.flatMap(p=>p.fields.filter(h=>h.value&&h.value!=="待补充").map(h=>`${p.title}/${h.label}: ${h.value}`)).slice(0,18),d=Fa.value.map(p=>`${p.label}: ${p.prompt}`),f=Ua.value.filter(Va).map(p=>`${ya(p)} / ${p.status}`);return["[ImageStudio node-aware workflow injection]","Task: understand the user's source-language instruction, translate it into concise English image-generation prompt language, then merge it into the selected workflow node.","Keep character names, locked identity traits, and explicit user constraints. Do not drop negative constraints.","Target prompt language: English","Source language: auto-detect",`User instruction: ${e}`,`Node: ${a.title}`,`Node phase: ${a.phase}`,`Node status: ${nr(a.status)}`,`Node existing prompt: ${a.prompt||"-"}`,`Node locked items: ${a.lockedItems||"-"}`,`Node decision: ${a.decision||"-"}`,`Character: ${r.name}`,`Identity: ${r.identity}`,`Personality: ${r.personality}`,`Appearance: ${Nr(r)}`,`Style: ${r.style||"-"}`,`Negative prompt: ${r.negative||"-"}`,`Structured persona fields: ${s.length?s.join(" | "):"-"}`,`Selected materials: ${d.length?d.join(" | "):"-"}`,`Selected drafts: ${f.length?f.join(" | "):"-"}`].join(`
|
||
`)}function sc(e){const a=qe.value,r=he.value;return{source:"standalone_web_workflow_chat",ui_node_id:Ye.value,ui_node_title:a.title,ui_node_phase:a.phase,ui_node_status:a.status,profile_id:r.profileId,profile_name:r.name,workflow_id:r.workflowId,source_language:"auto",target_prompt_language:"en",translation_mode:"backend_llm",user_instruction:e,persona_split_fields_ready:Hs.value,persona_split_fields_total:Gs.value,selected_material_ids:Qd(),selected_draft_image_ids:Ua.value.filter(Va).map(s=>s.image_id),candidate_feedback:qa.value}}function Gb(e){var d;const a=e.interpretation;if(!a)return"候选反馈已保存。";const r=[],s=[["喜欢",a.liked],["拒绝",a.rejected],["严格拒绝",a.strict_rejected]];for(const[f,p]of s)p.length&&r.push(`${f} ${p.map(h=>h.display_code).join("、")}`);return(d=a.final)!=null&&d.display_code&&r.push(`待定稿 ${a.final.display_code}`),a.positive_patch&&r.push("已生成正向调整"),a.negative_patch&&r.push("已生成负向约束"),a.material_intent&&r.push(`素材意图:${a.material_intent}`),r.length?r.join(";"):"下一轮调整要求已保存。"}async function Uv(e){var r,s,d;const a=Ve.value;if(!Ft.value||!a||a.legacy||!a.candidates.length)return"not_applicable";if(Vs.value)return Je.value="该轮次已经确认;如需继续修改,请先从当前节点创建分支。","blocked";Re.value=!0,Je.value="",hn.value="";try{const f=await ke(A.roundFeedback(a.round.round_id),{feedback_text:e,idempotency_key:`web-round-feedback-text-${a.round.round_id}-${Date.now()}`});wo(a.round.node_id,f);const p=Gb(f);return hn.value=`${p} 点击“开始新一轮”后会使用这些反馈。`,me.value=p,ed.value=e,td.value=(s=(r=f.interpretation)==null?void 0:r.metadata)!=null&&s.model_route?`候选反馈 / ${String(f.interpretation.metadata.model_route)}`:`候选反馈 / ${((d=f.interpretation)==null?void 0:d.source)||"确定性解释"}`,_n.value="","saved"}catch(f){return Je.value=`候选反馈理解失败:${ge(f)}`,me.value=Je.value,"failed"}finally{Re.value=!1}}async function Hb(){const e=_n.value.trim();if(!e||Re.value||await Uv(e)!=="not_applicable")return;if(Ft.value&&!po.value.route){me.value="当前节点和后端默认均未提供生图路由,请先显式覆盖或前往设置配置。";return}await fu({promptPatch:ic(e),metadata:sc(e)})&&(ed.value=e,td.value=`${qe.value.title} / ${xd.value||"后端自动"}`)}function Kv(){!aa.value||!ea(aa.value)||(Ms.value="generation",ja("imageViewer"),dc(),to.value=!0)}function du(e){const a=(e?Bd.value.find(r=>r.image_id===e):null)??el.value;!a||!ea(a)||(Lo.value=!1,U.value=a.image_id,Kv())}function Vv(){Ua.value.length<2||(Lo.value=!0)}function zb(e){return{configure_distinct_generation_cross_review_routes:"请在设置页配置至少一个与主候选不同的生图模型",configure_image_generation_route:"请先配置并启用可用的生图模型路由",regenerate_primary_candidate_with_configured_route:"主候选缺少可复用的模型路由,请先重新生成主候选",retry_or_remove_failed_review_candidate:"当前审查轮次存在失败候选,请重试失败项后再继续",select_review_candidates:"请至少勾选一个需要重新生成的审查候选",open_active_cross_review:"该节点已有进行中的交叉审查,请打开当前审查轮次",create_branch:"当前节点已锁定或工作流已封存,请先创建可编辑分支"}[e]||e.replace(/_/g," ")}function cu(e,a){const r=ge(e),s=e instanceof sa?se(e.details,"required_action"):"";return s?`${r};建议操作:${zb(s)}。`:`${a}:${r}`}async function Qb(){var r;const e=Ve.value;if(!e||e.legacy||!Ft.value)return;const a=e.round.round_id;ma.value=!0,zn.value="";try{const s=await be(A.round(a));if(((r=Ve.value)==null?void 0:r.round.round_id)!==a)return;wo(s.round.node_id,s,{select:!0}),kn.value=s,Fo.value=!0}catch(s){Je.value=cu(s,"交叉审查轮次加载失败")}finally{ma.value=!1}}function Yb(){ma.value||(Fo.value=!1,zn.value="")}function Jb(e){var r;const a=(r=e.image)==null?void 0:r.image_id;a&&du(a)}function uc(e){wo(e.round.node_id,e,{select:!0}),kn.value=e,Zo(e)}async function jv(e){var d;const a=he.value,r=e.round.workflow_id||(a==null?void 0:a.workflowId);if(await lc(e.round.node_id,!0),!a||!r)return;const s=se(e.next_node??void 0,"node_key");if(await vu(a,r,s?Bc(s):void 0),!s&&((d=e.approval)!=null&&d.restoration_node_id)){const f=ar(r).find(p=>{var h;return p.node_id===((h=e.approval)==null?void 0:h.restoration_node_id)});f&&al(xn(f))}}async function Xb(e){const a=kn.value;if(!(!a||ma.value||js.value)){ma.value=!0,zn.value="";try{const r=await ke(A.roundGenerationCrossReview(a.round.round_id),{...e,idempotency_key:e.idempotency_key||`web-generation-cross-review-${e.decision}-${a.round.round_id}-${e.candidate_id}`});if(uc(r),e.decision==="review"){hn.value=`${r.round.display_code} 已加入生成式交叉审查队列。`;return}hn.value="已跳过生成式交叉审查并确认采用该候选。",Fo.value=!1,await jv(r)}catch(r){zn.value=cu(r,"交叉审查提交失败")}finally{ma.value=!1}}}async function Zb(e){const a=kn.value;if(!(!a||ma.value||js.value)){ma.value=!0,zn.value="";try{const r=await ke(A.roundGenerationCrossReviewRegenerate(a.round.round_id),{...e,idempotency_key:e.idempotency_key||`web-generation-cross-review-regenerate-${a.round.round_id}-${e.candidate_ids.slice().sort().join("-")}`});uc(r),hn.value=`${r.round.display_code} 已入队,仅重新生成所选候选。`}catch(r){zn.value=cu(r,"交叉审查重生成失败")}finally{ma.value=!1}}}async function ew(e){const a=kn.value;if(!(!a||ma.value||js.value)){ma.value=!0,zn.value="";try{const r=await ke(A.roundGenerationCrossReviewApprove(a.round.round_id),{...e,idempotency_key:e.idempotency_key||`web-generation-cross-review-approve-${a.round.round_id}-${e.candidate_id}`});uc(r),hn.value="交叉审查候选已明确采用,并已交接到高清修复(XF)节点。",Fo.value=!1,await jv(r)}catch(r){zn.value=cu(r,"交叉审查采用失败")}finally{ma.value=!1}}}function Gv(e){var a;e&&Ev(e),(a=Zt.value)!=null&&a.imageUrl&&(Ms.value="quickProfile",ja("imageViewer"),dc(),to.value=!0)}function Hv(){to.value=!1,Ko.value=!1}function dc(){hl.value=1,ao.value={x:0,y:0}}function tw(e){hl.value=Sh(Number((hl.value+e).toFixed(2)),.5,4),hl.value<=1&&(ao.value={x:0,y:0})}function aw(e){tw(e.deltaY<0?.12:-.12)}function nw(){if(hl.value>1){dc();return}hl.value=2.2,ao.value={x:0,y:0}}function lw(e){hl.value<=1||(Ko.value=!0,Vo.value={pointerId:e.pointerId,x:e.clientX,y:e.clientY,offsetX:ao.value.x,offsetY:ao.value.y},e.currentTarget instanceof HTMLElement&&e.currentTarget.setPointerCapture(e.pointerId))}function ow(e){!Ko.value||e.pointerId!==Vo.value.pointerId||(ao.value={x:Vo.value.offsetX+e.clientX-Vo.value.x,y:Vo.value.offsetY+e.clientY-Vo.value.y})}function cc(e){!Ko.value||e.pointerId!==Vo.value.pointerId||(Ko.value=!1,e.currentTarget instanceof HTMLElement&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))}function zv(){ja("search"),id.value=!0,hr.value=!0,tn.value=0}function Qv(e){if(!Xo.value.length)return;const a=Xo.value.length;tn.value=(tn.value+e+a)%a}function rw(){const e=Xo.value[tn.value];e&&yv(e)}function Dr(){ja("personaQuestionnaire"),ii.value="",vs.value=!0}function Yv(){ja("externalProfileImport"),qo.value="",gs.value="",ms.value=!0,Ht(()=>{var e;(e=document.querySelector("[data-profile-import-input]"))==null||e.focus()})}function iw(){ja("quickProfileDetail"),ps.value=!0}function sw(e){yl.value=e,ja("materialDetail"),us.value=!0}async function uw(e){if(e.enabled){if(e.actionKey==="personaQuestionnaire"){Dr();return}if(e.actionKey==="workflowCompare"){Vv();return}if(e.actionKey==="externalProfileImport"){Yv();return}if(e.actionKey==="workflowPersonaSplit"){await _w();return}if(e.actionKey==="workflowSaveVersion"){await Mw();return}if(e.actionKey==="workflowCreateBranchFromNode"){await Zv();return}if(e.actionKey==="workflowNodeGenerate"){e.id==="hires"&&Ye.value!=="hires-fix"&&(al("hires-fix"),await Ht()),await fu();return}if(e.actionKey==="workflowNodeRetry"){await fu({retry:!0});return}if(e.actionKey==="workflowNodeComplete"){await bw();return}if(e.actionKey==="workflowNodeReview"){await $w();return}if(e.actionKey==="workflowReviewAdopt"){await Sw();return}if(e.actionKey==="workflowPromptPlanSave"){await ww();return}if(e.actionKey==="workflowPromptPlanComplete"){await kw();return}if(e.actionKey==="workflowPromptPlanNext"){al("prompt-plan");return}if(e.actionKey==="workflowMaterialBindSave"){await hw();return}if(e.actionKey==="workflowMaterialBindComplete"){await Cw();return}if(e.actionKey==="workflowArchiveFinal"){await vw();return}e.nav&&e.module&&Mt(e.nav,e.module)}}function dw(e){const a=e.profileId?Yt.value.find(s=>s.profile_id===e.profileId):void 0;return[["角色名",(a==null?void 0:a.name)||e.name],["身份定位",e.identity],["性格",e.personality],["性别表现",e.genderPresentation],["年龄阶段",e.ageStage],["物种/种族",e.species],["体型",e.bodyType],["显著特征",e.distinctiveFeatures],["基础设定",(a==null?void 0:a.base_prompt)||""],["外观",(a==null?void 0:a.appearance_prompt)||Nr(e)],["发色",e.hairColor],["发型",e.hairstyle],["瞳色",e.eyeColor],["服装",e.clothing],["风格",(a==null?void 0:a.style_prompt)||e.style],["规避项",(a==null?void 0:a.negative_prompt)||e.negative]].filter(s=>{var d;return!!((d=s[1])!=null&&d.trim())}).map(([s,d])=>`## ${s}
|
||
${d.trim()}`).join(`
|
||
|
||
`)}function cw(e){const a=ar(e),r=(...f)=>{for(const p of f){const h=a.find(T=>xo(T.node_key)===p);if(h!=null&&h.selected_image_id)return h.selected_image_id}return""},s={avatar:r("headshot"),persona_image:r("design_sheet","turnaround"),standing:r("full_body"),pv:r("style_lock")},d=Object.entries(s).filter(([,f])=>!f).map(([f])=>f);if(d.length){const f={avatar:"头像(头像草稿)",persona_image:"人设图(设定图或三视图)",standing:"立绘(全身设定)",pv:"PV 图(高清修复与统一风格)"};return me.value=`档案卡还缺少已明确采用的资产:${d.map(p=>f[p]).join("、")}。请回到对应节点确认一张候选图。`,null}return s}function fw(e){if(!(e instanceof sa))return`档案卡封存失败:${ge(e)}`;const a=[],r=e.details.incomplete_node_keys;Array.isArray(r)&&r.length&&a.push(`未完成节点:${r.map(String).join("、")}`);const s=se(e.details,"asset_role");s&&a.push(`资产角色:${s}`);const d=se(e.details,"active_branch")||se(e.details,"branch_name");d&&a.push(`当前分支:${d}`);const f=se(e.details,"status");f&&a.push(`工作流状态:${f}`);const p=a.length?`(${a.join(";")})`:"";return`档案卡封存失败:${e.message}${p}`}async function vw(){const e=he.value;if(!e||Re.value)return;const a=yt("建立档案卡");if(a){me.value=a;return}if(!e.workflowId||!e.profileId){me.value="请先保存角色并创建详细角色工作流,再建立档案卡。";return}const r=e.workflowId,s=Xe.value[r],d=(s==null?void 0:s.current_branch)||"main",f=cw(r);if(!f)return;const p=dw(e);if(!p){me.value="档案卡缺少人设文档,请先完成角色设定拆解。";return}const h={idempotency_key:`web-profile-card-${r}-${tu(d)}`,persona_document:p,assets:f,metadata:{source:"standalone_web_profile_card",schema_version:"character_profile_card_v1",profile_id:e.profileId,profile_name:e.name,workflow_id:r,branch_name:d,selected_material_ids:Qd()}};Re.value=!0,me.value="";try{const T=await ke(A.workflowFinalizeCard(r),h);pi.value={...pi.value,[e.profileId]:[T,...(pi.value[e.profileId]??[]).filter(Y=>Y.card_id!==T.card_id)]},si.value=T.created_at,await vu(e,r,"archive");const[O]=await Promise.allSettled([be(A.profileCards(e.profileId)),Ud(),ga(),Ma()]);O.status==="fulfilled"&&(pi.value={...pi.value,[e.profileId]:O.value}),al("archive"),me.value=`档案卡已原子封存:${Ta(T.card_id)} / ${T.branch_name},4 类必填资产均已入库。`}catch(T){me.value=fw(T)}finally{Re.value=!1}}async function fc(e){const a=he.value,r=a==null?void 0:a.workflowId;if(!r||en.value)return;const s=e==="start"?"启动":e==="cancel"?"取消":"归档";if(e==="start"&&!Us.value){Yl.value="请先在第一个节点导入粗略人设;导入成功后工作流会自动启动。";return}if(!(e!=="start"&&!window.confirm(`确定${s}当前工作流吗?`))){en.value=!0,Yl.value="";try{const d=e==="start"?A.workflowStart(r):e==="cancel"?A.workflowCancel(r):A.workflowArchive(r),f=await ke(d);Xe.value={...Xe.value,[r]:f},Yl.value=`工作流已${s}`}catch(d){Yl.value=ge(d)}finally{en.value=!1}}}async function pw(){var a;const e=(a=he.value)==null?void 0:a.workflowId;if(e){en.value=!0;try{ld.value=await be(A.workflowReview(e)),Yl.value="整体审查已完成"}catch(r){Yl.value=ge(r)}finally{en.value=!1}}}async function Jv(){var r;const e=(r=Ae.value)==null?void 0:r.node_id;if(!e)return;en.value=!0;const a=await nc(e,!0);Yl.value=a?"依赖上下文已刷新":di.value,en.value=!1}function Ei(e){return Ra.value?`${e}暂不可用:${$l.value}`:Zn.value?`${e}已被锁定:${go.value}`:""}function mw(e){return`branch_${(e.node_key||e.node_id).replace(/[^a-zA-Z0-9_-]+/g,"_").slice(0,28)}_${Date.now().toString(36)}`}async function Xv(e,a,r,s={}){const d=await ke(A.workflowSwitchBranch(a),{branch_name:r}),f=await be(A.workflowNodes(a)),p=f.filter(O=>O.branch_name===d.current_branch);je.value={...je.value,[a]:f},Xe.value={...Xe.value,[a]:d},tr(e,d,p.length?p:f);const h=(s.copiedFromNodeId?p.find(O=>se(O.metadata,"copied_from_node_id")===s.copiedFromNodeId):void 0)??(s.preferredUiNodeId?p.find(O=>xn(O)===s.preferredUiNodeId):void 0),T=h?xn(h):qr(d,p.length?p:f);return Cl.value.some(O=>O.id===T)&&al(T),await Promise.all([er(p.length?p:f),Br(a)]),d}async function gw(e){var f;const a=he.value,r=a==null?void 0:a.workflowId;if(!a||!r||Gn.value||e===((f=Wt.value)==null?void 0:f.current_branch))return;const s=yt("切换工作流分支");if(s){Oa.value=s;return}Gn.value=e,Oa.value="";const d=Ye.value;try{await Xv(a,r,e,{preferredUiNodeId:d}),me.value=`已切换到分支 ${e}。`}catch(p){Oa.value=`切换分支失败:${ge(p)}`}finally{Gn.value=""}}async function Zv(){var f,p;const e=he.value,a=Ae.value;if(!(e!=null&&e.workflowId)||!a||Wo.value||Gn.value)return;const r=yt("创建工作流分支");if(r){Oa.value=r,me.value=r;return}Wo.value=!0,Oa.value="",me.value="";const s=e.workflowId,d=((f=qe.value)==null?void 0:f.title)??a.title;try{const h=await ke(A.workflowBranches(s),{branch_name:mw(a),base_branch_name:a.branch_name||((p=Xe.value[s])==null?void 0:p.current_branch)||"main",base_node_id:a.node_id,copy_nodes:!0,metadata:{source:"standalone_web",ui_node_id:Ye.value,ui_node_title:d,reason:"edit_locked_completed_node"}});Jl.value={...Jl.value,[s]:Lv(s,[...Jl.value[s]??[],h])},Gn.value=h.branch_name,await Xv(e,s,h.branch_name,{preferredUiNodeId:Ye.value,copiedFromNodeId:a.node_id}),me.value=`已从「${d}」创建分支 ${h.branch_name},现在可以在新分支继续修改。`}catch(h){Oa.value=`创建分支失败:${ge(h)}`,me.value=Oa.value}finally{Wo.value=!1,Gn.value=""}}async function yw(e={}){const a=he.value,r=Ae.value;if(!a||!r||Re.value)return!1;const s=Ei(e.retry?"新建重试轮次":"新建生成轮次");if(s)return Je.value=`${s};请先创建分支。`,!1;Re.value=!0,rd.value=r.node_id,Je.value="",hn.value="";try{const d=qe.value,f=_n.value.trim(),p=e.promptPatch??(f?ic(f):(d==null?void 0:d.prompt)||Ue.value.basePrompt),h=Ve.value,T=h&&!h.legacy&&h.candidates.length?h:null;if(!T&&!po.value.route)return Je.value="当前节点和后端默认均未提供生图路由,请先在下方显式覆盖或前往设置配置。",me.value=Je.value,!1;if(T){const J=Md.value;if(J<1||J>3)return Je.value="开始下一轮前,请先把 1–3 张生成成功的候选标记为“喜欢”。",me.value=Je.value,!1}const O=`${Date.now()}-${Math.random().toString(16).slice(2)}`,Y=T?await ke(A.roundNext(T.round.round_id),{count:wr.value,...qc(Ar.value),idempotency_key:`web-round-next-${T.round.round_id}-${O}`}):await ke(A.nodeRounds(r.node_id),{round_kind:"primary",count:wr.value,prompt_patch:p,...qc(Ar.value),aspect_ratio:hp(d),idempotency_key:`web-round-${r.node_id}-${O}`,metadata:{source:"standalone_web_round",ui_node_id:Ye.value,requested_count:wr.value,...f?sc(f):{},...e.metadata??{}}});return wo(r.node_id,Y,{select:!0}),hn.value=T?`已根据 ${T.round.display_code} 的反馈加入下一轮生成队列`:"已加入生成队列",me.value=`轮次 ${Y.round.display_code} 已加入生成队列。`,_n.value="",Zo(Y),await Promise.allSettled([In(),Ma()]),!0}catch(d){return Je.value=`轮次提交失败:${ge(d)}`,me.value=Je.value,!1}finally{Re.value=!1,rd.value=""}}async function fu(e={}){const a=he.value;if(!a||Re.value)return!1;if(Ft.value)return yw(e);const r=yt(e.retry?"节点重跑":"节点生成");if(r)return me.value=r,!1;const s=ho(Ye.value,a);if(!s)return me.value="当前节点还没有绑定后端 node_id",!1;const d=Ei(e.retry?"节点重跑":"节点生成");if(d)return me.value=d,!1;Re.value=!0,me.value="";try{const f=qe.value,p=_n.value.trim(),T={prompt_patch:e.promptPatch??(p?ic(p):(f==null?void 0:f.prompt)||Ue.value.basePrompt),...qc(Ar.value),count:fh(f),aspect_ratio:hp(f),idempotency_key:`web-workflow-${s}-${Date.now()}-${Math.random().toString(16).slice(2)}`,metadata:{source:"standalone_web",ui_node_id:Ye.value,...p?sc(p):{},...e.metadata??{}}},O=e.retry?A.nodeRetry(s):A.nodeGenerate(s),Y=await ke(O,T),J=await ac(Y.images??[]);if(bt.value={...bt.value,[s]:ko([...J,...bt.value[s]??[]])},Qe.value=ko([...J,...Qe.value]).slice(0,12),J[0]&&(U.value=J[0].image_id),a.workflowId){const Le=await be(A.workflowNodes(a.workflowId));je.value={...je.value,[a.workflowId]:Le}}return _n.value="",await Promise.allSettled([ga(),In(),Ma()]),!0}catch(f){return me.value=`${e.retry?"节点重试":"节点生成"}失败:${ge(f)}`,!1}finally{Re.value=!1}}async function _w(){const e=he.value;if(!e||gr.value)return;const a=yt("设定拆解");if(a){yr.value=a;return}if(!e.profileId){yr.value="请先通过“生成档案”保存到后端,再进入设定拆解。";return}const r=Wt.value;if(rc(r)){Ye.value=qr(r,Xn.value);return}gr.value=!0,yr.value="";try{const{workflow:s}=await uu(e,Qa),d=await ke(A.workflowExecuteCharacter(s.workflow_id));je.value={...je.value,[s.workflow_id]:d.nodes},Xe.value={...Xe.value,[s.workflow_id]:d.workflow},tr(e,d.workflow,d.nodes),al("persona-split")}catch(s){yr.value=`后端拆解失败:${ge(s)}`}finally{gr.value=!1}}async function bw(){await vc(Ye.value,"prompt-plan","确认字段","字段已确认,提示词规划节点已解锁。")}async function vc(e,a,r,s){const d=he.value;if(!d||Re.value)return;const f=yt(r);if(f){me.value=f;return}if(xl(e)){me.value=$l.value;return}const p=ho(e,d);if(!p){me.value="当前节点还没有绑定后端 node_id";return}const h=Ei(r);if(h){me.value=h;return}Re.value=!0,me.value="";try{const T=await ke(A.nodeComplete(p));if(d.workflowId){const O=je.value[d.workflowId]??[];je.value={...je.value,[d.workflowId]:O.map(Y=>Y.node_id===T.node_id?T:Y)}}me.value=s,al(a)}catch(T){me.value=`${r}失败:${ge(T)}`}finally{Re.value=!1}}async function ww(){var d;const e=he.value;if(!e||Re.value)return;const a=yt("提示词规划");if(a){me.value=a;return}const r=ho("prompt-plan",e);if(!r){me.value="当前工作流缺少后端提示词规划节点 prompt_plan。";return}const s=Ei("提示词规划");if(s){me.value=s;return}Re.value=!0,me.value="";try{const f=xw(e),p=await sr(A.node(r),{prompt:f.prompt_context,negative_prompt:f.negative_prompt,metadata:{...((d=ar(e.workflowId??"").find(h=>h.node_id===r))==null?void 0:d.metadata)??{},prompt_plan:f,prompt_plan_schema_version:"2026-07-09.prompt-plan-schema.v1",ui_node_id:"prompt-plan",source:"standalone_web_prompt_plan"}});ep(e.workflowId,p),me.value="提示词规划已写入后端 prompt_plan 节点。"}catch(f){me.value=`提示词规划失败:${ge(f)}`}finally{Re.value=!1}}async function hw(){var d;const e=he.value;if(!e||Re.value)return;const a=yt("素材绑定");if(a){me.value=a;return}const r=ho("material-bind",e);if(!r){me.value="当前工作流缺少后端素材绑定节点 material_bind。";return}const s=Ei("素材绑定");if(s){me.value=s;return}Re.value=!0,me.value="";try{const f=Rw(e),p=await sr(A.node(r),{metadata:{...((d=ar(e.workflowId??"").find(h=>h.node_id===r))==null?void 0:d.metadata)??{},material_bindings:f,material_binding_schema_version:"2026-07-09.material-binding-schema.v1",ui_node_id:"material-bind",source:"standalone_web_material_bind"}});ep(e.workflowId,p),me.value=f.selected_material_ids.length?`素材绑定已落库:${f.selected_material_ids.length} 类真实后端参考。`:"素材绑定已落库:默认不使用参考。"}catch(f){me.value=`素材绑定失败:${ge(f)}`}finally{Re.value=!1}}async function kw(){await vc("prompt-plan","material-bind","确认提示词规划","提示词规划已确认,素材绑定节点已解锁。")}async function Cw(){await vc("material-bind","portrait-01","确认素材绑定","素材绑定已确认,头像草稿节点已解锁。")}async function $w(){var s,d;const e=he.value;if(!e||Re.value)return;const a=yt("节点审查");if(a){me.value=a;return}if(Ra.value){me.value=`节点审查暂不可用:${$l.value}`;return}const r=ho(Ye.value,e);if(!r){me.value="当前节点还没有绑定后端 node_id";return}Re.value=!0,me.value="";try{const f=await be(A.nodeReview(r));e.workflowId&&await ke(A.workflowHistory(e.workflowId),{action:"node_review",title:`${e.name} / ${qe.value.title} 审查`,node_id:r,image_id:se(f.summary,"selected_image_id")||((s=el.value)==null?void 0:s.image_id),include_nodes:!0,metadata:{source:"standalone_web_node_review",ui_node_id:Ye.value,review_passed:f.passed,warning_count:f.warnings.length,error_count:f.errors.length,stage_review:f.stage_review}});const p=Array.isArray((d=f.stage_review)==null?void 0:d.candidates)?f.stage_review.candidates.length:0;me.value=f.passed?`审查通过:${p} 个候选。`:`审查未通过:${f.errors.length} 个错误,${f.warnings.length} 个提醒。`}catch(f){me.value=`节点审查失败:${ge(f)}`}finally{Re.value=!1}}function Pw(e,a,r,s){const d=ar(e).slice().sort((h,T)=>h.sort_order-T.sort_order),f=d.find(h=>h.node_id===r),p=f?d.find(h=>h.sort_order>f.sort_order):void 0;return p?{uiNodeId:xn(p),backendNodeId:p.node_id}:{uiNodeId:void 0,backendNodeId:void 0}}function Iw(e){return e==="hires-fix"?"hires_fix_input":e==="archive"?"archive_input":"next_stage_input"}async function vu(e,a,r){const{workflow:s,nodes:d}=await be(A.workflow(a)),f=d.filter(p=>p.branch_name===s.current_branch);je.value={...je.value,[a]:d},Xe.value={...Xe.value,[a]:s},await er(f.length?f:d),tr(e,s,f.length?f:d),r&&Cl.value.some(p=>p.id===r)&&al(r)}async function Sw(){var p;const e=he.value;if(!e||Re.value)return;if(Ft.value&&Ve.value){await Rb();return}const a=yt("确认采用");if(a){me.value=a;return}if(!e.workflowId){me.value="请先生成角色档案并创建后端工作流,再确认采用。";return}if(Ra.value){me.value=`确认采用暂不可用:${$l.value}`;return}if(Jo.value){me.value=`${go.value} 已确认采用的节点不能重复采用。`;return}const r=ho(Ye.value,e);if(!r){me.value="当前节点还没有绑定后端 node_id。";return}const s=zs.value;if(!s||!Va(s)){me.value="请先将一张真实后端候选图标记为定稿,再确认采用。";return}if(!(bt.value[r]??[]).some(h=>h.image_id===s.image_id)){me.value="当前选中的图片不属于此后端节点,请重新选择节点内候选图。";return}const f=Pw(e.workflowId,Ye.value,r);Re.value=!0,me.value="";try{const h=await ke(A.nodeAdoptImage(r),{image_id:s.image_id,title:`${e.name} / ${qe.value.title} 确认采用`,metadata:{source:"standalone_web_stage_review_confirm",schema_version:"2026-07-09.stage-review-confirm.v1",profile_id:e.profileId,profile_name:e.name,workflow_id:e.workflowId,branch_name:((p=Xe.value[e.workflowId])==null?void 0:p.current_branch)??"main",ui_review_node_id:`${Ye.value}-review`,source_ui_node_id:Ye.value,source_backend_node_id:r,next_ui_node_id:f.uiNodeId,next_backend_node_id:f.backendNodeId,handoff_bucket:f.uiNodeId,handoff_role:Iw(f.uiNodeId),selected_draft_image_ids:Ua.value.filter(Va).map(T=>T.image_id),candidate_feedback:qa.value}});si.value=h.created_at,await vu(e,e.workflowId,f.uiNodeId),me.value=f.uiNodeId?`已确认采用,当前节点已锁定并交接到「${uh(f.uiNodeId)}」。`:"已确认采用,当前节点已锁定。",await Promise.allSettled([ga(),Ma()])}catch(h){me.value=`确认采用失败:${ge(h)}`}finally{Re.value=!1}}function ep(e,a){if(!e)return;const r=je.value[e]??[];je.value={...je.value,[e]:r.map(s=>s.node_id===a.node_id?a:s)}}function xw(e){const a=$i.value.flatMap(f=>f.fields.filter(p=>p.value&&p.value!=="待补充").map(p=>`${p.label}: ${p.value}`)),r=[e.name,e.identity,e.personality,Nr(e),e.style,a.slice(0,8).join(", ")].filter(Boolean).join(", "),s=e.negative||Ue.value.negativePrompt||"low quality, blurry, bad anatomy",d=[pu("portrait","头像节点",`${r}, face reference, clear eyes, recognizable hairstyle`,s,["name","hair","eyes","face identity"]),pu("bust","半身节点",`${r}, upper body, outfit silhouette, calm pose`,s,["face identity","hair","upper outfit"]),pu("fullbody","全身节点",`${r}, full body standing pose, complete outfit, shoes and accessories`,s,["face identity","body proportion","outfit"]),pu("sheet","设定图节点",`${r}, character design sheet, multi angle, expression and pose references`,s,["identity","outfit","style"])];return{profile_id:e.profileId,profile_name:e.name,negative_prompt:s,items:d,guard_checks:[{label:"负面词",value:s,status:"ready"},{label:"权重建议",value:"身份特征和发眼锚点优先,服装/配饰作为中等权重继承。",status:"ready"}],prompt_context:d.map(f=>f.prompt).join(`
|
||
`)}}function pu(e,a,r,s,d){return{id:e,title:a,prompt:r,negative:s,weight_suggestions:[{label:"identity",value:1.25,reason:"keep character identity stable"},{label:"style",value:.85,reason:"avoid overfitting style over identity"}],inherits:d,status:"ready"}}function Rw(e){const a=Fa.value,r=V.map((s,d)=>{const f=a.find(p=>p.category===s.category);return{id:`rule_${s.category}_${d+1}`,category:s.category,material_id:zd(f==null?void 0:f.id),material_label:(f==null?void 0:f.label)??"",material_group:(f==null?void 0:f.group)??(f==null?void 0:f.category)??"",material_prompt:(f==null?void 0:f.prompt)??"",material_colors:(f==null?void 0:f.colors)??[],bind_to_stages:tp(s.category),inheritance_rule:f?`${s.category} only affects explicitly bound downstream stages.`:"do not use reference unless user explicitly selects one",reference_strength:f?ap(s.category):"弱",required:!!(f&&["风格","服装"].includes(s.category)),status:f?"ready":"pending"}});return{profile_id:e.profileId,profile_name:e.name,selected_material_ids:Qd(),rules:r}}function tp(e){return{风格:[{stage_id:"portrait-draft",stage_title:"头像草稿"},{stage_id:"halfbody-draft",stage_title:"半身草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"},{stage_id:"review-archive",stage_title:"修复入库"}],构图:[{stage_id:"portrait-draft",stage_title:"头像草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"}],服装:[{stage_id:"halfbody-draft",stage_title:"半身草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"}],鞋袜:[{stage_id:"body-sheet",stage_title:"全身与设定图"}],配饰:[{stage_id:"body-sheet",stage_title:"全身与设定图"},{stage_id:"review-archive",stage_title:"修复入库"}]}[e]??[{stage_id:"body-sheet",stage_title:"全身与设定图"}]}function ap(e){return e==="风格"||e==="服装"?"强":e==="构图"?"中":"弱"}async function Mw(){var r;const e=he.value;if(!e||_r.value)return;const a=yt("保存快照");if(a){Do.value=a;return}if(!e.workflowId){Do.value="请先生成档案并创建后端工作流,再保存快照。";return}_r.value=!0,Do.value="";try{const s=await ke(A.workflowHistory(e.workflowId),{action:"save_version",title:`${e.name} / ${((r=qe.value)==null?void 0:r.title)??"工作流快照"}`,node_id:ho(Ye.value,e),include_nodes:!0,metadata:{source:"standalone_web",ui_node_id:Ye.value,profile_id:e.profileId,profile_name:e.name,profile_status:e.status}});si.value=s.created_at}catch(s){Do.value=`保存快照失败:${ge(s)}`}finally{_r.value=!1}}function ho(e,a){if(!a.workflowId)return;const s=ar(a.workflowId).find(f=>xn(f)===e);if(s)return s.node_id;const d=a.workflowNodeIds??[];if(e!=="brief-import"&&e==="persona-split")return d[0]}function ar(e){var s;const a=je.value[e]??[],r=(s=Xe.value[e])==null?void 0:s.current_branch;return r?a.filter(d=>d.branch_name===r):a}function Aw(e){const a=zs.value;if(a&&(!e||a.node_id===e))return[a.image_id];if(!e)return[];const r=(bt.value[e]??[]).find(s=>{var d;return s.image_id===((d=Xn.value.find(f=>f.node_id===e))==null?void 0:d.selected_image_id)});return r&&Va(r)?[r.image_id]:[]}function Va(e){const a="metadata"in e&&e.metadata&&typeof e.metadata=="object"?e.metadata:{},r=a.mock===!0||a.mock===1||a.mock==="true",s=Object.prototype.hasOwnProperty.call(a,"provider_error")&&a.provider_error!=null,d=a.fallback_used===!0||a.degraded===!0;return!r&&!s&&!d}async function Ew(){if(!Df.value||ri.value)return;const e=yt("生成档案");if(e){ii.value=e;return}$f.value+=1;const a=qw(Ce.value,$f.value);ri.value=!0,ii.value="";try{const r=await ke(A.quickProfileDraft,Tw(a,Ce.value,Kn.value)),s={...a,name:r.profile_preview.name||a.name,style:r.profile_preview.style_prompt||a.style,negative:r.profile_preview.negative_prompt||a.negative},d=await ke(A.quickProfileDraftSave,Nw(s,Ce.value,Kn.value,r)),p={...Lw(d,s),status:"文本档案已保存"};bn.value=[p,...bn.value.filter(h=>h.id!==p.id)],Yt.value=[d.profile,...Yt.value.filter(h=>h.profile_id!==d.profile.profile_id)],Rt.value={...Rt.value,[d.profile.profile_id]:d.workflow?[d.workflow]:[]},nu(p),H.value="quickProfile",At("personaQuestionnaire"),Ht(()=>{var h;(h=document.querySelector(`[data-profile-card-id="${p.id}"]`))==null||h.scrollIntoView({block:"nearest",behavior:"smooth"})})}catch(r){ii.value=`后端生成或保存失败:${ge(r)}`}finally{ri.value=!1}}function Tw(e,a,r){return{questionnaire:{...pc(a,r),name:e.name,identity:e.identity,gender_presentation:e.genderPresentation,age_stage:e.ageStage,species:e.species,body_type:e.bodyType,distinctive_features:e.distinctiveFeatures,personality:e.personality.split(/[,,。;;\n]/).map(s=>s.trim()).filter(Boolean),hair_color:e.hairColor,hairstyle:e.hairstyle,eye_color:e.eyeColor,style:e.style,clothing_keywords:e.clothing.split(/[,,。;;\n]/).map(s=>s.trim()).filter(Boolean)},metadata:{source:"standalone_web_questionnaire",questionnaire_mode:r}}}function Nw(e,a,r,s){const d=pc(a,r),f=(s==null?void 0:s.profile_preview)??{name:e.name,base_prompt:[e.name,e.identity,e.personality?`personality: ${e.personality}`:""].filter(Boolean).join(", "),appearance_prompt:[e.hairColor,e.hairstyle,e.eyeColor,e.clothing].filter(Boolean).join(", "),style_prompt:e.style,negative_prompt:e.negative};return{draft_id:s==null?void 0:s.draft_id,draft:s,profile_preview:f,description:`${e.identity}。${e.personality}`,questionnaire:d,metadata:{source:"quick_profile_questionnaire",questionnaire_mode:r,material_id:zd(e.materialId)||void 0,identity:e.identity,personality:e.personality,gender_presentation:e.genderPresentation,age_stage:e.ageStage,species:e.species,body_type:e.bodyType,distinctive_features:e.distinctiveFeatures,raw_appearance:d.appearance,identity_fields:Jd(e),hair_color:e.hairColor,hairstyle:e.hairstyle,eye_color:e.eyeColor,clothing:e.clothing,worldview:d.worldview,height_build:d.height_build,generation_style:d.generation_style},create_workflow:!1}}function pc(e,a){return np({mode:a,role_core:e.roleCore,gender_presentation:e.genderPresentation,age_stage:e.ageStage,species:e.species,body_type:e.bodyType,distinctive_features:e.distinctiveFeatures,personality:e.personality,appearance:e.appearance,outfit:e.outfit,scene:e.scene,avoid:e.avoid,worldview:e.worldview,background:e.background,height_build:e.heightBuild,body_features:e.bodyFeatures,likes:e.likes,dislikes:e.dislikes,habits:e.habits,relationships:e.relationships,story_hooks:e.storyHooks,generation_style:e.generationStyle,shot_preference:e.shotPreference,mood:e.mood,extra_notes:e.extraNotes})}function np(e){return Object.fromEntries(Object.entries(e).map(([a,r])=>[a,r.trim()]).filter(([,a])=>!!a))}function Lw(e,a){var d,f;const r=e.profile,s=r.metadata??{};return{...a,id:r.profile_id,profileId:r.profile_id,workflowId:e.workflow&&oc(e.workflow)?e.workflow.workflow_id:void 0,quickProfileWorkflowId:(d=e.workflow)==null?void 0:d.workflow_id,workflowNodeIds:e.workflow&&oc(e.workflow)?(f=e.nodes)==null?void 0:f.map(p=>p.node_id):void 0,name:r.name||a.name,identity:Nt(s.identity)||a.identity,genderPresentation:nl(s,"gender_presentation")||a.genderPresentation,ageStage:nl(s,"age_stage")||a.ageStage,species:nl(s,"species")||a.species,bodyType:nl(s,"body_type")||a.bodyType,distinctiveFeatures:nl(s,"distinctive_features")||a.distinctiveFeatures,personality:lp(r.base_prompt)||a.personality,hairColor:Nt(s.hair_color)||a.hairColor,hairstyle:Nt(s.hairstyle)||a.hairstyle,eyeColor:Nt(s.eye_color)||a.eyeColor,clothing:Nt(s.clothing)||a.clothing,style:r.style_prompt||a.style,negative:r.negative_prompt||a.negative,status:e.workflow?"已落库":"已保存",updatedAt:"刚刚"}}function Bw(e,a,r,s){const d=e.metadata??{},f=Nt(d.material_id),p=so.value.find(h=>h.id===f);return{id:e.profile_id,profileId:e.profile_id,workflowId:a==null?void 0:a.workflow_id,quickProfileWorkflowId:r==null?void 0:r.workflow_id,workflowNodeIds:void 0,name:e.name,identity:Nt(d.identity)||e.description||"后端角色档案",genderPresentation:nl(d,"gender_presentation"),ageStage:nl(d,"age_stage"),species:nl(d,"species"),bodyType:nl(d,"body_type"),distinctiveFeatures:nl(d,"distinctive_features"),personality:lp(e.base_prompt)||"待细化",hairColor:Nt(d.hair_color)||"待细化",hairstyle:Nt(d.hairstyle)||e.appearance_prompt||"待细化",eyeColor:Nt(d.eye_color)||"待细化",clothing:Nt(d.clothing)||e.appearance_prompt||"待细化",style:e.style_prompt||"待细化",negative:e.negative_prompt||"low quality, blurry, bad anatomy",status:a?a.status==="completed"?"工作流已拆解":"工作流就绪":r?"快速档案已落库":e.status,updatedAt:Tl(e.updated_at),materialId:f,colors:(p==null?void 0:p.colors)??op(s+31)}}function Nt(e){return typeof e=="string"?e.trim():""}function nl(e,a){const r=Nt(e[a]);if(r)return r;const s=Et(e.identity_fields)?e.identity_fields:void 0;if(s){const f=Nt(s[a]);if(f)return f}const d=Et(e.identity_lock)?e.identity_lock:void 0;return d?Nt(d[a]):""}function lp(e){const a="personality:",r=e??"",s=r.toLowerCase().indexOf(a);return s<0?"":r.slice(s+a.length).trim()}function qw(e,a){const r=Ow(e.roleCore,a),s=r.identity==="角色身份待细化"&&[e.background,e.worldview].map(p=>p.trim()).filter(Boolean).join(",")||r.identity,d=[e.appearance,e.heightBuild,e.bodyFeatures].map(p=>p.trim()).filter(Boolean).join(","),f=wd.value;return{id:`profile-local-${Date.now()}-${a}`,name:r.name,identity:s,genderPresentation:e.genderPresentation.trim(),ageStage:e.ageStage.trim(),species:e.species.trim(),bodyType:e.bodyType.trim(),distinctiveFeatures:e.distinctiveFeatures.trim(),personality:[e.personality,e.likes,e.dislikes].map(p=>p.trim()).filter(Boolean).join(";")||"性格待细化",hairColor:mc(d,["发色","头发","发"],"发色待细化"),hairstyle:mc(d,["发型","短发","长发","马尾","刘海"],d||"发型待细化"),eyeColor:mc(d,["瞳色","眼睛","眼"],"瞳色待细化"),clothing:e.outfit.trim()||"服装与配饰待细化",style:Dw(e),negative:e.avoid.trim()||"低质量、结构错误、过度复杂",status:"新建档案",updatedAt:"刚刚",materialId:(f==null?void 0:f.id)??"",colors:(f==null?void 0:f.colors)??op(a)}}function Ow(e,a){const r=e.split(/[,,。;;\n]/).map(p=>Zi(p)).filter(Boolean),s=r[0]??"",d=s&&s.length<=16?s:`新角色 ${String(a).padStart(2,"0")}`,f=(s===d?r.slice(1).join(","):r.join(","))||(s&&s!==d?s:"角色身份待细化");return{name:d,identity:f}}function mc(e,a,r){const s=e.trim();return s?s.split(/[,,。;;\n]/).map(f=>Zi(f)).filter(Boolean).find(f=>a.some(p=>f.includes(p)))??r:r}function Dw(e){const a=[e.worldview,e.scene,e.generationStyle,e.shotPreference,e.mood].map(r=>r.trim()).filter(Boolean);return a.length?`${a.join(",")},角色设定插画,清晰轮廓,高可读设计`:"角色设定插画,清晰轮廓,高可读设计"}function op(e){const a=[["#3f7edc","#2ec4b6","#f5c542"],["#2f7a60","#d2a23a","#e0f2fe"],["#d65b7f","#209b8d","#f4f4f5"]];return a[e%a.length]}async function Ww(e){var d,f;const a=e.target instanceof HTMLInputElement?e.target:null,r=(d=a==null?void 0:a.files)==null?void 0:d[0];if(!r)return;const s=r.name;if(!/\.(md|markdown|txt)$/i.test(s)){qo.value="仅支持 .md、.markdown 或 .txt 文件",a.value="";return}nd.value=!0,qo.value="",gs.value=s;try{const p=await r.text(),h=await ke(A.quickProfileDocumentImport,{filename:s,content:p,questionnaire:pc(Ce.value,Kn.value)}),T={role_core:"roleCore",gender_presentation:"genderPresentation",age_stage:"ageStage",species:"species",body_type:"bodyType",distinctive_features:"distinctiveFeatures",personality:"personality",appearance:"appearance",outfit:"outfit",scene:"scene",avoid:"avoid",worldview:"worldview",background:"background",height_build:"heightBuild",body_features:"bodyFeatures",likes:"likes",dislikes:"dislikes",habits:"habits",relationships:"relationships",story_hooks:"storyHooks",generation_style:"generationStyle",shot_preference:"shotPreference",mood:"mood",extra_notes:"extraNotes"},O={...Ce.value};for(const[J,Le]of Object.entries(h.questionnaire||{})){const Me=T[J];Me&&typeof Le=="string"&&Le.trim()&&(O[Me]=Le)}Ce.value=O,(h.unresolved_fields||[]).some(J=>["worldview","background","relationships","story_hooks","extra_notes"].includes(J))&&(Kn.value="advanced"),oi.value=p;const Y=(f=h.warnings)==null?void 0:f.filter(Boolean).join(";");qo.value=Y||(h.llm_used===!1?"未配置文本模型,已保留原文,请手动整理。":""),At("externalProfileImport"),Dr()}catch(p){qo.value=p instanceof Error?p.message:"文档识别失败"}finally{nd.value=!1,a&&(a.value="")}}function Fw(){if(!oi.value.trim())return;const a=gd.value;Ce.value={roleCore:a.roleCore,genderPresentation:a.genderPresentation,ageStage:a.ageStage,species:a.species,bodyType:a.bodyType,distinctiveFeatures:a.distinctiveFeatures,personality:a.personality,appearance:a.appearance,outfit:a.outfit,scene:a.scene,avoid:a.avoid,worldview:a.worldview,background:a.background,heightBuild:a.heightBuild,bodyFeatures:a.bodyFeatures,likes:a.likes,dislikes:a.dislikes,habits:a.habits,relationships:a.relationships,storyHooks:a.storyHooks,generationStyle:a.generationStyle,shotPreference:a.shotPreference,mood:a.mood,extraNotes:a.extraNotes},a.recognizedKeys.some(r=>["worldview","background","heightBuild","bodyFeatures","likes","dislikes","habits","relationships","storyHooks","generationStyle","shotPreference","mood","extraNotes"].includes(r))&&(Kn.value="advanced"),At("externalProfileImport"),Dr()}function rp(e){var s;const a=e.target instanceof Element?e.target:null,r=(s=a==null?void 0:a.closest("[data-overlay-root]"))==null?void 0:s.dataset.overlayRoot;return pp(r)?r:null}function ip(e){e.button===0&&(gi={pointerId:e.pointerId,x:e.clientX,y:e.clientY,startedOutside:rp(e)===null,moved:!1})}function sp(e){const a=gi;!a||a.pointerId!==e.pointerId||a.moved||Math.hypot(e.clientX-a.x,e.clientY-a.y)>6&&(a.moved=!0)}function up(e){const a=gi;if(gi=void 0,!a||a.pointerId!==e.pointerId||a.moved||!a.startedOutside||rp(e)!==null)return;const r=window.getSelection();r&&!r.isCollapsed||ja()}function dp(){gi=void 0}function Uw(e){var s;if(e.key!=="Escape")return;const a=e.target instanceof Element?e.target:null,r=(s=a==null?void 0:a.closest("[data-overlay-root]"))==null?void 0:s.dataset.overlayRoot;if(pp(r)){At(r);return}ja()}function cp(e){if(e.key==="Escape"){Uw(e);return}const a=e.target instanceof HTMLElement?e.target:null,r=!!(a!=null&&a.closest("input, textarea, select, [contenteditable='true']")),s=(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="k",d=e.key==="/"&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!r;!s&&!d||(e.preventDefault(),zv(),Ht(()=>{var f;return(f=Pf.value)==null?void 0:f.focus()}))}function gc(e){const a=!vp(e);ja(e),fp(e,a)}function ja(e){for(const a of If)a!==e&&At(a)}function At(e){fp(e,!1)}function fp(e,a){e==="search"&&(id.value=a,hr.value=a),e==="palette"&&(Ss.value=a),e==="notifications"&&(xs.value=a),e==="logs"&&(Rs.value=a),e==="imageViewer"&&(to.value=a,a||(Ko.value=!1)),e==="materialPicker"&&!a&&(gt.value=""),e==="materialDetail"&&(us.value=a),e==="materialCategoryCreate"&&(ds.value=a,!a&&!Gl.value&&(zl.value="")),e==="materialOperation"&&!a&&!kt.value&&(jl.value=null,Dt.value="",mr.value=null,wl.value="",Xl.value=[]),e==="personaQuestionnaire"&&(vs.value=a),e==="quickProfileDetail"&&(ps.value=a),e==="externalProfileImport"&&(ms.value=a)}function vp(e){return e==="search"?hr.value:e==="palette"?Ss.value:e==="notifications"?xs.value:e==="imageViewer"?to.value:e==="materialPicker"?!!gt.value:e==="materialDetail"?us.value:e==="materialCategoryCreate"?ds.value:e==="materialOperation"?!!jl.value:e==="personaQuestionnaire"?vs.value:e==="quickProfileDetail"?ps.value:e==="externalProfileImport"?ms.value:Rs.value}function pp(e){return If.includes(e)}function Kw(e){Zl.value=e.primary,eo.value=e.accent}function Vw(e){an.value.includes(e)||(an.value=[...an.value,e])}function jw(){an.value=ur([...an.value,...Ii.value.map(e=>e.id)])}function Gw(){const e=Ii.value.filter(a=>an.value.includes(a.id)).map(a=>a.id);$r.value=ur([...$r.value,...e])}function Hw(e){Mt(e.nav,e.module)}function mp(e){$a.value=e.task_id;const a=Be(e.status);Wn.value=["failed","dead_letter","cancelled"].includes(a)?"failed":["completed","succeeded","superseded"].includes(a)?"done":"active",Mt("queue","queue")}function zw(e){var r,s;const a=Be(e.status);return!!(["failed","dead_letter","cancelled"].includes(a)&&((r=de.value)!=null&&r.permissions.can_write)&&((s=de.value)!=null&&s.permissions.can_retry_tasks)&&!nn.value)}async function Qw(e){mp(e),await Ht();const a=Pi.value.find(r=>r.id==="retry");if(!(a!=null&&a.enabled)){xa.value="当前任务状态或权限不允许重试。";return}await mu(a)}async function Yw(e=St.value){var r;if(Zu.value||!((r=de.value)!=null&&r.permissions.can_manage_materials))return;Zu.value=!0;const a=new Set(e.map(s=>s.category_id));try{const s=[];for(const d of X){if(a.has(d.category_id))continue;const f=await ke(A.materialCategories,d);s.push(f),a.add(f.category_id)}for(const d of ve){if(a.has(d.category_id))continue;const f=d.parent_id;if(f&&!a.has(f))continue;const p=await ke(A.materialCategories,d);s.push(p),a.add(p.category_id)}s.length&&(xt.value=`默认素材分类已落库:${s.length} 个。`,await Ka())}catch(s){wt.value=`默认分类落库失败:${ge(s)}`}finally{Zu.value=!1}}async function Jw(e){if(kt.value)return;const a=wl.value,r=yt("添加并识别素材");if(r){Dt.value=r;return}kt.value=!0,Dt.value="",wt.value="";let s=null,d=null,f=!1;try{s=await ke(A.materialUpload,{...e,metadata:{...e.metadata,source:"imagestudio_frontend",registration_mode:"browser_image_upload"}}),Pa.value=e.category_id,yl.value=s.material_id;try{const p=await ke(A.materialRecognize(s.material_id),{});if(a){const h=Be(p.recognition_status);if(h==="pending_confirm")d=await ke(A.materialConfirm(p.material_id),{display_name:p.display_name,prompt:p.prompt,negative_prompt:p.negative_prompt,tags:p.tags});else if(h==="confirmed")d=p;else throw new Error(`识别状态为 ${eu(p.recognition_status)},尚不能绑定;请稍后在素材库确认后重试。`)}xt.value=a?`素材「${p.display_name}」已识别并确认,正在绑定当前节点。`:`素材「${p.display_name}」已添加并完成识别,当前状态:${eu(p.recognition_status)}。`}catch(p){if(a)throw p;wt.value=`素材「${s.display_name}」已保存,但自动识别失败:${ge(p)}。可在素材详情中重新识别。`}if(await Ka(),Pa.value=e.category_id,yl.value=s.material_id,a){if(!d||Be(d.recognition_status)!=="confirmed")throw new Error("素材尚未确认,不能写入节点绑定。");const p=Xl.value;if(!await Ov([...p,d.material_id],a))throw new Error(Jt.value||"节点绑定保存失败");Uo.value=`素材「${d.display_name}」已识别、确认并绑定到当前节点。`}f=!0}catch(p){s&&await Ka(),Dt.value=s&&a?`素材已保存,但未能完成当前节点绑定:${ge(p)}`:`添加素材失败:${ge(p)}`}finally{kt.value=!1,f&&At("materialOperation")}}async function Xw(e){if(kt.value)return;const a=yt("登记素材 URI");if(a){Dt.value=a;return}kt.value=!0,Dt.value="";let r=!1;try{const s=await ke(A.materialUpload,{...e,metadata:{source:"imagestudio_frontend",registration_mode:"storage_reference_only"}});await Ka(),Pa.value=e.category_id,yl.value=s.material_id,xt.value=`素材 URI「${s.display_name}」已登记,当前状态:${eu(s.recognition_status)}。`,r=!0}catch(s){Dt.value=`登记素材 URI 失败:${ge(s)}`}finally{kt.value=!1,r&&At("materialOperation")}}async function Zw(e){const a=hi.value;if(!a||kt.value)return;const r=yt("保存素材标准属性");if(r){xt.value=r;return}kt.value=!0,xt.value="";try{await sr(A.material(a.material_id),{normalized_asset_profile:e}),await Ka(),xt.value=`素材「${a.display_name}」的标准属性已保存。`}catch(s){xt.value=`保存标准属性失败:${ge(s)}`}finally{kt.value=!1}}async function eh(e){if(kt.value)return;const a=yt("预检查素材包");if(a){Dt.value=a;return}kt.value=!0,Dt.value="",mr.value=null;try{mr.value=await ke(A.assetImportPack,{package_uri:e.package_uri,dry_run:!0})}catch(r){Dt.value=`素材包 dry-run 失败:${ge(r)}`}finally{kt.value=!1}}async function th(e){if(kt.value)return;const a=mr.value;if(!a||a.package_uri!==e.package_uri||!a.execution_enabled){Dt.value="请先完成有效的 dry-run 预检查。";return}const r=yt("导入素材包");if(r){Dt.value=r;return}kt.value=!0,Dt.value="";let s=!1;try{const d=await ke(A.assetImportPack,{package_uri:e.package_uri,dry_run:!1});await Ka(),xt.value=`素材包已导入:新增 ${d.applied.created} 条,更新 ${d.applied.updated} 条。`,s=!0}catch(d){Dt.value=`素材包导入失败:${ge(d)}`}finally{kt.value=!1,s&&At("materialOperation")}}async function ah(e){if(kt.value)return;const a=he.value,r=hi.value;if(!(a!=null&&a.profileId)||!r||Be(r.recognition_status)!=="confirmed"){Dt.value="需要选中已落库角色和已确认的真实后端素材。";return}const s=yt("导入角色衣橱");if(s){Dt.value=s;return}kt.value=!0,Dt.value="";let d=!1;try{const f=await ke(A.wardrobeImportMaterial(a.profileId),{material_id:r.material_id,wardrobe_category:e.wardrobe_category});xt.value=`素材「${r.display_name}」已导入角色「${a.name}」衣橱(${f.wardrobe_category})。`;const p=Yt.value.find(h=>h.profile_id===a.profileId);p&&await Kd(p,!0),d=!0}catch(f){Dt.value=`导入角色衣橱失败:${ge(f)}`}finally{kt.value=!1,d&&At("materialOperation")}}async function gp(e){if(Xa.value||!e.enabled)return;if(wt.value="",xt.value="",e.id==="workflow-bind"){xv();return}if(e.id==="create-category"){Sv();return}if(e.id==="upload"){bo("register-uri");return}if(e.id==="asset-pack"){bo("asset-pack");return}if(e.id==="wardrobe"){bo("wardrobe");return}if(e.id==="refresh"){Xa.value=e.id,await Ka(),Xa.value="",xt.value="素材库已刷新。";return}const a=Rr.value;if(!a||a.source!=="backend"){wt.value="需要先选中一条真实后端素材。";return}Xa.value=e.id;try{let r=null;e.id==="recognize"?(r=await ke(A.materialRecognize(a.id),{}),xt.value=`素材「${r.display_name}」已提交识别。`):e.id==="re-recognize"?(r=await ke(A.materialReRecognize(a.id),{}),xt.value=`素材「${r.display_name}」已重新识别。`):e.id==="confirm"?(r=await ke(A.materialConfirm(a.id),{display_name:a.label,prompt:a.prompt,negative_prompt:a.negativePrompt,tags:a.tags}),xt.value=`素材「${r.display_name}」已确认入库。`):wt.value=`不支持的素材操作:${e.id}`,r&&(yl.value=r.material_id),await Ka()}catch(r){wt.value=`${e.title}失败:${ge(r)}`}finally{Xa.value=""}}async function mu(e){if(nn.value||ln.value||!e.enabled&&e.id!=="refresh")return;const a=tl.value,r=nh(e.id,a);if(r){ln.value=r;return}await yp(e.id,a==null?void 0:a.task_id)}function nh(e,a){if(e==="delete"&&a)return{id:"delete",taskId:a.task_id,title:"删除终态队列记录",detail:`将删除「${Co(a)}」的队列记录,并释放节点对旧任务的引用。已经生成的图库图片不会删除。`,confirmLabel:"确认删除"};if(e==="clear-failed"){const r=Gt.value.length;return{id:"clear-failed",title:"清理异常记录",detail:r>100?`当前共有 ${r} 条失败、取消或死信记录,本次最多清理 100 条。`:`将清理当前 ${r} 条失败、取消或死信记录。`,confirmLabel:"确认清理"}}if(e==="clear-completed"){const r=yo.value.length;return{id:"clear-completed",title:"清理已完成记录",detail:r>100?`当前共有 ${r} 条已完成、成功或已替代记录,本次最多清理 100 条。生成图片会保留。`:`将清理当前 ${r} 条已完成、成功或已替代记录;生成图片会保留。`,confirmLabel:"确认清理"}}if(e==="clear-terminal"){const r=Sl.value.length;return{id:"clear-terminal",title:"清理全部终态记录",detail:r>100?`当前共有 ${r} 条终态记录,本次最多清理 100 条。运行中、排队中和重试中的任务不会删除。`:`将清理当前 ${r} 条终态记录;运行中、排队中和重试中的任务不会删除。`,confirmLabel:"确认清理终态"}}return null}function lh(){nn.value||(ln.value=null)}async function oh(){const e=ln.value;if(!(!e||nn.value))try{await yp(e.id,e.taskId)}finally{ln.value===e&&(ln.value=null)}}async function yp(e,a){var f,p;if(nn.value)return;if(Xt.value="",xa.value="",e==="refresh"){nn.value=e;try{await Promise.allSettled([ga(),In(),Ma()]),xa.value="队列已刷新。"}finally{nn.value=""}return}const r=Pi.value.find(h=>h.id===e),s=a?ta.value.find(h=>h.task_id===a)??null:tl.value,d=!!((f=de.value)!=null&&f.permissions.can_write&&((p=de.value)!=null&&p.permissions.can_retry_tasks));if(["delete","retry-all-failed","clear-failed","clear-completed","clear-terminal"].includes(e)&&!d){Xt.value="当前账号缺少任务清理权限,请刷新页面后重试。";return}if(e==="delete"&&(!s||!Sl.value.some(h=>h.task_id===s.task_id))){Xt.value="目标任务已不存在或状态已经变化,只有失败、取消、死信和已完成记录可以删除。";return}if(e==="retry-all-failed"&&Gt.value.length===0){Xt.value="当前已经没有可重试的失败、取消或死信记录。";return}if(e==="clear-failed"&&Gt.value.length===0){Xt.value="当前已经没有可清理的异常记录。";return}if(e==="clear-completed"&&yo.value.length===0){Xt.value="当前已经没有可清理的已完成记录。";return}if(e==="clear-terminal"&&Sl.value.length===0){Xt.value="当前已经没有可清理的终态记录。";return}nn.value=e;try{if(e==="retry"){if(!s)return;const h=await ke(A.jobRetry(s.task_id),{});$a.value=h.task_id,xa.value=`替代任务 ${Ta(h.task_id)} 已执行,状态:${sl(h.status)}。`}else if(e==="retry-all-failed"){const h=await ke(A.jobRetryFailed,{limit:100});xa.value=Wr(h,"失败任务已批量重试")}else if(e==="cancel"){if(!s)return;const h=await ke(A.jobCancel(s.task_id),{});$a.value=h.task_id,xa.value=`任务 ${Ta(h.task_id)} 已取消。`}else if(e==="delete"){if(!s)return;await Oc(A.jobDelete(s.task_id)),$a.value===s.task_id&&($a.value=""),xa.value=`「${Co(s)}」的队列记录已删除。`}else if(e==="clear-failed"){const h=await ke(A.jobClearFailed,{limit:100});xa.value=Wr(h,"异常任务记录已清理")}else if(e==="clear-completed"){const h=await ke(A.jobClearTerminal,{limit:100,statuses:["completed","succeeded","superseded"]});xa.value=Wr(h,"已完成任务记录已清理")}else if(e==="clear-terminal"){const h=await ke(A.jobClearTerminal,{limit:100});xa.value=Wr(h,"终态任务记录已清理")}else if(e==="dead-letter-retry"){const h=await ke(A.jobDeadLetterRetry,{limit:5});xa.value=Wr(h,"死信任务已重新执行")}else if(e==="failed-to-dead-letter"){const h=await ke(A.jobDeadLetterMoveFailed,{limit:50});xa.value=Wr(h,"失败任务已移入死信")}await Promise.allSettled([ga(),In(),Ma()])}catch(h){const T=h instanceof sa?se(h.details,"replacement_task_id"):"";T?($a.value=T,Xt.value=`${(r==null?void 0:r.title)??"队列操作"}失败:${ge(h)};失败的替代任务 ${Ta(T)} 已保留。`,await Promise.allSettled([ga(),In(),Ma()])):Xt.value=`${(r==null?void 0:r.title)??"队列操作"}失败:${ge(h)}`}finally{nn.value=""}}function Wr(e,a){const r=Number(e.total),s=Array.isArray(e.errors)?e.errors.length:0,d=Number.isFinite(r)?r:0,f=Et(e.remaining_by_status)?e.remaining_by_status:void 0,p=f?Object.values(f).reduce((O,Y)=>{const J=Number(Y);return O+(Number.isFinite(J)?J:0)},0):0,h=s?`,${s} 条处理失败`:"",T=p>0?`;仍有 ${p} 条,可继续清理`:"";return`${a} ${d} 条${h}${T}。`}function _p(e){return{all:"全部",completed:"完成",failed:"失败",warning:"警告",system:"系统"}[e]}function nr(e){return{done:"已完成",running:"生成中",waiting:"待开始",review:"待审核"}[e]}function Ga(e,a,r,s){const d=r.trim();return{key:e,label:a,value:d||"待补充",hint:s,status:d&&d!=="-"&&d!=="待补充"?"ready":"pending"}}function rh(){var a,r;const e=Us.value;return{id:"brief-import",step:"01",title:"导入粗略人设",detail:"选择已落库角色卡作为角色工作流输入。",status:e?"done":"waiting",badge:"Profile",model:"Backend profile",duration:e?"已导入":"待开始",imageId:"",prompt:Ue.value.basePrompt,phase:"输入",progress:e?100:0,queue:((a=he.value)==null?void 0:a.profileId)??"-",attempt:e?"1 / 1":"0 / 1",eta:e?"已完成":"待开始",input:((r=he.value)==null?void 0:r.name)??"-",result:e?"角色人设已导入,设定拆解节点已解锁":"等待导入当前角色人设",dependsOn:"无",outputCount:"1 张角色卡"}}function ih(e,a){var r;return{id:e.id,step:String(a+2).padStart(2,"0"),title:e.title,detail:e.detail,status:"waiting",badge:e.badge,model:"等待工作流创建",duration:"待解锁",imageId:"",prompt:e.detail,phase:e.phase,progress:0,queue:"尚未入队",attempt:"0 / 1",eta:"待解锁",input:"等待上一节点完成",result:"节点尚未解锁",dependsOn:a===0?"01 导入粗略人设":((r=hm[a-1])==null?void 0:r.title)??"上一节点",outputCount:"等待产物",round:e.canonicalNodeKey}}function sh(e,a){var p,h;const r=bt.value[e.node_id]??[],d=(e.selected_image_id?r.find(T=>T.image_id===e.selected_image_id):null)??r[0],f=e.metadata??{};return{id:xn(e),step:String(a+2).padStart(2,"0"),title:gu(e),detail:e.description||bp(e),status:wp(e.status,e),badge:dh(e),model:e.model_route||((p=xr.value)==null?void 0:p.label)||"Backend workflow",duration:se(f,"duration")||(e.status==="completed"?"已完成":"待运行"),imageId:(d==null?void 0:d.image_id)??"",imageIds:r.map(T=>T.image_id),prompt:e.prompt||bp(e),phase:e.step_name||e.node_key,progress:ch(e.status),queue:se(f,"last_task_id")||se(f,"queue")||"-",attempt:se(f,"attempt")||"-",eta:e.status==="running"||e.status==="queued"?"运行中":e.status==="completed"?"已完成":"待开始",input:se(f,"input")||((h=he.value)==null?void 0:h.name)||"-",result:se(f,"result")||(r.length?`${r.length} 张候选图`:nr(wp(e.status,e))),dependsOn:se(f,"depends_on")||"-",outputCount:r.length?`${r.length} 张`:"等待产物",round:e.step_name||e.node_key,lockedItems:se(f,"locked_items")||"-",decision:se(f,"decision")||"-"}}function xn(e){return Bc(e.node_key)??`backend-${e.node_key||e.node_id}`}function uh(e){const a=Cl.value.find(s=>s.id===e);if(a)return a.title;const r=Mr.value.find(s=>s.id===e);return r?r.title:e}function gu(e){const a={profile_brief:"LLM 拆解设定",prompt_plan:"提示词规划",material_bind:"参考素材绑定",headshot:"头像草稿",upper_body:"半身草稿",lower_body:"下半身草稿",full_body:"全身设定",turnaround:"表情与转面设定图",design_sheet:"姿势与细节设定图",style_lock:"高清修复与统一风格",profile_card:"入库",fast_profile:"LLM 拆解设定",fast_candidates:"快速候选图",fast_final:"最终角色图"},r=xo(e.node_key);return a[r]||a[e.node_key]||e.title}function bp(e){return e.description||e.node_key.replace(/_/g," ")}function dh(e){const a=xo(e.node_key);return a.includes("profile")||a.includes("brief")?a==="profile_card"?"Archive":"LLM":a.includes("final")||a.includes("pack")?"Archive":e.node_type==="generation"?"Image":e.node_type}function wp(e,a){const r=Be(e);return r==="selected"||r==="skipped"?"done":r==="completed"?a&&a.node_type==="generation"&&xo(a.node_key)!=="profile_card"?"review":"done":r==="running"||r==="queued"?"running":r==="failed"?"review":"waiting"}function ch(e){const a=Be(e);return a==="completed"||a==="selected"?100:a==="running"?68:a==="queued"?18:0}function fh(e){return e&&(e.id.includes("portrait")||e.id.includes("body")||e.id.includes("sheet"))?4:1}function hp(e){return e?e.id.includes("fullbody")||e.id.includes("body")?"3:4":e.id.includes("sheet")?"4:3":"1:1":"1:1"}function ko(e){return Na(e,a=>a.image_id)}function vh(e){return Na(e,a=>a.profileId||a.id)}function ph(e){return e.some(a=>a.status==="running")?"running":e.some(a=>a.status==="review")?"review":e.length&&e.every(a=>a.status==="done")?"done":"waiting"}function mh(e){if(!e.length)return 0;const a=e.reduce((r,s)=>r+(s.progress??0),0);return Math.round(a/e.length)}function kp(e){const a=Cl.value,r=a.findIndex(s=>s.id===e);if(!(r<=0))return a.slice(0,r).find(s=>!gh(s))}function gh(e){var f,p,h,T;if(e.id==="brief-import")return Us.value;const a=Xn.value.find(O=>xn(O)===e.id);if(!a)return!1;const r=Be(a.status);if(r==="selected"||r==="skipped"||r==="completed"&&(a.node_type==="planning"||a.node_type==="reference_binding"||xo(a.node_key)==="profile_card"))return!0;const s=(p=(f=Wt.value)==null?void 0:f.metadata)==null?void 0:p.character_execution;return Et(s)&&s.progression_version!==hM?a.node_key==="prompt_plan"?((h=a.metadata)==null?void 0:h.prompt_plan)!=null:a.node_key==="material_bind"?((T=a.metadata)==null?void 0:T.material_bindings)!=null:!1:!1}function xl(e){return!!kp(e)}function yh(e){return!!(e.nodes.length&&e.nodes.every(a=>xl(a.id)))}function _h(e,a,r){return a}function Co(e){return Cp(e).summary}function bh(e){return`${e.model_route||"未指定模型"} · ${Pp(e.task_type)} · ${Ta(e.task_id)}`}function Cp(e){var Te,Bt,la,un;const a=(Te=e.request)==null?void 0:Te.metadata,r=Et(a)?a:void 0,s=se(e.metadata,"task_summary")||se(r,"task_summary"),d=e.profile_id||se(r,"profile_id")||se(e.metadata,"profile_id"),f=e.workflow_id||se(r,"workflow_id"),p=e.node_id||se(r,"node_id"),h=d?Jg.value.get(d):void 0,T=d?Sa.value.find(oa=>oa.profileId===d):void 0,O=f?Xg.value.get(f):void 0,Y=p?Zg.value.get(p):void 0,J=((Bt=h==null?void 0:h.metadata)==null?void 0:Bt.system_key)===qi,Le=se(e.metadata,"profile_name")||se(r,"profile_name"),Me=J?"":Le||(h==null?void 0:h.name)||(T==null?void 0:T.name)||"",Oe=hh(e,r,Y),pe=se(r,"ui_node_id"),De=se(r,"source")||se(e.metadata,"source"),vt=se(e.metadata,"workflow_type")||se(r,"workflow_type")||(O==null?void 0:O.workflow_type)||"",Lt=se(e.metadata,"node_key")||se(r,"node_key"),_a=se(e.metadata,"node_title")||se(r,"node_title");let nt=Pp(e.task_type);Oe||vt===fn||(la=e.idempotency_key)!=null&&la.startsWith("web-quick-")?nt="快速角色":vt===Qa||pe||De==="standalone_web_workflow"?nt="角色工作流":(vt==="single_image"||J||(un=e.idempotency_key)!=null&&un.startsWith("web-single-"))&&(nt="单图生成");const ba=Oe?kh(Oe):_a?wh(_a):Y?gu(Y):pe?$p(pe):Lt?$p(Lt):nt==="单图生成"?"图片生成":"",na=se(e.metadata,"workflow_name")||se(r,"workflow_name")||(O==null?void 0:O.display_name)||(f?`${nt}工作流`:""),Ut=[nt];Me&&Ut.push(Me),ba&&!(nt==="单图生成"&&ba==="图片生成")&&Ut.push(ba);const $=se(e.metadata,"title");return Ut.length===1&&$&&Ut.push($),Ut.length===1&&na&&na!==`${nt}工作流`&&Ut.push(na),{category:nt,profileName:Me,workflowName:na,nodeName:ba,summary:s||Ut.join(" / ")||`任务 ${Ta(e.task_id)}`}}function wh(e){return e.replace(/^快速(?=头像|半身像|立绘|设定图)/,"")}function hh(e,a,r){var p;const d=[se(a,"quick_character_target"),se(e.metadata,"quick_character_target"),se(r==null?void 0:r.metadata,"quick_character_target"),(r==null?void 0:r.node_key)||""].find(h=>Pn.some(T=>T.nodeKey===h));if(d)return d;const f=e.idempotency_key||"";return((p=Pn.find(h=>f.endsWith(`-${h.nodeKey}`)))==null?void 0:p.nodeKey)||""}function kh(e){return{quick_avatar:"头像",quick_bust:"半身像",quick_stand:"立绘",quick_sheet:"设定图"}[e]||e.replace(/^quick_/,"").replace(/_/g," ")}function $p(e){return{"brief-import":"导入粗略人设","persona-split":"LLM 拆解设定","prompt-plan":"提示词规划","material-bind":"素材绑定","portrait-01":"头像草稿 01","portrait-02":"头像草稿 02","portrait-03":"头像草稿 03","portrait-04":"头像定稿","body-sheet":"全身设定","expression-sheet":"表情设定图","pose-sheet":"姿势设定图","hires-fix":"高清修复",archive:"角色入库"}[e]||e.replace(/^backend-/,"").replace(/[-_]/g," ")}function Pp(e){return{generation:"图片生成",image_generation:"图片生成",prompt_expansion:"提示词扩写",material_recognition:"素材识别"}[Be(e)]||e||"后台任务"}function Ti(e){const a=Ch(e)?e:null,r=a==null?void 0:a.width,s=a==null?void 0:a.height,d=r&&s?`${r}x${s}`:"-",f=(a==null?void 0:a.model_route)||(a==null?void 0:a.model_used)||"后端返回",p=(a==null?void 0:a.positive_prompt)||"后端最近图片,等待补充原始提示词",h=a!=null&&a.is_archived?"已归档":"已生成";return{...e,title:ya(e),prompt:p,model:f,size:d,seed:a!=null&&a.seed?String(a.seed):Ta(e.image_id),duration:"-",status:h,source:a!=null&&a.task_id?`任务 ${Ta(a.task_id)}`:"图库最近图片"}}function Ch(e){return"positive_prompt"in e||"is_archived"in e}function Rl(e,a,r,s,d=[4,3]){const[f,p,h]=s,T=String(e).padStart(2,"0"),O=Ip(a),Y=Ip(r.length>34?`${r.slice(0,34)}...`:r),[J,Le]=d,Me=J>0&&Le>0?J/Le:4/3,Oe=Me>=1?1200:Math.round(1200*Me),pe=Me>=1?Math.round(1200/Me):1200,De=Math.min(Oe,pe),vt=Math.round(De*.08),Lt=Math.round(vt*1.38),_a=Math.round(De*.045),nt=Math.max(42,Math.round(De*.065)),ba=Math.round(pe-vt*1.55),na=Math.min(pe-vt*.75,ba+Math.round(De*.07)),Ut=Math.round(vt+De*.075),$=Math.max(42,Math.round(De*.078)),Te=Math.max(20,Math.round(De*.034)),Bt=Math.max(22,Math.round(De*.035)),la=Math.max(74,Math.round(De*.13)),un=Oe-vt*2,oa=pe-vt*2,Aa=Oe-Lt*2,dn=pe-Lt*2,ll=Math.round(Oe*.72),$o=Math.round(pe*.22),ol=Math.round(De*.46),Po=Math.round(Oe*.22),rl=Math.round(pe*.69),b=Math.round(De*.24),re=Math.round(Oe-vt*1.4),le=`${J}:${Le}`,tt=`
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="${Oe}" height="${pe}" viewBox="0 0 ${Oe} ${pe}" preserveAspectRatio="xMidYMid meet">
|
||
<defs>
|
||
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
||
<stop offset="0%" stop-color="${f}" />
|
||
<stop offset="58%" stop-color="${p}" />
|
||
<stop offset="100%" stop-color="#111827" />
|
||
</linearGradient>
|
||
<radialGradient id="halo" cx="72%" cy="22%" r="55%">
|
||
<stop offset="0%" stop-color="${h}" stop-opacity="0.82" />
|
||
<stop offset="100%" stop-color="${h}" stop-opacity="0" />
|
||
</radialGradient>
|
||
<pattern id="grid" width="${nt}" height="${nt}" patternUnits="userSpaceOnUse">
|
||
<path d="M${nt} 0H0V${nt}" fill="none" stroke="#ffffff" stroke-opacity="0.13" stroke-width="2" />
|
||
</pattern>
|
||
</defs>
|
||
<rect width="${Oe}" height="${pe}" fill="url(#bg)" />
|
||
<rect width="${Oe}" height="${pe}" fill="url(#grid)" />
|
||
<circle cx="${ll}" cy="${$o}" r="${ol}" fill="url(#halo)" />
|
||
<circle cx="${Po}" cy="${rl}" r="${b}" fill="#ffffff" opacity="0.11" />
|
||
<rect x="${vt}" y="${vt}" width="${un}" height="${oa}" rx="${_a}" fill="#ffffff" opacity="0.14" />
|
||
<rect x="${Lt}" y="${Lt}" width="${Aa}" height="${dn}" rx="${Math.round(_a*.72)}" fill="#0f172a" opacity="0.24" />
|
||
<text x="${Lt+Math.round(De*.035)}" y="${Ut}" fill="#ffffff" opacity="0.72" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Bt}" font-weight="700">IMAGESTUDIO · 未生成 ${T}</text>
|
||
<text x="${Lt+Math.round(De*.035)}" y="${ba}" fill="#ffffff" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${$}" font-weight="800">${O}</text>
|
||
<text x="${Lt+Math.round(De*.035)}" y="${na}" fill="#ffffff" opacity="0.78" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Te}">${Y}</text>
|
||
<text x="${re}" y="${Ut+Math.round(De*.02)}" text-anchor="middle" fill="#ffffff" opacity="0.86" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${la}" font-weight="900">${T}</text>
|
||
<text x="${Oe-vt}" y="${pe-Math.round(vt*.35)}" text-anchor="end" fill="#ffffff" opacity="0.72" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Math.max(18,Math.round(De*.027))}" font-weight="800">${le}</text>
|
||
</svg>`;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(tt)}`}function Ip(e){return e.replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a]??a)}function ya(e){return"title"in e&&e.title?e.title:e.node_id||e.workflow_id||e.profile_id||Ta(e.image_id)}function ea(e){return sn(e.thumbnail_url)||sn(e.image_url)}function sn(e){const a=String(e||"").trim();if(!a)return"";const r=$h(a);if(!r)return a;const s=_t.value[a];if(s)return s;if(!Tt.has(a)){const d=Ph(a,r).finally(()=>{Tt.delete(a)});Tt.set(a,d)}return $u()==="plugin-bridge"?"":a}function $h(e){var a;try{const r=new URL(e,window.location.origin);return r.pathname.endsWith("/media/fetch")&&((a=r.searchParams.get("token"))==null?void 0:a.trim())||""}catch{return""}}async function Ph(e,a){try{const r=await be(A.mediaPayload,{token:a}),s=String(r.body_base64||"");if(!s)return;const d=s.replace(/-/g,"+").replace(/_/g,"/"),f=d.padEnd(Math.ceil(d.length/4)*4,"="),p=window.atob(f),h=new Uint8Array(p.length);for(let O=0;O<p.length;O+=1)h[O]=p.charCodeAt(O);const T=URL.createObjectURL(new Blob([h],{type:r.content_type||"application/octet-stream"}));Ca.add(T),_t.value={..._t.value,[e]:T}}catch(r){console.warn("ImageStudio media bridge failed",r)}}function Ih(e){if(e.status==="confirmed_unsupported")return!1;if(e.dialect==="openai_images"||e.dialect==="comfyui")return!0;const a=e.capabilities||{};return!!(a.text_to_image||a.image_generation||a.workflow_graph||Object.keys(a).some(r=>["text_to_image","image_generation","workflow_graph"].includes(r)))}function Sh(e,a,r){return Math.max(a,Math.min(r,e))}function xh(){try{const e=localStorage.getItem(on.theme);(e==="light"||e==="dark")&&(Qn.value=e),Zl.value=localStorage.getItem(on.primary)||Zl.value,eo.value=localStorage.getItem(on.accent)||eo.value;const a=localStorage.getItem(on.navigationPinned);$n.value=a===null||a==="true",an.value=Sp(localStorage.getItem(on.readNotifications)),$r.value=Sp(localStorage.getItem(on.dismissedNotifications))}catch{}kr.value=$n.value}function Rh(){try{localStorage.setItem(on.theme,Qn.value),localStorage.setItem(on.primary,Zl.value),localStorage.setItem(on.accent,eo.value),localStorage.setItem(on.navigationPinned,String($n.value)),localStorage.setItem(on.readNotifications,JSON.stringify(an.value)),localStorage.setItem(on.dismissedNotifications,JSON.stringify($r.value))}catch{}}function Sp(e){if(!e)return[];try{const a=JSON.parse(e);return Array.isArray(a)?a.filter(r=>typeof r=="string"):[]}catch{return[]}}function Ml(e,a){const r=bc(e);return r?`rgba(${r.r}, ${r.g}, ${r.b}, ${a})`:`rgba(118, 104, 232, ${a})`}function yc(e,a,r){const s=bc(e),d=bc(a);if(!s||!d)return e;const f=Math.min(1,Math.max(0,r));return`#${_c(s.r*(1-f)+d.r*f)}${_c(s.g*(1-f)+d.g*f)}${_c(s.b*(1-f)+d.b*f)}`}function _c(e){return Math.round(e).toString(16).padStart(2,"0")}function bc(e){const a=e.replace("#","");return/^[0-9a-fA-F]{6}$/.test(a)?{r:Number.parseInt(a.slice(0,2),16),g:Number.parseInt(a.slice(2,4),16),b:Number.parseInt(a.slice(4,6),16)}:null}function se(e,a){const r=e==null?void 0:e[a];return typeof r=="string"?r:""}function Mh(e){return!Et(e)||typeof e.task_id!="string"?null:{task_id:e.task_id,task_type:typeof e.task_type=="string"?e.task_type:"generation",status:typeof e.status=="string"?e.status:"created",progress:typeof e.progress=="number"?e.progress:0,created_at:typeof e.created_at=="string"?e.created_at:"",updated_at:typeof e.updated_at=="string"?e.updated_at:"",profile_id:typeof e.profile_id=="string"?e.profile_id:null,workflow_id:typeof e.workflow_id=="string"?e.workflow_id:null,node_id:typeof e.node_id=="string"?e.node_id:null,model_route:typeof e.model_route=="string"?e.model_route:null,idempotency_key:typeof e.idempotency_key=="string"?e.idempotency_key:null,request:Et(e.request)?e.request:void 0,result:Et(e.result)?e.result:void 0,metadata:Et(e.metadata)?e.metadata:void 0,error_message:typeof e.error_message=="string"?e.error_message:null}}function Ah(e){return!!e}function Et(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function Eh(e){return Na(e,a=>a.id)}function ge(e){return sv(e)}return(e,a)=>{var r,s,d,f,p,h,T,O,Y,J,Le,Me,Oe,pe,De,vt,Lt,_a,nt,ba,na,Ut;return y(),w("main",{class:oe(["navigation-shell",{"rail-collapsed":!kr.value}]),"aria-label":"ImageStudio workbench","data-theme":Qn.value,style:Kt(g_.value)},[Ee(M0,{items:ne(P$),"active-key":F.value,"plugin-version":((r=de.value)==null?void 0:r.plugin_version)??"v3",expanded:kr.value,pinned:$n.value,onSelect:G_,onReveal:Gd,onScheduleHide:a[0]||(a[0]=$=>Js()),onTogglePinned:Q_},null,8,["items","active-key","plugin-version","expanded","pinned"]),l("section",nP,[l("header",lP,[l("div",oP,[l("span",null,g(Qg.value.label),1),l("h1",null,g(((s=de.value)==null?void 0:s.display_name)??"ImageStudio 星图导航"),1)]),l("div",rP,[a[95]||(a[95]=l("span",{"aria-hidden":"true"},"⌕",-1)),xe(l("input",{ref_key:"searchInputRef",ref:Pf,"aria-label":"Search ImageStudio","onUpdate:modelValue":a[1]||(a[1]=$=>Is.value=$),type:"search",role:"combobox","aria-autocomplete":"list","aria-controls":"global-search-results","aria-expanded":tv.value,"aria-activedescendant":Xo.value.length?`global-search-option-${tn.value}`:void 0,placeholder:"搜索生成、队列、图库、设置(Ctrl K)",onFocus:zv,onInput:a[2]||(a[2]=$=>{hr.value=!0,tn.value=0}),onKeydown:[a[3]||(a[3]=Ol(Ot($=>Qv(1),["prevent"]),["down"])),a[4]||(a[4]=Ol(Ot($=>Qv(-1),["prevent"]),["up"])),Ol(Ot(rw,["prevent"]),["enter"]),a[5]||(a[5]=Ol($=>At("search"),["escape"]))]},null,40,iP),[[Ke,Is.value]]),tv.value?(y(),w("div",sP,[(y(!0),w(z,null,ue(Xo.value,($,Te)=>(y(),w("button",{key:$.title,id:`global-search-option-${Te}`,type:"button",role:"option",class:oe({active:tn.value===Te}),"aria-selected":tn.value===Te,onMouseenter:Bt=>tn.value=Te,onMousedown:Ot(Bt=>yv($),["prevent"])},[l("strong",null,g($.title),1),l("small",null,g($.description),1)],42,uP))),128)),Xo.value.length?ce("",!0):(y(),w("p",dP,"没有匹配结果"))])):ce("",!0)]),l("div",cP,[l("button",{type:"button",class:"theme-switch",role:"switch","aria-checked":Qn.value==="dark",title:Qn.value==="dark"?"切换日间":"切换夜间",onClick:J_},[l("span",{class:oe({active:Qn.value==="light"}),"aria-label":"日间"},[...a[96]||(a[96]=[l("i",{class:"ui-icon icon-sun","aria-hidden":"true"},null,-1)])],2),l("span",{class:oe({active:Qn.value==="dark"}),"aria-label":"夜间"},[...a[97]||(a[97]=[l("i",{class:"ui-icon icon-moon","aria-hidden":"true"},null,-1)])],2)],8,fP),l("div",vP,[l("button",{type:"button",class:"icon-button",title:"通知","aria-expanded":xs.value,"aria-controls":"notification-panel",onClick:a[6]||(a[6]=$=>gc("notifications"))},[a[98]||(a[98]=l("span",{class:"ui-icon icon-bell","aria-hidden":"true"},null,-1)),Od.value?(y(),w("b",mP,g(Od.value),1)):ce("",!0)],8,pP),l("div",gP,[a[99]||(a[99]=l("strong",null,"通知概览",-1)),l("ul",null,[(y(!0),w(z,null,ue(nv.value,($,Te)=>(y(),w("li",{key:$.id,style:Kt({"--card-index":Te})},[l("span",{class:oe(["dot",$.type])},null,2),l("span",null,g($.title),1)],4))),128)),nv.value.length?ce("",!0):(y(),w("li",yP,"暂无通知"))])])]),l("button",{type:"button",class:"icon-button",title:"调色盘","data-overlay-root":"palette","aria-expanded":Ss.value,"aria-controls":"palette-panel",onClick:a[7]||(a[7]=$=>gc("palette"))},[...a[100]||(a[100]=[l("span",{class:"ui-icon icon-palette","aria-hidden":"true"},null,-1)])],8,_P),l("div",bP,[l("button",{type:"button",class:"icon-button",title:"日志","aria-expanded":Rs.value,"aria-controls":"log-popover",onClick:a[8]||(a[8]=$=>gc("logs"))},[...a[101]||(a[101]=[l("span",{class:"ui-icon icon-file","aria-hidden":"true"},null,-1)])],8,wP),Ee(ha,{name:"overlay-pop"},{default:qt(()=>[Rs.value?(y(),w("div",hP,[l("header",null,[l("div",null,[a[102]||(a[102]=l("span",null,"日志",-1)),l("strong",null,g(no.value?"需要重试":`${ht.value.length+Ze.value.length} 条`),1)]),l("button",{type:"button",onClick:Ma},"刷新")]),no.value?(y(),ut(ir,{key:0,tone:"bad",title:"日志加载失败",detail:no.value},null,8,["detail"])):(y(),ut(hu,{key:1,tag:"ul",name:"card-list",class:"log-list"},{default:qt(()=>[(y(!0),w(z,null,ue(Ze.value.slice(0,4),($,Te)=>(y(),w("li",{key:`${$.source}-${$.id}`,style:Kt({"--card-index":Te})},[a[103]||(a[103]=l("span",{class:"dot failed"},null,-1)),l("span",null,g($.error_message||$.source),1)],4))),128)),(y(!0),w(z,null,ue(ht.value.slice(0,Math.max(0,4-Ze.value.length)),($,Te)=>(y(),w("li",{key:$.task_id,style:Kt({"--card-index":Te})},[a[104]||(a[104]=l("span",{class:"dot completed"},null,-1)),l("span",null,g($.task_id)+" / "+g(ne(sl)($.status)),1)],4))),128)),!Ze.value.length&&!ht.value.length?(y(),w("li",kP,"暂无日志")):ce("",!0)]),_:1}))])):ce("",!0)]),_:1})]),l("div",{class:oe(["backend-status-chip",xf.value]),title:G.value.detail,"aria-live":"polite"},[a[105]||(a[105]=l("span",{"aria-hidden":"true"},null,-1)),l("strong",null,g(G.value.label),1)],10,CP),l("button",{type:"button",class:"refresh-button",disabled:Sf.value,onClick:Si},g(Sf.value?"同步中":"刷新"),9,$P)])]),Hg.value?(y(),w("div",{key:0,class:oe(["backend-connection-banner",xf.value]),role:"status","aria-live":"polite"},[l("div",null,[l("strong",null,g(G.value.title),1),l("span",null,g(G.value.detail),1)]),l("button",{type:"button",onClick:Si},"重新检测")],2)):ce("",!0),Ee(ha,{name:"panel-drop"},{default:qt(()=>[Ss.value?(y(),w("section",PP,[l("div",null,[(y(),w(z,null,ue(Ie,$=>l("button",{key:$.name,type:"button",onClick:Te=>Kw($)},[l("span",{class:"swatch",style:Kt({background:$.primary})},null,4),l("span",{class:"swatch",style:Kt({background:$.accent})},null,4),Bl(" "+g($.name),1)],8,IP)),64))]),l("label",null,[a[106]||(a[106]=l("span",null,"主色",-1)),xe(l("input",{"onUpdate:modelValue":a[9]||(a[9]=$=>Zl.value=$),type:"color"},null,512),[[Ke,Zl.value]])]),l("label",null,[a[107]||(a[107]=l("span",null,"副色",-1)),xe(l("input",{"onUpdate:modelValue":a[10]||(a[10]=$=>eo.value=$),type:"color"},null,512),[[Ke,eo.value]])])])):ce("",!0)]),_:1}),Ee(ha,{name:"panel-drop"},{default:qt(()=>[xs.value?(y(),w("section",SP,[l("header",null,[l("div",null,[a[108]||(a[108]=l("span",null,"消息中心",-1)),l("h2",null,g(Od.value)+" 条未读",1)]),l("div",{class:"inline-actions"},[l("button",{type:"button",onClick:jw},"全部已读"),l("button",{type:"button",onClick:Gw},"清空已读")])]),l("div",xP,[(y(),w(z,null,ue(["all","completed","failed","warning","system"],$=>l("button",{key:$,type:"button",class:oe({active:yi.value===$}),"aria-pressed":yi.value===$,onClick:Te=>yi.value=$},g(_p($)),11,RP)),64))]),Ee(hu,{tag:"ul",name:"card-list",class:"notification-list"},{default:qt(()=>[(y(!0),w(z,null,ue(av.value,($,Te)=>(y(),w("li",{key:$.id,class:oe({unread:!an.value.includes($.id)}),style:Kt({"--card-index":Te})},[l("div",{class:oe(["notification-thumb",$.type])},[$.thumbnailUrl?(y(),w("img",{key:0,src:$.thumbnailUrl,alt:""},null,8,MP)):(y(),w("span",AP,g(_p($.type).slice(0,1)),1))],2),l("div",null,[l("strong",null,g($.title),1),l("small",null,g($.detail),1),l("time",null,g(ne(Tl)($.createdAt)),1)]),l("button",{type:"button",onClick:Bt=>Vw($.id)},g(an.value.includes($.id)?"已读":"标记"),9,EP)],6))),128)),av.value.length?ce("",!0):(y(),w("li",TP,"暂无通知"))]),_:1})])):ce("",!0)]),_:1}),F.value==="generate"?(y(),w("section",NP,[l("header",LP,[l("div",null,[a[109]||(a[109]=l("span",null,"生成工作台",-1)),l("h2",null,g(lv.value.label),1),l("p",null,g(lv.value.detail),1)]),l("div",BP,[(y(),w(z,null,ue(fe,$=>l("button",{key:$.key,type:"button",class:oe(["generate-mode-button",{active:H.value===$.key}]),"aria-pressed":H.value===$.key,onClick:Te=>bb($.key)},g($.label),11,qP)),64))])]),Ee(ha,{name:"panel-drop",mode:"out-in"},{default:qt(()=>{var $,Te,Bt,la,un,oa,Aa,dn,ll,$o,ol,Po,rl;return[(y(),w("section",{key:H.value,class:"generate-mode-page"},[H.value==="image"?(y(),w("section",OP,[l("section",DP,[l("aside",WP,[l("header",null,[l("div",null,[a[110]||(a[110]=l("span",null,"生成预览",-1)),l("h2",null,g(Ho.value.length)+" 张",1)])]),Ho.value.length?(y(),w("div",FP,[(y(!0),w(z,null,ue(Ho.value,b=>{var re;return y(),w("button",{key:b.image_id,type:"button",class:oe(["image-preview-card",{active:((re=aa.value)==null?void 0:re.image_id)===b.image_id}]),onClick:le=>U.value=b.image_id},[l("span",KP,[ea(b)?(y(),w("img",{key:0,src:ea(b),alt:ya(b)},null,8,VP)):(y(),w("span",jP,"IMG"))]),l("span",null,[l("strong",null,g(ya(b)),1),l("small",null,g(b.model)+" / "+g(ne(Tl)(b.created_at)),1)])],10,UP)}),128))])):(y(),w("div",GP,[...a[111]||(a[111]=[l("strong",null,"暂无生成预览",-1),l("span",null,"通过自然语言发起生成后,结果会进入这里。",-1)])]))]),l("section",HP,[l("div",zP,[aa.value&&ea(aa.value)?(y(),w("button",{key:0,type:"button",class:"image-stage-button",title:`打开 ${ya(aa.value)}`,onClick:Kv},[l("img",{src:ea(aa.value),alt:ya(aa.value)},null,8,YP)],8,QP)):(y(),w("div",JP,[...a[112]||(a[112]=[l("strong",null,"等待图片",-1),l("span",null,"左侧选择的结果会在这里放大显示。",-1)])]))]),l("aside",XP,[l("header",null,[a[113]||(a[113]=l("span",null,"图片信息",-1)),l("strong",null,g(aa.value?ya(aa.value):"未选择"),1)]),l("dl",null,[(y(!0),w(z,null,ue(ey.value,b=>(y(),w("div",{key:b.label},[l("dt",null,g(b.label),1),l("dd",null,g(b.value),1)]))),128))])])])]),l("form",{class:"image-chat-panel",onSubmit:Ot(ec,["prevent"])},[l("div",ZP,[a[114]||(a[114]=l("strong",null,"对话框",-1)),l("small",null,g(ye.value==="direct"?"原文会直接发送给生图模型,不经过 LLM 改写。":"先由设置中选定的文本 LLM 扩写,再发送给生图模型。"),1),l("div",eI,[l("button",{type:"button",class:oe({active:ye.value==="direct"}),"aria-pressed":ye.value==="direct",onClick:a[11]||(a[11]=b=>ye.value="direct")},"直接发送",10,tI),l("button",{type:"button",class:oe({active:ye.value==="llm"}),"aria-pressed":ye.value==="llm",onClick:a[12]||(a[12]=b=>ye.value="llm")},"LLM 扩写",10,aI)])]),l("div",nI,[l("div",lI,[xe(l("textarea",{"onUpdate:modelValue":a[13]||(a[13]=b=>te.value=b),rows:"3","aria-label":"描述想生成的图片",onKeydown:[Ol(Ot(ec,["ctrl","prevent"]),["enter"]),Ol(Ot(ec,["meta","prevent"]),["enter"])]},null,40,oI),[[Ke,te.value]]),te.value.trim()?ce("",!0):(y(),w("div",rI,[a[116]||(a[116]=l("p",null,[l("strong",null,"例如:"),l("span",null,"生成一张雨夜霓虹街头的半身角色图,黑色短发,电影感,高细节。")],-1)),l("p",null,[a[115]||(a[115]=l("strong",null,"最近请求:",-1)),l("span",iI,g(Fe.value?`${Fe.value} / ${at.value||"未选择模型"}`:"暂无"),1)])]))]),l("div",sI,[l("div",uI,[l("button",{type:"button",class:"composer-icon-button",disabled:!te.value.trim()||Pe.value,title:"扩写提示词","aria-label":"扩写提示词",onClick:N_},[...a[117]||(a[117]=[l("span",{"aria-hidden":"true"},"✨",-1)])],8,dI),l("button",{type:"button",class:"composer-icon-button",title:"打开模型设置","aria-label":"打开模型设置",onClick:a[14]||(a[14]=b=>Mt("settings","settings"))},[...a[118]||(a[118]=[l("span",{"aria-hidden":"true"},"◌",-1)])]),l("label",cI,[a[119]||(a[119]=l("span",{"aria-hidden":"true"},"⚡",-1)),xe(l("select",{"onUpdate:modelValue":a[15]||(a[15]=b=>jt.value=b),disabled:!io.value.length},[(y(!0),w(z,null,ue(io.value,b=>(y(),w("option",{key:b.value,value:b.value},g(b.provider)+" / "+g(b.label),9,vI))),128))],8,fI),[[Mn,jt.value]])]),Ja.value?(y(),w("span",pI,"生成中")):Dn.value?(y(),w("span",mI,g(Dn.value),1)):bd.value?(y(),w("button",{key:2,type:"button",class:"model-state model-state-link",onClick:a[16]||(a[16]=b=>Mt("settings","settings"))},g(bd.value),1)):ce("",!0)]),l("div",gI,[a[120]||(a[120]=l("span",{class:"composer-shortcut",title:"提交快捷键"},"Ctrl ↵",-1)),l("button",{type:"submit",class:"composer-send-button",title:ye.value==="direct"?"直接发送给生图模型":"交给 LLM 扩写并生成",disabled:!te.value.trim()||Ja.value||!xr.value},g(Ja.value?"...":"↑"),9,yI)])])])],32)])):H.value==="quickProfile"?(y(),w("section",_I,[l("section",bI,[l("aside",wI,[l("header",hI,[a[121]||(a[121]=l("div",null,[l("span",null,"全部角色档案")],-1)),l("em",null,g(he.value.status),1)]),l("div",kI,[l("button",{type:"button",class:"quick-profile-library-add-card",onClick:Dr},[...a[122]||(a[122]=[l("span",{class:"quick-profile-library-add-icon"},"+",-1),l("span",{class:"quick-profile-library-copy"},[l("strong",null,"添加档案"),l("small",null,"新建角色卡"),l("em",null,"填写问卷后加入档案列表")],-1)])]),(y(!0),w(z,null,ue(fo.value,(b,re)=>(y(),w("button",{key:b.id,type:"button","data-profile-card-id":b.id,class:oe({active:Ps.value===b.id}),onClick:le=>nu(b)},[l("span",$I,[l("img",{src:Rl(re+41,b.name,b.identity,b.colors),alt:b.name},null,8,PI)]),l("span",II,[l("strong",null,g(b.name),1),l("small",null,g(b.identity),1),l("em",null,g(b.personality),1)]),l("span",SI,g(b.updatedAt),1)],10,CI))),128))])]),l("article",xI,[a[128]||(a[128]=l("header",{class:"quick-profile-section-header"},[l("div",null,[l("span",null,"角色预览")]),l("em",null,"只读档案")],-1)),l("button",{type:"button",class:"quick-profile-curl-button",title:"打开角色设定详情","aria-label":"打开角色设定详情",onClick:iw},[...a[123]||(a[123]=[l("span",null,"详情",-1)])]),l("section",RI,[l("figure",{class:"quick-profile-profile-portrait",style:Kt(Wf.value)},[l("button",{type:"button",class:"quick-profile-portrait-button",title:`打开 ${vo.value.label}`,onClick:a[17]||(a[17]=b=>Gv(vo.value.id))},[vo.value.imageUrl?(y(),w("img",{key:0,src:vo.value.imageUrl,alt:vo.value.label},null,8,AI)):(y(),w("span",EI,"尚未生成"))],8,MI)],4),l("div",TI,[a[124]||(a[124]=l("span",null,"姓名",-1)),l("strong",null,g(Ue.value.name),1)]),l("div",NI,[a[125]||(a[125]=l("span",null,"身份",-1)),l("p",null,g(bl.value.identity),1)]),l("div",LI,[a[126]||(a[126]=l("span",null,"风格",-1)),l("p",null,g(Ue.value.stylePrompt||(($=wd.value)==null?void 0:$.label)),1)]),l("div",BI,[a[127]||(a[127]=l("span",null,"设定简介",-1)),l("p",null,g(Ue.value.basePrompt),1),l("small",null,g(Ue.value.appearancePrompt),1)])])]),l("aside",qI,[l("header",OI,[l("div",null,[l("span",null,g(Zt.value.detail),1),l("strong",null,g(Zt.value.label),1)]),a[129]||(a[129]=l("em",null,"角色图片",-1))]),l("figure",DI,[Ee(ha,{name:"quick-profile-image-swap"},{default:qt(()=>[(y(),w("button",{key:Zt.value.id,type:"button",class:"quick-profile-hero-button",title:`打开 ${Zt.value.label}`,onClick:a[18]||(a[18]=b=>Gv())},[Zt.value.imageUrl?(y(),w("img",{key:0,src:Zt.value.imageUrl,alt:Zt.value.label},null,8,FI)):(y(),w("span",UI,"点击“一键生成”创建角色图片"))],8,WI))]),_:1})]),l("div",KI,[(y(!0),w(z,null,ue(Yo.value,b=>(y(),w("button",{key:b.id,type:"button",class:oe({active:_l.value===b.id}),onClick:re=>Ev(b.id)},[l("span",null,[b.imageUrl?(y(),w("img",{key:0,src:b.imageUrl,alt:b.label},null,8,jI)):(y(),w("span",GI,"待生成"))]),l("strong",null,g(b.label),1),l("small",null,g(b.detail),1),l("em",null,g(b.state),1)],10,VI))),128))])]),l("section",HI,[l("header",zI,[a[130]||(a[130]=l("div",null,[l("span",null,"参考素材")],-1)),l("em",null,g(ay.value),1)]),l("div",QI,[(y(),w(z,null,ue(V,(b,re)=>{var le,tt,Ea;return l("div",{key:b.id,class:"quick-profile-material-slot"},[l("button",{type:"button","data-overlay-root":"materialPicker","data-material-category":b.category,class:oe(["quick-profile-material-card",{active:!!Sn(b.category),expanded:gt.value===b.category}]),"aria-expanded":gt.value===b.category,onClick:pt=>kv(b.category)},[l("span",{class:oe(["quick-profile-material-media",{empty:!Sn(b.category)}])},[Sn(b.category)&&Lr(Sn(b.category),re)?(y(),w("img",{key:0,src:Lr(Sn(b.category),re),alt:((le=Sn(b.category))==null?void 0:le.label)??b.category},null,8,JI)):(y(),w("span",XI,"无缩略图"))],2),l("span",ZI,[l("small",null,g(b.category),1),l("strong",null,g(((tt=Sn(b.category))==null?void 0:tt.label)??"不使用参考"),1),l("em",null,g(((Ea=Sn(b.category))==null?void 0:Ea.prompt)??"点击选择或添加素材参考"),1)])],10,YI),Ee(ha,{name:"material-picker-pop"},{default:qt(()=>[gt.value===b.category?(y(),w("aside",{key:0,class:oe(["quick-profile-material-picker",{accessory:b.category===Pt,filtered:Fs.value}]),"data-overlay-root":"materialPicker"},[l("header",eS,[l("div",null,[l("span",null,g(b.category)+"参考",1),a[131]||(a[131]=l("strong",null,"选择素材",-1))]),l("small",null,g(Lf.value),1)]),b.category===Pt?(y(),w("div",tS,[(y(!0),w(z,null,ue(Nf.value,pt=>(y(),w("button",{key:pt,type:"button",class:oe({active:Hl.value===pt}),onClick:Al=>hv(pt)},g(pt),11,aS))),128))])):ce("",!0),Ee(hu,{tag:"div",name:"material-choice-scale",class:oe(["quick-profile-material-picker-list",{accessory:b.category===Pt,filtered:Fs.value}])},{default:qt(()=>[l("button",{key:"none",type:"button","data-material-action":"none",class:oe(["quick-profile-material-picker-choice","none",{active:!Sn(gt.value)}]),onClick:a[19]||(a[19]=pt=>$v(gt.value))},[...a[132]||(a[132]=[l("span",{class:"quick-profile-material-none-icon"},"无",-1),l("span",{class:"quick-profile-material-picker-copy"},[l("strong",null,"不使用"),l("em",null,"取消这个素材参考")],-1)])],2),(y(!0),w(z,null,ue(Cd.value,(pt,Al)=>(y(),w("button",{key:pt.id,type:"button","data-material-reference-id":pt.id,class:oe(["quick-profile-material-picker-choice",{active:bv(pt)}]),onClick:xp=>Cv(pt)},[l("span",lS,[Lr(pt,Al)?(y(),w("img",{key:0,src:Lr(pt,Al),alt:pt.label},null,8,oS)):(y(),w("span",rS,"无缩略图"))]),l("span",iS,[gt.value===Pt?(y(),w("small",sS,g(wv(pt)),1)):ce("",!0),l("strong",null,g(pt.label),1),l("em",null,g(pt.prompt),1)])],10,nS))),128)),l("button",{key:"add",type:"button","data-material-action":"add",class:"quick-profile-material-picker-choice add",onClick:a[20]||(a[20]=pt=>Rv(gt.value))},[a[133]||(a[133]=l("span",{class:"quick-profile-material-add-icon"},"+",-1)),l("span",uS,[l("strong",null,"添加"+g(gt.value)+"素材",1),l("em",null,g(Bf.value),1)])])]),_:1},8,["class"])],2)):ce("",!0)]),_:2},1024)])}),64))])]),l("section",dS,[l("header",cS,[a[134]||(a[134]=l("div",null,[l("span",null,"功能按钮")],-1)),l("em",null,g(Ff.value.length)+" 项",1)]),l("div",fS,[(y(!0),w(z,null,ue(Ff.value,b=>(y(),w("article",{key:b.id,class:oe(["quick-profile-command-card",b.tone,{disabled:!b.enabled}])},[l("div",vS,[l("span",pS,g(Ny(b.badge)),1)]),l("strong",null,g(b.title),1),l("p",null,g(b.detail),1),b.id==="persona"?(y(),w("button",{key:0,type:"button",disabled:!b.enabled,onClick:fb},g(Ks(b)),9,mS)):b.id==="workflow"?(y(),w("button",{key:1,type:"button",disabled:!b.enabled,onClick:wb},g(Ks(b)),9,gS)):b.nav&&b.module?(y(),w("button",{key:2,type:"button",onClick:re=>Mt(b.nav,b.module)},g(Ks(b)),9,yS)):(y(),w("span",_S,g(Ks(b)),1))],2))),128))]),Za.value?(y(),w("p",bS,g(Za.value),1)):ce("",!0),jn.value?(y(),w("p",wS,g(jn.value),1)):ce("",!0)])]),Ee(ha,{name:"viewer-fade"},{default:qt(()=>[ps.value?(y(),w("div",hS,[l("section",kS,[l("figure",{class:"quick-profile-detail-card-portrait",style:Kt(Wf.value)},[vo.value.imageUrl?(y(),w("img",{key:0,src:vo.value.imageUrl,alt:Ue.value.name},null,8,CS)):(y(),w("span",$S,"尚未生成角色图片")),l("figcaption",null,[a[135]||(a[135]=l("span",null,"角色设定",-1)),l("strong",null,g(Ue.value.name),1)])],4),l("aside",PS,[l("header",null,[l("div",null,[l("span",null,g(he.value.status),1),l("strong",null,g(Ue.value.name)+" / 设定详情",1)]),l("button",{type:"button",title:"关闭",onClick:a[21]||(a[21]=b=>At("quickProfileDetail"))},"×")]),l("dl",null,[(y(!0),w(z,null,ue(my.value,b=>(y(),w("div",{key:b.label},[l("dt",null,g(b.label),1),l("dd",null,g(b.value),1)]))),128))])])])])):ce("",!0)]),_:1}),Ee(ha,{name:"viewer-fade"},{default:qt(()=>[to.value&&Ms.value==="quickProfile"&&Zt.value?(y(),w("div",{key:0,class:"image-viewer-backdrop quick-profile-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":`${Zt.value.label} 详情`},[l("section",SS,[l("div",{class:oe(["quick-profile-viewer-media",{dragging:Ko.value,zoomed:hl.value>1}]),style:Kt(Ay.value),onWheel:Ot(aw,["prevent"]),onDblclick:nw,onPointerdown:lw,onPointermove:ow,onPointerup:cc,onPointercancel:cc,onPointerleave:cc},[l("div",{class:oe(["quick-profile-viewer-frame",Ey.value]),style:Kt({transform:ty.value})},[l("img",{src:Zt.value.imageUrl,alt:Zt.value.label,draggable:"false"},null,8,xS)],6)],38),l("aside",RS,[l("header",null,[l("div",null,[l("span",null,g(Zt.value.state),1),l("strong",null,g(Ue.value.name)+" / "+g(Zt.value.label),1)]),l("button",{type:"button",title:"关闭",onClick:Hv},"关闭")]),l("dl",null,[(y(!0),w(z,null,ue(Ty.value,b=>(y(),w("div",{key:b.label},[l("dt",null,g(b.label),1),l("dd",null,g(b.value),1)]))),128))])])])],8,IS)):ce("",!0)]),_:1})])):(y(),w("section",MS,[l("section",AS,[(y(!0),w(z,null,ue(b_.value,b=>(y(),w("article",{key:b.label},[l("span",null,g(b.label),1),l("strong",null,g(b.value),1),l("small",null,g(b.hint),1)]))),128))]),Wt.value?(y(),ut(ne(m),{key:0,branches:Sy.value,"current-branch":Wt.value.current_branch||"main","node-labels":xy.value,loading:bs.value===Wt.value.workflow_id,"busy-branch":Gn.value,error:Oa.value,disabled:!My.value,onRefresh:a[22]||(a[22]=b=>Br(Wt.value.workflow_id)),onSwitch:gw},null,8,["branches","current-branch","node-labels","loading","busy-branch","error","disabled"])):ce("",!0),Ft.value&&Ae.value?(y(),ut(ne(K),{key:1,rounds:Sd.value,"selected-round-id":((Te=Ve.value)==null?void 0:Te.round.round_id)||"","active-round-id":jy.value,"requested-count":wr.value,loading:ci.value===Ae.value.node_id||!!br.value,busy:rd.value===Ae.value.node_id||Re.value,disabled:G.value.state!=="connected","read-only":Vs.value,"can-create-round":Xy.value,"create-hint":Zy.value,error:Je.value,message:hn.value,onRefresh:a[23]||(a[23]=b=>lc(Ae.value.node_id,!0)),onSelectRound:Tb,onStartRound:Wb,"onUpdate:requestedCount":a[24]||(a[24]=b=>wr.value=b)},null,8,["rounds","selected-round-id","active-round-id","requested-count","loading","busy","disabled","read-only","can-create-round","create-hint","error","message"])):ce("",!0),l("section",ES,[l("aside",TS,[l("header",NS,[l("div",null,[a[136]||(a[136]=l("span",null,"节点流程",-1)),l("strong",null,g(Mr.value.length)+" 大 / "+g(By.value)+" 小",1)]),l("em",null,g(nr(qe.value.status)),1)]),l("div",LS,[(y(!0),w(z,null,ue(Mr.value,b=>{var re;return y(),w("article",{key:b.id,class:oe(["workflow-node-group",b.status,{active:((re=Id.value)==null?void 0:re.id)===b.id,locked:yh(b)}])},[l("button",{type:"button",class:"workflow-group-card",disabled:!b.previewNodeId,onClick:le=>al(b.previewNodeId)},[l("span",qS,g(b.step),1),l("span",OS,[l("small",null,g(nr(b.status))+" / "+g(b.badge),1),l("strong",null,g(b.title),1),l("em",null,g(b.detail),1),l("span",DS,[l("i",{style:Kt({width:`${b.progress}%`})},null,4)]),l("span",WS,[l("b",null,g(b.summary),1),l("b",null,g(b.outputCount),1),l("b",null,g(b.eta),1)])])],8,BS),b.nodes.length?(y(),w("div",FS,[(y(!0),w(z,null,ue(b.nodes,(le,tt)=>(y(),w("button",{key:le.id,type:"button",class:oe(["workflow-subnode-card",le.status,{active:qe.value.id===le.id,locked:xl(le.id)}]),"aria-label":xl(le.id)?`${le.title},未解锁,可查看`:le.title,onClick:Ea=>al(le.id)},[l("span",KS,g(String(tt+1).padStart(2,"0")),1),l("span",VS,[l("small",null,[xl(le.id)?(y(),w("span",jS,"⌁")):ce("",!0),Bl(" 节点 "+g(String(tt+1).padStart(2,"0"))+" / "+g(xl(le.id)?"未解锁":nr(le.status)),1)]),l("strong",null,g(le.title),1),l("em",null,g(le.outputCount??le.eta??le.duration),1)])],10,US))),128))])):ce("",!0)],2)}),128))])]),l("section",GS,[l("header",HS,[l("div",null,[a[137]||(a[137]=l("span",null,"主预览",-1)),l("strong",null,g(qy.value),1)]),Ci.value?(y(),w("div",zS,[l("em",null,g(Hs.value)+" / "+g(Gs.value)+" 字段",1)])):Nd.value?(y(),w("div",QS,[l("em",null,g(Xf.value.length)+" 条提示词",1)])):Ld.value?(y(),w("div",YS,[l("em",null,g(Fa.value.length)+" 类参考",1)])):Td.value?(y(),w("div",e2,[...a[138]||(a[138]=[l("em",null,"人设导入工作台",-1)])])):(y(),w("div",JS,[l("em",null,g(Ua.value.length)+" 对比 / "+g(rn.value.length)+" 候选",1),Ft.value?(y(),w("button",{key:0,type:"button",class:"workflow-review-trigger",disabled:!Qy.value||ma.value,onClick:Qb},g(ma.value?"加载审查…":"生成式交叉审查"),9,XS)):ce("",!0),Ft.value?(y(),w("button",{key:1,type:"button",class:"workflow-material-trigger",onClick:Lb}," 节点素材 ")):ce("",!0),l("button",{type:"button",class:"workflow-compare-trigger",disabled:Ua.value.length<2,onClick:Vv}," 平铺对比 ",8,ZS)]))]),Td.value?(y(),w("section",t2,[l("article",{class:"workflow-profile-import-card create"},[l("button",{type:"button",class:"workflow-profile-import-create-action",title:"打开角色档案问卷","aria-label":"打开角色档案问卷",onClick:Dr}," + "),a[139]||(a[139]=l("div",{class:"workflow-profile-import-copy"},[l("span",null,"新建"),l("strong",null,"新建粗略人设"),l("p",null,"从空白问卷开始,填写角色核心、性格、外观、服装、场景和规避项,然后作为本工作流的基础档案。")],-1))]),l("article",a2,[l("header",null,[a[140]||(a[140]=l("div",null,[l("span",null,"已有角色卡"),l("strong",null,"选择当前角色卡作为幕布输入")],-1)),l("em",null,g(fo.value.length)+" 张",1)]),l("div",n2,[(y(!0),w(z,null,ue(fo.value,(b,re)=>(y(),w("button",{key:b.id,type:"button","data-profile-card-id":b.id,class:oe({active:Ps.value===b.id}),onClick:le=>nu(b)},[l("span",{class:"workflow-profile-import-profile-portrait",style:Kt(_v(b.colors)),"aria-hidden":"true"},null,4),l("span",o2,[a[141]||(a[141]=l("small",null,"姓名",-1)),l("strong",null,g(b.name),1)]),l("span",r2,[a[142]||(a[142]=l("small",null,"身份",-1)),l("strong",null,g(b.identity),1)]),l("span",i2,[a[143]||(a[143]=l("small",null,"风格",-1)),l("strong",null,g(b.style||"未设定"),1)]),l("span",s2,[a[144]||(a[144]=l("small",null,"设定简介",-1)),l("strong",null,g(X_(b)),1),l("em",null,g(b.status)+" / "+g(b.updatedAt),1)])],10,l2))),128))])]),l("aside",u2,[a[148]||(a[148]=l("span",null,"当前导入",-1)),l("strong",null,g(he.value.name),1),l("p",null,g(he.value.identity),1),l("dl",null,[l("div",null,[a[145]||(a[145]=l("dt",null,"风格",-1)),l("dd",null,g(he.value.style||((Bt=wd.value)==null?void 0:Bt.label)),1)]),l("div",null,[a[146]||(a[146]=l("dt",null,"素材",-1)),l("dd",null,g(Fa.value.length)+" 类参考",1)]),l("div",null,[a[147]||(a[147]=l("dt",null,"状态",-1)),l("dd",null,g(he.value.status),1)])])])])):Ci.value?(y(),w("section",d2,[(y(!0),w(z,null,ue($i.value,b=>(y(),w("section",{key:b.id,class:"workflow-persona-split-group"},[l("header",null,[l("div",null,[l("span",null,g(b.title),1),l("strong",null,g(b.detail),1)]),l("em",null,g(b.fields.filter(re=>re.status==="ready").length)+" / "+g(b.fields.length),1)]),l("div",c2,[(y(!0),w(z,null,ue(b.fields,re=>(y(),w("article",{key:re.key,class:oe(["workflow-persona-split-field",re.status])},[l("span",null,g(re.label),1),l("strong",null,g(re.value),1),l("small",null,g(re.hint),1),l("em",null,g(re.status==="ready"?"已拆解":"待补充"),1)],2))),128))])]))),128)),a[149]||(a[149]=l("aside",{class:"workflow-persona-split-note"},[l("span",null,"后续流向"),l("strong",null,"确认字段后进入提示词规划"),l("p",null,"这些字段会作为头像、半身、全身、设定图和风格锁定节点的共同输入。真实后端返回更细字段后,可以继续映射到这里。")],-1))])):Nd.value?(y(),w("section",f2,[l("section",v2,[(y(!0),w(z,null,ue(Xf.value,b=>(y(),w("article",{key:b.id,class:"workflow-prompt-plan-card"},[l("header",null,[l("div",null,[l("span",null,g(b.target),1),l("strong",null,g(b.title),1)]),l("em",null,g(b.status),1)]),l("p",null,g(b.prompt),1),l("dl",null,[l("div",null,[a[150]||(a[150]=l("dt",null,"继承字段",-1)),l("dd",null,[(y(!0),w(z,null,ue(b.inherits,re=>(y(),w("span",{key:re},g(re),1))),128))])]),l("div",null,[a[151]||(a[151]=l("dt",null,"权重建议",-1)),l("dd",null,g(b.weight),1)]),l("div",null,[a[152]||(a[152]=l("dt",null,"负面词",-1)),l("dd",null,g(b.negative),1)])])]))),128))]),l("aside",p2,[(y(!0),w(z,null,ue(r_.value,b=>(y(),w("article",{key:b.label},[l("span",null,g(b.label),1),l("strong",null,g(b.value),1),l("em",null,g(b.status==="ready"?"已准备":"待处理"),1)]))),128))])])):Ld.value?(y(),w("section",m2,[(y(!0),w(z,null,ue(i_.value,(b,re)=>(y(),w("article",{key:b.category,class:"workflow-material-bind-card","data-overlay-root":"materialPicker"},[l("button",{type:"button",class:"workflow-material-bind-main",disabled:Rd.value,"data-material-category":b.category,"aria-expanded":gt.value===b.category,onClick:le=>kv(b.category)},[l("span",{class:"workflow-material-bind-swatch",style:Kt(_v(b.colors)),"aria-hidden":"true"},null,4),l("span",y2,[l("small",null,g(b.category)+" / "+g(b.strength)+"参考",1),l("strong",null,g(b.selectedLabel),1),l("em",null,g(b.selectedPrompt),1)]),l("b",null,g(b.required?"强制继承":"可选"),1)],8,g2),l("div",_2,[(y(!0),w(z,null,ue(b.stages,le=>(y(),w("span",{key:le.stage_id},g(le.stage_title),1))),128))]),Ee(ha,{name:"material-picker-pop"},{default:qt(()=>[gt.value===b.category?(y(),w("aside",{key:0,class:oe(["quick-profile-material-picker","workflow-material-picker",{accessory:b.category===Pt,filtered:Fs.value}]),"data-overlay-root":"materialPicker"},[l("header",b2,[l("div",null,[l("span",null,g(b.category)+"参考",1),a[153]||(a[153]=l("strong",null,"选择素材",-1))]),l("small",null,g(Lf.value),1)]),b.category===Pt?(y(),w("div",w2,[(y(!0),w(z,null,ue(Nf.value,le=>(y(),w("button",{key:le,type:"button",class:oe({active:Hl.value===le}),onClick:tt=>hv(le)},g(le),11,h2))),128))])):ce("",!0),Ee(hu,{tag:"div",name:"material-choice-scale",class:oe(["quick-profile-material-picker-list",{accessory:b.category===Pt,filtered:Fs.value}])},{default:qt(()=>[l("button",{key:"none",type:"button","data-material-action":"none",class:oe(["quick-profile-material-picker-choice","none",{active:!Sn(gt.value)}]),onClick:a[25]||(a[25]=le=>$v(gt.value))},[...a[154]||(a[154]=[l("span",{class:"quick-profile-material-none-icon"},"无",-1),l("span",{class:"quick-profile-material-picker-copy"},[l("strong",null,"不使用"),l("em",null,"默认不注入这个参考")],-1)])],2),(y(!0),w(z,null,ue(Cd.value,(le,tt)=>(y(),w("button",{key:le.id,type:"button","data-material-reference-id":le.id,class:oe(["quick-profile-material-picker-choice",{active:bv(le)}]),onClick:Ea=>Cv(le)},[l("span",C2,[Lr(le,tt)?(y(),w("img",{key:0,src:Lr(le,tt),alt:le.label},null,8,$2)):(y(),w("span",P2,"无缩略图"))]),l("span",I2,[le.advanced?(y(),w("small",S2,"进阶素材 · 高优先级")):gt.value===Pt?(y(),w("small",x2,g(wv(le)),1)):ce("",!0),l("strong",null,g(le.label),1),l("em",null,g(le.prompt),1)])],10,k2))),128)),l("button",{key:"add",type:"button","data-material-action":"add",class:"quick-profile-material-picker-choice add",onClick:a[26]||(a[26]=le=>Rv(gt.value))},[a[155]||(a[155]=l("span",{class:"quick-profile-material-add-icon"},"+",-1)),l("span",R2,[l("strong",null,"添加"+g(gt.value)+"素材",1),l("em",null,g(Bf.value),1)])])]),_:1},8,["class"])],2)):ce("",!0)]),_:2},1024)]))),128))])):Ft.value?(y(),ut(ne(_),{key:4,candidates:mo.value,"round-display-code":((la=Ve.value)==null?void 0:la.round.display_code)||"","round-status":((un=Ve.value)==null?void 0:un.round.status)||"","focused-candidate-id":Fn.value,"compared-candidate-ids":Ia.value,"final-candidate-id":Ct.value,"confirmed-candidate-id":Hy.value,"feedback-by-candidate-id":qa.value,"image-url-by-candidate-id":Gy.value,"busy-candidate-ids":zy.value,"max-compared":5,"max-liked":3,"image-fit":Hf.value,loading:!!br.value||ci.value===((oa=Ae.value)==null?void 0:oa.node_id),busy:!!vi.value,disabled:G.value.state!=="connected","read-only":!!((Aa=Ve.value)!=null&&Aa.read_only),confirmed:ne(Be)(((dn=Ve.value)==null?void 0:dn.round.status)||"")==="confirmed"||Jo.value,error:Je.value,"empty-text":"当前轮次还没有候选;提交后各候选会独立更新。",onFocus:Pb,onPreview:Ib,onToggleCompare:Tv,onSetFeedback:lu,onSetFinal:Sb,onRetry:Fb},null,8,["candidates","round-display-code","round-status","focused-candidate-id","compared-candidate-ids","final-candidate-id","confirmed-candidate-id","feedback-by-candidate-id","image-url-by-candidate-id","busy-candidate-ids","image-fit","loading","busy","disabled","read-only","confirmed","error"])):(y(),w("div",M2,[el.value?(y(),w("button",{key:0,type:"button",class:"workflow-preview-main",title:`打开 ${ya(el.value)}`,onClick:a[27]||(a[27]=b=>du(el.value.image_id))},[ea(el.value)?(y(),w("img",{key:0,src:ea(el.value),alt:ya(el.value)},null,8,E2)):ce("",!0),l("span",T2,[Bl(" 当前聚焦 / "+g(ya(el.value))+" ",1),Ct.value===ft(el.value)?(y(),w("b",N2,"已定稿")):ce("",!0)])],8,A2)):(y(),w("div",L2,[l("strong",null,g(rn.value.length?"选择候选图":"等待节点结果"),1),l("span",null,g(rn.value.length?"点击下方候选进行聚焦或加入对比。":"节点生成完成后,候选会显示在这里。"),1)]))])),!l_.value&&!Ft.value?(y(),w("section",B2,[a[156]||(a[156]=l("header",null,[l("span",null,"候选池"),l("em",null,"点击候选加入对比;喜欢、拒绝与定稿彼此独立")],-1)),l("div",q2,[(y(!0),w(z,null,ue(rn.value,(b,re)=>(y(),w("article",{key:b.image_id,class:oe({active:Ia.value.includes(ft(b)),focused:Fn.value===ft(b),final:Ct.value===ft(b)})},[l("button",{type:"button",class:"workflow-draft-select",disabled:Pl.value,"aria-pressed":Ia.value.includes(ft(b)),onClick:le=>Tv(ft(b))},[l("span",D2,[ea(b)?(y(),w("img",{key:0,src:ea(b),alt:ya(b)},null,8,W2)):ce("",!0),l("em",null,g(String(re+1).padStart(2,"0")),1),Ia.value.includes(ft(b))?(y(),w("strong",F2,"对比")):ce("",!0),Ct.value===ft(b)?(y(),w("b",U2,"定稿")):ce("",!0)]),l("span",K2,[l("strong",null,"候选 "+g(String(re+1).padStart(2,"0")),1),l("small",null,g(b.model)+" / "+g(b.status),1)])],8,O2),l("div",V2,[l("button",{type:"button",class:oe({active:Ri(ft(b))==="liked"}),disabled:Pl.value,onClick:le=>lu(ft(b),"liked")}," 喜欢 ",10,j2),l("button",{type:"button",class:oe({active:Ri(ft(b))==="rejected"}),disabled:Pl.value,onClick:le=>lu(ft(b),"rejected")}," 拒绝 ",10,G2),l("button",{type:"button",class:oe({active:Ri(ft(b))==="strict_rejected"}),disabled:Pl.value,onClick:le=>lu(ft(b),"strict_rejected")}," 严格拒绝 ",10,H2),l("button",{type:"button",class:oe(["workflow-candidate-final",{active:Ct.value===ft(b)}]),disabled:Pl.value,"aria-pressed":Ct.value===ft(b),onClick:le=>Nv(ft(b))},g(Ct.value===ft(b)?"取消定稿":"定稿"),11,z2)])],2))),128))])])):ce("",!0)]),l("aside",{class:oe(["workflow-surface workflow-detail-panel",{"persona-split":Ci.value}])},[l("header",Q2,[a[157]||(a[157]=l("div",null,[l("span",null,"节点详情"),l("strong",null,"参数与提示词")],-1)),l("em",null,g(qe.value.badge),1)]),l("div",Y2,[Ci.value?(y(),w("article",J2,[l("header",null,[l("div",null,[a[158]||(a[158]=l("span",null,"LLM 拆解设定",-1)),l("strong",null,g(he.value.name),1)]),l("em",null,g(qe.value.badge),1)]),l("p",null,g(qe.value.detail),1),l("dl",null,[(y(!0),w(z,null,ue(o_.value,b=>(y(),w("div",{key:b.label},[l("dt",null,g(b.label),1),l("dd",null,g(b.value),1),l("small",null,g(b.hint),1)]))),128))])])):(y(),w("dl",X2,[(y(!0),w(z,null,ue(c_.value,b=>(y(),w("div",{key:b.label},[l("dt",null,g(b.label),1),l("dd",null,g(b.value),1)]))),128))])),Ra.value?(y(),w("section",Z2,[a[159]||(a[159]=l("span",null,"未解锁 · 可查看",-1)),l("strong",null,g(qe.value.title),1),l("p",null,g($l.value),1)])):Jo.value?(y(),w("section",ex,[a[160]||(a[160]=l("span",null,"已锁定",-1)),l("strong",null,g(qe.value.title),1),l("p",null,g(go.value),1)])):Zn.value?(y(),w("section",tx,[a[161]||(a[161]=l("span",null,"待确认",-1)),l("strong",null,g(qe.value.title),1),l("p",null,g(go.value),1)])):ce("",!0),Ae.value?(y(),ut(ne(k),{key:5,context:Ry.value,loading:hs.value===Ae.value.node_id,error:di.value,locked:Zn.value||Ra.value,onRefresh:Jv},null,8,["context","loading","error","locked"])):ce("",!0),l("section",ax,[l("header",null,[a[162]||(a[162]=l("span",null,"工作流操作",-1)),Re.value||Wo.value?(y(),w("em",nx,"执行中")):me.value||Oa.value?(y(),w("em",lx,g(me.value||Oa.value),1)):ui.value?(y(),w("em",ox,"加载中")):Ql.value?(y(),w("em",rx,g(Ql.value),1)):(y(),w("em",ix,g(Zf.value.length)+" 项",1))]),l("div",sx,[l("span",null,g(Yl.value||"生命周期"),1),l("button",{disabled:en.value||!((ll=he.value)!=null&&ll.workflowId)||!Us.value,title:"导入粗略人设后自动启动",onClick:a[28]||(a[28]=b=>fc("start"))},"启动",8,ux),l("button",{disabled:en.value||!(($o=he.value)!=null&&$o.workflowId),onClick:a[29]||(a[29]=b=>fc("cancel"))},"取消",8,dx),l("button",{disabled:en.value||!((ol=he.value)!=null&&ol.workflowId),onClick:a[30]||(a[30]=b=>fc("archive"))},"归档",8,cx),l("button",{disabled:en.value||!((Po=he.value)!=null&&Po.workflowId),onClick:pw},"整体审查",8,fx),l("button",{disabled:en.value||!Ae.value,onClick:Jv},"节点依赖",8,vx)]),ld.value?(y(),w("pre",px,g(JSON.stringify(ld.value,null,2)),1)):ce("",!0),l("div",mx,[(y(!0),w(z,null,ue(Zf.value,b=>(y(),w("article",{key:b.id,class:oe(["workflow-action-card",b.tone,{disabled:!b.enabled}])},[l("div",null,[l("span",gx,g(f_(b.badge)),1)]),l("strong",null,g(b.title),1),l("p",null,g(b.detail),1),b.actionKey||b.nav&&b.module?(y(),w("button",{key:0,type:"button",disabled:!b.enabled,onClick:re=>uw(b)},g(ev(b)),9,yx)):(y(),w("span",_x,g(ev(b)),1))],2))),128))])])])],2)]),Ee(ne(I),{prompt:_n.value,"context-summary":s_.value,"node-title":qe.value.title,"node-phase":qe.value.phase,"has-round-candidates":!!(Ft.value&&((rl=Ve.value)!=null&&rl.candidates.length)),"last-prompt":ed.value,"last-model":td.value,"model-override":Ar.value,"effective-image-model":xd.value,"effective-image-source":Kf.value,"text-model":Uy.value,"model-options":Vf.value,"model-status-message":po.value.route?"":bd.value,disabled:Rd.value,busy:Re.value,"submit-disabled":!Jf.value&&Ft.value&&!po.value.route,"onUpdate:prompt":a[31]||(a[31]=b=>_n.value=b),"onUpdate:modelOverride":Ab,onSubmit:Hb,onOpenSettings:a[32]||(a[32]=b=>Mt("settings","settings")),onOpenMaterials:a[33]||(a[33]=b=>Mt("materials","images"))},null,8,["prompt","context-summary","node-title","node-phase","has-round-candidates","last-prompt","last-model","model-override","effective-image-model","effective-image-source","text-model","model-options","model-status-message","disabled","busy","submit-disabled"])])),Ee(ha,{name:"viewer-fade"},{default:qt(()=>[ms.value?(y(),w("div",bx,[l("section",wx,[l("header",null,[a[163]||(a[163]=l("div",null,[l("span",null,"外部角色卡"),l("strong",null,"粘贴文本并识别为角色档案")],-1)),l("button",{type:"button",title:"关闭",onClick:a[34]||(a[34]=b=>At("externalProfileImport"))},"×")]),l("div",hx,[l("div",kx,[l("label",Cx,[a[164]||(a[164]=l("span",null,"从文档导入",-1)),l("input",{type:"file",accept:".md,.markdown,.txt,text/markdown,text/plain",onChange:Ww},null,32)]),gs.value?(y(),w("em",$x,g(gs.value),1)):ce("",!0),nd.value?(y(),w("small",Px,"正在让文本模型整理角色档案…")):qo.value?(y(),w("small",Ix,g(qo.value),1)):ce("",!0)]),l("label",Sx,[a[165]||(a[165]=l("span",null,"原始文本",-1)),xe(l("textarea",{"onUpdate:modelValue":a[35]||(a[35]=b=>oi.value=b),"data-profile-import-input":"",rows:"14",placeholder:`姓名:星港绘理\r
|
||
身份:近未来港区巡查员\r
|
||
性格:冷静、可靠、行动快\r
|
||
外观:黑色短发,青绿色眼睛\r
|
||
服装:轻机能外套、短靴、发光臂章\r
|
||
避雷:低质量、结构错误`},null,512),[[Ke,oi.value]])]),l("aside",xx,[l("header",null,[l("div",null,[a[166]||(a[166]=l("span",null,"识别预览",-1)),l("strong",null,g(zg.value)+" / "+g(yd.value.length),1)]),l("em",null,g(Sr.value?`${Sr.value.length} 字`:"待粘贴"),1)]),l("dl",null,[(y(!0),w(z,null,ue(yd.value,b=>(y(),w("div",{key:b.key,class:oe({pending:Sr.value&&!b.recognized})},[l("dt",null,[Bl(g(b.label)+" ",1),l("span",null,g(b.recognized?"已识别":"待整理"),1)]),l("dd",null,g(b.value||"粘贴文本后显示"),1)],2))),128))])])]),l("footer",null,[l("span",null,g(Sr.value?"识别结果会先填入问卷,仍可在问卷里继续微调。":"等待外部角色卡文本。"),1),l("button",{type:"button",onClick:a[36]||(a[36]=b=>At("externalProfileImport"))},"取消"),l("button",{type:"button",disabled:!Sr.value,onClick:Fw}," 识别并填入问卷 ",8,Rx)])])])):ce("",!0)]),_:1}),Ee(ha,{name:"viewer-fade"},{default:qt(()=>[vs.value?(y(),w("div",Mx,[l("section",Ax,[l("header",null,[a[167]||(a[167]=l("div",null,[l("span",null,"快速角色"),l("strong",null,"创建角色档案问卷")],-1)),l("button",{type:"button",title:"关闭",onClick:a[37]||(a[37]=b=>At("personaQuestionnaire"))},"×")]),l("div",Ex,[l("label",null,[a[168]||(a[168]=l("span",null,"角色核心",-1)),xe(l("textarea",{"onUpdate:modelValue":a[38]||(a[38]=b=>Ce.value.roleCore=b),rows:"3",placeholder:"角色名、身份、核心定位,可以只写一句。"},null,512),[[Ke,Ce.value.roleCore]])]),l("label",Tx,[a[170]||(a[170]=l("span",null,"性别表现",-1)),xe(l("select",{"onUpdate:modelValue":a[39]||(a[39]=b=>Ce.value.genderPresentation=b)},[...a[169]||(a[169]=[l("option",{value:""},"未指定",-1),l("option",{value:"female"},"女性 / Female",-1),l("option",{value:"male"},"男性 / Male",-1),l("option",{value:"androgynous"},"中性 / Androgynous",-1),l("option",{value:"nonbinary"},"非二元 / Nonbinary",-1)])],512),[[Mn,Ce.value.genderPresentation]])]),l("label",Nx,[a[171]||(a[171]=l("span",null,"年龄阶段",-1)),xe(l("input",{"onUpdate:modelValue":a[40]||(a[40]=b=>Ce.value.ageStage=b),type:"text",placeholder:"例如 adult、young adult、middle-aged"},null,512),[[Ke,Ce.value.ageStage]])]),l("label",Lx,[a[172]||(a[172]=l("span",null,"物种 / 种族",-1)),xe(l("input",{"onUpdate:modelValue":a[41]||(a[41]=b=>Ce.value.species=b),type:"text",placeholder:"例如 human、elf、android"},null,512),[[Ke,Ce.value.species]])]),l("label",Bx,[a[173]||(a[173]=l("span",null,"体型",-1)),xe(l("input",{"onUpdate:modelValue":a[42]||(a[42]=b=>Ce.value.bodyType=b),type:"text",placeholder:"例如 slim、athletic、muscular"},null,512),[[Ke,Ce.value.bodyType]])]),l("label",null,[a[174]||(a[174]=l("span",null,"显著特征",-1)),xe(l("textarea",{"onUpdate:modelValue":a[43]||(a[43]=b=>Ce.value.distinctiveFeatures=b),rows:"3",placeholder:"伤疤、异色瞳、义体、角、纹身或固定视觉记忆点。"},null,512),[[Ke,Ce.value.distinctiveFeatures]])]),l("label",null,[a[175]||(a[175]=l("span",null,"性格关键词",-1)),xe(l("textarea",{"onUpdate:modelValue":a[44]||(a[44]=b=>Ce.value.personality=b),rows:"3",placeholder:"外显性格、内在矛盾、行动方式。"},null,512),[[Ke,Ce.value.personality]])]),l("label",null,[a[176]||(a[176]=l("span",null,"外观特征",-1)),xe(l("textarea",{"onUpdate:modelValue":a[45]||(a[45]=b=>Ce.value.appearance=b),rows:"3",placeholder:"发色、发型、眼睛、五官和视觉记忆点。"},null,512),[[Ke,Ce.value.appearance]])]),l("label",null,[a[177]||(a[177]=l("span",null,"服装与配饰",-1)),xe(l("textarea",{"onUpdate:modelValue":a[46]||(a[46]=b=>Ce.value.outfit=b),rows:"3",placeholder:"服装风格、配饰、武器或随身物。"},null,512),[[Ke,Ce.value.outfit]])]),l("label",null,[a[178]||(a[178]=l("span",null,"常用场景",-1)),xe(l("textarea",{"onUpdate:modelValue":a[47]||(a[47]=b=>Ce.value.scene=b),rows:"3",placeholder:"常驻地点、画面背景、适合出现的环境。"},null,512),[[Ke,Ce.value.scene]])]),l("label",null,[a[179]||(a[179]=l("span",null,"避雷内容",-1)),xe(l("textarea",{"onUpdate:modelValue":a[48]||(a[48]=b=>Ce.value.avoid=b),rows:"3",placeholder:"不想要的设计方向、负面词和禁用元素。"},null,512),[[Ke,Ce.value.avoid]])]),Kn.value==="advanced"?(y(),w(z,{key:0},[l("label",null,[a[180]||(a[180]=l("span",null,"世界观",-1)),xe(l("textarea",{"onUpdate:modelValue":a[49]||(a[49]=b=>Ce.value.worldview=b),rows:"3",placeholder:"现代、赛博、奇幻、末世、校园、古风、星际等。"},null,512),[[Ke,Ce.value.worldview]])]),l("label",null,[a[181]||(a[181]=l("span",null,"背景经历",-1)),xe(l("textarea",{"onUpdate:modelValue":a[50]||(a[50]=b=>Ce.value.background=b),rows:"3",placeholder:"所属组织、过往经历、当前处境。"},null,512),[[Ke,Ce.value.background]])]),l("label",null,[a[182]||(a[182]=l("span",null,"身高 / 身材",-1)),xe(l("textarea",{"onUpdate:modelValue":a[51]||(a[51]=b=>Ce.value.heightBuild=b),rows:"3",placeholder:"身高范围、体型、姿态气质、肤色。"},null,512),[[Ke,Ce.value.heightBuild]])]),l("label",null,[a[183]||(a[183]=l("span",null,"身体记忆点",-1)),xe(l("textarea",{"onUpdate:modelValue":a[52]||(a[52]=b=>Ce.value.bodyFeatures=b),rows:"3",placeholder:"伤疤、痣、纹身、义体、异色瞳等。"},null,512),[[Ke,Ce.value.bodyFeatures]])]),l("label",null,[a[184]||(a[184]=l("span",null,"喜好",-1)),xe(l("textarea",{"onUpdate:modelValue":a[53]||(a[53]=b=>Ce.value.likes=b),rows:"3",placeholder:"颜色、食物、饮品、兴趣、常去地点。"},null,512),[[Ke,Ce.value.likes]])]),l("label",null,[a[185]||(a[185]=l("span",null,"排斥 / 害怕",-1)),xe(l("textarea",{"onUpdate:modelValue":a[54]||(a[54]=b=>Ce.value.dislikes=b),rows:"3",placeholder:"不喜欢、害怕、排斥或会回避的东西。"},null,512),[[Ke,Ce.value.dislikes]])]),l("label",null,[a[186]||(a[186]=l("span",null,"生活习惯",-1)),xe(l("textarea",{"onUpdate:modelValue":a[55]||(a[55]=b=>Ce.value.habits=b),rows:"3",placeholder:"熬夜、洁癖、收集癖、整理装备等。"},null,512),[[Ke,Ce.value.habits]])]),l("label",null,[a[187]||(a[187]=l("span",null,"关系",-1)),xe(l("textarea",{"onUpdate:modelValue":a[56]||(a[56]=b=>Ce.value.relationships=b),rows:"3",placeholder:"重要关系人、同伴、敌对关系、想保护的人。"},null,512),[[Ke,Ce.value.relationships]])]),l("label",null,[a[188]||(a[188]=l("span",null,"故事钩子",-1)),xe(l("textarea",{"onUpdate:modelValue":a[57]||(a[57]=b=>Ce.value.storyHooks=b),rows:"3",placeholder:"未完成目标、秘密、可延展的事件线索。"},null,512),[[Ke,Ce.value.storyHooks]])]),l("label",null,[a[189]||(a[189]=l("span",null,"画风方向",-1)),xe(l("textarea",{"onUpdate:modelValue":a[58]||(a[58]=b=>Ce.value.generationStyle=b),rows:"3",placeholder:"赛璐璐、厚涂、电影感、设定集、轻小说插画等。"},null,512),[[Ke,Ce.value.generationStyle]])]),l("label",null,[a[190]||(a[190]=l("span",null,"镜头偏好",-1)),xe(l("textarea",{"onUpdate:modelValue":a[59]||(a[59]=b=>Ce.value.shotPreference=b),rows:"3",placeholder:"头像、半身、全身、立绘、设定图、多角度。"},null,512),[[Ke,Ce.value.shotPreference]])]),l("label",null,[a[191]||(a[191]=l("span",null,"氛围",-1)),xe(l("textarea",{"onUpdate:modelValue":a[60]||(a[60]=b=>Ce.value.mood=b),rows:"3",placeholder:"明亮、压抑、柔和、危险、神圣、孤独等。"},null,512),[[Ke,Ce.value.mood]])]),l("label",qx,[a[192]||(a[192]=l("span",null,"补充备注",-1)),xe(l("textarea",{"onUpdate:modelValue":a[61]||(a[61]=b=>Ce.value.extraNotes=b),rows:"3",placeholder:"其他需要保留给后端工作流的补充设定。"},null,512),[[Ke,Ce.value.extraNotes]])])],64)):ce("",!0)]),l("footer",null,[l("span",null,g(ii.value||"生成后会调用后端保存角色档案、创建 quick_profile 工作流,并自动选中角色卡。"),1),l("div",Ox,[l("div",Dx,[l("button",{type:"button",class:oe({active:Kn.value==="simple"}),onClick:a[62]||(a[62]=b=>Kn.value="simple")}," 简单问卷 ",2),l("button",{type:"button",class:oe({active:Kn.value==="advanced"}),onClick:a[63]||(a[63]=b=>Kn.value="advanced")}," 复杂问卷 ",2)]),l("button",{type:"button",disabled:!Df.value||ri.value,onClick:Ew},g(ri.value?"保存中":"生成档案"),9,Wx)])])])])):ce("",!0)]),_:1})]))]}),_:1})])):F.value==="profiles"?(y(),ut(ne(u),{key:2,"data-module":"profiles",profiles:ki.value,"selected-id":((d=dt.value)==null?void 0:d.profile_id)??"","selected-profile":dt.value,"selected-avatar-url":qf.value,"image-targets":ky.value,"selected-image-id":ys.value,loading:cd.value||_i.value,error:G.value.state==="connected"?fd.value:"","backend-connected":G.value.state==="connected","can-write":!!((f=de.value)!=null&&f.permissions.can_write),"material-count":Py.value,"selected-workflows-count":$y.value,"workflow-node-count":Iy.value,"wardrobe-items":$d.value,"wardrobe-materials":Of.value,"material-categories":St.value,"wardrobe-permissions":hy.value,"wardrobe-loading":wy.value,"wardrobe-busy":!!C.value,"wardrobe-error":yy.value,"generation-busy":by.value,"generation-error":_y.value,deleting:_s.value===((p=dt.value)==null?void 0:p.profile_id),onSelect:Yd,onSelectImage:a[64]||(a[64]=$=>ys.value=$),onRetry:A_,onCreate:hb,onImport:kb,onEdit:a[65]||(a[65]=$=>_b("quickProfile")),onGenerate:a[66]||(a[66]=$=>Xd("quick")),onWorkflow:gb,onDelete:yb,onMaterials:Cb,onWardrobeRetry:cb,onWardrobeAdd:ub,onWardrobeRemove:db},null,8,["profiles","selected-id","selected-profile","selected-avatar-url","image-targets","selected-image-id","loading","error","backend-connected","can-write","material-count","selected-workflows-count","workflow-node-count","wardrobe-items","wardrobe-materials","material-categories","wardrobe-permissions","wardrobe-loading","wardrobe-busy","wardrobe-error","generation-busy","generation-error","deleting"])):F.value==="materials"?(y(),w("section",Fx,[l("header",Ux,[l("div",null,[a[193]||(a[193]=l("span",null,"素材库",-1)),l("h2",null,g(ly.value),1),l("p",null,g(oy.value),1)]),W.value==="standard"?(y(),w("div",Kx,[l("button",{type:"button",disabled:Yn.value,onClick:a[67]||(a[67]=$=>gp(Tf.value[0]))},g(Yn.value?"同步中":"刷新素材"),9,Vx),l("button",{type:"button",onClick:xv},"进入素材绑定")])):(y(),w("div",jx,[l("button",{type:"button",onClick:a[68]||(a[68]=$=>Tr("advanced"))},"查看进阶素材"),l("button",{type:"button",onClick:a[69]||(a[69]=$=>Tr("advanced-import"))},"新建进阶导入")]))]),l("nav",Gx,[l("button",{type:"button",class:oe({active:W.value==="standard"}),"aria-pressed":W.value==="standard",onClick:a[70]||(a[70]=$=>Tr("standard"))},[...a[194]||(a[194]=[l("strong",null,"普通素材库",-1),l("small",null,"快速识别与直接确认",-1)])],10,Hx),l("button",{type:"button",class:oe({active:W.value==="advanced"}),"aria-pressed":W.value==="advanced",onClick:a[71]||(a[71]=$=>Tr("advanced"))},[...a[195]||(a[195]=[l("strong",null,"进阶素材库",-1),l("small",null,"验证通过的高优先级素材",-1)])],10,zx),l("button",{type:"button",class:oe({active:W.value==="advanced-import"}),"aria-pressed":W.value==="advanced-import",onClick:a[72]||(a[72]=$=>Tr("advanced-import"))},[...a[196]||(a[196]=[l("strong",null,"进阶导入",-1),l("small",null,"识别、验证生图与多轮调整",-1)])],10,Qx)]),W.value==="standard"?(y(),w(z,{key:0},[Ee(Cu,{cards:fy.value,"section-class":"materials-status-grid"},null,8,["cards"]),wt.value||xt.value?(y(),ut(ir,{key:0,class:"materials-page-message",tone:wt.value?"bad":"good",title:wt.value?"素材接口提示":"素材操作完成",detail:wt.value||xt.value,"action-label":"重新加载",busy:Yn.value,onAction:Ka},null,8,["tone","title","detail","busy"])):ce("",!0),l("section",Yx,[l("div",Jx,[l("section",Xx,[l("header",null,[l("div",null,[a[197]||(a[197]=l("span",null,"素材列表",-1)),l("h2",null,g(zo.value.length)+" 条素材",1)]),l("div",Zx,[l("em",null,g(Yn.value?"同步中":G.value.state==="connected"?"后端素材":"后端未连接"),1),l("button",{type:"button",class:"materials-primary-add",onClick:a[73]||(a[73]=$=>bo("upload-image"))},[...a[198]||(a[198]=[l("span",null,"+",-1),Bl(" 添加素材 ",-1)])])])]),l("div",eR,[(y(!0),w(z,null,ue(uo.value,$=>(y(),w("button",{key:$.id,type:"button",class:oe(["materials-category-chip",$.tone,{active:kd.value===$.id}]),title:`${$.label} / ${$.detail} / ${$.endpoint}`,"aria-pressed":kd.value===$.id,onClick:Te=>rb($.id)},[l("strong",null,g($.label),1),l("b",null,g($.count),1)],10,tR))),128)),l("button",{type:"button",class:"materials-category-chip add",title:((h=co.value)==null?void 0:h.label)===Pt?"打开添加配饰子类卡片 / POST material-categories":"打开添加分类卡片 / POST material-categories",onClick:Sv},[l("strong",null,g(((T=co.value)==null?void 0:T.label)===Pt?"添加子类":"添加分类"),1),a[199]||(a[199]=l("b",null,"+",-1))],8,aR)]),l("div",nR,[l("label",null,[a[201]||(a[201]=l("span",null,"身体槽位",-1)),xe(l("select",{"onUpdate:modelValue":a[74]||(a[74]=$=>ni.value=$)},[a[200]||(a[200]=l("option",{value:""},"全部槽位",-1)),(y(!0),w(z,null,ue(ne(kf),$=>(y(),w("option",{key:$.value,value:$.value},g($.label),9,lR))),128))],512),[[Mn,ni.value]])]),l("label",null,[a[203]||(a[203]=l("span",null,"穿着层级",-1)),xe(l("select",{"onUpdate:modelValue":a[75]||(a[75]=$=>li.value=$)},[a[202]||(a[202]=l("option",{value:""},"全部层级",-1)),(y(),w(z,null,ue(["skin","inner","base","middle","outer","overlay","accessory","prop"],$=>l("option",{key:$,value:$},g($),9,oR)),64))],512),[[Mn,li.value]])]),l("label",null,[a[205]||(a[205]=l("span",null,"最低置信度",-1)),xe(l("select",{"onUpdate:modelValue":a[76]||(a[76]=$=>ss.value=$)},[...a[204]||(a[204]=[l("option",{value:0},"不限",-1),l("option",{value:.6},"≥ 0.60 可参与生成",-1),l("option",{value:.8},"≥ 0.80 高置信",-1)])],512),[[Mn,ss.value,void 0,{number:!0}]])]),l("button",{type:"button",onClick:a[77]||(a[77]=$=>{ni.value="",li.value="",ss.value=0})},"清除筛选")]),Os.value.length?(y(),w("div",rR,[a[206]||(a[206]=l("span",null,"配饰子类",-1)),(y(!0),w(z,null,ue(Os.value,$=>{var Te;return y(),w("button",{key:$.id,type:"button",class:oe({active:kd.value===((Te=Qo.value)==null?void 0:Te.id)&&yn.value===$.id}),"aria-pressed":yn.value===$.id,onClick:Bt=>ib($.id)},[l("strong",null,g($.label),1),l("b",null,g($.count),1)],10,iR)}),128))])):ce("",!0),Yn.value&&!wi.value.length?(y(),w("div",sR,[(y(),w(z,null,ue(6,$=>l("span",{key:$})),64))])):zo.value.length?(y(),w("div",uR,[(y(!0),w(z,null,ue(zo.value,$=>{var Te;return y(),w("button",{key:$.id,type:"button",class:oe(["materials-library-card",ob($.status),{active:((Te=Rr.value)==null?void 0:Te.id)===$.id}]),onClick:Bt=>sw($.id)},[l("span",cR,[l("img",{src:$.imageUrl,alt:$.label},null,8,fR)]),l("span",vR,[l("small",null,g($.category)+" / "+g($.statusText),1),l("strong",null,g($.label),1),l("em",null,g($.prompt||"等待识别后写入提示词"),1)]),l("span",pR,[(y(!0),w(z,null,ue($.tags.slice(0,3),Bt=>(y(),w("b",{key:Bt},g(Bt),1))),128))])],10,dR)}),128))])):(y(),ut(Ec,{key:3,title:"暂无素材",detail:"登记 storage:// 素材 URI 或导入素材包后,后端素材记录会显示在这里。"},{actions:qt(()=>[l("button",{type:"button",onClick:a[78]||(a[78]=$=>bo("upload-image"))},"添加素材"),l("button",{type:"button",onClick:a[79]||(a[79]=$=>bo("register-uri"))},"登记素材 URI"),l("button",{type:"button",onClick:a[80]||(a[80]=$=>bo("asset-pack"))},"导入素材包")]),_:1}))])]),l("aside",mR,[l("section",gR,[a[207]||(a[207]=l("header",null,[l("div",null,[l("span",null,"后端动作"),l("h2",null,"素材接入点")])],-1)),l("div",yR,[(y(!0),w(z,null,ue(Tf.value,$=>(y(),w("button",{key:$.id,type:"button",class:oe(["materials-action-card",$.tone]),disabled:!$.enabled,onClick:Te=>gp($)},[l("span",null,g($.badge),1),l("strong",null,g($.title),1),l("small",null,g($.detail),1),l("em",null,g($.action),1),l("i",null,g($.endpoint),1)],10,_R))),128))])])])]),Ee(oC,{open:ds.value,title:uy.value,"is-accessory-group":Ds.value,"parent-label":dy.value,"endpoint-label":cy.value,busy:Gl.value,error:zl.value,"draft-name":cs.value,"draft-note":fs.value,"onUpdate:draftName":a[81]||(a[81]=$=>cs.value=$),"onUpdate:draftNote":a[82]||(a[82]=$=>fs.value=$),onSubmit:sb,onClose:a[83]||(a[83]=$=>At("materialCategoryCreate"))},null,8,["open","title","is-accessory-group","parent-label","endpoint-label","busy","error","draft-name","draft-note"]),Ee(RC,{open:us.value,item:Rr.value,rows:vy.value,material:hi.value,onSaveProfile:Zw,onClose:a[84]||(a[84]=$=>At("materialDetail"))},null,8,["open","item","rows","material"])],64)):(y(),ut(ne(n),{key:1,mode:W.value,categories:St.value,"can-manage":!!((O=de.value)!=null&&O.permissions.can_manage_materials),onNavigate:Tr,onChanged:H_},null,8,["mode","categories","can-manage"]))])):F.value==="queue"?(y(),w("section",bR,[l("header",wR,[a[208]||(a[208]=l("div",null,[l("span",null,"任务队列"),l("h2",null,"生成调度工作台"),l("p",null,"集中查看图片生成、快速角色和角色工作流节点的任务状态,失败任务会浮到处理区。")],-1)),l("div",hR,[l("button",{type:"button",disabled:Da.value,onClick:a[85]||(a[85]=$=>mu(Pi.value[0]))},g(Da.value?"同步中":"刷新队列"),9,kR),l("button",{type:"button",onClick:a[86]||(a[86]=$=>Mt("generate","generate"))},"新建生成")])]),Ee(Cu,{cards:p_.value,"section-class":"queue-status-grid"},null,8,["cards"]),Xt.value||xa.value?(y(),ut(ir,{key:0,class:"queue-page-error",tone:Xt.value?"bad":"good",title:Xt.value?"队列接口提示":"队列操作完成",detail:Xt.value||xa.value,"action-label":"重新加载",busy:Da.value,onAction:a[87]||(a[87]=$=>mu(Pi.value[0]))},null,8,["tone","title","detail","busy"])):ce("",!0),l("section",CR,[l("article",$R,[l("header",null,[l("div",null,[a[209]||(a[209]=l("span",null,"任务列表",-1)),l("h2",null,g(_o.value.length)+" 条任务",1)]),l("div",PR,[(y(!0),w(z,null,ue(v_.value,$=>(y(),w("button",{key:$.key,type:"button",role:"tab",class:oe({active:Wn.value===$.key}),"aria-selected":Wn.value===$.key,onClick:Te=>Wn.value=$.key},[l("span",null,g($.label),1),l("b",null,g($.count),1)],10,IR))),128))])]),Da.value&&!ta.value.length?(y(),w("div",SR,[(y(),w(z,null,ue(5,$=>l("span",{key:$})),64))])):_o.value.length?(y(),w("div",xR,[(y(!0),w(z,null,ue(_o.value,$=>{var Te;return y(),w("button",{key:$.task_id,type:"button",class:oe(["queue-task-card",ne(Nc)($.status),{active:((Te=tl.value)==null?void 0:Te.task_id)===$.task_id}]),onClick:Bt=>$a.value=$.task_id},[l("span",MR,g(ne(sl)($.status)),1),l("span",AR,[l("strong",null,g(Co($)),1),l("small",null,g(bh($)),1),l("i",ER,[l("span",{style:Kt({width:`${ne(ku)($)}%`})},null,4)])]),l("span",TR,[l("b",null,g(ne(ku)($))+"%",1),l("small",null,g(ne(Lc)($)),1)])],10,RR)}),128))])):(y(),w("div",NR,[...a[210]||(a[210]=[l("strong",null,"当前筛选下没有任务",-1),l("span",null,"切换筛选或新建生成任务后,这里会显示后端队列记录。",-1)])]))]),l("aside",LR,[l("section",BR,[l("header",null,[l("div",null,[a[211]||(a[211]=l("span",null,"任务详情",-1)),l("h2",null,g(tl.value?Co(tl.value):"未选中"),1)]),tl.value?(y(),w("span",{key:0,class:oe(["status-pill",ne(Nc)(tl.value.status)])},g(ne(sl)(tl.value.status)),3)):ce("",!0)]),l("dl",null,[(y(!0),w(z,null,ue(m_.value,$=>(y(),w("div",{key:$.label},[l("dt",null,g($.label),1),l("dd",null,g($.value),1)]))),128))])]),l("section",qR,[a[212]||(a[212]=l("header",null,[l("div",null,[l("span",null,"处理动作"),l("h2",null,"后端接入点")])],-1)),l("div",OR,[(y(!0),w(z,null,ue(Pi.value,$=>(y(),w("button",{key:$.id,type:"button",class:oe(["queue-action-card",$.tone]),disabled:!$.enabled,onClick:Te=>mu($)},[l("span",null,g($.badge),1),l("strong",null,g($.title),1),l("small",null,g($.detail),1),l("em",null,g($.action),1)],10,DR))),128))])])])])])):F.value==="gallery"?(y(),ut(ne(o),{key:5,images:Rf.value,"selected-id":we.value,loading:kl.value||sd.value,error:Ls.value,"backend-connected":G.value.state==="connected",onSelect:a[88]||(a[88]=$=>we.value=$),onRefresh:T_,onCreate:a[89]||(a[89]=$=>Mt("generate","generate")),onReuse:z_},null,8,["images","selected-id","loading","error","backend-connected"])):F.value==="settings"?(y(),ut(ne(c),{key:6,schema:Bn.value,current:ze.value,snapshots:zt.value,validation:qn.value,loading:Ns.value,busy:Go.value,error:Jn.value,message:lo.value,"backend-connected":G.value.state==="connected","can-manage":!!((Y=de.value)!=null&&Y.permissions.can_manage_config),"plugin-version":((J=de.value)==null?void 0:J.plugin_version)??"v3","model-count":Vl.value.length,onRefresh:Fd,onValidate:D_,onSave:W_,onReload:F_},null,8,["schema","current","snapshots","validation","loading","busy","error","message","backend-connected","can-manage","plugin-version","model-count"])):F.value==="logs"?(y(),ut(ne(i),{key:7,generation:ht.value,workflows:it.value,errors:Ze.value,integrations:He.value,audit:Ba.value,loading:Ts.value,error:no.value,"backend-connected":G.value.state==="connected","can-audit":!!((Le=de.value)!=null&&Le.permissions.can_manage_config),onRefresh:Ma},null,8,["generation","workflows","errors","integrations","audit","loading","error","backend-connected","can-audit"])):F.value!=="performance"?(y(),w(z,{key:8},[l("section",WR,[l("div",FR,[l("span",null,g(((Me=de.value)==null?void 0:Me.dashboard_user)??"AstrBot"),1),a[213]||(a[213]=l("h2",null,"星图导航工作台",-1)),a[214]||(a[214]=l("p",null,"生成、队列、图库和运行监控都在同一屏聚合。",-1))]),(y(!0),w(z,null,ue(qd.value.slice(0,3),$=>(y(),w("article",{key:$.label,class:oe(["signal-card",$.state])},[l("span",null,g($.label),1),l("strong",null,g($.value),1),l("small",null,g($.hint),1)],2))),128)),l("button",{type:"button",class:"quick-create",onClick:a[90]||(a[90]=$=>Mt("generate","generate"))},[...a[215]||(a[215]=[l("span",{"aria-hidden":"true"},"+",-1),Bl(" 新建生成 ",-1)])])]),l("section",UR,[l("div",KR,[l("section",VR,[l("header",null,[l("div",null,[a[216]||(a[216]=l("span",null,"性能监控",-1)),l("h2",null,g(Wa.value?"需要重试":ne(sl)(((Oe=E.value)==null?void 0:Oe.plugin_status)??"loading")),1)]),l("button",{type:"button",onClick:a[91]||(a[91]=$=>Mt("performance","performance"))},"详情")]),Wa.value?(y(),ut(ir,{key:0,tone:"bad",title:"监控加载失败",detail:Wa.value,"action-label":"重试",busy:kl.value,onAction:ga},null,8,["detail","busy"])):ce("",!0),Ee(Cu,{cards:y_.value,"section-class":"summary-metric-grid"},null,8,["cards"])]),l("section",jR,[l("header",null,[l("div",null,[a[217]||(a[217]=l("span",null,"当前队列",-1)),l("h2",null,g(oo.value)+" 个任务",1)]),l("button",{type:"button",disabled:Da.value,onClick:In},g(Da.value?"加载中":"更新"),9,GR)]),Xt.value?(y(),ut(ir,{key:0,tone:"bad",title:"队列加载失败",detail:Xt.value,"action-label":"重试",busy:Da.value,onAction:In},null,8,["detail","busy"])):Da.value&&!_d.value.length?(y(),w("div",HR,[(y(),w(z,null,ue(3,$=>l("span",{key:$})),64))])):_d.value.length?(y(),w("ul",zR,[(y(!0),w(z,null,ue(_d.value,$=>(y(),w("li",{key:$.task_id},[l("div",QR,[l("strong",null,g(Co($)),1),l("small",null,g($.model_route||"未指定模型")+" / 耗时 "+g(ne(Lc)($)),1),l("div",YR,[l("span",{style:Kt({width:`${ne(ku)($)}%`})},null,4)])]),l("span",{class:oe(["status-pill",ne(Nc)($.status)])},g(ne(sl)($.status)),3),l("div",JR,[l("button",{type:"button",title:"查看任务详情","aria-label":`查看任务 ${ne(Ta)($.task_id)} 详情`,onClick:Te=>mp($)}," □ ",8,XR),l("button",{type:"button",title:"重试任务","aria-label":`重试任务 ${ne(Ta)($.task_id)}`,disabled:!zw($),onClick:Te=>Qw($)}," ↻ ",8,ZR)])]))),128))])):(y(),ut(Ec,{key:3,title:"队列暂时空闲",detail:"新的生成任务会在这里显示进度、模型和等待时间。"}))]),l("section",eM,[l("header",null,[l("div",null,[a[218]||(a[218]=l("span",null,"智能工作建议",-1)),l("h2",null,g(Dd.value.length?"可继续处理":"当前平稳"),1)])]),Dd.value.length?(y(),w("div",tM,[(y(!0),w(z,null,ue(Dd.value,$=>(y(),w("button",{key:$.id,type:"button",class:oe(["suggestion-card",$.tone]),onClick:Te=>Hw($)},[l("span",null,g($.action),1),l("strong",null,g($.title),1),l("small",null,g($.detail),1)],10,aM))),128))])):(y(),ut(Ec,{key:1,class:"calm",title:"没有需要立即处理的建议",detail:"失败、待确认、成本提醒和可继续流程会自动浮到这里。"}))])]),l("aside",nM,[l("section",lM,[l("header",null,[l("div",null,[a[219]||(a[219]=l("span",null,"最近图片",-1)),l("h2",null,g(ro.value.length)+" 张结果",1)]),l("button",{type:"button",onClick:a[92]||(a[92]=$=>Mt("gallery","images"))},"图库")]),Wa.value?(y(),ut(ir,{key:0,tone:"bad",title:"图片摘要不可用",detail:Wa.value},null,8,["detail"])):kl.value&&!ro.value.length?(y(),w("div",oM,[(y(),w(z,null,ue(3,$=>l("span",{key:$,class:"image-skeleton"})),64))])):ro.value.length?(y(),w("div",rM,[(y(!0),w(z,null,ue(ro.value,$=>(y(),w("article",{key:$.image_id,class:"side-image-card"},[l("div",iM,[ea($)?(y(),w("img",{key:0,src:ea($),alt:ya($)},null,8,sM)):(y(),w("span",uM,"IMG"))]),l("strong",null,g(ya($)),1)]))),128))])):(y(),w("div",dM,[...a[220]||(a[220]=[l("strong",null,"暂无最近图片",-1),l("span",null,"完成的生成结果会在这里显示缩略图和名称。",-1)])]))])])])],64)):(y(),w("section",cM,[l("header",fM,[a[221]||(a[221]=l("div",null,[l("span",null,"性能详情"),l("h2",null,"运行、队列和存储监控"),l("p",null,"首页侧栏只保留必要指标,完整拆分集中在这里。")],-1)),l("button",{type:"button",disabled:kl.value,onClick:ga},g(kl.value?"同步中":"刷新监控"),9,vM)]),Wa.value?(y(),ut(ir,{key:0,class:"detail-error",tone:"bad",title:"监控详情加载失败",detail:Wa.value,"action-label":"重试",busy:kl.value,onAction:ga},null,8,["detail","busy"])):ce("",!0),Ee(Cu,{cards:qd.value,"section-class":"performance-metric-grid","card-class":"detail-card"},null,8,["cards"]),l("section",pM,[l("article",mM,[l("header",null,[l("div",null,[a[222]||(a[222]=l("span",null,"队列拆分",-1)),l("h2",null,g(oo.value)+" 个任务",1)])]),l("dl",null,[(y(!0),w(z,null,ue(w_.value,$=>(y(),w("div",{key:$.label},[l("dt",null,g($.label),1),l("dd",null,g($.value),1)]))),128))])]),l("article",gM,[l("header",null,[l("div",null,[a[223]||(a[223]=l("span",null,"存储拆分",-1)),l("h2",null,g(ne(Ll)(((pe=E.value)==null?void 0:pe.storage.total_bytes)??0)),1)])]),l("dl",null,[(y(!0),w(z,null,ue(h_.value,$=>(y(),w("div",{key:$.label},[l("dt",null,g($.label),1),l("dd",null,g($.value),1)]))),128))])]),l("article",yM,[l("header",null,[l("div",null,[a[224]||(a[224]=l("span",null,"接口状态",-1)),l("h2",null,g(Wa.value?"异常":"可读"),1)])]),l("dl",null,[l("div",null,[a[225]||(a[225]=l("dt",null,"Dashboard",-1)),l("dd",null,g(Wa.value?"失败":"正常"),1)]),l("div",null,[a[226]||(a[226]=l("dt",null,"Jobs",-1)),l("dd",null,g(Xt.value?"失败":"正常"),1)]),l("div",null,[a[227]||(a[227]=l("dt",null,"Logs",-1)),l("dd",null,g(no.value?"失败":"正常"),1)])])])])])),Ee(Q0,{open:!!(to.value&&Ms.value==="generation"&&aa.value&&ea(aa.value)),title:aa.value?ya(aa.value):"",src:aa.value?ea(aa.value):"",onClose:Hv},null,8,["open","title","src"]),Ee(ne(v),{open:Lo.value,title:qe.value.title,candidates:d_.value,onClose:a[93]||(a[93]=$=>Lo.value=!1),onPreview:du},null,8,["open","title","candidates"]),Ee(ne(M),{open:Fo.value,detail:kn.value,busy:ma.value,"read-only":js.value,error:zn.value,"model-route-options":Gf.value,"default-model-routes":Vy.value,"image-fit":Hf.value,onClose:Yb,onPreview:Jb,onDecide:Xb,onRegenerate:Zb,onApprove:ew},null,8,["open","detail","busy","read-only","error","model-route-options","default-model-routes","image-fit"]),Ee(ne(q),{open:ks.value,"node-title":((De=Cn.value)==null?void 0:De.node_title)||qe.value.title,"branch-name":((vt=Cn.value)==null?void 0:vt.branch_name)||((Lt=Wt.value)==null?void 0:Lt.current_branch)||"main","round-label":n_.value,materials:e_.value,categories:St.value,"selected-material-ids":t_.value,writable:Ad.value,"can-create-branch":a_.value,loading:Cs.value||Yn.value,saving:$s.value,uploading:kt.value&&!!wl.value,"lock-message":Ed.value,error:Jt.value,message:Uo.value,onClose:Bb,onRefresh:qb,onSave:Ov,onUpload:Ob,onCreateBranch:Db},null,8,["open","node-title","branch-name","round-label","materials","categories","selected-material-ids","writable","can-create-branch","loading","saving","uploading","lock-message","error","message"]),jl.value?(y(),ut(y$,{key:10,mode:jl.value,categories:St.value,material:hi.value,"profile-id":((_a=he.value)==null?void 0:_a.profileId)??"","profile-name":((nt=he.value)==null?void 0:nt.name)??"","default-category-id":sy.value,busy:kt.value,error:Dt.value,"asset-pack-plan":mr.value,onClose:a[94]||(a[94]=$=>At("materialOperation")),onUpload:Jw,onRegister:Xw,onPlanAssetPack:eh,onExecuteAssetPack:th,onImportWardrobe:ah},null,8,["mode","categories","material","profile-id","profile-name","default-category-id","busy","error","asset-pack-plan"])):ce("",!0),Ee(q0,{open:!!ln.value,title:((ba=ln.value)==null?void 0:ba.title)??"",detail:((na=ln.value)==null?void 0:na.detail)??"","confirm-label":((Ut=ln.value)==null?void 0:Ut.confirmLabel)??"确认",busy:!!(ln.value&&nn.value===ln.value.id),danger:!0,onConfirm:oh,onCancel:lh},null,8,["open","title","detail","confirm-label","busy"])])],14,aP)}}});c0(kM).mount("#app");export{is as $,vm as A,Ee as B,P as C,S as D,xM as E,z as F,SM as G,RM as H,Q0 as I,Oc as J,ke as K,Tl as L,Be as M,Ht as N,qt as O,rs as P,VM as Q,DM as R,NM as S,ha as T,EM as U,I$ as V,Kt as W,OM as X,qM as Y,ut as Z,ai as _,ti as a,BM as a0,LM as a1,TM as a2,WM as a3,FM as a4,KM as a5,UM as a6,_1 as a7,$M as a8,PM as b,IM as c,Ln as d,A as e,AM as f,be as g,y as h,w as i,l as j,ce as k,C$ as l,Bl as m,oe as n,ls as o,xe as p,Mn as q,ue as r,Ot as s,g as t,ne as u,Ke as v,lt as w,Ol as x,Tc as y,MM as z};
|