@c4a/server-cli 0.4.12-alpha.2 → 0.4.12-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3370 -905
- package/package.json +2 -1
- package/serve.js +7152 -1913
- package/web/assets/index-1QkfhsIS.js +12 -0
- package/web/assets/index-8J6WgTr0.js +238 -0
- package/web/assets/index-B1KeXpYL.css +1 -0
- package/web/assets/index-B1zrTc3w.js +12 -0
- package/web/assets/index-B6uGMtfP.css +1 -0
- package/web/assets/index-BCzQnf3x.css +1 -0
- package/web/assets/index-BE9z9PQF.js +238 -0
- package/web/assets/index-BF6rVrre.js +238 -0
- package/web/assets/index-BMVKFQ7h.js +238 -0
- package/web/assets/index-BRwgHwhm.js +12 -0
- package/web/assets/index-BXaK4HKi.js +12 -0
- package/web/assets/index-BaBWjAP7.css +1 -0
- package/web/assets/index-Be3yvSxB.js +12 -0
- package/web/assets/index-Bh0nrxkS.css +1 -0
- package/web/assets/index-BjM7CFih.js +12 -0
- package/web/assets/index-Bxc-msf3.js +238 -0
- package/web/assets/index-ByCT34eF.css +1 -0
- package/web/assets/index-C0SbV7Fr.js +238 -0
- package/web/assets/index-C1T-mIJp.js +238 -0
- package/web/assets/index-C6uqUNjs.js +238 -0
- package/web/assets/index-CKPy6nsr.js +238 -0
- package/web/assets/index-CSQvEPnB.js +238 -0
- package/web/assets/index-CU-x3HVJ.js +12 -0
- package/web/assets/index-CVcqJsfJ.js +12 -0
- package/web/assets/index-CWKka1Dm.css +1 -0
- package/web/assets/index-Cs1wjzzB.css +1 -0
- package/web/assets/index-D0FYwi5D.css +1 -0
- package/web/assets/index-D9pKIRoL.js +12 -0
- package/web/assets/index-DHMM5gmZ.js +12 -0
- package/web/assets/index-DMIK6qP9.js +12 -0
- package/web/assets/index-DNSKIsZU.js +238 -0
- package/web/assets/index-DW-afpe4.js +12 -0
- package/web/assets/index-DYi5EQi6.css +1 -0
- package/web/assets/index-DaUMALOp.css +1 -0
- package/web/assets/index-DeStbuhs.css +1 -0
- package/web/assets/index-DfXQnmId.js +12 -0
- package/web/assets/index-DisDw0E0.css +1 -0
- package/web/assets/index-Dm-_KwmC.css +1 -0
- package/web/assets/index-DmRvWfJA.js +12 -0
- package/web/assets/index-Drfhm6bu.js +12 -0
- package/web/assets/index-DvnO8hAI.js +12 -0
- package/web/assets/index-G3fxfqeh.js +238 -0
- package/web/assets/index-JdgClnFG.css +1 -0
- package/web/assets/index-P648JtKx.js +12 -0
- package/web/assets/index-VCinLKUc.css +1 -0
- package/web/assets/index-ZtrM6iGG.js +12 -0
- package/web/assets/index-oRdZsAv2.js +238 -0
- package/web/assets/index-snZ8He7E.js +12 -0
- package/web/assets/index-zH92nrE5.css +1 -0
- package/web/index.html +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function i0(n,l){for(var s=0;s<l.length;s++){const i=l[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(n,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=s(o);fetch(o.href,u)}})();function o0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Du={exports:{}},bs={};var mp;function c0(){if(mp)return bs;mp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(i,o,u){var m=null;if(u!==void 0&&(m=""+u),o.key!==void 0&&(m=""+o.key),"key"in o){u={};for(var p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:n,type:i,key:m,ref:o!==void 0?o:null,props:u}}return bs.Fragment=l,bs.jsx=s,bs.jsxs=s,bs}var hp;function u0(){return hp||(hp=1,Du.exports=c0()),Du.exports}var f=u0();const De=n=>typeof n=="string",vs=()=>{let n,l;const s=new Promise((i,o)=>{n=i,l=o});return s.resolve=n,s.reject=l,s},pp=n=>n==null?"":""+n,d0=(n,l,s)=>{n.forEach(i=>{l[i]&&(s[i]=l[i])})},f0=/###/g,gp=n=>n&&n.indexOf("###")>-1?n.replace(f0,"."):n,xp=n=>!n||De(n),Cs=(n,l,s)=>{const i=De(l)?l.split("."):l;let o=0;for(;o<i.length-1;){if(xp(n))return{};const u=gp(i[o]);!n[u]&&s&&(n[u]=new s),Object.prototype.hasOwnProperty.call(n,u)?n=n[u]:n={},++o}return xp(n)?{}:{obj:n,k:gp(i[o])}},yp=(n,l,s)=>{const{obj:i,k:o}=Cs(n,l,Object);if(i!==void 0||l.length===1){i[o]=s;return}let u=l[l.length-1],m=l.slice(0,l.length-1),p=Cs(n,m,Object);for(;p.obj===void 0&&m.length;)u=`${m[m.length-1]}.${u}`,m=m.slice(0,m.length-1),p=Cs(n,m,Object),p?.obj&&typeof p.obj[`${p.k}.${u}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${u}`]=s},m0=(n,l,s,i)=>{const{obj:o,k:u}=Cs(n,l,Object);o[u]=o[u]||[],o[u].push(s)},mo=(n,l)=>{const{obj:s,k:i}=Cs(n,l);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},h0=(n,l,s)=>{const i=mo(n,s);return i!==void 0?i:mo(l,s)},qg=(n,l,s)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in n?De(n[i])||n[i]instanceof String||De(l[i])||l[i]instanceof String?s&&(n[i]=l[i]):qg(n[i],l[i],s):n[i]=l[i]);return n},Nl=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var p0={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const g0=n=>De(n)?n.replace(/[&<>"'\/]/g,l=>p0[l]):n;class x0{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const s=this.regExpMap.get(l);if(s!==void 0)return s;const i=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,i),this.regExpQueue.push(l),i}}const y0=[" ",",","?","!",";"],b0=new x0(20),v0=(n,l,s)=>{l=l||"",s=s||"";const i=y0.filter(m=>l.indexOf(m)<0&&s.indexOf(m)<0);if(i.length===0)return!0;const o=b0.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let u=!o.test(n);if(!u){const m=n.indexOf(s);m>0&&!o.test(n.substring(0,m))&&(u=!0)}return u},td=(n,l,s=".")=>{if(!n)return;if(n[l])return Object.prototype.hasOwnProperty.call(n,l)?n[l]:void 0;const i=l.split(s);let o=n;for(let u=0;u<i.length;){if(!o||typeof o!="object")return;let m,p="";for(let g=u;g<i.length;++g)if(g!==u&&(p+=s),p+=i[g],m=o[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;u+=g-u+1;break}o=m}return o},zs=n=>n?.replace("_","-"),S0={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,l){console?.[n]?.apply?.(console,l)}};class ho{constructor(l,s={}){this.init(l,s)}init(l,s={}){this.prefix=s.prefix||"i18next:",this.logger=l||S0,this.options=s,this.debug=s.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,s,i,o){return o&&!this.debug?null:(De(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[s](l))}create(l){return new ho(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new ho(this.logger,l)}}var nn=new ho;class yo{constructor(){this.observers={}}on(l,s){return l.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(s)||0;this.observers[i].set(s,o+1)}),this}off(l,s){if(this.observers[l]){if(!s){delete this.observers[l];return}this.observers[l].delete(s)}}emit(l,...s){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o.apply(o,[l,...s])})}}class bp extends yo{constructor(l,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const s=this.options.ns.indexOf(l);s>-1&&this.options.ns.splice(s,1)}getResource(l,s,i,o={}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,m=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;l.indexOf(".")>-1?p=l.split("."):(p=[l,s],i&&(Array.isArray(i)?p.push(...i):De(i)&&u?p.push(...i.split(u)):p.push(i)));const g=mo(this.data,p);return!g&&!s&&!i&&l.indexOf(".")>-1&&(l=p[0],s=p[1],i=p.slice(2).join(".")),g||!m||!De(i)?g:td(this.data?.[l]?.[s],i,u)}addResource(l,s,i,o,u={silent:!1}){const m=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let p=[l,s];i&&(p=p.concat(m?i.split(m):i)),l.indexOf(".")>-1&&(p=l.split("."),o=s,s=p[1]),this.addNamespaces(s),yp(this.data,p,o),u.silent||this.emit("added",l,s,i,o)}addResources(l,s,i,o={silent:!1}){for(const u in i)(De(i[u])||Array.isArray(i[u]))&&this.addResource(l,s,u,i[u],{silent:!0});o.silent||this.emit("added",l,s,i)}addResourceBundle(l,s,i,o,u,m={silent:!1,skipCopy:!1}){let p=[l,s];l.indexOf(".")>-1&&(p=l.split("."),o=i,i=s,s=p[1]),this.addNamespaces(s);let g=mo(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?qg(g,i,u):g={...g,...i},yp(this.data,p,g),m.silent||this.emit("added",l,s,i)}removeResourceBundle(l,s){this.hasResourceBundle(l,s)&&delete this.data[l][s],this.removeNamespaces(s),this.emit("removed",l,s)}hasResourceBundle(l,s){return this.getResource(l,s)!==void 0}getResourceBundle(l,s){return s||(s=this.options.defaultNS),this.getResource(l,s)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const s=this.getDataByLanguage(l);return!!(s&&Object.keys(s)||[]).find(o=>s[o]&&Object.keys(s[o]).length>0)}toJSON(){return this.data}}var $g={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,l,s,i,o){return n.forEach(u=>{l=this.processors[u]?.process(l,s,i,o)??l}),l}};const Yg=Symbol("i18next/PATH_KEY");function _0(){const n=[],l=Object.create(null);let s;return l.get=(i,o)=>(s?.revoke?.(),o===Yg?n:(n.push(o),s=Proxy.revocable(i,l),s.proxy)),Proxy.revocable(Object.create(null),l).proxy}function ad(n,l){const{[Yg]:s}=n(_0());return s.join(l?.keySeparator??".")}const vp={},Mu=n=>!De(n)&&typeof n!="boolean"&&typeof n!="number";class po extends yo{constructor(l,s={}){super(),d0(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=nn.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,s={interpolation:{}}){const i={...s};if(l==null)return!1;const o=this.resolve(l,i);if(o?.res===void 0)return!1;const u=Mu(o.res);return!(i.returnObjects===!1&&u)}extractFromKey(l,s){let i=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=s.ns||this.options.defaultNS||[];const m=i&&l.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!v0(l,i,o);if(m&&!p){const g=l.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:l,namespaces:De(u)?[u]:u};const h=l.split(i);(i!==o||i===o&&this.options.ns.indexOf(h[0])>-1)&&(u=h.shift()),l=h.join(o)}return{key:l,namespaces:De(u)?[u]:u}}translate(l,s,i){let o=typeof s=="object"?{...s}:s;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),l==null)return"";typeof l=="function"&&(l=ad(l,{...this.options,...o})),Array.isArray(l)||(l=[String(l)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,m=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:p,namespaces:g}=this.extractFromKey(l[l.length-1],o),h=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const y=o.lng||this.language,_=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(y?.toLowerCase()==="cimode")return _?u?{res:`${h}${v}${p}`,usedKey:p,exactUsedKey:p,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:`${h}${v}${p}`:u?{res:p,usedKey:p,exactUsedKey:p,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:p;const j=this.resolve(l,o);let R=j?.res;const z=j?.usedKey||p,A=j?.exactUsedKey||p,X=["[object Number]","[object Function]","[object RegExp]"],Q=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,V=!this.i18nFormat||this.i18nFormat.handleAsObject,G=o.count!==void 0&&!De(o.count),Y=po.hasDefaultValue(o),te=G?this.pluralResolver.getSuffix(y,o.count,o):"",ee=o.ordinal&&G?this.pluralResolver.getSuffix(y,o.count,{ordinal:!1}):"",w=G&&!o.ordinal&&o.count===0,q=w&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${te}`]||o[`defaultValue${ee}`]||o.defaultValue;let Z=R;V&&!R&&Y&&(Z=q);const de=Mu(Z),se=Object.prototype.toString.apply(Z);if(V&&Z&&de&&X.indexOf(se)<0&&!(De(Q)&&Array.isArray(Z))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ye=this.options.returnedObjectHandler?this.options.returnedObjectHandler(z,Z,{...o,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return u?(j.res=ye,j.usedParams=this.getUsedParamsDetails(o),j):ye}if(m){const ye=Array.isArray(Z),ae=ye?[]:{},ie=ye?A:z;for(const M in Z)if(Object.prototype.hasOwnProperty.call(Z,M)){const W=`${ie}${m}${M}`;Y&&!R?ae[M]=this.translate(W,{...o,defaultValue:Mu(q)?q[M]:void 0,joinArrays:!1,ns:g}):ae[M]=this.translate(W,{...o,joinArrays:!1,ns:g}),ae[M]===W&&(ae[M]=Z[M])}R=ae}}else if(V&&De(Q)&&Array.isArray(R))R=R.join(Q),R&&(R=this.extendTranslation(R,l,o,i));else{let ye=!1,ae=!1;!this.isValidLookup(R)&&Y&&(ye=!0,R=q),this.isValidLookup(R)||(ae=!0,R=p);const M=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ae?void 0:R,W=Y&&q!==R&&this.options.updateMissing;if(ae||ye||W){if(this.logger.log(W?"updateKey":"missingKey",y,h,p,W?q:R),m){const N=this.resolve(p,{...o,keySeparator:!1});N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ce=[];const P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&P&&P[0])for(let N=0;N<P.length;N++)ce.push(P[N]);else this.options.saveMissingTo==="all"?ce=this.languageUtils.toResolveHierarchy(o.lng||this.language):ce.push(o.lng||this.language);const be=(N,H,F)=>{const ne=Y&&F!==R?F:M;this.options.missingKeyHandler?this.options.missingKeyHandler(N,h,H,ne,W,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(N,h,H,ne,W,o),this.emit("missingKey",N,h,H,R)};this.options.saveMissing&&(this.options.saveMissingPlurals&&G?ce.forEach(N=>{const H=this.pluralResolver.getSuffixes(N,o);w&&o[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(F=>{be([N],p+F,o[`defaultValue${F}`]||q)})}):be(ce,p,q))}R=this.extendTranslation(R,l,o,j,i),ae&&R===p&&this.options.appendNamespaceToMissingKey&&(R=`${h}${v}${p}`),(ae||ye)&&this.options.parseMissingKeyHandler&&(R=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${v}${p}`:p,ye?R:void 0,o))}return u?(j.res=R,j.usedParams=this.getUsedParamsDetails(o),j):R}extendTranslation(l,s,i,o,u){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const g=De(l)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const y=l.match(this.interpolator.nestingRegexp);h=y&&y.length}let v=i.replace&&!De(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),l=this.interpolator.interpolate(l,v,i.lng||this.language||o.usedLng,i),g){const y=l.match(this.interpolator.nestingRegexp),_=y&&y.length;h<_&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...y)=>u?.[0]===y[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${s[0]}`),null):this.translate(...y,s),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=De(m)?[m]:m;return l!=null&&p?.length&&i.applyPostProcessor!==!1&&(l=$g.handle(p,l,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),l}resolve(l,s={}){let i,o,u,m,p;return De(l)&&(l=[l]),l.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,s),v=h.key;o=v;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const _=s.count!==void 0&&!De(s.count),j=_&&!s.ordinal&&s.count===0,R=s.context!==void 0&&(De(s.context)||typeof s.context=="number")&&s.context!=="",z=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);y.forEach(A=>{this.isValidLookup(i)||(p=A,!vp[`${z[0]}-${A}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(vp[`${z[0]}-${A}`]=!0,this.logger.warn(`key "${o}" for languages "${z.join(", ")}" won't get resolved as namespace "${p}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),z.forEach(X=>{if(this.isValidLookup(i))return;m=X;const Q=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(Q,v,X,A,s);else{let G;_&&(G=this.pluralResolver.getSuffix(X,s.count,s));const Y=`${this.options.pluralSeparator}zero`,te=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(s.ordinal&&G.indexOf(te)===0&&Q.push(v+G.replace(te,this.options.pluralSeparator)),Q.push(v+G),j&&Q.push(v+Y)),R){const ee=`${v}${this.options.contextSeparator||"_"}${s.context}`;Q.push(ee),_&&(s.ordinal&&G.indexOf(te)===0&&Q.push(ee+G.replace(te,this.options.pluralSeparator)),Q.push(ee+G),j&&Q.push(ee+Y))}}let V;for(;V=Q.pop();)this.isValidLookup(i)||(u=V,i=this.getResource(X,A,V,s))}))})}),{res:i,usedKey:o,exactUsedKey:u,usedLng:m,usedNS:p}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,s,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,s,i,o):this.resourceStore.getResource(l,s,i,o)}getUsedParamsDetails(l={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=l.replace&&!De(l.replace);let o=i?l.replace:l;if(i&&typeof l.count<"u"&&(o.count=l.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const u of s)delete o[u]}return o}static hasDefaultValue(l){const s="defaultValue";for(const i in l)if(Object.prototype.hasOwnProperty.call(l,i)&&s===i.substring(0,s.length)&&l[i]!==void 0)return!0;return!1}}class Sp{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nn.create("languageUtils")}getScriptPartFromCode(l){if(l=zs(l),!l||l.indexOf("-")<0)return null;const s=l.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(l){if(l=zs(l),!l||l.indexOf("-")<0)return l;const s=l.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(l){if(De(l)&&l.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(l)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let s;return l.forEach(i=>{if(s)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(s=o)}),!s&&this.options.supportedLngs&&l.forEach(i=>{if(s)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return s=o;const u=this.getLanguagePartFromCode(i);if(this.isSupportedCode(u))return s=u;s=this.options.supportedLngs.find(m=>{if(m===u)return m;if(!(m.indexOf("-")<0&&u.indexOf("-")<0)&&(m.indexOf("-")>0&&u.indexOf("-")<0&&m.substring(0,m.indexOf("-"))===u||m.indexOf(u)===0&&u.length>1))return m})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(l,s){if(!l)return[];if(typeof l=="function"&&(l=l(s)),De(l)&&(l=[l]),Array.isArray(l))return l;if(!s)return l.default||[];let i=l[s];return i||(i=l[this.getScriptPartFromCode(s)]),i||(i=l[this.formatLanguageCode(s)]),i||(i=l[this.getLanguagePartFromCode(s)]),i||(i=l.default),i||[]}toResolveHierarchy(l,s){const i=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],l),o=[],u=m=>{m&&(this.isSupportedCode(m)?o.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return De(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(l))):De(l)&&u(this.formatLanguageCode(l)),i.forEach(m=>{o.indexOf(m)<0&&u(this.formatLanguageCode(m))}),o}}const _p={zero:0,one:1,two:2,few:3,many:4,other:5},jp={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class j0{constructor(l,s={}){this.languageUtils=l,this.options=s,this.logger=nn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(l,s={}){const i=zs(l==="dev"?"en":l),o=s.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:i,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let m;try{m=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),jp;if(!l.match(/-|_/))return jp;const g=this.languageUtils.getLanguagePartFromCode(l);m=this.getRule(g,s)}return this.pluralRulesCache[u]=m,m}needsPlural(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,s,i={}){return this.getSuffixes(l,i).map(o=>`${s}${o}`)}getSuffixes(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort((o,u)=>_p[o]-_p[u]).map(o=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(l,s,i={}){const o=this.getRule(l,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(s)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",s,i))}}const Np=(n,l,s,i=".",o=!0)=>{let u=h0(n,l,s);return!u&&o&&De(s)&&(u=td(n,s,i),u===void 0&&(u=td(l,s,i))),u},Au=n=>n.replace(/\$/g,"$$$$");class wp{constructor(l={}){this.logger=nn.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(s=>s),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:o,prefix:u,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:v,unescapePrefix:y,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:R,nestingSuffixEscaped:z,nestingOptionsSeparator:A,maxReplaces:X,alwaysFormat:Q}=l.interpolation;this.escape=s!==void 0?s:g0,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?Nl(u):m||"{{",this.suffix=p?Nl(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=v?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=_?Nl(_):j||Nl("$t("),this.nestingSuffix=R?Nl(R):z||Nl(")"),this.nestingOptionsSeparator=A||",",this.maxReplaces=X||1e3,this.alwaysFormat=Q!==void 0?Q:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(s,i)=>s?.source===i?(s.lastIndex=0,s):new RegExp(i,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,s,i,o){let u,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=j=>{if(j.indexOf(this.formatSeparator)<0){const X=Np(s,g,j,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(X,void 0,i,{...o,...s,interpolationkey:j}):X}const R=j.split(this.formatSeparator),z=R.shift().trim(),A=R.join(this.formatSeparator).trim();return this.format(Np(s,g,z,this.options.keySeparator,this.options.ignoreJSONStructure),A,i,{...o,...s,interpolationkey:z})};this.resetRegExp();const v=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,y=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:j=>Au(j)},{regex:this.regexp,safeValue:j=>this.escapeValue?Au(this.escape(j)):Au(j)}].forEach(j=>{for(p=0;u=j.regex.exec(l);){const R=u[1].trim();if(m=h(R),m===void 0)if(typeof v=="function"){const A=v(l,u,o);m=De(A)?A:""}else if(o&&Object.prototype.hasOwnProperty.call(o,R))m="";else if(y){m=u[0];continue}else this.logger.warn(`missed to pass in variable ${R} for interpolating ${l}`),m="";else!De(m)&&!this.useRawValueToEscape&&(m=pp(m));const z=j.safeValue(m);if(l=l.replace(u[0],z),y?(j.regex.lastIndex+=m.length,j.regex.lastIndex-=u[0].length):j.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),l}nest(l,s,i={}){let o,u,m;const p=(g,h)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const y=g.split(new RegExp(`${Nl(v)}[ ]*{`));let _=`{${y[1]}`;g=y[0],_=this.interpolate(_,m);const j=_.match(/'/g),R=_.match(/"/g);((j?.length??0)%2===0&&!R||(R?.length??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{m=JSON.parse(_),h&&(m={...h,...m})}catch(z){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,z),`${g}${v}${_}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;o=this.nestingRegexp.exec(l);){let g=[];m={...i},m=m.replace&&!De(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;const h=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(h!==-1&&(g=o[1].slice(h).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),o[1]=o[1].slice(0,h)),u=s(p.call(this,o[1].trim(),m),m),u&&o[0]===l&&!De(u))return u;De(u)||(u=pp(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${l}`),u=""),g.length&&(u=g.reduce((v,y)=>this.format(v,y,i.lng,{...i,interpolationkey:o[1].trim()}),u.trim())),l=l.replace(o[0],u),this.regexp.lastIndex=0}return l}}const N0=n=>{let l=n.toLowerCase().trim();const s={};if(n.indexOf("(")>-1){const i=n.split("(");l=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);l==="currency"&&o.indexOf(":")<0?s.currency||(s.currency=o.trim()):l==="relativetime"&&o.indexOf(":")<0?s.range||(s.range=o.trim()):o.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),v=p.trim();s[v]||(s[v]=h),h==="false"&&(s[v]=!1),h==="true"&&(s[v]=!0),isNaN(h)||(s[v]=parseInt(h,10))}})}return{formatName:l,formatOptions:s}},Ep=n=>{const l={};return(s,i,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const m=i+JSON.stringify(u);let p=l[m];return p||(p=n(zs(i),o),l[m]=p),p(s)}},w0=n=>(l,s,i)=>n(zs(s),i)(l);class E0{constructor(l={}){this.logger=nn.create("formatter"),this.options=l,this.init(l)}init(l,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?Ep:w0;this.formats={number:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u});return p=>m.format(p)}),currency:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u,style:"currency"});return p=>m.format(p)}),datetime:i((o,u)=>{const m=new Intl.DateTimeFormat(o,{...u});return p=>m.format(p)}),relativetime:i((o,u)=>{const m=new Intl.RelativeTimeFormat(o,{...u});return p=>m.format(p,u.range||"day")}),list:i((o,u)=>{const m=new Intl.ListFormat(o,{...u});return p=>m.format(p)})}}add(l,s){this.formats[l.toLowerCase().trim()]=s}addCached(l,s){this.formats[l.toLowerCase().trim()]=Ep(s)}format(l,s,i,o={}){const u=s.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(p=>p.indexOf(")")>-1)){const p=u.findIndex(g=>g.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,p)].join(this.formatSeparator)}return u.reduce((p,g)=>{const{formatName:h,formatOptions:v}=N0(g);if(this.formats[h]){let y=p;try{const _=o?.formatParams?.[o.interpolationkey]||{},j=_.locale||_.lng||o.locale||o.lng||i;y=this.formats[h](p,j,{...v,...o,..._})}catch(_){this.logger.warn(_)}return y}else this.logger.warn(`there was no format function for ${h}`);return p},l)}}const C0=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class R0 extends yo{constructor(l,s,i,o={}){super(),this.backend=l,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=nn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,o.backend,o)}queueLoad(l,s,i,o){const u={},m={},p={},g={};return l.forEach(h=>{let v=!0;s.forEach(y=>{const _=`${h}|${y}`;!i.reload&&this.store.hasResourceBundle(h,y)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?m[_]===void 0&&(m[_]=!0):(this.state[_]=1,v=!1,m[_]===void 0&&(m[_]=!0),u[_]===void 0&&(u[_]=!0),g[y]===void 0&&(g[y]=!0)))}),v||(p[h]=!0)}),(Object.keys(u).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(l,s,i){const o=l.split("|"),u=o[0],m=o[1];s&&this.emit("failedLoading",u,m,s),!s&&i&&this.store.addResourceBundle(u,m,i,void 0,void 0,{skipCopy:!0}),this.state[l]=s?-1:2,s&&i&&(this.state[l]=0);const p={};this.queue.forEach(g=>{m0(g.loaded,[u],m),C0(g,l),s&&g.errors.push(s),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const v=g.loaded[h];v.length&&v.forEach(y=>{p[h][y]===void 0&&(p[h][y]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(l,s,i,o=0,u=this.retryTimeout,m){if(!l.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:s,fcName:i,tried:o,wait:u,callback:m});return}this.readingCalls++;const p=(h,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,l,s,i,o+1,u*2,m)},u);return}m(h,v)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(l,s);h&&typeof h.then=="function"?h.then(v=>p(null,v)).catch(p):p(null,h)}catch(h){p(h)}return}return g(l,s,p)}prepareLoading(l,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();De(l)&&(l=this.languageUtils.toResolveHierarchy(l)),De(s)&&(s=[s]);const u=this.queueLoad(l,s,i,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(m=>{this.loadOne(m)})}load(l,s,i){this.prepareLoading(l,s,{},i)}reload(l,s,i){this.prepareLoading(l,s,{reload:!0},i)}loadOne(l,s=""){const i=l.split("|"),o=i[0],u=i[1];this.read(o,u,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${s}loading namespace ${u} for language ${o} failed`,m),!m&&p&&this.logger.log(`${s}loaded namespace ${u} for language ${o}`,p),this.loaded(l,m,p)})}saveMissing(l,s,i,o,u,m={},p=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${i}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const g={...m,isUpdate:u},h=this.backend.create.bind(this.backend);if(h.length<6)try{let v;h.length===5?v=h(l,s,i,o,g):v=h(l,s,i,o),v&&typeof v.then=="function"?v.then(y=>p(null,y)).catch(p):p(null,v)}catch(v){p(v)}else h(l,s,i,o,p,g)}!l||!l[0]||this.store.addResource(l[0],s,i,o)}}}const ku=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let l={};if(typeof n[1]=="object"&&(l=n[1]),De(n[1])&&(l.defaultValue=n[1]),De(n[2])&&(l.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const s=n[3]||n[2];Object.keys(s).forEach(i=>{l[i]=s[i]})}return l},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Cp=n=>(De(n.ns)&&(n.ns=[n.ns]),De(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),De(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),to=()=>{},T0=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},Gg="__i18next_supportNoticeShown",z0=()=>typeof globalThis<"u"&&!!globalThis[Gg],O0=()=>{typeof globalThis<"u"&&(globalThis[Gg]=!0)},D0=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(l=>l?.name?.indexOf("Locize")>0||l?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(l=>l?.projectId));class Rs extends yo{constructor(l={},s){if(super(),this.options=Cp(l),this.services={},this.logger=nn,this.modules={external:[]},T0(this),s&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,s),this;setTimeout(()=>{this.init(l,s)},0)}}init(l={},s){this.isInitializing=!0,typeof l=="function"&&(s=l,l={}),l.defaultNS==null&&l.ns&&(De(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=ku();this.options={...i,...this.options,...Cp(l)},this.options.interpolation={...i.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!D0(this)&&!z0()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),O0());const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?nn.init(o(this.modules.logger),this.options):nn.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=E0;const v=new Sp(this.options);this.store=new bp(this.options.resources,this.options);const y=this.services;y.logger=nn,y.resourceStore=this.store,y.languageUtils=v,y.pluralResolver=new j0(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(y.formatter=o(h),y.formatter.init&&y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new wp(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new R0(o(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",(j,...R)=>{this.emit(j,...R)}),this.modules.languageDetector&&(y.languageDetector=o(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=o(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new po(this.services,this.options),this.translator.on("*",(j,...R)=>{this.emit(j,...R)}),this.modules.external.forEach(j=>{j.init&&j.init(this)})}if(this.format=this.options.interpolation.format,s||(s=to),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...v)=>this.store[h](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...v)=>(this.store[h](...v),this)});const p=vs(),g=()=>{const h=(v,y)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),p.resolve(y),s(v,y)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),p}loadResources(l,s=to){let i=s;const o=De(l)?l:this.language;if(typeof l=="function"&&(i=l),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const u=[],m=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(h=>{h!=="cimode"&&u.indexOf(h)<0&&u.push(h)})};o?m(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>m(g)),this.options.preload?.forEach?.(p=>m(p)),this.services.backendConnector.load(u,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(p)})}else i(null)}reloadResources(l,s,i){const o=vs();return typeof l=="function"&&(i=l,l=void 0),typeof s=="function"&&(i=s,s=void 0),l||(l=this.languages),s||(s=this.options.ns),i||(i=to),this.services.backendConnector.reload(l,s,u=>{o.resolve(),i(u)}),o}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&$g.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let s=0;s<this.languages.length;s++){const i=this.languages[s];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,s){this.isLanguageChangingTo=l;const i=vs();this.emit("languageChanging",l);const o=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},u=(p,g)=>{g?this.isLanguageChangingTo===l&&(o(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,i.resolve((...h)=>this.t(...h)),s&&s(p,(...h)=>this.t(...h))},m=p=>{!l&&!p&&this.services.languageDetector&&(p=[]);const g=De(p)?p:p&&p[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(De(p)?[p]:p);h&&(this.language||o(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector?.cacheUserLanguage?.(h)),this.loadResources(h,v=>{u(v,h)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(l),i}getFixedT(l,s,i){const o=(u,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([u,m].concat(p)):g={...m},g.lng=g.lng||o.lng,g.lngs=g.lngs||o.lngs,g.ns=g.ns||o.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||o.keyPrefix);const h=this.options.keySeparator||".";let v;return g.keyPrefix&&Array.isArray(u)?v=u.map(y=>(typeof y=="function"&&(y=ad(y,{...this.options,...m})),`${g.keyPrefix}${h}${y}`)):(typeof u=="function"&&(u=ad(u,{...this.options,...m})),v=g.keyPrefix?`${g.keyPrefix}${h}${u}`:u),this.t(v,g)};return De(l)?o.lng=l:o.lngs=l,o.ns=s,o.keyPrefix=i,o}t(...l){return this.translator?.translate(...l)}exists(...l){return this.translator?.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=s.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(s.precheck){const p=s.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(i,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,l)&&(!o||m(u,l)))}loadNamespaces(l,s){const i=vs();return this.options.ns?(De(l)&&(l=[l]),l.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),s&&s(o)}),i):(s&&s(),Promise.resolve())}loadLanguages(l,s){const i=vs();De(l)&&(l=[l]);const o=this.options.preload||[],u=l.filter(m=>o.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return u.length?(this.options.preload=o.concat(u),this.loadResources(m=>{i.resolve(),s&&s(m)}),i):(s&&s(),Promise.resolve())}dir(l){if(l||(l=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!l)return"rtl";try{const o=new Intl.Locale(l);if(o&&o.getTextInfo){const u=o.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new Sp(ku());return l.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(i.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},s){const i=new Rs(l,s);return i.createInstance=Rs.createInstance,i}cloneInstance(l={},s=to){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const o={...this.options,...l,isClone:!0},u=new Rs(o);if((l.debug!==void 0||l.prefix!==void 0)&&(u.logger=u.logger.clone(l)),["store","services","language"].forEach(p=>{u[p]=this[p]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},i){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},g[h]=Object.keys(g[h]).reduce((v,y)=>(v[y]={...g[h][y]},v),g[h]),g),{});u.store=new bp(p,o),u.services.resourceStore=u.store}if(l.interpolation){const g={...ku().interpolation,...this.options.interpolation,...l.interpolation},h={...o,interpolation:g};u.services.interpolator=new wp(h)}return u.translator=new po(u.services,o),u.translator.on("*",(p,...g)=>{u.emit(p,...g)}),u.init(o,s),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const aa=Rs.createInstance();aa.createInstance;aa.dir;aa.init;aa.loadResources;aa.reloadResources;aa.use;aa.changeLanguage;aa.getFixedT;aa.t;aa.exists;aa.setDefaultNamespace;aa.hasLoadedNamespace;aa.loadNamespaces;aa.loadLanguages;var Lu={exports:{}},Me={};var Rp;function M0(){if(Rp)return Me;Rp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),_=Symbol.iterator;function j(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,A={};function X(N,H,F){this.props=N,this.context=H,this.refs=A,this.updater=F||R}X.prototype.isReactComponent={},X.prototype.setState=function(N,H){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,H,"setState")},X.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function Q(){}Q.prototype=X.prototype;function V(N,H,F){this.props=N,this.context=H,this.refs=A,this.updater=F||R}var G=V.prototype=new Q;G.constructor=V,z(G,X.prototype),G.isPureReactComponent=!0;var Y=Array.isArray;function te(){}var ee={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function q(N,H,F){var ne=F.ref;return{$$typeof:n,type:N,key:H,ref:ne!==void 0?ne:null,props:F}}function Z(N,H){return q(N.type,H,N.props)}function de(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function se(N){var H={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(F){return H[F]})}var ye=/\/+/g;function ae(N,H){return typeof N=="object"&&N!==null&&N.key!=null?se(""+N.key):H.toString(36)}function ie(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(te,te):(N.status="pending",N.then(function(H){N.status==="pending"&&(N.status="fulfilled",N.value=H)},function(H){N.status==="pending"&&(N.status="rejected",N.reason=H)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function M(N,H,F,ne,he){var _e=typeof N;(_e==="undefined"||_e==="boolean")&&(N=null);var ze=!1;if(N===null)ze=!0;else switch(_e){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(N.$$typeof){case n:case l:ze=!0;break;case v:return ze=N._init,M(ze(N._payload),H,F,ne,he)}}if(ze)return he=he(N),ze=ne===""?"."+ae(N,0):ne,Y(he)?(F="",ze!=null&&(F=ze.replace(ye,"$&/")+"/"),M(he,H,F,"",function(na){return na})):he!=null&&(de(he)&&(he=Z(he,F+(he.key==null||N&&N.key===he.key?"":(""+he.key).replace(ye,"$&/")+"/")+ze)),H.push(he)),1;ze=0;var Ze=ne===""?".":ne+":";if(Y(N))for(var Ue=0;Ue<N.length;Ue++)ne=N[Ue],_e=Ze+ae(ne,Ue),ze+=M(ne,H,F,_e,he);else if(Ue=j(N),typeof Ue=="function")for(N=Ue.call(N),Ue=0;!(ne=N.next()).done;)ne=ne.value,_e=Ze+ae(ne,Ue++),ze+=M(ne,H,F,_e,he);else if(_e==="object"){if(typeof N.then=="function")return M(ie(N),H,F,ne,he);throw H=String(N),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ze}function W(N,H,F){if(N==null)return N;var ne=[],he=0;return M(N,ne,"","",function(_e){return H.call(F,_e,he++)}),ne}function ce(N){if(N._status===-1){var H=N._result;H=H(),H.then(function(F){(N._status===0||N._status===-1)&&(N._status=1,N._result=F)},function(F){(N._status===0||N._status===-1)&&(N._status=2,N._result=F)}),N._status===-1&&(N._status=0,N._result=H)}if(N._status===1)return N._result.default;throw N._result}var P=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},be={map:W,forEach:function(N,H,F){W(N,function(){H.apply(this,arguments)},F)},count:function(N){var H=0;return W(N,function(){H++}),H},toArray:function(N){return W(N,function(H){return H})||[]},only:function(N){if(!de(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Me.Activity=y,Me.Children=be,Me.Component=X,Me.Fragment=s,Me.Profiler=o,Me.PureComponent=V,Me.StrictMode=i,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ee,Me.__COMPILER_RUNTIME={__proto__:null,c:function(N){return ee.H.useMemoCache(N)}},Me.cache=function(N){return function(){return N.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(N,H,F){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ne=z({},N.props),he=N.key;if(H!=null)for(_e in H.key!==void 0&&(he=""+H.key),H)!w.call(H,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&H.ref===void 0||(ne[_e]=H[_e]);var _e=arguments.length-2;if(_e===1)ne.children=F;else if(1<_e){for(var ze=Array(_e),Ze=0;Ze<_e;Ze++)ze[Ze]=arguments[Ze+2];ne.children=ze}return q(N.type,he,ne)},Me.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:u,_context:N},N},Me.createElement=function(N,H,F){var ne,he={},_e=null;if(H!=null)for(ne in H.key!==void 0&&(_e=""+H.key),H)w.call(H,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(he[ne]=H[ne]);var ze=arguments.length-2;if(ze===1)he.children=F;else if(1<ze){for(var Ze=Array(ze),Ue=0;Ue<ze;Ue++)Ze[Ue]=arguments[Ue+2];he.children=Ze}if(N&&N.defaultProps)for(ne in ze=N.defaultProps,ze)he[ne]===void 0&&(he[ne]=ze[ne]);return q(N,_e,he)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(N){return{$$typeof:p,render:N}},Me.isValidElement=de,Me.lazy=function(N){return{$$typeof:v,_payload:{_status:-1,_result:N},_init:ce}},Me.memo=function(N,H){return{$$typeof:h,type:N,compare:H===void 0?null:H}},Me.startTransition=function(N){var H=ee.T,F={};ee.T=F;try{var ne=N(),he=ee.S;he!==null&&he(F,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(te,P)}catch(_e){P(_e)}finally{H!==null&&F.types!==null&&(H.types=F.types),ee.T=H}},Me.unstable_useCacheRefresh=function(){return ee.H.useCacheRefresh()},Me.use=function(N){return ee.H.use(N)},Me.useActionState=function(N,H,F){return ee.H.useActionState(N,H,F)},Me.useCallback=function(N,H){return ee.H.useCallback(N,H)},Me.useContext=function(N){return ee.H.useContext(N)},Me.useDebugValue=function(){},Me.useDeferredValue=function(N,H){return ee.H.useDeferredValue(N,H)},Me.useEffect=function(N,H){return ee.H.useEffect(N,H)},Me.useEffectEvent=function(N){return ee.H.useEffectEvent(N)},Me.useId=function(){return ee.H.useId()},Me.useImperativeHandle=function(N,H,F){return ee.H.useImperativeHandle(N,H,F)},Me.useInsertionEffect=function(N,H){return ee.H.useInsertionEffect(N,H)},Me.useLayoutEffect=function(N,H){return ee.H.useLayoutEffect(N,H)},Me.useMemo=function(N,H){return ee.H.useMemo(N,H)},Me.useOptimistic=function(N,H){return ee.H.useOptimistic(N,H)},Me.useReducer=function(N,H,F){return ee.H.useReducer(N,H,F)},Me.useRef=function(N){return ee.H.useRef(N)},Me.useState=function(N){return ee.H.useState(N)},Me.useSyncExternalStore=function(N,H,F){return ee.H.useSyncExternalStore(N,H,F)},Me.useTransition=function(){return ee.H.useTransition()},Me.version="19.2.4",Me}var Tp;function bo(){return Tp||(Tp=1,Lu.exports=M0()),Lu.exports}var b=bo();const Nr=o0(b),A0=i0({__proto__:null,default:Nr},[b]),k0=(n,l,s,i)=>{const o=[s,{code:l,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);Rl(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},zp={},Vg=(n,l,s,i)=>{Rl(s)&&zp[s]||(Rl(s)&&(zp[s]=new Date),k0(n,l,s,i))},Kg=(n,l)=>()=>{if(n.isInitialized)l();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),l()};n.on("initialized",s)}},nd=(n,l,s)=>{n.loadNamespaces(l,Kg(n,s))},Op=(n,l,s,i)=>{if(Rl(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(l)>-1)return nd(n,s,i);s.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(l,Kg(n,i))},L0=(n,l,s={})=>!l.languages||!l.languages.length?(Vg(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:s.lng,precheck:(i,o)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),Rl=n=>typeof n=="string",U0=n=>typeof n=="object"&&n!==null,H0=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,B0={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},q0=n=>B0[n],$0=n=>n.replace(H0,q0);let ld={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:$0,transDefaultProps:void 0};const Y0=(n={})=>{ld={...ld,...n}},G0=()=>ld;let Xg;const V0=n=>{Xg=n},K0=()=>Xg,X0={type:"3rdParty",init(n){Y0(n.options.react),V0(n)}},Q0=b.createContext();class Z0{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Uu={exports:{}},Hu={};var Dp;function F0(){if(Dp)return Hu;Dp=1;var n=bo();function l(y,_){return y===_&&(y!==0||1/y===1/_)||y!==y&&_!==_}var s=typeof Object.is=="function"?Object.is:l,i=n.useState,o=n.useEffect,u=n.useLayoutEffect,m=n.useDebugValue;function p(y,_){var j=_(),R=i({inst:{value:j,getSnapshot:_}}),z=R[0].inst,A=R[1];return u(function(){z.value=j,z.getSnapshot=_,g(z)&&A({inst:z})},[y,j,_]),o(function(){return g(z)&&A({inst:z}),y(function(){g(z)&&A({inst:z})})},[y]),m(j),j}function g(y){var _=y.getSnapshot;y=y.value;try{var j=_();return!s(y,j)}catch{return!0}}function h(y,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return Hu.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,Hu}var Mp;function J0(){return Mp||(Mp=1,Uu.exports=F0()),Uu.exports}var P0=J0();const W0=(n,l)=>Rl(l)?l:U0(l)&&Rl(l.defaultValue)?l.defaultValue:Array.isArray(n)?n[n.length-1]:n,I0={t:W0,ready:!1},ev=()=>()=>{},Te=(n,l={})=>{const{i18n:s}=l,{i18n:i,defaultNS:o}=b.useContext(Q0)||{},u=s||i||K0();u&&!u.reportNamespaces&&(u.reportNamespaces=new Z0),u||Vg(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const m=b.useMemo(()=>({...G0(),...u?.options?.react,...l}),[u,l]),{useSuspense:p,keyPrefix:g}=m,h=o||u?.options?.defaultNS,v=Rl(h)?[h]:h||["translation"],y=b.useMemo(()=>v,v);u?.reportNamespaces?.addUsedNamespaces?.(y);const _=b.useRef(0),j=b.useCallback(q=>{if(!u)return ev;const{bindI18n:Z,bindI18nStore:de}=m,se=()=>{_.current+=1,q()};return Z&&u.on(Z,se),de&&u.store.on(de,se),()=>{Z&&Z.split(" ").forEach(ye=>u.off(ye,se)),de&&de.split(" ").forEach(ye=>u.store.off(ye,se))}},[u,m]),R=b.useRef(),z=b.useCallback(()=>{if(!u)return I0;const q=!!(u.isInitialized||u.initializedStoreOnce)&&y.every(ie=>L0(ie,u,m)),Z=l.lng||u.language,de=_.current,se=R.current;if(se&&se.ready===q&&se.lng===Z&&se.keyPrefix===g&&se.revision===de)return se;const ae={t:u.getFixedT(Z,m.nsMode==="fallback"?y:y[0],g),ready:q,lng:Z,keyPrefix:g,revision:de};return R.current=ae,ae},[u,y,g,m,l.lng]),[A,X]=b.useState(0),{t:Q,ready:V}=P0.useSyncExternalStore(j,z,z);b.useEffect(()=>{if(u&&!V&&!p){const q=()=>X(Z=>Z+1);l.lng?Op(u,l.lng,y,q):nd(u,y,q)}},[u,l.lng,y,V,p,A]);const G=u||{},Y=b.useRef(null),te=b.useRef(),ee=q=>{const Z=Object.getOwnPropertyDescriptors(q);Z.__original&&delete Z.__original;const de=Object.create(Object.getPrototypeOf(q),Z);if(!Object.prototype.hasOwnProperty.call(de,"__original"))try{Object.defineProperty(de,"__original",{value:q,writable:!1,enumerable:!1,configurable:!1})}catch{}return de},w=b.useMemo(()=>{const q=G,Z=q?.language;let de=q;q&&(Y.current&&Y.current.__original===q?te.current!==Z?(de=ee(q),Y.current=de,te.current=Z):de=Y.current:(de=ee(q),Y.current=de,te.current=Z));const se=[Q,de,V];return se.t=Q,se.i18n=de,se.ready=V,se},[Q,G,V,G.resolvedLanguage,G.language,G.languages]);if(u&&p&&!V)throw new Promise(q=>{const Z=()=>q();l.lng?Op(u,l.lng,y,Z):nd(u,y,Z)});return w},{slice:tv,forEach:av}=[];function nv(n){return av.call(tv.call(arguments,1),l=>{if(l)for(const s in l)n[s]===void 0&&(n[s]=l[s])}),n}function lv(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(s=>s.test(n))}const Ap=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rv=function(n,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(l);let u=`${n}=${o}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");u+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Ap.test(i.domain))throw new TypeError("option domain is invalid");u+=`; Domain=${i.domain}`}if(i.path){if(!Ap.test(i.path))throw new TypeError("option path is invalid");u+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");u+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(u+="; HttpOnly"),i.secure&&(u+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(u+="; Partitioned"),u},kp={create(n,l,s,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};s&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+s*60*1e3)),i&&(o.domain=i),document.cookie=rv(n,l,o)},read(n){const l=`${n}=`,s=document.cookie.split(";");for(let i=0;i<s.length;i++){let o=s[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(l)===0)return o.substring(l.length,o.length)}return null},remove(n,l){this.create(n,"",-1,l)}};var sv={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return kp.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:s,cookieMinutes:i,cookieDomain:o,cookieOptions:u}=l;s&&typeof document<"u"&&kp.create(s,n,i,o,u)}},iv={name:"querystring",lookup(n){let{lookupQuerystring:l}=n,s;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const u=i.substring(1).split("&");for(let m=0;m<u.length;m++){const p=u[m].indexOf("=");p>0&&u[m].substring(0,p)===l&&(s=u[m].substring(p+1))}}return s}},ov={name:"hash",lookup(n){let{lookupHash:l,lookupFromHashIndex:s}=n,i;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const u=o.substring(1);if(l){const m=u.split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===l&&(i=m[p].substring(g+1))}}if(i)return i;if(!i&&s>-1){const m=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(m)?m[typeof s=="number"?s:0]?.replace("/",""):void 0}}}return i}};let vr=null;const Lp=()=>{if(vr!==null)return vr;try{if(vr=typeof window<"u"&&window.localStorage!==null,!vr)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{vr=!1}return vr};var cv={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&Lp())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:s}=l;s&&Lp()&&window.localStorage.setItem(s,n)}};let Sr=null;const Up=()=>{if(Sr!==null)return Sr;try{if(Sr=typeof window<"u"&&window.sessionStorage!==null,!Sr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Sr=!1}return Sr};var uv={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&Up())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:s}=l;s&&Up()&&window.sessionStorage.setItem(s,n)}},dv={name:"navigator",lookup(n){const l=[];if(typeof navigator<"u"){const{languages:s,userLanguage:i,language:o}=navigator;if(s)for(let u=0;u<s.length;u++)l.push(s[u]);i&&l.push(i),o&&l.push(o)}return l.length>0?l:void 0}},fv={name:"htmlTag",lookup(n){let{htmlTag:l}=n,s;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(s=i.getAttribute("lang")),s}},mv={name:"path",lookup(n){let{lookupFromPathIndex:l}=n;if(typeof window>"u")return;const s=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof l=="number"?l:0]?.replace("/",""):void 0}},hv={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:l}=n;const s=typeof l=="number"?l+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[s]}};let Qg=!1;try{document.cookie,Qg=!0}catch{}const Zg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Qg||Zg.splice(1,1);const pv=()=>({order:Zg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Fg{constructor(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,s)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=nv(s,this.options||{},pv()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(sv),this.addDetector(iv),this.addDetector(cv),this.addDetector(uv),this.addDetector(dv),this.addDetector(fv),this.addDetector(mv),this.addDetector(hv),this.addDetector(ov)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,s=[];return l.forEach(i=>{if(this.detectors[i]){let o=this.detectors[i].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(s=s.concat(o))}}),s=s.filter(i=>i!=null&&!lv(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?s:s.length>0?s[0]:null}cacheUserLanguage(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;s&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||s.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(l,this.options)}))}}Fg.type="languageDetector";const gv={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub · @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. All rights reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management.","page.docs.title":"Docs","page.docs.description":"Public documentation portal.","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index.","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI — only what stands up to scrutiny gets written to the knowledge graph.","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here — browse, search, analyze, and use it anytime.","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain.","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly.","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains — get notified on updates, no manual transfer needed.","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration.","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling.","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling.","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results.","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph.","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.library.default_cloud_name":"Personal Cloud","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.status.go_index":"Index","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain.","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge.","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Select Version","sources.import.step.confirm":"Confirm Import","sources.import.daemon_offline":"Client {{name}} is not connected. Please start the local Daemon and connect to the server before importing.","sources.import.view_guide":"View Connection Guide","sources.import.select_root":"Select repository root directory","sources.import.current_path":"Current path","sources.import.not_git":"This directory is not a Git repository. Please select a directory containing .git.","sources.import.branch":"Branch","sources.import.commit":"Commit","sources.import.branch_warning":"Currently based on {{branch}} branch HEAD","sources.import.uncommitted_warning":"Uncommitted changes will not be collected","sources.import.recognized":"Recognized {{packages}} packages and {{docs}} documents","sources.import.no_packages":"No package structure detected. Will be imported as a single-package repository.","sources.import.confirm_heading":"About to import the following repository to {{name}}:","sources.import.packages":"Packages","sources.import.documents":"Documents","sources.import.loading_repo":"Loading repository info...","sources.import.loading_repo_slow":"Large repositories (>10 GB) may take 5–10 seconds...","sources.import.importing":"Importing...","sources.import.error_title":"Import Failed","sources.import.success":"Import complete","sources.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory path…","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Repositories (skipped)","sources.import.dir_git_hint":"Git repositories inside the directory will not be expanded for indexing. Import them separately if needed.","sources.import.dir_scanning":"Scanning directory contents...","sources.import.dir_scan_complete":"Scan complete","sources.import.dir_scan_error":"Failed to scan directory","sources.import.dir_scan_retry":"Retry","sources.import.dir_code_packages":"Code Packages","sources.import.dir_code_packages_tip":"Supported: package.json, pyproject.toml, setup.py, go.mod, Cargo.toml, pom.xml, build.gradle","sources.import.dir_doc_files":"Documents","sources.import.dir_doc_files_tip":"Supported: Markdown (.md)","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"Git repos are skipped. Use 'Import Repository' instead.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown Document","sources.actions.upload_doc":"Document","sources.actions.add":"Add","sources.actions.add_folder":"Folder","sources.actions.add_web":"Web Page","sources.actions.add_feishu":"Feishu Document","sources.actions.import_dir":"Import Directory","sources.actions.import_repo_url":"Import Repository","sources.upgrade.title":"Feature Upgrading","sources.upgrade.description":"This feature will be available in version 0.5.x. Stay tuned.","sources.upload.title":"Upload Documents","sources.upload.drop_hint":"Click to select or drag files here","sources.upload.supported_formats":"Supported: .md, .doc, .docx, .pdf, .ppt, .pptx, .txt (max 5MB each, up to 10 files)","sources.upload.file_too_large":'"{{name}}" exceeds 5MB limit',"sources.upload.too_many_files":"Maximum 10 files allowed, please re-select","sources.upload.unsupported_type":'"{{name}}" is not a supported file type',"sources.upload.uploading":"Uploading...","sources.upload.success":"Uploaded {{count}} documents","sources.upload.selected":"{{count}} files selected","sources.upload.remove":"Remove","sources.import_remote.title":"Import Remote Repository","sources.import_remote.step.loading":"Data Loading","sources.import_remote.url_label":"Repository URL","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"Only HTTPS URLs are accepted. SSH support is planned for a future release","sources.import_remote.url_hint_public":"Supports public Git repositories without authentication, and Git services with OAuth configured: ","sources.import_remote.url_hint_no_auth":"Supports public Git repositories and Git services with OAuth configured","sources.import_remote.url_invalid":"Only HTTPS Git URLs are supported","sources.import_remote.ref_label":"Branch / Tag","sources.import_remote.ref_branches":"Branches","sources.import_remote.ref_tags":"Tags","sources.import_remote.ref_search":"Search branches or tags…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"Auto-filled with the latest commit of selected branch. You can also type or search","sources.import_remote.commit_search":"Search commit…","sources.import_remote.loading_refs":"Querying repository branches...","sources.import_remote.summary_repo":"Repository","sources.import_remote.summary_branch":"Branch","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"Preparing environment","sources.import_remote.stage.clone":"Cloning repository","sources.import_remote.stage.scan":"Scanning project","sources.import_remote.stage.save":"Saving sources","sources.import_remote.complete":"Import complete","sources.import_remote.back_to_library":"Back to Sources","sources.import_remote.retry":"Retry","sources.import_remote.back":"Back","sources.import_remote.error.auth_required":"This repository requires authentication. Please configure an access token for {{host}} in Server Settings → Git Tokens.","sources.import_remote.error.auth_failed":"Authentication failed. Please check your Git token configuration.","sources.import_remote.error.not_found":"Repository not found or no access. Please check the URL.","sources.import_remote.error.network":"Cannot connect to the remote repository. Please check your network or try again later.","sources.import_remote.error.capacity":"Import queue is full. Please try again later.","sources.import_remote.error.clone_failed":"Clone failed","sources.import_remote.error.scan_failed":"Scan failed","sources.import_remote.error.save_failed":"Save failed","sources.change_detection.has_updates":"Has updates","sources.change_detection.reimport":"Re-import","sources.safety.notice.remote":"The remote repository will be cloned to the server for analysis. Code will not be uploaded to any third-party services."},xv={"nav.home":"首页","nav.studio":"工作台","nav.docs":"文档","nav.login":"登录","nav.logout":"退出登录","header.status.connected":"已连接","header.status.disconnected":"已断开","header.status.reconnecting":"重连中","footer.copyright":"GitHub · @Context4AI {{year}}. 版权所有","footer.copyright_compact":"@Context4AI {{year}}. 版权所有","footer.tagline":"知识工厂","footer.theme.dark":"暗色","footer.theme.light":"亮色","footer.theme.system":"跟随系统","studio.sidebar.sources":"知识索引","studio.sidebar.modeling":"知识建模","studio.sidebar.brain":"知识大脑","studio.sidebar.discovery":"发现知识","studio.sidebar.sharing":"分享知识","studio.sidebar.collaboration":"知识协同","studio.sidebar.settings":"设置","placeholder.coming":"计划在 {{version}} 版本实现","page.login.title":"登录","page.login.description":"身份验证与用户管理。","page.docs.title":"文档","page.docs.description":"公开文档门户。","page.sources.title":"知识索引","page.sources.description":"添加代码仓库、文档等输入材料,让大脑完成初步索引。","page.modeling.title":"知识建模","page.modeling.description":"和 AI 一起对索引内容建模,只有经得起推敲的才写入知识图谱。","page.brain.title":"知识大脑","page.brain.description":"建模完成的全部知识都在这里——浏览、搜索、分析,随时调用。","page.discovery.title":"发现知识","page.discovery.description":"看看别人整理好的知识,发现有用的一键补充到自己的大脑。","page.sharing.title":"分享知识","page.sharing.description":"把大脑中的知识打包输出,让别人和 AI 都能直接使用。","page.collaboration.title":"知识协同","page.collaboration.description":"和其他大脑保持同步,知识更新时自动通知,不用手动搬运。","page.settings.title":"设置","page.settings.description":"管理大脑的成员和配置。","page.code_setup.title":"代码设置","page.code_setup.description":"代码建模的仓库选择与配置。","page.code_compile.title":"代码编译","page.code_compile.description":"代码建模的编译进度追踪。","page.code_review.title":"代码审查","page.code_review.description":"审查并确认建模结果。","page.code_result.title":"代码结果","page.code_result.description":"查看最终建模结果与生成的知识图谱。","home.hero.title":"Context For AI","home.hero.description":"将代码仓库和业务文档转化为结构化知识图谱。","home.hero.cta.studio":"进入工作台","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"您访问的页面不存在。","notfound.back":"返回首页","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.library.default_cloud_name":"个人云","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"有新变更未更新索引","sources.status.go_index":"去索引","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础。","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识。","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"选择版本","sources.import.step.confirm":"确认导入","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.loading_repo":"正在加载仓库信息...","sources.import.loading_repo_slow":"大型仓库(>10 GB)可能需要 5~10 秒...","sources.import.importing":"导入中...","sources.import.error_title":"导入失败","sources.import.success":"导入完成","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step3":"等待连接","sources.add_client.step3_desc":"连接成功后,本页面将自动更新。","sources.add_client.waiting":"等待新的客户端连接...","sources.add_client.detected":"检测到新的本地客户端","sources.add_client.machine_name":"机器标识","sources.add_client.os":"操作系统","sources.add_client.daemon_version":"Daemon 版本","sources.add_client.client_name":"客户端名称","sources.add_client.confirm":"确认添加","sources.add_client.reconnected":"客户端 {{name}} 已重新连接","sources.add_client.go_to":"前往 {{name}}","sources.detail.tab.original":"原文","sources.detail.tab.overview":"概览","sources.detail.tab.digest":"摘要","sources.detail.tab.modeling":"建模结果","sources.detail.digest_placeholder":"完成索引后,即可在此查看结构化摘要。","sources.detail.modeling_placeholder":"在推演区完成建模后,此处将展示由该源产生的知识实体。","sources.detail.type":"类型","sources.detail.origin":"来源","sources.detail.origin.upload":"直接上传","sources.detail.origin.local":"本地文件","sources.detail.path":"路径","sources.detail.status":"状态","sources.detail.repo":"仓库","sources.detail.branch":"分支","sources.detail.commit":"提交","sources.detail.tech_stack":"技术栈","sources.detail.original_code_placeholder":"完成索引后即可查看包概览。","sources.detail.original_doc_placeholder":"文档内容将在上传后展示。","sources.detail.dependencies":"依赖","sources.delete.confirm_title":"确认删除","sources.delete.resource":"确定要删除 {{name}}?","sources.delete.resource_impact":"以下数据将被永久删除:原文内容、结构化摘要(如有)。","sources.delete.session_warning":"如果你的个人推演区正在使用此知识源,相关的候选推演将受到影响。","sources.delete.entity_safe":"已汇入大脑的正式知识不受影响。","sources.delete.folder":"确定要删除文件夹 {{name}}?","sources.delete.folder_impact":"文件夹内的所有资源将被递归删除:{{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_contents":"包含 {{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","sources.delete.repo_contents":"包含 {{packages}} 个包、{{docs}} 个文档。","sources.delete.indexed_hint":"其中 {{indexed}}/{{total}} 个已建立索引,索引数据将被删除。","sources.delete.repo_impact_generic":"所有包和文档的索引记录将被删除。","sources.delete.local_safe":"本地文件不受影响。","sources.delete.client":"确定要删除客户端 {{name}}?","sources.delete.client_impact":"该客户端下的所有已导入仓库记录和相关索引数据将被删除。","sources.delete.client_reregister":"该客户端下次连接时将触发重新注册。","sources.error.name_conflict":'该目录下已存在同名项"{{name}}"。',"sources.move.current":"当前位置","sources.move.target":"移动到","sources.breadcrumb.sources":"知识索引","common.cancel":"取消","common.confirm":"确认","common.back":"返回","common.next":"下一步","common.previous":"上一步","common.items":"{{count}} 项","common.loading":"加载中...","sources.import.no_entries":"未找到任何条目","sources.import.allowed_dirs":"客户端授权目录","sources.import.allowed_dirs_tooltip_restrict":"通过参数设定有权限的目录:","sources.import.allowed_dirs_tooltip_all":"或默认允许全部目录:","sources.import.wildcard_home":"主目录","sources.import.wildcard_path_placeholder":"输入目录路径…","sources.import.wildcard_go":"前往","sources.import.wildcard_goto":"前往","sources.import.wildcard_go_title":"前往目录","sources.import.wildcard_path_not_found":"该路径在远程机器上不存在","sources.import.already_imported":"已导入","sources.import.dir_title":"导入目录","sources.import.dir_step.select":"选择目录","sources.import.dir_step.scan":"扫描","sources.import.dir_step.confirm":"确认导入","sources.import.dir_confirm_heading":"即将导入以下目录到 {{name}}:","sources.import.dir_name":"目录名","sources.import.dir_path":"目录路径","sources.import.dir_files":"文件数","sources.import.dir_subdirs":"子目录数","sources.import.dir_git_repos":"仓库(已跳过)","sources.import.dir_git_hint":"目录内的 Git 仓库不会被展开索引,如需索引请单独导入仓库。","sources.import.dir_scanning":"正在扫描目录内容...","sources.import.dir_scan_complete":"扫描完成","sources.import.dir_scan_error":"目录扫描失败","sources.import.dir_scan_retry":"重试","sources.import.dir_code_packages":"代码包","sources.import.dir_code_packages_tip":"支持:package.json、pyproject.toml、setup.py、go.mod、Cargo.toml、pom.xml、build.gradle","sources.import.dir_doc_files":"文档","sources.import.dir_doc_files_tip":"支持:Markdown (.md)","sources.import.dir_total_files":"文件总数","sources.import.dir_total_dirs":"目录","sources.import.dir_git_skip_hint":"Git 仓库将被跳过,建议单独使用「导入仓库」。","sources.actions.upload":"上传","sources.actions.upload_md":"Markdown 文档","sources.actions.upload_doc":"文档","sources.actions.add":"新增","sources.actions.add_folder":"文件夹","sources.actions.add_web":"网页","sources.actions.add_feishu":"飞书文档","sources.actions.import_dir":"导入目录","sources.actions.import_repo_url":"导入仓库","sources.upgrade.title":"功能升级中","sources.upgrade.description":"此功能将在 0.5.x 版本中推出,敬请期待。","sources.upload.title":"上传文档","sources.upload.drop_hint":"点击选择文件或拖拽至此","sources.upload.supported_formats":"支持格式:.md, .doc, .docx, .pdf, .ppt, .pptx, .txt(每个最大 5MB,最多 10 个)","sources.upload.file_too_large":'"{{name}}" 超过 5MB 限制',"sources.upload.too_many_files":"最多上传 10 个文件,请重新选择","sources.upload.unsupported_type":'"{{name}}" 不是支持的文件类型',"sources.upload.uploading":"上传中...","sources.upload.success":"已上传 {{count}} 个文档","sources.upload.selected":"已选择 {{count}} 个文件","sources.upload.remove":"移除","sources.import_remote.title":"导入远程仓库","sources.import_remote.step.loading":"数据载入","sources.import_remote.url_label":"仓库地址","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"仅接受 HTTPS 地址,SSH 地址未来版本支持","sources.import_remote.url_hint_public":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务:","sources.import_remote.url_hint_no_auth":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务","sources.import_remote.url_invalid":"仅支持 HTTPS 格式的 Git URL","sources.import_remote.ref_label":"分支 / Tag","sources.import_remote.ref_branches":"分支","sources.import_remote.ref_tags":"Tag","sources.import_remote.ref_search":"搜索分支或 Tag…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"已自动填入所选分支最新 commit,也可手动输入或搜索","sources.import_remote.commit_search":"搜索 commit…","sources.import_remote.loading_refs":"正在查询仓库分支...","sources.import_remote.summary_repo":"仓库","sources.import_remote.summary_branch":"分支","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"准备执行环境","sources.import_remote.stage.clone":"克隆仓库","sources.import_remote.stage.scan":"识别项目结构","sources.import_remote.stage.save":"写入知识源","sources.import_remote.complete":"导入完成","sources.import_remote.back_to_library":"返回知识索引","sources.import_remote.retry":"重试","sources.import_remote.back":"返回","sources.import_remote.error.auth_required":"该仓库需要认证。请在 服务设置 → Git 令牌 中配置 {{host}} 的访问令牌。","sources.import_remote.error.auth_failed":"认证失败,请检查 Git 令牌配置。","sources.import_remote.error.not_found":"仓库不存在或无权访问。请检查 URL 是否正确。","sources.import_remote.error.network":"无法连接到远程仓库。请检查网络或稍后重试。","sources.import_remote.error.capacity":"当前导入任务已满,请稍后再试。","sources.import_remote.error.clone_failed":"克隆失败","sources.import_remote.error.scan_failed":"识别失败","sources.import_remote.error.save_failed":"写入失败","sources.change_detection.has_updates":"有更新","sources.change_detection.reimport":"重新导入","sources.safety.notice.remote":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。"};aa.use(Fg).use(X0).init({resources:{en:{translation:gv},zh:{translation:xv}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Bu={exports:{}},Ss={},qu={exports:{}},$u={};var Hp;function yv(){return Hp||(Hp=1,(function(n){function l(M,W){var ce=M.length;M.push(W);e:for(;0<ce;){var P=ce-1>>>1,be=M[P];if(0<o(be,W))M[P]=W,M[ce]=be,ce=P;else break e}}function s(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var W=M[0],ce=M.pop();if(ce!==W){M[0]=ce;e:for(var P=0,be=M.length,N=be>>>1;P<N;){var H=2*(P+1)-1,F=M[H],ne=H+1,he=M[ne];if(0>o(F,ce))ne<be&&0>o(he,F)?(M[P]=he,M[ne]=ce,P=ne):(M[P]=F,M[H]=ce,P=H);else if(ne<be&&0>o(he,ce))M[P]=he,M[ne]=ce,P=ne;else break e}}return W}function o(M,W){var ce=M.sortIndex-W.sortIndex;return ce!==0?ce:M.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var g=[],h=[],v=1,y=null,_=3,j=!1,R=!1,z=!1,A=!1,X=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function G(M){for(var W=s(h);W!==null;){if(W.callback===null)i(h);else if(W.startTime<=M)i(h),W.sortIndex=W.expirationTime,l(g,W);else break;W=s(h)}}function Y(M){if(z=!1,G(M),!R)if(s(g)!==null)R=!0,te||(te=!0,se());else{var W=s(h);W!==null&&ie(Y,W.startTime-M)}}var te=!1,ee=-1,w=5,q=-1;function Z(){return A?!0:!(n.unstable_now()-q<w)}function de(){if(A=!1,te){var M=n.unstable_now();q=M;var W=!0;try{e:{R=!1,z&&(z=!1,Q(ee),ee=-1),j=!0;var ce=_;try{t:{for(G(M),y=s(g);y!==null&&!(y.expirationTime>M&&Z());){var P=y.callback;if(typeof P=="function"){y.callback=null,_=y.priorityLevel;var be=P(y.expirationTime<=M);if(M=n.unstable_now(),typeof be=="function"){y.callback=be,G(M),W=!0;break t}y===s(g)&&i(g),G(M)}else i(g);y=s(g)}if(y!==null)W=!0;else{var N=s(h);N!==null&&ie(Y,N.startTime-M),W=!1}}break e}finally{y=null,_=ce,j=!1}W=void 0}}finally{W?se():te=!1}}}var se;if(typeof V=="function")se=function(){V(de)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,ae=ye.port2;ye.port1.onmessage=de,se=function(){ae.postMessage(null)}}else se=function(){X(de,0)};function ie(M,W){ee=X(function(){M(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<M?Math.floor(1e3/M):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(M){switch(_){case 1:case 2:case 3:var W=3;break;default:W=_}var ce=_;_=W;try{return M()}finally{_=ce}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(M,W){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ce=_;_=M;try{return W()}finally{_=ce}},n.unstable_scheduleCallback=function(M,W,ce){var P=n.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?P+ce:P):ce=P,M){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=ce+be,M={id:v++,callback:W,priorityLevel:M,startTime:ce,expirationTime:be,sortIndex:-1},ce>P?(M.sortIndex=ce,l(h,M),s(g)===null&&M===s(h)&&(z?(Q(ee),ee=-1):z=!0,ie(Y,ce-P))):(M.sortIndex=be,l(g,M),R||j||(R=!0,te||(te=!0,se()))),M},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(M){var W=_;return function(){var ce=_;_=W;try{return M.apply(this,arguments)}finally{_=ce}}}})($u)),$u}var Bp;function bv(){return Bp||(Bp=1,qu.exports=yv()),qu.exports}var Yu={exports:{}},Wt={};var qp;function vv(){if(qp)return Wt;qp=1;var n=bo();function l(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(g,h,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:g,containerInfo:h,implementation:v}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Wt.createPortal=function(g,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return u(g,h,null,v)},Wt.flushSync=function(g){var h=m.T,v=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=v,i.d.f()}},Wt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(g,h))},Wt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Wt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var v=h.as,y=p(v,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:_,fetchPriority:j}):v==="script"&&i.d.X(g,{crossOrigin:y,integrity:_,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Wt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=p(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},Wt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,y=p(v,h.crossOrigin);i.d.L(g,v,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Wt.preloadModule=function(g,h){if(typeof g=="string")if(h){var v=p(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},Wt.requestFormReset=function(g){i.d.r(g)},Wt.unstable_batchedUpdates=function(g,h){return g(h)},Wt.useFormState=function(g,h,v){return m.H.useFormState(g,h,v)},Wt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Wt.version="19.2.4",Wt}var $p;function Sv(){if($p)return Yu.exports;$p=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Yu.exports=vv(),Yu.exports}var Yp;function _v(){if(Yp)return Ss;Yp=1;var n=bv(),l=bo(),s=Sv();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(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 p(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 g(e){if(u(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,r=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(r=c.return,r!==null){a=r;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return g(c),e;if(d===r)return g(c),t;d=d.sibling}throw Error(i(188))}if(a.return!==r.return)a=c,r=d;else{for(var x=!1,S=c.child;S;){if(S===a){x=!0,a=c,r=d;break}if(S===r){x=!0,r=c,a=d;break}S=S.sibling}if(!x){for(S=d.child;S;){if(S===a){x=!0,a=d,r=c;break}if(S===r){x=!0,r=d,a=c;break}S=S.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==r)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),V=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case z:return"Fragment";case X:return"Profiler";case A:return"StrictMode";case Y:return"Suspense";case te:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case V:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ee:return t=e.displayName||null,t!==null?t:ae(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var ie=Array.isArray,M=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},P=[],be=-1;function N(e){return{current:e}}function H(e){0>be||(e.current=P[be],P[be]=null,be--)}function F(e,t){be++,P[be]=e.current,e.current=t}var ne=N(null),he=N(null),_e=N(null),ze=N(null);function Ze(e,t){switch(F(_e,t),F(he,e),F(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lh(t),e=Uh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ne),F(ne,e)}function Ue(){H(ne),H(he),H(_e)}function na(e){e.memoizedState!==null&&F(ze,e);var t=ne.current,a=Uh(t,e.type);t!==a&&(F(he,e),F(ne,a))}function Ft(e){he.current===e&&(H(ne),H(he)),ze.current===e&&(H(ze),ps._currentValue=ce)}var nt,Ge;function xt(e){if(nt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);nt=t&&t[1]||"",Ge=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+nt+e+Ge}var Tt=!1;function la(e,t){if(!e||Tt)return"";Tt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch($){var U=$}Reflect.construct(e,[],I)}else{try{I.call()}catch($){U=$}e.call(I.prototype)}}else{try{throw Error()}catch($){U=$}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch($){if($&&U&&typeof $.stack=="string")return[$.stack,U.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),x=d[0],S=d[1];if(x&&S){var E=x.split(`
|
|
4
|
+
`),L=S.split(`
|
|
5
|
+
`);for(c=r=0;r<E.length&&!E[r].includes("DetermineComponentFrameRoot");)r++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(r===E.length||c===L.length)for(r=E.length-1,c=L.length-1;1<=r&&0<=c&&E[r]!==L[c];)c--;for(;1<=r&&0<=c;r--,c--)if(E[r]!==L[c]){if(r!==1||c!==1)do if(r--,c--,0>c||E[r]!==L[c]){var K=`
|
|
6
|
+
`+E[r].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=r&&0<=c);break}}}finally{Tt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?xt(a):""}function Jt(e,t){switch(e.tag){case 26:case 27:case 5:return xt(e.type);case 16:return xt("Lazy");case 13:return e.child!==t&&t!==null?xt("Suspense Fallback"):xt("Suspense");case 19:return xt("SuspenseList");case 0:case 15:return la(e.type,!1);case 11:return la(e.type.render,!1);case 1:return la(e.type,!0);case 31:return xt("Activity");default:return""}}function Za(e){try{var t="",a=null;do t+=Jt(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var ja=Object.prototype.hasOwnProperty,Na=n.unstable_scheduleCallback,Ce=n.unstable_cancelCallback,Pe=n.unstable_shouldYield,pe=n.unstable_requestPaint,Oe=n.unstable_now,Ve=n.unstable_getCurrentPriorityLevel,ct=n.unstable_ImmediatePriority,Yt=n.unstable_UserBlockingPriority,Ht=n.unstable_NormalPriority,bt=n.unstable_LowPriority,ra=n.unstable_IdlePriority,kl=n.log,Or=n.unstable_setDisableYieldValue,Ba=null,Gt=null;function zt(e){if(typeof kl=="function"&&Or(e),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(Ba,e)}catch{}}var Bt=Math.clz32?Math.clz32:ue,Ll=Math.log,Ul=Math.LN2;function ue(e){return e>>>=0,e===0?32:31-(Ll(e)/Ul|0)|0}var we=256,tt=262144,St=4194304;function Je(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 sn(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var c=0,d=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=r&134217727;return S!==0?(r=S&~d,r!==0?c=Je(r):(x&=S,x!==0?c=Je(x):a||(a=S&~e,a!==0&&(c=Je(a))))):(S=r&~d,S!==0?c=Je(S):x!==0?c=Je(x):a||(a=r&~e,a!==0&&(c=Je(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function qa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ll(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 rl(){var e=St;return St<<=1,(St&62914560)===0&&(St=4194304),e}function Fa(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ja(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $s(e,t,a,r,c,d){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var S=e.entanglements,E=e.expirationTimes,L=e.hiddenUpdates;for(a=x&~a;0<a;){var K=31-Bt(a),I=1<<K;S[K]=0,E[K]=-1;var U=L[K];if(U!==null)for(L[K]=null,K=0;K<U.length;K++){var $=U[K];$!==null&&($.lane&=-536870913)}a&=~I}r!==0&&Ys(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(x&~t))}function Ys(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Bt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Gs(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Bt(a),c=1<<r;c&t|e[r]&t&&(e[r]|=t),a&=~c}}function C(e,t){var a=t&-t;return a=(a&42)!==0?1:O(a),(a&(e.suspendedLanes|t))!==0?0:a}function O(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 B(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function le(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:sp(e.type))}function re(e,t){var a=W.p;try{return W.p=e,t()}finally{W.p=a}}var ge=Math.random().toString(36).slice(2),oe="__reactFiber$"+ge,fe="__reactProps$"+ge,me="__reactContainer$"+ge,je="__reactEvents$"+ge,Ee="__reactListeners$"+ge,Se="__reactHandles$"+ge,We="__reactResources$"+ge,Be="__reactMarker$"+ge;function ut(e){delete e[oe],delete e[fe],delete e[je],delete e[Ee],delete e[Se]}function mt(e){var t=e[oe];if(t)return t;for(var a=e.parentNode;a;){if(t=a[me]||a[oe]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Vh(e);e!==null;){if(a=e[oe])return a;e=Vh(e)}return t}e=a,a=e.parentNode}return null}function _t(e){if(e=e[oe]||e[me]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Fe(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[We];return t||(t=e[We]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ft(e){e[Be]=!0}var Tn=new Set,$a={};function qt(e,t){Pa(e,t),Pa(e+"Capture",t)}function Pa(e,t){for($a[e]=t,e=0;e<t.length;e++)Tn.add(t[e])}var sl=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]*$"),Wa={},il={};function Hl(e){return ja.call(il,e)?!0:ja.call(Wa,e)?!1:sl.test(e)?il[e]=!0:(Wa[e]=!0,!1)}function qe(e,t,a){if(Hl(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Et(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Pt(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function Ot(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ht(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bl(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){a=""+x,d.call(this,x)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ql(e){if(!e._valueTracker){var t=ht(e)?"checked":"value";e._valueTracker=Bl(e,t,""+e[t])}}function Vs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=ht(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Ks(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 ty=/[\n"\\]/g;function wa(e){return e.replace(ty,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Eo(e,t,a,r,c,d,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ot(t)):e.value!==""+Ot(t)&&(e.value=""+Ot(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Co(e,x,Ot(t)):a!=null?Co(e,x,Ot(a)):r!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Ot(S):e.removeAttribute("name")}function Td(e,t,a,r,c,d,x,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){ql(e);return}a=a!=null?""+Ot(a):"",t=t!=null?""+Ot(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=S?e.checked:!!r,e.defaultChecked=!!r,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),ql(e)}function Co(e,t,a){t==="number"&&Ks(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function $l(e,t,a,r){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Ot(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function zd(e,t,a){if(t!=null&&(t=""+Ot(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ot(a):""}function Od(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=Ot(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),ql(e)}function Yl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ay=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 Dd(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||ay.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Md(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&a[c]!==r&&Dd(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&Dd(e,d,t[d])}function Ro(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 ny=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"]]),ly=/^[\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 Xs(e){return ly.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function on(){}var To=null;function zo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gl=null,Vl=null;function Ad(e){var t=_t(e);if(t&&(e=t.stateNode)){var a=e[fe]||null;e:switch(e=t.stateNode,t.type){case"input":if(Eo(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wa(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[fe]||null;if(!c)throw Error(i(90));Eo(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Vs(r)}break e;case"textarea":zd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&$l(e,!!a.multiple,t,!1)}}}var Oo=!1;function kd(e,t,a){if(Oo)return e(t,a);Oo=!0;try{var r=e(t);return r}finally{if(Oo=!1,(Gl!==null||Vl!==null)&&(Mi(),Gl&&(t=Gl,e=Vl,Vl=Gl=null,Ad(t),e)))for(t=0;t<e.length;t++)Ad(e[t])}}function Dr(e,t){var a=e.stateNode;if(a===null)return null;var r=a[fe]||null;if(r===null)return null;a=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var cn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Do=!1;if(cn)try{var Mr={};Object.defineProperty(Mr,"passive",{get:function(){Do=!0}}),window.addEventListener("test",Mr,Mr),window.removeEventListener("test",Mr,Mr)}catch{Do=!1}var zn=null,Mo=null,Qs=null;function Ld(){if(Qs)return Qs;var e,t=Mo,a=t.length,r,c="value"in zn?zn.value:zn.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(r=1;r<=x&&t[a-r]===c[d-r];r++);return Qs=c.slice(e,1<r?1-r:void 0)}function Zs(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 Fs(){return!0}function Ud(){return!1}function sa(e){function t(a,r,c,d,x){this._reactName=a,this._targetInst=c,this.type=r,this.nativeEvent=d,this.target=x,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(d):d[S]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Fs:Ud,this.isPropagationStopped=Ud,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Fs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Fs)},persist:function(){},isPersistent:Fs}),t}var ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Js=sa(ol),Ar=y({},ol,{view:0,detail:0}),ry=sa(Ar),Ao,ko,kr,Ps=y({},Ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uo,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!==kr&&(kr&&e.type==="mousemove"?(Ao=e.screenX-kr.screenX,ko=e.screenY-kr.screenY):ko=Ao=0,kr=e),Ao)},movementY:function(e){return"movementY"in e?e.movementY:ko}}),Hd=sa(Ps),sy=y({},Ps,{dataTransfer:0}),iy=sa(sy),oy=y({},Ar,{relatedTarget:0}),Lo=sa(oy),cy=y({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),uy=sa(cy),dy=y({},ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fy=sa(dy),my=y({},ol,{data:0}),Bd=sa(my),hy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},py={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"},gy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gy[e])?!!t[e]:!1}function Uo(){return xy}var yy=y({},Ar,{key:function(e){if(e.key){var t=hy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?py[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uo,charCode:function(e){return e.type==="keypress"?Zs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),by=sa(yy),vy=y({},Ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qd=sa(vy),Sy=y({},Ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uo}),_y=sa(Sy),jy=y({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ny=sa(jy),wy=y({},Ps,{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}),Ey=sa(wy),Cy=y({},ol,{newState:0,oldState:0}),Ry=sa(Cy),Ty=[9,13,27,32],Ho=cn&&"CompositionEvent"in window,Lr=null;cn&&"documentMode"in document&&(Lr=document.documentMode);var zy=cn&&"TextEvent"in window&&!Lr,$d=cn&&(!Ho||Lr&&8<Lr&&11>=Lr),Yd=" ",Gd=!1;function Vd(e,t){switch(e){case"keyup":return Ty.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kl=!1;function Oy(e,t){switch(e){case"compositionend":return Kd(t);case"keypress":return t.which!==32?null:(Gd=!0,Yd);case"textInput":return e=t.data,e===Yd&&Gd?null:e;default:return null}}function Dy(e,t){if(Kl)return e==="compositionend"||!Ho&&Vd(e,t)?(e=Ld(),Qs=Mo=zn=null,Kl=!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 $d&&t.locale!=="ko"?null:t.data;default:return null}}var My={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 Xd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!My[e.type]:t==="textarea"}function Qd(e,t,a,r){Gl?Vl?Vl.push(r):Vl=[r]:Gl=r,t=qi(t,"onChange"),0<t.length&&(a=new Js("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Ur=null,Hr=null;function Ay(e){zh(e,0)}function Ws(e){var t=Fe(e);if(Vs(t))return e}function Zd(e,t){if(e==="change")return t}var Fd=!1;if(cn){var Bo;if(cn){var qo="oninput"in document;if(!qo){var Jd=document.createElement("div");Jd.setAttribute("oninput","return;"),qo=typeof Jd.oninput=="function"}Bo=qo}else Bo=!1;Fd=Bo&&(!document.documentMode||9<document.documentMode)}function Pd(){Ur&&(Ur.detachEvent("onpropertychange",Wd),Hr=Ur=null)}function Wd(e){if(e.propertyName==="value"&&Ws(Hr)){var t=[];Qd(t,Hr,e,zo(e)),kd(Ay,t)}}function ky(e,t,a){e==="focusin"?(Pd(),Ur=t,Hr=a,Ur.attachEvent("onpropertychange",Wd)):e==="focusout"&&Pd()}function Ly(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ws(Hr)}function Uy(e,t){if(e==="click")return Ws(t)}function Hy(e,t){if(e==="input"||e==="change")return Ws(t)}function By(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fa=typeof Object.is=="function"?Object.is:By;function Br(e,t){if(fa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var c=a[r];if(!ja.call(t,c)||!fa(e[c],t[c]))return!1}return!0}function Id(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ef(e,t){var a=Id(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Id(a)}}function tf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function af(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ks(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ks(e.document)}return t}function $o(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 qy=cn&&"documentMode"in document&&11>=document.documentMode,Xl=null,Yo=null,qr=null,Go=!1;function nf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Go||Xl==null||Xl!==Ks(r)||(r=Xl,"selectionStart"in r&&$o(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qr&&Br(qr,r)||(qr=r,r=qi(Yo,"onSelect"),0<r.length&&(t=new Js("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Xl)))}function cl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ql={animationend:cl("Animation","AnimationEnd"),animationiteration:cl("Animation","AnimationIteration"),animationstart:cl("Animation","AnimationStart"),transitionrun:cl("Transition","TransitionRun"),transitionstart:cl("Transition","TransitionStart"),transitioncancel:cl("Transition","TransitionCancel"),transitionend:cl("Transition","TransitionEnd")},Vo={},lf={};cn&&(lf=document.createElement("div").style,"AnimationEvent"in window||(delete Ql.animationend.animation,delete Ql.animationiteration.animation,delete Ql.animationstart.animation),"TransitionEvent"in window||delete Ql.transitionend.transition);function ul(e){if(Vo[e])return Vo[e];if(!Ql[e])return e;var t=Ql[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in lf)return Vo[e]=t[a];return e}var rf=ul("animationend"),sf=ul("animationiteration"),of=ul("animationstart"),$y=ul("transitionrun"),Yy=ul("transitionstart"),Gy=ul("transitioncancel"),cf=ul("transitionend"),uf=new Map,Ko="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ko.push("scrollEnd");function Ya(e,t){uf.set(e,t),qt(t,[e])}var Is=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)},Ea=[],Zl=0,Xo=0;function ei(){for(var e=Zl,t=Xo=Zl=0;t<e;){var a=Ea[t];Ea[t++]=null;var r=Ea[t];Ea[t++]=null;var c=Ea[t];Ea[t++]=null;var d=Ea[t];if(Ea[t++]=null,r!==null&&c!==null){var x=r.pending;x===null?c.next=c:(c.next=x.next,x.next=c),r.pending=c}d!==0&&df(a,c,d)}}function ti(e,t,a,r){Ea[Zl++]=e,Ea[Zl++]=t,Ea[Zl++]=a,Ea[Zl++]=r,Xo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qo(e,t,a,r){return ti(e,t,a,r),ai(e)}function dl(e,t){return ti(e,null,null,t),ai(e)}function df(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,r=d.alternate,r!==null&&(r.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-Bt(a),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),d):null}function ai(e){if(50<os)throw os=0,au=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Fl={};function Vy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ma(e,t,a,r){return new Vy(e,t,a,r)}function Zo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function un(e,t){var a=e.alternate;return a===null?(a=ma(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function ff(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ni(e,t,a,r,c,d){var x=0;if(r=e,typeof e=="function")Zo(e)&&(x=1);else if(typeof e=="string")x=Fb(e,a,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=ma(31,a,t,c),e.elementType=q,e.lanes=d,e;case z:return fl(a.children,c,d,t);case A:x=8,c|=24;break;case X:return e=ma(12,a,t,c|2),e.elementType=X,e.lanes=d,e;case Y:return e=ma(13,a,t,c),e.elementType=Y,e.lanes=d,e;case te:return e=ma(19,a,t,c),e.elementType=te,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:x=10;break e;case Q:x=9;break e;case G:x=11;break e;case ee:x=14;break e;case w:x=16,r=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=ma(x,a,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function fl(e,t,a,r){return e=ma(7,e,r,t),e.lanes=a,e}function Fo(e,t,a){return e=ma(6,e,null,t),e.lanes=a,e}function mf(e){var t=ma(18,null,null,0);return t.stateNode=e,t}function Jo(e,t,a){return t=ma(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hf=new WeakMap;function Ca(e,t){if(typeof e=="object"&&e!==null){var a=hf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Za(t)},hf.set(e,t),t)}return{value:e,source:t,stack:Za(t)}}var Jl=[],Pl=0,li=null,$r=0,Ra=[],Ta=0,On=null,Ia=1,en="";function dn(e,t){Jl[Pl++]=$r,Jl[Pl++]=li,li=e,$r=t}function pf(e,t,a){Ra[Ta++]=Ia,Ra[Ta++]=en,Ra[Ta++]=On,On=e;var r=Ia;e=en;var c=32-Bt(r)-1;r&=~(1<<c),a+=1;var d=32-Bt(t)+c;if(30<d){var x=c-c%5;d=(r&(1<<x)-1).toString(32),r>>=x,c-=x,Ia=1<<32-Bt(t)+c|a<<c|r,en=d+e}else Ia=1<<d|a<<c|r,en=e}function Po(e){e.return!==null&&(dn(e,1),pf(e,1,0))}function Wo(e){for(;e===li;)li=Jl[--Pl],Jl[Pl]=null,$r=Jl[--Pl],Jl[Pl]=null;for(;e===On;)On=Ra[--Ta],Ra[Ta]=null,en=Ra[--Ta],Ra[Ta]=null,Ia=Ra[--Ta],Ra[Ta]=null}function gf(e,t){Ra[Ta++]=Ia,Ra[Ta++]=en,Ra[Ta++]=On,Ia=t.id,en=t.overflow,On=e}var Vt=null,pt=null,Qe=!1,Dn=null,za=!1,Io=Error(i(519));function Mn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yr(Ca(t,e)),Io}function xf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[oe]=e,t[fe]=r,a){case"dialog":Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":case"embed":Ye("load",t);break;case"video":case"audio":for(a=0;a<us.length;a++)Ye(us[a],t);break;case"source":Ye("error",t);break;case"img":case"image":case"link":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"input":Ye("invalid",t),Td(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ye("invalid",t);break;case"textarea":Ye("invalid",t),Od(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Ah(t.textContent,a)?(r.popover!=null&&(Ye("beforetoggle",t),Ye("toggle",t)),r.onScroll!=null&&Ye("scroll",t),r.onScrollEnd!=null&&Ye("scrollend",t),r.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||Mn(e,!0)}function yf(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:za=!1;return;case 27:case 3:za=!0;return;default:Vt=Vt.return}}function Wl(e){if(e!==Vt)return!1;if(!Qe)return yf(e),Qe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||xu(e.type,e.memoizedProps)),a=!a),a&&pt&&Mn(e),yf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));pt=Gh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));pt=Gh(e)}else t===27?(t=pt,Qn(e.type)?(e=_u,_u=null,pt=e):pt=t):pt=Vt?Da(e.stateNode.nextSibling):null;return!0}function ml(){pt=Vt=null,Qe=!1}function ec(){var e=Dn;return e!==null&&(ua===null?ua=e:ua.push.apply(ua,e),Dn=null),e}function Yr(e){Dn===null?Dn=[e]:Dn.push(e)}var tc=N(null),hl=null,fn=null;function An(e,t,a){F(tc,t._currentValue),t._currentValue=a}function mn(e){e._currentValue=tc.current,H(tc)}function ac(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function nc(e,t,a,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var x=c.child;d=d.firstContext;e:for(;d!==null;){var S=d;d=c;for(var E=0;E<t.length;E++)if(S.context===t[E]){d.lanes|=a,S=d.alternate,S!==null&&(S.lanes|=a),ac(d.return,a,e),r||(x=null);break e}d=S.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,d=x.alternate,d!==null&&(d.lanes|=a),ac(x,a,e),x=null}else x=c.child;if(x!==null)x.return=c;else for(x=c;x!==null;){if(x===e){x=null;break}if(c=x.sibling,c!==null){c.return=x.return,x=c;break}x=x.return}c=x}}function Il(e,t,a,r){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var x=c.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var S=c.type;fa(c.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(c===ze.current){if(x=c.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ps):e=[ps])}c=c.return}e!==null&&nc(t,e,a,r),t.flags|=262144}function ri(e){for(e=e.firstContext;e!==null;){if(!fa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function pl(e){hl=e,fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kt(e){return bf(hl,e)}function si(e,t){return hl===null&&pl(e),bf(e,t)}function bf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},fn===null){if(e===null)throw Error(i(308));fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fn=fn.next=t;return a}var Ky=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Xy=n.unstable_scheduleCallback,Qy=n.unstable_NormalPriority,Dt={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lc(){return{controller:new Ky,data:new Map,refCount:0}}function Gr(e){e.refCount--,e.refCount===0&&Xy(Qy,function(){e.controller.abort()})}var Vr=null,rc=0,er=0,tr=null;function Zy(e,t){if(Vr===null){var a=Vr=[];rc=0,er=ou(),tr={status:"pending",value:void 0,then:function(r){a.push(r)}}}return rc++,t.then(vf,vf),t}function vf(){if(--rc===0&&Vr!==null){tr!==null&&(tr.status="fulfilled");var e=Vr;Vr=null,er=0,tr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),r}var Sf=M.S;M.S=function(e,t){lh=Oe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Zy(e,t),Sf!==null&&Sf(e,t)};var gl=N(null);function sc(){var e=gl.current;return e!==null?e:dt.pooledCache}function ii(e,t){t===null?F(gl,gl.current):F(gl,t.pool)}function _f(){var e=sc();return e===null?null:{parent:Dt._currentValue,pool:e}}var ar=Error(i(460)),ic=Error(i(474)),oi=Error(i(542)),ci={then:function(){}};function jf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Nf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(on,on),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e;default:if(typeof t.status=="string")t.then(on,on);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e}throw yl=t,ar}}function xl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(yl=a,ar):a}}var yl=null;function wf(){if(yl===null)throw Error(i(459));var e=yl;return yl=null,e}function Ef(e){if(e===ar||e===oi)throw Error(i(483))}var nr=null,Kr=0;function ui(e){var t=Kr;return Kr+=1,nr===null&&(nr=[]),Nf(nr,e,t)}function Xr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function di(e,t){throw t.$$typeof===_?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Cf(e){function t(D,T){if(e){var k=D.deletions;k===null?(D.deletions=[T],D.flags|=16):k.push(T)}}function a(D,T){if(!e)return null;for(;T!==null;)t(D,T),T=T.sibling;return null}function r(D){for(var T=new Map;D!==null;)D.key!==null?T.set(D.key,D):T.set(D.index,D),D=D.sibling;return T}function c(D,T){return D=un(D,T),D.index=0,D.sibling=null,D}function d(D,T,k){return D.index=k,e?(k=D.alternate,k!==null?(k=k.index,k<T?(D.flags|=67108866,T):k):(D.flags|=67108866,T)):(D.flags|=1048576,T)}function x(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function S(D,T,k,J){return T===null||T.tag!==6?(T=Fo(k,D.mode,J),T.return=D,T):(T=c(T,k),T.return=D,T)}function E(D,T,k,J){var Ne=k.type;return Ne===z?K(D,T,k.props.children,J,k.key):T!==null&&(T.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===w&&xl(Ne)===T.type)?(T=c(T,k.props),Xr(T,k),T.return=D,T):(T=ni(k.type,k.key,k.props,null,D.mode,J),Xr(T,k),T.return=D,T)}function L(D,T,k,J){return T===null||T.tag!==4||T.stateNode.containerInfo!==k.containerInfo||T.stateNode.implementation!==k.implementation?(T=Jo(k,D.mode,J),T.return=D,T):(T=c(T,k.children||[]),T.return=D,T)}function K(D,T,k,J,Ne){return T===null||T.tag!==7?(T=fl(k,D.mode,J,Ne),T.return=D,T):(T=c(T,k),T.return=D,T)}function I(D,T,k){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=Fo(""+T,D.mode,k),T.return=D,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case j:return k=ni(T.type,T.key,T.props,null,D.mode,k),Xr(k,T),k.return=D,k;case R:return T=Jo(T,D.mode,k),T.return=D,T;case w:return T=xl(T),I(D,T,k)}if(ie(T)||se(T))return T=fl(T,D.mode,k,null),T.return=D,T;if(typeof T.then=="function")return I(D,ui(T),k);if(T.$$typeof===V)return I(D,si(D,T),k);di(D,T)}return null}function U(D,T,k,J){var Ne=T!==null?T.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return Ne!==null?null:S(D,T,""+k,J);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case j:return k.key===Ne?E(D,T,k,J):null;case R:return k.key===Ne?L(D,T,k,J):null;case w:return k=xl(k),U(D,T,k,J)}if(ie(k)||se(k))return Ne!==null?null:K(D,T,k,J,null);if(typeof k.then=="function")return U(D,T,ui(k),J);if(k.$$typeof===V)return U(D,T,si(D,k),J);di(D,k)}return null}function $(D,T,k,J,Ne){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return D=D.get(k)||null,S(T,D,""+J,Ne);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case j:return D=D.get(J.key===null?k:J.key)||null,E(T,D,J,Ne);case R:return D=D.get(J.key===null?k:J.key)||null,L(T,D,J,Ne);case w:return J=xl(J),$(D,T,k,J,Ne)}if(ie(J)||se(J))return D=D.get(k)||null,K(T,D,J,Ne,null);if(typeof J.then=="function")return $(D,T,k,ui(J),Ne);if(J.$$typeof===V)return $(D,T,k,si(T,J),Ne);di(T,J)}return null}function xe(D,T,k,J){for(var Ne=null,Ie=null,ve=T,Le=T=0,Xe=null;ve!==null&&Le<k.length;Le++){ve.index>Le?(Xe=ve,ve=null):Xe=ve.sibling;var et=U(D,ve,k[Le],J);if(et===null){ve===null&&(ve=Xe);break}e&&ve&&et.alternate===null&&t(D,ve),T=d(et,T,Le),Ie===null?Ne=et:Ie.sibling=et,Ie=et,ve=Xe}if(Le===k.length)return a(D,ve),Qe&&dn(D,Le),Ne;if(ve===null){for(;Le<k.length;Le++)ve=I(D,k[Le],J),ve!==null&&(T=d(ve,T,Le),Ie===null?Ne=ve:Ie.sibling=ve,Ie=ve);return Qe&&dn(D,Le),Ne}for(ve=r(ve);Le<k.length;Le++)Xe=$(ve,D,Le,k[Le],J),Xe!==null&&(e&&Xe.alternate!==null&&ve.delete(Xe.key===null?Le:Xe.key),T=d(Xe,T,Le),Ie===null?Ne=Xe:Ie.sibling=Xe,Ie=Xe);return e&&ve.forEach(function(Wn){return t(D,Wn)}),Qe&&dn(D,Le),Ne}function Re(D,T,k,J){if(k==null)throw Error(i(151));for(var Ne=null,Ie=null,ve=T,Le=T=0,Xe=null,et=k.next();ve!==null&&!et.done;Le++,et=k.next()){ve.index>Le?(Xe=ve,ve=null):Xe=ve.sibling;var Wn=U(D,ve,et.value,J);if(Wn===null){ve===null&&(ve=Xe);break}e&&ve&&Wn.alternate===null&&t(D,ve),T=d(Wn,T,Le),Ie===null?Ne=Wn:Ie.sibling=Wn,Ie=Wn,ve=Xe}if(et.done)return a(D,ve),Qe&&dn(D,Le),Ne;if(ve===null){for(;!et.done;Le++,et=k.next())et=I(D,et.value,J),et!==null&&(T=d(et,T,Le),Ie===null?Ne=et:Ie.sibling=et,Ie=et);return Qe&&dn(D,Le),Ne}for(ve=r(ve);!et.done;Le++,et=k.next())et=$(ve,D,Le,et.value,J),et!==null&&(e&&et.alternate!==null&&ve.delete(et.key===null?Le:et.key),T=d(et,T,Le),Ie===null?Ne=et:Ie.sibling=et,Ie=et);return e&&ve.forEach(function(s0){return t(D,s0)}),Qe&&dn(D,Le),Ne}function ot(D,T,k,J){if(typeof k=="object"&&k!==null&&k.type===z&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case j:e:{for(var Ne=k.key;T!==null;){if(T.key===Ne){if(Ne=k.type,Ne===z){if(T.tag===7){a(D,T.sibling),J=c(T,k.props.children),J.return=D,D=J;break e}}else if(T.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===w&&xl(Ne)===T.type){a(D,T.sibling),J=c(T,k.props),Xr(J,k),J.return=D,D=J;break e}a(D,T);break}else t(D,T);T=T.sibling}k.type===z?(J=fl(k.props.children,D.mode,J,k.key),J.return=D,D=J):(J=ni(k.type,k.key,k.props,null,D.mode,J),Xr(J,k),J.return=D,D=J)}return x(D);case R:e:{for(Ne=k.key;T!==null;){if(T.key===Ne)if(T.tag===4&&T.stateNode.containerInfo===k.containerInfo&&T.stateNode.implementation===k.implementation){a(D,T.sibling),J=c(T,k.children||[]),J.return=D,D=J;break e}else{a(D,T);break}else t(D,T);T=T.sibling}J=Jo(k,D.mode,J),J.return=D,D=J}return x(D);case w:return k=xl(k),ot(D,T,k,J)}if(ie(k))return xe(D,T,k,J);if(se(k)){if(Ne=se(k),typeof Ne!="function")throw Error(i(150));return k=Ne.call(k),Re(D,T,k,J)}if(typeof k.then=="function")return ot(D,T,ui(k),J);if(k.$$typeof===V)return ot(D,T,si(D,k),J);di(D,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,T!==null&&T.tag===6?(a(D,T.sibling),J=c(T,k),J.return=D,D=J):(a(D,T),J=Fo(k,D.mode,J),J.return=D,D=J),x(D)):a(D,T)}return function(D,T,k,J){try{Kr=0;var Ne=ot(D,T,k,J);return nr=null,Ne}catch(ve){if(ve===ar||ve===oi)throw ve;var Ie=ma(29,ve,null,D.mode);return Ie.lanes=J,Ie.return=D,Ie}}}var bl=Cf(!0),Rf=Cf(!1),kn=!1;function oc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cc(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 Ln(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Un(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(at&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=ai(e),df(e,null,a),t}return ti(e,r,t,a),ai(e)}function Qr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Gs(e,a)}}function uc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=x:d=d.next=x,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var dc=!1;function Zr(){if(dc){var e=tr;if(e!==null)throw e}}function Fr(e,t,a,r){dc=!1;var c=e.updateQueue;kn=!1;var d=c.firstBaseUpdate,x=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var E=S,L=E.next;E.next=null,x===null?d=L:x.next=L,x=E;var K=e.alternate;K!==null&&(K=K.updateQueue,S=K.lastBaseUpdate,S!==x&&(S===null?K.firstBaseUpdate=L:S.next=L,K.lastBaseUpdate=E))}if(d!==null){var I=c.baseState;x=0,K=L=E=null,S=d;do{var U=S.lane&-536870913,$=U!==S.lane;if($?(Ke&U)===U:(r&U)===U){U!==0&&U===er&&(dc=!0),K!==null&&(K=K.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var xe=e,Re=S;U=t;var ot=a;switch(Re.tag){case 1:if(xe=Re.payload,typeof xe=="function"){I=xe.call(ot,I,U);break e}I=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Re.payload,U=typeof xe=="function"?xe.call(ot,I,U):xe,U==null)break e;I=y({},I,U);break e;case 2:kn=!0}}U=S.callback,U!==null&&(e.flags|=64,$&&(e.flags|=8192),$=c.callbacks,$===null?c.callbacks=[U]:$.push(U))}else $={lane:U,tag:S.tag,payload:S.payload,callback:S.callback,next:null},K===null?(L=K=$,E=I):K=K.next=$,x|=U;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;$=S,S=$.next,$.next=null,c.lastBaseUpdate=$,c.shared.pending=null}}while(!0);K===null&&(E=I),c.baseState=E,c.firstBaseUpdate=L,c.lastBaseUpdate=K,d===null&&(c.shared.lanes=0),Yn|=x,e.lanes=x,e.memoizedState=I}}function Tf(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function zf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Tf(a[e],t)}var lr=N(null),fi=N(0);function Of(e,t){e=_n,F(fi,e),F(lr,t),_n=e|t.baseLanes}function fc(){F(fi,_n),F(lr,lr.current)}function mc(){_n=fi.current,H(lr),H(fi)}var ha=N(null),Oa=null;function Hn(e){var t=e.alternate;F(Ct,Ct.current&1),F(ha,e),Oa===null&&(t===null||lr.current!==null||t.memoizedState!==null)&&(Oa=e)}function hc(e){F(Ct,Ct.current),F(ha,e),Oa===null&&(Oa=e)}function Df(e){e.tag===22?(F(Ct,Ct.current),F(ha,e),Oa===null&&(Oa=e)):Bn()}function Bn(){F(Ct,Ct.current),F(ha,ha.current)}function pa(e){H(ha),Oa===e&&(Oa=null),H(Ct)}var Ct=N(0);function mi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||vu(a)||Su(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var hn=0,ke=null,st=null,Mt=null,hi=!1,rr=!1,vl=!1,pi=0,Jr=0,sr=null,Jy=0;function jt(){throw Error(i(321))}function pc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!fa(e[a],t[a]))return!1;return!0}function gc(e,t,a,r,c,d){return hn=d,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?pm:Oc,vl=!1,d=a(r,c),vl=!1,rr&&(d=Af(t,a,r,c)),Mf(e),d}function Mf(e){M.H=Ir;var t=st!==null&&st.next!==null;if(hn=0,Mt=st=ke=null,hi=!1,Jr=0,sr=null,t)throw Error(i(300));e===null||At||(e=e.dependencies,e!==null&&ri(e)&&(At=!0))}function Af(e,t,a,r){ke=e;var c=0;do{if(rr&&(sr=null),Jr=0,rr=!1,25<=c)throw Error(i(301));if(c+=1,Mt=st=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}M.H=gm,d=t(a,r)}while(rr);return d}function Py(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Pr(t):t,e=e.useState()[0],(st!==null?st.memoizedState:null)!==e&&(ke.flags|=1024),t}function xc(){var e=pi!==0;return pi=0,e}function yc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function bc(e){if(hi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hi=!1}hn=0,Mt=st=ke=null,rr=!1,Jr=pi=0,sr=null}function ea(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ke.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function Rt(){if(st===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=st.next;var t=Mt===null?ke.memoizedState:Mt.next;if(t!==null)Mt=t,st=e;else{if(e===null)throw ke.alternate===null?Error(i(467)):Error(i(310));st=e,e={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},Mt===null?ke.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function gi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Pr(e){var t=Jr;return Jr+=1,sr===null&&(sr=[]),e=Nf(sr,e,t),t=ke,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?pm:Oc),e}function xi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Pr(e);if(e.$$typeof===V)return Kt(e)}throw Error(i(438,String(e)))}function vc(e){var t=null,a=ke.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=ke.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=gi(),ke.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=Z;return t.index++,a}function pn(e,t){return typeof t=="function"?t(e):t}function yi(e){var t=Rt();return Sc(t,st,e)}function Sc(e,t,a){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=a;var c=e.baseQueue,d=r.pending;if(d!==null){if(c!==null){var x=c.next;c.next=d.next,d.next=x}t.baseQueue=c=d,r.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var S=x=null,E=null,L=t,K=!1;do{var I=L.lane&-536870913;if(I!==L.lane?(Ke&I)===I:(hn&I)===I){var U=L.revertLane;if(U===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),I===er&&(K=!0);else if((hn&U)===U){L=L.next,U===er&&(K=!0);continue}else I={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},E===null?(S=E=I,x=d):E=E.next=I,ke.lanes|=U,Yn|=U;I=L.action,vl&&a(d,I),d=L.hasEagerState?L.eagerState:a(d,I)}else U={lane:I,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},E===null?(S=E=U,x=d):E=E.next=U,ke.lanes|=I,Yn|=I;L=L.next}while(L!==null&&L!==t);if(E===null?x=d:E.next=S,!fa(d,e.memoizedState)&&(At=!0,K&&(a=tr,a!==null)))throw a;e.memoizedState=d,e.baseState=x,e.baseQueue=E,r.lastRenderedState=d}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function _c(e){var t=Rt(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var r=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do d=e(d,x.action),x=x.next;while(x!==c);fa(d,t.memoizedState)||(At=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,r]}function kf(e,t,a){var r=ke,c=Rt(),d=Qe;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!fa((st||c).memoizedState,a);if(x&&(c.memoizedState=a,At=!0),c=c.queue,wc(Hf.bind(null,r,c,e),[e]),c.getSnapshot!==t||x||Mt!==null&&Mt.memoizedState.tag&1){if(r.flags|=2048,ir(9,{destroy:void 0},Uf.bind(null,r,c,a,t),null),dt===null)throw Error(i(349));d||(hn&127)!==0||Lf(r,t,a)}return a}function Lf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ke.updateQueue,t===null?(t=gi(),ke.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Uf(e,t,a,r){t.value=a,t.getSnapshot=r,Bf(t)&&qf(e)}function Hf(e,t,a){return a(function(){Bf(t)&&qf(e)})}function Bf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!fa(e,a)}catch{return!0}}function qf(e){var t=dl(e,2);t!==null&&da(t,e,2)}function jc(e){var t=ea();if(typeof e=="function"){var a=e;if(e=a(),vl){zt(!0);try{a()}finally{zt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:e},t}function $f(e,t,a,r){return e.baseState=a,Sc(e,st,typeof r=="function"?r:pn)}function Wy(e,t,a,r,c){if(Si(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){d.listeners.push(x)}};M.T!==null?a(!0):d.isTransition=!1,r(d),a=t.pending,a===null?(d.next=t.pending=d,Yf(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Yf(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=M.T,x={};M.T=x;try{var S=a(c,r),E=M.S;E!==null&&E(x,S),Gf(e,t,S)}catch(L){Nc(e,t,L)}finally{d!==null&&x.types!==null&&(d.types=x.types),M.T=d}}else try{d=a(c,r),Gf(e,t,d)}catch(L){Nc(e,t,L)}}function Gf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Vf(e,t,r)},function(r){return Nc(e,t,r)}):Vf(e,t,a)}function Vf(e,t,a){t.status="fulfilled",t.value=a,Kf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Yf(e,a)))}function Nc(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Kf(t),t=t.next;while(t!==r)}e.action=null}function Kf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xf(e,t){return t}function Qf(e,t){if(Qe){var a=dt.formState;if(a!==null){e:{var r=ke;if(Qe){if(pt){t:{for(var c=pt,d=za;c.nodeType!==8;){if(!d){c=null;break t}if(c=Da(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){pt=Da(c.nextSibling),r=c.data==="F!";break e}}Mn(r)}r=!1}r&&(t=a[0])}}return a=ea(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xf,lastRenderedState:t},a.queue=r,a=fm.bind(null,ke,r),r.dispatch=a,r=jc(!1),d=zc.bind(null,ke,!1,r.queue),r=ea(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=Wy.bind(null,ke,c,d,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function Zf(e){var t=Rt();return Ff(t,st,e)}function Ff(e,t,a){if(t=Sc(e,t,Xf)[0],e=yi(pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Pr(t)}catch(x){throw x===ar?oi:x}else r=t;t=Rt();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(ke.flags|=2048,ir(9,{destroy:void 0},Iy.bind(null,c,a),null)),[r,d,e]}function Iy(e,t){e.action=t}function Jf(e){var t=Rt(),a=st;if(a!==null)return Ff(t,a,e);Rt(),t=t.memoizedState,a=Rt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function ir(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=ke.updateQueue,t===null&&(t=gi(),ke.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function Pf(){return Rt().memoizedState}function bi(e,t,a,r){var c=ea();ke.flags|=e,c.memoizedState=ir(1|t,{destroy:void 0},a,r===void 0?null:r)}function vi(e,t,a,r){var c=Rt();r=r===void 0?null:r;var d=c.memoizedState.inst;st!==null&&r!==null&&pc(r,st.memoizedState.deps)?c.memoizedState=ir(t,d,a,r):(ke.flags|=e,c.memoizedState=ir(1|t,d,a,r))}function Wf(e,t){bi(8390656,8,e,t)}function wc(e,t){vi(2048,8,e,t)}function eb(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=gi(),ke.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function If(e){var t=Rt().memoizedState;return eb({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function em(e,t){return vi(4,2,e,t)}function tm(e,t){return vi(4,4,e,t)}function am(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nm(e,t,a){a=a!=null?a.concat([e]):null,vi(4,4,am.bind(null,t,e),a)}function Ec(){}function lm(e,t){var a=Rt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&pc(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function rm(e,t){var a=Rt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&pc(t,r[1]))return r[0];if(r=e(),vl){zt(!0);try{e()}finally{zt(!1)}}return a.memoizedState=[r,t],r}function Cc(e,t,a){return a===void 0||(hn&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=sh(),ke.lanes|=e,Yn|=e,a)}function sm(e,t,a,r){return fa(a,t)?a:lr.current!==null?(e=Cc(e,a,r),fa(e,t)||(At=!0),e):(hn&42)===0||(hn&1073741824)!==0&&(Ke&261930)===0?(At=!0,e.memoizedState=a):(e=sh(),ke.lanes|=e,Yn|=e,t)}function im(e,t,a,r,c){var d=W.p;W.p=d!==0&&8>d?d:8;var x=M.T,S={};M.T=S,zc(e,!1,t,a);try{var E=c(),L=M.S;if(L!==null&&L(S,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var K=Fy(E,r);Wr(e,t,K,ya(e))}else Wr(e,t,r,ya(e))}catch(I){Wr(e,t,{then:function(){},status:"rejected",reason:I},ya())}finally{W.p=d,x!==null&&S.types!==null&&(x.types=S.types),M.T=x}}function tb(){}function Rc(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=om(e).queue;im(e,c,t,ce,a===null?tb:function(){return cm(e),a(r)})}function om(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:ce},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cm(e){var t=om(e);t.next===null&&(t=e.alternate.memoizedState),Wr(e,t.next.queue,{},ya())}function Tc(){return Kt(ps)}function um(){return Rt().memoizedState}function dm(){return Rt().memoizedState}function ab(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ya();e=Ln(a);var r=Un(t,e,a);r!==null&&(da(r,t,a),Qr(r,t,a)),t={cache:lc()},e.payload=t;return}t=t.return}}function nb(e,t,a){var r=ya();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Si(e)?mm(t,a):(a=Qo(e,t,a,r),a!==null&&(da(a,e,r),hm(a,t,r)))}function fm(e,t,a){var r=ya();Wr(e,t,a,r)}function Wr(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Si(e))mm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var x=t.lastRenderedState,S=d(x,a);if(c.hasEagerState=!0,c.eagerState=S,fa(S,x))return ti(e,t,c,0),dt===null&&ei(),!1}catch{}if(a=Qo(e,t,c,r),a!==null)return da(a,e,r),hm(a,t,r),!0}return!1}function zc(e,t,a,r){if(r={lane:2,revertLane:ou(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Si(e)){if(t)throw Error(i(479))}else t=Qo(e,a,r,2),t!==null&&da(t,e,2)}function Si(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function mm(e,t){rr=hi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function hm(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Gs(e,a)}}var Ir={readContext:Kt,use:xi,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Ir.useEffectEvent=jt;var pm={readContext:Kt,use:xi,useCallback:function(e,t){return ea().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:Wf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,bi(4194308,4,am.bind(null,t,e),a)},useLayoutEffect:function(e,t){return bi(4194308,4,e,t)},useInsertionEffect:function(e,t){bi(4,2,e,t)},useMemo:function(e,t){var a=ea();t=t===void 0?null:t;var r=e();if(vl){zt(!0);try{e()}finally{zt(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=ea();if(a!==void 0){var c=a(t);if(vl){zt(!0);try{a(t)}finally{zt(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=nb.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=ea();return e={current:e},t.memoizedState=e},useState:function(e){e=jc(e);var t=e.queue,a=fm.bind(null,ke,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ec,useDeferredValue:function(e,t){var a=ea();return Cc(a,e,t)},useTransition:function(){var e=jc(!1);return e=im.bind(null,ke,e.queue,!0,!1),ea().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=ke,c=ea();if(Qe){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),dt===null)throw Error(i(349));(Ke&127)!==0||Lf(r,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Wf(Hf.bind(null,r,d,e),[e]),r.flags|=2048,ir(9,{destroy:void 0},Uf.bind(null,r,d,a,t),null),a},useId:function(){var e=ea(),t=dt.identifierPrefix;if(Qe){var a=en,r=Ia;a=(r&~(1<<32-Bt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=pi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Jy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Tc,useFormState:Qf,useActionState:Qf,useOptimistic:function(e){var t=ea();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=zc.bind(null,ke,!0,a),a.dispatch=t,[e,t]},useMemoCache:vc,useCacheRefresh:function(){return ea().memoizedState=ab.bind(null,ke)},useEffectEvent:function(e){var t=ea(),a={impl:e};return t.memoizedState=a,function(){if((at&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Oc={readContext:Kt,use:xi,useCallback:lm,useContext:Kt,useEffect:wc,useImperativeHandle:nm,useInsertionEffect:em,useLayoutEffect:tm,useMemo:rm,useReducer:yi,useRef:Pf,useState:function(){return yi(pn)},useDebugValue:Ec,useDeferredValue:function(e,t){var a=Rt();return sm(a,st.memoizedState,e,t)},useTransition:function(){var e=yi(pn)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:Pr(e),t]},useSyncExternalStore:kf,useId:um,useHostTransitionStatus:Tc,useFormState:Zf,useActionState:Zf,useOptimistic:function(e,t){var a=Rt();return $f(a,st,e,t)},useMemoCache:vc,useCacheRefresh:dm};Oc.useEffectEvent=If;var gm={readContext:Kt,use:xi,useCallback:lm,useContext:Kt,useEffect:wc,useImperativeHandle:nm,useInsertionEffect:em,useLayoutEffect:tm,useMemo:rm,useReducer:_c,useRef:Pf,useState:function(){return _c(pn)},useDebugValue:Ec,useDeferredValue:function(e,t){var a=Rt();return st===null?Cc(a,e,t):sm(a,st.memoizedState,e,t)},useTransition:function(){var e=_c(pn)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:Pr(e),t]},useSyncExternalStore:kf,useId:um,useHostTransitionStatus:Tc,useFormState:Jf,useActionState:Jf,useOptimistic:function(e,t){var a=Rt();return st!==null?$f(a,st,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:vc,useCacheRefresh:dm};gm.useEffectEvent=If;function Dc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Mc={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=ya(),c=Ln(r);c.payload=t,a!=null&&(c.callback=a),t=Un(e,c,r),t!==null&&(da(t,e,r),Qr(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=ya(),c=Ln(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Un(e,c,r),t!==null&&(da(t,e,r),Qr(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ya(),r=Ln(a);r.tag=2,t!=null&&(r.callback=t),t=Un(e,r,a),t!==null&&(da(t,e,a),Qr(t,e,a))}};function xm(e,t,a,r,c,d,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,x):t.prototype&&t.prototype.isPureReactComponent?!Br(a,r)||!Br(c,d):!0}function ym(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Mc.enqueueReplaceState(t,t.state,null)}function Sl(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function bm(e){Is(e)}function vm(e){console.error(e)}function Sm(e){Is(e)}function _i(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function _m(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Ac(e,t,a){return a=Ln(a),a.tag=3,a.payload={element:null},a.callback=function(){_i(e,t)},a}function jm(e){return e=Ln(e),e.tag=3,e}function Nm(e,t,a,r){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=r.value;e.payload=function(){return c(d)},e.callback=function(){_m(t,a,r)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){_m(t,a,r),typeof c!="function"&&(Gn===null?Gn=new Set([this]):Gn.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function lb(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&Il(t,a,c,!0),a=ha.current,a!==null){switch(a.tag){case 31:case 13:return Oa===null?Ai():a.alternate===null&&Nt===0&&(Nt=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===ci?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),ru(e,r,c)),!1;case 22:return a.flags|=65536,r===ci?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),ru(e,r,c)),!1}throw Error(i(435,a.tag))}return ru(e,r,c),Ai(),!1}if(Qe)return t=ha.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==Io&&(e=Error(i(422),{cause:r}),Yr(Ca(e,a)))):(r!==Io&&(t=Error(i(423),{cause:r}),Yr(Ca(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=Ca(r,a),c=Ac(e.stateNode,r,c),uc(e,c),Nt!==4&&(Nt=2)),!1;var d=Error(i(520),{cause:r});if(d=Ca(d,a),is===null?is=[d]:is.push(d),Nt!==4&&(Nt=2),t===null)return!0;r=Ca(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Ac(a.stateNode,r,e),uc(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Gn===null||!Gn.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=jm(c),Nm(c,e,a,r),uc(a,c),!1}a=a.return}while(a!==null);return!1}var kc=Error(i(461)),At=!1;function Xt(e,t,a,r){t.child=e===null?Rf(t,null,a,r):bl(t,e.child,a,r)}function wm(e,t,a,r,c){a=a.render;var d=t.ref;if("ref"in r){var x={};for(var S in r)S!=="ref"&&(x[S]=r[S])}else x=r;return pl(t),r=gc(e,t,a,x,d,c),S=xc(),e!==null&&!At?(yc(e,t,c),gn(e,t,c)):(Qe&&S&&Po(t),t.flags|=1,Xt(e,t,r,c),t.child)}function Em(e,t,a,r,c){if(e===null){var d=a.type;return typeof d=="function"&&!Zo(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Cm(e,t,d,r,c)):(e=ni(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Gc(e,c)){var x=d.memoizedProps;if(a=a.compare,a=a!==null?a:Br,a(x,r)&&e.ref===t.ref)return gn(e,t,c)}return t.flags|=1,e=un(d,r),e.ref=t.ref,e.return=t,t.child=e}function Cm(e,t,a,r,c){if(e!==null){var d=e.memoizedProps;if(Br(d,r)&&e.ref===t.ref)if(At=!1,t.pendingProps=r=d,Gc(e,c))(e.flags&131072)!==0&&(At=!0);else return t.lanes=e.lanes,gn(e,t,c)}return Lc(e,t,a,r,c)}function Rm(e,t,a,r){var c=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~d}else r=0,t.child=null;return Tm(e,t,d,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ii(t,d!==null?d.cachePool:null),d!==null?Of(t,d):fc(),Df(t);else return r=t.lanes=536870912,Tm(e,t,d!==null?d.baseLanes|a:a,a,r)}else d!==null?(ii(t,d.cachePool),Of(t,d),Bn(),t.memoizedState=null):(e!==null&&ii(t,null),fc(),Bn());return Xt(e,t,c,a),t.child}function es(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Tm(e,t,a,r,c){var d=sc();return d=d===null?null:{parent:Dt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&ii(t,null),fc(),Df(t),e!==null&&Il(e,t,r,!0),t.childLanes=c,null}function ji(e,t){return t=wi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zm(e,t,a){return bl(t,e.child,null,a),e=ji(t,t.pendingProps),e.flags|=2,pa(t),t.memoizedState=null,e}function rb(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Qe){if(r.mode==="hidden")return e=ji(t,r),t.lanes=536870912,es(null,e);if(hc(t),(e=pt)?(e=Yh(e,za),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:On!==null?{id:Ia,overflow:en}:null,retryLane:536870912,hydrationErrors:null},a=mf(e),a.return=t,t.child=a,Vt=t,pt=null)):e=null,e===null)throw Mn(t);return t.lanes=536870912,null}return ji(t,r)}var d=e.memoizedState;if(d!==null){var x=d.dehydrated;if(hc(t),c)if(t.flags&256)t.flags&=-257,t=zm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(At||Il(e,t,a,!1),c=(a&e.childLanes)!==0,At||c){if(r=dt,r!==null&&(x=C(r,a),x!==0&&x!==d.retryLane))throw d.retryLane=x,dl(e,x),da(r,e,x),kc;Ai(),t=zm(e,t,a)}else e=d.treeContext,pt=Da(x.nextSibling),Vt=t,Qe=!0,Dn=null,za=!1,e!==null&&gf(t,e),t=ji(t,r),t.flags|=4096;return t}return e=un(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ni(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Lc(e,t,a,r,c){return pl(t),a=gc(e,t,a,r,void 0,c),r=xc(),e!==null&&!At?(yc(e,t,c),gn(e,t,c)):(Qe&&r&&Po(t),t.flags|=1,Xt(e,t,a,c),t.child)}function Om(e,t,a,r,c,d){return pl(t),t.updateQueue=null,a=Af(t,r,a,c),Mf(e),r=xc(),e!==null&&!At?(yc(e,t,d),gn(e,t,d)):(Qe&&r&&Po(t),t.flags|=1,Xt(e,t,a,d),t.child)}function Dm(e,t,a,r,c){if(pl(t),t.stateNode===null){var d=Fl,x=a.contextType;typeof x=="object"&&x!==null&&(d=Kt(x)),d=new a(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Mc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},oc(t),x=a.contextType,d.context=typeof x=="object"&&x!==null?Kt(x):Fl,d.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Dc(t,a,x,r),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(x=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),x!==d.state&&Mc.enqueueReplaceState(d,d.state,null),Fr(t,r,d,c),Zr(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var S=t.memoizedProps,E=Sl(a,S);d.props=E;var L=d.context,K=a.contextType;x=Fl,typeof K=="object"&&K!==null&&(x=Kt(K));var I=a.getDerivedStateFromProps;K=typeof I=="function"||typeof d.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,K||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S||L!==x)&&ym(t,d,r,x),kn=!1;var U=t.memoizedState;d.state=U,Fr(t,r,d,c),Zr(),L=t.memoizedState,S||U!==L||kn?(typeof I=="function"&&(Dc(t,a,I,r),L=t.memoizedState),(E=kn||xm(t,a,E,r,U,L,x))?(K||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=L),d.props=r,d.state=L,d.context=x,r=E):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,cc(e,t),x=t.memoizedProps,K=Sl(a,x),d.props=K,I=t.pendingProps,U=d.context,L=a.contextType,E=Fl,typeof L=="object"&&L!==null&&(E=Kt(L)),S=a.getDerivedStateFromProps,(L=typeof S=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==I||U!==E)&&ym(t,d,r,E),kn=!1,U=t.memoizedState,d.state=U,Fr(t,r,d,c),Zr();var $=t.memoizedState;x!==I||U!==$||kn||e!==null&&e.dependencies!==null&&ri(e.dependencies)?(typeof S=="function"&&(Dc(t,a,S,r),$=t.memoizedState),(K=kn||xm(t,a,K,r,U,$,E)||e!==null&&e.dependencies!==null&&ri(e.dependencies))?(L||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,$,E),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,$,E)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=$),d.props=r,d.state=$,d.context=E,r=K):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,Ni(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=bl(t,e.child,null,c),t.child=bl(t,null,a,c)):Xt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=gn(e,t,c),e}function Mm(e,t,a,r){return ml(),t.flags|=256,Xt(e,t,a,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hc(e){return{baseLanes:e,cachePool:_f()}}function Bc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=xa),e}function Am(e,t,a){var r=t.pendingProps,c=!1,d=(t.flags&128)!==0,x;if((x=d)||(x=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Qe){if(c?Hn(t):Bn(),(e=pt)?(e=Yh(e,za),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:On!==null?{id:Ia,overflow:en}:null,retryLane:536870912,hydrationErrors:null},a=mf(e),a.return=t,t.child=a,Vt=t,pt=null)):e=null,e===null)throw Mn(t);return Su(e)?t.lanes=32:t.lanes=536870912,null}var S=r.children;return r=r.fallback,c?(Bn(),c=t.mode,S=wi({mode:"hidden",children:S},c),r=fl(r,c,a,null),S.return=t,r.return=t,S.sibling=r,t.child=S,r=t.child,r.memoizedState=Hc(a),r.childLanes=Bc(e,x,a),t.memoizedState=Uc,es(null,r)):(Hn(t),qc(t,S))}var E=e.memoizedState;if(E!==null&&(S=E.dehydrated,S!==null)){if(d)t.flags&256?(Hn(t),t.flags&=-257,t=$c(e,t,a)):t.memoizedState!==null?(Bn(),t.child=e.child,t.flags|=128,t=null):(Bn(),S=r.fallback,c=t.mode,r=wi({mode:"visible",children:r.children},c),S=fl(S,c,a,null),S.flags|=2,r.return=t,S.return=t,r.sibling=S,t.child=r,bl(t,e.child,null,a),r=t.child,r.memoizedState=Hc(a),r.childLanes=Bc(e,x,a),t.memoizedState=Uc,t=es(null,r));else if(Hn(t),Su(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var L=x.dgst;x=L,r=Error(i(419)),r.stack="",r.digest=x,Yr({value:r,source:null,stack:null}),t=$c(e,t,a)}else if(At||Il(e,t,a,!1),x=(a&e.childLanes)!==0,At||x){if(x=dt,x!==null&&(r=C(x,a),r!==0&&r!==E.retryLane))throw E.retryLane=r,dl(e,r),da(x,e,r),kc;vu(S)||Ai(),t=$c(e,t,a)}else vu(S)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,pt=Da(S.nextSibling),Vt=t,Qe=!0,Dn=null,za=!1,e!==null&&gf(t,e),t=qc(t,r.children),t.flags|=4096);return t}return c?(Bn(),S=r.fallback,c=t.mode,E=e.child,L=E.sibling,r=un(E,{mode:"hidden",children:r.children}),r.subtreeFlags=E.subtreeFlags&65011712,L!==null?S=un(L,S):(S=fl(S,c,a,null),S.flags|=2),S.return=t,r.return=t,r.sibling=S,t.child=r,es(null,r),r=t.child,S=e.child.memoizedState,S===null?S=Hc(a):(c=S.cachePool,c!==null?(E=Dt._currentValue,c=c.parent!==E?{parent:E,pool:E}:c):c=_f(),S={baseLanes:S.baseLanes|a,cachePool:c}),r.memoizedState=S,r.childLanes=Bc(e,x,a),t.memoizedState=Uc,es(e.child,r)):(Hn(t),a=e.child,e=a.sibling,a=un(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function qc(e,t){return t=wi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function wi(e,t){return e=ma(22,e,null,t),e.lanes=0,e}function $c(e,t,a){return bl(t,e.child,null,a),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function km(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ac(e.return,t,a)}function Yc(e,t,a,r,c,d){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:c,treeForkCount:d}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=r,x.tail=a,x.tailMode=c,x.treeForkCount=d)}function Lm(e,t,a){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var x=Ct.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,F(Ct,x),Xt(e,t,r,a),r=Qe?$r:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&km(e,a,t);else if(e.tag===19)km(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&mi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Yc(t,!1,c,a,d,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&mi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Yc(t,!0,a,null,d,r);break;case"together":Yc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function gn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Yn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Il(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=un(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=un(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Gc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ri(e)))}function sb(e,t,a){switch(t.tag){case 3:Ze(t,t.stateNode.containerInfo),An(t,Dt,e.memoizedState.cache),ml();break;case 27:case 5:na(t);break;case 4:Ze(t,t.stateNode.containerInfo);break;case 10:An(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Hn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Am(e,t,a):(Hn(t),e=gn(e,t,a),e!==null?e.sibling:null);Hn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(Il(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return Lm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),F(Ct,Ct.current),r)break;return null;case 22:return t.lanes=0,Rm(e,t,a,t.pendingProps);case 24:An(t,Dt,e.memoizedState.cache)}return gn(e,t,a)}function Um(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)At=!0;else{if(!Gc(e,a)&&(t.flags&128)===0)return At=!1,sb(e,t,a);At=(e.flags&131072)!==0}else At=!1,Qe&&(t.flags&1048576)!==0&&pf(t,$r,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=xl(t.elementType),t.type=e,typeof e=="function")Zo(e)?(r=Sl(e,r),t.tag=1,t=Dm(null,t,e,r,a)):(t.tag=0,t=Lc(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===G){t.tag=11,t=wm(null,t,e,r,a);break e}else if(c===ee){t.tag=14,t=Em(null,t,e,r,a);break e}}throw t=ae(e)||e,Error(i(306,t,""))}}return t;case 0:return Lc(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=Sl(r,t.pendingProps),Dm(e,t,r,c,a);case 3:e:{if(Ze(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,cc(e,t),Fr(t,r,null,a);var x=t.memoizedState;if(r=x.cache,An(t,Dt,r),r!==d.cache&&nc(t,[Dt],a,!0),Zr(),r=x.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Mm(e,t,r,a);break e}else if(r!==c){c=Ca(Error(i(424)),t),Yr(c),t=Mm(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,pt=Da(e.firstChild),Vt=t,Qe=!0,Dn=null,za=!0,a=Rf(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ml(),r===c){t=gn(e,t,a);break e}Xt(e,t,r,a)}t=t.child}return t;case 26:return Ni(e,t),e===null?(a=Zh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Qe||(a=t.type,e=t.pendingProps,r=$i(_e.current).createElement(a),r[oe]=t,r[fe]=e,Qt(r,a,e),ft(r),t.stateNode=r):t.memoizedState=Zh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return na(t),e===null&&Qe&&(r=t.stateNode=Kh(t.type,t.pendingProps,_e.current),Vt=t,za=!0,c=pt,Qn(t.type)?(_u=c,pt=Da(r.firstChild)):pt=c),Xt(e,t,t.pendingProps.children,a),Ni(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Qe&&((c=r=pt)&&(r=Lb(r,t.type,t.pendingProps,za),r!==null?(t.stateNode=r,Vt=t,pt=Da(r.firstChild),za=!1,c=!0):c=!1),c||Mn(t)),na(t),c=t.type,d=t.pendingProps,x=e!==null?e.memoizedProps:null,r=d.children,xu(c,d)?r=null:x!==null&&xu(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=gc(e,t,Py,null,null,a),ps._currentValue=c),Ni(e,t),Xt(e,t,r,a),t.child;case 6:return e===null&&Qe&&((e=a=pt)&&(a=Ub(a,t.pendingProps,za),a!==null?(t.stateNode=a,Vt=t,pt=null,e=!0):e=!1),e||Mn(t)),null;case 13:return Am(e,t,a);case 4:return Ze(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bl(t,null,r,a):Xt(e,t,r,a),t.child;case 11:return wm(e,t,t.type,t.pendingProps,a);case 7:return Xt(e,t,t.pendingProps,a),t.child;case 8:return Xt(e,t,t.pendingProps.children,a),t.child;case 12:return Xt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,An(t,t.type,r.value),Xt(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,pl(t),c=Kt(c),r=r(c),t.flags|=1,Xt(e,t,r,a),t.child;case 14:return Em(e,t,t.type,t.pendingProps,a);case 15:return Cm(e,t,t.type,t.pendingProps,a);case 19:return Lm(e,t,a);case 31:return rb(e,t,a);case 22:return Rm(e,t,a,t.pendingProps);case 24:return pl(t),r=Kt(Dt),e===null?(c=sc(),c===null&&(c=dt,d=lc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:r,cache:c},oc(t),An(t,Dt,c)):((e.lanes&a)!==0&&(cc(e,t),Fr(t,null,null,a),Zr()),c=e.memoizedState,d=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),An(t,Dt,r)):(r=d.cache,An(t,Dt,r),r!==c.cache&&nc(t,[Dt],a,!0))),Xt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function xn(e){e.flags|=4}function Vc(e,t,a,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(uh())e.flags|=8192;else throw yl=ci,ic}else e.flags&=-16777217}function Hm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ih(t))if(uh())e.flags|=8192;else throw yl=ci,ic}function Ei(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?rl():536870912,e.lanes|=t,dr|=t)}function ts(e,t){if(!Qe)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function ib(e,t,a){var r=t.pendingProps;switch(Wo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),mn(Dt),Ue(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Wl(t)?xn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ec())),gt(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(xn(t),d!==null?(gt(t),Hm(t,d)):(gt(t),Vc(t,c,null,r,a))):d?d!==e.memoizedState?(xn(t),gt(t),Hm(t,d)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&xn(t),gt(t),Vc(t,c,e,r,a)),null;case 27:if(Ft(t),a=_e.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&xn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gt(t),null}e=ne.current,Wl(t)?xf(t):(e=Kh(c,r,a),t.stateNode=e,xn(t))}return gt(t),null;case 5:if(Ft(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&xn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gt(t),null}if(d=ne.current,Wl(t))xf(t);else{var x=$i(_e.current);switch(d){case 1:d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=x.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?x.createElement("select",{is:r.is}):x.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?x.createElement(c,{is:r.is}):x.createElement(c)}}d[oe]=t,d[fe]=r;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)d.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=d;e:switch(Qt(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&xn(t)}}return gt(t),Vc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&xn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=_e.current,Wl(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=Vt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[oe]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Ah(e.nodeValue,a)),e||Mn(t,!0)}else e=$i(e).createTextNode(r),e[oe]=t,t.stateNode=e}return gt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wl(t),a!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[oe]=t}else ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else a=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(pa(t),t):(pa(t),null);if((t.flags&128)!==0)throw Error(i(558))}return gt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Wl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[oe]=t}else ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),c=!1}else c=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(pa(t),t):(pa(t),null)}return pa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ei(t,t.updateQueue),gt(t),null);case 4:return Ue(),e===null&&fu(t.stateNode.containerInfo),gt(t),null;case 10:return mn(t.type),gt(t),null;case 19:if(H(Ct),r=t.memoizedState,r===null)return gt(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)ts(r,!1);else{if(Nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=mi(e),d!==null){for(t.flags|=128,ts(r,!1),e=d.updateQueue,t.updateQueue=e,Ei(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)ff(a,e),a=a.sibling;return F(Ct,Ct.current&1|2),Qe&&dn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>Oi&&(t.flags|=128,c=!0,ts(r,!1),t.lanes=4194304)}else{if(!c)if(e=mi(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ei(t,e),ts(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Qe)return gt(t),null}else 2*Oe()-r.renderingStartTime>Oi&&a!==536870912&&(t.flags|=128,c=!0,ts(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,a=Ct.current,F(Ct,c?a&1|2:a&1),Qe&&dn(t,r.treeForkCount),e):(gt(t),null);case 22:case 23:return pa(t),mc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),a=t.updateQueue,a!==null&&Ei(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&H(gl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),mn(Dt),gt(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function ob(e,t){switch(Wo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mn(Dt),Ue(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ft(t),null;case 31:if(t.memoizedState!==null){if(pa(t),t.alternate===null)throw Error(i(340));ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(pa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(Ct),null;case 4:return Ue(),null;case 10:return mn(t.type),null;case 22:case 23:return pa(t),mc(),e!==null&&H(gl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return mn(Dt),null;case 25:return null;default:return null}}function Bm(e,t){switch(Wo(t),t.tag){case 3:mn(Dt),Ue();break;case 26:case 27:case 5:Ft(t);break;case 4:Ue();break;case 31:t.memoizedState!==null&&pa(t);break;case 13:pa(t);break;case 19:H(Ct);break;case 10:mn(t.type);break;case 22:case 23:pa(t),mc(),e!==null&&H(gl);break;case 24:mn(Dt)}}function as(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var c=r.next;a=c;do{if((a.tag&e)===e){r=void 0;var d=a.create,x=a.inst;r=d(),x.destroy=r}a=a.next}while(a!==c)}}catch(S){rt(t,t.return,S)}}function qn(e,t,a){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&e)===e){var x=r.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,c=t;var E=a,L=S;try{L()}catch(K){rt(c,E,K)}}}r=r.next}while(r!==d)}}catch(K){rt(t,t.return,K)}}function qm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{zf(t,a)}catch(r){rt(e,e.return,r)}}}function $m(e,t,a){a.props=Sl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){rt(e,t,r)}}function ns(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(c){rt(e,t,c)}}function tn(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(c){rt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){rt(e,t,c)}else a.current=null}function Ym(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(c){rt(e,e.return,c)}}function Kc(e,t,a){try{var r=e.stateNode;zb(r,e.type,a,t),r[fe]=t}catch(c){rt(e,e.return,c)}}function Gm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qn(e.type)||e.tag===4}function Xc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gm(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&&Qn(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 Qc(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=on));else if(r!==4&&(r===27&&Qn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,a),e=e.sibling;e!==null;)Qc(e,t,a),e=e.sibling}function Ci(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Qn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ci(e,t,a),e=e.sibling;e!==null;)Ci(e,t,a),e=e.sibling}function Vm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Qt(t,r,a),t[oe]=e,t[fe]=a}catch(d){rt(e,e.return,d)}}var yn=!1,kt=!1,Zc=!1,Km=typeof WeakSet=="function"?WeakSet:Set,$t=null;function cb(e,t){if(e=e.containerInfo,pu=Zi,e=af(e),$o(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var x=0,S=-1,E=-1,L=0,K=0,I=e,U=null;t:for(;;){for(var $;I!==a||c!==0&&I.nodeType!==3||(S=x+c),I!==d||r!==0&&I.nodeType!==3||(E=x+r),I.nodeType===3&&(x+=I.nodeValue.length),($=I.firstChild)!==null;)U=I,I=$;for(;;){if(I===e)break t;if(U===a&&++L===c&&(S=x),U===d&&++K===r&&(E=x),($=I.nextSibling)!==null)break;I=U,U=I.parentNode}I=$}a=S===-1||E===-1?null:{start:S,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(gu={focusedElem:e,selectionRange:a},Zi=!1,$t=t;$t!==null;)if(t=$t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$t=e;else for(;$t!==null;){switch(t=$t,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,r=a.stateNode;try{var xe=Sl(a.type,c);e=r.getSnapshotBeforeUpdate(xe,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(Re){rt(a,a.return,Re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)bu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bu(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(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$t=e;break}$t=t.return}}function Xm(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:vn(e,a),r&4&&as(5,a);break;case 1:if(vn(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){rt(a,a.return,x)}else{var c=Sl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){rt(a,a.return,x)}}r&64&&qm(a),r&512&&ns(a,a.return);break;case 3:if(vn(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{zf(e,t)}catch(x){rt(a,a.return,x)}}break;case 27:t===null&&r&4&&Vm(a);case 26:case 5:vn(e,a),t===null&&r&4&&Ym(a),r&512&&ns(a,a.return);break;case 12:vn(e,a);break;case 31:vn(e,a),r&4&&Fm(e,a);break;case 13:vn(e,a),r&4&&Jm(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=yb.bind(null,a),Hb(e,a))));break;case 22:if(r=a.memoizedState!==null||yn,!r){t=t!==null&&t.memoizedState!==null||kt,c=yn;var d=kt;yn=r,(kt=t)&&!d?Sn(e,a,(a.subtreeFlags&8772)!==0):vn(e,a),yn=c,kt=d}break;case 30:break;default:vn(e,a)}}function Qm(e){var t=e.alternate;t!==null&&(e.alternate=null,Qm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(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 yt=null,ia=!1;function bn(e,t,a){for(a=a.child;a!==null;)Zm(e,t,a),a=a.sibling}function Zm(e,t,a){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(Ba,a)}catch{}switch(a.tag){case 26:kt||tn(a,t),bn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:kt||tn(a,t);var r=yt,c=ia;Qn(a.type)&&(yt=a.stateNode,ia=!1),bn(e,t,a),fs(a.stateNode),yt=r,ia=c;break;case 5:kt||tn(a,t);case 6:if(r=yt,c=ia,yt=null,bn(e,t,a),yt=r,ia=c,yt!==null)if(ia)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(a.stateNode)}catch(d){rt(a,t,d)}else try{yt.removeChild(a.stateNode)}catch(d){rt(a,t,d)}break;case 18:yt!==null&&(ia?(e=yt,qh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),br(e)):qh(yt,a.stateNode));break;case 4:r=yt,c=ia,yt=a.stateNode.containerInfo,ia=!0,bn(e,t,a),yt=r,ia=c;break;case 0:case 11:case 14:case 15:qn(2,a,t),kt||qn(4,a,t),bn(e,t,a);break;case 1:kt||(tn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&$m(a,t,r)),bn(e,t,a);break;case 21:bn(e,t,a);break;case 22:kt=(r=kt)||a.memoizedState!==null,bn(e,t,a),kt=r;break;default:bn(e,t,a)}}function Fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{br(e)}catch(a){rt(t,t.return,a)}}}function Jm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{br(e)}catch(a){rt(t,t.return,a)}}function ub(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Km),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Km),t;default:throw Error(i(435,e.tag))}}function Ri(e,t){var a=ub(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=bb.bind(null,e,r);r.then(c,c)}})}function oa(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var c=a[r],d=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(Qn(S.type)){yt=S.stateNode,ia=!1;break e}break;case 5:yt=S.stateNode,ia=!1;break e;case 3:case 4:yt=S.stateNode.containerInfo,ia=!0;break e}S=S.return}if(yt===null)throw Error(i(160));Zm(d,x,c),yt=null,ia=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pm(t,e),t=t.sibling}var Ga=null;function Pm(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:oa(t,e),ca(e),r&4&&(qn(3,e,e.return),as(3,e),qn(5,e,e.return));break;case 1:oa(t,e),ca(e),r&512&&(kt||a===null||tn(a,a.return)),r&64&&yn&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var c=Ga;if(oa(t,e),ca(e),r&512&&(kt||a===null||tn(a,a.return)),r&4){var d=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Be]||d[oe]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),Qt(d,r,a),d[oe]=e,ft(d),r=d;break e;case"link":var x=Ph("link","href",c).get(r+(a.href||""));if(x){for(var S=0;S<x.length;S++)if(d=x[S],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(S,1);break t}}d=c.createElement(r),Qt(d,r,a),c.head.appendChild(d);break;case"meta":if(x=Ph("meta","content",c).get(r+(a.content||""))){for(S=0;S<x.length;S++)if(d=x[S],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(S,1);break t}}d=c.createElement(r),Qt(d,r,a),c.head.appendChild(d);break;default:throw Error(i(468,r))}d[oe]=e,ft(d),r=d}e.stateNode=r}else Wh(c,e.type,e.stateNode);else e.stateNode=Jh(c,r,e.memoizedProps);else d!==r?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,r===null?Wh(c,e.type,e.stateNode):Jh(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,a.memoizedProps)}break;case 27:oa(t,e),ca(e),r&512&&(kt||a===null||tn(a,a.return)),a!==null&&r&4&&Kc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(oa(t,e),ca(e),r&512&&(kt||a===null||tn(a,a.return)),e.flags&32){c=e.stateNode;try{Yl(c,"")}catch(xe){rt(e,e.return,xe)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Kc(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Zc=!0);break;case 6:if(oa(t,e),ca(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(xe){rt(e,e.return,xe)}}break;case 3:if(Vi=null,c=Ga,Ga=Yi(t.containerInfo),oa(t,e),Ga=c,ca(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{br(t.containerInfo)}catch(xe){rt(e,e.return,xe)}Zc&&(Zc=!1,Wm(e));break;case 4:r=Ga,Ga=Yi(e.stateNode.containerInfo),oa(t,e),ca(e),Ga=r;break;case 12:oa(t,e),ca(e);break;case 31:oa(t,e),ca(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ri(e,r)));break;case 13:oa(t,e),ca(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(zi=Oe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ri(e,r)));break;case 22:c=e.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,L=yn,K=kt;if(yn=L||c,kt=K||E,oa(t,e),kt=K,yn=L,ca(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||E||yn||kt||_l(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){E=a=t;try{if(d=E.stateNode,c)x=d.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=E.stateNode;var I=E.memoizedProps.style,U=I!=null&&I.hasOwnProperty("display")?I.display:null;S.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(xe){rt(E,E.return,xe)}}}else if(t.tag===6){if(a===null){E=t;try{E.stateNode.nodeValue=c?"":E.memoizedProps}catch(xe){rt(E,E.return,xe)}}}else if(t.tag===18){if(a===null){E=t;try{var $=E.stateNode;c?$h($,!0):$h(E.stateNode,!1)}catch(xe){rt(E,E.return,xe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ri(e,a))));break;case 19:oa(t,e),ca(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ri(e,r)));break;case 30:break;case 21:break;default:oa(t,e),ca(e)}}function ca(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Gm(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=Xc(e);Ci(e,d,c);break;case 5:var x=a.stateNode;a.flags&32&&(Yl(x,""),a.flags&=-33);var S=Xc(e);Ci(e,S,x);break;case 3:case 4:var E=a.stateNode.containerInfo,L=Xc(e);Qc(e,L,E);break;default:throw Error(i(161))}}catch(K){rt(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xm(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qn(4,t,t.return),_l(t);break;case 1:tn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&$m(t,t.return,a),_l(t);break;case 27:fs(t.stateNode);case 26:case 5:tn(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function Sn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,d=t,x=d.flags;switch(d.tag){case 0:case 11:case 15:Sn(c,d,a),as(4,d);break;case 1:if(Sn(c,d,a),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){rt(r,r.return,L)}if(r=d,c=r.updateQueue,c!==null){var S=r.stateNode;try{var E=c.shared.hiddenCallbacks;if(E!==null)for(c.shared.hiddenCallbacks=null,c=0;c<E.length;c++)Tf(E[c],S)}catch(L){rt(r,r.return,L)}}a&&x&64&&qm(d),ns(d,d.return);break;case 27:Vm(d);case 26:case 5:Sn(c,d,a),a&&r===null&&x&4&&Ym(d),ns(d,d.return);break;case 12:Sn(c,d,a);break;case 31:Sn(c,d,a),a&&x&4&&Fm(c,d);break;case 13:Sn(c,d,a),a&&x&4&&Jm(c,d);break;case 22:d.memoizedState===null&&Sn(c,d,a),ns(d,d.return);break;case 30:break;default:Sn(c,d,a)}t=t.sibling}}function Fc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Gr(a))}function Jc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gr(e))}function Va(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Im(e,t,a,r),t=t.sibling}function Im(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Va(e,t,a,r),c&2048&&as(9,t);break;case 1:Va(e,t,a,r);break;case 3:Va(e,t,a,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gr(e)));break;case 12:if(c&2048){Va(e,t,a,r),e=t.stateNode;try{var d=t.memoizedProps,x=d.id,S=d.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){rt(t,t.return,E)}}else Va(e,t,a,r);break;case 31:Va(e,t,a,r);break;case 13:Va(e,t,a,r);break;case 23:break;case 22:d=t.stateNode,x=t.alternate,t.memoizedState!==null?d._visibility&2?Va(e,t,a,r):ls(e,t):d._visibility&2?Va(e,t,a,r):(d._visibility|=2,or(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Fc(x,t);break;case 24:Va(e,t,a,r),c&2048&&Jc(t.alternate,t);break;default:Va(e,t,a,r)}}function or(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,x=t,S=a,E=r,L=x.flags;switch(x.tag){case 0:case 11:case 15:or(d,x,S,E,c),as(8,x);break;case 23:break;case 22:var K=x.stateNode;x.memoizedState!==null?K._visibility&2?or(d,x,S,E,c):ls(d,x):(K._visibility|=2,or(d,x,S,E,c)),c&&L&2048&&Fc(x.alternate,x);break;case 24:or(d,x,S,E,c),c&&L&2048&&Jc(x.alternate,x);break;default:or(d,x,S,E,c)}t=t.sibling}}function ls(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,c=r.flags;switch(r.tag){case 22:ls(a,r),c&2048&&Fc(r.alternate,r);break;case 24:ls(a,r),c&2048&&Jc(r.alternate,r);break;default:ls(a,r)}t=t.sibling}}var rs=8192;function cr(e,t,a){if(e.subtreeFlags&rs)for(e=e.child;e!==null;)eh(e,t,a),e=e.sibling}function eh(e,t,a){switch(e.tag){case 26:cr(e,t,a),e.flags&rs&&e.memoizedState!==null&&Jb(a,Ga,e.memoizedState,e.memoizedProps);break;case 5:cr(e,t,a);break;case 3:case 4:var r=Ga;Ga=Yi(e.stateNode.containerInfo),cr(e,t,a),Ga=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=rs,rs=16777216,cr(e,t,a),rs=r):cr(e,t,a));break;default:cr(e,t,a)}}function th(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 ss(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];$t=r,nh(r,e)}th(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ah(e),e=e.sibling}function ah(e){switch(e.tag){case 0:case 11:case 15:ss(e),e.flags&2048&&qn(9,e,e.return);break;case 3:ss(e);break;case 12:ss(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ti(e)):ss(e);break;default:ss(e)}}function Ti(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];$t=r,nh(r,e)}th(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qn(8,t,t.return),Ti(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ti(t));break;default:Ti(t)}e=e.sibling}}function nh(e,t){for(;$t!==null;){var a=$t;switch(a.tag){case 0:case 11:case 15:qn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Gr(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,$t=r;else e:for(a=e;$t!==null;){r=$t;var c=r.sibling,d=r.return;if(Qm(r),r===a){$t=null;break e}if(c!==null){c.return=d,$t=c;break e}$t=d}}}var db={getCacheForType:function(e){var t=Kt(Dt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Kt(Dt).controller.signal}},fb=typeof WeakMap=="function"?WeakMap:Map,at=0,dt=null,$e=null,Ke=0,lt=0,ga=null,$n=!1,ur=!1,Pc=!1,_n=0,Nt=0,Yn=0,jl=0,Wc=0,xa=0,dr=0,is=null,ua=null,Ic=!1,zi=0,lh=0,Oi=1/0,Di=null,Gn=null,Ut=0,Vn=null,fr=null,jn=0,eu=0,tu=null,rh=null,os=0,au=null;function ya(){return(at&2)!==0&&Ke!==0?Ke&-Ke:M.T!==null?ou():le()}function sh(){if(xa===0)if((Ke&536870912)===0||Qe){var e=tt;tt<<=1,(tt&3932160)===0&&(tt=262144),xa=e}else xa=536870912;return e=ha.current,e!==null&&(e.flags|=32),xa}function da(e,t,a){(e===dt&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&(mr(e,0),Kn(e,Ke,xa,!1)),Ja(e,a),((at&2)===0||e!==dt)&&(e===dt&&((at&2)===0&&(jl|=a),Nt===4&&Kn(e,Ke,xa,!1)),an(e))}function ih(e,t,a){if((at&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||qa(e,t),c=r?pb(e,t):lu(e,t,!0),d=r;do{if(c===0){ur&&!r&&Kn(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!mb(a)){c=lu(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;c=is;var E=S.current.memoizedState.isDehydrated;if(E&&(mr(S,x).flags|=256),x=lu(S,x,!1),x!==2){if(Pc&&!E){S.errorRecoveryDisabledLanes|=d,jl|=d,c=4;break e}d=ua,ua=c,d!==null&&(ua===null?ua=d:ua.push.apply(ua,d))}c=x}if(d=!1,c!==2)continue}}if(c===1){mr(e,0),Kn(e,t,0,!0);break}e:{switch(r=e,d=c,d){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Kn(r,t,xa,!$n);break e;case 2:ua=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=zi+300-Oe(),10<c)){if(Kn(r,t,xa,!$n),sn(r,0,!0)!==0)break e;jn=t,r.timeoutHandle=Hh(oh.bind(null,r,a,ua,Di,Ic,t,xa,jl,dr,$n,d,"Throttled",-0,0),c);break e}oh(r,a,ua,Di,Ic,t,xa,jl,dr,$n,d,null,-0,0)}}break}while(!0);an(e)}function oh(e,t,a,r,c,d,x,S,E,L,K,I,U,$){if(e.timeoutHandle=-1,I=t.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:on},eh(t,d,I);var xe=(d&62914560)===d?zi-Oe():(d&4194048)===d?lh-Oe():0;if(xe=Pb(I,xe),xe!==null){jn=d,e.cancelPendingCommit=xe(gh.bind(null,e,t,d,a,r,c,x,S,E,K,I,null,U,$)),Kn(e,d,x,!L);return}}gh(e,t,d,a,r,c,x,S,E)}function mb(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var c=a[r],d=c.getSnapshot;c=c.value;try{if(!fa(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Kn(e,t,a,r){t&=~Wc,t&=~jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-Bt(c),x=1<<d;r[d]=-1,c&=~x}a!==0&&Ys(e,a,t)}function Mi(){return(at&6)===0?(cs(0),!1):!0}function nu(){if($e!==null){if(lt===0)var e=$e.return;else e=$e,fn=hl=null,bc(e),nr=null,Kr=0,e=$e;for(;e!==null;)Bm(e.alternate,e),e=e.return;$e=null}}function mr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Mb(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),jn=0,nu(),dt=e,$e=a=un(e.current,null),Ke=t,lt=0,ga=null,$n=!1,ur=qa(e,t),Pc=!1,dr=xa=Wc=jl=Yn=Nt=0,ua=is=null,Ic=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Bt(r),d=1<<c;t|=e[c],r&=~d}return _n=t,ei(),a}function ch(e,t){ke=null,M.H=Ir,t===ar||t===oi?(t=wf(),lt=3):t===ic?(t=wf(),lt=4):lt=t===kc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ga=t,$e===null&&(Nt=1,_i(e,Ca(t,e.current)))}function uh(){var e=ha.current;return e===null?!0:(Ke&4194048)===Ke?Oa===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===Oa:!1}function dh(){var e=M.H;return M.H=Ir,e===null?Ir:e}function fh(){var e=M.A;return M.A=db,e}function Ai(){Nt=4,$n||(Ke&4194048)!==Ke&&ha.current!==null||(ur=!0),(Yn&134217727)===0&&(jl&134217727)===0||dt===null||Kn(dt,Ke,xa,!1)}function lu(e,t,a){var r=at;at|=2;var c=dh(),d=fh();(dt!==e||Ke!==t)&&(Di=null,mr(e,t)),t=!1;var x=Nt;e:do try{if(lt!==0&&$e!==null){var S=$e,E=ga;switch(lt){case 8:nu(),x=6;break e;case 3:case 2:case 9:case 6:ha.current===null&&(t=!0);var L=lt;if(lt=0,ga=null,hr(e,S,E,L),a&&ur){x=0;break e}break;default:L=lt,lt=0,ga=null,hr(e,S,E,L)}}hb(),x=Nt;break}catch(K){ch(e,K)}while(!0);return t&&e.shellSuspendCounter++,fn=hl=null,at=r,M.H=c,M.A=d,$e===null&&(dt=null,Ke=0,ei()),x}function hb(){for(;$e!==null;)mh($e)}function pb(e,t){var a=at;at|=2;var r=dh(),c=fh();dt!==e||Ke!==t?(Di=null,Oi=Oe()+500,mr(e,t)):ur=qa(e,t);e:do try{if(lt!==0&&$e!==null){t=$e;var d=ga;t:switch(lt){case 1:lt=0,ga=null,hr(e,t,d,1);break;case 2:case 9:if(jf(d)){lt=0,ga=null,hh(t);break}t=function(){lt!==2&<!==9||dt!==e||(lt=7),an(e)},d.then(t,t);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:jf(d)?(lt=0,ga=null,hh(t)):(lt=0,ga=null,hr(e,t,d,7));break;case 5:var x=null;switch($e.tag){case 26:x=$e.memoizedState;case 5:case 27:var S=$e;if(x?Ih(x):S.stateNode.complete){lt=0,ga=null;var E=S.sibling;if(E!==null)$e=E;else{var L=S.return;L!==null?($e=L,ki(L)):$e=null}break t}}lt=0,ga=null,hr(e,t,d,5);break;case 6:lt=0,ga=null,hr(e,t,d,6);break;case 8:nu(),Nt=6;break e;default:throw Error(i(462))}}gb();break}catch(K){ch(e,K)}while(!0);return fn=hl=null,M.H=r,M.A=c,at=a,$e!==null?0:(dt=null,Ke=0,ei(),Nt)}function gb(){for(;$e!==null&&!Pe();)mh($e)}function mh(e){var t=Um(e.alternate,e,_n);e.memoizedProps=e.pendingProps,t===null?ki(e):$e=t}function hh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Om(a,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Om(a,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:bc(t);default:Bm(a,t),t=$e=ff(t,_n),t=Um(a,t,_n)}e.memoizedProps=e.pendingProps,t===null?ki(e):$e=t}function hr(e,t,a,r){fn=hl=null,bc(t),nr=null,Kr=0;var c=t.return;try{if(lb(e,c,t,a,Ke)){Nt=1,_i(e,Ca(a,e.current)),$e=null;return}}catch(d){if(c!==null)throw $e=c,d;Nt=1,_i(e,Ca(a,e.current)),$e=null;return}t.flags&32768?(Qe||r===1?e=!0:ur||(Ke&536870912)!==0?e=!1:($n=e=!0,(r===2||r===9||r===3||r===6)&&(r=ha.current,r!==null&&r.tag===13&&(r.flags|=16384))),ph(t,e)):ki(t)}function ki(e){var t=e;do{if((t.flags&32768)!==0){ph(t,$n);return}e=t.return;var a=ib(t.alternate,t,_n);if(a!==null){$e=a;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);Nt===0&&(Nt=5)}function ph(e,t){do{var a=ob(e.alternate,e);if(a!==null){a.flags&=32767,$e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=a}while(e!==null);Nt=6,$e=null}function gh(e,t,a,r,c,d,x,S,E){e.cancelPendingCommit=null;do Li();while(Ut!==0);if((at&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=Xo,$s(e,a,d,x,S,E),e===dt&&($e=dt=null,Ke=0),fr=t,Vn=e,jn=a,eu=d,tu=c,rh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,vb(Ht,function(){return Sh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=M.T,M.T=null,c=W.p,W.p=2,x=at,at|=4;try{cb(e,t,a)}finally{at=x,W.p=c,M.T=r}}Ut=1,xh(),yh(),bh()}}function xh(){if(Ut===1){Ut=0;var e=Vn,t=fr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var r=W.p;W.p=2;var c=at;at|=4;try{Pm(t,e);var d=gu,x=af(e.containerInfo),S=d.focusedElem,E=d.selectionRange;if(x!==S&&S&&S.ownerDocument&&tf(S.ownerDocument.documentElement,S)){if(E!==null&&$o(S)){var L=E.start,K=E.end;if(K===void 0&&(K=L),"selectionStart"in S)S.selectionStart=L,S.selectionEnd=Math.min(K,S.value.length);else{var I=S.ownerDocument||document,U=I&&I.defaultView||window;if(U.getSelection){var $=U.getSelection(),xe=S.textContent.length,Re=Math.min(E.start,xe),ot=E.end===void 0?Re:Math.min(E.end,xe);!$.extend&&Re>ot&&(x=ot,ot=Re,Re=x);var D=ef(S,Re),T=ef(S,ot);if(D&&T&&($.rangeCount!==1||$.anchorNode!==D.node||$.anchorOffset!==D.offset||$.focusNode!==T.node||$.focusOffset!==T.offset)){var k=I.createRange();k.setStart(D.node,D.offset),$.removeAllRanges(),Re>ot?($.addRange(k),$.extend(T.node,T.offset)):(k.setEnd(T.node,T.offset),$.addRange(k))}}}}for(I=[],$=S;$=$.parentNode;)$.nodeType===1&&I.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<I.length;S++){var J=I[S];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Zi=!!pu,gu=pu=null}finally{at=c,W.p=r,M.T=a}}e.current=t,Ut=2}}function yh(){if(Ut===2){Ut=0;var e=Vn,t=fr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var r=W.p;W.p=2;var c=at;at|=4;try{Xm(e,t.alternate,t)}finally{at=c,W.p=r,M.T=a}}Ut=3}}function bh(){if(Ut===4||Ut===3){Ut=0,pe();var e=Vn,t=fr,a=jn,r=rh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ut=5:(Ut=0,fr=Vn=null,vh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Gn=null),B(a),t=t.stateNode,Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(Ba,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=M.T,c=W.p,W.p=2,M.T=null;try{for(var d=e.onRecoverableError,x=0;x<r.length;x++){var S=r[x];d(S.value,{componentStack:S.stack})}}finally{M.T=t,W.p=c}}(jn&3)!==0&&Li(),an(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===au?os++:(os=0,au=e):os=0,cs(0)}}function vh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Gr(t)))}function Li(){return xh(),yh(),bh(),Sh()}function Sh(){if(Ut!==5)return!1;var e=Vn,t=eu;eu=0;var a=B(jn),r=M.T,c=W.p;try{W.p=32>a?32:a,M.T=null,a=tu,tu=null;var d=Vn,x=jn;if(Ut=0,fr=Vn=null,jn=0,(at&6)!==0)throw Error(i(331));var S=at;if(at|=4,ah(d.current),Im(d,d.current,x,a),at=S,cs(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(Ba,d)}catch{}return!0}finally{W.p=c,M.T=r,vh(e,t)}}function _h(e,t,a){t=Ca(a,t),t=Ac(e.stateNode,t,2),e=Un(e,t,2),e!==null&&(Ja(e,2),an(e))}function rt(e,t,a){if(e.tag===3)_h(e,e,a);else for(;t!==null;){if(t.tag===3){_h(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gn===null||!Gn.has(r))){e=Ca(a,e),a=jm(2),r=Un(t,a,2),r!==null&&(Nm(a,r,t,e),Ja(r,2),an(r));break}}t=t.return}}function ru(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new fb;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(a)||(Pc=!0,c.add(a),e=xb.bind(null,e,t,a),t.then(e,e))}function xb(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,dt===e&&(Ke&a)===a&&(Nt===4||Nt===3&&(Ke&62914560)===Ke&&300>Oe()-zi?(at&2)===0&&mr(e,0):Wc|=a,dr===Ke&&(dr=0)),an(e)}function jh(e,t){t===0&&(t=rl()),e=dl(e,t),e!==null&&(Ja(e,t),an(e))}function yb(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),jh(e,a)}function bb(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),jh(e,a)}function vb(e,t){return Na(e,t)}var Ui=null,pr=null,su=!1,Hi=!1,iu=!1,Xn=0;function an(e){e!==pr&&e.next===null&&(pr===null?Ui=pr=e:pr=pr.next=e),Hi=!0,su||(su=!0,_b())}function cs(e,t){if(!iu&&Hi){iu=!0;do for(var a=!1,r=Ui;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var x=r.suspendedLanes,S=r.pingedLanes;d=(1<<31-Bt(42|e)+1)-1,d&=c&~(x&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Ch(r,d))}else d=Ke,d=sn(r,r===dt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||qa(r,d)||(a=!0,Ch(r,d));r=r.next}while(a);iu=!1}}function Sb(){Nh()}function Nh(){Hi=su=!1;var e=0;Xn!==0&&Db()&&(e=Xn);for(var t=Oe(),a=null,r=Ui;r!==null;){var c=r.next,d=wh(r,t);d===0?(r.next=null,a===null?Ui=c:a.next=c,c===null&&(pr=a)):(a=r,(e!==0||(d&3)!==0)&&(Hi=!0)),r=c}Ut!==0&&Ut!==5||cs(e),Xn!==0&&(Xn=0)}function wh(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var x=31-Bt(d),S=1<<x,E=c[x];E===-1?((S&a)===0||(S&r)!==0)&&(c[x]=ll(S,t)):E<=t&&(e.expiredLanes|=S),d&=~S}if(t=dt,a=Ke,a=sn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(lt===2||lt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||qa(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),B(a)){case 2:case 8:a=Yt;break;case 32:a=Ht;break;case 268435456:a=ra;break;default:a=Ht}return r=Eh.bind(null,e),a=Na(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function Eh(e,t){if(Ut!==0&&Ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Li()&&e.callbackNode!==a)return null;var r=Ke;return r=sn(e,e===dt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(ih(e,r,t),wh(e,Oe()),e.callbackNode!=null&&e.callbackNode===a?Eh.bind(null,e):null)}function Ch(e,t){if(Li())return null;ih(e,t,!0)}function _b(){Ab(function(){(at&6)!==0?Na(ct,Sb):Nh()})}function ou(){if(Xn===0){var e=er;e===0&&(e=we,we<<=1,(we&261888)===0&&(we=256)),Xn=e}return Xn}function Rh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xs(""+e)}function Th(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function jb(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var d=Rh((c[fe]||null).action),x=r.submitter;x&&(t=(t=x[fe]||null)?Rh(t.formAction):x.getAttribute("formAction"),t!==null&&(d=t,x=null));var S=new Js("action","action",null,r,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Xn!==0){var E=x?Th(c,x):new FormData(c);Rc(a,{pending:!0,data:E,method:c.method,action:d},null,E)}}else typeof d=="function"&&(S.preventDefault(),E=x?Th(c,x):new FormData(c),Rc(a,{pending:!0,data:E,method:c.method,action:d},d,E))},currentTarget:c}]})}}for(var cu=0;cu<Ko.length;cu++){var uu=Ko[cu],Nb=uu.toLowerCase(),wb=uu[0].toUpperCase()+uu.slice(1);Ya(Nb,"on"+wb)}Ya(rf,"onAnimationEnd"),Ya(sf,"onAnimationIteration"),Ya(of,"onAnimationStart"),Ya("dblclick","onDoubleClick"),Ya("focusin","onFocus"),Ya("focusout","onBlur"),Ya($y,"onTransitionRun"),Ya(Yy,"onTransitionStart"),Ya(Gy,"onTransitionCancel"),Ya(cf,"onTransitionEnd"),Pa("onMouseEnter",["mouseout","mouseover"]),Pa("onMouseLeave",["mouseout","mouseover"]),Pa("onPointerEnter",["pointerout","pointerover"]),Pa("onPointerLeave",["pointerout","pointerover"]),qt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qt("onBeforeInput",["compositionend","keypress","textInput","paste"]),qt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var us="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(" "),Eb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(us));function zh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],c=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var x=r.length-1;0<=x;x--){var S=r[x],E=S.instance,L=S.currentTarget;if(S=S.listener,E!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(K){Is(K)}c.currentTarget=null,d=E}else for(x=0;x<r.length;x++){if(S=r[x],E=S.instance,L=S.currentTarget,S=S.listener,E!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(K){Is(K)}c.currentTarget=null,d=E}}}}function Ye(e,t){var a=t[je];a===void 0&&(a=t[je]=new Set);var r=e+"__bubble";a.has(r)||(Oh(t,e,2,!1),a.add(r))}function du(e,t,a){var r=0;t&&(r|=4),Oh(a,e,r,t)}var Bi="_reactListening"+Math.random().toString(36).slice(2);function fu(e){if(!e[Bi]){e[Bi]=!0,Tn.forEach(function(a){a!=="selectionchange"&&(Eb.has(a)||du(a,!1,e),du(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bi]||(t[Bi]=!0,du("selectionchange",!1,t))}}function Oh(e,t,a,r){switch(sp(t)){case 2:var c=e0;break;case 8:c=t0;break;default:c=Cu}a=c.bind(null,t,a,e),c=void 0,!Do||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function mu(e,t,a,r,c){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var x=r.tag;if(x===3||x===4){var S=r.stateNode.containerInfo;if(S===c)break;if(x===4)for(x=r.return;x!==null;){var E=x.tag;if((E===3||E===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;S!==null;){if(x=mt(S),x===null)return;if(E=x.tag,E===5||E===6||E===26||E===27){r=d=x;continue e}S=S.parentNode}}r=r.return}kd(function(){var L=d,K=zo(a),I=[];e:{var U=uf.get(e);if(U!==void 0){var $=Js,xe=e;switch(e){case"keypress":if(Zs(a)===0)break e;case"keydown":case"keyup":$=by;break;case"focusin":xe="focus",$=Lo;break;case"focusout":xe="blur",$=Lo;break;case"beforeblur":case"afterblur":$=Lo;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=Hd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=iy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=_y;break;case rf:case sf:case of:$=uy;break;case cf:$=Ny;break;case"scroll":case"scrollend":$=ry;break;case"wheel":$=Ey;break;case"copy":case"cut":case"paste":$=fy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=qd;break;case"toggle":case"beforetoggle":$=Ry}var Re=(t&4)!==0,ot=!Re&&(e==="scroll"||e==="scrollend"),D=Re?U!==null?U+"Capture":null:U;Re=[];for(var T=L,k;T!==null;){var J=T;if(k=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||k===null||D===null||(J=Dr(T,D),J!=null&&Re.push(ds(T,J,k))),ot)break;T=T.return}0<Re.length&&(U=new $(U,xe,null,a,K),I.push({event:U,listeners:Re}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",U&&a!==To&&(xe=a.relatedTarget||a.fromElement)&&(mt(xe)||xe[me]))break e;if(($||U)&&(U=K.window===K?K:(U=K.ownerDocument)?U.defaultView||U.parentWindow:window,$?(xe=a.relatedTarget||a.toElement,$=L,xe=xe?mt(xe):null,xe!==null&&(ot=u(xe),Re=xe.tag,xe!==ot||Re!==5&&Re!==27&&Re!==6)&&(xe=null)):($=null,xe=L),$!==xe)){if(Re=Hd,J="onMouseLeave",D="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(Re=qd,J="onPointerLeave",D="onPointerEnter",T="pointer"),ot=$==null?U:Fe($),k=xe==null?U:Fe(xe),U=new Re(J,T+"leave",$,a,K),U.target=ot,U.relatedTarget=k,J=null,mt(K)===L&&(Re=new Re(D,T+"enter",xe,a,K),Re.target=k,Re.relatedTarget=ot,J=Re),ot=J,$&&xe)t:{for(Re=Cb,D=$,T=xe,k=0,J=D;J;J=Re(J))k++;J=0;for(var Ne=T;Ne;Ne=Re(Ne))J++;for(;0<k-J;)D=Re(D),k--;for(;0<J-k;)T=Re(T),J--;for(;k--;){if(D===T||T!==null&&D===T.alternate){Re=D;break t}D=Re(D),T=Re(T)}Re=null}else Re=null;$!==null&&Dh(I,U,$,Re,!1),xe!==null&&ot!==null&&Dh(I,ot,xe,Re,!0)}}e:{if(U=L?Fe(L):window,$=U.nodeName&&U.nodeName.toLowerCase(),$==="select"||$==="input"&&U.type==="file")var Ie=Zd;else if(Xd(U))if(Fd)Ie=Hy;else{Ie=Ly;var ve=ky}else $=U.nodeName,!$||$.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&Ro(L.elementType)&&(Ie=Zd):Ie=Uy;if(Ie&&(Ie=Ie(e,L))){Qd(I,Ie,a,K);break e}ve&&ve(e,U,L),e==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&Co(U,"number",U.value)}switch(ve=L?Fe(L):window,e){case"focusin":(Xd(ve)||ve.contentEditable==="true")&&(Xl=ve,Yo=L,qr=null);break;case"focusout":qr=Yo=Xl=null;break;case"mousedown":Go=!0;break;case"contextmenu":case"mouseup":case"dragend":Go=!1,nf(I,a,K);break;case"selectionchange":if(qy)break;case"keydown":case"keyup":nf(I,a,K)}var Le;if(Ho)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Kl?Vd(e,a)&&(Xe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Xe="onCompositionStart");Xe&&($d&&a.locale!=="ko"&&(Kl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Kl&&(Le=Ld()):(zn=K,Mo="value"in zn?zn.value:zn.textContent,Kl=!0)),ve=qi(L,Xe),0<ve.length&&(Xe=new Bd(Xe,e,null,a,K),I.push({event:Xe,listeners:ve}),Le?Xe.data=Le:(Le=Kd(a),Le!==null&&(Xe.data=Le)))),(Le=zy?Oy(e,a):Dy(e,a))&&(Xe=qi(L,"onBeforeInput"),0<Xe.length&&(ve=new Bd("onBeforeInput","beforeinput",null,a,K),I.push({event:ve,listeners:Xe}),ve.data=Le)),jb(I,e,L,a,K)}zh(I,t)})}function ds(e,t,a){return{instance:e,listener:t,currentTarget:a}}function qi(e,t){for(var a=t+"Capture",r=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Dr(e,a),c!=null&&r.unshift(ds(e,c,d)),c=Dr(e,t),c!=null&&r.push(ds(e,c,d))),e.tag===3)return r;e=e.return}return[]}function Cb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dh(e,t,a,r,c){for(var d=t._reactName,x=[];a!==null&&a!==r;){var S=a,E=S.alternate,L=S.stateNode;if(S=S.tag,E!==null&&E===r)break;S!==5&&S!==26&&S!==27||L===null||(E=L,c?(L=Dr(a,d),L!=null&&x.unshift(ds(a,L,E))):c||(L=Dr(a,d),L!=null&&x.push(ds(a,L,E)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var Rb=/\r\n?/g,Tb=/\u0000|\uFFFD/g;function Mh(e){return(typeof e=="string"?e:""+e).replace(Rb,`
|
|
9
|
+
`).replace(Tb,"")}function Ah(e,t){return t=Mh(t),Mh(e)===t}function it(e,t,a,r,c,d){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Yl(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Yl(e,""+r);break;case"className":Et(e,"class",r);break;case"tabIndex":Et(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Et(e,a,r);break;case"style":Md(e,r,d);break;case"data":if(t!=="object"){Et(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Xs(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&it(e,t,"name",c.name,c,null),it(e,t,"formEncType",c.formEncType,c,null),it(e,t,"formMethod",c.formMethod,c,null),it(e,t,"formTarget",c.formTarget,c,null)):(it(e,t,"encType",c.encType,c,null),it(e,t,"method",c.method,c,null),it(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Xs(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=on);break;case"onScroll":r!=null&&Ye("scroll",e);break;case"onScrollEnd":r!=null&&Ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Xs(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),qe(e,"popover",r);break;case"xlinkActuate":Pt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Pt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Pt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Pt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Pt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Pt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":qe(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ny.get(a)||a,qe(e,a,r))}}function hu(e,t,a,r,c,d){switch(a){case"style":Md(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof r=="string"?Yl(e,r):(typeof r=="number"||typeof r=="bigint")&&Yl(e,""+r);break;case"onScroll":r!=null&&Ye("scroll",e);break;case"onScrollEnd":r!=null&&Ye("scrollend",e);break;case"onClick":r!=null&&(e.onclick=on);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$a.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[fe]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof r=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,c);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):qe(e,a,r)}}}function Qt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var r=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var x=a[d];if(x!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:it(e,t,d,x,a,null)}}c&&it(e,t,"srcSet",a.srcSet,a,null),r&&it(e,t,"src",a.src,a,null);return;case"input":Ye("invalid",e);var S=d=x=c=null,E=null,L=null;for(r in a)if(a.hasOwnProperty(r)){var K=a[r];if(K!=null)switch(r){case"name":c=K;break;case"type":x=K;break;case"checked":E=K;break;case"defaultChecked":L=K;break;case"value":d=K;break;case"defaultValue":S=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,t));break;default:it(e,t,r,K,a,null)}}Td(e,d,S,E,L,x,c,!1);return;case"select":Ye("invalid",e),r=x=d=null;for(c in a)if(a.hasOwnProperty(c)&&(S=a[c],S!=null))switch(c){case"value":d=S;break;case"defaultValue":x=S;break;case"multiple":r=S;default:it(e,t,c,S,a,null)}t=d,a=x,e.multiple=!!r,t!=null?$l(e,!!r,t,!1):a!=null&&$l(e,!!r,a,!0);return;case"textarea":Ye("invalid",e),d=c=r=null;for(x in a)if(a.hasOwnProperty(x)&&(S=a[x],S!=null))switch(x){case"value":r=S;break;case"defaultValue":c=S;break;case"children":d=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:it(e,t,x,S,a,null)}Od(e,r,c,d);return;case"option":for(E in a)a.hasOwnProperty(E)&&(r=a[E],r!=null)&&(E==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":it(e,t,E,r,a,null));return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(r=0;r<us.length;r++)Ye(us[r],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("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(L in a)if(a.hasOwnProperty(L)&&(r=a[L],r!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:it(e,t,L,r,a,null)}return;default:if(Ro(t)){for(K in a)a.hasOwnProperty(K)&&(r=a[K],r!==void 0&&hu(e,t,K,r,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(r=a[S],r!=null&&it(e,t,S,r,a,null))}function zb(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,x=null,S=null,E=null,L=null,K=null;for($ in a){var I=a[$];if(a.hasOwnProperty($)&&I!=null)switch($){case"checked":break;case"value":break;case"defaultValue":E=I;default:r.hasOwnProperty($)||it(e,t,$,null,r,I)}}for(var U in r){var $=r[U];if(I=a[U],r.hasOwnProperty(U)&&($!=null||I!=null))switch(U){case"type":d=$;break;case"name":c=$;break;case"checked":L=$;break;case"defaultChecked":K=$;break;case"value":x=$;break;case"defaultValue":S=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,t));break;default:$!==I&&it(e,t,U,$,r,I)}}Eo(e,x,S,E,L,K,d,c);return;case"select":$=x=S=U=null;for(d in a)if(E=a[d],a.hasOwnProperty(d)&&E!=null)switch(d){case"value":break;case"multiple":$=E;default:r.hasOwnProperty(d)||it(e,t,d,null,r,E)}for(c in r)if(d=r[c],E=a[c],r.hasOwnProperty(c)&&(d!=null||E!=null))switch(c){case"value":U=d;break;case"defaultValue":S=d;break;case"multiple":x=d;default:d!==E&&it(e,t,c,d,r,E)}t=S,a=x,r=$,U!=null?$l(e,!!a,U,!1):!!r!=!!a&&(t!=null?$l(e,!!a,t,!0):$l(e,!!a,a?[]:"",!1));return;case"textarea":$=U=null;for(S in a)if(c=a[S],a.hasOwnProperty(S)&&c!=null&&!r.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:it(e,t,S,null,r,c)}for(x in r)if(c=r[x],d=a[x],r.hasOwnProperty(x)&&(c!=null||d!=null))switch(x){case"value":U=c;break;case"defaultValue":$=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&it(e,t,x,c,r,d)}zd(e,U,$);return;case"option":for(var xe in a)U=a[xe],a.hasOwnProperty(xe)&&U!=null&&!r.hasOwnProperty(xe)&&(xe==="selected"?e.selected=!1:it(e,t,xe,null,r,U));for(E in r)U=r[E],$=a[E],r.hasOwnProperty(E)&&U!==$&&(U!=null||$!=null)&&(E==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":it(e,t,E,U,r,$));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 Re in a)U=a[Re],a.hasOwnProperty(Re)&&U!=null&&!r.hasOwnProperty(Re)&&it(e,t,Re,null,r,U);for(L in r)if(U=r[L],$=a[L],r.hasOwnProperty(L)&&U!==$&&(U!=null||$!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,t));break;default:it(e,t,L,U,r,$)}return;default:if(Ro(t)){for(var ot in a)U=a[ot],a.hasOwnProperty(ot)&&U!==void 0&&!r.hasOwnProperty(ot)&&hu(e,t,ot,void 0,r,U);for(K in r)U=r[K],$=a[K],!r.hasOwnProperty(K)||U===$||U===void 0&&$===void 0||hu(e,t,K,U,r,$);return}}for(var D in a)U=a[D],a.hasOwnProperty(D)&&U!=null&&!r.hasOwnProperty(D)&&it(e,t,D,null,r,U);for(I in r)U=r[I],$=a[I],!r.hasOwnProperty(I)||U===$||U==null&&$==null||it(e,t,I,U,r,$)}function kh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ob(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var c=a[r],d=c.transferSize,x=c.initiatorType,S=c.duration;if(d&&S&&kh(x)){for(x=0,S=c.responseEnd,r+=1;r<a.length;r++){var E=a[r],L=E.startTime;if(L>S)break;var K=E.transferSize,I=E.initiatorType;K&&kh(I)&&(E=E.responseEnd,x+=K*(E<S?1:(S-L)/(E-L)))}if(--r,t+=8*(d+x)/(c.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 pu=null,gu=null;function $i(e){return e.nodeType===9?e:e.ownerDocument}function Lh(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 Uh(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 xu(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 yu=null;function Db(){var e=window.event;return e&&e.type==="popstate"?e===yu?!1:(yu=e,!0):(yu=null,!1)}var Hh=typeof setTimeout=="function"?setTimeout:void 0,Mb=typeof clearTimeout=="function"?clearTimeout:void 0,Bh=typeof Promise=="function"?Promise:void 0,Ab=typeof queueMicrotask=="function"?queueMicrotask:typeof Bh<"u"?function(e){return Bh.resolve(null).then(e).catch(kb)}:Hh;function kb(e){setTimeout(function(){throw e})}function Qn(e){return e==="head"}function qh(e,t){var a=t,r=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(c),br(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")fs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,fs(a);for(var d=a.firstChild;d;){var x=d.nextSibling,S=d.nodeName;d[Be]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=x}}else a==="body"&&fs(e.ownerDocument.body);a=c}while(a);br(t)}function $h(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function bu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":bu(a),ut(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Lb(e,t,a,r){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Be])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Da(e.nextSibling),e===null)break}return null}function Ub(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Da(e.nextSibling),e===null))return null;return e}function Yh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Da(e.nextSibling),e===null))return null;return e}function vu(e){return e.data==="$?"||e.data==="$~"}function Su(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Hb(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Da(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 _u=null;function Gh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Da(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Vh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Kh(e,t,a){switch(t=$i(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function fs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var Ma=new Map,Xh=new Set;function Yi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Nn=W.d;W.d={f:Bb,r:qb,D:$b,C:Yb,L:Gb,m:Vb,X:Xb,S:Kb,M:Qb};function Bb(){var e=Nn.f(),t=Mi();return e||t}function qb(e){var t=_t(e);t!==null&&t.tag===5&&t.type==="form"?cm(t):Nn.r(e)}var gr=typeof document>"u"?null:document;function Qh(e,t,a){var r=gr;if(r&&typeof t=="string"&&t){var c=wa(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Xh.has(c)||(Xh.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Qt(t,"link",e),ft(t),r.head.appendChild(t)))}}function $b(e){Nn.D(e),Qh("dns-prefetch",e,null)}function Yb(e,t){Nn.C(e,t),Qh("preconnect",e,t)}function Gb(e,t,a){Nn.L(e,t,a);var r=gr;if(r&&e&&t){var c='link[rel="preload"][as="'+wa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+wa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+wa(a.imageSizes)+'"]')):c+='[href="'+wa(e)+'"]';var d=c;switch(t){case"style":d=xr(e);break;case"script":d=yr(e)}Ma.has(d)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ma.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(ms(d))||t==="script"&&r.querySelector(hs(d))||(t=r.createElement("link"),Qt(t,"link",e),ft(t),r.head.appendChild(t)))}}function Vb(e,t){Nn.m(e,t);var a=gr;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+wa(r)+'"][href="'+wa(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=yr(e)}if(!Ma.has(d)&&(e=y({rel:"modulepreload",href:e},t),Ma.set(d,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(hs(d)))return}r=a.createElement("link"),Qt(r,"link",e),ft(r),a.head.appendChild(r)}}}function Kb(e,t,a){Nn.S(e,t,a);var r=gr;if(r&&e){var c=Lt(r).hoistableStyles,d=xr(e);t=t||"default";var x=c.get(d);if(!x){var S={loading:0,preload:null};if(x=r.querySelector(ms(d)))S.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ma.get(d))&&ju(e,a);var E=x=r.createElement("link");ft(E),Qt(E,"link",e),E._p=new Promise(function(L,K){E.onload=L,E.onerror=K}),E.addEventListener("load",function(){S.loading|=1}),E.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Gi(x,t,r)}x={type:"stylesheet",instance:x,count:1,state:S},c.set(d,x)}}}function Xb(e,t){Nn.X(e,t);var a=gr;if(a&&e){var r=Lt(a).hoistableScripts,c=yr(e),d=r.get(c);d||(d=a.querySelector(hs(c)),d||(e=y({src:e,async:!0},t),(t=Ma.get(c))&&Nu(e,t),d=a.createElement("script"),ft(d),Qt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Qb(e,t){Nn.M(e,t);var a=gr;if(a&&e){var r=Lt(a).hoistableScripts,c=yr(e),d=r.get(c);d||(d=a.querySelector(hs(c)),d||(e=y({src:e,async:!0,type:"module"},t),(t=Ma.get(c))&&Nu(e,t),d=a.createElement("script"),ft(d),Qt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Zh(e,t,a,r){var c=(c=_e.current)?Yi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=xr(a.href),a=Lt(c).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=xr(a.href);var d=Lt(c).hoistableStyles,x=d.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,x),(d=c.querySelector(ms(e)))&&!d._p&&(x.instance=d,x.state.loading=5),Ma.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ma.set(e,a),d||Zb(c,e,a,x.state))),t&&r===null)throw Error(i(528,""));return x}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=yr(a),a=Lt(c).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function xr(e){return'href="'+wa(e)+'"'}function ms(e){return'link[rel="stylesheet"]['+e+"]"}function Fh(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Zb(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Qt(t,"link",a),ft(t),e.head.appendChild(t))}function yr(e){return'[src="'+wa(e)+'"]'}function hs(e){return"script[async]"+e}function Jh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+wa(a.href)+'"]');if(r)return t.instance=r,ft(r),r;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),ft(r),Qt(r,"style",c),Gi(r,a.precedence,e),t.instance=r;case"stylesheet":c=xr(a.href);var d=e.querySelector(ms(c));if(d)return t.state.loading|=4,t.instance=d,ft(d),d;r=Fh(a),(c=Ma.get(c))&&ju(r,c),d=(e.ownerDocument||e).createElement("link"),ft(d);var x=d;return x._p=new Promise(function(S,E){x.onload=S,x.onerror=E}),Qt(d,"link",r),t.state.loading|=4,Gi(d,a.precedence,e),t.instance=d;case"script":return d=yr(a.src),(c=e.querySelector(hs(d)))?(t.instance=c,ft(c),c):(r=a,(c=Ma.get(d))&&(r=y({},a),Nu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),ft(c),Qt(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Gi(r,a.precedence,e));return t.instance}function Gi(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,x=0;x<r.length;x++){var S=r[x];if(S.dataset.precedence===t)d=S;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function ju(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Nu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vi=null;function Ph(e,t,a){if(Vi===null){var r=new Map,c=Vi=new Map;c.set(a,r)}else c=Vi,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Be]||d[oe]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var x=d.getAttribute(t)||"";x=e+x;var S=r.get(x);S?S.push(d):r.set(x,[d])}}return r}function Wh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Fb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ih(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jb(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=xr(r.href),d=t.querySelector(ms(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ki.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,ft(d);return}d=t.ownerDocument||t,r=Fh(r),(c=Ma.get(c))&&ju(r,c),d=d.createElement("link"),ft(d);var x=d;x._p=new Promise(function(S,E){x.onload=S,x.onerror=E}),Qt(d,"link",r),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Ki.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var wu=0;function Pb(e,t){return e.stylesheets&&e.count===0&&Qi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Qi(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&wu===0&&(wu=62500*Ob());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qi(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>wu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Ki(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xi=null;function Qi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xi=new Map,t.forEach(Wb,e),Xi=null,Ki.call(e))}function Wb(e,t){if(!(t.state.loading&4)){var a=Xi.get(e);if(a)var r=a.get(null);else{a=new Map,Xi.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var x=c[d];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),r=x)}r&&a.set(null,r)}c=t.instance,x=c.getAttribute("data-precedence"),d=a.get(x)||r,d===r&&a.set(null,c),a.set(x,c),this.count++,r=Ki.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ps={$$typeof:V,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function Ib(e,t,a,r,c,d,x,S,E){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fa(0),this.hiddenUpdates=Fa(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function ep(e,t,a,r,c,d,x,S,E,L,K,I){return e=new Ib(e,t,a,x,E,L,K,I,S),t=1,d===!0&&(t|=24),d=ma(3,null,null,t),e.current=d,d.stateNode=e,t=lc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:a,cache:t},oc(d),e}function tp(e){return e?(e=Fl,e):Fl}function ap(e,t,a,r,c,d){c=tp(c),r.context===null?r.context=c:r.pendingContext=c,r=Ln(t),r.payload={element:a},d=d===void 0?null:d,d!==null&&(r.callback=d),a=Un(e,r,t),a!==null&&(da(a,e,t),Qr(a,e,t))}function np(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Eu(e,t){np(e,t),(e=e.alternate)&&np(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=dl(e,67108864);t!==null&&da(t,e,67108864),Eu(e,67108864)}}function rp(e){if(e.tag===13||e.tag===31){var t=ya();t=O(t);var a=dl(e,t);a!==null&&da(a,e,t),Eu(e,t)}}var Zi=!0;function e0(e,t,a,r){var c=M.T;M.T=null;var d=W.p;try{W.p=2,Cu(e,t,a,r)}finally{W.p=d,M.T=c}}function t0(e,t,a,r){var c=M.T;M.T=null;var d=W.p;try{W.p=8,Cu(e,t,a,r)}finally{W.p=d,M.T=c}}function Cu(e,t,a,r){if(Zi){var c=Ru(r);if(c===null)mu(e,t,r,Fi,a),ip(e,r);else if(n0(c,e,t,a,r))r.stopPropagation();else if(ip(e,r),t&4&&-1<a0.indexOf(e)){for(;c!==null;){var d=_t(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var x=Je(d.pendingLanes);if(x!==0){var S=d;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var E=1<<31-Bt(x);S.entanglements[1]|=E,x&=~E}an(d),(at&6)===0&&(Oi=Oe()+500,cs(0))}}break;case 31:case 13:S=dl(d,2),S!==null&&da(S,d,2),Mi(),Eu(d,2)}if(d=Ru(r),d===null&&mu(e,t,r,Fi,a),d===c)break;c=d}c!==null&&r.stopPropagation()}else mu(e,t,r,null,a)}}function Ru(e){return e=zo(e),Tu(e)}var Fi=null;function Tu(e){if(Fi=null,e=mt(e),e!==null){var t=u(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Fi=e,null}function sp(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(Ve()){case ct:return 2;case Yt:return 8;case Ht:case bt:return 32;case ra:return 268435456;default:return 32}default:return 32}}var zu=!1,Zn=null,Fn=null,Jn=null,gs=new Map,xs=new Map,Pn=[],a0="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 ip(e,t){switch(e){case"focusin":case"focusout":Zn=null;break;case"dragenter":case"dragleave":Fn=null;break;case"mouseover":case"mouseout":Jn=null;break;case"pointerover":case"pointerout":gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xs.delete(t.pointerId)}}function ys(e,t,a,r,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:d,targetContainers:[c]},t!==null&&(t=_t(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function n0(e,t,a,r,c){switch(t){case"focusin":return Zn=ys(Zn,e,t,a,r,c),!0;case"dragenter":return Fn=ys(Fn,e,t,a,r,c),!0;case"mouseover":return Jn=ys(Jn,e,t,a,r,c),!0;case"pointerover":var d=c.pointerId;return gs.set(d,ys(gs.get(d)||null,e,t,a,r,c)),!0;case"gotpointercapture":return d=c.pointerId,xs.set(d,ys(xs.get(d)||null,e,t,a,r,c)),!0}return!1}function op(e){var t=mt(e.target);if(t!==null){var a=u(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,re(e.priority,function(){rp(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,re(e.priority,function(){rp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ji(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Ru(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);To=r,a.target.dispatchEvent(r),To=null}else return t=_t(a),t!==null&&lp(t),e.blockedOn=a,!1;t.shift()}return!0}function cp(e,t,a){Ji(e)&&a.delete(t)}function l0(){zu=!1,Zn!==null&&Ji(Zn)&&(Zn=null),Fn!==null&&Ji(Fn)&&(Fn=null),Jn!==null&&Ji(Jn)&&(Jn=null),gs.forEach(cp),xs.forEach(cp)}function Pi(e,t){e.blockedOn===t&&(e.blockedOn=null,zu||(zu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,l0)))}var Wi=null;function up(e){Wi!==e&&(Wi=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Wi===e&&(Wi=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Tu(r||a)===null)continue;break}var d=_t(a);d!==null&&(e.splice(t,3),t-=3,Rc(d,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function br(e){function t(E){return Pi(E,e)}Zn!==null&&Pi(Zn,e),Fn!==null&&Pi(Fn,e),Jn!==null&&Pi(Jn,e),gs.forEach(t),xs.forEach(t);for(var a=0;a<Pn.length;a++){var r=Pn[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Pn.length&&(a=Pn[0],a.blockedOn===null);)op(a),a.blockedOn===null&&Pn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var c=a[r],d=a[r+1],x=c[fe]||null;if(typeof d=="function")x||up(a);else if(x){var S=null;if(d&&d.hasAttribute("formAction")){if(c=d,x=d[fe]||null)S=x.formAction;else if(Tu(c)!==null)continue}else S=x.action;typeof S=="function"?a[r+1]=S:(a.splice(r,3),r-=3),up(a)}}}function dp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(x){return c=x})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Ou(e){this._internalRoot=e}Ii.prototype.render=Ou.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=ya();ap(a,r,e,t,null,null)},Ii.prototype.unmount=Ou.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),Mi(),t[me]=null}};function Ii(e){this._internalRoot=e}Ii.prototype.unstable_scheduleHydration=function(e){if(e){var t=le();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Pn.length&&t!==0&&t<Pn[a].priority;a++);Pn.splice(a,0,e),a===0&&op(e)}};var fp=l.version;if(fp!=="19.2.4")throw Error(i(527,fp,"19.2.4"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=h(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var r0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eo.isDisabled&&eo.supportsFiber)try{Ba=eo.inject(r0),Gt=eo}catch{}}return Ss.createRoot=function(e,t){if(!o(e))throw Error(i(299));var a=!1,r="",c=bm,d=vm,x=Sm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=ep(e,1,!1,null,null,a,r,null,c,d,x,dp),e[me]=t.current,fu(e),new Ou(t)},Ss.hydrateRoot=function(e,t,a){if(!o(e))throw Error(i(299));var r=!1,c="",d=bm,x=vm,S=Sm,E=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=ep(e,1,!0,t,a??null,r,c,E,d,x,S,dp),t.context=tp(null),a=t.current,r=ya(),r=O(r),c=Ln(r),c.callback=null,Un(a,c,r),a=r,t.current.lanes=a,Ja(t,a),an(t),e[me]=t.current,fu(e),new Ii(t)},Ss.version="19.2.4",Ss}var Gp;function jv(){if(Gp)return Bu.exports;Gp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Bu.exports=_v(),Bu.exports}var Nv=jv();var Jg=n=>{throw TypeError(n)},wv=(n,l,s)=>l.has(n)||Jg("Cannot "+s),Gu=(n,l,s)=>(wv(n,l,"read from private field"),s?s.call(n):l.get(n)),Ev=(n,l,s)=>l.has(n)?Jg("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,s),Vp="popstate";function Kp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function Cv(n={}){function l(i,o){let u=o.state?.masked,{pathname:m,search:p,hash:g}=u||i.location;return Os("",{pathname:m,search:p,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function s(i,o){return typeof o=="string"?o:rn(o)}return Tv(l,s,null,n)}function He(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function wt(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Rv(){return Math.random().toString(36).substring(2,10)}function Xp(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Os(n,l,s=null,i,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Cn(l):l,state:s,key:l&&l.key||i||Rv(),unstable_mask:o}}function rn({pathname:n="/",search:l="",hash:s=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Cn(n){let l={};if(n){let s=n.indexOf("#");s>=0&&(l.hash=n.substring(s),n=n.substring(0,s));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function Tv(n,l,s,i={}){let{window:o=document.defaultView,v5Compat:u=!1}=i,m=o.history,p="POP",g=null,h=v();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function v(){return(m.state||{idx:null}).idx}function y(){p="POP";let A=v(),X=A==null?null:A-h;h=A,g&&g({action:p,location:z.location,delta:X})}function _(A,X){p="PUSH";let Q=Kp(A)?A:Os(z.location,A,X);h=v()+1;let V=Xp(Q,h),G=z.createHref(Q.unstable_mask||Q);try{m.pushState(V,"",G)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;o.location.assign(G)}u&&g&&g({action:p,location:z.location,delta:1})}function j(A,X){p="REPLACE";let Q=Kp(A)?A:Os(z.location,A,X);h=v();let V=Xp(Q,h),G=z.createHref(Q.unstable_mask||Q);m.replaceState(V,"",G),u&&g&&g({action:p,location:z.location,delta:0})}function R(A){return Pg(A)}let z={get action(){return p},get location(){return n(o,m)},listen(A){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(Vp,y),g=A,()=>{o.removeEventListener(Vp,y),g=null}},createHref(A){return l(o,A)},createURL:R,encodeLocation(A){let X=R(A);return{pathname:X.pathname,search:X.search,hash:X.hash}},push:_,replace:j,go(A){return m.go(A)}};return z}function Pg(n,l=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),He(s,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:rn(n);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=s+i),new URL(i,s)}var ws,Qp=class{constructor(n){if(Ev(this,ws,new Map),n)for(let[l,s]of n)this.set(l,s)}get(n){if(Gu(this,ws).has(n))return Gu(this,ws).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,l){Gu(this,ws).set(n,l)}};ws=new WeakMap;var zv=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ov(n){return zv.has(n)}var Dv=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Mv(n){return Dv.has(n)}function Av(n){return n.index===!0}function Ds(n,l,s=[],i={},o=!1){return n.map((u,m)=>{let p=[...s,String(m)],g=typeof u.id=="string"?u.id:p.join("-");if(He(u.index!==!0||!u.children,"Cannot specify children on an index route"),He(o||!i[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),Av(u)){let h={...u,id:g};return i[g]=Zp(h,l(h)),h}else{let h={...u,id:g,children:void 0};return i[g]=Zp(h,l(h)),u.children&&(h.children=Ds(u.children,l,p,i,o)),h}})}function Zp(n,l){return Object.assign(n,{...l,...typeof l.lazy=="object"&&l.lazy!=null?{lazy:{...n.lazy,...l.lazy}}:{}})}function In(n,l,s="/"){return Es(n,l,s,!1)}function Es(n,l,s,i){let o=typeof l=="string"?Cn(l):l,u=La(o.pathname||"/",s);if(u==null)return null;let m=Wg(n);Lv(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Qv(u);p=Kv(m[g],h,i)}return p}function kv(n,l){let{route:s,pathname:i,params:o}=n;return{id:s.id,pathname:i,params:o,data:l[s.id],loaderData:l[s.id],handle:s.handle}}function Wg(n,l=[],s=[],i="",o=!1){let u=(m,p,g=o,h)=>{let v={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(i)&&g)return;He(v.relativePath.startsWith(i),`Absolute route path "${v.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(i.length)}let y=Ka([i,v.relativePath]),_=s.concat(v);m.children&&m.children.length>0&&(He(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Wg(m.children,l,_,y,g)),!(m.path==null&&!m.index)&&l.push({path:y,score:Gv(y,m.index),routesMeta:_})};return n.forEach((m,p)=>{if(m.path===""||!m.path?.includes("?"))u(m,p);else for(let g of Ig(m.path))u(m,p,!0,g)}),l}function Ig(n){let l=n.split("/");if(l.length===0)return[];let[s,...i]=l,o=s.endsWith("?"),u=s.replace(/\?$/,"");if(i.length===0)return o?[u,""]:[u];let m=Ig(i.join("/")),p=[];return p.push(...m.map(g=>g===""?u:[u,g].join("/"))),o&&p.push(...m),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function Lv(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:Vv(l.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var Uv=/^:[\w-]+$/,Hv=3,Bv=2,qv=1,$v=10,Yv=-2,Fp=n=>n==="*";function Gv(n,l){let s=n.split("/"),i=s.length;return s.some(Fp)&&(i+=Yv),l&&(i+=Bv),s.filter(o=>!Fp(o)).reduce((o,u)=>o+(Uv.test(u)?Hv:u===""?qv:$v),i)}function Vv(n,l){return n.length===l.length&&n.slice(0,-1).every((i,o)=>i===l[o])?n[n.length-1]-l[l.length-1]:0}function Kv(n,l,s=!1){let{routesMeta:i}=n,o={},u="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,v=u==="/"?l:l.slice(u.length)||"/",y=go({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},v),_=g.route;if(!y&&h&&s&&!i[i.length-1].route.index&&(y=go({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!y)return null;Object.assign(o,y.params),m.push({params:o,pathname:Ka([u,y.pathname]),pathnameBase:Jv(Ka([u,y.pathnameBase])),route:_}),y.pathnameBase!=="/"&&(u=Ka([u,y.pathnameBase]))}return m}function go(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=Xv(n.path,n.caseSensitive,n.end),o=l.match(s);if(!o)return null;let u=o[0],m=u.replace(/(.)\/+$/,"$1"),p=o.slice(1);return{params:i.reduce((h,{paramName:v,isOptional:y},_)=>{if(v==="*"){let R=p[_]||"";m=u.slice(0,u.length-R.length).replace(/(.)\/+$/,"$1")}const j=p[_];return y&&!j?h[v]=void 0:h[v]=(j||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:m,pattern:n}}function Xv(n,l=!1,s=!0){wt(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],o="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g,h,v)=>{if(i.push({paramName:p,isOptional:g!=null}),g){let y=v.charAt(h+m.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,l?void 0:"i"),i]}function Qv(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return wt(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function La(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,i=n.charAt(s);return i&&i!=="/"?null:n.slice(s)||"/"}function Zv({basename:n,pathname:l}){return l==="/"?n:Ka([n,l])}var ex=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gd=n=>ex.test(n);function Fv(n,l="/"){let{pathname:s,search:i="",hash:o=""}=typeof n=="string"?Cn(n):n,u;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?u=Jp(s.substring(1),"/"):u=Jp(s,l)):u=l,{pathname:u,search:Pv(i),hash:Wv(o)}}function Jp(n,l){let s=l.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function Vu(n,l,s,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function tx(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function vo(n){let l=tx(n);return l.map((s,i)=>i===l.length-1?s.pathname:s.pathnameBase)}function ks(n,l,s,i=!1){let o;typeof n=="string"?o=Cn(n):(o={...n},He(!o.pathname||!o.pathname.includes("?"),Vu("?","pathname","search",o)),He(!o.pathname||!o.pathname.includes("#"),Vu("#","pathname","hash",o)),He(!o.search||!o.search.includes("#"),Vu("#","search","hash",o)));let u=n===""||o.pathname==="",m=u?"/":o.pathname,p;if(m==null)p=s;else{let y=l.length-1;if(!i&&m.startsWith("..")){let _=m.split("/");for(;_[0]==="..";)_.shift(),y-=1;o.pathname=_.join("/")}p=y>=0?l[y]:"/"}let g=Fv(o,p),h=m&&m!=="/"&&m.endsWith("/"),v=(u||m===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(h||v)&&(g.pathname+="/"),g}var Ka=n=>n.join("/").replace(/\/\/+/g,"/"),Jv=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Pv=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Wv=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Ls=class{constructor(n,l,s,i=!1){this.status=n,this.statusText=l||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Ms(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Us(n){return n.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ax=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function nx(n,l){let s=n;if(typeof s!="string"||!ex.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(ax)try{let u=new URL(window.location.href),m=s.startsWith("//")?new URL(u.protocol+s):new URL(s),p=La(m.pathname,l);m.origin===u.origin&&p!=null?s=p+m.search+m.hash:o=!0}catch{wt(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:o,to:s}}var tl=Symbol("Uninstrumented");function Iv(n,l){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(o=>o({id:l.id,index:l.index,path:l.path,instrument(u){let m=Object.keys(s);for(let p of m)u[p]&&s[p].push(u[p])}}));let i={};if(typeof l.lazy=="function"&&s.lazy.length>0){let o=wr(s.lazy,l.lazy,()=>{});o&&(i.lazy=o)}if(typeof l.lazy=="object"){let o=l.lazy;["middleware","loader","action"].forEach(u=>{let m=o[u],p=s[`lazy.${u}`];if(typeof m=="function"&&p.length>0){let g=wr(p,m,()=>{});g&&(i.lazy=Object.assign(i.lazy||{},{[u]:g}))}})}return["loader","action"].forEach(o=>{let u=l[o];if(typeof u=="function"&&s[o].length>0){let m=u[tl]??u,p=wr(s[o],m,(...g)=>Pp(g[0]));p&&(o==="loader"&&m.hydrate===!0&&(p.hydrate=!0),p[tl]=m,i[o]=p)}}),l.middleware&&l.middleware.length>0&&s.middleware.length>0&&(i.middleware=l.middleware.map(o=>{let u=o[tl]??o,m=wr(s.middleware,u,(...p)=>Pp(p[0]));return m?(m[tl]=u,m):o})),i}function e1(n,l){let s={navigate:[],fetch:[]};if(l.forEach(i=>i({instrument(o){let u=Object.keys(o);for(let m of u)o[m]&&s[m].push(o[m])}})),s.navigate.length>0){let i=n.navigate[tl]??n.navigate,o=wr(s.navigate,i,(...u)=>{let[m,p]=u;return{to:typeof m=="number"||typeof m=="string"?m:m?rn(m):".",...Wp(n,p??{})}});o&&(o[tl]=i,n.navigate=o)}if(s.fetch.length>0){let i=n.fetch[tl]??n.fetch,o=wr(s.fetch,i,(...u)=>{let[m,,p,g]=u;return{href:p??".",fetcherKey:m,...Wp(n,g??{})}});o&&(o[tl]=i,n.fetch=o)}return n}function wr(n,l,s){return n.length===0?null:async(...i)=>{let o=await lx(n,s(...i),()=>l(...i),n.length-1);if(o.type==="error")throw o.value;return o.value}}async function lx(n,l,s,i){let o=n[i],u;if(o){let m,p=async()=>(m?console.error("You cannot call instrumented handlers more than once"):m=lx(n,l,s,i-1),u=await m,He(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(p,l)}catch(g){console.error("An instrumentation function threw an error:",g)}m||await p(),await m}else try{u={type:"success",value:await s()}}catch(m){u={type:"error",value:m}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Pp(n){let{request:l,context:s,params:i,unstable_pattern:o}=n;return{request:t1(l),params:{...i},unstable_pattern:o,context:a1(s)}}function Wp(n,l){return{currentUrl:rn(n.state.location),..."formMethod"in l?{formMethod:l.formMethod}:{},..."formEncType"in l?{formEncType:l.formEncType}:{},..."formData"in l?{formData:l.formData}:{},..."body"in l?{body:l.body}:{}}}function t1(n){return{method:n.method,url:n.url,headers:{get:(...l)=>n.headers.get(...l)}}}function a1(n){if(l1(n)){let l={...n};return Object.freeze(l),l}else return{get:l=>n.get(l)}}var n1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function l1(n){if(n===null||typeof n!="object")return!1;const l=Object.getPrototypeOf(n);return l===Object.prototype||l===null||Object.getOwnPropertyNames(l).sort().join("\0")===n1}var rx=["POST","PUT","PATCH","DELETE"],r1=new Set(rx),s1=["GET",...rx],i1=new Set(s1),sx=new Set([301,302,303,307,308]),o1=new Set([307,308]),Ku={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},c1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_s={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},u1=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),ix="remix-router-transitions",ox=Symbol("ResetLoaderData");function d1(n){const l=n.window?n.window:typeof window<"u"?window:void 0,s=typeof l<"u"&&typeof l.document<"u"&&typeof l.document.createElement<"u";He(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=n.hydrationRouteProperties||[],o=n.mapRouteProperties||u1,u=o;if(n.unstable_instrumentations){let C=n.unstable_instrumentations;u=O=>({...o(O),...Iv(C.map(B=>B.route).filter(Boolean),O)})}let m={},p=Ds(n.routes,u,void 0,m),g,h=n.basename||"/";h.startsWith("/")||(h=`/${h}`);let v=n.dataStrategy||g1,y={...n.future},_=null,j=new Set,R=null,z=null,A=null,X=n.hydrationData!=null,Q=In(p,n.history.location,h),V=!1,G=null,Y,te;if(Q==null&&!n.patchRoutesOnNavigation){let C=Aa(404,{pathname:n.history.location.pathname}),{matches:O,route:B}=ao(p);Y=!0,te=!Y,Q=O,G={[B.id]:C}}else if(Q&&!n.hydrationData&&Fa(Q,p,n.history.location.pathname).active&&(Q=null),Q)if(Q.some(C=>C.route.lazy))Y=!1,te=!Y;else if(!Q.some(C=>xd(C.route)))Y=!0,te=!Y;else{let C=n.hydrationData?n.hydrationData.loaderData:null,O=n.hydrationData?n.hydrationData.errors:null,B=Q;if(O){let le=Q.findIndex(re=>O[re.route.id]!==void 0);B=B.slice(0,le+1)}te=!1,Y=B.every(le=>{let re=cx(le.route,C,O);return te=te||re.renderFallback,!re.shouldLoad})}else{Y=!1,te=!Y,Q=[];let C=Fa(null,p,n.history.location.pathname);C.active&&C.matches&&(V=!0,Q=C.matches)}let ee,w={historyAction:n.history.action,location:n.history.location,matches:Q,initialized:Y,renderFallback:te,navigation:Ku,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||G,fetchers:new Map,blockers:new Map},q="POP",Z=null,de=!1,se,ye=!1,ae=new Map,ie=null,M=!1,W=!1,ce=new Set,P=new Map,be=0,N=-1,H=new Map,F=new Set,ne=new Map,he=new Map,_e=new Set,ze=new Map,Ze,Ue=null;function na(){if(_=n.history.listen(({action:C,location:O,delta:B})=>{if(Ze){Ze(),Ze=void 0;return}wt(ze.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let le=St({currentLocation:w.location,nextLocation:O,historyAction:C});if(le&&B!=null){let re=new Promise(ge=>{Ze=ge});n.history.go(B*-1),tt(le,{state:"blocked",location:O,proceed(){tt(le,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),re.then(()=>n.history.go(B))},reset(){let ge=new Map(w.blockers);ge.set(le,_s),Ge({blockers:ge})}}),Z?.resolve(),Z=null;return}return Jt(C,O)}),s){A1(l,ae);let C=()=>k1(l,ae);l.addEventListener("pagehide",C),ie=()=>l.removeEventListener("pagehide",C)}return w.initialized||Jt("POP",w.location,{initialHydration:!0}),ee}function Ft(){_&&_(),ie&&ie(),j.clear(),se&&se.abort(),w.fetchers.forEach((C,O)=>Ba(O)),w.blockers.forEach((C,O)=>we(O))}function nt(C){return j.add(C),()=>j.delete(C)}function Ge(C,O={}){C.matches&&(C.matches=C.matches.map(re=>{let ge=m[re.route.id],oe=re.route;return oe.element!==ge.element||oe.errorElement!==ge.errorElement||oe.hydrateFallbackElement!==ge.hydrateFallbackElement?{...re,route:ge}:re})),w={...w,...C};let B=[],le=[];w.fetchers.forEach((re,ge)=>{re.state==="idle"&&(_e.has(ge)?B.push(ge):le.push(ge))}),_e.forEach(re=>{!w.fetchers.has(re)&&!P.has(re)&&B.push(re)}),[...j].forEach(re=>re(w,{deletedFetchers:B,newErrors:C.errors??null,viewTransitionOpts:O.viewTransitionOpts,flushSync:O.flushSync===!0})),B.forEach(re=>Ba(re)),le.forEach(re=>w.fetchers.delete(re))}function xt(C,O,{flushSync:B}={}){let le=w.actionData!=null&&w.navigation.formMethod!=null&&It(w.navigation.formMethod)&&w.navigation.state==="loading"&&C.state?._isRedirect!==!0,re;O.actionData?Object.keys(O.actionData).length>0?re=O.actionData:re=null:le?re=w.actionData:re=null;let ge=O.loaderData?og(w.loaderData,O.loaderData,O.matches||[],O.errors):w.loaderData,oe=w.blockers;oe.size>0&&(oe=new Map(oe),oe.forEach((Ee,Se)=>oe.set(Se,_s)));let fe=M?!1:rl(C,O.matches||w.matches),me=de===!0||w.navigation.formMethod!=null&&It(w.navigation.formMethod)&&C.state?._isRedirect!==!0;g&&(p=g,g=void 0),M||q==="POP"||(q==="PUSH"?n.history.push(C,C.state):q==="REPLACE"&&n.history.replace(C,C.state));let je;if(q==="POP"){let Ee=ae.get(w.location.pathname);Ee&&Ee.has(C.pathname)?je={currentLocation:w.location,nextLocation:C}:ae.has(C.pathname)&&(je={currentLocation:C,nextLocation:w.location})}else if(ye){let Ee=ae.get(w.location.pathname);Ee?Ee.add(C.pathname):(Ee=new Set([C.pathname]),ae.set(w.location.pathname,Ee)),je={currentLocation:w.location,nextLocation:C}}Ge({...O,actionData:re,loaderData:ge,historyAction:q,location:C,initialized:!0,renderFallback:!1,navigation:Ku,revalidation:"idle",restoreScrollPosition:fe,preventScrollReset:me,blockers:oe},{viewTransitionOpts:je,flushSync:B===!0}),q="POP",de=!1,ye=!1,M=!1,W=!1,Z?.resolve(),Z=null,Ue?.resolve(),Ue=null}async function Tt(C,O){if(Z?.resolve(),Z=null,typeof C=="number"){Z||(Z=fg());let ut=Z.promise;return n.history.go(C),ut}let B=rd(w.location,w.matches,h,C,O?.fromRouteId,O?.relative),{path:le,submission:re,error:ge}=Ip(!1,B,O),oe;O?.unstable_mask&&(oe={pathname:"",search:"",hash:"",...typeof O.unstable_mask=="string"?Cn(O.unstable_mask):{...w.location.unstable_mask,...O.unstable_mask}});let fe=w.location,me=Os(fe,le,O&&O.state,void 0,oe);me={...me,...n.history.encodeLocation(me)};let je=O&&O.replace!=null?O.replace:void 0,Ee="PUSH";je===!0?Ee="REPLACE":je===!1||re!=null&&It(re.formMethod)&&re.formAction===w.location.pathname+w.location.search&&(Ee="REPLACE");let Se=O&&"preventScrollReset"in O?O.preventScrollReset===!0:void 0,We=(O&&O.flushSync)===!0,Be=St({currentLocation:fe,nextLocation:me,historyAction:Ee});if(Be){tt(Be,{state:"blocked",location:me,proceed(){tt(Be,{state:"proceeding",proceed:void 0,reset:void 0,location:me}),Tt(C,O)},reset(){let ut=new Map(w.blockers);ut.set(Be,_s),Ge({blockers:ut})}});return}await Jt(Ee,me,{submission:re,pendingError:ge,preventScrollReset:Se,replace:O&&O.replace,enableViewTransition:O&&O.viewTransition,flushSync:We,callSiteDefaultShouldRevalidate:O&&O.unstable_defaultShouldRevalidate})}function la(){Ue||(Ue=fg()),Ht(),Ge({revalidation:"loading"});let C=Ue.promise;return w.navigation.state==="submitting"?C:w.navigation.state==="idle"?(Jt(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),C):(Jt(q||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:ye===!0}),C)}async function Jt(C,O,B){se&&se.abort(),se=null,q=C,M=(B&&B.startUninterruptedRevalidation)===!0,ll(w.location,w.matches),de=(B&&B.preventScrollReset)===!0,ye=(B&&B.enableViewTransition)===!0;let le=g||p,re=B&&B.overrideNavigation,ge=B?.initialHydration&&w.matches&&w.matches.length>0&&!V?w.matches:In(le,O,h),oe=(B&&B.flushSync)===!0;if(ge&&w.initialized&&!W&&N1(w.location,O)&&!(B&&B.submission&&It(B.submission.formMethod))){xt(O,{matches:ge},{flushSync:oe});return}let fe=Fa(ge,le,O.pathname);if(fe.active&&fe.matches&&(ge=fe.matches),!ge){let{error:mt,notFoundMatches:_t,route:Fe}=Je(O.pathname);xt(O,{matches:_t,loaderData:{},errors:{[Fe.id]:mt}},{flushSync:oe});return}se=new AbortController;let me=jr(n.history,O,se.signal,B&&B.submission),je=n.getContext?await n.getContext():new Qp,Ee;if(B&&B.pendingError)Ee=[el(ge).route.id,{type:"error",error:B.pendingError}];else if(B&&B.submission&&It(B.submission.formMethod)){let mt=await Za(me,O,B.submission,ge,je,fe.active,B&&B.initialHydration===!0,{replace:B.replace,flushSync:oe});if(mt.shortCircuited)return;if(mt.pendingActionResult){let[_t,Fe]=mt.pendingActionResult;if(ba(Fe)&&Ms(Fe.error)&&Fe.error.status===404){se=null,xt(O,{matches:mt.matches,loaderData:{},errors:{[_t]:Fe.error}});return}}ge=mt.matches||ge,Ee=mt.pendingActionResult,re=Xu(O,B.submission),oe=!1,fe.active=!1,me=jr(n.history,me.url,me.signal)}let{shortCircuited:Se,matches:We,loaderData:Be,errors:ut}=await ja(me,O,ge,je,fe.active,re,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,oe,Ee,B&&B.callSiteDefaultShouldRevalidate);Se||(se=null,xt(O,{matches:We||ge,...cg(Ee),loaderData:Be,errors:ut}))}async function Za(C,O,B,le,re,ge,oe,fe={}){Ht();let me=D1(O,B);if(Ge({navigation:me},{flushSync:fe.flushSync===!0}),ge){let Se=await Ja(le,O.pathname,C.signal);if(Se.type==="aborted")return{shortCircuited:!0};if(Se.type==="error"){if(Se.partialMatches.length===0){let{matches:Be,route:ut}=ao(p);return{matches:Be,pendingActionResult:[ut.id,{type:"error",error:Se.error}]}}let We=el(Se.partialMatches).route.id;return{matches:Se.partialMatches,pendingActionResult:[We,{type:"error",error:Se.error}]}}else if(Se.matches)le=Se.matches;else{let{notFoundMatches:We,error:Be,route:ut}=Je(O.pathname);return{matches:We,pendingActionResult:[ut.id,{type:"error",error:Be}]}}}let je,Ee=co(le,O);if(!Ee.route.action&&!Ee.route.lazy)je={type:"error",error:Aa(405,{method:C.method,pathname:O.pathname,routeId:Ee.route.id})};else{let Se=Er(u,m,C,le,Ee,oe?[]:i,re),We=await ct(C,Se,re,null);if(je=We[Ee.route.id],!je){for(let Be of le)if(We[Be.route.id]){je=We[Be.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(wl(je)){let Se;return fe&&fe.replace!=null?Se=fe.replace:Se=rg(je.response.headers.get("Location"),new URL(C.url),h,n.history)===w.location.pathname+w.location.search,await Ve(C,je,!0,{submission:B,replace:Se}),{shortCircuited:!0}}if(ba(je)){let Se=el(le,Ee.route.id);return(fe&&fe.replace)!==!0&&(q="PUSH"),{matches:le,pendingActionResult:[Se.route.id,je,Ee.route.id]}}return{matches:le,pendingActionResult:[Ee.route.id,je]}}async function ja(C,O,B,le,re,ge,oe,fe,me,je,Ee,Se,We){let Be=ge||Xu(O,oe),ut=oe||fe||dg(Be),mt=!M&&!je;if(re){if(mt){let Et=Na(Se);Ge({navigation:Be,...Et!==void 0?{actionData:Et}:{}},{flushSync:Ee})}let qe=await Ja(B,O.pathname,C.signal);if(qe.type==="aborted")return{shortCircuited:!0};if(qe.type==="error"){if(qe.partialMatches.length===0){let{matches:Pt,route:Ot}=ao(p);return{matches:Pt,loaderData:{},errors:{[Ot.id]:qe.error}}}let Et=el(qe.partialMatches).route.id;return{matches:qe.partialMatches,loaderData:{},errors:{[Et]:qe.error}}}else if(qe.matches)B=qe.matches;else{let{error:Et,notFoundMatches:Pt,route:Ot}=Je(O.pathname);return{matches:Pt,loaderData:{},errors:{[Ot.id]:Et}}}}let _t=g||p,{dsMatches:Fe,revalidatingFetchers:Lt}=eg(C,le,u,m,n.history,w,B,ut,O,je?[]:i,je===!0,W,ce,_e,ne,F,_t,h,n.patchRoutesOnNavigation!=null,Se,We);if(N=++be,!n.dataStrategy&&!Fe.some(qe=>qe.shouldLoad)&&!Fe.some(qe=>qe.route.middleware&&qe.route.middleware.length>0)&&Lt.length===0){let qe=Ll();return xt(O,{matches:B,loaderData:{},errors:Se&&ba(Se[1])?{[Se[0]]:Se[1].error}:null,...cg(Se),...qe?{fetchers:new Map(w.fetchers)}:{}},{flushSync:Ee}),{shortCircuited:!0}}if(mt){let qe={};if(!re){qe.navigation=Be;let Et=Na(Se);Et!==void 0&&(qe.actionData=Et)}Lt.length>0&&(qe.fetchers=Ce(Lt)),Ge(qe,{flushSync:Ee})}Lt.forEach(qe=>{zt(qe.key),qe.controller&&P.set(qe.key,qe.controller)});let ft=()=>Lt.forEach(qe=>zt(qe.key));se&&se.signal.addEventListener("abort",ft);let{loaderResults:Tn,fetcherResults:$a}=await Yt(Fe,Lt,C,le);if(C.signal.aborted)return{shortCircuited:!0};se&&se.signal.removeEventListener("abort",ft),Lt.forEach(qe=>P.delete(qe.key));let qt=no(Tn);if(qt)return await Ve(C,qt.result,!0,{replace:me}),{shortCircuited:!0};if(qt=no($a),qt)return F.add(qt.key),await Ve(C,qt.result,!0,{replace:me}),{shortCircuited:!0};let{loaderData:Pa,errors:sl}=ig(w,B,Tn,Se,Lt,$a);je&&w.errors&&(sl={...w.errors,...sl});let Wa=Ll(),il=Ul(N),Hl=Wa||il||Lt.length>0;return{matches:B,loaderData:Pa,errors:sl,...Hl?{fetchers:new Map(w.fetchers)}:{}}}function Na(C){if(C&&!ba(C[1]))return{[C[0]]:C[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Ce(C){return C.forEach(O=>{let B=w.fetchers.get(O.key),le=js(void 0,B?B.data:void 0);w.fetchers.set(O.key,le)}),new Map(w.fetchers)}async function Pe(C,O,B,le){zt(C);let re=(le&&le.flushSync)===!0,ge=g||p,oe=rd(w.location,w.matches,h,B,O,le?.relative),fe=In(ge,oe,h),me=Fa(fe,ge,oe);if(me.active&&me.matches&&(fe=me.matches),!fe){ra(C,O,Aa(404,{pathname:oe}),{flushSync:re});return}let{path:je,submission:Ee,error:Se}=Ip(!0,oe,le);if(Se){ra(C,O,Se,{flushSync:re});return}let We=n.getContext?await n.getContext():new Qp,Be=(le&&le.preventScrollReset)===!0;if(Ee&&It(Ee.formMethod)){await pe(C,O,je,fe,We,me.active,re,Be,Ee,le&&le.unstable_defaultShouldRevalidate);return}ne.set(C,{routeId:O,path:je}),await Oe(C,O,je,fe,We,me.active,re,Be,Ee)}async function pe(C,O,B,le,re,ge,oe,fe,me,je){Ht(),ne.delete(C);let Ee=w.fetchers.get(C);bt(C,M1(me,Ee),{flushSync:oe});let Se=new AbortController,We=jr(n.history,B,Se.signal,me);if(ge){let ht=await Ja(le,new URL(We.url).pathname,We.signal,C);if(ht.type==="aborted")return;if(ht.type==="error"){ra(C,O,ht.error,{flushSync:oe});return}else if(ht.matches)le=ht.matches;else{ra(C,O,Aa(404,{pathname:B}),{flushSync:oe});return}}let Be=co(le,B);if(!Be.route.action&&!Be.route.lazy){let ht=Aa(405,{method:me.formMethod,pathname:B,routeId:O});ra(C,O,ht,{flushSync:oe});return}P.set(C,Se);let ut=be,mt=Er(u,m,We,le,Be,i,re),_t=await ct(We,mt,re,C),Fe=_t[Be.route.id];if(!Fe){for(let ht of mt)if(_t[ht.route.id]){Fe=_t[ht.route.id];break}}if(We.signal.aborted){P.get(C)===Se&&P.delete(C);return}if(_e.has(C)){if(wl(Fe)||ba(Fe)){bt(C,wn(void 0));return}}else{if(wl(Fe))if(P.delete(C),N>ut){bt(C,wn(void 0));return}else return F.add(C),bt(C,js(me)),Ve(We,Fe,!1,{fetcherSubmission:me,preventScrollReset:fe});if(ba(Fe)){ra(C,O,Fe.error);return}}let Lt=w.navigation.location||w.location,ft=jr(n.history,Lt,Se.signal),Tn=g||p,$a=w.navigation.state!=="idle"?In(Tn,w.navigation.location,h):w.matches;He($a,"Didn't find any matches after fetcher action");let qt=++be;H.set(C,qt);let Pa=js(me,Fe.data);w.fetchers.set(C,Pa);let{dsMatches:sl,revalidatingFetchers:Wa}=eg(ft,re,u,m,n.history,w,$a,me,Lt,i,!1,W,ce,_e,ne,F,Tn,h,n.patchRoutesOnNavigation!=null,[Be.route.id,Fe],je);Wa.filter(ht=>ht.key!==C).forEach(ht=>{let Bl=ht.key,ql=w.fetchers.get(Bl),Vs=js(void 0,ql?ql.data:void 0);w.fetchers.set(Bl,Vs),zt(Bl),ht.controller&&P.set(Bl,ht.controller)}),Ge({fetchers:new Map(w.fetchers)});let il=()=>Wa.forEach(ht=>zt(ht.key));Se.signal.addEventListener("abort",il);let{loaderResults:Hl,fetcherResults:qe}=await Yt(sl,Wa,ft,re);if(Se.signal.aborted)return;if(Se.signal.removeEventListener("abort",il),H.delete(C),P.delete(C),Wa.forEach(ht=>P.delete(ht.key)),w.fetchers.has(C)){let ht=wn(Fe.data);w.fetchers.set(C,ht)}let Et=no(Hl);if(Et)return Ve(ft,Et.result,!1,{preventScrollReset:fe});if(Et=no(qe),Et)return F.add(Et.key),Ve(ft,Et.result,!1,{preventScrollReset:fe});let{loaderData:Pt,errors:Ot}=ig(w,$a,Hl,void 0,Wa,qe);Ul(qt),w.navigation.state==="loading"&&qt>N?(He(q,"Expected pending action"),se&&se.abort(),xt(w.navigation.location,{matches:$a,loaderData:Pt,errors:Ot,fetchers:new Map(w.fetchers)})):(Ge({errors:Ot,loaderData:og(w.loaderData,Pt,$a,Ot),fetchers:new Map(w.fetchers)}),W=!1)}async function Oe(C,O,B,le,re,ge,oe,fe,me){let je=w.fetchers.get(C);bt(C,js(me,je?je.data:void 0),{flushSync:oe});let Ee=new AbortController,Se=jr(n.history,B,Ee.signal);if(ge){let Fe=await Ja(le,new URL(Se.url).pathname,Se.signal,C);if(Fe.type==="aborted")return;if(Fe.type==="error"){ra(C,O,Fe.error,{flushSync:oe});return}else if(Fe.matches)le=Fe.matches;else{ra(C,O,Aa(404,{pathname:B}),{flushSync:oe});return}}let We=co(le,B);P.set(C,Ee);let Be=be,ut=Er(u,m,Se,le,We,i,re),_t=(await ct(Se,ut,re,C))[We.route.id];if(P.get(C)===Ee&&P.delete(C),!Se.signal.aborted){if(_e.has(C)){bt(C,wn(void 0));return}if(wl(_t))if(N>Be){bt(C,wn(void 0));return}else{F.add(C),await Ve(Se,_t,!1,{preventScrollReset:fe});return}if(ba(_t)){ra(C,O,_t.error);return}bt(C,wn(_t.data))}}async function Ve(C,O,B,{submission:le,fetcherSubmission:re,preventScrollReset:ge,replace:oe}={}){B||(Z?.resolve(),Z=null),O.response.headers.has("X-Remix-Revalidate")&&(W=!0);let fe=O.response.headers.get("Location");He(fe,"Expected a Location header on the redirect Response"),fe=rg(fe,new URL(C.url),h,n.history);let me=Os(w.location,fe,{_isRedirect:!0});if(s){let ut=!1;if(O.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(gd(fe)){const mt=Pg(fe,!0);ut=mt.origin!==l.location.origin||La(mt.pathname,h)==null}if(ut){oe?l.location.replace(fe):l.location.assign(fe);return}}se=null;let je=oe===!0||O.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ee,formAction:Se,formEncType:We}=w.navigation;!le&&!re&&Ee&&Se&&We&&(le=dg(w.navigation));let Be=le||re;if(o1.has(O.response.status)&&Be&&It(Be.formMethod))await Jt(je,me,{submission:{...Be,formAction:fe},preventScrollReset:ge||de,enableViewTransition:B?ye:void 0});else{let ut=Xu(me,le);await Jt(je,me,{overrideNavigation:ut,fetcherSubmission:re,preventScrollReset:ge||de,enableViewTransition:B?ye:void 0})}}async function ct(C,O,B,le){let re,ge={};try{re=await y1(v,C,O,le,B,!1)}catch(oe){return O.filter(fe=>fe.shouldLoad).forEach(fe=>{ge[fe.route.id]={type:"error",error:oe}}),ge}if(C.signal.aborted)return ge;if(!It(C.method))for(let oe of O){if(re[oe.route.id]?.type==="error")break;!re.hasOwnProperty(oe.route.id)&&!w.loaderData.hasOwnProperty(oe.route.id)&&(!w.errors||!w.errors.hasOwnProperty(oe.route.id))&&oe.shouldCallHandler()&&(re[oe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${oe.route.id}`)})}for(let[oe,fe]of Object.entries(re))if(R1(fe)){let me=fe.result;ge[oe]={type:"redirect",response:_1(me,C,oe,O,h)}}else ge[oe]=await S1(fe);return ge}async function Yt(C,O,B,le){let re=ct(B,C,le,null),ge=Promise.all(O.map(async me=>{if(me.matches&&me.match&&me.request&&me.controller){let Ee=(await ct(me.request,me.matches,le,me.key))[me.match.route.id];return{[me.key]:Ee}}else return Promise.resolve({[me.key]:{type:"error",error:Aa(404,{pathname:me.path})}})})),oe=await re,fe=(await ge).reduce((me,je)=>Object.assign(me,je),{});return{loaderResults:oe,fetcherResults:fe}}function Ht(){W=!0,ne.forEach((C,O)=>{P.has(O)&&ce.add(O),zt(O)})}function bt(C,O,B={}){w.fetchers.set(C,O),Ge({fetchers:new Map(w.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function ra(C,O,B,le={}){let re=el(w.matches,O);Ba(C),Ge({errors:{[re.route.id]:B},fetchers:new Map(w.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function kl(C){return he.set(C,(he.get(C)||0)+1),_e.has(C)&&_e.delete(C),w.fetchers.get(C)||c1}function Or(C,O){zt(C,O?.reason),bt(C,wn(null))}function Ba(C){let O=w.fetchers.get(C);P.has(C)&&!(O&&O.state==="loading"&&H.has(C))&&zt(C),ne.delete(C),H.delete(C),F.delete(C),_e.delete(C),ce.delete(C),w.fetchers.delete(C)}function Gt(C){let O=(he.get(C)||0)-1;O<=0?(he.delete(C),_e.add(C)):he.set(C,O),Ge({fetchers:new Map(w.fetchers)})}function zt(C,O){let B=P.get(C);B&&(B.abort(O),P.delete(C))}function Bt(C){for(let O of C){let B=kl(O),le=wn(B.data);w.fetchers.set(O,le)}}function Ll(){let C=[],O=!1;for(let B of F){let le=w.fetchers.get(B);He(le,`Expected fetcher: ${B}`),le.state==="loading"&&(F.delete(B),C.push(B),O=!0)}return Bt(C),O}function Ul(C){let O=[];for(let[B,le]of H)if(le<C){let re=w.fetchers.get(B);He(re,`Expected fetcher: ${B}`),re.state==="loading"&&(zt(B),H.delete(B),O.push(B))}return Bt(O),O.length>0}function ue(C,O){let B=w.blockers.get(C)||_s;return ze.get(C)!==O&&ze.set(C,O),B}function we(C){w.blockers.delete(C),ze.delete(C)}function tt(C,O){let B=w.blockers.get(C)||_s;He(B.state==="unblocked"&&O.state==="blocked"||B.state==="blocked"&&O.state==="blocked"||B.state==="blocked"&&O.state==="proceeding"||B.state==="blocked"&&O.state==="unblocked"||B.state==="proceeding"&&O.state==="unblocked",`Invalid blocker state transition: ${B.state} -> ${O.state}`);let le=new Map(w.blockers);le.set(C,O),Ge({blockers:le})}function St({currentLocation:C,nextLocation:O,historyAction:B}){if(ze.size===0)return;ze.size>1&&wt(!1,"A router only supports one blocker at a time");let le=Array.from(ze.entries()),[re,ge]=le[le.length-1],oe=w.blockers.get(re);if(!(oe&&oe.state==="proceeding")&&ge({currentLocation:C,nextLocation:O,historyAction:B}))return re}function Je(C){let O=Aa(404,{pathname:C}),B=g||p,{matches:le,route:re}=ao(B);return{notFoundMatches:le,route:re,error:O}}function sn(C,O,B){if(R=C,A=O,z=B||null,!X&&w.navigation===Ku){X=!0;let le=rl(w.location,w.matches);le!=null&&Ge({restoreScrollPosition:le})}return()=>{R=null,A=null,z=null}}function qa(C,O){return z&&z(C,O.map(le=>kv(le,w.loaderData)))||C.key}function ll(C,O){if(R&&A){let B=qa(C,O);R[B]=A()}}function rl(C,O){if(R){let B=qa(C,O),le=R[B];if(typeof le=="number")return le}return null}function Fa(C,O,B){if(n.patchRoutesOnNavigation)if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:Es(O,B,h,!0)}}else return{active:!0,matches:Es(O,B,h,!0)||[]};return{active:!1,matches:null}}async function Ja(C,O,B,le){if(!n.patchRoutesOnNavigation)return{type:"success",matches:C};let re=C;for(;;){let ge=g==null,oe=g||p,fe=m;try{await n.patchRoutesOnNavigation({signal:B,path:O,matches:re,fetcherKey:le,patch:(Ee,Se)=>{B.aborted||tg(Ee,Se,oe,fe,u,!1)}})}catch(Ee){return{type:"error",error:Ee,partialMatches:re}}finally{ge&&!B.aborted&&(p=[...p])}if(B.aborted)return{type:"aborted"};let me=In(oe,O,h),je=null;if(me){if(Object.keys(me[0].params).length===0)return{type:"success",matches:me};if(je=Es(oe,O,h,!0),!(je&&re.length<je.length&&$s(re,je.slice(0,re.length))))return{type:"success",matches:me}}if(je||(je=Es(oe,O,h,!0)),!je||$s(re,je))return{type:"success",matches:null};re=je}}function $s(C,O){return C.length===O.length&&C.every((B,le)=>B.route.id===O[le].route.id)}function Ys(C){m={},g=Ds(C,u,void 0,m)}function Gs(C,O,B=!1){let le=g==null;tg(C,O,g||p,m,u,B),le&&(p=[...p],Ge({}))}return ee={get basename(){return h},get future(){return y},get state(){return w},get routes(){return p},get window(){return l},initialize:na,subscribe:nt,enableScrollRestoration:sn,navigate:Tt,fetch:Pe,revalidate:la,createHref:C=>n.history.createHref(C),encodeLocation:C=>n.history.encodeLocation(C),getFetcher:kl,resetFetcher:Or,deleteFetcher:Gt,dispose:Ft,getBlocker:ue,deleteBlocker:we,patchRoutes:Gs,_internalFetchControllers:P,_internalSetRoutes:Ys,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){Ge(C)}},n.unstable_instrumentations&&(ee=e1(ee,n.unstable_instrumentations.map(C=>C.router).filter(Boolean))),ee}function f1(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function rd(n,l,s,i,o,u){let m,p;if(o){m=[];for(let h of l)if(m.push(h),h.route.id===o){p=h;break}}else m=l,p=l[l.length-1];let g=ks(i||".",vo(m),La(n.pathname,s)||n.pathname,u==="path");if(i==null&&(g.search=n.search,g.hash=n.hash),(i==null||i===""||i===".")&&p){let h=bd(g.search);if(p.route.index&&!h)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&h){let v=new URLSearchParams(g.search),y=v.getAll("index");v.delete("index"),y.filter(j=>j).forEach(j=>v.append("index",j));let _=v.toString();g.search=_?`?${_}`:""}}return s!=="/"&&(g.pathname=Zv({basename:s,pathname:g.pathname})),rn(g)}function Ip(n,l,s){if(!s||!f1(s))return{path:l};if(s.formMethod&&!O1(s.formMethod))return{path:l,error:Aa(405,{method:s.formMethod})};let i=()=>({path:l,error:Aa(400,{type:"invalid-body"})}),u=(s.formMethod||"get").toUpperCase(),m=px(l);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!It(u))return i();let y=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((_,[j,R])=>`${_}${j}=${R}
|
|
10
|
+
`,""):String(s.body);return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:void 0,text:y}}}else if(s.formEncType==="application/json"){if(!It(u))return i();try{let y=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:y,text:void 0}}}catch{return i()}}}He(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=id(s.formData),g=s.formData;else if(s.body instanceof FormData)p=id(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=sg(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=sg(p)}catch{return i()}let h={formMethod:u,formAction:m,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(It(h.formMethod))return{path:l,submission:h};let v=Cn(l);return n&&v.search&&bd(v.search)&&p.append("index",""),v.search=`?${p}`,{path:rn(v),submission:h}}function eg(n,l,s,i,o,u,m,p,g,h,v,y,_,j,R,z,A,X,Q,V,G){let Y=V?ba(V[1])?V[1].error:V[1].data:void 0,te=o.createURL(u.location),ee=o.createURL(g),w;if(v&&u.errors){let ie=Object.keys(u.errors)[0];w=m.findIndex(M=>M.route.id===ie)}else if(V&&ba(V[1])){let ie=V[0];w=m.findIndex(M=>M.route.id===ie)-1}let q=V?V[1].statusCode:void 0,Z=q&&q>=400,de={currentUrl:te,currentParams:u.matches[0]?.params||{},nextUrl:ee,nextParams:m[0].params,...p,actionResult:Y,actionStatus:q},se=Us(m),ye=m.map((ie,M)=>{let{route:W}=ie,ce=null;if(w!=null&&M>w)ce=!1;else if(W.lazy)ce=!0;else if(!xd(W))ce=!1;else if(v){let{shouldLoad:H}=cx(W,u.loaderData,u.errors);ce=H}else m1(u.loaderData,u.matches[M],ie)&&(ce=!0);if(ce!==null)return sd(s,i,n,se,ie,h,l,ce);let P=!1;typeof G=="boolean"?P=G:Z?P=!1:(y||te.pathname+te.search===ee.pathname+ee.search||te.search!==ee.search||h1(u.matches[M],ie))&&(P=!0);let be={...de,defaultShouldRevalidate:P},N=Ts(ie,be);return sd(s,i,n,se,ie,h,l,N,be,G)}),ae=[];return R.forEach((ie,M)=>{if(v||!m.some(ne=>ne.route.id===ie.routeId)||j.has(M))return;let W=u.fetchers.get(M),ce=W&&W.state!=="idle"&&W.data===void 0,P=In(A,ie.path,X);if(!P){if(Q&&ce)return;ae.push({key:M,routeId:ie.routeId,path:ie.path,matches:null,match:null,request:null,controller:null});return}if(z.has(M))return;let be=co(P,ie.path),N=new AbortController,H=jr(o,ie.path,N.signal),F=null;if(_.has(M))_.delete(M),F=Er(s,i,H,P,be,h,l);else if(ce)y&&(F=Er(s,i,H,P,be,h,l));else{let ne;typeof G=="boolean"?ne=G:Z?ne=!1:ne=y;let he={...de,defaultShouldRevalidate:ne};Ts(be,he)&&(F=Er(s,i,H,P,be,h,l,he))}F&&ae.push({key:M,routeId:ie.routeId,path:ie.path,matches:F,match:be,request:H,controller:N})}),{dsMatches:ye,revalidatingFetchers:ae}}function xd(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function cx(n,l,s){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!xd(n))return{shouldLoad:!1,renderFallback:!1};let i=l!=null&&n.id in l,o=s!=null&&s[n.id]!==void 0;if(!i&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof n.loader=="function"&&n.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let u=!i&&!o;return{shouldLoad:u,renderFallback:u}}function m1(n,l,s){let i=!l||s.route.id!==l.route.id,o=!n.hasOwnProperty(s.route.id);return i||o}function h1(n,l){let s=n.route.path;return n.pathname!==l.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==l.params["*"]}function Ts(n,l){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(l);if(typeof s=="boolean")return s}return l.defaultShouldRevalidate}function tg(n,l,s,i,o,u){let m;if(n){let h=i[n];He(h,`No route found to patch children into: routeId = ${n}`),h.children||(h.children=[]),m=h.children}else m=s;let p=[],g=[];if(l.forEach(h=>{let v=m.find(y=>ux(h,y));v?g.push({existingRoute:v,newRoute:h}):p.push(h)}),p.length>0){let h=Ds(p,o,[n||"_","patch",String(m?.length||"0")],i);m.push(...h)}if(u&&g.length>0)for(let h=0;h<g.length;h++){let{existingRoute:v,newRoute:y}=g[h],_=v,[j]=Ds([y],o,[],{},!0);Object.assign(_,{element:j.element?j.element:_.element,errorElement:j.errorElement?j.errorElement:_.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:_.hydrateFallbackElement})}}function ux(n,l){return"id"in n&&"id"in l&&n.id===l.id?!0:n.index===l.index&&n.path===l.path&&n.caseSensitive===l.caseSensitive?(!n.children||n.children.length===0)&&(!l.children||l.children.length===0)?!0:n.children?.every((s,i)=>l.children?.some(o=>ux(s,o)))??!1:!1}var ag=new WeakMap,dx=({key:n,route:l,manifest:s,mapRouteProperties:i})=>{let o=s[l.id];if(He(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[n];if(!u)return;let m=ag.get(o);m||(m={},ag.set(o,m));let p=m[n];if(p)return p;let g=(async()=>{let h=Ov(n),y=o[n]!==void 0&&n!=="hasErrorBoundary";if(h)wt(!h,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),m[n]=Promise.resolve();else if(y)wt(!1,`Route "${o.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let _=await u();_!=null&&(Object.assign(o,{[n]:_}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[n]=void 0,Object.values(o.lazy).every(_=>_===void 0)&&(o.lazy=void 0))})();return m[n]=g,g},ng=new WeakMap;function p1(n,l,s,i,o){let u=s[n.id];if(He(u,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let v=ng.get(u);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let y=(async()=>{He(typeof n.lazy=="function","No lazy route function found");let _=await n.lazy(),j={};for(let R in _){let z=_[R];if(z===void 0)continue;let A=Mv(R),Q=u[R]!==void 0&&R!=="hasErrorBoundary";A?wt(!A,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Q?wt(!Q,`Route "${u.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):j[R]=z}Object.assign(u,j),Object.assign(u,{...i(u),lazy:void 0})})();return ng.set(u,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let m=Object.keys(n.lazy),p=[],g;for(let v of m){if(o&&o.includes(v))continue;let y=dx({key:v,route:n,manifest:s,mapRouteProperties:i});y&&(p.push(y),v===l&&(g=y))}let h=p.length>0?Promise.all(p).then(()=>{}):void 0;return h?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:g}}async function lg(n){let l=n.matches.filter(o=>o.shouldLoad),s={};return(await Promise.all(l.map(o=>o.resolve()))).forEach((o,u)=>{s[l[u].route.id]=o}),s}async function g1(n){return n.matches.some(l=>l.route.middleware)?fx(n,()=>lg(n)):lg(n)}function fx(n,l){return x1(n,l,i=>{if(z1(i))throw i;return i},E1,s);function s(i,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:i}}));{let{matches:m}=n,p=Math.min(Math.max(m.findIndex(h=>h.route.id===o),0),Math.max(m.findIndex(h=>h.shouldCallHandler()),0)),g=el(m,m[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:i}})}}}async function x1(n,l,s,i,o){let{matches:u,request:m,params:p,context:g,unstable_pattern:h}=n,v=u.flatMap(_=>_.route.middleware?_.route.middleware.map(j=>[_.route.id,j]):[]);return await mx({request:m,params:p,context:g,unstable_pattern:h},v,l,s,i,o)}async function mx(n,l,s,i,o,u,m=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=l[m];if(!g)return await s();let[h,v]=g,y,_=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await mx(n,l,s,i,o,u,m+1)},y.value}catch(j){return y={value:await u(j,h,y)},y.value}};try{let j=await v(n,_),R=j!=null?i(j):void 0;return o(R)?R:y?R??y.value:(y={value:await _()},y.value)}catch(j){return await u(j,h,y)}}function hx(n,l,s,i,o){let u=dx({key:"middleware",route:i.route,manifest:l,mapRouteProperties:n}),m=p1(i.route,It(s.method)?"action":"loader",l,n,o);return{middleware:u,route:m.lazyRoutePromise,handler:m.lazyHandlerPromise}}function sd(n,l,s,i,o,u,m,p,g=null,h){let v=!1,y=hx(n,l,s,o,u);return{...o,_lazyPromises:y,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(_){return v=!0,g?typeof h=="boolean"?Ts(o,{...g,defaultShouldRevalidate:h}):typeof _=="boolean"?Ts(o,{...g,defaultShouldRevalidate:_}):Ts(o,g):p},resolve(_){let{lazy:j,loader:R,middleware:z}=o.route,A=v||p||_&&!It(s.method)&&(j||R),X=z&&z.length>0&&!R&&!j;return A&&(It(s.method)||!X)?b1({request:s,unstable_pattern:i,match:o,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:_,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function Er(n,l,s,i,o,u,m,p=null){return i.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:hx(n,l,s,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:sd(n,l,s,Us(i),g,u,m,!0,p))}async function y1(n,l,s,i,o,u){s.some(h=>h._lazyPromises?.middleware)&&await Promise.all(s.map(h=>h._lazyPromises?.middleware));let m={request:l,unstable_pattern:Us(s),params:s[0].params,context:o,matches:s},g=await n({...m,fetcherKey:i,runClientMiddleware:h=>{let v=m;return fx(v,()=>h({...v,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return g}async function b1({request:n,unstable_pattern:l,match:s,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:u,scopedContext:m}){let p,g,h=It(n.method),v=h?"action":"loader",y=_=>{let j,R=new Promise((X,Q)=>j=Q);g=()=>j(),n.signal.addEventListener("abort",g);let z=X=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${s.route.id}]`)):_({request:n,unstable_pattern:l,params:s.params,context:m},...X!==void 0?[X]:[]),A=(async()=>{try{return{type:"data",result:await(u?u(Q=>z(Q)):z())}}catch(X){return{type:"error",result:X}}})();return Promise.race([A,R])};try{let _=h?s.route.action:s.route.loader;if(i||o)if(_){let j,[R]=await Promise.all([y(_).catch(z=>{j=z}),i,o]);if(j!==void 0)throw j;p=R}else{await i;let j=h?s.route.action:s.route.loader;if(j)[p]=await Promise.all([y(j),o]);else if(v==="action"){let R=new URL(n.url),z=R.pathname+R.search;throw Aa(405,{method:n.method,pathname:z,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(_)p=await y(_);else{let j=new URL(n.url),R=j.pathname+j.search;throw Aa(404,{pathname:R})}}catch(_){return{type:"error",result:_}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function v1(n){let l=n.headers.get("Content-Type");return l&&/\bapplication\/json\b/.test(l)?n.body==null?null:n.json():n.text()}async function S1(n){let{result:l,type:s}=n;if(yd(l)){let i;try{i=await v1(l)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new Ls(l.status,l.statusText,i),statusCode:l.status,headers:l.headers}:{type:"data",data:i,statusCode:l.status,headers:l.headers}}return s==="error"?ug(l)?l.data instanceof Error?{type:"error",error:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:w1(l),statusCode:Ms(l)?l.status:void 0,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:l,statusCode:Ms(l)?l.status:void 0}:ug(l)?{type:"data",data:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"data",data:l}}function _1(n,l,s,i,o){let u=n.headers.get("Location");if(He(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!gd(u)){let m=i.slice(0,i.findIndex(p=>p.route.id===s)+1);u=rd(new URL(l.url),m,o,u),n.headers.set("Location",u)}return n}function rg(n,l,s,i){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(gd(n)){let u=n,m=u.startsWith("//")?new URL(l.protocol+u):new URL(u);if(o.includes(m.protocol))throw new Error("Invalid redirect location");let p=La(m.pathname,s)!=null;if(m.origin===l.origin&&p)return m.pathname+m.search+m.hash}try{let u=i.createURL(n);if(o.includes(u.protocol))throw new Error("Invalid redirect location")}catch{}return n}function jr(n,l,s,i){let o=n.createURL(px(l)).toString(),u={signal:s};if(i&&It(i.formMethod)){let{formMethod:m,formEncType:p}=i;u.method=m.toUpperCase(),p==="application/json"?(u.headers=new Headers({"Content-Type":p}),u.body=JSON.stringify(i.json)):p==="text/plain"?u.body=i.text:p==="application/x-www-form-urlencoded"&&i.formData?u.body=id(i.formData):u.body=i.formData}return new Request(o,u)}function id(n){let l=new URLSearchParams;for(let[s,i]of n.entries())l.append(s,typeof i=="string"?i:i.name);return l}function sg(n){let l=new FormData;for(let[s,i]of n.entries())l.append(s,i);return l}function j1(n,l,s,i=!1,o=!1){let u={},m=null,p,g=!1,h={},v=s&&ba(s[1])?s[1].error:void 0;return n.forEach(y=>{if(!(y.route.id in l))return;let _=y.route.id,j=l[_];if(He(!wl(j),"Cannot handle redirect results in processLoaderData"),ba(j)){let R=j.error;if(v!==void 0&&(R=v,v=void 0),m=m||{},o)m[_]=R;else{let z=el(n,_);m[z.route.id]==null&&(m[z.route.id]=R)}i||(u[_]=ox),g||(g=!0,p=Ms(j.error)?j.error.status:500),j.headers&&(h[_]=j.headers)}else u[_]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(h[_]=j.headers)}),v!==void 0&&s&&(m={[s[0]]:v},s[2]&&(u[s[2]]=void 0)),{loaderData:u,errors:m,statusCode:p||200,loaderHeaders:h}}function ig(n,l,s,i,o,u){let{loaderData:m,errors:p}=j1(l,s,i);return o.filter(g=>!g.matches||g.matches.some(h=>h.shouldLoad)).forEach(g=>{let{key:h,match:v,controller:y}=g;if(y&&y.signal.aborted)return;let _=u[h];if(He(_,"Did not find corresponding fetcher result"),ba(_)){let j=el(n.matches,v?.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:_.error}),n.fetchers.delete(h)}else if(wl(_))He(!1,"Unhandled fetcher revalidation redirect");else{let j=wn(_.data);n.fetchers.set(h,j)}}),{loaderData:m,errors:p}}function og(n,l,s,i){let o=Object.entries(l).filter(([,u])=>u!==ox).reduce((u,[m,p])=>(u[m]=p,u),{});for(let u of s){let m=u.route.id;if(!l.hasOwnProperty(m)&&n.hasOwnProperty(m)&&u.route.loader&&(o[m]=n[m]),i&&i.hasOwnProperty(m))break}return o}function cg(n){return n?ba(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function el(n,l){return(l?n.slice(0,n.findIndex(i=>i.route.id===l)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function ao(n){let l=n.length===1?n[0]:n.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:l}],route:l}}function Aa(n,{pathname:l,routeId:s,method:i,type:o,message:u}={}){let m="Unknown Server Error",p="Unknown @remix-run/router error";return n===400?(m="Bad Request",i&&l&&s?p=`You made a ${i} request to "${l}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:o==="invalid-body"&&(p="Unable to encode submission body")):n===403?(m="Forbidden",p=`Route "${s}" does not match URL "${l}"`):n===404?(m="Not Found",p=`No route matches URL "${l}"`):n===405&&(m="Method Not Allowed",i&&l&&s?p=`You made a ${i.toUpperCase()} request to "${l}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:i&&(p=`Invalid request method "${i.toUpperCase()}"`)),new Ls(n||500,m,new Error(p),!0)}function no(n){let l=Object.entries(n);for(let s=l.length-1;s>=0;s--){let[i,o]=l[s];if(wl(o))return{key:i,result:o}}}function px(n){let l=typeof n=="string"?Cn(n):n;return rn({...l,hash:""})}function N1(n,l){return n.pathname!==l.pathname||n.search!==l.search?!1:n.hash===""?l.hash!=="":n.hash===l.hash?!0:l.hash!==""}function w1(n){return new Ls(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)}function E1(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([l,s])=>typeof l=="string"&&C1(s))}function C1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function R1(n){return yd(n.result)&&sx.has(n.result.status)}function ba(n){return n.type==="error"}function wl(n){return(n&&n.type)==="redirect"}function ug(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function yd(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function T1(n){return sx.has(n)}function z1(n){return yd(n)&&T1(n.status)&&n.headers.has("Location")}function O1(n){return i1.has(n.toUpperCase())}function It(n){return r1.has(n.toUpperCase())}function bd(n){return new URLSearchParams(n).getAll("index").some(l=>l==="")}function co(n,l){let s=typeof l=="string"?Cn(l).search:l.search;if(n[n.length-1].route.index&&bd(s||""))return n[n.length-1];let i=tx(n);return i[i.length-1]}function dg(n){let{formMethod:l,formAction:s,formEncType:i,text:o,formData:u,json:m}=n;if(!(!l||!s||!i)){if(o!=null)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:l,formAction:s,formEncType:i,formData:u,json:void 0,text:void 0};if(m!==void 0)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:m,text:void 0}}}function Xu(n,l){return l?{state:"loading",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function D1(n,l){return{state:"submitting",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function js(n,l){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:l}}function M1(n,l){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l?l.data:void 0}}function wn(n){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function A1(n,l){try{let s=n.sessionStorage.getItem(ix);if(s){let i=JSON.parse(s);for(let[o,u]of Object.entries(i||{}))u&&Array.isArray(u)&&l.set(o,new Set(u||[]))}}catch{}}function k1(n,l){if(l.size>0){let s={};for(let[i,o]of l)s[i]=[...o];try{n.sessionStorage.setItem(ix,JSON.stringify(s))}catch(i){wt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function fg(){let n,l,s=new Promise((i,o)=>{n=async u=>{i(u);try{await s}catch{}},l=async u=>{o(u);try{await s}catch{}}});return{promise:s,resolve:n,reject:l}}var Ol=b.createContext(null);Ol.displayName="DataRouter";var Hs=b.createContext(null);Hs.displayName="DataRouterState";var gx=b.createContext(!1);function L1(){return b.useContext(gx)}var vd=b.createContext({isTransitioning:!1});vd.displayName="ViewTransition";var xx=b.createContext(new Map);xx.displayName="Fetchers";var U1=b.createContext(null);U1.displayName="Await";var _a=b.createContext(null);_a.displayName="Navigation";var So=b.createContext(null);So.displayName="Location";var Ua=b.createContext({outlet:null,matches:[],isDataRoute:!1});Ua.displayName="Route";var Sd=b.createContext(null);Sd.displayName="RouteError";var yx="REACT_ROUTER_ERROR",H1="REDIRECT",B1="ROUTE_ERROR_RESPONSE";function q1(n){if(n.startsWith(`${yx}:${H1}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function $1(n){if(n.startsWith(`${yx}:${B1}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new Ls(l.status,l.statusText,l.data)}catch{}}function Y1(n,{relative:l}={}){He(Rr(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=b.useContext(_a),{hash:o,pathname:u,search:m}=qs(n,{relative:l}),p=u;return s!=="/"&&(p=u==="/"?s:Ka([s,u])),i.createHref({pathname:p,search:m,hash:o})}function Rr(){return b.useContext(So)!=null}function Qa(){return He(Rr(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(So).location}var bx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function vx(n){b.useContext(_a).static||b.useLayoutEffect(n)}function Rn(){let{isDataRoute:n}=b.useContext(Ua);return n?n4():G1()}function G1(){He(Rr(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Ol),{basename:l,navigator:s}=b.useContext(_a),{matches:i}=b.useContext(Ua),{pathname:o}=Qa(),u=JSON.stringify(vo(i)),m=b.useRef(!1);return vx(()=>{m.current=!0}),b.useCallback((g,h={})=>{if(wt(m.current,bx),!m.current)return;if(typeof g=="number"){s.go(g);return}let v=ks(g,JSON.parse(u),o,h.relative==="path");n==null&&l!=="/"&&(v.pathname=v.pathname==="/"?l:Ka([l,v.pathname])),(h.replace?s.replace:s.push)(v,h.state,h)},[l,s,u,o,n])}var V1=b.createContext(null);function K1(n){let l=b.useContext(Ua).outlet;return b.useMemo(()=>l&&b.createElement(V1.Provider,{value:n},l),[l,n])}function Bs(){let{matches:n}=b.useContext(Ua),l=n[n.length-1];return l?l.params:{}}function qs(n,{relative:l}={}){let{matches:s}=b.useContext(Ua),{pathname:i}=Qa(),o=JSON.stringify(vo(s));return b.useMemo(()=>ks(n,JSON.parse(o),i,l==="path"),[n,o,i,l])}function X1(n,l,s){He(Rr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=b.useContext(_a),{matches:o}=b.useContext(Ua),u=o[o.length-1],m=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",h=u&&u.route;{let A=h&&h.path||"";_x(p,!h||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
+
|
|
12
|
+
Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let v=Qa(),y;y=v;let _=y.pathname||"/",j=_;if(g!=="/"){let A=g.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(A.length).join("/")}let R=In(n,{pathname:j});return wt(h||R!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),wt(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),P1(R&&R.map(A=>Object.assign({},A,{params:Object.assign({},m,A.params),pathname:Ka([g,i.encodeLocation?i.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?g:Ka([g,i.encodeLocation?i.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),o,s)}function Q1(){let n=a4(),l=Ms(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},u={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:u},"ErrorBoundary")," or"," ",b.createElement("code",{style:u},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},l),s?b.createElement("pre",{style:o},s):null,m)}var Z1=b.createElement(Q1,null),Sx=class extends b.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=$1(n.digest);s&&(n=s)}let l=n!==void 0?b.createElement(Ua.Provider,{value:this.props.routeContext},b.createElement(Sd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?b.createElement(F1,{error:n},l):l}};Sx.contextType=gx;var Qu=new WeakMap;function F1({children:n,error:l}){let{basename:s}=b.useContext(_a);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=q1(l.digest);if(i){let o=Qu.get(l);if(o)throw o;let u=nx(i.location,s);if(ax&&!Qu.get(l))if(u.isExternal||i.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:i.replace}));throw Qu.set(l,m),m}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function J1({routeContext:n,match:l,children:s}){let i=b.useContext(Ol);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),b.createElement(Ua.Provider,{value:n},s)}function P1(n,l=[],s){let i=s?.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let o=n,u=i?.errors;if(u!=null){let v=o.findIndex(y=>y.route.id&&u?.[y.route.id]!==void 0);He(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let m=!1,p=-1;if(s&&i){m=i.renderFallback;for(let v=0;v<o.length;v++){let y=o[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=v),y.route.id){let{loaderData:_,errors:j}=i,R=y.route.loader&&!_.hasOwnProperty(y.route.id)&&(!j||j[y.route.id]===void 0);if(y.route.lazy||R){s.isStatic&&(m=!0),p>=0?o=o.slice(0,p+1):o=[o[0]];break}}}}let g=s?.onError,h=i&&g?(v,y)=>{g(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Us(i.matches),errorInfo:y})}:void 0;return o.reduceRight((v,y,_)=>{let j,R=!1,z=null,A=null;i&&(j=u&&y.route.id?u[y.route.id]:void 0,z=y.route.errorElement||Z1,m&&(p<0&&_===0?(_x("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,A=null):p===_&&(R=!0,A=y.route.hydrateFallbackElement||null)));let X=l.concat(o.slice(0,_+1)),Q=()=>{let V;return j?V=z:R?V=A:y.route.Component?V=b.createElement(y.route.Component,null):y.route.element?V=y.route.element:V=v,b.createElement(J1,{match:y,routeContext:{outlet:v,matches:X,isDataRoute:i!=null},children:V})};return i&&(y.route.ErrorBoundary||y.route.errorElement||_===0)?b.createElement(Sx,{location:i.location,revalidation:i.revalidation,component:z,error:j,children:Q(),routeContext:{outlet:null,matches:X,isDataRoute:!0},onError:h}):Q()},null)}function _d(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function W1(n){let l=b.useContext(Ol);return He(l,_d(n)),l}function I1(n){let l=b.useContext(Hs);return He(l,_d(n)),l}function e4(n){let l=b.useContext(Ua);return He(l,_d(n)),l}function jd(n){let l=e4(n),s=l.matches[l.matches.length-1];return He(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function t4(){return jd("useRouteId")}function a4(){let n=b.useContext(Sd),l=I1("useRouteError"),s=jd("useRouteError");return n!==void 0?n:l.errors?.[s]}function n4(){let{router:n}=W1("useNavigate"),l=jd("useNavigate"),s=b.useRef(!1);return vx(()=>{s.current=!0}),b.useCallback(async(o,u={})=>{wt(s.current,bx),s.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:l,...u}))},[n,l])}var mg={};function _x(n,l,s){!l&&!mg[n]&&(mg[n]=!0,wt(!1,s))}var hg={};function pg(n,l){!n&&!hg[l]&&(hg[l]=!0,console.warn(l))}var l4="useOptimistic",gg=A0[l4],r4=()=>{};function s4(n){return gg?gg(n):[n,r4]}function i4(n){let l={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&wt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(l,{element:b.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&wt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(l,{hydrateFallbackElement:b.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&wt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(l,{errorElement:b.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),l}var o4=["HydrateFallback","hydrateFallbackElement"],c4=class{constructor(){this.status="pending",this.promise=new Promise((n,l)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",l(s))}})}};function u4({router:n,flushSync:l,onError:s,unstable_useTransitions:i}){i=L1()||i;let[u,m]=b.useState(n.state),[p,g]=s4(u),[h,v]=b.useState(),[y,_]=b.useState({isTransitioning:!1}),[j,R]=b.useState(),[z,A]=b.useState(),[X,Q]=b.useState(),V=b.useRef(new Map),G=b.useCallback((w,{deletedFetchers:q,newErrors:Z,flushSync:de,viewTransitionOpts:se})=>{Z&&s&&Object.values(Z).forEach(ae=>s(ae,{location:w.location,params:w.matches[0]?.params??{},unstable_pattern:Us(w.matches)})),w.fetchers.forEach((ae,ie)=>{ae.data!==void 0&&V.current.set(ie,ae.data)}),q.forEach(ae=>V.current.delete(ae)),pg(de===!1||l!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let ye=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(pg(se==null||ye,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!se||!ye){l&&de?l(()=>m(w)):i===!1?m(w):b.startTransition(()=>{i===!0&&g(ae=>xg(ae,w)),m(w)});return}if(l&&de){l(()=>{z&&(j?.resolve(),z.skipTransition()),_({isTransitioning:!0,flushSync:!0,currentLocation:se.currentLocation,nextLocation:se.nextLocation})});let ae=n.window.document.startViewTransition(()=>{l(()=>m(w))});ae.finished.finally(()=>{l(()=>{R(void 0),A(void 0),v(void 0),_({isTransitioning:!1})})}),l(()=>A(ae));return}z?(j?.resolve(),z.skipTransition(),Q({state:w,currentLocation:se.currentLocation,nextLocation:se.nextLocation})):(v(w),_({isTransitioning:!0,flushSync:!1,currentLocation:se.currentLocation,nextLocation:se.nextLocation}))},[n.window,l,z,j,i,g,s]);b.useLayoutEffect(()=>n.subscribe(G),[n,G]),b.useEffect(()=>{y.isTransitioning&&!y.flushSync&&R(new c4)},[y]),b.useEffect(()=>{if(j&&h&&n.window){let w=h,q=j.promise,Z=n.window.document.startViewTransition(async()=>{i===!1?m(w):b.startTransition(()=>{i===!0&&g(de=>xg(de,w)),m(w)}),await q});Z.finished.finally(()=>{R(void 0),A(void 0),v(void 0),_({isTransitioning:!1})}),A(Z)}},[h,j,n.window,i,g]),b.useEffect(()=>{j&&h&&p.location.key===h.location.key&&j.resolve()},[j,z,p.location,h]),b.useEffect(()=>{!y.isTransitioning&&X&&(v(X.state),_({isTransitioning:!0,flushSync:!1,currentLocation:X.currentLocation,nextLocation:X.nextLocation}),Q(void 0))},[y.isTransitioning,X]);let Y=b.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:w=>n.navigate(w),push:(w,q,Z)=>n.navigate(w,{state:q,preventScrollReset:Z?.preventScrollReset}),replace:(w,q,Z)=>n.navigate(w,{replace:!0,state:q,preventScrollReset:Z?.preventScrollReset})}),[n]),te=n.basename||"/",ee=b.useMemo(()=>({router:n,navigator:Y,static:!1,basename:te,onError:s}),[n,Y,te,s]);return b.createElement(b.Fragment,null,b.createElement(Ol.Provider,{value:ee},b.createElement(Hs.Provider,{value:p},b.createElement(xx.Provider,{value:V.current},b.createElement(vd.Provider,{value:y},b.createElement(m4,{basename:te,location:p.location,navigationType:p.historyAction,navigator:Y,unstable_useTransitions:i},b.createElement(d4,{routes:n.routes,future:n.future,state:p,isStatic:!1,onError:s})))))),null)}function xg(n,l){return{...n,navigation:l.navigation.state!=="idle"?l.navigation:n.navigation,revalidation:l.revalidation!=="idle"?l.revalidation:n.revalidation,actionData:l.navigation.state!=="submitting"?l.actionData:n.actionData,fetchers:l.fetchers}}var d4=b.memo(f4);function f4({routes:n,future:l,state:s,isStatic:i,onError:o}){return X1(n,void 0,{state:s,isStatic:i,onError:o})}function yg({to:n,replace:l,state:s,relative:i}){He(Rr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=b.useContext(_a);wt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=b.useContext(Ua),{pathname:m}=Qa(),p=Rn(),g=ks(n,vo(u),m,i==="path"),h=JSON.stringify(g);return b.useEffect(()=>{p(JSON.parse(h),{replace:l,state:s,relative:i})},[p,h,i,l,s]),null}function jx(n){return K1(n.context)}function m4({basename:n="/",children:l=null,location:s,navigationType:i="POP",navigator:o,static:u=!1,unstable_useTransitions:m}){He(!Rr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=b.useMemo(()=>({basename:p,navigator:o,static:u,unstable_useTransitions:m,future:{}}),[p,o,u,m]);typeof s=="string"&&(s=Cn(s));let{pathname:h="/",search:v="",hash:y="",state:_=null,key:j="default",unstable_mask:R}=s,z=b.useMemo(()=>{let A=La(h,p);return A==null?null:{location:{pathname:A,search:v,hash:y,state:_,key:j,unstable_mask:R},navigationType:i}},[p,h,v,y,_,j,i,R]);return wt(z!=null,`<Router basename="${p}"> is not able to match the URL "${h}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),z==null?null:b.createElement(_a.Provider,{value:g},b.createElement(So.Provider,{children:l,value:z}))}var uo="get",fo="application/x-www-form-urlencoded";function _o(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function h4(n){return _o(n)&&n.tagName.toLowerCase()==="button"}function p4(n){return _o(n)&&n.tagName.toLowerCase()==="form"}function g4(n){return _o(n)&&n.tagName.toLowerCase()==="input"}function x4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function y4(n,l){return n.button===0&&(!l||l==="_self")&&!x4(n)}function od(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,s)=>{let i=n[s];return l.concat(Array.isArray(i)?i.map(o=>[s,o]):[[s,i]])},[]))}function b4(n,l){let s=od(n);return l&&l.forEach((i,o)=>{s.has(o)||l.getAll(o).forEach(u=>{s.append(o,u)})}),s}var lo=null;function v4(){if(lo===null)try{new FormData(document.createElement("form"),0),lo=!1}catch{lo=!0}return lo}var S4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zu(n){return n!=null&&!S4.has(n)?(wt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${fo}"`),null):n}function _4(n,l){let s,i,o,u,m;if(p4(n)){let p=n.getAttribute("action");i=p?La(p,l):null,s=n.getAttribute("method")||uo,o=Zu(n.getAttribute("enctype"))||fo,u=new FormData(n)}else if(h4(n)||g4(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(i=g?La(g,l):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||uo,o=Zu(n.getAttribute("formenctype"))||Zu(p.getAttribute("enctype"))||fo,u=new FormData(p,n),!v4()){let{name:h,type:v,value:y}=n;if(v==="image"){let _=h?`${h}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else h&&u.append(h,y)}}else{if(_o(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=uo,i=null,o=fo,m=n}return u&&o==="text/plain"&&(m=u,u=void 0),{action:i,method:s.toLowerCase(),encType:o,formData:u,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Nd(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function j4(n,l,s,i){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:l&&La(o.pathname,l)==="/"?o.pathname=`${l.replace(/\/$/,"")}/_root.${i}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${i}`,o}async function N4(n,l){if(n.id in l)return l[n.id];try{let s=await import(n.module);return l[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function w4(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function E4(n,l,s){let i=await Promise.all(n.map(async o=>{let u=l.routes[o.route.id];if(u){let m=await N4(u,s);return m.links?m.links():[]}return[]}));return z4(i.flat(1).filter(w4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function bg(n,l,s,i,o,u){let m=(g,h)=>s[h]?g.route.id!==s[h].route.id:!0,p=(g,h)=>s[h].pathname!==g.pathname||s[h].route.path?.endsWith("*")&&s[h].params["*"]!==g.params["*"];return u==="assets"?l.filter((g,h)=>m(g,h)||p(g,h)):u==="data"?l.filter((g,h)=>{let v=i.routes[g.route.id];if(!v||!v.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let y=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function C4(n,l,{includeHydrateFallback:s}={}){return R4(n.map(i=>{let o=l.routes[i.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),s&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function R4(n){return[...new Set(n)]}function T4(n){let l={},s=Object.keys(n).sort();for(let i of s)l[i]=n[i];return l}function z4(n,l){let s=new Set;return new Set(l),n.reduce((i,o)=>{let u=JSON.stringify(T4(o));return s.has(u)||(s.add(u),i.push({key:u,link:o})),i},[])}function Nx(){let n=b.useContext(Ol);return Nd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function O4(){let n=b.useContext(Hs);return Nd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var wd=b.createContext(void 0);wd.displayName="FrameworkContext";function wx(){let n=b.useContext(wd);return Nd(n,"You must render this element inside a <HydratedRouter> element"),n}function D4(n,l){let s=b.useContext(wd),[i,o]=b.useState(!1),[u,m]=b.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:v,onTouchStart:y}=l,_=b.useRef(null);b.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let z=X=>{X.forEach(Q=>{m(Q.isIntersecting)})},A=new IntersectionObserver(z,{threshold:.5});return _.current&&A.observe(_.current),()=>{A.disconnect()}}},[n]),b.useEffect(()=>{if(i){let z=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(z)}}},[i]);let j=()=>{o(!0)},R=()=>{o(!1),m(!1)};return s?n!=="intent"?[u,_,{}]:[u,_,{onFocus:Ns(p,j),onBlur:Ns(g,R),onMouseEnter:Ns(h,j),onMouseLeave:Ns(v,R),onTouchStart:Ns(y,j)}]:[!1,_,{}]}function Ns(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function M4({page:n,...l}){let{router:s}=Nx(),i=b.useMemo(()=>In(s.routes,n,s.basename),[s.routes,n,s.basename]);return i?b.createElement(k4,{page:n,matches:i,...l}):null}function A4(n){let{manifest:l,routeModules:s}=wx(),[i,o]=b.useState([]);return b.useEffect(()=>{let u=!1;return E4(n,l,s).then(m=>{u||o(m)}),()=>{u=!0}},[n,l,s]),i}function k4({page:n,matches:l,...s}){let i=Qa(),{future:o,manifest:u,routeModules:m}=wx(),{basename:p}=Nx(),{loaderData:g,matches:h}=O4(),v=b.useMemo(()=>bg(n,l,h,u,i,"data"),[n,l,h,u,i]),y=b.useMemo(()=>bg(n,l,h,u,i,"assets"),[n,l,h,u,i]),_=b.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let z=new Set,A=!1;if(l.forEach(Q=>{let V=u.routes[Q.route.id];!V||!V.hasLoader||(!v.some(G=>G.route.id===Q.route.id)&&Q.route.id in g&&m[Q.route.id]?.shouldRevalidate||V.hasClientLoader?A=!0:z.add(Q.route.id))}),z.size===0)return[];let X=j4(n,p,o.unstable_trailingSlashAwareDataRequests,"data");return A&&z.size>0&&X.searchParams.set("_routes",l.filter(Q=>z.has(Q.route.id)).map(Q=>Q.route.id).join(",")),[X.pathname+X.search]},[p,o.unstable_trailingSlashAwareDataRequests,g,i,u,v,l,n,m]),j=b.useMemo(()=>C4(y,u),[y,u]),R=A4(y);return b.createElement(b.Fragment,null,_.map(z=>b.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...s})),j.map(z=>b.createElement("link",{key:z,rel:"modulepreload",href:z,...s})),R.map(({key:z,link:A})=>b.createElement("link",{key:z,nonce:s.nonce,...A,crossOrigin:A.crossOrigin??s.crossOrigin})))}function L4(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var U4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{U4&&(window.__reactRouterVersion="7.13.1")}catch{}function H4(n,l){return d1({basename:l?.basename,getContext:l?.getContext,future:l?.future,history:Cv({window:l?.window}),hydrationData:B4(),routes:n,mapRouteProperties:i4,hydrationRouteProperties:o4,dataStrategy:l?.dataStrategy,patchRoutesOnNavigation:l?.patchRoutesOnNavigation,window:l?.window,unstable_instrumentations:l?.unstable_instrumentations}).initialize()}function B4(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:q4(n.errors)}),n}function q4(n){if(!n)return null;let l=Object.entries(n),s={};for(let[i,o]of l)if(o&&o.__type==="RouteErrorResponse")s[i]=new Ls(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let u=window[o.__subType];if(typeof u=="function")try{let m=new u(o.message);m.stack="",s[i]=m}catch{}}if(s[i]==null){let u=new Error(o.message);u.stack="",s[i]=u}}else s[i]=o;return s}var Ex=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,va=b.forwardRef(function({onClick:l,discover:s="render",prefetch:i="none",relative:o,reloadDocument:u,replace:m,unstable_mask:p,state:g,target:h,to:v,preventScrollReset:y,viewTransition:_,unstable_defaultShouldRevalidate:j,...R},z){let{basename:A,navigator:X,unstable_useTransitions:Q}=b.useContext(_a),V=typeof v=="string"&&Ex.test(v),G=nx(v,A);v=G.to;let Y=Y1(v,{relative:o}),te=Qa(),ee=null;if(p){let ie=ks(p,[],te.unstable_mask?te.unstable_mask.pathname:"/",!0);A!=="/"&&(ie.pathname=ie.pathname==="/"?A:Ka([A,ie.pathname])),ee=X.createHref(ie)}let[w,q,Z]=D4(i,R),de=G4(v,{replace:m,unstable_mask:p,state:g,target:h,preventScrollReset:y,relative:o,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:Q});function se(ie){l&&l(ie),ie.defaultPrevented||de(ie)}let ye=!(G.isExternal||u),ae=b.createElement("a",{...R,...Z,href:(ye?ee:void 0)||G.absoluteURL||Y,onClick:ye?se:l,ref:L4(z,q),target:h,"data-discover":!V&&s==="render"?"true":void 0});return w&&!V?b.createElement(b.Fragment,null,ae,b.createElement(M4,{page:Y})):ae});va.displayName="Link";var As=b.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:i="",end:o=!1,style:u,to:m,viewTransition:p,children:g,...h},v){let y=qs(m,{relative:h.relative}),_=Qa(),j=b.useContext(Hs),{navigator:R,basename:z}=b.useContext(_a),A=j!=null&&Z4(y)&&p===!0,X=R.encodeLocation?R.encodeLocation(y).pathname:y.pathname,Q=_.pathname,V=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(Q=Q.toLowerCase(),V=V?V.toLowerCase():null,X=X.toLowerCase()),V&&z&&(V=La(V,z)||V);const G=X!=="/"&&X.endsWith("/")?X.length-1:X.length;let Y=Q===X||!o&&Q.startsWith(X)&&Q.charAt(G)==="/",te=V!=null&&(V===X||!o&&V.startsWith(X)&&V.charAt(X.length)==="/"),ee={isActive:Y,isPending:te,isTransitioning:A},w=Y?l:void 0,q;typeof i=="function"?q=i(ee):q=[i,Y?"active":null,te?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let Z=typeof u=="function"?u(ee):u;return b.createElement(va,{...h,"aria-current":w,className:q,ref:v,style:Z,to:m,viewTransition:p},typeof g=="function"?g(ee):g)});As.displayName="NavLink";var $4=b.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:i,replace:o,state:u,method:m=uo,action:p,onSubmit:g,relative:h,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:_,...j},R)=>{let{unstable_useTransitions:z}=b.useContext(_a),A=X4(),X=Q4(p,{relative:h}),Q=m.toLowerCase()==="get"?"get":"post",V=typeof p=="string"&&Ex.test(p),G=Y=>{if(g&&g(Y),Y.defaultPrevented)return;Y.preventDefault();let te=Y.nativeEvent.submitter,ee=te?.getAttribute("formmethod")||m,w=()=>A(te||Y.currentTarget,{fetcherKey:l,method:ee,navigate:s,replace:o,state:u,relative:h,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:_});z&&s!==!1?b.startTransition(()=>w()):w()};return b.createElement("form",{ref:R,method:Q,action:X,onSubmit:i?g:G,...j,"data-discover":!V&&n==="render"?"true":void 0})});$4.displayName="Form";function Y4(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Cx(n){let l=b.useContext(Ol);return He(l,Y4(n)),l}function G4(n,{target:l,replace:s,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:h}={}){let v=Rn(),y=Qa(),_=qs(n,{relative:m});return b.useCallback(j=>{if(y4(j,l)){j.preventDefault();let R=s!==void 0?s:rn(y)===rn(_),z=()=>v(n,{replace:R,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g});h?b.startTransition(()=>z()):z()}},[y,v,_,s,i,o,l,n,u,m,p,g,h])}function Ed(n){wt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=b.useRef(od(n)),s=b.useRef(!1),i=Qa(),o=b.useMemo(()=>b4(i.search,s.current?null:l.current),[i.search]),u=Rn(),m=b.useCallback((p,g)=>{const h=od(typeof p=="function"?p(new URLSearchParams(o)):p);s.current=!0,u("?"+h,g)},[u,o]);return[o,m]}var V4=0,K4=()=>`__${String(++V4)}__`;function X4(){let{router:n}=Cx("useSubmit"),{basename:l}=b.useContext(_a),s=t4(),i=n.fetch,o=n.navigate;return b.useCallback(async(u,m={})=>{let{action:p,method:g,encType:h,formData:v,body:y}=_4(u,l);if(m.navigate===!1){let _=m.fetcherKey||K4();await i(_,s,m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:y,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await o(m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:y,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,o,l,s])}function Q4(n,{relative:l}={}){let{basename:s}=b.useContext(_a),i=b.useContext(Ua);He(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),u={...qs(n||".",{relative:l})},m=Qa();if(n==null){u.search=m.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(v=>v==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let v=p.toString();u.search=v?`?${v}`:""}}return(!n||n===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(u.pathname=u.pathname==="/"?s:Ka([s,u.pathname])),rn(u)}function Z4(n,{relative:l}={}){let s=b.useContext(vd);He(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Cx("useViewTransitionState"),o=qs(n,{relative:l});if(!s.isTransitioning)return!1;let u=La(s.currentLocation.pathname,i)||s.currentLocation.pathname,m=La(s.nextLocation.pathname,i)||s.nextLocation.pathname;return go(o.pathname,m)!=null||go(o.pathname,u)!=null}const vg=n=>{let l;const s=new Set,i=(h,v)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const _=l;l=v??(typeof y!="object"||y===null)?y:Object.assign({},l,y),s.forEach(j=>j(l,_))}},o=()=>l,p={setState:i,getState:o,getInitialState:()=>g,subscribe:h=>(s.add(h),()=>s.delete(h))},g=l=n(i,o,p);return p},F4=(n=>n?vg(n):vg),J4=n=>n;function P4(n,l=J4){const s=Nr.useSyncExternalStore(n.subscribe,Nr.useCallback(()=>l(n.getState()),[n,l]),Nr.useCallback(()=>l(n.getInitialState()),[n,l]));return Nr.useDebugValue(s),s}const Sg=n=>{const l=F4(n),s=i=>P4(l,i);return Object.assign(s,l),s},jo=(n=>n?Sg(n):Sg),Rx="/api/v1";class El extends Error{constructor(l,s,i){super(i),this.status=l,this.code=s,this.name="ApiError"}}async function ro(n,l,s,i,o){let u=`${Rx}${l}`;if(i){const g=new URLSearchParams(i).toString();g&&(u+=`?${g}`)}const m={method:n,headers:{"Content-Type":"application/json"}};s!==void 0&&(m.body=JSON.stringify(s)),o?.signal&&(m.signal=o.signal);const p=await fetch(u,m);if(!p.ok){let g="UNKNOWN",h=p.statusText;try{const v=await p.json();v.code&&(g=v.code),v.message&&(h=v.message)}catch{}throw new El(p.status,g,h)}return p.json()}const Fu=new Map;function W4(n,l){let s=`${Rx}${n}`;if(l){const i=new URLSearchParams(l).toString();i&&(s+=`?${i}`)}return s}const vt={get(n,l,s){const i=W4(n,l),o=Fu.get(i);if(o)return o;const u=ro("GET",n,void 0,l,s).finally(()=>{Fu.delete(i)});return Fu.set(i,u),u},post(n,l,s){return ro("POST",n,l,void 0,s)},put(n,l){return ro("PUT",n,l)},delete(n){return ro("DELETE",n)}},I4=3e4,eS=1e3,tS=3e4;class aS{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;_status="disconnected";get status(){return this._status}setStatus(l){this._status=l;for(const s of this.statusHandlers)s(l)}onStatusChange(l){return this.statusHandlers.add(l),()=>{this.statusHandlers.delete(l)}}connect(l){this.url=l,this.intentionalClose=!1,this.reconnectAttempt=0,this.open()}disconnect(){this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}on(l,s){let i=this.handlers.get(l);return i||(i=new Set,this.handlers.set(l,i)),i.add(s),()=>{i.delete(s),i.size===0&&this.handlers.delete(l)}}send(l,s){if(this.ws?.readyState!==WebSocket.OPEN)return;const i={event:l,payload:s,timestamp:Date.now()};this.ws.send(JSON.stringify(i))}open(){this.setStatus("connecting");const l=new WebSocket(this.url);l.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},l.onmessage=s=>{try{const i=JSON.parse(String(s.data));if(i.event==="pong")return;const o=this.handlers.get(i.event);if(o)for(const u of o)u(i.payload)}catch{}},l.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},l.onerror=()=>{},this.ws=l}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},I4)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const l=Math.min(eS*2**this.reconnectAttempt,tS);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},l)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const Xa=new aS,nl="lib_cloud_default",Zt=jo((n,l)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const s=await vt.get("/libraries");n({libraries:s,loading:!1})}catch(s){n({error:s instanceof Error?s.message:"Failed to load libraries",loading:!1})}},createLibrary:async s=>{const i=await vt.post("/libraries",s);return n(o=>({libraries:[...o.libraries,i]})),i},deleteLibrary:async s=>{await vt.delete(`/libraries/${s}`),n(i=>({libraries:i.libraries.filter(o=>o.id!==s)}))},updateLibraryName:async(s,i)=>{const o=await vt.put(`/libraries/${s}`,{name:i});n(u=>({libraries:u.libraries.map(m=>m.id===s?o:m)}))},_updateLibraryOnline:(s,i)=>{n(o=>({libraries:o.libraries.map(u=>u.id===s?{...u,is_online:i}:u)}))},_refreshLibrary:async s=>{try{const i=await vt.get(`/libraries/${s}`);n(o=>({libraries:o.libraries.map(u=>u.id===s?i:u)}))}catch{l().fetchLibraries()}}})),Tr=n=>{const l=n.libraries.filter(i=>i.type==="cloud").sort((i,o)=>i.created_at.localeCompare(o.created_at)),s=n.libraries.filter(i=>i.type==="daemon").sort((i,o)=>i.name.localeCompare(o.name));return[...l,...s]},nS=n=>n.libraries.filter(l=>l.type==="daemon");Xa.on("ws:daemon:status",n=>{const l=n;l.lib_id&&Zt.getState()._updateLibraryOnline(l.lib_id,l.is_online),Zt.getState().fetchLibraries()});Xa.on("ws:daemon:connected",n=>{const l=n;l.lib_id&&Zt.getState()._updateLibraryOnline(l.lib_id,!0),Zt.getState().fetchLibraries()});Xa.on("ws:library:updated",n=>{const l=n;Zt.getState()._refreshLibrary(l.library_id)});const Tx=(...n)=>n.filter((l,s,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===s).join(" ").trim();const lS=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const rS=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,s,i)=>i?i.toUpperCase():s.toLowerCase());const _g=n=>{const l=rS(n);return l.charAt(0).toUpperCase()+l.slice(1)};var sS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const iS=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const oS=b.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:m,...p},g)=>b.createElement("svg",{ref:g,...sS,width:l,height:l,stroke:n,strokeWidth:i?Number(s)*24/Number(l):s,className:Tx("lucide",o),...!u&&!iS(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,v])=>b.createElement(h,v)),...Array.isArray(u)?u:[u]]));const Ae=(n,l)=>{const s=b.forwardRef(({className:i,...o},u)=>b.createElement(oS,{ref:u,iconNode:l,className:Tx(`lucide-${lS(_g(n))}`,`lucide-${n}`,i),...o}));return s.displayName=_g(n),s};const cS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zx=Ae("arrow-right",cS);const uS=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],jg=Ae("arrow-up-right",uS);const dS=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],fS=Ae("boxes",dS);const mS=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],hS=Ae("brain",mS);const pS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Tl=Ae("check",pS);const gS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ta=Ae("chevron-right",gS);const xS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ox=Ae("circle-alert",xS);const yS=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],bS=Ae("cloud",yS);const vS=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],cd=Ae("copy",vS);const SS=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],_S=Ae("database",SS);const jS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],NS=Ae("file-spreadsheet",jS);const wS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],al=Ae("file-text",wS);const ES=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Dx=Ae("file",ES);const CS=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],RS=Ae("files",CS);const TS=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],Cd=Ae("folder-git-2",TS);const zS=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],OS=Ae("folder-input",zS);const DS=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],MS=Ae("folder-open",DS);const AS=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Mx=Ae("folder-plus",AS);const kS=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ka=Ae("folder",kS);const LS=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],ud=Ae("git-branch",LS);const US=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],HS=Ae("git-commit-horizontal",US);const BS=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Ng=Ae("github",BS);const qS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],$S=Ae("globe",qS);const YS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],GS=Ae("info",YS);const VS=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],KS=Ae("laptop",VS);const XS=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],QS=Ae("list-filter",XS);const ZS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Sa=Ae("loader-circle",ZS);const FS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],JS=Ae("menu",FS);const PS=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],WS=Ae("monitor",PS);const IS=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],e2=Ae("moon",IS);const t2=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Cr=Ae("package",t2);const a2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],n2=Ae("panel-left",a2);const l2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],dd=Ae("pencil",l2);const r2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ax=Ae("plus",r2);const s2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],kx=Ae("refresh-cw",s2);const i2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fd=Ae("search",i2);const o2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],c2=Ae("settings",o2);const u2=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],d2=Ae("share-2",u2);const f2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],m2=Ae("sparkles",f2);const h2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],p2=Ae("sun",h2);const g2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Lx=Ae("trash-2",g2);const x2=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],md=Ae("upload",x2);const y2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],b2=Ae("users",y2);const v2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dl=Ae("x",v2),zl=jo(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:l=>n({status:l}),fetchDaemonStatus:async()=>{try{const l=await vt.get("/daemons/status");n({onlineCount:l.online_count,connections:l.connections})}catch{}}})),S2=n=>n==="connecting"?"disconnected":n;Xa.onStatusChange(n=>{zl.getState().setStatus(S2(n))});Xa.on("ws:daemon:connected",n=>{const l=n;zl.setState(s=>{if(s.connections.some(m=>m.machine_id===l.machine_id))return s;const o={machine_id:l.machine_id};l.lib_id&&(o.lib_id=l.lib_id);const u=[...s.connections,o];return{connections:u,onlineCount:u.length}})});Xa.on("ws:daemon:status",n=>{const l=n;zl.setState(s=>{if(l.is_online){if(s.connections.some(p=>p.machine_id===l.machine_id))return s;const u={machine_id:l.machine_id};l.lib_id&&(u.lib_id=l.lib_id);const m=[...s.connections,u];return{connections:m,onlineCount:m.length}}const i=s.connections.filter(o=>o.machine_id!==l.machine_id);return{connections:i,onlineCount:i.length}})});const wg=n=>Symbol.iterator in n,Eg=n=>"entries"in n,Cg=(n,l)=>{const s=n instanceof Map?n:new Map(n.entries()),i=l instanceof Map?l:new Map(l.entries());if(s.size!==i.size)return!1;for(const[o,u]of s)if(!i.has(o)||!Object.is(u,i.get(o)))return!1;return!0},_2=(n,l)=>{const s=n[Symbol.iterator](),i=l[Symbol.iterator]();let o=s.next(),u=i.next();for(;!o.done&&!u.done;){if(!Object.is(o.value,u.value))return!1;o=s.next(),u=i.next()}return!!o.done&&!!u.done};function j2(n,l){return Object.is(n,l)?!0:typeof n!="object"||n===null||typeof l!="object"||l===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(l)?!1:wg(n)&&wg(l)?Eg(n)&&Eg(l)?Cg(n,l):_2(n,l):Cg({entries:()=>Object.entries(n)},{entries:()=>Object.entries(l)})}function Ml(n){const l=Nr.useRef(void 0);return s=>{const i=n(s);return j2(l.current,i)?l.current:l.current=i}}function hd(){const{t:n}=Te(),l=zl(m=>m.onlineCount),s=zl(m=>m.connections.length);if(Zt(Ml(nS)).length===0)return null;const o=l>0,u=o?n("sources.header.daemon_status",{online:l,total:s}):n("sources.header.all_offline");return f.jsxs("div",{className:"group relative flex items-center",title:u,children:[f.jsx("span",{className:`inline-block h-[7px] w-[7px] rounded-full ${o?"bg-c4a-success":"bg-c4a-error"}`}),f.jsx("span",{className:"pointer-events-none absolute right-full mr-2 hidden whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-xs text-c4a-text-secondary shadow-c4a-md group-hover:block",children:u})]})}const Rg=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function N2(){const{t:n}=Te(),[l,s]=b.useState(!1);return f.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[f.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[f.jsxs(va,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),f.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[f.jsx("nav",{className:"flex items-center gap-4",children:Rg.map(({to:i,labelKey:o})=>f.jsx(As,{to:i,end:i==="/",className:({isActive:u})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(hd,{}),f.jsx(va,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})]}),f.jsx("button",{onClick:()=>s(!l),className:"text-c4a-text-secondary md:hidden",children:l?f.jsx(Dl,{size:20}):f.jsx(JS,{size:20})})]}),l&&f.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[f.jsx("nav",{className:"flex flex-col gap-2",children:Rg.map(({to:i,labelKey:o})=>f.jsx(As,{to:i,end:i==="/",onClick:()=>s(!1),className:({isActive:u})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(hd,{}),f.jsx(va,{to:"/login",onClick:()=>s(!1),className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})})]})]})}function w2(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function Ux(n){if(typeof window>"u")return;const l=w2(n);document.documentElement.setAttribute("data-theme",l),localStorage.setItem("theme",n)}function E2(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const Hx=jo(n=>({theme:E2(),setTheme:l=>{Ux(l),n({theme:l})}}));let Tg=!1;function C2(){if(Tg||typeof window>"u")return;Tg=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{const{theme:s}=Hx.getState();s==="system"&&Ux("system")};n.addEventListener("change",l)}C2();const R2=[{mode:"light",icon:p2,labelKey:"footer.theme.light"},{mode:"dark",icon:e2,labelKey:"footer.theme.dark"},{mode:"system",icon:WS,labelKey:"footer.theme.system"}];function Bx(){const{t:n}=Te(),{theme:l,setTheme:s}=Hx();return f.jsx("div",{className:"flex items-center gap-1",children:R2.map(({mode:i,icon:o,labelKey:u})=>f.jsx("button",{onClick:()=>s(i),title:n(u),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${l===i?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:f.jsx(o,{size:14})},i))})}function qx(){const{i18n:n}=Te(),l=()=>{const s=n.language==="en"?"zh":"en";n.changeLanguage(s)};return f.jsx("button",{onClick:l,className:"cursor-pointer rounded px-2 py-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-secondary hover:bg-c4a-bg-hover",children:n.language==="en"?"CN":"EN"})}function $x({compact:n}){const{t:l}=Te(),s=new Date().getFullYear(),i=n?"footer.copyright_compact":"footer.copyright";return f.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:l(i,{year:s})})}const T2="_brandIcon_1c7st_1",z2="_iconPulse_1c7st_35",zg={brandIcon:T2,iconPulse:z2};function O2({variant:n}){const{t:l}=Te(),s=n==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return f.jsx("footer",{className:`border-t border-c4a-border-subtle ${s} px-4 py-4`,children:f.jsxs("div",{className:"flex items-end justify-between gap-4",children:[f.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[f.jsx("div",{className:zg.brandIcon,children:f.jsx("span",{className:zg.iconPulse,children:"C4A"})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:l("footer.tagline")})]})]}),f.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Bx,{}),f.jsx(qx,{})]}),f.jsx($x,{})]})]})})}function D2(){return f.jsxs("div",{className:"flex min-h-screen flex-col",children:[f.jsx(N2,{}),f.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:f.jsx(jx,{})}),f.jsx(O2,{})]})}function M2({onToggleSidebar:n}){const{t:l}=Te();return f.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:f.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("button",{onClick:n,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:f.jsx(n2,{size:20})}),f.jsxs(va,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),f.jsx(va,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(hd,{}),f.jsx(va,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:l("nav.login")})]})]})})}const A2=n=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${n?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,k2=[{to:"/studio/modeling",icon:fS,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:hS,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:fd,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:d2,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:b2,i18nKey:"studio.sidebar.collaboration"},{to:"/studio/settings",icon:c2,i18nKey:"studio.sidebar.settings"}];function Og({onNavigate:n}){const{t:l}=Te(),s=Qa(),i=Rn(),o=Zt(Ml(Tr)),u=s.pathname.startsWith("/studio/sources")||s.pathname.startsWith("/studio/source/"),[m,p]=b.useState(u);b.useEffect(()=>{u&&p(!0)},[u]);const g=h=>h.id===nl?l("sources.library.default_cloud_name"):h.name;return f.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("nav",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"group/sources",children:[f.jsxs("button",{onClick:()=>p(h=>!h),className:`flex w-full cursor-pointer items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[f.jsx(_S,{size:14}),l("studio.sidebar.sources"),f.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"rounded p-0.5 text-c4a-text-muted opacity-0 transition-all hover:bg-c4a-bg-hover max-md:opacity-100 group-hover/sources:opacity-100 group-hover/sources:text-c4a-accent",title:l("sources.menu.add_client"),children:f.jsx(Ax,{size:12})}),f.jsx(ta,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&f.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(h=>{const v=g(h);return f.jsxs(As,{to:`/studio/sources/${h.id}`,onClick:n,className:({isActive:y})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${y?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[h.type==="cloud"?f.jsx(bS,{size:13,className:"shrink-0 opacity-60"}):f.jsx(KS,{size:13,className:"shrink-0 opacity-60"}),f.jsx("span",{className:"truncate",children:v}),h.type==="daemon"&&f.jsx("span",{className:`ml-auto h-[7px] w-[7px] shrink-0 rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`})]},h.id)})})]}),k2.map(({to:h,icon:v,i18nKey:y})=>f.jsxs(As,{to:h,onClick:n,className:({isActive:_})=>A2(_),children:[f.jsx(v,{size:14}),l(y)]},h))]}),f.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(Bx,{}),f.jsx(qx,{})]}),f.jsx($x,{compact:!0})]})]})}function L2(){const[n,l]=b.useState(!1);return b.useEffect(()=>{Zt.getState().fetchLibraries(),zl.getState().fetchDaemonStatus()},[]),b.useEffect(()=>Xa.onStatusChange(s=>{s==="connected"&&(Zt.getState().fetchLibraries(),zl.getState().fetchDaemonStatus())}),[]),f.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[f.jsx(M2,{onToggleSidebar:()=>l(!n)}),f.jsxs("div",{className:"flex min-h-0 flex-1",children:[f.jsx("div",{className:"hidden md:block",children:f.jsx(Og,{})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>l(!1)}),f.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:f.jsx(Og,{onNavigate:()=>l(!1)})})]}),f.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:f.jsx(jx,{})})]})]})}function U2(){const{t:n}=Te();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[f.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:n("home.hero.title")}),f.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:n("home.hero.description")}),f.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[f.jsxs(va,{to:"/studio",className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[n("home.hero.cta.studio"),f.jsx(zx,{size:14})]}),f.jsx("a",{href:"https://github.com/context4ai/c4a",target:"_blank",rel:"noopener noreferrer",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("home.hero.cta.github")})]})]})}function Ha({title:n,version:l,description:s}){const{t:i}=Te();return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-md text-center",children:[f.jsx("h2",{className:"font-mono text-2xl font-bold uppercase text-c4a-text-primary",children:n}),l&&f.jsx("span",{className:"mt-3 inline-block rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1 font-mono text-xs uppercase text-c4a-accent",children:i("placeholder.coming",{version:l})}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:s})]})})}function H2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.login.title"),version:"0.5.0",description:n("page.login.description")})}function B2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function q2(){const{t:n}=Te();return f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n("notfound.title")}),f.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:n("notfound.description")}),f.jsx(va,{to:"/",className:"mt-8 rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("notfound.back")})]})}function $2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function Y2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function G2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function V2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function K2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}function X2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.settings.title"),version:"0.5.x",description:n("page.settings.description")})}function Q2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function Z2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function F2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function J2(){const{t:n}=Te();return f.jsx(Ha,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const No=(n,l)=>{for(const s of n){if(s.path===l)return s;if(s.children){const i=No(s.children,l);if(i)return i}}return null},P2=(n,l)=>l===""?n:No(n,l)?.children??[],Yx=(n,l)=>{if(!l)return[];const s=l.split("/"),i=[];let o="";for(const u of s){o=o?`${o}/${u}`:u;const m=No(n,o);m&&i.push(m)}return i},wo=jo(n=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:l,limit:s,offset:i})=>{n({loading:!0,error:null});try{const o={library_id:l};s!==void 0&&(o.limit=String(s)),i!==void 0&&(o.offset=String(i));const u=await vt.get("/sources",o);n({rootSources:u.items,total:u.total,limit:u.limit,offset:u.offset,loading:!1})}catch(o){n({error:o instanceof Error?o.message:"Failed to load sources",loading:!1})}},fetchRootSource:async l=>{const s=await vt.get(`/sources/${l}`);return n({currentRoot:s}),s},createSource:async l=>await vt.post("/sources",l),addTreeNode:async(l,s)=>{const i=await vt.post(`/sources/${l}/tree`,s);return n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot})),i},updateSource:async(l,s)=>{const i=await vt.put(`/sources/${l}`,s);n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot}))},deleteSource:async l=>{await vt.delete(`/sources/${l}`),n(s=>({rootSources:s.rootSources.filter(i=>i.id!==l),currentRoot:s.currentRoot?.id===l?null:s.currentRoot}))},deleteTreeNode:async(l,s)=>{const i=await vt.delete(`/sources/${l}/tree?path=${encodeURIComponent(s)}`);return n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot})),i},uploadDoc:async l=>await vt.post("/sources/upload",l),setFilter:l=>n({filter:l}),clearSources:()=>n({rootSources:[],currentRoot:null,total:0,offset:0})}));function zr({segments:n}){const{t:l}=Te(),s=b.useRef(null),i=b.useRef(null),[o,u]=b.useState(0),m=[{label:l("sources.breadcrumb.sources")},...n],p=Math.max(0,m.length-3);b.useEffect(()=>{const h=s.current,v=i.current;if(!h||!v)return;const y=()=>{const j=h.clientWidth,R=Array.from(v.children);if(R.length===0)return;const z=R.map(ee=>ee.offsetWidth),A=4;if(z.reduce((ee,w)=>ee+w,0)+A*(z.length-1)<=j){u(0);return}const Q=20,V=(z[0]??0)+(z[1]??0)+A,G=z[z.length-1]??0,Y=V+A+Q+A+G;let te=p;for(let ee=1;ee<=p;ee++){let w=0;for(let q=2+ee;q<z.length-1;q++)w+=z[q]+A;if(Y+w<=j){te=ee;break}}u(te)};y();const _=new ResizeObserver(y);return _.observe(h),()=>_.disconnect()},[p,n,l]);const g=(()=>{if(o===0||m.length<=3)return m;const h=m.slice(0,2),v=m[m.length-1],y=m.slice(2+o,m.length-1);return[...h,{label:"…"},...y,v]})();return f.jsxs("div",{ref:s,className:"relative min-w-0 overflow-hidden",children:[f.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs text-c4a-text-muted",children:g.map((h,v)=>{const y=v===g.length-1;return f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&f.jsx(ta,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!y?f.jsx(va,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):f.jsx("span",{className:`whitespace-nowrap ${y?"text-c4a-text-primary":""}`,children:h.label})]},v)})}),f.jsx("div",{ref:i,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 items-center gap-1 overflow-visible whitespace-nowrap font-mono text-xs",children:m.map((h,v)=>f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&f.jsx(ta,{size:12}),f.jsx("span",{className:"whitespace-nowrap",children:h.label})]},v))})]})}const W2=["all","indexed","not_indexed"];function I2({value:n,onChange:l}){const{t:s}=Te(),[i,o]=b.useState(!1),u=b.useRef(null),m=b.useRef(null),p={all:s("sources.filter.all"),indexed:s("sources.filter.indexed"),not_indexed:s("sources.filter.not_indexed")},g=b.useCallback(y=>{u.current&&!u.current.contains(y.target)&&o(!1)},[]);b.useEffect(()=>{if(i)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i,g]);const h=b.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),o(!0)},[]),v=b.useCallback(()=>{m.current=setTimeout(()=>o(!1),150)},[]);return f.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(QS,{size:12}),f.jsx("span",{className:"hidden sm:inline",children:p[n]}),f.jsx(ta,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&f.jsx("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[120px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:W2.map(y=>f.jsxs("button",{onClick:()=>{l(y),o(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${y===n?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx(Tl,{size:12,className:y===n?"opacity-100":"opacity-0"}),p[y]]},y))})]})}function Gx({currentName:n,onConfirm:l,onCancel:s,error:i}){const[o,u]=b.useState(n),m=b.useRef(null);b.useEffect(()=>{m.current?.select()},[]);const p=b.useCallback(()=>{const h=o.trim();h&&h!==n?l(h):s()},[o,n,l,s]),g=b.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),p()):h.key==="Escape"&&s()},[p,s]);return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,onBlur:p,className:"min-w-0 flex-1 rounded border border-c4a-accent bg-c4a-bg-surface px-2 py-1 text-sm text-c4a-text-primary outline-none",autoFocus:!0}),f.jsx("button",{onClick:h=>{h.stopPropagation(),p()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:f.jsx(Tl,{size:14})}),f.jsx("button",{onClick:h=>{h.stopPropagation(),s()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:f.jsx(Dl,{size:14})}),i&&f.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:i})]})}const e_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),t_=new Set([".ts",".tsx",".md"]),a_=new Set([".md",".doc",".docx",".pdf",".ppt",".pptx",".txt"]),n_=new Set([".md",".txt"]),l_=5*1024*1024,r_=10;function pd(n){const l=n.lastIndexOf(".");return l>=0?n.slice(l).toLowerCase():""}function Vx(n){const l=n.includes("/")?n.split("/").pop():n;if(e_.has(l.toLowerCase()))return!0;const s=pd(l);return t_.has(s)}const s_=n=>{const l=new Date(n);if(Number.isNaN(l.getTime()))return"";const s=o=>String(o).padStart(2,"0"),i=`${s(l.getMonth()+1)}-${s(l.getDate())} ${s(l.getHours())}:${s(l.getMinutes())}`;return l.getFullYear()===new Date().getFullYear()?i:`${l.getFullYear()}-${i}`},Dg={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function i_({source:n,isDaemonLibrary:l}){const{t:s}=Te(),i=n.kind==="source",o=i&&(n.source_type==="code"||Vx(n.name)),u=o?"text-c4a-accent":"text-c4a-text-muted";let m;if(n.kind==="folder"?m=l?f.jsx(MS,{size:16,className:`shrink-0 ${u}`}):f.jsx(ka,{size:16,className:`shrink-0 ${u}`}):n.source_type==="code"?m=f.jsx(Cr,{size:16,className:`shrink-0 ${u}`}):m=f.jsx(al,{size:16,className:`shrink-0 ${u}`}),!i||!o)return f.jsx(f.Fragment,{children:m});const p=Dg[n.index_status]??Dg.none,g=s(`sources.status.${n.index_status}`);return f.jsxs("span",{className:"group/dot relative shrink-0",children:[m,f.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${p}`}),f.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-[10px] text-c4a-text-secondary opacity-0 shadow-lg transition-opacity group-hover/dot:opacity-100",children:g})]})}function Mg({source:n,displayName:l,childCount:s,isDaemonLibrary:i,isRepoRoot:o,hasUpdate:u,onClick:m,onRename:p,onDelete:g}){const{t:h}=Te(),[v,y]=b.useState(!1),[_,j]=b.useState(null),R=b.useCallback(async Y=>{if(!p)return;const te=await p(Y);te?j(te):(y(!1),j(null))},[p]),z=b.useCallback(()=>{y(!1),j(null)},[]),A=!o&&p,X=g,Q=n.updated_at||n.created_at,V=n.kind==="source"&&n.source_type!=="code"&&!Vx(n.name),G=!V;return f.jsxs("div",{className:`group flex items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors ${G?"cursor-pointer hover:bg-c4a-bg-hover":"cursor-default"}`,onClick:v||!G?void 0:m,children:[f.jsx(i_,{source:n,isDaemonLibrary:i??!1}),v?f.jsx("div",{className:"min-w-0 flex-1",onClick:Y=>Y.stopPropagation(),children:f.jsx(Gx,{currentName:n.name,onConfirm:R,onCancel:z,error:_})}):f.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${V?"text-c4a-text-muted":"text-c4a-text-primary"}`,children:l??n.name}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-tight text-c4a-accent/60",children:[f.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-c4a-accent"}),h("sources.change_detection.has_updates")]}),n.kind==="folder"&&s!==void 0&&f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:s})}),Q&&f.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:s_(Q)})]}),(A||X)&&f.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[A&&f.jsx("button",{title:h("sources.actions.rename"),onClick:Y=>{Y.stopPropagation(),y(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(dd,{size:14})}),X&&f.jsx("button",{title:h("sources.actions.delete"),onClick:Y=>{Y.stopPropagation(),g()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(Lx,{size:14})})]})]})}function Al({children:n,onClose:l,className:s="",overlayClass:i="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:u=!0,disableClose:m=!1}){const p=b.useRef(null);b.useEffect(()=>{if(!u)return;const h=v=>{v.key==="Escape"&&!m&&l()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[l,u,m]);const g=b.useCallback(h=>{o&&!m&&p.current&&!p.current.contains(h.target)&&l()},[l,o,m]);return f.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${i}`,onClick:g,children:f.jsx("div",{ref:p,className:s,children:n})})}function Ag({target:n,onConfirm:l,onCancel:s}){const{t:i}=Te();return f.jsxs(Al,{onClose:s,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.delete.confirm_title")}),f.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[n.type==="resource"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.resource",{name:n.name})}),f.jsx("p",{children:i("sources.delete.resource_impact")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.session_warning")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="folder"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder",{name:n.name})}),n.folderCount!==void 0&&n.sourceCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder_contents",{folders:n.folderCount,sources:n.sourceCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.sourceCount})})]}):f.jsx("p",{children:i("sources.delete.folder_impact_generic")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")})]}),n.type==="repo"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo",{name:n.name,library:n.libraryName})}),n.packageCount!==void 0&&n.docCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo_contents",{packages:n.packageCount,docs:n.docCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.packageCount+n.docCount})})]}):f.jsx("p",{children:i("sources.delete.repo_impact_generic")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="client"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.client",{name:n.name})}),f.jsx("p",{children:i("sources.delete.client_impact")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")}),f.jsx("p",{className:"text-c4a-text-muted",children:i("sources.delete.client_reregister")})]})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:s,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:l,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:i("common.confirm")})]})]})}function o_({onConfirm:n,onCancel:l,error:s}){const{t:i}=Te(),[o,u]=b.useState(""),m=b.useRef(null);b.useEffect(()=>{m.current?.focus()},[]);const p=b.useCallback(()=>{const h=o.trim();h&&n(h)},[o,n]),g=b.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),p())},[p]);return f.jsxs(Al,{onClose:l,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Mx,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.actions.new_folder")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,placeholder:i("sources.folder.name_placeholder"),className:"w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 text-sm text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent",autoFocus:!0}),s&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:s})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:p,disabled:!o.trim(),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:i("common.confirm")})]})]})}function Ju({label:n,icon:l,items:s,alignRight:i}){const[o,u]=b.useState(!1),m=b.useRef(null),p=b.useRef(null),g=b.useCallback(y=>{m.current&&!m.current.contains(y.target)&&u(!1)},[]);b.useEffect(()=>{if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,g]);const h=b.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),v=b.useCallback(()=>{p.current=setTimeout(()=>u(!1),150)},[]);return f.jsxs("div",{ref:m,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:`flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${n?"p-1 sm:px-2 sm:py-1":"p-1"}`,children:[l,n&&f.jsx("span",{className:"hidden sm:inline",children:n}),n&&f.jsx(ta,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&f.jsx("div",{className:`absolute top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${i?"right-0":"left-0"}`,children:s.map(y=>f.jsxs("button",{onClick:()=>{y.onClick(),u(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[y.icon,y.label]},y.label))})]})}function c_({onClose:n}){const{t:l}=Te();return f.jsxs(Al,{onClose:n,closeOnEsc:!1,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(m2,{size:18,className:"text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("sources.upgrade.title")})]}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("sources.upgrade.description")}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:n,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("common.confirm")})})]})}function u_(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function d_({onConfirm:n,onCancel:l,error:s,uploading:i}){const{t:o}=Te(),[u,m]=b.useState([]),[p,g]=b.useState(null),[h,v]=b.useState(!1),y=b.useRef(null),_=b.useCallback(G=>{g(null);for(const Y of G){const te=pd(Y.name);if(!a_.has(te)){g(o("sources.upload.unsupported_type",{name:Y.name}));return}if(Y.size>l_){g(o("sources.upload.file_too_large",{name:Y.name}));return}}m(Y=>{const te=new Map(Y.map(w=>[w.name,w]));for(const w of G)te.set(w.name,{name:w.name,size:w.size,file:w});const ee=Array.from(te.values());return ee.length>r_?(g(o("sources.upload.too_many_files")),Y):ee})},[o]),j=b.useCallback(G=>{const Y=G.target.files;!Y||Y.length===0||(_(Array.from(Y)),G.target.value="")},[_]),R=b.useCallback(G=>{m(Y=>Y.filter((te,ee)=>ee!==G)),g(null)},[]),z=b.useCallback(G=>{G.preventDefault(),v(!1);const Y=G.dataTransfer?.files;!Y||Y.length===0||_(Array.from(Y))},[_]),A=b.useCallback(G=>{G.preventDefault(),v(!0)},[]),X=b.useCallback(G=>{G.preventDefault(),v(!1)},[]),Q=b.useCallback(async()=>{if(u.length===0)return;const G=await Promise.all(u.map(Y=>new Promise((te,ee)=>{const w=pd(Y.name),q=n_.has(w),Z=new FileReader;Z.onerror=()=>ee(Z.error),q?(Z.onload=()=>te({name:Y.name,content:Z.result,encoding:"utf-8"}),Z.readAsText(Y.file)):(Z.onload=()=>{const de=Z.result,se=de.slice(de.indexOf(",")+1);te({name:Y.name,content:se,encoding:"base64"})},Z.readAsDataURL(Y.file))})));n(G)},[u,n]),V=s||p;return f.jsxs(Al,{onClose:l,disableClose:i??!1,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(md,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:y,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:j,className:"hidden"}),f.jsxs("button",{type:"button",onClick:()=>y.current?.click(),onDrop:z,onDragOver:A,onDragLeave:X,disabled:i,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${h?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${i?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[f.jsx(md,{size:24,className:"text-c4a-text-muted"}),f.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),f.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),u.length>0&&f.jsxs("div",{className:"mt-3",children:[f.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:u.length})}),f.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:u.map((G,Y)=>f.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[f.jsx(al,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:G.name}),f.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:u_(G.size)}),!i&&f.jsx("button",{type:"button",onClick:()=>R(Y),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:f.jsx(Dl,{size:12})})]},`${G.name}-${Y}`))})]}),V&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:V}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,disabled:i,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:o("common.cancel")}),f.jsxs("button",{onClick:Q,disabled:u.length===0||i,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[i&&f.jsx(Sa,{size:12,className:"animate-spin"}),o(i?"sources.upload.uploading":"common.confirm")]})]})]})}function f_({pathLabel:n,loading:l,onNavigateUp:s,children:i}){return f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),f.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:l?f.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:f.jsx(Sa,{size:14,className:"animate-spin text-c4a-text-muted"})}):f.jsxs(f.Fragment,{children:[s&&f.jsxs("button",{onClick:s,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(ka,{size:16,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{children:".."})]}),i]})})]})}function m_(n,l,s){const[i,o]=b.useState({}),u=b.useRef(new Set);return b.useEffect(()=>{if(!n||!l||s.length===0)return;const m=s.filter(p=>{const g=p.metadata;return g?.origin==="remote"&&g?.remote_url&&g?.remote_commit&&!u.current.has(p.id)});if(m.length!==0){m.forEach(p=>u.current.add(p.id));for(const p of m){const g=p.metadata;vt.post("/import/remote/refs",{library_id:n,url:g.remote_url}).then(h=>{const v=g.remote_ref||"",y=h.branches?.find(_=>_.name===v)??h.tags?.find(_=>_.name===v);y&&y.commit!==g.remote_commit&&o(_=>({..._,[p.id]:!0}))}).catch(()=>{})}}},[n,l,s]),i}function h_({library:n,onNewFolder:l,onImportRepo:s,onImportDir:i,onUpgrade:o}){const{t:u}=Te(),m=n.type==="daemon";return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-2xl text-center",children:[f.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:u(m?"sources.empty.daemon.title":"sources.empty.cloud.title")}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:u(m?"sources.empty.daemon.description":"sources.empty.cloud.description")}),f.jsx("div",{className:"mt-6 flex justify-center gap-3",children:m?f.jsxs(f.Fragment,{children:[i&&f.jsx("button",{onClick:i,disabled:!n.is_online,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:u("sources.actions.import_dir")}),s&&f.jsx("button",{onClick:s,disabled:!n.is_online,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:u("sources.actions.import_repo")})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:u("sources.actions.new_folder")}),o&&f.jsx("button",{onClick:o,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:u("sources.actions.import_repo_url")})]})})]})})}function p_(){const{t:n}=Te();return f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[f.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.empty.indexed.title")}),f.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:n("sources.empty.indexed.description")})]})}const Pu=n=>{let l=0,s=0,i=0,o=0,u=0;const m=p=>{for(const g of p.children??[])g.kind==="folder"?(l++,m(g)):g.kind==="source"&&(s++,g.source_type==="code"?i++:o++,(g.index_status==="indexed"||g.index_status==="stale")&&u++)};return m(n),{folders:l,sources:s,codeSources:i,docSources:o,indexedSources:u}};function g_(){const{t:n}=Te(),l=Rn(),{libId:s}=Bs(),[i,o]=Ed(),u=i.get("rootId")||null,m=i.get("path")||"",g=Zt(Ml(Tr)).find(ue=>ue.id===s),h=Zt(ue=>ue.updateLibraryName),v=Zt(ue=>ue.deleteLibrary),{rootSources:y,currentRoot:_,loading:j,filter:R,fetchRootSources:z,fetchRootSource:A,createSource:X,addTreeNode:Q,updateSource:V,deleteSource:G,deleteTreeNode:Y,uploadDoc:te,setFilter:ee}=wo(),[w,q]=b.useState(!1),[Z,de]=b.useState(null),[se,ye]=b.useState(null),[ae,ie]=b.useState(null),[M,W]=b.useState(null),[ce,P]=b.useState(!1),[be,N]=b.useState(!1),[H,F]=b.useState(null),[ne,he]=b.useState(!1),[_e,ze]=b.useState(!1),[Ze,Ue]=b.useState(null),[na,Ft]=b.useState(!1);b.useEffect(()=>{s&&z({library_id:s})},[s,z]),b.useEffect(()=>{u&&A(u)},[u,A]);const nt=u!==null,Ge=b.useMemo(()=>nt?_?[...P2(_.tree,m)].sort((tt,St)=>tt.kind!==St.kind?tt.kind==="folder"?-1:1:tt.name.localeCompare(St.name)).map(tt=>({type:"node",root:_,node:tt})):[]:[...y].sort((St,Je)=>St.kind!==Je.kind?St.kind==="folder"?-1:1:new Date(Je.created_at).getTime()-new Date(St.created_at).getTime()).map(St=>({type:"root",root:St,node:null})),[nt,y,_,m]),xt=b.useMemo(()=>R==="all"?Ge:Ge.filter(ue=>ue.type==="root"||!ue.node||ue.node.kind==="folder"?!0:R==="indexed"?ue.node.index_status==="indexed":ue.node.index_status==="none"||!ue.node.index_status),[Ge,R]),Tt=g?.type==="daemon",la=g?.type==="cloud",Jt=Tt&&!nt,Za=m_(s,la,y),ja=b.useMemo(()=>{if(!g)return[];const ue=[{label:g.id===nl?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];return nt&&_&&(ue.push({label:_.name,to:`/studio/sources/${g.id}?rootId=${_.id}`}),m&&Yx(_.tree,m).forEach(tt=>{ue.push({label:tt.name,to:`/studio/sources/${g.id}?rootId=${_.id}&path=${encodeURIComponent(tt.path)}`})})),ue},[g,nt,_,m,n]),Na=b.useCallback(async ue=>{if(s)try{nt&&u?await Q(u,{parent_path:m,kind:"folder",name:ue}):(await X({library_id:s,kind:"folder",name:ue}),z({library_id:s})),q(!1),de(null)}catch(we){we instanceof El&&we.status===409&&de(n("sources.error.name_conflict",{name:ue}))}},[s,nt,u,m,X,Q,z,n]),Ce=b.useCallback(ue=>{s&&(ue.type==="root"?ue.root.kind==="source"?l(`/studio/source/${ue.root.id}`):o({rootId:ue.root.id}):ue.node&&(ue.node.kind==="folder"?o({rootId:ue.root.id,path:ue.node.path}):l(`/studio/source/${ue.root.id}?path=${encodeURIComponent(ue.node.path)}`)))},[s,l,o]),Pe=b.useCallback(()=>{if(!(!u||!s))if(m){const ue=m.split("/");ue.pop();const we=ue.join("/");o(we?{rootId:u,path:we}:{rootId:u})}else o({})},[u,s,m,o]),pe=b.useCallback(async(ue,we)=>{try{return await V(ue,{name:we}),z({library_id:s}),null}catch(tt){return tt instanceof El&&tt.status===409?n("sources.error.name_conflict",{name:we}):null}},[s,V,z,n]),Oe=b.useCallback(ue=>{if(ue.type==="root"){ie(ue.root.id),W(null);const we=ue.root.tree.length>0?Pu({children:ue.root.tree}):void 0;ye(Tt?{type:"repo",name:ue.root.name,libraryName:g.name,...we?{packageCount:we.codeSources,docCount:we.docSources,indexedCount:we.indexedSources}:{}}:{type:ue.root.kind==="folder"?"folder":"resource",name:ue.root.name,...ue.root.kind==="folder"&&we?{folderCount:we.folders,sourceCount:we.sources,indexedCount:we.indexedSources}:{}})}else if(ue.node)if(ie(ue.root.id),W(ue.node.path),ue.node.kind==="folder"){const we=Pu(ue.node);ye({type:"folder",name:ue.node.name,folderCount:we.folders,sourceCount:we.sources,indexedCount:we.indexedSources})}else ye({type:"resource",name:ue.node.name})},[Tt,g]),Ve=b.useCallback(async()=>{if(!(!ae||!s)){try{M?await Y(ae,M):(await G(ae),z({library_id:s}))}catch{}ye(null),ie(null),W(null)}},[ae,M,s,G,Y,z]),ct=b.useCallback(()=>{s&&l(`/studio/sources/import/${s}`)},[s,l]),Yt=b.useCallback(()=>{s&&l(`/studio/sources/import-dir/${s}`)},[s,l]),Ht=b.useCallback(async ue=>{if(s){he(!0),F(null);try{const we={library_id:s,files:ue.map(tt=>{const St={file_name:tt.name,content:tt.content};return tt.encoding&&(St.encoding=tt.encoding),St})};nt&&u&&(we.root_source_id=u,we.parent_path=m),await te(we),nt&&u?A(u):z({library_id:s}),N(!1)}catch(we){we instanceof El&&we.status===409?F(n("sources.error.name_conflict",{name:ue[0]?.name??""})):we instanceof El&&F(we.message)}finally{he(!1)}}},[s,nt,u,m,te,z,A,n]),bt=g?.id===nl,ra=b.useCallback(async ue=>{if(s)try{await h(s,ue),ze(!1),Ue(null)}catch(we){const tt=we instanceof Error?we.message:String(we);Ue(tt)}},[s,h]),kl=b.useCallback(()=>{ze(!1),Ue(null)},[]),Or=b.useCallback(async()=>{if(s){try{await v(s),l("/studio/sources/add-client")}catch{}Ft(!1)}},[s,v,l]),Ba=b.useCallback(()=>{Ft(!1)},[]);if(!g)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Gt=y.length===0&&R==="all"&&!j&&!nt,zt=xt.filter(ue=>ue.type==="node"&&ue.node?.kind==="source").length===0&&R==="indexed"&&!j,Bt=!Jt,Ll=la,Ul=Jt;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("div",{className:"min-w-0 flex-1",children:_e?f.jsx(Gx,{currentName:g.name,onConfirm:ra,onCancel:kl,error:Ze}):f.jsx(zr,{segments:ja})}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Ll&&f.jsxs(f.Fragment,{children:[f.jsx(Ju,{label:n("sources.actions.upload"),icon:f.jsx(md,{size:14}),items:[{label:n("sources.actions.upload_doc"),icon:f.jsx(al,{size:14}),onClick:()=>N(!0)}]}),f.jsx(Ju,{label:n("sources.actions.add"),icon:f.jsx(Ax,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:f.jsx(Mx,{size:14}),onClick:()=>q(!0)},{label:n("sources.actions.add_web"),icon:f.jsx($S,{size:14}),onClick:()=>P(!0)},{label:n("sources.actions.add_feishu"),icon:f.jsx(NS,{size:14}),onClick:()=>P(!0)}]}),f.jsxs("button",{onClick:()=>l(`/studio/sources/import-remote/${s}`),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(jg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo_url")})]})]}),Ul&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:Yt,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(OS,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_dir")})]}),f.jsxs("button",{onClick:ct,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(jg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo")})]}),f.jsx(Ju,{label:"",icon:f.jsx(dd,{size:14}),alignRight:!0,items:[{label:n("sources.library.rename"),icon:f.jsx(dd,{size:14}),onClick:()=>ze(!0)},...bt?[]:[{label:n("sources.actions.delete"),icon:f.jsx(Lx,{size:14}),onClick:()=>Ft(!0)}]]})]}),Bt&&f.jsx(I2,{value:R,onChange:ee})]})]}),Gt?f.jsx(h_,{library:g,onNewFolder:()=>q(!0),...Tt?{onImportRepo:ct,onImportDir:Yt}:{},...la?{onUpgrade:()=>l(`/studio/sources/import-remote/${s}`)}:{}}):f.jsx(f_,{pathLabel:ja.map(ue=>ue.label).join(" / "),loading:j,onNavigateUp:nt?Pe:void 0,children:xt.length===0?zt?f.jsx(p_,{}):nt?null:f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:n("common.items",{count:0})}):f.jsx("div",{className:"flex flex-col gap-0.5",children:xt.map(ue=>{if(ue.type==="root"){const Je=ue.root,sn=Tt,qa=sn?Je.metadata?.local_path:void 0,ll=Je.tree.length>0?Pu({children:Je.tree}):void 0,rl=ll?ll.folders+ll.sources:0;return f.jsx(Mg,{source:{id:Je.id,library_id:Je.library_id,owner_id:Je.owner_id,path:"",kind:Je.kind,source_type:Je.source_type,name:Je.name,content_hash:Je.content_hash,metadata:Je.metadata,index_status:Je.index_status,created_at:Je.created_at,updated_at:Je.updated_at},...typeof qa=="string"?{displayName:qa}:{},...Je.kind==="folder"?{childCount:rl}:{},isDaemonLibrary:Tt??!1,isRepoRoot:sn,...Za[Je.id]?{hasUpdate:!0}:{},onClick:()=>Ce(ue),onRename:Fa=>pe(Je.id,Fa),onDelete:()=>Oe(ue)},Je.id)}const we=ue.node,tt=`${ue.root.id}:${we.path}`,St=we.kind==="folder"?we.children?.length??0:void 0;return f.jsx(Mg,{source:{id:ue.root.id,library_id:ue.root.library_id,owner_id:ue.root.owner_id,path:we.path,kind:we.kind,source_type:we.source_type??null,name:we.name,content_hash:null,metadata:we.metadata??null,index_status:we.index_status??"none",created_at:ue.root.created_at,updated_at:ue.root.updated_at},...St!==void 0?{childCount:St}:{},isDaemonLibrary:Tt??!1,onClick:()=>Ce(ue),...la?{onDelete:()=>Oe(ue)}:{}},tt)})})}),w&&f.jsx(o_,{onConfirm:Na,onCancel:()=>{q(!1),de(null)},error:Z}),be&&f.jsx(d_,{onConfirm:Ht,onCancel:()=>{N(!1),F(null)},error:H,uploading:ne}),ce&&f.jsx(c_,{onClose:()=>P(!1)}),se&&f.jsx(Ag,{target:se,onConfirm:Ve,onCancel:()=>{ye(null),ie(null),W(null)}}),na&&g&&f.jsx(Ag,{target:{type:"client",name:g.name},onConfirm:Or,onCancel:Ba})]})}function ln({active:n,current:l}){return f.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${l?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Cl(){return f.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function Kx({libraryName:n}){const{t:l}=Te();return f.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[f.jsx("p",{className:"text-sm text-c4a-warning",children:l("sources.import.daemon_offline",{name:n})}),f.jsx(va,{to:"/studio/sources/add-client",className:"mt-4 inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("sources.import.view_guide")})]})}function Rd({step:n,totalSteps:l,importing:s,stepBusy:i,canProceed:o,safetyNoticeKey:u,confirmLabelKey:m,onPrev:p,onNext:g,onImport:h}){const{t:v}=Te();return f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[f.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:v(u),onClick:y=>y.currentTarget.classList.toggle("line-clamp-1"),children:v(u)}),f.jsxs("div",{className:"flex shrink-0 gap-2",children:[n>1&&f.jsx("button",{onClick:p,disabled:s||i,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover disabled:opacity-40",children:v("common.previous")}),n<l?f.jsx("button",{onClick:g,disabled:!o||i,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:v("common.next")}):f.jsxs("button",{onClick:h,disabled:s||i||!o,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[s&&f.jsx(Sa,{size:12,className:"animate-spin"}),v(s?"sources.import.importing":m)]})]})]})}function Xx(n,l){const s=b.useCallback(async(m,p)=>{if(!n)throw new Error("No library");const g=await vt.post(`/libraries/${n}/rpc`,{method:m,params:p});if(g.error){const h=g.error;throw new Error(h.message??JSON.stringify(g.error))}return g.result??g},[n]),[i,o]=b.useState([]);b.useEffect(()=>{if(!n)return;let m=!1;return(async()=>{try{const p=await vt.get("/sources",{library_id:n,limit:"500"});if(m)return;const g=p.items.map(h=>{const v=h.metadata;return typeof v?.local_path=="string"?v.local_path:null}).filter(h=>h!==null);o(g)}catch{}})(),()=>{m=!0}},[n]);const u=b.useMemo(()=>{const m=l?.config;return!m||!Array.isArray(m.allowed_paths)?[]:m.allowed_paths},[l]);return{rpc:s,importedPaths:i,allowedPaths:u}}function x_(n,l){const s=n.toLowerCase();try{if(s.endsWith("package.json")){const i=JSON.parse(l);if(typeof i.name=="string"&&i.name.trim())return i.name.trim()}if(s.endsWith("pyproject.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("go.mod"))return l.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(s.endsWith("cargo.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("pom.xml"))return l.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(s.endsWith("build.gradle"))return l.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function Qx(n,l,s="repo"){const i=[];for(const u of n){const m=u.path.split("/"),p=m.slice(0,-1).join("/")||".",g=m.length===1||u.path==="package.json",h=p==="."?s:m[m.length-2]||p,v=x_(u.path,u.content);i.push({name:v||h,path:p,isRoot:g})}const o=l.filter(u=>/\.md$/i.test(u.path)).map(u=>u.path);return{packages:i,mdFiles:o}}function xo(n){try{return(new URL(n).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return n.split("/").pop()||n}}function Zx(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}:${String(n.getSeconds()).padStart(2,"0")}`}function Fx(){const{t:n}=Te(),[l,s]=b.useState(!1),[i,o]=b.useState(null),u=b.useRef(),m=b.useRef(),p=window.location.host,g=`c4a-daemon --server ${p} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${p}`,v=b.useCallback((j,R)=>{navigator.clipboard.writeText(j),o(R),clearTimeout(u.current),u.current=setTimeout(()=>o(null),1500)},[]),y=b.useCallback(()=>{clearTimeout(m.current),s(!0)},[]),_=b.useCallback(()=>{m.current=setTimeout(()=>s(!1),150)},[]);return f.jsxs("span",{className:"relative",onMouseEnter:y,onMouseLeave:_,children:[f.jsx(Ox,{size:12,className:"text-c4a-warning"}),l&&f.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:y,onMouseLeave:_,children:[f.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:g}),f.jsx("button",{onClick:()=>v(g,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===0?f.jsx(Tl,{size:10}):f.jsx(cd,{size:10})})]}),f.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_all")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),f.jsx("button",{onClick:()=>v(h,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===1?f.jsx(Tl,{size:10}):f.jsx(cd,{size:10})})]})]})]})}function Jx({open:n,onClose:l,rpc:s,onNavigate:i,defaultPath:o}){const{t:u}=Te(),[m,p]=b.useState(o??""),[g,h]=b.useState(null),[v,y]=b.useState(!1),_=b.useRef(null);b.useEffect(()=>{o&&!m&&p(o)},[o]);const j=b.useCallback(async()=>{const z=m.trim();if(z){y(!0),h(null);try{(await s("fs/exists",{path:z})).exists?(i(z),p(o??""),h(null),l()):h(u("sources.import.wildcard_path_not_found"))}catch(A){h(A instanceof Error?A.message:String(A))}finally{y(!1)}}},[m,s,u,i,l]),R=b.useCallback(()=>{p(o??""),h(null),l()},[l,o]);return n?f.jsxs(Al,{onClose:R,closeOnOverlay:!1,closeOnEsc:!1,overlayClass:"bg-black/40",className:"w-full max-w-md rounded-lg border border-c4a-border-default bg-c4a-bg-surface p-5 shadow-xl",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:u("sources.import.wildcard_go_title")}),f.jsx("button",{onClick:R,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:f.jsx(Dl,{size:14})})]}),f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("input",{ref:_,type:"text",value:m,onChange:z=>{p(z.target.value),h(null)},onKeyDown:z=>{z.key==="Enter"&&j()},placeholder:u("sources.import.wildcard_path_placeholder"),autoFocus:!0,className:"flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent"}),f.jsxs("button",{onClick:j,disabled:v||!m.trim(),className:"flex shrink-0 items-center gap-1.5 rounded bg-c4a-accent px-3 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[v?f.jsx(Sa,{size:12,className:"animate-spin"}):f.jsx(zx,{size:12}),u("sources.import.wildcard_go")]})]}),g&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:g})]}):null}function y_(n){const l=n.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(l){const s=l[1],i=l[2];return{slug:i,repoUrl:`https://${s}/${i}`,host:s}}try{const s=new URL(n),i=s.hostname,o=s.pathname.replace(/^\//,"").replace(/\.git$/,"");return o?{slug:o,repoUrl:`https://${i}/${o}`,host:i}:null}catch{return null}}function b_(n,l){return`${n}/tree/${encodeURIComponent(l)}`}function v_(n,l){return`${n}/commit/${l}`}function Px({rpc:n,allowedPaths:l,importedPaths:s,onNavigateUpExtra:i}){const o=!!l&&l.length>0,u=o&&l.length===1&&l[0]==="*",[m,p]=b.useState(o),[g,h]=b.useState(o&&!u?"":"/"),[v,y]=b.useState([]),[_,j]=b.useState(!1),[R,z]=b.useState(null),[A,X]=b.useState(null);b.useEffect(()=>{if(o&&!u)return;let q=!1;return(async()=>{try{const Z=await n("fs/homeDir",{});q||X(Z.home_dir)}catch{q||X("/")}})(),()=>{q=!0}},[o,u,n]);const[Q,V]=b.useState(!1),G=b.useCallback(async q=>{j(!0),z(null);try{const Z=await n("fs/listTree",{path:q,depth:1});y(Z.entries||[]),h(q),p(!1)}catch(Z){const de=Z instanceof Error?Z.message:String(Z);z(de)}finally{j(!1)}},[n]);b.useEffect(()=>{o&&!u||A!==null&&G(A)},[A,o,u,G]);const Y=b.useMemo(()=>new Set(s??[]),[s]),te=b.useCallback(()=>{if(o&&!u&&l.some(de=>de===g)){p(!0),h(""),y([]),z(null),i?.();return}const q=g.split("/").slice(0,-1).join("/")||"/";i?.(),G(q)},[o,u,l,g,G,i]),ee=b.useMemo(()=>v.filter(q=>q.type==="directory"),[v]),w=b.useMemo(()=>v.filter(q=>q.type==="file"),[v]);return{atRoot:m,currentPath:g,entries:v,loading:_,error:R,homeDir:A,goToOpen:Q,hasAllowedPaths:o,isWildcard:u,importedSet:Y,dirs:ee,files:w,loadTree:G,handleNavigateUp:te,setGoToOpen:V}}function S_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Te(),[m,p]=b.useState(null),{atRoot:g,currentPath:h,entries:v,loading:y,error:_,homeDir:j,goToOpen:R,isWildcard:z,importedSet:A,dirs:X,files:Q,loadTree:V,handleNavigateUp:G,setGoToOpen:Y}=Px({rpc:n,allowedPaths:i??[],importedPaths:o??[],onNavigateUpExtra:()=>p(null)}),[te,ee]=b.useState(null),[w,q]=b.useState(!1);b.useEffect(()=>{if(!l){ee(null),q(!1);return}ee(null),q(!0);let ae=!1;return(async()=>{try{const ie=await n("fs/repoStatus",{path:l});ae||(ee({branch:ie.branch,hash:ie.head_hash,remoteUrl:ie.remote_url}),q(!1))}catch{ae||(ee(null),q(!1))}})(),()=>{ae=!0}},[l,n]);const Z=b.useMemo(()=>te?.remoteUrl?y_(te.remoteUrl):null,[te?.remoteUrl]),de=b.useCallback(ae=>{if(ae.type==="directory")if(ae.is_git_repo){if(A.has(ae.path))return;p(null),s(ae.path,ae.name)}else p(ae.path),V(ae.path)},[s,V,A]),se=b.useMemo(()=>X.sort((ae,ie)=>ae.is_git_repo&&!ie.is_git_repo?-1:!ae.is_git_repo&&ie.is_git_repo?1:ae.name.localeCompare(ie.name)),[X]),ye=b.useMemo(()=>Q.sort((ae,ie)=>ae.name.localeCompare(ie.name)),[Q]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[g?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Fx,{})]}):f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),l&&w?f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[f.jsx(Sa,{size:12,className:"animate-spin"}),f.jsx("span",{children:u("common.loading")})]}):l&&te?f.jsxs("div",{className:"flex min-w-0 shrink items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent flex-wrap",children:[Z?f.jsxs("a",{href:Z.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:Z.repoUrl,children:[f.jsx(Ng,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:Z.slug})]}):f.jsxs("span",{className:"flex items-center gap-1 truncate",children:[f.jsx(Ng,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:l.split("/").pop()||l})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),Z?f.jsxs("a",{href:b_(Z.repoUrl,te.branch),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[f.jsx(ud,{size:10,className:"shrink-0"}),f.jsx("span",{children:te.branch})]}):f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(ud,{size:10,className:"shrink-0"}),f.jsx("span",{children:te.branch})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),Z?f.jsx("a",{href:v_(Z.repoUrl,te.hash),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:te.hash.slice(0,7)}):f.jsx("span",{children:te.hash.slice(0,7)})]}):!l&&z&&g?f.jsx("button",{onClick:()=>Y(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),g?z?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:j&&f.jsxs("button",{onClick:()=>V(j),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(ka,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[j,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(ta,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(ae=>f.jsxs("button",{onClick:()=>V(ae),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(ka,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:ae}),f.jsx(ta,{size:12,className:"shrink-0 text-c4a-text-muted"})]},ae))}):_&&!y?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:_}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[y&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Sa,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&f.jsxs("button",{onClick:G,disabled:y,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(ka,{size:14}),f.jsx("span",{children:".."})]}),se.map(ae=>{const ie=ae.is_git_repo&&A.has(ae.path),M=ae.is_git_repo?Cd:ka;return f.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${ie?"cursor-not-allowed text-c4a-accent/60":l===ae.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[f.jsxs("button",{onClick:()=>de(ae),disabled:ie||y,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[f.jsx(M,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate text-left",children:ae.name}),ie&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")})]}),!ie&&f.jsx("button",{onClick:W=>{W.stopPropagation(),V(ae.path)},disabled:y,className:"shrink-0 rounded p-1.5 text-c4a-text-muted transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent disabled:pointer-events-none",title:ae.path,children:f.jsx(ta,{size:12})})]},ae.path)}),ye.map(ae=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Dx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:ae.name})]},ae.path)),v.length===0&&!y&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),m&&!l&&f.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:u("sources.import.not_git")}),f.jsx(Jx,{open:R,onClose:()=>Y(!1),rpc:n,onNavigate:V,defaultPath:j??void 0})]})}const _r=50,Wu=["main","master"];function __(n){const l=[],s=[];for(const i of n)Wu.includes(i.name)?l.push(i):s.push(i);return l.sort((i,o)=>Wu.indexOf(i.name)-Wu.indexOf(o.name)),[...l,...s]}function kg(n,l,s){b.useEffect(()=>{if(!s)return;const i=o=>{n.current&&!n.current.contains(o.target)&&l()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,l,s])}function Wx({refs:n,loading:l,error:s,selectedRef:i,commit:o,onRefChange:u,onCommitChange:m,onValidChange:p,onRetry:g,onBranchSwitch:h}){const{t:v}=Te(),[y,_]=b.useState(!1),[j,R]=b.useState(""),[z,A]=b.useState(!0),[X,Q]=b.useState(!0),V=b.useRef(null),G=b.useRef(null),[Y,te]=b.useState(!1),[ee,w]=b.useState(""),q=b.useRef(null),Z=b.useRef(null);kg(V,()=>{_(!1),R("")},y),kg(q,()=>{te(!1),w("")},Y),b.useEffect(()=>{y&&setTimeout(()=>G.current?.focus(),0)},[y]),b.useEffect(()=>{Y&&setTimeout(()=>Z.current?.focus(),0)},[Y]),b.useEffect(()=>{p(!!i)},[i,p]);const de=b.useCallback(P=>{u(P.name),m(P.commit),_(!1),R(""),h?.(P.name)},[u,m,h]),se=b.useCallback((P,be)=>{m(P),u(be),te(!1),w("")},[m,u]),ye=b.useMemo(()=>n?__(n.branches):[],[n]),ae=b.useMemo(()=>{const P=j.toLowerCase();return(P?ye.filter(N=>N.name.toLowerCase().includes(P)):ye).slice(0,_r)},[ye,j]),ie=b.useMemo(()=>{if(!n)return[];const P=j.toLowerCase();return(P?n.tags.filter(N=>N.name.toLowerCase().includes(P)):n.tags).slice(0,_r)},[n,j]),M=b.useMemo(()=>{if(!n)return[];if(n.commits&&n.commits.length>0){const F=ee.toLowerCase(),ne=n.commits.map(he=>({hash:he.hash,refName:i||"",label:`${he.hash.slice(0,8)} ${he.message?`— ${he.message.slice(0,50)}`:""}`.trim()}));return F?ne.filter(he=>he.hash.toLowerCase().includes(F)||he.label.toLowerCase().includes(F)).slice(0,_r):ne.slice(0,_r)}const P=new Set,be=[],N=[...n.branches??[],...n.tags??[]];for(const F of N){const ne=F.commit.slice(0,8);P.has(F.commit)||(P.add(F.commit),be.push({hash:F.commit,refName:F.name,label:`${ne} (${F.name})`}))}if(!ee)return be.slice(0,_r);const H=ee.toLowerCase();return be.filter(F=>F.hash.toLowerCase().includes(H)||F.label.toLowerCase().includes(H)).slice(0,_r)},[n,ee,i]);if(l)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsx(Sa,{size:20,className:"animate-spin text-c4a-accent"}),f.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:v("sources.import_remote.loading_refs")})]});if(s)return f.jsx("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"rounded-sm border border-red-500/20 bg-red-500/10 p-4",children:[f.jsxs("p",{className:"font-mono text-sm font-medium text-red-400",children:[f.jsx(Dl,{size:14,className:"mr-1 inline-block"}),v("sources.import.error_title")]}),f.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:s}),g&&f.jsxs("button",{onClick:g,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(kx,{size:12}),v("sources.import_remote.retry")]})]})});if(!n)return null;const W=n.branches.find(P=>P.name===i)?.name??n.tags.find(P=>P.name===i)?.name??i,ce=o?o.slice(0,8):"";return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-sm uppercase tracking-tight text-c4a-text-secondary",children:v("sources.import_remote.ref_label")}),f.jsxs("div",{ref:V,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>_(!y),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{children:W||"—"}),f.jsx(ta,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${y?"rotate-90":""}`})]}),y&&f.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[f.jsx(fd,{size:14,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:G,type:"text",value:j,onChange:P=>R(P.target.value),placeholder:v("sources.import_remote.ref_search"),className:"w-full bg-transparent font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),f.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[ae.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[f.jsxs("button",{onClick:()=>A(!z),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(ta,{size:12,className:`transition-transform duration-200 ${z?"rotate-90":""}`}),v("sources.import_remote.ref_branches")," (",n.branches.length,")"]}),z&&ae.map(P=>f.jsxs("button",{onClick:()=>de(P),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${P.name===i?"font-semibold text-c4a-accent":"text-c4a-text-primary"}`,children:[f.jsx("span",{className:"truncate",children:P.name}),P.name===i&&f.jsx("span",{children:"✓"})]},`b-${P.name}`))]}),ie.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[f.jsxs("button",{onClick:()=>Q(!X),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(ta,{size:12,className:`transition-transform duration-200 ${X?"rotate-90":""}`}),v("sources.import_remote.ref_tags")," (",n.tags.length,")"]}),X&&ie.map(P=>f.jsxs("button",{onClick:()=>de(P),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${P.name===i?"font-semibold text-c4a-accent":"text-c4a-text-primary"}`,children:[f.jsx("span",{className:"truncate",children:P.name}),P.name===i&&f.jsx("span",{children:"✓"})]},`t-${P.name}`))]})]}),ae.length===0&&ie.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-sm uppercase tracking-tight text-c4a-text-secondary",children:v("sources.import_remote.commit_label")}),f.jsxs("div",{ref:q,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>te(!Y),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:ce||"—"}),f.jsx(ta,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${Y?"rotate-90":""}`})]}),Y&&f.jsxs("div",{className:"c4a-scrollbar absolute z-20 mt-1 max-h-64 w-full overflow-y-auto rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[f.jsx(fd,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:Z,type:"text",value:ee,onChange:P=>w(P.target.value),placeholder:v("sources.import_remote.commit_search"),className:"w-full bg-transparent font-mono text-xs text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),M.map(P=>f.jsxs("button",{onClick:()=>se(P.hash,P.refName),className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:"truncate",children:P.label}),P.hash===o&&f.jsx("span",{className:"text-c4a-accent",children:"✓"})]},P.hash)),M.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),f.jsxs("p",{className:"mt-1.5 flex items-center gap-1.5 text-sm text-c4a-text-muted",children:[f.jsx(GS,{size:12,className:"shrink-0"}),v("sources.import_remote.commit_hint")]})]})]})}const j_="_pulseBar_17bq5_1",N_={pulseBar:j_};function w_({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}){const{t:u}=Te();return f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"space-y-2",children:n.map(m=>{const p=s.includes(m.key),g=i===m.key,h=l===m.key;return f.jsxs("div",{className:"flex items-center gap-3",children:[g?f.jsx(Dl,{size:14,className:"shrink-0 text-red-400"}):p||h?f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:`block h-2 w-2 rounded-full bg-c4a-accent ${h?"animate-pulse":""}`})}):f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:"block h-2 w-2 rounded-full border border-c4a-text-muted/40"})}),f.jsx("span",{className:`flex-1 text-sm ${g?"text-red-400":h?"font-medium text-c4a-text-primary":p?"text-c4a-text-secondary":"text-c4a-text-muted"}`,children:m.label}),p&&f.jsx(Tl,{size:14,className:"shrink-0 text-c4a-accent/60"}),g&&f.jsx("span",{className:"font-mono text-xs text-red-400",children:u("sources.import.error_title")}),h&&o&&o.label&&f.jsx("span",{className:"max-w-[200px] truncate font-mono text-xs text-c4a-text-muted",children:o.label})]},m.key)})}),l&&!i&&f.jsxs("div",{className:"space-y-1",children:[o&&o.percent>=0?f.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-c4a-bg-elevated",children:f.jsx("div",{className:"h-full rounded-full bg-c4a-accent transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,o.percent))}%`}})}):f.jsx("div",{className:`h-1.5 rounded-full bg-c4a-bg-elevated ${N_.pulseBar}`}),o&&o.label&&f.jsx("p",{className:"truncate font-mono text-xs text-c4a-text-muted",children:o.label})]})]})}function Ix({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o,failedError:u,logs:m}){const p=b.useRef(null);return b.useEffect(()=>{p.current?.scrollIntoView({behavior:"smooth"})},[m.length]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsx(w_,{stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}),f.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[m.map((g,h)=>f.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:g},h)),f.jsx("div",{ref:p})]}),i&&u&&f.jsx("div",{className:"mt-3 rounded-sm border border-red-500/20 bg-red-500/10 p-4",children:f.jsx("p",{className:"font-mono text-sm font-medium text-red-400",children:u})})]})}function En({icon:n,label:l,value:s,tooltip:i,size:o="sm"}){const u=o==="sm";return f.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted",children:[n,f.jsx("span",{className:"font-mono text-[10px] uppercase",children:l})]}),f.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-primary ${u?"text-sm truncate":"text-lg"}`,title:u?String(s):void 0,children:s}),i&&f.jsx("div",{className:"pointer-events-none absolute bottom-full left-0 z-30 mb-1.5 hidden w-max max-w-[260px] rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/stat:block",children:i})]})}const Iu=100;function ey({repoName:n,repoIdentifier:l,branch:s,commit:i,packages:o,mdFiles:u,importing:m,completed:p}){const{t:g}=Te(),h=i?i.slice(0,7):"",[v,y]=b.useState("packages"),[_,j]=b.useState(Iu),R=b.useRef(null),z=b.useRef(null);b.useEffect(()=>{j(Iu),z.current?.scrollTo(0,0)},[v]),b.useEffect(()=>{const G=R.current;if(!G)return;const Y=v==="packages"?o.length:u.length;if(_>=Y)return;const te=new IntersectionObserver(ee=>{ee[0]?.isIntersecting&&j(w=>Math.min(w+Iu,Y))},{root:z.current,threshold:.1});return te.observe(G),()=>te.disconnect()},[v,_,o.length,u.length]);const A=v==="packages"?o:u,X=A.slice(0,_),Q=_<A.length,V=b.useMemo(()=>p?g("sources.import_remote.complete"):m?g("sources.import.importing"):g("sources.import.confirm_heading",{name:n}),[p,m,n,g]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:V}),f.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[f.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:l})]}),f.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[f.jsx(En,{icon:f.jsx(ud,{size:14}),label:g("sources.import.branch"),value:s}),f.jsx(En,{icon:f.jsx(HS,{size:14}),label:g("sources.import.commit"),value:h}),f.jsx(En,{icon:f.jsx(Cr,{size:14}),label:g("sources.import.packages"),value:String(o.length),tooltip:g("sources.import.dir_code_packages_tip")}),f.jsx(En,{icon:f.jsx(al,{size:14}),label:g("sources.import.documents"),value:String(u.length),tooltip:g("sources.import.dir_doc_files_tip")})]}),m&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Sa,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:g("sources.import.importing")})]}),(o.length>0||u.length>0)&&f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-base",children:[f.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[f.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-primary sm:block",children:g("sources.import.recognized",{packages:o.length,docs:u.length})}),f.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[f.jsxs("button",{onClick:()=>y("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${v==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(Cr,{size:13}),f.jsx("span",{className:"font-mono",children:o.length})]}),f.jsxs("button",{onClick:()=>y("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${v==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(al,{size:13}),f.jsx("span",{className:"font-mono",children:u.length})]})]})]}),f.jsx("hr",{className:"border-c4a-border-subtle"}),f.jsx("div",{ref:z,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:A.length===0?f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:v==="packages"?g("sources.import.no_packages"):"—"}):f.jsxs(f.Fragment,{children:[v==="packages"?X.map(G=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(Cr,{size:14,className:"shrink-0 text-c4a-accent"}),f.jsx("span",{className:"text-c4a-text-primary",children:G.name}),f.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:G.path}),G.isRoot&&f.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},G.path)):X.map(G=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(al,{size:14,className:"shrink-0 text-c4a-text-secondary"}),f.jsx("span",{className:"truncate text-c4a-text-primary",children:G})]},G)),Q&&f.jsx("div",{ref:R,className:"h-4"})]})})]})]})}const E_=["scan","save"],so={scan:"Scanning project",save:"Saving sources"};function C_(){const{t:n}=Te(),l=Rn(),{libId:s}=Bs(),o=Zt(Ml(Tr)).find(Ce=>Ce.id===s),u=wo(Ce=>Ce.createSource),[m,p]=b.useState(1),[g,h]=b.useState(null),[v,y]=b.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[_,j]=b.useState(null),[R,z]=b.useState(!1),[A,X]=b.useState(null),[Q,V]=b.useState(""),[G,Y]=b.useState(""),[te,ee]=b.useState(!1),[w,q]=b.useState(!1),[Z,de]=b.useState(!1),[se,ye]=b.useState(null),[ae,ie]=b.useState([]),[M,W]=b.useState(null),[ce,P]=b.useState(null),[be,N]=b.useState([]),H=b.useRef(null),F=o?.is_online??!1,{rpc:ne,importedPaths:he,allowedPaths:_e}=Xx(s,o),ze=b.useMemo(()=>E_.map(Ce=>({key:Ce,label:so[Ce]??Ce})),[]),Ze=b.useCallback(Ce=>{N(Pe=>[...Pe,`[${Zx()}] ${Ce}`])},[]),Ue=b.useCallback(Ce=>{ye(Pe=>(Pe&&Pe!==Ce&&(ie(pe=>pe.includes(Pe)?pe:[...pe,Pe]),Ze(`${so[Pe]??Pe} done`)),Ze(`${so[Ce]??Ce}...`),Ce)),P(null)},[Ze]),na=b.useCallback((Ce,Pe)=>{y(pe=>({...pe,repoPath:Ce,repoName:Pe}))},[]),Ft=b.useCallback(async()=>{z(!0),X(null);try{const Ce=await ne("fs/repoStatus",{path:v.repoPath}),Pe={branches:Ce.branches??[{name:Ce.branch,commit:Ce.head_hash}],tags:Ce.tags??[],default:Ce.branch,commits:Ce.commits??[{hash:Ce.head_hash,message:"HEAD"}]};j(Pe),y(pe=>({...pe,isDirty:Ce.is_dirty})),V(pe=>{if(pe)return pe;const Oe=Pe.branches.find(Yt=>Yt.name===Pe.default),Ve=Pe.branches[0],ct=Oe??Ve;return ct?(Y(ct.commit),ct.name):pe})}catch(Ce){const Pe=Ce instanceof Error?Ce.message:"Failed to load repository info";X(Pe)}finally{z(!1)}},[ne,v.repoPath]);b.useEffect(()=>{m===2&&v.repoPath&&!_&&Ft()},[m,v.repoPath,_,Ft]);const nt=b.useCallback(async Ce=>{try{const Pe=await ne("fs/repoStatus",{path:v.repoPath,branch:Ce});j(pe=>pe&&{...pe,commits:Pe.commits??[]})}catch{}},[ne,v.repoPath]),Ge=b.useCallback(async()=>{if(s){q(!0),de(!1),h(null),W(null),ie([]),ye(null),P(null),N([]),p(3);try{Ue("scan");const Ce=await ne("fs/repoScan",{path:v.repoPath,hash:G}),Pe=Ce.files||[],pe=Ce.manifests||[],Oe=xo(v.repoPath),{packages:Ve,mdFiles:ct}=Qx(pe,Pe,Oe);y(bt=>({...bt,branch:Q,commit:G,repoFiles:Pe,packages:Ve,mdFiles:ct,repoFileContents:pe})),Ue("save");const Yt=await u({library_id:s,repo_name:v.repoName||Oe,repo_root_path:v.repoPath,repo_branch:Q,repo_commit:G,repo_files:Pe.map(bt=>bt.path),repo_file_contents:pe});ie(["scan","save"]),ye(null),Ze(`${so.save} done`),Ze("Import complete");const Ht=Array.isArray(Yt)?Yt[0]:Yt;H.current=Ht?.id??null,de(!0),q(!1)}catch(Ce){W(se??"scan"),ye(null);const pe=Ce instanceof Error?Ce.message:String(Ce);Ze(`ERROR: ${pe}`),h(pe),q(!1)}}},[s,v,Q,G,ne,u,Ue,se,Ze]),xt=b.useCallback(()=>{W(null),h(null),Ge()},[Ge]),Tt=b.useCallback(()=>{s&&(H.current?l(`/studio/sources/${s}?rootId=${H.current}`):l(`/studio/sources/${s}`))},[s,l]),la=b.useMemo(()=>m===1?!!v.repoPath:m===2?te:m===3?Z:!1,[m,v.repoPath,te,Z]),Jt=b.useMemo(()=>o?[{label:o.id===nl?n("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:n("sources.import.title")}]:[],[o,n]);if(!o)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Za=m===4,ja=m===3&&!!M&&!w,Na=m<=2||m===3&&Z;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(zr,{segments:Jt})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(ln,{active:m>=1,current:m===1}),f.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Cl,{}),f.jsx(ln,{active:m>=2,current:m===2}),f.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Cl,{}),f.jsx(ln,{active:m>=3,current:m===3}),f.jsx("span",{className:m===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import_remote.step.loading")}),f.jsx(Cl,{}),f.jsx(ln,{active:m>=4,current:m===4}),f.jsx("span",{className:m===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:F?f.jsxs(f.Fragment,{children:[m===1&&f.jsx(S_,{rpc:ne,selectedPath:v.repoPath,onSelect:na,allowedPaths:_e,importedPaths:he}),m===2&&f.jsx(Wx,{refs:_,loading:R,error:A,selectedRef:Q,commit:G,onRefChange:V,onCommitChange:Y,onValidChange:ee,onRetry:Ft,onBranchSwitch:nt}),m===3&&f.jsx(Ix,{stages:ze,currentStage:se,completedStages:ae,failedStage:M,progress:ce,failedError:g,logs:be}),m===4&&f.jsx(ey,{repoName:v.repoName||xo(v.repoPath),repoIdentifier:v.repoPath,branch:Q,commit:G,packages:v.packages,mdFiles:v.mdFiles,importing:!1,completed:Z})]}):f.jsx(Kx,{libraryName:o.name})}),F&&f.jsx(f.Fragment,{children:Za?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:Tt,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.back_to_library")})}):ja?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{p(2),W(null),h(null),ie([]),ye(null),N([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("sources.import_remote.back")}),f.jsx("button",{onClick:xt,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.retry")})]}):Na?f.jsx(Rd,{step:m,totalSteps:4,importing:w,stepBusy:R||m===3&&w,canProceed:la,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>{m===3?(p(2),de(!1),ie([]),ye(null),N([])):p(Ce=>Ce-1)},onNext:()=>{m===2?Ge():p(Ce=>Ce+1)},onImport:Ge}):null}),g&&m!==3&&f.jsxs(Al,{onClose:()=>h(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:g}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>h(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]})}const Lg=(n,l)=>{let s=0,i=0,o=0;const u=[],m=p=>{for(const g of p)if(g.type==="directory")i++,g.is_git_repo&&o++,g.children&&m(g.children);else if(s++,/\.md$/i.test(g.name)){const h=g.path.startsWith(l)?g.path.slice(l.length).replace(/^\//,""):g.name;u.push(h)}};return m(n),{files:s,dirs:i,gitRepos:o,mdFiles:u}};function R_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Te(),{atRoot:m,currentPath:p,entries:g,loading:h,error:v,homeDir:y,goToOpen:_,isWildcard:j,importedSet:R,dirs:z,files:A,loadTree:X,handleNavigateUp:Q,setGoToOpen:V}=Px({rpc:n,allowedPaths:i??[],importedPaths:o??[]}),G=b.useCallback(w=>{if(w.type!=="directory"||R.has(w.path))return;const q=Lg(w.children||[],w.path);s(w.path,w.name,q),X(w.path)},[s,X,R]);b.useEffect(()=>{if(p&&!m&&g.length>=0&&!h){const w=p.split("/").pop()||p,q=Lg(g,p);s(p,w,q)}},[p,m,g,h,s]);const Y=b.useMemo(()=>l?l.split("/").pop()||l:"",[l]),te=b.useMemo(()=>z.sort((w,q)=>w.is_git_repo&&!q.is_git_repo?-1:!w.is_git_repo&&q.is_git_repo?1:w.name.localeCompare(q.name)),[z]),ee=b.useMemo(()=>A.sort((w,q)=>w.name.localeCompare(q.name)),[A]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Fx,{})]}):f.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:p}),l?f.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[f.jsx(ka,{size:12}),f.jsx("span",{children:Y})]}):j&&m?f.jsx("button",{onClick:()=>V(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?j?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:y&&f.jsxs("button",{onClick:()=>X(y),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(ka,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[y,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(ta,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(w=>f.jsxs("button",{onClick:()=>X(w),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(ka,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:w}),f.jsx(ta,{size:12,className:"shrink-0 text-c4a-text-muted"})]},w))}):v&&!h?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Sa,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&f.jsxs("button",{onClick:Q,disabled:h,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(ka,{size:14}),f.jsx("span",{children:".."})]}),te.map(w=>{const q=R.has(w.path),Z=w.is_git_repo?Cd:ka;return f.jsxs("button",{onClick:()=>G(w),disabled:q||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${q?"cursor-not-allowed text-c4a-accent/60":l===w.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[f.jsx(Z,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate",children:w.name}),q&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")}),f.jsx(ta,{size:12,className:"shrink-0 text-c4a-text-muted"})]},w.path)}),ee.map(w=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Dx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:w.name})]},w.path)),g.length===0&&!h&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),f.jsx(Jx,{open:_,onClose:()=>V(!1),rpc:n,onNavigate:X,defaultPath:y??void 0})]})}const T_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),z_=n=>{let l=0,s=0,i=0,o=0,u=0;const m=new Set;for(const p of n)if(p.type==="directory")s++,p.is_git_repo&&u++;else{l++,p.path.toLowerCase().endsWith(".md")&&o++;const h=p.path.split("/").pop();if(h&&T_.has(h.toLowerCase())){const v=p.path.split("/").slice(0,-1).join("/");n.some(_=>_.type==="directory"&&_.is_git_repo&&(v===_.path||v.startsWith(`${_.path}/`)))||m.add(v)}}return i=m.size,{totalFiles:l,totalDirs:s,codePackages:i,docFiles:o,gitRepos:u}};function O_({dirPath:n,rpc:l,importing:s,onScanComplete:i,onBusyChange:o}){const{t:u}=Te(),[m,p]=b.useState(!1),[g,h]=b.useState(null),[v,y]=b.useState(null),_=b.useCallback(async()=>{p(!0),o?.(!0),h(null),y(null);try{const j=await l("fs/dirScan",{path:n}),R=j.entries||[],z=j.manifests||[],A=z_(R);y(A),i(R,A,z)}catch(j){const R=j instanceof Error?j.message:String(j);h(R)}finally{p(!1),o?.(!1)}},[n,l,i,o]);return b.useEffect(()=>{_()},[_]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),f.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[m&&f.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[f.jsx(Sa,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.dir_scanning")})]}),g&&f.jsxs("div",{className:"mt-6",children:[f.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[f.jsx(Ox,{size:14,className:"mt-0.5 shrink-0"}),u("sources.import.dir_scan_error")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:g}),f.jsxs("button",{onClick:_,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(kx,{size:12}),u("sources.import.dir_scan_retry")]})]}),v&&!m&&!g&&f.jsxs("div",{className:"mt-6 space-y-3",children:[f.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[u("sources.import.dir_scan_complete"),"!"]}),f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[f.jsx(En,{icon:f.jsx(al,{size:14}),label:u("sources.import.dir_doc_files"),value:v.docFiles,tooltip:u("sources.import.dir_doc_files_tip"),size:"lg"}),f.jsx(En,{icon:f.jsx(Cr,{size:14}),label:u("sources.import.dir_code_packages"),value:v.codePackages,tooltip:u("sources.import.dir_code_packages_tip"),size:"lg"}),v.gitRepos>0&&f.jsx(En,{icon:f.jsx(Cd,{size:14}),label:u("sources.import.dir_git_repos"),value:v.gitRepos,size:"lg"}),f.jsx(En,{icon:f.jsx(ka,{size:14}),label:u("sources.import.dir_total_dirs"),value:v.totalDirs,size:"lg"}),f.jsx(En,{icon:f.jsx(RS,{size:14}),label:u("sources.import.dir_total_files"),value:v.totalFiles,size:"lg"})]}),v.gitRepos>0&&f.jsx("p",{className:"text-xs text-c4a-warning",children:u("sources.import.dir_git_skip_hint",{count:v.gitRepos})})]}),s&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Sa,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.importing")})]})]})]})}function D_(){const{t:n}=Te(),l=Rn(),{libId:s}=Bs(),o=Zt(Ml(Tr)).find(q=>q.id===s),u=wo(q=>q.createSource),[m,p]=b.useState(1),[g,h]=b.useState(!1),[v,y]=b.useState(null),[_,j]=b.useState(!1),[R,z]=b.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),A=o?.is_online??!1,{rpc:X,importedPaths:Q,allowedPaths:V}=Xx(s,o),G=b.useCallback((q,Z,de)=>{z(se=>({...se,dirPath:q,dirName:Z,fileCount:de.files,subDirCount:de.dirs,gitRepoCount:de.gitRepos,mdFiles:de.mdFiles}))},[]),Y=b.useCallback((q,Z,de)=>{z(se=>({...se,scanEntries:q,scanStats:Z,manifests:de}))},[]),te=b.useCallback(async()=>{if(s){h(!0);try{const q=await u({library_id:s,dir_files:R.scanEntries,dir_name:R.dirName,dir_path:R.dirPath,dir_file_contents:R.manifests}),Z=Array.isArray(q)?q[0]:q;Z?.id?l(`/studio/sources/${s}?rootId=${Z.id}`):l(`/studio/sources/${s}`)}catch(q){const Z=q instanceof Error?q.message:String(q);y(Z),h(!1)}}},[s,R,u,l]),ee=b.useMemo(()=>m===1?!!R.dirPath:m===2?R.scanEntries.length>0:!0,[m,R]),w=b.useMemo(()=>o?[{label:o.id===nl?n("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:n("sources.import.dir_title")}]:[],[o,n]);return o?f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(zr,{segments:w})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(ln,{active:m>=1,current:m===1}),f.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.select")}),f.jsx(Cl,{}),f.jsx(ln,{active:m>=2,current:m===2}),f.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:A?f.jsxs(f.Fragment,{children:[m===1&&f.jsx(R_,{rpc:X,selectedPath:R.dirPath,onSelect:G,allowedPaths:V,importedPaths:Q}),m===2&&f.jsx(O_,{dirPath:R.dirPath,rpc:X,importing:g,onScanComplete:Y,onBusyChange:j})]}):f.jsx(Kx,{libraryName:o.name})}),A&&f.jsx(Rd,{step:m,totalSteps:2,importing:g,stepBusy:_,canProceed:ee,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>p(q=>q-1),onNext:()=>p(q=>q+1),onImport:te}),v&&f.jsxs(Al,{onClose:()=>y(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>y(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const M_=/^https:\/\/[^/]+\/.+/;function A_({url:n,onUrlChange:l,onValidChange:s}){const{t:i}=Te(),[o,u]=b.useState(null),[m,p]=b.useState([]),g=b.useRef(null);b.useEffect(()=>{vt.get("/import/remote/git-hosts").then(_=>p(_.hosts),()=>{})},[]);const h=b.useCallback(_=>{if(!_){u(null),s(!1);return}M_.test(_)?(u(null),s(!0)):(u(i("sources.import_remote.url_invalid")),s(!1))},[s,i]),v=b.useCallback(_=>{const j=_.target.value;l(j),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>h(j),300)},[l,h]),y=b.useCallback(_=>{_.preventDefault();const j=_.clipboardData.getData("text").trim();l(j),g.current&&clearTimeout(g.current),h(j)},[l,h]);return b.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),b.useEffect(()=>{n&&h(n)},[]),f.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-default bg-c4a-bg-surface px-6 py-10",children:f.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[f.jsx("input",{type:"text",value:n,onChange:v,onPaste:y,placeholder:i("sources.import_remote.url_placeholder"),className:"w-full rounded-md border border-c4a-border-default bg-c4a-bg-surface px-4 py-3 text-center font-mono text-base font-semibold text-c4a-accent placeholder:font-normal placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none",autoFocus:!0}),f.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:o?f.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[f.jsx(Dl,{size:14,className:"shrink-0"}),o]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{children:m.length>0?f.jsxs(f.Fragment,{children:[i("sources.import_remote.url_hint_public"),m.map((_,j)=>f.jsxs("span",{children:[j>0&&"、",f.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:_})]},_))]}):i("sources.import_remote.url_hint_no_auth")}),f.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:i("sources.import_remote.url_hint_format")})]})})]})})}const Ug=["prepare","clone","scan","save"],io={prepare:"Preparing environment",clone:"Cloning repository",scan:"Scanning project",save:"Saving sources"};function k_(n,l,s){if(n instanceof El){const i=n.message.toLowerCase();if(n.status===503)return s("sources.import_remote.error.capacity");if(i.includes("connect")||i.includes("connectionrefused")||i.includes("unavailable")||i.includes("econnrefused"))return s("sources.import_remote.error.network");if(i.includes("authentication")||i.includes("token")||i.includes("credential")||i.includes("401")||i.includes("403"))try{const o=new URL(l).hostname;return s("sources.import_remote.error.auth_required",{host:o})}catch{return s("sources.import_remote.error.auth_required",{host:l})}return i.includes("not found")||i.includes("404")||i.includes("does not exist")?s("sources.import_remote.error.not_found"):n.message||s("sources.import_remote.error.network")}return n instanceof TypeError&&n.message.includes("fetch")?s("sources.import_remote.error.network"):n instanceof Error?n.message:s("sources.import_remote.error.network")}function L_(n){return n==="cloning"?"clone":n==="detecting"||n==="extracting"?"scan":n==="saving"?"save":n}function U_(){const{t:n}=Te(),l=Rn(),{libId:s}=Bs(),[i]=Ed(),o=i.get("url")||"",u=i.get("ref")||"",m=i.get("sourceUuid")||"",g=Zt(Ml(Tr)).find(pe=>pe.id===s),[h,v]=b.useState(o?2:1),[y,_]=b.useState(o),[j,R]=b.useState(!!o),[z,A]=b.useState(u),[X,Q]=b.useState(""),[V,G]=b.useState(!!u),[Y,te]=b.useState(null),[ee,w]=b.useState(!1),[q,Z]=b.useState(null),[de,se]=b.useState(!1),[ye,ae]=b.useState(!1),[ie,M]=b.useState(null),[W,ce]=b.useState(null),[P,be]=b.useState(null),[N,H]=b.useState(null),[F,ne]=b.useState([]),[he,_e]=b.useState(null),[ze,Ze]=b.useState([]),Ue=b.useRef(null),na=b.useRef(""),Ft=b.useMemo(()=>Ug.map(pe=>({key:pe,label:io[pe]??pe})),[]),nt=b.useCallback(pe=>{Ze(Oe=>[...Oe,`[${Zx()}] ${pe}`])},[]),Ge=b.useCallback(pe=>{H(Oe=>(Oe&&Oe!==pe&&(ne(Ve=>Ve.includes(Oe)?Ve:[...Ve,Oe]),nt(`${io[Oe]??Oe} done`)),nt(`${io[pe]??pe}...`),pe)),_e(null)},[nt]),xt=b.useCallback(async pe=>{if(s){w(!0),Z(null);try{const Oe=await vt.post("/import/remote/refs",{library_id:s,url:y},pe?{signal:pe}:void 0);te(Oe);const Ve=Oe.branches??[];Ve.length>0&&A(ct=>{if(ct)return ct;const Ht=Ve.find(bt=>bt.name===Oe.default)??Ve[0];return Ht?(Q(Ht.commit),Ht.name):ct})}catch(Oe){if(pe?.aborted)return;Z(k_(Oe,y,n))}finally{pe?.aborted||w(!1)}}},[s,y,n]);b.useEffect(()=>{if(h!==2||!s)return;const pe=new AbortController;return xt(pe.signal),()=>pe.abort()},[h,s,xt]),b.useEffect(()=>de?Xa.on("task/progress",Oe=>{const Ve=Oe,ct=L_(Ve.stage??"");ct&&Ug.includes(ct)&&(Ge(ct),_e({percent:Ve.percent??-1,label:Ve.label??""}))}):void 0,[de,Ge]);const Tt=b.useCallback(async()=>{if(s){se(!0),ae(!1),ce(null),be(null),ne([]),H(null),_e(null),Ze([]),v(3);try{Ge("prepare"),await new Promise(bt=>setTimeout(bt,300)),Ge("clone");const pe=await vt.post("/import/remote/clone",{library_id:s,url:y,ref:z,...X?{commit:X}:{}});na.current=pe.commit_hash,Ge("scan");const Oe=await vt.post("/import/remote/scan",{library_id:s,path:pe.path,hash:pe.commit_hash});Ge("save");const Ve=xo(y),ct=await vt.post("/import/remote/import",{library_id:s,url:y,ref:z,commit:pe.commit_hash,repo_name:Ve,repo_files:Oe.files.map(bt=>bt.path),repo_file_contents:Oe.manifests,...m?{source_uuid:m}:{}});ne(["prepare","clone","scan","save"]),H(null),nt(`${io.save} done`),nt("Import complete");const{packages:Yt,mdFiles:Ht}=Qx(Oe.manifests,Oe.files,Ve);M({packages:Yt,mdFiles:Ht}),ae(!0),se(!1),Ue.current=ct.id,v(4)}catch(pe){be(N??"prepare"),H(null);let Ve;pe instanceof El||pe instanceof Error?Ve=pe.message:Ve=String(pe),nt(`ERROR: ${Ve}`),ce(Ve),se(!1)}}},[s,y,z,X,m,Ge,N,nt]),la=b.useCallback(()=>{be(null),ce(null),Tt()},[Tt]),Jt=b.useCallback(()=>{s&&(Ue.current?l(`/studio/sources/${s}?rootId=${Ue.current}`):l(`/studio/sources/${s}`))},[s,l]),Za=b.useMemo(()=>h===1?j:h===2?V:!1,[h,j,V]),ja=b.useMemo(()=>g?[{label:g.id===nl?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`},{label:n("sources.import_remote.title")}]:[],[g,n]);if(!g)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Na=h===4&&ye,Ce=h===3&&!!P&&!de,Pe=h<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(zr,{segments:ja})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(ln,{active:h>=1,current:h===1}),f.jsx("span",{className:h===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Cl,{}),f.jsx(ln,{active:h>=2,current:h===2}),f.jsx("span",{className:h===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Cl,{}),f.jsx(ln,{active:h>=3,current:h===3}),f.jsx("span",{className:h===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import_remote.step.loading")}),f.jsx(Cl,{}),f.jsx(ln,{active:h>=4,current:h===4}),f.jsx("span",{className:h===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[h===1&&f.jsx(A_,{url:y,onUrlChange:_,onValidChange:R}),h===2&&s&&f.jsx(Wx,{refs:Y,loading:ee,error:q,selectedRef:z,commit:X,onRefChange:A,onCommitChange:Q,onValidChange:G,onRetry:()=>xt()}),h===3&&f.jsx(Ix,{stages:Ft,currentStage:N,completedStages:F,failedStage:P,progress:he,failedError:W,logs:ze}),h===4&&f.jsx(ey,{repoName:xo(y),repoIdentifier:y,branch:z,commit:na.current,packages:ie?.packages??[],mdFiles:ie?.mdFiles??[],importing:!1,completed:ye})]}),Na?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:Jt,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.back_to_library")})}):Ce?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{v(1),be(null),ce(null),ne([]),H(null),Ze([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("sources.import_remote.back")}),f.jsx("button",{onClick:la,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.retry")})]}):Pe?f.jsx(Rd,{step:h,totalSteps:2,importing:!1,stepBusy:ee,canProceed:Za,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>v(pe=>pe-1),onNext:()=>v(pe=>pe+1),onImport:Tt}):null]})}function H_(){const{t:n}=Te(),l=Rn(),s=Zt(_=>_.createLibrary),[i,o]=b.useState("waiting"),[u,m]=b.useState(null),[p,g]=b.useState(""),[h,v]=b.useState(!1);b.useEffect(()=>Xa.on("ws:daemon:connected",j=>{const R=j;m(R),g(R.machine_id),o(R.needs_registration?"new_client":"reconnected")}),[]),b.useEffect(()=>{let _=!1;return(async()=>{try{const j=await vt.get("/daemons/pending");if(_||j.pending.length===0)return;const R=j.pending[0];m({machine_id:R.machine_id,needs_registration:!0}),g(R.machine_id),o("new_client")}catch{}})(),()=>{_=!0}},[]);const y=b.useCallback(async()=>{if(u){v(!0);try{const _=await s({type:"daemon",name:p||u.machine_id,config:{machine_id:u.machine_id,os:u.os||"",daemon_version:u.daemon_version||""}});l(`/studio/sources/${_.id}`)}catch{v(!1)}}},[u,p,s,l]);return f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(zr,{segments:[{label:n("sources.add_client.title")}]}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),f.jsx("div",{className:"mt-6 rounded border border-c4a-border-default bg-c4a-bg-surface p-5",children:f.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:["npm install -g @c4a/daemon ",f.jsx(Hg,{text:"npm install -g @c4a/daemon"})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",n("sources.add_client.step2")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host}`," ",f.jsx(Hg,{text:`c4a-daemon --server ${window.location.host}`})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),f.jsxs("div",{className:"mt-6 rounded border border-c4a-border-default bg-c4a-bg-surface p-5",children:[i==="waiting"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Sa,{size:16,className:"animate-spin text-c4a-warning"}),f.jsx("span",{className:"text-sm text-c4a-warning",children:n("sources.add_client.waiting")})]}),i==="new_client"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:n("sources.add_client.detected")}),f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsx(ed,{label:n("sources.add_client.machine_name"),value:u.machine_id}),u.os&&f.jsx(ed,{label:n("sources.add_client.os"),value:u.os}),u.daemon_version&&f.jsx(ed,{label:n("sources.add_client.daemon_version"),value:u.daemon_version})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),f.jsx("input",{value:p,onChange:_=>g(_.target.value),className:"min-w-0 flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-2 py-1 font-mono text-xs text-c4a-text-primary outline-none focus:border-c4a-accent"})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx("button",{onClick:()=>l("/studio/sources"),className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("common.cancel")}),f.jsxs("button",{onClick:y,disabled:h||!p.trim(),className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-50",children:[h&&f.jsx(Sa,{size:12,className:"animate-spin"}),n("sources.add_client.confirm")]})]})]}),i==="reconnected"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Tl,{size:16,className:"text-c4a-success"}),f.jsx("span",{className:"text-sm text-c4a-text-primary",children:n("sources.add_client.reconnected",{name:u.machine_id})})]}),u.lib_id&&f.jsx(va,{to:`/studio/sources/${u.lib_id}`,className:"inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.add_client.go_to",{name:u.machine_id})})]})]})]})}function Hg({text:n}){const[l,s]=b.useState(!1),i=b.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[n]);return f.jsx("button",{type:"button",onClick:i,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:l?f.jsx(Tl,{size:13}):f.jsx(cd,{size:13})})}function ed({label:n,value:l}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:l})]})}function B_(){const{t:n}=Te(),{sourceUuid:l}=Bs(),[s]=Ed(),i=s.get("path")||"",{currentRoot:o,loading:u,fetchRootSource:m}=wo(),p=Zt(Ml(Tr)),[g,h]=b.useState("original");b.useEffect(()=>{l&&m(l)},[l,m]);const v=b.useMemo(()=>o?i?No(o.tree,i):o.kind==="source"?{path:"",kind:o.kind,source_type:o.source_type,name:o.name,metadata:o.metadata,index_status:o.index_status}:null:null,[o,i]),y=p.find(V=>V.id===o?.library_id),_=v?.metadata,j=_?Object.fromEntries(Object.entries(_).map(([V,G])=>[V,String(G??"")])):null,R=v?.source_type==="code",z=v?.name??o?.name??"",A=v?.source_type??null,X=b.useMemo(()=>{if(!o||!y)return[];const V=o.kind==="source"&&!i,G=[{label:y.id===nl?n("sources.library.default_cloud_name"):y.name,to:`/studio/sources/${y.id}`},{label:o.name,...V?{}:{to:`/studio/sources/${y.id}?rootId=${o.id}`}}];if(i){const Y=Yx(o.tree,i);for(let te=0;te<Y.length-1;te++){const ee=Y[te];G.push({label:ee.name,to:`/studio/sources/${y.id}?rootId=${o.id}&path=${encodeURIComponent(ee.path)}`})}Y.length>0&&G.push({label:Y[Y.length-1].name})}return G},[o,y,i,n]),Q=[{key:"original",label:n(R?"sources.detail.tab.overview":"sources.detail.tab.original")},{key:"digest",label:n("sources.detail.tab.digest")},{key:"modeling",label:n("sources.detail.tab.modeling")}];return u||!o||!v?f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}):f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(zr,{segments:X}),f.jsxs("div",{className:"mt-4 flex flex-wrap items-baseline gap-x-6 gap-y-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[R?f.jsx(Cr,{size:20,className:"shrink-0 text-c4a-accent"}):f.jsx(al,{size:20,className:"shrink-0 text-c4a-accent"}),f.jsx("h1",{className:"min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:z})]}),f.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[f.jsxs("span",{children:[n("sources.detail.type"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(A==="code"?"sources.type.code":"sources.type.doc")})]}),R&&j?.relative_path&&f.jsxs("span",{children:[n("sources.detail.path"),":"," ",f.jsx("span",{className:"font-mono text-c4a-text-secondary",children:j.relative_path})]}),!R&&f.jsxs("span",{children:[n("sources.detail.origin"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:y?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),f.jsxs("span",{children:[n("sources.detail.status"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${v.index_status??"none"}`)})]})]})]}),R&&j&&f.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[j.repo_name&&f.jsx(oo,{label:n("sources.detail.repo"),value:j.repo_name}),j.pinned_branch&&f.jsx(oo,{label:n("sources.detail.branch"),value:j.pinned_branch}),j.pinned_hash&&f.jsx(oo,{label:n("sources.detail.commit"),value:j.pinned_hash.slice(0,7)}),j.tech_stack&&f.jsx(oo,{label:n("sources.detail.tech_stack"),value:j.tech_stack})]})}),f.jsx("div",{className:"mt-3 flex border-b border-c4a-border-subtle",children:Q.map(V=>f.jsx("button",{onClick:()=>h(V.key),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${g===V.key?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:V.label},V.key))}),f.jsxs("div",{className:"mt-4 flex-1",children:[g==="original"&&f.jsx(q_,{node:v,isCode:R}),g==="digest"&&f.jsx(Bg,{message:n("sources.detail.digest_placeholder")}),g==="modeling"&&f.jsx(Bg,{message:n("sources.detail.modeling_placeholder")})]})]})}function oo({label:n,value:l}){return f.jsxs("div",{children:[f.jsx("span",{className:"text-c4a-text-muted",children:n}),f.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:l})]})}function q_({node:n,isCode:l}){const{t:s}=Te(),i=n.metadata;return l?f.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!i?.description&&f.jsx("p",{children:String(i.description)}),!!i?.dependencies&&f.jsxs("div",{children:[f.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:s("sources.detail.dependencies")}),f.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(i.dependencies).map(([o,u])=>f.jsxs("div",{className:"flex justify-between py-0.5",children:[f.jsx("span",{className:"text-c4a-text-primary",children:o}),f.jsx("span",{className:"text-c4a-text-muted",children:u})]},o))})]}),!i?.description&&!i?.dependencies&&f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_code_placeholder")})]}):f.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_doc_placeholder")})})}function Bg({message:n}){return f.jsx("div",{className:"flex items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:f.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:n})})}const $_=H4([{element:f.jsx(D2,{}),children:[{path:"/",element:f.jsx(U2,{})},{path:"/login",element:f.jsx(H2,{})},{path:"/docs",element:f.jsx(B2,{})}]},{path:"/studio",element:f.jsx(L2,{}),children:[{index:!0,element:f.jsx(yg,{to:"/studio/sources",replace:!0})},{path:"sources",element:f.jsx(yg,{to:`/studio/sources/${nl}`,replace:!0})},{path:"sources/add-client",element:f.jsx(H_,{})},{path:"sources/import/:libId",element:f.jsx(C_,{})},{path:"sources/import-dir/:libId",element:f.jsx(D_,{})},{path:"sources/import-remote/:libId",element:f.jsx(U_,{})},{path:"sources/:libId",element:f.jsx(g_,{})},{path:"source/:sourceUuid",element:f.jsx(B_,{})},{path:"modeling",element:f.jsx($2,{})},{path:"modeling/code/setup",element:f.jsx(Q2,{})},{path:"modeling/code/compile",element:f.jsx(Z2,{})},{path:"modeling/code/review",element:f.jsx(F2,{})},{path:"modeling/code/result",element:f.jsx(J2,{})},{path:"brain",element:f.jsx(Y2,{})},{path:"discovery",element:f.jsx(G2,{})},{path:"sharing",element:f.jsx(V2,{})},{path:"collaboration",element:f.jsx(K2,{})},{path:"settings",element:f.jsx(X2,{})}]},{path:"*",element:f.jsx(q2,{})}]);function Y_(){return b.useEffect(()=>{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return Xa.connect(l),()=>{Xa.disconnect()}},[]),f.jsx(u4,{router:$_})}Nv.createRoot(document.getElementById("root")).render(f.jsx(b.StrictMode,{children:f.jsx(Y_,{})}));
|