@gallop.software/studio 2.3.150 → 2.3.152

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.
@@ -0,0 +1,125 @@
1
+ function lm(i,c){for(var f=0;f<c.length;f++){const d=c[f];if(typeof d!="string"&&!Array.isArray(d)){for(const h in d)if(h!=="default"&&!(h in i)){const p=Object.getOwnPropertyDescriptor(d,h);p&&Object.defineProperty(i,h,p.get?p:{enumerable:!0,get:()=>d[h]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))d(h);new MutationObserver(h=>{for(const p of h)if(p.type==="childList")for(const C of p.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&d(C)}).observe(document,{childList:!0,subtree:!0});function f(h){const p={};return h.integrity&&(p.integrity=h.integrity),h.referrerPolicy&&(p.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?p.credentials="include":h.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function d(h){if(h.ep)return;h.ep=!0;const p=f(h);fetch(h.href,p)}})();function om(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Wc={exports:{}},oi={};var ap;function im(){if(ap)return oi;ap=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function f(d,h,p){var C=null;if(p!==void 0&&(C=""+p),h.key!==void 0&&(C=""+h.key),"key"in h){p={};for(var D in h)D!=="key"&&(p[D]=h[D])}else p=h;return h=p.ref,{$$typeof:i,type:d,key:C,ref:h!==void 0?h:null,props:p}}return oi.Fragment=c,oi.jsx=f,oi.jsxs=f,oi}var lp;function rm(){return lp||(lp=1,Wc.exports=im()),Wc.exports}var ci=rm(),Ic={exports:{}},Ve={};var op;function sm(){if(op)return Ve;op=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),C=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),_=Symbol.iterator;function q(x){return x===null||typeof x!="object"?null:(x=_&&x[_]||x["@@iterator"],typeof x=="function"?x:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,ie={};function K(x,O,ne){this.props=x,this.context=O,this.refs=ie,this.updater=ne||B}K.prototype.isReactComponent={},K.prototype.setState=function(x,O){if(typeof x!="object"&&typeof x!="function"&&x!=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,x,O,"setState")},K.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function ue(){}ue.prototype=K.prototype;function Q(x,O,ne){this.props=x,this.context=O,this.refs=ie,this.updater=ne||B}var oe=Q.prototype=new ue;oe.constructor=Q,G(oe,K.prototype),oe.isPureReactComponent=!0;var X=Array.isArray;function ee(){}var te={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function j(x,O,ne){var se=ne.ref;return{$$typeof:i,type:x,key:O,ref:se!==void 0?se:null,props:ne}}function W(x,O){return j(x.type,O,x.props)}function pe(x){return typeof x=="object"&&x!==null&&x.$$typeof===i}function ye(x){var O={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(ne){return O[ne]})}var me=/\/+/g;function re(x,O){return typeof x=="object"&&x!==null&&x.key!=null?ye(""+x.key):O.toString(36)}function Be(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status=="string"?x.then(ee,ee):(x.status="pending",x.then(function(O){x.status==="pending"&&(x.status="fulfilled",x.value=O)},function(O){x.status==="pending"&&(x.status="rejected",x.reason=O)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function A(x,O,ne,se,ve){var Te=typeof x;(Te==="undefined"||Te==="boolean")&&(x=null);var qe=!1;if(x===null)qe=!0;else switch(Te){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(x.$$typeof){case i:case c:qe=!0;break;case T:return qe=x._init,A(qe(x._payload),O,ne,se,ve)}}if(qe)return ve=ve(x),qe=se===""?"."+re(x,0):se,X(ve)?(ne="",qe!=null&&(ne=qe.replace(me,"$&/")+"/"),A(ve,O,ne,"",function($t){return $t})):ve!=null&&(pe(ve)&&(ve=W(ve,ne+(ve.key==null||x&&x.key===ve.key?"":(""+ve.key).replace(me,"$&/")+"/")+qe)),O.push(ve)),1;qe=0;var lt=se===""?".":se+":";if(X(x))for(var _e=0;_e<x.length;_e++)se=x[_e],Te=lt+re(se,_e),qe+=A(se,O,ne,Te,ve);else if(_e=q(x),typeof _e=="function")for(x=_e.call(x),_e=0;!(se=x.next()).done;)se=se.value,Te=lt+re(se,_e++),qe+=A(se,O,ne,Te,ve);else if(Te==="object"){if(typeof x.then=="function")return A(Be(x),O,ne,se,ve);throw O=String(x),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return qe}function Z(x,O,ne){if(x==null)return x;var se=[],ve=0;return A(x,se,"","",function(Te){return O.call(ne,Te,ve++)}),se}function I(x){if(x._status===-1){var O=x._result;O=O(),O.then(function(ne){(x._status===0||x._status===-1)&&(x._status=1,x._result=ne)},function(ne){(x._status===0||x._status===-1)&&(x._status=2,x._result=ne)}),x._status===-1&&(x._status=0,x._result=O)}if(x._status===1)return x._result.default;throw x._result}var Ee=typeof reportError=="function"?reportError:function(x){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof x=="object"&&x!==null&&typeof x.message=="string"?String(x.message):String(x),error:x});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",x);return}console.error(x)},De={map:Z,forEach:function(x,O,ne){Z(x,function(){O.apply(this,arguments)},ne)},count:function(x){var O=0;return Z(x,function(){O++}),O},toArray:function(x){return Z(x,function(O){return O})||[]},only:function(x){if(!pe(x))throw Error("React.Children.only expected to receive a single React element child.");return x}};return Ve.Activity=z,Ve.Children=De,Ve.Component=K,Ve.Fragment=f,Ve.Profiler=h,Ve.PureComponent=Q,Ve.StrictMode=d,Ve.Suspense=w,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=te,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(x){return te.H.useMemoCache(x)}},Ve.cache=function(x){return function(){return x.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(x,O,ne){if(x==null)throw Error("The argument must be a React element, but you passed "+x+".");var se=G({},x.props),ve=x.key;if(O!=null)for(Te in O.key!==void 0&&(ve=""+O.key),O)!le.call(O,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&O.ref===void 0||(se[Te]=O[Te]);var Te=arguments.length-2;if(Te===1)se.children=ne;else if(1<Te){for(var qe=Array(Te),lt=0;lt<Te;lt++)qe[lt]=arguments[lt+2];se.children=qe}return j(x.type,ve,se)},Ve.createContext=function(x){return x={$$typeof:C,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null},x.Provider=x,x.Consumer={$$typeof:p,_context:x},x},Ve.createElement=function(x,O,ne){var se,ve={},Te=null;if(O!=null)for(se in O.key!==void 0&&(Te=""+O.key),O)le.call(O,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ve[se]=O[se]);var qe=arguments.length-2;if(qe===1)ve.children=ne;else if(1<qe){for(var lt=Array(qe),_e=0;_e<qe;_e++)lt[_e]=arguments[_e+2];ve.children=lt}if(x&&x.defaultProps)for(se in qe=x.defaultProps,qe)ve[se]===void 0&&(ve[se]=qe[se]);return j(x,Te,ve)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(x){return{$$typeof:D,render:x}},Ve.isValidElement=pe,Ve.lazy=function(x){return{$$typeof:T,_payload:{_status:-1,_result:x},_init:I}},Ve.memo=function(x,O){return{$$typeof:y,type:x,compare:O===void 0?null:O}},Ve.startTransition=function(x){var O=te.T,ne={};te.T=ne;try{var se=x(),ve=te.S;ve!==null&&ve(ne,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(ee,Ee)}catch(Te){Ee(Te)}finally{O!==null&&ne.types!==null&&(O.types=ne.types),te.T=O}},Ve.unstable_useCacheRefresh=function(){return te.H.useCacheRefresh()},Ve.use=function(x){return te.H.use(x)},Ve.useActionState=function(x,O,ne){return te.H.useActionState(x,O,ne)},Ve.useCallback=function(x,O){return te.H.useCallback(x,O)},Ve.useContext=function(x){return te.H.useContext(x)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(x,O){return te.H.useDeferredValue(x,O)},Ve.useEffect=function(x,O){return te.H.useEffect(x,O)},Ve.useEffectEvent=function(x){return te.H.useEffectEvent(x)},Ve.useId=function(){return te.H.useId()},Ve.useImperativeHandle=function(x,O,ne){return te.H.useImperativeHandle(x,O,ne)},Ve.useInsertionEffect=function(x,O){return te.H.useInsertionEffect(x,O)},Ve.useLayoutEffect=function(x,O){return te.H.useLayoutEffect(x,O)},Ve.useMemo=function(x,O){return te.H.useMemo(x,O)},Ve.useOptimistic=function(x,O){return te.H.useOptimistic(x,O)},Ve.useReducer=function(x,O,ne){return te.H.useReducer(x,O,ne)},Ve.useRef=function(x){return te.H.useRef(x)},Ve.useState=function(x){return te.H.useState(x)},Ve.useSyncExternalStore=function(x,O,ne){return te.H.useSyncExternalStore(x,O,ne)},Ve.useTransition=function(){return te.H.useTransition()},Ve.version="19.2.4",Ve}var ip;function du(){return ip||(ip=1,Ic.exports=sm()),Ic.exports}var v=du();const ft=om(v),rp=lm({__proto__:null,default:ft},[v]);function cm(i){if(i.sheet)return i.sheet;for(var c=0;c<document.styleSheets.length;c++)if(document.styleSheets[c].ownerNode===i)return document.styleSheets[c]}function um(i){var c=document.createElement("style");return c.setAttribute("data-emotion",i.key),i.nonce!==void 0&&c.setAttribute("nonce",i.nonce),c.appendChild(document.createTextNode("")),c.setAttribute("data-s",""),c}var dm=(function(){function i(f){var d=this;this._insertTag=function(h){var p;d.tags.length===0?d.insertionPoint?p=d.insertionPoint.nextSibling:d.prepend?p=d.container.firstChild:p=d.before:p=d.tags[d.tags.length-1].nextSibling,d.container.insertBefore(h,p),d.tags.push(h)},this.isSpeedy=f.speedy===void 0?!0:f.speedy,this.tags=[],this.ctr=0,this.nonce=f.nonce,this.key=f.key,this.container=f.container,this.prepend=f.prepend,this.insertionPoint=f.insertionPoint,this.before=null}var c=i.prototype;return c.hydrate=function(d){d.forEach(this._insertTag)},c.insert=function(d){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(um(this));var h=this.tags[this.tags.length-1];if(this.isSpeedy){var p=cm(h);try{p.insertRule(d,p.cssRules.length)}catch{}}else h.appendChild(document.createTextNode(d));this.ctr++},c.flush=function(){this.tags.forEach(function(d){var h;return(h=d.parentNode)==null?void 0:h.removeChild(d)}),this.tags=[],this.ctr=0},i})(),sn="-ms-",Br="-moz-",st="-webkit-",Lp="comm",fu="rule",hu="decl",fm="@import",_p="@keyframes",hm="@layer",pm=Math.abs,Nr=String.fromCharCode,gm=Object.assign;function mm(i,c){return ln(i,0)^45?(((c<<2^ln(i,0))<<2^ln(i,1))<<2^ln(i,2))<<2^ln(i,3):0}function Op(i){return i.trim()}function ym(i,c){return(i=c.exec(i))?i[0]:i}function ct(i,c,f){return i.replace(c,f)}function su(i,c){return i.indexOf(c)}function ln(i,c){return i.charCodeAt(c)|0}function ui(i,c,f){return i.slice(c,f)}function In(i){return i.length}function pu(i){return i.length}function Lr(i,c){return c.push(i),i}function bm(i,c){return i.map(c).join("")}var jr=1,so=1,Hp=0,vn=0,Zt=0,uo="";function qr(i,c,f,d,h,p,C){return{value:i,root:c,parent:f,type:d,props:h,children:p,line:jr,column:so,length:C,return:""}}function ii(i,c){return gm(qr("",null,null,"",null,null,0),i,{length:-i.length},c)}function vm(){return Zt}function xm(){return Zt=vn>0?ln(uo,--vn):0,so--,Zt===10&&(so=1,jr--),Zt}function En(){return Zt=vn<Hp?ln(uo,vn++):0,so++,Zt===10&&(so=1,jr++),Zt}function ea(){return ln(uo,vn)}function _r(){return vn}function hi(i,c){return ui(uo,i,c)}function di(i){switch(i){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Bp(i){return jr=so=1,Hp=In(uo=i),vn=0,[]}function Up(i){return uo="",i}function Or(i){return Op(hi(vn-1,cu(i===91?i+2:i===40?i+1:i)))}function Sm(i){for(;(Zt=ea())&&Zt<33;)En();return di(i)>2||di(Zt)>3?"":" "}function wm(i,c){for(;--c&&En()&&!(Zt<48||Zt>102||Zt>57&&Zt<65||Zt>70&&Zt<97););return hi(i,_r()+(c<6&&ea()==32&&En()==32))}function cu(i){for(;En();)switch(Zt){case i:return vn;case 34:case 39:i!==34&&i!==39&&cu(Zt);break;case 40:i===41&&cu(i);break;case 92:En();break}return vn}function Cm(i,c){for(;En()&&i+Zt!==57;)if(i+Zt===84&&ea()===47)break;return"/*"+hi(c,vn-1)+"*"+Nr(i===47?i:En())}function km(i){for(;!di(ea());)En();return hi(i,vn)}function zm(i){return Up(Hr("",null,null,null,[""],i=Bp(i),0,[0],i))}function Hr(i,c,f,d,h,p,C,D,w){for(var y=0,T=0,z=C,_=0,q=0,B=0,G=1,ie=1,K=1,ue=0,Q="",oe=h,X=p,ee=d,te=Q;ie;)switch(B=ue,ue=En()){case 40:if(B!=108&&ln(te,z-1)==58){su(te+=ct(Or(ue),"&","&\f"),"&\f")!=-1&&(K=-1);break}case 34:case 39:case 91:te+=Or(ue);break;case 9:case 10:case 13:case 32:te+=Sm(B);break;case 92:te+=wm(_r()-1,7);continue;case 47:switch(ea()){case 42:case 47:Lr(Mm(Cm(En(),_r()),c,f),w);break;default:te+="/"}break;case 123*G:D[y++]=In(te)*K;case 125*G:case 59:case 0:switch(ue){case 0:case 125:ie=0;case 59+T:K==-1&&(te=ct(te,/\f/g,"")),q>0&&In(te)-z&&Lr(q>32?cp(te+";",d,f,z-1):cp(ct(te," ","")+";",d,f,z-2),w);break;case 59:te+=";";default:if(Lr(ee=sp(te,c,f,y,T,h,D,Q,oe=[],X=[],z),p),ue===123)if(T===0)Hr(te,c,ee,ee,oe,p,z,D,X);else switch(_===99&&ln(te,3)===110?100:_){case 100:case 108:case 109:case 115:Hr(i,ee,ee,d&&Lr(sp(i,ee,ee,0,0,h,D,Q,h,oe=[],z),X),h,X,z,D,d?oe:X);break;default:Hr(te,ee,ee,ee,[""],X,0,D,X)}}y=T=q=0,G=K=1,Q=te="",z=C;break;case 58:z=1+In(te),q=B;default:if(G<1){if(ue==123)--G;else if(ue==125&&G++==0&&xm()==125)continue}switch(te+=Nr(ue),ue*G){case 38:K=T>0?1:(te+="\f",-1);break;case 44:D[y++]=(In(te)-1)*K,K=1;break;case 64:ea()===45&&(te+=Or(En())),_=ea(),T=z=In(Q=te+=km(_r())),ue++;break;case 45:B===45&&In(te)==2&&(G=0)}}return p}function sp(i,c,f,d,h,p,C,D,w,y,T){for(var z=h-1,_=h===0?p:[""],q=pu(_),B=0,G=0,ie=0;B<d;++B)for(var K=0,ue=ui(i,z+1,z=pm(G=C[B])),Q=i;K<q;++K)(Q=Op(G>0?_[K]+" "+ue:ct(ue,/&\f/g,_[K])))&&(w[ie++]=Q);return qr(i,c,f,h===0?fu:D,w,y,T)}function Mm(i,c,f){return qr(i,c,f,Lp,Nr(vm()),ui(i,2,-2),0)}function cp(i,c,f,d){return qr(i,c,f,hu,ui(i,0,d),ui(i,d+1,-1),d)}function io(i,c){for(var f="",d=pu(i),h=0;h<d;h++)f+=c(i[h],h,i,c)||"";return f}function Dm(i,c,f,d){switch(i.type){case hm:if(i.children.length)break;case fm:case hu:return i.return=i.return||i.value;case Lp:return"";case _p:return i.return=i.value+"{"+io(i.children,d)+"}";case fu:i.value=i.props.join(",")}return In(f=io(i.children,d))?i.return=i.value+"{"+f+"}":""}function Tm(i){var c=pu(i);return function(f,d,h,p){for(var C="",D=0;D<c;D++)C+=i[D](f,d,h,p)||"";return C}}function Am(i){return function(c){c.root||(c=c.return)&&i(c)}}function Em(i){var c=Object.create(null);return function(f){return c[f]===void 0&&(c[f]=i(f)),c[f]}}var Rm=function(c,f,d){for(var h=0,p=0;h=p,p=ea(),h===38&&p===12&&(f[d]=1),!di(p);)En();return hi(c,vn)},Lm=function(c,f){var d=-1,h=44;do switch(di(h)){case 0:h===38&&ea()===12&&(f[d]=1),c[d]+=Rm(vn-1,f,d);break;case 2:c[d]+=Or(h);break;case 4:if(h===44){c[++d]=ea()===58?"&\f":"",f[d]=c[d].length;break}default:c[d]+=Nr(h)}while(h=En());return c},_m=function(c,f){return Up(Lm(Bp(c),f))},up=new WeakMap,Om=function(c){if(!(c.type!=="rule"||!c.parent||c.length<1)){for(var f=c.value,d=c.parent,h=c.column===d.column&&c.line===d.line;d.type!=="rule";)if(d=d.parent,!d)return;if(!(c.props.length===1&&f.charCodeAt(0)!==58&&!up.get(d))&&!h){up.set(c,!0);for(var p=[],C=_m(f,p),D=d.props,w=0,y=0;w<C.length;w++)for(var T=0;T<D.length;T++,y++)c.props[y]=p[w]?C[w].replace(/&\f/g,D[T]):D[T]+" "+C[w]}}},Hm=function(c){if(c.type==="decl"){var f=c.value;f.charCodeAt(0)===108&&f.charCodeAt(2)===98&&(c.return="",c.value="")}};function Np(i,c){switch(mm(i,c)){case 5103:return st+"print-"+i+i;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return st+i+i;case 5349:case 4246:case 4810:case 6968:case 2756:return st+i+Br+i+sn+i+i;case 6828:case 4268:return st+i+sn+i+i;case 6165:return st+i+sn+"flex-"+i+i;case 5187:return st+i+ct(i,/(\w+).+(:[^]+)/,st+"box-$1$2"+sn+"flex-$1$2")+i;case 5443:return st+i+sn+"flex-item-"+ct(i,/flex-|-self/,"")+i;case 4675:return st+i+sn+"flex-line-pack"+ct(i,/align-content|flex-|-self/,"")+i;case 5548:return st+i+sn+ct(i,"shrink","negative")+i;case 5292:return st+i+sn+ct(i,"basis","preferred-size")+i;case 6060:return st+"box-"+ct(i,"-grow","")+st+i+sn+ct(i,"grow","positive")+i;case 4554:return st+ct(i,/([^-])(transform)/g,"$1"+st+"$2")+i;case 6187:return ct(ct(ct(i,/(zoom-|grab)/,st+"$1"),/(image-set)/,st+"$1"),i,"")+i;case 5495:case 3959:return ct(i,/(image-set\([^]*)/,st+"$1$`$1");case 4968:return ct(ct(i,/(.+:)(flex-)?(.*)/,st+"box-pack:$3"+sn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+st+i+i;case 4095:case 3583:case 4068:case 2532:return ct(i,/(.+)-inline(.+)/,st+"$1$2")+i;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(In(i)-1-c>6)switch(ln(i,c+1)){case 109:if(ln(i,c+4)!==45)break;case 102:return ct(i,/(.+:)(.+)-([^]+)/,"$1"+st+"$2-$3$1"+Br+(ln(i,c+3)==108?"$3":"$2-$3"))+i;case 115:return~su(i,"stretch")?Np(ct(i,"stretch","fill-available"),c)+i:i}break;case 4949:if(ln(i,c+1)!==115)break;case 6444:switch(ln(i,In(i)-3-(~su(i,"!important")&&10))){case 107:return ct(i,":",":"+st)+i;case 101:return ct(i,/(.+:)([^;!]+)(;|!.+)?/,"$1"+st+(ln(i,14)===45?"inline-":"")+"box$3$1"+st+"$2$3$1"+sn+"$2box$3")+i}break;case 5936:switch(ln(i,c+11)){case 114:return st+i+sn+ct(i,/[svh]\w+-[tblr]{2}/,"tb")+i;case 108:return st+i+sn+ct(i,/[svh]\w+-[tblr]{2}/,"tb-rl")+i;case 45:return st+i+sn+ct(i,/[svh]\w+-[tblr]{2}/,"lr")+i}return st+i+sn+i+i}return i}var Bm=function(c,f,d,h){if(c.length>-1&&!c.return)switch(c.type){case hu:c.return=Np(c.value,c.length);break;case _p:return io([ii(c,{value:ct(c.value,"@","@"+st)})],h);case fu:if(c.length)return bm(c.props,function(p){switch(ym(p,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return io([ii(c,{props:[ct(p,/:(read-\w+)/,":"+Br+"$1")]})],h);case"::placeholder":return io([ii(c,{props:[ct(p,/:(plac\w+)/,":"+st+"input-$1")]}),ii(c,{props:[ct(p,/:(plac\w+)/,":"+Br+"$1")]}),ii(c,{props:[ct(p,/:(plac\w+)/,sn+"input-$1")]})],h)}return""})}},Um=[Bm],Nm=function(c){var f=c.key;if(f==="css"){var d=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(d,function(G){var ie=G.getAttribute("data-emotion");ie.indexOf(" ")!==-1&&(document.head.appendChild(G),G.setAttribute("data-s",""))})}var h=c.stylisPlugins||Um,p={},C,D=[];C=c.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+f+' "]'),function(G){for(var ie=G.getAttribute("data-emotion").split(" "),K=1;K<ie.length;K++)p[ie[K]]=!0;D.push(G)});var w,y=[Om,Hm];{var T,z=[Dm,Am(function(G){T.insert(G)})],_=Tm(y.concat(h,z)),q=function(ie){return io(zm(ie),_)};w=function(ie,K,ue,Q){T=ue,q(ie?ie+"{"+K.styles+"}":K.styles),Q&&(B.inserted[K.name]=!0)}}var B={key:f,sheet:new dm({key:f,container:C,nonce:c.nonce,speedy:c.speedy,prepend:c.prepend,insertionPoint:c.insertionPoint}),nonce:c.nonce,inserted:p,registered:{},insert:w};return B.sheet.hydrate(D),B},Pc={exports:{}},dt={};var dp;function jm(){if(dp)return dt;dp=1;var i=typeof Symbol=="function"&&Symbol.for,c=i?Symbol.for("react.element"):60103,f=i?Symbol.for("react.portal"):60106,d=i?Symbol.for("react.fragment"):60107,h=i?Symbol.for("react.strict_mode"):60108,p=i?Symbol.for("react.profiler"):60114,C=i?Symbol.for("react.provider"):60109,D=i?Symbol.for("react.context"):60110,w=i?Symbol.for("react.async_mode"):60111,y=i?Symbol.for("react.concurrent_mode"):60111,T=i?Symbol.for("react.forward_ref"):60112,z=i?Symbol.for("react.suspense"):60113,_=i?Symbol.for("react.suspense_list"):60120,q=i?Symbol.for("react.memo"):60115,B=i?Symbol.for("react.lazy"):60116,G=i?Symbol.for("react.block"):60121,ie=i?Symbol.for("react.fundamental"):60117,K=i?Symbol.for("react.responder"):60118,ue=i?Symbol.for("react.scope"):60119;function Q(X){if(typeof X=="object"&&X!==null){var ee=X.$$typeof;switch(ee){case c:switch(X=X.type,X){case w:case y:case d:case p:case h:case z:return X;default:switch(X=X&&X.$$typeof,X){case D:case T:case B:case q:case C:return X;default:return ee}}case f:return ee}}}function oe(X){return Q(X)===y}return dt.AsyncMode=w,dt.ConcurrentMode=y,dt.ContextConsumer=D,dt.ContextProvider=C,dt.Element=c,dt.ForwardRef=T,dt.Fragment=d,dt.Lazy=B,dt.Memo=q,dt.Portal=f,dt.Profiler=p,dt.StrictMode=h,dt.Suspense=z,dt.isAsyncMode=function(X){return oe(X)||Q(X)===w},dt.isConcurrentMode=oe,dt.isContextConsumer=function(X){return Q(X)===D},dt.isContextProvider=function(X){return Q(X)===C},dt.isElement=function(X){return typeof X=="object"&&X!==null&&X.$$typeof===c},dt.isForwardRef=function(X){return Q(X)===T},dt.isFragment=function(X){return Q(X)===d},dt.isLazy=function(X){return Q(X)===B},dt.isMemo=function(X){return Q(X)===q},dt.isPortal=function(X){return Q(X)===f},dt.isProfiler=function(X){return Q(X)===p},dt.isStrictMode=function(X){return Q(X)===h},dt.isSuspense=function(X){return Q(X)===z},dt.isValidElementType=function(X){return typeof X=="string"||typeof X=="function"||X===d||X===y||X===p||X===h||X===z||X===_||typeof X=="object"&&X!==null&&(X.$$typeof===B||X.$$typeof===q||X.$$typeof===C||X.$$typeof===D||X.$$typeof===T||X.$$typeof===ie||X.$$typeof===K||X.$$typeof===ue||X.$$typeof===G)},dt.typeOf=Q,dt}var fp;function qm(){return fp||(fp=1,Pc.exports=jm()),Pc.exports}var eu,hp;function Ym(){if(hp)return eu;hp=1;var i=qm(),c={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},f={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},d={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},h={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},p={};p[i.ForwardRef]=d,p[i.Memo]=h;function C(B){return i.isMemo(B)?h:p[B.$$typeof]||c}var D=Object.defineProperty,w=Object.getOwnPropertyNames,y=Object.getOwnPropertySymbols,T=Object.getOwnPropertyDescriptor,z=Object.getPrototypeOf,_=Object.prototype;function q(B,G,ie){if(typeof G!="string"){if(_){var K=z(G);K&&K!==_&&q(B,K,ie)}var ue=w(G);y&&(ue=ue.concat(y(G)));for(var Q=C(B),oe=C(G),X=0;X<ue.length;++X){var ee=ue[X];if(!f[ee]&&!(ie&&ie[ee])&&!(oe&&oe[ee])&&!(Q&&Q[ee])){var te=T(G,ee);try{D(B,ee,te)}catch{}}}}return B}return eu=q,eu}Ym();var Gm=!0;function Xm(i,c,f){var d="";return f.split(" ").forEach(function(h){i[h]!==void 0?c.push(i[h]+";"):h&&(d+=h+" ")}),d}var jp=function(c,f,d){var h=c.key+"-"+f.name;(d===!1||Gm===!1)&&c.registered[h]===void 0&&(c.registered[h]=f.styles)},Vm=function(c,f,d){jp(c,f,d);var h=c.key+"-"+f.name;if(c.inserted[f.name]===void 0){var p=f;do c.insert(f===p?"."+h:"",p,c.sheet,!0),p=p.next;while(p!==void 0)}};function Qm(i){for(var c=0,f,d=0,h=i.length;h>=4;++d,h-=4)f=i.charCodeAt(d)&255|(i.charCodeAt(++d)&255)<<8|(i.charCodeAt(++d)&255)<<16|(i.charCodeAt(++d)&255)<<24,f=(f&65535)*1540483477+((f>>>16)*59797<<16),f^=f>>>24,c=(f&65535)*1540483477+((f>>>16)*59797<<16)^(c&65535)*1540483477+((c>>>16)*59797<<16);switch(h){case 3:c^=(i.charCodeAt(d+2)&255)<<16;case 2:c^=(i.charCodeAt(d+1)&255)<<8;case 1:c^=i.charCodeAt(d)&255,c=(c&65535)*1540483477+((c>>>16)*59797<<16)}return c^=c>>>13,c=(c&65535)*1540483477+((c>>>16)*59797<<16),((c^c>>>15)>>>0).toString(36)}var Fm={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Km=/[A-Z]|^ms/g,Zm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,qp=function(c){return c.charCodeAt(1)===45},pp=function(c){return c!=null&&typeof c!="boolean"},tu=Em(function(i){return qp(i)?i:i.replace(Km,"-$&").toLowerCase()}),gp=function(c,f){switch(c){case"animation":case"animationName":if(typeof f=="string")return f.replace(Zm,function(d,h,p){return Pn={name:h,styles:p,next:Pn},h})}return Fm[c]!==1&&!qp(c)&&typeof f=="number"&&f!==0?f+"px":f};function fi(i,c,f){if(f==null)return"";var d=f;if(d.__emotion_styles!==void 0)return d;switch(typeof f){case"boolean":return"";case"object":{var h=f;if(h.anim===1)return Pn={name:h.name,styles:h.styles,next:Pn},h.name;var p=f;if(p.styles!==void 0){var C=p.next;if(C!==void 0)for(;C!==void 0;)Pn={name:C.name,styles:C.styles,next:Pn},C=C.next;var D=p.styles+";";return D}return Jm(i,c,f)}case"function":{if(i!==void 0){var w=Pn,y=f(i);return Pn=w,fi(i,c,y)}break}}var T=f;return T}function Jm(i,c,f){var d="";if(Array.isArray(f))for(var h=0;h<f.length;h++)d+=fi(i,c,f[h])+";";else for(var p in f){var C=f[p];if(typeof C!="object"){var D=C;pp(D)&&(d+=tu(p)+":"+gp(p,D)+";")}else if(Array.isArray(C)&&typeof C[0]=="string"&&c==null)for(var w=0;w<C.length;w++)pp(C[w])&&(d+=tu(p)+":"+gp(p,C[w])+";");else{var y=fi(i,c,C);switch(p){case"animation":case"animationName":{d+=tu(p)+":"+y+";";break}default:d+=p+"{"+y+"}"}}}return d}var mp=/label:\s*([^\s;{]+)\s*(;|$)/g,Pn;function Yp(i,c,f){if(i.length===1&&typeof i[0]=="object"&&i[0]!==null&&i[0].styles!==void 0)return i[0];var d=!0,h="";Pn=void 0;var p=i[0];if(p==null||p.raw===void 0)d=!1,h+=fi(f,c,p);else{var C=p;h+=C[0]}for(var D=1;D<i.length;D++)if(h+=fi(f,c,i[D]),d){var w=p;h+=w[D]}mp.lastIndex=0;for(var y="",T;(T=mp.exec(h))!==null;)y+="-"+T[1];var z=Qm(h)+y;return{name:z,styles:h,next:Pn}}var $m=function(c){return c()},Wm=rp.useInsertionEffect?rp.useInsertionEffect:!1,Im=Wm||$m,Gp=v.createContext(typeof HTMLElement<"u"?Nm({key:"css"}):null);Gp.Provider;var Pm=function(c){return v.forwardRef(function(f,d){var h=v.useContext(Gp);return c(f,h,d)})},e1=v.createContext({}),pi={}.hasOwnProperty,uu="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",gu=function(c,f){var d={};for(var h in f)pi.call(f,h)&&(d[h]=f[h]);return d[uu]=c,d},t1=function(c){var f=c.cache,d=c.serialized,h=c.isStringTag;return jp(f,d,h),Im(function(){return Vm(f,d,h)}),null},n1=Pm(function(i,c,f){var d=i.css;typeof d=="string"&&c.registered[d]!==void 0&&(d=c.registered[d]);var h=i[uu],p=[d],C="";typeof i.className=="string"?C=Xm(c.registered,p,i.className):i.className!=null&&(C=i.className+" ");var D=Yp(p,void 0,v.useContext(e1));C+=c.key+"-"+D.name;var w={};for(var y in i)pi.call(i,y)&&y!=="css"&&y!==uu&&(w[y]=i[y]);return w.className=C,f&&(w.ref=f),v.createElement(v.Fragment,null,v.createElement(t1,{cache:c,serialized:D,isStringTag:typeof h=="string"}),v.createElement(h,w))}),mu=n1,tt=ci.Fragment,r=function(c,f,d){return pi.call(f,"css")?ci.jsx(mu,gu(c,f),d):ci.jsx(c,f,d)},b=function(c,f,d){return pi.call(f,"css")?ci.jsxs(mu,gu(c,f),d):ci.jsxs(c,f,d)},nu={exports:{}},ri={},au={exports:{}},lu={};var yp;function a1(){return yp||(yp=1,(function(i){function c(A,Z){var I=A.length;A.push(Z);e:for(;0<I;){var Ee=I-1>>>1,De=A[Ee];if(0<h(De,Z))A[Ee]=Z,A[I]=De,I=Ee;else break e}}function f(A){return A.length===0?null:A[0]}function d(A){if(A.length===0)return null;var Z=A[0],I=A.pop();if(I!==Z){A[0]=I;e:for(var Ee=0,De=A.length,x=De>>>1;Ee<x;){var O=2*(Ee+1)-1,ne=A[O],se=O+1,ve=A[se];if(0>h(ne,I))se<De&&0>h(ve,ne)?(A[Ee]=ve,A[se]=I,Ee=se):(A[Ee]=ne,A[O]=I,Ee=O);else if(se<De&&0>h(ve,I))A[Ee]=ve,A[se]=I,Ee=se;else break e}}return Z}function h(A,Z){var I=A.sortIndex-Z.sortIndex;return I!==0?I:A.id-Z.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;i.unstable_now=function(){return p.now()}}else{var C=Date,D=C.now();i.unstable_now=function(){return C.now()-D}}var w=[],y=[],T=1,z=null,_=3,q=!1,B=!1,G=!1,ie=!1,K=typeof setTimeout=="function"?setTimeout:null,ue=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function oe(A){for(var Z=f(y);Z!==null;){if(Z.callback===null)d(y);else if(Z.startTime<=A)d(y),Z.sortIndex=Z.expirationTime,c(w,Z);else break;Z=f(y)}}function X(A){if(G=!1,oe(A),!B)if(f(w)!==null)B=!0,ee||(ee=!0,ye());else{var Z=f(y);Z!==null&&Be(X,Z.startTime-A)}}var ee=!1,te=-1,le=5,j=-1;function W(){return ie?!0:!(i.unstable_now()-j<le)}function pe(){if(ie=!1,ee){var A=i.unstable_now();j=A;var Z=!0;try{e:{B=!1,G&&(G=!1,ue(te),te=-1),q=!0;var I=_;try{t:{for(oe(A),z=f(w);z!==null&&!(z.expirationTime>A&&W());){var Ee=z.callback;if(typeof Ee=="function"){z.callback=null,_=z.priorityLevel;var De=Ee(z.expirationTime<=A);if(A=i.unstable_now(),typeof De=="function"){z.callback=De,oe(A),Z=!0;break t}z===f(w)&&d(w),oe(A)}else d(w);z=f(w)}if(z!==null)Z=!0;else{var x=f(y);x!==null&&Be(X,x.startTime-A),Z=!1}}break e}finally{z=null,_=I,q=!1}Z=void 0}}finally{Z?ye():ee=!1}}}var ye;if(typeof Q=="function")ye=function(){Q(pe)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,re=me.port2;me.port1.onmessage=pe,ye=function(){re.postMessage(null)}}else ye=function(){K(pe,0)};function Be(A,Z){te=K(function(){A(i.unstable_now())},Z)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(A){A.callback=null},i.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"):le=0<A?Math.floor(1e3/A):5},i.unstable_getCurrentPriorityLevel=function(){return _},i.unstable_next=function(A){switch(_){case 1:case 2:case 3:var Z=3;break;default:Z=_}var I=_;_=Z;try{return A()}finally{_=I}},i.unstable_requestPaint=function(){ie=!0},i.unstable_runWithPriority=function(A,Z){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var I=_;_=A;try{return Z()}finally{_=I}},i.unstable_scheduleCallback=function(A,Z,I){var Ee=i.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?Ee+I:Ee):I=Ee,A){case 1:var De=-1;break;case 2:De=250;break;case 5:De=1073741823;break;case 4:De=1e4;break;default:De=5e3}return De=I+De,A={id:T++,callback:Z,priorityLevel:A,startTime:I,expirationTime:De,sortIndex:-1},I>Ee?(A.sortIndex=I,c(y,A),f(w)===null&&A===f(y)&&(G?(ue(te),te=-1):G=!0,Be(X,I-Ee))):(A.sortIndex=De,c(w,A),B||q||(B=!0,ee||(ee=!0,ye()))),A},i.unstable_shouldYield=W,i.unstable_wrapCallback=function(A){var Z=_;return function(){var I=_;_=Z;try{return A.apply(this,arguments)}finally{_=I}}}})(lu)),lu}var bp;function l1(){return bp||(bp=1,au.exports=a1()),au.exports}var ou={exports:{}},rn={};var vp;function o1(){if(vp)return rn;vp=1;var i=du();function c(w){var y="https://react.dev/errors/"+w;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)y+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+w+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var d={d:{f,r:function(){throw Error(c(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},h=Symbol.for("react.portal");function p(w,y,T){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:z==null?null:""+z,children:w,containerInfo:y,implementation:T}}var C=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function D(w,y){if(w==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,rn.createPortal=function(w,y){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(c(299));return p(w,y,null,T)},rn.flushSync=function(w){var y=C.T,T=d.p;try{if(C.T=null,d.p=2,w)return w()}finally{C.T=y,d.p=T,d.d.f()}},rn.preconnect=function(w,y){typeof w=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,d.d.C(w,y))},rn.prefetchDNS=function(w){typeof w=="string"&&d.d.D(w)},rn.preinit=function(w,y){if(typeof w=="string"&&y&&typeof y.as=="string"){var T=y.as,z=D(T,y.crossOrigin),_=typeof y.integrity=="string"?y.integrity:void 0,q=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;T==="style"?d.d.S(w,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:z,integrity:_,fetchPriority:q}):T==="script"&&d.d.X(w,{crossOrigin:z,integrity:_,fetchPriority:q,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},rn.preinitModule=function(w,y){if(typeof w=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var T=D(y.as,y.crossOrigin);d.d.M(w,{crossOrigin:T,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&d.d.M(w)},rn.preload=function(w,y){if(typeof w=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var T=y.as,z=D(T,y.crossOrigin);d.d.L(w,T,{crossOrigin:z,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},rn.preloadModule=function(w,y){if(typeof w=="string")if(y){var T=D(y.as,y.crossOrigin);d.d.m(w,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:T,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else d.d.m(w)},rn.requestFormReset=function(w){d.d.r(w)},rn.unstable_batchedUpdates=function(w,y){return w(y)},rn.useFormState=function(w,y,T){return C.H.useFormState(w,y,T)},rn.useFormStatus=function(){return C.H.useHostTransitionStatus()},rn.version="19.2.4",rn}var xp;function i1(){if(xp)return ou.exports;xp=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),ou.exports=o1(),ou.exports}var Sp;function r1(){if(Sp)return ri;Sp=1;var i=l1(),c=du(),f=i1();function d(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 h(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function p(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function C(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 D(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 w(e){if(p(e)!==e)throw Error(d(188))}function y(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(d(188));return t!==e?null:e}for(var n=e,a=t;;){var l=n.return;if(l===null)break;var o=l.alternate;if(o===null){if(a=l.return,a!==null){n=a;continue}break}if(l.child===o.child){for(o=l.child;o;){if(o===n)return w(l),e;if(o===a)return w(l),t;o=o.sibling}throw Error(d(188))}if(n.return!==a.return)n=l,a=o;else{for(var u=!1,g=l.child;g;){if(g===n){u=!0,n=l,a=o;break}if(g===a){u=!0,a=l,n=o;break}g=g.sibling}if(!u){for(g=o.child;g;){if(g===n){u=!0,n=o,a=l;break}if(g===a){u=!0,a=o,n=l;break}g=g.sibling}if(!u)throw Error(d(189))}}if(n.alternate!==a)throw Error(d(190))}if(n.tag!==3)throw Error(d(188));return n.stateNode.current===n?e:t}function T(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=T(e),t!==null)return t;e=e.sibling}return null}var z=Object.assign,_=Symbol.for("react.element"),q=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),ie=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),ue=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),pe=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=pe&&e[pe]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case G:return"Fragment";case K:return"Profiler";case ie:return"StrictMode";case X:return"Suspense";case ee:return"SuspenseList";case j:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case Q:return e.displayName||"Context";case ue:return(e._context.displayName||"Context")+".Consumer";case oe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:re(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var Be=Array.isArray,A=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},Ee=[],De=-1;function x(e){return{current:e}}function O(e){0>De||(e.current=Ee[De],Ee[De]=null,De--)}function ne(e,t){De++,Ee[De]=e.current,e.current=t}var se=x(null),ve=x(null),Te=x(null),qe=x(null);function lt(e,t){switch(ne(Te,t),ne(ve,e),ne(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Mh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Mh(t),e=Dh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(se),ne(se,e)}function _e(){O(se),O(ve),O(Te)}function $t(e){e.memoizedState!==null&&ne(qe,e);var t=se.current,n=Dh(t,e.type);t!==n&&(ne(ve,e),ne(se,n))}function Je(e){ve.current===e&&(O(se),O(ve)),qe.current===e&&(O(qe),ti._currentValue=I)}var ut,ht;function Bt(e){if(ut===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ut=t&&t[1]||"",ht=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ut+e+ht}var St=!1;function Dt(e,t){if(!e||St)return"";St=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(U){var L=U}Reflect.construct(e,[],F)}else{try{F.call()}catch(U){L=U}e.call(F.prototype)}}else{try{throw Error()}catch(U){L=U}(F=e())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(U){if(U&&L&&typeof U.stack=="string")return[U.stack,L.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=a.DetermineComponentFrameRoot(),u=o[0],g=o[1];if(u&&g){var S=u.split(`
4
+ `),R=g.split(`
5
+ `);for(l=a=0;a<S.length&&!S[a].includes("DetermineComponentFrameRoot");)a++;for(;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;if(a===S.length||l===R.length)for(a=S.length-1,l=R.length-1;1<=a&&0<=l&&S[a]!==R[l];)l--;for(;1<=a&&0<=l;a--,l--)if(S[a]!==R[l]){if(a!==1||l!==1)do if(a--,l--,0>l||S[a]!==R[l]){var Y=`
6
+ `+S[a].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=a&&0<=l);break}}}finally{St=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Bt(n):""}function mt(e,t){switch(e.tag){case 26:case 27:case 5:return Bt(e.type);case 16:return Bt("Lazy");case 13:return e.child!==t&&t!==null?Bt("Suspense Fallback"):Bt("Suspense");case 19:return Bt("SuspenseList");case 0:case 15:return Dt(e.type,!1);case 11:return Dt(e.type.render,!1);case 1:return Dt(e.type,!0);case 31:return Bt("Activity");default:return""}}function on(e){try{var t="",n=null;do t+=mt(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
7
+ Error generating stack: `+a.message+`
8
+ `+a.stack}}var Ut=Object.prototype.hasOwnProperty,Ie=i.unstable_scheduleCallback,Nt=i.unstable_cancelCallback,wt=i.unstable_shouldYield,Re=i.unstable_requestPaint,Tt=i.unstable_now,dn=i.unstable_getCurrentPriorityLevel,xn=i.unstable_ImmediatePriority,Sn=i.unstable_UserBlockingPriority,fn=i.unstable_NormalPriority,J=i.unstable_LowPriority,de=i.unstable_IdlePriority,Ge=i.log,Pe=i.unstable_setDisableYieldValue,H=null,ae=null;function Ae(e){if(typeof Ge=="function"&&Pe(e),ae&&typeof ae.setStrictMode=="function")try{ae.setStrictMode(H,e)}catch{}}var Xe=Math.clz32?Math.clz32:gi,Wt=Math.log,Yn=Math.LN2;function gi(e){return e>>>=0,e===0?32:31-(Wt(e)/Yn|0)|0}var Ca=256,ta=262144,Lt=4194304;function na(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 wl(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,o=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var g=a&134217727;return g!==0?(a=g&~o,a!==0?l=na(a):(u&=g,u!==0?l=na(u):n||(n=g&~e,n!==0&&(l=na(n))))):(g=a&~o,g!==0?l=na(g):u!==0?l=na(u):n||(n=a&~e,n!==0&&(l=na(n)))),l===0?0:t!==0&&t!==l&&(t&o)===0&&(o=l&-l,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:l}function el(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Gr(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 mi(){var e=Lt;return Lt<<=1,(Lt&62914560)===0&&(Lt=4194304),e}function fo(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xr(e,t,n,a,l,o){var u=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,S=e.expirationTimes,R=e.hiddenUpdates;for(n=u&~n;0<n;){var Y=31-Xe(n),F=1<<Y;g[Y]=0,S[Y]=-1;var L=R[Y];if(L!==null)for(R[Y]=null,Y=0;Y<L.length;Y++){var U=L[Y];U!==null&&(U.lane&=-536870913)}n&=~F}a!==0&&yi(e,a,0),o!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=o&~(u&~t))}function yi(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Xe(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function bi(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Xe(n),l=1<<a;l&t|e[a]&t&&(e[a]|=t),n&=~l}}function ho(e,t){var n=t&-t;return n=(n&42)!==0?1:aa(n),(n&(e.suspendedLanes|t))!==0?0:n}function aa(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 po(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function vi(){var e=Z.p;return e!==0?e:(e=window.event,e===void 0?32:$h(e.type))}function Gn(e,t){var n=Z.p;try{return Z.p=e,t()}finally{Z.p=n}}var Kn=Math.random().toString(36).slice(2),At="__reactFiber$"+Kn,jt="__reactProps$"+Kn,wn="__reactContainer$"+Kn,Cl="__reactEvents$"+Kn,ka="__reactListeners$"+Kn,za="__reactHandles$"+Kn,go="__reactResources$"+Kn,nl="__reactMarker$"+Kn;function mo(e){delete e[At],delete e[jt],delete e[Cl],delete e[ka],delete e[za]}function la(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wn]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Oh(e);e!==null;){if(n=e[At])return n;e=Oh(e)}return t}e=n,n=e.parentNode}return null}function ge(e){if(e=e[At]||e[wn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ce(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function xe(e){var t=e[go];return t||(t=e[go]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Se(e){e[nl]=!0}var Oe=new Set,Ue={};function nt(e,t){at(e,t),at(e+"Capture",t)}function at(e,t){for(Ue[e]=t,e=0;e<t.length;e++)Oe.add(t[e])}var Ne=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]*$"),cn={},yo={};function $p(e){return Ut.call(yo,e)?!0:Ut.call(cn,e)?!1:Ne.test(e)?yo[e]=!0:(cn[e]=!0,!1)}function xi(e,t,n){if($p(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Si(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function oa(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function Rn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wp(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var l=a.get,o=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){n=""+u,o.call(this,u)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(u){n=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vr(e){if(!e._valueTracker){var t=yu(e)?"checked":"value";e._valueTracker=Wp(e,t,""+e[t])}}function bu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=yu(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function wi(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 Ip=/[\n"\\]/g;function Ln(e){return e.replace(Ip,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Qr(e,t,n,a,l,o,u,g){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rn(t)):e.value!==""+Rn(t)&&(e.value=""+Rn(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?Fr(e,u,Rn(t)):n!=null?Fr(e,u,Rn(n)):a!=null&&e.removeAttribute("value"),l==null&&o!=null&&(e.defaultChecked=!!o),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+Rn(g):e.removeAttribute("name")}function vu(e,t,n,a,l,o,u,g){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Vr(e);return}n=n!=null?""+Rn(n):"",t=t!=null?""+Rn(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=g?e.checked:!!a,e.defaultChecked=!!a,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),Vr(e)}function Fr(e,t,n){t==="number"&&wi(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function kl(e,t,n,a){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Rn(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,a&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function xu(e,t,n){if(t!=null&&(t=""+Rn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Rn(n):""}function Su(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(d(92));if(Be(a)){if(1<a.length)throw Error(d(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Rn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Vr(e)}function zl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pp=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 wu(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Pp.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Cu(e,t,n){if(t!=null&&typeof t!="object")throw Error(d(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var l in t)a=t[l],t.hasOwnProperty(l)&&n[l]!==a&&wu(e,l,a)}else for(var o in t)t.hasOwnProperty(o)&&wu(e,o,t[o])}function Kr(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 e0=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"]]),t0=/^[\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 Ci(e){return t0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ia(){}var Zr=null;function Jr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ml=null,Dl=null;function ku(e){var t=ge(e);if(t&&(e=t.stateNode)){var n=e[jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Qr(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ln(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var l=a[jt]||null;if(!l)throw Error(d(90));Qr(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&bu(a)}break e;case"textarea":xu(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&kl(e,!!n.multiple,t,!1)}}}var $r=!1;function zu(e,t,n){if($r)return e(t,n);$r=!0;try{var a=e(t);return a}finally{if($r=!1,(Ml!==null||Dl!==null)&&(ur(),Ml&&(t=Ml,e=Dl,Dl=Ml=null,ku(t),e)))for(t=0;t<e.length;t++)ku(e[t])}}function bo(e,t){var n=e.stateNode;if(n===null)return null;var a=n[jt]||null;if(a===null)return null;n=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(d(231,t,typeof n));return n}var ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wr=!1;if(ra)try{var vo={};Object.defineProperty(vo,"passive",{get:function(){Wr=!0}}),window.addEventListener("test",vo,vo),window.removeEventListener("test",vo,vo)}catch{Wr=!1}var Ma=null,Ir=null,ki=null;function Mu(){if(ki)return ki;var e,t=Ir,n=t.length,a,l="value"in Ma?Ma.value:Ma.textContent,o=l.length;for(e=0;e<n&&t[e]===l[e];e++);var u=n-e;for(a=1;a<=u&&t[n-a]===l[o-a];a++);return ki=l.slice(e,1<a?1-a:void 0)}function zi(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 Mi(){return!0}function Du(){return!1}function hn(e){function t(n,a,l,o,u){this._reactName=n,this._targetInst=l,this.type=a,this.nativeEvent=o,this.target=u,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(o):o[g]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Mi:Du,this.isPropagationStopped=Du,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Mi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Mi)},persist:function(){},isPersistent:Mi}),t}var al={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Di=hn(al),xo=z({},al,{view:0,detail:0}),n0=hn(xo),Pr,es,So,Ti=z({},xo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ns,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!==So&&(So&&e.type==="mousemove"?(Pr=e.screenX-So.screenX,es=e.screenY-So.screenY):es=Pr=0,So=e),Pr)},movementY:function(e){return"movementY"in e?e.movementY:es}}),Tu=hn(Ti),a0=z({},Ti,{dataTransfer:0}),l0=hn(a0),o0=z({},xo,{relatedTarget:0}),ts=hn(o0),i0=z({},al,{animationName:0,elapsedTime:0,pseudoElement:0}),r0=hn(i0),s0=z({},al,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),c0=hn(s0),u0=z({},al,{data:0}),Au=hn(u0),d0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f0={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"},h0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=h0[e])?!!t[e]:!1}function ns(){return p0}var g0=z({},xo,{key:function(e){if(e.key){var t=d0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?f0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ns,charCode:function(e){return e.type==="keypress"?zi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),m0=hn(g0),y0=z({},Ti,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Eu=hn(y0),b0=z({},xo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ns}),v0=hn(b0),x0=z({},al,{propertyName:0,elapsedTime:0,pseudoElement:0}),S0=hn(x0),w0=z({},Ti,{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}),C0=hn(w0),k0=z({},al,{newState:0,oldState:0}),z0=hn(k0),M0=[9,13,27,32],as=ra&&"CompositionEvent"in window,wo=null;ra&&"documentMode"in document&&(wo=document.documentMode);var D0=ra&&"TextEvent"in window&&!wo,Ru=ra&&(!as||wo&&8<wo&&11>=wo),Lu=" ",_u=!1;function Ou(e,t){switch(e){case"keyup":return M0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tl=!1;function T0(e,t){switch(e){case"compositionend":return Hu(t);case"keypress":return t.which!==32?null:(_u=!0,Lu);case"textInput":return e=t.data,e===Lu&&_u?null:e;default:return null}}function A0(e,t){if(Tl)return e==="compositionend"||!as&&Ou(e,t)?(e=Mu(),ki=Ir=Ma=null,Tl=!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 Ru&&t.locale!=="ko"?null:t.data;default:return null}}var E0={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 Bu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!E0[e.type]:t==="textarea"}function Uu(e,t,n,a){Ml?Dl?Dl.push(a):Dl=[a]:Ml=a,t=yr(t,"onChange"),0<t.length&&(n=new Di("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Co=null,ko=null;function R0(e){xh(e,0)}function Ai(e){var t=ce(e);if(bu(t))return e}function Nu(e,t){if(e==="change")return t}var ju=!1;if(ra){var ls;if(ra){var os="oninput"in document;if(!os){var qu=document.createElement("div");qu.setAttribute("oninput","return;"),os=typeof qu.oninput=="function"}ls=os}else ls=!1;ju=ls&&(!document.documentMode||9<document.documentMode)}function Yu(){Co&&(Co.detachEvent("onpropertychange",Gu),ko=Co=null)}function Gu(e){if(e.propertyName==="value"&&Ai(ko)){var t=[];Uu(t,ko,e,Jr(e)),zu(R0,t)}}function L0(e,t,n){e==="focusin"?(Yu(),Co=t,ko=n,Co.attachEvent("onpropertychange",Gu)):e==="focusout"&&Yu()}function _0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ai(ko)}function O0(e,t){if(e==="click")return Ai(t)}function H0(e,t){if(e==="input"||e==="change")return Ai(t)}function B0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Cn=typeof Object.is=="function"?Object.is:B0;function zo(e,t){if(Cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var l=n[a];if(!Ut.call(t,l)||!Cn(e[l],t[l]))return!1}return!0}function Xu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vu(e,t){var n=Xu(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xu(n)}}function Qu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wi(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wi(e.document)}return t}function is(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 U0=ra&&"documentMode"in document&&11>=document.documentMode,Al=null,rs=null,Mo=null,ss=!1;function Ku(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ss||Al==null||Al!==wi(a)||(a=Al,"selectionStart"in a&&is(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Mo&&zo(Mo,a)||(Mo=a,a=yr(rs,"onSelect"),0<a.length&&(t=new Di("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Al)))}function ll(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var El={animationend:ll("Animation","AnimationEnd"),animationiteration:ll("Animation","AnimationIteration"),animationstart:ll("Animation","AnimationStart"),transitionrun:ll("Transition","TransitionRun"),transitionstart:ll("Transition","TransitionStart"),transitioncancel:ll("Transition","TransitionCancel"),transitionend:ll("Transition","TransitionEnd")},cs={},Zu={};ra&&(Zu=document.createElement("div").style,"AnimationEvent"in window||(delete El.animationend.animation,delete El.animationiteration.animation,delete El.animationstart.animation),"TransitionEvent"in window||delete El.transitionend.transition);function ol(e){if(cs[e])return cs[e];if(!El[e])return e;var t=El[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zu)return cs[e]=t[n];return e}var Ju=ol("animationend"),$u=ol("animationiteration"),Wu=ol("animationstart"),N0=ol("transitionrun"),j0=ol("transitionstart"),q0=ol("transitioncancel"),Iu=ol("transitionend"),Pu=new Map,us="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(" ");us.push("scrollEnd");function Xn(e,t){Pu.set(e,t),nt(t,[e])}var Ei=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)},_n=[],Rl=0,ds=0;function Ri(){for(var e=Rl,t=ds=Rl=0;t<e;){var n=_n[t];_n[t++]=null;var a=_n[t];_n[t++]=null;var l=_n[t];_n[t++]=null;var o=_n[t];if(_n[t++]=null,a!==null&&l!==null){var u=a.pending;u===null?l.next=l:(l.next=u.next,u.next=l),a.pending=l}o!==0&&ed(n,l,o)}}function Li(e,t,n,a){_n[Rl++]=e,_n[Rl++]=t,_n[Rl++]=n,_n[Rl++]=a,ds|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function fs(e,t,n,a){return Li(e,t,n,a),_i(e)}function il(e,t){return Li(e,null,null,t),_i(e)}function ed(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var l=!1,o=e.return;o!==null;)o.childLanes|=n,a=o.alternate,a!==null&&(a.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(l=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,l&&t!==null&&(l=31-Xe(n),e=o.hiddenUpdates,a=e[l],a===null?e[l]=[t]:a.push(t),t.lane=n|536870912),o):null}function _i(e){if(50<Zo)throw Zo=0,Sc=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ll={};function Y0(e,t,n,a){this.tag=e,this.key=n,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kn(e,t,n,a){return new Y0(e,t,n,a)}function hs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sa(e,t){var n=e.alternate;return n===null?(n=kn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function td(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Oi(e,t,n,a,l,o){var u=0;if(a=e,typeof e=="function")hs(e)&&(u=1);else if(typeof e=="string")u=Fg(e,n,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case j:return e=kn(31,n,t,l),e.elementType=j,e.lanes=o,e;case G:return rl(n.children,l,o,t);case ie:u=8,l|=24;break;case K:return e=kn(12,n,t,l|2),e.elementType=K,e.lanes=o,e;case X:return e=kn(13,n,t,l),e.elementType=X,e.lanes=o,e;case ee:return e=kn(19,n,t,l),e.elementType=ee,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:u=10;break e;case ue:u=9;break e;case oe:u=11;break e;case te:u=14;break e;case le:u=16,a=null;break e}u=29,n=Error(d(130,e===null?"null":typeof e,"")),a=null}return t=kn(u,n,t,l),t.elementType=e,t.type=a,t.lanes=o,t}function rl(e,t,n,a){return e=kn(7,e,a,t),e.lanes=n,e}function ps(e,t,n){return e=kn(6,e,null,t),e.lanes=n,e}function nd(e){var t=kn(18,null,null,0);return t.stateNode=e,t}function gs(e,t,n){return t=kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ad=new WeakMap;function On(e,t){if(typeof e=="object"&&e!==null){var n=ad.get(e);return n!==void 0?n:(t={value:e,source:t,stack:on(t)},ad.set(e,t),t)}return{value:e,source:t,stack:on(t)}}var _l=[],Ol=0,Hi=null,Do=0,Hn=[],Bn=0,Da=null,Zn=1,Jn="";function ca(e,t){_l[Ol++]=Do,_l[Ol++]=Hi,Hi=e,Do=t}function ld(e,t,n){Hn[Bn++]=Zn,Hn[Bn++]=Jn,Hn[Bn++]=Da,Da=e;var a=Zn;e=Jn;var l=32-Xe(a)-1;a&=~(1<<l),n+=1;var o=32-Xe(t)+l;if(30<o){var u=l-l%5;o=(a&(1<<u)-1).toString(32),a>>=u,l-=u,Zn=1<<32-Xe(t)+l|n<<l|a,Jn=o+e}else Zn=1<<o|n<<l|a,Jn=e}function ms(e){e.return!==null&&(ca(e,1),ld(e,1,0))}function ys(e){for(;e===Hi;)Hi=_l[--Ol],_l[Ol]=null,Do=_l[--Ol],_l[Ol]=null;for(;e===Da;)Da=Hn[--Bn],Hn[Bn]=null,Jn=Hn[--Bn],Hn[Bn]=null,Zn=Hn[--Bn],Hn[Bn]=null}function od(e,t){Hn[Bn++]=Zn,Hn[Bn++]=Jn,Hn[Bn++]=Da,Zn=t.id,Jn=t.overflow,Da=e}var Pt=null,zt=null,et=!1,Ta=null,Un=!1,bs=Error(d(519));function Aa(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw To(On(t,e)),bs}function id(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[At]=e,t[jt]=a,n){case"dialog":Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":case"embed":Ze("load",t);break;case"video":case"audio":for(n=0;n<$o.length;n++)Ze($o[n],t);break;case"source":Ze("error",t);break;case"img":case"image":case"link":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"input":Ze("invalid",t),vu(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ze("invalid",t);break;case"textarea":Ze("invalid",t),Su(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||kh(t.textContent,n)?(a.popover!=null&&(Ze("beforetoggle",t),Ze("toggle",t)),a.onScroll!=null&&Ze("scroll",t),a.onScrollEnd!=null&&Ze("scrollend",t),a.onClick!=null&&(t.onclick=ia),t=!0):t=!1,t||Aa(e,!0)}function rd(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:Un=!1;return;case 27:case 3:Un=!0;return;default:Pt=Pt.return}}function Hl(e){if(e!==Pt)return!1;if(!et)return rd(e),et=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Bc(e.type,e.memoizedProps)),n=!n),n&&zt&&Aa(e),rd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));zt=_h(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));zt=_h(e)}else t===27?(t=zt,Xa(e.type)?(e=Yc,Yc=null,zt=e):zt=t):zt=Pt?jn(e.stateNode.nextSibling):null;return!0}function sl(){zt=Pt=null,et=!1}function vs(){var e=Ta;return e!==null&&(yn===null?yn=e:yn.push.apply(yn,e),Ta=null),e}function To(e){Ta===null?Ta=[e]:Ta.push(e)}var xs=x(null),cl=null,ua=null;function Ea(e,t,n){ne(xs,t._currentValue),t._currentValue=n}function da(e){e._currentValue=xs.current,O(xs)}function Ss(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function ws(e,t,n,a){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var o=l.dependencies;if(o!==null){var u=l.child;o=o.firstContext;e:for(;o!==null;){var g=o;o=l;for(var S=0;S<t.length;S++)if(g.context===t[S]){o.lanes|=n,g=o.alternate,g!==null&&(g.lanes|=n),Ss(o.return,n,e),a||(u=null);break e}o=g.next}}else if(l.tag===18){if(u=l.return,u===null)throw Error(d(341));u.lanes|=n,o=u.alternate,o!==null&&(o.lanes|=n),Ss(u,n,e),u=null}else u=l.child;if(u!==null)u.return=l;else for(u=l;u!==null;){if(u===e){u=null;break}if(l=u.sibling,l!==null){l.return=u.return,u=l;break}u=u.return}l=u}}function Bl(e,t,n,a){e=null;for(var l=t,o=!1;l!==null;){if(!o){if((l.flags&524288)!==0)o=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var u=l.alternate;if(u===null)throw Error(d(387));if(u=u.memoizedProps,u!==null){var g=l.type;Cn(l.pendingProps.value,u.value)||(e!==null?e.push(g):e=[g])}}else if(l===qe.current){if(u=l.alternate,u===null)throw Error(d(387));u.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(ti):e=[ti])}l=l.return}e!==null&&ws(t,e,n,a),t.flags|=262144}function Bi(e){for(e=e.firstContext;e!==null;){if(!Cn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ul(e){cl=e,ua=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function en(e){return sd(cl,e)}function Ui(e,t){return cl===null&&ul(e),sd(e,t)}function sd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ua===null){if(e===null)throw Error(d(308));ua=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ua=ua.next=t;return n}var G0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},X0=i.unstable_scheduleCallback,V0=i.unstable_NormalPriority,Xt={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cs(){return{controller:new G0,data:new Map,refCount:0}}function Ao(e){e.refCount--,e.refCount===0&&X0(V0,function(){e.controller.abort()})}var Eo=null,ks=0,Ul=0,Nl=null;function Q0(e,t){if(Eo===null){var n=Eo=[];ks=0,Ul=Dc(),Nl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return ks++,t.then(cd,cd),t}function cd(){if(--ks===0&&Eo!==null){Nl!==null&&(Nl.status="fulfilled");var e=Eo;Eo=null,Ul=0,Nl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function F0(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var l=0;l<n.length;l++)(0,n[l])(t)},function(l){for(a.status="rejected",a.reason=l,l=0;l<n.length;l++)(0,n[l])(void 0)}),a}var ud=A.S;A.S=function(e,t){Zf=Tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Q0(e,t),ud!==null&&ud(e,t)};var dl=x(null);function zs(){var e=dl.current;return e!==null?e:xt.pooledCache}function Ni(e,t){t===null?ne(dl,dl.current):ne(dl,t.pool)}function dd(){var e=zs();return e===null?null:{parent:Xt._currentValue,pool:e}}var jl=Error(d(460)),Ms=Error(d(474)),ji=Error(d(542)),qi={then:function(){}};function fd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function hd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ia,ia),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gd(e),e;default:if(typeof t.status=="string")t.then(ia,ia);else{if(e=xt,e!==null&&100<e.shellSuspendCounter)throw Error(d(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=a}},function(a){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gd(e),e}throw hl=t,jl}}function fl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(hl=n,jl):n}}var hl=null;function pd(){if(hl===null)throw Error(d(459));var e=hl;return hl=null,e}function gd(e){if(e===jl||e===ji)throw Error(d(483))}var ql=null,Ro=0;function Yi(e){var t=Ro;return Ro+=1,ql===null&&(ql=[]),hd(ql,e,t)}function Lo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Gi(e,t){throw t.$$typeof===_?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function md(e){function t(M,k){if(e){var E=M.deletions;E===null?(M.deletions=[k],M.flags|=16):E.push(k)}}function n(M,k){if(!e)return null;for(;k!==null;)t(M,k),k=k.sibling;return null}function a(M){for(var k=new Map;M!==null;)M.key!==null?k.set(M.key,M):k.set(M.index,M),M=M.sibling;return k}function l(M,k){return M=sa(M,k),M.index=0,M.sibling=null,M}function o(M,k,E){return M.index=E,e?(E=M.alternate,E!==null?(E=E.index,E<k?(M.flags|=67108866,k):E):(M.flags|=67108866,k)):(M.flags|=1048576,k)}function u(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function g(M,k,E,V){return k===null||k.tag!==6?(k=ps(E,M.mode,V),k.return=M,k):(k=l(k,E),k.return=M,k)}function S(M,k,E,V){var Me=E.type;return Me===G?Y(M,k,E.props.children,V,E.key):k!==null&&(k.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===le&&fl(Me)===k.type)?(k=l(k,E.props),Lo(k,E),k.return=M,k):(k=Oi(E.type,E.key,E.props,null,M.mode,V),Lo(k,E),k.return=M,k)}function R(M,k,E,V){return k===null||k.tag!==4||k.stateNode.containerInfo!==E.containerInfo||k.stateNode.implementation!==E.implementation?(k=gs(E,M.mode,V),k.return=M,k):(k=l(k,E.children||[]),k.return=M,k)}function Y(M,k,E,V,Me){return k===null||k.tag!==7?(k=rl(E,M.mode,V,Me),k.return=M,k):(k=l(k,E),k.return=M,k)}function F(M,k,E){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=ps(""+k,M.mode,E),k.return=M,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case q:return E=Oi(k.type,k.key,k.props,null,M.mode,E),Lo(E,k),E.return=M,E;case B:return k=gs(k,M.mode,E),k.return=M,k;case le:return k=fl(k),F(M,k,E)}if(Be(k)||ye(k))return k=rl(k,M.mode,E,null),k.return=M,k;if(typeof k.then=="function")return F(M,Yi(k),E);if(k.$$typeof===Q)return F(M,Ui(M,k),E);Gi(M,k)}return null}function L(M,k,E,V){var Me=k!==null?k.key:null;if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return Me!==null?null:g(M,k,""+E,V);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case q:return E.key===Me?S(M,k,E,V):null;case B:return E.key===Me?R(M,k,E,V):null;case le:return E=fl(E),L(M,k,E,V)}if(Be(E)||ye(E))return Me!==null?null:Y(M,k,E,V,null);if(typeof E.then=="function")return L(M,k,Yi(E),V);if(E.$$typeof===Q)return L(M,k,Ui(M,E),V);Gi(M,E)}return null}function U(M,k,E,V,Me){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return M=M.get(E)||null,g(k,M,""+V,Me);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case q:return M=M.get(V.key===null?E:V.key)||null,S(k,M,V,Me);case B:return M=M.get(V.key===null?E:V.key)||null,R(k,M,V,Me);case le:return V=fl(V),U(M,k,E,V,Me)}if(Be(V)||ye(V))return M=M.get(E)||null,Y(k,M,V,Me,null);if(typeof V.then=="function")return U(M,k,E,Yi(V),Me);if(V.$$typeof===Q)return U(M,k,E,Ui(k,V),Me);Gi(k,V)}return null}function be(M,k,E,V){for(var Me=null,ot=null,ke=k,Fe=k=0,We=null;ke!==null&&Fe<E.length;Fe++){ke.index>Fe?(We=ke,ke=null):We=ke.sibling;var it=L(M,ke,E[Fe],V);if(it===null){ke===null&&(ke=We);break}e&&ke&&it.alternate===null&&t(M,ke),k=o(it,k,Fe),ot===null?Me=it:ot.sibling=it,ot=it,ke=We}if(Fe===E.length)return n(M,ke),et&&ca(M,Fe),Me;if(ke===null){for(;Fe<E.length;Fe++)ke=F(M,E[Fe],V),ke!==null&&(k=o(ke,k,Fe),ot===null?Me=ke:ot.sibling=ke,ot=ke);return et&&ca(M,Fe),Me}for(ke=a(ke);Fe<E.length;Fe++)We=U(ke,M,Fe,E[Fe],V),We!==null&&(e&&We.alternate!==null&&ke.delete(We.key===null?Fe:We.key),k=o(We,k,Fe),ot===null?Me=We:ot.sibling=We,ot=We);return e&&ke.forEach(function(Za){return t(M,Za)}),et&&ca(M,Fe),Me}function Le(M,k,E,V){if(E==null)throw Error(d(151));for(var Me=null,ot=null,ke=k,Fe=k=0,We=null,it=E.next();ke!==null&&!it.done;Fe++,it=E.next()){ke.index>Fe?(We=ke,ke=null):We=ke.sibling;var Za=L(M,ke,it.value,V);if(Za===null){ke===null&&(ke=We);break}e&&ke&&Za.alternate===null&&t(M,ke),k=o(Za,k,Fe),ot===null?Me=Za:ot.sibling=Za,ot=Za,ke=We}if(it.done)return n(M,ke),et&&ca(M,Fe),Me;if(ke===null){for(;!it.done;Fe++,it=E.next())it=F(M,it.value,V),it!==null&&(k=o(it,k,Fe),ot===null?Me=it:ot.sibling=it,ot=it);return et&&ca(M,Fe),Me}for(ke=a(ke);!it.done;Fe++,it=E.next())it=U(ke,M,Fe,it.value,V),it!==null&&(e&&it.alternate!==null&&ke.delete(it.key===null?Fe:it.key),k=o(it,k,Fe),ot===null?Me=it:ot.sibling=it,ot=it);return e&&ke.forEach(function(am){return t(M,am)}),et&&ca(M,Fe),Me}function vt(M,k,E,V){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case q:e:{for(var Me=E.key;k!==null;){if(k.key===Me){if(Me=E.type,Me===G){if(k.tag===7){n(M,k.sibling),V=l(k,E.props.children),V.return=M,M=V;break e}}else if(k.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===le&&fl(Me)===k.type){n(M,k.sibling),V=l(k,E.props),Lo(V,E),V.return=M,M=V;break e}n(M,k);break}else t(M,k);k=k.sibling}E.type===G?(V=rl(E.props.children,M.mode,V,E.key),V.return=M,M=V):(V=Oi(E.type,E.key,E.props,null,M.mode,V),Lo(V,E),V.return=M,M=V)}return u(M);case B:e:{for(Me=E.key;k!==null;){if(k.key===Me)if(k.tag===4&&k.stateNode.containerInfo===E.containerInfo&&k.stateNode.implementation===E.implementation){n(M,k.sibling),V=l(k,E.children||[]),V.return=M,M=V;break e}else{n(M,k);break}else t(M,k);k=k.sibling}V=gs(E,M.mode,V),V.return=M,M=V}return u(M);case le:return E=fl(E),vt(M,k,E,V)}if(Be(E))return be(M,k,E,V);if(ye(E)){if(Me=ye(E),typeof Me!="function")throw Error(d(150));return E=Me.call(E),Le(M,k,E,V)}if(typeof E.then=="function")return vt(M,k,Yi(E),V);if(E.$$typeof===Q)return vt(M,k,Ui(M,E),V);Gi(M,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,k!==null&&k.tag===6?(n(M,k.sibling),V=l(k,E),V.return=M,M=V):(n(M,k),V=ps(E,M.mode,V),V.return=M,M=V),u(M)):n(M,k)}return function(M,k,E,V){try{Ro=0;var Me=vt(M,k,E,V);return ql=null,Me}catch(ke){if(ke===jl||ke===ji)throw ke;var ot=kn(29,ke,null,M.mode);return ot.lanes=V,ot.return=M,ot}}}var pl=md(!0),yd=md(!1),Ra=!1;function Ds(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ts(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 La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _a(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(rt&2)!==0){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=_i(e),ed(e,null,n),t}return Li(e,a,t,n),_i(e)}function _o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,bi(e,n)}}function As(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var u={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?l=o=u:o=o.next=u,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Es=!1;function Oo(){if(Es){var e=Nl;if(e!==null)throw e}}function Ho(e,t,n,a){Es=!1;var l=e.updateQueue;Ra=!1;var o=l.firstBaseUpdate,u=l.lastBaseUpdate,g=l.shared.pending;if(g!==null){l.shared.pending=null;var S=g,R=S.next;S.next=null,u===null?o=R:u.next=R,u=S;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,g=Y.lastBaseUpdate,g!==u&&(g===null?Y.firstBaseUpdate=R:g.next=R,Y.lastBaseUpdate=S))}if(o!==null){var F=l.baseState;u=0,Y=R=S=null,g=o;do{var L=g.lane&-536870913,U=L!==g.lane;if(U?($e&L)===L:(a&L)===L){L!==0&&L===Ul&&(Es=!0),Y!==null&&(Y=Y.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var be=e,Le=g;L=t;var vt=n;switch(Le.tag){case 1:if(be=Le.payload,typeof be=="function"){F=be.call(vt,F,L);break e}F=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Le.payload,L=typeof be=="function"?be.call(vt,F,L):be,L==null)break e;F=z({},F,L);break e;case 2:Ra=!0}}L=g.callback,L!==null&&(e.flags|=64,U&&(e.flags|=8192),U=l.callbacks,U===null?l.callbacks=[L]:U.push(L))}else U={lane:L,tag:g.tag,payload:g.payload,callback:g.callback,next:null},Y===null?(R=Y=U,S=F):Y=Y.next=U,u|=L;if(g=g.next,g===null){if(g=l.shared.pending,g===null)break;U=g,g=U.next,U.next=null,l.lastBaseUpdate=U,l.shared.pending=null}}while(!0);Y===null&&(S=F),l.baseState=S,l.firstBaseUpdate=R,l.lastBaseUpdate=Y,o===null&&(l.shared.lanes=0),Na|=u,e.lanes=u,e.memoizedState=F}}function bd(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function vd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bd(n[e],t)}var Yl=x(null),Xi=x(0);function xd(e,t){e=xa,ne(Xi,e),ne(Yl,t),xa=e|t.baseLanes}function Rs(){ne(Xi,xa),ne(Yl,Yl.current)}function Ls(){xa=Xi.current,O(Yl),O(Xi)}var zn=x(null),Nn=null;function Oa(e){var t=e.alternate;ne(qt,qt.current&1),ne(zn,e),Nn===null&&(t===null||Yl.current!==null||t.memoizedState!==null)&&(Nn=e)}function _s(e){ne(qt,qt.current),ne(zn,e),Nn===null&&(Nn=e)}function Sd(e){e.tag===22?(ne(qt,qt.current),ne(zn,e),Nn===null&&(Nn=e)):Ha()}function Ha(){ne(qt,qt.current),ne(zn,zn.current)}function Mn(e){O(zn),Nn===e&&(Nn=null),O(qt)}var qt=x(0);function Vi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||jc(n)||qc(n)))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,Qe=null,yt=null,Vt=null,Qi=!1,Gl=!1,gl=!1,Fi=0,Bo=0,Xl=null,K0=0;function _t(){throw Error(d(321))}function Os(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cn(e[n],t[n]))return!1;return!0}function Hs(e,t,n,a,l,o){return fa=o,Qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?lf:$s,gl=!1,o=n(a,l),gl=!1,Gl&&(o=Cd(t,n,a,l)),wd(e),o}function wd(e){A.H=jo;var t=yt!==null&&yt.next!==null;if(fa=0,Vt=yt=Qe=null,Qi=!1,Bo=0,Xl=null,t)throw Error(d(300));e===null||Qt||(e=e.dependencies,e!==null&&Bi(e)&&(Qt=!0))}function Cd(e,t,n,a){Qe=e;var l=0;do{if(Gl&&(Xl=null),Bo=0,Gl=!1,25<=l)throw Error(d(301));if(l+=1,Vt=yt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=of,o=t(n,a)}while(Gl);return o}function Z0(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?Uo(t):t,e=e.useState()[0],(yt!==null?yt.memoizedState:null)!==e&&(Qe.flags|=1024),t}function Bs(){var e=Fi!==0;return Fi=0,e}function Us(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ns(e){if(Qi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qi=!1}fa=0,Vt=yt=Qe=null,Gl=!1,Bo=Fi=0,Xl=null}function un(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?Qe.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function Yt(){if(yt===null){var e=Qe.alternate;e=e!==null?e.memoizedState:null}else e=yt.next;var t=Vt===null?Qe.memoizedState:Vt.next;if(t!==null)Vt=t,yt=e;else{if(e===null)throw Qe.alternate===null?Error(d(467)):Error(d(310));yt=e,e={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},Vt===null?Qe.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function Ki(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Uo(e){var t=Bo;return Bo+=1,Xl===null&&(Xl=[]),e=hd(Xl,e,t),t=Qe,(Vt===null?t.memoizedState:Vt.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?lf:$s),e}function Zi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Uo(e);if(e.$$typeof===Q)return en(e)}throw Error(d(438,String(e)))}function js(e){var t=null,n=Qe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Qe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ki(),Qe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=W;return t.index++,n}function ha(e,t){return typeof t=="function"?t(e):t}function Ji(e){var t=Yt();return qs(t,yt,e)}function qs(e,t,n){var a=e.queue;if(a===null)throw Error(d(311));a.lastRenderedReducer=n;var l=e.baseQueue,o=a.pending;if(o!==null){if(l!==null){var u=l.next;l.next=o.next,o.next=u}t.baseQueue=l=o,a.pending=null}if(o=e.baseState,l===null)e.memoizedState=o;else{t=l.next;var g=u=null,S=null,R=t,Y=!1;do{var F=R.lane&-536870913;if(F!==R.lane?($e&F)===F:(fa&F)===F){var L=R.revertLane;if(L===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),F===Ul&&(Y=!0);else if((fa&L)===L){R=R.next,L===Ul&&(Y=!0);continue}else F={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},S===null?(g=S=F,u=o):S=S.next=F,Qe.lanes|=L,Na|=L;F=R.action,gl&&n(o,F),o=R.hasEagerState?R.eagerState:n(o,F)}else L={lane:F,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},S===null?(g=S=L,u=o):S=S.next=L,Qe.lanes|=F,Na|=F;R=R.next}while(R!==null&&R!==t);if(S===null?u=o:S.next=g,!Cn(o,e.memoizedState)&&(Qt=!0,Y&&(n=Nl,n!==null)))throw n;e.memoizedState=o,e.baseState=u,e.baseQueue=S,a.lastRenderedState=o}return l===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ys(e){var t=Yt(),n=t.queue;if(n===null)throw Error(d(311));n.lastRenderedReducer=e;var a=n.dispatch,l=n.pending,o=t.memoizedState;if(l!==null){n.pending=null;var u=l=l.next;do o=e(o,u.action),u=u.next;while(u!==l);Cn(o,t.memoizedState)||(Qt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,a]}function kd(e,t,n){var a=Qe,l=Yt(),o=et;if(o){if(n===void 0)throw Error(d(407));n=n()}else n=t();var u=!Cn((yt||l).memoizedState,n);if(u&&(l.memoizedState=n,Qt=!0),l=l.queue,Vs(Dd.bind(null,a,l,e),[e]),l.getSnapshot!==t||u||Vt!==null&&Vt.memoizedState.tag&1){if(a.flags|=2048,Vl(9,{destroy:void 0},Md.bind(null,a,l,n,t),null),xt===null)throw Error(d(349));o||(fa&127)!==0||zd(a,t,n)}return n}function zd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Qe.updateQueue,t===null?(t=Ki(),Qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Md(e,t,n,a){t.value=n,t.getSnapshot=a,Td(t)&&Ad(e)}function Dd(e,t,n){return n(function(){Td(t)&&Ad(e)})}function Td(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cn(e,n)}catch{return!0}}function Ad(e){var t=il(e,2);t!==null&&bn(t,e,2)}function Gs(e){var t=un();if(typeof e=="function"){var n=e;if(e=n(),gl){Ae(!0);try{n()}finally{Ae(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:e},t}function Ed(e,t,n,a){return e.baseState=n,qs(e,yt,typeof a=="function"?a:ha)}function J0(e,t,n,a,l){if(Ii(e))throw Error(d(485));if(e=t.action,e!==null){var o={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(u){o.listeners.push(u)}};A.T!==null?n(!0):o.isTransition=!1,a(o),n=t.pending,n===null?(o.next=t.pending=o,Rd(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Rd(e,t){var n=t.action,a=t.payload,l=e.state;if(t.isTransition){var o=A.T,u={};A.T=u;try{var g=n(l,a),S=A.S;S!==null&&S(u,g),Ld(e,t,g)}catch(R){Xs(e,t,R)}finally{o!==null&&u.types!==null&&(o.types=u.types),A.T=o}}else try{o=n(l,a),Ld(e,t,o)}catch(R){Xs(e,t,R)}}function Ld(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){_d(e,t,a)},function(a){return Xs(e,t,a)}):_d(e,t,n)}function _d(e,t,n){t.status="fulfilled",t.value=n,Od(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Rd(e,n)))}function Xs(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Od(t),t=t.next;while(t!==a)}e.action=null}function Od(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Hd(e,t){return t}function Bd(e,t){if(et){var n=xt.formState;if(n!==null){e:{var a=Qe;if(et){if(zt){t:{for(var l=zt,o=Un;l.nodeType!==8;){if(!o){l=null;break t}if(l=jn(l.nextSibling),l===null){l=null;break t}}o=l.data,l=o==="F!"||o==="F"?l:null}if(l){zt=jn(l.nextSibling),a=l.data==="F!";break e}}Aa(a)}a=!1}a&&(t=n[0])}}return n=un(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hd,lastRenderedState:t},n.queue=a,n=tf.bind(null,Qe,a),a.dispatch=n,a=Gs(!1),o=Js.bind(null,Qe,!1,a.queue),a=un(),l={state:t,dispatch:null,action:e,pending:null},a.queue=l,n=J0.bind(null,Qe,l,o,n),l.dispatch=n,a.memoizedState=e,[t,n,!1]}function Ud(e){var t=Yt();return Nd(t,yt,e)}function Nd(e,t,n){if(t=qs(e,t,Hd)[0],e=Ji(ha)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Uo(t)}catch(u){throw u===jl?ji:u}else a=t;t=Yt();var l=t.queue,o=l.dispatch;return n!==t.memoizedState&&(Qe.flags|=2048,Vl(9,{destroy:void 0},$0.bind(null,l,n),null)),[a,o,e]}function $0(e,t){e.action=t}function jd(e){var t=Yt(),n=yt;if(n!==null)return Nd(t,n,e);Yt(),t=t.memoizedState,n=Yt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Vl(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Qe.updateQueue,t===null&&(t=Ki(),Qe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function qd(){return Yt().memoizedState}function $i(e,t,n,a){var l=un();Qe.flags|=e,l.memoizedState=Vl(1|t,{destroy:void 0},n,a===void 0?null:a)}function Wi(e,t,n,a){var l=Yt();a=a===void 0?null:a;var o=l.memoizedState.inst;yt!==null&&a!==null&&Os(a,yt.memoizedState.deps)?l.memoizedState=Vl(t,o,n,a):(Qe.flags|=e,l.memoizedState=Vl(1|t,o,n,a))}function Yd(e,t){$i(8390656,8,e,t)}function Vs(e,t){Wi(2048,8,e,t)}function W0(e){Qe.flags|=4;var t=Qe.updateQueue;if(t===null)t=Ki(),Qe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gd(e){var t=Yt().memoizedState;return W0({ref:t,nextImpl:e}),function(){if((rt&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function Xd(e,t){return Wi(4,2,e,t)}function Vd(e,t){return Wi(4,4,e,t)}function Qd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Fd(e,t,n){n=n!=null?n.concat([e]):null,Wi(4,4,Qd.bind(null,t,e),n)}function Qs(){}function Kd(e,t){var n=Yt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Os(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Zd(e,t){var n=Yt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Os(t,a[1]))return a[0];if(a=e(),gl){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[a,t],a}function Fs(e,t,n){return n===void 0||(fa&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=$f(),Qe.lanes|=e,Na|=e,n)}function Jd(e,t,n,a){return Cn(n,t)?n:Yl.current!==null?(e=Fs(e,n,a),Cn(e,t)||(Qt=!0),e):(fa&42)===0||(fa&1073741824)!==0&&($e&261930)===0?(Qt=!0,e.memoizedState=n):(e=$f(),Qe.lanes|=e,Na|=e,t)}function $d(e,t,n,a,l){var o=Z.p;Z.p=o!==0&&8>o?o:8;var u=A.T,g={};A.T=g,Js(e,!1,t,n);try{var S=l(),R=A.S;if(R!==null&&R(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var Y=F0(S,a);No(e,t,Y,An(e))}else No(e,t,a,An(e))}catch(F){No(e,t,{then:function(){},status:"rejected",reason:F},An())}finally{Z.p=o,u!==null&&g.types!==null&&(u.types=g.types),A.T=u}}function I0(){}function Ks(e,t,n,a){if(e.tag!==5)throw Error(d(476));var l=Wd(e).queue;$d(e,l,t,I,n===null?I0:function(){return Id(e),n(a)})}function Wd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Id(e){var t=Wd(e);t.next===null&&(t=e.alternate.memoizedState),No(e,t.next.queue,{},An())}function Zs(){return en(ti)}function Pd(){return Yt().memoizedState}function ef(){return Yt().memoizedState}function P0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=An();e=La(n);var a=_a(t,e,n);a!==null&&(bn(a,t,n),_o(a,t,n)),t={cache:Cs()},e.payload=t;return}t=t.return}}function eg(e,t,n){var a=An();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ii(e)?nf(t,n):(n=fs(e,t,n,a),n!==null&&(bn(n,e,a),af(n,t,a)))}function tf(e,t,n){var a=An();No(e,t,n,a)}function No(e,t,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ii(e))nf(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var u=t.lastRenderedState,g=o(u,n);if(l.hasEagerState=!0,l.eagerState=g,Cn(g,u))return Li(e,t,l,0),xt===null&&Ri(),!1}catch{}if(n=fs(e,t,l,a),n!==null)return bn(n,e,a),af(n,t,a),!0}return!1}function Js(e,t,n,a){if(a={lane:2,revertLane:Dc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ii(e)){if(t)throw Error(d(479))}else t=fs(e,n,a,2),t!==null&&bn(t,e,2)}function Ii(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function nf(e,t){Gl=Qi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function af(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,bi(e,n)}}var jo={readContext:en,use:Zi,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};jo.useEffectEvent=_t;var lf={readContext:en,use:Zi,useCallback:function(e,t){return un().memoizedState=[e,t===void 0?null:t],e},useContext:en,useEffect:Yd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$i(4194308,4,Qd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $i(4194308,4,e,t)},useInsertionEffect:function(e,t){$i(4,2,e,t)},useMemo:function(e,t){var n=un();t=t===void 0?null:t;var a=e();if(gl){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=un();if(n!==void 0){var l=n(t);if(gl){Ae(!0);try{n(t)}finally{Ae(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=eg.bind(null,Qe,e),[a.memoizedState,e]},useRef:function(e){var t=un();return e={current:e},t.memoizedState=e},useState:function(e){e=Gs(e);var t=e.queue,n=tf.bind(null,Qe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Qs,useDeferredValue:function(e,t){var n=un();return Fs(n,e,t)},useTransition:function(){var e=Gs(!1);return e=$d.bind(null,Qe,e.queue,!0,!1),un().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Qe,l=un();if(et){if(n===void 0)throw Error(d(407));n=n()}else{if(n=t(),xt===null)throw Error(d(349));($e&127)!==0||zd(a,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Yd(Dd.bind(null,a,o,e),[e]),a.flags|=2048,Vl(9,{destroy:void 0},Md.bind(null,a,o,n,t),null),n},useId:function(){var e=un(),t=xt.identifierPrefix;if(et){var n=Jn,a=Zn;n=(a&~(1<<32-Xe(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Fi++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=K0++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zs,useFormState:Bd,useActionState:Bd,useOptimistic:function(e){var t=un();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Js.bind(null,Qe,!0,n),n.dispatch=t,[e,t]},useMemoCache:js,useCacheRefresh:function(){return un().memoizedState=P0.bind(null,Qe)},useEffectEvent:function(e){var t=un(),n={impl:e};return t.memoizedState=n,function(){if((rt&2)!==0)throw Error(d(440));return n.impl.apply(void 0,arguments)}}},$s={readContext:en,use:Zi,useCallback:Kd,useContext:en,useEffect:Vs,useImperativeHandle:Fd,useInsertionEffect:Xd,useLayoutEffect:Vd,useMemo:Zd,useReducer:Ji,useRef:qd,useState:function(){return Ji(ha)},useDebugValue:Qs,useDeferredValue:function(e,t){var n=Yt();return Jd(n,yt.memoizedState,e,t)},useTransition:function(){var e=Ji(ha)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:Uo(e),t]},useSyncExternalStore:kd,useId:Pd,useHostTransitionStatus:Zs,useFormState:Ud,useActionState:Ud,useOptimistic:function(e,t){var n=Yt();return Ed(n,yt,e,t)},useMemoCache:js,useCacheRefresh:ef};$s.useEffectEvent=Gd;var of={readContext:en,use:Zi,useCallback:Kd,useContext:en,useEffect:Vs,useImperativeHandle:Fd,useInsertionEffect:Xd,useLayoutEffect:Vd,useMemo:Zd,useReducer:Ys,useRef:qd,useState:function(){return Ys(ha)},useDebugValue:Qs,useDeferredValue:function(e,t){var n=Yt();return yt===null?Fs(n,e,t):Jd(n,yt.memoizedState,e,t)},useTransition:function(){var e=Ys(ha)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:Uo(e),t]},useSyncExternalStore:kd,useId:Pd,useHostTransitionStatus:Zs,useFormState:jd,useActionState:jd,useOptimistic:function(e,t){var n=Yt();return yt!==null?Ed(n,yt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:js,useCacheRefresh:ef};of.useEffectEvent=Gd;function Ws(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:z({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=An(),l=La(a);l.payload=t,n!=null&&(l.callback=n),t=_a(e,l,a),t!==null&&(bn(t,e,a),_o(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=An(),l=La(a);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=_a(e,l,a),t!==null&&(bn(t,e,a),_o(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=An(),a=La(n);a.tag=2,t!=null&&(a.callback=t),t=_a(e,a,n),t!==null&&(bn(t,e,n),_o(t,e,n))}};function rf(e,t,n,a,l,o,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,o,u):t.prototype&&t.prototype.isPureReactComponent?!zo(n,a)||!zo(l,o):!0}function sf(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Is.enqueueReplaceState(t,t.state,null)}function ml(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=z({},n));for(var l in e)n[l]===void 0&&(n[l]=e[l])}return n}function cf(e){Ei(e)}function uf(e){console.error(e)}function df(e){Ei(e)}function Pi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function ff(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function Ps(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Pi(e,t)},n}function hf(e){return e=La(e),e.tag=3,e}function pf(e,t,n,a){var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var o=a.value;e.payload=function(){return l(o)},e.callback=function(){ff(t,n,a)}}var u=n.stateNode;u!==null&&typeof u.componentDidCatch=="function"&&(e.callback=function(){ff(t,n,a),typeof l!="function"&&(ja===null?ja=new Set([this]):ja.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function tg(e,t,n,a,l){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Bl(t,n,l,!0),n=zn.current,n!==null){switch(n.tag){case 31:case 13:return Nn===null?dr():n.alternate===null&&Ot===0&&(Ot=3),n.flags&=-257,n.flags|=65536,n.lanes=l,a===qi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),kc(e,a,l)),!1;case 22:return n.flags|=65536,a===qi?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),kc(e,a,l)),!1}throw Error(d(435,n.tag))}return kc(e,a,l),dr(),!1}if(et)return t=zn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,a!==bs&&(e=Error(d(422),{cause:a}),To(On(e,n)))):(a!==bs&&(t=Error(d(423),{cause:a}),To(On(t,n))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,a=On(a,n),l=Ps(e.stateNode,a,l),As(e,l),Ot!==4&&(Ot=2)),!1;var o=Error(d(520),{cause:a});if(o=On(o,n),Ko===null?Ko=[o]:Ko.push(o),Ot!==4&&(Ot=2),t===null)return!0;a=On(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=l&-l,n.lanes|=e,e=Ps(n.stateNode,a,e),As(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(ja===null||!ja.has(o))))return n.flags|=65536,l&=-l,n.lanes|=l,l=hf(l),pf(l,e,n,a),As(n,l),!1}n=n.return}while(n!==null);return!1}var ec=Error(d(461)),Qt=!1;function tn(e,t,n,a){t.child=e===null?yd(t,null,n,a):pl(t,e.child,n,a)}function gf(e,t,n,a,l){n=n.render;var o=t.ref;if("ref"in a){var u={};for(var g in a)g!=="ref"&&(u[g]=a[g])}else u=a;return ul(t),a=Hs(e,t,n,u,o,l),g=Bs(),e!==null&&!Qt?(Us(e,t,l),pa(e,t,l)):(et&&g&&ms(t),t.flags|=1,tn(e,t,a,l),t.child)}function mf(e,t,n,a,l){if(e===null){var o=n.type;return typeof o=="function"&&!hs(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,yf(e,t,o,a,l)):(e=Oi(n.type,null,a,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!sc(e,l)){var u=o.memoizedProps;if(n=n.compare,n=n!==null?n:zo,n(u,a)&&e.ref===t.ref)return pa(e,t,l)}return t.flags|=1,e=sa(o,a),e.ref=t.ref,e.return=t,t.child=e}function yf(e,t,n,a,l){if(e!==null){var o=e.memoizedProps;if(zo(o,a)&&e.ref===t.ref)if(Qt=!1,t.pendingProps=a=o,sc(e,l))(e.flags&131072)!==0&&(Qt=!0);else return t.lanes=e.lanes,pa(e,t,l)}return tc(e,t,n,a,l)}function bf(e,t,n,a){var l=a.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(a=t.child=e.child,l=0;a!==null;)l=l|a.lanes|a.childLanes,a=a.sibling;a=l&~o}else a=0,t.child=null;return vf(e,t,o,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ni(t,o!==null?o.cachePool:null),o!==null?xd(t,o):Rs(),Sd(t);else return a=t.lanes=536870912,vf(e,t,o!==null?o.baseLanes|n:n,n,a)}else o!==null?(Ni(t,o.cachePool),xd(t,o),Ha(),t.memoizedState=null):(e!==null&&Ni(t,null),Rs(),Ha());return tn(e,t,l,n),t.child}function qo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function vf(e,t,n,a,l){var o=zs();return o=o===null?null:{parent:Xt._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&Ni(t,null),Rs(),Sd(t),e!==null&&Bl(e,t,a,!0),t.childLanes=l,null}function er(e,t){return t=nr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xf(e,t,n){return pl(t,e.child,null,n),e=er(t,t.pendingProps),e.flags|=2,Mn(t),t.memoizedState=null,e}function ng(e,t,n){var a=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(et){if(a.mode==="hidden")return e=er(t,a),t.lanes=536870912,qo(null,e);if(_s(t),(e=zt)?(e=Lh(e,Un),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Da!==null?{id:Zn,overflow:Jn}:null,retryLane:536870912,hydrationErrors:null},n=nd(e),n.return=t,t.child=n,Pt=t,zt=null)):e=null,e===null)throw Aa(t);return t.lanes=536870912,null}return er(t,a)}var o=e.memoizedState;if(o!==null){var u=o.dehydrated;if(_s(t),l)if(t.flags&256)t.flags&=-257,t=xf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(Qt||Bl(e,t,n,!1),l=(n&e.childLanes)!==0,Qt||l){if(a=xt,a!==null&&(u=ho(a,n),u!==0&&u!==o.retryLane))throw o.retryLane=u,il(e,u),bn(a,e,u),ec;dr(),t=xf(e,t,n)}else e=o.treeContext,zt=jn(u.nextSibling),Pt=t,et=!0,Ta=null,Un=!1,e!==null&&od(t,e),t=er(t,a),t.flags|=4096;return t}return e=sa(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function tr(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(d(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function tc(e,t,n,a,l){return ul(t),n=Hs(e,t,n,a,void 0,l),a=Bs(),e!==null&&!Qt?(Us(e,t,l),pa(e,t,l)):(et&&a&&ms(t),t.flags|=1,tn(e,t,n,l),t.child)}function Sf(e,t,n,a,l,o){return ul(t),t.updateQueue=null,n=Cd(t,a,n,l),wd(e),a=Bs(),e!==null&&!Qt?(Us(e,t,o),pa(e,t,o)):(et&&a&&ms(t),t.flags|=1,tn(e,t,n,o),t.child)}function wf(e,t,n,a,l){if(ul(t),t.stateNode===null){var o=Ll,u=n.contextType;typeof u=="object"&&u!==null&&(o=en(u)),o=new n(a,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Is,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=a,o.state=t.memoizedState,o.refs={},Ds(t),u=n.contextType,o.context=typeof u=="object"&&u!==null?en(u):Ll,o.state=t.memoizedState,u=n.getDerivedStateFromProps,typeof u=="function"&&(Ws(t,n,u,a),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(u=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),u!==o.state&&Is.enqueueReplaceState(o,o.state,null),Ho(t,a,o,l),Oo(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){o=t.stateNode;var g=t.memoizedProps,S=ml(n,g);o.props=S;var R=o.context,Y=n.contextType;u=Ll,typeof Y=="object"&&Y!==null&&(u=en(Y));var F=n.getDerivedStateFromProps;Y=typeof F=="function"||typeof o.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,Y||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(g||R!==u)&&sf(t,o,a,u),Ra=!1;var L=t.memoizedState;o.state=L,Ho(t,a,o,l),Oo(),R=t.memoizedState,g||L!==R||Ra?(typeof F=="function"&&(Ws(t,n,F,a),R=t.memoizedState),(S=Ra||rf(t,n,S,a,L,R,u))?(Y||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=R),o.props=a,o.state=R,o.context=u,a=S):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{o=t.stateNode,Ts(e,t),u=t.memoizedProps,Y=ml(n,u),o.props=Y,F=t.pendingProps,L=o.context,R=n.contextType,S=Ll,typeof R=="object"&&R!==null&&(S=en(R)),g=n.getDerivedStateFromProps,(R=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(u!==F||L!==S)&&sf(t,o,a,S),Ra=!1,L=t.memoizedState,o.state=L,Ho(t,a,o,l),Oo();var U=t.memoizedState;u!==F||L!==U||Ra||e!==null&&e.dependencies!==null&&Bi(e.dependencies)?(typeof g=="function"&&(Ws(t,n,g,a),U=t.memoizedState),(Y=Ra||rf(t,n,Y,a,L,U,S)||e!==null&&e.dependencies!==null&&Bi(e.dependencies))?(R||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(a,U,S),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(a,U,S)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||u===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=U),o.props=a,o.state=U,o.context=S,a=Y):(typeof o.componentDidUpdate!="function"||u===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),a=!1)}return o=a,tr(e,t),a=(t.flags&128)!==0,o||a?(o=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&a?(t.child=pl(t,e.child,null,l),t.child=pl(t,null,n,l)):tn(e,t,n,l),t.memoizedState=o.state,e=t.child):e=pa(e,t,l),e}function Cf(e,t,n,a){return sl(),t.flags|=256,tn(e,t,n,a),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:dd()}}function lc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Tn),e}function kf(e,t,n){var a=t.pendingProps,l=!1,o=(t.flags&128)!==0,u;if((u=o)||(u=e!==null&&e.memoizedState===null?!1:(qt.current&2)!==0),u&&(l=!0,t.flags&=-129),u=(t.flags&32)!==0,t.flags&=-33,e===null){if(et){if(l?Oa(t):Ha(),(e=zt)?(e=Lh(e,Un),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Da!==null?{id:Zn,overflow:Jn}:null,retryLane:536870912,hydrationErrors:null},n=nd(e),n.return=t,t.child=n,Pt=t,zt=null)):e=null,e===null)throw Aa(t);return qc(e)?t.lanes=32:t.lanes=536870912,null}var g=a.children;return a=a.fallback,l?(Ha(),l=t.mode,g=nr({mode:"hidden",children:g},l),a=rl(a,l,n,null),g.return=t,a.return=t,g.sibling=a,t.child=g,a=t.child,a.memoizedState=ac(n),a.childLanes=lc(e,u,n),t.memoizedState=nc,qo(null,a)):(Oa(t),oc(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(o)t.flags&256?(Oa(t),t.flags&=-257,t=ic(e,t,n)):t.memoizedState!==null?(Ha(),t.child=e.child,t.flags|=128,t=null):(Ha(),g=a.fallback,l=t.mode,a=nr({mode:"visible",children:a.children},l),g=rl(g,l,n,null),g.flags|=2,a.return=t,g.return=t,a.sibling=g,t.child=a,pl(t,e.child,null,n),a=t.child,a.memoizedState=ac(n),a.childLanes=lc(e,u,n),t.memoizedState=nc,t=qo(null,a));else if(Oa(t),qc(g)){if(u=g.nextSibling&&g.nextSibling.dataset,u)var R=u.dgst;u=R,a=Error(d(419)),a.stack="",a.digest=u,To({value:a,source:null,stack:null}),t=ic(e,t,n)}else if(Qt||Bl(e,t,n,!1),u=(n&e.childLanes)!==0,Qt||u){if(u=xt,u!==null&&(a=ho(u,n),a!==0&&a!==S.retryLane))throw S.retryLane=a,il(e,a),bn(u,e,a),ec;jc(g)||dr(),t=ic(e,t,n)}else jc(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,zt=jn(g.nextSibling),Pt=t,et=!0,Ta=null,Un=!1,e!==null&&od(t,e),t=oc(t,a.children),t.flags|=4096);return t}return l?(Ha(),g=a.fallback,l=t.mode,S=e.child,R=S.sibling,a=sa(S,{mode:"hidden",children:a.children}),a.subtreeFlags=S.subtreeFlags&65011712,R!==null?g=sa(R,g):(g=rl(g,l,n,null),g.flags|=2),g.return=t,a.return=t,a.sibling=g,t.child=a,qo(null,a),a=t.child,g=e.child.memoizedState,g===null?g=ac(n):(l=g.cachePool,l!==null?(S=Xt._currentValue,l=l.parent!==S?{parent:S,pool:S}:l):l=dd(),g={baseLanes:g.baseLanes|n,cachePool:l}),a.memoizedState=g,a.childLanes=lc(e,u,n),t.memoizedState=nc,qo(e.child,a)):(Oa(t),n=e.child,e=n.sibling,n=sa(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(u=t.deletions,u===null?(t.deletions=[e],t.flags|=16):u.push(e)),t.child=n,t.memoizedState=null,n)}function oc(e,t){return t=nr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function nr(e,t){return e=kn(22,e,null,t),e.lanes=0,e}function ic(e,t,n){return pl(t,e.child,null,n),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zf(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Ss(e.return,t,n)}function rc(e,t,n,a,l,o){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:l,treeForkCount:o}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=a,u.tail=n,u.tailMode=l,u.treeForkCount=o)}function Mf(e,t,n){var a=t.pendingProps,l=a.revealOrder,o=a.tail;a=a.children;var u=qt.current,g=(u&2)!==0;if(g?(u=u&1|2,t.flags|=128):u&=1,ne(qt,u),tn(e,t,a,n),a=et?Do:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zf(e,n,t);else if(e.tag===19)zf(e,n,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(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Vi(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),rc(t,!1,l,n,o,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Vi(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}rc(t,!0,n,null,o,a);break;case"together":rc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function pa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Na|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Bl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,n=sa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=sa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Bi(e)))}function ag(e,t,n){switch(t.tag){case 3:lt(t,t.stateNode.containerInfo),Ea(t,Xt,e.memoizedState.cache),sl();break;case 27:case 5:$t(t);break;case 4:lt(t,t.stateNode.containerInfo);break;case 10:Ea(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,_s(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Oa(t),t.flags|=128,null):(n&t.child.childLanes)!==0?kf(e,t,n):(Oa(t),e=pa(e,t,n),e!==null?e.sibling:null);Oa(t);break;case 19:var l=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Bl(e,t,n,!1),a=(n&t.childLanes)!==0),l){if(a)return Mf(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),ne(qt,qt.current),a)break;return null;case 22:return t.lanes=0,bf(e,t,n,t.pendingProps);case 24:Ea(t,Xt,e.memoizedState.cache)}return pa(e,t,n)}function Df(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qt=!0;else{if(!sc(e,n)&&(t.flags&128)===0)return Qt=!1,ag(e,t,n);Qt=(e.flags&131072)!==0}else Qt=!1,et&&(t.flags&1048576)!==0&&ld(t,Do,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=fl(t.elementType),t.type=e,typeof e=="function")hs(e)?(a=ml(e,a),t.tag=1,t=wf(null,t,e,a,n)):(t.tag=0,t=tc(null,t,e,a,n));else{if(e!=null){var l=e.$$typeof;if(l===oe){t.tag=11,t=gf(null,t,e,a,n);break e}else if(l===te){t.tag=14,t=mf(null,t,e,a,n);break e}}throw t=re(e)||e,Error(d(306,t,""))}}return t;case 0:return tc(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,l=ml(a,t.pendingProps),wf(e,t,a,l,n);case 3:e:{if(lt(t,t.stateNode.containerInfo),e===null)throw Error(d(387));a=t.pendingProps;var o=t.memoizedState;l=o.element,Ts(e,t),Ho(t,a,null,n);var u=t.memoizedState;if(a=u.cache,Ea(t,Xt,a),a!==o.cache&&ws(t,[Xt],n,!0),Oo(),a=u.element,o.isDehydrated)if(o={element:a,isDehydrated:!1,cache:u.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Cf(e,t,a,n);break e}else if(a!==l){l=On(Error(d(424)),t),To(l),t=Cf(e,t,a,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,zt=jn(e.firstChild),Pt=t,et=!0,Ta=null,Un=!0,n=yd(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(sl(),a===l){t=pa(e,t,n);break e}tn(e,t,a,n)}t=t.child}return t;case 26:return tr(e,t),e===null?(n=Nh(t.type,null,t.pendingProps,null))?t.memoizedState=n:et||(n=t.type,e=t.pendingProps,a=br(Te.current).createElement(n),a[At]=t,a[jt]=e,nn(a,n,e),Se(a),t.stateNode=a):t.memoizedState=Nh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return $t(t),e===null&&et&&(a=t.stateNode=Hh(t.type,t.pendingProps,Te.current),Pt=t,Un=!0,l=zt,Xa(t.type)?(Yc=l,zt=jn(a.firstChild)):zt=l),tn(e,t,t.pendingProps.children,n),tr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&et&&((l=a=zt)&&(a=_g(a,t.type,t.pendingProps,Un),a!==null?(t.stateNode=a,Pt=t,zt=jn(a.firstChild),Un=!1,l=!0):l=!1),l||Aa(t)),$t(t),l=t.type,o=t.pendingProps,u=e!==null?e.memoizedProps:null,a=o.children,Bc(l,o)?a=null:u!==null&&Bc(l,u)&&(t.flags|=32),t.memoizedState!==null&&(l=Hs(e,t,Z0,null,null,n),ti._currentValue=l),tr(e,t),tn(e,t,a,n),t.child;case 6:return e===null&&et&&((e=n=zt)&&(n=Og(n,t.pendingProps,Un),n!==null?(t.stateNode=n,Pt=t,zt=null,e=!0):e=!1),e||Aa(t)),null;case 13:return kf(e,t,n);case 4:return lt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=pl(t,null,a,n):tn(e,t,a,n),t.child;case 11:return gf(e,t,t.type,t.pendingProps,n);case 7:return tn(e,t,t.pendingProps,n),t.child;case 8:return tn(e,t,t.pendingProps.children,n),t.child;case 12:return tn(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Ea(t,t.type,a.value),tn(e,t,a.children,n),t.child;case 9:return l=t.type._context,a=t.pendingProps.children,ul(t),l=en(l),a=a(l),t.flags|=1,tn(e,t,a,n),t.child;case 14:return mf(e,t,t.type,t.pendingProps,n);case 15:return yf(e,t,t.type,t.pendingProps,n);case 19:return Mf(e,t,n);case 31:return ng(e,t,n);case 22:return bf(e,t,n,t.pendingProps);case 24:return ul(t),a=en(Xt),e===null?(l=zs(),l===null&&(l=xt,o=Cs(),l.pooledCache=o,o.refCount++,o!==null&&(l.pooledCacheLanes|=n),l=o),t.memoizedState={parent:a,cache:l},Ds(t),Ea(t,Xt,l)):((e.lanes&n)!==0&&(Ts(e,t),Ho(t,null,null,n),Oo()),l=e.memoizedState,o=t.memoizedState,l.parent!==a?(l={parent:a,cache:a},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Ea(t,Xt,a)):(a=o.cache,Ea(t,Xt,a),a!==l.cache&&ws(t,[Xt],n,!0))),tn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function ga(e){e.flags|=4}function cc(e,t,n,a,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(eh())e.flags|=8192;else throw hl=qi,Ms}else e.flags&=-16777217}function Tf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xh(t))if(eh())e.flags|=8192;else throw hl=qi,Ms}function ar(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?mi():536870912,e.lanes|=t,Zl|=t)}function Yo(e,t){if(!et)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags&65011712,a|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags,a|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function lg(e,t,n){var a=t.pendingProps;switch(ys(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(t),null;case 1:return Mt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),da(Xt),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?ga(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,vs())),Mt(t),null;case 26:var l=t.type,o=t.memoizedState;return e===null?(ga(t),o!==null?(Mt(t),Tf(t,o)):(Mt(t),cc(t,l,null,a,n))):o?o!==e.memoizedState?(ga(t),Mt(t),Tf(t,o)):(Mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ga(t),Mt(t),cc(t,l,e,a,n)),null;case 27:if(Je(t),n=Te.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ga(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return Mt(t),null}e=se.current,Hl(t)?id(t):(e=Hh(l,a,n),t.stateNode=e,ga(t))}return Mt(t),null;case 5:if(Je(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ga(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return Mt(t),null}if(o=se.current,Hl(t))id(t);else{var u=br(Te.current);switch(o){case 1:o=u.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:o=u.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":o=u.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":o=u.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":o=u.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is=="string"?u.createElement("select",{is:a.is}):u.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is=="string"?u.createElement(l,{is:a.is}):u.createElement(l)}}o[At]=t,o[jt]=a;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)o.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=o;e:switch(nn(o,l,a),l){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ga(t)}}return Mt(t),cc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ga(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(d(166));if(e=Te.current,Hl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=Pt,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[At]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||kh(e.nodeValue,n)),e||Aa(t,!0)}else e=br(e).createTextNode(a),e[At]=t,t.stateNode=e}return Mt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Hl(t),n!==null){if(e===null){if(!a)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[At]=t}else sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Mt(t),e=!1}else n=vs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mn(t),t):(Mn(t),null);if((t.flags&128)!==0)throw Error(d(558))}return Mt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Hl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(317));l[At]=t}else sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Mt(t),l=!1}else l=vs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(Mn(t),t):(Mn(t),null)}return Mn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==l&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ar(t,t.updateQueue),Mt(t),null);case 4:return _e(),e===null&&Rc(t.stateNode.containerInfo),Mt(t),null;case 10:return da(t.type),Mt(t),null;case 19:if(O(qt),a=t.memoizedState,a===null)return Mt(t),null;if(l=(t.flags&128)!==0,o=a.rendering,o===null)if(l)Yo(a,!1);else{if(Ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Vi(e),o!==null){for(t.flags|=128,Yo(a,!1),e=o.updateQueue,t.updateQueue=e,ar(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)td(n,e),n=n.sibling;return ne(qt,qt.current&1|2),et&&ca(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Tt()>sr&&(t.flags|=128,l=!0,Yo(a,!1),t.lanes=4194304)}else{if(!l)if(e=Vi(o),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,ar(t,e),Yo(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!et)return Mt(t),null}else 2*Tt()-a.renderingStartTime>sr&&n!==536870912&&(t.flags|=128,l=!0,Yo(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Tt(),e.sibling=null,n=qt.current,ne(qt,l?n&1|2:n&1),et&&ca(t,a.treeForkCount),e):(Mt(t),null);case 22:case 23:return Mn(t),Ls(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Mt(t),t.subtreeFlags&6&&(t.flags|=8192)):Mt(t),n=t.updateQueue,n!==null&&ar(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&O(dl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),da(Xt),Mt(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function og(e,t){switch(ys(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return da(Xt),_e(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Je(t),null;case 31:if(t.memoizedState!==null){if(Mn(t),t.alternate===null)throw Error(d(340));sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(qt),null;case 4:return _e(),null;case 10:return da(t.type),null;case 22:case 23:return Mn(t),Ls(),e!==null&&O(dl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return da(Xt),null;case 25:return null;default:return null}}function Af(e,t){switch(ys(t),t.tag){case 3:da(Xt),_e();break;case 26:case 27:case 5:Je(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&Mn(t);break;case 13:Mn(t);break;case 19:O(qt);break;case 10:da(t.type);break;case 22:case 23:Mn(t),Ls(),e!==null&&O(dl);break;case 24:da(Xt)}}function Go(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var o=n.create,u=n.inst;a=o(),u.destroy=a}n=n.next}while(n!==l)}}catch(g){gt(t,t.return,g)}}function Ba(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var o=l.next;a=o;do{if((a.tag&e)===e){var u=a.inst,g=u.destroy;if(g!==void 0){u.destroy=void 0,l=t;var S=n,R=g;try{R()}catch(Y){gt(l,S,Y)}}}a=a.next}while(a!==o)}}catch(Y){gt(t,t.return,Y)}}function Ef(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{vd(t,n)}catch(a){gt(e,e.return,a)}}}function Rf(e,t,n){n.props=ml(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){gt(e,t,a)}}function Xo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(l){gt(e,t,l)}}function $n(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){gt(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){gt(e,t,l)}else n.current=null}function Lf(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(l){gt(e,e.return,l)}}function uc(e,t,n){try{var a=e.stateNode;Dg(a,e.type,n,t),a[jt]=t}catch(l){gt(e,e.return,l)}}function _f(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xa(e.type)||e.tag===4}function dc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_f(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&&Xa(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 fc(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ia));else if(a!==4&&(a===27&&Xa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(fc(e,t,n),e=e.sibling;e!==null;)fc(e,t,n),e=e.sibling}function lr(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Xa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(lr(e,t,n),e=e.sibling;e!==null;)lr(e,t,n),e=e.sibling}function Of(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);nn(t,a,n),t[At]=e,t[jt]=n}catch(o){gt(e,e.return,o)}}var ma=!1,Ft=!1,hc=!1,Hf=typeof WeakSet=="function"?WeakSet:Set,It=null;function ig(e,t){if(e=e.containerInfo,Oc=zr,e=Fu(e),is(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var l=a.anchorOffset,o=a.focusNode;a=a.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var u=0,g=-1,S=-1,R=0,Y=0,F=e,L=null;t:for(;;){for(var U;F!==n||l!==0&&F.nodeType!==3||(g=u+l),F!==o||a!==0&&F.nodeType!==3||(S=u+a),F.nodeType===3&&(u+=F.nodeValue.length),(U=F.firstChild)!==null;)L=F,F=U;for(;;){if(F===e)break t;if(L===n&&++R===l&&(g=u),L===o&&++Y===a&&(S=u),(U=F.nextSibling)!==null)break;F=L,L=F.parentNode}F=U}n=g===-1||S===-1?null:{start:g,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(Hc={focusedElem:e,selectionRange:n},zr=!1,It=t;It!==null;)if(t=It,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,It=e;else for(;It!==null;){switch(t=It,o=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(n=0;n<e.length;n++)l=e[n],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,n=t,l=o.memoizedProps,o=o.memoizedState,a=n.stateNode;try{var be=ml(n.type,l);e=a.getSnapshotBeforeUpdate(be,o),a.__reactInternalSnapshotBeforeUpdate=e}catch(Le){gt(n,n.return,Le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Nc(e);else if(n===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(d(163))}if(e=t.sibling,e!==null){e.return=t.return,It=e;break}It=t.return}}function Bf(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:ba(e,n),a&4&&Go(5,n);break;case 1:if(ba(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(u){gt(n,n.return,u)}else{var l=ml(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(u){gt(n,n.return,u)}}a&64&&Ef(n),a&512&&Xo(n,n.return);break;case 3:if(ba(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{vd(e,t)}catch(u){gt(n,n.return,u)}}break;case 27:t===null&&a&4&&Of(n);case 26:case 5:ba(e,n),t===null&&a&4&&Lf(n),a&512&&Xo(n,n.return);break;case 12:ba(e,n);break;case 31:ba(e,n),a&4&&jf(e,n);break;case 13:ba(e,n),a&4&&qf(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gg.bind(null,n),Hg(e,n))));break;case 22:if(a=n.memoizedState!==null||ma,!a){t=t!==null&&t.memoizedState!==null||Ft,l=ma;var o=Ft;ma=a,(Ft=t)&&!o?va(e,n,(n.subtreeFlags&8772)!==0):ba(e,n),ma=l,Ft=o}break;case 30:break;default:ba(e,n)}}function Uf(e){var t=e.alternate;t!==null&&(e.alternate=null,Uf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mo(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 Et=null,pn=!1;function ya(e,t,n){for(n=n.child;n!==null;)Nf(e,t,n),n=n.sibling}function Nf(e,t,n){if(ae&&typeof ae.onCommitFiberUnmount=="function")try{ae.onCommitFiberUnmount(H,n)}catch{}switch(n.tag){case 26:Ft||$n(n,t),ya(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ft||$n(n,t);var a=Et,l=pn;Xa(n.type)&&(Et=n.stateNode,pn=!1),ya(e,t,n),Io(n.stateNode),Et=a,pn=l;break;case 5:Ft||$n(n,t);case 6:if(a=Et,l=pn,Et=null,ya(e,t,n),Et=a,pn=l,Et!==null)if(pn)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(n.stateNode)}catch(o){gt(n,t,o)}else try{Et.removeChild(n.stateNode)}catch(o){gt(n,t,o)}break;case 18:Et!==null&&(pn?(e=Et,Eh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),no(e)):Eh(Et,n.stateNode));break;case 4:a=Et,l=pn,Et=n.stateNode.containerInfo,pn=!0,ya(e,t,n),Et=a,pn=l;break;case 0:case 11:case 14:case 15:Ba(2,n,t),Ft||Ba(4,n,t),ya(e,t,n);break;case 1:Ft||($n(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Rf(n,t,a)),ya(e,t,n);break;case 21:ya(e,t,n);break;case 22:Ft=(a=Ft)||n.memoizedState!==null,ya(e,t,n),Ft=a;break;default:ya(e,t,n)}}function jf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{no(e)}catch(n){gt(t,t.return,n)}}}function qf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{no(e)}catch(n){gt(t,t.return,n)}}function rg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Hf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Hf),t;default:throw Error(d(435,e.tag))}}function or(e,t){var n=rg(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var l=mg.bind(null,e,a);a.then(l,l)}})}function gn(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var l=n[a],o=e,u=t,g=u;e:for(;g!==null;){switch(g.tag){case 27:if(Xa(g.type)){Et=g.stateNode,pn=!1;break e}break;case 5:Et=g.stateNode,pn=!1;break e;case 3:case 4:Et=g.stateNode.containerInfo,pn=!0;break e}g=g.return}if(Et===null)throw Error(d(160));Nf(o,u,l),Et=null,pn=!1,o=l.alternate,o!==null&&(o.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Yf(t,e),t=t.sibling}var Vn=null;function Yf(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gn(t,e),mn(e),a&4&&(Ba(3,e,e.return),Go(3,e),Ba(5,e,e.return));break;case 1:gn(t,e),mn(e),a&512&&(Ft||n===null||$n(n,n.return)),a&64&&ma&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var l=Vn;if(gn(t,e),mn(e),a&512&&(Ft||n===null||$n(n,n.return)),a&4){var o=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,l=l.ownerDocument||l;t:switch(a){case"title":o=l.getElementsByTagName("title")[0],(!o||o[nl]||o[At]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=l.createElement(a),l.head.insertBefore(o,l.querySelector("head > title"))),nn(o,a,n),o[At]=e,Se(o),a=o;break e;case"link":var u=Yh("link","href",l).get(a+(n.href||""));if(u){for(var g=0;g<u.length;g++)if(o=u[g],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){u.splice(g,1);break t}}o=l.createElement(a),nn(o,a,n),l.head.appendChild(o);break;case"meta":if(u=Yh("meta","content",l).get(a+(n.content||""))){for(g=0;g<u.length;g++)if(o=u[g],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){u.splice(g,1);break t}}o=l.createElement(a),nn(o,a,n),l.head.appendChild(o);break;default:throw Error(d(468,a))}o[At]=e,Se(o),a=o}e.stateNode=a}else Gh(l,e.type,e.stateNode);else e.stateNode=qh(l,a,e.memoizedProps);else o!==a?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,a===null?Gh(l,e.type,e.stateNode):qh(l,a,e.memoizedProps)):a===null&&e.stateNode!==null&&uc(e,e.memoizedProps,n.memoizedProps)}break;case 27:gn(t,e),mn(e),a&512&&(Ft||n===null||$n(n,n.return)),n!==null&&a&4&&uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gn(t,e),mn(e),a&512&&(Ft||n===null||$n(n,n.return)),e.flags&32){l=e.stateNode;try{zl(l,"")}catch(be){gt(e,e.return,be)}}a&4&&e.stateNode!=null&&(l=e.memoizedProps,uc(e,l,n!==null?n.memoizedProps:l)),a&1024&&(hc=!0);break;case 6:if(gn(t,e),mn(e),a&4){if(e.stateNode===null)throw Error(d(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(be){gt(e,e.return,be)}}break;case 3:if(Sr=null,l=Vn,Vn=vr(t.containerInfo),gn(t,e),Vn=l,mn(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{no(t.containerInfo)}catch(be){gt(e,e.return,be)}hc&&(hc=!1,Gf(e));break;case 4:a=Vn,Vn=vr(e.stateNode.containerInfo),gn(t,e),mn(e),Vn=a;break;case 12:gn(t,e),mn(e);break;case 31:gn(t,e),mn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,or(e,a)));break;case 13:gn(t,e),mn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(rr=Tt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,or(e,a)));break;case 22:l=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,R=ma,Y=Ft;if(ma=R||l,Ft=Y||S,gn(t,e),Ft=Y,ma=R,mn(e),a&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(n===null||S||ma||Ft||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){S=n=t;try{if(o=S.stateNode,l)u=o.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none";else{g=S.stateNode;var F=S.memoizedProps.style,L=F!=null&&F.hasOwnProperty("display")?F.display:null;g.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(be){gt(S,S.return,be)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=l?"":S.memoizedProps}catch(be){gt(S,S.return,be)}}}else if(t.tag===18){if(n===null){S=t;try{var U=S.stateNode;l?Rh(U,!0):Rh(S.stateNode,!1)}catch(be){gt(S,S.return,be)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,or(e,n))));break;case 19:gn(t,e),mn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,or(e,a)));break;case 30:break;case 21:break;default:gn(t,e),mn(e)}}function mn(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(_f(a)){n=a;break}a=a.return}if(n==null)throw Error(d(160));switch(n.tag){case 27:var l=n.stateNode,o=dc(e);lr(e,o,l);break;case 5:var u=n.stateNode;n.flags&32&&(zl(u,""),n.flags&=-33);var g=dc(e);lr(e,g,u);break;case 3:case 4:var S=n.stateNode.containerInfo,R=dc(e);fc(e,R,S);break;default:throw Error(d(161))}}catch(Y){gt(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ba(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Bf(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ba(4,t,t.return),yl(t);break;case 1:$n(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Rf(t,t.return,n),yl(t);break;case 27:Io(t.stateNode);case 26:case 5:$n(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function va(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,l=e,o=t,u=o.flags;switch(o.tag){case 0:case 11:case 15:va(l,o,n),Go(4,o);break;case 1:if(va(l,o,n),a=o,l=a.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(R){gt(a,a.return,R)}if(a=o,l=a.updateQueue,l!==null){var g=a.stateNode;try{var S=l.shared.hiddenCallbacks;if(S!==null)for(l.shared.hiddenCallbacks=null,l=0;l<S.length;l++)bd(S[l],g)}catch(R){gt(a,a.return,R)}}n&&u&64&&Ef(o),Xo(o,o.return);break;case 27:Of(o);case 26:case 5:va(l,o,n),n&&a===null&&u&4&&Lf(o),Xo(o,o.return);break;case 12:va(l,o,n);break;case 31:va(l,o,n),n&&u&4&&jf(l,o);break;case 13:va(l,o,n),n&&u&4&&qf(l,o);break;case 22:o.memoizedState===null&&va(l,o,n),Xo(o,o.return);break;case 30:break;default:va(l,o,n)}t=t.sibling}}function pc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ao(n))}function gc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ao(e))}function Qn(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Xf(e,t,n,a),t=t.sibling}function Xf(e,t,n,a){var l=t.flags;switch(t.tag){case 0:case 11:case 15:Qn(e,t,n,a),l&2048&&Go(9,t);break;case 1:Qn(e,t,n,a);break;case 3:Qn(e,t,n,a),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ao(e)));break;case 12:if(l&2048){Qn(e,t,n,a),e=t.stateNode;try{var o=t.memoizedProps,u=o.id,g=o.onPostCommit;typeof g=="function"&&g(u,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){gt(t,t.return,S)}}else Qn(e,t,n,a);break;case 31:Qn(e,t,n,a);break;case 13:Qn(e,t,n,a);break;case 23:break;case 22:o=t.stateNode,u=t.alternate,t.memoizedState!==null?o._visibility&2?Qn(e,t,n,a):Vo(e,t):o._visibility&2?Qn(e,t,n,a):(o._visibility|=2,Ql(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),l&2048&&pc(u,t);break;case 24:Qn(e,t,n,a),l&2048&&gc(t.alternate,t);break;default:Qn(e,t,n,a)}}function Ql(e,t,n,a,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,u=t,g=n,S=a,R=u.flags;switch(u.tag){case 0:case 11:case 15:Ql(o,u,g,S,l),Go(8,u);break;case 23:break;case 22:var Y=u.stateNode;u.memoizedState!==null?Y._visibility&2?Ql(o,u,g,S,l):Vo(o,u):(Y._visibility|=2,Ql(o,u,g,S,l)),l&&R&2048&&pc(u.alternate,u);break;case 24:Ql(o,u,g,S,l),l&&R&2048&&gc(u.alternate,u);break;default:Ql(o,u,g,S,l)}t=t.sibling}}function Vo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,l=a.flags;switch(a.tag){case 22:Vo(n,a),l&2048&&pc(a.alternate,a);break;case 24:Vo(n,a),l&2048&&gc(a.alternate,a);break;default:Vo(n,a)}t=t.sibling}}var Qo=8192;function Fl(e,t,n){if(e.subtreeFlags&Qo)for(e=e.child;e!==null;)Vf(e,t,n),e=e.sibling}function Vf(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Qo&&e.memoizedState!==null&&Kg(n,Vn,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var a=Vn;Vn=vr(e.stateNode.containerInfo),Fl(e,t,n),Vn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Qo,Qo=16777216,Fl(e,t,n),Qo=a):Fl(e,t,n));break;default:Fl(e,t,n)}}function Qf(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 Fo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];It=a,Kf(a,e)}Qf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ff(e),e=e.sibling}function Ff(e){switch(e.tag){case 0:case 11:case 15:Fo(e),e.flags&2048&&Ba(9,e,e.return);break;case 3:Fo(e);break;case 12:Fo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ir(e)):Fo(e);break;default:Fo(e)}}function ir(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];It=a,Kf(a,e)}Qf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ba(8,t,t.return),ir(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ir(t));break;default:ir(t)}e=e.sibling}}function Kf(e,t){for(;It!==null;){var n=It;switch(n.tag){case 0:case 11:case 15:Ba(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ao(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,It=a;else e:for(n=e;It!==null;){a=It;var l=a.sibling,o=a.return;if(Uf(a),a===n){It=null;break e}if(l!==null){l.return=o,It=l;break e}It=o}}}var sg={getCacheForType:function(e){var t=en(Xt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return en(Xt).controller.signal}},cg=typeof WeakMap=="function"?WeakMap:Map,rt=0,xt=null,Ke=null,$e=0,pt=0,Dn=null,Ua=!1,Kl=!1,mc=!1,xa=0,Ot=0,Na=0,bl=0,yc=0,Tn=0,Zl=0,Ko=null,yn=null,bc=!1,rr=0,Zf=0,sr=1/0,cr=null,ja=null,Jt=0,qa=null,Jl=null,Sa=0,vc=0,xc=null,Jf=null,Zo=0,Sc=null;function An(){return(rt&2)!==0&&$e!==0?$e&-$e:A.T!==null?Dc():vi()}function $f(){if(Tn===0)if(($e&536870912)===0||et){var e=ta;ta<<=1,(ta&3932160)===0&&(ta=262144),Tn=e}else Tn=536870912;return e=zn.current,e!==null&&(e.flags|=32),Tn}function bn(e,t,n){(e===xt&&(pt===2||pt===9)||e.cancelPendingCommit!==null)&&($l(e,0),Ya(e,$e,Tn,!1)),tl(e,n),((rt&2)===0||e!==xt)&&(e===xt&&((rt&2)===0&&(bl|=n),Ot===4&&Ya(e,$e,Tn,!1)),Wn(e))}function Wf(e,t,n){if((rt&6)!==0)throw Error(d(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||el(e,t),l=a?fg(e,t):Cc(e,t,!0),o=a;do{if(l===0){Kl&&!a&&Ya(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!ug(n)){l=Cc(e,t,!1),o=!1;continue}if(l===2){if(o=t,e.errorRecoveryDisabledLanes&o)var u=0;else u=e.pendingLanes&-536870913,u=u!==0?u:u&536870912?536870912:0;if(u!==0){t=u;e:{var g=e;l=Ko;var S=g.current.memoizedState.isDehydrated;if(S&&($l(g,u).flags|=256),u=Cc(g,u,!1),u!==2){if(mc&&!S){g.errorRecoveryDisabledLanes|=o,bl|=o,l=4;break e}o=yn,yn=l,o!==null&&(yn===null?yn=o:yn.push.apply(yn,o))}l=u}if(o=!1,l!==2)continue}}if(l===1){$l(e,0),Ya(e,t,0,!0);break}e:{switch(a=e,o=l,o){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:Ya(a,t,Tn,!Ua);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(l=rr+300-Tt(),10<l)){if(Ya(a,t,Tn,!Ua),wl(a,0,!0)!==0)break e;Sa=t,a.timeoutHandle=Th(If.bind(null,a,n,yn,cr,bc,t,Tn,bl,Zl,Ua,o,"Throttled",-0,0),l);break e}If(a,n,yn,cr,bc,t,Tn,bl,Zl,Ua,o,null,-0,0)}}break}while(!0);Wn(e)}function If(e,t,n,a,l,o,u,g,S,R,Y,F,L,U){if(e.timeoutHandle=-1,F=t.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},Vf(t,o,F);var be=(o&62914560)===o?rr-Tt():(o&4194048)===o?Zf-Tt():0;if(be=Zg(F,be),be!==null){Sa=o,e.cancelPendingCommit=be(ih.bind(null,e,t,o,n,a,l,u,g,S,Y,F,null,L,U)),Ya(e,o,u,!R);return}}ih(e,t,o,n,a,l,u,g,S)}function ug(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var l=n[a],o=l.getSnapshot;l=l.value;try{if(!Cn(o(),l))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Ya(e,t,n,a){t&=~yc,t&=~bl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var l=t;0<l;){var o=31-Xe(l),u=1<<o;a[o]=-1,l&=~u}n!==0&&yi(e,n,t)}function ur(){return(rt&6)===0?(Jo(0),!1):!0}function wc(){if(Ke!==null){if(pt===0)var e=Ke.return;else e=Ke,ua=cl=null,Ns(e),ql=null,Ro=0,e=Ke;for(;e!==null;)Af(e.alternate,e),e=e.return;Ke=null}}function $l(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Eg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sa=0,wc(),xt=e,Ke=n=sa(e.current,null),$e=t,pt=0,Dn=null,Ua=!1,Kl=el(e,t),mc=!1,Zl=Tn=yc=bl=Na=Ot=0,yn=Ko=null,bc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-Xe(a),o=1<<l;t|=e[l],a&=~o}return xa=t,Ri(),n}function Pf(e,t){Qe=null,A.H=jo,t===jl||t===ji?(t=pd(),pt=3):t===Ms?(t=pd(),pt=4):pt=t===ec?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Dn=t,Ke===null&&(Ot=1,Pi(e,On(t,e.current)))}function eh(){var e=zn.current;return e===null?!0:($e&4194048)===$e?Nn===null:($e&62914560)===$e||($e&536870912)!==0?e===Nn:!1}function th(){var e=A.H;return A.H=jo,e===null?jo:e}function nh(){var e=A.A;return A.A=sg,e}function dr(){Ot=4,Ua||($e&4194048)!==$e&&zn.current!==null||(Kl=!0),(Na&134217727)===0&&(bl&134217727)===0||xt===null||Ya(xt,$e,Tn,!1)}function Cc(e,t,n){var a=rt;rt|=2;var l=th(),o=nh();(xt!==e||$e!==t)&&(cr=null,$l(e,t)),t=!1;var u=Ot;e:do try{if(pt!==0&&Ke!==null){var g=Ke,S=Dn;switch(pt){case 8:wc(),u=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(t=!0);var R=pt;if(pt=0,Dn=null,Wl(e,g,S,R),n&&Kl){u=0;break e}break;default:R=pt,pt=0,Dn=null,Wl(e,g,S,R)}}dg(),u=Ot;break}catch(Y){Pf(e,Y)}while(!0);return t&&e.shellSuspendCounter++,ua=cl=null,rt=a,A.H=l,A.A=o,Ke===null&&(xt=null,$e=0,Ri()),u}function dg(){for(;Ke!==null;)ah(Ke)}function fg(e,t){var n=rt;rt|=2;var a=th(),l=nh();xt!==e||$e!==t?(cr=null,sr=Tt()+500,$l(e,t)):Kl=el(e,t);e:do try{if(pt!==0&&Ke!==null){t=Ke;var o=Dn;t:switch(pt){case 1:pt=0,Dn=null,Wl(e,t,o,1);break;case 2:case 9:if(fd(o)){pt=0,Dn=null,lh(t);break}t=function(){pt!==2&&pt!==9||xt!==e||(pt=7),Wn(e)},o.then(t,t);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:fd(o)?(pt=0,Dn=null,lh(t)):(pt=0,Dn=null,Wl(e,t,o,7));break;case 5:var u=null;switch(Ke.tag){case 26:u=Ke.memoizedState;case 5:case 27:var g=Ke;if(u?Xh(u):g.stateNode.complete){pt=0,Dn=null;var S=g.sibling;if(S!==null)Ke=S;else{var R=g.return;R!==null?(Ke=R,fr(R)):Ke=null}break t}}pt=0,Dn=null,Wl(e,t,o,5);break;case 6:pt=0,Dn=null,Wl(e,t,o,6);break;case 8:wc(),Ot=6;break e;default:throw Error(d(462))}}hg();break}catch(Y){Pf(e,Y)}while(!0);return ua=cl=null,A.H=a,A.A=l,rt=n,Ke!==null?0:(xt=null,$e=0,Ri(),Ot)}function hg(){for(;Ke!==null&&!wt();)ah(Ke)}function ah(e){var t=Df(e.alternate,e,xa);e.memoizedProps=e.pendingProps,t===null?fr(e):Ke=t}function lh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Sf(n,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Sf(n,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:Ns(t);default:Af(n,t),t=Ke=td(t,xa),t=Df(n,t,xa)}e.memoizedProps=e.pendingProps,t===null?fr(e):Ke=t}function Wl(e,t,n,a){ua=cl=null,Ns(t),ql=null,Ro=0;var l=t.return;try{if(tg(e,l,t,n,$e)){Ot=1,Pi(e,On(n,e.current)),Ke=null;return}}catch(o){if(l!==null)throw Ke=l,o;Ot=1,Pi(e,On(n,e.current)),Ke=null;return}t.flags&32768?(et||a===1?e=!0:Kl||($e&536870912)!==0?e=!1:(Ua=e=!0,(a===2||a===9||a===3||a===6)&&(a=zn.current,a!==null&&a.tag===13&&(a.flags|=16384))),oh(t,e)):fr(t)}function fr(e){var t=e;do{if((t.flags&32768)!==0){oh(t,Ua);return}e=t.return;var n=lg(t.alternate,t,xa);if(n!==null){Ke=n;return}if(t=t.sibling,t!==null){Ke=t;return}Ke=t=e}while(t!==null);Ot===0&&(Ot=5)}function oh(e,t){do{var n=og(e.alternate,e);if(n!==null){n.flags&=32767,Ke=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ke=e;return}Ke=e=n}while(e!==null);Ot=6,Ke=null}function ih(e,t,n,a,l,o,u,g,S){e.cancelPendingCommit=null;do hr();while(Jt!==0);if((rt&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(o=t.lanes|t.childLanes,o|=ds,Xr(e,n,o,u,g,S),e===xt&&(Ke=xt=null,$e=0),Jl=t,qa=e,Sa=n,vc=o,xc=l,Jf=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,yg(fn,function(){return dh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null,l=Z.p,Z.p=2,u=rt,rt|=4;try{ig(e,t,n)}finally{rt=u,Z.p=l,A.T=a}}Jt=1,rh(),sh(),ch()}}function rh(){if(Jt===1){Jt=0;var e=qa,t=Jl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null;var a=Z.p;Z.p=2;var l=rt;rt|=4;try{Yf(t,e);var o=Hc,u=Fu(e.containerInfo),g=o.focusedElem,S=o.selectionRange;if(u!==g&&g&&g.ownerDocument&&Qu(g.ownerDocument.documentElement,g)){if(S!==null&&is(g)){var R=S.start,Y=S.end;if(Y===void 0&&(Y=R),"selectionStart"in g)g.selectionStart=R,g.selectionEnd=Math.min(Y,g.value.length);else{var F=g.ownerDocument||document,L=F&&F.defaultView||window;if(L.getSelection){var U=L.getSelection(),be=g.textContent.length,Le=Math.min(S.start,be),vt=S.end===void 0?Le:Math.min(S.end,be);!U.extend&&Le>vt&&(u=vt,vt=Le,Le=u);var M=Vu(g,Le),k=Vu(g,vt);if(M&&k&&(U.rangeCount!==1||U.anchorNode!==M.node||U.anchorOffset!==M.offset||U.focusNode!==k.node||U.focusOffset!==k.offset)){var E=F.createRange();E.setStart(M.node,M.offset),U.removeAllRanges(),Le>vt?(U.addRange(E),U.extend(k.node,k.offset)):(E.setEnd(k.node,k.offset),U.addRange(E))}}}}for(F=[],U=g;U=U.parentNode;)U.nodeType===1&&F.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<F.length;g++){var V=F[g];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}zr=!!Oc,Hc=Oc=null}finally{rt=l,Z.p=a,A.T=n}}e.current=t,Jt=2}}function sh(){if(Jt===2){Jt=0;var e=qa,t=Jl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=A.T,A.T=null;var a=Z.p;Z.p=2;var l=rt;rt|=4;try{Bf(e,t.alternate,t)}finally{rt=l,Z.p=a,A.T=n}}Jt=3}}function ch(){if(Jt===4||Jt===3){Jt=0,Re();var e=qa,t=Jl,n=Sa,a=Jf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Jt=5:(Jt=0,Jl=qa=null,uh(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(ja=null),po(n),t=t.stateNode,ae&&typeof ae.onCommitFiberRoot=="function")try{ae.onCommitFiberRoot(H,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=A.T,l=Z.p,Z.p=2,A.T=null;try{for(var o=e.onRecoverableError,u=0;u<a.length;u++){var g=a[u];o(g.value,{componentStack:g.stack})}}finally{A.T=t,Z.p=l}}(Sa&3)!==0&&hr(),Wn(e),l=e.pendingLanes,(n&261930)!==0&&(l&42)!==0?e===Sc?Zo++:(Zo=0,Sc=e):Zo=0,Jo(0)}}function uh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ao(t)))}function hr(){return rh(),sh(),ch(),dh()}function dh(){if(Jt!==5)return!1;var e=qa,t=vc;vc=0;var n=po(Sa),a=A.T,l=Z.p;try{Z.p=32>n?32:n,A.T=null,n=xc,xc=null;var o=qa,u=Sa;if(Jt=0,Jl=qa=null,Sa=0,(rt&6)!==0)throw Error(d(331));var g=rt;if(rt|=4,Ff(o.current),Xf(o,o.current,u,n),rt=g,Jo(0,!1),ae&&typeof ae.onPostCommitFiberRoot=="function")try{ae.onPostCommitFiberRoot(H,o)}catch{}return!0}finally{Z.p=l,A.T=a,uh(e,t)}}function fh(e,t,n){t=On(n,t),t=Ps(e.stateNode,t,2),e=_a(e,t,2),e!==null&&(tl(e,2),Wn(e))}function gt(e,t,n){if(e.tag===3)fh(e,e,n);else for(;t!==null;){if(t.tag===3){fh(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ja===null||!ja.has(a))){e=On(n,e),n=hf(2),a=_a(t,n,2),a!==null&&(pf(n,a,t,e),tl(a,2),Wn(a));break}}t=t.return}}function kc(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new cg;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(mc=!0,l.add(n),e=pg.bind(null,e,t,n),t.then(e,e))}function pg(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,xt===e&&($e&n)===n&&(Ot===4||Ot===3&&($e&62914560)===$e&&300>Tt()-rr?(rt&2)===0&&$l(e,0):yc|=n,Zl===$e&&(Zl=0)),Wn(e)}function hh(e,t){t===0&&(t=mi()),e=il(e,t),e!==null&&(tl(e,t),Wn(e))}function gg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hh(e,n)}function mg(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(d(314))}a!==null&&a.delete(t),hh(e,n)}function yg(e,t){return Ie(e,t)}var pr=null,Il=null,zc=!1,gr=!1,Mc=!1,Ga=0;function Wn(e){e!==Il&&e.next===null&&(Il===null?pr=Il=e:Il=Il.next=e),gr=!0,zc||(zc=!0,vg())}function Jo(e,t){if(!Mc&&gr){Mc=!0;do for(var n=!1,a=pr;a!==null;){if(e!==0){var l=a.pendingLanes;if(l===0)var o=0;else{var u=a.suspendedLanes,g=a.pingedLanes;o=(1<<31-Xe(42|e)+1)-1,o&=l&~(u&~g),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,yh(a,o))}else o=$e,o=wl(a,a===xt?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||el(a,o)||(n=!0,yh(a,o));a=a.next}while(n);Mc=!1}}function bg(){ph()}function ph(){gr=zc=!1;var e=0;Ga!==0&&Ag()&&(e=Ga);for(var t=Tt(),n=null,a=pr;a!==null;){var l=a.next,o=gh(a,t);o===0?(a.next=null,n===null?pr=l:n.next=l,l===null&&(Il=n)):(n=a,(e!==0||(o&3)!==0)&&(gr=!0)),a=l}Jt!==0&&Jt!==5||Jo(e),Ga!==0&&(Ga=0)}function gh(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var u=31-Xe(o),g=1<<u,S=l[u];S===-1?((g&n)===0||(g&a)!==0)&&(l[u]=Gr(g,t)):S<=t&&(e.expiredLanes|=g),o&=~g}if(t=xt,n=$e,n=wl(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(pt===2||pt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Nt(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||el(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Nt(a),po(n)){case 2:case 8:n=Sn;break;case 32:n=fn;break;case 268435456:n=de;break;default:n=fn}return a=mh.bind(null,e),n=Ie(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Nt(a),e.callbackPriority=2,e.callbackNode=null,2}function mh(e,t){if(Jt!==0&&Jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hr()&&e.callbackNode!==n)return null;var a=$e;return a=wl(e,e===xt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Wf(e,a,t),gh(e,Tt()),e.callbackNode!=null&&e.callbackNode===n?mh.bind(null,e):null)}function yh(e,t){if(hr())return null;Wf(e,t,!0)}function vg(){Rg(function(){(rt&6)!==0?Ie(xn,bg):ph()})}function Dc(){if(Ga===0){var e=Ul;e===0&&(e=Ca,Ca<<=1,(Ca&261888)===0&&(Ca=256)),Ga=e}return Ga}function bh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ci(""+e)}function vh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function xg(e,t,n,a,l){if(t==="submit"&&n&&n.stateNode===l){var o=bh((l[jt]||null).action),u=a.submitter;u&&(t=(t=u[jt]||null)?bh(t.formAction):u.getAttribute("formAction"),t!==null&&(o=t,u=null));var g=new Di("action","action",null,a,l);e.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Ga!==0){var S=u?vh(l,u):new FormData(l);Ks(n,{pending:!0,data:S,method:l.method,action:o},null,S)}}else typeof o=="function"&&(g.preventDefault(),S=u?vh(l,u):new FormData(l),Ks(n,{pending:!0,data:S,method:l.method,action:o},o,S))},currentTarget:l}]})}}for(var Tc=0;Tc<us.length;Tc++){var Ac=us[Tc],Sg=Ac.toLowerCase(),wg=Ac[0].toUpperCase()+Ac.slice(1);Xn(Sg,"on"+wg)}Xn(Ju,"onAnimationEnd"),Xn($u,"onAnimationIteration"),Xn(Wu,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(N0,"onTransitionRun"),Xn(j0,"onTransitionStart"),Xn(q0,"onTransitionCancel"),Xn(Iu,"onTransitionEnd"),at("onMouseEnter",["mouseout","mouseover"]),at("onMouseLeave",["mouseout","mouseover"]),at("onPointerEnter",["pointerout","pointerover"]),at("onPointerLeave",["pointerout","pointerover"]),nt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nt("onBeforeInput",["compositionend","keypress","textInput","paste"]),nt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $o="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(" "),Cg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($o));function xh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],l=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var u=a.length-1;0<=u;u--){var g=a[u],S=g.instance,R=g.currentTarget;if(g=g.listener,S!==o&&l.isPropagationStopped())break e;o=g,l.currentTarget=R;try{o(l)}catch(Y){Ei(Y)}l.currentTarget=null,o=S}else for(u=0;u<a.length;u++){if(g=a[u],S=g.instance,R=g.currentTarget,g=g.listener,S!==o&&l.isPropagationStopped())break e;o=g,l.currentTarget=R;try{o(l)}catch(Y){Ei(Y)}l.currentTarget=null,o=S}}}}function Ze(e,t){var n=t[Cl];n===void 0&&(n=t[Cl]=new Set);var a=e+"__bubble";n.has(a)||(Sh(t,e,2,!1),n.add(a))}function Ec(e,t,n){var a=0;t&&(a|=4),Sh(n,e,a,t)}var mr="_reactListening"+Math.random().toString(36).slice(2);function Rc(e){if(!e[mr]){e[mr]=!0,Oe.forEach(function(n){n!=="selectionchange"&&(Cg.has(n)||Ec(n,!1,e),Ec(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mr]||(t[mr]=!0,Ec("selectionchange",!1,t))}}function Sh(e,t,n,a){switch($h(t)){case 2:var l=Wg;break;case 8:l=Ig;break;default:l=Fc}n=l.bind(null,t,n,e),l=void 0,!Wr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),a?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Lc(e,t,n,a,l){var o=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var u=a.tag;if(u===3||u===4){var g=a.stateNode.containerInfo;if(g===l)break;if(u===4)for(u=a.return;u!==null;){var S=u.tag;if((S===3||S===4)&&u.stateNode.containerInfo===l)return;u=u.return}for(;g!==null;){if(u=la(g),u===null)return;if(S=u.tag,S===5||S===6||S===26||S===27){a=o=u;continue e}g=g.parentNode}}a=a.return}zu(function(){var R=o,Y=Jr(n),F=[];e:{var L=Pu.get(e);if(L!==void 0){var U=Di,be=e;switch(e){case"keypress":if(zi(n)===0)break e;case"keydown":case"keyup":U=m0;break;case"focusin":be="focus",U=ts;break;case"focusout":be="blur",U=ts;break;case"beforeblur":case"afterblur":U=ts;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=Tu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=l0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=v0;break;case Ju:case $u:case Wu:U=r0;break;case Iu:U=S0;break;case"scroll":case"scrollend":U=n0;break;case"wheel":U=C0;break;case"copy":case"cut":case"paste":U=c0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=Eu;break;case"toggle":case"beforetoggle":U=z0}var Le=(t&4)!==0,vt=!Le&&(e==="scroll"||e==="scrollend"),M=Le?L!==null?L+"Capture":null:L;Le=[];for(var k=R,E;k!==null;){var V=k;if(E=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||E===null||M===null||(V=bo(k,M),V!=null&&Le.push(Wo(k,V,E))),vt)break;k=k.return}0<Le.length&&(L=new U(L,be,null,n,Y),F.push({event:L,listeners:Le}))}}if((t&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",L&&n!==Zr&&(be=n.relatedTarget||n.fromElement)&&(la(be)||be[wn]))break e;if((U||L)&&(L=Y.window===Y?Y:(L=Y.ownerDocument)?L.defaultView||L.parentWindow:window,U?(be=n.relatedTarget||n.toElement,U=R,be=be?la(be):null,be!==null&&(vt=p(be),Le=be.tag,be!==vt||Le!==5&&Le!==27&&Le!==6)&&(be=null)):(U=null,be=R),U!==be)){if(Le=Tu,V="onMouseLeave",M="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(Le=Eu,V="onPointerLeave",M="onPointerEnter",k="pointer"),vt=U==null?L:ce(U),E=be==null?L:ce(be),L=new Le(V,k+"leave",U,n,Y),L.target=vt,L.relatedTarget=E,V=null,la(Y)===R&&(Le=new Le(M,k+"enter",be,n,Y),Le.target=E,Le.relatedTarget=vt,V=Le),vt=V,U&&be)t:{for(Le=kg,M=U,k=be,E=0,V=M;V;V=Le(V))E++;V=0;for(var Me=k;Me;Me=Le(Me))V++;for(;0<E-V;)M=Le(M),E--;for(;0<V-E;)k=Le(k),V--;for(;E--;){if(M===k||k!==null&&M===k.alternate){Le=M;break t}M=Le(M),k=Le(k)}Le=null}else Le=null;U!==null&&wh(F,L,U,Le,!1),be!==null&&vt!==null&&wh(F,vt,be,Le,!0)}}e:{if(L=R?ce(R):window,U=L.nodeName&&L.nodeName.toLowerCase(),U==="select"||U==="input"&&L.type==="file")var ot=Nu;else if(Bu(L))if(ju)ot=H0;else{ot=_0;var ke=L0}else U=L.nodeName,!U||U.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?R&&Kr(R.elementType)&&(ot=Nu):ot=O0;if(ot&&(ot=ot(e,R))){Uu(F,ot,n,Y);break e}ke&&ke(e,L,R),e==="focusout"&&R&&L.type==="number"&&R.memoizedProps.value!=null&&Fr(L,"number",L.value)}switch(ke=R?ce(R):window,e){case"focusin":(Bu(ke)||ke.contentEditable==="true")&&(Al=ke,rs=R,Mo=null);break;case"focusout":Mo=rs=Al=null;break;case"mousedown":ss=!0;break;case"contextmenu":case"mouseup":case"dragend":ss=!1,Ku(F,n,Y);break;case"selectionchange":if(U0)break;case"keydown":case"keyup":Ku(F,n,Y)}var Fe;if(as)e:{switch(e){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Tl?Ou(e,n)&&(We="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(We="onCompositionStart");We&&(Ru&&n.locale!=="ko"&&(Tl||We!=="onCompositionStart"?We==="onCompositionEnd"&&Tl&&(Fe=Mu()):(Ma=Y,Ir="value"in Ma?Ma.value:Ma.textContent,Tl=!0)),ke=yr(R,We),0<ke.length&&(We=new Au(We,e,null,n,Y),F.push({event:We,listeners:ke}),Fe?We.data=Fe:(Fe=Hu(n),Fe!==null&&(We.data=Fe)))),(Fe=D0?T0(e,n):A0(e,n))&&(We=yr(R,"onBeforeInput"),0<We.length&&(ke=new Au("onBeforeInput","beforeinput",null,n,Y),F.push({event:ke,listeners:We}),ke.data=Fe)),xg(F,e,R,n,Y)}xh(F,t)})}function Wo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function yr(e,t){for(var n=t+"Capture",a=[];e!==null;){var l=e,o=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||o===null||(l=bo(e,n),l!=null&&a.unshift(Wo(e,l,o)),l=bo(e,t),l!=null&&a.push(Wo(e,l,o))),e.tag===3)return a;e=e.return}return[]}function kg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function wh(e,t,n,a,l){for(var o=t._reactName,u=[];n!==null&&n!==a;){var g=n,S=g.alternate,R=g.stateNode;if(g=g.tag,S!==null&&S===a)break;g!==5&&g!==26&&g!==27||R===null||(S=R,l?(R=bo(n,o),R!=null&&u.unshift(Wo(n,R,S))):l||(R=bo(n,o),R!=null&&u.push(Wo(n,R,S)))),n=n.return}u.length!==0&&e.push({event:t,listeners:u})}var zg=/\r\n?/g,Mg=/\u0000|\uFFFD/g;function Ch(e){return(typeof e=="string"?e:""+e).replace(zg,`
9
+ `).replace(Mg,"")}function kh(e,t){return t=Ch(t),Ch(e)===t}function bt(e,t,n,a,l,o){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||zl(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&zl(e,""+a);break;case"className":Si(e,"class",a);break;case"tabIndex":Si(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Si(e,n,a);break;case"style":Cu(e,a,o);break;case"data":if(t!=="object"){Si(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Ci(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 o=="function"&&(n==="formAction"?(t!=="input"&&bt(e,t,"name",l.name,l,null),bt(e,t,"formEncType",l.formEncType,l,null),bt(e,t,"formMethod",l.formMethod,l,null),bt(e,t,"formTarget",l.formTarget,l,null)):(bt(e,t,"encType",l.encType,l,null),bt(e,t,"method",l.method,l,null),bt(e,t,"target",l.target,l,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Ci(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=ia);break;case"onScroll":a!=null&&Ze("scroll",e);break;case"onScrollEnd":a!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(d(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Ci(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Ze("beforetoggle",e),Ze("toggle",e),xi(e,"popover",a);break;case"xlinkActuate":oa(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":oa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":oa(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":oa(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":oa(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":oa(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":oa(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":oa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":oa(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":xi(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=e0.get(n)||n,xi(e,n,a))}}function _c(e,t,n,a,l,o){switch(n){case"style":Cu(e,a,o);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(d(60));e.innerHTML=n}}break;case"children":typeof a=="string"?zl(e,a):(typeof a=="number"||typeof a=="bigint")&&zl(e,""+a);break;case"onScroll":a!=null&&Ze("scroll",e);break;case"onScrollEnd":a!=null&&Ze("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ue.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),t=n.slice(2,l?n.length-7:void 0),o=e[jt]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,l),typeof a=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,l);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):xi(e,n,a)}}}function nn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var a=!1,l=!1,o;for(o in n)if(n.hasOwnProperty(o)){var u=n[o];if(u!=null)switch(o){case"src":a=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:bt(e,t,o,u,n,null)}}l&&bt(e,t,"srcSet",n.srcSet,n,null),a&&bt(e,t,"src",n.src,n,null);return;case"input":Ze("invalid",e);var g=o=u=l=null,S=null,R=null;for(a in n)if(n.hasOwnProperty(a)){var Y=n[a];if(Y!=null)switch(a){case"name":l=Y;break;case"type":u=Y;break;case"checked":S=Y;break;case"defaultChecked":R=Y;break;case"value":o=Y;break;case"defaultValue":g=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(d(137,t));break;default:bt(e,t,a,Y,n,null)}}vu(e,o,g,S,R,u,l,!1);return;case"select":Ze("invalid",e),a=u=o=null;for(l in n)if(n.hasOwnProperty(l)&&(g=n[l],g!=null))switch(l){case"value":o=g;break;case"defaultValue":u=g;break;case"multiple":a=g;default:bt(e,t,l,g,n,null)}t=o,n=u,e.multiple=!!a,t!=null?kl(e,!!a,t,!1):n!=null&&kl(e,!!a,n,!0);return;case"textarea":Ze("invalid",e),o=l=a=null;for(u in n)if(n.hasOwnProperty(u)&&(g=n[u],g!=null))switch(u){case"value":a=g;break;case"defaultValue":l=g;break;case"children":o=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(d(91));break;default:bt(e,t,u,g,n,null)}Su(e,a,l,o);return;case"option":for(S in n)n.hasOwnProperty(S)&&(a=n[S],a!=null)&&(S==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":bt(e,t,S,a,n,null));return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(a=0;a<$o.length;a++)Ze($o[a],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("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(R in n)if(n.hasOwnProperty(R)&&(a=n[R],a!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:bt(e,t,R,a,n,null)}return;default:if(Kr(t)){for(Y in n)n.hasOwnProperty(Y)&&(a=n[Y],a!==void 0&&_c(e,t,Y,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&bt(e,t,g,a,n,null))}function Dg(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,o=null,u=null,g=null,S=null,R=null,Y=null;for(U in n){var F=n[U];if(n.hasOwnProperty(U)&&F!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":S=F;default:a.hasOwnProperty(U)||bt(e,t,U,null,a,F)}}for(var L in a){var U=a[L];if(F=n[L],a.hasOwnProperty(L)&&(U!=null||F!=null))switch(L){case"type":o=U;break;case"name":l=U;break;case"checked":R=U;break;case"defaultChecked":Y=U;break;case"value":u=U;break;case"defaultValue":g=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(d(137,t));break;default:U!==F&&bt(e,t,L,U,a,F)}}Qr(e,u,g,S,R,Y,o,l);return;case"select":U=u=g=L=null;for(o in n)if(S=n[o],n.hasOwnProperty(o)&&S!=null)switch(o){case"value":break;case"multiple":U=S;default:a.hasOwnProperty(o)||bt(e,t,o,null,a,S)}for(l in a)if(o=a[l],S=n[l],a.hasOwnProperty(l)&&(o!=null||S!=null))switch(l){case"value":L=o;break;case"defaultValue":g=o;break;case"multiple":u=o;default:o!==S&&bt(e,t,l,o,a,S)}t=g,n=u,a=U,L!=null?kl(e,!!n,L,!1):!!a!=!!n&&(t!=null?kl(e,!!n,t,!0):kl(e,!!n,n?[]:"",!1));return;case"textarea":U=L=null;for(g in n)if(l=n[g],n.hasOwnProperty(g)&&l!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:bt(e,t,g,null,a,l)}for(u in a)if(l=a[u],o=n[u],a.hasOwnProperty(u)&&(l!=null||o!=null))switch(u){case"value":L=l;break;case"defaultValue":U=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(d(91));break;default:l!==o&&bt(e,t,u,l,a,o)}xu(e,L,U);return;case"option":for(var be in n)L=n[be],n.hasOwnProperty(be)&&L!=null&&!a.hasOwnProperty(be)&&(be==="selected"?e.selected=!1:bt(e,t,be,null,a,L));for(S in a)L=a[S],U=n[S],a.hasOwnProperty(S)&&L!==U&&(L!=null||U!=null)&&(S==="selected"?e.selected=L&&typeof L!="function"&&typeof L!="symbol":bt(e,t,S,L,a,U));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 Le in n)L=n[Le],n.hasOwnProperty(Le)&&L!=null&&!a.hasOwnProperty(Le)&&bt(e,t,Le,null,a,L);for(R in a)if(L=a[R],U=n[R],a.hasOwnProperty(R)&&L!==U&&(L!=null||U!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(d(137,t));break;default:bt(e,t,R,L,a,U)}return;default:if(Kr(t)){for(var vt in n)L=n[vt],n.hasOwnProperty(vt)&&L!==void 0&&!a.hasOwnProperty(vt)&&_c(e,t,vt,void 0,a,L);for(Y in a)L=a[Y],U=n[Y],!a.hasOwnProperty(Y)||L===U||L===void 0&&U===void 0||_c(e,t,Y,L,a,U);return}}for(var M in n)L=n[M],n.hasOwnProperty(M)&&L!=null&&!a.hasOwnProperty(M)&&bt(e,t,M,null,a,L);for(F in a)L=a[F],U=n[F],!a.hasOwnProperty(F)||L===U||L==null&&U==null||bt(e,t,F,L,a,U)}function zh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Tg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var l=n[a],o=l.transferSize,u=l.initiatorType,g=l.duration;if(o&&g&&zh(u)){for(u=0,g=l.responseEnd,a+=1;a<n.length;a++){var S=n[a],R=S.startTime;if(R>g)break;var Y=S.transferSize,F=S.initiatorType;Y&&zh(F)&&(S=S.responseEnd,u+=Y*(S<g?1:(g-R)/(S-R)))}if(--a,t+=8*(o+u)/(l.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 Oc=null,Hc=null;function br(e){return e.nodeType===9?e:e.ownerDocument}function Mh(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 Dh(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 Bc(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 Uc=null;function Ag(){var e=window.event;return e&&e.type==="popstate"?e===Uc?!1:(Uc=e,!0):(Uc=null,!1)}var Th=typeof setTimeout=="function"?setTimeout:void 0,Eg=typeof clearTimeout=="function"?clearTimeout:void 0,Ah=typeof Promise=="function"?Promise:void 0,Rg=typeof queueMicrotask=="function"?queueMicrotask:typeof Ah<"u"?function(e){return Ah.resolve(null).then(e).catch(Lg)}:Th;function Lg(e){setTimeout(function(){throw e})}function Xa(e){return e==="head"}function Eh(e,t){var n=t,a=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(l),no(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Io(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Io(n);for(var o=n.firstChild;o;){var u=o.nextSibling,g=o.nodeName;o[nl]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=u}}else n==="body"&&Io(e.ownerDocument.body);n=l}while(n);no(t)}function Rh(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Nc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nc(n),mo(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function _g(e,t,n,a){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[nl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=jn(e.nextSibling),e===null)break}return null}function Og(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=jn(e.nextSibling),e===null))return null;return e}function Lh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=jn(e.nextSibling),e===null))return null;return e}function jc(e){return e.data==="$?"||e.data==="$~"}function qc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Hg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function jn(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 Yc=null;function _h(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return jn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Oh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Hh(e,t,n){switch(t=br(n),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function Io(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mo(e)}var qn=new Map,Bh=new Set;function vr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wa=Z.d;Z.d={f:Bg,r:Ug,D:Ng,C:jg,L:qg,m:Yg,X:Xg,S:Gg,M:Vg};function Bg(){var e=wa.f(),t=ur();return e||t}function Ug(e){var t=ge(e);t!==null&&t.tag===5&&t.type==="form"?Id(t):wa.r(e)}var Pl=typeof document>"u"?null:document;function Uh(e,t,n){var a=Pl;if(a&&typeof t=="string"&&t){var l=Ln(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),Bh.has(l)||(Bh.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement("link"),nn(t,"link",e),Se(t),a.head.appendChild(t)))}}function Ng(e){wa.D(e),Uh("dns-prefetch",e,null)}function jg(e,t){wa.C(e,t),Uh("preconnect",e,t)}function qg(e,t,n){wa.L(e,t,n);var a=Pl;if(a&&e&&t){var l='link[rel="preload"][as="'+Ln(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+Ln(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+Ln(n.imageSizes)+'"]')):l+='[href="'+Ln(e)+'"]';var o=l;switch(t){case"style":o=eo(e);break;case"script":o=to(e)}qn.has(o)||(e=z({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),qn.set(o,e),a.querySelector(l)!==null||t==="style"&&a.querySelector(Po(o))||t==="script"&&a.querySelector(ei(o))||(t=a.createElement("link"),nn(t,"link",e),Se(t),a.head.appendChild(t)))}}function Yg(e,t){wa.m(e,t);var n=Pl;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Ln(a)+'"][href="'+Ln(e)+'"]',o=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=to(e)}if(!qn.has(o)&&(e=z({rel:"modulepreload",href:e},t),qn.set(o,e),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ei(o)))return}a=n.createElement("link"),nn(a,"link",e),Se(a),n.head.appendChild(a)}}}function Gg(e,t,n){wa.S(e,t,n);var a=Pl;if(a&&e){var l=xe(a).hoistableStyles,o=eo(e);t=t||"default";var u=l.get(o);if(!u){var g={loading:0,preload:null};if(u=a.querySelector(Po(o)))g.loading=5;else{e=z({rel:"stylesheet",href:e,"data-precedence":t},n),(n=qn.get(o))&&Gc(e,n);var S=u=a.createElement("link");Se(S),nn(S,"link",e),S._p=new Promise(function(R,Y){S.onload=R,S.onerror=Y}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,xr(u,t,a)}u={type:"stylesheet",instance:u,count:1,state:g},l.set(o,u)}}}function Xg(e,t){wa.X(e,t);var n=Pl;if(n&&e){var a=xe(n).hoistableScripts,l=to(e),o=a.get(l);o||(o=n.querySelector(ei(l)),o||(e=z({src:e,async:!0},t),(t=qn.get(l))&&Xc(e,t),o=n.createElement("script"),Se(o),nn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(l,o))}}function Vg(e,t){wa.M(e,t);var n=Pl;if(n&&e){var a=xe(n).hoistableScripts,l=to(e),o=a.get(l);o||(o=n.querySelector(ei(l)),o||(e=z({src:e,async:!0,type:"module"},t),(t=qn.get(l))&&Xc(e,t),o=n.createElement("script"),Se(o),nn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(l,o))}}function Nh(e,t,n,a){var l=(l=Te.current)?vr(l):null;if(!l)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=eo(n.href),n=xe(l).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=eo(n.href);var o=xe(l).hoistableStyles,u=o.get(e);if(u||(l=l.ownerDocument||l,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,u),(o=l.querySelector(Po(e)))&&!o._p&&(u.instance=o,u.state.loading=5),qn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},qn.set(e,n),o||Qg(l,e,n,u.state))),t&&a===null)throw Error(d(528,""));return u}if(t&&a!==null)throw Error(d(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=to(n),n=xe(l).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function eo(e){return'href="'+Ln(e)+'"'}function Po(e){return'link[rel="stylesheet"]['+e+"]"}function jh(e){return z({},e,{"data-precedence":e.precedence,precedence:null})}function Qg(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),nn(t,"link",n),Se(t),e.head.appendChild(t))}function to(e){return'[src="'+Ln(e)+'"]'}function ei(e){return"script[async]"+e}function qh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ln(n.href)+'"]');if(a)return t.instance=a,Se(a),a;var l=z({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Se(a),nn(a,"style",l),xr(a,n.precedence,e),t.instance=a;case"stylesheet":l=eo(n.href);var o=e.querySelector(Po(l));if(o)return t.state.loading|=4,t.instance=o,Se(o),o;a=jh(n),(l=qn.get(l))&&Gc(a,l),o=(e.ownerDocument||e).createElement("link"),Se(o);var u=o;return u._p=new Promise(function(g,S){u.onload=g,u.onerror=S}),nn(o,"link",a),t.state.loading|=4,xr(o,n.precedence,e),t.instance=o;case"script":return o=to(n.src),(l=e.querySelector(ei(o)))?(t.instance=l,Se(l),l):(a=n,(l=qn.get(o))&&(a=z({},n),Xc(a,l)),e=e.ownerDocument||e,l=e.createElement("script"),Se(l),nn(l,"link",a),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,xr(a,n.precedence,e));return t.instance}function xr(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,o=l,u=0;u<a.length;u++){var g=a[u];if(g.dataset.precedence===t)o=g;else if(o!==l)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Sr=null;function Yh(e,t,n){if(Sr===null){var a=new Map,l=Sr=new Map;l.set(n,a)}else l=Sr,a=l.get(n),a||(a=new Map,l.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),l=0;l<n.length;l++){var o=n[l];if(!(o[nl]||o[At]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var u=o.getAttribute(t)||"";u=e+u;var g=a.get(u);g?g.push(o):a.set(u,[o])}}return a}function Gh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Fg(e,t,n){if(n===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 Xh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Kg(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=eo(a.href),o=t.querySelector(Po(l));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=wr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,Se(o);return}o=t.ownerDocument||t,a=jh(a),(l=qn.get(l))&&Gc(a,l),o=o.createElement("link"),Se(o);var u=o;u._p=new Promise(function(g,S){u.onload=g,u.onerror=S}),nn(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=wr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Vc=0;function Zg(e,t){return e.stylesheets&&e.count===0&&kr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&kr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Vc===0&&(Vc=62500*Tg());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&kr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Vc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function wr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cr=null;function kr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cr=new Map,t.forEach(Jg,e),Cr=null,wr.call(e))}function Jg(e,t){if(!(t.state.loading&4)){var n=Cr.get(e);if(n)var a=n.get(null);else{n=new Map,Cr.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<l.length;o++){var u=l[o];(u.nodeName==="LINK"||u.getAttribute("media")!=="not all")&&(n.set(u.dataset.precedence,u),a=u)}a&&n.set(null,a)}l=t.instance,u=l.getAttribute("data-precedence"),o=n.get(u)||a,o===a&&n.set(null,l),n.set(u,l),this.count++,a=wr.bind(this),l.addEventListener("load",a),l.addEventListener("error",a),o?o.parentNode.insertBefore(l,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var ti={$$typeof:Q,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function $g(e,t,n,a,l,o,u,g,S){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=fo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fo(0),this.hiddenUpdates=fo(null),this.identifierPrefix=a,this.onUncaughtError=l,this.onCaughtError=o,this.onRecoverableError=u,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Vh(e,t,n,a,l,o,u,g,S,R,Y,F){return e=new $g(e,t,n,u,S,R,Y,F,g),t=1,o===!0&&(t|=24),o=kn(3,null,null,t),e.current=o,o.stateNode=e,t=Cs(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:a,isDehydrated:n,cache:t},Ds(o),e}function Qh(e){return e?(e=Ll,e):Ll}function Fh(e,t,n,a,l,o){l=Qh(l),a.context===null?a.context=l:a.pendingContext=l,a=La(t),a.payload={element:n},o=o===void 0?null:o,o!==null&&(a.callback=o),n=_a(e,a,t),n!==null&&(bn(n,e,t),_o(n,e,t))}function Kh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Qc(e,t){Kh(e,t),(e=e.alternate)&&Kh(e,t)}function Zh(e){if(e.tag===13||e.tag===31){var t=il(e,67108864);t!==null&&bn(t,e,67108864),Qc(e,67108864)}}function Jh(e){if(e.tag===13||e.tag===31){var t=An();t=aa(t);var n=il(e,t);n!==null&&bn(n,e,t),Qc(e,t)}}var zr=!0;function Wg(e,t,n,a){var l=A.T;A.T=null;var o=Z.p;try{Z.p=2,Fc(e,t,n,a)}finally{Z.p=o,A.T=l}}function Ig(e,t,n,a){var l=A.T;A.T=null;var o=Z.p;try{Z.p=8,Fc(e,t,n,a)}finally{Z.p=o,A.T=l}}function Fc(e,t,n,a){if(zr){var l=Kc(a);if(l===null)Lc(e,t,a,Mr,n),Wh(e,a);else if(em(l,e,t,n,a))a.stopPropagation();else if(Wh(e,a),t&4&&-1<Pg.indexOf(e)){for(;l!==null;){var o=ge(l);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var u=na(o.pendingLanes);if(u!==0){var g=o;for(g.pendingLanes|=2,g.entangledLanes|=2;u;){var S=1<<31-Xe(u);g.entanglements[1]|=S,u&=~S}Wn(o),(rt&6)===0&&(sr=Tt()+500,Jo(0))}}break;case 31:case 13:g=il(o,2),g!==null&&bn(g,o,2),ur(),Qc(o,2)}if(o=Kc(a),o===null&&Lc(e,t,a,Mr,n),o===l)break;l=o}l!==null&&a.stopPropagation()}else Lc(e,t,a,null,n)}}function Kc(e){return e=Jr(e),Zc(e)}var Mr=null;function Zc(e){if(Mr=null,e=la(e),e!==null){var t=p(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=C(t),e!==null)return e;e=null}else if(n===31){if(e=D(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Mr=e,null}function $h(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(dn()){case xn:return 2;case Sn:return 8;case fn:case J:return 32;case de:return 268435456;default:return 32}default:return 32}}var Jc=!1,Va=null,Qa=null,Fa=null,ni=new Map,ai=new Map,Ka=[],Pg="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 Wh(e,t){switch(e){case"focusin":case"focusout":Va=null;break;case"dragenter":case"dragleave":Qa=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ai.delete(t.pointerId)}}function li(e,t,n,a,l,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:o,targetContainers:[l]},t!==null&&(t=ge(t),t!==null&&Zh(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function em(e,t,n,a,l){switch(t){case"focusin":return Va=li(Va,e,t,n,a,l),!0;case"dragenter":return Qa=li(Qa,e,t,n,a,l),!0;case"mouseover":return Fa=li(Fa,e,t,n,a,l),!0;case"pointerover":var o=l.pointerId;return ni.set(o,li(ni.get(o)||null,e,t,n,a,l)),!0;case"gotpointercapture":return o=l.pointerId,ai.set(o,li(ai.get(o)||null,e,t,n,a,l)),!0}return!1}function Ih(e){var t=la(e.target);if(t!==null){var n=p(t);if(n!==null){if(t=n.tag,t===13){if(t=C(n),t!==null){e.blockedOn=t,Gn(e.priority,function(){Jh(n)});return}}else if(t===31){if(t=D(n),t!==null){e.blockedOn=t,Gn(e.priority,function(){Jh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Kc(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Zr=a,n.target.dispatchEvent(a),Zr=null}else return t=ge(n),t!==null&&Zh(t),e.blockedOn=n,!1;t.shift()}return!0}function Ph(e,t,n){Dr(e)&&n.delete(t)}function tm(){Jc=!1,Va!==null&&Dr(Va)&&(Va=null),Qa!==null&&Dr(Qa)&&(Qa=null),Fa!==null&&Dr(Fa)&&(Fa=null),ni.forEach(Ph),ai.forEach(Ph)}function Tr(e,t){e.blockedOn===t&&(e.blockedOn=null,Jc||(Jc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,tm)))}var Ar=null;function ep(e){Ar!==e&&(Ar=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Ar===e&&(Ar=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],l=e[t+2];if(typeof a!="function"){if(Zc(a||n)===null)continue;break}var o=ge(n);o!==null&&(e.splice(t,3),t-=3,Ks(o,{pending:!0,data:l,method:n.method,action:a},a,l))}}))}function no(e){function t(S){return Tr(S,e)}Va!==null&&Tr(Va,e),Qa!==null&&Tr(Qa,e),Fa!==null&&Tr(Fa,e),ni.forEach(t),ai.forEach(t);for(var n=0;n<Ka.length;n++){var a=Ka[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ka.length&&(n=Ka[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&Ka.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var l=n[a],o=n[a+1],u=l[jt]||null;if(typeof o=="function")u||ep(n);else if(u){var g=null;if(o&&o.hasAttribute("formAction")){if(l=o,u=o[jt]||null)g=u.formAction;else if(Zc(l)!==null)continue}else g=u.action;typeof g=="function"?n[a+1]=g:(n.splice(a,3),a-=3),ep(n)}}}function tp(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(u){return l=u})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function $c(e){this._internalRoot=e}Er.prototype.render=$c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var n=t.current,a=An();Fh(n,a,e,t,null,null)},Er.prototype.unmount=$c.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fh(e.current,2,null,e,null,null),ur(),t[wn]=null}};function Er(e){this._internalRoot=e}Er.prototype.unstable_scheduleHydration=function(e){if(e){var t=vi();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ka.length&&t!==0&&t<Ka[n].priority;n++);Ka.splice(n,0,e),n===0&&Ih(e)}};var np=c.version;if(np!=="19.2.4")throw Error(d(527,np,"19.2.4"));Z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=y(t),e=e!==null?T(e):null,e=e===null?null:e.stateNode,e};var nm={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rr.isDisabled&&Rr.supportsFiber)try{H=Rr.inject(nm),ae=Rr}catch{}}return ri.createRoot=function(e,t){if(!h(e))throw Error(d(299));var n=!1,a="",l=cf,o=uf,u=df;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(u=t.onRecoverableError)),t=Vh(e,1,!1,null,null,n,a,null,l,o,u,tp),e[wn]=t.current,Rc(e),new $c(t)},ri.hydrateRoot=function(e,t,n){if(!h(e))throw Error(d(299));var a=!1,l="",o=cf,u=uf,g=df,S=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(u=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=Vh(e,1,!0,t,n??null,a,l,S,o,u,g,tp),t.context=Qh(null),n=t.current,a=An(),a=aa(a),l=La(a),l.callback=null,_a(n,l,a),n=a,t.current.lanes=n,tl(t,n),Wn(t),e[wn]=t.current,Rc(e),new Er(t)},ri.version="19.2.4",ri}var wp;function s1(){if(wp)return nu.exports;wp=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),nu.exports=r1(),nu.exports}var c1=s1(),Cp=function(c,f){var d=arguments;if(f==null||!pi.call(f,"css"))return v.createElement.apply(void 0,d);var h=d.length,p=new Array(h);p[0]=mu,p[1]=gu(c,f);for(var C=2;C<h;C++)p[C]=d[C];return v.createElement.apply(null,p)};(function(i){var c;c||(c=i.JSX||(i.JSX={}))})(Cp||(Cp={}));function m(){for(var i=arguments.length,c=new Array(i),f=0;f<i;f++)c[f]=arguments[f];return Yp(c)}function Gt(){var i=m.apply(void 0,arguments),c="animation-"+i.name;return{name:c,styles:"@keyframes "+c+"{"+i.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}const u1={showProgress:!1,progressTitle:"",progressState:{current:0,total:0,percent:0,status:"processing"},showDeleteConfirm:!1,showMoveModal:!1,showSyncConfirm:!1,showProcessConfirm:!1,showDownloadConfirm:!1,actionPaths:[],syncImageCount:0,syncHasRemote:!1,syncHasLocal:!1,processMode:"generate",downloadImageCount:0,downloadTotalSelected:0},d1={isOpen:!1,openStudio:()=>{},closeStudio:()=>{},toggleStudio:()=>{},currentPath:"public",setCurrentPath:()=>{},navigateUp:()=>{},selectedItems:new Set,toggleSelection:()=>{},selectRange:()=>{},selectAll:()=>{},clearSelection:()=>{},lastSelectedPath:null,viewMode:"grid",setViewMode:()=>{},focusedItem:null,setFocusedItem:()=>{},meta:null,setMeta:()=>{},isLoading:!1,setIsLoading:()=>{},refreshKey:0,triggerRefresh:()=>{},editedImageKey:null,setEditedImageKey:()=>{},scanRequested:!1,triggerScan:()=>{},clearScanRequest:()=>{},searchQuery:"",setSearchQuery:()=>{},error:null,showError:()=>{},clearError:()=>{},fileItems:[],setFileItems:()=>{},actionState:u1,requestDelete:()=>{},requestMove:()=>{},requestSync:()=>{},requestDownload:()=>{},requestProcess:()=>{},setProcessMode:()=>{},confirmDelete:async()=>{},confirmMove:async()=>{},confirmSync:async()=>{},confirmProcess:async()=>{},cancelAction:()=>{},closeProgress:()=>{},stopProcessing:()=>{},deleteOrphans:async()=>{}},Xp=v.createContext(d1);function co(){return v.useContext(Xp)}const Sl="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, sans-serif",s={primary:"#635bff",primaryHover:"#5851e5",primaryLight:"#f0f0ff",background:"#f6f9fc",surface:"#ffffff",surfaceHover:"#f6f9fc",border:"#d8dee4",borderLight:"#e3e8ee",borderHover:"#c1c9d2",text:"#1a1f36",textSecondary:"#697386",textMuted:"#8792a2",success:"#0d7d4d",successLight:"#e6f7ef",danger:"#df1b41",dangerHover:"#c41535",dangerLight:"#fff5f7",imagesFolder:"#8b5cf6",hover:"#e8ecf0"},N={xs:"13px",sm:"14px",base:"16px",lg:"19px",xl:"22px"},Pa=m("font-family:",Sl,";font-size:",N.base,";line-height:1.5;color:",s.text,";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box;*,*::before,*::after{box-sizing:border-box;}button,input,select,textarea{font-family:inherit;font-size:inherit;}",""),f1=Gt`
10
+ from { opacity: 0; }
11
+ to { opacity: 1; }
12
+ `,h1=Gt`
13
+ from {
14
+ opacity: 0;
15
+ transform: translateY(-8px) scale(0.98);
16
+ }
17
+ to {
18
+ opacity: 1;
19
+ transform: translateY(0) scale(1);
20
+ }
21
+ `,p1=Gt`
22
+ from { transform: rotate(0deg); }
23
+ to { transform: rotate(360deg); }
24
+ `,He={overlay:m("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",f1," 0.15s ease-out;font-family:",Sl,";",""),modal:m(Pa," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:420px;width:90%;animation:",h1," 0.2s ease-out;overflow:hidden;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),body:{name:"5e7rpo",styles:"padding:12px 24px 24px"},message:m("font-size:",N.base,";color:",s.textSecondary,";margin:0;line-height:1.6;",""),footer:m("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:m("padding:10px 18px;font-size:",N.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnCancel:m("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),btnConfirm:m("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover{background-color:",s.primaryHover,";border-color:",s.primaryHover,";}",""),btnDanger:m("background-color:",s.danger,";border:1px solid ",s.danger,";color:white;&:hover{background-color:",s.dangerHover,";border-color:",s.dangerHover,";}","")};function ro({title:i,message:c,confirmLabel:f="Confirm",cancelLabel:d="Cancel",variant:h="default",onConfirm:p,onCancel:C}){return r("div",{css:He.overlay,onClick:C,children:b("div",{css:He.modal,onClick:D=>D.stopPropagation(),children:[r("div",{css:He.header,children:r("h3",{css:He.title,children:i})}),r("div",{css:He.body,children:r("p",{css:He.message,children:c})}),b("div",{css:He.footer,children:[r("button",{css:[He.btn,He.btnCancel,"",""],onClick:C,children:d}),r("button",{css:[He.btn,h==="danger"?He.btnDanger:He.btnConfirm,"",""],onClick:p,children:f})]})]})})}const g1={input:m("width:100%;padding:10px 12px;font-size:",N.base,";border:1px solid ",s.border,";border-radius:6px;background:",s.surface,";color:",s.text,";margin-top:12px;transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 2px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}","")};function xl({title:i,message:c,inputLabel:f,defaultValue:d="",placeholder:h,confirmLabel:p="Confirm",cancelLabel:C="Cancel",isLoading:D=!1,loadingLabel:w="Processing...",onConfirm:y,onCancel:T}){const[z,_]=ft.useState(d),q=B=>{B.preventDefault(),z.trim()&&!D&&y(z.trim())};return r("div",{css:He.overlay,onClick:D?void 0:T,children:r("div",{css:He.modal,onClick:B=>B.stopPropagation(),children:b("form",{onSubmit:q,children:[r("div",{css:He.header,children:r("h3",{css:He.title,children:i})}),b("div",{css:He.body,children:[c&&r("p",{css:He.message,children:c}),f&&r("label",{css:He.message,children:f}),r("input",{css:g1.input,type:"text",value:z,onChange:B=>_(B.target.value),placeholder:h,autoFocus:!0,disabled:D})]}),b("div",{css:He.footer,children:[r("button",{type:"button",css:[He.btn,He.btnCancel,"",""],onClick:T,disabled:D,children:C}),r("button",{type:"submit",css:[He.btn,He.btnConfirm,"",""],disabled:!z.trim()||D,children:D?b(tt,{children:[r("span",{css:m("display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:",p1," 0.75s linear infinite;margin-right:6px;","")}),w]}):p})]})]})})})}function Yr({title:i,message:c,buttonLabel:f="OK",onClose:d}){return r("div",{css:He.overlay,onClick:d,children:b("div",{css:He.modal,onClick:h=>h.stopPropagation(),children:[r("div",{css:He.header,children:r("h3",{css:He.title,children:i})}),r("div",{css:He.body,children:r("p",{css:He.message,children:c})}),r("div",{css:He.footer,children:r("button",{css:[He.btn,He.btnConfirm,"",""],onClick:d,children:f})})]})})}const Ja={progressContainer:{name:"yz1nei",styles:"margin-top:16px"},progressBar:m("width:100%;height:8px;background-color:",s.background,";border-radius:4px;overflow:hidden;margin-bottom:12px;",""),progressFill:m("height:100%;background:linear-gradient(90deg, ",s.primary,", ",s.primaryHover,");border-radius:4px;transition:width 0.3s ease;",""),progressText:m("font-size:",N.sm,";color:",s.textSecondary,";margin:0;display:flex;justify-content:space-between;align-items:center;",""),currentFile:m("font-size:",N.xs,";color:",s.textMuted,";margin:8px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;",""),errorList:{name:"1lw22n1",styles:"margin-top:12px;padding:12px;background:#fef2f2;border:1px solid #fecaca;border-radius:6px;max-height:200px;overflow-y:auto"},errorItem:m("font-size:",N.xs,";color:#991b1b;margin:0 0 4px;&:last-child{margin-bottom:0;}","")};function Ia({title:i,progress:c,onClose:f,onDeleteOrphans:d,onStop:h}){const p=c.status==="complete",C=c.status==="error",D=c.status==="stopped",w=c.status==="stopping",y=p||C||D,T=!y||w;return r("div",{css:He.overlay,children:b("div",{css:He.modal,onClick:z=>z.stopPropagation(),children:[r("div",{css:He.header,children:r("h3",{css:He.title,children:i})}),r("div",{css:He.body,children:C?r("p",{css:He.message,children:c.message||"An error occurred"}):D?b("p",{css:He.message,children:["Processing stopped. Processed ",c.processed??c.current," image",(c.processed??c.current)!==1?"s":""," before stopping."]}):p?b(tt,{children:[b("p",{css:He.message,children:[c.message?c.message:c.isDelete?b(tt,{children:["Deleted ",c.processed," file",c.processed!==1?"s":"",".",c.errors!==void 0&&c.errors>0?b(tt,{children:[" ",c.errors," error",c.errors!==1?"s":""," occurred."]}):null]}):c.isMove?b(tt,{children:["Moved ",c.processed," file",c.processed!==1?"s":"",".",c.errors!==void 0&&c.errors>0?b(tt,{children:[" ",c.errors," error",c.errors!==1?"s":""," occurred."]}):null]}):c.isScan?b(tt,{children:[c.alreadyProcessed!==void 0&&c.alreadyProcessed>0?b(tt,{children:[c.alreadyProcessed," image",c.alreadyProcessed!==1?"s":""," already exist. "]}):null,"Scanned ",c.processed," new image",c.processed!==1?"s":"",".",c.orphanedEntries!==void 0&&c.orphanedEntries>0?b(tt,{children:[" Removed ",c.orphanedEntries," orphaned entr",c.orphanedEntries!==1?"ies":"y","."]}):null,c.pendingUpdates!==void 0&&c.pendingUpdates>0?b(tt,{children:[" ",c.pendingUpdates," file",c.pendingUpdates!==1?"s have":" has"," local updates pending."]}):null]}):b(tt,{children:["Processed ",c.processed," new image",c.processed!==1?"s":"",".",c.alreadyProcessed!==void 0&&c.alreadyProcessed>0?b(tt,{children:[" ",c.alreadyProcessed," already processed."]}):null]}),c.orphansRemoved!==void 0&&c.orphansRemoved>0?b(tt,{children:[" Removed ",c.orphansRemoved," orphaned thumbnail",c.orphansRemoved!==1?"s":"","."]}):null]}),c.errorMessages&&c.errorMessages.length>0&&b("div",{css:Ja.errorList,children:[c.errorMessages.slice(0,10).map((z,_)=>r("p",{css:Ja.errorItem,children:z},_)),c.errorMessages.length>10&&b("p",{css:Ja.errorItem,children:["...and ",c.errorMessages.length-10," more"]})]})]}):b(tt,{children:[r("p",{css:He.message,children:c.status==="cleanup"?c.message||"Cleaning up...":c.message||"Processing..."}),b("div",{css:Ja.progressContainer,children:[r("div",{css:Ja.progressBar,children:r("div",{css:Ja.progressFill,style:{width:`${c.percent}%`}})}),b("div",{css:Ja.progressText,children:[b("span",{children:[c.current," of ",c.total]}),b("span",{children:[c.percent,"%"]})]}),c.currentFile&&r("p",{css:Ja.currentFile,title:c.currentFile,children:c.currentFile})]})]})}),b("div",{css:He.footer,children:[T&&h&&r("button",{css:[He.btn,He.btnDanger,"",""],onClick:h,disabled:c.status==="stopping",children:c.status==="stopping"?"Stopping...":"Stop"}),y&&c.orphanedFiles&&c.orphanedFiles.length>0&&d&&b("button",{css:[He.btn,He.btnDanger,"",""],onClick:d,children:["Delete ",c.orphanedFiles.length," Orphan",c.orphanedFiles.length!==1?"s":""]}),y&&r("button",{css:[He.btn,He.btnConfirm,"",""],onClick:f,children:"Done"})]})]})})}function Vp(i){const{setShowProgress:c,setProgressTitle:f,setProgressState:d,triggerRefresh:h}=i,p=v.useRef(null),C=v.useRef(!1),D=v.useRef(!1),w=v.useRef(null),y=v.useCallback(()=>{p.current&&p.current.abort()},[]);return{execute:v.useCallback(async z=>{const{endpoint:_,body:q,title:B,operationType:G,onComplete:ie,onError:K}=z;if(C.current){console.warn("Streaming operation already in progress");return}C.current=!0,D.current=!1;const Q=`${_.split("/").pop()?.replace("-stream","")||"op"}-${Date.now()}-${Math.random().toString(36).slice(2)}`;w.current=Q;const oe=new AbortController;p.current=oe;const X=async()=>{D.current=!0,d(ee=>({...ee,status:"stopping"}));try{await fetch("/api/studio/cancel-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:Q})})}catch{}};oe.signal.addEventListener("abort",X),f(B),c(!0),d({current:0,total:0,percent:0,status:"processing",message:`Starting ${B.toLowerCase()}...`});try{const ee=await fetch(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...q,operationId:Q})});if(!ee.ok){const W=await ee.json().catch(()=>({}));throw new Error(W.error||`Request failed: ${ee.status}`)}if(!ee.body)throw new Error("No response body");const te=ee.body.getReader(),le=new TextDecoder;let j="";try{for(;;){const{done:W,value:pe}=await te.read();if(W)break;j+=le.decode(pe,{stream:!0});const ye=j.split(`
25
+
26
+ `);j=ye.pop()||"";for(const me of ye)if(me.startsWith("data: "))try{const re=JSON.parse(me.slice(6));if(re.type==="start")d(Be=>({...Be,total:re.total||Be.total}));else if(re.type==="progress")d({current:re.current||0,total:re.total||0,percent:re.percent||Math.round((re.current||0)/(re.total||1)*100),status:"processing",currentFile:re.currentFile,message:re.message});else if(re.type==="cleanup")d(Be=>({...Be,status:"cleanup",message:re.message}));else if(re.type==="complete"){const Be=re.cancelled===!0,A=re.processed??re.moved??re.renamed??re.pushed??re.downloaded??re.added??re.imported??re.deleted??re.current??0;d({current:A,total:A,percent:100,status:Be?"stopped":re.errors&&re.errors>0?"error":"complete",message:re.message,processed:A,errors:re.errors,orphanedFiles:re.orphanedFiles,isDelete:G==="delete",isMove:G==="move",isScan:G==="scan"}),h(),ie?.(re)}else re.type==="error"&&(d(Be=>({...Be,status:"error",message:re.message})),K?.(re.message||"Unknown error"))}catch{}}}catch(W){if(!D.current)throw W}finally{oe.signal.removeEventListener("abort",X)}}catch(ee){if(!D.current){const te=ee instanceof Error?ee.message:"Operation failed";console.error(`${B} error:`,ee),d({current:0,total:0,percent:0,status:"error",message:te}),K?.(te)}}finally{C.current=!1,p.current=null,w.current=null}},[c,f,d,h]),stop:y,get isRunning(){return C.current}}}const m1=Gt`
27
+ from { opacity: 0; }
28
+ to { opacity: 1; }
29
+ `,y1=Gt`
30
+ from {
31
+ opacity: 0;
32
+ transform: translateY(-8px) scale(0.98);
33
+ }
34
+ to {
35
+ opacity: 1;
36
+ transform: translateY(0) scale(1);
37
+ }
38
+ `,Ht={overlay:m("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",m1," 0.15s ease-out;font-family:",Sl,";",""),modal:m(Pa," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:480px;width:90%;max-height:80vh;display:flex;flex-direction:column;animation:",y1," 0.2s ease-out;overflow:hidden;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),body:{name:"zizupt",styles:"padding:12px 24px 24px;flex:1;overflow-y:auto;min-height:200px;max-height:400px"},message:m("font-size:",N.base,";color:",s.textSecondary,";margin:0 0 16px;line-height:1.6;",""),folderList:{name:"1axgfg3",styles:"display:flex;flex-direction:column;gap:0"},folderItem:m("display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:6px;cursor:pointer;transition:all 0.15s ease;border:1px solid transparent;position:relative;&:hover{background-color:",s.surfaceHover,";}",""),treeIndent:{name:"197dxto",styles:"display:flex;align-items:center;height:100%"},treeLine:m("width:16px;height:100%;position:relative;flex-shrink:0;&::before{content:'';position:absolute;left:8px;top:0;bottom:50%;width:0;border-left:1px dashed ",s.textSecondary,";}&::after{content:'';position:absolute;left:8px;top:50%;width:8px;height:0;border-top:1px dashed ",s.textSecondary,";}",""),folderItemSelected:m("background-color:",s.primaryLight,";border-color:",s.primary,";&:hover{background-color:",s.primaryLight,";}",""),folderItemDisabled:{name:"181lhkw",styles:"opacity:0.5;cursor:not-allowed;&:hover{background-color:transparent;}"},folderIcon:{name:"17bs1oo",styles:"width:20px;height:20px;color:#f9935e;flex-shrink:0"},folderName:m("font-size:",N.base,";color:",s.text,";flex:1;",""),footer:m("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:m("padding:10px 18px;font-size:",N.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnCancel:m("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),btnConfirm:m("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),loading:m("display:flex;align-items:center;justify-content:center;padding:40px;color:",s.textSecondary,";",""),spinner:m("width:24px;height:24px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:spin 0.8s linear infinite;@keyframes spin{to{transform:rotate(360deg);}}","")};function Qp({selectedItems:i,currentPath:c,onMove:f,onCancel:d}){const[h,p]=v.useState([]),[C,D]=v.useState(!0),[w,y]=v.useState(null);v.useEffect(()=>{async function B(){try{const G=await fetch("/api/studio/list-folders");if(G.ok){const ie=await G.json();console.log("Loaded folders:",ie),p(ie.folders||[])}else console.error("Failed to load folders:",G.status,await G.text())}catch(G){console.error("Failed to load folders:",G)}finally{D(!1)}}B()},[]);const T=Array.from(i),z=h.filter(B=>!T.some(G=>B.path===G||B.path.startsWith(G+"/"))),_=B=>B===c,q=()=>{w&&f(w)};return r("div",{css:Ht.overlay,onClick:d,children:b("div",{css:Ht.modal,onClick:B=>B.stopPropagation(),children:[r("div",{css:Ht.header,children:r("h3",{css:Ht.title,children:"Move Items"})}),b("div",{css:Ht.body,children:[b("p",{css:Ht.message,children:["Select a destination folder for ",i.size," item",i.size!==1?"s":"",":"]}),C?r("div",{css:Ht.loading,children:r("div",{css:Ht.spinner})}):z.length===0?r("div",{css:Ht.loading,children:"No available folders to move to."}):r("div",{css:Ht.folderList,children:z.map(B=>{const G=_(B.path);return b("div",{css:[Ht.folderItem,w===B.path&&Ht.folderItemSelected,G&&Ht.folderItemDisabled,"",""],style:{paddingLeft:12},onClick:()=>!G&&y(B.path),children:[B.depth>0&&r("div",{css:Ht.treeIndent,children:Array.from({length:B.depth}).map((ie,K)=>r("div",{css:Ht.treeLine},K))}),r("svg",{css:Ht.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}),b("span",{css:Ht.folderName,children:[B.name,G&&" (current)"]})]},B.path)})})]}),b("div",{css:Ht.footer,children:[r("button",{css:[Ht.btn,Ht.btnCancel,"",""],onClick:d,children:"Cancel"}),r("button",{css:[Ht.btn,Ht.btnConfirm,"",""],onClick:q,disabled:!w,children:"Move Here"})]})]})})}const b1=`CLOUDFLARE_R2_ACCOUNT_ID=your_account_id
39
+ CLOUDFLARE_R2_ACCESS_KEY_ID=your_access_key
40
+ CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_key
41
+ CLOUDFLARE_R2_BUCKET_NAME=your_bucket_name
42
+ CLOUDFLARE_R2_PUBLIC_URL=https://pub-xxx.r2.dev
43
+ NEXT_PUBLIC_CLOUDFLARE_R2_PUBLIC_URL=https://pub-xxx.r2.dev`,we={overlay:{name:"8ivopw",styles:"position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);display:flex;align-items:center;justify-content:center;z-index:1100;padding:20px"},modal:m("background:",s.surface,";border-radius:12px;max-width:560px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 20px 40px rgba(0, 0, 0, 0.3);",""),header:m("display:flex;align-items:center;gap:12px;padding:20px 24px;border-bottom:1px solid ",s.border,";",""),icon:m("width:32px;height:32px;color:",s.primary,";flex-shrink:0;",""),title:m("font-size:",N.xl,";font-weight:600;color:",s.text,";margin:0;",""),closeBtn:m("margin-left:auto;background:none;border:none;padding:4px;cursor:pointer;color:",s.textMuted,";border-radius:4px;&:hover{color:",s.text,";background:",s.surfaceHover,";}",""),closeIcon:{name:"1aynuae",styles:"width:20px;height:20px"},content:{name:"vxuddk",styles:"padding:24px"},intro:m("font-size:",N.base,";color:",s.textSecondary,";margin:0 0 20px 0;line-height:1.6;",""),steps:{name:"1fs2p21",styles:"list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:16px"},step:{name:"1wesxqa",styles:"display:flex;gap:12px"},stepNumber:m("width:28px;height:28px;border-radius:50%;background:",s.primaryLight,";color:",s.primary,";font-size:",N.sm,";font-weight:600;display:flex;align-items:center;justify-content:center;flex-shrink:0;",""),stepContent:{name:"pkc2k3",styles:"flex:1;padding-top:3px"},stepTitle:m("font-size:",N.base,";font-weight:500;color:",s.text,";margin:0 0 4px 0;",""),stepDesc:m("font-size:",N.sm,";color:",s.textSecondary,";margin:0;line-height:1.5;",""),link:m("color:",s.primary,";text-decoration:none;font-weight:500;&:hover{text-decoration:underline;}",""),envVarsWrapper:{name:"1ksolcl",styles:"position:relative;margin-top:20px"},envVars:m("background:",s.background,";border:1px solid ",s.border,";border-radius:8px;padding:16px;padding-right:48px;font-family:'SF Mono',Monaco,'Cascadia Code',monospace;font-size:13px;line-height:1.8;color:",s.text,";overflow-x:auto;",""),envVar:{name:"4zleql",styles:"display:block"},envKey:m("color:",s.primary,";",""),envValue:m("color:",s.textSecondary,";",""),copyBtn:m("position:absolute;top:8px;right:8px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;color:",s.textMuted,";transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";color:",s.text,";border-color:#d0d5dd;}",""),copyIcon:{name:"157xhr7",styles:"width:16px;height:16px"},copiedTooltip:{name:"9a5yd1",styles:"position:absolute;top:50%;right:100%;transform:translateY(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-right:6px;pointer-events:none;&::before{content:'';position:absolute;right:-4px;top:50%;transform:translateY(-50%);border-left:4px solid #1a1f36;border-top:4px solid transparent;border-bottom:4px solid transparent;}"},footer:m("padding:16px 24px;border-top:1px solid ",s.border,";display:flex;justify-content:flex-end;gap:12px;",""),docsBtn:m("padding:10px 16px;border-radius:6px;font-size:",N.base,";font-weight:500;border:1px solid ",s.border,";background:",s.surface,";color:",s.text,";cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:6px;transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";border-color:#d0d5dd;}",""),doneBtn:m("padding:10px 20px;border-radius:6px;font-size:",N.base,";font-weight:500;border:none;background:",s.primary,";color:white;cursor:pointer;transition:background 0.15s ease;&:hover{background:",s.primaryHover,";}",""),externalIcon:{name:"1djxupe",styles:"width:14px;height:14px"}};function Fp({isOpen:i,onClose:c}){const[f,d]=v.useState(!1),h=async()=>{try{await navigator.clipboard.writeText(b1),d(!0),setTimeout(()=>d(!1),2e3)}catch(p){console.error("Failed to copy:",p)}};return i?r("div",{css:we.overlay,onClick:c,children:b("div",{css:we.modal,onClick:p=>p.stopPropagation(),children:[b("div",{css:we.header,children:[r("svg",{css:we.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),r("h2",{css:we.title,children:"Set Up CDN Storage"}),r("button",{css:we.closeBtn,onClick:c,children:r("svg",{css:we.closeIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),b("div",{css:we.content,children:[r("p",{css:we.intro,children:"Sync your images to Cloudflare R2 for faster global delivery. R2 offers generous free tier with no egress fees."}),b("ol",{css:we.steps,children:[b("li",{css:we.step,children:[r("span",{css:we.stepNumber,children:"1"}),b("div",{css:we.stepContent,children:[r("h4",{css:we.stepTitle,children:"Create a Cloudflare account"}),b("p",{css:we.stepDesc,children:["Sign up at"," ",r("a",{css:we.link,href:"https://dash.cloudflare.com/sign-up",target:"_blank",rel:"noopener noreferrer",children:"dash.cloudflare.com"})," ","if you don't have one already."]})]})]}),b("li",{css:we.step,children:[r("span",{css:we.stepNumber,children:"2"}),b("div",{css:we.stepContent,children:[r("h4",{css:we.stepTitle,children:"Create an R2 bucket"}),b("p",{css:we.stepDesc,children:["Go to R2 in your Cloudflare dashboard and create a new bucket. Choose a name like ",r("code",{children:"my-images"}),"."]})]})]}),b("li",{css:we.step,children:[r("span",{css:we.stepNumber,children:"3"}),b("div",{css:we.stepContent,children:[r("h4",{css:we.stepTitle,children:"Enable public access"}),b("p",{css:we.stepDesc,children:['In bucket settings, enable "Public Access" and copy the public URL (e.g., ',r("code",{children:"https://pub-xxx.r2.dev"}),")."]})]})]}),b("li",{css:we.step,children:[r("span",{css:we.stepNumber,children:"4"}),b("div",{css:we.stepContent,children:[r("h4",{css:we.stepTitle,children:"Create API token"}),r("p",{css:we.stepDesc,children:'Go to R2 → Manage R2 API Tokens → Create API Token. Select "Object Read & Write" permissions for your bucket.'})]})]}),b("li",{css:we.step,children:[r("span",{css:we.stepNumber,children:"5"}),b("div",{css:we.stepContent,children:[r("h4",{css:we.stepTitle,children:"Add environment variables"}),b("p",{css:we.stepDesc,children:["Add these to your ",r("code",{children:".env.local"})," file:"]})]})]})]}),b("div",{css:we.envVarsWrapper,children:[b("div",{css:we.envVars,children:[b("span",{css:we.envVar,children:[r("span",{css:we.envKey,children:"CLOUDFLARE_R2_ACCOUNT_ID"}),"=",r("span",{css:we.envValue,children:"your_account_id"})]}),b("span",{css:we.envVar,children:[r("span",{css:we.envKey,children:"CLOUDFLARE_R2_ACCESS_KEY_ID"}),"=",r("span",{css:we.envValue,children:"your_access_key"})]}),b("span",{css:we.envVar,children:[r("span",{css:we.envKey,children:"CLOUDFLARE_R2_SECRET_ACCESS_KEY"}),"=",r("span",{css:we.envValue,children:"your_secret_key"})]}),b("span",{css:we.envVar,children:[r("span",{css:we.envKey,children:"CLOUDFLARE_R2_BUCKET_NAME"}),"=",r("span",{css:we.envValue,children:"your_bucket_name"})]}),b("span",{css:we.envVar,children:[r("span",{css:we.envKey,children:"CLOUDFLARE_R2_PUBLIC_URL"}),"=",r("span",{css:we.envValue,children:"https://pub-xxx.r2.dev"})]}),b("span",{css:we.envVar,children:[r("span",{css:we.envKey,children:"NEXT_PUBLIC_CLOUDFLARE_R2_PUBLIC_URL"}),"=",r("span",{css:we.envValue,children:"https://pub-xxx.r2.dev"})]})]}),b("button",{css:we.copyBtn,onClick:h,title:"Copy to clipboard",children:[f&&r("span",{css:we.copiedTooltip,children:"Copied!"}),r("svg",{css:we.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]})]}),b("div",{css:we.footer,children:[b("a",{css:we.docsBtn,href:"https://developers.cloudflare.com/r2/get-started/",target:"_blank",rel:"noopener noreferrer",children:["R2 Documentation",r("svg",{css:we.externalIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]}),r("button",{css:we.doneBtn,onClick:c,children:"Got it"})]})]})}):null}const v1=Gt`
44
+ from { opacity: 0; }
45
+ to { opacity: 1; }
46
+ `,x1=Gt`
47
+ from {
48
+ opacity: 0;
49
+ transform: translateY(-8px) scale(0.98);
50
+ }
51
+ to {
52
+ opacity: 1;
53
+ transform: translateY(0) scale(1);
54
+ }
55
+ `,Ct={overlay:m("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",v1," 0.15s ease-out;font-family:",Sl,";",""),modal:m(Pa," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:520px;width:90%;animation:",x1," 0.2s ease-out;overflow:hidden;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),tabs:m("display:flex;gap:0;margin-top:16px;border-bottom:1px solid ",s.border,";",""),tab:m("padding:12px 20px;font-size:",N.base,";font-weight:500;color:",s.textSecondary,";background:none;border:none;cursor:pointer;position:relative;transition:color 0.15s;&:hover{color:",s.text,";}",""),tabActive:m("color:",s.primary,";&::after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:2px;background-color:",s.primary,";}",""),body:{name:"1po9b7e",styles:"padding:24px;min-height:200px"},dropzone:m("border:2px dashed ",s.border,";border-radius:8px;padding:40px 24px;text-align:center;cursor:pointer;transition:all 0.15s;&:hover{border-color:",s.primary,";background-color:",s.primaryLight,";}",""),dropzoneActive:m("border-color:",s.primary,";background-color:",s.primaryLight,";",""),dropzoneIcon:m("width:48px;height:48px;margin:0 auto 16px;color:",s.textMuted,";",""),dropzoneText:m("font-size:",N.base,";color:",s.text,";margin:0 0 4px;",""),dropzoneHint:m("font-size:",N.sm,";color:",s.textSecondary,";margin:0;",""),textarea:m("width:100%;min-height:150px;padding:12px;font-size:",N.sm,";font-family:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,monospace;border:1px solid ",s.border,";border-radius:8px;resize:vertical;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 3px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),textareaLabel:m("font-size:",N.sm,";color:",s.textSecondary,";margin:0 0 8px;",""),footer:m("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:m("padding:10px 18px;font-size:",N.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnCancel:m("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),btnConfirm:m("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.6;cursor:not-allowed;}",""),fileInput:{name:"eivff4",styles:"display:none"},selectedFiles:m("margin-top:16px;padding:12px;background-color:",s.background,";border-radius:6px;font-size:",N.sm,";color:",s.text,";","")};function S1({currentPath:i,onClose:c,onUploadComplete:f,streamingOperation:d,setShowProgress:h,setProgressTitle:p,setProgressState:C}){const[D,w]=v.useState("upload"),[y,T]=v.useState([]),[z,_]=v.useState(""),[q,B]=v.useState(!1),[G,ie]=v.useState(!1),[K,ue]=v.useState(!1),Q=v.useRef(null),oe=v.useCallback(j=>{j&&T(Array.from(j))},[]),X=v.useCallback(j=>{j.preventDefault(),B(!1),oe(j.dataTransfer.files)},[oe]),ee=v.useRef(!1),te=v.useCallback(async()=>{if(y.length!==0){if(h&&p&&C){c(),ee.current=!1,p("Uploading Files"),h(!0),C({current:0,total:y.length,percent:0,status:"processing",message:"Uploading..."});let j=0;const W=[];for(let pe=0;pe<y.length;pe++){if(ee.current){C(re=>({...re,status:"stopped",message:`Stopped. Uploaded ${j} file${j!==1?"s":""}.`})),f();return}const ye=y[pe],me=new FormData;me.append("file",ye),me.append("path",i);try{(await fetch("/api/studio/upload",{method:"POST",body:me})).ok?j++:W.push(ye.name)}catch{W.push(ye.name)}C({current:pe+1,total:y.length,percent:Math.round((pe+1)/y.length*100),status:"processing",currentFile:ye.name})}C({current:y.length,total:y.length,percent:100,status:"complete",message:`Uploaded ${j} file${j!==1?"s":""}.${W.length>0?` ${W.length} failed.`:""}`}),f();return}ie(!0);try{for(const j of y){const W=new FormData;W.append("file",j),W.append("path",i),await fetch("/api/studio/upload",{method:"POST",body:W})}f(),c()}catch(j){console.error("Upload failed:",j)}finally{ie(!1)}}},[y,i,f,c,h,p,C]),le=v.useCallback(async()=>{const j=z.split(`
56
+ `).map(W=>W.trim()).filter(W=>W.length>0);if(j.length!==0){if(d){c(),await d.execute({endpoint:"/api/studio/import",body:{urls:j},title:"Importing URLs",onComplete:()=>{f()}});return}ue(!0);try{const pe=(await fetch("/api/studio/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({urls:j})})).body?.getReader();if(!pe)throw new Error("No reader");const ye=new TextDecoder;for(;;){const{done:me,value:re}=await pe.read();if(me)break;const A=ye.decode(re).split(`
57
+
58
+ `).filter(Z=>Z.startsWith("data: "));for(const Z of A)JSON.parse(Z.replace("data: ","")).type==="complete"&&(f(),c())}}catch(W){console.error("Import failed:",W)}finally{ue(!1)}}},[z,f,c,d]);return r("div",{css:Ct.overlay,onClick:c,children:b("div",{css:Ct.modal,onClick:j=>j.stopPropagation(),children:[b("div",{css:Ct.header,children:[r("h3",{css:Ct.title,children:"Add New"}),b("div",{css:Ct.tabs,children:[r("button",{css:[Ct.tab,D==="upload"&&Ct.tabActive,"",""],onClick:()=>w("upload"),children:"Upload Files"}),r("button",{css:[Ct.tab,D==="import"&&Ct.tabActive,"",""],onClick:()=>w("import"),children:"Import URLs"})]})]}),r("div",{css:Ct.body,children:D==="upload"?b(tt,{children:[b("div",{css:[Ct.dropzone,q&&Ct.dropzoneActive,"",""],onClick:()=>Q.current?.click(),onDragOver:j=>{j.preventDefault(),B(!0)},onDragLeave:()=>B(!1),onDrop:X,children:[r("svg",{css:Ct.dropzoneIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),r("p",{css:Ct.dropzoneText,children:"Drop files here or click to browse"}),r("p",{css:Ct.dropzoneHint,children:"Supports images and other media files"})]}),r("input",{ref:Q,type:"file",multiple:!0,css:Ct.fileInput,onChange:j=>oe(j.target.files)}),y.length>0&&b("div",{css:Ct.selectedFiles,children:[y.length," file",y.length!==1?"s":""," selected"]})]}):b(tt,{children:[r("p",{css:Ct.textareaLabel,children:"Paste image URLs (one per line)"}),r("textarea",{css:Ct.textarea,value:z,onChange:j=>_(j.target.value),placeholder:`https://cdn.example.com/photos/image1.jpg
59
+ https://cdn.example.com/photos/image2.jpg`})]})}),b("div",{css:Ct.footer,children:[r("button",{css:[Ct.btn,Ct.btnCancel,"",""],onClick:c,children:"Cancel"}),D==="upload"?r("button",{css:[Ct.btn,Ct.btnConfirm,"",""],onClick:te,disabled:y.length===0||G,children:G?"Uploading...":"Upload"}):r("button",{css:[Ct.btn,Ct.btnConfirm,"",""],onClick:le,disabled:!z.trim()||K,children:K?"Importing...":"Import"})]})]})})}const w1="36px",Ye={btn:m("height:",w1,";padding:0 12px;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),icon:m("width:16px;height:16px;color:",s.textSecondary,";",""),overlay:{name:"1cy1r91",styles:"position:fixed;top:0;right:0;bottom:0;left:0;z-index:10000;display:flex;align-items:flex-start;justify-content:center;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);overflow-y:auto;scroll-behavior:smooth;padding:48px 24px"},panel:m(Pa," position:relative;background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);width:100%;max-width:512px;padding:24px;margin:auto 0;",""),header:{name:"1o4fids",styles:"display:flex;align-items:center;justify-content:space-between;margin-bottom:24px"},title:m("font-size:",N.xl,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),closeBtn:m("padding:6px;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),sections:{name:"klisov",styles:"display:flex;flex-direction:column;gap:24px"},sectionTitle:m("font-size:",N.base,";font-weight:600;color:",s.text,";margin:0 0 12px 0;",""),description:m("font-size:",N.sm,";color:",s.textSecondary,";margin:0 0 12px 0;",""),codeWrapper:{name:"bjn8wh",styles:"position:relative"},code:m("background-color:",s.background,";border-radius:8px;padding:12px;padding-right:40px;font-family:'SF Mono',Monaco,Consolas,monospace;font-size:",N.xs,";color:",s.textSecondary,";border:1px solid ",s.border,";overflow-x:auto;white-space:nowrap;",""),copyBtn:m("position:absolute;top:8px;right:8px;padding:4px;background:",s.surface,";border:1px solid ",s.border,";border-radius:4px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),tooltip:{name:"6eskey",styles:"position:absolute;bottom:100%;left:50%;transform:translateX(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-bottom:6px;pointer-events:none;z-index:100;&::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:4px solid transparent;border-top-color:#1a1f36;}"},copyIcon:m("width:14px;height:14px;color:",s.textSecondary,";",""),codeLine:{name:"1bbvuqp",styles:"margin:0 0 4px 0;&:last-child{margin:0;}"},input:m("width:100%;padding:10px 14px;border:1px solid ",s.border,";border-radius:6px;font-size:",N.base,";color:",s.text,";background:",s.surface,";transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 3px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),grid:{name:"xtlr5l",styles:"display:grid;grid-template-columns:repeat(3, 1fr);gap:12px"},label:m("font-size:",N.xs,";font-weight:500;color:",s.textSecondary,";display:block;margin-bottom:6px;",""),footer:m("margin-top:24px;padding-top:20px;border-top:1px solid ",s.border,";display:flex;justify-content:flex-end;gap:12px;",""),cancelBtn:m("padding:10px 18px;font-size:",N.base,";font-weight:500;color:",s.text,";background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),saveBtn:m("padding:10px 18px;font-size:",N.base,";font-weight:500;color:white;background-color:",s.primary,";border:1px solid ",s.primary,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;&:hover{background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.6;cursor:not-allowed;}",""),cdnList:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"},cdnRow:{name:"197tvr9",styles:"display:flex;gap:8px;align-items:center"},cdnInput:m("flex:1;padding:8px 12px;border:1px solid ",s.border,";border-radius:6px;font-size:",N.sm,";color:",s.text,";background:",s.surface,";transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 3px ",s.primaryLight,";}",""),cdnIndex:m("font-size:",N.xs,";color:",s.textMuted,";width:24px;text-align:center;flex-shrink:0;",""),cdnDeleteBtn:m("padding:6px;background:none;border:none;cursor:pointer;color:",s.textMuted,";transition:color 0.15s;flex-shrink:0;&:hover{color:",s.danger,";}",""),cdnAddBtn:m("padding:8px 12px;font-size:",N.sm,";font-weight:500;color:",s.primary,";background:",s.primaryLight,";border:1px dashed ",s.primary,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;gap:6px;margin-top:8px;&:hover{background:",s.surface,";}",""),warning:m("font-size:",N.xs,";color:",s.danger,";margin-top:8px;padding:8px 12px;background:",s.dangerLight,";border-radius:6px;","")};function C1(){const[i,c]=v.useState(!1);return b(tt,{children:[r("button",{css:Ye.btn,onClick:()=>c(!0),"aria-label":"Settings",children:b("svg",{css:Ye.icon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r("circle",{cx:"12",cy:"12",r:"3"}),r("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z"})]})}),i&&r(z1,{onClose:()=>c(!1)})]})}const k1=`# Dev site link (opens from Studio header)
60
+ STUDIO_DEV_SITE_URL=http://localhost:3000
61
+
62
+ # Cloudflare R2 Storage
63
+ CLOUDFLARE_R2_ACCOUNT_ID=your_account_id
64
+ CLOUDFLARE_R2_ACCESS_KEY_ID=your_access_key_id
65
+ CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_access_key
66
+ CLOUDFLARE_R2_BUCKET_NAME=your_bucket_name
67
+ CLOUDFLARE_R2_PUBLIC_URL=https://your-cdn.example.com`;function z1({onClose:i}){const{triggerRefresh:c}=co(),[f,d]=v.useState(!1),[h,p]=v.useState([]),[C,D]=v.useState(!0),[w,y]=v.useState(!1),[T,z]=v.useState(!1);v.useEffect(()=>{async function K(){try{const Q=await(await fetch("/api/studio/cdns")).json();p(Q.cdns||[])}catch(ue){console.error("Failed to load CDN URLs:",ue)}finally{D(!1)}}K()},[]);const _=()=>{navigator.clipboard.writeText(k1),d(!0),setTimeout(()=>d(!1),2e3)},q=v.useCallback((K,ue)=>{p(Q=>{const oe=[...Q];return oe[K]=ue,oe}),z(!0)},[]),B=v.useCallback(()=>{p(K=>[...K,""]),z(!0)},[]),G=v.useCallback(K=>{p(ue=>ue.filter((Q,oe)=>oe!==K)),z(!0)},[]),ie=v.useCallback(async()=>{y(!0);try{(await fetch("/api/studio/cdns",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cdns:h})})).ok&&(z(!1),c(),i())}catch(K){console.error("Failed to save CDN URLs:",K)}finally{y(!1)}},[h,c,i]);return r("div",{css:Ye.overlay,onClick:i,children:b("div",{css:Ye.panel,onClick:K=>K.stopPropagation(),children:[b("div",{css:Ye.header,children:[r("h2",{css:Ye.title,children:"Settings"}),r("button",{css:Ye.closeBtn,onClick:i,children:r("svg",{css:Ye.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),b("div",{css:Ye.sections,children:[b("section",{children:[r("h3",{css:Ye.sectionTitle,children:"CDN URLs"}),r("p",{css:Ye.description,children:"Manage CDN base URLs used by your images:"}),C?r("p",{css:Ye.description,children:"Loading..."}):b(tt,{children:[r("div",{css:Ye.cdnList,children:h.map((K,ue)=>b("div",{css:Ye.cdnRow,children:[r("span",{css:Ye.cdnIndex,children:ue}),r("input",{css:Ye.cdnInput,type:"text",value:K,onChange:Q=>q(ue,Q.target.value),placeholder:"https://cdn.example.com"}),r("button",{css:Ye.cdnDeleteBtn,onClick:()=>G(ue),title:"Delete CDN URL",children:r("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]},ue))}),b("button",{css:Ye.cdnAddBtn,onClick:B,children:[r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add CDN URL"]}),h.length>0&&r("p",{css:Ye.warning,children:"Warning: Changing CDN URLs may break image references. The index numbers correspond to image `c` values."})]})]}),b("section",{children:[r("h3",{css:Ye.sectionTitle,children:"Environment Variables"}),b("p",{css:Ye.description,children:["Configure in ",r("code",{children:".env.local"})," file (local development only, not needed in production):"]}),b("div",{css:Ye.codeWrapper,children:[b("button",{css:Ye.copyBtn,onClick:_,title:"Copy to clipboard",children:[f&&r("span",{css:Ye.tooltip,children:"Copied!"}),r("svg",{css:Ye.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})]}),b("div",{css:Ye.code,children:[r("p",{css:Ye.codeLine,children:"NEXT_PUBLIC_PRODUCTION_URL=http://localhost:3000"}),r("p",{css:Ye.codeLine,children:" "}),r("p",{css:Ye.codeLine,children:"# Cloudflare R2 Storage"}),r("p",{css:Ye.codeLine,children:"CLOUDFLARE_R2_ACCOUNT_ID=your_account_id"}),r("p",{css:Ye.codeLine,children:"CLOUDFLARE_R2_ACCESS_KEY_ID=your_access_key_id"}),r("p",{css:Ye.codeLine,children:"CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_access_key"}),r("p",{css:Ye.codeLine,children:"CLOUDFLARE_R2_BUCKET_NAME=your_bucket_name"}),r("p",{css:Ye.codeLine,children:"CLOUDFLARE_R2_PUBLIC_URL=https://your-cdn.example.com"})]})]})]}),b("section",{children:[r("h3",{css:Ye.sectionTitle,children:"Thumbnail Sizes"}),b("div",{css:Ye.grid,children:[b("div",{children:[r("label",{css:Ye.label,children:"Small"}),r("input",{css:Ye.input,type:"number",defaultValue:300})]}),b("div",{children:[r("label",{css:Ye.label,children:"Medium"}),r("input",{css:Ye.input,type:"number",defaultValue:700})]}),b("div",{children:[r("label",{css:Ye.label,children:"Large"}),r("input",{css:Ye.input,type:"number",defaultValue:1400})]})]})]})]}),b("div",{css:Ye.footer,children:[r("button",{css:Ye.cancelBtn,onClick:i,children:"Cancel"}),r("button",{css:Ye.saveBtn,onClick:ie,disabled:w||!T,children:w?"Saving...":"Save Changes"})]})]})})}const iu="36px",M1=Gt`
68
+ to { transform: rotate(360deg); }
69
+ `,ze={toolbar:m("display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;background-color:",s.surface,";border-bottom:1px solid ",s.border,";overflow:visible;min-width:0;@media (min-width: 768px){padding:12px 24px;}",""),left:{name:"17nohj2",styles:"display:flex;flex-wrap:nowrap;flex-shrink:0;align-items:center;gap:8px"},right:{name:"17nohj2",styles:"display:flex;flex-wrap:nowrap;flex-shrink:0;align-items:center;gap:8px"},btn:m("display:inline-flex;align-items:center;justify-content:center;gap:6px;height:",iu,";padding:0 14px;border-radius:6px;font-size:",N.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";cursor:pointer;transition:all 0.15s ease;color:",s.text,";letter-spacing:-0.01em;&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{cursor:not-allowed;opacity:0.5;}",""),btnPrimary:m("background:",s.primary,";border-color:",s.primary,";color:white;&:hover:not(:disabled){background:",s.primaryHover,";border-color:",s.primaryHover,";}",""),btnDanger:m("color:",s.danger,";&:hover:not(:disabled){background-color:",s.dangerLight,";border-color:",s.danger,";}",""),btnCloud:{name:"1lzbs29",styles:"color:#f59e0b;&:hover:not(:disabled){background-color:rgba(245, 158, 11, 0.1);border-color:#f59e0b;}"},cloudDropdownWrapper:{name:"bjn8wh",styles:"position:relative"},dropdownArrow:{name:"1j1hlpy",styles:"width:12px;height:12px;margin-left:4px"},cloudDropdown:m("position:absolute;top:100%;left:0;z-index:1000;min-width:160px;margin-top:4px;background:white;border:1px solid ",s.border,";border-radius:6px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);overflow:hidden;",""),cloudDropdownItem:m("display:flex;align-items:center;gap:8px;width:100%;padding:10px 14px;border:none;background:none;font-size:",N.sm,";color:",s.text,";cursor:pointer;text-align:left;white-space:nowrap;&:hover{background-color:",s.hover,";}svg{width:16px;height:16px;flex-shrink:0;color:#f59e0b;}",""),cloudDropdownItemDefault:m("svg{color:",s.text,";}",""),cloudDropdownItemDanger:m("color:",s.danger,";svg{color:",s.danger,";}",""),cloudDropdownDivider:m("height:1px;background-color:",s.border,";margin:4px 0;",""),icon:{name:"157xhr7",styles:"width:16px;height:16px"},iconSpin:m("animation:",M1," 1s linear infinite;",""),selectionCount:m("font-size:",N.base,";color:",s.textSecondary,";display:flex;align-items:center;gap:8px;margin-right:8px;",""),clearBtn:m("color:",s.primary,";background:none;border:none;cursor:pointer;font-size:",N.base,";font-weight:500;padding:0;&:hover{text-decoration:underline;}",""),divider:m("width:1px;height:24px;background:",s.border,";margin:0 4px;",""),viewToggle:m("display:flex;align-items:center;height:",iu,";background-color:",s.surface,";border:1px solid ",s.border,";border-radius:6px;overflow:hidden;",""),searchWrapper:{name:"9iujih",styles:"position:relative;display:flex;align-items:center"},searchInput:m("height:",iu,";padding:0 32px 0 12px;border:1px solid ",s.border,";border-radius:6px;font-size:",N.base,";background:",s.surface,";color:",s.text,";width:180px;transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 2px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),searchClearBtn:m("position:absolute;right:5px;top:5px;bottom:5px;background:",s.primary,";border:none;padding:0 6px;cursor:pointer;color:white;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all 0.15s ease;&:hover{background:",s.primaryHover,";}",""),viewBtn:m("height:100%;padding:0 10px;background:transparent;border:none;cursor:pointer;color:",s.textSecondary,";transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{color:",s.text,";background-color:",s.surfaceHover,";}",""),viewBtnActive:m("background-color:",s.primaryLight,";color:",s.primary,";&:hover{background-color:",s.primaryLight,";color:",s.primary,";}","")};function D1(){const{selectedItems:i,viewMode:c,setViewMode:f,clearSelection:d,currentPath:h,triggerRefresh:p,focusedItem:C,scanRequested:D,clearScanRequest:w,fileItems:y,requestProcess:T,setProcessMode:z,actionState:_,cancelAction:q}=co(),B=v.useRef(null),G=v.useRef(null),[ie,K]=v.useState(!1),[ue,Q]=v.useState(!1),[oe,X]=v.useState(!1),[ee,te]=v.useState(!1),[le,j]=v.useState(!1),[W,pe]=v.useState(0),[ye,me]=v.useState(!1),[re,Be]=v.useState(0),[A,Z]=v.useState(!1),[I,Ee]=v.useState(!1),[De,x]=v.useState(!1),[O,ne]=v.useState(0),[se,ve]=v.useState(!1),[Te,qe]=v.useState("Processing Images"),[lt,_e]=v.useState({current:0,total:0,percent:0,status:"processing"}),[$t,Je]=v.useState(null),[ut,ht]=v.useState(!1),[Bt,St]=v.useState(!1),[Dt,mt]=v.useState(!1),[on,Ut]=v.useState(!1),[Ie,Nt]=v.useState(!1),[wt,Re]=v.useState(!1),[Tt,dn]=v.useState(!1),[xn,Sn]=v.useState(!1),fn=v.useRef(null),J=v.useRef(null),de=Vp({setShowProgress:ve,setProgressTitle:qe,setProgressState:_e,triggerRefresh:p}),Ge=h==="public/images"||h.startsWith("public/images/");v.useCallback(()=>{B.current?.click()},[]);const Pe=v.useCallback(()=>{te(!0),p(),setTimeout(()=>te(!1),600)},[p]),H=v.useCallback(async()=>{X(!0),qe("Scanning Files"),ve(!0),_e({current:0,total:0,percent:0,status:"processing",message:"Scanning for files..."});try{const ce=(await fetch("/api/studio/scan",{method:"POST"})).body?.getReader();if(!ce)throw new Error("No reader");const xe=new TextDecoder;let Se="";for(;;){const{done:Oe,value:Ue}=await ce.read();if(Oe)break;Se+=xe.decode(Ue,{stream:!0});const nt=Se.split(`
70
+
71
+ `);Se=nt.pop()||"";for(const at of nt){if(!at.startsWith("data: "))continue;const Ne=JSON.parse(at.slice(6));if(Ne.type==="start")_e({current:0,total:Ne.total,percent:0,status:"processing",message:`Scanning ${Ne.total} files...`});else if(Ne.type==="progress")_e({current:Ne.current,total:Ne.total,percent:Ne.percent,status:"processing",currentFile:Ne.currentFile});else if(Ne.type==="cleanup")_e(cn=>({...cn,message:Ne.message}));else if(Ne.type==="complete"){let cn=Ne.renamed>0?`${Ne.renamed} file(s) renamed due to conflicts. `:"";Ne.orphanedFiles&&Ne.orphanedFiles.length>0&&(cn+=`Found ${Ne.orphanedFiles.length} orphaned thumbnail(s) in images folder.`),_e({current:Ne.total||0,total:Ne.total||0,percent:100,status:"complete",processed:Ne.added,alreadyProcessed:Ne.existingCount,errors:Ne.errors,orphanedFiles:Ne.orphanedFiles,pendingUpdates:Ne.pendingUpdates,orphanedEntries:Ne.orphanedEntries,message:cn||void 0,isScan:!0}),p()}else Ne.type==="error"&&_e({current:0,total:0,percent:0,status:"error",message:Ne.message||"Scan failed"})}}}catch(ge){console.error("Scan error:",ge),_e({current:0,total:0,percent:0,status:"error",message:"Scan failed"})}finally{X(!1)}},[p]);v.useEffect(()=>{const ge=ce=>{fn.current&&!fn.current.contains(ce.target)&&dn(!1),J.current&&!J.current.contains(ce.target)&&Sn(!1)};return document.addEventListener("mousedown",ge),()=>document.removeEventListener("mousedown",ge)},[]),v.useEffect(()=>{D&&!oe&&(w(),H())},[D,oe,w,H]);const ae=v.useCallback(async ge=>{const ce=ge.target.files;if(!ce||ce.length===0)return;const xe=Array.from(ce);xe.length>1?(_e({current:0,total:xe.length,percent:0,status:"processing",message:"Uploading files..."}),ve(!0)):Q(!0);let Se=0,Oe=0;try{for(let Ue=0;Ue<xe.length;Ue++){const nt=xe[Ue],at=new FormData;at.append("file",nt),at.append("path",h);try{const Ne=await fetch("/api/studio/upload",{method:"POST",body:at});if(Ne.ok)Se++;else{const cn=await Ne.json();Oe++,xe.length===1&&(Ne.status>=500?(console.error("Upload error:",cn),Je({title:"Upload Failed",message:`Failed to upload ${nt.name}: ${cn.error||"Unknown error"}`})):Je({title:"Cannot Upload Here",message:cn.error||"Upload not allowed in this location."}))}}catch{Oe++}xe.length>1&&_e({current:Ue+1,total:xe.length,percent:Math.round((Ue+1)/xe.length*100),status:"processing",currentFile:nt.name})}xe.length>1&&_e({current:xe.length,total:xe.length,percent:100,status:"complete",processed:Se,errors:Oe}),p()}catch(Ue){console.error("Upload error:",Ue),xe.length>1?_e({current:0,total:0,percent:0,status:"error",message:"Upload failed."}):Je({title:"Upload Failed",message:"Upload failed. Check console for details."})}finally{Q(!1),B.current&&(B.current.value="")}},[h,p]),Ae=v.useCallback(async ge=>{if(i.size>0){const xe=Array.from(i),Se=xe.filter(Ue=>(Ue.split("/").pop()||"").includes(".")&&!Ue.endsWith("/")),Oe=xe.filter(Ue=>!(Ue.split("/").pop()||"").includes(".")||Ue.endsWith("/"));if(Oe.length>0)try{const nt=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(Oe.join(","))}`)).json();if(nt.images)for(const at of nt.images){const Ne=`public/${at}`;Se.includes(Ne)||Se.push(Ne)}}catch(Ue){console.error("Failed to get folder files:",Ue)}if(Se.length===0){Je({title:"No Files Found",message:"No files found in the selected items."});return}z(ge),T(Se)}else try{const Se=await(await fetch("/api/studio/count-images")).json();if(!Se.images||Se.images.length===0){Je({title:"No Images Found",message:"No images found in the public folder to process."});return}const Oe=Se.images.map(Ue=>`public/${Ue}`);z(ge),T(Oe)}catch(xe){console.error("Failed to get images:",xe),Je({title:"Error",message:"Failed to get images."})}},[i,T,z]),Xe=v.useCallback(()=>{de.stop(),G.current&&(_e(ge=>({...ge,status:"stopping"})),G.current.abort())},[de]),Wt=v.useCallback(async()=>{const ge=lt.orphanedFiles;if(!(!ge||ge.length===0))try{const ce=await fetch("/api/studio/delete-orphans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:ge})}),xe=await ce.json();ce.ok?(_e(Se=>({...Se,orphanedFiles:void 0,orphansRemoved:xe.deleted,message:`Deleted ${xe.deleted} orphaned thumbnail${xe.deleted!==1?"s":""}.`})),p()):Je({title:"Delete Failed",message:xe.error||"Failed to delete orphaned files."})}catch(ce){console.error("Delete orphans error:",ce),Je({title:"Delete Failed",message:"Failed to delete orphaned files. Check console for details."})}},[lt.orphanedFiles,p]),Yn=v.useCallback(async()=>{if(i.size===0)return;const ge=Array.from(i),ce=ge.filter(Oe=>(Oe.split("/").pop()||"").includes(".")&&!Oe.endsWith("/")),xe=ge.filter(Oe=>!(Oe.split("/").pop()||"").includes(".")||Oe.endsWith("/"));let Se=ce.length;if(xe.length>0)try{const Ue=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(xe.join(","))}`)).json();Ue.images&&(Se+=Ue.images.length)}catch(Oe){console.error("Failed to get folder files:",Oe)}pe(Se),j(!0)},[i]),gi=v.useCallback(async()=>{j(!1);const ge=Array.from(i);ge.length!==0&&await de.execute({endpoint:"/api/studio/delete-stream",body:{paths:ge},title:"Deleting Files",operationType:"delete",onComplete:()=>{d()}})},[i,d,de]),Ca=v.useCallback(async()=>{if(i.size===0)return;const ge=Array.from(i),ce=ge.filter(at=>(at.split("/").pop()||"").includes(".")&&!at.endsWith("/")),xe=ge.filter(at=>!(at.split("/").pop()||"").includes(".")||at.endsWith("/")),Se=xe.length>0;if(Se)try{const Ne=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(xe.join(","))}`)).json();if(Ne.images)for(const cn of Ne.images){const yo=`public/${cn}`;ce.includes(yo)||ce.push(yo)}}catch(at){console.error("Failed to get folder files:",at)}if(ce.length===0){Je({title:"No Files Found",message:"No files found in the selected items."});return}let Oe=!1,Ue=!1,nt=0;for(const at of ce){const Ne=y.find(cn=>cn.path===at);Ne?Ne.isRemote?Oe=!0:Ne.cdnPushed?nt++:Ue=!0:Se&&(Ue=!0)}if(!Se&&nt===ce.length){Je({title:"Already Pushed",message:`All ${ce.length} file${ce.length!==1?"s are":" is"} already on the CDN.`});return}Be(ce.length),Z(Oe),Ee(Ue),me(!0)},[i,y]),ta=v.useCallback(async()=>{me(!1);const ge=Array.from(i),ce=ge.filter(Oe=>(Oe.split("/").pop()||"").includes(".")&&!Oe.endsWith("/")),xe=ge.filter(Oe=>!(Oe.split("/").pop()||"").includes(".")||Oe.endsWith("/"));if(xe.length>0)try{const Ue=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(xe.join(","))}`)).json();if(Ue.images)for(const nt of Ue.images){const at=`public/${nt}`;ce.includes(at)||ce.push(at)}}catch(Oe){console.error("Failed to get folder files:",Oe)}const Se=ce.map(Oe=>"/"+Oe.replace(/^public\//,""));Se.length!==0&&await de.execute({endpoint:"/api/studio/sync-stream",body:{imageKeys:Se},title:"Pushing to CDN",onComplete:()=>{d()},onError:Oe=>{(Oe.includes("R2 not configured")||Oe.includes("CLOUDFLARE_R2"))&&(ve(!1),Nt(!0))}})},[i,d,de]),[Lt,na]=v.useState([]),[wl,el]=v.useState(0),Gr=v.useCallback(async()=>{if(i.size===0)return;const ge=Array.from(i),ce=ge.filter(Ue=>(Ue.split("/").pop()||"").includes(".")&&!Ue.endsWith("/")),xe=ge.filter(Ue=>!(Ue.split("/").pop()||"").includes(".")||Ue.endsWith("/")),Se=xe.length>0;if(Se)try{const nt=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(xe.join(","))}`)).json();if(nt.images)for(const at of nt.images){const Ne=`public/${at}`;ce.includes(Ne)||ce.push(Ne)}}catch(Ue){console.error("Failed to get folder files:",Ue)}if(ce.length===0){Je({title:"No Files Found",message:"No files found in the selected items."});return}let Oe;if(Se)Oe=ce;else if(Oe=ce.filter(Ue=>{const nt=y.find(at=>at.path===Ue);return nt&&nt.cdnPushed&&!nt.isRemote}),Oe.length===0){Je({title:"No CDN Files",message:`None of the ${ce.length} selected file${ce.length!==1?"s are":" is"} on the CDN.`});return}na(Oe),el(ce.length),ne(Oe.length),x(!0)},[i,y]),mi=v.useCallback(async()=>{x(!1),_.showDownloadConfirm&&q();const ce=(_.showDownloadConfirm?_.actionPaths:Lt).map(xe=>"/"+xe.replace(/^public\//,""));await de.execute({endpoint:"/api/studio/download-stream",body:{imageKeys:ce},title:"Downloading from CDN",onComplete:()=>d()})},[Lt,d,_.showDownloadConfirm,_.actionPaths,q,de]),fo=v.useCallback(async()=>{if(i.size===0)return;const ce=Array.from(i).filter(xe=>{const Se=y.find(Oe=>Oe.path===xe);return Se&&(Se.hasUpdate||Se.type==="folder"&&Se.updateCount&&Se.updateCount>0)});if(ce.length===0){Je({title:"No Updates",message:"No files with pending updates in selection."});return}await de.execute({endpoint:"/api/studio/push-updates-stream",body:{paths:ce},title:"Pushing Updates",onComplete:()=>d()})},[i,y,d,de]),tl=v.useCallback(async()=>{if(i.size===0)return;const ce=Array.from(i).filter(xe=>{const Se=y.find(Oe=>Oe.path===xe);return Se&&(Se.hasUpdate||Se.type==="folder"&&Se.updateCount&&Se.updateCount>0)});if(ce.length!==0)try{const xe=await fetch("/api/studio/cancel-updates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:ce})});if(xe.ok)d(),p();else{const Se=await xe.json();Je({title:"Cancel Failed",message:Se.error||"Unknown error"})}}catch(xe){console.error("Cancel updates error:",xe),Je({title:"Cancel Failed",message:"Failed to cancel updates. Check console for details."})}},[i,y,d,p]),Xr=v.useCallback(async ge=>{ht(!1);try{const ce=await fetch("/api/studio/create-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentPath:h,name:ge})});if(ce.ok)p();else{const xe=await ce.json();Je({title:"Create Folder Failed",message:xe.error||"Unknown error"})}}catch(ce){console.error("Create folder error:",ce),Je({title:"Create Folder Failed",message:"Failed to create folder. Check console for details."})}},[h,p]),yi=v.useCallback(()=>{i.size!==0&&Ut(!0)},[i]),bi=v.useCallback(async ge=>{const ce=Array.from(i);await de.execute({endpoint:"/api/studio/move",body:{paths:ce,destination:ge},title:"Moving Files",onComplete:()=>d()})},[i,d,de]),{searchQuery:ho,setSearchQuery:aa}=co(),po=v.useCallback(ge=>{aa(ge.target.value)},[aa]),vi=v.useCallback(ge=>{ge.key==="Escape"&&(ge.stopPropagation(),aa(""),ge.target.blur())},[aa]),Gn=i.size>0;Gn&&Array.from(i).some(ge=>{const ce=y.find(xe=>xe.path===ge);return ce&&ce.cdnPushed&&!ce.isRemote}),Gn&&Array.from(i).every(ge=>{const ce=y.find(xe=>xe.path===ge);return ce&&ce.type==="file"&&ce.cdnPushed&&!ce.isRemote});const Kn=Gn&&Array.from(i).some(ge=>{const ce=y.find(xe=>xe.path===ge);return ce&&(ce.hasUpdate||ce.type==="folder"&&ce.updateCount&&ce.updateCount>0)}),At=Array.from(i),jt=At.length===1&&!At[0].includes("."),wn=jt?At[0]:null,Cl=wn&&wn.split("/").pop()||"",ka=At.length===1&&At[0].includes("."),za=ka?At[0]:null,go=za&&za.split("/").pop()||"",nl=v.useCallback(async ge=>{wn&&(St(!1),await de.execute({endpoint:"/api/studio/rename-stream",body:{oldPath:wn,newName:ge},title:"Renaming Folder",onComplete:()=>d()}))},[wn,d,de]),mo=v.useCallback(async ge=>{za&&(mt(!1),await de.execute({endpoint:"/api/studio/rename-stream",body:{oldPath:za,newName:ge},title:"Renaming File",onComplete:()=>d()}))},[za,d,de]),la=b(tt,{children:[(De||_.showDownloadConfirm)&&r(ro,{title:"Download from CDN",message:(()=>{const ge=_.showDownloadConfirm?_.downloadImageCount:O,ce=_.showDownloadConfirm?_.downloadTotalSelected:wl;return ce>ge?`Download ${ge} of ${ce} selected file${ce!==1?"s":""} from Cloudflare R2? (${ce-ge} not on CDN)`:`Download ${ge} image${ge!==1?"s":""} from Cloudflare R2 to local storage? Images will be removed from the CDN.`})(),confirmLabel:"Download",onConfirm:mi,onCancel:()=>{x(!1),_.showDownloadConfirm&&q()}}),se&&r(Ia,{title:Te,progress:lt,onStop:Xe,onDeleteOrphans:Wt,onClose:()=>{ve(!1),_e({current:0,total:0,percent:0,status:"processing"}),p()}})]});return C?la:b(tt,{children:[la,le&&r(ro,{title:"Delete Items",message:`Are you sure you want to delete ${W} file${W!==1?"s":""}? This action cannot be undone.`,confirmLabel:"Delete",variant:"danger",onConfirm:gi,onCancel:()=>j(!1)}),ye&&r(ro,{title:"Push to CDN",message:`Push ${re} image${re!==1?"s":""} to Cloudflare R2?${A?" Remote images will be downloaded first.":""}${I?" After pushing, local files will be deleted.":""}`,confirmLabel:"Push",onConfirm:ta,onCancel:()=>me(!1)}),ut&&r(xl,{title:"New Folder",message:"Enter a name for the new folder:",placeholder:"Folder name",confirmLabel:"Create",onConfirm:Xr,onCancel:()=>ht(!1)}),on&&r(Qp,{selectedItems:i,currentPath:h,onMove:ge=>{Ut(!1),bi(ge)},onCancel:()=>Ut(!1)}),Bt&&wn&&r(xl,{title:"Rename Folder",message:"Enter a new name for the folder:",placeholder:Cl,defaultValue:Cl,confirmLabel:"Rename",onConfirm:nl,onCancel:()=>St(!1)}),Dt&&za&&r(xl,{title:"Rename File",message:"Enter a new name for the file:",placeholder:go,defaultValue:go,confirmLabel:"Rename",onConfirm:mo,onCancel:()=>mt(!1)}),$t&&r(Yr,{title:$t.title,message:$t.message,onClose:()=>{Je(null),p()}}),r(Fp,{isOpen:Ie,onClose:()=>Nt(!1)}),ie&&r(S1,{currentPath:h,onClose:()=>K(!1),onUploadComplete:()=>{K(!1),p()},streamingOperation:de,setShowProgress:ve,setProgressTitle:qe,setProgressState:_e}),b("div",{css:ze.toolbar,children:[r("input",{ref:B,type:"file",multiple:!0,accept:"image/*,video/*,audio/*,.pdf",onChange:ae,style:{display:"none"}}),b("div",{css:ze.left,children:[b("button",{css:[ze.btn,ze.btnPrimary,"",""],onClick:()=>K(!0),disabled:ue||Ge,children:[r(T1,{}),"Add New"]}),b("button",{css:ze.btn,onClick:()=>{ka?mt(!0):jt?St(!0):ht(!0)},disabled:Ge&&!jt&&!ka,title:Ge&&!jt&&!ka?"Cannot create folders in protected images folder":void 0,children:[ka||jt?r(_1,{}):r(L1,{}),ka?"Rename File":jt?"Rename Folder":"New Folder"]}),r("div",{css:ze.divider}),b("div",{css:ze.cloudDropdownWrapper,ref:J,children:[b("button",{css:ze.btn,onClick:()=>Sn(!xn),disabled:_.showProgress||Ge,title:Ge?"Cannot process images folder":void 0,children:[r(q1,{}),"Thumbnails",r("svg",{css:ze.dropdownArrow,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),xn&&b("div",{css:ze.cloudDropdown,children:[b("button",{css:[ze.cloudDropdownItem,ze.cloudDropdownItemDefault,"",""],onClick:()=>{Sn(!1),Ae("generate")},children:[r(Y1,{}),"Generate Thumbnails"]}),b("button",{css:[ze.cloudDropdownItem,ze.cloudDropdownItemDanger,"",""],onClick:()=>{Sn(!1),Ae("remove")},children:[r(G1,{}),"Remove Thumbnails"]})]})]}),b("button",{css:[ze.btn,ze.btnDanger,"",""],onClick:Yn,disabled:!Gn,children:[r(R1,{}),"Delete"]}),b("button",{css:ze.btn,onClick:yi,disabled:!Gn,children:[r(O1,{}),"Move"]}),b("div",{css:ze.cloudDropdownWrapper,ref:fn,children:[b("button",{css:[ze.btn,ze.btnCloud,"",""],onClick:()=>dn(!Tt),disabled:!Gn,children:[r(kp,{}),"Cloud",r("svg",{css:ze.dropdownArrow,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),Tt&&Gn&&b("div",{css:ze.cloudDropdown,children:[Kn&&b(tt,{children:[b("button",{css:ze.cloudDropdownItem,onClick:()=>{dn(!1),fo()},children:[r(H1,{}),"Push Update"]}),b("button",{css:[ze.cloudDropdownItem,ze.cloudDropdownItemDanger,"",""],onClick:()=>{dn(!1),tl()},children:[r(B1,{}),"Cancel Update"]}),r("div",{css:ze.cloudDropdownDivider})]}),b("button",{css:ze.cloudDropdownItem,onClick:()=>{dn(!1),Ca()},children:[r(kp,{}),"Push CDN"]}),b("button",{css:ze.cloudDropdownItem,onClick:()=>{dn(!1),Gr()},children:[r(U1,{}),"Download"]})]})]}),b("div",{css:ze.searchWrapper,children:[r("input",{css:ze.searchInput,type:"text",placeholder:"Search images...",value:ho,onChange:po,onKeyDown:vi}),ho&&r("button",{css:ze.searchClearBtn,onClick:()=>aa(""),title:"Clear search",children:r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),b("div",{css:ze.right,children:[Gn&&b("span",{css:ze.selectionCount,children:[i.size," selected",r("button",{css:ze.clearBtn,onClick:d,children:"Clear"})]}),b("button",{css:ze.btn,onClick:H,disabled:oe,children:[r(A1,{spinning:oe}),"Scan"]}),r("button",{css:ze.btn,onClick:Pe,title:"Refresh view",disabled:ee,children:r(E1,{spinning:ee})}),b("div",{css:ze.viewToggle,children:[r("button",{css:[ze.viewBtn,c==="grid"&&ze.viewBtnActive,"",""],onClick:()=>f("grid"),"aria-label":"Grid view",children:r(N1,{})}),r("button",{css:[ze.viewBtn,c==="list"&&ze.viewBtnActive,"",""],onClick:()=>f("list"),"aria-label":"List view",children:r(j1,{})})]}),r(C1,{})]})]})]})}function T1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}function A1({spinning:i}){return r("svg",{css:[ze.icon,i&&ze.iconSpin,"",""],fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}function E1({spinning:i}){return r("svg",{css:[ze.icon,i&&ze.iconSpin,"",""],fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function R1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}function L1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})})}function _1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}function O1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})})}function kp(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})})}function H1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function B1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}function U1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})})}function N1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})}function j1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}function q1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}function Y1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}function G1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}class X1{async get(c){const f=await fetch(c,{cache:"no-store",headers:{"Cache-Control":"no-cache"}});if(!f.ok){const d=await f.json().catch(()=>({}));throw new Error(d.error||`Request failed: ${f.status}`)}return f.json()}async post(c,f){const d=await fetch(c,{method:"POST",headers:f?{"Content-Type":"application/json"}:void 0,body:f?JSON.stringify(f):void 0});if(!d.ok){const h=await d.json().catch(()=>({}));throw new Error(h.error||`Request failed: ${d.status}`)}return d.json()}async list(c="public"){return this.get(`/api/studio/list?path=${encodeURIComponent(c)}`)}async search(c,f="public"){return this.get(`/api/studio/search?q=${encodeURIComponent(c)}&path=${encodeURIComponent(f)}`)}async listFolders(){return this.get("/api/studio/list-folders")}async countImages(){return this.get("/api/studio/count-images")}async folderImages(c){return this.get(`/api/studio/folder-images?folders=${encodeURIComponent(c.join(","))}`)}async upload(c,f="public"){const d=new FormData;d.append("file",c),d.append("path",f);const h=await fetch("/api/studio/upload",{method:"POST",body:d});if(!h.ok){const p=await h.json().catch(()=>({}));throw new Error(p.error||`Upload failed: ${h.status}`)}return h.json()}async delete(c){return this.post("/api/studio/delete",{paths:c})}async createFolder(c,f){return this.post("/api/studio/create-folder",{parentPath:c,name:f})}async rename(c,f){return this.post("/api/studio/rename",{oldPath:c,newName:f})}async move(c,f){return this.post("/api/studio/move",{paths:c,destination:f})}async push(c){return this.post("/api/studio/sync",{imageKeys:c})}async reprocess(c){return this.post("/api/studio/reprocess",{imageKeys:c})}processAllStream(){return new EventSource("/api/studio/process-all")}async checkFeaturedImage(){return this.get("/api/studio/check-featured-image")}async getFeaturedImageOptions(){return this.get("/api/studio/featured-image-options")}}const si=new X1;function Kp(){const{currentPath:i,setCurrentPath:c,navigateUp:f,selectedItems:d,toggleSelection:h,selectRange:p,lastSelectedPath:C,selectAll:D,clearSelection:w,refreshKey:y,setFocusedItem:T,triggerRefresh:z,triggerScan:_,searchQuery:q,showError:B,setFileItems:G,editedImageKey:ie}=co(),[K,ue]=v.useState([]),[Q,oe]=v.useState(!0),[X,ee]=v.useState(!1),[te,le]=v.useState(null),j=v.useRef(!0),W=v.useRef(i);v.useEffect(()=>{async function x(){const O=W.current!==i;(j.current||O)&&oe(!0),W.current=i;try{const ne=q&&q.length>=2?await si.search(q,i):await si.list(i),se=ne.items||[];ue(se),G(se),ee(ne.isEmpty===!0)}catch(ne){const se=ne instanceof Error?ne.message:"Failed to load items";B("Load Error",se),ue([]),G([]),ee(!1)}oe(!1),j.current=!1}x()},[i,y,q,B,G]),v.useEffect(()=>{async function x(){if(i!=="public"){le(null);return}try{const O=await si.checkFeaturedImage();le(O)}catch{le(null)}}x()},[i,y]);const pe=i==="public",ye=q&&q.length>=2,me=[...K].sort((x,O)=>x.type==="folder"&&O.type!=="folder"?-1:x.type!=="folder"&&O.type==="folder"?1:x.name.localeCompare(O.name)),re=me.length>0&&me.every(x=>d.has(x.path)),Be=me.some(x=>d.has(x.path)),A=v.useCallback((x,O)=>{O.shiftKey&&C?p(C,x.path,me):h(x.path)},[C,p,me,h]),Z=v.useCallback(x=>{x.type==="folder"?c(x.path):T(x)},[c,T]),I=v.useCallback(async x=>{try{const O="/"+x.path.replace(/^public\//,"");await si.reprocess([O]),z()}catch(O){const ne=O instanceof Error?O.message:"Failed to generate thumbnail";B("Processing Error",ne)}},[z,B]),Ee=v.useCallback(()=>{re?w():D(me)},[re,w,D,me]),De=te&&!te.exists?te:null;return{items:K,loading:Q,sortedItems:me,metaEmpty:X,missingFeaturedImage:De,isAtRoot:pe,isSearching:ye,allItemsSelected:re,someItemsSelected:Be,currentPath:i,selectedItems:d,navigateUp:f,editedImageKey:ie,handleItemClick:A,handleOpen:Z,handleGenerateThumbnail:I,handleSelectAll:Ee,triggerScan:_,triggerRefresh:z}}const V1=Gt`
72
+ from { opacity: 0; }
73
+ to { opacity: 1; }
74
+ `,Q1=Gt`
75
+ from { transform: translateY(-20px); opacity: 0; }
76
+ to { transform: translateY(0); opacity: 1; }
77
+ `,F1=Gt`
78
+ to { transform: rotate(360deg); }
79
+ `,an={overlay:m("position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;background:rgba(0, 0, 0, 0.5);animation:",V1," 0.15s ease;",""),modal:m("background:",s.surface,";border-radius:12px;box-shadow:0 20px 40px rgba(0, 0, 0, 0.2);width:100%;max-width:440px;animation:",Q1," 0.2s ease;overflow:hidden;",""),header:m("padding:20px 24px;border-bottom:1px solid ",s.border,";",""),title:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0;",""),subtitle:m("font-size:",N.sm,";color:",s.textSecondary,";margin:4px 0 0 0;",""),body:{name:"1a7zdz",styles:"padding:24px;display:flex;flex-direction:column;gap:12px"},loading:{name:"uphaut",styles:"display:flex;align-items:center;justify-content:center;padding:40px"},spinner:m("width:24px;height:24px;border-radius:50%;border:2px solid ",s.border,";border-top-color:",s.primary,";animation:",F1," 0.8s linear infinite;",""),urlButton:m("display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:16px 20px;background:",s.background,";border:1px solid ",s.border,";border-radius:8px;cursor:pointer;transition:all 0.15s ease;text-align:left;&:hover:not(:disabled){background:",s.surfaceHover,";border-color:",s.primary,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),urlLabel:m("font-size:",N.xs,";font-weight:600;color:",s.textSecondary,";text-transform:uppercase;letter-spacing:0.05em;",""),urlValue:m("font-size:",N.base,";font-weight:500;color:",s.text,";word-break:break-all;",""),noOptions:m("padding:20px;text-align:center;color:",s.textSecondary,";font-size:",N.sm,";",""),footer:m("padding:16px 24px;border-top:1px solid ",s.border,";display:flex;justify-content:flex-end;",""),cancelBtn:m("padding:10px 20px;font-size:",N.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:",s.text,";&:hover{background:",s.surfaceHover,";border-color:",s.borderHover,";}","")};function Zp({isOpen:i,onClose:c,onSelect:f}){const[d,h]=v.useState(!0),[p,C]=v.useState(null),[D,w]=v.useState(null);if(v.useEffect(()=>{if(!i)return;async function T(){h(!0);try{const z=await si.getFeaturedImageOptions();C(z.devUrl),w(z.productionUrl)}catch(z){console.error("Failed to load featured image options:",z)}h(!1)}T()},[i]),!i)return null;const y=p||D;return r("div",{css:an.overlay,onClick:c,children:b("div",{css:an.modal,onClick:T=>T.stopPropagation(),children:[b("div",{css:an.header,children:[r("h2",{css:an.title,children:"Generate Screenshot"}),r("p",{css:an.subtitle,children:"Choose which URL to screenshot"})]}),r("div",{css:an.body,children:d?r("div",{css:an.loading,children:r("div",{css:an.spinner})}):y?b(tt,{children:[p&&b("button",{css:an.urlButton,onClick:()=>f(p),children:[r("span",{css:an.urlLabel,children:"Development"}),r("span",{css:an.urlValue,children:p})]}),D&&b("button",{css:an.urlButton,onClick:()=>f(D),children:[r("span",{css:an.urlLabel,children:"Production"}),r("span",{css:an.urlValue,children:D})]})]}):b("div",{css:an.noOptions,children:["No URLs configured. Set ",r("code",{children:"NEXT_PUBLIC_PRODUCTION_URL"})," in .env.local and/or .env.production."]})}),r("div",{css:an.footer,children:r("button",{css:an.cancelBtn,onClick:c,children:"Cancel"})})]})})}const K1=Gt`
80
+ to { transform: rotate(360deg); }
81
+ `,fe={loading:{name:"1d2ui9i",styles:"display:flex;align-items:center;justify-content:center;flex:1;min-height:300px"},spinner:m("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",K1," 0.8s linear infinite;",""),empty:m("display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-height:300px;color:",s.textSecondary,";",""),emptyIcon:{name:"1o3cbsn",styles:"width:48px;height:48px;margin-bottom:16px;opacity:0.5"},emptyText:m("font-size:",N.base,";margin:0 0 4px 0;&:last-child{color:",s.textMuted,";font-size:",N.sm,";}",""),scanButton:m("margin-top:16px;padding:10px 24px;font-size:",N.base,";font-weight:500;background:",s.primary,";color:white;border:none;border-radius:8px;cursor:pointer;transition:background 0.15s ease;&:hover:not(:disabled){background:",s.primaryHover,";}&:disabled{opacity:0.6;cursor:not-allowed;}",""),grid:{name:"el23hk",styles:"display:grid;grid-template-columns:1fr;gap:12px;@media (min-width: 480px){grid-template-columns:repeat(2, 1fr);}@media (min-width: 768px){grid-template-columns:repeat(3, 1fr);}@media (min-width: 1024px){grid-template-columns:repeat(4, 1fr);}@media (min-width: 1280px){grid-template-columns:repeat(5, 1fr);}"},item:m("position:relative;border-radius:8px;border:1px solid ",s.border,";overflow:hidden;cursor:pointer;transition:all 0.15s ease;background-color:",s.surface,";user-select:none;box-shadow:0 1px 2px rgba(0, 0, 0, 0.04);&:hover{border-color:#d0d5dd;box-shadow:0 2px 4px rgba(0, 0, 0, 0.06);}",""),itemSelected:m("border-color:",s.primary,";box-shadow:0 0 0 1px ",s.primary,";&:hover{border-color:",s.primary,";box-shadow:0 0 0 1px ",s.primary,";}",""),parentItem:m("cursor:pointer;&:hover{border-color:",s.primary,";}",""),checkboxWrapper:{name:"v3lnpt",styles:"position:absolute;top:0;left:0;z-index:10;padding:8px;cursor:pointer"},checkbox:m("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;",""),content:m("position:relative;aspect-ratio:1;display:flex;align-items:center;justify-content:center;padding:16px;background:",s.background,";",""),contentCloud:m("",""),contentRemote:m("",""),folderIcon:{name:"k1w47f",styles:"width:56px;height:56px;color:#f9935e"},imagesFolderIcon:m("width:56px;height:56px;color:",s.imagesFolder,";",""),imagesFolderWrapper:{name:"bjn8wh",styles:"position:relative"},lockIcon:m("position:absolute;bottom:4px;right:4px;width:16px;height:16px;color:",s.imagesFolder,";background:white;border-radius:50%;padding:2px;",""),parentIcon:m("width:56px;height:56px;color:",s.textMuted,";",""),fileIcon:m("width:40px;height:40px;color:",s.textMuted,";",""),image:{name:"rm1wug",styles:"max-width:100%;max-height:100%;object-fit:contain;border-radius:4px"},label:m("padding:10px 12px;background-color:",s.surface,";border-top:1px solid ",s.borderLight,";",""),labelRow:{name:"1gkgtms",styles:"display:flex;flex-direction:column;gap:2px"},labelText:{name:"fxp7t8",styles:"flex:1;min-width:0"},copyBtn:m("position:absolute;top:4px;right:4px;z-index:10;height:28px;width:28px;color:",s.textMuted,";background:transparent;border:none;padding:0;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{color:",s.text,";}",""),copyIcon:{name:"1eg0rk6",styles:"width:18px;height:18px"},folderStats:{name:"905wvx",styles:"display:flex;align-items:center;gap:8px;margin:2px 0 0 0"},folderStat:m("display:flex;align-items:center;gap:3px;font-size:",N.xs,";",""),folderStatLocal:m("color:",s.textMuted,";",""),folderStatCloud:{name:"1t8qh25",styles:"color:#f59e0b"},folderStatRemote:{name:"1lukubv",styles:"color:#ef4444"},folderStatUpdate:{name:"1t8qh25",styles:"color:#f59e0b"},folderStatIconCloud:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},folderStatIconLocal:m("width:14px;height:14px;color:",s.textSecondary,";",""),folderStatIconRemote:{name:"efr29r",styles:"width:14px;height:14px;color:#ef4444"},folderStatIconUpdate:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},updateLabel:m("color:#f59e0b;font-size:",N.xs,";",""),updateCloudIcon:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},updateSyncIcon:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},statusRow:{name:"1b1nq65",styles:"display:flex;align-items:center;justify-content:space-between;margin:2px 0 0 0;gap:4px"},statusLeft:{name:"1j5vobt",styles:"display:flex;align-items:center;gap:4px"},thumbChips:{name:"x2l7ss",styles:"display:flex;align-items:center;gap:3px;margin-left:auto"},thumbChip:m("display:inline-flex;align-items:center;justify-content:center;padding:1px 4px;font-size:9px;font-weight:600;border-radius:3px;background:rgba(0, 0, 0, 0.08);color:",s.textMuted,";text-transform:uppercase;letter-spacing:0.02em;",""),storedIconCloud:{name:"1e09qmx",styles:"width:16px;height:16px;color:#f59e0b"},storedIconRemote:{name:"1mrh6ju",styles:"width:16px;height:16px;color:#ef4444"},tooltip:{name:"qoyfdh",styles:"position:absolute;top:50%;right:100%;transform:translateY(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-right:6px;pointer-events:none;z-index:100;&::before{content:'';position:absolute;left:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-left-color:#1a1f36;}"},openBtn:m("position:absolute;bottom:8px;right:8px;z-index:10;height:28px;font-size:",N.sm,";font-weight:500;color:",s.primary,";background:",s.surface,";border:1px solid ",s.border,";padding:0 8px;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:flex;align-items:center;box-shadow:0 1px 2px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";}",""),featuredPlaceholder:m("position:relative;border-radius:8px;border:2px dashed ",s.success,";overflow:hidden;cursor:pointer;transition:all 0.15s ease;background-color:",s.background,";&:hover{border-color:",s.success,";background-color:",s.successLight,";}",""),featuredContent:{name:"y8o17o",styles:"position:relative;aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;gap:8px"},featuredIcon:m("width:40px;height:40px;color:",s.success,";",""),featuredText:m("font-size:",N.sm,";color:",s.success,";text-align:center;font-weight:500;",""),featuredLabel:m("padding:10px 12px;background-color:",s.surface,";border-top:1px solid ",s.borderLight,";",""),name:m("font-size:",N.sm,";font-weight:500;color:",s.text,";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;letter-spacing:-0.01em;direction:rtl;text-align:left;",""),size:m("font-size:",N.xs,";color:",s.textMuted,";margin:2px 0 0 0;",""),selectAllRow:m("display:flex;align-items:center;margin-bottom:16px;padding:12px 16px;background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";",""),selectAllLabel:m("display:flex;align-items:center;gap:10px;font-size:",N.base,";font-weight:500;color:",s.textSecondary,";cursor:pointer;&:hover{color:",s.text,";}",""),selectAllCheckbox:m("width:16px;height:16px;accent-color:",s.primary,";","")};function Z1(){const{loading:i,sortedItems:c,metaEmpty:f,missingFeaturedImage:d,isAtRoot:h,isSearching:p,allItemsSelected:C,someItemsSelected:D,selectedItems:w,navigateUp:y,handleItemClick:T,handleOpen:z,handleGenerateThumbnail:_,handleSelectAll:q,triggerScan:B,triggerRefresh:G,editedImageKey:ie}=Kp(),[K,ue]=v.useState(!1),[Q,oe]=v.useState(!1),[X,ee]=v.useState({current:0,total:3,percent:0,status:"processing",message:"Generating screenshot..."}),te=()=>{ue(!0)},le=async j=>{ue(!1),oe(!0),ee({current:0,total:4,percent:0,status:"processing",message:"Starting..."});try{const W=await fetch("/api/studio/generate-featured-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:j})});if(!W.ok){const me=await W.json();ee({current:0,total:4,percent:0,status:"error",message:me.error||"Failed to generate screenshot"});return}const pe=W.body?.getReader(),ye=new TextDecoder;if(pe){let me="";for(;;){const{done:re,value:Be}=await pe.read();if(re)break;me+=ye.decode(Be,{stream:!0});const A=me.split(`
82
+ `);me=A.pop()||"";for(const Z of A)if(Z.startsWith("data: "))try{const I=JSON.parse(Z.slice(6));I.type==="start"?ee(Ee=>({...Ee,total:I.total,message:`Screenshotting ${I.url}...`})):I.type==="progress"?ee({current:I.current,total:I.total,percent:I.percent,status:"processing",message:I.message}):I.type==="complete"?(ee({current:I.processed,total:I.processed,percent:100,status:I.errors>0?"error":"complete",message:I.message}),G()):I.type==="error"&&ee(Ee=>({...Ee,status:"error",message:I.message}))}catch{}}}}catch(W){console.error("Featured image generation error:",W),ee({current:0,total:3,percent:0,status:"error",message:"An error occurred while generating the screenshot"})}};return i?b(tt,{children:[Q&&r(Ia,{title:"Generating Screenshot",progress:X,onClose:()=>oe(!1)}),r("div",{css:fe.loading,children:r("div",{css:fe.spinner})})]}):f&&h?b("div",{css:fe.empty,children:[r("svg",{css:fe.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),r("p",{css:fe.emptyText,children:"No files tracked yet"}),r("p",{css:fe.emptyText,children:"Click Scan to discover files in your public folder"}),r("button",{css:fe.scanButton,onClick:B,children:"Scan for Files"})]}):c.length===0&&h?b("div",{css:fe.empty,children:[r("svg",{css:fe.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),r("p",{css:fe.emptyText,children:"No files in this folder"}),r("p",{css:fe.emptyText,children:"Upload images or click Scan in the toolbar"})]}):b(tt,{children:[r(Zp,{isOpen:K,onClose:()=>ue(!1),onSelect:le}),Q&&r(Ia,{title:"Generating Screenshot",progress:X,onClose:()=>oe(!1)}),b("div",{children:[c.length>0&&r("div",{css:fe.selectAllRow,children:b("label",{css:fe.selectAllLabel,children:[r("input",{type:"checkbox",css:fe.selectAllCheckbox,checked:C,ref:j=>{j&&(j.indeterminate=D&&!C)},onChange:q}),"Select all (",c.length,")"]})}),b("div",{css:fe.grid,children:[!h&&!p&&b("div",{css:[fe.item,fe.parentItem,"",""],onClick:y,children:[r("div",{css:fe.content,children:r("svg",{css:fe.parentIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}),b("div",{css:fe.label,children:[r("p",{css:fe.name,children:".."}),r("p",{css:fe.size,children:"Parent folder"})]})]}),c.map(j=>r($1,{item:j,isSelected:w.has(j.path),onClick:W=>T(j,W),onOpen:()=>z(j),onGenerateThumbnail:()=>_(j),editedImageKey:ie},j.path)),h&&d&&!p&&b("div",{css:fe.featuredPlaceholder,onClick:te,title:`Generate ${d.filename}`,children:[b("div",{css:fe.featuredContent,children:[r("svg",{css:fe.featuredIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),r("span",{css:fe.featuredText,children:"Generate Screenshot"})]}),b("div",{css:fe.featuredLabel,children:[r("p",{css:fe.name,children:d.filename}),r("p",{css:fe.size,children:"Click to screenshot homepage"})]})]})]})]})]})}function J1(i){return i.includes("/images/sm/")?"SM":i.includes("/images/md/")?"MD":i.includes("/images/lg/")?"LG":i.includes("/images/full/")?"FULL":null}function $1({item:i,isSelected:c,onClick:f,onOpen:d,onGenerateThumbnail:h,editedImageKey:p}){const[C,D]=v.useState(!1),w=i.type==="folder",y=!w&&i.thumbnail!==void 0,T=i.thumbnail&&p&&p.path===i.path?`${i.thumbnail}?v=${p.key}`:i.thumbnail,z=i.isProtected||w&&i.name==="images"&&i.path==="public/images",_=J1(i.path),q=!w&&(i.hasSm||i.hasMd||i.hasLg||i.hasFull||_),B=ie=>{ie.stopPropagation();const K="/"+i.path.replace(/^public\//,"");navigator.clipboard.writeText(K),D(!0),setTimeout(()=>D(!1),1500)},G=ie=>{if(z){ie.stopPropagation(),d();return}f(ie)};return b("div",{css:[fe.item,c&&!z&&fe.itemSelected,"",""],onClick:G,children:[!z&&r("div",{css:fe.checkboxWrapper,onClick:ie=>ie.stopPropagation(),children:r("input",{type:"checkbox",css:fe.checkbox,checked:c,onChange:()=>f({})})}),b("div",{css:[fe.content,i.isCloud&&fe.contentCloud,i.isRemote&&fe.contentRemote,"",""],children:[b("button",{css:fe.copyBtn,onClick:B,title:"Copy file path",children:[C&&r("span",{css:fe.tooltip,children:"Copied!"}),r("svg",{css:fe.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})]}),r("button",{css:fe.openBtn,onClick:ie=>{ie.stopPropagation(),d()},children:"Open"}),w?z?b("div",{css:fe.imagesFolderWrapper,children:[r("svg",{css:fe.imagesFolderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}),r("svg",{css:fe.lockIcon,fill:"currentColor",viewBox:"0 0 20 20",children:r("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})})]}):r("svg",{css:fe.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}):y&&T?r("img",{css:fe.image,src:T,alt:i.name,loading:"lazy"}):r("svg",{css:fe.fileIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})]}),r("div",{css:fe.label,children:r("div",{css:fe.labelRow,children:b("div",{css:fe.labelText,children:[r("p",{css:fe.name,title:i.name,children:i.name}),w?b("div",{css:fe.folderStats,children:[i.localCount!==void 0&&i.localCount>0&&b("span",{css:[fe.folderStat,fe.folderStatLocal,"",""],title:`${i.localCount} local`,children:[r("svg",{css:fe.folderStatIconLocal,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),i.localCount]}),i.cloudCount!==void 0&&i.cloudCount>0&&b("span",{css:[fe.folderStat,fe.folderStatCloud,"",""],title:`${i.cloudCount} in cloud`,children:[r("svg",{css:fe.folderStatIconCloud,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),i.cloudCount]}),i.remoteCount!==void 0&&i.remoteCount>0&&b("span",{css:[fe.folderStat,fe.folderStatRemote,"",""],title:`${i.remoteCount} remote`,children:[r("svg",{css:fe.folderStatIconRemote,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})}),i.remoteCount]}),i.updateCount!==void 0&&i.updateCount>0&&b("span",{css:[fe.folderStat,fe.folderStatUpdate,"",""],title:`${i.updateCount} pending update${i.updateCount!==1?"s":""}`,children:[r("svg",{css:fe.folderStatIconUpdate,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),i.updateCount]}),!i.localCount&&!i.cloudCount&&!i.remoteCount&&!i.updateCount&&i.fileCount!==void 0&&b("span",{css:fe.size,children:[i.fileCount," files"]})]}):b("div",{css:fe.statusRow,children:[r("div",{css:fe.statusLeft,children:i.hasUpdate?b(tt,{children:[r("svg",{css:fe.updateCloudIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),r("svg",{css:fe.updateSyncIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),r("span",{css:fe.updateLabel,children:"update"})]}):i.cdnPushed?r("svg",{css:i.isRemote?fe.storedIconRemote:fe.storedIconCloud,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.isRemote?r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}):r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}):i.size!==void 0?r("span",{css:fe.size,children:W1(i.size)}):null}),q&&r("span",{css:fe.thumbChips,children:_?r("span",{css:fe.thumbChip,children:_}):b(tt,{children:[i.hasSm&&r("span",{css:fe.thumbChip,children:"SM"}),i.hasMd&&r("span",{css:fe.thumbChip,children:"MD"}),i.hasLg&&r("span",{css:fe.thumbChip,children:"LG"}),i.hasFull&&r("span",{css:fe.thumbChip,children:"FULL"})]})})]})]})})})]})}function W1(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}const I1=Gt`
83
+ to { transform: rotate(360deg); }
84
+ `,P={loading:{name:"1d2ui9i",styles:"display:flex;align-items:center;justify-content:center;flex:1;min-height:300px"},spinner:m("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",I1," 0.8s linear infinite;",""),empty:m("display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-height:300px;color:",s.textSecondary,";",""),emptyHint:m("font-size:",N.sm,";color:",s.textMuted,";margin-top:4px;",""),scanButton:m("margin-top:16px;padding:10px 24px;font-size:",N.base,";font-weight:500;background:",s.primary,";color:white;border:none;border-radius:8px;cursor:pointer;transition:background 0.15s ease;&:hover:not(:disabled){background:",s.primaryHover,";}&:disabled{opacity:0.6;cursor:not-allowed;}",""),tableWrapper:m("background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";overflow-x:auto;",""),table:{name:"nufjao",styles:"width:100%;min-width:600px;border-collapse:collapse;white-space:nowrap"},th:m("text-align:left;font-size:11px;color:",s.textMuted,";text-transform:uppercase;letter-spacing:0.05em;padding:12px 16px;font-weight:600;background:",s.background,";border-bottom:1px solid ",s.border,";",""),thCheckbox:{name:"5iz1wr",styles:"width:48px"},thSize:{name:"yct5co",styles:"width:96px"},thDimensions:{name:"gu2s0e",styles:"width:128px"},thCdn:{name:"yct5co",styles:"width:96px"},tbody:m("",""),row:m("cursor:pointer;transition:background-color 0.15s ease;user-select:none;&:hover{background-color:",s.surfaceHover,";}&:not(:last-child) td{border-bottom:1px solid ",s.borderLight,";}",""),rowSelected:m("background-color:",s.primaryLight,";&:hover{background-color:",s.primaryLight,";}",""),parentRow:m("cursor:pointer;border-bottom:1px solid ",s.border,";&:hover{background-color:",s.surfaceHover,";}",""),td:{name:"i563hg",styles:"padding:12px 16px"},checkboxCell:{name:"sahq4q",styles:"padding:12px 16px;cursor:pointer;vertical-align:middle"},checkbox:m("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;display:block;",""),actionsCell:{name:"1w56d5c",styles:"display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto;flex-shrink:0"},copyBtn:m("position:relative;flex-shrink:0;height:32px;width:32px;font-size:",N.xs,";color:",s.textSecondary,";background:",s.surface,";border:1px solid ",s.border,";padding:0;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:inline-flex;align-items:center;justify-content:center;&:hover{background:",s.surfaceHover,";border-color:",s.borderHover,";color:",s.text,";}",""),copyIcon:{name:"157xhr7",styles:"width:16px;height:16px"},folderStats:{name:"1yydxi7",styles:"display:flex;align-items:center;gap:8px"},folderStat:m("display:flex;align-items:center;gap:3px;font-size:",N.xs,";",""),folderStatLocal:m("color:",s.textMuted,";",""),folderStatCloud:{name:"1t8qh25",styles:"color:#f59e0b"},folderStatRemote:{name:"1lukubv",styles:"color:#ef4444"},folderStatUpdate:{name:"1t8qh25",styles:"color:#f59e0b"},folderStatIconCloud:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},folderStatIconLocal:m("width:14px;height:14px;color:",s.textSecondary,";",""),folderStatIconRemote:{name:"efr29r",styles:"width:14px;height:14px;color:#ef4444"},folderStatIconUpdate:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},updateLabel:m("display:flex;align-items:center;gap:4px;color:#f59e0b;font-size:",N.xs,";",""),updateCloudIcon:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},updateSyncIcon:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},storedLabel:{name:"s5xdrg",styles:"display:flex;align-items:center"},storedIconCloud:{name:"1e09qmx",styles:"width:16px;height:16px;color:#f59e0b"},storedIconRemote:{name:"1mrh6ju",styles:"width:16px;height:16px;color:#ef4444"},tooltip:{name:"1bu1odp",styles:"position:absolute;top:50%;right:100%;transform:translateY(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-right:6px;pointer-events:none;z-index:100;&::after{content:'';position:absolute;left:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-left-color:#1a1f36;}"},nameCell:{name:"9s3nhy",styles:"display:flex;align-items:center;gap:12px;flex:1"},thumbnailWrapper:{name:"f01c4l",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:4px"},thumbnailCloud:m("",""),thumbnailRemote:m("",""),folderIconWrapper:{name:"xfecxx",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0"},folderIcon:{name:"a45yt2",styles:"width:24px;height:24px;color:#f9935e"},imagesFolderWrapper:{name:"iqqile",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;align-items:center"},imagesFolderIcon:m("width:24px;height:24px;color:",s.imagesFolder,";",""),lockIcon:m("width:10px;height:10px;color:",s.imagesFolder,";margin-left:-6px;margin-top:8px;",""),parentIcon:m("width:20px;height:20px;color:",s.textMuted,";flex-shrink:0;",""),fileIcon:m("width:20px;height:20px;color:",s.textMuted,";flex-shrink:0;",""),thumbnail:m("max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:4px;border:1px solid ",s.borderLight,";",""),name:m("font-size:",N.base,";font-weight:500;color:",s.text,";letter-spacing:-0.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:300px;",""),meta:m("font-size:",N.sm,";color:",s.textSecondary,";",""),cdnBadge:m("display:inline-flex;align-items:center;gap:4px;font-size:",N.xs,";font-weight:500;color:",s.success,";",""),cdnBadgeRemote:m("display:inline-flex;align-items:center;font-size:",N.xs,";font-weight:500;color:#ef4444;",""),cdnIcon:{name:"1suksrg",styles:"width:12px;height:12px"},cdnEmpty:m("font-size:",N.sm,";color:",s.textMuted,";",""),featuredRow:m("cursor:pointer;transition:background-color 0.15s ease;border:2px dashed ",s.success,";&:hover{background-color:",s.successLight,";}td{border-bottom:none!important;}",""),featuredIcon:m("width:24px;height:24px;color:",s.success,";",""),featuredText:m("color:",s.success,";font-weight:500;",""),openBtn:m("height:32px;font-size:",N.sm,";font-weight:500;color:",s.primary,";background:",s.surface,";border:1px solid ",s.border,";padding:0 14px;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:inline-flex;align-items:center;&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";}","")};function P1(){const{loading:i,sortedItems:c,metaEmpty:f,missingFeaturedImage:d,isAtRoot:h,isSearching:p,allItemsSelected:C,someItemsSelected:D,selectedItems:w,navigateUp:y,handleItemClick:T,handleOpen:z,handleGenerateThumbnail:_,handleSelectAll:q,triggerScan:B,triggerRefresh:G,editedImageKey:ie}=Kp(),[K,ue]=v.useState(!1),[Q,oe]=v.useState(!1),[X,ee]=v.useState({current:0,total:3,percent:0,status:"processing",message:"Generating screenshot..."}),te=()=>{ue(!0)},le=async j=>{ue(!1),oe(!0),ee({current:0,total:4,percent:0,status:"processing",message:"Starting..."});try{const W=await fetch("/api/studio/generate-featured-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:j})});if(!W.ok){const me=await W.json();ee({current:0,total:4,percent:0,status:"error",message:me.error||"Failed to generate screenshot"});return}const pe=W.body?.getReader(),ye=new TextDecoder;if(pe){let me="";for(;;){const{done:re,value:Be}=await pe.read();if(re)break;me+=ye.decode(Be,{stream:!0});const A=me.split(`
85
+ `);me=A.pop()||"";for(const Z of A)if(Z.startsWith("data: "))try{const I=JSON.parse(Z.slice(6));I.type==="start"?ee(Ee=>({...Ee,total:I.total,message:`Screenshotting ${I.url}...`})):I.type==="progress"?ee({current:I.current,total:I.total,percent:I.percent,status:"processing",message:I.message}):I.type==="complete"?(ee({current:I.processed,total:I.processed,percent:100,status:I.errors>0?"error":"complete",message:I.message}),G()):I.type==="error"&&ee(Ee=>({...Ee,status:"error",message:I.message}))}catch{}}}}catch(W){console.error("Featured image generation error:",W),ee({current:0,total:3,percent:0,status:"error",message:"An error occurred while generating the screenshot"})}};return i?r("div",{css:P.loading,children:r("div",{css:P.spinner})}):f&&h?b("div",{css:P.empty,children:[r("p",{children:"No files tracked yet"}),r("p",{css:P.emptyHint,children:"Click Scan to discover files in your public folder"}),r("button",{css:P.scanButton,onClick:B,children:"Scan for Files"})]}):c.length===0&&h?b("div",{css:P.empty,children:[r("p",{children:"No files in this folder"}),r("p",{css:P.emptyHint,children:"Upload images or click Scan in the toolbar"})]}):b(tt,{children:[r(Zp,{isOpen:K,onClose:()=>ue(!1),onSelect:le}),Q&&r(Ia,{title:"Generating Screenshot",progress:X,onClose:()=>oe(!1)}),r("div",{css:P.tableWrapper,children:b("table",{css:P.table,children:[r("thead",{children:b("tr",{children:[r("th",{css:[P.th,P.thCheckbox,"",""],children:c.length>0&&r("input",{type:"checkbox",css:P.checkbox,checked:C,ref:j=>{j&&(j.indeterminate=D&&!C)},onChange:q})}),r("th",{css:P.th,children:"Name"}),r("th",{css:[P.th,P.thSize,"",""],children:"Size"}),r("th",{css:[P.th,P.thDimensions,"",""],children:"Dimensions"}),r("th",{css:[P.th,P.thCdn,"",""],children:"CDN"})]})}),b("tbody",{css:P.tbody,children:[!h&&!p&&b("tr",{css:P.parentRow,onClick:y,children:[r("td",{css:P.td}),r("td",{css:P.td,children:b("div",{css:P.nameCell,children:[r("svg",{css:P.parentIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})}),r("span",{css:P.name,children:".."})]})}),r("td",{css:[P.td,P.meta,"",""],children:"--"}),r("td",{css:[P.td,P.meta,"",""],children:"Parent folder"}),r("td",{css:P.td,children:"--"})]}),c.map(j=>r(e2,{item:j,isSelected:w.has(j.path),onClick:W=>T(j,W),onOpen:()=>z(j),onGenerateThumbnail:()=>_(j),editedImageKey:ie},j.path)),h&&d&&!p&&b("tr",{css:P.featuredRow,onClick:te,title:`Generate ${d.filename}`,children:[r("td",{css:P.td}),r("td",{css:P.td,children:b("div",{css:P.nameCell,children:[r("div",{css:P.folderIconWrapper,children:r("svg",{css:P.featuredIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),r("span",{css:[P.name,P.featuredText,"",""],children:d.filename})]})}),r("td",{css:[P.td,P.meta,P.featuredText,"",""],children:"--"}),r("td",{css:[P.td,P.meta,P.featuredText,"",""],children:"Click to generate"}),r("td",{css:[P.td,P.featuredText,"",""],children:"--"})]})]})]})})]})}function e2({item:i,isSelected:c,onClick:f,onOpen:d,onGenerateThumbnail:h,editedImageKey:p}){const[C,D]=v.useState(!1),w=i.type==="folder",y=!w&&i.thumbnail!==void 0,T=i.thumbnail&&p&&p.path===i.path?`${i.thumbnail}?v=${p.key}`:i.thumbnail,z=i.isProtected||w&&i.name==="images"&&i.path==="public/images",_=B=>{B.stopPropagation();const G="/"+i.path.replace(/^public\//,"");navigator.clipboard.writeText(G),D(!0),setTimeout(()=>D(!1),1500)},q=B=>{if(z){B.stopPropagation(),d();return}f(B)};return b("tr",{css:[P.row,c&&!z&&P.rowSelected,"",""],onClick:q,children:[r("td",{css:[P.td,P.checkboxCell,"",""],onClick:B=>B.stopPropagation(),children:!z&&r("input",{type:"checkbox",css:P.checkbox,checked:c,onChange:()=>f({})})}),r("td",{css:P.td,children:b("div",{css:P.nameCell,children:[w?z?b("div",{css:P.imagesFolderWrapper,children:[r("svg",{css:P.imagesFolderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}),r("svg",{css:P.lockIcon,fill:"currentColor",viewBox:"0 0 20 20",children:r("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})})]}):r("div",{css:P.folderIconWrapper,children:r("svg",{css:P.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})})}):y&&T?r("div",{css:[P.thumbnailWrapper,i.isCloud&&P.thumbnailCloud,i.isRemote&&P.thumbnailRemote,"",""],children:r("img",{css:P.thumbnail,src:T,alt:i.name,loading:"lazy"})}):r("div",{css:[P.thumbnailWrapper,i.isCloud&&P.thumbnailCloud,i.isRemote&&P.thumbnailRemote,"",""],children:r("svg",{css:P.fileIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),r("span",{css:P.name,title:i.name,children:t2(i.name)}),b("div",{css:P.actionsCell,children:[b("button",{css:P.copyBtn,onClick:_,title:"Copy file path",children:[C&&r("span",{css:P.tooltip,children:"Copied!"}),r("svg",{css:P.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})]}),r("button",{css:P.openBtn,onClick:B=>{B.stopPropagation(),d()},children:"Open"})]})]})}),r("td",{css:[P.td,P.meta,"",""],children:w?b("div",{css:P.folderStats,children:[i.localCount!==void 0&&i.localCount>0&&b("span",{css:[P.folderStat,P.folderStatLocal,"",""],title:`${i.localCount} local`,children:[r("svg",{css:P.folderStatIconLocal,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),i.localCount]}),i.cloudCount!==void 0&&i.cloudCount>0&&b("span",{css:[P.folderStat,P.folderStatCloud,"",""],title:`${i.cloudCount} in cloud`,children:[r("svg",{css:P.folderStatIconCloud,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),i.cloudCount]}),i.remoteCount!==void 0&&i.remoteCount>0&&b("span",{css:[P.folderStat,P.folderStatRemote,"",""],title:`${i.remoteCount} remote`,children:[r("svg",{css:P.folderStatIconRemote,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})}),i.remoteCount]}),i.updateCount!==void 0&&i.updateCount>0&&b("span",{css:[P.folderStat,P.folderStatUpdate,"",""],title:`${i.updateCount} pending update${i.updateCount!==1?"s":""}`,children:[r("svg",{css:P.folderStatIconUpdate,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),i.updateCount]}),!i.localCount&&!i.cloudCount&&!i.remoteCount&&!i.updateCount&&i.fileCount!==void 0&&b("span",{children:[i.fileCount," files"]}),!i.localCount&&!i.cloudCount&&!i.remoteCount&&!i.updateCount&&i.fileCount===void 0&&"--"]}):i.hasUpdate?b("span",{css:P.updateLabel,children:[r("svg",{css:P.updateCloudIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),r("svg",{css:P.updateSyncIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"update"]}):i.cdnPushed?r("span",{css:P.storedLabel,children:r("svg",{css:i.isRemote?P.storedIconRemote:P.storedIconCloud,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.isRemote?r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}):r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})})}):i.size!==void 0?zp(i.size):"--"}),r("td",{css:[P.td,P.meta,"",""],children:w?i.totalSize!==void 0?zp(i.totalSize):"--":i.dimensions?`${i.dimensions.width}x${i.dimensions.height}`:"--"}),r("td",{css:P.td,children:i.cdnPushed?i.isRemote?r("span",{css:P.cdnBadgeRemote,children:"Remote"}):b("span",{css:P.cdnBadge,children:[r("svg",{css:P.cdnIcon,fill:"currentColor",viewBox:"0 0 20 20",children:r("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Pushed"]}):r("span",{css:P.cdnEmpty,children:"--"})})]})}function zp(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function t2(i,c=32){if(i.length<=c)return i;const f=i.lastIndexOf("."),d=f>0?i.substring(f):"",h=f>0?i.substring(0,f):i,p=c-d.length-3;if(p<6)return i.substring(0,c-3)+"...";const C=Math.ceil(p/2),D=Math.floor(p/2);return h.substring(0,C)+"..."+h.substring(h.length-D)+d}var n2=Object.defineProperty,a2=(i,c,f)=>c in i?n2(i,c,{enumerable:!0,configurable:!0,writable:!0,value:f}):i[c]=f,Rt=(i,c,f)=>a2(i,typeof c!="symbol"?c+"":c,f);const Ur={x:0,y:0,width:0,height:0,unit:"px"},ao=(i,c,f)=>Math.min(Math.max(i,c),f),l2=(...i)=>i.filter(c=>c&&typeof c=="string").join(" "),Mp=(i,c)=>i===c||i.width===c.width&&i.height===c.height&&i.x===c.x&&i.y===c.y&&i.unit===c.unit;function lo(i,c,f){return i.unit==="%"?{...Ur,...i,unit:"%"}:{unit:"%",x:i.x?i.x/c*100:0,y:i.y?i.y/f*100:0,width:i.width?i.width/c*100:0,height:i.height?i.height/f*100:0}}function $a(i,c,f){return i.unit?i.unit==="px"?{...Ur,...i,unit:"px"}:{unit:"px",x:i.x?i.x*c/100:0,y:i.y?i.y*f/100:0,width:i.width?i.width*c/100:0,height:i.height?i.height*f/100:0}:{...Ur,...i,unit:"px"}}function Dp(i,c,f,d,h,p=0,C=0,D=d,w=h){const y={...i};let T=Math.min(p,d),z=Math.min(C,h),_=Math.min(D,d),q=Math.min(w,h);c&&(c>1?(T=C?C*c:T,z=T/c,_=D*c):(z=p?p/c:z,T=z*c,q=w/c)),y.y<0&&(y.height=Math.max(y.height+y.y,z),y.y=0),y.x<0&&(y.width=Math.max(y.width+y.x,T),y.x=0);const B=d-(y.x+y.width);B<0&&(y.x=Math.min(y.x,d-T),y.width+=B);const G=h-(y.y+y.height);if(G<0&&(y.y=Math.min(y.y,h-z),y.height+=G),y.width<T&&((f==="sw"||f=="nw")&&(y.x-=T-y.width),y.width=T),y.height<z&&((f==="nw"||f=="ne")&&(y.y-=z-y.height),y.height=z),y.width>_&&((f==="sw"||f=="nw")&&(y.x-=_-y.width),y.width=_),y.height>q&&((f==="nw"||f=="ne")&&(y.y-=q-y.height),y.height=q),c){const ie=y.width/y.height;if(ie<c){const K=Math.max(y.width/c,z);(f==="nw"||f=="ne")&&(y.y-=K-y.height),y.height=K}else if(ie>c){const K=Math.max(y.height*c,T);(f==="sw"||f=="nw")&&(y.x-=K-y.width),y.width=K}}return y}function o2(i,c,f,d){const h={...i};return c==="ArrowLeft"?d==="nw"?(h.x-=f,h.y-=f,h.width+=f,h.height+=f):d==="w"?(h.x-=f,h.width+=f):d==="sw"?(h.x-=f,h.width+=f,h.height+=f):d==="ne"?(h.y+=f,h.width-=f,h.height-=f):d==="e"?h.width-=f:d==="se"&&(h.width-=f,h.height-=f):c==="ArrowRight"&&(d==="nw"?(h.x+=f,h.y+=f,h.width-=f,h.height-=f):d==="w"?(h.x+=f,h.width-=f):d==="sw"?(h.x+=f,h.width-=f,h.height-=f):d==="ne"?(h.y-=f,h.width+=f,h.height+=f):d==="e"?h.width+=f:d==="se"&&(h.width+=f,h.height+=f)),c==="ArrowUp"?d==="nw"?(h.x-=f,h.y-=f,h.width+=f,h.height+=f):d==="n"?(h.y-=f,h.height+=f):d==="ne"?(h.y-=f,h.width+=f,h.height+=f):d==="sw"?(h.x+=f,h.width-=f,h.height-=f):d==="s"?h.height-=f:d==="se"&&(h.width-=f,h.height-=f):c==="ArrowDown"&&(d==="nw"?(h.x+=f,h.y+=f,h.width-=f,h.height-=f):d==="n"?(h.y+=f,h.height-=f):d==="ne"?(h.y+=f,h.width-=f,h.height-=f):d==="sw"?(h.x-=f,h.width+=f,h.height+=f):d==="s"?h.height+=f:d==="se"&&(h.width+=f,h.height+=f)),h}const oo={capture:!0,passive:!1};let i2=0;const Wa=class Fn extends v.PureComponent{constructor(){super(...arguments),Rt(this,"docMoveBound",!1),Rt(this,"mouseDownOnCrop",!1),Rt(this,"dragStarted",!1),Rt(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),Rt(this,"componentRef",v.createRef()),Rt(this,"mediaRef",v.createRef()),Rt(this,"resizeObserver"),Rt(this,"initChangeCalled",!1),Rt(this,"instanceId",`rc-${i2++}`),Rt(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),Rt(this,"onCropPointerDown",c=>{const{crop:f,disabled:d}=this.props,h=this.getBox();if(!f)return;const p=$a(f,h.width,h.height);if(d)return;c.cancelable&&c.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const C=c.target.dataset.ord,D=!!C;let w=c.clientX,y=c.clientY,T=p.x,z=p.y;if(C){const _=c.clientX-h.x,q=c.clientY-h.y;let B=0,G=0;C==="ne"||C=="e"?(B=_-(p.x+p.width),G=q-p.y,T=p.x,z=p.y+p.height):C==="se"||C==="s"?(B=_-(p.x+p.width),G=q-(p.y+p.height),T=p.x,z=p.y):C==="sw"||C=="w"?(B=_-p.x,G=q-(p.y+p.height),T=p.x+p.width,z=p.y):(C==="nw"||C=="n")&&(B=_-p.x,G=q-p.y,T=p.x+p.width,z=p.y+p.height),w=T+h.x+B,y=z+h.y+G}this.evData={startClientX:w,startClientY:y,startCropX:T,startCropY:z,clientX:c.clientX,clientY:c.clientY,isResize:D,ord:C},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),Rt(this,"onComponentPointerDown",c=>{const{crop:f,disabled:d,locked:h,keepSelection:p,onChange:C}=this.props,D=this.getBox();if(d||h||p&&f)return;c.cancelable&&c.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const w=c.clientX-D.x,y=c.clientY-D.y,T={unit:"px",x:w,y,width:0,height:0};this.evData={startClientX:c.clientX,startClientY:c.clientY,startCropX:w,startCropY:y,clientX:c.clientX,clientY:c.clientY,isResize:!0},this.mouseDownOnCrop=!0,C($a(T,D.width,D.height),lo(T,D.width,D.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),Rt(this,"onDocPointerMove",c=>{const{crop:f,disabled:d,onChange:h,onDragStart:p}=this.props,C=this.getBox();if(d||!f||!this.mouseDownOnCrop)return;c.cancelable&&c.preventDefault(),this.dragStarted||(this.dragStarted=!0,p&&p(c));const{evData:D}=this;D.clientX=c.clientX,D.clientY=c.clientY;let w;D.isResize?w=this.resizeCrop():w=this.dragCrop(),Mp(f,w)||h($a(w,C.width,C.height),lo(w,C.width,C.height))}),Rt(this,"onComponentKeyDown",c=>{const{crop:f,disabled:d,onChange:h,onComplete:p}=this.props;if(d)return;const C=c.key;let D=!1;if(!f)return;const w=this.getBox(),y=this.makePixelCrop(w),T=(navigator.platform.match("Mac")?c.metaKey:c.ctrlKey)?Fn.nudgeStepLarge:c.shiftKey?Fn.nudgeStepMedium:Fn.nudgeStep;if(C==="ArrowLeft"?(y.x-=T,D=!0):C==="ArrowRight"?(y.x+=T,D=!0):C==="ArrowUp"?(y.y-=T,D=!0):C==="ArrowDown"&&(y.y+=T,D=!0),D){c.cancelable&&c.preventDefault(),y.x=ao(y.x,0,w.width-y.width),y.y=ao(y.y,0,w.height-y.height);const z=$a(y,w.width,w.height),_=lo(y,w.width,w.height);h(z,_),p&&p(z,_)}}),Rt(this,"onHandlerKeyDown",(c,f)=>{const{aspect:d=0,crop:h,disabled:p,minWidth:C=0,minHeight:D=0,maxWidth:w,maxHeight:y,onChange:T,onComplete:z}=this.props,_=this.getBox();if(p||!h)return;if(c.key==="ArrowUp"||c.key==="ArrowDown"||c.key==="ArrowLeft"||c.key==="ArrowRight")c.stopPropagation(),c.preventDefault();else return;const q=(navigator.platform.match("Mac")?c.metaKey:c.ctrlKey)?Fn.nudgeStepLarge:c.shiftKey?Fn.nudgeStepMedium:Fn.nudgeStep,B=$a(h,_.width,_.height),G=o2(B,c.key,q,f),ie=Dp(G,d,f,_.width,_.height,C,D,w,y);if(!Mp(h,ie)){const K=lo(ie,_.width,_.height);T(ie,K),z&&z(ie,K)}}),Rt(this,"onDocPointerDone",c=>{const{crop:f,disabled:d,onComplete:h,onDragEnd:p}=this.props,C=this.getBox();this.unbindDocMove(),!(d||!f)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,p&&p(c),h&&h($a(f,C.width,C.height),lo(f,C.width,C.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),Rt(this,"onDragFocus",()=>{var c;(c=this.componentRef.current)==null||c.scrollTo(0,0)})}get document(){return document}getBox(){const c=this.mediaRef.current;if(!c)return{x:0,y:0,width:0,height:0};const{x:f,y:d,width:h,height:p}=c.getBoundingClientRect();return{x:f,y:d,width:h,height:p}}componentDidUpdate(c){const{crop:f,onComplete:d}=this.props;if(d&&!c.crop&&f){const{width:h,height:p}=this.getBox();h&&p&&d($a(f,h,p),lo(f,h,p))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,oo),this.document.addEventListener("pointerup",this.onDocPointerDone,oo),this.document.addEventListener("pointercancel",this.onDocPointerDone,oo),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,oo),this.document.removeEventListener("pointerup",this.onDocPointerDone,oo),this.document.removeEventListener("pointercancel",this.onDocPointerDone,oo),this.docMoveBound=!1)}getCropStyle(){const{crop:c}=this.props;if(c)return{top:`${c.y}${c.unit}`,left:`${c.x}${c.unit}`,width:`${c.width}${c.unit}`,height:`${c.height}${c.unit}`}}dragCrop(){const{evData:c}=this,f=this.getBox(),d=this.makePixelCrop(f),h=c.clientX-c.startClientX,p=c.clientY-c.startClientY;return d.x=ao(c.startCropX+h,0,f.width-d.width),d.y=ao(c.startCropY+p,0,f.height-d.height),d}getPointRegion(c,f,d,h){const{evData:p}=this,C=p.clientX-c.x,D=p.clientY-c.y;let w;h&&f?w=f==="nw"||f==="n"||f==="ne":w=D<p.startCropY;let y;return d&&f?y=f==="nw"||f==="w"||f==="sw":y=C<p.startCropX,y?w?"nw":"sw":w?"ne":"se"}resolveMinDimensions(c,f,d=0,h=0){const p=Math.min(d,c.width),C=Math.min(h,c.height);return!f||!p&&!C?[p,C]:f>1?p?[p,p/f]:[C*f,C]:C?[C*f,C]:[p,p/f]}resizeCrop(){const{evData:c}=this,{aspect:f=0,maxWidth:d,maxHeight:h}=this.props,p=this.getBox(),[C,D]=this.resolveMinDimensions(p,f,this.props.minWidth,this.props.minHeight);let w=this.makePixelCrop(p);const y=this.getPointRegion(p,c.ord,C,D),T=c.ord||y;let z=c.clientX-c.startClientX,_=c.clientY-c.startClientY;(C&&T==="nw"||T==="w"||T==="sw")&&(z=Math.min(z,-C)),(D&&T==="nw"||T==="n"||T==="ne")&&(_=Math.min(_,-D));const q={unit:"px",x:0,y:0,width:0,height:0};y==="ne"?(q.x=c.startCropX,q.width=z,f?(q.height=q.width/f,q.y=c.startCropY-q.height):(q.height=Math.abs(_),q.y=c.startCropY-q.height)):y==="se"?(q.x=c.startCropX,q.y=c.startCropY,q.width=z,f?q.height=q.width/f:q.height=_):y==="sw"?(q.x=c.startCropX+z,q.y=c.startCropY,q.width=Math.abs(z),f?q.height=q.width/f:q.height=_):y==="nw"&&(q.x=c.startCropX+z,q.width=Math.abs(z),f?(q.height=q.width/f,q.y=c.startCropY-q.height):(q.height=Math.abs(_),q.y=c.startCropY+_));const B=Dp(q,f,y,p.width,p.height,C,D,d,h);return f||Fn.xyOrds.indexOf(T)>-1?w=B:Fn.xOrds.indexOf(T)>-1?(w.x=B.x,w.width=B.width):Fn.yOrds.indexOf(T)>-1&&(w.y=B.y,w.height=B.height),w.x=ao(w.x,0,p.width-w.width),w.y=ao(w.y,0,p.height-w.height),w}renderCropSelection(){const{ariaLabels:c=Fn.defaultProps.ariaLabels,disabled:f,locked:d,renderSelectionAddon:h,ruleOfThirds:p,crop:C}=this.props,D=this.getCropStyle();if(C)return ft.createElement("div",{style:D,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":c.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!f&&!d&&ft.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},ft.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),ft.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),ft.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),ft.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),ft.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":c.nwDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"nw"),role:"button"}),ft.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":c.nDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"n"),role:"button"}),ft.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":c.neDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"ne"),role:"button"}),ft.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":c.eDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"e"),role:"button"}),ft.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":c.seDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"se"),role:"button"}),ft.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":c.sDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"s"),role:"button"}),ft.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":c.swDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"sw"),role:"button"}),ft.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":c.wDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"w"),role:"button"})),h&&ft.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:w=>w.stopPropagation()},h(this.state)),p&&ft.createElement(ft.Fragment,null,ft.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),ft.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(c){const f={...Ur,...this.props.crop||{}};return $a(f,c.width,c.height)}render(){const{aspect:c,children:f,circularCrop:d,className:h,crop:p,disabled:C,locked:D,style:w,ruleOfThirds:y}=this.props,{cropIsActive:T,newCropIsBeingDrawn:z}=this.state,_=p?this.renderCropSelection():null,q=l2("ReactCrop",h,T&&"ReactCrop--active",C&&"ReactCrop--disabled",D&&"ReactCrop--locked",z&&"ReactCrop--new-crop",p&&c&&"ReactCrop--fixed-aspect",p&&d&&"ReactCrop--circular-crop",p&&y&&"ReactCrop--rule-of-thirds",!this.dragStarted&&p&&!p.width&&!p.height&&"ReactCrop--invisible-crop",d&&"ReactCrop--no-animate");return ft.createElement("div",{ref:this.componentRef,className:q,style:w},ft.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},f),p?ft.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},ft.createElement("defs",null,ft.createElement("mask",{id:`hole-${this.instanceId}`},ft.createElement("rect",{width:"100%",height:"100%",fill:"white"}),d?ft.createElement("ellipse",{cx:`${p.x+p.width/2}${p.unit}`,cy:`${p.y+p.height/2}${p.unit}`,rx:`${p.width/2}${p.unit}`,ry:`${p.height/2}${p.unit}`,fill:"black"}):ft.createElement("rect",{x:`${p.x}${p.unit}`,y:`${p.y}${p.unit}`,width:`${p.width}${p.unit}`,height:`${p.height}${p.unit}`,fill:"black"}))),ft.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,_)}};Rt(Wa,"xOrds",["e","w"]),Rt(Wa,"yOrds",["n","s"]),Rt(Wa,"xyOrds",["nw","ne","se","sw"]),Rt(Wa,"nudgeStep",1),Rt(Wa,"nudgeStepMedium",10),Rt(Wa,"nudgeStepLarge",100),Rt(Wa,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});let r2=Wa;const s2=Gt`
86
+ from { opacity: 0; }
87
+ to { opacity: 1; }
88
+ `,Ce={overlay:m("position:fixed;inset:0;z-index:10001;display:flex;background:transparent;animation:",s2," 0.15s ease-out;font-family:",Sl,";",""),container:m(Pa," display:flex;flex:1;margin:24px;background:",s.surface,";border:1px solid ",s.border,";border-radius:12px;overflow:hidden;box-shadow:0 20px 40px rgba(0, 0, 0, 0.2);",""),main:m("position:relative;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:",s.background,";overflow:hidden;.ReactCrop__crop-selection{border:2px solid ",s.primary,";}",""),headerButtons:{name:"8wfhwn",styles:"position:absolute;top:16px;right:16px;display:flex;gap:8px;z-index:10"},closeBtn:m("padding:8px;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),closeIcon:m("width:20px;height:20px;color:",s.textSecondary,";",""),rotationWrapper:{name:"1xwnw1d",styles:"transition:transform 0.3s ease;position:relative;cursor:pointer"},cropHint:m("position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);background:rgba(0, 0, 0, 0.7);color:white;padding:12px 20px;border-radius:8px;font-size:",N.sm,";pointer-events:none;white-space:nowrap;",""),successBanner:m("position:absolute;top:24px;left:50%;transform:translateX(-50%);background:#22c55e;color:#fff;padding:12px 24px;border-radius:8px;font-size:",N.sm,";font-weight:600;pointer-events:none;z-index:10;animation:fadeInOut 3s ease-in-out forwards;@keyframes fadeInOut{0%{opacity:0;transform:translateX(-50%) scale(0.9);}10%{opacity:1;transform:translateX(-50%) scale(1);}90%{opacity:1;transform:translateX(-50%) scale(1);}100%{opacity:0;transform:translateX(-50%) scale(0.9);}}",""),cropWrapper:{name:"12wysvm",styles:"max-width:100%;max-height:calc(100vh - 150px);img{max-width:100%;max-height:calc(100vh - 150px);display:block;}"},sidebar:m("width:280px;background:",s.surface,";border-left:1px solid ",s.border,";display:flex;flex-direction:column;overflow:hidden;",""),sidebarHeader:m("padding:16px 20px;border-bottom:1px solid ",s.border,";",""),sidebarTitle:m("font-size:",N.base,";font-weight:600;color:",s.text,";margin:0;",""),sidebarContent:{name:"1uv1qvv",styles:"flex:1;padding:20px;overflow:auto;display:flex;flex-direction:column;gap:20px"},section:{name:"1c3pogw",styles:"display:flex;flex-direction:column;gap:10px"},sectionLabel:m("font-size:",N.sm,";font-weight:600;color:",s.text,";",""),subSectionLabel:m("font-size:",N.xs,";font-weight:500;color:",s.textMuted,";text-transform:uppercase;letter-spacing:0.5px;",""),aspectButtons:{name:"13l5m7f",styles:"display:flex;gap:6px;flex-wrap:wrap"},aspectBtn:m("padding:6px 10px;font-size:",N.sm,";border:1px solid ",s.border,";background:",s.surface,";color:",s.text,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),aspectBtnActive:m("background-color:",s.primary,";border-color:",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primary,";border-color:",s.primary,";}",""),rotateButtons:{name:"11jf4ye",styles:"display:flex;gap:8px"},rotateBtn:m("flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:10px 12px;font-size:",N.sm,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:",s.text,";&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),rotateIcon:{name:"157xhr7",styles:"width:16px;height:16px"},rotatePreview:m("width:80px;height:80px;border:1px solid ",s.border,";border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:",s.background,";margin:8px auto;img{max-width:100%;max-height:100%;object-fit:contain;transition:transform 0.3s ease;}",""),resizeRow:{name:"1yydxi7",styles:"display:flex;align-items:center;gap:8px"},resizeInput:m("width:80px;min-width:0;padding:8px 6px;font-size:",N.sm,";border:1px solid ",s.border,";border-radius:6px;background:",s.surface,";color:",s.text,";text-align:center;&:focus{outline:none;border-color:",s.primary,";}&:disabled{opacity:0.5;cursor:not-allowed;background:",s.surfaceHover,";}&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}-moz-appearance:textfield;",""),resizeX:m("font-size:",N.sm,";color:",s.textMuted,";",""),qualitySlider:m("width:100%;height:6px;border-radius:3px;background:",s.border,";outline:none;cursor:pointer;&::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:",s.primary,";cursor:pointer;}&::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:",s.primary,";cursor:pointer;border:none;}",""),qualityRow:{name:"uh5xjc",styles:"display:flex;align-items:center;gap:12px"},qualityValue:m("min-width:40px;font-size:",N.sm,";color:",s.text,";text-align:right;",""),fileSize:m("font-size:",N.sm,";color:",s.textMuted,";padding:8px 0;",""),sidebarFooter:m("padding:16px 20px;border-top:1px solid ",s.border,";display:flex;flex-direction:column;gap:8px;",""),actionBtn:m("display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:12px 14px;font-size:",N.base,";font-weight:500;background:",s.primary,";border:1px solid ",s.primary,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),cancelBtn:m("display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:12px 14px;font-size:",N.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),spinner:{name:"1b4712p",styles:"width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin 0.75s linear infinite;@keyframes spin{to{transform:rotate(360deg);}}"},hint:m("font-size:",N.xs,";color:",s.textMuted,";font-style:italic;",""),clearBtn:m("margin-top:8px;padding:6px 12px;font-size:",N.xs,";color:",s.textSecondary,";background:transparent;border:1px solid ",s.border,";border-radius:4px;cursor:pointer;transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";color:",s.text,";}","")},c2=[{label:"Free",value:void 0},{label:"1:1",value:1},{label:"4:3",value:4/3},{label:"3:2",value:3/2},{label:"16:9",value:16/9},{label:"2:3",value:2/3},{label:"9:16",value:9/16}];function u2(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(2)} MB`}function d2({imagePath:i,imageSrc:c,dimensions:f,fileSize:d,onClose:h,onSaveComplete:p,triggerRefresh:C}){const D=v.useRef(null),[w,y]=v.useState(),[T,z]=v.useState(),[_,q]=v.useState(void 0),[B,G]=v.useState(f.width),[ie,K]=v.useState(f.height),[ue,Q]=v.useState(!1),[oe,X]=v.useState(!1),[ee,te]=v.useState({width:f.width,height:f.height}),[le,j]=v.useState(1),[W,pe]=v.useState(!1),[ye,me]=v.useState(0),[re,Be]=v.useState(!1),A=B!==ee.width||ie!==ee.height,[Z,I]=v.useState(0),[Ee,De]=v.useState(0),[x,O]=v.useState(!1),[ne,se]=v.useState(0),[ve,Te]=v.useState(null),[qe,lt]=v.useState(d),[_e,$t]=v.useState(95),[Je,ut]=v.useState(0),ht=Je!==0,Bt=J=>{const de=J.currentTarget,{naturalWidth:Ge,naturalHeight:Pe,width:H,height:ae}=de;te({width:Ge,height:Pe}),j(Ge/H),X(!0),G(Ge),K(Pe)},St=()=>{if(!oe||!D.current||W||A||ht)return;const J=D.current.width,de=D.current.height;if(pe(!0),_){const Ge=J/de;let Pe,H;_>Ge?(Pe=100,H=Ge/_*100):(H=100,Pe=_/Ge*100);const ae={unit:"%",x:(100-Pe)/2,y:(100-H)/2,width:Pe,height:H};y(ae);const Ae={unit:"px",x:Math.round(ae.x/100*J),y:Math.round(ae.y/100*de),width:Math.round(ae.width/100*J),height:Math.round(ae.height/100*de)};z(Ae)}else y({unit:"%",x:0,y:0,width:100,height:100}),z({unit:"px",x:0,y:0,width:J,height:de})},Dt=()=>{pe(!1),y(void 0),z(void 0)};v.useEffect(()=>{if(T&&oe&&le>0){const J=Math.round(T.width*le),de=Math.round(T.height*le);I(J),De(de)}else W||(I(0),De(0))},[T,oe,le,W]);const mt=()=>{ut(J=>(J+90)%360)},on=()=>{ut(J=>(J-90+360)%360)},Ut=()=>{ut(0)},Ie=()=>{re&&p({name:i.split("/").pop()||"",path:i,type:"file",dimensions:ee}),h()},Nt=J=>{if(q(J),!oe||!D.current)return;const de=D.current.width,Ge=D.current.height;if(J){const Pe=de/Ge;let H,ae;J>Pe?(H=100,ae=Pe/J*100):(ae=100,H=J/Pe*100);const Ae={unit:"%",x:(100-H)/2,y:(100-ae)/2,width:H,height:ae};y(Ae);const Xe={unit:"px",x:Math.round(Ae.x/100*de),y:Math.round(Ae.y/100*Ge),width:Math.round(Ae.width/100*de),height:Math.round(Ae.height/100*Ge)};z(Xe)}else y({unit:"%",x:0,y:0,width:100,height:100}),z({unit:"px",x:0,y:0,width:de,height:Ge})},wt=ee.width/ee.height,Re=J=>{if(W)return;const de=parseInt(J.target.value)||0;G(de),de>0&&K(Math.round(de/wt))},Tt=J=>{if(W)return;const de=parseInt(J.target.value)||0;K(de),de>0&&G(Math.round(de*wt))},dn=()=>{G(ee.width),K(ee.height)},xn=J=>{if(!T||!D.current)return;const de=parseInt(J.target.value)||0;if(de<=0)return;let Ge=Ee;_&&(Ge=Math.round(de/_));const Pe=de/le,H=Ge/le,ae={unit:"px",x:T.x,y:T.y,width:Pe,height:H},Ae=D.current.width-ae.x,Xe=D.current.height-ae.y;ae.width=Math.min(Pe,Ae),ae.height=Math.min(H,Xe),z(ae),y({unit:"px",x:ae.x,y:ae.y,width:ae.width,height:ae.height})},Sn=J=>{if(!T||!D.current)return;const de=parseInt(J.target.value)||0;if(de<=0)return;let Ge=Z;_&&(Ge=Math.round(de*_));const Pe=Ge/le,H=de/le,ae={unit:"px",x:T.x,y:T.y,width:Pe,height:H},Ae=D.current.width-ae.x,Xe=D.current.height-ae.y;ae.width=Math.min(Pe,Ae),ae.height=Math.min(H,Xe),z(ae),y({unit:"px",x:ae.x,y:ae.y,width:ae.width,height:ae.height})},fn=async()=>{if(oe){Q(!0);try{const J=T?{x:Math.round(T.x*le),y:Math.round(T.y*le),width:Math.round(T.width*le),height:Math.round(T.height*le)}:{x:0,y:0,width:ee.width,height:ee.height};let de=W?Z:A?B:ee.width,Ge=W?Ee:A?ie:ee.height;if(Je===90||Je===270){const ae=de;de=Ge,Ge=ae}const H=await(await fetch("/api/studio/edit-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imagePath:i,crop:J,rotation:Je,resize:{width:de,height:Ge},quality:_e})})).json();H.success?(C(),p(H.updatedItem),te({width:H.dimensions.width,height:H.dimensions.height}),G(H.dimensions.width),K(H.dimensions.height),H.updatedItem?.size&&lt(H.updatedItem.size),pe(!1),y(void 0),z(void 0),ut(0),Be(!0),me(Date.now()),se(ae=>ae+1),O(!0),setTimeout(()=>O(!1),3e3)):(console.error("Edit failed:",H.error),Te(H.error||"Failed to save image"))}catch(J){console.error("Edit error:",J),Te("An error occurred while saving the image")}finally{Q(!1)}}};return b("div",{css:Ce.overlay,children:[b("div",{css:Ce.container,children:[b("div",{css:Ce.main,children:[r("div",{css:Ce.headerButtons,children:r("button",{css:Ce.closeBtn,onClick:Ie,children:r("svg",{css:Ce.closeIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})}),b("div",{css:Ce.rotationWrapper,onClick:St,children:[r(r2,{crop:W?w:void 0,onChange:J=>y(J),onComplete:J=>z(J),aspect:_,css:Ce.cropWrapper,disabled:!W,children:r("img",{ref:D,src:ye?`${c}?v=${ye}`:c,alt:"Edit",onLoad:Bt,style:{cursor:W?"crosshair":"pointer"}})}),!W&&oe&&r("div",{css:Ce.cropHint,children:ht?"Save rotation first to enable crop":A?"Save resize first to enable crop":"Click to enable crop selection"}),x&&r("div",{css:Ce.successBanner,children:"Image updated"},ne)]})]}),b("div",{css:Ce.sidebar,children:[r("div",{css:Ce.sidebarHeader,children:r("h2",{css:Ce.sidebarTitle,children:"Edit Image"})}),b("div",{css:Ce.sidebarContent,children:[b("div",{css:Ce.section,children:[r("span",{css:Ce.sectionLabel,children:"Crop Selection"}),r("span",{css:Ce.subSectionLabel,children:"Aspect Ratio"}),r("div",{css:Ce.aspectButtons,children:c2.map(J=>r("button",{css:[Ce.aspectBtn,_===J.value&&Ce.aspectBtnActive,"",""],onClick:()=>Nt(J.value),disabled:A||ht,children:J.label},J.label))}),W&&b(tt,{children:[r("span",{css:Ce.subSectionLabel,children:"Selection Size"}),b("div",{css:Ce.resizeRow,children:[r("input",{type:"number",css:Ce.resizeInput,value:Z,onChange:xn,min:1}),r("span",{css:Ce.resizeX,children:"×"}),r("input",{type:"number",css:Ce.resizeInput,value:Ee,onChange:Sn,min:1}),r("span",{css:Ce.resizeX,children:"px"})]})]}),r("p",{css:Ce.hint,children:ht?"Save rotation first to enable crop":A?"Save resize first to enable crop":W?"Drag corners to resize crop area":"Click image to enable crop"}),W&&r("button",{css:Ce.clearBtn,onClick:Dt,children:"Clear Selection"})]}),b("div",{css:Ce.section,children:[r("span",{css:Ce.sectionLabel,children:"Rotation"}),r("div",{css:Ce.rotatePreview,children:r("img",{src:ye?`${c}?v=${ye}`:c,alt:"Rotation preview",style:{transform:`rotate(${Je}deg)`}})}),b("div",{css:Ce.rotateButtons,children:[b("button",{css:Ce.rotateBtn,onClick:on,disabled:ue||W||A,children:[r("svg",{css:Ce.rotateIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})}),"CCW"]}),b("button",{css:Ce.rotateBtn,onClick:mt,disabled:ue||W||A,children:[r("svg",{css:Ce.rotateIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10h-10a8 8 0 00-8 8v2M21 10l-6 6m6-6l-6-6"})}),"CW"]})]}),ht&&r("button",{css:Ce.clearBtn,onClick:Ut,children:"Reset Rotation"}),r("p",{css:Ce.hint,children:W||A?"Save other changes first to rotate":ht?"Click Save Changes to apply rotation":"Preview rotation before saving"})]}),b("div",{css:Ce.section,children:[r("span",{css:Ce.sectionLabel,children:"Resize Image"}),b("div",{css:Ce.resizeRow,children:[r("input",{type:"number",css:Ce.resizeInput,value:B,onChange:Re,min:1,disabled:W||ht}),r("span",{css:Ce.resizeX,children:"×"}),r("input",{type:"number",css:Ce.resizeInput,value:ie,onChange:Tt,min:1,disabled:W||ht}),r("span",{css:Ce.resizeX,children:"px"})]}),A&&!W&&!ht&&r("button",{css:Ce.clearBtn,onClick:dn,children:"Reset to Original"}),ht?r("p",{css:Ce.hint,children:"Save rotation first to resize"}):W?r("p",{css:Ce.hint,children:"Clear crop selection to resize"}):A?r("p",{css:Ce.hint,children:"Save to apply resize, then crop"}):r("p",{css:Ce.hint,children:"Maintains aspect ratio"})]}),b("div",{css:Ce.section,children:[r("span",{css:Ce.sectionLabel,children:"Quality"}),b("div",{css:Ce.qualityRow,children:[r("input",{type:"range",css:Ce.qualitySlider,min:1,max:100,value:_e,onChange:J=>$t(parseInt(J.target.value))}),b("span",{css:Ce.qualityValue,children:[_e,"%"]})]}),r("p",{css:Ce.hint,children:"Lower quality = smaller file size"})]}),b("div",{css:Ce.section,children:[r("span",{css:Ce.sectionLabel,children:"File Size"}),r("p",{css:Ce.fileSize,children:u2(qe)})]})]}),b("div",{css:Ce.sidebarFooter,children:[r("button",{css:Ce.actionBtn,onClick:fn,disabled:ue||!oe,children:ue?b(tt,{children:[r("span",{css:Ce.spinner}),"Saving..."]}):"Save Changes"}),r("button",{css:Ce.cancelBtn,onClick:Ie,disabled:ue,children:"Close"})]})]})]}),ve&&r(Yr,{title:"Error",message:ve,onClose:()=>Te(null)})]})}const f2=[".jpg",".jpeg",".png",".gif",".webp",".svg",".ico",".bmp",".tiff",".tif"],h2=[".mp4",".webm",".mov",".avi",".mkv",".m4v"];function p2(i){const c=i.toLowerCase().substring(i.lastIndexOf("."));return f2.includes(c)}function g2(i){const c=i.toLowerCase().substring(i.lastIndexOf("."));return h2.includes(c)}const he={overlay:{name:"1crgpqk",styles:"position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;display:flex;background:transparent"},container:m("display:flex;flex:1;margin:24px;background:",s.surface,";border:1px solid ",s.border,";border-radius:12px;overflow:hidden;box-shadow:0 20px 40px rgba(0, 0, 0, 0.2);",""),main:m("position:relative;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:",s.background,";overflow:auto;",""),headerButtons:{name:"8wfhwn",styles:"position:absolute;top:16px;right:16px;display:flex;gap:8px;z-index:10"},copyBtn:m("position:relative;padding:8px;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),copyIcon:m("width:20px;height:20px;color:",s.textSecondary,";",""),statusIcon:m("display:flex;align-items:center;justify-content:center;padding:8px;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);",""),cloudIcon:{name:"1byef48",styles:"width:22px;height:22px;color:#f59e0b;transform:translateY(1px)"},globeIcon:{name:"jso3j5",styles:"width:20px;height:20px;color:#ef4444"},tooltip:{name:"1w9prgf",styles:"position:absolute;right:100%;top:50%;transform:translateY(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-right:8px;pointer-events:none;z-index:100;&::after{content:'';position:absolute;left:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-left-color:#1a1f36;}"},mainCloseBtn:m("padding:8px;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),mainCloseIcon:m("width:20px;height:20px;color:",s.textSecondary,";",""),mediaWrapper:{name:"zr0bjt",styles:"max-width:100%;max-height:100%;display:flex;align-items:center;justify-content:center"},image:{name:"4gte4n",styles:"max-width:100%;max-height:calc(100vh - 200px);object-fit:contain;border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.1)"},video:{name:"1talud7",styles:"max-width:100%;max-height:calc(100vh - 200px);border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.1)"},filePlaceholder:m("display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px;background:",s.surface,";border-radius:12px;border:1px solid ",s.border,";",""),fileIcon:m("width:80px;height:80px;color:",s.textMuted,";margin-bottom:16px;",""),fileName:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0;",""),sidebar:m("width:280px;background:",s.surface,";border-left:1px solid ",s.border,";display:flex;flex-direction:column;overflow:hidden;",""),sidebarHeader:m("padding:16px 20px;border-bottom:1px solid ",s.border,";",""),sidebarTitle:m("font-size:",N.base,";font-weight:600;color:",s.text,";margin:0;",""),sidebarContent:{name:"esl95u",styles:"flex:1;padding:20px;overflow:auto"},info:{name:"bh1r16",styles:"display:flex;flex-direction:column;gap:12px;margin-bottom:24px"},infoRow:m("display:flex;justify-content:space-between;font-size:",N.sm,";",""),infoLabel:m("color:",s.textSecondary,";",""),infoValue:m("color:",s.text,";font-weight:500;text-align:right;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",""),infoValueWrap:m("color:",s.text,";font-weight:500;text-align:right;max-width:160px;word-break:break-all;white-space:normal;",""),infoLink:m("color:",s.primary,";font-weight:500;text-align:right;max-width:160px;word-break:break-all;white-space:normal;text-decoration:none;&:hover{text-decoration:underline;}",""),thumbChips:{name:"1w7hks3",styles:"display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end"},thumbChip:m("font-size:10px;font-weight:600;padding:2px 6px;border-radius:4px;background:",s.primary,";color:white;",""),actions:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"},actionBtn:m("display:flex;align-items:center;gap:10px;width:100%;padding:12px 14px;font-size:",N.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:",s.text,";text-align:left;&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),actionBtnDanger:m("color:",s.danger,";&:hover:not(:disabled){background-color:",s.dangerLight,";border-color:",s.danger,";}",""),actionBtnCloud:{name:"1lzbs29",styles:"color:#f59e0b;&:hover:not(:disabled){background-color:rgba(245, 158, 11, 0.1);border-color:#f59e0b;}"},actionIcon:{name:"a4lfw4",styles:"width:16px;height:16px;flex-shrink:0"}};function m2(){const{focusedItem:i,setFocusedItem:c,triggerRefresh:f,fileItems:d,setEditedImageKey:h,requestDelete:p,requestMove:C,requestSync:D,requestDownload:w,requestProcess:y,setProcessMode:T,actionState:z}=co(),[_,q]=v.useState(!1),[B,G]=v.useState(!1),[ie,K]=v.useState({current:0,total:1,percent:0,status:"processing",message:"Renaming..."}),[ue,Q]=v.useState(!1),[oe,X]=v.useState(null),[ee,te]=v.useState(!1),[le,j]=v.useState(!1),[W,pe]=v.useState({current:0,total:3,percent:0,status:"processing",message:"Generating favicons..."}),[ye,me]=v.useState(!1),[re,Be]=v.useState(0),A=z.showProgress,Z=i?i.name.toLowerCase()==="favicon.png"||i.name.toLowerCase()==="favicon.jpg":!1,I=i&&!i.isProtected&&/\.(jpg|jpeg|png|webp|gif)$/i.test(i.name)&&(!i.isCloud||i.hasUpdate),Ee=ut=>{c(ut),Be(Date.now()),h(ut.path)};if(!i)return null;const De=p2(i.name),x=g2(i.name),O="/"+i.path.replace(/^public\//,""),ne=i.cdnPushed&&i.cdnBaseUrl?`${i.cdnBaseUrl}${O}`:O,se=re?`${ne}?v=${re}`:ne,ve=typeof window<"u"?window.location.origin:"",Te=i.cdnPushed&&i.cdnBaseUrl?`${i.cdnBaseUrl}${O}`:`${ve}${O}`,qe=()=>{c(null)},lt=()=>{navigator.clipboard.writeText(Te),te(!0),setTimeout(()=>te(!1),1500)},_e=async ut=>{if(ut&&ut!==i.name){q(!1),G(!0),K({current:0,total:1,percent:0,status:"processing",message:"Renaming file..."});try{const ht=await fetch("/api/studio/rename-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:i.path,newName:ut})});if(!ht.body)throw new Error("No response body");const Bt=ht.body.getReader(),St=new TextDecoder;let Dt="",mt="";for(;;){const{done:on,value:Ut}=await Bt.read();if(on)break;Dt+=St.decode(Ut,{stream:!0});const Ie=Dt.split(`
89
+ `);Dt=Ie.pop()||"";for(const Nt of Ie){if(!Nt.startsWith("data: "))continue;const wt=JSON.parse(Nt.slice(6));wt.type==="start"?K({current:0,total:wt.total,percent:0,status:"processing",message:wt.message}):wt.type==="progress"?K({current:wt.current,total:wt.total,percent:Math.round(wt.current/wt.total*100),status:"processing",message:wt.message}):wt.type==="complete"?(mt=wt.newPath,K({current:wt.renamed,total:wt.renamed,percent:100,status:"complete",message:"Renamed successfully"})):wt.type==="error"&&(K(Re=>({...Re,status:"error",message:wt.message})),X({title:"Rename Failed",message:wt.message}))}}mt&&(c({...i,path:mt,name:mt.split("/").pop()||ut}),f())}catch(ht){console.error("Rename error:",ht),K(Bt=>({...Bt,status:"error",message:"Failed to rename"})),X({title:"Rename Failed",message:"An error occurred while renaming the file"})}}},$t=async()=>{if(i){j(!0),pe({current:0,total:3,percent:0,status:"processing",message:"Generating favicons..."});try{const ut=await fetch("/api/studio/generate-favicon",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imagePath:"/"+i.path.replace(/^public\//,"")})});if(!ut.ok){const St=await ut.json();pe({current:0,total:3,percent:0,status:"error",message:St.error||"Failed to generate favicons"});return}const ht=ut.body?.getReader(),Bt=new TextDecoder;if(ht){let St="";for(;;){const{done:Dt,value:mt}=await ht.read();if(Dt)break;St+=Bt.decode(mt,{stream:!0});const on=St.split(`
90
+ `);St=on.pop()||"";for(const Ut of on)if(Ut.startsWith("data: "))try{const Ie=JSON.parse(Ut.slice(6));Ie.type==="start"?pe(Nt=>({...Nt,total:Ie.total})):Ie.type==="progress"?pe({current:Ie.current,total:Ie.total,percent:Ie.percent,status:"processing",message:Ie.message}):Ie.type==="complete"?pe({current:Ie.processed,total:Ie.processed,percent:100,status:Ie.errors>0?"error":"complete",message:Ie.message}):Ie.type==="error"&&pe(Nt=>({...Nt,status:"error",message:Ie.message}))}catch{}}}}catch(ut){console.error("Favicon generation error:",ut),pe({current:0,total:3,percent:0,status:"error",message:"An error occurred while generating favicons"})}}},Je=()=>De?r("img",{css:he.image,src:se,alt:i.name}):x?r("video",{css:he.video,src:se,controls:!0}):b("div",{css:he.filePlaceholder,children:[r("svg",{css:he.fileIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),r("p",{css:he.fileName,children:i.name})]});return b(tt,{children:[oe&&r(Yr,{title:oe.title,message:oe.message,onClose:()=>X(null)}),r(Fp,{isOpen:ue,onClose:()=>Q(!1)}),_&&r(xl,{title:"Rename File",message:"Enter a new name for the file:",defaultValue:i.name,placeholder:"Enter new filename",confirmLabel:"Rename",onConfirm:_e,onCancel:()=>q(!1)}),B&&r(Ia,{title:"Renaming",progress:ie,onClose:()=>{G(!1),f()}}),le&&r(Ia,{title:"Generating Favicons",progress:W,onClose:()=>j(!1)}),r("div",{css:he.overlay,onClick:qe,children:b("div",{css:he.container,onClick:ut=>ut.stopPropagation(),children:[b("div",{css:he.main,children:[b("div",{css:he.headerButtons,children:[i.cdnPushed&&!i.isRemote&&r("span",{css:he.statusIcon,title:"Pushed to CDN",children:r("svg",{css:he.cloudIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})})}),i.isRemote&&r("span",{css:he.statusIcon,title:"Remote image",children:r("svg",{css:he.globeIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})})}),b("button",{css:he.copyBtn,onClick:lt,title:"Copy file path",children:[ee&&r("span",{css:he.tooltip,children:"Copied!"}),r("svg",{css:he.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})]}),r("button",{css:he.mainCloseBtn,onClick:qe,"aria-label":"Close",children:r("svg",{css:he.mainCloseIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),r("div",{css:he.mediaWrapper,children:Je()})]}),b("div",{css:he.sidebar,children:[r("div",{css:he.sidebarHeader,children:r("h3",{css:he.sidebarTitle,children:"Details"})}),b("div",{css:he.sidebarContent,children:[b("div",{css:he.info,children:[b("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Name"}),r("span",{css:he.infoValueWrap,children:i.name})]}),b("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Path"}),r("span",{css:he.infoValueWrap,children:i.path.replace(/^public\//,"")})]}),i.size!==void 0&&b("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Size"}),r("span",{css:he.infoValue,children:y2(i.size)})]}),i.dimensions&&b("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Dimensions"}),b("span",{css:he.infoValue,children:[i.dimensions.width," × ",i.dimensions.height]})]}),(i.hasSm||i.hasMd||i.hasLg||i.hasFull)&&b("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Thumbnails"}),r("span",{css:he.infoValue,children:b("span",{css:he.thumbChips,children:[i.hasSm&&r("span",{css:he.thumbChip,children:"SM"}),i.hasMd&&r("span",{css:he.thumbChip,children:"MD"}),i.hasLg&&r("span",{css:he.thumbChip,children:"LG"}),i.hasFull&&r("span",{css:he.thumbChip,children:"FULL"})]})})]}),b("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"CDN Status"}),r("span",{css:he.infoValue,children:i.cdnPushed?i.isRemote?"Remote":"Pushed":"Local"})]}),b("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"URL"}),r("a",{href:Te,target:"_blank",rel:"noopener noreferrer",css:he.infoLink,title:Te,children:Te})]})]}),b("div",{css:he.actions,children:[b("button",{css:he.actionBtn,onClick:()=>q(!0),disabled:i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),"Rename"]}),De&&b("button",{css:he.actionBtn,onClick:()=>me(!0),disabled:A||!I,title:I?void 0:"Download image first to edit",children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14M14 8l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"})}),I?"Edit Image":"Download to Edit"]}),b("button",{css:he.actionBtn,onClick:()=>C([i.path]),disabled:A||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})}),"Move"]}),b("button",{css:[he.actionBtn,he.actionBtnCloud,"",""],onClick:()=>D([i.path],d),disabled:A||i.isProtected||i.cdnPushed&&!i.isRemote,title:i.cdnPushed&&!i.isRemote?"Already in R2":void 0,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),"Push to CDN"]}),b("button",{css:[he.actionBtn,he.actionBtnCloud,"",""],onClick:()=>w([i.path],d),disabled:A||!i.cdnPushed||i.isRemote,title:i.cdnPushed?i.isRemote?"Remote image":"Download from CDN to local":"Not on CDN",children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})}),"Download from CDN"]}),b("button",{css:he.actionBtn,onClick:()=>{T("generate"),y([i.path])},disabled:A||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Generate Thumbnails"]}),(i.hasSm||i.hasMd||i.hasLg||i.hasFull)&&b("button",{css:he.actionBtn,onClick:()=>{T("remove"),y([i.path])},disabled:A||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Remove Thumbnails"]}),Z&&b("button",{css:he.actionBtn,onClick:$t,disabled:le||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})}),"Generate Favicons"]}),b("button",{css:[he.actionBtn,he.actionBtnDanger,"",""],onClick:()=>p([i.path]),disabled:A||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete"]})]})]})]})]})}),ye&&i.dimensions&&r(d2,{imagePath:i.path,imageSrc:se,dimensions:i.dimensions,fileSize:i.size||0,onClose:()=>me(!1),onSaveComplete:Ee,triggerRefresh:f})]})}function y2(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}const vl={overlay:{name:"1u8n9cx",styles:"position:fixed;inset:0;background:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1100"},modal:m("background:",s.surface,";border-radius:12px;padding:24px;max-width:400px;width:90%;box-shadow:0 20px 40px rgba(0, 0, 0, 0.2);",""),header:{name:"c6eghz",styles:"display:flex;align-items:center;gap:12px;margin-bottom:12px"},icon:m("width:24px;height:24px;color:",s.danger,";flex-shrink:0;",""),title:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0;",""),message:m("font-size:",N.base,";color:",s.textSecondary,";margin:0 0 20px 0;line-height:1.5;",""),button:m("width:100%;padding:10px 16px;border-radius:6px;font-size:",N.base,";font-weight:500;border:none;background:",s.primary,";color:white;cursor:pointer;transition:background 0.15s ease;&:hover{background:",s.primaryHover,";}","")};function b2(){const{error:i,clearError:c}=co();return i?r("div",{css:vl.overlay,onClick:c,children:b("div",{css:vl.modal,onClick:f=>f.stopPropagation(),children:[b("div",{css:vl.header,children:[r("svg",{css:vl.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),r("h3",{css:vl.title,children:i.title})]}),r("p",{css:vl.message,children:i.message}),r("button",{css:vl.button,onClick:c,children:"OK"})]})}):null}const Tp={showProgress:!1,progressTitle:"",progressState:{current:0,total:0,percent:0,status:"processing"},showDeleteConfirm:!1,showMoveModal:!1,showSyncConfirm:!1,showProcessConfirm:!1,showDownloadConfirm:!1,actionPaths:[],syncImageCount:0,syncHasRemote:!1,syncHasLocal:!1,processMode:"generate",downloadImageCount:0,downloadTotalSelected:0};function v2({triggerRefresh:i,clearSelection:c,setFocusedItem:f,showError:d}){const[h,p]=v.useState(Tp),C=v.useCallback(le=>{p(j=>({...j,progressState:typeof le=="function"?le(j.progressState):{...j.progressState,...le}}))},[]),D=v.useCallback(le=>{p(j=>({...j,showProgress:le}))},[]),w=v.useCallback(le=>{p(j=>({...j,progressTitle:le}))},[]),y=Vp({setShowProgress:D,setProgressTitle:w,setProgressState:C,triggerRefresh:i}),T=v.useCallback(le=>{p(j=>({...j,actionPaths:le,showDeleteConfirm:!0}))},[]),z=v.useCallback(le=>{p(j=>({...j,actionPaths:le,showMoveModal:!0}))},[]),_=v.useCallback((le,j)=>{const W=le.map(me=>"/"+me.replace(/^public\//,""));let pe=!1,ye=!1;for(const me of le){const re=j.find(Be=>Be.path===me);re&&(re.isRemote?pe=!0:re.cdnPushed||(ye=!0))}p(me=>({...me,actionPaths:le,syncImageCount:W.length,syncHasRemote:pe,syncHasLocal:ye,showSyncConfirm:!0}))},[]),q=v.useCallback((le,j)=>{const W=[];for(const pe of le){const ye=j.find(me=>me.path===pe);ye&&ye.cdnPushed&&!ye.isRemote&&W.push(pe)}p(pe=>({...pe,actionPaths:W,downloadImageCount:W.length,downloadTotalSelected:le.length,showDownloadConfirm:!0}))},[]),B=v.useCallback(le=>{p(j=>({...j,actionPaths:le,showProcessConfirm:!0}))},[]),G=v.useCallback(le=>{p(j=>({...j,processMode:le}))},[]),ie=v.useCallback(()=>{p(le=>({...le,showDeleteConfirm:!1,showMoveModal:!1,showSyncConfirm:!1,showProcessConfirm:!1,showDownloadConfirm:!1}))},[]),K=v.useCallback(()=>{p(Tp)},[]),ue=v.useCallback(()=>{y.stop()},[y]),Q=v.useCallback(async()=>{const le=h.actionPaths;p(j=>({...j,showDeleteConfirm:!1}));try{const j=await fetch("/api/studio/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:le})});if(j.ok)c(),f(null),i();else{const W=await j.json();d("Delete Failed",W.error||"Unknown error")}}catch(j){console.error("Delete error:",j),d("Delete Failed","Delete failed. Check console for details.")}},[h.actionPaths,c,f,i,d]),oe=v.useCallback(async le=>{const j=h.actionPaths;p(W=>({...W,showMoveModal:!1})),await y.execute({endpoint:"/api/studio/move",body:{paths:j,destination:le},title:"Moving Files",onComplete:W=>{W.errors&&W.errors>0&&W.errorMessages?.length&&d("Move Failed",W.errorMessages.join(`
91
+ `)),c(),f(null)}})},[h.actionPaths,c,f,d,y]),X=v.useCallback(async()=>{const j=h.actionPaths.map(ye=>"/"+ye.replace(/^public\//,""));p(ye=>({...ye,showSyncConfirm:!1,showProgress:!0,progressTitle:"Pushing to CDN",progressState:{current:0,total:j.length,percent:0,status:"processing",message:"Pushing to CDN..."}}));let W=0;const pe=[];for(let ye=0;ye<j.length;ye++){const me=j[ye];try{const re=await fetch("/api/studio/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageKeys:[me]})});if(re.ok)W++;else{const Be=await re.json();pe.push(`${me}: ${Be.error||"Unknown error"}`)}}catch(re){pe.push(`${me}: ${re instanceof Error?re.message:"Unknown error"}`)}C({current:ye+1,total:j.length,percent:Math.round((ye+1)/j.length*100),status:"processing",message:`Pushed ${me}`})}C({current:j.length,total:j.length,percent:100,status:pe.length>0?"error":"complete",message:`Pushed ${W} file${W!==1?"s":""}${pe.length>0?`, ${pe.length} error${pe.length!==1?"s":""}`:""}`}),pe.length>0&&d("Push Errors",pe.join(`
92
+ `)),c(),i()},[h.actionPaths,c,i,d,C]),ee=v.useCallback(async()=>{const le=h.actionPaths,j=h.processMode,W=le.map(re=>{const Be=re.replace(/^public\//,"");return Be.startsWith("/")?Be:`/${Be}`}),pe=j==="remove",ye=pe?"/api/studio/unprocess-stream":"/api/studio/reprocess-stream",me=pe?"Removing Thumbnails":"Generating Thumbnails";p(re=>({...re,showProcessConfirm:!1})),await y.execute({endpoint:ye,body:{imageKeys:W},title:me})},[h.actionPaths,h.processMode,y]),te=v.useCallback(async()=>{const le=h.progressState.orphanedFiles;if(!(!le||le.length===0))try{const j=await fetch("/api/studio/delete-orphans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:le})});if(j.ok)C(W=>({...W,orphanedFiles:void 0,message:W.message?.replace(/Found \d+ orphaned thumbnail\(s\).*/,"Orphaned thumbnails deleted.")})),i();else{const W=await j.json();d("Delete Failed",W.error||"Failed to delete orphaned files")}}catch(j){console.error("Delete orphans error:",j),d("Delete Failed","Failed to delete orphaned files. Check console for details.")}},[h.progressState.orphanedFiles,i,d,C]);return{actionState:h,setActionState:p,requestDelete:T,requestMove:z,requestSync:_,requestDownload:q,requestProcess:B,setProcessMode:G,cancelAction:ie,closeProgress:K,stopProcessing:ue,confirmDelete:Q,confirmMove:oe,confirmSync:X,confirmProcess:ee,deleteOrphans:te}}const x2=Gt`
93
+ from { opacity: 0; }
94
+ to { opacity: 1; }
95
+ `,S2=Gt`
96
+ from {
97
+ opacity: 0;
98
+ transform: translateY(-8px) scale(0.98);
99
+ }
100
+ to {
101
+ opacity: 1;
102
+ transform: translateY(0) scale(1);
103
+ }
104
+ `,w2=Gt`
105
+ from { transform: rotate(0deg); }
106
+ to { transform: rotate(360deg); }
107
+ `,je={overlay:m("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",x2," 0.15s ease-out;font-family:",Sl,";",""),modal:m(Pa," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:480px;width:90%;max-height:90vh;overflow:hidden;animation:",S2," 0.2s ease-out;display:flex;flex-direction:column;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),body:{name:"amghpa",styles:"padding:16px 24px 24px;overflow-y:auto;flex:1"},section:{name:"za8dp",styles:"margin-bottom:20px;&:last-child{margin-bottom:0;}"},sectionLabel:m("font-size:",N.sm,";font-weight:600;color:",s.textSecondary,";margin:0 0 8px 0;text-transform:uppercase;letter-spacing:0.05em;",""),folderName:m("display:inline-flex;align-items:center;gap:8px;padding:8px 12px;background:",s.background,";border-radius:6px;font-size:",N.base,";font-weight:500;color:",s.text,";",""),folderIcon:{name:"8pinfb",styles:"width:18px;height:18px;color:#f9935e"},statusBadge:m("display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:6px;font-size:",N.sm,";margin-top:8px;",""),statusNeedsGen:{name:"1ozqf4e",styles:"background:#fef3c7;color:#92400e"},statusReady:{name:"6zd3sa",styles:"background:#d1fae5;color:#065f46"},fontList:{name:"dj9uva",styles:"display:flex;flex-wrap:wrap;gap:6px;margin-top:8px"},fontChip:m("display:inline-flex;align-items:center;padding:4px 10px;background:",s.background,";border-radius:4px;font-size:",N.sm,";color:",s.text,";",""),checkboxList:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"},checkboxLabel:m("display:flex;align-items:center;gap:10px;padding:10px 12px;background:",s.background,";border-radius:6px;cursor:pointer;transition:background 0.15s ease;&:hover{background:",s.surfaceHover,";}",""),checkbox:m("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;",""),checkboxText:m("font-size:",N.base,";color:",s.text,";flex:1;",""),addNewRow:{name:"ap5vte",styles:"display:flex;gap:8px;margin-top:12px"},addNewInput:m("flex:1;padding:10px 12px;font-size:",N.base,";border:1px solid ",s.border,";border-radius:6px;background:",s.surface,";color:",s.text,";&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 2px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),addNewBtn:m("padding:10px 16px;font-size:",N.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;color:",s.text,";transition:all 0.15s ease;&:hover:not(:disabled){background:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),emptyText:m("font-size:",N.sm,";color:",s.textMuted,";padding:8px 0;",""),errorText:m("font-size:",N.sm,";color:",s.danger,";margin-top:4px;",""),footer:m("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:m("padding:10px 18px;font-size:",N.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnCancel:m("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),btnConfirm:m("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),loading:{name:"uphaut",styles:"display:flex;align-items:center;justify-content:center;padding:40px"},loadingSpinner:m("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",w2," 0.8s linear infinite;","")};function C2({folderPath:i,onConfirm:c,onCancel:f}){const[d,h]=v.useState(!0),[p,C]=v.useState(null),[D,w]=v.useState([]),[y,T]=v.useState(new Set),[z,_]=v.useState(""),[q,B]=v.useState("");v.useEffect(()=>{async function Q(){try{const[oe,X]=await Promise.all([fetch("/api/studio/fonts/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:i})}),fetch("/api/studio/fonts/assignments")]);if(oe.ok){const ee=await oe.json();C(ee),T(new Set(ee.assignments||[]))}if(X.ok){const ee=await X.json();w(ee.assignments||[])}}catch(oe){console.error("Failed to load data:",oe)}finally{h(!1)}}Q()},[i]);const G=Q=>{T(oe=>{const X=new Set(oe);return X.has(Q)?X.delete(Q):X.add(Q),X})},ie=()=>{const Q=z.trim().toLowerCase();if(Q){if(!/^[a-z][a-z0-9]*$/.test(Q)){B("Name must start with a letter and contain only letters and numbers");return}T(oe=>new Set([...oe,Q])),_(""),B("")}},K=()=>{const Q=Array.from(y);Q.length!==0&&c(Q)};if(d)return r("div",{css:je.overlay,children:r("div",{css:je.modal,children:r("div",{css:je.loading,children:r("div",{css:je.loadingSpinner})})})});const ue=p&&p.ttfFiles.length===0&&p.woff2Files.length===0;return r("div",{css:je.overlay,onClick:f,children:b("div",{css:je.modal,onClick:Q=>Q.stopPropagation(),children:[r("div",{css:je.header,children:r("h3",{css:je.title,children:"Assign Web Font"})}),b("div",{css:je.body,children:[b("div",{css:je.section,children:[r("p",{css:je.sectionLabel,children:"Font Folder"}),b("div",{css:je.folderName,children:[r("svg",{css:je.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}),p?.folderName||i.split("/").pop()]}),p&&r("div",{css:[je.statusBadge,p.needsGeneration?je.statusNeedsGen:je.statusReady,"",""],children:p.needsGeneration?b(tt,{children:[r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"woff2 files will be generated (",p.ttfFiles.length," TTF files)"]}):b(tt,{children:[r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"woff2 files ready (",p.woff2Files.length," files)"]})})]}),p&&p.detectedFonts.length>0&&b("div",{css:je.section,children:[r("p",{css:je.sectionLabel,children:"Detected Fonts"}),r("div",{css:je.fontList,children:p.detectedFonts.map((Q,oe)=>b("span",{css:je.fontChip,children:[Q.weightName,Q.style==="italic"?" Italic":""]},oe))})]}),p&&p.needsGeneration&&b("div",{css:je.section,children:[r("p",{css:je.sectionLabel,children:"TTF Files to Convert"}),b("div",{css:je.fontList,children:[p.ttfFiles.slice(0,8).map((Q,oe)=>r("span",{css:je.fontChip,children:Q},oe)),p.ttfFiles.length>8&&b("span",{css:je.fontChip,children:["+",p.ttfFiles.length-8," more"]})]})]}),!ue&&b("div",{css:je.section,children:[r("p",{css:je.sectionLabel,children:"Assign To"}),D.length>0?r("div",{css:je.checkboxList,children:D.map(Q=>b("label",{css:je.checkboxLabel,children:[r("input",{type:"checkbox",css:je.checkbox,checked:y.has(Q.name),onChange:()=>G(Q.name)}),r("span",{css:je.checkboxText,children:Q.name})]},Q.name))}):r("p",{css:je.emptyText,children:"No existing font assignments"}),Array.from(y).filter(Q=>!D.find(oe=>oe.name===Q)).map(Q=>b("label",{css:[je.checkboxLabel,"margin-top:8px;",""],children:[r("input",{type:"checkbox",css:je.checkbox,checked:!0,onChange:()=>G(Q)}),b("span",{css:je.checkboxText,children:[Q," (new)"]})]},Q)),b("div",{css:je.addNewRow,children:[r("input",{type:"text",css:je.addNewInput,placeholder:"Add new assignment...",value:z,onChange:Q=>{_(Q.target.value),B("")},onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),ie())}}),r("button",{css:je.addNewBtn,onClick:ie,disabled:!z.trim(),children:"Add"})]}),q&&r("p",{css:je.errorText,children:q})]}),ue&&r("div",{css:je.section,children:r("p",{css:je.emptyText,children:"This folder does not contain any TTF or woff2 font files."})})]}),b("div",{css:je.footer,children:[r("button",{css:[je.btn,je.btnCancel,"",""],onClick:f,children:"Cancel"}),b("button",{css:[je.btn,je.btnConfirm,"",""],onClick:K,disabled:y.size===0||ue,children:["Assign Font",y.size>1?"s":""]})]})]})})}const k2=Gt`
108
+ from { opacity: 0; }
109
+ to { opacity: 1; }
110
+ `,z2=Gt`
111
+ from {
112
+ opacity: 0;
113
+ transform: translateY(-8px) scale(0.98);
114
+ }
115
+ to {
116
+ opacity: 1;
117
+ transform: translateY(0) scale(1);
118
+ }
119
+ `,M2=Gt`
120
+ from { transform: rotate(0deg); }
121
+ to { transform: rotate(360deg); }
122
+ `,Kt={overlay:m("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",k2," 0.15s ease-out;font-family:",Sl,";",""),modal:m(Pa," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:480px;width:90%;max-height:80vh;overflow:hidden;animation:",z2," 0.2s ease-out;display:flex;flex-direction:column;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),body:{name:"amghpa",styles:"padding:16px 24px 24px;overflow-y:auto;flex:1"},assignmentList:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"},assignmentRow:m("display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:",s.background,";border-radius:8px;border:1px solid ",s.border,";",""),assignmentInfo:{name:"nj7tus",styles:"display:flex;align-items:center;gap:8px;flex:1;min-width:0"},assignmentName:m("font-size:",N.base,";font-weight:500;color:",s.text,";",""),assignmentFolder:m("font-size:",N.sm,";color:",s.textMuted,";&::before{content:'→';margin-right:6px;color:",s.textMuted,";}",""),deleteBtn:m("padding:6px 12px;font-size:",N.sm,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:4px;cursor:pointer;color:",s.textSecondary,";transition:all 0.15s ease;&:hover{background:",s.dangerLight,";border-color:",s.danger,";color:",s.danger,";}",""),confirmRow:{name:"1yydxi7",styles:"display:flex;align-items:center;gap:8px"},confirmBtn:m("padding:6px 12px;font-size:",N.sm,";font-weight:500;background:",s.danger,";border:1px solid ",s.danger,";border-radius:4px;cursor:pointer;color:white;transition:all 0.15s ease;&:hover{background:",s.dangerHover,";border-color:",s.dangerHover,";}",""),cancelBtn:m("padding:6px 12px;font-size:",N.sm,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:4px;cursor:pointer;color:",s.textSecondary,";transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";border-color:",s.borderHover,";}",""),emptyText:m("font-size:",N.base,";color:",s.textMuted,";text-align:center;padding:32px 0;",""),footer:m("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:m("padding:10px 18px;font-size:",N.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnPrimary:m("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover{background-color:",s.primaryHover,";border-color:",s.primaryHover,";}",""),loading:{name:"uphaut",styles:"display:flex;align-items:center;justify-content:center;padding:40px"},loadingSpinner:m("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",M2," 0.8s linear infinite;","")};function D2({onClose:i,onRefresh:c}){const[f,d]=v.useState(!0),[h,p]=v.useState([]),[C,D]=v.useState(null),w=v.useCallback(async()=>{try{const _=await fetch("/api/studio/fonts/assignments");if(_.ok){const q=await _.json();p(q.assignments||[])}}catch(_){console.error("Failed to load assignments:",_)}finally{d(!1)}},[]);v.useEffect(()=>{w()},[w]);const y=_=>{D(_)},T=()=>{D(null)},z=async _=>{try{(await fetch("/api/studio/fonts/delete-assignment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:_})})).ok&&(p(B=>B.filter(G=>G.name!==_)),D(null),c?.())}catch(q){console.error("Failed to delete assignment:",q)}};return r("div",{css:Kt.overlay,onClick:i,children:b("div",{css:Kt.modal,onClick:_=>_.stopPropagation(),children:[r("div",{css:Kt.header,children:r("h3",{css:Kt.title,children:"Font Assignments"})}),r("div",{css:Kt.body,children:f?r("div",{css:Kt.loading,children:r("div",{css:Kt.loadingSpinner})}):h.length===0?b("p",{css:Kt.emptyText,children:["No font assignments yet.",r("br",{}),'Select a folder and click "Assign Web Font" to create one.']}):r("div",{css:Kt.assignmentList,children:h.map(_=>b("div",{css:Kt.assignmentRow,children:[b("div",{css:Kt.assignmentInfo,children:[r("span",{css:Kt.assignmentName,children:_.name}),r("span",{css:Kt.assignmentFolder,children:_.folder})]}),C===_.name?b("div",{css:Kt.confirmRow,children:[r("button",{css:Kt.confirmBtn,onClick:()=>z(_.name),children:"Delete?"}),r("button",{css:Kt.cancelBtn,onClick:T,children:"Cancel"})]}):r("button",{css:Kt.deleteBtn,onClick:()=>y(_.name),children:"Delete"})]},_.name))})}),r("div",{css:Kt.footer,children:r("button",{css:[Kt.btn,Kt.btnPrimary,"",""],onClick:i,children:"Done"})})]})})}const Ap="36px",Ep=Gt`
123
+ to { transform: rotate(360deg); }
124
+ `,$={container:{name:"xt6tct",styles:"flex:1;display:flex;flex-direction:column;overflow:hidden"},toolbar:m("display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;background-color:",s.surface,";border-bottom:1px solid ",s.border,";@media (min-width: 768px){padding:12px 24px;}",""),toolbarLeft:{name:"17nohj2",styles:"display:flex;flex-wrap:nowrap;flex-shrink:0;align-items:center;gap:8px"},toolbarRight:{name:"17nohj2",styles:"display:flex;flex-wrap:nowrap;flex-shrink:0;align-items:center;gap:8px"},btn:m("display:inline-flex;align-items:center;justify-content:center;gap:6px;height:",Ap,";padding:0 14px;border-radius:6px;font-size:",N.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";cursor:pointer;transition:all 0.15s ease;color:",s.text,";&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{cursor:not-allowed;opacity:0.5;}",""),btnPrimary:m("background:",s.primary,";border-color:",s.primary,";color:white;&:hover:not(:disabled){background:",s.primaryHover,";border-color:",s.primaryHover,";}",""),btnDanger:m("color:",s.danger,";&:hover:not(:disabled){background-color:",s.dangerLight,";border-color:",s.danger,";}",""),btnIcon:{name:"157xhr7",styles:"width:16px;height:16px"},content:{name:"1tznmxd",styles:"flex:1;overflow:auto;padding:20px 24px"},loading:{name:"1d2ui9i",styles:"display:flex;align-items:center;justify-content:center;flex:1;min-height:300px"},spinner:m("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",Ep," 0.8s linear infinite;",""),empty:m("display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-height:300px;color:",s.textSecondary,";",""),emptyIcon:{name:"1o3cbsn",styles:"width:48px;height:48px;margin-bottom:16px;opacity:0.5"},emptyText:m("font-size:",N.base,";margin:0 0 4px 0;&:last-child{color:",s.textMuted,";font-size:",N.sm,";}",""),selectAllRow:m("display:flex;align-items:center;margin-bottom:16px;padding:12px 16px;background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";",""),selectAllLabel:m("display:flex;align-items:center;gap:10px;font-size:",N.base,";font-weight:500;color:",s.textSecondary,";cursor:pointer;&:hover{color:",s.text,";}",""),selectAllCheckbox:m("width:16px;height:16px;accent-color:",s.primary,";",""),grid:{name:"el23hk",styles:"display:grid;grid-template-columns:1fr;gap:12px;@media (min-width: 480px){grid-template-columns:repeat(2, 1fr);}@media (min-width: 768px){grid-template-columns:repeat(3, 1fr);}@media (min-width: 1024px){grid-template-columns:repeat(4, 1fr);}@media (min-width: 1280px){grid-template-columns:repeat(5, 1fr);}"},item:m("position:relative;border-radius:8px;border:1px solid ",s.border,";overflow:hidden;cursor:pointer;transition:all 0.15s ease;background-color:",s.surface,";user-select:none;box-shadow:0 1px 2px rgba(0, 0, 0, 0.04);&:hover{border-color:#d0d5dd;box-shadow:0 2px 4px rgba(0, 0, 0, 0.06);}",""),itemSelected:m("border-color:",s.primary,";box-shadow:0 0 0 1px ",s.primary,";",""),checkboxWrapper:{name:"v3lnpt",styles:"position:absolute;top:0;left:0;z-index:10;padding:8px;cursor:pointer"},checkbox:m("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;",""),itemContent:m("position:relative;aspect-ratio:1;display:flex;align-items:center;justify-content:center;padding:16px;background:",s.background,";",""),folderIcon:{name:"k1w47f",styles:"width:56px;height:56px;color:#f9935e"},parentIcon:m("width:56px;height:56px;color:",s.textMuted,";",""),fileIcon:m("width:40px;height:40px;color:",s.textMuted,";",""),openBtn:m("position:absolute;bottom:8px;right:8px;z-index:10;height:28px;font-size:",N.sm,";font-weight:500;color:",s.primary,";background:",s.surface,";border:1px solid ",s.border,";padding:0 8px;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:flex;align-items:center;box-shadow:0 1px 2px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";}",""),label:m("padding:10px 12px;background-color:",s.surface,";border-top:1px solid ",s.borderLight,";",""),labelName:m("font-size:",N.sm,";font-weight:500;color:",s.text,";margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",""),labelMeta:m("font-size:",N.xs,";color:",s.textMuted,";margin:2px 0 0 0;",""),dropOverlay:m("position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(99, 91, 255, 0.1);border:3px dashed ",s.primary,";border-radius:8px;display:flex;align-items:center;justify-content:center;z-index:50;pointer-events:none;",""),dropMessage:m("display:flex;flex-direction:column;align-items:center;gap:12px;color:",s.primary,";font-size:",N.lg,";font-weight:600;",""),dropIcon:{name:"18jhpep",styles:"width:48px;height:48px"},createBtn:m("margin-top:16px;padding:10px 24px;font-size:",N.base,";font-weight:500;background:",s.primary,";color:white;border:none;border-radius:8px;cursor:pointer;transition:background 0.15s ease;&:hover{background:",s.primaryHover,";}",""),viewToggle:m("display:flex;align-items:center;height:",Ap,";background-color:",s.surface,";border:1px solid ",s.border,";border-radius:6px;overflow:hidden;",""),viewBtn:m("height:100%;padding:0 10px;background:transparent;border:none;cursor:pointer;color:",s.textSecondary,";transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{color:",s.text,";background-color:",s.surfaceHover,";}",""),viewBtnActive:m("background-color:",s.primaryLight,";color:",s.primary,";&:hover{background-color:",s.primaryLight,";color:",s.primary,";}",""),iconSpin:m("animation:",Ep," 1s linear infinite;",""),tableWrapper:m("background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";overflow-x:auto;",""),table:{name:"1ceqwkv",styles:"width:100%;min-width:400px;border-collapse:collapse;white-space:nowrap"},th:m("text-align:left;font-size:11px;color:",s.textMuted,";text-transform:uppercase;letter-spacing:0.05em;padding:12px 16px;font-weight:600;background:",s.background,";border-bottom:1px solid ",s.border,";",""),thCheckbox:{name:"5iz1wr",styles:"width:48px"},thSize:{name:"yct5co",styles:"width:96px"},row:m("cursor:pointer;transition:background-color 0.15s ease;user-select:none;&:hover{background-color:",s.surfaceHover,";}&:not(:last-child) td{border-bottom:1px solid ",s.borderLight,";}",""),rowSelected:m("background-color:",s.primaryLight,";&:hover{background-color:",s.primaryLight,";}",""),parentRow:m("cursor:pointer;border-bottom:1px solid ",s.border,";&:hover{background-color:",s.surfaceHover,";}",""),td:{name:"i563hg",styles:"padding:12px 16px"},checkboxCell:{name:"sahq4q",styles:"padding:12px 16px;cursor:pointer;vertical-align:middle"},nameCell:{name:"9s3nhy",styles:"display:flex;align-items:center;gap:12px;flex:1"},folderIconWrapper:{name:"xfecxx",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0"},folderIconSmall:{name:"a45yt2",styles:"width:24px;height:24px;color:#f9935e"},fileIconWrapper:{name:"xfecxx",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0"},fileIconSmall:m("width:20px;height:20px;color:",s.textMuted,";",""),parentIconSmall:m("width:20px;height:20px;color:",s.textMuted,";flex-shrink:0;",""),name:m("font-size:",N.base,";font-weight:500;color:",s.text,";letter-spacing:-0.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:300px;",""),meta:m("font-size:",N.sm,";color:",s.textSecondary,";",""),actionsCell:{name:"1w56d5c",styles:"display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto;flex-shrink:0"},listOpenBtn:m("height:32px;font-size:",N.sm,";font-weight:500;color:",s.primary,";background:",s.surface,";border:1px solid ",s.border,";padding:0 14px;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:inline-flex;align-items:center;&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";}",""),badge:{name:"1ue8xbs",styles:"width:8px;height:8px;border-radius:50%;flex-shrink:0"},badgeGray:{name:"a0o945",styles:"background-color:#9ca3af"},badgeBlue:{name:"1pt39vn",styles:"background-color:#3b82f6"},badgeGreen:{name:"b752gh",styles:"background-color:#10b981"},badgeWrapper:{name:"1pi78hi",styles:"display:flex;align-items:center;gap:6px"}};function Rp(i){return i<1024?i+" B":i<1024*1024?(i/1024).toFixed(1)+" KB":(i/(1024*1024)).toFixed(1)+" MB"}function T2({currentPath:i,setCurrentPath:c,refreshKey:f,triggerRefresh:d}){const[h,p]=v.useState([]),[C,D]=v.useState(!0),[w,y]=v.useState(new Set),[T,z]=v.useState(!1),[_,q]=v.useState(!1),[B,G]=v.useState(!1),[ie,K]=v.useState(!1),[ue,Q]=v.useState(!1),[oe,X]=v.useState(!1),[ee,te]=v.useState("grid"),[le,j]=v.useState(!1),[W,pe]=v.useState(!1),[ye,me]=v.useState(!1),[re,Be]=v.useState(!1),[A,Z]=v.useState({status:"idle",current:0,total:0,percent:0}),[I,Ee]=v.useState(null),[De,x]=v.useState({}),O=v.useCallback(async()=>{try{D(!0);const H=await fetch(`/api/studio/fonts/list?path=${encodeURIComponent(i)}`);if(H.ok){const ae=await H.json();p(ae.items||[]),z(ae.canCreate===!0)}}catch(H){console.error("Failed to fetch fonts:",H),p([])}finally{D(!1)}},[i]);v.useEffect(()=>{O(),y(new Set)},[O,f]);const ne=v.useCallback(async H=>{const ae={};for(const Ae of H)if(Ae.type==="folder")try{const Xe=await fetch("/api/studio/fonts/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:Ae.path})});if(Xe.ok){const Wt=await Xe.json();ae[Ae.path]={needsGeneration:Wt.needsGeneration,hasWoff2:Wt.woff2Files?.length>0,assignments:Wt.assignments||[]}}}catch{}x(ae)},[]);v.useEffect(()=>{const H=h.filter(ae=>ae.type==="folder");H.length>0&&i.startsWith("_fonts")&&ne(H)},[h,i,ne]);const se=i==="_fonts";i==="src"||i.startsWith("src/");const ve=v.useCallback((H,ae)=>{ae.stopPropagation(),y(Ae=>{const Xe=new Set(Ae);return Xe.has(H.path)?Xe.delete(H.path):Xe.add(H.path),Xe})},[]),Te=v.useCallback(H=>{H.type==="folder"&&(c(H.path),y(new Set))},[c]),qe=v.useCallback(()=>{const H=i.split("/");H.pop();const ae=H.join("/")||"_fonts";c(ae),y(new Set)},[i,c]),lt=h.length>0&&w.size===h.length,_e=w.size>0,$t=v.useCallback(()=>{y(lt?new Set:new Set(h.map(H=>H.path)))},[lt,h]),Je=v.useCallback(async()=>{j(!0),await O(),j(!1)},[O]),ut=v.useCallback(()=>{Dt&&pe(!0)},[Dt]),ht=v.useCallback(async H=>{pe(!1),Be(!0),Z({status:"progress",current:0,total:1,percent:0,message:"Starting..."});try{const ae=await fetch("/api/studio/fonts/assign-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:mt,assignments:H})});if(!ae.ok||!ae.body){Z({status:"error",current:0,total:0,percent:0,message:"Failed to start assignment"});return}const Ae=ae.body.getReader(),Xe=new TextDecoder;for(;;){const{done:Wt,value:Yn}=await Ae.read();if(Wt)break;const Ca=Xe.decode(Yn,{stream:!0}).split(`
125
+ `);for(const ta of Ca)if(ta.startsWith("data: "))try{const Lt=JSON.parse(ta.slice(6));Lt.status==="progress"?Z({status:"progress",current:Lt.current||0,total:Lt.total||1,percent:Lt.total?Math.round(Lt.current/Lt.total*100):0,message:Lt.message,currentFile:Lt.currentFile}):Lt.status==="complete"?(Z({status:"complete",current:Lt.created?.length||0,total:Lt.created?.length||0,percent:100,message:Lt.message,processed:Lt.created?.length||0}),d()):Lt.status==="error"&&Z({status:"error",current:0,total:0,percent:0,message:Lt.message})}catch{}}}catch(ae){Z({status:"error",current:0,total:0,percent:0,message:String(ae)})}},[mt,d]),Bt=v.useCallback(()=>{Be(!1),Z({status:"idle",current:0,total:0,percent:0})},[]),St=Array.from(w),Dt=St.length===1&&h.find(H=>H.path===St[0])?.type==="folder",mt=Dt?St[0]:null,on=mt&&mt.split("/").pop()||"",Ut=St.length===1&&h.find(H=>H.path===St[0])?.type==="file",Ie=Ut?St[0]:null,Nt=Ie&&Ie.split("/").pop()||"",wt=v.useCallback(async H=>{if(mt){G(!1);try{(await fetch("/api/studio/fonts/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:mt,newName:H})})).ok&&(y(new Set),d())}catch(ae){console.error("Rename failed:",ae)}}},[mt,d]),Re=v.useCallback(async H=>{if(Ie){K(!1);try{(await fetch("/api/studio/fonts/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:Ie,newName:H})})).ok&&(y(new Set),d())}catch(ae){console.error("Rename file failed:",ae)}}},[Ie,d]),Tt=v.useCallback(()=>{w.size!==0&&X(!0)},[w.size]),dn=v.useCallback(async()=>{X(!1);try{(await fetch("/api/studio/fonts/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:Array.from(w)})})).ok&&(y(new Set),d())}catch(H){console.error("Delete failed:",H)}},[w,d]),xn=v.useCallback(()=>{Q(!0)},[]),Sn=v.useCallback(async H=>{Q(!1);try{(await fetch("/api/studio/fonts/create-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i,name:H})})).ok&&d()}catch(ae){console.error("Create folder failed:",ae)}},[i,d]),fn=v.useCallback(H=>{H.preventDefault(),H.stopPropagation(),i.startsWith("_fonts")&&q(!0)},[i]),J=v.useCallback(H=>{H.preventDefault(),H.stopPropagation(),q(!1)},[]),de=v.useCallback(async H=>{if(H.preventDefault(),H.stopPropagation(),q(!1),!i.startsWith("_fonts"))return;const ae=Array.from(H.dataTransfer.files).filter(Ae=>Ae.name.toLowerCase().endsWith(".ttf"));if(ae.length!==0){for(const Ae of ae){const Xe=new FormData;Xe.append("file",Ae),Xe.append("path",i);try{await fetch("/api/studio/fonts/upload",{method:"POST",body:Xe})}catch(Wt){console.error("Upload failed:",Wt)}}d()}},[i,d]),Ge=v.useCallback(H=>{H&&H.addEventListener("change",async ae=>{const Ae=ae.target.files;if(!(!Ae||Ae.length===0)){for(const Xe of Array.from(Ae)){if(!Xe.name.toLowerCase().endsWith(".ttf"))continue;const Wt=new FormData;Wt.append("file",Xe),Wt.append("path",i);try{await fetch("/api/studio/fonts/upload",{method:"POST",body:Wt})}catch(Yn){console.error("Upload failed:",Yn)}}d(),H.value=""}})},[i,d]);if(C)return b("div",{css:$.container,children:[r("div",{css:$.toolbar}),r("div",{css:$.loading,children:r("div",{css:$.spinner})})]});const Pe=i.startsWith("_fonts");return b("div",{css:$.container,children:[b("div",{css:$.toolbar,children:[b("div",{css:$.toolbarLeft,children:[Pe&&b(tt,{children:[b("button",{css:[$.btn,$.btnPrimary,"",""],onClick:()=>document.getElementById("font-file-input")?.click(),children:[r(A2,{}),"Add New"]}),r("input",{id:"font-file-input",type:"file",accept:".ttf",multiple:!0,style:{display:"none"},ref:Ge})]}),b("button",{css:$.btn,onClick:()=>{Ut?K(!0):Dt?G(!0):xn()},children:[Ut||Dt?r(L2,{}):r(E2,{}),Ut?"Rename File":Dt?"Rename Folder":"New Folder"]}),b("button",{css:[$.btn,$.btnDanger,"",""],onClick:Tt,disabled:w.size===0,children:[r(R2,{}),"Delete"]}),b("button",{css:$.btn,onClick:ut,disabled:!Dt,title:Dt?"Assign web font":"Select a folder to assign",children:[r(j2,{}),"Assign Web Font"]})]}),b("div",{css:$.toolbarRight,children:[r("button",{css:$.btn,onClick:Je,title:"Refresh view",disabled:le,children:r(B2,{spinning:le})}),b("div",{css:$.viewToggle,children:[r("button",{css:[$.viewBtn,ee==="grid"&&$.viewBtnActive,"",""],onClick:()=>te("grid"),"aria-label":"Grid view",children:r(U2,{})}),r("button",{css:[$.viewBtn,ee==="list"&&$.viewBtnActive,"",""],onClick:()=>te("list"),"aria-label":"List view",children:r(N2,{})})]}),r("button",{css:$.btn,onClick:()=>me(!0),title:"Font assignments settings",children:r(q2,{})})]})]}),b("div",{css:$.content,onDragOver:fn,onDragLeave:J,onDrop:de,style:{position:"relative"},children:[_&&r("div",{css:$.dropOverlay,children:b("div",{css:$.dropMessage,children:[r(_2,{}),r("span",{children:"Drop TTF files to upload"})]})}),h.length===0&&!T?b("div",{css:$.empty,children:[r(ru,{css:$.emptyIcon}),r("p",{css:$.emptyText,children:"No files yet"}),r("p",{css:$.emptyText,children:Pe?'Drop TTF files here or click "Add New"':"This folder is empty"})]}):h.length===0&&T?b("div",{css:$.empty,children:[r(ru,{css:$.emptyIcon}),r("p",{css:$.emptyText,children:"Folder doesn't exist"}),r("button",{css:$.createBtn,onClick:xn,children:"Create Folder"})]}):ee==="grid"?b(tt,{children:[h.length>0&&r("div",{css:$.selectAllRow,children:b("label",{css:$.selectAllLabel,children:[r("input",{type:"checkbox",css:$.selectAllCheckbox,checked:lt,ref:H=>{H&&(H.indeterminate=_e&&!lt)},onChange:$t}),"Select all (",h.length,")"]})}),b("div",{css:$.grid,children:[!se&&b("div",{css:$.item,onClick:qe,onDoubleClick:qe,children:[r("div",{css:$.itemContent,children:r(O2,{})}),b("div",{css:$.label,children:[r("p",{css:$.labelName,children:".."}),r("p",{css:$.labelMeta,children:"Parent folder"})]})]}),h.map(H=>{const ae=w.has(H.path);return b("div",{css:[$.item,ae&&$.itemSelected,"",""],onClick:Ae=>ve(H,Ae),onDoubleClick:()=>Te(H),children:[r("div",{css:$.checkboxWrapper,onClick:Ae=>{Ae.stopPropagation(),ve(H,Ae)},children:r("input",{type:"checkbox",css:$.checkbox,checked:ae,onChange:()=>{}})}),b("div",{css:$.itemContent,children:[r("button",{css:$.openBtn,onClick:Ae=>{Ae.stopPropagation(),Te(H)},children:"Open"}),H.type==="folder"?r(ru,{}):r(H2,{})]}),b("div",{css:$.label,children:[r("p",{css:$.labelName,children:b("span",{css:$.badgeWrapper,children:[H.type==="folder"&&De[H.path]&&r("span",{css:[$.badge,De[H.path].assignments.length>0?$.badgeGreen:De[H.path].hasWoff2?$.badgeBlue:$.badgeGray,"",""],title:De[H.path].assignments.length>0?`Assigned to: ${De[H.path].assignments.join(", ")}`:De[H.path].hasWoff2?"woff2 ready":"TTF only"}),H.name]})}),r("p",{css:$.labelMeta,children:H.type==="folder"?`${H.fileCount||0} files`:H.size?Rp(H.size):""})]})]},H.path)})]})]}):r("div",{css:$.tableWrapper,children:b("table",{css:$.table,children:[r("thead",{children:b("tr",{children:[r("th",{css:[$.th,$.thCheckbox,"",""],children:h.length>0&&r("input",{type:"checkbox",css:$.checkbox,checked:lt,ref:H=>{H&&(H.indeterminate=_e&&!lt)},onChange:$t})}),r("th",{css:$.th,children:"Name"}),r("th",{css:[$.th,$.thSize,"",""],children:"Size"})]})}),b("tbody",{children:[!se&&b("tr",{css:$.parentRow,onClick:qe,children:[r("td",{css:$.td}),r("td",{css:$.td,children:b("div",{css:$.nameCell,children:[r("svg",{css:$.parentIconSmall,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})}),r("span",{css:$.name,children:".."})]})}),r("td",{css:[$.td,$.meta,"",""],children:"Parent folder"})]}),h.map(H=>{const ae=w.has(H.path);return b("tr",{css:[$.row,ae&&$.rowSelected,"",""],onClick:Ae=>ve(H,Ae),children:[r("td",{css:[$.td,$.checkboxCell,"",""],onClick:Ae=>Ae.stopPropagation(),children:r("input",{type:"checkbox",css:$.checkbox,checked:ae,onChange:()=>ve(H,{})})}),r("td",{css:$.td,children:b("div",{css:$.nameCell,children:[H.type==="folder"?r("div",{css:$.folderIconWrapper,children:r("svg",{css:$.folderIconSmall,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})})}):r("div",{css:$.fileIconWrapper,children:r("svg",{css:$.fileIconSmall,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),b("span",{css:$.badgeWrapper,children:[H.type==="folder"&&De[H.path]&&r("span",{css:[$.badge,De[H.path].assignments.length>0?$.badgeGreen:De[H.path].hasWoff2?$.badgeBlue:$.badgeGray,"",""],title:De[H.path].assignments.length>0?`Assigned to: ${De[H.path].assignments.join(", ")}`:De[H.path].hasWoff2?"woff2 ready":"TTF only"}),r("span",{css:$.name,title:H.name,children:H.name})]}),r("div",{css:$.actionsCell,children:r("button",{css:$.listOpenBtn,onClick:Ae=>{Ae.stopPropagation(),Te(H)},children:"Open"})})]})}),r("td",{css:[$.td,$.meta,"",""],children:H.type==="folder"?`${H.fileCount||0} files`:H.size?Rp(H.size):"--"})]},H.path)})]})]})})]}),ue&&r(xl,{title:"New Folder",message:"Enter a name for the new folder:",placeholder:"Folder name",confirmLabel:"Create",onConfirm:Sn,onCancel:()=>Q(!1)}),B&&mt&&r(xl,{title:"Rename Folder",message:"Enter a new name for the folder:",placeholder:on,defaultValue:on,confirmLabel:"Rename",onConfirm:wt,onCancel:()=>G(!1)}),ie&&Ie&&r(xl,{title:"Rename File",message:"Enter a new name for the file:",placeholder:Nt,defaultValue:Nt,confirmLabel:"Rename",onConfirm:Re,onCancel:()=>K(!1)}),oe&&r(ro,{title:"Delete Items",message:`Are you sure you want to delete ${w.size} item${w.size!==1?"s":""}? This action cannot be undone.`,confirmLabel:"Delete",variant:"danger",onConfirm:dn,onCancel:()=>X(!1)}),W&&mt&&r(C2,{folderPath:mt,onConfirm:ht,onCancel:()=>pe(!1)}),re&&r(Ia,{title:"Assigning Web Font",progress:A,onClose:Bt}),ye&&r(D2,{onClose:()=>me(!1),onRefresh:d}),I&&r(Yr,{title:I.title,message:I.message,onClose:()=>Ee(null)})]})}function A2(){return r("svg",{css:$.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}function E2(){return r("svg",{css:$.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})})}function R2(){return r("svg",{css:$.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}function L2(){return r("svg",{css:$.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}function _2(){return r("svg",{css:$.dropIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}function ru(){return r("svg",{css:$.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})})}function O2(){return r("svg",{css:$.parentIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}function H2(){return r("svg",{css:$.fileIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})}function B2({spinning:i}){return r("svg",{css:[$.btnIcon,i&&$.iconSpin,"",""],fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function U2(){return r("svg",{css:$.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})}function N2(){return r("svg",{css:$.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}function j2(){return r("svg",{css:$.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})})}function q2(){return b("svg",{css:$.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}const Y2="36px",kt={container:m(Pa," display:flex;flex-direction:column;height:100%;background:",s.background,";",""),header:m("display:flex;align-items:center;justify-content:space-between;padding:12px 24px;background:",s.surface,";border-bottom:1px solid ",s.border,";position:relative;",""),titleDropdown:{name:"bjn8wh",styles:"position:relative"},titleButton:m("display:flex;align-items:center;gap:6px;font-size:19px!important;font-weight:600;color:",s.text,";background:transparent;border:none;padding:4px 8px;margin:-4px -8px;border-radius:6px;cursor:pointer;letter-spacing:-0.02em;transition:background 0.15s ease;&:hover{background:",s.surfaceHover,";}",""),titleChevron:m("width:18px;height:18px;color:",s.textSecondary,";transition:transform 0.15s ease;margin-top:2px;stroke-width:2.5;",""),titleChevronOpen:{name:"21xn5r",styles:"transform:rotate(180deg)"},dropdownMenu:m("position:absolute;top:calc(100% + 8px);left:0;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);padding:4px;z-index:100;",""),dropdownItem:m("display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;background:transparent;border:none;border-radius:6px;white-space:nowrap;position:relative;top:1px;font-size:19px!important;font-weight:600;letter-spacing:-0.02em;color:",s.text,";cursor:pointer;transition:all 0.15s ease;text-align:left;&:hover{background:",s.surfaceHover,";}",""),dropdownItemActive:m("&::after{content:'';display:inline-block;width:8px;height:8px;background:",s.primary,";border-radius:50%;position:relative;top:1px;}",""),headerLeft:{name:"16ur2v6",styles:"display:flex;align-items:center;gap:12px;flex:1;min-width:0"},headerCenter:{name:"1fsejhz",styles:"position:absolute;left:50%;transform:translateX(-50%);display:flex;align-items:center;max-width:50%"},breadcrumbs:m("display:flex;align-items:center;gap:6px;font-size:",N.base,";color:",s.textSecondary,";overflow:hidden;",""),breadcrumbSeparator:m("color:",s.border,";flex-shrink:0;",""),breadcrumbItem:m("color:",s.textSecondary,";text-decoration:none;cursor:pointer;transition:color 0.15s ease;white-space:nowrap;&:hover{color:",s.primary,";}",""),breadcrumbCurrent:m("color:",s.text,";font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;",""),headerIconBtn:m("display:flex;align-items:center;justify-content:center;width:32px;height:32px;color:",s.textMuted,";background:transparent;border:none;border-radius:6px;cursor:pointer;transition:all 0.15s ease;&:hover{color:",s.text,";background:",s.surface,";}",""),headerActions:{name:"1yydxi7",styles:"display:flex;align-items:center;gap:8px"},headerBtn:m("height:",Y2,";padding:0 12px;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),headerIcon:m("width:16px;height:16px;color:",s.textSecondary,";",""),content:{name:"1rtaly3",styles:"flex:1;display:flex;overflow:hidden"},fileBrowser:{name:"upomw9",styles:"flex:1;min-width:0;overflow:auto;padding:20px 24px;display:flex;flex-direction:column"},dropOverlay:m("position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(99, 91, 255, 0.1);border:3px dashed ",s.primary,";border-radius:8px;display:flex;align-items:center;justify-content:center;z-index:50;pointer-events:none;",""),dropMessage:m("display:flex;flex-direction:column;align-items:center;gap:12px;color:",s.primary,";font-size:",N.lg,";font-weight:600;",""),dropIcon:{name:"18jhpep",styles:"width:48px;height:48px"}};function G2({onClose:i,isVisible:c=!0,standaloneMode:f=!1,workspacePath:d,siteUrl:h}){const p=i||(()=>{}),[C,D]=v.useState("public"),[w,y]=v.useState(new Set),[T,z]=v.useState(null),[_,q]=v.useState("grid"),[B,G]=v.useState(null),[ie,K]=v.useState(null),[ue,Q]=v.useState(!1),[oe,X]=v.useState(0),[ee,te]=v.useState(!1),[le,j]=v.useState(""),[W,pe]=v.useState(null),[ye,me]=v.useState([]),[re,Be]=v.useState(!1),[A,Z]=v.useState(()=>{if(typeof window<"u"){const J=window.location.hash.slice(1);if(J==="fonts")return"fonts";if(J==="media")return"media"}return"media"}),[I,Ee]=v.useState(!1),De=v.useRef(null);v.useEffect(()=>{const J=()=>{const de=window.location.hash.slice(1);de==="fonts"?Z("fonts"):de==="media"&&Z("media")};return window.addEventListener("hashchange",J),()=>window.removeEventListener("hashchange",J)},[]);const[x,O]=v.useState("_fonts"),[ne,se]=v.useState(0),ve=v.useCallback(()=>{X(J=>J+1)},[]),[Te,qe]=v.useState(null),lt=v.useCallback(J=>{qe({path:J,key:Date.now()})},[]);v.useEffect(()=>{if(B&&ye.length>0){const J=ye.find(de=>de.path===B.path);J&&JSON.stringify(J)!==JSON.stringify(B)&&G(J)}},[ye,B]);const _e=v.useCallback(()=>{te(!0)},[]),$t=v.useCallback(()=>{te(!1)},[]),Je=v.useCallback((J,de)=>{pe({title:J,message:de})},[]),ut=v.useCallback(()=>{pe(null)},[]),ht=v.useCallback(J=>{J.preventDefault(),J.stopPropagation(),Be(!0)},[]),Bt=v.useCallback(J=>{J.preventDefault(),J.stopPropagation(),Be(!1)},[]),St=v.useCallback(async J=>{J.preventDefault(),J.stopPropagation(),Be(!1);const de=Array.from(J.dataTransfer.files);if(de.length!==0&&!(C==="public/images"||C.startsWith("public/images/"))){for(const Ge of de){const Pe=new FormData;Pe.append("file",Ge),Pe.append("path",C);try{await fetch("/api/studio/upload",{method:"POST",body:Pe})}catch(H){console.error("Upload error:",H)}}ve()}},[C,ve]),Dt=v.useCallback(()=>{if(C==="public")return;const J=C.split("/");J.pop(),D(J.join("/")||"public"),y(new Set)},[C]),mt=v.useCallback(J=>{D(J),y(new Set),G(null)},[]),on=v.useCallback(J=>{y(de=>{const Ge=new Set(de);return Ge.has(J)?Ge.delete(J):Ge.add(J),Ge}),z(J)},[]),Ut=v.useCallback((J,de,Ge)=>{const Pe=Ge.findIndex(Xe=>Xe.path===J),H=Ge.findIndex(Xe=>Xe.path===de);if(Pe===-1||H===-1)return;const ae=Math.min(Pe,H),Ae=Math.max(Pe,H);y(Xe=>{const Wt=new Set(Xe);for(let Yn=ae;Yn<=Ae;Yn++)Wt.add(Ge[Yn].path);return Wt}),z(de)},[]),Ie=v.useCallback(J=>{y(new Set(J.map(de=>de.path)))},[]),Nt=v.useCallback(()=>{y(new Set)},[]),wt=v.useCallback(J=>{G(J)},[]),Re=v2({triggerRefresh:ve,clearSelection:Nt,setFocusedItem:wt,showError:Je}),Tt=v.useCallback(J=>{if(J.key==="Escape"){const de=J.target;if(de.tagName==="INPUT"||de.tagName==="TEXTAREA")return;B?G(null):f||p()}},[p,B,f]);v.useEffect(()=>(c&&(document.addEventListener("keydown",Tt),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",Tt),document.body.style.overflow=""}),[Tt,c]),v.useEffect(()=>{const J=de=>{De.current&&!De.current.contains(de.target)&&Ee(!1)};return I&&document.addEventListener("mousedown",J),()=>{document.removeEventListener("mousedown",J)}},[I]);const dn=v.useCallback(()=>{Ee(J=>!J)},[]),xn=v.useCallback(J=>{Z(J),Ee(!1),window.location.hash=J},[]),Sn=v.useCallback(()=>{se(J=>J+1)},[]),fn={isOpen:!0,openStudio:()=>{},closeStudio:p,toggleStudio:p,currentPath:C,setCurrentPath:mt,navigateUp:Dt,selectedItems:w,toggleSelection:on,selectRange:Ut,selectAll:Ie,clearSelection:Nt,lastSelectedPath:T,viewMode:_,setViewMode:q,focusedItem:B,setFocusedItem:G,meta:ie,setMeta:K,isLoading:ue,setIsLoading:Q,refreshKey:oe,triggerRefresh:ve,editedImageKey:Te,setEditedImageKey:lt,scanRequested:ee,triggerScan:_e,clearScanRequest:$t,searchQuery:le,setSearchQuery:j,error:W,showError:Je,clearError:ut,fileItems:ye,setFileItems:me,actionState:Re.actionState,requestDelete:Re.requestDelete,requestMove:Re.requestMove,requestSync:Re.requestSync,requestDownload:Re.requestDownload,requestProcess:Re.requestProcess,setProcessMode:Re.setProcessMode,confirmDelete:Re.confirmDelete,confirmMove:Re.confirmMove,confirmSync:Re.confirmSync,confirmProcess:Re.confirmProcess,cancelAction:Re.cancelAction,closeProgress:Re.closeProgress,stopProcessing:Re.stopProcessing,deleteOrphans:Re.deleteOrphans};return r(Xp.Provider,{value:fn,children:b("div",{css:kt.container,children:[b("div",{css:kt.header,children:[r("div",{css:kt.headerLeft,children:b("div",{css:kt.titleDropdown,ref:De,children:[b("button",{css:kt.titleButton,onClick:dn,children:[r("span",{children:"gallop.studio"}),r(J2,{isOpen:I})]}),I&&b("div",{css:kt.dropdownMenu,children:[r("button",{css:[kt.dropdownItem,A==="media"&&kt.dropdownItemActive,"",""],onClick:()=>xn("media"),children:"media & files"}),r("button",{css:[kt.dropdownItem,A==="fonts"&&kt.dropdownItemActive,"",""],onClick:()=>xn("fonts"),children:"fonts"})]})]})}),r("div",{css:kt.headerCenter,children:r(F2,{currentPath:C,onNavigate:mt,projectName:d?d.split("/").pop():void 0})}),b("div",{css:kt.headerActions,children:[h&&r("a",{href:h,target:"_blank",rel:"noopener noreferrer",css:kt.headerIconBtn,title:`Open ${h}`,children:r(K2,{})}),!f&&r("button",{css:kt.headerBtn,onClick:p,"aria-label":"Close Studio",children:r(Z2,{})})]})]}),A==="media"?b(tt,{children:[r(D1,{}),b("div",{css:kt.content,onDragOver:ht,onDragLeave:Bt,onDrop:St,children:[re&&r("div",{css:kt.dropOverlay,children:b("div",{css:kt.dropMessage,children:[r("svg",{css:kt.dropIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})}),r("span",{children:"Drop files to upload"})]})}),r("div",{css:kt.fileBrowser,children:_==="grid"?r(Z1,{}):r(P1,{})})]}),B&&r(m2,{}),r(b2,{}),Re.actionState.showDeleteConfirm&&r(ro,{title:"Delete Files",message:`Are you sure you want to delete ${Re.actionState.actionPaths.length} item${Re.actionState.actionPaths.length!==1?"s":""}? This action cannot be undone.`,confirmLabel:"Delete",variant:"danger",onConfirm:Re.confirmDelete,onCancel:Re.cancelAction}),Re.actionState.showSyncConfirm&&r(ro,{title:"Push to CDN",message:`Push ${Re.actionState.syncImageCount} image${Re.actionState.syncImageCount!==1?"s":""} to Cloudflare R2?${Re.actionState.syncHasRemote?" Remote images will be downloaded first.":""}${Re.actionState.syncHasLocal?" After pushing, local files will be deleted.":""}`,confirmLabel:"Push",onConfirm:Re.confirmSync,onCancel:Re.cancelAction}),Re.actionState.showProcessConfirm&&r(Q2,{imageCount:Re.actionState.actionPaths.length,mode:Re.actionState.processMode,onConfirm:Re.confirmProcess,onCancel:Re.cancelAction}),Re.actionState.showMoveModal&&r(Qp,{selectedItems:new Set(Re.actionState.actionPaths),currentPath:C,onMove:J=>Re.confirmMove(J),onCancel:Re.cancelAction}),Re.actionState.showProgress&&r(Ia,{title:Re.actionState.progressTitle,progress:Re.actionState.progressState,onStop:Re.stopProcessing,onDeleteOrphans:Re.deleteOrphans,onClose:Re.closeProgress})]}):r(T2,{currentPath:x,setCurrentPath:O,refreshKey:ne,triggerRefresh:Sn})]})})}var X2={name:"1cm5yut",styles:"display:flex;gap:12px;justify-content:flex-end"},V2={name:"1ca3l8d",styles:"position:fixed;inset:0;background:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:10000"};function Q2({imageCount:i,mode:c,onConfirm:f,onCancel:d}){const h={overlay:V2,container:m("background:",s.surface,";border-radius:12px;padding:24px;max-width:420px;width:90%;box-shadow:0 20px 25px -5px rgba(0, 0, 0, 0.1),0 10px 10px -5px rgba(0, 0, 0, 0.04);",""),title:m("font-size:",N.lg,";font-weight:600;color:",s.text,";margin:0 0 16px;",""),message:m("font-size:",N.base,";color:",s.textSecondary,";margin:0 0 20px;line-height:1.5;",""),actions:X2,cancelBtn:m("padding:10px 20px;border:1px solid ",s.border,";border-radius:8px;background:",s.background,";color:",s.text,";font-size:",N.base,";font-weight:500;cursor:pointer;transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";border-color:",s.borderHover,";}",""),confirmBtn:m("padding:10px 20px;border:none;border-radius:8px;background:",s.primary,";color:white;font-size:",N.base,";font-weight:500;cursor:pointer;transition:all 0.15s ease;&:hover{background:",s.primaryHover,";}",""),confirmBtnDanger:m("background:",s.danger,";&:hover{background:#dc2626;}","")},p=c==="remove",C=p?"Remove Thumbnails":"Generate Thumbnails",D=p?`Remove generated thumbnails for ${i} image${i!==1?"s":""}? Original images will be kept.`:`Generate thumbnails for ${i} image${i!==1?"s":""}?`,w=p?"Remove":"Generate";return r("div",{css:h.overlay,onClick:d,children:b("div",{css:h.container,onClick:y=>y.stopPropagation(),children:[r("h2",{css:h.title,children:C}),r("p",{css:h.message,children:D}),b("div",{css:h.actions,children:[r("button",{css:h.cancelBtn,onClick:d,children:"Cancel"}),r("button",{css:[h.confirmBtn,p&&h.confirmBtnDanger,"",""],onClick:f,children:w})]})]})})}function F2({currentPath:i,onNavigate:c,projectName:f}){const d=i.split("/").filter(Boolean),h=d.map((p,C)=>({name:C===0&&p==="public"&&f?f:p,path:d.slice(0,C+1).join("/")}));return r("div",{css:kt.breadcrumbs,children:h.map((p,C)=>b("span",{style:{display:"flex",alignItems:"center",gap:6},children:[C>0&&r("span",{css:kt.breadcrumbSeparator,children:"/"}),C===h.length-1?r("span",{css:kt.breadcrumbCurrent,children:p.name}):r("span",{css:kt.breadcrumbItem,onClick:()=>c(p.path),children:p.name})]},p.path))})}function K2(){return b("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),r("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}function Z2(){return b("svg",{css:kt.headerIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function J2({isOpen:i}){return r("svg",{css:[kt.titleChevron,i&&kt.titleChevronOpen,"",""],viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r("polyline",{points:"6 9 12 15 18 9"})})}const Jp=document.getElementById("root");if(!Jp)throw new Error("Root element not found");const $2=window.__STUDIO_WORKSPACE__||"Unknown",W2=window.__STUDIO_SITE_URL__||"";c1.createRoot(Jp).render(r(v.StrictMode,{children:r("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"#0a0a0a"},children:r(G2,{isVisible:!0,standaloneMode:!0,workspacePath:$2,siteUrl:W2})})}));