ima2-gen 3.6.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/generatePipeline.js +7 -0
- package/package.json +2 -2
- package/ui/dist/.vite/manifest.json +32 -32
- package/ui/dist/assets/{AgentWorkspace-Bfe9PqZy.js → AgentWorkspace-DU9efUdT.js} +1 -1
- package/ui/dist/assets/{AssetGenWorkspace-XbViHOY0.js → AssetGenWorkspace-ldEVBldg.js} +2 -2
- package/ui/dist/assets/{AssetsWorkspace-HemkY-0A.js → AssetsWorkspace-D_kJ7dP_.js} +1 -1
- package/ui/dist/assets/{CardNewsWorkspace-Cchcm8ts.js → CardNewsWorkspace-DIhk26qD.js} +1 -1
- package/ui/dist/assets/GenerationRequestLogPanel-BZZJh4w_.js +1 -0
- package/ui/dist/assets/{HomeWorkspace-Do6VnjWR.js → HomeWorkspace-DwRS4Cim.js} +1 -1
- package/ui/dist/assets/{KeyingPanel-D79TCHH_.js → KeyingPanel-YkL9305F.js} +1 -1
- package/ui/dist/assets/{NodeCanvas-BpNgtUxt.js → NodeCanvas-CaFDJn_9.js} +1 -1
- package/ui/dist/assets/{PromptBuilderPanel-DHB1sU7O.js → PromptBuilderPanel-Bl5-fDQs.js} +1 -1
- package/ui/dist/assets/{PromptImportDialog-qD_tVhN5.js → PromptImportDialog-5RbU95_Y.js} +2 -2
- package/ui/dist/assets/{PromptImportDiscoverySection-51FDzoLN.js → PromptImportDiscoverySection-uhS5xI0p.js} +1 -1
- package/ui/dist/assets/{PromptImportFolderSection-uQNX1sJ_.js → PromptImportFolderSection-COwFVcbE.js} +1 -1
- package/ui/dist/assets/{PromptLibraryPanel-BngHherb.js → PromptLibraryPanel-DCtxfzy1.js} +2 -2
- package/ui/dist/assets/{SettingsWorkspace-dpl5CLsg.js → SettingsWorkspace-aHoTeB4-.js} +1 -1
- package/ui/dist/assets/{SpriteRecipeWorkspace-IpS6TVAF.js → SpriteRecipeWorkspace-B0fR6yXF.js} +1 -1
- package/ui/dist/assets/{index-DoM1FoZ5.js → index-Bj2sxDP3.js} +6 -6
- package/ui/dist/assets/index-BnMUy9kc.css +1 -0
- package/ui/dist/assets/{index-BA51BzWd.js → index-DBh-jt0i.js} +3 -3
- package/ui/dist/assets/{pptxgen.es-DlpIDw00.js → pptxgen.es-AWrWIHuf.js} +1 -1
- package/ui/dist/assets/{useAgentDialogFocus-BOGEpRNF.js → useAgentDialogFocus-BB6ds9jo.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/GenerationRequestLogPanel-CKw9JLH8.js +0 -1
- package/ui/dist/assets/index-DUxkTj-7.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NodeCanvas-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NodeCanvas-CaFDJn_9.js","assets/NodeCanvas-BnuhLJ6X.css","assets/AgentWorkspace-DU9efUdT.js","assets/useAgentDialogFocus-BB6ds9jo.js","assets/AssetsWorkspace-D_kJ7dP_.js","assets/KeyingPanel-YkL9305F.js","assets/AssetsWorkspace-BkUjPPKU.css","assets/AssetGenWorkspace-ldEVBldg.js","assets/AssetGenWorkspace-Dkr80l12.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const m of c.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function i(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(s){if(s.ep)return;s.ep=!0;const c=i(s);fetch(s.href,c)}})();var ZO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var uu={exports:{}},ri={};var Vh;function tT(){if(Vh)return ri;Vh=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(o,s,c){var m=null;if(c!==void 0&&(m=""+c),s.key!==void 0&&(m=""+s.key),"key"in s){c={};for(var p in s)p!=="key"&&(c[p]=s[p])}else c=s;return s=c.ref,{$$typeof:e,type:o,key:m,ref:s!==void 0?s:null,props:c}}return ri.Fragment=a,ri.jsx=i,ri.jsxs=i,ri}var Kh;function nT(){return Kh||(Kh=1,uu.exports=tT()),uu.exports}var d=nT(),mu={exports:{}},Ce={};var $h;function aT(){if($h)return Ce;$h=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),y=Symbol.iterator;function x(T){return T===null||typeof T!="object"?null:(T=y&&T[y]||T["@@iterator"],typeof T=="function"?T:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,I={};function k(T,F,W){this.props=T,this.context=F,this.refs=I,this.updater=W||E}k.prototype.isReactComponent={},k.prototype.setState=function(T,F){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,F,"setState")},k.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function C(){}C.prototype=k.prototype;function _(T,F,W){this.props=T,this.context=F,this.refs=I,this.updater=W||E}var N=_.prototype=new C;N.constructor=_,P(N,k.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function $(){}var L={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function re(T,F,W){var U=W.ref;return{$$typeof:e,type:T,key:F,ref:U!==void 0?U:null,props:W}}function he(T,F){return re(T.type,F,T.props)}function V(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function ee(T){var F={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(W){return F[W]})}var oe=/\/+/g;function Ne(T,F){return typeof T=="object"&&T!==null&&T.key!=null?ee(""+T.key):F.toString(36)}function ne(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then($,$):(T.status="pending",T.then(function(F){T.status==="pending"&&(T.status="fulfilled",T.value=F)},function(F){T.status==="pending"&&(T.status="rejected",T.reason=F)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function H(T,F,W,U,le){var pe=typeof T;(pe==="undefined"||pe==="boolean")&&(T=null);var xe=!1;if(T===null)xe=!0;else switch(pe){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(T.$$typeof){case e:case a:xe=!0;break;case S:return xe=T._init,H(xe(T._payload),F,W,U,le)}}if(xe)return le=le(T),xe=U===""?"."+Ne(T,0):U,j(le)?(W="",xe!=null&&(W=xe.replace(oe,"$&/")+"/"),H(le,F,W,"",function(Ze){return Ze})):le!=null&&(V(le)&&(le=he(le,W+(le.key==null||T&&T.key===le.key?"":(""+le.key).replace(oe,"$&/")+"/")+xe)),F.push(le)),1;xe=0;var Oe=U===""?".":U+":";if(j(T))for(var Re=0;Re<T.length;Re++)U=T[Re],pe=Oe+Ne(U,Re),xe+=H(U,F,W,pe,le);else if(Re=x(T),typeof Re=="function")for(T=Re.call(T),Re=0;!(U=T.next()).done;)U=U.value,pe=Oe+Ne(U,Re++),xe+=H(U,F,W,pe,le);else if(pe==="object"){if(typeof T.then=="function")return H(ne(T),F,W,U,le);throw F=String(T),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ae(T,F,W){if(T==null)return T;var U=[],le=0;return H(T,U,"","",function(pe){return F.call(W,pe,le++)}),U}function ce(T){if(T._status===-1){var F=T._result;F=F(),F.then(function(W){(T._status===0||T._status===-1)&&(T._status=1,T._result=W)},function(W){(T._status===0||T._status===-1)&&(T._status=2,T._result=W)}),T._status===-1&&(T._status=0,T._result=F)}if(T._status===1)return T._result.default;throw T._result}var be=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},Se={map:ae,forEach:function(T,F,W){ae(T,function(){F.apply(this,arguments)},W)},count:function(T){var F=0;return ae(T,function(){F++}),F},toArray:function(T){return ae(T,function(F){return F})||[]},only:function(T){if(!V(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Ce.Activity=v,Ce.Children=Se,Ce.Component=k,Ce.Fragment=i,Ce.Profiler=s,Ce.PureComponent=_,Ce.StrictMode=o,Ce.Suspense=h,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(T){return L.H.useMemoCache(T)}},Ce.cache=function(T){return function(){return T.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(T,F,W){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var U=P({},T.props),le=T.key;if(F!=null)for(pe in F.key!==void 0&&(le=""+F.key),F)!J.call(F,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&F.ref===void 0||(U[pe]=F[pe]);var pe=arguments.length-2;if(pe===1)U.children=W;else if(1<pe){for(var xe=Array(pe),Oe=0;Oe<pe;Oe++)xe[Oe]=arguments[Oe+2];U.children=xe}return re(T.type,le,U)},Ce.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:c,_context:T},T},Ce.createElement=function(T,F,W){var U,le={},pe=null;if(F!=null)for(U in F.key!==void 0&&(pe=""+F.key),F)J.call(F,U)&&U!=="key"&&U!=="__self"&&U!=="__source"&&(le[U]=F[U]);var xe=arguments.length-2;if(xe===1)le.children=W;else if(1<xe){for(var Oe=Array(xe),Re=0;Re<xe;Re++)Oe[Re]=arguments[Re+2];le.children=Oe}if(T&&T.defaultProps)for(U in xe=T.defaultProps,xe)le[U]===void 0&&(le[U]=xe[U]);return re(T,pe,le)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(T){return{$$typeof:p,render:T}},Ce.isValidElement=V,Ce.lazy=function(T){return{$$typeof:S,_payload:{_status:-1,_result:T},_init:ce}},Ce.memo=function(T,F){return{$$typeof:g,type:T,compare:F===void 0?null:F}},Ce.startTransition=function(T){var F=L.T,W={};L.T=W;try{var U=T(),le=L.S;le!==null&&le(W,U),typeof U=="object"&&U!==null&&typeof U.then=="function"&&U.then($,be)}catch(pe){be(pe)}finally{F!==null&&W.types!==null&&(F.types=W.types),L.T=F}},Ce.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ce.use=function(T){return L.H.use(T)},Ce.useActionState=function(T,F,W){return L.H.useActionState(T,F,W)},Ce.useCallback=function(T,F){return L.H.useCallback(T,F)},Ce.useContext=function(T){return L.H.useContext(T)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(T,F){return L.H.useDeferredValue(T,F)},Ce.useEffect=function(T,F){return L.H.useEffect(T,F)},Ce.useEffectEvent=function(T){return L.H.useEffectEvent(T)},Ce.useId=function(){return L.H.useId()},Ce.useImperativeHandle=function(T,F,W){return L.H.useImperativeHandle(T,F,W)},Ce.useInsertionEffect=function(T,F){return L.H.useInsertionEffect(T,F)},Ce.useLayoutEffect=function(T,F){return L.H.useLayoutEffect(T,F)},Ce.useMemo=function(T,F){return L.H.useMemo(T,F)},Ce.useOptimistic=function(T,F){return L.H.useOptimistic(T,F)},Ce.useReducer=function(T,F,W){return L.H.useReducer(T,F,W)},Ce.useRef=function(T){return L.H.useRef(T)},Ce.useState=function(T){return L.H.useState(T)},Ce.useSyncExternalStore=function(T,F,W){return L.H.useSyncExternalStore(T,F,W)},Ce.useTransition=function(){return L.H.useTransition()},Ce.version="19.2.8",Ce}var Yh;function am(){return Yh||(Yh=1,mu.exports=aT()),mu.exports}var R=am();const Hl=eT(R);var pu={exports:{}},ii={},fu={exports:{}},gu={};var Xh;function oT(){return Xh||(Xh=1,(function(e){function a(H,ae){var ce=H.length;H.push(ae);e:for(;0<ce;){var be=ce-1>>>1,Se=H[be];if(0<s(Se,ae))H[be]=ae,H[ce]=Se,ce=be;else break e}}function i(H){return H.length===0?null:H[0]}function o(H){if(H.length===0)return null;var ae=H[0],ce=H.pop();if(ce!==ae){H[0]=ce;e:for(var be=0,Se=H.length,T=Se>>>1;be<T;){var F=2*(be+1)-1,W=H[F],U=F+1,le=H[U];if(0>s(W,ce))U<Se&&0>s(le,W)?(H[be]=le,H[U]=ce,be=U):(H[be]=W,H[F]=ce,be=F);else if(U<Se&&0>s(le,ce))H[be]=le,H[U]=ce,be=U;else break e}}return ae}function s(H,ae){var ce=H.sortIndex-ae.sortIndex;return ce!==0?ce:H.id-ae.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var m=Date,p=m.now();e.unstable_now=function(){return m.now()-p}}var h=[],g=[],S=1,v=null,y=3,x=!1,E=!1,P=!1,I=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function N(H){for(var ae=i(g);ae!==null;){if(ae.callback===null)o(g);else if(ae.startTime<=H)o(g),ae.sortIndex=ae.expirationTime,a(h,ae);else break;ae=i(g)}}function j(H){if(P=!1,N(H),!E)if(i(h)!==null)E=!0,$||($=!0,ee());else{var ae=i(g);ae!==null&&ne(j,ae.startTime-H)}}var $=!1,L=-1,J=5,re=-1;function he(){return I?!0:!(e.unstable_now()-re<J)}function V(){if(I=!1,$){var H=e.unstable_now();re=H;var ae=!0;try{e:{E=!1,P&&(P=!1,C(L),L=-1),x=!0;var ce=y;try{t:{for(N(H),v=i(h);v!==null&&!(v.expirationTime>H&&he());){var be=v.callback;if(typeof be=="function"){v.callback=null,y=v.priorityLevel;var Se=be(v.expirationTime<=H);if(H=e.unstable_now(),typeof Se=="function"){v.callback=Se,N(H),ae=!0;break t}v===i(h)&&o(h),N(H)}else o(h);v=i(h)}if(v!==null)ae=!0;else{var T=i(g);T!==null&&ne(j,T.startTime-H),ae=!1}}break e}finally{v=null,y=ce,x=!1}ae=void 0}}finally{ae?ee():$=!1}}}var ee;if(typeof _=="function")ee=function(){_(V)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,Ne=oe.port2;oe.port1.onmessage=V,ee=function(){Ne.postMessage(null)}}else ee=function(){k(V,0)};function ne(H,ae){L=k(function(){H(e.unstable_now())},ae)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var ae=3;break;default:ae=y}var ce=y;y=ae;try{return H()}finally{y=ce}},e.unstable_requestPaint=function(){I=!0},e.unstable_runWithPriority=function(H,ae){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ce=y;y=H;try{return ae()}finally{y=ce}},e.unstable_scheduleCallback=function(H,ae,ce){var be=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?be+ce:be):ce=be,H){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=ce+Se,H={id:S++,callback:ae,priorityLevel:H,startTime:ce,expirationTime:Se,sortIndex:-1},ce>be?(H.sortIndex=ce,a(g,H),i(h)===null&&H===i(g)&&(P?(C(L),L=-1):P=!0,ne(j,ce-be))):(H.sortIndex=Se,a(h,H),E||x||(E=!0,$||($=!0,ee()))),H},e.unstable_shouldYield=he,e.unstable_wrapCallback=function(H){var ae=y;return function(){var ce=y;y=ae;try{return H.apply(this,arguments)}finally{y=ce}}}})(gu)),gu}var Qh;function rT(){return Qh||(Qh=1,fu.exports=oT()),fu.exports}var hu={exports:{}},Nt={};var Jh;function iT(){if(Jh)return Nt;Jh=1;var e=am();function a(h){var g="https://react.dev/errors/"+h;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)g+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+h+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(a(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function c(h,g,S){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:h,containerInfo:g,implementation:S}}var m=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(h,g){if(h==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Nt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Nt.createPortal=function(h,g){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(a(299));return c(h,g,null,S)},Nt.flushSync=function(h){var g=m.T,S=o.p;try{if(m.T=null,o.p=2,h)return h()}finally{m.T=g,o.p=S,o.d.f()}},Nt.preconnect=function(h,g){typeof h=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(h,g))},Nt.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},Nt.preinit=function(h,g){if(typeof h=="string"&&g&&typeof g.as=="string"){var S=g.as,v=p(S,g.crossOrigin),y=typeof g.integrity=="string"?g.integrity:void 0,x=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;S==="style"?o.d.S(h,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:x}):S==="script"&&o.d.X(h,{crossOrigin:v,integrity:y,fetchPriority:x,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Nt.preinitModule=function(h,g){if(typeof h=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var S=p(g.as,g.crossOrigin);o.d.M(h,{crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(h)},Nt.preload=function(h,g){if(typeof h=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var S=g.as,v=p(S,g.crossOrigin);o.d.L(h,S,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Nt.preloadModule=function(h,g){if(typeof h=="string")if(g){var S=p(g.as,g.crossOrigin);o.d.m(h,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(h)},Nt.requestFormReset=function(h){o.d.r(h)},Nt.unstable_batchedUpdates=function(h,g){return h(g)},Nt.useFormState=function(h,g,S){return m.H.useFormState(h,g,S)},Nt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Nt.version="19.2.8",Nt}var Wh;function mv(){if(Wh)return hu.exports;Wh=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),hu.exports=iT(),hu.exports}var Zh;function lT(){if(Zh)return ii;Zh=1;var e=rT(),a=am(),i=mv();function o(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,r=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(r=n.return),t=n.return;while(t)}return n.tag===3?r:null}function m(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(c(t)!==t)throw Error(o(188))}function g(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(o(188));return n!==t?null:t}for(var r=t,l=n;;){var u=r.return;if(u===null)break;var f=u.alternate;if(f===null){if(l=u.return,l!==null){r=l;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===r)return h(u),t;if(f===l)return h(u),n;f=f.sibling}throw Error(o(188))}if(r.return!==l.return)r=u,l=f;else{for(var b=!1,A=u.child;A;){if(A===r){b=!0,r=u,l=f;break}if(A===l){b=!0,l=u,r=f;break}A=A.sibling}if(!b){for(A=f.child;A;){if(A===r){b=!0,r=f,l=u;break}if(A===l){b=!0,l=f,r=u;break}A=A.sibling}if(!b)throw Error(o(189))}}if(r.alternate!==l)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?t:n}function S(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=S(t),n!==null)return n;t=t.sibling}return null}var v=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),_=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function ee(t){return t===null||typeof t!="object"?null:(t=V&&t[V]||t["@@iterator"],typeof t=="function"?t:null)}var oe=Symbol.for("react.client.reference");function Ne(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case P:return"Fragment";case k:return"Profiler";case I:return"StrictMode";case j:return"Suspense";case $:return"SuspenseList";case re:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case _:return t.displayName||"Context";case C:return(t._context.displayName||"Context")+".Consumer";case N:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return n=t.displayName||null,n!==null?n:Ne(t.type)||"Memo";case J:n=t._payload,t=t._init;try{return Ne(t(n))}catch{}}return null}var ne=Array.isArray,H=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},be=[],Se=-1;function T(t){return{current:t}}function F(t){0>Se||(t.current=be[Se],be[Se]=null,Se--)}function W(t,n){Se++,be[Se]=t.current,t.current=n}var U=T(null),le=T(null),pe=T(null),xe=T(null);function Oe(t,n){switch(W(pe,n),W(le,t),W(U,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?fh(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=fh(n),t=gh(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(U),W(U,t)}function Re(){F(U),F(le),F(pe)}function Ze(t){t.memoizedState!==null&&W(xe,t);var n=U.current,r=gh(n,t.type);n!==r&&(W(le,t),W(U,r))}function ie(t){le.current===t&&(F(U),F(le)),xe.current===t&&(F(xe),ti._currentValue=ce)}var lt,at;function st(t){if(lt===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);lt=n&&n[1]||"",at=-1<r.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+lt+t+at}var bt=!1;function se(t,n){if(!t||bt)return"";bt=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(K){var B=K}Reflect.construct(t,[],Q)}else{try{Q.call()}catch(K){B=K}t.call(Q.prototype)}}else{try{throw Error()}catch(K){B=K}(Q=t())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(K){if(K&&B&&typeof K.stack=="string")return[K.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=l.DetermineComponentFrameRoot(),b=f[0],A=f[1];if(b&&A){var M=b.split(`
|
|
@@ -11,20 +11,20 @@ Error generating stack: `+l.message+`
|
|
|
11
11
|
거기서 펼치기.`,heroLede:"내 컴퓨터에서 만들고, 고치고, 움직이게 합니다. 보내지 않으면 아무것도 나가지 않습니다.",lanesReady:"생성 경로 {total}개 중 {ready}개 준비됨",lanesNone:"준비된 경로 없음 — 설정에서 연결",modesTitle:"작업 공간",modeCreateHint:"한 장을 만들고 다듬습니다",modeNodeHint:"결과 하나를 여러 방향으로 나눕니다",modeAgentHint:"할 일을 말하면 에이전트가 실행합니다",modeAssetsHint:"만든 것을 모으고 다시 씁니다",untitledResult:"이름 없는 결과",recentResultAlt:"최근 결과: {prompt}",mediaUnavailable:"미리보기를 표시할 수 없습니다"},M0={label:"API 상태",checking:"확인 중...",offline:"오프라인",remaining:"${remaining} 남음",thisMonth:"이번 달 ${amount}",oauthFree:"GPT OAuth 무료 사용 가능",apiDisabled:"API 키 사용 가능",apiReady:"API 키 사용 가능",oauthMode:"GPT OAuth 모드"},P0={openGalleryAria:"갤러리 열기",openGalleryTitle:"전체 갤러리 열기",openGalleryShort:"전체",galleryCard:"갤러리 열기",recentTitle:"최근 생성",collapseRecent:"최근 생성 접기",expandRecent:"최근 생성 펼치기",collapseRecentShort:"접기",expandRecentShort:"펼치기",emptyRecent:"생성 히스토리가 여기에 표시됩니다.",generatingCollection:"이미지 {count}장 생성 중…",selectRecent:"생성 히스토리 선택",deleteImageAria:"이미지 기록 삭제",deleteSequenceAria:"{count}장 시퀀스 삭제",deleteSequenceConfirm:"이 멀티모드 시퀀스의 이미지 {count}장을 삭제할까요?",sequenceDeleted:"시퀀스 이미지 {count}장을 히스토리에서 삭제했습니다"},L0={closeSettings:"설정 닫기",detailSettings:"세부 설정",toggleShow:"세부 설정 보기",toggleHide:"세부 설정 숨기기",open:"열기",close:"닫기"},O0={label:"프롬프트",refCount:"참조 {count}/{max}",trayAria:"참조 트레이, {count}/{max}",deadTagHint:"트레이에서 제거된 태그 — 참조로만 표시",deadTagStatus:"프롬프트에서 사용할 수 없는 참조: {tags}",refChipTitle:"참조 이미지 {n}",refChipAlt:"참조 이미지 {n}",refRemoveAria:"참조 이미지 {n} 제거",placeholder:"원하는 이미지를 설명하고, 드래그 앤 드롭이나 붙여넣기로 참조 이미지를 추가할 수 있어요...",placeholderWithRefs:"첨부한 이미지로 무엇을 만들지 설명해 주세요...",attach:"첨부",attachTitle:"참조 이미지 첨부",useCurrent:"현재 결과 사용",useCurrentTitle:"현재 결과를 참조로 사용",continue:"이어가기",continueTitle:"현재 결과를 참조로 이어서 작업",savePrompt:"저장",storyboard:"스토리보드",storyboardTitle:"스토리보드 모드 — 인물과 장면의 연속성을 유지하며 순차 프레임 생성",videoToggleTitle:"비디오 모드 전환 (Grok 1.5)",directMode:"Direct",directModeActive:"1:1 Direct 켜짐",directModeTitle:"프롬프트를 원문 그대로 전달 (Direct 모드)",urlRefActive:"URL 참조",urlRefActiveTitle:"URL 참조가 활성화되어 첨부 이미지 대신 사용됩니다. 클릭하면 해제합니다.",urlRefClear:"URL 참조 해제",moveBlockUp:"{name} 위로 이동",moveBlockDown:"{name} 아래로 이동",afterBlocks:"본문 프롬프트 뒤",hint:"Ctrl + Enter로 생성",dropHere:"놓아서 참조 이미지로 추가 ({max}장까지)"},j0={modeTitle:"캔버스 모드",resultAlt:"생성 결과",imageViewerAria:"생성 이미지 뷰어. 좌우 방향키로 이전 또는 다음 이미지를 볼 수 있습니다.",tokens:"{n} 토큰",open:"캔버스 열기",openAria:"캔버스 모드에서 이미지 열기",dragToComposer:"작성창으로 드래그해서 참조 추가",dragHint:"드래그",annotationInstructionsChip:"캔버스 노트",close:"캔버스 닫기",blank:{title:"흰 캔버스",subtitle:"흰 종이에 그린 뒤 여기서 이어가세요.",create:"흰 캔버스 만들기",creating:"만드는 중...",failed:"흰 캔버스를 만들 수 없습니다"},drop:{hint:"이미지를 떨어뜨려 갤러리에 추가"},toolbar:{label:"캔버스 주석 도구",select:"선택",bgGroup:"내보내기 배경",bgAlpha:"투명",bgMatte:"단색",bgMatteColor:"단색 색상",cleanup:"배경 정리",cleanupMark:"표시",cleanupRemove:"제거",cleanupPreserve:"보존",cleanupInput:"입력",cleanupClick:"클릭",cleanupBrush:"브러시",cleanupBrushSize:"브러시",cleanupTolerance:"감도",cleanupAutoSample:"모서리",cleanupPickSeed:"배경 찍기",cleanupPickingSeed:"배경 클릭",cleanupActive:"활성",cleanupPreview:"미리보기",cleanupPreviewing:"미리보기 중...",cleanupApply:"PNG 적용",cleanupApplying:"적용 중...",cleanupReset:"초기화",cleanupSeedCount:"{n}개 seed",cleanupRemoved:"{n}% 제거",cleanupPickHint:"이미지 위 배경을 클릭하세요",cleanupBrushHint:"표시할 영역을 칠하세요",cleanupMaskHint:"보라색 영역이 제거 예정",cleanupApplied:"투명 PNG 생성됨",cleanupFailed:"배경 정리 실패",zoomGroup:"캔버스 확대/축소",zoomIn:"확대",zoomOut:"축소",zoomReset:"확대 초기화",zoomShortcutHint:"핀치 확대 · 두손가락 이동 · [ / ] · 0",pen:"펜",box:"박스",arrow:"화살표",memo:"메모",eraser:"지우개",eraserMenu:"지우개 옵션",objectEraser:"객체 지우개",brushEraser:"브러시 지우개",apply:"캔버스 버전 저장",applyDone:"캔버스 버전 저장됨",applyFailed:"캔버스 버전 저장 실패",export:"이미지 내보내기",exporting:"내보내는 중...",exportFailed:"내보내기 실패",undo:"실행 취소",redo:"다시 실행",deleteSelected:"선택 삭제",editMask:"박스 영역 편집",editMaskDisabled:"먼저 박스를 그려주세요",editMaskFailed:"마스크 편집 실패",editMaskUnsupported:"현재 이미지 제공자는 마스크 편집을 지원하지 않습니다",style:"스타일",color:"색상",strokeWidth:"선 굵기",clear:"모두 지우기",exportFormat:"내보내기 형식",exportAs:{png:"PNG 이미지",svg:"SVG 벡터",pptx:"PowerPoint 슬라이드"}},version:{saving:"캔버스 버전 저장 중...",saved:"캔버스 버전 저장됨",failed:"캔버스 버전 저장 실패",usingAsReference:"캔버스 버전을 참조 이미지로 사용할 수 있습니다"},revert:{action:"구워진 노트 되돌리기",mixedConfirm:"이 버전에는 픽셀 편집도 포함되어 있습니다. 구워진 노트를 되돌리면 픽셀 편집이 사라집니다. 계속할까요?",restored:"구워진 노트를 편집 가능한 초안으로 복원했습니다",completed:"구워진 노트와 픽셀 편집을 되돌렸습니다",failed:"구워진 노트를 되돌리지 못했습니다"}},G0={today:"오늘",yesterday:"어제",thisWeek:"이번 주",earlier:"이전",imageAltFallback:"생성 이미지",deleteTitle:"시스템 휴지통으로 이동",deleteAria:"이미지 삭제",ariaLabel:"이미지 갤러리",title:"갤러리",total:"총 {n}장",totalFiltered:" / 전체 {n}장",sortByAria:"정렬 기준",sortByDate:"날짜",sortBySession:"세션",favoriteFilterAria:"즐겨찾기 필터",filterAll:"전체",filterFavorites:"즐겨찾기",searchPlaceholder:"프롬프트나 파일명을 검색",searchDisabledPlaceholder:"세션 보기에서는 검색이 비활성화됩니다",closeAria:"갤러리 닫기",closeTitle:"닫기 (Esc)",sessionLabel:"세션 {name}",standalone:"독립 이미지",emptySessions:"아직 저장된 세션이 없습니다.",emptyAll:"아직 생성된 이미지가 없습니다. 먼저 하나 만들어보세요.",emptyFavorites:"아직 즐겨찾기한 이미지가 없습니다.",noResults:"검색 결과가 없습니다.",loadOlder:"이전 이미지 더 불러오기",loadingOlder:"이전 이미지 불러오는 중...",loadOlderFavorites:"이전 즐겨찾기 더 불러오기",loadingOlderFavorites:"이전 즐겨찾기 불러오는 중...",sessionPaginationHint:"세션 보기는 현재 페이지 기준입니다. 이전 이미지를 더 보려면 날짜 보기로 전환해 주세요.",sessionLoading:"세션별 이미지를 불러오는 중입니다...",sessionLoadFailed:"세션별 이미지를 불러오지 못했습니다.",sessionLimitNotice:"최신 {count}개만 표시합니다. 세션 보기에는 더 오래된 항목이 포함되지 않습니다.",retry:"다시 시도",loadOlderFailed:"이전 갤러리 항목을 불러오지 못했습니다.",storageNoticeTitle:"저장 위치 안내",storageNoticeRecoverable:"불편을 드려 죄송합니다. 최근 버전에서 갤러리 저장 위치가 설치 폴더에서 사용자 데이터 폴더로 바뀌었습니다. 예전 이미지가 이전 generated 폴더에 남아 있을 수 있어요. ima2 doctor를 실행하거나 복구 안내를 확인해 주세요.",storageNoticeNotFound:"불편을 드려 죄송합니다. 현재 이 컴퓨터에서 이전 generated 폴더를 찾지 못했습니다. 업데이트 중 예전 전역 설치 폴더가 교체된 경우 자동 복구가 어려울 수 있습니다. ima2 doctor와 복구 안내의 수동 검색 방법을 확인해 주세요.",storageNoticeUnknown:"저장 위치 상태를 확인하지 못했습니다. 업데이트 후 갤러리가 비어 보인다면 ima2 doctor로 이미지 폴더를 확인해 주세요.",openGeneratedDir:"폴더 열기",openGeneratedDirTitle:"생성 이미지 폴더 열기",cardNewsSet:"카드뉴스 세트",cardNewsCard:"카드뉴스 카드",openCardNewsSet:"세트 열기",openCardNewsSetFailed:"카드뉴스 세트를 열지 못했습니다.",copyCardNewsSetPath:"경로 복사",cardNewsPathCopied:"카드뉴스 세트 경로를 복사했습니다.",downloadCardNewsManifest:"매니페스트",cardNewsCount:"{n}장",deleted:"삭제됨: {filename}",undo:"되돌리기",secondsSuffix:"{n}초",permanentDeleted:"완전 삭제됨: {filename}",movedToSystemTrash:"시스템 휴지통으로 이동됨: {filename}",deleteFailed:"이미지를 삭제하지 못했습니다.",restoreFailed:"이미지를 복구하지 못했습니다.",favoriteTitle:"즐겨찾기 추가",unfavoriteTitle:"즐겨찾기 해제",favoriteAria:"즐겨찾기 추가",unfavoriteAria:"즐겨찾기 해제",favoriteFailed:"즐겨찾기를 변경하지 못했습니다",scopeAria:"갤러리 범위",scope:{current:"현재 세션",all:"전체 이미지"},empty:{currentSession:"이번 세션에는 아직 이미지가 없습니다."}},D0={empty:"비어 있음",elementMissing:'엘리먼트 "{name}"이 삭제됐습니다. 실행 전에 다시 연결하세요.',pending:"생성 중",reconciling:"동기화 중",reconcilingPhase:"동기화 중 · {phase}",ready:"완료 · {elapsed}s",readyWithSearch:"완료 · {elapsed}s · 검색 {searches}",stale:"오래된 상태",staleWithError:"오래된 상태: {error}",assetMissing:"에셋 누락",assetMissingWithError:"에셋 누락: {error}",error:"오류: {error}",errorUnknown:"알 수 없음",nodeImageAlt:"노드 이미지",partialImageAlt:"노드 중간 이미지 미리보기",noAsset:"에셋 없음",stateStale:"상태 오래됨",noImage:"이미지 없음",editPromptPlaceholder:"수정 프롬프트...",promptPlaceholder:"프롬프트...",regenerate:"재생성",newVariation:"새 변형",generate:"생성",generateTitle:"노드 이미지 생성",addChild:"자식",addChildTitle:"자식 노드 추가",duplicateBranch:"복제",duplicateBranchTitle:"새 브랜치 루트로 복제",deleteTitle:"삭제",regenerateTitle:"현재 노드 이미지를 제자리에서 다시 생성",newVariationTitle:"같은 부모 아래 새 변형 노드를 생성",parentImageRequired:"부모 이미지를 먼저 생성해야 합니다.",attachRef:"첨부",attachRefTitle:"노드 참조 이미지 첨부",refAlt:"노드 참조 이미지 {n}",removeRef:"참조 이미지 {n} 제거",dropRefs:"이미지를 여기에 놓기",nodeRefsUnsupportedForEdit:"추가 참조 이미지는 현재 루트 노드에서만 지원합니다.",nodeRefsUsedWithParent:"부모 이미지와 함께 참조로 사용됩니다.",classicRefsParkedTitle:"클래식 참조 이미지가 보관 중입니다",classicRefsParkedBody:"이 이미지는 클래식 작성창용이라 노드 모드 생성에는 사용되지 않습니다.",clearParkedRefs:"보관된 참조 비우기",retry:"재시도",retryTitle:"이 노드의 생성을 다시 시도합니다",errorAuthCta:"계정 또는 API 키를 확인한 뒤 다시 생성해 주세요.",errorFixCta:"프롬프트나 참조 이미지를 고친 뒤 다시 생성해 주세요."},F0={selectionOn:"선택중",selectionOff:"선택",selectAll:"전체",summary:"선택 {selected} · 미생성 {missing} · 영향 {stale}",generateMissing:"미생성",regenerateSelected:"재생성",stopRemaining:"중단",stopping:"중단중",clear:"해제",noneSelected:"선택된 노드가 없습니다.",parentRequired:"부모 이미지가 준비되지 않은 선택 노드가 {count}개 있습니다.",nothingToRun:"생성할 선택 노드가 없습니다.",stopQueued:"현재 노드가 끝나면 남은 작업을 중단합니다.",failed:"{done}/{total} 완료 후 중단되었습니다.",finished:"{done}/{total} 노드 작업 완료",staleBecauseParentChanged:"상위 노드가 재생성되어 다시 확인이 필요합니다.",cycleBlocked:"선택한 노드 {count}개가 순환 고리를 이루고 있어 실행할 수 없습니다.",partialFinished:"{total}개 중 {done}개 완료 — 실패 {failed}개, 건너뜀 {skipped}개."},z0={disconnect:"끊기",disconnectTitle:"선택한 연결선 끊기",disconnected:"연결선을 끊었습니다.",parentConflict:"한 노드에는 부모 연결을 하나만 둘 수 있습니다.",cycleBlocked:"이 연결은 순환 고리를 만들기 때문에 연결할 수 없습니다."},q0={authTitle:"공급자",apiLabel:"API 키",statusReady:"사용 가능",statusConnected:"연결됨",statusAuthRequired:"로그인 필요",statusDisconnected:"연결 안 됨",statusLineTitle:"상태",authMethodTitle:"인증",authActive:"사용 중",oauthNotReady:"GPT OAuth 프록시가 아직 준비되지 않았습니다.",codexLoginRequired:"Codex 로그인이 필요합니다.",codexLoginHint:"터미널에서 `codex login`을 실행한 뒤 이 페이지를 새로고침해 주세요.",oauthStarting:"GPT OAuth 프록시가 시작 중입니다. 몇 초 후 다시 시도하세요.",serverUnreachable:"서버에 연결할 수 없습니다. 백엔드가 실행 중인지 확인하세요.",apiInvalid:"API 키가 없거나 유효하지 않습니다. 서버의 .env 파일에서 OPENAI_API_KEY를 확인하세요.",grokOffline:"Grok 프록시가 실행되지 않고 있습니다.",grokNoImageModel:"Grok 이미지 생성 모델을 찾을 수 없습니다.",grokNotReady:"Grok을 사용할 수 없습니다.",grokOfflineHint:"필요하면 `ima2 grok login`을 한 번 실행한 뒤 `ima2 serve`를 시작하세요. ima2가 번들된 Grok 프록시를 자동으로 띄웁니다.",grokManagedByIma2:"Grok은 `ima2 serve` 안에서 번들된 progrok 프록시(127.0.0.1:18645)로 로컬 실행됩니다.",grokClassicOnly:"이 화면에서는 Grok 이미지 생성을 사용할 수 없습니다.",grokClassicOnlyHint:"Grok이 켜진 생성 화면에서 사용하세요.",grokCompatTitle:"Grok 이미지 API",grokCompatBody:"ima2 serve가 번들 progrok 프록시(127.0.0.1:18645)를 관리합니다. Grok은 항상 먼저 검색하고 첨부 레퍼런스를 Grok 4.5 플래너에 함께 보냅니다. 레퍼런스는 xAI 이미지 편집 경로에서 유지되며, 크기는 xAI aspect ratio/resolution으로 매핑됩니다. 출력 포맷·모더레이션·추론은 OpenAI 공급자에서만 설정합니다.",settingsBody:"앞으로 생성 요청에 사용할 공급자를 선택합니다.",availableTitle:"{name} 사용 가능",availableAria:"{name}: 사용 가능",unavailableAria:"{name}: 사용 불가",availableSr:"(사용 가능)",unavailableSr:"(사용 불가)",xaiApiKeyRequired:"xAI API 키 필요",geminiApiKeyRequired:"Gemini API 키 필요",atlasCloudApiKeyRequired:"Atlas Cloud API 키 필요",minimaxApiKeyRequired:"MiniMax API 키 필요",comingSoon:"준비 중",agyCompatTitle:"Gemini (agy)",agyCompatBody:"1024x1024 고정, JPEG 출력, 최대 3개 참조. 품질/크기 조절 없음.",agyCompatBodyLong:"1024x1024 고정 출력, JPEG 형식, 최대 3개 참조 이미지. 웹 검색, 품질/크기 조절 없음.",geminiApiCompatTitle:"Gemini API",geminiApiCompatBody:"Google Gemini API. 512px부터 4K까지 종횡비와 해상도를 조절할 수 있습니다.",geminiApiCompatBodyLong:"Google Gemini API 직접 호출. nano-banana-2(Flash), nano-banana-pro(Pro)를 지원하며 512px부터 4K까지 종횡비와 해상도를 조절할 수 있습니다.",gptCompatTitle:"GPT Image",gptCompatBody:"OpenAI Responses API를 통한 이미지 생성. 품질, 크기, 형식, 모더레이션, 웹 검색 설정 지원."},U0={connectionsTitle:"MCP 프로바이더 연결",connectionsBody:"공식 프로바이더 계정을 연결하고 도구 상태를 확인합니다. 연결된 프로바이더만 생성 셀렉터에 표시됩니다.",providerLabel:"생성 프로바이더",modelLabel:"생성 모델",coreProviders:"기본 프로바이더",connectedProviders:"연결된 MCP 프로바이더",imageModels:"이미지 모델",videoModels:"비디오 모델",chooseModel:"모델 선택",loadingModels:"모델 불러오는 중",loadingProviders:"연결 확인 중",providersLoadFailed:"MCP 프로바이더 상태를 불러오지 못했습니다.",modelsLoadFailed:"모델 목록을 불러오지 못했어요. 눌러서 다시 시도하세요.",retryModels:"다시 시도",noModels:"이 모드에서 사용할 수 있는 모델이 없습니다.",refreshingConnection:"새로고침 중…",exitLane:"코어 프로바이더 사용",modelSectionTitle:"모델",ratioAutoHelp:"Auto는 모델이 비율을 직접 정합니다. 프리셋은 일부 모델에서 거부될 수 있습니다.",aspectRatioLabel:"화면 비율",durationLabel:"길이",resolutionLabel:"해상도",qualityLabel:"품질",modeLabel:"모드",audioLabel:"오디오",onLabel:"켜기",offLabel:"끄기",toolInputsLabel:"참조 미디어",referenceNone:"선택 안 함",referenceSelect:"갤러리에서 선택",referenceCurrent:"현재 갤러리 항목",referenceMissing:"불러온 기록에 없음",startFrameLabel:"시작 프레임",endFrameLabel:"종료 프레임",endFrameNeedsStart:"시작 프레임을 먼저 선택해주세요.",imageReferencesLabel:"참조 이미지 (최대 3장)",imageReferenceAria:"참조 이미지 {index}",referenceTagAria:"참조 이미지 {index} 태그",referenceTagPlaceholder:"태그 (선택)",referenceTagInvalid:"태그는 한글·영문·숫자·밑줄(_), 하이픈(-)만 사용해 1~32자로 입력해주세요.",referenceAttachLocal:"내 이미지 첨부",referenceAttachHelp:"내 이미지는 생성할 때만 임시로 올리고, 작업이 끝나면 삭제해요.",referenceLocalFallback:"내 이미지",referenceLocalInvalidType:"PNG, JPEG, WebP 이미지를 선택해주세요.",referenceLocalReadFailed:"이미지를 읽지 못했어요. 다시 선택해주세요.",referenceSource:{asset:"에셋",element:"요소",local:"내 이미지"},videoReferenceLabel:"참조 영상",videoReferenceCostNote:"참조 영상을 사용하면 프로바이더 요금이 더 붙을 수 있어요.",advancedPresetsLabel:"고급 프리셋",providerDefaultsHelp:"이 모델은 추가 프리셋 없이 프로바이더 기본값을 사용합니다.",chooseModelForPresets:"상단 모델 선택기에서 모델을 고르면 지원 프리셋이 표시됩니다.",refreshList:"상태 새로고침",connect:"연결",connecting:"연결 중",connectOpensBrowser:"브라우저에서 프로바이더 로그인을 엽니다.",refreshConnection:"다시 연결",disconnect:"연결 해제",connectionActionFailed:"연결 작업을 완료하지 못했습니다. 잠시 후 다시 시도해주세요.",popupBlocked:"로그인 창이 차단되었습니다. 팝업을 허용한 뒤 다시 연결해주세요.",locked:"잠김",unavailable:"사용 불가",unknownProvider:"{provider} 연결 정보를 찾을 수 없습니다.",disconnectedSelection:"저장된 프로바이더 연결이 끊겼습니다. 설정에서 다시 연결해주세요.",disabledProvider:"이 프로바이더는 현재 서버 설정에서 비활성화되어 있습니다.",selectionUnavailable:"선택한 MCP 프로바이더를 사용할 수 없습니다. 설정에서 연결 상태를 확인해주세요.",higgsfieldLocked:"이 제공자는 현재 생성이 잠겨 있습니다.",toolCount:"도구 {count}개",toolCountUnknown:"도구 수 미확인",snapshotChanges:"스키마 변경 {count}건",billingLabel:"과금 방식",billingSubscription:"구독 크레딧",billingApi:"API 사용량 과금",billingUnknown:"미확인",generateFailed:"MCP 생성을 시작하지 못했습니다.",errorUnsupportedInput:"이 모델이 지원하지 않는 참조 유형이 포함되어 있어요. 다른 모델을 고르거나 해당 첨부를 빼주세요.",errorEndRequiresStart:"종료 프레임을 쓰려면 시작 프레임부터 선택해주세요.",errorInvalidReferences:"선택한 참조 이미지 중 일부를 찾을 수 없어요. 다시 선택해주세요.",errorInvalidFrame:"선택한 프레임이나 영상을 찾을 수 없어요. 다시 선택해주세요.",errorTempReferences:"내 참조 이미지를 준비하지 못했어요. 다시 선택해주세요.",status:{disconnected:"연결 안 됨",connecting:"연결 중",auth_required:"로그인 필요",connected:"연결됨",offline:"오프라인",error:"오류"},characterSlotLabel:"캐릭터",characterSlotNone:"캐릭터 바인딩 없음",characterSlotConflictHint:"캐릭터 바인딩을 쓰려면 @엘리먼트 멘션을 빼주세요 — 함께 쓸 수 없습니다."},H0={image:"이미지",video:"비디오"},B0={free:"무료",approx:"약 ${amount}",multimodeApprox:"최대 약 ${amount} ({count}장)",label:"예상 비용"},V0={download:"다운로드",copyImage:"이미지 복사",copyLastFrame:`마지막
|
|
12
12
|
프레임`,copyFirstFrame:`처음
|
|
13
13
|
프레임`,copyMidFrame:`중간
|
|
14
|
-
프레임`,copyPrompt:"프롬프트 복사",continueHere:"여기서 이어서",continueHereTitle:"이 이미지의 프롬프트를 가져와 이어서 작업",continueAsUrl:"URL로 이어서",continueAsUrlTitle:"원본 URL을 사용해 이어서 생성 (1시간 내 만료)",animate:"애니메이트",animating:"애니메이트 중…",animateTitle:"이 이미지로 Grok 비디오 생성 (이미지→비디오)",firstNode:"첫 노드",firstNodeTitle:"이 이미지를 Node Mode의 준비된 첫 노드로 보냅니다",info:"정보",infoTitle:"생성 세부 정보와 출처를 표시합니다",delete:"삭제",deleteTitle:"휴지통으로 이동",more:"더보기",sendToComfyUI:"ComfyUI로 보내기",sendToComfyUITitle:"이 저장된 이미지를 로컬 ComfyUI로 업로드",permanentDelete:"완전 삭제",permanentDeleteConfirm:'"{filename}" 이미지를 완전히 삭제할까요? 이 작업은 되돌릴 수 없습니다.',upscale:"업스케일",upscaleTitle:"Runway로 업스케일 (MCP)",upscaleFlavor:"플레이버",upscaleFlavorAuto:"자동",upscaleStart:"업스케일 시작",upscaleStarted:"업스케일을 시작했습니다",upscaleFailed:"업스케일 실패",upscaleInvalid:"업스케일 파라미터가 올바르지 않습니다"},K0={switchTitle:"세션 전환",loading:"불러오는 중...",newSession:"새 세션",newSessionTitle:"새 세션",renameTitle:"이름 변경",renamePrompt:"세션 이름",deleteTitle:"삭제",deleteConfirm:'"{title}" 세션을 삭제할까요? 이 작업은 되돌릴 수 없습니다.',empty:"아직 세션이 없습니다",firstGraph:"첫 번째 그래프",untitled:"제목 없는 세션",assetAbortedError:"생성이 정상적으로 끝나지 않았습니다. 이 노드에서 다시 시도하세요."},$0={ariaLabel:"UI 모드",classic:"기본",node:"노드",cardNews:"카드뉴스",agent:"에이전트"},Y0={workspace:"에이전트 작업공간",workspaceActionFailed:"작업 실패: {reason}",bootFailed:"에이전트 작업공간을 불러오지 못했습니다",bootRetry:"다시 시도",topbarBackToStudio:"스튜디오로 돌아가기",topbarStudio:"스튜디오",topbarOpenQueue:"큐 열기, 활성 작업 {count}개",topbarCloseQueue:"큐 닫기",topbarQueueSheet:"생성 큐",title:"에이전트",newSession:"새 에이전트",sessions:"세션",openSessions:"세션 열기",closeSessions:"세션 닫기",sessionsUseRail:"세션을 간단한 레일로 고정",sessionsUseExpanded:"펼친 세션 목록으로 고정",sessionSearch:"세션 검색",renameSession:"세션 이름 바꾸기",deleteSession:"세션 삭제",deleteConfirm:'"{title}" 세션을 삭제할까요?',imageCount:"{count}장",compacted:"컴팩트됨",web:"웹",chat:"채팅",user:"사용자",assistant:"에이전트",tool:"도구",toolExpand:"도구 상세 펼치기",toolCollapse:"도구 상세 접기",toolImageCount:"{count}장",toolCallCount:"{count}개 호출",toolGroup:"도구 실행",toolInput:"입력",toolOutput:"출력",toolsShowMore:"더보기",toolsShowLess:"접기",toolArtifacts:"결과물",requestId:"요청 ID",duration:"소요 시간",toolStatus:{queued:"대기",running:"실행 중",complete:"완료",error:"오류"},rightSidebar:"에이전트 사이드 도구",sidebarTabs:{image:"이미지",library:"라이브러리",forms:"양식",quality:"품질",model:"모델",queue:"큐"},modelSettings:"모델 설정",closeModelSettings:"모델 설정 닫기",openModelSettings:"모델 설정 열기",modelTabView:"모델 탭에서 보기",model:"모델",provider:"프로바이더",reasoningEffort:"추론",generationStrategy:"생성 계획",generationStrategyAuto:"사용자 요청 기준",generationStrategyManual:"고정 개수",quality:"품질",size:"크기",format:"포맷",moderation:"모더레이션",variantsCount:"변형 수",maxAutoVariants:"자동 최대",parallelism:"병렬 수",promptLibrary:"프롬프트 라이브러리",forms:"양식",noForms:"양식 템플릿이 없습니다",insertPrompt:"삽입",queue:"큐",runningShort:"실행",queuedShort:"대기",queueEmpty:"대기 중인 에이전트 작업이 없습니다.",cancelQueue:"취소",retryQueue:"재시도",sessionRunning:"생성 실행 중",sessionQueued:"{count}개 대기",sessionError:"생성 오류",queueStatus:{queued:"대기",running:"실행 중",succeeded:"완료",failed:"실패",canceled:"취소됨"},statusReady:"준비됨",statusGenerating:"생성 중",statusReconnecting:"연결 복구 중",pending:"응답을 생성하는 중...",pendingQueued:"대기열에서 기다리는 중...",pendingPlanning:"응답을 계획하는 중...",pendingGenerating:"도구 실행·생성 진행 중...",runError:"실행 중 오류가 발생했어요",errorRole:"오류",composerPlaceholder:"무엇이든 물어보거나 만들 것을 설명하세요",slashCommands:"에이전트 슬래시 명령",slashDesc_question:"이미지 생성 없이 질문",slashDesc_variants:"N개 이미지 변형 생성 (1-24)",slashDesc_generate:"bounded fanout 생성 (1-24)",slashDesc_parallelism:"동시 실행 제한",slashDesc_help:"사용 가능한 명령어 도움말",attachReference:"참조 첨부",send:"전송",webSearch:"검색 사용",emptyChat:"메시지를 입력하면 이미지 또는 비디오 작업이 시작됩니다.",emptyJumpLatest:"최신 메시지로 이동",queueSummary:"활성 {active} · 실패 {failed}",queuePlanSummary:"변형 {variants}개 · 병렬 {parallel}",queueDetails:"기술 상세",queueAnnouncement:"큐 업데이트: 실행 {running}, 대기 {queued}, 실패 {failed}",queueTimeAgo:"{value}{unit} 전",queueTimeUnit:{second:"초",minute:"분",hour:"시간"},progressQueued:"큐 대기 중",progressPlanning:"요청 준비 중",progressGenerating:"생성 중",progressDownloading:"결과 다운로드 중",progressFailed:"실행 실패",progressJob:"{kind} · 변형 {count}개",mediaKind:{image:"이미지",video:"비디오"},mediaSelect:"미디어 포커스",mediaLoading:"비디오 불러오는 중",mediaLoadFailed:"비디오를 불러오지 못했습니다.",mediaRetry:"재시도",mediaVideoLabel:"생성된 비디오",mediaDuration:"길이 {duration}",mediaDurationUnknown:"길이 정보 없음",mediaDownload:"다운로드",imagePane:"이미지",currentImage:"현재 이미지",openImage:"이미지 열기",closeImage:"이미지 닫기",selectImage:"이미지 포커스",variants:"변형",contextTabs:"이미지 컨텍스트",imageTab:"이미지",refsTab:"참조",webTab:"웹 근거",memoryTab:"기억",noImage:"현재 이미지 없음",noRefs:"참조 없음",noWeb:"웹 근거 없음",memoryItemStyle:"스타일 잠금은 이미지 컨텍스트에 보존됩니다.",memoryItemSubject:"피사체 잠금은 재개 후에도 복원됩니다.",imageAlt:"에이전트 이미지",filename:"파일",prompt:"프롬프트",stageEmptyHint:"첫 요청을 보내면 여기에서 이미지를 확인할 수 있습니다",openTools:"도구 패널 열기",closeTools:"도구 패널 닫기"},X0={workspace:"카드뉴스 작업공간",composer:"카드뉴스",composerHint:"템플릿은 스냅샷 기준이고, 출력 크기는 별도로 지정합니다.",topic:"주제",topicPlaceholder:"예: 중간고사 역전 플랜",audience:"대상",audiencePlaceholder:"예: 학부모",goal:"목표",goalPlaceholder:"예: 상담 신청",brief:"내용",briefPlaceholder:"카드뉴스에 들어갈 핵심 내용과 금지사항을 적어주세요.",outputSize:"출력 크기",customSize:"직접",draft:"초안 만들기",drafting:"초안 작성 중...",generateSet:"세트 생성",batchGenerate:"일괄 생성",generating:"생성 중...",generated:"{count}장 생성 완료.",missingGeneratedCard:"생성 응답에 이 카드가 포함되지 않았습니다.",error:"카드 생성에 실패했습니다.",imageTemplate:"이미지 템플릿",roleTemplate:"카드 구조",newTemplateLater:"커스텀 템플릿은 dev MVP 이후에 지원합니다",emptyTitle:"초안 대기 중",emptyBody:"왼쪽 설정으로 카드 덱을 준비합니다.",inspector:"카드 편집",cardTitle:"카드 제목",headline:"제목",body:"본문",visualPrompt:"이미지 프롬프트",summaryCopy:"요약 문구",designPrompt:"장면 / 디자인 프롬프트",textFields:"텍스트 박스",addTextField:"텍스트 박스 추가",removeTextField:"삭제",noTextFields:"아직 텍스트 박스가 없습니다.",textFieldText:"텍스트",textKind:"종류",placement:"위치",renderMode:"표시 방식",hierarchyLabel:"위계",textTooLong:"권장 길이를 초과했습니다.",selectTextField:"텍스트 박스 선택: {text}",textKinds:{headline:"제목",body:"설명 텍스트",caption:"캡션",cta:"행동 유도",badge:"배지",number:"숫자"},renderModes:{"in-image":"이미지에 표시","ui-only":"메모만"},hierarchy:{primary:"주요",secondary:"보조",supporting:"부가"},placements:{"top-left":"좌측 상단","top-center":"상단 중앙","top-right":"우측 상단","center-left":"좌측 중앙",center:"중앙","center-right":"우측 중앙","bottom-left":"좌측 하단","bottom-center":"하단 중앙","bottom-right":"우측 하단",free:"직접 지정"},roles:{cover:"표지",hook:"후킹",problem:"문제",insight:"인사이트",example:"예시",data:"데이터",summary:"요약",cta:"행동 유도"},locked:"잠김",unlocked:"열림",noCard:"선택된 카드 없음",generatedMeta:"생성 메타데이터",lockedHelp:"잠긴 카드는 일괄 생성과 재시도에서 제외됩니다.",retryCard:"이 카드 재시도",actions:{copyPrompt:"프롬프트 복사",copyCopy:"문구 복사",openImage:"이미지 열기",downloadCard:"다운로드"},status:{draft:"초안",queued:"대기",generating:"생성 중",generated:"완료",error:"오류",skipped:"제외",locked:"잠김"},progress:{generating:"생성 중 {done}/{total}",summary:"완료 {done}/{total}",detail:"대기 {queued} · 오류 {errors} · 제외 {skipped}",cardGenerating:"이 카드를 생성 중입니다."},planner:{structured:"구조화 JSON",jsonMode:"JSON 모드",repaired:"보정됨",fallback:"기본 초안",jsonOnlyHelp:"초안은 JSON만 만들고 이미지는 나중에 생성합니다.",error:"초안 생성 실패"}},Q0={selectedCameraPresets:"선택한 카메라 모션 프리셋",plannerModelTitle:"플래너 모델",reasoningEffortTitle:"추론 강도",modeLabel:"비디오 모드",mode:{"text-to-video":"텍스트 → 비디오 (참조 이미지 없음)","image-to-video":"이미지 → 비디오 (참조 1장)","reference-to-video":"레퍼런스 → 비디오 (참조 {n}장)"},seriesTopicTitle:"시리즈 주제",seriesTopicPlaceholder:"예: 한국 여행 브이로그",durationTitle:"길이",resolutionTitle:"해상도",resolution1080Help:"1080p는 Grok V1.5의 프롬프트 전용 또는 단일 이미지/프레임 영상에서 사용합니다. 참조 2장 이상에서는 사용할 수 없습니다.",aspectTitle:"비율",plannerUpdateFailed:"플래너 모델을 변경하지 못해 이전 설정으로 되돌렸습니다.",continuationFallbackT2V:"이어갈 영상의 마지막 프레임을 추출하지 못했습니다. 텍스트-비디오 방식으로 계속 생성합니다."},J0={appName:"이미지 생성기",imageModelLabel:"모델",imageSectionLabel:"이미지",gptImageSubLabel:"GPT-IMAGE-2",grokImageSubLabel:"Grok Imagine",geminiImageSubLabel:"Gemini",videoSectionLabel:"비디오",imageModelAria:"이미지 모델 선택",quickSettingsAria:"모델과 추론 강도 선택. 현재 모델 {model}, 추론 {effort}",quickSettingsModelOnlyAria:"이미지 모델 선택. 현재 모델 {model}",quickSettingsMenu:"모델 및 추론 빠른 설정",reasoningLabel:"추론",videoModelLabel:"비디오",nodeModeHint:"노드 모드에서는 노드를 눌러 프롬프트를 수정한 뒤 생성하세요. 오른쪽 패널의 설정 (품질/크기)은 새로 만드는 모든 결과에 적용됩니다."},W0={openAria:"설정 열기",openTitle:"설정",closeAria:"설정 닫기",closeTitle:"캔버스로 돌아가기",navAria:"설정 섹션",contentAria:"설정 내용",jumpTo:"{section} 섹션으로 이동",title:"설정",sections:{providers:{title:"프로바이더",hint:"계정 · 키 · 모델"},workspace:{title:"작업공간",hint:"프로필 · 배치 · 갤러리"},general:{title:"일반",hint:"언어"}},account:{primaryEyebrow:"현재 공급자",oauthTitle:"GPT OAuth",oauthBody:"GPT OAuth로 생성할 때 Codex 로그인 세션을 사용해요. 유효한 API 키가 있으면 API 키 모드로 바꿀 수 있어요.",apiSourceEnv:"OPENAI_API_KEY 감지됨",apiSourceConfig:"config.json API 키 감지됨",apiTitle:"OpenAI API 키",apiBody:"ima2-gen은 이 API 키로 Responses API 기반 생성, 편집, 멀티모드, 노드 요청을 처리할 수 있습니다.",apiDisabled:"사용 불가",apiReady:"준비됨",apiUnavailable:"사용 불가",apiUnknown:"상태 불명",grokEyebrow:"로컬 xAI 프록시",grokTitle:"Grok",grokBody:"설정된 로컬 포트의 progrok을 통해 xAI Images API 생성을 사용합니다.",agyEyebrow:"Antigravity CLI",agyTitle:"Gemini (agy)",agyInstalledBody:"로그인 상태는 확인할 수 없습니다. 생성이 실패하면 터미널에서 agy login 을 실행하세요.",agyMissingBody:"설치되지 않았습니다. 설치:",agyMissingLink:"Antigravity CLI",agyFineprint:"antigravity 모델과 이미지 할당량은 별도입니다.",agyInstalled:"설치됨",agyMissing:"미설치",status:{ready:"준비됨",authRequired:"로그인 필요",starting:"시작 중",offline:"오프라인",noImageModel:"이미지 모델 없음",error:"오류",checking:"확인 중"}},quota:{codexNotLoggedIn:"로그인 필요",fetchError:"쿼타를 불러올 수 없음",noData:"사용량 데이터 없음",grokUsageLink:"Grok 사용량 보기 →",switchAccount:"{provider} 계정 전환",startingLogin:"로그인 시작 중…",enterCode:"열린 탭에 이 코드를 입력하세요:",retry:"다시 시도",copyLink:"링크 복사",copied:"복사됨",waitingApproval:"승인 대기 중…",switchComplete:"계정을 전환했습니다. 새로고침 중…",switchFailed:"계정을 전환하지 못했습니다",tryAgain:"다시 시도"},imageModel:{title:"이미지 모델",body:"앞으로 이미지 생성에 쓸 모델을 골라요. Grok 모델을 고르면 공급자도 Grok으로 바뀌어요.",gpt54Mini:"GPT-5.4 Mini",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt56Sol:"GPT-5.6 Sol",gpt56Terra:"GPT-5.6 Terra",gpt56Luna:"GPT-5.6 Luna",grokImagine20:"Grok Imagine Image 2.0",grokImagine:"Grok Imagine",grokImagineQuality:"Grok Imagine Quality",nanoBanana2:"Nano Banana 2",nanoBanana2Api:"Nano Banana 2",nanoBananaPro:"나노 바나나 Pro",atlasCloudGptImage2:"Atlas Cloud GPT Image 2",atlasCloudGptImage2Edit:"Atlas Cloud GPT Image 2 Edit",minimaxImage01:"MiniMax image-01",minimaxImage01Live:"MiniMax image-01-live",agy:"Antigravity (agy)",gpt53CodexSpark:"GPT-5.3 Codex Spark — 이미지 생성 미지원",unsupportedHelp:"Grok 모델은 번들된 로컬 프록시를 통해 xAI Images API를 사용합니다. GPT 모델은 OpenAI Responses 이미지 생성을 사용합니다."},apiKeys:{accordionTitle:"API Keys",envSource:"환경 변수에서 로드됨",configSource:"설정 파일에서 로드됨",openai:{label:"GPT API Key (OpenAI)",placeholder:"OpenAI API 키 붙여넣기 (sk-...)"},xai:{label:"Grok API Key (xAI)",placeholder:"xAI API 키 붙여넣기 (xai-...)"},gemini:{label:"Gemini (Google)",placeholder:"Gemini API 키 붙여넣기 (AI...)"},atlascloud:{label:"Atlas Cloud",placeholder:"Atlas Cloud API 키 붙여넣기 (apikey-...)"},minimax:{label:"MiniMax",placeholder:"MiniMax API 키 붙여넣기"},vertex:{label:"Vertex AI (서비스 계정)",placeholder:'Google Cloud 서비스 계정 JSON 붙여넣기 { "type": "service_account", ... }',authModeApiKey:"API Key",authModeVertex:"Vertex JSON"},save:"저장",saved:"저장됨",saving:"검증 중...",remove:"삭제",saveFailed:"키를 저장하지 못했어요",networkError:"네트워크 오류가 발생했어요. 다시 시도해 주세요.",removeFailed:"키를 삭제하지 못했어요",configuredReplace:"설정됨 — 눌러서 교체",status:{valid:"유효",notConfigured:"미설정"}},videoModel:{grokImagine:"Grok Imagine Video",grokImagine15:"Grok Imagine Video 1.5"},reasoning:{title:"추론 강도",body:"값이 높을수록 생성 전에 plan/검색/프롬프트 보강에 더 많은 reasoning 토큰을 사용합니다.",none:"Off — 추가 추론 없음",low:"Low — 가장 빠름, 추론 최소",medium:"Medium — 기본 균형값",high:"High — 더 깊은 리서치와 통합",xhigh:"Xhigh — 확장 추론, 느림",max:"Max — 최대 추론, 가장 느림"},webSearch:{title:"웹서치",body:"실존 인물, 브랜드, 제품, 장소, 최신 이벤트를 생성 전에 실시간 검색해서 반영합니다.",on:"검색 켬",off:"검색 끔"},grokCompatibility:{title:"Grok 호환성",body:"Grok 이미지 생성은 먼저 필수 웹 검색을 수행하고, 그 다음 텍스트와 첨부 이미지를 함께 보는 image-tool planner가 최종 이미지 프롬프트를 영어로 작성한 뒤 xAI Images API로 실행됩니다. 첨부 레퍼런스는 xAI 이미지 편집 경로로 유지되고, 크기는 aspect ratio/resolution으로 매핑됩니다. 출력 포맷·모더레이션·추론은 GPT OAuth/API 키 공급자에서만 사용됩니다."},grokPlanner:{title:"Grok planner 모델",body:"검색과 이미지·비디오 프롬프트를 기획하는 모델입니다. 기본값은 Grok 4.5이며 I2V·Ref2V 기획에서 이미지 입력을 지원합니다. Grok 4.3은 호환 선택지로 남아 있습니다."},gallery:{defaultScopeTitle:"기본 갤러리 보기",defaultScopeBody:"갤러리를 열 때 처음 보여줄 범위를 선택합니다."},appearance:{historyStripLayoutTitle:"히스토리 썸네일",historyStripLayoutBody:"작업공간 옆 작은 히스토리 배열 방식을 고릅니다.",historyStripLayout:{rail:"세로",horizontal:"상단 가로",sidebar:"사이드바"}},language:{title:"언어",body:"생성 프롬프트와 무관하게 인터페이스 언어만 바꿉니다."}},Z0={loading:"세션 불러오는 중...",addFirst:"+ 첫 노드 추가",addRootTitle:"루트 노드 추가",hint:"핸들을 빈 공간으로 드래그하면 새 브랜치가 생깁니다. Delete 또는 Backspace로 삭제할 수 있습니다."},eC={title:"{provider} 사용 불가",ariaLabel:"{provider} 사용 불가"},tC={label:"언어",ko:"한국어",en:"English","zh-Hant":"正體中文","zh-Hans":"简体中文"},nC={close:"닫기",details:"자세한 원본 오류 보기",unknown:{title:"알 수 없는 오류가 발생했어요",body:"잠시 후 다시 시도해 주세요. 문제가 계속되면 원본 오류 메시지를 복사해 제보해 주세요."},moderationRefused:{title:"프롬프트가 모더레이션에 걸렸어요",body:"표현 수위를 낮추거나 다른 문구로 바꿔 보세요. 레퍼런스 이미지의 선정적/폭력적 요소도 영향을 줄 수 있어요.",cta:"프롬프트 수정",bodyInput:"프롬프트 텍스트가 입력 필터에 걸렸어요. 표현을 바꾸거나 다른 문구로 시도해 보세요.",bodyOutput:"이미지가 생성 후 출력 필터에 걸렸어요. 스타일이나 품질 설정을 바꿔 보세요."},emptyResponse:{title:"이미지가 돌아오지 않았어요",body:"Codex가 응답을 보냈지만 이미지 데이터가 비어 있었어요. 모더레이션 문제가 아니라 일시적 오류이거나 지원되지 않는 옵션 조합일 수 있어요. 다시 시도하거나 크기·품질·모델을 바꿔 보세요.",cta:"다시 시도"},streamParseFailed:{title:"이미지 응답 스트림을 해석하지 못했어요",body:"응답 데이터는 도착했지만 앱이 이미지 스트림을 끝까지 읽지 못했어요. 네트워크 프록시나 일시적인 스트림 오류일 수 있어요.",cta:"다시 시도"},imageToolNotCalled:{title:"이미지 도구가 호출되지 않았어요",body:"응답은 완료됐지만 이미지 생성 도구 호출이 확인되지 않았어요. 같은 프롬프트로 다시 시도하거나 모델/검색 옵션을 바꿔 보세요.",cta:"다시 시도"},webSearchOnlyResponse:{title:"이미지 도구가 호출되지 않았어요",body:"웹 검색 도구만 호출되고 이미지 생성 도구가 실행되지 않았어요. 검색 옵션을 끄거나 다시 시도해 주세요.",cta:"다시 시도"},imageToolFailed:{title:"이미지 도구 호출이 실패했어요",body:"이미지 생성 도구가 호출됐지만 실패 상태로 끝났어요. 문제가 반복되면 `ima2 doctor image-probe --json` 결과와 함께 제보해 주세요.",cta:"다시 시도"},imageToolNoResult:{title:"이미지 데이터가 비어 있었어요",body:"이미지 도구 호출은 완료됐지만 결과 이미지가 포함되지 않았어요. 옵션 조합이나 계정 권한 문제일 수 있어요.",cta:"다시 시도"},oauthImageCapabilityUnavailable:{title:"현재 계정에서 이미지 도구를 사용할 수 없는 것 같아요",body:"GPT OAuth 로그인은 되어 있지만, 이 계정/모델 조합에서 이미지 생성 도구 권한이 없을 수 있어요. API-Key 모드나 다른 모델로 확인해 주세요.",cta:"확인"},responsesStreamError:{title:"이미지 응답 스트림이 오류로 종료됐어요",body:"OpenAI 응답 스트림에서 오류 이벤트가 반환됐어요. 잠시 후 다시 시도하고, 반복되면 원본 오류 세부 정보를 확인해 주세요.",cta:"다시 시도"},upstream5xx:{title:"OpenAI 서버가 혼잡합니다",body:"잠시 후 다시 시도하면 대부분 해결돼요. 상태 페이지(status.openai.com)도 확인해 보세요.",cta:"다시 시도"},authChatgptExpired:{title:"Codex ChatGPT 로그인이 만료됐어요",body:"터미널에서 `ima2 setup`을 다시 실행한 뒤(옵션 1) 앱을 새로고침해 주세요.",cta:"새로고침"},authApiKeyInvalid:{title:"API 키 인증 실패",body:"키가 없거나 잘못됐거나, 한도/조직 권한 문제가 있을 수 있어요. GPT OAuth로 전환하거나 설정된 API 키를 갱신해 주세요.",cta:"확인"},networkFailed:{title:"네트워크 연결 실패",body:"OpenAI 또는 로컬 런타임 서비스에 연결하지 못했어요. 먼저 새로고침하고, 계속되면 VPN/방화벽과 `ima2 doctor`에 표시되는 포트를 확인해 주세요.",cta:"새로고침"},oauthUnavailable:{title:"GPT OAuth 프록시를 사용할 수 없어요",body:"GPT OAuth 프록시가 아직 시작 중이거나, 사용할 수 없거나, fallback 포트로 이동했을 수 있어요. 먼저 새로고침하고, 계속되면 `ima2 doctor`의 GPT OAuth URL을 확인해 주세요.",cta:"새로고침"},invalidRequest:{title:"이미지 요청을 수정해야 해요",body:"생성 요청의 일부 값이 올바르지 않습니다. 아래 원본 오류를 확인한 뒤 프롬프트나 크기를 수정해 다시 시도해 주세요.",cta:"입력 수정"},apikeyDisabled:{title:"API-Key 모드를 사용할 수 없어요",body:"이 빌드는 API-Key 생성을 지원하지만 현재 요청에서 설정된 키를 사용할 수 없었습니다. GPT OAuth로 전환하거나 API 키를 갱신해 주세요.",cta:"확인"},agyGenerationFailed:{title:"Gemini 생성 실패",body:"Antigravity CLI에서 오류가 발생했습니다. agy 바이너리가 설치되어 있고 Gemini 계정이 활성화되어 있는지 확인하세요.",cta:"재시도"},agyTimeout:{title:"Gemini 생성 시간 초과",body:"agy 프로세스가 제한 시간(360초) 내에 응답하지 않았습니다. 다시 시도하거나 agy CLI 상태를 확인하세요.",cta:"재시도"},agyProcessError:{title:"Gemini 프로세스 오류",body:"agy CLI가 예기치 않은 오류로 종료되었습니다. 'agy --version'으로 바이너리가 정상인지 확인하세요.",cta:"재시도"},agyQuotaExhausted:{title:"Gemini 할당량 소진",body:"Gemini 이미지 생성 용량이 소진되었습니다. 할당량은 자동으로 리셋됩니다 — 에러 상세에서 리셋 타이머를 확인하세요.",cta:"확인"},authClass:{title:"로그인이 필요합니다",body:"공급자 인증이 만료됐거나 키가 거부됐습니다. 설정에서 다시 로그인해 주세요.",cta:"다시 로그인"},billingRequired:{title:"잔액이 부족합니다",body:"이 공급자 계정에 사용 가능한 크레딧이 없습니다. 공급자 콘솔에서 잔액을 확인한 뒤 다시 시도해 주세요."}},aC={title:"프롬프트 라이브러리",saveTitle:"프롬프트 라이브러리에 저장",save:"저장",saved:"프롬프트를 저장했습니다",saveFailed:"저장에 실패했습니다",name:"이름",tags:"태그",search:"프롬프트 검색...",favorites:"즐겨찾기",load:"불러오기",insert:"삽입",inserted:"프롬프트를 삽입했습니다",removeInserted:"삽입한 프롬프트 {name} 제거",favorite:"즐겨찾기",unfavorite:"즐겨찾기 해제",empty:"저장된 프롬프트가 없어요.",content:"내용",copy:"복사",untitled:"제목 없음",addNew:"새 프롬프트 추가",import:"불러오기",importFiles:".txt, .md, .markdown 또는 GitHub 파일 불러오기",dropImport:".txt, .md, .markdown 파일을 놓으면 프롬프트로 가져옵니다",importTitle:"프롬프트 가져오기",importDropTitle:"파일을 여기에 드래그하세요",importDropHint:".txt, .md, .markdown 파일을 preview한 뒤 저장합니다",importChooseFiles:"파일 선택",importGithubLabel:"GitHub 파일 URL 또는 경로",importPreview:"미리보기",importPreviewEmpty:"파일을 드래그하거나 GitHub 경로를 입력하면 후보가 표시됩니다.",importCommit:"선택 항목 저장",importSelected:"선택한 프롬프트 불러오기 ({count})",importThisPrompt:"이 프롬프트 불러오기",previewPrompt:"내용 보기",selectPrompt:"선택",selectedPrompt:"선택됨",selectedCount:"{count}개 선택됨",selectAllCandidates:"전체 선택",clearCandidateSelection:"선택 해제",addAnotherSource:"다른 소스 추가",searchResultsHeader:"검색 결과 ({count}개)",searchResults:"검색 결과",promptText:"프롬프트 내용",importSelectAtLeastOne:"저장할 프롬프트를 하나 이상 선택하세요.",imported:"프롬프트 {count}개를 가져왔습니다",importFailed:"가져오기에 실패했습니다",importNoValidFiles:".txt, .md, .markdown 프롬프트 파일이 없습니다.",curatedSources:"추천 소스",curatedSourcesHint:"검토된 공개 프롬프트 소스 검색",curatedSearch:"검색",curatedSearchPlaceholder:"nano banana, gpt-image-2, typography...",refreshSource:"갱신",curatedRefreshed:"프롬프트 후보 {count}개를 인덱싱했습니다",sourceTrustTier:"소스 신뢰도",requiresAttribution:"출처 표시 필요",sourceDetails:"출처",license:"라이선스",attributionRequired:"출처 표기 필요",modelHints:"모델 힌트",taskHints:"작업 힌트",warnings:"경고",compatibilityWarnings:"호환성 경고",transparentUnsupportedGptImage2:"gpt-image-2는 투명 배경을 지원하지 않습니다",noCuratedResults:"추천 소스에서 프롬프트 후보를 찾지 못했습니다.",discovery:"발견",discoverySearch:"GitHub 검색",discoverySearchPlaceholder:"프롬프트 저장소 검색...",discoveryCandidates:"발견 후보",discoveryApprove:"승인",discoveryReject:"거절",discoveryApproved:"승인됨",discoveryRejected:"거절됨",discoveryScore:"점수",discoveryWarnings:"발견 경고",discoveryRateLimited:"GitHub discovery가 rate limit에 걸렸습니다.",discoveryNoResults:"발견 후보가 없습니다.",discoveryReviewQueue:"검토 대기열",discoveryRequiresPaths:"기본 검색 전에 검토된 파일 경로를 추가하세요.",folderBrowse:"폴더 보기",folderBrowseHint:"GitHub 폴더의 지원 파일만 불러옵니다",folderFiles:"폴더 파일",folderFilesEmpty:"가져올 수 있는 .md / .markdown / .txt 파일이 없습니다",folderPreviewSelected:"선택 파일 미리보기",folderSelectedCount:"{count}개 선택됨",folderWarnings:"폴더 경고",folderTooManyFiles:"파일이 너무 많아 일부만 표시했습니다",folderNoSelection:"미리볼 파일을 선택하세요",folderUnsupported:"GitHub 폴더만 지원합니다"},oC={title:"프롬프트 빌더",subtitle:"맥락을 이어가며 최종 프롬프트를 정리합니다.",scopeDraft:"새 작업",scopeImage:"선택 이미지: {name}",scopeImageFallback:"현재 이미지",newWorkTitle:"이미지 컨텍스트 없이 새 작업 시작",model:"빌더 모델",empty:"원하는 방향을 말해보세요. 현재 프롬프트와 설정을 함께 참고합니다.",user:"나",assistant:"빌더",placeholder:"어떤 이미지를 만들어볼까요?",send:"전송",sending:"작성 중",thinking:"프롬프트를 정리하는 중...",clear:"비우기",applyToPrompt:"본문에 적용",insertAsBlock:"블록 삽입",finalKoreanPrompt:"한국어 프롬프트",finalEnglishPrompt:"영어 프롬프트",blockName:"빌더 제안",applied:"빌더 제안을 본문 프롬프트에 적용했습니다",inserted:"빌더 제안을 프롬프트 블록으로 삽입했습니다",failed:"프롬프트 빌더 호출에 실패했습니다",removeScopeImage:"빌더에서 선택 이미지 제외",removeAttachment:"첨부 {name} 제거",attach:"파일 첨부",attachmentOnlyMessage:"첨부한 파일을 참고해서 프롬프트를 도와줘"},rC={sectionTitle:"작업 공간",sectionBody:"작업 공간 레이아웃 프로필을 선택합니다.",profileLabel:"작업 공간 프로필",defaultLabel:"기본",defaultDesc:"사이드바 컴포저가 있는 기본 생성 흐름.",promptStudioLabel:"프롬프트 스튜디오",promptStudioDesc:"프롬프트 빌더 패널, 그룹 히스토리, 향상된 뷰어."},iC={controls:"이미지 확대 컨트롤",zoomIn:"확대",zoomOut:"축소",reset:"확대 초기화"},lC={title:"로그",empty:"생성 로그가 없습니다",copied:"프롬프트 복사됨",copy:"클릭하여 프롬프트 복사",loadFailed:"생성 로그를 불러오지 못했습니다.",retry:"다시 시도"},sC={writeFailed:"클립보드에 복사하지 못했습니다."},cC={graphSaveFailed:"노드 그래프를 저장하지 못했습니다.",sessionSwitchSaveFailed:"현재 그래프를 저장하지 못해 세션 전환을 중단했습니다.",sessionInitialLoadFailed:"세션을 불러오지 못했습니다.",sessionInitialLoadRetry:"세션을 불러오지 못했습니다. 지금 다시 시도할까요?",attachmentReadFailed:"하나 이상의 첨부 파일을 읽지 못했습니다."},dC={ariaLabel:"기본 내비게이션",home:"홈",create:"생성",node:"노드 그래프",agent:"에이전트",assets:"보관함",assetGen:"에셋 생성",settings:"설정"},uC={title:"에셋 생성",lede:"이미지를 만들고 클릭 한 번으로 배경까지 지워 보세요.",prompt:"프롬프트",promptPlaceholder:"빨간 사과 하나, 스튜디오 제품 촬영",background:"배경",backgroundHint:"녹색 배경일 때 배경 제거가 가장 깨끗합니다. 잘 모르겠다면 녹색 그대로 두세요.",bgChroma:"크로마 그린",bgWhite:"하양",bgBlack:"블랙",model:"모델",modelGpt:"GPT",modelGrok:"Grok",kind:"출력",kindImage:"이미지",kindVideo:"비디오",videoSoon:"비디오 에셋은 다음 단계에서 열립니다",videoGrokOnly:"비디오 생성은 Grok에서 동작합니다 — 모델을 Grok으로 바꿔 주세요",videoOptions:"비디오 옵션",videoDuration:"길이",videoResolution:"해상도",videoAspect:"화면 비율",generate:"에셋 생성",generating:"생성 중…",emptyTitle:"아직 에셋이 없습니다",emptyBody:"왼쪽에 프롬프트를 쓰고 “에셋 생성”을 누르세요. 결과는 여기에 나타나고 프로젝트에 자동 저장됩니다.",previewImage:"이미지 미리보기 열기: {prompt}",previewVideo:"비디오 미리보기 열기: {prompt}",previewDialogTitle:"미리보기: {prompt}",closePreview:"미리보기 닫기",zoomIn:"확대",zoomOut:"화면에 맞춤",openHintImage:"크게 보기",openHintVideo:"재생",imageFallback:"생성된 이미지",videoFallback:"생성된 비디오",emptyCta:"첫 프롬프트 쓰기",errorTitle:"생성에 실패했습니다",errorHint:"모델과 API 키 설정을 확인하고 다시 시도해 주세요.",errorDismiss:"닫기",savedHint:"결과는 프로젝트에 자동 저장됩니다.",savedLink:"에셋 탭에서 보기",railTitle:"프로젝트 에셋",railEmpty:"이 프로젝트에 저장된 에셋이 아직 없습니다.",railError:"프로젝트 에셋을 불러오지 못했습니다.",sequence:"시퀀스",candidates:"후보 보관함",frameAria:"{rail}의 {n}번 프레임",addFrame:"추가",removeFrame:"빼기",deleteFrame:"{n}번 프레임 삭제"},mC={select:"프로젝트",unassigned:"미분류",new:"새 프로젝트…",newPrompt:"프로젝트 이름",search:"프로젝트 찾기…",searchPlaceholder:"프로젝트 검색",searchEmpty:"일치하는 프로젝트가 없습니다",close:"닫기",saveRetry:"저장 다시 시도"},pC={title:"스프라이트 큐레이터",open:"큐레이션",close:"큐레이터 닫기",state:"애니메이션 상태",unsaved:"저장하지 않은 변경",discardConfirm:"저장하지 않은 스프라이트 변경을 버릴까요?",loadError:"스프라이트 실행 결과를 불러오지 못했습니다.",saveError:"큐레이션을 저장하지 못했습니다.",bakeError:"스프라이트 아틀라스를 굽지 못했습니다.",exportError:"스프라이트 애니메이션을 내보내지 못했습니다.",previous:"이전 프레임",play:"재생",pause:"일시 정지",next:"다음 프레임",speed:"속도",grid:"격자",transform:"프레임 변형",rotate:"회전",scale:"크기",dx:"가로 이동",dy:"세로 이동",shx:"가로 기울기",shy:"세로 기울기",flipX:"좌우 뒤집기",sequence:"시퀀스 — 재생·굽기 순서",candidates:"후보 보관함",frameAria:"{rail}의 {n}번 프레임",addFrame:"추가",removeFrame:"빼기",deleteFrame:"{n}번 프레임 삭제",save:"큐레이션 저장",bake:"아틀라스 굽기",contactSheet:"콘택트 시트",gif:"GIF 내보내기",status:{loading:"불러오는 중…",ready:"저장됨",saving:"저장 중…",baking:"굽는 중…",exporting:"내보내는 중…",error:"작업 실패"}},fC={title:"배경 제거",open:"배경 제거",original:"원본",originalAlt:"배경 제거 전 원본",removed:"배경 제거",previewLoading:"제거 결과를 준비하는 중…",resultBadge:"배경 제거됨",keyColor:"키 색상",pickHint:"프리뷰를 클릭하면 키 색상을 다시 고릅니다",clickMode:"프리뷰 클릭 동작",modeErase:"클릭해서 지우기",modePick:"키 색 선택",eraseHint:"빈 공간을 클릭하면 이어진 그 영역만 지워집니다",undoClick:"클릭 취소 ({count})",previewAlt:"체커보드 위 키잉 프리뷰",tolerance:"제거 강도",softness:"경계 부드러움",spill:"색 번짐 제거",unmix:"경계 언믹스",unmixHint:"반투명 경계를 복원합니다 (크로마 키 전용)",reset:"기본값",download:"알파 PNG 내려받기",save:"프로젝트에 저장",saving:"저장 중…",videoSave:"알파 WebM 생성",videoKeying:"비디오 키잉 중… {seconds}s",videoSaved:"알파 WebM을 프로젝트에 저장했습니다",saved:"알파 PNG를 프로젝트에 저장했습니다",saveError:"키잉 결과를 저장하지 못했습니다",loadError:"이미지를 불러오지 못했습니다. 닫고 다시 시도해 주세요.",advanced:"제거 세부 조정 (고급)"},gC={ariaLabel:"빠른 작업",animate:"영상으로",edit:"캔버스에서 편집",useAsRef:"참조로 사용",rebake:"다시 굽기",refAdded:"참조 이미지로 추가됨",refFailed:"참조 추가 실패",saveToAssets:"보관",savedToAssets:"보관함에 저장됨",saveToAssetsFailed:"보관함 저장 실패"},hC={title:"보관함",clearAll:"전체 삭제",clearConfirm:"저장된 자산을 모두 삭제할까요? 되돌릴 수 없습니다.",testSheetsUnavailable:"요소 테스트 시트는 아직 사용할 수 없습니다.",detailAria:"{name} 상세",searchPlaceholder:"보관함 검색…",allAssets:"전체 보기",elementLibrary:"요소 라이브러리",removeFromElements:"요소 라이브러리에서 제거",emptyElementsTitle:"아직 요소가 없어요",emptyElementsBody:"요소는 @멘션으로 재사용하는 영구 참조(캐릭터·제품·스타일·장면)예요. 갤러리 이미지를 에셋으로 저장해 요소로 만들고, 어디서든 @로 불러오세요.",newFolder:"새 폴더",kindAll:"모든 유형",kindImage:"이미지",kindVideo:"비디오",kindElement:"요소",kindPreset:"프리셋",kindTemplate:"템플릿",emptyTitle:"아직 보관된 자산이 없어요",emptyBody:"아직 저장된 게 없습니다. 에셋 생성 탭에서 첫 이미지를 만들어 보세요 — 결과는 여기에 자동 저장됩니다.",emptySearchTitle:"일치하는 항목 없음",emptySearchBody:"다른 검색어나 태그, 유형 필터를 써보세요.",emptyFolderTitle:"빈 폴더예요",emptyFolderBody:"자산을 이 폴더로 옮기거나 새 결과물을 저장해보세요.",deleteAsset:"보관함에서 제거",confirmDelete:"삭제할까요?",loadMore:"더 불러오기",rootFolder:"최상위",renameFolder:"폴더 이름 변경",renameAsset:"에셋 이름 변경",starAsset:"에셋에 별표 추가",unstarAsset:"에셋 별표 해제",deleteFolder:"폴더 삭제",actionFailed:"작업 실패",starSaved:"에셋에 추가했어요",starSaveFailed:"별표는 저장했지만 에셋에는 추가하지 못했어요",itemCount:"{count}개",emptyCta:"에셋 생성 탭 열기",loadErrorTitle:"에셋을 불러오지 못했습니다",loadErrorBody:"라이브러리를 불러오는 중 문제가 생겼습니다.",retry:"다시 시도",detailClose:"상세 닫기",detailKind:"종류",detailCreated:"생성일",detailProvider:"모델",detailPrompt:"프롬프트",detailTags:"태그",bindingsTitle:"프로바이더 바인딩",bindingsHelp:"이 캐릭터를 외부 프로바이더와 연결하는 설정입니다.",bindingStateless:"생성마다 refs 전송",bindingTagPlaceholder:"runway @tag (선택)",bindingSave:"바인딩 저장",bindingSaving:"저장 중…",bindingTagInvalid:"태그는 1-32자 영문/숫자/밑줄/하이픈만 가능합니다.",bindingCapWarning:"refs가 {count}장입니다 — Runway는 생성당 최대 3장입니다.",bindingTrain:"Soul ID 학습",bindingTrainLockedHint:"Higgsfield 유료 플랜이 필요합니다.",bindingPaidPlan:"유료 플랜 필요",bindingDriftWarning:"refs가 학습 시점과 다릅니다 — 재학습을 고려하세요."},yC={name:"노드 스튜디오",toolbar:{addImage:"이미지 추가",templates:"템플릿",saveTemplate:"템플릿 저장",branch:"분기"},empty:{title:"이미지 워크플로 만들기",description:"프롬프트에서 시작하거나, 검증된 그래프를 불러오거나, 최근 작업을 이어가세요.",blankTitle:"빈 캔버스에서 시작",blankDescription:"프롬프트 노드 하나를 추가해 원하는 흐름을 직접 만드세요.",blankAction:"빈 캔버스 시작",templateTitle:"템플릿으로 시작",templateDescription:"자주 쓰는 생성 흐름을 담은 그래프를 복사해 시작하세요.",templateAction:"템플릿 보기",recentTitle:"최근 그래프 이어서",recentDescription:"가장 최근에 저장된 정상 그래프를 이어서 작업하세요.",recentUnavailable:"아직 이어서 열 수 있는 최근 그래프가 없어요.",recentAction:"최근 작업 열기",resumeError:"최근 그래프를 열지 못했어요. 다시 시도해 주세요."},elements:{ariaLabel:"요소 노드",title:"요소",hint:"드래그하거나 추가",loading:"요소를 불러오는 중…",loadError:"요소를 불러오지 못했어요. 다시 시도해 주세요.",empty:"아직 저장된 요소가 없어요.",addToCanvas:"캔버스에 추가"},elementNode:{untitled:"이름 없는 요소",referencesOutput:"요소 참조 출력",notesOutput:"요소 메모 출력",kind:"요소",referenceCountOne:"참조 {count}개",referenceCount:"참조 {count}개",missing:"이 요소는 삭제되었어요. 실행하기 전에 다시 연결해 주세요."},elementController:{onlyElements:"캔버스에는 요소 에셋만 추가할 수 있어요.",invalid:"요소 노드가 올바르지 않아요.",addError:"요소를 캔버스에 추가하지 못했어요."},branch:{defaultVariant:"변형 {index}",eyebrow:"워크플로 분기",title:"변형 만들기",close:"분기 창 닫기",variantLegend:"변형 {index}",label:"이름",provider:"프로바이더",modelOverride:"모델 변경",currentModel:"현재 모델 사용",sizeOverride:"크기 변경",currentSize:"현재 크기 사용",remove:"삭제",add:"변형 추가",cancel:"취소",create:"분기 만들기",selectSourceError:"연결된 소스 노드 하나를 선택해 주세요.",applyError:"분기를 적용하지 못해 그래프를 변경하지 않았어요."},templates:{previewAria:"{name} 그래프 미리보기",nodeCountOne:"노드 {count}개",nodeCount:"노드 {count}개",outputCountOne:"출력 {count}개",outputCount:"출력 {count}개",rename:"이름 변경",delete:"삭제",deleteConfirm:"“{name}” 템플릿을 삭제할까요? 되돌릴 수 없습니다.",title:"템플릿 선택",close:"템플릿 닫기",searchLabel:"템플릿 검색",searchPlaceholder:"이름 또는 태그",loading:"템플릿을 불러오는 중…",empty:"“{query}”와 일치하는 템플릿이 없어요.",starter:"기본 템플릿",yours:"내 템플릿",cancel:"취소",copy:"복사본 만들기",loadError:"템플릿을 불러오지 못했어요. 다시 시도해 주세요.",replaceConfirm:"현재 그래프를 이 템플릿 복사본으로 바꿀까요?",invalidGraph:"템플릿 그래프가 올바르지 않아요.",copyError:"템플릿을 복사하지 못했어요.",namePrompt:"템플릿 이름",saved:"템플릿을 저장했어요.",saveError:"템플릿을 저장하지 못했어요.",renamePrompt:"템플릿 이름 변경",renameError:"템플릿 이름을 바꾸지 못했어요.",deleteError:"템플릿을 삭제하지 못했어요."},palette:{ariaLabel:"노드 삽입 명령",compatiblePlaceholder:"{portType}와 연결할 노드 검색",searchPlaceholder:"노드 검색",filter:"{portType} 입력을 받을 수 있는 노드만 표시합니다.",emptyCompatible:"{portType} 입력을 받을 수 있는 노드가 없어요.",emptySearch:"검색과 일치하는 노드가 없어요.",commandsAria:"노드 명령",categories:{input:"입력",generate:"생성",transform:"변환",reference:"참조",output:"출력"}},commands:{"image-generate":{label:"이미지 생성",description:"워크플로에 이미지 노드를 추가합니다."}},portTypes:{prompt:"프롬프트",image:"이미지",images:"이미지 모음",video:"비디오",mask:"마스크","element-refs":"요소 참조","element-notes":"요소 메모",settings:"설정","any-media":"모든 미디어"},compatibility:{sameDirection:"출력 포트를 입력 포트에 연결해 주세요.",typeMismatch:"두 포트 유형은 서로 연결할 수 없어요.",cardinality:"이 입력에는 이미 연결된 노드가 있어요.",selfEdge:"노드는 자기 자신에 연결할 수 없어요.",duplicateEdge:"이미 같은 연결이 있어요.",unknownPort:"이 포트는 연결에 사용할 수 없어요.",cycle:"이 연결은 순환 고리를 만들기 때문에 연결할 수 없습니다."}},vC={tabs:{label:"에셋 작업 방식",generate:"일반 생성",sprite:"스프라이트"},title:"스프라이트 레시피",lede:"캐릭터 기준 앵커를 확정한 뒤 일관된 애니메이션 행을 생성합니다.",loading:"스프라이트 레시피를 불러오는 중…",loadError:"레시피를 불러오지 못했습니다.",retry:"다시 시도",empty:{title:"스프라이트 레시피 만들기",body:"캐릭터, 셀 크기, 애니메이션 상태를 정의하세요.",create:"레시피 만들기"},recipe:{select:"레시피",new:"새 레시피",name:"레시피 이름",characterId:"캐릭터 ID",description:"설명",style:"스타일",baseAssetId:"기준 이미지 에셋",baseAsset:"기준 이미지 에셋",save:"레시피 저장",saving:"저장 중…",unsaved:"생성 전에 변경 내용을 저장하세요."},cell:{title:"셀 크기",width:"너비",height:"높이",safeMarginX:"가로 여백",safeMarginY:"세로 여백"},chroma:{title:"크로마키",hex:"크로마 색상"},states:{title:"애니메이션 상태",add:"상태 추가",remove:"삭제",key:"상태 키",frames:"프레임",fps:"FPS",loop:"반복",action:"동작"},anchor:{title:"아이덴티티 앵커",missing:"행 생성 전에 idle 포즈를 생성하고 승인하세요.",generate:"idle 후보 생성",generating:"생성 중…",candidate:"검토할 후보가 준비되었습니다.",regenerate:"다시 생성",approve:"앵커 승인",approved:"앵커 승인됨",replace:"앵커 교체",confirmTitle:"이 아이덴티티 앵커를 승인할까요?",confirmBody:"이후 행은 이 아이덴티티를 재사용하며 기준 이미지는 다시 첨부되지 않습니다.",confirm:"승인",cancel:"취소"},rows:{title:"스프라이트 행",generateAll:"전체 생성",generateSelected:"선택 생성",regenerate:"행 다시 생성",cancel:"취소",preview:"미리보기",anchorRequired:"먼저 앵커를 승인하세요.",saveRequired:"먼저 레시피 변경 내용을 저장하세요.",status:{pending:"대기",queued:"예약됨",running:"생성 중",complete:"완료",error:"오류",canceled:"취소됨"}},error:{INVALID_SPRITE_RECIPE:"필수 레시피 항목을 입력하세요.",ANCHOR_NOT_APPROVED:"먼저 아이덴티티 앵커를 승인하세요.",BASE_REFERENCE_FORBIDDEN:"승인 후에는 기준 이미지를 다시 사용할 수 없습니다.",GENERATION_CANCELED:"생성이 취소되었습니다.",generic:"스프라이트 생성에 실패했습니다."}},bC={undone:"마지막 그래프 변경을 되돌렸습니다.",redone:"그래프 변경을 다시 적용했습니다."},SC={t2i:"텍스트→이미지",i2i:"이미지 편집",t2v:"텍스트→영상",i2v:"이미지→영상",v2v:"영상 이어가기"},xC={title:"요소",titleEdit:"요소 수정",titleNew:"새 요소",saved:"저장됨",ariaLabel:"요소 세부 정보",name:"이름",namePlaceholder:"예: 호두나무 의자",kind:"종류",kindCharacter:"인물",kindProduct:"제품",kindStyle:"스타일",kindScene:"장면",kindReference:"참조",selected:"선택한 요소",mentionAria:"{name}, {kind} 요소",unavailableAria:"{name}, 찾을 수 없는 요소",removeAria:"{name} 요소 삭제",helpCharacter:"반복해서 등장하는 인물이나 대상이에요.",helpProduct:"디자인 디테일을 일정하게 유지할 제품이에요.",helpStyle:"화풍, 재질, 마감 같은 시각 언어예요.",helpScene:"장소나 배경처럼 반복해서 쓰는 환경이에요.",notes:"메모",notesHelp:"외형, 재질처럼 계속 유지할 부분을 적어주세요.",notesPlaceholder:"따뜻한 호두나무 결, 둥근 모서리, 라탄 좌석…",remaining:"{n}자 남음",strength:"참조 반영 강도",strengthHelp:"생성 결과가 이 참조를 얼마나 따를지 정해요.",resetDefault:"기본값으로",saving:"저장 중…",save:"요소 저장",testing:"테스트 시트 만드는 중…",runTest:"테스트 시트 만들기",delete:"삭제",errorName:"저장하기 전에 이름을 지어주세요.",errorRefs:"저장하려면 참조 이미지가 최소 한 장 필요해요.",refsTitle:"참조 이미지",refsHelp:"끌어서 순서를 바꿀 수 있어요. 첫 이미지가 대표로 쓰여요.",refAlt:"참조 이미지 {n}",refPrimary:"대표",refLabel:"설명",refLabelPlaceholder:"정면, 측면, 재질…",refMoveUp:"참조 이미지 {n} 앞으로",refMoveDown:"참조 이미지 {n} 뒤로",refRemove:"삭제",refRemoved:"참조 이미지를 지웠어요.",refUndo:"되돌리기"},AC={common:g0,appBar:h0,sheet:y0,toast:v0,inflight:b0,size:S0,sizeConfirm:x0,quality:A0,moderation:T0,format:C0,count:w0,multimode:I0,metadata:E0,onboarding:R0,readiness:N0,generate:k0,home:_0,billing:M0,history:P0,panel:L0,prompt:O0,canvas:j0,gallery:G0,node:D0,nodeBatch:F0,edge:z0,provider:q0,mcp:U0,grokMode:H0,cost:B0,result:V0,session:K0,uiMode:$0,agent:Y0,cardNews:X0,video:Q0,sidebar:J0,settings:W0,nodeCanvas:Z0,apiDisabled:eC,language:tC,errorCard:nC,promptLibrary:aC,promptBuilder:oC,workspace:rC,viewer:iC,generationLog:lC,clipboard:sC,modal:cC,nav:dC,assetGen:uC,project:mC,spriteCurator:pC,keying:fC,chain:gC,assets:hC,"assets.clearAll":"전체 삭제","assets.clearConfirm":"저장된 자산을 모두 삭제할까요? 되돌릴 수 없습니다.",nodeStudio:yC,sprite:vC,graph:bC,provenance:SC,element:xC},TC={ok:"OK",cancel:"Cancel",delete:"Delete",close:"Close",saving:"Saving...",loading:"Loading...",dismiss:"Dismiss notification",generating:"Generating…",imageCollection:"{n} image collection",remove:"Remove",removeNamed:"Remove {name}",elementSuggestions:"Element suggestions",noMatchingElements:"No matching elements",enterPrompt:"Enter prompt…",continuity:"Continuity",activePrompt:"Active prompt",elementUnavailable:"Element unavailable",spritePreview:"Sprite animation preview",canvasMemo:"Canvas memo",cardDeck:"Card deck"},CC={modeImage:"Image",settings:"Settings",controls:"Generation controls",generate:"Generate",generateAria:"Open prompt sheet to generate an image"},wC={close:"Close prompt sheet",generate:"Generate image",controlsOpen:"Open generation controls",tabs:{prompt:"Prompt",controls:"Controls",library:"Library"}},IC={localImportSuccess:"Image added to gallery",localImportFailed:"Failed to import image",localImportInvalid:"Only PNG, JPEG, or WebP is supported",localStorageFull:"Local storage is full — recent state may not persist.",refLimitExceeded:"References are capped at 5. Extra images were dropped.",minimaxModelRequiresReference:"image-01-live needs a reference image outside China. Attach one, or switch to image-01.",refLimitTrayFull:"Reference tray is full ({max}). Remove an item with its X to attach more — deleted @tags can be re-mentioned with @.",refLimitPartial:"Only {added} of {total} images were added (limit {max}).",refOverProviderLimit:"This provider accepts up to {max} reference images. Remove {excess} to generate.",refTooLarge:"Image is too large. Convert to JPEG/PNG or lower the resolution and try again.",refNotBase64:"Image file is corrupted or uses an unsupported encoding.",refEmpty:"Empty image file. Please pick a different file.",refHeicUnsupported:"HEIC/HEIF is not supported. Convert to JPEG or PNG and try again.",noCurrentImageForRef:"No current image to use as reference.",refSlotFull:"Reference slots are full (max 5).",currentImageLoadFailed:"Failed to load current image.",addedCurrentAsRef:"Added current image as a reference.",sessionLoadFailed:"Failed to load session.",sessionCreateFailed:"Failed to create session.",sessionRenameFailed:"Failed to rename session.",sessionDeleteFailed:"Failed to delete session.",promptRequired:"Enter a prompt.",missingElements:"A selected element is missing. Remove it or re-add the element before generating.",nodeCreated:"Node {id} created ({elapsed}s)",nodeRootCreated:"Created a first node from this image.",animateStarted:"Animating image to video…",animateProgress:"Rendering video… {n}%",animateDone:"Video ready. Check your history.",animateFailed:"Video generation failed.",nodeCreateFailed:"Node generation failed.",generatedBatch:"Generated {count} images in {elapsed}s.",generatedSingle:"Generated in {elapsed}s.",generateFailed:"Generation failed.",sessionReloadedElsewhere:"Graph version changed, so the latest graph was reloaded.",promptCopied:"Prompt copied",metadataCopied:"Copied",imageCopied:"Copied to clipboard",frameCopied:"Frame copied to clipboard",copyFailed:"Copy failed",openGeneratedDirFailed:"Could not open the image folder. Run ima2 doctor to check the storage path.",openGeneratedDirOpened:"Opened the generated image folder.",noPromptToFork:"No prompt to fork",forkStarted:"Prompt imported. Edit and generate again.",forkStartedNoPrompt:"Image attached as reference. Type a prompt and generate.",continueAsUrlStarted:"Provider URL set as reference. Generate to use the original image.",continueAsUrlExpired:"The provider URL has expired. Use Continue here instead.",comfyExported:"Sent to ComfyUI as {filename}.",comfyExportInvalidUrl:"ComfyUI URL must be a local HTTP address.",comfyExportInvalidImage:"This saved image cannot be sent to ComfyUI.",comfyExportImageNotFound:"Saved image file was not found.",comfyExportFailed:"Could not upload image to ComfyUI.",cancelFailed:"Could not cancel generation.",errorClass:{rateLimited:"Too many requests. Please try again shortly.",providerTimeout:"The provider timed out. Please try again shortly.",networkFailure:"Could not reach the provider. Check the network, then try again.",contentRejected:"The provider rejected this prompt. Please revise it.",capabilityUnsupported:"This request is not supported by the current provider.",modelUnavailable:"The selected model is unavailable right now.",internalState:"Internal state is inconsistent. Reload the page."}},EC={queued:"Queued",planning:"Planning",streaming:"Generating",decoding:"Finalizing",canceling:"Canceling",noPrompt:"No prompt",cancelAria:"Cancel generation: {prompt}",title:"IN FLIGHT",badgeOpen:"Show {n} generations in flight",badgeClose:"Hide {n} generations in flight",inlineCollapse:"Collapse {n} generations in flight",footerHint:"You can close this panel — generations will continue.",kindImage:"Image",kindVideo:"Video",kindNode:"Node",kindMcp:"MCP",progressAria:"Generation progress: {n}%"},RC={title:"Size",grokAspectTitle:"Aspect Ratio",grokResolutionTitle:"Resolution",width:"Width",height:"Height",hint:"16px steps, max edge 3840, ratio up to 3:1, 655K–8.29M pixels",autoLabel:"Auto",autoSub:"Model pick",customLabel:"Custom",customSub:"Free form",customPlus:"+ Custom",customSlots:"Saved sizes",customSlot:"Custom",customSlotLimit:"Up to 3 custom sizes",saveCustomSlot:"Save custom size",replaceCustomSlot:"Replace slot",ratioFree:"Free",ratio21x9:"21:9",normalizedPreview:"Will send",noAdjustment:"No adjustment",squareMaxHint:"Square maximum is {size} because of the 8.29M pixel limit.",adjustedReasons:{snap:"snapped to 16px",maxEdge:"max edge",ratio:"ratio limit",minPixels:"minimum pixels",maxPixels:"maximum pixels",min:"minimum edge",max:"maximum edge",pixels:"pixel limit"}},NC={title:"Size adjustment required",body:"The requested size is outside the image generation limits.",requested:"Requested size",adjusted:"Adjusted size",approve:"Approve and generate",cancel:"Cancel",reasonRatio:"The ratio exceeds the 3:1 limit.",reasonPixels:"The maximum pixel limit is exceeded.",reasonMinPixels:"The requested image has too few pixels.",reasonMin:"The size is below the minimum.",reasonMax:"The size is above the maximum.",reasonSnap:"The size must align to 16px increments."},kC={title:"Quality",grokTitle:"Grok quality",grokModelTitle:"Model",lowLabel:"Low",lowSub:"Fast",mediumLabel:"Medium",mediumSub:"Balanced",highLabel:"High",highSub:"Best"},_C={title:"Moderation",autoLabel:"Auto",autoSub:"Standard filter",lowLabel:"Low",lowSub:"Relaxed filter",explain:"Auto uses the standard safety filter. Low relaxes limits so borderline prompts may pass through."},MC={title:"Format"},PC={title:"Count",customPlus:"+n",customLabel:"Custom count",highCountHint:"Higher counts can take longer with references or high quality.",minMaxHint:"Use 1-24 images.",decrease:"Decrease count",increase:"Increase count"},LC={label:"Sequence",tooltip:"Generate ordered stages from one prompt",shortHint:"planned stages",maxStages:"Max stages",highCountHint:"Higher stage counts can take several minutes.",minMaxHint:"Use 1-24 stages.",composerBadge:"Sequence · up to {count}",composerAriaLabel:"Sequence prompt composer, up to {count} separate stages",promptPlaceholder:"Describe the sequence. Use Count with Sequence off for same-prompt batches.",promptPlaceholderWithRefs:"Describe the staged sequence using the attached references.",toggleDisabledGenerating:"Wait for the current generation to finish",sequenceTitle:"Sequence results",sequenceProgress:"{returned}/{requested} images",stageLabel:"Stage {index}",generating:"Generating...",partialAlt:"Partial multimode preview",partial:"Generated {returned}/{requested} images in {elapsed}s.",complete:"Generated {returned}/{requested} images in {elapsed}s.",notReturned:"Not returned",empty:"No image returned",error:"Generation failed",canceled:"Canceled",cancel:"Cancel"},OC={restoreTitle:"Restore image settings",restoreBody:"This image contains ima2 generation metadata. Apply its prompt and settings, or attach it as a reference only.",applySettings:"Apply settings",useAsReferenceOnly:"Reference only",noMetadata:"No ima2 metadata found.",invalidMetadata:"Invalid image metadata.",unsupportedFormat:"Only PNG, JPEG, and WebP metadata can be restored.",readFailed:"Could not read image metadata.",applied:"Image settings restored.",sourceXmp:"XMP",sourcePngComment:"PNG comment",imageAlt:"Dropped image preview",prompt:"Prompt",size:"Size",quality:"Quality",model:"Model",source:"Source",title:"Generation Details",asset:"asset",summary:"Generation summary",copy:"Copy",copyRaw:"Copy raw JSON",copyField:"Copy {label}",rawJson:"Raw metadata JSON",sections:{provider:"Provider & Model",settings:"Generation Settings",usage:"Usage & Timing",lineage:"Lineage",video:"Video",videoContinuity:"Video Continuity",prompts:"Prompts"},fields:{provider:"Provider",authPath:"Auth path",model:"Model",providerUrl:"Provider URL",requestId:"Request ID",quality:"Quality",size:"Size",format:"Format",moderation:"Moderation",reasoning:"Reasoning",promptMode:"Prompt mode",kind:"Kind",mediaType:"Media type",elapsed:"Elapsed",tokens:"Tokens",totalTokens:"Total tokens",inputTokens:"Input",cachedTokens:"Cached",outputTokens:"Output",reasoningTokens:"Reasoning",webSearchCalls:"Web searches",grokCostTicks:"Grok cost ticks",usage:"Usage",filename:"Filename",createdAt:"Created",sessionId:"Session",nodeId:"Node",parentNodeId:"Parent node",clientNodeId:"Client node",refsCount:"References",sequence:"Sequence",setId:"Set",cardId:"Card",videoDuration:"Duration",videoResolution:"Resolution",videoAspectRatio:"Aspect ratio",videoRequestedModel:"Requested model",videoEffectiveModel:"Effective model",videoModelFallback:"Model fallback",xaiVideoRequestId:"xAI video request",sourceImageFilename:"Source image",lineageId:"Lineage",parentFilename:"Parent file",sourceFrame:"Source frame",continuityEntries:"Entries",latestContinuityPrompt:"Latest continuity prompt",promptPrimary:"Prompt",userPrompt:"User prompt",prompt:"Stored prompt",revisedPrompt:"Revised prompt",composerPrompt:"Composer prompt",insertedPrompts:"Inserted prompts"}},jC={title:"Hello! First time here?",body:"Sign in to start generating. You can connect ChatGPT, Grok, or Gemini.",login:"Yes, sign me in",skip:"I'll set it up myself"},GC={title:"Generation readiness",open:"Check readiness",openTitle:"Check provider, auth, model, and web-search readiness",settingsTitle:"Generation readiness",settingsBody:"Open a compact popup with provider, auth, model, reasoning, and web-search state.",ready:"Ready to generate",readyBody:"The selected provider is available.",blocked:"Provider needs attention",provider:"Provider",model:"Model",reasoning:"Reasoning",webSearch:"Web search",grokApi:"Grok API",grokApiBody:"Runs through bundled progrok: mandatory search, Grok 4.5 image-and-text tool planning in English, then xAI Images API. Attached references use xAI image editing so i2i context is preserved.",openAccount:"Open account settings"},DC={button:"Generate",buttonLoading:"Generating ({n})"},FC={recentTitle:"Recent work",selectedCount:"{count} selected",selectedPresets:"Selected presets",referenceTrayCount:"{count} refs",referenceTrayAria:"{count} references are attached to the next generation",viewAll:"View all",heroTitle:"Branch the images you love.",heroLede:"Generate, edit, and animate locally across your own provider lanes. Nothing leaves the machine unless you send it.",lanesReady:"{ready} of {total} lanes ready",lanesNone:"no lane ready — open Settings",modesTitle:"Workspaces",modeCreateHint:"Generate and iterate on a single image",modeNodeHint:"Branch one result into many directions",modeAgentHint:"Describe the job and let the agent run it",modeAssetsHint:"Collect, star, and reuse what you made",untitledResult:"Untitled result",recentResultAlt:"Recent result: {prompt}",mediaUnavailable:"Preview unavailable"},zC={label:"API Status",checking:"Checking...",offline:"Offline",remaining:"${remaining} remaining",thisMonth:"${amount} this month",oauthFree:"GPT OAuth · free via codex",apiDisabled:"API key ready",apiReady:"API key ready",oauthMode:"GPT OAuth mode"},qC={openGalleryAria:"Open gallery",openGalleryTitle:"Open full gallery",openGalleryShort:"All",galleryCard:"Open gallery",recentTitle:"Recent Generations",collapseRecent:"Collapse recent generations",expandRecent:"Expand recent generations",collapseRecentShort:"Hide",expandRecentShort:"Show",emptyRecent:"Generated images will appear here.",generatingCollection:"Generating {count} images…",selectRecent:"Select generated image",deleteImageAria:"Delete image from history",deleteSequenceAria:"Delete {count}-image sequence",deleteSequenceConfirm:"Delete all {count} images in this multimode sequence?",sequenceDeleted:"Deleted {count} sequence images from history"},UC={closeSettings:"Close settings",detailSettings:"Settings",toggleShow:"Show settings",toggleHide:"Hide settings",open:"Open",close:"Close"},HC={label:"Prompt",refCount:"Refs {count}/{max}",trayAria:"Reference tray, {count} of {max}",deadTagHint:"Tag removed from the tray — shown as a reference only",deadTagStatus:"Unavailable references in the prompt: {tags}",refChipTitle:"Reference {n}",refChipAlt:"Reference {n}",refRemoveAria:"Remove reference {n}",placeholder:"Describe the image you want. Drag & drop or paste to attach reference images...",placeholderWithRefs:"Describe what to do with the attached images...",attach:"Attach",attachTitle:"Attach reference images",useCurrent:"Use current",useCurrentTitle:"Use current result as a reference",continue:"Continue",continueTitle:"Continue from current result as reference",savePrompt:"Save",storyboard:"Storyboard",storyboardTitle:"Enable storyboard mode — maintains character and scene continuity across sequential frames",videoToggleTitle:"Toggle video mode (Grok 1.5)",directMode:"Direct",directModeActive:"1:1 Direct on",directModeTitle:"Pass prompt through verbatim (Direct mode)",urlRefActive:"URL ref",urlRefActiveTitle:"Provider URL reference is active and will be used instead of attached image refs. Click to clear.",urlRefClear:"Clear provider URL reference",moveBlockUp:"Move {name} up",moveBlockDown:"Move {name} down",afterBlocks:"After main prompt",hint:"Ctrl + Enter to generate",dropHere:"Drop to attach as reference (up to {max})"},BC={modeTitle:"Canvas Mode",resultAlt:"result",imageViewerAria:"Generated image viewer. Use left and right arrow keys to move between images.",tokens:"{n} tokens",open:"Open Canvas",openAria:"Open image in canvas mode",dragToComposer:"Drag to composer as reference",dragHint:"Drag",annotationInstructionsChip:"Canvas notes",close:"Close Canvas",blank:{title:"Blank canvas",subtitle:"Sketch on white paper, then continue from it.",create:"Create blank canvas",creating:"Creating...",failed:"Could not create blank canvas"},drop:{hint:"Drop image to add to gallery"},toolbar:{label:"Canvas annotation tools",select:"Select",bgGroup:"Export background",bgAlpha:"Alpha",bgMatte:"Matte",bgMatteColor:"Matte color",cleanup:"Clean background",cleanupMark:"Mark",cleanupRemove:"Remove",cleanupPreserve:"Preserve",cleanupInput:"Input",cleanupClick:"Click",cleanupBrush:"Brush",cleanupBrushSize:"Brush",cleanupTolerance:"Tolerance",cleanupAutoSample:"Corners",cleanupPickSeed:"Pick seed",cleanupPickingSeed:"Click background",cleanupActive:"Active",cleanupPreview:"Preview",cleanupPreviewing:"Previewing...",cleanupApply:"Apply PNG",cleanupApplying:"Applying...",cleanupReset:"Reset",cleanupSeedCount:"{n} seeds",cleanupRemoved:"{n}% removed",cleanupPickHint:"Click the background on the image",cleanupBrushHint:"Paint the area to mark",cleanupMaskHint:"Purple mask will be removed",cleanupApplied:"Transparent PNG created",cleanupFailed:"Background cleanup failed",zoomGroup:"Canvas zoom",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomReset:"Reset zoom",zoomShortcutHint:"Pinch zoom · two-finger pan · [ / ] · 0",pen:"Pen",box:"Box",arrow:"Arrow",memo:"Sticky memo",eraser:"Eraser",eraserMenu:"Eraser options",objectEraser:"Object eraser",brushEraser:"Brush eraser",apply:"Save canvas version",applyDone:"Canvas version saved",applyFailed:"Could not save canvas version",export:"Export image",exporting:"Exporting...",exportFailed:"Export failed",undo:"Undo",redo:"Redo",deleteSelected:"Delete selected",editMask:"Edit boxed areas",editMaskDisabled:"Draw a box first",editMaskFailed:"Masked edit failed",editMaskUnsupported:"Masked edit is not supported by the current image provider",style:"Style",color:"Color",strokeWidth:"Stroke width",clear:"Clear all",exportFormat:"Export format",exportAs:{png:"PNG image",svg:"SVG vector",pptx:"PowerPoint slide"}},version:{saving:"Saving canvas version...",saved:"Canvas version saved",failed:"Could not save canvas version",usingAsReference:"Canvas version is ready as a reference"},revert:{action:"Revert baked notes",mixedConfirm:"This version also contains pixel edits. Reverting baked notes will discard those pixel edits. Continue?",restored:"Baked notes restored as an editable draft",completed:"Baked notes and pixel edits reverted",failed:"Could not revert baked notes"}},VC={today:"Today",yesterday:"Yesterday",thisWeek:"This week",earlier:"Earlier",imageAltFallback:"Generated image",deleteTitle:"Move to system trash",deleteAria:"Delete image",ariaLabel:"Image gallery",title:"Gallery",total:"{n} total",totalFiltered:" / {n} total",sortByAria:"Sort by",sortByDate:"Date",sortBySession:"Session",favoriteFilterAria:"Favorite filter",filterAll:"All",filterFavorites:"Favorites",searchPlaceholder:"Search prompts or filenames",searchDisabledPlaceholder:"Search is disabled in session view",closeAria:"Close gallery",closeTitle:"Close (Esc)",sessionLabel:"Session {name}",standalone:"Standalone images",emptySessions:"No sessions saved yet.",emptyAll:"No images yet. Create one first.",emptyFavorites:"No favorite images yet.",noResults:"No results.",loadOlder:"Load older",loadingOlder:"Loading older...",loadOlderFavorites:"Load older favorites",loadingOlderFavorites:"Loading older favorites...",sessionPaginationHint:"Session view uses the current page. Switch to Date view to load older images.",sessionLoading:"Loading session groups...",sessionLoadFailed:"Could not load session groups.",sessionLimitNotice:"Showing the newest {count} items. Older items are not included in session view.",retry:"Retry",loadOlderFailed:"Could not load older gallery items.",storageNoticeTitle:"Storage notice",storageNoticeRecoverable:"Sorry for the scare. Recent versions moved the gallery folder from the installed package to your user data folder. Your old images may still be in the previous generated folder. Run ima2 doctor or open the recovery guide.",storageNoticeNotFound:"Sorry for the scare. We could not find a previous generated folder on this machine. If the old global install folder was replaced during update, automatic recovery may not be possible. Run ima2 doctor and check the recovery guide for manual search steps.",storageNoticeUnknown:"Storage status could not be checked. If the gallery looks empty after an update, run ima2 doctor to inspect the image folder.",openGeneratedDir:"Open folder",openGeneratedDirTitle:"Open generated image folder",cardNewsSet:"Card News set",cardNewsCard:"Card News card",openCardNewsSet:"Open set",openCardNewsSetFailed:"Could not open the Card News set.",copyCardNewsSetPath:"Copy path",cardNewsPathCopied:"Card News set path copied.",downloadCardNewsManifest:"Manifest",cardNewsCount:"{n} cards",deleted:"Deleted: {filename}",undo:"Undo",secondsSuffix:"{n}s",permanentDeleted:"Permanently deleted: {filename}",movedToSystemTrash:"Moved to system trash: {filename}",deleteFailed:"Could not delete image.",restoreFailed:"Could not restore image.",favoriteTitle:"Add to favorites",unfavoriteTitle:"Remove from favorites",favoriteAria:"Add to favorites",unfavoriteAria:"Remove from favorites",favoriteFailed:"Could not update favorite",scopeAria:"Gallery scope",scope:{current:"Current session",all:"All images"},empty:{currentSession:"No images in this session yet."}},KC={empty:"Empty",elementMissing:'Element "{name}" was deleted. Reconnect it before running.',pending:"Generating",reconciling:"Syncing",reconcilingPhase:"Syncing · {phase}",ready:"Done · {elapsed}s",readyWithSearch:"Done · {elapsed}s · searched {searches}",stale:"Stale",staleWithError:"Stale: {error}",assetMissing:"Asset missing",assetMissingWithError:"Asset missing: {error}",error:"Error: {error}",errorUnknown:"unknown",nodeImageAlt:"Node image",partialImageAlt:"Partial node image preview",noAsset:"No asset",stateStale:"State stale",noImage:"No image",editPromptPlaceholder:"Edit prompt...",promptPlaceholder:"Prompt...",regenerate:"Regen",newVariation:"New variant",generate:"Gen",generateTitle:"Generate node image",addChild:"Child",addChildTitle:"Add child node",duplicateBranch:"Branch",duplicateBranchTitle:"Duplicate as a new branch root",deleteTitle:"Delete",regenerateTitle:"Regenerate this node in place",newVariationTitle:"Create a new sibling variant under the same parent",parentImageRequired:"Generate the parent image first.",attachRef:"Attach",attachRefTitle:"Attach node reference images",refAlt:"Node reference {n}",removeRef:"Remove reference {n}",dropRefs:"Drop images here",nodeRefsUnsupportedForEdit:"Extra references are only supported on root nodes for now.",nodeRefsUsedWithParent:"Used together with the parent image.",classicRefsParkedTitle:"Classic references are parked",classicRefsParkedBody:"These images belong to the classic composer and are inactive in node mode.",clearParkedRefs:"Clear parked references",retry:"Retry",retryTitle:"Retry this node's generation",errorAuthCta:"Check your account or API key, then generate again.",errorFixCta:"Adjust the prompt or references, then generate again."},$C={selectionOn:"Selecting",selectionOff:"Select",selectAll:"Select all",summary:"{selected} selected · {missing} missing · {stale} affected",generateMissing:"Generate missing",regenerateSelected:"Regenerate selected",stopRemaining:"Stop remaining",stopping:"Stopping",clear:"Clear",noneSelected:"No nodes selected.",parentRequired:"{count} selected node(s) need a ready parent image first.",nothingToRun:"No selected nodes need generation.",stopQueued:"The current node will finish, then the remaining queue will stop.",failed:"Stopped after {done}/{total} node(s).",finished:"Finished {done}/{total} node(s).",staleBecauseParentChanged:"An upstream node was regenerated; refresh this node when needed.",cycleBlocked:"Cannot run: {count} selected node(s) form a loop.",partialFinished:"Finished {done}/{total} — {failed} failed, {skipped} skipped."},YC={disconnect:"Disconnect",disconnectTitle:"Disconnect selected edge",disconnected:"Connection removed.",parentConflict:"A node can only have one parent connection.",cycleBlocked:"That connection would create a loop."},XC={authTitle:"Provider",apiLabel:"API Key",statusReady:"Ready",statusConnected:"Connected",statusAuthRequired:"Sign-in required",statusDisconnected:"Disconnected",statusLineTitle:"Status",authMethodTitle:"Auth",authActive:"Active",oauthNotReady:"GPT OAuth proxy is not ready yet.",codexLoginRequired:"Codex login required.",codexLoginHint:"Run `codex login` in your terminal, then refresh this page.",oauthStarting:"GPT OAuth proxy is starting. Try again in a few seconds.",serverUnreachable:"Cannot reach the server. Make sure the backend is running.",apiInvalid:"API key is missing or invalid. Check OPENAI_API_KEY in the server's .env.",grokOffline:"Grok proxy is not running.",grokNoImageModel:"No Grok image generation model found.",grokNotReady:"Grok is not available.",grokOfflineHint:"Run `ima2 grok login` once if needed, then start `ima2 serve`; ima2 starts the bundled Grok proxy automatically.",grokManagedByIma2:"Grok runs locally inside `ima2 serve` through the bundled progrok proxy at 127.0.0.1:18645.",grokClassicOnly:"Grok image generation is not available in this surface.",grokClassicOnlyHint:"Use a generation surface with Grok enabled.",grokCompatTitle:"Grok image API",grokCompatBody:"ima2 serve manages the bundled progrok proxy at 127.0.0.1:18645. Grok always searches before image generation, sends attached references into the Grok 4.5 planner, keeps them through xAI image editing, and maps size to xAI aspect ratio/resolution. Output format, moderation, and reasoning are OpenAI-provider settings only.",settingsBody:"Choose which provider future generation requests use.",availableTitle:"{name} available",availableAria:"{name}: available",unavailableAria:"{name}: unavailable",availableSr:"(available)",unavailableSr:"(unavailable)",xaiApiKeyRequired:"xAI API key required",geminiApiKeyRequired:"Gemini API key required",atlasCloudApiKeyRequired:"Atlas Cloud API key required",minimaxApiKeyRequired:"MiniMax API key required",comingSoon:"Coming soon",agyCompatTitle:"Gemini (agy)",agyCompatBody:"1024x1024 fixed, JPEG output, max 3 refs. No quality/size control.",agyCompatBodyLong:"1024x1024 fixed output, JPEG format, max 3 reference images. No web search, no quality/size control.",geminiApiCompatTitle:"Gemini API",geminiApiCompatBody:"Google Gemini API. Supports aspect ratio and resolution control from 512px to 4K.",geminiApiCompatBodyLong:"Google Gemini API direct. Supports nano-banana-2 (Flash) and nano-banana-pro (Pro), with aspect ratio and resolution control from 512px to 4K.",gptCompatTitle:"GPT Image",gptCompatBody:"OpenAI image generation via Responses API. Supports quality, size, format, moderation, and web search settings."},QC={connectionsTitle:"MCP provider connections",connectionsBody:"Connect official provider accounts and review tool status. Only connected providers appear in the generation selector.",providerLabel:"Generation provider",modelLabel:"Generation model",coreProviders:"Core providers",connectedProviders:"Connected MCP providers",imageModels:"Image models",videoModels:"Video models",chooseModel:"Choose a model",loadingModels:"Loading models",loadingProviders:"Checking connections",providersLoadFailed:"Could not load MCP provider status.",modelsLoadFailed:"Models failed to load — tap to retry",retryModels:"Retry",noModels:"No models are available for this mode.",refreshingConnection:"Refreshing…",exitLane:"Use core providers",modelSectionTitle:"Model",ratioAutoHelp:"Auto lets the model pick its own aspect ratio. Presets may be rejected by some models.",aspectRatioLabel:"Aspect ratio",durationLabel:"Duration",resolutionLabel:"Resolution",qualityLabel:"Quality",modeLabel:"Mode",audioLabel:"Audio",onLabel:"On",offLabel:"Off",toolInputsLabel:"Reference media",referenceNone:"None",referenceSelect:"Choose from gallery",referenceCurrent:"Current gallery item",referenceMissing:"Not in loaded history",startFrameLabel:"Start frame",endFrameLabel:"End frame",endFrameNeedsStart:"Choose a start frame first.",imageReferencesLabel:"Image references (up to 3)",imageReferenceAria:"Image reference {index}",referenceTagAria:"Tag for image reference {index}",referenceTagPlaceholder:"Optional tag",referenceTagInvalid:"Use 1–32 letters, numbers, underscores, or hyphens for the tag.",referenceAttachLocal:"Attach local image",referenceAttachHelp:"Local images are uploaded temporarily and removed after generation settles.",referenceLocalFallback:"Local image",referenceLocalInvalidType:"Choose a PNG, JPEG, or WebP image.",referenceLocalReadFailed:"Could not read this image. Choose it again.",referenceSource:{asset:"Asset",element:"Element",local:"Local attachment"},videoReferenceLabel:"Video reference",videoReferenceCostNote:"Using a video reference may add provider charges.",advancedPresetsLabel:"Advanced presets",providerDefaultsHelp:"This model uses provider defaults without additional presets.",chooseModelForPresets:"Choose a model in the top selector to see its supported presets.",refreshList:"Refresh status",connect:"Connect",connecting:"Connecting",connectOpensBrowser:"Opens provider sign-in in a browser window.",refreshConnection:"Reconnect",disconnect:"Disconnect",connectionActionFailed:"The connection action could not be completed. Try again shortly.",popupBlocked:"The sign-in window was blocked. Allow popups, then connect again.",locked:"Locked",unavailable:"Unavailable",unknownProvider:"Connection information for {provider} is unavailable.",disconnectedSelection:"The saved provider is disconnected. Reconnect it in Settings.",disabledProvider:"This provider is disabled in the current server configuration.",selectionUnavailable:"The selected MCP provider is unavailable. Check its connection in Settings.",higgsfieldLocked:"Generation is locked for this provider.",toolCount:"{count} tools",toolCountUnknown:"Tool count unknown",snapshotChanges:"{count} schema changes",billingLabel:"Billing",billingSubscription:"Subscription credits",billingApi:"API usage billing",billingUnknown:"Unknown",generateFailed:"Could not start MCP generation.",errorUnsupportedInput:"This model does not support one of the selected reference types. Choose a compatible model or remove it.",errorEndRequiresStart:"Choose a start frame before adding an end frame.",errorInvalidReferences:"One or more reference images are no longer available. Choose them again.",errorInvalidFrame:"The selected frame or video is no longer available. Choose it again.",errorTempReferences:"Could not prepare the local reference image. Choose it again.",status:{disconnected:"Disconnected",connecting:"Connecting",auth_required:"Sign-in required",connected:"Connected",offline:"Offline",error:"Error"},characterSlotLabel:"Character",characterSlotNone:"No character binding",characterSlotConflictHint:"Remove @element mentions to use a character binding — they cannot be combined."},JC={image:"Image",video:"Video"},WC={free:"free",approx:"~${amount}",multimodeApprox:"up to ~${amount} ({count})",label:"Est. cost"},ZC={download:"Download",copyImage:"Copy image",copyLastFrame:`Last
|
|
14
|
+
프레임`,copyPrompt:"프롬프트 복사",continueHere:"여기서 이어서",continueHereTitle:"이 이미지의 프롬프트를 가져와 이어서 작업",continueAsUrl:"URL로 이어서",continueAsUrlTitle:"원본 URL을 사용해 이어서 생성 (1시간 내 만료)",animate:"애니메이트",animating:"애니메이트 중…",animateTitle:"이 이미지로 Grok 비디오 생성 (이미지→비디오)",firstNode:"첫 노드",firstNodeTitle:"이 이미지를 Node Mode의 준비된 첫 노드로 보냅니다",info:"정보",infoTitle:"생성 세부 정보와 출처를 표시합니다",delete:"삭제",deleteTitle:"휴지통으로 이동",more:"더보기",sendToComfyUI:"ComfyUI로 보내기",sendToComfyUITitle:"이 저장된 이미지를 로컬 ComfyUI로 업로드",permanentDelete:"완전 삭제",permanentDeleteConfirm:'"{filename}" 이미지를 완전히 삭제할까요? 이 작업은 되돌릴 수 없습니다.',upscale:"업스케일",upscaleTitle:"Runway로 업스케일 (MCP)",upscaleFlavor:"플레이버",upscaleFlavorAuto:"자동",upscaleStart:"업스케일 시작",upscaleStarted:"업스케일을 시작했습니다",upscaleFailed:"업스케일 실패",upscaleInvalid:"업스케일 파라미터가 올바르지 않습니다"},K0={switchTitle:"세션 전환",loading:"불러오는 중...",newSession:"새 세션",newSessionTitle:"새 세션",renameTitle:"이름 변경",renamePrompt:"세션 이름",deleteTitle:"삭제",deleteConfirm:'"{title}" 세션을 삭제할까요? 이 작업은 되돌릴 수 없습니다.',empty:"아직 세션이 없습니다",firstGraph:"첫 번째 그래프",untitled:"제목 없는 세션",assetAbortedError:"생성이 정상적으로 끝나지 않았습니다. 이 노드에서 다시 시도하세요."},$0={ariaLabel:"UI 모드",classic:"기본",node:"노드",cardNews:"카드뉴스",agent:"에이전트"},Y0={workspace:"에이전트 작업공간",workspaceActionFailed:"작업 실패: {reason}",bootFailed:"에이전트 작업공간을 불러오지 못했습니다",bootRetry:"다시 시도",topbarBackToStudio:"스튜디오로 돌아가기",topbarStudio:"스튜디오",topbarOpenQueue:"큐 열기, 활성 작업 {count}개",topbarCloseQueue:"큐 닫기",topbarQueueSheet:"생성 큐",title:"에이전트",newSession:"새 에이전트",sessions:"세션",openSessions:"세션 열기",closeSessions:"세션 닫기",sessionsUseRail:"세션을 간단한 레일로 고정",sessionsUseExpanded:"펼친 세션 목록으로 고정",sessionSearch:"세션 검색",renameSession:"세션 이름 바꾸기",deleteSession:"세션 삭제",deleteConfirm:'"{title}" 세션을 삭제할까요?',imageCount:"{count}장",compacted:"컴팩트됨",web:"웹",chat:"채팅",user:"사용자",assistant:"에이전트",tool:"도구",toolExpand:"도구 상세 펼치기",toolCollapse:"도구 상세 접기",toolImageCount:"{count}장",toolCallCount:"{count}개 호출",toolGroup:"도구 실행",toolInput:"입력",toolOutput:"출력",toolsShowMore:"더보기",toolsShowLess:"접기",toolArtifacts:"결과물",requestId:"요청 ID",duration:"소요 시간",toolStatus:{queued:"대기",running:"실행 중",complete:"완료",error:"오류"},rightSidebar:"에이전트 사이드 도구",sidebarTabs:{image:"이미지",library:"라이브러리",forms:"양식",quality:"품질",model:"모델",queue:"큐"},modelSettings:"모델 설정",closeModelSettings:"모델 설정 닫기",openModelSettings:"모델 설정 열기",modelTabView:"모델 탭에서 보기",model:"모델",provider:"프로바이더",reasoningEffort:"추론",generationStrategy:"생성 계획",generationStrategyAuto:"사용자 요청 기준",generationStrategyManual:"고정 개수",quality:"품질",size:"크기",format:"포맷",moderation:"모더레이션",variantsCount:"변형 수",maxAutoVariants:"자동 최대",parallelism:"병렬 수",promptLibrary:"프롬프트 라이브러리",forms:"양식",noForms:"양식 템플릿이 없습니다",insertPrompt:"삽입",queue:"큐",runningShort:"실행",queuedShort:"대기",queueEmpty:"대기 중인 에이전트 작업이 없습니다.",cancelQueue:"취소",retryQueue:"재시도",sessionRunning:"생성 실행 중",sessionQueued:"{count}개 대기",sessionError:"생성 오류",queueStatus:{queued:"대기",running:"실행 중",succeeded:"완료",failed:"실패",canceled:"취소됨"},statusReady:"준비됨",statusGenerating:"생성 중",statusReconnecting:"연결 복구 중",pending:"응답을 생성하는 중...",pendingQueued:"대기열에서 기다리는 중...",pendingPlanning:"응답을 계획하는 중...",pendingGenerating:"도구 실행·생성 진행 중...",runError:"실행 중 오류가 발생했어요",errorRole:"오류",composerPlaceholder:"무엇이든 물어보거나 만들 것을 설명하세요",slashCommands:"에이전트 슬래시 명령",slashDesc_question:"이미지 생성 없이 질문",slashDesc_variants:"N개 이미지 변형 생성 (1-24)",slashDesc_generate:"bounded fanout 생성 (1-24)",slashDesc_parallelism:"동시 실행 제한",slashDesc_help:"사용 가능한 명령어 도움말",attachReference:"참조 첨부",send:"전송",webSearch:"검색 사용",emptyChat:"메시지를 입력하면 이미지 또는 비디오 작업이 시작됩니다.",emptyJumpLatest:"최신 메시지로 이동",queueSummary:"활성 {active} · 실패 {failed}",queuePlanSummary:"변형 {variants}개 · 병렬 {parallel}",queueDetails:"기술 상세",queueAnnouncement:"큐 업데이트: 실행 {running}, 대기 {queued}, 실패 {failed}",queueTimeAgo:"{value}{unit} 전",queueTimeUnit:{second:"초",minute:"분",hour:"시간"},progressQueued:"큐 대기 중",progressPlanning:"요청 준비 중",progressGenerating:"생성 중",progressDownloading:"결과 다운로드 중",progressFailed:"실행 실패",progressJob:"{kind} · 변형 {count}개",mediaKind:{image:"이미지",video:"비디오"},mediaSelect:"미디어 포커스",mediaLoading:"비디오 불러오는 중",mediaLoadFailed:"비디오를 불러오지 못했습니다.",mediaRetry:"재시도",mediaVideoLabel:"생성된 비디오",mediaDuration:"길이 {duration}",mediaDurationUnknown:"길이 정보 없음",mediaDownload:"다운로드",imagePane:"이미지",currentImage:"현재 이미지",openImage:"이미지 열기",closeImage:"이미지 닫기",selectImage:"이미지 포커스",variants:"변형",contextTabs:"이미지 컨텍스트",imageTab:"이미지",refsTab:"참조",webTab:"웹 근거",memoryTab:"기억",noImage:"현재 이미지 없음",noRefs:"참조 없음",noWeb:"웹 근거 없음",memoryItemStyle:"스타일 잠금은 이미지 컨텍스트에 보존됩니다.",memoryItemSubject:"피사체 잠금은 재개 후에도 복원됩니다.",imageAlt:"에이전트 이미지",filename:"파일",prompt:"프롬프트",stageEmptyHint:"첫 요청을 보내면 여기에서 이미지를 확인할 수 있습니다",openTools:"도구 패널 열기",closeTools:"도구 패널 닫기"},X0={workspace:"카드뉴스 작업공간",composer:"카드뉴스",composerHint:"템플릿은 스냅샷 기준이고, 출력 크기는 별도로 지정합니다.",topic:"주제",topicPlaceholder:"예: 중간고사 역전 플랜",audience:"대상",audiencePlaceholder:"예: 학부모",goal:"목표",goalPlaceholder:"예: 상담 신청",brief:"내용",briefPlaceholder:"카드뉴스에 들어갈 핵심 내용과 금지사항을 적어주세요.",outputSize:"출력 크기",customSize:"직접",draft:"초안 만들기",drafting:"초안 작성 중...",generateSet:"세트 생성",batchGenerate:"일괄 생성",generating:"생성 중...",generated:"{count}장 생성 완료.",missingGeneratedCard:"생성 응답에 이 카드가 포함되지 않았습니다.",error:"카드 생성에 실패했습니다.",imageTemplate:"이미지 템플릿",roleTemplate:"카드 구조",newTemplateLater:"커스텀 템플릿은 dev MVP 이후에 지원합니다",emptyTitle:"초안 대기 중",emptyBody:"왼쪽 설정으로 카드 덱을 준비합니다.",inspector:"카드 편집",cardTitle:"카드 제목",headline:"제목",body:"본문",visualPrompt:"이미지 프롬프트",summaryCopy:"요약 문구",designPrompt:"장면 / 디자인 프롬프트",textFields:"텍스트 박스",addTextField:"텍스트 박스 추가",removeTextField:"삭제",noTextFields:"아직 텍스트 박스가 없습니다.",textFieldText:"텍스트",textKind:"종류",placement:"위치",renderMode:"표시 방식",hierarchyLabel:"위계",textTooLong:"권장 길이를 초과했습니다.",selectTextField:"텍스트 박스 선택: {text}",textKinds:{headline:"제목",body:"설명 텍스트",caption:"캡션",cta:"행동 유도",badge:"배지",number:"숫자"},renderModes:{"in-image":"이미지에 표시","ui-only":"메모만"},hierarchy:{primary:"주요",secondary:"보조",supporting:"부가"},placements:{"top-left":"좌측 상단","top-center":"상단 중앙","top-right":"우측 상단","center-left":"좌측 중앙",center:"중앙","center-right":"우측 중앙","bottom-left":"좌측 하단","bottom-center":"하단 중앙","bottom-right":"우측 하단",free:"직접 지정"},roles:{cover:"표지",hook:"후킹",problem:"문제",insight:"인사이트",example:"예시",data:"데이터",summary:"요약",cta:"행동 유도"},locked:"잠김",unlocked:"열림",noCard:"선택된 카드 없음",generatedMeta:"생성 메타데이터",lockedHelp:"잠긴 카드는 일괄 생성과 재시도에서 제외됩니다.",retryCard:"이 카드 재시도",actions:{copyPrompt:"프롬프트 복사",copyCopy:"문구 복사",openImage:"이미지 열기",downloadCard:"다운로드"},status:{draft:"초안",queued:"대기",generating:"생성 중",generated:"완료",error:"오류",skipped:"제외",locked:"잠김"},progress:{generating:"생성 중 {done}/{total}",summary:"완료 {done}/{total}",detail:"대기 {queued} · 오류 {errors} · 제외 {skipped}",cardGenerating:"이 카드를 생성 중입니다."},planner:{structured:"구조화 JSON",jsonMode:"JSON 모드",repaired:"보정됨",fallback:"기본 초안",jsonOnlyHelp:"초안은 JSON만 만들고 이미지는 나중에 생성합니다.",error:"초안 생성 실패"}},Q0={selectedCameraPresets:"선택한 카메라 모션 프리셋",plannerModelTitle:"플래너 모델",reasoningEffortTitle:"추론 강도",modeLabel:"비디오 모드",mode:{"text-to-video":"텍스트 → 비디오 (참조 이미지 없음)","image-to-video":"이미지 → 비디오 (참조 1장)","reference-to-video":"레퍼런스 → 비디오 (참조 {n}장)"},seriesTopicTitle:"시리즈 주제",seriesTopicPlaceholder:"예: 한국 여행 브이로그",durationTitle:"길이",resolutionTitle:"해상도",resolution1080Help:"1080p는 Grok V1.5의 프롬프트 전용 또는 단일 이미지/프레임 영상에서 사용합니다. 참조 2장 이상에서는 사용할 수 없습니다.",aspectTitle:"비율",plannerUpdateFailed:"플래너 모델을 변경하지 못해 이전 설정으로 되돌렸습니다.",continuationFallbackT2V:"이어갈 영상의 마지막 프레임을 추출하지 못했습니다. 텍스트-비디오 방식으로 계속 생성합니다."},J0={appName:"이미지 생성기",imageModelLabel:"모델",imageSectionLabel:"이미지",gptImageSubLabel:"GPT-IMAGE-2",grokImageSubLabel:"Grok Imagine",geminiImageSubLabel:"Gemini",videoSectionLabel:"비디오",imageModelAria:"이미지 모델 선택",quickSettingsAria:"모델과 추론 강도 선택. 현재 모델 {model}, 추론 {effort}",quickSettingsModelOnlyAria:"이미지 모델 선택. 현재 모델 {model}",quickSettingsMenu:"모델 및 추론 빠른 설정",reasoningLabel:"추론",videoModelLabel:"비디오",nodeModeHint:"노드 모드에서는 노드를 눌러 프롬프트를 수정한 뒤 생성하세요. 오른쪽 패널의 설정 (품질/크기)은 새로 만드는 모든 결과에 적용됩니다."},W0={openAria:"설정 열기",openTitle:"설정",closeAria:"설정 닫기",closeTitle:"캔버스로 돌아가기",navAria:"설정 섹션",contentAria:"설정 내용",jumpTo:"{section} 섹션으로 이동",title:"설정",sections:{providers:{title:"프로바이더",hint:"계정 · 키 · 모델"},workspace:{title:"작업공간",hint:"프로필 · 배치 · 갤러리"},general:{title:"일반",hint:"언어"}},account:{primaryEyebrow:"현재 공급자",oauthTitle:"GPT OAuth",oauthBody:"GPT OAuth로 생성할 때 Codex 로그인 세션을 사용해요. 유효한 API 키가 있으면 API 키 모드로 바꿀 수 있어요.",apiSourceEnv:"OPENAI_API_KEY 감지됨",apiSourceConfig:"config.json API 키 감지됨",apiTitle:"OpenAI API 키",apiBody:"ima2-gen은 이 API 키로 Responses API 기반 생성, 편집, 멀티모드, 노드 요청을 처리할 수 있습니다.",apiDisabled:"사용 불가",apiReady:"준비됨",apiUnavailable:"사용 불가",apiUnknown:"상태 불명",grokEyebrow:"로컬 xAI 프록시",grokTitle:"Grok",grokBody:"설정된 로컬 포트의 progrok을 통해 xAI Images API 생성을 사용합니다.",agyEyebrow:"Antigravity CLI",agyTitle:"Gemini (agy)",agyInstalledBody:"로그인 상태는 확인할 수 없습니다. 생성이 실패하면 터미널에서 agy login 을 실행하세요.",agyMissingBody:"설치되지 않았습니다. 설치:",agyMissingLink:"Antigravity CLI",agyFineprint:"antigravity 모델과 이미지 할당량은 별도입니다.",agyInstalled:"설치됨",agyMissing:"미설치",status:{ready:"준비됨",authRequired:"로그인 필요",starting:"시작 중",offline:"오프라인",noImageModel:"이미지 모델 없음",error:"오류",checking:"확인 중"}},quota:{codexNotLoggedIn:"로그인 필요",fetchError:"쿼타를 불러올 수 없음",noData:"사용량 데이터 없음",grokUsageLink:"Grok 사용량 보기 →",switchAccount:"{provider} 계정 전환",startingLogin:"로그인 시작 중…",enterCode:"열린 탭에 이 코드를 입력하세요:",retry:"다시 시도",copyLink:"링크 복사",copied:"복사됨",waitingApproval:"승인 대기 중…",switchComplete:"계정을 전환했습니다. 새로고침 중…",switchFailed:"계정을 전환하지 못했습니다",tryAgain:"다시 시도"},imageModel:{title:"이미지 모델",body:"앞으로 이미지 생성에 쓸 모델을 골라요. Grok 모델을 고르면 공급자도 Grok으로 바뀌어요.",gpt54Mini:"GPT-5.4 Mini",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt56Sol:"GPT-5.6 Sol",gpt56Terra:"GPT-5.6 Terra",gpt56Luna:"GPT-5.6 Luna",grokImagine20:"Grok Imagine Image 2.0",grokImagine:"Grok Imagine",grokImagineQuality:"Grok Imagine Quality",nanoBanana2:"Nano Banana 2",nanoBanana2Api:"Nano Banana 2",nanoBananaPro:"나노 바나나 Pro",atlasCloudGptImage2:"Atlas Cloud GPT Image 2",atlasCloudGptImage2Edit:"Atlas Cloud GPT Image 2 Edit",minimaxImage01:"MiniMax image-01",minimaxImage01Live:"MiniMax image-01-live",agy:"Antigravity (agy)",gpt53CodexSpark:"GPT-5.3 Codex Spark — 이미지 생성 미지원",unsupportedHelp:"Grok 모델은 번들된 로컬 프록시를 통해 xAI Images API를 사용합니다. GPT 모델은 OpenAI Responses 이미지 생성을 사용합니다."},apiKeys:{accordionTitle:"API Keys",envSource:"환경 변수에서 로드됨",configSource:"설정 파일에서 로드됨",openai:{label:"GPT API Key (OpenAI)",placeholder:"OpenAI API 키 붙여넣기 (sk-...)"},xai:{label:"Grok API Key (xAI)",placeholder:"xAI API 키 붙여넣기 (xai-...)"},gemini:{label:"Gemini (Google)",placeholder:"Gemini API 키 붙여넣기 (AI...)"},atlascloud:{label:"Atlas Cloud",placeholder:"Atlas Cloud API 키 붙여넣기 (apikey-...)"},minimax:{label:"MiniMax",placeholder:"MiniMax API 키 붙여넣기"},vertex:{label:"Vertex AI (서비스 계정)",placeholder:'Google Cloud 서비스 계정 JSON 붙여넣기 { "type": "service_account", ... }',authModeApiKey:"API Key",authModeVertex:"Vertex JSON"},save:"저장",saved:"저장됨",saving:"검증 중...",remove:"삭제",saveFailed:"키를 저장하지 못했어요",networkError:"네트워크 오류가 발생했어요. 다시 시도해 주세요.",removeFailed:"키를 삭제하지 못했어요",configuredReplace:"설정됨 — 눌러서 교체",status:{valid:"유효",notConfigured:"미설정"}},videoModel:{grokImagine:"Grok Imagine Video",grokImagine15:"Grok Imagine Video 1.5"},reasoning:{title:"추론 강도",body:"값이 높을수록 생성 전에 plan/검색/프롬프트 보강에 더 많은 reasoning 토큰을 사용합니다.",none:"Off — 추가 추론 없음",low:"Low — 가장 빠름, 추론 최소",medium:"Medium — 기본 균형값",high:"High — 더 깊은 리서치와 통합",xhigh:"Xhigh — 확장 추론, 느림",max:"Max — 최대 추론, 가장 느림"},webSearch:{title:"웹서치",body:"실존 인물, 브랜드, 제품, 장소, 최신 이벤트를 생성 전에 실시간 검색해서 반영합니다.",on:"검색 켬",off:"검색 끔"},grokCompatibility:{title:"Grok 호환성",body:"Grok 이미지 생성은 먼저 필수 웹 검색을 수행하고, 그 다음 텍스트와 첨부 이미지를 함께 보는 image-tool planner가 최종 이미지 프롬프트를 영어로 작성한 뒤 xAI Images API로 실행됩니다. 첨부 레퍼런스는 xAI 이미지 편집 경로로 유지되고, 크기는 aspect ratio/resolution으로 매핑됩니다. 출력 포맷·모더레이션·추론은 GPT OAuth/API 키 공급자에서만 사용됩니다."},grokPlanner:{title:"Grok planner 모델",body:"검색과 이미지·비디오 프롬프트를 기획하는 모델입니다. 기본값은 Grok 4.5이며 I2V·Ref2V 기획에서 이미지 입력을 지원합니다. Grok 4.3은 호환 선택지로 남아 있습니다."},gallery:{defaultScopeTitle:"기본 갤러리 보기",defaultScopeBody:"갤러리를 열 때 처음 보여줄 범위를 선택합니다."},appearance:{historyStripLayoutTitle:"히스토리 썸네일",historyStripLayoutBody:"작업공간 옆 작은 히스토리 배열 방식을 고릅니다.",historyStripLayout:{rail:"세로",horizontal:"상단 가로",sidebar:"사이드바"}},language:{title:"언어",body:"생성 프롬프트와 무관하게 인터페이스 언어만 바꿉니다."}},Z0={loading:"세션 불러오는 중...",addFirst:"+ 첫 노드 추가",addRootTitle:"루트 노드 추가",hint:"핸들을 빈 공간으로 드래그하면 새 브랜치가 생깁니다. Delete 또는 Backspace로 삭제할 수 있습니다."},eC={title:"{provider} 사용 불가",ariaLabel:"{provider} 사용 불가"},tC={label:"언어",ko:"한국어",en:"English","zh-Hant":"正體中文","zh-Hans":"简体中文"},nC={close:"닫기",details:"자세한 원본 오류 보기",unknown:{title:"알 수 없는 오류가 발생했어요",body:"잠시 후 다시 시도해 주세요. 문제가 계속되면 원본 오류 메시지를 복사해 제보해 주세요."},moderationRefused:{title:"프롬프트가 모더레이션에 걸렸어요",body:"표현 수위를 낮추거나 다른 문구로 바꿔 보세요. 레퍼런스 이미지의 선정적/폭력적 요소도 영향을 줄 수 있어요.",cta:"프롬프트 수정",bodyInput:"프롬프트 텍스트가 입력 필터에 걸렸어요. 표현을 바꾸거나 다른 문구로 시도해 보세요.",bodyOutput:"이미지가 생성 후 출력 필터에 걸렸어요. 스타일이나 품질 설정을 바꿔 보세요."},emptyResponse:{title:"이미지가 돌아오지 않았어요",body:"Codex가 응답을 보냈지만 이미지 데이터가 비어 있었어요. 모더레이션 문제가 아니라 일시적 오류이거나 지원되지 않는 옵션 조합일 수 있어요. 다시 시도하거나 크기·품질·모델을 바꿔 보세요.",cta:"다시 시도"},streamParseFailed:{title:"이미지 응답 스트림을 해석하지 못했어요",body:"응답 데이터는 도착했지만 앱이 이미지 스트림을 끝까지 읽지 못했어요. 네트워크 프록시나 일시적인 스트림 오류일 수 있어요.",cta:"다시 시도"},imageToolNotCalled:{title:"이미지 도구가 호출되지 않았어요",body:"응답은 완료됐지만 이미지 생성 도구 호출이 확인되지 않았어요. 같은 프롬프트로 다시 시도하거나 모델/검색 옵션을 바꿔 보세요.",cta:"다시 시도"},webSearchOnlyResponse:{title:"이미지 도구가 호출되지 않았어요",body:"웹 검색 도구만 호출되고 이미지 생성 도구가 실행되지 않았어요. 검색 옵션을 끄거나 다시 시도해 주세요.",cta:"다시 시도"},imageToolFailed:{title:"이미지 도구 호출이 실패했어요",body:"이미지 생성 도구가 호출됐지만 실패 상태로 끝났어요. 문제가 반복되면 `ima2 doctor image-probe --json` 결과와 함께 제보해 주세요.",cta:"다시 시도"},imageToolNoResult:{title:"이미지 데이터가 비어 있었어요",body:"이미지 도구 호출은 완료됐지만 결과 이미지가 포함되지 않았어요. 옵션 조합이나 계정 권한 문제일 수 있어요.",cta:"다시 시도"},oauthImageCapabilityUnavailable:{title:"현재 계정에서 이미지 도구를 사용할 수 없는 것 같아요",body:"GPT OAuth 로그인은 되어 있지만, 이 계정/모델 조합에서 이미지 생성 도구 권한이 없을 수 있어요. API-Key 모드나 다른 모델로 확인해 주세요.",cta:"확인"},responsesStreamError:{title:"이미지 응답 스트림이 오류로 종료됐어요",body:"OpenAI 응답 스트림에서 오류 이벤트가 반환됐어요. 잠시 후 다시 시도하고, 반복되면 원본 오류 세부 정보를 확인해 주세요.",cta:"다시 시도"},upstream5xx:{title:"OpenAI 서버가 혼잡합니다",body:"잠시 후 다시 시도하면 대부분 해결돼요. 상태 페이지(status.openai.com)도 확인해 보세요.",cta:"다시 시도"},authChatgptExpired:{title:"Codex ChatGPT 로그인이 만료됐어요",body:"터미널에서 `ima2 setup`을 다시 실행한 뒤(옵션 1) 앱을 새로고침해 주세요.",cta:"새로고침"},authApiKeyInvalid:{title:"API 키 인증 실패",body:"키가 없거나 잘못됐거나, 한도/조직 권한 문제가 있을 수 있어요. GPT OAuth로 전환하거나 설정된 API 키를 갱신해 주세요.",cta:"확인"},networkFailed:{title:"네트워크 연결 실패",body:"OpenAI 또는 로컬 런타임 서비스에 연결하지 못했어요. 먼저 새로고침하고, 계속되면 VPN/방화벽과 `ima2 doctor`에 표시되는 포트를 확인해 주세요.",cta:"새로고침"},oauthUnavailable:{title:"GPT OAuth 프록시를 사용할 수 없어요",body:"GPT OAuth 프록시가 아직 시작 중이거나, 사용할 수 없거나, fallback 포트로 이동했을 수 있어요. 먼저 새로고침하고, 계속되면 `ima2 doctor`의 GPT OAuth URL을 확인해 주세요.",cta:"새로고침"},invalidRequest:{title:"이미지 요청을 수정해야 해요",body:"생성 요청의 일부 값이 올바르지 않습니다. 아래 원본 오류를 확인한 뒤 프롬프트나 크기를 수정해 다시 시도해 주세요.",cta:"입력 수정"},apikeyDisabled:{title:"API-Key 모드를 사용할 수 없어요",body:"이 빌드는 API-Key 생성을 지원하지만 현재 요청에서 설정된 키를 사용할 수 없었습니다. GPT OAuth로 전환하거나 API 키를 갱신해 주세요.",cta:"확인"},agyGenerationFailed:{title:"Gemini 생성 실패",body:"Antigravity CLI에서 오류가 발생했습니다. agy 바이너리가 설치되어 있고 Gemini 계정이 활성화되어 있는지 확인하세요.",cta:"재시도"},agyTimeout:{title:"Gemini 생성 시간 초과",body:"agy 프로세스가 제한 시간(360초) 내에 응답하지 않았습니다. 다시 시도하거나 agy CLI 상태를 확인하세요.",cta:"재시도"},agyProcessError:{title:"Gemini 프로세스 오류",body:"agy CLI가 예기치 않은 오류로 종료되었습니다. 'agy --version'으로 바이너리가 정상인지 확인하세요.",cta:"재시도"},agyQuotaExhausted:{title:"Gemini 할당량 소진",body:"Gemini 이미지 생성 용량이 소진되었습니다. 할당량은 자동으로 리셋됩니다 — 에러 상세에서 리셋 타이머를 확인하세요.",cta:"확인"},authClass:{title:"로그인이 필요합니다",body:"공급자 인증이 만료됐거나 키가 거부됐습니다. 설정에서 다시 로그인해 주세요.",cta:"다시 로그인"},billingRequired:{title:"잔액이 부족합니다",body:"이 공급자 계정에 사용 가능한 크레딧이 없습니다. 공급자 콘솔에서 잔액을 확인한 뒤 다시 시도해 주세요."}},aC={title:"프롬프트 라이브러리",saveTitle:"프롬프트 라이브러리에 저장",save:"저장",saved:"프롬프트를 저장했습니다",saveFailed:"저장에 실패했습니다",name:"이름",tags:"태그",search:"프롬프트 검색...",favorites:"즐겨찾기",load:"불러오기",insert:"삽입",inserted:"프롬프트를 삽입했습니다",removeInserted:"삽입한 프롬프트 {name} 제거",favorite:"즐겨찾기",unfavorite:"즐겨찾기 해제",empty:"저장된 프롬프트가 없어요.",content:"내용",copy:"복사",untitled:"제목 없음",addNew:"새 프롬프트 추가",import:"불러오기",importFiles:".txt, .md, .markdown 또는 GitHub 파일 불러오기",dropImport:".txt, .md, .markdown 파일을 놓으면 프롬프트로 가져옵니다",importTitle:"프롬프트 가져오기",importDropTitle:"파일을 여기에 드래그하세요",importDropHint:".txt, .md, .markdown 파일을 preview한 뒤 저장합니다",importChooseFiles:"파일 선택",importGithubLabel:"GitHub 파일 URL 또는 경로",importPreview:"미리보기",importPreviewEmpty:"파일을 드래그하거나 GitHub 경로를 입력하면 후보가 표시됩니다.",importCommit:"선택 항목 저장",importSelected:"선택한 프롬프트 불러오기 ({count})",importThisPrompt:"이 프롬프트 불러오기",previewPrompt:"내용 보기",selectPrompt:"선택",selectedPrompt:"선택됨",selectedCount:"{count}개 선택됨",selectAllCandidates:"전체 선택",clearCandidateSelection:"선택 해제",addAnotherSource:"다른 소스 추가",searchResultsHeader:"검색 결과 ({count}개)",searchResults:"검색 결과",promptText:"프롬프트 내용",importSelectAtLeastOne:"저장할 프롬프트를 하나 이상 선택하세요.",imported:"프롬프트 {count}개를 가져왔습니다",importFailed:"가져오기에 실패했습니다",importNoValidFiles:".txt, .md, .markdown 프롬프트 파일이 없습니다.",curatedSources:"추천 소스",curatedSourcesHint:"검토된 공개 프롬프트 소스 검색",curatedSearch:"검색",curatedSearchPlaceholder:"nano banana, gpt-image-2, typography...",refreshSource:"갱신",curatedRefreshed:"프롬프트 후보 {count}개를 인덱싱했습니다",sourceTrustTier:"소스 신뢰도",requiresAttribution:"출처 표시 필요",sourceDetails:"출처",license:"라이선스",attributionRequired:"출처 표기 필요",modelHints:"모델 힌트",taskHints:"작업 힌트",warnings:"경고",compatibilityWarnings:"호환성 경고",transparentUnsupportedGptImage2:"gpt-image-2는 투명 배경을 지원하지 않습니다",noCuratedResults:"추천 소스에서 프롬프트 후보를 찾지 못했습니다.",discovery:"발견",discoverySearch:"GitHub 검색",discoverySearchPlaceholder:"프롬프트 저장소 검색...",discoveryCandidates:"발견 후보",discoveryApprove:"승인",discoveryReject:"거절",discoveryApproved:"승인됨",discoveryRejected:"거절됨",discoveryScore:"점수",discoveryWarnings:"발견 경고",discoveryRateLimited:"GitHub discovery가 rate limit에 걸렸습니다.",discoveryNoResults:"발견 후보가 없습니다.",discoveryReviewQueue:"검토 대기열",discoveryRequiresPaths:"기본 검색 전에 검토된 파일 경로를 추가하세요.",folderBrowse:"폴더 보기",folderBrowseHint:"GitHub 폴더의 지원 파일만 불러옵니다",folderFiles:"폴더 파일",folderFilesEmpty:"가져올 수 있는 .md / .markdown / .txt 파일이 없습니다",folderPreviewSelected:"선택 파일 미리보기",folderSelectedCount:"{count}개 선택됨",folderWarnings:"폴더 경고",folderTooManyFiles:"파일이 너무 많아 일부만 표시했습니다",folderNoSelection:"미리볼 파일을 선택하세요",folderUnsupported:"GitHub 폴더만 지원합니다"},oC={title:"프롬프트 빌더",subtitle:"맥락을 이어가며 최종 프롬프트를 정리합니다.",scopeDraft:"새 작업",scopeImage:"선택 이미지: {name}",scopeImageFallback:"현재 이미지",newWorkTitle:"이미지 컨텍스트 없이 새 작업 시작",model:"빌더 모델",empty:"원하는 방향을 말해보세요. 현재 프롬프트와 설정을 함께 참고합니다.",user:"나",assistant:"빌더",placeholder:"어떤 이미지를 만들어볼까요?",send:"전송",sending:"작성 중",thinking:"프롬프트를 정리하는 중...",clear:"비우기",applyToPrompt:"본문에 적용",insertAsBlock:"블록 삽입",finalKoreanPrompt:"한국어 프롬프트",finalEnglishPrompt:"영어 프롬프트",blockName:"빌더 제안",applied:"빌더 제안을 본문 프롬프트에 적용했습니다",inserted:"빌더 제안을 프롬프트 블록으로 삽입했습니다",failed:"프롬프트 빌더 호출에 실패했습니다",removeScopeImage:"빌더에서 선택 이미지 제외",removeAttachment:"첨부 {name} 제거",attach:"파일 첨부",attachmentOnlyMessage:"첨부한 파일을 참고해서 프롬프트를 도와줘"},rC={sectionTitle:"작업 공간",sectionBody:"작업 공간 레이아웃 프로필을 선택합니다.",profileLabel:"작업 공간 프로필",defaultLabel:"기본",defaultDesc:"사이드바 컴포저가 있는 기본 생성 흐름.",promptStudioLabel:"프롬프트 스튜디오",promptStudioDesc:"프롬프트 빌더 패널, 그룹 히스토리, 향상된 뷰어."},iC={controls:"이미지 확대 컨트롤",zoomIn:"확대",zoomOut:"축소",reset:"확대 초기화"},lC={title:"로그",empty:"생성 로그가 없습니다",copied:"프롬프트 복사됨",copy:"클릭하여 프롬프트 복사",loadFailed:"생성 로그를 불러오지 못했습니다.",retry:"다시 시도",detailOpen:"클릭하여 상세 보기",detailTitle:"생성 요청",detailTime:"시각",detailRequestId:"요청 ID",detailCounts:"성공 / 요청",detailError:"오류 코드",detailPrompt:"프롬프트",detailPromptEmpty:"(프롬프트 없음)",detailErrorMessage:"실패 사유"},sC={writeFailed:"클립보드에 복사하지 못했습니다."},cC={graphSaveFailed:"노드 그래프를 저장하지 못했습니다.",sessionSwitchSaveFailed:"현재 그래프를 저장하지 못해 세션 전환을 중단했습니다.",sessionInitialLoadFailed:"세션을 불러오지 못했습니다.",sessionInitialLoadRetry:"세션을 불러오지 못했습니다. 지금 다시 시도할까요?",attachmentReadFailed:"하나 이상의 첨부 파일을 읽지 못했습니다."},dC={ariaLabel:"기본 내비게이션",home:"홈",create:"생성",node:"노드 그래프",agent:"에이전트",assets:"보관함",assetGen:"에셋 생성",settings:"설정"},uC={title:"에셋 생성",lede:"이미지를 만들고 클릭 한 번으로 배경까지 지워 보세요.",prompt:"프롬프트",promptPlaceholder:"빨간 사과 하나, 스튜디오 제품 촬영",background:"배경",backgroundHint:"녹색 배경일 때 배경 제거가 가장 깨끗합니다. 잘 모르겠다면 녹색 그대로 두세요.",bgChroma:"크로마 그린",bgWhite:"하양",bgBlack:"블랙",model:"모델",modelGpt:"GPT",modelGrok:"Grok",kind:"출력",kindImage:"이미지",kindVideo:"비디오",videoSoon:"비디오 에셋은 다음 단계에서 열립니다",videoGrokOnly:"비디오 생성은 Grok에서 동작합니다 — 모델을 Grok으로 바꿔 주세요",videoOptions:"비디오 옵션",videoDuration:"길이",videoResolution:"해상도",videoAspect:"화면 비율",generate:"에셋 생성",generating:"생성 중…",emptyTitle:"아직 에셋이 없습니다",emptyBody:"왼쪽에 프롬프트를 쓰고 “에셋 생성”을 누르세요. 결과는 여기에 나타나고 프로젝트에 자동 저장됩니다.",previewImage:"이미지 미리보기 열기: {prompt}",previewVideo:"비디오 미리보기 열기: {prompt}",previewDialogTitle:"미리보기: {prompt}",closePreview:"미리보기 닫기",zoomIn:"확대",zoomOut:"화면에 맞춤",openHintImage:"크게 보기",openHintVideo:"재생",imageFallback:"생성된 이미지",videoFallback:"생성된 비디오",emptyCta:"첫 프롬프트 쓰기",errorTitle:"생성에 실패했습니다",errorHint:"모델과 API 키 설정을 확인하고 다시 시도해 주세요.",errorDismiss:"닫기",savedHint:"결과는 프로젝트에 자동 저장됩니다.",savedLink:"에셋 탭에서 보기",railTitle:"프로젝트 에셋",railEmpty:"이 프로젝트에 저장된 에셋이 아직 없습니다.",railError:"프로젝트 에셋을 불러오지 못했습니다.",sequence:"시퀀스",candidates:"후보 보관함",frameAria:"{rail}의 {n}번 프레임",addFrame:"추가",removeFrame:"빼기",deleteFrame:"{n}번 프레임 삭제"},mC={select:"프로젝트",unassigned:"미분류",new:"새 프로젝트…",newPrompt:"프로젝트 이름",search:"프로젝트 찾기…",searchPlaceholder:"프로젝트 검색",searchEmpty:"일치하는 프로젝트가 없습니다",close:"닫기",saveRetry:"저장 다시 시도"},pC={title:"스프라이트 큐레이터",open:"큐레이션",close:"큐레이터 닫기",state:"애니메이션 상태",unsaved:"저장하지 않은 변경",discardConfirm:"저장하지 않은 스프라이트 변경을 버릴까요?",loadError:"스프라이트 실행 결과를 불러오지 못했습니다.",saveError:"큐레이션을 저장하지 못했습니다.",bakeError:"스프라이트 아틀라스를 굽지 못했습니다.",exportError:"스프라이트 애니메이션을 내보내지 못했습니다.",previous:"이전 프레임",play:"재생",pause:"일시 정지",next:"다음 프레임",speed:"속도",grid:"격자",transform:"프레임 변형",rotate:"회전",scale:"크기",dx:"가로 이동",dy:"세로 이동",shx:"가로 기울기",shy:"세로 기울기",flipX:"좌우 뒤집기",sequence:"시퀀스 — 재생·굽기 순서",candidates:"후보 보관함",frameAria:"{rail}의 {n}번 프레임",addFrame:"추가",removeFrame:"빼기",deleteFrame:"{n}번 프레임 삭제",save:"큐레이션 저장",bake:"아틀라스 굽기",contactSheet:"콘택트 시트",gif:"GIF 내보내기",status:{loading:"불러오는 중…",ready:"저장됨",saving:"저장 중…",baking:"굽는 중…",exporting:"내보내는 중…",error:"작업 실패"}},fC={title:"배경 제거",open:"배경 제거",original:"원본",originalAlt:"배경 제거 전 원본",removed:"배경 제거",previewLoading:"제거 결과를 준비하는 중…",resultBadge:"배경 제거됨",keyColor:"키 색상",pickHint:"프리뷰를 클릭하면 키 색상을 다시 고릅니다",clickMode:"프리뷰 클릭 동작",modeErase:"클릭해서 지우기",modePick:"키 색 선택",eraseHint:"빈 공간을 클릭하면 이어진 그 영역만 지워집니다",undoClick:"클릭 취소 ({count})",previewAlt:"체커보드 위 키잉 프리뷰",tolerance:"제거 강도",softness:"경계 부드러움",spill:"색 번짐 제거",unmix:"경계 언믹스",unmixHint:"반투명 경계를 복원합니다 (크로마 키 전용)",reset:"기본값",download:"알파 PNG 내려받기",save:"프로젝트에 저장",saving:"저장 중…",videoSave:"알파 WebM 생성",videoKeying:"비디오 키잉 중… {seconds}s",videoSaved:"알파 WebM을 프로젝트에 저장했습니다",saved:"알파 PNG를 프로젝트에 저장했습니다",saveError:"키잉 결과를 저장하지 못했습니다",loadError:"이미지를 불러오지 못했습니다. 닫고 다시 시도해 주세요.",advanced:"제거 세부 조정 (고급)"},gC={ariaLabel:"빠른 작업",animate:"영상으로",edit:"캔버스에서 편집",useAsRef:"참조로 사용",rebake:"다시 굽기",refAdded:"참조 이미지로 추가됨",refFailed:"참조 추가 실패",saveToAssets:"보관",savedToAssets:"보관함에 저장됨",saveToAssetsFailed:"보관함 저장 실패"},hC={title:"보관함",clearAll:"전체 삭제",clearConfirm:"저장된 자산을 모두 삭제할까요? 되돌릴 수 없습니다.",testSheetsUnavailable:"요소 테스트 시트는 아직 사용할 수 없습니다.",detailAria:"{name} 상세",searchPlaceholder:"보관함 검색…",allAssets:"전체 보기",elementLibrary:"요소 라이브러리",removeFromElements:"요소 라이브러리에서 제거",emptyElementsTitle:"아직 요소가 없어요",emptyElementsBody:"요소는 @멘션으로 재사용하는 영구 참조(캐릭터·제품·스타일·장면)예요. 갤러리 이미지를 에셋으로 저장해 요소로 만들고, 어디서든 @로 불러오세요.",newFolder:"새 폴더",kindAll:"모든 유형",kindImage:"이미지",kindVideo:"비디오",kindElement:"요소",kindPreset:"프리셋",kindTemplate:"템플릿",emptyTitle:"아직 보관된 자산이 없어요",emptyBody:"아직 저장된 게 없습니다. 에셋 생성 탭에서 첫 이미지를 만들어 보세요 — 결과는 여기에 자동 저장됩니다.",emptySearchTitle:"일치하는 항목 없음",emptySearchBody:"다른 검색어나 태그, 유형 필터를 써보세요.",emptyFolderTitle:"빈 폴더예요",emptyFolderBody:"자산을 이 폴더로 옮기거나 새 결과물을 저장해보세요.",deleteAsset:"보관함에서 제거",confirmDelete:"삭제할까요?",loadMore:"더 불러오기",rootFolder:"최상위",renameFolder:"폴더 이름 변경",renameAsset:"에셋 이름 변경",starAsset:"에셋에 별표 추가",unstarAsset:"에셋 별표 해제",deleteFolder:"폴더 삭제",actionFailed:"작업 실패",starSaved:"에셋에 추가했어요",starSaveFailed:"별표는 저장했지만 에셋에는 추가하지 못했어요",itemCount:"{count}개",emptyCta:"에셋 생성 탭 열기",loadErrorTitle:"에셋을 불러오지 못했습니다",loadErrorBody:"라이브러리를 불러오는 중 문제가 생겼습니다.",retry:"다시 시도",detailClose:"상세 닫기",detailKind:"종류",detailCreated:"생성일",detailProvider:"모델",detailPrompt:"프롬프트",detailTags:"태그",bindingsTitle:"프로바이더 바인딩",bindingsHelp:"이 캐릭터를 외부 프로바이더와 연결하는 설정입니다.",bindingStateless:"생성마다 refs 전송",bindingTagPlaceholder:"runway @tag (선택)",bindingSave:"바인딩 저장",bindingSaving:"저장 중…",bindingTagInvalid:"태그는 1-32자 영문/숫자/밑줄/하이픈만 가능합니다.",bindingCapWarning:"refs가 {count}장입니다 — Runway는 생성당 최대 3장입니다.",bindingTrain:"Soul ID 학습",bindingTrainLockedHint:"Higgsfield 유료 플랜이 필요합니다.",bindingPaidPlan:"유료 플랜 필요",bindingDriftWarning:"refs가 학습 시점과 다릅니다 — 재학습을 고려하세요."},yC={name:"노드 스튜디오",toolbar:{addImage:"이미지 추가",templates:"템플릿",saveTemplate:"템플릿 저장",branch:"분기"},empty:{title:"이미지 워크플로 만들기",description:"프롬프트에서 시작하거나, 검증된 그래프를 불러오거나, 최근 작업을 이어가세요.",blankTitle:"빈 캔버스에서 시작",blankDescription:"프롬프트 노드 하나를 추가해 원하는 흐름을 직접 만드세요.",blankAction:"빈 캔버스 시작",templateTitle:"템플릿으로 시작",templateDescription:"자주 쓰는 생성 흐름을 담은 그래프를 복사해 시작하세요.",templateAction:"템플릿 보기",recentTitle:"최근 그래프 이어서",recentDescription:"가장 최근에 저장된 정상 그래프를 이어서 작업하세요.",recentUnavailable:"아직 이어서 열 수 있는 최근 그래프가 없어요.",recentAction:"최근 작업 열기",resumeError:"최근 그래프를 열지 못했어요. 다시 시도해 주세요."},elements:{ariaLabel:"요소 노드",title:"요소",hint:"드래그하거나 추가",loading:"요소를 불러오는 중…",loadError:"요소를 불러오지 못했어요. 다시 시도해 주세요.",empty:"아직 저장된 요소가 없어요.",addToCanvas:"캔버스에 추가"},elementNode:{untitled:"이름 없는 요소",referencesOutput:"요소 참조 출력",notesOutput:"요소 메모 출력",kind:"요소",referenceCountOne:"참조 {count}개",referenceCount:"참조 {count}개",missing:"이 요소는 삭제되었어요. 실행하기 전에 다시 연결해 주세요."},elementController:{onlyElements:"캔버스에는 요소 에셋만 추가할 수 있어요.",invalid:"요소 노드가 올바르지 않아요.",addError:"요소를 캔버스에 추가하지 못했어요."},branch:{defaultVariant:"변형 {index}",eyebrow:"워크플로 분기",title:"변형 만들기",close:"분기 창 닫기",variantLegend:"변형 {index}",label:"이름",provider:"프로바이더",modelOverride:"모델 변경",currentModel:"현재 모델 사용",sizeOverride:"크기 변경",currentSize:"현재 크기 사용",remove:"삭제",add:"변형 추가",cancel:"취소",create:"분기 만들기",selectSourceError:"연결된 소스 노드 하나를 선택해 주세요.",applyError:"분기를 적용하지 못해 그래프를 변경하지 않았어요."},templates:{previewAria:"{name} 그래프 미리보기",nodeCountOne:"노드 {count}개",nodeCount:"노드 {count}개",outputCountOne:"출력 {count}개",outputCount:"출력 {count}개",rename:"이름 변경",delete:"삭제",deleteConfirm:"“{name}” 템플릿을 삭제할까요? 되돌릴 수 없습니다.",title:"템플릿 선택",close:"템플릿 닫기",searchLabel:"템플릿 검색",searchPlaceholder:"이름 또는 태그",loading:"템플릿을 불러오는 중…",empty:"“{query}”와 일치하는 템플릿이 없어요.",starter:"기본 템플릿",yours:"내 템플릿",cancel:"취소",copy:"복사본 만들기",loadError:"템플릿을 불러오지 못했어요. 다시 시도해 주세요.",replaceConfirm:"현재 그래프를 이 템플릿 복사본으로 바꿀까요?",invalidGraph:"템플릿 그래프가 올바르지 않아요.",copyError:"템플릿을 복사하지 못했어요.",namePrompt:"템플릿 이름",saved:"템플릿을 저장했어요.",saveError:"템플릿을 저장하지 못했어요.",renamePrompt:"템플릿 이름 변경",renameError:"템플릿 이름을 바꾸지 못했어요.",deleteError:"템플릿을 삭제하지 못했어요."},palette:{ariaLabel:"노드 삽입 명령",compatiblePlaceholder:"{portType}와 연결할 노드 검색",searchPlaceholder:"노드 검색",filter:"{portType} 입력을 받을 수 있는 노드만 표시합니다.",emptyCompatible:"{portType} 입력을 받을 수 있는 노드가 없어요.",emptySearch:"검색과 일치하는 노드가 없어요.",commandsAria:"노드 명령",categories:{input:"입력",generate:"생성",transform:"변환",reference:"참조",output:"출력"}},commands:{"image-generate":{label:"이미지 생성",description:"워크플로에 이미지 노드를 추가합니다."}},portTypes:{prompt:"프롬프트",image:"이미지",images:"이미지 모음",video:"비디오",mask:"마스크","element-refs":"요소 참조","element-notes":"요소 메모",settings:"설정","any-media":"모든 미디어"},compatibility:{sameDirection:"출력 포트를 입력 포트에 연결해 주세요.",typeMismatch:"두 포트 유형은 서로 연결할 수 없어요.",cardinality:"이 입력에는 이미 연결된 노드가 있어요.",selfEdge:"노드는 자기 자신에 연결할 수 없어요.",duplicateEdge:"이미 같은 연결이 있어요.",unknownPort:"이 포트는 연결에 사용할 수 없어요.",cycle:"이 연결은 순환 고리를 만들기 때문에 연결할 수 없습니다."}},vC={tabs:{label:"에셋 작업 방식",generate:"일반 생성",sprite:"스프라이트"},title:"스프라이트 레시피",lede:"캐릭터 기준 앵커를 확정한 뒤 일관된 애니메이션 행을 생성합니다.",loading:"스프라이트 레시피를 불러오는 중…",loadError:"레시피를 불러오지 못했습니다.",retry:"다시 시도",empty:{title:"스프라이트 레시피 만들기",body:"캐릭터, 셀 크기, 애니메이션 상태를 정의하세요.",create:"레시피 만들기"},recipe:{select:"레시피",new:"새 레시피",name:"레시피 이름",characterId:"캐릭터 ID",description:"설명",style:"스타일",baseAssetId:"기준 이미지 에셋",baseAsset:"기준 이미지 에셋",save:"레시피 저장",saving:"저장 중…",unsaved:"생성 전에 변경 내용을 저장하세요."},cell:{title:"셀 크기",width:"너비",height:"높이",safeMarginX:"가로 여백",safeMarginY:"세로 여백"},chroma:{title:"크로마키",hex:"크로마 색상"},states:{title:"애니메이션 상태",add:"상태 추가",remove:"삭제",key:"상태 키",frames:"프레임",fps:"FPS",loop:"반복",action:"동작"},anchor:{title:"아이덴티티 앵커",missing:"행 생성 전에 idle 포즈를 생성하고 승인하세요.",generate:"idle 후보 생성",generating:"생성 중…",candidate:"검토할 후보가 준비되었습니다.",regenerate:"다시 생성",approve:"앵커 승인",approved:"앵커 승인됨",replace:"앵커 교체",confirmTitle:"이 아이덴티티 앵커를 승인할까요?",confirmBody:"이후 행은 이 아이덴티티를 재사용하며 기준 이미지는 다시 첨부되지 않습니다.",confirm:"승인",cancel:"취소"},rows:{title:"스프라이트 행",generateAll:"전체 생성",generateSelected:"선택 생성",regenerate:"행 다시 생성",cancel:"취소",preview:"미리보기",anchorRequired:"먼저 앵커를 승인하세요.",saveRequired:"먼저 레시피 변경 내용을 저장하세요.",status:{pending:"대기",queued:"예약됨",running:"생성 중",complete:"완료",error:"오류",canceled:"취소됨"}},error:{INVALID_SPRITE_RECIPE:"필수 레시피 항목을 입력하세요.",ANCHOR_NOT_APPROVED:"먼저 아이덴티티 앵커를 승인하세요.",BASE_REFERENCE_FORBIDDEN:"승인 후에는 기준 이미지를 다시 사용할 수 없습니다.",GENERATION_CANCELED:"생성이 취소되었습니다.",generic:"스프라이트 생성에 실패했습니다."}},bC={undone:"마지막 그래프 변경을 되돌렸습니다.",redone:"그래프 변경을 다시 적용했습니다."},SC={t2i:"텍스트→이미지",i2i:"이미지 편집",t2v:"텍스트→영상",i2v:"이미지→영상",v2v:"영상 이어가기"},xC={title:"요소",titleEdit:"요소 수정",titleNew:"새 요소",saved:"저장됨",ariaLabel:"요소 세부 정보",name:"이름",namePlaceholder:"예: 호두나무 의자",kind:"종류",kindCharacter:"인물",kindProduct:"제품",kindStyle:"스타일",kindScene:"장면",kindReference:"참조",selected:"선택한 요소",mentionAria:"{name}, {kind} 요소",unavailableAria:"{name}, 찾을 수 없는 요소",removeAria:"{name} 요소 삭제",helpCharacter:"반복해서 등장하는 인물이나 대상이에요.",helpProduct:"디자인 디테일을 일정하게 유지할 제품이에요.",helpStyle:"화풍, 재질, 마감 같은 시각 언어예요.",helpScene:"장소나 배경처럼 반복해서 쓰는 환경이에요.",notes:"메모",notesHelp:"외형, 재질처럼 계속 유지할 부분을 적어주세요.",notesPlaceholder:"따뜻한 호두나무 결, 둥근 모서리, 라탄 좌석…",remaining:"{n}자 남음",strength:"참조 반영 강도",strengthHelp:"생성 결과가 이 참조를 얼마나 따를지 정해요.",resetDefault:"기본값으로",saving:"저장 중…",save:"요소 저장",testing:"테스트 시트 만드는 중…",runTest:"테스트 시트 만들기",delete:"삭제",errorName:"저장하기 전에 이름을 지어주세요.",errorRefs:"저장하려면 참조 이미지가 최소 한 장 필요해요.",refsTitle:"참조 이미지",refsHelp:"끌어서 순서를 바꿀 수 있어요. 첫 이미지가 대표로 쓰여요.",refAlt:"참조 이미지 {n}",refPrimary:"대표",refLabel:"설명",refLabelPlaceholder:"정면, 측면, 재질…",refMoveUp:"참조 이미지 {n} 앞으로",refMoveDown:"참조 이미지 {n} 뒤로",refRemove:"삭제",refRemoved:"참조 이미지를 지웠어요.",refUndo:"되돌리기"},AC={common:g0,appBar:h0,sheet:y0,toast:v0,inflight:b0,size:S0,sizeConfirm:x0,quality:A0,moderation:T0,format:C0,count:w0,multimode:I0,metadata:E0,onboarding:R0,readiness:N0,generate:k0,home:_0,billing:M0,history:P0,panel:L0,prompt:O0,canvas:j0,gallery:G0,node:D0,nodeBatch:F0,edge:z0,provider:q0,mcp:U0,grokMode:H0,cost:B0,result:V0,session:K0,uiMode:$0,agent:Y0,cardNews:X0,video:Q0,sidebar:J0,settings:W0,nodeCanvas:Z0,apiDisabled:eC,language:tC,errorCard:nC,promptLibrary:aC,promptBuilder:oC,workspace:rC,viewer:iC,generationLog:lC,clipboard:sC,modal:cC,nav:dC,assetGen:uC,project:mC,spriteCurator:pC,keying:fC,chain:gC,assets:hC,"assets.clearAll":"전체 삭제","assets.clearConfirm":"저장된 자산을 모두 삭제할까요? 되돌릴 수 없습니다.",nodeStudio:yC,sprite:vC,graph:bC,provenance:SC,element:xC},TC={ok:"OK",cancel:"Cancel",delete:"Delete",close:"Close",saving:"Saving...",loading:"Loading...",dismiss:"Dismiss notification",generating:"Generating…",imageCollection:"{n} image collection",remove:"Remove",removeNamed:"Remove {name}",elementSuggestions:"Element suggestions",noMatchingElements:"No matching elements",enterPrompt:"Enter prompt…",continuity:"Continuity",activePrompt:"Active prompt",elementUnavailable:"Element unavailable",spritePreview:"Sprite animation preview",canvasMemo:"Canvas memo",cardDeck:"Card deck"},CC={modeImage:"Image",settings:"Settings",controls:"Generation controls",generate:"Generate",generateAria:"Open prompt sheet to generate an image"},wC={close:"Close prompt sheet",generate:"Generate image",controlsOpen:"Open generation controls",tabs:{prompt:"Prompt",controls:"Controls",library:"Library"}},IC={localImportSuccess:"Image added to gallery",localImportFailed:"Failed to import image",localImportInvalid:"Only PNG, JPEG, or WebP is supported",localStorageFull:"Local storage is full — recent state may not persist.",refLimitExceeded:"References are capped at 5. Extra images were dropped.",minimaxModelRequiresReference:"image-01-live needs a reference image outside China. Attach one, or switch to image-01.",refLimitTrayFull:"Reference tray is full ({max}). Remove an item with its X to attach more — deleted @tags can be re-mentioned with @.",refLimitPartial:"Only {added} of {total} images were added (limit {max}).",refOverProviderLimit:"This provider accepts up to {max} reference images. Remove {excess} to generate.",refTooLarge:"Image is too large. Convert to JPEG/PNG or lower the resolution and try again.",refNotBase64:"Image file is corrupted or uses an unsupported encoding.",refEmpty:"Empty image file. Please pick a different file.",refHeicUnsupported:"HEIC/HEIF is not supported. Convert to JPEG or PNG and try again.",noCurrentImageForRef:"No current image to use as reference.",refSlotFull:"Reference slots are full (max 5).",currentImageLoadFailed:"Failed to load current image.",addedCurrentAsRef:"Added current image as a reference.",sessionLoadFailed:"Failed to load session.",sessionCreateFailed:"Failed to create session.",sessionRenameFailed:"Failed to rename session.",sessionDeleteFailed:"Failed to delete session.",promptRequired:"Enter a prompt.",missingElements:"A selected element is missing. Remove it or re-add the element before generating.",nodeCreated:"Node {id} created ({elapsed}s)",nodeRootCreated:"Created a first node from this image.",animateStarted:"Animating image to video…",animateProgress:"Rendering video… {n}%",animateDone:"Video ready. Check your history.",animateFailed:"Video generation failed.",nodeCreateFailed:"Node generation failed.",generatedBatch:"Generated {count} images in {elapsed}s.",generatedSingle:"Generated in {elapsed}s.",generateFailed:"Generation failed.",sessionReloadedElsewhere:"Graph version changed, so the latest graph was reloaded.",promptCopied:"Prompt copied",metadataCopied:"Copied",imageCopied:"Copied to clipboard",frameCopied:"Frame copied to clipboard",copyFailed:"Copy failed",openGeneratedDirFailed:"Could not open the image folder. Run ima2 doctor to check the storage path.",openGeneratedDirOpened:"Opened the generated image folder.",noPromptToFork:"No prompt to fork",forkStarted:"Prompt imported. Edit and generate again.",forkStartedNoPrompt:"Image attached as reference. Type a prompt and generate.",continueAsUrlStarted:"Provider URL set as reference. Generate to use the original image.",continueAsUrlExpired:"The provider URL has expired. Use Continue here instead.",comfyExported:"Sent to ComfyUI as {filename}.",comfyExportInvalidUrl:"ComfyUI URL must be a local HTTP address.",comfyExportInvalidImage:"This saved image cannot be sent to ComfyUI.",comfyExportImageNotFound:"Saved image file was not found.",comfyExportFailed:"Could not upload image to ComfyUI.",cancelFailed:"Could not cancel generation.",errorClass:{rateLimited:"Too many requests. Please try again shortly.",providerTimeout:"The provider timed out. Please try again shortly.",networkFailure:"Could not reach the provider. Check the network, then try again.",contentRejected:"The provider rejected this prompt. Please revise it.",capabilityUnsupported:"This request is not supported by the current provider.",modelUnavailable:"The selected model is unavailable right now.",internalState:"Internal state is inconsistent. Reload the page."}},EC={queued:"Queued",planning:"Planning",streaming:"Generating",decoding:"Finalizing",canceling:"Canceling",noPrompt:"No prompt",cancelAria:"Cancel generation: {prompt}",title:"IN FLIGHT",badgeOpen:"Show {n} generations in flight",badgeClose:"Hide {n} generations in flight",inlineCollapse:"Collapse {n} generations in flight",footerHint:"You can close this panel — generations will continue.",kindImage:"Image",kindVideo:"Video",kindNode:"Node",kindMcp:"MCP",progressAria:"Generation progress: {n}%"},RC={title:"Size",grokAspectTitle:"Aspect Ratio",grokResolutionTitle:"Resolution",width:"Width",height:"Height",hint:"16px steps, max edge 3840, ratio up to 3:1, 655K–8.29M pixels",autoLabel:"Auto",autoSub:"Model pick",customLabel:"Custom",customSub:"Free form",customPlus:"+ Custom",customSlots:"Saved sizes",customSlot:"Custom",customSlotLimit:"Up to 3 custom sizes",saveCustomSlot:"Save custom size",replaceCustomSlot:"Replace slot",ratioFree:"Free",ratio21x9:"21:9",normalizedPreview:"Will send",noAdjustment:"No adjustment",squareMaxHint:"Square maximum is {size} because of the 8.29M pixel limit.",adjustedReasons:{snap:"snapped to 16px",maxEdge:"max edge",ratio:"ratio limit",minPixels:"minimum pixels",maxPixels:"maximum pixels",min:"minimum edge",max:"maximum edge",pixels:"pixel limit"}},NC={title:"Size adjustment required",body:"The requested size is outside the image generation limits.",requested:"Requested size",adjusted:"Adjusted size",approve:"Approve and generate",cancel:"Cancel",reasonRatio:"The ratio exceeds the 3:1 limit.",reasonPixels:"The maximum pixel limit is exceeded.",reasonMinPixels:"The requested image has too few pixels.",reasonMin:"The size is below the minimum.",reasonMax:"The size is above the maximum.",reasonSnap:"The size must align to 16px increments."},kC={title:"Quality",grokTitle:"Grok quality",grokModelTitle:"Model",lowLabel:"Low",lowSub:"Fast",mediumLabel:"Medium",mediumSub:"Balanced",highLabel:"High",highSub:"Best"},_C={title:"Moderation",autoLabel:"Auto",autoSub:"Standard filter",lowLabel:"Low",lowSub:"Relaxed filter",explain:"Auto uses the standard safety filter. Low relaxes limits so borderline prompts may pass through."},MC={title:"Format"},PC={title:"Count",customPlus:"+n",customLabel:"Custom count",highCountHint:"Higher counts can take longer with references or high quality.",minMaxHint:"Use 1-24 images.",decrease:"Decrease count",increase:"Increase count"},LC={label:"Sequence",tooltip:"Generate ordered stages from one prompt",shortHint:"planned stages",maxStages:"Max stages",highCountHint:"Higher stage counts can take several minutes.",minMaxHint:"Use 1-24 stages.",composerBadge:"Sequence · up to {count}",composerAriaLabel:"Sequence prompt composer, up to {count} separate stages",promptPlaceholder:"Describe the sequence. Use Count with Sequence off for same-prompt batches.",promptPlaceholderWithRefs:"Describe the staged sequence using the attached references.",toggleDisabledGenerating:"Wait for the current generation to finish",sequenceTitle:"Sequence results",sequenceProgress:"{returned}/{requested} images",stageLabel:"Stage {index}",generating:"Generating...",partialAlt:"Partial multimode preview",partial:"Generated {returned}/{requested} images in {elapsed}s.",complete:"Generated {returned}/{requested} images in {elapsed}s.",notReturned:"Not returned",empty:"No image returned",error:"Generation failed",canceled:"Canceled",cancel:"Cancel"},OC={restoreTitle:"Restore image settings",restoreBody:"This image contains ima2 generation metadata. Apply its prompt and settings, or attach it as a reference only.",applySettings:"Apply settings",useAsReferenceOnly:"Reference only",noMetadata:"No ima2 metadata found.",invalidMetadata:"Invalid image metadata.",unsupportedFormat:"Only PNG, JPEG, and WebP metadata can be restored.",readFailed:"Could not read image metadata.",applied:"Image settings restored.",sourceXmp:"XMP",sourcePngComment:"PNG comment",imageAlt:"Dropped image preview",prompt:"Prompt",size:"Size",quality:"Quality",model:"Model",source:"Source",title:"Generation Details",asset:"asset",summary:"Generation summary",copy:"Copy",copyRaw:"Copy raw JSON",copyField:"Copy {label}",rawJson:"Raw metadata JSON",sections:{provider:"Provider & Model",settings:"Generation Settings",usage:"Usage & Timing",lineage:"Lineage",video:"Video",videoContinuity:"Video Continuity",prompts:"Prompts"},fields:{provider:"Provider",authPath:"Auth path",model:"Model",providerUrl:"Provider URL",requestId:"Request ID",quality:"Quality",size:"Size",format:"Format",moderation:"Moderation",reasoning:"Reasoning",promptMode:"Prompt mode",kind:"Kind",mediaType:"Media type",elapsed:"Elapsed",tokens:"Tokens",totalTokens:"Total tokens",inputTokens:"Input",cachedTokens:"Cached",outputTokens:"Output",reasoningTokens:"Reasoning",webSearchCalls:"Web searches",grokCostTicks:"Grok cost ticks",usage:"Usage",filename:"Filename",createdAt:"Created",sessionId:"Session",nodeId:"Node",parentNodeId:"Parent node",clientNodeId:"Client node",refsCount:"References",sequence:"Sequence",setId:"Set",cardId:"Card",videoDuration:"Duration",videoResolution:"Resolution",videoAspectRatio:"Aspect ratio",videoRequestedModel:"Requested model",videoEffectiveModel:"Effective model",videoModelFallback:"Model fallback",xaiVideoRequestId:"xAI video request",sourceImageFilename:"Source image",lineageId:"Lineage",parentFilename:"Parent file",sourceFrame:"Source frame",continuityEntries:"Entries",latestContinuityPrompt:"Latest continuity prompt",promptPrimary:"Prompt",userPrompt:"User prompt",prompt:"Stored prompt",revisedPrompt:"Revised prompt",composerPrompt:"Composer prompt",insertedPrompts:"Inserted prompts"}},jC={title:"Hello! First time here?",body:"Sign in to start generating. You can connect ChatGPT, Grok, or Gemini.",login:"Yes, sign me in",skip:"I'll set it up myself"},GC={title:"Generation readiness",open:"Check readiness",openTitle:"Check provider, auth, model, and web-search readiness",settingsTitle:"Generation readiness",settingsBody:"Open a compact popup with provider, auth, model, reasoning, and web-search state.",ready:"Ready to generate",readyBody:"The selected provider is available.",blocked:"Provider needs attention",provider:"Provider",model:"Model",reasoning:"Reasoning",webSearch:"Web search",grokApi:"Grok API",grokApiBody:"Runs through bundled progrok: mandatory search, Grok 4.5 image-and-text tool planning in English, then xAI Images API. Attached references use xAI image editing so i2i context is preserved.",openAccount:"Open account settings"},DC={button:"Generate",buttonLoading:"Generating ({n})"},FC={recentTitle:"Recent work",selectedCount:"{count} selected",selectedPresets:"Selected presets",referenceTrayCount:"{count} refs",referenceTrayAria:"{count} references are attached to the next generation",viewAll:"View all",heroTitle:"Branch the images you love.",heroLede:"Generate, edit, and animate locally across your own provider lanes. Nothing leaves the machine unless you send it.",lanesReady:"{ready} of {total} lanes ready",lanesNone:"no lane ready — open Settings",modesTitle:"Workspaces",modeCreateHint:"Generate and iterate on a single image",modeNodeHint:"Branch one result into many directions",modeAgentHint:"Describe the job and let the agent run it",modeAssetsHint:"Collect, star, and reuse what you made",untitledResult:"Untitled result",recentResultAlt:"Recent result: {prompt}",mediaUnavailable:"Preview unavailable"},zC={label:"API Status",checking:"Checking...",offline:"Offline",remaining:"${remaining} remaining",thisMonth:"${amount} this month",oauthFree:"GPT OAuth · free via codex",apiDisabled:"API key ready",apiReady:"API key ready",oauthMode:"GPT OAuth mode"},qC={openGalleryAria:"Open gallery",openGalleryTitle:"Open full gallery",openGalleryShort:"All",galleryCard:"Open gallery",recentTitle:"Recent Generations",collapseRecent:"Collapse recent generations",expandRecent:"Expand recent generations",collapseRecentShort:"Hide",expandRecentShort:"Show",emptyRecent:"Generated images will appear here.",generatingCollection:"Generating {count} images…",selectRecent:"Select generated image",deleteImageAria:"Delete image from history",deleteSequenceAria:"Delete {count}-image sequence",deleteSequenceConfirm:"Delete all {count} images in this multimode sequence?",sequenceDeleted:"Deleted {count} sequence images from history"},UC={closeSettings:"Close settings",detailSettings:"Settings",toggleShow:"Show settings",toggleHide:"Hide settings",open:"Open",close:"Close"},HC={label:"Prompt",refCount:"Refs {count}/{max}",trayAria:"Reference tray, {count} of {max}",deadTagHint:"Tag removed from the tray — shown as a reference only",deadTagStatus:"Unavailable references in the prompt: {tags}",refChipTitle:"Reference {n}",refChipAlt:"Reference {n}",refRemoveAria:"Remove reference {n}",placeholder:"Describe the image you want. Drag & drop or paste to attach reference images...",placeholderWithRefs:"Describe what to do with the attached images...",attach:"Attach",attachTitle:"Attach reference images",useCurrent:"Use current",useCurrentTitle:"Use current result as a reference",continue:"Continue",continueTitle:"Continue from current result as reference",savePrompt:"Save",storyboard:"Storyboard",storyboardTitle:"Enable storyboard mode — maintains character and scene continuity across sequential frames",videoToggleTitle:"Toggle video mode (Grok 1.5)",directMode:"Direct",directModeActive:"1:1 Direct on",directModeTitle:"Pass prompt through verbatim (Direct mode)",urlRefActive:"URL ref",urlRefActiveTitle:"Provider URL reference is active and will be used instead of attached image refs. Click to clear.",urlRefClear:"Clear provider URL reference",moveBlockUp:"Move {name} up",moveBlockDown:"Move {name} down",afterBlocks:"After main prompt",hint:"Ctrl + Enter to generate",dropHere:"Drop to attach as reference (up to {max})"},BC={modeTitle:"Canvas Mode",resultAlt:"result",imageViewerAria:"Generated image viewer. Use left and right arrow keys to move between images.",tokens:"{n} tokens",open:"Open Canvas",openAria:"Open image in canvas mode",dragToComposer:"Drag to composer as reference",dragHint:"Drag",annotationInstructionsChip:"Canvas notes",close:"Close Canvas",blank:{title:"Blank canvas",subtitle:"Sketch on white paper, then continue from it.",create:"Create blank canvas",creating:"Creating...",failed:"Could not create blank canvas"},drop:{hint:"Drop image to add to gallery"},toolbar:{label:"Canvas annotation tools",select:"Select",bgGroup:"Export background",bgAlpha:"Alpha",bgMatte:"Matte",bgMatteColor:"Matte color",cleanup:"Clean background",cleanupMark:"Mark",cleanupRemove:"Remove",cleanupPreserve:"Preserve",cleanupInput:"Input",cleanupClick:"Click",cleanupBrush:"Brush",cleanupBrushSize:"Brush",cleanupTolerance:"Tolerance",cleanupAutoSample:"Corners",cleanupPickSeed:"Pick seed",cleanupPickingSeed:"Click background",cleanupActive:"Active",cleanupPreview:"Preview",cleanupPreviewing:"Previewing...",cleanupApply:"Apply PNG",cleanupApplying:"Applying...",cleanupReset:"Reset",cleanupSeedCount:"{n} seeds",cleanupRemoved:"{n}% removed",cleanupPickHint:"Click the background on the image",cleanupBrushHint:"Paint the area to mark",cleanupMaskHint:"Purple mask will be removed",cleanupApplied:"Transparent PNG created",cleanupFailed:"Background cleanup failed",zoomGroup:"Canvas zoom",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomReset:"Reset zoom",zoomShortcutHint:"Pinch zoom · two-finger pan · [ / ] · 0",pen:"Pen",box:"Box",arrow:"Arrow",memo:"Sticky memo",eraser:"Eraser",eraserMenu:"Eraser options",objectEraser:"Object eraser",brushEraser:"Brush eraser",apply:"Save canvas version",applyDone:"Canvas version saved",applyFailed:"Could not save canvas version",export:"Export image",exporting:"Exporting...",exportFailed:"Export failed",undo:"Undo",redo:"Redo",deleteSelected:"Delete selected",editMask:"Edit boxed areas",editMaskDisabled:"Draw a box first",editMaskFailed:"Masked edit failed",editMaskUnsupported:"Masked edit is not supported by the current image provider",style:"Style",color:"Color",strokeWidth:"Stroke width",clear:"Clear all",exportFormat:"Export format",exportAs:{png:"PNG image",svg:"SVG vector",pptx:"PowerPoint slide"}},version:{saving:"Saving canvas version...",saved:"Canvas version saved",failed:"Could not save canvas version",usingAsReference:"Canvas version is ready as a reference"},revert:{action:"Revert baked notes",mixedConfirm:"This version also contains pixel edits. Reverting baked notes will discard those pixel edits. Continue?",restored:"Baked notes restored as an editable draft",completed:"Baked notes and pixel edits reverted",failed:"Could not revert baked notes"}},VC={today:"Today",yesterday:"Yesterday",thisWeek:"This week",earlier:"Earlier",imageAltFallback:"Generated image",deleteTitle:"Move to system trash",deleteAria:"Delete image",ariaLabel:"Image gallery",title:"Gallery",total:"{n} total",totalFiltered:" / {n} total",sortByAria:"Sort by",sortByDate:"Date",sortBySession:"Session",favoriteFilterAria:"Favorite filter",filterAll:"All",filterFavorites:"Favorites",searchPlaceholder:"Search prompts or filenames",searchDisabledPlaceholder:"Search is disabled in session view",closeAria:"Close gallery",closeTitle:"Close (Esc)",sessionLabel:"Session {name}",standalone:"Standalone images",emptySessions:"No sessions saved yet.",emptyAll:"No images yet. Create one first.",emptyFavorites:"No favorite images yet.",noResults:"No results.",loadOlder:"Load older",loadingOlder:"Loading older...",loadOlderFavorites:"Load older favorites",loadingOlderFavorites:"Loading older favorites...",sessionPaginationHint:"Session view uses the current page. Switch to Date view to load older images.",sessionLoading:"Loading session groups...",sessionLoadFailed:"Could not load session groups.",sessionLimitNotice:"Showing the newest {count} items. Older items are not included in session view.",retry:"Retry",loadOlderFailed:"Could not load older gallery items.",storageNoticeTitle:"Storage notice",storageNoticeRecoverable:"Sorry for the scare. Recent versions moved the gallery folder from the installed package to your user data folder. Your old images may still be in the previous generated folder. Run ima2 doctor or open the recovery guide.",storageNoticeNotFound:"Sorry for the scare. We could not find a previous generated folder on this machine. If the old global install folder was replaced during update, automatic recovery may not be possible. Run ima2 doctor and check the recovery guide for manual search steps.",storageNoticeUnknown:"Storage status could not be checked. If the gallery looks empty after an update, run ima2 doctor to inspect the image folder.",openGeneratedDir:"Open folder",openGeneratedDirTitle:"Open generated image folder",cardNewsSet:"Card News set",cardNewsCard:"Card News card",openCardNewsSet:"Open set",openCardNewsSetFailed:"Could not open the Card News set.",copyCardNewsSetPath:"Copy path",cardNewsPathCopied:"Card News set path copied.",downloadCardNewsManifest:"Manifest",cardNewsCount:"{n} cards",deleted:"Deleted: {filename}",undo:"Undo",secondsSuffix:"{n}s",permanentDeleted:"Permanently deleted: {filename}",movedToSystemTrash:"Moved to system trash: {filename}",deleteFailed:"Could not delete image.",restoreFailed:"Could not restore image.",favoriteTitle:"Add to favorites",unfavoriteTitle:"Remove from favorites",favoriteAria:"Add to favorites",unfavoriteAria:"Remove from favorites",favoriteFailed:"Could not update favorite",scopeAria:"Gallery scope",scope:{current:"Current session",all:"All images"},empty:{currentSession:"No images in this session yet."}},KC={empty:"Empty",elementMissing:'Element "{name}" was deleted. Reconnect it before running.',pending:"Generating",reconciling:"Syncing",reconcilingPhase:"Syncing · {phase}",ready:"Done · {elapsed}s",readyWithSearch:"Done · {elapsed}s · searched {searches}",stale:"Stale",staleWithError:"Stale: {error}",assetMissing:"Asset missing",assetMissingWithError:"Asset missing: {error}",error:"Error: {error}",errorUnknown:"unknown",nodeImageAlt:"Node image",partialImageAlt:"Partial node image preview",noAsset:"No asset",stateStale:"State stale",noImage:"No image",editPromptPlaceholder:"Edit prompt...",promptPlaceholder:"Prompt...",regenerate:"Regen",newVariation:"New variant",generate:"Gen",generateTitle:"Generate node image",addChild:"Child",addChildTitle:"Add child node",duplicateBranch:"Branch",duplicateBranchTitle:"Duplicate as a new branch root",deleteTitle:"Delete",regenerateTitle:"Regenerate this node in place",newVariationTitle:"Create a new sibling variant under the same parent",parentImageRequired:"Generate the parent image first.",attachRef:"Attach",attachRefTitle:"Attach node reference images",refAlt:"Node reference {n}",removeRef:"Remove reference {n}",dropRefs:"Drop images here",nodeRefsUnsupportedForEdit:"Extra references are only supported on root nodes for now.",nodeRefsUsedWithParent:"Used together with the parent image.",classicRefsParkedTitle:"Classic references are parked",classicRefsParkedBody:"These images belong to the classic composer and are inactive in node mode.",clearParkedRefs:"Clear parked references",retry:"Retry",retryTitle:"Retry this node's generation",errorAuthCta:"Check your account or API key, then generate again.",errorFixCta:"Adjust the prompt or references, then generate again."},$C={selectionOn:"Selecting",selectionOff:"Select",selectAll:"Select all",summary:"{selected} selected · {missing} missing · {stale} affected",generateMissing:"Generate missing",regenerateSelected:"Regenerate selected",stopRemaining:"Stop remaining",stopping:"Stopping",clear:"Clear",noneSelected:"No nodes selected.",parentRequired:"{count} selected node(s) need a ready parent image first.",nothingToRun:"No selected nodes need generation.",stopQueued:"The current node will finish, then the remaining queue will stop.",failed:"Stopped after {done}/{total} node(s).",finished:"Finished {done}/{total} node(s).",staleBecauseParentChanged:"An upstream node was regenerated; refresh this node when needed.",cycleBlocked:"Cannot run: {count} selected node(s) form a loop.",partialFinished:"Finished {done}/{total} — {failed} failed, {skipped} skipped."},YC={disconnect:"Disconnect",disconnectTitle:"Disconnect selected edge",disconnected:"Connection removed.",parentConflict:"A node can only have one parent connection.",cycleBlocked:"That connection would create a loop."},XC={authTitle:"Provider",apiLabel:"API Key",statusReady:"Ready",statusConnected:"Connected",statusAuthRequired:"Sign-in required",statusDisconnected:"Disconnected",statusLineTitle:"Status",authMethodTitle:"Auth",authActive:"Active",oauthNotReady:"GPT OAuth proxy is not ready yet.",codexLoginRequired:"Codex login required.",codexLoginHint:"Run `codex login` in your terminal, then refresh this page.",oauthStarting:"GPT OAuth proxy is starting. Try again in a few seconds.",serverUnreachable:"Cannot reach the server. Make sure the backend is running.",apiInvalid:"API key is missing or invalid. Check OPENAI_API_KEY in the server's .env.",grokOffline:"Grok proxy is not running.",grokNoImageModel:"No Grok image generation model found.",grokNotReady:"Grok is not available.",grokOfflineHint:"Run `ima2 grok login` once if needed, then start `ima2 serve`; ima2 starts the bundled Grok proxy automatically.",grokManagedByIma2:"Grok runs locally inside `ima2 serve` through the bundled progrok proxy at 127.0.0.1:18645.",grokClassicOnly:"Grok image generation is not available in this surface.",grokClassicOnlyHint:"Use a generation surface with Grok enabled.",grokCompatTitle:"Grok image API",grokCompatBody:"ima2 serve manages the bundled progrok proxy at 127.0.0.1:18645. Grok always searches before image generation, sends attached references into the Grok 4.5 planner, keeps them through xAI image editing, and maps size to xAI aspect ratio/resolution. Output format, moderation, and reasoning are OpenAI-provider settings only.",settingsBody:"Choose which provider future generation requests use.",availableTitle:"{name} available",availableAria:"{name}: available",unavailableAria:"{name}: unavailable",availableSr:"(available)",unavailableSr:"(unavailable)",xaiApiKeyRequired:"xAI API key required",geminiApiKeyRequired:"Gemini API key required",atlasCloudApiKeyRequired:"Atlas Cloud API key required",minimaxApiKeyRequired:"MiniMax API key required",comingSoon:"Coming soon",agyCompatTitle:"Gemini (agy)",agyCompatBody:"1024x1024 fixed, JPEG output, max 3 refs. No quality/size control.",agyCompatBodyLong:"1024x1024 fixed output, JPEG format, max 3 reference images. No web search, no quality/size control.",geminiApiCompatTitle:"Gemini API",geminiApiCompatBody:"Google Gemini API. Supports aspect ratio and resolution control from 512px to 4K.",geminiApiCompatBodyLong:"Google Gemini API direct. Supports nano-banana-2 (Flash) and nano-banana-pro (Pro), with aspect ratio and resolution control from 512px to 4K.",gptCompatTitle:"GPT Image",gptCompatBody:"OpenAI image generation via Responses API. Supports quality, size, format, moderation, and web search settings."},QC={connectionsTitle:"MCP provider connections",connectionsBody:"Connect official provider accounts and review tool status. Only connected providers appear in the generation selector.",providerLabel:"Generation provider",modelLabel:"Generation model",coreProviders:"Core providers",connectedProviders:"Connected MCP providers",imageModels:"Image models",videoModels:"Video models",chooseModel:"Choose a model",loadingModels:"Loading models",loadingProviders:"Checking connections",providersLoadFailed:"Could not load MCP provider status.",modelsLoadFailed:"Models failed to load — tap to retry",retryModels:"Retry",noModels:"No models are available for this mode.",refreshingConnection:"Refreshing…",exitLane:"Use core providers",modelSectionTitle:"Model",ratioAutoHelp:"Auto lets the model pick its own aspect ratio. Presets may be rejected by some models.",aspectRatioLabel:"Aspect ratio",durationLabel:"Duration",resolutionLabel:"Resolution",qualityLabel:"Quality",modeLabel:"Mode",audioLabel:"Audio",onLabel:"On",offLabel:"Off",toolInputsLabel:"Reference media",referenceNone:"None",referenceSelect:"Choose from gallery",referenceCurrent:"Current gallery item",referenceMissing:"Not in loaded history",startFrameLabel:"Start frame",endFrameLabel:"End frame",endFrameNeedsStart:"Choose a start frame first.",imageReferencesLabel:"Image references (up to 3)",imageReferenceAria:"Image reference {index}",referenceTagAria:"Tag for image reference {index}",referenceTagPlaceholder:"Optional tag",referenceTagInvalid:"Use 1–32 letters, numbers, underscores, or hyphens for the tag.",referenceAttachLocal:"Attach local image",referenceAttachHelp:"Local images are uploaded temporarily and removed after generation settles.",referenceLocalFallback:"Local image",referenceLocalInvalidType:"Choose a PNG, JPEG, or WebP image.",referenceLocalReadFailed:"Could not read this image. Choose it again.",referenceSource:{asset:"Asset",element:"Element",local:"Local attachment"},videoReferenceLabel:"Video reference",videoReferenceCostNote:"Using a video reference may add provider charges.",advancedPresetsLabel:"Advanced presets",providerDefaultsHelp:"This model uses provider defaults without additional presets.",chooseModelForPresets:"Choose a model in the top selector to see its supported presets.",refreshList:"Refresh status",connect:"Connect",connecting:"Connecting",connectOpensBrowser:"Opens provider sign-in in a browser window.",refreshConnection:"Reconnect",disconnect:"Disconnect",connectionActionFailed:"The connection action could not be completed. Try again shortly.",popupBlocked:"The sign-in window was blocked. Allow popups, then connect again.",locked:"Locked",unavailable:"Unavailable",unknownProvider:"Connection information for {provider} is unavailable.",disconnectedSelection:"The saved provider is disconnected. Reconnect it in Settings.",disabledProvider:"This provider is disabled in the current server configuration.",selectionUnavailable:"The selected MCP provider is unavailable. Check its connection in Settings.",higgsfieldLocked:"Generation is locked for this provider.",toolCount:"{count} tools",toolCountUnknown:"Tool count unknown",snapshotChanges:"{count} schema changes",billingLabel:"Billing",billingSubscription:"Subscription credits",billingApi:"API usage billing",billingUnknown:"Unknown",generateFailed:"Could not start MCP generation.",errorUnsupportedInput:"This model does not support one of the selected reference types. Choose a compatible model or remove it.",errorEndRequiresStart:"Choose a start frame before adding an end frame.",errorInvalidReferences:"One or more reference images are no longer available. Choose them again.",errorInvalidFrame:"The selected frame or video is no longer available. Choose it again.",errorTempReferences:"Could not prepare the local reference image. Choose it again.",status:{disconnected:"Disconnected",connecting:"Connecting",auth_required:"Sign-in required",connected:"Connected",offline:"Offline",error:"Error"},characterSlotLabel:"Character",characterSlotNone:"No character binding",characterSlotConflictHint:"Remove @element mentions to use a character binding — they cannot be combined."},JC={image:"Image",video:"Video"},WC={free:"free",approx:"~${amount}",multimodeApprox:"up to ~${amount} ({count})",label:"Est. cost"},ZC={download:"Download",copyImage:"Copy image",copyLastFrame:`Last
|
|
15
15
|
Frame`,copyFirstFrame:`First
|
|
16
16
|
Frame`,copyMidFrame:`Mid
|
|
17
|
-
Frame`,copyPrompt:"Copy prompt",continueHere:"Continue here",continueHereTitle:"Import this image's prompt and keep working",continueAsUrl:"URL continue",continueAsUrlTitle:"Continue using the original provider URL (expires in 1 hour)",animate:"Animate",animating:"Animating…",animateTitle:"Generate a Grok video from this image (image-to-video)",firstNode:"First node",firstNodeTitle:"Send this image to Node Mode as a ready first node",info:"Info",infoTitle:"Show generation details and provenance",delete:"Delete",deleteTitle:"Move to trash",more:"More",sendToComfyUI:"Send to ComfyUI",sendToComfyUITitle:"Upload this saved image to local ComfyUI",permanentDelete:"Permanently delete",permanentDeleteConfirm:'Permanently delete "{filename}"? This cannot be undone.',upscale:"Upscale",upscaleTitle:"Upscale through Runway (MCP)",upscaleFlavor:"Flavor",upscaleFlavorAuto:"auto",upscaleStart:"Start upscale",upscaleStarted:"Upscale started",upscaleFailed:"Upscale failed",upscaleInvalid:"Invalid upscale parameters"},ew={switchTitle:"Switch session",loading:"Loading...",newSession:"New session",newSessionTitle:"New session",renameTitle:"Rename",renamePrompt:"Session name",deleteTitle:"Delete",deleteConfirm:'Delete session "{title}"? This cannot be undone.',empty:"No sessions yet",firstGraph:"My first graph",untitled:"Untitled session",assetAbortedError:"Generation did not finish cleanly. Retry from this node."},tw={ariaLabel:"UI mode",classic:"Classic",node:"Node",cardNews:"Card News",agent:"Agent"},nw={workspace:"Agent workspace",workspaceActionFailed:"Action failed: {reason}",bootFailed:"Agent workspace could not be loaded",bootRetry:"Retry",topbarBackToStudio:"Back to Studio",topbarStudio:"Studio",topbarOpenQueue:"Open queue, {count} active jobs",topbarCloseQueue:"Close queue",topbarQueueSheet:"Generation queue",title:"Agent",newSession:"New Agent",sessions:"Sessions",openSessions:"Open sessions",closeSessions:"Close sessions",sessionsUseRail:"Pin sessions as a compact rail",sessionsUseExpanded:"Pin the expanded sessions list",sessionSearch:"Search sessions",renameSession:"Rename session",deleteSession:"Delete session",deleteConfirm:'Delete "{title}"?',imageCount:"{count} images",compacted:"Compacted",web:"Web",chat:"Chat",user:"User",assistant:"Agent",tool:"Tool",toolExpand:"Show tool details",toolCollapse:"Hide tool details",toolImageCount:"{count} img",toolCallCount:"{count} calls",toolGroup:"Tool run",toolInput:"Input",toolOutput:"Output",toolsShowMore:"More",toolsShowLess:"Less",toolArtifacts:"Artifacts",requestId:"Request ID",duration:"Duration",toolStatus:{queued:"Queued",running:"Running",complete:"Complete",error:"Error"},rightSidebar:"Agent side tools",sidebarTabs:{image:"Image",library:"Library",forms:"Forms",quality:"Quality",model:"Model",queue:"Queue"},modelSettings:"Model settings",closeModelSettings:"Close model settings",openModelSettings:"Open model settings",modelTabView:"View in Model tab",model:"Model",provider:"Provider",reasoningEffort:"Reasoning",generationStrategy:"Generation plan",generationStrategyAuto:"Based on user request",generationStrategyManual:"Fixed count",quality:"Quality",size:"Size",format:"Format",moderation:"Moderation",variantsCount:"Variants",maxAutoVariants:"Auto max",parallelism:"Parallelism",promptLibrary:"Prompt library",forms:"Forms",noForms:"No form templates",insertPrompt:"Insert",queue:"Queue",runningShort:"run",queuedShort:"wait",queueEmpty:"No queued Agent work.",cancelQueue:"Cancel",retryQueue:"Retry",sessionRunning:"Generation running",sessionQueued:"{count} queued",sessionError:"Generation error",queueStatus:{queued:"Queued",running:"Running",succeeded:"Done",failed:"Failed",canceled:"Canceled"},statusReady:"Ready",statusGenerating:"Generating",statusReconnecting:"Reconnecting",pending:"Generating response...",pendingQueued:"Waiting in queue...",pendingPlanning:"Planning the response...",pendingGenerating:"Running tools and generating...",runError:"Run failed",errorRole:"Error",composerPlaceholder:"Ask anything or describe what to create",slashCommands:"Agent slash commands",slashDesc_question:"Ask a question without generating images",slashDesc_variants:"Generate N image variants (1-24)",slashDesc_generate:"Bounded fanout generation (1-24)",slashDesc_parallelism:"Limit concurrent tool calls",slashDesc_help:"Show available commands",attachReference:"Attach reference",send:"Send",webSearch:"Use search",emptyChat:"Enter a message to start image or video work.",emptyJumpLatest:"Jump to latest",queueSummary:"{active} active · {failed} failed",queuePlanSummary:"variants {variants} · parallel {parallel}",queueDetails:"Technical details",queueAnnouncement:"Queue updated: {running} running, {queued} queued, {failed} failed",queueTimeAgo:"{value} {unit} ago",queueTimeUnit:{second:"sec",minute:"min",hour:"hr"},progressQueued:"Waiting in queue",progressPlanning:"Preparing request",progressGenerating:"Generating",progressDownloading:"Downloading result",progressFailed:"Run failed",progressJob:"{kind} · {count} variants",mediaKind:{image:"Image",video:"Video"},mediaSelect:"Focus media",mediaLoading:"Loading video",mediaLoadFailed:"Video could not be loaded.",mediaRetry:"Retry",mediaVideoLabel:"Generated video",mediaDuration:"Duration {duration}",mediaDurationUnknown:"Duration unavailable",mediaDownload:"Download",imagePane:"Image",currentImage:"Current image",openImage:"Open image",closeImage:"Close image",selectImage:"Focus image",variants:"Variants",contextTabs:"Image context",imageTab:"Image",refsTab:"Refs",webTab:"Web",memoryTab:"Memory",noImage:"No current image",noRefs:"No references",noWeb:"No web evidence",memoryItemStyle:"Style locks are retained in image context.",memoryItemSubject:"Subject locks are restored after resume.",imageAlt:"Agent image",filename:"File",prompt:"Prompt",stageEmptyHint:"Send your first request to see the image here",openTools:"Open tools panel",closeTools:"Close tools panel"},aw={workspace:"Card News workspace",composer:"Card News",composerHint:"Templates are visual snapshots; output size is set separately.",topic:"Topic",topicPlaceholder:"e.g. Exam comeback plan",audience:"Audience",audiencePlaceholder:"e.g. Parents",goal:"Goal",goalPlaceholder:"e.g. Book a consultation",brief:"Brief",briefPlaceholder:"Describe the card news content, required points, and exclusions.",outputSize:"Output size",customSize:"Custom",draft:"Draft outline",drafting:"Drafting...",generateSet:"Generate set",batchGenerate:"Batch generate",generating:"Generating...",generated:"Generated {count} cards.",missingGeneratedCard:"The generation response did not include this card.",error:"Card generation failed.",imageTemplate:"Image template",roleTemplate:"Card structure",newTemplateLater:"Custom templates are planned after the dev MVP",emptyTitle:"Waiting for a draft",emptyBody:"Use the left setup panel to prepare the card deck.",inspector:"Card inspector",cardTitle:"Card title",headline:"Headline",body:"Body",visualPrompt:"Image prompt",summaryCopy:"Summary copy",designPrompt:"Scene / design prompt",textFields:"Text boxes",addTextField:"Add text box",removeTextField:"Remove",noTextFields:"No text boxes yet.",textFieldText:"Text",textKind:"Kind",placement:"Placement",renderMode:"Render mode",hierarchyLabel:"Hierarchy",textTooLong:"Text exceeds the suggested length.",selectTextField:"Select text box: {text}",textKinds:{headline:"Headline",body:"Supporting text",caption:"Caption",cta:"CTA",badge:"Badge",number:"Number"},renderModes:{"in-image":"In image","ui-only":"UI only"},hierarchy:{primary:"Primary",secondary:"Secondary",supporting:"Supporting"},placements:{"top-left":"Top-left","top-center":"Top-center","top-right":"Top-right","center-left":"Center-left",center:"Center","center-right":"Center-right","bottom-left":"Bottom-left","bottom-center":"Bottom-center","bottom-right":"Bottom-right",free:"Free"},roles:{cover:"Cover",hook:"Hook",problem:"Problem",insight:"Insight",example:"Example",data:"Data",summary:"Summary",cta:"CTA"},locked:"Locked",unlocked:"Unlocked",noCard:"No card selected",generatedMeta:"Generated metadata",lockedHelp:"Locked cards are excluded from batch generation and retry.",retryCard:"Retry this card",actions:{copyPrompt:"Copy prompt",copyCopy:"Copy copy",openImage:"Open image",downloadCard:"Download"},status:{draft:"Draft",queued:"Queued",generating:"Generating",generated:"Done",error:"Error",skipped:"Skipped",locked:"Locked"},progress:{generating:"Generating {done}/{total}",summary:"Done {done}/{total}",detail:"{queued} queued · {errors} errors · {skipped} skipped",cardGenerating:"Generating this card."},planner:{structured:"Structured JSON",jsonMode:"JSON mode",repaired:"Repaired",fallback:"Fallback draft",jsonOnlyHelp:"Draft creates JSON only. Images are generated later.",error:"Draft failed"}},ow={selectedCameraPresets:"Selected camera motion presets",plannerModelTitle:"Planner Model",reasoningEffortTitle:"Reasoning Effort",modeLabel:"Video mode",mode:{"text-to-video":"Text → video (no reference images)","image-to-video":"Image → video (1 reference)","reference-to-video":"Reference → video ({n} references)"},seriesTopicTitle:"Series topic",seriesTopicPlaceholder:"e.g. Korean travel vlog",durationTitle:"Length",resolutionTitle:"Resolution",resolution1080Help:"1080p uses Grok V1.5 for prompt-only or single image/frame video. It is not available with 2+ references.",aspectTitle:"Aspect ratio",plannerUpdateFailed:"Could not update the planner model. The previous setting was restored.",continuationFallbackT2V:"The continuation frame could not be extracted. Generation will continue as text-to-video."},rw={appName:"Image Generator",imageModelLabel:"Model",imageSectionLabel:"Image",gptImageSubLabel:"GPT-IMAGE-2",grokImageSubLabel:"Grok Imagine",geminiImageSubLabel:"Gemini",videoSectionLabel:"Video",imageModelAria:"Choose image model",quickSettingsAria:"Choose model and reasoning effort. Current model {model}, reasoning {effort}",quickSettingsModelOnlyAria:"Choose image model. Current model {model}",quickSettingsMenu:"Model and reasoning quick settings",reasoningLabel:"Reasoning",videoModelLabel:"Video",nodeModeHint:"In node mode, click a node to edit its prompt and generate. Settings on the right panel (quality/size) apply to every new result."},iw={openAria:"Open settings",openTitle:"Settings",closeAria:"Close settings",closeTitle:"Return to canvas",navAria:"Settings sections",contentAria:"Settings content",jumpTo:"Jump to {section}",title:"Settings",sections:{providers:{title:"Providers",hint:"Accounts, keys, models"},workspace:{title:"Workspace",hint:"Profile, layout, gallery"},general:{title:"General",hint:"Language"}},account:{primaryEyebrow:"Active provider",oauthTitle:"GPT OAuth",oauthBody:"GPT OAuth generation runs through your Codex OAuth session. You can switch to API-key mode when a valid key is configured.",apiSourceEnv:"OPENAI_API_KEY detected",apiSourceConfig:"config.json API key detected",apiTitle:"OpenAI API key",apiBody:"ima2-gen can use this API key for generation, edit, multimode, and node requests through the Responses API.",apiDisabled:"Unavailable",apiReady:"Ready",apiUnavailable:"Unavailable",apiUnknown:"Status unknown",grokEyebrow:"Local xAI proxy",grokTitle:"Grok",grokBody:"Uses progrok at the configured local port for xAI Images API generation.",agyEyebrow:"Antigravity CLI",agyTitle:"Gemini (agy)",agyInstalledBody:"Login status can't be detected. Run `agy login` in your terminal if generation fails.",agyMissingBody:"Not installed. Get the",agyMissingLink:"Antigravity CLI",agyFineprint:"Antigravity models and image quota are billed separately.",agyInstalled:"Installed",agyMissing:"Not installed",status:{ready:"Ready",authRequired:"Login required",starting:"Starting",offline:"Offline",noImageModel:"No image model",error:"Error",checking:"Checking"}},quota:{codexNotLoggedIn:"Not logged in",fetchError:"Could not load quota",noData:"No usage data",grokUsageLink:"View Grok usage →",switchAccount:"Switch {provider} account",startingLogin:"Starting login…",enterCode:"Enter this code in the opened tab:",retry:"Retry",copyLink:"Copy link",copied:"Copied",waitingApproval:"Waiting for approval…",switchComplete:"Account switched. Refreshing…",switchFailed:"Account switch failed",tryAgain:"Try again"},imageModel:{title:"Image model",body:"Choose the image model used for future generations. Selecting a Grok model switches the provider to Grok.",gpt54Mini:"GPT-5.4 Mini",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt56Sol:"GPT-5.6 Sol",gpt56Terra:"GPT-5.6 Terra",gpt56Luna:"GPT-5.6 Luna",grokImagine20:"Grok Imagine Image 2.0",grokImagine:"Grok Imagine",grokImagineQuality:"Grok Imagine Quality",nanoBanana2:"Nano Banana 2",nanoBanana2Api:"Nano Banana 2",nanoBananaPro:"Nano Banana Pro",atlasCloudGptImage2:"Atlas Cloud GPT Image 2",atlasCloudGptImage2Edit:"Atlas Cloud GPT Image 2 Edit",minimaxImage01:"MiniMax image-01",minimaxImage01Live:"MiniMax image-01-live",agy:"Antigravity (agy)",gpt53CodexSpark:"GPT-5.3 Codex Spark — unsupported for images",unsupportedHelp:"Grok models use xAI's Images API through the bundled local proxy. GPT models use OpenAI Responses image generation."},apiKeys:{accordionTitle:"API Keys",envSource:"Loaded from environment",configSource:"Loaded from config",openai:{label:"GPT API Key (OpenAI)",placeholder:"Paste your OpenAI API key (sk-...)"},xai:{label:"Grok API Key (xAI)",placeholder:"Paste your xAI API key (xai-...)"},gemini:{label:"Gemini (Google)",placeholder:"Paste your Gemini API key (AI...)"},atlascloud:{label:"Atlas Cloud",placeholder:"Paste your Atlas Cloud API key (apikey-...)"},minimax:{label:"MiniMax",placeholder:"Paste your MiniMax API key"},vertex:{label:"Vertex AI (Service Account)",placeholder:'Paste your Google Cloud service account JSON { "type": "service_account", ... }',authModeApiKey:"API Key",authModeVertex:"Vertex JSON"},save:"Save",saved:"Saved",saving:"Validating...",remove:"Remove",saveFailed:"Could not save the key",networkError:"Network error. Try again.",removeFailed:"Could not remove the key",configuredReplace:"configured — click to replace",status:{valid:"Valid",notConfigured:"Not configured"}},videoModel:{grokImagine:"Grok Imagine Video",grokImagine15:"Grok Imagine Video 1.5"},reasoning:{title:"Reasoning effort",body:"Higher effort spends more reasoning tokens on planning, web search, and prompt enrichment before generating.",none:"Off — no extra reasoning",low:"Low — fastest, minimal reasoning",medium:"Medium — balanced default",high:"High — deeper research and synthesis",xhigh:"Xhigh — extended reasoning, slower",max:"Max — maximum reasoning, slowest"},webSearch:{title:"Web search",body:"Use live search before generation for real people, brands, products, places, and recent events.",on:"Search on",off:"Search off"},grokCompatibility:{title:"Grok compatibility",body:"Grok image generation first runs mandatory web search, then sends text and attached images to a local image-tool planner that writes the final image prompt in English. Attached references route through xAI image editing; size is mapped to aspect ratio/resolution. Output format, moderation, and reasoning are only used by GPT OAuth and API key providers."},grokPlanner:{title:"Grok planner model",body:"The model used for search and image/video prompt planning. Grok 4.5 is the default and supports image input for I2V/Ref2V planning; Grok 4.3 remains available as a compatibility override."},gallery:{defaultScopeTitle:"Default gallery view",defaultScopeBody:"Choose what the gallery shows when you open it."},appearance:{historyStripLayoutTitle:"History thumbnails",historyStripLayoutBody:"Choose how the compact history strip sits beside the workspace.",historyStripLayout:{rail:"Rail",horizontal:"Top row",sidebar:"Sidebar"}},language:{title:"Language",body:"Switch the UI language without changing generated content."}},lw={loading:"Loading session...",addFirst:"+ Add first node",addRootTitle:"Add root node",hint:"Drag a handle into empty space to branch. Press Delete or Backspace to remove."},sw={title:"{provider} unavailable",ariaLabel:"{provider} unavailable"},cw={label:"Language",ko:"한국어",en:"English","zh-Hant":"正體中文","zh-Hans":"简体中文"},dw={close:"Close",details:"Show raw error details",unknown:{title:"An unexpected error occurred",body:"Please try again shortly. If it persists, copy the raw error message below and report it."},moderationRefused:{title:"Prompt blocked by moderation",body:"Soften the wording or rephrase. Sensitive/violent content in reference images can also trigger this.",cta:"Edit prompt",bodyInput:"Your prompt text was caught by the input filter. Try rephrasing or using different wording.",bodyOutput:"The generated image was caught by the output filter. Try changing the style or quality settings."},emptyResponse:{title:"No image was returned",body:"Codex responded but didn't include image data. This isn't a moderation block — it's likely a transient hiccup or an unsupported size/quality/model combination. Retry, or try a different size or model.",cta:"Retry"},streamParseFailed:{title:"Could not parse the image response stream",body:"Response data arrived, but the app could not read the image stream cleanly. This can happen with a proxy or transient stream transport issue.",cta:"Retry"},imageToolNotCalled:{title:"The image tool was not called",body:"The response completed, but no image-generation tool call was observed. Retry the same prompt, or try another model/search setting.",cta:"Retry"},webSearchOnlyResponse:{title:"The image tool was not called",body:"Only web search ran; the image-generation tool did not. Turn off search or retry the request.",cta:"Retry"},imageToolFailed:{title:"The image tool call failed",body:"The image-generation tool was called, but it ended in a failed state. If this repeats, report it with `ima2 doctor image-probe --json` output.",cta:"Retry"},imageToolNoResult:{title:"The image result was empty",body:"The image tool call completed but did not include image data. This can point to an unsupported option combination or account capability issue.",cta:"Retry"},oauthImageCapabilityUnavailable:{title:"This account may not have image-tool access",body:"GPT OAuth is connected, but this account/model combination may not be entitled to use image generation. Compare with API-key mode or another model.",cta:"OK"},responsesStreamError:{title:"The image response stream ended with an error",body:"OpenAI returned an error event inside the response stream. Retry shortly, and check the raw error details if it persists.",cta:"Retry"},upstream5xx:{title:"OpenAI is currently busy",body:"Retrying usually resolves this. Check status.openai.com if it persists.",cta:"Retry"},authChatgptExpired:{title:"Codex ChatGPT session expired",body:"Run `ima2 setup` in your terminal (option 1), then reload this app.",cta:"Reload"},authApiKeyInvalid:{title:"API key authentication failed",body:"The key is missing, invalid, revoked, out of quota, or tied to the wrong org. Switch to GPT OAuth or update the configured API key.",cta:"OK"},networkFailed:{title:"Network connection failed",body:"Could not reach OpenAI or the local runtime service. Reload first; if it persists, check VPN/firewall and the port shown by `ima2 doctor`.",cta:"Reload"},oauthUnavailable:{title:"GPT OAuth proxy unavailable",body:"The GPT OAuth proxy is starting, unavailable, or moved to a fallback port. Reload first; if it persists, run `ima2 doctor` and check the reported GPT OAuth URL.",cta:"Reload"},invalidRequest:{title:"Image request needs changes",body:"One or more generation parameters are invalid. Check the raw error details below, then edit the prompt or size and try again.",cta:"Edit input"},apikeyDisabled:{title:"API-key mode is unavailable",body:"This build supports API-key generation, but the current request could not use a configured key. Switch to GPT OAuth or update the API key.",cta:"OK"},agyGenerationFailed:{title:"Gemini generation failed",body:"The Antigravity CLI returned an error. Check that the agy binary is installed and your Gemini account is active.",cta:"Retry"},agyTimeout:{title:"Gemini generation timed out",body:"The agy process did not respond within the timeout window (360s). Try again or check the agy CLI status.",cta:"Retry"},agyProcessError:{title:"Gemini process error",body:"The agy CLI exited with an unexpected error. Verify the binary is working with 'agy --version'.",cta:"Retry"},agyQuotaExhausted:{title:"Gemini quota exhausted",body:"You have exhausted your Gemini image generation capacity. Your quota will reset automatically — check the reset timer in the error details.",cta:"OK"},authClass:{title:"Sign-in required",body:"Provider authentication expired or the key was rejected. Sign in again from Settings.",cta:"Sign in again"},billingRequired:{title:"Billing required",body:"This provider account has no remaining credit. Check the provider console, then try again."}},uw={title:"Prompt Library",saveTitle:"Save to Prompt Library",save:"Save",saved:"Prompt saved",saveFailed:"Save failed",name:"Name",tags:"Tags",search:"Search prompts...",favorites:"Favorites",load:"Load",insert:"Insert",inserted:"Prompt inserted",removeInserted:"Remove inserted prompt {name}",favorite:"Favorite",unfavorite:"Unfavorite",empty:"No saved prompts yet.",content:"Content",copy:"Copy",untitled:"Untitled",addNew:"Add new prompt",import:"Import",importFiles:"Import .txt, .md, .markdown, or GitHub files",dropImport:"Drop .txt, .md, or .markdown files to import prompts",importTitle:"Import prompts",importDropTitle:"Drag files here",importDropHint:"Preview .txt, .md, and .markdown files before saving",importChooseFiles:"Choose files",importGithubLabel:"GitHub file URL or path",importPreview:"Preview",importPreviewEmpty:"Drop files or enter a GitHub path to preview candidates.",importCommit:"Save selected",importSelected:"Import selected ({count})",importThisPrompt:"Import this prompt",previewPrompt:"Preview",selectPrompt:"Select",selectedPrompt:"Selected",selectedCount:"{count} selected",selectAllCandidates:"Select all",clearCandidateSelection:"Clear",addAnotherSource:"Add another source",searchResultsHeader:"Search results ({count})",searchResults:"Search results",promptText:"Prompt text",importSelectAtLeastOne:"Select at least one prompt to save.",imported:"Imported {count} prompt(s)",importFailed:"Import failed",importNoValidFiles:"No .txt, .md, or .markdown prompt files found.",curatedSources:"Curated sources",curatedSourcesHint:"Search indexed public prompt sources",curatedSearch:"Search",curatedSearchPlaceholder:"nano banana, gpt-image-2, typography...",refreshSource:"Refresh",curatedRefreshed:"Indexed {count} prompt candidate(s)",sourceTrustTier:"Source trust",requiresAttribution:"Attribution required",sourceDetails:"Source",license:"License",attributionRequired:"Attribution required",modelHints:"Model hints",taskHints:"Task hints",warnings:"Warnings",compatibilityWarnings:"Compatibility warnings",transparentUnsupportedGptImage2:"Transparent background is not supported by gpt-image-2",noCuratedResults:"No curated prompt candidates found.",discovery:"Discovery",discoverySearch:"Search GitHub",discoverySearchPlaceholder:"Search prompt repositories...",discoveryCandidates:"Discovery candidates",discoveryApprove:"Approve",discoveryReject:"Reject",discoveryApproved:"Approved",discoveryRejected:"Rejected",discoveryScore:"Score",discoveryWarnings:"Discovery warnings",discoveryRateLimited:"GitHub discovery is rate limited.",discoveryNoResults:"No discovery candidates found.",discoveryReviewQueue:"Review queue",discoveryRequiresPaths:"Add reviewed file paths before default search.",folderBrowse:"Browse folder",folderBrowseHint:"Loads supported files from a GitHub folder",folderFiles:"Folder files",folderFilesEmpty:"No importable .md, .markdown, or .txt files found.",folderPreviewSelected:"Preview selected files",folderSelectedCount:"{count} selected",folderWarnings:"Folder warnings",folderTooManyFiles:"Too many files; showing a limited set.",folderNoSelection:"Select files to preview.",folderUnsupported:"Only GitHub folders are supported."},mw={title:"Prompt Builder",subtitle:"Refine prompts through multi-turn context.",scopeDraft:"New work",scopeImage:"Selected image: {name}",scopeImageFallback:"Current image",newWorkTitle:"Start a new work without image context",model:"Builder model",empty:"Describe the direction you want. I will include your current prompt and settings as context.",user:"You",assistant:"Builder",placeholder:"What kind of image should we make?",send:"Send",sending:"Writing",thinking:"Refining the prompt...",clear:"Clear",applyToPrompt:"Apply to prompt",insertAsBlock:"Insert block",finalKoreanPrompt:"Korean prompt",finalEnglishPrompt:"English prompt",blockName:"Builder suggestion",applied:"Builder suggestion applied to the main prompt",inserted:"Builder suggestion inserted as a prompt block",failed:"Prompt builder request failed",removeScopeImage:"Remove selected image from builder context",removeAttachment:"Remove attachment {name}",attach:"Attach file",attachmentOnlyMessage:"Use the attached file as context and help with the prompt"},pw={sectionTitle:"Workspace",sectionBody:"Choose a workspace layout profile.",profileLabel:"Workspace profile",defaultLabel:"Default",defaultDesc:"Standard generation workflow with sidebar composer.",promptStudioLabel:"Prompt Studio",promptStudioDesc:"Prompt builder panel, grouped history, and enhanced viewer."},fw={controls:"Image zoom controls",zoomIn:"Zoom in",zoomOut:"Zoom out",reset:"Reset zoom"},gw={title:"Log",empty:"No generation logs yet",copied:"Prompt copied",copy:"Click to copy prompt",loadFailed:"Could not load generation logs.",retry:"Retry"},hw={writeFailed:"Could not write to the clipboard."},yw={graphSaveFailed:"The node graph could not be saved.",sessionSwitchSaveFailed:"Session switch was stopped because the current graph could not be saved.",sessionInitialLoadFailed:"Sessions could not be loaded.",sessionInitialLoadRetry:"Sessions could not be loaded. Retry now?",attachmentReadFailed:"Could not read one or more attachments."},vw={ariaLabel:"Main navigation",home:"Home",create:"Create",node:"Node graph",agent:"Agent",assets:"Assets",assetGen:"Asset Gen",settings:"Settings"},bw={title:"Asset generation",lede:"Create images or clips, then remove their backgrounds in one click.",prompt:"Prompt",promptPlaceholder:"A single red apple, studio product shot",background:"Background",backgroundHint:"A green background gives the cleanest background removal. Not sure? Keep green.",bgChroma:"Chroma green",bgWhite:"White",bgBlack:"Black",model:"Model",modelGpt:"GPT",modelGrok:"Grok",kind:"Output",kindImage:"Image",kindVideo:"Video",videoSoon:"Video assets arrive in a later phase",videoGrokOnly:"Video generation runs on Grok — switch the model to Grok",videoOptions:"Video options",videoDuration:"Duration",videoResolution:"Resolution",videoAspect:"Aspect ratio",generate:"Generate asset",generating:"Generating…",emptyTitle:"No assets yet",emptyBody:"Write a prompt on the left and press “Generate asset”. Results appear here and are saved to your project automatically.",previewImage:"Open image preview: {prompt}",previewVideo:"Open video preview: {prompt}",previewDialogTitle:"Preview: {prompt}",closePreview:"Close preview",zoomIn:"Zoom in",zoomOut:"Fit to screen",openHintImage:"Enlarge",openHintVideo:"Play",imageFallback:"Generated image",videoFallback:"Generated video",emptyCta:"Write your first prompt",errorTitle:"Generation failed",errorHint:"Check the model and API key settings, then try again.",errorDismiss:"Dismiss",savedHint:"Results are saved to your project automatically.",savedLink:"View in Assets",railTitle:"Project assets",railEmpty:"No saved assets in this project yet.",railError:"Could not load project assets.",sequence:"Sequence",candidates:"Candidates",frameAria:"Frame {n}, {rail}",addFrame:"Add",removeFrame:"Remove",deleteFrame:"Delete frame {n}"},Sw={select:"Project",unassigned:"Unassigned",new:"New project…",newPrompt:"Project name",search:"Find project…",searchPlaceholder:"Search projects",searchEmpty:"No matching project",close:"Close",saveRetry:"Retry save"},xw={title:"Sprite curator",open:"Curate",close:"Close curator",state:"Animation state",unsaved:"Unsaved changes",discardConfirm:"Discard your unsaved sprite changes?",loadError:"Could not load this sprite run.",saveError:"Could not save the curation.",bakeError:"Could not bake the sprite atlas.",exportError:"Could not export the sprite animation.",previous:"Previous frame",play:"Play",pause:"Pause",next:"Next frame",speed:"Speed",grid:"Grid",transform:"Frame transform",rotate:"Rotate",scale:"Scale",dx:"Move X",dy:"Move Y",shx:"Shear X",shy:"Shear Y",flipX:"Flip horizontally",sequence:"Sequence — play and bake order",candidates:"Candidate pool",frameAria:"Frame {n}, {rail}",addFrame:"Add",removeFrame:"Remove",deleteFrame:"Delete frame {n}",save:"Save curation",bake:"Bake atlas",contactSheet:"Contact sheet",gif:"Export GIF",status:{loading:"Loading…",ready:"Saved",saving:"Saving…",baking:"Baking…",exporting:"Exporting…",error:"Action failed"}},Aw={title:"Remove background",open:"Remove background",original:"Original",originalAlt:"Original before background removal",removed:"Background removed",previewLoading:"Preparing the removed-background preview…",resultBadge:"Background removed",keyColor:"Key color",pickHint:"Click the preview to re-pick the key color",clickMode:"Preview click action",modeErase:"Click to erase",modePick:"Pick key color",eraseHint:"Click an empty area to erase just that connected region",undoClick:"Undo click ({count})",previewAlt:"Keying preview on a checkerboard",tolerance:"Removal strength",softness:"Edge softness",spill:"Color spill cleanup",unmix:"Boundary unmix",unmixHint:"Restore semi-transparent edges (chroma keys only)",reset:"Reset",download:"Download alpha PNG",save:"Save to project",saving:"Saving…",videoSave:"Create alpha WebM",videoKeying:"Keying video… {seconds}s",videoSaved:"Alpha WebM saved to the project",saved:"Alpha PNG saved to the project",saveError:"Could not save the keyed image",loadError:"Could not load this image for keying. Close and try again.",advanced:"Fine-tune removal (advanced)"},Tw={ariaLabel:"Quick actions",animate:"Animate",edit:"Edit in canvas",useAsRef:"Use as reference",rebake:"Re-generate",refAdded:"Added as reference image",refFailed:"Could not add reference",saveToAssets:"Save to assets",savedToAssets:"Saved to assets",saveToAssetsFailed:"Could not save to assets"},Cw={title:"Assets",clearAll:"Clear all",clearConfirm:"Delete all saved assets? This cannot be undone.",testSheetsUnavailable:"Element test sheets are not available yet.",detailAria:"{name} details",searchPlaceholder:"Search assets…",allAssets:"All assets",elementLibrary:"Element library",removeFromElements:"Remove from element library",emptyElementsTitle:"No elements yet",emptyElementsBody:"Elements are reusable @-mentionable references (characters, products, styles, scenes). Save a gallery image to assets and promote it, then mention it anywhere with @.",newFolder:"New folder",kindAll:"All types",kindImage:"Images",kindVideo:"Videos",kindElement:"Elements",kindPreset:"Presets",kindTemplate:"Templates",emptyTitle:"No assets yet",emptyBody:"Nothing saved yet. Generate your first image in the Asset generation tab — results are saved here automatically.",emptySearchTitle:"No matches",emptySearchBody:"Try a different search, tag, or type filter.",emptyFolderTitle:"This folder is empty",emptyFolderBody:"Move assets here or save new results into this folder.",deleteAsset:"Remove from assets",confirmDelete:"Delete?",loadMore:"Load more",rootFolder:"Top level",renameFolder:"Rename folder",renameAsset:"Rename asset",starAsset:"Star asset",unstarAsset:"Remove asset star",deleteFolder:"Delete folder",actionFailed:"Action failed",starSaved:"Added to Assets",starSaveFailed:"Starred, but could not add to Assets",itemCount:"{count} items",emptyCta:"Open Asset generation",loadErrorTitle:"Could not load assets",loadErrorBody:"Something went wrong while loading your library.",retry:"Try again",detailClose:"Close asset details",detailKind:"Type",detailCreated:"Created",detailProvider:"Model",detailPrompt:"Prompt",detailTags:"Tags",bindingsTitle:"Provider bindings",bindingsHelp:"How this character connects to external providers.",bindingStateless:"refs per generation",bindingTagPlaceholder:"runway @tag (optional)",bindingSave:"Save binding",bindingSaving:"Saving…",bindingTagInvalid:"Tag must be 1-32 letters, numbers, underscores, or hyphens.",bindingCapWarning:"This character has {count} refs — Runway accepts at most 3 per generation.",bindingTrain:"Train Soul ID",bindingTrainLockedHint:"Requires a paid Higgsfield plan.",bindingPaidPlan:"paid plan required",bindingDriftWarning:"Refs differ from the train-time snapshot — consider retraining."},ww={name:"Node studio",toolbar:{addImage:"Add image",templates:"Templates",saveTemplate:"Save template",branch:"Branch"},empty:{title:"Build an image workflow",description:"Start with a prompt, reuse a proven graph, or continue your latest work.",blankTitle:"Start with a blank canvas",blankDescription:"Add one prompt node and shape the workflow yourself.",blankAction:"Start blank",templateTitle:"Start from a template",templateDescription:"Copy a ready-made graph for a common generation workflow.",templateAction:"Browse templates",recentTitle:"Resume recent graph",recentDescription:"Continue the most recently saved valid graph.",recentUnavailable:"No recent graph is available yet.",recentAction:"Resume recent",resumeError:"Could not open the recent graph. Try again."},elements:{ariaLabel:"Element nodes",title:"Elements",hint:"Drag or add",loading:"Loading elements…",loadError:"Could not load elements. Try again.",empty:"No saved elements yet.",addToCanvas:"Add to canvas"},elementNode:{untitled:"Untitled element",referencesOutput:"Element references output",notesOutput:"Element notes output",kind:"Element",referenceCountOne:"{count} ref",referenceCount:"{count} refs",missing:"This element was deleted. Reconnect it before running."},elementController:{onlyElements:"Only element assets can be added to the canvas.",invalid:"The element node is invalid.",addError:"Could not add the element to the canvas."},branch:{defaultVariant:"Variant {index}",eyebrow:"Branch workflow",title:"Create variants",close:"Close branch dialog",variantLegend:"Variant {index}",label:"Label",provider:"Provider",modelOverride:"Model override",currentModel:"Use current model",sizeOverride:"Size override",currentSize:"Use current size",remove:"Remove",add:"Add variant",cancel:"Cancel",create:"Create branches",selectSourceError:"Select one connected source node.",applyError:"The branch could not be applied, so the graph was left unchanged."},templates:{previewAria:"{name} graph preview",nodeCountOne:"{count} node",nodeCount:"{count} nodes",outputCountOne:"{count} output",outputCount:"{count} outputs",rename:"Rename",delete:"Delete",deleteConfirm:"Delete template “{name}”? This cannot be undone.",title:"Choose a template",close:"Close templates",searchLabel:"Search templates",searchPlaceholder:"Name or tag",loading:"Loading templates…",empty:"No templates match “{query}”.",starter:"Starter templates",yours:"Your templates",cancel:"Cancel",copy:"Make a copy",loadError:"Could not load templates. Try again.",replaceConfirm:"Replace the current graph with a copy of this template?",invalidGraph:"The template graph is invalid.",copyError:"Could not copy the template.",namePrompt:"Template name",saved:"Template saved.",saveError:"Could not save the template.",renamePrompt:"Rename template",renameError:"Could not rename the template.",deleteError:"Could not delete the template."},palette:{ariaLabel:"Insert node command",compatiblePlaceholder:"Compatible with {portType}",searchPlaceholder:"Search nodes",filter:"Showing nodes that accept {portType}.",emptyCompatible:"No node accepts {portType}.",emptySearch:"No nodes match this search.",commandsAria:"Node commands",categories:{input:"Input",generate:"Generate",transform:"Transform",reference:"Reference",output:"Output"}},commands:{"image-generate":{label:"Image generation",description:"Add an image node to the workflow."}},portTypes:{prompt:"prompt",image:"image",images:"images",video:"video",mask:"mask","element-refs":"element references","element-notes":"element notes",settings:"settings","any-media":"any media"},compatibility:{sameDirection:"Connect an output port to an input port.",typeMismatch:"Those port types are not compatible.",cardinality:"That input already has a connection.",selfEdge:"A node cannot connect to itself.",duplicateEdge:"That connection already exists.",unknownPort:"This port is not available for connections.",cycle:"That connection would create a loop."}},Iw={tabs:{label:"Asset workflow",generate:"Generate",sprite:"Sprites"},title:"Sprite recipes",lede:"Lock one character anchor, then generate consistent animation rows.",loading:"Loading sprite recipes…",loadError:"Could not load recipes.",retry:"Retry",empty:{title:"Create a sprite recipe",body:"Define the character, cell geometry, and animation states.",create:"Create recipe"},recipe:{select:"Recipe",new:"New recipe",name:"Recipe name",characterId:"Character ID",description:"Description",style:"Style",baseAssetId:"Base image asset",baseAsset:"Base image asset",save:"Save recipe",saving:"Saving…",unsaved:"Save changes before generating."},cell:{title:"Cell geometry",width:"Width",height:"Height",safeMarginX:"Horizontal margin",safeMarginY:"Vertical margin"},chroma:{title:"Chroma key",hex:"Chroma color"},states:{title:"Animation states",add:"Add state",remove:"Remove",key:"State key",frames:"Frames",fps:"FPS",loop:"Loop",action:"Action"},anchor:{title:"Identity anchor",missing:"Generate and approve an idle pose before rows.",generate:"Generate idle candidate",generating:"Generating…",candidate:"Candidate ready for review.",regenerate:"Regen",approve:"Approve anchor",approved:"Anchor approved",replace:"Replace anchor",confirmTitle:"Approve this identity anchor?",confirmBody:"Future rows will reuse this identity; the base image will not be attached again.",confirm:"Approve",cancel:"Cancel"},rows:{title:"Sprite rows",generateAll:"Generate all",generateSelected:"Generate selected",regenerate:"Retry row",cancel:"Cancel",preview:"Preview",anchorRequired:"Approve the anchor first.",saveRequired:"Save recipe changes first.",status:{pending:"Pending",queued:"Queued",running:"Running",complete:"Complete",error:"Error",canceled:"Canceled"}},error:{INVALID_SPRITE_RECIPE:"Complete the required recipe fields.",ANCHOR_NOT_APPROVED:"Approve the identity anchor first.",BASE_REFERENCE_FORBIDDEN:"The base image cannot be reused after approval.",GENERATION_CANCELED:"Generation was canceled.",generic:"Sprite generation failed."}},Ew={undone:"Undid the last graph change.",redone:"Redid the graph change."},Rw={t2i:"Text → Image",i2i:"Image edit",t2v:"Text → Video",i2v:"Image → Video",v2v:"Video continuation"},Nw={title:"Element",titleEdit:"Edit element",titleNew:"New element",saved:"Saved",ariaLabel:"Element details",name:"Name",namePlaceholder:"e.g. Walnut chair",kind:"Kind",kindCharacter:"Character",kindProduct:"Product",kindStyle:"Style",kindScene:"Scene",kindReference:"Reference",selected:"Selected elements",mentionAria:"{name}, {kind} element",unavailableAria:"{name}, unavailable element",removeAria:"Remove {name} element",helpCharacter:"A person or recurring subject.",helpProduct:"A product with consistent design details.",helpStyle:"A visual language, material, or treatment.",helpScene:"A place, setting, or recurring environment.",notes:"Notes",notesHelp:"Describe appearance, materials, and details that should stay consistent.",notesPlaceholder:"Warm walnut grain, rounded edges, woven cane seat…",remaining:"{n} remaining",strength:"Reference strength",strengthHelp:"How strongly generated work should follow these references.",resetDefault:"Reset to default",saving:"Saving…",save:"Save element",testing:"Generating test sheet…",runTest:"Run test sheet",delete:"Delete",errorName:"Name your element before saving.",errorRefs:"Add at least one reference image before saving.",refsTitle:"Reference images",refsHelp:"Drag to set order. The first image is the representative thumbnail.",refAlt:"Reference {n}",refPrimary:"Representative",refLabel:"Label",refLabelPlaceholder:"Front, side, material…",refMoveUp:"Move reference {n} up",refMoveDown:"Move reference {n} down",refRemove:"Remove",refRemoved:"Reference removed.",refUndo:"Undo"},kw={common:TC,appBar:CC,sheet:wC,toast:IC,inflight:EC,size:RC,sizeConfirm:NC,quality:kC,moderation:_C,format:MC,count:PC,multimode:LC,metadata:OC,onboarding:jC,readiness:GC,generate:DC,home:FC,billing:zC,history:qC,panel:UC,prompt:HC,canvas:BC,gallery:VC,node:KC,nodeBatch:$C,edge:YC,provider:XC,mcp:QC,grokMode:JC,cost:WC,result:ZC,session:ew,uiMode:tw,agent:nw,cardNews:aw,video:ow,sidebar:rw,settings:iw,nodeCanvas:lw,apiDisabled:sw,language:cw,errorCard:dw,promptLibrary:uw,promptBuilder:mw,workspace:pw,viewer:fw,generationLog:gw,clipboard:hw,modal:yw,nav:vw,assetGen:bw,project:Sw,spriteCurator:xw,keying:Aw,chain:Tw,assets:Cw,"assets.clearAll":"Clear all","assets.clearConfirm":"Delete all saved assets? This cannot be undone.",nodeStudio:ww,sprite:Iw,graph:Ew,provenance:Rw,element:Nw},_w={ok:"確定",cancel:"取消",delete:"刪除",close:"關閉",saving:"儲存...",loading:"載入中...",dismiss:"關閉通知",generating:"生成…",imageCollection:"{n} 影像集",remove:"移除",removeNamed:"刪除 {name}",elementSuggestions:"元素建議",noMatchingElements:"沒有符合的元素",enterPrompt:"輸入提示...",continuity:"連續性",activePrompt:"主動提示",elementUnavailable:"元素不可用",spritePreview:"精靈動畫預覽",canvasMemo:"畫布備忘錄",cardDeck:"卡牌組"},Mw={modeImage:"影像",settings:"設定",controls:"發電控制",generate:"產生",generateAria:"開啟提示表產生圖像"},Pw={close:"關閉提示表",generate:"產生影像",controlsOpen:"開放式發電控制",tabs:{prompt:"提示詞",controls:"控制",library:"圖書館"}},Lw={localImportSuccess:"圖像已新增至圖庫",localImportFailed:"匯入圖片失敗",localImportInvalid:"僅支援 PNG、JPEG 或 WebP",localStorageFull:"本機儲存已滿 - 最近的狀態可能不會持續。",refLimitExceeded:"參考文獻上限為 5。多餘的圖像被刪除。",minimaxModelRequiresReference:"image-01-live 需要中國境外的參考影像。附上一個,或切換到 image-01。",refLimitTrayFull:"參考托盤已滿 ({max})。使用 X 刪除項目以附加更多 — 已刪除的 @tags 可以使用 @ 重新提及。",refLimitPartial:"僅新增了 {total} 影像中的 {added}(限制 {max})。",refOverProviderLimit:"此提供者最多接受 {max} 參考影像。刪除 {excess} 來產生。",refTooLarge:"圖片太大。轉換為 JPEG/PNG 或降低解析度並重試。",refNotBase64:"圖像檔案已損壞或使用了不支援的編碼。",refEmpty:"空圖像檔。請選擇不同的文件。",refHeicUnsupported:"不支援 HEIC/HEIF。轉換為 JPEG 或 PNG 並重試。",noCurrentImageForRef:"沒有當前圖像可用作參考。",refSlotFull:"參考槽已滿(最多 5 個)。",currentImageLoadFailed:"無法載入目前圖像。",addedCurrentAsRef:"新增目前影像作為參考。",sessionLoadFailed:"無法載入會話。",sessionCreateFailed:"建立會話失敗。",sessionRenameFailed:"無法重命名會話。",sessionDeleteFailed:"刪除會話失敗。",promptRequired:"輸入提示。",missingElements:"缺少選定的元素。在生成之前將其刪除或重新添加元素。",nodeCreated:"Node {id} 建立 ({elapsed}s)",nodeRootCreated:"從該映像建立第一個 node 。",animateStarted:"將圖像動畫化為影片...",animateProgress:"渲染影片…{n}%",animateDone:"影片準備好了。檢查你的歷史記錄。",animateFailed:"視訊生成失敗。",nodeCreateFailed:"Node 產生失敗。",generatedBatch:"在 {elapsed}s 中產生 {count} 影像。",generatedSingle:"在 {elapsed}s 中產生。",generateFailed:"一代失敗。",sessionReloadedElsewhere:"圖表版本發生變化,因此重新載入最新圖表。",promptCopied:"提示已複製",metadataCopied:"已複製",imageCopied:"已複製到剪貼簿",frameCopied:"幀已複製到剪貼簿",copyFailed:"複製失敗",openGeneratedDirFailed:"無法打開圖像資料夾。運行ima2 doctor檢查儲存路徑。",openGeneratedDirOpened:"打開生成的圖像資料夾。",noPromptToFork:"沒有提示分叉",forkStarted:"提示導入。再次編輯並產生。",forkStartedNoPrompt:"附上圖片作為參考。輸入提示並產生。",continueAsUrlStarted:"提供者 URL 設定為參考。生成以使用原始圖像。",continueAsUrlExpired:"提供者 URL 已過期。請改用此處繼續。",comfyExported:"以 {filename} 發送到 ComfyUI。",comfyExportInvalidUrl:"ComfyUI URL 必須是本地 HTTP 位址。",comfyExportInvalidImage:"此儲存的影像無法傳送至 ComfyUI。",comfyExportImageNotFound:"未找到已儲存的影像檔案。",comfyExportFailed:"無法將映像上傳到 ComfyUI。",cancelFailed:"無法取消生成。",errorClass:{rateLimited:"請求過於頻繁,請稍後再試。",providerTimeout:"服務商回應逾時,請稍後再試。",networkFailure:"無法連線至服務商。請檢查網路後重試。",contentRejected:"服務商拒絕了該提示詞,請修改後重試。",capabilityUnsupported:"目前服務商不支援此請求。",modelUnavailable:"所選模型暫時無法使用。",internalState:"內部狀態異常,請重新載入頁面。"}},Ow={queued:"排隊",planning:"規劃",streaming:"產生",decoding:"敲定",canceling:"取消",noPrompt:"無提示",cancelAria:"取消產生:{prompt}",title:"飛行中",badgeOpen:"顯示飛行中的 {n} 代",badgeClose:"隱藏飛行中的 {n} 代",inlineCollapse:"崩潰飛行中的 {n} 代",footerHint:"您可以關閉此面板——生成會繼續。",kindImage:"影像",kindVideo:"影片",kindNode:"節點",kindMcp:"MCP",progressAria:"產生進度:{n}%"},jw={title:"尺寸",grokAspectTitle:"縱橫比",grokResolutionTitle:"解析度",width:"寬度",height:"高度",hint:"16px 步長,最大邊緣 3840,比例高達 3:1,655K–829M 像素",autoLabel:"自動",autoSub:"型號選擇",customLabel:"自訂",customSub:"自由形式",customPlus:"+ 客製化",customSlots:"保存的尺寸",customSlot:"自訂",customSlotLimit:"最多 3 種自訂尺寸",saveCustomSlot:"儲存自訂尺寸",replaceCustomSlot:"更換插槽",ratioFree:"自由比例",ratio21x9:"21:9",normalizedPreview:"會發送",noAdjustment:"無需調整",squareMaxHint:"由於 829 萬像素限制,平方最大值為 {size}。",adjustedReasons:{snap:"捕捉到 16 像素",maxEdge:"最大邊緣",ratio:"比率限制",minPixels:"最小像素",maxPixels:"最大像素",min:"最小邊緣",max:"最大邊緣",pixels:"像素限制"}},Gw={title:"需要調整尺寸",body:"請求的大小超出了圖像生成限制。",requested:"要求尺寸",adjusted:"調整後的尺寸",approve:"批准並生成",cancel:"取消",reasonRatio:"該比例超出了 3:1 的限制。",reasonPixels:"超出了最大像素限制。",reasonMinPixels:"請求的圖像像素太少。",reasonMin:"尺寸低於最小值。",reasonMax:"大小超過最大值。",reasonSnap:"尺寸必須以 16 像素為增量對齊。"},Dw={title:"品質",grokTitle:"Grok 質量",grokModelTitle:"模型",lowLabel:"低",lowSub:"快速",mediumLabel:"中",mediumSub:"均衡",highLabel:"高",highSub:"最佳"},Fw={title:"內容審查",autoLabel:"自動",autoSub:"標準安全篩選器",lowLabel:"低",lowSub:"較寬鬆的篩選器",explain:"自動使用標準安全篩選器;低模式會放寬限制,因此部分邊界提示詞可能會通過。"},zw={title:"格式"},qw={title:"數數",customPlus:"+n",customLabel:"自訂計數",highCountHint:"對於參考或高品質的計數,較高的計數可能需要更長的時間。",minMaxHint:"使用 1-24 張影像。",decrease:"減少計數",increase:"增加計數"},Uw={label:"序列",tooltip:"用一個提示詞生成多個階段",shortHint:"規劃中的階段",maxStages:"最多階段數",highCountHint:"較高的階段數可能需要幾分鐘的時間。",minMaxHint:"使用 1-24 級。",composerBadge:"序列·共 {count} 段",composerAriaLabel:"序列提示編輯器,最多 {count} 個階段",promptPlaceholder:"描述要生成的階段;關閉序列後搭配數量,可批次生成相同提示詞。",promptPlaceholderWithRefs:"使用所附參考文獻描述分階段順序。",toggleDisabledGenerating:"等待當前一代完成",sequenceTitle:"序列結果",sequenceProgress:"{returned}/{requested} 影像",stageLabel:"階段{index}",generating:"生成...",partialAlt:"部分多模式預覽",partial:"在 {elapsed}s 中產生 {returned}/{requested} 影像。",complete:"在 {elapsed}s 中產生 {returned}/{requested} 影像。",notReturned:"未退回",empty:"沒有返回圖像",error:"生成失敗",canceled:"取消",cancel:"取消"},Hw={restoreTitle:"恢復影像設定",restoreBody:"此影像包含 ima2 生成元資料。應用其提示和設置,或僅將其附加作為參考。",applySettings:"應用程式設定",useAsReferenceOnly:"僅供參考",noMetadata:"未找到 ima2 元資料。",invalidMetadata:"圖像元資料無效。",unsupportedFormat:"僅可恢復 PNG、JPEG 和 WebP 元資料。",readFailed:"無法讀取影像元資料。",applied:"影像設定已恢復。",sourceXmp:"XMP",sourcePngComment:"PNG 評論",imageAlt:"放置影像預覽",prompt:"提示詞",size:"尺寸",quality:"品質",model:"模型",source:"來源",title:"生成詳情",asset:"資產",summary:"生成摘要",copy:"複製",copyRaw:"複製原始 JSON",copyField:"複製 {label}",rawJson:"原始元資料 JSON",sections:{provider:"供應商和型號",settings:"產生設定",usage:"用量與時間",lineage:"來源鏈",video:"影片",videoContinuity:"視訊連續性",prompts:"提示"},fields:{provider:"提供者",authPath:"認證路徑",model:"模型",providerUrl:"提供者 URL",requestId:"請求ID",quality:"品質",size:"尺寸",format:"格式",moderation:"內容審查",reasoning:"推理",promptMode:"提示方式",kind:"種類",mediaType:"媒體類型",elapsed:"耗時",tokens:"代幣",totalTokens:"代幣總數",inputTokens:"輸入",cachedTokens:"快取",outputTokens:"輸出",reasoningTokens:"推理",webSearchCalls:"網路搜尋",grokCostTicks:"Grok 成本刻度",usage:"用量",filename:"檔案名稱",createdAt:"建立時間",sessionId:"工作階段",nodeId:"節點",parentNodeId:"父級 node",clientNodeId:"客戶端 node",refsCount:"參考",sequence:"順序",setId:"批次",cardId:"卡片",videoDuration:"影片時長",videoResolution:"影片解析度",videoAspectRatio:"縱橫比",videoRequestedModel:"要求的型號",videoEffectiveModel:"有效模式",videoModelFallback:"模型後備",xaiVideoRequestId:"xAI 視訊請求",sourceImageFilename:"來源圖片",lineageId:"來源鏈 ID",parentFilename:"父項檔案",sourceFrame:"來源影格",continuityEntries:"連續性項目",latestContinuityPrompt:"最新連續性提示",promptPrimary:"提示詞",userPrompt:"使用者提示",prompt:"儲存提示",revisedPrompt:"修改提示",composerPrompt:"作曲家提示",insertedPrompts:"插入的提示"}},Bw={title:"你好!第一次來這裡?",body:"登入以開始產生。您可以連接 ChatGPT、Grok 或 Gemini。",login:"是的,讓我登入",skip:"我自己設定一下"},Vw={title:"生成準備狀態",open:"檢查準備狀況",openTitle:"檢查提供者、身份驗證、模型和網路搜尋準備情況",settingsTitle:"生成準備狀態",settingsBody:"開啟一個包含提供者、身份驗證、模型、推理和網路搜尋狀態的緊湊彈出視窗。",ready:"準備生成",readyBody:"所選提供者可用。",blocked:"提供者需要關注",provider:"提供者",model:"模型",reasoning:"推理",webSearch:"網頁搜尋",grokApi:"Grok API",grokApiBody:"透過捆綁的 progrok 運作:強制搜尋、Grok 4.5 英語圖像和文字工具規劃,然後是 xAI Images API。附加參考使用 xAI 影像編輯,因此保留了 i2i 上下文。",openAccount:"開設帳戶設置"},Kw={button:"產生",buttonLoading:"生成({n})"},$w={recentTitle:"最近的工作",selectedCount:"已選擇 {count}",selectedPresets:"選定的預設",referenceTrayCount:"{count} 參考文獻",referenceTrayAria:"{count} 引用附加到下一代",viewAll:"看全部",heroTitle:"從滿意的那一張,繼續展開。",heroLede:"在本機生成、編輯、讓畫面動起來。不主動傳送,就不會離開這台機器。",lanesReady:"{total} 條生成通道中 {ready} 條就緒",lanesNone:"尚無就緒通道 — 請在設定中連接",modesTitle:"工作區",modeCreateHint:"生成並打磨單張圖像",modeNodeHint:"把一個結果分成多個方向",modeAgentHint:"說明需求,交給智慧代理執行",modeAssetsHint:"收藏並重複使用你的成果",untitledResult:"未命名結果",recentResultAlt:"最近結果:{prompt}",mediaUnavailable:"無法顯示預覽"},Yw={label:"API 狀態",checking:"檢查...",offline:"離線",remaining:"剩餘 ${remaining}",thisMonth:"本月 ${amount}",oauthFree:"GPT OAuth · 透過 codex 免費",apiDisabled:"API 密鑰準備就緒",apiReady:"API 密鑰準備就緒",oauthMode:"GPT OAuth 模式"},Xw={openGalleryAria:"打開畫廊",openGalleryTitle:"打開完整畫廊",openGalleryShort:"全部",galleryCard:"打開畫廊",recentTitle:"最近幾代人",collapseRecent:"崩潰最近幾代",expandRecent:"擴展最近幾代",collapseRecentShort:"隱藏",expandRecentShort:"展示",emptyRecent:"生成的圖像將出現在此。",generatingCollection:"正在產生 {count} 圖片...",selectRecent:"選擇生成的圖像",deleteImageAria:"從歷史記錄中刪除影像",deleteSequenceAria:"刪除 {count}-影像序列",deleteSequenceConfirm:"刪除此多模式序列中的所有 {count} 影像?",sequenceDeleted:"從歷史記錄中刪除了 {count} 序列影像"},Qw={closeSettings:"關閉設定",detailSettings:"設定",toggleShow:"顯示設定",toggleHide:"隱藏設定",open:"打開",close:"關閉"},Jw={label:"提示詞",refCount:"參考 {count}/{max}",trayAria:"參考托盤,{max} 的 {count}",deadTagHint:"標籤已從托盤上移除 — 僅供參考",deadTagStatus:"提示中不可用的引用:{tags}",refChipTitle:"參考 {n}",refChipAlt:"參考 {n}",refRemoveAria:"刪除引用 {n}",placeholder:"描述您想要的圖像。拖放或貼上以附加參考圖像...",placeholderWithRefs:"描述如何處理所附圖片...",attach:"附",attachTitle:"附上參考圖片",useCurrent:"使用電流",useCurrentTitle:"使用目前結果作為參考",continue:"繼續",continueTitle:"從目前結果繼續作為參考",savePrompt:"節省",storyboard:"故事板",storyboardTitle:"啟用故事板模式 - 在連續幀之間保持角色和場景的連續性",videoToggleTitle:"切換視訊模式 (Grok 1.5)",directMode:"直接的",directModeActive:"1:1直接上",directModeTitle:"逐字傳遞提示(直接模式)",urlRefActive:"URL 參考",urlRefActiveTitle:"提供者 URL 引用處於活動狀態,將用於取代附加的圖像引用。單擊以清除。",urlRefClear:"清除提供者 URL 參考",moveBlockUp:"將 {name} 向上移動",moveBlockDown:"向下移動 {name}",afterBlocks:"主提示後",hint:"Ctrl+Enter 生成",dropHere:"拖曳到附件作為參考(最多 {max})"},Ww={modeTitle:"畫布模式",resultAlt:"結果",imageViewerAria:"生成的圖像檢視器。使用左右箭頭鍵在影像之間移動。",tokens:"{n} 代幣",open:"打開畫布",openAria:"以畫布模式開啟圖像",dragToComposer:"拖曳到作曲家作為參考",dragHint:"拖",annotationInstructionsChip:"畫布筆記",close:"關閉畫布",blank:{title:"空白畫布",subtitle:"在白紙上畫草圖,然後繼續。",create:"建立空白畫布",creating:"創造...",failed:"無法建立空白畫布"},drop:{hint:"拖放圖像以添加到圖庫"},toolbar:{label:"畫布註釋工具",select:"選擇",bgGroup:"出口背景",bgAlpha:"阿爾法",bgMatte:"霧面的",bgMatteColor:"霧面色",cleanup:"乾淨的背景",cleanupMark:"標記",cleanupRemove:"消除",cleanupPreserve:"儲存",cleanupInput:"輸入",cleanupClick:"點選",cleanupBrush:"刷子",cleanupBrushSize:"刷子",cleanupTolerance:"寬容",cleanupAutoSample:"角球",cleanupPickSeed:"採摘種子",cleanupPickingSeed:"點選背景",cleanupActive:"已啟用",cleanupPreview:"預覽",cleanupPreviewing:"正在預覽...",cleanupApply:"申請 PNG",cleanupApplying:"正在申請...",cleanupReset:"重置",cleanupSeedCount:"{n} 種子",cleanupRemoved:"{n}% 已刪除",cleanupPickHint:"點擊圖像上的背景",cleanupBrushHint:"繪製要標記的區域",cleanupMaskHint:"紫色面具將被移除",cleanupApplied:"已建立透明 PNG",cleanupFailed:"後台清理失敗",zoomGroup:"畫布縮放",zoomIn:"放大",zoomOut:"縮小",zoomReset:"重設變焦",zoomShortcutHint:"雙指縮放·兩指平移·[ / ]·0",pen:"筆",box:"盒子",arrow:"箭",memo:"便籤紙",eraser:"橡皮",eraserMenu:"橡皮擦選項",objectEraser:"物體橡皮擦",brushEraser:"刷子橡皮擦",apply:"儲存畫布版本",applyDone:"畫布版本已儲存",applyFailed:"無法儲存畫布版本",export:"匯出圖片",exporting:"出口...",exportFailed:"匯出失敗",undo:"撤銷",redo:"重做",deleteSelected:"刪除所選內容",editMask:"編輯盒裝區域",editMaskDisabled:"先畫一個盒子",editMaskFailed:"屏蔽編輯失敗",editMaskUnsupported:"目前圖像提供者不支援蒙版編輯",style:"風格",color:"顏色",strokeWidth:"筆觸寬度",clear:"全部清除",exportFormat:"導出格式",exportAs:{png:"PNG 影像",svg:"SVG 向量",pptx:"PowerPoint 投影片"}},version:{saving:"正在儲存畫布版本...",saved:"畫布版本已儲存",failed:"無法儲存畫布版本",usingAsReference:"Canvas版本已準備好作為參考"},revert:{action:"恢復烘焙筆記",mixedConfirm:"此版本還包含像素編輯。恢復烘焙筆記將丟棄這些像素編輯。繼續?",restored:"烘焙筆記恢復為可編輯草稿",completed:"烘焙筆記和像素編輯已恢復",failed:"無法恢復烘焙筆記"}},Zw={today:"今天",yesterday:"昨天",thisWeek:"本星期",earlier:"早些時候",imageAltFallback:"生成的圖像",deleteTitle:"移至系統垃圾箱",deleteAria:"刪除影像",ariaLabel:"圖片庫",title:"畫廊",total:"{n} 總計",totalFiltered:"/ {n} 總計",sortByAria:"排序方式",sortByDate:"日期",sortBySession:"工作階段",favoriteFilterAria:"最喜歡的過濾器",filterAll:"全部",filterFavorites:"收藏夾",searchPlaceholder:"搜尋提示或檔案名稱",searchDisabledPlaceholder:"在會話視圖中停用搜尋",closeAria:"關閉畫廊",closeTitle:"關閉(Esc)",sessionLabel:"會話 {name}",standalone:"獨立影像",emptySessions:"尚未保存任何會話。",emptyAll:"還沒有圖像。先創建一個。",emptyFavorites:"還沒有最喜歡的圖像。",noResults:"沒有結果。",loadOlder:"加載較舊的",loadingOlder:"正在加載較舊的...",loadOlderFavorites:"加載較舊的收藏夾",loadingOlderFavorites:"正在加載舊的收藏夾...",sessionPaginationHint:"會話視圖使用目前頁面。切換到日期視圖以載入舊圖像。",sessionLoading:"正在載入會話組...",sessionLoadFailed:"無法載入會話組。",sessionLimitNotice:"顯示最新的 {count} 項目。較舊的項目不包含在會話視圖中。",retry:"重試",loadOlderFailed:"無法載入舊的畫廊項目。",storageNoticeTitle:"保管須知",storageNoticeRecoverable:"抱歉嚇到了。最新版本將圖庫資料夾從已安裝的套件移至使用者資料資料夾。您的舊圖像可能仍在先前生成的資料夾中。運行 ima2 doctor 或開啟恢復指南。",storageNoticeNotFound:"抱歉嚇到了。我們在這台機器上找不到以前產生的資料夾。如果在更新過程中取代了舊的全域安裝資料夾,則可能無法自動復原。運行 ima2 doctor 並查看恢復指南以了解手動搜尋步驟。",storageNoticeUnknown:"無法檢查儲存狀態。如果更新後圖庫看起來是空的,請執行 ima2 doctor 檢查映像資料夾。",openGeneratedDir:"打開資料夾",openGeneratedDirTitle:"打開生成的圖像資料夾",cardNewsSet:"卡新聞集",cardNewsCard:"卡新聞卡",openCardNewsSet:"開集",openCardNewsSetFailed:"無法打開卡片新聞集。",copyCardNewsSetPath:"複製路徑",cardNewsPathCopied:"卡新聞設定路徑已複製。",downloadCardNewsManifest:"顯現",cardNewsCount:"{n} 卡",deleted:"已刪除:{filename}",undo:"撤銷",secondsSuffix:"{n}s",permanentDeleted:"永久刪除:{filename}",movedToSystemTrash:"移至系統垃圾箱:{filename}",deleteFailed:"無法刪除影像。",restoreFailed:"無法恢復影像。",favoriteTitle:"加入收藏夾",unfavoriteTitle:"從收藏夾中刪除",favoriteAria:"加入收藏夾",unfavoriteAria:"從收藏夾中刪除",favoriteFailed:"無法更新收藏夾",scopeAria:"畫廊範圍",scope:{current:"目前會話",all:"所有圖片"},empty:{currentSession:"此會話中還沒有圖像。"}},eI={empty:"空的",elementMissing:"元素“{name}”已刪除。運行前重新連線。",pending:"產生",reconciling:"正在同步",reconcilingPhase:"正在同步·{phase}",ready:"完成 · {elapsed}s",readyWithSearch:"完成·{elapsed}s·搜尋{searches}",stale:"陳舊",staleWithError:"陳舊:{error}",assetMissing:"資產失蹤",assetMissingWithError:"資產缺失:{error}",error:"錯誤:{error}",errorUnknown:"未知",nodeImageAlt:"Node 影像",partialImageAlt:"部分node影像預覽",noAsset:"沒有資產",stateStale:"狀態陳舊",noImage:"無影像",editPromptPlaceholder:"編輯提示...",promptPlaceholder:"提示詞...",regenerate:"雷根",newVariation:"新版本",generate:"根",generateTitle:"產生 node 影像",addChild:"孩子",addChildTitle:"新增子項 node",duplicateBranch:"分支",duplicateBranchTitle:"複製為新的分支根",deleteTitle:"刪除",regenerateTitle:"就地重新產生 node",newVariationTitle:"在同一父項下建立一個新的同級變體",parentImageRequired:"首先生成父圖像。",attachRef:"附",attachRefTitle:"附上 node 參考影像",refAlt:"Node 參考 {n}",removeRef:"刪除引用 {n}",dropRefs:"將圖像拖放到此處",nodeRefsUnsupportedForEdit:"目前僅根節點支援額外引用。",nodeRefsUsedWithParent:"與父圖像一起使用。",classicRefsParkedTitle:"經典參考已停放",classicRefsParkedBody:"這些圖像屬於經典作曲家,在 node 模式下處於非活動狀態。",clearParkedRefs:"清除停放的參考",retry:"重試",retryTitle:"重試這個 node 的生成",errorAuthCta:"檢查您的帳戶或 API 金鑰,然後重新產生。",errorFixCta:"調整提示或引用,然後再次產生。"},tI={selectionOn:"選擇",selectionOff:"選擇",selectAll:"選擇全部",summary:"{selected} 已選擇 · {missing} 缺失 · {stale} 受影響",generateMissing:"生成缺失",regenerateSelected:"重新產生選定的",stopRemaining:"停止剩餘",stopping:"停止",clear:"清除",noneSelected:"未選擇節點。",parentRequired:"{count} 選擇的 node 首先需要準備好父映像。",nothingToRun:"沒有選定的節點需要產生。",stopQueued:"目前的 node 將完成,然後剩餘的佇列將停止。",failed:"在 {done}/{total} node(s) 之後停止。",finished:"已完成 {done}/{total} node(s)。",staleBecauseParentChanged:"重新產生了上游 node ;需要時刷新此 node 。",cycleBlocked:"無法運作:{count} 選擇的 node 形成循環。",partialFinished:"已完成 {done}/{total} — {failed} 失敗,{skipped} 已跳過。"},nI={disconnect:"斷開",disconnectTitle:"斷開選定的邊",disconnected:"連線已移除。",parentConflict:"node 只能有一個父連結。",cycleBlocked:"該連接會形成一個循環。"},aI={authTitle:"提供者",apiLabel:"API 密鑰",statusReady:"可用",statusConnected:"已連接",statusAuthRequired:"需要登入",statusDisconnected:"已斷開連接",statusLineTitle:"狀態",authMethodTitle:"授權",authActive:"已啟用",oauthNotReady:"GPT OAuth 代理程式尚未準備好。",codexLoginRequired:"需要 Codex 登入。",codexLoginHint:"在終端機中執行 `codex login`,然後刷新此頁面。",oauthStarting:"GPT OAuth 代理程式正在啟動。幾秒鐘後重試。",serverUnreachable:"無法到達伺服器。確保後端正在運作。",apiInvalid:"API 密鑰遺失或無效。檢查伺服器.env 中的 OPENAI_API_KEY。",grokOffline:"Grok 代理程式未運作。",grokNoImageModel:"找不到 Grok 影像生成模型。",grokNotReady:"Grok 不可用。",grokOfflineHint:"如果需要,執行 `ima2 grok login` 一次,然後啟動 `ima2 serve`; ima2 自動啟動捆綁的 Grok 代理程式。",grokManagedByIma2:"Grok 透過位於 127.0.0.1:18645 的捆綁 progrok 代理程式在 `ima2 serve` 內部本地運行。",grokClassicOnly:"Grok 影像產生在此表面中不可用。",grokClassicOnlyHint:"使用啟用了 Grok 的生成表面。",grokCompatTitle:"Grok 影像 API",grokCompatBody:"ima2 服務在 127.0.0.1:18645 管理捆綁的 progrok 代理。 Grok 始終在圖像生成之前進行搜索,將附加引用發送到 Grok 4.5 規劃器中,透過 xAI 圖像編輯保留它們,並將大小映射到 xAI 寬高比/分辨率。輸出格式、審核和推理僅是 OpenAI 提供者設定。",settingsBody:"選擇下一代請求使用哪個提供者。",availableTitle:"{name} 可用",availableAria:"{name}:可用",unavailableAria:"{name}:不可用",availableSr:"(可用的)",unavailableSr:"(不可用)",xaiApiKeyRequired:"需要 xAI API 密鑰",geminiApiKeyRequired:"Gemini API 需要密鑰",atlasCloudApiKeyRequired:"Atlas Cloud 需要 API 金鑰",minimaxApiKeyRequired:"MiniMax API 需要密鑰",comingSoon:"即將推出",agyCompatTitle:"Gemini (agy)",agyCompatBody:"1024x1024 固定,JPEG 輸出,最多 3 個參考。沒有品質/尺寸控制。",agyCompatBodyLong:"1024x1024 固定輸出,JPEG 格式,最多 3 個參考影像。沒有網絡搜索,沒有品質/尺寸控制。",geminiApiCompatTitle:"Gemini API",geminiApiCompatBody:"Google Gemini API。支援從 512px 到 4K 的寬高比和解析度控制。",geminiApiCompatBodyLong:"Google Gemini API 直接。支援 nano-banana-2 (Flash) 和 nano-banana-pro (Pro),寬高比和解析度控制範圍為 512px 至 4K。",gptCompatTitle:"GPT Image",gptCompatBody:"OpenAI 透過回應 API 產生影像。支援品質、大小、格式、審核和網路搜尋設定。"},oI={connectionsTitle:"MCP 提供者連接",connectionsBody:"連接官方提供者帳戶並查看工具狀態。只有連線的提供者才會出現在產生選擇器中。",providerLabel:"發電商",modelLabel:"生成模型",coreProviders:"核心提供者",connectedProviders:"連接的 MCP 供應商",imageModels:"影像模型",videoModels:"視訊模型",chooseModel:"選擇型號",loadingModels:"載入模型",loadingProviders:"檢查連接",providersLoadFailed:"無法載入 MCP 提供者狀態。",modelsLoadFailed:"模型載入失敗 — 點選重試",retryModels:"重試",noModels:"沒有適用於此模式的型號。",refreshingConnection:"清爽…",exitLane:"使用核心提供者",modelSectionTitle:"模型",ratioAutoHelp:"自動讓模型選擇自己的縱橫比。某些型號可能會拒絕預設。",aspectRatioLabel:"縱橫比",durationLabel:"時長",resolutionLabel:"解析度",qualityLabel:"品質",modeLabel:"模式",audioLabel:"聲音的",onLabel:"在",offLabel:"離開",toolInputsLabel:"參考媒體",referenceNone:"沒有任何",referenceSelect:"從畫廊中選擇",referenceCurrent:"目前畫廊項目",referenceMissing:"不在載入的歷史記錄中",startFrameLabel:"起始畫面",endFrameLabel:"結束框架",endFrameNeedsStart:"首先選擇一個起始幀。",imageReferencesLabel:"圖片參考(最多 3 張)",imageReferenceAria:"圖片參考{index}",referenceTagAria:"影像參考標籤 {index}",referenceTagPlaceholder:"可選標籤",referenceTagInvalid:"使用 1-32 個字母、數字、底線或連字號作為標籤。",referenceAttachLocal:"附上本地圖片",referenceAttachHelp:"本機影像暫時上傳,並在產生穩定後刪除。",referenceLocalFallback:"本地圖片",referenceLocalInvalidType:"選擇 PNG、JPEG 或 WebP 影像。",referenceLocalReadFailed:"無法讀取該影像。再選擇一次。",referenceSource:{asset:"資產",element:"元素",local:"本地附件"},videoReferenceLabel:"影片參考",videoReferenceCostNote:"使用視訊參考可能會增加提供者費用。",advancedPresetsLabel:"進階預設",providerDefaultsHelp:"此模型使用提供者預設值,無需額外預設。",chooseModelForPresets:"在頂部選擇器中選擇一個型號以查看其支援的預設。",refreshList:"刷新狀態",connect:"連接",connecting:"正在連接",connectOpensBrowser:"在瀏覽器視窗中開啟提供者登入。",refreshConnection:"重新連接",disconnect:"斷開",connectionActionFailed:"連接操作無法完成。稍後再試。",popupBlocked:"登入視窗被封鎖。允許彈出窗口,然後再次連接。",locked:"鎖定",unavailable:"不可用",unknownProvider:"{provider} 的連線資訊不可用。",disconnectedSelection:"已儲存的提供者已中斷連線。在“設定”中重新連線。",disabledProvider:"此提供者在目前伺服器配置中已停用。",selectionUnavailable:"所選的 MCP 提供者不可用。在“設定”中檢查其連接。",higgsfieldLocked:"該提供者的代數已鎖定。",toolCount:"{count} 工具",toolCountUnknown:"工具數量未知",snapshotChanges:"{count} 架構更改",billingLabel:"計費",billingSubscription:"訂閱積分",billingApi:"API 使用計費",billingUnknown:"未知",generateFailed:"無法啟動 MCP 產生。",errorUnsupportedInput:"此模型不支援選定的參考類型之一。選擇相容型號或將其刪除。",errorEndRequiresStart:"在新增結束幀之前選擇開始幀。",errorInvalidReferences:"一張或多張參考影像不再可用。再次選擇他們。",errorInvalidFrame:"所選幀或影片不再可用。再選擇一次。",errorTempReferences:"無法準備本地參考影像。再選擇一次。",status:{disconnected:"已斷開連接",connecting:"正在連接",auth_required:"需要登入",connected:"已連接",offline:"離線",error:"錯誤"},characterSlotLabel:"特點",characterSlotNone:"無字元綁定",characterSlotConflictHint:"刪除 @element 提及使用字元綁定 - 它們不能組合。"},rI={image:"影像",video:"影片"},iI={free:"免費",approx:"〜${amount}",multimodeApprox:"最高~${amount} ({count})",label:"預估成本"},lI={download:"下載",copyImage:"複製影像",copyLastFrame:`最後
|
|
17
|
+
Frame`,copyPrompt:"Copy prompt",continueHere:"Continue here",continueHereTitle:"Import this image's prompt and keep working",continueAsUrl:"URL continue",continueAsUrlTitle:"Continue using the original provider URL (expires in 1 hour)",animate:"Animate",animating:"Animating…",animateTitle:"Generate a Grok video from this image (image-to-video)",firstNode:"First node",firstNodeTitle:"Send this image to Node Mode as a ready first node",info:"Info",infoTitle:"Show generation details and provenance",delete:"Delete",deleteTitle:"Move to trash",more:"More",sendToComfyUI:"Send to ComfyUI",sendToComfyUITitle:"Upload this saved image to local ComfyUI",permanentDelete:"Permanently delete",permanentDeleteConfirm:'Permanently delete "{filename}"? This cannot be undone.',upscale:"Upscale",upscaleTitle:"Upscale through Runway (MCP)",upscaleFlavor:"Flavor",upscaleFlavorAuto:"auto",upscaleStart:"Start upscale",upscaleStarted:"Upscale started",upscaleFailed:"Upscale failed",upscaleInvalid:"Invalid upscale parameters"},ew={switchTitle:"Switch session",loading:"Loading...",newSession:"New session",newSessionTitle:"New session",renameTitle:"Rename",renamePrompt:"Session name",deleteTitle:"Delete",deleteConfirm:'Delete session "{title}"? This cannot be undone.',empty:"No sessions yet",firstGraph:"My first graph",untitled:"Untitled session",assetAbortedError:"Generation did not finish cleanly. Retry from this node."},tw={ariaLabel:"UI mode",classic:"Classic",node:"Node",cardNews:"Card News",agent:"Agent"},nw={workspace:"Agent workspace",workspaceActionFailed:"Action failed: {reason}",bootFailed:"Agent workspace could not be loaded",bootRetry:"Retry",topbarBackToStudio:"Back to Studio",topbarStudio:"Studio",topbarOpenQueue:"Open queue, {count} active jobs",topbarCloseQueue:"Close queue",topbarQueueSheet:"Generation queue",title:"Agent",newSession:"New Agent",sessions:"Sessions",openSessions:"Open sessions",closeSessions:"Close sessions",sessionsUseRail:"Pin sessions as a compact rail",sessionsUseExpanded:"Pin the expanded sessions list",sessionSearch:"Search sessions",renameSession:"Rename session",deleteSession:"Delete session",deleteConfirm:'Delete "{title}"?',imageCount:"{count} images",compacted:"Compacted",web:"Web",chat:"Chat",user:"User",assistant:"Agent",tool:"Tool",toolExpand:"Show tool details",toolCollapse:"Hide tool details",toolImageCount:"{count} img",toolCallCount:"{count} calls",toolGroup:"Tool run",toolInput:"Input",toolOutput:"Output",toolsShowMore:"More",toolsShowLess:"Less",toolArtifacts:"Artifacts",requestId:"Request ID",duration:"Duration",toolStatus:{queued:"Queued",running:"Running",complete:"Complete",error:"Error"},rightSidebar:"Agent side tools",sidebarTabs:{image:"Image",library:"Library",forms:"Forms",quality:"Quality",model:"Model",queue:"Queue"},modelSettings:"Model settings",closeModelSettings:"Close model settings",openModelSettings:"Open model settings",modelTabView:"View in Model tab",model:"Model",provider:"Provider",reasoningEffort:"Reasoning",generationStrategy:"Generation plan",generationStrategyAuto:"Based on user request",generationStrategyManual:"Fixed count",quality:"Quality",size:"Size",format:"Format",moderation:"Moderation",variantsCount:"Variants",maxAutoVariants:"Auto max",parallelism:"Parallelism",promptLibrary:"Prompt library",forms:"Forms",noForms:"No form templates",insertPrompt:"Insert",queue:"Queue",runningShort:"run",queuedShort:"wait",queueEmpty:"No queued Agent work.",cancelQueue:"Cancel",retryQueue:"Retry",sessionRunning:"Generation running",sessionQueued:"{count} queued",sessionError:"Generation error",queueStatus:{queued:"Queued",running:"Running",succeeded:"Done",failed:"Failed",canceled:"Canceled"},statusReady:"Ready",statusGenerating:"Generating",statusReconnecting:"Reconnecting",pending:"Generating response...",pendingQueued:"Waiting in queue...",pendingPlanning:"Planning the response...",pendingGenerating:"Running tools and generating...",runError:"Run failed",errorRole:"Error",composerPlaceholder:"Ask anything or describe what to create",slashCommands:"Agent slash commands",slashDesc_question:"Ask a question without generating images",slashDesc_variants:"Generate N image variants (1-24)",slashDesc_generate:"Bounded fanout generation (1-24)",slashDesc_parallelism:"Limit concurrent tool calls",slashDesc_help:"Show available commands",attachReference:"Attach reference",send:"Send",webSearch:"Use search",emptyChat:"Enter a message to start image or video work.",emptyJumpLatest:"Jump to latest",queueSummary:"{active} active · {failed} failed",queuePlanSummary:"variants {variants} · parallel {parallel}",queueDetails:"Technical details",queueAnnouncement:"Queue updated: {running} running, {queued} queued, {failed} failed",queueTimeAgo:"{value} {unit} ago",queueTimeUnit:{second:"sec",minute:"min",hour:"hr"},progressQueued:"Waiting in queue",progressPlanning:"Preparing request",progressGenerating:"Generating",progressDownloading:"Downloading result",progressFailed:"Run failed",progressJob:"{kind} · {count} variants",mediaKind:{image:"Image",video:"Video"},mediaSelect:"Focus media",mediaLoading:"Loading video",mediaLoadFailed:"Video could not be loaded.",mediaRetry:"Retry",mediaVideoLabel:"Generated video",mediaDuration:"Duration {duration}",mediaDurationUnknown:"Duration unavailable",mediaDownload:"Download",imagePane:"Image",currentImage:"Current image",openImage:"Open image",closeImage:"Close image",selectImage:"Focus image",variants:"Variants",contextTabs:"Image context",imageTab:"Image",refsTab:"Refs",webTab:"Web",memoryTab:"Memory",noImage:"No current image",noRefs:"No references",noWeb:"No web evidence",memoryItemStyle:"Style locks are retained in image context.",memoryItemSubject:"Subject locks are restored after resume.",imageAlt:"Agent image",filename:"File",prompt:"Prompt",stageEmptyHint:"Send your first request to see the image here",openTools:"Open tools panel",closeTools:"Close tools panel"},aw={workspace:"Card News workspace",composer:"Card News",composerHint:"Templates are visual snapshots; output size is set separately.",topic:"Topic",topicPlaceholder:"e.g. Exam comeback plan",audience:"Audience",audiencePlaceholder:"e.g. Parents",goal:"Goal",goalPlaceholder:"e.g. Book a consultation",brief:"Brief",briefPlaceholder:"Describe the card news content, required points, and exclusions.",outputSize:"Output size",customSize:"Custom",draft:"Draft outline",drafting:"Drafting...",generateSet:"Generate set",batchGenerate:"Batch generate",generating:"Generating...",generated:"Generated {count} cards.",missingGeneratedCard:"The generation response did not include this card.",error:"Card generation failed.",imageTemplate:"Image template",roleTemplate:"Card structure",newTemplateLater:"Custom templates are planned after the dev MVP",emptyTitle:"Waiting for a draft",emptyBody:"Use the left setup panel to prepare the card deck.",inspector:"Card inspector",cardTitle:"Card title",headline:"Headline",body:"Body",visualPrompt:"Image prompt",summaryCopy:"Summary copy",designPrompt:"Scene / design prompt",textFields:"Text boxes",addTextField:"Add text box",removeTextField:"Remove",noTextFields:"No text boxes yet.",textFieldText:"Text",textKind:"Kind",placement:"Placement",renderMode:"Render mode",hierarchyLabel:"Hierarchy",textTooLong:"Text exceeds the suggested length.",selectTextField:"Select text box: {text}",textKinds:{headline:"Headline",body:"Supporting text",caption:"Caption",cta:"CTA",badge:"Badge",number:"Number"},renderModes:{"in-image":"In image","ui-only":"UI only"},hierarchy:{primary:"Primary",secondary:"Secondary",supporting:"Supporting"},placements:{"top-left":"Top-left","top-center":"Top-center","top-right":"Top-right","center-left":"Center-left",center:"Center","center-right":"Center-right","bottom-left":"Bottom-left","bottom-center":"Bottom-center","bottom-right":"Bottom-right",free:"Free"},roles:{cover:"Cover",hook:"Hook",problem:"Problem",insight:"Insight",example:"Example",data:"Data",summary:"Summary",cta:"CTA"},locked:"Locked",unlocked:"Unlocked",noCard:"No card selected",generatedMeta:"Generated metadata",lockedHelp:"Locked cards are excluded from batch generation and retry.",retryCard:"Retry this card",actions:{copyPrompt:"Copy prompt",copyCopy:"Copy copy",openImage:"Open image",downloadCard:"Download"},status:{draft:"Draft",queued:"Queued",generating:"Generating",generated:"Done",error:"Error",skipped:"Skipped",locked:"Locked"},progress:{generating:"Generating {done}/{total}",summary:"Done {done}/{total}",detail:"{queued} queued · {errors} errors · {skipped} skipped",cardGenerating:"Generating this card."},planner:{structured:"Structured JSON",jsonMode:"JSON mode",repaired:"Repaired",fallback:"Fallback draft",jsonOnlyHelp:"Draft creates JSON only. Images are generated later.",error:"Draft failed"}},ow={selectedCameraPresets:"Selected camera motion presets",plannerModelTitle:"Planner Model",reasoningEffortTitle:"Reasoning Effort",modeLabel:"Video mode",mode:{"text-to-video":"Text → video (no reference images)","image-to-video":"Image → video (1 reference)","reference-to-video":"Reference → video ({n} references)"},seriesTopicTitle:"Series topic",seriesTopicPlaceholder:"e.g. Korean travel vlog",durationTitle:"Length",resolutionTitle:"Resolution",resolution1080Help:"1080p uses Grok V1.5 for prompt-only or single image/frame video. It is not available with 2+ references.",aspectTitle:"Aspect ratio",plannerUpdateFailed:"Could not update the planner model. The previous setting was restored.",continuationFallbackT2V:"The continuation frame could not be extracted. Generation will continue as text-to-video."},rw={appName:"Image Generator",imageModelLabel:"Model",imageSectionLabel:"Image",gptImageSubLabel:"GPT-IMAGE-2",grokImageSubLabel:"Grok Imagine",geminiImageSubLabel:"Gemini",videoSectionLabel:"Video",imageModelAria:"Choose image model",quickSettingsAria:"Choose model and reasoning effort. Current model {model}, reasoning {effort}",quickSettingsModelOnlyAria:"Choose image model. Current model {model}",quickSettingsMenu:"Model and reasoning quick settings",reasoningLabel:"Reasoning",videoModelLabel:"Video",nodeModeHint:"In node mode, click a node to edit its prompt and generate. Settings on the right panel (quality/size) apply to every new result."},iw={openAria:"Open settings",openTitle:"Settings",closeAria:"Close settings",closeTitle:"Return to canvas",navAria:"Settings sections",contentAria:"Settings content",jumpTo:"Jump to {section}",title:"Settings",sections:{providers:{title:"Providers",hint:"Accounts, keys, models"},workspace:{title:"Workspace",hint:"Profile, layout, gallery"},general:{title:"General",hint:"Language"}},account:{primaryEyebrow:"Active provider",oauthTitle:"GPT OAuth",oauthBody:"GPT OAuth generation runs through your Codex OAuth session. You can switch to API-key mode when a valid key is configured.",apiSourceEnv:"OPENAI_API_KEY detected",apiSourceConfig:"config.json API key detected",apiTitle:"OpenAI API key",apiBody:"ima2-gen can use this API key for generation, edit, multimode, and node requests through the Responses API.",apiDisabled:"Unavailable",apiReady:"Ready",apiUnavailable:"Unavailable",apiUnknown:"Status unknown",grokEyebrow:"Local xAI proxy",grokTitle:"Grok",grokBody:"Uses progrok at the configured local port for xAI Images API generation.",agyEyebrow:"Antigravity CLI",agyTitle:"Gemini (agy)",agyInstalledBody:"Login status can't be detected. Run `agy login` in your terminal if generation fails.",agyMissingBody:"Not installed. Get the",agyMissingLink:"Antigravity CLI",agyFineprint:"Antigravity models and image quota are billed separately.",agyInstalled:"Installed",agyMissing:"Not installed",status:{ready:"Ready",authRequired:"Login required",starting:"Starting",offline:"Offline",noImageModel:"No image model",error:"Error",checking:"Checking"}},quota:{codexNotLoggedIn:"Not logged in",fetchError:"Could not load quota",noData:"No usage data",grokUsageLink:"View Grok usage →",switchAccount:"Switch {provider} account",startingLogin:"Starting login…",enterCode:"Enter this code in the opened tab:",retry:"Retry",copyLink:"Copy link",copied:"Copied",waitingApproval:"Waiting for approval…",switchComplete:"Account switched. Refreshing…",switchFailed:"Account switch failed",tryAgain:"Try again"},imageModel:{title:"Image model",body:"Choose the image model used for future generations. Selecting a Grok model switches the provider to Grok.",gpt54Mini:"GPT-5.4 Mini",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt56Sol:"GPT-5.6 Sol",gpt56Terra:"GPT-5.6 Terra",gpt56Luna:"GPT-5.6 Luna",grokImagine20:"Grok Imagine Image 2.0",grokImagine:"Grok Imagine",grokImagineQuality:"Grok Imagine Quality",nanoBanana2:"Nano Banana 2",nanoBanana2Api:"Nano Banana 2",nanoBananaPro:"Nano Banana Pro",atlasCloudGptImage2:"Atlas Cloud GPT Image 2",atlasCloudGptImage2Edit:"Atlas Cloud GPT Image 2 Edit",minimaxImage01:"MiniMax image-01",minimaxImage01Live:"MiniMax image-01-live",agy:"Antigravity (agy)",gpt53CodexSpark:"GPT-5.3 Codex Spark — unsupported for images",unsupportedHelp:"Grok models use xAI's Images API through the bundled local proxy. GPT models use OpenAI Responses image generation."},apiKeys:{accordionTitle:"API Keys",envSource:"Loaded from environment",configSource:"Loaded from config",openai:{label:"GPT API Key (OpenAI)",placeholder:"Paste your OpenAI API key (sk-...)"},xai:{label:"Grok API Key (xAI)",placeholder:"Paste your xAI API key (xai-...)"},gemini:{label:"Gemini (Google)",placeholder:"Paste your Gemini API key (AI...)"},atlascloud:{label:"Atlas Cloud",placeholder:"Paste your Atlas Cloud API key (apikey-...)"},minimax:{label:"MiniMax",placeholder:"Paste your MiniMax API key"},vertex:{label:"Vertex AI (Service Account)",placeholder:'Paste your Google Cloud service account JSON { "type": "service_account", ... }',authModeApiKey:"API Key",authModeVertex:"Vertex JSON"},save:"Save",saved:"Saved",saving:"Validating...",remove:"Remove",saveFailed:"Could not save the key",networkError:"Network error. Try again.",removeFailed:"Could not remove the key",configuredReplace:"configured — click to replace",status:{valid:"Valid",notConfigured:"Not configured"}},videoModel:{grokImagine:"Grok Imagine Video",grokImagine15:"Grok Imagine Video 1.5"},reasoning:{title:"Reasoning effort",body:"Higher effort spends more reasoning tokens on planning, web search, and prompt enrichment before generating.",none:"Off — no extra reasoning",low:"Low — fastest, minimal reasoning",medium:"Medium — balanced default",high:"High — deeper research and synthesis",xhigh:"Xhigh — extended reasoning, slower",max:"Max — maximum reasoning, slowest"},webSearch:{title:"Web search",body:"Use live search before generation for real people, brands, products, places, and recent events.",on:"Search on",off:"Search off"},grokCompatibility:{title:"Grok compatibility",body:"Grok image generation first runs mandatory web search, then sends text and attached images to a local image-tool planner that writes the final image prompt in English. Attached references route through xAI image editing; size is mapped to aspect ratio/resolution. Output format, moderation, and reasoning are only used by GPT OAuth and API key providers."},grokPlanner:{title:"Grok planner model",body:"The model used for search and image/video prompt planning. Grok 4.5 is the default and supports image input for I2V/Ref2V planning; Grok 4.3 remains available as a compatibility override."},gallery:{defaultScopeTitle:"Default gallery view",defaultScopeBody:"Choose what the gallery shows when you open it."},appearance:{historyStripLayoutTitle:"History thumbnails",historyStripLayoutBody:"Choose how the compact history strip sits beside the workspace.",historyStripLayout:{rail:"Rail",horizontal:"Top row",sidebar:"Sidebar"}},language:{title:"Language",body:"Switch the UI language without changing generated content."}},lw={loading:"Loading session...",addFirst:"+ Add first node",addRootTitle:"Add root node",hint:"Drag a handle into empty space to branch. Press Delete or Backspace to remove."},sw={title:"{provider} unavailable",ariaLabel:"{provider} unavailable"},cw={label:"Language",ko:"한국어",en:"English","zh-Hant":"正體中文","zh-Hans":"简体中文"},dw={close:"Close",details:"Show raw error details",unknown:{title:"An unexpected error occurred",body:"Please try again shortly. If it persists, copy the raw error message below and report it."},moderationRefused:{title:"Prompt blocked by moderation",body:"Soften the wording or rephrase. Sensitive/violent content in reference images can also trigger this.",cta:"Edit prompt",bodyInput:"Your prompt text was caught by the input filter. Try rephrasing or using different wording.",bodyOutput:"The generated image was caught by the output filter. Try changing the style or quality settings."},emptyResponse:{title:"No image was returned",body:"Codex responded but didn't include image data. This isn't a moderation block — it's likely a transient hiccup or an unsupported size/quality/model combination. Retry, or try a different size or model.",cta:"Retry"},streamParseFailed:{title:"Could not parse the image response stream",body:"Response data arrived, but the app could not read the image stream cleanly. This can happen with a proxy or transient stream transport issue.",cta:"Retry"},imageToolNotCalled:{title:"The image tool was not called",body:"The response completed, but no image-generation tool call was observed. Retry the same prompt, or try another model/search setting.",cta:"Retry"},webSearchOnlyResponse:{title:"The image tool was not called",body:"Only web search ran; the image-generation tool did not. Turn off search or retry the request.",cta:"Retry"},imageToolFailed:{title:"The image tool call failed",body:"The image-generation tool was called, but it ended in a failed state. If this repeats, report it with `ima2 doctor image-probe --json` output.",cta:"Retry"},imageToolNoResult:{title:"The image result was empty",body:"The image tool call completed but did not include image data. This can point to an unsupported option combination or account capability issue.",cta:"Retry"},oauthImageCapabilityUnavailable:{title:"This account may not have image-tool access",body:"GPT OAuth is connected, but this account/model combination may not be entitled to use image generation. Compare with API-key mode or another model.",cta:"OK"},responsesStreamError:{title:"The image response stream ended with an error",body:"OpenAI returned an error event inside the response stream. Retry shortly, and check the raw error details if it persists.",cta:"Retry"},upstream5xx:{title:"OpenAI is currently busy",body:"Retrying usually resolves this. Check status.openai.com if it persists.",cta:"Retry"},authChatgptExpired:{title:"Codex ChatGPT session expired",body:"Run `ima2 setup` in your terminal (option 1), then reload this app.",cta:"Reload"},authApiKeyInvalid:{title:"API key authentication failed",body:"The key is missing, invalid, revoked, out of quota, or tied to the wrong org. Switch to GPT OAuth or update the configured API key.",cta:"OK"},networkFailed:{title:"Network connection failed",body:"Could not reach OpenAI or the local runtime service. Reload first; if it persists, check VPN/firewall and the port shown by `ima2 doctor`.",cta:"Reload"},oauthUnavailable:{title:"GPT OAuth proxy unavailable",body:"The GPT OAuth proxy is starting, unavailable, or moved to a fallback port. Reload first; if it persists, run `ima2 doctor` and check the reported GPT OAuth URL.",cta:"Reload"},invalidRequest:{title:"Image request needs changes",body:"One or more generation parameters are invalid. Check the raw error details below, then edit the prompt or size and try again.",cta:"Edit input"},apikeyDisabled:{title:"API-key mode is unavailable",body:"This build supports API-key generation, but the current request could not use a configured key. Switch to GPT OAuth or update the API key.",cta:"OK"},agyGenerationFailed:{title:"Gemini generation failed",body:"The Antigravity CLI returned an error. Check that the agy binary is installed and your Gemini account is active.",cta:"Retry"},agyTimeout:{title:"Gemini generation timed out",body:"The agy process did not respond within the timeout window (360s). Try again or check the agy CLI status.",cta:"Retry"},agyProcessError:{title:"Gemini process error",body:"The agy CLI exited with an unexpected error. Verify the binary is working with 'agy --version'.",cta:"Retry"},agyQuotaExhausted:{title:"Gemini quota exhausted",body:"You have exhausted your Gemini image generation capacity. Your quota will reset automatically — check the reset timer in the error details.",cta:"OK"},authClass:{title:"Sign-in required",body:"Provider authentication expired or the key was rejected. Sign in again from Settings.",cta:"Sign in again"},billingRequired:{title:"Billing required",body:"This provider account has no remaining credit. Check the provider console, then try again."}},uw={title:"Prompt Library",saveTitle:"Save to Prompt Library",save:"Save",saved:"Prompt saved",saveFailed:"Save failed",name:"Name",tags:"Tags",search:"Search prompts...",favorites:"Favorites",load:"Load",insert:"Insert",inserted:"Prompt inserted",removeInserted:"Remove inserted prompt {name}",favorite:"Favorite",unfavorite:"Unfavorite",empty:"No saved prompts yet.",content:"Content",copy:"Copy",untitled:"Untitled",addNew:"Add new prompt",import:"Import",importFiles:"Import .txt, .md, .markdown, or GitHub files",dropImport:"Drop .txt, .md, or .markdown files to import prompts",importTitle:"Import prompts",importDropTitle:"Drag files here",importDropHint:"Preview .txt, .md, and .markdown files before saving",importChooseFiles:"Choose files",importGithubLabel:"GitHub file URL or path",importPreview:"Preview",importPreviewEmpty:"Drop files or enter a GitHub path to preview candidates.",importCommit:"Save selected",importSelected:"Import selected ({count})",importThisPrompt:"Import this prompt",previewPrompt:"Preview",selectPrompt:"Select",selectedPrompt:"Selected",selectedCount:"{count} selected",selectAllCandidates:"Select all",clearCandidateSelection:"Clear",addAnotherSource:"Add another source",searchResultsHeader:"Search results ({count})",searchResults:"Search results",promptText:"Prompt text",importSelectAtLeastOne:"Select at least one prompt to save.",imported:"Imported {count} prompt(s)",importFailed:"Import failed",importNoValidFiles:"No .txt, .md, or .markdown prompt files found.",curatedSources:"Curated sources",curatedSourcesHint:"Search indexed public prompt sources",curatedSearch:"Search",curatedSearchPlaceholder:"nano banana, gpt-image-2, typography...",refreshSource:"Refresh",curatedRefreshed:"Indexed {count} prompt candidate(s)",sourceTrustTier:"Source trust",requiresAttribution:"Attribution required",sourceDetails:"Source",license:"License",attributionRequired:"Attribution required",modelHints:"Model hints",taskHints:"Task hints",warnings:"Warnings",compatibilityWarnings:"Compatibility warnings",transparentUnsupportedGptImage2:"Transparent background is not supported by gpt-image-2",noCuratedResults:"No curated prompt candidates found.",discovery:"Discovery",discoverySearch:"Search GitHub",discoverySearchPlaceholder:"Search prompt repositories...",discoveryCandidates:"Discovery candidates",discoveryApprove:"Approve",discoveryReject:"Reject",discoveryApproved:"Approved",discoveryRejected:"Rejected",discoveryScore:"Score",discoveryWarnings:"Discovery warnings",discoveryRateLimited:"GitHub discovery is rate limited.",discoveryNoResults:"No discovery candidates found.",discoveryReviewQueue:"Review queue",discoveryRequiresPaths:"Add reviewed file paths before default search.",folderBrowse:"Browse folder",folderBrowseHint:"Loads supported files from a GitHub folder",folderFiles:"Folder files",folderFilesEmpty:"No importable .md, .markdown, or .txt files found.",folderPreviewSelected:"Preview selected files",folderSelectedCount:"{count} selected",folderWarnings:"Folder warnings",folderTooManyFiles:"Too many files; showing a limited set.",folderNoSelection:"Select files to preview.",folderUnsupported:"Only GitHub folders are supported."},mw={title:"Prompt Builder",subtitle:"Refine prompts through multi-turn context.",scopeDraft:"New work",scopeImage:"Selected image: {name}",scopeImageFallback:"Current image",newWorkTitle:"Start a new work without image context",model:"Builder model",empty:"Describe the direction you want. I will include your current prompt and settings as context.",user:"You",assistant:"Builder",placeholder:"What kind of image should we make?",send:"Send",sending:"Writing",thinking:"Refining the prompt...",clear:"Clear",applyToPrompt:"Apply to prompt",insertAsBlock:"Insert block",finalKoreanPrompt:"Korean prompt",finalEnglishPrompt:"English prompt",blockName:"Builder suggestion",applied:"Builder suggestion applied to the main prompt",inserted:"Builder suggestion inserted as a prompt block",failed:"Prompt builder request failed",removeScopeImage:"Remove selected image from builder context",removeAttachment:"Remove attachment {name}",attach:"Attach file",attachmentOnlyMessage:"Use the attached file as context and help with the prompt"},pw={sectionTitle:"Workspace",sectionBody:"Choose a workspace layout profile.",profileLabel:"Workspace profile",defaultLabel:"Default",defaultDesc:"Standard generation workflow with sidebar composer.",promptStudioLabel:"Prompt Studio",promptStudioDesc:"Prompt builder panel, grouped history, and enhanced viewer."},fw={controls:"Image zoom controls",zoomIn:"Zoom in",zoomOut:"Zoom out",reset:"Reset zoom"},gw={title:"Log",empty:"No generation logs yet",copied:"Prompt copied",copy:"Click to copy prompt",loadFailed:"Could not load generation logs.",retry:"Retry",detailOpen:"Click for details",detailTitle:"Generation request",detailTime:"Time",detailRequestId:"Request ID",detailCounts:"Succeeded / requested",detailError:"Error code",detailPrompt:"Prompt",detailPromptEmpty:"(empty prompt)",detailErrorMessage:"Failure reason"},hw={writeFailed:"Could not write to the clipboard."},yw={graphSaveFailed:"The node graph could not be saved.",sessionSwitchSaveFailed:"Session switch was stopped because the current graph could not be saved.",sessionInitialLoadFailed:"Sessions could not be loaded.",sessionInitialLoadRetry:"Sessions could not be loaded. Retry now?",attachmentReadFailed:"Could not read one or more attachments."},vw={ariaLabel:"Main navigation",home:"Home",create:"Create",node:"Node graph",agent:"Agent",assets:"Assets",assetGen:"Asset Gen",settings:"Settings"},bw={title:"Asset generation",lede:"Create images or clips, then remove their backgrounds in one click.",prompt:"Prompt",promptPlaceholder:"A single red apple, studio product shot",background:"Background",backgroundHint:"A green background gives the cleanest background removal. Not sure? Keep green.",bgChroma:"Chroma green",bgWhite:"White",bgBlack:"Black",model:"Model",modelGpt:"GPT",modelGrok:"Grok",kind:"Output",kindImage:"Image",kindVideo:"Video",videoSoon:"Video assets arrive in a later phase",videoGrokOnly:"Video generation runs on Grok — switch the model to Grok",videoOptions:"Video options",videoDuration:"Duration",videoResolution:"Resolution",videoAspect:"Aspect ratio",generate:"Generate asset",generating:"Generating…",emptyTitle:"No assets yet",emptyBody:"Write a prompt on the left and press “Generate asset”. Results appear here and are saved to your project automatically.",previewImage:"Open image preview: {prompt}",previewVideo:"Open video preview: {prompt}",previewDialogTitle:"Preview: {prompt}",closePreview:"Close preview",zoomIn:"Zoom in",zoomOut:"Fit to screen",openHintImage:"Enlarge",openHintVideo:"Play",imageFallback:"Generated image",videoFallback:"Generated video",emptyCta:"Write your first prompt",errorTitle:"Generation failed",errorHint:"Check the model and API key settings, then try again.",errorDismiss:"Dismiss",savedHint:"Results are saved to your project automatically.",savedLink:"View in Assets",railTitle:"Project assets",railEmpty:"No saved assets in this project yet.",railError:"Could not load project assets.",sequence:"Sequence",candidates:"Candidates",frameAria:"Frame {n}, {rail}",addFrame:"Add",removeFrame:"Remove",deleteFrame:"Delete frame {n}"},Sw={select:"Project",unassigned:"Unassigned",new:"New project…",newPrompt:"Project name",search:"Find project…",searchPlaceholder:"Search projects",searchEmpty:"No matching project",close:"Close",saveRetry:"Retry save"},xw={title:"Sprite curator",open:"Curate",close:"Close curator",state:"Animation state",unsaved:"Unsaved changes",discardConfirm:"Discard your unsaved sprite changes?",loadError:"Could not load this sprite run.",saveError:"Could not save the curation.",bakeError:"Could not bake the sprite atlas.",exportError:"Could not export the sprite animation.",previous:"Previous frame",play:"Play",pause:"Pause",next:"Next frame",speed:"Speed",grid:"Grid",transform:"Frame transform",rotate:"Rotate",scale:"Scale",dx:"Move X",dy:"Move Y",shx:"Shear X",shy:"Shear Y",flipX:"Flip horizontally",sequence:"Sequence — play and bake order",candidates:"Candidate pool",frameAria:"Frame {n}, {rail}",addFrame:"Add",removeFrame:"Remove",deleteFrame:"Delete frame {n}",save:"Save curation",bake:"Bake atlas",contactSheet:"Contact sheet",gif:"Export GIF",status:{loading:"Loading…",ready:"Saved",saving:"Saving…",baking:"Baking…",exporting:"Exporting…",error:"Action failed"}},Aw={title:"Remove background",open:"Remove background",original:"Original",originalAlt:"Original before background removal",removed:"Background removed",previewLoading:"Preparing the removed-background preview…",resultBadge:"Background removed",keyColor:"Key color",pickHint:"Click the preview to re-pick the key color",clickMode:"Preview click action",modeErase:"Click to erase",modePick:"Pick key color",eraseHint:"Click an empty area to erase just that connected region",undoClick:"Undo click ({count})",previewAlt:"Keying preview on a checkerboard",tolerance:"Removal strength",softness:"Edge softness",spill:"Color spill cleanup",unmix:"Boundary unmix",unmixHint:"Restore semi-transparent edges (chroma keys only)",reset:"Reset",download:"Download alpha PNG",save:"Save to project",saving:"Saving…",videoSave:"Create alpha WebM",videoKeying:"Keying video… {seconds}s",videoSaved:"Alpha WebM saved to the project",saved:"Alpha PNG saved to the project",saveError:"Could not save the keyed image",loadError:"Could not load this image for keying. Close and try again.",advanced:"Fine-tune removal (advanced)"},Tw={ariaLabel:"Quick actions",animate:"Animate",edit:"Edit in canvas",useAsRef:"Use as reference",rebake:"Re-generate",refAdded:"Added as reference image",refFailed:"Could not add reference",saveToAssets:"Save to assets",savedToAssets:"Saved to assets",saveToAssetsFailed:"Could not save to assets"},Cw={title:"Assets",clearAll:"Clear all",clearConfirm:"Delete all saved assets? This cannot be undone.",testSheetsUnavailable:"Element test sheets are not available yet.",detailAria:"{name} details",searchPlaceholder:"Search assets…",allAssets:"All assets",elementLibrary:"Element library",removeFromElements:"Remove from element library",emptyElementsTitle:"No elements yet",emptyElementsBody:"Elements are reusable @-mentionable references (characters, products, styles, scenes). Save a gallery image to assets and promote it, then mention it anywhere with @.",newFolder:"New folder",kindAll:"All types",kindImage:"Images",kindVideo:"Videos",kindElement:"Elements",kindPreset:"Presets",kindTemplate:"Templates",emptyTitle:"No assets yet",emptyBody:"Nothing saved yet. Generate your first image in the Asset generation tab — results are saved here automatically.",emptySearchTitle:"No matches",emptySearchBody:"Try a different search, tag, or type filter.",emptyFolderTitle:"This folder is empty",emptyFolderBody:"Move assets here or save new results into this folder.",deleteAsset:"Remove from assets",confirmDelete:"Delete?",loadMore:"Load more",rootFolder:"Top level",renameFolder:"Rename folder",renameAsset:"Rename asset",starAsset:"Star asset",unstarAsset:"Remove asset star",deleteFolder:"Delete folder",actionFailed:"Action failed",starSaved:"Added to Assets",starSaveFailed:"Starred, but could not add to Assets",itemCount:"{count} items",emptyCta:"Open Asset generation",loadErrorTitle:"Could not load assets",loadErrorBody:"Something went wrong while loading your library.",retry:"Try again",detailClose:"Close asset details",detailKind:"Type",detailCreated:"Created",detailProvider:"Model",detailPrompt:"Prompt",detailTags:"Tags",bindingsTitle:"Provider bindings",bindingsHelp:"How this character connects to external providers.",bindingStateless:"refs per generation",bindingTagPlaceholder:"runway @tag (optional)",bindingSave:"Save binding",bindingSaving:"Saving…",bindingTagInvalid:"Tag must be 1-32 letters, numbers, underscores, or hyphens.",bindingCapWarning:"This character has {count} refs — Runway accepts at most 3 per generation.",bindingTrain:"Train Soul ID",bindingTrainLockedHint:"Requires a paid Higgsfield plan.",bindingPaidPlan:"paid plan required",bindingDriftWarning:"Refs differ from the train-time snapshot — consider retraining."},ww={name:"Node studio",toolbar:{addImage:"Add image",templates:"Templates",saveTemplate:"Save template",branch:"Branch"},empty:{title:"Build an image workflow",description:"Start with a prompt, reuse a proven graph, or continue your latest work.",blankTitle:"Start with a blank canvas",blankDescription:"Add one prompt node and shape the workflow yourself.",blankAction:"Start blank",templateTitle:"Start from a template",templateDescription:"Copy a ready-made graph for a common generation workflow.",templateAction:"Browse templates",recentTitle:"Resume recent graph",recentDescription:"Continue the most recently saved valid graph.",recentUnavailable:"No recent graph is available yet.",recentAction:"Resume recent",resumeError:"Could not open the recent graph. Try again."},elements:{ariaLabel:"Element nodes",title:"Elements",hint:"Drag or add",loading:"Loading elements…",loadError:"Could not load elements. Try again.",empty:"No saved elements yet.",addToCanvas:"Add to canvas"},elementNode:{untitled:"Untitled element",referencesOutput:"Element references output",notesOutput:"Element notes output",kind:"Element",referenceCountOne:"{count} ref",referenceCount:"{count} refs",missing:"This element was deleted. Reconnect it before running."},elementController:{onlyElements:"Only element assets can be added to the canvas.",invalid:"The element node is invalid.",addError:"Could not add the element to the canvas."},branch:{defaultVariant:"Variant {index}",eyebrow:"Branch workflow",title:"Create variants",close:"Close branch dialog",variantLegend:"Variant {index}",label:"Label",provider:"Provider",modelOverride:"Model override",currentModel:"Use current model",sizeOverride:"Size override",currentSize:"Use current size",remove:"Remove",add:"Add variant",cancel:"Cancel",create:"Create branches",selectSourceError:"Select one connected source node.",applyError:"The branch could not be applied, so the graph was left unchanged."},templates:{previewAria:"{name} graph preview",nodeCountOne:"{count} node",nodeCount:"{count} nodes",outputCountOne:"{count} output",outputCount:"{count} outputs",rename:"Rename",delete:"Delete",deleteConfirm:"Delete template “{name}”? This cannot be undone.",title:"Choose a template",close:"Close templates",searchLabel:"Search templates",searchPlaceholder:"Name or tag",loading:"Loading templates…",empty:"No templates match “{query}”.",starter:"Starter templates",yours:"Your templates",cancel:"Cancel",copy:"Make a copy",loadError:"Could not load templates. Try again.",replaceConfirm:"Replace the current graph with a copy of this template?",invalidGraph:"The template graph is invalid.",copyError:"Could not copy the template.",namePrompt:"Template name",saved:"Template saved.",saveError:"Could not save the template.",renamePrompt:"Rename template",renameError:"Could not rename the template.",deleteError:"Could not delete the template."},palette:{ariaLabel:"Insert node command",compatiblePlaceholder:"Compatible with {portType}",searchPlaceholder:"Search nodes",filter:"Showing nodes that accept {portType}.",emptyCompatible:"No node accepts {portType}.",emptySearch:"No nodes match this search.",commandsAria:"Node commands",categories:{input:"Input",generate:"Generate",transform:"Transform",reference:"Reference",output:"Output"}},commands:{"image-generate":{label:"Image generation",description:"Add an image node to the workflow."}},portTypes:{prompt:"prompt",image:"image",images:"images",video:"video",mask:"mask","element-refs":"element references","element-notes":"element notes",settings:"settings","any-media":"any media"},compatibility:{sameDirection:"Connect an output port to an input port.",typeMismatch:"Those port types are not compatible.",cardinality:"That input already has a connection.",selfEdge:"A node cannot connect to itself.",duplicateEdge:"That connection already exists.",unknownPort:"This port is not available for connections.",cycle:"That connection would create a loop."}},Iw={tabs:{label:"Asset workflow",generate:"Generate",sprite:"Sprites"},title:"Sprite recipes",lede:"Lock one character anchor, then generate consistent animation rows.",loading:"Loading sprite recipes…",loadError:"Could not load recipes.",retry:"Retry",empty:{title:"Create a sprite recipe",body:"Define the character, cell geometry, and animation states.",create:"Create recipe"},recipe:{select:"Recipe",new:"New recipe",name:"Recipe name",characterId:"Character ID",description:"Description",style:"Style",baseAssetId:"Base image asset",baseAsset:"Base image asset",save:"Save recipe",saving:"Saving…",unsaved:"Save changes before generating."},cell:{title:"Cell geometry",width:"Width",height:"Height",safeMarginX:"Horizontal margin",safeMarginY:"Vertical margin"},chroma:{title:"Chroma key",hex:"Chroma color"},states:{title:"Animation states",add:"Add state",remove:"Remove",key:"State key",frames:"Frames",fps:"FPS",loop:"Loop",action:"Action"},anchor:{title:"Identity anchor",missing:"Generate and approve an idle pose before rows.",generate:"Generate idle candidate",generating:"Generating…",candidate:"Candidate ready for review.",regenerate:"Regen",approve:"Approve anchor",approved:"Anchor approved",replace:"Replace anchor",confirmTitle:"Approve this identity anchor?",confirmBody:"Future rows will reuse this identity; the base image will not be attached again.",confirm:"Approve",cancel:"Cancel"},rows:{title:"Sprite rows",generateAll:"Generate all",generateSelected:"Generate selected",regenerate:"Retry row",cancel:"Cancel",preview:"Preview",anchorRequired:"Approve the anchor first.",saveRequired:"Save recipe changes first.",status:{pending:"Pending",queued:"Queued",running:"Running",complete:"Complete",error:"Error",canceled:"Canceled"}},error:{INVALID_SPRITE_RECIPE:"Complete the required recipe fields.",ANCHOR_NOT_APPROVED:"Approve the identity anchor first.",BASE_REFERENCE_FORBIDDEN:"The base image cannot be reused after approval.",GENERATION_CANCELED:"Generation was canceled.",generic:"Sprite generation failed."}},Ew={undone:"Undid the last graph change.",redone:"Redid the graph change."},Rw={t2i:"Text → Image",i2i:"Image edit",t2v:"Text → Video",i2v:"Image → Video",v2v:"Video continuation"},Nw={title:"Element",titleEdit:"Edit element",titleNew:"New element",saved:"Saved",ariaLabel:"Element details",name:"Name",namePlaceholder:"e.g. Walnut chair",kind:"Kind",kindCharacter:"Character",kindProduct:"Product",kindStyle:"Style",kindScene:"Scene",kindReference:"Reference",selected:"Selected elements",mentionAria:"{name}, {kind} element",unavailableAria:"{name}, unavailable element",removeAria:"Remove {name} element",helpCharacter:"A person or recurring subject.",helpProduct:"A product with consistent design details.",helpStyle:"A visual language, material, or treatment.",helpScene:"A place, setting, or recurring environment.",notes:"Notes",notesHelp:"Describe appearance, materials, and details that should stay consistent.",notesPlaceholder:"Warm walnut grain, rounded edges, woven cane seat…",remaining:"{n} remaining",strength:"Reference strength",strengthHelp:"How strongly generated work should follow these references.",resetDefault:"Reset to default",saving:"Saving…",save:"Save element",testing:"Generating test sheet…",runTest:"Run test sheet",delete:"Delete",errorName:"Name your element before saving.",errorRefs:"Add at least one reference image before saving.",refsTitle:"Reference images",refsHelp:"Drag to set order. The first image is the representative thumbnail.",refAlt:"Reference {n}",refPrimary:"Representative",refLabel:"Label",refLabelPlaceholder:"Front, side, material…",refMoveUp:"Move reference {n} up",refMoveDown:"Move reference {n} down",refRemove:"Remove",refRemoved:"Reference removed.",refUndo:"Undo"},kw={common:TC,appBar:CC,sheet:wC,toast:IC,inflight:EC,size:RC,sizeConfirm:NC,quality:kC,moderation:_C,format:MC,count:PC,multimode:LC,metadata:OC,onboarding:jC,readiness:GC,generate:DC,home:FC,billing:zC,history:qC,panel:UC,prompt:HC,canvas:BC,gallery:VC,node:KC,nodeBatch:$C,edge:YC,provider:XC,mcp:QC,grokMode:JC,cost:WC,result:ZC,session:ew,uiMode:tw,agent:nw,cardNews:aw,video:ow,sidebar:rw,settings:iw,nodeCanvas:lw,apiDisabled:sw,language:cw,errorCard:dw,promptLibrary:uw,promptBuilder:mw,workspace:pw,viewer:fw,generationLog:gw,clipboard:hw,modal:yw,nav:vw,assetGen:bw,project:Sw,spriteCurator:xw,keying:Aw,chain:Tw,assets:Cw,"assets.clearAll":"Clear all","assets.clearConfirm":"Delete all saved assets? This cannot be undone.",nodeStudio:ww,sprite:Iw,graph:Ew,provenance:Rw,element:Nw},_w={ok:"確定",cancel:"取消",delete:"刪除",close:"關閉",saving:"儲存...",loading:"載入中...",dismiss:"關閉通知",generating:"生成…",imageCollection:"{n} 影像集",remove:"移除",removeNamed:"刪除 {name}",elementSuggestions:"元素建議",noMatchingElements:"沒有符合的元素",enterPrompt:"輸入提示...",continuity:"連續性",activePrompt:"主動提示",elementUnavailable:"元素不可用",spritePreview:"精靈動畫預覽",canvasMemo:"畫布備忘錄",cardDeck:"卡牌組"},Mw={modeImage:"影像",settings:"設定",controls:"發電控制",generate:"產生",generateAria:"開啟提示表產生圖像"},Pw={close:"關閉提示表",generate:"產生影像",controlsOpen:"開放式發電控制",tabs:{prompt:"提示詞",controls:"控制",library:"圖書館"}},Lw={localImportSuccess:"圖像已新增至圖庫",localImportFailed:"匯入圖片失敗",localImportInvalid:"僅支援 PNG、JPEG 或 WebP",localStorageFull:"本機儲存已滿 - 最近的狀態可能不會持續。",refLimitExceeded:"參考文獻上限為 5。多餘的圖像被刪除。",minimaxModelRequiresReference:"image-01-live 需要中國境外的參考影像。附上一個,或切換到 image-01。",refLimitTrayFull:"參考托盤已滿 ({max})。使用 X 刪除項目以附加更多 — 已刪除的 @tags 可以使用 @ 重新提及。",refLimitPartial:"僅新增了 {total} 影像中的 {added}(限制 {max})。",refOverProviderLimit:"此提供者最多接受 {max} 參考影像。刪除 {excess} 來產生。",refTooLarge:"圖片太大。轉換為 JPEG/PNG 或降低解析度並重試。",refNotBase64:"圖像檔案已損壞或使用了不支援的編碼。",refEmpty:"空圖像檔。請選擇不同的文件。",refHeicUnsupported:"不支援 HEIC/HEIF。轉換為 JPEG 或 PNG 並重試。",noCurrentImageForRef:"沒有當前圖像可用作參考。",refSlotFull:"參考槽已滿(最多 5 個)。",currentImageLoadFailed:"無法載入目前圖像。",addedCurrentAsRef:"新增目前影像作為參考。",sessionLoadFailed:"無法載入會話。",sessionCreateFailed:"建立會話失敗。",sessionRenameFailed:"無法重命名會話。",sessionDeleteFailed:"刪除會話失敗。",promptRequired:"輸入提示。",missingElements:"缺少選定的元素。在生成之前將其刪除或重新添加元素。",nodeCreated:"Node {id} 建立 ({elapsed}s)",nodeRootCreated:"從該映像建立第一個 node 。",animateStarted:"將圖像動畫化為影片...",animateProgress:"渲染影片…{n}%",animateDone:"影片準備好了。檢查你的歷史記錄。",animateFailed:"視訊生成失敗。",nodeCreateFailed:"Node 產生失敗。",generatedBatch:"在 {elapsed}s 中產生 {count} 影像。",generatedSingle:"在 {elapsed}s 中產生。",generateFailed:"一代失敗。",sessionReloadedElsewhere:"圖表版本發生變化,因此重新載入最新圖表。",promptCopied:"提示已複製",metadataCopied:"已複製",imageCopied:"已複製到剪貼簿",frameCopied:"幀已複製到剪貼簿",copyFailed:"複製失敗",openGeneratedDirFailed:"無法打開圖像資料夾。運行ima2 doctor檢查儲存路徑。",openGeneratedDirOpened:"打開生成的圖像資料夾。",noPromptToFork:"沒有提示分叉",forkStarted:"提示導入。再次編輯並產生。",forkStartedNoPrompt:"附上圖片作為參考。輸入提示並產生。",continueAsUrlStarted:"提供者 URL 設定為參考。生成以使用原始圖像。",continueAsUrlExpired:"提供者 URL 已過期。請改用此處繼續。",comfyExported:"以 {filename} 發送到 ComfyUI。",comfyExportInvalidUrl:"ComfyUI URL 必須是本地 HTTP 位址。",comfyExportInvalidImage:"此儲存的影像無法傳送至 ComfyUI。",comfyExportImageNotFound:"未找到已儲存的影像檔案。",comfyExportFailed:"無法將映像上傳到 ComfyUI。",cancelFailed:"無法取消生成。",errorClass:{rateLimited:"請求過於頻繁,請稍後再試。",providerTimeout:"服務商回應逾時,請稍後再試。",networkFailure:"無法連線至服務商。請檢查網路後重試。",contentRejected:"服務商拒絕了該提示詞,請修改後重試。",capabilityUnsupported:"目前服務商不支援此請求。",modelUnavailable:"所選模型暫時無法使用。",internalState:"內部狀態異常,請重新載入頁面。"}},Ow={queued:"排隊",planning:"規劃",streaming:"產生",decoding:"敲定",canceling:"取消",noPrompt:"無提示",cancelAria:"取消產生:{prompt}",title:"飛行中",badgeOpen:"顯示飛行中的 {n} 代",badgeClose:"隱藏飛行中的 {n} 代",inlineCollapse:"崩潰飛行中的 {n} 代",footerHint:"您可以關閉此面板——生成會繼續。",kindImage:"影像",kindVideo:"影片",kindNode:"節點",kindMcp:"MCP",progressAria:"產生進度:{n}%"},jw={title:"尺寸",grokAspectTitle:"縱橫比",grokResolutionTitle:"解析度",width:"寬度",height:"高度",hint:"16px 步長,最大邊緣 3840,比例高達 3:1,655K–829M 像素",autoLabel:"自動",autoSub:"型號選擇",customLabel:"自訂",customSub:"自由形式",customPlus:"+ 客製化",customSlots:"保存的尺寸",customSlot:"自訂",customSlotLimit:"最多 3 種自訂尺寸",saveCustomSlot:"儲存自訂尺寸",replaceCustomSlot:"更換插槽",ratioFree:"自由比例",ratio21x9:"21:9",normalizedPreview:"會發送",noAdjustment:"無需調整",squareMaxHint:"由於 829 萬像素限制,平方最大值為 {size}。",adjustedReasons:{snap:"捕捉到 16 像素",maxEdge:"最大邊緣",ratio:"比率限制",minPixels:"最小像素",maxPixels:"最大像素",min:"最小邊緣",max:"最大邊緣",pixels:"像素限制"}},Gw={title:"需要調整尺寸",body:"請求的大小超出了圖像生成限制。",requested:"要求尺寸",adjusted:"調整後的尺寸",approve:"批准並生成",cancel:"取消",reasonRatio:"該比例超出了 3:1 的限制。",reasonPixels:"超出了最大像素限制。",reasonMinPixels:"請求的圖像像素太少。",reasonMin:"尺寸低於最小值。",reasonMax:"大小超過最大值。",reasonSnap:"尺寸必須以 16 像素為增量對齊。"},Dw={title:"品質",grokTitle:"Grok 質量",grokModelTitle:"模型",lowLabel:"低",lowSub:"快速",mediumLabel:"中",mediumSub:"均衡",highLabel:"高",highSub:"最佳"},Fw={title:"內容審查",autoLabel:"自動",autoSub:"標準安全篩選器",lowLabel:"低",lowSub:"較寬鬆的篩選器",explain:"自動使用標準安全篩選器;低模式會放寬限制,因此部分邊界提示詞可能會通過。"},zw={title:"格式"},qw={title:"數數",customPlus:"+n",customLabel:"自訂計數",highCountHint:"對於參考或高品質的計數,較高的計數可能需要更長的時間。",minMaxHint:"使用 1-24 張影像。",decrease:"減少計數",increase:"增加計數"},Uw={label:"序列",tooltip:"用一個提示詞生成多個階段",shortHint:"規劃中的階段",maxStages:"最多階段數",highCountHint:"較高的階段數可能需要幾分鐘的時間。",minMaxHint:"使用 1-24 級。",composerBadge:"序列·共 {count} 段",composerAriaLabel:"序列提示編輯器,最多 {count} 個階段",promptPlaceholder:"描述要生成的階段;關閉序列後搭配數量,可批次生成相同提示詞。",promptPlaceholderWithRefs:"使用所附參考文獻描述分階段順序。",toggleDisabledGenerating:"等待當前一代完成",sequenceTitle:"序列結果",sequenceProgress:"{returned}/{requested} 影像",stageLabel:"階段{index}",generating:"生成...",partialAlt:"部分多模式預覽",partial:"在 {elapsed}s 中產生 {returned}/{requested} 影像。",complete:"在 {elapsed}s 中產生 {returned}/{requested} 影像。",notReturned:"未退回",empty:"沒有返回圖像",error:"生成失敗",canceled:"取消",cancel:"取消"},Hw={restoreTitle:"恢復影像設定",restoreBody:"此影像包含 ima2 生成元資料。應用其提示和設置,或僅將其附加作為參考。",applySettings:"應用程式設定",useAsReferenceOnly:"僅供參考",noMetadata:"未找到 ima2 元資料。",invalidMetadata:"圖像元資料無效。",unsupportedFormat:"僅可恢復 PNG、JPEG 和 WebP 元資料。",readFailed:"無法讀取影像元資料。",applied:"影像設定已恢復。",sourceXmp:"XMP",sourcePngComment:"PNG 評論",imageAlt:"放置影像預覽",prompt:"提示詞",size:"尺寸",quality:"品質",model:"模型",source:"來源",title:"生成詳情",asset:"資產",summary:"生成摘要",copy:"複製",copyRaw:"複製原始 JSON",copyField:"複製 {label}",rawJson:"原始元資料 JSON",sections:{provider:"供應商和型號",settings:"產生設定",usage:"用量與時間",lineage:"來源鏈",video:"影片",videoContinuity:"視訊連續性",prompts:"提示"},fields:{provider:"提供者",authPath:"認證路徑",model:"模型",providerUrl:"提供者 URL",requestId:"請求ID",quality:"品質",size:"尺寸",format:"格式",moderation:"內容審查",reasoning:"推理",promptMode:"提示方式",kind:"種類",mediaType:"媒體類型",elapsed:"耗時",tokens:"代幣",totalTokens:"代幣總數",inputTokens:"輸入",cachedTokens:"快取",outputTokens:"輸出",reasoningTokens:"推理",webSearchCalls:"網路搜尋",grokCostTicks:"Grok 成本刻度",usage:"用量",filename:"檔案名稱",createdAt:"建立時間",sessionId:"工作階段",nodeId:"節點",parentNodeId:"父級 node",clientNodeId:"客戶端 node",refsCount:"參考",sequence:"順序",setId:"批次",cardId:"卡片",videoDuration:"影片時長",videoResolution:"影片解析度",videoAspectRatio:"縱橫比",videoRequestedModel:"要求的型號",videoEffectiveModel:"有效模式",videoModelFallback:"模型後備",xaiVideoRequestId:"xAI 視訊請求",sourceImageFilename:"來源圖片",lineageId:"來源鏈 ID",parentFilename:"父項檔案",sourceFrame:"來源影格",continuityEntries:"連續性項目",latestContinuityPrompt:"最新連續性提示",promptPrimary:"提示詞",userPrompt:"使用者提示",prompt:"儲存提示",revisedPrompt:"修改提示",composerPrompt:"作曲家提示",insertedPrompts:"插入的提示"}},Bw={title:"你好!第一次來這裡?",body:"登入以開始產生。您可以連接 ChatGPT、Grok 或 Gemini。",login:"是的,讓我登入",skip:"我自己設定一下"},Vw={title:"生成準備狀態",open:"檢查準備狀況",openTitle:"檢查提供者、身份驗證、模型和網路搜尋準備情況",settingsTitle:"生成準備狀態",settingsBody:"開啟一個包含提供者、身份驗證、模型、推理和網路搜尋狀態的緊湊彈出視窗。",ready:"準備生成",readyBody:"所選提供者可用。",blocked:"提供者需要關注",provider:"提供者",model:"模型",reasoning:"推理",webSearch:"網頁搜尋",grokApi:"Grok API",grokApiBody:"透過捆綁的 progrok 運作:強制搜尋、Grok 4.5 英語圖像和文字工具規劃,然後是 xAI Images API。附加參考使用 xAI 影像編輯,因此保留了 i2i 上下文。",openAccount:"開設帳戶設置"},Kw={button:"產生",buttonLoading:"生成({n})"},$w={recentTitle:"最近的工作",selectedCount:"已選擇 {count}",selectedPresets:"選定的預設",referenceTrayCount:"{count} 參考文獻",referenceTrayAria:"{count} 引用附加到下一代",viewAll:"看全部",heroTitle:"從滿意的那一張,繼續展開。",heroLede:"在本機生成、編輯、讓畫面動起來。不主動傳送,就不會離開這台機器。",lanesReady:"{total} 條生成通道中 {ready} 條就緒",lanesNone:"尚無就緒通道 — 請在設定中連接",modesTitle:"工作區",modeCreateHint:"生成並打磨單張圖像",modeNodeHint:"把一個結果分成多個方向",modeAgentHint:"說明需求,交給智慧代理執行",modeAssetsHint:"收藏並重複使用你的成果",untitledResult:"未命名結果",recentResultAlt:"最近結果:{prompt}",mediaUnavailable:"無法顯示預覽"},Yw={label:"API 狀態",checking:"檢查...",offline:"離線",remaining:"剩餘 ${remaining}",thisMonth:"本月 ${amount}",oauthFree:"GPT OAuth · 透過 codex 免費",apiDisabled:"API 密鑰準備就緒",apiReady:"API 密鑰準備就緒",oauthMode:"GPT OAuth 模式"},Xw={openGalleryAria:"打開畫廊",openGalleryTitle:"打開完整畫廊",openGalleryShort:"全部",galleryCard:"打開畫廊",recentTitle:"最近幾代人",collapseRecent:"崩潰最近幾代",expandRecent:"擴展最近幾代",collapseRecentShort:"隱藏",expandRecentShort:"展示",emptyRecent:"生成的圖像將出現在此。",generatingCollection:"正在產生 {count} 圖片...",selectRecent:"選擇生成的圖像",deleteImageAria:"從歷史記錄中刪除影像",deleteSequenceAria:"刪除 {count}-影像序列",deleteSequenceConfirm:"刪除此多模式序列中的所有 {count} 影像?",sequenceDeleted:"從歷史記錄中刪除了 {count} 序列影像"},Qw={closeSettings:"關閉設定",detailSettings:"設定",toggleShow:"顯示設定",toggleHide:"隱藏設定",open:"打開",close:"關閉"},Jw={label:"提示詞",refCount:"參考 {count}/{max}",trayAria:"參考托盤,{max} 的 {count}",deadTagHint:"標籤已從托盤上移除 — 僅供參考",deadTagStatus:"提示中不可用的引用:{tags}",refChipTitle:"參考 {n}",refChipAlt:"參考 {n}",refRemoveAria:"刪除引用 {n}",placeholder:"描述您想要的圖像。拖放或貼上以附加參考圖像...",placeholderWithRefs:"描述如何處理所附圖片...",attach:"附",attachTitle:"附上參考圖片",useCurrent:"使用電流",useCurrentTitle:"使用目前結果作為參考",continue:"繼續",continueTitle:"從目前結果繼續作為參考",savePrompt:"節省",storyboard:"故事板",storyboardTitle:"啟用故事板模式 - 在連續幀之間保持角色和場景的連續性",videoToggleTitle:"切換視訊模式 (Grok 1.5)",directMode:"直接的",directModeActive:"1:1直接上",directModeTitle:"逐字傳遞提示(直接模式)",urlRefActive:"URL 參考",urlRefActiveTitle:"提供者 URL 引用處於活動狀態,將用於取代附加的圖像引用。單擊以清除。",urlRefClear:"清除提供者 URL 參考",moveBlockUp:"將 {name} 向上移動",moveBlockDown:"向下移動 {name}",afterBlocks:"主提示後",hint:"Ctrl+Enter 生成",dropHere:"拖曳到附件作為參考(最多 {max})"},Ww={modeTitle:"畫布模式",resultAlt:"結果",imageViewerAria:"生成的圖像檢視器。使用左右箭頭鍵在影像之間移動。",tokens:"{n} 代幣",open:"打開畫布",openAria:"以畫布模式開啟圖像",dragToComposer:"拖曳到作曲家作為參考",dragHint:"拖",annotationInstructionsChip:"畫布筆記",close:"關閉畫布",blank:{title:"空白畫布",subtitle:"在白紙上畫草圖,然後繼續。",create:"建立空白畫布",creating:"創造...",failed:"無法建立空白畫布"},drop:{hint:"拖放圖像以添加到圖庫"},toolbar:{label:"畫布註釋工具",select:"選擇",bgGroup:"出口背景",bgAlpha:"阿爾法",bgMatte:"霧面的",bgMatteColor:"霧面色",cleanup:"乾淨的背景",cleanupMark:"標記",cleanupRemove:"消除",cleanupPreserve:"儲存",cleanupInput:"輸入",cleanupClick:"點選",cleanupBrush:"刷子",cleanupBrushSize:"刷子",cleanupTolerance:"寬容",cleanupAutoSample:"角球",cleanupPickSeed:"採摘種子",cleanupPickingSeed:"點選背景",cleanupActive:"已啟用",cleanupPreview:"預覽",cleanupPreviewing:"正在預覽...",cleanupApply:"申請 PNG",cleanupApplying:"正在申請...",cleanupReset:"重置",cleanupSeedCount:"{n} 種子",cleanupRemoved:"{n}% 已刪除",cleanupPickHint:"點擊圖像上的背景",cleanupBrushHint:"繪製要標記的區域",cleanupMaskHint:"紫色面具將被移除",cleanupApplied:"已建立透明 PNG",cleanupFailed:"後台清理失敗",zoomGroup:"畫布縮放",zoomIn:"放大",zoomOut:"縮小",zoomReset:"重設變焦",zoomShortcutHint:"雙指縮放·兩指平移·[ / ]·0",pen:"筆",box:"盒子",arrow:"箭",memo:"便籤紙",eraser:"橡皮",eraserMenu:"橡皮擦選項",objectEraser:"物體橡皮擦",brushEraser:"刷子橡皮擦",apply:"儲存畫布版本",applyDone:"畫布版本已儲存",applyFailed:"無法儲存畫布版本",export:"匯出圖片",exporting:"出口...",exportFailed:"匯出失敗",undo:"撤銷",redo:"重做",deleteSelected:"刪除所選內容",editMask:"編輯盒裝區域",editMaskDisabled:"先畫一個盒子",editMaskFailed:"屏蔽編輯失敗",editMaskUnsupported:"目前圖像提供者不支援蒙版編輯",style:"風格",color:"顏色",strokeWidth:"筆觸寬度",clear:"全部清除",exportFormat:"導出格式",exportAs:{png:"PNG 影像",svg:"SVG 向量",pptx:"PowerPoint 投影片"}},version:{saving:"正在儲存畫布版本...",saved:"畫布版本已儲存",failed:"無法儲存畫布版本",usingAsReference:"Canvas版本已準備好作為參考"},revert:{action:"恢復烘焙筆記",mixedConfirm:"此版本還包含像素編輯。恢復烘焙筆記將丟棄這些像素編輯。繼續?",restored:"烘焙筆記恢復為可編輯草稿",completed:"烘焙筆記和像素編輯已恢復",failed:"無法恢復烘焙筆記"}},Zw={today:"今天",yesterday:"昨天",thisWeek:"本星期",earlier:"早些時候",imageAltFallback:"生成的圖像",deleteTitle:"移至系統垃圾箱",deleteAria:"刪除影像",ariaLabel:"圖片庫",title:"畫廊",total:"{n} 總計",totalFiltered:"/ {n} 總計",sortByAria:"排序方式",sortByDate:"日期",sortBySession:"工作階段",favoriteFilterAria:"最喜歡的過濾器",filterAll:"全部",filterFavorites:"收藏夾",searchPlaceholder:"搜尋提示或檔案名稱",searchDisabledPlaceholder:"在會話視圖中停用搜尋",closeAria:"關閉畫廊",closeTitle:"關閉(Esc)",sessionLabel:"會話 {name}",standalone:"獨立影像",emptySessions:"尚未保存任何會話。",emptyAll:"還沒有圖像。先創建一個。",emptyFavorites:"還沒有最喜歡的圖像。",noResults:"沒有結果。",loadOlder:"加載較舊的",loadingOlder:"正在加載較舊的...",loadOlderFavorites:"加載較舊的收藏夾",loadingOlderFavorites:"正在加載舊的收藏夾...",sessionPaginationHint:"會話視圖使用目前頁面。切換到日期視圖以載入舊圖像。",sessionLoading:"正在載入會話組...",sessionLoadFailed:"無法載入會話組。",sessionLimitNotice:"顯示最新的 {count} 項目。較舊的項目不包含在會話視圖中。",retry:"重試",loadOlderFailed:"無法載入舊的畫廊項目。",storageNoticeTitle:"保管須知",storageNoticeRecoverable:"抱歉嚇到了。最新版本將圖庫資料夾從已安裝的套件移至使用者資料資料夾。您的舊圖像可能仍在先前生成的資料夾中。運行 ima2 doctor 或開啟恢復指南。",storageNoticeNotFound:"抱歉嚇到了。我們在這台機器上找不到以前產生的資料夾。如果在更新過程中取代了舊的全域安裝資料夾,則可能無法自動復原。運行 ima2 doctor 並查看恢復指南以了解手動搜尋步驟。",storageNoticeUnknown:"無法檢查儲存狀態。如果更新後圖庫看起來是空的,請執行 ima2 doctor 檢查映像資料夾。",openGeneratedDir:"打開資料夾",openGeneratedDirTitle:"打開生成的圖像資料夾",cardNewsSet:"卡新聞集",cardNewsCard:"卡新聞卡",openCardNewsSet:"開集",openCardNewsSetFailed:"無法打開卡片新聞集。",copyCardNewsSetPath:"複製路徑",cardNewsPathCopied:"卡新聞設定路徑已複製。",downloadCardNewsManifest:"顯現",cardNewsCount:"{n} 卡",deleted:"已刪除:{filename}",undo:"撤銷",secondsSuffix:"{n}s",permanentDeleted:"永久刪除:{filename}",movedToSystemTrash:"移至系統垃圾箱:{filename}",deleteFailed:"無法刪除影像。",restoreFailed:"無法恢復影像。",favoriteTitle:"加入收藏夾",unfavoriteTitle:"從收藏夾中刪除",favoriteAria:"加入收藏夾",unfavoriteAria:"從收藏夾中刪除",favoriteFailed:"無法更新收藏夾",scopeAria:"畫廊範圍",scope:{current:"目前會話",all:"所有圖片"},empty:{currentSession:"此會話中還沒有圖像。"}},eI={empty:"空的",elementMissing:"元素“{name}”已刪除。運行前重新連線。",pending:"產生",reconciling:"正在同步",reconcilingPhase:"正在同步·{phase}",ready:"完成 · {elapsed}s",readyWithSearch:"完成·{elapsed}s·搜尋{searches}",stale:"陳舊",staleWithError:"陳舊:{error}",assetMissing:"資產失蹤",assetMissingWithError:"資產缺失:{error}",error:"錯誤:{error}",errorUnknown:"未知",nodeImageAlt:"Node 影像",partialImageAlt:"部分node影像預覽",noAsset:"沒有資產",stateStale:"狀態陳舊",noImage:"無影像",editPromptPlaceholder:"編輯提示...",promptPlaceholder:"提示詞...",regenerate:"雷根",newVariation:"新版本",generate:"根",generateTitle:"產生 node 影像",addChild:"孩子",addChildTitle:"新增子項 node",duplicateBranch:"分支",duplicateBranchTitle:"複製為新的分支根",deleteTitle:"刪除",regenerateTitle:"就地重新產生 node",newVariationTitle:"在同一父項下建立一個新的同級變體",parentImageRequired:"首先生成父圖像。",attachRef:"附",attachRefTitle:"附上 node 參考影像",refAlt:"Node 參考 {n}",removeRef:"刪除引用 {n}",dropRefs:"將圖像拖放到此處",nodeRefsUnsupportedForEdit:"目前僅根節點支援額外引用。",nodeRefsUsedWithParent:"與父圖像一起使用。",classicRefsParkedTitle:"經典參考已停放",classicRefsParkedBody:"這些圖像屬於經典作曲家,在 node 模式下處於非活動狀態。",clearParkedRefs:"清除停放的參考",retry:"重試",retryTitle:"重試這個 node 的生成",errorAuthCta:"檢查您的帳戶或 API 金鑰,然後重新產生。",errorFixCta:"調整提示或引用,然後再次產生。"},tI={selectionOn:"選擇",selectionOff:"選擇",selectAll:"選擇全部",summary:"{selected} 已選擇 · {missing} 缺失 · {stale} 受影響",generateMissing:"生成缺失",regenerateSelected:"重新產生選定的",stopRemaining:"停止剩餘",stopping:"停止",clear:"清除",noneSelected:"未選擇節點。",parentRequired:"{count} 選擇的 node 首先需要準備好父映像。",nothingToRun:"沒有選定的節點需要產生。",stopQueued:"目前的 node 將完成,然後剩餘的佇列將停止。",failed:"在 {done}/{total} node(s) 之後停止。",finished:"已完成 {done}/{total} node(s)。",staleBecauseParentChanged:"重新產生了上游 node ;需要時刷新此 node 。",cycleBlocked:"無法運作:{count} 選擇的 node 形成循環。",partialFinished:"已完成 {done}/{total} — {failed} 失敗,{skipped} 已跳過。"},nI={disconnect:"斷開",disconnectTitle:"斷開選定的邊",disconnected:"連線已移除。",parentConflict:"node 只能有一個父連結。",cycleBlocked:"該連接會形成一個循環。"},aI={authTitle:"提供者",apiLabel:"API 密鑰",statusReady:"可用",statusConnected:"已連接",statusAuthRequired:"需要登入",statusDisconnected:"已斷開連接",statusLineTitle:"狀態",authMethodTitle:"授權",authActive:"已啟用",oauthNotReady:"GPT OAuth 代理程式尚未準備好。",codexLoginRequired:"需要 Codex 登入。",codexLoginHint:"在終端機中執行 `codex login`,然後刷新此頁面。",oauthStarting:"GPT OAuth 代理程式正在啟動。幾秒鐘後重試。",serverUnreachable:"無法到達伺服器。確保後端正在運作。",apiInvalid:"API 密鑰遺失或無效。檢查伺服器.env 中的 OPENAI_API_KEY。",grokOffline:"Grok 代理程式未運作。",grokNoImageModel:"找不到 Grok 影像生成模型。",grokNotReady:"Grok 不可用。",grokOfflineHint:"如果需要,執行 `ima2 grok login` 一次,然後啟動 `ima2 serve`; ima2 自動啟動捆綁的 Grok 代理程式。",grokManagedByIma2:"Grok 透過位於 127.0.0.1:18645 的捆綁 progrok 代理程式在 `ima2 serve` 內部本地運行。",grokClassicOnly:"Grok 影像產生在此表面中不可用。",grokClassicOnlyHint:"使用啟用了 Grok 的生成表面。",grokCompatTitle:"Grok 影像 API",grokCompatBody:"ima2 服務在 127.0.0.1:18645 管理捆綁的 progrok 代理。 Grok 始終在圖像生成之前進行搜索,將附加引用發送到 Grok 4.5 規劃器中,透過 xAI 圖像編輯保留它們,並將大小映射到 xAI 寬高比/分辨率。輸出格式、審核和推理僅是 OpenAI 提供者設定。",settingsBody:"選擇下一代請求使用哪個提供者。",availableTitle:"{name} 可用",availableAria:"{name}:可用",unavailableAria:"{name}:不可用",availableSr:"(可用的)",unavailableSr:"(不可用)",xaiApiKeyRequired:"需要 xAI API 密鑰",geminiApiKeyRequired:"Gemini API 需要密鑰",atlasCloudApiKeyRequired:"Atlas Cloud 需要 API 金鑰",minimaxApiKeyRequired:"MiniMax API 需要密鑰",comingSoon:"即將推出",agyCompatTitle:"Gemini (agy)",agyCompatBody:"1024x1024 固定,JPEG 輸出,最多 3 個參考。沒有品質/尺寸控制。",agyCompatBodyLong:"1024x1024 固定輸出,JPEG 格式,最多 3 個參考影像。沒有網絡搜索,沒有品質/尺寸控制。",geminiApiCompatTitle:"Gemini API",geminiApiCompatBody:"Google Gemini API。支援從 512px 到 4K 的寬高比和解析度控制。",geminiApiCompatBodyLong:"Google Gemini API 直接。支援 nano-banana-2 (Flash) 和 nano-banana-pro (Pro),寬高比和解析度控制範圍為 512px 至 4K。",gptCompatTitle:"GPT Image",gptCompatBody:"OpenAI 透過回應 API 產生影像。支援品質、大小、格式、審核和網路搜尋設定。"},oI={connectionsTitle:"MCP 提供者連接",connectionsBody:"連接官方提供者帳戶並查看工具狀態。只有連線的提供者才會出現在產生選擇器中。",providerLabel:"發電商",modelLabel:"生成模型",coreProviders:"核心提供者",connectedProviders:"連接的 MCP 供應商",imageModels:"影像模型",videoModels:"視訊模型",chooseModel:"選擇型號",loadingModels:"載入模型",loadingProviders:"檢查連接",providersLoadFailed:"無法載入 MCP 提供者狀態。",modelsLoadFailed:"模型載入失敗 — 點選重試",retryModels:"重試",noModels:"沒有適用於此模式的型號。",refreshingConnection:"清爽…",exitLane:"使用核心提供者",modelSectionTitle:"模型",ratioAutoHelp:"自動讓模型選擇自己的縱橫比。某些型號可能會拒絕預設。",aspectRatioLabel:"縱橫比",durationLabel:"時長",resolutionLabel:"解析度",qualityLabel:"品質",modeLabel:"模式",audioLabel:"聲音的",onLabel:"在",offLabel:"離開",toolInputsLabel:"參考媒體",referenceNone:"沒有任何",referenceSelect:"從畫廊中選擇",referenceCurrent:"目前畫廊項目",referenceMissing:"不在載入的歷史記錄中",startFrameLabel:"起始畫面",endFrameLabel:"結束框架",endFrameNeedsStart:"首先選擇一個起始幀。",imageReferencesLabel:"圖片參考(最多 3 張)",imageReferenceAria:"圖片參考{index}",referenceTagAria:"影像參考標籤 {index}",referenceTagPlaceholder:"可選標籤",referenceTagInvalid:"使用 1-32 個字母、數字、底線或連字號作為標籤。",referenceAttachLocal:"附上本地圖片",referenceAttachHelp:"本機影像暫時上傳,並在產生穩定後刪除。",referenceLocalFallback:"本地圖片",referenceLocalInvalidType:"選擇 PNG、JPEG 或 WebP 影像。",referenceLocalReadFailed:"無法讀取該影像。再選擇一次。",referenceSource:{asset:"資產",element:"元素",local:"本地附件"},videoReferenceLabel:"影片參考",videoReferenceCostNote:"使用視訊參考可能會增加提供者費用。",advancedPresetsLabel:"進階預設",providerDefaultsHelp:"此模型使用提供者預設值,無需額外預設。",chooseModelForPresets:"在頂部選擇器中選擇一個型號以查看其支援的預設。",refreshList:"刷新狀態",connect:"連接",connecting:"正在連接",connectOpensBrowser:"在瀏覽器視窗中開啟提供者登入。",refreshConnection:"重新連接",disconnect:"斷開",connectionActionFailed:"連接操作無法完成。稍後再試。",popupBlocked:"登入視窗被封鎖。允許彈出窗口,然後再次連接。",locked:"鎖定",unavailable:"不可用",unknownProvider:"{provider} 的連線資訊不可用。",disconnectedSelection:"已儲存的提供者已中斷連線。在“設定”中重新連線。",disabledProvider:"此提供者在目前伺服器配置中已停用。",selectionUnavailable:"所選的 MCP 提供者不可用。在“設定”中檢查其連接。",higgsfieldLocked:"該提供者的代數已鎖定。",toolCount:"{count} 工具",toolCountUnknown:"工具數量未知",snapshotChanges:"{count} 架構更改",billingLabel:"計費",billingSubscription:"訂閱積分",billingApi:"API 使用計費",billingUnknown:"未知",generateFailed:"無法啟動 MCP 產生。",errorUnsupportedInput:"此模型不支援選定的參考類型之一。選擇相容型號或將其刪除。",errorEndRequiresStart:"在新增結束幀之前選擇開始幀。",errorInvalidReferences:"一張或多張參考影像不再可用。再次選擇他們。",errorInvalidFrame:"所選幀或影片不再可用。再選擇一次。",errorTempReferences:"無法準備本地參考影像。再選擇一次。",status:{disconnected:"已斷開連接",connecting:"正在連接",auth_required:"需要登入",connected:"已連接",offline:"離線",error:"錯誤"},characterSlotLabel:"特點",characterSlotNone:"無字元綁定",characterSlotConflictHint:"刪除 @element 提及使用字元綁定 - 它們不能組合。"},rI={image:"影像",video:"影片"},iI={free:"免費",approx:"〜${amount}",multimodeApprox:"最高~${amount} ({count})",label:"預估成本"},lI={download:"下載",copyImage:"複製影像",copyLastFrame:`最後
|
|
18
18
|
框架`,copyFirstFrame:`第一
|
|
19
19
|
框架`,copyMidFrame:`中
|
|
20
|
-
框架`,copyPrompt:"複製提示",continueHere:"在這裡繼續",continueHereTitle:"導入此圖像的提示並繼續工作",continueAsUrl:"URL 繼續",continueAsUrlTitle:"繼續使用原始提供者URL(1小時後過期)",animate:"動畫",animating:"動畫…",animateTitle:"從此影像產生 Grok 影片(影像到影片)",firstNode:"第一 node",firstNodeTitle:"將此圖像傳送至 Node 模式作為首先準備好的 node",info:"資訊",infoTitle:"顯示產生詳細資訊和出處",delete:"刪除",deleteTitle:"移至垃圾箱",more:"更多的",sendToComfyUI:"發送至 ComfyUI",sendToComfyUITitle:"將已儲存的圖片上傳至本機ComfyUI",permanentDelete:"永久刪除",permanentDeleteConfirm:"永久刪除“{filename}”?此操作無法撤銷。",upscale:"高級",upscaleTitle:"透過 Runway (MCP) 進行升級",upscaleFlavor:"味道",upscaleFlavorAuto:"自動",upscaleStart:"開始高檔",upscaleStarted:"高級開始",upscaleFailed:"高檔失敗",upscaleInvalid:"無效的高檔參數"},sI={switchTitle:"切換會話",loading:"載入中...",newSession:"新會話",newSessionTitle:"新會話",renameTitle:"重新命名",renamePrompt:"會話名稱",deleteTitle:"刪除",deleteConfirm:"刪除會話“{title}”?此操作無法撤銷。",empty:"還沒有工作階段",firstGraph:"我的第一張圖",untitled:"無標題工作階段",assetAbortedError:"一代並沒有乾淨地結束。從此 node 重試。"},cI={ariaLabel:"UI 模式",classic:"經典的",node:"Node",cardNews:"卡新聞",agent:"代理人"},dI={workspace:"座席工作區",workspaceActionFailed:"操作失敗:{reason}",bootFailed:"無法載入代理工作區",bootRetry:"重試",topbarBackToStudio:"返回工作室",topbarStudio:"工作室",topbarOpenQueue:"開啟佇列,{count} 活動作業",topbarCloseQueue:"關閉佇列",topbarQueueSheet:"生成隊列",title:"代理人",newSession:"新代理",sessions:"工作階段",openSessions:"顯示工作階段",closeSessions:"隱藏工作階段",sessionsUseRail:"將會話固定為緊湊型導軌",sessionsUseExpanded:"固定擴展會話列表",sessionSearch:"搜尋會話",renameSession:"重新命名會話",deleteSession:"刪除會話",deleteConfirm:"刪除“{title}”?",imageCount:"{count} 影像",compacted:"壓實",web:"網路",chat:"聊天",user:"使用者",assistant:"代理人",tool:"工具",toolExpand:"顯示工具詳細信息",toolCollapse:"隱藏工具詳細信息",toolImageCount:"{count} 張圖片",toolCallCount:"{count} 調用",toolGroup:"工具運行",toolInput:"輸入",toolOutput:"輸出",toolsShowMore:"更多的",toolsShowLess:"較少的",toolArtifacts:"文物",requestId:"請求ID",duration:"時長",toolStatus:{queued:"排隊",running:"跑步",complete:"完全的",error:"錯誤"},rightSidebar:"代理端工具",sidebarTabs:{image:"影像",library:"圖書館",forms:"表格",quality:"品質",model:"模型",queue:"佇列"},modelSettings:"模型設定",closeModelSettings:"關閉模型設定",openModelSettings:"開啟模型設定",modelTabView:"在「模型」標籤中查看",model:"模型",provider:"提供者",reasoningEffort:"推理",generationStrategy:"發電計劃",generationStrategyAuto:"根據用戶要求",generationStrategyManual:"固定計數",quality:"品質",size:"尺寸",format:"格式",moderation:"內容審查",variantsCount:"變體",maxAutoVariants:"自動最大",parallelism:"平行性",promptLibrary:"提示庫",forms:"表格",noForms:"沒有表單模板",insertPrompt:"插入",queue:"佇列",runningShort:"跑步",queuedShort:"等待",queueEmpty:"沒有排隊的代理工作。",cancelQueue:"取消",retryQueue:"重試",sessionRunning:"代運行",sessionQueued:"{count} 已排隊",sessionError:"產生錯誤",queueStatus:{queued:"排隊",running:"跑步",succeeded:"完畢",failed:"失敗的",canceled:"取消"},statusReady:"可用",statusGenerating:"產生",statusReconnecting:"重新連接",pending:"正在產生回應...",pendingQueued:"排隊等候...",pendingPlanning:"計劃回應...",pendingGenerating:"運行工具並生成...",runError:"運行失敗",errorRole:"錯誤",composerPlaceholder:"詢問任何問題或描述要創建什麼",slashCommands:"代理斜杠命令",slashDesc_question:"提出問題而不產生圖像",slashDesc_variants:"產生 N 個影像變體 (1-24)",slashDesc_generate:"有界扇出生成 (1-24)",slashDesc_parallelism:"限制並發工具調用",slashDesc_help:"顯示可用指令",attachReference:"附上參考資料",send:"傳送",webSearch:"使用搜尋",emptyChat:"輸入訊息以開始圖像或視訊工作。",emptyJumpLatest:"跳轉至最新",queueSummary:"{active} 有效 · {failed} 失敗",queuePlanSummary:"變異 {variants} · 並行 {parallel}",queueDetails:"技術細節",queueAnnouncement:"佇列已更新:{running} 正在運行,{queued} 已排隊,{failed} 失敗",queueTimeAgo:"{value} {unit} 前",queueTimeUnit:{second:"秒",minute:"分分鐘",hour:"小時"},progressQueued:"排隊等候",progressPlanning:"準備請求",progressGenerating:"產生",progressDownloading:"下載結果",progressFailed:"運行失敗",progressJob:"{kind} · {count} 變體",mediaKind:{image:"影像",video:"影片"},mediaSelect:"分眾媒體",mediaLoading:"載入影片",mediaLoadFailed:"影片無法載入。",mediaRetry:"重試",mediaVideoLabel:"生成的視頻",mediaDuration:"持續時間 {duration}",mediaDurationUnknown:"持續時間不可用",mediaDownload:"下載",imagePane:"影像",currentImage:"目前影像",openImage:"打開圖片",closeImage:"關閉影像",selectImage:"焦點影像",variants:"變體",contextTabs:"影像上下文",imageTab:"影像",refsTab:"參考文獻",webTab:"網路",memoryTab:"記憶",noImage:"沒有當前影像",noRefs:"沒有參考文獻",noWeb:"沒有網路證據",memoryItemStyle:"樣式鎖定保留在圖像上下文中。",memoryItemSubject:"主題鎖定在恢復後恢復。",imageAlt:"代理形象",filename:"文件",prompt:"提示詞",stageEmptyHint:"在此處發送您的第一個查看圖片的請求",openTools:"打開工具面板",closeTools:"關閉工具面板"},uI={workspace:"卡新聞工作區",composer:"卡新聞",composerHint:"模板是視覺快照;輸出尺寸單獨設定。",topic:"話題",topicPlaceholder:"例如考試復出計劃",audience:"觀眾",audiencePlaceholder:"例如父母",goal:"目標",goalPlaceholder:"例如預約諮詢",brief:"簡短的",briefPlaceholder:"描述卡片新聞內容、所需要點和排除內容。",outputSize:"輸出尺寸",customSize:"風俗",draft:"摘要草案",drafting:"起草...",generateSet:"生成集",batchGenerate:"批量生成",generating:"生成...",generated:"產生 {count} 卡。",missingGeneratedCard:"產生回應不包括這張卡。",error:"卡生成失敗。",imageTemplate:"圖片模板",roleTemplate:"卡牌結構",newTemplateLater:"開發 MVP 後計畫客製化模板",emptyTitle:"等待草稿",emptyBody:"使用左側設定面板準備卡片組。",inspector:"卡片檢驗員",cardTitle:"卡標題",headline:"標題",body:"身體",visualPrompt:"圖片提示",summaryCopy:"摘要副本",designPrompt:"場景/設計提示",textFields:"文字方塊",addTextField:"新增文字框",removeTextField:"消除",noTextFields:"還沒有文字方塊。",textFieldText:"文字",textKind:"種類",placement:"放置",renderMode:"渲染模式",hierarchyLabel:"等級制度",textTooLong:"文字超出建議長度。",selectTextField:"選擇文字方塊:{text}",textKinds:{headline:"標題",body:"支援文字",caption:"標題",cta:"電腦輔助科技協會",badge:"徽章",number:"數位"},renderModes:{"in-image":"在影像中","ui-only":"僅 UI"},hierarchy:{primary:"基本的",secondary:"中學",supporting:"配套"},placements:{"top-left":"左上角","top-center":"頂部中心","top-right":"右上角","center-left":"中偏左",center:"中心","center-right":"中右","bottom-left":"左下角","bottom-center":"底部中心","bottom-right":"右下角",free:"免費"},roles:{cover:"覆蓋",hook:"鉤",problem:"問題",insight:"洞察力",example:"例子",data:"數據",summary:"概括",cta:"電腦輔助科技協會"},locked:"鎖定",unlocked:"解鎖",noCard:"未選擇卡",generatedMeta:"產生的元數據",lockedHelp:"鎖定的卡片不參與批量生成和重試。",retryCard:"重試此卡",actions:{copyPrompt:"複製提示",copyCopy:"複製複製",openImage:"打開圖片",downloadCard:"下載"},status:{draft:"草稿",queued:"排隊",generating:"產生",generated:"完畢",error:"錯誤",skipped:"跳過",locked:"鎖定"},progress:{generating:"產生 {done}/{total}",summary:"完成 {done}/{total}",detail:"{queued} 已排隊 · {errors} 錯誤 · {skipped} 已跳過",cardGenerating:"產生這張卡。"},planner:{structured:"結構化 JSON",jsonMode:"JSON 模式",repaired:"已修復",fallback:"後備草案",jsonOnlyHelp:"草稿僅建立 JSON。圖像稍後生成。",error:"草稿失敗"}},mI={selectedCameraPresets:"選定的攝影機運動預設",plannerModelTitle:"規劃模型",reasoningEffortTitle:"推理努力",modeLabel:"視訊模式",mode:{"text-to-video":"文字→影片(無參考圖)","image-to-video":"圖片 → 影片(1 篇參考)","reference-to-video":"參考 → 影片({n} 參考)"},seriesTopicTitle:"系列專題",seriesTopicPlaceholder:"例如韓國旅遊視訊博客",durationTitle:"長度",resolutionTitle:"解析度",resolution1080Help:"1080p 使用 Grok V1.5 進行僅提示或單一影像/幀影片。它不適用於 2 個以上的參考文獻。",aspectTitle:"縱橫比",plannerUpdateFailed:"無法更新規劃器模型。之前的設定已恢復。",continuationFallbackT2V:"無法提取連續幀。生成將繼續以文字到影片的形式進行。"},pI={appName:"影像生成器",imageModelLabel:"模型",imageSectionLabel:"影像",gptImageSubLabel:"GPT-IMAGE-2",grokImageSubLabel:"Grok Imagine",geminiImageSubLabel:"Gemini",videoSectionLabel:"影片",imageModelAria:"選擇圖像模型",quickSettingsAria:"選擇模型和推理工作。當前模型{model},推理{effort}",quickSettingsModelOnlyAria:"選擇圖像模型。目前型號 {model}",quickSettingsMenu:"模型和推理快速設置",reasoningLabel:"推理",videoModelLabel:"影片",nodeModeHint:"在 node 模式下,按一下 node 編輯其提示並產生。右側面板上的設定(品質/尺寸)適用於每個新結果。"},fI={openAria:"開啟設定",openTitle:"設定",closeAria:"關閉設定",closeTitle:"返回畫布",navAria:"設定部分",contentAria:"設定內容",jumpTo:"跳到 {section}",title:"設定",sections:{providers:{title:"供應商",hint:"帳戶、金鑰、模型"},workspace:{title:"工作空間",hint:"簡介、佈置、畫廊"},general:{title:"一般的",hint:"語言"}},account:{primaryEyebrow:"活躍的提供者",oauthTitle:"GPT OAuth",oauthBody:"GPT OAuth 產生貫穿您的 Codex OAuth 會話。配置有效密鑰後,您可以切換到 API-密鑰模式。",apiSourceEnv:"偵測到 OPENAI_API_KEY",apiSourceConfig:"偵測到 config.json API 密鑰",apiTitle:"OpenAI API 密鑰",apiBody:"ima2-gen 可以使用此 API 密鑰透過回應 API 進行產生、編輯、多重模式和 node 請求。",apiDisabled:"不可用",apiReady:"可用",apiUnavailable:"不可用",apiUnknown:"狀態未知",grokEyebrow:"本地 xAI 代理",grokTitle:"Grok",grokBody:"在配置的本機連接埠使用 progrok 產生 xAI 映像 API。",agyEyebrow:"Antigravity CLI",agyTitle:"Gemini (agy)",agyInstalledBody:"無法檢測登入狀態。如果產生失敗,請在終端機中執行 `agy login` 。",agyMissingBody:"未安裝。獲取",agyMissingLink:"Antigravity CLI",agyFineprint:"Antigravity 模型和影像配額是單獨計費。",agyInstalled:"已安裝",agyMissing:"未安裝",status:{ready:"可用",authRequired:"需要登入",starting:"開始",offline:"離線",noImageModel:"無影像模型",error:"錯誤",checking:"檢查"}},quota:{codexNotLoggedIn:"未登入",fetchError:"無法加載配額",noData:"無使用數據",grokUsageLink:"看 Grok 用法 →",switchAccount:"切換 {provider} 帳戶",startingLogin:"開始登入...",enterCode:"在打開的選項卡中輸入此代碼:",retry:"重試",copyLink:"複製連結",copied:"已複製",waitingApproval:"等待批准...",switchComplete:"帳號已切換。清爽…",switchFailed:"帳戶切換失敗",tryAgain:"再試一次"},imageModel:{title:"影像模型",body:"選擇供後代使用的影像模型。選擇 Grok 模型會將提供者切換到 Grok。",gpt54Mini:"GPT-5.4 迷你",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt56Sol:"GPT-5.6 索爾",gpt56Terra:"GPT-5.6 泰拉",gpt56Luna:"GPT-5.6 露娜",grokImagine20:"Grok Imagine 圖像 2.0",grokImagine:"Grok Imagine",grokImagineQuality:"Grok Imagine 質量",nanoBanana2:"奈米香蕉2",nanoBanana2Api:"奈米香蕉2",nanoBananaPro:"奈米香蕉專業版",atlasCloudGptImage2:"阿特拉斯雲 GPT Image 2",atlasCloudGptImage2Edit:"阿特拉斯雲 GPT Image 2 編輯",minimaxImage01:"MiniMax image-01",minimaxImage01Live:"MiniMax image-01-live",agy:"Antigravity (agy)",gpt53CodexSpark:"GPT-5.3 Codex Spark — 不支援影像",unsupportedHelp:"Grok 模型透過捆綁的本地代理使用 xAI 的圖像 API。 GPT 模型使用 OpenAI 回應影像產生。"},apiKeys:{accordionTitle:"API 密鑰",envSource:"從環境載入",configSource:"從配置載入",openai:{label:"GPT API 密鑰 (OpenAI)",placeholder:"貼上您的 OpenAI API 密鑰(sk-...)"},xai:{label:"Grok API 密鑰 (xAI)",placeholder:"貼上您的 xAI API 密鑰 (xai-...)"},gemini:{label:"Gemini (Google)",placeholder:"貼上您的 Gemini API 密鑰(AI...)"},atlascloud:{label:"阿特拉斯雲",placeholder:"貼上您的 Atlas Cloud API 金鑰(apikey-...)"},minimax:{label:"MiniMax",placeholder:"貼上您的 MiniMax API 密鑰"},vertex:{label:"Vertex AI(服務帳戶)",placeholder:'貼上您的 Google 雲端服務帳號 JSON { "type": "service_account",... }',authModeApiKey:"API 密鑰",authModeVertex:"頂點 JSON"},save:"節省",saved:"已儲存",saving:"正在驗證...",remove:"移除",saveFailed:"無法儲存密鑰",networkError:"網路錯誤。再試一次。",removeFailed:"無法移除鑰匙",configuredReplace:"已配置 — 按一下以取代",status:{valid:"有效的",notConfigured:"未配置"}},videoModel:{grokImagine:"Grok Imagine 視頻",grokImagine15:"Grok Imagine 影片 1.5"},reasoning:{title:"推理努力",body:"更高的努力會在生成之前花費更多的推理令牌來規劃、網路搜尋和提示豐富。",none:"關——沒有額外的推理",low:"低——最快、最少的推理",medium:"中 — 平衡預設值",high:"高——更深入的研究與綜合",xhigh:"Xhigh — 擴展推理,速度較慢",max:"Max-最大推理,最慢"},webSearch:{title:"網頁搜尋",body:"在生成之前使用即時搜尋來尋找真實的人物、品牌、產品、地點和最近的事件。",on:"搜尋於",off:"關閉搜尋"},grokCompatibility:{title:"Grok 相容性",body:"Grok 圖像生成首先運行強製網絡搜索,然後將文字和附加圖像發送到本地圖像工具規劃器,該規劃器用英語編寫最終圖像提示。附上透過 xAI 影像編輯的參考路線;大小對應到寬高比/解析度。輸出格式、審核和推理僅由 GPT OAuth 和 API 密鑰提供者使用。"},grokPlanner:{title:"Grok 規劃器模型",body:"該模型用於搜尋和圖像/視訊提示規劃。 Grok 4.5 為默認,支援I2V/Ref2V 規劃的影像輸入;Grok 4.3 仍可用作相容性覆蓋。"},gallery:{defaultScopeTitle:"預設圖庫視圖",defaultScopeBody:"選擇開啟圖庫時顯示的內容。"},appearance:{historyStripLayoutTitle:"歷史縮圖",historyStripLayoutBody:"選擇緊湊的歷史記錄條位於工作區旁的方式。",historyStripLayout:{rail:"軌",horizontal:"頂排",sidebar:"側邊欄"}},language:{title:"語言",body:"切換介面語言,不會變更生成內容。"}},gI={loading:"正在載入會話...",addFirst:"+ 增加第一個 node",addRootTitle:"加根 node",hint:"將手把拖曳到空白區域以進行分支。按刪除或退格鍵刪除。"},hI={title:"{provider} 不可用",ariaLabel:"{provider} 不可用"},yI={label:"語言",ko:"한국어",en:"English","zh-Hant":"正體中文","zh-Hans":"简体中文"},vI={close:"關閉",details:"顯示原始錯誤詳細訊息",unknown:{title:"發生意外錯誤",body:"請稍後重試。如果問題仍然存在,請複製下面的原始錯誤訊息並報告。"},moderationRefused:{title:"提示被審核阻止",body:"軟化措辭或改寫。參考圖像中的敏感/暴力內容也可能觸發此問題。",cta:"編輯提示",bodyInput:"您的提示文字已被輸入過濾器捕獲。嘗試改寫或使用不同的措詞。",bodyOutput:"產生的影像被輸出濾波器捕獲。嘗試更改樣式或品質設定。"},emptyResponse:{title:"沒有返回圖像",body:"Codex 回應但不包含影像資料。這不是一個調節塊 - 它可能是一個短暫的問題或不受支援的尺寸/品質/型號組合。重試,或嘗試不同的尺寸或型號。",cta:"重試"},streamParseFailed:{title:"無法解析圖像響應流",body:"響應數據到達,但應用程式無法乾淨地讀取圖像流。代理或瞬態流傳輸問題可能會發生這種情況。",cta:"重試"},imageToolNotCalled:{title:"未呼叫圖像工具",body:"響應已完成,但未觀察到圖像生成工具呼叫。重試相同的提示,或嘗試其他模型/搜尋設定。",cta:"重試"},webSearchOnlyResponse:{title:"未呼叫圖像工具",body:"僅運行網路搜尋;圖像生成工具沒有。關閉搜尋或重試請求。",cta:"重試"},imageToolFailed:{title:"圖像工具呼叫失敗",body:"呼叫了圖像生成工具,但最終以失敗狀態結束。如果重複出現此情況,請使用 `ima2 doctor image-probe --json` 輸出報告它。",cta:"重試"},imageToolNoResult:{title:"影像結果為空",body:"圖像工具呼叫已完成,但不包含圖像資料。這可能表示選項組合不受支援或帳戶功能問題。",cta:"重試"},oauthImageCapabilityUnavailable:{title:"該帳戶可能沒有圖像工具存取權限",body:"GPT OAuth 已連接,但此帳戶/模型組合可能無權使用影像產生。與 API-key 模式或其他模式進行比較。",cta:"確定"},responsesStreamError:{title:"圖像響應流以錯誤結束",body:"OpenAI 在回應流中傳回了錯誤事件。請稍後重試,如果問題仍然存在,請檢查原始錯誤詳細資訊。",cta:"重試"},upstream5xx:{title:"OpenAI 目前正忙",body:"重試通常可以解決此問題。檢查 status.openai.com 如果它仍然存在。",cta:"重試"},authChatgptExpired:{title:"Codex ChatGPT 會話已過期",body:"在終端機中執行 `ima2 setup`(選項 1),然後重新載入此應用程式。",cta:"重新載入"},authApiKeyInvalid:{title:"API 金鑰驗證失敗",body:"金鑰遺失、無效、已撤銷、超出配額或綁定到錯誤的組織。切換到 GPT OAuth 或更新配置的 API 密鑰。",cta:"確定"},networkFailed:{title:"網路連線失敗",body:"無法存取 OpenAI 或本地運行時服務。先重新載入;如果問題仍然存在,請檢查 VPN/防火牆以及 `ima2 doctor` 顯示的連接埠。",cta:"重新載入"},oauthUnavailable:{title:"GPT OAuth 代理程式不可用",body:"GPT OAuth 代理程式正在啟動、無法使用或移至備用連接埠。先重新載入;如果仍然存在,請執行 `ima2 doctor` 並檢查報告的 GPT OAuth URL。",cta:"重新載入"},invalidRequest:{title:"圖片請求需要更改",body:"一個或多個生成參數無效。檢查下面的原始錯誤詳細信息,然後編輯提示或大小並重試。",cta:"編輯輸入"},apikeyDisabled:{title:"API-按鍵模式不可用",body:"此版本支援 API-密鑰生成,但目前請求無法使用配置的密鑰。切換到 GPT OAuth 或更新 API 密鑰。",cta:"確定"},agyGenerationFailed:{title:"Gemini 產生失敗",body:"Antigravity CLI 回傳錯誤。檢查 agy 二進位檔案是否已安裝且您的 Gemini 帳戶是否處於活動狀態。",cta:"重試"},agyTimeout:{title:"Gemini 產生逾時",body:"agy 程序在逾時視窗(360 秒)內沒有回應。重試或檢查 agy CLI 狀態。",cta:"重試"},agyProcessError:{title:"Gemini 進程錯誤",body:"agy CLI 因意外錯誤而退出。驗證二進位檔案是否可以與「agy --version」一起使用。",cta:"重試"},agyQuotaExhausted:{title:"Gemini 配額已用完",body:"您已用盡 Gemini 圖像生成能力。您的配額將自動重設 - 檢查錯誤詳細資料中的重設計時器。",cta:"確定"},authClass:{title:"需要重新登入",body:"服務商認證已過期或金鑰遭拒。請至設定重新登入。",cta:"重新登入"},billingRequired:{title:"需要儲值",body:"此服務商帳戶餘額不足。請前往服務商主控台確認後重試。"}},bI={title:"提示庫",saveTitle:"儲存到提示庫",save:"節省",saved:"提示已儲存",saveFailed:"保存失敗",name:"姓名",tags:"標籤",search:"搜尋提示...",favorites:"收藏夾",load:"載入",insert:"插入",inserted:"提示已插入",removeInserted:"刪除插入的提示 {name}",favorite:"最喜歡的",unfavorite:"不喜歡",empty:"尚未儲存提示。",content:"內容",copy:"複製",untitled:"無題",addNew:"新增提示",import:"進口",importFiles:"匯入.txt、.md、.markdown 或 GitHub 文件",dropImport:"拖曳.txt、.md 或.markdown 檔案以匯入提示",importTitle:"導入提示",importDropTitle:"將文件拖到此處",importDropHint:"儲存前預覽.txt、.md 和.markdown 文件",importChooseFiles:"選擇文件",importGithubLabel:"GitHub 檔案 URL 或路徑",importPreview:"預覽",importPreviewEmpty:"拖放檔案或輸入 GitHub 路徑來預覽候選。",importCommit:"儲存選定的內容",importSelected:"導入選定的 ({count})",importThisPrompt:"導入此提示",previewPrompt:"預覽",selectPrompt:"選擇",selectedPrompt:"已選擇",selectedCount:"已選擇 {count}",selectAllCandidates:"選擇全部",clearCandidateSelection:"清除",addAnotherSource:"增加另一個來源",searchResultsHeader:"搜尋結果 ({count})",searchResults:"搜尋結果",promptText:"提示文字",importSelectAtLeastOne:"至少選擇一個提示進行儲存。",imported:"導入的 {count} 提示",importFailed:"導入失敗",importNoValidFiles:"未找到.txt、.md 或.markdown 提示檔。",curatedSources:"精選來源",curatedSourcesHint:"搜尋已索引的公共提示來源",curatedSearch:"搜尋",curatedSearchPlaceholder:"奈米香蕉,gpt-image-2,排版......",refreshSource:"重新整理",curatedRefreshed:"已索引的 {count} 提示候選者",sourceTrustTier:"來源信任",requiresAttribution:"需要歸屬",sourceDetails:"來源",license:"執照",attributionRequired:"需要歸屬",modelHints:"型號提示",taskHints:"任務提示",warnings:"警告",compatibilityWarnings:"相容性警告",transparentUnsupportedGptImage2:"gpt-image-2 不支援透明背景",noCuratedResults:"未找到精選的提示候選人。",discovery:"發現",discoverySearch:"搜尋 GitHub",discoverySearchPlaceholder:"搜尋提示儲存庫...",discoveryCandidates:"發現候選人",discoveryApprove:"核准",discoveryReject:"拒絕",discoveryApproved:"得到正式認可的",discoveryRejected:"被拒絕",discoveryScore:"分數",discoveryWarnings:"發現警告",discoveryRateLimited:"GitHub 發現是有速率限制的。",discoveryNoResults:"未找到發現候選。",discoveryReviewQueue:"審核佇列",discoveryRequiresPaths:"在預設搜尋之前新增已審閱的檔案路徑。",folderBrowse:"瀏覽資料夾",folderBrowseHint:"從 GitHub 資料夾載入支援的文件",folderFiles:"資料夾檔案",folderFilesEmpty:"找不到可匯入的.md、.markdown 或.txt 檔案。",folderPreviewSelected:"預覽選定的文件",folderSelectedCount:"已選擇 {count}",folderWarnings:"資料夾警告",folderTooManyFiles:"文件太多;顯示有限集。",folderNoSelection:"選擇要預覽的文件。",folderUnsupported:"僅支援 GitHub 資料夾。"},SI={title:"提示產生器",subtitle:"透過多輪上下文細化提示。",scopeDraft:"新作品",scopeImage:"所選影像:{name}",scopeImageFallback:"目前影像",newWorkTitle:"在沒有圖像上下文的情況下開始新的工作",model:"建造者模型",empty:"描述一下你想要的方向。我將包括您當前的提示和設定作為上下文。",user:"你",assistant:"建設者",placeholder:"我們該樹立什麼樣的形象?",send:"傳送",sending:"寫作",thinking:"完善提示...",clear:"清除",applyToPrompt:"適用於提示",insertAsBlock:"插入區塊",finalKoreanPrompt:"韓語提示",finalEnglishPrompt:"英文提示",blockName:"建造商建議",applied:"建構器建議應用於主提示",inserted:"作為提示區塊插入的建構器建議",failed:"提示建構器請求失敗",removeScopeImage:"從建構器上下文中刪除選定的影像",removeAttachment:"刪除附件 {name}",attach:"附加文件",attachmentOnlyMessage:"使用附加文件作為上下文並根據提示提供協助"},xI={sectionTitle:"工作空間",sectionBody:"選擇工作區佈局設定檔。",profileLabel:"工作區設定檔",defaultLabel:"預設",defaultDesc:"帶有側邊欄編輯器的標準生成工作流程。",promptStudioLabel:"提示工作室",promptStudioDesc:"提示建構器面板、分組記錄和增強的檢視器。"},AI={controls:"圖像縮放控件",zoomIn:"放大",zoomOut:"縮小",reset:"重設變焦"},TI={title:"紀錄",empty:"還沒有產生日誌",copied:"提示已複製",copy:"點選複製提示",loadFailed:"無法載入生成日誌。",retry:"重試"},CI={writeFailed:"無法寫入剪貼簿。"},wI={graphSaveFailed:"無法儲存 node 圖表。",sessionSwitchSaveFailed:"由於無法儲存目前圖形,會話切換已停止。",sessionInitialLoadFailed:"無法載入會話。",sessionInitialLoadRetry:"無法載入會話。現在重試?",attachmentReadFailed:"無法讀取一個或多個附件。"},II={ariaLabel:"主導航",home:"家",create:"創造",node:"Node 圖",agent:"代理人",assets:"資產",assetGen:"資產生成",settings:"設定"},EI={title:"資產生成",lede:"建立圖片或短片,然後一鍵移除背景。",prompt:"提示詞",promptPlaceholder:"一個紅蘋果,工作室產品拍攝",background:"背景",backgroundHint:"綠色背景最適合去背;不確定時就選綠色。",bgChroma:"色度綠幕",bgWhite:"白色",bgBlack:"黑色",model:"模型",modelGpt:"GPT",modelGrok:"Grok",kind:"輸出",kindImage:"影像",kindVideo:"影片",videoSoon:"影片功能稍後推出",videoGrokOnly:"影片生成需要使用 Grok,請切換模型。",videoOptions:"影片選項",videoDuration:"影片時長",videoResolution:"影片解析度",videoAspect:"縱橫比",generate:"產生資產",generating:"生成…",emptyTitle:"還沒有資產",emptyBody:"在左側寫下提示,然後按下「產生資產」。結果顯示在此處並自動儲存到您的項目中。",previewImage:"開啟影像預覽:{prompt}",previewVideo:"開啟影片預覽:{prompt}",previewDialogTitle:"預覽:{prompt}",closePreview:"關閉預覽",zoomIn:"放大",zoomOut:"符合螢幕大小",openHintImage:"放大",openHintVideo:"播放",imageFallback:"生成的圖像",videoFallback:"生成的視頻",emptyCta:"寫下你的第一個提示",errorTitle:"生成失敗",errorHint:"請檢查模型與 API 金鑰設定後再試一次。",errorDismiss:"關閉",savedHint:"結果會自動儲存到您的專案中。",savedLink:"在資產中查看",railTitle:"專案資產",railEmpty:"該項目中尚未保存資產。",railError:"無法載入專案資產。",sequence:"影格序列",candidates:"候選影格",frameAria:"第 {n} 格,{rail}",addFrame:"加入",removeFrame:"移除",deleteFrame:"刪除第 {n} 格"},RI={select:"專案",unassigned:"未分配",new:"新項目…",newPrompt:"項目名稱",search:"尋找項目...",searchPlaceholder:"搜尋項目",searchEmpty:"沒有匹配的項目",close:"關閉",saveRetry:"重試保存"},NI={title:"角色表",open:"開啟角色表",close:"關閉角色表",state:"動畫狀態",unsaved:"未儲存的更改",discardConfirm:"放棄未儲存的精靈變更嗎?",loadError:"無法載入此精靈運行。",saveError:"無法保存策展。",bakeError:"無法製作角色圖集。",exportError:"無法匯出精靈動畫。",previous:"上一幀",play:"播放",pause:"暫停",next:"下一幀",speed:"速度",grid:"網格",transform:"影格變換",rotate:"旋轉",scale:"縮放",dx:"移動 X",dy:"移動 Y",shx:"剪切X",shy:"剪切Y",flipX:"水平翻轉",sequence:"影格序列——播放與製作順序",candidates:"候選影格庫",frameAria:"第 {n} 格,{rail}",addFrame:"加入",removeFrame:"移除",deleteFrame:"刪除第 {n} 格",save:"儲存角色表",bake:"製作角色圖集",contactSheet:"縮圖總覽",gif:"匯出 GIF",status:{loading:"載入中…",ready:"已儲存",saving:"儲存中…",baking:"製作中…",exporting:"匯出中…",error:"操作失敗"}},kI={title:"刪除背景",open:"刪除背景",original:"原圖",originalAlt:"去除背景前的原圖",removed:"背景已移除",previewLoading:"準備刪除背景預覽...",resultBadge:"背景已移除",keyColor:"去背色",pickHint:"點選預覽重新選擇主色",clickMode:"預覽點擊功能",modeErase:"點擊以擦除",modePick:"選擇去背色",eraseHint:"按一下空白區域以僅刪除該連線區域",undoClick:"撤銷點選 ({count})",previewAlt:"棋盤上的摳像預覽",tolerance:"去背強度",softness:"邊緣柔化",spill:"清理色溢",unmix:"邊緣去混色",unmixHint:"恢復半透明邊緣(僅限色度鍵)",reset:"重置",download:"下載透明 PNG",save:"儲存到項目",saving:"儲存中…",videoSave:"建立 alpha WebM",videoKeying:"鍵控影片... {seconds}s",videoSaved:"Alpha WebM 儲存到項目",saved:"Alpha PNG 儲存到專案中",saveError:"無法保存摳像影像",loadError:"無法載入此圖片進行摳像。關閉並重試。",advanced:"微調去背(進階)"},_I={ariaLabel:"快速行動",animate:"動畫",edit:"在畫布中編輯",useAsRef:"用作參考",rebake:"再生",refAdded:"新增為參考影像",refFailed:"無法新增參考",saveToAssets:"保存到資產",savedToAssets:"保存到資產",saveToAssetsFailed:"無法保存到資產"},MI={title:"資產",clearAll:"全部清除",clearConfirm:"刪除所有已儲存的資源?此操作無法撤銷。",testSheetsUnavailable:"元素測試表尚不可用。",detailAria:"{name} 詳細信息",searchPlaceholder:"搜尋資產...",allAssets:"所有資產",elementLibrary:"元素庫",removeFromElements:"從元素庫中刪除",emptyElementsTitle:"還沒有元素",emptyElementsBody:"元素是可重複使用的@可提及的參考(人物、產品、風格、場景)。將圖庫圖像儲存到資產並推廣它,然後在任何地方使用 @ 提及它。",newFolder:"新建資料夾",kindAll:"所有類型",kindImage:"圖片",kindVideo:"影片",kindElement:"元素",kindPreset:"預設",kindTemplate:"範本",emptyTitle:"還沒有資產",emptyBody:"尚未保存任何內容。在資產生成標籤中產生您的第一張圖像 - 結果會自動保存在此。",emptySearchTitle:"沒有匹配項",emptySearchBody:"嘗試不同的搜尋、標籤或類型過濾器。",emptyFolderTitle:"該資料夾是空的",emptyFolderBody:"將資源移至此處或將新結果儲存到此資料夾。",deleteAsset:"從資產中刪除",confirmDelete:"刪除?",loadMore:"加載更多",rootFolder:"頂級",renameFolder:"重新命名資料夾",renameAsset:"重命名資產",starAsset:"明星資產",unstarAsset:"刪除資產星級",deleteFolder:"刪除資料夾",actionFailed:"操作失敗",starSaved:"新增到資產",starSaveFailed:"已加星標,但無法新增至資產",itemCount:"{count} 項目",emptyCta:"開放資產生成",loadErrorTitle:"無法載入資源",loadErrorBody:"載入您的庫時出現問題。",retry:"再試一次",detailClose:"關閉資產詳細信息",detailKind:"類型",detailCreated:"建立時間",detailProvider:"模型",detailPrompt:"提示詞",detailTags:"標籤",bindingsTitle:"提供者綁定",bindingsHelp:"該角色如何連接到外部提供者。",bindingStateless:"每代的引用數",bindingTagPlaceholder:"runway @tag (可選)",bindingSave:"保存綁定",bindingSaving:"保存…",bindingTagInvalid:"標籤必須是 1-32 個字母、數字、底線或連字號。",bindingCapWarning:"角色有 {count} 引用 — Runway 每代最多接受 3 個。",bindingTrain:"火車靈魂ID",bindingTrainLockedHint:"需付費 Higgsfield 方案。",bindingPaidPlan:"需要付費計劃",bindingDriftWarning:"參考與訓練時快照不同-考慮重新訓練。"},PI={name:"Node 工作室",toolbar:{addImage:"新增圖片",templates:"範本",saveTemplate:"儲存模板",branch:"分支"},empty:{title:"建構圖像工作流程",description:"從提示開始,重複使用經過驗證的圖表,或繼續您的最新工作。",blankTitle:"從空白畫布開始",blankDescription:"增加一個提示 node 並自行塑造工作流程。",blankAction:"開始空白",templateTitle:"從模板開始",templateDescription:"複製現成的圖表以用於常見的生成工作流程。",templateAction:"瀏覽模板",recentTitle:"恢復最近的圖表",recentDescription:"繼續最近保存的有效圖表。",recentUnavailable:"目前尚無最新圖表。",recentAction:"恢復最近的",resumeError:"無法開啟最近的圖表。再試一次。"},elements:{ariaLabel:"元素節點",title:"元素",hint:"拖曳或添加",loading:"正在載入元素...",loadError:"無法載入元素。再試一次。",empty:"尚未儲存元素。",addToCanvas:"添加到畫布"},elementNode:{untitled:"無標題元素",referencesOutput:"元素引用輸出",notesOutput:"元素註解輸出",kind:"元素",referenceCountOne:"{count} 參考",referenceCount:"{count} 參考文獻",missing:"該元素已被刪除。運行前重新連線。"},elementController:{onlyElements:"只能將元素資源加入畫布。",invalid:"元素 node 無效。",addError:"無法將元素新增至畫布。"},branch:{defaultVariant:"變異 {index}",eyebrow:"分行工作流程",title:"創建變體",close:"關閉分支對話框",variantLegend:"變異 {index}",label:"標籤",provider:"提供者",modelOverride:"模型覆蓋",currentModel:"使用當前模型",sizeOverride:"尺寸覆蓋",currentSize:"使用目前尺寸",remove:"移除",add:"添加變體",cancel:"取消",create:"建立分支",selectSourceError:"選擇一個連接的來源 node。",applyError:"此分支無法應用,因此圖表保持不變。"},templates:{previewAria:"{name} 圖形預覽",nodeCountOne:"{count} 個節點",nodeCount:"{count} 節點",outputCountOne:"{count} 輸出",outputCount:"{count} 輸出",rename:"重新命名",delete:"刪除",deleteConfirm:"删除模板“{name}”?此操作無法撤銷。",title:"選擇模板",close:"關閉模板",searchLabel:"搜尋模板",searchPlaceholder:"名稱或標籤",loading:"正在載入模板...",empty:"沒有模板匹配“{query}”。",starter:"入門模板",yours:"您的模板",cancel:"取消",copy:"影印一份",loadError:"無法載入模板。再試一次。",replaceConfirm:"用此模板的副本替換當前圖形?",invalidGraph:"模板圖無效。",copyError:"無法複製模板。",namePrompt:"模板名稱",saved:"模板已儲存。",saveError:"無法儲存模板。",renamePrompt:"重新命名模板",renameError:"無法重命名模板。",deleteError:"無法刪除模板。"},palette:{ariaLabel:"插入 node 指令",compatiblePlaceholder:"與 {portType} 相容",searchPlaceholder:"搜尋節點",filter:"顯示接受 {portType} 的節點。",emptyCompatible:"node 不接受 {portType}。",emptySearch:"沒有節點與此搜尋相符。",commandsAria:"Node 指令",categories:{input:"輸入",generate:"產生",transform:"轉換",reference:"參考",output:"輸出"}},commands:{"image-generate":{label:"影像生成",description:"將影像 node 加入工作流程。"}},portTypes:{prompt:"提示詞",image:"影像",images:"圖片",video:"影片",mask:"面具","element-refs":"元素參考","element-notes":"元素註釋",settings:"設定","any-media":"任何媒體"},compatibility:{sameDirection:"將輸出埠連接到輸入埠。",typeMismatch:"這些連接埠類型不相容。",cardinality:"該輸入已經有一個連接。",selfEdge:"node 無法連接到自身。",duplicateEdge:"該連接已經存在。",unknownPort:"此連接埠不可用於連接。",cycle:"該連接會形成一個循環。"}},LI={tabs:{label:"資產工作流程",generate:"產生",sprite:"角色表"},title:"角色表",lede:"鎖定角色設定,然後產生動作一致的角色影格。",loading:"正在載入角色表…",loadError:"無法載入角色表。",retry:"重試",empty:{title:"建立角色表",body:"設定角色、影格尺寸與動畫狀態。",create:"建立角色表"},recipe:{select:"角色表",new:"新增角色表",name:"角色表名稱",characterId:"角色ID",description:"描述",style:"風格",baseAssetId:"基礎圖像資源",baseAsset:"基礎圖像資源",save:"儲存角色表",saving:"儲存中…",unsaved:"生成前儲存變更。"},cell:{title:"影格尺寸",width:"寬度",height:"高度",safeMarginX:"水平邊界",safeMarginY:"垂直邊界"},chroma:{title:"綠幕去背",hex:"去背顏色"},states:{title:"動畫狀態",add:"新增狀態",remove:"移除",key:"狀態名稱",frames:"影格數",fps:"FPS",loop:"環形",action:"動作"},anchor:{title:"身分錨",missing:"在行前產生並批准一個空閒姿勢。",generate:"生成空閒候選人",generating:"生成…",candidate:"候選人準備接受審查。",regenerate:"雷根",approve:"批准錨點",approved:"錨定批准",replace:"更換錨",confirmTitle:"批准這個身分錨?",confirmBody:"未來的行將重複使用此標識;基本影像將不會再次附加。",confirm:"核准",cancel:"取消"},rows:{title:"精靈行",generateAll:"產生全部",generateSelected:"產生選定的",regenerate:"重試行",cancel:"取消",preview:"預覽",anchorRequired:"首先批准錨點。",saveRequired:"首先儲存配方更改。",status:{pending:"待辦的",queued:"排隊",running:"跑步",complete:"完全的",error:"錯誤",canceled:"取消"}},error:{INVALID_SPRITE_RECIPE:"填寫所需的配方欄位。",ANCHOR_NOT_APPROVED:"首先批准身分錨。",BASE_REFERENCE_FORBIDDEN:"基礎鏡像審核通過後不可重複使用。",GENERATION_CANCELED:"一代被取消。",generic:"精靈生成失敗。"}},OI={undone:"撤銷最後的圖形變更。",redone:"重新繪製圖形變更。"},jI={t2i:"文字 → 圖片",i2i:"圖片編輯",t2v:"文字 → 視頻",i2v:"圖片 → 影片",v2v:"影片延續"},GI={title:"元素",titleEdit:"編輯元素",titleNew:"新元素",saved:"已儲存",ariaLabel:"元素詳情",name:"姓名",namePlaceholder:"例如胡桃木椅",kind:"種類",kindCharacter:"特點",kindProduct:"產品",kindStyle:"風格",kindScene:"場景",kindReference:"參考",selected:"選定的元素",mentionAria:"{name}、{kind} 元素",unavailableAria:"{name},不可用元素",removeAria:"刪除 {name} 元素",helpCharacter:"一個人或反覆出現的主題。",helpProduct:"設計細節一致的產品。",helpStyle:"視覺語言、材料或處理方式。",helpScene:"地點、環境或反覆出現的環境。",notes:"筆記",notesHelp:"描述應保持一致的外觀、材料和細節。",notesPlaceholder:"溫暖的胡桃木紋、圓潤的邊緣、編織的藤條座椅…",remaining:"剩餘 {n}",strength:"參考強度",strengthHelp:"生成的作品的強度應遵循這些參考文獻。",resetDefault:"重設為預設值",saving:"儲存中…",save:"儲存元素",testing:"正在產生測試表...",runTest:"運行測試表",delete:"刪除",errorName:"儲存之前命名您的元素。",errorRefs:"儲存前至少新增一張參考影像。",refsTitle:"參考圖片",refsHelp:"拖曳以設定順序。第一個圖像是代表性縮圖。",refAlt:"參考 {n}",refPrimary:"代表",refLabel:"標籤",refLabelPlaceholder:"正面、側面、材質…",refMoveUp:"將引用 {n} 向上移動",refMoveDown:"向下移動引用 {n}",refRemove:"消除",refRemoved:"參考已刪除。",refUndo:"撤銷"},DI={common:_w,appBar:Mw,sheet:Pw,toast:Lw,inflight:Ow,size:jw,sizeConfirm:Gw,quality:Dw,moderation:Fw,format:zw,count:qw,multimode:Uw,metadata:Hw,onboarding:Bw,readiness:Vw,generate:Kw,home:$w,billing:Yw,history:Xw,panel:Qw,prompt:Jw,canvas:Ww,gallery:Zw,node:eI,nodeBatch:tI,edge:nI,provider:aI,mcp:oI,grokMode:rI,cost:iI,result:lI,session:sI,uiMode:cI,agent:dI,cardNews:uI,video:mI,sidebar:pI,settings:fI,nodeCanvas:gI,apiDisabled:hI,language:yI,errorCard:vI,promptLibrary:bI,promptBuilder:SI,workspace:xI,viewer:AI,generationLog:TI,clipboard:CI,modal:wI,nav:II,assetGen:EI,project:RI,spriteCurator:NI,keying:kI,chain:_I,assets:MI,"assets.clearAll":"全部清除","assets.clearConfirm":"刪除所有已儲存的資源?此操作無法撤銷。",nodeStudio:PI,sprite:LI,graph:OI,provenance:jI,element:GI},FI={ok:"确定",cancel:"取消",delete:"删除",close:"关闭",saving:"保存...",loading:"加载中...",dismiss:"关闭通知",generating:"生成…",imageCollection:"{n} 图像集",remove:"移除",removeNamed:"删除 {name}",elementSuggestions:"元素建议",noMatchingElements:"没有匹配的元素",enterPrompt:"输入提示...",continuity:"连续性",activePrompt:"主动提示",elementUnavailable:"元素不可用",spritePreview:"精灵动画预览",canvasMemo:"画布备忘录",cardDeck:"卡牌组"},zI={modeImage:"图像",settings:"设置",controls:"发电控制",generate:"产生",generateAria:"打开提示表生成图像"},qI={close:"关闭提示表",generate:"生成图像",controlsOpen:"开放式发电控制",tabs:{prompt:"提示词",controls:"控制",library:"图书馆"}},UI={localImportSuccess:"图像已添加到图库",localImportFailed:"导入图片失败",localImportInvalid:"仅支持 PNG、JPEG 或 WebP",localStorageFull:"本地存储已满 - 最近的状态可能不会持续。",refLimitExceeded:"参考文献上限为 5。多余的图像被删除。",minimaxModelRequiresReference:"image-01-live 需要中国境外的参考图像。附上一个,或切换到 image-01。",refLimitTrayFull:"参考托盘已满 ({max})。使用 X 删除项目以附加更多 — 已删除的 @tags 可以使用 @ 重新提及。",refLimitPartial:"仅添加了 {total} 图像中的 {added}(限制 {max})。",refOverProviderLimit:"该提供程序最多接受 {max} 参考图像。删除 {excess} 来生成。",refTooLarge:"图片太大。转换为 JPEG/PNG 或降低分辨率并重试。",refNotBase64:"图像文件已损坏或使用了不受支持的编码。",refEmpty:"空图像文件。请选择不同的文件。",refHeicUnsupported:"不支持 HEIC/HEIF。转换为 JPEG 或 PNG 并重试。",noCurrentImageForRef:"没有当前图像可用作参考。",refSlotFull:"参考槽已满(最多 5 个)。",currentImageLoadFailed:"无法加载当前图像。",addedCurrentAsRef:"添加当前图像作为参考。",sessionLoadFailed:"无法加载会话。",sessionCreateFailed:"创建会话失败。",sessionRenameFailed:"无法重命名会话。",sessionDeleteFailed:"删除会话失败。",promptRequired:"输入提示。",missingElements:"缺少选定的元素。在生成之前将其删除或重新添加元素。",nodeCreated:"Node {id} 创建 ({elapsed}s)",nodeRootCreated:"从该图像创建第一个 node 。",animateStarted:"将图像动画化为视频...",animateProgress:"渲染视频…{n}%",animateDone:"视频准备好了。检查你的历史记录。",animateFailed:"视频生成失败。",nodeCreateFailed:"Node 生成失败。",generatedBatch:"在 {elapsed}s 中生成 {count} 图像。",generatedSingle:"在 {elapsed}s 中生成。",generateFailed:"一代失败。",sessionReloadedElsewhere:"图表版本发生变化,因此重新加载最新图表。",promptCopied:"提示已复制",metadataCopied:"已复制",imageCopied:"已复制到剪贴板",frameCopied:"帧已复制到剪贴板",copyFailed:"复制失败",openGeneratedDirFailed:"无法打开图像文件夹。运行ima2 doctor检查存储路径。",openGeneratedDirOpened:"打开生成的图像文件夹。",noPromptToFork:"没有提示分叉",forkStarted:"提示导入。再次编辑并生成。",forkStartedNoPrompt:"附上图片作为参考。输入提示并生成。",continueAsUrlStarted:"提供程序 URL 设置为参考。生成以使用原始图像。",continueAsUrlExpired:"提供程序 URL 已过期。请改用此处继续。",comfyExported:"作为 {filename} 发送到 ComfyUI。",comfyExportInvalidUrl:"ComfyUI URL 必须是本地 HTTP 地址。",comfyExportInvalidImage:"此保存的图像无法发送到 ComfyUI。",comfyExportImageNotFound:"未找到保存的图像文件。",comfyExportFailed:"无法将图像上传到 ComfyUI。",cancelFailed:"无法取消生成。",errorClass:{rateLimited:"请求过于频繁,请稍后再试。",providerTimeout:"服务商响应超时,请稍后再试。",networkFailure:"无法连接服务商。请检查网络后重试。",contentRejected:"服务商拒绝了该提示词,请修改后重试。",capabilityUnsupported:"当前服务商不支持此请求。",modelUnavailable:"所选模型暂时不可用。",internalState:"内部状态异常,请重新加载页面。"}},HI={queued:"排队",planning:"规划",streaming:"生成",decoding:"敲定",canceling:"取消",noPrompt:"无提示",cancelAria:"取消生成:{prompt}",title:"飞行中",badgeOpen:"显示飞行中的 {n} 代",badgeClose:"隐藏飞行中的 {n} 代",inlineCollapse:"崩溃飞行中的 {n} 代",footerHint:"您可以关闭此面板——生成会继续。",kindImage:"图像",kindVideo:"视频",kindNode:"节点",kindMcp:"MCP",progressAria:"生成进度:{n}%"},BI={title:"尺寸",grokAspectTitle:"纵横比",grokResolutionTitle:"分辨率",width:"宽度",height:"高度",hint:"16px 步长,最大边缘 3840,比例高达 3:1,655K–829M 像素",autoLabel:"自动",autoSub:"型号选择",customLabel:"自定义",customSub:"自由形式",customPlus:"+ 定制",customSlots:"保存的尺寸",customSlot:"自定义",customSlotLimit:"最多 3 种自定义尺寸",saveCustomSlot:"保存自定义尺寸",replaceCustomSlot:"更换插槽",ratioFree:"自由比例",ratio21x9:"21:9",normalizedPreview:"会发送",noAdjustment:"无需调整",squareMaxHint:"由于 829 万像素限制,平方最大值为 {size}。",adjustedReasons:{snap:"捕捉到 16 像素",maxEdge:"最大边缘",ratio:"比率限制",minPixels:"最小像素",maxPixels:"最大像素",min:"最小边缘",max:"最大边缘",pixels:"像素限制"}},VI={title:"需要调整尺寸",body:"请求的大小超出了图像生成限制。",requested:"要求尺寸",adjusted:"调整后的尺寸",approve:"批准并生成",cancel:"取消",reasonRatio:"该比例超出了 3:1 的限制。",reasonPixels:"超出了最大像素限制。",reasonMinPixels:"请求的图像像素太少。",reasonMin:"尺寸低于最小值。",reasonMax:"大小超过最大值。",reasonSnap:"尺寸必须以 16 像素为增量对齐。"},KI={title:"质量",grokTitle:"Grok 质量",grokModelTitle:"模型",lowLabel:"低",lowSub:"快速",mediumLabel:"中",mediumSub:"均衡",highLabel:"高",highSub:"最佳"},$I={title:"内容审核",autoLabel:"自动",autoSub:"标准安全过滤器",lowLabel:"低",lowSub:"较宽松的过滤器",explain:"自动使用标准安全过滤器;低模式会放宽限制,因此部分边界提示词可能会通过。"},YI={title:"格式"},XI={title:"数数",customPlus:"+n",customLabel:"自定义计数",highCountHint:"对于参考或高质量的计数,较高的计数可能需要更长的时间。",minMaxHint:"使用 1-24 张图像。",decrease:"减少计数",increase:"增加计数"},QI={label:"序列",tooltip:"用一个提示词生成多个阶段",shortHint:"规划中的阶段",maxStages:"最多阶段数",highCountHint:"较高的阶段数可能需要几分钟的时间。",minMaxHint:"使用 1-24 级。",composerBadge:"序列·共 {count} 段",composerAriaLabel:"序列提示编辑器,最多 {count} 个阶段",promptPlaceholder:"描述要生成的阶段;关闭序列后搭配数量,可批量生成相同提示词。",promptPlaceholderWithRefs:"使用所附参考文献描述分阶段顺序。",toggleDisabledGenerating:"等待当前一代完成",sequenceTitle:"序列结果",sequenceProgress:"{returned}/{requested} 图像",stageLabel:"阶段{index}",generating:"生成...",partialAlt:"部分多模式预览",partial:"在 {elapsed}s 中生成 {returned}/{requested} 图像。",complete:"在 {elapsed}s 中生成 {returned}/{requested} 图像。",notReturned:"未退回",empty:"没有返回图像",error:"生成失败",canceled:"取消",cancel:"取消"},JI={restoreTitle:"恢复图像设置",restoreBody:"该图像包含 ima2 生成元数据。应用其提示和设置,或仅将其附加作为参考。",applySettings:"应用设置",useAsReferenceOnly:"仅供参考",noMetadata:"未找到 ima2 元数据。",invalidMetadata:"图像元数据无效。",unsupportedFormat:"仅可以恢复 PNG、JPEG 和 WebP 元数据。",readFailed:"无法读取图像元数据。",applied:"图像设置已恢复。",sourceXmp:"XMP",sourcePngComment:"PNG 评论",imageAlt:"放置图像预览",prompt:"提示词",size:"尺寸",quality:"质量",model:"模型",source:"来源",title:"生成详情",asset:"资产",summary:"生成摘要",copy:"复制",copyRaw:"复制原始 JSON",copyField:"复制 {label}",rawJson:"原始元数据 JSON",sections:{provider:"供应商和型号",settings:"生成设置",usage:"用量与时间",lineage:"来源链",video:"视频",videoContinuity:"视频连续性",prompts:"提示"},fields:{provider:"提供者",authPath:"认证路径",model:"模型",providerUrl:"提供商 URL",requestId:"请求ID",quality:"质量",size:"尺寸",format:"格式",moderation:"内容审核",reasoning:"推理",promptMode:"提示方式",kind:"种类",mediaType:"媒体类型",elapsed:"耗时",tokens:"代币",totalTokens:"代币总数",inputTokens:"输入",cachedTokens:"缓存",outputTokens:"输出",reasoningTokens:"推理",webSearchCalls:"网络搜索",grokCostTicks:"Grok 成本刻度",usage:"用量",filename:"文件名",createdAt:"创建时间",sessionId:"会话",nodeId:"节点",parentNodeId:"父级 node",clientNodeId:"客户端 node",refsCount:"参考",sequence:"顺序",setId:"批次",cardId:"卡片",videoDuration:"视频时长",videoResolution:"视频分辨率",videoAspectRatio:"纵横比",videoRequestedModel:"要求的型号",videoEffectiveModel:"有效模式",videoModelFallback:"模型后备",xaiVideoRequestId:"xAI 视频请求",sourceImageFilename:"源图片",lineageId:"来源链 ID",parentFilename:"父项文件",sourceFrame:"来源帧",continuityEntries:"连续性条目",latestContinuityPrompt:"最新连续性提示",promptPrimary:"提示词",userPrompt:"用户提示",prompt:"存储提示",revisedPrompt:"修改提示",composerPrompt:"作曲家提示",insertedPrompts:"插入的提示"}},WI={title:"你好!第一次来这里?",body:"登录以开始生成。您可以连接 ChatGPT、Grok 或 Gemini。",login:"是的,让我登录",skip:"我自己设置一下"},ZI={title:"生成准备状态",open:"检查准备情况",openTitle:"检查提供商、身份验证、模型和网络搜索准备情况",settingsTitle:"生成准备状态",settingsBody:"打开一个包含提供者、身份验证、模型、推理和网络搜索状态的紧凑弹出窗口。",ready:"准备生成",readyBody:"所选提供商可用。",blocked:"提供商需要关注",provider:"提供者",model:"模型",reasoning:"推理",webSearch:"网页搜索",grokApi:"Grok API",grokApiBody:"通过捆绑的 progrok 运行:强制搜索、Grok 4.5 英语图像和文本工具规划,然后是 xAI Images API。附加参考使用 xAI 图像编辑,因此保留了 i2i 上下文。",openAccount:"开设账户设置"},eE={button:"产生",buttonLoading:"生成({n})"},tE={recentTitle:"最近的工作",selectedCount:"已选择 {count}",selectedPresets:"选定的预设",referenceTrayCount:"{count} 参考文献",referenceTrayAria:"{count} 引用附加到下一代",viewAll:"查看全部",heroTitle:"从满意的那一张,继续展开。",heroLede:"在本机生成、编辑、让画面动起来。不主动发送,就不会离开这台机器。",lanesReady:"{total} 条生成通道中 {ready} 条就绪",lanesNone:"暂无就绪通道 — 请在设置中连接",modesTitle:"工作区",modeCreateHint:"生成并打磨单张图像",modeNodeHint:"把一个结果分成多个方向",modeAgentHint:"说明需求,交给智能体执行",modeAssetsHint:"收藏并重复使用你的成果",untitledResult:"未命名结果",recentResultAlt:"最近结果:{prompt}",mediaUnavailable:"无法显示预览"},nE={label:"API 状态",checking:"检查...",offline:"离线",remaining:"剩余 ${remaining}",thisMonth:"本月 ${amount}",oauthFree:"GPT OAuth · 通过 codex 免费",apiDisabled:"API 密钥准备就绪",apiReady:"API 密钥准备就绪",oauthMode:"GPT OAuth 模式"},aE={openGalleryAria:"打开画廊",openGalleryTitle:"打开完整画廊",openGalleryShort:"全部",galleryCard:"打开画廊",recentTitle:"最近几代人",collapseRecent:"崩溃最近几代",expandRecent:"扩展最近几代",collapseRecentShort:"隐藏",expandRecentShort:"展示",emptyRecent:"生成的图像将出现在此处。",generatingCollection:"正在生成 {count} 图像...",selectRecent:"选择生成的图像",deleteImageAria:"从历史记录中删除图像",deleteSequenceAria:"删除 {count}-图像序列",deleteSequenceConfirm:"删除此多模式序列中的所有 {count} 图像?",sequenceDeleted:"从历史记录中删除了 {count} 序列图像"},oE={closeSettings:"关闭设置",detailSettings:"设置",toggleShow:"显示设置",toggleHide:"隐藏设置",open:"打开",close:"关闭"},rE={label:"提示词",refCount:"参考 {count}/{max}",trayAria:"参考托盘,{max} 的 {count}",deadTagHint:"标签已从托盘上移除 — 仅供参考",deadTagStatus:"提示中不可用的引用:{tags}",refChipTitle:"参考 {n}",refChipAlt:"参考 {n}",refRemoveAria:"删除引用 {n}",placeholder:"描述您想要的图像。拖放或粘贴以附加参考图像...",placeholderWithRefs:"描述如何处理所附图片...",attach:"附",attachTitle:"附上参考图片",useCurrent:"使用电流",useCurrentTitle:"使用当前结果作为参考",continue:"继续",continueTitle:"从当前结果继续作为参考",savePrompt:"节省",storyboard:"故事板",storyboardTitle:"启用故事板模式 - 在连续帧之间保持角色和场景的连续性",videoToggleTitle:"切换视频模式 (Grok 1.5)",directMode:"直接的",directModeActive:"1:1直接上",directModeTitle:"逐字传递提示(直接模式)",urlRefActive:"URL 参考",urlRefActiveTitle:"提供程序 URL 引用处于活动状态,将用于代替附加的图像引用。单击以清除。",urlRefClear:"清除提供者 URL 参考",moveBlockUp:"将 {name} 向上移动",moveBlockDown:"向下移动 {name}",afterBlocks:"主提示后",hint:"Ctrl+Enter 生成",dropHere:"拖放到附件作为参考(最多 {max})"},iE={modeTitle:"画布模式",resultAlt:"结果",imageViewerAria:"生成的图像查看器。使用左右箭头键在图像之间移动。",tokens:"{n} 代币",open:"打开画布",openAria:"以画布模式打开图像",dragToComposer:"拖到作曲家作为参考",dragHint:"拖",annotationInstructionsChip:"画布笔记",close:"关闭画布",blank:{title:"空白画布",subtitle:"在白纸上画草图,然后继续。",create:"创建空白画布",creating:"创造...",failed:"无法创建空白画布"},drop:{hint:"拖放图像以添加到图库"},toolbar:{label:"画布注释工具",select:"选择",bgGroup:"出口背景",bgAlpha:"阿尔法",bgMatte:"哑光的",bgMatteColor:"哑光色",cleanup:"干净的背景",cleanupMark:"标记",cleanupRemove:"消除",cleanupPreserve:"保存",cleanupInput:"输入",cleanupClick:"点击",cleanupBrush:"刷子",cleanupBrushSize:"刷子",cleanupTolerance:"宽容",cleanupAutoSample:"角球",cleanupPickSeed:"采摘种子",cleanupPickingSeed:"点击背景",cleanupActive:"已激活",cleanupPreview:"预览",cleanupPreviewing:"正在预览...",cleanupApply:"申请 PNG",cleanupApplying:"正在申请...",cleanupReset:"重置",cleanupSeedCount:"{n} 种子",cleanupRemoved:"{n}% 已删除",cleanupPickHint:"单击图像上的背景",cleanupBrushHint:"绘制要标记的区域",cleanupMaskHint:"紫色面具将被移除",cleanupApplied:"已创建透明 PNG",cleanupFailed:"后台清理失败",zoomGroup:"画布缩放",zoomIn:"放大",zoomOut:"缩小",zoomReset:"重置变焦",zoomShortcutHint:"双指缩放·两指平移·[ / ]·0",pen:"笔",box:"盒子",arrow:"箭",memo:"便签纸",eraser:"橡皮",eraserMenu:"橡皮擦选项",objectEraser:"物体橡皮擦",brushEraser:"刷子橡皮擦",apply:"保存画布版本",applyDone:"画布版本已保存",applyFailed:"无法保存画布版本",export:"导出图片",exporting:"出口...",exportFailed:"导出失败",undo:"撤消",redo:"重做",deleteSelected:"删除所选内容",editMask:"编辑盒装区域",editMaskDisabled:"先画一个盒子",editMaskFailed:"屏蔽编辑失败",editMaskUnsupported:"当前图像提供商不支持蒙版编辑",style:"风格",color:"颜色",strokeWidth:"笔划宽度",clear:"全部清除",exportFormat:"导出格式",exportAs:{png:"PNG 图像",svg:"SVG 向量",pptx:"PowerPoint 幻灯片"}},version:{saving:"正在保存画布版本...",saved:"画布版本已保存",failed:"无法保存画布版本",usingAsReference:"Canvas版本已准备好作为参考"},revert:{action:"恢复烘焙笔记",mixedConfirm:"此版本还包含像素编辑。恢复烘焙笔记将丢弃这些像素编辑。继续?",restored:"烘焙笔记恢复为可编辑草稿",completed:"烘焙笔记和像素编辑已恢复",failed:"无法恢复烘焙笔记"}},lE={today:"今天",yesterday:"昨天",thisWeek:"本星期",earlier:"早些时候",imageAltFallback:"生成的图像",deleteTitle:"移至系统垃圾箱",deleteAria:"删除图像",ariaLabel:"图片库",title:"画廊",total:"{n} 总计",totalFiltered:"/ {n} 总计",sortByAria:"排序方式",sortByDate:"日期",sortBySession:"会话",favoriteFilterAria:"最喜欢的过滤器",filterAll:"全部",filterFavorites:"收藏夹",searchPlaceholder:"搜索提示或文件名",searchDisabledPlaceholder:"在会话视图中禁用搜索",closeAria:"关闭画廊",closeTitle:"关闭(Esc)",sessionLabel:"会话 {name}",standalone:"独立图像",emptySessions:"尚未保存任何会话。",emptyAll:"还没有图像。先创建一个。",emptyFavorites:"还没有最喜欢的图像。",noResults:"没有结果。",loadOlder:"加载较旧的",loadingOlder:"正在加载较旧的...",loadOlderFavorites:"加载较旧的收藏夹",loadingOlderFavorites:"正在加载旧的收藏夹...",sessionPaginationHint:"会话视图使用当前页面。切换到日期视图以加载旧图像。",sessionLoading:"正在加载会话组...",sessionLoadFailed:"无法加载会话组。",sessionLimitNotice:"显示最新的 {count} 项目。较旧的项目不包含在会话视图中。",retry:"重试",loadOlderFailed:"无法加载旧的画廊项目。",storageNoticeTitle:"保管须知",storageNoticeRecoverable:"抱歉吓到了。最新版本将图库文件夹从已安装的包移至用户数据文件夹。您的旧图像可能仍在之前生成的文件夹中。运行 ima2 doctor 或打开恢复指南。",storageNoticeNotFound:"抱歉吓到了。我们在这台机器上找不到以前生成的文件夹。如果在更新过程中替换了旧的全局安装文件夹,则可能无法自动恢复。运行 ima2 doctor 并查看恢复指南以了解手动搜索步骤。",storageNoticeUnknown:"无法检查存储状态。如果更新后图库看起来是空的,请运行 ima2 doctor 检查图像文件夹。",openGeneratedDir:"打开文件夹",openGeneratedDirTitle:"打开生成的图像文件夹",cardNewsSet:"卡新闻集",cardNewsCard:"卡片新闻卡",openCardNewsSet:"开集",openCardNewsSetFailed:"无法打开卡片新闻集。",copyCardNewsSetPath:"复制路径",cardNewsPathCopied:"卡新闻设置路径已复制。",downloadCardNewsManifest:"显现",cardNewsCount:"{n} 卡",deleted:"已删除:{filename}",undo:"撤消",secondsSuffix:"{n}s",permanentDeleted:"永久删除:{filename}",movedToSystemTrash:"移至系统垃圾箱:{filename}",deleteFailed:"无法删除图像。",restoreFailed:"无法恢复图像。",favoriteTitle:"添加到收藏夹",unfavoriteTitle:"从收藏夹中删除",favoriteAria:"添加到收藏夹",unfavoriteAria:"从收藏夹中删除",favoriteFailed:"无法更新收藏夹",scopeAria:"画廊范围",scope:{current:"当前会话",all:"所有图片"},empty:{currentSession:"此会话中还没有图像。"}},sE={empty:"空的",elementMissing:"元素“{name}”已删除。运行前重新连接。",pending:"生成",reconciling:"正在同步",reconcilingPhase:"正在同步·{phase}",ready:"完成 · {elapsed}s",readyWithSearch:"完成·{elapsed}s·搜索{searches}",stale:"陈旧",staleWithError:"陈旧:{error}",assetMissing:"资产失踪",assetMissingWithError:"资产缺失:{error}",error:"错误:{error}",errorUnknown:"未知",nodeImageAlt:"Node 图像",partialImageAlt:"部分node图像预览",noAsset:"没有资产",stateStale:"状态陈旧",noImage:"无图像",editPromptPlaceholder:"编辑提示...",promptPlaceholder:"提示词...",regenerate:"雷根",newVariation:"新版本",generate:"根",generateTitle:"生成 node 图像",addChild:"孩子",addChildTitle:"添加子项 node",duplicateBranch:"分支",duplicateBranchTitle:"复制为新的分支根",deleteTitle:"删除",regenerateTitle:"就地重新生成 node",newVariationTitle:"在同一父项下创建一个新的同级变体",parentImageRequired:"首先生成父图像。",attachRef:"附",attachRefTitle:"附上 node 参考图像",refAlt:"Node 参考 {n}",removeRef:"删除引用 {n}",dropRefs:"将图像拖放到此处",nodeRefsUnsupportedForEdit:"目前仅根节点支持额外引用。",nodeRefsUsedWithParent:"与父图像一起使用。",classicRefsParkedTitle:"经典参考已停放",classicRefsParkedBody:"这些图像属于经典作曲家,在 node 模式下处于非活动状态。",clearParkedRefs:"清除停放的参考",retry:"重试",retryTitle:"重试这个 node 的生成",errorAuthCta:"检查您的帐户或 API 密钥,然后重新生成。",errorFixCta:"调整提示或引用,然后再次生成。"},cE={selectionOn:"选择",selectionOff:"选择",selectAll:"选择全部",summary:"{selected} 已选择 · {missing} 缺失 · {stale} 受影响",generateMissing:"生成缺失",regenerateSelected:"重新生成选定的",stopRemaining:"停止剩余",stopping:"停止",clear:"清除",noneSelected:"未选择节点。",parentRequired:"{count} 选择的 node 首先需要准备好父映像。",nothingToRun:"没有选定的节点需要生成。",stopQueued:"当前的 node 将完成,然后剩余的队列将停止。",failed:"在 {done}/{total} node(s) 之后停止。",finished:"已完成 {done}/{total} node(s)。",staleBecauseParentChanged:"重新生成了上游 node ;需要时刷新此 node 。",cycleBlocked:"无法运行:{count} 选择的 node 形成循环。",partialFinished:"已完成 {done}/{total} — {failed} 失败,{skipped} 已跳过。"},dE={disconnect:"断开",disconnectTitle:"断开选定的边",disconnected:"连接已移除。",parentConflict:"node 只能有一个父连接。",cycleBlocked:"该连接会形成一个循环。"},uE={authTitle:"提供者",apiLabel:"API 密钥",statusReady:"可用",statusConnected:"已连接",statusAuthRequired:"需要登录",statusDisconnected:"已断开连接",statusLineTitle:"状态",authMethodTitle:"授权",authActive:"已激活",oauthNotReady:"GPT OAuth 代理尚未准备好。",codexLoginRequired:"需要 Codex 登录。",codexLoginHint:"在终端中运行 `codex login`,然后刷新此页面。",oauthStarting:"GPT OAuth 代理正在启动。几秒钟后重试。",serverUnreachable:"无法到达服务器。确保后端正在运行。",apiInvalid:"API 密钥丢失或无效。检查服务器.env 中的 OPENAI_API_KEY。",grokOffline:"Grok 代理未运行。",grokNoImageModel:"未找到 Grok 图像生成模型。",grokNotReady:"Grok 不可用。",grokOfflineHint:"如果需要,运行 `ima2 grok login` 一次,然后启动 `ima2 serve`; ima2 自动启动捆绑的 Grok 代理。",grokManagedByIma2:"Grok 通过位于 127.0.0.1:18645 的捆绑 progrok 代理在 `ima2 serve` 内部本地运行。",grokClassicOnly:"Grok 图像生成在此表面中不可用。",grokClassicOnlyHint:"使用启用了 Grok 的生成表面。",grokCompatTitle:"Grok 图像 API",grokCompatBody:"ima2 服务在 127.0.0.1:18645 管理捆绑的 progrok 代理。 Grok 始终在图像生成之前进行搜索,将附加引用发送到 Grok 4.5 规划器中,通过 xAI 图像编辑保留它们,并将大小映射到 xAI 宽高比/分辨率。输出格式、审核和推理仅是 OpenAI 提供商设置。",settingsBody:"选择下一代请求使用哪个提供商。",availableTitle:"{name} 可用",availableAria:"{name}:可用",unavailableAria:"{name}:不可用",availableSr:"(可用的)",unavailableSr:"(不可用)",xaiApiKeyRequired:"需要 xAI API 密钥",geminiApiKeyRequired:"Gemini API 需要密钥",atlasCloudApiKeyRequired:"Atlas Cloud 需要 API 密钥",minimaxApiKeyRequired:"MiniMax API 需要密钥",comingSoon:"即将推出",agyCompatTitle:"Gemini (agy)",agyCompatBody:"1024x1024 固定,JPEG 输出,最多 3 个参考。没有质量/尺寸控制。",agyCompatBodyLong:"1024x1024 固定输出,JPEG 格式,最多 3 个参考图像。没有网络搜索,没有质量/尺寸控制。",geminiApiCompatTitle:"Gemini API",geminiApiCompatBody:"Google Gemini API。支持从 512px 到 4K 的宽高比和分辨率控制。",geminiApiCompatBodyLong:"Google Gemini API 直接。支持 nano-banana-2 (Flash) 和 nano-banana-pro (Pro),宽高比和分辨率控制范围为 512px 至 4K。",gptCompatTitle:"GPT Image",gptCompatBody:"OpenAI 通过响应 API 生成图像。支持质量、大小、格式、审核和网络搜索设置。"},mE={connectionsTitle:"MCP 提供商连接",connectionsBody:"连接官方提供商帐户并查看工具状态。只有连接的提供商才会出现在生成选择器中。",providerLabel:"发电商",modelLabel:"生成模型",coreProviders:"核心提供商",connectedProviders:"连接的 MCP 提供商",imageModels:"图像模型",videoModels:"视频模型",chooseModel:"选择型号",loadingModels:"加载模型",loadingProviders:"检查连接",providersLoadFailed:"无法加载 MCP 提供程序状态。",modelsLoadFailed:"模型加载失败 — 点击重试",retryModels:"重试",noModels:"没有适用于此模式的型号。",refreshingConnection:"清爽…",exitLane:"使用核心提供商",modelSectionTitle:"模型",ratioAutoHelp:"自动让模型选择自己的纵横比。某些型号可能会拒绝预设。",aspectRatioLabel:"纵横比",durationLabel:"时长",resolutionLabel:"分辨率",qualityLabel:"质量",modeLabel:"模式",audioLabel:"声音的",onLabel:"在",offLabel:"离开",toolInputsLabel:"参考媒体",referenceNone:"没有任何",referenceSelect:"从画廊中选择",referenceCurrent:"当前画廊项目",referenceMissing:"不在加载的历史记录中",startFrameLabel:"起始帧",endFrameLabel:"结束框架",endFrameNeedsStart:"首先选择一个起始帧。",imageReferencesLabel:"图片参考(最多 3 个)",imageReferenceAria:"图片参考{index}",referenceTagAria:"图像参考标签 {index}",referenceTagPlaceholder:"可选标签",referenceTagInvalid:"使用 1-32 个字母、数字、下划线或连字符作为标签。",referenceAttachLocal:"附上本地图片",referenceAttachHelp:"本地图像暂时上传,并在生成稳定后删除。",referenceLocalFallback:"本地图片",referenceLocalInvalidType:"选择 PNG、JPEG 或 WebP 图像。",referenceLocalReadFailed:"无法读取该图像。再选择一次。",referenceSource:{asset:"资产",element:"元素",local:"本地附件"},videoReferenceLabel:"视频参考",videoReferenceCostNote:"使用视频参考可能会增加提供商费用。",advancedPresetsLabel:"高级预设",providerDefaultsHelp:"该模型使用提供商默认值,无需额外预设。",chooseModelForPresets:"在顶部选择器中选择一个型号以查看其支持的预设。",refreshList:"刷新状态",connect:"连接",connecting:"正在连接",connectOpensBrowser:"在浏览器窗口中打开提供商登录。",refreshConnection:"重新连接",disconnect:"断开",connectionActionFailed:"连接操作无法完成。稍后再试。",popupBlocked:"登录窗口被封锁。允许弹出窗口,然后再次连接。",locked:"锁定",unavailable:"不可用",unknownProvider:"{provider} 的连接信息不可用。",disconnectedSelection:"保存的提供程序已断开连接。在“设置”中重新连接。",disabledProvider:"该提供程序在当前服务器配置中被禁用。",selectionUnavailable:"所选的 MCP 提供商不可用。在“设置”中检查其连接。",higgsfieldLocked:"该提供商的代数已锁定。",toolCount:"{count} 工具",toolCountUnknown:"工具数量未知",snapshotChanges:"{count} 架构更改",billingLabel:"计费",billingSubscription:"订阅积分",billingApi:"API 使用计费",billingUnknown:"未知",generateFailed:"无法启动 MCP 生成。",errorUnsupportedInput:"该模型不支持选定的参考类型之一。选择兼容型号或将其删除。",errorEndRequiresStart:"在添加结束帧之前选择开始帧。",errorInvalidReferences:"一张或多张参考图像不再可用。再次选择他们。",errorInvalidFrame:"所选帧或视频不再可用。再选择一次。",errorTempReferences:"无法准备本地参考图像。再选择一次。",status:{disconnected:"已断开连接",connecting:"正在连接",auth_required:"需要登录",connected:"已连接",offline:"离线",error:"错误"},characterSlotLabel:"特点",characterSlotNone:"无字符绑定",characterSlotConflictHint:"删除 @element 提及使用字符绑定 - 它们不能组合。"},pE={image:"图像",video:"视频"},fE={free:"免费",approx:"〜${amount}",multimodeApprox:"最高~${amount} ({count})",label:"预计成本"},gE={download:"下载",copyImage:"复制图像",copyLastFrame:`最后
|
|
20
|
+
框架`,copyPrompt:"複製提示",continueHere:"在這裡繼續",continueHereTitle:"導入此圖像的提示並繼續工作",continueAsUrl:"URL 繼續",continueAsUrlTitle:"繼續使用原始提供者URL(1小時後過期)",animate:"動畫",animating:"動畫…",animateTitle:"從此影像產生 Grok 影片(影像到影片)",firstNode:"第一 node",firstNodeTitle:"將此圖像傳送至 Node 模式作為首先準備好的 node",info:"資訊",infoTitle:"顯示產生詳細資訊和出處",delete:"刪除",deleteTitle:"移至垃圾箱",more:"更多的",sendToComfyUI:"發送至 ComfyUI",sendToComfyUITitle:"將已儲存的圖片上傳至本機ComfyUI",permanentDelete:"永久刪除",permanentDeleteConfirm:"永久刪除“{filename}”?此操作無法撤銷。",upscale:"高級",upscaleTitle:"透過 Runway (MCP) 進行升級",upscaleFlavor:"味道",upscaleFlavorAuto:"自動",upscaleStart:"開始高檔",upscaleStarted:"高級開始",upscaleFailed:"高檔失敗",upscaleInvalid:"無效的高檔參數"},sI={switchTitle:"切換會話",loading:"載入中...",newSession:"新會話",newSessionTitle:"新會話",renameTitle:"重新命名",renamePrompt:"會話名稱",deleteTitle:"刪除",deleteConfirm:"刪除會話“{title}”?此操作無法撤銷。",empty:"還沒有工作階段",firstGraph:"我的第一張圖",untitled:"無標題工作階段",assetAbortedError:"一代並沒有乾淨地結束。從此 node 重試。"},cI={ariaLabel:"UI 模式",classic:"經典的",node:"Node",cardNews:"卡新聞",agent:"代理人"},dI={workspace:"座席工作區",workspaceActionFailed:"操作失敗:{reason}",bootFailed:"無法載入代理工作區",bootRetry:"重試",topbarBackToStudio:"返回工作室",topbarStudio:"工作室",topbarOpenQueue:"開啟佇列,{count} 活動作業",topbarCloseQueue:"關閉佇列",topbarQueueSheet:"生成隊列",title:"代理人",newSession:"新代理",sessions:"工作階段",openSessions:"顯示工作階段",closeSessions:"隱藏工作階段",sessionsUseRail:"將會話固定為緊湊型導軌",sessionsUseExpanded:"固定擴展會話列表",sessionSearch:"搜尋會話",renameSession:"重新命名會話",deleteSession:"刪除會話",deleteConfirm:"刪除“{title}”?",imageCount:"{count} 影像",compacted:"壓實",web:"網路",chat:"聊天",user:"使用者",assistant:"代理人",tool:"工具",toolExpand:"顯示工具詳細信息",toolCollapse:"隱藏工具詳細信息",toolImageCount:"{count} 張圖片",toolCallCount:"{count} 調用",toolGroup:"工具運行",toolInput:"輸入",toolOutput:"輸出",toolsShowMore:"更多的",toolsShowLess:"較少的",toolArtifacts:"文物",requestId:"請求ID",duration:"時長",toolStatus:{queued:"排隊",running:"跑步",complete:"完全的",error:"錯誤"},rightSidebar:"代理端工具",sidebarTabs:{image:"影像",library:"圖書館",forms:"表格",quality:"品質",model:"模型",queue:"佇列"},modelSettings:"模型設定",closeModelSettings:"關閉模型設定",openModelSettings:"開啟模型設定",modelTabView:"在「模型」標籤中查看",model:"模型",provider:"提供者",reasoningEffort:"推理",generationStrategy:"發電計劃",generationStrategyAuto:"根據用戶要求",generationStrategyManual:"固定計數",quality:"品質",size:"尺寸",format:"格式",moderation:"內容審查",variantsCount:"變體",maxAutoVariants:"自動最大",parallelism:"平行性",promptLibrary:"提示庫",forms:"表格",noForms:"沒有表單模板",insertPrompt:"插入",queue:"佇列",runningShort:"跑步",queuedShort:"等待",queueEmpty:"沒有排隊的代理工作。",cancelQueue:"取消",retryQueue:"重試",sessionRunning:"代運行",sessionQueued:"{count} 已排隊",sessionError:"產生錯誤",queueStatus:{queued:"排隊",running:"跑步",succeeded:"完畢",failed:"失敗的",canceled:"取消"},statusReady:"可用",statusGenerating:"產生",statusReconnecting:"重新連接",pending:"正在產生回應...",pendingQueued:"排隊等候...",pendingPlanning:"計劃回應...",pendingGenerating:"運行工具並生成...",runError:"運行失敗",errorRole:"錯誤",composerPlaceholder:"詢問任何問題或描述要創建什麼",slashCommands:"代理斜杠命令",slashDesc_question:"提出問題而不產生圖像",slashDesc_variants:"產生 N 個影像變體 (1-24)",slashDesc_generate:"有界扇出生成 (1-24)",slashDesc_parallelism:"限制並發工具調用",slashDesc_help:"顯示可用指令",attachReference:"附上參考資料",send:"傳送",webSearch:"使用搜尋",emptyChat:"輸入訊息以開始圖像或視訊工作。",emptyJumpLatest:"跳轉至最新",queueSummary:"{active} 有效 · {failed} 失敗",queuePlanSummary:"變異 {variants} · 並行 {parallel}",queueDetails:"技術細節",queueAnnouncement:"佇列已更新:{running} 正在運行,{queued} 已排隊,{failed} 失敗",queueTimeAgo:"{value} {unit} 前",queueTimeUnit:{second:"秒",minute:"分分鐘",hour:"小時"},progressQueued:"排隊等候",progressPlanning:"準備請求",progressGenerating:"產生",progressDownloading:"下載結果",progressFailed:"運行失敗",progressJob:"{kind} · {count} 變體",mediaKind:{image:"影像",video:"影片"},mediaSelect:"分眾媒體",mediaLoading:"載入影片",mediaLoadFailed:"影片無法載入。",mediaRetry:"重試",mediaVideoLabel:"生成的視頻",mediaDuration:"持續時間 {duration}",mediaDurationUnknown:"持續時間不可用",mediaDownload:"下載",imagePane:"影像",currentImage:"目前影像",openImage:"打開圖片",closeImage:"關閉影像",selectImage:"焦點影像",variants:"變體",contextTabs:"影像上下文",imageTab:"影像",refsTab:"參考文獻",webTab:"網路",memoryTab:"記憶",noImage:"沒有當前影像",noRefs:"沒有參考文獻",noWeb:"沒有網路證據",memoryItemStyle:"樣式鎖定保留在圖像上下文中。",memoryItemSubject:"主題鎖定在恢復後恢復。",imageAlt:"代理形象",filename:"文件",prompt:"提示詞",stageEmptyHint:"在此處發送您的第一個查看圖片的請求",openTools:"打開工具面板",closeTools:"關閉工具面板"},uI={workspace:"卡新聞工作區",composer:"卡新聞",composerHint:"模板是視覺快照;輸出尺寸單獨設定。",topic:"話題",topicPlaceholder:"例如考試復出計劃",audience:"觀眾",audiencePlaceholder:"例如父母",goal:"目標",goalPlaceholder:"例如預約諮詢",brief:"簡短的",briefPlaceholder:"描述卡片新聞內容、所需要點和排除內容。",outputSize:"輸出尺寸",customSize:"風俗",draft:"摘要草案",drafting:"起草...",generateSet:"生成集",batchGenerate:"批量生成",generating:"生成...",generated:"產生 {count} 卡。",missingGeneratedCard:"產生回應不包括這張卡。",error:"卡生成失敗。",imageTemplate:"圖片模板",roleTemplate:"卡牌結構",newTemplateLater:"開發 MVP 後計畫客製化模板",emptyTitle:"等待草稿",emptyBody:"使用左側設定面板準備卡片組。",inspector:"卡片檢驗員",cardTitle:"卡標題",headline:"標題",body:"身體",visualPrompt:"圖片提示",summaryCopy:"摘要副本",designPrompt:"場景/設計提示",textFields:"文字方塊",addTextField:"新增文字框",removeTextField:"消除",noTextFields:"還沒有文字方塊。",textFieldText:"文字",textKind:"種類",placement:"放置",renderMode:"渲染模式",hierarchyLabel:"等級制度",textTooLong:"文字超出建議長度。",selectTextField:"選擇文字方塊:{text}",textKinds:{headline:"標題",body:"支援文字",caption:"標題",cta:"電腦輔助科技協會",badge:"徽章",number:"數位"},renderModes:{"in-image":"在影像中","ui-only":"僅 UI"},hierarchy:{primary:"基本的",secondary:"中學",supporting:"配套"},placements:{"top-left":"左上角","top-center":"頂部中心","top-right":"右上角","center-left":"中偏左",center:"中心","center-right":"中右","bottom-left":"左下角","bottom-center":"底部中心","bottom-right":"右下角",free:"免費"},roles:{cover:"覆蓋",hook:"鉤",problem:"問題",insight:"洞察力",example:"例子",data:"數據",summary:"概括",cta:"電腦輔助科技協會"},locked:"鎖定",unlocked:"解鎖",noCard:"未選擇卡",generatedMeta:"產生的元數據",lockedHelp:"鎖定的卡片不參與批量生成和重試。",retryCard:"重試此卡",actions:{copyPrompt:"複製提示",copyCopy:"複製複製",openImage:"打開圖片",downloadCard:"下載"},status:{draft:"草稿",queued:"排隊",generating:"產生",generated:"完畢",error:"錯誤",skipped:"跳過",locked:"鎖定"},progress:{generating:"產生 {done}/{total}",summary:"完成 {done}/{total}",detail:"{queued} 已排隊 · {errors} 錯誤 · {skipped} 已跳過",cardGenerating:"產生這張卡。"},planner:{structured:"結構化 JSON",jsonMode:"JSON 模式",repaired:"已修復",fallback:"後備草案",jsonOnlyHelp:"草稿僅建立 JSON。圖像稍後生成。",error:"草稿失敗"}},mI={selectedCameraPresets:"選定的攝影機運動預設",plannerModelTitle:"規劃模型",reasoningEffortTitle:"推理努力",modeLabel:"視訊模式",mode:{"text-to-video":"文字→影片(無參考圖)","image-to-video":"圖片 → 影片(1 篇參考)","reference-to-video":"參考 → 影片({n} 參考)"},seriesTopicTitle:"系列專題",seriesTopicPlaceholder:"例如韓國旅遊視訊博客",durationTitle:"長度",resolutionTitle:"解析度",resolution1080Help:"1080p 使用 Grok V1.5 進行僅提示或單一影像/幀影片。它不適用於 2 個以上的參考文獻。",aspectTitle:"縱橫比",plannerUpdateFailed:"無法更新規劃器模型。之前的設定已恢復。",continuationFallbackT2V:"無法提取連續幀。生成將繼續以文字到影片的形式進行。"},pI={appName:"影像生成器",imageModelLabel:"模型",imageSectionLabel:"影像",gptImageSubLabel:"GPT-IMAGE-2",grokImageSubLabel:"Grok Imagine",geminiImageSubLabel:"Gemini",videoSectionLabel:"影片",imageModelAria:"選擇圖像模型",quickSettingsAria:"選擇模型和推理工作。當前模型{model},推理{effort}",quickSettingsModelOnlyAria:"選擇圖像模型。目前型號 {model}",quickSettingsMenu:"模型和推理快速設置",reasoningLabel:"推理",videoModelLabel:"影片",nodeModeHint:"在 node 模式下,按一下 node 編輯其提示並產生。右側面板上的設定(品質/尺寸)適用於每個新結果。"},fI={openAria:"開啟設定",openTitle:"設定",closeAria:"關閉設定",closeTitle:"返回畫布",navAria:"設定部分",contentAria:"設定內容",jumpTo:"跳到 {section}",title:"設定",sections:{providers:{title:"供應商",hint:"帳戶、金鑰、模型"},workspace:{title:"工作空間",hint:"簡介、佈置、畫廊"},general:{title:"一般的",hint:"語言"}},account:{primaryEyebrow:"活躍的提供者",oauthTitle:"GPT OAuth",oauthBody:"GPT OAuth 產生貫穿您的 Codex OAuth 會話。配置有效密鑰後,您可以切換到 API-密鑰模式。",apiSourceEnv:"偵測到 OPENAI_API_KEY",apiSourceConfig:"偵測到 config.json API 密鑰",apiTitle:"OpenAI API 密鑰",apiBody:"ima2-gen 可以使用此 API 密鑰透過回應 API 進行產生、編輯、多重模式和 node 請求。",apiDisabled:"不可用",apiReady:"可用",apiUnavailable:"不可用",apiUnknown:"狀態未知",grokEyebrow:"本地 xAI 代理",grokTitle:"Grok",grokBody:"在配置的本機連接埠使用 progrok 產生 xAI 映像 API。",agyEyebrow:"Antigravity CLI",agyTitle:"Gemini (agy)",agyInstalledBody:"無法檢測登入狀態。如果產生失敗,請在終端機中執行 `agy login` 。",agyMissingBody:"未安裝。獲取",agyMissingLink:"Antigravity CLI",agyFineprint:"Antigravity 模型和影像配額是單獨計費。",agyInstalled:"已安裝",agyMissing:"未安裝",status:{ready:"可用",authRequired:"需要登入",starting:"開始",offline:"離線",noImageModel:"無影像模型",error:"錯誤",checking:"檢查"}},quota:{codexNotLoggedIn:"未登入",fetchError:"無法加載配額",noData:"無使用數據",grokUsageLink:"看 Grok 用法 →",switchAccount:"切換 {provider} 帳戶",startingLogin:"開始登入...",enterCode:"在打開的選項卡中輸入此代碼:",retry:"重試",copyLink:"複製連結",copied:"已複製",waitingApproval:"等待批准...",switchComplete:"帳號已切換。清爽…",switchFailed:"帳戶切換失敗",tryAgain:"再試一次"},imageModel:{title:"影像模型",body:"選擇供後代使用的影像模型。選擇 Grok 模型會將提供者切換到 Grok。",gpt54Mini:"GPT-5.4 迷你",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt56Sol:"GPT-5.6 索爾",gpt56Terra:"GPT-5.6 泰拉",gpt56Luna:"GPT-5.6 露娜",grokImagine20:"Grok Imagine 圖像 2.0",grokImagine:"Grok Imagine",grokImagineQuality:"Grok Imagine 質量",nanoBanana2:"奈米香蕉2",nanoBanana2Api:"奈米香蕉2",nanoBananaPro:"奈米香蕉專業版",atlasCloudGptImage2:"阿特拉斯雲 GPT Image 2",atlasCloudGptImage2Edit:"阿特拉斯雲 GPT Image 2 編輯",minimaxImage01:"MiniMax image-01",minimaxImage01Live:"MiniMax image-01-live",agy:"Antigravity (agy)",gpt53CodexSpark:"GPT-5.3 Codex Spark — 不支援影像",unsupportedHelp:"Grok 模型透過捆綁的本地代理使用 xAI 的圖像 API。 GPT 模型使用 OpenAI 回應影像產生。"},apiKeys:{accordionTitle:"API 密鑰",envSource:"從環境載入",configSource:"從配置載入",openai:{label:"GPT API 密鑰 (OpenAI)",placeholder:"貼上您的 OpenAI API 密鑰(sk-...)"},xai:{label:"Grok API 密鑰 (xAI)",placeholder:"貼上您的 xAI API 密鑰 (xai-...)"},gemini:{label:"Gemini (Google)",placeholder:"貼上您的 Gemini API 密鑰(AI...)"},atlascloud:{label:"阿特拉斯雲",placeholder:"貼上您的 Atlas Cloud API 金鑰(apikey-...)"},minimax:{label:"MiniMax",placeholder:"貼上您的 MiniMax API 密鑰"},vertex:{label:"Vertex AI(服務帳戶)",placeholder:'貼上您的 Google 雲端服務帳號 JSON { "type": "service_account",... }',authModeApiKey:"API 密鑰",authModeVertex:"頂點 JSON"},save:"節省",saved:"已儲存",saving:"正在驗證...",remove:"移除",saveFailed:"無法儲存密鑰",networkError:"網路錯誤。再試一次。",removeFailed:"無法移除鑰匙",configuredReplace:"已配置 — 按一下以取代",status:{valid:"有效的",notConfigured:"未配置"}},videoModel:{grokImagine:"Grok Imagine 視頻",grokImagine15:"Grok Imagine 影片 1.5"},reasoning:{title:"推理努力",body:"更高的努力會在生成之前花費更多的推理令牌來規劃、網路搜尋和提示豐富。",none:"關——沒有額外的推理",low:"低——最快、最少的推理",medium:"中 — 平衡預設值",high:"高——更深入的研究與綜合",xhigh:"Xhigh — 擴展推理,速度較慢",max:"Max-最大推理,最慢"},webSearch:{title:"網頁搜尋",body:"在生成之前使用即時搜尋來尋找真實的人物、品牌、產品、地點和最近的事件。",on:"搜尋於",off:"關閉搜尋"},grokCompatibility:{title:"Grok 相容性",body:"Grok 圖像生成首先運行強製網絡搜索,然後將文字和附加圖像發送到本地圖像工具規劃器,該規劃器用英語編寫最終圖像提示。附上透過 xAI 影像編輯的參考路線;大小對應到寬高比/解析度。輸出格式、審核和推理僅由 GPT OAuth 和 API 密鑰提供者使用。"},grokPlanner:{title:"Grok 規劃器模型",body:"該模型用於搜尋和圖像/視訊提示規劃。 Grok 4.5 為默認,支援I2V/Ref2V 規劃的影像輸入;Grok 4.3 仍可用作相容性覆蓋。"},gallery:{defaultScopeTitle:"預設圖庫視圖",defaultScopeBody:"選擇開啟圖庫時顯示的內容。"},appearance:{historyStripLayoutTitle:"歷史縮圖",historyStripLayoutBody:"選擇緊湊的歷史記錄條位於工作區旁的方式。",historyStripLayout:{rail:"軌",horizontal:"頂排",sidebar:"側邊欄"}},language:{title:"語言",body:"切換介面語言,不會變更生成內容。"}},gI={loading:"正在載入會話...",addFirst:"+ 增加第一個 node",addRootTitle:"加根 node",hint:"將手把拖曳到空白區域以進行分支。按刪除或退格鍵刪除。"},hI={title:"{provider} 不可用",ariaLabel:"{provider} 不可用"},yI={label:"語言",ko:"한국어",en:"English","zh-Hant":"正體中文","zh-Hans":"简体中文"},vI={close:"關閉",details:"顯示原始錯誤詳細訊息",unknown:{title:"發生意外錯誤",body:"請稍後重試。如果問題仍然存在,請複製下面的原始錯誤訊息並報告。"},moderationRefused:{title:"提示被審核阻止",body:"軟化措辭或改寫。參考圖像中的敏感/暴力內容也可能觸發此問題。",cta:"編輯提示",bodyInput:"您的提示文字已被輸入過濾器捕獲。嘗試改寫或使用不同的措詞。",bodyOutput:"產生的影像被輸出濾波器捕獲。嘗試更改樣式或品質設定。"},emptyResponse:{title:"沒有返回圖像",body:"Codex 回應但不包含影像資料。這不是一個調節塊 - 它可能是一個短暫的問題或不受支援的尺寸/品質/型號組合。重試,或嘗試不同的尺寸或型號。",cta:"重試"},streamParseFailed:{title:"無法解析圖像響應流",body:"響應數據到達,但應用程式無法乾淨地讀取圖像流。代理或瞬態流傳輸問題可能會發生這種情況。",cta:"重試"},imageToolNotCalled:{title:"未呼叫圖像工具",body:"響應已完成,但未觀察到圖像生成工具呼叫。重試相同的提示,或嘗試其他模型/搜尋設定。",cta:"重試"},webSearchOnlyResponse:{title:"未呼叫圖像工具",body:"僅運行網路搜尋;圖像生成工具沒有。關閉搜尋或重試請求。",cta:"重試"},imageToolFailed:{title:"圖像工具呼叫失敗",body:"呼叫了圖像生成工具,但最終以失敗狀態結束。如果重複出現此情況,請使用 `ima2 doctor image-probe --json` 輸出報告它。",cta:"重試"},imageToolNoResult:{title:"影像結果為空",body:"圖像工具呼叫已完成,但不包含圖像資料。這可能表示選項組合不受支援或帳戶功能問題。",cta:"重試"},oauthImageCapabilityUnavailable:{title:"該帳戶可能沒有圖像工具存取權限",body:"GPT OAuth 已連接,但此帳戶/模型組合可能無權使用影像產生。與 API-key 模式或其他模式進行比較。",cta:"確定"},responsesStreamError:{title:"圖像響應流以錯誤結束",body:"OpenAI 在回應流中傳回了錯誤事件。請稍後重試,如果問題仍然存在,請檢查原始錯誤詳細資訊。",cta:"重試"},upstream5xx:{title:"OpenAI 目前正忙",body:"重試通常可以解決此問題。檢查 status.openai.com 如果它仍然存在。",cta:"重試"},authChatgptExpired:{title:"Codex ChatGPT 會話已過期",body:"在終端機中執行 `ima2 setup`(選項 1),然後重新載入此應用程式。",cta:"重新載入"},authApiKeyInvalid:{title:"API 金鑰驗證失敗",body:"金鑰遺失、無效、已撤銷、超出配額或綁定到錯誤的組織。切換到 GPT OAuth 或更新配置的 API 密鑰。",cta:"確定"},networkFailed:{title:"網路連線失敗",body:"無法存取 OpenAI 或本地運行時服務。先重新載入;如果問題仍然存在,請檢查 VPN/防火牆以及 `ima2 doctor` 顯示的連接埠。",cta:"重新載入"},oauthUnavailable:{title:"GPT OAuth 代理程式不可用",body:"GPT OAuth 代理程式正在啟動、無法使用或移至備用連接埠。先重新載入;如果仍然存在,請執行 `ima2 doctor` 並檢查報告的 GPT OAuth URL。",cta:"重新載入"},invalidRequest:{title:"圖片請求需要更改",body:"一個或多個生成參數無效。檢查下面的原始錯誤詳細信息,然後編輯提示或大小並重試。",cta:"編輯輸入"},apikeyDisabled:{title:"API-按鍵模式不可用",body:"此版本支援 API-密鑰生成,但目前請求無法使用配置的密鑰。切換到 GPT OAuth 或更新 API 密鑰。",cta:"確定"},agyGenerationFailed:{title:"Gemini 產生失敗",body:"Antigravity CLI 回傳錯誤。檢查 agy 二進位檔案是否已安裝且您的 Gemini 帳戶是否處於活動狀態。",cta:"重試"},agyTimeout:{title:"Gemini 產生逾時",body:"agy 程序在逾時視窗(360 秒)內沒有回應。重試或檢查 agy CLI 狀態。",cta:"重試"},agyProcessError:{title:"Gemini 進程錯誤",body:"agy CLI 因意外錯誤而退出。驗證二進位檔案是否可以與「agy --version」一起使用。",cta:"重試"},agyQuotaExhausted:{title:"Gemini 配額已用完",body:"您已用盡 Gemini 圖像生成能力。您的配額將自動重設 - 檢查錯誤詳細資料中的重設計時器。",cta:"確定"},authClass:{title:"需要重新登入",body:"服務商認證已過期或金鑰遭拒。請至設定重新登入。",cta:"重新登入"},billingRequired:{title:"需要儲值",body:"此服務商帳戶餘額不足。請前往服務商主控台確認後重試。"}},bI={title:"提示庫",saveTitle:"儲存到提示庫",save:"節省",saved:"提示已儲存",saveFailed:"保存失敗",name:"姓名",tags:"標籤",search:"搜尋提示...",favorites:"收藏夾",load:"載入",insert:"插入",inserted:"提示已插入",removeInserted:"刪除插入的提示 {name}",favorite:"最喜歡的",unfavorite:"不喜歡",empty:"尚未儲存提示。",content:"內容",copy:"複製",untitled:"無題",addNew:"新增提示",import:"進口",importFiles:"匯入.txt、.md、.markdown 或 GitHub 文件",dropImport:"拖曳.txt、.md 或.markdown 檔案以匯入提示",importTitle:"導入提示",importDropTitle:"將文件拖到此處",importDropHint:"儲存前預覽.txt、.md 和.markdown 文件",importChooseFiles:"選擇文件",importGithubLabel:"GitHub 檔案 URL 或路徑",importPreview:"預覽",importPreviewEmpty:"拖放檔案或輸入 GitHub 路徑來預覽候選。",importCommit:"儲存選定的內容",importSelected:"導入選定的 ({count})",importThisPrompt:"導入此提示",previewPrompt:"預覽",selectPrompt:"選擇",selectedPrompt:"已選擇",selectedCount:"已選擇 {count}",selectAllCandidates:"選擇全部",clearCandidateSelection:"清除",addAnotherSource:"增加另一個來源",searchResultsHeader:"搜尋結果 ({count})",searchResults:"搜尋結果",promptText:"提示文字",importSelectAtLeastOne:"至少選擇一個提示進行儲存。",imported:"導入的 {count} 提示",importFailed:"導入失敗",importNoValidFiles:"未找到.txt、.md 或.markdown 提示檔。",curatedSources:"精選來源",curatedSourcesHint:"搜尋已索引的公共提示來源",curatedSearch:"搜尋",curatedSearchPlaceholder:"奈米香蕉,gpt-image-2,排版......",refreshSource:"重新整理",curatedRefreshed:"已索引的 {count} 提示候選者",sourceTrustTier:"來源信任",requiresAttribution:"需要歸屬",sourceDetails:"來源",license:"執照",attributionRequired:"需要歸屬",modelHints:"型號提示",taskHints:"任務提示",warnings:"警告",compatibilityWarnings:"相容性警告",transparentUnsupportedGptImage2:"gpt-image-2 不支援透明背景",noCuratedResults:"未找到精選的提示候選人。",discovery:"發現",discoverySearch:"搜尋 GitHub",discoverySearchPlaceholder:"搜尋提示儲存庫...",discoveryCandidates:"發現候選人",discoveryApprove:"核准",discoveryReject:"拒絕",discoveryApproved:"得到正式認可的",discoveryRejected:"被拒絕",discoveryScore:"分數",discoveryWarnings:"發現警告",discoveryRateLimited:"GitHub 發現是有速率限制的。",discoveryNoResults:"未找到發現候選。",discoveryReviewQueue:"審核佇列",discoveryRequiresPaths:"在預設搜尋之前新增已審閱的檔案路徑。",folderBrowse:"瀏覽資料夾",folderBrowseHint:"從 GitHub 資料夾載入支援的文件",folderFiles:"資料夾檔案",folderFilesEmpty:"找不到可匯入的.md、.markdown 或.txt 檔案。",folderPreviewSelected:"預覽選定的文件",folderSelectedCount:"已選擇 {count}",folderWarnings:"資料夾警告",folderTooManyFiles:"文件太多;顯示有限集。",folderNoSelection:"選擇要預覽的文件。",folderUnsupported:"僅支援 GitHub 資料夾。"},SI={title:"提示產生器",subtitle:"透過多輪上下文細化提示。",scopeDraft:"新作品",scopeImage:"所選影像:{name}",scopeImageFallback:"目前影像",newWorkTitle:"在沒有圖像上下文的情況下開始新的工作",model:"建造者模型",empty:"描述一下你想要的方向。我將包括您當前的提示和設定作為上下文。",user:"你",assistant:"建設者",placeholder:"我們該樹立什麼樣的形象?",send:"傳送",sending:"寫作",thinking:"完善提示...",clear:"清除",applyToPrompt:"適用於提示",insertAsBlock:"插入區塊",finalKoreanPrompt:"韓語提示",finalEnglishPrompt:"英文提示",blockName:"建造商建議",applied:"建構器建議應用於主提示",inserted:"作為提示區塊插入的建構器建議",failed:"提示建構器請求失敗",removeScopeImage:"從建構器上下文中刪除選定的影像",removeAttachment:"刪除附件 {name}",attach:"附加文件",attachmentOnlyMessage:"使用附加文件作為上下文並根據提示提供協助"},xI={sectionTitle:"工作空間",sectionBody:"選擇工作區佈局設定檔。",profileLabel:"工作區設定檔",defaultLabel:"預設",defaultDesc:"帶有側邊欄編輯器的標準生成工作流程。",promptStudioLabel:"提示工作室",promptStudioDesc:"提示建構器面板、分組記錄和增強的檢視器。"},AI={controls:"圖像縮放控件",zoomIn:"放大",zoomOut:"縮小",reset:"重設變焦"},TI={title:"紀錄",empty:"還沒有產生日誌",copied:"提示已複製",copy:"點選複製提示",loadFailed:"無法載入生成日誌。",retry:"重試",detailOpen:"點擊查看詳情",detailTitle:"生成請求",detailTime:"時間",detailRequestId:"請求 ID",detailCounts:"成功 / 請求",detailError:"錯誤代碼",detailPrompt:"提示詞",detailPromptEmpty:"(無提示詞)",detailErrorMessage:"失敗原因"},CI={writeFailed:"無法寫入剪貼簿。"},wI={graphSaveFailed:"無法儲存 node 圖表。",sessionSwitchSaveFailed:"由於無法儲存目前圖形,會話切換已停止。",sessionInitialLoadFailed:"無法載入會話。",sessionInitialLoadRetry:"無法載入會話。現在重試?",attachmentReadFailed:"無法讀取一個或多個附件。"},II={ariaLabel:"主導航",home:"家",create:"創造",node:"Node 圖",agent:"代理人",assets:"資產",assetGen:"資產生成",settings:"設定"},EI={title:"資產生成",lede:"建立圖片或短片,然後一鍵移除背景。",prompt:"提示詞",promptPlaceholder:"一個紅蘋果,工作室產品拍攝",background:"背景",backgroundHint:"綠色背景最適合去背;不確定時就選綠色。",bgChroma:"色度綠幕",bgWhite:"白色",bgBlack:"黑色",model:"模型",modelGpt:"GPT",modelGrok:"Grok",kind:"輸出",kindImage:"影像",kindVideo:"影片",videoSoon:"影片功能稍後推出",videoGrokOnly:"影片生成需要使用 Grok,請切換模型。",videoOptions:"影片選項",videoDuration:"影片時長",videoResolution:"影片解析度",videoAspect:"縱橫比",generate:"產生資產",generating:"生成…",emptyTitle:"還沒有資產",emptyBody:"在左側寫下提示,然後按下「產生資產」。結果顯示在此處並自動儲存到您的項目中。",previewImage:"開啟影像預覽:{prompt}",previewVideo:"開啟影片預覽:{prompt}",previewDialogTitle:"預覽:{prompt}",closePreview:"關閉預覽",zoomIn:"放大",zoomOut:"符合螢幕大小",openHintImage:"放大",openHintVideo:"播放",imageFallback:"生成的圖像",videoFallback:"生成的視頻",emptyCta:"寫下你的第一個提示",errorTitle:"生成失敗",errorHint:"請檢查模型與 API 金鑰設定後再試一次。",errorDismiss:"關閉",savedHint:"結果會自動儲存到您的專案中。",savedLink:"在資產中查看",railTitle:"專案資產",railEmpty:"該項目中尚未保存資產。",railError:"無法載入專案資產。",sequence:"影格序列",candidates:"候選影格",frameAria:"第 {n} 格,{rail}",addFrame:"加入",removeFrame:"移除",deleteFrame:"刪除第 {n} 格"},RI={select:"專案",unassigned:"未分配",new:"新項目…",newPrompt:"項目名稱",search:"尋找項目...",searchPlaceholder:"搜尋項目",searchEmpty:"沒有匹配的項目",close:"關閉",saveRetry:"重試保存"},NI={title:"角色表",open:"開啟角色表",close:"關閉角色表",state:"動畫狀態",unsaved:"未儲存的更改",discardConfirm:"放棄未儲存的精靈變更嗎?",loadError:"無法載入此精靈運行。",saveError:"無法保存策展。",bakeError:"無法製作角色圖集。",exportError:"無法匯出精靈動畫。",previous:"上一幀",play:"播放",pause:"暫停",next:"下一幀",speed:"速度",grid:"網格",transform:"影格變換",rotate:"旋轉",scale:"縮放",dx:"移動 X",dy:"移動 Y",shx:"剪切X",shy:"剪切Y",flipX:"水平翻轉",sequence:"影格序列——播放與製作順序",candidates:"候選影格庫",frameAria:"第 {n} 格,{rail}",addFrame:"加入",removeFrame:"移除",deleteFrame:"刪除第 {n} 格",save:"儲存角色表",bake:"製作角色圖集",contactSheet:"縮圖總覽",gif:"匯出 GIF",status:{loading:"載入中…",ready:"已儲存",saving:"儲存中…",baking:"製作中…",exporting:"匯出中…",error:"操作失敗"}},kI={title:"刪除背景",open:"刪除背景",original:"原圖",originalAlt:"去除背景前的原圖",removed:"背景已移除",previewLoading:"準備刪除背景預覽...",resultBadge:"背景已移除",keyColor:"去背色",pickHint:"點選預覽重新選擇主色",clickMode:"預覽點擊功能",modeErase:"點擊以擦除",modePick:"選擇去背色",eraseHint:"按一下空白區域以僅刪除該連線區域",undoClick:"撤銷點選 ({count})",previewAlt:"棋盤上的摳像預覽",tolerance:"去背強度",softness:"邊緣柔化",spill:"清理色溢",unmix:"邊緣去混色",unmixHint:"恢復半透明邊緣(僅限色度鍵)",reset:"重置",download:"下載透明 PNG",save:"儲存到項目",saving:"儲存中…",videoSave:"建立 alpha WebM",videoKeying:"鍵控影片... {seconds}s",videoSaved:"Alpha WebM 儲存到項目",saved:"Alpha PNG 儲存到專案中",saveError:"無法保存摳像影像",loadError:"無法載入此圖片進行摳像。關閉並重試。",advanced:"微調去背(進階)"},_I={ariaLabel:"快速行動",animate:"動畫",edit:"在畫布中編輯",useAsRef:"用作參考",rebake:"再生",refAdded:"新增為參考影像",refFailed:"無法新增參考",saveToAssets:"保存到資產",savedToAssets:"保存到資產",saveToAssetsFailed:"無法保存到資產"},MI={title:"資產",clearAll:"全部清除",clearConfirm:"刪除所有已儲存的資源?此操作無法撤銷。",testSheetsUnavailable:"元素測試表尚不可用。",detailAria:"{name} 詳細信息",searchPlaceholder:"搜尋資產...",allAssets:"所有資產",elementLibrary:"元素庫",removeFromElements:"從元素庫中刪除",emptyElementsTitle:"還沒有元素",emptyElementsBody:"元素是可重複使用的@可提及的參考(人物、產品、風格、場景)。將圖庫圖像儲存到資產並推廣它,然後在任何地方使用 @ 提及它。",newFolder:"新建資料夾",kindAll:"所有類型",kindImage:"圖片",kindVideo:"影片",kindElement:"元素",kindPreset:"預設",kindTemplate:"範本",emptyTitle:"還沒有資產",emptyBody:"尚未保存任何內容。在資產生成標籤中產生您的第一張圖像 - 結果會自動保存在此。",emptySearchTitle:"沒有匹配項",emptySearchBody:"嘗試不同的搜尋、標籤或類型過濾器。",emptyFolderTitle:"該資料夾是空的",emptyFolderBody:"將資源移至此處或將新結果儲存到此資料夾。",deleteAsset:"從資產中刪除",confirmDelete:"刪除?",loadMore:"加載更多",rootFolder:"頂級",renameFolder:"重新命名資料夾",renameAsset:"重命名資產",starAsset:"明星資產",unstarAsset:"刪除資產星級",deleteFolder:"刪除資料夾",actionFailed:"操作失敗",starSaved:"新增到資產",starSaveFailed:"已加星標,但無法新增至資產",itemCount:"{count} 項目",emptyCta:"開放資產生成",loadErrorTitle:"無法載入資源",loadErrorBody:"載入您的庫時出現問題。",retry:"再試一次",detailClose:"關閉資產詳細信息",detailKind:"類型",detailCreated:"建立時間",detailProvider:"模型",detailPrompt:"提示詞",detailTags:"標籤",bindingsTitle:"提供者綁定",bindingsHelp:"該角色如何連接到外部提供者。",bindingStateless:"每代的引用數",bindingTagPlaceholder:"runway @tag (可選)",bindingSave:"保存綁定",bindingSaving:"保存…",bindingTagInvalid:"標籤必須是 1-32 個字母、數字、底線或連字號。",bindingCapWarning:"角色有 {count} 引用 — Runway 每代最多接受 3 個。",bindingTrain:"火車靈魂ID",bindingTrainLockedHint:"需付費 Higgsfield 方案。",bindingPaidPlan:"需要付費計劃",bindingDriftWarning:"參考與訓練時快照不同-考慮重新訓練。"},PI={name:"Node 工作室",toolbar:{addImage:"新增圖片",templates:"範本",saveTemplate:"儲存模板",branch:"分支"},empty:{title:"建構圖像工作流程",description:"從提示開始,重複使用經過驗證的圖表,或繼續您的最新工作。",blankTitle:"從空白畫布開始",blankDescription:"增加一個提示 node 並自行塑造工作流程。",blankAction:"開始空白",templateTitle:"從模板開始",templateDescription:"複製現成的圖表以用於常見的生成工作流程。",templateAction:"瀏覽模板",recentTitle:"恢復最近的圖表",recentDescription:"繼續最近保存的有效圖表。",recentUnavailable:"目前尚無最新圖表。",recentAction:"恢復最近的",resumeError:"無法開啟最近的圖表。再試一次。"},elements:{ariaLabel:"元素節點",title:"元素",hint:"拖曳或添加",loading:"正在載入元素...",loadError:"無法載入元素。再試一次。",empty:"尚未儲存元素。",addToCanvas:"添加到畫布"},elementNode:{untitled:"無標題元素",referencesOutput:"元素引用輸出",notesOutput:"元素註解輸出",kind:"元素",referenceCountOne:"{count} 參考",referenceCount:"{count} 參考文獻",missing:"該元素已被刪除。運行前重新連線。"},elementController:{onlyElements:"只能將元素資源加入畫布。",invalid:"元素 node 無效。",addError:"無法將元素新增至畫布。"},branch:{defaultVariant:"變異 {index}",eyebrow:"分行工作流程",title:"創建變體",close:"關閉分支對話框",variantLegend:"變異 {index}",label:"標籤",provider:"提供者",modelOverride:"模型覆蓋",currentModel:"使用當前模型",sizeOverride:"尺寸覆蓋",currentSize:"使用目前尺寸",remove:"移除",add:"添加變體",cancel:"取消",create:"建立分支",selectSourceError:"選擇一個連接的來源 node。",applyError:"此分支無法應用,因此圖表保持不變。"},templates:{previewAria:"{name} 圖形預覽",nodeCountOne:"{count} 個節點",nodeCount:"{count} 節點",outputCountOne:"{count} 輸出",outputCount:"{count} 輸出",rename:"重新命名",delete:"刪除",deleteConfirm:"删除模板“{name}”?此操作無法撤銷。",title:"選擇模板",close:"關閉模板",searchLabel:"搜尋模板",searchPlaceholder:"名稱或標籤",loading:"正在載入模板...",empty:"沒有模板匹配“{query}”。",starter:"入門模板",yours:"您的模板",cancel:"取消",copy:"影印一份",loadError:"無法載入模板。再試一次。",replaceConfirm:"用此模板的副本替換當前圖形?",invalidGraph:"模板圖無效。",copyError:"無法複製模板。",namePrompt:"模板名稱",saved:"模板已儲存。",saveError:"無法儲存模板。",renamePrompt:"重新命名模板",renameError:"無法重命名模板。",deleteError:"無法刪除模板。"},palette:{ariaLabel:"插入 node 指令",compatiblePlaceholder:"與 {portType} 相容",searchPlaceholder:"搜尋節點",filter:"顯示接受 {portType} 的節點。",emptyCompatible:"node 不接受 {portType}。",emptySearch:"沒有節點與此搜尋相符。",commandsAria:"Node 指令",categories:{input:"輸入",generate:"產生",transform:"轉換",reference:"參考",output:"輸出"}},commands:{"image-generate":{label:"影像生成",description:"將影像 node 加入工作流程。"}},portTypes:{prompt:"提示詞",image:"影像",images:"圖片",video:"影片",mask:"面具","element-refs":"元素參考","element-notes":"元素註釋",settings:"設定","any-media":"任何媒體"},compatibility:{sameDirection:"將輸出埠連接到輸入埠。",typeMismatch:"這些連接埠類型不相容。",cardinality:"該輸入已經有一個連接。",selfEdge:"node 無法連接到自身。",duplicateEdge:"該連接已經存在。",unknownPort:"此連接埠不可用於連接。",cycle:"該連接會形成一個循環。"}},LI={tabs:{label:"資產工作流程",generate:"產生",sprite:"角色表"},title:"角色表",lede:"鎖定角色設定,然後產生動作一致的角色影格。",loading:"正在載入角色表…",loadError:"無法載入角色表。",retry:"重試",empty:{title:"建立角色表",body:"設定角色、影格尺寸與動畫狀態。",create:"建立角色表"},recipe:{select:"角色表",new:"新增角色表",name:"角色表名稱",characterId:"角色ID",description:"描述",style:"風格",baseAssetId:"基礎圖像資源",baseAsset:"基礎圖像資源",save:"儲存角色表",saving:"儲存中…",unsaved:"生成前儲存變更。"},cell:{title:"影格尺寸",width:"寬度",height:"高度",safeMarginX:"水平邊界",safeMarginY:"垂直邊界"},chroma:{title:"綠幕去背",hex:"去背顏色"},states:{title:"動畫狀態",add:"新增狀態",remove:"移除",key:"狀態名稱",frames:"影格數",fps:"FPS",loop:"環形",action:"動作"},anchor:{title:"身分錨",missing:"在行前產生並批准一個空閒姿勢。",generate:"生成空閒候選人",generating:"生成…",candidate:"候選人準備接受審查。",regenerate:"雷根",approve:"批准錨點",approved:"錨定批准",replace:"更換錨",confirmTitle:"批准這個身分錨?",confirmBody:"未來的行將重複使用此標識;基本影像將不會再次附加。",confirm:"核准",cancel:"取消"},rows:{title:"精靈行",generateAll:"產生全部",generateSelected:"產生選定的",regenerate:"重試行",cancel:"取消",preview:"預覽",anchorRequired:"首先批准錨點。",saveRequired:"首先儲存配方更改。",status:{pending:"待辦的",queued:"排隊",running:"跑步",complete:"完全的",error:"錯誤",canceled:"取消"}},error:{INVALID_SPRITE_RECIPE:"填寫所需的配方欄位。",ANCHOR_NOT_APPROVED:"首先批准身分錨。",BASE_REFERENCE_FORBIDDEN:"基礎鏡像審核通過後不可重複使用。",GENERATION_CANCELED:"一代被取消。",generic:"精靈生成失敗。"}},OI={undone:"撤銷最後的圖形變更。",redone:"重新繪製圖形變更。"},jI={t2i:"文字 → 圖片",i2i:"圖片編輯",t2v:"文字 → 視頻",i2v:"圖片 → 影片",v2v:"影片延續"},GI={title:"元素",titleEdit:"編輯元素",titleNew:"新元素",saved:"已儲存",ariaLabel:"元素詳情",name:"姓名",namePlaceholder:"例如胡桃木椅",kind:"種類",kindCharacter:"特點",kindProduct:"產品",kindStyle:"風格",kindScene:"場景",kindReference:"參考",selected:"選定的元素",mentionAria:"{name}、{kind} 元素",unavailableAria:"{name},不可用元素",removeAria:"刪除 {name} 元素",helpCharacter:"一個人或反覆出現的主題。",helpProduct:"設計細節一致的產品。",helpStyle:"視覺語言、材料或處理方式。",helpScene:"地點、環境或反覆出現的環境。",notes:"筆記",notesHelp:"描述應保持一致的外觀、材料和細節。",notesPlaceholder:"溫暖的胡桃木紋、圓潤的邊緣、編織的藤條座椅…",remaining:"剩餘 {n}",strength:"參考強度",strengthHelp:"生成的作品的強度應遵循這些參考文獻。",resetDefault:"重設為預設值",saving:"儲存中…",save:"儲存元素",testing:"正在產生測試表...",runTest:"運行測試表",delete:"刪除",errorName:"儲存之前命名您的元素。",errorRefs:"儲存前至少新增一張參考影像。",refsTitle:"參考圖片",refsHelp:"拖曳以設定順序。第一個圖像是代表性縮圖。",refAlt:"參考 {n}",refPrimary:"代表",refLabel:"標籤",refLabelPlaceholder:"正面、側面、材質…",refMoveUp:"將引用 {n} 向上移動",refMoveDown:"向下移動引用 {n}",refRemove:"消除",refRemoved:"參考已刪除。",refUndo:"撤銷"},DI={common:_w,appBar:Mw,sheet:Pw,toast:Lw,inflight:Ow,size:jw,sizeConfirm:Gw,quality:Dw,moderation:Fw,format:zw,count:qw,multimode:Uw,metadata:Hw,onboarding:Bw,readiness:Vw,generate:Kw,home:$w,billing:Yw,history:Xw,panel:Qw,prompt:Jw,canvas:Ww,gallery:Zw,node:eI,nodeBatch:tI,edge:nI,provider:aI,mcp:oI,grokMode:rI,cost:iI,result:lI,session:sI,uiMode:cI,agent:dI,cardNews:uI,video:mI,sidebar:pI,settings:fI,nodeCanvas:gI,apiDisabled:hI,language:yI,errorCard:vI,promptLibrary:bI,promptBuilder:SI,workspace:xI,viewer:AI,generationLog:TI,clipboard:CI,modal:wI,nav:II,assetGen:EI,project:RI,spriteCurator:NI,keying:kI,chain:_I,assets:MI,"assets.clearAll":"全部清除","assets.clearConfirm":"刪除所有已儲存的資源?此操作無法撤銷。",nodeStudio:PI,sprite:LI,graph:OI,provenance:jI,element:GI},FI={ok:"确定",cancel:"取消",delete:"删除",close:"关闭",saving:"保存...",loading:"加载中...",dismiss:"关闭通知",generating:"生成…",imageCollection:"{n} 图像集",remove:"移除",removeNamed:"删除 {name}",elementSuggestions:"元素建议",noMatchingElements:"没有匹配的元素",enterPrompt:"输入提示...",continuity:"连续性",activePrompt:"主动提示",elementUnavailable:"元素不可用",spritePreview:"精灵动画预览",canvasMemo:"画布备忘录",cardDeck:"卡牌组"},zI={modeImage:"图像",settings:"设置",controls:"发电控制",generate:"产生",generateAria:"打开提示表生成图像"},qI={close:"关闭提示表",generate:"生成图像",controlsOpen:"开放式发电控制",tabs:{prompt:"提示词",controls:"控制",library:"图书馆"}},UI={localImportSuccess:"图像已添加到图库",localImportFailed:"导入图片失败",localImportInvalid:"仅支持 PNG、JPEG 或 WebP",localStorageFull:"本地存储已满 - 最近的状态可能不会持续。",refLimitExceeded:"参考文献上限为 5。多余的图像被删除。",minimaxModelRequiresReference:"image-01-live 需要中国境外的参考图像。附上一个,或切换到 image-01。",refLimitTrayFull:"参考托盘已满 ({max})。使用 X 删除项目以附加更多 — 已删除的 @tags 可以使用 @ 重新提及。",refLimitPartial:"仅添加了 {total} 图像中的 {added}(限制 {max})。",refOverProviderLimit:"该提供程序最多接受 {max} 参考图像。删除 {excess} 来生成。",refTooLarge:"图片太大。转换为 JPEG/PNG 或降低分辨率并重试。",refNotBase64:"图像文件已损坏或使用了不受支持的编码。",refEmpty:"空图像文件。请选择不同的文件。",refHeicUnsupported:"不支持 HEIC/HEIF。转换为 JPEG 或 PNG 并重试。",noCurrentImageForRef:"没有当前图像可用作参考。",refSlotFull:"参考槽已满(最多 5 个)。",currentImageLoadFailed:"无法加载当前图像。",addedCurrentAsRef:"添加当前图像作为参考。",sessionLoadFailed:"无法加载会话。",sessionCreateFailed:"创建会话失败。",sessionRenameFailed:"无法重命名会话。",sessionDeleteFailed:"删除会话失败。",promptRequired:"输入提示。",missingElements:"缺少选定的元素。在生成之前将其删除或重新添加元素。",nodeCreated:"Node {id} 创建 ({elapsed}s)",nodeRootCreated:"从该图像创建第一个 node 。",animateStarted:"将图像动画化为视频...",animateProgress:"渲染视频…{n}%",animateDone:"视频准备好了。检查你的历史记录。",animateFailed:"视频生成失败。",nodeCreateFailed:"Node 生成失败。",generatedBatch:"在 {elapsed}s 中生成 {count} 图像。",generatedSingle:"在 {elapsed}s 中生成。",generateFailed:"一代失败。",sessionReloadedElsewhere:"图表版本发生变化,因此重新加载最新图表。",promptCopied:"提示已复制",metadataCopied:"已复制",imageCopied:"已复制到剪贴板",frameCopied:"帧已复制到剪贴板",copyFailed:"复制失败",openGeneratedDirFailed:"无法打开图像文件夹。运行ima2 doctor检查存储路径。",openGeneratedDirOpened:"打开生成的图像文件夹。",noPromptToFork:"没有提示分叉",forkStarted:"提示导入。再次编辑并生成。",forkStartedNoPrompt:"附上图片作为参考。输入提示并生成。",continueAsUrlStarted:"提供程序 URL 设置为参考。生成以使用原始图像。",continueAsUrlExpired:"提供程序 URL 已过期。请改用此处继续。",comfyExported:"作为 {filename} 发送到 ComfyUI。",comfyExportInvalidUrl:"ComfyUI URL 必须是本地 HTTP 地址。",comfyExportInvalidImage:"此保存的图像无法发送到 ComfyUI。",comfyExportImageNotFound:"未找到保存的图像文件。",comfyExportFailed:"无法将图像上传到 ComfyUI。",cancelFailed:"无法取消生成。",errorClass:{rateLimited:"请求过于频繁,请稍后再试。",providerTimeout:"服务商响应超时,请稍后再试。",networkFailure:"无法连接服务商。请检查网络后重试。",contentRejected:"服务商拒绝了该提示词,请修改后重试。",capabilityUnsupported:"当前服务商不支持此请求。",modelUnavailable:"所选模型暂时不可用。",internalState:"内部状态异常,请重新加载页面。"}},HI={queued:"排队",planning:"规划",streaming:"生成",decoding:"敲定",canceling:"取消",noPrompt:"无提示",cancelAria:"取消生成:{prompt}",title:"飞行中",badgeOpen:"显示飞行中的 {n} 代",badgeClose:"隐藏飞行中的 {n} 代",inlineCollapse:"崩溃飞行中的 {n} 代",footerHint:"您可以关闭此面板——生成会继续。",kindImage:"图像",kindVideo:"视频",kindNode:"节点",kindMcp:"MCP",progressAria:"生成进度:{n}%"},BI={title:"尺寸",grokAspectTitle:"纵横比",grokResolutionTitle:"分辨率",width:"宽度",height:"高度",hint:"16px 步长,最大边缘 3840,比例高达 3:1,655K–829M 像素",autoLabel:"自动",autoSub:"型号选择",customLabel:"自定义",customSub:"自由形式",customPlus:"+ 定制",customSlots:"保存的尺寸",customSlot:"自定义",customSlotLimit:"最多 3 种自定义尺寸",saveCustomSlot:"保存自定义尺寸",replaceCustomSlot:"更换插槽",ratioFree:"自由比例",ratio21x9:"21:9",normalizedPreview:"会发送",noAdjustment:"无需调整",squareMaxHint:"由于 829 万像素限制,平方最大值为 {size}。",adjustedReasons:{snap:"捕捉到 16 像素",maxEdge:"最大边缘",ratio:"比率限制",minPixels:"最小像素",maxPixels:"最大像素",min:"最小边缘",max:"最大边缘",pixels:"像素限制"}},VI={title:"需要调整尺寸",body:"请求的大小超出了图像生成限制。",requested:"要求尺寸",adjusted:"调整后的尺寸",approve:"批准并生成",cancel:"取消",reasonRatio:"该比例超出了 3:1 的限制。",reasonPixels:"超出了最大像素限制。",reasonMinPixels:"请求的图像像素太少。",reasonMin:"尺寸低于最小值。",reasonMax:"大小超过最大值。",reasonSnap:"尺寸必须以 16 像素为增量对齐。"},KI={title:"质量",grokTitle:"Grok 质量",grokModelTitle:"模型",lowLabel:"低",lowSub:"快速",mediumLabel:"中",mediumSub:"均衡",highLabel:"高",highSub:"最佳"},$I={title:"内容审核",autoLabel:"自动",autoSub:"标准安全过滤器",lowLabel:"低",lowSub:"较宽松的过滤器",explain:"自动使用标准安全过滤器;低模式会放宽限制,因此部分边界提示词可能会通过。"},YI={title:"格式"},XI={title:"数数",customPlus:"+n",customLabel:"自定义计数",highCountHint:"对于参考或高质量的计数,较高的计数可能需要更长的时间。",minMaxHint:"使用 1-24 张图像。",decrease:"减少计数",increase:"增加计数"},QI={label:"序列",tooltip:"用一个提示词生成多个阶段",shortHint:"规划中的阶段",maxStages:"最多阶段数",highCountHint:"较高的阶段数可能需要几分钟的时间。",minMaxHint:"使用 1-24 级。",composerBadge:"序列·共 {count} 段",composerAriaLabel:"序列提示编辑器,最多 {count} 个阶段",promptPlaceholder:"描述要生成的阶段;关闭序列后搭配数量,可批量生成相同提示词。",promptPlaceholderWithRefs:"使用所附参考文献描述分阶段顺序。",toggleDisabledGenerating:"等待当前一代完成",sequenceTitle:"序列结果",sequenceProgress:"{returned}/{requested} 图像",stageLabel:"阶段{index}",generating:"生成...",partialAlt:"部分多模式预览",partial:"在 {elapsed}s 中生成 {returned}/{requested} 图像。",complete:"在 {elapsed}s 中生成 {returned}/{requested} 图像。",notReturned:"未退回",empty:"没有返回图像",error:"生成失败",canceled:"取消",cancel:"取消"},JI={restoreTitle:"恢复图像设置",restoreBody:"该图像包含 ima2 生成元数据。应用其提示和设置,或仅将其附加作为参考。",applySettings:"应用设置",useAsReferenceOnly:"仅供参考",noMetadata:"未找到 ima2 元数据。",invalidMetadata:"图像元数据无效。",unsupportedFormat:"仅可以恢复 PNG、JPEG 和 WebP 元数据。",readFailed:"无法读取图像元数据。",applied:"图像设置已恢复。",sourceXmp:"XMP",sourcePngComment:"PNG 评论",imageAlt:"放置图像预览",prompt:"提示词",size:"尺寸",quality:"质量",model:"模型",source:"来源",title:"生成详情",asset:"资产",summary:"生成摘要",copy:"复制",copyRaw:"复制原始 JSON",copyField:"复制 {label}",rawJson:"原始元数据 JSON",sections:{provider:"供应商和型号",settings:"生成设置",usage:"用量与时间",lineage:"来源链",video:"视频",videoContinuity:"视频连续性",prompts:"提示"},fields:{provider:"提供者",authPath:"认证路径",model:"模型",providerUrl:"提供商 URL",requestId:"请求ID",quality:"质量",size:"尺寸",format:"格式",moderation:"内容审核",reasoning:"推理",promptMode:"提示方式",kind:"种类",mediaType:"媒体类型",elapsed:"耗时",tokens:"代币",totalTokens:"代币总数",inputTokens:"输入",cachedTokens:"缓存",outputTokens:"输出",reasoningTokens:"推理",webSearchCalls:"网络搜索",grokCostTicks:"Grok 成本刻度",usage:"用量",filename:"文件名",createdAt:"创建时间",sessionId:"会话",nodeId:"节点",parentNodeId:"父级 node",clientNodeId:"客户端 node",refsCount:"参考",sequence:"顺序",setId:"批次",cardId:"卡片",videoDuration:"视频时长",videoResolution:"视频分辨率",videoAspectRatio:"纵横比",videoRequestedModel:"要求的型号",videoEffectiveModel:"有效模式",videoModelFallback:"模型后备",xaiVideoRequestId:"xAI 视频请求",sourceImageFilename:"源图片",lineageId:"来源链 ID",parentFilename:"父项文件",sourceFrame:"来源帧",continuityEntries:"连续性条目",latestContinuityPrompt:"最新连续性提示",promptPrimary:"提示词",userPrompt:"用户提示",prompt:"存储提示",revisedPrompt:"修改提示",composerPrompt:"作曲家提示",insertedPrompts:"插入的提示"}},WI={title:"你好!第一次来这里?",body:"登录以开始生成。您可以连接 ChatGPT、Grok 或 Gemini。",login:"是的,让我登录",skip:"我自己设置一下"},ZI={title:"生成准备状态",open:"检查准备情况",openTitle:"检查提供商、身份验证、模型和网络搜索准备情况",settingsTitle:"生成准备状态",settingsBody:"打开一个包含提供者、身份验证、模型、推理和网络搜索状态的紧凑弹出窗口。",ready:"准备生成",readyBody:"所选提供商可用。",blocked:"提供商需要关注",provider:"提供者",model:"模型",reasoning:"推理",webSearch:"网页搜索",grokApi:"Grok API",grokApiBody:"通过捆绑的 progrok 运行:强制搜索、Grok 4.5 英语图像和文本工具规划,然后是 xAI Images API。附加参考使用 xAI 图像编辑,因此保留了 i2i 上下文。",openAccount:"开设账户设置"},eE={button:"产生",buttonLoading:"生成({n})"},tE={recentTitle:"最近的工作",selectedCount:"已选择 {count}",selectedPresets:"选定的预设",referenceTrayCount:"{count} 参考文献",referenceTrayAria:"{count} 引用附加到下一代",viewAll:"查看全部",heroTitle:"从满意的那一张,继续展开。",heroLede:"在本机生成、编辑、让画面动起来。不主动发送,就不会离开这台机器。",lanesReady:"{total} 条生成通道中 {ready} 条就绪",lanesNone:"暂无就绪通道 — 请在设置中连接",modesTitle:"工作区",modeCreateHint:"生成并打磨单张图像",modeNodeHint:"把一个结果分成多个方向",modeAgentHint:"说明需求,交给智能体执行",modeAssetsHint:"收藏并重复使用你的成果",untitledResult:"未命名结果",recentResultAlt:"最近结果:{prompt}",mediaUnavailable:"无法显示预览"},nE={label:"API 状态",checking:"检查...",offline:"离线",remaining:"剩余 ${remaining}",thisMonth:"本月 ${amount}",oauthFree:"GPT OAuth · 通过 codex 免费",apiDisabled:"API 密钥准备就绪",apiReady:"API 密钥准备就绪",oauthMode:"GPT OAuth 模式"},aE={openGalleryAria:"打开画廊",openGalleryTitle:"打开完整画廊",openGalleryShort:"全部",galleryCard:"打开画廊",recentTitle:"最近几代人",collapseRecent:"崩溃最近几代",expandRecent:"扩展最近几代",collapseRecentShort:"隐藏",expandRecentShort:"展示",emptyRecent:"生成的图像将出现在此处。",generatingCollection:"正在生成 {count} 图像...",selectRecent:"选择生成的图像",deleteImageAria:"从历史记录中删除图像",deleteSequenceAria:"删除 {count}-图像序列",deleteSequenceConfirm:"删除此多模式序列中的所有 {count} 图像?",sequenceDeleted:"从历史记录中删除了 {count} 序列图像"},oE={closeSettings:"关闭设置",detailSettings:"设置",toggleShow:"显示设置",toggleHide:"隐藏设置",open:"打开",close:"关闭"},rE={label:"提示词",refCount:"参考 {count}/{max}",trayAria:"参考托盘,{max} 的 {count}",deadTagHint:"标签已从托盘上移除 — 仅供参考",deadTagStatus:"提示中不可用的引用:{tags}",refChipTitle:"参考 {n}",refChipAlt:"参考 {n}",refRemoveAria:"删除引用 {n}",placeholder:"描述您想要的图像。拖放或粘贴以附加参考图像...",placeholderWithRefs:"描述如何处理所附图片...",attach:"附",attachTitle:"附上参考图片",useCurrent:"使用电流",useCurrentTitle:"使用当前结果作为参考",continue:"继续",continueTitle:"从当前结果继续作为参考",savePrompt:"节省",storyboard:"故事板",storyboardTitle:"启用故事板模式 - 在连续帧之间保持角色和场景的连续性",videoToggleTitle:"切换视频模式 (Grok 1.5)",directMode:"直接的",directModeActive:"1:1直接上",directModeTitle:"逐字传递提示(直接模式)",urlRefActive:"URL 参考",urlRefActiveTitle:"提供程序 URL 引用处于活动状态,将用于代替附加的图像引用。单击以清除。",urlRefClear:"清除提供者 URL 参考",moveBlockUp:"将 {name} 向上移动",moveBlockDown:"向下移动 {name}",afterBlocks:"主提示后",hint:"Ctrl+Enter 生成",dropHere:"拖放到附件作为参考(最多 {max})"},iE={modeTitle:"画布模式",resultAlt:"结果",imageViewerAria:"生成的图像查看器。使用左右箭头键在图像之间移动。",tokens:"{n} 代币",open:"打开画布",openAria:"以画布模式打开图像",dragToComposer:"拖到作曲家作为参考",dragHint:"拖",annotationInstructionsChip:"画布笔记",close:"关闭画布",blank:{title:"空白画布",subtitle:"在白纸上画草图,然后继续。",create:"创建空白画布",creating:"创造...",failed:"无法创建空白画布"},drop:{hint:"拖放图像以添加到图库"},toolbar:{label:"画布注释工具",select:"选择",bgGroup:"出口背景",bgAlpha:"阿尔法",bgMatte:"哑光的",bgMatteColor:"哑光色",cleanup:"干净的背景",cleanupMark:"标记",cleanupRemove:"消除",cleanupPreserve:"保存",cleanupInput:"输入",cleanupClick:"点击",cleanupBrush:"刷子",cleanupBrushSize:"刷子",cleanupTolerance:"宽容",cleanupAutoSample:"角球",cleanupPickSeed:"采摘种子",cleanupPickingSeed:"点击背景",cleanupActive:"已激活",cleanupPreview:"预览",cleanupPreviewing:"正在预览...",cleanupApply:"申请 PNG",cleanupApplying:"正在申请...",cleanupReset:"重置",cleanupSeedCount:"{n} 种子",cleanupRemoved:"{n}% 已删除",cleanupPickHint:"单击图像上的背景",cleanupBrushHint:"绘制要标记的区域",cleanupMaskHint:"紫色面具将被移除",cleanupApplied:"已创建透明 PNG",cleanupFailed:"后台清理失败",zoomGroup:"画布缩放",zoomIn:"放大",zoomOut:"缩小",zoomReset:"重置变焦",zoomShortcutHint:"双指缩放·两指平移·[ / ]·0",pen:"笔",box:"盒子",arrow:"箭",memo:"便签纸",eraser:"橡皮",eraserMenu:"橡皮擦选项",objectEraser:"物体橡皮擦",brushEraser:"刷子橡皮擦",apply:"保存画布版本",applyDone:"画布版本已保存",applyFailed:"无法保存画布版本",export:"导出图片",exporting:"出口...",exportFailed:"导出失败",undo:"撤消",redo:"重做",deleteSelected:"删除所选内容",editMask:"编辑盒装区域",editMaskDisabled:"先画一个盒子",editMaskFailed:"屏蔽编辑失败",editMaskUnsupported:"当前图像提供商不支持蒙版编辑",style:"风格",color:"颜色",strokeWidth:"笔划宽度",clear:"全部清除",exportFormat:"导出格式",exportAs:{png:"PNG 图像",svg:"SVG 向量",pptx:"PowerPoint 幻灯片"}},version:{saving:"正在保存画布版本...",saved:"画布版本已保存",failed:"无法保存画布版本",usingAsReference:"Canvas版本已准备好作为参考"},revert:{action:"恢复烘焙笔记",mixedConfirm:"此版本还包含像素编辑。恢复烘焙笔记将丢弃这些像素编辑。继续?",restored:"烘焙笔记恢复为可编辑草稿",completed:"烘焙笔记和像素编辑已恢复",failed:"无法恢复烘焙笔记"}},lE={today:"今天",yesterday:"昨天",thisWeek:"本星期",earlier:"早些时候",imageAltFallback:"生成的图像",deleteTitle:"移至系统垃圾箱",deleteAria:"删除图像",ariaLabel:"图片库",title:"画廊",total:"{n} 总计",totalFiltered:"/ {n} 总计",sortByAria:"排序方式",sortByDate:"日期",sortBySession:"会话",favoriteFilterAria:"最喜欢的过滤器",filterAll:"全部",filterFavorites:"收藏夹",searchPlaceholder:"搜索提示或文件名",searchDisabledPlaceholder:"在会话视图中禁用搜索",closeAria:"关闭画廊",closeTitle:"关闭(Esc)",sessionLabel:"会话 {name}",standalone:"独立图像",emptySessions:"尚未保存任何会话。",emptyAll:"还没有图像。先创建一个。",emptyFavorites:"还没有最喜欢的图像。",noResults:"没有结果。",loadOlder:"加载较旧的",loadingOlder:"正在加载较旧的...",loadOlderFavorites:"加载较旧的收藏夹",loadingOlderFavorites:"正在加载旧的收藏夹...",sessionPaginationHint:"会话视图使用当前页面。切换到日期视图以加载旧图像。",sessionLoading:"正在加载会话组...",sessionLoadFailed:"无法加载会话组。",sessionLimitNotice:"显示最新的 {count} 项目。较旧的项目不包含在会话视图中。",retry:"重试",loadOlderFailed:"无法加载旧的画廊项目。",storageNoticeTitle:"保管须知",storageNoticeRecoverable:"抱歉吓到了。最新版本将图库文件夹从已安装的包移至用户数据文件夹。您的旧图像可能仍在之前生成的文件夹中。运行 ima2 doctor 或打开恢复指南。",storageNoticeNotFound:"抱歉吓到了。我们在这台机器上找不到以前生成的文件夹。如果在更新过程中替换了旧的全局安装文件夹,则可能无法自动恢复。运行 ima2 doctor 并查看恢复指南以了解手动搜索步骤。",storageNoticeUnknown:"无法检查存储状态。如果更新后图库看起来是空的,请运行 ima2 doctor 检查图像文件夹。",openGeneratedDir:"打开文件夹",openGeneratedDirTitle:"打开生成的图像文件夹",cardNewsSet:"卡新闻集",cardNewsCard:"卡片新闻卡",openCardNewsSet:"开集",openCardNewsSetFailed:"无法打开卡片新闻集。",copyCardNewsSetPath:"复制路径",cardNewsPathCopied:"卡新闻设置路径已复制。",downloadCardNewsManifest:"显现",cardNewsCount:"{n} 卡",deleted:"已删除:{filename}",undo:"撤消",secondsSuffix:"{n}s",permanentDeleted:"永久删除:{filename}",movedToSystemTrash:"移至系统垃圾箱:{filename}",deleteFailed:"无法删除图像。",restoreFailed:"无法恢复图像。",favoriteTitle:"添加到收藏夹",unfavoriteTitle:"从收藏夹中删除",favoriteAria:"添加到收藏夹",unfavoriteAria:"从收藏夹中删除",favoriteFailed:"无法更新收藏夹",scopeAria:"画廊范围",scope:{current:"当前会话",all:"所有图片"},empty:{currentSession:"此会话中还没有图像。"}},sE={empty:"空的",elementMissing:"元素“{name}”已删除。运行前重新连接。",pending:"生成",reconciling:"正在同步",reconcilingPhase:"正在同步·{phase}",ready:"完成 · {elapsed}s",readyWithSearch:"完成·{elapsed}s·搜索{searches}",stale:"陈旧",staleWithError:"陈旧:{error}",assetMissing:"资产失踪",assetMissingWithError:"资产缺失:{error}",error:"错误:{error}",errorUnknown:"未知",nodeImageAlt:"Node 图像",partialImageAlt:"部分node图像预览",noAsset:"没有资产",stateStale:"状态陈旧",noImage:"无图像",editPromptPlaceholder:"编辑提示...",promptPlaceholder:"提示词...",regenerate:"雷根",newVariation:"新版本",generate:"根",generateTitle:"生成 node 图像",addChild:"孩子",addChildTitle:"添加子项 node",duplicateBranch:"分支",duplicateBranchTitle:"复制为新的分支根",deleteTitle:"删除",regenerateTitle:"就地重新生成 node",newVariationTitle:"在同一父项下创建一个新的同级变体",parentImageRequired:"首先生成父图像。",attachRef:"附",attachRefTitle:"附上 node 参考图像",refAlt:"Node 参考 {n}",removeRef:"删除引用 {n}",dropRefs:"将图像拖放到此处",nodeRefsUnsupportedForEdit:"目前仅根节点支持额外引用。",nodeRefsUsedWithParent:"与父图像一起使用。",classicRefsParkedTitle:"经典参考已停放",classicRefsParkedBody:"这些图像属于经典作曲家,在 node 模式下处于非活动状态。",clearParkedRefs:"清除停放的参考",retry:"重试",retryTitle:"重试这个 node 的生成",errorAuthCta:"检查您的帐户或 API 密钥,然后重新生成。",errorFixCta:"调整提示或引用,然后再次生成。"},cE={selectionOn:"选择",selectionOff:"选择",selectAll:"选择全部",summary:"{selected} 已选择 · {missing} 缺失 · {stale} 受影响",generateMissing:"生成缺失",regenerateSelected:"重新生成选定的",stopRemaining:"停止剩余",stopping:"停止",clear:"清除",noneSelected:"未选择节点。",parentRequired:"{count} 选择的 node 首先需要准备好父映像。",nothingToRun:"没有选定的节点需要生成。",stopQueued:"当前的 node 将完成,然后剩余的队列将停止。",failed:"在 {done}/{total} node(s) 之后停止。",finished:"已完成 {done}/{total} node(s)。",staleBecauseParentChanged:"重新生成了上游 node ;需要时刷新此 node 。",cycleBlocked:"无法运行:{count} 选择的 node 形成循环。",partialFinished:"已完成 {done}/{total} — {failed} 失败,{skipped} 已跳过。"},dE={disconnect:"断开",disconnectTitle:"断开选定的边",disconnected:"连接已移除。",parentConflict:"node 只能有一个父连接。",cycleBlocked:"该连接会形成一个循环。"},uE={authTitle:"提供者",apiLabel:"API 密钥",statusReady:"可用",statusConnected:"已连接",statusAuthRequired:"需要登录",statusDisconnected:"已断开连接",statusLineTitle:"状态",authMethodTitle:"授权",authActive:"已激活",oauthNotReady:"GPT OAuth 代理尚未准备好。",codexLoginRequired:"需要 Codex 登录。",codexLoginHint:"在终端中运行 `codex login`,然后刷新此页面。",oauthStarting:"GPT OAuth 代理正在启动。几秒钟后重试。",serverUnreachable:"无法到达服务器。确保后端正在运行。",apiInvalid:"API 密钥丢失或无效。检查服务器.env 中的 OPENAI_API_KEY。",grokOffline:"Grok 代理未运行。",grokNoImageModel:"未找到 Grok 图像生成模型。",grokNotReady:"Grok 不可用。",grokOfflineHint:"如果需要,运行 `ima2 grok login` 一次,然后启动 `ima2 serve`; ima2 自动启动捆绑的 Grok 代理。",grokManagedByIma2:"Grok 通过位于 127.0.0.1:18645 的捆绑 progrok 代理在 `ima2 serve` 内部本地运行。",grokClassicOnly:"Grok 图像生成在此表面中不可用。",grokClassicOnlyHint:"使用启用了 Grok 的生成表面。",grokCompatTitle:"Grok 图像 API",grokCompatBody:"ima2 服务在 127.0.0.1:18645 管理捆绑的 progrok 代理。 Grok 始终在图像生成之前进行搜索,将附加引用发送到 Grok 4.5 规划器中,通过 xAI 图像编辑保留它们,并将大小映射到 xAI 宽高比/分辨率。输出格式、审核和推理仅是 OpenAI 提供商设置。",settingsBody:"选择下一代请求使用哪个提供商。",availableTitle:"{name} 可用",availableAria:"{name}:可用",unavailableAria:"{name}:不可用",availableSr:"(可用的)",unavailableSr:"(不可用)",xaiApiKeyRequired:"需要 xAI API 密钥",geminiApiKeyRequired:"Gemini API 需要密钥",atlasCloudApiKeyRequired:"Atlas Cloud 需要 API 密钥",minimaxApiKeyRequired:"MiniMax API 需要密钥",comingSoon:"即将推出",agyCompatTitle:"Gemini (agy)",agyCompatBody:"1024x1024 固定,JPEG 输出,最多 3 个参考。没有质量/尺寸控制。",agyCompatBodyLong:"1024x1024 固定输出,JPEG 格式,最多 3 个参考图像。没有网络搜索,没有质量/尺寸控制。",geminiApiCompatTitle:"Gemini API",geminiApiCompatBody:"Google Gemini API。支持从 512px 到 4K 的宽高比和分辨率控制。",geminiApiCompatBodyLong:"Google Gemini API 直接。支持 nano-banana-2 (Flash) 和 nano-banana-pro (Pro),宽高比和分辨率控制范围为 512px 至 4K。",gptCompatTitle:"GPT Image",gptCompatBody:"OpenAI 通过响应 API 生成图像。支持质量、大小、格式、审核和网络搜索设置。"},mE={connectionsTitle:"MCP 提供商连接",connectionsBody:"连接官方提供商帐户并查看工具状态。只有连接的提供商才会出现在生成选择器中。",providerLabel:"发电商",modelLabel:"生成模型",coreProviders:"核心提供商",connectedProviders:"连接的 MCP 提供商",imageModels:"图像模型",videoModels:"视频模型",chooseModel:"选择型号",loadingModels:"加载模型",loadingProviders:"检查连接",providersLoadFailed:"无法加载 MCP 提供程序状态。",modelsLoadFailed:"模型加载失败 — 点击重试",retryModels:"重试",noModels:"没有适用于此模式的型号。",refreshingConnection:"清爽…",exitLane:"使用核心提供商",modelSectionTitle:"模型",ratioAutoHelp:"自动让模型选择自己的纵横比。某些型号可能会拒绝预设。",aspectRatioLabel:"纵横比",durationLabel:"时长",resolutionLabel:"分辨率",qualityLabel:"质量",modeLabel:"模式",audioLabel:"声音的",onLabel:"在",offLabel:"离开",toolInputsLabel:"参考媒体",referenceNone:"没有任何",referenceSelect:"从画廊中选择",referenceCurrent:"当前画廊项目",referenceMissing:"不在加载的历史记录中",startFrameLabel:"起始帧",endFrameLabel:"结束框架",endFrameNeedsStart:"首先选择一个起始帧。",imageReferencesLabel:"图片参考(最多 3 个)",imageReferenceAria:"图片参考{index}",referenceTagAria:"图像参考标签 {index}",referenceTagPlaceholder:"可选标签",referenceTagInvalid:"使用 1-32 个字母、数字、下划线或连字符作为标签。",referenceAttachLocal:"附上本地图片",referenceAttachHelp:"本地图像暂时上传,并在生成稳定后删除。",referenceLocalFallback:"本地图片",referenceLocalInvalidType:"选择 PNG、JPEG 或 WebP 图像。",referenceLocalReadFailed:"无法读取该图像。再选择一次。",referenceSource:{asset:"资产",element:"元素",local:"本地附件"},videoReferenceLabel:"视频参考",videoReferenceCostNote:"使用视频参考可能会增加提供商费用。",advancedPresetsLabel:"高级预设",providerDefaultsHelp:"该模型使用提供商默认值,无需额外预设。",chooseModelForPresets:"在顶部选择器中选择一个型号以查看其支持的预设。",refreshList:"刷新状态",connect:"连接",connecting:"正在连接",connectOpensBrowser:"在浏览器窗口中打开提供商登录。",refreshConnection:"重新连接",disconnect:"断开",connectionActionFailed:"连接操作无法完成。稍后再试。",popupBlocked:"登录窗口被封锁。允许弹出窗口,然后再次连接。",locked:"锁定",unavailable:"不可用",unknownProvider:"{provider} 的连接信息不可用。",disconnectedSelection:"保存的提供程序已断开连接。在“设置”中重新连接。",disabledProvider:"该提供程序在当前服务器配置中被禁用。",selectionUnavailable:"所选的 MCP 提供商不可用。在“设置”中检查其连接。",higgsfieldLocked:"该提供商的代数已锁定。",toolCount:"{count} 工具",toolCountUnknown:"工具数量未知",snapshotChanges:"{count} 架构更改",billingLabel:"计费",billingSubscription:"订阅积分",billingApi:"API 使用计费",billingUnknown:"未知",generateFailed:"无法启动 MCP 生成。",errorUnsupportedInput:"该模型不支持选定的参考类型之一。选择兼容型号或将其删除。",errorEndRequiresStart:"在添加结束帧之前选择开始帧。",errorInvalidReferences:"一张或多张参考图像不再可用。再次选择他们。",errorInvalidFrame:"所选帧或视频不再可用。再选择一次。",errorTempReferences:"无法准备本地参考图像。再选择一次。",status:{disconnected:"已断开连接",connecting:"正在连接",auth_required:"需要登录",connected:"已连接",offline:"离线",error:"错误"},characterSlotLabel:"特点",characterSlotNone:"无字符绑定",characterSlotConflictHint:"删除 @element 提及使用字符绑定 - 它们不能组合。"},pE={image:"图像",video:"视频"},fE={free:"免费",approx:"〜${amount}",multimodeApprox:"最高~${amount} ({count})",label:"预计成本"},gE={download:"下载",copyImage:"复制图像",copyLastFrame:`最后
|
|
21
21
|
框架`,copyFirstFrame:`第一
|
|
22
22
|
框架`,copyMidFrame:`中
|
|
23
|
-
框架`,copyPrompt:"复制提示",continueHere:"在这里继续",continueHereTitle:"导入此图像的提示并继续工作",continueAsUrl:"URL 继续",continueAsUrlTitle:"继续使用原始提供商URL(1小时后过期)",animate:"动画",animating:"动画…",animateTitle:"从此图像生成 Grok 视频(图像到视频)",firstNode:"第一个 node",firstNodeTitle:"将此图像发送到 Node 模式作为首先准备好的 node",info:"信息",infoTitle:"显示生成详细信息和出处",delete:"删除",deleteTitle:"移至垃圾箱",more:"更多的",sendToComfyUI:"发送至 ComfyUI",sendToComfyUITitle:"将保存的图片上传到本地ComfyUI",permanentDelete:"永久删除",permanentDeleteConfirm:"永久删除“{filename}”?此操作无法撤消。",upscale:"高档",upscaleTitle:"通过 Runway (MCP) 进行升级",upscaleFlavor:"味道",upscaleFlavorAuto:"自动",upscaleStart:"开始高档",upscaleStarted:"高档开始",upscaleFailed:"高档失败",upscaleInvalid:"无效的高档参数"},hE={switchTitle:"切换会话",loading:"加载中...",newSession:"新会话",newSessionTitle:"新会话",renameTitle:"重命名",renamePrompt:"会话名称",deleteTitle:"删除",deleteConfirm:"删除会话“{title}”?此操作无法撤消。",empty:"还没有会话",firstGraph:"我的第一张图",untitled:"无标题会话",assetAbortedError:"一代人并没有干净地结束。从此 node 重试。"},yE={ariaLabel:"UI 模式",classic:"经典的",node:"Node",cardNews:"卡新闻",agent:"代理人"},vE={workspace:"座席工作区",workspaceActionFailed:"操作失败:{reason}",bootFailed:"无法加载代理工作区",bootRetry:"重试",topbarBackToStudio:"返回工作室",topbarStudio:"工作室",topbarOpenQueue:"打开队列,{count} 活动作业",topbarCloseQueue:"关闭队列",topbarQueueSheet:"生成队列",title:"代理人",newSession:"新代理",sessions:"会话",openSessions:"显示会话",closeSessions:"隐藏会话",sessionsUseRail:"将会话固定为紧凑型导轨",sessionsUseExpanded:"固定扩展会话列表",sessionSearch:"搜索会话",renameSession:"重命名会话",deleteSession:"删除会话",deleteConfirm:"删除“{title}”?",imageCount:"{count} 图像",compacted:"压实",web:"网络",chat:"聊天",user:"用户",assistant:"代理人",tool:"工具",toolExpand:"显示工具详细信息",toolCollapse:"隐藏工具详细信息",toolImageCount:"{count} 张图片",toolCallCount:"{count} 调用",toolGroup:"工具运行",toolInput:"输入",toolOutput:"输出",toolsShowMore:"更多的",toolsShowLess:"较少的",toolArtifacts:"文物",requestId:"请求ID",duration:"时长",toolStatus:{queued:"排队",running:"跑步",complete:"完全的",error:"错误"},rightSidebar:"代理端工具",sidebarTabs:{image:"图像",library:"图书馆",forms:"表格",quality:"质量",model:"模型",queue:"队列"},modelSettings:"模型设置",closeModelSettings:"关闭模型设置",openModelSettings:"打开模型设置",modelTabView:"在“模型”选项卡中查看",model:"模型",provider:"提供者",reasoningEffort:"推理",generationStrategy:"发电计划",generationStrategyAuto:"根据用户要求",generationStrategyManual:"固定计数",quality:"质量",size:"尺寸",format:"格式",moderation:"内容审核",variantsCount:"变体",maxAutoVariants:"自动最大",parallelism:"并行性",promptLibrary:"提示库",forms:"表格",noForms:"没有表单模板",insertPrompt:"插入",queue:"队列",runningShort:"跑步",queuedShort:"等待",queueEmpty:"没有排队的代理工作。",cancelQueue:"取消",retryQueue:"重试",sessionRunning:"代运行",sessionQueued:"{count} 已排队",sessionError:"生成错误",queueStatus:{queued:"排队",running:"跑步",succeeded:"完毕",failed:"失败的",canceled:"取消"},statusReady:"可用",statusGenerating:"生成",statusReconnecting:"重新连接",pending:"正在生成响应...",pendingQueued:"排队等候...",pendingPlanning:"计划回应...",pendingGenerating:"运行工具并生成...",runError:"运行失败",errorRole:"错误",composerPlaceholder:"询问任何问题或描述要创建什么",slashCommands:"代理斜杠命令",slashDesc_question:"提出问题而不生成图像",slashDesc_variants:"生成 N 个图像变体 (1-24)",slashDesc_generate:"有界扇出生成 (1-24)",slashDesc_parallelism:"限制并发工具调用",slashDesc_help:"显示可用命令",attachReference:"附上参考资料",send:"发送",webSearch:"使用搜索",emptyChat:"输入消息以开始图像或视频工作。",emptyJumpLatest:"跳转至最新",queueSummary:"{active} 有效 · {failed} 失败",queuePlanSummary:"变体 {variants} · 并行 {parallel}",queueDetails:"技术细节",queueAnnouncement:"队列已更新:{running} 正在运行,{queued} 已排队,{failed} 失败",queueTimeAgo:"{value} {unit} 前",queueTimeUnit:{second:"秒",minute:"分钟",hour:"小时"},progressQueued:"排队等候",progressPlanning:"准备请求",progressGenerating:"生成",progressDownloading:"下载结果",progressFailed:"运行失败",progressJob:"{kind} · {count} 变体",mediaKind:{image:"图像",video:"视频"},mediaSelect:"分众媒体",mediaLoading:"加载视频",mediaLoadFailed:"视频无法加载。",mediaRetry:"重试",mediaVideoLabel:"生成的视频",mediaDuration:"持续时间 {duration}",mediaDurationUnknown:"持续时间不可用",mediaDownload:"下载",imagePane:"图像",currentImage:"当前图像",openImage:"打开图片",closeImage:"关闭图像",selectImage:"焦点图像",variants:"变体",contextTabs:"图像上下文",imageTab:"图像",refsTab:"参考文献",webTab:"网络",memoryTab:"记忆",noImage:"没有当前图像",noRefs:"没有参考文献",noWeb:"没有网络证据",memoryItemStyle:"样式锁保留在图像上下文中。",memoryItemSubject:"主题锁定在恢复后恢复。",imageAlt:"代理形象",filename:"文件",prompt:"提示词",stageEmptyHint:"在此处发送您的第一个查看图片的请求",openTools:"打开工具面板",closeTools:"关闭工具面板"},bE={workspace:"卡新闻工作区",composer:"卡新闻",composerHint:"模板是视觉快照;输出尺寸单独设置。",topic:"话题",topicPlaceholder:"例如考试复出计划",audience:"观众",audiencePlaceholder:"例如父母",goal:"目标",goalPlaceholder:"例如预约咨询",brief:"简短的",briefPlaceholder:"描述卡片新闻内容、所需要点和排除内容。",outputSize:"输出尺寸",customSize:"风俗",draft:"概要草案",drafting:"起草...",generateSet:"生成集",batchGenerate:"批量生成",generating:"生成...",generated:"生成 {count} 卡。",missingGeneratedCard:"生成响应不包括这张卡。",error:"卡生成失败。",imageTemplate:"图片模板",roleTemplate:"卡牌结构",newTemplateLater:"开发 MVP 后计划定制模板",emptyTitle:"等待草稿",emptyBody:"使用左侧设置面板准备卡片组。",inspector:"卡片检验员",cardTitle:"卡标题",headline:"标题",body:"身体",visualPrompt:"图片提示",summaryCopy:"摘要副本",designPrompt:"场景/设计提示",textFields:"文本框",addTextField:"添加文本框",removeTextField:"消除",noTextFields:"还没有文本框。",textFieldText:"文本",textKind:"种类",placement:"放置",renderMode:"渲染模式",hierarchyLabel:"等级制度",textTooLong:"文本超出建议长度。",selectTextField:"选择文本框:{text}",textKinds:{headline:"标题",body:"支持文字",caption:"标题",cta:"计算机辅助技术协会",badge:"徽章",number:"数字"},renderModes:{"in-image":"在图像中","ui-only":"仅 UI"},hierarchy:{primary:"基本的",secondary:"中学",supporting:"配套"},placements:{"top-left":"左上角","top-center":"顶部中心","top-right":"右上角","center-left":"中偏左",center:"中心","center-right":"中右","bottom-left":"左下角","bottom-center":"底部中心","bottom-right":"右下角",free:"免费"},roles:{cover:"覆盖",hook:"钩",problem:"问题",insight:"洞察力",example:"例子",data:"数据",summary:"概括",cta:"计算机辅助技术协会"},locked:"锁定",unlocked:"解锁",noCard:"未选择卡",generatedMeta:"生成的元数据",lockedHelp:"锁定的卡不参与批量生成和重试。",retryCard:"重试此卡",actions:{copyPrompt:"复制提示",copyCopy:"复制复制",openImage:"打开图片",downloadCard:"下载"},status:{draft:"草稿",queued:"排队",generating:"生成",generated:"完毕",error:"错误",skipped:"跳过",locked:"锁定"},progress:{generating:"生成 {done}/{total}",summary:"完成 {done}/{total}",detail:"{queued} 已排队 · {errors} 错误 · {skipped} 已跳过",cardGenerating:"生成这张卡。"},planner:{structured:"结构化 JSON",jsonMode:"JSON 模式",repaired:"已修复",fallback:"后备草案",jsonOnlyHelp:"草稿仅创建 JSON。图像稍后生成。",error:"草稿失败"}},SE={selectedCameraPresets:"选定的摄像机运动预设",plannerModelTitle:"规划模型",reasoningEffortTitle:"推理努力",modeLabel:"视频模式",mode:{"text-to-video":"文字→视频(无参考图片)","image-to-video":"图片 → 视频(1 个参考)","reference-to-video":"参考 → 视频({n} 参考)"},seriesTopicTitle:"系列专题",seriesTopicPlaceholder:"例如韩国旅游视频博客",durationTitle:"长度",resolutionTitle:"分辨率",resolution1080Help:"1080p 使用 Grok V1.5 进行仅提示或单图像/帧视频。它不适用于 2 个以上的参考文献。",aspectTitle:"纵横比",plannerUpdateFailed:"无法更新规划器模型。之前的设置已恢复。",continuationFallbackT2V:"无法提取连续帧。生成将继续以文本到视频的形式进行。"},xE={appName:"图像生成器",imageModelLabel:"模型",imageSectionLabel:"图像",gptImageSubLabel:"GPT-IMAGE-2",grokImageSubLabel:"Grok Imagine",geminiImageSubLabel:"Gemini",videoSectionLabel:"视频",imageModelAria:"选择图像模型",quickSettingsAria:"选择模型和推理工作。当前模型{model},推理{effort}",quickSettingsModelOnlyAria:"选择图像模型。当前型号 {model}",quickSettingsMenu:"模型和推理快速设置",reasoningLabel:"推理",videoModelLabel:"视频",nodeModeHint:"在 node 模式下,单击 node 编辑其提示并生成。右侧面板上的设置(质量/尺寸)适用于每个新结果。"},AE={openAria:"打开设置",openTitle:"设置",closeAria:"关闭设置",closeTitle:"返回画布",navAria:"设置部分",contentAria:"设置内容",jumpTo:"跳转到 {section}",title:"设置",sections:{providers:{title:"供应商",hint:"账户、密钥、模型"},workspace:{title:"工作空间",hint:"简介、布局、画廊"},general:{title:"一般的",hint:"语言"}},account:{primaryEyebrow:"活跃的提供商",oauthTitle:"GPT OAuth",oauthBody:"GPT OAuth 生成贯穿您的 Codex OAuth 会话。配置有效密钥后,您可以切换到 API-密钥模式。",apiSourceEnv:"检测到 OPENAI_API_KEY",apiSourceConfig:"检测到 config.json API 密钥",apiTitle:"OpenAI API 密钥",apiBody:"ima2-gen 可以使用此 API 密钥通过响应 API 进行生成、编辑、多模式和 node 请求。",apiDisabled:"不可用",apiReady:"可用",apiUnavailable:"不可用",apiUnknown:"状态未知",grokEyebrow:"本地 xAI 代理",grokTitle:"Grok",grokBody:"在配置的本地端口使用 progrok 生成 xAI 映像 API。",agyEyebrow:"Antigravity CLI",agyTitle:"Gemini (agy)",agyInstalledBody:"无法检测登录状态。如果生成失败,请在终端中运行 `agy login` 。",agyMissingBody:"未安装。获取",agyMissingLink:"Antigravity CLI",agyFineprint:"Antigravity 模型和图像配额单独计费。",agyInstalled:"已安装",agyMissing:"未安装",status:{ready:"可用",authRequired:"需要登录",starting:"开始",offline:"离线",noImageModel:"无图像模型",error:"错误",checking:"检查"}},quota:{codexNotLoggedIn:"未登录",fetchError:"无法加载配额",noData:"无使用数据",grokUsageLink:"查看 Grok 用法 →",switchAccount:"切换 {provider} 帐户",startingLogin:"开始登录...",enterCode:"在打开的选项卡中输入此代码:",retry:"重试",copyLink:"复制链接",copied:"已复制",waitingApproval:"等待批准...",switchComplete:"帐号已切换。清爽…",switchFailed:"账户切换失败",tryAgain:"再试一次"},imageModel:{title:"图像模型",body:"选择供后代使用的图像模型。选择 Grok 模型会将提供程序切换到 Grok。",gpt54Mini:"GPT-5.4 迷你",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt56Sol:"GPT-5.6 索尔",gpt56Terra:"GPT-5.6 泰拉",gpt56Luna:"GPT-5.6 卢娜",grokImagine20:"Grok Imagine 图像 2.0",grokImagine:"Grok Imagine",grokImagineQuality:"Grok Imagine 质量",nanoBanana2:"纳米香蕉2",nanoBanana2Api:"纳米香蕉2",nanoBananaPro:"纳米香蕉专业版",atlasCloudGptImage2:"阿特拉斯云 GPT Image 2",atlasCloudGptImage2Edit:"阿特拉斯云 GPT Image 2 编辑",minimaxImage01:"MiniMax image-01",minimaxImage01Live:"MiniMax image-01-live",agy:"Antigravity (agy)",gpt53CodexSpark:"GPT-5.3 Codex Spark — 不支持图像",unsupportedHelp:"Grok 模型通过捆绑的本地代理使用 xAI 的图像 API。 GPT 模型使用 OpenAI 响应图像生成。"},apiKeys:{accordionTitle:"API 密钥",envSource:"从环境加载",configSource:"从配置加载",openai:{label:"GPT API 密钥 (OpenAI)",placeholder:"粘贴您的 OpenAI API 密钥(sk-...)"},xai:{label:"Grok API 密钥 (xAI)",placeholder:"粘贴您的 xAI API 密钥 (xai-...)"},gemini:{label:"Gemini (Google)",placeholder:"粘贴您的 Gemini API 密钥(AI...)"},atlascloud:{label:"阿特拉斯云",placeholder:"粘贴您的 Atlas Cloud API 密钥(apikey-...)"},minimax:{label:"MiniMax",placeholder:"粘贴您的 MiniMax API 密钥"},vertex:{label:"Vertex AI(服务帐户)",placeholder:'粘贴您的 Google 云服务帐户 JSON { "type": "service_account",... }',authModeApiKey:"API 密钥",authModeVertex:"顶点 JSON"},save:"节省",saved:"已保存",saving:"正在验证...",remove:"移除",saveFailed:"无法保存密钥",networkError:"网络错误。再试一次。",removeFailed:"无法移除钥匙",configuredReplace:"已配置 — 单击以替换",status:{valid:"有效的",notConfigured:"未配置"}},videoModel:{grokImagine:"Grok Imagine 视频",grokImagine15:"Grok Imagine 视频 1.5"},reasoning:{title:"推理努力",body:"更高的努力会在生成之前花费更多的推理令牌来规划、网络搜索和提示丰富。",none:"关——没有额外的推理",low:"低——最快、最少的推理",medium:"中 — 平衡默认值",high:"高——更深入的研究和综合",xhigh:"Xhigh — 扩展推理,速度较慢",max:"Max——最大推理,最慢"},webSearch:{title:"网页搜索",body:"在生成之前使用实时搜索来查找真实的人物、品牌、产品、地点和最近的事件。",on:"搜索于",off:"关闭搜索"},grokCompatibility:{title:"Grok 兼容性",body:"Grok 图像生成首先运行强制网络搜索,然后将文本和附加图像发送到本地图像工具规划器,该规划器用英语编写最终图像提示。附上通过 xAI 图像编辑的参考路线;大小映射到宽高比/分辨率。输出格式、审核和推理仅由 GPT OAuth 和 API 密钥提供程序使用。"},grokPlanner:{title:"Grok 规划器模型",body:"该模型用于搜索和图像/视频提示规划。 Grok 4.5为默认,支持I2V/Ref2V规划的图像输入; Grok 4.3 仍然可用作兼容性覆盖。"},gallery:{defaultScopeTitle:"默认图库视图",defaultScopeBody:"选择打开图库时显示的内容。"},appearance:{historyStripLayoutTitle:"历史缩略图",historyStripLayoutBody:"选择紧凑的历史记录条位于工作区旁边的方式。",historyStripLayout:{rail:"轨",horizontal:"顶排",sidebar:"侧边栏"}},language:{title:"语言",body:"切换界面语言,不会更改生成内容。"}},TE={loading:"正在加载会话...",addFirst:"+ 添加第一个 node",addRootTitle:"添加根 node",hint:"将手柄拖动到空白区域以进行分支。按删除或退格键删除。"},CE={title:"{provider} 不可用",ariaLabel:"{provider} 不可用"},wE={label:"语言",ko:"한국어",en:"English","zh-Hant":"正體中文","zh-Hans":"简体中文"},IE={close:"关闭",details:"显示原始错误详细信息",unknown:{title:"发生意外错误",body:"请稍后重试。如果问题仍然存在,请复制下面的原始错误消息并报告。"},moderationRefused:{title:"提示被审核阻止",body:"软化措辞或改写。参考图像中的敏感/暴力内容也可能触发此问题。",cta:"编辑提示",bodyInput:"您的提示文本已被输入过滤器捕获。尝试改写或使用不同的措辞。",bodyOutput:"生成的图像被输出滤波器捕获。尝试更改样式或质量设置。"},emptyResponse:{title:"没有返回图像",body:"Codex 响应但不包含图像数据。这不是一个调节块 - 它可能是一个短暂的问题或不受支持的尺寸/质量/型号组合。重试,或尝试不同的尺寸或型号。",cta:"重试"},streamParseFailed:{title:"无法解析图像响应流",body:"响应数据到达,但应用程序无法干净地读取图像流。代理或瞬态流传输问题可能会发生这种情况。",cta:"重试"},imageToolNotCalled:{title:"未调用图像工具",body:"响应已完成,但未观察到图像生成工具调用。重试相同的提示,或尝试其他模型/搜索设置。",cta:"重试"},webSearchOnlyResponse:{title:"未调用图像工具",body:"仅运行网络搜索;图像生成工具没有。关闭搜索或重试请求。",cta:"重试"},imageToolFailed:{title:"图像工具调用失败",body:"调用了图像生成工具,但最终以失败状态结束。如果重复出现此情况,请使用 `ima2 doctor image-probe --json` 输出报告它。",cta:"重试"},imageToolNoResult:{title:"图像结果为空",body:"图像工具调用已完成,但不包含图像数据。这可能表明选项组合不受支持或帐户功能问题。",cta:"重试"},oauthImageCapabilityUnavailable:{title:"该帐户可能没有图像工具访问权限",body:"GPT OAuth 已连接,但此帐户/模型组合可能无权使用图像生成。与 API-key 模式或其他模式进行比较。",cta:"确定"},responsesStreamError:{title:"图像响应流以错误结束",body:"OpenAI 在响应流中返回了错误事件。请稍后重试,如果问题仍然存在,请检查原始错误详细信息。",cta:"重试"},upstream5xx:{title:"OpenAI 当前正忙",body:"重试通常可以解决此问题。检查 status.openai.com 如果它仍然存在。",cta:"重试"},authChatgptExpired:{title:"Codex ChatGPT 会话已过期",body:"在终端中运行 `ima2 setup`(选项 1),然后重新加载此应用程序。",cta:"重新加载"},authApiKeyInvalid:{title:"API 密钥身份验证失败",body:"密钥丢失、无效、已撤销、超出配额或绑定到错误的组织。切换到 GPT OAuth 或更新配置的 API 密钥。",cta:"确定"},networkFailed:{title:"网络连接失败",body:"无法访问 OpenAI 或本地运行时服务。先重新加载;如果问题仍然存在,请检查 VPN/防火墙以及 `ima2 doctor` 显示的端口。",cta:"重新加载"},oauthUnavailable:{title:"GPT OAuth 代理不可用",body:"GPT OAuth 代理正在启动、不可用或移至备用端口。先重新加载;如果仍然存在,请运行 `ima2 doctor` 并检查报告的 GPT OAuth URL。",cta:"重新加载"},invalidRequest:{title:"图片请求需要更改",body:"一个或多个生成参数无效。检查下面的原始错误详细信息,然后编辑提示或大小并重试。",cta:"编辑输入"},apikeyDisabled:{title:"API-按键模式不可用",body:"此版本支持 API-密钥生成,但当前请求无法使用配置的密钥。切换到 GPT OAuth 或更新 API 密钥。",cta:"确定"},agyGenerationFailed:{title:"Gemini 生成失败",body:"Antigravity CLI 返回错误。检查 agy 二进制文件是否已安装并且您的 Gemini 帐户是否处于活动状态。",cta:"重试"},agyTimeout:{title:"Gemini 生成超时",body:"agy 进程在超时窗口(360 秒)内没有响应。重试或检查 agy CLI 状态。",cta:"重试"},agyProcessError:{title:"Gemini 进程错误",body:"agy CLI 因意外错误而退出。验证二进制文件是否可以与“agy --version”一起使用。",cta:"重试"},agyQuotaExhausted:{title:"Gemini 配额已用完",body:"您已用尽 Gemini 图像生成能力。您的配额将自动重置 - 检查错误详细信息中的重置计时器。",cta:"确定"},authClass:{title:"需要重新登录",body:"服务商认证已过期或密钥被拒绝。请在设置中重新登录。",cta:"重新登录"},billingRequired:{title:"需要充值",body:"该服务商账户余额不足。请前往服务商控制台确认后重试。"}},EE={title:"提示库",saveTitle:"保存到提示库",save:"节省",saved:"提示已保存",saveFailed:"保存失败",name:"姓名",tags:"标签",search:"搜索提示...",favorites:"收藏夹",load:"加载",insert:"插入",inserted:"提示已插入",removeInserted:"删除插入的提示 {name}",favorite:"最喜欢的",unfavorite:"不喜欢",empty:"尚未保存提示。",content:"内容",copy:"复制",untitled:"无题",addNew:"添加新提示",import:"进口",importFiles:"导入.txt、.md、.markdown 或 GitHub 文件",dropImport:"拖放.txt、.md 或.markdown 文件以导入提示",importTitle:"导入提示",importDropTitle:"将文件拖到此处",importDropHint:"保存前预览.txt、.md 和.markdown 文件",importChooseFiles:"选择文件",importGithubLabel:"GitHub 文件 URL 或路径",importPreview:"预览",importPreviewEmpty:"拖放文件或输入 GitHub 路径来预览候选。",importCommit:"保存选定的内容",importSelected:"导入选定的 ({count})",importThisPrompt:"导入此提示",previewPrompt:"预览",selectPrompt:"选择",selectedPrompt:"已选择",selectedCount:"已选择 {count}",selectAllCandidates:"选择全部",clearCandidateSelection:"清除",addAnotherSource:"添加另一个来源",searchResultsHeader:"搜索结果 ({count})",searchResults:"搜索结果",promptText:"提示文字",importSelectAtLeastOne:"至少选择一个提示进行保存。",imported:"导入的 {count} 提示",importFailed:"导入失败",importNoValidFiles:"未找到.txt、.md 或.markdown 提示文件。",curatedSources:"精选来源",curatedSourcesHint:"搜索已索引的公共提示源",curatedSearch:"搜索",curatedSearchPlaceholder:"纳米香蕉,gpt-image-2,排版......",refreshSource:"刷新",curatedRefreshed:"已索引的 {count} 提示候选者",sourceTrustTier:"来源信任",requiresAttribution:"需要归属",sourceDetails:"来源",license:"执照",attributionRequired:"需要归属",modelHints:"型号提示",taskHints:"任务提示",warnings:"警告",compatibilityWarnings:"兼容性警告",transparentUnsupportedGptImage2:"gpt-image-2 不支持透明背景",noCuratedResults:"未找到精选的提示候选人。",discovery:"发现",discoverySearch:"搜索 GitHub",discoverySearchPlaceholder:"搜索提示存储库...",discoveryCandidates:"发现候选人",discoveryApprove:"批准",discoveryReject:"拒绝",discoveryApproved:"得到正式认可的",discoveryRejected:"被拒绝",discoveryScore:"分数",discoveryWarnings:"发现警告",discoveryRateLimited:"GitHub 发现是有速率限制的。",discoveryNoResults:"未找到发现候选者。",discoveryReviewQueue:"审核队列",discoveryRequiresPaths:"在默认搜索之前添加已审阅的文件路径。",folderBrowse:"浏览文件夹",folderBrowseHint:"从 GitHub 文件夹加载支持的文件",folderFiles:"文件夹文件",folderFilesEmpty:"找不到可导入的.md、.markdown 或.txt 文件。",folderPreviewSelected:"预览选定的文件",folderSelectedCount:"已选择 {count}",folderWarnings:"文件夹警告",folderTooManyFiles:"文件太多;显示有限集。",folderNoSelection:"选择要预览的文件。",folderUnsupported:"仅支持 GitHub 文件夹。"},RE={title:"提示生成器",subtitle:"通过多轮上下文细化提示。",scopeDraft:"新作品",scopeImage:"所选图像:{name}",scopeImageFallback:"当前图像",newWorkTitle:"在没有图像上下文的情况下开始新的工作",model:"建造者模型",empty:"描述一下你想要的方向。我将包括您当前的提示和设置作为上下文。",user:"你",assistant:"建设者",placeholder:"我们应该树立什么样的形象?",send:"发送",sending:"写作",thinking:"完善提示...",clear:"清除",applyToPrompt:"适用于提示",insertAsBlock:"插入块",finalKoreanPrompt:"韩语提示",finalEnglishPrompt:"英文提示",blockName:"建造商建议",applied:"构建器建议应用于主提示",inserted:"作为提示块插入的构建器建议",failed:"提示构建器请求失败",removeScopeImage:"从构建器上下文中删除选定的图像",removeAttachment:"删除附件 {name}",attach:"附加文件",attachmentOnlyMessage:"使用附加文件作为上下文并根据提示提供帮助"},NE={sectionTitle:"工作空间",sectionBody:"选择工作区布局配置文件。",profileLabel:"工作区配置文件",defaultLabel:"默认",defaultDesc:"带有侧边栏编辑器的标准生成工作流程。",promptStudioLabel:"提示工作室",promptStudioDesc:"提示构建器面板、分组历史记录和增强的查看器。"},kE={controls:"图像缩放控件",zoomIn:"放大",zoomOut:"缩小",reset:"重置变焦"},_E={title:"日志",empty:"还没有生成日志",copied:"提示已复制",copy:"点击复制提示",loadFailed:"无法加载生成日志。",retry:"重试"},ME={writeFailed:"无法写入剪贴板。"},PE={graphSaveFailed:"无法保存 node 图表。",sessionSwitchSaveFailed:"由于无法保存当前图形,会话切换已停止。",sessionInitialLoadFailed:"无法加载会话。",sessionInitialLoadRetry:"无法加载会话。现在重试?",attachmentReadFailed:"无法读取一个或多个附件。"},LE={ariaLabel:"主导航",home:"家",create:"创造",node:"Node 图",agent:"代理人",assets:"资产",assetGen:"资产生成",settings:"设置"},OE={title:"资产生成",lede:"创建图像或短片,然后一键移除背景。",prompt:"提示词",promptPlaceholder:"一个红苹果,工作室产品拍摄",background:"背景",backgroundHint:"绿色背景最适合去背;不确定时就选绿色。",bgChroma:"色度绿幕",bgWhite:"白色",bgBlack:"黑色",model:"模型",modelGpt:"GPT",modelGrok:"Grok",kind:"输出",kindImage:"图像",kindVideo:"视频",videoSoon:"视频功能稍后推出",videoGrokOnly:"视频生成需要使用 Grok,请切换模型。",videoOptions:"视频选项",videoDuration:"视频时长",videoResolution:"视频分辨率",videoAspect:"纵横比",generate:"生成资产",generating:"生成…",emptyTitle:"还没有资产",emptyBody:"在左侧写下提示,然后按“生成资产”。结果显示在此处并自动保存到您的项目中。",previewImage:"打开图像预览:{prompt}",previewVideo:"打开视频预览:{prompt}",previewDialogTitle:"预览:{prompt}",closePreview:"关闭预览",zoomIn:"放大",zoomOut:"适合屏幕大小",openHintImage:"放大",openHintVideo:"播放",imageFallback:"生成的图像",videoFallback:"生成的视频",emptyCta:"写下你的第一个提示",errorTitle:"生成失败",errorHint:"请检查模型和 API 密钥设置后重试。",errorDismiss:"关闭",savedHint:"结果会自动保存到您的项目中。",savedLink:"在资产中查看",railTitle:"项目资产",railEmpty:"该项目中尚未保存资产。",railError:"无法加载项目资产。",sequence:"帧序列",candidates:"候选帧",frameAria:"第 {n} 帧,{rail}",addFrame:"添加",removeFrame:"移除",deleteFrame:"删除第 {n} 帧"},jE={select:"项目",unassigned:"未分配",new:"新项目…",newPrompt:"项目名称",search:"寻找项目...",searchPlaceholder:"搜索项目",searchEmpty:"没有匹配的项目",close:"关闭",saveRetry:"重试保存"},GE={title:"角色表",open:"打开角色表",close:"关闭角色表",state:"动画状态",unsaved:"未保存的更改",discardConfirm:"放弃未保存的精灵更改吗?",loadError:"无法加载此精灵运行。",saveError:"无法保存策展。",bakeError:"无法制作角色图集。",exportError:"无法导出精灵动画。",previous:"上一帧",play:"播放",pause:"暂停",next:"下一帧",speed:"速度",grid:"网格",transform:"帧变换",rotate:"旋转",scale:"缩放",dx:"移动 X",dy:"移动 Y",shx:"剪切X",shy:"剪切Y",flipX:"水平翻转",sequence:"帧序列——播放和制作顺序",candidates:"候选帧库",frameAria:"第 {n} 帧,{rail}",addFrame:"添加",removeFrame:"移除",deleteFrame:"删除第 {n} 帧",save:"保存角色表",bake:"制作角色图集",contactSheet:"缩略图总览",gif:"导出 GIF",status:{loading:"加载中…",ready:"已保存",saving:"保存中…",baking:"制作中…",exporting:"导出中…",error:"操作失败"}},DE={title:"删除背景",open:"删除背景",original:"原图",originalAlt:"去除背景前的原图",removed:"背景已移除",previewLoading:"准备删除背景预览...",resultBadge:"背景已移除",keyColor:"去背色",pickHint:"单击预览重新选择主色",clickMode:"预览点击功能",modeErase:"单击以擦除",modePick:"选择去背色",eraseHint:"单击空白区域以仅删除该连接区域",undoClick:"撤消单击 ({count})",previewAlt:"棋盘上的抠像预览",tolerance:"去背强度",softness:"边缘柔化",spill:"清理色溢",unmix:"边缘去混色",unmixHint:"恢复半透明边缘(仅限色度键)",reset:"重置",download:"下载透明 PNG",save:"保存到项目",saving:"保存中…",videoSave:"创建 alpha WebM",videoKeying:"键控视频... {seconds}s",videoSaved:"Alpha WebM 保存到项目",saved:"Alpha PNG 保存到项目中",saveError:"无法保存抠像图像",loadError:"无法加载此图像进行抠像。关闭并重试。",advanced:"微调去背(高级)"},FE={ariaLabel:"快速行动",animate:"动画",edit:"在画布中编辑",useAsRef:"用作参考",rebake:"再生",refAdded:"添加为参考图像",refFailed:"无法添加参考",saveToAssets:"保存到资产",savedToAssets:"保存到资产",saveToAssetsFailed:"无法保存到资产"},zE={title:"资产",clearAll:"全部清除",clearConfirm:"删除所有已保存的资源?此操作无法撤消。",testSheetsUnavailable:"元素测试表尚不可用。",detailAria:"{name} 详细信息",searchPlaceholder:"搜索资产...",allAssets:"所有资产",elementLibrary:"元素库",removeFromElements:"从元素库中删除",emptyElementsTitle:"还没有元素",emptyElementsBody:"元素是可重复使用的@可提及的参考(人物、产品、风格、场景)。将图库图像保存到资产并推广它,然后在任何地方使用 @ 提及它。",newFolder:"新建文件夹",kindAll:"所有类型",kindImage:"图片",kindVideo:"视频",kindElement:"元素",kindPreset:"预设",kindTemplate:"模板",emptyTitle:"还没有资产",emptyBody:"尚未保存任何内容。在资产生成选项卡中生成您的第一张图像 - 结果会自动保存在此处。",emptySearchTitle:"没有匹配项",emptySearchBody:"尝试不同的搜索、标签或类型过滤器。",emptyFolderTitle:"该文件夹是空的",emptyFolderBody:"将资源移至此处或将新结果保存到此文件夹中。",deleteAsset:"从资产中删除",confirmDelete:"删除?",loadMore:"加载更多",rootFolder:"顶级",renameFolder:"重命名文件夹",renameAsset:"重命名资产",starAsset:"明星资产",unstarAsset:"删除资产星级",deleteFolder:"删除文件夹",actionFailed:"操作失败",starSaved:"添加到资产",starSaveFailed:"已加星标,但无法添加到资产",itemCount:"{count} 项目",emptyCta:"开放资产生成",loadErrorTitle:"无法加载资源",loadErrorBody:"加载您的库时出现问题。",retry:"再试一次",detailClose:"关闭资产详细信息",detailKind:"类型",detailCreated:"创建时间",detailProvider:"模型",detailPrompt:"提示词",detailTags:"标签",bindingsTitle:"提供者绑定",bindingsHelp:"该角色如何连接到外部提供商。",bindingStateless:"每代的引用数",bindingTagPlaceholder:"runway @tag (可选)",bindingSave:"保存绑定",bindingSaving:"保存…",bindingTagInvalid:"标签必须是 1-32 个字母、数字、下划线或连字符。",bindingCapWarning:"该角色有 {count} 引用 — Runway 每代最多接受 3 个。",bindingTrain:"火车灵魂ID",bindingTrainLockedHint:"需要付费 Higgsfield 计划。",bindingPaidPlan:"需要付费计划",bindingDriftWarning:"参考与训练时快照不同——考虑重新训练。"},qE={name:"Node 工作室",toolbar:{addImage:"添加图片",templates:"模板",saveTemplate:"保存模板",branch:"分支"},empty:{title:"构建图像工作流程",description:"从提示开始,重复使用经过验证的图表,或继续您的最新工作。",blankTitle:"从空白画布开始",blankDescription:"添加一个提示 node 并自行塑造工作流程。",blankAction:"开始空白",templateTitle:"从模板开始",templateDescription:"复制现成的图表以用于常见的生成工作流程。",templateAction:"浏览模板",recentTitle:"恢复最近的图表",recentDescription:"继续最近保存的有效图表。",recentUnavailable:"目前尚无最新图表。",recentAction:"恢复最近的",resumeError:"无法打开最近的图表。再试一次。"},elements:{ariaLabel:"元素节点",title:"元素",hint:"拖动或添加",loading:"正在加载元素...",loadError:"无法加载元素。再试一次。",empty:"尚未保存元素。",addToCanvas:"添加到画布"},elementNode:{untitled:"无标题元素",referencesOutput:"元素引用输出",notesOutput:"元素注释输出",kind:"元素",referenceCountOne:"{count} 参考",referenceCount:"{count} 参考文献",missing:"该元素已被删除。运行前重新连接。"},elementController:{onlyElements:"只能将元素资源添加到画布中。",invalid:"元素 node 无效。",addError:"无法将元素添加到画布。"},branch:{defaultVariant:"变体 {index}",eyebrow:"分行工作流程",title:"创建变体",close:"关闭分支对话框",variantLegend:"变体 {index}",label:"标签",provider:"提供者",modelOverride:"模型覆盖",currentModel:"使用当前模型",sizeOverride:"尺寸覆盖",currentSize:"使用当前尺寸",remove:"移除",add:"添加变体",cancel:"取消",create:"创建分支",selectSourceError:"选择一个连接的源 node。",applyError:"该分支无法应用,因此图表保持不变。"},templates:{previewAria:"{name} 图形预览",nodeCountOne:"{count} 个节点",nodeCount:"{count} 节点",outputCountOne:"{count} 输出",outputCount:"{count} 输出",rename:"重命名",delete:"删除",deleteConfirm:"删除模板“{name}”?此操作无法撤消。",title:"选择模板",close:"关闭模板",searchLabel:"搜索模板",searchPlaceholder:"名称或标签",loading:"正在加载模板...",empty:"没有模板匹配“{query}”。",starter:"入门模板",yours:"您的模板",cancel:"取消",copy:"复印一份",loadError:"无法加载模板。再试一次。",replaceConfirm:"用此模板的副本替换当前图形?",invalidGraph:"模板图无效。",copyError:"无法复制模板。",namePrompt:"模板名称",saved:"模板已保存。",saveError:"无法保存模板。",renamePrompt:"重命名模板",renameError:"无法重命名模板。",deleteError:"无法删除模板。"},palette:{ariaLabel:"插入 node 命令",compatiblePlaceholder:"与 {portType} 兼容",searchPlaceholder:"搜索节点",filter:"显示接受 {portType} 的节点。",emptyCompatible:"node 不接受 {portType}。",emptySearch:"没有节点与此搜索匹配。",commandsAria:"Node 命令",categories:{input:"输入",generate:"产生",transform:"转换",reference:"参考",output:"输出"}},commands:{"image-generate":{label:"图像生成",description:"将图像 node 添加到工作流程中。"}},portTypes:{prompt:"提示词",image:"图像",images:"图片",video:"视频",mask:"面具","element-refs":"元素参考","element-notes":"元素注释",settings:"设置","any-media":"任何媒体"},compatibility:{sameDirection:"将输出端口连接到输入端口。",typeMismatch:"这些端口类型不兼容。",cardinality:"该输入已经有一个连接。",selfEdge:"node 无法连接到自身。",duplicateEdge:"该连接已经存在。",unknownPort:"该端口不可用于连接。",cycle:"该连接会形成一个循环。"}},UE={tabs:{label:"资产工作流程",generate:"产生",sprite:"角色表"},title:"角色表",lede:"锁定角色设定,然后生成动作一致的角色帧。",loading:"正在加载精灵配方...",loadError:"无法加载角色表。",retry:"重试",empty:{title:"创建角色表",body:"设置角色、帧尺寸与动画状态。",create:"创建角色表"},recipe:{select:"角色表",new:"新建角色表",name:"角色表名称",characterId:"角色ID",description:"描述",style:"风格",baseAssetId:"基础图像资源",baseAsset:"基础图像资源",save:"保存角色表",saving:"保存中…",unsaved:"生成前保存更改。"},cell:{title:"帧尺寸",width:"宽度",height:"高度",safeMarginX:"水平边界",safeMarginY:"垂直边界"},chroma:{title:"绿幕去背",hex:"去背颜色"},states:{title:"动画状态",add:"添加状态",remove:"移除",key:"状态密钥",frames:"帧数",fps:"FPS",loop:"环形",action:"动作"},anchor:{title:"身份锚",missing:"在行前生成并批准一个空闲姿势。",generate:"生成空闲候选人",generating:"生成…",candidate:"候选人准备接受审查。",regenerate:"雷根",approve:"批准锚点",approved:"锚定批准",replace:"更换锚",confirmTitle:"批准这个身份锚?",confirmBody:"未来的行将重用此标识;基本图像将不会再次附加。",confirm:"批准",cancel:"取消"},rows:{title:"精灵行",generateAll:"生成全部",generateSelected:"生成选定的",regenerate:"重试行",cancel:"取消",preview:"预览",anchorRequired:"首先批准锚点。",saveRequired:"首先保存配方更改。",status:{pending:"待办的",queued:"排队",running:"跑步",complete:"完全的",error:"错误",canceled:"取消"}},error:{INVALID_SPRITE_RECIPE:"填写所需的配方字段。",ANCHOR_NOT_APPROVED:"首先批准身份锚。",BASE_REFERENCE_FORBIDDEN:"基础镜像审核通过后不可重复使用。",GENERATION_CANCELED:"一代被取消。",generic:"精灵生成失败。"}},HE={undone:"撤消最后的图形更改。",redone:"重新绘制图形更改。"},BE={t2i:"文字 → 图片",i2i:"图片编辑",t2v:"文字 → 视频",i2v:"图片 → 视频",v2v:"视频延续"},VE={title:"元素",titleEdit:"编辑元素",titleNew:"新元素",saved:"已保存",ariaLabel:"元素详情",name:"姓名",namePlaceholder:"例如胡桃木椅",kind:"种类",kindCharacter:"特点",kindProduct:"产品",kindStyle:"风格",kindScene:"场景",kindReference:"参考",selected:"选定的元素",mentionAria:"{name}、{kind} 元素",unavailableAria:"{name},不可用元素",removeAria:"删除 {name} 元素",helpCharacter:"一个人或反复出现的主题。",helpProduct:"设计细节一致的产品。",helpStyle:"视觉语言、材料或处理方式。",helpScene:"地点、环境或反复出现的环境。",notes:"笔记",notesHelp:"描述应保持一致的外观、材料和细节。",notesPlaceholder:"温暖的胡桃木纹、圆润的边缘、编织的藤条座椅……",remaining:"剩余 {n}",strength:"参考强度",strengthHelp:"生成的作品的强度应遵循这些参考文献。",resetDefault:"重置为默认值",saving:"保存中…",save:"保存元素",testing:"正在生成测试表...",runTest:"运行测试表",delete:"删除",errorName:"保存之前命名您的元素。",errorRefs:"保存前至少添加一张参考图像。",refsTitle:"参考图片",refsHelp:"拖动以设置顺序。第一个图像是代表性缩略图。",refAlt:"参考 {n}",refPrimary:"代表",refLabel:"标签",refLabelPlaceholder:"正面、侧面、材质……",refMoveUp:"将引用 {n} 向上移动",refMoveDown:"向下移动引用 {n}",refRemove:"消除",refRemoved:"参考已删除。",refUndo:"撤消"},KE={common:FI,appBar:zI,sheet:qI,toast:UI,inflight:HI,size:BI,sizeConfirm:VI,quality:KI,moderation:$I,format:YI,count:XI,multimode:QI,metadata:JI,onboarding:WI,readiness:ZI,generate:eE,home:tE,billing:nE,history:aE,panel:oE,prompt:rE,canvas:iE,gallery:lE,node:sE,nodeBatch:cE,edge:dE,provider:uE,mcp:mE,grokMode:pE,cost:fE,result:gE,session:hE,uiMode:yE,agent:vE,cardNews:bE,video:SE,sidebar:xE,settings:AE,nodeCanvas:TE,apiDisabled:CE,language:wE,errorCard:IE,promptLibrary:EE,promptBuilder:RE,workspace:NE,viewer:kE,generationLog:_E,clipboard:ME,modal:PE,nav:LE,assetGen:OE,project:jE,spriteCurator:GE,keying:DE,chain:FE,assets:zE,"assets.clearAll":"全部清除","assets.clearConfirm":"删除所有已保存的资源?此操作无法撤消。",nodeStudio:qE,sprite:UE,graph:HE,provenance:BE,element:VE},cy={ko:AC,en:kw,"zh-Hant":DI,"zh-Hans":KE};function dy(e,a){return a.split(".").reduce((i,o)=>{if(i!=null)return i[o]},e)}function $E(e,a){return e.replace(/\{(\w+)\}/g,(i,o)=>o in a?String(a[o]):`{${o}}`)}function Z(e,a){const i=w.getState().locale;return qv(i,e,a)}function qv(e,a,i){const o=dy(cy[e],a),s=typeof o=="string"?o:dy(cy.en,a),c=typeof s=="string"?s:a;return i?$E(c,i):c}function ge(){const e=w(a=>a.locale);return{locale:e,t:(a,i)=>qv(e,a,i)}}const Cj=["ko","en","zh-Hant","zh-Hans"];function YE(){try{const e=localStorage.getItem("ima2.locale");if(e==="ko"||e==="en"||e==="zh-Hant"||e==="zh-Hans")return e}catch{}if(typeof navigator<"u"){const e=navigator.language||"";if(e.toLowerCase().startsWith("ko"))return"ko";const a=e.toLowerCase();if(/^(zh[-_](tw|hk|mo|hant)|zh-hant)/.test(a))return"zh-Hant";if(/^(zh[-_](cn|sg|hans)|zh)/.test(a))return"zh-Hans"}return"en"}function XE(e){try{localStorage.setItem("ima2.locale",e)}catch{}}const QE="none",$u=[{value:"none",shortLabel:"off",fullLabelKey:"settings.reasoning.none"},{value:"low",shortLabel:"low",fullLabelKey:"settings.reasoning.low"},{value:"medium",shortLabel:"med",fullLabelKey:"settings.reasoning.medium"},{value:"high",shortLabel:"high",fullLabelKey:"settings.reasoning.high"},{value:"xhigh",shortLabel:"xhigh",fullLabelKey:"settings.reasoning.xhigh"},{value:"max",shortLabel:"max",fullLabelKey:"settings.reasoning.max"}];function Uv(e){return $u.some(a=>a.value===e)}const JE={low:"l",medium:"m",high:"h",xhigh:"x",max:"M"};function WE(e){return!Uv(e)||e==="none"?null:`R:${JE[e]}`}const ZE=!0,eR=!1,ir=!0,Hv=eR,lr=!0,tR=24;function Yu(e){return Math.min(tR,Math.max(1,Math.trunc(e||1)))}function nR(e){return Math.round(e/16)*16}const to=16,mm=3840,bu=655360,ms=8294400,aR=3,Jo=3,uy=Math.floor(Math.sqrt(ms)/to)*to,Bv=to,oR=mm,Kl=aR;function my(e){return Math.floor(e/16)*16}function bs(e){return Math.ceil(e/16)*16}function bn(e){return Math.min(oR,Math.max(Bv,e))}function _n(e,a){const i=typeof e=="number"?e:Number.parseInt(e,10);return Number.isFinite(i)?i:a}function oo(e,a){e.includes(a)||e.push(a)}function py(e,a){const i=nR(e);return i!==e&&oo(a,"snap"),i}function fy(e,a){return e<Bv&&oo(a,"min"),e>mm&&oo(a,"maxEdge"),bn(e)}function gy(e,a,i){return e>a*Kl?(oo(i,"ratio"),{w:e,h:bn(bs(e/Kl))}):a>e*Kl?(oo(i,"ratio"),{w:bn(bs(a/Kl)),h:a}):{w:e,h:a}}function rR(e,a,i){if(e*a<bu){oo(i,"minPixels");const m=Math.sqrt(bu/(e*a));let p=bn(bs(e*m)),h=bn(bs(a*m));for(;p*h<bu;)p<=h?p=bn(p+to):h=bn(h+to);return{w:p,h}}if(e*a<=ms)return{w:e,h:a};oo(i,"maxPixels");const o=Math.sqrt(ms/(e*a));let s=bn(my(e*o)),c=bn(my(a*o));for(;s*c>ms;)s>=c?s=bn(s-to):c=bn(c-to);return{w:s,h:c}}function pm(e,a,i,o){const s=[],c=_n(e,i),m=_n(a,o);let p=fy(py(c,s),s),h=fy(py(m,s),s);return{w:p,h}=gy(p,h,s),{w:p,h}=rR(p,h,s),{w:p,h}=gy(p,h,s),{requestedW:c,requestedH:m,w:p,h,adjusted:p!==c||h!==m,reasons:s}}function Vv(e,a,i,o){const s=pm(e,a,i,o);return{w:s.w,h:s.h}}const iR=[{id:"free",label:"Free",w:0,h:0},{id:"1:1",label:"1:1",w:1,h:1},{id:"3:2",label:"3:2",w:3,h:2},{id:"2:3",label:"2:3",w:2,h:3},{id:"16:9",label:"16:9",w:16,h:9},{id:"9:16",label:"9:16",w:9,h:16},{id:"21:9",label:"21:9",w:21,h:9},{id:"9:21",label:"9:21",w:9,h:21}];function lR(e,a){return`${e}x${a}`}function sR(e,a=1024){if(e.id==="free")return null;const i=a,o=e.w>=e.h,s=o?Math.round(i*e.w/e.h):i,c=o?i:Math.round(i*e.h/e.w);return Vv(s,c,s,c)}function Gs(e){const a=Vv(e.w,e.h,2400,1024);return{...e,w:a.w,h:a.h,label:e.label||`${a.w}×${a.h}`}}function Wo(e){return e.slice(0,Jo).map(Gs)}function cR(e,a){const i=Gs(a),o=e.findIndex(s=>s.id===i.id);return o>=0?Wo(e.map((s,c)=>c===o?i:s)):e.length>=Jo?Wo(e):Wo([...e,i])}function dR(e,a,i){const o=Gs({...i,id:a});return Wo(e.map(s=>s.id===a?o:s))}const uR=[{value:"1024x1024",label:"1024×1024",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],mR=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],pR=[{value:"1024x1824",label:"1024×1824",sub:"9:16"},{value:"2048x2048",label:"2048×2048",sub:"2K 1:1"},{value:"2048x1152",label:"2048×1152",sub:"2K 16:9"}],fR=[{value:"1152x2048",label:"1152×2048",sub:"2K 9:16"},{value:"3840x2160",label:"3840×2160",sub:"4K 16:9"},{value:"2160x3840",label:"2160×3840",sub:"4K 9:16"}];function gR(){return[{value:"auto",label:Z("size.autoLabel"),sub:Z("size.autoSub")},{value:"custom",label:Z("size.customLabel"),sub:Z("size.customSub")}]}function Tn(){return{startFrameFilename:null,endFrameFilename:null,references:[],referenceVideoFilename:null}}const Xu="vid:",Qu="img:",hR=/^[\p{L}\p{N}_-]{1,32}$/u;function fm(e){return hR.test(e)}function yR(e){return e.references.some(a=>a.tag!==void 0&&!fm(a.tag))}function Kv(e){return e==="video"?"video":"image"}function Ds(e){return typeof e=="string"&&/^\d{1,3}:\d{1,3}$/.test(e)?e:null}function vR(e){return typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.length<=128}function Fs(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const a=Object.entries(e).slice(0,24);return Object.fromEntries(a.filter(([i,o])=>/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(i)&&vR(o)))}function hy(e,a){return!(e.type==="number"&&typeof a!="number"||e.type==="boolean"&&typeof a!="boolean"||e.type==="string"&&typeof a!="string"||e.type==="string_array"||e.options&&!e.options.includes(a)||typeof a=="number"&&e.min!==void 0&&a<e.min||typeof a=="number"&&e.max!==void 0&&a>e.max)}function $v(e,a,i){const o=Ds(a),s=Fs(i),c={};for(const m of e.parameters){const p=s[m.name];p!==void 0&&hy(m,p)?c[m.name]=p:m.default!==void 0&&hy(m,m.default)&&(c[m.name]=m.default)}return{ratio:o&&e.aspectRatios.includes(o)?o:null,parameters:c}}function bR(e){return e?$v(e,null,{}):{ratio:null,parameters:{}}}function SR(e,a){return e.ratio===a.ratio&&JSON.stringify(e.parameters)===JSON.stringify(a.parameters)}function Yv(e){if(!e||typeof e!="object")return null;const a=e;if(typeof a.filename!="string"||a.filename.length===0)return null;const i=typeof a.tag=="string"?a.tag.slice(0,128):"",o=typeof a.dataUrl=="string"&&/^data:image\/(?:png|jpeg|webp);base64,/i.test(a.dataUrl)?a.dataUrl:null,s=typeof a.displayName=="string"&&a.displayName?a.displayName.slice(0,180):null;return{filename:a.filename,...i?{tag:i}:{},...o?{dataUrl:o}:{},...s?{displayName:s}:{}}}function gm(e){if(!e||typeof e!="object")return Tn();const a=e,i=Array.isArray(a.references)?a.references.map(Yv).filter(o=>!!o):[];return{startFrameFilename:typeof a.startFrameFilename=="string"&&a.startFrameFilename?a.startFrameFilename:null,endFrameFilename:typeof a.endFrameFilename=="string"&&a.endFrameFilename?a.endFrameFilename:null,references:i.filter((o,s)=>i.findIndex(c=>c.filename===o.filename)===s).slice(0,3),referenceVideoFilename:typeof a.referenceVideoFilename=="string"&&a.referenceVideoFilename?a.referenceVideoFilename:null}}function hm(e,a){const i=gm(a),o=e.includes("start_image")?i.startFrameFilename:null;return{startFrameFilename:o,endFrameFilename:e.includes("end_image")&&o?i.endFrameFilename:null,references:e.includes("image_references")?i.references:[],referenceVideoFilename:e.includes("video_references")?i.referenceVideoFilename:null}}function Xv(e,a){return JSON.stringify(e)===JSON.stringify(a)}function xR(e){return{provider:typeof e.mcpProvider=="string"?e.mcpProvider:null,model:typeof e.mcpModel=="string"?e.mcpModel:null,kind:Kv(e.mcpMediaKind),ratio:Ds(e.mcpRatio),parameters:Fs(e.mcpParameters)}}function $l(e,a){return`${e==="video"?Xu:Qu}${a}`}function AR(e){if(e.startsWith(Xu)){const a=e.slice(Xu.length);return a?{kind:"video",model:a}:null}if(e.startsWith(Qu)){const a=e.slice(Qu.length);return a?{kind:"image",model:a}:null}return null}function Qv(e){const a=e.normalize("NFKC").replace(/\s+/g,"_").replace(/[^\p{L}\p{N}_-]/gu,"").slice(0,32);return a.length>0?a:null}function TR(e,a,i){const o=e.mcpProvider??null;if(!o||!a)return null;const s=Kv(e.mcpMediaKind),c=Ds(e.mcpRatio),m=Fs(e.mcpParameters),p=e.mcpReferenceSelection!==void 0,h=e.mcpInputRoles,g=k=>h===void 0||h.includes(k),S=gm(e.mcpReferenceSelection),v=p?g("start_image")?S.startFrameFilename:null:s==="video"?e.currentImageFilename??null:null,y=p&&g("image_references")?S.references:[],x=g("image_references")?e.elementReferences??[]:[],E=[...y,...x].map(Yv).filter(k=>!!k).filter((k,C,_)=>_.findIndex(N=>N.filename===k.filename)===C).slice(0,3);if(E.some(k=>k.dataUrl||k.tag!==void 0&&!fm(k.tag)))return null;const P=p&&g("end_image")&&v?S.endFrameFilename:null,I=p&&g("video_references")?S.referenceVideoFilename:null;return{provider:o,kind:s,prompt:a,model:e.mcpModel??void 0,...c?{ratio:c}:{},...Object.keys(m).length>0?{parameters:m}:{},startFrameFilename:v??void 0,...P?{endFrameFilename:P}:{},...E.length>0?{references:E.map(({filename:k,tag:C})=>({filename:k,...C?{tag:C}:{}}))}:{},...I?{referenceVideoFilename:I}:{},...e.mcpCharacterElementId?{characterElementId:e.mcpCharacterElementId}:{},...i?{requestId:i}:{}}}function xi(e,a){const i=a.filter(s=>s.placement!=="after"),o=a.filter(s=>s.placement==="after");return[...i.map(s=>s.text.trim()).filter(Boolean),e.trim(),...o.map(s=>s.text.trim()).filter(Boolean)].filter(Boolean).join(`
|
|
23
|
+
框架`,copyPrompt:"复制提示",continueHere:"在这里继续",continueHereTitle:"导入此图像的提示并继续工作",continueAsUrl:"URL 继续",continueAsUrlTitle:"继续使用原始提供商URL(1小时后过期)",animate:"动画",animating:"动画…",animateTitle:"从此图像生成 Grok 视频(图像到视频)",firstNode:"第一个 node",firstNodeTitle:"将此图像发送到 Node 模式作为首先准备好的 node",info:"信息",infoTitle:"显示生成详细信息和出处",delete:"删除",deleteTitle:"移至垃圾箱",more:"更多的",sendToComfyUI:"发送至 ComfyUI",sendToComfyUITitle:"将保存的图片上传到本地ComfyUI",permanentDelete:"永久删除",permanentDeleteConfirm:"永久删除“{filename}”?此操作无法撤消。",upscale:"高档",upscaleTitle:"通过 Runway (MCP) 进行升级",upscaleFlavor:"味道",upscaleFlavorAuto:"自动",upscaleStart:"开始高档",upscaleStarted:"高档开始",upscaleFailed:"高档失败",upscaleInvalid:"无效的高档参数"},hE={switchTitle:"切换会话",loading:"加载中...",newSession:"新会话",newSessionTitle:"新会话",renameTitle:"重命名",renamePrompt:"会话名称",deleteTitle:"删除",deleteConfirm:"删除会话“{title}”?此操作无法撤消。",empty:"还没有会话",firstGraph:"我的第一张图",untitled:"无标题会话",assetAbortedError:"一代人并没有干净地结束。从此 node 重试。"},yE={ariaLabel:"UI 模式",classic:"经典的",node:"Node",cardNews:"卡新闻",agent:"代理人"},vE={workspace:"座席工作区",workspaceActionFailed:"操作失败:{reason}",bootFailed:"无法加载代理工作区",bootRetry:"重试",topbarBackToStudio:"返回工作室",topbarStudio:"工作室",topbarOpenQueue:"打开队列,{count} 活动作业",topbarCloseQueue:"关闭队列",topbarQueueSheet:"生成队列",title:"代理人",newSession:"新代理",sessions:"会话",openSessions:"显示会话",closeSessions:"隐藏会话",sessionsUseRail:"将会话固定为紧凑型导轨",sessionsUseExpanded:"固定扩展会话列表",sessionSearch:"搜索会话",renameSession:"重命名会话",deleteSession:"删除会话",deleteConfirm:"删除“{title}”?",imageCount:"{count} 图像",compacted:"压实",web:"网络",chat:"聊天",user:"用户",assistant:"代理人",tool:"工具",toolExpand:"显示工具详细信息",toolCollapse:"隐藏工具详细信息",toolImageCount:"{count} 张图片",toolCallCount:"{count} 调用",toolGroup:"工具运行",toolInput:"输入",toolOutput:"输出",toolsShowMore:"更多的",toolsShowLess:"较少的",toolArtifacts:"文物",requestId:"请求ID",duration:"时长",toolStatus:{queued:"排队",running:"跑步",complete:"完全的",error:"错误"},rightSidebar:"代理端工具",sidebarTabs:{image:"图像",library:"图书馆",forms:"表格",quality:"质量",model:"模型",queue:"队列"},modelSettings:"模型设置",closeModelSettings:"关闭模型设置",openModelSettings:"打开模型设置",modelTabView:"在“模型”选项卡中查看",model:"模型",provider:"提供者",reasoningEffort:"推理",generationStrategy:"发电计划",generationStrategyAuto:"根据用户要求",generationStrategyManual:"固定计数",quality:"质量",size:"尺寸",format:"格式",moderation:"内容审核",variantsCount:"变体",maxAutoVariants:"自动最大",parallelism:"并行性",promptLibrary:"提示库",forms:"表格",noForms:"没有表单模板",insertPrompt:"插入",queue:"队列",runningShort:"跑步",queuedShort:"等待",queueEmpty:"没有排队的代理工作。",cancelQueue:"取消",retryQueue:"重试",sessionRunning:"代运行",sessionQueued:"{count} 已排队",sessionError:"生成错误",queueStatus:{queued:"排队",running:"跑步",succeeded:"完毕",failed:"失败的",canceled:"取消"},statusReady:"可用",statusGenerating:"生成",statusReconnecting:"重新连接",pending:"正在生成响应...",pendingQueued:"排队等候...",pendingPlanning:"计划回应...",pendingGenerating:"运行工具并生成...",runError:"运行失败",errorRole:"错误",composerPlaceholder:"询问任何问题或描述要创建什么",slashCommands:"代理斜杠命令",slashDesc_question:"提出问题而不生成图像",slashDesc_variants:"生成 N 个图像变体 (1-24)",slashDesc_generate:"有界扇出生成 (1-24)",slashDesc_parallelism:"限制并发工具调用",slashDesc_help:"显示可用命令",attachReference:"附上参考资料",send:"发送",webSearch:"使用搜索",emptyChat:"输入消息以开始图像或视频工作。",emptyJumpLatest:"跳转至最新",queueSummary:"{active} 有效 · {failed} 失败",queuePlanSummary:"变体 {variants} · 并行 {parallel}",queueDetails:"技术细节",queueAnnouncement:"队列已更新:{running} 正在运行,{queued} 已排队,{failed} 失败",queueTimeAgo:"{value} {unit} 前",queueTimeUnit:{second:"秒",minute:"分钟",hour:"小时"},progressQueued:"排队等候",progressPlanning:"准备请求",progressGenerating:"生成",progressDownloading:"下载结果",progressFailed:"运行失败",progressJob:"{kind} · {count} 变体",mediaKind:{image:"图像",video:"视频"},mediaSelect:"分众媒体",mediaLoading:"加载视频",mediaLoadFailed:"视频无法加载。",mediaRetry:"重试",mediaVideoLabel:"生成的视频",mediaDuration:"持续时间 {duration}",mediaDurationUnknown:"持续时间不可用",mediaDownload:"下载",imagePane:"图像",currentImage:"当前图像",openImage:"打开图片",closeImage:"关闭图像",selectImage:"焦点图像",variants:"变体",contextTabs:"图像上下文",imageTab:"图像",refsTab:"参考文献",webTab:"网络",memoryTab:"记忆",noImage:"没有当前图像",noRefs:"没有参考文献",noWeb:"没有网络证据",memoryItemStyle:"样式锁保留在图像上下文中。",memoryItemSubject:"主题锁定在恢复后恢复。",imageAlt:"代理形象",filename:"文件",prompt:"提示词",stageEmptyHint:"在此处发送您的第一个查看图片的请求",openTools:"打开工具面板",closeTools:"关闭工具面板"},bE={workspace:"卡新闻工作区",composer:"卡新闻",composerHint:"模板是视觉快照;输出尺寸单独设置。",topic:"话题",topicPlaceholder:"例如考试复出计划",audience:"观众",audiencePlaceholder:"例如父母",goal:"目标",goalPlaceholder:"例如预约咨询",brief:"简短的",briefPlaceholder:"描述卡片新闻内容、所需要点和排除内容。",outputSize:"输出尺寸",customSize:"风俗",draft:"概要草案",drafting:"起草...",generateSet:"生成集",batchGenerate:"批量生成",generating:"生成...",generated:"生成 {count} 卡。",missingGeneratedCard:"生成响应不包括这张卡。",error:"卡生成失败。",imageTemplate:"图片模板",roleTemplate:"卡牌结构",newTemplateLater:"开发 MVP 后计划定制模板",emptyTitle:"等待草稿",emptyBody:"使用左侧设置面板准备卡片组。",inspector:"卡片检验员",cardTitle:"卡标题",headline:"标题",body:"身体",visualPrompt:"图片提示",summaryCopy:"摘要副本",designPrompt:"场景/设计提示",textFields:"文本框",addTextField:"添加文本框",removeTextField:"消除",noTextFields:"还没有文本框。",textFieldText:"文本",textKind:"种类",placement:"放置",renderMode:"渲染模式",hierarchyLabel:"等级制度",textTooLong:"文本超出建议长度。",selectTextField:"选择文本框:{text}",textKinds:{headline:"标题",body:"支持文字",caption:"标题",cta:"计算机辅助技术协会",badge:"徽章",number:"数字"},renderModes:{"in-image":"在图像中","ui-only":"仅 UI"},hierarchy:{primary:"基本的",secondary:"中学",supporting:"配套"},placements:{"top-left":"左上角","top-center":"顶部中心","top-right":"右上角","center-left":"中偏左",center:"中心","center-right":"中右","bottom-left":"左下角","bottom-center":"底部中心","bottom-right":"右下角",free:"免费"},roles:{cover:"覆盖",hook:"钩",problem:"问题",insight:"洞察力",example:"例子",data:"数据",summary:"概括",cta:"计算机辅助技术协会"},locked:"锁定",unlocked:"解锁",noCard:"未选择卡",generatedMeta:"生成的元数据",lockedHelp:"锁定的卡不参与批量生成和重试。",retryCard:"重试此卡",actions:{copyPrompt:"复制提示",copyCopy:"复制复制",openImage:"打开图片",downloadCard:"下载"},status:{draft:"草稿",queued:"排队",generating:"生成",generated:"完毕",error:"错误",skipped:"跳过",locked:"锁定"},progress:{generating:"生成 {done}/{total}",summary:"完成 {done}/{total}",detail:"{queued} 已排队 · {errors} 错误 · {skipped} 已跳过",cardGenerating:"生成这张卡。"},planner:{structured:"结构化 JSON",jsonMode:"JSON 模式",repaired:"已修复",fallback:"后备草案",jsonOnlyHelp:"草稿仅创建 JSON。图像稍后生成。",error:"草稿失败"}},SE={selectedCameraPresets:"选定的摄像机运动预设",plannerModelTitle:"规划模型",reasoningEffortTitle:"推理努力",modeLabel:"视频模式",mode:{"text-to-video":"文字→视频(无参考图片)","image-to-video":"图片 → 视频(1 个参考)","reference-to-video":"参考 → 视频({n} 参考)"},seriesTopicTitle:"系列专题",seriesTopicPlaceholder:"例如韩国旅游视频博客",durationTitle:"长度",resolutionTitle:"分辨率",resolution1080Help:"1080p 使用 Grok V1.5 进行仅提示或单图像/帧视频。它不适用于 2 个以上的参考文献。",aspectTitle:"纵横比",plannerUpdateFailed:"无法更新规划器模型。之前的设置已恢复。",continuationFallbackT2V:"无法提取连续帧。生成将继续以文本到视频的形式进行。"},xE={appName:"图像生成器",imageModelLabel:"模型",imageSectionLabel:"图像",gptImageSubLabel:"GPT-IMAGE-2",grokImageSubLabel:"Grok Imagine",geminiImageSubLabel:"Gemini",videoSectionLabel:"视频",imageModelAria:"选择图像模型",quickSettingsAria:"选择模型和推理工作。当前模型{model},推理{effort}",quickSettingsModelOnlyAria:"选择图像模型。当前型号 {model}",quickSettingsMenu:"模型和推理快速设置",reasoningLabel:"推理",videoModelLabel:"视频",nodeModeHint:"在 node 模式下,单击 node 编辑其提示并生成。右侧面板上的设置(质量/尺寸)适用于每个新结果。"},AE={openAria:"打开设置",openTitle:"设置",closeAria:"关闭设置",closeTitle:"返回画布",navAria:"设置部分",contentAria:"设置内容",jumpTo:"跳转到 {section}",title:"设置",sections:{providers:{title:"供应商",hint:"账户、密钥、模型"},workspace:{title:"工作空间",hint:"简介、布局、画廊"},general:{title:"一般的",hint:"语言"}},account:{primaryEyebrow:"活跃的提供商",oauthTitle:"GPT OAuth",oauthBody:"GPT OAuth 生成贯穿您的 Codex OAuth 会话。配置有效密钥后,您可以切换到 API-密钥模式。",apiSourceEnv:"检测到 OPENAI_API_KEY",apiSourceConfig:"检测到 config.json API 密钥",apiTitle:"OpenAI API 密钥",apiBody:"ima2-gen 可以使用此 API 密钥通过响应 API 进行生成、编辑、多模式和 node 请求。",apiDisabled:"不可用",apiReady:"可用",apiUnavailable:"不可用",apiUnknown:"状态未知",grokEyebrow:"本地 xAI 代理",grokTitle:"Grok",grokBody:"在配置的本地端口使用 progrok 生成 xAI 映像 API。",agyEyebrow:"Antigravity CLI",agyTitle:"Gemini (agy)",agyInstalledBody:"无法检测登录状态。如果生成失败,请在终端中运行 `agy login` 。",agyMissingBody:"未安装。获取",agyMissingLink:"Antigravity CLI",agyFineprint:"Antigravity 模型和图像配额单独计费。",agyInstalled:"已安装",agyMissing:"未安装",status:{ready:"可用",authRequired:"需要登录",starting:"开始",offline:"离线",noImageModel:"无图像模型",error:"错误",checking:"检查"}},quota:{codexNotLoggedIn:"未登录",fetchError:"无法加载配额",noData:"无使用数据",grokUsageLink:"查看 Grok 用法 →",switchAccount:"切换 {provider} 帐户",startingLogin:"开始登录...",enterCode:"在打开的选项卡中输入此代码:",retry:"重试",copyLink:"复制链接",copied:"已复制",waitingApproval:"等待批准...",switchComplete:"帐号已切换。清爽…",switchFailed:"账户切换失败",tryAgain:"再试一次"},imageModel:{title:"图像模型",body:"选择供后代使用的图像模型。选择 Grok 模型会将提供程序切换到 Grok。",gpt54Mini:"GPT-5.4 迷你",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt56Sol:"GPT-5.6 索尔",gpt56Terra:"GPT-5.6 泰拉",gpt56Luna:"GPT-5.6 卢娜",grokImagine20:"Grok Imagine 图像 2.0",grokImagine:"Grok Imagine",grokImagineQuality:"Grok Imagine 质量",nanoBanana2:"纳米香蕉2",nanoBanana2Api:"纳米香蕉2",nanoBananaPro:"纳米香蕉专业版",atlasCloudGptImage2:"阿特拉斯云 GPT Image 2",atlasCloudGptImage2Edit:"阿特拉斯云 GPT Image 2 编辑",minimaxImage01:"MiniMax image-01",minimaxImage01Live:"MiniMax image-01-live",agy:"Antigravity (agy)",gpt53CodexSpark:"GPT-5.3 Codex Spark — 不支持图像",unsupportedHelp:"Grok 模型通过捆绑的本地代理使用 xAI 的图像 API。 GPT 模型使用 OpenAI 响应图像生成。"},apiKeys:{accordionTitle:"API 密钥",envSource:"从环境加载",configSource:"从配置加载",openai:{label:"GPT API 密钥 (OpenAI)",placeholder:"粘贴您的 OpenAI API 密钥(sk-...)"},xai:{label:"Grok API 密钥 (xAI)",placeholder:"粘贴您的 xAI API 密钥 (xai-...)"},gemini:{label:"Gemini (Google)",placeholder:"粘贴您的 Gemini API 密钥(AI...)"},atlascloud:{label:"阿特拉斯云",placeholder:"粘贴您的 Atlas Cloud API 密钥(apikey-...)"},minimax:{label:"MiniMax",placeholder:"粘贴您的 MiniMax API 密钥"},vertex:{label:"Vertex AI(服务帐户)",placeholder:'粘贴您的 Google 云服务帐户 JSON { "type": "service_account",... }',authModeApiKey:"API 密钥",authModeVertex:"顶点 JSON"},save:"节省",saved:"已保存",saving:"正在验证...",remove:"移除",saveFailed:"无法保存密钥",networkError:"网络错误。再试一次。",removeFailed:"无法移除钥匙",configuredReplace:"已配置 — 单击以替换",status:{valid:"有效的",notConfigured:"未配置"}},videoModel:{grokImagine:"Grok Imagine 视频",grokImagine15:"Grok Imagine 视频 1.5"},reasoning:{title:"推理努力",body:"更高的努力会在生成之前花费更多的推理令牌来规划、网络搜索和提示丰富。",none:"关——没有额外的推理",low:"低——最快、最少的推理",medium:"中 — 平衡默认值",high:"高——更深入的研究和综合",xhigh:"Xhigh — 扩展推理,速度较慢",max:"Max——最大推理,最慢"},webSearch:{title:"网页搜索",body:"在生成之前使用实时搜索来查找真实的人物、品牌、产品、地点和最近的事件。",on:"搜索于",off:"关闭搜索"},grokCompatibility:{title:"Grok 兼容性",body:"Grok 图像生成首先运行强制网络搜索,然后将文本和附加图像发送到本地图像工具规划器,该规划器用英语编写最终图像提示。附上通过 xAI 图像编辑的参考路线;大小映射到宽高比/分辨率。输出格式、审核和推理仅由 GPT OAuth 和 API 密钥提供程序使用。"},grokPlanner:{title:"Grok 规划器模型",body:"该模型用于搜索和图像/视频提示规划。 Grok 4.5为默认,支持I2V/Ref2V规划的图像输入; Grok 4.3 仍然可用作兼容性覆盖。"},gallery:{defaultScopeTitle:"默认图库视图",defaultScopeBody:"选择打开图库时显示的内容。"},appearance:{historyStripLayoutTitle:"历史缩略图",historyStripLayoutBody:"选择紧凑的历史记录条位于工作区旁边的方式。",historyStripLayout:{rail:"轨",horizontal:"顶排",sidebar:"侧边栏"}},language:{title:"语言",body:"切换界面语言,不会更改生成内容。"}},TE={loading:"正在加载会话...",addFirst:"+ 添加第一个 node",addRootTitle:"添加根 node",hint:"将手柄拖动到空白区域以进行分支。按删除或退格键删除。"},CE={title:"{provider} 不可用",ariaLabel:"{provider} 不可用"},wE={label:"语言",ko:"한국어",en:"English","zh-Hant":"正體中文","zh-Hans":"简体中文"},IE={close:"关闭",details:"显示原始错误详细信息",unknown:{title:"发生意外错误",body:"请稍后重试。如果问题仍然存在,请复制下面的原始错误消息并报告。"},moderationRefused:{title:"提示被审核阻止",body:"软化措辞或改写。参考图像中的敏感/暴力内容也可能触发此问题。",cta:"编辑提示",bodyInput:"您的提示文本已被输入过滤器捕获。尝试改写或使用不同的措辞。",bodyOutput:"生成的图像被输出滤波器捕获。尝试更改样式或质量设置。"},emptyResponse:{title:"没有返回图像",body:"Codex 响应但不包含图像数据。这不是一个调节块 - 它可能是一个短暂的问题或不受支持的尺寸/质量/型号组合。重试,或尝试不同的尺寸或型号。",cta:"重试"},streamParseFailed:{title:"无法解析图像响应流",body:"响应数据到达,但应用程序无法干净地读取图像流。代理或瞬态流传输问题可能会发生这种情况。",cta:"重试"},imageToolNotCalled:{title:"未调用图像工具",body:"响应已完成,但未观察到图像生成工具调用。重试相同的提示,或尝试其他模型/搜索设置。",cta:"重试"},webSearchOnlyResponse:{title:"未调用图像工具",body:"仅运行网络搜索;图像生成工具没有。关闭搜索或重试请求。",cta:"重试"},imageToolFailed:{title:"图像工具调用失败",body:"调用了图像生成工具,但最终以失败状态结束。如果重复出现此情况,请使用 `ima2 doctor image-probe --json` 输出报告它。",cta:"重试"},imageToolNoResult:{title:"图像结果为空",body:"图像工具调用已完成,但不包含图像数据。这可能表明选项组合不受支持或帐户功能问题。",cta:"重试"},oauthImageCapabilityUnavailable:{title:"该帐户可能没有图像工具访问权限",body:"GPT OAuth 已连接,但此帐户/模型组合可能无权使用图像生成。与 API-key 模式或其他模式进行比较。",cta:"确定"},responsesStreamError:{title:"图像响应流以错误结束",body:"OpenAI 在响应流中返回了错误事件。请稍后重试,如果问题仍然存在,请检查原始错误详细信息。",cta:"重试"},upstream5xx:{title:"OpenAI 当前正忙",body:"重试通常可以解决此问题。检查 status.openai.com 如果它仍然存在。",cta:"重试"},authChatgptExpired:{title:"Codex ChatGPT 会话已过期",body:"在终端中运行 `ima2 setup`(选项 1),然后重新加载此应用程序。",cta:"重新加载"},authApiKeyInvalid:{title:"API 密钥身份验证失败",body:"密钥丢失、无效、已撤销、超出配额或绑定到错误的组织。切换到 GPT OAuth 或更新配置的 API 密钥。",cta:"确定"},networkFailed:{title:"网络连接失败",body:"无法访问 OpenAI 或本地运行时服务。先重新加载;如果问题仍然存在,请检查 VPN/防火墙以及 `ima2 doctor` 显示的端口。",cta:"重新加载"},oauthUnavailable:{title:"GPT OAuth 代理不可用",body:"GPT OAuth 代理正在启动、不可用或移至备用端口。先重新加载;如果仍然存在,请运行 `ima2 doctor` 并检查报告的 GPT OAuth URL。",cta:"重新加载"},invalidRequest:{title:"图片请求需要更改",body:"一个或多个生成参数无效。检查下面的原始错误详细信息,然后编辑提示或大小并重试。",cta:"编辑输入"},apikeyDisabled:{title:"API-按键模式不可用",body:"此版本支持 API-密钥生成,但当前请求无法使用配置的密钥。切换到 GPT OAuth 或更新 API 密钥。",cta:"确定"},agyGenerationFailed:{title:"Gemini 生成失败",body:"Antigravity CLI 返回错误。检查 agy 二进制文件是否已安装并且您的 Gemini 帐户是否处于活动状态。",cta:"重试"},agyTimeout:{title:"Gemini 生成超时",body:"agy 进程在超时窗口(360 秒)内没有响应。重试或检查 agy CLI 状态。",cta:"重试"},agyProcessError:{title:"Gemini 进程错误",body:"agy CLI 因意外错误而退出。验证二进制文件是否可以与“agy --version”一起使用。",cta:"重试"},agyQuotaExhausted:{title:"Gemini 配额已用完",body:"您已用尽 Gemini 图像生成能力。您的配额将自动重置 - 检查错误详细信息中的重置计时器。",cta:"确定"},authClass:{title:"需要重新登录",body:"服务商认证已过期或密钥被拒绝。请在设置中重新登录。",cta:"重新登录"},billingRequired:{title:"需要充值",body:"该服务商账户余额不足。请前往服务商控制台确认后重试。"}},EE={title:"提示库",saveTitle:"保存到提示库",save:"节省",saved:"提示已保存",saveFailed:"保存失败",name:"姓名",tags:"标签",search:"搜索提示...",favorites:"收藏夹",load:"加载",insert:"插入",inserted:"提示已插入",removeInserted:"删除插入的提示 {name}",favorite:"最喜欢的",unfavorite:"不喜欢",empty:"尚未保存提示。",content:"内容",copy:"复制",untitled:"无题",addNew:"添加新提示",import:"进口",importFiles:"导入.txt、.md、.markdown 或 GitHub 文件",dropImport:"拖放.txt、.md 或.markdown 文件以导入提示",importTitle:"导入提示",importDropTitle:"将文件拖到此处",importDropHint:"保存前预览.txt、.md 和.markdown 文件",importChooseFiles:"选择文件",importGithubLabel:"GitHub 文件 URL 或路径",importPreview:"预览",importPreviewEmpty:"拖放文件或输入 GitHub 路径来预览候选。",importCommit:"保存选定的内容",importSelected:"导入选定的 ({count})",importThisPrompt:"导入此提示",previewPrompt:"预览",selectPrompt:"选择",selectedPrompt:"已选择",selectedCount:"已选择 {count}",selectAllCandidates:"选择全部",clearCandidateSelection:"清除",addAnotherSource:"添加另一个来源",searchResultsHeader:"搜索结果 ({count})",searchResults:"搜索结果",promptText:"提示文字",importSelectAtLeastOne:"至少选择一个提示进行保存。",imported:"导入的 {count} 提示",importFailed:"导入失败",importNoValidFiles:"未找到.txt、.md 或.markdown 提示文件。",curatedSources:"精选来源",curatedSourcesHint:"搜索已索引的公共提示源",curatedSearch:"搜索",curatedSearchPlaceholder:"纳米香蕉,gpt-image-2,排版......",refreshSource:"刷新",curatedRefreshed:"已索引的 {count} 提示候选者",sourceTrustTier:"来源信任",requiresAttribution:"需要归属",sourceDetails:"来源",license:"执照",attributionRequired:"需要归属",modelHints:"型号提示",taskHints:"任务提示",warnings:"警告",compatibilityWarnings:"兼容性警告",transparentUnsupportedGptImage2:"gpt-image-2 不支持透明背景",noCuratedResults:"未找到精选的提示候选人。",discovery:"发现",discoverySearch:"搜索 GitHub",discoverySearchPlaceholder:"搜索提示存储库...",discoveryCandidates:"发现候选人",discoveryApprove:"批准",discoveryReject:"拒绝",discoveryApproved:"得到正式认可的",discoveryRejected:"被拒绝",discoveryScore:"分数",discoveryWarnings:"发现警告",discoveryRateLimited:"GitHub 发现是有速率限制的。",discoveryNoResults:"未找到发现候选者。",discoveryReviewQueue:"审核队列",discoveryRequiresPaths:"在默认搜索之前添加已审阅的文件路径。",folderBrowse:"浏览文件夹",folderBrowseHint:"从 GitHub 文件夹加载支持的文件",folderFiles:"文件夹文件",folderFilesEmpty:"找不到可导入的.md、.markdown 或.txt 文件。",folderPreviewSelected:"预览选定的文件",folderSelectedCount:"已选择 {count}",folderWarnings:"文件夹警告",folderTooManyFiles:"文件太多;显示有限集。",folderNoSelection:"选择要预览的文件。",folderUnsupported:"仅支持 GitHub 文件夹。"},RE={title:"提示生成器",subtitle:"通过多轮上下文细化提示。",scopeDraft:"新作品",scopeImage:"所选图像:{name}",scopeImageFallback:"当前图像",newWorkTitle:"在没有图像上下文的情况下开始新的工作",model:"建造者模型",empty:"描述一下你想要的方向。我将包括您当前的提示和设置作为上下文。",user:"你",assistant:"建设者",placeholder:"我们应该树立什么样的形象?",send:"发送",sending:"写作",thinking:"完善提示...",clear:"清除",applyToPrompt:"适用于提示",insertAsBlock:"插入块",finalKoreanPrompt:"韩语提示",finalEnglishPrompt:"英文提示",blockName:"建造商建议",applied:"构建器建议应用于主提示",inserted:"作为提示块插入的构建器建议",failed:"提示构建器请求失败",removeScopeImage:"从构建器上下文中删除选定的图像",removeAttachment:"删除附件 {name}",attach:"附加文件",attachmentOnlyMessage:"使用附加文件作为上下文并根据提示提供帮助"},NE={sectionTitle:"工作空间",sectionBody:"选择工作区布局配置文件。",profileLabel:"工作区配置文件",defaultLabel:"默认",defaultDesc:"带有侧边栏编辑器的标准生成工作流程。",promptStudioLabel:"提示工作室",promptStudioDesc:"提示构建器面板、分组历史记录和增强的查看器。"},kE={controls:"图像缩放控件",zoomIn:"放大",zoomOut:"缩小",reset:"重置变焦"},_E={title:"日志",empty:"还没有生成日志",copied:"提示已复制",copy:"点击复制提示",loadFailed:"无法加载生成日志。",retry:"重试",detailOpen:"点击查看详情",detailTitle:"生成请求",detailTime:"时间",detailRequestId:"请求 ID",detailCounts:"成功 / 请求",detailError:"错误代码",detailPrompt:"提示词",detailPromptEmpty:"(无提示词)",detailErrorMessage:"失败原因"},ME={writeFailed:"无法写入剪贴板。"},PE={graphSaveFailed:"无法保存 node 图表。",sessionSwitchSaveFailed:"由于无法保存当前图形,会话切换已停止。",sessionInitialLoadFailed:"无法加载会话。",sessionInitialLoadRetry:"无法加载会话。现在重试?",attachmentReadFailed:"无法读取一个或多个附件。"},LE={ariaLabel:"主导航",home:"家",create:"创造",node:"Node 图",agent:"代理人",assets:"资产",assetGen:"资产生成",settings:"设置"},OE={title:"资产生成",lede:"创建图像或短片,然后一键移除背景。",prompt:"提示词",promptPlaceholder:"一个红苹果,工作室产品拍摄",background:"背景",backgroundHint:"绿色背景最适合去背;不确定时就选绿色。",bgChroma:"色度绿幕",bgWhite:"白色",bgBlack:"黑色",model:"模型",modelGpt:"GPT",modelGrok:"Grok",kind:"输出",kindImage:"图像",kindVideo:"视频",videoSoon:"视频功能稍后推出",videoGrokOnly:"视频生成需要使用 Grok,请切换模型。",videoOptions:"视频选项",videoDuration:"视频时长",videoResolution:"视频分辨率",videoAspect:"纵横比",generate:"生成资产",generating:"生成…",emptyTitle:"还没有资产",emptyBody:"在左侧写下提示,然后按“生成资产”。结果显示在此处并自动保存到您的项目中。",previewImage:"打开图像预览:{prompt}",previewVideo:"打开视频预览:{prompt}",previewDialogTitle:"预览:{prompt}",closePreview:"关闭预览",zoomIn:"放大",zoomOut:"适合屏幕大小",openHintImage:"放大",openHintVideo:"播放",imageFallback:"生成的图像",videoFallback:"生成的视频",emptyCta:"写下你的第一个提示",errorTitle:"生成失败",errorHint:"请检查模型和 API 密钥设置后重试。",errorDismiss:"关闭",savedHint:"结果会自动保存到您的项目中。",savedLink:"在资产中查看",railTitle:"项目资产",railEmpty:"该项目中尚未保存资产。",railError:"无法加载项目资产。",sequence:"帧序列",candidates:"候选帧",frameAria:"第 {n} 帧,{rail}",addFrame:"添加",removeFrame:"移除",deleteFrame:"删除第 {n} 帧"},jE={select:"项目",unassigned:"未分配",new:"新项目…",newPrompt:"项目名称",search:"寻找项目...",searchPlaceholder:"搜索项目",searchEmpty:"没有匹配的项目",close:"关闭",saveRetry:"重试保存"},GE={title:"角色表",open:"打开角色表",close:"关闭角色表",state:"动画状态",unsaved:"未保存的更改",discardConfirm:"放弃未保存的精灵更改吗?",loadError:"无法加载此精灵运行。",saveError:"无法保存策展。",bakeError:"无法制作角色图集。",exportError:"无法导出精灵动画。",previous:"上一帧",play:"播放",pause:"暂停",next:"下一帧",speed:"速度",grid:"网格",transform:"帧变换",rotate:"旋转",scale:"缩放",dx:"移动 X",dy:"移动 Y",shx:"剪切X",shy:"剪切Y",flipX:"水平翻转",sequence:"帧序列——播放和制作顺序",candidates:"候选帧库",frameAria:"第 {n} 帧,{rail}",addFrame:"添加",removeFrame:"移除",deleteFrame:"删除第 {n} 帧",save:"保存角色表",bake:"制作角色图集",contactSheet:"缩略图总览",gif:"导出 GIF",status:{loading:"加载中…",ready:"已保存",saving:"保存中…",baking:"制作中…",exporting:"导出中…",error:"操作失败"}},DE={title:"删除背景",open:"删除背景",original:"原图",originalAlt:"去除背景前的原图",removed:"背景已移除",previewLoading:"准备删除背景预览...",resultBadge:"背景已移除",keyColor:"去背色",pickHint:"单击预览重新选择主色",clickMode:"预览点击功能",modeErase:"单击以擦除",modePick:"选择去背色",eraseHint:"单击空白区域以仅删除该连接区域",undoClick:"撤消单击 ({count})",previewAlt:"棋盘上的抠像预览",tolerance:"去背强度",softness:"边缘柔化",spill:"清理色溢",unmix:"边缘去混色",unmixHint:"恢复半透明边缘(仅限色度键)",reset:"重置",download:"下载透明 PNG",save:"保存到项目",saving:"保存中…",videoSave:"创建 alpha WebM",videoKeying:"键控视频... {seconds}s",videoSaved:"Alpha WebM 保存到项目",saved:"Alpha PNG 保存到项目中",saveError:"无法保存抠像图像",loadError:"无法加载此图像进行抠像。关闭并重试。",advanced:"微调去背(高级)"},FE={ariaLabel:"快速行动",animate:"动画",edit:"在画布中编辑",useAsRef:"用作参考",rebake:"再生",refAdded:"添加为参考图像",refFailed:"无法添加参考",saveToAssets:"保存到资产",savedToAssets:"保存到资产",saveToAssetsFailed:"无法保存到资产"},zE={title:"资产",clearAll:"全部清除",clearConfirm:"删除所有已保存的资源?此操作无法撤消。",testSheetsUnavailable:"元素测试表尚不可用。",detailAria:"{name} 详细信息",searchPlaceholder:"搜索资产...",allAssets:"所有资产",elementLibrary:"元素库",removeFromElements:"从元素库中删除",emptyElementsTitle:"还没有元素",emptyElementsBody:"元素是可重复使用的@可提及的参考(人物、产品、风格、场景)。将图库图像保存到资产并推广它,然后在任何地方使用 @ 提及它。",newFolder:"新建文件夹",kindAll:"所有类型",kindImage:"图片",kindVideo:"视频",kindElement:"元素",kindPreset:"预设",kindTemplate:"模板",emptyTitle:"还没有资产",emptyBody:"尚未保存任何内容。在资产生成选项卡中生成您的第一张图像 - 结果会自动保存在此处。",emptySearchTitle:"没有匹配项",emptySearchBody:"尝试不同的搜索、标签或类型过滤器。",emptyFolderTitle:"该文件夹是空的",emptyFolderBody:"将资源移至此处或将新结果保存到此文件夹中。",deleteAsset:"从资产中删除",confirmDelete:"删除?",loadMore:"加载更多",rootFolder:"顶级",renameFolder:"重命名文件夹",renameAsset:"重命名资产",starAsset:"明星资产",unstarAsset:"删除资产星级",deleteFolder:"删除文件夹",actionFailed:"操作失败",starSaved:"添加到资产",starSaveFailed:"已加星标,但无法添加到资产",itemCount:"{count} 项目",emptyCta:"开放资产生成",loadErrorTitle:"无法加载资源",loadErrorBody:"加载您的库时出现问题。",retry:"再试一次",detailClose:"关闭资产详细信息",detailKind:"类型",detailCreated:"创建时间",detailProvider:"模型",detailPrompt:"提示词",detailTags:"标签",bindingsTitle:"提供者绑定",bindingsHelp:"该角色如何连接到外部提供商。",bindingStateless:"每代的引用数",bindingTagPlaceholder:"runway @tag (可选)",bindingSave:"保存绑定",bindingSaving:"保存…",bindingTagInvalid:"标签必须是 1-32 个字母、数字、下划线或连字符。",bindingCapWarning:"该角色有 {count} 引用 — Runway 每代最多接受 3 个。",bindingTrain:"火车灵魂ID",bindingTrainLockedHint:"需要付费 Higgsfield 计划。",bindingPaidPlan:"需要付费计划",bindingDriftWarning:"参考与训练时快照不同——考虑重新训练。"},qE={name:"Node 工作室",toolbar:{addImage:"添加图片",templates:"模板",saveTemplate:"保存模板",branch:"分支"},empty:{title:"构建图像工作流程",description:"从提示开始,重复使用经过验证的图表,或继续您的最新工作。",blankTitle:"从空白画布开始",blankDescription:"添加一个提示 node 并自行塑造工作流程。",blankAction:"开始空白",templateTitle:"从模板开始",templateDescription:"复制现成的图表以用于常见的生成工作流程。",templateAction:"浏览模板",recentTitle:"恢复最近的图表",recentDescription:"继续最近保存的有效图表。",recentUnavailable:"目前尚无最新图表。",recentAction:"恢复最近的",resumeError:"无法打开最近的图表。再试一次。"},elements:{ariaLabel:"元素节点",title:"元素",hint:"拖动或添加",loading:"正在加载元素...",loadError:"无法加载元素。再试一次。",empty:"尚未保存元素。",addToCanvas:"添加到画布"},elementNode:{untitled:"无标题元素",referencesOutput:"元素引用输出",notesOutput:"元素注释输出",kind:"元素",referenceCountOne:"{count} 参考",referenceCount:"{count} 参考文献",missing:"该元素已被删除。运行前重新连接。"},elementController:{onlyElements:"只能将元素资源添加到画布中。",invalid:"元素 node 无效。",addError:"无法将元素添加到画布。"},branch:{defaultVariant:"变体 {index}",eyebrow:"分行工作流程",title:"创建变体",close:"关闭分支对话框",variantLegend:"变体 {index}",label:"标签",provider:"提供者",modelOverride:"模型覆盖",currentModel:"使用当前模型",sizeOverride:"尺寸覆盖",currentSize:"使用当前尺寸",remove:"移除",add:"添加变体",cancel:"取消",create:"创建分支",selectSourceError:"选择一个连接的源 node。",applyError:"该分支无法应用,因此图表保持不变。"},templates:{previewAria:"{name} 图形预览",nodeCountOne:"{count} 个节点",nodeCount:"{count} 节点",outputCountOne:"{count} 输出",outputCount:"{count} 输出",rename:"重命名",delete:"删除",deleteConfirm:"删除模板“{name}”?此操作无法撤消。",title:"选择模板",close:"关闭模板",searchLabel:"搜索模板",searchPlaceholder:"名称或标签",loading:"正在加载模板...",empty:"没有模板匹配“{query}”。",starter:"入门模板",yours:"您的模板",cancel:"取消",copy:"复印一份",loadError:"无法加载模板。再试一次。",replaceConfirm:"用此模板的副本替换当前图形?",invalidGraph:"模板图无效。",copyError:"无法复制模板。",namePrompt:"模板名称",saved:"模板已保存。",saveError:"无法保存模板。",renamePrompt:"重命名模板",renameError:"无法重命名模板。",deleteError:"无法删除模板。"},palette:{ariaLabel:"插入 node 命令",compatiblePlaceholder:"与 {portType} 兼容",searchPlaceholder:"搜索节点",filter:"显示接受 {portType} 的节点。",emptyCompatible:"node 不接受 {portType}。",emptySearch:"没有节点与此搜索匹配。",commandsAria:"Node 命令",categories:{input:"输入",generate:"产生",transform:"转换",reference:"参考",output:"输出"}},commands:{"image-generate":{label:"图像生成",description:"将图像 node 添加到工作流程中。"}},portTypes:{prompt:"提示词",image:"图像",images:"图片",video:"视频",mask:"面具","element-refs":"元素参考","element-notes":"元素注释",settings:"设置","any-media":"任何媒体"},compatibility:{sameDirection:"将输出端口连接到输入端口。",typeMismatch:"这些端口类型不兼容。",cardinality:"该输入已经有一个连接。",selfEdge:"node 无法连接到自身。",duplicateEdge:"该连接已经存在。",unknownPort:"该端口不可用于连接。",cycle:"该连接会形成一个循环。"}},UE={tabs:{label:"资产工作流程",generate:"产生",sprite:"角色表"},title:"角色表",lede:"锁定角色设定,然后生成动作一致的角色帧。",loading:"正在加载精灵配方...",loadError:"无法加载角色表。",retry:"重试",empty:{title:"创建角色表",body:"设置角色、帧尺寸与动画状态。",create:"创建角色表"},recipe:{select:"角色表",new:"新建角色表",name:"角色表名称",characterId:"角色ID",description:"描述",style:"风格",baseAssetId:"基础图像资源",baseAsset:"基础图像资源",save:"保存角色表",saving:"保存中…",unsaved:"生成前保存更改。"},cell:{title:"帧尺寸",width:"宽度",height:"高度",safeMarginX:"水平边界",safeMarginY:"垂直边界"},chroma:{title:"绿幕去背",hex:"去背颜色"},states:{title:"动画状态",add:"添加状态",remove:"移除",key:"状态密钥",frames:"帧数",fps:"FPS",loop:"环形",action:"动作"},anchor:{title:"身份锚",missing:"在行前生成并批准一个空闲姿势。",generate:"生成空闲候选人",generating:"生成…",candidate:"候选人准备接受审查。",regenerate:"雷根",approve:"批准锚点",approved:"锚定批准",replace:"更换锚",confirmTitle:"批准这个身份锚?",confirmBody:"未来的行将重用此标识;基本图像将不会再次附加。",confirm:"批准",cancel:"取消"},rows:{title:"精灵行",generateAll:"生成全部",generateSelected:"生成选定的",regenerate:"重试行",cancel:"取消",preview:"预览",anchorRequired:"首先批准锚点。",saveRequired:"首先保存配方更改。",status:{pending:"待办的",queued:"排队",running:"跑步",complete:"完全的",error:"错误",canceled:"取消"}},error:{INVALID_SPRITE_RECIPE:"填写所需的配方字段。",ANCHOR_NOT_APPROVED:"首先批准身份锚。",BASE_REFERENCE_FORBIDDEN:"基础镜像审核通过后不可重复使用。",GENERATION_CANCELED:"一代被取消。",generic:"精灵生成失败。"}},HE={undone:"撤消最后的图形更改。",redone:"重新绘制图形更改。"},BE={t2i:"文字 → 图片",i2i:"图片编辑",t2v:"文字 → 视频",i2v:"图片 → 视频",v2v:"视频延续"},VE={title:"元素",titleEdit:"编辑元素",titleNew:"新元素",saved:"已保存",ariaLabel:"元素详情",name:"姓名",namePlaceholder:"例如胡桃木椅",kind:"种类",kindCharacter:"特点",kindProduct:"产品",kindStyle:"风格",kindScene:"场景",kindReference:"参考",selected:"选定的元素",mentionAria:"{name}、{kind} 元素",unavailableAria:"{name},不可用元素",removeAria:"删除 {name} 元素",helpCharacter:"一个人或反复出现的主题。",helpProduct:"设计细节一致的产品。",helpStyle:"视觉语言、材料或处理方式。",helpScene:"地点、环境或反复出现的环境。",notes:"笔记",notesHelp:"描述应保持一致的外观、材料和细节。",notesPlaceholder:"温暖的胡桃木纹、圆润的边缘、编织的藤条座椅……",remaining:"剩余 {n}",strength:"参考强度",strengthHelp:"生成的作品的强度应遵循这些参考文献。",resetDefault:"重置为默认值",saving:"保存中…",save:"保存元素",testing:"正在生成测试表...",runTest:"运行测试表",delete:"删除",errorName:"保存之前命名您的元素。",errorRefs:"保存前至少添加一张参考图像。",refsTitle:"参考图片",refsHelp:"拖动以设置顺序。第一个图像是代表性缩略图。",refAlt:"参考 {n}",refPrimary:"代表",refLabel:"标签",refLabelPlaceholder:"正面、侧面、材质……",refMoveUp:"将引用 {n} 向上移动",refMoveDown:"向下移动引用 {n}",refRemove:"消除",refRemoved:"参考已删除。",refUndo:"撤消"},KE={common:FI,appBar:zI,sheet:qI,toast:UI,inflight:HI,size:BI,sizeConfirm:VI,quality:KI,moderation:$I,format:YI,count:XI,multimode:QI,metadata:JI,onboarding:WI,readiness:ZI,generate:eE,home:tE,billing:nE,history:aE,panel:oE,prompt:rE,canvas:iE,gallery:lE,node:sE,nodeBatch:cE,edge:dE,provider:uE,mcp:mE,grokMode:pE,cost:fE,result:gE,session:hE,uiMode:yE,agent:vE,cardNews:bE,video:SE,sidebar:xE,settings:AE,nodeCanvas:TE,apiDisabled:CE,language:wE,errorCard:IE,promptLibrary:EE,promptBuilder:RE,workspace:NE,viewer:kE,generationLog:_E,clipboard:ME,modal:PE,nav:LE,assetGen:OE,project:jE,spriteCurator:GE,keying:DE,chain:FE,assets:zE,"assets.clearAll":"全部清除","assets.clearConfirm":"删除所有已保存的资源?此操作无法撤消。",nodeStudio:qE,sprite:UE,graph:HE,provenance:BE,element:VE},cy={ko:AC,en:kw,"zh-Hant":DI,"zh-Hans":KE};function dy(e,a){return a.split(".").reduce((i,o)=>{if(i!=null)return i[o]},e)}function $E(e,a){return e.replace(/\{(\w+)\}/g,(i,o)=>o in a?String(a[o]):`{${o}}`)}function Z(e,a){const i=w.getState().locale;return qv(i,e,a)}function qv(e,a,i){const o=dy(cy[e],a),s=typeof o=="string"?o:dy(cy.en,a),c=typeof s=="string"?s:a;return i?$E(c,i):c}function ge(){const e=w(a=>a.locale);return{locale:e,t:(a,i)=>qv(e,a,i)}}const Cj=["ko","en","zh-Hant","zh-Hans"];function YE(){try{const e=localStorage.getItem("ima2.locale");if(e==="ko"||e==="en"||e==="zh-Hant"||e==="zh-Hans")return e}catch{}if(typeof navigator<"u"){const e=navigator.language||"";if(e.toLowerCase().startsWith("ko"))return"ko";const a=e.toLowerCase();if(/^(zh[-_](tw|hk|mo|hant)|zh-hant)/.test(a))return"zh-Hant";if(/^(zh[-_](cn|sg|hans)|zh)/.test(a))return"zh-Hans"}return"en"}function XE(e){try{localStorage.setItem("ima2.locale",e)}catch{}}const QE="none",$u=[{value:"none",shortLabel:"off",fullLabelKey:"settings.reasoning.none"},{value:"low",shortLabel:"low",fullLabelKey:"settings.reasoning.low"},{value:"medium",shortLabel:"med",fullLabelKey:"settings.reasoning.medium"},{value:"high",shortLabel:"high",fullLabelKey:"settings.reasoning.high"},{value:"xhigh",shortLabel:"xhigh",fullLabelKey:"settings.reasoning.xhigh"},{value:"max",shortLabel:"max",fullLabelKey:"settings.reasoning.max"}];function Uv(e){return $u.some(a=>a.value===e)}const JE={low:"l",medium:"m",high:"h",xhigh:"x",max:"M"};function WE(e){return!Uv(e)||e==="none"?null:`R:${JE[e]}`}const ZE=!0,eR=!1,ir=!0,Hv=eR,lr=!0,tR=24;function Yu(e){return Math.min(tR,Math.max(1,Math.trunc(e||1)))}function nR(e){return Math.round(e/16)*16}const to=16,mm=3840,bu=655360,ms=8294400,aR=3,Jo=3,uy=Math.floor(Math.sqrt(ms)/to)*to,Bv=to,oR=mm,Kl=aR;function my(e){return Math.floor(e/16)*16}function bs(e){return Math.ceil(e/16)*16}function bn(e){return Math.min(oR,Math.max(Bv,e))}function _n(e,a){const i=typeof e=="number"?e:Number.parseInt(e,10);return Number.isFinite(i)?i:a}function oo(e,a){e.includes(a)||e.push(a)}function py(e,a){const i=nR(e);return i!==e&&oo(a,"snap"),i}function fy(e,a){return e<Bv&&oo(a,"min"),e>mm&&oo(a,"maxEdge"),bn(e)}function gy(e,a,i){return e>a*Kl?(oo(i,"ratio"),{w:e,h:bn(bs(e/Kl))}):a>e*Kl?(oo(i,"ratio"),{w:bn(bs(a/Kl)),h:a}):{w:e,h:a}}function rR(e,a,i){if(e*a<bu){oo(i,"minPixels");const m=Math.sqrt(bu/(e*a));let p=bn(bs(e*m)),h=bn(bs(a*m));for(;p*h<bu;)p<=h?p=bn(p+to):h=bn(h+to);return{w:p,h}}if(e*a<=ms)return{w:e,h:a};oo(i,"maxPixels");const o=Math.sqrt(ms/(e*a));let s=bn(my(e*o)),c=bn(my(a*o));for(;s*c>ms;)s>=c?s=bn(s-to):c=bn(c-to);return{w:s,h:c}}function pm(e,a,i,o){const s=[],c=_n(e,i),m=_n(a,o);let p=fy(py(c,s),s),h=fy(py(m,s),s);return{w:p,h}=gy(p,h,s),{w:p,h}=rR(p,h,s),{w:p,h}=gy(p,h,s),{requestedW:c,requestedH:m,w:p,h,adjusted:p!==c||h!==m,reasons:s}}function Vv(e,a,i,o){const s=pm(e,a,i,o);return{w:s.w,h:s.h}}const iR=[{id:"free",label:"Free",w:0,h:0},{id:"1:1",label:"1:1",w:1,h:1},{id:"3:2",label:"3:2",w:3,h:2},{id:"2:3",label:"2:3",w:2,h:3},{id:"16:9",label:"16:9",w:16,h:9},{id:"9:16",label:"9:16",w:9,h:16},{id:"21:9",label:"21:9",w:21,h:9},{id:"9:21",label:"9:21",w:9,h:21}];function lR(e,a){return`${e}x${a}`}function sR(e,a=1024){if(e.id==="free")return null;const i=a,o=e.w>=e.h,s=o?Math.round(i*e.w/e.h):i,c=o?i:Math.round(i*e.h/e.w);return Vv(s,c,s,c)}function Gs(e){const a=Vv(e.w,e.h,2400,1024);return{...e,w:a.w,h:a.h,label:e.label||`${a.w}×${a.h}`}}function Wo(e){return e.slice(0,Jo).map(Gs)}function cR(e,a){const i=Gs(a),o=e.findIndex(s=>s.id===i.id);return o>=0?Wo(e.map((s,c)=>c===o?i:s)):e.length>=Jo?Wo(e):Wo([...e,i])}function dR(e,a,i){const o=Gs({...i,id:a});return Wo(e.map(s=>s.id===a?o:s))}const uR=[{value:"1024x1024",label:"1024×1024",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],mR=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],pR=[{value:"1024x1824",label:"1024×1824",sub:"9:16"},{value:"2048x2048",label:"2048×2048",sub:"2K 1:1"},{value:"2048x1152",label:"2048×1152",sub:"2K 16:9"}],fR=[{value:"1152x2048",label:"1152×2048",sub:"2K 9:16"},{value:"3840x2160",label:"3840×2160",sub:"4K 16:9"},{value:"2160x3840",label:"2160×3840",sub:"4K 9:16"}];function gR(){return[{value:"auto",label:Z("size.autoLabel"),sub:Z("size.autoSub")},{value:"custom",label:Z("size.customLabel"),sub:Z("size.customSub")}]}function Tn(){return{startFrameFilename:null,endFrameFilename:null,references:[],referenceVideoFilename:null}}const Xu="vid:",Qu="img:",hR=/^[\p{L}\p{N}_-]{1,32}$/u;function fm(e){return hR.test(e)}function yR(e){return e.references.some(a=>a.tag!==void 0&&!fm(a.tag))}function Kv(e){return e==="video"?"video":"image"}function Ds(e){return typeof e=="string"&&/^\d{1,3}:\d{1,3}$/.test(e)?e:null}function vR(e){return typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.length<=128}function Fs(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const a=Object.entries(e).slice(0,24);return Object.fromEntries(a.filter(([i,o])=>/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(i)&&vR(o)))}function hy(e,a){return!(e.type==="number"&&typeof a!="number"||e.type==="boolean"&&typeof a!="boolean"||e.type==="string"&&typeof a!="string"||e.type==="string_array"||e.options&&!e.options.includes(a)||typeof a=="number"&&e.min!==void 0&&a<e.min||typeof a=="number"&&e.max!==void 0&&a>e.max)}function $v(e,a,i){const o=Ds(a),s=Fs(i),c={};for(const m of e.parameters){const p=s[m.name];p!==void 0&&hy(m,p)?c[m.name]=p:m.default!==void 0&&hy(m,m.default)&&(c[m.name]=m.default)}return{ratio:o&&e.aspectRatios.includes(o)?o:null,parameters:c}}function bR(e){return e?$v(e,null,{}):{ratio:null,parameters:{}}}function SR(e,a){return e.ratio===a.ratio&&JSON.stringify(e.parameters)===JSON.stringify(a.parameters)}function Yv(e){if(!e||typeof e!="object")return null;const a=e;if(typeof a.filename!="string"||a.filename.length===0)return null;const i=typeof a.tag=="string"?a.tag.slice(0,128):"",o=typeof a.dataUrl=="string"&&/^data:image\/(?:png|jpeg|webp);base64,/i.test(a.dataUrl)?a.dataUrl:null,s=typeof a.displayName=="string"&&a.displayName?a.displayName.slice(0,180):null;return{filename:a.filename,...i?{tag:i}:{},...o?{dataUrl:o}:{},...s?{displayName:s}:{}}}function gm(e){if(!e||typeof e!="object")return Tn();const a=e,i=Array.isArray(a.references)?a.references.map(Yv).filter(o=>!!o):[];return{startFrameFilename:typeof a.startFrameFilename=="string"&&a.startFrameFilename?a.startFrameFilename:null,endFrameFilename:typeof a.endFrameFilename=="string"&&a.endFrameFilename?a.endFrameFilename:null,references:i.filter((o,s)=>i.findIndex(c=>c.filename===o.filename)===s).slice(0,3),referenceVideoFilename:typeof a.referenceVideoFilename=="string"&&a.referenceVideoFilename?a.referenceVideoFilename:null}}function hm(e,a){const i=gm(a),o=e.includes("start_image")?i.startFrameFilename:null;return{startFrameFilename:o,endFrameFilename:e.includes("end_image")&&o?i.endFrameFilename:null,references:e.includes("image_references")?i.references:[],referenceVideoFilename:e.includes("video_references")?i.referenceVideoFilename:null}}function Xv(e,a){return JSON.stringify(e)===JSON.stringify(a)}function xR(e){return{provider:typeof e.mcpProvider=="string"?e.mcpProvider:null,model:typeof e.mcpModel=="string"?e.mcpModel:null,kind:Kv(e.mcpMediaKind),ratio:Ds(e.mcpRatio),parameters:Fs(e.mcpParameters)}}function $l(e,a){return`${e==="video"?Xu:Qu}${a}`}function AR(e){if(e.startsWith(Xu)){const a=e.slice(Xu.length);return a?{kind:"video",model:a}:null}if(e.startsWith(Qu)){const a=e.slice(Qu.length);return a?{kind:"image",model:a}:null}return null}function Qv(e){const a=e.normalize("NFKC").replace(/\s+/g,"_").replace(/[^\p{L}\p{N}_-]/gu,"").slice(0,32);return a.length>0?a:null}function TR(e,a,i){const o=e.mcpProvider??null;if(!o||!a)return null;const s=Kv(e.mcpMediaKind),c=Ds(e.mcpRatio),m=Fs(e.mcpParameters),p=e.mcpReferenceSelection!==void 0,h=e.mcpInputRoles,g=k=>h===void 0||h.includes(k),S=gm(e.mcpReferenceSelection),v=p?g("start_image")?S.startFrameFilename:null:s==="video"?e.currentImageFilename??null:null,y=p&&g("image_references")?S.references:[],x=g("image_references")?e.elementReferences??[]:[],E=[...y,...x].map(Yv).filter(k=>!!k).filter((k,C,_)=>_.findIndex(N=>N.filename===k.filename)===C).slice(0,3);if(E.some(k=>k.dataUrl||k.tag!==void 0&&!fm(k.tag)))return null;const P=p&&g("end_image")&&v?S.endFrameFilename:null,I=p&&g("video_references")?S.referenceVideoFilename:null;return{provider:o,kind:s,prompt:a,model:e.mcpModel??void 0,...c?{ratio:c}:{},...Object.keys(m).length>0?{parameters:m}:{},startFrameFilename:v??void 0,...P?{endFrameFilename:P}:{},...E.length>0?{references:E.map(({filename:k,tag:C})=>({filename:k,...C?{tag:C}:{}}))}:{},...I?{referenceVideoFilename:I}:{},...e.mcpCharacterElementId?{characterElementId:e.mcpCharacterElementId}:{},...i?{requestId:i}:{}}}function xi(e,a){const i=a.filter(s=>s.placement!=="after"),o=a.filter(s=>s.placement==="after");return[...i.map(s=>s.text.trim()).filter(Boolean),e.trim(),...o.map(s=>s.text.trim()).filter(Boolean)].filter(Boolean).join(`
|
|
24
24
|
|
|
25
25
|
`)}function CR(e){if(!e||typeof e!="object")return null;const a=e;return typeof a.id!="string"||typeof a.name!="string"||typeof a.text!="string"?null:{id:a.id,name:a.name,text:a.text,placement:a.placement==="after"?"after":"before"}}function Ai(e){if(!Array.isArray(e))return null;const a=e.map(CR);return a.every(i=>i!==null)?a:null}function ym(e){return e.map(a=>({id:a.id,name:a.name,text:a.text,placement:a.placement==="after"?"after":"before"}))}function wR(e){const a=Ai(e.composerInsertedPrompts);return typeof e.composerPrompt=="string"?{prompt:e.composerPrompt,insertedPrompts:a??[]}:a?{insertedPrompts:a}:{}}function IR(){try{const e=localStorage.getItem(Nv);return e===null?!0:JSON.parse(e)===!0}catch{return!0}}function ER(){try{const e=localStorage.getItem(kv);if(e==="agent")return lr?e:"classic";if(e==="card-news")return Hv?e:"classic";if(e==="node")return ir?e:"classic";if(e==="assets"||e==="asset-gen"||e==="home"||e==="classic")return e}catch{}return"classic"}function RR(){try{const e=localStorage.getItem(_v);if(e==="rail"||e==="horizontal"||e==="sidebar")return e}catch{}return"rail"}function yy(e){try{const a=localStorage.getItem(e);if(a==="current-session"||a==="all")return a}catch{}return"current-session"}function vy(){if(typeof window>"u")return{mode:"alpha",matteColor:"#ffffff"};try{const e=window.localStorage.getItem(Mv);if(!e)return{mode:"alpha",matteColor:"#ffffff"};const a=JSON.parse(e),i=a.mode==="matte"?"matte":"alpha",o=typeof a.matteColor=="string"&&/^#[0-9a-fA-F]{6}$/.test(a.matteColor)?a.matteColor:"#ffffff";return{mode:i,matteColor:o}}catch{return{mode:"alpha",matteColor:"#ffffff"}}}function Jv(e,a){if(!(typeof window>"u"))try{window.localStorage.setItem(Mv,JSON.stringify({mode:e,matteColor:a}))}catch{}}function Wv(){try{const e=localStorage.getItem(Pv);if(Tv(e))return e}catch{}return Uu}function Wa(e){try{localStorage.setItem(Pv,e)}catch{}}function NR(){try{const e=localStorage.getItem(Lv);if(Uv(e))return e}catch{}return QE}function kR(e){try{localStorage.setItem(Lv,e)}catch{}}function _R(){try{const e=localStorage.getItem(Ov);if(e==="false")return!1;if(e==="true")return!0}catch{}return ZE}function MR(e){try{localStorage.setItem(Ov,String(e))}catch{}}const by={model:!1,duration:5,resolution:"480p",aspectRatio:"auto"};function vm(){try{const e=localStorage.getItem(Fv);if(!e)return by;const a=JSON.parse(e);return{model:Iv(a.model),duration:typeof a.duration=="number"?a.duration:5,resolution:a.resolution==="480p"||a.resolution==="720p"||a.resolution==="1080p"?a.resolution:"480p",aspectRatio:typeof a.aspectRatio=="string"?a.aspectRatio:"auto"}}catch{return by}}function Zo(e){try{const a=vm();localStorage.setItem(Fv,JSON.stringify({...a,...e}))}catch{}}function Zv(){try{const e=localStorage.getItem(Vu);return typeof e=="string"&&e.length>0?e:null}catch{return null}}function Ln(e){try{e?localStorage.setItem(Vu,e):localStorage.removeItem(Vu)}catch{}}function PR(){try{const e=localStorage.getItem(Ku);return typeof e=="string"&&e.length>0?e:null}catch{return null}}function bm(e){try{e?localStorage.setItem(Ku,e):localStorage.removeItem(Ku)}catch{}}function LR(e,a){return`${e}x${a}`}function hi(e){return Yu(e)}const eb=new Set(["1024x1024","1536x1024","1024x1536","1360x1024","1024x1360","1824x1024","1024x1824","2048x2048","2048x1152","1152x2048","3840x2160","2160x3840","auto","custom"]);function OR(e){if(typeof e!="string")return{};if(eb.has(e))return{preset:e};const a=/^(\d+)x(\d+)$/.exec(e);if(!a)return{};const i=Number(a[1]),o=Number(a[2]);return!Number.isFinite(i)||!Number.isFinite(o)?{}:{preset:"custom",w:i,h:o}}function tb(e){return e==="low"||e==="medium"||e==="high"}function nb(e){return e==="png"||e==="jpeg"||e==="webp"}function ab(e){return e==="low"||e==="auto"}function jR(e){return a0(e)}function GR(e){return e==="auto"||e==="direct"}function DR(e){return typeof e=="string"&&eb.has(e)}function zs(){try{const e=localStorage.getItem(jv);if(!e)return{};const a=JSON.parse(e),i={};jR(a.provider)&&(i.provider=a.provider);const o=a.mcpProvider,s=a.mcpModel;(typeof o=="string"||o===null)&&(i.mcpProvider=o),(typeof s=="string"||s===null)&&(i.mcpModel=s),(a.mcpMediaKind==="image"||a.mcpMediaKind==="video")&&(i.mcpMediaKind=a.mcpMediaKind),"mcpRatio"in a&&(i.mcpRatio=Ds(a.mcpRatio)),"mcpParameters"in a&&(i.mcpParameters=Fs(a.mcpParameters)),tb(a.quality)&&(i.quality=a.quality),DR(a.sizePreset)&&(i.sizePreset=a.sizePreset),typeof a.customW=="number"&&Number.isFinite(a.customW)&&(i.customW=_n(a.customW,1920)),typeof a.customH=="number"&&Number.isFinite(a.customH)&&(i.customH=_n(a.customH,1088)),nb(a.format)&&(i.format=a.format),ab(a.moderation)&&(i.moderation=a.moderation),typeof a.count=="number"&&(i.count=hi(a.count)),typeof a.multimode=="boolean"&&(i.multimode=a.multimode),typeof a.multimodeMaxImages=="number"&&(i.multimodeMaxImages=hi(a.multimodeMaxImages)),GR(a.promptMode)&&(i.promptMode=a.promptMode),typeof a.prompt=="string"&&(i.prompt=a.prompt);const c=Ai(a.insertedPrompts);return c&&(i.insertedPrompts=c),i}catch{return{}}}function FR(){return xR(zs())}function Ti(e,a,i="image"){Ge({mcpProvider:e,mcpModel:a,mcpMediaKind:i})}function Ge(e){try{const a=zs();localStorage.setItem(jv,JSON.stringify({...a,...e}))}catch{}}const zR={maxB64Bytes:6e6,preserveTransparency:!1,maxEdge:4096,qualityLadder:[.85,.7,.55]},Sy=16777216;function xy(e,a,i){let o=e,s=a;if(o<=0||s<=0)return{w:1,h:1};const c=Math.max(o,s);if(c>i){const m=i/c;o=Math.round(o*m),s=Math.round(s*m)}if(o*s>Sy){const m=Math.sqrt(Sy/(o*s));o=Math.max(1,Math.floor(o*m)),s=Math.max(1,Math.floor(s*m))}return{w:o,h:s}}function Yl(e){return new Promise((a,i)=>{const o=new FileReader;o.onload=()=>{typeof o.result=="string"?a(o.result):i(new Error("FileReader returned non-string"))},o.onerror=()=>i(o.error??new Error("FileReader failed")),o.readAsDataURL(e)})}function Su(e,a,i){return new Promise((o,s)=>{e.toBlob(c=>c?o(c):s(new Error("canvas.toBlob returned null")),a,i)})}function Xl(e){const a=e.indexOf(",");return a<0?e.length:e.length-a-1}async function Sm(e,a={}){const i={...zR,...a},o=await Yl(e);if(Xl(o)<=i.maxB64Bytes)return o;let s;try{s=await createImageBitmap(e)}catch(c){throw new Error("이미지 디코드 실패. JPEG/PNG로 변환 후 다시 시도해 주세요.",{cause:c})}try{const{w:c,h:m}=xy(s.width,s.height,i.maxEdge),p=document.createElement("canvas");p.width=c,p.height=m;const h=p.getContext("2d");if(!h)throw new Error("canvas 2d context unavailable");if(h.drawImage(s,0,0,c,m),i.preserveTransparency){const S=await Su(p,"image/png"),v=await Yl(S);if(Xl(v)>i.maxB64Bytes)throw new Error("이미지 압축 실패. JPEG/PNG로 미리 변환 후 다시 시도해 주세요.");return v}for(const S of i.qualityLadder){const v=await Su(p,"image/jpeg",S),y=await Yl(v);if(Xl(y)<=i.maxB64Bytes)return y}const g=xy(c,m,2048);p.width=g.w,p.height=g.h,h.drawImage(s,0,0,g.w,g.h);for(const S of[.7,.5,.35]){const v=await Su(p,"image/jpeg",S),y=await Yl(v);if(Xl(y)<=i.maxB64Bytes)return y}throw new Error("이미지 압축 실패. JPEG/PNG로 미리 변환 후 다시 시도해 주세요.")}finally{s.close?.()}}function Ss(e){const a=(e.type||"").toLowerCase();if(a.includes("heic")||a.includes("heif"))return!0;const i=(e.name||"").toLowerCase();return i.endsWith(".heic")||i.endsWith(".heif")}function ob(e){return(e.type||"").toLowerCase()==="image/png"}const rb=18e4;function ib(e){const a=e.uiMode==="node"?[{kind:"node",sessionId:e.activeSessionId??void 0}]:[{kind:"classic"}];e.inFlight.some(i=>i.kind==="multimode")&&a.push({kind:"multimode"}),a.push({kind:"video"}),a.push({kind:"mcp-image"},{kind:"mcp-video"});for(const i of e.inFlight)i.kind?.startsWith("mcp-action-")&&!a.some(o=>o.kind===i.kind)&&a.push({kind:i.kind});return a}function lb(e,a){const i=e.kind??"classic";return a.some(o=>i===o.kind&&(o.kind!=="node"||(e.sessionId??null)===(o.sessionId??null)))}async function sb(e){const a=await Promise.all(e.map(i=>gv({kind:i.kind,sessionId:i.sessionId,includeTerminal:!0})));return{jobs:a.flatMap(i=>i.jobs),terminalJobs:a.flatMap(i=>i.terminalJobs??[])}}function xs(e){const a=e.meta??{},i=e.kind==="classic"||e.kind==="node"||e.kind==="multimode"||e.kind==="video"?e.kind:a.kind==="classic"||a.kind==="node"||a.kind==="multimode"||a.kind==="video"?a.kind:Ju(e.kind)??Ju(a.kind);return{id:e.requestId,prompt:typeof e.prompt=="string"?e.prompt:"",startedAt:e.startedAt,composerPrompt:typeof a.composerPrompt=="string"?a.composerPrompt:void 0,composerInsertedPrompts:Ai(a.composerInsertedPrompts)??void 0,phase:typeof e.phase=="string"?e.phase:void 0,sessionId:typeof a.sessionId=="string"?a.sessionId:null,parentNodeId:typeof a.parentNodeId=="string"?a.parentNodeId:null,clientNodeId:typeof a.clientNodeId=="string"?a.clientNodeId:null,kind:i}}function cb(e){const a=typeof e.errorCode=="string"&&e.errorCode?e.errorCode:"UNKNOWN",i=new Error(a==="EMPTY_RESPONSE"?"No image data returned from the image backend.":"Generation failed on the server.");return i.code=a,i.status=typeof e.httpStatus=="number"?e.httpStatus:void 0,i}function sr(e){if(!e||typeof e!="object")return!1;const a=e;return a.code==="GENERATION_CANCELED"||a.status===499}function Ay(e){return e.filename||e.image}function Ty(e,a){const i=new Map(e.map(o=>[Ay(o),o]));for(const o of a)i.set(Ay(o),o);return[...i.values()].sort((o,s)=>(o.sequenceIndex??Number.MAX_SAFE_INTEGER)-(s.sequenceIndex??Number.MAX_SAFE_INTEGER))}function db(){try{const e=localStorage.getItem(Gv);if(!e)return[];const a=JSON.parse(e);if(!Array.isArray(a))return[];const i=Date.now();return a.filter(o=>o&&typeof o.id=="string"&&typeof o.prompt=="string"&&typeof o.startedAt=="number"&&i-o.startedAt<rb).map(o=>({id:o.id,prompt:o.prompt,startedAt:o.startedAt,composerPrompt:typeof o.composerPrompt=="string"?o.composerPrompt:void 0,composerInsertedPrompts:Ai(o.composerInsertedPrompts)??void 0,phase:typeof o.phase=="string"?o.phase:void 0,sessionId:typeof o.sessionId=="string"?o.sessionId:null,parentNodeId:typeof o.parentNodeId=="string"?o.parentNodeId:null,clientNodeId:typeof o.clientNodeId=="string"?o.clientNodeId:null,kind:o.kind==="classic"||o.kind==="node"||o.kind==="multimode"||o.kind==="video"?o.kind:Ju(o.kind)}))}catch{return[]}}function Ju(e){return e==="classic"||e==="node"||e==="multimode"||e==="video"||e==="mcp-image"||e==="mcp-video"||typeof e=="string"&&e.startsWith("mcp-action-")?e:void 0}const An=500,xm=5;function qR(e){return e==="classic"||e==="edit"||e==="generate"||e==="card-news-card"||e==="card-news-set"?e:null}function Ci(e){const a=Ai(e.composerInsertedPrompts),i=e.mediaType==="video"||/\.(mp4|webm|mov)$/i.test(e.filename??"");return{image:e.url,url:e.url,providerUrl:e.providerUrl??null,mediaType:e.mediaType,video:e.video??null,videoSeries:e.videoSeries??null,videoContinuity:e.videoContinuity??null,videoLineage:e.videoLineage??null,filename:e.filename,thumb:e.thumb??(i?void 0:e.url),prompt:e.prompt??void 0,userPrompt:e.userPrompt??null,revisedPrompt:e.revisedPrompt??null,promptMode:e.promptMode??null,composerPrompt:e.composerPrompt??null,composerInsertedPrompts:a?ym(a):null,size:e.size??void 0,quality:e.quality??void 0,format:e.format,model:e.model??void 0,reasoningEffort:e.reasoningEffort??void 0,elapsed:e.elapsed??void 0,provider:e.provider,usage:e.usage??void 0,createdAt:e.createdAt,sessionId:e.sessionId??null,nodeId:e.nodeId??null,parentNodeId:e.parentNodeId??null,clientNodeId:e.clientNodeId??null,requestId:e.requestId??null,kind:qR(e.kind),canvasVersion:!!e.canvasVersion,canvasSourceFilename:e.canvasSourceFilename??null,canvasEditableFilename:e.canvasEditableFilename??null,canvasMergedAt:e.canvasMergedAt??void 0,annotationsBaked:!!e.annotationsBaked,annotationSnapshot:e.annotationSnapshot??null,annotationOnly:!!e.annotationOnly,setId:e.setId??null,cardId:e.cardId??null,cardOrder:e.cardOrder??null,headline:e.headline??null,body:e.body??null,cards:e.cards,refsCount:e.refsCount??0,webSearchCalls:e.webSearchCalls??0,isFavorite:e.isFavorite??!1,sequenceId:e.sequenceId??null,sequenceIndex:e.sequenceIndex??null,sequenceTotalRequested:e.sequenceTotalRequested??null,sequenceTotalReturned:e.sequenceTotalReturned??null,sequenceStatus:e.sequenceStatus??null}}function Sn(e){return e.filename??e.image}function ub(e,a){const i=Sn(a);return e.filter(o=>Sn(o)!==i)}function mb(e,a){const i=Sn(a);return e.find(o=>Sn(o)===i)}function pb(e,a){return a?{...a,...e,createdAt:e.createdAt??a.createdAt,requestId:e.requestId??a.requestId,sessionId:e.sessionId??a.sessionId,kind:e.kind??a.kind,refsCount:e.refsCount??a.refsCount,isFavorite:e.isFavorite??a.isFavorite}:e}function fb(e,a){const i=new Map(e.map(o=>[Sn(o),o]));for(const o of a)i.set(Sn(o),o);return[...e.map(o=>i.get(Sn(o))??o),...a.filter(o=>!e.some(s=>Sn(s)===Sn(o)))]}function qs(e,a){return e.slice(0,Math.max(An,a))}function Am(e){return e.replace(/^data:[^;]+;base64,/,"")}async function wi(e,a="reference.png"){const i=await fetch(e);if(!i.ok)throw new Error(`reference fetch failed: ${i.status}`);const o=await i.blob(),s=new File([o],a,{type:o.type||"image/png"});return Sm(s,{preserveTransparency:!1})}function UR(e,a){let i=!1;const o={};for(const[s,c]of Object.entries(e)){const m=c.images.filter(p=>p.filename!==a);if(m.length===c.images.length){o[s]=c;continue}i=!0,m.length!==0&&(o[s]={...c,images:m,returned:m.length,status:c.status==="complete"&&m.length<c.requested?"partial":c.status})}return i?o:e}function jt(e){try{localStorage.setItem(Gv,JSON.stringify(e))}catch(a){const i=window;i.__ima2QuotaWarned||(i.__ima2QuotaWarned=!0,console.warn("[ima2] localStorage write failed:",a))}}function Us(e,a){if(e.provider==="grok"||e.provider==="grok-api"||e.provider==="agy"||e.provider==="gemini-api"||e.provider==="atlascloud"||e.provider==="minimax"||e.sizePreset!=="custom")return null;const i=pm(e.customW,e.customH,e.customW,e.customH);return i.adjusted?{requestedW:i.requestedW,requestedH:i.requestedH,adjustedW:i.w,adjustedH:i.h,reasons:i.reasons,continuation:a}:null}function HR(e){const a=typeof e=="number"?e:Number(e);return Number.isFinite(a)?Math.max(1,Math.trunc(a)):xm}async function BR(e){try{const a=await gT();e({referenceLimit:HR(a.limits?.maxRefCount)})}catch{e({referenceLimit:xm})}}function Tm(e){return new Promise((a,i)=>{const o=new FileReader;o.onload=()=>a(String(o.result)),o.onerror=()=>i(o.error),o.readAsDataURL(e)})}async function VR(e){const a=await fetch(e);if(!a.ok)throw new Error(`reference fetch failed: ${a.status}`);const i=await a.blob();return Tm(new File([i],"reference.png",{type:i.type||"image/png"}))}function KR(e,a=256){return new Promise(i=>{const o=new Image;o.onload=()=>{const s=Math.min(1,a/Math.max(o.width,o.height)),c=document.createElement("canvas");c.width=o.width*s,c.height=o.height*s;const m=c.getContext("2d");if(!m)return i(e);m.drawImage(o,0,0,c.width,c.height),i(c.toDataURL("image/jpeg",.6))},o.onerror=()=>i(e),o.src=e})}function $R(e,a){return e.find(i=>i.target===a)??null}function YR(e,a,i){return e.some(o=>o.target===i&&o.source!==a)}function XR(e,a,i){if(a===i)return!0;const o=new Map;for(const m of e){const p=o.get(m.source)??[];p.push(m.target),o.set(m.source,p)}const s=new Set([i]),c=[i];for(let m=0;m<c.length;m++)for(const p of o.get(c[m])??[]){if(p===a)return!0;s.has(p)||(s.add(p),c.push(p))}return!1}function wj(e,a){const i=new Map,o=new Map;for(const m of e)i.set(m.id,0);for(const m of a){i.set(m.target,(i.get(m.target)??0)+1);const p=o.get(m.source)??[];p.push(m.target),o.set(m.source,p)}const s=e.filter(m=>(i.get(m.id)??0)===0).map(m=>m.id);let c=0;for(let m=0;m<s.length;m++){c+=1;for(const p of o.get(s[m])??[]){const h=(i.get(p)??0)-1;i.set(p,h),h===0&&s.push(p)}}return c<e.length}function Mn(e,a){const i=new Map(e.map(o=>[o.id,o]));return e.map(o=>{const s=$R(a,o.id),m=(s?i.get(s.source):null)?.data.serverNodeId??null;return o.data.parentServerNodeId===m?o:{...o,data:{...o.data,parentServerNodeId:m}}})}const gb="ima2.nodeRefs.v1";function Cm(){try{const e=localStorage.getItem(gb);if(!e)return{};const a=JSON.parse(e);return a&&typeof a=="object"?a:{}}catch{return{}}}function hb(e){try{localStorage.setItem(gb,JSON.stringify(e))}catch{}}function QR(e,a){if(!e)return[];const i=Cm()[e]?.[a];return Array.isArray(i)?i.filter(o=>typeof o=="string"):[]}function Hs(e,a,i){if(!e)return;const o=Cm(),s={...o[e]??{}};i.length===0?delete s[a]:s[a]=i,o[e]=s,hb(o)}function wm(e,a){Hs(e,a,[])}function JR(e,a){if(!e)return;const i=Cm(),o=i[e];if(!o)return;const s=new Set(a);for(const c of Object.keys(o))s.has(c)||delete o[c];i[e]=o,hb(i)}const WR=/\.(mp4|webm|mov)$/i;function kn(e){if(!e||e.startsWith("data:image/"))return!1;const a=e.split("?")[0];return WR.test(a)||e.startsWith("data:video/")}function gt(e){return e?e.mediaType==="video"?!0:kn(e.filename)||kn(e.url)||kn(e.image):!1}const ZR=15e3;function Im(e,a,i={}){return new Promise((o,s)=>{const c=document.createElement("video");c.crossOrigin="anonymous",c.preload="auto",c.muted=!0;let m=!1,p=null;const h=()=>{p!==null&&clearTimeout(p),i.signal?.removeEventListener("abort",S),c.onloadedmetadata=null,c.onseeked=null,c.onerror=null,c.src="",c.load()},g=v=>{m||(m=!0,h(),v())};function S(){g(()=>s(Object.assign(new Error("frame extraction aborted"),{code:"VIDEO_FRAME_EXTRACT_ABORTED"})))}if(i.signal?.aborted){S();return}i.signal?.addEventListener("abort",S),p=setTimeout(()=>{g(()=>s(new Error("frame extraction timed out")))},ZR),c.onloadedmetadata=()=>{const v=c.duration;if(!Number.isFinite(v)||v<=0){g(()=>s(new Error("video duration is unavailable")));return}c.currentTime=Math.max(0,a(v))},c.onseeked=()=>{try{const v=document.createElement("canvas");v.width=c.videoWidth,v.height=c.videoHeight;const y=v.getContext("2d");if(!y){g(()=>s(new Error("canvas 2d context unavailable")));return}y.drawImage(c,0,0);const x=v.toDataURL("image/jpeg",.85);g(()=>o(x))}catch(v){g(()=>s(v))}},c.onerror=()=>{g(()=>s(new Error("Failed to load video for frame extraction")))},c.src=e})}function cr(e,a){return Im(e,i=>i-.1,a)}function yb(e,a){return Im(e,i=>Math.min(i*.3,.4),a)}function vb(e,a){return Im(e,i=>i/2,a)}function bb(e){const a=e.nodes.map(o=>{const s=o.data??{},c=typeof s.imageUrl=="string"&&s.imageUrl.length>0?s.imageUrl:null,m=typeof s.serverNodeId=="string"&&s.serverNodeId.length>0?`/generated/${s.serverNodeId}.png`:null,p=c??m,h={...s,clientId:o.id,serverNodeId:s.serverNodeId??null,parentServerNodeId:s.parentServerNodeId??null,prompt:typeof s.prompt=="string"?s.prompt:"",imageUrl:p,status:s.status??(p?"ready":"empty"),pendingRequestId:s.pendingRequestId??null,recoveryRequestId:s.recoveryRequestId??null,pendingPhase:s.pendingPhase??null,pendingStartedAt:typeof s.pendingStartedAt=="number"?s.pendingStartedAt:null,partialImageUrl:null,error:s.error,elapsed:s.elapsed,reasoningEffort:s.reasoningEffort,webSearchCalls:s.webSearchCalls,model:s.model??null,size:s.size??null,referenceImages:QR(e.id,o.id),video:s.video??null};return{id:o.id,type:s.nodeType==="element-reference"?"elementReferenceNode":"imageNode",position:{x:o.x,y:o.y},data:h}}),i=e.edges.map(o=>{const s=o.data??{};return{id:o.id,source:o.source,target:o.target,sourceHandle:typeof s.sourceHandle=="string"?s.sourceHandle:null,targetHandle:typeof s.targetHandle=="string"?s.targetHandle:null}});return{graphNodes:Mn(a,i),graphEdges:i,graphVersion:e.graphVersion}}const e1=800;let Nn=null,ps=!1,fs=!1,Za=null,Sb=0;function xb(){try{const e=sessionStorage.getItem(sy);if(e)return e;const a=`tab_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`;return sessionStorage.setItem(sy,a),a}catch{return"tab_unavailable"}}function Ab(e){const a={...e};return delete a.referenceImages,delete a.partialImageUrl,e.status==="pending"||e.status==="reconciling"?{...a,status:"empty",pendingRequestId:null,recoveryRequestId:e.pendingRequestId??e.recoveryRequestId??null,pendingPhase:null,pendingStartedAt:null,error:void 0}:a}function Tb(e){return e.map(a=>({id:a.id,source:a.source,target:a.target,data:{sourceHandle:a.sourceHandle??null,targetHandle:a.targetHandle??null}}))}async function Cb(e,a){const i=e().activeSessionId;if(!i||e().graphNodes.filter(p=>!p.data.imageUrl&&!p.data.serverNodeId).length===0)return;let s=[];try{s=(await rr({sessionId:i,limit:An})).items}catch{return}let c=!1;const m=e().graphNodes.map(p=>{if(p.data.imageUrl||p.data.serverNodeId)return p;const h=p.data.pendingStartedAt??0,g=p.data.pendingRequestId??p.data.recoveryRequestId??null,v=(g?s.find(y=>(y.sessionId??null)===i&&(y.requestId??null)===g):null)??s.find(y=>(y.sessionId??null)===i&&(y.clientNodeId??null)===p.id&&(!h||(y.createdAt??0)>=h));return v?(c=!0,{...p,data:{...p.data,status:"ready",imageUrl:v.url,serverNodeId:v.nodeId??p.data.serverNodeId,size:v.size??p.data.size??null,elapsed:v.elapsed??p.data.elapsed,reasoningEffort:v.reasoningEffort??p.data.reasoningEffort,video:v.video??p.data.video??null,pendingRequestId:null,recoveryRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,error:void 0}}):p});c&&(a({graphNodes:m}),Ib(e,a,"recovery"))}async function t1(e,a){const i=e().activeSessionId;if(!i)return;const{session:o}=await bv(i),{graphNodes:s,graphEdges:c,graphVersion:m}=bb(o);a({graphNodes:s,graphEdges:c,activeSessionGraphVersion:m}),e().showToast(Z("toast.sessionReloadedElsewhere"),!0),await Cb(e,a).catch(()=>{})}async function n1(e,a,i){const o=e().activeSessionId,s=e().activeSessionGraphVersion;if(!o||s==null)return"skipped";const{graphNodes:c,graphEdges:m,sessionLoading:p}=e();if(p||c.length===0&&s>0)return"skipped";const h=c.map(v=>({id:v.id,x:v.position.x,y:v.position.y,data:Ab(v.data)})),g=Tb(m),S=`gs_${Date.now().toString(36)}_${++Sb}`;try{const v=await HT(o,s,h,g,{saveId:S,saveReason:i,tabId:xb()});return e().activeSessionId!==o?"skipped":(JR(o,e().graphNodes.map(y=>y.id)),a({activeSessionGraphVersion:v.graphVersion}),"saved")}catch(v){return v.status===409?(await t1(e,a),"conflict"):(console.warn("[sessions] save failed:",v),"failed")}}async function wb(e,a,i){return ps?(fs=!0,Za||"skipped"):(ps=!0,Za=(async()=>{let o=i,s="skipped";do{if(fs=!1,s=await n1(e,a,o),s==="conflict"||s==="failed")break;o="queued"}while(fs);return s})().finally(()=>{ps=!1,Za=null}),Za)}function Ib(e,a,i="debounced"){const o=e();o.activeSessionId&&(o.sessionLoading||(Nn&&clearTimeout(Nn),Nn=setTimeout(()=>{Nn=null,wb(e,a,i)},e1)))}async function a1(e,a,i="manual"){let o=!1;if(Nn&&(clearTimeout(Nn),Nn=null,o=!0),ps){if(fs=!0,(Za?await Za:"skipped")==="failed")throw new Error(Z("modal.graphSaveFailed"));return}if(o&&await wb(e,a,i)==="failed")throw new Error(Z("modal.graphSaveFailed"))}function o1(e){const a=e();if(!a.activeSessionId||a.activeSessionGraphVersion==null||a.sessionLoading||a.graphNodes.length===0&&a.activeSessionGraphVersion>0)return;Nn&&(clearTimeout(Nn),Nn=null);const i=a.graphNodes.map(m=>({id:m.id,x:m.position.x,y:m.position.y,data:Ab(m.data)})),o=Tb(a.graphEdges),s=`/api/sessions/${encodeURIComponent(a.activeSessionId)}/graph`,c=JSON.stringify({nodes:i,edges:o});try{fetch(s,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(a.activeSessionGraphVersion),"X-Ima2-Graph-Save-Id":`gs_${Date.now().toString(36)}_${++Sb}`,"X-Ima2-Graph-Save-Reason":"beforeunload","X-Ima2-Tab-Id":xb()},body:c,keepalive:!0})}catch{}}async function Ra(e,a,i,o={}){const s=gt(e)?void 0:await KR(e.image).catch(()=>e.image),c=e.filename?`/generated/${e.filename}`:e.image,m={...e,thumb:s,url:c,createdAt:e.createdAt||Date.now()},p=i(),h=mb(p.history,m),g=pb(m,h),S=ub(p.history,g),v=qs([g,...S],p.loadedHistoryRetainLimit+1),x=!(o.autoSelectStartedAt!=null&&p.lastHistorySelectedAt>o.autoSelectStartedAt)&&(!p.currentImage||o.autoSelectStartedAt==null||p.lastHistorySelectedAt<=o.autoSelectStartedAt);x&&Ln(g.filename??null),a({history:v,...x?{currentImage:g}:{},loadedHistoryRetainLimit:Math.max(p.loadedHistoryRetainLimit,Math.min(p.history.length+1,p.loadedHistoryRetainLimit+1)),unseenGeneratedCount:p.unseenGeneratedCount+1})}function r1(e){for(const a of e.history)if(a.sessionId)return a.sessionId;return null}const i1=30;function xu(e,a,i){return{nodes:structuredClone(e),edges:structuredClone(a),label:i,at:Date.now()}}function l1(e,a,i=i1){const o=[...e,a];return o.length>i?o.slice(o.length-i):o}function s1(e,a,i){if(e.length===0)return null;const o=e[e.length-1];return{past:e.slice(0,-1),restored:o,future:[...i,a]}}function c1(e,a,i){if(i.length===0)return null;const o=i[i.length-1];return{past:[...e,a],restored:o,future:i.slice(0,-1)}}const d1=["status","pendingRequestId","recoveryRequestId","pendingPhase","pendingStartedAt","partialImageUrl"];function Cy(e,a){const i=new Map(a.map(s=>[s.id,s]));return{nodes:e.nodes.map(s=>{const c=i.get(s.id);if(!c||!(c.data.status==="pending"||c.data.status==="reconciling"))return s;const p={...s.data};for(const h of d1)p[h]=c.data[h];return{...s,data:p}}),edges:e.edges}}function u1(e){return e.data.status==="ready"&&!!e.data.imageUrl}function m1(e,a,i){const o=new Set(i),s=new Set(e.map(v=>v.id)),c=new Map,m=new Map;for(const v of o)s.has(v)&&(c.set(v,0),m.set(v,[]));for(const v of a)!o.has(v.source)||!o.has(v.target)||(m.get(v.source)?.push(v.target),c.set(v.target,(c.get(v.target)??0)+1));const p=e.map(v=>v.id),h=p.filter(v=>o.has(v)&&(c.get(v)??0)===0),g=[];for(let v=0;v<h.length;v++){const y=h[v];g.push(y);for(const x of m.get(y)??[])c.set(x,(c.get(x)??0)-1),(c.get(x)??0)===0&&h.push(x)}const S=new Set(g);return g.concat(p.filter(v=>o.has(v)&&!S.has(v)))}function p1(e,a){const i=new Set(a),o=new Set,s=new Map;for(const m of e){const p=s.get(m.source)??[];p.push(m.target),s.set(m.source,p)}const c=[...i];for(let m=0;m<c.length;m++)for(const p of s.get(c[m])??[])i.has(p)||o.has(p)||(o.add(p),c.push(p));return[...o]}function f1(e,a){const i=new Map;for(const c of e){const m=i.get(c.source)??[];m.push(c.target),i.set(c.source,m)}const o=new Set,s=[a];for(let c=0;c<s.length;c++)for(const m of i.get(s[c])??[])o.has(m)||(o.add(m),s.push(m));return[...o]}function g1(e,a,i){const o=new Set(i);return e.filter(s=>s.source===a&&!o.has(s.target)).map(s=>s.target)}function h1(e,a,i){const o=new Set(i),s=new Map(e.map(m=>[m.id,m])),c=[];for(const m of a){if(!o.has(m.target)||o.has(m.source))continue;s.get(m.source)?.data.serverNodeId||c.push(m.target)}return c}function y1(e,a,i){const o=new Set(i),s=new Set(e.map(g=>g.id)),c=new Map,m=new Map;for(const g of o)s.has(g)&&(c.set(g,0),m.set(g,[]));for(const g of a)!c.has(g.source)||!c.has(g.target)||(m.get(g.source)?.push(g.target),c.set(g.target,(c.get(g.target)??0)+1));const p=[...c.keys()].filter(g=>(c.get(g)??0)===0),h=new Set;for(let g=0;g<p.length;g++){h.add(p[g]);for(const S of m.get(p[g])??[]){const v=(c.get(S)??0)-1;c.set(S,v),v===0&&p.push(S)}}return[...c.keys()].filter(g=>!h.has(g))}const v1=["BILLING_REQUIRED","AUTH_INVALID","AUTH_EXPIRED"],b1={AUTH_INVALID:{surface:"card",cardKey:"errorCard.authClass",cta:"reauth"},AUTH_EXPIRED:{surface:"card",cardKey:"errorCard.authClass",cta:"reauth"},BILLING_REQUIRED:{surface:"card",cardKey:"errorCard.billingRequired"},RATE_LIMITED:{surface:"toast",toastKey:"toast.errorClass.rateLimited",cta:"retry"},PROVIDER_TIMEOUT:{surface:"toast",toastKey:"toast.errorClass.providerTimeout",cta:"retry"},NETWORK_FAILURE:{surface:"toast",toastKey:"toast.errorClass.networkFailure",cta:"retry"},CONTENT_REJECTED:{surface:"toast",toastKey:"toast.errorClass.contentRejected"},CAPABILITY_UNSUPPORTED:{surface:"toast",toastKey:"toast.errorClass.capabilityUnsupported"},MODEL_UNAVAILABLE:{surface:"toast",toastKey:"toast.errorClass.modelUnavailable"},INTERNAL_STATE_ERROR:{surface:"toast",toastKey:"toast.errorClass.internalState",cta:"reload"}};function S1(e){return typeof e=="string"&&v1.includes(e)}function wy(e){if(typeof e=="string")return b1[e]}const eo={REF_TOO_LARGE:{surface:"toast",toastKey:"toast.refTooLarge"},REF_NOT_BASE64:{surface:"toast",toastKey:"toast.refNotBase64"},REF_EMPTY:{surface:"toast",toastKey:"toast.refEmpty"},REF_TOO_MANY:{surface:"toast",toastKey:"toast.refLimitExceeded"},MINIMAX_MODEL_REQUIRES_REFERENCE:{surface:"toast",toastKey:"toast.minimaxModelRequiresReference"},MODERATION_REFUSED:{surface:"card",cardKey:"errorCard.moderationRefused",cta:"dismiss"},SAFETY_REFUSAL:{surface:"card",cardKey:"errorCard.moderationRefused",cta:"dismiss"},EMPTY_RESPONSE:{surface:"card",cardKey:"errorCard.emptyResponse",cta:"dismiss"},STREAM_PARSE_FAILED:{surface:"card",cardKey:"errorCard.streamParseFailed",cta:"retry"},IMAGE_TOOL_NOT_CALLED:{surface:"card",cardKey:"errorCard.imageToolNotCalled",cta:"retry"},WEB_SEARCH_ONLY_RESPONSE:{surface:"card",cardKey:"errorCard.webSearchOnlyResponse",cta:"retry"},IMAGE_TOOL_FAILED:{surface:"card",cardKey:"errorCard.imageToolFailed",cta:"retry"},IMAGE_TOOL_COMPLETED_WITHOUT_RESULT:{surface:"card",cardKey:"errorCard.imageToolNoResult",cta:"retry"},OAUTH_IMAGE_CAPABILITY_UNAVAILABLE:{surface:"card",cardKey:"errorCard.oauthImageCapabilityUnavailable",cta:"dismiss"},RESPONSES_STREAM_ERROR:{surface:"card",cardKey:"errorCard.responsesStreamError",cta:"retry"},UPSTREAM_5XX:{surface:"card",cardKey:"errorCard.upstream5xx",cta:"retry"},AUTH_CHATGPT_EXPIRED:{surface:"card",cardKey:"errorCard.authChatgptExpired",cta:"reauth"},AUTH_API_KEY_INVALID:{surface:"card",cardKey:"errorCard.authApiKeyInvalid",cta:"dismiss"},NETWORK_FAILED:{surface:"card",cardKey:"errorCard.networkFailed",cta:"reload"},OAUTH_UNAVAILABLE:{surface:"card",cardKey:"errorCard.oauthUnavailable",cta:"reload"},INVALID_REQUEST:{surface:"card",cardKey:"errorCard.invalidRequest",cta:"dismiss"},INVALID_MODERATION:{surface:"toast",toastKey:"toast.generateFailed"},APIKEY_DISABLED:{surface:"card",cardKey:"errorCard.apikeyDisabled",cta:"dismiss"},AGY_GENERATION_FAILED:{surface:"card",cardKey:"errorCard.agyGenerationFailed",cta:"retry"},AGY_TIMEOUT:{surface:"card",cardKey:"errorCard.agyTimeout",cta:"retry"},AGY_PROCESS_ERROR:{surface:"card",cardKey:"errorCard.agyProcessError",cta:"retry"},AGY_QUOTA_EXHAUSTED:{surface:"card",cardKey:"errorCard.agyQuotaExhausted",cta:"dismiss"},AGY_PARSE_FAILED:{surface:"card",cardKey:"errorCard.agyProcessError",cta:"retry"},AGY_ARTIFACT_NOT_FOUND:{surface:"card",cardKey:"errorCard.agyProcessError",cta:"retry"},DB_ERROR:{surface:"toast",toastKey:"toast.generateFailed"},UNKNOWN:{surface:"toast",toastKey:"toast.generateFailed"}};function Iy(e){const a=(e||"").toLowerCase();return a?a.includes("moderation_blocked")||a.includes("moderation refused")?"MODERATION_REFUSED":a.includes("no image data returned")?"EMPTY_RESPONSE":a.includes("stream could not be parsed")?"STREAM_PARSE_FAILED":a.includes("web search but not the image tool")?"WEB_SEARCH_ONLY_RESPONSE":a.includes("without calling the image tool")?"IMAGE_TOOL_NOT_CALLED":a.includes("image tool call failed")?"IMAGE_TOOL_FAILED":a.includes("image tool completed without image data")?"IMAGE_TOOL_COMPLETED_WITHOUT_RESULT":a.includes("token is expired")||a.includes("sign in again")||a.includes("access token")&&a.includes("expired")||a.includes("token")&&a.includes("expired")&&!a.includes("api key")?"AUTH_CHATGPT_EXPIRED":a.includes("incorrect api key")||a.includes("invalid authentication")||a.includes("exceeded your current quota")||a.includes("incorrect organization")?"AUTH_API_KEY_INVALID":a.includes("failed to fetch")||a.includes("econnrefused")||a.includes("econnreset")||a.includes("enotfound")||a.includes("etimedout")||a.includes("network error")?"NETWORK_FAILED":a.includes("oauth")&&(a.includes("not running")||a.includes("unavailable")||a.includes("not ready"))?"OAUTH_UNAVAILABLE":a.includes("invalid_request_error")||a.includes("invalid_value")||a.includes("invalid size")||a.includes("invalid request")||a.includes("requested resolution")||a.includes("minimum pixel budget")||a.includes("unsupported value")?"INVALID_REQUEST":a.includes("resource exhausted")||a.includes("exhausted your capacity")||a.includes("quota will reset")?"AGY_QUOTA_EXHAUSTED":a.includes("agy generation timed out")?"AGY_TIMEOUT":a.includes("agy generation failed")?"AGY_GENERATION_FAILED":a.includes("agy process error")||a.includes("agy exited")?"AGY_PROCESS_ERROR":a.includes("agy artifact not found")?"AGY_ARTIFACT_NOT_FOUND":a.includes("could not parse artifact path from agy")?"AGY_PARSE_FAILED":a.includes("an error occurred while processing")||/\b5\d\d\b/.test(a)?"UPSTREAM_5XX":"UNKNOWN":"UNKNOWN"}function x1(e){const a=(e||"").toLowerCase();return a.includes("request was rejected")||a.includes("prompt was rejected")?"input":a.includes("image was filtered")||a.includes("generated image")?"output":"unknown"}function Eb(e){const a=e,i=a&&typeof a=="object"?a:{},o=typeof i.message=="string"?i.message:String(e??""),s=typeof i.code=="string"?i.code:"",c=typeof i.rawCode=="string"?i.rawCode:void 0,m=typeof i.errorClass=="string"?i.errorClass:void 0,p=s&&s in eo?s:c&&c in eo?c:void 0,h=S1(m)?wy(m):void 0,g=wy(m);let S,v;h?(S=p??"UNKNOWN",v=h):p?(S=p,v=eo[p]):g?(S=Iy(o),v=g):(S=Iy(o),v=eo[S]??eo.UNKNOWN);const y=S==="MODERATION_REFUSED"||S==="SAFETY_REFUSAL"?(typeof i.moderationStage=="string"?i.moderationStage:void 0)||x1(o):void 0;return{code:S,spec:v,message:o,...c?{rawCode:c}:s&&!p?{rawCode:s}:{},...m&&(h||g)?{errorClass:m}:{},...y?{moderationStage:y}:{}}}function dr(e,a){const{code:i,spec:o,message:s}=Eb(e);if(o.surface==="card")a.showErrorCard(i,{fallbackMessage:s,cardKey:o.cardKey,cta:o.cta});else{const c=o.toastKey?Z(o.toastKey):s||Z("toast.generateFailed");a.showToast(c,!0)}return{code:i,message:s}}const A1=["AUTH_CHATGPT_EXPIRED","AUTH_API_KEY_INVALID","APIKEY_DISABLED","AGY_QUOTA_EXHAUSTED"],T1=["EMPTY_RESPONSE","DB_ERROR","UNKNOWN"];function C1(e){if(A1.includes(e))return"auth";const a=eo[e]?.cta;return a==="reauth"?"auth":a==="retry"||a==="reload"||T1.includes(e)?"retry":"fix-input"}function w1(e){const{code:a,message:i}=Eb(e),o=C1(a);return{message:i,code:a,retryable:o==="retry",action:o,occurredAt:Date.now()}}const I1=Av.grok.video,E1=3;function R1(e,a){return Av[e]?.[a]}function Rb(e){if(e.mcpProvider)return E1;if(e.videoModelSelected)return Math.min(e.serverLimit,I1);const a=R1(e.provider,"image");return a===void 0?e.serverLimit:Math.min(e.serverLimit,a)}const As=new Map;function ur(e,a){As.set(e,a)}function mr(e){As.delete(e)}function Nb(e){As.get(e)?.abort(),As.delete(e)}const N1="element-source:",k1=500;function _1(e){return`${N1}${e}`}function Ij(e,a){const i=_1(a);return e.find(o=>o.kind==="element"&&(o.metadata?.sourceAssetId===a||o.tags.includes(i)))??null}function kb(e){const a=e.metadata?.refs;return Array.isArray(a)?a.find(i=>typeof i=="string"&&i.length>0)??null:null}async function M1(e=im){const a=[],i=new Set,o=new Set;let s=null;try{do{const c=await e({kind:"element",folderId:null,tag:null,q:"",cursor:s,limit:k1});for(const m of c.assets)i.has(m.id)||(i.add(m.id),a.push(m));if(s=c.nextCursor,s&&o.has(s))throw new Error("element pagination returned a repeated cursor");s&&o.add(s)}while(s);return a}catch(c){throw c instanceof Error?c:new Error(String(c))}}function _b(e){return`/generated/${e.split("/").map(encodeURIComponent).join("/")}`}function Ej(e){const a=e.filePath??(e.kind==="element"?kb(e)??"":""),i=_b(a),o=e.metadata?.derivedKind;return{image:i,url:i,filename:a,prompt:e.name,mediaType:e.kind==="video"?"video":"image",createdAt:e.createdAt,requestId:`asset:${e.id}`,kind:typeof o=="string"&&o.startsWith("keyed-")?"edit":"imported"}}const Ey=32,Ry="Image_",P1=/@([\p{L}\p{N}_-]+)/gu,L1=new Set([" "," ",`
|
|
26
26
|
`,"(","["]);function Mb(e,a){const i=new Set(a);let o=Math.max(1,Math.trunc(e)||1);for(;i.has(`${Ry}${o}`);)o+=1;return{tag:`${Ry}${o}`,nextAttachmentOrdinal:o+1}}function O1(e,a){const i=new Set(a),o=e.slice(0,Ey)||"Element";if(!i.has(o))return o;let s=2;for(;;){const c=`_${s}`,m=`${o.slice(0,Ey-c.length)}${c}`;if(!i.has(m))return m;s+=1}}function Ii(e){return e.trayItems.filter(a=>a.kind==="attachment")}function Pb(e){return e.trayItems.filter(a=>a.kind==="element")}function j1(e){return Ii(e).map(a=>a.source.dataUrl)}function G1(e){return Pb(e).map(a=>a.source.elementId)}function D1(e){const a={trayItems:e};return{referenceImages:j1(a),selectedElementIds:G1(a)}}function Em(e,a){return e.length<a}function Bs(e,a,i=Date.now()){const o={...e};for(const s of a)Object.defineProperty(o,s.tag,{value:i,enumerable:!0,configurable:!0,writable:!0});return o}function F1(e,a){return Object.prototype.hasOwnProperty.call(e,a)}function Rm(e,a){if(!F1(e,a))return e;const i={...e};return delete i[a],i}function z1(e){const a=[];for(const i of e.matchAll(P1)){const o=i.index,s=o>0?e[o-1]:void 0;s!==void 0&&!L1.has(s)||a.push({tag:i[1],start:o,end:o+i[0].length})}return a}function q1(e){return e.reduce((a,i)=>a+(i.kind==="attachment"?1:i.source.referenceFilenames.length),0)}function Nm(e,a){let i;return e(o=>{const s=a(o,o.activeReferenceLimit());if(i=s.result,!s.patch)return{};const c=s.patch.trayItems??o.trayItems,m=o.elementCatalog,p=s.patch.elementCatalog??m??null;return{...s.patch,trayItems:c,elementCatalog:p,missingElementIds:jb(c,p),...D1(c)}}),i}function U1(e){const a=new Set;return e.filter(i=>i.kind!=="element"||a.has(i.id)?!1:(a.add(i.id),!0))}function Lb(e,a){const i=e??[],o=i.findIndex(s=>s.id===a.id);return o<0?[...i,a]:i.map((s,c)=>c===o?a:s)}function H1(e,a,i){return i??e.elementCatalog?.find(o=>o.id===a)??e.assets.find(o=>o.id===a&&o.kind==="element")}function Ob(e){const a=e.metadata?.refs;return Array.isArray(a)?a.filter(i=>typeof i=="string"&&i.length>0):[]}function gs(e,a,i,o){return o&&(o.id!==e||o.kind!=="element")?null:Nm(a,(s,c)=>{if(!Em(s.trayItems,c))return{result:null};if(s.trayItems.some(v=>v.kind==="element"&&v.source.elementId===e))return{result:null};const m=s,p=H1(m,e,o),h=p?Qv(p.name):null;if(!p||!h)return{result:null};const g=O1(h,s.trayItems.map(v=>v.tag)),S={kind:"element",tokenId:crypto.randomUUID(),tag:g,insertedAt:Date.now(),source:{elementId:e,nameAtInsertion:p.name,referenceFilenames:Ob(p)}};return{result:S,patch:{trayItems:[...s.trayItems,S],retiredTags:Rm(s.retiredTags,g),elementCatalog:Lb(m.elementCatalog,p)}}})}function jb(e,a){if(a==null)return[];const i=new Set(a.map(s=>s.id)),o=new Set;return e.reduce((s,c)=>{if(c.kind!=="element")return s;const m=c.source.elementId;return!i.has(m)&&!o.has(m)&&s.push(m),o.add(m),s},[])}function Wu(e,a){return e.find(i=>i.kind==="element"&&i.source.elementId===a)}function B1(e,a,i){Nm(a,o=>{const s=Wu(o.trayItems,e);return s?{result:void 0,patch:{trayItems:o.trayItems.filter(c=>c.tokenId!==s.tokenId),retiredTags:Bs(o.retiredTags,[s])}}:{result:void 0}})}function Gb(e,a,i){const o=U1(e);a(s=>({elementCatalog:o,missingElementIds:jb(s.trayItems,o)}))}function Db(e,a,i){const o=new Map(e.map(p=>[p.id,p])),s=new Set,c=new Map,m=[...i];for(;m.length>0;){const p=m.shift();if(!s.has(p)){s.add(p);for(const h of a){if(h.target!==p)continue;const g=o.get(h.source);if(g)if(g.type==="elementReferenceNode"){if(!c.has(g.id)){const S=g.data;c.set(g.id,{nodeId:g.id,elementId:typeof S.elementId=="string"&&S.elementId?S.elementId:null,name:typeof S.elementName=="string"&&S.elementName||typeof S.elementId=="string"&&S.elementId||"element",missing:S.missing===!0})}}else m.push(g.id)}}}return[...c.values()]}const Ja=new Set;async function V1(e,a,i){const o=[],s=[],c=[],m={};for(const p of e){if(p.missing||!p.elementId){if(p.missing)return{ok:!1,name:p.name};continue}let h;try{h=(await QT(p.elementId)).asset}catch{return{ok:!1,name:p.name}}const g=Lb(i().elementCatalog,h),S=h.updatedAt??h.createdAt;c.push(h.id),m[h.id]=S,typeof h.notes=="string"&&h.notes.trim()&&s.push(`${h.name}: ${h.notes.trim()}`),a({elementCatalog:g,graphNodes:i().graphNodes.map(v=>v.id===p.nodeId?{...v,data:{...v.data,resolvedRevision:S,missing:!1}}:v)});for(const v of Ob(h))try{const y=await VR(_b(v));o.includes(y)||o.push(y)}catch{}}return{ok:!0,referenceDataUrls:o,notes:s,elementIds:c,revisions:m}}function K1(e,a,i){const o=[];for(const s of[...e,...a])if(o.includes(s)||o.push(s),o.length>=i)break;return o}async function $1(e,a,i,o,s){if(Ja.has(e))return null;Ja.add(e);const c=o().graphNodes,m=Mn(c,o().graphEdges);m.some((V,ee)=>V.data.parentServerNodeId!==c[ee]?.data.parentServerNodeId)&&i({graphNodes:m});const p=m.find(V=>V.id===e);if(!p)return Ja.delete(e),null;const h=Db(o().graphNodes,o().graphEdges,[e]),g=await V1(h,i,o);if(g.ok===!1)return o().showToast(Z("node.elementMissing",{name:g.name}),!0),Ja.delete(e),null;const{prompt:S,parentServerNodeId:v}=p.data;if(!S.trim())return o().showToast(Z("toast.promptRequired"),!0),Ja.delete(e),null;const y=o(),x=typeof p.data.provider=="string"&&p.data.provider?p.data.provider:y.provider,E=Rb({provider:x,serverLimit:y.referenceLimit,videoModelSelected:!!y.videoModelSelected,mcpProvider:y.mcpProvider??null}),P=K1(p.data.referenceImages??[],g.referenceDataUrls,E),I=typeof p.data.model=="string"&&p.data.model?p.data.model:y.imageModel,k=a.sizeOverride??(typeof p.data.size=="string"&&p.data.size?p.data.size:y.getResolvedSize()),C=a.parentServerNodeIdOverride!==void 0?a.parentServerNodeIdOverride:v;if(o().graphEdges.find(V=>V.target===e)&&!C)return o().showToast(Z("node.parentImageRequired"),!0),Ja.delete(e),null;const N=y.activeSessionId,j=Date.now(),$=Math.random().toString(36).slice(2,6),L=`fn_${e}_${j}_${$}`,J=new AbortController;ur(L,J);const re=[...y.inFlight,{id:L,prompt:S,startedAt:j,kind:"node",sessionId:N,clientNodeId:e}];s(re),i({graphNodes:o().graphNodes.map(V=>V.id===e?{...V,data:{...V.data,status:"pending",pendingRequestId:L,recoveryRequestId:L,pendingPhase:"queued",pendingStartedAt:j,partialImageUrl:null,error:void 0,errorInfo:null,size:k}}:V),activeGenerations:y.activeGenerations+1,inFlight:re}),o().startInFlightPolling();let he=!0;try{const V=await e0({parentNodeId:C,prompt:S,quality:y.quality,size:k,format:y.format,moderation:y.moderation,provider:x,model:I,reasoningEffort:y.reasoningEffort,storyboard:y.storyboardActive||void 0,requestId:L,sessionId:N,clientNodeId:e,contextMode:"parent-plus-refs",searchMode:y.webSearchEnabled?"on":"off",webSearchEnabled:y.webSearchEnabled,...P.length?{references:P.map(Am)}:{},...g.elementIds.length?{elementIds:g.elementIds,elementRevisions:g.revisions,elementNotes:g.notes}:{}},{onPartial:ee=>{o().activeSessionId===N&&i({graphNodes:o().graphNodes.map(oe=>oe.id===e?{...oe,data:{...oe.data,status:"pending",partialImageUrl:ee.image,pendingPhase:"partial"}}:oe)})},onPhase:ee=>{o().activeSessionId===N&&ee.phase&&i({graphNodes:o().graphNodes.map(oe=>oe.id===e?{...oe,data:{...oe.data,pendingPhase:ee.phase??oe.data.pendingPhase}}:oe)})}},{signal:J.signal});return o().activeSessionId===N&&(i({graphNodes:o().graphNodes.map(ee=>{if(ee.id!==e)return ee;const oe={...ee.data};return delete oe.partialImageUrl,{...ee,data:{...oe,serverNodeId:V.nodeId,imageUrl:V.url,status:"ready",pendingRequestId:null,recoveryRequestId:null,pendingPhase:null,pendingStartedAt:null,elapsed:V.elapsed,reasoningEffort:V.reasoningEffort,webSearchCalls:V.webSearchCalls,model:V.model??null,size:V.size??null,errorInfo:null}}})}),he=!0,a.suppressToast||o().showToast(Z("toast.nodeCreated",{id:V.nodeId.slice(0,8),elapsed:V.elapsed}))),V.nodeId}catch(V){if(sr(V))return o().activeSessionId===N&&(i({graphNodes:o().graphNodes.map(oe=>oe.id===e?{...oe,data:{...oe.data,status:oe.data.imageUrl?"ready":"empty",pendingRequestId:null,recoveryRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,error:void 0,errorInfo:null}}:oe)}),he=!0),null;const ee=V instanceof Error?V.message:Z("toast.nodeCreateFailed");return o().activeSessionId===N&&(i({graphNodes:o().graphNodes.map(oe=>oe.id===e?{...oe,data:{...oe.data,status:"error",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,error:ee,errorInfo:w1(V)}}:oe)}),he=!0,dr(V,o())),null}finally{Ja.delete(e);const V=o().inFlight.filter(ee=>ee.id!==L);s(V),mr(L),i({activeGenerations:Math.max(0,o().activeGenerations-1),inFlight:V}),o().activeSessionId===N&&he&&(o().scheduleGraphSave(),o().flushGraphSave("node-complete"))}}async function Y1(e,a,i){if(i().nodeBatchRunning)return;const o=zv(i().graphNodes).filter(I=>i().graphNodes.find(k=>k.id===I)?.type!=="elementReferenceNode");if(o.length===0){i().showToast(Z("nodeBatch.noneSelected"),!0);return}const s=h1(i().graphNodes,i().graphEdges,o);if(s.length>0){i().showToast(Z("nodeBatch.parentRequired",{count:s.length}),!0);return}const c=y1(i().graphNodes,i().graphEdges,o);if(c.length>0){i().showToast(Z("nodeBatch.cycleBlocked",{count:c.length}),!0);return}const m=m1(i().graphNodes,i().graphEdges,o),p=new Set(o),h=m.filter(I=>{if(e==="regenerate-all")return!0;const k=i().graphNodes.find(C=>C.id===I);return k?!u1(k):!1});if(h.length===0){i().showToast(Z("nodeBatch.nothingToRun"));return}const S=Db(i().graphNodes,i().graphEdges,h).find(I=>I.missing);if(S){i().showToast(Z("node.elementMissing",{name:S.name}),!0);return}a({nodeBatchRunning:!0,nodeBatchStopping:!1});const v=new Map;let y=0,x=0,E=0;const P=new Set;try{for(const I of h){if(i().nodeBatchStopping)break;if(P.has(I)){E+=1;continue}const k=i().graphEdges.find(L=>L.target===I),C=k?v.get(k.source)??i().graphNodes.find(L=>L.id===I)?.data.parentServerNodeId??null:null,_=i().videoModelSelected?await i().runVideoGenerate(I).then(()=>i().graphNodes.find(J=>J.id===I)?.data.serverNodeId??null):await i().runGenerateNodeInPlace(I,{parentServerNodeIdOverride:C,suppressToast:!0});if(!_){x+=1;for(const L of f1(i().graphEdges,I))P.add(L);continue}y+=1,v.set(I,_);const N=g1(i().graphEdges,I,p),j=i().graphEdges.filter(L=>L.source===I&&p.has(L.target)).map(L=>L.target),$=new Set(p1(i().graphEdges,p));a({graphNodes:i().graphNodes.map(L=>j.includes(L.id)?{...L,data:{...L.data,parentServerNodeId:_}}:$.has(L.id)?{...L,data:{...L.data,status:"stale",parentServerNodeId:N.includes(L.id)?_:L.data.parentServerNodeId,error:Z("nodeBatch.staleBecauseParentChanged")}}:L)})}x>0?i().showToast(Z("nodeBatch.partialFinished",{done:y,failed:x,skipped:E,total:h.length}),!0):i().showToast(Z("nodeBatch.finished",{done:y,total:h.length})),i().scheduleGraphSave()}finally{a({nodeBatchRunning:!1,nodeBatchStopping:!1})}}function Zu(e){return Array.isArray(e.images)}function X1(e,a){return e.modes.includes("both")||e.modes.includes(a)}function Vs(e){const a=new Map(e.catalog.map(m=>[m.id,m])),i=[],o={},s=[],c=[];for(const m of e.presetIds){const p=a.get(m);if(!p||!X1(p,e.mode)){c.push(m);continue}const h=p.perProvider?.[e.provider];i.push(h?.fragment??p.promptFragment),Object.assign(o,h?.params),s.push(m)}return{promptFragment:i.join(" "),params:o,appliedPresetIds:s,skipped:c}}const Q1=[{id:"dolly-in",name:"Dolly In",category:"camera-motion",promptFragment:"a smooth cinematic dolly-in toward the subject with natural parallax",perProvider:{grok:{fragment:"camera: smooth dolly-in toward the subject, natural parallax"},gemini:{fragment:"The camera slowly dollies forward toward the subject with stable cinematic parallax."}},modes:["video"]},{id:"dolly-out",name:"Dolly Out",category:"camera-motion",promptFragment:"a controlled dolly-out revealing the wider environment around the subject",perProvider:{grok:{fragment:"camera: controlled dolly-out revealing the wider scene"},gemini:{fragment:"The camera smoothly pulls backward to reveal the surrounding environment."}},modes:["video"]},{id:"dolly-zoom",name:"Dolly Zoom",category:"camera-motion",promptFragment:"a dramatic dolly zoom with the subject scale held steady as perspective compresses",perProvider:{grok:{fragment:"camera: dramatic dolly zoom, subject scale locked, perspective warping"},gemini:{fragment:"Use a precise dolly zoom, maintaining subject size while the background perspective shifts dramatically."}},modes:["video"]},{id:"orbit-left",name:"Orbit Left",category:"camera-motion",promptFragment:"a smooth leftward orbit around the subject with strong dimensional parallax",perProvider:{grok:{fragment:"camera: smooth orbit left around subject"},gemini:{fragment:"The camera arcs counterclockwise around the subject in a smooth stabilized orbit."}},modes:["video"]},{id:"orbit-right",name:"Orbit Right",category:"camera-motion",promptFragment:"a smooth rightward orbit around the subject with strong dimensional parallax",perProvider:{grok:{fragment:"camera: smooth orbit right around subject"},gemini:{fragment:"The camera arcs clockwise around the subject in a smooth stabilized orbit."}},modes:["video"]},{id:"crane-up",name:"Crane Up",category:"camera-motion",promptFragment:"a graceful crane-up rising from subject level into a broad establishing view",perProvider:{grok:{fragment:"camera: graceful crane-up into a wide establishing view"},gemini:{fragment:"The camera rises vertically on a crane, transitioning into an elevated establishing view."}},modes:["video"]},{id:"crane-down",name:"Crane Down",category:"camera-motion",promptFragment:"a descending crane shot settling from an overhead view toward the subject",perProvider:{grok:{fragment:"camera: descending crane-down from overhead to subject level"},gemini:{fragment:"The camera descends smoothly from an elevated overview toward the subject."}},modes:["video"]},{id:"pan-left",name:"Pan Left",category:"camera-motion",promptFragment:"a measured pan left on a stable tripod head following the action",perProvider:{grok:{fragment:"camera: stable pan left following action"},gemini:{fragment:"Pan the camera steadily left while maintaining level framing."}},modes:["video"]},{id:"pan-right",name:"Pan Right",category:"camera-motion",promptFragment:"a measured pan right on a stable tripod head following the action",perProvider:{grok:{fragment:"camera: stable pan right following action"},gemini:{fragment:"Pan the camera steadily right while maintaining level framing."}},modes:["video"]},{id:"tilt-up",name:"Tilt Up",category:"camera-motion",promptFragment:"a deliberate tilt upward revealing the subject from base to top",perProvider:{grok:{fragment:"camera: deliberate tilt up, base-to-top reveal"},gemini:{fragment:"Tilt the camera upward in a controlled reveal from the lower frame to the upper subject."}},modes:["video"]},{id:"tilt-down",name:"Tilt Down",category:"camera-motion",promptFragment:"a deliberate tilt downward revealing the scene from top to ground level",perProvider:{grok:{fragment:"camera: deliberate tilt down, top-to-ground reveal"},gemini:{fragment:"Tilt the camera downward in a controlled reveal from above to ground level."}},modes:["video"]},{id:"tracking-left",name:"Tracking Left",category:"camera-motion",promptFragment:"a lateral tracking shot moving left alongside the subject at matched speed",perProvider:{grok:{fragment:"camera: lateral tracking left, speed matched to subject"},gemini:{fragment:"Track laterally left beside the moving subject, matching its speed and distance."}},modes:["video"]},{id:"tracking-right",name:"Tracking Right",category:"camera-motion",promptFragment:"a lateral tracking shot moving right alongside the subject at matched speed",perProvider:{grok:{fragment:"camera: lateral tracking right, speed matched to subject"},gemini:{fragment:"Track laterally right beside the moving subject, matching its speed and distance."}},modes:["video"]},{id:"fpv-drone",name:"FPV Drone",category:"camera-motion",promptFragment:"an agile FPV drone flight weaving close through the environment with dynamic banking",perProvider:{grok:{fragment:"camera: agile FPV drone flight, close fly-through, dynamic banking"},gemini:{fragment:"Use an agile first-person drone camera that banks and threads closely through the environment."}},modes:["video"]},{id:"handheld",name:"Handheld",category:"camera-motion",promptFragment:"natural documentary handheld movement with subtle operator sway and responsive reframing",perProvider:{grok:{fragment:"camera: natural handheld documentary movement, subtle sway"},gemini:{fragment:"Use restrained handheld camera motion with organic operator sway and responsive framing."}},modes:["video"]},{id:"whip-pan",name:"Whip Pan",category:"camera-motion",promptFragment:"a rapid whip pan with directional motion blur landing sharply on the next subject",perProvider:{grok:{fragment:"camera: fast whip pan with motion blur, sharp landing"},gemini:{fragment:"Execute a rapid whip pan with directional blur, resolving cleanly on the destination subject."}},modes:["video"]},{id:"crash-zoom",name:"Crash Zoom",category:"camera-motion",promptFragment:"an abrupt crash zoom into a critical detail with energetic lens compression",perProvider:{grok:{fragment:"camera: abrupt crash zoom into critical detail"},gemini:{fragment:"Snap into a fast crash zoom that emphasizes a critical detail with dramatic compression."}},modes:["video"]},{id:"bullet-time",name:"Bullet Time",category:"camera-motion",promptFragment:"a high-speed orbit around nearly frozen action with suspended particles and extreme temporal detail",perProvider:{grok:{fragment:"camera: bullet-time orbit around near-frozen action, suspended particles"},gemini:{fragment:"Create a bullet-time orbit around nearly frozen action, preserving crisp suspended particles and spatial detail."}},modes:["video"]},{id:"hyperlapse",name:"Hyperlapse",category:"camera-motion",promptFragment:"a stabilized forward-moving hyperlapse with accelerated environmental change and fixed visual anchor",perProvider:{grok:{fragment:"camera: stabilized moving hyperlapse, fixed anchor, accelerated surroundings"},gemini:{fragment:"Use a stabilized traveling hyperlapse with a locked visual anchor and rapidly changing surroundings."}},modes:["video"]},{id:"static",name:"Static",category:"camera-motion",promptFragment:"a locked-off static camera with no movement and a carefully composed stable frame",perProvider:{grok:{fragment:"camera: locked-off static shot, no movement"},gemini:{fragment:"Keep the camera completely locked off with stable composition and no camera movement."}},modes:["video"]}],J1=[{id:"cinematic",name:"Cinematic",category:"style",promptFragment:"cinematic production design, anamorphic composition, restrained film grain, rich tonal separation",modes:["both"]},{id:"anime",name:"Anime",category:"style",promptFragment:"high-detail anime key visual, expressive linework, cel shading, deliberate color scripting",modes:["both"]},{id:"watercolor",name:"Watercolor",category:"style",promptFragment:"transparent watercolor washes on textured cold-press paper, soft pigment blooms and granulation",modes:["both"]},{id:"oil-painting",name:"Oil Painting",category:"style",promptFragment:"traditional oil painting with layered glazes, visible impasto brushwork and deep painterly color",modes:["both"]},{id:"pencil-sketch",name:"Pencil Sketch",category:"style",promptFragment:"graphite pencil drawing with confident contour lines, cross-hatching and subtle paper tooth",modes:["both"]},{id:"pixel-art",name:"Pixel Art",category:"style",promptFragment:"hand-crafted pixel art with a limited palette, crisp clusters and controlled dithering",modes:["both"]},{id:"vaporwave",name:"Vaporwave",category:"style",promptFragment:"vaporwave aesthetic, pastel neon gradients, retro digital artifacts, chrome accents and nostalgic geometry",modes:["both"]},{id:"noir",name:"Noir",category:"style",promptFragment:"classic film noir, high-contrast monochrome photography, oblique shadows and tense urban atmosphere",modes:["both"]},{id:"pop-art",name:"Pop Art",category:"style",promptFragment:"bold pop-art treatment with saturated primaries, halftone dots, graphic outlines and punchy repetition",modes:["both"]},{id:"surreal",name:"Surreal",category:"style",promptFragment:"dreamlike surrealism with impossible spatial relationships, symbolic objects and uncanny photoreal detail",modes:["both"]},{id:"photorealistic",name:"Photorealistic",category:"style",promptFragment:"photorealistic material detail, physically plausible optics, natural texture and true-to-life color response",modes:["both"]},{id:"minimalist",name:"Minimalist",category:"style",promptFragment:"minimalist visual language, essential forms, generous negative space and a disciplined reduced palette",modes:["both"]},{id:"baroque",name:"Baroque",category:"style",promptFragment:"opulent Baroque composition, dramatic diagonals, ornate detail, theatrical movement and rich fabrics",modes:["both"]},{id:"cyberpunk",name:"Cyberpunk",category:"style",promptFragment:"dense cyberpunk worldbuilding, rain-slick surfaces, layered neon signage, advanced machinery and urban decay",modes:["both"]},{id:"ukiyo-e",name:"Ukiyo-e",category:"style",promptFragment:"Japanese ukiyo-e woodblock print, flowing contour lines, flat mineral colors and decorative patterning",modes:["both"]}],W1=[{id:"golden-hour",name:"Golden Hour",category:"lighting",promptFragment:"warm low-angle golden-hour sunlight, long soft-edged shadows and luminous atmospheric haze",modes:["both"]},{id:"blue-hour",name:"Blue Hour",category:"lighting",promptFragment:"cool blue-hour ambient light with balanced practical lights and a deep cobalt sky",modes:["both"]},{id:"studio-softbox",name:"Studio Softbox",category:"lighting",promptFragment:"large studio softbox key light with smooth wrap, controlled fill and clean catchlights",modes:["both"]},{id:"hard-rim",name:"Hard Rim",category:"lighting",promptFragment:"hard back rim light carving a bright edge around the subject against a darker background",modes:["both"]},{id:"volumetric-fog",name:"Volumetric Fog",category:"lighting",promptFragment:"directional volumetric light shafts visible through fine atmospheric fog with layered depth",modes:["both"]},{id:"neon-glow",name:"Neon Glow",category:"lighting",promptFragment:"saturated neon illumination with colored spill, glossy reflections and luminous edge bloom",modes:["both"]},{id:"chiaroscuro",name:"Chiaroscuro",category:"lighting",promptFragment:"dramatic chiaroscuro lighting with a sculpted key, deep controlled shadow and painterly contrast",modes:["both"]},{id:"overcast-diffuse",name:"Overcast Diffuse",category:"lighting",promptFragment:"broad overcast daylight, exceptionally soft diffuse shadows and even natural skin tones",modes:["both"]},{id:"candlelight",name:"Candlelight",category:"lighting",promptFragment:"intimate flickering candlelight with warm falloff, soft amber highlights and deep surrounding shadow",modes:["both"]},{id:"moonlight",name:"Moonlight",category:"lighting",promptFragment:"cool directional moonlight with silver-blue highlights, subdued fill and nocturnal contrast",modes:["both"]}],Fb=[...Q1,...J1,...W1];function zb(e){return Fb.find(a=>a.id===e)}function Ks(){return[...Fb]}function qb(e){const a=e.selectedElementIds;return Array.isArray(a)?a.filter(i=>typeof i=="string"):[]}function Ub(e){return e==="grok"||e==="grok-api"?"grok":e==="gemini-api"?"gemini":"gpt"}async function Z1(e,a,i){const o=i();if(o.uiMode!=="classic")return;const s=xi(o.prompt,o.insertedPrompts);if(!s)return;const c=Vs({catalog:Ks(),presetIds:o.selectedPresetIds,provider:Ub(o.provider),mode:"image"}),m=c.promptFragment?`${c.promptFragment} ${s}`:s,p=o.prompt,h=ym(o.insertedPrompts),g=e??o.getResolvedSize(),S=`mm_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,v=new AbortController;ur(S,v);const y=Date.now(),x=y,E=hi(o.multimodeMaxImages),P=[...o.inFlight,{id:S,prompt:m,startedAt:y,kind:"multimode",composerPrompt:p,composerInsertedPrompts:h}],I={sequenceId:S,requestId:S,requested:E,returned:0,images:[],partials:[],status:"pending"};jt(P),a({activeGenerations:o.activeGenerations+1,inFlight:P,activeFlightIds:new Set([...o.activeFlightIds,S]),multimodeSequences:{...o.multimodeSequences,[S]:I},multimodePreviewFlightId:S}),i().startInFlightPolling();try{const k={prompt:m,quality:o.quality,size:g,format:o.format,moderation:o.moderation,provider:o.provider,maxImages:E,model:o.imageModel,reasoningEffort:o.reasoningEffort,webSearchEnabled:o.webSearchEnabled,requestId:S,mode:o.promptMode,composerPrompt:p,composerInsertedPrompts:h,presetIds:c.appliedPresetIds,elementIds:qb(o),...o.providerUrlReference?{providerUrl:o.providerUrlReference}:o.referenceImages.length?{references:o.referenceImages.map(Am)}:{}},C=await kT(k,{onPartial:j=>{a($=>{const L=$.multimodeSequences[S];return L?{multimodeSequences:{...$.multimodeSequences,[S]:{...L,partials:[...L.partials,{image:j.image,index:j.index??null}].slice(-E)}}}:{}})},onImage:j=>{a($=>{const L=$.multimodeSequences[S];if(!L)return{};const J=Ty(L.images,[j]);return J.length===L.images.length?{}:{multimodeSequences:{...$.multimodeSequences,[S]:{...L,sequenceId:j.sequenceId??L.sequenceId,returned:J.length,images:J,status:"partial"}}}})}},{signal:v.signal}),_=C.images.map(j=>({...j,prompt:m,elapsed:Number.parseFloat(C.elapsed),provider:C.provider,usage:C.usage,requestId:j.requestId??C.requestId??S,composerPrompt:p,composerInsertedPrompts:h,quality:C.quality,size:C.size,model:C.model??null}));for(const j of _)await Ra(j,a,i,{autoSelectStartedAt:x});a(j=>({multimodeSequences:{...j.multimodeSequences,[S]:(()=>{const $=j.multimodeSequences[S],L=Ty($?.images??[],_);return{sequenceId:C.sequenceId,requestId:S,requested:C.requested,returned:L.length,images:L,partials:[],status:C.status,elapsed:C.elapsed}})()}}));const N=C.status==="complete"?"multimode.complete":"multimode.partial";i().showToast(Z(N,{returned:C.returned,requested:C.requested,elapsed:C.elapsed}))}catch(k){k.name==="AbortError"||sr(k)?a(C=>{const _=C.multimodeSequences[S];return _?{multimodeSequences:{...C.multimodeSequences,[S]:{..._,status:"canceled"}}}:{}}):(a(C=>{const _=C.multimodeSequences[S];return _?{multimodeSequences:{...C.multimodeSequences,[S]:{..._,status:"error",error:k.message}}}:{}}),dr(k,i()))}finally{const k=i().inFlight.filter(C=>C.id!==S);jt(k),mr(S),a(C=>{const _=new Set(C.activeFlightIds);_.delete(S);let N=C.multimodePreviewFlightId;const j=C.multimodeSequences[S]?.status,$=j==="complete"||j==="partial";if(N===S&&!$){const J=[..._];N=J.length>0?J[J.length-1]:null}const L={...C.multimodeSequences};return $&&N!==S&&delete L[S],{activeGenerations:Math.max(0,C.activeGenerations-1),inFlight:k,activeFlightIds:_,multimodePreviewFlightId:N,multimodeSequences:L}})}}async function eN(e,a,i){const o=i(),s=xi(o.prompt,o.insertedPrompts);if(!s)return;const c=Vs({catalog:Ks(),presetIds:o.selectedPresetIds,provider:Ub(o.provider),mode:"image"}),m=c.promptFragment?`${c.promptFragment} ${s}`:s,p=o.prompt,h=ym(o.insertedPrompts),g=e??o.getResolvedSize(),S=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,v=new AbortController;ur(S,v);const y=Date.now(),x=y,E=[...o.inFlight,{id:S,prompt:m,startedAt:y,composerPrompt:p,composerInsertedPrompts:h}];jt(E),a({activeGenerations:o.activeGenerations+1,inFlight:E}),i().startInFlightPolling();try{const P={prompt:m,quality:o.quality,size:g,format:o.format,moderation:o.moderation,provider:o.provider,n:o.count,model:o.imageModel,reasoningEffort:o.reasoningEffort,storyboard:o.storyboardActive||void 0,webSearchEnabled:o.webSearchEnabled,requestId:S,mode:o.promptMode,composerPrompt:p,composerInsertedPrompts:h,presetIds:c.appliedPresetIds,elementIds:qb(o),...o.providerUrlReference?{providerUrl:o.providerUrlReference}:o.referenceImages.length?{references:o.referenceImages.map(Am)}:{}},I=await yv(P,{signal:v.signal});if(Zu(I)&&I.images.length>1){for(const k of I.images){const C={image:k.image,filename:k.filename,reasoningEffort:I.reasoningEffort,prompt:m,composerPrompt:p,composerInsertedPrompts:h,elapsed:I.elapsed,provider:I.provider,providerUrl:k.providerUrl??null,usage:I.usage,requestId:I.requestId??S,quality:I.quality,size:I.size,model:I.model??null,createdAt:k.createdAt??Date.now()};await Ra(C,a,i,{autoSelectStartedAt:x})}i().showToast(Z("toast.generatedBatch",{count:I.images.length,elapsed:I.elapsed}))}else{let k;if(Zu(I)){const C=I.images[0];k={image:C.image,filename:C.filename,reasoningEffort:I.reasoningEffort,prompt:m,composerPrompt:p,composerInsertedPrompts:h,elapsed:I.elapsed,provider:I.provider,providerUrl:C.providerUrl??null,usage:I.usage,requestId:I.requestId??S,quality:I.quality,size:I.size,model:I.model??null,createdAt:C.createdAt??Date.now()}}else k={image:I.image,filename:I.filename,reasoningEffort:I.reasoningEffort,prompt:m,composerPrompt:p,composerInsertedPrompts:h,elapsed:I.elapsed,provider:I.provider,providerUrl:I.providerUrl??null,usage:I.usage,requestId:I.requestId??S,quality:I.quality,size:I.size,model:I.model??null,createdAt:I.createdAt??Date.now()};await Ra(k,a,i,{autoSelectStartedAt:x}),i().showToast(Z("toast.generatedSingle",{elapsed:I.elapsed}))}}catch(P){sr(P)||dr(P,i())}finally{const P=i().inFlight.filter(I=>I.id!==S);jt(P),mr(S),a({activeGenerations:Math.max(0,i().activeGenerations-1),inFlight:P})}}function tN(e){const a=e?.status;return e?.code==="VIDEO_FRAME_EXTRACT_ABORTED"?!1:typeof a!="number"?!0:a>=500||a===503||a===504}async function nN(e,a,i={}){const o=`/api/video/frame?file=${encodeURIComponent(e)}&position=${a}`,s=await fetch(o,{signal:i.signal});if(!s.ok)throw Object.assign(new Error(`frame extraction failed (${s.status})`),{status:s.status});const c=await s.blob();return await new Promise((m,p)=>{const h=new FileReader;h.onload=()=>m(String(h.result)),h.onerror=()=>p(h.error??new Error("frame decode failed")),h.readAsDataURL(c)})}function aN(e){return{async extractFrame(a,i,o={}){if(a.kind==="generated"&&i==="last")try{return{dataUrl:await e.fetchGeneratedFrame(a.filename,"last",o),via:"server-ffmpeg"}}catch(c){if(!tN(c))throw c}const s=a.kind==="url"?a.url:`/generated/${encodeURIComponent(a.filename)}`;return{dataUrl:await e.extractFromElement(s,i,o),via:"browser-canvas"}}}}const oN=aN({fetchGeneratedFrame:nN,extractFromElement:(e,a,i)=>a==="last"?cr(e,i):a==="first"?yb(e,i):vb(e,i)}),Ts="Your video prompt should describe: visual flow, motion flow, sound/no-music intent, dialogue/no-dialogue, and the desired ending frame. Pace the scene to fill the selected duration naturally — opening composition, connected action/emotion change, and a stable ending frame.";function rN(e){const a=e.length<=4?e:[e[0],...e.slice(-3)];return a.map((i,o)=>({...i,ordinal:o+1,role:o===0?"start":o===a.length-1?"parent":"ancestor"}))}function Ql(e){return typeof e=="string"&&e.trim()?e.trim():null}function Hb(e){if(e.videoContinuity?.entries?.length)return{...e.videoContinuity,parentFilename:e.filename??e.videoContinuity.parentFilename??null,sourceFrame:"last",entries:rN(e.videoContinuity.entries)};const a=Ql(e.revisedPrompt)??Ql(e.prompt);if(!a)return null;const i=e.filename??null;return{lineageId:`lineage:${i??Date.now()}`,parentFilename:i,sourceFrame:"last",maxEntries:4,retention:"keep-start-plus-latest-3",entries:[{id:`clip:${i??"unknown"}`,ordinal:1,role:"start",filename:i,userPrompt:Ql(e.userPrompt)??Ql(e.prompt),revisedPrompt:a,createdAt:e.createdAt??Date.now()}]}}function yi(e){return{image:e.url||e.image,url:e.url,filename:e.filename,prompt:e.prompt??null,userPrompt:e.userPrompt??null,revisedPrompt:e.revisedPrompt??null,createdAt:e.createdAt,mediaType:e.mediaType,videoContinuity:e.videoContinuity??null}}function iN(e){const a=e.entries[e.entries.length-1];return{id:`video-continuity:${e.lineageId}`,name:"Video Continuity",text:["Video continuity context:","The attached image is the last frame of the previous video.",a?`Continue from previous revisedPrompt #${a.ordinal}: ${a.revisedPrompt}`:null,"The new prompt must define next motion, camera, sound/music/no-music, dialogue/no-dialogue, and ending frame.","Pace the new clip to naturally fill the selected duration with a production-level sequence from the last-frame anchor."].filter(Boolean).join(`
|
|
27
27
|
`)}}function Bb(e){if(!e?.entries?.length)return null;const a=e.entries[e.entries.length-1];return`${e.entries.length}/4 clips · last frame · ${a?.filename??"unsaved source"}`}async function lN(e,a){const i=a();if(!xi(i.prompt,i.insertedPrompts)||km(a))return;if(i.videoModelSelected)return a().runVideoGenerate();const s=i.uiMode==="classic"&&i.multimode,c=Us(i,{kind:s?"multimode":"classic"});if(c){e({customSizeConfirm:c});return}if(s){await a().generateMultimode();return}await a().runGenerate()}function sN(e,a){const i=a().multimodePreviewFlightId;i&&(Nb(i),a().cancelInFlightJob(i),e(o=>{const s=o.multimodeSequences[i];return s?{multimodeSequences:{...o.multimodeSequences,[i]:{...s,status:"canceled"}}}:{}}))}function km(e){return(e().missingElementIds??[]).length>0?(e().showToast(Z("toast.missingElements"),!0),!0):!1}async function cN(e,a){const i=a().customSizeConfirm;if(!i||(i.continuation.kind==="classic"||i.continuation.kind==="multimode")&&km(a))return;const o=LR(i.adjustedW,i.adjustedH);if(e({customW:i.adjustedW,customH:i.adjustedH,customSizeConfirm:null}),i.continuation.kind==="classic"){await a().runGenerate(o);return}if(i.continuation.kind==="multimode"){await a().generateMultimode(o);return}if(i.continuation.kind==="node-in-place"){await a().runGenerateNodeInPlace(i.continuation.clientId,{sizeOverride:o});return}if(i.continuation.kind==="node-variation"){await a().generateNodeVariation(i.continuation.clientId,o);return}await a().runGenerateNode(i.continuation.clientId,o)}async function dN(e,a,i){const o=i().graphNodes.find(m=>m.id===e);if(!o)return;const{prompt:s}=o.data;if(!s.trim()){i().showToast(Z("toast.promptRequired"),!0);return}if(i().videoModelSelected)return i().runVideoGenerate(e);const c=Us(i(),{kind:"node",clientId:e});if(c){a({customSizeConfirm:c});return}await i().runGenerateNode(e)}async function uN(e,a,i){const o=i().graphNodes.find(c=>c.id===e);if(!o)return;if(!o.data.prompt.trim()){i().showToast(Z("toast.promptRequired"),!0);return}if(i().videoModelSelected)return i().runVideoGenerate(e);const s=Us(i(),{kind:"node-in-place",clientId:e});if(s){a({customSizeConfirm:s});return}await i().runGenerateNodeInPlace(e)}async function mN(e,a,i,o){const s=o().graphNodes.find(m=>m.id===e);if(!s)return;if(!s.data.prompt.trim()){o().showToast(Z("toast.promptRequired"),!0);return}if(o().videoModelSelected){const m=o().addSiblingNode(e);return o().runVideoGenerate(m)}if(!a){const m=Us(o(),{kind:"node-variation",clientId:e});if(m){i({customSizeConfirm:m});return}}const c=o().addSiblingNode(e);await o().runGenerateNodeInPlace(c,{sizeOverride:a})}async function pN(e,a,i,o){const c=o().graphNodes.find(m=>m.id===e)?.data.status==="ready"?o().addSiblingNode(e):e;await o().runGenerateNodeInPlace(c,{sizeOverride:a})}function Vb(e){const a=e.selectedElementIds;return Array.isArray(a)?a.filter(i=>typeof i=="string"):[]}function Kb(e){return e==="grok"||e==="grok-api"?"grok":e==="gemini-api"?"gemini":"gpt"}async function fN(e,a,i){const o=e?i().graphNodes.find(N=>N.id===e):null,s=o?o.data.referenceImages??[]:i().referenceImages,c=Rv(s.length),m=o?o.data.prompt.trim():xi(i().prompt,i().insertedPrompts);if(!m.trim()){i().showToast(Ts,!0);return}const p=i(),h=Vs({catalog:Ks(),presetIds:p.selectedPresetIds,provider:Kb(p.provider),mode:"video"}),g=h.promptFragment?`${h.promptFragment} ${m}`:m;let S,v,y=o?o.data.videoContinuity??null:i().videoContinuityLineage,x;if(o&&s.length===0&&o.data.parentServerNodeId){const N=i().graphNodes.find(j=>j.data.serverNodeId===o.data.parentServerNodeId);if(N?.data.imageUrl)if(kn(N.data.imageUrl))try{const j=N.data.imageUrl.replace(/^\/generated\//,"");v=(await oN.extractFrame({kind:"generated",filename:j},"last")).dataUrl,y=N.data.videoContinuity??Hb({filename:j,prompt:N.data.prompt,userPrompt:N.data.prompt,revisedPrompt:N.data.prompt,createdAt:Date.now(),videoContinuity:null}),x=j}catch{i().showToast(Z("video.continuationFallbackT2V"),!0)}else S=N.data.imageUrl.replace(/^\/generated\//,"")}const E=Date.now(),P=E,I=`vid_${E}_${Math.random().toString(36).slice(2,6)}`,k=new AbortController;ur(I,k);const C=i().activeSessionId,_=[...i().inFlight,{id:I,prompt:g,startedAt:E,kind:"video",sessionId:C,clientNodeId:e??null}];jt(_),o&&a({graphNodes:i().graphNodes.map(N=>N.id===e?{...N,data:{...N.data,status:"pending",pendingRequestId:I,pendingPhase:"queued",pendingStartedAt:E,partialImageUrl:null,error:void 0}}:N)}),a({inFlight:_,activeGenerations:_.length,videoProgress:0}),i().startInFlightPolling();try{const N=i().providerUrlReference,j={prompt:g,requestId:I,provider:i().provider==="grok-api"?"grok-api":"grok",model:typeof i().videoModelSelected=="string"&&i().videoModelSelected||void 0,referenceImages:s.length>=2?s:void 0,sourceImage:s.length===1?s[0]:v,sourceFilename:s.length===0&&!v?S:void 0,continueFromVideo:x,continuityLineage:y,duration:m0(i().videoDuration,c),resolution:i().videoResolution,aspectRatio:i().videoAspectRatio,topic:i().videoTopic||void 0,storyboard:i().storyboardActive||void 0,presetIds:h.appliedPresetIds,elementIds:Vb(i()),sessionId:C,clientNodeId:e??null,...N?{providerUrl:N}:{}},$=await rm(j,{onPlanning:()=>a({inFlight:i().inFlight.map(L=>L.id===I?{...L,phase:"planning"}:L)}),onSubmitted:()=>a({inFlight:i().inFlight.map(L=>L.id===I?{...L,phase:"streaming"}:L)}),onProgress:({progress:L})=>a({videoProgress:L??null})},{signal:k.signal});if(o&&$&&i().activeSessionId===C&&(a({graphNodes:i().graphNodes.map(L=>L.id===e?{...L,data:{...L.data,serverNodeId:$.filename.replace(/\.[^.]+$/,""),imageUrl:$.url,status:"ready",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,elapsed:$.elapsed??void 0,model:$.effectiveModel??$.requestedModel??o.data.model??null,videoContinuity:$.videoContinuity??y,video:{...$.video??{},...$.videoSeries?.topic?{topic:$.videoSeries.topic}:{}}}}:L)}),i().scheduleGraphSave(),i().flushGraphSave("video-node-complete")),$){const L={image:$.url,filename:$.filename,url:$.url,mediaType:"video",prompt:g,elapsed:$.elapsed,video:$.video??{},videoSeries:$.videoSeries??null,videoContinuity:$.videoContinuity??null,revisedPrompt:$.revisedPrompt??null,requestId:$.requestId??I,createdAt:Date.now(),sessionId:C};await Ra(L,a,i,{autoSelectStartedAt:P})}}catch(N){if(sr(N))o&&i().activeSessionId===C&&a({graphNodes:i().graphNodes.map(j=>j.id===e?{...j,data:{...j.data,status:j.data.imageUrl?"ready":"empty",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,error:void 0}}:j)});else{const j=N instanceof Error?N.message:"Video generation failed";o&&i().activeSessionId===C&&a({graphNodes:i().graphNodes.map($=>$.id===e?{...$,data:{...$.data,status:"error",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,error:j}}:$)}),i().showToast(j,!0)}}finally{const N=i().inFlight.filter(j=>j.id!==I);jt(N),mr(I),a({inFlight:N,activeGenerations:N.length,videoProgress:null}),i().startInFlightPolling()}}async function gN(e,a,i,o){const s=a?.trim();if(!s)throw o().showToast(Ts,!0),new Error(Ts);if(km(o))return!1;const c=o(),m=Vs({catalog:Ks(),presetIds:c.selectedPresetIds,provider:Kb(c.provider),mode:"video"}),p=m.promptFragment?`${m.promptFragment} ${s}`:s,h=Date.now(),g=h,S=`vid_${h}_${Math.random().toString(36).slice(2,6)}`,v=new AbortController;ur(S,v);const y=[...o().inFlight,{id:S,prompt:p,startedAt:h,kind:"video",sessionId:o().activeSessionId,clientNodeId:null}];jt(y),i({inFlight:y,activeGenerations:y.length,videoProgress:0}),o().startInFlightPolling();try{const x={prompt:p,presetIds:m.appliedPresetIds,elementIds:Vb(o()),requestId:S,provider:o().provider==="grok-api"?"grok-api":"grok",mode:"image-to-video",sourceFilename:e,duration:5,resolution:"480p",aspectRatio:"auto"},E=await rm(x,{onPlanning:()=>i({inFlight:o().inFlight.map(I=>I.id===S?{...I,phase:"planning"}:I)}),onSubmitted:()=>i({inFlight:o().inFlight.map(I=>I.id===S?{...I,phase:"streaming"}:I)}),onProgress:({progress:I})=>i({videoProgress:I??null})},{signal:v.signal}),P={image:E.url,filename:E.filename,url:E.url,mediaType:"video",prompt:p,elapsed:E.elapsed,video:E.video??{},videoSeries:E.videoSeries??null,videoContinuity:E.videoContinuity??null,revisedPrompt:E.revisedPrompt??null,requestId:E.requestId??S,createdAt:Date.now(),sessionId:o().activeSessionId};await Ra(P,i,o,{autoSelectStartedAt:g})}catch(x){if(!sr(x)){const E=x instanceof Error?x.message:"Video generation failed";o().showToast(E,!0)}}finally{const x=o().inFlight.filter(E=>E.id!==S);jt(x),mr(S),i({inFlight:x,activeGenerations:x.length,videoProgress:null}),o().startInFlightPolling()}return!0}function hN(e,a){if(typeof window>"u")return;const i=window;if(i.__ima2InflightTimer)return;const o=async()=>{const c=a().inFlight.length===0&&a().activeGenerations===0;c?(i.__ima2StopTicks=(i.__ima2StopTicks??0)+1,i.__ima2StopTicks>=2&&i.__ima2InflightTimer&&(clearInterval(i.__ima2InflightTimer),i.__ima2InflightTimer=void 0,i.__ima2StopTicks=0)):i.__ima2StopTicks=0;let m=new Set;if(!c)try{const p=ib(a()),{jobs:h,terminalJobs:g=[]}=await sb(p);m=new Set(h.map(C=>C.requestId));const S=new Map(h.map(C=>[C.requestId,C])),v=new Map(g.map(C=>[C.requestId,C])),y=[];let x=!1;const E=Date.now(),P=5e3,I=[];for(const C of a().inFlight){if(!lb(C,p)){I.push(C);continue}const _=v.get(C.id);if(_){x=!0,_.status==="error"&&y.push(cb(_));continue}if(!S.has(C.id)&&E-C.startedAt>P){x=!0;continue}const N=S.get(C.id);if(N){const j=xs(N),$={...C,phase:j.phase,sessionId:j.sessionId,parentNodeId:j.parentNodeId,clientNodeId:j.clientNodeId,kind:j.kind};($.phase!==C.phase||$.sessionId!==C.sessionId||$.parentNodeId!==C.parentNodeId||$.clientNodeId!==C.clientNodeId||$.kind!==C.kind)&&(x=!0),I.push($)}else I.push(C)}const k=new Set(I.map(C=>C.id));for(const C of h)k.has(C.requestId)||(I.push(xs(C)),x=!0);x&&(jt(I),e({inFlight:I,activeGenerations:I.length}));for(const C of y)dr(C,a())}catch{}try{const p=a().history.reduce((y,x)=>x.createdAt&&x.createdAt>y?x.createdAt:y,0),{items:h}=await rr({limit:An,since:p}),g=h.map(Ci);g.length>0&&e(y=>{const x=new Set(y.history.map(Sn)),E=g.filter(I=>{const k=Sn(I);return x.has(k)?!1:(x.add(k),!0)});if(E.length===0)return{};const P=y.currentImage??E[0];return!y.currentImage&&E[0]?.filename&&Ln(E[0].filename),{history:qs([...E,...y.history],Math.max(An,y.history.length+E.length)),currentImage:P,loadedHistoryRetainLimit:Math.max(y.loadedHistoryRetainLimit,y.history.length+E.length)}});const S=Date.now(),v=a().inFlight.filter(y=>m.has(y.id)||S-y.startedAt<rb);v.length!==a().inFlight.length&&(jt(v),e({inFlight:v,activeGenerations:v.length}))}catch{}};i.__ima2InflightTimer=window.setInterval(o,1500)}async function yN(e,a){try{const i=ib(a()),{jobs:o,terminalJobs:s=[]}=await sb(i),c=new Map(o.map(x=>[x.requestId,x])),m=new Map(s.map(x=>[x.requestId,x])),p=[],h=Date.now(),g=a().inFlight,v=(g.length>0?g:db()).flatMap(x=>{const E=c.get(x.id);if(E){const I=xs(E);return[{...x,...I,prompt:x.prompt||I.prompt,phase:x.phase||I.phase}]}if(!lb(x,i))return[x];const P=m.get(x.id);return P?(P.status==="error"&&p.push(cb(P)),[]):h-x.startedAt<1e4?[x]:[]}),y=new Set(v.map(x=>x.id));for(const x of o)y.has(x.requestId)||v.push(xs(x));jt(v),e({inFlight:v,activeGenerations:v.length});for(const x of p)dr(x,a());v.length>0&&a().startInFlightPolling()}catch{}}const ro=()=>"nc_"+Math.random().toString(36).slice(2,10);function Ny(e,a){return{x:e*360,y:a*320}}const vN=360,$b=320;function bN(e,a,i){const o=new Set(i.filter(s=>s.source===e).map(s=>s.target));return a.filter(s=>o.has(s.id))}function _m(e){const a=e.filter(o=>!o.data.parentServerNodeId);if(a.length===0)return Ny(0,0);const i=Math.max(...a.map(o=>o.position.y));return{x:Ny(0,0).x,y:i+$b}}function Yb(e,a,i){const o=bN(e.id,a,i),s=e.position.x+vN;if(o.length===0)return{x:s,y:e.position.y};const c=Math.max(...o.map(m=>m.position.y));return{x:s,y:c+$b}}const vi="source-right",bi="target-left";function $s(e,a,i,o){return`${e}:${i??"auto"}->${a}:${o??"auto"}`}function SN(e,a){return e&&e.startsWith(`${a}-`)?e:null}function xN(e){switch(e){case"source-top":return"target-bottom";case"source-right":return"target-left";case"source-bottom":return"target-top";case"source-left":return"target-right";default:return null}}function AN(e,a){const i=ro();a().recordGraphHistory("add-root");const o={id:i,type:"imageNode",position:_m(a().graphNodes),data:{clientId:i,serverNodeId:null,parentServerNodeId:null,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return e({graphNodes:[...a().graphNodes,o]}),a().scheduleGraphSave(),i}function TN(e,a,i){const o=ro();i().recordGraphHistory("add-root-from-history");const s={id:o,type:"imageNode",position:_m(i().graphNodes),data:{clientId:o,serverNodeId:e.nodeId??null,parentServerNodeId:null,prompt:e.prompt??"",imageUrl:e.image,status:"ready",pendingRequestId:null,pendingPhase:null,model:e.model??null,size:e.size??null,elapsed:e.elapsed??void 0,video:e.video??null}};return a({uiMode:"node",graphNodes:[...i().graphNodes,s]}),i().scheduleGraphSave(),o}function CN(e,a,i){const o=i().graphNodes.find(p=>p.id===e);if(!o)return e;i().recordGraphHistory("add-child");const s=ro(),c={id:s,type:"imageNode",position:Yb(o,i().graphNodes,i().graphEdges),data:{clientId:s,serverNodeId:null,parentServerNodeId:o.data.serverNodeId,prompt:kn(o.data.imageUrl)&&o.data.prompt||"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},m={id:$s(e,s,vi,bi),source:e,target:s,sourceHandle:vi,targetHandle:bi};if(a({graphNodes:[...i().graphNodes,c],graphEdges:[...i().graphEdges,m]}),i().scheduleGraphSave(),o.data.imageUrl&&kn(o.data.imageUrl)){const p=o.data.imageUrl;o.data.video&&o.data.video.topic&&i().setVideoTopic(o.data.video.topic),(async()=>{try{const h=await cr(p);a({graphNodes:i().graphNodes.map(g=>g.id===s?{...g,data:{...g.data,referenceImages:[h]}}:g)}),i().scheduleGraphSave()}catch{}})()}return s}function wN(e,a,i){const o=i().graphNodes.find(S=>S.id===e);if(!o)return e;i().recordGraphHistory("add-sibling");const s=i().graphEdges.find(S=>S.target===e);if(!s){const S=ro(),v={id:S,type:"imageNode",position:_m(i().graphNodes),data:{clientId:S,serverNodeId:null,parentServerNodeId:null,prompt:o.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return a({graphNodes:[...i().graphNodes,v]}),i().scheduleGraphSave(),S}const c=s.source,m=i().graphNodes.find(S=>S.id===c);if(!m)return e;const p=ro(),h={id:p,type:"imageNode",position:Yb(m,i().graphNodes,i().graphEdges),data:{clientId:p,serverNodeId:null,parentServerNodeId:o.data.parentServerNodeId,prompt:o.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:$s(c,p,vi,bi),source:c,target:p,sourceHandle:vi,targetHandle:bi};return a({graphNodes:[...i().graphNodes,h],graphEdges:[...i().graphEdges,g]}),i().scheduleGraphSave(),p}function IN(e,a,i,o,s){const c=s().graphNodes.find(v=>v.id===e);if(!c)return e;s().recordGraphHistory("add-child-at");const m=ro(),p=SN(i,"source")??vi,h=xN(p)??bi,g={id:m,type:"imageNode",position:a,data:{clientId:m,serverNodeId:null,parentServerNodeId:c.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},S={id:$s(e,m,p,h),source:e,target:m,sourceHandle:p,targetHandle:h};return o({graphNodes:[...s().graphNodes,g],graphEdges:[...s().graphEdges,S]}),s().scheduleGraphSave(),m}function EN(e,a,i){const o=i().graphNodes.find(m=>m.id===e);if(!o)return e;i().recordGraphHistory("duplicate-branch");const s=ro(),c={id:s,type:"imageNode",position:{x:o.position.x+420,y:o.position.y+40},data:{clientId:s,serverNodeId:null,parentServerNodeId:null,prompt:o.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};if(a({graphNodes:[...i().graphNodes,c]}),i().scheduleGraphSave(),o.data.imageUrl){const m=o.data.imageUrl;(async()=>{try{const p=await wi(m,"node-reference.png");a({graphNodes:i().graphNodes.map(h=>h.id===s?{...h,data:{...h.data,referenceImages:[p]}}:h)})}catch{}})()}return s}function RN(e,a,i,o){i({graphNodes:o().graphNodes.map(s=>s.id===e?{...s,data:{...s.data,prompt:a}}:s)}),o().scheduleGraphSave()}function NN(e,a,i){const o=i().graphNodes.find(p=>p.id===e);if(!o)return;i().recordGraphHistory("delete-node");const s=o?.data?.pendingRequestId;s&&Mt(s),wm(i().activeSessionId,e);const c=i().graphNodes.filter(p=>p.id!==e),m=i().graphEdges.filter(p=>p.source!==e&&p.target!==e);a({graphNodes:Mn(c,m),graphEdges:m}),i().scheduleGraphSave()}function kN(e,a,i){const o=new Set(e);if(o.size===0)return;i().recordGraphHistory("delete-nodes");for(const m of o)wm(i().activeSessionId,m);for(const m of i().graphNodes)o.has(m.id)&&m.data?.pendingRequestId&&Mt(m.data.pendingRequestId);const s=i().graphNodes.filter(m=>!o.has(m.id)),c=i().graphEdges.filter(m=>!o.has(m.source)&&!o.has(m.target));a({graphNodes:Mn(s,c),graphEdges:c}),i().scheduleGraphSave()}function _N(e,a,i){const o=new Set(e);if(o.size===0)return;const s=i().graphEdges.filter(h=>o.has(h.id));if(s.length===0)return;i().recordGraphHistory("disconnect-edges");const c=i().graphEdges.filter(h=>!o.has(h.id)),m=new Set(s.map(h=>h.target)),p=i().graphNodes.map(h=>{if(!m.has(h.id))return h;const g=c.find(v=>v.target===h.id),S=g?i().graphNodes.find(v=>v.id===g.source):null;return{...h,data:{...h.data,parentServerNodeId:S?.data.serverNodeId??null}}});a({graphNodes:Mn(p,c),graphEdges:c}),i().scheduleGraphSave(),i().flushGraphSave("edge-disconnect"),i().showToast(Z("edge.disconnected"))}function MN(e,a,i,o,s,c){if(e===a||c().graphEdges.find(g=>g.source===e&&g.target===a))return;if(YR(c().graphEdges,e,a)){c().showToast(Z("edge.parentConflict"),!0);return}if(XR(c().graphEdges,e,a)){c().showToast(Z("edge.cycleBlocked"),!0);return}if(!c().graphNodes.find(g=>g.id===e))return;c().recordGraphHistory("connect-nodes");const h=[...c().graphEdges,{id:$s(e,a,i,o),source:e,target:a,sourceHandle:i,targetHandle:o}];s({graphNodes:Mn(c().graphNodes,h),graphEdges:h}),c().scheduleGraphSave()}async function PN(e,a,i,o){const s=o().graphNodes.find(x=>x.id===e);if(!s)return;const c=s.data.referenceImages??[],p=o().referenceLimit-c.length;if(p<=0){o().showToast(Z("toast.refLimitExceeded"),!0);return}const h=a.slice(0,Math.max(0,p)),g=h.filter(Ss),S=h.filter(x=>!Ss(x)),y=(await Promise.all(S.map(async x=>{try{return await Sm(x,{preserveTransparency:ob(x)})}catch(E){return console.warn("[addNodeReferences] compress failed",E),null}}))).filter(x=>!!x);if(y.length>0){const x=o().activeSessionId;i({graphNodes:o().graphNodes.map(E=>{if(E.id!==e)return E;const P=[...E.data.referenceImages??[],...y].slice(0,o().referenceLimit);return Hs(x,e,P),{...E,data:{...E.data,referenceImages:P}}})}),o().scheduleGraphSave()}g.length>0&&o().showToast(Z("toast.refHeicUnsupported"),!0),S.length-y.length>0&&o().showToast(Z("toast.refTooLarge"),!0),a.length>p&&o().showToast(Z("toast.refLimitExceeded"),!0)}function Xb(e,a,i,o){o().graphNodes.find(c=>c.id===e)&&(i({graphNodes:o().graphNodes.map(c=>{if(c.id!==e)return c;const m=c.data.referenceImages??[];if(m.length>=o().referenceLimit)return c;const p=[...m,a];return Hs(o().activeSessionId,e,p),{...c,data:{...c.data,referenceImages:p}}})}),o().scheduleGraphSave())}async function LN(e,a,i,o,s){const c=s().graphNodes.find(p=>p.id===e);if(!c)return;if((c.data.referenceImages??[]).length>=s().referenceLimit){s().showToast(Z("toast.refLimitExceeded"),!0);return}let m;try{m=kn(a)||kn(i)?await cr(a):await wi(a,i||"node-reference.png")}catch{s().showToast(Z("toast.currentImageLoadFailed"),!0);return}Xb(e,m,o,s)}function ON(e,a,i,o){i({graphNodes:o().graphNodes.map(s=>{if(s.id!==e)return s;const c=(s.data.referenceImages??[]).filter((m,p)=>p!==a);return Hs(o().activeSessionId,e,c),{...s,data:{...s.data,referenceImages:c}}})}),o().scheduleGraphSave()}function jN(e,a,i){wm(i().activeSessionId,e),a({graphNodes:i().graphNodes.map(o=>o.id===e?{...o,data:{...o.data,referenceImages:void 0}}:o)}),i().scheduleGraphSave()}const ky=10;function Qb(e,a){return a?a.filename&&e.filename===a.filename?!0:e.image===a.image:!1}function GN(e){return[e.canvasSourceFilename,e.canvasEditableFilename].filter(a=>!!a)}function so(e){return e.filter(a=>!a.canvasVersion)}function Pn(e,a){if(!a)return null;const i=so(e);if(!a.canvasVersion)return i.find(c=>Qb(c,a))??null;const o=GN(a);return i.find(c=>c.filename?o.includes(c.filename):!1)??null}function DN(e,a){const i=so(e),o=Pn(e,a);return i.findIndex(s=>Qb(s,o))}function FN(e,a,i){const o=so(e);if(o.length===0)return null;if(i==="first")return o[0]??null;if(i==="last")return o[o.length-1]??null;const s=DN(e,a);if(s<0)return null;if(i==="pagePrevious"||i==="pageNext"){const m=i==="pagePrevious"?-ky:ky,p=Math.max(0,Math.min(o.length-1,s+m));return o[p]??null}const c=i==="previous"?s-1:s+1;return o[c]??null}function Jb(e,a){const i=so(e),o=i.findIndex(s=>s.filename===a);return o<0?null:i[o+1]??i[o-1]??null}function Ot(e){return e.filename||e.image}function mi(e){return!e.canvasVersion}function hs(e){const a=new Set;return e.filter(i=>{const o=Ot(i);return a.has(o)?!1:(a.add(o),!0)})}const Wb=72,_y=10;function Zb(e,a){const i=e.sequenceIndex??Number.MAX_SAFE_INTEGER,o=a.sequenceIndex??Number.MAX_SAFE_INTEGER;return i!==o?i-o:(e.createdAt??0)-(a.createdAt??0)}function zN(e){return e<=1?1:e===2?2:4}function eS(e){const a=new Set,i=new Map,o=[];for(const s of e){if(!mi(s))continue;if(s.sequenceId){const m=`sequence:${s.sequenceId}`;let p=i.get(s.sequenceId);p||(p={type:"sequence",key:m,sequenceId:s.sequenceId,items:[]},i.set(s.sequenceId,p),o.push(p)),p.items.push(s);continue}const c=Ot(s);a.has(c)||(a.add(c),o.push({type:"image",key:c,item:s}))}for(const s of i.values())s.items.sort(Zb);return o}function tS(e,a){return a?`sequence:${a}`:e?.sequenceId?`sequence:${e.sequenceId}`:e?Ot(e):null}function Au(e){return e.type==="sequence"?{type:"sequence",sequenceId:e.sequenceId}:{type:"image",item:e.item}}function qN(e,a,i,o,s=Wb){const c=eS(e).slice(0,s);if(c.length===0)return null;const m=c[0],p=c[c.length-1];if(!m||!p)return null;if(i==="first")return Au(m);if(i==="last")return Au(p);const h=tS(a,o),g=h?c.findIndex(x=>x.key===h):-1;if(g<0)return null;const S=i==="pagePrevious"?-_y:i==="pageNext"?_y:i==="previous"?-1:1,v=Math.max(0,Math.min(c.length-1,g+S));if(v===g)return null;const y=c[v];return y?Au(y):null}const nS={promptBuilderSurface:"right-panel",composerPlacement:"sidebar",multimodeHistoryGrouping:"individual",restoreComposerFromHistory:!0,viewerTools:"basic"},UN={promptBuilderSurface:"right-panel",composerPlacement:"bottom",multimodeHistoryGrouping:"sequence",restoreComposerFromHistory:!1,viewerTools:"zoom-pan"},HN={default:nS,"prompt-studio":UN};function Ei(e,a){return HN[e]??nS}function BN(e,a){return Ei(e).promptBuilderSurface!=="off"}const VN="history:";function aS(e,a,i){if(!a||i||!a.startsWith(VN)||!(a in e))return e;const o={...e};return delete o[a],o}function KN(e){const a=e.multimodePreviewFlightId;return a?a.startsWith("history:")?a.slice(8):e.multimodeSequences[a]?.sequenceId??null:null}async function $N(e,a){const i=a().historyNextCursor;if(!(!i||a().historyLoadingOlder)){e({historyLoadingOlder:!0});try{const o=await rr({limit:An,cursor:i}),s=o.items.map(Ci);e(c=>{const m=new Set(c.history.map(h=>h.filename??h.image)),p=s.filter(h=>{const g=h.filename??h.image;return m.has(g)?!1:(m.add(g),!0)});return{history:[...c.history,...p],historyNextCursor:o.nextCursor,historyLoadingOlder:!1,loadedHistoryRetainLimit:Math.max(c.loadedHistoryRetainLimit,c.history.length+p.length)}})}catch{e({historyLoadingOlder:!1}),a().showToast(Z("gallery.loadOlderFailed"),!0)}}}async function YN(e,a){try{const i=await rr({limit:An,favoritesOnly:!0}),o=i.items.map(Ci);e(s=>{const c=fb(s.history,o);return{history:c,favoriteHistoryNextCursor:i.nextCursor,loadedHistoryRetainLimit:Math.max(s.loadedHistoryRetainLimit,c.length),galleryFavorites:new Set([...Array.from(s.galleryFavorites),...o.filter(m=>m.filename).map(m=>m.filename)])}})}catch{a().showToast(Z("gallery.loadOlderFailed"),!0)}}async function XN(e,a){const i=a().favoriteHistoryNextCursor;if(!(!i||a().favoriteHistoryLoadingOlder)){e({favoriteHistoryLoadingOlder:!0});try{const o=await rr({limit:An,cursor:i,favoritesOnly:!0}),s=o.items.map(Ci);e(c=>{const m=fb(c.history,s);return{history:m,favoriteHistoryNextCursor:o.nextCursor,favoriteHistoryLoadingOlder:!1,loadedHistoryRetainLimit:Math.max(c.loadedHistoryRetainLimit,m.length),galleryFavorites:new Set([...Array.from(c.galleryFavorites),...s.filter(p=>p.filename).map(p=>p.filename)])}})}catch{e({favoriteHistoryLoadingOlder:!1}),a().showToast(Z("gallery.loadOlderFailed"),!0)}}}function QN(e,a,i){const o=Date.now(),s=i().history,c=e.canvasVersion?Pn(s,e)??so(s)[0]??null:Pn(s,e)??e;Ln(c?.filename??null);const m=Ei(i().workspaceProfile).restoreComposerFromHistory,p=i().prompt,h=i().insertedPrompts,g=p.trim()!==""||h.length>0,S=m&&c&&!g?wR(c):{},v=i().multimodePreviewFlightId,y=v?i().multimodeSequences[v]:null,x=y&&c&&y.images.some(E=>E.filename===c.filename);a(E=>({currentImage:c,lastHistorySelectedAt:o,unseenGeneratedCount:0,multimodePreviewFlightId:x?v:null,multimodeSequences:aS(E.multimodeSequences,v,!!x),...S}))}function JN(e,a,i){const o=Date.now(),s=i().history.filter(g=>g.sequenceId===e&&!g.canvasVersion).sort(Zb);if(s.length===0)return;const c=`history:${e}`,m=Math.max(s.length,...s.map(g=>g.sequenceTotalRequested??0)),p=s.length,h=s[0]?.sequenceStatus==="empty"?"empty":p>=m?"complete":"partial";Ln(null),a(g=>({currentImage:null,lastHistorySelectedAt:o,unseenGeneratedCount:0,canvasOpen:!1,multimodePreviewFlightId:c,multimodeSequences:{...aS(g.multimodeSequences,g.multimodePreviewFlightId,!1),[c]:{sequenceId:e,requestId:c,requested:m,returned:p,images:s,partials:[],status:h}}}))}function WN(e,a,i){const o=i(),s=Ei(o.workspaceProfile);if(o.uiMode==="classic"&&s.multimodeHistoryGrouping==="sequence"){const m=qN(o.history,o.currentImage,e,KN(o));if(!m)return;if(m.type==="sequence"){i().showHistorySequence(m.sequenceId);return}i().selectHistory(m.item);return}const c=FN(o.history,o.currentImage,e);c&&i().selectHistory(c)}async function ZN(e,a,i){const o=e.canvasVersion?Pn(i().history,e):e;if(!o||o.canvasVersion||!o.filename){i().showToast(Z("gallery.deleteFailed"),!0);return}const s=o.filename,c=i().currentImage,p=(c?Pn(i().history,c)??c:null)?.filename===s,h=p?Jb(i().history,s):c;try{await vv(s),a(g=>{const S=UR(g.multimodeSequences,s),v=g.multimodePreviewFlightId&&!S[g.multimodePreviewFlightId]?null:g.multimodePreviewFlightId;return{history:g.history.filter(y=>y.filename!==s),currentImage:h,multimodePreviewFlightId:v,multimodeSequences:S,trashPending:null}}),p&&Ln(h?.filename??null),i().showToast(Z("gallery.movedToSystemTrash",{filename:s}))}catch(g){console.error("[history] trash failed",g),i().showToast(Z("gallery.deleteFailed"),!0)}}async function ek(e,a,i){const o=i().history.filter(g=>g.sequenceId===e&&!g.canvasVersion&&!!g.filename);if(o.length===0){i().showToast(Z("gallery.deleteFailed"),!0);return}if(!window.confirm(Z("history.deleteSequenceConfirm",{count:o.length})))return;const c=new Set(o.map(g=>g.filename).filter(g=>!!g)),m=i().currentImage,p=!!(m?.filename&&c.has(m.filename)),h=i().multimodePreviewFlightId===`history:${e}`||i().multimodePreviewFlightId===e;try{for(const g of c)await vv(g);a(g=>{const S={...g.multimodeSequences};return delete S[`history:${e}`],delete S[e],{history:g.history.filter(v=>!v.filename||!c.has(v.filename)),currentImage:p?null:g.currentImage,multimodePreviewFlightId:h?null:g.multimodePreviewFlightId,multimodeSequences:S,trashPending:null}}),p&&Ln(null),i().showToast(Z("history.sequenceDeleted",{count:c.size}))}catch(g){console.error("[history] sequence trash failed",g),i().showToast(Z("gallery.deleteFailed"),!0)}}async function tk(e,a){const i=a().trashPending;if(i)try{await GT(i.filename,i.trashId),a().addHistoryItem(i.item),e({trashPending:null})}catch(o){console.error("[history] restore failed",o),a().showToast(Z("gallery.restoreFailed"),!0)}}async function nk(e,a,i){const o=e.canvasVersion?Pn(i().history,e):e;if(!o||o.canvasVersion||!o.filename){i().showToast(Z("gallery.deleteFailed"),!0);return}const s=o.filename;if(!window.confirm(Z("result.permanentDeleteConfirm",{filename:s})))return;const m=i().currentImage,h=(m?Pn(i().history,m)??m:null)?.filename===s,g=h?Jb(i().history,s):m;try{await jT(s),a(S=>({history:S.history.filter(v=>v.filename!==s),currentImage:g,trashPending:S.trashPending?.filename===s?null:S.trashPending})),h&&Ln(g?.filename??null),i().showToast(Z("gallery.permanentDeleted",{filename:s}))}catch(S){console.error("[history] permanent delete failed",S),i().showToast(Z("gallery.deleteFailed"),!0)}}function ak(e,a,i){const o=i(),s=o.history.filter(m=>m.filename!==e),c=o.currentImage&&o.currentImage.filename===e?null:o.currentImage;a({history:s,currentImage:c}),c===null&&Ln(null)}function ok(e,a,i){const o=i(),s={...e,createdAt:e.createdAt||Date.now()},c=mb(o.history,s),m=pb(s,c),p=ub(o.history,m);a({history:qs([m,...p],o.loadedHistoryRetainLimit+1),loadedHistoryRetainLimit:Math.max(o.loadedHistoryRetainLimit,Math.min(o.history.length+1,o.loadedHistoryRetainLimit+1))})}async function rk(e,a,i){if(!e.type||!/^image\/(png|jpeg|webp)$/.test(e.type))return i().showToast(Z("toast.localImportInvalid"),!0),null;try{const o=await _T(e);return i().addHistoryItem(o),a({currentImage:o,unseenGeneratedCount:0}),o.filename&&Ln(o.filename),i().showToast(Z("toast.localImportSuccess")),o}catch{return i().showToast(Z("toast.localImportFailed"),!0),null}}function ik(e,a){(async()=>{try{const i=await rr({limit:An}),o=i.items.map(Ci);if(e({historyNextCursor:i.nextCursor,loadedHistoryRetainLimit:An}),o.length>0){const s=Zv(),c=s?o.find(h=>h.filename===s):null,m=so(o),p=(c?Pn(o,c):null)??m[0]??null;e({history:o,currentImage:p,historyNextCursor:i.nextCursor,loadedHistoryRetainLimit:Math.max(An,o.length)}),p?.filename!==s&&Ln(p?.filename??null)}}catch(i){console.warn("[history] load failed:",i)}})()}async function oS(e,a){try{const{sessions:i}=await FT();if(e({sessions:i}),!a().activeSessionId){const s=PR(),c=s?i.some(m=>m.id===s):!1;s&&c?await a().switchSession(s):await a().createAndSwitchSession(Z("session.firstGraph"))}}catch(i){console.warn("[sessions] load failed:",i),a().showToast(Z("modal.sessionInitialLoadFailed"),!0),window.confirm(Z("modal.sessionInitialLoadRetry"))&&await oS(e,a)}}async function lk(e,a,i){if(e!==i().activeSessionId){try{await i().flushGraphSave("switch-session")}catch(o){console.warn("[sessions] switch blocked by save failure:",o),a({sessionLoading:!1}),i().showToast(Z("modal.sessionSwitchSaveFailed"),!0);return}a({sessionLoading:!0});try{const{session:o}=await bv(e),{graphNodes:s,graphEdges:c,graphVersion:m}=bb(o);a({activeSessionId:e,activeSessionGraphVersion:m,graphNodes:s,graphEdges:c,graphHistoryPast:[],graphHistoryFuture:[],sessionLoading:!1}),bm(e),await i().reconcileGraphPending().catch(()=>{})}catch(o){console.warn("[sessions] switch failed:",o),a({sessionLoading:!1}),i().showToast(Z("toast.sessionLoadFailed"),!0)}}}async function sk(e,a){const i=a().activeSessionId;if(!i)return;if(a().graphNodes.filter(s=>s.data?.pendingRequestId&&(s.data.status==="pending"||s.data.status==="reconciling")).length>0){let s=[];try{s=(await gv({kind:"node",sessionId:i})).jobs}catch{s=[]}const c=new Map(s.map(g=>[g.requestId,g.phase])),m=Date.now(),p=1e4,h=a().graphNodes.map(g=>{const S=g.data?.pendingRequestId;if(!S||g.data.status!=="pending"&&g.data.status!=="reconciling")return g;if(c.has(S)){const x=c.get(S)??null;return{...g,data:{...g.data,status:"reconciling",pendingPhase:x}}}const v=g.data.pendingStartedAt??0;if(v&&m-v<p)return{...g,data:{...g.data,status:"reconciling"}};const y=!!g.data.imageUrl||!!g.data.serverNodeId;return{...g,data:{...g.data,pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,status:y?"ready":"stale",error:y?void 0:Z("session.assetAbortedError")}}});e({graphNodes:h})}await Cb(a,e).catch(()=>{})}async function ck(e,a,i){e==null&&(e=Z("session.untitled"));try{const{session:o}=await zT(e);a({sessions:[o,...i().sessions],activeSessionId:o.id,activeSessionGraphVersion:o.graphVersion,graphNodes:[],graphEdges:[],graphHistoryPast:[],graphHistoryFuture:[]}),bm(o.id)}catch(o){console.warn("[sessions] create failed:",o),i().showToast(Z("toast.sessionCreateFailed"),!0)}}async function dk(e,a,i){const o=i().activeSessionId;if(o)try{await qT(o,e),a({sessions:i().sessions.map(s=>s.id===o?{...s,title:e,updatedAt:Date.now()}:s)})}catch{i().showToast(Z("toast.sessionRenameFailed"),!0)}}async function uk(e,a,i){try{await UT(e);const o=i().sessions.filter(s=>s.id!==e);a({sessions:o}),i().activeSessionId===e&&(a({activeSessionId:null,activeSessionGraphVersion:null,graphNodes:[],graphEdges:[]}),bm(null),o.length>0?await i().switchSession(o[0].id):await i().createAndSwitchSession(Z("session.firstGraph")))}catch{i().showToast(Z("toast.sessionDeleteFailed"),!0)}}function mk(e,a){const i={},o=a.userPrompt||a.prompt;typeof o=="string"&&(i.prompt=o),tb(a.quality)&&(i.quality=a.quality),nb(a.format)&&(i.format=a.format),ab(a.moderation)&&(i.moderation=a.moderation),(a.promptMode==="auto"||a.promptMode==="direct")&&(i.promptMode=a.promptMode),a.model&&Tv(a.model)&&(i.imageModel=a.model);const s=OR(a.size);return s.preset&&(i.sizePreset=s.preset),s.preset==="custom"&&s.w&&s.h&&(i.customW=_n(s.w,e.customW),i.customH=_n(s.h,e.customH)),i}function Ri(e,a){return Nm(e,a)}function Mm(e){const a=/^data:(image\/(?:png|jpeg|webp));/i.exec(e)?.[1]?.toLowerCase();return a==="image/png"||a==="image/jpeg"||a==="image/webp"?a:null}function rS(e,a){return{kind:"attachment",tokenId:crypto.randomUUID(),tag:a,insertedAt:Date.now(),source:e}}function Pm(e,a){return Ri(a,(i,o)=>{const s=[...i.trayItems];let c=i.retiredTags;const m=new Set(s.map(g=>g.tag)),p=[];let h=i.nextAttachmentOrdinal;for(const g of e){if(!Em(s,o))break;const S=Mb(h,m),v=rS(g,S.tag);s.push(v),p.push(v),m.add(v.tag),c=Rm(c,v.tag),h=S.nextAttachmentOrdinal}return p.length===0?{result:p}:{result:p,patch:{trayItems:s,nextAttachmentOrdinal:h,retiredTags:c,providerUrlReference:null}}})}function pk(e,a,i){return Pm(e,a)}function Ys(e,a,i,o){const s=Mm(e);return s?Pm([{dataUrl:e,mimeType:s,origin:a}],i)[0]??null:null}function fk(e,a,i){Ys(e,"gallery",a)}async function gk(e,a,i){const o=i().activeReferenceLimit(),s=Math.max(0,o-i().trayItems.length),c=e.slice(0,s),m=c.filter(Ss),p=c.filter(v=>!Ss(v)),g=(await Promise.all(p.map(async v=>{try{const y=await Sm(v,{preserveTransparency:ob(v)}),x=Mm(y);return x?{dataUrl:y,mimeType:x,originalName:v.name,byteSize:v.size,origin:"file"}:null}catch(y){return console.warn("[addReferences] compress failed",y),null}}))).filter(v=>v!==null),S=Pm(g,a);m.length>0&&i().showToast(Z("toast.refHeicUnsupported"),!0),p.length-g.length>0&&i().showToast(Z("toast.refTooLarge"),!0),(e.length>s||g.length>S.length)&&i().showToast(Z("toast.refLimitExceeded"),!0)}async function hk(e,a,i,o){if(!e.type.startsWith("image/"))return!1;let s="";try{s=await Tm(e);const c=await BT({filename:e.name,dataUrl:s});return c.metadata?(i({metadataRestore:{filename:e.name,image:s,metadata:c.metadata,source:c.source??"xmp",targetNodeId:a}}),!0):!1}catch{return o().showToast(Z("metadata.readFailed"),!0),!1}}function yk(e,a){const i=a().metadataRestore;if(!i)return;const o=mk(a(),i.metadata);if(o.imageModel&&Wa(o.imageModel),i.targetNodeId&&typeof o.prompt=="string"){const s=o.prompt;e({...o,metadataRestore:null,graphNodes:a().graphNodes.map(c=>c.id===i.targetNodeId?{...c,data:{...c.data,prompt:s}}:c)}),a().scheduleGraphSave()}else e({...o,metadataRestore:null});a().showToast(Z("metadata.applied"))}function Lm(e){return e.insertedPrompts.filter(a=>!a.id.startsWith("video-continuity:"))}function Om(e,a){a.length!==e.length&&Ge({insertedPrompts:a})}function iS(e,a,i){const o=i().insertedPrompts;Ri(a,s=>{const c=s.trayItems.find(h=>h.tokenId===e);if(!c)return{result:void 0};const m=s.trayItems.filter(h=>h.tokenId!==e),p={trayItems:m,retiredTags:Bs(s.retiredTags,[c])};if(c.kind==="attachment"){const h=Ii({trayItems:m}).length===0;p.canvasReferenceImage=c.source.dataUrl===s.canvasReferenceImage?null:s.canvasReferenceImage,h&&(p.insertedPrompts=Lm(s),p.videoContinuityLineage=null)}return{result:void 0,patch:p}}),Om(o,i().insertedPrompts)}function vk(e,a,i){const o=Ii(i())[e];o&&iS(o.tokenId,a,i)}function bk(e,a){const i=a().insertedPrompts;Ri(e,o=>{const s=Ii(o);return{result:void 0,patch:{trayItems:o.trayItems.filter(m=>m.kind!=="attachment"),retiredTags:Bs(o.retiredTags,s),canvasReferenceImage:null,videoContinuityLineage:null,insertedPrompts:Lm(o),providerUrlReference:null}}}),Om(i,a().insertedPrompts)}function Sk(e,a){const i=a().insertedPrompts;Ri(e,o=>({result:void 0,patch:{trayItems:[],retiredTags:{},canvasReferenceImage:null,videoContinuityLineage:null,insertedPrompts:Lm(o),providerUrlReference:null}})),Om(i,a().insertedPrompts)}function xk(e,a,i){const o=Ii(e).filter(g=>g.source.dataUrl===i.dataUrl||g.source.dataUrl===e.canvasReferenceImage),s=new Set(o.map(g=>g.tokenId)),c=e.trayItems.filter(g=>!s.has(g.tokenId));if(!Em(c,a))return{result:!1};const m=Mb(e.nextAttachmentOrdinal,c.map(g=>g.tag)),p=rS(i,m.tag),h=Rm(Bs(e.retiredTags,o),p.tag);return{result:!0,patch:{trayItems:[p,...c],nextAttachmentOrdinal:m.nextAttachmentOrdinal,retiredTags:h,canvasReferenceImage:i.dataUrl,providerUrlReference:null}}}async function Ak(e,a,i,o){let s;try{s=await wi(o??e.image,e.filename||"canvas-version-reference.png")}catch{throw i().showToast(Z("toast.currentImageLoadFailed"),!0),new Error("canvas_reference_attach_failed")}const c=Mm(s);if(!c){i().showToast(Z("toast.currentImageLoadFailed"),!0);return}if(!Ri(a,(p,h)=>xk(p,h,{dataUrl:s,mimeType:c,originalName:e.filename||"canvas-version-reference.png",origin:"canvas"}))){i().showToast(Z("toast.refSlotFull"),!0);return}i().showToast(Z("canvas.version.usingAsReference"))}function lS(e){return e.canvasVersion&&e.canvasSourceFilename?`/generated/${encodeURIComponent(e.canvasSourceFilename)}`:e.image}async function Tk(e,a){const i=a().currentImage;if(!i){a().showToast(Z("toast.noCurrentImageForRef"),!0);return}if(a().trayItems.length>=a().activeReferenceLimit()){a().showToast(Z("toast.refSlotFull"),!0);return}let o;try{o=await wi(lS(i),i.canvasSourceFilename||i.filename||"current-reference.png")}catch{a().showToast(Z("toast.currentImageLoadFailed"),!0);return}if(!Ys(o,"gallery",e)){a().showToast(Z("toast.refSlotFull"),!0);return}a().showToast(Z("toast.addedCurrentAsRef"))}async function Ck(e,a,i){if(i().trayItems.length>=i().activeReferenceLimit()){i().showToast(Z("toast.refSlotFull"),!0);return}let o;try{o=await wi(lS(e),e.canvasSourceFilename||e.filename||"canvas-reference.png")}catch{i().showToast(Z("toast.currentImageLoadFailed"),!0);return}if(!Ys(o,"gallery",a)){i().showToast(Z("toast.refSlotFull"),!0);return}i().showToast(Z("toast.addedCurrentAsRef"))}function wk(e,a,i){const o=i.data?.parentServerNodeId;if(o){const c=e.find(m=>m.data?.serverNodeId===o);if(c)return c}const s=a.find(c=>c.target===i.id);return s?e.find(c=>c.id===s.source):void 0}function Ik(e){if(e.providerUrlReference)return 1;if(e.uiMode==="node"){const a=e.graphNodes??[],i=a.find(c=>c.selected),o=i?.data?.referenceImages?.length??0;return o>0?o:i&&wk(a,e.graphEdges??[],i)?.data?.imageUrl?1:0}return e.referenceImages?.length??0}const Ek=1e4;let Si=[];async function jm(e){const a=await ue("/api/mcp/providers",{signal:e});return Si=Array.isArray(a.providers)?a.providers:[],Si}function Rk(){return Si}async function Rj(e){const a=window.open("about:blank",`ima2_mcp_${e}`);try{const i=await ue(`/api/mcp/providers/${encodeURIComponent(e)}/connect`,{method:"POST"}),o=i.status.authorizationUrl;if(o){if(!a)throw new Error("MCP_POPUP_BLOCKED");a.location.href=o}else a?.close();return i.status}catch(i){throw a?.close(),i}}async function Nj(e){return(await ue(`/api/mcp/providers/${encodeURIComponent(e)}/refresh`,{method:"POST"})).status}async function kj(e){return(await ue(`/api/mcp/providers/${encodeURIComponent(e)}/connection`,{method:"DELETE"})).status}async function sS(e,a){const o=(await ue(`/api/mcp/providers/${encodeURIComponent(e)}/models`,{signal:a})).models;return{image:Array.isArray(o?.image)?o.image:[],video:Array.isArray(o?.video)?o.video:[]}}function Nk(e,a){if(typeof e.filename!="string"||typeof e.url!="string"||e.mediaType!=="image"&&e.mediaType!=="video")return null;const i=e.model;return{requestId:a,filename:e.filename,url:e.url,mediaType:e.mediaType,provider:typeof e.provider=="string"?e.provider:void 0,model:typeof i=="string"||i===null?i:void 0,createdAt:typeof e.createdAt=="number"?e.createdAt:void 0}}function kk(e,a){let i=!1;const o=()=>i?!1:(i=!0,s(),c(),!0),s=io(e,null,(m,p)=>{if(m==="done"){const h=Nk(p,e);if(!h||!o())return;Promise.resolve(a.onDone(h)).catch(g=>{a.onError?.(g instanceof Error?g:new Error(String(g)))});return}if(m==="error"&&o()){const h=new Error(typeof p.message=="string"?p.message:"MCP generation failed");typeof p.code=="string"&&(h.code=p.code),a.onError?.(h)}}),c=or(()=>{if(!o())return;const m=new Error("MCP generation timed out");m.code="MCP_STREAM_TIMEOUT",a.onError?.(m)});return o}async function _k(e,a){const i=e.requestId??`mcp_ui_${Date.now()}`,o=kk(i,a);try{const c=(await jm()).find(m=>m.id===e.provider);if(!c||c.status.state!=="connected"){const m=new Error("MCP provider is not connected");throw m.code=c?"MCP_NOT_CONNECTED":"MCP_PROVIDER_UNKNOWN",m}return await ue("/api/mcp/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,requestId:i})}),i}catch(s){throw o(),s}}function cS(){const[e,a]=R.useState(()=>[...Si]),[i,o]=R.useState(Si.length===0),[s,c]=R.useState(null),m=R.useCallback(async()=>{try{const p=await jm();a([...p]),c(null)}catch(p){c(p instanceof Error?p:new Error(String(p)))}finally{o(!1)}},[]);return R.useEffect(()=>{m();const p=window.setInterval(()=>{m()},Ek);return()=>window.clearInterval(p)},[m]),{providers:e,loading:i,error:s,refresh:m}}let Cs=null;function dS(e){const a=e,i=a.code??a.message??"";return i.startsWith("MCP_INPUT_ROLE_UNSUPPORTED")||a.message?.startsWith("MCP_INPUT_ROLE_UNSUPPORTED")?Z("mcp.errorUnsupportedInput"):i==="MCP_END_FRAME_REQUIRES_START"?Z("mcp.errorEndRequiresStart"):i==="INVALID_MCP_REFERENCES"?Z("mcp.errorInvalidReferences"):i==="INVALID_START_FRAME"?Z("mcp.errorInvalidFrame"):i.startsWith("INVALID_MCP_TEMP_REFERENCE")||i==="MCP_TEMP_REFERENCES_FAILED"?Z("mcp.errorTempReferences"):Z(i==="MCP_NOT_CONNECTED"||i==="MCP_PROVIDER_UNKNOWN"?"mcp.selectionUnavailable":"mcp.generateFailed")}async function Mk(e){const a=e.references.filter(c=>c.dataUrl);if(a.length===0)return{selection:e,batchId:null};const i=await ue("/api/mcp/temp-references",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({images:a.map(c=>({dataUrl:c.dataUrl,...c.tag?{tag:c.tag}:{}}))})});if(i.files.length!==a.length)throw new Error("MCP_TEMP_REFERENCES_FAILED");let o=0;const s=e.references.map(c=>c.dataUrl?{filename:i.files[o++].filename,...c.tag?{tag:c.tag}:{}}:c);return{selection:{...e,references:s},batchId:i.batchId}}async function Pk(e){try{await ue(`/api/mcp/temp-references/${encodeURIComponent(e)}`,{method:"DELETE"})}catch(a){console.error("[mcp] temporary reference cleanup failed",a)}}async function Lk(e,a,i){let o=()=>{};const s=new Promise(m=>{o=m});if(await _k(e,{onDone:()=>{a().hydrateHistory(),o()},onError:m=>{a().showToast(dS(m),!0),o()}}),!i){await a().reconcileInflight(),a().startInFlightPolling();return}let c=null;try{await a().reconcileInflight(),a().startInFlightPolling()}catch(m){c=m}if(await s,c)throw c}async function Ok(e){const a=e();if((a.mcpProvider?Rk().find(h=>h.id===a.mcpProvider):void 0)?.executable===!1){e().showToast(Z("mcp.higgsfieldLocked"),!0);return}const o=xi(a.prompt,a.insertedPrompts);if(!o)return;const s=a.mcpReferenceSelection??Tn();if(yR(s)){e().showToast(Z("mcp.referenceTagInvalid"),!0);return}const c=a.selectedElementIds??[];if(a.mcpCharacterElementId&&c.length>0){e().showToast(Z("mcp.characterSlotConflictHint"),!0);return}const m=c.map(h=>a.assets.find(g=>g.id===h)).flatMap(h=>{const g=h?.metadata?.refs;if(!Array.isArray(g))return[];const S=h?.name?Qv(h.name):null;return g.filter(v=>typeof v=="string").map(v=>({filename:v,...S?{tag:S}:{}}))}).slice(0,3);let p=null;try{const h=await Mk(s);p=h.batchId;const g=TR({mcpProvider:a.mcpProvider,mcpModel:a.mcpModel,mcpMediaKind:a.mcpMediaKind,mcpRatio:a.mcpRatio,mcpParameters:a.mcpParameters,mcpInputRoles:a.mcpInputRoles??[],mcpReferenceSelection:h.selection,currentImageFilename:a.currentImage?.filename??null,mcpCharacterElementId:a.mcpCharacterElementId??null,...m.length>0?{elementReferences:m}:{}},o,`mcp_ui_${Date.now()}`);if(!g)return;await Lk(g,e,!!p)}catch(h){e().showToast(dS(h),!0)}finally{p&&await Pk(p)}}function Xs(e){Ti(null,null,"image"),Ge({mcpRatio:null,mcpParameters:{}}),e({mcpProvider:null,mcpModel:null,mcpMediaKind:"image",mcpRatio:null,mcpParameters:{},mcpInputRoles:[],mcpReferenceSelection:Tn(),mcpCharacterElementId:null,...Cs?{generate:Cs}:{}})}function Qs(e,a,i,o=null,s){if(!e){Xs(a);return}Cs||(Cs=i().generate);const c=i().mcpProvider===e?i().mcpModel??o:o,m=s??i().mcpMediaKind??"image",p=i().mcpProvider!==e;Ti(e,c,m),Ge({count:1,multimode:!1,...p?{mcpRatio:null,mcpParameters:{}}:{}}),a({mcpProvider:e,mcpModel:c,mcpMediaKind:m,...p?{mcpRatio:null,mcpParameters:{},mcpInputRoles:[],mcpReferenceSelection:Tn()}:{},count:1,multimode:!1,generate:()=>Ok(i)})}function jk(e,a,i){Ti(i().mcpProvider??null,e,i().mcpMediaKind??"image"),Ge({mcpRatio:null,mcpParameters:{}}),a({mcpModel:e,mcpRatio:null,mcpParameters:{},mcpInputRoles:[],mcpReferenceSelection:Tn()})}function Gk(e,a,i,o,s){const c=bR(s);let m=s?hm(s.inputRoles,o().mcpReferenceSelection):Tn();const p=o().currentImage;s?.inputRoles.includes("start_image")&&!m.startFrameFilename&&p?.filename&&!gt(p)&&(m={...m,startFrameFilename:p.filename}),Ti(o().mcpProvider??null,e,a),Ge({mcpRatio:c.ratio,mcpParameters:c.parameters}),i({mcpModel:e,mcpMediaKind:a,mcpRatio:c.ratio,mcpParameters:c.parameters,mcpInputRoles:s?[...s.inputRoles]:[],mcpReferenceSelection:m})}function Dk(e,a,i){(i().mcpMediaKind??"image")!==e&&(Ti(i().mcpProvider??null,null,e),Ge({mcpRatio:null,mcpParameters:{}}),a({mcpMediaKind:e,mcpModel:null,mcpRatio:null,mcpParameters:{},mcpInputRoles:[],mcpReferenceSelection:Tn()}))}function Fk(e,a){Ge({mcpRatio:e}),a({mcpRatio:e})}function zk(e,a,i,o){if(!/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(e))return;const s={...o().mcpParameters??{}};a===null?delete s[e]:s[e]=a,Ge({mcpParameters:s}),i({mcpParameters:s})}function qk(e,a,i){const o=hm(i().mcpInputRoles??[],gm(e)),s=i().mcpReferenceSelection??Tn();Xv(s,o)||a({mcpReferenceSelection:o})}function Uk(e,a,i){const o={ratio:i().mcpRatio??null,parameters:i().mcpParameters??{}},s=$v(e,o.ratio,o.parameters),c=i().mcpReferenceSelection??Tn(),m=hm(e.inputRoles,c),p=JSON.stringify(i().mcpInputRoles??[])!==JSON.stringify(e.inputRoles),h=!SR(o,s),g=!Xv(c,m);!h&&!g&&!p||(h&&Ge({mcpRatio:s.ratio,mcpParameters:s.parameters}),a({...h?{mcpRatio:s.ratio,mcpParameters:s.parameters}:{},mcpInputRoles:[...e.inputRoles],mcpReferenceSelection:m}))}function Hk(e,a){const i=FR();i.provider&&(Qs(i.provider,e,a,i.model,i.kind),Ge({mcpRatio:i.ratio,mcpParameters:i.parameters}),e({mcpRatio:i.ratio,mcpParameters:i.parameters}))}function Bk(e,a,i){Xs(a),Ge({provider:e});const o=i().imageModel;if(!(e==="grok"||e==="grok-api")&&i().videoModelSelected&&(a({videoModelSelected:!1}),Zo({model:!1})),(e==="grok"||e==="grok-api")&&!fi(o)){const c="grok-imagine-image-2.0";Wa(c),a({provider:e,imageModel:c})}else if((e==="agy"||e==="gemini-api")&&!vs(o)){const c=e==="gemini-api"?"nano-banana-pro":"nano-banana-2";Wa(c),a({provider:e,imageModel:c})}else if(e==="atlascloud"&&!Hu(o)){const c="openai/gpt-image-2/text-to-image";Wa(c),a({provider:e,imageModel:c})}else if(e==="minimax"&&!Bu(o)){const c="image-01";Wa(c),a({provider:e,imageModel:c})}else e!=="grok"&&e!=="grok-api"&&e!=="agy"&&e!=="gemini-api"&&e!=="atlascloud"&&e!=="minimax"&&(fi(o)||vs(o)||Hu(o)||Bu(o))?(a({provider:e,imageModel:Uu}),Wa(Uu)):a({provider:e})}function Vk(e,a){Ge({quality:e}),a({quality:e})}function Kk(e,a){Ge({sizePreset:e}),a({sizePreset:e})}function $k(e,a,i,o){const s=_n(e,o().customW),c=_n(a,o().customH);Ge({customW:s,customH:c}),i({customW:s,customH:c})}function Yk(e,a){Ge({grokAspectRatio:e}),a({grokAspectRatio:e})}function Xk(e,a){Ge({grokResolution:e}),a({grokResolution:e})}function Qk(e,a){Ge({format:e}),a({format:e})}function Jk(e,a){Ge({moderation:e}),a({moderation:e})}function Wk(e,a,i){if(Xs(a),Wa(e),a({videoModelSelected:!1}),Zo({model:!1}),fi(e)){Ge({provider:"grok"}),a({provider:"grok",imageModel:e});return}if(vs(e)){const o=i().provider;o!=="agy"&&o!=="gemini-api"?(Ge({provider:"agy"}),a({provider:"agy",imageModel:e})):a({imageModel:e});return}if(Hu(e)){Ge({provider:"atlascloud"}),a({provider:"atlascloud",imageModel:e});return}if(Bu(e)){Ge({provider:"minimax"}),a({provider:"minimax",imageModel:e});return}if(i().provider==="grok"||i().provider==="agy"||i().provider==="gemini-api"||i().provider==="atlascloud"||i().provider==="minimax"){Ge({provider:"oauth"}),a({provider:"oauth",imageModel:e});return}a({imageModel:e})}function Zk(e,a,i){Xs(a);const o=Iv(e)||Ea;a({videoModelSelected:o}),Zo({model:o});const s=i().provider;s!=="grok"&&s!=="grok-api"&&i().setProvider("grok")}function e_(e){return Ik(e())}function t_(e,a){kR(e),a({reasoningEffort:e})}function n_(e,a){MR(e),a({webSearchEnabled:e})}function a_(e,a){const i=hi(e);Ge({count:i}),a({count:i})}function o_(e,a,i){if(e&&i().uiMode!=="classic")return;Ge({multimode:e});const o=i();a({multimode:e,multimodeSequences:e?o.multimodeSequences:{},multimodePreviewFlightId:e?o.multimodePreviewFlightId:null})}function r_(e,a){const i=hi(e);Ge({multimodeMaxImages:i}),a({multimodeMaxImages:i})}function i_(e,a){Ge({promptMode:e}),a({promptMode:e})}function l_(e,a){Ge({prompt:e}),a({prompt:e})}function s_(e){const{provider:a,sizePreset:i,customW:o,customH:s,grokAspectRatio:c,grokResolution:m}=e();return a==="grok"||a==="grok-api"?`grok:${c}:${m}`:i==="custom"?`${o}x${s}`:i}const Tu="starred";async function c_(e,a){const o=(await a.getAssets({kind:null,folderId:null,tag:null,q:"",filePath:e.filename,limit:1})).assets[0];if(o?.tags.includes(Tu))return"noop";if(o)return await a.updateAsset(o.id,{tags:[...new Set([...o.tags,Tu])]}),"tagged";const s=gt({...e,image:e.image??""})?"video":"image";return await a.createAsset({filePath:e.filename,kind:s,name:e.prompt?.trim().slice(0,80)||e.filename,tags:[Tu],metadata:{origin:"star",mediaType:s}}),"created"}function d_(e,a){a(i=>{const o=i.insertedPrompts.some(m=>m.id===e.id),s={...e,placement:e.placement==="after"?"after":"before"},c=o?i.insertedPrompts:[...i.insertedPrompts,s];return Ge({insertedPrompts:c}),{insertedPrompts:c}})}function u_(e,a){a(i=>{const o=i.insertedPrompts.filter(s=>s.id!==e);return Ge({insertedPrompts:o}),{insertedPrompts:o,videoContinuityLineage:e.startsWith("video-continuity:")?null:i.videoContinuityLineage}})}function m_(e,a,i){i(o=>{const s=o.insertedPrompts.filter(y=>y.placement!=="after"),c=o.insertedPrompts.filter(y=>y.placement==="after"),m=[...s.map(y=>({kind:"prompt",prompt:y})),{kind:"main"},...c.map(y=>({kind:"prompt",prompt:y}))],p=m.findIndex(y=>y.kind==="prompt"&&y.prompt.id===e);if(p<0)return{};const h=a==="up"?p-1:p+1;if(h<0||h>=m.length)return{};const[g]=m.splice(p,1);m.splice(h,0,g);const S=m.findIndex(y=>y.kind==="main"),v=m.filter(y=>y.kind==="prompt").map((y,x)=>({...y.prompt,placement:x<S?"before":"after"}));return Ge({insertedPrompts:v}),{insertedPrompts:v}})}function p_(e){Ge({insertedPrompts:[]}),e({insertedPrompts:[],videoContinuityLineage:null})}async function f_(e){e({promptLibraryLoading:!0});try{const a=await VT();e({promptLibrary:{prompts:a.prompts,folders:a.folders},promptLibraryLoading:!1})}catch(a){console.error("[PromptLibrary] load failed",a),e({promptLibraryLoading:!1})}}async function g_(e,a,i){try{await KT(e),await i().loadPromptLibrary(),i().showToast(Z("promptLibrary.saved"))}catch(o){console.error("[PromptLibrary] save failed",o),i().showToast(Z("promptLibrary.saveFailed"),!0)}}async function h_(e,a,i){try{await $T(e),await i().loadPromptLibrary()}catch(o){console.error("[PromptLibrary] delete failed",o)}}async function y_(e,a,i){try{await YT(e),await i().loadPromptLibrary()}catch(o){console.error("[PromptLibrary] favorite toggle failed",o)}}async function v_(e,a,i){try{const o=[];for(const c of e){if(!/\.(txt|md|markdown)$/i.test(c.name))continue;const m=await c.text();if(!m.trim())continue;const p=c.name.replace(/\.(txt|md|markdown)$/i,"");o.push({name:p.trim()||Z("promptLibrary.untitled"),text:m.trim(),tags:[]})}if(o.length===0){i().showToast(Z("promptLibrary.importNoValidFiles"),!0);return}const s=await XT({prompts:o});await i().loadPromptLibrary(),i().showToast(Z("promptLibrary.imported",{count:s.promptsImported}))}catch(o){console.error("[PromptLibrary] import failed",o),i().showToast(Z("promptLibrary.importFailed"),!0)}}async function b_(e,a,i){const o=e.filename;if(!o)return null;let s;try{s=(await PT(o)).isFavorite,a(m=>{const p=new Set(m.galleryFavorites);return s?p.add(o):p.delete(o),{galleryFavorites:p}}),a(m=>({history:m.history.map(p=>p.filename===o?{...p,isFavorite:s}:p),currentImage:m.currentImage?.filename===o?{...m.currentImage,isFavorite:s}:m.currentImage}))}catch(c){return console.error("[GalleryFavorite] toggle failed",c),i().showToast(Z("gallery.favoriteFailed"),!0),null}if(!s)return s;try{await c_({...e,filename:o},{getAssets:im,createAsset:Ps,updateAsset:Sv})!=="noop"&&i().showToast(Z("assets.starSaved"))}catch(c){console.error("[GalleryFavorite] asset sync failed",c),i().showToast(Z("assets.starSaveFailed"),!0)}return s}async function S_(e,a,i){if(e){Nb(e),a(o=>{const s=o.inFlight.map(c=>c.id===e?{...c,phase:"canceling"}:c);return jt(s),{inFlight:s}});try{await Mt(e),i().startInFlightPolling()}catch{i().showToast(Z("toast.cancelFailed"),!0)}}}function x_(e,a){const i=db(),o=Zv(),s=Wv(),c=vm();e(m=>{const p=o?m.history.find(v=>v.filename===o)??null:null,h=p?Pn(m.history,p):null,g=so(m.history)[0]??null,S=m.currentImage?.canvasVersion?Pn(m.history,m.currentImage)??g:m.currentImage;return{inFlight:i,activeGenerations:i.length,imageModel:s,videoModelSelected:c.model,videoDuration:c.duration,videoResolution:c.resolution,videoAspectRatio:c.aspectRatio,currentImage:o&&S?.filename!==o?h??S:S}}),i.length>0&&a().startInFlightPolling()}function A_(e,a){a(i=>({history:e.filename?i.history.some(o=>o.filename===e.filename)?i.history.map(o=>o.filename===e.filename?e:o):qs([e,...i.history],i.loadedHistoryRetainLimit+1):i.history,loadedHistoryRetainLimit:Math.max(i.loadedHistoryRetainLimit,Math.min(i.history.length+1,i.loadedHistoryRetainLimit+1))}))}function T_(e,a){const i=a().metadataRestore;i&&(i.targetNodeId?a().addNodeReferenceDataUrl(i.targetNodeId,i.image):a().addReferenceDataUrl(i.image),e({metadataRestore:null}))}function C_(e,a){const i=!a().rightPanelOpen;try{localStorage.setItem(Nv,JSON.stringify(i))}catch{}e({rightPanelOpen:i})}function w_(e,a){try{localStorage.setItem(um,e)}catch{}a({galleryScope:e})}function I_(e,a){try{localStorage.setItem(Dv,e),localStorage.setItem(um,e)}catch{}a({galleryDefaultScope:e,galleryScope:e})}function E_(e,a){const i=e==="card-news"&&!Hv?"classic":e;try{localStorage.setItem(kv,i)}catch{}a({uiMode:i})}function R_(e,a){try{localStorage.setItem(_v,e)}catch{}a({historyStripLayout:e})}function N_(e,a,i){const o=Date.now(),s={message:e,error:a,id:o+Math.random(),createdAt:o};i(c=>({toast:s,toastLog:[...c.toastLog,s].slice(-50)}))}function k_(e,a){a(i=>{const o=i.toastLog.filter(s=>s.id!==e);return{toastLog:o,toast:i.toast?.id===e?o[o.length-1]??null:i.toast}})}function __(e,a,i){const o=Date.now(),s={code:e,cardKey:a?.cardKey,cta:a?.cta,fallbackMessage:a?.fallbackMessage,id:o+Math.random(),createdAt:o};i(c=>({errorCard:s,errorCardLog:[...c.errorCardLog,s]}))}function M_(e,a){a(i=>{if(e==null)return{errorCard:null,errorCardLog:[]};const o=i.errorCardLog.filter(s=>s.id!==e);return{errorCardLog:o,errorCard:i.errorCard?.id===e?o[o.length-1]??null:i.errorCard}})}function P_(e,a,i){a({graphNodes:Mn(e,i().graphEdges)}),i().scheduleGraphSave()}function L_(e,a,i){a({graphEdges:e,graphNodes:Mn(i().graphNodes,e)}),i().scheduleGraphSave()}function O_(e,a){const i=!a().nodeSelectionMode;e({nodeSelectionMode:i,...i?{}:{graphNodes:gi(a().graphNodes,[])}})}function j_(e,a,i,o){i({graphNodes:f0(o().graphNodes,o().graphEdges,e,a)})}function G_(e,a){a().nodeBatchRunning&&(e({nodeBatchStopping:!0}),a().showToast(Z("nodeBatch.stopQueued")))}function D_(e,a,i){i({canvasPanX:Math.max(-4e3,Math.min(4e3,e)),canvasPanY:Math.max(-4e3,Math.min(4e3,a))})}function F_(e,a,i){a({canvasExportBackground:e}),Jv(e,i().canvasExportMatteColor)}function z_(e,a,i){a({canvasExportMatteColor:e}),Jv(i().canvasExportBackground,e)}const ea=e=>console.error("[assets]",e instanceof Error?e.message:String(e));let Cu=0;async function uS(e){const{folders:a}=await lm();e({assetsFolders:a})}const Gm=uS;async function Dm(e,a,i){const o=e!==!1;if(!o&&i().assetsLoading)return;const s=++Cu;a({assetsLoading:!0,...o?{assetsLoadError:!1}:{}});try{const c=i().assetsFilters,m=await im({...c,cursor:o?null:i().assetsCursor}),p=o?await Promise.all([lm(),sm()]):null;if(s!==Cu)return;a(h=>({assets:o?m.assets:[...h.assets,...m.assets.filter(g=>!h.assets.some(S=>S.id===g.id))],assetsCursor:m.nextCursor,assetsLoading:!1,...p?{assetsFolders:p[0].folders,assetsTags:p[1].tags}:{}}))}catch(c){ea(c),s===Cu&&a({assetsLoading:!1,...o?{assetsLoadError:!0}:{}})}}async function q_(e,a){!a().assetsCursor||a().assetsLoading||await Dm(!1,e,a)}function My(e,a,i){a(o=>({assetsFilters:{...o.assetsFilters,...e}})),Dm(!0,a,i)}async function U_(e,a,i){if(!e.filename)return!1;const o=Object.fromEntries(Object.entries({prompt:e.prompt,provider:e.provider,model:e.model,mediaType:e.mediaType,requestId:e.requestId,sessionId:e.sessionId,createdAt:e.createdAt}).filter(([,s])=>s!==void 0));try{const s=i().selectedProjectId??void 0,{asset:c}=await Ps({filePath:e.filename,kind:gt(e)?"video":"image",name:(e.prompt||"").trim().slice(0,80)||e.filename,folderId:s,tags:[],metadata:o}),m=i().assetsFilters;return(!m.kind||m.kind===c.kind)&&!m.tag&&!(m.q||"").trim()&&!m.folderId&&a(h=>({assets:[c,...h.assets.filter(g=>g.id!==c.id)]})),!0}catch(s){return ea(s),!1}}async function H_(e,a,i){try{const{asset:o}=await Sv(e,a);let s=null;try{s=(await sm()).tags}catch(c){ea(c)}return i(c=>{const m=c.assetsFilters.tag;return{assets:m&&!o.tags.includes(m)?c.assets.filter(h=>h.id!==e):c.assets.map(h=>h.id===e?o:h),...s?{assetsTags:s}:{}}}),!0}catch(o){return ea(o),!1}}async function B_(e,a){try{return await JT(e),a(i=>({assets:i.assets.filter(o=>o.id!==e)})),!0}catch(i){return ea(i),!1}}async function V_(e,a,i){try{return await WT({name:e,parentId:a}),await Gm(i),!0}catch(o){return ea(o),!1}}async function K_(e,a,i){try{return await xv(e,{name:a}),await Gm(i),!0}catch(o){return ea(o),!1}}async function $_(e,a,i){try{return await xv(e,{parentId:a}),await Gm(i),!0}catch(o){return ea(o),!1}}async function Y_(e,a){try{await ZT(e);const[{folders:i},{tags:o}]=await Promise.all([lm(),sm()]);return a({assetsFolders:i,assetsTags:o}),!0}catch(i){return ea(i),!1}}function X_(e){const a=e.assetGenProvider;if(a==="grok"||a==="grok-api")return"grok-imagine-image-2.0";if(!(fi(e.imageModel)||vs(e.imageModel)))return e.imageModel}async function mS(e,a,i){if(!e.filename)return;const o=i();try{await Ps({filePath:e.filename,kind:"image",name:(e.prompt||"").trim().slice(0,80)||e.filename,folderId:o.selectedProjectId??void 0,tags:[],metadata:{source:"asset-gen",backgroundPreset:o.assetGenBackground,prompt:e.prompt,provider:e.provider,requestId:e.requestId}}),a(s=>({assetGenSaveFailures:s.assetGenSaveFailures.filter(c=>c!==e.requestId)}))}catch{a(s=>({assetGenSaveFailures:s.assetGenSaveFailures.includes(e.requestId??"")?s.assetGenSaveFailures:[...s.assetGenSaveFailures,e.requestId??""]}))}}async function Q_(e,a,i){const o=i().assetGenItems.find(s=>s.requestId===e);o&&(o.mediaType==="video"?await pS(o,a,i):await mS(o,a,i))}async function J_(e,a,i,o){const s=i(),c=s.assetGenPrompt.trim(),m=await rm({prompt:c,provider:"grok",duration:s.assetGenVideoDuration,resolution:s.assetGenVideoResolution,aspectRatio:s.assetGenVideoAspect,requestId:e,backgroundPreset:s.assetGenBackground},{},{signal:o.signal}),p={image:m.url,url:m.url,filename:m.filename,mediaType:"video",video:m.video??null,prompt:c,provider:"grok",requestId:m.requestId??e,elapsed:m.elapsed,createdAt:Date.now()};await Ra(p,a,i,{autoSelectStartedAt:Date.now()}),a(h=>({assetGenItems:[p,...h.assetGenItems]})),await pS(p,a,i),i().showToast(Z("toast.generatedSingle",{elapsed:String(m.elapsed??"")}))}async function pS(e,a,i){if(!e.filename)return;const o=i();try{await Ps({filePath:e.filename,kind:"video",name:(e.prompt||"").trim().slice(0,80)||e.filename,folderId:o.selectedProjectId??void 0,tags:[],metadata:{source:"asset-gen",backgroundPreset:o.assetGenBackground,prompt:e.prompt,provider:e.provider,requestId:e.requestId}}),a(s=>({assetGenSaveFailures:s.assetGenSaveFailures.filter(c=>c!==e.requestId)}))}catch{a(s=>({assetGenSaveFailures:s.assetGenSaveFailures.includes(e.requestId??"")?s.assetGenSaveFailures:[...s.assetGenSaveFailures,e.requestId??""]}))}}async function W_(e,a){const i=a(),o=i.assetGenPrompt.trim();if(!o)return;const s=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,c=new AbortController;ur(s,c);const m=Date.now(),p=[...i.inFlight,{id:s,prompt:o,startedAt:m}];jt(p),e({assetGenLastError:null,activeGenerations:i.activeGenerations+1,inFlight:p}),a().startInFlightPolling();try{if(i.assetGenKind==="video"){await J_(s,e,a,c);return}const h={prompt:o,quality:i.quality,size:"1024x1024",format:"png",moderation:i.moderation,provider:i.assetGenProvider,n:1,model:X_(i),requestId:s,mode:i.promptMode,backgroundPreset:i.assetGenBackground},g=await yv(h,{signal:c.signal}),S=Zu(g)?g.images[0]:null,v={image:S?S.image:g.image,filename:S?S.filename:g.filename,reasoningEffort:g.reasoningEffort,prompt:o,elapsed:g.elapsed,provider:g.provider,providerUrl:(S?S.providerUrl:g.providerUrl)??null,usage:g.usage,requestId:g.requestId??s,quality:g.quality,size:g.size,model:g.model??null,createdAt:(S?S.createdAt:g.createdAt)??Date.now()};await Ra(v,e,a,{autoSelectStartedAt:m}),e(y=>({assetGenItems:[v,...y.assetGenItems]})),await mS(v,e,a),a().showToast(Z("toast.generatedSingle",{elapsed:g.elapsed}))}catch(h){if(!sr(h)){dr(h,a());const g=h instanceof Error?h.message:String(h);e({assetGenLastError:g})}}finally{const h=a().inFlight.filter(g=>g.id!==s);jt(h),mr(s),e({activeGenerations:Math.max(0,a().activeGenerations-1),inFlight:h})}}function Z_(e){return[...new Set(e.filter(a=>typeof a=="string"))]}function si(e){Ge({presetIds:e})}const eM=e=>({selectedPresetIds:zs().presetIds??[],addPreset:a=>e(i=>{if(i.selectedPresetIds.includes(a))return i;const o=[...i.selectedPresetIds,a];return si(o),{selectedPresetIds:o}}),removePreset:a=>e(i=>{const o=i.selectedPresetIds.filter(s=>s!==a);return si(o),{selectedPresetIds:o}}),togglePreset:a=>e(i=>{const o=i.selectedPresetIds.includes(a)?i.selectedPresetIds.filter(s=>s!==a):[...i.selectedPresetIds,a];return si(o),{selectedPresetIds:o}}),clearPresets:()=>{si([]),e({selectedPresetIds:[]})},restorePresetIds:a=>{const i=Z_(a);si(i),e({selectedPresetIds:i})}});function tM(){return{name:"",characterId:"",description:"",style:"",baseAssetId:"",cell:{width:256,height:256,safeMarginX:8,safeMarginY:8},chroma:{preset:"green",hex:"#00ff00"},states:[{key:"idle",frames:4,fps:8,loop:!0,action:"idle"}]}}const Ni=(e,a="POST",i)=>({method:a,signal:i,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),nM=e=>ue("/api/sprite-recipes",{signal:e}),aM=(e,a)=>ue(`/api/sprite-recipes/${encodeURIComponent(e)}`,{signal:a}),oM=(e,a)=>ue("/api/sprite-recipes",Ni(e,"POST",a)),rM=(e,a,i)=>ue(`/api/sprite-recipes/${encodeURIComponent(e)}`,Ni(a,"PATCH",i)),iM=(e,a={},i)=>ue(`/api/sprite-recipes/${encodeURIComponent(e)}/generate`,Ni({...a,async:!0},"POST",i)),lM=(e,a,i)=>ue(`/api/sprite-recipes/${encodeURIComponent(e)}/anchor/approve`,Ni({assetId:a},"POST",i)),sM=(e,a={},i)=>ue(`/api/sprite-recipes/${encodeURIComponent(e)}/generate`,Ni({...a,async:!0},"POST",i)),er=new Map,pr=e=>e instanceof Error?e.message:String(e),fS=e=>({id:e.id,name:e.name,anchorStatus:e.anchorStatus,updatedAt:e.updatedAt});async function cM(e,a){e({spriteRecipeLoading:!0,spriteRecipeError:null});try{const{recipes:i}=await nM();e({spriteRecipes:i.map(fS)}),a().activeSpriteRecipeId&&await Fm(a().activeSpriteRecipeId,e,a)}catch(i){e({spriteRecipeError:pr(i)})}finally{e({spriteRecipeLoading:!1})}}async function Fm(e,a,i){if(a({activeSpriteRecipeId:e,spriteRecipeError:null}),!e){a({activeSpriteRecipe:null});return}a({spriteRecipeLoading:!0});try{const{recipe:o}=await aM(e);a({activeSpriteRecipe:o,spriteRecipeDraft:o,spriteRecipeDirty:!1})}catch(o){a({spriteRecipeError:pr(o)})}finally{a({spriteRecipeLoading:!1})}}async function dM(e,a){e({spriteRecipeSaving:!0,spriteRecipeError:null});try{const i=a(),o=i.activeSpriteRecipeId?await rM(i.activeSpriteRecipeId,i.spriteRecipeDraft):await oM(i.spriteRecipeDraft);return e(s=>({activeSpriteRecipeId:o.recipe.id,activeSpriteRecipe:o.recipe,spriteRecipeDraft:o.recipe,spriteRecipeDirty:!1,spriteRecipes:[fS(o.recipe),...s.spriteRecipes.filter(c=>c.id!==o.recipe.id)]})),o.recipe.id}catch(i){return e({spriteRecipeError:pr(i)}),null}finally{e({spriteRecipeSaving:!1})}}function gS(e,a,i){er.get(e)?.(),er.set(e,io(e,null,(o,s)=>gM({event:o,data:{...s,requestId:e}},a,i)))}async function uM(e,a){const i=a().activeSpriteRecipeId;if(i){e({spriteRecipeGenerating:!0,spriteRecipeError:null});try{const o=crypto.randomUUID();gS(o,e,a),await iM(i,{requestId:o,async:!0})}catch(o){e({spriteRecipeError:pr(o),spriteRecipeGenerating:!1})}}}async function mM(e,a,i){const o=i().activeSpriteRecipeId;if(o){a({spriteRecipeGenerating:!0,spriteRecipeError:null});try{const{recipe:s}=await lM(o,e);a({activeSpriteRecipe:s,spriteRecipeDraft:s,spriteRecipeDirty:!1})}catch(s){a({spriteRecipeError:pr(s)})}finally{a({spriteRecipeGenerating:!1})}}}async function pM(e,a,i){const o=i().activeSpriteRecipeId;if(o){a({spriteRecipeGenerating:!0,spriteRecipeError:null});try{const s=crypto.randomUUID();gS(s,a,i),await sM(o,{requestId:s,stateKeys:e,async:!0})}catch(s){a({spriteRecipeError:pr(s),spriteRecipeGenerating:!1})}}}async function fM(e,a,i){er.get(e)?.(),er.delete(e),a({spriteRecipeGenerating:!1})}function gM(e,a,i){const o=e.data.stateKey,s=e.data.url??e.data.image??e.data.previewUrl;if(o&&s&&a(c=>({spritePartialPreviews:{...c.spritePartialPreviews,[o]:s}})),e.event==="error"&&a({spriteRecipeError:String(e.data.message??"Generation failed"),spriteRecipeGenerating:!1}),e.event==="done"){const c=String(e.data.requestId??"");er.get(c)?.(),er.delete(c),a({spriteRecipeGenerating:!1});const m=i().activeSpriteRecipeId;m&&Fm(m,a)}}function hM(e,a){a(i=>({spriteRecipeDraft:{...i.spriteRecipeDraft,...e},spriteRecipeDirty:!0}))}const kt=zs(),hS=Wv(),ui=vm(),Jl=ui.model||fi(hS)?"grok":(kt.provider??"oauth")==="grok"?"oauth":kt.provider??"oauth",w=pv((e,a,i)=>({...eM(e),assets:[],assetGenWorkflow:"generate",setAssetGenWorkflow:o=>e({assetGenWorkflow:o}),spriteRecipes:[],activeSpriteRecipeId:null,activeSpriteRecipe:null,spriteRecipeDraft:tM(),spriteRecipeDirty:!1,spriteRecipeLoading:!1,spriteRecipeSaving:!1,spriteRecipeGenerating:!1,spriteRecipeError:null,spriteSelectedStates:[],spritePartialPreviews:{},loadSpriteRecipes:()=>cM(e,a),selectSpriteRecipe:o=>Fm(o,e),updateSpriteRecipeDraft:o=>hM(o,e),saveSpriteRecipe:()=>dM(e,a),generateSpriteAnchor:()=>uM(e,a),approveSpriteAnchor:o=>mM(o,e,a),generateSpriteRows:o=>pM(o,e,a),cancelSpriteJob:o=>fM(o,e),assetsFolders:[],assetsTags:[],assetsLoading:!1,assetsLoadError:!1,assetsCursor:null,assetsFilters:{kind:null,folderId:null,tag:null,q:""},assetGenPrompt:"",assetGenBackground:"chroma-green",assetGenProvider:Jl==="grok"||Jl==="grok-api"?Jl:"oauth",assetGenKind:"image",assetGenVideoDuration:5,assetGenVideoResolution:"720p",assetGenVideoAspect:"1:1",setAssetGenVideoDuration:o=>e({assetGenVideoDuration:o}),setAssetGenVideoResolution:o=>e({assetGenVideoResolution:o}),setAssetGenVideoAspect:o=>e({assetGenVideoAspect:o}),assetGenItems:[],assetGenSaveFailures:[],assetGenLastError:null,setAssetGenLastError:o=>e({assetGenLastError:o}),keyingTarget:null,setKeyingTarget:o=>e({keyingTarget:o}),spriteCuratorTarget:null,setCuratorTarget:o=>e({spriteCuratorTarget:o}),addAssetGenDerivedItem:o=>e(s=>o.filename&&s.assetGenItems.some(c=>c.filename===o.filename)?{}:{assetGenItems:[o,...s.assetGenItems]}),selectedProjectId:null,setSelectedProject:o=>{e({selectedProjectId:o}),My({folderId:o},e,a)},loadAssetFolders:()=>uS(e),retryAssetGenSave:o=>Q_(o,e,a),setAssetGenPrompt:o=>e({assetGenPrompt:o}),setAssetGenBackground:o=>e({assetGenBackground:o}),setAssetGenProvider:o=>e({assetGenProvider:o}),setAssetGenKind:o=>e({assetGenKind:o}),generateAssetGen:()=>W_(e,a),loadAssets:o=>Dm(o,e,a),loadMoreAssets:()=>q_(e,a),setAssetsFilters:o=>My(o,e,a),saveToAssets:o=>U_(o,e,a),updateAssetItem:(o,s)=>H_(o,s,e),deleteAssetItem:o=>B_(o,e),createAssetFolder:(o,s)=>V_(o,s,e),renameAssetFolder:(o,s)=>K_(o,s,e),moveAssetFolder:(o,s)=>$_(o,s,e),deleteAssetFolder:o=>Y_(o,e),provider:Jl,quality:kt.quality??"medium",sizePreset:kt.sizePreset??"1024x1024",customW:kt.customW??1920,customH:kt.customH??1088,grokAspectRatio:kt.grokAspectRatio??"1:1",grokResolution:kt.grokResolution??"1k",format:kt.format??"png",moderation:kt.moderation??"low",count:kt.count??1,multimode:kt.multimode??!1,multimodeMaxImages:kt.multimodeMaxImages??4,multimodeSequences:{},activeFlightIds:new Set,multimodePreviewFlightId:null,promptMode:kt.promptMode??"auto",prompt:kt.prompt??"",insertedPrompts:kt.insertedPrompts??[],mcpInputRoles:[],mcpReferenceSelection:Tn(),mcpCharacterElementId:null,trayItems:[],nextAttachmentOrdinal:1,retiredTags:{},elementCatalog:null,missingElementIds:[],pendingAssetDetailId:null,referenceImages:[],selectedElementIds:[],referenceLimit:xm,activeReferenceLimit:()=>Rb({provider:a().provider,serverLimit:a().referenceLimit,videoModelSelected:!!a().videoModelSelected,mcpProvider:a().mcpProvider??null}),providerUrlReference:null,canvasReferenceImage:null,physicalVideoSourceCount:()=>q1(a().trayItems),workspaceProfile:(()=>{try{return localStorage.getItem("ima2.workspaceProfile")==="prompt-studio"?"prompt-studio":"default"}catch{return"default"}})(),promptBuilderOpen:!1,storyboardActive:!1,promptLibraryOpen:!1,promptLibrary:{prompts:[],folders:[]},promptLibraryLoading:!1,galleryFavorites:new Set,browserId:fv(),canvasOpen:!1,canvasZoom:1,canvasPanX:0,canvasPanY:0,canvasExportBackground:vy().mode,canvasExportMatteColor:vy().matteColor,syncCapabilities:()=>BR(e),addTrayAttachments:async o=>pk(o,e),addTrayAttachmentDataUrl:(o,s)=>Ys(o,s,e),addTrayElement:o=>gs(o,e),addElementFromMention:o=>gs(o.id,e,a,o),syncElementCatalog:o=>Gb(o,e),openAssetDetail:o=>e({uiMode:"assets",pendingAssetDetailId:o}),removeTrayItem:o=>iS(o,e,a),clearTray:()=>Sk(e,a),addElementId:o=>{gs(o,e)},removeElementId:o=>B1(o,e),addReferences:o=>gk(o,e,a),addReferenceDataUrl:o=>fk(o,e),metadataRestore:null,readDroppedImageMetadata:(o,s=null)=>hk(o,s,e,a),applyMetadataRestore:()=>yk(e,a),cancelMetadataRestore:()=>e({metadataRestore:null}),addMetadataRestoreAsReference:()=>T_(e,a),removeReference:o=>vk(o,e,a),setProviderUrlReference:o=>e({providerUrlReference:o}),clearReferences:()=>bk(e,a),attachCanvasVersionReference:(o,s)=>Ak(o,e,a,s),useCurrentAsReference:()=>Tk(e,a),useImageAsReference:o=>Ck(o,e,a),activeGenerations:0,unseenGeneratedCount:0,inFlight:[],cancelInFlightJob:o=>S_(o,e,a),startInFlightPolling:()=>{hN(e,a)},reconcileInflight:async()=>{await yN(e,a)},syncFromStorage:()=>x_(e,a),currentImage:null,lastHistorySelectedAt:0,applyMergedCanvasImage:o=>A_(o,e),addGeneratedHistoryItem:async o=>{await Ra(o,e,a)},history:[],historyNextCursor:null,historyLoadingOlder:!1,favoriteHistoryNextCursor:null,favoriteHistoryLoadingOlder:!1,loadedHistoryRetainLimit:An,loadOlderHistory:async()=>$N(e,a),loadFavoriteHistory:async()=>YN(e,a),loadOlderFavoriteHistory:async()=>XN(e,a),trashPending:null,toast:null,toastLog:[],customSizeConfirm:null,errorCard:null,errorCardLog:[],rightPanelOpen:IR(),toggleRightPanel:()=>C_(e,a),composeSheetOpen:!1,composeSheetTab:"prompt",openComposeSheet:(o="prompt")=>e({composeSheetOpen:!0,composeSheetTab:o}),setComposeSheetTab:o=>e({composeSheetTab:o}),closeComposeSheet:()=>e({composeSheetOpen:!1}),galleryOpen:!1,openGallery:()=>e(o=>({galleryOpen:!0,galleryScope:o.galleryDefaultScope})),closeGallery:()=>e({galleryOpen:!1}),galleryScope:yy(um),galleryDefaultScope:yy(Dv),setGalleryScope:o=>w_(o,e),setGalleryDefaultScope:o=>I_(o,e),imageModel:hS,reasoningEffort:NR(),webSearchEnabled:_R(),settingsOpen:!1,activeSettingsSection:"providers",readinessPopupOpen:!1,openSettings:(o="providers")=>e({settingsOpen:!0,activeSettingsSection:o}),closeSettings:()=>e({settingsOpen:!1}),toggleSettings:()=>e(o=>({settingsOpen:!o.settingsOpen,activeSettingsSection:o.settingsOpen?o.activeSettingsSection:"providers"})),setActiveSettingsSection:o=>e({activeSettingsSection:o}),openReadinessPopup:()=>e({readinessPopupOpen:!0}),closeReadinessPopup:()=>e({readinessPopupOpen:!1}),uiMode:ER(),setUIMode:o=>E_(o,e),historyStripLayout:RR(),setHistoryStripLayout:o=>R_(o,e),locale:YE(),setLocale:o=>{XE(o),e({locale:o})},graphNodes:[],graphEdges:[],graphHistoryPast:[],graphHistoryFuture:[],recordGraphHistory:o=>{const s=a();e({graphHistoryPast:l1(s.graphHistoryPast,xu(s.graphNodes,s.graphEdges,o)),graphHistoryFuture:[]})},undoGraph:()=>{const o=a(),s=s1(o.graphHistoryPast,xu(o.graphNodes,o.graphEdges,"current"),o.graphHistoryFuture);if(!s)return!1;const c=Cy(s.restored,o.graphNodes);return e({graphNodes:Mn(c.nodes,c.edges),graphEdges:c.edges,graphHistoryPast:s.past,graphHistoryFuture:s.future}),a().scheduleGraphSave(),!0},redoGraph:()=>{const o=a(),s=c1(o.graphHistoryPast,xu(o.graphNodes,o.graphEdges,"current"),o.graphHistoryFuture);if(!s)return!1;const c=Cy(s.restored,o.graphNodes);return e({graphNodes:Mn(c.nodes,c.edges),graphEdges:c.edges,graphHistoryPast:s.past,graphHistoryFuture:s.future}),a().scheduleGraphSave(),!0},setGraphNodes:o=>P_(o,e,a),setGraphEdges:o=>L_(o,e,a),disconnectEdge:o=>{a().disconnectEdges([o])},disconnectEdges:o=>_N(o,e,a),nodeSelectionMode:!1,nodeBatchRunning:!1,nodeBatchStopping:!1,toggleNodeSelectionMode:()=>O_(e,a),selectAllGraphNodes:()=>{e({graphNodes:gi(a().graphNodes,a().graphNodes.map(o=>o.id))})},selectNodeGraph:(o,s)=>j_(o,s,e,a),clearNodeSelection:()=>{e({graphNodes:gi(a().graphNodes,[])})},cancelNodeBatch:()=>G_(e,a),sessions:[],activeSessionId:null,activeSessionGraphVersion:null,sessionLoading:!1,async loadSessions(){await oS(e,a)},async switchSession(o){await lk(o,e,a)},async reconcileGraphPending(){await sk(e,a)},async createAndSwitchSession(o){await ck(o,e,a)},async renameCurrentSession(o){await dk(o,e,a)},async deleteSessionById(o){await uk(o,e,a)},scheduleGraphSave(){Ib(a,e)},async flushGraphSave(o="manual"){await a1(a,e,o)},addRootNode:()=>AN(e,a),createRootNodeFromHistoryItem:o=>TN(o,e,a),addChildNode:o=>CN(o,e,a),addSiblingNode:o=>wN(o,e,a),updateNodePrompt:(o,s)=>RN(o,s,e,a),addNodeReferences:async(o,s)=>PN(o,s,e,a),addNodeReferenceDataUrl:(o,s)=>Xb(o,s,e,a),addNodeReferenceFromUrl:async(o,s,c)=>LN(o,s,c,e,a),removeNodeReference:(o,s)=>ON(o,s,e,a),clearNodeReferences:o=>jN(o,e,a),duplicateBranchRoot:o=>EN(o,e,a),generateNode:o=>dN(o,e,a),generateNodeInPlace:o=>uN(o,e,a),generateNodeVariation:(o,s)=>mN(o,s,e,a),runGenerateNode:(o,s)=>pN(o,s,e,a),async runGenerateNodeInPlace(o,s={}){return $1(o,s,e,a,jt)},async runNodeBatch(o){await Y1(o,e,a)},deleteNode:o=>NN(o,e,a),deleteNodes:o=>kN(o,e,a),addChildNodeAt:(o,s,c)=>IN(o,s,c,e,a),connectNodes:(o,s,c,m)=>MN(o,s,c,m,e,a),setProvider:o=>Bk(o,e,a),setQuality:o=>Vk(o,e),setSizePreset:o=>Kk(o,e),setCustomSize:(o,s)=>$k(o,s,e,a),setGrokAspectRatio:o=>Yk(o,e),setGrokResolution:o=>Xk(o,e),setFormat:o=>Qk(o,e),setModeration:o=>Jk(o,e),setImageModel:o=>Wk(o,e,a),videoModelSelected:ui.model,videoDuration:ui.duration,videoResolution:ui.resolution,videoAspectRatio:ui.aspectRatio,videoTopic:"",videoContinuityLineage:null,videoProgress:null,selectVideoModel:o=>Zk(o,e,a),setVideoDuration:o=>{e({videoDuration:o}),Zo({duration:o})},setVideoResolution:o=>{e({videoResolution:o}),Zo({resolution:o})},setVideoAspectRatio:o=>{e({videoAspectRatio:o}),Zo({aspectRatio:o})},setVideoTopic:o=>e({videoTopic:o}),setVideoContinuityLineage:o=>e({videoContinuityLineage:o}),activeVideoRefCount:()=>e_(a),runVideoGenerate:async o=>{await fN(o,e,a)},animateImage:async(o,s)=>gN(o,s,e,a),setReasoningEffort:o=>t_(o,e),setWebSearchEnabled:o=>n_(o,e),setCount:o=>a_(o,e),setMultimode:o=>o_(o,e,a),setMultimodeMaxImages:o=>r_(o,e),setPromptMode:o=>i_(o,e),setPrompt:o=>l_(o,e),insertPromptToComposer:o=>d_(o,e),removeInsertedPromptFromComposer:o=>u_(o,e),moveInsertedPromptInComposer:(o,s)=>m_(o,s,e),clearInsertedPrompts:()=>p_(e),selectHistory:o=>QN(o,e,a),showHistorySequence:o=>JN(o,e,a),markGeneratedResultsSeen:()=>e({unseenGeneratedCount:0}),selectHistoryShortcutTarget:o=>WN(o,e,a),trashHistoryItem:async o=>ZN(o,e,a),trashHistorySequence:async o=>ek(o,e,a),restorePendingTrash:async()=>tk(e,a),clearPendingTrash:()=>e({trashPending:null}),permanentlyDeleteHistoryItemByClick:async o=>{await a().permanentlyDeleteHistoryItemByShortcut(o)},permanentlyDeleteHistoryItemByShortcut:async o=>nk(o,e,a),removeFromHistory:o=>ak(o,e,a),addHistoryItem:o=>ok(o,e,a),importLocalImageToHistory:async o=>rk(o,e,a),getResolvedSize:()=>s_(a),generate:()=>lN(e,a),async generateMultimode(o){await Z1(o,e,a)},cancelMultimode:()=>sN(e,a),async runGenerate(o){await eN(o,e,a)},confirmCustomSizeAdjustment:()=>cN(e,a),cancelCustomSizeAdjustment:()=>e({customSizeConfirm:null}),hydrateHistory(){ik(e)},showToast:(o,s=!1)=>N_(o,s,e),dismissToast:o=>k_(o,e),showErrorCard:(o,s)=>__(o,s,e),dismissErrorCard:o=>M_(o,e),setWorkspaceProfile(o){e({workspaceProfile:o});try{localStorage.setItem("ima2.workspaceProfile",o)}catch{}},togglePromptBuilder(){e(o=>({promptBuilderOpen:!o.promptBuilderOpen}))},toggleStoryboard(){e(o=>({storyboardActive:!o.storyboardActive}))},setPromptLibraryOpen(o){e({promptLibraryOpen:o})},togglePromptLibrary(){e(o=>({promptLibraryOpen:!o.promptLibraryOpen}))},loadPromptLibrary:()=>f_(e),savePromptToLibrary:o=>g_(o,e,a),deletePromptFromLibrary:o=>h_(o,e,a),togglePromptFavorite:o=>y_(o,e,a),importPromptsToLibrary:o=>v_(o,e,a),toggleGalleryFavorite:o=>b_(o,e,a),openCanvas:()=>e({canvasOpen:!0,canvasZoom:1,canvasPanX:0,canvasPanY:0}),closeCanvas:()=>e({canvasOpen:!1}),setCanvasZoom:o=>e({canvasZoom:Math.max(.5,Math.min(3,o))}),resetCanvasZoom:()=>e({canvasZoom:1,canvasPanX:0,canvasPanY:0}),setCanvasPan:(o,s)=>D_(o,s,e),resetCanvasPan:()=>e({canvasPanX:0,canvasPanY:0}),setCanvasExportBackground:o=>F_(o,e,a),setCanvasExportMatteColor:o=>z_(o,e,a)})),yM=/^[\p{L}\p{N}_-]$/u,vM=new Set([" "," ","(","["]);function bM(e,a){const i=Math.max(0,Math.min(a,e.length));let o=i;for(;o>0&&e[o-1]!=="@"&&e[o-1]!==`
|
|
28
28
|
`;){if(!yM.test(e[o-1]))return null;o-=1}if(o===0||e[o-1]!=="@")return null;const s=o-1,c=e[s-1];return c!==void 0&&!vM.has(c)&&c!==`
|
|
29
29
|
`?null:{start:s,end:i,query:e.slice(o,i)}}function xn({title:e,help:a,items:i,value:o,onChange:s,className:c}){const m=R.useRef(null),p=h=>{if(h.key!=="ArrowLeft"&&h.key!=="ArrowRight")return;const g=i.filter(x=>!x.disabled);if(g.length===0)return;const S=g.findIndex(x=>x.value===o),v=h.key==="ArrowRight"?1:-1,y=g[(S+v+g.length)%g.length];h.preventDefault(),s(y.value),m.current?.querySelector(`[data-value="${y.value}"]`)?.focus()};return d.jsxs("div",{className:`option-group${c?` ${c}`:""}`,children:[e?d.jsx("div",{className:"section-title",children:e}):null,d.jsx("div",{className:"option-row",role:"group",ref:m,onKeyDown:p,children:i.map(h=>d.jsxs("button",{type:"button","data-value":h.value,className:`option-btn${h.value===o?" active":""}`,style:h.color?{color:h.color}:void 0,disabled:h.disabled,"aria-pressed":h.value===o,onClick:()=>s(h.value),children:[h.label,h.sub?d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:h.sub})]}):null]},h.value))}),a?d.jsx("p",{className:"option-help",children:a}):null]})}var Js=mv();function SM(e,a){if(!e||!a)return!0;const i=e.target;return!(i&&typeof i=="object"&&"nodeType"in i&&a.contains(i))}const xM=(e,a)=>{if(e&&e.length>0){const o=e.filter(s=>s.items.length>0);return{flat:o.flatMap(s=>[...s.items]),rendered:o}}const i=a??[];return{flat:[...i],rendered:[{items:i}]}},Py=(e,a,i)=>{if(a==="first"){const o=e.findIndex(s=>!s.disabled);return o>=0?o:i}for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return i};function tr({items:e,groups:a,value:i,onChange:o,ariaLabel:s,className:c,id:m,disabled:p,portal:h=!1,triggerLabel:g,triggerSub:S,placeholder:v,title:y}){const x=R.useId(),E=R.useRef(null),P=R.useRef(null),I=R.useRef(null),[k,C]=R.useState(!1),[_,N]=R.useState({top:0,left:0,width:200,maxHeight:260}),{flat:j,rendered:$}=xM(a,e),L=j.length===0,[J,re]=R.useState(()=>Math.max(0,j.findIndex(T=>T.value===i))),he=R.useRef({buffer:"",at:0}),V=j.find(T=>T.value===i),ee=T=>`${x}-opt-${T}`,oe=T=>T.searchText?T.searchText:typeof T.label=="string"?T.label:T.value,Ne=T=>{const F=Date.now(),W=he.current;W.buffer=F-W.at>1e3?T:W.buffer+T,W.at=F;const U=W.buffer.toLowerCase(),le=W.buffer.length===1?J+1:J;for(let pe=0;pe<j.length;pe+=1){const xe=(le+pe+j.length)%j.length,Oe=j[xe];if(!(!Oe||Oe.disabled)&&oe(Oe).toLowerCase().startsWith(U)){re(xe);return}}};R.useEffect(()=>{if(!k)return;const T=F=>{const W=F.target;W instanceof Node&&(E.current?.contains(W)||I.current?.contains(W)||C(!1))};return document.addEventListener("pointerdown",T),()=>document.removeEventListener("pointerdown",T)},[k]),R.useLayoutEffect(()=>{if(!h||!k)return;const T=P.current?.getBoundingClientRect();if(T){const le=Math.max(0,window.innerWidth-24),pe=Math.min(300,le,Math.max(190,T.width)),xe=Math.max(12,window.innerWidth-pe-12),Oe=Math.min(Math.max(12,T.left),xe),Re=window.innerHeight-T.bottom-12,Ze=T.top-12,ie=Re>=160||Re>=Ze?"down":"up",lt=Math.max(0,ie==="down"?Re:Ze),at=Math.min(420,lt),st=8+j.length*44,bt=I.current?.scrollHeight??st,se=Math.min(bt,at);N({top:ie==="down"?T.bottom+4:Math.max(12,T.top-se-4),left:Oe,width:pe,maxHeight:at})}const F=()=>C(!1),W=U=>{SM(U,I.current)&&C(!1)};return window.addEventListener("resize",F),window.addEventListener("scroll",W,!0),()=>{window.removeEventListener("resize",F),window.removeEventListener("scroll",W,!0)}},[h,k]),R.useEffect(()=>{k&&I.current?.querySelector(`[data-index="${J}"]`)?.scrollIntoView({block:"nearest"})},[k,J]);const ne=()=>{L||(re(Math.max(0,j.findIndex(T=>T.value===i))),C(!0))};R.useEffect(()=>{L&&(C(!1),re(0))},[L]);const H=T=>{let F=J;for(let W=0;W<j.length&&(F=(F+T+j.length)%j.length,!!j[F]?.disabled);W+=1);re(F)},ae=T=>{const F=j[T];!F||F.disabled||(o(F.value),C(!1),P.current?.focus())},ce=T=>{if(!k){["Enter"," ","ArrowDown","ArrowUp"].includes(T.key)&&(T.preventDefault(),ne());return}if(T.key==="Escape")T.preventDefault(),C(!1);else if(T.key==="ArrowDown")T.preventDefault(),H(1);else if(T.key==="ArrowUp")T.preventDefault(),H(-1);else if(T.key==="Home")T.preventDefault(),re(Py(j,"first",J));else if(T.key==="End")T.preventDefault(),re(Py(j,"last",J));else if(T.key==="Enter"||T.key===" "){if(T.key===" "&&Date.now()-he.current.at<=1e3&&he.current.buffer){T.preventDefault(),Ne(" ");return}T.preventDefault(),ae(J)}else T.key==="Tab"?C(!1):T.key.length===1&&!T.metaKey&&!T.ctrlKey&&!T.altKey&&(T.preventDefault(),Ne(T.key))};let be=-1;const Se=k&&!L?d.jsx("ul",{className:`ctl-select__list${h?" ctl-select__list--portal":""}`,role:"listbox",id:x,ref:I,style:h?{position:"fixed",top:_.top,left:_.left,width:_.width,maxHeight:_.maxHeight}:void 0,children:$.map((T,F)=>d.jsxs("li",{role:"presentation",className:"ctl-select__group",children:[T.label?d.jsx("div",{className:"ctl-select__group-label",children:T.label}):null,d.jsx("ul",{role:"group","aria-label":typeof T.label=="string"?T.label:void 0,className:"ctl-select__group-items",children:T.items.map(W=>{be+=1;const U=be;return d.jsxs("li",{role:"option",id:ee(U),"data-index":U,"aria-selected":W.value===i,"aria-disabled":W.disabled||void 0,className:`ctl-select__item${W.value===i?" is-selected":""}${U===J?" is-active":""}${W.disabled?" is-disabled":""}`,onPointerEnter:()=>re(U),onClick:()=>ae(U),children:[d.jsx("span",{className:"ctl-select__item-label",children:W.label}),W.sub?d.jsx("span",{className:"ctl-select__item-sub",children:W.sub}):null]},W.value)})})]},`g-${F}`))}):null;return d.jsxs("div",{className:`ctl-select${c?` ${c}`:""}`,ref:E,children:[d.jsxs("button",{type:"button",id:m,ref:P,className:`ctl-select__trigger${k?" is-open":""}`,role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?x:void 0,"aria-activedescendant":k&&j[J]?ee(J):void 0,"aria-label":s,disabled:p||L,title:y,onClick:()=>k?C(!1):ne(),onKeyDown:ce,children:[d.jsx("span",{className:"ctl-select__value",children:g??V?.label??v??""}),S??V?.sub?d.jsx("span",{className:"ctl-select__value-sub",children:S??V?.sub}):null,d.jsx("svg",{className:"ctl-select__caret",width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true",children:d.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4"})})]}),Se?h?Js.createPortal(Se,document.body):Se:null]})}function AM({checked:e,onChange:a,label:i,ariaLabel:o,className:s,disabled:c,id:m}){return d.jsxs("button",{type:"button",id:m,role:"switch","aria-checked":e,"aria-label":o,disabled:c,className:`ctl-toggle${e?" is-on":""}${s?` ${s}`:""}`,onClick:()=>a(!e),children:[d.jsx("span",{className:"ctl-toggle__track","aria-hidden":"true",children:d.jsx("span",{className:"ctl-toggle__thumb"})}),i?d.jsx("span",{className:"ctl-toggle__label",children:i}):null]})}function yS({selected:e,onSelect:a,onRemove:i,removeLabel:o,disabled:s,className:c,children:m,title:p}){return d.jsxs("span",{className:`ctl-chip${e?" is-selected":""}${s?" is-disabled":""}${c?` ${c}`:""}`,children:[d.jsx("button",{type:"button",className:"ctl-chip__body","aria-pressed":a?e:void 0,disabled:s,title:p,onClick:a,children:m}),i?d.jsx("button",{type:"button",className:"ctl-chip__remove","aria-label":o,disabled:s,onClick:i,children:d.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l6 6M7 1L1 7",stroke:"currentColor",strokeWidth:"1.3"})})}):null]})}function zm({className:e,children:a,ariaLabel:i}){return d.jsx("div",{className:`ctl-chip-row${e?` ${e}`:""}`,role:"group","aria-label":i,children:a})}function TM(){return d.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:d.jsx("path",{d:"m12 2.75 2.78 5.63 6.22.9-4.5 4.39 1.06 6.2L12 16.94 6.44 19.87l1.06-6.2L3 9.28l6.22-.9L12 2.75Z"})})}function vS({active:e,label:a,variant:i,busy:o=!1,onToggle:s}){const c=h=>{h.stopPropagation()},m=h=>{h.stopPropagation()},p=h=>{(h.key==="Enter"||h.key===" ")&&h.stopPropagation()};return d.jsx("button",{type:"button",className:`favorite-star favorite-star--${i}${e?" is-active":""}`,title:a,"aria-label":a,"aria-pressed":e,"aria-busy":o||void 0,disabled:o,onPointerDown:c,onDoubleClick:m,onKeyDown:p,onClick:h=>{h.stopPropagation(),s()},children:d.jsx(TM,{})})}function CM(){return d.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:d.jsx("path",{d:"M4 20h4l10-10a2.5 2.5 0 0 0-3.5-3.5L4.5 16.5 4 20Z",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"})})}const Ly=12,wM=240;function IM(e,a){const i=getComputedStyle(e),o=document.createElement("div");["boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textTransform","textIndent","textAlign","wordSpacing","tabSize"].forEach(g=>{o.style[g]=i[g]}),o.style.cssText+=";position:fixed;visibility:hidden;white-space:pre-wrap;overflow-wrap:break-word;top:0;left:-9999px;",o.textContent=e.value.slice(0,a);const c=document.createElement("span");c.textContent=e.value.slice(a)||".",o.append(c),document.body.append(o);const m=o.getBoundingClientRect(),p=c.getBoundingClientRect();o.remove();const h=e.getBoundingClientRect();return new DOMRect(h.left+p.left-m.left-e.scrollLeft,h.top+p.top-m.top-e.scrollTop,1,p.height||parseFloat(i.lineHeight)||16)}function EM(e,a){const i=IM(e,a),o=window.innerHeight-i.bottom,s=o<wM?"top":"bottom",c=s==="bottom"?o:i.top;return{left:Math.max(Ly,Math.min(i.left,window.innerWidth-332)),top:s==="bottom"?i.bottom+6:Math.max(Ly,i.top-Math.min(320,c-8)),placement:s,maxHeight:Math.max(120,Math.min(320,c-12))}}function RM(){return window.matchMedia("(max-width: 640px)").matches}function NM({open:e,textareaRef:a,caret:i,query:o,elements:s,ariaLabel:c,emptyLabel:m,kindLabel:p,onSelect:h,onClose:g,onActiveChange:S}){const v=R.useId(),[y,x]=R.useState(0),[E,P]=R.useState(null),[I,k]=R.useState(!1),C=R.useRef(null),_=R.useMemo(()=>{const L=o.trim().toLocaleLowerCase();return L?s.filter(J=>[J.name,...J.tags??[]].some(re=>re.toLocaleLowerCase().includes(L))):s},[s,o]),N=L=>{x(L),S?.(L)},j=()=>{const L=_[y];L&&h(L)};if(R.useLayoutEffect(()=>{if(!e||!a.current)return;const L=()=>{if(!a.current){g();return}k(RM()),P(EM(a.current,i))},J=()=>requestAnimationFrame(L);return L(),window.addEventListener("resize",J),a.current.addEventListener("scroll",J),()=>{window.removeEventListener("resize",J),a.current?.removeEventListener("scroll",J)}},[e,a,i,g]),R.useEffect(()=>{N(0)},[o,_.length]),R.useEffect(()=>{if(!e)return;const L=a.current;if(!L)return;L.setAttribute("aria-controls",v),L.setAttribute("aria-expanded","true");const J=re=>{if(document.activeElement===L){if(re.key==="Escape"){re.preventDefault(),g();return}re.key==="ArrowDown"||re.key==="ArrowUp"?(re.preventDefault(),N((y+(re.key==="ArrowDown"?1:-1)+_.length)%Math.max(1,_.length))):re.key==="Home"?(re.preventDefault(),N(0)):re.key==="End"?(re.preventDefault(),N(Math.max(0,_.length-1))):re.key==="Enter"?_.length&&(re.preventDefault(),j()):re.key==="Tab"&&_.length&&j()}};return L.addEventListener("keydown",J),()=>{L.removeAttribute("aria-controls"),L.removeAttribute("aria-expanded"),L.removeAttribute("aria-activedescendant"),L.removeEventListener("keydown",J)}},[e,a,v,y,_,g]),R.useEffect(()=>{const L=a.current,J=_[y];L&&J&&L.setAttribute("aria-activedescendant",`${v}-${J.id}`)},[y,_,v,a]),R.useEffect(()=>{C.current?.querySelector(".is-active")?.scrollIntoView({block:"nearest"})},[y]),!e||!E||typeof document>"u")return null;const $=d.jsx("section",{className:`element-mention-menu${I?" is-mobile":""}`,style:I?void 0:{left:E.left,top:E.top,maxHeight:E.maxHeight},"aria-label":c,children:d.jsx("ul",{id:v,className:"element-mention-menu__list",role:"listbox",ref:C,children:_.length?_.map((L,J)=>d.jsxs("li",{id:`${v}-${L.id}`,role:"option","aria-selected":J===y,className:`element-mention-menu__option${J===y?" is-active":""}`,onPointerEnter:()=>N(J),onMouseDown:re=>{re.preventDefault(),h(L)},children:[L.thumbnail?d.jsx("img",{src:L.thumbnail,alt:"",className:"element-mention-menu__thumbnail"}):d.jsx("span",{className:"element-mention-menu__thumbnail is-empty","aria-hidden":"true"}),d.jsxs("span",{className:"element-mention-menu__copy",children:[d.jsx("strong",{children:L.name}),d.jsx("small",{children:p(L.kind)})]})]},L.id)):d.jsx("li",{className:"element-mention-menu__empty",role:"presentation",children:m})})});return Js.createPortal($,document.body)}function kM(e){if(e)return e.startsWith("/generated/")?e:`/generated/${e.split("/").map(encodeURIComponent).join("/")}`}function _M(e){return e.kind==="attachment"?e.source.dataUrl:e.source.thumbnailUrl??kM(e.source.referenceFilenames[0])}function MM({items:e,limit:a,onRemove:i,onAdd:o}){const{t:s}=ge(),c=e.length>a,m=e.length>=a;return d.jsxs("div",{className:"composer__tray-wrap",children:[d.jsxs("div",{className:"composer__tray",role:"list","aria-label":s("prompt.trayAria",{count:e.length,max:a}),children:[e.map((p,h)=>{const g=_M(p);return d.jsxs("div",{className:"composer__tray-slot",role:"listitem","aria-label":`@${p.tag}, ${h+1}/${a}`,children:[d.jsxs("span",{className:"composer__tray-thumbnail",children:[g?d.jsx("img",{src:g,alt:"",loading:"lazy",decoding:"async"}):d.jsx("span",{className:"composer__tray-thumbnail-empty","aria-hidden":"true",children:"@"}),d.jsx("button",{type:"button",className:"composer__tray-remove",onClick:()=>i(p.tokenId),"aria-label":`${s("prompt.refRemoveAria",{n:h+1})}: @${p.tag}`,children:"×"})]}),d.jsxs("span",{className:"composer__tray-tag",title:`@${p.tag}`,children:["@",p.tag]})]},p.tokenId)}),d.jsx("button",{type:"button",className:"composer__tray-slot composer__tray-slot--add",onClick:o,disabled:m,"aria-label":s("prompt.attachTitle"),title:s("prompt.attachTitle"),children:d.jsx("span",{"aria-hidden":"true",children:"+"})})]}),c?d.jsx("p",{className:"composer__ref-warning",role:"alert",children:s("prompt.refOverProviderLimit",{max:a,excess:e.length-a})}):null]})}function PM({kind:e="character"}){const a={character:"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm-5 6c.4-2.2 2.2-3.5 5-3.5s4.6 1.3 5 3.5",product:"M3 5.5 8 2l5 3.5v6L8 15l-5-3.5v-6ZM3 5.5 8 9l5-3.5M8 9v6",style:"m3 11 5-8 5 8-5 2-5-2Zm5-8v10",scene:"M2 13 6.5 8l3 3 2-2 2.5 4H2ZM2 3h12v12H2z",reference:"M2 3h12v10H2zM2 10l3.5-3.5 3 3L11 7l3 3"};return d.jsx("svg",{className:"element-mention-chip__kind",viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:a[e]})})}function LM({elementId:e,name:a,kind:i,thumbnail:o,missing:s,ariaLabel:c,unavailableLabel:m,removeLabel:p,onRemove:h,onOpen:g}){return d.jsxs("span",{className:`element-mention-chip${s?" is-missing":""}`,"data-element-id":e,children:[d.jsxs("button",{type:"button",className:"element-mention-chip__body",onClick:()=>g?.(e),"aria-label":c,children:[o?d.jsx("img",{className:"element-mention-chip__thumbnail",src:o,alt:""}):d.jsx("span",{className:"element-mention-chip__thumbnail is-empty","aria-hidden":"true"}),s?d.jsx("span",{className:"element-mention-chip__warning","aria-label":m,children:"!"}):d.jsx(PM,{kind:i}),d.jsx("span",{className:"element-mention-chip__name",children:a})]}),d.jsx("button",{type:"button",className:"element-mention-chip__remove",onClick:()=>h(e),"aria-label":p,children:d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"m4 4 8 8m0-8-8 8"})})})]})}const OM=new Set(["character","product","style","scene"]);function jM(e){const a=e?.metadata?.elementKind;return typeof a=="string"&&OM.has(a)?a:"character"}function GM(e){if(!e)return;const a=e.metadata?.refs,i=Array.isArray(a)?a.find(o=>typeof o=="string"&&o.length>0):void 0;return i?`/generated/${i.split("/").map(encodeURIComponent).join("/")}`:void 0}function DM(e,a,i){const o=new Map((a??[]).map(c=>[c.id,c])),s=new Set(i);return Pb({trayItems:[...e]}).map(c=>{const m=o.get(c.source.elementId);return{elementId:c.source.elementId,name:m?.name??c.source.nameAtInsertion,kind:jM(m),thumbnail:GM(m)??c.source.thumbnailUrl,missing:s.has(c.source.elementId)||a!==null&&!m}})}function FM(e){const a=DM(e.items,e.assets,e.missingElementIds);return a.length===0?null:d.jsx(zm,{ariaLabel:e.selectedLabel,children:a.map(i=>{const o=e.kindLabel(i.kind);return d.jsx(LM,{...i,ariaLabel:e.mentionLabel(i.name,o,i.missing),unavailableLabel:e.unavailableLabel,removeLabel:e.removeLabel(i.name),onRemove:e.onRemove},i.elementId)})})}const zM=["boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textTransform","textIndent","textAlign","wordSpacing","tabSize","whiteSpace","overflowWrap","wordBreak"];function qM({prompt:e,retiredTags:a,textareaRef:i}){const{t:o}=ge(),s=R.useRef(null),c=R.useRef(null),[m,p]=R.useState([]),h=R.useMemo(()=>z1(e).filter(S=>Object.prototype.hasOwnProperty.call(a,S.tag)),[e,a]),g=R.useMemo(()=>[...new Set(h.map(S=>`@${S.tag}`))],[h]);return R.useLayoutEffect(()=>{const S=i.current,v=s.current,y=c.current?.firstChild;if(!S||!v||!(y instanceof Text)){p([]);return}const x=()=>{const P=getComputedStyle(S);zM.forEach(C=>{v.style[C]=P[C]}),v.scrollTop=S.scrollTop,v.scrollLeft=S.scrollLeft;const I=v.getBoundingClientRect(),k=[];for(const C of h){const _=document.createRange();_.setStart(y,C.start),_.setEnd(y,C.end),Array.from(_.getClientRects()).forEach((N,j)=>{k.push({key:`${C.start}-${C.end}-${j}`,left:N.left-I.left+v.scrollLeft,top:N.top-I.top+v.scrollTop,width:N.width,height:N.height})})}p(k)};x(),S.addEventListener("scroll",x,{passive:!0});const E=new ResizeObserver(x);return E.observe(S),()=>{S.removeEventListener("scroll",x),E.disconnect()}},[i,e,h]),d.jsxs(d.Fragment,{children:[d.jsxs("div",{ref:s,className:"composer__prompt-mirror","aria-hidden":"true",children:[d.jsx("span",{ref:c,children:e}),m.map(S=>d.jsx("span",{className:"dead-tag",style:S},S.key))]}),d.jsx("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:g.length>0?o("prompt.deadTagStatus",{tags:g.join(", ")}):""})]})}async function Ws(e){const a=w.getState(),i=gt(e),o=!!e.prompt;if(a.clearReferences(),a.setPrompt(o&&!i?e.prompt:""),i){const s=e.url||e.image,c=await cr(s);a.addReferenceDataUrl(c);const m=Hb(e);a.setVideoContinuityLineage(m),m&&a.insertPromptToComposer(iN(m)),e.videoSeries?.topic&&a.setVideoTopic(e.videoSeries.topic),a.videoModelSelected||a.selectVideoModel("grok-imagine-video-1.5")}else await a.useImageAsReference(e);return{ok:!0,isVideo:i,hasPrompt:o}}async function bS(e){const a=await Ws(e);return e.providerUrl&&w.getState().setProviderUrlReference(e.providerUrl),a}const UM=Object.freeze(Object.defineProperty({__proto__:null,continueFromItem:Ws,continueFromItemAsUrl:bS},Symbol.toStringTag,{value:"Module"}));function HM({text:e,mode:a,onClose:i}){const{t:o}=ge(),s=w(E=>E.savePromptToLibrary),[c,m]=R.useState(e.slice(0,30)),[p,h]=R.useState(e),[g,S]=R.useState(""),[v,y]=R.useState(!1),x=async()=>{p.trim()&&(y(!0),await s({name:c.trim()||p.slice(0,30),text:p.trim(),tags:g.split(",").map(E=>E.trim()).filter(Boolean),mode:a||void 0}),y(!1),i())};return d.jsxs("div",{className:"save-prompt-popover",onClick:E=>E.stopPropagation(),children:[d.jsxs("div",{className:"save-prompt-popover__header",children:[d.jsx("span",{children:o("promptLibrary.saveTitle")}),d.jsx("button",{className:"save-prompt-popover__close",onClick:i,"aria-label":o("common.close"),children:"×"})]}),d.jsxs("div",{className:"save-prompt-popover__body",children:[d.jsxs("label",{children:[o("promptLibrary.name"),d.jsx("input",{type:"text",value:c,onChange:E=>m(E.target.value),placeholder:p.slice(0,30)})]}),d.jsxs("label",{children:[o("promptLibrary.content"),d.jsx("textarea",{value:p,onChange:E=>h(E.target.value),placeholder:o("common.enterPrompt"),rows:4,autoFocus:!0})]}),d.jsxs("label",{children:[o("promptLibrary.tags"),d.jsx("input",{type:"text",value:g,onChange:E=>S(E.target.value),placeholder:"cta, product, summer"})]})]}),d.jsx("div",{className:"save-prompt-popover__footer",children:d.jsx("button",{onClick:x,disabled:v||!p.trim(),className:"save-prompt-popover__save",children:o(v?"common.saving":"promptLibrary.save")})})]})}function BM({variant:e="label"}){const{t:a}=ge(),i=w(c=>c.webSearchEnabled),o=w(c=>c.setWebSearchEnabled),s=a(i?"settings.webSearch.on":"settings.webSearch.off");return e==="label"?d.jsx(AM,{checked:i,onChange:o,label:s,className:"web-search-toggle web-search-toggle--label"}):d.jsx("button",{type:"button",className:`${e==="compact"?"composer__tool ":""}web-search-toggle web-search-toggle--${e}${i?" is-active":""}`,onClick:()=>o(!i),"aria-pressed":i,"aria-label":s,title:s,children:e==="compact"?d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("path",{d:"M2 12h20"}),d.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 0 20"}),d.jsx("path",{d:"M12 2a15.3 15.3 0 0 0 0 20"})]}):d.jsx("span",{children:s})})}function VM({canAddMore:e,onAttach:a}){const{t:i}=ge(),o=w(P=>P.prompt),s=w(P=>P.currentImage),c=w(P=>P.videoModelSelected),m=w(P=>P.selectVideoModel),p=w(P=>P.setImageModel),h=w(P=>P.promptMode),g=w(P=>P.setPromptMode),S=w(P=>P.storyboardActive),v=w(P=>P.toggleStoryboard),[y,x]=R.useState(!1),E=h==="direct";return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"composer__hint-row",children:d.jsx("span",{className:"composer__hint",children:i("prompt.hint")})}),d.jsxs("div",{className:"composer__toolbar",children:[d.jsx("button",{type:"button",className:"composer__tool",onClick:a,disabled:!e,title:i("prompt.attachTitle"),"aria-label":i("prompt.attachTitle"),children:d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),d.jsx("button",{type:"button",className:"composer__tool",onClick:()=>s&&void Ws(s).catch(()=>{}),disabled:!s||!e,title:i("prompt.continueTitle"),children:i("prompt.continue")}),d.jsx("button",{type:"button",className:`composer__tool${c?" composer__tool--on":""}`,onClick:()=>{c?p("gpt-5.6-luna"):m("grok-imagine-video-1.5")},title:i("prompt.videoToggleTitle"),"aria-label":i("prompt.videoToggleTitle"),"aria-pressed":!!c,children:d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("polygon",{points:"23 7 16 12 23 17 23 7"}),d.jsx("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})]})}),d.jsx("button",{type:"button",className:`composer__tool${E?" composer__tool--on":""}`,onClick:()=>g(E?"auto":"direct"),title:i("prompt.directModeTitle"),"aria-label":i("prompt.directModeTitle"),"aria-pressed":E,children:d.jsx("span",{"aria-hidden":"true",style:{fontWeight:700,fontSize:11},children:"1:1"})}),d.jsx(BM,{variant:"compact"}),d.jsxs("div",{className:"composer__tool-wrap",children:[d.jsx("button",{type:"button",className:"composer__tool composer__tool--full",onClick:()=>x(P=>!P),disabled:!o.trim(),title:i("promptLibrary.saveTitle"),"aria-label":i("promptLibrary.saveTitle"),children:i("prompt.savePrompt")}),y&&d.jsx(HM,{text:o,mode:h,onClose:()=>x(!1)})]})]}),d.jsx("div",{className:"composer__storyboard-row",children:d.jsx("button",{type:"button",className:`composer__tool composer__tool--storyboard${S?" composer__tool--on":""}`,onClick:v,title:i("prompt.storyboardTitle"),"aria-pressed":S,children:i("prompt.storyboard")})})]})}function Oy(e){return e?Array.from(e).flatMap(a=>{if(a.kind!=="file"||!a.type.startsWith("image/"))return[];const i=a.getAsFile();return i?[i]:[]}):[]}function KM(e){const{maxRefs:a,trayItemCount:i,captureAttachmentCaret:o,addFilesAtCaret:s}=e,{t:c}=ge(),m=async(h,g)=>{const S=Math.max(0,a-i);if(S===0){w.getState().showToast(c("toast.refLimitTrayFull",{max:a}),!0);return}const v=h.slice(0,S),y=await s(v,g,!1);h.length>v.length&&w.getState().showToast(c("toast.refLimitPartial",{added:y,total:h.length,max:a}),!1)},p=h=>{const g=Oy(h.clipboardData?.items??null);g.length!==0&&(h.preventDefault(),m(g,o()))};return R.useEffect(()=>{const h=g=>{const S=g.target;if(["INPUT","TEXTAREA"].includes(S?.tagName??"")||S?.isContentEditable)return;const v=Oy(g.clipboardData?.items??null);v.length!==0&&(g.preventDefault(),m(v,w.getState().prompt.length))};return window.addEventListener("paste",h),()=>window.removeEventListener("paste",h)},[s,a,c,i]),p}const wu="tray:";function jy(e){return`${e.start}:${e.end}:${e.query}`}function $M(e){const a=w.getState();return a.addElementFromMention?a.addElementFromMention(e):gs(e.id,w.setState,w.getState,e)}function YM(e){const a=w.getState();a.syncElementCatalog?a.syncElementCatalog(e):Gb(e,w.setState,w.getState)}function XM(e){const a=Number.parseFloat(e);return Number.isFinite(a)&&a>0?a:null}function qm({variant:e="sidebar"}){const a=w(D=>D.prompt),i=w(D=>D.setPrompt),o=w(D=>D.insertedPrompts),s=w(D=>D.removeInsertedPromptFromComposer),c=w(D=>D.moveInsertedPromptInComposer),m=w(D=>D.generate),p=w(D=>D.selectedPresetIds),h=w(D=>D.removePreset),g=w(D=>D),S=g.addElementId,v=g.elementCatalog??null,y=g.missingElementIds??[],[x,E]=R.useState([]),P=D=>{const Ae=x.find(ke=>ke.id===D);return Ae?$M(Ae):(S?.(D),null)};R.useEffect(()=>{let D=!1;return M1().then(Ae=>{D||(E(Ae),YM(Ae))}).catch(Ae=>console.error("[ElementMention] load failed",Ae)),()=>{D=!0}},[]);const{t:I}=ge(),k=w(D=>D.trayItems),C=w(D=>D.retiredTags),_=w(D=>D.removeTrayItem),N=w(D=>D.activeReferenceLimit()),j=w(D=>D.providerUrlReference),$=w(D=>D.setProviderUrlReference),L=w(D=>D.addReferences),J=w(D=>D.addReferenceDataUrl),re=w(D=>D.useImageAsReference),he=w(D=>D.readDroppedImageMetadata),V=R.useRef(null),ee=R.useRef(null),oe=R.useRef(null),[Ne,ne]=R.useState(!1),[H,ae]=R.useState(null),ce=R.useRef(!1),be=R.useRef(null),Se=R.useRef(null),T=w(D=>D.promptMode),F=w(D=>D.multimode),W=w(D=>D.multimodeMaxImages),U=T==="direct",le=o.filter(D=>D.placement!=="after"),pe=o.filter(D=>D.placement==="after"),xe=[...le.map(D=>D.id),"__main_prompt__",...pe.map(D=>D.id)],Oe=k.length<N,Re=F?k.length>0?I("multimode.promptPlaceholderWithRefs"):I("multimode.promptPlaceholder"):k.length>0?I("prompt.placeholderWithRefs"):I("prompt.placeholder"),Ze=()=>ee.current?.selectionStart??w.getState().prompt.length,ie=(D,Ae)=>{const ke=w.getState().trayItems.filter(At=>At.kind==="attachment"&&!D.has(At.tokenId));if(ke.length===0)return 0;const Qe=w.getState().prompt,pt=Math.max(0,Math.min(Ae,Qe.length)),Dt=ke.map(At=>`@${At.tag} `).join("");i(`${Qe.slice(0,pt)}${Dt}${Qe.slice(pt)}`);const _a=pt+Dt.length;return requestAnimationFrame(()=>ee.current?.setSelectionRange(_a,_a)),ke.length},lt=(D,Ae)=>{const ke=`@${D} `,Qe=w.getState().prompt,pt=`${Qe.slice(0,Ae.start)}${ke}${Qe.slice(Ae.end)}`,Dt=Ae.start+ke.length;i(pt),requestAnimationFrame(()=>ee.current?.setSelectionRange(Dt,Dt))},at=(D,Ae)=>{if(ce.current)return;const ke=bM(D,Ae);ae(ke&&jy(ke)!==Se.current?ke:null)},st=async(D,Ae,ke)=>{if(D.length===0)return 0;const Qe=new Set(w.getState().trayItems.map(pt=>pt.tokenId));try{return ke&&D.length===1&&await he(D[0])?0:(await L(D),ie(Qe,Ae))}catch{return 0}},bt=async D=>{const Ae=oe.current??Ze();oe.current=null,await st(D,Ae,!0)},se=()=>{Oe&&(oe.current=Ze(),V.current?.click())},qe=async(D,Ae)=>{const ke=new Set(w.getState().trayItems.map(Qe=>Qe.tokenId));try{const Qe=D.url||D.image;if(!Qe)return;const pt={image:Qe,url:D.url,filename:D.filename};if(gt(pt)){const Dt=await cr(Qe);Dt&&J(Dt)}else await re(pt);ie(ke,Ae)}catch{}},ot=D=>{D.preventDefault(),ne(!1);const Ae=D.dataTransfer.getData("application/ima2-ref");if(Ae){try{const Qe=JSON.parse(Ae);qe(Qe,Ze())}catch{}return}const ke=Array.from(D.dataTransfer.files).filter(Qe=>Qe.type.startsWith("image/"));ke.length>0&&bt(ke)},St=D=>{D.preventDefault(),Ne||ne(!0)},xt=D=>{D.currentTarget.contains(D.relatedTarget)||ne(!1)},nn=KM({maxRefs:N,trayItemCount:k.length,captureAttachmentCaret:Ze,addFilesAtCaret:st}),Yt=R.useRef(null),fn=R.useRef(e);R.useLayoutEffect(()=>{const D=ee.current;if(!D)return;(Yt.current===null||fn.current!==e)&&(Yt.current=XM(window.getComputedStyle(D).maxHeight)??0,fn.current=e),D.style.height="auto";const Ae=Yt.current,ke=Ae?Math.min(D.scrollHeight,Ae):D.scrollHeight;D.style.height=`${ke}px`},[a,e]);const et=(D,Ae)=>{const ke=xe.indexOf(D);return ke<0?!1:Ae==="up"?ke>0:ke<xe.length-1},On=D=>d.jsxs("div",{className:"composer__prompt-chip",title:D.name,children:[d.jsx("span",{className:"composer__prompt-chip-plus","aria-hidden":"true",children:"+"}),d.jsx("span",{className:"composer__prompt-chip-title",children:D.name}),d.jsxs("div",{className:"composer__prompt-chip-actions",children:[d.jsx("button",{type:"button",className:"composer__prompt-chip-move",onClick:()=>c(D.id,"up"),disabled:!et(D.id,"up"),"aria-label":I("prompt.moveBlockUp",{name:D.name}),title:I("prompt.moveBlockUp",{name:D.name}),children:"^"}),d.jsx("button",{type:"button",className:"composer__prompt-chip-move",onClick:()=>c(D.id,"down"),disabled:!et(D.id,"down"),"aria-label":I("prompt.moveBlockDown",{name:D.name}),title:I("prompt.moveBlockDown",{name:D.name}),children:"v"}),d.jsx("button",{type:"button",className:"composer__prompt-chip-remove",onClick:()=>s(D.id),"aria-label":I("promptLibrary.removeInserted",{name:D.name}),children:"x"})]})]},D.id);return d.jsxs("div",{className:`composer composer--${e}${Ne?" composer--drag":""}${U?" composer--direct":""}${F?" composer--multimode":""}${U&&F?" composer--combined-modes":""}`,role:"group","aria-label":F?I("multimode.composerAriaLabel",{count:W}):I("prompt.label"),onDrop:ot,onDragOver:St,onDragLeave:xt,onPaste:nn,children:[d.jsxs("div",{className:"composer__header",children:[d.jsx("span",{className:"section-title composer__label",children:I("prompt.label")}),d.jsxs("div",{className:"composer__header-meta",children:[F&&d.jsx("span",{className:"composer__mode-badge",children:I("multimode.composerBadge",{count:W})}),U&&d.jsx("span",{className:"composer__direct-badge",children:I("prompt.directModeActive")}),j&&d.jsxs("button",{type:"button",className:"composer__url-ref-badge",onClick:()=>$(null),title:I("prompt.urlRefActiveTitle"),"aria-label":I("prompt.urlRefClear"),children:[d.jsx("span",{className:"composer__url-ref-dot","aria-hidden":"true"}),I("prompt.urlRefActive")]}),k.length>0&&d.jsx("span",{className:"composer__count",children:I("prompt.refCount",{count:k.length,max:N})})]})]}),d.jsx(MM,{items:k,limit:N,onRemove:_,onAdd:se}),le.length>0&&d.jsx("div",{className:"composer__prompt-chips",children:le.map(On)}),p.length>0&&d.jsx(zm,{ariaLabel:I("home.selectedPresets"),children:p.map(D=>{const Ae=zb(D);return Ae?d.jsx(yS,{onRemove:()=>h(D),removeLabel:I("common.removeNamed",{name:Ae.name}),children:Ae.name},D):null})}),d.jsx(FM,{items:k,assets:v,missingElementIds:y,selectedLabel:I("element.selected"),unavailableLabel:I("common.elementUnavailable"),kindLabel:D=>I(`element.kind${D[0].toUpperCase()}${D.slice(1)}`),mentionLabel:(D,Ae,ke)=>ke?I("element.unavailableAria",{name:D}):I("element.mentionAria",{name:D,kind:Ae}),removeLabel:D=>I("element.removeAria",{name:D}),onRemove:D=>g.removeElementId?.(D)}),d.jsxs("div",{className:"composer__prompt-stack",children:[d.jsx(qM,{prompt:a,retiredTags:C,textareaRef:ee}),d.jsx("textarea",{ref:ee,className:"prompt-area composer__textarea",value:a,placeholder:Re,onCompositionStart:()=>{ce.current=!0,ae(null)},onCompositionEnd:D=>{ce.current=!1,be.current=D.currentTarget.value,queueMicrotask(()=>{be.current=null}),at(D.currentTarget.value,D.currentTarget.selectionStart)},onChange:D=>{Se.current=null,i(D.target.value),be.current!==D.target.value&&at(D.target.value,D.target.selectionStart)},onClick:D=>at(D.currentTarget.value,D.currentTarget.selectionStart),onKeyDown:D=>{if(D.key==="Escape"&&H){D.preventDefault(),Se.current=jy(H),ae(null);return}if(D.key==="Enter"&&(D.metaKey||D.ctrlKey)){if(D.preventDefault(),y.length>0)return;m()}}})]}),d.jsx(NM,{open:H!==null,textareaRef:ee,caret:H?.end??0,query:H?.query??"",elements:[...k.filter(D=>D.kind==="attachment").map(D=>({id:`${wu}${D.tokenId}`,name:D.tag,kind:"reference",thumbnail:D.source.dataUrl})),...x.map(D=>{const Ae=kb(D);return{id:D.id,name:D.name,kind:typeof D.metadata?.elementKind=="string"?D.metadata.elementKind:"character",thumbnail:Ae?`/generated/${Ae.split("/").map(encodeURIComponent).join("/")}`:void 0,tags:D.tags}})],ariaLabel:I("common.elementSuggestions"),emptyLabel:I("common.noMatchingElements"),kindLabel:D=>I(`element.kind${D[0].toUpperCase()}${D.slice(1)}`),onSelect:D=>{const Ae=Wu(w.getState().trayItems,D.id);if(D.id.startsWith(wu)){const Qe=D.id.slice(wu.length),pt=w.getState().trayItems.find(Dt=>Dt.tokenId===Qe);pt&&H&<(pt.tag,H),ae(null);return}if(P?.(D.id),Ae){requestAnimationFrame(()=>document.querySelector(`[data-element-id="${CSS.escape(D.id)}"] .element-mention-chip__body`)?.focus()),ae(null);return}const ke=Wu(w.getState().trayItems,D.id);!ke||!H||(lt(ke.tag,H),ae(null))},onClose:()=>ae(null)}),pe.length>0&&d.jsxs("div",{className:"composer__prompt-chips composer__prompt-chips--after",children:[d.jsx("span",{className:"composer__prompt-chips-label",children:I("prompt.afterBlocks")}),pe.map(On)]}),d.jsx(VM,{canAddMore:Oe,onAttach:se}),Ne&&d.jsx("div",{className:"composer__dropzone","aria-hidden":"true",children:I("prompt.dropHere",{max:N})}),d.jsx("input",{ref:V,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:D=>{const Ae=Array.from(D.target.files??[]);Ae.length>0?bt(Ae):oe.current=null,D.target.value=""}})]})}function Um(){const e=w(p=>p.activeGenerations),a=w(p=>p.generate),i=w(p=>p.openReadinessPopup),o=w(p=>p.missingElementIds??[]),{t:s}=ge(),c=e>0,m=o.length>0;return d.jsxs("div",{className:"generate-row",children:[d.jsxs("button",{type:"button",className:`generate-btn foil-hover${c?" generate-btn--active":""}`,disabled:m,title:m?s("toast.missingElements"):void 0,onClick:()=>{a()},children:[s("generate.button"),c?d.jsx("span",{className:"generate-btn__count","aria-label":s("generate.buttonLoading",{n:e}),children:e}):null]}),d.jsx("button",{type:"button",className:"generate-row__readiness",onClick:i,title:s("readiness.openTitle"),"aria-label":s("readiness.openTitle"),children:"?"})]})}function SS(e,a=28){const i=e.trim().replace(/\s+/g," ");return i.length>a?`${i.slice(0,a)}...`:i}function Hm(e={}){const a=w(m=>m.inFlight),i=w(m=>m.cancelInFlightJob),o=w(m=>m.videoProgress),{t:s}=ge(),c={queued:s("inflight.queued"),planning:s("inflight.planning"),streaming:s("inflight.streaming"),decoding:s("inflight.decoding"),canceling:s("inflight.canceling")};return a.length===0?null:"panelId"in e?d.jsx(WM,{jobs:a,phaseLabels:c,videoProgress:o,cancelInFlightJob:i,t:s,variant:e.variant,panelId:e.panelId}):d.jsx(QM,{jobs:a,phaseLabels:c,videoProgress:o,cancelInFlightJob:i,t:s})}function QM(e){return d.jsx("ul",{className:"in-flight-list",children:e.jobs.map(a=>d.jsx(JM,{f:a,...e},a.id))})}function JM({f:e,phaseLabels:a,videoProgress:i,cancelInFlightJob:o,t:s}){const c=e.phase?a[e.phase]??e.phase:s("inflight.queued"),p=e.prompt.trim().replace(/\s+/g," ")||s("inflight.noPrompt");return d.jsxs("li",{className:"in-flight-item","data-phase":e.phase??"queued",title:p,"aria-label":`${c}: ${p}`,children:[d.jsx("span",{className:"in-flight-prompt",children:SS(e.prompt)}),d.jsx("span",{className:"in-flight-phase",children:e.kind==="video"&&i!=null&&i>0?`${Math.round(i*100)}%`:c}),d.jsx("button",{type:"button",className:"in-flight-cancel",onClick:()=>{o(e.id)},disabled:e.phase==="canceling","aria-label":s("inflight.cancelAria",{prompt:p}),title:s("common.cancel"),children:"×"}),d.jsx("span",{className:"in-flight-spinner","aria-hidden":"true","data-motion-essential":!0})]})}function WM(e){const a=e.jobs.filter(s=>s.kind==="video"||s.kind==="mcp-video"),i=a.length===1?a[0]?.id:null,o=e.videoProgress!=null&&e.videoProgress>=0&&e.videoProgress<=1?e.videoProgress:null;return d.jsx("ul",{id:e.panelId,className:`in-flight-list in-flight-list--${e.variant}`,children:e.jobs.map(s=>d.jsx(ZM,{f:s,determinateVideoId:i,validVideoProgress:o,...e},s.id))})}function ZM({f:e,determinateVideoId:a,validVideoProgress:i,phaseLabels:o,cancelInFlightJob:s,t:c}){const m=e.phase?o[e.phase]??e.phase:c("inflight.queued"),h=e.prompt.trim().replace(/\s+/g," ")||c("inflight.noPrompt"),g=e.kind==="video"||e.kind==="mcp-video",S=t2(e)??n2(e.kind,c),v=e.id===a&&i!=null?Math.round(i*100):null;return d.jsxs("li",{className:"in-flight-rich-item","data-phase":e.phase??"queued",title:h,"aria-label":`${S}, ${m}: ${h}`,children:[d.jsx("span",{className:`in-flight-placeholder${g?" in-flight-placeholder--video":""}`,"aria-hidden":"true",children:d.jsx(a2,{video:g})}),d.jsxs("span",{className:"in-flight-rich-copy",children:[d.jsx("span",{className:"in-flight-rich-title",children:S}),d.jsx("span",{className:"in-flight-rich-prompt",title:h,children:SS(e.prompt,54)}),d.jsxs("span",{className:"in-flight-rich-status",children:[d.jsx("span",{className:"in-flight-phase",children:v==null?m:`${m} · ${v}%`}),d.jsx(e2,{progressPercent:v,phaseLabel:m,t:c})]})]}),d.jsx("button",{type:"button",className:"in-flight-cancel",onClick:()=>{s(e.id)},disabled:e.phase==="canceling","aria-label":c("inflight.cancelAria",{prompt:h}),title:c("common.cancel"),children:"×"})]})}function e2({progressPercent:e,phaseLabel:a,t:i}){return d.jsx("span",{className:`in-flight-progress${e==null?" in-flight-progress--indeterminate":""}`,role:"progressbar","data-motion-essential":!0,"aria-label":e==null?a:i("inflight.progressAria",{n:e}),"aria-valuemin":e==null?void 0:0,"aria-valuemax":e==null?void 0:100,"aria-valuenow":e??void 0,children:d.jsx("span",{style:e==null?void 0:{width:`${e}%`}})})}function t2(e){return!("model"in e)||typeof e.model!="string"?null:e.model.trim()||null}function n2(e,a){return e?.startsWith("mcp-")?a("inflight.kindMcp"):a(e==="video"?"inflight.kindVideo":e==="node"?"inflight.kindNode":"inflight.kindImage")}function a2({video:e}){return d.jsxs("svg",{viewBox:"0 0 24 24",focusable:"false",children:[d.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),e?d.jsx("path",{d:"m10 9 5 3-5 3Z"}):d.jsxs(d.Fragment,{children:[d.jsx("circle",{cx:"9",cy:"9",r:"1.5"}),d.jsx("path",{d:"m5.5 17 4.2-4 2.7 2.4 2.2-2 3.9 3.6"})]})]})}const Gy="(max-width: 800px)";function ka(){const[e,a]=R.useState(()=>typeof window<"u"?window.matchMedia(Gy).matches:!1);return R.useEffect(()=>{if(typeof window>"u")return;const i=window.matchMedia(Gy),o=()=>a(i.matches);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[]),e}const o2=10,wa=12;function r2({anchorRef:e,panelId:a,focusOnOpen:i,onRequestClose:o,onPointerEnter:s,onPointerLeave:c}){const{t:m}=ge(),p=R.useRef(null),h=R.useRef(null),g=R.useRef(null),[S,v]=R.useState({left:wa,top:wa,caretTop:24}),[y,x]=R.useState(!1);R.useLayoutEffect(()=>{const I=()=>{const _=e.current,N=p.current;if(!_||!N)return;const j=_.getBoundingClientRect(),$=_.closest(".sidebar")?.getBoundingClientRect(),L=N.getBoundingClientRect(),J=$?$.right:j.right,re=Math.max(wa,window.innerWidth-L.width-wa),he=Math.max(wa,window.innerHeight-L.height-wa),V=Math.min(Math.max(J+o2,wa),re),ee=Math.min(Math.max(j.bottom-L.height,wa),he),oe=Math.min(Math.max(j.top+j.height/2-ee,16),L.height-16);v({left:V,top:ee,caretTop:oe}),x(!0)},k=()=>{g.current!=null&&cancelAnimationFrame(g.current),g.current=requestAnimationFrame(I)};I(),window.addEventListener("resize",k),window.addEventListener("scroll",k,!0);const C=new ResizeObserver(k);return e.current&&C.observe(e.current),p.current&&C.observe(p.current),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0),C.disconnect(),g.current!=null&&cancelAnimationFrame(g.current)}},[e]),R.useLayoutEffect(()=>{i&&h.current?.focus()},[i]),R.useEffect(()=>{const I=C=>{const _=C.target;_&&(e.current?.contains(_)||p.current?.contains(_))||o(!1)},k=C=>{C.key==="Escape"&&(C.preventDefault(),o(!0))};return document.addEventListener("pointerdown",I,!0),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",I,!0),document.removeEventListener("keydown",k)}},[e,o]);const E=`${a}-title`,P={left:S.left,top:S.top,"--inflight-caret-top":`${S.caretTop}px`};return Js.createPortal(d.jsxs("div",{ref:p,className:"inflight-popup",role:"dialog","aria-modal":"false","aria-labelledby":E,"data-positioned":y,style:P,onPointerEnter:s,onPointerLeave:c,children:[d.jsxs("header",{className:"inflight-popup__header",children:[d.jsx("h2",{ref:h,id:E,tabIndex:-1,children:m("inflight.title")}),d.jsx("button",{type:"button",className:"inflight-popup__close","aria-label":m("common.close"),title:m("common.close"),onClick:()=>o(!0),children:d.jsx("span",{"aria-hidden":"true",children:"×"})})]}),d.jsx(Hm,{variant:"popup",panelId:a}),d.jsx("footer",{className:"inflight-popup__footer",children:m("inflight.footerHint")})]}),document.body)}const i2=180,l2=180;function xS({variant:e="popup",panelId:a,expanded:i=!1,onToggle:o}){const s=w(he=>he.inFlight.length),c=ka(),{t:m}=ge(),[p,h]=R.useState("closed"),[g,S]=R.useState(!1),v=R.useRef(null),y=R.useRef(null),x=R.useRef(null),E=e==="inline"?i:p!=="closed",P=()=>{y.current!=null&&window.clearTimeout(y.current),x.current!=null&&window.clearTimeout(x.current),y.current=null,x.current=null};if(R.useEffect(()=>P,[]),R.useLayoutEffect(()=>{if(s!==0)return;const he=document.activeElement;E&&he instanceof HTMLElement&&he.closest(".inflight-popup")&&v.current?.focus(),P(),h("closed"),S(!1),e==="inline"&&i&&o?.(!1)},[s,i,o,E,e]),s===0&&!(s===0&&e==="popup"&&E)||e==="popup"&&c)return null;const k=()=>window.matchMedia("(hover: hover) and (pointer: fine)").matches,C=()=>{x.current!=null&&window.clearTimeout(x.current),x.current=null},_=()=>{e!=="popup"||p==="pinned"||!k()||(C(),y.current!=null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>h("hover"),i2))},N=()=>{y.current!=null&&window.clearTimeout(y.current),y.current=null,!(e!=="popup"||p!=="hover")&&(x.current=window.setTimeout(()=>h("closed"),l2))},j=he=>{P(),h("closed"),S(!1),he&&v.current?.focus()},$=he=>{if(e==="inline"){o?.(!i);return}if(P(),p==="pinned"){j(!1);return}S(he.detail===0),h("pinned")},L=he=>{he.pointerType==="mouse"&&_()},J=s>99?"99+":String(s),re=E?"inflight.badgeClose":"inflight.badgeOpen";return d.jsxs("span",{className:`inflight-badge-wrap inflight-badge-wrap--${e}`,onPointerEnter:L,onPointerLeave:N,children:[d.jsxs("button",{ref:v,type:"button",className:`inflight-badge inflight-badge--${e}`,onClick:$,"aria-live":"polite","aria-expanded":E,"aria-controls":a,"aria-haspopup":e==="popup"?"dialog":void 0,"aria-label":m(re,{n:s}),title:m(re,{n:s}),children:[d.jsx("span",{className:"inflight-badge__spinner","aria-hidden":"true"}),d.jsx("span",{className:"inflight-badge__count","aria-hidden":"true",children:J})]}),e==="popup"&&E?d.jsx("span",{className:"inflight-badge__bridge","aria-hidden":"true"}):null,e==="popup"&&E?d.jsx(r2,{anchorRef:v,panelId:a,focusOnOpen:g,onRequestClose:j,onPointerEnter:C,onPointerLeave:N}):null]})}function s2(){const{t:e}=ge(),a=w(y=>y.sessions),i=w(y=>y.activeSessionId),o=w(y=>y.switchSession),s=w(y=>y.createAndSwitchSession),c=w(y=>y.renameCurrentSession),m=w(y=>y.deleteSessionById),[p,h]=R.useState(!1),g=a.find(y=>y.id===i),S=()=>{const y=window.prompt(e("session.renamePrompt"),g?.title??e("session.newSession"));y&&y.trim()&&c(y.trim())},v=(y,x)=>{window.confirm(e("session.deleteConfirm",{title:x}))&&m(y)};return d.jsxs("div",{className:"session-picker",children:[d.jsxs("div",{className:"session-picker-row",children:[d.jsxs("button",{type:"button",className:"session-current",onClick:()=>h(y=>!y),title:e("session.switchTitle"),children:[d.jsx("span",{className:"session-title",children:g?.title??e("session.loading")}),d.jsx("span",{className:"session-caret",children:p?"▴":"▾"})]}),d.jsx("button",{type:"button",className:"session-btn",onClick:()=>{s(e("session.newSession"))},title:e("session.newSessionTitle"),children:"+"}),d.jsx("button",{type:"button",className:"session-btn",onClick:S,title:e("session.renameTitle"),disabled:!g,children:d.jsx(CM,{})})]}),p&&d.jsxs("ul",{className:"session-list",children:[a.map(y=>d.jsxs("li",{className:y.id===i?"is-active":"",children:[d.jsxs("button",{type:"button",className:"session-item",onClick:()=>{h(!1),o(y.id)},children:[d.jsx("span",{className:"session-item-title",children:y.title}),d.jsx("span",{className:"session-item-count",children:y.nodeCount})]}),d.jsx("button",{type:"button",className:"session-del",onClick:()=>v(y.id,y.title),title:e("session.deleteTitle"),children:"×"})]},y.id)),a.length===0&&d.jsx("li",{className:"session-empty",children:e("session.empty")})]})]})}const c2=[{value:"oauth",label:"GPT"},{value:"api",label:"GPT API"},{value:"grok",label:"Grok"},{value:"grok-api",label:"xAI API"},{value:"agy",label:"agy"},{value:"gemini-api",label:"Gem API"},{value:"atlascloud",label:"Atlas"},{value:"minimax",label:"MiniMax"}],Wl="mcp:",Zl="core:",es="video:",Iu="effort:";function d2(e){Qs(e,w.setState,w.getState)}function u2(e){jk(e,w.setState,w.getState)}function m2(e,a,i){Gk(e,a,w.setState,w.getState,i)}const Eu={image:[],video:[]};function Dy(e){return e.replace(/(^|-)([a-z])/g,(a,i,o)=>`${i}${o.toUpperCase()}`)}function AS({compact:e=!1}={}){const{t:a}=ge(),i=w(U=>U.provider),o=w(U=>U.imageModel),s=w(U=>U.videoModelSelected),c=w(U=>U.mcpProvider??null),m=w(U=>U.mcpModel??null),p=w(U=>U.mcpMediaKind??"image"),h=w(U=>U.setProvider),g=w(U=>U.setImageModel),S=w(U=>U.selectVideoModel),v=w(U=>U.setReasoningEffort),y=w(U=>U.reasoningEffort),{providers:x,loading:E,error:P}=cS(),[I,k]=R.useState(Eu),[C,_]=R.useState(!1),[N,j]=R.useState(0),[$,L]=R.useState(!1);R.useEffect(()=>{Hk(w.setState,w.getState)},[]);const J=c?x.find(U=>U.id===c)??null:null,re=!!(J?.enabled&&J.status.state==="connected");R.useEffect(()=>{if(!c||!re){k(Eu),_(!1);return}const U=new AbortController;return L(!0),_(!1),sS(c,U.signal).then(le=>{if(U.signal.aborted)return;k(le);const pe=w.getState(),Oe=(pe.mcpMediaKind==="video"?le.video:le.image).find(Re=>Re.id===pe.mcpModel);Oe&&Uk(Oe.capabilities,w.setState,w.getState)}).catch(le=>{le.name!=="AbortError"&&(U.signal.aborted||(k(Eu),_(!0)))}).finally(()=>{U.signal.aborted||L(!1)}),()=>U.abort()},[c,re,N]);const he=R.useMemo(()=>x.filter(U=>U.enabled&&U.status.state==="connected"),[x]),V=c?`${Wl}${c}`:`${Zl}${i}`,ee=c0(i),oe=s?`${es}${s}`:o,Ne=c?m?$l(p,m):"":oe,ne=!c&&(i==="oauth"||i==="api")&&!s,H=!!(m&&(I.image.some(U=>U.id===m)||I.video.some(U=>U.id===m))),ae=J?.executable===!1?J.lockReason??a("mcp.higgsfieldLocked"):null,ce=c?J?J.status.state!=="connected"?a("mcp.disconnectedSelection"):J.enabled?null:a("mcp.disabledProvider"):a("mcp.unknownProvider",{provider:c}):null,be=U=>{if(U.startsWith(Zl)){h(U.slice(Zl.length));return}const le=U.slice(Wl.length),pe=x.find(xe=>xe.id===le);!pe||pe.status.state!=="connected"||d2(le)},Se=U=>{if(U.startsWith(Iu)){v(U.slice(Iu.length));return}if(c){const le=AR(U);if(le){const xe=(le.kind==="video"?I.video:I.image).find(Oe=>Oe.id===le.model);m2(le.model,le.kind,xe?.capabilities)}else u2(U||null);return}if(U.startsWith(es)){S(U.slice(es.length));return}g(U)},T=[{label:a("mcp.coreProviders"),items:c2.map(U=>({value:`${Zl}${U.value}`,label:U.label}))}];he.length>0&&T.push({label:a("mcp.connectedProviders"),items:he.map(U=>({value:`${Wl}${U.id}`,label:Dy(U.id),sub:U.executable===!1?a("mcp.locked"):void 0}))}),c&&!he.some(U=>U.id===c)&&T.push({items:[{value:`${Wl}${c}`,label:Dy(c),sub:a("mcp.unavailable"),disabled:!0}]});const F=[];if(c)m&&!H&&F.push({items:[{value:$l(p,m),label:m}]}),F.push({label:a("mcp.imageModels"),items:I.image.map(U=>({value:$l("image",U.id),label:U.label}))}),F.push({label:a("mcp.videoModels"),items:I.video.map(U=>({value:$l("video",U.id),label:U.label}))});else{const U=i==="grok"||i==="grok-api";F.push({label:a("mcp.imageModels"),items:ee.map(le=>({value:le.value,label:le.shortLabel}))}),(U||s)&&F.push({label:a("mcp.videoModels"),items:d0.map(le=>({value:`${es}${le.value}`,label:le.shortLabel}))}),ne&&F.push({label:a("sidebar.reasoningLabel"),items:$u.map(le=>({value:`${Iu}${le.value}`,label:le.shortLabel,sub:le.value===y?"●":void 0}))})}const W=$u.find(U=>U.value===y);return d.jsxs("div",{className:`image-model-select image-model-select--sidebar gen-provider-model${e?" is-compact":""}`,children:[d.jsx(tr,{id:"sidebar-generation-provider",className:"gen-provider-model__select gen-provider-model__select--provider",groups:T,value:V,onChange:be,ariaLabel:a("mcp.providerLabel"),title:ce??a("mcp.providerLabel"),portal:!0}),d.jsx(tr,{id:"sidebar-generation-model",className:"gen-provider-model__select gen-provider-model__select--model",groups:F,value:Ne,onChange:Se,ariaLabel:a("mcp.modelLabel"),title:ce??a("mcp.modelLabel"),disabled:!!ce,placeholder:c?a($?"mcp.loadingModels":"mcp.chooseModel"):void 0,triggerSub:ne&&W?W.shortLabel:void 0,portal:!0}),ce||ae||P||C?d.jsx("span",{className:"image-model-select__trigger-effort",role:"status",children:ce??ae??(C?d.jsx("button",{type:"button",className:"image-model-select__retry",onClick:()=>j(U=>U+1),children:a("mcp.modelsLoadFailed")}):a(E?"mcp.loadingProviders":"mcp.providersLoadFailed"))}):null]})}function TS(e){return{...e,textFields:Array.isArray(e.textFields)?e.textFields:[]}}function pi(e){return{...e,cards:Array.isArray(e.cards)?e.cards.map(TS):[]}}async function co(e,a){const i=await fetch(e,a),o=await i.json().catch(()=>({}));if(!i.ok){const s=o,c=typeof s.error=="string"?s.error:s.error?.message||`Request failed: ${i.status}`,m=new Error(c);throw typeof s.error!="string"&&(m.code=s.error?.code),m}return o}function p2(){return co("/api/cardnews/image-templates")}function f2(){return co("/api/cardnews/role-templates")}async function g2(e){const a=await co("/api/cardnews/draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{...a,plan:pi(a.plan)}}function h2(e){return co("/api/cardnews/jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}function y2(e){return co(`/api/cardnews/jobs/${encodeURIComponent(e)}`)}async function v2(e){const i=(await co(`/api/cardnews/cards/${encodeURIComponent(e.card.id)}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,cards:[e.card]})})).cards.find(o=>o.id===e.card.id);if(!i)throw new Error("Regenerated card not found");return{card:i}}function Fy(e){return co(`/api/cardnews/sets/${encodeURIComponent(e)}`).then(a=>({...a,plan:pi(a.plan)}))}function b2(e){return`/api/cardnews/sets/${encodeURIComponent(e)}/manifest?download=1`}function S2(e){return e[0]?.id||"academy-lesson-square"}function x2(e){return e.find(a=>a.id==="mid-5")?.id||e[0]?.id||"mid-5"}function A2(e){return Math.round(e/16)*16}function ws(e){return Math.min(mm,Math.max(1024,A2(e)))}function zy(e){return e.outputSizePreset!=="custom"?e.outputSizePreset:`${ws(e.customW)}x${ws(e.customH)}`}function CS(e){if(e){if(typeof e=="string")return e;if(typeof e=="object"&&"message"in e){const a=e.message;return typeof a=="string"?a:void 0}return String(e)}}function T2(e,a){const i=a.status||"generated";return{...e,...a,textFields:Array.isArray(a.textFields)?a.textFields:e.textFields,status:i,error:i==="error"?CS(a.error)||Z("cardNews.error"):void 0}}function C2(e){return new Promise(a=>setTimeout(a,e))}function Ru(e,a){const i=new Map(a.cards.map(o=>[o.id,o]));return{...e,cards:e.cards.map(o=>{const s=i.get(o.id);return s?{...o,...s,textFields:Array.isArray(s.textFields)?s.textFields:o.textFields,status:s.status||o.status,error:CS(s.error)}:o})}}const vt=pv((e,a)=>({templates:[],roleTemplates:[],activePlan:null,selectedCardId:null,selectedTextFieldId:null,topic:"",audience:"",goal:"",contentBrief:"",imageTemplateId:"academy-lesson-square",roleTemplateId:"mid-5",outputSizePreset:"2048x2048",customW:2048,customH:2048,loading:!1,generating:!1,error:null,draftError:null,plannerMeta:null,async hydrate(){if(!(a().loading||a().templates.length>0)){e({loading:!0,error:null});try{const[i,o]=await Promise.all([p2(),f2()]);e({templates:i.templates,roleTemplates:o.templates,imageTemplateId:S2(i.templates),roleTemplateId:x2(o.templates),loading:!1})}catch(i){e({loading:!1,error:i instanceof Error?i.message:String(i)})}}},setBriefField(i,o){e({[i]:o})},setImageTemplate(i){e({imageTemplateId:i})},setRoleTemplate(i){e({roleTemplateId:i})},setOutputSizePreset(i){e({outputSizePreset:i})},setCustomSize(i,o){e({customW:ws(i),customH:ws(o)})},async draft(){const i=a();e({loading:!0,error:null,draftError:null});try{const{plan:o,planner:s}=await g2({topic:i.topic,audience:i.audience,goal:i.goal,contentBrief:i.contentBrief,imageTemplateId:i.imageTemplateId,roleTemplateId:i.roleTemplateId,size:zy(i)});e({activePlan:pi(o),selectedCardId:o.cards[0]?.id||null,selectedTextFieldId:null,plannerMeta:s||null,loading:!1})}catch(o){const s=o instanceof Error?o.message:String(o);e({loading:!1,draftError:s,error:s})}},updateCard(i,o){e(s=>({activePlan:s.activePlan?{...s.activePlan,cards:s.activePlan.cards.map(c=>c.id===i?{...c,...o}:c)}:null}))},updateTextField(i,o,s){e(c=>({activePlan:c.activePlan?{...c.activePlan,cards:c.activePlan.cards.map(m=>m.id!==i||m.locked?m:{...m,textFields:m.textFields.map(p=>p.id===o?{...p,...s,source:s.source||"user"}:p)})}:null}))},addTextField(i,o){e(s=>({activePlan:s.activePlan?{...s.activePlan,cards:s.activePlan.cards.map(c=>c.id===i&&!c.locked?{...c,textFields:[...c.textFields,{...o,source:"user"}]}:c)}:null,selectedTextFieldId:o.id}))},removeTextField(i,o){e(s=>({activePlan:s.activePlan?{...s.activePlan,cards:s.activePlan.cards.map(c=>c.id===i&&!c.locked?{...c,textFields:c.textFields.filter(m=>m.id!==o)}:c)}:null,selectedTextFieldId:s.selectedTextFieldId===o?null:s.selectedTextFieldId}))},selectCard(i){e({selectedCardId:i,selectedTextFieldId:null})},selectTextField(i){e({selectedTextFieldId:i})},getGenerationSummary(){const i=a().activePlan?.cards||[];return{total:i.length,done:i.filter(o=>o.status==="generated").length,queued:i.filter(o=>o.status==="queued").length,generating:i.filter(o=>o.status==="generating").length,errors:i.filter(o=>o.status==="error").length,skipped:i.filter(o=>o.locked||o.status==="skipped").length}},async generateSet(){const i=a();if(!i.activePlan)return;const o=w.getState();e({generating:!0,error:null,activePlan:{...i.activePlan,cards:i.activePlan.cards.map(s=>s.locked?{...s,status:"skipped"}:{...s,status:"queued",error:void 0})}});try{const s=a().activePlan||i.activePlan;let m=await h2({...s,size:zy(i),quality:o.quality,moderation:o.moderation,model:o.imageModel,sessionId:o.activeSessionId});for(e(h=>({activePlan:h.activePlan?Ru(h.activePlan,m):h.activePlan}));["queued","running"].includes(m.status);)await C2(900),m=await y2(m.jobId),e(h=>({activePlan:h.activePlan?Ru(h.activePlan,m):h.activePlan}));const p=await Fy(m.setId).catch(()=>null);e(h=>({generating:!1,activePlan:p?.plan?pi(p.plan):h.activePlan?Ru(h.activePlan,m):h.activePlan,selectedTextFieldId:null})),o.showToast(Z("cardNews.generated",{count:m.generated}))}catch(s){const c=s instanceof Error?s.message:String(s);e(m=>({generating:!1,error:c,activePlan:m.activePlan?{...m.activePlan,cards:m.activePlan.cards.map(p=>p.status==="queued"||p.status==="generating"?{...p,status:"error",error:c}:p)}:m.activePlan}))}},async retryCard(i){const s=a().activePlan,c=s?.cards.find(p=>p.id===i);if(!s||!c||c.locked||!["draft","error"].includes(c.status))return;const m=w.getState();e({error:null,activePlan:{...s,cards:s.cards.map(p=>p.id===i?{...p,status:"generating",error:void 0}:p)}});try{const{card:p}=await v2({setId:s.setId,card:c,quality:m.quality,moderation:m.moderation,model:m.imageModel});e(h=>({activePlan:h.activePlan?{...h.activePlan,cards:h.activePlan.cards.map(g=>g.id===i?T2(g,TS(p)):g)}:h.activePlan}))}catch(p){const h=p instanceof Error?p.message:String(p);e(g=>({error:h,activePlan:g.activePlan?{...g.activePlan,cards:g.activePlan.cards.map(S=>S.id===i?{...S,status:"error",error:h}:S)}:g.activePlan}))}},async loadSet(i){e({loading:!0,error:null,selectedTextFieldId:null});try{const{plan:o}=await Fy(i);e({activePlan:pi(o),selectedCardId:o.cards[0]?.id||null,selectedTextFieldId:null,loading:!1})}catch(o){e({loading:!1,error:o instanceof Error?o.message:String(o)})}}}));function w2(){const{t:e}=ge(),a=vt(N=>N.hydrate),i=vt(N=>N.topic),o=vt(N=>N.audience),s=vt(N=>N.goal),c=vt(N=>N.contentBrief),m=vt(N=>N.outputSizePreset),p=vt(N=>N.customW),h=vt(N=>N.customH),g=vt(N=>N.setBriefField),S=vt(N=>N.setOutputSizePreset),v=vt(N=>N.setCustomSize),y=vt(N=>N.draft),x=vt(N=>N.loading),E=vt(N=>N.generating),P=vt(N=>N.draftError),I=vt(N=>N.generateSet),k=vt(N=>N.activePlan),C=k?.cards||[],_={total:C.length,done:C.filter(N=>N.status==="generated").length};return R.useEffect(()=>{a()},[a]),d.jsxs("section",{className:"card-news-composer","aria-label":e("cardNews.composer"),children:[d.jsx("div",{className:"card-news-composer__head",children:d.jsxs("div",{children:[d.jsx("div",{className:"section-title",children:e("cardNews.composer")}),d.jsx("p",{children:e("cardNews.composerHint")})]})}),d.jsxs("label",{className:"card-news-field",children:[d.jsx("span",{children:e("cardNews.topic")}),d.jsx("input",{value:i,placeholder:e("cardNews.topicPlaceholder"),onChange:N=>g("topic",N.target.value)})]}),d.jsxs("label",{className:"card-news-field",children:[d.jsx("span",{children:e("cardNews.audience")}),d.jsx("input",{value:o,placeholder:e("cardNews.audiencePlaceholder"),onChange:N=>g("audience",N.target.value)})]}),d.jsxs("label",{className:"card-news-field",children:[d.jsx("span",{children:e("cardNews.goal")}),d.jsx("input",{value:s,placeholder:e("cardNews.goalPlaceholder"),onChange:N=>g("goal",N.target.value)})]}),d.jsxs("label",{className:"card-news-field",children:[d.jsx("span",{children:e("cardNews.brief")}),d.jsx("textarea",{value:c,placeholder:e("cardNews.briefPlaceholder"),onChange:N=>g("contentBrief",N.target.value)})]}),d.jsxs("div",{className:"card-news-field",children:[d.jsx("span",{children:e("cardNews.outputSize")}),d.jsx("div",{className:"card-news-size-row",role:"group","aria-label":e("cardNews.outputSize"),children:["1024x1024","2048x2048","custom"].map(N=>d.jsx("button",{type:"button",className:`option-btn${m===N?" active":""}`,onClick:()=>S(N),children:N==="custom"?e("cardNews.customSize"):N==="1024x1024"?"1024²":"2048²"},N))}),m==="custom"?d.jsxs("div",{className:"card-news-custom-size",children:[d.jsx("input",{className:"custom-size-input",type:"text",inputMode:"numeric",value:p,onChange:N=>v(Number.parseInt(N.target.value,10)||p,h),"aria-label":e("size.width")}),d.jsx("span",{children:"×"}),d.jsx("input",{className:"custom-size-input",type:"text",inputMode:"numeric",value:h,onChange:N=>v(p,Number.parseInt(N.target.value,10)||h),"aria-label":e("size.height")})]}):null]}),d.jsxs("button",{type:"button",className:"generate-btn card-news-draft-btn",onClick:()=>{y()},disabled:x||!i.trim(),children:[x?d.jsx("span",{className:"card-news-spinner","aria-hidden":"true"}):null,e(x?"cardNews.drafting":"cardNews.draft")]}),P?d.jsx("div",{className:"card-news-error",role:"alert",children:P}):null,x?d.jsxs("div",{className:"card-news-inline-status",role:"status",children:[d.jsx("span",{className:"card-news-spinner","aria-hidden":"true"}),d.jsx("span",{children:e("cardNews.drafting")})]}):null,d.jsxs("button",{type:"button",className:"composer__tool card-news-generate-btn",onClick:()=>{I()},disabled:!k||E||k.cards.every(N=>N.locked),children:[E?d.jsx("span",{className:"card-news-spinner","aria-hidden":"true"}):null,E?e("cardNews.progress.generating",{done:_.done,total:_.total}):e("cardNews.batchGenerate")]})]})}function nr({className:e}){return d.jsx("span",{className:["video-thumb-placeholder",e].filter(Boolean).join(" "),"aria-hidden":"true"})}function I2({item:e,active:a,selectLabel:i,deleteLabel:o,setRef:s,onSelect:c,onDelete:m}){const p=Ot(e),h=gt(e),g=S=>{S.dataTransfer.setData("application/ima2-ref",JSON.stringify(h?yi(e):{image:e.url||e.image,filename:e.filename})),S.dataTransfer.effectAllowed="copy"};return d.jsxs("div",{className:"sidebar-history__item",children:[d.jsx("button",{ref:S=>s(p,S),type:"button",className:`sidebar-history__thumb${a?" active":""}${h?" sidebar-history__thumb--video":""}`,onClick:()=>c(e),"aria-label":i,title:e.prompt??"",draggable:!0,onDragStart:g,children:h?d.jsxs(d.Fragment,{children:[e.thumb?d.jsx("img",{src:e.thumb,alt:"",loading:"lazy",decoding:"async"}):d.jsx(nr,{}),d.jsx("span",{className:"sidebar-history__play-badge","aria-hidden":"true",children:"▶"})]}):d.jsx("img",{src:e.thumb||e.url||e.image,alt:"",loading:"lazy",decoding:"async"})}),d.jsx("button",{type:"button",className:"sidebar-history__delete",onClick:S=>{S.preventDefault(),S.stopPropagation(),m(e)},"aria-label":o,title:o,children:"x"})]})}function E2({entry:e,active:a,selectLabel:i,deleteLabel:o,setRef:s,onSelect:c,onDelete:m}){const p=zN(e.items.length);return d.jsxs("div",{className:"sidebar-history__item",children:[d.jsxs("button",{ref:h=>s(e.key,h),type:"button",className:`sidebar-history__sequence${a?" active":""}`,onClick:()=>c(e.sequenceId),"aria-label":i,children:[d.jsx("span",{className:`sidebar-history__sequence-grid count-${p}`,"aria-hidden":"true",children:Array.from({length:p}).map((h,g)=>{const S=e.items[g];return S&>(S)&&!S.thumb?d.jsx(nr,{},Ot(S)):S?d.jsx("img",{src:S.thumb||S.url||S.image,alt:"",loading:"lazy",decoding:"async"},Ot(S)):d.jsx("span",{className:"sidebar-history__sequence-placeholder"},`sequence-placeholder-${e.sequenceId}-${g}`)})}),d.jsx("span",{className:"sidebar-history__sequence-badge",children:e.items.length})]}),d.jsx("button",{type:"button",className:"sidebar-history__delete",onClick:h=>{h.preventDefault(),h.stopPropagation(),m(e.sequenceId)},"aria-label":o,title:o,children:"x"})]})}const qy="ima2.sidebarHistoryCollapsed";function Uy(){const{t:e}=ge();return d.jsx("div",{className:"sidebar-history__item",children:d.jsx("div",{className:"sidebar-history__thumb sidebar-history__thumb--skeleton","aria-label":e("common.generating")})})}function R2({count:e}){const a=Math.min(e,4);return d.jsx("div",{className:"sidebar-history__item",children:d.jsx("div",{className:"sidebar-history__thumb sidebar-history__thumb--collection-skeleton",children:Array.from({length:a},(i,o)=>d.jsx("div",{className:"sidebar-collection-mini sidebar-collection-mini--skeleton"},o))})})}function N2(){const e=w(k=>k.history),a=w(k=>k.currentImage),i=w(k=>k.selectHistory),o=w(k=>k.showHistorySequence),s=w(k=>k.trashHistoryItem),c=w(k=>k.trashHistorySequence),m=w(k=>k.inFlight),p=w(k=>k.multimodeSequences),h=w(k=>{const C=k.multimodePreviewFlightId;return C?C.startsWith("history:")?C.slice(8):k.multimodeSequences[C]?.sequenceId??null:null}),g=w(k=>k.openGallery),S=R.useRef({}),[v,y]=R.useState(()=>{try{return localStorage.getItem(qy)==="1"}catch{return!1}}),{t:x}=ge(),E=tS(a,h),P=R.useMemo(()=>eS(e).slice(0,Wb),[e]);R.useEffect(()=>{!E||v||S.current[E]?.scrollIntoView({block:"nearest",inline:"nearest"})},[E,v,P]),R.useEffect(()=>{try{localStorage.setItem(qy,v?"1":"0")}catch{}},[v]);const I=(k,C)=>{S.current[k]=C};return d.jsxs("section",{className:`sidebar-history${v?" sidebar-history--collapsed":""}`,"aria-label":x("history.recentTitle"),children:[d.jsxs("div",{className:"sidebar-history__header",children:[d.jsx("span",{className:"section-title",children:x("history.recentTitle")}),d.jsxs("div",{className:"sidebar-history__header-actions",children:[d.jsx("button",{type:"button",className:"sidebar-history__gallery-button",onClick:g,"aria-label":x("history.galleryCard"),title:x("history.openGalleryTitle"),children:d.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),d.jsx("button",{type:"button",className:"sidebar-history__toggle",onClick:()=>y(k=>!k),title:x(v?"history.expandRecent":"history.collapseRecent"),"aria-expanded":!v,children:x(v?"history.expandRecentShort":"history.collapseRecentShort")})]})]}),v?null:d.jsxs("div",{className:"sidebar-history__grid",children:[m.map(k=>{const C=p[k.id];if(k.kind==="multimode"&&C){const _=[d.jsx(R2,{count:C.requested},`coll-sk-${k.id}`)];for(let N=0;N<C.requested;N++)C.images[N]||_.push(d.jsx(Uy,{},`sk-${k.id}-${N}`));return _}return d.jsx(Uy,{},`sk-${k.id}`)}),P.length===0&&m.length===0?d.jsx("button",{type:"button",className:"sidebar-history__empty",onClick:g,children:x("history.emptyRecent")}):null,P.map(k=>k.type==="sequence"?d.jsx(E2,{entry:k,active:E===k.key,selectLabel:x("history.selectRecent"),deleteLabel:x("history.deleteSequenceAria",{count:k.items.length}),setRef:I,onSelect:o,onDelete:C=>{c(C)}},k.key):d.jsx(I2,{item:k.item,active:E===k.key,selectLabel:x("history.selectRecent"),deleteLabel:x("history.deleteImageAria"),setRef:I,onSelect:i,onDelete:C=>{s(C)}},k.key))]})]})}const k2="sidebar-inflight-panel";function _2(){const{t:e}=ge(),a=w(g=>g.uiMode),i=w(g=>g.workspaceProfile),o=w(g=>g.referenceImages),s=w(g=>g.clearReferences),c=ka(),m=a==="agent"&&lr?"agent":a==="node"&&ir?"node":a==="assets"?"assets":a==="asset-gen"?"asset-gen":"classic",p=Ei(i),h=!c&&m==="classic"&&p.composerPlacement==="bottom"&&p.multimodeHistoryGrouping==="sequence";return d.jsxs(d.Fragment,{children:[d.jsx(M2,{}),m==="classic"?h?d.jsx(d.Fragment,{children:d.jsx(N2,{})}):d.jsxs(d.Fragment,{children:[d.jsx(qm,{}),d.jsxs("div",{className:"sidebar-generate-with-inflight",children:[d.jsx(Um,{}),d.jsx(xS,{variant:"popup",panelId:k2})]})]}):m==="card-news"?d.jsx(d.Fragment,{children:d.jsx(w2,{})}):m==="node"?d.jsxs(d.Fragment,{children:[d.jsx(s2,{}),o.length>0?d.jsxs("div",{className:"node-mode-ref-warning",role:"status",children:[d.jsx("strong",{children:e("node.classicRefsParkedTitle")}),d.jsx("span",{children:e("node.classicRefsParkedBody")}),d.jsx("button",{type:"button",onClick:s,children:e("node.clearParkedRefs")})]}):null,d.jsx("div",{className:"sidebar__node-hint",children:e("sidebar.nodeModeHint")}),d.jsx(Hm,{})]}):null]})}function M2(){const e=ka();return d.jsx(d.Fragment,{children:d.jsxs("div",{className:"logo",children:[d.jsx("div",{className:"logo-mark","aria-hidden":"true"}),d.jsxs("div",{className:"logo-copy",children:[d.jsx("div",{className:"logo-title",children:"ima2"}),d.jsx("div",{className:"logo-title logo-title--gen",children:"gen"})]}),d.jsxs("div",{className:"logo-actions",children:[d.jsx(L2,{}),d.jsx(AS,{compact:e})]})]})})}function P2(){return d.jsx("aside",{className:"sidebar",children:d.jsx("div",{className:"sidebar__scroll",children:d.jsx(_2,{})})})}function L2(){const{t:e}=ge(),a=w(m=>m.togglePromptLibrary),i=w(m=>m.promptLibraryOpen),o=w(m=>m.rightPanelOpen),s=w(m=>m.toggleRightPanel),c=()=>{!i&&!o&&s(),a()};return d.jsx("button",{type:"button",className:"settings-button",onClick:c,title:e("promptLibrary.title"),"aria-label":e("promptLibrary.title"),children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})})})}const O2=1024,j2=1024,G2="blank-canvas.png";function Hy(e,a){return typeof e!="number"||!Number.isFinite(e)||e<=0?a:Math.max(1,Math.round(e))}async function D2(e){const a=Hy(e?.width,O2),i=Hy(e?.height,j2),o=document.createElement("canvas");o.width=a,o.height=i;const s=o.getContext("2d");if(!s)throw new Error("blank_canvas_context_unavailable");s.fillStyle="#ffffff",s.fillRect(0,0,o.width,o.height);const c=await new Promise((m,p)=>{o.toBlob(h=>{h?m(h):p(new Error("blank_canvas_blob_unavailable"))},"image/png")});return new File([c],G2,{type:"image/png"})}const ts=1024;function F2(e){const a=/^(\d+)x(\d+)$/.exec(e);if(!a)return{width:ts,height:ts};const i=Number.parseInt(a[1]??"",10),o=Number.parseInt(a[2]??"",10);return!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0?{width:ts,height:ts}:{width:i,height:o}}function z2(){const e=w(h=>h.importLocalImageToHistory),a=w(h=>h.openCanvas),i=w(h=>h.showToast),o=w(h=>h.getResolvedSize),{t:s}=ge(),[c,m]=R.useState(!1),p=R.useCallback(async()=>{if(!c){m(!0);try{const h=F2(o()),g=await D2(h);await e(g)&&a()}catch{i(s("canvas.blank.failed"),!0)}finally{m(!1)}}},[c,o,e,a,i,s]);return{creatingBlankCanvas:c,createBlankCanvas:p}}function q2(e,a){return{image:e.url,url:e.url,providerUrl:e.providerUrl,filename:e.filename,mediaType:"video",prompt:e.prompt,userPrompt:e.userPrompt,revisedPrompt:e.revisedPrompt,provider:e.provider,model:e.model,format:"mp4",elapsed:e.elapsed,usage:e.usage??void 0,webSearchCalls:e.webSearchCalls,video:e.video,videoSeries:null,videoContinuity:e.videoContinuity,videoLineage:e.videoLineage,requestId:e.requestId,createdAt:e.createdAt,sessionId:null}}async function U2(e,a){try{const i=await fetch("/api/video/extend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:a}),o=await i.json().catch(()=>({}));if(!i.ok)throw ao(o,`Request failed: ${i.status}`);if(i.status!==202||o.requestId!==e.requestId||o.sourceVideoId!==e.sourceVideoId||o.workflow!=="last-frame-i2v")throw new Error("Video extension returned an invalid acceptance response")}catch(i){throw i instanceof Error?i:new Error(String(i))}}function H2(e,a){return lo(),new Promise((i,o)=>{let s=!1,c=()=>{},m=()=>{};const p=v=>{s||(s=!0,c(),m(),a.removeEventListener("abort",g),v())},h=()=>{Mt(e.requestId).catch(()=>{})},g=()=>p(()=>{h(),o(new DOMException("Aborted","AbortError"))});if(m=io(e.requestId,null,(v,y)=>{v==="done"?p(()=>i(y)):v==="error"&&p(()=>o(ao(y,"Video extension failed")))}),c=or(()=>p(()=>{h(),o(new Error("Video extension stream timed out"))})),a.aborted)return g();a.addEventListener("abort",g,{once:!0}),IT().then(()=>U2(e,a)).catch(v=>p(()=>o(v)))})}const B2={oauth:"GPT OAuth / Codex login",api:"GPT API key",grok:"Grok OAuth / progrok","grok-api":"Grok API key",agy:"Antigravity Gemini CLI","gemini-api":"Gemini API / Vertex",atlascloud:"Atlas Cloud API",minimax:"MiniMax API"};function V2(e){return e==null?!1:typeof e=="string"?e.trim().length>0:typeof e=="number"?Number.isFinite(e):typeof e=="boolean"}function Bm(e){return V2(e)?String(e):null}function K2(e,a){return typeof e!="number"||!Number.isFinite(e)?null:new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function By(e){return e?e.replace("x","×"):null}function $2(e){if(e==null)return null;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Ee(e,a,i,o={}){const s=Bm(i);s&&e.push({label:a,value:s,...o})}function Nu(e,a,i,o={}){typeof i!="number"||i<=0||Ee(e,a,i,o)}function Y2(e,a,i){const o=$2(i);!o||o==="{}"||o==="[]"||e.push({label:a,value:o,copyValue:o,pre:!0})}function X2(e){if(!e.sequenceId)return null;const a=[e.sequenceIndex!=null&&e.sequenceTotalReturned!=null?`${e.sequenceIndex+1}/${e.sequenceTotalReturned}`:null,e.sequenceTotalRequested!=null?`requested ${e.sequenceTotalRequested}`:null,e.sequenceStatus??null].filter(Boolean);return a.length?`${e.sequenceId} (${a.join(", ")})`:e.sequenceId}function Q2(e){return e?B2[e]??e:null}function J2(e){return e.trim().replace(/\s+/g," ")}function ns(e,a,i,o){const s=Bm(o);if(!s)return;const c=J2(s);!c||a.has(c)||(a.add(c),e.push({label:i,value:s,copyValue:s,pre:!0}))}function Vy(e,a){const i=e?.[a];return typeof i=="number"&&Number.isFinite(i)?i:null}function Ky(e,a,i){const o=e?.[a];if(!o||typeof o!="object"||Array.isArray(o))return null;const s=o[i];return typeof s=="number"&&Number.isFinite(s)?s:null}function W2(e){const a=["metadata-modal__row"];return e.pre&&a.push("metadata-modal__row--pre"),e.compact&&a.push("metadata-modal__row--compact"),a.join(" ")}function Z2({item:e,onClose:a,onCopy:i}){const{t:o,locale:s}=ge(),c=R.useMemo(()=>JSON.stringify(e,null,2),[e]),m=e.videoContinuity?.entries?.[e.videoContinuity.entries.length-1]??null,p=Q2(e.provider),h=[[p,e.model].filter(Boolean).join(" · "),By(e.size),e.elapsed!=null?`${e.elapsed}s`:null,e.usage?.total_tokens!=null?`${e.usage.total_tokens} ${o("metadata.fields.tokens").toLowerCase()}`:null].filter(C=>!!C),g=[],S=[];Ee(S,o("metadata.fields.provider"),p,{compact:!0}),Ee(S,o("metadata.fields.model"),e.model,{compact:!0}),Ee(S,o("metadata.fields.providerUrl"),e.providerUrl,{copyValue:e.providerUrl??void 0}),Ee(S,o("metadata.fields.requestId"),e.requestId,{copyValue:e.requestId??void 0}),S.length&&g.push({title:o("metadata.sections.provider"),fields:S,compact:!0});const v=[];Ee(v,o("metadata.fields.quality"),e.quality,{compact:!0}),Ee(v,o("metadata.fields.size"),By(e.size),{compact:!0}),Ee(v,o("metadata.fields.format"),e.format,{compact:!0}),Ee(v,o("metadata.fields.moderation"),e.moderation,{compact:!0}),Ee(v,o("metadata.fields.reasoning"),e.reasoningEffort,{compact:!0}),Ee(v,o("metadata.fields.promptMode"),e.promptMode,{compact:!0}),Ee(v,o("metadata.fields.kind"),e.kind,{compact:!0}),Ee(v,o("metadata.fields.mediaType"),e.mediaType,{compact:!0}),v.length&&g.push({title:o("metadata.sections.settings"),fields:v,compact:!0});const y=[];Ee(y,o("metadata.fields.elapsed"),e.elapsed!=null?`${e.elapsed}s`:null,{compact:!0}),Ee(y,o("metadata.fields.totalTokens"),e.usage?.total_tokens,{compact:!0}),Ee(y,o("metadata.fields.inputTokens"),Vy(e.usage,"input_tokens"),{compact:!0}),Nu(y,o("metadata.fields.cachedTokens"),Ky(e.usage,"input_tokens_details","cached_tokens"),{compact:!0}),Ee(y,o("metadata.fields.outputTokens"),Vy(e.usage,"output_tokens"),{compact:!0}),Nu(y,o("metadata.fields.reasoningTokens"),Ky(e.usage,"output_tokens_details","reasoning_tokens"),{compact:!0}),Nu(y,o("metadata.fields.webSearchCalls"),e.webSearchCalls,{compact:!0}),e.usage?.grok_cost_usd_ticks!=null&&Ee(y,o("metadata.fields.grokCostTicks"),e.usage.grok_cost_usd_ticks,{compact:!0}),y.length&&g.push({title:o("metadata.sections.usage"),fields:y,compact:!0});const x=[];Ee(x,o("metadata.fields.filename"),e.filename,{copyValue:e.filename}),Ee(x,o("metadata.fields.createdAt"),K2(e.createdAt,s)),Ee(x,o("metadata.fields.sessionId"),e.sessionId),Ee(x,o("metadata.fields.nodeId"),e.nodeId),Ee(x,o("metadata.fields.parentNodeId"),e.parentNodeId),Ee(x,o("metadata.fields.clientNodeId"),e.clientNodeId),Ee(x,o("metadata.fields.refsCount"),e.refsCount),Ee(x,o("metadata.fields.sequence"),X2(e)),Ee(x,o("metadata.fields.setId"),e.setId),Ee(x,o("metadata.fields.cardId"),e.cardId),x.length&&g.push({title:o("metadata.sections.lineage"),fields:x});const E=[];Ee(E,o("metadata.fields.videoDuration"),e.video?.duration?`${e.video.duration}s`:null),Ee(E,o("metadata.fields.videoResolution"),e.video?.resolution),Ee(E,o("metadata.fields.videoAspectRatio"),e.video?.aspectRatio),Ee(E,o("metadata.fields.videoRequestedModel"),e.video?.requestedModel),Ee(E,o("metadata.fields.videoEffectiveModel"),e.video?.effectiveModel),Ee(E,o("metadata.fields.videoModelFallback"),e.video?.modelFallback),Ee(E,o("metadata.fields.xaiVideoRequestId"),e.video?.xaiVideoRequestId,{copyValue:Bm(e.video?.xaiVideoRequestId)??void 0}),Ee(E,o("metadata.fields.sourceImageFilename"),e.video?.sourceImageFilename),E.length&&g.push({title:o("metadata.sections.video"),fields:E});const P=[];Ee(P,o("metadata.fields.lineageId"),e.videoContinuity?.lineageId),Ee(P,o("metadata.fields.parentFilename"),e.videoContinuity?.parentFilename),Ee(P,o("metadata.fields.sourceFrame"),e.videoContinuity?.sourceFrame),Ee(P,o("metadata.fields.continuityEntries"),e.videoContinuity?.entries?.length),Ee(P,o("metadata.fields.latestContinuityPrompt"),m?.revisedPrompt,{copyValue:m?.revisedPrompt,pre:!0}),P.length&&g.push({title:o("metadata.sections.videoContinuity"),fields:P});const I=[],k=new Set;return ns(I,k,o("metadata.fields.promptPrimary"),e.userPrompt??e.prompt),ns(I,k,o("metadata.fields.revisedPrompt"),e.revisedPrompt),ns(I,k,o("metadata.fields.prompt"),e.prompt),ns(I,k,o("metadata.fields.composerPrompt"),e.composerPrompt),Y2(I,o("metadata.fields.insertedPrompts"),e.composerInsertedPrompts),I.length&&g.push({title:o("metadata.sections.prompts"),fields:I}),d.jsx("div",{className:"modal-backdrop metadata-modal-backdrop",onClick:a,children:d.jsxs("section",{className:"modal metadata-modal",role:"dialog","aria-modal":"true","aria-labelledby":"metadata-modal-title",onClick:C=>C.stopPropagation(),children:[d.jsxs("header",{className:"metadata-modal__header",children:[d.jsxs("div",{children:[d.jsx("h3",{id:"metadata-modal-title",children:o("metadata.title")}),d.jsx("p",{children:[e.mediaType??o("metadata.asset"),e.filename].filter(Boolean).join(" · ")}),h.length?d.jsx("div",{className:"metadata-modal__summary","aria-label":o("metadata.summary"),children:h.map(C=>d.jsx("span",{children:C},C))}):null]}),d.jsx("button",{type:"button",className:"metadata-modal__close",onClick:a,"aria-label":o("common.close"),children:"×"})]}),d.jsxs("div",{className:"metadata-modal__body",children:[g.map(C=>d.jsxs("section",{className:C.compact?"metadata-modal__section metadata-modal__section--compact":"metadata-modal__section",children:[d.jsx("h4",{children:C.title}),d.jsx("dl",{children:C.fields.map(_=>d.jsxs("div",{className:W2(_),children:[d.jsx("dt",{children:_.label}),d.jsxs("dd",{children:[_.pre?d.jsx("pre",{children:_.value}):d.jsx("span",{children:_.value}),_.copyValue?d.jsx("button",{type:"button",onClick:()=>i(_.copyValue),"aria-label":o("metadata.copyField",{label:_.label}),children:o("metadata.copy")}):null]})]},`${C.title}:${_.label}`))})]},C.title)),d.jsxs("details",{className:"metadata-modal__raw",children:[d.jsx("summary",{children:o("metadata.rawJson")}),d.jsx("div",{className:"metadata-modal__raw-actions",children:d.jsx("button",{type:"button",onClick:()=>i(c),children:o("metadata.copyRaw")})}),d.jsx("pre",{children:c})]})]})]})})}function eP(e){return/\.(png|jpe?g|webp)$/i.test(e)?"image":/\.(mp4|mov)$/i.test(e)?"video":null}function wS(e,a){return e==="video"&&Object.values(a).some(i=>i!==void 0)?"video upscale takes no parameters":a.scaleFactor!==void 0&&![2,4,8,16].includes(a.scaleFactor)?"scaleFactor must be 2, 4, 8, or 16":a.scaleFactor!==void 0&&a.scaleFactor>2&&a.flavor!==void 0&&a.flavor!=="sublime"?"scaleFactor above 2 requires flavor sublime":null}function tP(e,a){const i=eP(e);if(!i||wS(i,a))return null;const o=i==="image"?"upscale-image":"upscale-video",s=Object.fromEntries(Object.entries(a).filter(([,c])=>c!==void 0));return{action:o,files:[e],...Object.keys(s).length>0?{parameters:s}:{}}}const nP=[2,4,8,16],aP=["sublime","photo","photo_denoiser"];function oP({pending:e,onSubmit:a,onClose:i}){const{t:o}=ge(),[s,c]=R.useState(2),[m,p]=R.useState(""),[h,g]=R.useState(10),[S,v]=R.useState(10),[y,x]=R.useState(30),E={scaleFactor:s,...m?{flavor:m}:{},sharpen:h,smartGrain:S,ultraDetail:y},P=wS("image",E);return d.jsxs("div",{className:"upscale-popover",role:"dialog","aria-label":o("result.upscaleTitle"),children:[d.jsx("div",{className:"option-row",role:"group","aria-label":"scaleFactor",children:nP.map(I=>d.jsxs("button",{type:"button",className:`option-btn${s===I?" active":""}`,"aria-pressed":s===I,onClick:()=>c(I),children:[I,"x"]},I))}),d.jsxs("label",{className:"upscale-popover__field",children:[d.jsx("span",{children:o("result.upscaleFlavor")}),d.jsxs("select",{value:m,onChange:I=>p(I.target.value),children:[d.jsx("option",{value:"",children:o("result.upscaleFlavorAuto")}),aP.map(I=>d.jsx("option",{value:I,children:I},I))]})]}),[["sharpen",h,g],["smartGrain",S,v],["ultraDetail",y,x]].map(([I,k,C])=>d.jsxs("label",{className:"upscale-popover__field",children:[d.jsxs("span",{children:[I," ",d.jsx("output",{children:k})]}),d.jsx("input",{type:"range",min:0,max:100,step:5,value:k,onChange:_=>C(Number(_.target.value))})]},I)),P?d.jsx("p",{className:"element-detail__error",role:"alert",children:P}):null,d.jsxs("div",{className:"upscale-popover__actions",children:[d.jsx("button",{type:"button",className:"action-btn action-btn--primary",disabled:e||!!P,onClick:()=>a(E),children:o(e?"inflight.streaming":"result.upscaleStart")}),d.jsx("button",{type:"button",className:"action-btn",onClick:i,children:o("common.cancel")})]})]})}const rP="canvas-mode-context",iP="Canvas Mode",$y=36e5,lP=["Canvas Mode context:","The user edited or annotated the reference image on a canvas.","If the image is a blank white canvas or paper with user-drawn strokes, treat those strokes as source content and preserve/complete them.","If the image is an existing picture with circles, arrows, sticky notes, handwritten marks, or memo notes over it, treat those marks as edit instructions. Apply the instruction, then remove the marks from the final image unless explicitly asked to keep them.","Infer the intended edit from the canvas marks and memo text. Preserve unrelated image content."].join(`
|
|
30
|
-
`);function sP({imageOverride:e=null,onAfterDeleteFocus:a}){const{t:i}=ge(),o=w(se=>se.currentImage),s=w(se=>se.showToast),c=w(se=>se.insertPromptToComposer),m=w(se=>se.createRootNodeFromHistoryItem),p=w(se=>se.trashHistoryItem),h=w(se=>se.saveToAssets),g=w(se=>se.permanentlyDeleteHistoryItemByClick),S=w(se=>se.canvasOpen),v=w(se=>se.openCanvas),[y,x]=R.useState(!1),[E,P]=R.useState(!1),[I,k]=R.useState("idle"),[C,_]=R.useState(!1),[N,j]=R.useState(!1),[$,L]=R.useState(!1),[J,re]=R.useState(!1),he=R.useRef(null);R.useEffect(()=>{let se=!0;return jm().then(qe=>{se&&re(qe.some(ot=>ot.id==="runway"&&ot.status.state==="connected"))}).catch(()=>{}),()=>{se=!1}},[]);const V=async se=>{if(!ee?.filename||$)return;const qe=tP(ee.filename,se);if(!qe){s(i("result.upscaleInvalid"),!0);return}L(!0);try{await ue("/api/mcp/media-action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)}),j(!1),s(i("result.upscaleStarted"))}catch{s(i("result.upscaleFailed"),!0)}finally{L(!1)}};R.useEffect(()=>()=>he.current?.abort(),[]);const ee=e??o;if(!ee)return null;const oe=gt(ee),Ne=oe?ee.url||ee.image:"",ne=!!ee.filename,H=!!ee.filename&&!oe,ae=oe&&!!ee.filename,be=!!((ee.provider==="grok"||ee.provider==="grok-api")&&!oe&&ee.providerUrl&&ee.createdAt&&Date.now()-ee.createdAt<$y),Se=async()=>{if(!(!ee.filename||E)){P(!0);try{await w.getState().animateImage(ee.filename,ee.prompt??void 0)&&s(i("toast.animateDone"))}catch(se){const qe=se instanceof Error?se.message:i("toast.animateFailed");s(qe,!0)}finally{P(!1)}}},T=async()=>{if(!ee.filename||I==="pending")return;const se=`vext_${crypto.randomUUID()}`,qe=new AbortController;he.current=qe,k("pending");try{const ot=await H2({requestId:se,sourceVideoId:ee.filename,prompt:ee.prompt?.trim()||void 0,provider:ee.provider==="grok-api"?"grok-api":"grok",model:ee.model??void 0},qe.signal);w.getState().addHistoryItem(q2(ot,ee)),k("idle"),s(i("toast.animateDone"))}catch(ot){const St=ot instanceof DOMException&&ot.name==="AbortError";k(St?"idle":"error"),St||s(ot instanceof Error?ot.message:i("toast.animateFailed"),!0)}finally{he.current===qe&&(he.current=null)}},F=()=>he.current?.abort(),W=()=>{const se=document.createElement("a");se.href=ee.image,se.download=ee.filename||"generated.png",se.click()},U=async se=>{const ot=await(await fetch(se)).blob();let St;if(ot.type==="image/png")St=ot;else{const xt=new Image;xt.crossOrigin="anonymous";const nn=URL.createObjectURL(ot);await new Promise((fn,et)=>{xt.onload=()=>fn(),xt.onerror=et,xt.src=nn});const Yt=document.createElement("canvas");Yt.width=xt.naturalWidth,Yt.height=xt.naturalHeight,Yt.getContext("2d").drawImage(xt,0,0),URL.revokeObjectURL(nn),St=await new Promise((fn,et)=>Yt.toBlob(On=>On?fn(On):et(),"image/png"))}await navigator.clipboard.write([new ClipboardItem({"image/png":St})])},le=async()=>{try{if(oe){const se=await cr(Ne);await U(se)}else await U(ee.image);s(i(oe?"toast.frameCopied":"toast.imageCopied"))}catch{s(i("toast.copyFailed"),!0)}},pe=async()=>{try{const se=await yb(Ne);await U(se),s(i("toast.frameCopied"))}catch{s(i("toast.copyFailed"),!0)}},xe=async()=>{try{const se=await vb(Ne);await U(se),s(i("toast.frameCopied"))}catch{s(i("toast.copyFailed"),!0)}},Oe=async()=>{if(ee.prompt)try{await navigator.clipboard.writeText(ee.prompt),s(i("toast.promptCopied"))}catch{s(i("clipboard.writeFailed"),!0)}},Re=async se=>{try{await navigator.clipboard.writeText(se),s(i("toast.metadataCopied"))}catch{s(i("clipboard.writeFailed"),!0)}},Ze=async()=>{let se={ok:!1,isVideo:!1,hasPrompt:!1};try{se=await Ws(ee)}catch{}S&&e&&c({id:rP,name:iP,text:lP});const qe=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');qe&&(qe.focus(),qe.setSelectionRange(qe.value.length,qe.value.length)),s(i(se.hasPrompt?"toast.forkStarted":"toast.forkStartedNoPrompt"))},ie=async()=>{if(oe||!ee.providerUrl||!ee.createdAt||Date.now()-ee.createdAt>=$y){s(i("toast.continueAsUrlExpired"),!0);return}try{await bS(ee)}catch{}const se=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');se&&(se.focus(),se.setSelectionRange(se.value.length,se.value.length)),s(i("toast.continueAsUrlStarted"))},lt=async()=>{if(!(!ee.filename||y)){x(!0);try{const se=await DT({filename:ee.filename});s(i("toast.comfyExported",{filename:se.uploadedFilename}))}catch(se){const qe=se instanceof Error?se.code:void 0;s(i(qe==="COMFY_URL_NOT_LOCAL"?"toast.comfyExportInvalidUrl":qe==="COMFY_IMAGE_INVALID"?"toast.comfyExportInvalidImage":qe==="COMFY_IMAGE_NOT_FOUND"?"toast.comfyExportImageNotFound":"toast.comfyExportFailed"),!0)}finally{x(!1)}}},at=()=>{m(ee),s(i("toast.nodeRootCreated"))},st=async()=>{try{await p(ee)}finally{a?.()}},bt=async()=>{try{await g(ee)}finally{a?.()}};return d.jsxs("div",{className:"result-actions",children:[d.jsx("button",{type:"button",className:"action-btn",onClick:W,children:i("result.download")}),d.jsx("button",{type:"button",className:`action-btn${oe?" action-btn--frame":""}`,onClick:le,children:i(oe?"result.copyLastFrame":"result.copyImage")}),oe&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-btn action-btn--frame",onClick:pe,children:i("result.copyFirstFrame")}),d.jsx("button",{type:"button",className:"action-btn action-btn--frame",onClick:xe,children:i("result.copyMidFrame")})]}),d.jsx("button",{type:"button",className:"action-btn",onClick:()=>{Oe()},children:i("result.copyPrompt")}),d.jsx("button",{type:"button",className:"action-btn",onClick:()=>{(async()=>{const se=await h(ee);s(i(se?"chain.savedToAssets":"chain.saveToAssetsFailed"),!se)})()},title:i("chain.saveToAssets"),children:i("chain.saveToAssets")}),d.jsx("button",{type:"button",className:"action-btn action-btn--primary",onClick:Ze,title:i("result.continueHereTitle"),children:i("result.continueHere")}),be&&d.jsx("button",{type:"button",className:"action-btn",onClick:()=>{ie()},title:i("result.continueAsUrlTitle"),children:i("result.continueAsUrl")}),H&&d.jsx("button",{type:"button",className:"action-btn",onClick:()=>{Se()},disabled:E,title:i("result.animateTitle"),children:i(E?"result.animating":"result.animate")}),J&&ee.filename&&(oe?d.jsx("button",{type:"button",className:"action-btn",disabled:$,onClick:()=>{V({})},title:i("result.upscaleTitle"),children:i($?"inflight.streaming":"result.upscale")}):d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-btn",disabled:$,onClick:()=>j(se=>!se),title:i("result.upscaleTitle"),children:i("result.upscale")}),N?d.jsx(oP,{pending:$,onSubmit:se=>{V(se)},onClose:()=>j(!1)}):null]})),ae&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-btn",onClick:T,disabled:I==="pending","aria-busy":I==="pending",title:i("result.extendTitle")??"이어가기",children:I==="pending"?i("inflight.streaming"):I==="error"?i("gallery.retry"):i("result.extend")??"이어가기"}),I==="pending"&&d.jsx("button",{type:"button",className:"action-btn",onClick:F,children:i("common.cancel")})]}),d.jsx("button",{type:"button",className:"action-btn",onClick:at,title:i("result.firstNodeTitle"),children:i("result.firstNode")}),d.jsx("button",{type:"button",className:"action-btn",onClick:()=>_(!0),title:i("result.infoTitle"),children:i("result.info")}),!S&&d.jsx("button",{type:"button",className:"action-btn",onClick:v,title:i("canvas.open"),"aria-label":i("canvas.openAria"),children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:d.jsx("path",{d:"M4 4h8v8M12 4l-8 8"})})}),ee.filename&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-btn action-btn--danger",onClick:()=>{st()},title:i("result.deleteTitle"),children:i("result.delete")}),d.jsxs("details",{className:"result-actions__more",children:[d.jsx("summary",{className:"action-btn",children:i("result.more")}),d.jsxs("div",{className:"result-actions__menu",children:[ne&&d.jsx("button",{type:"button",className:"result-actions__menu-item",onClick:()=>{lt()},title:i("result.sendToComfyUITitle"),disabled:y,children:i("result.sendToComfyUI")}),d.jsx("button",{type:"button",className:"result-actions__menu-item result-actions__danger-item",onClick:()=>{bt()},children:i("result.permanentDelete")})]})]})]}),C&&d.jsx(Z2,{item:ee,onClose:()=>_(!1),onCopy:se=>{Re(se)}})]})}function cP({prompt:e,onCopy:a}){const{t:i}=ge(),o=s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),a())};return d.jsx("div",{className:"result-prompt",onClick:a,onKeyDown:o,role:"button",tabIndex:0,title:i("result.copyPrompt"),"aria-label":i("result.copyPrompt"),children:d.jsx("span",{className:"result-prompt__text",children:e})})}function dP(){const e=w(y=>{const x=y.multimodePreviewFlightId;return x?y.multimodeSequences[x]??null:null}),a=w(y=>y.cancelMultimode),i=w(y=>{const x=y.multimodePreviewFlightId;return!!(x&&(y.activeFlightIds.has(x)||y.inFlight.some(E=>E.id===x)))}),o=w(y=>y.selectHistory),s=w(y=>y.currentImage),c=w(y=>y.openCanvas),{t:m}=ge(),p=y=>{o(y)},h=y=>{o(y),c()};if(!e)return null;const g=new Map,S=e.partials.filter(y=>y.index==null);for(const y of e.partials)y.index!=null&&g.set(y.index,y);const v=Array.from({length:e.requested},(y,x)=>{const E=e.images[x],P=g.get(x)??(E?void 0:S.shift());return{index:x,image:E,partial:P}});return d.jsxs("section",{className:"multimode-sequence","aria-live":"polite",children:[d.jsxs("div",{className:"multimode-sequence__header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"multimode-sequence__title",children:m("multimode.sequenceTitle")}),d.jsx("div",{className:"multimode-sequence__meta",children:m("multimode.sequenceProgress",{returned:e.returned,requested:e.requested})})]}),i?d.jsx("button",{type:"button",className:"secondary-btn",onClick:a,children:m("multimode.cancel")}):null]}),d.jsx("div",{className:`multimode-sequence__grid count-${Math.min(e.requested,4)}`,children:v.map(({index:y,image:x,partial:E})=>{const P=x&&s?.filename&&x.filename===s.filename;return d.jsxs("article",{className:`multimode-sequence__slot${x?" done":""}${P?" active":""}`,onClick:x?()=>p(x):void 0,onDoubleClick:x?()=>h(x):void 0,role:x?"button":void 0,tabIndex:x?0:void 0,onKeyDown:x?I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),p(x))}:void 0,children:[d.jsx("div",{className:"multimode-sequence__badge",children:m("multimode.stageLabel",{index:y+1})}),x?d.jsx("img",{src:x.url??x.image,alt:m("canvas.resultAlt"),loading:"lazy",decoding:"async",className:"multimode-sequence__img-fade"}):E?d.jsx("img",{src:E.image,alt:m("multimode.partialAlt"),loading:"lazy",decoding:"async",className:"multimode-sequence__img-fade"}):e.status==="pending"||e.status==="complete"?d.jsx("div",{className:"multimode-sequence__skeleton"}):d.jsx("div",{className:"multimode-sequence__empty",children:e.status==="error"?m("multimode.error"):e.status==="empty"?m("multimode.empty"):e.status==="canceled"?m("multimode.canceled"):e.status==="partial"?m("multimode.notReturned"):m("multimode.generating")})]},x?.filename??y)})})]})}function uP({zoom:e,minZoom:a,maxZoom:i,onZoomIn:o,onZoomOut:s,onReset:c,labels:m}){return d.jsxs("div",{className:"viewer-controls","aria-label":m.controls,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),onWheel:p=>p.stopPropagation(),children:[d.jsx("button",{type:"button",className:"viewer-control-btn",onClick:p=>{p.stopPropagation(),s()},disabled:e<=a,"aria-label":m.zoomOut,children:"-"}),d.jsxs("button",{type:"button",className:"viewer-control-btn viewer-control-btn--label",onClick:p=>{p.stopPropagation(),c()},"aria-label":m.reset,children:[Math.round(e*100),"%"]}),d.jsx("button",{type:"button",className:"viewer-control-btn",onClick:p=>{p.stopPropagation(),o()},disabled:e>=i,"aria-label":m.zoomIn,children:"+"})]})}function ys(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLButtonElement||e.isContentEditable:!1}function mP(e,a,i,o){if(!e)return!1;const s=a.find(c=>c.filename===e);return s?!!s.isFavorite:o!==void 0?o:i.has(e)}function _j(e,a){return a?e.filter(i=>i!=="starred"):Array.from(new Set([...e,"starred"]))}const no=1,IS=5,as=.22;function pP(e){return Math.min(IS,Math.max(no,e))}function fP(e){const[a,i]=R.useState(1),[o,s]=R.useState({x:0,y:0}),[c,m]=R.useState(null),p=R.useRef(0),h=R.useRef(null),g=R.useCallback(()=>{cancelAnimationFrame(p.current),p.current=0,h.current=null,i(1),s({x:0,y:0}),m(null)},[]);R.useEffect(()=>{g()},[g,e]),R.useEffect(()=>()=>{cancelAnimationFrame(p.current)},[]);const S=R.useCallback(I=>{i(k=>{const C=pP(k+I);return C<=no?(s({x:0,y:0}),no):Number(C.toFixed(2))})},[]),v=R.useCallback(I=>{I.preventDefault(),S(I.deltaY<0?as:-as)},[S]),y=R.useCallback(()=>{if(a>no){g();return}i(2)},[g,a]),x=R.useCallback(I=>{a<=no||I.button!==0||(I.preventDefault(),I.currentTarget.setPointerCapture(I.pointerId),m({pointerId:I.pointerId,startX:I.clientX,startY:I.clientY,baseX:o.x,baseY:o.y}))},[o.x,o.y,a]),E=R.useCallback(I=>{if(!c||c.pointerId!==I.pointerId)return;const k={x:c.baseX+I.clientX-c.startX,y:c.baseY+I.clientY-c.startY};h.current=k,cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{s(k),h.current=null})},[c]),P=R.useCallback(I=>{!c||c.pointerId!==I.pointerId||(cancelAnimationFrame(p.current),p.current=0,h.current&&(s(h.current),h.current=null),m(null),I.currentTarget.releasePointerCapture(I.pointerId))},[c]);return{zoom:a,pan:o,reset:g,zoomIn:()=>S(as),zoomOut:()=>S(-as),handleWheel:v,handleDoubleClick:y,handlePointerDown:x,handlePointerMove:E,handlePointerUp:P}}const gP=R.lazy(()=>$t(()=>import("./index-BA51BzWd.js"),[]).then(e=>({default:e.CanvasModeWorkspace})));function hP(e){return e==="low"?"l":e==="medium"?"m":e==="high"?"h":e??null}function yP(e){if(!e)return null;const a=e.match(/^(\d+)x\1$/);return a?`${a[1]}²`:e.replace("x","×")}function vP(e){const a=e.url??e.image;if(!e.canvasVersion||!e.canvasMergedAt||a.startsWith("data:"))return a;const i=a.includes("?")?"&":"?";return`${a}${i}canvasMergedAt=${e.canvasMergedAt}`}function em(){const e=w(T=>T.currentImage),a=w(T=>T.importLocalImageToHistory),i=w(T=>{const F=T.multimodePreviewFlightId;return F?T.multimodeSequences[F]??null:null}),o=w(T=>T.selectHistoryShortcutTarget),s=w(T=>T.trashHistoryItem),c=w(T=>T.permanentlyDeleteHistoryItemByShortcut),m=w(T=>T.markGeneratedResultsSeen),p=w(T=>T.activeGenerations),h=w(T=>T.canvasOpen),g=w(T=>T.openCanvas),S=w(T=>T.showToast),v=w(T=>T.history),y=w(T=>T.galleryFavorites),x=w(T=>T.toggleGalleryFavorite),{t:E}=ge(),[P,I]=R.useState(!1),[k,C]=R.useState(null),{creatingBlankCanvas:_,createBlankCanvas:N}=z2(),j=R.useRef(null),$=e?`${e.filename??e.url??e.image}:${e.canvasMergedAt??""}`:null,L=fP($),J=()=>{e?.prompt&&(navigator.clipboard.writeText(e.prompt),S(E("toast.promptCopied")))},re=T=>{if(T.key==="Delete"||T.key==="Backspace"){if(!e||T.target!==T.currentTarget||ys(T.target))return;if(T.preventDefault(),T.shiftKey){c(e);return}s(e);return}T.key!=="ArrowLeft"&&T.key!=="ArrowRight"&&T.key!=="Home"&&T.key!=="End"||T.target===T.currentTarget&&(ys(T.target)||(T.preventDefault(),T.key==="ArrowLeft"?o("previous"):T.key==="ArrowRight"?o("next"):T.key==="Home"?o("first"):T.key==="End"&&o("last")))},he=T=>{ys(T.target)||(m(),T.currentTarget.focus())},V=R.useCallback(()=>{window.requestAnimationFrame(()=>j.current?.focus())},[]),ee=async()=>{const T=e?.filename;if(!(!e||!T||k===T)){C(T);try{await x(e)}finally{C(F=>F===T?null:F)}}},oe=R.useCallback(T=>{Array.from(T.dataTransfer.types).includes("Files")&&(T.preventDefault(),I(F=>F||!0))},[]),Ne=R.useCallback(T=>{T.currentTarget.contains(T.relatedTarget)||I(!1)},[]),ne=R.useCallback(async T=>{if(!Array.from(T.dataTransfer.types).includes("Files"))return;T.preventDefault(),I(!1);const F=Array.from(T.dataTransfer.files).filter(W=>/^image\/(png|jpeg|webp)$/.test(W.type));F.length!==0&&await a(F[0])},[a]);if(h&&e)return d.jsx(R.Suspense,{fallback:d.jsx("main",{className:"canvas canvas--mode-open","aria-busy":"true"}),children:d.jsx(gP,{currentImage:e})});const H=hP(e?.quality),ae=yP(e?.size),ce=Cv(e?.model,e?.provider),be=e?vP(e):null,Se=mP(e?.filename,v,y,e?.isFavorite);return d.jsxs("main",{className:`canvas${P?" canvas--drop-active":""}`,onDragOver:oe,onDragLeave:Ne,onDrop:ne,children:[P?d.jsx("div",{className:"canvas__drop-overlay","aria-hidden":!0,children:d.jsx("span",{className:"canvas__drop-hint",children:E("canvas.drop.hint")})}):null,d.jsx("div",{className:`progress-bar${p>0?" active":""}`}),i?d.jsx(dP,{}):e&&be?d.jsxs("div",{ref:j,className:"result-container visible",tabIndex:0,onMouseDown:he,onKeyDown:re,"aria-label":E("canvas.imageViewerAria"),children:[d.jsxs("div",{className:`result-preview-frame canvas-annotation-frame${L.zoom>no?" canvas-annotation-frame--zoomed":""}`,onWheel:L.handleWheel,onDoubleClick:L.handleDoubleClick,onPointerDown:L.handlePointerDown,onPointerMove:L.handlePointerMove,onPointerUp:L.handlePointerUp,onPointerCancel:L.handlePointerUp,children:[e.filename?d.jsx(vS,{variant:"result",active:Se,busy:k===e.filename,label:E(Se?"gallery.unfavoriteAria":"gallery.favoriteAria"),onToggle:ee}):null,gt(e)?d.jsxs(d.Fragment,{children:[d.jsx("video",{className:"result-img",src:be,controls:!0,autoPlay:!0,loop:!0,playsInline:!0,style:{transform:`translate(${L.pan.x}px, ${L.pan.y}px) scale(${L.zoom})`}},$??void 0),d.jsx("div",{className:"result-drag-handle",draggable:!0,onDragStart:T=>{T.dataTransfer.setData("application/ima2-ref",JSON.stringify(yi(e))),T.dataTransfer.effectAllowed="copy"},title:E("canvas.dragToComposer"),"aria-label":E("canvas.dragToComposer"),children:E("canvas.dragHint")})]}):d.jsxs(d.Fragment,{children:[d.jsx("img",{className:"result-img",src:be,alt:E("canvas.resultAlt"),decoding:"async",fetchPriority:"high",style:{transform:`translate(${L.pan.x}px, ${L.pan.y}px) scale(${L.zoom})`},onDoubleClick:T=>{T.stopPropagation(),g()}},$??void 0),d.jsx("div",{className:"result-drag-handle",draggable:!0,onDragStart:T=>{T.dataTransfer.setData("application/ima2-ref",JSON.stringify({image:e.url||e.image,filename:e.filename})),T.dataTransfer.effectAllowed="copy"},title:E("canvas.dragToComposer"),"aria-label":E("canvas.dragToComposer"),children:E("canvas.dragHint")})]}),d.jsx(uP,{zoom:L.zoom,minZoom:no,maxZoom:IS,onZoomIn:L.zoomIn,onZoomOut:L.zoomOut,onReset:L.reset,labels:{controls:E("viewer.controls"),zoomIn:E("viewer.zoomIn"),zoomOut:E("viewer.zoomOut"),reset:E("viewer.reset")}})]}),d.jsx("div",{className:"result-meta",children:(gt(e)?[e.elapsed!=null?`${e.elapsed}s`:null,e.video?.duration?`${e.video.duration}s clip`:null,e.video?.resolution??null,e.video?.aspectRatio??null,Bb(e.videoContinuity),ce]:[e.elapsed!=null?`${e.elapsed}s`:null,e.usage?E("canvas.tokens",{n:e.usage.total_tokens??"?"}):null,WE(e.reasoningEffort),H,ae,ce]).filter(T=>!!T).join(" · ")}),d.jsx(sP,{onAfterDeleteFocus:V}),e.prompt?d.jsx(cP,{prompt:e.prompt,onCopy:J}):null]}):e?null:d.jsxs("div",{className:"canvas__blank-entry",children:[d.jsx("div",{className:"canvas__blank-sheet","aria-hidden":!0}),d.jsxs("div",{className:"canvas__blank-copy",children:[d.jsx("strong",{children:E("canvas.blank.title")}),d.jsx("span",{children:E("canvas.blank.subtitle")})]}),d.jsx("button",{type:"button",className:"canvas__blank-button",onClick:()=>{N()},disabled:_,children:E(_?"canvas.blank.creating":"canvas.blank.create")})]})]})}function bP(){return d.jsxs("div",{className:"classic-workspace",children:[d.jsx("div",{className:"classic-workspace__stage",children:d.jsx(em,{})}),d.jsxs("div",{className:"classic-workspace__dock",children:[d.jsx(qm,{variant:"bottom"}),d.jsx(Um,{})]})]})}const ES="ima2.customSizeSlots";function SP(e){if(!e||typeof e!="object")return!1;const a=e;return typeof a.id=="string"&&typeof a.w=="number"&&typeof a.h=="number"&&typeof a.updatedAt=="number"}function xP(){try{const e=localStorage.getItem(ES);if(!e)return[];const a=JSON.parse(e);return Array.isArray(a)?Wo(a.filter(SP)):[]}catch{return[]}}function AP(e){try{localStorage.setItem(ES,JSON.stringify(Wo(e)))}catch{}}function TP(e,a,i){return Gs({id:`slot_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,w:e,h:a,ratio:i,updatedAt:Date.now()})}function ci(e){return e.map(a=>({value:a.value,label:a.label,sub:a.sub}))}function CP(){const e=w(ne=>ne.sizePreset),a=w(ne=>ne.setSizePreset),i=w(ne=>ne.customW),o=w(ne=>ne.customH),s=w(ne=>ne.setCustomSize),{t:c}=ge(),[m,p]=R.useState(String(i)),[h,g]=R.useState(String(o)),[S,v]=R.useState(e==="custom"),[y,x]=R.useState(()=>xP()),[E,P]=R.useState(null),[I,k]=R.useState("free"),C=e==="custom",_=pm(m,h,i,o),N=gR().filter(ne=>ne.value==="auto");R.useEffect(()=>{p(String(i)),g(String(o))},[i,o]),R.useEffect(()=>{C||(v(!1),P(null))},[C]);function j(ne){x(ne),AP(ne)}function $(){const ne=_n(m,i),H=_n(h,o);s(ne,H),p(String(ne)),g(String(H))}function L(ne){ne.key==="Enter"&&(ne.preventDefault(),$())}function J(){a("custom"),v(!0),P(y.length>=Jo?y[0]?.id??null:null)}function re(ne){a(ne),ne!=="custom"&&(v(!1),P(null))}function he(ne){a("custom"),s(ne.w,ne.h),p(String(ne.w)),g(String(ne.h)),v(!1),P(ne.id)}function V(ne){k(ne.id);const H=sR(ne);H&&(p(String(H.w)),g(String(H.h)))}function ee(){const ne=TP(_.w,_.h,I),H=y.length>=Jo&&E?dR(y,E,ne):cR(y,ne);j(H),a("custom"),s(_.w,_.h),p(String(_.w)),g(String(_.h)),P(ne.id),v(!1)}const oe=_.reasons.length>0?_.reasons.map(ne=>c(`size.adjustedReasons.${ne}`)).join(", "):c("size.noAdjustment"),Ne=_.reasons.includes("maxPixels")&&_.requestedW===_.requestedH&&_.w===_.h?c("size.squareMaxHint",{size:`${uy}×${uy}`}):null;return d.jsxs("div",{className:"option-group size-picker",children:[d.jsx("div",{className:"section-title",children:c("size.title")}),d.jsx(xn,{title:"",items:ci(uR),value:e,onChange:re}),d.jsx(xn,{title:"",items:ci(mR),value:e,onChange:re}),d.jsx(xn,{title:"",items:ci(pR),value:e,onChange:re}),d.jsx(xn,{title:"",items:ci(fR),value:e,onChange:re}),d.jsxs("div",{className:"option-row size-picker__quick-row",children:[ci(N).map(ne=>d.jsxs("button",{type:"button",className:`option-btn${e===ne.value?" active":""}`,onClick:()=>re(ne.value),children:[ne.label,ne.sub?d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:ne.sub})]}):null]},ne.value)),d.jsxs("button",{type:"button",className:`option-btn${C?" active":""}`,onClick:J,children:[c("size.customPlus"),d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:c("size.customSub")})]})]}),y.length>0?d.jsx("div",{className:"option-row size-picker__slot-row",children:y.map(ne=>d.jsxs("button",{type:"button",className:`option-btn size-picker__slot${C&&i===ne.w&&o===ne.h?" active":""}`,onClick:()=>he(ne),children:[ne.w,"×",ne.h,d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:ne.ratio||c("size.customSlot")})]},ne.id))}):null,S?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"size-picker__ratio-row",children:iR.map(ne=>d.jsx("button",{type:"button",className:`size-picker__ratio${I===ne.id?" active":""}`,onClick:()=>V(ne),children:ne.id==="free"?c("size.ratioFree"):ne.label},ne.id))}),d.jsxs("div",{className:"option-row size-picker__custom-row",children:[d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:m,onChange:ne=>p(ne.target.value.replace(/\D/g,"")),onBlur:$,onKeyDown:L,placeholder:c("size.width")}),d.jsx("span",{className:"size-picker__dimension-separator","aria-hidden":"true",children:"×"}),d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:h,onChange:ne=>g(ne.target.value.replace(/\D/g,"")),onBlur:$,onKeyDown:L,placeholder:c("size.height")})]}),d.jsxs("div",{className:"size-picker__preview",children:[d.jsx("span",{children:c("size.normalizedPreview")}),d.jsx("strong",{children:lR(_.w,_.h)})]}),d.jsx("div",{className:"size-picker__preview size-picker__preview--reason",children:oe}),Ne?d.jsx("div",{className:"size-picker__preview size-picker__preview--detail",children:Ne}):null,y.length>=Jo?d.jsxs("div",{className:"size-picker__replace-row",children:[d.jsx("span",{children:c("size.replaceCustomSlot")}),y.map(ne=>d.jsxs("button",{type:"button",className:`size-picker__replace${E===ne.id?" active":""}`,onClick:()=>P(ne.id),children:[ne.w,"×",ne.h]},ne.id))]}):null,d.jsx("button",{type:"button",className:"size-picker__save",onClick:ee,children:y.length>=Jo?c("size.replaceCustomSlot"):c("size.saveCustomSlot")}),d.jsx("div",{className:"size-hint",children:c("size.hint")})]}):null]})}const ku=[1,2,4];function wP(){const e=w(C=>C.count),a=w(C=>C.setCount),i=w(C=>C.uiMode),o=w(C=>C.multimode),s=w(C=>C.multimodeMaxImages),c=w(C=>C.setMultimodeMaxImages),{t:m}=ge(),p=i==="classic"&&o,h=p?s:e,g=p?c:a,[S,v]=R.useState(!ku.includes(h)),[y,x]=R.useState(String(h));R.useEffect(()=>{v(!ku.includes(h)),x(String(h))},[p,h]);function E(C=y){const _=Yu(Number.parseInt(C,10));g(_),x(String(_))}function P(C){v(!1),x(String(C)),g(C)}function I(C){const _=Yu(h+C);v(!0),x(String(_)),g(_)}function k(C){C.key==="Enter"&&(C.preventDefault(),E())}return d.jsxs("div",{className:"option-group count-picker",children:[d.jsx("div",{className:"section-title",children:m(p?"multimode.maxStages":"count.title")}),d.jsxs("div",{className:"option-row",children:[ku.map(C=>d.jsx("button",{type:"button",className:`option-btn${h===C&&!S?" active":""}`,onClick:()=>P(C),children:C},C)),d.jsx("button",{type:"button",className:`option-btn${S?" active":""}`,onClick:()=>{v(C=>!C),x(String(h))},children:m("count.customPlus")})]}),S?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"count-picker__custom",children:[d.jsx("button",{type:"button",className:"count-picker__step",onClick:()=>I(-1),"aria-label":m("count.decrease"),children:"-"}),d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"count-picker__input",value:y,onChange:C=>x(C.target.value.replace(/\D/g,"")),onBlur:()=>E(),onKeyDown:k,"aria-label":m("count.customLabel")}),d.jsx("button",{type:"button",className:"count-picker__step",onClick:()=>I(1),"aria-label":m("count.increase"),children:"+"})]}),d.jsx("p",{className:"option-help",children:h>=5?m(p?"multimode.highCountHint":"count.highCountHint"):m(p?"multimode.minMaxHint":"count.minMaxHint")})]}):null]})}const IP={low:{"1024x1024":.006,"1024x1536":.005,"1536x1024":.005,"1024x1360":.005,"1360x1024":.005,"1024x1824":.006,"1824x1024":.006,"2048x2048":.012,"2048x1152":.009,"1152x2048":.009,"3840x2160":.023,"2160x3840":.023,auto:.006},medium:{"1024x1024":.053,"1024x1536":.041,"1536x1024":.041,"1024x1360":.041,"1360x1024":.041,"1024x1824":.05,"1824x1024":.05,"2048x2048":.106,"2048x1152":.08,"1152x2048":.08,"3840x2160":.2,"2160x3840":.2,auto:.053},high:{"1024x1024":.211,"1024x1536":.165,"1536x1024":.165,"1024x1360":.165,"1360x1024":.165,"1024x1824":.2,"1824x1024":.2,"2048x2048":.422,"2048x1152":.32,"1152x2048":.32,"3840x2160":.8,"2160x3840":.8,auto:.211}},EP={512:.045,"1K":.067,"2K":.101,"4K":.151},RP={512:.134,"1K":.134,"2K":.134,"4K":.24};function NP(e){return e<=512?"512":e<=1024?"1K":e<=2048?"2K":"4K"}function kP(e,a){const i=e.match(/^(\d+)x(\d+)$/);if(!i)return .003;const o=Math.max(Number(i[1]),Number(i[2])),s=NP(o),m=a==="nano-banana-pro"?RP:EP;return m[s]??m["1K"]??.003}function _P(e,a,i,o){return i==="gemini-api"?kP(a,o):IP[e]?.[a]??0}function MP(){const{t:e}=ge(),a=w(y=>y.provider),i=w(y=>y.quality),o=w(y=>y.multimode),s=w(y=>y.multimodeMaxImages),m=w(y=>y.getResolvedSize)(),p=w(y=>y.imageModel),h=a==="oauth"||a==="grok"||a==="agy",g=_P(i,m,a,p),S=h?e("cost.free"):o?e("cost.multimodeApprox",{amount:(g*s).toFixed(3),count:s}):e("cost.approx",{amount:g.toFixed(3)}),v=h?"var(--green)":void 0;return d.jsxs("div",{className:"cost-estimate",children:[d.jsx("span",{children:e("cost.label")}),d.jsx("span",{className:"price",style:v?{color:v}:void 0,children:S})]})}function RS(){const[e,a]=R.useState(null);return R.useEffect(()=>{let i=!1,o=null;const s=async()=>{try{const c=await hT();if(i)return;a(c),c.status==="starting"&&(o=setTimeout(s,3e3))}catch{i||a(null)}};return s(),()=>{i=!0,o&&clearTimeout(o)}},[]),e}function PP(){const[e,a]=R.useState(null),[i,o]=R.useState(!1);return R.useEffect(()=>{let s=!1;return yT().then(c=>{s||a(c)}).catch(()=>{s||o(!0)}),()=>{s=!0}},[]),{data:e,error:i}}function NS(){const[e,a]=R.useState(null);return R.useEffect(()=>{let i=!1,o=null;const s=async()=>{try{const c=await fetch("/api/grok/status");if(i)return;const m=await c.json();a(m),m.status!=="ready"&&(o=setTimeout(s,1e4))}catch{i||a({status:"offline"})}};return s(),()=>{i=!0,o&&clearTimeout(o)}},[]),e}function kS(){const[e,a]=R.useState(null),[i,o]=R.useState(null),s=R.useCallback(async()=>{try{const m=await(await fetch("/api/keys/status")).json();a(m),o(null)}catch(c){o(c instanceof Error?c:new Error(String(c)))}},[]);return R.useEffect(()=>{let c=!1,m=null;return(async()=>(await s(),c||(m=setInterval(s,3e4))))(),()=>{c=!0,m&&clearInterval(m)}},[s]),{data:e,error:i,mutate:s}}function _S(){const{t:e}=ge(),a=RS(),{data:i}=PP(),o=NS(),{data:s}=kS(),c=a?.status==="ready";let m=e("provider.oauthNotReady"),p;a?.status==="auth_required"?(m=e("provider.codexLoginRequired"),p=e("provider.codexLoginHint")):a?.status==="starting"?m=e("provider.oauthStarting"):a||(m=e("provider.serverUnreachable"));const h=i?.apiKeyValid===!0,g=o?.status==="ready",S=o?o.status==="offline"?e("provider.grokOffline"):o.status==="no_image_model"?e("provider.grokNoImageModel"):o.status==="error"?e("provider.grokNotReady"):"":e("provider.grokNotReady"),v=s?.xai?.valid===!0,y=s?.gemini?.valid===!0||s?.vertex?.valid===!0,x=s?.atlascloud?.valid===!0,E=s?.minimax?.valid===!0;return{oauth:{ok:c,reason:m,hint:p},api:{ok:h,reason:h?"":e("provider.apiInvalid")},grok:{ok:g,reason:S,hint:g?void 0:e("provider.grokOfflineHint")},"grok-api":{ok:v,reason:v?"":e("provider.xaiApiKeyRequired")},agy:{ok:!0,reason:""},"gemini-api":{ok:y,reason:y?"":e("provider.geminiApiKeyRequired")},atlascloud:{ok:x,reason:x?"":e("provider.atlasCloudApiKeyRequired")},minimax:{ok:E,reason:E?"":e("provider.minimaxApiKeyRequired")}}}const LP=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function uo(e,a){const i=R.useRef(null),o=R.useRef(a);return o.current=a,R.useEffect(()=>{if(!e)return;const s=document.activeElement instanceof HTMLElement?document.activeElement:null,c=i.current,m=()=>Array.from(c?.querySelectorAll(LP)??[]).filter(h=>!h.hidden&&h.getAttribute("aria-hidden")!=="true");window.requestAnimationFrame(()=>{(c?.querySelector("[data-modal-initial-focus]")??m()[0]??c)?.focus()});const p=h=>{if(h.key==="Escape"){h.preventDefault(),o.current();return}if(h.key!=="Tab")return;const g=m();if(g.length===0){h.preventDefault(),c?.focus();return}const S=g[0],v=g[g.length-1];h.shiftKey&&document.activeElement===S?(h.preventDefault(),v.focus()):!h.shiftKey&&document.activeElement===v&&(h.preventDefault(),S.focus())};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),window.requestAnimationFrame(()=>s?.focus())}},[e]),i}function OP({open:e,providerLabel:a,reason:i,hint:o,onClose:s}){const{t:c}=ge(),m=uo(e,s);if(!e)return null;const p=c("apiDisabled.title",{provider:a});return d.jsx("div",{className:"modal-backdrop",onClick:s,role:"presentation",children:d.jsxs("div",{ref:m,className:"modal",role:"dialog","aria-modal":"true","aria-label":p,tabIndex:-1,onClick:h=>h.stopPropagation(),children:[d.jsx("div",{className:"modal__title",children:p}),d.jsxs("div",{className:"modal__body",children:[d.jsx("p",{children:i}),o?d.jsx("p",{className:"modal__hint",children:o}):null]}),d.jsx("div",{className:"modal__actions",children:d.jsx("button",{type:"button",className:"modal__btn",onClick:s,"data-modal-initial-focus":!0,children:c("common.ok")})})]})})}const os="core:",_u="mcp:",Mu=[{value:"oauth",provider:"GPT",method:"OAuth"},{value:"api",provider:"GPT",method:"API"},{value:"grok",provider:"Grok",method:"OAuth"},{value:"grok-api",provider:"Grok",method:"API"},{value:"agy",provider:"Gemini",method:"agy"},{value:"gemini-api",provider:"Gemini",method:"API"},{value:"atlascloud",provider:"Atlas Cloud",method:"API"},{value:"minimax",provider:"MiniMax",method:"API"}];function Pu(e){return e.replace(/(^|-)([a-z])/g,(a,i,o)=>`${i}${o.toUpperCase()}`)}function Lu({tone:e}){return d.jsx("span",{className:`status-dot status-dot--${e==="ok"?"ok":e==="warn"?"warn":"bad"}`,"aria-hidden":"true"})}function Yy(e){return e.enabled?e.status.state==="connected"?e.executable===!1?"warn":"ok":e.status.state==="connecting"||e.status.state==="auth_required"?"warn":"bad":"bad"}function Xy({mcpProviders:e}){const{t:a}=ge(),i=w(_=>_.provider),o=w(_=>_.mcpProvider??null),s=w(_=>_.setProvider),c=_S(),[m,p]=R.useState(null),h=_=>{const N=c[_.value];return N.ok?a("provider.statusReady"):N.reason},g=_=>_.enabled?_.status.state==="connected"?_.executable===!1?`${a("provider.statusConnected")} · ${a("mcp.locked")}`:a("provider.statusConnected"):_.status.state==="connecting"?a("mcp.connecting"):_.status.state==="auth_required"?a("provider.statusAuthRequired"):a("provider.statusDisconnected"):a("mcp.disabledProvider"),S=[{label:a("mcp.coreProviders"),items:Mu.map(_=>{const N=c[_.value];return{value:`${os}${_.value}`,searchText:`${_.provider} ${_.method}`,label:d.jsxs("span",{className:"provider-option",children:[d.jsx(Lu,{tone:N.ok?"ok":"bad"}),d.jsxs("span",{children:[_.provider," ",_.method]})]}),sub:h(_)}})}],v=e.filter(_=>_.enabled).map(_=>({value:`${_u}${_.id}`,searchText:Pu(_.id),label:d.jsxs("span",{className:"provider-option",children:[d.jsx(Lu,{tone:Yy(_)}),d.jsx("span",{children:Pu(_.id)})]}),sub:g(_)}));v.length>0&&S.push({label:"MCP",items:v});const y=o?`${_u}${o}`:`${os}${i}`,x=o?null:Mu.find(_=>_.value===i)??null,E=o?e.find(_=>_.id===o)??null:null,P=x?h(x):E?g(E):a("provider.statusDisconnected"),I=x?c[x.value].ok?"ok":"bad":E?Yy(E):"bad",k=x?x.method:"MCP",C=_=>{if(_.startsWith(os)){const $=_.slice(os.length),L=Mu.find(re=>re.value===$),J=c[$];if(!J.ok){p({label:L?`${L.provider} ${L.method}`:$,reason:J.reason,hint:J.hint});return}s($);return}const N=_.slice(_u.length),j=e.find($=>$.id===N);if(!j||!j.enabled||j.status.state!=="connected"){p({label:Pu(N),reason:!j||!j.enabled?a("mcp.disabledProvider"):a("mcp.disconnectedSelection")});return}Qs(N,w.setState,w.getState)};return d.jsxs("div",{className:"option-group provider-status-select","data-testid":"provider-status-select",children:[d.jsx("div",{className:"section-title",children:a("provider.authTitle")}),d.jsx(tr,{groups:S,value:y,onChange:C,portal:!0,ariaLabel:a("provider.authTitle"),className:"provider-status-select__select"}),d.jsxs("div",{className:"provider-status-line","data-tone":I,children:[d.jsx(Lu,{tone:I}),d.jsxs("span",{className:"provider-status-line__key",children:[a("provider.statusLineTitle"),":"]}),d.jsx("span",{className:"provider-status-line__value",children:P})]}),d.jsxs("div",{className:"provider-auth-chip",title:a("provider.authMethodTitle"),children:[d.jsx("span",{children:k}),I!=="bad"?d.jsx("span",{className:"provider-auth-chip__state",children:a("provider.authActive")}):null]}),d.jsx(OP,{open:!!m,providerLabel:m?.label??"",reason:m?.reason??"",hint:m?.hint,onClose:()=>p(null)})]})}const jP=[{value:"1:1",label:"1:1"},{value:"3:2",label:"3:2"},{value:"2:3",label:"2:3"},{value:"4:3",label:"4:3"},{value:"3:4",label:"3:4"},{value:"16:9",label:"16:9"},{value:"9:16",label:"9:16"},{value:"2:1",label:"2:1"},{value:"1:2",label:"1:2"},{value:"auto",label:"Auto"}],GP=[{value:"1k",label:"1K"},{value:"2k",label:"2K"}];function DP(){const{t:e}=ge(),a=w(c=>c.grokAspectRatio),i=w(c=>c.grokResolution),o=w(c=>c.setGrokAspectRatio),s=w(c=>c.setGrokResolution);return d.jsxs("div",{className:"option-group grok-size-picker",children:[d.jsx("div",{className:"section-title",children:e("size.grokAspectTitle")}),d.jsx("div",{className:"grok-size-picker__aspects",children:jP.map(c=>d.jsx("button",{type:"button",className:`option-btn grok-size-picker__aspect${a===c.value?" active":""}`,onClick:()=>o(c.value),children:c.label},c.value))}),d.jsx("div",{className:"section-title",style:{marginTop:8},children:e("size.grokResolutionTitle")}),d.jsx("div",{className:"grok-size-picker__resolutions",children:GP.map(c=>d.jsx("button",{type:"button",className:`option-btn grok-size-picker__res${i===c.value?" active":""}`,onClick:()=>s(c.value),children:c.label},c.value))})]})}const FP=[{value:"grok-imagine-image",label:"Grok",sub:"Fast"},{value:"grok-imagine-image-quality",label:"Grok+",sub:"Best"}];function zP(){const{t:e}=ge(),a=w(o=>o.imageModel),i=w(o=>o.setImageModel);return d.jsx(xn,{title:e("quality.grokModelTitle"),items:FP,value:a,onChange:i})}function MS({values:e,value:a,defaultValue:i,onChange:o,allowAuto:s=!1,disabled:c,ariaLabel:m}){const{t:p}=ge(),h=R.useId();if(e.length===0)return null;const g=a??i??e[0],S=e.reduce((E,P,I)=>Math.abs(P-g)<Math.abs(e[E]-g)?I:E,0),v=a===null,y=e[0],x=e[e.length-1];return d.jsxs("div",{className:`ctl-duration${v?" is-auto":""}${c?" is-disabled":""}`,children:[d.jsxs("div",{className:"ctl-duration__head",children:[d.jsx("output",{htmlFor:h,className:"ctl-duration__value",children:v?`${p("size.autoLabel")} · ${e[S]}s`:`${e[S]}s`}),s?d.jsx("button",{type:"button",className:`option-btn ctl-duration__auto${v?" active":""}`,"aria-pressed":v,disabled:c,onClick:()=>o(null),children:p("size.autoLabel")}):null]}),d.jsx("input",{id:h,type:"range",className:"ctl-duration__range",min:0,max:e.length-1,step:1,value:S,disabled:c,"aria-label":m,"aria-valuetext":`${e[S]}s`,onChange:E=>o(e[Number(E.target.value)]??e[0])}),d.jsxs("div",{className:"ctl-duration__scale","aria-hidden":"true",children:[d.jsxs("span",{children:[y,"s"]}),d.jsxs("span",{children:[x,"s"]})]})]})}const qP=[{value:"480p",label:"480p"},{value:"720p",label:"720p"},{value:"1080p",label:"1080p",sub:"1.5 HD"}],UP=["auto","1:1","16:9","9:16","4:3","3:4","3:2","2:3"].map(e=>({value:e,label:e})),Qy=[3,5,8,10,12,15],HP=[{value:dm,label:"Grok V",sub:"Fast"},{value:Ea,label:"Grok V1.5",sub:"HD"}];function BP(){const{t:e}=ge(),a=w(V=>V.videoModelSelected),i=w(V=>V.selectVideoModel),o=w(V=>V.activeVideoRefCount()),s=w(V=>V.videoDuration),c=w(V=>V.setVideoDuration),m=w(V=>V.videoResolution),p=w(V=>V.setVideoResolution),h=w(V=>V.videoAspectRatio),g=w(V=>V.setVideoAspectRatio),S=w(V=>V.videoTopic),v=w(V=>V.setVideoTopic),y=w(V=>V.showToast),x=w(V=>V.videoContinuityLineage),E=w(V=>V.selectedPresetIds),P=w(V=>V.removePreset),I=E.map(V=>zb(V)).filter(V=>V?.category==="camera-motion"),k=o>=2?Ev:15,C=Rv(o),_=Bb(x),N=vu(a,"1080p",C),j=vu(Ea,"1080p",C),$=qP.map(V=>V.value==="1080p"?{...V,disabled:!j}:V);R.useEffect(()=>{vu(a,m,C)||p("720p")},[C,m,p,a]);const L=V=>{if(V==="1080p"){if(!j)return;N||i(Ea)}p(V)},[J,re]=R.useState(null);R.useEffect(()=>{fetch("/api/config/grok-planner").then(V=>V.json()).then(re).catch(()=>{})},[]);const he=async V=>{const ee=J?.model;re(oe=>oe?{...oe,model:V}:null);try{const oe=await fetch("/api/config/grok-planner",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:V})});if(!oe.ok)throw new Error(`HTTP ${oe.status}`)}catch{re(oe=>oe&&ee?{...oe,model:ee}:oe),y(e("video.plannerUpdateFailed"),!0)}};return d.jsxs("div",{className:"right-panel-settings video-controls",children:[d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("quality.grokModelTitle")??"Model"}),d.jsx("div",{className:"option-row",children:HP.map(V=>d.jsxs("button",{type:"button",className:`option-btn${a===V.value?" active":""}`,onClick:()=>i(V.value),children:[V.label,d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:V.sub})]},V.value))})]}),d.jsxs("div",{className:"provider-compat-note",role:"note",children:[d.jsx("strong",{children:e("video.modeLabel")}),d.jsx("span",{children:e(`video.mode.${C}`,{n:o})})]}),_?d.jsxs("div",{className:"provider-compat-note",role:"note",children:[d.jsx("strong",{children:e("common.continuity")}),d.jsx("span",{children:_})]}):null,I.length>0&&d.jsx(zm,{ariaLabel:e("video.selectedCameraPresets"),children:I.map(V=>d.jsx(yS,{onRemove:()=>P(V.id),removeLabel:e("common.removeNamed",{name:V.name}),children:V.name},V.id))}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("video.seriesTopicTitle")??"시리즈 주제"}),d.jsx("input",{type:"text",className:"video-topic-input",placeholder:e("video.seriesTopicPlaceholder")??"예: 한국 여행 브이로그",value:S,onChange:V=>v(V.target.value)})]}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("video.durationTitle")}),d.jsx(MS,{values:Qy.filter(V=>V<=k),value:s,ariaLabel:e("video.durationTitle"),onChange:V=>c(V??Qy[0])})]}),d.jsx(xn,{title:e("video.resolutionTitle"),help:j?void 0:e("video.resolution1080Help"),items:$,value:m,onChange:L}),d.jsx(xn,{title:e("video.aspectTitle"),items:UP,value:h,onChange:g}),J&&d.jsx("div",{className:"video-controls__pills",children:d.jsx(tr,{className:"video-controls__pill",items:J.options.map(V=>({value:V,label:V})),value:J.model,onChange:V=>{he(V)},ariaLabel:e("video.plannerModelTitle")})}),d.jsxs("details",{className:"provider-compat-details",style:{marginTop:8},children:[d.jsx("summary",{children:e("common.activePrompt")}),d.jsx("p",{children:Ts})]})]})}const VP="",PS=3;function Jy(e,a,i,o){const s=[],c=new Set;for(const m of[a,...e])!m?.filename||c.has(m.filename)||gt(m)!==o||o&&!/\.(?:mp4|mov)$/i.test(m.filename)||(c.add(m.filename),s.push({filename:m.filename,current:m===a}));for(const m of i){const p=m.filePath,h=o?m.kind==="video":m.kind==="image"||m.kind==="element",g=o?/\.(?:mp4|mov)$/i.test(p??""):/\.(?:png|jpe?g|webp)$/i.test(p??"");!p||!h||!g||c.has(p)||(c.add(p),s.push({filename:p,current:!1,label:m.name||p,source:m.kind==="element"?"element":"asset"}))}return s}function KP(e,a){return e[a]??null}function LS(e,a,i){const o=!a||e.some(s=>s.filename===a);return[{value:VP,label:i("mcp.referenceNone")},...o?[]:[{value:a,label:a,sub:i("mcp.referenceMissing")}],...e.map(s=>({value:s.filename,label:s.label??s.filename,sub:s.current?i("mcp.referenceCurrent"):s.source?i(`mcp.referenceSource.${s.source}`):void 0}))]}function Ou({id:e,label:a,value:i,candidates:o,disabled:s,title:c,help:m,onChange:p,t:h}){return d.jsxs("div",{className:"mcp-reference-slot",children:[d.jsx("label",{className:"mcp-reference-slot__label",htmlFor:e,children:a}),d.jsx(tr,{id:e,items:LS(o,i??"",h),value:i??"",onChange:p,ariaLabel:a,placeholder:h("mcp.referenceSelect"),disabled:s,title:c,portal:!0}),m?d.jsx("p",{className:"option-help",children:m}):null]})}function $P({index:e,images:a,selection:i,disabled:o,onChange:s,t:c}){const m=KP(i.references,e),p=new Set(i.references.filter((E,P)=>P!==e).map(E=>E.filename)),h=m?.dataUrl?{filename:m.filename,current:!1,label:m.displayName??c("mcp.referenceLocalFallback"),source:"local"}:null,g=[...h?[h]:[],...a.filter(E=>!p.has(E.filename))],S=E=>{const P=[...i.references];E?P[e]={filename:E,...m?.tag?{tag:m.tag}:{}}:P.splice(e,1),s({...i,references:P})},v=E=>{if(!m)return;const P=[...i.references],{tag:I,...k}=m;P[e]={...k,...E?{tag:E}:{}},s({...i,references:P})},y=!!(m?.tag&&!fm(m.tag)),x=`mcp-reference-tag-error-${e}`;return d.jsxs("div",{className:"mcp-reference-slot__reference",children:[d.jsx(tr,{items:LS(g,m?.filename??"",c),value:m?.filename??"",onChange:S,ariaLabel:c("mcp.imageReferenceAria",{index:e+1}),placeholder:c("mcp.referenceSelect"),disabled:o,portal:!0}),d.jsxs("div",{children:[d.jsx("input",{type:"text",value:m?.tag??"",onChange:E=>v(E.target.value),"aria-label":c("mcp.referenceTagAria",{index:e+1}),placeholder:c("mcp.referenceTagPlaceholder"),"aria-invalid":y,"aria-describedby":y?x:void 0,maxLength:32,disabled:o||!m}),y?d.jsx("p",{id:x,className:"settings-row__microcopy",role:"alert",children:c("mcp.referenceTagInvalid")}):null]})]})}function YP({selection:e,disabled:a,onChange:i,t:o}){const s=R.useRef(null),[c,m]=R.useState(null),p=e.references.length>=PS,h=async g=>{const S=g.target.files?.[0];if(g.target.value="",!!S){if(!/^image\/(?:png|jpeg|webp)$/i.test(S.type)){m(o("mcp.referenceLocalInvalidType"));return}try{const v=await Tm(S),y=`local:${globalThis.crypto.randomUUID()}`;i({...e,references:[...e.references,{filename:y,displayName:S.name,dataUrl:v}]}),m(null)}catch{m(o("mcp.referenceLocalReadFailed"))}}};return d.jsxs("div",{children:[d.jsx("input",{ref:s,className:"sr-only",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:g=>{h(g)},disabled:a||p}),d.jsx("button",{type:"button",className:"option-btn",onClick:()=>s.current?.click(),disabled:a||p,children:o("mcp.referenceAttachLocal")}),d.jsx("p",{className:"option-help",children:o("mcp.referenceAttachHelp")}),c?d.jsx("p",{className:"settings-row__microcopy",role:"alert",children:c}):null]})}function XP({images:e,selection:a,disabled:i,onChange:o,t:s}){return d.jsxs("div",{className:"mcp-reference-slot",children:[d.jsx("div",{className:"mcp-reference-slot__label",children:s("mcp.imageReferencesLabel")}),Array.from({length:PS},(c,m)=>d.jsx($P,{index:m,images:e,selection:a,disabled:i,onChange:o,t:s},m)),d.jsx(YP,{selection:a,disabled:i,onChange:o,t:s})]})}function QP({inputRoles:e,disabled:a}){const{t:i}=ge(),o=w(v=>v.history),s=w(v=>v.currentImage),c=w(v=>v.assets),m=w(v=>v.mcpReferenceSelection)??Tn(),p=R.useMemo(()=>Jy(o,s,c,!1),[o,s,c]),h=R.useMemo(()=>Jy(o,s,c,!0),[o,s,c]),g=v=>qk(v,w.setState,w.getState),S=m.startFrameFilename?void 0:i("mcp.endFrameNeedsStart");return d.jsxs("div",{className:"mcp-reference-slots",children:[e.includes("start_image")?d.jsx(Ou,{id:"mcp-start-frame",label:i("mcp.startFrameLabel"),value:m.startFrameFilename,candidates:p,disabled:a,t:i,onChange:v=>g({...m,startFrameFilename:v||null,...v?{}:{endFrameFilename:null}})}):null,e.includes("end_image")?d.jsx(Ou,{id:"mcp-end-frame",label:i("mcp.endFrameLabel"),value:m.endFrameFilename,candidates:p,disabled:a||!m.startFrameFilename,title:S,help:S,t:i,onChange:v=>g({...m,endFrameFilename:v||null})}):null,e.includes("image_references")?d.jsx(XP,{images:p,selection:m,disabled:a,onChange:g,t:i}):null,e.includes("video_references")?d.jsx(Ou,{id:"mcp-video-reference",label:i("mcp.videoReferenceLabel"),value:m.referenceVideoFilename,candidates:h,disabled:a,t:i,help:i("mcp.videoReferenceCostNote"),onChange:v=>g({...m,referenceVideoFilename:v||null})}):null]})}function JP(e){return Array.isArray(e)&&e.includes("image_references")}function WP(e){return e.mentionElementIds.length>0&&e.characterElementId?"conflict":"ok"}function Mj(e,a){return a.mode!=="trained-id"||!Array.isArray(a.trainedFromRefs)?!1:a.trainedFromRefs.length!==e.length?!0:a.trainedFromRefs.some((i,o)=>e[o]!==i)}function Pj(e){return e.length>3}function ZP({inputRoles:e,disabled:a}){const{t:i}=ge(),o=w(g=>g.assets),s=w(g=>g.mcpCharacterElementId??null),c=w(g=>g.selectedElementIds??[]);if(!JP(e))return null;const m=o.filter(g=>g.kind==="element"&&g.metadata?.elementKind==="character"),p=WP({mentionElementIds:c,characterElementId:s})==="conflict",h=!!a||c.length>0;return d.jsxs("div",{className:"mcp-character-slot","data-testid":"mcp-character-slot",children:[d.jsx("div",{className:"section-title",children:i("mcp.characterSlotLabel")}),d.jsxs("select",{value:s??"",disabled:h,"aria-label":i("mcp.characterSlotLabel"),title:c.length>0?i("mcp.characterSlotConflictHint"):void 0,onChange:g=>w.setState({mcpCharacterElementId:g.target.value||null}),children:[d.jsx("option",{value:"",children:i("mcp.characterSlotNone")}),m.map(g=>d.jsx("option",{value:g.id,children:g.name},g.id))]}),p?d.jsx("p",{className:"option-help",role:"alert",children:i("mcp.characterSlotConflictHint")}):null]})}const Wy=new Set(["duration","resolution","quality","mode"]);function Zy(e){return e.filter((a,i)=>e.findIndex(o=>o===a)===i)}function Vm(e){return e.options&&e.options.length>0?Zy(e.options):e.type==="boolean"?[!0,!1]:e.type!=="number"||e.min===void 0||e.max===void 0?[]:Number.isInteger(e.min)&&Number.isInteger(e.max)&&e.max-e.min<=20?Array.from({length:e.max-e.min+1},(a,i)=>e.min+i):Zy([e.min,...e.default!==void 0?[e.default]:[],e.max])}function ev(e,a){return{duration:a("mcp.durationLabel"),resolution:a("mcp.resolutionLabel"),quality:a("mcp.qualityLabel"),mode:a("mcp.modeLabel"),generateAudio:a("mcp.audioLabel"),generate_audio:a("mcp.audioLabel"),sound:a("mcp.audioLabel")}[e]??e.replace(/_/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function eL(e,a){return typeof e=="boolean"?a(e?"mcp.onLabel":"mcp.offLabel"):String(e)}function tL(e){return[...Vm(e).filter(i=>typeof i=="number")].sort((i,o)=>i-o)}function nL({parameter:e,value:a,disabled:i,onChange:o}){const{t:s}=ge();if(e.name==="duration"&&e.type==="number"){const p=tL(e);if(p.length>1){const h=ev(e.name,s);return d.jsxs("div",{className:"mcp-preset-row",children:[d.jsx("div",{className:"section-title",children:h}),d.jsx(MS,{values:p,value:typeof a=="number"?a:null,defaultValue:typeof e.default=="number"?e.default:void 0,allowAuto:!e.required,disabled:i,ariaLabel:h,onChange:o})]})}}const c=Vm(e);if(c.length===0)return null;const m=ev(e.name,s);return d.jsxs("div",{className:"mcp-preset-row",children:[d.jsx("div",{className:"section-title",children:m}),d.jsxs("div",{className:"mcp-preset-row__options",role:"group","aria-label":m,children:[e.required?null:d.jsx("button",{type:"button",className:`option-btn${a===void 0?" active":""}`,"aria-pressed":a===void 0,disabled:i,onClick:()=>o(null),children:s("size.autoLabel")}),c.map(p=>d.jsx("button",{type:"button",className:`option-btn${a===p?" active":""}`,"aria-pressed":a===p,disabled:i,onClick:()=>o(p),title:e.description,children:eL(p,s)},`${typeof p}:${String(p)}`))]})]})}function tv({entries:e,parameters:a,disabled:i,onParameter:o}){return d.jsx(d.Fragment,{children:e.map(s=>d.jsx(nL,{parameter:s,value:a[s.name],disabled:i,onChange:c=>o(s.name,c)},s.name))})}function aL({entry:e,ratio:a,parameters:i,disabled:o,onRatio:s,onParameter:c}){const{t:m}=ge(),p=e.capabilities.aspectRatios.filter(y=>y!=="auto"),h=e.capabilities.parameters.filter(y=>Vm(y).length>0),g=h.filter(y=>Wy.has(y.name)),S=h.filter(y=>!Wy.has(y.name)),v=e.capabilities.inputRoles.some(y=>y==="start_image"||y==="end_image"||y==="image_references"||y==="video_references");return d.jsxs("div",{className:"mcp-model-presets","data-capability-source":e.capabilities.source,children:[p.length>0?d.jsxs("div",{className:"mcp-preset-row",children:[d.jsx("div",{className:"section-title",children:m("mcp.aspectRatioLabel")}),d.jsxs("div",{className:"mcp-preset-row__options",role:"group","aria-label":m("mcp.aspectRatioLabel"),children:[d.jsx("button",{type:"button",className:`option-btn${a===null?" active":""}`,"aria-pressed":a===null,disabled:o,onClick:()=>s(null),children:m("size.autoLabel")}),p.map(y=>d.jsx("button",{type:"button",className:`option-btn${a===y?" active":""}`,"aria-pressed":a===y,disabled:o,onClick:()=>s(y),children:y},y))]})]}):null,d.jsx(tv,{entries:g,parameters:i,disabled:o,onParameter:c}),v?d.jsxs("div",{className:"mcp-tool-inputs",children:[d.jsx("div",{className:"section-title",children:m("mcp.toolInputsLabel")}),d.jsx(QP,{inputRoles:e.capabilities.inputRoles,disabled:o}),d.jsx(ZP,{inputRoles:e.capabilities.inputRoles,disabled:o})]}):null,S.length>0?d.jsxs("details",{className:"mcp-advanced-presets",children:[d.jsx("summary",{children:m("mcp.advancedPresetsLabel")}),d.jsx(tv,{entries:S,parameters:i,disabled:o,onParameter:c})]}):null,p.length===0&&h.length===0?d.jsx("p",{className:"option-help",children:m("mcp.providerDefaultsHelp")}):null]})}const rs={image:[],video:[]},oL={};function rL(e){return e.replace(/(^|-)([a-z])/g,(a,i,o)=>`${i}${o.toUpperCase()}`)}function iL({record:e}){const{t:a}=ge(),i=w(_=>_.mcpProvider??null),o=w(_=>_.mcpModel??null),s=w(_=>_.mcpMediaKind??"image"),c=w(_=>_.mcpRatio??null),p=w(_=>_.mcpParameters)??oL,[h,g]=R.useState(rs),[S,v]=R.useState("idle"),[y,x]=R.useState(0),E=e?.executable===!1,P=e?.status.state==="connected";if(R.useEffect(()=>{if(!i||!P){g(rs),v("idle");return}const _=new AbortController;return g(rs),v("loading"),sS(i,_.signal).then(N=>{_.signal.aborted||(g(N),v("ready"))}).catch(N=>{N.name!=="AbortError"&&(_.signal.aborted||(g(rs),v("error")))}),()=>_.abort()},[i,P,y]),!i)return null;const I=s==="video"?h.video:h.image,k=I.find(_=>_.id===o)??null,C=_=>Dk(_,w.setState,w.getState);return d.jsxs("div",{className:"mcp-generation-controls","data-testid":"mcp-generation-controls",children:[d.jsxs("div",{className:"option-group",children:[d.jsxs("div",{className:"section-title mcp-generation-controls__header",children:[d.jsxs("span",{children:[rL(i)," · MCP"]}),d.jsx("button",{type:"button",className:"mcp-generation-controls__exit",onClick:()=>Qs(null,w.setState,w.getState),children:a("mcp.exitLane")})]}),P?null:d.jsx("p",{className:"option-help",children:a("mcp.disconnectedSelection")}),E?d.jsx("p",{className:"option-help",children:a("mcp.higgsfieldLocked")}):null]}),d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"option-group",children:d.jsxs("div",{className:"option-row",children:[d.jsx("button",{type:"button",className:`option-btn${s==="image"?" active":""}`,"aria-pressed":s==="image",onClick:()=>C("image"),children:a("grokMode.image")}),d.jsx("button",{type:"button",className:`option-btn${s==="video"?" active":""}`,"aria-pressed":s==="video",onClick:()=>C("video"),children:a("grokMode.video")})]})}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:a("mcp.modelSectionTitle")}),S==="loading"?d.jsx("p",{className:"option-help",role:"status",children:a("mcp.loadingModels")}):S==="error"?d.jsxs("div",{className:"mcp-catalog-state",role:"alert",children:[d.jsx("span",{children:a("mcp.modelsLoadFailed")}),d.jsx("button",{type:"button",className:"settings-action-btn",onClick:()=>x(_=>_+1),children:a("mcp.retryModels")})]}):S==="ready"&&I.length===0?d.jsx("p",{className:"option-help",children:a("mcp.noModels")}):k?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mcp-selected-model",children:[d.jsx("strong",{children:k.label}),k.description?d.jsx("span",{children:k.description}):null]}),d.jsx(aL,{entry:k,ratio:c,parameters:p,disabled:E,onRatio:_=>Fk(_,w.setState),onParameter:(_,N)=>zk(_,N,w.setState,w.getState)})]}):d.jsx("p",{className:"option-help",children:a(o?"mcp.providerDefaultsHelp":"mcp.chooseModelForPresets")})]})]})]})}const lL=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],is=[{value:"1:1",label:"1:1"},{value:"2:3",label:"2:3"},{value:"3:2",label:"3:2"},{value:"3:4",label:"3:4"},{value:"4:3",label:"4:3"},{value:"4:5",label:"4:5"},{value:"5:4",label:"5:4"},{value:"9:16",label:"9:16"},{value:"16:9",label:"16:9"},{value:"21:9",label:"21:9"}],sL=[{value:"512",label:"512px"},{value:"1K",label:"1K"},{value:"2K",label:"2K"},{value:"4K",label:"4K"}],Is={"1:1":{512:"512x512","1K":"1024x1024","2K":"2048x2048","4K":"4096x4096"},"2:3":{512:"424x632","1K":"848x1264","2K":"1696x2528","4K":"3392x5056"},"3:2":{512:"632x424","1K":"1264x848","2K":"2528x1696","4K":"5056x3392"},"3:4":{512:"448x600","1K":"896x1200","2K":"1792x2400","4K":"3584x4800"},"4:3":{512:"600x448","1K":"1200x896","2K":"2400x1792","4K":"4800x3584"},"4:5":{512:"464x576","1K":"928x1152","2K":"1856x2304","4K":"3712x4608"},"5:4":{512:"576x464","1K":"1152x928","2K":"2304x1856","4K":"4608x3712"},"9:16":{512:"384x688","1K":"768x1376","2K":"1536x2752","4K":"3072x5504"},"16:9":{512:"688x384","1K":"1376x768","2K":"2752x1536","4K":"5504x3072"},"21:9":{512:"792x168","1K":"1584x672","2K":"3168x1344","4K":"6336x2688"}};function cL(e){for(const[a,i]of Object.entries(Is))for(const[o,s]of Object.entries(i))if(s===e)return{ratio:a,res:o};return null}function dL(e,a){const i=e/a;let o="1:1",s=1/0;const c=[...Object.keys(Is),"1:8","8:1","1:4","4:1"];for(const h of c){const[g,S]=h.split(":").map(Number),v=Math.abs(i-g/S);v<s&&(s=v,o=h)}const m=Math.max(e,a),p=m<=512?"512":m<=1024?"1K":m<=2048?"2K":"4K";return{ratio:o,res:p}}function OS(){const{t:e}=ge(),a=w(ie=>ie.provider),i=w(ie=>ie.quality),o=w(ie=>ie.setQuality),s=w(ie=>ie.format),c=w(ie=>ie.setFormat),m=w(ie=>ie.moderation),p=w(ie=>ie.setModeration),h=w(ie=>ie.multimode),g=w(ie=>ie.setMultimode),S=w(ie=>ie.imageModel),v=w(ie=>ie.setImageModel),y=w(ie=>ie.selectVideoModel),x=w(ie=>ie.sizePreset),E=w(ie=>ie.customW),P=w(ie=>ie.customH),I=w(ie=>ie.setSizePreset),k=w(ie=>ie.setCustomSize),C=w(ie=>ie.uiMode),_=w(ie=>ie.videoModelSelected),N=w(ie=>ie.mcpProvider??null),{providers:j}=cS(),$=C==="classic",L=a==="grok"||a==="grok-api",J=a==="agy",re=a==="gemini-api",he=J||re,V=L||he,ee=x==="custom"?`${E}x${P}`:"1024x1024",oe=re&&x==="auto",Ne=re&&!oe?cL(ee):null,ne=Ne??{ratio:"",res:""},H=re&&!oe&&x==="custom"&&!Ne,ae=S==="nano-banana-pro"?"nano-banana-pro":"nano-banana-2",[ce,be]=R.useState(!1),[Se,T]=R.useState(String(E)),[F,W]=R.useState(String(P)),U=(ie,lt)=>{const at=Is[ie||"1:1"]?.[lt||"1K"]||"1024x1024",[st,bt]=at.split("x").map(Number);be(!1),I("custom"),k(st,bt)},le=()=>{const ie=Number(Se),lt=Number(F);!Number.isFinite(ie)||!Number.isFinite(lt)||ie<=0||lt<=0||(I("custom"),k(ie,lt),be(!1))},pe=[{value:"low",label:e("quality.lowLabel"),sub:e("quality.lowSub")},{value:"medium",label:e("quality.mediumLabel"),sub:e("quality.mediumSub")},{value:"high",label:e("quality.highLabel"),sub:e("quality.highSub")}],xe=[{value:"auto",label:e("moderation.autoLabel"),sub:e("moderation.autoSub")},{value:"low",label:e("moderation.lowLabel"),sub:e("moderation.lowSub"),color:"var(--amber)"}],Oe=[{value:"nano-banana-2",label:"Nano",sub:"Banana 2"},{value:"nano-banana-pro",label:"Nano",sub:"Banana Pro"}],Re=L?{title:e("provider.grokCompatTitle"),body:e("provider.grokCompatBody")}:J?{title:e("provider.agyCompatTitle"),body:e("provider.agyCompatBody")}:re?{title:e("provider.geminiApiCompatTitle"),body:e("provider.geminiApiCompatBody")}:{title:e("provider.gptCompatTitle"),body:e("provider.gptCompatBody")},Ze=ie=>{ie==="video"?y("grok-imagine-video"):v(S)};return N?d.jsxs("div",{className:"right-panel-settings",role:"tabpanel",children:[d.jsx(Xy,{mcpProviders:j}),d.jsx(iL,{record:j.find(ie=>ie.id===N)??null})]}):d.jsxs("div",{className:"right-panel-settings",role:"tabpanel",children:[d.jsx(Xy,{mcpProviders:j}),d.jsxs("details",{className:"provider-compat-details",children:[d.jsx("summary",{children:Re.title}),d.jsx("p",{children:Re.body})]}),L&&d.jsx("div",{className:"option-group grok-mode-toggle",children:d.jsxs("div",{className:"option-row",children:[d.jsx("button",{type:"button",className:`option-btn${_?"":" active"}`,onClick:()=>Ze("image"),children:e("grokMode.image")}),d.jsx("button",{type:"button",className:`option-btn${_?" active":""}`,onClick:()=>Ze("video"),children:e("grokMode.video")})]})}),_?d.jsx(BP,{}):d.jsxs(d.Fragment,{children:[J?null:L?d.jsxs(d.Fragment,{children:[d.jsx(zP,{}),d.jsx(DP,{})]}):re?d.jsxs(d.Fragment,{children:[d.jsx(xn,{title:e("quality.grokModelTitle"),items:Oe,value:ae,onChange:v}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("size.grokAspectTitle")||"Aspect Ratio"}),[is.slice(0,3),is.slice(3,6),is.slice(6,8),is.slice(8)].map((ie,lt)=>d.jsx("div",{className:"option-row",children:ie.map(at=>d.jsx("button",{type:"button",className:`option-btn${ne.ratio===at.value?" active":""}`,onClick:()=>U(at.value,ne.res),children:at.label},at.value))},lt))]}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("size.grokResolutionTitle")||"Resolution"}),d.jsx("div",{className:"gemini-resolution-grid",children:sL.map(ie=>d.jsxs("button",{type:"button",className:`option-btn${ne.res===ie.value?" active":""}`,onClick:()=>U(ne.ratio,ie.value),children:[d.jsx("span",{children:ie.label}),d.jsx("br",{}),d.jsx("small",{children:Is[ne.ratio]?.[ie.value]?.replace("x","×")||""})]},ie.value))})]}),d.jsxs("div",{className:"option-group",children:[d.jsxs("div",{className:"option-row",children:[d.jsxs("button",{type:"button",className:`option-btn${oe?" active":""}`,onClick:()=>{be(!1),I("auto")},children:[e("size.autoLabel"),d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:e("size.autoSub")})]}),d.jsxs("button",{type:"button",className:`option-btn${H||ce?" active":""}`,onClick:()=>be(ie=>!ie),children:[e("size.customPlus"),d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:e("size.customSub")})]})]}),ce?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"option-row size-picker__custom-row",children:[d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:Se,onChange:ie=>T(ie.target.value.replace(/\D/g,"")),placeholder:e("size.width")}),d.jsx("span",{className:"size-picker__dimension-separator","aria-hidden":"true",children:"×"}),d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:F,onChange:ie=>W(ie.target.value.replace(/\D/g,"")),placeholder:e("size.height")})]}),Number(Se)>0&&Number(F)>0?d.jsxs("div",{className:"size-picker__preview",children:[d.jsx("span",{children:e("size.normalizedPreview")}),d.jsx("strong",{children:(()=>{const ie=dL(Number(Se),Number(F));return`${ie.ratio} · ${ie.res}`})()})]}):null,d.jsx("button",{type:"button",className:"size-picker__save",onClick:le,children:e("settings.apiKeys.save")})]}):null]})]}):d.jsxs(d.Fragment,{children:[d.jsx(xn,{title:e("quality.title"),items:pe,value:i,onChange:o}),d.jsx(CP,{})]}),V?null:d.jsxs(d.Fragment,{children:[d.jsx(xn,{title:e("format.title"),items:lL,value:s,onChange:c}),d.jsx(xn,{title:e("moderation.title"),items:xe,value:m,onChange:p}),d.jsx("p",{className:"option-help",children:e("moderation.explain")})]}),$&&!he&&d.jsx("div",{className:"option-group multimode-toggle",children:d.jsxs("button",{type:"button",className:`multimode-toggle__button${h?" active":""}`,"aria-pressed":h,title:e("multimode.tooltip"),onClick:()=>g(!h),children:[d.jsx("span",{children:e("multimode.label")}),d.jsx("span",{children:e("multimode.shortHint")})]})}),he?null:d.jsx(wP,{}),d.jsx(MP,{})]})]})}const uL=R.lazy(()=>$t(()=>import("./PromptLibraryPanel-BngHherb.js"),[]).then(e=>({default:e.PromptLibraryPanel}))),mL=R.lazy(()=>$t(()=>import("./PromptBuilderPanel-DHB1sU7O.js"),[]).then(e=>({default:e.PromptBuilderPanel}))),pL=R.lazy(()=>$t(()=>import("./GenerationRequestLogPanel-CKw9JLH8.js"),[]).then(e=>({default:e.GenerationRequestLogPanel})));function fL(){const e=w(k=>k.rightPanelOpen),a=w(k=>k.toggleRightPanel),i=w(k=>k.promptLibraryOpen),o=w(k=>k.setPromptLibraryOpen),s=w(k=>k.promptBuilderOpen),c=w(k=>k.togglePromptBuilder),m=w(k=>k.workspaceProfile),{t:p}=ge(),[h,g]=R.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);R.useEffect(()=>{if(typeof window>"u")return;const k=window.matchMedia("(max-width: 800px)"),C=()=>g(k.matches);return k.addEventListener("change",C),()=>k.removeEventListener("change",C)},[]);const[S,v]=R.useState(!1),y=BN(m)&&!h,x=h?e:!0,E=uo(h&&e,a),P=S?"log":s&&y?"builder":i?"library":"settings",I=k=>{v(k==="log"),k==="builder"?(s||c(),i&&o(!1)):k==="library"?(s&&c(),i||o(!0)):(s&&c(),i&&o(!1))};return d.jsxs(d.Fragment,{children:[h&&e?d.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":p("panel.closeSettings"),onClick:a}):null,d.jsxs("aside",{ref:E,className:`right-panel${e?"":" collapsed"}${h&&x?" drawer-open":""}`,"aria-label":p("panel.detailSettings"),"aria-modal":h&&e?"true":void 0,role:h&&e?"dialog":void 0,tabIndex:h?-1:void 0,children:[!h&&d.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":e,"aria-controls":"right-panel-body",onClick:a,title:p(e?"panel.toggleHide":"panel.toggleShow"),children:e?">":"<"}),d.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!e,children:[d.jsxs("div",{className:"right-panel-tabs",role:"tablist","aria-label":p("panel.detailSettings"),children:[y?d.jsx("button",{type:"button",role:"tab","aria-selected":P==="builder","aria-controls":"right-panel-tab-builder",title:p("promptBuilder.title"),className:`right-panel-tabs__button${P==="builder"?" active":""}`,onClick:()=>I("builder"),children:p("promptBuilder.title")}):null,d.jsx("button",{type:"button",role:"tab","aria-selected":P==="log","aria-controls":"right-panel-tab-log",title:p("generationLog.title"),className:`right-panel-tabs__button${y?"":" right-panel-tabs__button--full"}${P==="log"?" active":""}`,onClick:()=>I("log"),children:p("generationLog.title")}),d.jsx("button",{type:"button",role:"tab","aria-selected":P==="library","aria-controls":"right-panel-tab-library",title:p("promptLibrary.title"),className:`right-panel-tabs__button right-panel-tabs__button--full${P==="library"?" active":""}`,onClick:()=>I("library"),children:p("promptLibrary.title")}),d.jsx("button",{type:"button",role:"tab","aria-selected":P==="settings","aria-controls":"right-panel-tab-settings",title:p("panel.detailSettings"),className:`right-panel-tabs__button right-panel-tabs__button--full${P==="settings"?" active":""}`,onClick:()=>I("settings"),children:p("panel.detailSettings")})]}),P==="builder"&&y?d.jsx("div",{id:"right-panel-tab-builder",role:"tabpanel",children:d.jsx(R.Suspense,{fallback:d.jsx("div",{className:"prompt-library-panel__loading",children:p("common.loading")}),children:d.jsx(mL,{variant:"sidebar"})})}):P==="library"?d.jsx("div",{id:"right-panel-tab-library",role:"tabpanel",children:d.jsx(R.Suspense,{fallback:d.jsx("div",{className:"prompt-library-panel__loading",children:p("common.loading")}),children:d.jsx(uL,{variant:"embedded"})})}):P==="log"?d.jsx("div",{id:"right-panel-tab-log",role:"tabpanel",children:d.jsx(R.Suspense,{fallback:d.jsx("div",{className:"prompt-library-panel__loading",children:p("common.loading")}),children:d.jsx(pL,{})})}):d.jsx("div",{id:"right-panel-tab-settings",role:"tabpanel",children:d.jsx(OS,{})})]})]})]})}function gL(e){const a=e.currentTarget;if(a.scrollWidth<=a.clientWidth||!(Math.abs(e.deltaY)>Math.abs(e.deltaX)))return;const o=a.scrollLeft<=0,s=a.scrollLeft+a.clientWidth>=a.scrollWidth-1,c=e.deltaY<0,m=e.deltaY>0;c&&o||m&&s||(e.preventDefault(),a.scrollLeft+=e.deltaY)}function hL({id:e}){const{t:a}=ge();return d.jsx("div",{className:"history-thumb history-thumb--skeleton","aria-label":a("common.generating")},e)}function yL({id:e,count:a}){const{t:i}=ge(),o=Math.min(a,4);return d.jsx("div",{className:"history-thumb history-thumb--collection-skeleton","aria-label":i("history.generatingCollection",{count:a}),children:Array.from({length:o},(s,c)=>d.jsx("div",{className:"collection-mini collection-mini--skeleton"},c))},`coll-${e}`)}function vL({sequenceId:e,images:a}){const i=w(p=>p.showHistorySequence),s=w(p=>p.multimodePreviewFlightId)===`history:${e}`,c=a.slice(0,4),{t:m}=ge();return d.jsx("button",{type:"button",className:`history-thumb history-thumb--collection${s?" active":""}`,onClick:()=>i(e),"aria-label":m("common.imageCollection",{n:a.length}),children:c.map((p,h)=>!p.thumb&&(kn(p.url)||kn(p.image))?d.jsx(nr,{className:"collection-mini"},h):d.jsx("img",{className:"collection-mini",src:p.thumb||p.url||p.image,alt:"",loading:"lazy",decoding:"async"},h))})}function bL(e){const a=R.useRef(null),i=R.useRef(new Map),[o,s]=R.useState(()=>new Set);R.useEffect(()=>{if(!e||typeof IntersectionObserver>"u")return;const m=new IntersectionObserver(p=>{const h=p.filter(g=>g.isIntersecting);h.length!==0&&s(g=>{const S=new Set(g);for(const v of h){const y=v.target.dataset.historyLazyKey;y&&S.add(y)}return S})},{root:e,rootMargin:"0px 200% 0px 200%"});a.current=m;for(const p of i.current.values())m.observe(p);return()=>{m.disconnect(),a.current=null}},[e]);const c=R.useCallback((m,p)=>{const h=i.current.get(m);h&&h!==p&&a.current?.unobserve(h),p?(i.current.set(m,p),a.current?.observe(p)):i.current.delete(m)},[]);return{visibleKeys:o,register:c,supported:typeof IntersectionObserver<"u"}}function SL(){const e=w(C=>C.history),a=w(C=>C.currentImage),i=w(C=>C.historyStripLayout),o=w(C=>C.selectHistory),s=w(C=>C.openGallery),c=w(C=>C.inFlight),m=w(C=>C.multimodeSequences),p=R.useRef({}),[h,g]=R.useState(null),S=bL(h),{t:v}=ge(),y=a?Ot(a):null,x=R.useMemo(()=>hs(e.filter(mi)),[e]),E=R.useMemo(()=>{const C=[];for(const _ of c){const N=m[_.id];if(_.kind==="multimode"&&N){C.push({type:"collection-skeleton",id:_.id,count:N.requested});for(let j=0;j<N.requested;j++)N.images[j]||C.push({type:"skeleton",id:`${_.id}_${j}`,count:1})}else C.push({type:"skeleton",id:_.id,count:1})}return C},[c,m]),{completedSequences:P,sequenceFirstKeys:I}=R.useMemo(()=>{const C=new Map,_=new Set;for(const N of x)if(N.sequenceId&&(N.sequenceTotalRequested??0)>1){C.has(N.sequenceId)||_.add(Ot(N));const j=C.get(N.sequenceId)||[];j.push(N),C.set(N.sequenceId,j)}return{completedSequences:C,sequenceFirstKeys:_}},[x]);R.useEffect(()=>{y&&p.current[y]?.scrollIntoView({block:"nearest",inline:"nearest"})},[y,x]);const k=(C,_)=>{const N=S.supported?S.visibleKeys.has(C):!0;return d.jsx("div",{ref:j=>{p.current[C]=j,S.register(C,j)},className:"history-thumb","data-history-lazy-key":C,"aria-hidden":N?void 0:!0,style:{padding:0,overflow:"hidden"},children:N?_:null},C)};return d.jsxs("div",{ref:g,className:`history-strip${i==="horizontal"?" history-strip--horizontal":""}${i==="sidebar"?" history-strip--sidebar":""}`,onWheel:gL,"data-layout":i,children:[d.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:s,"aria-label":v("history.openGalleryAria"),title:v("history.openGalleryTitle"),children:d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),E.map(C=>C.type==="collection-skeleton"?d.jsx(yL,{id:C.id,count:C.count},`coll-${C.id}`):d.jsx(hL,{id:C.id},C.id)),x.map(C=>{const _=Ot(C),N=y===_;if(C.sequenceId&&P.has(C.sequenceId)&&I.has(_)){const j=P.get(C.sequenceId);return[k(`coll-${C.sequenceId}`,d.jsx(vL,{sequenceId:C.sequenceId,images:j})),...j.map($=>{const L=Ot($),J=y===L;return gt($)?k(L,d.jsxs("div",{className:`history-thumb history-thumb--video history-thumb--fade-in${J?" active":""}`,onClick:()=>o($),draggable:!0,onDragStart:re=>{re.dataTransfer.setData("application/ima2-ref",JSON.stringify(yi($))),re.dataTransfer.effectAllowed="copy"},children:[$.thumb?d.jsx("img",{src:$.thumb,alt:"",loading:"lazy",decoding:"async"}):d.jsx(nr,{}),d.jsx("span",{className:"history-thumb__play-badge","aria-hidden":"true",children:"▶"})]})):k(L,d.jsx("img",{src:$.thumb||$.url||$.image,alt:"",className:`history-thumb history-thumb--fade-in${J?" active":""}`,loading:"lazy",decoding:"async",onClick:()=>o($),draggable:!0,onDragStart:re=>{re.dataTransfer.setData("application/ima2-ref",JSON.stringify({image:$.url||$.image,filename:$.filename})),re.dataTransfer.effectAllowed="copy"}}))})]}return C.sequenceId&&P.has(C.sequenceId)&&!I.has(_)?null:gt(C)?k(_,d.jsxs("div",{className:`history-thumb history-thumb--video${N?" active":""}`,onClick:()=>o(C),draggable:!0,onDragStart:j=>{j.dataTransfer.setData("application/ima2-ref",JSON.stringify(yi(C))),j.dataTransfer.effectAllowed="copy"},children:[C.thumb?d.jsx("img",{src:C.thumb,alt:"",loading:"lazy",decoding:"async"}):d.jsx(nr,{}),d.jsx("span",{className:"history-thumb__play-badge","aria-hidden":"true",children:"▶"})]})):k(_,d.jsx("img",{src:C.thumb||C.url||C.image,alt:"",className:`history-thumb${N?" active":""}`,loading:"lazy",decoding:"async",onClick:()=>o(C),draggable:!0,onDragStart:j=>{j.dataTransfer.setData("application/ima2-ref",JSON.stringify({image:C.url||C.image,filename:C.filename})),j.dataTransfer.effectAllowed="copy"}}))})]})}const nv=3e3;function xL(){const{t:e}=ge(),a=w(g=>g.toastLog),i=w(g=>g.errorCardLog),o=w(g=>g.dismissToast),s=w(g=>g.dismissErrorCard),[c,m]=R.useState(()=>typeof document>"u"?!0:document.visibilityState==="visible"),p=R.useRef(new Map);R.useEffect(()=>{const g=()=>m(document.visibilityState==="visible");return document.addEventListener("visibilitychange",g),window.addEventListener("focus",g),window.addEventListener("blur",g),()=>{document.removeEventListener("visibilitychange",g),window.removeEventListener("focus",g),window.removeEventListener("blur",g)}},[]),R.useEffect(()=>{const g=p.current,S=new Set([...a.map(v=>`toast-${v.id}`),...i.map(v=>`error-card-${v.id}`)]);for(const[v,y]of g)(!S.has(v)||!c)&&(clearTimeout(y),g.delete(v));if(c){for(const v of a){const y=`toast-${v.id}`;if(g.has(y))continue;const x=setTimeout(()=>{g.delete(y),o(v.id)},nv);g.set(y,x)}for(const v of i){const y=`error-card-${v.id}`;if(g.has(y))continue;const x=setTimeout(()=>{g.delete(y),s(v.id)},nv);g.set(y,x)}}},[s,o,i,c,a]),R.useEffect(()=>()=>{for(const g of p.current.values())clearTimeout(g);p.current.clear()},[]);const h=[...a.map(g=>({kind:"toast",id:g.id,key:`toast-${g.id}`,message:g.message,error:g.error,createdAt:g.createdAt,cta:void 0,cardKey:void 0})),...i.map(g=>{const S=eo[g.code],v=g.cardKey??S?.cardKey??"errorCard.unknown",y=e(`${v}.title`),x=e(`${v}.body`),E=g.cta??S?.cta;return{kind:"error-card",id:g.id,key:`error-card-${g.id}`,message:g.fallbackMessage?`${y}: ${x} ${g.fallbackMessage}`:`${y}: ${x}`,error:!0,createdAt:g.createdAt,cta:E,cardKey:v}})].sort((g,S)=>g.createdAt-S.createdAt).slice(-5);return h.length===0?null:d.jsx("div",{className:"toast-stack","aria-live":"polite","aria-relevant":"additions removals",children:h.map(g=>{const S=["toast","visible",g.error?"error":"",g.kind==="error-card"?"toast--card":""].filter(Boolean).join(" ");return d.jsxs("div",{className:S,role:g.error?"alert":"status",children:[d.jsx("span",{className:"toast__message",children:g.message}),g.kind==="error-card"&&(g.cta==="reauth"||g.cta==="reload")?d.jsx("button",{type:"button",className:"toast__cta",onClick:()=>{g.cta==="reauth"&&w.getState().openSettings("providers"),g.cta==="reload"&&window.location.reload()},children:e(`${g.cardKey??"errorCard.unknown"}.cta`)}):null,d.jsx("button",{type:"button",className:"toast__dismiss","aria-label":e("common.dismiss"),onClick:()=>g.kind==="error-card"?s(g.id):o(g.id),children:d.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:d.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round"})})})]},g.key)})})}function AL(){return null}function TL(e,a="en"){if(!e)return"earlier";const i=new Date(e);if(Number.isNaN(i.getTime()))return"earlier";const s=Math.floor((new Date().getTime()-i.getTime())/864e5);return s===0?"today":s===1?"yesterday":s<7?"thisWeek":new Intl.DateTimeFormat(a,{year:"numeric",month:"short",day:"numeric"}).format(i)}function CL(e,a,i){async function o(m){if(m.setId)try{await vt.getState().loadSet(m.setId),w.getState().setUIMode("card-news"),e()}catch{a(i("gallery.openCardNewsSetFailed"),!0)}}async function s(m,p){if(p.stopPropagation(),!m.setId)return;const h=`generated/cardnews/${m.setId}`;try{await navigator.clipboard?.writeText(h),a(i("gallery.cardNewsPathCopied"))}catch{a(i("toast.copyFailed"),!0)}}function c(m,p){p.stopPropagation(),m.setId&&window.open(b2(m.setId),"_blank","noopener,noreferrer")}return{handleOpenCardNewsSet:o,handleCopyCardNewsSetPath:s,handleDownloadCardNewsManifest:c}}const wL=["ArrowLeft","ArrowRight","Home","End"];function IL(){return R.useCallback(e=>{if(!wL.includes(e.key))return;const a=e.currentTarget,i=Array.from(a.querySelectorAll("[role='tab']")).filter(p=>!p.hasAttribute("disabled"));if(i.length===0)return;e.preventDefault();const o=document.activeElement,s=o?i.indexOf(o):-1,c=e.key==="Home"?0:e.key==="End"?i.length-1:s<0?0:(s+(e.key==="ArrowRight"?1:-1)+i.length)%i.length,m=i[c];m?.focus(),m?.click()},[])}function ju({className:e,ariaLabel:a,tabs:i,value:o,onChange:s}){const c=IL(),m=i.find(h=>h.value===o),p=m&&!m.disabled?m.value:i.find(h=>!h.disabled)?.value;return d.jsx("div",{className:e,role:"tablist","aria-label":a,onKeyDown:c,children:i.map(h=>d.jsx("button",{type:"button",role:"tab","aria-selected":h.value===o,tabIndex:h.value===p?0:-1,className:h.value===o?"active":"",onClick:()=>s(h.value),disabled:h.disabled,children:h.label},h.value))})}function EL({item:e,onOpen:a,onCopyPath:i,onDownloadManifest:o}){const{t:s}=ge(),m=e.cards?.find(p=>p.headline)?.headline||e.headline||s("gallery.cardNewsSet");return d.jsxs(d.Fragment,{children:[d.jsxs("button",{type:"button",className:"gallery__tile",onClick:()=>a(e),title:m,children:[e.image?d.jsx("img",{src:e.image,alt:m,loading:"lazy"}):null,d.jsxs("div",{className:"gallery__caption",children:[d.jsx("small",{children:s("gallery.cardNewsSet")}),d.jsx("span",{className:"gallery__caption-text",children:m})]}),d.jsx("div",{className:"gallery-card-news-strip",children:(e.cards||[]).slice(0,5).map((p,h)=>d.jsxs("span",{children:[p.url?d.jsx("img",{src:p.url,alt:p.headline??"",loading:"lazy"}):null,d.jsx("em",{children:p.cardOrder??h+1})]},`${p.url}-${h}`))})]}),d.jsxs("div",{className:"gallery-card-news-actions",children:[d.jsx("span",{children:s("gallery.cardNewsCount",{n:e.cards?.length??0})}),d.jsx("button",{type:"button",onClick:()=>a(e),children:s("gallery.openCardNewsSet")}),d.jsx("button",{type:"button",onClick:p=>i(e,p),children:s("gallery.copyCardNewsSetPath")}),d.jsx("button",{type:"button",onClick:p=>o(e,p),children:s("gallery.downloadCardNewsManifest")})]})]})}const RL=[{id:"animate",labelKey:"chain.animate",available:e=>!!e.filename&&!gt(e)},{id:"edit",labelKey:"chain.edit",available:e=>!!e.filename&&!gt(e)},{id:"useAsRef",labelKey:"chain.useAsRef",available:e=>!!(e.image||e.url)},{id:"rebake",labelKey:"chain.rebake",available:e=>!!(e.prompt||e.filename)},{id:"saveToAssets",labelKey:"chain.saveToAssets",available:e=>!!e.filename},{id:"saveAsElement",labelKey:"chain.saveAsElement",available:e=>!!e.filename&&!gt(e)}];async function NL(e,a,i,o){const s=i();switch(e){case"animate":{if(!a.filename)return;try{await s.animateImage(a.filename,a.prompt??void 0)&&s.showToast(o("toast.animateDone"))}catch(c){s.showToast(c instanceof Error?c.message:o("toast.animateFailed"),!0)}break}case"edit":{s.selectHistory(a),s.openCanvas();break}case"useAsRef":{const c=a.url||a.image;if(!c)return;try{const p=await(await fetch(c)).blob(),h=new File([p],a.filename||"reference.png",{type:p.type});await s.addReferences([h]),s.showToast(o("chain.refAdded"))}catch{s.showToast(o("chain.refFailed"),!0)}break}case"rebake":{try{const{continueFromItem:m}=await $t(async()=>{const{continueFromItem:h}=await Promise.resolve().then(()=>UM);return{continueFromItem:h}},void 0),p=await m(a);s.showToast(o(p.hasPrompt?"toast.forkStarted":"toast.forkStartedNoPrompt"))}catch{s.showToast(o("toast.forkFailed"),!0)}const c=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');c&&(c.focus(),c.setSelectionRange(c.value.length,c.value.length));break}case"saveToAssets":{try{const c=await s.saveToAssets(a);s.showToast(o(c?"chain.savedToAssets":"chain.saveToAssetsFailed"),!c)}catch{s.showToast(o("chain.saveToAssetsFailed"),!0)}break}case"saveAsElement":{try{const c=await s.saveAsElement?.(a);s.showToast(o(c?"chain.savedToAssets":"chain.saveToAssetsFailed"),!c)}catch{s.showToast(o("chain.saveToAssetsFailed"),!0)}break}}}function kL(e){return e.mediaType==="video"?e.videoContinuity?.parentFilename?"v2v":e.sourceImageFilename?"i2v":"t2v":e.canvasSourceFilename||e.sourceImageFilename?"i2i":e.model?"t2i":null}function _L(e){return e.videoContinuity?.parentFilename??e.canvasSourceFilename??e.sourceImageFilename??null}function ML(e){return{modelLabel:Cv(e.model,e.provider),derivation:kL(e),sourceLabel:_L(e)}}function PL(e){return!e.modelLabel&&!e.derivation}function LL({view:e,size:a="sm"}){const{t:i}=ge();return PL(e)?null:d.jsxs("span",{className:`provenance-chip provenance-chip--${a}`,children:[e.modelLabel?d.jsx("span",{className:"provenance-chip__model",children:e.modelLabel}):null,e.derivation?d.jsx("span",{className:"provenance-chip__derivation",children:i(`provenance.${e.derivation}`)}):null]})}function OL({id:e}){switch(e){case"animate":return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"edit":return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),d.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"useAsRef":return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),d.jsx("polyline",{points:"17 8 12 3 7 8"}),d.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]});case"rebake":return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("polyline",{points:"23 4 23 10 17 10"}),d.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]});case"saveToAssets":return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"2",y:"3",width:"20",height:"5",rx:"1"}),d.jsx("path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}),d.jsx("path",{d:"M10 12h4"})]})}}function jL({item:e,active:a,itemRef:i,onSelect:o,onDelete:s,onToggleFavorite:c,favoriteBusy:m=!1,t:p}){const h=R.useMemo(()=>RL.filter(v=>v.available(e)),[e]),g=R.useCallback(async(v,y)=>{y.stopPropagation(),await NL(v,e,()=>{const x=w.getState();return{animateImage:x.animateImage,openCanvas:x.openCanvas,selectHistory:x.selectHistory,addReferences:x.addReferences,showToast:x.showToast,saveToAssets:x.saveToAssets}},p)},[e,p]),S=v=>{v.dataTransfer.setData("application/ima2-ref",JSON.stringify(gt(e)?yi(e):{image:e.url||e.image,filename:e.filename})),v.dataTransfer.effectAllowed="copy"};return d.jsxs("div",{ref:i,className:`gallery__tile-wrap${a?" gallery__tile-wrap--active":""}${e.isFavorite?" gallery__tile-wrap--favorite":""}`,children:[d.jsxs("button",{type:"button",className:`gallery__tile${a?" gallery__tile--active":""}`,onClick:()=>o(e),title:e.prompt??"",draggable:!0,onDragStart:S,children:[gt(e)?d.jsxs("div",{className:"gallery__tile-video-wrap",children:[e.thumb?d.jsx("img",{src:e.thumb,alt:e.prompt??p("gallery.imageAltFallback"),loading:"lazy",decoding:"async",className:"gallery__tile-video"}):d.jsx(nr,{className:"gallery__tile-video"}),d.jsx("span",{className:"gallery__play-badge","aria-hidden":"true",children:"▶"})]}):d.jsx("img",{src:e.thumb||e.image,alt:e.prompt??p("gallery.imageAltFallback"),loading:"lazy",decoding:"async"}),e.prompt&&d.jsx("div",{className:"gallery__caption",children:d.jsx("span",{className:"gallery__caption-text",children:e.prompt})})]}),h.length>0?d.jsx("div",{className:"gallery__chain-overlay",role:"group","aria-label":p("chain.ariaLabel"),children:h.map(v=>d.jsx("button",{type:"button",className:"gallery__chain-btn",onClick:y=>{g(v.id,y)},title:p(v.labelKey),"aria-label":p(v.labelKey),children:d.jsx(OL,{id:v.id})},v.id))}):null,e.filename&&c&&d.jsx(vS,{variant:"gallery",active:!!e.isFavorite,busy:m,label:e.isFavorite?p("gallery.unfavoriteAria"):p("gallery.favoriteAria"),onToggle:()=>c(e)}),e.filename&&d.jsx("button",{type:"button",className:"gallery__delete",onClick:v=>s(e,v),title:p("gallery.deleteTitle"),"aria-label":p("gallery.deleteAria"),children:"×"}),d.jsx(LL,{view:ML(e)})]})}function GL(e,a,i){const o=new Array(e);return new Proxy(o,{get(s,c,m){if(typeof c=="string"){const p=c.charCodeAt(0);if(p>=48&&p<=57){const h=+c;if(Number.isInteger(h)&&h>=0&&h<e){let g=s[h];if(!g){const S=a[h*2];g=s[h]={index:h,key:i(h),start:S,size:a[h*2+1],end:S+a[h*2+1],lane:0}}return g}}if(c==="length")return e}return Reflect.get(s,c,m)}})}function Qo(e,a,i){let o=i.initialDeps??[],s,c=!0;function m(){const p=e();return(p.length!==o.length||p.some((g,S)=>o[S]!==g))&&(o=p,s=a(...p),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(s),c=!1),s}return m.updateDeps=p=>{o=p},m}function av(e,a){if(e===void 0)throw new Error("Unexpected undefined");return e}const DL=(e,a)=>Math.abs(e-a)<1.01,FL=(e,a,i)=>{let o;return function(...s){e.clearTimeout(o),o=e.setTimeout(()=>a.apply(this,s),i)}};let di;const Gu=()=>{if(di!==void 0)return di;if(typeof navigator>"u")return di=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return di=!0;const e=navigator.maxTouchPoints;return di=navigator.platform==="MacIntel"&&e!==void 0&&e>0},ov=e=>{const{offsetWidth:a,offsetHeight:i}=e;return{width:a,height:i}},zL=e=>e,qL=e=>{const a=Math.max(e.startIndex-e.overscan,0),o=Math.min(e.endIndex+e.overscan,e.count-1)-a+1,s=new Array(o);for(let c=0;c<o;c++)s[c]=a+c;return s},UL=(e,a)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const s=m=>{const{width:p,height:h}=m;a({width:Math.round(p),height:Math.round(h)})};if(s(ov(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(m=>{const p=()=>{const h=m[0];if(h?.borderBoxSize){const g=h.borderBoxSize[0];if(g){s({width:g.inlineSize,height:g.blockSize});return}}s(ov(i))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(p):p()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},Es={passive:!0},HL=typeof window>"u"?!0:"onscrollend"in window,BL=(e,a,i)=>{const o=e.scrollElement;if(!o)return;const s=e.targetWindow;if(!s)return;const c=e.options.useScrollendEvent&&HL;let m=0;const p=c?null:FL(s,()=>a(m,!1),e.options.isScrollingResetDelay),h=v=>()=>{m=i(o),p?.(),a(m,v)},g=h(!0),S=h(!1);return o.addEventListener("scroll",g,Es),c&&o.addEventListener("scrollend",S,Es),()=>{o.removeEventListener("scroll",g),c&&o.removeEventListener("scrollend",S)}},VL=(e,a)=>BL(e,a,i=>{const{horizontal:o,isRtl:s}=e.options;return o?i.scrollLeft*(s&&-1||1):i.scrollTop}),KL=(e,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(e),s=i.options.getItemKey(o);return i.itemSizeCache.get(s)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(e),s=i.options.getItemKey(o),c=i.itemSizeCache.get(s);if(c!==void 0)return c}return e[i.options.horizontal?"offsetWidth":"offsetHeight"]},$L=(e,{adjustments:a=0,behavior:i},o)=>{var s,c;(c=(s=o.scrollElement)==null?void 0:s.scrollTo)==null||c.call(s,{[o.options.horizontal?"left":"top"]:e+a,behavior:i})},YL=$L;class XL{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,s;return((s=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:s.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(s=>{s.forEach(c=>{const m=()=>{const p=c.target,h=this.indexFromElement(p);if(!p.isConnected){this.observer.unobserve(p);for(const[g,S]of this.elementsCache)if(S===p){this.elementsCache.delete(g);break}return}this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(p,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(m):m()})}));return{disconnect:()=>{var s;(s=o())==null||s.disconnect(),i=null},observe:s=>{var c;return(c=o())==null?void 0:c.observe(s,{box:"border-box"})},unobserve:s=>{var c;return(c=o())==null?void 0:c.unobserve(s)}}})(),this.range=null,this.setOptions=i=>{var o,s;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:zL,rangeExtractor:qL,onChange:()=>{},measureElement:KL,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const y in i){const x=i[y];x!==void 0&&(c[y]=x)}const m=this.options;let p=null,h=null,g=!1;if(m!==void 0&&m.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const y=m.count,x=c.count,E=this.getMeasurements(),P=y>0?((o=E[0])==null?void 0:o.key)??m.getItemKey(0):null,I=y>0?((s=E[y-1])==null?void 0:s.key)??m.getItemKey(y-1):null;if(x!==y||y>0&&x>0&&(c.getItemKey(0)!==P||c.getItemKey(x-1)!==I)){g=!0;const _=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??E[0]:null;_&&(p=[_.key,this.getScrollOffset()-_.start]);const N=c.followOnAppend===!0?"auto":c.followOnAppend||null;N&&x>y&&this.isAtEnd(m.scrollEndThreshold)&&(y===0||c.getItemKey(x-1)!==I)&&(h=N)}}this.options=c,g&&(this.pendingMin=0,this.itemSizeCacheVersion++);let S=!1,v=0;if(p&&this.scrollOffset!==null){const[y,x]=p,E=this.getMeasurements(),{count:P,getItemKey:I}=this.options;let k=0;for(;k<P&&I(k)!==y;)k++;if(k<P){const C=E[k];if(C){const _=Math.max(0,C.start+x);_!==this.scrollOffset&&(v=_-this.scrollOffset,this.scrollOffset=_,S=!0)}}}(S||h)&&(this.pendingScrollAnchor=[S?p[0]:null,S?p[1]:0,h,v])},this.notify=i=>{var o,s;(s=(o=this.options).onChange)==null||s.call(o,this,i)},this.maybeNotify=Qo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,m)=>{if(m&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const p=this.getScrollOffset();this.scrollDirection=m?p===c?this.scrollDirection:p<c?"forward":"backward":null,this.scrollOffset=c,this.isScrolling=m,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const c=this.scrollElement,m=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},p=()=>{this._iosTouching=!1,!(!Gu()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",m,Es),c.addEventListener("touchend",p,Es),this.unsubs.push(()=>{c.removeEventListener("touchstart",m),c.removeEventListener("touchend",p),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[c,m,p,h]=s;c!==null&&!p&&(Gu()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?h!==0&&(this._iosDeferredAdjustment+=h):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),p&&this.scrollToEnd({behavior:p})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Qo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,s,c,m,p,h,g)=>(this.prevLanes!==void 0&&this.prevLanes!==p&&(this.lanesChangedFlag=!0),this.prevLanes=p,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:s,getItemKey:c,enabled:m,lanes:p,laneAssignmentMode:h,gap:g}),{key:!1}),this.getMeasurements=Qo(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:s,getItemKey:c,enabled:m,lanes:p,laneAssignmentMode:h,gap:g},S)=>{const v=this.itemSizeCache;if(!m)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const k of this.laneAssignments.keys())k>=i&&this.laneAssignments.delete(k);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(k=>{this.itemSizeCache.set(k.key,k.size)}));const y=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),p===1){const k=i*2;let C=this._flatMeasurements;if(!C||C.length<k){const j=new Float64Array(k);C&&y>0&&j.set(C.subarray(0,y*2)),C=j,this._flatMeasurements=C}let _;if(y===0)_=o+s;else{const j=y-1;_=C[j*2]+C[j*2+1]+g}for(let j=y;j<i;j++){const $=c(j),L=v.get($),J=typeof L=="number"?L:this.options.estimateSize(j);C[j*2]=_,C[j*2+1]=J,_+=J+g}const N=GL(i,C,c);return this.measurementsCache=N,N}const x=this.measurementsCache.slice(0,y),E=new Array(p).fill(void 0),P=new Float64Array(p);let I=0;for(let k=0;k<y;k++){const C=x[k];C&&(E[C.lane]===void 0&&I++,E[C.lane]=k,P[C.lane]=C.end)}for(let k=y;k<i;k++){const C=c(k),_=this.laneAssignments.get(k);let N,j;const $=h==="estimate"||v.has(C);if(_!==void 0&&this.options.lanes>1){N=_;const he=E[N],V=he!==void 0?x[he]:void 0;j=V?V.end+g:o+s}else if(I===p){let he=0,V=P[0],ee=E[0];for(let oe=1;oe<p;oe++){const Ne=P[oe];(Ne<V||Ne===V&&E[oe]<ee)&&(he=oe,V=Ne,ee=E[oe])}N=he,j=V+g,$&&this.laneAssignments.set(k,N)}else N=k%this.options.lanes,j=o+s,$&&this.laneAssignments.set(k,N);const L=v.get(C),J=typeof L=="number"?L:this.options.estimateSize(k),re=j+J;x[k]={index:k,start:j,size:J,end:re,key:C,lane:N},E[N]===void 0&&I++,E[N]=k,P[N]=re}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Qo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,s,c)=>i.length===0||o===0?(this.range=null,null):(this.range=JL(i,o,s,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Qo(()=>{let i=null,o=null;const s=this.calculateRange();return s&&(i=s.startIndex,o=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,s,c,m)=>c===null||m===null?[]:i({startIndex:c,endIndex:m,overscan:o,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,s=i.getAttribute(o);return s?parseInt(s,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(s!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),m=Math.max(0,s-c),p=Math.min(this.options.count-1,s+c);return i>=m&&i<=p}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((m,p)=>{m.isConnected||(this.observer.unobserve(m),this.elementsCache.delete(p))});return}const o=this.indexFromElement(i),s=this.options.getItemKey(o),c=this.elementsCache.get(s);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(s,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var s,c;if(i<0||i>=this.options.count)return;let m,p,h;const g=this._flatMeasurements;if(this.options.lanes===1&&g!==null)h=this.options.getItemKey(i),p=g[i*2],m=g[i*2+1];else{const y=this.measurementsCache[i];if(!y)return;h=y.key,p=y.start,m=y.size}const S=this.itemSizeCache.get(h)??m,v=o-S;if(v!==0){const y=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=y?this.getTotalSize():0,E=this.getScrollOffset()+this.scrollAdjustments,I=!this.itemSizeCache.has(h)?p<E:p+S<=E&&this.scrollDirection!=="backward",k=((c=this.scrollState)==null?void 0:c.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[i]??{index:i,key:h,start:p,size:m,end:p+m,lane:0},v,this):I);(this.pendingMin===null||i<this.pendingMin)&&(this.pendingMin=i),this.itemSizeCache.set(h,o),this.itemSizeCacheVersion++;let C=!1;y?C=this.applyScrollAdjustment(this.getTotalSize()-x):k&&(C=this.applyScrollAdjustment(v)),this.notify(C)}},this.getVirtualItems=Qo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const s=[];for(let c=0,m=i.length;c<m;c++){const p=i[c],h=o[p];s.push(h)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const s=this._flatMeasurements,c=this.options.lanes===1&&s!=null,m=jS(0,o.length-1,c?p=>s[p*2]:p=>av(o[p]).start,i);return av(o[m])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,s=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),m=this.getScrollOffset();o==="auto"&&(o=i>=m+c?"end":"start"),o==="center"?i+=(s-c)/2:o==="end"&&(i-=c);const p=this.getMaxScrollOffset();return Math.max(Math.min(p,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const s=this.getSize(),c=this.getScrollOffset(),m=this.measurementsCache[i];if(!m)return;if(o==="auto")if(m.end>=c+s-this.options.scrollPaddingEnd)o="end";else if(m.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const p=o==="end"?m.end+this.options.scrollPaddingEnd:m.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(p,o,m.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),m=this.now();this.scrollState={index:null,align:o,behavior:s,startedAt:m,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[m,p]=c,h=this.now();this.scrollState={index:i,align:p,behavior:s,startedAt:h,lastTargetOffset:m,stableFrames:0},this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const s=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let s;if(o.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,m=this._flatMeasurements;m!=null?s=m[c*2]+m[c*2+1]:s=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let m=o.length-1;for(;m>=0&&c.some(p=>p===null);){const p=o[m];c[p.lane]===null&&(c[p.lane]=p.end),m--}s=Math.max(...c.filter(p=>p!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const s of o)s&&this.itemSizeCache.has(s.key)&&i.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:s})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:s,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Gu()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=o?o[0]:this.scrollState.lastTargetOffset,c=1,m=s!==this.scrollState.lastTargetOffset;if(!m&&DL(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,m){const p=this.getSize()||600,h=Math.abs(s-this.getScrollOffset()),g=this.scrollState.behavior==="smooth"&&h>p;this.scrollState.lastTargetOffset=s,g||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:g?"smooth":"auto"})}this.scheduleScrollReconcile()}}const jS=(e,a,i,o)=>{for(;e<=a;){const s=(e+a)/2|0,c=i(s);if(c<o)e=s+1;else if(c>o)a=s-1;else return s}return e>0?e-1:0};function QL(e,a,i){let o=0;for(;o<=a;){const s=(o+a)/2|0,c=e[s*2];if(c<i)o=s+1;else if(c>i)a=s-1;else return s}return o>0?o-1:0}function JL(e,a,i,o,s){const c=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:c};if(o===1&&s!==null){const g=QL(s,c,i);let S=g;const v=i+a;for(;S<c&&s[S*2]+s[S*2+1]<v;)S++;return{startIndex:g,endIndex:S}}let p=jS(0,c,g=>e[g].start,i),h=p;if(o===1)for(;h<c&&e[h].end<i+a;)h++;else if(o>1){const g=Array(o).fill(0);for(;h<c&&g.some(v=>v<i+a);){const v=e[h];g[v.lane]=v.end,h++}const S=Array(o).fill(i+a);for(;p>=0&&S.some(v=>v>=i);){const v=e[p];S[v.lane]=v.start,p--}p=Math.max(0,p-p%o),h=Math.min(c,h+(o-1-h%o))}return{startIndex:p,endIndex:h}}const Du=typeof document<"u"?R.useLayoutEffect:R.useEffect;function WL({useFlushSync:e=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const s=R.useReducer(S=>S+1,0)[1],c=R.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const m=S=>{const v=c.current;if(!v.enabled||!v.container)return;const y=S.getTotalSize();if(y!==v.lastSize){v.lastSize=y;const x=S.options.horizontal?"width":"height";v.container.style[x]=`${y}px`}},p=S=>{const v=c.current;if(!v.enabled||!v.container)return;m(S);const y=!!S.options.horizontal,x=v.mode==="transform",E=y?"left":"top",P=S.options.scrollMargin,I=S.getVirtualItems();for(const k of I){const C=k.start-P,_=S.elementsCache.get(k.key);_&&v.lastPositions.get(_)!==C&&(v.lastPositions.set(_,C),x?_.style.transform=y?`translate3d(${C}px, 0, 0)`:`translate3d(0, ${C}px, 0)`:_.style[E]=`${C}px`)}},h={...o,onChange:(S,v)=>{var y;const x=c.current;let E=!0;if(x.enabled){p(S);const P=S.range,I=x.prevRange;E=!I||I.isScrolling!==S.isScrolling||I.startIndex!==P?.startIndex||I.endIndex!==P?.endIndex,E&&(x.prevRange=P?{startIndex:P.startIndex,endIndex:P.endIndex,isScrolling:S.isScrolling}:null)}E&&(e&&v?Js.flushSync(s):s()),(y=o.onChange)==null||y.call(o,S,v)}},[g]=R.useState(()=>{const S=new XL(h);return Object.assign(S,{containerRef:v=>{const y=c.current;if(y.container=v,y.lastSize=null,v&&y.enabled){const x=S.getTotalSize();y.lastSize=x;const E=S.options.horizontal?"width":"height";v.style[E]=`${x}px`}}})});return g.setOptions(h),Du(()=>g._didMount(),[]),Du(()=>(m(g),g._willUpdate())),Du(()=>{p(g)}),g}function ZL(e){return WL({observeElementRect:UL,observeElementOffset:VL,scrollToFn:YL,...e})}const Rs=170,Ns=10,GS=36,eO=44;function tO(e){const a=Math.max(Rs,e-GS);return Math.max(1,Math.floor((a+Ns)/(Rs+Ns)))}function nO(e,a){const i=Math.max(Rs,e-GS);return Math.max(Rs,Math.floor((i-Ns*Math.max(0,a-1))/a))+Ns}function aO(e,a){const i=[];for(const[o,s]of e){i.push({type:"header",id:`h-${o}`,label:o,count:s.length});for(let c=0;c<s.length;c+=a)i.push({type:"items",id:`r-${o}-${c}`,items:s.slice(c,c+a)})}return i}function oO({dateGroups:e,selectedKey:a,scrollElement:i,localizeBucket:o,renderTile:s}){const c=R.useRef(null),[m,p]=R.useState(0),h=R.useMemo(()=>tO(m||960),[m]),g=R.useMemo(()=>nO(m||960,h),[m,h]),S=R.useMemo(()=>aO(e,h),[e,h]);R.useEffect(()=>{const y=c.current;if(!y)return;const x=()=>p(y.clientWidth);x();const E=new ResizeObserver(x);return E.observe(y),()=>E.disconnect()},[]);const v=ZL({count:S.length,getScrollElement:()=>i,estimateSize:y=>S[y]?.type==="header"?eO:g,overscan:6});return R.useEffect(()=>{if(!a)return;const y=S.findIndex(x=>x.type==="items"&&x.items.some(E=>Ot(E)===a));y>=0&&v.scrollToIndex(y,{align:"center"})},[S,a,v]),d.jsx("div",{ref:c,className:"gallery__virtual",style:{height:v.getTotalSize()},children:v.getVirtualItems().map(y=>{const x=S[y.index];return x?d.jsx("div",{className:"gallery__virtual-row",style:{transform:`translateY(${y.start}px)`},children:x.type==="header"?d.jsxs("header",{className:"gallery__group-header gallery__group-header--virtual",children:[d.jsx("span",{className:"gallery__group-label",children:o(x.label)}),d.jsx("span",{className:"gallery__group-count",children:x.count})]}):d.jsx("div",{className:"gallery__grid gallery__grid--virtual",children:x.items.map((E,P)=>s(E,x.id,P))})},x.id):null})})}function rv({showSessions:e,favoritesOnly:a,query:i,historyNextCursor:o,favoriteHistoryNextCursor:s,historyLoadingOlder:c,favoriteHistoryLoadingOlder:m,onLoadOlder:p,onLoadOlderFavorites:h,t:g}){return e?d.jsx("div",{className:"gallery__load-more gallery__load-more--hint",children:g("gallery.sessionPaginationHint")}):i.trim()?null:a?s?d.jsx("div",{className:"gallery__load-more",children:d.jsx("button",{type:"button",onClick:h,disabled:m,children:g(m?"gallery.loadingOlderFavorites":"gallery.loadOlderFavorites")})}):null:o?d.jsx("div",{className:"gallery__load-more",children:d.jsx("button",{type:"button",onClick:p,disabled:c,children:g(c?"gallery.loadingOlder":"gallery.loadOlder")})}):null}function rO({groups:e,loose:a,favoritesOnly:i,galleryScope:o,setGalleryScope:s,renderTile:c,t:m}){return e.length===0&&a.length===0?d.jsx("div",{className:"gallery__empty",children:i?m("gallery.emptyFavorites"):o==="current-session"?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:m("gallery.empty.currentSession")}),d.jsx("button",{type:"button",onClick:()=>s("all"),children:m("gallery.scope.all")})]}):m("gallery.emptySessions")}):d.jsxs(d.Fragment,{children:[e.map(p=>d.jsxs("section",{className:"gallery__group",children:[d.jsxs("header",{className:"gallery__group-header",children:[d.jsx("span",{className:"gallery__group-label",title:p.sessionId,children:p.title?p.displayLabel:m("gallery.sessionLabel",{name:p.displayLabel})}),d.jsx("span",{className:"gallery__group-count",children:p.items.length})]}),d.jsx("div",{className:"gallery__grid",children:p.items.map((h,g)=>c(h,p.sessionId,g))})]},p.sessionId)),a.length>0&&d.jsxs("section",{className:"gallery__group",children:[d.jsxs("header",{className:"gallery__group-header",children:[d.jsx("span",{className:"gallery__group-label",children:m("gallery.standalone")}),d.jsx("span",{className:"gallery__group-count",children:a.length})]}),d.jsx("div",{className:"gallery__grid",children:a.map((p,h)=>c(p,"loose",h))})]})]})}function iO({status:e,dismissed:a,onOpenFolder:i,onDismiss:o,t:s}){const c=e!=null&&e.state!=="ok"&&!a,m=e?.state==="recoverable"?"gallery.storageNoticeRecoverable":e?.state==="not_found"?"gallery.storageNoticeNotFound":"gallery.storageNoticeUnknown";return d.jsxs("div",{className:`gallery__storage-bar${c?" gallery__storage-bar--notice":""}`,children:[c?d.jsxs("div",{className:"gallery__storage-copy",children:[d.jsx("div",{className:"gallery__storage-title",children:s("gallery.storageNoticeTitle")}),d.jsx("div",{className:"gallery__storage-text",children:s(m)})]}):d.jsx("div",{className:"gallery__storage-copy gallery__storage-copy--quiet",children:e?.generatedDirLabel??"~/.ima2/generated"}),d.jsxs("div",{className:"gallery__storage-actions",children:[d.jsx("button",{type:"button",className:"gallery__storage-button",onClick:i,title:s("gallery.openGeneratedDirTitle"),children:s("gallery.openGeneratedDir")}),c&&d.jsx("button",{type:"button",className:"gallery__storage-button gallery__storage-button--ghost",onClick:o,children:s("common.close")})]})]})}const iv="ima2.storageNoticeDismissed.0.09.23";function lO(e){const a=R.useRef(null),i=R.useRef(new Map),[o,s]=R.useState(()=>new Set);R.useEffect(()=>{if(!e||typeof IntersectionObserver>"u")return;const m=new IntersectionObserver(p=>{const h=p.filter(g=>g.isIntersecting);h.length!==0&&s(g=>{const S=new Set(g);for(const v of h){const y=v.target.dataset.galleryLazyKey;y&&S.add(y)}return S})},{root:e,rootMargin:"200% 0px"});a.current=m;for(const p of i.current.values())m.observe(p);return()=>{m.disconnect(),a.current=null}},[e]);const c=R.useCallback((m,p)=>{const h=i.current.get(m);h&&h!==p&&a.current?.unobserve(h),p?(i.current.set(m,p),a.current?.observe(p)):i.current.delete(m)},[]);return{visibleKeys:o,register:c,supported:typeof IntersectionObserver<"u"}}function sO(){const{t:e,locale:a}=ge(),i=w(te=>te.galleryOpen),o=w(te=>te.closeGallery),s=w(te=>te.history),c=w(te=>te.selectHistory),m=w(te=>te.currentImage),p=w(te=>te.trashHistoryItem),h=w(te=>te.showToast),g=w(te=>te.toggleGalleryFavorite),S=w(te=>te.galleryScope),v=w(te=>te.setGalleryScope),y=w(te=>te.historyNextCursor),x=w(te=>te.historyLoadingOlder),E=w(te=>te.favoriteHistoryNextCursor),P=w(te=>te.favoriteHistoryLoadingOlder),I=w(te=>te.loadOlderHistory),k=w(te=>te.loadFavoriteHistory),C=w(te=>te.loadOlderFavoriteHistory),_=w(r1),[N,j]=R.useState(""),[$,L]=R.useState("date"),[J,re]=R.useState(!1),[he,V]=R.useState(()=>new Set),ee=R.useRef(new Set),[oe,Ne]=R.useState([]),[ne,H]=R.useState([]),[ae,ce]=R.useState(!1),[be,Se]=R.useState(!1),[T,F]=R.useState(!1),[W,U]=R.useState(0),[le,pe]=R.useState(null),[xe,Oe]=R.useState(()=>{try{return localStorage.getItem(iv)==="1"}catch{return!1}}),Re=R.useRef(null),Ze=R.useRef({}),[ie,lt]=R.useState(null),at=R.useRef(0),st=R.useRef({open:!1,selectedKey:null}),bt=R.useMemo(()=>hs(s.filter(mi)),[s]),se=R.useCallback(te=>{Re.current=te,lt(te)},[]),qe=lO(ie),ot=uo(i,o);R.useEffect(()=>{i||j("")},[i]),R.useEffect(()=>{if(!i)return;let te=!1;return(async()=>{try{const Te=await LT();te||pe(Te)}catch{te||pe({generatedDirLabel:"~/.ima2/generated",generatedCount:0,legacyCandidatesScanned:0,legacySourcesFound:0,legacyFilesFound:0,state:"unknown",messageKind:"unknown",recoveryDocsPath:"docs/RECOVER_OLD_IMAGES.md",doctorCommand:"ima2 doctor",overrides:{generatedDir:!1,configDir:!1}})}})(),()=>{te=!0}},[i]),R.useEffect(()=>{if(!i||$!=="session")return;let te=!1;return Ne([]),H([]),ce(!0),Se(!1),F(!1),(async()=>{try{const Te=await MT({limit:500,sessionId:S==="current-session"?_:void 0});if(te)return;F(Te.nextCursor!==null||Te.total>=500);const Tt=de=>{const We=de.kind,Ft=We==="classic"||We==="edit"||We==="generate"||We==="card-news-card"||We==="card-news-set"?We:null,Ma=de.mediaType==="video"||/\.(mp4|webm|mov)$/i.test(de.filename??"");return{image:de.url,url:de.url,filename:de.filename,thumb:de.thumb??(Ma?void 0:de.url),mediaType:de.mediaType,video:de.video??null,videoSeries:de.videoSeries??null,videoContinuity:de.videoContinuity??null,prompt:de.prompt??void 0,userPrompt:de.userPrompt??null,revisedPrompt:de.revisedPrompt??null,promptMode:de.promptMode??null,composerPrompt:de.composerPrompt??null,composerInsertedPrompts:de.composerInsertedPrompts??null,size:de.size??void 0,quality:de.quality??void 0,format:de.format,moderation:de.moderation??void 0,model:de.model??void 0,reasoningEffort:de.reasoningEffort,provider:de.provider,providerUrl:de.providerUrl??null,usage:de.usage,elapsed:de.elapsed??void 0,createdAt:de.createdAt,sessionId:de.sessionId??null,nodeId:de.nodeId??null,parentNodeId:de.parentNodeId??null,clientNodeId:de.clientNodeId??null,requestId:de.requestId??null,kind:Ft,setId:de.setId??null,cardId:de.cardId??null,cardOrder:de.cardOrder??null,headline:de.headline??null,body:de.body??null,cards:de.cards,refsCount:de.refsCount??0,webSearchCalls:de.webSearchCalls??0,sequenceId:de.sequenceId??null,sequenceIndex:de.sequenceIndex??null,sequenceTotalRequested:de.sequenceTotalRequested??null,sequenceTotalReturned:de.sequenceTotalReturned??null,sequenceStatus:de.sequenceStatus??null,isFavorite:de.isFavorite??!1}};Ne(Te.sessions.map(de=>({sessionId:de.sessionId,title:de.title??null,label:de.label??null,displayLabel:de.title||de.label||de.sessionId.slice(0,8),items:hs(de.items.filter(mi).map(Tt))})).filter(de=>de.items.length>0)),H(hs(Te.loose.filter(mi).map(Tt)))}catch{te||Se(!0)}finally{te||ce(!1)}})(),()=>{te=!0}},[i,$,S,_,W]),R.useEffect(()=>{!i||$==="session"||!J||k()},[i,$,J,k]);const St=R.useMemo(()=>{const te=N.trim().toLowerCase().normalize("NFC");return bt.filter(Te=>J&&!Te.isFavorite?!1:te?(Te.prompt??"").toLowerCase().normalize("NFC").includes(te)||(Te.filename??"").toLowerCase().normalize("NFC").includes(te):!0)},[bt,N,J]),xt=R.useMemo(()=>J?oe.map(te=>({...te,items:te.items.filter(Te=>Te.isFavorite)})).filter(te=>te.items.length>0):oe,[oe,J]),nn=R.useMemo(()=>J?ne.filter(te=>te.isFavorite):ne,[ne,J]),Yt=R.useMemo(()=>{const te=new Map;for(const Te of St){const Tt=TL(Te.createdAt,a);te.has(Tt)||te.set(Tt,[]),te.get(Tt).push(Te)}return Array.from(te.entries())},[St,a]),fn=$==="session"?xt.reduce((te,Te)=>te+Te.items.length,0)+nn.length:St.length;R.useLayoutEffect(()=>{const te=m?Ot(m):null;if(!i){st.current={open:!1,selectedKey:te};return}const Te=st.current,Tt=!Te.open||Te.selectedKey!==te;st.current={open:!0,selectedKey:te};const de=te?Ze.current[te]:null;if(Tt&&de){de.scrollIntoView({block:"center"});return}Re.current&&(Re.current.scrollTop=at.current)},[i,m?.filename,m?.image,$,fn,Yt.length,xt.length,nn.length]);async function et(te,Te){Te.stopPropagation();const Tt=Ot(te);await p(te),delete Ze.current[Tt],window.requestAnimationFrame(()=>Re.current?.focus())}async function On(te){const Te=te.filename;if(!(!Te||ee.current.has(Te))){ee.current.add(Te),V(new Set(ee.current));try{const Tt=await g(te);if(Tt===null)return;Ne(de=>de.map(We=>({...We,items:We.items.map(Ft=>Ft.filename===Te?{...Ft,isFavorite:Tt}:Ft)}))),H(de=>de.map(We=>We.filename===Te?{...We,isFavorite:Tt}:We))}finally{ee.current.delete(Te),V(new Set(ee.current))}}}async function D(){try{await OT(),h(e("toast.openGeneratedDirOpened"))}catch{h(e("toast.openGeneratedDirFailed"),!0)}}const{handleOpenCardNewsSet:Ae,handleCopyCardNewsSetPath:ke,handleDownloadCardNewsManifest:Qe}=CL(o,h,e);function pt(){Oe(!0);try{localStorage.setItem(iv,"1")}catch{}}if(!i)return null;const Dt=te=>te==="earlier"||te==="today"||te==="yesterday"||te==="thisWeek"?e(`gallery.${te}`):te,_a=(te,Te,Tt)=>{const de=m?.image===te.image,We=Ot(te),Ft=gn=>{Ze.current[We]=gn,qe.register(We,gn)};return(qe.supported?qe.visibleKeys.has(We):!0)?te.kind==="card-news-set"?d.jsx("div",{ref:Ft,className:"gallery__tile-wrap gallery-card-news-set",children:d.jsx(EL,{item:te,onOpen:gn=>{Ae(gn)},onCopyPath:ke,onDownloadManifest:Qe})},`${Te}-${We}`):d.jsx(jL,{item:te,active:de,itemRef:Ft,onSelect:gn=>{c(gn),o()},onDelete:et,onToggleFavorite:On,favoriteBusy:!!(te.filename&&he.has(te.filename)),t:e},`${Te}-${We}`):d.jsx("div",{ref:Ft,className:"gallery__tile-wrap","data-gallery-lazy-key":We,style:{aspectRatio:"1 / 1"},"aria-hidden":"true"},`${Te}-${We}`)},At=$==="session",Pt=m?Ot(m):null;return d.jsx("div",{className:"gallery-backdrop",onClick:o,role:"presentation",children:d.jsxs("div",{ref:ot,className:"gallery",role:"dialog","aria-modal":"true","aria-label":e("gallery.ariaLabel"),tabIndex:-1,onClick:te=>te.stopPropagation(),children:[d.jsxs("div",{className:"gallery__header",children:[d.jsxs("div",{className:"gallery__title-row",children:[d.jsx("div",{className:"gallery__title",children:e("gallery.title")}),d.jsxs("div",{className:"gallery__meta",children:[e("gallery.total",{n:fn}),N||J?e("gallery.totalFiltered",{n:bt.length}):""]}),d.jsx(ju,{className:"gallery__favorite-filter",ariaLabel:e("gallery.favoriteFilterAria"),value:J?"favorites":"all",onChange:te=>re(te==="favorites"),tabs:[{value:"all",label:e("gallery.filterAll")},{value:"favorites",label:e("gallery.filterFavorites")}]}),d.jsx(ju,{className:"gallery__group-toggle",ariaLabel:e("gallery.sortByAria"),value:$,onChange:L,tabs:[{value:"date",label:e("gallery.sortByDate")},{value:"session",label:e("gallery.sortBySession")}]}),d.jsx(ju,{className:"gallery__scope",ariaLabel:e("gallery.scopeAria"),value:S,onChange:v,tabs:[{value:"current-session",label:e("gallery.scope.current"),disabled:!_},{value:"all",label:e("gallery.scope.all")}]})]}),d.jsx("input",{type:"text",className:"gallery__search",...At?{}:{"data-modal-initial-focus":!0},placeholder:e(At?"gallery.searchDisabledPlaceholder":"gallery.searchPlaceholder"),value:N,onChange:te=>j(te.target.value),disabled:At}),d.jsx("button",{type:"button",className:"gallery__close",onClick:o,"aria-label":e("gallery.closeAria"),title:e("gallery.closeTitle"),children:"×"})]}),d.jsx(iO,{status:le,dismissed:xe,onOpenFolder:D,onDismiss:pt,t:e}),d.jsx("div",{className:"gallery__scroll",ref:se,tabIndex:-1,onScroll:()=>{at.current=Re.current?.scrollTop??0},children:At?ae?d.jsx("div",{className:"gallery__empty",role:"status","aria-live":"polite",children:e("gallery.sessionLoading")}):be?d.jsxs("div",{className:"gallery__empty",role:"alert",children:[d.jsx("span",{children:e("gallery.sessionLoadFailed")}),d.jsx("button",{type:"button",onClick:()=>U(te=>te+1),children:e("gallery.retry")})]}):d.jsxs(d.Fragment,{children:[T?d.jsx("div",{className:"gallery__limit-notice",role:"status",children:e("gallery.sessionLimitNotice",{count:500})}):null,d.jsx(rO,{groups:xt,loose:nn,favoritesOnly:J,galleryScope:S,setGalleryScope:v,renderTile:_a,t:e}),d.jsx(rv,{showSessions:At,favoritesOnly:J,query:N,historyNextCursor:y,favoriteHistoryNextCursor:E,historyLoadingOlder:x,favoriteHistoryLoadingOlder:P,onLoadOlder:()=>{I()},onLoadOlderFavorites:()=>{C()},t:e})]}):St.length===0?d.jsx("div",{className:"gallery__empty",children:bt.length===0?e("gallery.emptyAll"):e(J?"gallery.emptyFavorites":"gallery.noResults")}):d.jsxs(d.Fragment,{children:[d.jsx(oO,{dateGroups:Yt,selectedKey:Pt,scrollElement:ie,localizeBucket:Dt,renderTile:_a}),d.jsx(rv,{showSessions:At,favoritesOnly:J,query:N,historyNextCursor:y,favoriteHistoryNextCursor:E,historyLoadingOlder:x,favoriteHistoryLoadingOlder:P,onLoadOlder:()=>{I()},onLoadOlderFavorites:()=>{C()},t:e})]})})]})})}function cO(e){return e.includes("ratio")?"sizeConfirm.reasonRatio":e.includes("maxPixels")||e.includes("pixels")?"sizeConfirm.reasonPixels":e.includes("minPixels")?"sizeConfirm.reasonMinPixels":e.includes("min")?"sizeConfirm.reasonMin":e.includes("maxEdge")||e.includes("max")?"sizeConfirm.reasonMax":"sizeConfirm.reasonSnap"}function dO(){const e=w(p=>p.customSizeConfirm),a=w(p=>p.confirmCustomSizeAdjustment),i=w(p=>p.cancelCustomSizeAdjustment),{t:o}=ge(),s=uo(!!e,i);if(!e)return null;const c=`${e.requestedW}x${e.requestedH}`,m=`${e.adjustedW}x${e.adjustedH}`;return d.jsx("div",{className:"modal-backdrop custom-size-confirm-backdrop",role:"presentation",children:d.jsxs("div",{ref:s,className:"modal custom-size-confirm",role:"dialog","aria-modal":"true","aria-labelledby":"custom-size-confirm-title","aria-describedby":"custom-size-confirm-body",tabIndex:-1,children:[d.jsx("div",{id:"custom-size-confirm-title",className:"modal__title",children:o("sizeConfirm.title")}),d.jsxs("div",{id:"custom-size-confirm-body",className:"modal__body",children:[d.jsx("p",{children:o("sizeConfirm.body")}),d.jsxs("dl",{className:"size-confirm__pairs",children:[d.jsxs("div",{className:"size-confirm__pair",children:[d.jsx("dt",{children:o("sizeConfirm.requested")}),d.jsx("dd",{children:c})]}),d.jsxs("div",{className:"size-confirm__pair",children:[d.jsx("dt",{children:o("sizeConfirm.adjusted")}),d.jsx("dd",{children:m})]})]}),d.jsx("p",{className:"size-confirm__reason",children:o(cO(e.reasons))})]}),d.jsxs("div",{className:"modal__actions",children:[d.jsx("button",{type:"button","data-modal-initial-focus":!0,className:"modal__btn modal__btn--secondary",onClick:i,children:o("sizeConfirm.cancel")}),d.jsx("button",{type:"button",className:"modal__btn",onClick:()=>{a()},children:o("sizeConfirm.approve")})]})]})})}function ls(e){return e==null||e===""?"-":String(e)}function uO(){const{t:e}=ge(),a=w(h=>h.metadataRestore),i=w(h=>h.applyMetadataRestore),o=w(h=>h.addMetadataRestoreAsReference),s=w(h=>h.cancelMetadataRestore),c=uo(!!a,s);if(!a)return null;const m=a.metadata,p=m.userPrompt||m.prompt||m.revisedPrompt||"";return d.jsx("div",{className:"modal-backdrop metadata-restore-backdrop",role:"presentation",children:d.jsxs("div",{ref:c,className:"modal metadata-restore",role:"dialog","aria-modal":"true","aria-labelledby":"metadata-restore-title",tabIndex:-1,children:[d.jsx("div",{id:"metadata-restore-title",className:"modal__title",children:e("metadata.restoreTitle")}),d.jsxs("div",{className:"modal__body metadata-restore__body",children:[d.jsx("p",{children:e("metadata.restoreBody")}),d.jsxs("div",{className:"metadata-restore__preview",children:[d.jsx("img",{src:a.image,alt:e("metadata.imageAlt")}),d.jsxs("div",{className:"metadata-restore__details",children:[d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.prompt")}),d.jsx("strong",{title:p,children:ls(p)})]}),d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.size")}),d.jsx("strong",{children:ls(m.size)})]}),d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.quality")}),d.jsx("strong",{children:ls(m.quality)})]}),d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.model")}),d.jsx("strong",{children:ls(m.model)})]}),d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.source")}),d.jsx("strong",{children:a.source==="png-comment"?e("metadata.sourcePngComment"):e("metadata.sourceXmp")})]})]})]})]}),d.jsxs("div",{className:"modal__actions",children:[d.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:s,"data-modal-initial-focus":!0,children:e("common.cancel")}),d.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:o,children:e("metadata.useAsReferenceOnly")}),d.jsx("button",{type:"button",className:"modal__btn",onClick:i,children:e("metadata.applySettings")})]})]})})}function mO(){const{t:e}=ge(),a=w(P=>P.readinessPopupOpen),i=w(P=>P.closeReadinessPopup),o=w(P=>P.openSettings),s=w(P=>P.provider),c=w(P=>P.imageModel),m=w(P=>P.reasoningEffort),p=w(P=>P.webSearchEnabled),h=_S(),g=s==="grok",S=Na.find(P=>P.value===c),v=uo(a,i);if(!a)return null;const y=h[s],x=y.ok,E=()=>{i(),o("providers")};return d.jsx("div",{className:"modal-backdrop provider-readiness-backdrop",onClick:i,role:"presentation",children:d.jsxs("div",{ref:v,className:"modal provider-readiness",role:"dialog","aria-modal":"true","aria-labelledby":"provider-readiness-title",tabIndex:-1,onClick:P=>P.stopPropagation(),children:[d.jsx("div",{id:"provider-readiness-title",className:"modal__title",children:e("readiness.title")}),d.jsxs("div",{className:"modal__body provider-readiness__body",children:[d.jsxs("div",{className:`provider-readiness__status${x?" is-ok":" is-blocked"}`,children:[d.jsx("span",{"aria-hidden":"true"}),d.jsx("strong",{children:e(x?"readiness.ready":"readiness.blocked")}),d.jsx("small",{children:x?e("readiness.readyBody"):y.reason})]}),y.hint?d.jsx("p",{className:"modal__hint",children:y.hint}):null,d.jsxs("dl",{className:"provider-readiness__facts",children:[d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.provider")}),d.jsx("dd",{children:s==="agy"?"Gemini":s==="grok"?"Grok OAuth":s==="oauth"?"GPT OAuth":"GPT API"})]}),d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.model")}),d.jsx("dd",{children:S?e(S.fullLabelKey):c})]}),g?d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.grokApi")}),d.jsx("dd",{children:e("readiness.grokApiBody")})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.reasoning")}),d.jsx("dd",{children:m})]}),d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.webSearch")}),d.jsx("dd",{children:e(p?"settings.webSearch.on":"settings.webSearch.off")})]})]})]})]}),d.jsxs("div",{className:"modal__actions",children:[d.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:i,"data-modal-initial-focus":!0,children:e("common.close")}),d.jsx("button",{type:"button",className:"modal__btn",onClick:E,children:e("readiness.openAccount")})]})]})})}const lv="ima2.onboardingDismissed";function pO(){const{t:e}=ge(),a=w(I=>I.openSettings),i=RS(),o=NS(),{data:s}=kS(),[c,m]=R.useState(()=>{try{return localStorage.getItem(lv)==="1"}catch{return!1}}),p=i!==null&&o!==null&&s!=null,h=i?.status==="auth_required"||i?.status==="offline",g=o?.status==="offline"||o?.status==="error",S=s?!s.gemini?.configured&&!s.vertex?.configured:!1,y=!c&&(p&&h&&g&&S),x=()=>{try{localStorage.setItem(lv,"1")}catch{}m(!0)},E=()=>{x(),a("providers")},P=uo(y,x);return y?d.jsx("div",{className:"modal-backdrop",role:"presentation",children:d.jsxs("div",{ref:P,className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-title",tabIndex:-1,children:[d.jsx("div",{id:"onboarding-title",className:"modal__title",children:e("onboarding.title")}),d.jsx("div",{className:"modal__body",children:d.jsx("p",{children:e("onboarding.body")})}),d.jsxs("div",{className:"modal__actions",children:[d.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:x,"data-modal-initial-focus":!0,children:e("onboarding.skip")}),d.jsx("button",{type:"button",className:"modal__btn",onClick:E,children:e("onboarding.login")})]})]})}):null}function fO(){const e=w(m=>m.trashPending),a=w(m=>m.restorePendingTrash),i=w(m=>m.clearPendingTrash),{t:o}=ge(),[s,c]=R.useState(Date.now());return R.useEffect(()=>{if(!e)return;c(Date.now());const m=window.setInterval(()=>{const p=Date.now();c(p),p>=e.expiresAt&&i()},500);return()=>window.clearInterval(m)},[i,e]),e?d.jsxs("div",{className:"trash-undo-toast",children:[d.jsx("span",{children:o("gallery.deleted",{filename:e.filename})}),d.jsx("button",{type:"button",onClick:()=>{a()},children:o("gallery.undo")}),d.jsx("span",{className:"trash-undo-toast__timer",children:o("gallery.secondsSuffix",{n:Math.max(0,Math.ceil((e.expiresAt-s)/1e3))})})]}):null}function gO(){return d.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("line",{x1:"4",y1:"6",x2:"14",y2:"6"}),d.jsx("circle",{cx:"17",cy:"6",r:"2.2"}),d.jsx("line",{x1:"4",y1:"12",x2:"8",y2:"12"}),d.jsx("circle",{cx:"11",cy:"12",r:"2.2"}),d.jsx("line",{x1:"14",y1:"12",x2:"20",y2:"12"}),d.jsx("line",{x1:"4",y1:"18",x2:"14",y2:"18"}),d.jsx("circle",{cx:"17",cy:"18",r:"2.2"})]})}function hO(){const e=w(g=>g.composeSheetOpen),a=w(g=>g.composeSheetTab),i=w(g=>g.openComposeSheet),o=w(g=>g.settingsOpen),s=w(g=>g.uiMode),{t:c}=ge();if(!ka()||o||s==="home"||s==="card-news"||s==="agent"||s==="assets"||s==="asset-gen")return null;const p=e&&a==="controls",h=c("sheet.controlsOpen");return d.jsx("button",{type:"button",className:"mobile-settings-toggle","aria-expanded":p,"aria-controls":"mobile-generate-sheet","aria-label":h,title:h,onClick:()=>i("controls"),children:d.jsx(gO,{})})}let ks=null;function yO(e){ks=e}function vO(){const e=ks;ks=null,e?.isConnected&&e.focus()}function sv(){ks=null}function bO(){const{t:e}=ge(),a=w(S=>S.openComposeSheet),i=w(S=>S.settingsOpen),o=w(S=>S.uiMode),s=o==="agent"&&lr?"agent":o==="node"&&ir?"node":o==="home"?"home":o==="assets"?"assets":o==="asset-gen"?"asset-gen":"classic",c=ka(),m=R.useRef(null),p=R.useRef(null),h=R.useRef(null),g=(S,v)=>{v.current&&yO(v.current),a(S==="library"?"library":S==="controls"?"controls":"prompt")};return!c||i||s!=="classic"?null:d.jsxs("header",{className:"mobile-app-bar",role:"banner",children:[d.jsxs("div",{className:"mobile-app-bar__brand",children:[d.jsx("div",{className:"logo-mark","aria-hidden":"true"}),d.jsxs("div",{className:"mobile-app-bar__brand-copy",children:[d.jsx("span",{className:"mobile-app-bar__title",children:"ima2-gen"}),d.jsx("span",{className:"mobile-app-bar__mode",children:e("appBar.modeImage")})]})]}),d.jsxs("div",{className:"mobile-app-bar__actions",children:[d.jsx(AS,{compact:!0}),d.jsx("button",{ref:m,type:"button",className:"mobile-app-bar__icon-button",onClick:()=>g("library",m),"aria-label":e("promptLibrary.title"),title:e("promptLibrary.title"),children:d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})})}),d.jsx("button",{ref:p,type:"button",className:"mobile-app-bar__icon-button",onClick:()=>g("controls",p),"aria-label":e("appBar.controls"),title:e("appBar.controls"),children:d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"3"}),d.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),d.jsx("button",{ref:h,type:"button",className:"mobile-app-bar__generate",onClick:()=>g("prompt",h),"aria-label":e("appBar.generateAria"),title:e("appBar.generate"),style:{width:44,padding:0},children:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M12 3l1.8 5.4L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.6L12 3z"}),d.jsx("path",{d:"M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8L19 15z"})]})})]})]})}const SO={"#home":"home","#create":"classic","#canvas":"classic","#node":"node","#agent":"agent","#assets":"assets","#asset-gen":"asset-gen"},cv={home:"#home",classic:"#create",node:"#node",agent:"#agent",assets:"#assets","asset-gen":"#asset-gen"};function xO(){const e=location.hash;if(e==="#settings")return{mode:"classic",settings:!0};const a=SO[e];return a&&a!=="settings"?{mode:a,settings:!1}:null}function AO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),d.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),d.jsx("path",{d:"m21 15-5-5L5 21"})]})}function TO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),d.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]})}function CO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"2",y:"6",width:"8",height:"6",rx:"1"}),d.jsx("rect",{x:"14",y:"12",width:"8",height:"6",rx:"1"}),d.jsx("path",{d:"M10 9h4"}),d.jsx("path",{d:"M14 15V9a2 2 0 0 1 2-2h0"})]})}function wO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"2.5",fill:"currentColor",stroke:"none"}),d.jsx("ellipse",{cx:"12",cy:"12",rx:"9",ry:"4",transform:"rotate(-30 12 12)"}),d.jsx("ellipse",{cx:"12",cy:"12",rx:"9",ry:"4",transform:"rotate(30 12 12)"})]})}function IO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function EO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}),d.jsx("path",{d:"M8 12h8"})]})}function RO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"3",y:"3",width:"13",height:"13",rx:"2"}),d.jsx("path",{d:"M3 12l3.5-3.5a1.4 1.4 0 0 1 2 0L13 13"}),d.jsx("path",{d:"M19 14v6"}),d.jsx("path",{d:"M16 17h6"})]})}const NO=[{id:"home",mode:"home",icon:TO,labelKey:"nav.home",enabled:!0},{id:"create",mode:"classic",icon:AO,labelKey:"nav.create",enabled:!0},{id:"node",mode:"node",icon:CO,labelKey:"nav.node",enabled:ir},{id:"agent",mode:"agent",icon:wO,labelKey:"nav.agent",enabled:lr},{id:"assets",mode:"assets",icon:EO,labelKey:"nav.assets",enabled:!0},{id:"asset-gen",mode:"asset-gen",icon:RO,labelKey:"nav.assetGen",enabled:!0},{id:"settings",settingsAction:!0,icon:IO,labelKey:"nav.settings",enabled:!0,bottom:!0}];function kO(){const{t:e}=ge(),a=w(x=>x.uiMode),i=w(x=>x.setUIMode),o=w(x=>x.settingsOpen),s=w(x=>x.openSettings),c=w(x=>x.closeSettings),m=ka(),p=R.useCallback(x=>{if(x.settingsAction){o?(c(),history.replaceState(null,"",cv[a]||"#create")):(s(),history.replaceState(null,"","#settings"));return}x.mode&&(o&&c(),i(x.mode),history.replaceState(null,"",cv[x.mode]||"#create"))},[a,o,i,s,c]);R.useEffect(()=>{const x=()=>{const E=xO();E&&(E.settings?s():(o&&c(),i(E.mode)))};return x(),window.addEventListener("popstate",x),window.addEventListener("hashchange",x),()=>{window.removeEventListener("popstate",x),window.removeEventListener("hashchange",x)}},[]);const h=NO.filter(x=>x.enabled),g=h.filter(x=>!x.bottom),S=h.filter(x=>x.bottom),v=x=>x.settingsAction?o:!o&&x.mode===a,y=x=>d.jsxs("button",{type:"button",className:`nav-rail__btn${v(x)?" is-active":""}`,onClick:()=>p(x),"aria-label":e(x.labelKey),"aria-current":v(x)?"page":void 0,children:[d.jsx(x.icon,{}),d.jsx("span",{className:"nav-rail__label","aria-hidden":"true",children:e(x.labelKey)})]},x.id);return m?d.jsx("nav",{className:"nav-rail nav-rail--mobile","aria-label":e("nav.ariaLabel"),children:h.map(y)}):d.jsxs("nav",{className:"nav-rail","aria-label":e("nav.ariaLabel"),children:[d.jsx("div",{className:"nav-rail__top",children:g.map(y)}),d.jsx("div",{className:"nav-rail__bottom",children:S.map(y)})]})}const _O=R.lazy(()=>$t(()=>import("./PromptLibraryPanel-BngHherb.js"),[]).then(e=>({default:e.PromptLibraryPanel}))),Rn=["prompt","controls","library"],ss="mobile-inflight-panel",cs=e=>`mobile-sheet-tab-${e}`,ds=e=>`mobile-sheet-panel-${e}`;function MO(){const{t:e}=ge(),a=w(N=>N.composeSheetOpen),i=w(N=>N.composeSheetTab),o=w(N=>N.setComposeSheetTab),s=w(N=>N.closeComposeSheet),c=w(N=>N.inFlight.length),m=w(N=>N.settingsOpen),p=w(N=>N.uiMode),h=p==="agent"&&lr?"agent":p==="node"&&ir?"node":p==="home"?"home":p==="assets"?"assets":"classic",g=ka(),[S,v]=R.useState(!1),y=R.useRef(c),x=R.useRef(!1),E=R.useRef(null),P=R.useRef({}),I=R.useRef(!1),k=N=>{o(N),requestAnimationFrame(()=>P.current[N]?.focus())},C=(N,j)=>{const $=Rn.indexOf(j),L=N.key==="ArrowRight"?Rn[($+1)%Rn.length]:N.key==="ArrowLeft"?Rn[($-1+Rn.length)%Rn.length]:N.key==="Home"?Rn[0]:N.key==="End"?Rn[Rn.length-1]:null;L&&(N.preventDefault(),k(L))};R.useEffect(()=>{if((!a||i!=="prompt"||!g||m||h!=="classic")&&v(!1),!a)return;const N=j=>{j.key==="Escape"&&s()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[a,i,s,g,m,h]),R.useLayoutEffect(()=>{const N=y.current>0&&c===0;y.current=c,N&&(v(!1),x.current&&E.current?.querySelector(".generate-btn")?.focus(),x.current=!1)},[c]),R.useLayoutEffect(()=>{if(a){I.current=!0;const N=requestAnimationFrame(()=>P.current[i]?.focus());return()=>cancelAnimationFrame(N)}I.current&&(I.current=!1,vO())},[a,i]);const _=g&&!m&&h==="classic";return R.useEffect(()=>{_||(I.current=!1,w.getState().composeSheetOpen&&s(),sv())},[_]),R.useEffect(()=>()=>sv(),[]),_?d.jsxs(d.Fragment,{children:[a?d.jsx("button",{type:"button",className:"compose-sheet-backdrop","aria-label":e("sheet.close"),onClick:s}):null,d.jsxs("section",{id:"mobile-generate-sheet",inert:!a,className:`compose-sheet${a?" compose-sheet--open":""}`,role:"dialog","aria-modal":a?"true":"false","aria-label":e("sheet.generate"),"aria-hidden":!a,children:[d.jsx("button",{type:"button",className:"compose-sheet__handle",onClick:s,"aria-label":e("sheet.close")}),d.jsx("div",{className:"mobile-sheet-tabs",role:"tablist","aria-label":e("sheet.generate"),children:Rn.map(N=>d.jsx("button",{ref:j=>{P.current[N]=j},id:cs(N),type:"button",role:"tab","aria-selected":i===N,"aria-controls":ds(N),tabIndex:i===N?0:-1,className:`mobile-sheet-tabs__button${i===N?" active":""}`,onClick:()=>o(N),onKeyDown:j=>C(j,N),children:e(`sheet.tabs.${N}`)},N))}),d.jsxs("div",{className:"compose-sheet__body",children:[d.jsx("div",{id:ds("prompt"),className:"compose-sheet__panel compose-sheet__panel--prompt",role:"tabpanel","aria-labelledby":cs("prompt"),hidden:i!=="prompt",onFocusCapture:N=>{const j=document.getElementById(ss);x.current=j?.contains(N.target)??!1},children:i==="prompt"?d.jsxs(d.Fragment,{children:[d.jsx(qm,{}),c>0?d.jsxs("section",{className:"compose-sheet__inflight",hidden:!S,children:[d.jsxs("button",{type:"button",className:"compose-sheet__inflight-header",onClick:()=>{E.current?.querySelector(".inflight-badge")?.focus(),v(!1)},"aria-expanded":S,"aria-controls":ss,"aria-label":e("inflight.inlineCollapse",{n:c}),children:[d.jsxs("span",{children:[e("inflight.title")," (",c,")"]}),d.jsx("span",{"aria-hidden":"true",children:"−"})]}),d.jsx(Hm,{variant:"inline",panelId:ss}),d.jsx("p",{className:"compose-sheet__inflight-footer",children:e("inflight.footerHint")})]}):null,d.jsxs("div",{ref:E,className:"compose-sheet__actions",children:[d.jsx(Um,{}),d.jsx(xS,{variant:"inline",panelId:ss,expanded:S,onToggle:v})]})]}):null}),d.jsx("div",{id:ds("controls"),className:"compose-sheet__panel compose-sheet__panel--controls",role:"tabpanel","aria-labelledby":cs("controls"),hidden:i!=="controls",children:i==="controls"?d.jsx(OS,{}):null}),d.jsx("div",{id:ds("library"),className:"compose-sheet__panel compose-sheet__panel--library",role:"tabpanel","aria-labelledby":cs("library"),hidden:i!=="library",children:i==="library"?d.jsx(R.Suspense,{fallback:d.jsx("div",{className:"prompt-library-panel__loading",children:e("common.loading")}),children:d.jsx(_O,{variant:"embedded",forceOpen:!0,onRequestClose:()=>o("prompt")})}):null})]})]})]}):null}const PO={ArrowLeft:"previous",ArrowRight:"next",Home:"first",End:"last",PageUp:"pagePrevious",PageDown:"pageNext"};function LO(){const e=w(o=>o.uiMode),a=w(o=>!!o.currentImage||!!o.multimodePreviewFlightId),i=w(o=>o.selectHistoryShortcutTarget);R.useEffect(()=>{if(e!=="classic")return;const o=s=>{const c=PO[s.key];c&&(s.defaultPrevented||ys(s.target)||a&&(s.preventDefault(),i(c)))};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a,i,e])}const us=64,DS="Image Gen";let Km=DS,tm=!1,Ia=null,$m="",nm=!1;function FS(){return navigator}function zS(){if(typeof document>"u")return null;if(Ia)return Ia;const e=document.querySelector('link[rel~="icon"]');if(e)return Ia=e,$m=e.href||e.getAttribute("href")||"",e;const a=document.createElement("link");return a.rel="icon",document.head.appendChild(a),Ia=a,nm=!0,a}function OO(e){const a=document.createElement("canvas");a.width=us,a.height=us;const i=a.getContext("2d");return i?(i.clearRect(0,0,us,us),i.fillStyle="#0a0a0a",jO(i,6,6,52,52,12),i.fill(),i.strokeStyle="#ffffff",i.lineWidth=5,i.beginPath(),i.arc(30,32,14,0,Math.PI*2),i.stroke(),i.fillStyle="#ffffff",i.beginPath(),i.arc(30,32,5,0,Math.PI*2),i.fill(),i.beginPath(),i.arc(48,16,e>1?13:10,0,Math.PI*2),i.fillStyle="#ff335f",i.fill(),i.lineWidth=4,i.strokeStyle="#ffffff",i.stroke(),e>1&&(i.fillStyle="#ffffff",i.font="bold 15px sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText(String(Math.min(e,9)),48,17)),a.toDataURL("image/png")):$m}function jO(e,a,i,o,s,c){e.beginPath(),e.moveTo(a+c,i),e.arcTo(a+o,i,a+o,i+s,c),e.arcTo(a+o,i+s,a,i+s,c),e.arcTo(a,i+s,a,i,c),e.arcTo(a,i,a+o,i,c),e.closePath()}async function GO(e){const a=FS();if(typeof a.setAppBadge=="function")try{await a.setAppBadge(e)}catch{}}async function DO(){const e=FS();if(typeof e.clearAppBadge=="function")try{await e.clearAppBadge()}catch{}}function FO(e){document.title=`(${e}) ${Km}`;const a=zS();a&&(a.href=OO(e)),GO(e)}function dv(){document.title=Km,Ia&&(nm?(Ia.remove(),Ia=null,nm=!1):Ia.href=$m),DO()}function uv(){tm||typeof document>"u"||(tm=!0,Km=document.title||DS,zS())}function zO(e){R.useEffect(()=>(uv(),()=>{tm&&dv()}),[]),R.useEffect(()=>{uv(),e>0?FO(e):dv()},[e])}function qO(){R.useEffect(()=>{if(typeof window>"u")return;const e=window.visualViewport;if(!e)return;const a=()=>{const i=Math.round(e.height),o=Math.round(e.offsetTop);document.documentElement.style.setProperty("--vv-h",`${i}px`),document.documentElement.style.setProperty("--vv-offset-top",`${o}px`)};return a(),e.addEventListener("resize",a),e.addEventListener("scroll",a),()=>{e.removeEventListener("resize",a),e.removeEventListener("scroll",a)}},[])}const UO=R.lazy(()=>$t(()=>import("./NodeCanvas-BpNgtUxt.js"),__vite__mapDeps([0,1])).then(e=>({default:e.NodeCanvas}))),HO=R.lazy(()=>$t(()=>import("./SettingsWorkspace-dpl5CLsg.js"),[]).then(e=>({default:e.SettingsWorkspace}))),BO=R.lazy(()=>$t(()=>import("./CardNewsWorkspace-Cchcm8ts.js"),[]).then(e=>({default:e.CardNewsWorkspace}))),VO=R.lazy(()=>$t(()=>import("./AgentWorkspace-Bfe9PqZy.js"),__vite__mapDeps([2,3])).then(e=>({default:e.AgentWorkspace}))),KO=R.lazy(()=>$t(()=>import("./AssetsWorkspace-HemkY-0A.js"),__vite__mapDeps([4,5,3,6])).then(e=>({default:e.AssetsWorkspace}))),$O=R.lazy(()=>$t(()=>import("./AssetGenWorkspace-XbViHOY0.js").then(e=>e.A),__vite__mapDeps([7,5,3,8])).then(e=>({default:e.AssetGenWorkspace}))),YO=R.lazy(()=>$t(()=>import("./HomeWorkspace-Do6VnjWR.js"),[]).then(e=>({default:e.HomeWorkspace}))),XO=R.lazy(()=>$t(()=>import("./PromptLibraryPanel-BngHherb.js"),[]).then(e=>({default:e.PromptLibraryPanel})));function QO(){return d.jsx("main",{className:"canvas canvas--lazy-loading","aria-busy":"true"})}function JO(){LO(),qO();const{locale:e}=ge(),a=w(j=>j.hydrateHistory),i=w(j=>j.loadSessions),o=w(j=>j.syncCapabilities),s=w(j=>j.startInFlightPolling),c=w(j=>j.reconcileInflight),m=w(j=>j.syncFromStorage),p=w(j=>j.settingsOpen),h=w(j=>j.unseenGeneratedCount),g=w(j=>j.historyStripLayout),S=w(j=>j.workspaceProfile),v=w(j=>j.uiMode),y=v==="agent"&&lr?"agent":v==="node"&&ir?"node":v==="home"?"home":v==="assets"?"assets":v==="asset-gen"?"asset-gen":"classic",x=y==="agent",E=y==="assets",P=y==="asset-gen",I=y==="home",k=ka(),C=Ei(S),_=!k&&y==="classic"&&C.composerPlacement==="bottom"&&C.multimodeHistoryGrouping==="sequence",N=!_&&!x&&!E&&!P&&!I;return zO(h),R.useEffect(()=>{document.documentElement.lang=e},[e]),R.useEffect(()=>{o(),a(),i(),c(),s(),lo(),CT(()=>c()),wT(j=>{j==="failed"&&console.warn("[SSE] connection failed after multiple retries")})},[a,i,c,s,o]),R.useEffect(()=>{const j=$=>{const L=$.detail?.assetId;L&&w.getState().openAssetDetail(L)};return window.addEventListener("ima2:open-assets-detail",j),()=>window.removeEventListener("ima2:open-assets-detail",j)},[]),R.useEffect(()=>{const j=$=>{$.key&&($.key==="ima2.inFlight"||$.key==="ima2.selectedFilename")&&m()};return window.addEventListener("storage",j),()=>window.removeEventListener("storage",j)},[m]),R.useEffect(()=>{const j=()=>{o1(w.getState)};return window.addEventListener("beforeunload",j),()=>{window.removeEventListener("beforeunload",j)}},[]),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:`app${S==="prompt-studio"?" app--prompt-studio":""}${p?" app--settings-open":""}${N&&g==="horizontal"?" app--history-horizontal":""}${N&&g==="sidebar"?" app--history-sidebar":""}`,"data-history-strip-layout":g,"data-mobile":k?"1":void 0,"data-ui-mode":y,children:[d.jsx(kO,{}),I?null:d.jsx(P2,{}),d.jsx(bO,{}),N?d.jsx(SL,{}):null,d.jsx(R.Suspense,{fallback:d.jsx(QO,{}),children:p?d.jsx(HO,{}):y==="classic"?_?d.jsx(bP,{}):d.jsx(em,{}):y==="node"?d.jsx(UO,{}):y==="card-news"?d.jsx(BO,{}):y==="agent"?d.jsx(VO,{}):y==="assets"?d.jsx(KO,{}):y==="asset-gen"?d.jsx($O,{}):y==="home"?d.jsx(YO,{}):d.jsx(em,{})}),y==="agent"||y==="card-news"||y==="assets"||y==="asset-gen"||y==="home"?null:d.jsx(fL,{})]}),d.jsx(dO,{}),d.jsx(fO,{}),d.jsx(xL,{}),d.jsx(AL,{}),d.jsx(sO,{}),d.jsx(uO,{}),d.jsx(mO,{}),d.jsx(pO,{}),d.jsx(MO,{}),d.jsx(hO,{}),y==="card-news"?d.jsx(R.Suspense,{fallback:null,children:d.jsx(XO,{})}):null]})}function WO(){if(window.location.protocol!=="http:"||window.location.hostname!=="localhost")return!1;const e=new URL(window.location.href);return e.hostname="127.0.0.1",window.location.replace(e.toString()),!0}WO()||cT.createRoot(document.getElementById("root")).render(d.jsx(R.StrictMode,{children:d.jsx(JO,{})}));export{ZL as $,$u as A,vs as B,Js as C,i0 as D,Cj as E,xn as F,r0 as G,cS as H,Na as I,Rj as J,Nj as K,kj as L,vt as M,gL as N,o0 as O,tR as P,Eb as Q,Hl as R,HM as S,CM as T,Tj as U,d0 as V,BM as W,Ij as X,JT as Y,bj as Z,_1 as _,R as a,vS as a0,_j as a1,Pj as a2,Mj as a3,Aj as a4,Ej as a5,im as a6,_b as a7,IL as a8,Hm as a9,ej as aA,sj as aB,aj as aC,z2 as aD,nj as aE,dP as aF,pv as aG,tj as aH,Z as aI,uj as aJ,cj as aK,mj as aL,pj as aM,dj as aN,ZO as aO,fj as aP,gj as aQ,hj as aR,yj as aS,vj as aT,$t as aa,xj as ab,io as ac,Sj as ad,Ks as ae,zm as af,yS as ag,Ot as ah,_S as ai,AO as aj,CO as ak,ir as al,wO as am,lr as an,EO as ao,cv as ap,uo as aq,TM as ar,sP as as,cP as at,Zu as au,ij as av,rj as aw,ys as ax,lj as ay,oj as az,w as b,Cv as c,ML as d,p1 as e,WE as f,eT as g,Mn as h,kn as i,d as j,ro as k,wj as l,M1 as m,u1 as n,kb as o,QT as p,ue as q,am as r,ka as s,tr as t,ge as u,RS as v,XR as w,NS as x,PP as y,kS as z};
|
|
30
|
+
`);function sP({imageOverride:e=null,onAfterDeleteFocus:a}){const{t:i}=ge(),o=w(se=>se.currentImage),s=w(se=>se.showToast),c=w(se=>se.insertPromptToComposer),m=w(se=>se.createRootNodeFromHistoryItem),p=w(se=>se.trashHistoryItem),h=w(se=>se.saveToAssets),g=w(se=>se.permanentlyDeleteHistoryItemByClick),S=w(se=>se.canvasOpen),v=w(se=>se.openCanvas),[y,x]=R.useState(!1),[E,P]=R.useState(!1),[I,k]=R.useState("idle"),[C,_]=R.useState(!1),[N,j]=R.useState(!1),[$,L]=R.useState(!1),[J,re]=R.useState(!1),he=R.useRef(null);R.useEffect(()=>{let se=!0;return jm().then(qe=>{se&&re(qe.some(ot=>ot.id==="runway"&&ot.status.state==="connected"))}).catch(()=>{}),()=>{se=!1}},[]);const V=async se=>{if(!ee?.filename||$)return;const qe=tP(ee.filename,se);if(!qe){s(i("result.upscaleInvalid"),!0);return}L(!0);try{await ue("/api/mcp/media-action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)}),j(!1),s(i("result.upscaleStarted"))}catch{s(i("result.upscaleFailed"),!0)}finally{L(!1)}};R.useEffect(()=>()=>he.current?.abort(),[]);const ee=e??o;if(!ee)return null;const oe=gt(ee),Ne=oe?ee.url||ee.image:"",ne=!!ee.filename,H=!!ee.filename&&!oe,ae=oe&&!!ee.filename,be=!!((ee.provider==="grok"||ee.provider==="grok-api")&&!oe&&ee.providerUrl&&ee.createdAt&&Date.now()-ee.createdAt<$y),Se=async()=>{if(!(!ee.filename||E)){P(!0);try{await w.getState().animateImage(ee.filename,ee.prompt??void 0)&&s(i("toast.animateDone"))}catch(se){const qe=se instanceof Error?se.message:i("toast.animateFailed");s(qe,!0)}finally{P(!1)}}},T=async()=>{if(!ee.filename||I==="pending")return;const se=`vext_${crypto.randomUUID()}`,qe=new AbortController;he.current=qe,k("pending");try{const ot=await H2({requestId:se,sourceVideoId:ee.filename,prompt:ee.prompt?.trim()||void 0,provider:ee.provider==="grok-api"?"grok-api":"grok",model:ee.model??void 0},qe.signal);w.getState().addHistoryItem(q2(ot,ee)),k("idle"),s(i("toast.animateDone"))}catch(ot){const St=ot instanceof DOMException&&ot.name==="AbortError";k(St?"idle":"error"),St||s(ot instanceof Error?ot.message:i("toast.animateFailed"),!0)}finally{he.current===qe&&(he.current=null)}},F=()=>he.current?.abort(),W=()=>{const se=document.createElement("a");se.href=ee.image,se.download=ee.filename||"generated.png",se.click()},U=async se=>{const ot=await(await fetch(se)).blob();let St;if(ot.type==="image/png")St=ot;else{const xt=new Image;xt.crossOrigin="anonymous";const nn=URL.createObjectURL(ot);await new Promise((fn,et)=>{xt.onload=()=>fn(),xt.onerror=et,xt.src=nn});const Yt=document.createElement("canvas");Yt.width=xt.naturalWidth,Yt.height=xt.naturalHeight,Yt.getContext("2d").drawImage(xt,0,0),URL.revokeObjectURL(nn),St=await new Promise((fn,et)=>Yt.toBlob(On=>On?fn(On):et(),"image/png"))}await navigator.clipboard.write([new ClipboardItem({"image/png":St})])},le=async()=>{try{if(oe){const se=await cr(Ne);await U(se)}else await U(ee.image);s(i(oe?"toast.frameCopied":"toast.imageCopied"))}catch{s(i("toast.copyFailed"),!0)}},pe=async()=>{try{const se=await yb(Ne);await U(se),s(i("toast.frameCopied"))}catch{s(i("toast.copyFailed"),!0)}},xe=async()=>{try{const se=await vb(Ne);await U(se),s(i("toast.frameCopied"))}catch{s(i("toast.copyFailed"),!0)}},Oe=async()=>{if(ee.prompt)try{await navigator.clipboard.writeText(ee.prompt),s(i("toast.promptCopied"))}catch{s(i("clipboard.writeFailed"),!0)}},Re=async se=>{try{await navigator.clipboard.writeText(se),s(i("toast.metadataCopied"))}catch{s(i("clipboard.writeFailed"),!0)}},Ze=async()=>{let se={ok:!1,isVideo:!1,hasPrompt:!1};try{se=await Ws(ee)}catch{}S&&e&&c({id:rP,name:iP,text:lP});const qe=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');qe&&(qe.focus(),qe.setSelectionRange(qe.value.length,qe.value.length)),s(i(se.hasPrompt?"toast.forkStarted":"toast.forkStartedNoPrompt"))},ie=async()=>{if(oe||!ee.providerUrl||!ee.createdAt||Date.now()-ee.createdAt>=$y){s(i("toast.continueAsUrlExpired"),!0);return}try{await bS(ee)}catch{}const se=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');se&&(se.focus(),se.setSelectionRange(se.value.length,se.value.length)),s(i("toast.continueAsUrlStarted"))},lt=async()=>{if(!(!ee.filename||y)){x(!0);try{const se=await DT({filename:ee.filename});s(i("toast.comfyExported",{filename:se.uploadedFilename}))}catch(se){const qe=se instanceof Error?se.code:void 0;s(i(qe==="COMFY_URL_NOT_LOCAL"?"toast.comfyExportInvalidUrl":qe==="COMFY_IMAGE_INVALID"?"toast.comfyExportInvalidImage":qe==="COMFY_IMAGE_NOT_FOUND"?"toast.comfyExportImageNotFound":"toast.comfyExportFailed"),!0)}finally{x(!1)}}},at=()=>{m(ee),s(i("toast.nodeRootCreated"))},st=async()=>{try{await p(ee)}finally{a?.()}},bt=async()=>{try{await g(ee)}finally{a?.()}};return d.jsxs("div",{className:"result-actions",children:[d.jsx("button",{type:"button",className:"action-btn",onClick:W,children:i("result.download")}),d.jsx("button",{type:"button",className:`action-btn${oe?" action-btn--frame":""}`,onClick:le,children:i(oe?"result.copyLastFrame":"result.copyImage")}),oe&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-btn action-btn--frame",onClick:pe,children:i("result.copyFirstFrame")}),d.jsx("button",{type:"button",className:"action-btn action-btn--frame",onClick:xe,children:i("result.copyMidFrame")})]}),d.jsx("button",{type:"button",className:"action-btn",onClick:()=>{Oe()},children:i("result.copyPrompt")}),d.jsx("button",{type:"button",className:"action-btn",onClick:()=>{(async()=>{const se=await h(ee);s(i(se?"chain.savedToAssets":"chain.saveToAssetsFailed"),!se)})()},title:i("chain.saveToAssets"),children:i("chain.saveToAssets")}),d.jsx("button",{type:"button",className:"action-btn action-btn--primary",onClick:Ze,title:i("result.continueHereTitle"),children:i("result.continueHere")}),be&&d.jsx("button",{type:"button",className:"action-btn",onClick:()=>{ie()},title:i("result.continueAsUrlTitle"),children:i("result.continueAsUrl")}),H&&d.jsx("button",{type:"button",className:"action-btn",onClick:()=>{Se()},disabled:E,title:i("result.animateTitle"),children:i(E?"result.animating":"result.animate")}),J&&ee.filename&&(oe?d.jsx("button",{type:"button",className:"action-btn",disabled:$,onClick:()=>{V({})},title:i("result.upscaleTitle"),children:i($?"inflight.streaming":"result.upscale")}):d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-btn",disabled:$,onClick:()=>j(se=>!se),title:i("result.upscaleTitle"),children:i("result.upscale")}),N?d.jsx(oP,{pending:$,onSubmit:se=>{V(se)},onClose:()=>j(!1)}):null]})),ae&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-btn",onClick:T,disabled:I==="pending","aria-busy":I==="pending",title:i("result.extendTitle")??"이어가기",children:I==="pending"?i("inflight.streaming"):I==="error"?i("gallery.retry"):i("result.extend")??"이어가기"}),I==="pending"&&d.jsx("button",{type:"button",className:"action-btn",onClick:F,children:i("common.cancel")})]}),d.jsx("button",{type:"button",className:"action-btn",onClick:at,title:i("result.firstNodeTitle"),children:i("result.firstNode")}),d.jsx("button",{type:"button",className:"action-btn",onClick:()=>_(!0),title:i("result.infoTitle"),children:i("result.info")}),!S&&d.jsx("button",{type:"button",className:"action-btn",onClick:v,title:i("canvas.open"),"aria-label":i("canvas.openAria"),children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:d.jsx("path",{d:"M4 4h8v8M12 4l-8 8"})})}),ee.filename&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-btn action-btn--danger",onClick:()=>{st()},title:i("result.deleteTitle"),children:i("result.delete")}),d.jsxs("details",{className:"result-actions__more",children:[d.jsx("summary",{className:"action-btn",children:i("result.more")}),d.jsxs("div",{className:"result-actions__menu",children:[ne&&d.jsx("button",{type:"button",className:"result-actions__menu-item",onClick:()=>{lt()},title:i("result.sendToComfyUITitle"),disabled:y,children:i("result.sendToComfyUI")}),d.jsx("button",{type:"button",className:"result-actions__menu-item result-actions__danger-item",onClick:()=>{bt()},children:i("result.permanentDelete")})]})]})]}),C&&d.jsx(Z2,{item:ee,onClose:()=>_(!1),onCopy:se=>{Re(se)}})]})}function cP({prompt:e,onCopy:a}){const{t:i}=ge(),o=s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),a())};return d.jsx("div",{className:"result-prompt",onClick:a,onKeyDown:o,role:"button",tabIndex:0,title:i("result.copyPrompt"),"aria-label":i("result.copyPrompt"),children:d.jsx("span",{className:"result-prompt__text",children:e})})}function dP(){const e=w(y=>{const x=y.multimodePreviewFlightId;return x?y.multimodeSequences[x]??null:null}),a=w(y=>y.cancelMultimode),i=w(y=>{const x=y.multimodePreviewFlightId;return!!(x&&(y.activeFlightIds.has(x)||y.inFlight.some(E=>E.id===x)))}),o=w(y=>y.selectHistory),s=w(y=>y.currentImage),c=w(y=>y.openCanvas),{t:m}=ge(),p=y=>{o(y)},h=y=>{o(y),c()};if(!e)return null;const g=new Map,S=e.partials.filter(y=>y.index==null);for(const y of e.partials)y.index!=null&&g.set(y.index,y);const v=Array.from({length:e.requested},(y,x)=>{const E=e.images[x],P=g.get(x)??(E?void 0:S.shift());return{index:x,image:E,partial:P}});return d.jsxs("section",{className:"multimode-sequence","aria-live":"polite",children:[d.jsxs("div",{className:"multimode-sequence__header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"multimode-sequence__title",children:m("multimode.sequenceTitle")}),d.jsx("div",{className:"multimode-sequence__meta",children:m("multimode.sequenceProgress",{returned:e.returned,requested:e.requested})})]}),i?d.jsx("button",{type:"button",className:"secondary-btn",onClick:a,children:m("multimode.cancel")}):null]}),d.jsx("div",{className:`multimode-sequence__grid count-${Math.min(e.requested,4)}`,children:v.map(({index:y,image:x,partial:E})=>{const P=x&&s?.filename&&x.filename===s.filename;return d.jsxs("article",{className:`multimode-sequence__slot${x?" done":""}${P?" active":""}`,onClick:x?()=>p(x):void 0,onDoubleClick:x?()=>h(x):void 0,role:x?"button":void 0,tabIndex:x?0:void 0,onKeyDown:x?I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),p(x))}:void 0,children:[d.jsx("div",{className:"multimode-sequence__badge",children:m("multimode.stageLabel",{index:y+1})}),x?d.jsx("img",{src:x.url??x.image,alt:m("canvas.resultAlt"),loading:"lazy",decoding:"async",className:"multimode-sequence__img-fade"}):E?d.jsx("img",{src:E.image,alt:m("multimode.partialAlt"),loading:"lazy",decoding:"async",className:"multimode-sequence__img-fade"}):e.status==="pending"||e.status==="complete"?d.jsx("div",{className:"multimode-sequence__skeleton"}):d.jsx("div",{className:"multimode-sequence__empty",children:e.status==="error"?m("multimode.error"):e.status==="empty"?m("multimode.empty"):e.status==="canceled"?m("multimode.canceled"):e.status==="partial"?m("multimode.notReturned"):m("multimode.generating")})]},x?.filename??y)})})]})}function uP({zoom:e,minZoom:a,maxZoom:i,onZoomIn:o,onZoomOut:s,onReset:c,labels:m}){return d.jsxs("div",{className:"viewer-controls","aria-label":m.controls,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),onWheel:p=>p.stopPropagation(),children:[d.jsx("button",{type:"button",className:"viewer-control-btn",onClick:p=>{p.stopPropagation(),s()},disabled:e<=a,"aria-label":m.zoomOut,children:"-"}),d.jsxs("button",{type:"button",className:"viewer-control-btn viewer-control-btn--label",onClick:p=>{p.stopPropagation(),c()},"aria-label":m.reset,children:[Math.round(e*100),"%"]}),d.jsx("button",{type:"button",className:"viewer-control-btn",onClick:p=>{p.stopPropagation(),o()},disabled:e>=i,"aria-label":m.zoomIn,children:"+"})]})}function ys(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLButtonElement||e.isContentEditable:!1}function mP(e,a,i,o){if(!e)return!1;const s=a.find(c=>c.filename===e);return s?!!s.isFavorite:o!==void 0?o:i.has(e)}function _j(e,a){return a?e.filter(i=>i!=="starred"):Array.from(new Set([...e,"starred"]))}const no=1,IS=5,as=.22;function pP(e){return Math.min(IS,Math.max(no,e))}function fP(e){const[a,i]=R.useState(1),[o,s]=R.useState({x:0,y:0}),[c,m]=R.useState(null),p=R.useRef(0),h=R.useRef(null),g=R.useCallback(()=>{cancelAnimationFrame(p.current),p.current=0,h.current=null,i(1),s({x:0,y:0}),m(null)},[]);R.useEffect(()=>{g()},[g,e]),R.useEffect(()=>()=>{cancelAnimationFrame(p.current)},[]);const S=R.useCallback(I=>{i(k=>{const C=pP(k+I);return C<=no?(s({x:0,y:0}),no):Number(C.toFixed(2))})},[]),v=R.useCallback(I=>{I.preventDefault(),S(I.deltaY<0?as:-as)},[S]),y=R.useCallback(()=>{if(a>no){g();return}i(2)},[g,a]),x=R.useCallback(I=>{a<=no||I.button!==0||(I.preventDefault(),I.currentTarget.setPointerCapture(I.pointerId),m({pointerId:I.pointerId,startX:I.clientX,startY:I.clientY,baseX:o.x,baseY:o.y}))},[o.x,o.y,a]),E=R.useCallback(I=>{if(!c||c.pointerId!==I.pointerId)return;const k={x:c.baseX+I.clientX-c.startX,y:c.baseY+I.clientY-c.startY};h.current=k,cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{s(k),h.current=null})},[c]),P=R.useCallback(I=>{!c||c.pointerId!==I.pointerId||(cancelAnimationFrame(p.current),p.current=0,h.current&&(s(h.current),h.current=null),m(null),I.currentTarget.releasePointerCapture(I.pointerId))},[c]);return{zoom:a,pan:o,reset:g,zoomIn:()=>S(as),zoomOut:()=>S(-as),handleWheel:v,handleDoubleClick:y,handlePointerDown:x,handlePointerMove:E,handlePointerUp:P}}const gP=R.lazy(()=>$t(()=>import("./index-DBh-jt0i.js"),[]).then(e=>({default:e.CanvasModeWorkspace})));function hP(e){return e==="low"?"l":e==="medium"?"m":e==="high"?"h":e??null}function yP(e){if(!e)return null;const a=e.match(/^(\d+)x\1$/);return a?`${a[1]}²`:e.replace("x","×")}function vP(e){const a=e.url??e.image;if(!e.canvasVersion||!e.canvasMergedAt||a.startsWith("data:"))return a;const i=a.includes("?")?"&":"?";return`${a}${i}canvasMergedAt=${e.canvasMergedAt}`}function em(){const e=w(T=>T.currentImage),a=w(T=>T.importLocalImageToHistory),i=w(T=>{const F=T.multimodePreviewFlightId;return F?T.multimodeSequences[F]??null:null}),o=w(T=>T.selectHistoryShortcutTarget),s=w(T=>T.trashHistoryItem),c=w(T=>T.permanentlyDeleteHistoryItemByShortcut),m=w(T=>T.markGeneratedResultsSeen),p=w(T=>T.activeGenerations),h=w(T=>T.canvasOpen),g=w(T=>T.openCanvas),S=w(T=>T.showToast),v=w(T=>T.history),y=w(T=>T.galleryFavorites),x=w(T=>T.toggleGalleryFavorite),{t:E}=ge(),[P,I]=R.useState(!1),[k,C]=R.useState(null),{creatingBlankCanvas:_,createBlankCanvas:N}=z2(),j=R.useRef(null),$=e?`${e.filename??e.url??e.image}:${e.canvasMergedAt??""}`:null,L=fP($),J=()=>{e?.prompt&&(navigator.clipboard.writeText(e.prompt),S(E("toast.promptCopied")))},re=T=>{if(T.key==="Delete"||T.key==="Backspace"){if(!e||T.target!==T.currentTarget||ys(T.target))return;if(T.preventDefault(),T.shiftKey){c(e);return}s(e);return}T.key!=="ArrowLeft"&&T.key!=="ArrowRight"&&T.key!=="Home"&&T.key!=="End"||T.target===T.currentTarget&&(ys(T.target)||(T.preventDefault(),T.key==="ArrowLeft"?o("previous"):T.key==="ArrowRight"?o("next"):T.key==="Home"?o("first"):T.key==="End"&&o("last")))},he=T=>{ys(T.target)||(m(),T.currentTarget.focus())},V=R.useCallback(()=>{window.requestAnimationFrame(()=>j.current?.focus())},[]),ee=async()=>{const T=e?.filename;if(!(!e||!T||k===T)){C(T);try{await x(e)}finally{C(F=>F===T?null:F)}}},oe=R.useCallback(T=>{Array.from(T.dataTransfer.types).includes("Files")&&(T.preventDefault(),I(F=>F||!0))},[]),Ne=R.useCallback(T=>{T.currentTarget.contains(T.relatedTarget)||I(!1)},[]),ne=R.useCallback(async T=>{if(!Array.from(T.dataTransfer.types).includes("Files"))return;T.preventDefault(),I(!1);const F=Array.from(T.dataTransfer.files).filter(W=>/^image\/(png|jpeg|webp)$/.test(W.type));F.length!==0&&await a(F[0])},[a]);if(h&&e)return d.jsx(R.Suspense,{fallback:d.jsx("main",{className:"canvas canvas--mode-open","aria-busy":"true"}),children:d.jsx(gP,{currentImage:e})});const H=hP(e?.quality),ae=yP(e?.size),ce=Cv(e?.model,e?.provider),be=e?vP(e):null,Se=mP(e?.filename,v,y,e?.isFavorite);return d.jsxs("main",{className:`canvas${P?" canvas--drop-active":""}`,onDragOver:oe,onDragLeave:Ne,onDrop:ne,children:[P?d.jsx("div",{className:"canvas__drop-overlay","aria-hidden":!0,children:d.jsx("span",{className:"canvas__drop-hint",children:E("canvas.drop.hint")})}):null,d.jsx("div",{className:`progress-bar${p>0?" active":""}`}),i?d.jsx(dP,{}):e&&be?d.jsxs("div",{ref:j,className:"result-container visible",tabIndex:0,onMouseDown:he,onKeyDown:re,"aria-label":E("canvas.imageViewerAria"),children:[d.jsxs("div",{className:`result-preview-frame canvas-annotation-frame${L.zoom>no?" canvas-annotation-frame--zoomed":""}`,onWheel:L.handleWheel,onDoubleClick:L.handleDoubleClick,onPointerDown:L.handlePointerDown,onPointerMove:L.handlePointerMove,onPointerUp:L.handlePointerUp,onPointerCancel:L.handlePointerUp,children:[e.filename?d.jsx(vS,{variant:"result",active:Se,busy:k===e.filename,label:E(Se?"gallery.unfavoriteAria":"gallery.favoriteAria"),onToggle:ee}):null,gt(e)?d.jsxs(d.Fragment,{children:[d.jsx("video",{className:"result-img",src:be,controls:!0,autoPlay:!0,loop:!0,playsInline:!0,style:{transform:`translate(${L.pan.x}px, ${L.pan.y}px) scale(${L.zoom})`}},$??void 0),d.jsx("div",{className:"result-drag-handle",draggable:!0,onDragStart:T=>{T.dataTransfer.setData("application/ima2-ref",JSON.stringify(yi(e))),T.dataTransfer.effectAllowed="copy"},title:E("canvas.dragToComposer"),"aria-label":E("canvas.dragToComposer"),children:E("canvas.dragHint")})]}):d.jsxs(d.Fragment,{children:[d.jsx("img",{className:"result-img",src:be,alt:E("canvas.resultAlt"),decoding:"async",fetchPriority:"high",style:{transform:`translate(${L.pan.x}px, ${L.pan.y}px) scale(${L.zoom})`},onDoubleClick:T=>{T.stopPropagation(),g()}},$??void 0),d.jsx("div",{className:"result-drag-handle",draggable:!0,onDragStart:T=>{T.dataTransfer.setData("application/ima2-ref",JSON.stringify({image:e.url||e.image,filename:e.filename})),T.dataTransfer.effectAllowed="copy"},title:E("canvas.dragToComposer"),"aria-label":E("canvas.dragToComposer"),children:E("canvas.dragHint")})]}),d.jsx(uP,{zoom:L.zoom,minZoom:no,maxZoom:IS,onZoomIn:L.zoomIn,onZoomOut:L.zoomOut,onReset:L.reset,labels:{controls:E("viewer.controls"),zoomIn:E("viewer.zoomIn"),zoomOut:E("viewer.zoomOut"),reset:E("viewer.reset")}})]}),d.jsx("div",{className:"result-meta",children:(gt(e)?[e.elapsed!=null?`${e.elapsed}s`:null,e.video?.duration?`${e.video.duration}s clip`:null,e.video?.resolution??null,e.video?.aspectRatio??null,Bb(e.videoContinuity),ce]:[e.elapsed!=null?`${e.elapsed}s`:null,e.usage?E("canvas.tokens",{n:e.usage.total_tokens??"?"}):null,WE(e.reasoningEffort),H,ae,ce]).filter(T=>!!T).join(" · ")}),d.jsx(sP,{onAfterDeleteFocus:V}),e.prompt?d.jsx(cP,{prompt:e.prompt,onCopy:J}):null]}):e?null:d.jsxs("div",{className:"canvas__blank-entry",children:[d.jsx("div",{className:"canvas__blank-sheet","aria-hidden":!0}),d.jsxs("div",{className:"canvas__blank-copy",children:[d.jsx("strong",{children:E("canvas.blank.title")}),d.jsx("span",{children:E("canvas.blank.subtitle")})]}),d.jsx("button",{type:"button",className:"canvas__blank-button",onClick:()=>{N()},disabled:_,children:E(_?"canvas.blank.creating":"canvas.blank.create")})]})]})}function bP(){return d.jsxs("div",{className:"classic-workspace",children:[d.jsx("div",{className:"classic-workspace__stage",children:d.jsx(em,{})}),d.jsxs("div",{className:"classic-workspace__dock",children:[d.jsx(qm,{variant:"bottom"}),d.jsx(Um,{})]})]})}const ES="ima2.customSizeSlots";function SP(e){if(!e||typeof e!="object")return!1;const a=e;return typeof a.id=="string"&&typeof a.w=="number"&&typeof a.h=="number"&&typeof a.updatedAt=="number"}function xP(){try{const e=localStorage.getItem(ES);if(!e)return[];const a=JSON.parse(e);return Array.isArray(a)?Wo(a.filter(SP)):[]}catch{return[]}}function AP(e){try{localStorage.setItem(ES,JSON.stringify(Wo(e)))}catch{}}function TP(e,a,i){return Gs({id:`slot_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,w:e,h:a,ratio:i,updatedAt:Date.now()})}function ci(e){return e.map(a=>({value:a.value,label:a.label,sub:a.sub}))}function CP(){const e=w(ne=>ne.sizePreset),a=w(ne=>ne.setSizePreset),i=w(ne=>ne.customW),o=w(ne=>ne.customH),s=w(ne=>ne.setCustomSize),{t:c}=ge(),[m,p]=R.useState(String(i)),[h,g]=R.useState(String(o)),[S,v]=R.useState(e==="custom"),[y,x]=R.useState(()=>xP()),[E,P]=R.useState(null),[I,k]=R.useState("free"),C=e==="custom",_=pm(m,h,i,o),N=gR().filter(ne=>ne.value==="auto");R.useEffect(()=>{p(String(i)),g(String(o))},[i,o]),R.useEffect(()=>{C||(v(!1),P(null))},[C]);function j(ne){x(ne),AP(ne)}function $(){const ne=_n(m,i),H=_n(h,o);s(ne,H),p(String(ne)),g(String(H))}function L(ne){ne.key==="Enter"&&(ne.preventDefault(),$())}function J(){a("custom"),v(!0),P(y.length>=Jo?y[0]?.id??null:null)}function re(ne){a(ne),ne!=="custom"&&(v(!1),P(null))}function he(ne){a("custom"),s(ne.w,ne.h),p(String(ne.w)),g(String(ne.h)),v(!1),P(ne.id)}function V(ne){k(ne.id);const H=sR(ne);H&&(p(String(H.w)),g(String(H.h)))}function ee(){const ne=TP(_.w,_.h,I),H=y.length>=Jo&&E?dR(y,E,ne):cR(y,ne);j(H),a("custom"),s(_.w,_.h),p(String(_.w)),g(String(_.h)),P(ne.id),v(!1)}const oe=_.reasons.length>0?_.reasons.map(ne=>c(`size.adjustedReasons.${ne}`)).join(", "):c("size.noAdjustment"),Ne=_.reasons.includes("maxPixels")&&_.requestedW===_.requestedH&&_.w===_.h?c("size.squareMaxHint",{size:`${uy}×${uy}`}):null;return d.jsxs("div",{className:"option-group size-picker",children:[d.jsx("div",{className:"section-title",children:c("size.title")}),d.jsx(xn,{title:"",items:ci(uR),value:e,onChange:re}),d.jsx(xn,{title:"",items:ci(mR),value:e,onChange:re}),d.jsx(xn,{title:"",items:ci(pR),value:e,onChange:re}),d.jsx(xn,{title:"",items:ci(fR),value:e,onChange:re}),d.jsxs("div",{className:"option-row size-picker__quick-row",children:[ci(N).map(ne=>d.jsxs("button",{type:"button",className:`option-btn${e===ne.value?" active":""}`,onClick:()=>re(ne.value),children:[ne.label,ne.sub?d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:ne.sub})]}):null]},ne.value)),d.jsxs("button",{type:"button",className:`option-btn${C?" active":""}`,onClick:J,children:[c("size.customPlus"),d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:c("size.customSub")})]})]}),y.length>0?d.jsx("div",{className:"option-row size-picker__slot-row",children:y.map(ne=>d.jsxs("button",{type:"button",className:`option-btn size-picker__slot${C&&i===ne.w&&o===ne.h?" active":""}`,onClick:()=>he(ne),children:[ne.w,"×",ne.h,d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:ne.ratio||c("size.customSlot")})]},ne.id))}):null,S?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"size-picker__ratio-row",children:iR.map(ne=>d.jsx("button",{type:"button",className:`size-picker__ratio${I===ne.id?" active":""}`,onClick:()=>V(ne),children:ne.id==="free"?c("size.ratioFree"):ne.label},ne.id))}),d.jsxs("div",{className:"option-row size-picker__custom-row",children:[d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:m,onChange:ne=>p(ne.target.value.replace(/\D/g,"")),onBlur:$,onKeyDown:L,placeholder:c("size.width")}),d.jsx("span",{className:"size-picker__dimension-separator","aria-hidden":"true",children:"×"}),d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:h,onChange:ne=>g(ne.target.value.replace(/\D/g,"")),onBlur:$,onKeyDown:L,placeholder:c("size.height")})]}),d.jsxs("div",{className:"size-picker__preview",children:[d.jsx("span",{children:c("size.normalizedPreview")}),d.jsx("strong",{children:lR(_.w,_.h)})]}),d.jsx("div",{className:"size-picker__preview size-picker__preview--reason",children:oe}),Ne?d.jsx("div",{className:"size-picker__preview size-picker__preview--detail",children:Ne}):null,y.length>=Jo?d.jsxs("div",{className:"size-picker__replace-row",children:[d.jsx("span",{children:c("size.replaceCustomSlot")}),y.map(ne=>d.jsxs("button",{type:"button",className:`size-picker__replace${E===ne.id?" active":""}`,onClick:()=>P(ne.id),children:[ne.w,"×",ne.h]},ne.id))]}):null,d.jsx("button",{type:"button",className:"size-picker__save",onClick:ee,children:y.length>=Jo?c("size.replaceCustomSlot"):c("size.saveCustomSlot")}),d.jsx("div",{className:"size-hint",children:c("size.hint")})]}):null]})}const ku=[1,2,4];function wP(){const e=w(C=>C.count),a=w(C=>C.setCount),i=w(C=>C.uiMode),o=w(C=>C.multimode),s=w(C=>C.multimodeMaxImages),c=w(C=>C.setMultimodeMaxImages),{t:m}=ge(),p=i==="classic"&&o,h=p?s:e,g=p?c:a,[S,v]=R.useState(!ku.includes(h)),[y,x]=R.useState(String(h));R.useEffect(()=>{v(!ku.includes(h)),x(String(h))},[p,h]);function E(C=y){const _=Yu(Number.parseInt(C,10));g(_),x(String(_))}function P(C){v(!1),x(String(C)),g(C)}function I(C){const _=Yu(h+C);v(!0),x(String(_)),g(_)}function k(C){C.key==="Enter"&&(C.preventDefault(),E())}return d.jsxs("div",{className:"option-group count-picker",children:[d.jsx("div",{className:"section-title",children:m(p?"multimode.maxStages":"count.title")}),d.jsxs("div",{className:"option-row",children:[ku.map(C=>d.jsx("button",{type:"button",className:`option-btn${h===C&&!S?" active":""}`,onClick:()=>P(C),children:C},C)),d.jsx("button",{type:"button",className:`option-btn${S?" active":""}`,onClick:()=>{v(C=>!C),x(String(h))},children:m("count.customPlus")})]}),S?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"count-picker__custom",children:[d.jsx("button",{type:"button",className:"count-picker__step",onClick:()=>I(-1),"aria-label":m("count.decrease"),children:"-"}),d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"count-picker__input",value:y,onChange:C=>x(C.target.value.replace(/\D/g,"")),onBlur:()=>E(),onKeyDown:k,"aria-label":m("count.customLabel")}),d.jsx("button",{type:"button",className:"count-picker__step",onClick:()=>I(1),"aria-label":m("count.increase"),children:"+"})]}),d.jsx("p",{className:"option-help",children:h>=5?m(p?"multimode.highCountHint":"count.highCountHint"):m(p?"multimode.minMaxHint":"count.minMaxHint")})]}):null]})}const IP={low:{"1024x1024":.006,"1024x1536":.005,"1536x1024":.005,"1024x1360":.005,"1360x1024":.005,"1024x1824":.006,"1824x1024":.006,"2048x2048":.012,"2048x1152":.009,"1152x2048":.009,"3840x2160":.023,"2160x3840":.023,auto:.006},medium:{"1024x1024":.053,"1024x1536":.041,"1536x1024":.041,"1024x1360":.041,"1360x1024":.041,"1024x1824":.05,"1824x1024":.05,"2048x2048":.106,"2048x1152":.08,"1152x2048":.08,"3840x2160":.2,"2160x3840":.2,auto:.053},high:{"1024x1024":.211,"1024x1536":.165,"1536x1024":.165,"1024x1360":.165,"1360x1024":.165,"1024x1824":.2,"1824x1024":.2,"2048x2048":.422,"2048x1152":.32,"1152x2048":.32,"3840x2160":.8,"2160x3840":.8,auto:.211}},EP={512:.045,"1K":.067,"2K":.101,"4K":.151},RP={512:.134,"1K":.134,"2K":.134,"4K":.24};function NP(e){return e<=512?"512":e<=1024?"1K":e<=2048?"2K":"4K"}function kP(e,a){const i=e.match(/^(\d+)x(\d+)$/);if(!i)return .003;const o=Math.max(Number(i[1]),Number(i[2])),s=NP(o),m=a==="nano-banana-pro"?RP:EP;return m[s]??m["1K"]??.003}function _P(e,a,i,o){return i==="gemini-api"?kP(a,o):IP[e]?.[a]??0}function MP(){const{t:e}=ge(),a=w(y=>y.provider),i=w(y=>y.quality),o=w(y=>y.multimode),s=w(y=>y.multimodeMaxImages),m=w(y=>y.getResolvedSize)(),p=w(y=>y.imageModel),h=a==="oauth"||a==="grok"||a==="agy",g=_P(i,m,a,p),S=h?e("cost.free"):o?e("cost.multimodeApprox",{amount:(g*s).toFixed(3),count:s}):e("cost.approx",{amount:g.toFixed(3)}),v=h?"var(--green)":void 0;return d.jsxs("div",{className:"cost-estimate",children:[d.jsx("span",{children:e("cost.label")}),d.jsx("span",{className:"price",style:v?{color:v}:void 0,children:S})]})}function RS(){const[e,a]=R.useState(null);return R.useEffect(()=>{let i=!1,o=null;const s=async()=>{try{const c=await hT();if(i)return;a(c),c.status==="starting"&&(o=setTimeout(s,3e3))}catch{i||a(null)}};return s(),()=>{i=!0,o&&clearTimeout(o)}},[]),e}function PP(){const[e,a]=R.useState(null),[i,o]=R.useState(!1);return R.useEffect(()=>{let s=!1;return yT().then(c=>{s||a(c)}).catch(()=>{s||o(!0)}),()=>{s=!0}},[]),{data:e,error:i}}function NS(){const[e,a]=R.useState(null);return R.useEffect(()=>{let i=!1,o=null;const s=async()=>{try{const c=await fetch("/api/grok/status");if(i)return;const m=await c.json();a(m),m.status!=="ready"&&(o=setTimeout(s,1e4))}catch{i||a({status:"offline"})}};return s(),()=>{i=!0,o&&clearTimeout(o)}},[]),e}function kS(){const[e,a]=R.useState(null),[i,o]=R.useState(null),s=R.useCallback(async()=>{try{const m=await(await fetch("/api/keys/status")).json();a(m),o(null)}catch(c){o(c instanceof Error?c:new Error(String(c)))}},[]);return R.useEffect(()=>{let c=!1,m=null;return(async()=>(await s(),c||(m=setInterval(s,3e4))))(),()=>{c=!0,m&&clearInterval(m)}},[s]),{data:e,error:i,mutate:s}}function _S(){const{t:e}=ge(),a=RS(),{data:i}=PP(),o=NS(),{data:s}=kS(),c=a?.status==="ready";let m=e("provider.oauthNotReady"),p;a?.status==="auth_required"?(m=e("provider.codexLoginRequired"),p=e("provider.codexLoginHint")):a?.status==="starting"?m=e("provider.oauthStarting"):a||(m=e("provider.serverUnreachable"));const h=i?.apiKeyValid===!0,g=o?.status==="ready",S=o?o.status==="offline"?e("provider.grokOffline"):o.status==="no_image_model"?e("provider.grokNoImageModel"):o.status==="error"?e("provider.grokNotReady"):"":e("provider.grokNotReady"),v=s?.xai?.valid===!0,y=s?.gemini?.valid===!0||s?.vertex?.valid===!0,x=s?.atlascloud?.valid===!0,E=s?.minimax?.valid===!0;return{oauth:{ok:c,reason:m,hint:p},api:{ok:h,reason:h?"":e("provider.apiInvalid")},grok:{ok:g,reason:S,hint:g?void 0:e("provider.grokOfflineHint")},"grok-api":{ok:v,reason:v?"":e("provider.xaiApiKeyRequired")},agy:{ok:!0,reason:""},"gemini-api":{ok:y,reason:y?"":e("provider.geminiApiKeyRequired")},atlascloud:{ok:x,reason:x?"":e("provider.atlasCloudApiKeyRequired")},minimax:{ok:E,reason:E?"":e("provider.minimaxApiKeyRequired")}}}const LP=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function uo(e,a){const i=R.useRef(null),o=R.useRef(a);return o.current=a,R.useEffect(()=>{if(!e)return;const s=document.activeElement instanceof HTMLElement?document.activeElement:null,c=i.current,m=()=>Array.from(c?.querySelectorAll(LP)??[]).filter(h=>!h.hidden&&h.getAttribute("aria-hidden")!=="true");window.requestAnimationFrame(()=>{(c?.querySelector("[data-modal-initial-focus]")??m()[0]??c)?.focus()});const p=h=>{if(h.key==="Escape"){h.preventDefault(),o.current();return}if(h.key!=="Tab")return;const g=m();if(g.length===0){h.preventDefault(),c?.focus();return}const S=g[0],v=g[g.length-1];h.shiftKey&&document.activeElement===S?(h.preventDefault(),v.focus()):!h.shiftKey&&document.activeElement===v&&(h.preventDefault(),S.focus())};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),window.requestAnimationFrame(()=>s?.focus())}},[e]),i}function OP({open:e,providerLabel:a,reason:i,hint:o,onClose:s}){const{t:c}=ge(),m=uo(e,s);if(!e)return null;const p=c("apiDisabled.title",{provider:a});return d.jsx("div",{className:"modal-backdrop",onClick:s,role:"presentation",children:d.jsxs("div",{ref:m,className:"modal",role:"dialog","aria-modal":"true","aria-label":p,tabIndex:-1,onClick:h=>h.stopPropagation(),children:[d.jsx("div",{className:"modal__title",children:p}),d.jsxs("div",{className:"modal__body",children:[d.jsx("p",{children:i}),o?d.jsx("p",{className:"modal__hint",children:o}):null]}),d.jsx("div",{className:"modal__actions",children:d.jsx("button",{type:"button",className:"modal__btn",onClick:s,"data-modal-initial-focus":!0,children:c("common.ok")})})]})})}const os="core:",_u="mcp:",Mu=[{value:"oauth",provider:"GPT",method:"OAuth"},{value:"api",provider:"GPT",method:"API"},{value:"grok",provider:"Grok",method:"OAuth"},{value:"grok-api",provider:"Grok",method:"API"},{value:"agy",provider:"Gemini",method:"agy"},{value:"gemini-api",provider:"Gemini",method:"API"},{value:"atlascloud",provider:"Atlas Cloud",method:"API"},{value:"minimax",provider:"MiniMax",method:"API"}];function Pu(e){return e.replace(/(^|-)([a-z])/g,(a,i,o)=>`${i}${o.toUpperCase()}`)}function Lu({tone:e}){return d.jsx("span",{className:`status-dot status-dot--${e==="ok"?"ok":e==="warn"?"warn":"bad"}`,"aria-hidden":"true"})}function Yy(e){return e.enabled?e.status.state==="connected"?e.executable===!1?"warn":"ok":e.status.state==="connecting"||e.status.state==="auth_required"?"warn":"bad":"bad"}function Xy({mcpProviders:e}){const{t:a}=ge(),i=w(_=>_.provider),o=w(_=>_.mcpProvider??null),s=w(_=>_.setProvider),c=_S(),[m,p]=R.useState(null),h=_=>{const N=c[_.value];return N.ok?a("provider.statusReady"):N.reason},g=_=>_.enabled?_.status.state==="connected"?_.executable===!1?`${a("provider.statusConnected")} · ${a("mcp.locked")}`:a("provider.statusConnected"):_.status.state==="connecting"?a("mcp.connecting"):_.status.state==="auth_required"?a("provider.statusAuthRequired"):a("provider.statusDisconnected"):a("mcp.disabledProvider"),S=[{label:a("mcp.coreProviders"),items:Mu.map(_=>{const N=c[_.value];return{value:`${os}${_.value}`,searchText:`${_.provider} ${_.method}`,label:d.jsxs("span",{className:"provider-option",children:[d.jsx(Lu,{tone:N.ok?"ok":"bad"}),d.jsxs("span",{children:[_.provider," ",_.method]})]}),sub:h(_)}})}],v=e.filter(_=>_.enabled).map(_=>({value:`${_u}${_.id}`,searchText:Pu(_.id),label:d.jsxs("span",{className:"provider-option",children:[d.jsx(Lu,{tone:Yy(_)}),d.jsx("span",{children:Pu(_.id)})]}),sub:g(_)}));v.length>0&&S.push({label:"MCP",items:v});const y=o?`${_u}${o}`:`${os}${i}`,x=o?null:Mu.find(_=>_.value===i)??null,E=o?e.find(_=>_.id===o)??null:null,P=x?h(x):E?g(E):a("provider.statusDisconnected"),I=x?c[x.value].ok?"ok":"bad":E?Yy(E):"bad",k=x?x.method:"MCP",C=_=>{if(_.startsWith(os)){const $=_.slice(os.length),L=Mu.find(re=>re.value===$),J=c[$];if(!J.ok){p({label:L?`${L.provider} ${L.method}`:$,reason:J.reason,hint:J.hint});return}s($);return}const N=_.slice(_u.length),j=e.find($=>$.id===N);if(!j||!j.enabled||j.status.state!=="connected"){p({label:Pu(N),reason:!j||!j.enabled?a("mcp.disabledProvider"):a("mcp.disconnectedSelection")});return}Qs(N,w.setState,w.getState)};return d.jsxs("div",{className:"option-group provider-status-select","data-testid":"provider-status-select",children:[d.jsx("div",{className:"section-title",children:a("provider.authTitle")}),d.jsx(tr,{groups:S,value:y,onChange:C,portal:!0,ariaLabel:a("provider.authTitle"),className:"provider-status-select__select"}),d.jsxs("div",{className:"provider-status-line","data-tone":I,children:[d.jsx(Lu,{tone:I}),d.jsxs("span",{className:"provider-status-line__key",children:[a("provider.statusLineTitle"),":"]}),d.jsx("span",{className:"provider-status-line__value",children:P})]}),d.jsxs("div",{className:"provider-auth-chip",title:a("provider.authMethodTitle"),children:[d.jsx("span",{children:k}),I!=="bad"?d.jsx("span",{className:"provider-auth-chip__state",children:a("provider.authActive")}):null]}),d.jsx(OP,{open:!!m,providerLabel:m?.label??"",reason:m?.reason??"",hint:m?.hint,onClose:()=>p(null)})]})}const jP=[{value:"1:1",label:"1:1"},{value:"3:2",label:"3:2"},{value:"2:3",label:"2:3"},{value:"4:3",label:"4:3"},{value:"3:4",label:"3:4"},{value:"16:9",label:"16:9"},{value:"9:16",label:"9:16"},{value:"2:1",label:"2:1"},{value:"1:2",label:"1:2"},{value:"auto",label:"Auto"}],GP=[{value:"1k",label:"1K"},{value:"2k",label:"2K"}];function DP(){const{t:e}=ge(),a=w(c=>c.grokAspectRatio),i=w(c=>c.grokResolution),o=w(c=>c.setGrokAspectRatio),s=w(c=>c.setGrokResolution);return d.jsxs("div",{className:"option-group grok-size-picker",children:[d.jsx("div",{className:"section-title",children:e("size.grokAspectTitle")}),d.jsx("div",{className:"grok-size-picker__aspects",children:jP.map(c=>d.jsx("button",{type:"button",className:`option-btn grok-size-picker__aspect${a===c.value?" active":""}`,onClick:()=>o(c.value),children:c.label},c.value))}),d.jsx("div",{className:"section-title",style:{marginTop:8},children:e("size.grokResolutionTitle")}),d.jsx("div",{className:"grok-size-picker__resolutions",children:GP.map(c=>d.jsx("button",{type:"button",className:`option-btn grok-size-picker__res${i===c.value?" active":""}`,onClick:()=>s(c.value),children:c.label},c.value))})]})}const FP=[{value:"grok-imagine-image",label:"Grok",sub:"Fast"},{value:"grok-imagine-image-quality",label:"Grok+",sub:"Best"}];function zP(){const{t:e}=ge(),a=w(o=>o.imageModel),i=w(o=>o.setImageModel);return d.jsx(xn,{title:e("quality.grokModelTitle"),items:FP,value:a,onChange:i})}function MS({values:e,value:a,defaultValue:i,onChange:o,allowAuto:s=!1,disabled:c,ariaLabel:m}){const{t:p}=ge(),h=R.useId();if(e.length===0)return null;const g=a??i??e[0],S=e.reduce((E,P,I)=>Math.abs(P-g)<Math.abs(e[E]-g)?I:E,0),v=a===null,y=e[0],x=e[e.length-1];return d.jsxs("div",{className:`ctl-duration${v?" is-auto":""}${c?" is-disabled":""}`,children:[d.jsxs("div",{className:"ctl-duration__head",children:[d.jsx("output",{htmlFor:h,className:"ctl-duration__value",children:v?`${p("size.autoLabel")} · ${e[S]}s`:`${e[S]}s`}),s?d.jsx("button",{type:"button",className:`option-btn ctl-duration__auto${v?" active":""}`,"aria-pressed":v,disabled:c,onClick:()=>o(null),children:p("size.autoLabel")}):null]}),d.jsx("input",{id:h,type:"range",className:"ctl-duration__range",min:0,max:e.length-1,step:1,value:S,disabled:c,"aria-label":m,"aria-valuetext":`${e[S]}s`,onChange:E=>o(e[Number(E.target.value)]??e[0])}),d.jsxs("div",{className:"ctl-duration__scale","aria-hidden":"true",children:[d.jsxs("span",{children:[y,"s"]}),d.jsxs("span",{children:[x,"s"]})]})]})}const qP=[{value:"480p",label:"480p"},{value:"720p",label:"720p"},{value:"1080p",label:"1080p",sub:"1.5 HD"}],UP=["auto","1:1","16:9","9:16","4:3","3:4","3:2","2:3"].map(e=>({value:e,label:e})),Qy=[3,5,8,10,12,15],HP=[{value:dm,label:"Grok V",sub:"Fast"},{value:Ea,label:"Grok V1.5",sub:"HD"}];function BP(){const{t:e}=ge(),a=w(V=>V.videoModelSelected),i=w(V=>V.selectVideoModel),o=w(V=>V.activeVideoRefCount()),s=w(V=>V.videoDuration),c=w(V=>V.setVideoDuration),m=w(V=>V.videoResolution),p=w(V=>V.setVideoResolution),h=w(V=>V.videoAspectRatio),g=w(V=>V.setVideoAspectRatio),S=w(V=>V.videoTopic),v=w(V=>V.setVideoTopic),y=w(V=>V.showToast),x=w(V=>V.videoContinuityLineage),E=w(V=>V.selectedPresetIds),P=w(V=>V.removePreset),I=E.map(V=>zb(V)).filter(V=>V?.category==="camera-motion"),k=o>=2?Ev:15,C=Rv(o),_=Bb(x),N=vu(a,"1080p",C),j=vu(Ea,"1080p",C),$=qP.map(V=>V.value==="1080p"?{...V,disabled:!j}:V);R.useEffect(()=>{vu(a,m,C)||p("720p")},[C,m,p,a]);const L=V=>{if(V==="1080p"){if(!j)return;N||i(Ea)}p(V)},[J,re]=R.useState(null);R.useEffect(()=>{fetch("/api/config/grok-planner").then(V=>V.json()).then(re).catch(()=>{})},[]);const he=async V=>{const ee=J?.model;re(oe=>oe?{...oe,model:V}:null);try{const oe=await fetch("/api/config/grok-planner",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:V})});if(!oe.ok)throw new Error(`HTTP ${oe.status}`)}catch{re(oe=>oe&&ee?{...oe,model:ee}:oe),y(e("video.plannerUpdateFailed"),!0)}};return d.jsxs("div",{className:"right-panel-settings video-controls",children:[d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("quality.grokModelTitle")??"Model"}),d.jsx("div",{className:"option-row",children:HP.map(V=>d.jsxs("button",{type:"button",className:`option-btn${a===V.value?" active":""}`,onClick:()=>i(V.value),children:[V.label,d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:V.sub})]},V.value))})]}),d.jsxs("div",{className:"provider-compat-note",role:"note",children:[d.jsx("strong",{children:e("video.modeLabel")}),d.jsx("span",{children:e(`video.mode.${C}`,{n:o})})]}),_?d.jsxs("div",{className:"provider-compat-note",role:"note",children:[d.jsx("strong",{children:e("common.continuity")}),d.jsx("span",{children:_})]}):null,I.length>0&&d.jsx(zm,{ariaLabel:e("video.selectedCameraPresets"),children:I.map(V=>d.jsx(yS,{onRemove:()=>P(V.id),removeLabel:e("common.removeNamed",{name:V.name}),children:V.name},V.id))}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("video.seriesTopicTitle")??"시리즈 주제"}),d.jsx("input",{type:"text",className:"video-topic-input",placeholder:e("video.seriesTopicPlaceholder")??"예: 한국 여행 브이로그",value:S,onChange:V=>v(V.target.value)})]}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("video.durationTitle")}),d.jsx(MS,{values:Qy.filter(V=>V<=k),value:s,ariaLabel:e("video.durationTitle"),onChange:V=>c(V??Qy[0])})]}),d.jsx(xn,{title:e("video.resolutionTitle"),help:j?void 0:e("video.resolution1080Help"),items:$,value:m,onChange:L}),d.jsx(xn,{title:e("video.aspectTitle"),items:UP,value:h,onChange:g}),J&&d.jsx("div",{className:"video-controls__pills",children:d.jsx(tr,{className:"video-controls__pill",items:J.options.map(V=>({value:V,label:V})),value:J.model,onChange:V=>{he(V)},ariaLabel:e("video.plannerModelTitle")})}),d.jsxs("details",{className:"provider-compat-details",style:{marginTop:8},children:[d.jsx("summary",{children:e("common.activePrompt")}),d.jsx("p",{children:Ts})]})]})}const VP="",PS=3;function Jy(e,a,i,o){const s=[],c=new Set;for(const m of[a,...e])!m?.filename||c.has(m.filename)||gt(m)!==o||o&&!/\.(?:mp4|mov)$/i.test(m.filename)||(c.add(m.filename),s.push({filename:m.filename,current:m===a}));for(const m of i){const p=m.filePath,h=o?m.kind==="video":m.kind==="image"||m.kind==="element",g=o?/\.(?:mp4|mov)$/i.test(p??""):/\.(?:png|jpe?g|webp)$/i.test(p??"");!p||!h||!g||c.has(p)||(c.add(p),s.push({filename:p,current:!1,label:m.name||p,source:m.kind==="element"?"element":"asset"}))}return s}function KP(e,a){return e[a]??null}function LS(e,a,i){const o=!a||e.some(s=>s.filename===a);return[{value:VP,label:i("mcp.referenceNone")},...o?[]:[{value:a,label:a,sub:i("mcp.referenceMissing")}],...e.map(s=>({value:s.filename,label:s.label??s.filename,sub:s.current?i("mcp.referenceCurrent"):s.source?i(`mcp.referenceSource.${s.source}`):void 0}))]}function Ou({id:e,label:a,value:i,candidates:o,disabled:s,title:c,help:m,onChange:p,t:h}){return d.jsxs("div",{className:"mcp-reference-slot",children:[d.jsx("label",{className:"mcp-reference-slot__label",htmlFor:e,children:a}),d.jsx(tr,{id:e,items:LS(o,i??"",h),value:i??"",onChange:p,ariaLabel:a,placeholder:h("mcp.referenceSelect"),disabled:s,title:c,portal:!0}),m?d.jsx("p",{className:"option-help",children:m}):null]})}function $P({index:e,images:a,selection:i,disabled:o,onChange:s,t:c}){const m=KP(i.references,e),p=new Set(i.references.filter((E,P)=>P!==e).map(E=>E.filename)),h=m?.dataUrl?{filename:m.filename,current:!1,label:m.displayName??c("mcp.referenceLocalFallback"),source:"local"}:null,g=[...h?[h]:[],...a.filter(E=>!p.has(E.filename))],S=E=>{const P=[...i.references];E?P[e]={filename:E,...m?.tag?{tag:m.tag}:{}}:P.splice(e,1),s({...i,references:P})},v=E=>{if(!m)return;const P=[...i.references],{tag:I,...k}=m;P[e]={...k,...E?{tag:E}:{}},s({...i,references:P})},y=!!(m?.tag&&!fm(m.tag)),x=`mcp-reference-tag-error-${e}`;return d.jsxs("div",{className:"mcp-reference-slot__reference",children:[d.jsx(tr,{items:LS(g,m?.filename??"",c),value:m?.filename??"",onChange:S,ariaLabel:c("mcp.imageReferenceAria",{index:e+1}),placeholder:c("mcp.referenceSelect"),disabled:o,portal:!0}),d.jsxs("div",{children:[d.jsx("input",{type:"text",value:m?.tag??"",onChange:E=>v(E.target.value),"aria-label":c("mcp.referenceTagAria",{index:e+1}),placeholder:c("mcp.referenceTagPlaceholder"),"aria-invalid":y,"aria-describedby":y?x:void 0,maxLength:32,disabled:o||!m}),y?d.jsx("p",{id:x,className:"settings-row__microcopy",role:"alert",children:c("mcp.referenceTagInvalid")}):null]})]})}function YP({selection:e,disabled:a,onChange:i,t:o}){const s=R.useRef(null),[c,m]=R.useState(null),p=e.references.length>=PS,h=async g=>{const S=g.target.files?.[0];if(g.target.value="",!!S){if(!/^image\/(?:png|jpeg|webp)$/i.test(S.type)){m(o("mcp.referenceLocalInvalidType"));return}try{const v=await Tm(S),y=`local:${globalThis.crypto.randomUUID()}`;i({...e,references:[...e.references,{filename:y,displayName:S.name,dataUrl:v}]}),m(null)}catch{m(o("mcp.referenceLocalReadFailed"))}}};return d.jsxs("div",{children:[d.jsx("input",{ref:s,className:"sr-only",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:g=>{h(g)},disabled:a||p}),d.jsx("button",{type:"button",className:"option-btn",onClick:()=>s.current?.click(),disabled:a||p,children:o("mcp.referenceAttachLocal")}),d.jsx("p",{className:"option-help",children:o("mcp.referenceAttachHelp")}),c?d.jsx("p",{className:"settings-row__microcopy",role:"alert",children:c}):null]})}function XP({images:e,selection:a,disabled:i,onChange:o,t:s}){return d.jsxs("div",{className:"mcp-reference-slot",children:[d.jsx("div",{className:"mcp-reference-slot__label",children:s("mcp.imageReferencesLabel")}),Array.from({length:PS},(c,m)=>d.jsx($P,{index:m,images:e,selection:a,disabled:i,onChange:o,t:s},m)),d.jsx(YP,{selection:a,disabled:i,onChange:o,t:s})]})}function QP({inputRoles:e,disabled:a}){const{t:i}=ge(),o=w(v=>v.history),s=w(v=>v.currentImage),c=w(v=>v.assets),m=w(v=>v.mcpReferenceSelection)??Tn(),p=R.useMemo(()=>Jy(o,s,c,!1),[o,s,c]),h=R.useMemo(()=>Jy(o,s,c,!0),[o,s,c]),g=v=>qk(v,w.setState,w.getState),S=m.startFrameFilename?void 0:i("mcp.endFrameNeedsStart");return d.jsxs("div",{className:"mcp-reference-slots",children:[e.includes("start_image")?d.jsx(Ou,{id:"mcp-start-frame",label:i("mcp.startFrameLabel"),value:m.startFrameFilename,candidates:p,disabled:a,t:i,onChange:v=>g({...m,startFrameFilename:v||null,...v?{}:{endFrameFilename:null}})}):null,e.includes("end_image")?d.jsx(Ou,{id:"mcp-end-frame",label:i("mcp.endFrameLabel"),value:m.endFrameFilename,candidates:p,disabled:a||!m.startFrameFilename,title:S,help:S,t:i,onChange:v=>g({...m,endFrameFilename:v||null})}):null,e.includes("image_references")?d.jsx(XP,{images:p,selection:m,disabled:a,onChange:g,t:i}):null,e.includes("video_references")?d.jsx(Ou,{id:"mcp-video-reference",label:i("mcp.videoReferenceLabel"),value:m.referenceVideoFilename,candidates:h,disabled:a,t:i,help:i("mcp.videoReferenceCostNote"),onChange:v=>g({...m,referenceVideoFilename:v||null})}):null]})}function JP(e){return Array.isArray(e)&&e.includes("image_references")}function WP(e){return e.mentionElementIds.length>0&&e.characterElementId?"conflict":"ok"}function Mj(e,a){return a.mode!=="trained-id"||!Array.isArray(a.trainedFromRefs)?!1:a.trainedFromRefs.length!==e.length?!0:a.trainedFromRefs.some((i,o)=>e[o]!==i)}function Pj(e){return e.length>3}function ZP({inputRoles:e,disabled:a}){const{t:i}=ge(),o=w(g=>g.assets),s=w(g=>g.mcpCharacterElementId??null),c=w(g=>g.selectedElementIds??[]);if(!JP(e))return null;const m=o.filter(g=>g.kind==="element"&&g.metadata?.elementKind==="character"),p=WP({mentionElementIds:c,characterElementId:s})==="conflict",h=!!a||c.length>0;return d.jsxs("div",{className:"mcp-character-slot","data-testid":"mcp-character-slot",children:[d.jsx("div",{className:"section-title",children:i("mcp.characterSlotLabel")}),d.jsxs("select",{value:s??"",disabled:h,"aria-label":i("mcp.characterSlotLabel"),title:c.length>0?i("mcp.characterSlotConflictHint"):void 0,onChange:g=>w.setState({mcpCharacterElementId:g.target.value||null}),children:[d.jsx("option",{value:"",children:i("mcp.characterSlotNone")}),m.map(g=>d.jsx("option",{value:g.id,children:g.name},g.id))]}),p?d.jsx("p",{className:"option-help",role:"alert",children:i("mcp.characterSlotConflictHint")}):null]})}const Wy=new Set(["duration","resolution","quality","mode"]);function Zy(e){return e.filter((a,i)=>e.findIndex(o=>o===a)===i)}function Vm(e){return e.options&&e.options.length>0?Zy(e.options):e.type==="boolean"?[!0,!1]:e.type!=="number"||e.min===void 0||e.max===void 0?[]:Number.isInteger(e.min)&&Number.isInteger(e.max)&&e.max-e.min<=20?Array.from({length:e.max-e.min+1},(a,i)=>e.min+i):Zy([e.min,...e.default!==void 0?[e.default]:[],e.max])}function ev(e,a){return{duration:a("mcp.durationLabel"),resolution:a("mcp.resolutionLabel"),quality:a("mcp.qualityLabel"),mode:a("mcp.modeLabel"),generateAudio:a("mcp.audioLabel"),generate_audio:a("mcp.audioLabel"),sound:a("mcp.audioLabel")}[e]??e.replace(/_/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function eL(e,a){return typeof e=="boolean"?a(e?"mcp.onLabel":"mcp.offLabel"):String(e)}function tL(e){return[...Vm(e).filter(i=>typeof i=="number")].sort((i,o)=>i-o)}function nL({parameter:e,value:a,disabled:i,onChange:o}){const{t:s}=ge();if(e.name==="duration"&&e.type==="number"){const p=tL(e);if(p.length>1){const h=ev(e.name,s);return d.jsxs("div",{className:"mcp-preset-row",children:[d.jsx("div",{className:"section-title",children:h}),d.jsx(MS,{values:p,value:typeof a=="number"?a:null,defaultValue:typeof e.default=="number"?e.default:void 0,allowAuto:!e.required,disabled:i,ariaLabel:h,onChange:o})]})}}const c=Vm(e);if(c.length===0)return null;const m=ev(e.name,s);return d.jsxs("div",{className:"mcp-preset-row",children:[d.jsx("div",{className:"section-title",children:m}),d.jsxs("div",{className:"mcp-preset-row__options",role:"group","aria-label":m,children:[e.required?null:d.jsx("button",{type:"button",className:`option-btn${a===void 0?" active":""}`,"aria-pressed":a===void 0,disabled:i,onClick:()=>o(null),children:s("size.autoLabel")}),c.map(p=>d.jsx("button",{type:"button",className:`option-btn${a===p?" active":""}`,"aria-pressed":a===p,disabled:i,onClick:()=>o(p),title:e.description,children:eL(p,s)},`${typeof p}:${String(p)}`))]})]})}function tv({entries:e,parameters:a,disabled:i,onParameter:o}){return d.jsx(d.Fragment,{children:e.map(s=>d.jsx(nL,{parameter:s,value:a[s.name],disabled:i,onChange:c=>o(s.name,c)},s.name))})}function aL({entry:e,ratio:a,parameters:i,disabled:o,onRatio:s,onParameter:c}){const{t:m}=ge(),p=e.capabilities.aspectRatios.filter(y=>y!=="auto"),h=e.capabilities.parameters.filter(y=>Vm(y).length>0),g=h.filter(y=>Wy.has(y.name)),S=h.filter(y=>!Wy.has(y.name)),v=e.capabilities.inputRoles.some(y=>y==="start_image"||y==="end_image"||y==="image_references"||y==="video_references");return d.jsxs("div",{className:"mcp-model-presets","data-capability-source":e.capabilities.source,children:[p.length>0?d.jsxs("div",{className:"mcp-preset-row",children:[d.jsx("div",{className:"section-title",children:m("mcp.aspectRatioLabel")}),d.jsxs("div",{className:"mcp-preset-row__options",role:"group","aria-label":m("mcp.aspectRatioLabel"),children:[d.jsx("button",{type:"button",className:`option-btn${a===null?" active":""}`,"aria-pressed":a===null,disabled:o,onClick:()=>s(null),children:m("size.autoLabel")}),p.map(y=>d.jsx("button",{type:"button",className:`option-btn${a===y?" active":""}`,"aria-pressed":a===y,disabled:o,onClick:()=>s(y),children:y},y))]})]}):null,d.jsx(tv,{entries:g,parameters:i,disabled:o,onParameter:c}),v?d.jsxs("div",{className:"mcp-tool-inputs",children:[d.jsx("div",{className:"section-title",children:m("mcp.toolInputsLabel")}),d.jsx(QP,{inputRoles:e.capabilities.inputRoles,disabled:o}),d.jsx(ZP,{inputRoles:e.capabilities.inputRoles,disabled:o})]}):null,S.length>0?d.jsxs("details",{className:"mcp-advanced-presets",children:[d.jsx("summary",{children:m("mcp.advancedPresetsLabel")}),d.jsx(tv,{entries:S,parameters:i,disabled:o,onParameter:c})]}):null,p.length===0&&h.length===0?d.jsx("p",{className:"option-help",children:m("mcp.providerDefaultsHelp")}):null]})}const rs={image:[],video:[]},oL={};function rL(e){return e.replace(/(^|-)([a-z])/g,(a,i,o)=>`${i}${o.toUpperCase()}`)}function iL({record:e}){const{t:a}=ge(),i=w(_=>_.mcpProvider??null),o=w(_=>_.mcpModel??null),s=w(_=>_.mcpMediaKind??"image"),c=w(_=>_.mcpRatio??null),p=w(_=>_.mcpParameters)??oL,[h,g]=R.useState(rs),[S,v]=R.useState("idle"),[y,x]=R.useState(0),E=e?.executable===!1,P=e?.status.state==="connected";if(R.useEffect(()=>{if(!i||!P){g(rs),v("idle");return}const _=new AbortController;return g(rs),v("loading"),sS(i,_.signal).then(N=>{_.signal.aborted||(g(N),v("ready"))}).catch(N=>{N.name!=="AbortError"&&(_.signal.aborted||(g(rs),v("error")))}),()=>_.abort()},[i,P,y]),!i)return null;const I=s==="video"?h.video:h.image,k=I.find(_=>_.id===o)??null,C=_=>Dk(_,w.setState,w.getState);return d.jsxs("div",{className:"mcp-generation-controls","data-testid":"mcp-generation-controls",children:[d.jsxs("div",{className:"option-group",children:[d.jsxs("div",{className:"section-title mcp-generation-controls__header",children:[d.jsxs("span",{children:[rL(i)," · MCP"]}),d.jsx("button",{type:"button",className:"mcp-generation-controls__exit",onClick:()=>Qs(null,w.setState,w.getState),children:a("mcp.exitLane")})]}),P?null:d.jsx("p",{className:"option-help",children:a("mcp.disconnectedSelection")}),E?d.jsx("p",{className:"option-help",children:a("mcp.higgsfieldLocked")}):null]}),d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"option-group",children:d.jsxs("div",{className:"option-row",children:[d.jsx("button",{type:"button",className:`option-btn${s==="image"?" active":""}`,"aria-pressed":s==="image",onClick:()=>C("image"),children:a("grokMode.image")}),d.jsx("button",{type:"button",className:`option-btn${s==="video"?" active":""}`,"aria-pressed":s==="video",onClick:()=>C("video"),children:a("grokMode.video")})]})}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:a("mcp.modelSectionTitle")}),S==="loading"?d.jsx("p",{className:"option-help",role:"status",children:a("mcp.loadingModels")}):S==="error"?d.jsxs("div",{className:"mcp-catalog-state",role:"alert",children:[d.jsx("span",{children:a("mcp.modelsLoadFailed")}),d.jsx("button",{type:"button",className:"settings-action-btn",onClick:()=>x(_=>_+1),children:a("mcp.retryModels")})]}):S==="ready"&&I.length===0?d.jsx("p",{className:"option-help",children:a("mcp.noModels")}):k?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mcp-selected-model",children:[d.jsx("strong",{children:k.label}),k.description?d.jsx("span",{children:k.description}):null]}),d.jsx(aL,{entry:k,ratio:c,parameters:p,disabled:E,onRatio:_=>Fk(_,w.setState),onParameter:(_,N)=>zk(_,N,w.setState,w.getState)})]}):d.jsx("p",{className:"option-help",children:a(o?"mcp.providerDefaultsHelp":"mcp.chooseModelForPresets")})]})]})]})}const lL=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],is=[{value:"1:1",label:"1:1"},{value:"2:3",label:"2:3"},{value:"3:2",label:"3:2"},{value:"3:4",label:"3:4"},{value:"4:3",label:"4:3"},{value:"4:5",label:"4:5"},{value:"5:4",label:"5:4"},{value:"9:16",label:"9:16"},{value:"16:9",label:"16:9"},{value:"21:9",label:"21:9"}],sL=[{value:"512",label:"512px"},{value:"1K",label:"1K"},{value:"2K",label:"2K"},{value:"4K",label:"4K"}],Is={"1:1":{512:"512x512","1K":"1024x1024","2K":"2048x2048","4K":"4096x4096"},"2:3":{512:"424x632","1K":"848x1264","2K":"1696x2528","4K":"3392x5056"},"3:2":{512:"632x424","1K":"1264x848","2K":"2528x1696","4K":"5056x3392"},"3:4":{512:"448x600","1K":"896x1200","2K":"1792x2400","4K":"3584x4800"},"4:3":{512:"600x448","1K":"1200x896","2K":"2400x1792","4K":"4800x3584"},"4:5":{512:"464x576","1K":"928x1152","2K":"1856x2304","4K":"3712x4608"},"5:4":{512:"576x464","1K":"1152x928","2K":"2304x1856","4K":"4608x3712"},"9:16":{512:"384x688","1K":"768x1376","2K":"1536x2752","4K":"3072x5504"},"16:9":{512:"688x384","1K":"1376x768","2K":"2752x1536","4K":"5504x3072"},"21:9":{512:"792x168","1K":"1584x672","2K":"3168x1344","4K":"6336x2688"}};function cL(e){for(const[a,i]of Object.entries(Is))for(const[o,s]of Object.entries(i))if(s===e)return{ratio:a,res:o};return null}function dL(e,a){const i=e/a;let o="1:1",s=1/0;const c=[...Object.keys(Is),"1:8","8:1","1:4","4:1"];for(const h of c){const[g,S]=h.split(":").map(Number),v=Math.abs(i-g/S);v<s&&(s=v,o=h)}const m=Math.max(e,a),p=m<=512?"512":m<=1024?"1K":m<=2048?"2K":"4K";return{ratio:o,res:p}}function OS(){const{t:e}=ge(),a=w(ie=>ie.provider),i=w(ie=>ie.quality),o=w(ie=>ie.setQuality),s=w(ie=>ie.format),c=w(ie=>ie.setFormat),m=w(ie=>ie.moderation),p=w(ie=>ie.setModeration),h=w(ie=>ie.multimode),g=w(ie=>ie.setMultimode),S=w(ie=>ie.imageModel),v=w(ie=>ie.setImageModel),y=w(ie=>ie.selectVideoModel),x=w(ie=>ie.sizePreset),E=w(ie=>ie.customW),P=w(ie=>ie.customH),I=w(ie=>ie.setSizePreset),k=w(ie=>ie.setCustomSize),C=w(ie=>ie.uiMode),_=w(ie=>ie.videoModelSelected),N=w(ie=>ie.mcpProvider??null),{providers:j}=cS(),$=C==="classic",L=a==="grok"||a==="grok-api",J=a==="agy",re=a==="gemini-api",he=J||re,V=L||he,ee=x==="custom"?`${E}x${P}`:"1024x1024",oe=re&&x==="auto",Ne=re&&!oe?cL(ee):null,ne=Ne??{ratio:"",res:""},H=re&&!oe&&x==="custom"&&!Ne,ae=S==="nano-banana-pro"?"nano-banana-pro":"nano-banana-2",[ce,be]=R.useState(!1),[Se,T]=R.useState(String(E)),[F,W]=R.useState(String(P)),U=(ie,lt)=>{const at=Is[ie||"1:1"]?.[lt||"1K"]||"1024x1024",[st,bt]=at.split("x").map(Number);be(!1),I("custom"),k(st,bt)},le=()=>{const ie=Number(Se),lt=Number(F);!Number.isFinite(ie)||!Number.isFinite(lt)||ie<=0||lt<=0||(I("custom"),k(ie,lt),be(!1))},pe=[{value:"low",label:e("quality.lowLabel"),sub:e("quality.lowSub")},{value:"medium",label:e("quality.mediumLabel"),sub:e("quality.mediumSub")},{value:"high",label:e("quality.highLabel"),sub:e("quality.highSub")}],xe=[{value:"auto",label:e("moderation.autoLabel"),sub:e("moderation.autoSub")},{value:"low",label:e("moderation.lowLabel"),sub:e("moderation.lowSub"),color:"var(--amber)"}],Oe=[{value:"nano-banana-2",label:"Nano",sub:"Banana 2"},{value:"nano-banana-pro",label:"Nano",sub:"Banana Pro"}],Re=L?{title:e("provider.grokCompatTitle"),body:e("provider.grokCompatBody")}:J?{title:e("provider.agyCompatTitle"),body:e("provider.agyCompatBody")}:re?{title:e("provider.geminiApiCompatTitle"),body:e("provider.geminiApiCompatBody")}:{title:e("provider.gptCompatTitle"),body:e("provider.gptCompatBody")},Ze=ie=>{ie==="video"?y("grok-imagine-video"):v(S)};return N?d.jsxs("div",{className:"right-panel-settings",role:"tabpanel",children:[d.jsx(Xy,{mcpProviders:j}),d.jsx(iL,{record:j.find(ie=>ie.id===N)??null})]}):d.jsxs("div",{className:"right-panel-settings",role:"tabpanel",children:[d.jsx(Xy,{mcpProviders:j}),d.jsxs("details",{className:"provider-compat-details",children:[d.jsx("summary",{children:Re.title}),d.jsx("p",{children:Re.body})]}),L&&d.jsx("div",{className:"option-group grok-mode-toggle",children:d.jsxs("div",{className:"option-row",children:[d.jsx("button",{type:"button",className:`option-btn${_?"":" active"}`,onClick:()=>Ze("image"),children:e("grokMode.image")}),d.jsx("button",{type:"button",className:`option-btn${_?" active":""}`,onClick:()=>Ze("video"),children:e("grokMode.video")})]})}),_?d.jsx(BP,{}):d.jsxs(d.Fragment,{children:[J?null:L?d.jsxs(d.Fragment,{children:[d.jsx(zP,{}),d.jsx(DP,{})]}):re?d.jsxs(d.Fragment,{children:[d.jsx(xn,{title:e("quality.grokModelTitle"),items:Oe,value:ae,onChange:v}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("size.grokAspectTitle")||"Aspect Ratio"}),[is.slice(0,3),is.slice(3,6),is.slice(6,8),is.slice(8)].map((ie,lt)=>d.jsx("div",{className:"option-row",children:ie.map(at=>d.jsx("button",{type:"button",className:`option-btn${ne.ratio===at.value?" active":""}`,onClick:()=>U(at.value,ne.res),children:at.label},at.value))},lt))]}),d.jsxs("div",{className:"option-group",children:[d.jsx("div",{className:"section-title",children:e("size.grokResolutionTitle")||"Resolution"}),d.jsx("div",{className:"gemini-resolution-grid",children:sL.map(ie=>d.jsxs("button",{type:"button",className:`option-btn${ne.res===ie.value?" active":""}`,onClick:()=>U(ne.ratio,ie.value),children:[d.jsx("span",{children:ie.label}),d.jsx("br",{}),d.jsx("small",{children:Is[ne.ratio]?.[ie.value]?.replace("x","×")||""})]},ie.value))})]}),d.jsxs("div",{className:"option-group",children:[d.jsxs("div",{className:"option-row",children:[d.jsxs("button",{type:"button",className:`option-btn${oe?" active":""}`,onClick:()=>{be(!1),I("auto")},children:[e("size.autoLabel"),d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:e("size.autoSub")})]}),d.jsxs("button",{type:"button",className:`option-btn${H||ce?" active":""}`,onClick:()=>be(ie=>!ie),children:[e("size.customPlus"),d.jsx("br",{}),d.jsx("span",{className:"option-sub",children:e("size.customSub")})]})]}),ce?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"option-row size-picker__custom-row",children:[d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:Se,onChange:ie=>T(ie.target.value.replace(/\D/g,"")),placeholder:e("size.width")}),d.jsx("span",{className:"size-picker__dimension-separator","aria-hidden":"true",children:"×"}),d.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:F,onChange:ie=>W(ie.target.value.replace(/\D/g,"")),placeholder:e("size.height")})]}),Number(Se)>0&&Number(F)>0?d.jsxs("div",{className:"size-picker__preview",children:[d.jsx("span",{children:e("size.normalizedPreview")}),d.jsx("strong",{children:(()=>{const ie=dL(Number(Se),Number(F));return`${ie.ratio} · ${ie.res}`})()})]}):null,d.jsx("button",{type:"button",className:"size-picker__save",onClick:le,children:e("settings.apiKeys.save")})]}):null]})]}):d.jsxs(d.Fragment,{children:[d.jsx(xn,{title:e("quality.title"),items:pe,value:i,onChange:o}),d.jsx(CP,{})]}),V?null:d.jsxs(d.Fragment,{children:[d.jsx(xn,{title:e("format.title"),items:lL,value:s,onChange:c}),d.jsx(xn,{title:e("moderation.title"),items:xe,value:m,onChange:p}),d.jsx("p",{className:"option-help",children:e("moderation.explain")})]}),$&&!he&&d.jsx("div",{className:"option-group multimode-toggle",children:d.jsxs("button",{type:"button",className:`multimode-toggle__button${h?" active":""}`,"aria-pressed":h,title:e("multimode.tooltip"),onClick:()=>g(!h),children:[d.jsx("span",{children:e("multimode.label")}),d.jsx("span",{children:e("multimode.shortHint")})]})}),he?null:d.jsx(wP,{}),d.jsx(MP,{})]})]})}const uL=R.lazy(()=>$t(()=>import("./PromptLibraryPanel-DCtxfzy1.js"),[]).then(e=>({default:e.PromptLibraryPanel}))),mL=R.lazy(()=>$t(()=>import("./PromptBuilderPanel-Bl5-fDQs.js"),[]).then(e=>({default:e.PromptBuilderPanel}))),pL=R.lazy(()=>$t(()=>import("./GenerationRequestLogPanel-BZZJh4w_.js"),[]).then(e=>({default:e.GenerationRequestLogPanel})));function fL(){const e=w(k=>k.rightPanelOpen),a=w(k=>k.toggleRightPanel),i=w(k=>k.promptLibraryOpen),o=w(k=>k.setPromptLibraryOpen),s=w(k=>k.promptBuilderOpen),c=w(k=>k.togglePromptBuilder),m=w(k=>k.workspaceProfile),{t:p}=ge(),[h,g]=R.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);R.useEffect(()=>{if(typeof window>"u")return;const k=window.matchMedia("(max-width: 800px)"),C=()=>g(k.matches);return k.addEventListener("change",C),()=>k.removeEventListener("change",C)},[]);const[S,v]=R.useState(!1),y=BN(m)&&!h,x=h?e:!0,E=uo(h&&e,a),P=S?"log":s&&y?"builder":i?"library":"settings",I=k=>{v(k==="log"),k==="builder"?(s||c(),i&&o(!1)):k==="library"?(s&&c(),i||o(!0)):(s&&c(),i&&o(!1))};return d.jsxs(d.Fragment,{children:[h&&e?d.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":p("panel.closeSettings"),onClick:a}):null,d.jsxs("aside",{ref:E,className:`right-panel${e?"":" collapsed"}${h&&x?" drawer-open":""}`,"aria-label":p("panel.detailSettings"),"aria-modal":h&&e?"true":void 0,role:h&&e?"dialog":void 0,tabIndex:h?-1:void 0,children:[!h&&d.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":e,"aria-controls":"right-panel-body",onClick:a,title:p(e?"panel.toggleHide":"panel.toggleShow"),children:e?">":"<"}),d.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!e,children:[d.jsxs("div",{className:"right-panel-tabs",role:"tablist","aria-label":p("panel.detailSettings"),children:[y?d.jsx("button",{type:"button",role:"tab","aria-selected":P==="builder","aria-controls":"right-panel-tab-builder",title:p("promptBuilder.title"),className:`right-panel-tabs__button${P==="builder"?" active":""}`,onClick:()=>I("builder"),children:p("promptBuilder.title")}):null,d.jsx("button",{type:"button",role:"tab","aria-selected":P==="log","aria-controls":"right-panel-tab-log",title:p("generationLog.title"),className:`right-panel-tabs__button${y?"":" right-panel-tabs__button--full"}${P==="log"?" active":""}`,onClick:()=>I("log"),children:p("generationLog.title")}),d.jsx("button",{type:"button",role:"tab","aria-selected":P==="library","aria-controls":"right-panel-tab-library",title:p("promptLibrary.title"),className:`right-panel-tabs__button right-panel-tabs__button--full${P==="library"?" active":""}`,onClick:()=>I("library"),children:p("promptLibrary.title")}),d.jsx("button",{type:"button",role:"tab","aria-selected":P==="settings","aria-controls":"right-panel-tab-settings",title:p("panel.detailSettings"),className:`right-panel-tabs__button right-panel-tabs__button--full${P==="settings"?" active":""}`,onClick:()=>I("settings"),children:p("panel.detailSettings")})]}),P==="builder"&&y?d.jsx("div",{id:"right-panel-tab-builder",role:"tabpanel",children:d.jsx(R.Suspense,{fallback:d.jsx("div",{className:"prompt-library-panel__loading",children:p("common.loading")}),children:d.jsx(mL,{variant:"sidebar"})})}):P==="library"?d.jsx("div",{id:"right-panel-tab-library",role:"tabpanel",children:d.jsx(R.Suspense,{fallback:d.jsx("div",{className:"prompt-library-panel__loading",children:p("common.loading")}),children:d.jsx(uL,{variant:"embedded"})})}):P==="log"?d.jsx("div",{id:"right-panel-tab-log",role:"tabpanel",children:d.jsx(R.Suspense,{fallback:d.jsx("div",{className:"prompt-library-panel__loading",children:p("common.loading")}),children:d.jsx(pL,{})})}):d.jsx("div",{id:"right-panel-tab-settings",role:"tabpanel",children:d.jsx(OS,{})})]})]})]})}function gL(e){const a=e.currentTarget;if(a.scrollWidth<=a.clientWidth||!(Math.abs(e.deltaY)>Math.abs(e.deltaX)))return;const o=a.scrollLeft<=0,s=a.scrollLeft+a.clientWidth>=a.scrollWidth-1,c=e.deltaY<0,m=e.deltaY>0;c&&o||m&&s||(e.preventDefault(),a.scrollLeft+=e.deltaY)}function hL({id:e}){const{t:a}=ge();return d.jsx("div",{className:"history-thumb history-thumb--skeleton","aria-label":a("common.generating")},e)}function yL({id:e,count:a}){const{t:i}=ge(),o=Math.min(a,4);return d.jsx("div",{className:"history-thumb history-thumb--collection-skeleton","aria-label":i("history.generatingCollection",{count:a}),children:Array.from({length:o},(s,c)=>d.jsx("div",{className:"collection-mini collection-mini--skeleton"},c))},`coll-${e}`)}function vL({sequenceId:e,images:a}){const i=w(p=>p.showHistorySequence),s=w(p=>p.multimodePreviewFlightId)===`history:${e}`,c=a.slice(0,4),{t:m}=ge();return d.jsx("button",{type:"button",className:`history-thumb history-thumb--collection${s?" active":""}`,onClick:()=>i(e),"aria-label":m("common.imageCollection",{n:a.length}),children:c.map((p,h)=>!p.thumb&&(kn(p.url)||kn(p.image))?d.jsx(nr,{className:"collection-mini"},h):d.jsx("img",{className:"collection-mini",src:p.thumb||p.url||p.image,alt:"",loading:"lazy",decoding:"async"},h))})}function bL(e){const a=R.useRef(null),i=R.useRef(new Map),[o,s]=R.useState(()=>new Set);R.useEffect(()=>{if(!e||typeof IntersectionObserver>"u")return;const m=new IntersectionObserver(p=>{const h=p.filter(g=>g.isIntersecting);h.length!==0&&s(g=>{const S=new Set(g);for(const v of h){const y=v.target.dataset.historyLazyKey;y&&S.add(y)}return S})},{root:e,rootMargin:"0px 200% 0px 200%"});a.current=m;for(const p of i.current.values())m.observe(p);return()=>{m.disconnect(),a.current=null}},[e]);const c=R.useCallback((m,p)=>{const h=i.current.get(m);h&&h!==p&&a.current?.unobserve(h),p?(i.current.set(m,p),a.current?.observe(p)):i.current.delete(m)},[]);return{visibleKeys:o,register:c,supported:typeof IntersectionObserver<"u"}}function SL(){const e=w(C=>C.history),a=w(C=>C.currentImage),i=w(C=>C.historyStripLayout),o=w(C=>C.selectHistory),s=w(C=>C.openGallery),c=w(C=>C.inFlight),m=w(C=>C.multimodeSequences),p=R.useRef({}),[h,g]=R.useState(null),S=bL(h),{t:v}=ge(),y=a?Ot(a):null,x=R.useMemo(()=>hs(e.filter(mi)),[e]),E=R.useMemo(()=>{const C=[];for(const _ of c){const N=m[_.id];if(_.kind==="multimode"&&N){C.push({type:"collection-skeleton",id:_.id,count:N.requested});for(let j=0;j<N.requested;j++)N.images[j]||C.push({type:"skeleton",id:`${_.id}_${j}`,count:1})}else C.push({type:"skeleton",id:_.id,count:1})}return C},[c,m]),{completedSequences:P,sequenceFirstKeys:I}=R.useMemo(()=>{const C=new Map,_=new Set;for(const N of x)if(N.sequenceId&&(N.sequenceTotalRequested??0)>1){C.has(N.sequenceId)||_.add(Ot(N));const j=C.get(N.sequenceId)||[];j.push(N),C.set(N.sequenceId,j)}return{completedSequences:C,sequenceFirstKeys:_}},[x]);R.useEffect(()=>{y&&p.current[y]?.scrollIntoView({block:"nearest",inline:"nearest"})},[y,x]);const k=(C,_)=>{const N=S.supported?S.visibleKeys.has(C):!0;return d.jsx("div",{ref:j=>{p.current[C]=j,S.register(C,j)},className:"history-thumb","data-history-lazy-key":C,"aria-hidden":N?void 0:!0,style:{padding:0,overflow:"hidden"},children:N?_:null},C)};return d.jsxs("div",{ref:g,className:`history-strip${i==="horizontal"?" history-strip--horizontal":""}${i==="sidebar"?" history-strip--sidebar":""}`,onWheel:gL,"data-layout":i,children:[d.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:s,"aria-label":v("history.openGalleryAria"),title:v("history.openGalleryTitle"),children:d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),E.map(C=>C.type==="collection-skeleton"?d.jsx(yL,{id:C.id,count:C.count},`coll-${C.id}`):d.jsx(hL,{id:C.id},C.id)),x.map(C=>{const _=Ot(C),N=y===_;if(C.sequenceId&&P.has(C.sequenceId)&&I.has(_)){const j=P.get(C.sequenceId);return[k(`coll-${C.sequenceId}`,d.jsx(vL,{sequenceId:C.sequenceId,images:j})),...j.map($=>{const L=Ot($),J=y===L;return gt($)?k(L,d.jsxs("div",{className:`history-thumb history-thumb--video history-thumb--fade-in${J?" active":""}`,onClick:()=>o($),draggable:!0,onDragStart:re=>{re.dataTransfer.setData("application/ima2-ref",JSON.stringify(yi($))),re.dataTransfer.effectAllowed="copy"},children:[$.thumb?d.jsx("img",{src:$.thumb,alt:"",loading:"lazy",decoding:"async"}):d.jsx(nr,{}),d.jsx("span",{className:"history-thumb__play-badge","aria-hidden":"true",children:"▶"})]})):k(L,d.jsx("img",{src:$.thumb||$.url||$.image,alt:"",className:`history-thumb history-thumb--fade-in${J?" active":""}`,loading:"lazy",decoding:"async",onClick:()=>o($),draggable:!0,onDragStart:re=>{re.dataTransfer.setData("application/ima2-ref",JSON.stringify({image:$.url||$.image,filename:$.filename})),re.dataTransfer.effectAllowed="copy"}}))})]}return C.sequenceId&&P.has(C.sequenceId)&&!I.has(_)?null:gt(C)?k(_,d.jsxs("div",{className:`history-thumb history-thumb--video${N?" active":""}`,onClick:()=>o(C),draggable:!0,onDragStart:j=>{j.dataTransfer.setData("application/ima2-ref",JSON.stringify(yi(C))),j.dataTransfer.effectAllowed="copy"},children:[C.thumb?d.jsx("img",{src:C.thumb,alt:"",loading:"lazy",decoding:"async"}):d.jsx(nr,{}),d.jsx("span",{className:"history-thumb__play-badge","aria-hidden":"true",children:"▶"})]})):k(_,d.jsx("img",{src:C.thumb||C.url||C.image,alt:"",className:`history-thumb${N?" active":""}`,loading:"lazy",decoding:"async",onClick:()=>o(C),draggable:!0,onDragStart:j=>{j.dataTransfer.setData("application/ima2-ref",JSON.stringify({image:C.url||C.image,filename:C.filename})),j.dataTransfer.effectAllowed="copy"}}))})]})}const nv=3e3;function xL(){const{t:e}=ge(),a=w(g=>g.toastLog),i=w(g=>g.errorCardLog),o=w(g=>g.dismissToast),s=w(g=>g.dismissErrorCard),[c,m]=R.useState(()=>typeof document>"u"?!0:document.visibilityState==="visible"),p=R.useRef(new Map);R.useEffect(()=>{const g=()=>m(document.visibilityState==="visible");return document.addEventListener("visibilitychange",g),window.addEventListener("focus",g),window.addEventListener("blur",g),()=>{document.removeEventListener("visibilitychange",g),window.removeEventListener("focus",g),window.removeEventListener("blur",g)}},[]),R.useEffect(()=>{const g=p.current,S=new Set([...a.map(v=>`toast-${v.id}`),...i.map(v=>`error-card-${v.id}`)]);for(const[v,y]of g)(!S.has(v)||!c)&&(clearTimeout(y),g.delete(v));if(c){for(const v of a){const y=`toast-${v.id}`;if(g.has(y))continue;const x=setTimeout(()=>{g.delete(y),o(v.id)},nv);g.set(y,x)}for(const v of i){const y=`error-card-${v.id}`;if(g.has(y))continue;const x=setTimeout(()=>{g.delete(y),s(v.id)},nv);g.set(y,x)}}},[s,o,i,c,a]),R.useEffect(()=>()=>{for(const g of p.current.values())clearTimeout(g);p.current.clear()},[]);const h=[...a.map(g=>({kind:"toast",id:g.id,key:`toast-${g.id}`,message:g.message,error:g.error,createdAt:g.createdAt,cta:void 0,cardKey:void 0})),...i.map(g=>{const S=eo[g.code],v=g.cardKey??S?.cardKey??"errorCard.unknown",y=e(`${v}.title`),x=e(`${v}.body`),E=g.cta??S?.cta;return{kind:"error-card",id:g.id,key:`error-card-${g.id}`,message:g.fallbackMessage?`${y}: ${x} ${g.fallbackMessage}`:`${y}: ${x}`,error:!0,createdAt:g.createdAt,cta:E,cardKey:v}})].sort((g,S)=>g.createdAt-S.createdAt).slice(-5);return h.length===0?null:d.jsx("div",{className:"toast-stack","aria-live":"polite","aria-relevant":"additions removals",children:h.map(g=>{const S=["toast","visible",g.error?"error":"",g.kind==="error-card"?"toast--card":""].filter(Boolean).join(" ");return d.jsxs("div",{className:S,role:g.error?"alert":"status",children:[d.jsx("span",{className:"toast__message",children:g.message}),g.kind==="error-card"&&(g.cta==="reauth"||g.cta==="reload")?d.jsx("button",{type:"button",className:"toast__cta",onClick:()=>{g.cta==="reauth"&&w.getState().openSettings("providers"),g.cta==="reload"&&window.location.reload()},children:e(`${g.cardKey??"errorCard.unknown"}.cta`)}):null,d.jsx("button",{type:"button",className:"toast__dismiss","aria-label":e("common.dismiss"),onClick:()=>g.kind==="error-card"?s(g.id):o(g.id),children:d.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:d.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round"})})})]},g.key)})})}function AL(){return null}function TL(e,a="en"){if(!e)return"earlier";const i=new Date(e);if(Number.isNaN(i.getTime()))return"earlier";const s=Math.floor((new Date().getTime()-i.getTime())/864e5);return s===0?"today":s===1?"yesterday":s<7?"thisWeek":new Intl.DateTimeFormat(a,{year:"numeric",month:"short",day:"numeric"}).format(i)}function CL(e,a,i){async function o(m){if(m.setId)try{await vt.getState().loadSet(m.setId),w.getState().setUIMode("card-news"),e()}catch{a(i("gallery.openCardNewsSetFailed"),!0)}}async function s(m,p){if(p.stopPropagation(),!m.setId)return;const h=`generated/cardnews/${m.setId}`;try{await navigator.clipboard?.writeText(h),a(i("gallery.cardNewsPathCopied"))}catch{a(i("toast.copyFailed"),!0)}}function c(m,p){p.stopPropagation(),m.setId&&window.open(b2(m.setId),"_blank","noopener,noreferrer")}return{handleOpenCardNewsSet:o,handleCopyCardNewsSetPath:s,handleDownloadCardNewsManifest:c}}const wL=["ArrowLeft","ArrowRight","Home","End"];function IL(){return R.useCallback(e=>{if(!wL.includes(e.key))return;const a=e.currentTarget,i=Array.from(a.querySelectorAll("[role='tab']")).filter(p=>!p.hasAttribute("disabled"));if(i.length===0)return;e.preventDefault();const o=document.activeElement,s=o?i.indexOf(o):-1,c=e.key==="Home"?0:e.key==="End"?i.length-1:s<0?0:(s+(e.key==="ArrowRight"?1:-1)+i.length)%i.length,m=i[c];m?.focus(),m?.click()},[])}function ju({className:e,ariaLabel:a,tabs:i,value:o,onChange:s}){const c=IL(),m=i.find(h=>h.value===o),p=m&&!m.disabled?m.value:i.find(h=>!h.disabled)?.value;return d.jsx("div",{className:e,role:"tablist","aria-label":a,onKeyDown:c,children:i.map(h=>d.jsx("button",{type:"button",role:"tab","aria-selected":h.value===o,tabIndex:h.value===p?0:-1,className:h.value===o?"active":"",onClick:()=>s(h.value),disabled:h.disabled,children:h.label},h.value))})}function EL({item:e,onOpen:a,onCopyPath:i,onDownloadManifest:o}){const{t:s}=ge(),m=e.cards?.find(p=>p.headline)?.headline||e.headline||s("gallery.cardNewsSet");return d.jsxs(d.Fragment,{children:[d.jsxs("button",{type:"button",className:"gallery__tile",onClick:()=>a(e),title:m,children:[e.image?d.jsx("img",{src:e.image,alt:m,loading:"lazy"}):null,d.jsxs("div",{className:"gallery__caption",children:[d.jsx("small",{children:s("gallery.cardNewsSet")}),d.jsx("span",{className:"gallery__caption-text",children:m})]}),d.jsx("div",{className:"gallery-card-news-strip",children:(e.cards||[]).slice(0,5).map((p,h)=>d.jsxs("span",{children:[p.url?d.jsx("img",{src:p.url,alt:p.headline??"",loading:"lazy"}):null,d.jsx("em",{children:p.cardOrder??h+1})]},`${p.url}-${h}`))})]}),d.jsxs("div",{className:"gallery-card-news-actions",children:[d.jsx("span",{children:s("gallery.cardNewsCount",{n:e.cards?.length??0})}),d.jsx("button",{type:"button",onClick:()=>a(e),children:s("gallery.openCardNewsSet")}),d.jsx("button",{type:"button",onClick:p=>i(e,p),children:s("gallery.copyCardNewsSetPath")}),d.jsx("button",{type:"button",onClick:p=>o(e,p),children:s("gallery.downloadCardNewsManifest")})]})]})}const RL=[{id:"animate",labelKey:"chain.animate",available:e=>!!e.filename&&!gt(e)},{id:"edit",labelKey:"chain.edit",available:e=>!!e.filename&&!gt(e)},{id:"useAsRef",labelKey:"chain.useAsRef",available:e=>!!(e.image||e.url)},{id:"rebake",labelKey:"chain.rebake",available:e=>!!(e.prompt||e.filename)},{id:"saveToAssets",labelKey:"chain.saveToAssets",available:e=>!!e.filename},{id:"saveAsElement",labelKey:"chain.saveAsElement",available:e=>!!e.filename&&!gt(e)}];async function NL(e,a,i,o){const s=i();switch(e){case"animate":{if(!a.filename)return;try{await s.animateImage(a.filename,a.prompt??void 0)&&s.showToast(o("toast.animateDone"))}catch(c){s.showToast(c instanceof Error?c.message:o("toast.animateFailed"),!0)}break}case"edit":{s.selectHistory(a),s.openCanvas();break}case"useAsRef":{const c=a.url||a.image;if(!c)return;try{const p=await(await fetch(c)).blob(),h=new File([p],a.filename||"reference.png",{type:p.type});await s.addReferences([h]),s.showToast(o("chain.refAdded"))}catch{s.showToast(o("chain.refFailed"),!0)}break}case"rebake":{try{const{continueFromItem:m}=await $t(async()=>{const{continueFromItem:h}=await Promise.resolve().then(()=>UM);return{continueFromItem:h}},void 0),p=await m(a);s.showToast(o(p.hasPrompt?"toast.forkStarted":"toast.forkStartedNoPrompt"))}catch{s.showToast(o("toast.forkFailed"),!0)}const c=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');c&&(c.focus(),c.setSelectionRange(c.value.length,c.value.length));break}case"saveToAssets":{try{const c=await s.saveToAssets(a);s.showToast(o(c?"chain.savedToAssets":"chain.saveToAssetsFailed"),!c)}catch{s.showToast(o("chain.saveToAssetsFailed"),!0)}break}case"saveAsElement":{try{const c=await s.saveAsElement?.(a);s.showToast(o(c?"chain.savedToAssets":"chain.saveToAssetsFailed"),!c)}catch{s.showToast(o("chain.saveToAssetsFailed"),!0)}break}}}function kL(e){return e.mediaType==="video"?e.videoContinuity?.parentFilename?"v2v":e.sourceImageFilename?"i2v":"t2v":e.canvasSourceFilename||e.sourceImageFilename?"i2i":e.model?"t2i":null}function _L(e){return e.videoContinuity?.parentFilename??e.canvasSourceFilename??e.sourceImageFilename??null}function ML(e){return{modelLabel:Cv(e.model,e.provider),derivation:kL(e),sourceLabel:_L(e)}}function PL(e){return!e.modelLabel&&!e.derivation}function LL({view:e,size:a="sm"}){const{t:i}=ge();return PL(e)?null:d.jsxs("span",{className:`provenance-chip provenance-chip--${a}`,children:[e.modelLabel?d.jsx("span",{className:"provenance-chip__model",children:e.modelLabel}):null,e.derivation?d.jsx("span",{className:"provenance-chip__derivation",children:i(`provenance.${e.derivation}`)}):null]})}function OL({id:e}){switch(e){case"animate":return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"edit":return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),d.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"useAsRef":return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),d.jsx("polyline",{points:"17 8 12 3 7 8"}),d.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]});case"rebake":return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("polyline",{points:"23 4 23 10 17 10"}),d.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]});case"saveToAssets":return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"2",y:"3",width:"20",height:"5",rx:"1"}),d.jsx("path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}),d.jsx("path",{d:"M10 12h4"})]})}}function jL({item:e,active:a,itemRef:i,onSelect:o,onDelete:s,onToggleFavorite:c,favoriteBusy:m=!1,t:p}){const h=R.useMemo(()=>RL.filter(v=>v.available(e)),[e]),g=R.useCallback(async(v,y)=>{y.stopPropagation(),await NL(v,e,()=>{const x=w.getState();return{animateImage:x.animateImage,openCanvas:x.openCanvas,selectHistory:x.selectHistory,addReferences:x.addReferences,showToast:x.showToast,saveToAssets:x.saveToAssets}},p)},[e,p]),S=v=>{v.dataTransfer.setData("application/ima2-ref",JSON.stringify(gt(e)?yi(e):{image:e.url||e.image,filename:e.filename})),v.dataTransfer.effectAllowed="copy"};return d.jsxs("div",{ref:i,className:`gallery__tile-wrap${a?" gallery__tile-wrap--active":""}${e.isFavorite?" gallery__tile-wrap--favorite":""}`,children:[d.jsxs("button",{type:"button",className:`gallery__tile${a?" gallery__tile--active":""}`,onClick:()=>o(e),title:e.prompt??"",draggable:!0,onDragStart:S,children:[gt(e)?d.jsxs("div",{className:"gallery__tile-video-wrap",children:[e.thumb?d.jsx("img",{src:e.thumb,alt:e.prompt??p("gallery.imageAltFallback"),loading:"lazy",decoding:"async",className:"gallery__tile-video"}):d.jsx(nr,{className:"gallery__tile-video"}),d.jsx("span",{className:"gallery__play-badge","aria-hidden":"true",children:"▶"})]}):d.jsx("img",{src:e.thumb||e.image,alt:e.prompt??p("gallery.imageAltFallback"),loading:"lazy",decoding:"async"}),e.prompt&&d.jsx("div",{className:"gallery__caption",children:d.jsx("span",{className:"gallery__caption-text",children:e.prompt})})]}),h.length>0?d.jsx("div",{className:"gallery__chain-overlay",role:"group","aria-label":p("chain.ariaLabel"),children:h.map(v=>d.jsx("button",{type:"button",className:"gallery__chain-btn",onClick:y=>{g(v.id,y)},title:p(v.labelKey),"aria-label":p(v.labelKey),children:d.jsx(OL,{id:v.id})},v.id))}):null,e.filename&&c&&d.jsx(vS,{variant:"gallery",active:!!e.isFavorite,busy:m,label:e.isFavorite?p("gallery.unfavoriteAria"):p("gallery.favoriteAria"),onToggle:()=>c(e)}),e.filename&&d.jsx("button",{type:"button",className:"gallery__delete",onClick:v=>s(e,v),title:p("gallery.deleteTitle"),"aria-label":p("gallery.deleteAria"),children:"×"}),d.jsx(LL,{view:ML(e)})]})}function GL(e,a,i){const o=new Array(e);return new Proxy(o,{get(s,c,m){if(typeof c=="string"){const p=c.charCodeAt(0);if(p>=48&&p<=57){const h=+c;if(Number.isInteger(h)&&h>=0&&h<e){let g=s[h];if(!g){const S=a[h*2];g=s[h]={index:h,key:i(h),start:S,size:a[h*2+1],end:S+a[h*2+1],lane:0}}return g}}if(c==="length")return e}return Reflect.get(s,c,m)}})}function Qo(e,a,i){let o=i.initialDeps??[],s,c=!0;function m(){const p=e();return(p.length!==o.length||p.some((g,S)=>o[S]!==g))&&(o=p,s=a(...p),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(s),c=!1),s}return m.updateDeps=p=>{o=p},m}function av(e,a){if(e===void 0)throw new Error("Unexpected undefined");return e}const DL=(e,a)=>Math.abs(e-a)<1.01,FL=(e,a,i)=>{let o;return function(...s){e.clearTimeout(o),o=e.setTimeout(()=>a.apply(this,s),i)}};let di;const Gu=()=>{if(di!==void 0)return di;if(typeof navigator>"u")return di=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return di=!0;const e=navigator.maxTouchPoints;return di=navigator.platform==="MacIntel"&&e!==void 0&&e>0},ov=e=>{const{offsetWidth:a,offsetHeight:i}=e;return{width:a,height:i}},zL=e=>e,qL=e=>{const a=Math.max(e.startIndex-e.overscan,0),o=Math.min(e.endIndex+e.overscan,e.count-1)-a+1,s=new Array(o);for(let c=0;c<o;c++)s[c]=a+c;return s},UL=(e,a)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const s=m=>{const{width:p,height:h}=m;a({width:Math.round(p),height:Math.round(h)})};if(s(ov(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(m=>{const p=()=>{const h=m[0];if(h?.borderBoxSize){const g=h.borderBoxSize[0];if(g){s({width:g.inlineSize,height:g.blockSize});return}}s(ov(i))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(p):p()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},Es={passive:!0},HL=typeof window>"u"?!0:"onscrollend"in window,BL=(e,a,i)=>{const o=e.scrollElement;if(!o)return;const s=e.targetWindow;if(!s)return;const c=e.options.useScrollendEvent&&HL;let m=0;const p=c?null:FL(s,()=>a(m,!1),e.options.isScrollingResetDelay),h=v=>()=>{m=i(o),p?.(),a(m,v)},g=h(!0),S=h(!1);return o.addEventListener("scroll",g,Es),c&&o.addEventListener("scrollend",S,Es),()=>{o.removeEventListener("scroll",g),c&&o.removeEventListener("scrollend",S)}},VL=(e,a)=>BL(e,a,i=>{const{horizontal:o,isRtl:s}=e.options;return o?i.scrollLeft*(s&&-1||1):i.scrollTop}),KL=(e,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(e),s=i.options.getItemKey(o);return i.itemSizeCache.get(s)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(e),s=i.options.getItemKey(o),c=i.itemSizeCache.get(s);if(c!==void 0)return c}return e[i.options.horizontal?"offsetWidth":"offsetHeight"]},$L=(e,{adjustments:a=0,behavior:i},o)=>{var s,c;(c=(s=o.scrollElement)==null?void 0:s.scrollTo)==null||c.call(s,{[o.options.horizontal?"left":"top"]:e+a,behavior:i})},YL=$L;class XL{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,s;return((s=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:s.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(s=>{s.forEach(c=>{const m=()=>{const p=c.target,h=this.indexFromElement(p);if(!p.isConnected){this.observer.unobserve(p);for(const[g,S]of this.elementsCache)if(S===p){this.elementsCache.delete(g);break}return}this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(p,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(m):m()})}));return{disconnect:()=>{var s;(s=o())==null||s.disconnect(),i=null},observe:s=>{var c;return(c=o())==null?void 0:c.observe(s,{box:"border-box"})},unobserve:s=>{var c;return(c=o())==null?void 0:c.unobserve(s)}}})(),this.range=null,this.setOptions=i=>{var o,s;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:zL,rangeExtractor:qL,onChange:()=>{},measureElement:KL,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const y in i){const x=i[y];x!==void 0&&(c[y]=x)}const m=this.options;let p=null,h=null,g=!1;if(m!==void 0&&m.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const y=m.count,x=c.count,E=this.getMeasurements(),P=y>0?((o=E[0])==null?void 0:o.key)??m.getItemKey(0):null,I=y>0?((s=E[y-1])==null?void 0:s.key)??m.getItemKey(y-1):null;if(x!==y||y>0&&x>0&&(c.getItemKey(0)!==P||c.getItemKey(x-1)!==I)){g=!0;const _=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??E[0]:null;_&&(p=[_.key,this.getScrollOffset()-_.start]);const N=c.followOnAppend===!0?"auto":c.followOnAppend||null;N&&x>y&&this.isAtEnd(m.scrollEndThreshold)&&(y===0||c.getItemKey(x-1)!==I)&&(h=N)}}this.options=c,g&&(this.pendingMin=0,this.itemSizeCacheVersion++);let S=!1,v=0;if(p&&this.scrollOffset!==null){const[y,x]=p,E=this.getMeasurements(),{count:P,getItemKey:I}=this.options;let k=0;for(;k<P&&I(k)!==y;)k++;if(k<P){const C=E[k];if(C){const _=Math.max(0,C.start+x);_!==this.scrollOffset&&(v=_-this.scrollOffset,this.scrollOffset=_,S=!0)}}}(S||h)&&(this.pendingScrollAnchor=[S?p[0]:null,S?p[1]:0,h,v])},this.notify=i=>{var o,s;(s=(o=this.options).onChange)==null||s.call(o,this,i)},this.maybeNotify=Qo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,m)=>{if(m&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const p=this.getScrollOffset();this.scrollDirection=m?p===c?this.scrollDirection:p<c?"forward":"backward":null,this.scrollOffset=c,this.isScrolling=m,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const c=this.scrollElement,m=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},p=()=>{this._iosTouching=!1,!(!Gu()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",m,Es),c.addEventListener("touchend",p,Es),this.unsubs.push(()=>{c.removeEventListener("touchstart",m),c.removeEventListener("touchend",p),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[c,m,p,h]=s;c!==null&&!p&&(Gu()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?h!==0&&(this._iosDeferredAdjustment+=h):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),p&&this.scrollToEnd({behavior:p})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Qo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,s,c,m,p,h,g)=>(this.prevLanes!==void 0&&this.prevLanes!==p&&(this.lanesChangedFlag=!0),this.prevLanes=p,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:s,getItemKey:c,enabled:m,lanes:p,laneAssignmentMode:h,gap:g}),{key:!1}),this.getMeasurements=Qo(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:s,getItemKey:c,enabled:m,lanes:p,laneAssignmentMode:h,gap:g},S)=>{const v=this.itemSizeCache;if(!m)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const k of this.laneAssignments.keys())k>=i&&this.laneAssignments.delete(k);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(k=>{this.itemSizeCache.set(k.key,k.size)}));const y=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),p===1){const k=i*2;let C=this._flatMeasurements;if(!C||C.length<k){const j=new Float64Array(k);C&&y>0&&j.set(C.subarray(0,y*2)),C=j,this._flatMeasurements=C}let _;if(y===0)_=o+s;else{const j=y-1;_=C[j*2]+C[j*2+1]+g}for(let j=y;j<i;j++){const $=c(j),L=v.get($),J=typeof L=="number"?L:this.options.estimateSize(j);C[j*2]=_,C[j*2+1]=J,_+=J+g}const N=GL(i,C,c);return this.measurementsCache=N,N}const x=this.measurementsCache.slice(0,y),E=new Array(p).fill(void 0),P=new Float64Array(p);let I=0;for(let k=0;k<y;k++){const C=x[k];C&&(E[C.lane]===void 0&&I++,E[C.lane]=k,P[C.lane]=C.end)}for(let k=y;k<i;k++){const C=c(k),_=this.laneAssignments.get(k);let N,j;const $=h==="estimate"||v.has(C);if(_!==void 0&&this.options.lanes>1){N=_;const he=E[N],V=he!==void 0?x[he]:void 0;j=V?V.end+g:o+s}else if(I===p){let he=0,V=P[0],ee=E[0];for(let oe=1;oe<p;oe++){const Ne=P[oe];(Ne<V||Ne===V&&E[oe]<ee)&&(he=oe,V=Ne,ee=E[oe])}N=he,j=V+g,$&&this.laneAssignments.set(k,N)}else N=k%this.options.lanes,j=o+s,$&&this.laneAssignments.set(k,N);const L=v.get(C),J=typeof L=="number"?L:this.options.estimateSize(k),re=j+J;x[k]={index:k,start:j,size:J,end:re,key:C,lane:N},E[N]===void 0&&I++,E[N]=k,P[N]=re}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Qo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,s,c)=>i.length===0||o===0?(this.range=null,null):(this.range=JL(i,o,s,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Qo(()=>{let i=null,o=null;const s=this.calculateRange();return s&&(i=s.startIndex,o=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,s,c,m)=>c===null||m===null?[]:i({startIndex:c,endIndex:m,overscan:o,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,s=i.getAttribute(o);return s?parseInt(s,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(s!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),m=Math.max(0,s-c),p=Math.min(this.options.count-1,s+c);return i>=m&&i<=p}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((m,p)=>{m.isConnected||(this.observer.unobserve(m),this.elementsCache.delete(p))});return}const o=this.indexFromElement(i),s=this.options.getItemKey(o),c=this.elementsCache.get(s);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(s,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var s,c;if(i<0||i>=this.options.count)return;let m,p,h;const g=this._flatMeasurements;if(this.options.lanes===1&&g!==null)h=this.options.getItemKey(i),p=g[i*2],m=g[i*2+1];else{const y=this.measurementsCache[i];if(!y)return;h=y.key,p=y.start,m=y.size}const S=this.itemSizeCache.get(h)??m,v=o-S;if(v!==0){const y=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=y?this.getTotalSize():0,E=this.getScrollOffset()+this.scrollAdjustments,I=!this.itemSizeCache.has(h)?p<E:p+S<=E&&this.scrollDirection!=="backward",k=((c=this.scrollState)==null?void 0:c.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[i]??{index:i,key:h,start:p,size:m,end:p+m,lane:0},v,this):I);(this.pendingMin===null||i<this.pendingMin)&&(this.pendingMin=i),this.itemSizeCache.set(h,o),this.itemSizeCacheVersion++;let C=!1;y?C=this.applyScrollAdjustment(this.getTotalSize()-x):k&&(C=this.applyScrollAdjustment(v)),this.notify(C)}},this.getVirtualItems=Qo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const s=[];for(let c=0,m=i.length;c<m;c++){const p=i[c],h=o[p];s.push(h)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const s=this._flatMeasurements,c=this.options.lanes===1&&s!=null,m=jS(0,o.length-1,c?p=>s[p*2]:p=>av(o[p]).start,i);return av(o[m])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,s=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),m=this.getScrollOffset();o==="auto"&&(o=i>=m+c?"end":"start"),o==="center"?i+=(s-c)/2:o==="end"&&(i-=c);const p=this.getMaxScrollOffset();return Math.max(Math.min(p,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const s=this.getSize(),c=this.getScrollOffset(),m=this.measurementsCache[i];if(!m)return;if(o==="auto")if(m.end>=c+s-this.options.scrollPaddingEnd)o="end";else if(m.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const p=o==="end"?m.end+this.options.scrollPaddingEnd:m.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(p,o,m.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),m=this.now();this.scrollState={index:null,align:o,behavior:s,startedAt:m,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[m,p]=c,h=this.now();this.scrollState={index:i,align:p,behavior:s,startedAt:h,lastTargetOffset:m,stableFrames:0},this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const s=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let s;if(o.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,m=this._flatMeasurements;m!=null?s=m[c*2]+m[c*2+1]:s=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let m=o.length-1;for(;m>=0&&c.some(p=>p===null);){const p=o[m];c[p.lane]===null&&(c[p.lane]=p.end),m--}s=Math.max(...c.filter(p=>p!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const s of o)s&&this.itemSizeCache.has(s.key)&&i.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:s})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:s,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Gu()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=o?o[0]:this.scrollState.lastTargetOffset,c=1,m=s!==this.scrollState.lastTargetOffset;if(!m&&DL(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,m){const p=this.getSize()||600,h=Math.abs(s-this.getScrollOffset()),g=this.scrollState.behavior==="smooth"&&h>p;this.scrollState.lastTargetOffset=s,g||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:g?"smooth":"auto"})}this.scheduleScrollReconcile()}}const jS=(e,a,i,o)=>{for(;e<=a;){const s=(e+a)/2|0,c=i(s);if(c<o)e=s+1;else if(c>o)a=s-1;else return s}return e>0?e-1:0};function QL(e,a,i){let o=0;for(;o<=a;){const s=(o+a)/2|0,c=e[s*2];if(c<i)o=s+1;else if(c>i)a=s-1;else return s}return o>0?o-1:0}function JL(e,a,i,o,s){const c=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:c};if(o===1&&s!==null){const g=QL(s,c,i);let S=g;const v=i+a;for(;S<c&&s[S*2]+s[S*2+1]<v;)S++;return{startIndex:g,endIndex:S}}let p=jS(0,c,g=>e[g].start,i),h=p;if(o===1)for(;h<c&&e[h].end<i+a;)h++;else if(o>1){const g=Array(o).fill(0);for(;h<c&&g.some(v=>v<i+a);){const v=e[h];g[v.lane]=v.end,h++}const S=Array(o).fill(i+a);for(;p>=0&&S.some(v=>v>=i);){const v=e[p];S[v.lane]=v.start,p--}p=Math.max(0,p-p%o),h=Math.min(c,h+(o-1-h%o))}return{startIndex:p,endIndex:h}}const Du=typeof document<"u"?R.useLayoutEffect:R.useEffect;function WL({useFlushSync:e=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const s=R.useReducer(S=>S+1,0)[1],c=R.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const m=S=>{const v=c.current;if(!v.enabled||!v.container)return;const y=S.getTotalSize();if(y!==v.lastSize){v.lastSize=y;const x=S.options.horizontal?"width":"height";v.container.style[x]=`${y}px`}},p=S=>{const v=c.current;if(!v.enabled||!v.container)return;m(S);const y=!!S.options.horizontal,x=v.mode==="transform",E=y?"left":"top",P=S.options.scrollMargin,I=S.getVirtualItems();for(const k of I){const C=k.start-P,_=S.elementsCache.get(k.key);_&&v.lastPositions.get(_)!==C&&(v.lastPositions.set(_,C),x?_.style.transform=y?`translate3d(${C}px, 0, 0)`:`translate3d(0, ${C}px, 0)`:_.style[E]=`${C}px`)}},h={...o,onChange:(S,v)=>{var y;const x=c.current;let E=!0;if(x.enabled){p(S);const P=S.range,I=x.prevRange;E=!I||I.isScrolling!==S.isScrolling||I.startIndex!==P?.startIndex||I.endIndex!==P?.endIndex,E&&(x.prevRange=P?{startIndex:P.startIndex,endIndex:P.endIndex,isScrolling:S.isScrolling}:null)}E&&(e&&v?Js.flushSync(s):s()),(y=o.onChange)==null||y.call(o,S,v)}},[g]=R.useState(()=>{const S=new XL(h);return Object.assign(S,{containerRef:v=>{const y=c.current;if(y.container=v,y.lastSize=null,v&&y.enabled){const x=S.getTotalSize();y.lastSize=x;const E=S.options.horizontal?"width":"height";v.style[E]=`${x}px`}}})});return g.setOptions(h),Du(()=>g._didMount(),[]),Du(()=>(m(g),g._willUpdate())),Du(()=>{p(g)}),g}function ZL(e){return WL({observeElementRect:UL,observeElementOffset:VL,scrollToFn:YL,...e})}const Rs=170,Ns=10,GS=36,eO=44;function tO(e){const a=Math.max(Rs,e-GS);return Math.max(1,Math.floor((a+Ns)/(Rs+Ns)))}function nO(e,a){const i=Math.max(Rs,e-GS);return Math.max(Rs,Math.floor((i-Ns*Math.max(0,a-1))/a))+Ns}function aO(e,a){const i=[];for(const[o,s]of e){i.push({type:"header",id:`h-${o}`,label:o,count:s.length});for(let c=0;c<s.length;c+=a)i.push({type:"items",id:`r-${o}-${c}`,items:s.slice(c,c+a)})}return i}function oO({dateGroups:e,selectedKey:a,scrollElement:i,localizeBucket:o,renderTile:s}){const c=R.useRef(null),[m,p]=R.useState(0),h=R.useMemo(()=>tO(m||960),[m]),g=R.useMemo(()=>nO(m||960,h),[m,h]),S=R.useMemo(()=>aO(e,h),[e,h]);R.useEffect(()=>{const y=c.current;if(!y)return;const x=()=>p(y.clientWidth);x();const E=new ResizeObserver(x);return E.observe(y),()=>E.disconnect()},[]);const v=ZL({count:S.length,getScrollElement:()=>i,estimateSize:y=>S[y]?.type==="header"?eO:g,overscan:6});return R.useEffect(()=>{if(!a)return;const y=S.findIndex(x=>x.type==="items"&&x.items.some(E=>Ot(E)===a));y>=0&&v.scrollToIndex(y,{align:"center"})},[S,a,v]),d.jsx("div",{ref:c,className:"gallery__virtual",style:{height:v.getTotalSize()},children:v.getVirtualItems().map(y=>{const x=S[y.index];return x?d.jsx("div",{className:"gallery__virtual-row",style:{transform:`translateY(${y.start}px)`},children:x.type==="header"?d.jsxs("header",{className:"gallery__group-header gallery__group-header--virtual",children:[d.jsx("span",{className:"gallery__group-label",children:o(x.label)}),d.jsx("span",{className:"gallery__group-count",children:x.count})]}):d.jsx("div",{className:"gallery__grid gallery__grid--virtual",children:x.items.map((E,P)=>s(E,x.id,P))})},x.id):null})})}function rv({showSessions:e,favoritesOnly:a,query:i,historyNextCursor:o,favoriteHistoryNextCursor:s,historyLoadingOlder:c,favoriteHistoryLoadingOlder:m,onLoadOlder:p,onLoadOlderFavorites:h,t:g}){return e?d.jsx("div",{className:"gallery__load-more gallery__load-more--hint",children:g("gallery.sessionPaginationHint")}):i.trim()?null:a?s?d.jsx("div",{className:"gallery__load-more",children:d.jsx("button",{type:"button",onClick:h,disabled:m,children:g(m?"gallery.loadingOlderFavorites":"gallery.loadOlderFavorites")})}):null:o?d.jsx("div",{className:"gallery__load-more",children:d.jsx("button",{type:"button",onClick:p,disabled:c,children:g(c?"gallery.loadingOlder":"gallery.loadOlder")})}):null}function rO({groups:e,loose:a,favoritesOnly:i,galleryScope:o,setGalleryScope:s,renderTile:c,t:m}){return e.length===0&&a.length===0?d.jsx("div",{className:"gallery__empty",children:i?m("gallery.emptyFavorites"):o==="current-session"?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:m("gallery.empty.currentSession")}),d.jsx("button",{type:"button",onClick:()=>s("all"),children:m("gallery.scope.all")})]}):m("gallery.emptySessions")}):d.jsxs(d.Fragment,{children:[e.map(p=>d.jsxs("section",{className:"gallery__group",children:[d.jsxs("header",{className:"gallery__group-header",children:[d.jsx("span",{className:"gallery__group-label",title:p.sessionId,children:p.title?p.displayLabel:m("gallery.sessionLabel",{name:p.displayLabel})}),d.jsx("span",{className:"gallery__group-count",children:p.items.length})]}),d.jsx("div",{className:"gallery__grid",children:p.items.map((h,g)=>c(h,p.sessionId,g))})]},p.sessionId)),a.length>0&&d.jsxs("section",{className:"gallery__group",children:[d.jsxs("header",{className:"gallery__group-header",children:[d.jsx("span",{className:"gallery__group-label",children:m("gallery.standalone")}),d.jsx("span",{className:"gallery__group-count",children:a.length})]}),d.jsx("div",{className:"gallery__grid",children:a.map((p,h)=>c(p,"loose",h))})]})]})}function iO({status:e,dismissed:a,onOpenFolder:i,onDismiss:o,t:s}){const c=e!=null&&e.state!=="ok"&&!a,m=e?.state==="recoverable"?"gallery.storageNoticeRecoverable":e?.state==="not_found"?"gallery.storageNoticeNotFound":"gallery.storageNoticeUnknown";return d.jsxs("div",{className:`gallery__storage-bar${c?" gallery__storage-bar--notice":""}`,children:[c?d.jsxs("div",{className:"gallery__storage-copy",children:[d.jsx("div",{className:"gallery__storage-title",children:s("gallery.storageNoticeTitle")}),d.jsx("div",{className:"gallery__storage-text",children:s(m)})]}):d.jsx("div",{className:"gallery__storage-copy gallery__storage-copy--quiet",children:e?.generatedDirLabel??"~/.ima2/generated"}),d.jsxs("div",{className:"gallery__storage-actions",children:[d.jsx("button",{type:"button",className:"gallery__storage-button",onClick:i,title:s("gallery.openGeneratedDirTitle"),children:s("gallery.openGeneratedDir")}),c&&d.jsx("button",{type:"button",className:"gallery__storage-button gallery__storage-button--ghost",onClick:o,children:s("common.close")})]})]})}const iv="ima2.storageNoticeDismissed.0.09.23";function lO(e){const a=R.useRef(null),i=R.useRef(new Map),[o,s]=R.useState(()=>new Set);R.useEffect(()=>{if(!e||typeof IntersectionObserver>"u")return;const m=new IntersectionObserver(p=>{const h=p.filter(g=>g.isIntersecting);h.length!==0&&s(g=>{const S=new Set(g);for(const v of h){const y=v.target.dataset.galleryLazyKey;y&&S.add(y)}return S})},{root:e,rootMargin:"200% 0px"});a.current=m;for(const p of i.current.values())m.observe(p);return()=>{m.disconnect(),a.current=null}},[e]);const c=R.useCallback((m,p)=>{const h=i.current.get(m);h&&h!==p&&a.current?.unobserve(h),p?(i.current.set(m,p),a.current?.observe(p)):i.current.delete(m)},[]);return{visibleKeys:o,register:c,supported:typeof IntersectionObserver<"u"}}function sO(){const{t:e,locale:a}=ge(),i=w(te=>te.galleryOpen),o=w(te=>te.closeGallery),s=w(te=>te.history),c=w(te=>te.selectHistory),m=w(te=>te.currentImage),p=w(te=>te.trashHistoryItem),h=w(te=>te.showToast),g=w(te=>te.toggleGalleryFavorite),S=w(te=>te.galleryScope),v=w(te=>te.setGalleryScope),y=w(te=>te.historyNextCursor),x=w(te=>te.historyLoadingOlder),E=w(te=>te.favoriteHistoryNextCursor),P=w(te=>te.favoriteHistoryLoadingOlder),I=w(te=>te.loadOlderHistory),k=w(te=>te.loadFavoriteHistory),C=w(te=>te.loadOlderFavoriteHistory),_=w(r1),[N,j]=R.useState(""),[$,L]=R.useState("date"),[J,re]=R.useState(!1),[he,V]=R.useState(()=>new Set),ee=R.useRef(new Set),[oe,Ne]=R.useState([]),[ne,H]=R.useState([]),[ae,ce]=R.useState(!1),[be,Se]=R.useState(!1),[T,F]=R.useState(!1),[W,U]=R.useState(0),[le,pe]=R.useState(null),[xe,Oe]=R.useState(()=>{try{return localStorage.getItem(iv)==="1"}catch{return!1}}),Re=R.useRef(null),Ze=R.useRef({}),[ie,lt]=R.useState(null),at=R.useRef(0),st=R.useRef({open:!1,selectedKey:null}),bt=R.useMemo(()=>hs(s.filter(mi)),[s]),se=R.useCallback(te=>{Re.current=te,lt(te)},[]),qe=lO(ie),ot=uo(i,o);R.useEffect(()=>{i||j("")},[i]),R.useEffect(()=>{if(!i)return;let te=!1;return(async()=>{try{const Te=await LT();te||pe(Te)}catch{te||pe({generatedDirLabel:"~/.ima2/generated",generatedCount:0,legacyCandidatesScanned:0,legacySourcesFound:0,legacyFilesFound:0,state:"unknown",messageKind:"unknown",recoveryDocsPath:"docs/RECOVER_OLD_IMAGES.md",doctorCommand:"ima2 doctor",overrides:{generatedDir:!1,configDir:!1}})}})(),()=>{te=!0}},[i]),R.useEffect(()=>{if(!i||$!=="session")return;let te=!1;return Ne([]),H([]),ce(!0),Se(!1),F(!1),(async()=>{try{const Te=await MT({limit:500,sessionId:S==="current-session"?_:void 0});if(te)return;F(Te.nextCursor!==null||Te.total>=500);const Tt=de=>{const We=de.kind,Ft=We==="classic"||We==="edit"||We==="generate"||We==="card-news-card"||We==="card-news-set"?We:null,Ma=de.mediaType==="video"||/\.(mp4|webm|mov)$/i.test(de.filename??"");return{image:de.url,url:de.url,filename:de.filename,thumb:de.thumb??(Ma?void 0:de.url),mediaType:de.mediaType,video:de.video??null,videoSeries:de.videoSeries??null,videoContinuity:de.videoContinuity??null,prompt:de.prompt??void 0,userPrompt:de.userPrompt??null,revisedPrompt:de.revisedPrompt??null,promptMode:de.promptMode??null,composerPrompt:de.composerPrompt??null,composerInsertedPrompts:de.composerInsertedPrompts??null,size:de.size??void 0,quality:de.quality??void 0,format:de.format,moderation:de.moderation??void 0,model:de.model??void 0,reasoningEffort:de.reasoningEffort,provider:de.provider,providerUrl:de.providerUrl??null,usage:de.usage,elapsed:de.elapsed??void 0,createdAt:de.createdAt,sessionId:de.sessionId??null,nodeId:de.nodeId??null,parentNodeId:de.parentNodeId??null,clientNodeId:de.clientNodeId??null,requestId:de.requestId??null,kind:Ft,setId:de.setId??null,cardId:de.cardId??null,cardOrder:de.cardOrder??null,headline:de.headline??null,body:de.body??null,cards:de.cards,refsCount:de.refsCount??0,webSearchCalls:de.webSearchCalls??0,sequenceId:de.sequenceId??null,sequenceIndex:de.sequenceIndex??null,sequenceTotalRequested:de.sequenceTotalRequested??null,sequenceTotalReturned:de.sequenceTotalReturned??null,sequenceStatus:de.sequenceStatus??null,isFavorite:de.isFavorite??!1}};Ne(Te.sessions.map(de=>({sessionId:de.sessionId,title:de.title??null,label:de.label??null,displayLabel:de.title||de.label||de.sessionId.slice(0,8),items:hs(de.items.filter(mi).map(Tt))})).filter(de=>de.items.length>0)),H(hs(Te.loose.filter(mi).map(Tt)))}catch{te||Se(!0)}finally{te||ce(!1)}})(),()=>{te=!0}},[i,$,S,_,W]),R.useEffect(()=>{!i||$==="session"||!J||k()},[i,$,J,k]);const St=R.useMemo(()=>{const te=N.trim().toLowerCase().normalize("NFC");return bt.filter(Te=>J&&!Te.isFavorite?!1:te?(Te.prompt??"").toLowerCase().normalize("NFC").includes(te)||(Te.filename??"").toLowerCase().normalize("NFC").includes(te):!0)},[bt,N,J]),xt=R.useMemo(()=>J?oe.map(te=>({...te,items:te.items.filter(Te=>Te.isFavorite)})).filter(te=>te.items.length>0):oe,[oe,J]),nn=R.useMemo(()=>J?ne.filter(te=>te.isFavorite):ne,[ne,J]),Yt=R.useMemo(()=>{const te=new Map;for(const Te of St){const Tt=TL(Te.createdAt,a);te.has(Tt)||te.set(Tt,[]),te.get(Tt).push(Te)}return Array.from(te.entries())},[St,a]),fn=$==="session"?xt.reduce((te,Te)=>te+Te.items.length,0)+nn.length:St.length;R.useLayoutEffect(()=>{const te=m?Ot(m):null;if(!i){st.current={open:!1,selectedKey:te};return}const Te=st.current,Tt=!Te.open||Te.selectedKey!==te;st.current={open:!0,selectedKey:te};const de=te?Ze.current[te]:null;if(Tt&&de){de.scrollIntoView({block:"center"});return}Re.current&&(Re.current.scrollTop=at.current)},[i,m?.filename,m?.image,$,fn,Yt.length,xt.length,nn.length]);async function et(te,Te){Te.stopPropagation();const Tt=Ot(te);await p(te),delete Ze.current[Tt],window.requestAnimationFrame(()=>Re.current?.focus())}async function On(te){const Te=te.filename;if(!(!Te||ee.current.has(Te))){ee.current.add(Te),V(new Set(ee.current));try{const Tt=await g(te);if(Tt===null)return;Ne(de=>de.map(We=>({...We,items:We.items.map(Ft=>Ft.filename===Te?{...Ft,isFavorite:Tt}:Ft)}))),H(de=>de.map(We=>We.filename===Te?{...We,isFavorite:Tt}:We))}finally{ee.current.delete(Te),V(new Set(ee.current))}}}async function D(){try{await OT(),h(e("toast.openGeneratedDirOpened"))}catch{h(e("toast.openGeneratedDirFailed"),!0)}}const{handleOpenCardNewsSet:Ae,handleCopyCardNewsSetPath:ke,handleDownloadCardNewsManifest:Qe}=CL(o,h,e);function pt(){Oe(!0);try{localStorage.setItem(iv,"1")}catch{}}if(!i)return null;const Dt=te=>te==="earlier"||te==="today"||te==="yesterday"||te==="thisWeek"?e(`gallery.${te}`):te,_a=(te,Te,Tt)=>{const de=m?.image===te.image,We=Ot(te),Ft=gn=>{Ze.current[We]=gn,qe.register(We,gn)};return(qe.supported?qe.visibleKeys.has(We):!0)?te.kind==="card-news-set"?d.jsx("div",{ref:Ft,className:"gallery__tile-wrap gallery-card-news-set",children:d.jsx(EL,{item:te,onOpen:gn=>{Ae(gn)},onCopyPath:ke,onDownloadManifest:Qe})},`${Te}-${We}`):d.jsx(jL,{item:te,active:de,itemRef:Ft,onSelect:gn=>{c(gn),o()},onDelete:et,onToggleFavorite:On,favoriteBusy:!!(te.filename&&he.has(te.filename)),t:e},`${Te}-${We}`):d.jsx("div",{ref:Ft,className:"gallery__tile-wrap","data-gallery-lazy-key":We,style:{aspectRatio:"1 / 1"},"aria-hidden":"true"},`${Te}-${We}`)},At=$==="session",Pt=m?Ot(m):null;return d.jsx("div",{className:"gallery-backdrop",onClick:o,role:"presentation",children:d.jsxs("div",{ref:ot,className:"gallery",role:"dialog","aria-modal":"true","aria-label":e("gallery.ariaLabel"),tabIndex:-1,onClick:te=>te.stopPropagation(),children:[d.jsxs("div",{className:"gallery__header",children:[d.jsxs("div",{className:"gallery__title-row",children:[d.jsx("div",{className:"gallery__title",children:e("gallery.title")}),d.jsxs("div",{className:"gallery__meta",children:[e("gallery.total",{n:fn}),N||J?e("gallery.totalFiltered",{n:bt.length}):""]}),d.jsx(ju,{className:"gallery__favorite-filter",ariaLabel:e("gallery.favoriteFilterAria"),value:J?"favorites":"all",onChange:te=>re(te==="favorites"),tabs:[{value:"all",label:e("gallery.filterAll")},{value:"favorites",label:e("gallery.filterFavorites")}]}),d.jsx(ju,{className:"gallery__group-toggle",ariaLabel:e("gallery.sortByAria"),value:$,onChange:L,tabs:[{value:"date",label:e("gallery.sortByDate")},{value:"session",label:e("gallery.sortBySession")}]}),d.jsx(ju,{className:"gallery__scope",ariaLabel:e("gallery.scopeAria"),value:S,onChange:v,tabs:[{value:"current-session",label:e("gallery.scope.current"),disabled:!_},{value:"all",label:e("gallery.scope.all")}]})]}),d.jsx("input",{type:"text",className:"gallery__search",...At?{}:{"data-modal-initial-focus":!0},placeholder:e(At?"gallery.searchDisabledPlaceholder":"gallery.searchPlaceholder"),value:N,onChange:te=>j(te.target.value),disabled:At}),d.jsx("button",{type:"button",className:"gallery__close",onClick:o,"aria-label":e("gallery.closeAria"),title:e("gallery.closeTitle"),children:"×"})]}),d.jsx(iO,{status:le,dismissed:xe,onOpenFolder:D,onDismiss:pt,t:e}),d.jsx("div",{className:"gallery__scroll",ref:se,tabIndex:-1,onScroll:()=>{at.current=Re.current?.scrollTop??0},children:At?ae?d.jsx("div",{className:"gallery__empty",role:"status","aria-live":"polite",children:e("gallery.sessionLoading")}):be?d.jsxs("div",{className:"gallery__empty",role:"alert",children:[d.jsx("span",{children:e("gallery.sessionLoadFailed")}),d.jsx("button",{type:"button",onClick:()=>U(te=>te+1),children:e("gallery.retry")})]}):d.jsxs(d.Fragment,{children:[T?d.jsx("div",{className:"gallery__limit-notice",role:"status",children:e("gallery.sessionLimitNotice",{count:500})}):null,d.jsx(rO,{groups:xt,loose:nn,favoritesOnly:J,galleryScope:S,setGalleryScope:v,renderTile:_a,t:e}),d.jsx(rv,{showSessions:At,favoritesOnly:J,query:N,historyNextCursor:y,favoriteHistoryNextCursor:E,historyLoadingOlder:x,favoriteHistoryLoadingOlder:P,onLoadOlder:()=>{I()},onLoadOlderFavorites:()=>{C()},t:e})]}):St.length===0?d.jsx("div",{className:"gallery__empty",children:bt.length===0?e("gallery.emptyAll"):e(J?"gallery.emptyFavorites":"gallery.noResults")}):d.jsxs(d.Fragment,{children:[d.jsx(oO,{dateGroups:Yt,selectedKey:Pt,scrollElement:ie,localizeBucket:Dt,renderTile:_a}),d.jsx(rv,{showSessions:At,favoritesOnly:J,query:N,historyNextCursor:y,favoriteHistoryNextCursor:E,historyLoadingOlder:x,favoriteHistoryLoadingOlder:P,onLoadOlder:()=>{I()},onLoadOlderFavorites:()=>{C()},t:e})]})})]})})}function cO(e){return e.includes("ratio")?"sizeConfirm.reasonRatio":e.includes("maxPixels")||e.includes("pixels")?"sizeConfirm.reasonPixels":e.includes("minPixels")?"sizeConfirm.reasonMinPixels":e.includes("min")?"sizeConfirm.reasonMin":e.includes("maxEdge")||e.includes("max")?"sizeConfirm.reasonMax":"sizeConfirm.reasonSnap"}function dO(){const e=w(p=>p.customSizeConfirm),a=w(p=>p.confirmCustomSizeAdjustment),i=w(p=>p.cancelCustomSizeAdjustment),{t:o}=ge(),s=uo(!!e,i);if(!e)return null;const c=`${e.requestedW}x${e.requestedH}`,m=`${e.adjustedW}x${e.adjustedH}`;return d.jsx("div",{className:"modal-backdrop custom-size-confirm-backdrop",role:"presentation",children:d.jsxs("div",{ref:s,className:"modal custom-size-confirm",role:"dialog","aria-modal":"true","aria-labelledby":"custom-size-confirm-title","aria-describedby":"custom-size-confirm-body",tabIndex:-1,children:[d.jsx("div",{id:"custom-size-confirm-title",className:"modal__title",children:o("sizeConfirm.title")}),d.jsxs("div",{id:"custom-size-confirm-body",className:"modal__body",children:[d.jsx("p",{children:o("sizeConfirm.body")}),d.jsxs("dl",{className:"size-confirm__pairs",children:[d.jsxs("div",{className:"size-confirm__pair",children:[d.jsx("dt",{children:o("sizeConfirm.requested")}),d.jsx("dd",{children:c})]}),d.jsxs("div",{className:"size-confirm__pair",children:[d.jsx("dt",{children:o("sizeConfirm.adjusted")}),d.jsx("dd",{children:m})]})]}),d.jsx("p",{className:"size-confirm__reason",children:o(cO(e.reasons))})]}),d.jsxs("div",{className:"modal__actions",children:[d.jsx("button",{type:"button","data-modal-initial-focus":!0,className:"modal__btn modal__btn--secondary",onClick:i,children:o("sizeConfirm.cancel")}),d.jsx("button",{type:"button",className:"modal__btn",onClick:()=>{a()},children:o("sizeConfirm.approve")})]})]})})}function ls(e){return e==null||e===""?"-":String(e)}function uO(){const{t:e}=ge(),a=w(h=>h.metadataRestore),i=w(h=>h.applyMetadataRestore),o=w(h=>h.addMetadataRestoreAsReference),s=w(h=>h.cancelMetadataRestore),c=uo(!!a,s);if(!a)return null;const m=a.metadata,p=m.userPrompt||m.prompt||m.revisedPrompt||"";return d.jsx("div",{className:"modal-backdrop metadata-restore-backdrop",role:"presentation",children:d.jsxs("div",{ref:c,className:"modal metadata-restore",role:"dialog","aria-modal":"true","aria-labelledby":"metadata-restore-title",tabIndex:-1,children:[d.jsx("div",{id:"metadata-restore-title",className:"modal__title",children:e("metadata.restoreTitle")}),d.jsxs("div",{className:"modal__body metadata-restore__body",children:[d.jsx("p",{children:e("metadata.restoreBody")}),d.jsxs("div",{className:"metadata-restore__preview",children:[d.jsx("img",{src:a.image,alt:e("metadata.imageAlt")}),d.jsxs("div",{className:"metadata-restore__details",children:[d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.prompt")}),d.jsx("strong",{title:p,children:ls(p)})]}),d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.size")}),d.jsx("strong",{children:ls(m.size)})]}),d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.quality")}),d.jsx("strong",{children:ls(m.quality)})]}),d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.model")}),d.jsx("strong",{children:ls(m.model)})]}),d.jsxs("div",{children:[d.jsx("span",{children:e("metadata.source")}),d.jsx("strong",{children:a.source==="png-comment"?e("metadata.sourcePngComment"):e("metadata.sourceXmp")})]})]})]})]}),d.jsxs("div",{className:"modal__actions",children:[d.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:s,"data-modal-initial-focus":!0,children:e("common.cancel")}),d.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:o,children:e("metadata.useAsReferenceOnly")}),d.jsx("button",{type:"button",className:"modal__btn",onClick:i,children:e("metadata.applySettings")})]})]})})}function mO(){const{t:e}=ge(),a=w(P=>P.readinessPopupOpen),i=w(P=>P.closeReadinessPopup),o=w(P=>P.openSettings),s=w(P=>P.provider),c=w(P=>P.imageModel),m=w(P=>P.reasoningEffort),p=w(P=>P.webSearchEnabled),h=_S(),g=s==="grok",S=Na.find(P=>P.value===c),v=uo(a,i);if(!a)return null;const y=h[s],x=y.ok,E=()=>{i(),o("providers")};return d.jsx("div",{className:"modal-backdrop provider-readiness-backdrop",onClick:i,role:"presentation",children:d.jsxs("div",{ref:v,className:"modal provider-readiness",role:"dialog","aria-modal":"true","aria-labelledby":"provider-readiness-title",tabIndex:-1,onClick:P=>P.stopPropagation(),children:[d.jsx("div",{id:"provider-readiness-title",className:"modal__title",children:e("readiness.title")}),d.jsxs("div",{className:"modal__body provider-readiness__body",children:[d.jsxs("div",{className:`provider-readiness__status${x?" is-ok":" is-blocked"}`,children:[d.jsx("span",{"aria-hidden":"true"}),d.jsx("strong",{children:e(x?"readiness.ready":"readiness.blocked")}),d.jsx("small",{children:x?e("readiness.readyBody"):y.reason})]}),y.hint?d.jsx("p",{className:"modal__hint",children:y.hint}):null,d.jsxs("dl",{className:"provider-readiness__facts",children:[d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.provider")}),d.jsx("dd",{children:s==="agy"?"Gemini":s==="grok"?"Grok OAuth":s==="oauth"?"GPT OAuth":"GPT API"})]}),d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.model")}),d.jsx("dd",{children:S?e(S.fullLabelKey):c})]}),g?d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.grokApi")}),d.jsx("dd",{children:e("readiness.grokApiBody")})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.reasoning")}),d.jsx("dd",{children:m})]}),d.jsxs("div",{children:[d.jsx("dt",{children:e("readiness.webSearch")}),d.jsx("dd",{children:e(p?"settings.webSearch.on":"settings.webSearch.off")})]})]})]})]}),d.jsxs("div",{className:"modal__actions",children:[d.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:i,"data-modal-initial-focus":!0,children:e("common.close")}),d.jsx("button",{type:"button",className:"modal__btn",onClick:E,children:e("readiness.openAccount")})]})]})})}const lv="ima2.onboardingDismissed";function pO(){const{t:e}=ge(),a=w(I=>I.openSettings),i=RS(),o=NS(),{data:s}=kS(),[c,m]=R.useState(()=>{try{return localStorage.getItem(lv)==="1"}catch{return!1}}),p=i!==null&&o!==null&&s!=null,h=i?.status==="auth_required"||i?.status==="offline",g=o?.status==="offline"||o?.status==="error",S=s?!s.gemini?.configured&&!s.vertex?.configured:!1,y=!c&&(p&&h&&g&&S),x=()=>{try{localStorage.setItem(lv,"1")}catch{}m(!0)},E=()=>{x(),a("providers")},P=uo(y,x);return y?d.jsx("div",{className:"modal-backdrop",role:"presentation",children:d.jsxs("div",{ref:P,className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-title",tabIndex:-1,children:[d.jsx("div",{id:"onboarding-title",className:"modal__title",children:e("onboarding.title")}),d.jsx("div",{className:"modal__body",children:d.jsx("p",{children:e("onboarding.body")})}),d.jsxs("div",{className:"modal__actions",children:[d.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:x,"data-modal-initial-focus":!0,children:e("onboarding.skip")}),d.jsx("button",{type:"button",className:"modal__btn",onClick:E,children:e("onboarding.login")})]})]})}):null}function fO(){const e=w(m=>m.trashPending),a=w(m=>m.restorePendingTrash),i=w(m=>m.clearPendingTrash),{t:o}=ge(),[s,c]=R.useState(Date.now());return R.useEffect(()=>{if(!e)return;c(Date.now());const m=window.setInterval(()=>{const p=Date.now();c(p),p>=e.expiresAt&&i()},500);return()=>window.clearInterval(m)},[i,e]),e?d.jsxs("div",{className:"trash-undo-toast",children:[d.jsx("span",{children:o("gallery.deleted",{filename:e.filename})}),d.jsx("button",{type:"button",onClick:()=>{a()},children:o("gallery.undo")}),d.jsx("span",{className:"trash-undo-toast__timer",children:o("gallery.secondsSuffix",{n:Math.max(0,Math.ceil((e.expiresAt-s)/1e3))})})]}):null}function gO(){return d.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("line",{x1:"4",y1:"6",x2:"14",y2:"6"}),d.jsx("circle",{cx:"17",cy:"6",r:"2.2"}),d.jsx("line",{x1:"4",y1:"12",x2:"8",y2:"12"}),d.jsx("circle",{cx:"11",cy:"12",r:"2.2"}),d.jsx("line",{x1:"14",y1:"12",x2:"20",y2:"12"}),d.jsx("line",{x1:"4",y1:"18",x2:"14",y2:"18"}),d.jsx("circle",{cx:"17",cy:"18",r:"2.2"})]})}function hO(){const e=w(g=>g.composeSheetOpen),a=w(g=>g.composeSheetTab),i=w(g=>g.openComposeSheet),o=w(g=>g.settingsOpen),s=w(g=>g.uiMode),{t:c}=ge();if(!ka()||o||s==="home"||s==="card-news"||s==="agent"||s==="assets"||s==="asset-gen")return null;const p=e&&a==="controls",h=c("sheet.controlsOpen");return d.jsx("button",{type:"button",className:"mobile-settings-toggle","aria-expanded":p,"aria-controls":"mobile-generate-sheet","aria-label":h,title:h,onClick:()=>i("controls"),children:d.jsx(gO,{})})}let ks=null;function yO(e){ks=e}function vO(){const e=ks;ks=null,e?.isConnected&&e.focus()}function sv(){ks=null}function bO(){const{t:e}=ge(),a=w(S=>S.openComposeSheet),i=w(S=>S.settingsOpen),o=w(S=>S.uiMode),s=o==="agent"&&lr?"agent":o==="node"&&ir?"node":o==="home"?"home":o==="assets"?"assets":o==="asset-gen"?"asset-gen":"classic",c=ka(),m=R.useRef(null),p=R.useRef(null),h=R.useRef(null),g=(S,v)=>{v.current&&yO(v.current),a(S==="library"?"library":S==="controls"?"controls":"prompt")};return!c||i||s!=="classic"?null:d.jsxs("header",{className:"mobile-app-bar",role:"banner",children:[d.jsxs("div",{className:"mobile-app-bar__brand",children:[d.jsx("div",{className:"logo-mark","aria-hidden":"true"}),d.jsxs("div",{className:"mobile-app-bar__brand-copy",children:[d.jsx("span",{className:"mobile-app-bar__title",children:"ima2-gen"}),d.jsx("span",{className:"mobile-app-bar__mode",children:e("appBar.modeImage")})]})]}),d.jsxs("div",{className:"mobile-app-bar__actions",children:[d.jsx(AS,{compact:!0}),d.jsx("button",{ref:m,type:"button",className:"mobile-app-bar__icon-button",onClick:()=>g("library",m),"aria-label":e("promptLibrary.title"),title:e("promptLibrary.title"),children:d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})})}),d.jsx("button",{ref:p,type:"button",className:"mobile-app-bar__icon-button",onClick:()=>g("controls",p),"aria-label":e("appBar.controls"),title:e("appBar.controls"),children:d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"3"}),d.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),d.jsx("button",{ref:h,type:"button",className:"mobile-app-bar__generate",onClick:()=>g("prompt",h),"aria-label":e("appBar.generateAria"),title:e("appBar.generate"),style:{width:44,padding:0},children:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M12 3l1.8 5.4L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.6L12 3z"}),d.jsx("path",{d:"M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8L19 15z"})]})})]})]})}const SO={"#home":"home","#create":"classic","#canvas":"classic","#node":"node","#agent":"agent","#assets":"assets","#asset-gen":"asset-gen"},cv={home:"#home",classic:"#create",node:"#node",agent:"#agent",assets:"#assets","asset-gen":"#asset-gen"};function xO(){const e=location.hash;if(e==="#settings")return{mode:"classic",settings:!0};const a=SO[e];return a&&a!=="settings"?{mode:a,settings:!1}:null}function AO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),d.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),d.jsx("path",{d:"m21 15-5-5L5 21"})]})}function TO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),d.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]})}function CO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"2",y:"6",width:"8",height:"6",rx:"1"}),d.jsx("rect",{x:"14",y:"12",width:"8",height:"6",rx:"1"}),d.jsx("path",{d:"M10 9h4"}),d.jsx("path",{d:"M14 15V9a2 2 0 0 1 2-2h0"})]})}function wO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"2.5",fill:"currentColor",stroke:"none"}),d.jsx("ellipse",{cx:"12",cy:"12",rx:"9",ry:"4",transform:"rotate(-30 12 12)"}),d.jsx("ellipse",{cx:"12",cy:"12",rx:"9",ry:"4",transform:"rotate(30 12 12)"})]})}function IO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function EO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}),d.jsx("path",{d:"M8 12h8"})]})}function RO(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"3",y:"3",width:"13",height:"13",rx:"2"}),d.jsx("path",{d:"M3 12l3.5-3.5a1.4 1.4 0 0 1 2 0L13 13"}),d.jsx("path",{d:"M19 14v6"}),d.jsx("path",{d:"M16 17h6"})]})}const NO=[{id:"home",mode:"home",icon:TO,labelKey:"nav.home",enabled:!0},{id:"create",mode:"classic",icon:AO,labelKey:"nav.create",enabled:!0},{id:"node",mode:"node",icon:CO,labelKey:"nav.node",enabled:ir},{id:"agent",mode:"agent",icon:wO,labelKey:"nav.agent",enabled:lr},{id:"assets",mode:"assets",icon:EO,labelKey:"nav.assets",enabled:!0},{id:"asset-gen",mode:"asset-gen",icon:RO,labelKey:"nav.assetGen",enabled:!0},{id:"settings",settingsAction:!0,icon:IO,labelKey:"nav.settings",enabled:!0,bottom:!0}];function kO(){const{t:e}=ge(),a=w(x=>x.uiMode),i=w(x=>x.setUIMode),o=w(x=>x.settingsOpen),s=w(x=>x.openSettings),c=w(x=>x.closeSettings),m=ka(),p=R.useCallback(x=>{if(x.settingsAction){o?(c(),history.replaceState(null,"",cv[a]||"#create")):(s(),history.replaceState(null,"","#settings"));return}x.mode&&(o&&c(),i(x.mode),history.replaceState(null,"",cv[x.mode]||"#create"))},[a,o,i,s,c]);R.useEffect(()=>{const x=()=>{const E=xO();E&&(E.settings?s():(o&&c(),i(E.mode)))};return x(),window.addEventListener("popstate",x),window.addEventListener("hashchange",x),()=>{window.removeEventListener("popstate",x),window.removeEventListener("hashchange",x)}},[]);const h=NO.filter(x=>x.enabled),g=h.filter(x=>!x.bottom),S=h.filter(x=>x.bottom),v=x=>x.settingsAction?o:!o&&x.mode===a,y=x=>d.jsxs("button",{type:"button",className:`nav-rail__btn${v(x)?" is-active":""}`,onClick:()=>p(x),"aria-label":e(x.labelKey),"aria-current":v(x)?"page":void 0,children:[d.jsx(x.icon,{}),d.jsx("span",{className:"nav-rail__label","aria-hidden":"true",children:e(x.labelKey)})]},x.id);return m?d.jsx("nav",{className:"nav-rail nav-rail--mobile","aria-label":e("nav.ariaLabel"),children:h.map(y)}):d.jsxs("nav",{className:"nav-rail","aria-label":e("nav.ariaLabel"),children:[d.jsx("div",{className:"nav-rail__top",children:g.map(y)}),d.jsx("div",{className:"nav-rail__bottom",children:S.map(y)})]})}const _O=R.lazy(()=>$t(()=>import("./PromptLibraryPanel-DCtxfzy1.js"),[]).then(e=>({default:e.PromptLibraryPanel}))),Rn=["prompt","controls","library"],ss="mobile-inflight-panel",cs=e=>`mobile-sheet-tab-${e}`,ds=e=>`mobile-sheet-panel-${e}`;function MO(){const{t:e}=ge(),a=w(N=>N.composeSheetOpen),i=w(N=>N.composeSheetTab),o=w(N=>N.setComposeSheetTab),s=w(N=>N.closeComposeSheet),c=w(N=>N.inFlight.length),m=w(N=>N.settingsOpen),p=w(N=>N.uiMode),h=p==="agent"&&lr?"agent":p==="node"&&ir?"node":p==="home"?"home":p==="assets"?"assets":"classic",g=ka(),[S,v]=R.useState(!1),y=R.useRef(c),x=R.useRef(!1),E=R.useRef(null),P=R.useRef({}),I=R.useRef(!1),k=N=>{o(N),requestAnimationFrame(()=>P.current[N]?.focus())},C=(N,j)=>{const $=Rn.indexOf(j),L=N.key==="ArrowRight"?Rn[($+1)%Rn.length]:N.key==="ArrowLeft"?Rn[($-1+Rn.length)%Rn.length]:N.key==="Home"?Rn[0]:N.key==="End"?Rn[Rn.length-1]:null;L&&(N.preventDefault(),k(L))};R.useEffect(()=>{if((!a||i!=="prompt"||!g||m||h!=="classic")&&v(!1),!a)return;const N=j=>{j.key==="Escape"&&s()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[a,i,s,g,m,h]),R.useLayoutEffect(()=>{const N=y.current>0&&c===0;y.current=c,N&&(v(!1),x.current&&E.current?.querySelector(".generate-btn")?.focus(),x.current=!1)},[c]),R.useLayoutEffect(()=>{if(a){I.current=!0;const N=requestAnimationFrame(()=>P.current[i]?.focus());return()=>cancelAnimationFrame(N)}I.current&&(I.current=!1,vO())},[a,i]);const _=g&&!m&&h==="classic";return R.useEffect(()=>{_||(I.current=!1,w.getState().composeSheetOpen&&s(),sv())},[_]),R.useEffect(()=>()=>sv(),[]),_?d.jsxs(d.Fragment,{children:[a?d.jsx("button",{type:"button",className:"compose-sheet-backdrop","aria-label":e("sheet.close"),onClick:s}):null,d.jsxs("section",{id:"mobile-generate-sheet",inert:!a,className:`compose-sheet${a?" compose-sheet--open":""}`,role:"dialog","aria-modal":a?"true":"false","aria-label":e("sheet.generate"),"aria-hidden":!a,children:[d.jsx("button",{type:"button",className:"compose-sheet__handle",onClick:s,"aria-label":e("sheet.close")}),d.jsx("div",{className:"mobile-sheet-tabs",role:"tablist","aria-label":e("sheet.generate"),children:Rn.map(N=>d.jsx("button",{ref:j=>{P.current[N]=j},id:cs(N),type:"button",role:"tab","aria-selected":i===N,"aria-controls":ds(N),tabIndex:i===N?0:-1,className:`mobile-sheet-tabs__button${i===N?" active":""}`,onClick:()=>o(N),onKeyDown:j=>C(j,N),children:e(`sheet.tabs.${N}`)},N))}),d.jsxs("div",{className:"compose-sheet__body",children:[d.jsx("div",{id:ds("prompt"),className:"compose-sheet__panel compose-sheet__panel--prompt",role:"tabpanel","aria-labelledby":cs("prompt"),hidden:i!=="prompt",onFocusCapture:N=>{const j=document.getElementById(ss);x.current=j?.contains(N.target)??!1},children:i==="prompt"?d.jsxs(d.Fragment,{children:[d.jsx(qm,{}),c>0?d.jsxs("section",{className:"compose-sheet__inflight",hidden:!S,children:[d.jsxs("button",{type:"button",className:"compose-sheet__inflight-header",onClick:()=>{E.current?.querySelector(".inflight-badge")?.focus(),v(!1)},"aria-expanded":S,"aria-controls":ss,"aria-label":e("inflight.inlineCollapse",{n:c}),children:[d.jsxs("span",{children:[e("inflight.title")," (",c,")"]}),d.jsx("span",{"aria-hidden":"true",children:"−"})]}),d.jsx(Hm,{variant:"inline",panelId:ss}),d.jsx("p",{className:"compose-sheet__inflight-footer",children:e("inflight.footerHint")})]}):null,d.jsxs("div",{ref:E,className:"compose-sheet__actions",children:[d.jsx(Um,{}),d.jsx(xS,{variant:"inline",panelId:ss,expanded:S,onToggle:v})]})]}):null}),d.jsx("div",{id:ds("controls"),className:"compose-sheet__panel compose-sheet__panel--controls",role:"tabpanel","aria-labelledby":cs("controls"),hidden:i!=="controls",children:i==="controls"?d.jsx(OS,{}):null}),d.jsx("div",{id:ds("library"),className:"compose-sheet__panel compose-sheet__panel--library",role:"tabpanel","aria-labelledby":cs("library"),hidden:i!=="library",children:i==="library"?d.jsx(R.Suspense,{fallback:d.jsx("div",{className:"prompt-library-panel__loading",children:e("common.loading")}),children:d.jsx(_O,{variant:"embedded",forceOpen:!0,onRequestClose:()=>o("prompt")})}):null})]})]})]}):null}const PO={ArrowLeft:"previous",ArrowRight:"next",Home:"first",End:"last",PageUp:"pagePrevious",PageDown:"pageNext"};function LO(){const e=w(o=>o.uiMode),a=w(o=>!!o.currentImage||!!o.multimodePreviewFlightId),i=w(o=>o.selectHistoryShortcutTarget);R.useEffect(()=>{if(e!=="classic")return;const o=s=>{const c=PO[s.key];c&&(s.defaultPrevented||ys(s.target)||a&&(s.preventDefault(),i(c)))};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a,i,e])}const us=64,DS="Image Gen";let Km=DS,tm=!1,Ia=null,$m="",nm=!1;function FS(){return navigator}function zS(){if(typeof document>"u")return null;if(Ia)return Ia;const e=document.querySelector('link[rel~="icon"]');if(e)return Ia=e,$m=e.href||e.getAttribute("href")||"",e;const a=document.createElement("link");return a.rel="icon",document.head.appendChild(a),Ia=a,nm=!0,a}function OO(e){const a=document.createElement("canvas");a.width=us,a.height=us;const i=a.getContext("2d");return i?(i.clearRect(0,0,us,us),i.fillStyle="#0a0a0a",jO(i,6,6,52,52,12),i.fill(),i.strokeStyle="#ffffff",i.lineWidth=5,i.beginPath(),i.arc(30,32,14,0,Math.PI*2),i.stroke(),i.fillStyle="#ffffff",i.beginPath(),i.arc(30,32,5,0,Math.PI*2),i.fill(),i.beginPath(),i.arc(48,16,e>1?13:10,0,Math.PI*2),i.fillStyle="#ff335f",i.fill(),i.lineWidth=4,i.strokeStyle="#ffffff",i.stroke(),e>1&&(i.fillStyle="#ffffff",i.font="bold 15px sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText(String(Math.min(e,9)),48,17)),a.toDataURL("image/png")):$m}function jO(e,a,i,o,s,c){e.beginPath(),e.moveTo(a+c,i),e.arcTo(a+o,i,a+o,i+s,c),e.arcTo(a+o,i+s,a,i+s,c),e.arcTo(a,i+s,a,i,c),e.arcTo(a,i,a+o,i,c),e.closePath()}async function GO(e){const a=FS();if(typeof a.setAppBadge=="function")try{await a.setAppBadge(e)}catch{}}async function DO(){const e=FS();if(typeof e.clearAppBadge=="function")try{await e.clearAppBadge()}catch{}}function FO(e){document.title=`(${e}) ${Km}`;const a=zS();a&&(a.href=OO(e)),GO(e)}function dv(){document.title=Km,Ia&&(nm?(Ia.remove(),Ia=null,nm=!1):Ia.href=$m),DO()}function uv(){tm||typeof document>"u"||(tm=!0,Km=document.title||DS,zS())}function zO(e){R.useEffect(()=>(uv(),()=>{tm&&dv()}),[]),R.useEffect(()=>{uv(),e>0?FO(e):dv()},[e])}function qO(){R.useEffect(()=>{if(typeof window>"u")return;const e=window.visualViewport;if(!e)return;const a=()=>{const i=Math.round(e.height),o=Math.round(e.offsetTop);document.documentElement.style.setProperty("--vv-h",`${i}px`),document.documentElement.style.setProperty("--vv-offset-top",`${o}px`)};return a(),e.addEventListener("resize",a),e.addEventListener("scroll",a),()=>{e.removeEventListener("resize",a),e.removeEventListener("scroll",a)}},[])}const UO=R.lazy(()=>$t(()=>import("./NodeCanvas-CaFDJn_9.js"),__vite__mapDeps([0,1])).then(e=>({default:e.NodeCanvas}))),HO=R.lazy(()=>$t(()=>import("./SettingsWorkspace-aHoTeB4-.js"),[]).then(e=>({default:e.SettingsWorkspace}))),BO=R.lazy(()=>$t(()=>import("./CardNewsWorkspace-DIhk26qD.js"),[]).then(e=>({default:e.CardNewsWorkspace}))),VO=R.lazy(()=>$t(()=>import("./AgentWorkspace-DU9efUdT.js"),__vite__mapDeps([2,3])).then(e=>({default:e.AgentWorkspace}))),KO=R.lazy(()=>$t(()=>import("./AssetsWorkspace-D_kJ7dP_.js"),__vite__mapDeps([4,5,3,6])).then(e=>({default:e.AssetsWorkspace}))),$O=R.lazy(()=>$t(()=>import("./AssetGenWorkspace-ldEVBldg.js").then(e=>e.A),__vite__mapDeps([7,5,3,8])).then(e=>({default:e.AssetGenWorkspace}))),YO=R.lazy(()=>$t(()=>import("./HomeWorkspace-DwRS4Cim.js"),[]).then(e=>({default:e.HomeWorkspace}))),XO=R.lazy(()=>$t(()=>import("./PromptLibraryPanel-DCtxfzy1.js"),[]).then(e=>({default:e.PromptLibraryPanel})));function QO(){return d.jsx("main",{className:"canvas canvas--lazy-loading","aria-busy":"true"})}function JO(){LO(),qO();const{locale:e}=ge(),a=w(j=>j.hydrateHistory),i=w(j=>j.loadSessions),o=w(j=>j.syncCapabilities),s=w(j=>j.startInFlightPolling),c=w(j=>j.reconcileInflight),m=w(j=>j.syncFromStorage),p=w(j=>j.settingsOpen),h=w(j=>j.unseenGeneratedCount),g=w(j=>j.historyStripLayout),S=w(j=>j.workspaceProfile),v=w(j=>j.uiMode),y=v==="agent"&&lr?"agent":v==="node"&&ir?"node":v==="home"?"home":v==="assets"?"assets":v==="asset-gen"?"asset-gen":"classic",x=y==="agent",E=y==="assets",P=y==="asset-gen",I=y==="home",k=ka(),C=Ei(S),_=!k&&y==="classic"&&C.composerPlacement==="bottom"&&C.multimodeHistoryGrouping==="sequence",N=!_&&!x&&!E&&!P&&!I;return zO(h),R.useEffect(()=>{document.documentElement.lang=e},[e]),R.useEffect(()=>{o(),a(),i(),c(),s(),lo(),CT(()=>c()),wT(j=>{j==="failed"&&console.warn("[SSE] connection failed after multiple retries")})},[a,i,c,s,o]),R.useEffect(()=>{const j=$=>{const L=$.detail?.assetId;L&&w.getState().openAssetDetail(L)};return window.addEventListener("ima2:open-assets-detail",j),()=>window.removeEventListener("ima2:open-assets-detail",j)},[]),R.useEffect(()=>{const j=$=>{$.key&&($.key==="ima2.inFlight"||$.key==="ima2.selectedFilename")&&m()};return window.addEventListener("storage",j),()=>window.removeEventListener("storage",j)},[m]),R.useEffect(()=>{const j=()=>{o1(w.getState)};return window.addEventListener("beforeunload",j),()=>{window.removeEventListener("beforeunload",j)}},[]),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:`app${S==="prompt-studio"?" app--prompt-studio":""}${p?" app--settings-open":""}${N&&g==="horizontal"?" app--history-horizontal":""}${N&&g==="sidebar"?" app--history-sidebar":""}`,"data-history-strip-layout":g,"data-mobile":k?"1":void 0,"data-ui-mode":y,children:[d.jsx(kO,{}),I?null:d.jsx(P2,{}),d.jsx(bO,{}),N?d.jsx(SL,{}):null,d.jsx(R.Suspense,{fallback:d.jsx(QO,{}),children:p?d.jsx(HO,{}):y==="classic"?_?d.jsx(bP,{}):d.jsx(em,{}):y==="node"?d.jsx(UO,{}):y==="card-news"?d.jsx(BO,{}):y==="agent"?d.jsx(VO,{}):y==="assets"?d.jsx(KO,{}):y==="asset-gen"?d.jsx($O,{}):y==="home"?d.jsx(YO,{}):d.jsx(em,{})}),y==="agent"||y==="card-news"||y==="assets"||y==="asset-gen"||y==="home"?null:d.jsx(fL,{})]}),d.jsx(dO,{}),d.jsx(fO,{}),d.jsx(xL,{}),d.jsx(AL,{}),d.jsx(sO,{}),d.jsx(uO,{}),d.jsx(mO,{}),d.jsx(pO,{}),d.jsx(MO,{}),d.jsx(hO,{}),y==="card-news"?d.jsx(R.Suspense,{fallback:null,children:d.jsx(XO,{})}):null]})}function WO(){if(window.location.protocol!=="http:"||window.location.hostname!=="localhost")return!1;const e=new URL(window.location.href);return e.hostname="127.0.0.1",window.location.replace(e.toString()),!0}WO()||cT.createRoot(document.getElementById("root")).render(d.jsx(R.StrictMode,{children:d.jsx(JO,{})}));export{ZL as $,$u as A,vs as B,Js as C,i0 as D,Cj as E,xn as F,r0 as G,cS as H,Na as I,Rj as J,Nj as K,kj as L,vt as M,gL as N,o0 as O,tR as P,Eb as Q,Hl as R,HM as S,CM as T,Tj as U,d0 as V,BM as W,Ij as X,JT as Y,bj as Z,_1 as _,R as a,vS as a0,_j as a1,Pj as a2,Mj as a3,Aj as a4,Ej as a5,im as a6,_b as a7,IL as a8,Hm as a9,ej as aA,sj as aB,aj as aC,z2 as aD,nj as aE,dP as aF,pv as aG,tj as aH,Z as aI,uj as aJ,cj as aK,mj as aL,pj as aM,dj as aN,ZO as aO,fj as aP,gj as aQ,hj as aR,yj as aS,vj as aT,$t as aa,xj as ab,io as ac,Sj as ad,Ks as ae,zm as af,yS as ag,Ot as ah,_S as ai,AO as aj,CO as ak,ir as al,wO as am,lr as an,EO as ao,cv as ap,uo as aq,TM as ar,sP as as,cP as at,Zu as au,ij as av,rj as aw,ys as ax,lj as ay,oj as az,w as b,Cv as c,ML as d,p1 as e,WE as f,eT as g,Mn as h,kn as i,d as j,ro as k,wj as l,M1 as m,u1 as n,kb as o,QT as p,ue as q,am as r,ka as s,tr as t,ge as u,RS as v,XR as w,NS as x,PP as y,kS as z};
|