@c4a/server-cli 0.4.12-alpha.3 → 0.4.12-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4021 -1105
- package/package.json +2 -1
- package/serve.js +8449 -2018
- package/web/assets/ContentCard-D0mL7yOO.js +1 -0
- package/web/assets/ContentCard-_I22pq8z.js +1 -0
- package/web/assets/ContentDetail-BlCJjlr2.js +65 -0
- package/web/assets/ContentDetail-BtrIxG3F.js +1 -0
- package/web/assets/ContentDetail-DVIbcpNs.js +65 -0
- package/web/assets/EntityDetail-BBLfJ9LL.js +3 -0
- package/web/assets/EntityDetail-CHe5PkO9.js +1 -0
- package/web/assets/EntityDetail-CQNu3A3D.js +3 -0
- package/web/assets/JsonTree-BRUca2ED.js +1 -0
- package/web/assets/JsonTree-Dd_iNoWA.js +1 -0
- package/web/assets/RelationDetail-BoTv8wr4.js +1 -0
- package/web/assets/RelationDetail-CZwj9HUp.js +1 -0
- package/web/assets/RelationDetail-CkBj9cCj.js +1 -0
- package/web/assets/andromeeda-C4gqWexZ.js +1 -0
- package/web/assets/angular-html-DA-rfuFy.js +1 -0
- package/web/assets/angular-ts-BrjP3tb8.js +1 -0
- package/web/assets/astro-HNnZUWAn.js +1 -0
- package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/web/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/web/assets/ayu-light-BA47KaF1.js +1 -0
- package/web/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/web/assets/blade-BjGOyj-B.js +1 -0
- package/web/assets/c-BIGW1oBm.js +1 -0
- package/web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/web/assets/coffee-Ch7k5sss.js +1 -0
- package/web/assets/cpp-CofmeUqb.js +1 -0
- package/web/assets/css-CLj8gQPS.js +1 -0
- package/web/assets/csv-fuZLfV_i.js +1 -0
- package/web/assets/dark-plus-C3mMm8J8.js +1 -0
- package/web/assets/dracula-BzJJZx-M.js +1 -0
- package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/web/assets/everforest-light-C8M2exoo.js +1 -0
- package/web/assets/github-dark-DHJKELXO.js +1 -0
- package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/web/assets/github-light-DAi9KRSo.js +1 -0
- package/web/assets/github-light-default-D7oLnXFd.js +1 -0
- package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/web/assets/glsl-DplSGwfg.js +1 -0
- package/web/assets/graphql-ChdNCCLP.js +1 -0
- package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/web/assets/haml-D5jkg6IW.js +1 -0
- package/web/assets/handlebars-BpdQsYii.js +1 -0
- package/web/assets/horizon-BUw7H-hv.js +1 -0
- package/web/assets/horizon-bright-CUuTKBJd.js +1 -0
- package/web/assets/houston-DnULxvSX.js +1 -0
- package/web/assets/html-derivative-DlHx6ybY.js +1 -0
- package/web/assets/html-pp8916En.js +1 -0
- package/web/assets/http-jrhK8wxY.js +1 -0
- package/web/assets/hurl-irOxFIW8.js +1 -0
- package/web/assets/imba-DGztddWO.js +1 -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-BLskFmu3.js +193 -0
- package/web/assets/index-BMVKFQ7h.js +238 -0
- package/web/assets/index-BRwgHwhm.js +12 -0
- package/web/assets/index-BU6YkKWq.css +1 -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-BoqItESG.js +13 -0
- package/web/assets/index-Bxkj7nBM.css +1 -0
- package/web/assets/index-ByCT34eF.css +1 -0
- package/web/assets/index-C1tbhKrB.css +1 -0
- package/web/assets/index-C6uqUNjs.js +238 -0
- package/web/assets/index-CU-x3HVJ.js +12 -0
- package/web/assets/index-CVcqJsfJ.js +12 -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-DW-afpe4.js +12 -0
- package/web/assets/index-DaUMALOp.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-JdgClnFG.css +1 -0
- package/web/assets/index-P648JtKx.js +12 -0
- package/web/assets/index-PGORoGGx.js +13 -0
- package/web/assets/index-ZtrM6iGG.js +12 -0
- package/web/assets/java-CylS5w8V.js +1 -0
- package/web/assets/javascript-wDzz0qaB.js +1 -0
- package/web/assets/jinja-f2NsQr07.js +1 -0
- package/web/assets/jison-wvAkD_A8.js +1 -0
- package/web/assets/json-Cp-IABpG.js +1 -0
- package/web/assets/json5-C9tS-k6U.js +1 -0
- package/web/assets/jsonc-Des-eS-w.js +1 -0
- package/web/assets/jsonl-DcaNXYhu.js +1 -0
- package/web/assets/jsx-g9-lgVsj.js +1 -0
- package/web/assets/julia-CxzCAyBv.js +1 -0
- package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/web/assets/laserwave-DUszq2jm.js +1 -0
- package/web/assets/less-B1dDrJ26.js +1 -0
- package/web/assets/light-plus-B7mTdjB0.js +1 -0
- package/web/assets/markdown-Cvjx9yec.js +1 -0
- package/web/assets/marko-DjSrsDqO.js +1 -0
- package/web/assets/material-theme-D5KoaKCx.js +1 -0
- package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/web/assets/mdc-DTYItulj.js +1 -0
- package/web/assets/mdx-Cmh6b_Ma.js +1 -0
- package/web/assets/min-dark-CafNBF8u.js +1 -0
- package/web/assets/min-light-CTRr51gU.js +1 -0
- package/web/assets/monokai-D4h5O-jR.js +1 -0
- package/web/assets/night-owl-C39BiMTA.js +1 -0
- package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/web/assets/nord-Ddv68eIx.js +1 -0
- package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/web/assets/one-light-C3Wv6jpd.js +1 -0
- package/web/assets/php-R6g_5hLQ.js +1 -0
- package/web/assets/plastic-3e1v2bzS.js +1 -0
- package/web/assets/poimandres-CS3Unz2-.js +1 -0
- package/web/assets/postcss-CXtECtnM.js +1 -0
- package/web/assets/pug-DKIMFp6K.js +1 -0
- package/web/assets/python-B6aJPvgy.js +1 -0
- package/web/assets/r-Dspwwk_N.js +1 -0
- package/web/assets/red-bN70gL4F.js +1 -0
- package/web/assets/regexp-CDVJQ6XC.js +1 -0
- package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/web/assets/sass-Cj5Yp3dK.js +1 -0
- package/web/assets/scss-D5BDwBP9.js +1 -0
- package/web/assets/shellscript-Yzrsuije.js +1 -0
- package/web/assets/slack-dark-BthQWCQV.js +1 -0
- package/web/assets/slack-ochin-DqwNpetd.js +1 -0
- package/web/assets/snazzy-light-Bw305WKR.js +1 -0
- package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/web/assets/solarized-light-L9t79GZl.js +1 -0
- package/web/assets/sql-BLtJtn59.js +1 -0
- package/web/assets/stylus-BEDo0Tqx.js +1 -0
- package/web/assets/svelte-Cy7k_4gC.js +1 -0
- package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/web/assets/tokyo-night-hegEt444.js +1 -0
- package/web/assets/ts-tags-DQrlYJgV.js +1 -0
- package/web/assets/tsx-COt5Ahok.js +1 -0
- package/web/assets/typescript-BPQ3VLAy.js +1 -0
- package/web/assets/vesper-DU1UobuO.js +1 -0
- package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/web/assets/vue-D2xRrEX4.js +1 -0
- package/web/assets/vue-html-AaS7Mt5G.js +1 -0
- package/web/assets/vue-vine-BoDAl6tE.js +1 -0
- package/web/assets/wasm-CG6Dc4jp.js +1 -0
- package/web/assets/wasm-MzD3tlZU.js +1 -0
- package/web/assets/wgsl-Dx-B1_4e.js +1 -0
- package/web/assets/wit-5i3qLPDT.js +1 -0
- package/web/assets/xml-sdJ4AIDG.js +1 -0
- package/web/assets/yaml-Buea-lGh.js +1 -0
- package/web/index.html +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContentDetail-DVIbcpNs.js","assets/JsonTree-Dd_iNoWA.js","assets/EntityDetail-CQNu3A3D.js","assets/ContentCard-_I22pq8z.js","assets/RelationDetail-CZwj9HUp.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function Nv(n,r){for(var l=0;l<r.length;l++){const i=r[l];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const d=Object.getOwnPropertyDescriptor(i,o);d&&Object.defineProperty(n,o,d.get?d:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function l(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(o){if(o.ep)return;o.ep=!0;const d=l(o);fetch(o.href,d)}})();function wv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Hu={exports:{}},Nl={};var Np;function Ev(){if(Np)return Nl;Np=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(i,o,d){var m=null;if(d!==void 0&&(m=""+d),o.key!==void 0&&(m=""+o.key),"key"in o){d={};for(var p in o)p!=="key"&&(d[p]=o[p])}else d=o;return o=d.ref,{$$typeof:n,type:i,key:m,ref:o!==void 0?o:null,props:d}}return Nl.Fragment=r,Nl.jsx=l,Nl.jsxs=l,Nl}var wp;function Cv(){return wp||(wp=1,Hu.exports=Ev()),Hu.exports}var u=Cv();const De=n=>typeof n=="string",wl=()=>{let n,r;const l=new Promise((i,o)=>{n=i,r=o});return l.resolve=n,l.reject=r,l},Ep=n=>n==null?"":""+n,Rv=(n,r,l)=>{n.forEach(i=>{r[i]&&(l[i]=r[i])})},kv=/###/g,Cp=n=>n&&n.indexOf("###")>-1?n.replace(kv,"."):n,Rp=n=>!n||De(n),Al=(n,r,l)=>{const i=De(r)?r.split("."):r;let o=0;for(;o<i.length-1;){if(Rp(n))return{};const d=Cp(i[o]);!n[d]&&l&&(n[d]=new l),Object.prototype.hasOwnProperty.call(n,d)?n=n[d]:n={},++o}return Rp(n)?{}:{obj:n,k:Cp(i[o])}},kp=(n,r,l)=>{const{obj:i,k:o}=Al(n,r,Object);if(i!==void 0||r.length===1){i[o]=l;return}let d=r[r.length-1],m=r.slice(0,r.length-1),p=Al(n,m,Object);for(;p.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),p=Al(n,m,Object),p?.obj&&typeof p.obj[`${p.k}.${d}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${d}`]=l},Tv=(n,r,l,i)=>{const{obj:o,k:d}=Al(n,r,Object);o[d]=o[d]||[],o[d].push(l)},yo=(n,r)=>{const{obj:l,k:i}=Al(n,r);if(l&&Object.prototype.hasOwnProperty.call(l,i))return l[i]},zv=(n,r,l)=>{const i=yo(n,l);return i!==void 0?i:yo(r,l)},nx=(n,r,l)=>{for(const i in r)i!=="__proto__"&&i!=="constructor"&&(i in n?De(n[i])||n[i]instanceof String||De(r[i])||r[i]instanceof String?l&&(n[i]=r[i]):nx(n[i],r[i],l):n[i]=r[i]);return n},Or=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ov={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Dv=n=>De(n)?n.replace(/[&<>"'\/]/g,r=>Ov[r]):n;class Av{constructor(r){this.capacity=r,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(r){const l=this.regExpMap.get(r);if(l!==void 0)return l;const i=new RegExp(r);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(r,i),this.regExpQueue.push(r),i}}const Mv=[" ",",","?","!",";"],Lv=new Av(20),Uv=(n,r,l)=>{r=r||"",l=l||"";const i=Mv.filter(m=>r.indexOf(m)<0&&l.indexOf(m)<0);if(i.length===0)return!0;const o=Lv.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let d=!o.test(n);if(!d){const m=n.indexOf(l);m>0&&!o.test(n.substring(0,m))&&(d=!0)}return d},cd=(n,r,l=".")=>{if(!n)return;if(n[r])return Object.prototype.hasOwnProperty.call(n,r)?n[r]:void 0;const i=r.split(l);let o=n;for(let d=0;d<i.length;){if(!o||typeof o!="object")return;let m,p="";for(let g=d;g<i.length;++g)if(g!==d&&(p+=l),p+=i[g],m=o[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;d+=g-d+1;break}o=m}return o},Ul=n=>n?.replace("_","-"),Hv={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,r){console?.[n]?.apply?.(console,r)}};class bo{constructor(r,l={}){this.init(r,l)}init(r,l={}){this.prefix=l.prefix||"i18next:",this.logger=r||Hv,this.options=l,this.debug=l.debug}log(...r){return this.forward(r,"log","",!0)}warn(...r){return this.forward(r,"warn","",!0)}error(...r){return this.forward(r,"error","")}deprecate(...r){return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(r,l,i,o){return o&&!this.debug?null:(De(r[0])&&(r[0]=`${i}${this.prefix} ${r[0]}`),this.logger[l](r))}create(r){return new bo(this.logger,{prefix:`${this.prefix}:${r}:`,...this.options})}clone(r){return r=r||this.options,r.prefix=r.prefix||this.prefix,new bo(this.logger,r)}}var fn=new bo;class So{constructor(){this.observers={}}on(r,l){return r.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(l)||0;this.observers[i].set(l,o+1)}),this}off(r,l){if(this.observers[r]){if(!l){delete this.observers[r];return}this.observers[r].delete(l)}}emit(r,...l){this.observers[r]&&Array.from(this.observers[r].entries()).forEach(([o,d])=>{for(let m=0;m<d;m++)o(...l)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,d])=>{for(let m=0;m<d;m++)o.apply(o,[r,...l])})}}class Tp extends So{constructor(r,l={ns:["translation"],defaultNS:"translation"}){super(),this.data=r||{},this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}removeNamespaces(r){const l=this.options.ns.indexOf(r);l>-1&&this.options.ns.splice(l,1)}getResource(r,l,i,o={}){const d=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,m=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;r.indexOf(".")>-1?p=r.split("."):(p=[r,l],i&&(Array.isArray(i)?p.push(...i):De(i)&&d?p.push(...i.split(d)):p.push(i)));const g=yo(this.data,p);return!g&&!l&&!i&&r.indexOf(".")>-1&&(r=p[0],l=p[1],i=p.slice(2).join(".")),g||!m||!De(i)?g:cd(this.data?.[r]?.[l],i,d)}addResource(r,l,i,o,d={silent:!1}){const m=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let p=[r,l];i&&(p=p.concat(m?i.split(m):i)),r.indexOf(".")>-1&&(p=r.split("."),o=l,l=p[1]),this.addNamespaces(l),kp(this.data,p,o),d.silent||this.emit("added",r,l,i,o)}addResources(r,l,i,o={silent:!1}){for(const d in i)(De(i[d])||Array.isArray(i[d]))&&this.addResource(r,l,d,i[d],{silent:!0});o.silent||this.emit("added",r,l,i)}addResourceBundle(r,l,i,o,d,m={silent:!1,skipCopy:!1}){let p=[r,l];r.indexOf(".")>-1&&(p=r.split("."),o=i,i=l,l=p[1]),this.addNamespaces(l);let g=yo(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?nx(g,i,d):g={...g,...i},kp(this.data,p,g),m.silent||this.emit("added",r,l,i)}removeResourceBundle(r,l){this.hasResourceBundle(r,l)&&delete this.data[r][l],this.removeNamespaces(l),this.emit("removed",r,l)}hasResourceBundle(r,l){return this.getResource(r,l)!==void 0}getResourceBundle(r,l){return l||(l=this.options.defaultNS),this.getResource(r,l)}getDataByLanguage(r){return this.data[r]}hasLanguageSomeTranslations(r){const l=this.getDataByLanguage(r);return!!(l&&Object.keys(l)||[]).find(o=>l[o]&&Object.keys(l[o]).length>0)}toJSON(){return this.data}}var rx={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,r,l,i,o){return n.forEach(d=>{r=this.processors[d]?.process(r,l,i,o)??r}),r}};const sx=Symbol("i18next/PATH_KEY");function Bv(){const n=[],r=Object.create(null);let l;return r.get=(i,o)=>(l?.revoke?.(),o===sx?n:(n.push(o),l=Proxy.revocable(i,r),l.proxy)),Proxy.revocable(Object.create(null),r).proxy}function ud(n,r){const{[sx]:l}=n(Bv());return l.join(r?.keySeparator??".")}const zp={},Bu=n=>!De(n)&&typeof n!="boolean"&&typeof n!="number";class vo extends So{constructor(r,l={}){super(),Rv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,this),this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=fn.create("translator")}changeLanguage(r){r&&(this.language=r)}exists(r,l={interpolation:{}}){const i={...l};if(r==null)return!1;const o=this.resolve(r,i);if(o?.res===void 0)return!1;const d=Bu(o.res);return!(i.returnObjects===!1&&d)}extractFromKey(r,l){let i=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let d=l.ns||this.options.defaultNS||[];const m=i&&r.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!l.keySeparator&&!this.options.userDefinedNsSeparator&&!l.nsSeparator&&!Uv(r,i,o);if(m&&!p){const g=r.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:r,namespaces:De(d)?[d]:d};const h=r.split(i);(i!==o||i===o&&this.options.ns.indexOf(h[0])>-1)&&(d=h.shift()),r=h.join(o)}return{key:r,namespaces:De(d)?[d]:d}}translate(r,l,i){let o=typeof l=="object"?{...l}:l;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),r==null)return"";typeof r=="function"&&(r=ud(r,{...this.options,...o})),Array.isArray(r)||(r=[String(r)]);const d=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(r[r.length-1],o),h=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=o.lng||this.language,_=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b?.toLowerCase()==="cimode")return _?d?{res:`${h}${v}${p}`,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:`${h}${v}${p}`:d?{res:p,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:p;const j=this.resolve(r,o);let N=j?.res;const C=j?.usedKey||p,z=j?.exactUsedKey||p,q=["[object Number]","[object Function]","[object RegExp]"],Q=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,V=!this.i18nFormat||this.i18nFormat.handleAsObject,Y=o.count!==void 0&&!De(o.count),te=vo.hasDefaultValue(o),Z=Y?this.pluralResolver.getSuffix(b,o.count,o):"",G=o.ordinal&&Y?this.pluralResolver.getSuffix(b,o.count,{ordinal:!1}):"",E=Y&&!o.ordinal&&o.count===0,H=E&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${Z}`]||o[`defaultValue${G}`]||o.defaultValue;let W=N;V&&!N&&te&&(W=H);const de=Bu(W),le=Object.prototype.toString.apply(W);if(V&&W&&de&&q.indexOf(le)<0&&!(De(Q)&&Array.isArray(W))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const se=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,W,{...o,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return d?(j.res=se,j.usedParams=this.getUsedParamsDetails(o),j):se}if(m){const se=Array.isArray(W),ce=se?[]:{},ge=se?z:C;for(const A in W)if(Object.prototype.hasOwnProperty.call(W,A)){const P=`${ge}${m}${A}`;te&&!N?ce[A]=this.translate(P,{...o,defaultValue:Bu(H)?H[A]:void 0,joinArrays:!1,ns:g}):ce[A]=this.translate(P,{...o,joinArrays:!1,ns:g}),ce[A]===P&&(ce[A]=W[A])}N=ce}}else if(V&&De(Q)&&Array.isArray(N))N=N.join(Q),N&&(N=this.extendTranslation(N,r,o,i));else{let se=!1,ce=!1;!this.isValidLookup(N)&&te&&(se=!0,N=H),this.isValidLookup(N)||(ce=!0,N=p);const A=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ce?void 0:N,P=te&&H!==N&&this.options.updateMissing;if(ce||se||P){if(this.logger.log(P?"updateKey":"missingKey",b,h,p,P?H:N),m){const w=this.resolve(p,{...o,keySeparator:!1});w&&w.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 fe=[];const me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&me&&me[0])for(let w=0;w<me.length;w++)fe.push(me[w]);else this.options.saveMissingTo==="all"?fe=this.languageUtils.toResolveHierarchy(o.lng||this.language):fe.push(o.lng||this.language);const re=(w,$,ee)=>{const ae=te&&ee!==N?ee:A;this.options.missingKeyHandler?this.options.missingKeyHandler(w,h,$,ae,P,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(w,h,$,ae,P,o),this.emit("missingKey",w,h,$,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Y?fe.forEach(w=>{const $=this.pluralResolver.getSuffixes(w,o);E&&o[`defaultValue${this.options.pluralSeparator}zero`]&&$.indexOf(`${this.options.pluralSeparator}zero`)<0&&$.push(`${this.options.pluralSeparator}zero`),$.forEach(ee=>{re([w],p+ee,o[`defaultValue${ee}`]||H)})}):re(fe,p,H))}N=this.extendTranslation(N,r,o,j,i),ce&&N===p&&this.options.appendNamespaceToMissingKey&&(N=`${h}${v}${p}`),(ce||se)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${v}${p}`:p,se?N:void 0,o))}return d?(j.res=N,j.usedParams=this.getUsedParamsDetails(o),j):N}extendTranslation(r,l,i,o,d){if(this.i18nFormat?.parse)r=this.i18nFormat.parse(r,{...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(r)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const b=r.match(this.interpolator.nestingRegexp);h=b&&b.length}let v=i.replace&&!De(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),r=this.interpolator.interpolate(r,v,i.lng||this.language||o.usedLng,i),g){const b=r.match(this.interpolator.nestingRegexp),_=b&&b.length;h<_&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(r=this.interpolator.nest(r,(...b)=>d?.[0]===b[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${b[0]} in key: ${l[0]}`),null):this.translate(...b,l),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=De(m)?[m]:m;return r!=null&&p?.length&&i.applyPostProcessor!==!1&&(r=rx.handle(p,r,l,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),r}resolve(r,l={}){let i,o,d,m,p;return De(r)&&(r=[r]),r.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,l),v=h.key;o=v;let b=h.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const _=l.count!==void 0&&!De(l.count),j=_&&!l.ordinal&&l.count===0,N=l.context!==void 0&&(De(l.context)||typeof l.context=="number")&&l.context!=="",C=l.lngs?l.lngs:this.languageUtils.toResolveHierarchy(l.lng||this.language,l.fallbackLng);b.forEach(z=>{this.isValidLookup(i)||(p=z,!zp[`${C[0]}-${z}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(zp[`${C[0]}-${z}`]=!0,this.logger.warn(`key "${o}" for languages "${C.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!!!")),C.forEach(q=>{if(this.isValidLookup(i))return;m=q;const Q=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(Q,v,q,z,l);else{let Y;_&&(Y=this.pluralResolver.getSuffix(q,l.count,l));const te=`${this.options.pluralSeparator}zero`,Z=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(l.ordinal&&Y.indexOf(Z)===0&&Q.push(v+Y.replace(Z,this.options.pluralSeparator)),Q.push(v+Y),j&&Q.push(v+te)),N){const G=`${v}${this.options.contextSeparator||"_"}${l.context}`;Q.push(G),_&&(l.ordinal&&Y.indexOf(Z)===0&&Q.push(G+Y.replace(Z,this.options.pluralSeparator)),Q.push(G+Y),j&&Q.push(G+te))}}let V;for(;V=Q.pop();)this.isValidLookup(i)||(d=V,i=this.getResource(q,z,V,l))}))})}),{res:i,usedKey:o,exactUsedKey:d,usedLng:m,usedNS:p}}isValidLookup(r){return r!==void 0&&!(!this.options.returnNull&&r===null)&&!(!this.options.returnEmptyString&&r==="")}getResource(r,l,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(r,l,i,o):this.resourceStore.getResource(r,l,i,o)}getUsedParamsDetails(r={}){const l=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=r.replace&&!De(r.replace);let o=i?r.replace:r;if(i&&typeof r.count<"u"&&(o.count=r.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const d of l)delete o[d]}return o}static hasDefaultValue(r){const l="defaultValue";for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&l===i.substring(0,l.length)&&r[i]!==void 0)return!0;return!1}}class Op{constructor(r){this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=fn.create("languageUtils")}getScriptPartFromCode(r){if(r=Ul(r),!r||r.indexOf("-")<0)return null;const l=r.split("-");return l.length===2||(l.pop(),l[l.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(l.join("-"))}getLanguagePartFromCode(r){if(r=Ul(r),!r||r.indexOf("-")<0)return r;const l=r.split("-");return this.formatLanguageCode(l[0])}formatLanguageCode(r){if(De(r)&&r.indexOf("-")>-1){let l;try{l=Intl.getCanonicalLocales(r)[0]}catch{}return l&&this.options.lowerCaseLng&&(l=l.toLowerCase()),l||(this.options.lowerCaseLng?r.toLowerCase():r)}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}isSupportedCode(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}getBestMatchFromCodes(r){if(!r)return null;let l;return r.forEach(i=>{if(l)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(l=o)}),!l&&this.options.supportedLngs&&r.forEach(i=>{if(l)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return l=o;const d=this.getLanguagePartFromCode(i);if(this.isSupportedCode(d))return l=d;l=this.options.supportedLngs.find(m=>{if(m===d)return m;if(!(m.indexOf("-")<0&&d.indexOf("-")<0)&&(m.indexOf("-")>0&&d.indexOf("-")<0&&m.substring(0,m.indexOf("-"))===d||m.indexOf(d)===0&&d.length>1))return m})}),l||(l=this.getFallbackCodes(this.options.fallbackLng)[0]),l}getFallbackCodes(r,l){if(!r)return[];if(typeof r=="function"&&(r=r(l)),De(r)&&(r=[r]),Array.isArray(r))return r;if(!l)return r.default||[];let i=r[l];return i||(i=r[this.getScriptPartFromCode(l)]),i||(i=r[this.formatLanguageCode(l)]),i||(i=r[this.getLanguagePartFromCode(l)]),i||(i=r.default),i||[]}toResolveHierarchy(r,l){const i=this.getFallbackCodes((l===!1?[]:l)||this.options.fallbackLng||[],r),o=[],d=m=>{m&&(this.isSupportedCode(m)?o.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return De(r)&&(r.indexOf("-")>-1||r.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(r))):De(r)&&d(this.formatLanguageCode(r)),i.forEach(m=>{o.indexOf(m)<0&&d(this.formatLanguageCode(m))}),o}}const Dp={zero:0,one:1,two:2,few:3,many:4,other:5},Ap={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class $v{constructor(r,l={}){this.languageUtils=r,this.options=l,this.logger=fn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(r,l={}){const i=Ul(r==="dev"?"en":r),o=l.ordinal?"ordinal":"cardinal",d=JSON.stringify({cleanedCode:i,type:o});if(d in this.pluralRulesCache)return this.pluralRulesCache[d];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!"),Ap;if(!r.match(/-|_/))return Ap;const g=this.languageUtils.getLanguagePartFromCode(r);m=this.getRule(g,l)}return this.pluralRulesCache[d]=m,m}needsPlural(r,l={}){let i=this.getRule(r,l);return i||(i=this.getRule("dev",l)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(r,l,i={}){return this.getSuffixes(r,i).map(o=>`${l}${o}`)}getSuffixes(r,l={}){let i=this.getRule(r,l);return i||(i=this.getRule("dev",l)),i?i.resolvedOptions().pluralCategories.sort((o,d)=>Dp[o]-Dp[d]).map(o=>`${this.options.prepend}${l.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(r,l,i={}){const o=this.getRule(r,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(l)}`:(this.logger.warn(`no plural rule found for: ${r}`),this.getSuffix("dev",l,i))}}const Mp=(n,r,l,i=".",o=!0)=>{let d=zv(n,r,l);return!d&&o&&De(l)&&(d=cd(n,l,i),d===void 0&&(d=cd(r,l,i))),d},$u=n=>n.replace(/\$/g,"$$$$");class Lp{constructor(r={}){this.logger=fn.create("interpolator"),this.options=r,this.format=r?.interpolation?.format||(l=>l),this.init(r)}init(r={}){r.interpolation||(r.interpolation={escapeValue:!0});const{escape:l,escapeValue:i,useRawValueToEscape:o,prefix:d,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:N,nestingSuffixEscaped:C,nestingOptionsSeparator:z,maxReplaces:q,alwaysFormat:Q}=r.interpolation;this.escape=l!==void 0?l:Dv,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=d?Or(d):m||"{{",this.suffix=p?Or(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=_?Or(_):j||Or("$t("),this.nestingSuffix=N?Or(N):C||Or(")"),this.nestingOptionsSeparator=z||",",this.maxReplaces=q||1e3,this.alwaysFormat=Q!==void 0?Q:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const r=(l,i)=>l?.source===i?(l.lastIndex=0,l):new RegExp(i,"g");this.regexp=r(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=r(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=r(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(r,l,i,o){let d,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=j=>{if(j.indexOf(this.formatSeparator)<0){const q=Mp(l,g,j,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(q,void 0,i,{...o,...l,interpolationkey:j}):q}const N=j.split(this.formatSeparator),C=N.shift().trim(),z=N.join(this.formatSeparator).trim();return this.format(Mp(l,g,C,this.options.keySeparator,this.options.ignoreJSONStructure),z,i,{...o,...l,interpolationkey:C})};this.resetRegExp();const v=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:j=>$u(j)},{regex:this.regexp,safeValue:j=>this.escapeValue?$u(this.escape(j)):$u(j)}].forEach(j=>{for(p=0;d=j.regex.exec(r);){const N=d[1].trim();if(m=h(N),m===void 0)if(typeof v=="function"){const z=v(r,d,o);m=De(z)?z:""}else if(o&&Object.prototype.hasOwnProperty.call(o,N))m="";else if(b){m=d[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${r}`),m="";else!De(m)&&!this.useRawValueToEscape&&(m=Ep(m));const C=j.safeValue(m);if(r=r.replace(d[0],C),b?(j.regex.lastIndex+=m.length,j.regex.lastIndex-=d[0].length):j.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),r}nest(r,l,i={}){let o,d,m;const p=(g,h)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const b=g.split(new RegExp(`${Or(v)}[ ]*{`));let _=`{${b[1]}`;g=b[0],_=this.interpolate(_,m);const j=_.match(/'/g),N=_.match(/"/g);((j?.length??0)%2===0&&!N||(N?.length??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{m=JSON.parse(_),h&&(m={...h,...m})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,C),`${g}${v}${_}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;o=this.nestingRegexp.exec(r);){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)),d=l(p.call(this,o[1].trim(),m),m),d&&o[0]===r&&!De(d))return d;De(d)||(d=Ep(d)),d||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${r}`),d=""),g.length&&(d=g.reduce((v,b)=>this.format(v,b,i.lng,{...i,interpolationkey:o[1].trim()}),d.trim())),r=r.replace(o[0],d),this.regexp.lastIndex=0}return r}}const qv=n=>{let r=n.toLowerCase().trim();const l={};if(n.indexOf("(")>-1){const i=n.split("(");r=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);r==="currency"&&o.indexOf(":")<0?l.currency||(l.currency=o.trim()):r==="relativetime"&&o.indexOf(":")<0?l.range||(l.range=o.trim()):o.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),v=p.trim();l[v]||(l[v]=h),h==="false"&&(l[v]=!1),h==="true"&&(l[v]=!0),isNaN(h)||(l[v]=parseInt(h,10))}})}return{formatName:r,formatOptions:l}},Up=n=>{const r={};return(l,i,o)=>{let d=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(d={...d,[o.interpolationkey]:void 0});const m=i+JSON.stringify(d);let p=r[m];return p||(p=n(Ul(i),o),r[m]=p),p(l)}},Yv=n=>(r,l,i)=>n(Ul(l),i)(r);class Gv{constructor(r={}){this.logger=fn.create("formatter"),this.options=r,this.init(r)}init(r,l={interpolation:{}}){this.formatSeparator=l.interpolation.formatSeparator||",";const i=l.cacheInBuiltFormats?Up:Yv;this.formats={number:i((o,d)=>{const m=new Intl.NumberFormat(o,{...d});return p=>m.format(p)}),currency:i((o,d)=>{const m=new Intl.NumberFormat(o,{...d,style:"currency"});return p=>m.format(p)}),datetime:i((o,d)=>{const m=new Intl.DateTimeFormat(o,{...d});return p=>m.format(p)}),relativetime:i((o,d)=>{const m=new Intl.RelativeTimeFormat(o,{...d});return p=>m.format(p,d.range||"day")}),list:i((o,d)=>{const m=new Intl.ListFormat(o,{...d});return p=>m.format(p)})}}add(r,l){this.formats[r.toLowerCase().trim()]=l}addCached(r,l){this.formats[r.toLowerCase().trim()]=Up(l)}format(r,l,i,o={}){const d=l.split(this.formatSeparator);if(d.length>1&&d[0].indexOf("(")>1&&d[0].indexOf(")")<0&&d.find(p=>p.indexOf(")")>-1)){const p=d.findIndex(g=>g.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,p)].join(this.formatSeparator)}return d.reduce((p,g)=>{const{formatName:h,formatOptions:v}=qv(g);if(this.formats[h]){let b=p;try{const _=o?.formatParams?.[o.interpolationkey]||{},j=_.locale||_.lng||o.locale||o.lng||i;b=this.formats[h](p,j,{...v,...o,..._})}catch(_){this.logger.warn(_)}return b}else this.logger.warn(`there was no format function for ${h}`);return p},r)}}const Vv=(n,r)=>{n.pending[r]!==void 0&&(delete n.pending[r],n.pendingCount--)};class Kv extends So{constructor(r,l,i,o={}){super(),this.backend=r,this.store=l,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=fn.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(r,l,i,o){const d={},m={},p={},g={};return r.forEach(h=>{let v=!0;l.forEach(b=>{const _=`${h}|${b}`;!i.reload&&this.store.hasResourceBundle(h,b)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?m[_]===void 0&&(m[_]=!0):(this.state[_]=1,v=!1,m[_]===void 0&&(m[_]=!0),d[_]===void 0&&(d[_]=!0),g[b]===void 0&&(g[b]=!0)))}),v||(p[h]=!0)}),(Object.keys(d).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(d),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(r,l,i){const o=r.split("|"),d=o[0],m=o[1];l&&this.emit("failedLoading",d,m,l),!l&&i&&this.store.addResourceBundle(d,m,i,void 0,void 0,{skipCopy:!0}),this.state[r]=l?-1:2,l&&i&&(this.state[r]=0);const p={};this.queue.forEach(g=>{Tv(g.loaded,[d],m),Vv(g,r),l&&g.errors.push(l),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const v=g.loaded[h];v.length&&v.forEach(b=>{p[h][b]===void 0&&(p[h][b]=!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(r,l,i,o=0,d=this.retryTimeout,m){if(!r.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:l,fcName:i,tried:o,wait:d,callback:m});return}this.readingCalls++;const p=(h,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(h&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,r,l,i,o+1,d*2,m)},d);return}m(h,v)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(r,l);h&&typeof h.then=="function"?h.then(v=>p(null,v)).catch(p):p(null,h)}catch(h){p(h)}return}return g(r,l,p)}prepareLoading(r,l,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();De(r)&&(r=this.languageUtils.toResolveHierarchy(r)),De(l)&&(l=[l]);const d=this.queueLoad(r,l,i,o);if(!d.toLoad.length)return d.pending.length||o(),null;d.toLoad.forEach(m=>{this.loadOne(m)})}load(r,l,i){this.prepareLoading(r,l,{},i)}reload(r,l,i){this.prepareLoading(r,l,{reload:!0},i)}loadOne(r,l=""){const i=r.split("|"),o=i[0],d=i[1];this.read(o,d,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${l}loading namespace ${d} for language ${o} failed`,m),!m&&p&&this.logger.log(`${l}loaded namespace ${d} for language ${o}`,p),this.loaded(r,m,p)})}saveMissing(r,l,i,o,d,m={},p=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(l)){this.logger.warn(`did not save key "${i}" as the namespace "${l}" 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:d},h=this.backend.create.bind(this.backend);if(h.length<6)try{let v;h.length===5?v=h(r,l,i,o,g):v=h(r,l,i,o),v&&typeof v.then=="function"?v.then(b=>p(null,b)).catch(p):p(null,v)}catch(v){p(v)}else h(r,l,i,o,p,g)}!r||!r[0]||this.store.addResource(r[0],l,i,o)}}}const qu=()=>({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 r={};if(typeof n[1]=="object"&&(r=n[1]),De(n[1])&&(r.defaultValue=n[1]),De(n[2])&&(r.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const l=n[3]||n[2];Object.keys(l).forEach(i=>{r[i]=l[i]})}return r},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Hp=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),so=()=>{},Xv=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(l=>{typeof n[l]=="function"&&(n[l]=n[l].bind(n))})},lx="__i18next_supportNoticeShown",Qv=()=>typeof globalThis<"u"&&!!globalThis[lx],Fv=()=>{typeof globalThis<"u"&&(globalThis[lx]=!0)},Zv=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(r=>r?.name?.indexOf("Locize")>0||r?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(r=>r?.projectId));class Ml extends So{constructor(r={},l){if(super(),this.options=Hp(r),this.services={},this.logger=fn,this.modules={external:[]},Xv(this),l&&!this.isInitialized&&!r.isClone){if(!this.options.initAsync)return this.init(r,l),this;setTimeout(()=>{this.init(r,l)},0)}}init(r={},l){this.isInitializing=!0,typeof r=="function"&&(l=r,r={}),r.defaultNS==null&&r.ns&&(De(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=qu();this.options={...i,...this.options,...Hp(r)},this.options.interpolation={...i.interpolation,...this.options.interpolation},r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Zv(this)&&!Qv()&&(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 💙"),Fv());const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?fn.init(o(this.modules.logger),this.options):fn.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=Gv;const v=new Op(this.options);this.store=new Tp(this.options.resources,this.options);const b=this.services;b.logger=fn,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new $v(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)&&(b.formatter=o(h),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new Lp(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new Kv(o(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.languageDetector&&(b.languageDetector=o(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=o(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new vo(this.services,this.options),this.translator.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.external.forEach(j=>{j.init&&j.init(this)})}if(this.format=this.options.interpolation.format,l||(l=so),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=wl(),g=()=>{const h=(v,b)=>{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(b),l(v,b)};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(r,l=so){let i=l;const o=De(r)?r:this.language;if(typeof r=="function"&&(i=r),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const d=[],m=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(h=>{h!=="cimode"&&d.indexOf(h)<0&&d.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(d,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(p)})}else i(null)}reloadResources(r,l,i){const o=wl();return typeof r=="function"&&(i=r,r=void 0),typeof l=="function"&&(i=l,l=void 0),r||(r=this.languages),l||(l=this.options.ns),i||(i=so),this.services.backendConnector.reload(r,l,d=>{o.resolve(),i(d)}),o}use(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&rx.addPostProcessor(r),r.type==="formatter"&&(this.modules.formatter=r),r.type==="3rdParty"&&this.modules.external.push(r),this}setResolvedLanguage(r){if(!(!r||!this.languages)&&!(["cimode","dev"].indexOf(r)>-1)){for(let l=0;l<this.languages.length;l++){const i=this.languages[l];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(r)<0&&this.store.hasLanguageSomeTranslations(r)&&(this.resolvedLanguage=r,this.languages.unshift(r))}}changeLanguage(r,l){this.isLanguageChangingTo=r;const i=wl();this.emit("languageChanging",r);const o=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},d=(p,g)=>{g?this.isLanguageChangingTo===r&&(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)),l&&l(p,(...h)=>this.t(...h))},m=p=>{!r&&!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=>{d(v,h)})};return!r&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!r&&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(r),i}getFixedT(r,l,i){const o=(d,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([d,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(d)?v=d.map(b=>(typeof b=="function"&&(b=ud(b,{...this.options,...m})),`${g.keyPrefix}${h}${b}`)):(typeof d=="function"&&(d=ud(d,{...this.options,...m})),v=g.keyPrefix?`${g.keyPrefix}${h}${d}`:d),this.t(v,g)};return De(r)?o.lng=r:o.lngs=r,o.ns=l,o.keyPrefix=i,o}t(...r){return this.translator?.translate(...r)}exists(...r){return this.translator?.exists(...r)}setDefaultNamespace(r){this.options.defaultNS=r}hasLoadedNamespace(r,l={}){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=l.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,d=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(l.precheck){const p=l.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(i,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,r)&&(!o||m(d,r)))}loadNamespaces(r,l){const i=wl();return this.options.ns?(De(r)&&(r=[r]),r.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),l&&l(o)}),i):(l&&l(),Promise.resolve())}loadLanguages(r,l){const i=wl();De(r)&&(r=[r]);const o=this.options.preload||[],d=r.filter(m=>o.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return d.length?(this.options.preload=o.concat(d),this.loadResources(m=>{i.resolve(),l&&l(m)}),i):(l&&l(),Promise.resolve())}dir(r){if(r||(r=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!r)return"rtl";try{const o=new Intl.Locale(r);if(o&&o.getTextInfo){const d=o.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const l=["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 Op(qu());return r.toLowerCase().indexOf("-latn")>1?"ltr":l.indexOf(i.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(r={},l){const i=new Ml(r,l);return i.createInstance=Ml.createInstance,i}cloneInstance(r={},l=so){const i=r.forkResourceStore;i&&delete r.forkResourceStore;const o={...this.options,...r,isClone:!0},d=new Ml(o);if((r.debug!==void 0||r.prefix!==void 0)&&(d.logger=d.logger.clone(r)),["store","services","language"].forEach(p=>{d[p]=this[p]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},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,b)=>(v[b]={...g[h][b]},v),g[h]),g),{});d.store=new Tp(p,o),d.services.resourceStore=d.store}if(r.interpolation){const g={...qu().interpolation,...this.options.interpolation,...r.interpolation},h={...o,interpolation:g};d.services.interpolator=new Lp(h)}return d.translator=new vo(d.services,o),d.translator.on("*",(p,...g)=>{d.emit(p,...g)}),d.init(o,l),d.translator.options=o,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const fa=Ml.createInstance();fa.createInstance;fa.dir;fa.init;fa.loadResources;fa.reloadResources;fa.use;fa.changeLanguage;fa.getFixedT;fa.t;fa.exists;fa.setDefaultNamespace;fa.hasLoadedNamespace;fa.loadNamespaces;fa.loadLanguages;var Yu={exports:{}},Me={};var Bp;function Jv(){if(Bp)return Me;Bp=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=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"),b=Symbol.for("react.activity"),_=Symbol.iterator;function j(w){return w===null||typeof w!="object"?null:(w=_&&w[_]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,z={};function q(w,$,ee){this.props=w,this.context=$,this.refs=z,this.updater=ee||N}q.prototype.isReactComponent={},q.prototype.setState=function(w,$){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,$,"setState")},q.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function Q(){}Q.prototype=q.prototype;function V(w,$,ee){this.props=w,this.context=$,this.refs=z,this.updater=ee||N}var Y=V.prototype=new Q;Y.constructor=V,C(Y,q.prototype),Y.isPureReactComponent=!0;var te=Array.isArray;function Z(){}var G={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function H(w,$,ee){var ae=ee.ref;return{$$typeof:n,type:w,key:$,ref:ae!==void 0?ae:null,props:ee}}function W(w,$){return H(w.type,$,w.props)}function de(w){return typeof w=="object"&&w!==null&&w.$$typeof===n}function le(w){var $={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(ee){return $[ee]})}var se=/\/+/g;function ce(w,$){return typeof w=="object"&&w!==null&&w.key!=null?le(""+w.key):$.toString(36)}function ge(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(Z,Z):(w.status="pending",w.then(function($){w.status==="pending"&&(w.status="fulfilled",w.value=$)},function($){w.status==="pending"&&(w.status="rejected",w.reason=$)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function A(w,$,ee,ae,xe){var ve=typeof w;(ve==="undefined"||ve==="boolean")&&(w=null);var ze=!1;if(w===null)ze=!0;else switch(ve){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(w.$$typeof){case n:case r:ze=!0;break;case v:return ze=w._init,A(ze(w._payload),$,ee,ae,xe)}}if(ze)return xe=xe(w),ze=ae===""?"."+ce(w,0):ae,te(xe)?(ee="",ze!=null&&(ee=ze.replace(se,"$&/")+"/"),A(xe,$,ee,"",function(ea){return ea})):xe!=null&&(de(xe)&&(xe=W(xe,ee+(xe.key==null||w&&w.key===xe.key?"":(""+xe.key).replace(se,"$&/")+"/")+ze)),$.push(xe)),1;ze=0;var Pe=ae===""?".":ae+":";if(te(w))for(var Xe=0;Xe<w.length;Xe++)ae=w[Xe],ve=Pe+ce(ae,Xe),ze+=A(ae,$,ee,ve,xe);else if(Xe=j(w),typeof Xe=="function")for(w=Xe.call(w),Xe=0;!(ae=w.next()).done;)ae=ae.value,ve=Pe+ce(ae,Xe++),ze+=A(ae,$,ee,ve,xe);else if(ve==="object"){if(typeof w.then=="function")return A(ge(w),$,ee,ae,xe);throw $=String(w),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ze}function P(w,$,ee){if(w==null)return w;var ae=[],xe=0;return A(w,ae,"","",function(ve){return $.call(ee,ve,xe++)}),ae}function fe(w){if(w._status===-1){var $=w._result;$=$(),$.then(function(ee){(w._status===0||w._status===-1)&&(w._status=1,w._result=ee)},function(ee){(w._status===0||w._status===-1)&&(w._status=2,w._result=ee)}),w._status===-1&&(w._status=0,w._result=$)}if(w._status===1)return w._result.default;throw w._result}var me=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},re={map:P,forEach:function(w,$,ee){P(w,function(){$.apply(this,arguments)},ee)},count:function(w){var $=0;return P(w,function(){$++}),$},toArray:function(w){return P(w,function($){return $})||[]},only:function(w){if(!de(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Me.Activity=b,Me.Children=re,Me.Component=q,Me.Fragment=l,Me.Profiler=o,Me.PureComponent=V,Me.StrictMode=i,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,Me.__COMPILER_RUNTIME={__proto__:null,c:function(w){return G.H.useMemoCache(w)}},Me.cache=function(w){return function(){return w.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(w,$,ee){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var ae=C({},w.props),xe=w.key;if($!=null)for(ve in $.key!==void 0&&(xe=""+$.key),$)!E.call($,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&$.ref===void 0||(ae[ve]=$[ve]);var ve=arguments.length-2;if(ve===1)ae.children=ee;else if(1<ve){for(var ze=Array(ve),Pe=0;Pe<ve;Pe++)ze[Pe]=arguments[Pe+2];ae.children=ze}return H(w.type,xe,ae)},Me.createContext=function(w){return w={$$typeof:m,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:d,_context:w},w},Me.createElement=function(w,$,ee){var ae,xe={},ve=null;if($!=null)for(ae in $.key!==void 0&&(ve=""+$.key),$)E.call($,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(xe[ae]=$[ae]);var ze=arguments.length-2;if(ze===1)xe.children=ee;else if(1<ze){for(var Pe=Array(ze),Xe=0;Xe<ze;Xe++)Pe[Xe]=arguments[Xe+2];xe.children=Pe}if(w&&w.defaultProps)for(ae in ze=w.defaultProps,ze)xe[ae]===void 0&&(xe[ae]=ze[ae]);return H(w,ve,xe)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(w){return{$$typeof:p,render:w}},Me.isValidElement=de,Me.lazy=function(w){return{$$typeof:v,_payload:{_status:-1,_result:w},_init:fe}},Me.memo=function(w,$){return{$$typeof:h,type:w,compare:$===void 0?null:$}},Me.startTransition=function(w){var $=G.T,ee={};G.T=ee;try{var ae=w(),xe=G.S;xe!==null&&xe(ee,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(Z,me)}catch(ve){me(ve)}finally{$!==null&&ee.types!==null&&($.types=ee.types),G.T=$}},Me.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},Me.use=function(w){return G.H.use(w)},Me.useActionState=function(w,$,ee){return G.H.useActionState(w,$,ee)},Me.useCallback=function(w,$){return G.H.useCallback(w,$)},Me.useContext=function(w){return G.H.useContext(w)},Me.useDebugValue=function(){},Me.useDeferredValue=function(w,$){return G.H.useDeferredValue(w,$)},Me.useEffect=function(w,$){return G.H.useEffect(w,$)},Me.useEffectEvent=function(w){return G.H.useEffectEvent(w)},Me.useId=function(){return G.H.useId()},Me.useImperativeHandle=function(w,$,ee){return G.H.useImperativeHandle(w,$,ee)},Me.useInsertionEffect=function(w,$){return G.H.useInsertionEffect(w,$)},Me.useLayoutEffect=function(w,$){return G.H.useLayoutEffect(w,$)},Me.useMemo=function(w,$){return G.H.useMemo(w,$)},Me.useOptimistic=function(w,$){return G.H.useOptimistic(w,$)},Me.useReducer=function(w,$,ee){return G.H.useReducer(w,$,ee)},Me.useRef=function(w){return G.H.useRef(w)},Me.useState=function(w){return G.H.useState(w)},Me.useSyncExternalStore=function(w,$,ee){return G.H.useSyncExternalStore(w,$,ee)},Me.useTransition=function(){return G.H.useTransition()},Me.version="19.2.4",Me}var $p;function jo(){return $p||($p=1,Yu.exports=Jv()),Yu.exports}var y=jo();const Rs=wv(y),Pv=Nv({__proto__:null,default:Rs},[y]),Iv=(n,r,l,i)=>{const o=[l,{code:r,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);Lr(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},qp={},ix=(n,r,l,i)=>{Lr(l)&&qp[l]||(Lr(l)&&(qp[l]=new Date),Iv(n,r,l,i))},ox=(n,r)=>()=>{if(n.isInitialized)r();else{const l=()=>{setTimeout(()=>{n.off("initialized",l)},0),r()};n.on("initialized",l)}},dd=(n,r,l)=>{n.loadNamespaces(r,ox(n,l))},Yp=(n,r,l,i)=>{if(Lr(l)&&(l=[l]),n.options.preload&&n.options.preload.indexOf(r)>-1)return dd(n,l,i);l.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(r,ox(n,i))},Wv=(n,r,l={})=>!r.languages||!r.languages.length?(ix(r,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:r.languages}),!0):r.hasLoadedNamespace(n,{lng:l.lng,precheck:(i,o)=>{if(l.bindI18n&&l.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),Lr=n=>typeof n=="string",e0=n=>typeof n=="object"&&n!==null,t0=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,a0={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},n0=n=>a0[n],r0=n=>n.replace(t0,n0);let fd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:r0,transDefaultProps:void 0};const s0=(n={})=>{fd={...fd,...n}},l0=()=>fd;let cx;const i0=n=>{cx=n},o0=()=>cx,c0={type:"3rdParty",init(n){s0(n.options.react),i0(n)}},u0=y.createContext();class d0{constructor(){this.usedNamespaces={}}addUsedNamespaces(r){r.forEach(l=>{this.usedNamespaces[l]||(this.usedNamespaces[l]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Gu={exports:{}},Vu={};var Gp;function f0(){if(Gp)return Vu;Gp=1;var n=jo();function r(b,_){return b===_&&(b!==0||1/b===1/_)||b!==b&&_!==_}var l=typeof Object.is=="function"?Object.is:r,i=n.useState,o=n.useEffect,d=n.useLayoutEffect,m=n.useDebugValue;function p(b,_){var j=_(),N=i({inst:{value:j,getSnapshot:_}}),C=N[0].inst,z=N[1];return d(function(){C.value=j,C.getSnapshot=_,g(C)&&z({inst:C})},[b,j,_]),o(function(){return g(C)&&z({inst:C}),b(function(){g(C)&&z({inst:C})})},[b]),m(j),j}function g(b){var _=b.getSnapshot;b=b.value;try{var j=_();return!l(b,j)}catch{return!0}}function h(b,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return Vu.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,Vu}var Vp;function m0(){return Vp||(Vp=1,Gu.exports=f0()),Gu.exports}var h0=m0();const p0=(n,r)=>Lr(r)?r:e0(r)&&Lr(r.defaultValue)?r.defaultValue:Array.isArray(n)?n[n.length-1]:n,g0={t:p0,ready:!1},x0=()=>()=>{},Ne=(n,r={})=>{const{i18n:l}=r,{i18n:i,defaultNS:o}=y.useContext(u0)||{},d=l||i||o0();d&&!d.reportNamespaces&&(d.reportNamespaces=new d0),d||ix(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const m=y.useMemo(()=>({...l0(),...d?.options?.react,...r}),[d,r]),{useSuspense:p,keyPrefix:g}=m,h=o||d?.options?.defaultNS,v=Lr(h)?[h]:h||["translation"],b=y.useMemo(()=>v,v);d?.reportNamespaces?.addUsedNamespaces?.(b);const _=y.useRef(0),j=y.useCallback(H=>{if(!d)return x0;const{bindI18n:W,bindI18nStore:de}=m,le=()=>{_.current+=1,H()};return W&&d.on(W,le),de&&d.store.on(de,le),()=>{W&&W.split(" ").forEach(se=>d.off(se,le)),de&&de.split(" ").forEach(se=>d.store.off(se,le))}},[d,m]),N=y.useRef(),C=y.useCallback(()=>{if(!d)return g0;const H=!!(d.isInitialized||d.initializedStoreOnce)&&b.every(ge=>Wv(ge,d,m)),W=r.lng||d.language,de=_.current,le=N.current;if(le&&le.ready===H&&le.lng===W&&le.keyPrefix===g&&le.revision===de)return le;const ce={t:d.getFixedT(W,m.nsMode==="fallback"?b:b[0],g),ready:H,lng:W,keyPrefix:g,revision:de};return N.current=ce,ce},[d,b,g,m,r.lng]),[z,q]=y.useState(0),{t:Q,ready:V}=h0.useSyncExternalStore(j,C,C);y.useEffect(()=>{if(d&&!V&&!p){const H=()=>q(W=>W+1);r.lng?Yp(d,r.lng,b,H):dd(d,b,H)}},[d,r.lng,b,V,p,z]);const Y=d||{},te=y.useRef(null),Z=y.useRef(),G=H=>{const W=Object.getOwnPropertyDescriptors(H);W.__original&&delete W.__original;const de=Object.create(Object.getPrototypeOf(H),W);if(!Object.prototype.hasOwnProperty.call(de,"__original"))try{Object.defineProperty(de,"__original",{value:H,writable:!1,enumerable:!1,configurable:!1})}catch{}return de},E=y.useMemo(()=>{const H=Y,W=H?.language;let de=H;H&&(te.current&&te.current.__original===H?Z.current!==W?(de=G(H),te.current=de,Z.current=W):de=te.current:(de=G(H),te.current=de,Z.current=W));const le=[Q,de,V];return le.t=Q,le.i18n=de,le.ready=V,le},[Q,Y,V,Y.resolvedLanguage,Y.language,Y.languages]);if(d&&p&&!V)throw new Promise(H=>{const W=()=>H();r.lng?Yp(d,r.lng,b,W):dd(d,b,W)});return E},{slice:y0,forEach:b0}=[];function v0(n){return b0.call(y0.call(arguments,1),r=>{if(r)for(const l in r)n[l]===void 0&&(n[l]=r[l])}),n}function _0(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(l=>l.test(n))}const Kp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,S0=function(n,r){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(r);let d=`${n}=${o}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");d+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Kp.test(i.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${i.domain}`}if(i.path){if(!Kp.test(i.path))throw new TypeError("option path is invalid");d+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");d+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(d+="; HttpOnly"),i.secure&&(d+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(d+="; Partitioned"),d},Xp={create(n,r,l,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};l&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+l*60*1e3)),i&&(o.domain=i),document.cookie=S0(n,r,o)},read(n){const r=`${n}=`,l=document.cookie.split(";");for(let i=0;i<l.length;i++){let o=l[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(r)===0)return o.substring(r.length,o.length)}return null},remove(n,r){this.create(n,"",-1,r)}};var j0={name:"cookie",lookup(n){let{lookupCookie:r}=n;if(r&&typeof document<"u")return Xp.read(r)||void 0},cacheUserLanguage(n,r){let{lookupCookie:l,cookieMinutes:i,cookieDomain:o,cookieOptions:d}=r;l&&typeof document<"u"&&Xp.create(l,n,i,o,d)}},N0={name:"querystring",lookup(n){let{lookupQuerystring:r}=n,l;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 d=i.substring(1).split("&");for(let m=0;m<d.length;m++){const p=d[m].indexOf("=");p>0&&d[m].substring(0,p)===r&&(l=d[m].substring(p+1))}}return l}},w0={name:"hash",lookup(n){let{lookupHash:r,lookupFromHashIndex:l}=n,i;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const d=o.substring(1);if(r){const m=d.split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===r&&(i=m[p].substring(g+1))}}if(i)return i;if(!i&&l>-1){const m=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(m)?m[typeof l=="number"?l:0]?.replace("/",""):void 0}}}return i}};let Ns=null;const Qp=()=>{if(Ns!==null)return Ns;try{if(Ns=typeof window<"u"&&window.localStorage!==null,!Ns)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{Ns=!1}return Ns};var E0={name:"localStorage",lookup(n){let{lookupLocalStorage:r}=n;if(r&&Qp())return window.localStorage.getItem(r)||void 0},cacheUserLanguage(n,r){let{lookupLocalStorage:l}=r;l&&Qp()&&window.localStorage.setItem(l,n)}};let ws=null;const Fp=()=>{if(ws!==null)return ws;try{if(ws=typeof window<"u"&&window.sessionStorage!==null,!ws)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{ws=!1}return ws};var C0={name:"sessionStorage",lookup(n){let{lookupSessionStorage:r}=n;if(r&&Fp())return window.sessionStorage.getItem(r)||void 0},cacheUserLanguage(n,r){let{lookupSessionStorage:l}=r;l&&Fp()&&window.sessionStorage.setItem(l,n)}},R0={name:"navigator",lookup(n){const r=[];if(typeof navigator<"u"){const{languages:l,userLanguage:i,language:o}=navigator;if(l)for(let d=0;d<l.length;d++)r.push(l[d]);i&&r.push(i),o&&r.push(o)}return r.length>0?r:void 0}},k0={name:"htmlTag",lookup(n){let{htmlTag:r}=n,l;const i=r||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(l=i.getAttribute("lang")),l}},T0={name:"path",lookup(n){let{lookupFromPathIndex:r}=n;if(typeof window>"u")return;const l=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?l[typeof r=="number"?r:0]?.replace("/",""):void 0}},z0={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:r}=n;const l=typeof r=="number"?r+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[l]}};let ux=!1;try{document.cookie,ux=!0}catch{}const dx=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ux||dx.splice(1,1);const O0=()=>({order:dx,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class fx{constructor(r){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(r,l)}init(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=v0(l,this.options||{},O0()),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(j0),this.addDetector(N0),this.addDetector(E0),this.addDetector(C0),this.addDetector(R0),this.addDetector(k0),this.addDetector(T0),this.addDetector(z0),this.addDetector(w0)}addDetector(r){return this.detectors[r.name]=r,this}detect(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,l=[];return r.forEach(i=>{if(this.detectors[i]){let o=this.detectors[i].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(l=l.concat(o))}}),l=l.filter(i=>i!=null&&!_0(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?l:l.length>0?l[0]:null}cacheUserLanguage(r){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;l&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||l.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(r,this.options)}))}}fx.type="languageDetector";const D0={"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","login.title":"SIGN IN","login.provider_cta":"Sign in with {{name}}","login.loading":"LOADING...","login.authenticating":"AUTHENTICATING...","login.or":"OR","login.test_account":"Test Account","login.error":"Failed to load login options","login.retry":"Retry","user.menu.connect_source":"Connect Source","user.menu.sign_out":"Sign out","api_keys.title":"API Keys","api_keys.description":"API Keys for programmatic access to C4A API (AI Agent, CLI, CI/CD)","api_keys.create":"Create API Key","api_keys.created":"API Key Created","api_keys.copy_warning":"Copy now, this key won't be shown again.","api_keys.copy":"Copy","api_keys.copied":"Copied!","api_keys.done":"Done","api_keys.empty.title":"No API Keys","api_keys.empty.description":"API Keys for programmatic access to C4A API","api_keys.created_at":"Created {{date}}","api_keys.never_used":"Never used","api_keys.expires.never":"Never expires","api_keys.expires.30d":"30 days","api_keys.expires.90d":"90 days","api_keys.expires.1y":"1 year","api_keys.form.name":"Name","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"Expiration (optional)","api_keys.delete.confirm":"Delete this API key? This action cannot be undone.","workspace.default_name":"My Brain","settings.tab.general":"General","settings.tab.api_keys":"API Keys","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","error.description":"Something went wrong. Please try again.","error.reload":"Reload","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.menu.status_online":"{{machine}} connected","sources.menu.status_offline":"{{machine}} not connected, click for setup guide","sources.library.default_cloud_name":"My Drive","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":"Import Complete","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.import.stage.prepare":"Preparing environment","sources.import.stage.clone":"Cloning repository","sources.import.stage.scan":"Scanning project","sources.import.stage.save":"Saving sources","sources.import.stage.done_suffix":"done","sources.import.stage.complete":"Import complete","sources.import.step.loading":"Data Import","sources.import.done":"Done","sources.import.back":"Back","sources.import.retry":"Retry","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.step2_allow":"Restrict access to specific directories (does not affect existing imports)","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_name_hint":"Display name in the source tree after import. Leave empty to use the default repository name.","sources.import.dir_name_duplicate":"This name already exists. Please use a different 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.upload_document":"Upload 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 Import","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.loading_refs_slow":"Large projects may take 10–30s, please wait...","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":"Done","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.","content.detail.tab.raw":"Raw Content","content.detail.tab.digest":"Digest","content.detail.tab.extraction":"LLM Extraction","content.detail.tab.entities":"Entities","content.detail.size":"Size","content.detail.created_at":"Created","content.detail.sources":"Sources","content.detail.language":"Language","content.detail.model":"Model","entity.detail.tab.overview":"Overview","entity.detail.tab.relations":"Relations","entity.detail.tab.contents":"Contents","entity.detail.tab.referrers":"Referrers","entity.detail.tab.neighbors":"Neighbors","entity.detail.type":"Type","entity.detail.kind":"Kind","entity.detail.perspective":"Perspective","entity.detail.scope":"Scope","relation.detail.tab.overview":"Overview","relation.detail.weight":"Weight","relation.detail.confidence":"Confidence","relation.detail.from":"From","relation.detail.to":"To","relation.detail.description":"Description","relation.detail.data":"Additional Data","relation.detail.source_refs":"Content Sources","relation.detail.meta":"Metadata","relation.detail.source_label":"Source","relation.detail.source_field_sync":"System-derived","relation.detail.source_explicit":"Explicitly declared","relation.filter.direction.all":"All Directions","relation.filter.direction.outgoing":"Outgoing →","relation.filter.direction.incoming":"← Incoming","relation.filter.type.all":"All Types","ref.stale":"Stale ref","ref.unknown":"Unknown entity","ref.retry":"Resolve failed, click to retry","confidence.high":"High confidence","confidence.ai":"AI suggestion","confidence.low":"Low confidence","source.field_sync":"System-derived","source.explicit":"Explicitly declared","common.empty.content_raw.title":"Content unavailable","common.empty.content_raw.description":"This content was imported by a local Daemon; the raw text was not uploaded to the server.","common.empty.content_digest.title":"Not yet indexed","common.empty.content_digest.description":"This content has not been through structured indexing yet.","common.empty.content_extraction.title":"Not yet extracted","common.empty.content_extraction.description":"AI has not yet performed entity extraction and analysis on this content.","common.empty.content_entities.title":"No associated entities","common.empty.content_entities.description":"No entities have been extracted from this content yet.","common.empty.entity_relations.title":"No relations","common.empty.entity_relations.description":"This entity is currently an island with no connections to other entities.","common.empty.entity_contents.title":"No content sources","common.empty.entity_contents.description":"This entity is not linked to any source code or document content.","common.empty.entity_referrers.title":"No referrers","common.empty.entity_referrers.description":"No other entities currently reference this entity in their data fields.","common.empty.entity_neighbors.title":"No neighbors","common.empty.entity_neighbors.description":"This entity has no directly connected neighbor nodes in the graph.","common.error.not_found":"Resource not found","common.error.not_found_description":"The requested resource does not exist or has been removed.","common.error.load_failed":"Failed to load","common.error.load_failed_description":"An error occurred while loading data. Please try again."},A0={"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":"身份验证与用户管理","login.title":"登录","login.provider_cta":"使用 {{name}} 登录","login.loading":"加载中...","login.authenticating":"认证中...","login.or":"或","login.test_account":"测试账户","login.error":"加载登录选项失败","login.retry":"重试","user.menu.connect_source":"接入知识源","user.menu.sign_out":"退出登录","api_keys.title":"API 密钥","api_keys.description":"API Key 用于程序化访问 C4A API(AI Agent、CLI、CI/CD)","api_keys.create":"创建 API Key","api_keys.created":"API Key 已创建","api_keys.copy_warning":"请立即复制,此 Key 不会再次显示。","api_keys.copy":"复制","api_keys.copied":"已复制!","api_keys.done":"完成","api_keys.empty.title":"尚无 API Key","api_keys.empty.description":"API Key 用于程序化访问 C4A API","api_keys.created_at":"创建于 {{date}}","api_keys.never_used":"从未使用","api_keys.expires.never":"永不过期","api_keys.expires.30d":"30 天","api_keys.expires.90d":"90 天","api_keys.expires.1y":"1 年","api_keys.form.name":"名称","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"过期时间(可选)","api_keys.delete.confirm":"删除此 API Key?此操作不可撤销。","workspace.default_name":"我的大脑","settings.tab.general":"常规","settings.tab.api_keys":"API 密钥","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":"返回首页","error.description":"页面出现了问题,请重试。","error.reload":"重新加载","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.menu.status_online":"{{machine}} 已连接","sources.menu.status_offline":"{{machine}} 未连接,点击前往教程","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.import.stage.prepare":"准备执行环境","sources.import.stage.clone":"克隆仓库","sources.import.stage.scan":"扫描项目","sources.import.stage.save":"保存数据源","sources.import.stage.done_suffix":"✓","sources.import.stage.complete":"导入完成","sources.import.step.loading":"数据导入","sources.import.done":"完成","sources.import.back":"返回","sources.import.retry":"重试","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step2_allow":"限制访问目录(不影响已有导入)","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_name_hint":"导入后在目录树中的显示名称,留空使用默认仓库名。","sources.import.dir_name_duplicate":"该名称已存在,请使用其他名称。","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.upload_document":"上传文档","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.loading_refs_slow":"大型项目可能需要 10~30s,请耐心等待...","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":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。","content.detail.tab.raw":"原始内容","content.detail.tab.digest":"索引摘要","content.detail.tab.extraction":"LLM 提取","content.detail.tab.entities":"关联实体","content.detail.size":"大小","content.detail.created_at":"创建时间","content.detail.sources":"来源","content.detail.language":"语言","content.detail.model":"模型","entity.detail.tab.overview":"概览","entity.detail.tab.relations":"关系","entity.detail.tab.contents":"内容来源","entity.detail.tab.referrers":"被引用","entity.detail.tab.neighbors":"邻居","entity.detail.type":"类型","entity.detail.kind":"种类","entity.detail.perspective":"视角","entity.detail.scope":"作用域","relation.detail.tab.overview":"概览","relation.detail.weight":"权重","relation.detail.confidence":"置信度","relation.detail.from":"起点","relation.detail.to":"终点","relation.detail.description":"描述","relation.detail.data":"附加数据","relation.detail.source_refs":"内容来源","relation.detail.meta":"元信息","relation.detail.source_label":"生成方式","relation.detail.source_field_sync":"系统推导","relation.detail.source_explicit":"显式声明","relation.filter.direction.all":"全部方向","relation.filter.direction.outgoing":"出边 →","relation.filter.direction.incoming":"← 入边","relation.filter.type.all":"全部类型","ref.stale":"已失效引用","ref.unknown":"未知实体","ref.retry":"解析失败,点击重试","confidence.high":"高确信","confidence.ai":"AI 建议","confidence.low":"低确信","source.field_sync":"系统推导","source.explicit":"显式声明","common.empty.content_raw.title":"内容不可用","common.empty.content_raw.description":"此内容由本地 Daemon 导入,原始文本未上传到服务端。","common.empty.content_digest.title":"尚未索引","common.empty.content_digest.description":"此内容尚未经过结构化索引处理。","common.empty.content_extraction.title":"尚未提取","common.empty.content_extraction.description":"AI 尚未对此内容进行实体提取和分析。","common.empty.content_entities.title":"暂无关联实体","common.empty.content_entities.description":"尚未从此内容中提取出任何实体。","common.empty.entity_relations.title":"暂无关系","common.empty.entity_relations.description":"该实体目前是一个孤岛,尚未与其他实体建立关联。","common.empty.entity_contents.title":"暂无内容来源","common.empty.entity_contents.description":"该实体未关联任何源代码或文档内容。","common.empty.entity_referrers.title":"暂无被引用","common.empty.entity_referrers.description":"目前没有其他实体在 data 字段中引用此实体。","common.empty.entity_neighbors.title":"暂无邻居","common.empty.entity_neighbors.description":"该实体在图谱中没有直接关联的邻居节点。","common.error.not_found":"资源不存在","common.error.not_found_description":"请求的资源不存在或已被移除。","common.error.load_failed":"加载失败","common.error.load_failed_description":"加载数据时发生错误,请重试。"};fa.use(fx).use(c0).init({resources:{en:{translation:D0},zh:{translation:A0}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Ku={exports:{}},El={},Xu={exports:{}},Qu={};var Zp;function M0(){return Zp||(Zp=1,(function(n){function r(A,P){var fe=A.length;A.push(P);e:for(;0<fe;){var me=fe-1>>>1,re=A[me];if(0<o(re,P))A[me]=P,A[fe]=re,fe=me;else break e}}function l(A){return A.length===0?null:A[0]}function i(A){if(A.length===0)return null;var P=A[0],fe=A.pop();if(fe!==P){A[0]=fe;e:for(var me=0,re=A.length,w=re>>>1;me<w;){var $=2*(me+1)-1,ee=A[$],ae=$+1,xe=A[ae];if(0>o(ee,fe))ae<re&&0>o(xe,ee)?(A[me]=xe,A[ae]=fe,me=ae):(A[me]=ee,A[$]=fe,me=$);else if(ae<re&&0>o(xe,fe))A[me]=xe,A[ae]=fe,me=ae;else break e}}return P}function o(A,P){var fe=A.sortIndex-P.sortIndex;return fe!==0?fe:A.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var g=[],h=[],v=1,b=null,_=3,j=!1,N=!1,C=!1,z=!1,q=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function Y(A){for(var P=l(h);P!==null;){if(P.callback===null)i(h);else if(P.startTime<=A)i(h),P.sortIndex=P.expirationTime,r(g,P);else break;P=l(h)}}function te(A){if(C=!1,Y(A),!N)if(l(g)!==null)N=!0,Z||(Z=!0,le());else{var P=l(h);P!==null&&ge(te,P.startTime-A)}}var Z=!1,G=-1,E=5,H=-1;function W(){return z?!0:!(n.unstable_now()-H<E)}function de(){if(z=!1,Z){var A=n.unstable_now();H=A;var P=!0;try{e:{N=!1,C&&(C=!1,Q(G),G=-1),j=!0;var fe=_;try{t:{for(Y(A),b=l(g);b!==null&&!(b.expirationTime>A&&W());){var me=b.callback;if(typeof me=="function"){b.callback=null,_=b.priorityLevel;var re=me(b.expirationTime<=A);if(A=n.unstable_now(),typeof re=="function"){b.callback=re,Y(A),P=!0;break t}b===l(g)&&i(g),Y(A)}else i(g);b=l(g)}if(b!==null)P=!0;else{var w=l(h);w!==null&&ge(te,w.startTime-A),P=!1}}break e}finally{b=null,_=fe,j=!1}P=void 0}}finally{P?le():Z=!1}}}var le;if(typeof V=="function")le=function(){V(de)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=de,le=function(){ce.postMessage(null)}}else le=function(){q(de,0)};function ge(A,P){G=q(function(){A(n.unstable_now())},P)}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(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<A?Math.floor(1e3/A):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(A){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var fe=_;_=P;try{return A()}finally{_=fe}},n.unstable_requestPaint=function(){z=!0},n.unstable_runWithPriority=function(A,P){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var fe=_;_=A;try{return P()}finally{_=fe}},n.unstable_scheduleCallback=function(A,P,fe){var me=n.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?me+fe:me):fe=me,A){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=fe+re,A={id:v++,callback:P,priorityLevel:A,startTime:fe,expirationTime:re,sortIndex:-1},fe>me?(A.sortIndex=fe,r(h,A),l(g)===null&&A===l(h)&&(C?(Q(G),G=-1):C=!0,ge(te,fe-me))):(A.sortIndex=re,r(g,A),N||j||(N=!0,Z||(Z=!0,le()))),A},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(A){var P=_;return function(){var fe=_;_=P;try{return A.apply(this,arguments)}finally{_=fe}}}})(Qu)),Qu}var Jp;function L0(){return Jp||(Jp=1,Xu.exports=M0()),Xu.exports}var Fu={exports:{}},ra={};var Pp;function U0(){if(Pp)return ra;Pp=1;var n=jo();function r(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 l(){}var i={d:{f:l,r:function(){throw Error(r(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,h,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,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 ra.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ra.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(r(299));return d(g,h,null,v)},ra.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()}},ra.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))},ra.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},ra.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var v=h.as,b=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:b,integrity:_,fetchPriority:j}):v==="script"&&i.d.X(g,{crossOrigin:b,integrity:_,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ra.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)},ra.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,b=p(v,h.crossOrigin);i.d.L(g,v,{crossOrigin:b,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})}},ra.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)},ra.requestFormReset=function(g){i.d.r(g)},ra.unstable_batchedUpdates=function(g,h){return g(h)},ra.useFormState=function(g,h,v){return m.H.useFormState(g,h,v)},ra.useFormStatus=function(){return m.H.useHostTransitionStatus()},ra.version="19.2.4",ra}var Ip;function H0(){if(Ip)return Fu.exports;Ip=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(r){console.error(r)}}return n(),Fu.exports=U0(),Fu.exports}var Wp;function B0(){if(Wp)return El;Wp=1;var n=L0(),r=jo(),l=H0();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 d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function 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(d(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,s=t;;){var c=a.return;if(c===null)break;var f=c.alternate;if(f===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===a)return g(c),e;if(f===s)return g(c),t;f=f.sibling}throw Error(i(188))}if(a.return!==s.return)a=c,s=f;else{for(var x=!1,S=c.child;S;){if(S===a){x=!0,a=c,s=f;break}if(S===s){x=!0,s=c,a=f;break}S=S.sibling}if(!x){for(S=f.child;S;){if(S===a){x=!0,a=f,s=c;break}if(S===s){x=!0,s=f,a=c;break}S=S.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==s)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 b=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),V=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case q:return"Profiler";case z:return"StrictMode";case te:return"Suspense";case Z:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case V:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case Y:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var ge=Array.isArray,A=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},me=[],re=-1;function w(e){return{current:e}}function $(e){0>re||(e.current=me[re],me[re]=null,re--)}function ee(e,t){re++,me[re]=e.current,e.current=t}var ae=w(null),xe=w(null),ve=w(null),ze=w(null);function Pe(e,t){switch(ee(ve,t),ee(xe,e),ee(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qh(t),e=Fh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ae),ee(ae,e)}function Xe(){$(ae),$(xe),$(ve)}function ea(e){e.memoizedState!==null&&ee(ze,e);var t=ae.current,a=Fh(t,e.type);t!==a&&(ee(xe,e),ee(ae,a))}function ma(e){xe.current===e&&($(ae),$(xe)),ze.current===e&&($(ze),vl._currentValue=fe)}var Qe,et;function ft(e){if(Qe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Qe=t&&t[1]||"",et=-1<a.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Qe+e+et}var qt=!1;function Vt(e,t){if(!e||qt)return"";qt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={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(K){var U=K}Reflect.construct(e,[],I)}else{try{I.call()}catch(K){U=K}e.call(I.prototype)}}else{try{throw Error()}catch(K){U=K}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(K){if(K&&U&&typeof K.stack=="string")return[K.stack,U.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),x=f[0],S=f[1];if(x&&S){var k=x.split(`
|
|
5
|
+
`),L=S.split(`
|
|
6
|
+
`);for(c=s=0;s<k.length&&!k[s].includes("DetermineComponentFrameRoot");)s++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(s===k.length||c===L.length)for(s=k.length-1,c=L.length-1;1<=s&&0<=c&&k[s]!==L[c];)c--;for(;1<=s&&0<=c;s--,c--)if(k[s]!==L[c]){if(s!==1||c!==1)do if(s--,c--,0>c||k[s]!==L[c]){var F=`
|
|
7
|
+
`+k[s].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=s&&0<=c);break}}}finally{qt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ft(a):""}function ta(e,t){switch(e.tag){case 26:case 27:case 5:return ft(e.type);case 16:return ft("Lazy");case 13:return e.child!==t&&t!==null?ft("Suspense Fallback"):ft("Suspense");case 19:return ft("SuspenseList");case 0:case 15:return Vt(e.type,!1);case 11:return Vt(e.type.render,!1);case 1:return Vt(e.type,!0);case 31:return ft("Activity");default:return""}}function aa(e){try{var t="",a=null;do t+=ta(e,a),a=e,e=e.return;while(e);return t}catch(s){return`
|
|
8
|
+
Error generating stack: `+s.message+`
|
|
9
|
+
`+s.stack}}var Sa=Object.prototype.hasOwnProperty,ja=n.unstable_scheduleCallback,Aa=n.unstable_cancelCallback,la=n.unstable_shouldYield,ia=n.unstable_requestPaint,pt=n.unstable_now,oa=n.unstable_getCurrentPriorityLevel,_e=n.unstable_ImmediatePriority,Ae=n.unstable_UserBlockingPriority,Fe=n.unstable_NormalPriority,gt=n.unstable_LowPriority,Nt=n.unstable_IdlePriority,Ft=n.log,Ia=n.unstable_setDisableYieldValue,Zt=null,kt=null;function xt(e){if(typeof Ft=="function"&&Ia(e),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(Zt,e)}catch{}}var Dt=Math.clz32?Math.clz32:st,Ce=Math.log,Le=Math.LN2;function st(e){return e>>>=0,e===0?32:31-(Ce(e)/Le|0)|0}var X=256,ie=262144,Oe=4194304;function $e(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 Ue(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=s&134217727;return S!==0?(s=S&~f,s!==0?c=$e(s):(x&=S,x!==0?c=$e(x):a||(a=S&~e,a!==0&&(c=$e(a))))):(S=s&~f,S!==0?c=$e(S):x!==0?c=$e(x):a||(a=s&~e,a!==0&&(c=$e(a)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:c}function At(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ca(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 ua(){var e=Oe;return Oe<<=1,(Oe&62914560)===0&&(Oe=4194304),e}function Ma(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Na(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mr(e,t,a,s,c,f){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,k=e.expirationTimes,L=e.hiddenUpdates;for(a=x&~a;0<a;){var F=31-Dt(a),I=1<<F;S[F]=0,k[F]=-1;var U=L[F];if(U!==null)for(L[F]=null,F=0;F<U.length;F++){var K=U[F];K!==null&&(K.lane&=-536870913)}a&=~I}s!==0&&$r(e,s,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~t))}function $r(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Dt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function qr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-Dt(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function R(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 ne(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:xp(e.type))}function oe(e,t){var a=P.p;try{return P.p=e,t()}finally{P.p=a}}var ye=Math.random().toString(36).slice(2),ue="__reactFiber$"+ye,he="__reactProps$"+ye,pe="__reactContainer$"+ye,we="__reactEvents$"+ye,Re="__reactListeners$"+ye,je="__reactHandles$"+ye,tt="__reactResources$"+ye,Ye="__reactMarker$"+ye;function mt(e){delete e[ue],delete e[he],delete e[we],delete e[Re],delete e[je]}function bt(e){var t=e[ue];if(t)return t;for(var a=e.parentNode;a;){if(t=a[pe]||a[ue]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=tp(e);e!==null;){if(a=e[ue])return a;e=tp(e)}return t}e=a,a=e.parentNode}return null}function wt(e){if(e=e[ue]||e[pe]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function We(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Yt(e){var t=e[tt];return t||(t=e[tt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Ye]=!0}var Un=new Set,Wa={};function Kt(e,t){sn(e,t),sn(e+"Capture",t)}function sn(e,t){for(Wa[e]=t,e=0;e<t.length;e++)Un.add(t[e])}var hr=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]*$"),ln={},pr={};function Yr(e){return Sa.call(pr,e)?!0:Sa.call(ln,e)?!1:hr.test(e)?pr[e]=!0:(ln[e]=!0,!1)}function Ge(e,t,a){if(Yr(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Tt(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 na(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function Mt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gr(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,f=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){a=""+x,f.call(this,x)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vr(e){if(!e._valueTracker){var t=vt(e)?"checked":"value";e._valueTracker=Gr(e,t,""+e[t])}}function Fl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=vt(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function Zl(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 yy=/[\n"\\]/g;function La(e){return e.replace(yy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Oo(e,t,a,s,c,f,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=""+Mt(t)):e.value!==""+Mt(t)&&(e.value=""+Mt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Do(e,x,Mt(t)):a!=null?Do(e,x,Mt(a)):s!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Mt(S):e.removeAttribute("name")}function $d(e,t,a,s,c,f,x,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Vr(e);return}a=a!=null?""+Mt(a):"",t=t!=null?""+Mt(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=S?e.checked:!!s,e.defaultChecked=!!s,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Vr(e)}function Do(e,t,a){t==="number"&&Zl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Kr(e,t,a,s){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&&s&&(e[a].defaultSelected=!0)}else{for(a=""+Mt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function qd(e,t,a){if(t!=null&&(t=""+Mt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Mt(a):""}function Yd(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(i(92));if(ge(s)){if(1<s.length)throw Error(i(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=Mt(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),Vr(e)}function Xr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var by=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 Gd(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||by.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Vd(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&Gd(e,c,s)}else for(var f in t)t.hasOwnProperty(f)&&Gd(e,f,t[f])}function Ao(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 vy=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"]]),_y=/^[\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 Jl(e){return _y.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function gn(){}var Mo=null;function Lo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qr=null,Fr=null;function Kd(e){var t=wt(e);if(t&&(e=t.stateNode)){var a=e[he]||null;e:switch(e=t.stateNode,t.type){case"input":if(Oo(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="'+La(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[he]||null;if(!c)throw Error(i(90));Oo(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&Fl(s)}break e;case"textarea":qd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Kr(e,!!a.multiple,t,!1)}}}var Uo=!1;function Xd(e,t,a){if(Uo)return e(t,a);Uo=!0;try{var s=e(t);return s}finally{if(Uo=!1,(Qr!==null||Fr!==null)&&(Ui(),Qr&&(t=Qr,e=Fr,Fr=Qr=null,Kd(t),e)))for(t=0;t<e.length;t++)Kd(e[t])}}function Us(e,t){var a=e.stateNode;if(a===null)return null;var s=a[he]||null;if(s===null)return null;a=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var xn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ho=!1;if(xn)try{var Hs={};Object.defineProperty(Hs,"passive",{get:function(){Ho=!0}}),window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Ho=!1}var Hn=null,Bo=null,Pl=null;function Qd(){if(Pl)return Pl;var e,t=Bo,a=t.length,s,c="value"in Hn?Hn.value:Hn.textContent,f=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(s=1;s<=x&&t[a-s]===c[f-s];s++);return Pl=c.slice(e,1<s?1-s:void 0)}function Il(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 Wl(){return!0}function Fd(){return!1}function ha(e){function t(a,s,c,f,x){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Wl:Fd,this.isPropagationStopped=Fd,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Wl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),t}var gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ei=ha(gr),Bs=b({},gr,{view:0,detail:0}),Sy=ha(Bs),$o,qo,$s,ti=b({},Bs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Go,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==$s&&($s&&e.type==="mousemove"?($o=e.screenX-$s.screenX,qo=e.screenY-$s.screenY):qo=$o=0,$s=e),$o)},movementY:function(e){return"movementY"in e?e.movementY:qo}}),Zd=ha(ti),jy=b({},ti,{dataTransfer:0}),Ny=ha(jy),wy=b({},Bs,{relatedTarget:0}),Yo=ha(wy),Ey=b({},gr,{animationName:0,elapsedTime:0,pseudoElement:0}),Cy=ha(Ey),Ry=b({},gr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ky=ha(Ry),Ty=b({},gr,{data:0}),Jd=ha(Ty),zy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oy={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"},Dy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ay(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dy[e])?!!t[e]:!1}function Go(){return Ay}var My=b({},Bs,{key:function(e){if(e.key){var t=zy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Il(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Oy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Go,charCode:function(e){return e.type==="keypress"?Il(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Il(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ly=ha(My),Uy=b({},ti,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pd=ha(Uy),Hy=b({},Bs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Go}),By=ha(Hy),$y=b({},gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),qy=ha($y),Yy=b({},ti,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Gy=ha(Yy),Vy=b({},gr,{newState:0,oldState:0}),Ky=ha(Vy),Xy=[9,13,27,32],Vo=xn&&"CompositionEvent"in window,qs=null;xn&&"documentMode"in document&&(qs=document.documentMode);var Qy=xn&&"TextEvent"in window&&!qs,Id=xn&&(!Vo||qs&&8<qs&&11>=qs),Wd=" ",ef=!1;function tf(e,t){switch(e){case"keyup":return Xy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function af(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zr=!1;function Fy(e,t){switch(e){case"compositionend":return af(t);case"keypress":return t.which!==32?null:(ef=!0,Wd);case"textInput":return e=t.data,e===Wd&&ef?null:e;default:return null}}function Zy(e,t){if(Zr)return e==="compositionend"||!Vo&&tf(e,t)?(e=Qd(),Pl=Bo=Hn=null,Zr=!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 Id&&t.locale!=="ko"?null:t.data;default:return null}}var Jy={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 nf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jy[e.type]:t==="textarea"}function rf(e,t,a,s){Qr?Fr?Fr.push(s):Fr=[s]:Qr=s,t=Vi(t,"onChange"),0<t.length&&(a=new ei("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Ys=null,Gs=null;function Py(e){qh(e,0)}function ai(e){var t=We(e);if(Fl(t))return e}function sf(e,t){if(e==="change")return t}var lf=!1;if(xn){var Ko;if(xn){var Xo="oninput"in document;if(!Xo){var of=document.createElement("div");of.setAttribute("oninput","return;"),Xo=typeof of.oninput=="function"}Ko=Xo}else Ko=!1;lf=Ko&&(!document.documentMode||9<document.documentMode)}function cf(){Ys&&(Ys.detachEvent("onpropertychange",uf),Gs=Ys=null)}function uf(e){if(e.propertyName==="value"&&ai(Gs)){var t=[];rf(t,Gs,e,Lo(e)),Xd(Py,t)}}function Iy(e,t,a){e==="focusin"?(cf(),Ys=t,Gs=a,Ys.attachEvent("onpropertychange",uf)):e==="focusout"&&cf()}function Wy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ai(Gs)}function eb(e,t){if(e==="click")return ai(t)}function tb(e,t){if(e==="input"||e==="change")return ai(t)}function ab(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wa=typeof Object.is=="function"?Object.is:ab;function Vs(e,t){if(wa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Sa.call(t,c)||!wa(e[c],t[c]))return!1}return!0}function df(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ff(e,t){var a=df(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=df(a)}}function mf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zl(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=Zl(e.document)}return t}function Qo(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 nb=xn&&"documentMode"in document&&11>=document.documentMode,Jr=null,Fo=null,Ks=null,Zo=!1;function pf(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Zo||Jr==null||Jr!==Zl(s)||(s=Jr,"selectionStart"in s&&Qo(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ks&&Vs(Ks,s)||(Ks=s,s=Vi(Fo,"onSelect"),0<s.length&&(t=new ei("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=Jr)))}function xr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pr={animationend:xr("Animation","AnimationEnd"),animationiteration:xr("Animation","AnimationIteration"),animationstart:xr("Animation","AnimationStart"),transitionrun:xr("Transition","TransitionRun"),transitionstart:xr("Transition","TransitionStart"),transitioncancel:xr("Transition","TransitionCancel"),transitionend:xr("Transition","TransitionEnd")},Jo={},gf={};xn&&(gf=document.createElement("div").style,"AnimationEvent"in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),"TransitionEvent"in window||delete Pr.transitionend.transition);function yr(e){if(Jo[e])return Jo[e];if(!Pr[e])return e;var t=Pr[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in gf)return Jo[e]=t[a];return e}var xf=yr("animationend"),yf=yr("animationiteration"),bf=yr("animationstart"),rb=yr("transitionrun"),sb=yr("transitionstart"),lb=yr("transitioncancel"),vf=yr("transitionend"),_f=new Map,Po="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(" ");Po.push("scrollEnd");function en(e,t){_f.set(e,t),Kt(t,[e])}var ni=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)},Ua=[],Ir=0,Io=0;function ri(){for(var e=Ir,t=Io=Ir=0;t<e;){var a=Ua[t];Ua[t++]=null;var s=Ua[t];Ua[t++]=null;var c=Ua[t];Ua[t++]=null;var f=Ua[t];if(Ua[t++]=null,s!==null&&c!==null){var x=s.pending;x===null?c.next=c:(c.next=x.next,x.next=c),s.pending=c}f!==0&&Sf(a,c,f)}}function si(e,t,a,s){Ua[Ir++]=e,Ua[Ir++]=t,Ua[Ir++]=a,Ua[Ir++]=s,Io|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Wo(e,t,a,s){return si(e,t,a,s),li(e)}function br(e,t){return si(e,null,null,t),li(e)}function Sf(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,f=e.return;f!==null;)f.childLanes|=a,s=f.alternate,s!==null&&(s.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-Dt(a),e=f.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),f):null}function li(e){if(50<ml)throw ml=0,ou=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Wr={};function ib(e,t,a,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ea(e,t,a,s){return new ib(e,t,a,s)}function ec(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yn(e,t){var a=e.alternate;return a===null?(a=Ea(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 jf(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 ii(e,t,a,s,c,f){var x=0;if(s=e,typeof e=="function")ec(e)&&(x=1);else if(typeof e=="string")x=fv(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=Ea(31,a,t,c),e.elementType=H,e.lanes=f,e;case C:return vr(a.children,c,f,t);case z:x=8,c|=24;break;case q:return e=Ea(12,a,t,c|2),e.elementType=q,e.lanes=f,e;case te:return e=Ea(13,a,t,c),e.elementType=te,e.lanes=f,e;case Z:return e=Ea(19,a,t,c),e.elementType=Z,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:x=10;break e;case Q:x=9;break e;case Y:x=11;break e;case G:x=14;break e;case E:x=16,s=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),s=null}return t=Ea(x,a,t,c),t.elementType=e,t.type=s,t.lanes=f,t}function vr(e,t,a,s){return e=Ea(7,e,s,t),e.lanes=a,e}function tc(e,t,a){return e=Ea(6,e,null,t),e.lanes=a,e}function Nf(e){var t=Ea(18,null,null,0);return t.stateNode=e,t}function ac(e,t,a){return t=Ea(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wf=new WeakMap;function Ha(e,t){if(typeof e=="object"&&e!==null){var a=wf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:aa(t)},wf.set(e,t),t)}return{value:e,source:t,stack:aa(t)}}var es=[],ts=0,oi=null,Xs=0,Ba=[],$a=0,Bn=null,on=1,cn="";function bn(e,t){es[ts++]=Xs,es[ts++]=oi,oi=e,Xs=t}function Ef(e,t,a){Ba[$a++]=on,Ba[$a++]=cn,Ba[$a++]=Bn,Bn=e;var s=on;e=cn;var c=32-Dt(s)-1;s&=~(1<<c),a+=1;var f=32-Dt(t)+c;if(30<f){var x=c-c%5;f=(s&(1<<x)-1).toString(32),s>>=x,c-=x,on=1<<32-Dt(t)+c|a<<c|s,cn=f+e}else on=1<<f|a<<c|s,cn=e}function nc(e){e.return!==null&&(bn(e,1),Ef(e,1,0))}function rc(e){for(;e===oi;)oi=es[--ts],es[ts]=null,Xs=es[--ts],es[ts]=null;for(;e===Bn;)Bn=Ba[--$a],Ba[$a]=null,cn=Ba[--$a],Ba[$a]=null,on=Ba[--$a],Ba[$a]=null}function Cf(e,t){Ba[$a++]=on,Ba[$a++]=cn,Ba[$a++]=Bn,on=t.id,cn=t.overflow,Bn=e}var Jt=null,_t=null,Ie=!1,$n=null,qa=!1,sc=Error(i(519));function qn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qs(Ha(t,e)),sc}function Rf(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[ue]=e,t[he]=s,a){case"dialog":Ke("cancel",t),Ke("close",t);break;case"iframe":case"object":case"embed":Ke("load",t);break;case"video":case"audio":for(a=0;a<pl.length;a++)Ke(pl[a],t);break;case"source":Ke("error",t);break;case"img":case"image":case"link":Ke("error",t),Ke("load",t);break;case"details":Ke("toggle",t);break;case"input":Ke("invalid",t),$d(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ke("invalid",t);break;case"textarea":Ke("invalid",t),Yd(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||Kh(t.textContent,a)?(s.popover!=null&&(Ke("beforetoggle",t),Ke("toggle",t)),s.onScroll!=null&&Ke("scroll",t),s.onScrollEnd!=null&&Ke("scrollend",t),s.onClick!=null&&(t.onclick=gn),t=!0):t=!1,t||qn(e,!0)}function kf(e){for(Jt=e.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:qa=!1;return;case 27:case 3:qa=!0;return;default:Jt=Jt.return}}function as(e){if(e!==Jt)return!1;if(!Ie)return kf(e),Ie=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||ju(e.type,e.memoizedProps)),a=!a),a&&_t&&qn(e),kf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));_t=ep(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));_t=ep(e)}else t===27?(t=_t,tr(e.type)?(e=Ru,Ru=null,_t=e):_t=t):_t=Jt?Ga(e.stateNode.nextSibling):null;return!0}function _r(){_t=Jt=null,Ie=!1}function lc(){var e=$n;return e!==null&&(ya===null?ya=e:ya.push.apply(ya,e),$n=null),e}function Qs(e){$n===null?$n=[e]:$n.push(e)}var ic=w(null),Sr=null,vn=null;function Yn(e,t,a){ee(ic,t._currentValue),t._currentValue=a}function _n(e){e._currentValue=ic.current,$(ic)}function oc(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function cc(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var x=c.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=c;for(var k=0;k<t.length;k++)if(S.context===t[k]){f.lanes|=a,S=f.alternate,S!==null&&(S.lanes|=a),oc(f.return,a,e),s||(x=null);break e}f=S.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,f=x.alternate,f!==null&&(f.lanes|=a),oc(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 ns(e,t,a,s){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!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;wa(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(vl):e=[vl])}c=c.return}e!==null&&cc(t,e,a,s),t.flags|=262144}function ci(e){for(e=e.firstContext;e!==null;){if(!wa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function jr(e){Sr=e,vn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pt(e){return Tf(Sr,e)}function ui(e,t){return Sr===null&&jr(e),Tf(e,t)}function Tf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},vn===null){if(e===null)throw Error(i(308));vn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vn=vn.next=t;return a}var ob=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},cb=n.unstable_scheduleCallback,ub=n.unstable_NormalPriority,Lt={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uc(){return{controller:new ob,data:new Map,refCount:0}}function Fs(e){e.refCount--,e.refCount===0&&cb(ub,function(){e.controller.abort()})}var Zs=null,dc=0,rs=0,ss=null;function db(e,t){if(Zs===null){var a=Zs=[];dc=0,rs=hu(),ss={status:"pending",value:void 0,then:function(s){a.push(s)}}}return dc++,t.then(zf,zf),t}function zf(){if(--dc===0&&Zs!==null){ss!==null&&(ss.status="fulfilled");var e=Zs;Zs=null,rs=0,ss=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fb(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var Of=A.S;A.S=function(e,t){ph=pt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&db(e,t),Of!==null&&Of(e,t)};var Nr=w(null);function fc(){var e=Nr.current;return e!==null?e:ht.pooledCache}function di(e,t){t===null?ee(Nr,Nr.current):ee(Nr,t.pool)}function Df(){var e=fc();return e===null?null:{parent:Lt._currentValue,pool:e}}var ls=Error(i(460)),mc=Error(i(474)),fi=Error(i(542)),mi={then:function(){}};function Af(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Mf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(gn,gn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uf(e),e;default:if(typeof t.status=="string")t.then(gn,gn);else{if(e=ht,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uf(e),e}throw Er=t,ls}}function wr(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Er=a,ls):a}}var Er=null;function Lf(){if(Er===null)throw Error(i(459));var e=Er;return Er=null,e}function Uf(e){if(e===ls||e===fi)throw Error(i(483))}var is=null,Js=0;function hi(e){var t=Js;return Js+=1,is===null&&(is=[]),Mf(is,e,t)}function Ps(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function pi(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 Hf(e){function t(D,T){if(e){var M=D.deletions;M===null?(D.deletions=[T],D.flags|=16):M.push(T)}}function a(D,T){if(!e)return null;for(;T!==null;)t(D,T),T=T.sibling;return null}function s(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=yn(D,T),D.index=0,D.sibling=null,D}function f(D,T,M){return D.index=M,e?(M=D.alternate,M!==null?(M=M.index,M<T?(D.flags|=67108866,T):M):(D.flags|=67108866,T)):(D.flags|=1048576,T)}function x(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function S(D,T,M,J){return T===null||T.tag!==6?(T=tc(M,D.mode,J),T.return=D,T):(T=c(T,M),T.return=D,T)}function k(D,T,M,J){var Ee=M.type;return Ee===C?F(D,T,M.props.children,J,M.key):T!==null&&(T.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===E&&wr(Ee)===T.type)?(T=c(T,M.props),Ps(T,M),T.return=D,T):(T=ii(M.type,M.key,M.props,null,D.mode,J),Ps(T,M),T.return=D,T)}function L(D,T,M,J){return T===null||T.tag!==4||T.stateNode.containerInfo!==M.containerInfo||T.stateNode.implementation!==M.implementation?(T=ac(M,D.mode,J),T.return=D,T):(T=c(T,M.children||[]),T.return=D,T)}function F(D,T,M,J,Ee){return T===null||T.tag!==7?(T=vr(M,D.mode,J,Ee),T.return=D,T):(T=c(T,M),T.return=D,T)}function I(D,T,M){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=tc(""+T,D.mode,M),T.return=D,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case j:return M=ii(T.type,T.key,T.props,null,D.mode,M),Ps(M,T),M.return=D,M;case N:return T=ac(T,D.mode,M),T.return=D,T;case E:return T=wr(T),I(D,T,M)}if(ge(T)||le(T))return T=vr(T,D.mode,M,null),T.return=D,T;if(typeof T.then=="function")return I(D,hi(T),M);if(T.$$typeof===V)return I(D,ui(D,T),M);pi(D,T)}return null}function U(D,T,M,J){var Ee=T!==null?T.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return Ee!==null?null:S(D,T,""+M,J);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case j:return M.key===Ee?k(D,T,M,J):null;case N:return M.key===Ee?L(D,T,M,J):null;case E:return M=wr(M),U(D,T,M,J)}if(ge(M)||le(M))return Ee!==null?null:F(D,T,M,J,null);if(typeof M.then=="function")return U(D,T,hi(M),J);if(M.$$typeof===V)return U(D,T,ui(D,M),J);pi(D,M)}return null}function K(D,T,M,J,Ee){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return D=D.get(M)||null,S(T,D,""+J,Ee);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case j:return D=D.get(J.key===null?M:J.key)||null,k(T,D,J,Ee);case N:return D=D.get(J.key===null?M:J.key)||null,L(T,D,J,Ee);case E:return J=wr(J),K(D,T,M,J,Ee)}if(ge(J)||le(J))return D=D.get(M)||null,F(T,D,J,Ee,null);if(typeof J.then=="function")return K(D,T,M,hi(J),Ee);if(J.$$typeof===V)return K(D,T,M,ui(T,J),Ee);pi(T,J)}return null}function be(D,T,M,J){for(var Ee=null,at=null,Se=T,Be=T=0,Je=null;Se!==null&&Be<M.length;Be++){Se.index>Be?(Je=Se,Se=null):Je=Se.sibling;var nt=U(D,Se,M[Be],J);if(nt===null){Se===null&&(Se=Je);break}e&&Se&&nt.alternate===null&&t(D,Se),T=f(nt,T,Be),at===null?Ee=nt:at.sibling=nt,at=nt,Se=Je}if(Be===M.length)return a(D,Se),Ie&&bn(D,Be),Ee;if(Se===null){for(;Be<M.length;Be++)Se=I(D,M[Be],J),Se!==null&&(T=f(Se,T,Be),at===null?Ee=Se:at.sibling=Se,at=Se);return Ie&&bn(D,Be),Ee}for(Se=s(Se);Be<M.length;Be++)Je=K(Se,D,Be,M[Be],J),Je!==null&&(e&&Je.alternate!==null&&Se.delete(Je.key===null?Be:Je.key),T=f(Je,T,Be),at===null?Ee=Je:at.sibling=Je,at=Je);return e&&Se.forEach(function(lr){return t(D,lr)}),Ie&&bn(D,Be),Ee}function ke(D,T,M,J){if(M==null)throw Error(i(151));for(var Ee=null,at=null,Se=T,Be=T=0,Je=null,nt=M.next();Se!==null&&!nt.done;Be++,nt=M.next()){Se.index>Be?(Je=Se,Se=null):Je=Se.sibling;var lr=U(D,Se,nt.value,J);if(lr===null){Se===null&&(Se=Je);break}e&&Se&&lr.alternate===null&&t(D,Se),T=f(lr,T,Be),at===null?Ee=lr:at.sibling=lr,at=lr,Se=Je}if(nt.done)return a(D,Se),Ie&&bn(D,Be),Ee;if(Se===null){for(;!nt.done;Be++,nt=M.next())nt=I(D,nt.value,J),nt!==null&&(T=f(nt,T,Be),at===null?Ee=nt:at.sibling=nt,at=nt);return Ie&&bn(D,Be),Ee}for(Se=s(Se);!nt.done;Be++,nt=M.next())nt=K(Se,D,Be,nt.value,J),nt!==null&&(e&&nt.alternate!==null&&Se.delete(nt.key===null?Be:nt.key),T=f(nt,T,Be),at===null?Ee=nt:at.sibling=nt,at=nt);return e&&Se.forEach(function(jv){return t(D,jv)}),Ie&&bn(D,Be),Ee}function dt(D,T,M,J){if(typeof M=="object"&&M!==null&&M.type===C&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case j:e:{for(var Ee=M.key;T!==null;){if(T.key===Ee){if(Ee=M.type,Ee===C){if(T.tag===7){a(D,T.sibling),J=c(T,M.props.children),J.return=D,D=J;break e}}else if(T.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===E&&wr(Ee)===T.type){a(D,T.sibling),J=c(T,M.props),Ps(J,M),J.return=D,D=J;break e}a(D,T);break}else t(D,T);T=T.sibling}M.type===C?(J=vr(M.props.children,D.mode,J,M.key),J.return=D,D=J):(J=ii(M.type,M.key,M.props,null,D.mode,J),Ps(J,M),J.return=D,D=J)}return x(D);case N:e:{for(Ee=M.key;T!==null;){if(T.key===Ee)if(T.tag===4&&T.stateNode.containerInfo===M.containerInfo&&T.stateNode.implementation===M.implementation){a(D,T.sibling),J=c(T,M.children||[]),J.return=D,D=J;break e}else{a(D,T);break}else t(D,T);T=T.sibling}J=ac(M,D.mode,J),J.return=D,D=J}return x(D);case E:return M=wr(M),dt(D,T,M,J)}if(ge(M))return be(D,T,M,J);if(le(M)){if(Ee=le(M),typeof Ee!="function")throw Error(i(150));return M=Ee.call(M),ke(D,T,M,J)}if(typeof M.then=="function")return dt(D,T,hi(M),J);if(M.$$typeof===V)return dt(D,T,ui(D,M),J);pi(D,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,T!==null&&T.tag===6?(a(D,T.sibling),J=c(T,M),J.return=D,D=J):(a(D,T),J=tc(M,D.mode,J),J.return=D,D=J),x(D)):a(D,T)}return function(D,T,M,J){try{Js=0;var Ee=dt(D,T,M,J);return is=null,Ee}catch(Se){if(Se===ls||Se===fi)throw Se;var at=Ea(29,Se,null,D.mode);return at.lanes=J,at.return=D,at}}}var Cr=Hf(!0),Bf=Hf(!1),Gn=!1;function hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pc(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 Vn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Kn(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(rt&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=li(e),Sf(e,null,a),t}return si(e,s,t,a),li(e)}function Is(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,qr(e,a)}}function gc(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?c=f=x:f=f.next=x,a=a.next}while(a!==null);f===null?c=f=t:f=f.next=t}else c=f=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var xc=!1;function Ws(){if(xc){var e=ss;if(e!==null)throw e}}function el(e,t,a,s){xc=!1;var c=e.updateQueue;Gn=!1;var f=c.firstBaseUpdate,x=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var k=S,L=k.next;k.next=null,x===null?f=L:x.next=L,x=k;var F=e.alternate;F!==null&&(F=F.updateQueue,S=F.lastBaseUpdate,S!==x&&(S===null?F.firstBaseUpdate=L:S.next=L,F.lastBaseUpdate=k))}if(f!==null){var I=c.baseState;x=0,F=L=k=null,S=f;do{var U=S.lane&-536870913,K=U!==S.lane;if(K?(Ze&U)===U:(s&U)===U){U!==0&&U===rs&&(xc=!0),F!==null&&(F=F.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var be=e,ke=S;U=t;var dt=a;switch(ke.tag){case 1:if(be=ke.payload,typeof be=="function"){I=be.call(dt,I,U);break e}I=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=ke.payload,U=typeof be=="function"?be.call(dt,I,U):be,U==null)break e;I=b({},I,U);break e;case 2:Gn=!0}}U=S.callback,U!==null&&(e.flags|=64,K&&(e.flags|=8192),K=c.callbacks,K===null?c.callbacks=[U]:K.push(U))}else K={lane:U,tag:S.tag,payload:S.payload,callback:S.callback,next:null},F===null?(L=F=K,k=I):F=F.next=K,x|=U;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;K=S,S=K.next,K.next=null,c.lastBaseUpdate=K,c.shared.pending=null}}while(!0);F===null&&(k=I),c.baseState=k,c.firstBaseUpdate=L,c.lastBaseUpdate=F,f===null&&(c.shared.lanes=0),Jn|=x,e.lanes=x,e.memoizedState=I}}function $f(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function qf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)$f(a[e],t)}var os=w(null),gi=w(0);function Yf(e,t){e=Tn,ee(gi,e),ee(os,t),Tn=e|t.baseLanes}function yc(){ee(gi,Tn),ee(os,os.current)}function bc(){Tn=gi.current,$(os),$(gi)}var Ca=w(null),Ya=null;function Xn(e){var t=e.alternate;ee(zt,zt.current&1),ee(Ca,e),Ya===null&&(t===null||os.current!==null||t.memoizedState!==null)&&(Ya=e)}function vc(e){ee(zt,zt.current),ee(Ca,e),Ya===null&&(Ya=e)}function Gf(e){e.tag===22?(ee(zt,zt.current),ee(Ca,e),Ya===null&&(Ya=e)):Qn()}function Qn(){ee(zt,zt.current),ee(Ca,Ca.current)}function Ra(e){$(Ca),Ya===e&&(Ya=null),$(zt)}var zt=w(0);function xi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Eu(a)||Cu(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 Sn=0,He=null,ct=null,Ut=null,yi=!1,cs=!1,Rr=!1,bi=0,tl=0,us=null,mb=0;function Et(){throw Error(i(321))}function _c(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!wa(e[a],t[a]))return!1;return!0}function Sc(e,t,a,s,c,f){return Sn=f,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Em:Uc,Rr=!1,f=a(s,c),Rr=!1,cs&&(f=Kf(t,a,s,c)),Vf(e),f}function Vf(e){A.H=rl;var t=ct!==null&&ct.next!==null;if(Sn=0,Ut=ct=He=null,yi=!1,tl=0,us=null,t)throw Error(i(300));e===null||Ht||(e=e.dependencies,e!==null&&ci(e)&&(Ht=!0))}function Kf(e,t,a,s){He=e;var c=0;do{if(cs&&(us=null),tl=0,cs=!1,25<=c)throw Error(i(301));if(c+=1,Ut=ct=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}A.H=Cm,f=t(a,s)}while(cs);return f}function hb(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?al(t):t,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(He.flags|=1024),t}function jc(){var e=bi!==0;return bi=0,e}function Nc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function wc(e){if(yi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}yi=!1}Sn=0,Ut=ct=He=null,cs=!1,tl=bi=0,us=null}function da(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?He.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Ot(){if(ct===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=Ut===null?He.memoizedState:Ut.next;if(t!==null)Ut=t,ct=e;else{if(e===null)throw He.alternate===null?Error(i(467)):Error(i(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},Ut===null?He.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function vi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function al(e){var t=tl;return tl+=1,us===null&&(us=[]),e=Mf(us,e,t),t=He,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Em:Uc),e}function _i(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return al(e);if(e.$$typeof===V)return Pt(e)}throw Error(i(438,String(e)))}function Ec(e){var t=null,a=He.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=He.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=vi(),He.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=W;return t.index++,a}function jn(e,t){return typeof t=="function"?t(e):t}function Si(e){var t=Ot();return Cc(t,ct,e)}function Cc(e,t,a){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=a;var c=e.baseQueue,f=s.pending;if(f!==null){if(c!==null){var x=c.next;c.next=f.next,f.next=x}t.baseQueue=c=f,s.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var S=x=null,k=null,L=t,F=!1;do{var I=L.lane&-536870913;if(I!==L.lane?(Ze&I)===I:(Sn&I)===I){var U=L.revertLane;if(U===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),I===rs&&(F=!0);else if((Sn&U)===U){L=L.next,U===rs&&(F=!0);continue}else I={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},k===null?(S=k=I,x=f):k=k.next=I,He.lanes|=U,Jn|=U;I=L.action,Rr&&a(f,I),f=L.hasEagerState?L.eagerState:a(f,I)}else U={lane:I,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},k===null?(S=k=U,x=f):k=k.next=U,He.lanes|=I,Jn|=I;L=L.next}while(L!==null&&L!==t);if(k===null?x=f:k.next=S,!wa(f,e.memoizedState)&&(Ht=!0,F&&(a=ss,a!==null)))throw a;e.memoizedState=f,e.baseState=x,e.baseQueue=k,s.lastRenderedState=f}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Rc(e){var t=Ot(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,f=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do f=e(f,x.action),x=x.next;while(x!==c);wa(f,t.memoizedState)||(Ht=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,s]}function Xf(e,t,a){var s=He,c=Ot(),f=Ie;if(f){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!wa((ct||c).memoizedState,a);if(x&&(c.memoizedState=a,Ht=!0),c=c.queue,zc(Zf.bind(null,s,c,e),[e]),c.getSnapshot!==t||x||Ut!==null&&Ut.memoizedState.tag&1){if(s.flags|=2048,ds(9,{destroy:void 0},Ff.bind(null,s,c,a,t),null),ht===null)throw Error(i(349));f||(Sn&127)!==0||Qf(s,t,a)}return a}function Qf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=He.updateQueue,t===null?(t=vi(),He.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ff(e,t,a,s){t.value=a,t.getSnapshot=s,Jf(t)&&Pf(e)}function Zf(e,t,a){return a(function(){Jf(t)&&Pf(e)})}function Jf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!wa(e,a)}catch{return!0}}function Pf(e){var t=br(e,2);t!==null&&ba(t,e,2)}function kc(e){var t=da();if(typeof e=="function"){var a=e;if(e=a(),Rr){xt(!0);try{a()}finally{xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:e},t}function If(e,t,a,s){return e.baseState=a,Cc(e,ct,typeof s=="function"?s:jn)}function pb(e,t,a,s,c){if(wi(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};A.T!==null?a(!0):f.isTransition=!1,s(f),a=t.pending,a===null?(f.next=t.pending=f,Wf(t,f)):(f.next=a.next,t.pending=a.next=f)}}function Wf(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var f=A.T,x={};A.T=x;try{var S=a(c,s),k=A.S;k!==null&&k(x,S),em(e,t,S)}catch(L){Tc(e,t,L)}finally{f!==null&&x.types!==null&&(f.types=x.types),A.T=f}}else try{f=a(c,s),em(e,t,f)}catch(L){Tc(e,t,L)}}function em(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){tm(e,t,s)},function(s){return Tc(e,t,s)}):tm(e,t,a)}function tm(e,t,a){t.status="fulfilled",t.value=a,am(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Wf(e,a)))}function Tc(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,am(t),t=t.next;while(t!==s)}e.action=null}function am(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function nm(e,t){return t}function rm(e,t){if(Ie){var a=ht.formState;if(a!==null){e:{var s=He;if(Ie){if(_t){t:{for(var c=_t,f=qa;c.nodeType!==8;){if(!f){c=null;break t}if(c=Ga(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){_t=Ga(c.nextSibling),s=c.data==="F!";break e}}qn(s)}s=!1}s&&(t=a[0])}}return a=da(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nm,lastRenderedState:t},a.queue=s,a=jm.bind(null,He,s),s.dispatch=a,s=kc(!1),f=Lc.bind(null,He,!1,s.queue),s=da(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=pb.bind(null,He,c,f,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function sm(e){var t=Ot();return lm(t,ct,e)}function lm(e,t,a){if(t=Cc(e,t,nm)[0],e=Si(jn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=al(t)}catch(x){throw x===ls?fi:x}else s=t;t=Ot();var c=t.queue,f=c.dispatch;return a!==t.memoizedState&&(He.flags|=2048,ds(9,{destroy:void 0},gb.bind(null,c,a),null)),[s,f,e]}function gb(e,t){e.action=t}function im(e){var t=Ot(),a=ct;if(a!==null)return lm(t,a,e);Ot(),t=t.memoizedState,a=Ot();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function ds(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=He.updateQueue,t===null&&(t=vi(),He.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function om(){return Ot().memoizedState}function ji(e,t,a,s){var c=da();He.flags|=e,c.memoizedState=ds(1|t,{destroy:void 0},a,s===void 0?null:s)}function Ni(e,t,a,s){var c=Ot();s=s===void 0?null:s;var f=c.memoizedState.inst;ct!==null&&s!==null&&_c(s,ct.memoizedState.deps)?c.memoizedState=ds(t,f,a,s):(He.flags|=e,c.memoizedState=ds(1|t,f,a,s))}function cm(e,t){ji(8390656,8,e,t)}function zc(e,t){Ni(2048,8,e,t)}function xb(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=vi(),He.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function um(e){var t=Ot().memoizedState;return xb({ref:t,nextImpl:e}),function(){if((rt&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function dm(e,t){return Ni(4,2,e,t)}function fm(e,t){return Ni(4,4,e,t)}function mm(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 hm(e,t,a){a=a!=null?a.concat([e]):null,Ni(4,4,mm.bind(null,t,e),a)}function Oc(){}function pm(e,t){var a=Ot();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&_c(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function gm(e,t){var a=Ot();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&_c(t,s[1]))return s[0];if(s=e(),Rr){xt(!0);try{e()}finally{xt(!1)}}return a.memoizedState=[s,t],s}function Dc(e,t,a){return a===void 0||(Sn&1073741824)!==0&&(Ze&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=xh(),He.lanes|=e,Jn|=e,a)}function xm(e,t,a,s){return wa(a,t)?a:os.current!==null?(e=Dc(e,a,s),wa(e,t)||(Ht=!0),e):(Sn&42)===0||(Sn&1073741824)!==0&&(Ze&261930)===0?(Ht=!0,e.memoizedState=a):(e=xh(),He.lanes|=e,Jn|=e,t)}function ym(e,t,a,s,c){var f=P.p;P.p=f!==0&&8>f?f:8;var x=A.T,S={};A.T=S,Lc(e,!1,t,a);try{var k=c(),L=A.S;if(L!==null&&L(S,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var F=fb(k,s);nl(e,t,F,za(e))}else nl(e,t,s,za(e))}catch(I){nl(e,t,{then:function(){},status:"rejected",reason:I},za())}finally{P.p=f,x!==null&&S.types!==null&&(x.types=S.types),A.T=x}}function yb(){}function Ac(e,t,a,s){if(e.tag!==5)throw Error(i(476));var c=bm(e).queue;ym(e,c,t,fe,a===null?yb:function(){return vm(e),a(s)})}function bm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:fe},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vm(e){var t=bm(e);t.next===null&&(t=e.alternate.memoizedState),nl(e,t.next.queue,{},za())}function Mc(){return Pt(vl)}function _m(){return Ot().memoizedState}function Sm(){return Ot().memoizedState}function bb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=za();e=Vn(a);var s=Kn(t,e,a);s!==null&&(ba(s,t,a),Is(s,t,a)),t={cache:uc()},e.payload=t;return}t=t.return}}function vb(e,t,a){var s=za();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},wi(e)?Nm(t,a):(a=Wo(e,t,a,s),a!==null&&(ba(a,e,s),wm(a,t,s)))}function jm(e,t,a){var s=za();nl(e,t,a,s)}function nl(e,t,a,s){var c={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(wi(e))Nm(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var x=t.lastRenderedState,S=f(x,a);if(c.hasEagerState=!0,c.eagerState=S,wa(S,x))return si(e,t,c,0),ht===null&&ri(),!1}catch{}if(a=Wo(e,t,c,s),a!==null)return ba(a,e,s),wm(a,t,s),!0}return!1}function Lc(e,t,a,s){if(s={lane:2,revertLane:hu(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},wi(e)){if(t)throw Error(i(479))}else t=Wo(e,a,s,2),t!==null&&ba(t,e,2)}function wi(e){var t=e.alternate;return e===He||t!==null&&t===He}function Nm(e,t){cs=yi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function wm(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,qr(e,a)}}var rl={readContext:Pt,use:_i,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};rl.useEffectEvent=Et;var Em={readContext:Pt,use:_i,useCallback:function(e,t){return da().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:cm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ji(4194308,4,mm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ji(4194308,4,e,t)},useInsertionEffect:function(e,t){ji(4,2,e,t)},useMemo:function(e,t){var a=da();t=t===void 0?null:t;var s=e();if(Rr){xt(!0);try{e()}finally{xt(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=da();if(a!==void 0){var c=a(t);if(Rr){xt(!0);try{a(t)}finally{xt(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=vb.bind(null,He,e),[s.memoizedState,e]},useRef:function(e){var t=da();return e={current:e},t.memoizedState=e},useState:function(e){e=kc(e);var t=e.queue,a=jm.bind(null,He,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Oc,useDeferredValue:function(e,t){var a=da();return Dc(a,e,t)},useTransition:function(){var e=kc(!1);return e=ym.bind(null,He,e.queue,!0,!1),da().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=He,c=da();if(Ie){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),ht===null)throw Error(i(349));(Ze&127)!==0||Qf(s,t,a)}c.memoizedState=a;var f={value:a,getSnapshot:t};return c.queue=f,cm(Zf.bind(null,s,f,e),[e]),s.flags|=2048,ds(9,{destroy:void 0},Ff.bind(null,s,f,a,t),null),a},useId:function(){var e=da(),t=ht.identifierPrefix;if(Ie){var a=cn,s=on;a=(s&~(1<<32-Dt(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=bi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=mb++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mc,useFormState:rm,useActionState:rm,useOptimistic:function(e){var t=da();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Lc.bind(null,He,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ec,useCacheRefresh:function(){return da().memoizedState=bb.bind(null,He)},useEffectEvent:function(e){var t=da(),a={impl:e};return t.memoizedState=a,function(){if((rt&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Uc={readContext:Pt,use:_i,useCallback:pm,useContext:Pt,useEffect:zc,useImperativeHandle:hm,useInsertionEffect:dm,useLayoutEffect:fm,useMemo:gm,useReducer:Si,useRef:om,useState:function(){return Si(jn)},useDebugValue:Oc,useDeferredValue:function(e,t){var a=Ot();return xm(a,ct.memoizedState,e,t)},useTransition:function(){var e=Si(jn)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:al(e),t]},useSyncExternalStore:Xf,useId:_m,useHostTransitionStatus:Mc,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var a=Ot();return If(a,ct,e,t)},useMemoCache:Ec,useCacheRefresh:Sm};Uc.useEffectEvent=um;var Cm={readContext:Pt,use:_i,useCallback:pm,useContext:Pt,useEffect:zc,useImperativeHandle:hm,useInsertionEffect:dm,useLayoutEffect:fm,useMemo:gm,useReducer:Rc,useRef:om,useState:function(){return Rc(jn)},useDebugValue:Oc,useDeferredValue:function(e,t){var a=Ot();return ct===null?Dc(a,e,t):xm(a,ct.memoizedState,e,t)},useTransition:function(){var e=Rc(jn)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:al(e),t]},useSyncExternalStore:Xf,useId:_m,useHostTransitionStatus:Mc,useFormState:im,useActionState:im,useOptimistic:function(e,t){var a=Ot();return ct!==null?If(a,ct,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ec,useCacheRefresh:Sm};Cm.useEffectEvent=um;function Hc(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:b({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Bc={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=za(),c=Vn(s);c.payload=t,a!=null&&(c.callback=a),t=Kn(e,c,s),t!==null&&(ba(t,e,s),Is(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=za(),c=Vn(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Kn(e,c,s),t!==null&&(ba(t,e,s),Is(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=za(),s=Vn(a);s.tag=2,t!=null&&(s.callback=t),t=Kn(e,s,a),t!==null&&(ba(t,e,a),Is(t,e,a))}};function Rm(e,t,a,s,c,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,x):t.prototype&&t.prototype.isPureReactComponent?!Vs(a,s)||!Vs(c,f):!0}function km(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&Bc.enqueueReplaceState(t,t.state,null)}function kr(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=b({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Tm(e){ni(e)}function zm(e){console.error(e)}function Om(e){ni(e)}function Ei(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Dm(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function $c(e,t,a){return a=Vn(a),a.tag=3,a.payload={element:null},a.callback=function(){Ei(e,t)},a}function Am(e){return e=Vn(e),e.tag=3,e}function Mm(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var f=s.value;e.payload=function(){return c(f)},e.callback=function(){Dm(t,a,s)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Dm(t,a,s),typeof c!="function"&&(Pn===null?Pn=new Set([this]):Pn.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})})}function _b(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&ns(t,a,c,!0),a=Ca.current,a!==null){switch(a.tag){case 31:case 13:return Ya===null?Hi():a.alternate===null&&Ct===0&&(Ct=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===mi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),du(e,s,c)),!1;case 22:return a.flags|=65536,s===mi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),du(e,s,c)),!1}throw Error(i(435,a.tag))}return du(e,s,c),Hi(),!1}if(Ie)return t=Ca.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==sc&&(e=Error(i(422),{cause:s}),Qs(Ha(e,a)))):(s!==sc&&(t=Error(i(423),{cause:s}),Qs(Ha(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Ha(s,a),c=$c(e.stateNode,s,c),gc(e,c),Ct!==4&&(Ct=2)),!1;var f=Error(i(520),{cause:s});if(f=Ha(f,a),fl===null?fl=[f]:fl.push(f),Ct!==4&&(Ct=2),t===null)return!0;s=Ha(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=$c(a.stateNode,s,e),gc(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Pn===null||!Pn.has(f))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Am(c),Mm(c,e,a,s),gc(a,c),!1}a=a.return}while(a!==null);return!1}var qc=Error(i(461)),Ht=!1;function It(e,t,a,s){t.child=e===null?Bf(t,null,a,s):Cr(t,e.child,a,s)}function Lm(e,t,a,s,c){a=a.render;var f=t.ref;if("ref"in s){var x={};for(var S in s)S!=="ref"&&(x[S]=s[S])}else x=s;return jr(t),s=Sc(e,t,a,x,f,c),S=jc(),e!==null&&!Ht?(Nc(e,t,c),Nn(e,t,c)):(Ie&&S&&nc(t),t.flags|=1,It(e,t,s,c),t.child)}function Um(e,t,a,s,c){if(e===null){var f=a.type;return typeof f=="function"&&!ec(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,Hm(e,t,f,s,c)):(e=ii(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Zc(e,c)){var x=f.memoizedProps;if(a=a.compare,a=a!==null?a:Vs,a(x,s)&&e.ref===t.ref)return Nn(e,t,c)}return t.flags|=1,e=yn(f,s),e.ref=t.ref,e.return=t,t.child=e}function Hm(e,t,a,s,c){if(e!==null){var f=e.memoizedProps;if(Vs(f,s)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=s=f,Zc(e,c))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,Nn(e,t,c)}return Yc(e,t,a,s,c)}function Bm(e,t,a,s){var c=s.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~f}else s=0,t.child=null;return $m(e,t,f,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&di(t,f!==null?f.cachePool:null),f!==null?Yf(t,f):yc(),Gf(t);else return s=t.lanes=536870912,$m(e,t,f!==null?f.baseLanes|a:a,a,s)}else f!==null?(di(t,f.cachePool),Yf(t,f),Qn(),t.memoizedState=null):(e!==null&&di(t,null),yc(),Qn());return It(e,t,c,a),t.child}function sl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $m(e,t,a,s,c){var f=fc();return f=f===null?null:{parent:Lt._currentValue,pool:f},t.memoizedState={baseLanes:a,cachePool:f},e!==null&&di(t,null),yc(),Gf(t),e!==null&&ns(e,t,s,!0),t.childLanes=c,null}function Ci(e,t){return t=ki({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qm(e,t,a){return Cr(t,e.child,null,a),e=Ci(t,t.pendingProps),e.flags|=2,Ra(t),t.memoizedState=null,e}function Sb(e,t,a){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(s.mode==="hidden")return e=Ci(t,s),t.lanes=536870912,sl(null,e);if(vc(t),(e=_t)?(e=Wh(e,qa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bn!==null?{id:on,overflow:cn}:null,retryLane:536870912,hydrationErrors:null},a=Nf(e),a.return=t,t.child=a,Jt=t,_t=null)):e=null,e===null)throw qn(t);return t.lanes=536870912,null}return Ci(t,s)}var f=e.memoizedState;if(f!==null){var x=f.dehydrated;if(vc(t),c)if(t.flags&256)t.flags&=-257,t=qm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ht||ns(e,t,a,!1),c=(a&e.childLanes)!==0,Ht||c){if(s=ht,s!==null&&(x=R(s,a),x!==0&&x!==f.retryLane))throw f.retryLane=x,br(e,x),ba(s,e,x),qc;Hi(),t=qm(e,t,a)}else e=f.treeContext,_t=Ga(x.nextSibling),Jt=t,Ie=!0,$n=null,qa=!1,e!==null&&Cf(t,e),t=Ci(t,s),t.flags|=4096;return t}return e=yn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ri(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 Yc(e,t,a,s,c){return jr(t),a=Sc(e,t,a,s,void 0,c),s=jc(),e!==null&&!Ht?(Nc(e,t,c),Nn(e,t,c)):(Ie&&s&&nc(t),t.flags|=1,It(e,t,a,c),t.child)}function Ym(e,t,a,s,c,f){return jr(t),t.updateQueue=null,a=Kf(t,s,a,c),Vf(e),s=jc(),e!==null&&!Ht?(Nc(e,t,f),Nn(e,t,f)):(Ie&&s&&nc(t),t.flags|=1,It(e,t,a,f),t.child)}function Gm(e,t,a,s,c){if(jr(t),t.stateNode===null){var f=Wr,x=a.contextType;typeof x=="object"&&x!==null&&(f=Pt(x)),f=new a(s,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Bc,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=s,f.state=t.memoizedState,f.refs={},hc(t),x=a.contextType,f.context=typeof x=="object"&&x!==null?Pt(x):Wr,f.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Hc(t,a,x,s),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Bc.enqueueReplaceState(f,f.state,null),el(t,s,f,c),Ws(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,k=kr(a,S);f.props=k;var L=f.context,F=a.contextType;x=Wr,typeof F=="object"&&F!==null&&(x=Pt(F));var I=a.getDerivedStateFromProps;F=typeof I=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,F||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||L!==x)&&km(t,f,s,x),Gn=!1;var U=t.memoizedState;f.state=U,el(t,s,f,c),Ws(),L=t.memoizedState,S||U!==L||Gn?(typeof I=="function"&&(Hc(t,a,I,s),L=t.memoizedState),(k=Gn||Rm(t,a,k,s,U,L,x))?(F||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=L),f.props=s,f.state=L,f.context=x,s=k):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,pc(e,t),x=t.memoizedProps,F=kr(a,x),f.props=F,I=t.pendingProps,U=f.context,L=a.contextType,k=Wr,typeof L=="object"&&L!==null&&(k=Pt(L)),S=a.getDerivedStateFromProps,(L=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==I||U!==k)&&km(t,f,s,k),Gn=!1,U=t.memoizedState,f.state=U,el(t,s,f,c),Ws();var K=t.memoizedState;x!==I||U!==K||Gn||e!==null&&e.dependencies!==null&&ci(e.dependencies)?(typeof S=="function"&&(Hc(t,a,S,s),K=t.memoizedState),(F=Gn||Rm(t,a,F,s,U,K,k)||e!==null&&e.dependencies!==null&&ci(e.dependencies))?(L||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,K,k),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,K,k)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=K),f.props=s,f.state=K,f.context=k,s=F):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),s=!1)}return f=s,Ri(e,t),s=(t.flags&128)!==0,f||s?(f=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&s?(t.child=Cr(t,e.child,null,c),t.child=Cr(t,null,a,c)):It(e,t,a,c),t.memoizedState=f.state,e=t.child):e=Nn(e,t,c),e}function Vm(e,t,a,s){return _r(),t.flags|=256,It(e,t,a,s),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vc(e){return{baseLanes:e,cachePool:Df()}}function Kc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ta),e}function Km(e,t,a){var s=t.pendingProps,c=!1,f=(t.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(zt.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(c?Xn(t):Qn(),(e=_t)?(e=Wh(e,qa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bn!==null?{id:on,overflow:cn}:null,retryLane:536870912,hydrationErrors:null},a=Nf(e),a.return=t,t.child=a,Jt=t,_t=null)):e=null,e===null)throw qn(t);return Cu(e)?t.lanes=32:t.lanes=536870912,null}var S=s.children;return s=s.fallback,c?(Qn(),c=t.mode,S=ki({mode:"hidden",children:S},c),s=vr(s,c,a,null),S.return=t,s.return=t,S.sibling=s,t.child=S,s=t.child,s.memoizedState=Vc(a),s.childLanes=Kc(e,x,a),t.memoizedState=Gc,sl(null,s)):(Xn(t),Xc(t,S))}var k=e.memoizedState;if(k!==null&&(S=k.dehydrated,S!==null)){if(f)t.flags&256?(Xn(t),t.flags&=-257,t=Qc(e,t,a)):t.memoizedState!==null?(Qn(),t.child=e.child,t.flags|=128,t=null):(Qn(),S=s.fallback,c=t.mode,s=ki({mode:"visible",children:s.children},c),S=vr(S,c,a,null),S.flags|=2,s.return=t,S.return=t,s.sibling=S,t.child=s,Cr(t,e.child,null,a),s=t.child,s.memoizedState=Vc(a),s.childLanes=Kc(e,x,a),t.memoizedState=Gc,t=sl(null,s));else if(Xn(t),Cu(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var L=x.dgst;x=L,s=Error(i(419)),s.stack="",s.digest=x,Qs({value:s,source:null,stack:null}),t=Qc(e,t,a)}else if(Ht||ns(e,t,a,!1),x=(a&e.childLanes)!==0,Ht||x){if(x=ht,x!==null&&(s=R(x,a),s!==0&&s!==k.retryLane))throw k.retryLane=s,br(e,s),ba(x,e,s),qc;Eu(S)||Hi(),t=Qc(e,t,a)}else Eu(S)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,_t=Ga(S.nextSibling),Jt=t,Ie=!0,$n=null,qa=!1,e!==null&&Cf(t,e),t=Xc(t,s.children),t.flags|=4096);return t}return c?(Qn(),S=s.fallback,c=t.mode,k=e.child,L=k.sibling,s=yn(k,{mode:"hidden",children:s.children}),s.subtreeFlags=k.subtreeFlags&65011712,L!==null?S=yn(L,S):(S=vr(S,c,a,null),S.flags|=2),S.return=t,s.return=t,s.sibling=S,t.child=s,sl(null,s),s=t.child,S=e.child.memoizedState,S===null?S=Vc(a):(c=S.cachePool,c!==null?(k=Lt._currentValue,c=c.parent!==k?{parent:k,pool:k}:c):c=Df(),S={baseLanes:S.baseLanes|a,cachePool:c}),s.memoizedState=S,s.childLanes=Kc(e,x,a),t.memoizedState=Gc,sl(e.child,s)):(Xn(t),a=e.child,e=a.sibling,a=yn(a,{mode:"visible",children:s.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 Xc(e,t){return t=ki({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ki(e,t){return e=Ea(22,e,null,t),e.lanes=0,e}function Qc(e,t,a){return Cr(t,e.child,null,a),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xm(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),oc(e.return,t,a)}function Fc(e,t,a,s,c,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c,treeForkCount:f}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=s,x.tail=a,x.tailMode=c,x.treeForkCount=f)}function Qm(e,t,a){var s=t.pendingProps,c=s.revealOrder,f=s.tail;s=s.children;var x=zt.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,ee(zt,x),It(e,t,s,a),s=Ie?Xs:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xm(e,a,t);else if(e.tag===19)Xm(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&&xi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Fc(t,!1,c,a,f,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&xi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Fc(t,!0,a,null,f,s);break;case"together":Fc(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Nn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Jn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ns(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=yn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=yn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Zc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ci(e)))}function jb(e,t,a){switch(t.tag){case 3:Pe(t,t.stateNode.containerInfo),Yn(t,Lt,e.memoizedState.cache),_r();break;case 27:case 5:ea(t);break;case 4:Pe(t,t.stateNode.containerInfo);break;case 10:Yn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,vc(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Xn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Km(e,t,a):(Xn(t),e=Nn(e,t,a),e!==null?e.sibling:null);Xn(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(ns(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return Qm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ee(zt,zt.current),s)break;return null;case 22:return t.lanes=0,Bm(e,t,a,t.pendingProps);case 24:Yn(t,Lt,e.memoizedState.cache)}return Nn(e,t,a)}function Fm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Zc(e,a)&&(t.flags&128)===0)return Ht=!1,jb(e,t,a);Ht=(e.flags&131072)!==0}else Ht=!1,Ie&&(t.flags&1048576)!==0&&Ef(t,Xs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=wr(t.elementType),t.type=e,typeof e=="function")ec(e)?(s=kr(e,s),t.tag=1,t=Gm(null,t,e,s,a)):(t.tag=0,t=Yc(null,t,e,s,a));else{if(e!=null){var c=e.$$typeof;if(c===Y){t.tag=11,t=Lm(null,t,e,s,a);break e}else if(c===G){t.tag=14,t=Um(null,t,e,s,a);break e}}throw t=ce(e)||e,Error(i(306,t,""))}}return t;case 0:return Yc(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=kr(s,t.pendingProps),Gm(e,t,s,c,a);case 3:e:{if(Pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));s=t.pendingProps;var f=t.memoizedState;c=f.element,pc(e,t),el(t,s,null,a);var x=t.memoizedState;if(s=x.cache,Yn(t,Lt,s),s!==f.cache&&cc(t,[Lt],a,!0),Ws(),s=x.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Vm(e,t,s,a);break e}else if(s!==c){c=Ha(Error(i(424)),t),Qs(c),t=Vm(e,t,s,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,_t=Ga(e.firstChild),Jt=t,Ie=!0,$n=null,qa=!0,a=Bf(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(_r(),s===c){t=Nn(e,t,a);break e}It(e,t,s,a)}t=t.child}return t;case 26:return Ri(e,t),e===null?(a=sp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ie||(a=t.type,e=t.pendingProps,s=Ki(ve.current).createElement(a),s[ue]=t,s[he]=e,Wt(s,a,e),yt(s),t.stateNode=s):t.memoizedState=sp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ea(t),e===null&&Ie&&(s=t.stateNode=ap(t.type,t.pendingProps,ve.current),Jt=t,qa=!0,c=_t,tr(t.type)?(Ru=c,_t=Ga(s.firstChild)):_t=c),It(e,t,t.pendingProps.children,a),Ri(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((c=s=_t)&&(s=Wb(s,t.type,t.pendingProps,qa),s!==null?(t.stateNode=s,Jt=t,_t=Ga(s.firstChild),qa=!1,c=!0):c=!1),c||qn(t)),ea(t),c=t.type,f=t.pendingProps,x=e!==null?e.memoizedProps:null,s=f.children,ju(c,f)?s=null:x!==null&&ju(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=Sc(e,t,hb,null,null,a),vl._currentValue=c),Ri(e,t),It(e,t,s,a),t.child;case 6:return e===null&&Ie&&((e=a=_t)&&(a=ev(a,t.pendingProps,qa),a!==null?(t.stateNode=a,Jt=t,_t=null,e=!0):e=!1),e||qn(t)),null;case 13:return Km(e,t,a);case 4:return Pe(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Cr(t,null,s,a):It(e,t,s,a),t.child;case 11:return Lm(e,t,t.type,t.pendingProps,a);case 7:return It(e,t,t.pendingProps,a),t.child;case 8:return It(e,t,t.pendingProps.children,a),t.child;case 12:return It(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,Yn(t,t.type,s.value),It(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,jr(t),c=Pt(c),s=s(c),t.flags|=1,It(e,t,s,a),t.child;case 14:return Um(e,t,t.type,t.pendingProps,a);case 15:return Hm(e,t,t.type,t.pendingProps,a);case 19:return Qm(e,t,a);case 31:return Sb(e,t,a);case 22:return Bm(e,t,a,t.pendingProps);case 24:return jr(t),s=Pt(Lt),e===null?(c=fc(),c===null&&(c=ht,f=uc(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=a),c=f),t.memoizedState={parent:s,cache:c},hc(t),Yn(t,Lt,c)):((e.lanes&a)!==0&&(pc(e,t),el(t,null,null,a),Ws()),c=e.memoizedState,f=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Yn(t,Lt,s)):(s=f.cache,Yn(t,Lt,s),s!==c.cache&&cc(t,[Lt],a,!0))),It(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function wn(e){e.flags|=4}function Jc(e,t,a,s,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(_h())e.flags|=8192;else throw Er=mi,mc}else e.flags&=-16777217}function Zm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!up(t))if(_h())e.flags|=8192;else throw Er=mi,mc}function Ti(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ua():536870912,e.lanes|=t,ps|=t)}function ll(e,t){if(!Ie)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 s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function Nb(e,t,a){var s=t.pendingProps;switch(rc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return St(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),_n(Lt),Xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(as(t)?wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,lc())),St(t),null;case 26:var c=t.type,f=t.memoizedState;return e===null?(wn(t),f!==null?(St(t),Zm(t,f)):(St(t),Jc(t,c,null,s,a))):f?f!==e.memoizedState?(wn(t),St(t),Zm(t,f)):(St(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&wn(t),St(t),Jc(t,c,e,s,a)),null;case 27:if(ma(t),a=ve.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&wn(t);else{if(!s){if(t.stateNode===null)throw Error(i(166));return St(t),null}e=ae.current,as(t)?Rf(t):(e=ap(c,s,a),t.stateNode=e,wn(t))}return St(t),null;case 5:if(ma(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&wn(t);else{if(!s){if(t.stateNode===null)throw Error(i(166));return St(t),null}if(f=ae.current,as(t))Rf(t);else{var x=Ki(ve.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?x.createElement("select",{is:s.is}):x.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?x.createElement(c,{is:s.is}):x.createElement(c)}}f[ue]=t,f[he]=s;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)f.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=f;e:switch(Wt(f,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&wn(t)}}return St(t),Jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&wn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(i(166));if(e=ve.current,as(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=Jt,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[ue]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||Kh(e.nodeValue,a)),e||qn(t,!0)}else e=Ki(e).createTextNode(s),e[ue]=t,t.stateNode=e}return St(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=as(t),a!==null){if(e===null){if(!s)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[ue]=t}else _r(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),e=!1}else a=lc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Ra(t),t):(Ra(t),null);if((t.flags&128)!==0)throw Error(i(558))}return St(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=as(t),s!==null&&s.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[ue]=t}else _r(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),c=!1}else c=lc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Ra(t),t):(Ra(t),null)}return Ra(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==c&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ti(t,t.updateQueue),St(t),null);case 4:return Xe(),e===null&&yu(t.stateNode.containerInfo),St(t),null;case 10:return _n(t.type),St(t),null;case 19:if($(zt),s=t.memoizedState,s===null)return St(t),null;if(c=(t.flags&128)!==0,f=s.rendering,f===null)if(c)ll(s,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=xi(e),f!==null){for(t.flags|=128,ll(s,!1),e=f.updateQueue,t.updateQueue=e,Ti(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)jf(a,e),a=a.sibling;return ee(zt,zt.current&1|2),Ie&&bn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&pt()>Mi&&(t.flags|=128,c=!0,ll(s,!1),t.lanes=4194304)}else{if(!c)if(e=xi(f),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ti(t,e),ll(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!Ie)return St(t),null}else 2*pt()-s.renderingStartTime>Mi&&a!==536870912&&(t.flags|=128,c=!0,ll(s,!1),t.lanes=4194304);s.isBackwards?(f.sibling=t.child,t.child=f):(e=s.last,e!==null?e.sibling=f:t.child=f,s.last=f)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=pt(),e.sibling=null,a=zt.current,ee(zt,c?a&1|2:a&1),Ie&&bn(t,s.treeForkCount),e):(St(t),null);case 22:case 23:return Ra(t),bc(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),a=t.updateQueue,a!==null&&Ti(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&$(Nr),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),_n(Lt),St(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function wb(e,t){switch(rc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _n(Lt),Xe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ma(t),null;case 31:if(t.memoizedState!==null){if(Ra(t),t.alternate===null)throw Error(i(340));_r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ra(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));_r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(zt),null;case 4:return Xe(),null;case 10:return _n(t.type),null;case 22:case 23:return Ra(t),bc(),e!==null&&$(Nr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _n(Lt),null;case 25:return null;default:return null}}function Jm(e,t){switch(rc(t),t.tag){case 3:_n(Lt),Xe();break;case 26:case 27:case 5:ma(t);break;case 4:Xe();break;case 31:t.memoizedState!==null&&Ra(t);break;case 13:Ra(t);break;case 19:$(zt);break;case 10:_n(t.type);break;case 22:case 23:Ra(t),bc(),e!==null&&$(Nr);break;case 24:_n(Lt)}}function il(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var f=a.create,x=a.inst;s=f(),x.destroy=s}a=a.next}while(a!==c)}}catch(S){ot(t,t.return,S)}}function Fn(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var f=c.next;s=f;do{if((s.tag&e)===e){var x=s.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,c=t;var k=a,L=S;try{L()}catch(F){ot(c,k,F)}}}s=s.next}while(s!==f)}}catch(F){ot(t,t.return,F)}}function Pm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{qf(t,a)}catch(s){ot(e,e.return,s)}}}function Im(e,t,a){a.props=kr(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){ot(e,t,s)}}function ol(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){ot(e,t,c)}}function un(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){ot(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){ot(e,t,c)}else a.current=null}function Wm(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){ot(e,e.return,c)}}function Pc(e,t,a){try{var s=e.stateNode;Qb(s,e.type,a,t),s[he]=t}catch(c){ot(e,e.return,c)}}function eh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tr(e.type)||e.tag===4}function Ic(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||eh(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&&tr(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 Wc(e,t,a){var s=e.tag;if(s===5||s===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=gn));else if(s!==4&&(s===27&&tr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Wc(e,t,a),e=e.sibling;e!==null;)Wc(e,t,a),e=e.sibling}function zi(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&tr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(zi(e,t,a),e=e.sibling;e!==null;)zi(e,t,a),e=e.sibling}function th(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Wt(t,s,a),t[ue]=e,t[he]=a}catch(f){ot(e,e.return,f)}}var En=!1,Bt=!1,eu=!1,ah=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function Eb(e,t){if(e=e.containerInfo,_u=Ii,e=hf(e),Qo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var x=0,S=-1,k=-1,L=0,F=0,I=e,U=null;t:for(;;){for(var K;I!==a||c!==0&&I.nodeType!==3||(S=x+c),I!==f||s!==0&&I.nodeType!==3||(k=x+s),I.nodeType===3&&(x+=I.nodeValue.length),(K=I.firstChild)!==null;)U=I,I=K;for(;;){if(I===e)break t;if(U===a&&++L===c&&(S=x),U===f&&++F===s&&(k=x),(K=I.nextSibling)!==null)break;I=U,U=I.parentNode}I=K}a=S===-1||k===-1?null:{start:S,end:k}}else a=null}a=a||{start:0,end:0}}else a=null;for(Su={focusedElem:e,selectionRange:a},Ii=!1,Xt=t;Xt!==null;)if(t=Xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xt=e;else for(;Xt!==null;){switch(t=Xt,f=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&&f!==null){e=void 0,a=t,c=f.memoizedProps,f=f.memoizedState,s=a.stateNode;try{var be=kr(a.type,c);e=s.getSnapshotBeforeUpdate(be,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(ke){ot(a,a.return,ke)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)wu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":wu(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,Xt=e;break}Xt=t.return}}function nh(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(e,a),s&4&&il(5,a);break;case 1:if(Rn(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){ot(a,a.return,x)}else{var c=kr(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){ot(a,a.return,x)}}s&64&&Pm(a),s&512&&ol(a,a.return);break;case 3:if(Rn(e,a),s&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{qf(e,t)}catch(x){ot(a,a.return,x)}}break;case 27:t===null&&s&4&&th(a);case 26:case 5:Rn(e,a),t===null&&s&4&&Wm(a),s&512&&ol(a,a.return);break;case 12:Rn(e,a);break;case 31:Rn(e,a),s&4&&lh(e,a);break;case 13:Rn(e,a),s&4&&ih(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Mb.bind(null,a),tv(e,a))));break;case 22:if(s=a.memoizedState!==null||En,!s){t=t!==null&&t.memoizedState!==null||Bt,c=En;var f=Bt;En=s,(Bt=t)&&!f?kn(e,a,(a.subtreeFlags&8772)!==0):Rn(e,a),En=c,Bt=f}break;case 30:break;default:Rn(e,a)}}function rh(e){var t=e.alternate;t!==null&&(e.alternate=null,rh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(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 jt=null,pa=!1;function Cn(e,t,a){for(a=a.child;a!==null;)sh(e,t,a),a=a.sibling}function sh(e,t,a){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Zt,a)}catch{}switch(a.tag){case 26:Bt||un(a,t),Cn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||un(a,t);var s=jt,c=pa;tr(a.type)&&(jt=a.stateNode,pa=!1),Cn(e,t,a),xl(a.stateNode),jt=s,pa=c;break;case 5:Bt||un(a,t);case 6:if(s=jt,c=pa,jt=null,Cn(e,t,a),jt=s,pa=c,jt!==null)if(pa)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(a.stateNode)}catch(f){ot(a,t,f)}else try{jt.removeChild(a.stateNode)}catch(f){ot(a,t,f)}break;case 18:jt!==null&&(pa?(e=jt,Ph(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),js(e)):Ph(jt,a.stateNode));break;case 4:s=jt,c=pa,jt=a.stateNode.containerInfo,pa=!0,Cn(e,t,a),jt=s,pa=c;break;case 0:case 11:case 14:case 15:Fn(2,a,t),Bt||Fn(4,a,t),Cn(e,t,a);break;case 1:Bt||(un(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Im(a,t,s)),Cn(e,t,a);break;case 21:Cn(e,t,a);break;case 22:Bt=(s=Bt)||a.memoizedState!==null,Cn(e,t,a),Bt=s;break;default:Cn(e,t,a)}}function lh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{js(e)}catch(a){ot(t,t.return,a)}}}function ih(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{js(e)}catch(a){ot(t,t.return,a)}}function Cb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ah),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ah),t;default:throw Error(i(435,e.tag))}}function Oi(e,t){var a=Cb(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var c=Lb.bind(null,e,s);s.then(c,c)}})}function ga(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],f=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(tr(S.type)){jt=S.stateNode,pa=!1;break e}break;case 5:jt=S.stateNode,pa=!1;break e;case 3:case 4:jt=S.stateNode.containerInfo,pa=!0;break e}S=S.return}if(jt===null)throw Error(i(160));sh(f,x,c),jt=null,pa=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)oh(t,e),t=t.sibling}var tn=null;function oh(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ga(t,e),xa(e),s&4&&(Fn(3,e,e.return),il(3,e),Fn(5,e,e.return));break;case 1:ga(t,e),xa(e),s&512&&(Bt||a===null||un(a,a.return)),s&64&&En&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=tn;if(ga(t,e),xa(e),s&512&&(Bt||a===null||un(a,a.return)),s&4){var f=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Ye]||f[ue]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(s),c.head.insertBefore(f,c.querySelector("head > title"))),Wt(f,s,a),f[ue]=e,yt(f),s=f;break e;case"link":var x=op("link","href",c).get(s+(a.href||""));if(x){for(var S=0;S<x.length;S++)if(f=x[S],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(S,1);break t}}f=c.createElement(s),Wt(f,s,a),c.head.appendChild(f);break;case"meta":if(x=op("meta","content",c).get(s+(a.content||""))){for(S=0;S<x.length;S++)if(f=x[S],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(S,1);break t}}f=c.createElement(s),Wt(f,s,a),c.head.appendChild(f);break;default:throw Error(i(468,s))}f[ue]=e,yt(f),s=f}e.stateNode=s}else cp(c,e.type,e.stateNode);else e.stateNode=ip(c,s,e.memoizedProps);else f!==s?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,s===null?cp(c,e.type,e.stateNode):ip(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Pc(e,e.memoizedProps,a.memoizedProps)}break;case 27:ga(t,e),xa(e),s&512&&(Bt||a===null||un(a,a.return)),a!==null&&s&4&&Pc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ga(t,e),xa(e),s&512&&(Bt||a===null||un(a,a.return)),e.flags&32){c=e.stateNode;try{Xr(c,"")}catch(be){ot(e,e.return,be)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,Pc(e,c,a!==null?a.memoizedProps:c)),s&1024&&(eu=!0);break;case 6:if(ga(t,e),xa(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(be){ot(e,e.return,be)}}break;case 3:if(Fi=null,c=tn,tn=Xi(t.containerInfo),ga(t,e),tn=c,xa(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{js(t.containerInfo)}catch(be){ot(e,e.return,be)}eu&&(eu=!1,ch(e));break;case 4:s=tn,tn=Xi(e.stateNode.containerInfo),ga(t,e),xa(e),tn=s;break;case 12:ga(t,e),xa(e);break;case 31:ga(t,e),xa(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Oi(e,s)));break;case 13:ga(t,e),xa(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ai=pt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Oi(e,s)));break;case 22:c=e.memoizedState!==null;var k=a!==null&&a.memoizedState!==null,L=En,F=Bt;if(En=L||c,Bt=F||k,ga(t,e),Bt=F,En=L,xa(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||k||En||Bt||Tr(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){k=a=t;try{if(f=k.stateNode,c)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=k.stateNode;var I=k.memoizedProps.style,U=I!=null&&I.hasOwnProperty("display")?I.display:null;S.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(be){ot(k,k.return,be)}}}else if(t.tag===6){if(a===null){k=t;try{k.stateNode.nodeValue=c?"":k.memoizedProps}catch(be){ot(k,k.return,be)}}}else if(t.tag===18){if(a===null){k=t;try{var K=k.stateNode;c?Ih(K,!0):Ih(k.stateNode,!1)}catch(be){ot(k,k.return,be)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Oi(e,a))));break;case 19:ga(t,e),xa(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Oi(e,s)));break;case 30:break;case 21:break;default:ga(t,e),xa(e)}}function xa(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(eh(s)){a=s;break}s=s.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,f=Ic(e);zi(e,f,c);break;case 5:var x=a.stateNode;a.flags&32&&(Xr(x,""),a.flags&=-33);var S=Ic(e);zi(e,S,x);break;case 3:case 4:var k=a.stateNode.containerInfo,L=Ic(e);Wc(e,L,k);break;default:throw Error(i(161))}}catch(F){ot(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ch(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ch(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Rn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nh(e,t.alternate,t),t=t.sibling}function Tr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Fn(4,t,t.return),Tr(t);break;case 1:un(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Im(t,t.return,a),Tr(t);break;case 27:xl(t.stateNode);case 26:case 5:un(t,t.return),Tr(t);break;case 22:t.memoizedState===null&&Tr(t);break;case 30:Tr(t);break;default:Tr(t)}e=e.sibling}}function kn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,f=t,x=f.flags;switch(f.tag){case 0:case 11:case 15:kn(c,f,a),il(4,f);break;case 1:if(kn(c,f,a),s=f,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){ot(s,s.return,L)}if(s=f,c=s.updateQueue,c!==null){var S=s.stateNode;try{var k=c.shared.hiddenCallbacks;if(k!==null)for(c.shared.hiddenCallbacks=null,c=0;c<k.length;c++)$f(k[c],S)}catch(L){ot(s,s.return,L)}}a&&x&64&&Pm(f),ol(f,f.return);break;case 27:th(f);case 26:case 5:kn(c,f,a),a&&s===null&&x&4&&Wm(f),ol(f,f.return);break;case 12:kn(c,f,a);break;case 31:kn(c,f,a),a&&x&4&&lh(c,f);break;case 13:kn(c,f,a),a&&x&4&&ih(c,f);break;case 22:f.memoizedState===null&&kn(c,f,a),ol(f,f.return);break;case 30:break;default:kn(c,f,a)}t=t.sibling}}function tu(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&&Fs(a))}function au(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fs(e))}function an(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)uh(e,t,a,s),t=t.sibling}function uh(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:an(e,t,a,s),c&2048&&il(9,t);break;case 1:an(e,t,a,s);break;case 3:an(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fs(e)));break;case 12:if(c&2048){an(e,t,a,s),e=t.stateNode;try{var f=t.memoizedProps,x=f.id,S=f.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){ot(t,t.return,k)}}else an(e,t,a,s);break;case 31:an(e,t,a,s);break;case 13:an(e,t,a,s);break;case 23:break;case 22:f=t.stateNode,x=t.alternate,t.memoizedState!==null?f._visibility&2?an(e,t,a,s):cl(e,t):f._visibility&2?an(e,t,a,s):(f._visibility|=2,fs(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&tu(x,t);break;case 24:an(e,t,a,s),c&2048&&au(t.alternate,t);break;default:an(e,t,a,s)}}function fs(e,t,a,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,x=t,S=a,k=s,L=x.flags;switch(x.tag){case 0:case 11:case 15:fs(f,x,S,k,c),il(8,x);break;case 23:break;case 22:var F=x.stateNode;x.memoizedState!==null?F._visibility&2?fs(f,x,S,k,c):cl(f,x):(F._visibility|=2,fs(f,x,S,k,c)),c&&L&2048&&tu(x.alternate,x);break;case 24:fs(f,x,S,k,c),c&&L&2048&&au(x.alternate,x);break;default:fs(f,x,S,k,c)}t=t.sibling}}function cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:cl(a,s),c&2048&&tu(s.alternate,s);break;case 24:cl(a,s),c&2048&&au(s.alternate,s);break;default:cl(a,s)}t=t.sibling}}var ul=8192;function ms(e,t,a){if(e.subtreeFlags&ul)for(e=e.child;e!==null;)dh(e,t,a),e=e.sibling}function dh(e,t,a){switch(e.tag){case 26:ms(e,t,a),e.flags&ul&&e.memoizedState!==null&&mv(a,tn,e.memoizedState,e.memoizedProps);break;case 5:ms(e,t,a);break;case 3:case 4:var s=tn;tn=Xi(e.stateNode.containerInfo),ms(e,t,a),tn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=ul,ul=16777216,ms(e,t,a),ul=s):ms(e,t,a));break;default:ms(e,t,a)}}function fh(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 dl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];Xt=s,hh(s,e)}fh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)mh(e),e=e.sibling}function mh(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&Fn(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Di(e)):dl(e);break;default:dl(e)}}function Di(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];Xt=s,hh(s,e)}fh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Fn(8,t,t.return),Di(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Di(t));break;default:Di(t)}e=e.sibling}}function hh(e,t){for(;Xt!==null;){var a=Xt;switch(a.tag){case 0:case 11:case 15:Fn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Fs(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,Xt=s;else e:for(a=e;Xt!==null;){s=Xt;var c=s.sibling,f=s.return;if(rh(s),s===a){Xt=null;break e}if(c!==null){c.return=f,Xt=c;break e}Xt=f}}}var Rb={getCacheForType:function(e){var t=Pt(Lt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Pt(Lt).controller.signal}},kb=typeof WeakMap=="function"?WeakMap:Map,rt=0,ht=null,Ve=null,Ze=0,it=0,ka=null,Zn=!1,hs=!1,nu=!1,Tn=0,Ct=0,Jn=0,zr=0,ru=0,Ta=0,ps=0,fl=null,ya=null,su=!1,Ai=0,ph=0,Mi=1/0,Li=null,Pn=null,Gt=0,In=null,gs=null,zn=0,lu=0,iu=null,gh=null,ml=0,ou=null;function za(){return(rt&2)!==0&&Ze!==0?Ze&-Ze:A.T!==null?hu():ne()}function xh(){if(Ta===0)if((Ze&536870912)===0||Ie){var e=ie;ie<<=1,(ie&3932160)===0&&(ie=262144),Ta=e}else Ta=536870912;return e=Ca.current,e!==null&&(e.flags|=32),Ta}function ba(e,t,a){(e===ht&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(xs(e,0),Wn(e,Ze,Ta,!1)),Na(e,a),((rt&2)===0||e!==ht)&&(e===ht&&((rt&2)===0&&(zr|=a),Ct===4&&Wn(e,Ze,Ta,!1)),dn(e))}function yh(e,t,a){if((rt&6)!==0)throw Error(i(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||At(e,t),c=s?Ob(e,t):uu(e,t,!0),f=s;do{if(c===0){hs&&!s&&Wn(e,t,0,!1);break}else{if(a=e.current.alternate,f&&!Tb(a)){c=uu(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)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=fl;var k=S.current.memoizedState.isDehydrated;if(k&&(xs(S,x).flags|=256),x=uu(S,x,!1),x!==2){if(nu&&!k){S.errorRecoveryDisabledLanes|=f,zr|=f,c=4;break e}f=ya,ya=c,f!==null&&(ya===null?ya=f:ya.push.apply(ya,f))}c=x}if(f=!1,c!==2)continue}}if(c===1){xs(e,0),Wn(e,t,0,!0);break}e:{switch(s=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Wn(s,t,Ta,!Zn);break e;case 2:ya=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Ai+300-pt(),10<c)){if(Wn(s,t,Ta,!Zn),Ue(s,0,!0)!==0)break e;zn=t,s.timeoutHandle=Zh(bh.bind(null,s,a,ya,Li,su,t,Ta,zr,ps,Zn,f,"Throttled",-0,0),c);break e}bh(s,a,ya,Li,su,t,Ta,zr,ps,Zn,f,null,-0,0)}}break}while(!0);dn(e)}function bh(e,t,a,s,c,f,x,S,k,L,F,I,U,K){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:gn},dh(t,f,I);var be=(f&62914560)===f?Ai-pt():(f&4194048)===f?ph-pt():0;if(be=hv(I,be),be!==null){zn=f,e.cancelPendingCommit=be(Ch.bind(null,e,t,f,a,s,c,x,S,k,F,I,null,U,K)),Wn(e,f,x,!L);return}}Ch(e,t,f,a,s,c,x,S,k)}function Tb(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 s=0;s<a.length;s++){var c=a[s],f=c.getSnapshot;c=c.value;try{if(!wa(f(),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 Wn(e,t,a,s){t&=~ru,t&=~zr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var f=31-Dt(c),x=1<<f;s[f]=-1,c&=~x}a!==0&&$r(e,a,t)}function Ui(){return(rt&6)===0?(hl(0),!1):!0}function cu(){if(Ve!==null){if(it===0)var e=Ve.return;else e=Ve,vn=Sr=null,wc(e),is=null,Js=0,e=Ve;for(;e!==null;)Jm(e.alternate,e),e=e.return;Ve=null}}function xs(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Jb(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),zn=0,cu(),ht=e,Ve=a=yn(e.current,null),Ze=t,it=0,ka=null,Zn=!1,hs=At(e,t),nu=!1,ps=Ta=ru=zr=Jn=Ct=0,ya=fl=null,su=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-Dt(s),f=1<<c;t|=e[c],s&=~f}return Tn=t,ri(),a}function vh(e,t){He=null,A.H=rl,t===ls||t===fi?(t=Lf(),it=3):t===mc?(t=Lf(),it=4):it=t===qc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ka=t,Ve===null&&(Ct=1,Ei(e,Ha(t,e.current)))}function _h(){var e=Ca.current;return e===null?!0:(Ze&4194048)===Ze?Ya===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?e===Ya:!1}function Sh(){var e=A.H;return A.H=rl,e===null?rl:e}function jh(){var e=A.A;return A.A=Rb,e}function Hi(){Ct=4,Zn||(Ze&4194048)!==Ze&&Ca.current!==null||(hs=!0),(Jn&134217727)===0&&(zr&134217727)===0||ht===null||Wn(ht,Ze,Ta,!1)}function uu(e,t,a){var s=rt;rt|=2;var c=Sh(),f=jh();(ht!==e||Ze!==t)&&(Li=null,xs(e,t)),t=!1;var x=Ct;e:do try{if(it!==0&&Ve!==null){var S=Ve,k=ka;switch(it){case 8:cu(),x=6;break e;case 3:case 2:case 9:case 6:Ca.current===null&&(t=!0);var L=it;if(it=0,ka=null,ys(e,S,k,L),a&&hs){x=0;break e}break;default:L=it,it=0,ka=null,ys(e,S,k,L)}}zb(),x=Ct;break}catch(F){vh(e,F)}while(!0);return t&&e.shellSuspendCounter++,vn=Sr=null,rt=s,A.H=c,A.A=f,Ve===null&&(ht=null,Ze=0,ri()),x}function zb(){for(;Ve!==null;)Nh(Ve)}function Ob(e,t){var a=rt;rt|=2;var s=Sh(),c=jh();ht!==e||Ze!==t?(Li=null,Mi=pt()+500,xs(e,t)):hs=At(e,t);e:do try{if(it!==0&&Ve!==null){t=Ve;var f=ka;t:switch(it){case 1:it=0,ka=null,ys(e,t,f,1);break;case 2:case 9:if(Af(f)){it=0,ka=null,wh(t);break}t=function(){it!==2&&it!==9||ht!==e||(it=7),dn(e)},f.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:Af(f)?(it=0,ka=null,wh(t)):(it=0,ka=null,ys(e,t,f,7));break;case 5:var x=null;switch(Ve.tag){case 26:x=Ve.memoizedState;case 5:case 27:var S=Ve;if(x?up(x):S.stateNode.complete){it=0,ka=null;var k=S.sibling;if(k!==null)Ve=k;else{var L=S.return;L!==null?(Ve=L,Bi(L)):Ve=null}break t}}it=0,ka=null,ys(e,t,f,5);break;case 6:it=0,ka=null,ys(e,t,f,6);break;case 8:cu(),Ct=6;break e;default:throw Error(i(462))}}Db();break}catch(F){vh(e,F)}while(!0);return vn=Sr=null,A.H=s,A.A=c,rt=a,Ve!==null?0:(ht=null,Ze=0,ri(),Ct)}function Db(){for(;Ve!==null&&!la();)Nh(Ve)}function Nh(e){var t=Fm(e.alternate,e,Tn);e.memoizedProps=e.pendingProps,t===null?Bi(e):Ve=t}function wh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Ym(a,t,t.pendingProps,t.type,void 0,Ze);break;case 11:t=Ym(a,t,t.pendingProps,t.type.render,t.ref,Ze);break;case 5:wc(t);default:Jm(a,t),t=Ve=jf(t,Tn),t=Fm(a,t,Tn)}e.memoizedProps=e.pendingProps,t===null?Bi(e):Ve=t}function ys(e,t,a,s){vn=Sr=null,wc(t),is=null,Js=0;var c=t.return;try{if(_b(e,c,t,a,Ze)){Ct=1,Ei(e,Ha(a,e.current)),Ve=null;return}}catch(f){if(c!==null)throw Ve=c,f;Ct=1,Ei(e,Ha(a,e.current)),Ve=null;return}t.flags&32768?(Ie||s===1?e=!0:hs||(Ze&536870912)!==0?e=!1:(Zn=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ca.current,s!==null&&s.tag===13&&(s.flags|=16384))),Eh(t,e)):Bi(t)}function Bi(e){var t=e;do{if((t.flags&32768)!==0){Eh(t,Zn);return}e=t.return;var a=Nb(t.alternate,t,Tn);if(a!==null){Ve=a;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);Ct===0&&(Ct=5)}function Eh(e,t){do{var a=wb(e.alternate,e);if(a!==null){a.flags&=32767,Ve=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=a}while(e!==null);Ct=6,Ve=null}function Ch(e,t,a,s,c,f,x,S,k){e.cancelPendingCommit=null;do $i();while(Gt!==0);if((rt&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=Io,mr(e,a,f,x,S,k),e===ht&&(Ve=ht=null,Ze=0),gs=t,In=e,zn=a,lu=f,iu=c,gh=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ub(Fe,function(){return Oh(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=A.T,A.T=null,c=P.p,P.p=2,x=rt,rt|=4;try{Eb(e,t,a)}finally{rt=x,P.p=c,A.T=s}}Gt=1,Rh(),kh(),Th()}}function Rh(){if(Gt===1){Gt=0;var e=In,t=gs,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null;var s=P.p;P.p=2;var c=rt;rt|=4;try{oh(t,e);var f=Su,x=hf(e.containerInfo),S=f.focusedElem,k=f.selectionRange;if(x!==S&&S&&S.ownerDocument&&mf(S.ownerDocument.documentElement,S)){if(k!==null&&Qo(S)){var L=k.start,F=k.end;if(F===void 0&&(F=L),"selectionStart"in S)S.selectionStart=L,S.selectionEnd=Math.min(F,S.value.length);else{var I=S.ownerDocument||document,U=I&&I.defaultView||window;if(U.getSelection){var K=U.getSelection(),be=S.textContent.length,ke=Math.min(k.start,be),dt=k.end===void 0?ke:Math.min(k.end,be);!K.extend&&ke>dt&&(x=dt,dt=ke,ke=x);var D=ff(S,ke),T=ff(S,dt);if(D&&T&&(K.rangeCount!==1||K.anchorNode!==D.node||K.anchorOffset!==D.offset||K.focusNode!==T.node||K.focusOffset!==T.offset)){var M=I.createRange();M.setStart(D.node,D.offset),K.removeAllRanges(),ke>dt?(K.addRange(M),K.extend(T.node,T.offset)):(M.setEnd(T.node,T.offset),K.addRange(M))}}}}for(I=[],K=S;K=K.parentNode;)K.nodeType===1&&I.push({element:K,left:K.scrollLeft,top:K.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}}Ii=!!_u,Su=_u=null}finally{rt=c,P.p=s,A.T=a}}e.current=t,Gt=2}}function kh(){if(Gt===2){Gt=0;var e=In,t=gs,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=A.T,A.T=null;var s=P.p;P.p=2;var c=rt;rt|=4;try{nh(e,t.alternate,t)}finally{rt=c,P.p=s,A.T=a}}Gt=3}}function Th(){if(Gt===4||Gt===3){Gt=0,ia();var e=In,t=gs,a=zn,s=gh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Gt=5:(Gt=0,gs=In=null,zh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Pn=null),B(a),t=t.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(Zt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=A.T,c=P.p,P.p=2,A.T=null;try{for(var f=e.onRecoverableError,x=0;x<s.length;x++){var S=s[x];f(S.value,{componentStack:S.stack})}}finally{A.T=t,P.p=c}}(zn&3)!==0&&$i(),dn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===ou?ml++:(ml=0,ou=e):ml=0,hl(0)}}function zh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fs(t)))}function $i(){return Rh(),kh(),Th(),Oh()}function Oh(){if(Gt!==5)return!1;var e=In,t=lu;lu=0;var a=B(zn),s=A.T,c=P.p;try{P.p=32>a?32:a,A.T=null,a=iu,iu=null;var f=In,x=zn;if(Gt=0,gs=In=null,zn=0,(rt&6)!==0)throw Error(i(331));var S=rt;if(rt|=4,mh(f.current),uh(f,f.current,x,a),rt=S,hl(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(Zt,f)}catch{}return!0}finally{P.p=c,A.T=s,zh(e,t)}}function Dh(e,t,a){t=Ha(a,t),t=$c(e.stateNode,t,2),e=Kn(e,t,2),e!==null&&(Na(e,2),dn(e))}function ot(e,t,a){if(e.tag===3)Dh(e,e,a);else for(;t!==null;){if(t.tag===3){Dh(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Pn===null||!Pn.has(s))){e=Ha(a,e),a=Am(2),s=Kn(t,a,2),s!==null&&(Mm(a,s,t,e),Na(s,2),dn(s));break}}t=t.return}}function du(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new kb;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(nu=!0,c.add(a),e=Ab.bind(null,e,t,a),t.then(e,e))}function Ab(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ht===e&&(Ze&a)===a&&(Ct===4||Ct===3&&(Ze&62914560)===Ze&&300>pt()-Ai?(rt&2)===0&&xs(e,0):ru|=a,ps===Ze&&(ps=0)),dn(e)}function Ah(e,t){t===0&&(t=ua()),e=br(e,t),e!==null&&(Na(e,t),dn(e))}function Mb(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Ah(e,a)}function Lb(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(t),Ah(e,a)}function Ub(e,t){return ja(e,t)}var qi=null,bs=null,fu=!1,Yi=!1,mu=!1,er=0;function dn(e){e!==bs&&e.next===null&&(bs===null?qi=bs=e:bs=bs.next=e),Yi=!0,fu||(fu=!0,Bb())}function hl(e,t){if(!mu&&Yi){mu=!0;do for(var a=!1,s=qi;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var f=0;else{var x=s.suspendedLanes,S=s.pingedLanes;f=(1<<31-Dt(42|e)+1)-1,f&=c&~(x&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,Hh(s,f))}else f=Ze,f=Ue(s,s===ht?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||At(s,f)||(a=!0,Hh(s,f));s=s.next}while(a);mu=!1}}function Hb(){Mh()}function Mh(){Yi=fu=!1;var e=0;er!==0&&Zb()&&(e=er);for(var t=pt(),a=null,s=qi;s!==null;){var c=s.next,f=Lh(s,t);f===0?(s.next=null,a===null?qi=c:a.next=c,c===null&&(bs=a)):(a=s,(e!==0||(f&3)!==0)&&(Yi=!0)),s=c}Gt!==0&&Gt!==5||hl(e),er!==0&&(er=0)}function Lh(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-Dt(f),S=1<<x,k=c[x];k===-1?((S&a)===0||(S&s)!==0)&&(c[x]=ca(S,t)):k<=t&&(e.expiredLanes|=S),f&=~S}if(t=ht,a=Ze,a=Ue(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Aa(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||At(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&Aa(s),B(a)){case 2:case 8:a=Ae;break;case 32:a=Fe;break;case 268435456:a=Nt;break;default:a=Fe}return s=Uh.bind(null,e),a=ja(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&Aa(s),e.callbackPriority=2,e.callbackNode=null,2}function Uh(e,t){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if($i()&&e.callbackNode!==a)return null;var s=Ze;return s=Ue(e,e===ht?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(yh(e,s,t),Lh(e,pt()),e.callbackNode!=null&&e.callbackNode===a?Uh.bind(null,e):null)}function Hh(e,t){if($i())return null;yh(e,t,!0)}function Bb(){Pb(function(){(rt&6)!==0?ja(_e,Hb):Mh()})}function hu(){if(er===0){var e=rs;e===0&&(e=X,X<<=1,(X&261888)===0&&(X=256)),er=e}return er}function Bh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jl(""+e)}function $h(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 $b(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var f=Bh((c[he]||null).action),x=s.submitter;x&&(t=(t=x[he]||null)?Bh(t.formAction):x.getAttribute("formAction"),t!==null&&(f=t,x=null));var S=new ei("action","action",null,s,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(er!==0){var k=x?$h(c,x):new FormData(c);Ac(a,{pending:!0,data:k,method:c.method,action:f},null,k)}}else typeof f=="function"&&(S.preventDefault(),k=x?$h(c,x):new FormData(c),Ac(a,{pending:!0,data:k,method:c.method,action:f},f,k))},currentTarget:c}]})}}for(var pu=0;pu<Po.length;pu++){var gu=Po[pu],qb=gu.toLowerCase(),Yb=gu[0].toUpperCase()+gu.slice(1);en(qb,"on"+Yb)}en(xf,"onAnimationEnd"),en(yf,"onAnimationIteration"),en(bf,"onAnimationStart"),en("dblclick","onDoubleClick"),en("focusin","onFocus"),en("focusout","onBlur"),en(rb,"onTransitionRun"),en(sb,"onTransitionStart"),en(lb,"onTransitionCancel"),en(vf,"onTransitionEnd"),sn("onMouseEnter",["mouseout","mouseover"]),sn("onMouseLeave",["mouseout","mouseover"]),sn("onPointerEnter",["pointerout","pointerover"]),sn("onPointerLeave",["pointerout","pointerover"]),Kt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pl="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(" "),Gb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pl));function qh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var f=void 0;if(t)for(var x=s.length-1;0<=x;x--){var S=s[x],k=S.instance,L=S.currentTarget;if(S=S.listener,k!==f&&c.isPropagationStopped())break e;f=S,c.currentTarget=L;try{f(c)}catch(F){ni(F)}c.currentTarget=null,f=k}else for(x=0;x<s.length;x++){if(S=s[x],k=S.instance,L=S.currentTarget,S=S.listener,k!==f&&c.isPropagationStopped())break e;f=S,c.currentTarget=L;try{f(c)}catch(F){ni(F)}c.currentTarget=null,f=k}}}}function Ke(e,t){var a=t[we];a===void 0&&(a=t[we]=new Set);var s=e+"__bubble";a.has(s)||(Yh(t,e,2,!1),a.add(s))}function xu(e,t,a){var s=0;t&&(s|=4),Yh(a,e,s,t)}var Gi="_reactListening"+Math.random().toString(36).slice(2);function yu(e){if(!e[Gi]){e[Gi]=!0,Un.forEach(function(a){a!=="selectionchange"&&(Gb.has(a)||xu(a,!1,e),xu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gi]||(t[Gi]=!0,xu("selectionchange",!1,t))}}function Yh(e,t,a,s){switch(xp(t)){case 2:var c=xv;break;case 8:c=yv;break;default:c=Du}a=c.bind(null,t,a,e),c=void 0,!Ho||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?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 bu(e,t,a,s,c){var f=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var x=s.tag;if(x===3||x===4){var S=s.stateNode.containerInfo;if(S===c)break;if(x===4)for(x=s.return;x!==null;){var k=x.tag;if((k===3||k===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;S!==null;){if(x=bt(S),x===null)return;if(k=x.tag,k===5||k===6||k===26||k===27){s=f=x;continue e}S=S.parentNode}}s=s.return}Xd(function(){var L=f,F=Lo(a),I=[];e:{var U=_f.get(e);if(U!==void 0){var K=ei,be=e;switch(e){case"keypress":if(Il(a)===0)break e;case"keydown":case"keyup":K=Ly;break;case"focusin":be="focus",K=Yo;break;case"focusout":be="blur",K=Yo;break;case"beforeblur":case"afterblur":K=Yo;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":K=Zd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=Ny;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=By;break;case xf:case yf:case bf:K=Cy;break;case vf:K=qy;break;case"scroll":case"scrollend":K=Sy;break;case"wheel":K=Gy;break;case"copy":case"cut":case"paste":K=ky;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Pd;break;case"toggle":case"beforetoggle":K=Ky}var ke=(t&4)!==0,dt=!ke&&(e==="scroll"||e==="scrollend"),D=ke?U!==null?U+"Capture":null:U;ke=[];for(var T=L,M;T!==null;){var J=T;if(M=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||M===null||D===null||(J=Us(T,D),J!=null&&ke.push(gl(T,J,M))),dt)break;T=T.return}0<ke.length&&(U=new K(U,be,null,a,F),I.push({event:U,listeners:ke}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",U&&a!==Mo&&(be=a.relatedTarget||a.fromElement)&&(bt(be)||be[pe]))break e;if((K||U)&&(U=F.window===F?F:(U=F.ownerDocument)?U.defaultView||U.parentWindow:window,K?(be=a.relatedTarget||a.toElement,K=L,be=be?bt(be):null,be!==null&&(dt=d(be),ke=be.tag,be!==dt||ke!==5&&ke!==27&&ke!==6)&&(be=null)):(K=null,be=L),K!==be)){if(ke=Zd,J="onMouseLeave",D="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(ke=Pd,J="onPointerLeave",D="onPointerEnter",T="pointer"),dt=K==null?U:We(K),M=be==null?U:We(be),U=new ke(J,T+"leave",K,a,F),U.target=dt,U.relatedTarget=M,J=null,bt(F)===L&&(ke=new ke(D,T+"enter",be,a,F),ke.target=M,ke.relatedTarget=dt,J=ke),dt=J,K&&be)t:{for(ke=Vb,D=K,T=be,M=0,J=D;J;J=ke(J))M++;J=0;for(var Ee=T;Ee;Ee=ke(Ee))J++;for(;0<M-J;)D=ke(D),M--;for(;0<J-M;)T=ke(T),J--;for(;M--;){if(D===T||T!==null&&D===T.alternate){ke=D;break t}D=ke(D),T=ke(T)}ke=null}else ke=null;K!==null&&Gh(I,U,K,ke,!1),be!==null&&dt!==null&&Gh(I,dt,be,ke,!0)}}e:{if(U=L?We(L):window,K=U.nodeName&&U.nodeName.toLowerCase(),K==="select"||K==="input"&&U.type==="file")var at=sf;else if(nf(U))if(lf)at=tb;else{at=Wy;var Se=Iy}else K=U.nodeName,!K||K.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&Ao(L.elementType)&&(at=sf):at=eb;if(at&&(at=at(e,L))){rf(I,at,a,F);break e}Se&&Se(e,U,L),e==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&Do(U,"number",U.value)}switch(Se=L?We(L):window,e){case"focusin":(nf(Se)||Se.contentEditable==="true")&&(Jr=Se,Fo=L,Ks=null);break;case"focusout":Ks=Fo=Jr=null;break;case"mousedown":Zo=!0;break;case"contextmenu":case"mouseup":case"dragend":Zo=!1,pf(I,a,F);break;case"selectionchange":if(nb)break;case"keydown":case"keyup":pf(I,a,F)}var Be;if(Vo)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Zr?tf(e,a)&&(Je="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Je="onCompositionStart");Je&&(Id&&a.locale!=="ko"&&(Zr||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Zr&&(Be=Qd()):(Hn=F,Bo="value"in Hn?Hn.value:Hn.textContent,Zr=!0)),Se=Vi(L,Je),0<Se.length&&(Je=new Jd(Je,e,null,a,F),I.push({event:Je,listeners:Se}),Be?Je.data=Be:(Be=af(a),Be!==null&&(Je.data=Be)))),(Be=Qy?Fy(e,a):Zy(e,a))&&(Je=Vi(L,"onBeforeInput"),0<Je.length&&(Se=new Jd("onBeforeInput","beforeinput",null,a,F),I.push({event:Se,listeners:Je}),Se.data=Be)),$b(I,e,L,a,F)}qh(I,t)})}function gl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Vi(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Us(e,a),c!=null&&s.unshift(gl(e,c,f)),c=Us(e,t),c!=null&&s.push(gl(e,c,f))),e.tag===3)return s;e=e.return}return[]}function Vb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gh(e,t,a,s,c){for(var f=t._reactName,x=[];a!==null&&a!==s;){var S=a,k=S.alternate,L=S.stateNode;if(S=S.tag,k!==null&&k===s)break;S!==5&&S!==26&&S!==27||L===null||(k=L,c?(L=Us(a,f),L!=null&&x.unshift(gl(a,L,k))):c||(L=Us(a,f),L!=null&&x.push(gl(a,L,k)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var Kb=/\r\n?/g,Xb=/\u0000|\uFFFD/g;function Vh(e){return(typeof e=="string"?e:""+e).replace(Kb,`
|
|
10
|
+
`).replace(Xb,"")}function Kh(e,t){return t=Vh(t),Vh(e)===t}function ut(e,t,a,s,c,f){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Xr(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Xr(e,""+s);break;case"className":Tt(e,"class",s);break;case"tabIndex":Tt(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Tt(e,a,s);break;case"style":Vd(e,s,f);break;case"data":if(t!=="object"){Tt(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=Jl(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="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 f=="function"&&(a==="formAction"?(t!=="input"&&ut(e,t,"name",c.name,c,null),ut(e,t,"formEncType",c.formEncType,c,null),ut(e,t,"formMethod",c.formMethod,c,null),ut(e,t,"formTarget",c.formTarget,c,null)):(ut(e,t,"encType",c.encType,c,null),ut(e,t,"method",c.method,c,null),ut(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=Jl(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=gn);break;case"onScroll":s!=null&&Ke("scroll",e);break;case"onScrollEnd":s!=null&&Ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=Jl(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Ke("beforetoggle",e),Ke("toggle",e),Ge(e,"popover",s);break;case"xlinkActuate":na(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":na(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":na(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":na(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":na(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":na(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":na(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ge(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=vy.get(a)||a,Ge(e,a,s))}}function vu(e,t,a,s,c,f){switch(a){case"style":Vd(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof s=="string"?Xr(e,s):(typeof s=="number"||typeof s=="bigint")&&Xr(e,""+s);break;case"onScroll":s!=null&&Ke("scroll",e);break;case"onScrollEnd":s!=null&&Ke("scrollend",e);break;case"onClick":s!=null&&(e.onclick=gn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wa.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),f=e[he]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof s=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):Ge(e,a,s)}}}function Wt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",e),Ke("load",e);var s=!1,c=!1,f;for(f in a)if(a.hasOwnProperty(f)){var x=a[f];if(x!=null)switch(f){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ut(e,t,f,x,a,null)}}c&&ut(e,t,"srcSet",a.srcSet,a,null),s&&ut(e,t,"src",a.src,a,null);return;case"input":Ke("invalid",e);var S=f=x=c=null,k=null,L=null;for(s in a)if(a.hasOwnProperty(s)){var F=a[s];if(F!=null)switch(s){case"name":c=F;break;case"type":x=F;break;case"checked":k=F;break;case"defaultChecked":L=F;break;case"value":f=F;break;case"defaultValue":S=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:ut(e,t,s,F,a,null)}}$d(e,f,S,k,L,x,c,!1);return;case"select":Ke("invalid",e),s=x=f=null;for(c in a)if(a.hasOwnProperty(c)&&(S=a[c],S!=null))switch(c){case"value":f=S;break;case"defaultValue":x=S;break;case"multiple":s=S;default:ut(e,t,c,S,a,null)}t=f,a=x,e.multiple=!!s,t!=null?Kr(e,!!s,t,!1):a!=null&&Kr(e,!!s,a,!0);return;case"textarea":Ke("invalid",e),f=c=s=null;for(x in a)if(a.hasOwnProperty(x)&&(S=a[x],S!=null))switch(x){case"value":s=S;break;case"defaultValue":c=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:ut(e,t,x,S,a,null)}Yd(e,s,c,f);return;case"option":for(k in a)a.hasOwnProperty(k)&&(s=a[k],s!=null)&&(k==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":ut(e,t,k,s,a,null));return;case"dialog":Ke("beforetoggle",e),Ke("toggle",e),Ke("cancel",e),Ke("close",e);break;case"iframe":case"object":Ke("load",e);break;case"video":case"audio":for(s=0;s<pl.length;s++)Ke(pl[s],e);break;case"image":Ke("error",e),Ke("load",e);break;case"details":Ke("toggle",e);break;case"embed":case"source":case"link":Ke("error",e),Ke("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)&&(s=a[L],s!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ut(e,t,L,s,a,null)}return;default:if(Ao(t)){for(F in a)a.hasOwnProperty(F)&&(s=a[F],s!==void 0&&vu(e,t,F,s,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(s=a[S],s!=null&&ut(e,t,S,s,a,null))}function Qb(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,x=null,S=null,k=null,L=null,F=null;for(K in a){var I=a[K];if(a.hasOwnProperty(K)&&I!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":k=I;default:s.hasOwnProperty(K)||ut(e,t,K,null,s,I)}}for(var U in s){var K=s[U];if(I=a[U],s.hasOwnProperty(U)&&(K!=null||I!=null))switch(U){case"type":f=K;break;case"name":c=K;break;case"checked":L=K;break;case"defaultChecked":F=K;break;case"value":x=K;break;case"defaultValue":S=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,t));break;default:K!==I&&ut(e,t,U,K,s,I)}}Oo(e,x,S,k,L,F,f,c);return;case"select":K=x=S=U=null;for(f in a)if(k=a[f],a.hasOwnProperty(f)&&k!=null)switch(f){case"value":break;case"multiple":K=k;default:s.hasOwnProperty(f)||ut(e,t,f,null,s,k)}for(c in s)if(f=s[c],k=a[c],s.hasOwnProperty(c)&&(f!=null||k!=null))switch(c){case"value":U=f;break;case"defaultValue":S=f;break;case"multiple":x=f;default:f!==k&&ut(e,t,c,f,s,k)}t=S,a=x,s=K,U!=null?Kr(e,!!a,U,!1):!!s!=!!a&&(t!=null?Kr(e,!!a,t,!0):Kr(e,!!a,a?[]:"",!1));return;case"textarea":K=U=null;for(S in a)if(c=a[S],a.hasOwnProperty(S)&&c!=null&&!s.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ut(e,t,S,null,s,c)}for(x in s)if(c=s[x],f=a[x],s.hasOwnProperty(x)&&(c!=null||f!=null))switch(x){case"value":U=c;break;case"defaultValue":K=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&ut(e,t,x,c,s,f)}qd(e,U,K);return;case"option":for(var be in a)U=a[be],a.hasOwnProperty(be)&&U!=null&&!s.hasOwnProperty(be)&&(be==="selected"?e.selected=!1:ut(e,t,be,null,s,U));for(k in s)U=s[k],K=a[k],s.hasOwnProperty(k)&&U!==K&&(U!=null||K!=null)&&(k==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":ut(e,t,k,U,s,K));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 ke in a)U=a[ke],a.hasOwnProperty(ke)&&U!=null&&!s.hasOwnProperty(ke)&&ut(e,t,ke,null,s,U);for(L in s)if(U=s[L],K=a[L],s.hasOwnProperty(L)&&U!==K&&(U!=null||K!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,t));break;default:ut(e,t,L,U,s,K)}return;default:if(Ao(t)){for(var dt in a)U=a[dt],a.hasOwnProperty(dt)&&U!==void 0&&!s.hasOwnProperty(dt)&&vu(e,t,dt,void 0,s,U);for(F in s)U=s[F],K=a[F],!s.hasOwnProperty(F)||U===K||U===void 0&&K===void 0||vu(e,t,F,U,s,K);return}}for(var D in a)U=a[D],a.hasOwnProperty(D)&&U!=null&&!s.hasOwnProperty(D)&&ut(e,t,D,null,s,U);for(I in s)U=s[I],K=a[I],!s.hasOwnProperty(I)||U===K||U==null&&K==null||ut(e,t,I,U,s,K)}function Xh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Fb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var c=a[s],f=c.transferSize,x=c.initiatorType,S=c.duration;if(f&&S&&Xh(x)){for(x=0,S=c.responseEnd,s+=1;s<a.length;s++){var k=a[s],L=k.startTime;if(L>S)break;var F=k.transferSize,I=k.initiatorType;F&&Xh(I)&&(k=k.responseEnd,x+=F*(k<S?1:(S-L)/(k-L)))}if(--s,t+=8*(f+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 _u=null,Su=null;function Ki(e){return e.nodeType===9?e:e.ownerDocument}function Qh(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 Fh(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 ju(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 Nu=null;function Zb(){var e=window.event;return e&&e.type==="popstate"?e===Nu?!1:(Nu=e,!0):(Nu=null,!1)}var Zh=typeof setTimeout=="function"?setTimeout:void 0,Jb=typeof clearTimeout=="function"?clearTimeout:void 0,Jh=typeof Promise=="function"?Promise:void 0,Pb=typeof queueMicrotask=="function"?queueMicrotask:typeof Jh<"u"?function(e){return Jh.resolve(null).then(e).catch(Ib)}:Zh;function Ib(e){setTimeout(function(){throw e})}function tr(e){return e==="head"}function Ph(e,t){var a=t,s=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(c),js(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")xl(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,xl(a);for(var f=a.firstChild;f;){var x=f.nextSibling,S=f.nodeName;f[Ye]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=x}}else a==="body"&&xl(e.ownerDocument.body);a=c}while(a);js(t)}function Ih(e,t){var a=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function wu(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":wu(a),mt(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Wb(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Ye])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==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(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Ga(e.nextSibling),e===null)break}return null}function ev(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Ga(e.nextSibling),e===null))return null;return e}function Wh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ga(e.nextSibling),e===null))return null;return e}function Eu(e){return e.data==="$?"||e.data==="$~"}function Cu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function tv(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ga(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 Ru=null;function ep(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Ga(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function tp(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 ap(e,t,a){switch(t=Ki(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 xl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var Va=new Map,np=new Set;function Xi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var On=P.d;P.d={f:av,r:nv,D:rv,C:sv,L:lv,m:iv,X:cv,S:ov,M:uv};function av(){var e=On.f(),t=Ui();return e||t}function nv(e){var t=wt(e);t!==null&&t.tag===5&&t.type==="form"?vm(t):On.r(e)}var vs=typeof document>"u"?null:document;function rp(e,t,a){var s=vs;if(s&&typeof t=="string"&&t){var c=La(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),np.has(c)||(np.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),Wt(t,"link",e),yt(t),s.head.appendChild(t)))}}function rv(e){On.D(e),rp("dns-prefetch",e,null)}function sv(e,t){On.C(e,t),rp("preconnect",e,t)}function lv(e,t,a){On.L(e,t,a);var s=vs;if(s&&e&&t){var c='link[rel="preload"][as="'+La(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+La(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+La(a.imageSizes)+'"]')):c+='[href="'+La(e)+'"]';var f=c;switch(t){case"style":f=_s(e);break;case"script":f=Ss(e)}Va.has(f)||(e=b({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Va.set(f,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(yl(f))||t==="script"&&s.querySelector(bl(f))||(t=s.createElement("link"),Wt(t,"link",e),yt(t),s.head.appendChild(t)))}}function iv(e,t){On.m(e,t);var a=vs;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+La(s)+'"][href="'+La(e)+'"]',f=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Ss(e)}if(!Va.has(f)&&(e=b({rel:"modulepreload",href:e},t),Va.set(f,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bl(f)))return}s=a.createElement("link"),Wt(s,"link",e),yt(s),a.head.appendChild(s)}}}function ov(e,t,a){On.S(e,t,a);var s=vs;if(s&&e){var c=Yt(s).hoistableStyles,f=_s(e);t=t||"default";var x=c.get(f);if(!x){var S={loading:0,preload:null};if(x=s.querySelector(yl(f)))S.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Va.get(f))&&ku(e,a);var k=x=s.createElement("link");yt(k),Wt(k,"link",e),k._p=new Promise(function(L,F){k.onload=L,k.onerror=F}),k.addEventListener("load",function(){S.loading|=1}),k.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Qi(x,t,s)}x={type:"stylesheet",instance:x,count:1,state:S},c.set(f,x)}}}function cv(e,t){On.X(e,t);var a=vs;if(a&&e){var s=Yt(a).hoistableScripts,c=Ss(e),f=s.get(c);f||(f=a.querySelector(bl(c)),f||(e=b({src:e,async:!0},t),(t=Va.get(c))&&Tu(e,t),f=a.createElement("script"),yt(f),Wt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(c,f))}}function uv(e,t){On.M(e,t);var a=vs;if(a&&e){var s=Yt(a).hoistableScripts,c=Ss(e),f=s.get(c);f||(f=a.querySelector(bl(c)),f||(e=b({src:e,async:!0,type:"module"},t),(t=Va.get(c))&&Tu(e,t),f=a.createElement("script"),yt(f),Wt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(c,f))}}function sp(e,t,a,s){var c=(c=ve.current)?Xi(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=_s(a.href),a=Yt(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=_s(a.href);var f=Yt(c).hoistableStyles,x=f.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=c.querySelector(yl(e)))&&!f._p&&(x.instance=f,x.state.loading=5),Va.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},Va.set(e,a),f||dv(c,e,a,x.state))),t&&s===null)throw Error(i(528,""));return x}if(t&&s!==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=Ss(a),a=Yt(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function _s(e){return'href="'+La(e)+'"'}function yl(e){return'link[rel="stylesheet"]['+e+"]"}function lp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function dv(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Wt(t,"link",a),yt(t),e.head.appendChild(t))}function Ss(e){return'[src="'+La(e)+'"]'}function bl(e){return"script[async]"+e}function ip(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+La(a.href)+'"]');if(s)return t.instance=s,yt(s),s;var c=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),yt(s),Wt(s,"style",c),Qi(s,a.precedence,e),t.instance=s;case"stylesheet":c=_s(a.href);var f=e.querySelector(yl(c));if(f)return t.state.loading|=4,t.instance=f,yt(f),f;s=lp(a),(c=Va.get(c))&&ku(s,c),f=(e.ownerDocument||e).createElement("link"),yt(f);var x=f;return x._p=new Promise(function(S,k){x.onload=S,x.onerror=k}),Wt(f,"link",s),t.state.loading|=4,Qi(f,a.precedence,e),t.instance=f;case"script":return f=Ss(a.src),(c=e.querySelector(bl(f)))?(t.instance=c,yt(c),c):(s=a,(c=Va.get(f))&&(s=b({},a),Tu(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),yt(c),Wt(c,"link",s),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&&(s=t.instance,t.state.loading|=4,Qi(s,a.precedence,e));return t.instance}function Qi(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,f=c,x=0;x<s.length;x++){var S=s[x];if(S.dataset.precedence===t)f=S;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function ku(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Tu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Fi=null;function op(e,t,a){if(Fi===null){var s=new Map,c=Fi=new Map;c.set(a,s)}else c=Fi,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var f=a[c];if(!(f[Ye]||f[ue]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(t)||"";x=e+x;var S=s.get(x);S?S.push(f):s.set(x,[f])}}return s}function cp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function fv(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 up(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function mv(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=_s(s.href),f=t.querySelector(yl(c));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Zi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=f,yt(f);return}f=t.ownerDocument||t,s=lp(s),(c=Va.get(c))&&ku(s,c),f=f.createElement("link"),yt(f);var x=f;x._p=new Promise(function(S,k){x.onload=S,x.onerror=k}),Wt(f,"link",s),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Zi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var zu=0;function hv(e,t){return e.stylesheets&&e.count===0&&Pi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&Pi(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&zu===0&&(zu=62500*Fb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Pi(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>zu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Zi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ji=null;function Pi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ji=new Map,t.forEach(pv,e),Ji=null,Zi.call(e))}function pv(e,t){if(!(t.state.loading&4)){var a=Ji.get(e);if(a)var s=a.get(null);else{a=new Map,Ji.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var x=c[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),s=x)}s&&a.set(null,s)}c=t.instance,x=c.getAttribute("data-precedence"),f=a.get(x)||s,f===s&&a.set(null,c),a.set(x,c),this.count++,s=Zi.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var vl={$$typeof:V,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function gv(e,t,a,s,c,f,x,S,k){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=Ma(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ma(0),this.hiddenUpdates=Ma(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function dp(e,t,a,s,c,f,x,S,k,L,F,I){return e=new gv(e,t,a,x,k,L,F,I,S),t=1,f===!0&&(t|=24),f=Ea(3,null,null,t),e.current=f,f.stateNode=e,t=uc(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:s,isDehydrated:a,cache:t},hc(f),e}function fp(e){return e?(e=Wr,e):Wr}function mp(e,t,a,s,c,f){c=fp(c),s.context===null?s.context=c:s.pendingContext=c,s=Vn(t),s.payload={element:a},f=f===void 0?null:f,f!==null&&(s.callback=f),a=Kn(e,s,t),a!==null&&(ba(a,e,t),Is(a,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ou(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=br(e,67108864);t!==null&&ba(t,e,67108864),Ou(e,67108864)}}function gp(e){if(e.tag===13||e.tag===31){var t=za();t=O(t);var a=br(e,t);a!==null&&ba(a,e,t),Ou(e,t)}}var Ii=!0;function xv(e,t,a,s){var c=A.T;A.T=null;var f=P.p;try{P.p=2,Du(e,t,a,s)}finally{P.p=f,A.T=c}}function yv(e,t,a,s){var c=A.T;A.T=null;var f=P.p;try{P.p=8,Du(e,t,a,s)}finally{P.p=f,A.T=c}}function Du(e,t,a,s){if(Ii){var c=Au(s);if(c===null)bu(e,t,s,Wi,a),yp(e,s);else if(vv(c,e,t,a,s))s.stopPropagation();else if(yp(e,s),t&4&&-1<bv.indexOf(e)){for(;c!==null;){var f=wt(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=$e(f.pendingLanes);if(x!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var k=1<<31-Dt(x);S.entanglements[1]|=k,x&=~k}dn(f),(rt&6)===0&&(Mi=pt()+500,hl(0))}}break;case 31:case 13:S=br(f,2),S!==null&&ba(S,f,2),Ui(),Ou(f,2)}if(f=Au(s),f===null&&bu(e,t,s,Wi,a),f===c)break;c=f}c!==null&&s.stopPropagation()}else bu(e,t,s,null,a)}}function Au(e){return e=Lo(e),Mu(e)}var Wi=null;function Mu(e){if(Wi=null,e=bt(e),e!==null){var t=d(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 Wi=e,null}function xp(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(oa()){case _e:return 2;case Ae:return 8;case Fe:case gt:return 32;case Nt:return 268435456;default:return 32}default:return 32}}var Lu=!1,ar=null,nr=null,rr=null,_l=new Map,Sl=new Map,sr=[],bv="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 yp(e,t){switch(e){case"focusin":case"focusout":ar=null;break;case"dragenter":case"dragleave":nr=null;break;case"mouseover":case"mouseout":rr=null;break;case"pointerover":case"pointerout":_l.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sl.delete(t.pointerId)}}function jl(e,t,a,s,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:f,targetContainers:[c]},t!==null&&(t=wt(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function vv(e,t,a,s,c){switch(t){case"focusin":return ar=jl(ar,e,t,a,s,c),!0;case"dragenter":return nr=jl(nr,e,t,a,s,c),!0;case"mouseover":return rr=jl(rr,e,t,a,s,c),!0;case"pointerover":var f=c.pointerId;return _l.set(f,jl(_l.get(f)||null,e,t,a,s,c)),!0;case"gotpointercapture":return f=c.pointerId,Sl.set(f,jl(Sl.get(f)||null,e,t,a,s,c)),!0}return!1}function bp(e){var t=bt(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,oe(e.priority,function(){gp(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,oe(e.priority,function(){gp(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 eo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Au(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Mo=s,a.target.dispatchEvent(s),Mo=null}else return t=wt(a),t!==null&&pp(t),e.blockedOn=a,!1;t.shift()}return!0}function vp(e,t,a){eo(e)&&a.delete(t)}function _v(){Lu=!1,ar!==null&&eo(ar)&&(ar=null),nr!==null&&eo(nr)&&(nr=null),rr!==null&&eo(rr)&&(rr=null),_l.forEach(vp),Sl.forEach(vp)}function to(e,t){e.blockedOn===t&&(e.blockedOn=null,Lu||(Lu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,_v)))}var ao=null;function _p(e){ao!==e&&(ao=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ao===e&&(ao=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(Mu(s||a)===null)continue;break}var f=wt(a);f!==null&&(e.splice(t,3),t-=3,Ac(f,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function js(e){function t(k){return to(k,e)}ar!==null&&to(ar,e),nr!==null&&to(nr,e),rr!==null&&to(rr,e),_l.forEach(t),Sl.forEach(t);for(var a=0;a<sr.length;a++){var s=sr[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<sr.length&&(a=sr[0],a.blockedOn===null);)bp(a),a.blockedOn===null&&sr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],f=a[s+1],x=c[he]||null;if(typeof f=="function")x||_p(a);else if(x){var S=null;if(f&&f.hasAttribute("formAction")){if(c=f,x=f[he]||null)S=x.formAction;else if(Mu(c)!==null)continue}else S=x.action;typeof S=="function"?a[s+1]=S:(a.splice(s,3),s-=3),_p(a)}}}function Sp(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return c=x})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Uu(e){this._internalRoot=e}no.prototype.render=Uu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,s=za();mp(a,s,e,t,null,null)},no.prototype.unmount=Uu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),Ui(),t[pe]=null}};function no(e){this._internalRoot=e}no.prototype.unstable_scheduleHydration=function(e){if(e){var t=ne();e={blockedOn:null,target:e,priority:t};for(var a=0;a<sr.length&&t!==0&&t<sr[a].priority;a++);sr.splice(a,0,e),a===0&&bp(e)}};var jp=r.version;if(jp!=="19.2.4")throw Error(i(527,jp,"19.2.4"));P.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 Sv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ro=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ro.isDisabled&&ro.supportsFiber)try{Zt=ro.inject(Sv),kt=ro}catch{}}return El.createRoot=function(e,t){if(!o(e))throw Error(i(299));var a=!1,s="",c=Tm,f=zm,x=Om;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=dp(e,1,!1,null,null,a,s,null,c,f,x,Sp),e[pe]=t.current,yu(e),new Uu(t)},El.hydrateRoot=function(e,t,a){if(!o(e))throw Error(i(299));var s=!1,c="",f=Tm,x=zm,S=Om,k=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(k=a.formState)),t=dp(e,1,!0,t,a??null,s,c,k,f,x,S,Sp),t.context=fp(null),a=t.current,s=za(),s=O(s),c=Vn(s),c.callback=null,Kn(a,c,s),a=s,t.current.lanes=a,Na(t,a),dn(t),e[pe]=t.current,yu(e),new no(t)},El.version="19.2.4",El}var eg;function $0(){if(eg)return Ku.exports;eg=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(r){console.error(r)}}return n(),Ku.exports=B0(),Ku.exports}var q0=$0();var mx=n=>{throw TypeError(n)},Y0=(n,r,l)=>r.has(n)||mx("Cannot "+l),Zu=(n,r,l)=>(Y0(n,r,"read from private field"),l?l.call(n):r.get(n)),G0=(n,r,l)=>r.has(n)?mx("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,l),tg="popstate";function ag(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function V0(n={}){function r(i,o){let d=o.state?.masked,{pathname:m,search:p,hash:g}=d||i.location;return Hl("",{pathname:m,search:p,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",d?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function l(i,o){return typeof o=="string"?o:hn(o)}return X0(r,l,null,n)}function qe(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function Rt(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function K0(){return Math.random().toString(36).substring(2,10)}function ng(n,r){return{usr:n.state,key:n.key,idx:r,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Hl(n,r,l=null,i,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof r=="string"?Mn(r):r,state:l,key:r&&r.key||i||K0(),unstable_mask:o}}function hn({pathname:n="/",search:r="",hash:l=""}){return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),l&&l!=="#"&&(n+=l.charAt(0)==="#"?l:"#"+l),n}function Mn(n){let r={};if(n){let l=n.indexOf("#");l>=0&&(r.hash=n.substring(l),n=n.substring(0,l));let i=n.indexOf("?");i>=0&&(r.search=n.substring(i),n=n.substring(0,i)),n&&(r.pathname=n)}return r}function X0(n,r,l,i={}){let{window:o=document.defaultView,v5Compat:d=!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 b(){p="POP";let z=v(),q=z==null?null:z-h;h=z,g&&g({action:p,location:C.location,delta:q})}function _(z,q){p="PUSH";let Q=ag(z)?z:Hl(C.location,z,q);h=v()+1;let V=ng(Q,h),Y=C.createHref(Q.unstable_mask||Q);try{m.pushState(V,"",Y)}catch(te){if(te instanceof DOMException&&te.name==="DataCloneError")throw te;o.location.assign(Y)}d&&g&&g({action:p,location:C.location,delta:1})}function j(z,q){p="REPLACE";let Q=ag(z)?z:Hl(C.location,z,q);h=v();let V=ng(Q,h),Y=C.createHref(Q.unstable_mask||Q);m.replaceState(V,"",Y),d&&g&&g({action:p,location:C.location,delta:0})}function N(z){return hx(z)}let C={get action(){return p},get location(){return n(o,m)},listen(z){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(tg,b),g=z,()=>{o.removeEventListener(tg,b),g=null}},createHref(z){return r(o,z)},createURL:N,encodeLocation(z){let q=N(z);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:_,replace:j,go(z){return m.go(z)}};return C}function hx(n,r=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),qe(l,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:hn(n);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=l+i),new URL(i,l)}var zl,rg=class{constructor(n){if(G0(this,zl,new Map),n)for(let[r,l]of n)this.set(r,l)}get(n){if(Zu(this,zl).has(n))return Zu(this,zl).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,r){Zu(this,zl).set(n,r)}};zl=new WeakMap;var Q0=new Set(["lazy","caseSensitive","path","id","index","children"]);function F0(n){return Q0.has(n)}var Z0=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function J0(n){return Z0.has(n)}function P0(n){return n.index===!0}function Bl(n,r,l=[],i={},o=!1){return n.map((d,m)=>{let p=[...l,String(m)],g=typeof d.id=="string"?d.id:p.join("-");if(qe(d.index!==!0||!d.children,"Cannot specify children on an index route"),qe(o||!i[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),P0(d)){let h={...d,id:g};return i[g]=sg(h,r(h)),h}else{let h={...d,id:g,children:void 0};return i[g]=sg(h,r(h)),d.children&&(h.children=Bl(d.children,r,p,i,o)),h}})}function sg(n,r){return Object.assign(n,{...r,...typeof r.lazy=="object"&&r.lazy!=null?{lazy:{...n.lazy,...r.lazy}}:{}})}function ir(n,r,l="/"){return Ol(n,r,l,!1)}function Ol(n,r,l,i){let o=typeof r=="string"?Mn(r):r,d=Qa(o.pathname||"/",l);if(d==null)return null;let m=px(n);W0(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=u1(d);p=o1(m[g],h,i)}return p}function I0(n,r){let{route:l,pathname:i,params:o}=n;return{id:l.id,pathname:i,params:o,data:r[l.id],loaderData:r[l.id],handle:l.handle}}function px(n,r=[],l=[],i="",o=!1){let d=(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;qe(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 b=nn([i,v.relativePath]),_=l.concat(v);m.children&&m.children.length>0&&(qe(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),px(m.children,r,_,b,g)),!(m.path==null&&!m.index)&&r.push({path:b,score:l1(b,m.index),routesMeta:_})};return n.forEach((m,p)=>{if(m.path===""||!m.path?.includes("?"))d(m,p);else for(let g of gx(m.path))d(m,p,!0,g)}),r}function gx(n){let r=n.split("/");if(r.length===0)return[];let[l,...i]=r,o=l.endsWith("?"),d=l.replace(/\?$/,"");if(i.length===0)return o?[d,""]:[d];let m=gx(i.join("/")),p=[];return p.push(...m.map(g=>g===""?d:[d,g].join("/"))),o&&p.push(...m),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function W0(n){n.sort((r,l)=>r.score!==l.score?l.score-r.score:i1(r.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}var e1=/^:[\w-]+$/,t1=3,a1=2,n1=1,r1=10,s1=-2,lg=n=>n==="*";function l1(n,r){let l=n.split("/"),i=l.length;return l.some(lg)&&(i+=s1),r&&(i+=a1),l.filter(o=>!lg(o)).reduce((o,d)=>o+(e1.test(d)?t1:d===""?n1:r1),i)}function i1(n,r){return n.length===r.length&&n.slice(0,-1).every((i,o)=>i===r[o])?n[n.length-1]-r[r.length-1]:0}function o1(n,r,l=!1){let{routesMeta:i}=n,o={},d="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,v=d==="/"?r:r.slice(d.length)||"/",b=_o({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},v),_=g.route;if(!b&&h&&l&&!i[i.length-1].route.index&&(b=_o({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!b)return null;Object.assign(o,b.params),m.push({params:o,pathname:nn([d,b.pathname]),pathnameBase:m1(nn([d,b.pathnameBase])),route:_}),b.pathnameBase!=="/"&&(d=nn([d,b.pathnameBase]))}return m}function _o(n,r){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,i]=c1(n.path,n.caseSensitive,n.end),o=r.match(l);if(!o)return null;let d=o[0],m=d.replace(/(.)\/+$/,"$1"),p=o.slice(1);return{params:i.reduce((h,{paramName:v,isOptional:b},_)=>{if(v==="*"){let N=p[_]||"";m=d.slice(0,d.length-N.length).replace(/(.)\/+$/,"$1")}const j=p[_];return b&&!j?h[v]=void 0:h[v]=(j||"").replace(/%2F/g,"/"),h},{}),pathname:d,pathnameBase:m,pattern:n}}function c1(n,r=!1,l=!0){Rt(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 b=v.charAt(h+m.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),i]}function u1(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Rt(!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 (${r}).`),n}}function Qa(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let l=r.endsWith("/")?r.length-1:r.length,i=n.charAt(l);return i&&i!=="/"?null:n.slice(l)||"/"}function d1({basename:n,pathname:r}){return r==="/"?n:nn([n,r])}var xx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wd=n=>xx.test(n);function f1(n,r="/"){let{pathname:l,search:i="",hash:o=""}=typeof n=="string"?Mn(n):n,d;return l?(l=l.replace(/\/\/+/g,"/"),l.startsWith("/")?d=ig(l.substring(1),"/"):d=ig(l,r)):d=r,{pathname:d,search:h1(i),hash:p1(o)}}function ig(n,r){let l=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?l.length>1&&l.pop():o!=="."&&l.push(o)}),l.length>1?l.join("/"):"/"}function Ju(n,r,l,i){return`Cannot include a '${n}' character in a manually specified \`to.${r}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yx(n){return n.filter((r,l)=>l===0||r.route.path&&r.route.path.length>0)}function No(n){let r=yx(n);return r.map((l,i)=>i===r.length-1?l.pathname:l.pathnameBase)}function ql(n,r,l,i=!1){let o;typeof n=="string"?o=Mn(n):(o={...n},qe(!o.pathname||!o.pathname.includes("?"),Ju("?","pathname","search",o)),qe(!o.pathname||!o.pathname.includes("#"),Ju("#","pathname","hash",o)),qe(!o.search||!o.search.includes("#"),Ju("#","search","hash",o)));let d=n===""||o.pathname==="",m=d?"/":o.pathname,p;if(m==null)p=l;else{let b=r.length-1;if(!i&&m.startsWith("..")){let _=m.split("/");for(;_[0]==="..";)_.shift(),b-=1;o.pathname=_.join("/")}p=b>=0?r[b]:"/"}let g=f1(o,p),h=m&&m!=="/"&&m.endsWith("/"),v=(d||m===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(h||v)&&(g.pathname+="/"),g}var nn=n=>n.join("/").replace(/\/\/+/g,"/"),m1=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),h1=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,p1=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Yl=class{constructor(n,r,l,i=!1){this.status=n,this.statusText=r||"",this.internal=i,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function Os(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Gl(n){return n.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var bx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vx(n,r){let l=n;if(typeof l!="string"||!xx.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let i=l,o=!1;if(bx)try{let d=new URL(window.location.href),m=l.startsWith("//")?new URL(d.protocol+l):new URL(l),p=Qa(m.pathname,r);m.origin===d.origin&&p!=null?l=p+m.search+m.hash:o=!0}catch{Rt(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:o,to:l}}var ur=Symbol("Uninstrumented");function g1(n,r){let l={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(o=>o({id:r.id,index:r.index,path:r.path,instrument(d){let m=Object.keys(l);for(let p of m)d[p]&&l[p].push(d[p])}}));let i={};if(typeof r.lazy=="function"&&l.lazy.length>0){let o=ks(l.lazy,r.lazy,()=>{});o&&(i.lazy=o)}if(typeof r.lazy=="object"){let o=r.lazy;["middleware","loader","action"].forEach(d=>{let m=o[d],p=l[`lazy.${d}`];if(typeof m=="function"&&p.length>0){let g=ks(p,m,()=>{});g&&(i.lazy=Object.assign(i.lazy||{},{[d]:g}))}})}return["loader","action"].forEach(o=>{let d=r[o];if(typeof d=="function"&&l[o].length>0){let m=d[ur]??d,p=ks(l[o],m,(...g)=>og(g[0]));p&&(o==="loader"&&m.hydrate===!0&&(p.hydrate=!0),p[ur]=m,i[o]=p)}}),r.middleware&&r.middleware.length>0&&l.middleware.length>0&&(i.middleware=r.middleware.map(o=>{let d=o[ur]??o,m=ks(l.middleware,d,(...p)=>og(p[0]));return m?(m[ur]=d,m):o})),i}function x1(n,r){let l={navigate:[],fetch:[]};if(r.forEach(i=>i({instrument(o){let d=Object.keys(o);for(let m of d)o[m]&&l[m].push(o[m])}})),l.navigate.length>0){let i=n.navigate[ur]??n.navigate,o=ks(l.navigate,i,(...d)=>{let[m,p]=d;return{to:typeof m=="number"||typeof m=="string"?m:m?hn(m):".",...cg(n,p??{})}});o&&(o[ur]=i,n.navigate=o)}if(l.fetch.length>0){let i=n.fetch[ur]??n.fetch,o=ks(l.fetch,i,(...d)=>{let[m,,p,g]=d;return{href:p??".",fetcherKey:m,...cg(n,g??{})}});o&&(o[ur]=i,n.fetch=o)}return n}function ks(n,r,l){return n.length===0?null:async(...i)=>{let o=await _x(n,l(...i),()=>r(...i),n.length-1);if(o.type==="error")throw o.value;return o.value}}async function _x(n,r,l,i){let o=n[i],d;if(o){let m,p=async()=>(m?console.error("You cannot call instrumented handlers more than once"):m=_x(n,r,l,i-1),d=await m,qe(d,"Expected a result"),d.type==="error"&&d.value instanceof Error?{status:"error",error:d.value}:{status:"success",error:void 0});try{await o(p,r)}catch(g){console.error("An instrumentation function threw an error:",g)}m||await p(),await m}else try{d={type:"success",value:await l()}}catch(m){d={type:"error",value:m}}return d||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function og(n){let{request:r,context:l,params:i,unstable_pattern:o}=n;return{request:y1(r),params:{...i},unstable_pattern:o,context:b1(l)}}function cg(n,r){return{currentUrl:hn(n.state.location),..."formMethod"in r?{formMethod:r.formMethod}:{},..."formEncType"in r?{formEncType:r.formEncType}:{},..."formData"in r?{formData:r.formData}:{},..."body"in r?{body:r.body}:{}}}function y1(n){return{method:n.method,url:n.url,headers:{get:(...r)=>n.headers.get(...r)}}}function b1(n){if(_1(n)){let r={...n};return Object.freeze(r),r}else return{get:r=>n.get(r)}}var v1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _1(n){if(n===null||typeof n!="object")return!1;const r=Object.getPrototypeOf(n);return r===Object.prototype||r===null||Object.getOwnPropertyNames(r).sort().join("\0")===v1}var Sx=["POST","PUT","PATCH","DELETE"],S1=new Set(Sx),j1=["GET",...Sx],N1=new Set(j1),jx=new Set([301,302,303,307,308]),w1=new Set([307,308]),Pu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},E1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Cl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},C1=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),Nx="remix-router-transitions",wx=Symbol("ResetLoaderData");function R1(n){const r=n.window?n.window:typeof window<"u"?window:void 0,l=typeof r<"u"&&typeof r.document<"u"&&typeof r.document.createElement<"u";qe(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=n.hydrationRouteProperties||[],o=n.mapRouteProperties||C1,d=o;if(n.unstable_instrumentations){let R=n.unstable_instrumentations;d=O=>({...o(O),...g1(R.map(B=>B.route).filter(Boolean),O)})}let m={},p=Bl(n.routes,d,void 0,m),g,h=n.basename||"/";h.startsWith("/")||(h=`/${h}`);let v=n.dataStrategy||D1,b={...n.future},_=null,j=new Set,N=null,C=null,z=null,q=n.hydrationData!=null,Q=ir(p,n.history.location,h),V=!1,Y=null,te,Z;if(Q==null&&!n.patchRoutesOnNavigation){let R=Ka(404,{pathname:n.history.location.pathname}),{matches:O,route:B}=lo(p);te=!0,Z=!te,Q=O,Y={[B.id]:R}}else if(Q&&!n.hydrationData&&Ma(Q,p,n.history.location.pathname).active&&(Q=null),Q)if(Q.some(R=>R.route.lazy))te=!1,Z=!te;else if(!Q.some(R=>Ed(R.route)))te=!0,Z=!te;else{let R=n.hydrationData?n.hydrationData.loaderData:null,O=n.hydrationData?n.hydrationData.errors:null,B=Q;if(O){let ne=Q.findIndex(oe=>O[oe.route.id]!==void 0);B=B.slice(0,ne+1)}Z=!1,te=B.every(ne=>{let oe=Ex(ne.route,R,O);return Z=Z||oe.renderFallback,!oe.shouldLoad})}else{te=!1,Z=!te,Q=[];let R=Ma(null,p,n.history.location.pathname);R.active&&R.matches&&(V=!0,Q=R.matches)}let G,E={historyAction:n.history.action,location:n.history.location,matches:Q,initialized:te,renderFallback:Z,navigation:Pu,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||Y,fetchers:new Map,blockers:new Map},H="POP",W=null,de=!1,le,se=!1,ce=new Map,ge=null,A=!1,P=!1,fe=new Set,me=new Map,re=0,w=-1,$=new Map,ee=new Set,ae=new Map,xe=new Map,ve=new Set,ze=new Map,Pe,Xe=null;function ea(){if(_=n.history.listen(({action:R,location:O,delta:B})=>{if(Pe){Pe(),Pe=void 0;return}Rt(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 ne=Oe({currentLocation:E.location,nextLocation:O,historyAction:R});if(ne&&B!=null){let oe=new Promise(ye=>{Pe=ye});n.history.go(B*-1),ie(ne,{state:"blocked",location:O,proceed(){ie(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),oe.then(()=>n.history.go(B))},reset(){let ye=new Map(E.blockers);ye.set(ne,Cl),et({blockers:ye})}}),W?.resolve(),W=null;return}return ta(R,O)}),l){P1(r,ce);let R=()=>I1(r,ce);r.addEventListener("pagehide",R),ge=()=>r.removeEventListener("pagehide",R)}return E.initialized||ta("POP",E.location,{initialHydration:!0}),G}function ma(){_&&_(),ge&&ge(),j.clear(),le&&le.abort(),E.fetchers.forEach((R,O)=>Zt(O)),E.blockers.forEach((R,O)=>X(O))}function Qe(R){return j.add(R),()=>j.delete(R)}function et(R,O={}){R.matches&&(R.matches=R.matches.map(oe=>{let ye=m[oe.route.id],ue=oe.route;return ue.element!==ye.element||ue.errorElement!==ye.errorElement||ue.hydrateFallbackElement!==ye.hydrateFallbackElement?{...oe,route:ye}:oe})),E={...E,...R};let B=[],ne=[];E.fetchers.forEach((oe,ye)=>{oe.state==="idle"&&(ve.has(ye)?B.push(ye):ne.push(ye))}),ve.forEach(oe=>{!E.fetchers.has(oe)&&!me.has(oe)&&B.push(oe)}),[...j].forEach(oe=>oe(E,{deletedFetchers:B,newErrors:R.errors??null,viewTransitionOpts:O.viewTransitionOpts,flushSync:O.flushSync===!0})),B.forEach(oe=>Zt(oe)),ne.forEach(oe=>E.fetchers.delete(oe))}function ft(R,O,{flushSync:B}={}){let ne=E.actionData!=null&&E.navigation.formMethod!=null&&sa(E.navigation.formMethod)&&E.navigation.state==="loading"&&R.state?._isRedirect!==!0,oe;O.actionData?Object.keys(O.actionData).length>0?oe=O.actionData:oe=null:ne?oe=E.actionData:oe=null;let ye=O.loaderData?bg(E.loaderData,O.loaderData,O.matches||[],O.errors):E.loaderData,ue=E.blockers;ue.size>0&&(ue=new Map(ue),ue.forEach((Re,je)=>ue.set(je,Cl)));let he=A?!1:ua(R,O.matches||E.matches),pe=de===!0||E.navigation.formMethod!=null&&sa(E.navigation.formMethod)&&R.state?._isRedirect!==!0;g&&(p=g,g=void 0),A||H==="POP"||(H==="PUSH"?n.history.push(R,R.state):H==="REPLACE"&&n.history.replace(R,R.state));let we;if(H==="POP"){let Re=ce.get(E.location.pathname);Re&&Re.has(R.pathname)?we={currentLocation:E.location,nextLocation:R}:ce.has(R.pathname)&&(we={currentLocation:R,nextLocation:E.location})}else if(se){let Re=ce.get(E.location.pathname);Re?Re.add(R.pathname):(Re=new Set([R.pathname]),ce.set(E.location.pathname,Re)),we={currentLocation:E.location,nextLocation:R}}et({...O,actionData:oe,loaderData:ye,historyAction:H,location:R,initialized:!0,renderFallback:!1,navigation:Pu,revalidation:"idle",restoreScrollPosition:he,preventScrollReset:pe,blockers:ue},{viewTransitionOpts:we,flushSync:B===!0}),H="POP",de=!1,se=!1,A=!1,P=!1,W?.resolve(),W=null,Xe?.resolve(),Xe=null}async function qt(R,O){if(W?.resolve(),W=null,typeof R=="number"){W||(W=jg());let mt=W.promise;return n.history.go(R),mt}let B=md(E.location,E.matches,h,R,O?.fromRouteId,O?.relative),{path:ne,submission:oe,error:ye}=ug(!1,B,O),ue;O?.unstable_mask&&(ue={pathname:"",search:"",hash:"",...typeof O.unstable_mask=="string"?Mn(O.unstable_mask):{...E.location.unstable_mask,...O.unstable_mask}});let he=E.location,pe=Hl(he,ne,O&&O.state,void 0,ue);pe={...pe,...n.history.encodeLocation(pe)};let we=O&&O.replace!=null?O.replace:void 0,Re="PUSH";we===!0?Re="REPLACE":we===!1||oe!=null&&sa(oe.formMethod)&&oe.formAction===E.location.pathname+E.location.search&&(Re="REPLACE");let je=O&&"preventScrollReset"in O?O.preventScrollReset===!0:void 0,tt=(O&&O.flushSync)===!0,Ye=Oe({currentLocation:he,nextLocation:pe,historyAction:Re});if(Ye){ie(Ye,{state:"blocked",location:pe,proceed(){ie(Ye,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),qt(R,O)},reset(){let mt=new Map(E.blockers);mt.set(Ye,Cl),et({blockers:mt})}});return}await ta(Re,pe,{submission:oe,pendingError:ye,preventScrollReset:je,replace:O&&O.replace,enableViewTransition:O&&O.viewTransition,flushSync:tt,callSiteDefaultShouldRevalidate:O&&O.unstable_defaultShouldRevalidate})}function Vt(){Xe||(Xe=jg()),Fe(),et({revalidation:"loading"});let R=Xe.promise;return E.navigation.state==="submitting"?R:E.navigation.state==="idle"?(ta(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),R):(ta(H||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:se===!0}),R)}async function ta(R,O,B){le&&le.abort(),le=null,H=R,A=(B&&B.startUninterruptedRevalidation)===!0,ca(E.location,E.matches),de=(B&&B.preventScrollReset)===!0,se=(B&&B.enableViewTransition)===!0;let ne=g||p,oe=B&&B.overrideNavigation,ye=B?.initialHydration&&E.matches&&E.matches.length>0&&!V?E.matches:ir(ne,O,h),ue=(B&&B.flushSync)===!0;if(ye&&E.initialized&&!P&&q1(E.location,O)&&!(B&&B.submission&&sa(B.submission.formMethod))){ft(O,{matches:ye},{flushSync:ue});return}let he=Ma(ye,ne,O.pathname);if(he.active&&he.matches&&(ye=he.matches),!ye){let{error:bt,notFoundMatches:wt,route:We}=$e(O.pathname);ft(O,{matches:wt,loaderData:{},errors:{[We.id]:bt}},{flushSync:ue});return}le=new AbortController;let pe=Cs(n.history,O,le.signal,B&&B.submission),we=n.getContext?await n.getContext():new rg,Re;if(B&&B.pendingError)Re=[or(ye).route.id,{type:"error",error:B.pendingError}];else if(B&&B.submission&&sa(B.submission.formMethod)){let bt=await aa(pe,O,B.submission,ye,we,he.active,B&&B.initialHydration===!0,{replace:B.replace,flushSync:ue});if(bt.shortCircuited)return;if(bt.pendingActionResult){let[wt,We]=bt.pendingActionResult;if(Oa(We)&&Os(We.error)&&We.error.status===404){le=null,ft(O,{matches:bt.matches,loaderData:{},errors:{[wt]:We.error}});return}}ye=bt.matches||ye,Re=bt.pendingActionResult,oe=Iu(O,B.submission),ue=!1,he.active=!1,pe=Cs(n.history,pe.url,pe.signal)}let{shortCircuited:je,matches:tt,loaderData:Ye,errors:mt}=await Sa(pe,O,ye,we,he.active,oe,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,ue,Re,B&&B.callSiteDefaultShouldRevalidate);je||(le=null,ft(O,{matches:tt||ye,...vg(Re),loaderData:Ye,errors:mt}))}async function aa(R,O,B,ne,oe,ye,ue,he={}){Fe();let pe=Z1(O,B);if(et({navigation:pe},{flushSync:he.flushSync===!0}),ye){let je=await Na(ne,O.pathname,R.signal);if(je.type==="aborted")return{shortCircuited:!0};if(je.type==="error"){if(je.partialMatches.length===0){let{matches:Ye,route:mt}=lo(p);return{matches:Ye,pendingActionResult:[mt.id,{type:"error",error:je.error}]}}let tt=or(je.partialMatches).route.id;return{matches:je.partialMatches,pendingActionResult:[tt,{type:"error",error:je.error}]}}else if(je.matches)ne=je.matches;else{let{notFoundMatches:tt,error:Ye,route:mt}=$e(O.pathname);return{matches:tt,pendingActionResult:[mt.id,{type:"error",error:Ye}]}}}let we,Re=po(ne,O);if(!Re.route.action&&!Re.route.lazy)we={type:"error",error:Ka(405,{method:R.method,pathname:O.pathname,routeId:Re.route.id})};else{let je=Ts(d,m,R,ne,Re,ue?[]:i,oe),tt=await _e(R,je,oe,null);if(we=tt[Re.route.id],!we){for(let Ye of ne)if(tt[Ye.route.id]){we=tt[Ye.route.id];break}}if(R.signal.aborted)return{shortCircuited:!0}}if(Dr(we)){let je;return he&&he.replace!=null?je=he.replace:je=gg(we.response.headers.get("Location"),new URL(R.url),h,n.history)===E.location.pathname+E.location.search,await oa(R,we,!0,{submission:B,replace:je}),{shortCircuited:!0}}if(Oa(we)){let je=or(ne,Re.route.id);return(he&&he.replace)!==!0&&(H="PUSH"),{matches:ne,pendingActionResult:[je.route.id,we,Re.route.id]}}return{matches:ne,pendingActionResult:[Re.route.id,we]}}async function Sa(R,O,B,ne,oe,ye,ue,he,pe,we,Re,je,tt){let Ye=ye||Iu(O,ue),mt=ue||he||Sg(Ye),bt=!A&&!we;if(oe){if(bt){let Tt=ja(je);et({navigation:Ye,...Tt!==void 0?{actionData:Tt}:{}},{flushSync:Re})}let Ge=await Na(B,O.pathname,R.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){if(Ge.partialMatches.length===0){let{matches:na,route:Mt}=lo(p);return{matches:na,loaderData:{},errors:{[Mt.id]:Ge.error}}}let Tt=or(Ge.partialMatches).route.id;return{matches:Ge.partialMatches,loaderData:{},errors:{[Tt]:Ge.error}}}else if(Ge.matches)B=Ge.matches;else{let{error:Tt,notFoundMatches:na,route:Mt}=$e(O.pathname);return{matches:na,loaderData:{},errors:{[Mt.id]:Tt}}}}let wt=g||p,{dsMatches:We,revalidatingFetchers:Yt}=dg(R,ne,d,m,n.history,E,B,mt,O,we?[]:i,we===!0,P,fe,ve,ae,ee,wt,h,n.patchRoutesOnNavigation!=null,je,tt);if(w=++re,!n.dataStrategy&&!We.some(Ge=>Ge.shouldLoad)&&!We.some(Ge=>Ge.route.middleware&&Ge.route.middleware.length>0)&&Yt.length===0){let Ge=Ce();return ft(O,{matches:B,loaderData:{},errors:je&&Oa(je[1])?{[je[0]]:je[1].error}:null,...vg(je),...Ge?{fetchers:new Map(E.fetchers)}:{}},{flushSync:Re}),{shortCircuited:!0}}if(bt){let Ge={};if(!oe){Ge.navigation=Ye;let Tt=ja(je);Tt!==void 0&&(Ge.actionData=Tt)}Yt.length>0&&(Ge.fetchers=Aa(Yt)),et(Ge,{flushSync:Re})}Yt.forEach(Ge=>{xt(Ge.key),Ge.controller&&me.set(Ge.key,Ge.controller)});let yt=()=>Yt.forEach(Ge=>xt(Ge.key));le&&le.signal.addEventListener("abort",yt);let{loaderResults:Un,fetcherResults:Wa}=await Ae(We,Yt,R,ne);if(R.signal.aborted)return{shortCircuited:!0};le&&le.signal.removeEventListener("abort",yt),Yt.forEach(Ge=>me.delete(Ge.key));let Kt=io(Un);if(Kt)return await oa(R,Kt.result,!0,{replace:pe}),{shortCircuited:!0};if(Kt=io(Wa),Kt)return ee.add(Kt.key),await oa(R,Kt.result,!0,{replace:pe}),{shortCircuited:!0};let{loaderData:sn,errors:hr}=yg(E,B,Un,je,Yt,Wa);we&&E.errors&&(hr={...E.errors,...hr});let ln=Ce(),pr=Le(w),Yr=ln||pr||Yt.length>0;return{matches:B,loaderData:sn,errors:hr,...Yr?{fetchers:new Map(E.fetchers)}:{}}}function ja(R){if(R&&!Oa(R[1]))return{[R[0]]:R[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Aa(R){return R.forEach(O=>{let B=E.fetchers.get(O.key),ne=Rl(void 0,B?B.data:void 0);E.fetchers.set(O.key,ne)}),new Map(E.fetchers)}async function la(R,O,B,ne){xt(R);let oe=(ne&&ne.flushSync)===!0,ye=g||p,ue=md(E.location,E.matches,h,B,O,ne?.relative),he=ir(ye,ue,h),pe=Ma(he,ye,ue);if(pe.active&&pe.matches&&(he=pe.matches),!he){Nt(R,O,Ka(404,{pathname:ue}),{flushSync:oe});return}let{path:we,submission:Re,error:je}=ug(!0,ue,ne);if(je){Nt(R,O,je,{flushSync:oe});return}let tt=n.getContext?await n.getContext():new rg,Ye=(ne&&ne.preventScrollReset)===!0;if(Re&&sa(Re.formMethod)){await ia(R,O,we,he,tt,pe.active,oe,Ye,Re,ne&&ne.unstable_defaultShouldRevalidate);return}ae.set(R,{routeId:O,path:we}),await pt(R,O,we,he,tt,pe.active,oe,Ye,Re)}async function ia(R,O,B,ne,oe,ye,ue,he,pe,we){Fe(),ae.delete(R);let Re=E.fetchers.get(R);gt(R,J1(pe,Re),{flushSync:ue});let je=new AbortController,tt=Cs(n.history,B,je.signal,pe);if(ye){let vt=await Na(ne,new URL(tt.url).pathname,tt.signal,R);if(vt.type==="aborted")return;if(vt.type==="error"){Nt(R,O,vt.error,{flushSync:ue});return}else if(vt.matches)ne=vt.matches;else{Nt(R,O,Ka(404,{pathname:B}),{flushSync:ue});return}}let Ye=po(ne,B);if(!Ye.route.action&&!Ye.route.lazy){let vt=Ka(405,{method:pe.formMethod,pathname:B,routeId:O});Nt(R,O,vt,{flushSync:ue});return}me.set(R,je);let mt=re,bt=Ts(d,m,tt,ne,Ye,i,oe),wt=await _e(tt,bt,oe,R),We=wt[Ye.route.id];if(!We){for(let vt of bt)if(wt[vt.route.id]){We=wt[vt.route.id];break}}if(tt.signal.aborted){me.get(R)===je&&me.delete(R);return}if(ve.has(R)){if(Dr(We)||Oa(We)){gt(R,Dn(void 0));return}}else{if(Dr(We))if(me.delete(R),w>mt){gt(R,Dn(void 0));return}else return ee.add(R),gt(R,Rl(pe)),oa(tt,We,!1,{fetcherSubmission:pe,preventScrollReset:he});if(Oa(We)){Nt(R,O,We.error);return}}let Yt=E.navigation.location||E.location,yt=Cs(n.history,Yt,je.signal),Un=g||p,Wa=E.navigation.state!=="idle"?ir(Un,E.navigation.location,h):E.matches;qe(Wa,"Didn't find any matches after fetcher action");let Kt=++re;$.set(R,Kt);let sn=Rl(pe,We.data);E.fetchers.set(R,sn);let{dsMatches:hr,revalidatingFetchers:ln}=dg(yt,oe,d,m,n.history,E,Wa,pe,Yt,i,!1,P,fe,ve,ae,ee,Un,h,n.patchRoutesOnNavigation!=null,[Ye.route.id,We],we);ln.filter(vt=>vt.key!==R).forEach(vt=>{let Gr=vt.key,Vr=E.fetchers.get(Gr),Fl=Rl(void 0,Vr?Vr.data:void 0);E.fetchers.set(Gr,Fl),xt(Gr),vt.controller&&me.set(Gr,vt.controller)}),et({fetchers:new Map(E.fetchers)});let pr=()=>ln.forEach(vt=>xt(vt.key));je.signal.addEventListener("abort",pr);let{loaderResults:Yr,fetcherResults:Ge}=await Ae(hr,ln,yt,oe);if(je.signal.aborted)return;if(je.signal.removeEventListener("abort",pr),$.delete(R),me.delete(R),ln.forEach(vt=>me.delete(vt.key)),E.fetchers.has(R)){let vt=Dn(We.data);E.fetchers.set(R,vt)}let Tt=io(Yr);if(Tt)return oa(yt,Tt.result,!1,{preventScrollReset:he});if(Tt=io(Ge),Tt)return ee.add(Tt.key),oa(yt,Tt.result,!1,{preventScrollReset:he});let{loaderData:na,errors:Mt}=yg(E,Wa,Yr,void 0,ln,Ge);Le(Kt),E.navigation.state==="loading"&&Kt>w?(qe(H,"Expected pending action"),le&&le.abort(),ft(E.navigation.location,{matches:Wa,loaderData:na,errors:Mt,fetchers:new Map(E.fetchers)})):(et({errors:Mt,loaderData:bg(E.loaderData,na,Wa,Mt),fetchers:new Map(E.fetchers)}),P=!1)}async function pt(R,O,B,ne,oe,ye,ue,he,pe){let we=E.fetchers.get(R);gt(R,Rl(pe,we?we.data:void 0),{flushSync:ue});let Re=new AbortController,je=Cs(n.history,B,Re.signal);if(ye){let We=await Na(ne,new URL(je.url).pathname,je.signal,R);if(We.type==="aborted")return;if(We.type==="error"){Nt(R,O,We.error,{flushSync:ue});return}else if(We.matches)ne=We.matches;else{Nt(R,O,Ka(404,{pathname:B}),{flushSync:ue});return}}let tt=po(ne,B);me.set(R,Re);let Ye=re,mt=Ts(d,m,je,ne,tt,i,oe),wt=(await _e(je,mt,oe,R))[tt.route.id];if(me.get(R)===Re&&me.delete(R),!je.signal.aborted){if(ve.has(R)){gt(R,Dn(void 0));return}if(Dr(wt))if(w>Ye){gt(R,Dn(void 0));return}else{ee.add(R),await oa(je,wt,!1,{preventScrollReset:he});return}if(Oa(wt)){Nt(R,O,wt.error);return}gt(R,Dn(wt.data))}}async function oa(R,O,B,{submission:ne,fetcherSubmission:oe,preventScrollReset:ye,replace:ue}={}){B||(W?.resolve(),W=null),O.response.headers.has("X-Remix-Revalidate")&&(P=!0);let he=O.response.headers.get("Location");qe(he,"Expected a Location header on the redirect Response"),he=gg(he,new URL(R.url),h,n.history);let pe=Hl(E.location,he,{_isRedirect:!0});if(l){let mt=!1;if(O.response.headers.has("X-Remix-Reload-Document"))mt=!0;else if(wd(he)){const bt=hx(he,!0);mt=bt.origin!==r.location.origin||Qa(bt.pathname,h)==null}if(mt){ue?r.location.replace(he):r.location.assign(he);return}}le=null;let we=ue===!0||O.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Re,formAction:je,formEncType:tt}=E.navigation;!ne&&!oe&&Re&&je&&tt&&(ne=Sg(E.navigation));let Ye=ne||oe;if(w1.has(O.response.status)&&Ye&&sa(Ye.formMethod))await ta(we,pe,{submission:{...Ye,formAction:he},preventScrollReset:ye||de,enableViewTransition:B?se:void 0});else{let mt=Iu(pe,ne);await ta(we,pe,{overrideNavigation:mt,fetcherSubmission:oe,preventScrollReset:ye||de,enableViewTransition:B?se:void 0})}}async function _e(R,O,B,ne){let oe,ye={};try{oe=await M1(v,R,O,ne,B,!1)}catch(ue){return O.filter(he=>he.shouldLoad).forEach(he=>{ye[he.route.id]={type:"error",error:ue}}),ye}if(R.signal.aborted)return ye;if(!sa(R.method))for(let ue of O){if(oe[ue.route.id]?.type==="error")break;!oe.hasOwnProperty(ue.route.id)&&!E.loaderData.hasOwnProperty(ue.route.id)&&(!E.errors||!E.errors.hasOwnProperty(ue.route.id))&&ue.shouldCallHandler()&&(oe[ue.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ue.route.id}`)})}for(let[ue,he]of Object.entries(oe))if(K1(he)){let pe=he.result;ye[ue]={type:"redirect",response:B1(pe,R,ue,O,h)}}else ye[ue]=await H1(he);return ye}async function Ae(R,O,B,ne){let oe=_e(B,R,ne,null),ye=Promise.all(O.map(async pe=>{if(pe.matches&&pe.match&&pe.request&&pe.controller){let Re=(await _e(pe.request,pe.matches,ne,pe.key))[pe.match.route.id];return{[pe.key]:Re}}else return Promise.resolve({[pe.key]:{type:"error",error:Ka(404,{pathname:pe.path})}})})),ue=await oe,he=(await ye).reduce((pe,we)=>Object.assign(pe,we),{});return{loaderResults:ue,fetcherResults:he}}function Fe(){P=!0,ae.forEach((R,O)=>{me.has(O)&&fe.add(O),xt(O)})}function gt(R,O,B={}){E.fetchers.set(R,O),et({fetchers:new Map(E.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function Nt(R,O,B,ne={}){let oe=or(E.matches,O);Zt(R),et({errors:{[oe.route.id]:B},fetchers:new Map(E.fetchers)},{flushSync:(ne&&ne.flushSync)===!0})}function Ft(R){return xe.set(R,(xe.get(R)||0)+1),ve.has(R)&&ve.delete(R),E.fetchers.get(R)||E1}function Ia(R,O){xt(R,O?.reason),gt(R,Dn(null))}function Zt(R){let O=E.fetchers.get(R);me.has(R)&&!(O&&O.state==="loading"&&$.has(R))&&xt(R),ae.delete(R),$.delete(R),ee.delete(R),ve.delete(R),fe.delete(R),E.fetchers.delete(R)}function kt(R){let O=(xe.get(R)||0)-1;O<=0?(xe.delete(R),ve.add(R)):xe.set(R,O),et({fetchers:new Map(E.fetchers)})}function xt(R,O){let B=me.get(R);B&&(B.abort(O),me.delete(R))}function Dt(R){for(let O of R){let B=Ft(O),ne=Dn(B.data);E.fetchers.set(O,ne)}}function Ce(){let R=[],O=!1;for(let B of ee){let ne=E.fetchers.get(B);qe(ne,`Expected fetcher: ${B}`),ne.state==="loading"&&(ee.delete(B),R.push(B),O=!0)}return Dt(R),O}function Le(R){let O=[];for(let[B,ne]of $)if(ne<R){let oe=E.fetchers.get(B);qe(oe,`Expected fetcher: ${B}`),oe.state==="loading"&&(xt(B),$.delete(B),O.push(B))}return Dt(O),O.length>0}function st(R,O){let B=E.blockers.get(R)||Cl;return ze.get(R)!==O&&ze.set(R,O),B}function X(R){E.blockers.delete(R),ze.delete(R)}function ie(R,O){let B=E.blockers.get(R)||Cl;qe(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 ne=new Map(E.blockers);ne.set(R,O),et({blockers:ne})}function Oe({currentLocation:R,nextLocation:O,historyAction:B}){if(ze.size===0)return;ze.size>1&&Rt(!1,"A router only supports one blocker at a time");let ne=Array.from(ze.entries()),[oe,ye]=ne[ne.length-1],ue=E.blockers.get(oe);if(!(ue&&ue.state==="proceeding")&&ye({currentLocation:R,nextLocation:O,historyAction:B}))return oe}function $e(R){let O=Ka(404,{pathname:R}),B=g||p,{matches:ne,route:oe}=lo(B);return{notFoundMatches:ne,route:oe,error:O}}function Ue(R,O,B){if(N=R,z=O,C=B||null,!q&&E.navigation===Pu){q=!0;let ne=ua(E.location,E.matches);ne!=null&&et({restoreScrollPosition:ne})}return()=>{N=null,z=null,C=null}}function At(R,O){return C&&C(R,O.map(ne=>I0(ne,E.loaderData)))||R.key}function ca(R,O){if(N&&z){let B=At(R,O);N[B]=z()}}function ua(R,O){if(N){let B=At(R,O),ne=N[B];if(typeof ne=="number")return ne}return null}function Ma(R,O,B){if(n.patchRoutesOnNavigation)if(R){if(Object.keys(R[0].params).length>0)return{active:!0,matches:Ol(O,B,h,!0)}}else return{active:!0,matches:Ol(O,B,h,!0)||[]};return{active:!1,matches:null}}async function Na(R,O,B,ne){if(!n.patchRoutesOnNavigation)return{type:"success",matches:R};let oe=R;for(;;){let ye=g==null,ue=g||p,he=m;try{await n.patchRoutesOnNavigation({signal:B,path:O,matches:oe,fetcherKey:ne,patch:(Re,je)=>{B.aborted||fg(Re,je,ue,he,d,!1)}})}catch(Re){return{type:"error",error:Re,partialMatches:oe}}finally{ye&&!B.aborted&&(p=[...p])}if(B.aborted)return{type:"aborted"};let pe=ir(ue,O,h),we=null;if(pe){if(Object.keys(pe[0].params).length===0)return{type:"success",matches:pe};if(we=Ol(ue,O,h,!0),!(we&&oe.length<we.length&&mr(oe,we.slice(0,oe.length))))return{type:"success",matches:pe}}if(we||(we=Ol(ue,O,h,!0)),!we||mr(oe,we))return{type:"success",matches:null};oe=we}}function mr(R,O){return R.length===O.length&&R.every((B,ne)=>B.route.id===O[ne].route.id)}function $r(R){m={},g=Bl(R,d,void 0,m)}function qr(R,O,B=!1){let ne=g==null;fg(R,O,g||p,m,d,B),ne&&(p=[...p],et({}))}return G={get basename(){return h},get future(){return b},get state(){return E},get routes(){return p},get window(){return r},initialize:ea,subscribe:Qe,enableScrollRestoration:Ue,navigate:qt,fetch:la,revalidate:Vt,createHref:R=>n.history.createHref(R),encodeLocation:R=>n.history.encodeLocation(R),getFetcher:Ft,resetFetcher:Ia,deleteFetcher:kt,dispose:ma,getBlocker:st,deleteBlocker:X,patchRoutes:qr,_internalFetchControllers:me,_internalSetRoutes:$r,_internalSetStateDoNotUseOrYouWillBreakYourApp(R){et(R)}},n.unstable_instrumentations&&(G=x1(G,n.unstable_instrumentations.map(R=>R.router).filter(Boolean))),G}function k1(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function md(n,r,l,i,o,d){let m,p;if(o){m=[];for(let h of r)if(m.push(h),h.route.id===o){p=h;break}}else m=r,p=r[r.length-1];let g=ql(i||".",No(m),Qa(n.pathname,l)||n.pathname,d==="path");if(i==null&&(g.search=n.search,g.hash=n.hash),(i==null||i===""||i===".")&&p){let h=Rd(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),b=v.getAll("index");v.delete("index"),b.filter(j=>j).forEach(j=>v.append("index",j));let _=v.toString();g.search=_?`?${_}`:""}}return l!=="/"&&(g.pathname=d1({basename:l,pathname:g.pathname})),hn(g)}function ug(n,r,l){if(!l||!k1(l))return{path:r};if(l.formMethod&&!F1(l.formMethod))return{path:r,error:Ka(405,{method:l.formMethod})};let i=()=>({path:r,error:Ka(400,{type:"invalid-body"})}),d=(l.formMethod||"get").toUpperCase(),m=Ox(r);if(l.body!==void 0){if(l.formEncType==="text/plain"){if(!sa(d))return i();let b=typeof l.body=="string"?l.body:l.body instanceof FormData||l.body instanceof URLSearchParams?Array.from(l.body.entries()).reduce((_,[j,N])=>`${_}${j}=${N}
|
|
11
|
+
`,""):String(l.body);return{path:r,submission:{formMethod:d,formAction:m,formEncType:l.formEncType,formData:void 0,json:void 0,text:b}}}else if(l.formEncType==="application/json"){if(!sa(d))return i();try{let b=typeof l.body=="string"?JSON.parse(l.body):l.body;return{path:r,submission:{formMethod:d,formAction:m,formEncType:l.formEncType,formData:void 0,json:b,text:void 0}}}catch{return i()}}}qe(typeof FormData=="function","FormData is not available in this environment");let p,g;if(l.formData)p=pd(l.formData),g=l.formData;else if(l.body instanceof FormData)p=pd(l.body),g=l.body;else if(l.body instanceof URLSearchParams)p=l.body,g=xg(p);else if(l.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(l.body),g=xg(p)}catch{return i()}let h={formMethod:d,formAction:m,formEncType:l&&l.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(sa(h.formMethod))return{path:r,submission:h};let v=Mn(r);return n&&v.search&&Rd(v.search)&&p.append("index",""),v.search=`?${p}`,{path:hn(v),submission:h}}function dg(n,r,l,i,o,d,m,p,g,h,v,b,_,j,N,C,z,q,Q,V,Y){let te=V?Oa(V[1])?V[1].error:V[1].data:void 0,Z=o.createURL(d.location),G=o.createURL(g),E;if(v&&d.errors){let ge=Object.keys(d.errors)[0];E=m.findIndex(A=>A.route.id===ge)}else if(V&&Oa(V[1])){let ge=V[0];E=m.findIndex(A=>A.route.id===ge)-1}let H=V?V[1].statusCode:void 0,W=H&&H>=400,de={currentUrl:Z,currentParams:d.matches[0]?.params||{},nextUrl:G,nextParams:m[0].params,...p,actionResult:te,actionStatus:H},le=Gl(m),se=m.map((ge,A)=>{let{route:P}=ge,fe=null;if(E!=null&&A>E)fe=!1;else if(P.lazy)fe=!0;else if(!Ed(P))fe=!1;else if(v){let{shouldLoad:$}=Ex(P,d.loaderData,d.errors);fe=$}else T1(d.loaderData,d.matches[A],ge)&&(fe=!0);if(fe!==null)return hd(l,i,n,le,ge,h,r,fe);let me=!1;typeof Y=="boolean"?me=Y:W?me=!1:(b||Z.pathname+Z.search===G.pathname+G.search||Z.search!==G.search||z1(d.matches[A],ge))&&(me=!0);let re={...de,defaultShouldRevalidate:me},w=Ll(ge,re);return hd(l,i,n,le,ge,h,r,w,re,Y)}),ce=[];return N.forEach((ge,A)=>{if(v||!m.some(ae=>ae.route.id===ge.routeId)||j.has(A))return;let P=d.fetchers.get(A),fe=P&&P.state!=="idle"&&P.data===void 0,me=ir(z,ge.path,q);if(!me){if(Q&&fe)return;ce.push({key:A,routeId:ge.routeId,path:ge.path,matches:null,match:null,request:null,controller:null});return}if(C.has(A))return;let re=po(me,ge.path),w=new AbortController,$=Cs(o,ge.path,w.signal),ee=null;if(_.has(A))_.delete(A),ee=Ts(l,i,$,me,re,h,r);else if(fe)b&&(ee=Ts(l,i,$,me,re,h,r));else{let ae;typeof Y=="boolean"?ae=Y:W?ae=!1:ae=b;let xe={...de,defaultShouldRevalidate:ae};Ll(re,xe)&&(ee=Ts(l,i,$,me,re,h,r,xe))}ee&&ce.push({key:A,routeId:ge.routeId,path:ge.path,matches:ee,match:re,request:$,controller:w})}),{dsMatches:se,revalidatingFetchers:ce}}function Ed(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function Ex(n,r,l){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Ed(n))return{shouldLoad:!1,renderFallback:!1};let i=r!=null&&n.id in r,o=l!=null&&l[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 d=!i&&!o;return{shouldLoad:d,renderFallback:d}}function T1(n,r,l){let i=!r||l.route.id!==r.route.id,o=!n.hasOwnProperty(l.route.id);return i||o}function z1(n,r){let l=n.route.path;return n.pathname!==r.pathname||l!=null&&l.endsWith("*")&&n.params["*"]!==r.params["*"]}function Ll(n,r){if(n.route.shouldRevalidate){let l=n.route.shouldRevalidate(r);if(typeof l=="boolean")return l}return r.defaultShouldRevalidate}function fg(n,r,l,i,o,d){let m;if(n){let h=i[n];qe(h,`No route found to patch children into: routeId = ${n}`),h.children||(h.children=[]),m=h.children}else m=l;let p=[],g=[];if(r.forEach(h=>{let v=m.find(b=>Cx(h,b));v?g.push({existingRoute:v,newRoute:h}):p.push(h)}),p.length>0){let h=Bl(p,o,[n||"_","patch",String(m?.length||"0")],i);m.push(...h)}if(d&&g.length>0)for(let h=0;h<g.length;h++){let{existingRoute:v,newRoute:b}=g[h],_=v,[j]=Bl([b],o,[],{},!0);Object.assign(_,{element:j.element?j.element:_.element,errorElement:j.errorElement?j.errorElement:_.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:_.hydrateFallbackElement})}}function Cx(n,r){return"id"in n&&"id"in r&&n.id===r.id?!0:n.index===r.index&&n.path===r.path&&n.caseSensitive===r.caseSensitive?(!n.children||n.children.length===0)&&(!r.children||r.children.length===0)?!0:n.children?.every((l,i)=>r.children?.some(o=>Cx(l,o)))??!1:!1}var mg=new WeakMap,Rx=({key:n,route:r,manifest:l,mapRouteProperties:i})=>{let o=l[r.id];if(qe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let d=o.lazy[n];if(!d)return;let m=mg.get(o);m||(m={},mg.set(o,m));let p=m[n];if(p)return p;let g=(async()=>{let h=F0(n),b=o[n]!==void 0&&n!=="hasErrorBoundary";if(h)Rt(!h,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),m[n]=Promise.resolve();else if(b)Rt(!1,`Route "${o.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let _=await d();_!=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},hg=new WeakMap;function O1(n,r,l,i,o){let d=l[n.id];if(qe(d,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let v=hg.get(d);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let b=(async()=>{qe(typeof n.lazy=="function","No lazy route function found");let _=await n.lazy(),j={};for(let N in _){let C=_[N];if(C===void 0)continue;let z=J0(N),Q=d[N]!==void 0&&N!=="hasErrorBoundary";z?Rt(!z,"Route property "+N+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Q?Rt(!Q,`Route "${d.id}" has a static property "${N}" defined but its lazy function is also returning a value for this property. The lazy route property "${N}" will be ignored.`):j[N]=C}Object.assign(d,j),Object.assign(d,{...i(d),lazy:void 0})})();return hg.set(d,b),b.catch(()=>{}),{lazyRoutePromise:b,lazyHandlerPromise:b}}let m=Object.keys(n.lazy),p=[],g;for(let v of m){if(o&&o.includes(v))continue;let b=Rx({key:v,route:n,manifest:l,mapRouteProperties:i});b&&(p.push(b),v===r&&(g=b))}let h=p.length>0?Promise.all(p).then(()=>{}):void 0;return h?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:g}}async function pg(n){let r=n.matches.filter(o=>o.shouldLoad),l={};return(await Promise.all(r.map(o=>o.resolve()))).forEach((o,d)=>{l[r[d].route.id]=o}),l}async function D1(n){return n.matches.some(r=>r.route.middleware)?kx(n,()=>pg(n)):pg(n)}function kx(n,r){return A1(n,r,i=>{if(Q1(i))throw i;return i},G1,l);function l(i,o,d){if(d)return Promise.resolve(Object.assign(d.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=or(m,m[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:i}})}}}async function A1(n,r,l,i,o){let{matches:d,request:m,params:p,context:g,unstable_pattern:h}=n,v=d.flatMap(_=>_.route.middleware?_.route.middleware.map(j=>[_.route.id,j]):[]);return await Tx({request:m,params:p,context:g,unstable_pattern:h},v,r,l,i,o)}async function Tx(n,r,l,i,o,d,m=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=r[m];if(!g)return await l();let[h,v]=g,b,_=async()=>{if(b)throw new Error("You may only call `next()` once per middleware");try{return b={value:await Tx(n,r,l,i,o,d,m+1)},b.value}catch(j){return b={value:await d(j,h,b)},b.value}};try{let j=await v(n,_),N=j!=null?i(j):void 0;return o(N)?N:b?N??b.value:(b={value:await _()},b.value)}catch(j){return await d(j,h,b)}}function zx(n,r,l,i,o){let d=Rx({key:"middleware",route:i.route,manifest:r,mapRouteProperties:n}),m=O1(i.route,sa(l.method)?"action":"loader",r,n,o);return{middleware:d,route:m.lazyRoutePromise,handler:m.lazyHandlerPromise}}function hd(n,r,l,i,o,d,m,p,g=null,h){let v=!1,b=zx(n,r,l,o,d);return{...o,_lazyPromises:b,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(_){return v=!0,g?typeof h=="boolean"?Ll(o,{...g,defaultShouldRevalidate:h}):typeof _=="boolean"?Ll(o,{...g,defaultShouldRevalidate:_}):Ll(o,g):p},resolve(_){let{lazy:j,loader:N,middleware:C}=o.route,z=v||p||_&&!sa(l.method)&&(j||N),q=C&&C.length>0&&!N&&!j;return z&&(sa(l.method)||!q)?L1({request:l,unstable_pattern:i,match:o,lazyHandlerPromise:b?.handler,lazyRoutePromise:b?.route,handlerOverride:_,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function Ts(n,r,l,i,o,d,m,p=null){return i.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:zx(n,r,l,g,d),resolve:()=>Promise.resolve({type:"data",result:void 0})}:hd(n,r,l,Gl(i),g,d,m,!0,p))}async function M1(n,r,l,i,o,d){l.some(h=>h._lazyPromises?.middleware)&&await Promise.all(l.map(h=>h._lazyPromises?.middleware));let m={request:r,unstable_pattern:Gl(l),params:l[0].params,context:o,matches:l},g=await n({...m,fetcherKey:i,runClientMiddleware:h=>{let v=m;return kx(v,()=>h({...v,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(l.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return g}async function L1({request:n,unstable_pattern:r,match:l,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:d,scopedContext:m}){let p,g,h=sa(n.method),v=h?"action":"loader",b=_=>{let j,N=new Promise((q,Q)=>j=Q);g=()=>j(),n.signal.addEventListener("abort",g);let C=q=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${l.route.id}]`)):_({request:n,unstable_pattern:r,params:l.params,context:m},...q!==void 0?[q]:[]),z=(async()=>{try{return{type:"data",result:await(d?d(Q=>C(Q)):C())}}catch(q){return{type:"error",result:q}}})();return Promise.race([z,N])};try{let _=h?l.route.action:l.route.loader;if(i||o)if(_){let j,[N]=await Promise.all([b(_).catch(C=>{j=C}),i,o]);if(j!==void 0)throw j;p=N}else{await i;let j=h?l.route.action:l.route.loader;if(j)[p]=await Promise.all([b(j),o]);else if(v==="action"){let N=new URL(n.url),C=N.pathname+N.search;throw Ka(405,{method:n.method,pathname:C,routeId:l.route.id})}else return{type:"data",result:void 0}}else if(_)p=await b(_);else{let j=new URL(n.url),N=j.pathname+j.search;throw Ka(404,{pathname:N})}}catch(_){return{type:"error",result:_}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function U1(n){let r=n.headers.get("Content-Type");return r&&/\bapplication\/json\b/.test(r)?n.body==null?null:n.json():n.text()}async function H1(n){let{result:r,type:l}=n;if(Cd(r)){let i;try{i=await U1(r)}catch(o){return{type:"error",error:o}}return l==="error"?{type:"error",error:new Yl(r.status,r.statusText,i),statusCode:r.status,headers:r.headers}:{type:"data",data:i,statusCode:r.status,headers:r.headers}}return l==="error"?_g(r)?r.data instanceof Error?{type:"error",error:r.data,statusCode:r.init?.status,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"error",error:Y1(r),statusCode:Os(r)?r.status:void 0,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"error",error:r,statusCode:Os(r)?r.status:void 0}:_g(r)?{type:"data",data:r.data,statusCode:r.init?.status,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function B1(n,r,l,i,o){let d=n.headers.get("Location");if(qe(d,"Redirects returned/thrown from loaders/actions must have a Location header"),!wd(d)){let m=i.slice(0,i.findIndex(p=>p.route.id===l)+1);d=md(new URL(r.url),m,o,d),n.headers.set("Location",d)}return n}function gg(n,r,l,i){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(wd(n)){let d=n,m=d.startsWith("//")?new URL(r.protocol+d):new URL(d);if(o.includes(m.protocol))throw new Error("Invalid redirect location");let p=Qa(m.pathname,l)!=null;if(m.origin===r.origin&&p)return m.pathname+m.search+m.hash}try{let d=i.createURL(n);if(o.includes(d.protocol))throw new Error("Invalid redirect location")}catch{}return n}function Cs(n,r,l,i){let o=n.createURL(Ox(r)).toString(),d={signal:l};if(i&&sa(i.formMethod)){let{formMethod:m,formEncType:p}=i;d.method=m.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(i.json)):p==="text/plain"?d.body=i.text:p==="application/x-www-form-urlencoded"&&i.formData?d.body=pd(i.formData):d.body=i.formData}return new Request(o,d)}function pd(n){let r=new URLSearchParams;for(let[l,i]of n.entries())r.append(l,typeof i=="string"?i:i.name);return r}function xg(n){let r=new FormData;for(let[l,i]of n.entries())r.append(l,i);return r}function $1(n,r,l,i=!1,o=!1){let d={},m=null,p,g=!1,h={},v=l&&Oa(l[1])?l[1].error:void 0;return n.forEach(b=>{if(!(b.route.id in r))return;let _=b.route.id,j=r[_];if(qe(!Dr(j),"Cannot handle redirect results in processLoaderData"),Oa(j)){let N=j.error;if(v!==void 0&&(N=v,v=void 0),m=m||{},o)m[_]=N;else{let C=or(n,_);m[C.route.id]==null&&(m[C.route.id]=N)}i||(d[_]=wx),g||(g=!0,p=Os(j.error)?j.error.status:500),j.headers&&(h[_]=j.headers)}else d[_]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(h[_]=j.headers)}),v!==void 0&&l&&(m={[l[0]]:v},l[2]&&(d[l[2]]=void 0)),{loaderData:d,errors:m,statusCode:p||200,loaderHeaders:h}}function yg(n,r,l,i,o,d){let{loaderData:m,errors:p}=$1(r,l,i);return o.filter(g=>!g.matches||g.matches.some(h=>h.shouldLoad)).forEach(g=>{let{key:h,match:v,controller:b}=g;if(b&&b.signal.aborted)return;let _=d[h];if(qe(_,"Did not find corresponding fetcher result"),Oa(_)){let j=or(n.matches,v?.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:_.error}),n.fetchers.delete(h)}else if(Dr(_))qe(!1,"Unhandled fetcher revalidation redirect");else{let j=Dn(_.data);n.fetchers.set(h,j)}}),{loaderData:m,errors:p}}function bg(n,r,l,i){let o=Object.entries(r).filter(([,d])=>d!==wx).reduce((d,[m,p])=>(d[m]=p,d),{});for(let d of l){let m=d.route.id;if(!r.hasOwnProperty(m)&&n.hasOwnProperty(m)&&d.route.loader&&(o[m]=n[m]),i&&i.hasOwnProperty(m))break}return o}function vg(n){return n?Oa(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function or(n,r){return(r?n.slice(0,n.findIndex(i=>i.route.id===r)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function lo(n){let r=n.length===1?n[0]:n.find(l=>l.index||!l.path||l.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function Ka(n,{pathname:r,routeId:l,method:i,type:o,message:d}={}){let m="Unknown Server Error",p="Unknown @remix-run/router error";return n===400?(m="Bad Request",i&&r&&l?p=`You made a ${i} request to "${r}" but did not provide a \`loader\` for route "${l}", so there is no way to handle the request.`:o==="invalid-body"&&(p="Unable to encode submission body")):n===403?(m="Forbidden",p=`Route "${l}" does not match URL "${r}"`):n===404?(m="Not Found",p=`No route matches URL "${r}"`):n===405&&(m="Method Not Allowed",i&&r&&l?p=`You made a ${i.toUpperCase()} request to "${r}" but did not provide an \`action\` for route "${l}", so there is no way to handle the request.`:i&&(p=`Invalid request method "${i.toUpperCase()}"`)),new Yl(n||500,m,new Error(p),!0)}function io(n){let r=Object.entries(n);for(let l=r.length-1;l>=0;l--){let[i,o]=r[l];if(Dr(o))return{key:i,result:o}}}function Ox(n){let r=typeof n=="string"?Mn(n):n;return hn({...r,hash:""})}function q1(n,r){return n.pathname!==r.pathname||n.search!==r.search?!1:n.hash===""?r.hash!=="":n.hash===r.hash?!0:r.hash!==""}function Y1(n){return new Yl(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)}function G1(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([r,l])=>typeof r=="string"&&V1(l))}function V1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function K1(n){return Cd(n.result)&&jx.has(n.result.status)}function Oa(n){return n.type==="error"}function Dr(n){return(n&&n.type)==="redirect"}function _g(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function Cd(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function X1(n){return jx.has(n)}function Q1(n){return Cd(n)&&X1(n.status)&&n.headers.has("Location")}function F1(n){return N1.has(n.toUpperCase())}function sa(n){return S1.has(n.toUpperCase())}function Rd(n){return new URLSearchParams(n).getAll("index").some(r=>r==="")}function po(n,r){let l=typeof r=="string"?Mn(r).search:r.search;if(n[n.length-1].route.index&&Rd(l||""))return n[n.length-1];let i=yx(n);return i[i.length-1]}function Sg(n){let{formMethod:r,formAction:l,formEncType:i,text:o,formData:d,json:m}=n;if(!(!r||!l||!i)){if(o!=null)return{formMethod:r,formAction:l,formEncType:i,formData:void 0,json:void 0,text:o};if(d!=null)return{formMethod:r,formAction:l,formEncType:i,formData:d,json:void 0,text:void 0};if(m!==void 0)return{formMethod:r,formAction:l,formEncType:i,formData:void 0,json:m,text:void 0}}}function Iu(n,r){return r?{state:"loading",location:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Z1(n,r){return{state:"submitting",location:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Rl(n,r){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function J1(n,r){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:r?r.data:void 0}}function Dn(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 P1(n,r){try{let l=n.sessionStorage.getItem(Nx);if(l){let i=JSON.parse(l);for(let[o,d]of Object.entries(i||{}))d&&Array.isArray(d)&&r.set(o,new Set(d||[]))}}catch{}}function I1(n,r){if(r.size>0){let l={};for(let[i,o]of r)l[i]=[...o];try{n.sessionStorage.setItem(Nx,JSON.stringify(l))}catch(i){Rt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function jg(){let n,r,l=new Promise((i,o)=>{n=async d=>{i(d);try{await l}catch{}},r=async d=>{o(d);try{await l}catch{}}});return{promise:l,resolve:n,reject:r}}var Ur=y.createContext(null);Ur.displayName="DataRouter";var Vl=y.createContext(null);Vl.displayName="DataRouterState";var Dx=y.createContext(!1);function W1(){return y.useContext(Dx)}var kd=y.createContext({isTransitioning:!1});kd.displayName="ViewTransition";var Ax=y.createContext(new Map);Ax.displayName="Fetchers";var e4=y.createContext(null);e4.displayName="Await";var Da=y.createContext(null);Da.displayName="Navigation";var wo=y.createContext(null);wo.displayName="Location";var Ja=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ja.displayName="Route";var Td=y.createContext(null);Td.displayName="RouteError";var Mx="REACT_ROUTER_ERROR",t4="REDIRECT",a4="ROUTE_ERROR_RESPONSE";function n4(n){if(n.startsWith(`${Mx}:${t4}:{`))try{let r=JSON.parse(n.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function r4(n){if(n.startsWith(`${Mx}:${a4}:{`))try{let r=JSON.parse(n.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Yl(r.status,r.statusText,r.data)}catch{}}function s4(n,{relative:r}={}){qe(As(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:i}=y.useContext(Da),{hash:o,pathname:d,search:m}=Xl(n,{relative:r}),p=d;return l!=="/"&&(p=d==="/"?l:nn([l,d])),i.createHref({pathname:p,search:m,hash:o})}function As(){return y.useContext(wo)!=null}function Pa(){return qe(As(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(wo).location}var Lx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ux(n){y.useContext(Da).static||y.useLayoutEffect(n)}function _a(){let{isDataRoute:n}=y.useContext(Ja);return n?b4():l4()}function l4(){qe(As(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Ur),{basename:r,navigator:l}=y.useContext(Da),{matches:i}=y.useContext(Ja),{pathname:o}=Pa(),d=JSON.stringify(No(i)),m=y.useRef(!1);return Ux(()=>{m.current=!0}),y.useCallback((g,h={})=>{if(Rt(m.current,Lx),!m.current)return;if(typeof g=="number"){l.go(g);return}let v=ql(g,JSON.parse(d),o,h.relative==="path");n==null&&r!=="/"&&(v.pathname=v.pathname==="/"?r:nn([r,v.pathname])),(h.replace?l.replace:l.push)(v,h.state,h)},[r,l,d,o,n])}var i4=y.createContext(null);function o4(n){let r=y.useContext(Ja).outlet;return y.useMemo(()=>r&&y.createElement(i4.Provider,{value:n},r),[r,n])}function Kl(){let{matches:n}=y.useContext(Ja),r=n[n.length-1];return r?r.params:{}}function Xl(n,{relative:r}={}){let{matches:l}=y.useContext(Ja),{pathname:i}=Pa(),o=JSON.stringify(No(l));return y.useMemo(()=>ql(n,JSON.parse(o),i,r==="path"),[n,o,i,r])}function c4(n,r,l){qe(As(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=y.useContext(Da),{matches:o}=y.useContext(Ja),d=o[o.length-1],m=d?d.params:{},p=d?d.pathname:"/",g=d?d.pathnameBase:"/",h=d&&d.route;{let z=h&&h.path||"";$x(p,!h||z.endsWith("*")||z.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${z}">) 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.
|
|
12
|
+
|
|
13
|
+
Please change the parent <Route path="${z}"> to <Route path="${z==="/"?"*":`${z}/*`}">.`)}let v=Pa(),b;b=v;let _=b.pathname||"/",j=_;if(g!=="/"){let z=g.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(z.length).join("/")}let N=ir(n,{pathname:j});return Rt(h||N!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Rt(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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.`),h4(N&&N.map(z=>Object.assign({},z,{params:Object.assign({},m,z.params),pathname:nn([g,i.encodeLocation?i.encodeLocation(z.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathname]),pathnameBase:z.pathnameBase==="/"?g:nn([g,i.encodeLocation?i.encodeLocation(z.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathnameBase])})),o,l)}function u4(){let n=Bx(),r=Os(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},d={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},r),l?y.createElement("pre",{style:o},l):null,m)}var d4=y.createElement(u4,null),Hx=class extends y.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,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){this.props.onError?this.props.onError(n,r):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 l=r4(n.digest);l&&(n=l)}let r=n!==void 0?y.createElement(Ja.Provider,{value:this.props.routeContext},y.createElement(Td.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(f4,{error:n},r):r}};Hx.contextType=Dx;var Wu=new WeakMap;function f4({children:n,error:r}){let{basename:l}=y.useContext(Da);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let i=n4(r.digest);if(i){let o=Wu.get(r);if(o)throw o;let d=vx(i.location,l);if(bx&&!Wu.get(r))if(d.isExternal||i.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:i.replace}));throw Wu.set(r,m),m}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function m4({routeContext:n,match:r,children:l}){let i=y.useContext(Ur);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(Ja.Provider,{value:n},l)}function h4(n,r=[],l){let i=l?.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(r.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let o=n,d=i?.errors;if(d!=null){let v=o.findIndex(b=>b.route.id&&d?.[b.route.id]!==void 0);qe(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let m=!1,p=-1;if(l&&i){m=i.renderFallback;for(let v=0;v<o.length;v++){let b=o[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(p=v),b.route.id){let{loaderData:_,errors:j}=i,N=b.route.loader&&!_.hasOwnProperty(b.route.id)&&(!j||j[b.route.id]===void 0);if(b.route.lazy||N){l.isStatic&&(m=!0),p>=0?o=o.slice(0,p+1):o=[o[0]];break}}}}let g=l?.onError,h=i&&g?(v,b)=>{g(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Gl(i.matches),errorInfo:b})}:void 0;return o.reduceRight((v,b,_)=>{let j,N=!1,C=null,z=null;i&&(j=d&&b.route.id?d[b.route.id]:void 0,C=b.route.errorElement||d4,m&&(p<0&&_===0?($x("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,z=null):p===_&&(N=!0,z=b.route.hydrateFallbackElement||null)));let q=r.concat(o.slice(0,_+1)),Q=()=>{let V;return j?V=C:N?V=z:b.route.Component?V=y.createElement(b.route.Component,null):b.route.element?V=b.route.element:V=v,y.createElement(m4,{match:b,routeContext:{outlet:v,matches:q,isDataRoute:i!=null},children:V})};return i&&(b.route.ErrorBoundary||b.route.errorElement||_===0)?y.createElement(Hx,{location:i.location,revalidation:i.revalidation,component:C,error:j,children:Q(),routeContext:{outlet:null,matches:q,isDataRoute:!0},onError:h}):Q()},null)}function zd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function p4(n){let r=y.useContext(Ur);return qe(r,zd(n)),r}function g4(n){let r=y.useContext(Vl);return qe(r,zd(n)),r}function x4(n){let r=y.useContext(Ja);return qe(r,zd(n)),r}function Od(n){let r=x4(n),l=r.matches[r.matches.length-1];return qe(l.route.id,`${n} can only be used on routes that contain a unique "id"`),l.route.id}function y4(){return Od("useRouteId")}function Bx(){let n=y.useContext(Td),r=g4("useRouteError"),l=Od("useRouteError");return n!==void 0?n:r.errors?.[l]}function b4(){let{router:n}=p4("useNavigate"),r=Od("useNavigate"),l=y.useRef(!1);return Ux(()=>{l.current=!0}),y.useCallback(async(o,d={})=>{Rt(l.current,Lx),l.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:r,...d}))},[n,r])}var Ng={};function $x(n,r,l){!r&&!Ng[n]&&(Ng[n]=!0,Rt(!1,l))}var wg={};function Eg(n,r){!n&&!wg[r]&&(wg[r]=!0,console.warn(r))}var v4="useOptimistic",Cg=Pv[v4],_4=()=>{};function S4(n){return Cg?Cg(n):[n,_4]}function j4(n){let r={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&Rt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(r,{element:y.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&Rt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(r,{hydrateFallbackElement:y.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&Rt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(r,{errorElement:y.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),r}var N4=["HydrateFallback","hydrateFallbackElement"],w4=class{constructor(){this.status="pending",this.promise=new Promise((n,r)=>{this.resolve=l=>{this.status==="pending"&&(this.status="resolved",n(l))},this.reject=l=>{this.status==="pending"&&(this.status="rejected",r(l))}})}};function E4({router:n,flushSync:r,onError:l,unstable_useTransitions:i}){i=W1()||i;let[d,m]=y.useState(n.state),[p,g]=S4(d),[h,v]=y.useState(),[b,_]=y.useState({isTransitioning:!1}),[j,N]=y.useState(),[C,z]=y.useState(),[q,Q]=y.useState(),V=y.useRef(new Map),Y=y.useCallback((E,{deletedFetchers:H,newErrors:W,flushSync:de,viewTransitionOpts:le})=>{W&&l&&Object.values(W).forEach(ce=>l(ce,{location:E.location,params:E.matches[0]?.params??{},unstable_pattern:Gl(E.matches)})),E.fetchers.forEach((ce,ge)=>{ce.data!==void 0&&V.current.set(ge,ce.data)}),H.forEach(ce=>V.current.delete(ce)),Eg(de===!1||r!=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 se=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(Eg(le==null||se,"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."),!le||!se){r&&de?r(()=>m(E)):i===!1?m(E):y.startTransition(()=>{i===!0&&g(ce=>Rg(ce,E)),m(E)});return}if(r&&de){r(()=>{C&&(j?.resolve(),C.skipTransition()),_({isTransitioning:!0,flushSync:!0,currentLocation:le.currentLocation,nextLocation:le.nextLocation})});let ce=n.window.document.startViewTransition(()=>{r(()=>m(E))});ce.finished.finally(()=>{r(()=>{N(void 0),z(void 0),v(void 0),_({isTransitioning:!1})})}),r(()=>z(ce));return}C?(j?.resolve(),C.skipTransition(),Q({state:E,currentLocation:le.currentLocation,nextLocation:le.nextLocation})):(v(E),_({isTransitioning:!0,flushSync:!1,currentLocation:le.currentLocation,nextLocation:le.nextLocation}))},[n.window,r,C,j,i,g,l]);y.useLayoutEffect(()=>n.subscribe(Y),[n,Y]),y.useEffect(()=>{b.isTransitioning&&!b.flushSync&&N(new w4)},[b]),y.useEffect(()=>{if(j&&h&&n.window){let E=h,H=j.promise,W=n.window.document.startViewTransition(async()=>{i===!1?m(E):y.startTransition(()=>{i===!0&&g(de=>Rg(de,E)),m(E)}),await H});W.finished.finally(()=>{N(void 0),z(void 0),v(void 0),_({isTransitioning:!1})}),z(W)}},[h,j,n.window,i,g]),y.useEffect(()=>{j&&h&&p.location.key===h.location.key&&j.resolve()},[j,C,p.location,h]),y.useEffect(()=>{!b.isTransitioning&&q&&(v(q.state),_({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}),Q(void 0))},[b.isTransitioning,q]);let te=y.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,H,W)=>n.navigate(E,{state:H,preventScrollReset:W?.preventScrollReset}),replace:(E,H,W)=>n.navigate(E,{replace:!0,state:H,preventScrollReset:W?.preventScrollReset})}),[n]),Z=n.basename||"/",G=y.useMemo(()=>({router:n,navigator:te,static:!1,basename:Z,onError:l}),[n,te,Z,l]);return y.createElement(y.Fragment,null,y.createElement(Ur.Provider,{value:G},y.createElement(Vl.Provider,{value:p},y.createElement(Ax.Provider,{value:V.current},y.createElement(kd.Provider,{value:b},y.createElement(T4,{basename:Z,location:p.location,navigationType:p.historyAction,navigator:te,unstable_useTransitions:i},y.createElement(C4,{routes:n.routes,future:n.future,state:p,isStatic:!1,onError:l})))))),null)}function Rg(n,r){return{...n,navigation:r.navigation.state!=="idle"?r.navigation:n.navigation,revalidation:r.revalidation!=="idle"?r.revalidation:n.revalidation,actionData:r.navigation.state!=="submitting"?r.actionData:n.actionData,fetchers:r.fetchers}}var C4=y.memo(R4);function R4({routes:n,future:r,state:l,isStatic:i,onError:o}){return c4(n,void 0,{state:l,isStatic:i,onError:o})}function k4({to:n,replace:r,state:l,relative:i}){qe(As(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=y.useContext(Da);Rt(!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:d}=y.useContext(Ja),{pathname:m}=Pa(),p=_a(),g=ql(n,No(d),m,i==="path"),h=JSON.stringify(g);return y.useEffect(()=>{p(JSON.parse(h),{replace:r,state:l,relative:i})},[p,h,i,r,l]),null}function qx(n){return o4(n.context)}function T4({basename:n="/",children:r=null,location:l,navigationType:i="POP",navigator:o,static:d=!1,unstable_useTransitions:m}){qe(!As(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=y.useMemo(()=>({basename:p,navigator:o,static:d,unstable_useTransitions:m,future:{}}),[p,o,d,m]);typeof l=="string"&&(l=Mn(l));let{pathname:h="/",search:v="",hash:b="",state:_=null,key:j="default",unstable_mask:N}=l,C=y.useMemo(()=>{let z=Qa(h,p);return z==null?null:{location:{pathname:z,search:v,hash:b,state:_,key:j,unstable_mask:N},navigationType:i}},[p,h,v,b,_,j,i,N]);return Rt(C!=null,`<Router basename="${p}"> is not able to match the URL "${h}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:y.createElement(Da.Provider,{value:g},y.createElement(wo.Provider,{children:r,value:C}))}var go="get",xo="application/x-www-form-urlencoded";function Eo(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function z4(n){return Eo(n)&&n.tagName.toLowerCase()==="button"}function O4(n){return Eo(n)&&n.tagName.toLowerCase()==="form"}function D4(n){return Eo(n)&&n.tagName.toLowerCase()==="input"}function A4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function M4(n,r){return n.button===0&&(!r||r==="_self")&&!A4(n)}function gd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((r,l)=>{let i=n[l];return r.concat(Array.isArray(i)?i.map(o=>[l,o]):[[l,i]])},[]))}function L4(n,r){let l=gd(n);return r&&r.forEach((i,o)=>{l.has(o)||r.getAll(o).forEach(d=>{l.append(o,d)})}),l}var oo=null;function U4(){if(oo===null)try{new FormData(document.createElement("form"),0),oo=!1}catch{oo=!0}return oo}var H4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ed(n){return n!=null&&!H4.has(n)?(Rt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xo}"`),null):n}function B4(n,r){let l,i,o,d,m;if(O4(n)){let p=n.getAttribute("action");i=p?Qa(p,r):null,l=n.getAttribute("method")||go,o=ed(n.getAttribute("enctype"))||xo,d=new FormData(n)}else if(z4(n)||D4(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?Qa(g,r):null,l=n.getAttribute("formmethod")||p.getAttribute("method")||go,o=ed(n.getAttribute("formenctype"))||ed(p.getAttribute("enctype"))||xo,d=new FormData(p,n),!U4()){let{name:h,type:v,value:b}=n;if(v==="image"){let _=h?`${h}.`:"";d.append(`${_}x`,"0"),d.append(`${_}y`,"0")}else h&&d.append(h,b)}}else{if(Eo(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=go,i=null,o=xo,m=n}return d&&o==="text/plain"&&(m=d,d=void 0),{action:i,method:l.toLowerCase(),encType:o,formData:d,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Dd(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function $4(n,r,l,i){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return l?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:r&&Qa(o.pathname,r)==="/"?o.pathname=`${r.replace(/\/$/,"")}/_root.${i}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${i}`,o}async function q4(n,r){if(n.id in r)return r[n.id];try{let l=await import(n.module);return r[n.id]=l,l}catch(l){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Y4(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 G4(n,r,l){let i=await Promise.all(n.map(async o=>{let d=r.routes[o.route.id];if(d){let m=await q4(d,l);return m.links?m.links():[]}return[]}));return Q4(i.flat(1).filter(Y4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function kg(n,r,l,i,o,d){let m=(g,h)=>l[h]?g.route.id!==l[h].route.id:!0,p=(g,h)=>l[h].pathname!==g.pathname||l[h].route.path?.endsWith("*")&&l[h].params["*"]!==g.params["*"];return d==="assets"?r.filter((g,h)=>m(g,h)||p(g,h)):d==="data"?r.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 b=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:l[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function V4(n,r,{includeHydrateFallback:l}={}){return K4(n.map(i=>{let o=r.routes[i.route.id];if(!o)return[];let d=[o.module];return o.clientActionModule&&(d=d.concat(o.clientActionModule)),o.clientLoaderModule&&(d=d.concat(o.clientLoaderModule)),l&&o.hydrateFallbackModule&&(d=d.concat(o.hydrateFallbackModule)),o.imports&&(d=d.concat(o.imports)),d}).flat(1))}function K4(n){return[...new Set(n)]}function X4(n){let r={},l=Object.keys(n).sort();for(let i of l)r[i]=n[i];return r}function Q4(n,r){let l=new Set;return new Set(r),n.reduce((i,o)=>{let d=JSON.stringify(X4(o));return l.has(d)||(l.add(d),i.push({key:d,link:o})),i},[])}function Yx(){let n=y.useContext(Ur);return Dd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function F4(){let n=y.useContext(Vl);return Dd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Ad=y.createContext(void 0);Ad.displayName="FrameworkContext";function Gx(){let n=y.useContext(Ad);return Dd(n,"You must render this element inside a <HydratedRouter> element"),n}function Z4(n,r){let l=y.useContext(Ad),[i,o]=y.useState(!1),[d,m]=y.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:v,onTouchStart:b}=r,_=y.useRef(null);y.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let C=q=>{q.forEach(Q=>{m(Q.isIntersecting)})},z=new IntersectionObserver(C,{threshold:.5});return _.current&&z.observe(_.current),()=>{z.disconnect()}}},[n]),y.useEffect(()=>{if(i){let C=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(C)}}},[i]);let j=()=>{o(!0)},N=()=>{o(!1),m(!1)};return l?n!=="intent"?[d,_,{}]:[d,_,{onFocus:kl(p,j),onBlur:kl(g,N),onMouseEnter:kl(h,j),onMouseLeave:kl(v,N),onTouchStart:kl(b,j)}]:[!1,_,{}]}function kl(n,r){return l=>{n&&n(l),l.defaultPrevented||r(l)}}function J4({page:n,...r}){let{router:l}=Yx(),i=y.useMemo(()=>ir(l.routes,n,l.basename),[l.routes,n,l.basename]);return i?y.createElement(I4,{page:n,matches:i,...r}):null}function P4(n){let{manifest:r,routeModules:l}=Gx(),[i,o]=y.useState([]);return y.useEffect(()=>{let d=!1;return G4(n,r,l).then(m=>{d||o(m)}),()=>{d=!0}},[n,r,l]),i}function I4({page:n,matches:r,...l}){let i=Pa(),{future:o,manifest:d,routeModules:m}=Gx(),{basename:p}=Yx(),{loaderData:g,matches:h}=F4(),v=y.useMemo(()=>kg(n,r,h,d,i,"data"),[n,r,h,d,i]),b=y.useMemo(()=>kg(n,r,h,d,i,"assets"),[n,r,h,d,i]),_=y.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let C=new Set,z=!1;if(r.forEach(Q=>{let V=d.routes[Q.route.id];!V||!V.hasLoader||(!v.some(Y=>Y.route.id===Q.route.id)&&Q.route.id in g&&m[Q.route.id]?.shouldRevalidate||V.hasClientLoader?z=!0:C.add(Q.route.id))}),C.size===0)return[];let q=$4(n,p,o.unstable_trailingSlashAwareDataRequests,"data");return z&&C.size>0&&q.searchParams.set("_routes",r.filter(Q=>C.has(Q.route.id)).map(Q=>Q.route.id).join(",")),[q.pathname+q.search]},[p,o.unstable_trailingSlashAwareDataRequests,g,i,d,v,r,n,m]),j=y.useMemo(()=>V4(b,d),[b,d]),N=P4(b);return y.createElement(y.Fragment,null,_.map(C=>y.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...l})),j.map(C=>y.createElement("link",{key:C,rel:"modulepreload",href:C,...l})),N.map(({key:C,link:z})=>y.createElement("link",{key:C,nonce:l.nonce,...z,crossOrigin:z.crossOrigin??l.crossOrigin})))}function W4(...n){return r=>{n.forEach(l=>{typeof l=="function"?l(r):l!=null&&(l.current=r)})}}var e_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{e_&&(window.__reactRouterVersion="7.13.1")}catch{}function t_(n,r){return R1({basename:r?.basename,getContext:r?.getContext,future:r?.future,history:V0({window:r?.window}),hydrationData:a_(),routes:n,mapRouteProperties:j4,hydrationRouteProperties:N4,dataStrategy:r?.dataStrategy,patchRoutesOnNavigation:r?.patchRoutesOnNavigation,window:r?.window,unstable_instrumentations:r?.unstable_instrumentations}).initialize()}function a_(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:n_(n.errors)}),n}function n_(n){if(!n)return null;let r=Object.entries(n),l={};for(let[i,o]of r)if(o&&o.__type==="RouteErrorResponse")l[i]=new Yl(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let d=window[o.__subType];if(typeof d=="function")try{let m=new d(o.message);m.stack="",l[i]=m}catch{}}if(l[i]==null){let d=new Error(o.message);d.stack="",l[i]=d}}else l[i]=o;return l}var Vx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fa=y.forwardRef(function({onClick:r,discover:l="render",prefetch:i="none",relative:o,reloadDocument:d,replace:m,unstable_mask:p,state:g,target:h,to:v,preventScrollReset:b,viewTransition:_,unstable_defaultShouldRevalidate:j,...N},C){let{basename:z,navigator:q,unstable_useTransitions:Q}=y.useContext(Da),V=typeof v=="string"&&Vx.test(v),Y=vx(v,z);v=Y.to;let te=s4(v,{relative:o}),Z=Pa(),G=null;if(p){let ge=ql(p,[],Z.unstable_mask?Z.unstable_mask.pathname:"/",!0);z!=="/"&&(ge.pathname=ge.pathname==="/"?z:nn([z,ge.pathname])),G=q.createHref(ge)}let[E,H,W]=Z4(i,N),de=l_(v,{replace:m,unstable_mask:p,state:g,target:h,preventScrollReset:b,relative:o,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:Q});function le(ge){r&&r(ge),ge.defaultPrevented||de(ge)}let se=!(Y.isExternal||d),ce=y.createElement("a",{...N,...W,href:(se?G:void 0)||Y.absoluteURL||te,onClick:se?le:r,ref:W4(C,H),target:h,"data-discover":!V&&l==="render"?"true":void 0});return E&&!V?y.createElement(y.Fragment,null,ce,y.createElement(J4,{page:te})):ce});Fa.displayName="Link";var Ds=y.forwardRef(function({"aria-current":r="page",caseSensitive:l=!1,className:i="",end:o=!1,style:d,to:m,viewTransition:p,children:g,...h},v){let b=Xl(m,{relative:h.relative}),_=Pa(),j=y.useContext(Vl),{navigator:N,basename:C}=y.useContext(Da),z=j!=null&&d_(b)&&p===!0,q=N.encodeLocation?N.encodeLocation(b).pathname:b.pathname,Q=_.pathname,V=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;l||(Q=Q.toLowerCase(),V=V?V.toLowerCase():null,q=q.toLowerCase()),V&&C&&(V=Qa(V,C)||V);const Y=q!=="/"&&q.endsWith("/")?q.length-1:q.length;let te=Q===q||!o&&Q.startsWith(q)&&Q.charAt(Y)==="/",Z=V!=null&&(V===q||!o&&V.startsWith(q)&&V.charAt(q.length)==="/"),G={isActive:te,isPending:Z,isTransitioning:z},E=te?r:void 0,H;typeof i=="function"?H=i(G):H=[i,te?"active":null,Z?"pending":null,z?"transitioning":null].filter(Boolean).join(" ");let W=typeof d=="function"?d(G):d;return y.createElement(Fa,{...h,"aria-current":E,className:H,ref:v,style:W,to:m,viewTransition:p},typeof g=="function"?g(G):g)});Ds.displayName="NavLink";var r_=y.forwardRef(({discover:n="render",fetcherKey:r,navigate:l,reloadDocument:i,replace:o,state:d,method:m=go,action:p,onSubmit:g,relative:h,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_,...j},N)=>{let{unstable_useTransitions:C}=y.useContext(Da),z=c_(),q=u_(p,{relative:h}),Q=m.toLowerCase()==="get"?"get":"post",V=typeof p=="string"&&Vx.test(p),Y=te=>{if(g&&g(te),te.defaultPrevented)return;te.preventDefault();let Z=te.nativeEvent.submitter,G=Z?.getAttribute("formmethod")||m,E=()=>z(Z||te.currentTarget,{fetcherKey:r,method:G,navigate:l,replace:o,state:d,relative:h,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_});C&&l!==!1?y.startTransition(()=>E()):E()};return y.createElement("form",{ref:N,method:Q,action:q,onSubmit:i?g:Y,...j,"data-discover":!V&&n==="render"?"true":void 0})});r_.displayName="Form";function s_(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kx(n){let r=y.useContext(Ur);return qe(r,s_(n)),r}function l_(n,{target:r,replace:l,unstable_mask:i,state:o,preventScrollReset:d,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:h}={}){let v=_a(),b=Pa(),_=Xl(n,{relative:m});return y.useCallback(j=>{if(M4(j,r)){j.preventDefault();let N=l!==void 0?l:hn(b)===hn(_),C=()=>v(n,{replace:N,unstable_mask:i,state:o,preventScrollReset:d,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g});h?y.startTransition(()=>C()):C()}},[b,v,_,l,i,o,r,n,d,m,p,g,h])}function Co(n){Rt(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 r=y.useRef(gd(n)),l=y.useRef(!1),i=Pa(),o=y.useMemo(()=>L4(i.search,l.current?null:r.current),[i.search]),d=_a(),m=y.useCallback((p,g)=>{const h=gd(typeof p=="function"?p(new URLSearchParams(o)):p);l.current=!0,d("?"+h,g)},[d,o]);return[o,m]}var i_=0,o_=()=>`__${String(++i_)}__`;function c_(){let{router:n}=Kx("useSubmit"),{basename:r}=y.useContext(Da),l=y4(),i=n.fetch,o=n.navigate;return y.useCallback(async(d,m={})=>{let{action:p,method:g,encType:h,formData:v,body:b}=B4(d,r);if(m.navigate===!1){let _=m.fetcherKey||o_();await i(_,l,m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:b,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:b,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:l,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,o,r,l])}function u_(n,{relative:r}={}){let{basename:l}=y.useContext(Da),i=y.useContext(Ja);qe(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),d={...Xl(n||".",{relative:r})},m=Pa();if(n==null){d.search=m.search;let p=new URLSearchParams(d.search),g=p.getAll("index");if(g.some(v=>v==="")){p.delete("index"),g.filter(b=>b).forEach(b=>p.append("index",b));let v=p.toString();d.search=v?`?${v}`:""}}return(!n||n===".")&&o.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(d.pathname=d.pathname==="/"?l:nn([l,d.pathname])),hn(d)}function d_(n,{relative:r}={}){let l=y.useContext(kd);qe(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Kx("useViewTransitionState"),o=Xl(n,{relative:r});if(!l.isTransitioning)return!1;let d=Qa(l.currentLocation.pathname,i)||l.currentLocation.pathname,m=Qa(l.nextLocation.pathname,i)||l.nextLocation.pathname;return _o(o.pathname,m)!=null||_o(o.pathname,d)!=null}const f_="modulepreload",m_=function(n){return"/"+n},Tg={},Md=function(r,l,i){let o=Promise.resolve();if(l&&l.length>0){let g=function(h){return Promise.all(h.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=m?.nonce||m?.getAttribute("nonce");o=g(l.map(h=>{if(h=m_(h),h in Tg)return;Tg[h]=!0;const v=h.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const _=document.createElement("link");if(_.rel=v?"stylesheet":f_,v||(_.as="script"),_.crossOrigin="",_.href=h,p&&_.setAttribute("nonce",p),document.head.appendChild(_),v)return new Promise((j,N)=>{_.addEventListener("load",j),_.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${h}`)))})}))}function d(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return o.then(m=>{for(const p of m||[])p.status==="rejected"&&d(p.reason);return r().catch(d)})};const Xx=(...n)=>n.filter((r,l,i)=>!!r&&r.trim()!==""&&i.indexOf(r)===l).join(" ").trim();const h_=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const p_=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,l,i)=>i?i.toUpperCase():l.toLowerCase());const zg=n=>{const r=p_(n);return r.charAt(0).toUpperCase()+r.slice(1)};var g_={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 x_=n=>{for(const r in n)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};const y_=y.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:o="",children:d,iconNode:m,...p},g)=>y.createElement("svg",{ref:g,...g_,width:r,height:r,stroke:n,strokeWidth:i?Number(l)*24/Number(r):l,className:Xx("lucide",o),...!d&&!x_(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,v])=>y.createElement(h,v)),...Array.isArray(d)?d:[d]]));const Te=(n,r)=>{const l=y.forwardRef(({className:i,...o},d)=>y.createElement(y_,{ref:d,iconNode:r,className:Xx(`lucide-${h_(zg(n))}`,`lucide-${n}`,i),...o}));return l.displayName=zg(n),l};const b_=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Qx=Te("arrow-right",b_);const v_=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Og=Te("arrow-up-right",v_);const __=[["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"}]],S_=Te("boxes",__);const j_=[["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"}]],N_=Te("brain",j_);const w_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fr=Te("check",w_);const E_=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qt=Te("chevron-right",E_);const C_=[["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"}]],Fx=Te("circle-alert",C_);const R_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],k_=Te("circle",R_);const T_=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],z_=Te("cloud",T_);const O_=[["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"}]],xd=Te("copy",O_);const D_=[["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"}]],Zx=Te("database",D_);const A_=[["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"}]],M_=Te("file-spreadsheet",A_);const L_=[["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"}]],dr=Te("file-text",L_);const U_=[["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"}]],Jx=Te("file",U_);const H_=[["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"}]],B_=Te("files",H_);const $_=[["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"}]],Ro=Te("folder-git-2",$_);const q_=[["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"}]],Y_=Te("folder-input",q_);const G_=[["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"}]],V_=Te("folder-open",G_);const K_=[["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"}]],Px=Te("folder-plus",K_);const X_=[["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"}]],Xa=Te("folder",X_);const Q_=[["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"}]],yd=Te("git-branch",Q_);const F_=[["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"}]],Z_=Te("git-commit-horizontal",F_);const J_=[["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"}]],Dg=Te("github",J_);const P_=[["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"}]],I_=Te("globe",P_);const W_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],eS=Te("info",W_);const tS=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],aS=Te("key",tS);const nS=[["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"}]],rS=Te("laptop",nS);const sS=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],lS=Te("list-filter",sS);const iS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],va=Te("loader-circle",iS);const oS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],cS=Te("log-out",oS);const uS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],dS=Te("menu",uS);const fS=[["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"}]],mS=Te("monitor",fS);const hS=[["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"}]],pS=Te("moon",hS);const gS=[["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"}]],zs=Te("package",gS);const xS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],yS=Te("panel-left",xS);const bS=[["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"}]],bd=Te("pencil",bS);const vS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ld=Te("plus",vS);const _S=[["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"}]],SS=Te("refresh-cw",_S);const jS=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],NS=Te("rotate-cw",jS);const wS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vd=Te("search",wS);const ES=[["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"}]],CS=Te("settings",ES);const RS=[["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"}]],kS=Te("share-2",RS);const TS=[["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"}]],zS=Te("sparkles",TS);const OS=[["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"}]],DS=Te("sun",OS);const AS=[["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"}]],Ud=Te("trash-2",AS);const MS=[["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"}]],_d=Te("upload",MS);const LS=[["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"}]],US=Te("users",LS);const HS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hr=Te("x",HS),Ag=n=>Symbol.iterator in n,Mg=n=>"entries"in n,Lg=(n,r)=>{const l=n instanceof Map?n:new Map(n.entries()),i=r instanceof Map?r:new Map(r.entries());if(l.size!==i.size)return!1;for(const[o,d]of l)if(!i.has(o)||!Object.is(d,i.get(o)))return!1;return!0},BS=(n,r)=>{const l=n[Symbol.iterator](),i=r[Symbol.iterator]();let o=l.next(),d=i.next();for(;!o.done&&!d.done;){if(!Object.is(o.value,d.value))return!1;o=l.next(),d=i.next()}return!!o.done&&!!d.done};function $S(n,r){return Object.is(n,r)?!0:typeof n!="object"||n===null||typeof r!="object"||r===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(r)?!1:Ag(n)&&Ag(r)?Mg(n)&&Mg(r)?Lg(n,r):BS(n,r):Lg({entries:()=>Object.entries(n)},{entries:()=>Object.entries(r)})}function Br(n){const r=Rs.useRef(void 0);return l=>{const i=n(l);return $S(r.current,i)?r.current:r.current=i}}const Ug=n=>{let r;const l=new Set,i=(h,v)=>{const b=typeof h=="function"?h(r):h;if(!Object.is(b,r)){const _=r;r=v??(typeof b!="object"||b===null)?b:Object.assign({},r,b),l.forEach(j=>j(r,_))}},o=()=>r,p={setState:i,getState:o,getInitialState:()=>g,subscribe:h=>(l.add(h),()=>l.delete(h))},g=r=n(i,o,p);return p},qS=(n=>n?Ug(n):Ug),YS=n=>n;function GS(n,r=YS){const l=Rs.useSyncExternalStore(n.subscribe,Rs.useCallback(()=>r(n.getState()),[n,r]),Rs.useCallback(()=>r(n.getInitialState()),[n,r]));return Rs.useDebugValue(l),l}const Hg=n=>{const r=qS(n),l=i=>GS(r,i);return Object.assign(l,r),l},Ql=(n=>n?Hg(n):Hg),Tl="c4a_token";function Bg(n){try{const r=n.split(".");if(r.length!==3)return null;const l=r[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(l))}catch{return null}}function $g(n){const r=n.userId,l=n.name,i=n.email,o=n.avatar_url,d=n.workspaceId;if(!r||!i||!d)return null;const m={id:r,name:l??i,email:i,personal_workspace_id:d};return o&&(m.avatar_url=o),m}function qg(n){const r=n.exp;return r?Date.now()>=r*1e3:!1}const Za=Ql(n=>({token:null,user:null,isAuthenticated:!1,init:()=>{const r=localStorage.getItem(Tl);if(!r){n({token:null,user:null,isAuthenticated:!1});return}const l=Bg(r);if(!l||qg(l)){localStorage.removeItem(Tl),n({token:null,user:null,isAuthenticated:!1});return}const i=$g(l);if(!i){localStorage.removeItem(Tl),n({token:null,user:null,isAuthenticated:!1});return}n({token:r,user:i,isAuthenticated:!0})},login:r=>{const l=Bg(r);if(!l||qg(l))return;const i=$g(l);i&&(localStorage.setItem(Tl,r),n({token:r,user:i,isAuthenticated:!0}))},logout:()=>{localStorage.removeItem(Tl),n({token:null,user:null,isAuthenticated:!1})}})),Ix="/api/v1";class Ar extends Error{constructor(r,l,i){super(i),this.status=r,this.code=l,this.name="ApiError"}}async function co(n,r,l,i,o){let d=`${Ix}${r}`;if(i){const v=new URLSearchParams(i).toString();v&&(d+=`?${v}`)}const m={"Content-Type":"application/json"},p=Za.getState().token;p&&(m.Authorization=`Bearer ${p}`);const g={method:n,headers:m};l!==void 0&&(g.body=JSON.stringify(l)),o?.signal&&(g.signal=o.signal);const h=await fetch(d,g);if(!h.ok){let v="UNKNOWN",b=h.statusText;try{const _=await h.json();_.code&&(v=_.code),_.message&&(b=_.message)}catch{}throw h.status===401&&Za.getState().logout(),new Ar(h.status,v,b)}return h.json()}const td=new Map;function VS(n,r){let l=`${Ix}${n}`;if(r){const i=new URLSearchParams(r).toString();i&&(l+=`?${i}`)}return l}const lt={get(n,r,l){const i=VS(n,r),o=td.get(i);if(o)return o;const d=co("GET",n,void 0,r,l).finally(()=>{td.delete(i)});return td.set(i,d),d},post(n,r,l){return co("POST",n,r,void 0,l)},put(n,r){return co("PUT",n,r)},delete(n){return co("DELETE",n)}},KS=3e4,XS=1e3,QS=3e4;class FS{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(r){this._status=r;for(const l of this.statusHandlers)l(r)}onStatusChange(r){return this.statusHandlers.add(r),()=>{this.statusHandlers.delete(r)}}connect(r){this.url=r,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(r,l){let i=this.handlers.get(r);return i||(i=new Set,this.handlers.set(r,i)),i.add(l),()=>{i.delete(l),i.size===0&&this.handlers.delete(r)}}send(r,l){if(this.ws?.readyState!==WebSocket.OPEN)return;const i={event:r,payload:l,timestamp:Date.now()};this.ws.send(JSON.stringify(i))}open(){this.setStatus("connecting");const r=new WebSocket(this.url);r.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},r.onmessage=l=>{try{const i=JSON.parse(String(l.data));if(i.event==="pong")return;const o=this.handlers.get(i.event);if(o)for(const d of o)d(i.payload)}catch{}},r.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},r.onerror=()=>{},this.ws=r}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},KS)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const r=Math.min(XS*2**this.reconnectAttempt,QS);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},r)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const rn=new FS,$t=Ql((n,r)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const l=await lt.get("/libraries");n({libraries:l,loading:!1})}catch(l){n({error:l instanceof Error?l.message:"Failed to load libraries",loading:!1})}},createLibrary:async l=>{const i=await lt.post("/libraries",l);return n(o=>({libraries:[...o.libraries,i]})),i},deleteLibrary:async l=>{await lt.delete(`/libraries/${l}`),n(i=>({libraries:i.libraries.filter(o=>o.id!==l)}))},updateLibraryName:async(l,i)=>{const o=await lt.put(`/libraries/${l}`,{name:i});n(d=>({libraries:d.libraries.map(m=>m.id===l?o:m)}))},_updateLibraryOnline:(l,i)=>{n(o=>({libraries:o.libraries.map(d=>d.id===l?{...d,is_online:i}:d)}))},_refreshLibrary:async l=>{try{const i=await lt.get(`/libraries/${l}`);n(o=>({libraries:o.libraries.map(d=>d.id===l?i:d)}))}catch{r().fetchLibraries()}}})),Ms=n=>{const r=n.libraries.filter(i=>i.type==="cloud").sort((i,o)=>i.created_at.localeCompare(o.created_at)),l=n.libraries.filter(i=>i.type==="daemon").sort((i,o)=>i.name.localeCompare(o.name));return[...r,...l]},ZS=n=>n.libraries.filter(r=>r.type==="daemon");rn.on("ws:daemon:status",n=>{const r=n;r.lib_id&&$t.getState()._updateLibraryOnline(r.lib_id,r.is_online),$t.getState().fetchLibraries()});rn.on("ws:daemon:connected",n=>{const r=n;r.lib_id&&$t.getState()._updateLibraryOnline(r.lib_id,!0),$t.getState().fetchLibraries()});rn.on("ws:library:updated",n=>{const r=n;$t.getState()._refreshLibrary(r.library_id)});function JS({name:n,avatarUrl:r,size:l=24}){const[i,o]=y.useState(!1),d=n.charAt(0).toUpperCase();return r&&!i?u.jsx("img",{src:r,alt:"",className:"rounded-full object-cover",style:{width:l,height:l},onError:()=>o(!0)}):u.jsx("span",{className:"inline-flex items-center justify-center rounded-full bg-c4a-accent font-mono font-bold text-white",style:{width:l,height:l,fontSize:l*.48},children:d})}function PS(){const{t:n}=Ne(),r=_a(),l=Za(_=>_.user),i=Za(_=>_.logout),[o,d]=y.useState(!1),m=y.useRef(null),p=$t(Br(ZS)),g=p.some(_=>_.is_online),h=y.useCallback(()=>{i(),d(!1),r("/login",{replace:!0})},[i,r]),v=()=>{m.current&&clearTimeout(m.current),d(!0)},b=()=>{m.current=setTimeout(()=>d(!1),150)};return l?u.jsxs("div",{className:"relative",onMouseEnter:v,onMouseLeave:b,children:[u.jsxs("button",{className:"relative flex cursor-pointer items-center gap-1",children:[u.jsx(JS,{name:l.name,avatarUrl:l.avatar_url,size:30}),u.jsx("span",{className:`absolute right-0 top-0 h-2 w-2 rounded-full ${g?"bg-c4a-success":"bg-c4a-text-muted"}`})]}),o&&u.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 min-w-[180px] rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md",children:[u.jsxs("div",{className:"px-4 py-3",children:[u.jsx("p",{className:"text-sm text-c4a-text-primary",children:l.name}),u.jsx("p",{className:"text-xs text-c4a-text-muted",children:l.email})]}),u.jsx("div",{className:"border-t border-c4a-border-subtle",children:p.length===0?u.jsxs("button",{onClick:()=>{d(!1),r("/studio/sources/add-client")},className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:u.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-c4a-text-muted"})}),n("user.menu.connect_source")]}):p.map(_=>u.jsxs("button",{onClick:()=>{d(!1),r(`/studio/sources/${_.id}`)},className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:u.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${_.is_online?"bg-c4a-success":"bg-c4a-error"}`})}),_.name]},_.id))}),u.jsx("div",{className:"border-t border-c4a-border-subtle",children:u.jsxs("button",{onClick:h,className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx(cS,{size:12,className:"shrink-0"}),n("user.menu.sign_out")]})})]})]}):null}function Sd({onLoginClick:n}){const{t:r}=Ne();return Za(i=>i.isAuthenticated)?u.jsx(PS,{}):u.jsx(Fa,{to:"/login",onClick:n,className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:r("nav.login")})}const Yg=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function IS(){const{t:n}=Ne(),[r,l]=y.useState(!1);return u.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[u.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[u.jsxs(Fa,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),u.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),u.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[u.jsx("nav",{className:"flex items-center gap-4",children:Yg.map(({to:i,labelKey:o})=>u.jsx(Ds,{to:i,end:i==="/",className:({isActive:d})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),u.jsx(Sd,{})]}),u.jsx("button",{onClick:()=>l(!r),className:"text-c4a-text-secondary md:hidden",children:r?u.jsx(Hr,{size:20}):u.jsx(dS,{size:20})})]}),r&&u.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[u.jsx("nav",{className:"flex flex-col gap-2",children:Yg.map(({to:i,labelKey:o})=>u.jsx(Ds,{to:i,end:i==="/",onClick:()=>l(!1),className:({isActive:d})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),u.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:u.jsx(Sd,{onLoginClick:()=>l(!1)})})]})]})}function WS(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function Wx(n){if(typeof window>"u")return;const r=WS(n);document.documentElement.setAttribute("data-theme",r),localStorage.setItem("theme",n)}function e2(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const ey=Ql(n=>({theme:e2(),setTheme:r=>{Wx(r),n({theme:r})}}));let Gg=!1;function t2(){if(Gg||typeof window>"u")return;Gg=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{const{theme:l}=ey.getState();l==="system"&&Wx("system")};n.addEventListener("change",r)}t2();const a2=[{mode:"light",icon:DS,labelKey:"footer.theme.light"},{mode:"dark",icon:pS,labelKey:"footer.theme.dark"},{mode:"system",icon:mS,labelKey:"footer.theme.system"}];function ty(){const{t:n}=Ne(),{theme:r,setTheme:l}=ey();return u.jsx("div",{className:"flex items-center gap-1",children:a2.map(({mode:i,icon:o,labelKey:d})=>u.jsx("button",{onClick:()=>l(i),title:n(d),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${r===i?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:u.jsx(o,{size:14})},i))})}function ay(){const{i18n:n}=Ne(),r=()=>{const l=n.language==="en"?"zh":"en";n.changeLanguage(l)};return u.jsx("button",{onClick:r,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 ny({compact:n}){const{t:r}=Ne(),l=new Date().getFullYear(),i=n?"footer.copyright_compact":"footer.copyright";return u.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:r(i,{year:l})})}const n2="_brandIcon_1c7st_1",r2="_iconPulse_1c7st_35",Vg={brandIcon:n2,iconPulse:r2};function s2({variant:n}){const{t:r}=Ne(),l=n==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return u.jsx("footer",{className:`border-t border-c4a-border-subtle ${l} px-4 py-4`,children:u.jsxs("div",{className:"flex items-end justify-between gap-4",children:[u.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[u.jsx("div",{className:Vg.brandIcon,children:u.jsx("span",{className:Vg.iconPulse,children:"C4A"})}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),u.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:r("footer.tagline")})]})]}),u.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ty,{}),u.jsx(ay,{})]}),u.jsx(ny,{})]})]})})}function l2(){return u.jsxs("div",{className:"flex min-h-screen flex-col",children:[u.jsx(IS,{}),u.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:u.jsx(qx,{})}),u.jsx(s2,{})]})}function i2({onToggleSidebar:n}){return u.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:u.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[n&&u.jsx("button",{onClick:n,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:u.jsx(yS,{size:20})}),u.jsxs(Fa,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),u.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),u.jsx(Fa,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),u.jsx(Sd,{})]})})}const o2=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"}`,c2=[{to:"/studio/modeling",icon:S_,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:N_,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:vd,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:kS,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:US,i18nKey:"studio.sidebar.collaboration"}],u2=[{to:"/studio/settings/api-keys",i18nKey:"settings.tab.api_keys",icon:aS}],d2=["My Drive","个人云","我的云盘"];function f2({onNavigate:n}){const{t:r}=Ne(),i=Pa().pathname.startsWith("/studio/settings"),[o,d]=y.useState(i);return y.useEffect(()=>{i&&d(!0)},[i]),u.jsxs("div",{children:[u.jsxs("button",{onClick:()=>d(m=>!m),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 ${i?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[u.jsx(CS,{size:14}),r("studio.sidebar.settings"),u.jsx(Qt,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${o?"rotate-90":""}`})]}),o&&u.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:u2.map(({to:m,i18nKey:p,icon:g})=>u.jsxs(Ds,{to:m,onClick:n,className:({isActive:h})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${h?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[u.jsx(g,{size:13,className:"shrink-0 opacity-60"}),r(p)]},m))})]})}function Kg({onNavigate:n}){const{t:r}=Ne(),l=Pa(),i=_a(),o=$t(Br(Ms)),d=l.pathname.startsWith("/studio/sources")||l.pathname.startsWith("/studio/source/"),[m,p]=y.useState(d);y.useEffect(()=>{d&&p(!0)},[d]);const g=h=>h.is_default&&d2.includes(h.name)?r("sources.library.default_cloud_name"):h.name;return u.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:[u.jsxs("nav",{className:"flex flex-col gap-1",children:[u.jsxs("div",{className:"group/sources",children:[u.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 ${d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[u.jsx(Zx,{size:14}),r("studio.sidebar.sources"),u.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:r("sources.menu.add_client"),children:u.jsx(Ld,{size:12})}),u.jsx(Qt,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&u.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(h=>{const v=g(h);return u.jsxs(Ds,{to:`/studio/sources/${h.id}`,onClick:n,className:({isActive:b})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${b?"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"?u.jsx(z_,{size:13,className:"shrink-0 opacity-60"}):u.jsx(rS,{size:13,className:"shrink-0 opacity-60"}),u.jsx("span",{className:"truncate",children:v}),h.type==="daemon"&&(()=>{const b=h.config?.machine_id;return u.jsxs("span",{role:"button",tabIndex:0,onClick:_=>{_.preventDefault(),_.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),_.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[u.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`}),u.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 z-50 ml-2 hidden -translate-y-1/2 whitespace-nowrap 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/dot:block",children:h.is_online?r("sources.menu.status_online",{machine:b??""}):r("sources.menu.status_offline",{machine:b??""})})]})})()]},h.id)})})]}),c2.map(({to:h,icon:v,i18nKey:b})=>u.jsxs(Ds,{to:h,onClick:n,className:({isActive:_})=>o2(_),children:[u.jsx(v,{size:14}),r(b)]},h)),u.jsx(f2,{...n?{onNavigate:n}:{}})]}),u.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(ty,{}),u.jsx(ay,{})]}),u.jsx(ny,{compact:!0})]})]})}const $l=Ql(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:r=>n({status:r}),fetchDaemonStatus:async()=>{try{const r=await lt.get("/daemons/status");n({onlineCount:r.online_count,connections:r.connections})}catch{}}})),m2=n=>n==="connecting"?"disconnected":n;rn.onStatusChange(n=>{$l.getState().setStatus(m2(n))});rn.on("ws:daemon:connected",n=>{const r=n;$l.setState(l=>{if(l.connections.some(m=>m.machine_id===r.machine_id))return l;const o={machine_id:r.machine_id};r.lib_id&&(o.lib_id=r.lib_id);const d=[...l.connections,o];return{connections:d,onlineCount:d.length}})});rn.on("ws:daemon:status",n=>{const r=n;$l.setState(l=>{if(r.is_online){if(l.connections.some(p=>p.machine_id===r.machine_id))return l;const d={machine_id:r.machine_id};r.lib_id&&(d.lib_id=r.lib_id);const m=[...l.connections,d];return{connections:m,onlineCount:m.length}}const i=l.connections.filter(o=>o.machine_id!==r.machine_id);return{connections:i,onlineCount:i.length}})});function h2(){const n=_a(),[r,l]=y.useState(!1),i=Za(m=>m.isAuthenticated),[o,d]=y.useState(!1);return y.useEffect(()=>{const m=Za.getState();m.isAuthenticated||m.init(),d(!0)},[]),y.useEffect(()=>{o&&!i&&n("/login",{replace:!0})},[o,i,n]),y.useEffect(()=>{!o||!i||($t.getState().fetchLibraries(),$l.getState().fetchDaemonStatus())},[o,i]),y.useEffect(()=>{if(!(!o||!i))return rn.onStatusChange(m=>{m==="connected"&&($t.getState().fetchLibraries(),$l.getState().fetchDaemonStatus())})},[o,i]),!o||!i?null:u.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[u.jsx(i2,{onToggleSidebar:()=>l(!r)}),u.jsxs("div",{className:"flex min-h-0 flex-1",children:[u.jsx("div",{className:"hidden md:block",children:u.jsx(Kg,{})}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>l(!1)}),u.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:u.jsx(Kg,{onNavigate:()=>l(!1)})})]}),u.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:u.jsx(qx,{})})]})]})}function p2(){const{t:n}=Ne();return u.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[u.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:n("home.hero.title")}),u.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:n("home.hero.description")}),u.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[u.jsxs(Fa,{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"),u.jsx(Qx,{size:14})]}),u.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")})]})]})}const g2=new Set(["github","google","feishu"]),x2=new Set(["oidc","oauth2"]);function y2(){const{t:n}=Ne(),r=_a(),l=Za(Y=>Y.login),i=Za(Y=>Y.isAuthenticated),[o,d]=y.useState([]),[m,p]=y.useState(!0),[g,h]=y.useState(null),[v,b]=y.useState(!1);y.useEffect(()=>{i&&r("/studio",{replace:!0})},[i,r]);const _=y.useCallback(async()=>{p(!0),h(null);try{const Y=await lt.get("/auth/providers");d(Y)}catch{h(n("login.error"))}finally{p(!1)}},[n]);y.useEffect(()=>{_()},[_]);const j=Y=>{window.location.href=`/api/v1/auth/${Y}/login`},N=async()=>{b(!0);try{const Y=await lt.post("/auth/test-account/login");l(Y.token),r("/studio",{replace:!0})}catch{b(!1),h(n("login.error"))}},C=o.filter(Y=>g2.has(Y.type)),z=o.filter(Y=>x2.has(Y.type)),q=o.find(Y=>Y.type==="test_account"),Q=C.length>0||z.length>0,V=(C.length>0?1:0)+(z.length>0?1:0)+(q?1:0)>1;return u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 py-12",children:u.jsxs("div",{className:"w-full max-w-sm rounded border border-c4a-border-subtle bg-c4a-bg-surface px-8 pt-8 pb-10",children:[(m||v)&&u.jsxs("div",{className:"flex flex-col items-center gap-6",children:[u.jsx("h2",{className:"font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:n(v?"login.authenticating":"login.loading")}),u.jsx("div",{className:"h-0.5 w-16 animate-pulse rounded bg-c4a-accent/40"})]}),!m&&!v&&g&&u.jsxs("div",{className:"flex flex-col items-center gap-4",children:[u.jsx("p",{className:"text-xs text-c4a-error",children:g}),u.jsx("button",{onClick:_,className:"cursor-pointer rounded border border-c4a-border-default px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("login.retry")})]}),!m&&!v&&!g&&u.jsxs("div",{className:"flex flex-col gap-6",children:[u.jsx("h2",{className:"text-center font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:n("login.title")}),u.jsxs("div",{className:"flex flex-col gap-2",children:[C.map(Y=>u.jsx(Xg,{provider:Y,onClick:()=>j(Y.id),label:n("login.provider_cta",{name:Y.display_name})},Y.id)),C.length>0&&z.length>0&&u.jsx(Qg,{label:n("login.or")}),z.map(Y=>u.jsx(Xg,{provider:Y,onClick:()=>j(Y.id),label:n("login.provider_cta",{name:Y.display_name})},Y.id)),Q&&q&&V&&u.jsx(Qg,{label:n("login.or")}),q&&u.jsxs("button",{onClick:N,className:"flex h-11 w-full cursor-pointer items-center justify-center gap-3 rounded bg-c4a-accent/75 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent",children:[q.icon&&u.jsx("img",{src:q.icon,alt:"",className:"h-5 w-5"}),n("login.provider_cta",{name:n("login.test_account")})]})]})]})]})})}function Xg({provider:n,onClick:r,label:l}){return u.jsxs("button",{onClick:r,className:"flex h-11 w-full cursor-pointer items-center justify-center gap-3 rounded bg-c4a-bg-hover font-mono text-xs uppercase tracking-tight text-c4a-text-primary transition-colors hover:bg-c4a-bg-active",children:[n.icon&&u.jsx("img",{src:n.icon,alt:"",className:"h-5 w-5"}),l]})}function Qg({label:n}){return u.jsxs("div",{className:"flex items-center gap-3 py-1",children:[u.jsx("div",{className:"h-px flex-1 bg-c4a-border-subtle"}),u.jsx("span",{className:"font-mono text-[10px] uppercase text-c4a-text-muted",children:n}),u.jsx("div",{className:"h-px flex-1 bg-c4a-border-subtle"})]})}const b2="animate-pulse font-mono text-xs uppercase tracking-tight text-c4a-text-muted";function Hd({labelKey:n="login.loading",className:r}){const{t:l}=Ne();return u.jsx("span",{className:r??b2,children:l(n)})}function v2(){const n=_a(),r=Za(l=>l.login);return y.useEffect(()=>{const i=new URLSearchParams(window.location.search).get("token");if(i){r(i);const o=Za.getState().isAuthenticated;n(o?"/studio":"/login",{replace:!0})}else n("/login",{replace:!0})},[r,n]),u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(Hd,{labelKey:"login.authenticating",className:"animate-pulse font-mono text-sm uppercase tracking-tight text-c4a-text-muted"})})}function ko({icon:n,title:r,description:l,action:i,fullPage:o}){const d=u.jsxs("div",{className:o?"w-full max-w-[800px] text-center":"flex flex-col items-center justify-center py-12",children:[n&&u.jsx("div",{className:"mb-3 text-c4a-text-muted",children:n}),o?u.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:r}):u.jsx("p",{className:"font-mono text-sm text-c4a-text-secondary",children:r}),u.jsx("p",{className:`mt-2 text-center ${o?"mt-3 text-sm text-c4a-text-secondary":"max-w-md text-xs text-c4a-text-muted"}`,children:l}),i&&u.jsx("div",{className:o?"mt-6 flex justify-center":"mt-4",children:i})]});return o?u.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:d}):d}function pn({title:n,version:r,description:l}){const{t:i}=Ne();return u.jsx(ko,{fullPage:!0,title:n,description:l,action:r?u.jsx("span",{className:"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:r})}):void 0})}function _2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function S2(){const{t:n}=Ne();return u.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[u.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n("notfound.title")}),u.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:n("notfound.description")}),u.jsx(Fa,{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 Fg(){const{t:n}=Ne(),r=Bx();let l="500",i=n("error.description");return Os(r)?(l=String(r.status),r.status===404?i=n("notfound.description"):r.statusText&&(i=r.statusText)):r instanceof Error&&(i=r.message),console.error(`[ErrorPage] ${l}:`,r),u.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[u.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:l}),u.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:i}),u.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[u.jsxs("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[u.jsx(NS,{size:14}),n("error.reload")]}),u.jsx(Fa,{to:"/",className:"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 j2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function N2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function w2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function E2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function C2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}function Ln({children:n,onClose:r,className:l="",overlayClass:i="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:d=!0,disableClose:m=!1}){const p=y.useRef(null);y.useEffect(()=>{if(!d)return;const h=v=>{v.key==="Escape"&&!m&&r()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[r,d,m]);const g=y.useCallback(h=>{o&&!m&&p.current&&!p.current.contains(h.target)&&r()},[r,o,m]);return u.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${i}`,onClick:g,children:u.jsx("div",{ref:p,className:l,children:n})})}function R2(){const{t:n}=Ne(),[r,l]=y.useState([]),[i,o]=y.useState(!0),[d,m]=y.useState(!1),[p,g]=y.useState(null),h=[{label:n("page.settings.title")},{label:n("settings.tab.api_keys")}],v=y.useCallback(async()=>{o(!0);try{const j=await lt.get("/auth/api-keys");l(j)}catch{}finally{o(!1)}},[]);y.useEffect(()=>{v()},[v]);const b=j=>{m(!1),g(j),v()},_=async j=>{if(confirm(n("api_keys.delete.confirm")))try{await lt.delete(`/auth/api-keys/${j}`),v()}catch{}};return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:h.map((j,N)=>{const C=N===h.length-1;return u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[N>0&&u.jsx(Qt,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:C?"text-c4a-text-primary":"",children:j.label})]},N)})}),i&&u.jsx("div",{className:"flex flex-1 items-center justify-center pb-24",children:u.jsx(Hd,{})}),!i&&r.length===0&&u.jsx(ko,{fullPage:!0,title:n("api_keys.empty.title"),description:n("api_keys.empty.description"),action:u.jsx("button",{onClick:()=>m(!0),className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent",children:n("api_keys.create")})}),!i&&r.length>0&&u.jsxs("div",{className:"mt-4",children:[u.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[u.jsx("p",{className:"text-xs text-c4a-text-muted",children:n("api_keys.description")}),u.jsxs("button",{onClick:()=>m(!0),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[u.jsx(Ld,{size:14}),n("api_keys.create")]})]}),u.jsx("div",{className:"flex flex-col gap-3",children:r.map(j=>u.jsx(k2,{apiKey:j,onDelete:()=>_(j.id)},j.id))})]}),d&&u.jsx(T2,{onClose:()=>m(!1),onCreated:b}),p&&u.jsx(z2,{apiKey:p,onClose:()=>g(null)})]})}function k2({apiKey:n,onDelete:r}){const{t:l}=Ne(),i=n.last_used_at?new Date(n.last_used_at).toLocaleDateString():l("api_keys.never_used"),o=new Date(n.created_at).toLocaleDateString();return u.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-mono text-sm text-c4a-text-primary",children:n.name}),u.jsxs("p",{className:"mt-1 text-xs text-c4a-text-muted",children:[u.jsxs("span",{className:"font-mono",children:[n.key_prefix,"****"]}),u.jsx("span",{className:"mx-2",children:"·"}),i]}),u.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:l("api_keys.created_at",{date:o})})]}),u.jsx("button",{onClick:r,className:"cursor-pointer p-1 text-c4a-text-muted transition-colors hover:text-c4a-error",title:"Delete",children:u.jsx(Ud,{size:14})})]})})}function T2({onClose:n,onCreated:r}){const{t:l}=Ne(),[i,o]=y.useState(""),[d,m]=y.useState("never"),[p,g]=y.useState(!1),h=y.useRef(null),[v,b]=y.useState(!1),_=[{value:"never",label:l("api_keys.expires.never")},{value:"30d",label:l("api_keys.expires.30d")},{value:"90d",label:l("api_keys.expires.90d")},{value:"1y",label:l("api_keys.expires.1y")}],j=_.find(C=>C.value===d);y.useEffect(()=>{if(!p)return;const C=z=>{h.current&&!h.current.contains(z.target)&&g(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[p]);const N=async()=>{if(i.trim()){b(!0);try{const C=O2(d),z=await lt.post("/auth/api-keys",{name:i.trim(),scope:["read"],expires_at:C});r(z)}catch{b(!1)}}};return u.jsxs(Ln,{onClose:n,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",children:[u.jsx("h2",{className:"mb-6 font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:l("api_keys.create")}),u.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:l("api_keys.form.name")}),u.jsx("input",{value:i,onChange:C=>o(C.target.value),placeholder:l("api_keys.form.name_placeholder"),className:"mb-4 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none"}),u.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:l("api_keys.form.expiry")}),u.jsxs("div",{ref:h,className:"relative mb-6",children:[u.jsxs("button",{type:"button",onClick:()=>g(C=>!C),className:"flex w-full cursor-pointer items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary transition-colors hover:border-c4a-border-strong",children:[u.jsx("span",{children:j?.label}),u.jsx(Qt,{size:14,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${p?"rotate-90":""}`})]}),p&&u.jsx("div",{className:"absolute left-0 top-full z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:_.map(C=>u.jsxs("button",{type:"button",onClick:()=>{m(C.value),g(!1)},className:`flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors hover:bg-c4a-bg-hover ${C.value===d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[u.jsx(fr,{size:12,className:`shrink-0 ${C.value===d?"opacity-100":"opacity-0"}`}),C.label]},C.value))})]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.jsx("button",{onClick:n,disabled:v,className:"cursor-pointer rounded border border-c4a-border-default px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:l("common.cancel")}),u.jsx("button",{onClick:N,disabled:!i.trim()||v,className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent disabled:opacity-50",children:l("api_keys.create")})]})]})}function z2({apiKey:n,onClose:r}){const{t:l}=Ne(),[i,o]=y.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(n.key),o(!0),setTimeout(()=>o(!1),2e3)}catch{const m=document.querySelector("[data-api-key-value]");if(m){const p=document.createRange();p.selectNodeContents(m);const g=window.getSelection();g?.removeAllRanges(),g?.addRange(p)}}};return u.jsxs(Ln,{onClose:r,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",closeOnOverlay:!1,closeOnEsc:!1,children:[u.jsx("h2",{className:"mb-4 font-mono text-sm uppercase tracking-tight text-c4a-accent",children:l("api_keys.created")}),u.jsx("p",{className:"mb-4 text-sm text-c4a-text-secondary",children:l("api_keys.copy_warning")}),u.jsxs("div",{className:"mb-6 flex items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-base px-3 py-2",children:[u.jsx("code",{"data-api-key-value":!0,className:"flex-1 truncate font-mono text-xs text-c4a-text-primary",children:n.key}),u.jsx("button",{onClick:d,className:"cursor-pointer shrink-0 font-mono text-xs uppercase text-c4a-accent transition-colors hover:text-c4a-accent/80",children:l(i?"api_keys.copied":"api_keys.copy")})]}),u.jsx("div",{className:"flex justify-end",children:u.jsx("button",{onClick:r,className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent",children:l("api_keys.done")})})]})}function O2(n){if(n==="never")return null;const r=new Date;switch(n){case"30d":r.setDate(r.getDate()+30);break;case"90d":r.setDate(r.getDate()+90);break;case"1y":r.setFullYear(r.getFullYear()+1);break;default:return null}return r.toISOString()}function D2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function A2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function M2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function L2(){const{t:n}=Ne();return u.jsx(pn,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const To=(n,r)=>{for(const l of n){if(l.path===r)return l;if(l.children){const i=To(l.children,r);if(i)return i}}return null},U2=(n,r)=>r===""?n:To(n,r)?.children??[],Dl=(n,r)=>{if(!r)return[];const l=r.split("/"),i=[];let o="";for(const d of l){o=o?`${o}/${d}`:d;const m=To(n,o);m&&i.push(m)}return i},zo=Ql(n=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:r,limit:l,offset:i})=>{n({loading:!0,error:null});try{const o={library_id:r};l!==void 0&&(o.limit=String(l)),i!==void 0&&(o.offset=String(i));const d=await lt.get("/sources",o);n({rootSources:d.items,total:d.total,limit:d.limit,offset:d.offset,loading:!1})}catch(o){n({error:o instanceof Error?o.message:"Failed to load sources",loading:!1})}},fetchRootSource:async r=>{const l=await lt.get(`/sources/${r}`);return n({currentRoot:l}),l},createSource:async r=>await lt.post("/sources",r),addTreeNode:async(r,l)=>{const i=await lt.post(`/sources/${r}/tree`,l);return n(o=>({rootSources:o.rootSources.map(d=>d.id===r?i:d),currentRoot:o.currentRoot?.id===r?i:o.currentRoot})),i},updateSource:async(r,l)=>{const i=await lt.put(`/sources/${r}`,l);n(o=>({rootSources:o.rootSources.map(d=>d.id===r?i:d),currentRoot:o.currentRoot?.id===r?i:o.currentRoot}))},deleteSource:async r=>{await lt.delete(`/sources/${r}`),n(l=>({rootSources:l.rootSources.filter(i=>i.id!==r),currentRoot:l.currentRoot?.id===r?null:l.currentRoot}))},deleteTreeNode:async(r,l)=>{const i=await lt.delete(`/sources/${r}/tree?path=${encodeURIComponent(l)}`);return n(o=>({rootSources:o.rootSources.map(d=>d.id===r?i:d),currentRoot:o.currentRoot?.id===r?i:o.currentRoot})),i},uploadDoc:async r=>await lt.post("/sources/upload",r),setFilter:r=>n({filter:r}),clearSources:()=>n({rootSources:[],currentRoot:null,total:0,offset:0})}));function Ls({segments:n}){const{t:r}=Ne(),l=y.useRef(null),i=y.useRef(null),[o,d]=y.useState(0),m=[{label:r("sources.breadcrumb.sources")},...n],p=Math.max(0,m.length-3);y.useEffect(()=>{const h=l.current,v=i.current;if(!h||!v)return;const b=()=>{const j=h.clientWidth,N=Array.from(v.children);if(N.length===0)return;const C=N.map(G=>G.offsetWidth),z=4;if(C.reduce((G,E)=>G+E,0)+z*(C.length-1)<=j){d(0);return}const Q=20,V=(C[0]??0)+(C[1]??0)+z,Y=C[C.length-1]??0,te=V+z+Q+z+Y;let Z=p;for(let G=1;G<=p;G++){let E=0;for(let H=2+G;H<C.length-1;H++)E+=C[H]+z;if(te+E<=j){Z=G;break}}d(Z)};b();const _=new ResizeObserver(b);return _.observe(h),()=>_.disconnect()},[p,n,r]);const g=(()=>{if(o===0||m.length<=3)return m;const h=m.slice(0,2),v=m[m.length-1],b=m.slice(2+o,m.length-1);return[...h,{label:"…"},...b,v]})();return u.jsxs("div",{ref:l,className:"relative min-w-0 overflow-hidden",children:[u.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs tracking-tight text-c4a-text-muted",children:g.map((h,v)=>{const b=v===g.length-1;return u.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${v===0?"uppercase":""}`,children:[v>0&&u.jsx(Qt,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!b?u.jsx(Fa,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):u.jsx("span",{className:`whitespace-nowrap ${b?"text-c4a-text-primary":""}`,children:h.label})]},v)})}),u.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 tracking-tight",children:m.map((h,v)=>u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&u.jsx(Qt,{size:12}),u.jsx("span",{className:"whitespace-nowrap",children:h.label})]},v))})]})}const H2=["all","indexed","not_indexed"];function B2({value:n,onChange:r}){const{t:l}=Ne(),[i,o]=y.useState(!1),d=y.useRef(null),m=y.useRef(null),p={all:l("sources.filter.all"),indexed:l("sources.filter.indexed"),not_indexed:l("sources.filter.not_indexed")},g=y.useCallback(b=>{d.current&&!d.current.contains(b.target)&&o(!1)},[]);y.useEffect(()=>{if(i)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i,g]);const h=y.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),o(!0)},[]),v=y.useCallback(()=>{m.current=setTimeout(()=>o(!1),150)},[]);return u.jsxs("div",{ref:d,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[u.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:[u.jsx(lS,{size:12}),u.jsx("span",{className:"hidden sm:inline",children:p[n]}),u.jsx(Qt,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&u.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:H2.map(b=>u.jsxs("button",{onClick:()=>{r(b),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 ${b===n?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx(fr,{size:12,className:b===n?"opacity-100":"opacity-0"}),p[b]]},b))})]})}function ry({currentName:n,onConfirm:r,onCancel:l,error:i}){const[o,d]=y.useState(n),m=y.useRef(null);y.useEffect(()=>{m.current?.select()},[]);const p=y.useCallback(()=>{const h=o.trim();h&&h!==n?r(h):l()},[o,n,r,l]),g=y.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),p()):h.key==="Escape"&&l()},[p,l]);return u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("input",{ref:m,value:o,onChange:h=>d(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}),u.jsx("button",{onClick:h=>{h.stopPropagation(),p()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:u.jsx(fr,{size:14})}),u.jsx("button",{onClick:h=>{h.stopPropagation(),l()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:u.jsx(Hr,{size:14})}),i&&u.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:i})]})}const $2=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),q2=new Set([".ts",".tsx",".md"]),Y2=new Set([".md",".doc",".docx",".pdf",".ppt",".pptx",".txt"]),G2=new Set([".md",".txt"]),V2=5*1024*1024,K2=10;function jd(n){const r=n.lastIndexOf(".");return r>=0?n.slice(r).toLowerCase():""}function X2(n){const r=n.includes("/")?n.split("/").pop():n;if($2.has(r.toLowerCase()))return!0;const l=jd(r);return q2.has(l)}const Q2=n=>{const r=new Date(n);if(Number.isNaN(r.getTime()))return"";const l=o=>String(o).padStart(2,"0"),i=`${l(r.getMonth()+1)}-${l(r.getDate())} ${l(r.getHours())}:${l(r.getMinutes())}`;return r.getFullYear()===new Date().getFullYear()?i:`${r.getFullYear()}-${i}`},Zg={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function F2({source:n,isDaemonLibrary:r,isRepoRoot:l}){const{t:i}=Ne(),o=n.kind==="source",d=o&&(n.source_type==="code"||X2(n.name)),m=d?"text-c4a-accent":"text-c4a-text-secondary group-hover:text-c4a-accent",p=n.metadata?.origin==="remote";let g;if(n.kind==="folder"?g=l||p?u.jsx(Ro,{size:16,className:`shrink-0 ${m}`}):r?u.jsx(V_,{size:16,className:`shrink-0 ${m}`}):u.jsx(Xa,{size:16,className:`shrink-0 ${m}`}):n.source_type==="code"?g=u.jsx(zs,{size:16,className:`shrink-0 ${m}`}):g=u.jsx(dr,{size:16,className:`shrink-0 ${m}`}),!o||!d)return u.jsx(u.Fragment,{children:g});const h=Zg[n.index_status]??Zg.none,v=i(`sources.status.${n.index_status}`);return u.jsxs("span",{className:"group/dot relative shrink-0",children:[g,u.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${h}`}),u.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:v})]})}function Jg({source:n,displayName:r,childCount:l,isDaemonLibrary:i,isRepoRoot:o,hasUpdate:d,onClick:m,onRename:p,onDelete:g}){const{t:h}=Ne(),[v,b]=y.useState(!1),[_,j]=y.useState(null),N=y.useCallback(async V=>{if(!p)return;const Y=await p(V);Y?j(Y):(b(!1),j(null))},[p]),C=y.useCallback(()=>{b(!1),j(null)},[]),z=!o&&p,q=g,Q=n.updated_at||n.created_at;return u.jsxs("div",{className:"group flex cursor-pointer items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent",onClick:v?void 0:m,children:[u.jsx(F2,{source:n,isDaemonLibrary:i??!1,isRepoRoot:o??!1}),v?u.jsx("div",{className:"min-w-0 flex-1",onClick:V=>V.stopPropagation(),children:u.jsx(ry,{currentName:n.name,onConfirm:N,onCancel:C,error:_})}):u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-secondary group-hover:text-c4a-accent",children:r??n.name}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[d&&u.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:[u.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"&&l!==void 0&&u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:l})}),Q&&u.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:Q2(Q)})]}),(z||q)&&u.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[z?u.jsx("button",{title:h("sources.actions.rename"),onClick:V=>{V.stopPropagation(),b(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:u.jsx(bd,{size:14})}):q?u.jsx("span",{className:"p-1",children:u.jsx("span",{className:"inline-block h-[14px] w-[14px]"})}):null,q&&u.jsx("button",{title:h("sources.actions.delete"),onClick:V=>{V.stopPropagation(),g()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:u.jsx(Ud,{size:14})})]})]})}function Pg({target:n,onConfirm:r,onCancel:l}){const{t:i}=Ne();return u.jsxs(Ln,{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:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.delete.confirm_title")}),u.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[n.type==="resource"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.resource",{name:n.name})}),u.jsx("p",{children:i("sources.delete.resource_impact")}),u.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.session_warning")}),u.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="folder"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.folder",{name:n.name})}),n.folderCount!==void 0&&n.sourceCount!==void 0?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.folder_contents",{folders:n.folderCount,sources:n.sourceCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&u.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.sourceCount})})]}):u.jsx("p",{children:i("sources.delete.folder_impact_generic")}),u.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")})]}),n.type==="repo"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.repo",{name:n.name,library:n.libraryName})}),n.packageCount!==void 0&&n.docCount!==void 0?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.repo_contents",{packages:n.packageCount,docs:n.docCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&u.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.packageCount+n.docCount})})]}):u.jsx("p",{children:i("sources.delete.repo_impact_generic")}),u.jsx("p",{children:i("sources.delete.local_safe")}),u.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="client"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.client",{name:n.name})}),u.jsx("p",{children:i("sources.delete.client_impact")}),u.jsx("p",{children:i("sources.delete.local_safe")}),u.jsx("p",{children:i("sources.delete.entity_safe")}),u.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")}),u.jsx("p",{className:"text-c4a-text-muted",children:i("sources.delete.client_reregister")})]})]}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.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")}),u.jsx("button",{onClick:r,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 Z2({onConfirm:n,onCancel:r,error:l}){const{t:i}=Ne(),[o,d]=y.useState(""),m=y.useRef(null);y.useEffect(()=>{m.current?.focus()},[]);const p=y.useCallback(()=>{const h=o.trim();h&&n(h)},[o,n]),g=y.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),p())},[p]);return u.jsxs(Ln,{onClose:r,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Px,{size:16,className:"shrink-0 text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.actions.new_folder")})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("input",{ref:m,value:o,onChange:h=>d(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}),l&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:l})]}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.jsx("button",{onClick:r,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")}),u.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 ad({label:n,icon:r,items:l,alignRight:i}){const[o,d]=y.useState(!1),m=y.useRef(null),p=y.useRef(null),g=y.useCallback(b=>{m.current&&!m.current.contains(b.target)&&d(!1)},[]);y.useEffect(()=>{if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,g]);const h=y.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),d(!0)},[]),v=y.useCallback(()=>{p.current=setTimeout(()=>d(!1),150)},[]);return u.jsxs("div",{ref:m,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[u.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:[r,n&&u.jsx("span",{className:"hidden sm:inline",children:n}),n&&u.jsx(Qt,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&u.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:l.map(b=>u.jsxs("button",{onClick:()=>{b.onClick(),d(!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:[b.icon,b.label]},b.label))})]})}function J2({onClose:n}){const{t:r}=Ne();return u.jsxs(Ln,{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:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(zS,{size:18,className:"text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:r("sources.upgrade.title")})]}),u.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:r("sources.upgrade.description")}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.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:r("common.confirm")})})]})}function P2(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function I2({onConfirm:n,onCancel:r,error:l,uploading:i}){const{t:o}=Ne(),[d,m]=y.useState([]),[p,g]=y.useState(null),[h,v]=y.useState(!1),[b,_]=y.useState(!1),j=y.useRef(null),N=y.useCallback(Z=>{g(null);for(const G of Z){const E=jd(G.name);if(!Y2.has(E)){g(o("sources.upload.unsupported_type",{name:G.name}));return}if(G.size>V2){g(o("sources.upload.file_too_large",{name:G.name}));return}}m(G=>{const E=new Map(G.map(W=>[W.name,W]));for(const W of Z)E.set(W.name,{name:W.name,size:W.size,file:W});const H=Array.from(E.values());return H.length>K2?(g(o("sources.upload.too_many_files")),G):H})},[o]),C=y.useCallback(Z=>{const G=Z.target.files;!G||G.length===0||(N(Array.from(G)),Z.target.value="")},[N]),z=y.useCallback(Z=>{m(G=>G.filter((E,H)=>H!==Z)),g(null)},[]),q=y.useCallback(Z=>{Z.preventDefault(),v(!1);const G=Z.dataTransfer?.files;!G||G.length===0||N(Array.from(G))},[N]),Q=y.useCallback(Z=>{Z.preventDefault(),v(!0)},[]),V=y.useCallback(Z=>{Z.preventDefault(),v(!1)},[]),Y=y.useCallback(async()=>{if(!(d.length===0||b)){_(!0);try{const Z=await Promise.all(d.map(G=>new Promise((E,H)=>{const W=jd(G.name),de=G2.has(W),le=new FileReader;le.onerror=()=>H(le.error),de?(le.onload=()=>E({name:G.name,content:le.result,encoding:"utf-8"}),le.readAsText(G.file)):(le.onload=()=>{const se=le.result,ce=se.slice(se.indexOf(",")+1);E({name:G.name,content:ce,encoding:"base64"})},le.readAsDataURL(G.file))})));n(Z)}catch{_(!1)}}},[d,b,n]),te=l||p;return u.jsxs(Ln,{onClose:r,disableClose:b||(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:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(_d,{size:16,className:"shrink-0 text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("input",{ref:j,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:C,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>j.current?.click(),onDrop:q,onDragOver:Q,onDragLeave:V,disabled:b||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"} ${b||i?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[u.jsx(_d,{size:24,className:"text-c4a-text-muted"}),u.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),u.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),d.length>0&&u.jsxs("div",{className:"mt-3",children:[u.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:d.length})}),u.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:d.map((Z,G)=>u.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[u.jsx(dr,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:Z.name}),u.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:P2(Z.size)}),!b&&!i&&u.jsx("button",{type:"button",onClick:()=>z(G),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:u.jsx(Hr,{size:12})})]},`${Z.name}-${G}`))})]}),te&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:te}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.jsx("button",{onClick:r,disabled:b||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")}),u.jsxs("button",{onClick:Y,disabled:d.length===0||b||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:[(b||i)&&u.jsx(va,{size:12,className:"animate-spin"}),o(b||i?"sources.upload.uploading":"common.confirm")]})]})]})}function W2({pathLabel:n,loading:r,badge:l,onNavigateUp:i,children:o}){return u.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[u.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:n}),l]}),u.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),u.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:r?u.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:u.jsx(va,{size:14,className:"animate-spin text-c4a-text-muted"})}):u.jsxs(u.Fragment,{children:[i&&u.jsxs("button",{onClick:i,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:[u.jsx(Xa,{size:16,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{children:".."})]}),o]})})]})}function ej(n){const r=n.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(r){const l=r[1],i=r[2];return{slug:i,repoUrl:`https://${l}/${i}`,host:l}}try{const l=new URL(n),i=l.hostname,o=l.pathname.replace(/^\//,"").replace(/\.git$/,"");return o?{slug:o,repoUrl:`https://${i}/${o}`,host:i}:null}catch{return null}}function tj(n,r){return`${n}/tree/${encodeURIComponent(r)}`}function aj(n,r){return`${n}/commit/${r}`}function sy({remoteUrl:n,fallbackName:r,branch:l,commit:i}){const o=n?ej(n):null,d=i.slice(0,7);return u.jsxs("div",{className:"flex min-w-0 shrink flex-wrap items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent",children:[o?u.jsxs("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:o.repoUrl,children:[u.jsx(Dg,{size:12,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:o.slug})]}):u.jsxs("span",{className:"flex items-center gap-1 truncate",children:[u.jsx(Dg,{size:12,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:r||"repo"})]}),u.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?u.jsxs("a",{href:tj(o.repoUrl,l),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[u.jsx(yd,{size:10,className:"shrink-0"}),u.jsx("span",{children:l})]}):u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(yd,{size:10,className:"shrink-0"}),u.jsx("span",{children:l})]}),u.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?u.jsx("a",{href:aj(o.repoUrl,i),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:d}):u.jsx("span",{children:d})]})}function nj(n,r,l){const[i,o]=y.useState({}),d=y.useRef(new Set);return y.useEffect(()=>{if(!n||!r||l.length===0)return;const m=l.filter(p=>{const g=p.metadata;return g?.origin==="remote"&&g?.remote_url&&g?.remote_commit&&!d.current.has(p.id)});if(m.length!==0){m.forEach(p=>d.current.add(p.id));for(const p of m){const g=p.metadata;lt.post("/import/remote/refs",{library_id:n,url:g.remote_url}).then(h=>{const v=g.remote_ref||"",b=h.branches?.find(_=>_.name===v)??h.tags?.find(_=>_.name===v);b&&b.commit!==g.remote_commit&&o(_=>({..._,[p.id]:!0}))}).catch(()=>{})}}},[n,r,l]),i}function rj({library:n,onNewFolder:r,onUploadDoc:l,onImportRepo:i,onImportDir:o,onUpgrade:d}){const{t:m}=Ne(),p=n.type==="daemon",g="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",h=p?u.jsxs("div",{className:"flex gap-3",children:[o&&u.jsx("button",{onClick:o,disabled:!n.is_online,className:g,children:m("sources.actions.import_dir")}),i&&u.jsx("button",{onClick:i,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:m("sources.actions.import_repo")})]}):u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:r,className:g,children:m("sources.actions.new_folder")}),l&&u.jsx("button",{onClick:l,className:g,children:m("sources.actions.upload_document")}),d&&u.jsx("button",{onClick:d,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:m("sources.actions.import_repo_url")})]});return u.jsx(ko,{fullPage:!0,title:m(p?"sources.empty.daemon.title":"sources.empty.cloud.title"),description:m(p?"sources.empty.daemon.description":"sources.empty.cloud.description"),action:h})}function sj(){const{t:n}=Ne();return u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[u.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.empty.indexed.title")}),u.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:n("sources.empty.indexed.description")})]})}const nd=n=>{let r=0,l=0,i=0,o=0,d=0;const m=p=>{for(const g of p.children??[])g.kind==="folder"?(r++,m(g)):g.kind==="source"&&(l++,g.source_type==="code"?i++:o++,(g.index_status==="indexed"||g.index_status==="stale")&&d++)};return m(n),{folders:r,sources:l,codeSources:i,docSources:o,indexedSources:d}};function lj(){const{t:n}=Ne(),r=_a(),{libId:l}=Kl(),[i,o]=Co(),d=i.get("rootId")||null,m=i.get("path")||"",g=$t(Br(Ms)).find(X=>X.id===l),h=$t(X=>X.updateLibraryName),v=$t(X=>X.deleteLibrary),{rootSources:b,currentRoot:_,loading:j,filter:N,fetchRootSources:C,fetchRootSource:z,createSource:q,addTreeNode:Q,updateSource:V,deleteSource:Y,deleteTreeNode:te,uploadDoc:Z,setFilter:G}=zo(),[E,H]=y.useState(!1),[W,de]=y.useState(null),[le,se]=y.useState(null),[ce,ge]=y.useState(null),[A,P]=y.useState(null),[fe,me]=y.useState(!1),[re,w]=y.useState(!1),[$,ee]=y.useState(null),[ae,xe]=y.useState(!1),[ve,ze]=y.useState(!1),[Pe,Xe]=y.useState(null),[ea,ma]=y.useState(!1);y.useEffect(()=>{l&&C({library_id:l})},[l,C]),y.useEffect(()=>{d&&z(d)},[d,z]);const Qe=d!==null,et=y.useMemo(()=>Qe?_?[...U2(_.tree,m)].sort((Oe,$e)=>Oe.kind!==$e.kind?Oe.kind==="folder"?-1:1:Oe.name.localeCompare($e.name)).map(Oe=>({type:"node",root:_,node:Oe})):[]:[...b].sort(($e,Ue)=>$e.kind!==Ue.kind?$e.kind==="folder"?-1:1:new Date(Ue.created_at).getTime()-new Date($e.created_at).getTime()).map($e=>({type:"root",root:$e,node:null})),[Qe,b,_,m]),ft=y.useMemo(()=>N==="all"?et:et.filter(X=>X.type==="root"||!X.node||X.node.kind==="folder"?!0:N==="indexed"?X.node.index_status==="indexed":X.node.index_status==="none"||!X.node.index_status),[et,N]),qt=g?.type==="daemon",Vt=g?.type==="cloud",ta=qt&&!Qe,aa=nj(l,Vt,b),Sa=y.useMemo(()=>{if(!g)return[];const X=[{label:g.is_default?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];return Qe&&_&&(X.push({label:_.name,to:`/studio/sources/${g.id}?rootId=${_.id}`}),m&&Dl(_.tree,m).forEach(Oe=>{X.push({label:Oe.name,to:`/studio/sources/${g.id}?rootId=${_.id}&path=${encodeURIComponent(Oe.path)}`})})),X},[g,Qe,_,m,n]),ja=y.useCallback(async X=>{if(l)try{Qe&&d?await Q(d,{parent_path:m,kind:"folder",name:X}):(await q({library_id:l,kind:"folder",name:X}),C({library_id:l})),H(!1),de(null)}catch(ie){ie instanceof Ar&&ie.status===409&&de(n("sources.error.name_conflict",{name:X}))}},[l,Qe,d,m,q,Q,C,n]),Aa=y.useCallback(X=>{l&&(X.type==="root"?X.root.kind==="source"?r(`/studio/source/${X.root.id}`):o({rootId:X.root.id}):X.node&&(X.node.kind==="folder"?o({rootId:X.root.id,path:X.node.path}):r(`/studio/source/${X.root.id}?path=${encodeURIComponent(X.node.path)}`)))},[l,r,o]),la=y.useCallback(()=>{if(!(!d||!l))if(m){const X=m.split("/");X.pop();const ie=X.join("/");o(ie?{rootId:d,path:ie}:{rootId:d})}else o({})},[d,l,m,o]),ia=y.useCallback(async(X,ie)=>{try{return await V(X,{name:ie}),C({library_id:l}),null}catch(Oe){return Oe instanceof Ar&&Oe.status===409?n("sources.error.name_conflict",{name:ie}):null}},[l,V,C,n]),pt=y.useCallback(X=>{if(X.type==="root"){ge(X.root.id),P(null);const ie=X.root.tree.length>0?nd({children:X.root.tree}):void 0;se(qt?{type:"repo",name:X.root.name,libraryName:g.name,...ie?{packageCount:ie.codeSources,docCount:ie.docSources,indexedCount:ie.indexedSources}:{}}:{type:X.root.kind==="folder"?"folder":"resource",name:X.root.name,...X.root.kind==="folder"&&ie?{folderCount:ie.folders,sourceCount:ie.sources,indexedCount:ie.indexedSources}:{}})}else if(X.node)if(ge(X.root.id),P(X.node.path),X.node.kind==="folder"){const ie=nd(X.node);se({type:"folder",name:X.node.name,folderCount:ie.folders,sourceCount:ie.sources,indexedCount:ie.indexedSources})}else se({type:"resource",name:X.node.name})},[qt,g]),oa=y.useCallback(async()=>{if(!(!ce||!l)){try{A?await te(ce,A):(await Y(ce),C({library_id:l}))}catch{}se(null),ge(null),P(null)}},[ce,A,l,Y,te,C]),_e=y.useCallback(()=>{if(!l)return;const X=new URLSearchParams;d&&(X.set("parentId",d),_&&X.set("parentName",_.name)),m&&X.set("parentPath",m);const ie=X.toString();r(`/studio/sources/import/${l}${ie?`?${ie}`:""}`)},[l,r,d,m,_]),Ae=y.useCallback(()=>{l&&r(`/studio/sources/import-dir/${l}`)},[l,r]),Fe=y.useCallback(async X=>{if(l){xe(!0),ee(null);try{const ie={library_id:l,files:X.map(Oe=>{const $e={file_name:Oe.name,content:Oe.content};return Oe.encoding&&($e.encoding=Oe.encoding),$e})};Qe&&d&&(ie.root_source_id=d,ie.parent_path=m),await Z(ie),Qe&&d?z(d):C({library_id:l}),w(!1)}catch(ie){ie instanceof Ar&&ie.status===409?ee(n("sources.error.name_conflict",{name:X[0]?.name??""})):ie instanceof Ar&&ee(ie.message)}finally{xe(!1)}}},[l,Qe,d,m,Z,C,z,n]),gt=g?.is_default===!0,Nt=y.useCallback(async X=>{if(l)try{await h(l,X),ze(!1),Xe(null)}catch(ie){const Oe=ie instanceof Error?ie.message:String(ie);Xe(Oe)}},[l,h]),Ft=y.useCallback(()=>{ze(!1),Xe(null)},[]),Ia=y.useCallback(async()=>{if(l){try{await v(l),r("/studio/sources/add-client")}catch{}ma(!1)}},[l,v,r]),Zt=y.useCallback(()=>{ma(!1)},[]);if(!g)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const kt=b.length===0&&N==="all"&&!j&&!Qe,xt=ft.filter(X=>X.type==="node"&&X.node?.kind==="source").length===0&&N==="indexed"&&!j,Dt=!Qe||!_?!1:_.metadata?.origin==="remote"?!0:m?Dl(_.tree,m).some(ie=>ie.metadata?.origin==="remote"):!1,Ce=!ta,Le=Vt&&!Dt,st=ta;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("div",{className:"min-w-0 flex-1",children:ve?u.jsx(ry,{currentName:g.name,onConfirm:Nt,onCancel:Ft,error:Pe}):u.jsx(Ls,{segments:Sa})}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Le&&u.jsxs(u.Fragment,{children:[u.jsx(ad,{label:n("sources.actions.upload"),icon:u.jsx(_d,{size:14}),items:[{label:n("sources.actions.upload_doc"),icon:u.jsx(dr,{size:14}),onClick:()=>w(!0)}]}),u.jsx(ad,{label:n("sources.actions.add"),icon:u.jsx(Ld,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:u.jsx(Px,{size:14}),onClick:()=>H(!0)},{label:n("sources.actions.add_web"),icon:u.jsx(I_,{size:14}),onClick:()=>me(!0)},{label:n("sources.actions.add_feishu"),icon:u.jsx(M_,{size:14}),onClick:()=>me(!0)}]}),u.jsxs("button",{onClick:()=>{const X=new URLSearchParams;d&&(X.set("parentId",d),_&&X.set("parentName",_.name)),m&&X.set("parentPath",m);const ie=X.toString();r(`/studio/sources/import-remote/${l}${ie?`?${ie}`:""}`)},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:[u.jsx(Og,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo_url")})]})]}),st&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:Ae,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:[u.jsx(Y_,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_dir")})]}),u.jsxs("button",{onClick:_e,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:[u.jsx(Og,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo")})]}),u.jsx(ad,{label:"",icon:u.jsx(bd,{size:14}),alignRight:!0,items:[{label:n("sources.library.rename"),icon:u.jsx(bd,{size:14}),onClick:()=>ze(!0)},...gt?[]:[{label:n("sources.actions.delete"),icon:u.jsx(Ud,{size:14}),onClick:()=>ma(!0)}]]})]}),Ce&&u.jsx(B2,{value:N,onChange:G})]})]}),kt?u.jsx(rj,{library:g,onNewFolder:()=>H(!0),...qt?{onImportRepo:_e,onImportDir:Ae}:{},...Vt?{onUploadDoc:()=>w(!0),onUpgrade:()=>{const X=new URLSearchParams;d&&(X.set("parentId",d),_&&X.set("parentName",_.name)),m&&X.set("parentPath",m);const ie=X.toString();r(`/studio/sources/import-remote/${l}${ie?`?${ie}`:""}`)}}:{}}):u.jsx(W2,{pathLabel:(()=>{if(!Qe||!_)return"/";const X=_.metadata,ie=qt?typeof X?.local_path=="string"?X.local_path:_.name:"/"+_.name;if(!m)return ie;const Oe=Dl(_.tree,m);return ie+"/"+Oe.map($e=>$e.name).join("/")})(),loading:j,badge:(()=>{if(!Qe||!_)return;let X=_.metadata,ie=_.name;if(!X?.origin&&m){const Ue=Dl(_.tree,m);for(const At of Ue){const ca=At.metadata;if(ca?.origin==="remote"){X=ca,ie=At.name;break}}}const Oe=X?.pinned_branch??X?.remote_ref,$e=X?.pinned_hash??X?.remote_commit;if(!(!Oe||!$e))return u.jsx(sy,{remoteUrl:X?.remote_url,fallbackName:ie,branch:Oe,commit:$e})})(),onNavigateUp:Qe?la:void 0,children:ft.length===0?xt?u.jsx(sj,{}):Qe?null:u.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:n("common.items",{count:0})}):u.jsx("div",{className:"flex flex-col gap-0.5",children:ft.map(X=>{if(X.type==="root"){const Ue=X.root,At=qt,ca=At?Ue.metadata?.local_path:void 0,ua=Ue.tree.length>0?nd({children:Ue.tree}):void 0,Ma=ua?ua.folders+ua.sources:0,Na=Ue.metadata,mr=Na?.origin==="remote",$r=Na?.import_type==="directory",qr=mr||At&&!$r;return u.jsx(Jg,{source:{id:Ue.id,library_id:Ue.library_id,owner_id:Ue.owner_id,path:"",kind:Ue.kind,source_type:Ue.source_type,name:Ue.name,content_hash:Ue.content_hash,metadata:Ue.metadata,index_status:Ue.index_status,created_at:Ue.created_at,updated_at:Ue.updated_at},...typeof ca=="string"?{displayName:ca}:{},...Ue.kind==="folder"?{childCount:Ma}:{},isDaemonLibrary:qt??!1,isRepoRoot:qr,...aa[Ue.id]?{hasUpdate:!0}:{},onClick:()=>Aa(X),...mr?{}:{onRename:R=>ia(Ue.id,R)},onDelete:()=>pt(X)},Ue.id)}const ie=X.node,Oe=`${X.root.id}:${ie.path}`,$e=ie.kind==="folder"?ie.children?.length??0:void 0;return u.jsx(Jg,{source:{id:X.root.id,library_id:X.root.library_id,owner_id:X.root.owner_id,path:ie.path,kind:ie.kind,source_type:ie.source_type??null,name:ie.name,content_hash:null,metadata:ie.metadata??null,index_status:ie.index_status??"none",created_at:X.root.created_at,updated_at:X.root.updated_at},...$e!==void 0?{childCount:$e}:{},isDaemonLibrary:qt??!1,onClick:()=>Aa(X),...Vt&&X.root.metadata?.origin!=="remote"?{onDelete:()=>pt(X)}:{}},Oe)})})}),E&&u.jsx(Z2,{onConfirm:ja,onCancel:()=>{H(!1),de(null)},error:W}),re&&u.jsx(I2,{onConfirm:Fe,onCancel:()=>{w(!1),ee(null)},error:$,uploading:ae}),fe&&u.jsx(J2,{onClose:()=>me(!1)}),le&&u.jsx(Pg,{target:le,onConfirm:oa,onCancel:()=>{se(null),ge(null),P(null)}}),ea&&g&&u.jsx(Pg,{target:{type:"client",name:g.name},onConfirm:Ia,onCancel:Zt})]})}function ij(){const{t:n}=Ne(),r=_a(),l=$t(m=>m.libraries),i=$t(m=>m.loading),[o,d]=y.useState(!1);return y.useEffect(()=>{if(i)return;if(l.length===0&&!o){d(!0),$t.getState().fetchLibraries();return}const m=l.find(p=>p.is_default);m?r(`/studio/sources/${m.id}`,{replace:!0}):l.length>0&&r(`/studio/sources/${l[0].id}`,{replace:!0})},[l,i,r,o]),o&&!i&&l.length===0?u.jsx(ko,{fullPage:!0,icon:u.jsx(Zx,{size:32}),title:n("sources.empty.cloud.title"),description:n("sources.empty.cloud.description")}):u.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:u.jsx(Hd,{})})}function mn({active:n,current:r}){return u.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${r?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Mr(){return u.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function ly({libraryName:n}){const{t:r}=Ne();return u.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[u.jsx("p",{className:"text-sm text-c4a-warning",children:r("sources.import.daemon_offline",{name:n})}),u.jsx(Fa,{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:r("sources.import.view_guide")})]})}function Bd({step:n,totalSteps:r,importing:l,stepBusy:i,canProceed:o,safetyNoticeKey:d,confirmLabelKey:m,onPrev:p,onNext:g,onImport:h}){const{t:v}=Ne();return u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[u.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(d),onClick:b=>b.currentTarget.classList.toggle("line-clamp-1"),children:v(d)}),u.jsxs("div",{className:"flex shrink-0 gap-2",children:[n>1&&u.jsx("button",{onClick:p,disabled:l||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<r?u.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")}):u.jsxs("button",{onClick:h,disabled:l||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:[l&&u.jsx(va,{size:12,className:"animate-spin"}),v(l?"sources.import.importing":m)]})]})]})}function iy(n,r){const l=y.useCallback(async(m,p)=>{if(!n)throw new Error("No library");const g=await lt.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]=y.useState([]);y.useEffect(()=>{if(!n)return;let m=!1;return(async()=>{try{const p=await lt.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 d=y.useMemo(()=>{const m=r?.config;return!m||!Array.isArray(m.allowed_paths)?[]:m.allowed_paths},[r]);return{rpc:l,importedPaths:i,allowedPaths:d}}function oj(n,r){const l=n.toLowerCase();try{if(l.endsWith("package.json")){const i=JSON.parse(r);if(typeof i.name=="string"&&i.name.trim())return i.name.trim()}if(l.endsWith("pyproject.toml"))return r.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(l.endsWith("go.mod"))return r.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(l.endsWith("cargo.toml"))return r.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(l.endsWith("pom.xml"))return r.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(l.endsWith("build.gradle"))return r.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function oy(n,r,l="repo"){const i=[];for(const d of n){const m=d.path.split("/"),p=m.slice(0,-1).join("/")||".",g=m.length===1||d.path==="package.json",h=p==="."?l:m[m.length-2]||p,v=oj(d.path,d.content);i.push({name:v||h,path:p,isRoot:g})}const o=r.filter(d=>/\.md$/i.test(d.path)).map(d=>d.path);return{packages:i,mdFiles:o}}const Ig=new Set(["tree","blob","commit","commits","raw","src"]),cj=new Set(["commit","commits"]);function uj(n){let r;try{r=new URL(n.trim())}catch{return{repoUrl:n.trim()}}const l=r.pathname.split("/").filter(Boolean);let i=-1;for(let h=2;h<l.length;h++){const v=l[h];if(v==="-"&&h+1<l.length&&Ig.has(l[h+1])){i=h;break}if(Ig.has(v)){i=h;break}}if(i===-1)return{repoUrl:`${r.protocol}//${r.host}${r.pathname}`.replace(/\/+$/,"")};const o=l.slice(0,i).join("/"),d=`${r.protocol}//${r.host}/${o}`;let m,p;if(l[i]==="-"?(m=l[i+1],p=i+2):(m=l[i],p=i+1),p>=l.length)return{repoUrl:d};const g=l[p];return cj.has(m)?{repoUrl:d,commit:g}:{repoUrl:d,ref:g}}function cr(n){try{return(new URL(n).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return n.split("/").pop()||n}}function Nd(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}:${String(n.getSeconds()).padStart(2,"0")}`}const dj=1500;async function cy(n){const r=dj-(Date.now()-n);r>0&&await new Promise(l=>setTimeout(l,r))}function uy(){const{t:n}=Ne(),[r,l]=y.useState(!1),[i,o]=y.useState(null),d=y.useRef(),m=y.useRef(),p=window.location.host,g=`c4a-daemon --server ${p} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${p}`,v=y.useCallback((j,N)=>{navigator.clipboard.writeText(j),o(N),clearTimeout(d.current),d.current=setTimeout(()=>o(null),1500)},[]),b=y.useCallback(()=>{clearTimeout(m.current),l(!0)},[]),_=y.useCallback(()=>{m.current=setTimeout(()=>l(!1),150)},[]);return u.jsxs("span",{className:"relative",onMouseEnter:b,onMouseLeave:_,children:[u.jsx(Fx,{size:12,className:"text-c4a-warning"}),r&&u.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:b,onMouseLeave:_,children:[u.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),u.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[u.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:g}),u.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?u.jsx(fr,{size:10}):u.jsx(xd,{size:10})})]}),u.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_all")}),u.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[u.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),u.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?u.jsx(fr,{size:10}):u.jsx(xd,{size:10})})]})]})]})}function dy({open:n,onClose:r,rpc:l,onNavigate:i,defaultPath:o}){const{t:d}=Ne(),[m,p]=y.useState(o??""),[g,h]=y.useState(null),[v,b]=y.useState(!1),_=y.useRef(null);y.useEffect(()=>{o&&!m&&p(o)},[o]);const j=y.useCallback(async()=>{const C=m.trim();if(C){b(!0),h(null);try{(await l("fs/exists",{path:C})).exists?(i(C),p(o??""),h(null),r()):h(d("sources.import.wildcard_path_not_found"))}catch(z){h(z instanceof Error?z.message:String(z))}finally{b(!1)}}},[m,l,d,i,r]),N=y.useCallback(()=>{p(o??""),h(null),r()},[r,o]);return n?u.jsxs(Ln,{onClose:N,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:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:d("sources.import.wildcard_go_title")}),u.jsx("button",{onClick:N,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:u.jsx(Hr,{size:14})})]}),u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsx("input",{ref:_,type:"text",value:m,onChange:C=>{p(C.target.value),h(null)},onKeyDown:C=>{C.key==="Enter"&&j()},placeholder:d("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"}),u.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?u.jsx(va,{size:12,className:"animate-spin"}):u.jsx(Qx,{size:12}),d("sources.import.wildcard_go")]})]}),g&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:g})]}):null}function fy({rpc:n,allowedPaths:r,importedPaths:l,onNavigateUpExtra:i}){const o=!!r&&r.length>0,d=o&&r.length===1&&r[0]==="*",[m,p]=y.useState(o),[g,h]=y.useState(o&&!d?"":"/"),[v,b]=y.useState([]),[_,j]=y.useState(!1),[N,C]=y.useState(null),[z,q]=y.useState(null);y.useEffect(()=>{if(o&&!d)return;let H=!1;return(async()=>{try{const W=await n("fs/homeDir",{});H||q(W.home_dir)}catch{H||q("/")}})(),()=>{H=!0}},[o,d,n]);const[Q,V]=y.useState(!1),Y=y.useCallback(async H=>{j(!0),C(null);try{const W=await n("fs/listTree",{path:H,depth:1});b(W.entries||[]),h(H),p(!1)}catch(W){const de=W instanceof Error?W.message:String(W);C(de)}finally{j(!1)}},[n]);y.useEffect(()=>{o&&!d||z!==null&&Y(z)},[z,o,d,Y]);const te=y.useMemo(()=>new Set(l??[]),[l]),Z=y.useCallback(()=>{if(o&&!d&&r.some(de=>de===g)){p(!0),h(""),b([]),C(null),i?.();return}const H=g.split("/").slice(0,-1).join("/")||"/";i?.(),Y(H)},[o,d,r,g,Y,i]),G=y.useMemo(()=>v.filter(H=>H.type==="directory"),[v]),E=y.useMemo(()=>v.filter(H=>H.type==="file"),[v]);return{atRoot:m,currentPath:g,entries:v,loading:_,error:N,homeDir:z,goToOpen:Q,hasAllowedPaths:o,isWildcard:d,importedSet:te,dirs:G,files:E,loadTree:Y,handleNavigateUp:Z,setGoToOpen:V}}function fj({rpc:n,selectedPath:r,onSelect:l,allowedPaths:i,importedPaths:o}){const{t:d}=Ne(),[m,p]=y.useState(null),{atRoot:g,currentPath:h,entries:v,loading:b,error:_,homeDir:j,goToOpen:N,isWildcard:C,importedSet:z,dirs:q,files:Q,loadTree:V,handleNavigateUp:Y,setGoToOpen:te}=fy({rpc:n,allowedPaths:i??[],importedPaths:o??[],onNavigateUpExtra:()=>p(null)}),[Z,G]=y.useState(null),[E,H]=y.useState(!1);y.useEffect(()=>{if(!r){G(null),H(!1);return}G(null),H(!0);let se=!1;return(async()=>{try{const ce=await n("fs/repoStatus",{path:r});se||(G({branch:ce.branch,hash:ce.head_hash,remoteUrl:ce.remote_url}),H(!1))}catch{se||(G(null),H(!1))}})(),()=>{se=!0}},[r,n]);const W=y.useCallback(se=>{if(se.type==="directory")if(se.is_git_repo){if(z.has(se.path))return;p(null),l(se.path,se.name)}else p(se.path),V(se.path)},[l,V,z]),de=y.useMemo(()=>q.sort((se,ce)=>se.is_git_repo&&!ce.is_git_repo?-1:!se.is_git_repo&&ce.is_git_repo?1:se.name.localeCompare(ce.name)),[q]),le=y.useMemo(()=>Q.sort((se,ce)=>se.name.localeCompare(ce.name)),[Q]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[g?u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[u.jsx("span",{children:d("sources.import.allowed_dirs")}),u.jsx(uy,{})]}):u.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),r&&E?u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[u.jsx(va,{size:12,className:"animate-spin"}),u.jsx("span",{children:d("common.loading")})]}):r&&Z?u.jsx(sy,{remoteUrl:Z.remoteUrl,fallbackName:r.split("/").pop()||r,branch:Z.branch,commit:Z.hash}):!r&&C&&g?u.jsx("button",{onClick:()=>te(!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:d("sources.import.wildcard_goto")}):null]}),u.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),g?C?u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:j&&u.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:[u.jsx(Xa,{size:14,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:[j,u.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",d("sources.import.wildcard_home"),")"]})]}),u.jsx(Qt,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(se=>u.jsxs("button",{onClick:()=>V(se),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:[u.jsx(Xa,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:se}),u.jsx(Qt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},se))}):_&&!b?u.jsx("p",{className:"py-4 text-xs text-c4a-error",children:_}):u.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[b&&u.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:u.jsx(va,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&u.jsxs("button",{onClick:Y,disabled:b,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:[u.jsx(Xa,{size:14}),u.jsx("span",{children:".."})]}),de.map(se=>{const ce=se.is_git_repo&&z.has(se.path),ge=se.is_git_repo?Ro:Xa;return u.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${ce?"cursor-not-allowed text-c4a-accent/60":r===se.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[u.jsxs("button",{onClick:()=>W(se),disabled:ce||b,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[u.jsx(ge,{size:14,className:"shrink-0"}),u.jsx("span",{className:"flex-1 truncate text-left",children:se.name}),ce&&u.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:d("sources.import.already_imported")})]}),!ce&&u.jsx("button",{onClick:A=>{A.stopPropagation(),V(se.path)},disabled:b,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:se.path,children:u.jsx(Qt,{size:12})})]},se.path)}),le.map(se=>u.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[u.jsx(Jx,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:se.name})]},se.path)),v.length===0&&!b&&u.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:d("sources.import.no_entries")})]}),m&&!r&&u.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:d("sources.import.not_git")}),u.jsx(dy,{open:N,onClose:()=>te(!1),rpc:n,onNavigate:V,defaultPath:j??void 0})]})}const Es=50,rd=["main","master"];function mj(n){const r=[],l=[];for(const i of n)rd.includes(i.name)?r.push(i):l.push(i);return r.sort((i,o)=>rd.indexOf(i.name)-rd.indexOf(o.name)),[...r,...l]}function Wg(n,r,l){y.useEffect(()=>{if(!l)return;const i=o=>{n.current&&!n.current.contains(o.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r,l])}function my({refs:n,loading:r,error:l,selectedRef:i,commit:o,onRefChange:d,onCommitChange:m,onValidChange:p,onBranchSwitch:g}){const{t:h}=Ne(),[v,b]=y.useState(!1),[_,j]=y.useState(""),[N,C]=y.useState(!0),[z,q]=y.useState(!0),Q=y.useRef(null),V=y.useRef(null),[Y,te]=y.useState(!1),[Z,G]=y.useState(""),E=y.useRef(null),H=y.useRef(null);Wg(Q,()=>{b(!1),j("")},v),Wg(E,()=>{te(!1),G("")},Y),y.useEffect(()=>{v&&setTimeout(()=>V.current?.focus(),0)},[v]),y.useEffect(()=>{Y&&setTimeout(()=>H.current?.focus(),0)},[Y]),y.useEffect(()=>{p(!!i)},[i,p]);const W=y.useCallback(re=>{d(re.name),m(re.commit),b(!1),j(""),g?.(re.name)},[d,m,g]),de=y.useCallback((re,w)=>{m(re),d(w),te(!1),G("")},[m,d]),le=y.useMemo(()=>n?mj(n.branches):[],[n]),se=y.useMemo(()=>{const re=_.toLowerCase();return(re?le.filter($=>$.name.toLowerCase().includes(re)):le).slice(0,Es)},[le,_]),ce=y.useMemo(()=>{if(!n)return[];const re=_.toLowerCase();return(re?n.tags.filter($=>$.name.toLowerCase().includes(re)):n.tags).slice(0,Es)},[n,_]),ge=y.useMemo(()=>{if(!n)return[];if(n.commits&&n.commits.length>0){const ae=Z.toLowerCase(),xe=n.commits.map(ve=>({hash:ve.hash,refName:i||"",label:`${ve.hash.slice(0,8)} ${ve.message?`— ${ve.message.slice(0,50)}`:""}`.trim()}));return ae?xe.filter(ve=>ve.hash.toLowerCase().includes(ae)||ve.label.toLowerCase().includes(ae)).slice(0,Es):xe.slice(0,Es)}const re=new Set,w=[],$=[...n.branches??[],...n.tags??[]];for(const ae of $){const xe=ae.commit.slice(0,8);re.has(ae.commit)||(re.add(ae.commit),w.push({hash:ae.commit,refName:ae.name,label:`${xe} (${ae.name})`}))}if(!Z)return w.slice(0,Es);const ee=Z.toLowerCase();return w.filter(ae=>ae.hash.toLowerCase().includes(ee)||ae.label.toLowerCase().includes(ee)).slice(0,Es)},[n,Z,i]),[A,P]=y.useState(!1);if(y.useEffect(()=>{if(!r){P(!1);return}const re=setTimeout(()=>P(!0),5e3);return()=>clearTimeout(re)},[r]),r)return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx(va,{size:20,className:"animate-spin text-c4a-accent"}),u.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:h("sources.import_remote.loading_refs")}),A&&u.jsx("span",{className:"mt-1.5 text-xs text-c4a-text-muted",children:h("sources.import_remote.loading_refs_slow")})]});if(l)return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[u.jsx(Hr,{size:14,className:"shrink-0"}),h("sources.import.error_title")]}),u.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:l})]});if(!n)return null;const fe=n.branches.find(re=>re.name===i)?.name??n.tags.find(re=>re.name===i)?.name??i,me=o?o.slice(0,8):"";return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.ref_label")}),u.jsxs("div",{ref:Q,className:"relative mt-2",children:[u.jsxs("button",{onClick:()=>b(!v),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:[u.jsx("span",{children:fe||"—"}),u.jsx(Qt,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${v?"rotate-90":""}`})]}),v&&u.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[u.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:u.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[u.jsx(vd,{size:14,className:"shrink-0 text-c4a-text-muted"}),u.jsx("input",{ref:V,type:"text",value:_,onChange:re=>j(re.target.value),placeholder:h("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"})]})}),u.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[se.length>0&&u.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[u.jsxs("button",{onClick:()=>C(!N),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:[u.jsx(Qt,{size:12,className:`transition-transform duration-200 ${N?"rotate-90":""}`}),h("sources.import_remote.ref_branches")," (",n.branches.length,")"]}),N&&se.map(re=>u.jsxs("button",{onClick:()=>W(re),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${re.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx("span",{className:"truncate",children:re.name}),re.name===i&&u.jsx("span",{children:"✓"})]},`b-${re.name}`))]}),ce.length>0&&u.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[u.jsxs("button",{onClick:()=>q(!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:[u.jsx(Qt,{size:12,className:`transition-transform duration-200 ${z?"rotate-90":""}`}),h("sources.import_remote.ref_tags")," (",n.tags.length,")"]}),z&&ce.map(re=>u.jsxs("button",{onClick:()=>W(re),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${re.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx("span",{className:"truncate",children:re.name}),re.name===i&&u.jsx("span",{children:"✓"})]},`t-${re.name}`))]})]}),se.length===0&&ce.length===0&&u.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.commit_label")}),u.jsxs("div",{ref:E,className:"relative mt-2",children:[u.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:[u.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:me||"—"}),u.jsx(Qt,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${Y?"rotate-90":""}`})]}),Y&&u.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:[u.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[u.jsx(vd,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("input",{ref:H,type:"text",value:Z,onChange:re=>G(re.target.value),placeholder:h("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"})]})}),ge.map(re=>u.jsxs("button",{onClick:()=>de(re.hash,re.refName),className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx("span",{className:"truncate",children:re.label}),re.hash===o&&u.jsx("span",{className:"text-c4a-accent",children:"✓"})]},re.hash)),ge.length===0&&u.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),u.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[u.jsx(eS,{size:12,className:"shrink-0"}),h("sources.import_remote.commit_hint")]})]})]})}const hj="_progressTrack_4p57j_1",pj="_progressFill_4p57j_9",gj="_progressFillFailed_4p57j_45",xj="_indeterminate_4p57j_53",uo={progressTrack:hj,progressFill:pj,progressFillFailed:gj,indeterminate:xj};function yj(n){const r={},l=100/n.length;return n.forEach((i,o)=>{r[i.key]=Math.round(l*(o+1))}),r}function bj(n,r,l,i,o,d){const m=v=>v>0?r[n[v-1].key]??0:0;if(o){const v=n.findIndex(j=>j.key===o),b=m(v),_=r[o]??100;return b+d/100*(_-b)}if(!l)return i.length===n.length?100:0;const p=n.findIndex(v=>v.key===l);if(p<0)return 0;const g=m(p),h=r[l]??100;return d>=0?g+d/100*(h-g):g}function vj({stages:n,currentStage:r,completedStages:l,failedStage:i,progress:o,breakpoints:d}){const m=d??yj(n),p=o?.percent??-1,g=y.useRef(0),[h,v]=y.useState(0),b=y.useRef(null),_=bj(n,m,r,l,i,p>=0?p:-1);g.current=_,y.useEffect(()=>{_>h&&v(_)},[_]),y.useEffect(()=>{if(!r||i){b.current&&(clearInterval(b.current),b.current=null);return}const Q=n.findIndex(G=>G.key===r),V=m[r]??100,Y=Q===n.length-1?V-1:V-2,te=500,Z=.025;return b.current=setInterval(()=>{v(G=>{const E=g.current;if(G>=E&&G<Y){const H=Math.max(.1,(Y-G)*Z);return Math.min(G+H,Y)}return G})},te),()=>{b.current&&(clearInterval(b.current),b.current=null)}},[r,i,n,m]);const j=y.useRef(null);y.useEffect(()=>{if(l.length===n.length&&!i)return b.current&&(clearInterval(b.current),b.current=null),j.current=setInterval(()=>{v(Q=>Q>=100?(j.current&&clearInterval(j.current),j.current=null,100):Math.min(100,Q+4))},32),()=>{j.current&&(clearInterval(j.current),j.current=null)}},[l.length,n.length,i]);const N=Math.min(100,Math.max(0,h)),C=!!r&&!i,z=!!i,q=l.length===n.length&&!i;return u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:n.map(Q=>{const V=l.includes(Q.key),Y=i===Q.key,te=r===Q.key;let Z="inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-mono text-[11px] uppercase tracking-tight transition-colors";return Y?Z+=" bg-red-500/10 text-red-400":V?Z+=" bg-c4a-accent/10 text-c4a-accent":te?Z+=" bg-c4a-accent/15 text-c4a-accent":Z+=" bg-c4a-bg-elevated text-c4a-text-muted",u.jsxs("span",{className:Z,children:[Y?u.jsx(Hr,{size:10,className:"shrink-0"}):V?u.jsx(fr,{size:10,className:"shrink-0"}):te?u.jsx(va,{size:10,className:"shrink-0 animate-spin"}):u.jsx(k_,{size:8,className:"shrink-0 opacity-40"}),Q.label]},Q.key)})}),u.jsx("div",{className:uo.progressTrack,children:N>0?u.jsx("div",{className:`${uo.progressFill} ${z?uo.progressFillFailed:""}`,style:{width:`${N}%`}},"fill"):C?u.jsx("div",{className:uo.indeterminate,style:{width:"100%",height:"100%"}},"pulse"):null}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted tabular-nums",children:q?"100%":C||z?`${Math.round(N)}%`:""}),o?.label&&C&&u.jsx("span",{className:"max-w-[320px] truncate font-mono text-[11px] text-c4a-text-muted",children:o.label})]})]})}function hy({stages:n,currentStage:r,completedStages:l,failedStage:i,progress:o,breakpoints:d,failedError:m,logs:p}){const g=y.useRef(null);return y.useEffect(()=>{g.current?.scrollIntoView({behavior:"smooth"})},[p.length]),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx(vj,{stages:n,currentStage:r,completedStages:l,failedStage:i,progress:o,...d?{breakpoints:d}:{}}),u.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[p.map((h,v)=>u.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:h},v)),u.jsx("div",{ref:g})]}),i&&m&&u.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:u.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:m})})]})}function An({icon:n,label:r,value:l,tooltip:i,size:o="sm"}){const d=o==="sm";return u.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[n,u.jsx("span",{className:"font-mono text-xs uppercase",children:r})]}),u.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${d?"text-sm truncate":"text-lg"}`,title:d?String(l):void 0,children:l}),i&&u.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 sd=100;function py({repoName:n,repoIdentifier:r,branch:l,commit:i,packages:o,mdFiles:d,importing:m,completed:p}){const{t:g}=Ne(),h=i?i.slice(0,7):"",[v,b]=y.useState("packages"),[_,j]=y.useState(sd),N=y.useRef(null),C=y.useRef(null);y.useEffect(()=>{j(sd),C.current?.scrollTo(0,0)},[v]),y.useEffect(()=>{const Y=N.current;if(!Y)return;const te=v==="packages"?o.length:d.length;if(_>=te)return;const Z=new IntersectionObserver(G=>{G[0]?.isIntersecting&&j(E=>Math.min(E+sd,te))},{root:C.current,threshold:.1});return Z.observe(Y),()=>Z.disconnect()},[v,_,o.length,d.length]);const z=v==="packages"?o:d,q=z.slice(0,_),Q=_<z.length,V=y.useMemo(()=>p?g("sources.import_remote.complete"):m?g("sources.import.importing"):g("sources.import.confirm_heading",{name:n}),[p,m,n,g]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[u.jsx("p",{className:"text-sm text-c4a-text-secondary",children:V}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:n}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:r})]}),u.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[u.jsx(An,{icon:u.jsx(yd,{size:14}),label:g("sources.import.branch"),value:l}),u.jsx(An,{icon:u.jsx(Z_,{size:14}),label:g("sources.import.commit"),value:h}),u.jsx(An,{icon:u.jsx(zs,{size:14}),label:g("sources.import.packages"),value:String(o.length),tooltip:g("sources.import.dir_code_packages_tip")}),u.jsx(An,{icon:u.jsx(dr,{size:14}),label:g("sources.import.documents"),value:String(d.length),tooltip:g("sources.import.dir_doc_files_tip")})]}),m&&u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[u.jsx(va,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:g("sources.import.importing")})]}),(o.length>0||d.length>0)&&u.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[u.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:g("sources.import.recognized",{packages:o.length,docs:d.length})}),u.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[u.jsxs("button",{onClick:()=>b("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:[u.jsx(zs,{size:13}),u.jsx("span",{className:"font-mono",children:o.length})]}),u.jsxs("button",{onClick:()=>b("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:[u.jsx(dr,{size:13}),u.jsx("span",{className:"font-mono",children:d.length})]})]})]}),u.jsx("hr",{className:"border-c4a-border-subtle"}),u.jsx("div",{ref:C,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:z.length===0?u.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:v==="packages"?g("sources.import.no_packages"):"—"}):u.jsxs(u.Fragment,{children:[v==="packages"?q.map(Y=>u.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[u.jsx(zs,{size:14,className:"shrink-0 text-c4a-accent"}),u.jsx("span",{className:"text-c4a-text-secondary",children:Y.name}),u.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:Y.path}),Y.isRoot&&u.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},Y.path)):q.map(Y=>u.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[u.jsx(dr,{size:14,className:"shrink-0 text-c4a-text-secondary"}),u.jsx("span",{className:"truncate text-c4a-text-secondary",children:Y})]},Y)),Q&&u.jsx("div",{ref:N,className:"h-4"})]})})]})]})}const _j=["scan","save"],fo={scan:"sources.import.stage.scan",save:"sources.import.stage.save"},Sj={scan:20,save:90};function jj(){const{t:n}=Ne(),r=_a(),{libId:l}=Kl(),[i]=Co(),d=$t(Br(Ms)).find(_e=>_e.id===l),m=zo(_e=>_e.createSource),p=i.get("parentId")||"",g=i.get("parentName")||"",h=i.get("parentPath")||"",[v,b]=y.useState(1),[_,j]=y.useState(null),[N,C]=y.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[z,q]=y.useState(null),[Q,V]=y.useState(!1),[Y,te]=y.useState(null),[Z,G]=y.useState(""),[E,H]=y.useState(""),[W,de]=y.useState(!1),[le,se]=y.useState(!1),[ce,ge]=y.useState(!1),[A,P]=y.useState(null),[fe,me]=y.useState([]),[re,w]=y.useState(null),[$,ee]=y.useState(null),[ae,xe]=y.useState([]),ve=y.useRef(null),ze=d?.is_online??!1,{rpc:Pe,importedPaths:Xe,allowedPaths:ea}=iy(l,d),ma=y.useMemo(()=>_j.map(_e=>({key:_e,label:fo[_e]?n(fo[_e]):_e})),[n]),Qe=y.useCallback(_e=>{xe(Ae=>[...Ae,`[${Nd()}] ${_e}`])},[]),et=y.useRef(null),ft=y.useCallback(_e=>{const Ae=et.current;Ae&&Ae!==_e&&(me(Fe=>Fe.includes(Ae)?Fe:[...Fe,Ae]),Qe(`${n(fo[Ae]??Ae)} ${n("sources.import.stage.done_suffix")}`)),Qe(`${n(fo[_e]??_e)}...`),et.current=_e,P(_e),ee(null)},[Qe,n]),qt=y.useCallback((_e,Ae)=>{C(Fe=>({...Fe,repoPath:_e,repoName:Ae}))},[]),Vt=y.useCallback(async()=>{V(!0),te(null);try{const _e=await Pe("fs/repoStatus",{path:N.repoPath}),Ae={branches:_e.branches??[{name:_e.branch,commit:_e.head_hash}],tags:_e.tags??[],default:_e.branch,commits:_e.commits??[{hash:_e.head_hash,message:"HEAD"}]};q(Ae),C(Fe=>({...Fe,isDirty:_e.is_dirty})),G(Fe=>{if(Fe)return Fe;const gt=Ae.branches.find(Ia=>Ia.name===Ae.default),Nt=Ae.branches[0],Ft=gt??Nt;return Ft?(H(Ft.commit),Ft.name):Fe})}catch(_e){const Ae=_e instanceof Error?_e.message:"Failed to load repository info";te(Ae)}finally{V(!1)}},[Pe,N.repoPath]);y.useEffect(()=>{v===2&&N.repoPath&&!z&&Vt()},[v,N.repoPath,z,Vt]);const ta=y.useCallback(async _e=>{try{const Ae=await Pe("fs/repoStatus",{path:N.repoPath,branch:_e});q(Fe=>Fe&&{...Fe,commits:Ae.commits??[]})}catch{}},[Pe,N.repoPath]),aa=y.useCallback(async()=>{if(!l)return;const _e=Date.now();se(!0),ge(!1),j(null),w(null),me([]),et.current=null,P(null),ee(null),xe([]),b(3);try{ft("scan");const Ae=await Pe("fs/repoScan",{path:N.repoPath,hash:E}),Fe=Ae.files||[],gt=Ae.manifests||[],Nt=cr(N.repoPath),{packages:Ft,mdFiles:Ia}=oy(gt,Fe,Nt);C(xt=>({...xt,branch:Z,commit:E,repoFiles:Fe,packages:Ft,mdFiles:Ia,repoFileContents:gt})),ft("save");const Zt=await m({library_id:l,repo_name:N.repoName||Nt,repo_root_path:N.repoPath,repo_branch:Z,repo_commit:E,repo_files:Fe.map(xt=>xt.path),repo_file_contents:gt,...p?{parent_source_id:p,parent_path:h}:{}});me(["scan","save"]),et.current=null,P(null),Qe(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),Qe(n("sources.import.stage.complete"));const kt=Array.isArray(Zt)?Zt[0]:Zt;ve.current=kt?.id??null,await cy(_e),ge(!0),se(!1),b(4)}catch(Ae){const Fe=et.current??"scan";w(Fe),et.current=null,P(null);const gt=Ae instanceof Error?Ae.message:String(Ae);Qe(`ERROR: ${gt}`),j(gt),se(!1)}},[l,N,Z,E,p,h,Pe,m,ft,Qe]),Sa=y.useCallback(()=>{w(null),j(null),aa()},[aa]),ja=y.useCallback(()=>{if(l)if(p){const _e=N.repoName||cr(N.repoPath),Ae=h?`${h}/${_e}`:_e;r(`/studio/sources/${l}?rootId=${p}&path=${encodeURIComponent(Ae)}`)}else ve.current?r(`/studio/sources/${l}?rootId=${ve.current}`):r(`/studio/sources/${l}`)},[l,r,p,h,N.repoPath,N.repoName]),Aa=y.useMemo(()=>v===1?!!N.repoPath:v===2?W:v===3?ce:!1,[v,N.repoPath,W,ce]),la=y.useMemo(()=>{if(!d)return[];const _e=[{label:d.is_default?n("sources.library.default_cloud_name"):d.name,to:`/studio/sources/${d.id}`}];if(p&&(_e.push({label:g||p,to:`/studio/sources/${d.id}?rootId=${p}`}),h)){const Ae=h.split("/").filter(Boolean);for(const[Fe,gt]of Ae.entries()){const Nt=Ae.slice(0,Fe+1).join("/");_e.push({label:gt,to:`/studio/sources/${d.id}?rootId=${p}&path=${encodeURIComponent(Nt)}`})}}return _e.push({label:n("sources.import.title")}),_e},[d,p,g,h,n]);if(!d)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const ia=v===4,pt=v===3&&!!re&&!le,oa=v<=2;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ls,{segments:la})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(mn,{active:v>=1,current:v===1}),u.jsx("span",{className:v===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),u.jsx(Mr,{}),u.jsx(mn,{active:v>=2,current:v===2}),u.jsx("span",{className:v===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),u.jsx(Mr,{}),u.jsx(mn,{active:v>=3,current:v===3}),u.jsx("span",{className:v===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.loading")}),u.jsx(Mr,{}),u.jsx(mn,{active:v>=4,current:v===4}),u.jsx("span",{className:v===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),u.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:ze?u.jsxs(u.Fragment,{children:[v===1&&u.jsx(fj,{rpc:Pe,selectedPath:N.repoPath,onSelect:qt,allowedPaths:ea,importedPaths:Xe}),v===2&&u.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:u.jsx(my,{refs:z,loading:Q,error:Y,selectedRef:Z,commit:E,onRefChange:G,onCommitChange:H,onValidChange:de,onRetry:Vt,onBranchSwitch:ta})}),v===3&&u.jsx(hy,{stages:ma,currentStage:A,completedStages:fe,failedStage:re,progress:$,breakpoints:Sj,failedError:_,logs:ae}),v===4&&u.jsx(py,{repoName:N.repoName||cr(N.repoPath),repoIdentifier:N.repoPath,branch:Z,commit:E,packages:N.packages,mdFiles:N.mdFiles,importing:!1,completed:ce})]}):u.jsx(ly,{libraryName:d.name})}),ze&&u.jsx(u.Fragment,{children:ia?u.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:u.jsx("button",{onClick:ja,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.done")})}):pt?u.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[u.jsx("button",{onClick:()=>{b(2),w(null),j(null),me([]),et.current=null,P(null),xe([])},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.back")}),u.jsx("button",{onClick:Sa,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.retry")})]}):oa?u.jsx(Bd,{step:v,totalSteps:4,importing:le,stepBusy:Q||v===3&&le,canProceed:Aa,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>b(_e=>_e-1),onNext:()=>{v===2?aa():b(_e=>_e+1)},onImport:aa}):null}),_&&v!==3&&u.jsxs(Ln,{onClose:()=>j(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:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),u.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:_}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.jsx("button",{onClick:()=>j(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 ex=(n,r)=>{let l=0,i=0,o=0;const d=[],m=p=>{for(const g of p)if(g.type==="directory")i++,g.is_git_repo&&o++,g.children&&m(g.children);else if(l++,/\.md$/i.test(g.name)){const h=g.path.startsWith(r)?g.path.slice(r.length).replace(/^\//,""):g.name;d.push(h)}};return m(n),{files:l,dirs:i,gitRepos:o,mdFiles:d}};function Nj({rpc:n,selectedPath:r,onSelect:l,allowedPaths:i,importedPaths:o}){const{t:d}=Ne(),{atRoot:m,currentPath:p,entries:g,loading:h,error:v,homeDir:b,goToOpen:_,isWildcard:j,importedSet:N,dirs:C,files:z,loadTree:q,handleNavigateUp:Q,setGoToOpen:V}=fy({rpc:n,allowedPaths:i??[],importedPaths:o??[]}),Y=y.useCallback(E=>{if(E.type!=="directory"||N.has(E.path))return;const H=ex(E.children||[],E.path);l(E.path,E.name,H),q(E.path)},[l,q,N]);y.useEffect(()=>{if(p&&!m&&g.length>=0&&!h){const E=p.split("/").pop()||p,H=ex(g,p);l(p,E,H)}},[p,m,g,h,l]);const te=y.useMemo(()=>r?r.split("/").pop()||r:"",[r]),Z=y.useMemo(()=>C.sort((E,H)=>E.is_git_repo&&!H.is_git_repo?-1:!E.is_git_repo&&H.is_git_repo?1:E.name.localeCompare(H.name)),[C]),G=y.useMemo(()=>z.sort((E,H)=>E.name.localeCompare(H.name)),[z]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m?u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[u.jsx("span",{children:d("sources.import.allowed_dirs")}),u.jsx(uy,{})]}):u.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:p}),r?u.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[u.jsx(Xa,{size:12}),u.jsx("span",{children:te})]}):j&&m?u.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:d("sources.import.wildcard_goto")}):null]}),u.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?j?u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:b&&u.jsxs("button",{onClick:()=>q(b),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:[u.jsx(Xa,{size:14,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:[b,u.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",d("sources.import.wildcard_home"),")"]})]}),u.jsx(Qt,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(E=>u.jsxs("button",{onClick:()=>q(E),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:[u.jsx(Xa,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:E}),u.jsx(Qt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},E))}):v&&!h?u.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):u.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&u.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:u.jsx(va,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&u.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:[u.jsx(Xa,{size:14}),u.jsx("span",{children:".."})]}),Z.map(E=>{const H=N.has(E.path),W=E.is_git_repo?Ro:Xa;return u.jsxs("button",{onClick:()=>Y(E),disabled:H||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${H?"cursor-not-allowed text-c4a-accent/60":r===E.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[u.jsx(W,{size:14,className:"shrink-0"}),u.jsx("span",{className:"flex-1 truncate",children:E.name}),H&&u.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:d("sources.import.already_imported")}),u.jsx(Qt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},E.path)}),G.map(E=>u.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[u.jsx(Jx,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:E.name})]},E.path)),g.length===0&&!h&&u.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:d("sources.import.no_entries")})]}),u.jsx(dy,{open:_,onClose:()=>V(!1),rpc:n,onNavigate:q,defaultPath:b??void 0})]})}const wj=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),Ej=n=>{let r=0,l=0,i=0,o=0,d=0;const m=new Set;for(const p of n)if(p.type==="directory")l++,p.is_git_repo&&d++;else{r++,p.path.toLowerCase().endsWith(".md")&&o++;const h=p.path.split("/").pop();if(h&&wj.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:r,totalDirs:l,codePackages:i,docFiles:o,gitRepos:d}};function Cj({dirPath:n,rpc:r,importing:l,onScanComplete:i,onBusyChange:o}){const{t:d}=Ne(),[m,p]=y.useState(!1),[g,h]=y.useState(null),[v,b]=y.useState(null),_=y.useCallback(async()=>{p(!0),o?.(!0),h(null),b(null);try{const j=await r("fs/dirScan",{path:n}),N=j.entries||[],C=j.manifests||[],z=Ej(N);b(z),i(N,z,C)}catch(j){const N=j instanceof Error?j.message:String(j);h(N)}finally{p(!1),o?.(!1)}},[n,r,i,o]);return y.useEffect(()=>{_()},[_]),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[u.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:n}),u.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),u.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[m&&u.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[u.jsx(va,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:d("sources.import.dir_scanning")})]}),g&&u.jsxs("div",{className:"mt-6",children:[u.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[u.jsx(Fx,{size:14,className:"mt-0.5 shrink-0"}),d("sources.import.dir_scan_error")]}),u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:g}),u.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:[u.jsx(SS,{size:12}),d("sources.import.dir_scan_retry")]})]}),v&&!m&&!g&&u.jsxs("div",{className:"mt-6 space-y-3",children:[u.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[d("sources.import.dir_scan_complete"),"!"]}),u.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[u.jsx(An,{icon:u.jsx(dr,{size:14}),label:d("sources.import.dir_doc_files"),value:v.docFiles,tooltip:d("sources.import.dir_doc_files_tip"),size:"lg"}),u.jsx(An,{icon:u.jsx(zs,{size:14}),label:d("sources.import.dir_code_packages"),value:v.codePackages,tooltip:d("sources.import.dir_code_packages_tip"),size:"lg"}),v.gitRepos>0&&u.jsx(An,{icon:u.jsx(Ro,{size:14}),label:d("sources.import.dir_git_repos"),value:v.gitRepos,size:"lg"}),u.jsx(An,{icon:u.jsx(Xa,{size:14}),label:d("sources.import.dir_total_dirs"),value:v.totalDirs,size:"lg"}),u.jsx(An,{icon:u.jsx(B_,{size:14}),label:d("sources.import.dir_total_files"),value:v.totalFiles,size:"lg"})]}),v.gitRepos>0&&u.jsx("p",{className:"text-xs text-c4a-warning",children:d("sources.import.dir_git_skip_hint",{count:v.gitRepos})})]}),l&&u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[u.jsx(va,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:d("sources.import.importing")})]})]})]})}function Rj(){const{t:n}=Ne(),r=_a(),{libId:l}=Kl(),o=$t(Br(Ms)).find(H=>H.id===l),d=zo(H=>H.createSource),[m,p]=y.useState(1),[g,h]=y.useState(!1),[v,b]=y.useState(null),[_,j]=y.useState(!1),[N,C]=y.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),z=o?.is_online??!1,{rpc:q,importedPaths:Q,allowedPaths:V}=iy(l,o),Y=y.useCallback((H,W,de)=>{C(le=>({...le,dirPath:H,dirName:W,fileCount:de.files,subDirCount:de.dirs,gitRepoCount:de.gitRepos,mdFiles:de.mdFiles}))},[]),te=y.useCallback((H,W,de)=>{C(le=>({...le,scanEntries:H,scanStats:W,manifests:de}))},[]),Z=y.useCallback(async()=>{if(l){h(!0);try{const H=await d({library_id:l,dir_files:N.scanEntries,dir_name:N.dirName,dir_path:N.dirPath,dir_file_contents:N.manifests}),W=Array.isArray(H)?H[0]:H;W?.id?r(`/studio/sources/${l}?rootId=${W.id}`):r(`/studio/sources/${l}`)}catch(H){const W=H instanceof Error?H.message:String(H);b(W),h(!1)}}},[l,N,d,r]),G=y.useMemo(()=>m===1?!!N.dirPath:m===2?N.scanEntries.length>0:!0,[m,N]),E=y.useMemo(()=>o?[{label:o.is_default?n("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:n("sources.import.dir_title")}]:[],[o,n]);return o?u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ls,{segments:E})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(mn,{active:m>=1,current:m===1}),u.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.select")}),u.jsx(Mr,{}),u.jsx(mn,{active:m>=2,current:m===2}),u.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.confirm")})]}),u.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:z?u.jsxs(u.Fragment,{children:[m===1&&u.jsx(Nj,{rpc:q,selectedPath:N.dirPath,onSelect:Y,allowedPaths:V,importedPaths:Q}),m===2&&u.jsx(Cj,{dirPath:N.dirPath,rpc:q,importing:g,onScanComplete:te,onBusyChange:j})]}):u.jsx(ly,{libraryName:o.name})}),z&&u.jsx(Bd,{step:m,totalSteps:2,importing:g,stepBusy:_,canProceed:G,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>p(H=>H-1),onNext:()=>p(H=>H+1),onImport:Z}),v&&u.jsxs(Ln,{onClose:()=>b(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:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),u.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.jsx("button",{onClick:()=>b(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")})})]})]}):u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const kj=/^https:\/\/[^/]+\/.+/;function Tj({url:n,onUrlChange:r,onValidChange:l,onRefHint:i}){const{t:o}=Ne(),[d,m]=y.useState(null),[p,g]=y.useState([]),h=y.useRef(null);y.useEffect(()=>{lt.get("/import/remote/git-hosts").then(j=>g(j.hosts),()=>{})},[]);const v=y.useCallback(j=>{if(!j){m(null),l(!1);return}const N=uj(j),C=N.repoUrl!==j.trim(),z=C?N.repoUrl:j;C&&(r(z),i?.(N.ref,N.commit)),kj.test(z)?(m(null),l(!0)):(m(o("sources.import_remote.url_invalid")),l(!1))},[r,l,i,o]),b=y.useCallback(j=>{const N=j.target.value;r(N),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>v(N),500)},[r,v]),_=y.useCallback(j=>{j.preventDefault();const N=j.clipboardData.getData("text").trim();r(N),h.current&&clearTimeout(h.current),v(N)},[r,v]);return y.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),y.useEffect(()=>{n&&v(n)},[]),u.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface px-6 py-10",children:u.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[u.jsx("input",{type:"text",value:n,onChange:b,onPaste:_,placeholder:o("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}),u.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:d?u.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[u.jsx(Hr,{size:14,className:"shrink-0"}),d]}):u.jsxs(u.Fragment,{children:[u.jsx("p",{children:p.length>0?u.jsxs(u.Fragment,{children:[o("sources.import_remote.url_hint_public"),p.map((j,N)=>u.jsxs("span",{children:[N>0&&"、",u.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:j})]},j))]}):o("sources.import_remote.url_hint_no_auth")}),u.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:o("sources.import_remote.url_hint_format")})]})})]})})}const tx=["prepare","clone","scan","save"],mo={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"},zj={prepare:5,clone:90,scan:95,save:100};function Oj(n,r,l){if(n instanceof Ar){const i=n.message.toLowerCase();if(n.status===503)return l("sources.import_remote.error.capacity");if(i.includes("connect")||i.includes("connectionrefused")||i.includes("unavailable")||i.includes("econnrefused"))return l("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(r).hostname;return l("sources.import_remote.error.auth_required",{host:o})}catch{return l("sources.import_remote.error.auth_required",{host:r})}return i.includes("not found")||i.includes("404")||i.includes("does not exist")?l("sources.import_remote.error.not_found"):n.message||l("sources.import_remote.error.network")}return n instanceof TypeError&&n.message.includes("fetch")?l("sources.import_remote.error.network"):n instanceof Error?n.message:l("sources.import_remote.error.network")}function Dj(n){return n==="cloning"?"clone":n==="detecting"||n==="extracting"?"scan":n==="saving"?"save":n}function Aj(){const{t:n}=Ne(),r=_a(),{libId:l}=Kl(),[i]=Co(),o=i.get("url")||"",d=i.get("ref")||"",m=i.get("sourceUuid")||"",p=i.get("parentId")||"",g=i.get("parentName")||"",h=i.get("parentPath")||"",b=$t(Br(Ms)).find(Ce=>Ce.id===l),[_,j]=y.useState(new Set),N=y.useCallback(async()=>{if(l)try{const Ce=new Set;if(p){const st=(await lt.get(`/sources/${p}`)).tree??[];let X=h===""?st:[];if(h){const ie=(Oe,$e)=>{for(const Ue of Oe){if(Ue.path===$e)return Ue.children??[];if(Ue.children){const At=ie(Ue.children,$e);if(At.length>0)return At}}return[]};X=ie(st,h)}for(const ie of X)Ce.add(ie.name.toLowerCase())}else{const Le=await lt.get("/sources",{library_id:l});for(const st of Le.items)Ce.add(st.name.toLowerCase())}j(Ce)}catch{}},[l,p,h]);y.useEffect(()=>{N()},[N]);const[C,z]=y.useState(o?2:1),[q,Q]=y.useState(o),[V,Y]=y.useState(!!o),[te,Z]=y.useState(d),[G,E]=y.useState(""),[H,W]=y.useState(!!d),[de,le]=y.useState(""),se=y.useRef(void 0),ce=y.useRef(void 0),[ge,A]=y.useState(null),[P,fe]=y.useState(!1),[me,re]=y.useState(null),[w,$]=y.useState(!1),[ee,ae]=y.useState(!1),[xe,ve]=y.useState(null),[ze,Pe]=y.useState(null),[Xe,ea]=y.useState(null),[ma,Qe]=y.useState(null),[et,ft]=y.useState([]),[qt,Vt]=y.useState(null),[ta,aa]=y.useState([]),Sa=y.useRef(null),ja=y.useRef(""),Aa=y.useMemo(()=>tx.map(Ce=>({key:Ce,label:mo[Ce]?n(mo[Ce]):Ce})),[n]),la=y.useCallback(Ce=>{aa(Le=>[...Le,`[${Nd()}] ${Ce}`])},[]),ia=y.useRef(null),pt=y.useCallback(Ce=>{const Le=ia.current;Le&&Le!==Ce&&(ft(st=>st.includes(Le)?st:[...st,Le]),la(`${n(mo[Le]??Le)} ${n("sources.import.stage.done_suffix")}`)),la(`${n(mo[Ce]??Ce)}...`),ia.current=Ce,Qe(Ce),Vt(null)},[la,n]),oa=y.useCallback((Ce,Le)=>{se.current=Ce,ce.current=Le},[]),_e=y.useCallback(async Ce=>{if(l){fe(!0),re(null);try{const Le=await lt.post("/import/remote/refs",{library_id:l,url:q},Ce?{signal:Ce}:void 0);A(Le);const st=Le.branches??[],X=Le.tags??[],ie=[...st,...X];ie.length>0&&Z(Oe=>{if(Oe)return Oe;const $e=se.current,Ue=ce.current;if($e){const ua=ie.find(Ma=>Ma.name===$e);if(ua)return E(ua.commit),ua.name}Ue&&E(Ue);const ca=st.find(ua=>ua.name===Le.default)??st[0];return ca?(Ue||E(ca.commit),ca.name):Oe})}catch(Le){if(Ce?.aborted)return;re(Oj(Le,q,n))}finally{Ce?.aborted||fe(!1)}}},[l,q,n]);y.useEffect(()=>{if(C!==2||!l)return;const Ce=new AbortController;return _e(Ce.signal),()=>Ce.abort()},[C,l,_e]),y.useEffect(()=>{if(!w)return;let Ce="";return rn.on("task/progress",st=>{const X=st,ie=Dj(X.stage??"");ie&&tx.includes(ie)&&(Vt({percent:X.percent??-1,label:X.detail??X.label??""}),X.detail&&X.detail!==Ce&&(Ce=X.detail,aa(Oe=>[...Oe,`[${Nd()}] ${X.detail}`])))})},[w]);const Ae=y.useCallback(async()=>{if(!l)return;const Ce=Date.now();$(!0),ae(!1),Pe(null),ea(null),ft([]),ia.current=null,Qe(null),Vt(null),aa([]),z(3);try{pt("prepare"),await new Promise(ca=>setTimeout(ca,300)),pt("clone");const Le=cr(q),st=de||Le,X=h?`${h}/${st}`:st,ie=await lt.post("/import/remote/clone",{library_id:l,url:q,ref:te,...G?{commit:G}:{},repo_name:X});ja.current=ie.commit_hash,pt("scan");const Oe=await lt.post("/import/remote/scan",{library_id:l,path:ie.path,hash:ie.commit_hash});pt("save");const $e=await lt.post("/import/remote/import",{library_id:l,url:q,ref:te,commit:ie.commit_hash,repo_name:X,dir_name:st,repo_files:Oe.files,repo_file_contents:Oe.manifests,...m?{source_uuid:m}:{},...p?{parent_source_id:p,parent_path:h}:{}});ft(["prepare","clone","scan","save"]),ia.current=null,Qe(null),la(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),la(n("sources.import.stage.complete"));const{packages:Ue,mdFiles:At}=oy(Oe.manifests,Oe.files,Le);ve({packages:Ue,mdFiles:At}),Sa.current=$e.id,await cy(Ce),ae(!0),$(!1),z(4)}catch(Le){const st=ia.current??"prepare";ea(st),ia.current=null,Qe(null);let X;Le instanceof Ar||Le instanceof Error?X=Le.message:X=String(Le),la(`ERROR: ${X}`),Pe(X),$(!1)}},[l,q,te,G,de,m,p,h,pt,la]),Fe=y.useCallback(()=>{ea(null),Pe(null),Ae()},[Ae]),gt=y.useCallback(()=>{if(l)if(p){const Ce=cr(q),Le=de||Ce,st=h?`${h}/${Le}`:Le;r(`/studio/sources/${l}?rootId=${p}&path=${encodeURIComponent(st)}`)}else Sa.current?r(`/studio/sources/${l}?rootId=${Sa.current}`):r(`/studio/sources/${l}`)},[l,r,p,h,de,q]),Nt=(de||cr(q)).toLowerCase(),Ft=_.has(Nt),Ia=y.useMemo(()=>C===1?V:C===2?H&&!Ft:!1,[C,V,H,Ft]),Zt=y.useMemo(()=>{if(!b)return[];const Ce=[{label:b.is_default?n("sources.library.default_cloud_name"):b.name,to:`/studio/sources/${b.id}`}];if(p&&(Ce.push({label:g||p,to:`/studio/sources/${b.id}?rootId=${p}`}),h)){const Le=h.split("/").filter(Boolean);for(const[st,X]of Le.entries()){const ie=Le.slice(0,st+1).join("/");Ce.push({label:X,to:`/studio/sources/${b.id}?rootId=${p}&path=${encodeURIComponent(ie)}`})}}return Ce.push({label:n("sources.import_remote.title")}),Ce},[b,p,g,h,n]);if(!b)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const kt=C===4&&ee,xt=C===3&&!!Xe&&!w,Dt=C<=2;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ls,{segments:Zt})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(mn,{active:C>=1,current:C===1}),u.jsx("span",{className:C===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),u.jsx(Mr,{}),u.jsx(mn,{active:C>=2,current:C===2}),u.jsx("span",{className:C===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),u.jsx(Mr,{}),u.jsx(mn,{active:C>=3,current:C===3}),u.jsx("span",{className:C===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.loading")}),u.jsx(Mr,{}),u.jsx(mn,{active:C>=4,current:C===4}),u.jsx("span",{className:C===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),u.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[C===1&&u.jsx(Tj,{url:q,onUrlChange:Q,onValidChange:Y,onRefHint:oa}),C===2&&l&&u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[u.jsx(my,{refs:ge,loading:P,error:me,selectedRef:te,commit:G,onRefChange:Z,onCommitChange:E,onValidChange:W,onRetry:()=>_e()}),!P&&ge&&u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:n("sources.import.dir_name")}),u.jsx("input",{type:"text",value:de,onChange:Ce=>le(Ce.target.value),placeholder:cr(q),className:`mt-2 w-full rounded border bg-c4a-bg-surface px-3 py-2 font-mono text-sm text-c4a-accent placeholder:text-c4a-text-muted focus:outline-none ${Ft?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),Ft?u.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:n("sources.import.dir_name_duplicate")}):u.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:n("sources.import.dir_name_hint")})]})]}),C===3&&u.jsx(hy,{stages:Aa,currentStage:ma,completedStages:et,failedStage:Xe,progress:qt,breakpoints:zj,failedError:ze,logs:ta}),C===4&&u.jsx(py,{repoName:cr(q),repoIdentifier:q,branch:te,commit:ja.current,packages:xe?.packages??[],mdFiles:xe?.mdFiles??[],importing:!1,completed:ee})]}),kt?u.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:u.jsx("button",{onClick:gt,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.done")})}):xt?u.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[u.jsx("button",{onClick:()=>{z(2),ea(null),Pe(null),ft([]),ia.current=null,Qe(null),aa([])},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.back")}),u.jsx("button",{onClick:Fe,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.retry")})]}):Dt?u.jsx(Bd,{step:C,totalSteps:2,importing:!1,stepBusy:P,canProceed:Ia,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>z(Ce=>Ce-1),onNext:()=>z(Ce=>Ce+1),onImport:Ae}):null]})}function Mj(){const{t:n}=Ne(),r=_a(),l=$t(_=>_.createLibrary),[i,o]=y.useState("waiting"),[d,m]=y.useState(null),[p,g]=y.useState(""),[h,v]=y.useState(!1);y.useEffect(()=>rn.on("ws:daemon:connected",j=>{const N=j;m(N),g(N.machine_id),o(N.needs_registration?"new_client":"reconnected")}),[]),y.useEffect(()=>{let _=!1;return(async()=>{try{const j=await lt.get("/daemons/pending");if(_||j.pending.length===0)return;const N=j.pending[0];m({machine_id:N.machine_id,needs_registration:!0}),g(N.machine_id),o("new_client")}catch{}})(),()=>{_=!0}},[]);const b=y.useCallback(async()=>{if(d){v(!0);try{const _=await l({type:"daemon",name:p||d.machine_id,config:{machine_id:d.machine_id,os:d.os||"",daemon_version:d.daemon_version||""}});r(`/studio/sources/${_.id}`)}catch{v(!1)}}},[d,p,l,r]);return u.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[u.jsx(Ls,{segments:[{label:n("sources.add_client.title")}]}),u.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),u.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:u.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),u.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 ",u.jsx(ld,{text:"npm install -g @c4a/daemon"})]})]}),u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",n("sources.add_client.step2")]}),u.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}`," ",u.jsx(ld,{text:`c4a-daemon --server ${window.location.host}`})]}),u.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:n("sources.add_client.step2_allow")}),u.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} --allow ~/dir1,~/dir2`," ",u.jsx(ld,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),u.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[i==="waiting"&&u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(va,{size:16,className:"animate-spin text-c4a-warning"}),u.jsx("span",{className:"text-sm text-c4a-warning",children:n("sources.add_client.waiting")})]}),i==="new_client"&&d&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:n("sources.add_client.detected")}),u.jsxs("div",{className:"space-y-2 text-sm",children:[u.jsx(id,{label:n("sources.add_client.machine_name"),value:d.machine_id}),d.os&&u.jsx(id,{label:n("sources.add_client.os"),value:d.os}),d.daemon_version&&u.jsx(id,{label:n("sources.add_client.daemon_version"),value:d.daemon_version})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),u.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"})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx("button",{onClick:()=>r("/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")}),u.jsxs("button",{onClick:b,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&&u.jsx(va,{size:12,className:"animate-spin"}),n("sources.add_client.confirm")]})]})]}),i==="reconnected"&&d&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(fr,{size:16,className:"text-c4a-success"}),u.jsx("span",{className:"text-sm text-c4a-text-primary",children:n("sources.add_client.reconnected",{name:d.machine_id})})]}),d.lib_id&&u.jsx(Fa,{to:`/studio/sources/${d.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:d.machine_id})})]})]})]})}function ld({text:n}){const[r,l]=y.useState(!1),i=y.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},[n]);return u.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:r?u.jsx(fr,{size:13}):u.jsx(xd,{size:13})})}function id({label:n,value:r}){return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:r})]})}const gy=y.createContext(null);function xy(){const n=y.useContext(gy);if(!n)throw new Error("Tabs compound components must be used within <Tabs>");return n}function Lj({value:n,onChange:r,children:l}){return u.jsx(gy.Provider,{value:{value:n,onChange:r},children:l})}function Uj({children:n}){return u.jsx("div",{className:"flex border-b border-c4a-border-subtle",children:n})}function Hj({value:n,children:r}){const{value:l,onChange:i}=xy(),o=l===n;return u.jsx("button",{onClick:()=>i(n),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${o?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:r})}function od({value:n,children:r}){const{value:l}=xy();return l!==n?null:u.jsx(u.Fragment,{children:r})}function Bj(){const{t:n}=Ne(),{sourceUuid:r}=Kl(),[l]=Co(),i=l.get("path")||"",{currentRoot:o,loading:d,fetchRootSource:m}=zo(),p=$t(Br(Ms)),[g,h]=y.useState("original");y.useEffect(()=>{r&&m(r)},[r,m]);const v=y.useMemo(()=>o?i?To(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]),b=p.find(V=>V.id===o?.library_id),_=v?.metadata,j=_?Object.fromEntries(Object.entries(_).map(([V,Y])=>[V,String(Y??"")])):null,N=v?.source_type==="code",C=v?.name??o?.name??"",z=v?.source_type??null,q=y.useMemo(()=>{if(!o||!b)return[];const V=o.kind==="source"&&!i,Y=[{label:b.is_default?n("sources.library.default_cloud_name"):b.name,to:`/studio/sources/${b.id}`},{label:o.name,...V?{}:{to:`/studio/sources/${b.id}?rootId=${o.id}`}}];if(i){const te=Dl(o.tree,i);for(let Z=0;Z<te.length-1;Z++){const G=te[Z];Y.push({label:G.name,to:`/studio/sources/${b.id}?rootId=${o.id}&path=${encodeURIComponent(G.path)}`})}te.length>0&&Y.push({label:te[te.length-1].name})}return Y},[o,b,i,n]),Q=[{key:"original",label:n(N?"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 d||!o||!v?u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}):u.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[u.jsx(Ls,{segments:q}),u.jsxs("div",{className:"mt-4 flex flex-wrap items-baseline gap-x-6 gap-y-2",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[N?u.jsx(zs,{size:20,className:"shrink-0 text-c4a-accent"}):u.jsx(dr,{size:20,className:"shrink-0 text-c4a-accent"}),u.jsx("h1",{className:"min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:C})]}),u.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[u.jsxs("span",{children:[n("sources.detail.type"),":"," ",u.jsx("span",{className:"text-c4a-text-secondary",children:n(z==="code"?"sources.type.code":"sources.type.doc")})]}),N&&j?.relative_path&&u.jsxs("span",{children:[n("sources.detail.path"),":"," ",u.jsx("span",{className:"font-mono text-c4a-text-secondary",children:j.relative_path})]}),!N&&u.jsxs("span",{children:[n("sources.detail.origin"),":"," ",u.jsx("span",{className:"text-c4a-text-secondary",children:b?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),u.jsxs("span",{children:[n("sources.detail.status"),":"," ",u.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${v.index_status??"none"}`)})]})]})]}),N&&j&&u.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:u.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[j.repo_name&&u.jsx(ho,{label:n("sources.detail.repo"),value:j.repo_name}),j.pinned_branch&&u.jsx(ho,{label:n("sources.detail.branch"),value:j.pinned_branch}),j.pinned_hash&&u.jsx(ho,{label:n("sources.detail.commit"),value:j.pinned_hash.slice(0,7)}),j.tech_stack&&u.jsx(ho,{label:n("sources.detail.tech_stack"),value:j.tech_stack})]})}),u.jsxs(Lj,{value:g,onChange:V=>h(V),children:[u.jsx("div",{className:"mt-3",children:u.jsx(Uj,{children:Q.map(V=>u.jsx(Hj,{value:V.key,children:V.label},V.key))})}),u.jsxs("div",{className:"mt-4 flex-1",children:[u.jsx(od,{value:"original",children:u.jsx($j,{node:v,isCode:N})}),u.jsx(od,{value:"digest",children:u.jsx(ax,{message:n("sources.detail.digest_placeholder")})}),u.jsx(od,{value:"modeling",children:u.jsx(ax,{message:n("sources.detail.modeling_placeholder")})})]})]})]})}function ho({label:n,value:r}){return u.jsxs("div",{children:[u.jsx("span",{className:"text-c4a-text-muted",children:n}),u.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:r})]})}function $j({node:n,isCode:r}){const{t:l}=Ne(),i=n.metadata;return r?u.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!i?.description&&u.jsx("p",{children:String(i.description)}),!!i?.dependencies&&u.jsxs("div",{children:[u.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:l("sources.detail.dependencies")}),u.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(i.dependencies).map(([o,d])=>u.jsxs("div",{className:"flex justify-between py-0.5",children:[u.jsx("span",{className:"text-c4a-text-primary",children:o}),u.jsx("span",{className:"text-c4a-text-muted",children:d})]},o))})]}),!i?.description&&!i?.dependencies&&u.jsx("p",{className:"text-c4a-text-muted",children:l("sources.detail.original_code_placeholder")})]}):u.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:u.jsx("p",{className:"text-c4a-text-muted",children:l("sources.detail.original_doc_placeholder")})})}function ax({message:n}){return u.jsx("div",{className:"flex items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:u.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:n})})}const qj=y.lazy(()=>Md(()=>import("./ContentDetail-DVIbcpNs.js"),__vite__mapDeps([0,1])).then(n=>({default:n.ContentDetail}))),Yj=y.lazy(()=>Md(()=>import("./EntityDetail-CQNu3A3D.js"),__vite__mapDeps([2,1,3])).then(n=>({default:n.EntityDetail}))),Gj=y.lazy(()=>Md(()=>import("./RelationDetail-CZwj9HUp.js"),__vite__mapDeps([4,1,3])).then(n=>({default:n.RelationDetail}))),Vj=t_([{element:u.jsx(l2,{}),errorElement:u.jsx(Fg,{}),children:[{path:"/",element:u.jsx(p2,{})},{path:"/login",element:u.jsx(y2,{})},{path:"/auth/callback",element:u.jsx(v2,{})},{path:"/docs",element:u.jsx(_2,{})}]},{path:"/studio",element:u.jsx(h2,{}),errorElement:u.jsx(Fg,{}),children:[{index:!0,element:u.jsx(k4,{to:"/studio/sources",replace:!0})},{path:"sources",element:u.jsx(ij,{})},{path:"sources/add-client",element:u.jsx(Mj,{})},{path:"sources/import/:libId",element:u.jsx(jj,{})},{path:"sources/import-dir/:libId",element:u.jsx(Rj,{})},{path:"sources/import-remote/:libId",element:u.jsx(Aj,{})},{path:"sources/:libId",element:u.jsx(lj,{})},{path:"source/:sourceUuid",element:u.jsx(Bj,{})},{path:"contents/:hashId",element:u.jsx(y.Suspense,{fallback:null,children:u.jsx(qj,{})})},{path:"entities/:entityId",element:u.jsx(y.Suspense,{fallback:null,children:u.jsx(Yj,{})})},{path:"relations/:relationId",element:u.jsx(y.Suspense,{fallback:null,children:u.jsx(Gj,{})})},{path:"modeling",element:u.jsx(j2,{})},{path:"modeling/code/setup",element:u.jsx(D2,{})},{path:"modeling/code/compile",element:u.jsx(A2,{})},{path:"modeling/code/review",element:u.jsx(M2,{})},{path:"modeling/code/result",element:u.jsx(L2,{})},{path:"brain",element:u.jsx(N2,{})},{path:"discovery",element:u.jsx(w2,{})},{path:"sharing",element:u.jsx(E2,{})},{path:"collaboration",element:u.jsx(C2,{})},{path:"settings/api-keys",element:u.jsx(R2,{})}]},{path:"*",element:u.jsx(S2,{})}]);function Kj(){return y.useEffect(()=>{Za.getState().init();const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return rn.connect(r),()=>{rn.disconnect()}},[]),u.jsx(E4,{router:Vj})}q0.createRoot(document.getElementById("root")).render(u.jsx(y.StrictMode,{children:u.jsx(Kj,{})}));export{Ar as A,ko as E,Lj as T,Md as _,_a as a,Ne as b,Kl as c,lt as d,Uj as e,Hj as f,wv as g,od as h,Te as i,u as j,Ql as k,y as r,ey as u};
|