ima2-gen 1.1.13 → 1.1.14
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/README.md +10 -1
- package/bin/commands/doctor.js +195 -0
- package/bin/commands/doctor.ts +202 -0
- package/bin/ima2.js +3 -105
- package/bin/ima2.ts +3 -109
- package/config.js +1 -0
- package/config.ts +5 -0
- package/docs/CLI.md +36 -0
- package/docs/FAQ.ko.md +82 -2
- package/docs/FAQ.md +85 -2
- package/docs/PROMPT_STUDIO.ko.md +111 -0
- package/docs/PROMPT_STUDIO.md +115 -0
- package/docs/README.ko.md +8 -1
- package/docs/migration/runtime-test-inventory.md +6 -1
- package/lib/agentRuntime.js +9 -2
- package/lib/agentRuntime.ts +8 -2
- package/lib/errorClassify.js +1 -1
- package/lib/errorClassify.ts +1 -1
- package/lib/generationErrors.js +121 -23
- package/lib/generationErrors.ts +100 -13
- package/lib/responsesDoctor.js +386 -0
- package/lib/responsesDoctor.ts +456 -0
- package/lib/responsesErrors.js +57 -0
- package/lib/responsesErrors.ts +83 -0
- package/lib/responsesFallback.js +72 -0
- package/lib/responsesFallback.ts +114 -0
- package/lib/responsesImageAdapter.js +121 -174
- package/lib/responsesImageAdapter.ts +136 -211
- package/lib/responsesParse.js +324 -0
- package/lib/responsesParse.ts +452 -0
- package/lib/responsesTools.js +15 -0
- package/lib/responsesTools.ts +28 -0
- package/package.json +1 -1
- package/routes/edit.js +26 -1
- package/routes/edit.ts +26 -1
- package/routes/generate.js +40 -0
- package/routes/generate.ts +47 -0
- package/ui/dist/.vite/manifest.json +12 -12
- package/ui/dist/assets/{AgentWorkspace-BJe9yxPA.js → AgentWorkspace-B6YNOZHi.js} +1 -1
- package/ui/dist/assets/{CardNewsWorkspace-BBLdwzYU.js → CardNewsWorkspace-EFVeg4l_.js} +1 -1
- package/ui/dist/assets/{NodeCanvas-BSZ527J4.js → NodeCanvas-iM6yjHvO.js} +1 -1
- package/ui/dist/assets/{PromptBuilderPanel-Y2VygFc0.js → PromptBuilderPanel-C3GdLDCl.js} +1 -1
- package/ui/dist/assets/{PromptImportDialog-C6lFV-LL.js → PromptImportDialog-DS9vrc_w.js} +2 -2
- package/ui/dist/assets/{PromptImportDiscoverySection-D8YJFhND.js → PromptImportDiscoverySection-DHFEt_FA.js} +1 -1
- package/ui/dist/assets/{PromptImportFolderSection-ywfcQolW.js → PromptImportFolderSection-BQxb1zs5.js} +1 -1
- package/ui/dist/assets/{PromptLibraryPanel-fk4KmrGy.js → PromptLibraryPanel-NhMKVGfU.js} +2 -2
- package/ui/dist/assets/{SettingsWorkspace-DL5vhAHQ.js → SettingsWorkspace-FjKjaDqj.js} +1 -1
- package/ui/dist/assets/index-BAN6lKgf.js +28 -0
- package/ui/dist/assets/{index-BLx55BOg.js → index-BbFZyM92.js} +1 -1
- package/ui/dist/assets/index-DK1faG9Z.css +1 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-ByViUJfx.css +0 -1
- package/ui/dist/assets/index-Ci36vcFD.js +0 -28
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NodeCanvas-BSZ527J4.js","assets/NodeCanvas-BZV40eAE.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&s(p)}).observe(document,{childList:!0,subtree:!0});function i(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(u){if(u.ep)return;u.ep=!0;const d=i(u);fetch(u.href,d)}})();function Vv(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Dc={exports:{}},hi={};var gp;function Xv(){if(gp)return hi;gp=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function i(s,u,d){var p=null;if(d!==void 0&&(p=""+d),u.key!==void 0&&(p=""+u.key),"key"in u){d={};for(var m in u)m!=="key"&&(d[m]=u[m])}else d=u;return u=d.ref,{$$typeof:l,type:s,key:p,ref:u!==void 0?u:null,props:d}}return hi.Fragment=o,hi.jsx=i,hi.jsxs=i,hi}var yp;function Kv(){return yp||(yp=1,Dc.exports=Xv()),Dc.exports}var f=Kv(),Lc={exports:{}},re={};var vp;function Qv(){if(vp)return re;vp=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),S=Symbol.iterator;function N(w){return w===null||typeof w!="object"?null:(w=S&&w[S]||w["@@iterator"],typeof w=="function"?w:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,F={};function Y(w,T,B){this.props=w,this.context=T,this.refs=F,this.updater=B||M}Y.prototype.isReactComponent={},Y.prototype.setState=function(w,T){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,T,"setState")},Y.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function X(){}X.prototype=Y.prototype;function Q(w,T,B){this.props=w,this.context=T,this.refs=F,this.updater=B||M}var D=Q.prototype=new X;D.constructor=Q,z(D,Y.prototype),D.isPureReactComponent=!0;var te=Array.isArray;function U(){}var $={H:null,A:null,T:null,S:null},Ce=Object.prototype.hasOwnProperty;function ae(w,T,B){var Z=B.ref;return{$$typeof:l,type:w,key:T,ref:Z!==void 0?Z:null,props:B}}function we(w,T){return ae(w.type,T,w.props)}function ke(w){return typeof w=="object"&&w!==null&&w.$$typeof===l}function Ie(w){var T={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(B){return T[B]})}var ct=/\/+/g;function Fe(w,T){return typeof w=="object"&&w!==null&&w.key!=null?Ie(""+w.key):T.toString(36)}function K(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(U,U):(w.status="pending",w.then(function(T){w.status==="pending"&&(w.status="fulfilled",w.value=T)},function(T){w.status==="pending"&&(w.status="rejected",w.reason=T)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function A(w,T,B,Z,ie){var oe=typeof w;(oe==="undefined"||oe==="boolean")&&(w=null);var ge=!1;if(w===null)ge=!0;else switch(oe){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(w.$$typeof){case l:case o:ge=!0;break;case x:return ge=w._init,A(ge(w._payload),T,B,Z,ie)}}if(ge)return ie=ie(w),ge=Z===""?"."+Fe(w,0):Z,te(ie)?(B="",ge!=null&&(B=ge.replace(ct,"$&/")+"/"),A(ie,T,B,"",function(Ja){return Ja})):ie!=null&&(ke(ie)&&(ie=we(ie,B+(ie.key==null||w&&w.key===ie.key?"":(""+ie.key).replace(ct,"$&/")+"/")+ge)),T.push(ie)),1;ge=0;var Ze=Z===""?".":Z+":";if(te(w))for(var He=0;He<w.length;He++)Z=w[He],oe=Ze+Fe(Z,He),ge+=A(Z,T,B,oe,ie);else if(He=N(w),typeof He=="function")for(w=He.call(w),He=0;!(Z=w.next()).done;)Z=Z.value,oe=Ze+Fe(Z,He++),ge+=A(Z,T,B,oe,ie);else if(oe==="object"){if(typeof w.then=="function")return A(K(w),T,B,Z,ie);throw T=String(w),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return ge}function V(w,T,B){if(w==null)return w;var Z=[],ie=0;return A(w,Z,"","",function(oe){return T.call(B,oe,ie++)}),Z}function ne(w){if(w._status===-1){var T=w._result;T=T(),T.then(function(B){(w._status===0||w._status===-1)&&(w._status=1,w._result=B)},function(B){(w._status===0||w._status===-1)&&(w._status=2,w._result=B)}),w._status===-1&&(w._status=0,w._result=T)}if(w._status===1)return w._result.default;throw w._result}var xe=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},Ne={map:V,forEach:function(w,T,B){V(w,function(){T.apply(this,arguments)},B)},count:function(w){var T=0;return V(w,function(){T++}),T},toArray:function(w){return V(w,function(T){return T})||[]},only:function(w){if(!ke(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return re.Activity=b,re.Children=Ne,re.Component=Y,re.Fragment=i,re.Profiler=u,re.PureComponent=Q,re.StrictMode=s,re.Suspense=y,re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,re.__COMPILER_RUNTIME={__proto__:null,c:function(w){return $.H.useMemoCache(w)}},re.cache=function(w){return function(){return w.apply(null,arguments)}},re.cacheSignal=function(){return null},re.cloneElement=function(w,T,B){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var Z=z({},w.props),ie=w.key;if(T!=null)for(oe in T.key!==void 0&&(ie=""+T.key),T)!Ce.call(T,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&T.ref===void 0||(Z[oe]=T[oe]);var oe=arguments.length-2;if(oe===1)Z.children=B;else if(1<oe){for(var ge=Array(oe),Ze=0;Ze<oe;Ze++)ge[Ze]=arguments[Ze+2];Z.children=ge}return ae(w.type,ie,Z)},re.createContext=function(w){return w={$$typeof:p,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:d,_context:w},w},re.createElement=function(w,T,B){var Z,ie={},oe=null;if(T!=null)for(Z in T.key!==void 0&&(oe=""+T.key),T)Ce.call(T,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ie[Z]=T[Z]);var ge=arguments.length-2;if(ge===1)ie.children=B;else if(1<ge){for(var Ze=Array(ge),He=0;He<ge;He++)Ze[He]=arguments[He+2];ie.children=Ze}if(w&&w.defaultProps)for(Z in ge=w.defaultProps,ge)ie[Z]===void 0&&(ie[Z]=ge[Z]);return ae(w,oe,ie)},re.createRef=function(){return{current:null}},re.forwardRef=function(w){return{$$typeof:m,render:w}},re.isValidElement=ke,re.lazy=function(w){return{$$typeof:x,_payload:{_status:-1,_result:w},_init:ne}},re.memo=function(w,T){return{$$typeof:g,type:w,compare:T===void 0?null:T}},re.startTransition=function(w){var T=$.T,B={};$.T=B;try{var Z=w(),ie=$.S;ie!==null&&ie(B,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(U,xe)}catch(oe){xe(oe)}finally{T!==null&&B.types!==null&&(T.types=B.types),$.T=T}},re.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},re.use=function(w){return $.H.use(w)},re.useActionState=function(w,T,B){return $.H.useActionState(w,T,B)},re.useCallback=function(w,T){return $.H.useCallback(w,T)},re.useContext=function(w){return $.H.useContext(w)},re.useDebugValue=function(){},re.useDeferredValue=function(w,T){return $.H.useDeferredValue(w,T)},re.useEffect=function(w,T){return $.H.useEffect(w,T)},re.useEffectEvent=function(w){return $.H.useEffectEvent(w)},re.useId=function(){return $.H.useId()},re.useImperativeHandle=function(w,T,B){return $.H.useImperativeHandle(w,T,B)},re.useInsertionEffect=function(w,T){return $.H.useInsertionEffect(w,T)},re.useLayoutEffect=function(w,T){return $.H.useLayoutEffect(w,T)},re.useMemo=function(w,T){return $.H.useMemo(w,T)},re.useOptimistic=function(w,T){return $.H.useOptimistic(w,T)},re.useReducer=function(w,T,B){return $.H.useReducer(w,T,B)},re.useRef=function(w){return $.H.useRef(w)},re.useState=function(w){return $.H.useState(w)},re.useSyncExternalStore=function(w,T,B){return $.H.useSyncExternalStore(w,T,B)},re.useTransition=function(){return $.H.useTransition()},re.version="19.2.5",re}var bp;function ou(){return bp||(bp=1,Lc.exports=Qv()),Lc.exports}var q=ou();const Zs=Vv(q);var qc={exports:{}},gi={},Hc={exports:{}},kc={};var Sp;function Zv(){return Sp||(Sp=1,(function(l){function o(A,V){var ne=A.length;A.push(V);e:for(;0<ne;){var xe=ne-1>>>1,Ne=A[xe];if(0<u(Ne,V))A[xe]=V,A[ne]=Ne,ne=xe;else break e}}function i(A){return A.length===0?null:A[0]}function s(A){if(A.length===0)return null;var V=A[0],ne=A.pop();if(ne!==V){A[0]=ne;e:for(var xe=0,Ne=A.length,w=Ne>>>1;xe<w;){var T=2*(xe+1)-1,B=A[T],Z=T+1,ie=A[Z];if(0>u(B,ne))Z<Ne&&0>u(ie,B)?(A[xe]=ie,A[Z]=ne,xe=Z):(A[xe]=B,A[T]=ne,xe=T);else if(Z<Ne&&0>u(ie,ne))A[xe]=ie,A[Z]=ne,xe=Z;else break e}}return V}function u(A,V){var ne=A.sortIndex-V.sortIndex;return ne!==0?ne:A.id-V.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var p=Date,m=p.now();l.unstable_now=function(){return p.now()-m}}var y=[],g=[],x=1,b=null,S=3,N=!1,M=!1,z=!1,F=!1,Y=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function D(A){for(var V=i(g);V!==null;){if(V.callback===null)s(g);else if(V.startTime<=A)s(g),V.sortIndex=V.expirationTime,o(y,V);else break;V=i(g)}}function te(A){if(z=!1,D(A),!M)if(i(y)!==null)M=!0,U||(U=!0,Ie());else{var V=i(g);V!==null&&K(te,V.startTime-A)}}var U=!1,$=-1,Ce=5,ae=-1;function we(){return F?!0:!(l.unstable_now()-ae<Ce)}function ke(){if(F=!1,U){var A=l.unstable_now();ae=A;var V=!0;try{e:{M=!1,z&&(z=!1,X($),$=-1),N=!0;var ne=S;try{t:{for(D(A),b=i(y);b!==null&&!(b.expirationTime>A&&we());){var xe=b.callback;if(typeof xe=="function"){b.callback=null,S=b.priorityLevel;var Ne=xe(b.expirationTime<=A);if(A=l.unstable_now(),typeof Ne=="function"){b.callback=Ne,D(A),V=!0;break t}b===i(y)&&s(y),D(A)}else s(y);b=i(y)}if(b!==null)V=!0;else{var w=i(g);w!==null&&K(te,w.startTime-A),V=!1}}break e}finally{b=null,S=ne,N=!1}V=void 0}}finally{V?Ie():U=!1}}}var Ie;if(typeof Q=="function")Ie=function(){Q(ke)};else if(typeof MessageChannel<"u"){var ct=new MessageChannel,Fe=ct.port2;ct.port1.onmessage=ke,Ie=function(){Fe.postMessage(null)}}else Ie=function(){Y(ke,0)};function K(A,V){$=Y(function(){A(l.unstable_now())},V)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(A){A.callback=null},l.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ce=0<A?Math.floor(1e3/A):5},l.unstable_getCurrentPriorityLevel=function(){return S},l.unstable_next=function(A){switch(S){case 1:case 2:case 3:var V=3;break;default:V=S}var ne=S;S=V;try{return A()}finally{S=ne}},l.unstable_requestPaint=function(){F=!0},l.unstable_runWithPriority=function(A,V){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var ne=S;S=A;try{return V()}finally{S=ne}},l.unstable_scheduleCallback=function(A,V,ne){var xe=l.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?xe+ne:xe):ne=xe,A){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=ne+Ne,A={id:x++,callback:V,priorityLevel:A,startTime:ne,expirationTime:Ne,sortIndex:-1},ne>xe?(A.sortIndex=ne,o(g,A),i(y)===null&&A===i(g)&&(z?(X($),$=-1):z=!0,K(te,ne-xe))):(A.sortIndex=Ne,o(y,A),M||N||(M=!0,U||(U=!0,Ie()))),A},l.unstable_shouldYield=we,l.unstable_wrapCallback=function(A){var V=S;return function(){var ne=S;S=V;try{return A.apply(this,arguments)}finally{S=ne}}}})(kc)),kc}var xp;function Jv(){return xp||(xp=1,Hc.exports=Zv()),Hc.exports}var Gc={exports:{}},st={};var Np;function $v(){if(Np)return st;Np=1;var l=ou();function o(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(o(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(y,g,x){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:y,containerInfo:g,implementation:x}}var p=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return st.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,st.createPortal=function(y,g){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(o(299));return d(y,g,null,x)},st.flushSync=function(y){var g=p.T,x=s.p;try{if(p.T=null,s.p=2,y)return y()}finally{p.T=g,s.p=x,s.d.f()}},st.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(y,g))},st.prefetchDNS=function(y){typeof y=="string"&&s.d.D(y)},st.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var x=g.as,b=m(x,g.crossOrigin),S=typeof g.integrity=="string"?g.integrity:void 0,N=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?s.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:S,fetchPriority:N}):x==="script"&&s.d.X(y,{crossOrigin:b,integrity:S,fetchPriority:N,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},st.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var x=m(g.as,g.crossOrigin);s.d.M(y,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&s.d.M(y)},st.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,b=m(x,g.crossOrigin);s.d.L(y,x,{crossOrigin:b,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})}},st.preloadModule=function(y,g){if(typeof y=="string")if(g){var x=m(g.as,g.crossOrigin);s.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else s.d.m(y)},st.requestFormReset=function(y){s.d.r(y)},st.unstable_batchedUpdates=function(y,g){return y(g)},st.useFormState=function(y,g,x){return p.H.useFormState(y,g,x)},st.useFormStatus=function(){return p.H.useHostTransitionStatus()},st.version="19.2.5",st}var Ep;function _h(){if(Ep)return Gc.exports;Ep=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),Gc.exports=$v(),Gc.exports}var Tp;function Wv(){if(Tp)return gi;Tp=1;var l=Jv(),o=ou(),i=_h();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(d(e)!==e)throw Error(s(188))}function g(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(s(188));return t!==e?null:e}for(var a=e,n=t;;){var r=a.return;if(r===null)break;var c=r.alternate;if(c===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===c.child){for(c=r.child;c;){if(c===a)return y(r),e;if(c===n)return y(r),t;c=c.sibling}throw Error(s(188))}if(a.return!==n.return)a=r,n=c;else{for(var h=!1,v=r.child;v;){if(v===a){h=!0,a=r,n=c;break}if(v===n){h=!0,n=r,a=c;break}v=v.sibling}if(!h){for(v=c.child;v;){if(v===a){h=!0,a=c,n=r;break}if(v===n){h=!0,n=c,a=r;break}v=v.sibling}if(!h)throw Error(s(189))}}if(a.alternate!==n)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,S=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),Ce=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),ke=Symbol.iterator;function Ie(e){return e===null||typeof e!="object"?null:(e=ke&&e[ke]||e["@@iterator"],typeof e=="function"?e:null)}var ct=Symbol.for("react.client.reference");function Fe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ct?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case z:return"Fragment";case Y:return"Profiler";case F:return"StrictMode";case te:return"Suspense";case U:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case Q:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:Fe(e.type)||"Memo";case Ce:t=e._payload,e=e._init;try{return Fe(e(t))}catch{}}return null}var K=Array.isArray,A=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},xe=[],Ne=-1;function w(e){return{current:e}}function T(e){0>Ne||(e.current=xe[Ne],xe[Ne]=null,Ne--)}function B(e,t){Ne++,xe[Ne]=e.current,e.current=t}var Z=w(null),ie=w(null),oe=w(null),ge=w(null);function Ze(e,t){switch(B(oe,t),B(ie,e),B(Z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?km(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=km(t),e=Gm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}T(Z),B(Z,e)}function He(){T(Z),T(ie),T(oe)}function Ja(e){e.memoizedState!==null&&B(ge,e);var t=Z.current,a=Gm(t,e.type);t!==a&&(B(ie,e),B(Z,a))}function Cn(e){ie.current===e&&(T(Z),T(ie)),ge.current===e&&(T(ge),di._currentValue=ne)}var xl,Oi;function na(e){if(xl===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);xl=t&&t[1]||"",Oi=-1<a.stack.indexOf(`
|
|
3
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+xl+e+Oi}var Nl=!1;function wn(e,t){if(!e||Nl)return"";Nl=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(L){var I=L}Reflect.construct(e,[],G)}else{try{G.call()}catch(L){I=L}e.call(G.prototype)}}else{try{throw Error()}catch(L){I=L}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(L){if(L&&I&&typeof L.stack=="string")return[L.stack,I.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=n.DetermineComponentFrameRoot(),h=c[0],v=c[1];if(h&&v){var E=h.split(`
|
|
5
|
-
`),j=v.split(`
|
|
6
|
-
`);for(r=n=0;n<E.length&&!E[n].includes("DetermineComponentFrameRoot");)n++;for(;r<j.length&&!j[r].includes("DetermineComponentFrameRoot");)r++;if(n===E.length||r===j.length)for(n=E.length-1,r=j.length-1;1<=n&&0<=r&&E[n]!==j[r];)r--;for(;1<=n&&0<=r;n--,r--)if(E[n]!==j[r]){if(n!==1||r!==1)do if(n--,r--,0>r||E[n]!==j[r]){var H=`
|
|
7
|
-
`+E[n].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=n&&0<=r);break}}}finally{Nl=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?na(a):""}function $a(e,t){switch(e.tag){case 26:case 27:case 5:return na(e.type);case 16:return na("Lazy");case 13:return e.child!==t&&t!==null?na("Suspense Fallback"):na("Suspense");case 19:return na("SuspenseList");case 0:case 15:return wn(e.type,!1);case 11:return wn(e.type.render,!1);case 1:return wn(e.type,!0);case 31:return na("Activity");default:return""}}function ji(e){try{var t="",a=null;do t+=$a(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
8
|
-
Error generating stack: `+n.message+`
|
|
9
|
-
`+n.stack}}var P=Object.prototype.hasOwnProperty,Se=l.unstable_scheduleCallback,ut=l.unstable_cancelCallback,ve=l.unstable_shouldYield,Mt=l.unstable_requestPaint,Je=l.unstable_now,la=l.unstable_getCurrentPriorityLevel,gu=l.unstable_ImmediatePriority,yu=l.unstable_UserBlockingPriority,zi=l.unstable_NormalPriority,wg=l.unstable_LowPriority,vu=l.unstable_IdlePriority,Ag=l.log,Mg=l.unstable_setDisableYieldValue,El=null,bt=null;function Ta(e){if(typeof Ag=="function"&&Mg(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(El,e)}catch{}}var St=Math.clz32?Math.clz32:jg,Rg=Math.log,Og=Math.LN2;function jg(e){return e>>>=0,e===0?32:31-(Rg(e)/Og|0)|0}var Ii=256,Di=262144,Li=4194304;function Wa(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qi(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var v=n&134217727;return v!==0?(n=v&~c,n!==0?r=Wa(n):(h&=v,h!==0?r=Wa(h):a||(a=v&~e,a!==0&&(r=Wa(a))))):(v=n&~c,v!==0?r=Wa(v):h!==0?r=Wa(h):a||(a=n&~e,a!==0&&(r=Wa(a)))),r===0?0:t!==0&&t!==r&&(t&c)===0&&(c=r&-r,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:r}function Tl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function zg(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bu(){var e=Li;return Li<<=1,(Li&62914560)===0&&(Li=4194304),e}function Eo(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function _l(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ig(e,t,a,n,r,c){var h=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,E=e.expirationTimes,j=e.hiddenUpdates;for(a=h&~a;0<a;){var H=31-St(a),G=1<<H;v[H]=0,E[H]=-1;var I=j[H];if(I!==null)for(j[H]=null,H=0;H<I.length;H++){var L=I[H];L!==null&&(L.lane&=-536870913)}a&=~G}n!==0&&Su(e,n,0),c!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function Su(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-St(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function xu(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-St(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function Nu(e,t){var a=t&-t;return a=(a&42)!==0?1:To(a),(a&(e.suspendedLanes|t))!==0?0:a}function To(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _o(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Eu(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:cp(e.type))}function Tu(e,t){var a=V.p;try{return V.p=e,t()}finally{V.p=a}}var _a=Math.random().toString(36).slice(2),tt="__reactFiber$"+_a,ft="__reactProps$"+_a,An="__reactContainer$"+_a,Co="__reactEvents$"+_a,Dg="__reactListeners$"+_a,Lg="__reactHandles$"+_a,_u="__reactResources$"+_a,Cl="__reactMarker$"+_a;function wo(e){delete e[tt],delete e[ft],delete e[Co],delete e[Dg],delete e[Lg]}function Mn(e){var t=e[tt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[An]||a[tt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Xm(e);e!==null;){if(a=e[tt])return a;e=Xm(e)}return t}e=a,a=e.parentNode}return null}function Rn(e){if(e=e[tt]||e[An]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function On(e){var t=e[_u];return t||(t=e[_u]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $e(e){e[Cl]=!0}var Cu=new Set,wu={};function en(e,t){jn(e,t),jn(e+"Capture",t)}function jn(e,t){for(wu[e]=t,e=0;e<t.length;e++)Cu.add(t[e])}var qg=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Au={},Mu={};function Hg(e){return P.call(Mu,e)?!0:P.call(Au,e)?!1:qg.test(e)?Mu[e]=!0:(Au[e]=!0,!1)}function Hi(e,t,a){if(Hg(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ki(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function ia(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Rt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ru(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kg(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(h){a=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ao(e){if(!e._valueTracker){var t=Ru(e)?"checked":"value";e._valueTracker=kg(e,t,""+e[t])}}function Ou(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Ru(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Gi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Gg=/[\n"\\]/g;function Ot(e){return e.replace(Gg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mo(e,t,a,n,r,c,h,v){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rt(t)):e.value!==""+Rt(t)&&(e.value=""+Rt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Ro(e,h,Rt(t)):a!=null?Ro(e,h,Rt(a)):n!=null&&e.removeAttribute("value"),r==null&&c!=null&&(e.defaultChecked=!!c),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Rt(v):e.removeAttribute("name")}function ju(e,t,a,n,r,c,h,v){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Ao(e);return}a=a!=null?""+Rt(a):"",t=t!=null?""+Rt(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=v?e.checked:!!n,e.defaultChecked=!!n,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Ao(e)}function Ro(e,t,a){t==="number"&&Gi(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function zn(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Rt(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function zu(e,t,a){if(t!=null&&(t=""+Rt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Rt(a):""}function Iu(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(s(92));if(K(n)){if(1<n.length)throw Error(s(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Rt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Ao(e)}function In(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Ug=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Du(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||Ug.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Lu(e,t,a){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var r in t)n=t[r],t.hasOwnProperty(r)&&a[r]!==n&&Du(e,r,n)}else for(var c in t)t.hasOwnProperty(c)&&Du(e,c,t[c])}function Oo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Bg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Pg=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ui(e){return Pg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function sa(){}var jo=null;function zo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dn=null,Ln=null;function qu(e){var t=Rn(e);if(t&&(e=t.stateNode)){var a=e[ft]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mo(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Ot(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[ft]||null;if(!r)throw Error(s(90));Mo(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Ou(n)}break e;case"textarea":zu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&zn(e,!!a.multiple,t,!1)}}}var Io=!1;function Hu(e,t,a){if(Io)return e(t,a);Io=!0;try{var n=e(t);return n}finally{if(Io=!1,(Dn!==null||Ln!==null)&&(As(),Dn&&(t=Dn,e=Ln,Ln=Dn=null,qu(t),e)))for(t=0;t<e.length;t++)qu(e[t])}}function Al(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ft]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,t,typeof a));return a}var oa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Do=!1;if(oa)try{var Ml={};Object.defineProperty(Ml,"passive",{get:function(){Do=!0}}),window.addEventListener("test",Ml,Ml),window.removeEventListener("test",Ml,Ml)}catch{Do=!1}var Ca=null,Lo=null,Bi=null;function ku(){if(Bi)return Bi;var e,t=Lo,a=t.length,n,r="value"in Ca?Ca.value:Ca.textContent,c=r.length;for(e=0;e<a&&t[e]===r[e];e++);var h=a-e;for(n=1;n<=h&&t[a-n]===r[c-n];n++);return Bi=r.slice(e,1<n?1-n:void 0)}function Pi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Fi(){return!0}function Gu(){return!1}function mt(e){function t(a,n,r,c,h){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(c):c[v]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Fi:Gu,this.isPropagationStopped=Gu,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Fi)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Fi)},persist:function(){},isPersistent:Fi}),t}var tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yi=mt(tn),Rl=b({},tn,{view:0,detail:0}),Fg=mt(Rl),qo,Ho,Ol,Vi=b({},Rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Go,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ol&&(Ol&&e.type==="mousemove"?(qo=e.screenX-Ol.screenX,Ho=e.screenY-Ol.screenY):Ho=qo=0,Ol=e),qo)},movementY:function(e){return"movementY"in e?e.movementY:Ho}}),Uu=mt(Vi),Yg=b({},Vi,{dataTransfer:0}),Vg=mt(Yg),Xg=b({},Rl,{relatedTarget:0}),ko=mt(Xg),Kg=b({},tn,{animationName:0,elapsedTime:0,pseudoElement:0}),Qg=mt(Kg),Zg=b({},tn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Jg=mt(Zg),$g=b({},tn,{data:0}),Bu=mt($g),Wg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ey={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ty={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ay(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ty[e])?!!t[e]:!1}function Go(){return ay}var ny=b({},Rl,{key:function(e){if(e.key){var t=Wg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ey[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Go,charCode:function(e){return e.type==="keypress"?Pi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ly=mt(ny),iy=b({},Vi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pu=mt(iy),sy=b({},Rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Go}),oy=mt(sy),ry=b({},tn,{propertyName:0,elapsedTime:0,pseudoElement:0}),cy=mt(ry),uy=b({},Vi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),dy=mt(uy),fy=b({},tn,{newState:0,oldState:0}),my=mt(fy),py=[9,13,27,32],Uo=oa&&"CompositionEvent"in window,jl=null;oa&&"documentMode"in document&&(jl=document.documentMode);var hy=oa&&"TextEvent"in window&&!jl,Fu=oa&&(!Uo||jl&&8<jl&&11>=jl),Yu=" ",Vu=!1;function Xu(e,t){switch(e){case"keyup":return py.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ku(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qn=!1;function gy(e,t){switch(e){case"compositionend":return Ku(t);case"keypress":return t.which!==32?null:(Vu=!0,Yu);case"textInput":return e=t.data,e===Yu&&Vu?null:e;default:return null}}function yy(e,t){if(qn)return e==="compositionend"||!Uo&&Xu(e,t)?(e=ku(),Bi=Lo=Ca=null,qn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Fu&&t.locale!=="ko"?null:t.data;default:return null}}var vy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vy[e.type]:t==="textarea"}function Zu(e,t,a,n){Dn?Ln?Ln.push(n):Ln=[n]:Dn=n,t=Ds(t,"onChange"),0<t.length&&(a=new Yi("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var zl=null,Il=null;function by(e){zm(e,0)}function Xi(e){var t=wl(e);if(Ou(t))return e}function Ju(e,t){if(e==="change")return t}var $u=!1;if(oa){var Bo;if(oa){var Po="oninput"in document;if(!Po){var Wu=document.createElement("div");Wu.setAttribute("oninput","return;"),Po=typeof Wu.oninput=="function"}Bo=Po}else Bo=!1;$u=Bo&&(!document.documentMode||9<document.documentMode)}function ed(){zl&&(zl.detachEvent("onpropertychange",td),Il=zl=null)}function td(e){if(e.propertyName==="value"&&Xi(Il)){var t=[];Zu(t,Il,e,zo(e)),Hu(by,t)}}function Sy(e,t,a){e==="focusin"?(ed(),zl=t,Il=a,zl.attachEvent("onpropertychange",td)):e==="focusout"&&ed()}function xy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xi(Il)}function Ny(e,t){if(e==="click")return Xi(t)}function Ey(e,t){if(e==="input"||e==="change")return Xi(t)}function Ty(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xt=typeof Object.is=="function"?Object.is:Ty;function Dl(e,t){if(xt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!P.call(t,r)||!xt(e[r],t[r]))return!1}return!0}function ad(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nd(e,t){var a=ad(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ad(a)}}function ld(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ld(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function id(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gi(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Gi(e.document)}return t}function Fo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _y=oa&&"documentMode"in document&&11>=document.documentMode,Hn=null,Yo=null,Ll=null,Vo=!1;function sd(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Vo||Hn==null||Hn!==Gi(n)||(n=Hn,"selectionStart"in n&&Fo(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ll&&Dl(Ll,n)||(Ll=n,n=Ds(Yo,"onSelect"),0<n.length&&(t=new Yi("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Hn)))}function an(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var kn={animationend:an("Animation","AnimationEnd"),animationiteration:an("Animation","AnimationIteration"),animationstart:an("Animation","AnimationStart"),transitionrun:an("Transition","TransitionRun"),transitionstart:an("Transition","TransitionStart"),transitioncancel:an("Transition","TransitionCancel"),transitionend:an("Transition","TransitionEnd")},Xo={},od={};oa&&(od=document.createElement("div").style,"AnimationEvent"in window||(delete kn.animationend.animation,delete kn.animationiteration.animation,delete kn.animationstart.animation),"TransitionEvent"in window||delete kn.transitionend.transition);function nn(e){if(Xo[e])return Xo[e];if(!kn[e])return e;var t=kn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in od)return Xo[e]=t[a];return e}var rd=nn("animationend"),cd=nn("animationiteration"),ud=nn("animationstart"),Cy=nn("transitionrun"),wy=nn("transitionstart"),Ay=nn("transitioncancel"),dd=nn("transitionend"),fd=new Map,Ko="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ko.push("scrollEnd");function Ut(e,t){fd.set(e,t),en(t,[e])}var Ki=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},jt=[],Gn=0,Qo=0;function Qi(){for(var e=Gn,t=Qo=Gn=0;t<e;){var a=jt[t];jt[t++]=null;var n=jt[t];jt[t++]=null;var r=jt[t];jt[t++]=null;var c=jt[t];if(jt[t++]=null,n!==null&&r!==null){var h=n.pending;h===null?r.next=r:(r.next=h.next,h.next=r),n.pending=r}c!==0&&md(a,r,c)}}function Zi(e,t,a,n){jt[Gn++]=e,jt[Gn++]=t,jt[Gn++]=a,jt[Gn++]=n,Qo|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Zo(e,t,a,n){return Zi(e,t,a,n),Ji(e)}function ln(e,t){return Zi(e,null,null,t),Ji(e)}function md(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var r=!1,c=e.return;c!==null;)c.childLanes|=a,n=c.alternate,n!==null&&(n.childLanes|=a),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(r=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,r&&t!==null&&(r=31-St(a),e=c.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),c):null}function Ji(e){if(50<li)throw li=0,ic=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Un={};function My(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nt(e,t,a,n){return new My(e,t,a,n)}function Jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ra(e,t){var a=e.alternate;return a===null?(a=Nt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function pd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function $i(e,t,a,n,r,c){var h=0;if(n=e,typeof e=="function")Jo(e)&&(h=1);else if(typeof e=="string")h=Iv(e,a,Z.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ae:return e=Nt(31,a,t,r),e.elementType=ae,e.lanes=c,e;case z:return sn(a.children,r,c,t);case F:h=8,r|=24;break;case Y:return e=Nt(12,a,t,r|2),e.elementType=Y,e.lanes=c,e;case te:return e=Nt(13,a,t,r),e.elementType=te,e.lanes=c,e;case U:return e=Nt(19,a,t,r),e.elementType=U,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:h=10;break e;case X:h=9;break e;case D:h=11;break e;case $:h=14;break e;case Ce:h=16,n=null;break e}h=29,a=Error(s(130,e===null?"null":typeof e,"")),n=null}return t=Nt(h,a,t,r),t.elementType=e,t.type=n,t.lanes=c,t}function sn(e,t,a,n){return e=Nt(7,e,n,t),e.lanes=a,e}function $o(e,t,a){return e=Nt(6,e,null,t),e.lanes=a,e}function hd(e){var t=Nt(18,null,null,0);return t.stateNode=e,t}function Wo(e,t,a){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gd=new WeakMap;function zt(e,t){if(typeof e=="object"&&e!==null){var a=gd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ji(t)},gd.set(e,t),t)}return{value:e,source:t,stack:ji(t)}}var Bn=[],Pn=0,Wi=null,ql=0,It=[],Dt=0,wa=null,Kt=1,Qt="";function ca(e,t){Bn[Pn++]=ql,Bn[Pn++]=Wi,Wi=e,ql=t}function yd(e,t,a){It[Dt++]=Kt,It[Dt++]=Qt,It[Dt++]=wa,wa=e;var n=Kt;e=Qt;var r=32-St(n)-1;n&=~(1<<r),a+=1;var c=32-St(t)+r;if(30<c){var h=r-r%5;c=(n&(1<<h)-1).toString(32),n>>=h,r-=h,Kt=1<<32-St(t)+r|a<<r|n,Qt=c+e}else Kt=1<<c|a<<r|n,Qt=e}function er(e){e.return!==null&&(ca(e,1),yd(e,1,0))}function tr(e){for(;e===Wi;)Wi=Bn[--Pn],Bn[Pn]=null,ql=Bn[--Pn],Bn[Pn]=null;for(;e===wa;)wa=It[--Dt],It[Dt]=null,Qt=It[--Dt],It[Dt]=null,Kt=It[--Dt],It[Dt]=null}function vd(e,t){It[Dt++]=Kt,It[Dt++]=Qt,It[Dt++]=wa,Kt=t.id,Qt=t.overflow,wa=e}var at=null,De=null,ye=!1,Aa=null,Lt=!1,ar=Error(s(519));function Ma(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hl(zt(t,e)),ar}function bd(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[tt]=e,t[ft]=n,a){case"dialog":me("cancel",t),me("close",t);break;case"iframe":case"object":case"embed":me("load",t);break;case"video":case"audio":for(a=0;a<si.length;a++)me(si[a],t);break;case"source":me("error",t);break;case"img":case"image":case"link":me("error",t),me("load",t);break;case"details":me("toggle",t);break;case"input":me("invalid",t),ju(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":me("invalid",t);break;case"textarea":me("invalid",t),Iu(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||qm(t.textContent,a)?(n.popover!=null&&(me("beforetoggle",t),me("toggle",t)),n.onScroll!=null&&me("scroll",t),n.onScrollEnd!=null&&me("scrollend",t),n.onClick!=null&&(t.onclick=sa),t=!0):t=!1,t||Ma(e,!0)}function Sd(e){for(at=e.return;at;)switch(at.tag){case 5:case 31:case 13:Lt=!1;return;case 27:case 3:Lt=!0;return;default:at=at.return}}function Fn(e){if(e!==at)return!1;if(!ye)return Sd(e),ye=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Sc(e.type,e.memoizedProps)),a=!a),a&&De&&Ma(e),Sd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));De=Vm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));De=Vm(e)}else t===27?(t=De,Pa(e.type)?(e=_c,_c=null,De=e):De=t):De=at?Ht(e.stateNode.nextSibling):null;return!0}function on(){De=at=null,ye=!1}function nr(){var e=Aa;return e!==null&&(yt===null?yt=e:yt.push.apply(yt,e),Aa=null),e}function Hl(e){Aa===null?Aa=[e]:Aa.push(e)}var lr=w(null),rn=null,ua=null;function Ra(e,t,a){B(lr,t._currentValue),t._currentValue=a}function da(e){e._currentValue=lr.current,T(lr)}function ir(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function sr(e,t,a,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var c=r.dependencies;if(c!==null){var h=r.child;c=c.firstContext;e:for(;c!==null;){var v=c;c=r;for(var E=0;E<t.length;E++)if(v.context===t[E]){c.lanes|=a,v=c.alternate,v!==null&&(v.lanes|=a),ir(c.return,a,e),n||(h=null);break e}c=v.next}}else if(r.tag===18){if(h=r.return,h===null)throw Error(s(341));h.lanes|=a,c=h.alternate,c!==null&&(c.lanes|=a),ir(h,a,e),h=null}else h=r.child;if(h!==null)h.return=r;else for(h=r;h!==null;){if(h===e){h=null;break}if(r=h.sibling,r!==null){r.return=h.return,h=r;break}h=h.return}r=h}}function Yn(e,t,a,n){e=null;for(var r=t,c=!1;r!==null;){if(!c){if((r.flags&524288)!==0)c=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var h=r.alternate;if(h===null)throw Error(s(387));if(h=h.memoizedProps,h!==null){var v=r.type;xt(r.pendingProps.value,h.value)||(e!==null?e.push(v):e=[v])}}else if(r===ge.current){if(h=r.alternate,h===null)throw Error(s(387));h.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(di):e=[di])}r=r.return}e!==null&&sr(t,e,a,n),t.flags|=262144}function es(e){for(e=e.firstContext;e!==null;){if(!xt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function cn(e){rn=e,ua=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function nt(e){return xd(rn,e)}function ts(e,t){return rn===null&&cn(e),xd(e,t)}function xd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ua===null){if(e===null)throw Error(s(308));ua=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ua=ua.next=t;return a}var Ry=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Oy=l.unstable_scheduleCallback,jy=l.unstable_NormalPriority,Ye={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function or(){return{controller:new Ry,data:new Map,refCount:0}}function kl(e){e.refCount--,e.refCount===0&&Oy(jy,function(){e.controller.abort()})}var Gl=null,rr=0,Vn=0,Xn=null;function zy(e,t){if(Gl===null){var a=Gl=[];rr=0,Vn=dc(),Xn={status:"pending",value:void 0,then:function(n){a.push(n)}}}return rr++,t.then(Nd,Nd),t}function Nd(){if(--rr===0&&Gl!==null){Xn!==null&&(Xn.status="fulfilled");var e=Gl;Gl=null,Vn=0,Xn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Iy(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var Ed=A.S;A.S=function(e,t){om=Je(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&zy(e,t),Ed!==null&&Ed(e,t)};var un=w(null);function cr(){var e=un.current;return e!==null?e:ze.pooledCache}function as(e,t){t===null?B(un,un.current):B(un,t.pool)}function Td(){var e=cr();return e===null?null:{parent:Ye._currentValue,pool:e}}var Kn=Error(s(460)),ur=Error(s(474)),ns=Error(s(542)),ls={then:function(){}};function _d(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Cd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(sa,sa),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ad(e),e;default:if(typeof t.status=="string")t.then(sa,sa);else{if(e=ze,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=n}},function(n){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ad(e),e}throw fn=t,Kn}}function dn(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(fn=a,Kn):a}}var fn=null;function wd(){if(fn===null)throw Error(s(459));var e=fn;return fn=null,e}function Ad(e){if(e===Kn||e===ns)throw Error(s(483))}var Qn=null,Ul=0;function is(e){var t=Ul;return Ul+=1,Qn===null&&(Qn=[]),Cd(Qn,e,t)}function Bl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ss(e,t){throw t.$$typeof===S?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Md(e){function t(R,_){if(e){var O=R.deletions;O===null?(R.deletions=[_],R.flags|=16):O.push(_)}}function a(R,_){if(!e)return null;for(;_!==null;)t(R,_),_=_.sibling;return null}function n(R){for(var _=new Map;R!==null;)R.key!==null?_.set(R.key,R):_.set(R.index,R),R=R.sibling;return _}function r(R,_){return R=ra(R,_),R.index=0,R.sibling=null,R}function c(R,_,O){return R.index=O,e?(O=R.alternate,O!==null?(O=O.index,O<_?(R.flags|=67108866,_):O):(R.flags|=67108866,_)):(R.flags|=1048576,_)}function h(R){return e&&R.alternate===null&&(R.flags|=67108866),R}function v(R,_,O,k){return _===null||_.tag!==6?(_=$o(O,R.mode,k),_.return=R,_):(_=r(_,O),_.return=R,_)}function E(R,_,O,k){var le=O.type;return le===z?H(R,_,O.props.children,k,O.key):_!==null&&(_.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Ce&&dn(le)===_.type)?(_=r(_,O.props),Bl(_,O),_.return=R,_):(_=$i(O.type,O.key,O.props,null,R.mode,k),Bl(_,O),_.return=R,_)}function j(R,_,O,k){return _===null||_.tag!==4||_.stateNode.containerInfo!==O.containerInfo||_.stateNode.implementation!==O.implementation?(_=Wo(O,R.mode,k),_.return=R,_):(_=r(_,O.children||[]),_.return=R,_)}function H(R,_,O,k,le){return _===null||_.tag!==7?(_=sn(O,R.mode,k,le),_.return=R,_):(_=r(_,O),_.return=R,_)}function G(R,_,O){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=$o(""+_,R.mode,O),_.return=R,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case N:return O=$i(_.type,_.key,_.props,null,R.mode,O),Bl(O,_),O.return=R,O;case M:return _=Wo(_,R.mode,O),_.return=R,_;case Ce:return _=dn(_),G(R,_,O)}if(K(_)||Ie(_))return _=sn(_,R.mode,O,null),_.return=R,_;if(typeof _.then=="function")return G(R,is(_),O);if(_.$$typeof===Q)return G(R,ts(R,_),O);ss(R,_)}return null}function I(R,_,O,k){var le=_!==null?_.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return le!==null?null:v(R,_,""+O,k);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case N:return O.key===le?E(R,_,O,k):null;case M:return O.key===le?j(R,_,O,k):null;case Ce:return O=dn(O),I(R,_,O,k)}if(K(O)||Ie(O))return le!==null?null:H(R,_,O,k,null);if(typeof O.then=="function")return I(R,_,is(O),k);if(O.$$typeof===Q)return I(R,_,ts(R,O),k);ss(R,O)}return null}function L(R,_,O,k,le){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return R=R.get(O)||null,v(_,R,""+k,le);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case N:return R=R.get(k.key===null?O:k.key)||null,E(_,R,k,le);case M:return R=R.get(k.key===null?O:k.key)||null,j(_,R,k,le);case Ce:return k=dn(k),L(R,_,O,k,le)}if(K(k)||Ie(k))return R=R.get(O)||null,H(_,R,k,le,null);if(typeof k.then=="function")return L(R,_,O,is(k),le);if(k.$$typeof===Q)return L(R,_,O,ts(_,k),le);ss(_,k)}return null}function W(R,_,O,k){for(var le=null,Ee=null,ee=_,ue=_=0,he=null;ee!==null&&ue<O.length;ue++){ee.index>ue?(he=ee,ee=null):he=ee.sibling;var Te=I(R,ee,O[ue],k);if(Te===null){ee===null&&(ee=he);break}e&&ee&&Te.alternate===null&&t(R,ee),_=c(Te,_,ue),Ee===null?le=Te:Ee.sibling=Te,Ee=Te,ee=he}if(ue===O.length)return a(R,ee),ye&&ca(R,ue),le;if(ee===null){for(;ue<O.length;ue++)ee=G(R,O[ue],k),ee!==null&&(_=c(ee,_,ue),Ee===null?le=ee:Ee.sibling=ee,Ee=ee);return ye&&ca(R,ue),le}for(ee=n(ee);ue<O.length;ue++)he=L(ee,R,ue,O[ue],k),he!==null&&(e&&he.alternate!==null&&ee.delete(he.key===null?ue:he.key),_=c(he,_,ue),Ee===null?le=he:Ee.sibling=he,Ee=he);return e&&ee.forEach(function(Ka){return t(R,Ka)}),ye&&ca(R,ue),le}function se(R,_,O,k){if(O==null)throw Error(s(151));for(var le=null,Ee=null,ee=_,ue=_=0,he=null,Te=O.next();ee!==null&&!Te.done;ue++,Te=O.next()){ee.index>ue?(he=ee,ee=null):he=ee.sibling;var Ka=I(R,ee,Te.value,k);if(Ka===null){ee===null&&(ee=he);break}e&&ee&&Ka.alternate===null&&t(R,ee),_=c(Ka,_,ue),Ee===null?le=Ka:Ee.sibling=Ka,Ee=Ka,ee=he}if(Te.done)return a(R,ee),ye&&ca(R,ue),le;if(ee===null){for(;!Te.done;ue++,Te=O.next())Te=G(R,Te.value,k),Te!==null&&(_=c(Te,_,ue),Ee===null?le=Te:Ee.sibling=Te,Ee=Te);return ye&&ca(R,ue),le}for(ee=n(ee);!Te.done;ue++,Te=O.next())Te=L(ee,R,ue,Te.value,k),Te!==null&&(e&&Te.alternate!==null&&ee.delete(Te.key===null?ue:Te.key),_=c(Te,_,ue),Ee===null?le=Te:Ee.sibling=Te,Ee=Te);return e&&ee.forEach(function(Yv){return t(R,Yv)}),ye&&ca(R,ue),le}function je(R,_,O,k){if(typeof O=="object"&&O!==null&&O.type===z&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case N:e:{for(var le=O.key;_!==null;){if(_.key===le){if(le=O.type,le===z){if(_.tag===7){a(R,_.sibling),k=r(_,O.props.children),k.return=R,R=k;break e}}else if(_.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Ce&&dn(le)===_.type){a(R,_.sibling),k=r(_,O.props),Bl(k,O),k.return=R,R=k;break e}a(R,_);break}else t(R,_);_=_.sibling}O.type===z?(k=sn(O.props.children,R.mode,k,O.key),k.return=R,R=k):(k=$i(O.type,O.key,O.props,null,R.mode,k),Bl(k,O),k.return=R,R=k)}return h(R);case M:e:{for(le=O.key;_!==null;){if(_.key===le)if(_.tag===4&&_.stateNode.containerInfo===O.containerInfo&&_.stateNode.implementation===O.implementation){a(R,_.sibling),k=r(_,O.children||[]),k.return=R,R=k;break e}else{a(R,_);break}else t(R,_);_=_.sibling}k=Wo(O,R.mode,k),k.return=R,R=k}return h(R);case Ce:return O=dn(O),je(R,_,O,k)}if(K(O))return W(R,_,O,k);if(Ie(O)){if(le=Ie(O),typeof le!="function")throw Error(s(150));return O=le.call(O),se(R,_,O,k)}if(typeof O.then=="function")return je(R,_,is(O),k);if(O.$$typeof===Q)return je(R,_,ts(R,O),k);ss(R,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,_!==null&&_.tag===6?(a(R,_.sibling),k=r(_,O),k.return=R,R=k):(a(R,_),k=$o(O,R.mode,k),k.return=R,R=k),h(R)):a(R,_)}return function(R,_,O,k){try{Ul=0;var le=je(R,_,O,k);return Qn=null,le}catch(ee){if(ee===Kn||ee===ns)throw ee;var Ee=Nt(29,ee,null,R.mode);return Ee.lanes=k,Ee.return=R,Ee}}}var mn=Md(!0),Rd=Md(!1),Oa=!1;function dr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(_e&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=Ji(e),md(e,null,a),t}return Zi(e,n,t,a),Ji(e)}function Pl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,xu(e,a)}}function mr(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var h={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?r=c=h:c=c.next=h,a=a.next}while(a!==null);c===null?r=c=t:c=c.next=t}else r=c=t;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:c,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var pr=!1;function Fl(){if(pr){var e=Xn;if(e!==null)throw e}}function Yl(e,t,a,n){pr=!1;var r=e.updateQueue;Oa=!1;var c=r.firstBaseUpdate,h=r.lastBaseUpdate,v=r.shared.pending;if(v!==null){r.shared.pending=null;var E=v,j=E.next;E.next=null,h===null?c=j:h.next=j,h=E;var H=e.alternate;H!==null&&(H=H.updateQueue,v=H.lastBaseUpdate,v!==h&&(v===null?H.firstBaseUpdate=j:v.next=j,H.lastBaseUpdate=E))}if(c!==null){var G=r.baseState;h=0,H=j=E=null,v=c;do{var I=v.lane&-536870913,L=I!==v.lane;if(L?(pe&I)===I:(n&I)===I){I!==0&&I===Vn&&(pr=!0),H!==null&&(H=H.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var W=e,se=v;I=t;var je=a;switch(se.tag){case 1:if(W=se.payload,typeof W=="function"){G=W.call(je,G,I);break e}G=W;break e;case 3:W.flags=W.flags&-65537|128;case 0:if(W=se.payload,I=typeof W=="function"?W.call(je,G,I):W,I==null)break e;G=b({},G,I);break e;case 2:Oa=!0}}I=v.callback,I!==null&&(e.flags|=64,L&&(e.flags|=8192),L=r.callbacks,L===null?r.callbacks=[I]:L.push(I))}else L={lane:I,tag:v.tag,payload:v.payload,callback:v.callback,next:null},H===null?(j=H=L,E=G):H=H.next=L,h|=I;if(v=v.next,v===null){if(v=r.shared.pending,v===null)break;L=v,v=L.next,L.next=null,r.lastBaseUpdate=L,r.shared.pending=null}}while(!0);H===null&&(E=G),r.baseState=E,r.firstBaseUpdate=j,r.lastBaseUpdate=H,c===null&&(r.shared.lanes=0),Ha|=h,e.lanes=h,e.memoizedState=G}}function Od(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function jd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Od(a[e],t)}var Zn=w(null),os=w(0);function zd(e,t){e=Sa,B(os,e),B(Zn,t),Sa=e|t.baseLanes}function hr(){B(os,Sa),B(Zn,Zn.current)}function gr(){Sa=os.current,T(Zn),T(os)}var Et=w(null),qt=null;function Ia(e){var t=e.alternate;B(Be,Be.current&1),B(Et,e),qt===null&&(t===null||Zn.current!==null||t.memoizedState!==null)&&(qt=e)}function yr(e){B(Be,Be.current),B(Et,e),qt===null&&(qt=e)}function Id(e){e.tag===22?(B(Be,Be.current),B(Et,e),qt===null&&(qt=e)):Da()}function Da(){B(Be,Be.current),B(Et,Et.current)}function Tt(e){T(Et),qt===e&&(qt=null),T(Be)}var Be=w(0);function rs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Ec(a)||Tc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fa=0,ce=null,Re=null,Ve=null,cs=!1,Jn=!1,pn=!1,us=0,Vl=0,$n=null,Dy=0;function Ge(){throw Error(s(321))}function vr(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!xt(e[a],t[a]))return!1;return!0}function br(e,t,a,n,r,c){return fa=c,ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?vf:Ir,pn=!1,c=a(n,r),pn=!1,Jn&&(c=Ld(t,a,n,r)),Dd(e),c}function Dd(e){A.H=Ql;var t=Re!==null&&Re.next!==null;if(fa=0,Ve=Re=ce=null,cs=!1,Vl=0,$n=null,t)throw Error(s(300));e===null||Xe||(e=e.dependencies,e!==null&&es(e)&&(Xe=!0))}function Ld(e,t,a,n){ce=e;var r=0;do{if(Jn&&($n=null),Vl=0,Jn=!1,25<=r)throw Error(s(301));if(r+=1,Ve=Re=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}A.H=bf,c=t(a,n)}while(Jn);return c}function Ly(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?Xl(t):t,e=e.useState()[0],(Re!==null?Re.memoizedState:null)!==e&&(ce.flags|=1024),t}function Sr(){var e=us!==0;return us=0,e}function xr(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Nr(e){if(cs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cs=!1}fa=0,Ve=Re=ce=null,Jn=!1,Vl=us=0,$n=null}function dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ve===null?ce.memoizedState=Ve=e:Ve=Ve.next=e,Ve}function Pe(){if(Re===null){var e=ce.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Ve===null?ce.memoizedState:Ve.next;if(t!==null)Ve=t,Re=e;else{if(e===null)throw ce.alternate===null?Error(s(467)):Error(s(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Ve===null?ce.memoizedState=Ve=e:Ve=Ve.next=e}return Ve}function ds(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xl(e){var t=Vl;return Vl+=1,$n===null&&($n=[]),e=Cd($n,e,t),t=ce,(Ve===null?t.memoizedState:Ve.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?vf:Ir),e}function fs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xl(e);if(e.$$typeof===Q)return nt(e)}throw Error(s(438,String(e)))}function Er(e){var t=null,a=ce.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=ce.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=ds(),ce.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=we;return t.index++,a}function ma(e,t){return typeof t=="function"?t(e):t}function ms(e){var t=Pe();return Tr(t,Re,e)}function Tr(e,t,a){var n=e.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=a;var r=e.baseQueue,c=n.pending;if(c!==null){if(r!==null){var h=r.next;r.next=c.next,c.next=h}t.baseQueue=r=c,n.pending=null}if(c=e.baseState,r===null)e.memoizedState=c;else{t=r.next;var v=h=null,E=null,j=t,H=!1;do{var G=j.lane&-536870913;if(G!==j.lane?(pe&G)===G:(fa&G)===G){var I=j.revertLane;if(I===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),G===Vn&&(H=!0);else if((fa&I)===I){j=j.next,I===Vn&&(H=!0);continue}else G={lane:0,revertLane:j.revertLane,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},E===null?(v=E=G,h=c):E=E.next=G,ce.lanes|=I,Ha|=I;G=j.action,pn&&a(c,G),c=j.hasEagerState?j.eagerState:a(c,G)}else I={lane:G,revertLane:j.revertLane,gesture:j.gesture,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},E===null?(v=E=I,h=c):E=E.next=I,ce.lanes|=G,Ha|=G;j=j.next}while(j!==null&&j!==t);if(E===null?h=c:E.next=v,!xt(c,e.memoizedState)&&(Xe=!0,H&&(a=Xn,a!==null)))throw a;e.memoizedState=c,e.baseState=h,e.baseQueue=E,n.lastRenderedState=c}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function _r(e){var t=Pe(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var n=a.dispatch,r=a.pending,c=t.memoizedState;if(r!==null){a.pending=null;var h=r=r.next;do c=e(c,h.action),h=h.next;while(h!==r);xt(c,t.memoizedState)||(Xe=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,n]}function qd(e,t,a){var n=ce,r=Pe(),c=ye;if(c){if(a===void 0)throw Error(s(407));a=a()}else a=t();var h=!xt((Re||r).memoizedState,a);if(h&&(r.memoizedState=a,Xe=!0),r=r.queue,Ar(Gd.bind(null,n,r,e),[e]),r.getSnapshot!==t||h||Ve!==null&&Ve.memoizedState.tag&1){if(n.flags|=2048,Wn(9,{destroy:void 0},kd.bind(null,n,r,a,t),null),ze===null)throw Error(s(349));c||(fa&127)!==0||Hd(n,t,a)}return a}function Hd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ce.updateQueue,t===null?(t=ds(),ce.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function kd(e,t,a,n){t.value=a,t.getSnapshot=n,Ud(t)&&Bd(e)}function Gd(e,t,a){return a(function(){Ud(t)&&Bd(e)})}function Ud(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!xt(e,a)}catch{return!0}}function Bd(e){var t=ln(e,2);t!==null&&vt(t,e,2)}function Cr(e){var t=dt();if(typeof e=="function"){var a=e;if(e=a(),pn){Ta(!0);try{a()}finally{Ta(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:e},t}function Pd(e,t,a,n){return e.baseState=a,Tr(e,Re,typeof n=="function"?n:ma)}function qy(e,t,a,n,r){if(gs(e))throw Error(s(485));if(e=t.action,e!==null){var c={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};A.T!==null?a(!0):c.isTransition=!1,n(c),a=t.pending,a===null?(c.next=t.pending=c,Fd(t,c)):(c.next=a.next,t.pending=a.next=c)}}function Fd(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var c=A.T,h={};A.T=h;try{var v=a(r,n),E=A.S;E!==null&&E(h,v),Yd(e,t,v)}catch(j){wr(e,t,j)}finally{c!==null&&h.types!==null&&(c.types=h.types),A.T=c}}else try{c=a(r,n),Yd(e,t,c)}catch(j){wr(e,t,j)}}function Yd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Vd(e,t,n)},function(n){return wr(e,t,n)}):Vd(e,t,a)}function Vd(e,t,a){t.status="fulfilled",t.value=a,Xd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Fd(e,a)))}function wr(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Xd(t),t=t.next;while(t!==n)}e.action=null}function Xd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kd(e,t){return t}function Qd(e,t){if(ye){var a=ze.formState;if(a!==null){e:{var n=ce;if(ye){if(De){t:{for(var r=De,c=Lt;r.nodeType!==8;){if(!c){r=null;break t}if(r=Ht(r.nextSibling),r===null){r=null;break t}}c=r.data,r=c==="F!"||c==="F"?r:null}if(r){De=Ht(r.nextSibling),n=r.data==="F!";break e}}Ma(n)}n=!1}n&&(t=a[0])}}return a=dt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kd,lastRenderedState:t},a.queue=n,a=hf.bind(null,ce,n),n.dispatch=a,n=Cr(!1),c=zr.bind(null,ce,!1,n.queue),n=dt(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=qy.bind(null,ce,r,c,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function Zd(e){var t=Pe();return Jd(t,Re,e)}function Jd(e,t,a){if(t=Tr(e,t,Kd)[0],e=ms(ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Xl(t)}catch(h){throw h===Kn?ns:h}else n=t;t=Pe();var r=t.queue,c=r.dispatch;return a!==t.memoizedState&&(ce.flags|=2048,Wn(9,{destroy:void 0},Hy.bind(null,r,a),null)),[n,c,e]}function Hy(e,t){e.action=t}function $d(e){var t=Pe(),a=Re;if(a!==null)return Jd(t,a,e);Pe(),t=t.memoizedState,a=Pe();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Wn(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=ce.updateQueue,t===null&&(t=ds(),ce.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function Wd(){return Pe().memoizedState}function ps(e,t,a,n){var r=dt();ce.flags|=e,r.memoizedState=Wn(1|t,{destroy:void 0},a,n===void 0?null:n)}function hs(e,t,a,n){var r=Pe();n=n===void 0?null:n;var c=r.memoizedState.inst;Re!==null&&n!==null&&vr(n,Re.memoizedState.deps)?r.memoizedState=Wn(t,c,a,n):(ce.flags|=e,r.memoizedState=Wn(1|t,c,a,n))}function ef(e,t){ps(8390656,8,e,t)}function Ar(e,t){hs(2048,8,e,t)}function ky(e){ce.flags|=4;var t=ce.updateQueue;if(t===null)t=ds(),ce.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function tf(e){var t=Pe().memoizedState;return ky({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function af(e,t){return hs(4,2,e,t)}function nf(e,t){return hs(4,4,e,t)}function lf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function sf(e,t,a){a=a!=null?a.concat([e]):null,hs(4,4,lf.bind(null,t,e),a)}function Mr(){}function of(e,t){var a=Pe();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&vr(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function rf(e,t){var a=Pe();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&vr(t,n[1]))return n[0];if(n=e(),pn){Ta(!0);try{e()}finally{Ta(!1)}}return a.memoizedState=[n,t],n}function Rr(e,t,a){return a===void 0||(fa&1073741824)!==0&&(pe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=cm(),ce.lanes|=e,Ha|=e,a)}function cf(e,t,a,n){return xt(a,t)?a:Zn.current!==null?(e=Rr(e,a,n),xt(e,t)||(Xe=!0),e):(fa&42)===0||(fa&1073741824)!==0&&(pe&261930)===0?(Xe=!0,e.memoizedState=a):(e=cm(),ce.lanes|=e,Ha|=e,t)}function uf(e,t,a,n,r){var c=V.p;V.p=c!==0&&8>c?c:8;var h=A.T,v={};A.T=v,zr(e,!1,t,a);try{var E=r(),j=A.S;if(j!==null&&j(v,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var H=Iy(E,n);Kl(e,t,H,wt(e))}else Kl(e,t,n,wt(e))}catch(G){Kl(e,t,{then:function(){},status:"rejected",reason:G},wt())}finally{V.p=c,h!==null&&v.types!==null&&(h.types=v.types),A.T=h}}function Gy(){}function Or(e,t,a,n){if(e.tag!==5)throw Error(s(476));var r=df(e).queue;uf(e,r,t,ne,a===null?Gy:function(){return ff(e),a(n)})}function df(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:ne},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ff(e){var t=df(e);t.next===null&&(t=e.alternate.memoizedState),Kl(e,t.next.queue,{},wt())}function jr(){return nt(di)}function mf(){return Pe().memoizedState}function pf(){return Pe().memoizedState}function Uy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=wt();e=ja(a);var n=za(t,e,a);n!==null&&(vt(n,t,a),Pl(n,t,a)),t={cache:or()},e.payload=t;return}t=t.return}}function By(e,t,a){var n=wt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},gs(e)?gf(t,a):(a=Zo(e,t,a,n),a!==null&&(vt(a,e,n),yf(a,t,n)))}function hf(e,t,a){var n=wt();Kl(e,t,a,n)}function Kl(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(gs(e))gf(t,r);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,v=c(h,a);if(r.hasEagerState=!0,r.eagerState=v,xt(v,h))return Zi(e,t,r,0),ze===null&&Qi(),!1}catch{}if(a=Zo(e,t,r,n),a!==null)return vt(a,e,n),yf(a,t,n),!0}return!1}function zr(e,t,a,n){if(n={lane:2,revertLane:dc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gs(e)){if(t)throw Error(s(479))}else t=Zo(e,a,n,2),t!==null&&vt(t,e,2)}function gs(e){var t=e.alternate;return e===ce||t!==null&&t===ce}function gf(e,t){Jn=cs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function yf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,xu(e,a)}}var Ql={readContext:nt,use:fs,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useLayoutEffect:Ge,useInsertionEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useSyncExternalStore:Ge,useId:Ge,useHostTransitionStatus:Ge,useFormState:Ge,useActionState:Ge,useOptimistic:Ge,useMemoCache:Ge,useCacheRefresh:Ge};Ql.useEffectEvent=Ge;var vf={readContext:nt,use:fs,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:nt,useEffect:ef,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ps(4194308,4,lf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var a=dt();t=t===void 0?null:t;var n=e();if(pn){Ta(!0);try{e()}finally{Ta(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=dt();if(a!==void 0){var r=a(t);if(pn){Ta(!0);try{a(t)}finally{Ta(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=By.bind(null,ce,e),[n.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Cr(e);var t=e.queue,a=hf.bind(null,ce,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Mr,useDeferredValue:function(e,t){var a=dt();return Rr(a,e,t)},useTransition:function(){var e=Cr(!1);return e=uf.bind(null,ce,e.queue,!0,!1),dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=ce,r=dt();if(ye){if(a===void 0)throw Error(s(407));a=a()}else{if(a=t(),ze===null)throw Error(s(349));(pe&127)!==0||Hd(n,t,a)}r.memoizedState=a;var c={value:a,getSnapshot:t};return r.queue=c,ef(Gd.bind(null,n,c,e),[e]),n.flags|=2048,Wn(9,{destroy:void 0},kd.bind(null,n,c,a,t),null),a},useId:function(){var e=dt(),t=ze.identifierPrefix;if(ye){var a=Qt,n=Kt;a=(n&~(1<<32-St(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=us++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Dy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:jr,useFormState:Qd,useActionState:Qd,useOptimistic:function(e){var t=dt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=zr.bind(null,ce,!0,a),a.dispatch=t,[e,t]},useMemoCache:Er,useCacheRefresh:function(){return dt().memoizedState=Uy.bind(null,ce)},useEffectEvent:function(e){var t=dt(),a={impl:e};return t.memoizedState=a,function(){if((_e&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Ir={readContext:nt,use:fs,useCallback:of,useContext:nt,useEffect:Ar,useImperativeHandle:sf,useInsertionEffect:af,useLayoutEffect:nf,useMemo:rf,useReducer:ms,useRef:Wd,useState:function(){return ms(ma)},useDebugValue:Mr,useDeferredValue:function(e,t){var a=Pe();return cf(a,Re.memoizedState,e,t)},useTransition:function(){var e=ms(ma)[0],t=Pe().memoizedState;return[typeof e=="boolean"?e:Xl(e),t]},useSyncExternalStore:qd,useId:mf,useHostTransitionStatus:jr,useFormState:Zd,useActionState:Zd,useOptimistic:function(e,t){var a=Pe();return Pd(a,Re,e,t)},useMemoCache:Er,useCacheRefresh:pf};Ir.useEffectEvent=tf;var bf={readContext:nt,use:fs,useCallback:of,useContext:nt,useEffect:Ar,useImperativeHandle:sf,useInsertionEffect:af,useLayoutEffect:nf,useMemo:rf,useReducer:_r,useRef:Wd,useState:function(){return _r(ma)},useDebugValue:Mr,useDeferredValue:function(e,t){var a=Pe();return Re===null?Rr(a,e,t):cf(a,Re.memoizedState,e,t)},useTransition:function(){var e=_r(ma)[0],t=Pe().memoizedState;return[typeof e=="boolean"?e:Xl(e),t]},useSyncExternalStore:qd,useId:mf,useHostTransitionStatus:jr,useFormState:$d,useActionState:$d,useOptimistic:function(e,t){var a=Pe();return Re!==null?Pd(a,Re,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Er,useCacheRefresh:pf};bf.useEffectEvent=tf;function Dr(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:b({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Lr={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=wt(),r=ja(n);r.payload=t,a!=null&&(r.callback=a),t=za(e,r,n),t!==null&&(vt(t,e,n),Pl(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=wt(),r=ja(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=za(e,r,n),t!==null&&(vt(t,e,n),Pl(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=wt(),n=ja(a);n.tag=2,t!=null&&(n.callback=t),t=za(e,n,a),t!==null&&(vt(t,e,a),Pl(t,e,a))}};function Sf(e,t,a,n,r,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,c,h):t.prototype&&t.prototype.isPureReactComponent?!Dl(a,n)||!Dl(r,c):!0}function xf(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Lr.enqueueReplaceState(t,t.state,null)}function hn(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=b({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function Nf(e){Ki(e)}function Ef(e){console.error(e)}function Tf(e){Ki(e)}function ys(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function _f(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function qr(e,t,a){return a=ja(a),a.tag=3,a.payload={element:null},a.callback=function(){ys(e,t)},a}function Cf(e){return e=ja(e),e.tag=3,e}function wf(e,t,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var c=n.value;e.payload=function(){return r(c)},e.callback=function(){_f(t,a,n)}}var h=a.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){_f(t,a,n),typeof r!="function"&&(ka===null?ka=new Set([this]):ka.add(this));var v=n.stack;this.componentDidCatch(n.value,{componentStack:v!==null?v:""})})}function Py(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Yn(t,a,r,!0),a=Et.current,a!==null){switch(a.tag){case 31:case 13:return qt===null?Ms():a.alternate===null&&Ue===0&&(Ue=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===ls?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),rc(e,n,r)),!1;case 22:return a.flags|=65536,n===ls?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),rc(e,n,r)),!1}throw Error(s(435,a.tag))}return rc(e,n,r),Ms(),!1}if(ye)return t=Et.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==ar&&(e=Error(s(422),{cause:n}),Hl(zt(e,a)))):(n!==ar&&(t=Error(s(423),{cause:n}),Hl(zt(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=zt(n,a),r=qr(e.stateNode,n,r),mr(e,r),Ue!==4&&(Ue=2)),!1;var c=Error(s(520),{cause:n});if(c=zt(c,a),ni===null?ni=[c]:ni.push(c),Ue!==4&&(Ue=2),t===null)return!0;n=zt(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=qr(a.stateNode,n,e),mr(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ka===null||!ka.has(c))))return a.flags|=65536,r&=-r,a.lanes|=r,r=Cf(r),wf(r,e,a,n),mr(a,r),!1}a=a.return}while(a!==null);return!1}var Hr=Error(s(461)),Xe=!1;function lt(e,t,a,n){t.child=e===null?Rd(t,null,a,n):mn(t,e.child,a,n)}function Af(e,t,a,n,r){a=a.render;var c=t.ref;if("ref"in n){var h={};for(var v in n)v!=="ref"&&(h[v]=n[v])}else h=n;return cn(t),n=br(e,t,a,h,c,r),v=Sr(),e!==null&&!Xe?(xr(e,t,r),pa(e,t,r)):(ye&&v&&er(t),t.flags|=1,lt(e,t,n,r),t.child)}function Mf(e,t,a,n,r){if(e===null){var c=a.type;return typeof c=="function"&&!Jo(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,Rf(e,t,c,n,r)):(e=$i(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Vr(e,r)){var h=c.memoizedProps;if(a=a.compare,a=a!==null?a:Dl,a(h,n)&&e.ref===t.ref)return pa(e,t,r)}return t.flags|=1,e=ra(c,n),e.ref=t.ref,e.return=t,t.child=e}function Rf(e,t,a,n,r){if(e!==null){var c=e.memoizedProps;if(Dl(c,n)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=n=c,Vr(e,r))(e.flags&131072)!==0&&(Xe=!0);else return t.lanes=e.lanes,pa(e,t,r)}return kr(e,t,a,n,r)}function Of(e,t,a,n){var r=n.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,e!==null){for(n=t.child=e.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~c}else n=0,t.child=null;return jf(e,t,c,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&as(t,c!==null?c.cachePool:null),c!==null?zd(t,c):hr(),Id(t);else return n=t.lanes=536870912,jf(e,t,c!==null?c.baseLanes|a:a,a,n)}else c!==null?(as(t,c.cachePool),zd(t,c),Da(),t.memoizedState=null):(e!==null&&as(t,null),hr(),Da());return lt(e,t,r,a),t.child}function Zl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jf(e,t,a,n,r){var c=cr();return c=c===null?null:{parent:Ye._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&as(t,null),hr(),Id(t),e!==null&&Yn(e,t,n,!0),t.childLanes=r,null}function vs(e,t){return t=Ss({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zf(e,t,a){return mn(t,e.child,null,a),e=vs(t,t.pendingProps),e.flags|=2,Tt(t),t.memoizedState=null,e}function Fy(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ye){if(n.mode==="hidden")return e=vs(t,n),t.lanes=536870912,Zl(null,e);if(yr(t),(e=De)?(e=Ym(e,Lt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wa!==null?{id:Kt,overflow:Qt}:null,retryLane:536870912,hydrationErrors:null},a=hd(e),a.return=t,t.child=a,at=t,De=null)):e=null,e===null)throw Ma(t);return t.lanes=536870912,null}return vs(t,n)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(yr(t),r)if(t.flags&256)t.flags&=-257,t=zf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Xe||Yn(e,t,a,!1),r=(a&e.childLanes)!==0,Xe||r){if(n=ze,n!==null&&(h=Nu(n,a),h!==0&&h!==c.retryLane))throw c.retryLane=h,ln(e,h),vt(n,e,h),Hr;Ms(),t=zf(e,t,a)}else e=c.treeContext,De=Ht(h.nextSibling),at=t,ye=!0,Aa=null,Lt=!1,e!==null&&vd(t,e),t=vs(t,n),t.flags|=4096;return t}return e=ra(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bs(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function kr(e,t,a,n,r){return cn(t),a=br(e,t,a,n,void 0,r),n=Sr(),e!==null&&!Xe?(xr(e,t,r),pa(e,t,r)):(ye&&n&&er(t),t.flags|=1,lt(e,t,a,r),t.child)}function If(e,t,a,n,r,c){return cn(t),t.updateQueue=null,a=Ld(t,n,a,r),Dd(e),n=Sr(),e!==null&&!Xe?(xr(e,t,c),pa(e,t,c)):(ye&&n&&er(t),t.flags|=1,lt(e,t,a,c),t.child)}function Df(e,t,a,n,r){if(cn(t),t.stateNode===null){var c=Un,h=a.contextType;typeof h=="object"&&h!==null&&(c=nt(h)),c=new a(n,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Lr,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=n,c.state=t.memoizedState,c.refs={},dr(t),h=a.contextType,c.context=typeof h=="object"&&h!==null?nt(h):Un,c.state=t.memoizedState,h=a.getDerivedStateFromProps,typeof h=="function"&&(Dr(t,a,h,n),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&Lr.enqueueReplaceState(c,c.state,null),Yl(t,n,c,r),Fl(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){c=t.stateNode;var v=t.memoizedProps,E=hn(a,v);c.props=E;var j=c.context,H=a.contextType;h=Un,typeof H=="object"&&H!==null&&(h=nt(H));var G=a.getDerivedStateFromProps;H=typeof G=="function"||typeof c.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,H||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(v||j!==h)&&xf(t,c,n,h),Oa=!1;var I=t.memoizedState;c.state=I,Yl(t,n,c,r),Fl(),j=t.memoizedState,v||I!==j||Oa?(typeof G=="function"&&(Dr(t,a,G,n),j=t.memoizedState),(E=Oa||Sf(t,a,E,n,I,j,h))?(H||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=j),c.props=n,c.state=j,c.context=h,n=E):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{c=t.stateNode,fr(e,t),h=t.memoizedProps,H=hn(a,h),c.props=H,G=t.pendingProps,I=c.context,j=a.contextType,E=Un,typeof j=="object"&&j!==null&&(E=nt(j)),v=a.getDerivedStateFromProps,(j=typeof v=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==G||I!==E)&&xf(t,c,n,E),Oa=!1,I=t.memoizedState,c.state=I,Yl(t,n,c,r),Fl();var L=t.memoizedState;h!==G||I!==L||Oa||e!==null&&e.dependencies!==null&&es(e.dependencies)?(typeof v=="function"&&(Dr(t,a,v,n),L=t.memoizedState),(H=Oa||Sf(t,a,H,n,I,L,E)||e!==null&&e.dependencies!==null&&es(e.dependencies))?(j||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(n,L,E),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(n,L,E)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=L),c.props=n,c.state=L,c.context=E,n=H):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),n=!1)}return c=n,bs(e,t),n=(t.flags&128)!==0,c||n?(c=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&n?(t.child=mn(t,e.child,null,r),t.child=mn(t,null,a,r)):lt(e,t,a,r),t.memoizedState=c.state,e=t.child):e=pa(e,t,r),e}function Lf(e,t,a,n){return on(),t.flags|=256,lt(e,t,a,n),t.child}var Gr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ur(e){return{baseLanes:e,cachePool:Td()}}function Br(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ct),e}function qf(e,t,a){var n=t.pendingProps,r=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(Be.current&2)!==0),h&&(r=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(ye){if(r?Ia(t):Da(),(e=De)?(e=Ym(e,Lt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wa!==null?{id:Kt,overflow:Qt}:null,retryLane:536870912,hydrationErrors:null},a=hd(e),a.return=t,t.child=a,at=t,De=null)):e=null,e===null)throw Ma(t);return Tc(e)?t.lanes=32:t.lanes=536870912,null}var v=n.children;return n=n.fallback,r?(Da(),r=t.mode,v=Ss({mode:"hidden",children:v},r),n=sn(n,r,a,null),v.return=t,n.return=t,v.sibling=n,t.child=v,n=t.child,n.memoizedState=Ur(a),n.childLanes=Br(e,h,a),t.memoizedState=Gr,Zl(null,n)):(Ia(t),Pr(t,v))}var E=e.memoizedState;if(E!==null&&(v=E.dehydrated,v!==null)){if(c)t.flags&256?(Ia(t),t.flags&=-257,t=Fr(e,t,a)):t.memoizedState!==null?(Da(),t.child=e.child,t.flags|=128,t=null):(Da(),v=n.fallback,r=t.mode,n=Ss({mode:"visible",children:n.children},r),v=sn(v,r,a,null),v.flags|=2,n.return=t,v.return=t,n.sibling=v,t.child=n,mn(t,e.child,null,a),n=t.child,n.memoizedState=Ur(a),n.childLanes=Br(e,h,a),t.memoizedState=Gr,t=Zl(null,n));else if(Ia(t),Tc(v)){if(h=v.nextSibling&&v.nextSibling.dataset,h)var j=h.dgst;h=j,n=Error(s(419)),n.stack="",n.digest=h,Hl({value:n,source:null,stack:null}),t=Fr(e,t,a)}else if(Xe||Yn(e,t,a,!1),h=(a&e.childLanes)!==0,Xe||h){if(h=ze,h!==null&&(n=Nu(h,a),n!==0&&n!==E.retryLane))throw E.retryLane=n,ln(e,n),vt(h,e,n),Hr;Ec(v)||Ms(),t=Fr(e,t,a)}else Ec(v)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,De=Ht(v.nextSibling),at=t,ye=!0,Aa=null,Lt=!1,e!==null&&vd(t,e),t=Pr(t,n.children),t.flags|=4096);return t}return r?(Da(),v=n.fallback,r=t.mode,E=e.child,j=E.sibling,n=ra(E,{mode:"hidden",children:n.children}),n.subtreeFlags=E.subtreeFlags&65011712,j!==null?v=ra(j,v):(v=sn(v,r,a,null),v.flags|=2),v.return=t,n.return=t,n.sibling=v,t.child=n,Zl(null,n),n=t.child,v=e.child.memoizedState,v===null?v=Ur(a):(r=v.cachePool,r!==null?(E=Ye._currentValue,r=r.parent!==E?{parent:E,pool:E}:r):r=Td(),v={baseLanes:v.baseLanes|a,cachePool:r}),n.memoizedState=v,n.childLanes=Br(e,h,a),t.memoizedState=Gr,Zl(e.child,n)):(Ia(t),a=e.child,e=a.sibling,a=ra(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=a,t.memoizedState=null,a)}function Pr(e,t){return t=Ss({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ss(e,t){return e=Nt(22,e,null,t),e.lanes=0,e}function Fr(e,t,a){return mn(t,e.child,null,a),e=Pr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hf(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ir(e.return,t,a)}function Yr(e,t,a,n,r,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=n,h.tail=a,h.tailMode=r,h.treeForkCount=c)}function kf(e,t,a){var n=t.pendingProps,r=n.revealOrder,c=n.tail;n=n.children;var h=Be.current,v=(h&2)!==0;if(v?(h=h&1|2,t.flags|=128):h&=1,B(Be,h),lt(e,t,n,a),n=ye?ql:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hf(e,a,t);else if(e.tag===19)Hf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&rs(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Yr(t,!1,r,a,c,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&rs(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Yr(t,!0,a,null,c,n);break;case"together":Yr(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function pa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ha|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Yn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,a=ra(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ra(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Vr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&es(e)))}function Yy(e,t,a){switch(t.tag){case 3:Ze(t,t.stateNode.containerInfo),Ra(t,Ye,e.memoizedState.cache),on();break;case 27:case 5:Ja(t);break;case 4:Ze(t,t.stateNode.containerInfo);break;case 10:Ra(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yr(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Ia(t),t.flags|=128,null):(a&t.child.childLanes)!==0?qf(e,t,a):(Ia(t),e=pa(e,t,a),e!==null?e.sibling:null);Ia(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Yn(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return kf(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),B(Be,Be.current),n)break;return null;case 22:return t.lanes=0,Of(e,t,a,t.pendingProps);case 24:Ra(t,Ye,e.memoizedState.cache)}return pa(e,t,a)}function Gf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xe=!0;else{if(!Vr(e,a)&&(t.flags&128)===0)return Xe=!1,Yy(e,t,a);Xe=(e.flags&131072)!==0}else Xe=!1,ye&&(t.flags&1048576)!==0&&yd(t,ql,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=dn(t.elementType),t.type=e,typeof e=="function")Jo(e)?(n=hn(e,n),t.tag=1,t=Df(null,t,e,n,a)):(t.tag=0,t=kr(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===D){t.tag=11,t=Af(null,t,e,n,a);break e}else if(r===$){t.tag=14,t=Mf(null,t,e,n,a);break e}}throw t=Fe(e)||e,Error(s(306,t,""))}}return t;case 0:return kr(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=hn(n,t.pendingProps),Df(e,t,n,r,a);case 3:e:{if(Ze(t,t.stateNode.containerInfo),e===null)throw Error(s(387));n=t.pendingProps;var c=t.memoizedState;r=c.element,fr(e,t),Yl(t,n,null,a);var h=t.memoizedState;if(n=h.cache,Ra(t,Ye,n),n!==c.cache&&sr(t,[Ye],a,!0),Fl(),n=h.element,c.isDehydrated)if(c={element:n,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Lf(e,t,n,a);break e}else if(n!==r){r=zt(Error(s(424)),t),Hl(r),t=Lf(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,De=Ht(e.firstChild),at=t,ye=!0,Aa=null,Lt=!0,a=Rd(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(on(),n===r){t=pa(e,t,a);break e}lt(e,t,n,a)}t=t.child}return t;case 26:return bs(e,t),e===null?(a=Jm(t.type,null,t.pendingProps,null))?t.memoizedState=a:ye||(a=t.type,e=t.pendingProps,n=Ls(oe.current).createElement(a),n[tt]=t,n[ft]=e,it(n,a,e),$e(n),t.stateNode=n):t.memoizedState=Jm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ja(t),e===null&&ye&&(n=t.stateNode=Km(t.type,t.pendingProps,oe.current),at=t,Lt=!0,r=De,Pa(t.type)?(_c=r,De=Ht(n.firstChild)):De=r),lt(e,t,t.pendingProps.children,a),bs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ye&&((r=n=De)&&(n=xv(n,t.type,t.pendingProps,Lt),n!==null?(t.stateNode=n,at=t,De=Ht(n.firstChild),Lt=!1,r=!0):r=!1),r||Ma(t)),Ja(t),r=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,n=c.children,Sc(r,c)?n=null:h!==null&&Sc(r,h)&&(t.flags|=32),t.memoizedState!==null&&(r=br(e,t,Ly,null,null,a),di._currentValue=r),bs(e,t),lt(e,t,n,a),t.child;case 6:return e===null&&ye&&((e=a=De)&&(a=Nv(a,t.pendingProps,Lt),a!==null?(t.stateNode=a,at=t,De=null,e=!0):e=!1),e||Ma(t)),null;case 13:return qf(e,t,a);case 4:return Ze(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=mn(t,null,n,a):lt(e,t,n,a),t.child;case 11:return Af(e,t,t.type,t.pendingProps,a);case 7:return lt(e,t,t.pendingProps,a),t.child;case 8:return lt(e,t,t.pendingProps.children,a),t.child;case 12:return lt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Ra(t,t.type,n.value),lt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,cn(t),r=nt(r),n=n(r),t.flags|=1,lt(e,t,n,a),t.child;case 14:return Mf(e,t,t.type,t.pendingProps,a);case 15:return Rf(e,t,t.type,t.pendingProps,a);case 19:return kf(e,t,a);case 31:return Fy(e,t,a);case 22:return Of(e,t,a,t.pendingProps);case 24:return cn(t),n=nt(Ye),e===null?(r=cr(),r===null&&(r=ze,c=or(),r.pooledCache=c,c.refCount++,c!==null&&(r.pooledCacheLanes|=a),r=c),t.memoizedState={parent:n,cache:r},dr(t),Ra(t,Ye,r)):((e.lanes&a)!==0&&(fr(e,t),Yl(t,null,null,a),Fl()),r=e.memoizedState,c=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Ra(t,Ye,n)):(n=c.cache,Ra(t,Ye,n),n!==r.cache&&sr(t,[Ye],a,!0))),lt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function ha(e){e.flags|=4}function Xr(e,t,a,n,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(mm())e.flags|=8192;else throw fn=ls,ur}else e.flags&=-16777217}function Uf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ap(t))if(mm())e.flags|=8192;else throw fn=ls,ur}function xs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?bu():536870912,e.lanes|=t,nl|=t)}function Jl(e,t){if(!ye)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Le(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function Vy(e,t,a){var n=t.pendingProps;switch(tr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return Le(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),da(Ye),He(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Fn(t)?ha(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,nr())),Le(t),null;case 26:var r=t.type,c=t.memoizedState;return e===null?(ha(t),c!==null?(Le(t),Uf(t,c)):(Le(t),Xr(t,r,null,n,a))):c?c!==e.memoizedState?(ha(t),Le(t),Uf(t,c)):(Le(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&ha(t),Le(t),Xr(t,r,e,n,a)),null;case 27:if(Cn(t),a=oe.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ha(t);else{if(!n){if(t.stateNode===null)throw Error(s(166));return Le(t),null}e=Z.current,Fn(t)?bd(t):(e=Km(r,n,a),t.stateNode=e,ha(t))}return Le(t),null;case 5:if(Cn(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ha(t);else{if(!n){if(t.stateNode===null)throw Error(s(166));return Le(t),null}if(c=Z.current,Fn(t))bd(t);else{var h=Ls(oe.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof n.is=="string"?h.createElement("select",{is:n.is}):h.createElement("select"),n.multiple?c.multiple=!0:n.size&&(c.size=n.size);break;default:c=typeof n.is=="string"?h.createElement(r,{is:n.is}):h.createElement(r)}}c[tt]=t,c[ft]=n;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(it(c,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&ha(t)}}return Le(t),Xr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&ha(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(s(166));if(e=oe.current,Fn(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=at,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[tt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||qm(e.nodeValue,a)),e||Ma(t,!0)}else e=Ls(e).createTextNode(n),e[tt]=t,t.stateNode=e}return Le(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Fn(t),a!==null){if(e===null){if(!n)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[tt]=t}else on(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Le(t),e=!1}else a=nr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Tt(t),t):(Tt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Le(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Fn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(s(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));r[tt]=t}else on(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Le(t),r=!1}else r=nr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Tt(t),t):(Tt(t),null)}return Tt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==r&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),xs(t,t.updateQueue),Le(t),null);case 4:return He(),e===null&&hc(t.stateNode.containerInfo),Le(t),null;case 10:return da(t.type),Le(t),null;case 19:if(T(Be),n=t.memoizedState,n===null)return Le(t),null;if(r=(t.flags&128)!==0,c=n.rendering,c===null)if(r)Jl(n,!1);else{if(Ue!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=rs(e),c!==null){for(t.flags|=128,Jl(n,!1),e=c.updateQueue,t.updateQueue=e,xs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)pd(a,e),a=a.sibling;return B(Be,Be.current&1|2),ye&&ca(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Je()>Cs&&(t.flags|=128,r=!0,Jl(n,!1),t.lanes=4194304)}else{if(!r)if(e=rs(c),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,xs(t,e),Jl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!c.alternate&&!ye)return Le(t),null}else 2*Je()-n.renderingStartTime>Cs&&a!==536870912&&(t.flags|=128,r=!0,Jl(n,!1),t.lanes=4194304);n.isBackwards?(c.sibling=t.child,t.child=c):(e=n.last,e!==null?e.sibling=c:t.child=c,n.last=c)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Je(),e.sibling=null,a=Be.current,B(Be,r?a&1|2:a&1),ye&&ca(t,n.treeForkCount),e):(Le(t),null);case 22:case 23:return Tt(t),gr(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),a=t.updateQueue,a!==null&&xs(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&T(un),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),da(Ye),Le(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function Xy(e,t){switch(tr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return da(Ye),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Cn(t),null;case 31:if(t.memoizedState!==null){if(Tt(t),t.alternate===null)throw Error(s(340));on()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Tt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));on()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return T(Be),null;case 4:return He(),null;case 10:return da(t.type),null;case 22:case 23:return Tt(t),gr(),e!==null&&T(un),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return da(Ye),null;case 25:return null;default:return null}}function Bf(e,t){switch(tr(t),t.tag){case 3:da(Ye),He();break;case 26:case 27:case 5:Cn(t);break;case 4:He();break;case 31:t.memoizedState!==null&&Tt(t);break;case 13:Tt(t);break;case 19:T(Be);break;case 10:da(t.type);break;case 22:case 23:Tt(t),gr(),e!==null&&T(un);break;case 24:da(Ye)}}function $l(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var c=a.create,h=a.inst;n=c(),h.destroy=n}a=a.next}while(a!==r)}}catch(v){Me(t,t.return,v)}}function La(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var c=r.next;n=c;do{if((n.tag&e)===e){var h=n.inst,v=h.destroy;if(v!==void 0){h.destroy=void 0,r=t;var E=a,j=v;try{j()}catch(H){Me(r,E,H)}}}n=n.next}while(n!==c)}}catch(H){Me(t,t.return,H)}}function Pf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{jd(t,a)}catch(n){Me(e,e.return,n)}}}function Ff(e,t,a){a.props=hn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Me(e,t,n)}}function Wl(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(r){Me(e,t,r)}}function Zt(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){Me(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){Me(e,t,r)}else a.current=null}function Yf(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){Me(e,e.return,r)}}function Kr(e,t,a){try{var n=e.stateNode;hv(n,e.type,a,t),n[ft]=t}catch(r){Me(e,e.return,r)}}function Vf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Pa(e.type)||e.tag===4}function Qr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Pa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zr(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=sa));else if(n!==4&&(n===27&&Pa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Zr(e,t,a),e=e.sibling;e!==null;)Zr(e,t,a),e=e.sibling}function Ns(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Pa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ns(e,t,a),e=e.sibling;e!==null;)Ns(e,t,a),e=e.sibling}function Xf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);it(t,n,a),t[tt]=e,t[ft]=a}catch(c){Me(e,e.return,c)}}var ga=!1,Ke=!1,Jr=!1,Kf=typeof WeakSet=="function"?WeakSet:Set,We=null;function Ky(e,t){if(e=e.containerInfo,vc=Ps,e=id(e),Fo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,c=n.focusNode;n=n.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break e}var h=0,v=-1,E=-1,j=0,H=0,G=e,I=null;t:for(;;){for(var L;G!==a||r!==0&&G.nodeType!==3||(v=h+r),G!==c||n!==0&&G.nodeType!==3||(E=h+n),G.nodeType===3&&(h+=G.nodeValue.length),(L=G.firstChild)!==null;)I=G,G=L;for(;;){if(G===e)break t;if(I===a&&++j===r&&(v=h),I===c&&++H===n&&(E=h),(L=G.nextSibling)!==null)break;G=I,I=G.parentNode}G=L}a=v===-1||E===-1?null:{start:v,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(bc={focusedElem:e,selectionRange:a},Ps=!1,We=t;We!==null;)if(t=We,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,We=e;else for(;We!==null;){switch(t=We,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,a=t,r=c.memoizedProps,c=c.memoizedState,n=a.stateNode;try{var W=hn(a.type,r);e=n.getSnapshotBeforeUpdate(W,c),n.__reactInternalSnapshotBeforeUpdate=e}catch(se){Me(a,a.return,se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Nc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,We=e;break}We=t.return}}function Qf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:va(e,a),n&4&&$l(5,a);break;case 1:if(va(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(h){Me(a,a.return,h)}else{var r=hn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Me(a,a.return,h)}}n&64&&Pf(a),n&512&&Wl(a,a.return);break;case 3:if(va(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{jd(e,t)}catch(h){Me(a,a.return,h)}}break;case 27:t===null&&n&4&&Xf(a);case 26:case 5:va(e,a),t===null&&n&4&&Yf(a),n&512&&Wl(a,a.return);break;case 12:va(e,a);break;case 31:va(e,a),n&4&&$f(e,a);break;case 13:va(e,a),n&4&&Wf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=nv.bind(null,a),Ev(e,a))));break;case 22:if(n=a.memoizedState!==null||ga,!n){t=t!==null&&t.memoizedState!==null||Ke,r=ga;var c=Ke;ga=n,(Ke=t)&&!c?ba(e,a,(a.subtreeFlags&8772)!==0):va(e,a),ga=r,Ke=c}break;case 30:break;default:va(e,a)}}function Zf(e){var t=e.alternate;t!==null&&(e.alternate=null,Zf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var qe=null,pt=!1;function ya(e,t,a){for(a=a.child;a!==null;)Jf(e,t,a),a=a.sibling}function Jf(e,t,a){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(El,a)}catch{}switch(a.tag){case 26:Ke||Zt(a,t),ya(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ke||Zt(a,t);var n=qe,r=pt;Pa(a.type)&&(qe=a.stateNode,pt=!1),ya(e,t,a),ri(a.stateNode),qe=n,pt=r;break;case 5:Ke||Zt(a,t);case 6:if(n=qe,r=pt,qe=null,ya(e,t,a),qe=n,pt=r,qe!==null)if(pt)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(a.stateNode)}catch(c){Me(a,t,c)}else try{qe.removeChild(a.stateNode)}catch(c){Me(a,t,c)}break;case 18:qe!==null&&(pt?(e=qe,Pm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),dl(e)):Pm(qe,a.stateNode));break;case 4:n=qe,r=pt,qe=a.stateNode.containerInfo,pt=!0,ya(e,t,a),qe=n,pt=r;break;case 0:case 11:case 14:case 15:La(2,a,t),Ke||La(4,a,t),ya(e,t,a);break;case 1:Ke||(Zt(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&Ff(a,t,n)),ya(e,t,a);break;case 21:ya(e,t,a);break;case 22:Ke=(n=Ke)||a.memoizedState!==null,ya(e,t,a),Ke=n;break;default:ya(e,t,a)}}function $f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{dl(e)}catch(a){Me(t,t.return,a)}}}function Wf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{dl(e)}catch(a){Me(t,t.return,a)}}function Qy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Kf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Kf),t;default:throw Error(s(435,e.tag))}}function Es(e,t){var a=Qy(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=lv.bind(null,e,n);n.then(r,r)}})}function ht(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],c=e,h=t,v=h;e:for(;v!==null;){switch(v.tag){case 27:if(Pa(v.type)){qe=v.stateNode,pt=!1;break e}break;case 5:qe=v.stateNode,pt=!1;break e;case 3:case 4:qe=v.stateNode.containerInfo,pt=!0;break e}v=v.return}if(qe===null)throw Error(s(160));Jf(c,h,r),qe=null,pt=!1,c=r.alternate,c!==null&&(c.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)em(t,e),t=t.sibling}var Bt=null;function em(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ht(t,e),gt(e),n&4&&(La(3,e,e.return),$l(3,e),La(5,e,e.return));break;case 1:ht(t,e),gt(e),n&512&&(Ke||a===null||Zt(a,a.return)),n&64&&ga&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=Bt;if(ht(t,e),gt(e),n&512&&(Ke||a===null||Zt(a,a.return)),n&4){var c=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":c=r.getElementsByTagName("title")[0],(!c||c[Cl]||c[tt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=r.createElement(n),r.head.insertBefore(c,r.querySelector("head > title"))),it(c,n,a),c[tt]=e,$e(c),n=c;break e;case"link":var h=ep("link","href",r).get(n+(a.href||""));if(h){for(var v=0;v<h.length;v++)if(c=h[v],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){h.splice(v,1);break t}}c=r.createElement(n),it(c,n,a),r.head.appendChild(c);break;case"meta":if(h=ep("meta","content",r).get(n+(a.content||""))){for(v=0;v<h.length;v++)if(c=h[v],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){h.splice(v,1);break t}}c=r.createElement(n),it(c,n,a),r.head.appendChild(c);break;default:throw Error(s(468,n))}c[tt]=e,$e(c),n=c}e.stateNode=n}else tp(r,e.type,e.stateNode);else e.stateNode=Wm(r,n,e.memoizedProps);else c!==n?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,n===null?tp(r,e.type,e.stateNode):Wm(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Kr(e,e.memoizedProps,a.memoizedProps)}break;case 27:ht(t,e),gt(e),n&512&&(Ke||a===null||Zt(a,a.return)),a!==null&&n&4&&Kr(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ht(t,e),gt(e),n&512&&(Ke||a===null||Zt(a,a.return)),e.flags&32){r=e.stateNode;try{In(r,"")}catch(W){Me(e,e.return,W)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,Kr(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Jr=!0);break;case 6:if(ht(t,e),gt(e),n&4){if(e.stateNode===null)throw Error(s(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(W){Me(e,e.return,W)}}break;case 3:if(ks=null,r=Bt,Bt=qs(t.containerInfo),ht(t,e),Bt=r,gt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{dl(t.containerInfo)}catch(W){Me(e,e.return,W)}Jr&&(Jr=!1,tm(e));break;case 4:n=Bt,Bt=qs(e.stateNode.containerInfo),ht(t,e),gt(e),Bt=n;break;case 12:ht(t,e),gt(e);break;case 31:ht(t,e),gt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Es(e,n)));break;case 13:ht(t,e),gt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(_s=Je()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Es(e,n)));break;case 22:r=e.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,j=ga,H=Ke;if(ga=j||r,Ke=H||E,ht(t,e),Ke=H,ga=j,gt(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||E||ga||Ke||gn(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){E=a=t;try{if(c=E.stateNode,r)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{v=E.stateNode;var G=E.memoizedProps.style,I=G!=null&&G.hasOwnProperty("display")?G.display:null;v.style.display=I==null||typeof I=="boolean"?"":(""+I).trim()}}catch(W){Me(E,E.return,W)}}}else if(t.tag===6){if(a===null){E=t;try{E.stateNode.nodeValue=r?"":E.memoizedProps}catch(W){Me(E,E.return,W)}}}else if(t.tag===18){if(a===null){E=t;try{var L=E.stateNode;r?Fm(L,!0):Fm(E.stateNode,!1)}catch(W){Me(E,E.return,W)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Es(e,a))));break;case 19:ht(t,e),gt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Es(e,n)));break;case 30:break;case 21:break;default:ht(t,e),gt(e)}}function gt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(Vf(n)){a=n;break}n=n.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var r=a.stateNode,c=Qr(e);Ns(e,c,r);break;case 5:var h=a.stateNode;a.flags&32&&(In(h,""),a.flags&=-33);var v=Qr(e);Ns(e,v,h);break;case 3:case 4:var E=a.stateNode.containerInfo,j=Qr(e);Zr(e,j,E);break;default:throw Error(s(161))}}catch(H){Me(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;tm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function va(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Qf(e,t.alternate,t),t=t.sibling}function gn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:La(4,t,t.return),gn(t);break;case 1:Zt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Ff(t,t.return,a),gn(t);break;case 27:ri(t.stateNode);case 26:case 5:Zt(t,t.return),gn(t);break;case 22:t.memoizedState===null&&gn(t);break;case 30:gn(t);break;default:gn(t)}e=e.sibling}}function ba(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,r=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:ba(r,c,a),$l(4,c);break;case 1:if(ba(r,c,a),n=c,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(j){Me(n,n.return,j)}if(n=c,r=n.updateQueue,r!==null){var v=n.stateNode;try{var E=r.shared.hiddenCallbacks;if(E!==null)for(r.shared.hiddenCallbacks=null,r=0;r<E.length;r++)Od(E[r],v)}catch(j){Me(n,n.return,j)}}a&&h&64&&Pf(c),Wl(c,c.return);break;case 27:Xf(c);case 26:case 5:ba(r,c,a),a&&n===null&&h&4&&Yf(c),Wl(c,c.return);break;case 12:ba(r,c,a);break;case 31:ba(r,c,a),a&&h&4&&$f(r,c);break;case 13:ba(r,c,a),a&&h&4&&Wf(r,c);break;case 22:c.memoizedState===null&&ba(r,c,a),Wl(c,c.return);break;case 30:break;default:ba(r,c,a)}t=t.sibling}}function $r(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&kl(a))}function Wr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&kl(e))}function Pt(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)am(e,t,a,n),t=t.sibling}function am(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Pt(e,t,a,n),r&2048&&$l(9,t);break;case 1:Pt(e,t,a,n);break;case 3:Pt(e,t,a,n),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&kl(e)));break;case 12:if(r&2048){Pt(e,t,a,n),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,v=c.onPostCommit;typeof v=="function"&&v(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Me(t,t.return,E)}}else Pt(e,t,a,n);break;case 31:Pt(e,t,a,n);break;case 13:Pt(e,t,a,n);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Pt(e,t,a,n):ei(e,t):c._visibility&2?Pt(e,t,a,n):(c._visibility|=2,el(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&$r(h,t);break;case 24:Pt(e,t,a,n),r&2048&&Wr(t.alternate,t);break;default:Pt(e,t,a,n)}}function el(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,v=a,E=n,j=h.flags;switch(h.tag){case 0:case 11:case 15:el(c,h,v,E,r),$l(8,h);break;case 23:break;case 22:var H=h.stateNode;h.memoizedState!==null?H._visibility&2?el(c,h,v,E,r):ei(c,h):(H._visibility|=2,el(c,h,v,E,r)),r&&j&2048&&$r(h.alternate,h);break;case 24:el(c,h,v,E,r),r&&j&2048&&Wr(h.alternate,h);break;default:el(c,h,v,E,r)}t=t.sibling}}function ei(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,r=n.flags;switch(n.tag){case 22:ei(a,n),r&2048&&$r(n.alternate,n);break;case 24:ei(a,n),r&2048&&Wr(n.alternate,n);break;default:ei(a,n)}t=t.sibling}}var ti=8192;function tl(e,t,a){if(e.subtreeFlags&ti)for(e=e.child;e!==null;)nm(e,t,a),e=e.sibling}function nm(e,t,a){switch(e.tag){case 26:tl(e,t,a),e.flags&ti&&e.memoizedState!==null&&Dv(a,Bt,e.memoizedState,e.memoizedProps);break;case 5:tl(e,t,a);break;case 3:case 4:var n=Bt;Bt=qs(e.stateNode.containerInfo),tl(e,t,a),Bt=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ti,ti=16777216,tl(e,t,a),ti=n):tl(e,t,a));break;default:tl(e,t,a)}}function lm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ai(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];We=n,sm(n,e)}lm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)im(e),e=e.sibling}function im(e){switch(e.tag){case 0:case 11:case 15:ai(e),e.flags&2048&&La(9,e,e.return);break;case 3:ai(e);break;case 12:ai(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ts(e)):ai(e);break;default:ai(e)}}function Ts(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];We=n,sm(n,e)}lm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:La(8,t,t.return),Ts(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ts(t));break;default:Ts(t)}e=e.sibling}}function sm(e,t){for(;We!==null;){var a=We;switch(a.tag){case 0:case 11:case 15:La(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:kl(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,We=n;else e:for(a=e;We!==null;){n=We;var r=n.sibling,c=n.return;if(Zf(n),n===a){We=null;break e}if(r!==null){r.return=c,We=r;break e}We=c}}}var Zy={getCacheForType:function(e){var t=nt(Ye),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return nt(Ye).controller.signal}},Jy=typeof WeakMap=="function"?WeakMap:Map,_e=0,ze=null,fe=null,pe=0,Ae=0,_t=null,qa=!1,al=!1,ec=!1,Sa=0,Ue=0,Ha=0,yn=0,tc=0,Ct=0,nl=0,ni=null,yt=null,ac=!1,_s=0,om=0,Cs=1/0,ws=null,ka=null,Qe=0,Ga=null,ll=null,xa=0,nc=0,lc=null,rm=null,li=0,ic=null;function wt(){return(_e&2)!==0&&pe!==0?pe&-pe:A.T!==null?dc():Eu()}function cm(){if(Ct===0)if((pe&536870912)===0||ye){var e=Di;Di<<=1,(Di&3932160)===0&&(Di=262144),Ct=e}else Ct=536870912;return e=Et.current,e!==null&&(e.flags|=32),Ct}function vt(e,t,a){(e===ze&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)&&(il(e,0),Ua(e,pe,Ct,!1)),_l(e,a),((_e&2)===0||e!==ze)&&(e===ze&&((_e&2)===0&&(yn|=a),Ue===4&&Ua(e,pe,Ct,!1)),Jt(e))}function um(e,t,a){if((_e&6)!==0)throw Error(s(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Tl(e,t),r=n?ev(e,t):oc(e,t,!0),c=n;do{if(r===0){al&&!n&&Ua(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!$y(a)){r=oc(e,t,!1),c=!1;continue}if(r===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var v=e;r=ni;var E=v.current.memoizedState.isDehydrated;if(E&&(il(v,h).flags|=256),h=oc(v,h,!1),h!==2){if(ec&&!E){v.errorRecoveryDisabledLanes|=c,yn|=c,r=4;break e}c=yt,yt=r,c!==null&&(yt===null?yt=c:yt.push.apply(yt,c))}r=h}if(c=!1,r!==2)continue}}if(r===1){il(e,0),Ua(e,t,0,!0);break}e:{switch(n=e,c=r,c){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:Ua(n,t,Ct,!qa);break e;case 2:yt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(r=_s+300-Je(),10<r)){if(Ua(n,t,Ct,!qa),qi(n,0,!0)!==0)break e;xa=t,n.timeoutHandle=Um(dm.bind(null,n,a,yt,ws,ac,t,Ct,yn,nl,qa,c,"Throttled",-0,0),r);break e}dm(n,a,yt,ws,ac,t,Ct,yn,nl,qa,c,null,-0,0)}}break}while(!0);Jt(e)}function dm(e,t,a,n,r,c,h,v,E,j,H,G,I,L){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sa},nm(t,c,G);var W=(c&62914560)===c?_s-Je():(c&4194048)===c?om-Je():0;if(W=Lv(G,W),W!==null){xa=c,e.cancelPendingCommit=W(bm.bind(null,e,t,c,a,n,r,h,v,E,H,G,null,I,L)),Ua(e,c,h,!j);return}}bm(e,t,c,a,n,r,h,v,E)}function $y(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var r=a[n],c=r.getSnapshot;r=r.value;try{if(!xt(c(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ua(e,t,a,n){t&=~tc,t&=~yn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var c=31-St(r),h=1<<c;n[c]=-1,r&=~h}a!==0&&Su(e,a,t)}function As(){return(_e&6)===0?(ii(0),!1):!0}function sc(){if(fe!==null){if(Ae===0)var e=fe.return;else e=fe,ua=rn=null,Nr(e),Qn=null,Ul=0,e=fe;for(;e!==null;)Bf(e.alternate,e),e=e.return;fe=null}}function il(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,vv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),xa=0,sc(),ze=e,fe=a=ra(e.current,null),pe=t,Ae=0,_t=null,qa=!1,al=Tl(e,t),ec=!1,nl=Ct=tc=yn=Ha=Ue=0,yt=ni=null,ac=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-St(n),c=1<<r;t|=e[r],n&=~c}return Sa=t,Qi(),a}function fm(e,t){ce=null,A.H=Ql,t===Kn||t===ns?(t=wd(),Ae=3):t===ur?(t=wd(),Ae=4):Ae=t===Hr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,_t=t,fe===null&&(Ue=1,ys(e,zt(t,e.current)))}function mm(){var e=Et.current;return e===null?!0:(pe&4194048)===pe?qt===null:(pe&62914560)===pe||(pe&536870912)!==0?e===qt:!1}function pm(){var e=A.H;return A.H=Ql,e===null?Ql:e}function hm(){var e=A.A;return A.A=Zy,e}function Ms(){Ue=4,qa||(pe&4194048)!==pe&&Et.current!==null||(al=!0),(Ha&134217727)===0&&(yn&134217727)===0||ze===null||Ua(ze,pe,Ct,!1)}function oc(e,t,a){var n=_e;_e|=2;var r=pm(),c=hm();(ze!==e||pe!==t)&&(ws=null,il(e,t)),t=!1;var h=Ue;e:do try{if(Ae!==0&&fe!==null){var v=fe,E=_t;switch(Ae){case 8:sc(),h=6;break e;case 3:case 2:case 9:case 6:Et.current===null&&(t=!0);var j=Ae;if(Ae=0,_t=null,sl(e,v,E,j),a&&al){h=0;break e}break;default:j=Ae,Ae=0,_t=null,sl(e,v,E,j)}}Wy(),h=Ue;break}catch(H){fm(e,H)}while(!0);return t&&e.shellSuspendCounter++,ua=rn=null,_e=n,A.H=r,A.A=c,fe===null&&(ze=null,pe=0,Qi()),h}function Wy(){for(;fe!==null;)gm(fe)}function ev(e,t){var a=_e;_e|=2;var n=pm(),r=hm();ze!==e||pe!==t?(ws=null,Cs=Je()+500,il(e,t)):al=Tl(e,t);e:do try{if(Ae!==0&&fe!==null){t=fe;var c=_t;t:switch(Ae){case 1:Ae=0,_t=null,sl(e,t,c,1);break;case 2:case 9:if(_d(c)){Ae=0,_t=null,ym(t);break}t=function(){Ae!==2&&Ae!==9||ze!==e||(Ae=7),Jt(e)},c.then(t,t);break e;case 3:Ae=7;break e;case 4:Ae=5;break e;case 7:_d(c)?(Ae=0,_t=null,ym(t)):(Ae=0,_t=null,sl(e,t,c,7));break;case 5:var h=null;switch(fe.tag){case 26:h=fe.memoizedState;case 5:case 27:var v=fe;if(h?ap(h):v.stateNode.complete){Ae=0,_t=null;var E=v.sibling;if(E!==null)fe=E;else{var j=v.return;j!==null?(fe=j,Rs(j)):fe=null}break t}}Ae=0,_t=null,sl(e,t,c,5);break;case 6:Ae=0,_t=null,sl(e,t,c,6);break;case 8:sc(),Ue=6;break e;default:throw Error(s(462))}}tv();break}catch(H){fm(e,H)}while(!0);return ua=rn=null,A.H=n,A.A=r,_e=a,fe!==null?0:(ze=null,pe=0,Qi(),Ue)}function tv(){for(;fe!==null&&!ve();)gm(fe)}function gm(e){var t=Gf(e.alternate,e,Sa);e.memoizedProps=e.pendingProps,t===null?Rs(e):fe=t}function ym(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=If(a,t,t.pendingProps,t.type,void 0,pe);break;case 11:t=If(a,t,t.pendingProps,t.type.render,t.ref,pe);break;case 5:Nr(t);default:Bf(a,t),t=fe=pd(t,Sa),t=Gf(a,t,Sa)}e.memoizedProps=e.pendingProps,t===null?Rs(e):fe=t}function sl(e,t,a,n){ua=rn=null,Nr(t),Qn=null,Ul=0;var r=t.return;try{if(Py(e,r,t,a,pe)){Ue=1,ys(e,zt(a,e.current)),fe=null;return}}catch(c){if(r!==null)throw fe=r,c;Ue=1,ys(e,zt(a,e.current)),fe=null;return}t.flags&32768?(ye||n===1?e=!0:al||(pe&536870912)!==0?e=!1:(qa=e=!0,(n===2||n===9||n===3||n===6)&&(n=Et.current,n!==null&&n.tag===13&&(n.flags|=16384))),vm(t,e)):Rs(t)}function Rs(e){var t=e;do{if((t.flags&32768)!==0){vm(t,qa);return}e=t.return;var a=Vy(t.alternate,t,Sa);if(a!==null){fe=a;return}if(t=t.sibling,t!==null){fe=t;return}fe=t=e}while(t!==null);Ue===0&&(Ue=5)}function vm(e,t){do{var a=Xy(e.alternate,e);if(a!==null){a.flags&=32767,fe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){fe=e;return}fe=e=a}while(e!==null);Ue=6,fe=null}function bm(e,t,a,n,r,c,h,v,E){e.cancelPendingCommit=null;do Os();while(Qe!==0);if((_e&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(c=t.lanes|t.childLanes,c|=Qo,Ig(e,a,c,h,v,E),e===ze&&(fe=ze=null,pe=0),ll=t,Ga=e,xa=a,nc=c,lc=r,rm=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,iv(zi,function(){return Tm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null,r=V.p,V.p=2,h=_e,_e|=4;try{Ky(e,t,a)}finally{_e=h,V.p=r,A.T=n}}Qe=1,Sm(),xm(),Nm()}}function Sm(){if(Qe===1){Qe=0;var e=Ga,t=ll,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null;var n=V.p;V.p=2;var r=_e;_e|=4;try{em(t,e);var c=bc,h=id(e.containerInfo),v=c.focusedElem,E=c.selectionRange;if(h!==v&&v&&v.ownerDocument&&ld(v.ownerDocument.documentElement,v)){if(E!==null&&Fo(v)){var j=E.start,H=E.end;if(H===void 0&&(H=j),"selectionStart"in v)v.selectionStart=j,v.selectionEnd=Math.min(H,v.value.length);else{var G=v.ownerDocument||document,I=G&&G.defaultView||window;if(I.getSelection){var L=I.getSelection(),W=v.textContent.length,se=Math.min(E.start,W),je=E.end===void 0?se:Math.min(E.end,W);!L.extend&&se>je&&(h=je,je=se,se=h);var R=nd(v,se),_=nd(v,je);if(R&&_&&(L.rangeCount!==1||L.anchorNode!==R.node||L.anchorOffset!==R.offset||L.focusNode!==_.node||L.focusOffset!==_.offset)){var O=G.createRange();O.setStart(R.node,R.offset),L.removeAllRanges(),se>je?(L.addRange(O),L.extend(_.node,_.offset)):(O.setEnd(_.node,_.offset),L.addRange(O))}}}}for(G=[],L=v;L=L.parentNode;)L.nodeType===1&&G.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<G.length;v++){var k=G[v];k.element.scrollLeft=k.left,k.element.scrollTop=k.top}}Ps=!!vc,bc=vc=null}finally{_e=r,V.p=n,A.T=a}}e.current=t,Qe=2}}function xm(){if(Qe===2){Qe=0;var e=Ga,t=ll,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=A.T,A.T=null;var n=V.p;V.p=2;var r=_e;_e|=4;try{Qf(e,t.alternate,t)}finally{_e=r,V.p=n,A.T=a}}Qe=3}}function Nm(){if(Qe===4||Qe===3){Qe=0,Mt();var e=Ga,t=ll,a=xa,n=rm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qe=5:(Qe=0,ll=Ga=null,Em(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(ka=null),_o(a),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(El,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=A.T,r=V.p,V.p=2,A.T=null;try{for(var c=e.onRecoverableError,h=0;h<n.length;h++){var v=n[h];c(v.value,{componentStack:v.stack})}}finally{A.T=t,V.p=r}}(xa&3)!==0&&Os(),Jt(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===ic?li++:(li=0,ic=e):li=0,ii(0)}}function Em(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,kl(t)))}function Os(){return Sm(),xm(),Nm(),Tm()}function Tm(){if(Qe!==5)return!1;var e=Ga,t=nc;nc=0;var a=_o(xa),n=A.T,r=V.p;try{V.p=32>a?32:a,A.T=null,a=lc,lc=null;var c=Ga,h=xa;if(Qe=0,ll=Ga=null,xa=0,(_e&6)!==0)throw Error(s(331));var v=_e;if(_e|=4,im(c.current),am(c,c.current,h,a),_e=v,ii(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(El,c)}catch{}return!0}finally{V.p=r,A.T=n,Em(e,t)}}function _m(e,t,a){t=zt(a,t),t=qr(e.stateNode,t,2),e=za(e,t,2),e!==null&&(_l(e,2),Jt(e))}function Me(e,t,a){if(e.tag===3)_m(e,e,a);else for(;t!==null;){if(t.tag===3){_m(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ka===null||!ka.has(n))){e=zt(a,e),a=Cf(2),n=za(t,a,2),n!==null&&(wf(a,n,t,e),_l(n,2),Jt(n));break}}t=t.return}}function rc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Jy;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(a)||(ec=!0,r.add(a),e=av.bind(null,e,t,a),t.then(e,e))}function av(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ze===e&&(pe&a)===a&&(Ue===4||Ue===3&&(pe&62914560)===pe&&300>Je()-_s?(_e&2)===0&&il(e,0):tc|=a,nl===pe&&(nl=0)),Jt(e)}function Cm(e,t){t===0&&(t=bu()),e=ln(e,t),e!==null&&(_l(e,t),Jt(e))}function nv(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Cm(e,a)}function lv(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(s(314))}n!==null&&n.delete(t),Cm(e,a)}function iv(e,t){return Se(e,t)}var js=null,ol=null,cc=!1,zs=!1,uc=!1,Ba=0;function Jt(e){e!==ol&&e.next===null&&(ol===null?js=ol=e:ol=ol.next=e),zs=!0,cc||(cc=!0,ov())}function ii(e,t){if(!uc&&zs){uc=!0;do for(var a=!1,n=js;n!==null;){if(e!==0){var r=n.pendingLanes;if(r===0)var c=0;else{var h=n.suspendedLanes,v=n.pingedLanes;c=(1<<31-St(42|e)+1)-1,c&=r&~(h&~v),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,Rm(n,c))}else c=pe,c=qi(n,n===ze?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(c&3)===0||Tl(n,c)||(a=!0,Rm(n,c));n=n.next}while(a);uc=!1}}function sv(){wm()}function wm(){zs=cc=!1;var e=0;Ba!==0&&yv()&&(e=Ba);for(var t=Je(),a=null,n=js;n!==null;){var r=n.next,c=Am(n,t);c===0?(n.next=null,a===null?js=r:a.next=r,r===null&&(ol=a)):(a=n,(e!==0||(c&3)!==0)&&(zs=!0)),n=r}Qe!==0&&Qe!==5||ii(e),Ba!==0&&(Ba=0)}function Am(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-St(c),v=1<<h,E=r[h];E===-1?((v&a)===0||(v&n)!==0)&&(r[h]=zg(v,t)):E<=t&&(e.expiredLanes|=v),c&=~v}if(t=ze,a=pe,a=qi(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&ut(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Tl(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&ut(n),_o(a)){case 2:case 8:a=yu;break;case 32:a=zi;break;case 268435456:a=vu;break;default:a=zi}return n=Mm.bind(null,e),a=Se(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&ut(n),e.callbackPriority=2,e.callbackNode=null,2}function Mm(e,t){if(Qe!==0&&Qe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Os()&&e.callbackNode!==a)return null;var n=pe;return n=qi(e,e===ze?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(um(e,n,t),Am(e,Je()),e.callbackNode!=null&&e.callbackNode===a?Mm.bind(null,e):null)}function Rm(e,t){if(Os())return null;um(e,t,!0)}function ov(){bv(function(){(_e&6)!==0?Se(gu,sv):wm()})}function dc(){if(Ba===0){var e=Vn;e===0&&(e=Ii,Ii<<=1,(Ii&261888)===0&&(Ii=256)),Ba=e}return Ba}function Om(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ui(""+e)}function jm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function rv(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var c=Om((r[ft]||null).action),h=n.submitter;h&&(t=(t=h[ft]||null)?Om(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var v=new Yi("action","action",null,n,r);e.push({event:v,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Ba!==0){var E=h?jm(r,h):new FormData(r);Or(a,{pending:!0,data:E,method:r.method,action:c},null,E)}}else typeof c=="function"&&(v.preventDefault(),E=h?jm(r,h):new FormData(r),Or(a,{pending:!0,data:E,method:r.method,action:c},c,E))},currentTarget:r}]})}}for(var fc=0;fc<Ko.length;fc++){var mc=Ko[fc],cv=mc.toLowerCase(),uv=mc[0].toUpperCase()+mc.slice(1);Ut(cv,"on"+uv)}Ut(rd,"onAnimationEnd"),Ut(cd,"onAnimationIteration"),Ut(ud,"onAnimationStart"),Ut("dblclick","onDoubleClick"),Ut("focusin","onFocus"),Ut("focusout","onBlur"),Ut(Cy,"onTransitionRun"),Ut(wy,"onTransitionStart"),Ut(Ay,"onTransitionCancel"),Ut(dd,"onTransitionEnd"),jn("onMouseEnter",["mouseout","mouseover"]),jn("onMouseLeave",["mouseout","mouseover"]),jn("onPointerEnter",["pointerout","pointerover"]),jn("onPointerLeave",["pointerout","pointerover"]),en("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),en("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),en("onBeforeInput",["compositionend","keypress","textInput","paste"]),en("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),en("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),en("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var si="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(si));function zm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],r=n.event;n=n.listeners;e:{var c=void 0;if(t)for(var h=n.length-1;0<=h;h--){var v=n[h],E=v.instance,j=v.currentTarget;if(v=v.listener,E!==c&&r.isPropagationStopped())break e;c=v,r.currentTarget=j;try{c(r)}catch(H){Ki(H)}r.currentTarget=null,c=E}else for(h=0;h<n.length;h++){if(v=n[h],E=v.instance,j=v.currentTarget,v=v.listener,E!==c&&r.isPropagationStopped())break e;c=v,r.currentTarget=j;try{c(r)}catch(H){Ki(H)}r.currentTarget=null,c=E}}}}function me(e,t){var a=t[Co];a===void 0&&(a=t[Co]=new Set);var n=e+"__bubble";a.has(n)||(Im(t,e,2,!1),a.add(n))}function pc(e,t,a){var n=0;t&&(n|=4),Im(a,e,n,t)}var Is="_reactListening"+Math.random().toString(36).slice(2);function hc(e){if(!e[Is]){e[Is]=!0,Cu.forEach(function(a){a!=="selectionchange"&&(dv.has(a)||pc(a,!1,e),pc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Is]||(t[Is]=!0,pc("selectionchange",!1,t))}}function Im(e,t,a,n){switch(cp(t)){case 2:var r=kv;break;case 8:r=Gv;break;default:r=Rc}a=r.bind(null,t,a,e),r=void 0,!Do||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),n?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function gc(e,t,a,n,r){var c=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var h=n.tag;if(h===3||h===4){var v=n.stateNode.containerInfo;if(v===r)break;if(h===4)for(h=n.return;h!==null;){var E=h.tag;if((E===3||E===4)&&h.stateNode.containerInfo===r)return;h=h.return}for(;v!==null;){if(h=Mn(v),h===null)return;if(E=h.tag,E===5||E===6||E===26||E===27){n=c=h;continue e}v=v.parentNode}}n=n.return}Hu(function(){var j=c,H=zo(a),G=[];e:{var I=fd.get(e);if(I!==void 0){var L=Yi,W=e;switch(e){case"keypress":if(Pi(a)===0)break e;case"keydown":case"keyup":L=ly;break;case"focusin":W="focus",L=ko;break;case"focusout":W="blur",L=ko;break;case"beforeblur":case"afterblur":L=ko;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=Uu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=Vg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=oy;break;case rd:case cd:case ud:L=Qg;break;case dd:L=cy;break;case"scroll":case"scrollend":L=Fg;break;case"wheel":L=dy;break;case"copy":case"cut":case"paste":L=Jg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Pu;break;case"toggle":case"beforetoggle":L=my}var se=(t&4)!==0,je=!se&&(e==="scroll"||e==="scrollend"),R=se?I!==null?I+"Capture":null:I;se=[];for(var _=j,O;_!==null;){var k=_;if(O=k.stateNode,k=k.tag,k!==5&&k!==26&&k!==27||O===null||R===null||(k=Al(_,R),k!=null&&se.push(oi(_,k,O))),je)break;_=_.return}0<se.length&&(I=new L(I,W,null,a,H),G.push({event:I,listeners:se}))}}if((t&7)===0){e:{if(I=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",I&&a!==jo&&(W=a.relatedTarget||a.fromElement)&&(Mn(W)||W[An]))break e;if((L||I)&&(I=H.window===H?H:(I=H.ownerDocument)?I.defaultView||I.parentWindow:window,L?(W=a.relatedTarget||a.toElement,L=j,W=W?Mn(W):null,W!==null&&(je=d(W),se=W.tag,W!==je||se!==5&&se!==27&&se!==6)&&(W=null)):(L=null,W=j),L!==W)){if(se=Uu,k="onMouseLeave",R="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(se=Pu,k="onPointerLeave",R="onPointerEnter",_="pointer"),je=L==null?I:wl(L),O=W==null?I:wl(W),I=new se(k,_+"leave",L,a,H),I.target=je,I.relatedTarget=O,k=null,Mn(H)===j&&(se=new se(R,_+"enter",W,a,H),se.target=O,se.relatedTarget=je,k=se),je=k,L&&W)t:{for(se=fv,R=L,_=W,O=0,k=R;k;k=se(k))O++;k=0;for(var le=_;le;le=se(le))k++;for(;0<O-k;)R=se(R),O--;for(;0<k-O;)_=se(_),k--;for(;O--;){if(R===_||_!==null&&R===_.alternate){se=R;break t}R=se(R),_=se(_)}se=null}else se=null;L!==null&&Dm(G,I,L,se,!1),W!==null&&je!==null&&Dm(G,je,W,se,!0)}}e:{if(I=j?wl(j):window,L=I.nodeName&&I.nodeName.toLowerCase(),L==="select"||L==="input"&&I.type==="file")var Ee=Ju;else if(Qu(I))if($u)Ee=Ey;else{Ee=xy;var ee=Sy}else L=I.nodeName,!L||L.toLowerCase()!=="input"||I.type!=="checkbox"&&I.type!=="radio"?j&&Oo(j.elementType)&&(Ee=Ju):Ee=Ny;if(Ee&&(Ee=Ee(e,j))){Zu(G,Ee,a,H);break e}ee&&ee(e,I,j),e==="focusout"&&j&&I.type==="number"&&j.memoizedProps.value!=null&&Ro(I,"number",I.value)}switch(ee=j?wl(j):window,e){case"focusin":(Qu(ee)||ee.contentEditable==="true")&&(Hn=ee,Yo=j,Ll=null);break;case"focusout":Ll=Yo=Hn=null;break;case"mousedown":Vo=!0;break;case"contextmenu":case"mouseup":case"dragend":Vo=!1,sd(G,a,H);break;case"selectionchange":if(_y)break;case"keydown":case"keyup":sd(G,a,H)}var ue;if(Uo)e:{switch(e){case"compositionstart":var he="onCompositionStart";break e;case"compositionend":he="onCompositionEnd";break e;case"compositionupdate":he="onCompositionUpdate";break e}he=void 0}else qn?Xu(e,a)&&(he="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(he="onCompositionStart");he&&(Fu&&a.locale!=="ko"&&(qn||he!=="onCompositionStart"?he==="onCompositionEnd"&&qn&&(ue=ku()):(Ca=H,Lo="value"in Ca?Ca.value:Ca.textContent,qn=!0)),ee=Ds(j,he),0<ee.length&&(he=new Bu(he,e,null,a,H),G.push({event:he,listeners:ee}),ue?he.data=ue:(ue=Ku(a),ue!==null&&(he.data=ue)))),(ue=hy?gy(e,a):yy(e,a))&&(he=Ds(j,"onBeforeInput"),0<he.length&&(ee=new Bu("onBeforeInput","beforeinput",null,a,H),G.push({event:ee,listeners:he}),ee.data=ue)),rv(G,e,j,a,H)}zm(G,t)})}function oi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ds(e,t){for(var a=t+"Capture",n=[];e!==null;){var r=e,c=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||c===null||(r=Al(e,a),r!=null&&n.unshift(oi(e,r,c)),r=Al(e,t),r!=null&&n.push(oi(e,r,c))),e.tag===3)return n;e=e.return}return[]}function fv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dm(e,t,a,n,r){for(var c=t._reactName,h=[];a!==null&&a!==n;){var v=a,E=v.alternate,j=v.stateNode;if(v=v.tag,E!==null&&E===n)break;v!==5&&v!==26&&v!==27||j===null||(E=j,r?(j=Al(a,c),j!=null&&h.unshift(oi(a,j,E))):r||(j=Al(a,c),j!=null&&h.push(oi(a,j,E)))),a=a.return}h.length!==0&&e.push({event:t,listeners:h})}var mv=/\r\n?/g,pv=/\u0000|\uFFFD/g;function Lm(e){return(typeof e=="string"?e:""+e).replace(mv,`
|
|
10
|
-
`).replace(pv,"")}function qm(e,t){return t=Lm(t),Lm(e)===t}function Oe(e,t,a,n,r,c){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||In(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&In(e,""+n);break;case"className":ki(e,"class",n);break;case"tabIndex":ki(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ki(e,a,n);break;case"style":Lu(e,n,c);break;case"data":if(t!=="object"){ki(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ui(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(a==="formAction"?(t!=="input"&&Oe(e,t,"name",r.name,r,null),Oe(e,t,"formEncType",r.formEncType,r,null),Oe(e,t,"formMethod",r.formMethod,r,null),Oe(e,t,"formTarget",r.formTarget,r,null)):(Oe(e,t,"encType",r.encType,r,null),Oe(e,t,"method",r.method,r,null),Oe(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ui(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=sa);break;case"onScroll":n!=null&&me("scroll",e);break;case"onScrollEnd":n!=null&&me("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(s(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Ui(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":me("beforetoggle",e),me("toggle",e),Hi(e,"popover",n);break;case"xlinkActuate":ia(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ia(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ia(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ia(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ia(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ia(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ia(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ia(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ia(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Hi(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Bg.get(a)||a,Hi(e,a,n))}}function yc(e,t,a,n,r,c){switch(a){case"style":Lu(e,n,c);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(s(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof n=="string"?In(e,n):(typeof n=="number"||typeof n=="bigint")&&In(e,""+n);break;case"onScroll":n!=null&&me("scroll",e);break;case"onScrollEnd":n!=null&&me("scrollend",e);break;case"onClick":n!=null&&(e.onclick=sa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wu.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),c=e[ft]||null,c=c!=null?c[a]:null,typeof c=="function"&&e.removeEventListener(t,c,r),typeof n=="function")){typeof c!="function"&&c!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Hi(e,a,n)}}}function it(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":me("error",e),me("load",e);var n=!1,r=!1,c;for(c in a)if(a.hasOwnProperty(c)){var h=a[c];if(h!=null)switch(c){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Oe(e,t,c,h,a,null)}}r&&Oe(e,t,"srcSet",a.srcSet,a,null),n&&Oe(e,t,"src",a.src,a,null);return;case"input":me("invalid",e);var v=c=h=r=null,E=null,j=null;for(n in a)if(a.hasOwnProperty(n)){var H=a[n];if(H!=null)switch(n){case"name":r=H;break;case"type":h=H;break;case"checked":E=H;break;case"defaultChecked":j=H;break;case"value":c=H;break;case"defaultValue":v=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(137,t));break;default:Oe(e,t,n,H,a,null)}}ju(e,c,v,E,j,h,r,!1);return;case"select":me("invalid",e),n=h=c=null;for(r in a)if(a.hasOwnProperty(r)&&(v=a[r],v!=null))switch(r){case"value":c=v;break;case"defaultValue":h=v;break;case"multiple":n=v;default:Oe(e,t,r,v,a,null)}t=c,a=h,e.multiple=!!n,t!=null?zn(e,!!n,t,!1):a!=null&&zn(e,!!n,a,!0);return;case"textarea":me("invalid",e),c=r=n=null;for(h in a)if(a.hasOwnProperty(h)&&(v=a[h],v!=null))switch(h){case"value":n=v;break;case"defaultValue":r=v;break;case"children":c=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(s(91));break;default:Oe(e,t,h,v,a,null)}Iu(e,n,r,c);return;case"option":for(E in a)a.hasOwnProperty(E)&&(n=a[E],n!=null)&&(E==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Oe(e,t,E,n,a,null));return;case"dialog":me("beforetoggle",e),me("toggle",e),me("cancel",e),me("close",e);break;case"iframe":case"object":me("load",e);break;case"video":case"audio":for(n=0;n<si.length;n++)me(si[n],e);break;case"image":me("error",e),me("load",e);break;case"details":me("toggle",e);break;case"embed":case"source":case"link":me("error",e),me("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(j in a)if(a.hasOwnProperty(j)&&(n=a[j],n!=null))switch(j){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Oe(e,t,j,n,a,null)}return;default:if(Oo(t)){for(H in a)a.hasOwnProperty(H)&&(n=a[H],n!==void 0&&yc(e,t,H,n,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(n=a[v],n!=null&&Oe(e,t,v,n,a,null))}function hv(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,c=null,h=null,v=null,E=null,j=null,H=null;for(L in a){var G=a[L];if(a.hasOwnProperty(L)&&G!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":E=G;default:n.hasOwnProperty(L)||Oe(e,t,L,null,n,G)}}for(var I in n){var L=n[I];if(G=a[I],n.hasOwnProperty(I)&&(L!=null||G!=null))switch(I){case"type":c=L;break;case"name":r=L;break;case"checked":j=L;break;case"defaultChecked":H=L;break;case"value":h=L;break;case"defaultValue":v=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(137,t));break;default:L!==G&&Oe(e,t,I,L,n,G)}}Mo(e,h,v,E,j,H,c,r);return;case"select":L=h=v=I=null;for(c in a)if(E=a[c],a.hasOwnProperty(c)&&E!=null)switch(c){case"value":break;case"multiple":L=E;default:n.hasOwnProperty(c)||Oe(e,t,c,null,n,E)}for(r in n)if(c=n[r],E=a[r],n.hasOwnProperty(r)&&(c!=null||E!=null))switch(r){case"value":I=c;break;case"defaultValue":v=c;break;case"multiple":h=c;default:c!==E&&Oe(e,t,r,c,n,E)}t=v,a=h,n=L,I!=null?zn(e,!!a,I,!1):!!n!=!!a&&(t!=null?zn(e,!!a,t,!0):zn(e,!!a,a?[]:"",!1));return;case"textarea":L=I=null;for(v in a)if(r=a[v],a.hasOwnProperty(v)&&r!=null&&!n.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Oe(e,t,v,null,n,r)}for(h in n)if(r=n[h],c=a[h],n.hasOwnProperty(h)&&(r!=null||c!=null))switch(h){case"value":I=r;break;case"defaultValue":L=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(s(91));break;default:r!==c&&Oe(e,t,h,r,n,c)}zu(e,I,L);return;case"option":for(var W in a)I=a[W],a.hasOwnProperty(W)&&I!=null&&!n.hasOwnProperty(W)&&(W==="selected"?e.selected=!1:Oe(e,t,W,null,n,I));for(E in n)I=n[E],L=a[E],n.hasOwnProperty(E)&&I!==L&&(I!=null||L!=null)&&(E==="selected"?e.selected=I&&typeof I!="function"&&typeof I!="symbol":Oe(e,t,E,I,n,L));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var se in a)I=a[se],a.hasOwnProperty(se)&&I!=null&&!n.hasOwnProperty(se)&&Oe(e,t,se,null,n,I);for(j in n)if(I=n[j],L=a[j],n.hasOwnProperty(j)&&I!==L&&(I!=null||L!=null))switch(j){case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(s(137,t));break;default:Oe(e,t,j,I,n,L)}return;default:if(Oo(t)){for(var je in a)I=a[je],a.hasOwnProperty(je)&&I!==void 0&&!n.hasOwnProperty(je)&&yc(e,t,je,void 0,n,I);for(H in n)I=n[H],L=a[H],!n.hasOwnProperty(H)||I===L||I===void 0&&L===void 0||yc(e,t,H,I,n,L);return}}for(var R in a)I=a[R],a.hasOwnProperty(R)&&I!=null&&!n.hasOwnProperty(R)&&Oe(e,t,R,null,n,I);for(G in n)I=n[G],L=a[G],!n.hasOwnProperty(G)||I===L||I==null&&L==null||Oe(e,t,G,I,n,L)}function Hm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function gv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],c=r.transferSize,h=r.initiatorType,v=r.duration;if(c&&v&&Hm(h)){for(h=0,v=r.responseEnd,n+=1;n<a.length;n++){var E=a[n],j=E.startTime;if(j>v)break;var H=E.transferSize,G=E.initiatorType;H&&Hm(G)&&(E=E.responseEnd,h+=H*(E<v?1:(v-j)/(E-j)))}if(--n,t+=8*(c+h)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var vc=null,bc=null;function Ls(e){return e.nodeType===9?e:e.ownerDocument}function km(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Gm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Sc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xc=null;function yv(){var e=window.event;return e&&e.type==="popstate"?e===xc?!1:(xc=e,!0):(xc=null,!1)}var Um=typeof setTimeout=="function"?setTimeout:void 0,vv=typeof clearTimeout=="function"?clearTimeout:void 0,Bm=typeof Promise=="function"?Promise:void 0,bv=typeof queueMicrotask=="function"?queueMicrotask:typeof Bm<"u"?function(e){return Bm.resolve(null).then(e).catch(Sv)}:Um;function Sv(e){setTimeout(function(){throw e})}function Pa(e){return e==="head"}function Pm(e,t){var a=t,n=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(r),dl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")ri(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ri(a);for(var c=a.firstChild;c;){var h=c.nextSibling,v=c.nodeName;c[Cl]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=h}}else a==="body"&&ri(e.ownerDocument.body);a=r}while(a);dl(t)}function Fm(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Nc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Nc(a),wo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function xv(e,t,a,n){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Cl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Ht(e.nextSibling),e===null)break}return null}function Nv(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Ht(e.nextSibling),e===null))return null;return e}function Ym(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ht(e.nextSibling),e===null))return null;return e}function Ec(e){return e.data==="$?"||e.data==="$~"}function Tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ev(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Ht(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var _c=null;function Vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Ht(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Xm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Km(e,t,a){switch(t=Ls(a),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function ri(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wo(e)}var kt=new Map,Qm=new Set;function qs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Na=V.d;V.d={f:Tv,r:_v,D:Cv,C:wv,L:Av,m:Mv,X:Ov,S:Rv,M:jv};function Tv(){var e=Na.f(),t=As();return e||t}function _v(e){var t=Rn(e);t!==null&&t.tag===5&&t.type==="form"?ff(t):Na.r(e)}var rl=typeof document>"u"?null:document;function Zm(e,t,a){var n=rl;if(n&&typeof t=="string"&&t){var r=Ot(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),Qm.has(r)||(Qm.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),it(t,"link",e),$e(t),n.head.appendChild(t)))}}function Cv(e){Na.D(e),Zm("dns-prefetch",e,null)}function wv(e,t){Na.C(e,t),Zm("preconnect",e,t)}function Av(e,t,a){Na.L(e,t,a);var n=rl;if(n&&e&&t){var r='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Ot(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Ot(a.imageSizes)+'"]')):r+='[href="'+Ot(e)+'"]';var c=r;switch(t){case"style":c=cl(e);break;case"script":c=ul(e)}kt.has(c)||(e=b({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),kt.set(c,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(ci(c))||t==="script"&&n.querySelector(ui(c))||(t=n.createElement("link"),it(t,"link",e),$e(t),n.head.appendChild(t)))}}function Mv(e,t){Na.m(e,t);var a=rl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ot(n)+'"][href="'+Ot(e)+'"]',c=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ul(e)}if(!kt.has(c)&&(e=b({rel:"modulepreload",href:e},t),kt.set(c,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ui(c)))return}n=a.createElement("link"),it(n,"link",e),$e(n),a.head.appendChild(n)}}}function Rv(e,t,a){Na.S(e,t,a);var n=rl;if(n&&e){var r=On(n).hoistableStyles,c=cl(e);t=t||"default";var h=r.get(c);if(!h){var v={loading:0,preload:null};if(h=n.querySelector(ci(c)))v.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},a),(a=kt.get(c))&&Cc(e,a);var E=h=n.createElement("link");$e(E),it(E,"link",e),E._p=new Promise(function(j,H){E.onload=j,E.onerror=H}),E.addEventListener("load",function(){v.loading|=1}),E.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Hs(h,t,n)}h={type:"stylesheet",instance:h,count:1,state:v},r.set(c,h)}}}function Ov(e,t){Na.X(e,t);var a=rl;if(a&&e){var n=On(a).hoistableScripts,r=ul(e),c=n.get(r);c||(c=a.querySelector(ui(r)),c||(e=b({src:e,async:!0},t),(t=kt.get(r))&&wc(e,t),c=a.createElement("script"),$e(c),it(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(r,c))}}function jv(e,t){Na.M(e,t);var a=rl;if(a&&e){var n=On(a).hoistableScripts,r=ul(e),c=n.get(r);c||(c=a.querySelector(ui(r)),c||(e=b({src:e,async:!0,type:"module"},t),(t=kt.get(r))&&wc(e,t),c=a.createElement("script"),$e(c),it(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(r,c))}}function Jm(e,t,a,n){var r=(r=oe.current)?qs(r):null;if(!r)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=cl(a.href),a=On(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=cl(a.href);var c=On(r).hoistableStyles,h=c.get(e);if(h||(r=r.ownerDocument||r,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=r.querySelector(ci(e)))&&!c._p&&(h.instance=c,h.state.loading=5),kt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},kt.set(e,a),c||zv(r,e,a,h.state))),t&&n===null)throw Error(s(528,""));return h}if(t&&n!==null)throw Error(s(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ul(a),a=On(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function cl(e){return'href="'+Ot(e)+'"'}function ci(e){return'link[rel="stylesheet"]['+e+"]"}function $m(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function zv(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),it(t,"link",a),$e(t),e.head.appendChild(t))}function ul(e){return'[src="'+Ot(e)+'"]'}function ui(e){return"script[async]"+e}function Wm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Ot(a.href)+'"]');if(n)return t.instance=n,$e(n),n;var r=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),$e(n),it(n,"style",r),Hs(n,a.precedence,e),t.instance=n;case"stylesheet":r=cl(a.href);var c=e.querySelector(ci(r));if(c)return t.state.loading|=4,t.instance=c,$e(c),c;n=$m(a),(r=kt.get(r))&&Cc(n,r),c=(e.ownerDocument||e).createElement("link"),$e(c);var h=c;return h._p=new Promise(function(v,E){h.onload=v,h.onerror=E}),it(c,"link",n),t.state.loading|=4,Hs(c,a.precedence,e),t.instance=c;case"script":return c=ul(a.src),(r=e.querySelector(ui(c)))?(t.instance=r,$e(r),r):(n=a,(r=kt.get(c))&&(n=b({},a),wc(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),$e(r),it(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Hs(n,a.precedence,e));return t.instance}function Hs(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,c=r,h=0;h<n.length;h++){var v=n[h];if(v.dataset.precedence===t)c=v;else if(c!==r)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Cc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ks=null;function ep(e,t,a){if(ks===null){var n=new Map,r=ks=new Map;r.set(a,n)}else r=ks,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var c=a[r];if(!(c[Cl]||c[tt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var v=n.get(h);v?v.push(c):n.set(h,[c])}}return n}function tp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Iv(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ap(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Dv(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=cl(n.href),c=t.querySelector(ci(r));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Gs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,$e(c);return}c=t.ownerDocument||t,n=$m(n),(r=kt.get(r))&&Cc(n,r),c=c.createElement("link"),$e(c);var h=c;h._p=new Promise(function(v,E){h.onload=v,h.onerror=E}),it(c,"link",n),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Gs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Ac=0;function Lv(e,t){return e.stylesheets&&e.count===0&&Bs(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Ac===0&&(Ac=62500*gv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Ac?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Gs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Us=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Us=new Map,t.forEach(qv,e),Us=null,Gs.call(e))}function qv(e,t){if(!(t.state.loading&4)){var a=Us.get(e);if(a)var n=a.get(null);else{a=new Map,Us.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<r.length;c++){var h=r[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(a.set(h.dataset.precedence,h),n=h)}n&&a.set(null,n)}r=t.instance,h=r.getAttribute("data-precedence"),c=a.get(h)||n,c===n&&a.set(null,r),a.set(h,r),this.count++,n=Gs.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),c?c.parentNode.insertBefore(r,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var di={$$typeof:Q,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Hv(e,t,a,n,r,c,h,v,E){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Eo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Eo(0),this.hiddenUpdates=Eo(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function np(e,t,a,n,r,c,h,v,E,j,H,G){return e=new Hv(e,t,a,h,E,j,H,G,v),t=1,c===!0&&(t|=24),c=Nt(3,null,null,t),e.current=c,c.stateNode=e,t=or(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:n,isDehydrated:a,cache:t},dr(c),e}function lp(e){return e?(e=Un,e):Un}function ip(e,t,a,n,r,c){r=lp(r),n.context===null?n.context=r:n.pendingContext=r,n=ja(t),n.payload={element:a},c=c===void 0?null:c,c!==null&&(n.callback=c),a=za(e,n,t),a!==null&&(vt(a,e,t),Pl(a,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Mc(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=ln(e,67108864);t!==null&&vt(t,e,67108864),Mc(e,67108864)}}function rp(e){if(e.tag===13||e.tag===31){var t=wt();t=To(t);var a=ln(e,t);a!==null&&vt(a,e,t),Mc(e,t)}}var Ps=!0;function kv(e,t,a,n){var r=A.T;A.T=null;var c=V.p;try{V.p=2,Rc(e,t,a,n)}finally{V.p=c,A.T=r}}function Gv(e,t,a,n){var r=A.T;A.T=null;var c=V.p;try{V.p=8,Rc(e,t,a,n)}finally{V.p=c,A.T=r}}function Rc(e,t,a,n){if(Ps){var r=Oc(n);if(r===null)gc(e,t,n,Fs,a),up(e,n);else if(Bv(r,e,t,a,n))n.stopPropagation();else if(up(e,n),t&4&&-1<Uv.indexOf(e)){for(;r!==null;){var c=Rn(r);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=Wa(c.pendingLanes);if(h!==0){var v=c;for(v.pendingLanes|=2,v.entangledLanes|=2;h;){var E=1<<31-St(h);v.entanglements[1]|=E,h&=~E}Jt(c),(_e&6)===0&&(Cs=Je()+500,ii(0))}}break;case 31:case 13:v=ln(c,2),v!==null&&vt(v,c,2),As(),Mc(c,2)}if(c=Oc(n),c===null&&gc(e,t,n,Fs,a),c===r)break;r=c}r!==null&&n.stopPropagation()}else gc(e,t,n,null,a)}}function Oc(e){return e=zo(e),jc(e)}var Fs=null;function jc(e){if(Fs=null,e=Mn(e),e!==null){var t=d(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Fs=e,null}function cp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(la()){case gu:return 2;case yu:return 8;case zi:case wg:return 32;case vu:return 268435456;default:return 32}default:return 32}}var zc=!1,Fa=null,Ya=null,Va=null,fi=new Map,mi=new Map,Xa=[],Uv="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function up(e,t){switch(e){case"focusin":case"focusout":Fa=null;break;case"dragenter":case"dragleave":Ya=null;break;case"mouseover":case"mouseout":Va=null;break;case"pointerover":case"pointerout":fi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mi.delete(t.pointerId)}}function pi(e,t,a,n,r,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:c,targetContainers:[r]},t!==null&&(t=Rn(t),t!==null&&op(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Bv(e,t,a,n,r){switch(t){case"focusin":return Fa=pi(Fa,e,t,a,n,r),!0;case"dragenter":return Ya=pi(Ya,e,t,a,n,r),!0;case"mouseover":return Va=pi(Va,e,t,a,n,r),!0;case"pointerover":var c=r.pointerId;return fi.set(c,pi(fi.get(c)||null,e,t,a,n,r)),!0;case"gotpointercapture":return c=r.pointerId,mi.set(c,pi(mi.get(c)||null,e,t,a,n,r)),!0}return!1}function dp(e){var t=Mn(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,Tu(e.priority,function(){rp(a)});return}}else if(t===31){if(t=m(a),t!==null){e.blockedOn=t,Tu(e.priority,function(){rp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ys(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Oc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);jo=n,a.target.dispatchEvent(n),jo=null}else return t=Rn(a),t!==null&&op(t),e.blockedOn=a,!1;t.shift()}return!0}function fp(e,t,a){Ys(e)&&a.delete(t)}function Pv(){zc=!1,Fa!==null&&Ys(Fa)&&(Fa=null),Ya!==null&&Ys(Ya)&&(Ya=null),Va!==null&&Ys(Va)&&(Va=null),fi.forEach(fp),mi.forEach(fp)}function Vs(e,t){e.blockedOn===t&&(e.blockedOn=null,zc||(zc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Pv)))}var Xs=null;function mp(e){Xs!==e&&(Xs=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Xs===e&&(Xs=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],r=e[t+2];if(typeof n!="function"){if(jc(n||a)===null)continue;break}var c=Rn(a);c!==null&&(e.splice(t,3),t-=3,Or(c,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function dl(e){function t(E){return Vs(E,e)}Fa!==null&&Vs(Fa,e),Ya!==null&&Vs(Ya,e),Va!==null&&Vs(Va,e),fi.forEach(t),mi.forEach(t);for(var a=0;a<Xa.length;a++){var n=Xa[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Xa.length&&(a=Xa[0],a.blockedOn===null);)dp(a),a.blockedOn===null&&Xa.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],c=a[n+1],h=r[ft]||null;if(typeof c=="function")h||mp(a);else if(h){var v=null;if(c&&c.hasAttribute("formAction")){if(r=c,h=c[ft]||null)v=h.formAction;else if(jc(r)!==null)continue}else v=h.action;typeof v=="function"?a[n+1]=v:(a.splice(n,3),n-=3),mp(a)}}}function pp(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return r=h})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Ic(e){this._internalRoot=e}Ks.prototype.render=Ic.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var a=t.current,n=wt();ip(a,n,e,t,null,null)},Ks.prototype.unmount=Ic.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),As(),t[An]=null}};function Ks(e){this._internalRoot=e}Ks.prototype.unstable_scheduleHydration=function(e){if(e){var t=Eu();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Xa.length&&t!==0&&t<Xa[a].priority;a++);Xa.splice(a,0,e),a===0&&dp(e)}};var hp=o.version;if(hp!=="19.2.5")throw Error(s(527,hp,"19.2.5"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=g(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var Fv={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qs.isDisabled&&Qs.supportsFiber)try{El=Qs.inject(Fv),bt=Qs}catch{}}return gi.createRoot=function(e,t){if(!u(e))throw Error(s(299));var a=!1,n="",r=Nf,c=Ef,h=Tf;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=np(e,1,!1,null,null,a,n,null,r,c,h,pp),e[An]=t.current,hc(e),new Ic(t)},gi.hydrateRoot=function(e,t,a){if(!u(e))throw Error(s(299));var n=!1,r="",c=Nf,h=Ef,v=Tf,E=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=np(e,1,!0,t,a??null,n,r,E,c,h,v,pp),t.context=lp(null),a=t.current,n=wt(),n=To(n),r=ja(n),r.callback=null,za(a,r,n),a=n,t.current.lanes=a,_l(t,a),Jt(t),e[An]=t.current,hc(e),new Ks(t)},gi.version="19.2.5",gi}var _p;function eb(){if(_p)return qc.exports;_p=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),qc.exports=Wv(),qc.exports}var tb=eb();const ab="modulepreload",nb=function(l){return"/"+l},Cp={},Ea=function(o,i,s){let u=Promise.resolve();if(i&&i.length>0){let y=function(g){return Promise.all(g.map(x=>Promise.resolve(x).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),m=p?.nonce||p?.getAttribute("nonce");u=y(i.map(g=>{if(g=nb(g),g in Cp)return;Cp[g]=!0;const x=g.endsWith(".css"),b=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${b}`))return;const S=document.createElement("link");if(S.rel=x?"stylesheet":ab,x||(S.as="script"),S.crossOrigin="",S.href=g,m&&S.setAttribute("nonce",m),document.head.appendChild(S),x)return new Promise((N,M)=>{S.addEventListener("load",N),S.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${g}`)))})}))}function d(p){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=p,window.dispatchEvent(m),!m.defaultPrevented)throw p}return u.then(p=>{for(const m of p||[])m.status==="rejected"&&d(m.reason);return o().catch(d)})},wp=l=>{let o;const i=new Set,s=(g,x)=>{const b=typeof g=="function"?g(o):g;if(!Object.is(b,o)){const S=o;o=x??(typeof b!="object"||b===null)?b:Object.assign({},o,b),i.forEach(N=>N(o,S))}},u=()=>o,m={setState:s,getState:u,getInitialState:()=>y,subscribe:g=>(i.add(g),()=>i.delete(g))},y=o=l(s,u,m);return m},lb=(l=>l?wp(l):wp),ib=l=>l;function sb(l,o=ib){const i=Zs.useSyncExternalStore(l.subscribe,Zs.useCallback(()=>o(l.getState()),[l,o]),Zs.useCallback(()=>o(l.getInitialState()),[l,o]));return Zs.useDebugValue(i),i}const Ap=l=>{const o=lb(l),i=s=>sb(o,s);return Object.assign(i,o),i},Ch=(l=>l?Ap(l):Ap),ob=["default","gpt","claude","gemini","grok"];function Mp(l){return Array.isArray(l.images)}function rb(l){let o="message";const i=[];for(const u of l.split(`
|
|
11
|
-
`))u.startsWith("event:")&&(o=u.slice(6).trim()),u.startsWith("data:")&&i.push(u.slice(5).trimStart());if(i.length===0)return null;const s=i.join(`
|
|
12
|
-
`);return!s||s==="[DONE]"?null:{event:o,data:JSON.parse(s)}}async function cb(l,o={}){const i=await fetch("/api/node/generate",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(l)});if(!(i.headers.get("content-type")??"").includes("text/event-stream")){const y=await i.json().catch(()=>({}));if(!i.ok){const g=y,x=g?.error?.message??`Request failed: ${i.status}`,b=new Error(x);throw b.code=g?.error?.code,b.status=g?.status??i.status,b}return y}if(!i.ok||!i.body)throw new Error(`Request failed: ${i.status}`);const u=i.body.getReader(),d=new TextDecoder;let p="",m=null;for(;;){const{done:y,value:g}=await u.read();if(y)break;p+=d.decode(g,{stream:!0});let x=p.indexOf(`
|
|
13
|
-
|
|
14
|
-
`);for(;x!==-1;){const b=p.slice(0,x);p=p.slice(x+2);const S=rb(b);if(S){if(S.event==="partial")o.onPartial?.(S.data);else if(S.event==="phase")o.onPhase?.(S.data);else if(S.event==="done")m=S.data;else if(S.event==="error"){const N=S.data,M=N?.error?.message??"Node generation failed",z=new Error(M);throw z.code=N?.error?.code,z.status=N?.status,z}}x=p.indexOf(`
|
|
15
|
-
|
|
16
|
-
`)}}if(!m){const y=new Error("No image data returned from the node stream");throw y.code="EMPTY_RESPONSE",y.status=422,y}return m}async function de(l,o){const i=await fetch(l,o),s=await i.json().catch(()=>({}));if(!i.ok){const u=s.error,d=s.code,p=typeof u=="string"?u:u?.message??`Request failed: ${i.status}`,m=new Error(p);throw m.status=i.status,typeof u!="string"&&u?.code?m.code=u.code:d&&(m.code=d),typeof s.currentVersion=="number"&&(m.currentVersion=s.currentVersion),m}return s}function wh(l){const o=new URLSearchParams;l?.kind&&o.set("kind",l.kind),l?.sessionId&&o.set("sessionId",l.sessionId),l?.includeTerminal&&o.set("includeTerminal","1");const i=o.size>0?`?${o.toString()}`:"";return de(`/api/inflight${i}`)}function Uc(l){return de(`/api/inflight/${encodeURIComponent(l)}`,{method:"DELETE"})}function ub(){return de("/api/oauth/status")}function db(){return de("/api/billing")}function fb(l){return de("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function mb(l){let o=null;const i=[];for(const u of l.split(`
|
|
17
|
-
`))u.startsWith("event:")&&(o=u.slice(6).trim()),u.startsWith("data:")&&i.push(u.slice(5).trimStart());if(i.length===0)return null;const s=i.join(`
|
|
18
|
-
`);return!s||s==="[DONE]"?null:{event:o,data:JSON.parse(s)}}async function pb(l,o={},i={}){const s=await fetch("/api/generate/multimode",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(l),signal:i.signal});if(!(s.headers.get("content-type")??"").includes("text/event-stream")){const g=await s.json().catch(()=>({}));if(!s.ok){const x=g,b=new Error(x.error??`Request failed: ${s.status}`);throw b.code=x.code,b.status=x.status??s.status,b}return g}if(!s.ok||!s.body)throw new Error(`Request failed: ${s.status}`);const d=s.body.getReader(),p=new TextDecoder;let m="",y=null;for(;;){const{done:g,value:x}=await d.read();if(g)break;m+=p.decode(x,{stream:!0});let b=m.indexOf(`
|
|
19
|
-
|
|
20
|
-
`);for(;b!==-1;){const S=m.slice(0,b);m=m.slice(b+2);const N=mb(S);if(N){if(N.event==="partial")o.onPartial?.(N.data);else if(N.event==="image")o.onImage?.(N.data);else if(N.event==="phase")o.onPhase?.(N.data);else if(N.event==="done")y=N.data;else if(N.event==="error"){const M=N.data,z=new Error(M.error??"Multimode generation failed");throw z.code=M.code,z.status=M.status,z}}b=m.indexOf(`
|
|
21
|
-
|
|
22
|
-
`)}}if(!y){const g=new Error("No image data returned from the multimode stream");throw g.code="EMPTY_RESPONSE",g.status=422,g}return y}function FN(l){return de("/api/edit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}let yi=null;function Ah(){if(!yi){const l=localStorage.getItem("ima2.browserId");l?yi=l:(yi=`${Date.now().toString(36)}_${Math.random().toString(36).slice(2,9)}`,localStorage.setItem("ima2.browserId",yi))}return yi}function Sl(l,o){const i={...o?.headers,"X-Ima2-Browser-Id":Ah()};return de(l,{...o,headers:i})}function gl(l={}){const o=new URLSearchParams;return o.set("limit",String(l.limit??50)),l.since!=null&&o.set("since",String(l.since)),l.cursor&&(o.set("before",String(l.cursor.before)),o.set("beforeFilename",l.cursor.beforeFilename)),l.sessionId&&o.set("sessionId",l.sessionId),l.favoritesOnly&&o.set("favoritesOnly","1"),Sl(`/api/history?${o.toString()}`)}function hb(l={}){const o=new URLSearchParams;return o.set("groupBy","session"),o.set("limit",String(l.limit??200)),l.cursor&&(o.set("before",String(l.cursor.before)),o.set("beforeFilename",l.cursor.beforeFilename)),l.sessionId&&o.set("sessionId",l.sessionId),Sl(`/api/history?${o.toString()}`)}function gb(l){return Sl("/api/history/favorite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:l})})}async function yb(){return(await de("/api/storage/status")).data}function vb(){return de("/api/storage/open-generated-dir",{method:"POST"})}function Rp(l){return de(`/api/history/${encodeURIComponent(l)}`,{method:"DELETE"})}function bb(l){return de(`/api/history/${encodeURIComponent(l)}/permanent`,{method:"DELETE"})}function Sb(l,o){return de(`/api/history/${encodeURIComponent(l)}/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trashId:o})})}function xb(l){return de("/api/comfy/export-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:l.filename})})}function Nb(l){return de("/api/metadata/read",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function YN(l){return Sl(`/api/annotations/${encodeURIComponent(l)}`)}async function VN(l,o){await Sl(`/api/annotations/${encodeURIComponent(l)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({annotations:o})})}async function XN(l){await Sl(`/api/annotations/${encodeURIComponent(l)}`,{method:"DELETE"})}function KN(l){const o=new URLSearchParams({sourceFilename:l.sourceFilename});return de(`/api/canvas-versions?${o.toString()}`,{method:"POST",headers:{"Content-Type":"image/png"},body:l.image})}function QN(l,o){const i=new URLSearchParams;o.sourceFilename&&i.set("sourceFilename",o.sourceFilename);const s=i.size>0?`?${i.toString()}`:"";return de(`/api/canvas-versions/${encodeURIComponent(l)}${s}`,{method:"PUT",headers:{"Content-Type":"image/png"},body:o.image})}function Eb(){return de("/api/sessions")}function Tb(l){return de("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:l})})}function Mh(l){return de(`/api/sessions/${encodeURIComponent(l)}`)}function _b(l,o){return de(`/api/sessions/${encodeURIComponent(l)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:o})})}function Cb(l){return de(`/api/sessions/${encodeURIComponent(l)}`,{method:"DELETE"})}function wb(l,o,i,s,u={}){const d={"Content-Type":"application/json","If-Match":String(o)};return u.saveId&&(d["X-Ima2-Graph-Save-Id"]=u.saveId),u.saveReason&&(d["X-Ima2-Graph-Save-Reason"]=u.saveReason),u.tabId&&(d["X-Ima2-Tab-Id"]=u.tabId),de(`/api/sessions/${encodeURIComponent(l)}/graph`,{method:"PUT",headers:d,body:JSON.stringify({nodes:i,edges:s})})}function Ab(l){const o=new URLSearchParams;return de(`/api/prompts?${o.toString()}`)}function Mb(l){return de("/api/prompts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function Rb(l){return de(`/api/prompts/${encodeURIComponent(l)}`,{method:"DELETE"})}function Ob(l){return de(`/api/prompts/${encodeURIComponent(l)}/favorite`,{method:"POST"})}function jb(l){return de("/api/prompts/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function ZN(l){return de("/api/prompts/import/preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function JN(l){return de("/api/prompts/import/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function $N(){return de("/api/prompts/import/curated-sources")}function WN(l){return de("/api/prompts/import/curated-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function eE(l){return de("/api/prompts/import/curated-refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function tE(l){const o=new URLSearchParams,i=o.size>0?`?${o.toString()}`:"";return de(`/api/prompts/import/discovery${i}`)}function aE(l){return de("/api/prompts/import/discovery-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({q:l.q,seeds:l.seeds,limit:l.limit})})}function nE(l){return de("/api/prompts/import/discovery-review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function lE(l){return de("/api/prompts/import/folder-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:{kind:"github-folder",input:l.source.input}})})}function iE(l){return de("/api/prompts/import/folder-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:{kind:"github-folder",input:l.source.input},paths:l.paths})})}async function zb(l){const o=await l.arrayBuffer(),i=await fetch("/api/history/import-local",{method:"POST",headers:{"Content-Type":l.type||"image/png","X-Ima2-Original-Filename":encodeURIComponent(l.name)},body:o});if(!i.ok){let u={};try{u=await i.json()}catch{}const d=new Error(u.error||`Import failed (${i.status})`);throw d.code=u.code||"IMPORT_FAILED",d}return(await i.json()).item}function sE(l){return de("/api/prompt-builder/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function Ib(l){return new Promise((o,i)=>{const s=new FileReader;s.onload=()=>o(String(s.result)),s.onerror=()=>i(s.error),s.readAsDataURL(l)})}function Db(l,o=256){return new Promise(i=>{const s=new Image;s.onload=()=>{const u=Math.min(1,o/Math.max(s.width,s.height)),d=document.createElement("canvas");d.width=s.width*u,d.height=s.height*u;const p=d.getContext("2d");if(!p)return i(l);p.drawImage(s,0,0,d.width,d.height),i(d.toDataURL("image/jpeg",.6))},s.onerror=()=>i(l),s.src=l})}const Lb={maxB64Bytes:6e6,preserveTransparency:!1,maxEdge:4096,qualityLadder:[.85,.7,.55]},Op=16777216;function qb(l,o,i){let s=l,u=o;if(s<=0||u<=0)return{w:1,h:1};const d=Math.max(s,u);if(d>i){const p=i/d;s=Math.round(s*p),u=Math.round(u*p)}if(s*u>Op){const p=Math.sqrt(Op/(s*u));s=Math.max(1,Math.floor(s*p)),u=Math.max(1,Math.floor(u*p))}return{w:s,h:u}}function Bc(l){return new Promise((o,i)=>{const s=new FileReader;s.onload=()=>{typeof s.result=="string"?o(s.result):i(new Error("FileReader returned non-string"))},s.onerror=()=>i(s.error??new Error("FileReader failed")),s.readAsDataURL(l)})}function jp(l,o,i){return new Promise((s,u)=>{l.toBlob(d=>d?s(d):u(new Error("canvas.toBlob returned null")),o,i)})}function Pc(l){const o=l.indexOf(",");return o<0?l.length:l.length-o-1}async function eu(l,o={}){const i={...Lb,...o},s=await Bc(l);if(Pc(s)<=i.maxB64Bytes)return s;let u;try{u=await createImageBitmap(l)}catch(d){throw new Error("이미지 디코드 실패. JPEG/PNG로 변환 후 다시 시도해 주세요.",{cause:d})}try{const{w:d,h:p}=qb(u.width,u.height,i.maxEdge),m=document.createElement("canvas");m.width=d,m.height=p;const y=m.getContext("2d");if(!y)throw new Error("canvas 2d context unavailable");if(y.drawImage(u,0,0,d,p),i.preserveTransparency){const g=await jp(m,"image/png"),x=await Bc(g);if(Pc(x)>i.maxB64Bytes)throw new Error("이미지 압축 실패. JPEG/PNG로 미리 변환 후 다시 시도해 주세요.");return x}for(const g of i.qualityLadder){const x=await jp(m,"image/jpeg",g),b=await Bc(x);if(Pc(b)<=i.maxB64Bytes)return b}throw new Error("이미지 압축 실패. JPEG/PNG로 미리 변환 후 다시 시도해 주세요.")}finally{u.close?.()}}function Js(l){const o=(l.type||"").toLowerCase();if(o.includes("heic")||o.includes("heif"))return!0;const i=(l.name||"").toLowerCase();return i.endsWith(".heic")||i.endsWith(".heif")}function zp(l){return(l.type||"").toLowerCase()==="image/png"}const Hb={ok:"확인",cancel:"취소",delete:"삭제",close:"닫기",saving:"저장 중...",loading:"불러오는 중..."},kb={modeImage:"이미지",settings:"설정",controls:"생성 옵션",generate:"생성",generateAria:"이미지 생성을 위한 프롬프트 시트 열기"},Gb={close:"프롬프트 시트 닫기",generate:"이미지 생성",controlsOpen:"생성 옵션 열기",tabs:{prompt:"프롬프트",controls:"옵션",library:"라이브러리"}},Ub={localImportSuccess:"이미지가 갤러리에 추가됐어요",localImportFailed:"이미지 가져오기 실패",localImportInvalid:"PNG, JPEG, WebP만 지원해요",localStorageFull:"로컬 저장소가 가득 차서 최근 상태가 저장되지 않을 수 있습니다.",refLimitExceeded:"참조 이미지는 최대 5장까지 추가할 수 있습니다. 초과한 이미지는 제외되었습니다.",refTooLarge:"이미지가 너무 큽니다. JPEG/PNG로 미리 변환하거나 해상도를 낮춰 다시 시도해 주세요.",refNotBase64:"이미지 파일이 손상되었거나 지원하지 않는 형식입니다.",refEmpty:"빈 이미지 파일입니다. 다른 파일을 선택해 주세요.",refHeicUnsupported:"HEIC/HEIF는 지원하지 않습니다. JPEG 또는 PNG로 변환 후 다시 시도해 주세요.",noCurrentImageForRef:"참조로 사용할 현재 이미지가 없습니다.",refSlotFull:"참조 이미지 슬롯이 가득 찼습니다. 최대 5장까지 가능합니다.",currentImageLoadFailed:"현재 이미지를 불러오지 못했습니다.",addedCurrentAsRef:"현재 이미지를 참조에 추가했습니다.",sessionLoadFailed:"세션을 불러오지 못했습니다.",sessionCreateFailed:"세션을 만들지 못했습니다.",sessionRenameFailed:"세션 이름을 바꾸지 못했습니다.",sessionDeleteFailed:"세션을 삭제하지 못했습니다.",promptRequired:"프롬프트를 입력하세요.",nodeCreated:"노드 {id} 생성 완료 ({elapsed}초)",nodeRootCreated:"이 이미지를 첫 노드로 만들었습니다.",nodeCreateFailed:"노드 생성에 실패했습니다.",generatedBatch:"{count}장을 {elapsed}초 만에 생성했습니다.",generatedSingle:"{elapsed}초 만에 생성했습니다.",generateFailed:"생성에 실패했습니다.",sessionReloadedElsewhere:"그래프 버전이 달라져 최신 그래프를 다시 불러왔습니다.",promptCopied:"프롬프트를 복사했습니다",imageCopied:"클립보드에 복사했습니다",copyFailed:"복사에 실패했습니다",openGeneratedDirFailed:"이미지 폴더를 열지 못했습니다. ima2 doctor로 저장 경로를 확인해 주세요.",openGeneratedDirOpened:"생성 이미지 폴더를 열었습니다.",noPromptToFork:"가져올 프롬프트가 없습니다",forkStarted:"이 이미지의 프롬프트를 가져왔습니다. 수정 후 다시 생성하세요",forkStartedNoPrompt:"이미지를 참조로 첨부했어요. 프롬프트 입력 후 생성하세요",comfyExported:"ComfyUI로 보냈습니다: {filename}",comfyExportInvalidUrl:"ComfyUI URL은 로컬 HTTP 주소여야 합니다.",comfyExportInvalidImage:"이 저장 이미지는 ComfyUI로 보낼 수 없습니다.",comfyExportImageNotFound:"저장된 이미지 파일을 찾지 못했습니다.",comfyExportFailed:"ComfyUI로 이미지를 업로드하지 못했습니다.",cancelFailed:"생성을 취소하지 못했습니다."},Bb={queued:"대기 중",streaming:"생성 중",decoding:"마무리 중",canceling:"취소 중",noPrompt:"프롬프트 없음",cancelAria:"생성 취소: {prompt}"},Pb={title:"크기",width:"가로",height:"세로",hint:"16px 단위, 최대 변 3840, 비율 3:1 이하, 65.5만-829만 픽셀",autoLabel:"자동",autoSub:"모델 추천",customLabel:"직접 입력",customSub:"자유 설정",customPlus:"+ 직접",customSlots:"저장 크기",customSlot:"커스텀",customSlotLimit:"커스텀 크기는 최대 3개",saveCustomSlot:"커스텀 크기 저장",replaceCustomSlot:"슬롯 교체",ratioFree:"자유",ratio21x9:"21:9",normalizedPreview:"전송 크기",noAdjustment:"조정 없음",squareMaxHint:"829만 픽셀 제한 때문에 정사각형 최대는 {size}입니다.",adjustedReasons:{snap:"16px 보정",maxEdge:"최대 변",ratio:"비율 제한",minPixels:"최소 픽셀",maxPixels:"최대 픽셀",min:"최소 변",max:"최대 변",pixels:"픽셀 제한"}},Fb={title:"크기 조정이 필요합니다",body:"입력한 크기가 이미지 생성 제한을 벗어나 자동 조정이 필요합니다.",requested:"요청한 크기",adjusted:"조정될 크기",approve:"승인 후 생성",cancel:"취소",reasonRatio:"비율 제한 3:1을 초과했습니다.",reasonPixels:"최대 픽셀 수 제한을 초과했습니다.",reasonMinPixels:"요청한 이미지의 픽셀 수가 너무 적습니다.",reasonMin:"최소 크기보다 작습니다.",reasonMax:"최대 크기보다 큽니다.",reasonSnap:"16px 단위에 맞춰야 합니다."},Yb={title:"품질",lowLabel:"낮음",lowSub:"빠름",mediumLabel:"중간",mediumSub:"균형",highLabel:"높음",highSub:"최상"},Vb={title:"모더레이션",autoLabel:"자동",autoSub:"표준 필터",lowLabel:"낮음",lowSub:"완화 필터",explain:"자동은 표준 안전 필터를 사용합니다. 낮음은 제한을 조금 완화해 경계선 프롬프트가 더 통과할 수 있습니다."},Xb={title:"포맷"},Kb={title:"개수",customPlus:"+n",customLabel:"직접 입력 개수",highCountHint:"고품질이나 참조 이미지에서는 시간이 더 걸릴 수 있습니다.",minMaxHint:"1-8장까지 가능합니다.",decrease:"개수 줄이기",increase:"개수 늘리기"},Qb={label:"멀티모드",tooltip:"한 프롬프트로 단계별 시퀀스를 생성합니다",shortHint:"단계별 생성",maxStages:"최대 단계",highCountHint:"단계가 많으면 몇 분 걸릴 수 있습니다.",minMaxHint:"1-8단계까지 가능합니다.",composerBadge:"시퀀스 · 최대 {count}장",composerAriaLabel:"멀티모드 프롬프트 입력창, 최대 {count}개의 별도 이미지",promptPlaceholder:"단계별로 만들 장면을 입력하세요. 콜라주가 아니라 별도 이미지로 요청합니다.",promptPlaceholderWithRefs:"첨부한 참조를 바탕으로 단계별 시퀀스를 입력하세요.",toggleDisabledGenerating:"현재 생성이 끝난 뒤 변경할 수 있습니다",sequenceTitle:"멀티모드 시퀀스",sequenceProgress:"{returned}/{requested}장",stageLabel:"{index}단계",generating:"생성 중...",partialAlt:"멀티모드 중간 미리보기",partial:"{requested}장 중 {returned}장을 {elapsed}초 만에 생성했습니다.",complete:"{requested}장 중 {returned}장을 {elapsed}초 만에 생성했습니다.",notReturned:"반환되지 않음",empty:"반환된 이미지 없음",error:"생성 실패",canceled:"취소됨",cancel:"취소"},Zb={restoreTitle:"이미지 설정 복원",restoreBody:"이 이미지에 ima2 생성 정보가 있습니다. 프롬프트와 설정을 적용하거나 참조 이미지만 추가할 수 있습니다.",applySettings:"설정 적용",useAsReferenceOnly:"참조만 추가",noMetadata:"ima2 메타데이터가 없습니다.",invalidMetadata:"이미지 메타데이터가 올바르지 않습니다.",unsupportedFormat:"PNG, JPEG, WebP 메타데이터만 복원할 수 있습니다.",readFailed:"메타데이터를 읽지 못했습니다.",applied:"이미지 설정을 복원했습니다.",sourceXmp:"XMP",sourcePngComment:"PNG comment",imageAlt:"드롭한 이미지 미리보기",prompt:"프롬프트",size:"크기",quality:"품질",model:"모델",source:"출처"},Jb={title:"생성 준비 상태",open:"준비 상태 확인",openTitle:"프로바이더, 인증, 모델, 웹 검색 준비 상태 확인",settingsTitle:"생성 준비 상태",settingsBody:"프로바이더, 인증, 모델, 추론, 웹 검색 상태를 팝업으로 확인합니다.",ready:"생성 준비 완료",readyBody:"선택한 프로바이더를 사용할 수 있습니다.",blocked:"프로바이더 확인 필요",provider:"프로바이더",model:"모델",reasoning:"추론",webSearch:"웹 검색",openAccount:"계정 설정 열기"},$b={button:"생성",buttonLoading:"생성 중 ({n})"},Wb={label:"API 상태",checking:"확인 중...",offline:"오프라인",remaining:"${remaining} 남음",thisMonth:"이번 달 ${amount}",oauthFree:"OAuth 무료 사용 가능",apiDisabled:"API 키 사용 가능",apiReady:"API 키 사용 가능",oauthMode:"OAuth 모드"},eS={openGalleryAria:"갤러리 열기",openGalleryTitle:"전체 갤러리 열기",openGalleryShort:"전체",galleryCard:"갤러리 열기",recentTitle:"최근 생성",collapseRecent:"최근 생성 접기",expandRecent:"최근 생성 펼치기",collapseRecentShort:"접기",expandRecentShort:"펼치기",emptyRecent:"생성 히스토리가 여기에 표시됩니다.",selectRecent:"생성 히스토리 선택",deleteImageAria:"이미지 기록 삭제",deleteSequenceAria:"{count}장 시퀀스 삭제",deleteSequenceConfirm:"이 멀티모드 시퀀스의 이미지 {count}장을 삭제할까요?",sequenceDeleted:"시퀀스 이미지 {count}장을 히스토리에서 삭제했습니다"},tS={closeSettings:"설정 닫기",detailSettings:"세부 설정",toggleShow:"세부 설정 보기",toggleHide:"세부 설정 숨기기",open:"열기",close:"닫기"},aS={label:"프롬프트",refCount:"참조 {count}/{max}",refChipTitle:"참조 이미지 {n}",refChipAlt:"참조 이미지 {n}",refRemoveAria:"참조 이미지 {n} 제거",placeholder:"원하는 이미지를 설명하고, 드래그 앤 드롭이나 붙여넣기로 참조 이미지를 추가할 수 있어요...",placeholderWithRefs:"첨부한 이미지로 무엇을 만들지 설명해 주세요...",attach:"첨부",attachTitle:"참조 이미지 첨부",useCurrent:"현재 결과 사용",useCurrentTitle:"현재 결과를 참조로 사용",directMode:"Direct",directModeActive:"1:1 Direct 켜짐",directModeTitle:"프롬프트를 원문 그대로 전달 (Direct 모드)",moveBlockUp:"{name} 위로 이동",moveBlockDown:"{name} 아래로 이동",afterBlocks:"본문 프롬프트 뒤",hint:"Ctrl + Enter로 생성",dropHere:"놓아서 참조 이미지로 추가 ({max}장까지)"},nS={resultAlt:"생성 결과",imageViewerAria:"생성 이미지 뷰어. 좌우 방향키로 이전 또는 다음 이미지를 볼 수 있습니다.",tokens:"{n} 토큰",open:"캔버스 열기",openAria:"캔버스 모드에서 이미지 열기",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:"모두 지우기"},version:{saving:"캔버스 버전 저장 중...",saved:"캔버스 버전 저장됨",failed:"캔버스 버전 저장 실패",usingAsReference:"캔버스 버전을 참조 이미지로 사용할 수 있습니다"}},lS={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:"세션 보기는 현재 페이지 기준입니다. 이전 이미지를 더 보려면 날짜 보기로 전환해 주세요.",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:"즐겨찾기 해제",scopeAria:"갤러리 범위",scope:{current:"현재 세션",all:"전체 이미지"},empty:{currentSession:"이번 세션에는 아직 이미지가 없습니다."}},iS={empty:"비어 있음",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:"보관된 참조 비우기"},sS={selectionOn:"선택중",selectionOff:"선택",selectAll:"전체",summary:"선택 {selected} · 미생성 {missing} · 영향 {stale}",generateMissing:"미생성",regenerateSelected:"재생성",stopRemaining:"중단",stopping:"중단중",clear:"해제",noneSelected:"선택된 노드가 없습니다.",parentRequired:"부모 이미지가 준비되지 않은 선택 노드가 {count}개 있습니다.",nothingToRun:"생성할 선택 노드가 없습니다.",stopQueued:"현재 노드가 끝나면 남은 작업을 중단합니다.",failed:"{done}/{total} 완료 후 중단되었습니다.",finished:"{done}/{total} 노드 작업 완료",staleBecauseParentChanged:"상위 노드가 재생성되어 다시 확인이 필요합니다."},oS={disconnect:"끊기",disconnectTitle:"선택한 연결선 끊기",disconnected:"연결선을 끊었습니다.",parentConflict:"한 노드에는 부모 연결을 하나만 둘 수 있습니다."},rS={authTitle:"인증 방식",apiLabel:"API 키",oauthNotReady:"OAuth 프록시가 아직 준비되지 않았습니다.",codexLoginRequired:"Codex 로그인이 필요합니다.",codexLoginHint:"터미널에서 `codex login`을 실행한 뒤 이 페이지를 새로고침하세요.",oauthStarting:"OAuth 프록시가 시작 중입니다. 몇 초 후 다시 시도하세요.",serverUnreachable:"서버에 연결할 수 없습니다. 백엔드가 실행 중인지 확인하세요.",apiInvalid:"API 키가 없거나 유효하지 않습니다. 서버의 .env 파일에서 OPENAI_API_KEY를 확인하세요.",availableTitle:"{name} 사용 가능",availableAria:"{name}: 사용 가능",unavailableAria:"{name}: 사용 불가",availableSr:"(사용 가능)",unavailableSr:"(사용 불가)"},cS={free:"무료",approx:"약 ${amount}",multimodeApprox:"최대 약 ${amount} ({count}장)",label:"예상 비용"},uS={download:"다운로드",copyImage:"이미지 복사",copyPrompt:"프롬프트 복사",continueHere:"여기서 이어서",continueHereTitle:"이 이미지의 프롬프트를 가져와 이어서 작업",firstNode:"첫 노드",firstNodeTitle:"이 이미지를 Node Mode의 준비된 첫 노드로 보냅니다",delete:"삭제",deleteTitle:"휴지통으로 이동",more:"더보기",sendToComfyUI:"ComfyUI로 보내기",sendToComfyUITitle:"이 저장된 이미지를 로컬 ComfyUI로 업로드",permanentDelete:"완전 삭제",permanentDeleteConfirm:'"{filename}" 이미지를 완전히 삭제할까요? 이 작업은 되돌릴 수 없습니다.'},dS={switchTitle:"세션 전환",loading:"불러오는 중...",newSession:"새 세션",newSessionTitle:"새 세션",renameTitle:"이름 변경",renamePrompt:"세션 이름",deleteTitle:"삭제",deleteConfirm:'"{title}" 세션을 삭제할까요? 이 작업은 되돌릴 수 없습니다.',empty:"아직 세션이 없습니다",firstGraph:"첫 번째 그래프",untitled:"제목 없는 세션",assetAbortedError:"생성이 정상적으로 끝나지 않았습니다. 이 노드에서 다시 시도하세요."},fS={ariaLabel:"UI 모드",classic:"기본",node:"노드",cardNews:"카드뉴스",agent:"에이전트"},mS={workspace:"에이전트 작업공간",title:"에이전트",newSession:"새 에이전트",sessions:"세션",openSessions:"세션 열기",closeSessions:"세션 닫기",sessionSearch:"세션 검색",renameSession:"세션 이름 바꾸기",deleteSession:"세션 삭제",deleteConfirm:'"{title}" 세션을 삭제할까요?',imageCount:"{count}장",compacted:"컴팩트됨",web:"웹",chat:"채팅",user:"사용자",assistant:"에이전트",tool:"도구",toolExpand:"도구 상세 펼치기",toolCollapse:"도구 상세 접기",toolImageCount:"{count}장",toolCallCount:"{count}개 호출",toolGroup:"도구 실행",toolInput:"입력",toolOutput:"출력",toolArtifacts:"결과물",requestId:"요청 ID",duration:"소요 시간",toolStatus:{queued:"대기",running:"실행 중",complete:"완료",error:"오류"},rightSidebar:"에이전트 사이드 도구",sidebarTabs:{image:"이미지",library:"라이브러리",forms:"양식",quality:"품질",model:"모델",queue:"큐"},modelSettings:"모델 설정",closeModelSettings:"모델 설정 닫기",openModelSettings:"모델 설정 열기",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:"이미지를 생성하는 중...",composerPlaceholder:"만들 이미지를 입력하세요",slashCommands:"에이전트 슬래시 명령",slashDesc_question:"이미지 생성 없이 질문",slashDesc_variants:"N개 이미지 변형 생성 (1-8)",slashDesc_generate:"bounded fanout 생성 (1-8)",slashDesc_parallelism:"동시 실행 제한",slashDesc_help:"사용 가능한 명령어 도움말",attachReference:"참조 첨부",send:"전송",webSearch:"검색 사용",emptyChat:"메시지를 입력하면 이미지 작업이 시작됩니다.",imagePane:"이미지",currentImage:"현재 이미지",openImage:"이미지 열기",closeImage:"이미지 닫기",selectImage:"이미지 포커스",variants:"변형",contextTabs:"이미지 컨텍스트",imageTab:"이미지",refsTab:"참조",webTab:"웹 근거",memoryTab:"기억",noImage:"현재 이미지 없음",noRefs:"참조 없음",noWeb:"웹 근거 없음",memoryItemStyle:"스타일 잠금은 이미지 컨텍스트에 보존됩니다.",memoryItemSubject:"피사체 잠금은 재개 후에도 복원됩니다.",imageAlt:"에이전트 이미지",filename:"파일",prompt:"프롬프트"},pS={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:"초안 생성 실패"}},hS={appName:"이미지 생성기",imageModelLabel:"모델",imageModelAria:"이미지 모델 선택",nodeModeHint:"노드 모드에서는 노드를 눌러 프롬프트를 수정한 뒤 생성하세요. 오른쪽 패널의 설정 (품질/크기)은 새로 만드는 모든 결과에 적용됩니다."},gS={openAria:"설정 열기",openTitle:"설정",closeAria:"설정 닫기",closeTitle:"캔버스로 돌아가기",navAria:"설정 섹션",contentAria:"설정 내용",jumpTo:"{section} 섹션으로 이동",eyebrow:"작업공간 설정",title:"설정",subtitle:"계정, 화면, 앞으로 늘어날 작업공간 옵션을 이곳에 모아 생성 흐름은 가볍게 유지합니다.",sections:{account:{title:"계정",hint:"OAuth 상태"},generation:{title:"생성",hint:"모델 기본값"},appearance:{title:"화면",hint:"라이트/다크"},workspace:{title:"작업공간",hint:"프로필"},language:{title:"언어",hint:"UI 문구"},future:{title:"예정",hint:"확장 공간"}},account:{primaryEyebrow:"현재 공급자",oauthTitle:"OAuth 사용 중",oauthBody:"OAuth 생성은 Codex OAuth 세션으로 실행됩니다. 유효한 키가 설정되어 있으면 API-Key 모드로 전환할 수 있습니다.",apiSourceEnv:"OPENAI_API_KEY 감지됨",apiSourceConfig:"config.json API 키 감지됨",apiTitle:"API 키 공급자 사용 가능",apiBody:"ima2-gen은 이 API 키로 Responses API 기반 생성, 편집, 멀티모드, 노드 요청을 처리할 수 있습니다.",apiDisabled:"사용 불가",apiReady:"준비됨",apiUnavailable:"사용 불가",apiUnknown:"상태 불명"},imageModel:{title:"이미지 모델",body:"앞으로 생성 요청에 사용할 OAuth 이미지 모델을 선택합니다.",gpt54Mini:"GPT-5.4 Mini",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt53CodexSpark:"GPT-5.3 Codex Spark — 이미지 생성 미지원",unsupportedHelp:"기본값은 GPT-5.4 Mini입니다. GPT-5.3 Codex Spark는 OAuth 모델 상태에 보일 수 있지만 image_generation 도구를 지원하지 않습니다."},reasoning:{title:"추론 강도",body:"값이 높을수록 생성 전에 plan/검색/프롬프트 보강에 더 많은 reasoning 토큰을 사용합니다.",none:"Off — 추가 추론 없음",low:"Low — 가장 빠름, 추론 최소",medium:"Medium — 기본 균형값",high:"High — 더 깊은 리서치와 통합",xhigh:"Xhigh — 최대 추론, 가장 느림"},webSearch:{title:"웹서치",body:"실존 인물, 브랜드, 제품, 장소, 최신 이벤트를 생성 전에 실시간 검색해서 반영합니다.",on:"검색 켬",off:"검색 끔"},gallery:{defaultScopeTitle:"기본 갤러리 보기",defaultScopeBody:"갤러리를 열 때 처음 보여줄 범위를 선택합니다."},appearance:{themeTitle:"테마",themeBody:"이 기기에서 사용할 테마 스타일과 밝기를 선택합니다.",historyStripLayoutTitle:"히스토리 썸네일",historyStripLayoutBody:"작업공간 옆 작은 히스토리 배열 방식을 고릅니다.",historyStripLayout:{rail:"세로",horizontal:"상단 가로",sidebar:"사이드바"}},language:{title:"언어",body:"생성 프롬프트와 무관하게 인터페이스 언어만 바꿉니다."},future:{title:"나중을 위한 자리",body:"OAuth 복구 도구나 작업공간 옵션이 실제로 필요해지면 이곳에 추가합니다."}},yS={loading:"세션 불러오는 중...",addFirst:"+ 첫 노드 추가",addRootTitle:"루트 노드 추가",hint:"핸들을 빈 공간으로 드래그하면 새 브랜치가 생깁니다. Delete 또는 Backspace로 삭제할 수 있습니다."},vS={title:"{provider} 사용 불가",ariaLabel:"{provider} 사용 불가"},bS={label:"언어",ko:"한국어",en:"English"},SS={label:"테마",modeLabel:"밝기",styleLabel:"테마 스타일",system:"시스템",dark:"다크",light:"라이트",family:{default:"기본",gpt:"GPT",claude:"Claude",gemini:"Gemini",grok:"Grok"}},xS={close:"닫기",details:"자세한 원본 오류 보기",unknown:{title:"알 수 없는 오류가 발생했어요",body:"잠시 후 다시 시도해 주세요. 문제가 계속되면 원본 오류 메시지를 복사해 제보해 주세요."},moderationRefused:{title:"프롬프트가 모더레이션에 걸렸어요",body:"표현 수위를 낮추거나 다른 문구로 바꿔 보세요. 레퍼런스 이미지의 선정적/폭력적 요소도 영향을 줄 수 있어요.",cta:"프롬프트 수정"},emptyResponse:{title:"이미지가 돌아오지 않았어요",body:"Codex가 응답을 보냈지만 이미지 데이터가 비어 있었어요. 모더레이션 문제가 아니라 일시적 오류이거나 지원되지 않는 옵션 조합일 수 있어요. 다시 시도하거나 크기·품질·모델을 바꿔 보세요.",cta:"다시 시도"},upstream5xx:{title:"OpenAI 서버가 혼잡합니다",body:"잠시 후 다시 시도하면 대부분 해결돼요. 상태 페이지(status.openai.com)도 확인해 보세요.",cta:"다시 시도"},authChatgptExpired:{title:"Codex ChatGPT 로그인이 만료됐어요",body:"터미널에서 `npx @openai/codex login`을 다시 실행한 뒤 앱을 새로고침해 주세요.",cta:"새로고침"},authApiKeyInvalid:{title:"API 키 인증 실패",body:"키가 없거나 잘못됐거나, 한도/조직 권한 문제가 있을 수 있어요. OAuth로 전환하거나 설정된 API 키를 갱신해 주세요.",cta:"확인"},networkFailed:{title:"네트워크 연결 실패",body:"OpenAI 또는 로컬 런타임 서비스에 연결하지 못했어요. 먼저 새로고침하고, 계속되면 VPN/방화벽과 `ima2 doctor`에 표시되는 포트를 확인해 주세요.",cta:"새로고침"},oauthUnavailable:{title:"OAuth 프록시를 사용할 수 없어요",body:"OAuth 프록시가 아직 시작 중이거나, 사용할 수 없거나, fallback 포트로 이동했을 수 있어요. 먼저 새로고침하고, 계속되면 `ima2 doctor`의 OAuth URL을 확인해 주세요.",cta:"새로고침"},invalidRequest:{title:"이미지 요청을 수정해야 해요",body:"생성 요청의 일부 값이 올바르지 않습니다. 아래 원본 오류를 확인한 뒤 프롬프트나 크기를 수정해 다시 시도해 주세요.",cta:"입력 수정"},apikeyDisabled:{title:"API-Key 모드를 사용할 수 없어요",body:"이 빌드는 API-Key 생성을 지원하지만 현재 요청에서 설정된 키를 사용할 수 없었습니다. OAuth로 전환하거나 API 키를 갱신해 주세요.",cta:"확인"}},NS={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 폴더만 지원합니다"},ES={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:"첨부한 파일을 참고해서 프롬프트를 도와줘"},TS={sectionTitle:"작업 공간",sectionBody:"작업 공간 레이아웃 프로필을 선택합니다.",profileLabel:"작업 공간 프로필",defaultLabel:"기본",defaultDesc:"사이드바 컴포저가 있는 기본 생성 흐름.",promptStudioLabel:"프롬프트 스튜디오",promptStudioDesc:"프롬프트 빌더 패널, 그룹 히스토리, 향상된 뷰어."},_S={controls:"이미지 확대 컨트롤",zoomIn:"확대",zoomOut:"축소",reset:"확대 초기화"},CS={common:Hb,appBar:kb,sheet:Gb,toast:Ub,inflight:Bb,size:Pb,sizeConfirm:Fb,quality:Yb,moderation:Vb,format:Xb,count:Kb,multimode:Qb,metadata:Zb,readiness:Jb,generate:$b,billing:Wb,history:eS,panel:tS,prompt:aS,canvas:nS,gallery:lS,node:iS,nodeBatch:sS,edge:oS,provider:rS,cost:cS,result:uS,session:dS,uiMode:fS,agent:mS,cardNews:pS,sidebar:hS,settings:gS,nodeCanvas:yS,apiDisabled:vS,language:bS,theme:SS,errorCard:xS,promptLibrary:NS,promptBuilder:ES,workspace:TS,viewer:_S},wS={ok:"OK",cancel:"Cancel",delete:"Delete",close:"Close",saving:"Saving...",loading:"Loading..."},AS={modeImage:"Image",settings:"Settings",controls:"Generation controls",generate:"Generate",generateAria:"Open prompt sheet to generate an image"},MS={close:"Close prompt sheet",generate:"Generate image",controlsOpen:"Open generation controls",tabs:{prompt:"Prompt",controls:"Controls",library:"Library"}},RS={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.",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.",nodeCreated:"Node {id} created ({elapsed}s)",nodeRootCreated:"Created a first node from this image.",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",imageCopied:"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.",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."},OS={queued:"Queued",streaming:"Generating",decoding:"Finalizing",canceling:"Canceling",noPrompt:"No prompt",cancelAria:"Cancel generation: {prompt}"},jS={title:"Size",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"}},zS={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."},IS={title:"Quality",lowLabel:"Low",lowSub:"Fast",mediumLabel:"Medium",mediumSub:"Balanced",highLabel:"High",highSub:"Best"},DS={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."},LS={title:"Format"},qS={title:"Count",customPlus:"+n",customLabel:"Custom count",highCountHint:"Higher counts can take longer with references or high quality.",minMaxHint:"Use 1–8 images.",decrease:"Decrease count",increase:"Increase count"},HS={label:"Multimode",tooltip:"Generate a staged sequence from one prompt",shortHint:"one prompt sequence",maxStages:"Max stages",highCountHint:"Higher stage counts can take several minutes.",minMaxHint:"Use 1–8 stages.",composerBadge:"Sequence · up to {count}",composerAriaLabel:"Multimode prompt composer, up to {count} separate images",promptPlaceholder:"Describe the sequence. The app will ask for separate images, not a collage.",promptPlaceholderWithRefs:"Describe the staged sequence using the attached references.",toggleDisabledGenerating:"Wait for the current generation to finish",sequenceTitle:"Multimode sequence",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"},kS={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"},GS={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",openAccount:"Open account settings"},US={button:"Generate",buttonLoading:"Generating ({n})"},BS={label:"API Status",checking:"Checking...",offline:"Offline",remaining:"${remaining} remaining",thisMonth:"${amount} this month",oauthFree:"OAuth · free via codex",apiDisabled:"API key ready",apiReady:"API key ready",oauthMode:"OAuth mode"},PS={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.",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"},FS={closeSettings:"Close settings",detailSettings:"Settings",toggleShow:"Show settings",toggleHide:"Hide settings",open:"Open",close:"Close"},YS={label:"Prompt",refCount:"Refs {count}/{max}",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",directMode:"Direct",directModeActive:"1:1 Direct on",directModeTitle:"Pass prompt through verbatim (Direct mode)",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})"},VS={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",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"},version:{saving:"Saving canvas version...",saved:"Canvas version saved",failed:"Could not save canvas version",usingAsReference:"Canvas version is ready as a reference"}},XS={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.",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",scopeAria:"Gallery scope",scope:{current:"Current session",all:"All images"},empty:{currentSession:"No images in this session yet."}},KS={empty:"Empty",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"},QS={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."},ZS={disconnect:"Disconnect",disconnectTitle:"Disconnect selected edge",disconnected:"Connection removed.",parentConflict:"A node can only have one parent connection."},JS={authTitle:"Authentication",apiLabel:"API Key",oauthNotReady:"OAuth proxy is not ready yet.",codexLoginRequired:"Codex login required.",codexLoginHint:"Run `codex login` in your terminal, then refresh this page.",oauthStarting:"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.",availableTitle:"{name} available",availableAria:"{name}: available",unavailableAria:"{name}: unavailable",availableSr:"(available)",unavailableSr:"(unavailable)"},$S={free:"free",approx:"~${amount}",multimodeApprox:"up to ~${amount} ({count})",label:"Est. cost"},WS={download:"Download",copyImage:"Copy image",copyPrompt:"Copy prompt",continueHere:"Continue here",continueHereTitle:"Import this image's prompt and keep working",firstNode:"First node",firstNodeTitle:"Send this image to Node Mode as a ready first node",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.'},e0={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."},t0={ariaLabel:"UI mode",classic:"Classic",node:"Node",cardNews:"Card News",agent:"Agent"},a0={workspace:"Agent workspace",title:"Agent",newSession:"New Agent",sessions:"Sessions",openSessions:"Open sessions",closeSessions:"Close sessions",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",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",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 image...",composerPlaceholder:"Describe the image to create",slashCommands:"Agent slash commands",slashDesc_question:"Ask a question without generating images",slashDesc_variants:"Generate N image variants (1-8)",slashDesc_generate:"Bounded fanout generation (1-8)",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 work.",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"},n0={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"}},l0={appName:"Image Generator",imageModelLabel:"Model",imageModelAria:"Choose image model",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."},i0={openAria:"Open settings",openTitle:"Settings",closeAria:"Close settings",closeTitle:"Return to canvas",navAria:"Settings sections",contentAria:"Settings content",jumpTo:"Jump to {section}",eyebrow:"Workspace settings",title:"Settings",subtitle:"Account, display, and future workspace controls live here so the generator stays focused.",sections:{account:{title:"Account",hint:"OAuth status"},generation:{title:"Generation",hint:"Model defaults"},appearance:{title:"Appearance",hint:"Light and dark"},workspace:{title:"Workspace",hint:"Profile"},language:{title:"Language",hint:"Interface copy"},future:{title:"Future",hint:"Reserved"}},account:{primaryEyebrow:"Active provider",oauthTitle:"OAuth is active",oauthBody:"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:"API key provider available",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"},imageModel:{title:"Image model",body:"Choose the OAuth model used for future image generations.",gpt54Mini:"GPT-5.4 Mini",gpt54:"GPT-5.4",gpt55:"GPT-5.5",gpt53CodexSpark:"GPT-5.3 Codex Spark — unsupported for images",unsupportedHelp:"Default is GPT-5.4 Mini. GPT-5.3 Codex Spark may appear in OAuth model status, but it does not support the image_generation tool."},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 — 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"},gallery:{defaultScopeTitle:"Default gallery view",defaultScopeBody:"Choose what the gallery shows when you open it."},appearance:{themeTitle:"Theme",themeBody:"Pick a theme style and brightness for this device.",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."},future:{title:"Reserved for later",body:"Future provider repair and workspace controls will appear here when they become useful."}},s0={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."},o0={title:"{provider} unavailable",ariaLabel:"{provider} unavailable"},r0={label:"Language",ko:"한국어",en:"English"},c0={label:"Theme",modeLabel:"Brightness",styleLabel:"Theme style",system:"System",dark:"Dark",light:"Light",family:{default:"Default",gpt:"GPT",claude:"Claude",gemini:"Gemini",grok:"Grok"}},u0={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"},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"},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 `npx @openai/codex login` in your terminal, 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 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:"OAuth proxy unavailable",body:"The OAuth proxy is starting, unavailable, or moved to a fallback port. Reload first; if it persists, run `ima2 doctor` and check the reported 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 OAuth or update the API key.",cta:"OK"}},d0={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."},f0={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"},m0={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."},p0={controls:"Image zoom controls",zoomIn:"Zoom in",zoomOut:"Zoom out",reset:"Reset zoom"},h0={common:wS,appBar:AS,sheet:MS,toast:RS,inflight:OS,size:jS,sizeConfirm:zS,quality:IS,moderation:DS,format:LS,count:qS,multimode:HS,metadata:kS,readiness:GS,generate:US,billing:BS,history:PS,panel:FS,prompt:YS,canvas:VS,gallery:XS,node:KS,nodeBatch:QS,edge:ZS,provider:JS,cost:$S,result:WS,session:e0,uiMode:t0,agent:a0,cardNews:n0,sidebar:l0,settings:i0,nodeCanvas:s0,apiDisabled:o0,language:r0,theme:c0,errorCard:u0,promptLibrary:d0,promptBuilder:f0,workspace:m0,viewer:p0},Ip={ko:CS,en:h0};function Dp(l,o){return o.split(".").reduce((i,s)=>{if(i!=null)return i[s]},l)}function g0(l,o){return l.replace(/\{(\w+)\}/g,(i,s)=>s in o?String(o[s]):`{${s}}`)}function J(l,o){const i=C.getState().locale;return Rh(i,l,o)}function Rh(l,o,i){const s=Dp(Ip[l],o),u=typeof s=="string"?s:Dp(Ip.en,o),d=typeof u=="string"?u:o;return i?g0(d,i):d}function be(){const l=C(o=>o.locale);return{locale:l,t:(o,i)=>Rh(l,o,i)}}const oE=["ko","en"];function y0(){try{const l=localStorage.getItem("ima2.locale");if(l==="ko"||l==="en")return l}catch{}return typeof navigator<"u"&&(navigator.language||"").toLowerCase().startsWith("ko")?"ko":"en"}function v0(l){try{localStorage.setItem("ima2.locale",l)}catch{}}function b0(l){return Math.round(l/16)*16}const Sn=16,ru=3840,Fc=655360,co=8294400,S0=3,yl=3,Lp=Math.floor(Math.sqrt(co)/Sn)*Sn,Oh=Sn,x0=ru,$s=S0;function qp(l){return Math.floor(l/16)*16}function vo(l){return Math.ceil(l/16)*16}function Vt(l){return Math.min(x0,Math.max(Oh,l))}function aa(l,o){const i=typeof l=="number"?l:Number.parseInt(l,10);return Number.isFinite(i)?i:o}function Tn(l,o){l.includes(o)||l.push(o)}function Hp(l,o){const i=b0(l);return i!==l&&Tn(o,"snap"),i}function kp(l,o){return l<Oh&&Tn(o,"min"),l>ru&&Tn(o,"maxEdge"),Vt(l)}function Gp(l,o,i){return l>o*$s?(Tn(i,"ratio"),{w:l,h:Vt(vo(l/$s))}):o>l*$s?(Tn(i,"ratio"),{w:Vt(vo(o/$s)),h:o}):{w:l,h:o}}function N0(l,o,i){if(l*o<Fc){Tn(i,"minPixels");const p=Math.sqrt(Fc/(l*o));let m=Vt(vo(l*p)),y=Vt(vo(o*p));for(;m*y<Fc;)m<=y?m=Vt(m+Sn):y=Vt(y+Sn);return{w:m,h:y}}if(l*o<=co)return{w:l,h:o};Tn(i,"maxPixels");const s=Math.sqrt(co/(l*o));let u=Vt(qp(l*s)),d=Vt(qp(o*s));for(;u*d>co;)u>=d?u=Vt(u-Sn):d=Vt(d-Sn);return{w:u,h:d}}function cu(l,o,i,s){const u=[],d=aa(l,i),p=aa(o,s);let m=kp(Hp(d,u),u),y=kp(Hp(p,u),u);return{w:m,h:y}=Gp(m,y,u),{w:m,h:y}=N0(m,y,u),{w:m,h:y}=Gp(m,y,u),{requestedW:d,requestedH:p,w:m,h:y,adjusted:m!==d||y!==p,reasons:u}}function jh(l,o,i,s){const u=cu(l,o,i,s);return{w:u.w,h:u.h}}const E0=[{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 T0(l,o){return`${l}x${o}`}function _0(l,o=1024){if(l.id==="free")return null;const i=o,s=l.w>=l.h,u=s?Math.round(i*l.w/l.h):i,d=s?i:Math.round(i*l.h/l.w);return jh(u,d,u,d)}function No(l){const o=jh(l.w,l.h,2400,1024);return{...l,w:o.w,h:o.h,label:l.label||`${o.w}×${o.h}`}}function bl(l){return l.slice(0,yl).map(No)}function C0(l,o){const i=No(o),s=l.findIndex(u=>u.id===i.id);return s>=0?bl(l.map((u,d)=>d===s?i:u)):l.length>=yl?bl(l):bl([...l,i])}function w0(l,o,i){const s=No({...i,id:o});return bl(l.map(u=>u.id===o?s:u))}const A0=[{value:"1024x1024",label:"1024×1024",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],M0=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],R0=[{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"}],O0=[{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 j0(){return[{value:"auto",label:J("size.autoLabel"),sub:J("size.autoSub")},{value:"custom",label:J("size.customLabel"),sub:J("size.customSub")}]}const z0="gpt-5.4-mini",vl=[{value:"gpt-5.4-mini",shortLabel:"5.4m",fullLabelKey:"settings.imageModel.gpt54Mini"},{value:"gpt-5.4",shortLabel:"5.4",fullLabelKey:"settings.imageModel.gpt54"},{value:"gpt-5.5",shortLabel:"5.5",fullLabelKey:"settings.imageModel.gpt55"}],I0=[{value:"gpt-5.3-codex-spark",fullLabelKey:"settings.imageModel.gpt53CodexSpark"}];function zh(l){return vl.some(o=>o.value===l)}function D0(l){return l?vl.find(o=>o.value===l)?.shortLabel??l:null}const L0="none",q0=[{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"}];function H0(l){return q0.some(o=>o.value===l)}const rt=["ima2.rightPanelOpen","ima2.uiMode","ima2.historyStripLayout","ima2:theme","ima2:themeFamily","ima2.canvas.exportBackground.v1","ima2.imageModel","ima2.reasoningEffort","ima2.webSearchEnabled","ima2.generationDefaults","ima2.inFlight","ima2.selectedFilename","ima2.activeSessionId","ima2.graphTabId","ima2.galleryScope","ima2.galleryDefaultScope","ima2.locale","ima2.workspaceProfile","ima2.workspaceOverrides"],Ih=rt[0],Dh=rt[1],Lh=rt[2],qh=rt[3],Hh=rt[4],kh=rt[5],Gh=rt[6],Uh=rt[7],Bh=rt[8],Ph=rt[9],Fh=rt[10],tu=rt[11],au=rt[12],Up=rt[13],Yc=rt[14],Bp=rt[15],k0=!0,vn=()=>"nc_"+Math.random().toString(36).slice(2,10);function Pp(l,o){return{x:l*360,y:o*320}}function G0(l,o){return l.find(i=>i.target===o)??null}function U0(l,o,i){return l.some(s=>s.target===i&&s.source!==o)}function Qa(l,o){const i=new Map(l.map(s=>[s.id,s]));return l.map(s=>{const u=G0(o,s.id),p=(u?i.get(u.source):null)?.data.serverNodeId??null;return s.data.parentServerNodeId===p?s:{...s,data:{...s.data,parentServerNodeId:p}}})}const B0=360,Yh=320;function P0(l,o,i){const s=new Set(i.filter(u=>u.source===l).map(u=>u.target));return o.filter(u=>s.has(u.id))}function Vc(l){const o=l.filter(s=>!s.data.parentServerNodeId);if(o.length===0)return Pp(0,0);const i=Math.max(...o.map(s=>s.position.y));return{x:Pp(0,0).x,y:i+Yh}}function Fp(l,o,i){const s=P0(l.id,o,i),u=l.position.x+B0;if(s.length===0)return{x:u,y:l.position.y};const d=Math.max(...s.map(p=>p.position.y));return{x:u,y:d+Yh}}const Vh="ima2.nodeRefs.v1";function uu(){try{const l=localStorage.getItem(Vh);if(!l)return{};const o=JSON.parse(l);return o&&typeof o=="object"?o:{}}catch{return{}}}function Xh(l){try{localStorage.setItem(Vh,JSON.stringify(l))}catch{}}function F0(l,o){if(!l)return[];const i=uu()[l]?.[o];return Array.isArray(i)?i.filter(s=>typeof s=="string"):[]}function uo(l,o,i){if(!l)return;const s=uu(),u={...s[l]??{}};i.length===0?delete u[o]:u[o]=i,s[l]=u,Xh(s)}function Xc(l,o){uo(l,o,[])}function Y0(l,o){if(!l)return;const i=uu(),s=i[l];if(!s)return;const u=new Set(o);for(const d of Object.keys(s))u.has(d)||delete s[d];i[l]=s,Xh(i)}function V0(l,o,i){const s=new Set(l.map(m=>m.id));if(!s.has(i))return[];const u=new Map;for(const m of s)u.set(m,new Set);for(const m of o)!s.has(m.source)||!s.has(m.target)||(u.get(m.source)?.add(m.target),u.get(m.target)?.add(m.source));const d=new Set,p=[i];for(let m=0;m<p.length;m++){const y=p[m];if(!d.has(y)){d.add(y);for(const g of u.get(y)??[])d.has(g)||p.push(g)}}return l.filter(m=>d.has(m.id)).map(m=>m.id)}function Kh(l){return l.filter(o=>o.selected).map(o=>o.id)}function Ni(l,o){const i=new Set(o);return l.map(s=>({...s,selected:i.has(s.id)}))}function X0(l,o,i,s){const u=new Set(V0(l,o,i));if(!u.size)return l;if(!s)return Ni(l,u);const d=l.find(y=>y.id===i),p=l.some(y=>u.has(y.id)&&y.selected),m=new Set(Kh(l));if(p)d?.selected?m.delete(i):m.add(i);else for(const y of u)m.add(y);return Ni(l,m)}function K0(l){return l.data.status==="ready"&&!!l.data.imageUrl}function Q0(l,o,i){const s=new Set(i),u=new Set(l.map(b=>b.id)),d=new Map,p=new Map;for(const b of s)u.has(b)&&(d.set(b,0),p.set(b,[]));for(const b of o)!s.has(b.source)||!s.has(b.target)||(p.get(b.source)?.push(b.target),d.set(b.target,(d.get(b.target)??0)+1));const m=l.map(b=>b.id),y=m.filter(b=>s.has(b)&&(d.get(b)??0)===0),g=[];for(let b=0;b<y.length;b++){const S=y[b];g.push(S);for(const N of p.get(S)??[])d.set(N,(d.get(N)??0)-1),(d.get(N)??0)===0&&y.push(N)}const x=new Set(g);return g.concat(m.filter(b=>s.has(b)&&!x.has(b)))}function Z0(l,o){const i=new Set(o),s=new Set,u=new Map;for(const p of l){const m=u.get(p.source)??[];m.push(p.target),u.set(p.source,m)}const d=[...i];for(let p=0;p<d.length;p++)for(const m of u.get(d[p])??[])i.has(m)||s.has(m)||(s.add(m),d.push(m));return[...s]}function J0(l,o,i){const s=new Set(i);return l.filter(u=>u.source===o&&!s.has(u.target)).map(u=>u.target)}function $0(l,o,i){const s=new Set(i),u=new Map(l.map(p=>[p.id,p])),d=[];for(const p of o){if(!s.has(p.target)||s.has(p.source))continue;u.get(p.source)?.data.serverNodeId||d.push(p.target)}return d}const Ei={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"},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"},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"},DB_ERROR:{surface:"toast",toastKey:"toast.generateFailed"},UNKNOWN:{surface:"toast",toastKey:"toast.generateFailed"}};function W0(l){const o=(l||"").toLowerCase();return o?o.includes("moderation_blocked")||o.includes("moderation refused")?"MODERATION_REFUSED":o.includes("no image data returned")?"EMPTY_RESPONSE":o.includes("token is expired")||o.includes("sign in again")||o.includes("access token")&&o.includes("expired")||o.includes("token")&&o.includes("expired")&&!o.includes("api key")?"AUTH_CHATGPT_EXPIRED":o.includes("incorrect api key")||o.includes("invalid authentication")||o.includes("exceeded your current quota")||o.includes("incorrect organization")?"AUTH_API_KEY_INVALID":o.includes("failed to fetch")||o.includes("econnrefused")||o.includes("econnreset")||o.includes("enotfound")||o.includes("etimedout")||o.includes("network error")?"NETWORK_FAILED":o.includes("oauth")&&(o.includes("not running")||o.includes("unavailable")||o.includes("not ready"))?"OAUTH_UNAVAILABLE":o.includes("invalid_request_error")||o.includes("invalid_value")||o.includes("invalid size")||o.includes("invalid request")||o.includes("requested resolution")||o.includes("minimum pixel budget")||o.includes("unsupported value")?"INVALID_REQUEST":o.includes("an error occurred while processing")||/\b5\d\d\b/.test(o)?"UPSTREAM_5XX":"UNKNOWN":"UNKNOWN"}function e1(l){const o=l,i=typeof o?.message=="string"?o.message:String(l??""),s=typeof o?.code=="string"?o.code:"",u=s&&s in Ei?s:W0(i),d=Ei[u]??Ei.UNKNOWN;return{code:u,spec:d,message:i}}function vi(l,o){const{code:i,spec:s,message:u}=e1(l);if(s.surface==="card")o.showErrorCard(i,{fallbackMessage:u});else{const d=s.toastKey?J(s.toastKey):u||J("toast.generateFailed");o.showToast(d,!0)}return{code:i,message:u}}const wi=!0,Qh=!1,Ai=!0,Yp=10;function Zh(l,o){return o?o.filename&&l.filename===o.filename?!0:l.image===o.image:!1}function t1(l){return[l.canvasSourceFilename,l.canvasEditableFilename].filter(o=>!!o)}function En(l){return l.filter(o=>!o.canvasVersion)}function Wt(l,o){if(!o)return null;const i=En(l);if(!o.canvasVersion)return i.find(d=>Zh(d,o))??null;const s=t1(o);return i.find(d=>d.filename?s.includes(d.filename):!1)??null}function a1(l,o){const i=En(l),s=Wt(l,o);return i.findIndex(u=>Zh(u,s))}function n1(l,o,i){const s=En(l);if(s.length===0)return null;if(i==="first")return s[0]??null;if(i==="last")return s[s.length-1]??null;const u=a1(l,o);if(u<0)return null;if(i==="pagePrevious"||i==="pageNext"){const p=i==="pagePrevious"?-Yp:Yp,m=Math.max(0,Math.min(s.length-1,u+p));return s[m]??null}const d=i==="previous"?u-1:u+1;return s[d]??null}function Vp(l,o){const i=En(l),s=i.findIndex(u=>u.filename===o);return s<0?null:i[s+1]??i[s-1]??null}function Gt(l){return l.filename||l.image}function Ti(l){return!l.canvasVersion}function fo(l){const o=new Set;return l.filter(i=>{const s=Gt(i);return o.has(s)?!1:(o.add(s),!0)})}const l1=72;function Jh(l,o){const i=l.sequenceIndex??Number.MAX_SAFE_INTEGER,s=o.sequenceIndex??Number.MAX_SAFE_INTEGER;return i!==s?i-s:(l.createdAt??0)-(o.createdAt??0)}function i1(l){return l<=1?1:l===2?2:4}function s1(l){const o=new Set,i=new Map,s=[];for(const u of l){if(!Ti(u))continue;if(u.sequenceId){const p=`sequence:${u.sequenceId}`;let m=i.get(u.sequenceId);m||(m={type:"sequence",key:p,sequenceId:u.sequenceId,items:[]},i.set(u.sequenceId,m),s.push(m)),m.items.push(u);continue}const d=Gt(u);o.has(d)||(o.add(d),s.push({type:"image",key:d,item:u}))}for(const u of i.values())u.items.sort(Jh);return s}function o1(){try{const l=localStorage.getItem(Ih);return l===null?!0:JSON.parse(l)===!0}catch{return!0}}function r1(){try{const l=localStorage.getItem(Dh);if(l==="agent")return Ai?l:"classic";if(l==="card-news")return Qh?l:"classic";if(l==="node")return wi?l:"classic";if(l==="classic")return l}catch{}return"agent"}function Kc(){try{const l=localStorage.getItem(qh);if(l==="system"||l==="dark"||l==="light")return l}catch{}return"system"}function Xp(){try{const l=localStorage.getItem(Hh);if(l&&ob.includes(l))return l}catch{}return"default"}function c1(){try{const l=localStorage.getItem(Lh);if(l==="rail"||l==="horizontal"||l==="sidebar")return l}catch{}return"rail"}function Kp(l){try{const o=localStorage.getItem(l);if(o==="current-session"||o==="all")return o}catch{}return"current-session"}function Qp(){if(typeof window>"u")return{mode:"alpha",matteColor:"#ffffff"};try{const l=window.localStorage.getItem(kh);if(!l)return{mode:"alpha",matteColor:"#ffffff"};const o=JSON.parse(l),i=o.mode==="matte"?"matte":"alpha",s=typeof o.matteColor=="string"&&/^#[0-9a-fA-F]{6}$/.test(o.matteColor)?o.matteColor:"#ffffff";return{mode:i,matteColor:s}}catch{return{mode:"alpha",matteColor:"#ffffff"}}}function Zp(l,o){if(!(typeof window>"u"))try{window.localStorage.setItem(kh,JSON.stringify({mode:l,matteColor:o}))}catch{}}function Jp(){try{const l=localStorage.getItem(Gh);if(zh(l))return l}catch{}return z0}function $p(l){try{localStorage.setItem(Gh,l)}catch{}}function u1(){try{const l=localStorage.getItem(Uh);if(H0(l))return l}catch{}return L0}function d1(l){try{localStorage.setItem(Uh,l)}catch{}}function f1(){try{const l=localStorage.getItem(Bh);if(l==="false")return!1;if(l==="true")return!0}catch{}return k0}function m1(l){try{localStorage.setItem(Bh,String(l))}catch{}}function Ws(l){return l==="dark"||l==="light"?l:typeof window>"u"||typeof window.matchMedia!="function"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}const $h=18e4,fl=new Set;function Wp(l){const o=l.uiMode==="node"?[{kind:"node",sessionId:l.activeSessionId??void 0}]:[{kind:"classic"}];return l.inFlight.some(i=>i.kind==="multimode")&&o.push({kind:"multimode"}),o}function eh(l,o){const i=l.kind??"classic";return o.some(s=>i===s.kind&&(s.kind!=="node"||(l.sessionId??null)===(s.sessionId??null)))}async function th(l){const o=await Promise.all(l.map(i=>wh({kind:i.kind,sessionId:i.sessionId,includeTerminal:!0})));return{jobs:o.flatMap(i=>i.jobs),terminalJobs:o.flatMap(i=>i.terminalJobs??[])}}function Qc(l,o){const i=o.filter(u=>u.placement!=="after"),s=o.filter(u=>u.placement==="after");return[...i.map(u=>u.text.trim()).filter(Boolean),l.trim(),...s.map(u=>u.text.trim()).filter(Boolean)].filter(Boolean).join(`
|
|
23
|
-
|
|
24
|
-
`)}function p1(l){if(!l||typeof l!="object")return null;const o=l;return typeof o.id!="string"||typeof o.name!="string"||typeof o.text!="string"?null:{id:o.id,name:o.name,text:o.text,placement:o.placement==="after"?"after":"before"}}function Mi(l){if(!Array.isArray(l))return null;const o=l.map(p1);return o.every(i=>i!==null)?o:null}function nu(l){return l.map(o=>({id:o.id,name:o.name,text:o.text,placement:o.placement==="after"?"after":"before"}))}function h1(l){const o=Mi(l.composerInsertedPrompts);return typeof l.composerPrompt=="string"?{prompt:l.composerPrompt,insertedPrompts:o??[]}:o?{insertedPrompts:o}:{}}function eo(l){const o=l.meta??{},i=l.kind==="classic"||l.kind==="node"||l.kind==="multimode"?l.kind:o.kind==="classic"||o.kind==="node"||o.kind==="multimode"?o.kind:void 0;return{id:l.requestId,prompt:typeof l.prompt=="string"?l.prompt:"",startedAt:l.startedAt,composerPrompt:typeof o.composerPrompt=="string"?o.composerPrompt:void 0,composerInsertedPrompts:Mi(o.composerInsertedPrompts)??void 0,phase:typeof l.phase=="string"?l.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:i}}function ah(l){const o=typeof l.errorCode=="string"&&l.errorCode?l.errorCode:"UNKNOWN",i=new Error(o==="EMPTY_RESPONSE"?"No image data returned from the image backend.":"Generation failed on the server.");return i.code=o,i.status=typeof l.httpStatus=="number"?l.httpStatus:void 0,i}function nh(l){if(!l||typeof l!="object")return!1;const o=l;return o.code==="GENERATION_CANCELED"||o.status===499}function lh(l){return l.filename||l.image}function ih(l,o){const i=new Map(l.map(s=>[lh(s),s]));for(const s of o)i.set(lh(s),s);return[...i.values()].sort((s,u)=>(s.sequenceIndex??Number.MAX_SAFE_INTEGER)-(u.sequenceIndex??Number.MAX_SAFE_INTEGER))}function sh(){try{const l=localStorage.getItem(Fh);if(!l)return[];const o=JSON.parse(l);if(!Array.isArray(o))return[];const i=Date.now();return o.filter(s=>s&&typeof s.id=="string"&&typeof s.prompt=="string"&&typeof s.startedAt=="number"&&i-s.startedAt<$h).map(s=>({id:s.id,prompt:s.prompt,startedAt:s.startedAt,composerPrompt:typeof s.composerPrompt=="string"?s.composerPrompt:void 0,composerInsertedPrompts:Mi(s.composerInsertedPrompts)??void 0,phase:typeof s.phase=="string"?s.phase:void 0,sessionId:typeof s.sessionId=="string"?s.sessionId:null,parentNodeId:typeof s.parentNodeId=="string"?s.parentNodeId:null,clientNodeId:typeof s.clientNodeId=="string"?s.clientNodeId:null,kind:s.kind==="classic"||s.kind==="node"||s.kind==="multimode"?s.kind:void 0}))}catch{return[]}}function $t(l){try{localStorage.setItem(Fh,JSON.stringify(l))}catch(o){const i=window;if(!i.__ima2QuotaWarned){i.__ima2QuotaWarned=!0,console.warn("[ima2] localStorage write failed:",o);try{C.getState().showToast(J("toast.localStorageFull"),!0)}catch{}}}}function oh(){try{const l=localStorage.getItem(tu);return typeof l=="string"&&l.length>0?l:null}catch{return null}}function ea(l){try{l?localStorage.setItem(tu,l):localStorage.removeItem(tu)}catch{}}function g1(){try{const l=localStorage.getItem(au);return typeof l=="string"&&l.length>0?l:null}catch{return null}}function Zc(l){try{l?localStorage.setItem(au,l):localStorage.removeItem(au)}catch{}}const Yt=500,Ft=5;function y1(l){return l==="classic"||l==="edit"||l==="generate"||l==="card-news-card"||l==="card-news-set"?l:null}function bi(l){const o=Mi(l.composerInsertedPrompts);return{image:l.url,url:l.url,filename:l.filename,thumb:l.url,prompt:l.prompt??void 0,userPrompt:l.userPrompt??null,revisedPrompt:l.revisedPrompt??null,promptMode:l.promptMode??null,composerPrompt:l.composerPrompt??null,composerInsertedPrompts:o?nu(o):null,size:l.size??void 0,quality:l.quality??void 0,format:l.format,model:l.model??void 0,provider:l.provider,usage:l.usage??void 0,createdAt:l.createdAt,sessionId:l.sessionId??null,nodeId:l.nodeId??null,clientNodeId:l.clientNodeId??null,requestId:l.requestId??null,kind:y1(l.kind),canvasVersion:!!l.canvasVersion,canvasSourceFilename:l.canvasSourceFilename??null,canvasEditableFilename:l.canvasEditableFilename??null,canvasMergedAt:l.canvasMergedAt??void 0,setId:l.setId??null,cardId:l.cardId??null,cardOrder:l.cardOrder??null,headline:l.headline??null,body:l.body??null,cards:l.cards,refsCount:l.refsCount??0,isFavorite:l.isFavorite??!1,sequenceId:l.sequenceId??null,sequenceIndex:l.sequenceIndex??null,sequenceTotalRequested:l.sequenceTotalRequested??null,sequenceTotalReturned:l.sequenceTotalReturned??null,sequenceStatus:l.sequenceStatus??null}}function Xt(l){return l.filename??l.image}function Wh(l,o){const i=Xt(o);return l.filter(s=>Xt(s)!==i)}function eg(l,o){const i=Xt(o);return l.find(s=>Xt(s)===i)}function tg(l,o){return o?{...o,...l,createdAt:l.createdAt??o.createdAt,requestId:l.requestId??o.requestId,sessionId:l.sessionId??o.sessionId,kind:l.kind??o.kind,refsCount:l.refsCount??o.refsCount,isFavorite:l.isFavorite??o.isFavorite}:l}function rh(l,o){const i=new Map(l.map(s=>[Xt(s),s]));for(const s of o)i.set(Xt(s),s);return[...l.map(s=>i.get(Xt(s))??s),...o.filter(s=>!l.some(u=>Xt(u)===Xt(s)))]}function mo(l,o){return l.slice(0,Math.max(Yt,o))}function Jc(l){return l.replace(/^data:[^;]+;base64,/,"")}async function to(l,o="reference.png"){const i=await fetch(l);if(!i.ok)throw new Error(`reference fetch failed: ${i.status}`);const s=await i.blob(),u=new File([s],o,{type:s.type||"image/png"});return eu(u,{preserveTransparency:!1})}const ml="source-right",Si="target-left";function ao(l,o,i,s){return`${l}:${i??"auto"}->${o}:${s??"auto"}`}function v1(l,o){return l&&l.startsWith(`${o}-`)?l:null}function b1(l){switch(l){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 ag(l){const o=l.nodes.map(s=>{const u=s.data??{},d=typeof u.imageUrl=="string"&&u.imageUrl.length>0?u.imageUrl:null,p=typeof u.serverNodeId=="string"&&u.serverNodeId.length>0?`/generated/${u.serverNodeId}.png`:null,m=d??p,y={clientId:s.id,serverNodeId:u.serverNodeId??null,parentServerNodeId:u.parentServerNodeId??null,prompt:typeof u.prompt=="string"?u.prompt:"",imageUrl:m,status:u.status??(m?"ready":"empty"),pendingRequestId:u.pendingRequestId??null,recoveryRequestId:u.recoveryRequestId??null,pendingPhase:u.pendingPhase??null,pendingStartedAt:typeof u.pendingStartedAt=="number"?u.pendingStartedAt:null,partialImageUrl:null,error:u.error,elapsed:u.elapsed,webSearchCalls:u.webSearchCalls,model:u.model??null,size:u.size??null,referenceImages:F0(l.id,s.id)};return{id:s.id,type:"imageNode",position:{x:s.x,y:s.y},data:y}}),i=l.edges.map(s=>{const u=s.data??{};return{id:s.id,source:s.source,target:s.target,sourceHandle:typeof u.sourceHandle=="string"?u.sourceHandle:null,targetHandle:typeof u.targetHandle=="string"?u.targetHandle:null}});return{graphNodes:Qa(o,i),graphEdges:i,graphVersion:l.graphVersion}}function S1(l,o){let i=!1;const s={};for(const[u,d]of Object.entries(l)){const p=d.images.filter(m=>m.filename!==o);if(p.length===d.images.length){s[u]=d;continue}i=!0,p.length!==0&&(s[u]={...d,images:p,returned:p.length,status:d.status==="complete"&&p.length<d.requested?"partial":d.status})}return i?s:l}function x1(l,o){return`${l}x${o}`}function _i(l){return Math.min(8,Math.max(1,Math.trunc(l||1)))}const ng=new Set(["1024x1024","1536x1024","1024x1536","1360x1024","1024x1360","1824x1024","1024x1824","2048x2048","2048x1152","1152x2048","3840x2160","2160x3840","auto","custom"]);function N1(l){if(typeof l!="string")return{};if(ng.has(l))return{preset:l};const o=/^(\d+)x(\d+)$/.exec(l);if(!o)return{};const i=Number(o[1]),s=Number(o[2]);return!Number.isFinite(i)||!Number.isFinite(s)?{}:{preset:"custom",w:i,h:s}}function lg(l){return l==="low"||l==="medium"||l==="high"}function ig(l){return l==="png"||l==="jpeg"||l==="webp"}function sg(l){return l==="low"||l==="auto"}function E1(l){return l==="oauth"||l==="api"}function T1(l){return l==="auto"||l==="direct"}function _1(l){return typeof l=="string"&&ng.has(l)}function og(){try{const l=localStorage.getItem(Ph);if(!l)return{};const o=JSON.parse(l),i={};E1(o.provider)&&(i.provider=o.provider),lg(o.quality)&&(i.quality=o.quality),_1(o.sizePreset)&&(i.sizePreset=o.sizePreset),typeof o.customW=="number"&&Number.isFinite(o.customW)&&(i.customW=aa(o.customW,1920)),typeof o.customH=="number"&&Number.isFinite(o.customH)&&(i.customH=aa(o.customH,1088)),ig(o.format)&&(i.format=o.format),sg(o.moderation)&&(i.moderation=o.moderation),typeof o.count=="number"&&(i.count=_i(o.count)),typeof o.multimode=="boolean"&&(i.multimode=o.multimode),typeof o.multimodeMaxImages=="number"&&(i.multimodeMaxImages=_i(o.multimodeMaxImages)),T1(o.promptMode)&&(i.promptMode=o.promptMode),typeof o.prompt=="string"&&(i.prompt=o.prompt);const s=Mi(o.insertedPrompts);return s&&(i.insertedPrompts=s),i}catch{return{}}}function ot(l){try{const o=og();localStorage.setItem(Ph,JSON.stringify({...o,...l}))}catch{}}function C1(l,o){const i={},s=o.userPrompt||o.prompt;typeof s=="string"&&(i.prompt=s),lg(o.quality)&&(i.quality=o.quality),ig(o.format)&&(i.format=o.format),sg(o.moderation)&&(i.moderation=o.moderation),(o.promptMode==="auto"||o.promptMode==="direct")&&(i.promptMode=o.promptMode),o.model&&zh(o.model)&&(i.imageModel=o.model);const u=N1(o.size);return u.preset&&(i.sizePreset=u.preset),u.preset==="custom"&&u.w&&u.h&&(i.customW=aa(u.w,l.customW),i.customH=aa(u.h,l.customH)),i}function no(l,o){if(l.sizePreset!=="custom")return null;const i=cu(l.customW,l.customH,l.customW,l.customH);return i.adjusted?{requestedW:i.requestedW,requestedH:i.requestedH,adjustedW:i.w,adjustedH:i.h,reasons:i.reasons,continuation:o}:null}const At=og(),C=Ch((l,o)=>({provider:At.provider??"oauth",quality:At.quality??"medium",sizePreset:At.sizePreset??"1024x1024",customW:At.customW??1920,customH:At.customH??1088,format:At.format??"png",moderation:At.moderation??"low",count:At.count??1,multimode:At.multimode??!1,multimodeMaxImages:At.multimodeMaxImages??4,multimodeSequences:{},multimodeAbortControllers:{},multimodePreviewFlightId:null,promptMode:At.promptMode??"auto",prompt:At.prompt??"",insertedPrompts:At.insertedPrompts??[],referenceImages:[],canvasReferenceImage:null,workspaceProfile:(()=>{try{return localStorage.getItem("ima2.workspaceProfile")==="prompt-studio"?"prompt-studio":"default"}catch{return"default"}})(),promptBuilderOpen:!1,promptLibraryOpen:!1,promptLibrary:{prompts:[],folders:[]},promptLibraryLoading:!1,galleryFavorites:new Set,browserId:Ah(),canvasOpen:!1,canvasZoom:1,canvasPanX:0,canvasPanY:0,canvasExportBackground:Qp().mode,canvasExportMatteColor:Qp().matteColor,addReferences:async i=>{const s=Ft-o().referenceImages.length,u=i.slice(0,Math.max(0,s)),d=u.filter(Js),p=u.filter(x=>!Js(x)),y=(await Promise.all(p.map(async x=>{try{return await eu(x,{preserveTransparency:zp(x)})}catch(b){return console.warn("[addReferences] compress failed",b),null}}))).filter(x=>!!x);l(x=>({referenceImages:[...x.referenceImages,...y].slice(0,Ft)})),d.length>0&&o().showToast(J("toast.refHeicUnsupported"),!0),p.length-y.length>0&&o().showToast(J("toast.refTooLarge"),!0),i.length>s&&o().showToast(J("toast.refLimitExceeded"),!0)},addReferenceDataUrl:i=>{l(s=>s.referenceImages.length>=Ft?s:{referenceImages:[...s.referenceImages,i]})},metadataRestore:null,readDroppedImageMetadata:async(i,s=null)=>{if(!i.type.startsWith("image/"))return!1;let u="";try{u=await Ib(i);const d=await Nb({filename:i.name,dataUrl:u});return d.metadata?(l({metadataRestore:{filename:i.name,image:u,metadata:d.metadata,source:d.source??"xmp",targetNodeId:s}}),!0):!1}catch{return o().showToast(J("metadata.readFailed"),!0),!1}},applyMetadataRestore:()=>{const i=o().metadataRestore;if(!i)return;const s=C1(o(),i.metadata);if(s.imageModel&&$p(s.imageModel),i.targetNodeId&&typeof s.prompt=="string"){const u=s.prompt;l({...s,metadataRestore:null,graphNodes:o().graphNodes.map(d=>d.id===i.targetNodeId?{...d,data:{...d.data,prompt:u}}:d)}),o().scheduleGraphSave()}else l({...s,metadataRestore:null});o().showToast(J("metadata.applied"))},cancelMetadataRestore:()=>l({metadataRestore:null}),addMetadataRestoreAsReference:()=>{const i=o().metadataRestore;i&&(i.targetNodeId?o().addNodeReferenceDataUrl(i.targetNodeId,i.image):o().addReferenceDataUrl(i.image),l({metadataRestore:null}))},removeReference:i=>{l(s=>({referenceImages:s.referenceImages.filter((u,d)=>d!==i),canvasReferenceImage:s.referenceImages[i]===s.canvasReferenceImage?null:s.canvasReferenceImage}))},clearReferences:()=>l({referenceImages:[],canvasReferenceImage:null}),attachCanvasVersionReference:async i=>{let s;try{s=await to(i.image,i.filename||"canvas-version-reference.png")}catch{throw o().showToast(J("toast.currentImageLoadFailed"),!0),new Error("canvas_reference_attach_failed")}l(u=>{const p=(u.canvasReferenceImage?u.referenceImages.filter(m=>m!==u.canvasReferenceImage):u.referenceImages).filter(m=>m!==s);return{canvasReferenceImage:s,referenceImages:[s,...p].slice(0,Ft)}}),o().showToast(J("canvas.version.usingAsReference"))},useCurrentAsReference:async()=>{const i=o().currentImage;if(!i){o().showToast(J("toast.noCurrentImageForRef"),!0);return}if(o().referenceImages.length>=Ft){o().showToast(J("toast.refSlotFull"),!0);return}let s;try{s=await to(i.image,i.filename||"current-reference.png")}catch{o().showToast(J("toast.currentImageLoadFailed"),!0);return}l(u=>({referenceImages:[...u.referenceImages,s].slice(0,Ft)})),o().showToast(J("toast.addedCurrentAsRef"))},useImageAsReference:async i=>{if(o().referenceImages.length>=Ft){o().showToast(J("toast.refSlotFull"),!0);return}let s;try{s=await to(i.image,i.filename||"canvas-reference.png")}catch{o().showToast(J("toast.currentImageLoadFailed"),!0);return}l(u=>({referenceImages:[...u.referenceImages,s].slice(0,Ft)})),o().showToast(J("toast.addedCurrentAsRef"))},activeGenerations:0,unseenGeneratedCount:0,inFlight:[],cancelInFlightJob:async i=>{if(i){l(s=>{const u=s.inFlight.map(d=>d.id===i?{...d,phase:"canceling"}:d);return $t(u),{inFlight:u}});try{await Uc(i),o().startInFlightPolling()}catch{o().showToast(J("toast.cancelFailed"),!0)}}},startInFlightPolling:()=>{if(typeof window>"u")return;const i=window;if(i.__ima2InflightTimer)return;const s=async()=>{if(o().inFlight.length===0&&o().activeGenerations===0){i.__ima2InflightTimer&&(clearInterval(i.__ima2InflightTimer),i.__ima2InflightTimer=void 0);return}let d=new Set;try{const p=Wp(o()),{jobs:m,terminalJobs:y=[]}=await th(p);d=new Set(m.map(Y=>Y.requestId));const g=new Map(m.map(Y=>[Y.requestId,Y])),x=new Map(y.map(Y=>[Y.requestId,Y])),b=[];let S=!1;const N=Date.now(),M=5e3,z=[];for(const Y of o().inFlight){if(!eh(Y,p)){z.push(Y);continue}const X=x.get(Y.id);if(X){S=!0,X.status==="error"&&b.push(ah(X));continue}if(!g.has(Y.id)&&N-Y.startedAt>M){S=!0;continue}const Q=g.get(Y.id);if(Q){const D=eo(Q),te={...Y,phase:D.phase,sessionId:D.sessionId,parentNodeId:D.parentNodeId,clientNodeId:D.clientNodeId,kind:D.kind};(te.phase!==Y.phase||te.sessionId!==Y.sessionId||te.parentNodeId!==Y.parentNodeId||te.clientNodeId!==Y.clientNodeId||te.kind!==Y.kind)&&(S=!0),z.push(te)}else z.push(Y)}const F=new Set(z.map(Y=>Y.id));for(const Y of m)F.has(Y.requestId)||(z.push(eo(Y)),S=!0);S&&($t(z),l({inFlight:z,activeGenerations:z.length}));for(const Y of b)vi(Y,o())}catch{}try{const p=o().history.reduce((b,S)=>S.createdAt&&S.createdAt>b?S.createdAt:b,0),{items:m}=await gl({limit:Yt,since:p}),y=m.map(bi);y.length>0&&l(b=>{const S=new Set(b.history.map(Xt)),N=y.filter(z=>{const F=Xt(z);return S.has(F)?!1:(S.add(F),!0)});if(N.length===0)return{};const M=b.currentImage??N[0];return!b.currentImage&&N[0]?.filename&&ea(N[0].filename),{history:mo([...N,...b.history],Math.max(Yt,b.history.length+N.length)),currentImage:M,loadedHistoryRetainLimit:Math.max(b.loadedHistoryRetainLimit,b.history.length+N.length)}});const g=Date.now(),x=o().inFlight.filter(b=>d.has(b.id)||g-b.startedAt<$h);x.length!==o().inFlight.length&&($t(x),l({inFlight:x,activeGenerations:x.length}))}catch{}};i.__ima2InflightTimer=window.setInterval(s,1500)},reconcileInflight:async()=>{try{const i=Wp(o()),{jobs:s,terminalJobs:u=[]}=await th(i),d=new Map(s.map(N=>[N.requestId,N])),p=new Map(u.map(N=>[N.requestId,N])),m=[],y=Date.now(),g=o().inFlight,b=(g.length>0?g:sh()).flatMap(N=>{const M=d.get(N.id);if(M){const F=eo(M);return[{...N,...F,prompt:N.prompt||F.prompt}]}if(!eh(N,i))return[N];const z=p.get(N.id);return z?(z.status==="error"&&m.push(ah(z)),[]):y-N.startedAt<1e4?[N]:[]}),S=new Set(b.map(N=>N.id));for(const N of s)S.has(N.requestId)||b.push(eo(N));$t(b),l({inFlight:b,activeGenerations:b.length});for(const N of m)vi(N,o());b.length>0&&o().startInFlightPolling()}catch{}},syncFromStorage:()=>{const i=sh(),s=oh(),u=Jp();l(d=>{const p=s?d.history.find(x=>x.filename===s)??null:null,m=p?Wt(d.history,p):null,y=En(d.history)[0]??null,g=d.currentImage?.canvasVersion?Wt(d.history,d.currentImage)??y:d.currentImage;return{inFlight:i,activeGenerations:i.length,imageModel:u,currentImage:s&&g?.filename!==s?m??g:g}}),i.length>0&&o().startInFlightPolling()},currentImage:null,applyMergedCanvasImage:i=>{l(s=>({history:i.filename?s.history.some(u=>u.filename===i.filename)?s.history.map(u=>u.filename===i.filename?i:u):mo([i,...s.history],s.loadedHistoryRetainLimit+1):s.history,loadedHistoryRetainLimit:Math.max(s.loadedHistoryRetainLimit,Math.min(s.history.length+1,s.loadedHistoryRetainLimit+1))}))},addGeneratedHistoryItem:async i=>{await lo(i,l,o)},history:[],historyNextCursor:null,historyLoadingOlder:!1,favoriteHistoryNextCursor:null,favoriteHistoryLoadingOlder:!1,loadedHistoryRetainLimit:Yt,loadOlderHistory:async()=>{const i=o().historyNextCursor;if(!(!i||o().historyLoadingOlder)){l({historyLoadingOlder:!0});try{const s=await gl({limit:Yt,cursor:i}),u=s.items.map(bi);l(d=>{const p=new Set(d.history.map(y=>y.filename??y.image)),m=u.filter(y=>{const g=y.filename??y.image;return p.has(g)?!1:(p.add(g),!0)});return{history:[...d.history,...m],historyNextCursor:s.nextCursor,historyLoadingOlder:!1,loadedHistoryRetainLimit:Math.max(d.loadedHistoryRetainLimit,d.history.length+m.length)}})}catch{l({historyLoadingOlder:!1}),o().showToast(J("gallery.loadOlderFailed"),!0)}}},loadFavoriteHistory:async()=>{try{const i=await gl({limit:Yt,favoritesOnly:!0}),s=i.items.map(bi);l(u=>{const d=rh(u.history,s);return{history:d,favoriteHistoryNextCursor:i.nextCursor,loadedHistoryRetainLimit:Math.max(u.loadedHistoryRetainLimit,d.length),galleryFavorites:new Set([...Array.from(u.galleryFavorites),...s.filter(p=>p.filename).map(p=>p.filename)])}})}catch{o().showToast(J("gallery.loadOlderFailed"),!0)}},loadOlderFavoriteHistory:async()=>{const i=o().favoriteHistoryNextCursor;if(!(!i||o().favoriteHistoryLoadingOlder)){l({favoriteHistoryLoadingOlder:!0});try{const s=await gl({limit:Yt,cursor:i,favoritesOnly:!0}),u=s.items.map(bi);l(d=>{const p=rh(d.history,u);return{history:p,favoriteHistoryNextCursor:s.nextCursor,favoriteHistoryLoadingOlder:!1,loadedHistoryRetainLimit:Math.max(d.loadedHistoryRetainLimit,p.length),galleryFavorites:new Set([...Array.from(d.galleryFavorites),...u.filter(m=>m.filename).map(m=>m.filename)])}})}catch{l({favoriteHistoryLoadingOlder:!1}),o().showToast(J("gallery.loadOlderFailed"),!0)}}},trashPending:null,toast:null,toastLog:[],customSizeConfirm:null,errorCard:null,errorCardLog:[],rightPanelOpen:o1(),toggleRightPanel:()=>l(i=>{const s=!i.rightPanelOpen;try{localStorage.setItem(Ih,JSON.stringify(s))}catch{}return{rightPanelOpen:s}}),composeSheetOpen:!1,composeSheetTab:"prompt",openComposeSheet:(i="prompt")=>l({composeSheetOpen:!0,composeSheetTab:i}),setComposeSheetTab:i=>l({composeSheetTab:i}),closeComposeSheet:()=>l({composeSheetOpen:!1}),galleryOpen:!1,openGallery:()=>l(i=>({galleryOpen:!0,galleryScope:i.galleryDefaultScope})),closeGallery:()=>l({galleryOpen:!1}),galleryScope:Kp(Yc),galleryDefaultScope:Kp(Bp),setGalleryScope:i=>{try{localStorage.setItem(Yc,i)}catch{}l({galleryScope:i})},setGalleryDefaultScope:i=>{try{localStorage.setItem(Bp,i),localStorage.setItem(Yc,i)}catch{}l({galleryDefaultScope:i,galleryScope:i})},imageModel:Jp(),reasoningEffort:u1(),webSearchEnabled:f1(),settingsOpen:!1,activeSettingsSection:"account",readinessPopupOpen:!1,openSettings:(i="account")=>l({settingsOpen:!0,activeSettingsSection:i}),closeSettings:()=>l({settingsOpen:!1}),toggleSettings:()=>l(i=>({settingsOpen:!i.settingsOpen,activeSettingsSection:i.settingsOpen?i.activeSettingsSection:"account"})),setActiveSettingsSection:i=>l({activeSettingsSection:i}),openReadinessPopup:()=>l({readinessPopupOpen:!0}),closeReadinessPopup:()=>l({readinessPopupOpen:!1}),uiMode:r1(),setUIMode:i=>{const s=i==="card-news"&&!Qh?"classic":i;try{localStorage.setItem(Dh,s)}catch{}l({uiMode:s})},theme:Kc(),resolvedTheme:Ws(Kc()),themeFamily:Xp(),historyStripLayout:c1(),setTheme:i=>{try{localStorage.setItem(qh,i)}catch{}l({theme:i,resolvedTheme:Ws(i)})},setThemeFamily:i=>{try{localStorage.setItem(Hh,i)}catch{}l({themeFamily:i})},setHistoryStripLayout:i=>{try{localStorage.setItem(Lh,i)}catch{}l({historyStripLayout:i})},syncThemeFromStorage:()=>{const i=Kc();l({theme:i,resolvedTheme:Ws(i)})},syncThemeFamilyFromStorage:()=>{l({themeFamily:Xp()})},refreshResolvedTheme:()=>{l(i=>({resolvedTheme:Ws(i.theme)}))},locale:y0(),setLocale:i=>{v0(i),l({locale:i})},graphNodes:[],graphEdges:[],setGraphNodes:i=>{l({graphNodes:Qa(i,o().graphEdges)}),o().scheduleGraphSave()},setGraphEdges:i=>{l({graphEdges:i,graphNodes:Qa(o().graphNodes,i)}),o().scheduleGraphSave()},disconnectEdge:i=>{o().disconnectEdges([i])},disconnectEdges:i=>{const s=new Set(i);if(s.size===0)return;const u=o().graphEdges.filter(y=>s.has(y.id));if(u.length===0)return;const d=o().graphEdges.filter(y=>!s.has(y.id)),p=new Set(u.map(y=>y.target)),m=o().graphNodes.map(y=>{if(!p.has(y.id))return y;const g=d.find(b=>b.target===y.id),x=g?o().graphNodes.find(b=>b.id===g.source):null;return{...y,data:{...y.data,parentServerNodeId:x?.data.serverNodeId??null}}});l({graphNodes:Qa(m,d),graphEdges:d}),o().scheduleGraphSave(),o().flushGraphSave("edge-disconnect"),o().showToast(J("edge.disconnected"))},nodeSelectionMode:!1,nodeBatchRunning:!1,nodeBatchStopping:!1,toggleNodeSelectionMode:()=>{const i=!o().nodeSelectionMode;l({nodeSelectionMode:i,...i?{}:{graphNodes:Ni(o().graphNodes,[])}})},selectAllGraphNodes:()=>{l({graphNodes:Ni(o().graphNodes,o().graphNodes.map(i=>i.id))})},selectNodeGraph:(i,s)=>{l({graphNodes:X0(o().graphNodes,o().graphEdges,i,s)})},clearNodeSelection:()=>{l({graphNodes:Ni(o().graphNodes,[])})},cancelNodeBatch:()=>{o().nodeBatchRunning&&(l({nodeBatchStopping:!0}),o().showToast(J("nodeBatch.stopQueued")))},sessions:[],activeSessionId:null,activeSessionGraphVersion:null,sessionLoading:!1,async loadSessions(){try{const{sessions:i}=await Eb();if(l({sessions:i}),!o().activeSessionId){const u=g1(),d=u?i.some(p=>p.id===u):!1;u&&d?await o().switchSession(u):await o().createAndSwitchSession(J("session.firstGraph"))}}catch(i){console.warn("[sessions] load failed:",i)}},async switchSession(i){l({sessionLoading:!0}),await o().flushGraphSave("switch-session");try{const{session:s}=await Mh(i),{graphNodes:u,graphEdges:d,graphVersion:p}=ag(s);l({activeSessionId:i,activeSessionGraphVersion:p,graphNodes:u,graphEdges:d,sessionLoading:!1}),Zc(i),await o().reconcileGraphPending().catch(()=>{})}catch(s){console.warn("[sessions] switch failed:",s),l({sessionLoading:!1}),o().showToast(J("toast.sessionLoadFailed"),!0)}},async reconcileGraphPending(){const i=o().activeSessionId;if(!i)return;if(o().graphNodes.filter(u=>u.data?.pendingRequestId&&(u.data.status==="pending"||u.data.status==="reconciling")).length>0){let u=[];try{u=(await wh({kind:"node",sessionId:i})).jobs}catch{u=[]}const d=new Map(u.map(g=>[g.requestId,g.phase])),p=Date.now(),m=1e4,y=o().graphNodes.map(g=>{const x=g.data?.pendingRequestId;if(!x||g.data.status!=="pending"&&g.data.status!=="reconciling")return g;if(d.has(x)){const N=d.get(x)??null;return{...g,data:{...g.data,status:"reconciling",pendingPhase:N}}}const b=g.data.pendingStartedAt??0;if(b&&p-b<m)return{...g,data:{...g.data,status:"reconciling"}};const S=!!g.data.imageUrl||!!g.data.serverNodeId;return{...g,data:{...g.data,pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,status:S?"ready":"stale",error:S?void 0:J("session.assetAbortedError")}}});l({graphNodes:y})}await fg(o,l).catch(()=>{})},async createAndSwitchSession(i){i==null&&(i=J("session.untitled"));try{const{session:s}=await Tb(i);l({sessions:[s,...o().sessions],activeSessionId:s.id,activeSessionGraphVersion:s.graphVersion,graphNodes:[],graphEdges:[]}),Zc(s.id)}catch(s){console.warn("[sessions] create failed:",s),o().showToast(J("toast.sessionCreateFailed"),!0)}},async renameCurrentSession(i){const s=o().activeSessionId;if(s)try{await _b(s,i),l({sessions:o().sessions.map(u=>u.id===s?{...u,title:i,updatedAt:Date.now()}:u)})}catch{o().showToast(J("toast.sessionRenameFailed"),!0)}},async deleteSessionById(i){try{await Cb(i);const s=o().sessions.filter(u=>u.id!==i);l({sessions:s}),o().activeSessionId===i&&(l({activeSessionId:null,activeSessionGraphVersion:null,graphNodes:[],graphEdges:[]}),Zc(null),s.length>0?await o().switchSession(s[0].id):await o().createAndSwitchSession(J("session.firstGraph")))}catch{o().showToast(J("toast.sessionDeleteFailed"),!0)}},scheduleGraphSave(){pg(o,l)},async flushGraphSave(i="manual"){await R1(o,l,i)},addRootNode:()=>{const i=vn(),s={id:i,type:"imageNode",position:Vc(o().graphNodes),data:{clientId:i,serverNodeId:null,parentServerNodeId:null,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return l({graphNodes:[...o().graphNodes,s]}),o().scheduleGraphSave(),i},createRootNodeFromHistoryItem:i=>{const s=vn(),u={id:s,type:"imageNode",position:Vc(o().graphNodes),data:{clientId:s,serverNodeId:i.nodeId??null,parentServerNodeId:null,prompt:i.prompt??"",imageUrl:i.image,status:"ready",pendingRequestId:null,pendingPhase:null,model:i.model??null,size:i.size??null}};return l({uiMode:"node",graphNodes:[...o().graphNodes,u]}),o().scheduleGraphSave(),s},addChildNode:i=>{const s=o().graphNodes.find(m=>m.id===i);if(!s)return i;const u=vn(),d={id:u,type:"imageNode",position:Fp(s,o().graphNodes,o().graphEdges),data:{clientId:u,serverNodeId:null,parentServerNodeId:s.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},p={id:ao(i,u,ml,Si),source:i,target:u,sourceHandle:ml,targetHandle:Si};return l({graphNodes:[...o().graphNodes,d],graphEdges:[...o().graphEdges,p]}),o().scheduleGraphSave(),u},addSiblingNode:i=>{const s=o().graphNodes.find(x=>x.id===i);if(!s)return i;const u=o().graphEdges.find(x=>x.target===i);if(!u){const x=vn(),b={id:x,type:"imageNode",position:Vc(o().graphNodes),data:{clientId:x,serverNodeId:null,parentServerNodeId:null,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return l({graphNodes:[...o().graphNodes,b]}),o().scheduleGraphSave(),x}const d=u.source,p=o().graphNodes.find(x=>x.id===d);if(!p)return i;const m=vn(),y={id:m,type:"imageNode",position:Fp(p,o().graphNodes,o().graphEdges),data:{clientId:m,serverNodeId:null,parentServerNodeId:s.data.parentServerNodeId,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:ao(d,m,ml,Si),source:d,target:m,sourceHandle:ml,targetHandle:Si};return l({graphNodes:[...o().graphNodes,y],graphEdges:[...o().graphEdges,g]}),o().scheduleGraphSave(),m},updateNodePrompt:(i,s)=>{l({graphNodes:o().graphNodes.map(u=>u.id===i?{...u,data:{...u.data,prompt:s}}:u)}),o().scheduleGraphSave()},addNodeReferences:async(i,s)=>{const u=o().graphNodes.find(N=>N.id===i);if(!u)return;const d=u.data.referenceImages??[],p=Ft-d.length;if(p<=0){o().showToast(J("toast.refLimitExceeded"),!0);return}const m=s.slice(0,Math.max(0,p)),y=m.filter(Js),g=m.filter(N=>!Js(N)),b=(await Promise.all(g.map(async N=>{try{return await eu(N,{preserveTransparency:zp(N)})}catch(M){return console.warn("[addNodeReferences] compress failed",M),null}}))).filter(N=>!!N);if(b.length>0){const N=o().activeSessionId;l({graphNodes:o().graphNodes.map(M=>{if(M.id!==i)return M;const z=[...M.data.referenceImages??[],...b].slice(0,Ft);return uo(N,i,z),{...M,data:{...M.data,referenceImages:z}}})}),o().scheduleGraphSave()}y.length>0&&o().showToast(J("toast.refHeicUnsupported"),!0),g.length-b.length>0&&o().showToast(J("toast.refTooLarge"),!0),s.length>p&&o().showToast(J("toast.refLimitExceeded"),!0)},addNodeReferenceDataUrl:(i,s)=>{o().graphNodes.find(d=>d.id===i)&&(l({graphNodes:o().graphNodes.map(d=>{if(d.id!==i)return d;const p=d.data.referenceImages??[];if(p.length>=Ft)return d;const m=[...p,s];return uo(o().activeSessionId,i,m),{...d,data:{...d.data,referenceImages:m}}})}),o().scheduleGraphSave())},removeNodeReference:(i,s)=>{l({graphNodes:o().graphNodes.map(u=>{if(u.id!==i)return u;const d=(u.data.referenceImages??[]).filter((p,m)=>m!==s);return uo(o().activeSessionId,i,d),{...u,data:{...u.data,referenceImages:d}}})}),o().scheduleGraphSave()},clearNodeReferences:i=>{Xc(o().activeSessionId,i),l({graphNodes:o().graphNodes.map(s=>s.id===i?{...s,data:{...s.data,referenceImages:void 0}}:s)}),o().scheduleGraphSave()},duplicateBranchRoot:i=>{const s=o().graphNodes.find(p=>p.id===i);if(!s)return i;const u=vn();o().graphNodes.filter(p=>!p.data.parentServerNodeId).length;const d={id:u,type:"imageNode",position:{x:s.position.x+420,y:s.position.y+40},data:{clientId:u,serverNodeId:null,parentServerNodeId:null,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};if(l({graphNodes:[...o().graphNodes,d]}),o().scheduleGraphSave(),s.data.imageUrl){const p=s.data.imageUrl;(async()=>{try{const m=await to(p,"node-reference.png");l({graphNodes:o().graphNodes.map(y=>y.id===u?{...y,data:{...y.data,referenceImages:[m]}}:y)})}catch{}})()}return u},async generateNode(i){const s=o().graphNodes.find(p=>p.id===i);if(!s)return;const{prompt:u}=s.data;if(!u.trim()){o().showToast(J("toast.promptRequired"),!0);return}const d=no(o(),{kind:"node",clientId:i});if(d){l({customSizeConfirm:d});return}await o().runGenerateNode(i)},async generateNodeInPlace(i){const s=o().graphNodes.find(d=>d.id===i);if(!s)return;if(!s.data.prompt.trim()){o().showToast(J("toast.promptRequired"),!0);return}const u=no(o(),{kind:"node-in-place",clientId:i});if(u){l({customSizeConfirm:u});return}await o().runGenerateNodeInPlace(i)},async generateNodeVariation(i,s){const u=o().graphNodes.find(p=>p.id===i);if(!u)return;if(!u.data.prompt.trim()){o().showToast(J("toast.promptRequired"),!0);return}if(!s){const p=no(o(),{kind:"node-variation",clientId:i});if(p){l({customSizeConfirm:p});return}}const d=o().addSiblingNode(i);await o().runGenerateNodeInPlace(d,{sizeOverride:s})},async runGenerateNode(i,s){const d=o().graphNodes.find(p=>p.id===i)?.data.status==="ready"?o().addSiblingNode(i):i;await o().runGenerateNodeInPlace(d,{sizeOverride:s})},async runGenerateNodeInPlace(i,s={}){if(fl.has(i))return null;fl.add(i);const u=o().graphNodes,d=Qa(u,o().graphEdges);d.some((D,te)=>D.data.parentServerNodeId!==u[te]?.data.parentServerNodeId)&&l({graphNodes:d});const p=d.find(D=>D.id===i);if(!p)return fl.delete(i),null;const{prompt:m,parentServerNodeId:y}=p.data;if(!m.trim())return o().showToast(J("toast.promptRequired"),!0),fl.delete(i),null;const g=p.data.referenceImages??[],x=o(),b=s.sizeOverride??x.getResolvedSize(),S=s.parentServerNodeIdOverride!==void 0?s.parentServerNodeIdOverride:y;if(o().graphEdges.find(D=>D.target===i)&&!S)return o().showToast(J("node.parentImageRequired"),!0),fl.delete(i),null;const M=x.activeSessionId,z=Date.now(),F=Math.random().toString(36).slice(2,6),Y=`fn_${i}_${z}_${F}`,X=[...x.inFlight,{id:Y,prompt:m,startedAt:z,kind:"node",sessionId:M,clientNodeId:i}];$t(X),l({graphNodes:o().graphNodes.map(D=>D.id===i?{...D,data:{...D.data,status:"pending",pendingRequestId:Y,recoveryRequestId:Y,pendingPhase:"queued",pendingStartedAt:z,partialImageUrl:null,error:void 0,size:b}}:D),activeGenerations:x.activeGenerations+1,inFlight:X}),o().startInFlightPolling();let Q=!0;try{const D=await cb({parentNodeId:S,prompt:m,quality:x.quality,size:b,format:x.format,moderation:x.moderation,model:x.imageModel,reasoningEffort:x.reasoningEffort,requestId:Y,sessionId:M,clientNodeId:i,contextMode:"parent-plus-refs",searchMode:x.webSearchEnabled?"on":"off",webSearchEnabled:x.webSearchEnabled,...g.length?{references:g.map(Jc)}:{}},{onPartial:te=>{o().activeSessionId===M&&l({graphNodes:o().graphNodes.map(U=>U.id===i?{...U,data:{...U.data,status:"pending",partialImageUrl:te.image,pendingPhase:"partial"}}:U)})},onPhase:te=>{o().activeSessionId===M&&te.phase&&l({graphNodes:o().graphNodes.map(U=>U.id===i?{...U,data:{...U.data,pendingPhase:te.phase??U.data.pendingPhase}}:U)})}});return o().activeSessionId===M&&(l({graphNodes:o().graphNodes.map(te=>{if(te.id!==i)return te;const U={...te.data};return delete U.partialImageUrl,{...te,data:{...U,serverNodeId:D.nodeId,imageUrl:D.url,status:"ready",pendingRequestId:null,recoveryRequestId:null,pendingPhase:null,pendingStartedAt:null,elapsed:D.elapsed,webSearchCalls:D.webSearchCalls,model:D.model??null,size:D.size??b}}})}),Q=!0,s.suppressToast||o().showToast(J("toast.nodeCreated",{id:D.nodeId.slice(0,8),elapsed:D.elapsed}))),D.nodeId}catch(D){const te=D instanceof Error?D.message:J("toast.nodeCreateFailed");return o().activeSessionId===M&&(l({graphNodes:o().graphNodes.map(U=>U.id===i?{...U,data:{...U.data,status:"error",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,error:te}}:U)}),Q=!0,vi(D,o())),null}finally{fl.delete(i);const D=o().inFlight.filter(te=>te.id!==Y);$t(D),l({activeGenerations:Math.max(0,o().activeGenerations-1),inFlight:D}),o().activeSessionId===M&&Q&&(o().scheduleGraphSave(),o().flushGraphSave("node-complete"))}},async runNodeBatch(i){if(o().nodeBatchRunning)return;const s=Kh(o().graphNodes);if(s.length===0){o().showToast(J("nodeBatch.noneSelected"),!0);return}const u=$0(o().graphNodes,o().graphEdges,s);if(u.length>0){o().showToast(J("nodeBatch.parentRequired",{count:u.length}),!0);return}const d=Q0(o().graphNodes,o().graphEdges,s),p=new Set(s),m=d.filter(x=>{if(i==="regenerate-all")return!0;const b=o().graphNodes.find(S=>S.id===x);return b?!K0(b):!1});if(m.length===0){o().showToast(J("nodeBatch.nothingToRun"));return}l({nodeBatchRunning:!0,nodeBatchStopping:!1});const y=new Map;let g=0;try{for(const x of m){if(o().nodeBatchStopping)break;const b=o().graphEdges.find(F=>F.target===x),S=b?y.get(b.source)??o().graphNodes.find(F=>F.id===x)?.data.parentServerNodeId??null:null,N=await o().runGenerateNodeInPlace(x,{parentServerNodeIdOverride:S,suppressToast:!0});if(!N){o().showToast(J("nodeBatch.failed",{done:g,total:m.length}),!0);break}g+=1,y.set(x,N);const M=J0(o().graphEdges,x,p),z=new Set(Z0(o().graphEdges,p));l({graphNodes:o().graphNodes.map(F=>z.has(F.id)?{...F,data:{...F.data,status:"stale",parentServerNodeId:M.includes(F.id)?N:F.data.parentServerNodeId,error:J("nodeBatch.staleBecauseParentChanged")}}:F)})}o().showToast(J("nodeBatch.finished",{done:g,total:m.length})),o().scheduleGraphSave()}finally{l({nodeBatchRunning:!1,nodeBatchStopping:!1})}},deleteNode:i=>{const u=o().graphNodes.find(m=>m.id===i)?.data?.pendingRequestId;u&&Uc(u),Xc(o().activeSessionId,i);const d=o().graphNodes.filter(m=>m.id!==i),p=o().graphEdges.filter(m=>m.source!==i&&m.target!==i);l({graphNodes:Qa(d,p),graphEdges:p}),o().scheduleGraphSave()},deleteNodes:i=>{const s=new Set(i);for(const p of s)Xc(o().activeSessionId,p);for(const p of o().graphNodes)s.has(p.id)&&p.data?.pendingRequestId&&Uc(p.data.pendingRequestId);const u=o().graphNodes.filter(p=>!s.has(p.id)),d=o().graphEdges.filter(p=>!s.has(p.source)&&!s.has(p.target));l({graphNodes:Qa(u,d),graphEdges:d}),o().scheduleGraphSave()},addChildNodeAt:(i,s,u=ml)=>{const d=o().graphNodes.find(b=>b.id===i);if(!d)return i;const p=vn(),m=v1(u,"source")??ml,y=b1(m)??Si,g={id:p,type:"imageNode",position:s,data:{clientId:p,serverNodeId:null,parentServerNodeId:d.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},x={id:ao(i,p,m,y),source:i,target:p,sourceHandle:m,targetHandle:y};return l({graphNodes:[...o().graphNodes,g],graphEdges:[...o().graphEdges,x]}),o().scheduleGraphSave(),p},connectNodes:(i,s,u=null,d=null)=>{if(i===s||o().graphEdges.find(g=>g.source===i&&g.target===s))return;if(U0(o().graphEdges,i,s)){o().showToast(J("edge.parentConflict"),!0);return}if(!o().graphNodes.find(g=>g.id===i))return;const y=[...o().graphEdges,{id:ao(i,s,u,d),source:i,target:s,sourceHandle:u,targetHandle:d}];l({graphNodes:Qa(o().graphNodes,y),graphEdges:y}),o().scheduleGraphSave()},setProvider:i=>{ot({provider:i}),l({provider:i})},setQuality:i=>{ot({quality:i}),l({quality:i})},setSizePreset:i=>{ot({sizePreset:i}),l({sizePreset:i})},setCustomSize:(i,s)=>l(u=>{const d=aa(i,u.customW),p=aa(s,u.customH);return ot({customW:d,customH:p}),{customW:d,customH:p}}),setFormat:i=>{ot({format:i}),l({format:i})},setModeration:i=>{ot({moderation:i}),l({moderation:i})},setImageModel:i=>{$p(i),l({imageModel:i})},setReasoningEffort:i=>{d1(i),l({reasoningEffort:i})},setWebSearchEnabled:i=>{m1(i),l({webSearchEnabled:i})},setCount:i=>{const s=_i(i);ot({count:s}),l({count:s})},setMultimode:i=>{if(i&&o().uiMode!=="classic")return;ot({multimode:i});const s=o();l({multimode:i,multimodeSequences:i?s.multimodeSequences:{},multimodePreviewFlightId:i?s.multimodePreviewFlightId:null})},setMultimodeMaxImages:i=>{const s=_i(i);ot({multimodeMaxImages:s}),l({multimodeMaxImages:s})},setPromptMode:i=>{ot({promptMode:i}),l({promptMode:i})},setPrompt:i=>{ot({prompt:i}),l({prompt:i})},insertPromptToComposer:i=>l(s=>{const u=s.insertedPrompts.some(m=>m.id===i.id),d={...i,placement:i.placement==="after"?"after":"before"},p=u?s.insertedPrompts:[...s.insertedPrompts,d];return ot({insertedPrompts:p}),{insertedPrompts:p}}),removeInsertedPromptFromComposer:i=>l(s=>{const u=s.insertedPrompts.filter(d=>d.id!==i);return ot({insertedPrompts:u}),{insertedPrompts:u}}),moveInsertedPromptInComposer:(i,s)=>l(u=>{const d=u.insertedPrompts.filter(N=>N.placement!=="after"),p=u.insertedPrompts.filter(N=>N.placement==="after"),m=[...d.map(N=>({kind:"prompt",prompt:N})),{kind:"main"},...p.map(N=>({kind:"prompt",prompt:N}))],y=m.findIndex(N=>N.kind==="prompt"&&N.prompt.id===i);if(y<0)return{};const g=s==="up"?y-1:y+1;if(g<0||g>=m.length)return{};const[x]=m.splice(y,1);m.splice(g,0,x);const b=m.findIndex(N=>N.kind==="main"),S=m.filter(N=>N.kind==="prompt").map((N,M)=>({...N.prompt,placement:M<b?"before":"after"}));return ot({insertedPrompts:S}),{insertedPrompts:S}}),clearInsertedPrompts:()=>{ot({insertedPrompts:[]}),l({insertedPrompts:[]})},selectHistory:i=>{const s=o().history,u=i.canvasVersion?Wt(s,i)??En(s)[0]??null:Wt(s,i)??i;ea(u?.filename??null);const d=u?h1(u):{};Object.keys(d).length>0&&ot(d),l({currentImage:u,unseenGeneratedCount:0,multimodePreviewFlightId:null,...d})},showHistorySequence:i=>{const s=o().history.filter(y=>y.sequenceId===i&&!y.canvasVersion).sort(Jh);if(s.length===0)return;const u=`history:${i}`,d=Math.max(s.length,...s.map(y=>y.sequenceTotalRequested??0)),p=s.length,m=s[0]?.sequenceStatus==="empty"?"empty":p>=d?"complete":"partial";ea(null),l(y=>({currentImage:null,unseenGeneratedCount:0,canvasOpen:!1,multimodePreviewFlightId:u,multimodeSequences:{...y.multimodeSequences,[u]:{sequenceId:i,requestId:u,requested:d,returned:p,images:s,partials:[],status:m}}}))},markGeneratedResultsSeen:()=>l({unseenGeneratedCount:0}),selectHistoryShortcutTarget:i=>{const s=n1(o().history,o().currentImage,i);s&&o().selectHistory(s)},trashHistoryItem:async i=>{const s=i.canvasVersion?Wt(o().history,i):i;if(!s||s.canvasVersion||!s.filename){o().showToast(J("gallery.deleteFailed"),!0);return}const u=s.filename,d=o().currentImage,m=(d?Wt(o().history,d)??d:null)?.filename===u,y=m?Vp(o().history,u):d;try{await Rp(u),l(g=>{const x=S1(g.multimodeSequences,u),b=g.multimodePreviewFlightId&&!x[g.multimodePreviewFlightId]?null:g.multimodePreviewFlightId;return{history:g.history.filter(S=>S.filename!==u),currentImage:y,multimodePreviewFlightId:b,multimodeSequences:x,trashPending:null}}),m&&ea(y?.filename??null),o().showToast(J("gallery.movedToSystemTrash",{filename:u}))}catch(g){console.error("[history] trash failed",g),o().showToast(J("gallery.deleteFailed"),!0)}},trashHistorySequence:async i=>{const s=o().history.filter(g=>g.sequenceId===i&&!g.canvasVersion&&!!g.filename);if(s.length===0){o().showToast(J("gallery.deleteFailed"),!0);return}if(!window.confirm(J("history.deleteSequenceConfirm",{count:s.length})))return;const d=new Set(s.map(g=>g.filename).filter(g=>!!g)),p=o().currentImage,m=!!(p?.filename&&d.has(p.filename)),y=o().multimodePreviewFlightId===`history:${i}`||o().multimodePreviewFlightId===i;try{for(const g of d)await Rp(g);l(g=>{const x={...g.multimodeSequences};return delete x[`history:${i}`],delete x[i],{history:g.history.filter(b=>!b.filename||!d.has(b.filename)),currentImage:m?null:g.currentImage,multimodePreviewFlightId:y?null:g.multimodePreviewFlightId,multimodeSequences:x,trashPending:null}}),m&&ea(null),o().showToast(J("history.sequenceDeleted",{count:d.size}))}catch(g){console.error("[history] sequence trash failed",g),o().showToast(J("gallery.deleteFailed"),!0)}},restorePendingTrash:async()=>{const i=o().trashPending;if(i)try{await Sb(i.filename,i.trashId),o().addHistoryItem(i.item),l({trashPending:null})}catch(s){console.error("[history] restore failed",s),o().showToast(J("gallery.restoreFailed"),!0)}},clearPendingTrash:()=>l({trashPending:null}),permanentlyDeleteHistoryItemByClick:async i=>{await o().permanentlyDeleteHistoryItemByShortcut(i)},permanentlyDeleteHistoryItemByShortcut:async i=>{const s=i.canvasVersion?Wt(o().history,i):i;if(!s||s.canvasVersion||!s.filename){o().showToast(J("gallery.deleteFailed"),!0);return}const u=s.filename;if(!window.confirm(J("result.permanentDeleteConfirm",{filename:u})))return;const p=o().currentImage,y=(p?Wt(o().history,p)??p:null)?.filename===u,g=y?Vp(o().history,u):p;try{await bb(u),l(x=>({history:x.history.filter(b=>b.filename!==u),currentImage:g,trashPending:x.trashPending?.filename===u?null:x.trashPending})),y&&ea(g?.filename??null),o().showToast(J("gallery.permanentDeleted",{filename:u}))}catch(x){console.error("[history] permanent delete failed",x),o().showToast(J("gallery.deleteFailed"),!0)}},removeFromHistory:i=>{const s=o(),u=s.history.filter(p=>p.filename!==i),d=s.currentImage&&s.currentImage.filename===i?null:s.currentImage;l({history:u,currentImage:d}),d===null&&ea(null)},addHistoryItem:i=>{const s=o(),u={...i,createdAt:i.createdAt||Date.now()},d=eg(s.history,u),p=tg(u,d),m=Wh(s.history,p);l({history:mo([p,...m],s.loadedHistoryRetainLimit+1),loadedHistoryRetainLimit:Math.max(s.loadedHistoryRetainLimit,Math.min(s.history.length+1,s.loadedHistoryRetainLimit+1))})},importLocalImageToHistory:async i=>{if(!i.type||!/^image\/(png|jpeg|webp)$/.test(i.type))return o().showToast(J("toast.localImportInvalid"),!0),null;try{const s=await zb(i);return o().addHistoryItem(s),l({currentImage:s,unseenGeneratedCount:0}),s.filename&&ea(s.filename),o().showToast(J("toast.localImportSuccess")),s}catch{return o().showToast(J("toast.localImportFailed"),!0),null}},getResolvedSize:()=>{const{sizePreset:i,customW:s,customH:u}=o();return i==="custom"?`${s}x${u}`:i},async generate(){const i=o();if(!Qc(i.prompt,i.insertedPrompts))return;const u=i.uiMode==="classic"&&i.multimode,d=no(i,{kind:u?"multimode":"classic"});if(d){l({customSizeConfirm:d});return}if(u){await o().generateMultimode();return}await o().runGenerate()},async generateMultimode(i){const s=o();if(s.uiMode!=="classic")return;const u=Qc(s.prompt,s.insertedPrompts);if(!u)return;const d=s.prompt,p=nu(s.insertedPrompts),m=i??s.getResolvedSize(),y=`mm_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,g=new AbortController,x=Date.now(),b=_i(s.multimodeMaxImages),S=[...s.inFlight,{id:y,prompt:u,startedAt:x,kind:"multimode",composerPrompt:d,composerInsertedPrompts:p}],N={sequenceId:y,requestId:y,requested:b,returned:0,images:[],partials:[],status:"pending"};$t(S),l({activeGenerations:s.activeGenerations+1,inFlight:S,multimodeAbortControllers:{...s.multimodeAbortControllers,[y]:g},multimodeSequences:{...s.multimodeSequences,[y]:N},multimodePreviewFlightId:y}),o().startInFlightPolling();try{const M=await pb({prompt:u,quality:s.quality,size:m,format:s.format,moderation:s.moderation,provider:s.provider,maxImages:b,model:s.imageModel,reasoningEffort:s.reasoningEffort,webSearchEnabled:s.webSearchEnabled,requestId:y,mode:s.promptMode,composerPrompt:d,composerInsertedPrompts:p,...s.referenceImages.length?{references:s.referenceImages.map(Jc)}:{}},{onPartial:Y=>{l(X=>{const Q=X.multimodeSequences[y];return Q?{multimodeSequences:{...X.multimodeSequences,[y]:{...Q,partials:[...Q.partials,{image:Y.image,index:Y.index??null}].slice(-b)}}}:{}})},onImage:Y=>{l(X=>{const Q=X.multimodeSequences[y];if(!Q)return{};const D=ih(Q.images,[Y]);return D.length===Q.images.length?{}:{multimodeSequences:{...X.multimodeSequences,[y]:{...Q,sequenceId:Y.sequenceId??Q.sequenceId,returned:D.length,images:D,status:"partial"}}}})}},{signal:g.signal}),z=M.images.map(Y=>({...Y,prompt:u,elapsed:Number.parseFloat(M.elapsed),provider:M.provider,usage:M.usage,requestId:Y.requestId??M.requestId??y,composerPrompt:d,composerInsertedPrompts:p,quality:M.quality??s.quality,size:M.size??m,model:M.model??s.imageModel}));for(const Y of z)await lo(Y,l,o);l(Y=>({multimodeSequences:{...Y.multimodeSequences,[y]:(()=>{const X=Y.multimodeSequences[y],Q=ih(X?.images??[],z);return{sequenceId:M.sequenceId,requestId:y,requested:M.requested,returned:Q.length,images:Q,partials:[],status:M.status,elapsed:M.elapsed}})()}}));const F=M.status==="complete"?"multimode.complete":"multimode.partial";o().showToast(J(F,{returned:M.returned,requested:M.requested,elapsed:M.elapsed}))}catch(M){M.name==="AbortError"||nh(M)?l(z=>{const F=z.multimodeSequences[y];return F?{multimodeSequences:{...z.multimodeSequences,[y]:{...F,status:"canceled"}}}:{}}):(l(z=>{const F=z.multimodeSequences[y];return F?{multimodeSequences:{...z.multimodeSequences,[y]:{...F,status:"error",error:M.message}}}:{}}),vi(M,o()))}finally{const M=o().inFlight.filter(z=>z.id!==y);$t(M),l(z=>{const F={...z.multimodeAbortControllers};delete F[y];let Y=z.multimodePreviewFlightId;if(Y===y){const X=z.multimodeSequences[y]?.status;if(!(X==="complete"||X==="partial")){const D=Object.keys(F);Y=D.length>0?D[D.length-1]:null}}return{activeGenerations:Math.max(0,z.activeGenerations-1),inFlight:M,multimodeAbortControllers:F,multimodePreviewFlightId:Y}})}},cancelMultimode:()=>{const i=o().multimodePreviewFlightId;i&&(o().multimodeAbortControllers[i]?.abort(),o().cancelInFlightJob(i),l(s=>{const u=s.multimodeSequences[i];return u?{multimodeSequences:{...s.multimodeSequences,[i]:{...u,status:"canceled"}}}:{}}))},async runGenerate(i){const s=o(),u=Qc(s.prompt,s.insertedPrompts);if(!u)return;const d=s.prompt,p=nu(s.insertedPrompts),m=i??s.getResolvedSize(),y=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,g=Date.now(),x=[...s.inFlight,{id:y,prompt:u,startedAt:g,composerPrompt:d,composerInsertedPrompts:p}];$t(x),l({activeGenerations:s.activeGenerations+1,inFlight:x}),o().startInFlightPolling();try{const b={prompt:u,quality:s.quality,size:m,format:s.format,moderation:s.moderation,provider:s.provider,n:s.count,model:s.imageModel,reasoningEffort:s.reasoningEffort,webSearchEnabled:s.webSearchEnabled,requestId:y,mode:s.promptMode,composerPrompt:d,composerInsertedPrompts:p,...s.referenceImages.length?{references:s.referenceImages.map(Jc)}:{}},S=await fb(b);if(Mp(S)&&S.images.length>1){for(const N of S.images){const M={image:N.image,filename:N.filename,prompt:u,composerPrompt:d,composerInsertedPrompts:p,elapsed:S.elapsed,provider:S.provider,usage:S.usage,requestId:S.requestId??y,quality:S.quality??s.quality,size:S.size??m,model:S.model??s.imageModel};await lo(M,l,o)}o().showToast(J("toast.generatedBatch",{count:S.images.length,elapsed:S.elapsed}))}else{let N;if(Mp(S)){const M=S.images[0];N={image:M.image,filename:M.filename,prompt:u,composerPrompt:d,composerInsertedPrompts:p,elapsed:S.elapsed,provider:S.provider,usage:S.usage,requestId:S.requestId??y,quality:S.quality??s.quality,size:S.size??m,model:S.model??s.imageModel}}else N={image:S.image,filename:S.filename,prompt:u,composerPrompt:d,composerInsertedPrompts:p,elapsed:S.elapsed,provider:S.provider,usage:S.usage,requestId:S.requestId??y,quality:S.quality??s.quality,size:S.size??m,model:S.model??s.imageModel};await lo(N,l,o),o().showToast(J("toast.generatedSingle",{elapsed:S.elapsed}))}}catch(b){nh(b)||vi(b,o())}finally{const b=o().inFlight.filter(S=>S.id!==y);$t(b),l({activeGenerations:Math.max(0,o().activeGenerations-1),inFlight:b})}},async confirmCustomSizeAdjustment(){const i=o().customSizeConfirm;if(!i)return;const s=x1(i.adjustedW,i.adjustedH);if(l({customW:i.adjustedW,customH:i.adjustedH,customSizeConfirm:null}),i.continuation.kind==="classic"){await o().runGenerate(s);return}if(i.continuation.kind==="multimode"){await o().generateMultimode(s);return}if(i.continuation.kind==="node-in-place"){await o().runGenerateNodeInPlace(i.continuation.clientId,{sizeOverride:s});return}if(i.continuation.kind==="node-variation"){await o().generateNodeVariation(i.continuation.clientId,s);return}await o().runGenerateNode(i.continuation.clientId,s)},cancelCustomSizeAdjustment:()=>l({customSizeConfirm:null}),hydrateHistory(){(async()=>{try{const i=await gl({limit:Yt}),s=i.items.map(bi);if(l({historyNextCursor:i.nextCursor,loadedHistoryRetainLimit:Yt}),s.length>0){const u=oh(),d=u?s.find(y=>y.filename===u):null,p=En(s),m=(d?Wt(s,d):null)??p[0]??null;l({history:s,currentImage:m,historyNextCursor:i.nextCursor,loadedHistoryRetainLimit:Math.max(Yt,s.length)}),m?.filename!==u&&ea(m?.filename??null)}}catch(i){console.warn("[history] load failed:",i)}})()},showToast(i,s=!1){const u=Date.now(),d={message:i,error:s,id:u+Math.random(),createdAt:u};l(p=>({toast:d,toastLog:[...p.toastLog,d]}))},dismissToast(i){l(s=>{const u=s.toastLog.filter(d=>d.id!==i);return{toastLog:u,toast:s.toast?.id===i?u[u.length-1]??null:s.toast}})},showErrorCard(i,s){const u=Date.now(),d={code:i,fallbackMessage:s?.fallbackMessage,id:u+Math.random(),createdAt:u};l(p=>({errorCard:d,errorCardLog:[...p.errorCardLog,d]}))},dismissErrorCard(i){l(s=>{if(i==null)return{errorCard:null,errorCardLog:[]};const u=s.errorCardLog.filter(d=>d.id!==i);return{errorCardLog:u,errorCard:s.errorCard?.id===i?u[u.length-1]??null:s.errorCard}})},setWorkspaceProfile(i){l({workspaceProfile:i});try{localStorage.setItem("ima2.workspaceProfile",i)}catch{}},togglePromptBuilder(){l(i=>({promptBuilderOpen:!i.promptBuilderOpen}))},setPromptLibraryOpen(i){l({promptLibraryOpen:i})},togglePromptLibrary(){l(i=>({promptLibraryOpen:!i.promptLibraryOpen}))},async loadPromptLibrary(){l({promptLibraryLoading:!0});try{const i=await Ab();l({promptLibrary:{prompts:i.prompts,folders:i.folders},promptLibraryLoading:!1})}catch(i){console.error("[PromptLibrary] load failed",i),l({promptLibraryLoading:!1})}},async savePromptToLibrary(i){try{await Mb(i),await o().loadPromptLibrary(),o().showToast(J("promptLibrary.saved"))}catch(s){console.error("[PromptLibrary] save failed",s),o().showToast(J("promptLibrary.saveFailed"),!0)}},async deletePromptFromLibrary(i){try{await Rb(i),await o().loadPromptLibrary()}catch(s){console.error("[PromptLibrary] delete failed",s)}},async togglePromptFavorite(i){try{await Ob(i),await o().loadPromptLibrary()}catch(s){console.error("[PromptLibrary] favorite toggle failed",s)}},async importPromptsToLibrary(i){try{const s=[];for(const d of i){if(!/\.(txt|md|markdown)$/i.test(d.name))continue;const p=await d.text();if(!p.trim())continue;const m=d.name.replace(/\.(txt|md|markdown)$/i,"");s.push({name:m.trim()||J("promptLibrary.untitled"),text:p.trim(),tags:[]})}if(s.length===0){o().showToast(J("promptLibrary.importNoValidFiles"),!0);return}const u=await jb({prompts:s});await o().loadPromptLibrary(),o().showToast(J("promptLibrary.imported",{count:u.promptsImported}))}catch(s){console.error("[PromptLibrary] import failed",s),o().showToast(J("promptLibrary.importFailed"),!0)}},async toggleGalleryFavorite(i){try{const s=await gb(i);l(u=>{const d=new Set(u.galleryFavorites);return s.isFavorite?d.add(i):d.delete(i),{galleryFavorites:d}}),l(u=>({history:u.history.map(d=>d.filename===i?{...d,isFavorite:s.isFavorite}:d)}))}catch(s){console.error("[GalleryFavorite] toggle failed",s)}},openCanvas:()=>l({canvasOpen:!0,canvasZoom:1,canvasPanX:0,canvasPanY:0}),closeCanvas:()=>l({canvasOpen:!1}),setCanvasZoom:i=>l({canvasZoom:Math.max(.5,Math.min(3,i))}),resetCanvasZoom:()=>l({canvasZoom:1,canvasPanX:0,canvasPanY:0}),setCanvasPan:(i,s)=>{l({canvasPanX:Math.max(-4e3,Math.min(4e3,i)),canvasPanY:Math.max(-4e3,Math.min(4e3,s))})},resetCanvasPan:()=>l({canvasPanX:0,canvasPanY:0}),setCanvasExportBackground:i=>{l({canvasExportBackground:i}),Zp(i,o().canvasExportMatteColor)},setCanvasExportMatteColor:i=>{l({canvasExportMatteColor:i}),Zp(o().canvasExportBackground,i)}})),w1=800;let ta=null,po=!1,ho=!1,bn=null,rg=0;function cg(){try{const l=sessionStorage.getItem(Up);if(l)return l;const o=`tab_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`;return sessionStorage.setItem(Up,o),o}catch{return"tab_unavailable"}}function ug(l){const o={...l};return delete o.referenceImages,delete o.partialImageUrl,l.status==="pending"||l.status==="reconciling"?{...o,status:"empty",pendingRequestId:null,recoveryRequestId:l.pendingRequestId??l.recoveryRequestId??null,pendingPhase:null,pendingStartedAt:null,error:void 0}:o}function dg(l){return l.map(o=>({id:o.id,source:o.source,target:o.target,data:{sourceHandle:o.sourceHandle??null,targetHandle:o.targetHandle??null}}))}async function fg(l,o){const i=l().activeSessionId;if(!i||l().graphNodes.filter(m=>!m.data.imageUrl&&!m.data.serverNodeId).length===0)return;let u=[];try{u=(await gl({sessionId:i,limit:Yt})).items}catch{return}let d=!1;const p=l().graphNodes.map(m=>{if(m.data.imageUrl||m.data.serverNodeId)return m;const y=m.data.pendingStartedAt??0,g=m.data.pendingRequestId??m.data.recoveryRequestId??null,b=(g?u.find(S=>(S.sessionId??null)===i&&(S.requestId??null)===g):null)??u.find(S=>(S.sessionId??null)===i&&(S.clientNodeId??null)===m.id&&(!y||(S.createdAt??0)>=y));return b?(d=!0,{...m,data:{...m.data,status:"ready",imageUrl:b.url,serverNodeId:b.nodeId??m.data.serverNodeId,size:b.size??m.data.size??null,pendingRequestId:null,recoveryRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,error:void 0}}):m});d&&(o({graphNodes:p}),pg(l,o,"recovery"))}async function A1(l,o){const i=l().activeSessionId;if(!i)return;const{session:s}=await Mh(i),{graphNodes:u,graphEdges:d,graphVersion:p}=ag(s);o({graphNodes:u,graphEdges:d,activeSessionGraphVersion:p}),l().showToast(J("toast.sessionReloadedElsewhere"),!0),await fg(l,o).catch(()=>{})}async function M1(l,o,i){const s=l().activeSessionId,u=l().activeSessionGraphVersion;if(!s||u==null)return"skipped";const{graphNodes:d,graphEdges:p}=l(),m=d.map(x=>({id:x.id,x:x.position.x,y:x.position.y,data:ug(x.data)})),y=dg(p),g=`gs_${Date.now().toString(36)}_${++rg}`;try{const x=await wb(s,u,m,y,{saveId:g,saveReason:i,tabId:cg()});return l().activeSessionId!==s?"skipped":(Y0(s,l().graphNodes.map(b=>b.id)),o({activeSessionGraphVersion:x.graphVersion}),"saved")}catch(x){return x.status===409?(await A1(l,o),"conflict"):(console.warn("[sessions] save failed:",x),"failed")}}async function mg(l,o,i){if(po){ho=!0,bn&&await bn;return}po=!0,bn=(async()=>{let s=i;do{ho=!1;const u=await M1(l,o,s);if(u==="conflict"||u==="failed")break;s="queued"}while(ho)})().finally(()=>{po=!1,bn=null}),await bn}function pg(l,o,i="debounced"){const s=l();s.activeSessionId&&(s.sessionLoading||(ta&&clearTimeout(ta),ta=setTimeout(()=>{ta=null,mg(l,o,i)},w1)))}async function R1(l,o,i="manual"){let s=!1;if(ta&&(clearTimeout(ta),ta=null,s=!0),po){ho=!0,bn&&await bn;return}s&&await mg(l,o,i)}function O1(l){const o=l();if(!o.activeSessionId||o.activeSessionGraphVersion==null)return;ta&&(clearTimeout(ta),ta=null);const i=o.graphNodes.map(p=>({id:p.id,x:p.position.x,y:p.position.y,data:ug(p.data)})),s=dg(o.graphEdges),u=`/api/sessions/${encodeURIComponent(o.activeSessionId)}/graph`,d=JSON.stringify({nodes:i,edges:s});try{fetch(u,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(o.activeSessionGraphVersion),"X-Ima2-Graph-Save-Id":`gs_${Date.now().toString(36)}_${++rg}`,"X-Ima2-Graph-Save-Reason":"beforeunload","X-Ima2-Tab-Id":cg()},body:d,keepalive:!0})}catch{}}async function lo(l,o,i){const s=await Db(l.image).catch(()=>l.image),u=l.filename?`/generated/${l.filename}`:l.image,d={...l,thumb:s,url:u,createdAt:l.createdAt||Date.now()},p=i(),m=eg(p.history,d),y=tg(d,m),g=Wh(p.history,y),x=mo([y,...g],p.loadedHistoryRetainLimit+1);ea(y.filename??null),o({history:x,currentImage:y,loadedHistoryRetainLimit:Math.max(p.loadedHistoryRetainLimit,Math.min(p.history.length+1,p.loadedHistoryRetainLimit+1)),unseenGeneratedCount:i().unseenGeneratedCount+1})}function j1(l){for(const o of l.history)if(o.sessionId)return o.sessionId;return null}function z1(){const{t:l}=be(),o=C(s=>s.uiMode),i=C(s=>s.setUIMode);return f.jsxs("div",{className:"ui-mode-switch",role:"tablist","aria-label":l("uiMode.ariaLabel"),children:[f.jsx("button",{type:"button",role:"tab","aria-selected":o==="classic",className:`ui-mode-switch__tab${o==="classic"?" active":""}`,onClick:()=>i("classic"),children:l("uiMode.classic")}),f.jsx("button",{type:"button",role:"tab","aria-selected":o==="node",className:`ui-mode-switch__tab${o==="node"?" active":""}`,onClick:()=>i("node"),children:l("uiMode.node")}),null,f.jsx("button",{type:"button",role:"tab","aria-selected":o==="agent",className:`ui-mode-switch__tab${o==="agent"?" active":""}`,onClick:()=>i("agent"),children:l("uiMode.agent")})]})}function I1({text:l,mode:o,onClose:i}){const{t:s}=be(),u=C(M=>M.savePromptToLibrary),[d,p]=q.useState(l.slice(0,30)),[m,y]=q.useState(l),[g,x]=q.useState(""),[b,S]=q.useState(!1),N=async()=>{m.trim()&&(S(!0),await u({name:d.trim()||m.slice(0,30),text:m.trim(),tags:g.split(",").map(M=>M.trim()).filter(Boolean),mode:o||void 0}),S(!1),i())};return f.jsxs("div",{className:"save-prompt-popover",onClick:M=>M.stopPropagation(),children:[f.jsxs("div",{className:"save-prompt-popover__header",children:[f.jsx("span",{children:s("promptLibrary.saveTitle")}),f.jsx("button",{className:"save-prompt-popover__close",onClick:i,"aria-label":s("common.close"),children:"×"})]}),f.jsxs("div",{className:"save-prompt-popover__body",children:[f.jsxs("label",{children:[s("promptLibrary.name"),f.jsx("input",{type:"text",value:d,onChange:M=>p(M.target.value),placeholder:m.slice(0,30)})]}),f.jsxs("label",{children:[s("promptLibrary.content"),f.jsx("textarea",{value:m,onChange:M=>y(M.target.value),placeholder:"Enter prompt...",rows:4,autoFocus:!0})]}),f.jsxs("label",{children:[s("promptLibrary.tags"),f.jsx("input",{type:"text",value:g,onChange:M=>x(M.target.value),placeholder:"cta, product, summer"})]})]}),f.jsx("div",{className:"save-prompt-popover__footer",children:f.jsx("button",{onClick:N,disabled:b||!m.trim(),className:"save-prompt-popover__save",children:s(b?"common.saving":"promptLibrary.save")})})]})}function D1({variant:l="label"}){const{t:o}=be(),i=C(d=>d.webSearchEnabled),s=C(d=>d.setWebSearchEnabled),u=o(i?"settings.webSearch.on":"settings.webSearch.off");return f.jsx("button",{type:"button",className:`web-search-toggle web-search-toggle--${l}${i?" is-active":""}`,onClick:()=>s(!i),"aria-pressed":i,"aria-label":u,title:u,children:l==="compact"?f.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:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("path",{d:"M2 12h20"}),f.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 0 20"}),f.jsx("path",{d:"M12 2a15.3 15.3 0 0 0 0 20"})]}):f.jsx("span",{children:u})})}const pl=5;function du({variant:l="sidebar"}){const o=C(T=>T.prompt),i=C(T=>T.setPrompt),s=C(T=>T.insertedPrompts),u=C(T=>T.removeInsertedPromptFromComposer),d=C(T=>T.moveInsertedPromptInComposer),p=C(T=>T.generate),{t:m}=be(),y=C(T=>T.referenceImages),g=C(T=>T.addReferences),x=C(T=>T.readDroppedImageMetadata),b=C(T=>T.removeReference),S=C(T=>T.useCurrentAsReference),N=C(T=>T.currentImage),M=q.useRef(null),z=q.useRef(null),[F,Y]=q.useState(!1),[X,Q]=q.useState(!1),D=C(T=>T.promptMode),te=C(T=>T.setPromptMode),U=C(T=>T.multimode),$=C(T=>T.multimodeMaxImages),Ce=D==="direct",ae=s.filter(T=>T.placement!=="after"),we=s.filter(T=>T.placement==="after"),ke=[...ae.map(T=>T.id),"__main_prompt__",...we.map(T=>T.id)],Ie=y.length<pl,ct=U?y.length>0?m("multimode.promptPlaceholderWithRefs"):m("multimode.promptPlaceholder"):y.length>0?m("prompt.placeholderWithRefs"):m("prompt.placeholder"),Fe=async T=>{T.length!==0&&(T.length===1&&await x(T[0])||await g(T))},K=T=>{T.preventDefault(),Y(!1);const B=Array.from(T.dataTransfer.files).filter(Z=>Z.type.startsWith("image/"));B.length>0&&Fe(B)},A=T=>{T.preventDefault(),F||Y(!0)},V=T=>{T.currentTarget.contains(T.relatedTarget)||Y(!1)},ne=T=>{if(!T)return[];const B=[];for(const Z of Array.from(T)){if(Z.kind!=="file"||!Z.type.startsWith("image/"))continue;const ie=Z.getAsFile();ie&&B.push(ie)}return B},xe=T=>{if(!Ie)return;const B=ne(T.clipboardData?.items??null);if(B.length===0)return;T.preventDefault();const Z=pl-y.length;g(B.slice(0,Z))};q.useLayoutEffect(()=>{const T=z.current;T&&(T.style.height="auto",T.style.height=`${T.scrollHeight}px`)},[o]),q.useEffect(()=>{const T=B=>{const Z=B.target,ie=Z?.tagName;if(ie==="INPUT"||ie==="TEXTAREA"||Z?.isContentEditable)return;const oe=ne(B.clipboardData?.items??null);if(oe.length===0||y.length>=pl)return;B.preventDefault();const ge=pl-y.length;g(oe.slice(0,ge))};return window.addEventListener("paste",T),()=>window.removeEventListener("paste",T)},[y.length,g]);const Ne=(T,B)=>{const Z=ke.indexOf(T);return Z<0?!1:B==="up"?Z>0:Z<ke.length-1},w=T=>f.jsxs("div",{className:"composer__prompt-chip",title:T.name,children:[f.jsx("span",{className:"composer__prompt-chip-plus","aria-hidden":"true",children:"+"}),f.jsx("span",{className:"composer__prompt-chip-title",children:T.name}),f.jsxs("div",{className:"composer__prompt-chip-actions",children:[f.jsx("button",{type:"button",className:"composer__prompt-chip-move",onClick:()=>d(T.id,"up"),disabled:!Ne(T.id,"up"),"aria-label":m("prompt.moveBlockUp",{name:T.name}),title:m("prompt.moveBlockUp",{name:T.name}),children:"^"}),f.jsx("button",{type:"button",className:"composer__prompt-chip-move",onClick:()=>d(T.id,"down"),disabled:!Ne(T.id,"down"),"aria-label":m("prompt.moveBlockDown",{name:T.name}),title:m("prompt.moveBlockDown",{name:T.name}),children:"v"}),f.jsx("button",{type:"button",className:"composer__prompt-chip-remove",onClick:()=>u(T.id),"aria-label":m("promptLibrary.removeInserted",{name:T.name}),children:"x"})]})]},T.id);return f.jsxs("div",{className:`composer composer--${l}${F?" composer--drag":""}${Ce&&!U?" composer--direct":""}${U?" composer--multimode":""}`,role:"group","aria-label":U?m("multimode.composerAriaLabel",{count:$}):m("prompt.label"),onDrop:K,onDragOver:A,onDragLeave:V,onPaste:xe,children:[f.jsxs("div",{className:"composer__header",children:[f.jsx("span",{className:"section-title composer__label",children:m("prompt.label")}),f.jsxs("div",{className:"composer__header-meta",children:[U&&f.jsx("span",{className:"composer__mode-badge",children:m("multimode.composerBadge",{count:$})}),Ce&&f.jsx("span",{className:"composer__direct-badge",children:m("prompt.directModeActive")}),y.length>0&&f.jsx("span",{className:"composer__count",children:m("prompt.refCount",{count:y.length,max:pl})})]})]}),y.length>0&&f.jsx("div",{className:"composer__chips",children:y.map((T,B)=>f.jsxs("div",{className:"composer__chip",title:m("prompt.refChipTitle",{n:B+1}),children:[f.jsx("img",{src:T,alt:m("prompt.refChipAlt",{n:B+1})}),f.jsx("button",{type:"button",className:"composer__chip-remove",onClick:()=>b(B),"aria-label":m("prompt.refRemoveAria",{n:B+1}),children:"×"})]},B))}),ae.length>0&&f.jsx("div",{className:"composer__prompt-chips",children:ae.map(w)}),f.jsx("textarea",{ref:z,className:"prompt-area composer__textarea",value:o,placeholder:ct,onChange:T=>i(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),p())}}),we.length>0&&f.jsxs("div",{className:"composer__prompt-chips composer__prompt-chips--after",children:[f.jsx("span",{className:"composer__prompt-chips-label",children:m("prompt.afterBlocks")}),we.map(w)]}),f.jsxs("div",{className:"composer__toolbar",children:[f.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>Ie&&M.current?.click(),disabled:!Ie,title:m("prompt.attachTitle"),"aria-label":m("prompt.attachTitle"),children:[f.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:f.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"})}),f.jsx("span",{children:m("prompt.attach")})]}),f.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>{S()},disabled:!N||!Ie,title:m("prompt.useCurrentTitle"),children:[f.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:[f.jsx("polyline",{points:"23 4 23 10 17 10"}),f.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),f.jsx("span",{children:m("prompt.useCurrent")})]}),f.jsxs("button",{type:"button",className:`composer__tool${Ce?" composer__tool--on":""}`,onClick:()=>te(Ce?"auto":"direct"),title:m("prompt.directModeTitle"),"aria-label":m("prompt.directModeTitle"),"aria-pressed":Ce,children:[f.jsx("span",{"aria-hidden":"true",style:{fontWeight:700,fontSize:11},children:"1:1"}),f.jsx("span",{children:m("prompt.directMode")})]}),f.jsx(D1,{variant:"compact"}),f.jsxs("div",{style:{position:"relative"},children:[f.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>Q(T=>!T),disabled:!o.trim(),title:m("promptLibrary.saveTitle"),"aria-label":m("promptLibrary.saveTitle"),children:[f.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:f.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})}),f.jsx("span",{children:m("promptLibrary.save")})]}),X&&f.jsx(I1,{text:o,mode:D,onClose:()=>Q(!1)})]}),f.jsx("span",{className:"composer__hint",children:m("prompt.hint")})]}),F&&f.jsx("div",{className:"composer__dropzone","aria-hidden":"true",children:m("prompt.dropHere",{max:pl})}),f.jsx("input",{ref:M,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:T=>{const B=Array.from(T.target.files??[]);B.length>0&&Fe(B),T.target.value=""}})]})}function fu(){const l=C(p=>p.activeGenerations),o=C(p=>p.generate),i=C(p=>p.openReadinessPopup),{t:s}=be(),u=l>0,d=u?s("generate.buttonLoading",{n:l}):s("generate.button");return f.jsxs("div",{className:"generate-row",children:[f.jsx("button",{type:"button",className:`generate-btn${u?" loading":""}`,onClick:()=>{o()},children:d}),f.jsx("button",{type:"button",className:"generate-row__readiness",onClick:i,title:s("readiness.openTitle"),"aria-label":s("readiness.openTitle"),children:"?"})]})}function L1(l,o=28){const i=l.trim().replace(/\s+/g," ");return i.length>o?`${i.slice(0,o)}...`:i}function go(){const l=C(u=>u.inFlight),o=C(u=>u.cancelInFlightJob),{t:i}=be(),s={queued:i("inflight.queued"),streaming:i("inflight.streaming"),decoding:i("inflight.decoding"),canceling:i("inflight.canceling")};return l.length===0?null:f.jsx("ul",{className:"in-flight-list",children:l.map(u=>{const d=u.phase?s[u.phase]??u.phase:i("inflight.queued"),m=u.prompt.trim().replace(/\s+/g," ")||i("inflight.noPrompt");return f.jsxs("li",{className:"in-flight-item","data-phase":u.phase??"queued",title:m,"aria-label":`${d}: ${m}`,children:[f.jsx("span",{className:"in-flight-prompt",children:L1(u.prompt)}),f.jsx("span",{className:"in-flight-phase",children:d}),f.jsx("button",{type:"button",className:"in-flight-cancel",onClick:()=>{o(u.id)},disabled:u.phase==="canceling","aria-label":i("inflight.cancelAria",{prompt:m}),title:i("common.cancel"),children:"×"}),f.jsx("span",{className:"in-flight-spinner","aria-hidden":"true"})]},u.id)})})}function q1(){const{t:l}=be(),o=C(S=>S.sessions),i=C(S=>S.activeSessionId),s=C(S=>S.switchSession),u=C(S=>S.createAndSwitchSession),d=C(S=>S.renameCurrentSession),p=C(S=>S.deleteSessionById),[m,y]=q.useState(!1),g=o.find(S=>S.id===i),x=()=>{const S=window.prompt(l("session.renamePrompt"),g?.title??l("session.newSession"));S&&S.trim()&&d(S.trim())},b=(S,N)=>{window.confirm(l("session.deleteConfirm",{title:N}))&&p(S)};return f.jsxs("div",{className:"session-picker",children:[f.jsxs("div",{className:"session-picker-row",children:[f.jsxs("button",{type:"button",className:"session-current",onClick:()=>y(S=>!S),title:l("session.switchTitle"),children:[f.jsx("span",{className:"session-title",children:g?.title??l("session.loading")}),f.jsx("span",{className:"session-caret",children:m?"▴":"▾"})]}),f.jsx("button",{type:"button",className:"session-btn",onClick:()=>{u(l("session.newSession"))},title:l("session.newSessionTitle"),children:"+"}),f.jsx("button",{type:"button",className:"session-btn",onClick:x,title:l("session.renameTitle"),disabled:!g,children:"✎"})]}),m&&f.jsxs("ul",{className:"session-list",children:[o.map(S=>f.jsxs("li",{className:S.id===i?"is-active":"",children:[f.jsxs("button",{type:"button",className:"session-item",onClick:()=>{y(!1),s(S.id)},children:[f.jsx("span",{className:"session-item-title",children:S.title}),f.jsx("span",{className:"session-item-count",children:S.nodeCount})]}),f.jsx("button",{type:"button",className:"session-del",onClick:()=>b(S.id,S.title),title:l("session.deleteTitle"),children:"×"})]},S.id)),o.length===0&&f.jsx("li",{className:"session-empty",children:l("session.empty")})]})]})}function H1(){const{t:l}=be(),o=C(s=>s.settingsOpen),i=C(s=>s.toggleSettings);return f.jsx("button",{type:"button",className:`settings-button${o?" is-active":""}`,onClick:i,"aria-label":l("settings.openAria"),"aria-pressed":o,title:l("settings.openTitle"),children:f.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M12 8.2a3.8 3.8 0 1 0 0 7.6 3.8 3.8 0 0 0 0-7.6Zm0 5.7a1.9 1.9 0 1 1 0-3.8 1.9 1.9 0 0 1 0 3.8Z"}),f.jsx("path",{d:"m20.3 13.4.1-1.4-.1-1.4-2.2-.5a6.9 6.9 0 0 0-.6-1.3l1.2-1.9a9.6 9.6 0 0 0-2-2l-1.9 1.2c-.4-.2-.9-.4-1.3-.6L13 3.3a9.5 9.5 0 0 0-2.8 0l-.5 2.2c-.5.2-.9.3-1.3.6L6.5 4.9a9.6 9.6 0 0 0-2 2l1.2 1.9c-.2.4-.4.9-.6 1.3l-2.2.5a9.5 9.5 0 0 0 0 2.8l2.2.5c.2.5.3.9.6 1.3l-1.2 1.9a9.6 9.6 0 0 0 2 2l1.9-1.2c.4.2.9.4 1.3.6l.5 2.2a9.5 9.5 0 0 0 2.8 0l.5-2.2c.5-.2.9-.3 1.3-.6l1.9 1.2a9.6 9.6 0 0 0 2-2l-1.2-1.9c.2-.4.4-.9.6-1.3l2.2-.5Z"})]})})}function hg({variant:l}){const{t:o}=be(),[i,s]=q.useState(!1),u=q.useRef(null),d=C(x=>x.imageModel),p=C(x=>x.setImageModel),m=l==="settings"?"settings-image-model":"sidebar-image-model",y=vl.find(x=>x.value===d)??vl[0],g=x=>{p(x.target.value)};return q.useEffect(()=>{if(l!=="sidebar"||!i)return;const x=S=>{const N=S.target;N instanceof Node&&(u.current?.contains(N)||s(!1))},b=S=>{S.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",x),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",b)}},[i,l]),l==="sidebar"?f.jsxs("div",{ref:u,className:"image-model-select image-model-select--sidebar",children:[f.jsx("button",{id:m,type:"button",className:"image-model-select__trigger","aria-haspopup":"listbox","aria-expanded":i,"aria-label":o("sidebar.imageModelAria"),onClick:()=>s(x=>!x),children:y.shortLabel}),i?f.jsx("div",{className:"image-model-select__menu",role:"listbox","aria-label":o("sidebar.imageModelAria"),children:vl.map(x=>f.jsxs("button",{type:"button",className:`image-model-select__item${x.value===d?" is-active":""}`,role:"option","aria-selected":x.value===d,onClick:()=>{p(x.value),s(!1)},children:[f.jsx("span",{children:x.shortLabel}),f.jsx("small",{children:o(x.fullLabelKey)})]},x.value))}):null]}):f.jsx("div",{className:"image-model-select image-model-select--settings",children:f.jsxs("select",{id:m,value:d,onChange:g,children:[vl.map(x=>f.jsx("option",{value:x.value,children:o(x.fullLabelKey)},x.value)),I0.map(x=>f.jsx("option",{value:x.value,disabled:!0,children:o(x.fullLabelKey)},x.value))]})})}function gg(l){return{...l,textFields:Array.isArray(l.textFields)?l.textFields:[]}}function Ci(l){return{...l,cards:Array.isArray(l.cards)?l.cards.map(gg):[]}}async function _n(l,o){const i=await fetch(l,o),s=await i.json().catch(()=>({}));if(!i.ok){const u=s,d=typeof u.error=="string"?u.error:u.error?.message||`Request failed: ${i.status}`,p=new Error(d);throw typeof u.error!="string"&&(p.code=u.error?.code),p}return s}function k1(){return _n("/api/cardnews/image-templates")}function G1(){return _n("/api/cardnews/role-templates")}async function U1(l){const o=await _n("/api/cardnews/draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return{...o,plan:Ci(o.plan)}}function B1(l){return _n("/api/cardnews/jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}function P1(l){return _n(`/api/cardnews/jobs/${encodeURIComponent(l)}`)}async function F1(l){const i=(await _n(`/api/cardnews/cards/${encodeURIComponent(l.card.id)}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...l,cards:[l.card]})})).cards.find(s=>s.id===l.card.id);if(!i)throw new Error("Regenerated card not found");return{card:i}}function ch(l){return _n(`/api/cardnews/sets/${encodeURIComponent(l)}`).then(o=>({...o,plan:Ci(o.plan)}))}function Y1(l){return`/api/cardnews/sets/${encodeURIComponent(l)}/manifest?download=1`}function V1(l){return l[0]?.id||"academy-lesson-square"}function X1(l){return l.find(o=>o.id==="mid-5")?.id||l[0]?.id||"mid-5"}function K1(l){return Math.round(l/16)*16}function bo(l){return Math.min(ru,Math.max(1024,K1(l)))}function uh(l){return l.outputSizePreset!=="custom"?l.outputSizePreset:`${bo(l.customW)}x${bo(l.customH)}`}function yg(l){if(l){if(typeof l=="string")return l;if(typeof l=="object"&&"message"in l){const o=l.message;return typeof o=="string"?o:void 0}return String(l)}}function Q1(l,o){const i=o.status||"generated";return{...l,...o,textFields:Array.isArray(o.textFields)?o.textFields:l.textFields,status:i,error:i==="error"?yg(o.error)||J("cardNews.error"):void 0}}function Z1(l){return new Promise(o=>setTimeout(o,l))}function $c(l,o){const i=new Map(o.cards.map(s=>[s.id,s]));return{...l,cards:l.cards.map(s=>{const u=i.get(s.id);return u?{...s,...u,textFields:Array.isArray(u.textFields)?u.textFields:s.textFields,status:u.status||s.status,error:yg(u.error)}:s})}}const et=Ch((l,o)=>({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(!(o().loading||o().templates.length>0)){l({loading:!0,error:null});try{const[i,s]=await Promise.all([k1(),G1()]);l({templates:i.templates,roleTemplates:s.templates,imageTemplateId:V1(i.templates),roleTemplateId:X1(s.templates),loading:!1})}catch(i){l({loading:!1,error:i instanceof Error?i.message:String(i)})}}},setBriefField(i,s){l({[i]:s})},setImageTemplate(i){l({imageTemplateId:i})},setRoleTemplate(i){l({roleTemplateId:i})},setOutputSizePreset(i){l({outputSizePreset:i})},setCustomSize(i,s){l({customW:bo(i),customH:bo(s)})},async draft(){const i=o();l({loading:!0,error:null,draftError:null});try{const{plan:s,planner:u}=await U1({topic:i.topic,audience:i.audience,goal:i.goal,contentBrief:i.contentBrief,imageTemplateId:i.imageTemplateId,roleTemplateId:i.roleTemplateId,size:uh(i)});l({activePlan:Ci(s),selectedCardId:s.cards[0]?.id||null,selectedTextFieldId:null,plannerMeta:u||null,loading:!1})}catch(s){const u=s instanceof Error?s.message:String(s);l({loading:!1,draftError:u,error:u})}},updateCard(i,s){l(u=>({activePlan:u.activePlan?{...u.activePlan,cards:u.activePlan.cards.map(d=>d.id===i?{...d,...s}:d)}:null}))},updateTextField(i,s,u){l(d=>({activePlan:d.activePlan?{...d.activePlan,cards:d.activePlan.cards.map(p=>p.id!==i||p.locked?p:{...p,textFields:p.textFields.map(m=>m.id===s?{...m,...u,source:u.source||"user"}:m)})}:null}))},addTextField(i,s){l(u=>({activePlan:u.activePlan?{...u.activePlan,cards:u.activePlan.cards.map(d=>d.id===i&&!d.locked?{...d,textFields:[...d.textFields,{...s,source:"user"}]}:d)}:null,selectedTextFieldId:s.id}))},removeTextField(i,s){l(u=>({activePlan:u.activePlan?{...u.activePlan,cards:u.activePlan.cards.map(d=>d.id===i&&!d.locked?{...d,textFields:d.textFields.filter(p=>p.id!==s)}:d)}:null,selectedTextFieldId:u.selectedTextFieldId===s?null:u.selectedTextFieldId}))},selectCard(i){l({selectedCardId:i,selectedTextFieldId:null})},selectTextField(i){l({selectedTextFieldId:i})},getGenerationSummary(){const i=o().activePlan?.cards||[];return{total:i.length,done:i.filter(s=>s.status==="generated").length,queued:i.filter(s=>s.status==="queued").length,generating:i.filter(s=>s.status==="generating").length,errors:i.filter(s=>s.status==="error").length,skipped:i.filter(s=>s.locked||s.status==="skipped").length}},async generateSet(){const i=o();if(!i.activePlan)return;const s=C.getState();l({generating:!0,error:null,activePlan:{...i.activePlan,cards:i.activePlan.cards.map(u=>u.locked?{...u,status:"skipped"}:{...u,status:"queued",error:void 0})}});try{const u=o().activePlan||i.activePlan;let p=await B1({...u,size:uh(i),quality:s.quality,moderation:s.moderation,model:s.imageModel,sessionId:s.activeSessionId});for(l(y=>({activePlan:y.activePlan?$c(y.activePlan,p):y.activePlan}));["queued","running"].includes(p.status);)await Z1(900),p=await P1(p.jobId),l(y=>({activePlan:y.activePlan?$c(y.activePlan,p):y.activePlan}));const m=await ch(p.setId).catch(()=>null);l(y=>({generating:!1,activePlan:m?.plan?Ci(m.plan):y.activePlan?$c(y.activePlan,p):y.activePlan,selectedTextFieldId:null})),s.showToast(J("cardNews.generated",{count:p.generated}))}catch(u){const d=u instanceof Error?u.message:String(u);l(p=>({generating:!1,error:d,activePlan:p.activePlan?{...p.activePlan,cards:p.activePlan.cards.map(m=>m.status==="queued"||m.status==="generating"?{...m,status:"error",error:d}:m)}:p.activePlan}))}},async retryCard(i){const u=o().activePlan,d=u?.cards.find(m=>m.id===i);if(!u||!d||d.locked||!["draft","error"].includes(d.status))return;const p=C.getState();l({error:null,activePlan:{...u,cards:u.cards.map(m=>m.id===i?{...m,status:"generating",error:void 0}:m)}});try{const{card:m}=await F1({setId:u.setId,card:d,quality:p.quality,moderation:p.moderation,model:p.imageModel});l(y=>({activePlan:y.activePlan?{...y.activePlan,cards:y.activePlan.cards.map(g=>g.id===i?Q1(g,gg(m)):g)}:y.activePlan}))}catch(m){const y=m instanceof Error?m.message:String(m);l(g=>({error:y,activePlan:g.activePlan?{...g.activePlan,cards:g.activePlan.cards.map(x=>x.id===i?{...x,status:"error",error:y}:x)}:g.activePlan}))}},async loadSet(i){l({loading:!0,error:null,selectedTextFieldId:null});try{const{plan:s}=await ch(i);l({activePlan:Ci(s),selectedCardId:s.cards[0]?.id||null,selectedTextFieldId:null,loading:!1})}catch(s){l({loading:!1,error:s instanceof Error?s.message:String(s)})}}}));function J1(){const{t:l}=be(),o=et(D=>D.hydrate),i=et(D=>D.topic),s=et(D=>D.audience),u=et(D=>D.goal),d=et(D=>D.contentBrief),p=et(D=>D.outputSizePreset),m=et(D=>D.customW),y=et(D=>D.customH),g=et(D=>D.setBriefField),x=et(D=>D.setOutputSizePreset),b=et(D=>D.setCustomSize),S=et(D=>D.draft),N=et(D=>D.loading),M=et(D=>D.generating),z=et(D=>D.draftError),F=et(D=>D.generateSet),Y=et(D=>D.activePlan),X=Y?.cards||[],Q={total:X.length,done:X.filter(D=>D.status==="generated").length};return q.useEffect(()=>{o()},[o]),f.jsxs("section",{className:"card-news-composer","aria-label":l("cardNews.composer"),children:[f.jsx("div",{className:"card-news-composer__head",children:f.jsxs("div",{children:[f.jsx("div",{className:"section-title",children:l("cardNews.composer")}),f.jsx("p",{children:l("cardNews.composerHint")})]})}),f.jsxs("label",{className:"card-news-field",children:[f.jsx("span",{children:l("cardNews.topic")}),f.jsx("input",{value:i,placeholder:l("cardNews.topicPlaceholder"),onChange:D=>g("topic",D.target.value)})]}),f.jsxs("label",{className:"card-news-field",children:[f.jsx("span",{children:l("cardNews.audience")}),f.jsx("input",{value:s,placeholder:l("cardNews.audiencePlaceholder"),onChange:D=>g("audience",D.target.value)})]}),f.jsxs("label",{className:"card-news-field",children:[f.jsx("span",{children:l("cardNews.goal")}),f.jsx("input",{value:u,placeholder:l("cardNews.goalPlaceholder"),onChange:D=>g("goal",D.target.value)})]}),f.jsxs("label",{className:"card-news-field",children:[f.jsx("span",{children:l("cardNews.brief")}),f.jsx("textarea",{value:d,placeholder:l("cardNews.briefPlaceholder"),onChange:D=>g("contentBrief",D.target.value)})]}),f.jsxs("div",{className:"card-news-field",children:[f.jsx("span",{children:l("cardNews.outputSize")}),f.jsx("div",{className:"card-news-size-row",role:"group","aria-label":l("cardNews.outputSize"),children:["1024x1024","2048x2048","custom"].map(D=>f.jsx("button",{type:"button",className:`option-btn${p===D?" active":""}`,onClick:()=>x(D),children:D==="custom"?l("cardNews.customSize"):D==="1024x1024"?"1024²":"2048²"},D))}),p==="custom"?f.jsxs("div",{className:"card-news-custom-size",children:[f.jsx("input",{className:"custom-size-input",type:"text",inputMode:"numeric",value:m,onChange:D=>b(Number.parseInt(D.target.value,10)||m,y),"aria-label":l("size.width")}),f.jsx("span",{children:"×"}),f.jsx("input",{className:"custom-size-input",type:"text",inputMode:"numeric",value:y,onChange:D=>b(m,Number.parseInt(D.target.value,10)||y),"aria-label":l("size.height")})]}):null]}),f.jsxs("button",{type:"button",className:"generate-btn card-news-draft-btn",onClick:()=>{S()},disabled:N||!i.trim(),children:[N?f.jsx("span",{className:"card-news-spinner","aria-hidden":"true"}):null,l(N?"cardNews.drafting":"cardNews.draft")]}),z?f.jsx("div",{className:"card-news-error",role:"alert",children:z}):null,N?f.jsxs("div",{className:"card-news-inline-status",role:"status",children:[f.jsx("span",{className:"card-news-spinner","aria-hidden":"true"}),f.jsx("span",{children:l("cardNews.drafting")})]}):null,f.jsxs("button",{type:"button",className:"composer__tool card-news-generate-btn",onClick:()=>{F()},disabled:!Y||M||Y.cards.every(D=>D.locked),children:[M?f.jsx("span",{className:"card-news-spinner","aria-hidden":"true"}):null,M?l("cardNews.progress.generating",{done:Q.done,total:Q.total}):l("cardNews.batchGenerate")]})]})}function $1({item:l,active:o,selectLabel:i,deleteLabel:s,setRef:u,onSelect:d,onDelete:p}){const m=Gt(l);return f.jsxs("div",{className:"sidebar-history__item",children:[f.jsx("button",{ref:y=>u(m,y),type:"button",className:`sidebar-history__thumb${o?" active":""}`,onClick:()=>d(l),"aria-label":i,children:f.jsx("img",{src:l.thumb||l.url||l.image,alt:"",loading:"lazy",decoding:"async"})}),f.jsx("button",{type:"button",className:"sidebar-history__delete",onClick:y=>{y.preventDefault(),y.stopPropagation(),p(l)},"aria-label":s,title:s,children:"x"})]})}function W1({entry:l,active:o,selectLabel:i,deleteLabel:s,setRef:u,onSelect:d,onDelete:p}){const m=i1(l.items.length);return f.jsxs("div",{className:"sidebar-history__item",children:[f.jsxs("button",{ref:y=>u(l.key,y),type:"button",className:`sidebar-history__sequence${o?" active":""}`,onClick:()=>d(l.sequenceId),"aria-label":i,children:[f.jsx("span",{className:`sidebar-history__sequence-grid count-${m}`,"aria-hidden":"true",children:Array.from({length:m}).map((y,g)=>{const x=l.items[g];return x?f.jsx("img",{src:x.thumb||x.url||x.image,alt:"",loading:"lazy",decoding:"async"},Gt(x)):f.jsx("span",{className:"sidebar-history__sequence-placeholder"},`sequence-placeholder-${l.sequenceId}-${g}`)})}),f.jsx("span",{className:"sidebar-history__sequence-badge",children:l.items.length})]}),f.jsx("button",{type:"button",className:"sidebar-history__delete",onClick:y=>{y.preventDefault(),y.stopPropagation(),p(l.sequenceId)},"aria-label":s,title:s,children:"x"})]})}const dh="ima2.sidebarHistoryCollapsed";function ex(){const l=C(z=>z.history),o=C(z=>z.currentImage),i=C(z=>z.selectHistory),s=C(z=>z.showHistorySequence),u=C(z=>z.trashHistoryItem),d=C(z=>z.trashHistorySequence),p=C(z=>z.multimodePreviewFlightId),m=C(z=>z.openGallery),y=q.useRef({}),[g,x]=q.useState(()=>{try{return localStorage.getItem(dh)==="1"}catch{return!1}}),{t:b}=be(),S=p?.startsWith("history:")?`sequence:${p.slice(8)}`:o?.sequenceId?`sequence:${o.sequenceId}`:o?Gt(o):null,N=q.useMemo(()=>s1(l).slice(0,l1),[l]);q.useEffect(()=>{!S||g||y.current[S]?.scrollIntoView({block:"nearest",inline:"nearest"})},[S,g,N]),q.useEffect(()=>{try{localStorage.setItem(dh,g?"1":"0")}catch{}},[g]);const M=(z,F)=>{y.current[z]=F};return f.jsxs("section",{className:`sidebar-history${g?" sidebar-history--collapsed":""}`,"aria-label":b("history.recentTitle"),children:[f.jsxs("div",{className:"sidebar-history__header",children:[f.jsx("span",{className:"section-title",children:b("history.recentTitle")}),f.jsx("button",{type:"button",className:"sidebar-history__toggle",onClick:()=>x(z=>!z),title:b(g?"history.expandRecent":"history.collapseRecent"),"aria-expanded":!g,children:b(g?"history.expandRecentShort":"history.collapseRecentShort")})]}),g?null:f.jsxs("div",{className:"sidebar-history__grid",children:[f.jsx("button",{type:"button",className:"sidebar-history__gallery-card",onClick:m,"aria-label":b("history.galleryCard"),title:b("history.openGalleryTitle"),children:f.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),f.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),f.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),f.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),N.length===0?f.jsx("button",{type:"button",className:"sidebar-history__empty",onClick:m,children:b("history.emptyRecent")}):null,N.map(z=>z.type==="sequence"?f.jsx(W1,{entry:z,active:S===z.key,selectLabel:b("history.selectRecent"),deleteLabel:b("history.deleteSequenceAria",{count:z.items.length}),setRef:M,onSelect:s,onDelete:F=>{d(F)}},z.key):f.jsx($1,{item:z.item,active:S===z.key,selectLabel:b("history.selectRecent"),deleteLabel:b("history.deleteImageAria"),setRef:M,onSelect:i,onDelete:F=>{u(F)}},z.key))]})]})}const vg={promptBuilderSurface:"off",composerPlacement:"sidebar",multimodeHistoryGrouping:"individual",restoreComposerFromHistory:!0,viewerTools:"basic"},tx={promptBuilderSurface:"right-panel",composerPlacement:"bottom",multimodeHistoryGrouping:"sequence",restoreComposerFromHistory:!0,viewerTools:"zoom-pan"},ax={default:vg,"prompt-studio":tx};function mu(l,o){return ax[l]??vg}function nx(l,o){return mu(l).promptBuilderSurface!=="off"}const fh="(max-width: 800px)";function Ri(){const[l,o]=q.useState(()=>typeof window<"u"?window.matchMedia(fh).matches:!1);return q.useEffect(()=>{if(typeof window>"u")return;const i=window.matchMedia(fh),s=()=>o(i.matches);return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),l}function lx(){const{t:l}=be(),o=C(g=>g.uiMode),i=C(g=>g.workspaceProfile),s=C(g=>g.referenceImages),u=C(g=>g.clearReferences),d=Ri(),p=o==="agent"&&Ai?"agent":o==="node"&&wi?"node":"classic",m=mu(i),y=!d&&p==="classic"&&m.composerPlacement==="bottom"&&m.multimodeHistoryGrouping==="sequence";return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"logo",children:[f.jsx("div",{className:"logo-mark","aria-hidden":"true"}),f.jsxs("div",{className:"logo-copy",children:[f.jsx("div",{className:"logo-title",children:"ima2-gen"}),f.jsx("div",{className:"logo-subtitle",children:"gpt-image-2 studio"})]}),f.jsxs("div",{className:"logo-actions",children:[f.jsx(sx,{}),f.jsx(hg,{variant:"sidebar"}),f.jsx(H1,{})]})]}),f.jsx(z1,{}),p==="classic"?y?f.jsxs(f.Fragment,{children:[f.jsx(ex,{}),f.jsx(go,{})]}):f.jsxs(f.Fragment,{children:[f.jsx(du,{}),f.jsx(fu,{}),f.jsx(go,{})]}):p==="card-news"?f.jsx(f.Fragment,{children:f.jsx(J1,{})}):p==="node"?f.jsxs(f.Fragment,{children:[f.jsx(q1,{}),s.length>0?f.jsxs("div",{className:"node-mode-ref-warning",role:"status",children:[f.jsx("strong",{children:l("node.classicRefsParkedTitle")}),f.jsx("span",{children:l("node.classicRefsParkedBody")}),f.jsx("button",{type:"button",onClick:u,children:l("node.clearParkedRefs")})]}):null,f.jsx("div",{className:"sidebar__node-hint",children:l("sidebar.nodeModeHint")}),f.jsx(go,{})]}):null]})}function ix(){return f.jsx("aside",{className:"sidebar",children:f.jsx("div",{className:"sidebar__scroll",children:f.jsx(lx,{})})})}function sx(){const{t:l}=be(),o=C(p=>p.togglePromptLibrary),i=C(p=>p.promptLibraryOpen),s=C(p=>p.rightPanelOpen),u=C(p=>p.toggleRightPanel),d=()=>{!i&&!s&&u(),o()};return f.jsx("button",{type:"button",className:"settings-button",onClick:d,title:l("promptLibrary.title"),"aria-label":l("promptLibrary.title"),children:f.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:f.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})})})}const ox=1024,rx=1024,cx="blank-canvas.png";function mh(l,o){return typeof l!="number"||!Number.isFinite(l)||l<=0?o:Math.max(1,Math.round(l))}async function ux(l){const o=mh(l?.width,ox),i=mh(l?.height,rx),s=document.createElement("canvas");s.width=o,s.height=i;const u=s.getContext("2d");if(!u)throw new Error("blank_canvas_context_unavailable");u.fillStyle="#ffffff",u.fillRect(0,0,s.width,s.height);const d=await new Promise((p,m)=>{s.toBlob(y=>{y?p(y):m(new Error("blank_canvas_blob_unavailable"))},"image/png")});return new File([d],cx,{type:"image/png"})}const io=1024;function dx(l){const o=/^(\d+)x(\d+)$/.exec(l);if(!o)return{width:io,height:io};const i=Number.parseInt(o[1]??"",10),s=Number.parseInt(o[2]??"",10);return!Number.isFinite(i)||!Number.isFinite(s)||i<=0||s<=0?{width:io,height:io}:{width:i,height:s}}function fx(){const l=C(y=>y.importLocalImageToHistory),o=C(y=>y.openCanvas),i=C(y=>y.showToast),s=C(y=>y.getResolvedSize),{t:u}=be(),[d,p]=q.useState(!1),m=q.useCallback(async()=>{if(!d){p(!0);try{const y=dx(s()),g=await ux(y);await l(g)&&o()}catch{i(u("canvas.blank.failed"),!0)}finally{p(!1)}}},[d,s,l,o,i,u]);return{creatingBlankCanvas:d,createBlankCanvas:m}}const mx="canvas-mode-context",px="Canvas Mode",hx=["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(`
|
|
25
|
-
`);function gx({imageOverride:l=null,onAfterDeleteFocus:o}){const{t:i}=be(),s=C(ae=>ae.currentImage),u=C(ae=>ae.showToast),d=C(ae=>ae.setPrompt),p=C(ae=>ae.insertPromptToComposer),m=C(ae=>ae.useImageAsReference),y=C(ae=>ae.createRootNodeFromHistoryItem),g=C(ae=>ae.trashHistoryItem),x=C(ae=>ae.permanentlyDeleteHistoryItemByClick),b=C(ae=>ae.canvasOpen),S=C(ae=>ae.openCanvas),[N,M]=q.useState(!1),z=l??s;if(!z)return null;const F=!!z.filename,Y=()=>{const ae=document.createElement("a");ae.href=z.image,ae.download=z.filename||"generated.png",ae.click()},X=async()=>{try{const we=await(await fetch(z.image)).blob();await navigator.clipboard.write([new ClipboardItem({[we.type]:we})]),u(i("toast.imageCopied"))}catch{u(i("toast.copyFailed"),!0)}},Q=()=>{z.prompt&&(navigator.clipboard.writeText(z.prompt),u(i("toast.promptCopied")))},D=async()=>{const ae=!!z.prompt;ae&&d(z.prompt);try{await m(z)}catch{}b&&l&&p({id:mx,name:px,text:hx});const we=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');we&&(we.focus(),we.setSelectionRange(we.value.length,we.value.length)),u(i(ae?"toast.forkStarted":"toast.forkStartedNoPrompt"))},te=async()=>{if(!(!z.filename||N)){M(!0);try{const ae=await xb({filename:z.filename});u(i("toast.comfyExported",{filename:ae.uploadedFilename}))}catch(ae){const we=ae instanceof Error?ae.code:void 0;u(i(we==="COMFY_URL_NOT_LOCAL"?"toast.comfyExportInvalidUrl":we==="COMFY_IMAGE_INVALID"?"toast.comfyExportInvalidImage":we==="COMFY_IMAGE_NOT_FOUND"?"toast.comfyExportImageNotFound":"toast.comfyExportFailed"),!0)}finally{M(!1)}}},U=()=>{y(z),u(i("toast.nodeRootCreated"))},$=async()=>{try{await g(z)}finally{o?.()}},Ce=async()=>{try{await x(z)}finally{o?.()}};return f.jsxs("div",{className:"result-actions",children:[f.jsx("button",{type:"button",className:"action-btn",onClick:Y,children:i("result.download")}),f.jsx("button",{type:"button",className:"action-btn",onClick:X,children:i("result.copyImage")}),f.jsx("button",{type:"button",className:"action-btn",onClick:Q,children:i("result.copyPrompt")}),f.jsx("button",{type:"button",className:"action-btn action-btn--primary",onClick:D,title:i("result.continueHereTitle"),children:i("result.continueHere")}),f.jsx("button",{type:"button",className:"action-btn",onClick:U,title:i("result.firstNodeTitle"),children:i("result.firstNode")}),!b&&f.jsx("button",{type:"button",className:"action-btn",onClick:S,title:i("canvas.open"),"aria-label":i("canvas.openAria"),children:f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:f.jsx("path",{d:"M4 4h8v8M12 4l-8 8"})})}),z.filename&&f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button",className:"action-btn action-btn--danger",onClick:()=>{$()},title:i("result.deleteTitle"),children:i("result.delete")}),f.jsxs("details",{className:"result-actions__more",children:[f.jsx("summary",{className:"action-btn",children:i("result.more")}),f.jsxs("div",{className:"result-actions__menu",children:[F&&f.jsx("button",{type:"button",className:"result-actions__menu-item",onClick:()=>{te()},title:i("result.sendToComfyUITitle"),disabled:N,children:i("result.sendToComfyUI")}),f.jsx("button",{type:"button",className:"result-actions__menu-item result-actions__danger-item",onClick:()=>{Ce()},children:i("result.permanentDelete")})]})]})]})]})}function yx(){const l=C(S=>{const N=S.multimodePreviewFlightId;return N?S.multimodeSequences[N]??null:null}),o=C(S=>S.cancelMultimode),i=C(S=>{const N=S.multimodePreviewFlightId;return!!(N&&(S.multimodeAbortControllers[N]||S.inFlight.some(M=>M.id===N)))}),s=C(S=>S.selectHistory),u=C(S=>S.currentImage),d=C(S=>S.openCanvas),{t:p}=be(),m=S=>{s(S)},y=S=>{s(S),d()};if(!l)return null;const g=new Map,x=l.partials.filter(S=>S.index==null);for(const S of l.partials)S.index!=null&&g.set(S.index,S);const b=Array.from({length:l.requested},(S,N)=>{const M=l.images[N],z=g.get(N)??(M?void 0:x.shift());return{index:N,image:M,partial:z}});return f.jsxs("section",{className:"multimode-sequence","aria-live":"polite",children:[f.jsxs("div",{className:"multimode-sequence__header",children:[f.jsxs("div",{children:[f.jsx("div",{className:"multimode-sequence__title",children:p("multimode.sequenceTitle")}),f.jsx("div",{className:"multimode-sequence__meta",children:p("multimode.sequenceProgress",{returned:l.returned,requested:l.requested})})]}),i?f.jsx("button",{type:"button",className:"secondary-btn",onClick:o,children:p("multimode.cancel")}):null]}),f.jsx("div",{className:`multimode-sequence__grid count-${Math.min(l.requested,4)}`,children:b.map(({index:S,image:N,partial:M})=>{const z=N&&u?.filename&&N.filename===u.filename;return f.jsxs("article",{className:`multimode-sequence__slot${N?" done":""}${z?" active":""}`,onClick:N?()=>m(N):void 0,onDoubleClick:N?()=>y(N):void 0,role:N?"button":void 0,tabIndex:N?0:void 0,onKeyDown:N?F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),m(N))}:void 0,children:[f.jsx("div",{className:"multimode-sequence__badge",children:p("multimode.stageLabel",{index:S+1})}),N?f.jsx("img",{src:N.url??N.image,alt:p("canvas.resultAlt")}):M?f.jsx("img",{src:M.image,alt:p("multimode.partialAlt")}):f.jsx("div",{className:"multimode-sequence__empty",children:l.status==="error"?p("multimode.error"):l.status==="empty"?p("multimode.empty"):l.status==="canceled"?p("multimode.canceled"):l.status==="partial"?p("multimode.notReturned"):p("multimode.generating")})]},N?.filename??S)})})]})}function vx({zoom:l,minZoom:o,maxZoom:i,onZoomIn:s,onZoomOut:u,onReset:d,labels:p}){return f.jsxs("div",{className:"viewer-controls","aria-label":p.controls,onPointerDown:m=>m.stopPropagation(),onDoubleClick:m=>m.stopPropagation(),onWheel:m=>m.stopPropagation(),children:[f.jsx("button",{type:"button",className:"viewer-control-btn",onClick:m=>{m.stopPropagation(),u()},disabled:l<=o,"aria-label":p.zoomOut,children:"-"}),f.jsxs("button",{type:"button",className:"viewer-control-btn viewer-control-btn--label",onClick:m=>{m.stopPropagation(),d()},"aria-label":p.reset,children:[Math.round(l*100),"%"]}),f.jsx("button",{type:"button",className:"viewer-control-btn",onClick:m=>{m.stopPropagation(),s()},disabled:l>=i,"aria-label":p.zoomIn,children:"+"})]})}function yo(l){return l instanceof HTMLElement?l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement||l instanceof HTMLButtonElement||l.isContentEditable:!1}const xn=1,bg=5,so=.22;function bx(l){return Math.min(bg,Math.max(xn,l))}function Sx(l){const[o,i]=q.useState(1),[s,u]=q.useState({x:0,y:0}),[d,p]=q.useState(null),m=q.useCallback(()=>{i(1),u({x:0,y:0}),p(null)},[]);q.useEffect(()=>{m()},[m,l]);const y=q.useCallback(M=>{i(z=>{const F=bx(z+M);return F<=xn?(u({x:0,y:0}),xn):Number(F.toFixed(2))})},[]),g=q.useCallback(M=>{M.preventDefault(),y(M.deltaY<0?so:-so)},[y]),x=q.useCallback(()=>{if(o>xn){m();return}i(2)},[m,o]),b=q.useCallback(M=>{o<=xn||M.button!==0||(M.preventDefault(),M.currentTarget.setPointerCapture(M.pointerId),p({pointerId:M.pointerId,startX:M.clientX,startY:M.clientY,baseX:s.x,baseY:s.y}))},[s.x,s.y,o]),S=q.useCallback(M=>{!d||d.pointerId!==M.pointerId||u({x:d.baseX+M.clientX-d.startX,y:d.baseY+M.clientY-d.startY})},[d]),N=q.useCallback(M=>{!d||d.pointerId!==M.pointerId||(p(null),M.currentTarget.releasePointerCapture(M.pointerId))},[d]);return{zoom:o,pan:s,reset:m,zoomIn:()=>y(so),zoomOut:()=>y(-so),handleWheel:g,handleDoubleClick:x,handlePointerDown:b,handlePointerMove:S,handlePointerUp:N}}const xx=q.lazy(()=>Ea(()=>import("./index-BLx55BOg.js"),[]).then(l=>({default:l.CanvasModeWorkspace})));function Nx(l){return l==="low"?"l":l==="medium"?"m":l==="high"?"h":l??null}function Ex(l){if(!l)return null;const o=l.match(/^(\d+)x\1$/);return o?`${o[1]}²`:l.replace("x","×")}function Tx(l){const o=l.url??l.image;if(!l.canvasVersion||!l.canvasMergedAt||o.startsWith("data:"))return o;const i=o.includes("?")?"&":"?";return`${o}${i}canvasMergedAt=${l.canvasMergedAt}`}function lu(){const l=C(A=>A.currentImage),o=C(A=>A.importLocalImageToHistory),i=C(A=>{const V=A.multimodePreviewFlightId;return V?A.multimodeSequences[V]??null:null}),s=C(A=>A.selectHistoryShortcutTarget),u=C(A=>A.trashHistoryItem),d=C(A=>A.permanentlyDeleteHistoryItemByShortcut),p=C(A=>A.markGeneratedResultsSeen),m=C(A=>A.activeGenerations),y=C(A=>A.quality),g=C(A=>A.getResolvedSize),x=C(A=>A.canvasOpen),b=C(A=>A.openCanvas),S=C(A=>A.showToast),{t:N}=be(),[M,z]=q.useState(!1),{creatingBlankCanvas:F,createBlankCanvas:Y}=fx(),X=q.useRef(null),Q=l?`${l.filename??l.url??l.image}:${l.canvasMergedAt??""}`:null,D=Sx(Q),te=()=>{l?.prompt&&(navigator.clipboard.writeText(l.prompt),S(N("toast.promptCopied")))},U=A=>{if(A.key==="Delete"||A.key==="Backspace"){if(!l||A.target!==A.currentTarget||yo(A.target))return;if(A.preventDefault(),A.shiftKey){d(l);return}u(l);return}A.key!=="ArrowLeft"&&A.key!=="ArrowRight"&&A.key!=="Home"&&A.key!=="End"||A.target===A.currentTarget&&(yo(A.target)||(A.preventDefault(),A.key==="ArrowLeft"?s("previous"):A.key==="ArrowRight"?s("next"):A.key==="Home"?s("first"):A.key==="End"&&s("last")))},$=A=>{yo(A.target)||(p(),A.currentTarget.focus())},Ce=q.useCallback(()=>{window.requestAnimationFrame(()=>X.current?.focus())},[]),ae=q.useCallback(A=>{Array.from(A.dataTransfer.types).includes("Files")&&(A.preventDefault(),z(V=>V||!0))},[]),we=q.useCallback(A=>{A.currentTarget.contains(A.relatedTarget)||z(!1)},[]),ke=q.useCallback(async A=>{if(!Array.from(A.dataTransfer.types).includes("Files"))return;A.preventDefault(),z(!1);const V=Array.from(A.dataTransfer.files).filter(ne=>/^image\/(png|jpeg|webp)$/.test(ne.type));V.length!==0&&await o(V[0])},[o]);if(x&&l)return f.jsx(q.Suspense,{fallback:f.jsx("main",{className:"canvas canvas--mode-open","aria-busy":"true"}),children:f.jsx(xx,{currentImage:l})});const Ie=Nx(l?.quality??y),ct=Ex(l?.size??g()),Fe=D0(l?.model),K=l?Tx(l):null;return f.jsxs("main",{className:`canvas${M?" canvas--drop-active":""}`,onDragOver:ae,onDragLeave:we,onDrop:ke,children:[M?f.jsx("div",{className:"canvas__drop-overlay","aria-hidden":!0,children:f.jsx("span",{className:"canvas__drop-hint",children:N("canvas.drop.hint")})}):null,f.jsx("div",{className:`progress-bar${m>0?" active":""}`}),i?f.jsx(yx,{}):l&&K?f.jsxs("div",{ref:X,className:"result-container visible",tabIndex:0,onMouseDown:$,onKeyDown:U,"aria-label":N("canvas.imageViewerAria"),children:[f.jsxs("div",{className:`canvas-annotation-frame${D.zoom>xn?" canvas-annotation-frame--zoomed":""}`,onWheel:D.handleWheel,onDoubleClick:D.handleDoubleClick,onPointerDown:D.handlePointerDown,onPointerMove:D.handlePointerMove,onPointerUp:D.handlePointerUp,onPointerCancel:D.handlePointerUp,children:[f.jsx("img",{className:"result-img",src:K,alt:N("canvas.resultAlt"),style:{transform:`translate(${D.pan.x}px, ${D.pan.y}px) scale(${D.zoom})`},onDoubleClick:A=>{A.stopPropagation(),b()}},Q??void 0),f.jsx(vx,{zoom:D.zoom,minZoom:xn,maxZoom:bg,onZoomIn:D.zoomIn,onZoomOut:D.zoomOut,onReset:D.reset,labels:{controls:N("viewer.controls"),zoomIn:N("viewer.zoomIn"),zoomOut:N("viewer.zoomOut"),reset:N("viewer.reset")}})]}),f.jsx("div",{className:"result-meta",children:[l.elapsed!=null?`${l.elapsed}s`:null,l.usage?N("canvas.tokens",{n:l.usage.total_tokens??"?"}):null,Ie,ct,Fe,l.provider??null].filter(A=>!!A).join(" · ")}),f.jsx(gx,{onAfterDeleteFocus:Ce}),l.prompt?f.jsx("div",{className:"result-prompt",onClick:te,children:l.prompt}):null]}):l?null:f.jsxs("div",{className:"canvas__blank-entry",children:[f.jsx("div",{className:"canvas__blank-sheet","aria-hidden":!0}),f.jsxs("div",{className:"canvas__blank-copy",children:[f.jsx("strong",{children:N("canvas.blank.title")}),f.jsx("span",{children:N("canvas.blank.subtitle")})]}),f.jsx("button",{type:"button",className:"canvas__blank-button",onClick:()=>{Y()},disabled:F,children:N(F?"canvas.blank.creating":"canvas.blank.create")})]})]})}function _x(){return f.jsxs("div",{className:"classic-workspace",children:[f.jsx("div",{className:"classic-workspace__stage",children:f.jsx(lu,{})}),f.jsxs("div",{className:"classic-workspace__dock",children:[f.jsx(du,{variant:"bottom"}),f.jsx(fu,{})]})]})}function Nn({title:l,help:o,items:i,value:s,onChange:u}){return f.jsxs("div",{className:"option-group",children:[l?f.jsx("div",{className:"section-title",children:l}):null,f.jsx("div",{className:"option-row",children:i.map(d=>f.jsxs("button",{className:`option-btn${d.value===s?" active":""}`,style:d.color?{color:d.color}:void 0,disabled:d.disabled,onClick:()=>u(d.value),type:"button",children:[d.label,d.sub?f.jsxs(f.Fragment,{children:[f.jsx("br",{}),f.jsx("span",{className:"option-sub",children:d.sub})]}):null]},d.value))}),o?f.jsx("p",{className:"option-help",children:o}):null]})}const Sg="ima2.customSizeSlots";function Cx(l){if(!l||typeof l!="object")return!1;const o=l;return typeof o.id=="string"&&typeof o.w=="number"&&typeof o.h=="number"&&typeof o.updatedAt=="number"}function wx(){try{const l=localStorage.getItem(Sg);if(!l)return[];const o=JSON.parse(l);return Array.isArray(o)?bl(o.filter(Cx)):[]}catch{return[]}}function Ax(l){try{localStorage.setItem(Sg,JSON.stringify(bl(l)))}catch{}}function Mx(l,o,i){return No({id:`slot_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,w:l,h:o,ratio:i,updatedAt:Date.now()})}function xi(l){return l.map(o=>({value:o.value,label:o.label,sub:o.sub}))}function Rx(){const l=C(K=>K.sizePreset),o=C(K=>K.setSizePreset),i=C(K=>K.customW),s=C(K=>K.customH),u=C(K=>K.setCustomSize),{t:d}=be(),[p,m]=q.useState(String(i)),[y,g]=q.useState(String(s)),[x,b]=q.useState(l==="custom"),[S,N]=q.useState(()=>wx()),[M,z]=q.useState(null),[F,Y]=q.useState("free"),X=l==="custom",Q=cu(p,y,i,s),D=j0().filter(K=>K.value==="auto");q.useEffect(()=>{m(String(i)),g(String(s))},[i,s]),q.useEffect(()=>{X||(b(!1),z(null))},[X]);function te(K){N(K),Ax(K)}function U(){const K=aa(p,i),A=aa(y,s);u(K,A),m(String(K)),g(String(A))}function $(K){K.key==="Enter"&&(K.preventDefault(),U())}function Ce(){o("custom"),b(!0),z(S.length>=yl?S[0]?.id??null:null)}function ae(K){o(K),K!=="custom"&&(b(!1),z(null))}function we(K){o("custom"),u(K.w,K.h),m(String(K.w)),g(String(K.h)),b(!1),z(K.id)}function ke(K){Y(K.id);const A=_0(K);A&&(m(String(A.w)),g(String(A.h)))}function Ie(){const K=Mx(Q.w,Q.h,F),A=S.length>=yl&&M?w0(S,M,K):C0(S,K);te(A),o("custom"),u(Q.w,Q.h),m(String(Q.w)),g(String(Q.h)),z(K.id),b(!1)}const ct=Q.reasons.length>0?Q.reasons.map(K=>d(`size.adjustedReasons.${K}`)).join(", "):d("size.noAdjustment"),Fe=Q.reasons.includes("maxPixels")&&Q.requestedW===Q.requestedH&&Q.w===Q.h?d("size.squareMaxHint",{size:`${Lp}×${Lp}`}):null;return f.jsxs("div",{className:"option-group size-picker",children:[f.jsx("div",{className:"section-title",children:d("size.title")}),f.jsx(Nn,{title:"",items:xi(A0),value:l,onChange:ae}),f.jsx(Nn,{title:"",items:xi(M0),value:l,onChange:ae}),f.jsx(Nn,{title:"",items:xi(R0),value:l,onChange:ae}),f.jsx(Nn,{title:"",items:xi(O0),value:l,onChange:ae}),f.jsxs("div",{className:"option-row size-picker__quick-row",children:[xi(D).map(K=>f.jsxs("button",{type:"button",className:`option-btn${l===K.value?" active":""}`,onClick:()=>ae(K.value),children:[K.label,K.sub?f.jsxs(f.Fragment,{children:[f.jsx("br",{}),f.jsx("span",{className:"option-sub",children:K.sub})]}):null]},K.value)),f.jsxs("button",{type:"button",className:`option-btn${X?" active":""}`,onClick:Ce,children:[d("size.customPlus"),f.jsx("br",{}),f.jsx("span",{className:"option-sub",children:d("size.customSub")})]})]}),S.length>0?f.jsx("div",{className:"option-row size-picker__slot-row",children:S.map(K=>f.jsxs("button",{type:"button",className:`option-btn size-picker__slot${X&&i===K.w&&s===K.h?" active":""}`,onClick:()=>we(K),children:[K.w,"×",K.h,f.jsx("br",{}),f.jsx("span",{className:"option-sub",children:K.ratio||d("size.customSlot")})]},K.id))}):null,x?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"size-picker__ratio-row",children:E0.map(K=>f.jsx("button",{type:"button",className:`size-picker__ratio${F===K.id?" active":""}`,onClick:()=>ke(K),children:K.id==="free"?d("size.ratioFree"):K.label},K.id))}),f.jsxs("div",{className:"option-row size-picker__custom-row",children:[f.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:p,onChange:K=>m(K.target.value.replace(/\D/g,"")),onBlur:U,onKeyDown:$,placeholder:d("size.width")}),f.jsx("span",{className:"size-picker__dimension-separator","aria-hidden":"true",children:"×"}),f.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"custom-size-input",value:y,onChange:K=>g(K.target.value.replace(/\D/g,"")),onBlur:U,onKeyDown:$,placeholder:d("size.height")})]}),f.jsxs("div",{className:"size-picker__preview",children:[f.jsx("span",{children:d("size.normalizedPreview")}),f.jsx("strong",{children:T0(Q.w,Q.h)})]}),f.jsx("div",{className:"size-picker__preview size-picker__preview--reason",children:ct}),Fe?f.jsx("div",{className:"size-picker__preview size-picker__preview--detail",children:Fe}):null,S.length>=yl?f.jsxs("div",{className:"size-picker__replace-row",children:[f.jsx("span",{children:d("size.replaceCustomSlot")}),S.map(K=>f.jsxs("button",{type:"button",className:`size-picker__replace${M===K.id?" active":""}`,onClick:()=>z(K.id),children:[K.w,"×",K.h]},K.id))]}):null,f.jsx("button",{type:"button",className:"size-picker__save",onClick:Ie,children:S.length>=yl?d("size.replaceCustomSlot"):d("size.saveCustomSlot")}),f.jsx("div",{className:"size-hint",children:d("size.hint")})]}):null]})}const Wc=[1,2,4];function ph(l){return Math.min(8,Math.max(1,Math.trunc(l||1)))}function Ox(){const l=C(X=>X.count),o=C(X=>X.setCount),i=C(X=>X.uiMode),s=C(X=>X.multimode),u=C(X=>X.multimodeMaxImages),d=C(X=>X.setMultimodeMaxImages),{t:p}=be(),m=i==="classic"&&s,y=m?u:l,g=m?d:o,[x,b]=q.useState(!Wc.includes(y)),[S,N]=q.useState(String(y));q.useEffect(()=>{b(!Wc.includes(y)),N(String(y))},[m,y]);function M(X=S){const Q=ph(Number.parseInt(X,10));g(Q),N(String(Q))}function z(X){b(!1),N(String(X)),g(X)}function F(X){const Q=ph(y+X);b(!0),N(String(Q)),g(Q)}function Y(X){X.key==="Enter"&&(X.preventDefault(),M())}return f.jsxs("div",{className:"option-group count-picker",children:[f.jsx("div",{className:"section-title",children:p(m?"multimode.maxStages":"count.title")}),f.jsxs("div",{className:"option-row",children:[Wc.map(X=>f.jsx("button",{type:"button",className:`option-btn${y===X&&!x?" active":""}`,onClick:()=>z(X),children:X},X)),f.jsx("button",{type:"button",className:`option-btn${x?" active":""}`,onClick:()=>{b(X=>!X),N(String(y))},children:p("count.customPlus")})]}),x?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"count-picker__custom",children:[f.jsx("button",{type:"button",className:"count-picker__step",onClick:()=>F(-1),"aria-label":p("count.decrease"),children:"-"}),f.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"count-picker__input",value:S,onChange:X=>N(X.target.value.replace(/\D/g,"")),onBlur:()=>M(),onKeyDown:Y,"aria-label":p("count.customLabel")}),f.jsx("button",{type:"button",className:"count-picker__step",onClick:()=>F(1),"aria-label":p("count.increase"),children:"+"})]}),f.jsx("p",{className:"option-help",children:y>=5?p(m?"multimode.highCountHint":"count.highCountHint"):p(m?"multimode.minMaxHint":"count.minMaxHint")})]}):null]})}const jx={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}};function zx(l,o){return jx[l]?.[o]??0}function Ix(){const{t:l}=be(),o=C(b=>b.provider),i=C(b=>b.quality),s=C(b=>b.multimode),u=C(b=>b.multimodeMaxImages),p=C(b=>b.getResolvedSize)(),m=o==="oauth",y=zx(i,p),g=m?l("cost.free"):s?l("cost.multimodeApprox",{amount:(y*u).toFixed(3),count:u}):l("cost.approx",{amount:y.toFixed(3)}),x=m?"var(--green)":void 0;return f.jsxs("div",{className:"cost-estimate",children:[f.jsx("span",{children:l("cost.label")}),f.jsx("span",{className:"price",style:x?{color:x}:void 0,children:g})]})}const Dx=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}];function xg(){const{t:l}=be(),o=C(N=>N.quality),i=C(N=>N.setQuality),s=C(N=>N.format),u=C(N=>N.setFormat),d=C(N=>N.moderation),p=C(N=>N.setModeration),m=C(N=>N.multimode),y=C(N=>N.setMultimode),x=C(N=>N.uiMode)==="classic",b=[{value:"low",label:l("quality.lowLabel"),sub:l("quality.lowSub")},{value:"medium",label:l("quality.mediumLabel"),sub:l("quality.mediumSub")},{value:"high",label:l("quality.highLabel"),sub:l("quality.highSub")}],S=[{value:"auto",label:l("moderation.autoLabel"),sub:l("moderation.autoSub")},{value:"low",label:l("moderation.lowLabel"),sub:l("moderation.lowSub"),color:"var(--amber)"}];return f.jsxs("div",{className:"right-panel-settings",role:"tabpanel",children:[f.jsx(Nn,{title:l("quality.title"),items:b,value:o,onChange:i}),f.jsx(Rx,{}),f.jsx(Nn,{title:l("format.title"),items:Dx,value:s,onChange:u}),f.jsx(Nn,{title:l("moderation.title"),items:S,value:d,onChange:p}),f.jsx("p",{className:"option-help",children:l("moderation.explain")}),x&&f.jsx("div",{className:"option-group multimode-toggle",children:f.jsxs("button",{type:"button",className:`multimode-toggle__button${m?" active":""}`,"aria-pressed":m,title:l("multimode.tooltip"),onClick:()=>y(!m),children:[f.jsx("span",{children:l("multimode.label")}),f.jsx("span",{children:l("multimode.shortHint")})]})}),f.jsx(Ox,{}),f.jsx(Ix,{})]})}const Lx=q.lazy(()=>Ea(()=>import("./PromptLibraryPanel-fk4KmrGy.js"),[]).then(l=>({default:l.PromptLibraryPanel}))),qx=q.lazy(()=>Ea(()=>import("./PromptBuilderPanel-Y2VygFc0.js"),[]).then(l=>({default:l.PromptBuilderPanel})));function Hx(){const l=C(M=>M.rightPanelOpen),o=C(M=>M.toggleRightPanel),i=C(M=>M.promptLibraryOpen),s=C(M=>M.setPromptLibraryOpen),u=C(M=>M.promptBuilderOpen),d=C(M=>M.togglePromptBuilder),p=C(M=>M.workspaceProfile),{t:m}=be(),[y,g]=q.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);q.useEffect(()=>{if(typeof window>"u")return;const M=window.matchMedia("(max-width: 800px)"),z=()=>g(M.matches);return M.addEventListener("change",z),()=>M.removeEventListener("change",z)},[]);const x=nx(p)&&!y,b=y?l:!0,S=u&&x?"builder":i?"library":"settings",N=M=>{M==="builder"?(u||d(),i&&s(!1)):M==="library"?(u&&d(),i||s(!0)):(u&&d(),i&&s(!1))};return f.jsxs(f.Fragment,{children:[y&&l?f.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":m("panel.closeSettings"),onClick:o}):null,f.jsxs("aside",{className:`right-panel${l?"":" collapsed"}${y&&b?" drawer-open":""}`,"aria-label":m("panel.detailSettings"),children:[!y&&f.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":l,"aria-controls":"right-panel-body",onClick:o,title:m(l?"panel.toggleHide":"panel.toggleShow"),children:l?">":"<"}),f.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!l,children:[f.jsxs("div",{className:"right-panel-tabs",role:"tablist","aria-label":m("panel.detailSettings"),children:[x?f.jsx("button",{type:"button",role:"tab","aria-selected":S==="builder",className:`right-panel-tabs__button${S==="builder"?" active":""}`,onClick:()=>N("builder"),children:m("promptBuilder.title")}):null,f.jsx("button",{type:"button",role:"tab","aria-selected":S==="settings",className:`right-panel-tabs__button${S==="settings"?" active":""}`,onClick:()=>N("settings"),children:m("panel.detailSettings")}),f.jsx("button",{type:"button",role:"tab","aria-selected":S==="library",className:`right-panel-tabs__button${S==="library"?" active":""}`,onClick:()=>N("library"),children:m("promptLibrary.title")})]}),S==="builder"&&x?f.jsx(q.Suspense,{fallback:f.jsx("div",{className:"prompt-library-panel__loading",children:m("common.loading")}),children:f.jsx(qx,{variant:"sidebar"})}):S==="library"?f.jsx(q.Suspense,{fallback:f.jsx("div",{className:"prompt-library-panel__loading",children:m("common.loading")}),children:f.jsx(Lx,{variant:"embedded"})}):f.jsx(xg,{})]})]})]})}function kx(l){const o=l.currentTarget;if(o.scrollWidth<=o.clientWidth||!(Math.abs(l.deltaY)>Math.abs(l.deltaX)))return;const s=o.scrollLeft<=0,u=o.scrollLeft+o.clientWidth>=o.scrollWidth-1,d=l.deltaY<0,p=l.deltaY>0;d&&s||p&&u||(l.preventDefault(),o.scrollLeft+=l.deltaY)}function Gx(){const l=C(g=>g.history),o=C(g=>g.currentImage),i=C(g=>g.historyStripLayout),s=C(g=>g.selectHistory),u=C(g=>g.openGallery),d=q.useRef({}),{t:p}=be(),m=o?Gt(o):null,y=q.useMemo(()=>fo(l.filter(Ti)),[l]);return q.useEffect(()=>{m&&d.current[m]?.scrollIntoView({block:"nearest",inline:"nearest"})},[m,y]),f.jsxs("div",{className:`history-strip${i==="horizontal"?" history-strip--horizontal":""}${i==="sidebar"?" history-strip--sidebar":""}`,onWheel:kx,"data-layout":i,children:[f.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:u,"aria-label":p("history.openGalleryAria"),title:p("history.openGalleryTitle"),children:f.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),f.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),f.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),f.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),y.map(g=>{const x=Gt(g),b=m===x;return f.jsx("img",{ref:S=>{d.current[x]=S},src:g.thumb||g.url||g.image,alt:"",className:`history-thumb${b?" active":""}`,onClick:()=>s(g)},x)})]})}const hh=3e4;function Ux(){const{t:l}=be(),o=C(g=>g.toastLog),i=C(g=>g.errorCardLog),s=C(g=>g.dismissToast),u=C(g=>g.dismissErrorCard),[d,p]=q.useState(()=>typeof document>"u"?!0:document.visibilityState==="visible"),m=q.useRef(new Map);q.useEffect(()=>{const g=()=>p(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)}},[]),q.useEffect(()=>{const g=m.current,x=new Set([...o.map(b=>`toast-${b.id}`),...i.map(b=>`error-card-${b.id}`)]);for(const[b,S]of g)(!x.has(b)||!d)&&(clearTimeout(S),g.delete(b));if(d){for(const b of o){const S=`toast-${b.id}`;if(g.has(S))continue;const N=setTimeout(()=>{g.delete(S),s(b.id)},hh);g.set(S,N)}for(const b of i){const S=`error-card-${b.id}`;if(g.has(S))continue;const N=setTimeout(()=>{g.delete(S),u(b.id)},hh);g.set(S,N)}}},[u,s,i,d,o]),q.useEffect(()=>()=>{for(const g of m.current.values())clearTimeout(g);m.current.clear()},[]);const y=[...o.map(g=>({kind:"toast",id:g.id,key:`toast-${g.id}`,message:g.message,error:g.error,createdAt:g.createdAt})),...i.map(g=>{const x=Ei[g.code]??Ei.UNKNOWN,b=l(`${x.cardKey??"errorCard.unknown"}.title`),S=l(`${x.cardKey??"errorCard.unknown"}.body`);return{kind:"error-card",id:g.id,key:`error-card-${g.id}`,message:g.fallbackMessage?`${b}: ${S} ${g.fallbackMessage}`:`${b}: ${S}`,error:!0,createdAt:g.createdAt}})].sort((g,x)=>g.createdAt-x.createdAt);return y.length===0?null:f.jsx("div",{className:"toast-stack","aria-live":"polite","aria-relevant":"additions removals",children:y.map(g=>{const x=["toast","visible",g.error?"error":"",g.kind==="error-card"?"toast--card":""].filter(Boolean).join(" ");return f.jsxs("div",{className:x,role:g.error?"alert":"status",children:[f.jsx("span",{className:"toast__message",children:g.message}),f.jsx("button",{type:"button",className:"toast__dismiss","aria-label":"Dismiss notification",onClick:()=>g.kind==="error-card"?u(g.id):s(g.id),children:"x"})]},g.key)})})}function Bx(){return null}function Px(l){if(!l)return"earlier";const o=new Date(l);if(Number.isNaN(o.getTime()))return"earlier";const s=Math.floor((new Date().getTime()-o.getTime())/864e5);return s===0?"today":s===1?"yesterday":s<7?"thisWeek":o.toLocaleDateString("ko-KR",{year:"numeric",month:"short",day:"numeric"})}function Fx({item:l,onOpen:o,onCopyPath:i,onDownloadManifest:s}){const{t:u}=be(),p=l.cards?.find(m=>m.headline)?.headline||l.headline||u("gallery.cardNewsSet");return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"gallery__tile",onClick:()=>o(l),title:p,children:[l.image?f.jsx("img",{src:l.image,alt:p,loading:"lazy"}):null,f.jsxs("div",{className:"gallery__caption",children:[f.jsx("small",{children:u("gallery.cardNewsSet")}),f.jsx("span",{className:"gallery__caption-text",children:p})]}),f.jsx("div",{className:"gallery-card-news-strip",children:(l.cards||[]).slice(0,5).map((m,y)=>f.jsxs("span",{children:[m.url?f.jsx("img",{src:m.url,alt:m.headline??"",loading:"lazy"}):null,f.jsx("em",{children:m.cardOrder??y+1})]},`${m.url}-${y}`))})]}),f.jsxs("div",{className:"gallery-card-news-actions",children:[f.jsx("span",{children:u("gallery.cardNewsCount",{n:l.cards?.length??0})}),f.jsx("button",{type:"button",onClick:()=>o(l),children:u("gallery.openCardNewsSet")}),f.jsx("button",{type:"button",onClick:m=>i(l,m),children:u("gallery.copyCardNewsSetPath")}),f.jsx("button",{type:"button",onClick:m=>s(l,m),children:u("gallery.downloadCardNewsManifest")})]})]})}function Yx({item:l,active:o,itemRef:i,onSelect:s,onDelete:u,onToggleFavorite:d,t:p}){return f.jsxs("div",{ref:i,className:`gallery__tile-wrap${o?" gallery__tile-wrap--active":""}${l.isFavorite?" gallery__tile-wrap--favorite":""}`,children:[f.jsxs("button",{type:"button",className:`gallery__tile${o?" gallery__tile--active":""}`,onClick:()=>s(l),title:l.prompt??"",children:[f.jsx("img",{src:l.thumb||l.image,alt:l.prompt??p("gallery.imageAltFallback"),loading:"lazy",decoding:"async"}),l.prompt&&f.jsx("div",{className:"gallery__caption",children:f.jsx("span",{className:"gallery__caption-text",children:l.prompt})})]}),l.filename&&d&&f.jsx("button",{type:"button",className:`gallery__favorite${l.isFavorite?" gallery__favorite--on":""}`,onClick:m=>{m.stopPropagation(),d(l)},title:l.isFavorite?p("gallery.unfavoriteTitle"):p("gallery.favoriteTitle"),"aria-label":l.isFavorite?p("gallery.unfavoriteAria"):p("gallery.favoriteAria"),children:l.isFavorite?"★":"☆"}),l.filename&&f.jsx("button",{type:"button",className:"gallery__delete",onClick:m=>u(l,m),title:p("gallery.deleteTitle"),"aria-label":p("gallery.deleteAria"),children:"×"})]})}var Vx=_h();function hl(l,o,i){let s=i.initialDeps??[],u,d=!0;function p(){var m,y,g;let x;i.key&&((m=i.debug)!=null&&m.call(i))&&(x=Date.now());const b=l();if(!(b.length!==s.length||b.some((M,z)=>s[z]!==M)))return u;s=b;let N;if(i.key&&((y=i.debug)!=null&&y.call(i))&&(N=Date.now()),u=o(...b),i.key&&((g=i.debug)!=null&&g.call(i))){const M=Math.round((Date.now()-x)*100)/100,z=Math.round((Date.now()-N)*100)/100,F=z/16,Y=(X,Q)=>{for(X=String(X);X.length<Q;)X=" "+X;return X};console.info(`%c⏱ ${Y(z,5)} /${Y(M,5)} ms`,`
|
|
26
|
-
font-size: .6rem;
|
|
27
|
-
font-weight: bold;
|
|
28
|
-
color: hsl(${Math.max(0,Math.min(120-120*F,120))}deg 100% 31%);`,i?.key)}return i?.onChange&&!(d&&i.skipInitialOnChange)&&i.onChange(u),d=!1,u}return p.updateDeps=m=>{s=m},p}function gh(l,o){if(l===void 0)throw new Error("Unexpected undefined");return l}const Xx=(l,o)=>Math.abs(l-o)<1.01,Kx=(l,o,i)=>{let s;return function(...u){l.clearTimeout(s),s=l.setTimeout(()=>o.apply(this,u),i)}},yh=l=>{const{offsetWidth:o,offsetHeight:i}=l;return{width:o,height:i}},Qx=l=>l,Zx=l=>{const o=Math.max(l.startIndex-l.overscan,0),i=Math.min(l.endIndex+l.overscan,l.count-1),s=[];for(let u=o;u<=i;u++)s.push(u);return s},Jx=(l,o)=>{const i=l.scrollElement;if(!i)return;const s=l.targetWindow;if(!s)return;const u=p=>{const{width:m,height:y}=p;o({width:Math.round(m),height:Math.round(y)})};if(u(yh(i)),!s.ResizeObserver)return()=>{};const d=new s.ResizeObserver(p=>{const m=()=>{const y=p[0];if(y?.borderBoxSize){const g=y.borderBoxSize[0];if(g){u({width:g.inlineSize,height:g.blockSize});return}}u(yh(i))};l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(m):m()});return d.observe(i,{box:"border-box"}),()=>{d.unobserve(i)}},vh={passive:!0},bh=typeof window>"u"?!0:"onscrollend"in window,$x=(l,o)=>{const i=l.scrollElement;if(!i)return;const s=l.targetWindow;if(!s)return;let u=0;const d=l.options.useScrollendEvent&&bh?()=>{}:Kx(s,()=>{o(u,!1)},l.options.isScrollingResetDelay),p=x=>()=>{const{horizontal:b,isRtl:S}=l.options;u=b?i.scrollLeft*(S&&-1||1):i.scrollTop,d(),o(u,x)},m=p(!0),y=p(!1);i.addEventListener("scroll",m,vh);const g=l.options.useScrollendEvent&&bh;return g&&i.addEventListener("scrollend",y,vh),()=>{i.removeEventListener("scroll",m),g&&i.removeEventListener("scrollend",y)}},Wx=(l,o,i)=>{if(o?.borderBoxSize){const s=o.borderBoxSize[0];if(s)return Math.round(s[i.options.horizontal?"inlineSize":"blockSize"])}return l[i.options.horizontal?"offsetWidth":"offsetHeight"]},eN=(l,{adjustments:o=0,behavior:i},s)=>{var u,d;const p=l+o;(d=(u=s.scrollElement)==null?void 0:u.scrollTo)==null||d.call(u,{[s.options.horizontal?"left":"top"]:p,behavior:i})};class tN{constructor(o){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var i,s,u;return((u=(s=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:s.now)==null?void 0:u.call(s))??Date.now()},this.observer=(()=>{let i=null;const s=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(u=>{u.forEach(d=>{const p=()=>{const m=d.target,y=this.indexFromElement(m);if(!m.isConnected){this.observer.unobserve(m);return}this.shouldMeasureDuringScroll(y)&&this.resizeItem(y,this.options.measureElement(m,d,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(p):p()})}));return{disconnect:()=>{var u;(u=s())==null||u.disconnect(),i=null},observe:u=>{var d;return(d=s())==null?void 0:d.observe(u,{box:"border-box"})},unobserve:u=>{var d;return(d=s())==null?void 0:d.unobserve(u)}}})(),this.range=null,this.setOptions=i=>{Object.entries(i).forEach(([s,u])=>{typeof u>"u"&&delete i[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Qx,rangeExtractor:Zx,onChange:()=>{},measureElement:Wx,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...i}},this.notify=i=>{var s,u;(u=(s=this.options).onChange)==null||u.call(s,this,i)},this.maybeNotify=hl(()=>(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.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,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(u=>{this.observer.observe(u)}),this.unsubs.push(this.options.observeElementRect(this,u=>{this.scrollRect=u,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(u,d)=>{this.scrollAdjustments=0,this.scrollDirection=d?this.getScrollOffset()<u?"forward":"backward":null,this.scrollOffset=u,this.isScrolling=d,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,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.getFurthestMeasurement=(i,s)=>{const u=new Map,d=new Map;for(let p=s-1;p>=0;p--){const m=i[p];if(u.has(m.lane))continue;const y=d.get(m.lane);if(y==null||m.end>y.end?d.set(m.lane,m):m.end<y.end&&u.set(m.lane,!0),u.size===this.options.lanes)break}return d.size===this.options.lanes?Array.from(d.values()).sort((p,m)=>p.end===m.end?p.index-m.index:p.end-m.end)[0]:void 0},this.getMeasurementOptions=hl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(i,s,u,d,p,m,y)=>(this.prevLanes!==void 0&&this.prevLanes!==m&&(this.lanesChangedFlag=!0),this.prevLanes=m,this.pendingMeasuredCacheIndexes=[],{count:i,paddingStart:s,scrollMargin:u,getItemKey:d,enabled:p,lanes:m,laneAssignmentMode:y}),{key:!1}),this.getMeasurements=hl(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:i,paddingStart:s,scrollMargin:u,getItemKey:d,enabled:p,lanes:m,laneAssignmentMode:y},g)=>{if(!p)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const N of this.laneAssignments.keys())N>=i&&this.laneAssignments.delete(N);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(N=>{this.itemSizeCache.set(N.key,N.size)}));const x=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1);const b=this.measurementsCache.slice(0,x),S=new Array(m).fill(void 0);for(let N=0;N<x;N++){const M=b[N];M&&(S[M.lane]=N)}for(let N=x;N<i;N++){const M=d(N),z=this.laneAssignments.get(N);let F,Y;const X=y==="estimate"||g.has(M);if(z!==void 0&&this.options.lanes>1){F=z;const U=S[F],$=U!==void 0?b[U]:void 0;Y=$?$.end+this.options.gap:s+u}else{const U=this.options.lanes===1?b[N-1]:this.getFurthestMeasurement(b,N);Y=U?U.end+this.options.gap:s+u,F=U?U.lane:N%this.options.lanes,this.options.lanes>1&&X&&this.laneAssignments.set(N,F)}const Q=g.get(M),D=typeof Q=="number"?Q:this.options.estimateSize(N),te=Y+D;b[N]={index:N,start:Y,size:D,end:te,key:M,lane:F},S[F]=N}return this.measurementsCache=b,b},{key:!1,debug:()=>this.options.debug}),this.calculateRange=hl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,s,u,d)=>this.range=i.length>0&&s>0?aN({measurements:i,outerSize:s,scrollOffset:u,lanes:d}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=hl(()=>{let i=null,s=null;const u=this.calculateRange();return u&&(i=u.startIndex,s=u.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,s]},(i,s,u,d,p)=>d===null||p===null?[]:i({startIndex:d,endIndex:p,overscan:s,count:u}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const s=this.options.indexAttribute,u=i.getAttribute(s);return u?parseInt(u,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const u=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(u!==void 0&&this.range){const d=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),p=Math.max(0,u-d),m=Math.min(this.options.count-1,u+d);return i>=p&&i<=m}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((p,m)=>{p.isConnected||(this.observer.unobserve(p),this.elementsCache.delete(m))});return}const s=this.indexFromElement(i),u=this.options.getItemKey(s),d=this.elementsCache.get(u);d!==i&&(d&&this.observer.unobserve(d),this.observer.observe(i),this.elementsCache.set(u,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,s)=>{var u;const d=this.measurementsCache[i];if(!d)return;const p=this.itemSizeCache.get(d.key)??d.size,m=s-p;m!==0&&(((u=this.scrollState)==null?void 0:u.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(d,m,this):d.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=m,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(d.index),this.itemSizeCache=new Map(this.itemSizeCache.set(d.key,s)),this.notify(!1))},this.getVirtualItems=hl(()=>[this.getVirtualIndexes(),this.getMeasurements()],(i,s)=>{const u=[];for(let d=0,p=i.length;d<p;d++){const m=i[d],y=s[m];u.push(y)}return u},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=i=>{const s=this.getMeasurements();if(s.length!==0)return gh(s[Ng(0,s.length-1,u=>gh(s[u]).start,i)])},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.getOffsetForAlignment=(i,s,u=0)=>{if(!this.scrollElement)return 0;const d=this.getSize(),p=this.getScrollOffset();s==="auto"&&(s=i>=p+d?"end":"start"),s==="center"?i+=(u-d)/2:s==="end"&&(i-=d);const m=this.getMaxScrollOffset();return Math.max(Math.min(m,i),0)},this.getOffsetForIndex=(i,s="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const u=this.getSize(),d=this.getScrollOffset(),p=this.measurementsCache[i];if(!p)return;if(s==="auto")if(p.end>=d+u-this.options.scrollPaddingEnd)s="end";else if(p.start<=d+this.options.scrollPaddingStart)s="start";else return[d,s];if(s==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),s];const m=s==="end"?p.end+this.options.scrollPaddingEnd:p.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(m,s,p.size),s]},this.scrollToOffset=(i,{align:s="start",behavior:u="auto"}={})=>{const d=this.getOffsetForAlignment(i,s),p=this.now();this.scrollState={index:null,align:s,behavior:u,startedAt:p,lastTargetOffset:d,stableFrames:0},this._scrollToOffset(d,{adjustments:void 0,behavior:u}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:s="auto",behavior:u="auto"}={})=>{i=Math.max(0,Math.min(i,this.options.count-1));const d=this.getOffsetForIndex(i,s);if(!d)return;const[p,m]=d,y=this.now();this.scrollState={index:i,align:m,behavior:u,startedAt:y,lastTargetOffset:p,stableFrames:0},this._scrollToOffset(p,{adjustments:void 0,behavior:u}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:s="auto"}={})=>{const u=this.getScrollOffset()+i,d=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:d,lastTargetOffset:u,stableFrames:0},this._scrollToOffset(u,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var i;const s=this.getMeasurements();let u;if(s.length===0)u=this.options.paddingStart;else if(this.options.lanes===1)u=((i=s[s.length-1])==null?void 0:i.end)??0;else{const d=Array(this.options.lanes).fill(null);let p=s.length-1;for(;p>=0&&d.some(m=>m===null);){const m=s[p];d[m.lane]===null&&(d[m.lane]=m.end),p--}u=Math.max(...d.filter(m=>m!==null))}return Math.max(u-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(i,{adjustments:s,behavior:u})=>{this.options.scrollToFn(i,{behavior:u,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(o)}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 s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,u=s?s[0]:this.scrollState.lastTargetOffset,d=1,p=u!==this.scrollState.lastTargetOffset;if(!p&&Xx(u,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=d){this.scrollState=null;return}}else this.scrollState.stableFrames=0,p&&(this.scrollState.lastTargetOffset=u,this.scrollState.behavior="auto",this._scrollToOffset(u,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ng=(l,o,i,s)=>{for(;l<=o;){const u=(l+o)/2|0,d=i(u);if(d<s)l=u+1;else if(d>s)o=u-1;else return u}return l>0?l-1:0};function aN({measurements:l,outerSize:o,scrollOffset:i,lanes:s}){const u=l.length-1,d=y=>l[y].start;if(l.length<=s)return{startIndex:0,endIndex:u};let p=Ng(0,u,d,i),m=p;if(s===1)for(;m<u&&l[m].end<i+o;)m++;else if(s>1){const y=Array(s).fill(0);for(;m<u&&y.some(x=>x<i+o);){const x=l[m];y[x.lane]=x.end,m++}const g=Array(s).fill(i+o);for(;p>=0&&g.some(x=>x>=i);){const x=l[p];g[x.lane]=x.start,p--}p=Math.max(0,p-p%s),m=Math.min(u,m+(s-1-m%s))}return{startIndex:p,endIndex:m}}const Sh=typeof document<"u"?q.useLayoutEffect:q.useEffect;function nN({useFlushSync:l=!0,...o}){const i=q.useReducer(()=>({}),{})[1],s={...o,onChange:(d,p)=>{var m;l&&p?Vx.flushSync(i):i(),(m=o.onChange)==null||m.call(o,d,p)}},[u]=q.useState(()=>new tN(s));return u.setOptions(s),Sh(()=>u._didMount(),[]),Sh(()=>u._willUpdate()),u}function lN(l){return nN({observeElementRect:Jx,observeElementOffset:$x,scrollToFn:eN,...l})}const So=170,xo=10,Eg=36,iN=44;function sN(l){const o=Math.max(So,l-Eg);return Math.max(1,Math.floor((o+xo)/(So+xo)))}function oN(l,o){const i=Math.max(So,l-Eg);return Math.max(So,Math.floor((i-xo*Math.max(0,o-1))/o))+xo}function rN(l,o){const i=[];for(const[s,u]of l){i.push({type:"header",id:`h-${s}`,label:s,count:u.length});for(let d=0;d<u.length;d+=o)i.push({type:"items",id:`r-${s}-${d}`,items:u.slice(d,d+o)})}return i}function cN({dateGroups:l,selectedKey:o,scrollElement:i,localizeBucket:s,renderTile:u}){const d=q.useRef(null),[p,m]=q.useState(0),y=q.useMemo(()=>sN(p||960),[p]),g=q.useMemo(()=>oN(p||960,y),[p,y]),x=q.useMemo(()=>rN(l,y),[l,y]);q.useEffect(()=>{const S=d.current;if(!S)return;const N=()=>m(S.clientWidth);N();const M=new ResizeObserver(N);return M.observe(S),()=>M.disconnect()},[]);const b=lN({count:x.length,getScrollElement:()=>i,estimateSize:S=>x[S]?.type==="header"?iN:g,overscan:6});return q.useEffect(()=>{if(!o)return;const S=x.findIndex(N=>N.type==="items"&&N.items.some(M=>Gt(M)===o));S>=0&&b.scrollToIndex(S,{align:"center"})},[x,o,b]),f.jsx("div",{ref:d,className:"gallery__virtual",style:{height:b.getTotalSize()},children:b.getVirtualItems().map(S=>{const N=x[S.index];return N?f.jsx("div",{className:"gallery__virtual-row",style:{transform:`translateY(${S.start}px)`},children:N.type==="header"?f.jsxs("header",{className:"gallery__group-header gallery__group-header--virtual",children:[f.jsx("span",{className:"gallery__group-label",children:s(N.label)}),f.jsx("span",{className:"gallery__group-count",children:N.count})]}):f.jsx("div",{className:"gallery__grid gallery__grid--virtual",children:N.items.map((M,z)=>u(M,N.id,z))})},N.id):null})})}function xh({showSessions:l,favoritesOnly:o,query:i,historyNextCursor:s,favoriteHistoryNextCursor:u,historyLoadingOlder:d,favoriteHistoryLoadingOlder:p,onLoadOlder:m,onLoadOlderFavorites:y,t:g}){return l?f.jsx("div",{className:"gallery__load-more gallery__load-more--hint",children:g("gallery.sessionPaginationHint")}):i.trim()?null:o?u?f.jsx("div",{className:"gallery__load-more",children:f.jsx("button",{type:"button",onClick:y,disabled:p,children:g(p?"gallery.loadingOlderFavorites":"gallery.loadOlderFavorites")})}):null:s?f.jsx("div",{className:"gallery__load-more",children:f.jsx("button",{type:"button",onClick:m,disabled:d,children:g(d?"gallery.loadingOlder":"gallery.loadOlder")})}):null}function uN({groups:l,loose:o,favoritesOnly:i,galleryScope:s,setGalleryScope:u,renderTile:d,t:p}){return l.length===0&&o.length===0?f.jsx("div",{className:"gallery__empty",children:i?p("gallery.emptyFavorites"):s==="current-session"?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:p("gallery.empty.currentSession")}),f.jsx("button",{type:"button",onClick:()=>u("all"),children:p("gallery.scope.all")})]}):p("gallery.emptySessions")}):f.jsxs(f.Fragment,{children:[l.map(m=>f.jsxs("section",{className:"gallery__group",children:[f.jsxs("header",{className:"gallery__group-header",children:[f.jsx("span",{className:"gallery__group-label",title:m.sessionId,children:m.title?m.displayLabel:p("gallery.sessionLabel",{name:m.displayLabel})}),f.jsx("span",{className:"gallery__group-count",children:m.items.length})]}),f.jsx("div",{className:"gallery__grid",children:m.items.map((y,g)=>d(y,m.sessionId,g))})]},m.sessionId)),o.length>0&&f.jsxs("section",{className:"gallery__group",children:[f.jsxs("header",{className:"gallery__group-header",children:[f.jsx("span",{className:"gallery__group-label",children:p("gallery.standalone")}),f.jsx("span",{className:"gallery__group-count",children:o.length})]}),f.jsx("div",{className:"gallery__grid",children:o.map((m,y)=>d(m,"loose",y))})]})]})}function dN({status:l,dismissed:o,onOpenFolder:i,onDismiss:s,t:u}){const d=l!=null&&l.state!=="ok"&&!o,p=l?.state==="recoverable"?"gallery.storageNoticeRecoverable":l?.state==="not_found"?"gallery.storageNoticeNotFound":"gallery.storageNoticeUnknown";return f.jsxs("div",{className:`gallery__storage-bar${d?" gallery__storage-bar--notice":""}`,children:[d?f.jsxs("div",{className:"gallery__storage-copy",children:[f.jsx("div",{className:"gallery__storage-title",children:u("gallery.storageNoticeTitle")}),f.jsx("div",{className:"gallery__storage-text",children:u(p)})]}):f.jsx("div",{className:"gallery__storage-copy gallery__storage-copy--quiet",children:l?.generatedDirLabel??"~/.ima2/generated"}),f.jsxs("div",{className:"gallery__storage-actions",children:[f.jsx("button",{type:"button",className:"gallery__storage-button",onClick:i,title:u("gallery.openGeneratedDirTitle"),children:u("gallery.openGeneratedDir")}),d&&f.jsx("button",{type:"button",className:"gallery__storage-button gallery__storage-button--ghost",onClick:s,children:u("common.close")})]})]})}const Nh="ima2.storageNoticeDismissed.0.09.23";function fN(){const{t:l}=be(),o=C(P=>P.galleryOpen),i=C(P=>P.closeGallery),s=C(P=>P.history),u=C(P=>P.selectHistory),d=C(P=>P.currentImage),p=C(P=>P.trashHistoryItem),m=C(P=>P.showToast),y=C(P=>P.toggleGalleryFavorite),g=C(P=>P.galleryScope),x=C(P=>P.setGalleryScope),b=C(P=>P.historyNextCursor),S=C(P=>P.historyLoadingOlder),N=C(P=>P.favoriteHistoryNextCursor),M=C(P=>P.favoriteHistoryLoadingOlder),z=C(P=>P.loadOlderHistory),F=C(P=>P.loadFavoriteHistory),Y=C(P=>P.loadOlderFavoriteHistory),X=C(j1),[Q,D]=q.useState(""),[te,U]=q.useState("date"),[$,Ce]=q.useState(!1),[ae,we]=q.useState([]),[ke,Ie]=q.useState([]),[ct,Fe]=q.useState(null),[K,A]=q.useState(()=>{try{return localStorage.getItem(Nh)==="1"}catch{return!1}}),V=q.useRef(null),ne=q.useRef({}),[xe,Ne]=q.useState(null),w=q.useRef(0),T=q.useMemo(()=>fo(s.filter(Ti)),[s]),B=q.useCallback(P=>{V.current=P,Ne(P)},[]);q.useEffect(()=>{if(!o)return;const P=Se=>{Se.key==="Escape"&&i()};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[o,i]),q.useEffect(()=>{o||D("")},[o]),q.useEffect(()=>{if(!o)return;let P=!1;return(async()=>{try{const Se=await yb();P||Fe(Se)}catch{P||Fe({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}})}})(),()=>{P=!0}},[o]),q.useEffect(()=>{if(!o||te!=="session")return;let P=!1;return(async()=>{try{const Se=await hb({limit:500,sessionId:g==="current-session"?X:void 0});if(P)return;const ut=ve=>{const Mt=ve.kind,Je=Mt==="classic"||Mt==="edit"||Mt==="generate"||Mt==="card-news-card"||Mt==="card-news-set"?Mt:null;return{image:ve.url,url:ve.url,filename:ve.filename,prompt:ve.prompt??void 0,size:ve.size??void 0,quality:ve.quality??void 0,model:ve.model??void 0,provider:ve.provider,createdAt:ve.createdAt,sessionId:ve.sessionId??null,nodeId:ve.nodeId??null,clientNodeId:ve.clientNodeId??null,kind:Je,setId:ve.setId??null,cardId:ve.cardId??null,cardOrder:ve.cardOrder??null,headline:ve.headline??null,body:ve.body??null,cards:ve.cards,isFavorite:ve.isFavorite??!1}};we(Se.sessions.map(ve=>({sessionId:ve.sessionId,title:ve.title??null,label:ve.label??null,displayLabel:ve.title||ve.label||ve.sessionId.slice(0,8),items:fo(ve.items.filter(Ti).map(ut))})).filter(ve=>ve.items.length>0)),Ie(fo(Se.loose.filter(Ti).map(ut)))}catch{}})(),()=>{P=!0}},[o,te,g,X]),q.useEffect(()=>{!o||te==="session"||!$||F()},[o,te,$,F]);const Z=q.useMemo(()=>{const P=Q.trim().toLowerCase().normalize("NFC");return T.filter(Se=>$&&!Se.isFavorite?!1:P?(Se.prompt??"").toLowerCase().normalize("NFC").includes(P)||(Se.filename??"").toLowerCase().normalize("NFC").includes(P):!0)},[T,Q,$]),ie=q.useMemo(()=>$?ae.map(P=>({...P,items:P.items.filter(Se=>Se.isFavorite)})).filter(P=>P.items.length>0):ae,[ae,$]),oe=q.useMemo(()=>$?ke.filter(P=>P.isFavorite):ke,[ke,$]),ge=q.useMemo(()=>{const P=new Map;for(const Se of Z){const ut=Px(Se.createdAt);P.has(ut)||P.set(ut,[]),P.get(ut).push(Se)}return Array.from(P.entries())},[Z]),Ze=te==="session"?ie.reduce((P,Se)=>P+Se.items.length,0)+oe.length:Z.length;q.useLayoutEffect(()=>{if(!o)return;const P=d?Gt(d):null,Se=P?ne.current[P]:null;if(Se){Se.scrollIntoView({block:"center"});return}V.current&&(V.current.scrollTop=w.current)},[o,d?.filename,d?.image,te,Ze,ge.length,ie.length,oe.length]);async function He(P,Se){Se.stopPropagation();const ut=Gt(P);await p(P),delete ne.current[ut],window.requestAnimationFrame(()=>V.current?.focus())}async function Ja(){try{await vb(),m(l("toast.openGeneratedDirOpened"))}catch{m(l("toast.openGeneratedDirFailed"),!0)}}async function Cn(P){if(P.setId)try{await et.getState().loadSet(P.setId),C.getState().setUIMode("card-news"),i()}catch{m(l("gallery.openCardNewsSetFailed"),!0)}}async function xl(P,Se){if(Se.stopPropagation(),!P.setId)return;const ut=`generated/cardnews/${P.setId}`;try{await navigator.clipboard?.writeText(ut),m(l("gallery.cardNewsPathCopied"))}catch{m(l("toast.copyFailed"),!0)}}function Oi(P,Se){Se.stopPropagation(),P.setId&&window.open(Y1(P.setId),"_blank","noopener,noreferrer")}function na(){A(!0);try{localStorage.setItem(Nh,"1")}catch{}}if(!o)return null;const Nl=P=>P==="earlier"||P==="today"||P==="yesterday"||P==="thisWeek"?l(`gallery.${P}`):P,wn=(P,Se,ut)=>{const ve=d?.image===P.image,Mt=Gt(P),Je=la=>{ne.current[Mt]=la};return P.kind==="card-news-set"?f.jsx("div",{ref:Je,className:"gallery__tile-wrap gallery-card-news-set",children:f.jsx(Fx,{item:P,onOpen:la=>{Cn(la)},onCopyPath:xl,onDownloadManifest:Oi})},`${Se}-${Mt}`):f.jsx(Yx,{item:P,active:ve,itemRef:Je,onSelect:la=>{u(la),i()},onDelete:He,onToggleFavorite:la=>{y(la.filename)},t:l},`${Se}-${Mt}`)},$a=te==="session",ji=d?Gt(d):null;return f.jsx("div",{className:"gallery-backdrop",onClick:i,role:"presentation",children:f.jsxs("div",{className:"gallery",role:"dialog","aria-modal":"true","aria-label":l("gallery.ariaLabel"),onClick:P=>P.stopPropagation(),children:[f.jsxs("div",{className:"gallery__header",children:[f.jsxs("div",{className:"gallery__title-row",children:[f.jsx("div",{className:"gallery__title",children:l("gallery.title")}),f.jsxs("div",{className:"gallery__meta",children:[l("gallery.total",{n:Ze}),Q||$?l("gallery.totalFiltered",{n:T.length}):""]}),f.jsxs("div",{className:"gallery__favorite-filter",role:"tablist","aria-label":l("gallery.favoriteFilterAria"),children:[f.jsx("button",{type:"button",role:"tab","aria-selected":!$,className:$?"":"active",onClick:()=>Ce(!1),children:l("gallery.filterAll")}),f.jsx("button",{type:"button",role:"tab","aria-selected":$,className:$?"active":"",onClick:()=>Ce(!0),children:l("gallery.filterFavorites")})]}),f.jsxs("div",{className:"gallery__group-toggle",role:"tablist","aria-label":l("gallery.sortByAria"),children:[f.jsx("button",{type:"button",role:"tab","aria-selected":te==="date",className:te==="date"?"active":"",onClick:()=>U("date"),children:l("gallery.sortByDate")}),f.jsx("button",{type:"button",role:"tab","aria-selected":te==="session",className:te==="session"?"active":"",onClick:()=>U("session"),children:l("gallery.sortBySession")})]}),f.jsxs("div",{className:"gallery__scope",role:"tablist","aria-label":l("gallery.scopeAria"),children:[f.jsx("button",{type:"button",role:"tab","aria-selected":g==="current-session",className:g==="current-session"?"active":"",onClick:()=>x("current-session"),disabled:!X,children:l("gallery.scope.current")}),f.jsx("button",{type:"button",role:"tab","aria-selected":g==="all",className:g==="all"?"active":"",onClick:()=>x("all"),children:l("gallery.scope.all")})]})]}),f.jsx("input",{type:"text",className:"gallery__search",placeholder:l($a?"gallery.searchDisabledPlaceholder":"gallery.searchPlaceholder"),value:Q,onChange:P=>D(P.target.value),autoFocus:!0,disabled:$a}),f.jsx("button",{type:"button",className:"gallery__close",onClick:i,"aria-label":l("gallery.closeAria"),title:l("gallery.closeTitle"),children:"×"})]}),f.jsx(dN,{status:ct,dismissed:K,onOpenFolder:Ja,onDismiss:na,t:l}),f.jsx("div",{className:"gallery__scroll",ref:B,tabIndex:-1,onScroll:()=>{w.current=V.current?.scrollTop??0},children:$a?f.jsxs(f.Fragment,{children:[f.jsx(uN,{groups:ie,loose:oe,favoritesOnly:$,galleryScope:g,setGalleryScope:x,renderTile:wn,t:l}),f.jsx(xh,{showSessions:$a,favoritesOnly:$,query:Q,historyNextCursor:b,favoriteHistoryNextCursor:N,historyLoadingOlder:S,favoriteHistoryLoadingOlder:M,onLoadOlder:()=>{z()},onLoadOlderFavorites:()=>{Y()},t:l})]}):Z.length===0?f.jsx("div",{className:"gallery__empty",children:T.length===0?l("gallery.emptyAll"):l($?"gallery.emptyFavorites":"gallery.noResults")}):f.jsxs(f.Fragment,{children:[f.jsx(cN,{dateGroups:ge,selectedKey:ji,scrollElement:xe,localizeBucket:Nl,renderTile:wn}),f.jsx(xh,{showSessions:$a,favoritesOnly:$,query:Q,historyNextCursor:b,favoriteHistoryNextCursor:N,historyLoadingOlder:S,favoriteHistoryLoadingOlder:M,onLoadOlder:()=>{z()},onLoadOlderFavorites:()=>{Y()},t:l})]})})]})})}function mN(l){return l.includes("ratio")?"sizeConfirm.reasonRatio":l.includes("maxPixels")||l.includes("pixels")?"sizeConfirm.reasonPixels":l.includes("minPixels")?"sizeConfirm.reasonMinPixels":l.includes("min")?"sizeConfirm.reasonMin":l.includes("maxEdge")||l.includes("max")?"sizeConfirm.reasonMax":"sizeConfirm.reasonSnap"}function pN(){const l=C(m=>m.customSizeConfirm),o=C(m=>m.confirmCustomSizeAdjustment),i=C(m=>m.cancelCustomSizeAdjustment),s=q.useRef(null),{t:u}=be();if(q.useEffect(()=>{if(!l)return;s.current?.focus();const m=y=>{y.key==="Escape"&&i()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i,l]),!l)return null;const d=`${l.requestedW}x${l.requestedH}`,p=`${l.adjustedW}x${l.adjustedH}`;return f.jsx("div",{className:"modal-backdrop custom-size-confirm-backdrop",role:"presentation",children:f.jsxs("div",{className:"modal custom-size-confirm",role:"dialog","aria-modal":"true","aria-labelledby":"custom-size-confirm-title","aria-describedby":"custom-size-confirm-body",children:[f.jsx("div",{id:"custom-size-confirm-title",className:"modal__title",children:u("sizeConfirm.title")}),f.jsxs("div",{id:"custom-size-confirm-body",className:"modal__body",children:[f.jsx("p",{children:u("sizeConfirm.body")}),f.jsxs("dl",{className:"size-confirm__pairs",children:[f.jsxs("div",{className:"size-confirm__pair",children:[f.jsx("dt",{children:u("sizeConfirm.requested")}),f.jsx("dd",{children:d})]}),f.jsxs("div",{className:"size-confirm__pair",children:[f.jsx("dt",{children:u("sizeConfirm.adjusted")}),f.jsx("dd",{children:p})]})]}),f.jsx("p",{className:"size-confirm__reason",children:u(mN(l.reasons))})]}),f.jsxs("div",{className:"modal__actions",children:[f.jsx("button",{ref:s,type:"button",className:"modal__btn modal__btn--secondary",onClick:i,children:u("sizeConfirm.cancel")}),f.jsx("button",{type:"button",className:"modal__btn",onClick:()=>{o()},children:u("sizeConfirm.approve")})]})]})})}function oo(l){return l==null||l===""?"-":String(l)}function hN(){const{t:l}=be(),o=C(m=>m.metadataRestore),i=C(m=>m.applyMetadataRestore),s=C(m=>m.addMetadataRestoreAsReference),u=C(m=>m.cancelMetadataRestore);if(!o)return null;const d=o.metadata,p=d.userPrompt||d.prompt||d.revisedPrompt||"";return f.jsx("div",{className:"modal-backdrop metadata-restore-backdrop",role:"presentation",children:f.jsxs("div",{className:"modal metadata-restore",role:"dialog","aria-modal":"true","aria-labelledby":"metadata-restore-title",children:[f.jsx("div",{id:"metadata-restore-title",className:"modal__title",children:l("metadata.restoreTitle")}),f.jsxs("div",{className:"modal__body metadata-restore__body",children:[f.jsx("p",{children:l("metadata.restoreBody")}),f.jsxs("div",{className:"metadata-restore__preview",children:[f.jsx("img",{src:o.image,alt:l("metadata.imageAlt")}),f.jsxs("div",{className:"metadata-restore__details",children:[f.jsxs("div",{children:[f.jsx("span",{children:l("metadata.prompt")}),f.jsx("strong",{title:p,children:oo(p)})]}),f.jsxs("div",{children:[f.jsx("span",{children:l("metadata.size")}),f.jsx("strong",{children:oo(d.size)})]}),f.jsxs("div",{children:[f.jsx("span",{children:l("metadata.quality")}),f.jsx("strong",{children:oo(d.quality)})]}),f.jsxs("div",{children:[f.jsx("span",{children:l("metadata.model")}),f.jsx("strong",{children:oo(d.model)})]}),f.jsxs("div",{children:[f.jsx("span",{children:l("metadata.source")}),f.jsx("strong",{children:o.source==="png-comment"?l("metadata.sourcePngComment"):l("metadata.sourceXmp")})]})]})]})]}),f.jsxs("div",{className:"modal__actions",children:[f.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:u,children:l("common.cancel")}),f.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:s,children:l("metadata.useAsReferenceOnly")}),f.jsx("button",{type:"button",className:"modal__btn",onClick:i,children:l("metadata.applySettings")})]})]})})}function gN(){const[l,o]=q.useState(null);return q.useEffect(()=>{let i=!1,s=null;const u=async()=>{try{const d=await ub();if(i)return;o(d),d.status==="starting"&&(s=setTimeout(u,3e3))}catch{i||o(null)}};return u(),()=>{i=!0,s&&clearTimeout(s)}},[]),l}function yN(){const[l,o]=q.useState(null),[i,s]=q.useState(!1);return q.useEffect(()=>{let u=!1;return db().then(d=>{u||o(d)}).catch(()=>{u||s(!0)}),()=>{u=!0}},[]),{data:l,error:i}}function vN(){const{t:l}=be(),o=gN(),{data:i}=yN(),s=o?.status==="ready";let u=l("provider.oauthNotReady"),d;o?.status==="auth_required"?(u=l("provider.codexLoginRequired"),d=l("provider.codexLoginHint")):o?.status==="starting"?u=l("provider.oauthStarting"):o||(u=l("provider.serverUnreachable"));const p=i?.apiKeyValid===!0;return{oauth:{ok:s,reason:u,hint:d},api:{ok:p,reason:p?"":l("provider.apiInvalid")}}}function bN(){const{t:l}=be(),o=C(S=>S.readinessPopupOpen),i=C(S=>S.closeReadinessPopup),s=C(S=>S.openSettings),u=C(S=>S.provider),d=C(S=>S.imageModel),p=C(S=>S.reasoningEffort),m=C(S=>S.webSearchEnabled),y=vN();if(!o)return null;const g=y[u],x=g.ok,b=()=>{i(),s("account")};return f.jsx("div",{className:"modal-backdrop provider-readiness-backdrop",onClick:i,role:"presentation",children:f.jsxs("div",{className:"modal provider-readiness",role:"dialog","aria-modal":"true","aria-labelledby":"provider-readiness-title",onClick:S=>S.stopPropagation(),children:[f.jsx("div",{id:"provider-readiness-title",className:"modal__title",children:l("readiness.title")}),f.jsxs("div",{className:"modal__body provider-readiness__body",children:[f.jsxs("div",{className:`provider-readiness__status${x?" is-ok":" is-blocked"}`,children:[f.jsx("span",{"aria-hidden":"true"}),f.jsx("strong",{children:l(x?"readiness.ready":"readiness.blocked")}),f.jsx("small",{children:x?l("readiness.readyBody"):g.reason})]}),g.hint?f.jsx("p",{className:"modal__hint",children:g.hint}):null,f.jsxs("dl",{className:"provider-readiness__facts",children:[f.jsxs("div",{children:[f.jsx("dt",{children:l("readiness.provider")}),f.jsx("dd",{children:u==="oauth"?"OAuth":l("provider.apiLabel")})]}),f.jsxs("div",{children:[f.jsx("dt",{children:l("readiness.model")}),f.jsx("dd",{children:d})]}),f.jsxs("div",{children:[f.jsx("dt",{children:l("readiness.reasoning")}),f.jsx("dd",{children:p})]}),f.jsxs("div",{children:[f.jsx("dt",{children:l("readiness.webSearch")}),f.jsx("dd",{children:l(m?"settings.webSearch.on":"settings.webSearch.off")})]})]})]}),f.jsxs("div",{className:"modal__actions",children:[f.jsx("button",{type:"button",className:"modal__btn modal__btn--secondary",onClick:i,children:l("common.close")}),f.jsx("button",{type:"button",className:"modal__btn",onClick:b,children:l("readiness.openAccount")})]})]})})}function SN(){const l=C(p=>p.trashPending),o=C(p=>p.restorePendingTrash),i=C(p=>p.clearPendingTrash),{t:s}=be(),[u,d]=q.useState(Date.now());return q.useEffect(()=>{if(!l)return;d(Date.now());const p=window.setInterval(()=>{const m=Date.now();d(m),m>=l.expiresAt&&i()},500);return()=>window.clearInterval(p)},[i,l]),l?f.jsxs("div",{className:"trash-undo-toast",children:[f.jsx("span",{children:s("gallery.deleted",{filename:l.filename})}),f.jsx("button",{type:"button",onClick:()=>{o()},children:s("gallery.undo")}),f.jsx("span",{className:"trash-undo-toast__timer",children:s("gallery.secondsSuffix",{n:Math.max(0,Math.ceil((l.expiresAt-u)/1e3))})})]}):null}function xN(){return f.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:[f.jsx("line",{x1:"4",y1:"6",x2:"14",y2:"6"}),f.jsx("circle",{cx:"17",cy:"6",r:"2.2"}),f.jsx("line",{x1:"4",y1:"12",x2:"8",y2:"12"}),f.jsx("circle",{cx:"11",cy:"12",r:"2.2"}),f.jsx("line",{x1:"14",y1:"12",x2:"20",y2:"12"}),f.jsx("line",{x1:"4",y1:"18",x2:"14",y2:"18"}),f.jsx("circle",{cx:"17",cy:"18",r:"2.2"})]})}function NN(){const l=C(g=>g.composeSheetOpen),o=C(g=>g.composeSheetTab),i=C(g=>g.openComposeSheet),s=C(g=>g.settingsOpen),u=C(g=>g.uiMode),{t:d}=be();if(!Ri()||s||u==="card-news"||u==="agent")return null;const m=l&&o==="controls",y=d("sheet.controlsOpen");return f.jsx("button",{type:"button",className:"mobile-settings-toggle","aria-expanded":m,"aria-controls":"mobile-generate-sheet","aria-label":y,title:y,onClick:()=>i("controls"),children:f.jsx(xN,{})})}function EN(){const{t:l}=be(),o=C(p=>p.openComposeSheet),i=C(p=>p.settingsOpen),s=C(p=>p.uiMode),u=s==="agent"&&Ai?"agent":s==="node"&&wi?"node":"classic";return!Ri()||i||u!=="classic"?null:f.jsxs("header",{className:"mobile-app-bar",role:"banner",children:[f.jsxs("div",{className:"mobile-app-bar__brand",children:[f.jsx("div",{className:"logo-mark","aria-hidden":"true"}),f.jsxs("div",{className:"mobile-app-bar__brand-copy",children:[f.jsx("span",{className:"mobile-app-bar__title",children:"ima2-gen"}),f.jsx("span",{className:"mobile-app-bar__mode",children:l("appBar.modeImage")})]})]}),f.jsxs("div",{className:"mobile-app-bar__actions",children:[f.jsx(hg,{variant:"sidebar"}),f.jsx("button",{type:"button",className:"mobile-app-bar__icon-button",onClick:()=>o("library"),"aria-label":l("promptLibrary.title"),title:l("promptLibrary.title"),children:f.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:f.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})})}),f.jsx("button",{type:"button",className:"mobile-app-bar__icon-button",onClick:()=>o("controls"),"aria-label":l("appBar.controls"),title:l("appBar.controls"),children:f.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:[f.jsx("circle",{cx:"12",cy:"12",r:"3"}),f.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"})]})}),f.jsxs("button",{type:"button",className:"mobile-app-bar__generate",onClick:()=>o("prompt"),"aria-label":l("appBar.generateAria"),children:[f.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:[f.jsx("path",{d:"M12 3l1.8 5.4L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.6L12 3z"}),f.jsx("path",{d:"M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8L19 15z"})]}),f.jsx("span",{children:l("appBar.generate")})]})]})]})}const TN=q.lazy(()=>Ea(()=>import("./PromptLibraryPanel-fk4KmrGy.js"),[]).then(l=>({default:l.PromptLibraryPanel}))),_N=["prompt","controls","library"];function CN(){const{t:l}=be(),o=C(g=>g.composeSheetOpen),i=C(g=>g.composeSheetTab),s=C(g=>g.setComposeSheetTab),u=C(g=>g.closeComposeSheet),d=C(g=>g.settingsOpen),p=C(g=>g.uiMode),m=p==="agent"&&Ai?"agent":p==="node"&&wi?"node":"classic",y=Ri();return q.useEffect(()=>{if(!o)return;const g=x=>{x.key==="Escape"&&u()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[o,u]),!y||d||m!=="classic"?null:f.jsxs(f.Fragment,{children:[o?f.jsx("div",{className:"compose-sheet-backdrop",role:"button","aria-label":l("sheet.close"),onClick:u}):null,f.jsxs("section",{id:"mobile-generate-sheet",className:`compose-sheet${o?" compose-sheet--open":""}`,role:"dialog","aria-modal":o?"true":"false","aria-label":l("sheet.generate"),"aria-hidden":!o,children:[f.jsx("button",{type:"button",className:"compose-sheet__handle",onClick:u,"aria-label":l("sheet.close")}),f.jsx("div",{className:"mobile-sheet-tabs",role:"tablist","aria-label":l("sheet.generate"),children:_N.map(g=>f.jsx("button",{type:"button",role:"tab","aria-selected":i===g,className:`mobile-sheet-tabs__button${i===g?" active":""}`,onClick:()=>s(g),children:l(`sheet.tabs.${g}`)},g))}),f.jsx("div",{className:"compose-sheet__body",children:i==="prompt"?f.jsxs("div",{className:"compose-sheet__panel compose-sheet__panel--prompt",role:"tabpanel",children:[f.jsx(du,{}),f.jsx(fu,{}),f.jsx(go,{})]}):i==="controls"?f.jsx("div",{className:"compose-sheet__panel compose-sheet__panel--controls",role:"tabpanel",children:f.jsx(xg,{})}):f.jsx("div",{className:"compose-sheet__panel compose-sheet__panel--library",role:"tabpanel",children:f.jsx(q.Suspense,{fallback:f.jsx("div",{className:"prompt-library-panel__loading",children:l("common.loading")}),children:f.jsx(TN,{variant:"embedded",forceOpen:!0,onRequestClose:()=>s("prompt")})})})})]})]})}const wN={ArrowLeft:"previous",ArrowRight:"next",Home:"first",End:"last",PageUp:"pagePrevious",PageDown:"pageNext"};function AN(){const l=C(s=>s.uiMode),o=C(s=>s.currentImage),i=C(s=>s.selectHistoryShortcutTarget);q.useEffect(()=>{if(l!=="classic")return;const s=u=>{const d=wN[u.key];d&&(u.defaultPrevented||yo(u.target)||o&&(u.preventDefault(),i(d)))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[o,i,l])}const ro=64,Tg="Image Gen";let pu=Tg,iu=!1,Za=null,hu="",su=!1;function _g(){return navigator}function Cg(){if(typeof document>"u")return null;if(Za)return Za;const l=document.querySelector('link[rel~="icon"]');if(l)return Za=l,hu=l.href||l.getAttribute("href")||"",l;const o=document.createElement("link");return o.rel="icon",document.head.appendChild(o),Za=o,su=!0,o}function MN(l){const o=document.createElement("canvas");o.width=ro,o.height=ro;const i=o.getContext("2d");return i?(i.clearRect(0,0,ro,ro),i.fillStyle="#0a0a0a",RN(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,l>1?13:10,0,Math.PI*2),i.fillStyle="#ff335f",i.fill(),i.lineWidth=4,i.strokeStyle="#ffffff",i.stroke(),l>1&&(i.fillStyle="#ffffff",i.font="bold 15px sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText(String(Math.min(l,9)),48,17)),o.toDataURL("image/png")):hu}function RN(l,o,i,s,u,d){l.beginPath(),l.moveTo(o+d,i),l.arcTo(o+s,i,o+s,i+u,d),l.arcTo(o+s,i+u,o,i+u,d),l.arcTo(o,i+u,o,i,d),l.arcTo(o,i,o+s,i,d),l.closePath()}async function ON(l){const o=_g();if(typeof o.setAppBadge=="function")try{await o.setAppBadge(l)}catch{}}async function jN(){const l=_g();if(typeof l.clearAppBadge=="function")try{await l.clearAppBadge()}catch{}}function zN(l){document.title=`(${l}) ${pu}`;const o=Cg();o&&(o.href=MN(l)),ON(l)}function Eh(){document.title=pu,Za&&(su?(Za.remove(),Za=null,su=!1):Za.href=hu),jN()}function Th(){iu||typeof document>"u"||(iu=!0,pu=document.title||Tg,Cg())}function IN(l){q.useEffect(()=>(Th(),()=>{iu&&Eh()}),[]),q.useEffect(()=>{Th(),l>0?zN(l):Eh()},[l])}function DN(){q.useEffect(()=>{if(typeof window>"u")return;const l=window.visualViewport;if(!l)return;const o=()=>{const i=Math.round(l.height),s=Math.round(l.offsetTop);document.documentElement.style.setProperty("--vv-h",`${i}px`),document.documentElement.style.setProperty("--vv-offset-top",`${s}px`)};return o(),l.addEventListener("resize",o),l.addEventListener("scroll",o),()=>{l.removeEventListener("resize",o),l.removeEventListener("scroll",o)}},[])}const LN=q.lazy(()=>Ea(()=>import("./NodeCanvas-BSZ527J4.js"),__vite__mapDeps([0,1])).then(l=>({default:l.NodeCanvas}))),qN=q.lazy(()=>Ea(()=>import("./SettingsWorkspace-DL5vhAHQ.js"),[]).then(l=>({default:l.SettingsWorkspace}))),HN=q.lazy(()=>Ea(()=>import("./CardNewsWorkspace-BBLdwzYU.js"),[]).then(l=>({default:l.CardNewsWorkspace}))),kN=q.lazy(()=>Ea(()=>import("./AgentWorkspace-BJe9yxPA.js"),[]).then(l=>({default:l.AgentWorkspace}))),GN=q.lazy(()=>Ea(()=>import("./PromptLibraryPanel-fk4KmrGy.js"),[]).then(l=>({default:l.PromptLibraryPanel})));function UN(){return f.jsx("main",{className:"canvas canvas--lazy-loading","aria-busy":"true"})}function BN(){AN(),DN();const l=C(U=>U.hydrateHistory),o=C(U=>U.loadSessions),i=C(U=>U.startInFlightPolling),s=C(U=>U.reconcileInflight),u=C(U=>U.syncFromStorage),d=C(U=>U.theme),p=C(U=>U.resolvedTheme),m=C(U=>U.themeFamily),y=C(U=>U.settingsOpen),g=C(U=>U.unseenGeneratedCount),x=C(U=>U.historyStripLayout),b=C(U=>U.workspaceProfile),S=C(U=>U.syncThemeFromStorage),N=C(U=>U.syncThemeFamilyFromStorage),M=C(U=>U.refreshResolvedTheme),z=C(U=>U.uiMode),F=z==="agent"&&Ai?"agent":z==="node"&&wi?"node":"classic",Y=F==="agent",X=Ri(),Q=mu(b),D=!X&&F==="classic"&&Q.composerPlacement==="bottom"&&Q.multimodeHistoryGrouping==="sequence",te=!D&&!Y;return IN(g),q.useEffect(()=>{l(),o(),s(),i()},[l,o,s,i]),q.useEffect(()=>{const U=$=>{$.key&&($.key==="ima2.inFlight"||$.key==="ima2.selectedFilename"?u():$.key==="ima2:theme"?S():$.key==="ima2:themeFamily"&&N())};return window.addEventListener("storage",U),()=>window.removeEventListener("storage",U)},[u,S,N]),q.useEffect(()=>{const U=document.documentElement;U.dataset.theme=p,U.dataset.themeMode=p,U.dataset.themeFamily=m,U.style.colorScheme=p},[p,m]),q.useEffect(()=>{if(d!=="system")return;const U=window.matchMedia("(prefers-color-scheme: light)");return U.addEventListener("change",M),()=>U.removeEventListener("change",M)},[M,d]),q.useEffect(()=>{const U=()=>{O1(C.getState)};return window.addEventListener("beforeunload",U),()=>{window.removeEventListener("beforeunload",U)}},[]),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:`app${b==="prompt-studio"?" app--prompt-studio":""}${y?" app--settings-open":""}${te&&x==="horizontal"?" app--history-horizontal":""}${te&&x==="sidebar"?" app--history-sidebar":""}`,"data-theme-mode":p,"data-theme-family":m,"data-history-strip-layout":x,"data-mobile":X?"1":void 0,"data-ui-mode":F,children:[f.jsx(ix,{}),f.jsx(EN,{}),te?f.jsx(Gx,{}):null,f.jsx(q.Suspense,{fallback:f.jsx(UN,{}),children:y?f.jsx(qN,{}):F==="classic"?D?f.jsx(_x,{}):f.jsx(lu,{}):F==="node"?f.jsx(LN,{}):F==="card-news"?f.jsx(HN,{}):F==="agent"?f.jsx(kN,{}):f.jsx(lu,{})}),F==="agent"||F==="card-news"?null:f.jsx(Hx,{})]}),f.jsx(pN,{}),f.jsx(SN,{}),f.jsx(Ux,{}),f.jsx(Bx,{}),f.jsx(fN,{}),f.jsx(hN,{}),f.jsx(bN,{}),f.jsx(CN,{}),f.jsx(NN,{}),F==="card-news"?f.jsx(q.Suspense,{fallback:null,children:f.jsx(GN,{})}):null]})}function PN(){if(window.location.protocol!=="http:"||window.location.hostname!=="localhost")return!1;const l=new URL(window.location.href);return l.hostname="127.0.0.1",window.location.replace(l.toString()),!0}PN()||tb.createRoot(document.getElementById("root")).render(f.jsx(q.StrictMode,{children:f.jsx(BN,{})}));export{VN as A,Ch as B,sE as C,$N as D,ZN as E,WN as F,eE as G,JN as H,hg as I,tE as J,aE as K,nE as L,yx as M,lE as N,iE as O,Zs as R,I1 as S,ob as T,z1 as U,D1 as W,Ea as _,q as a,C as b,D0 as c,Z0 as d,Ri as e,gN as f,Vv as g,yN as h,q0 as i,f as j,oE as k,et as l,kx as m,K0 as n,vl as o,gx as p,Mp as q,ou as r,KN as s,yo as t,be as u,QN as v,XN as w,FN as x,fx as y,YN as z};
|