@c4a/server-cli 0.4.12-alpha.3 → 0.4.12-beta.15
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 +8452 -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/ContentDetail-cN2pQvDs.js +1 -0
- package/web/assets/EntityDetail-BBLfJ9LL.js +3 -0
- package/web/assets/EntityDetail-CHe5PkO9.js +1 -0
- package/web/assets/EntityDetail-CKrOvH7P.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-B2h1kYvi.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-Bol5oT-i.js +193 -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-PA09G5Gn.css +1 -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,12 @@
|
|
|
1
|
+
function cv(n,l){for(var s=0;s<l.length;s++){const i=l[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(n,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=s(o);fetch(o.href,u)}})();function uv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Au={exports:{}},_s={};var mp;function dv(){if(mp)return _s;mp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(i,o,u){var m=null;if(u!==void 0&&(m=""+u),o.key!==void 0&&(m=""+o.key),"key"in o){u={};for(var p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:n,type:i,key:m,ref:o!==void 0?o:null,props:u}}return _s.Fragment=l,_s.jsx=s,_s.jsxs=s,_s}var hp;function fv(){return hp||(hp=1,Au.exports=dv()),Au.exports}var f=fv();const De=n=>typeof n=="string",js=()=>{let n,l;const s=new Promise((i,o)=>{n=i,l=o});return s.resolve=n,s.reject=l,s},pp=n=>n==null?"":""+n,mv=(n,l,s)=>{n.forEach(i=>{l[i]&&(s[i]=l[i])})},hv=/###/g,gp=n=>n&&n.indexOf("###")>-1?n.replace(hv,"."):n,xp=n=>!n||De(n),zs=(n,l,s)=>{const i=De(l)?l.split("."):l;let o=0;for(;o<i.length-1;){if(xp(n))return{};const u=gp(i[o]);!n[u]&&s&&(n[u]=new s),Object.prototype.hasOwnProperty.call(n,u)?n=n[u]:n={},++o}return xp(n)?{}:{obj:n,k:gp(i[o])}},yp=(n,l,s)=>{const{obj:i,k:o}=zs(n,l,Object);if(i!==void 0||l.length===1){i[o]=s;return}let u=l[l.length-1],m=l.slice(0,l.length-1),p=zs(n,m,Object);for(;p.obj===void 0&&m.length;)u=`${m[m.length-1]}.${u}`,m=m.slice(0,m.length-1),p=zs(n,m,Object),p?.obj&&typeof p.obj[`${p.k}.${u}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${u}`]=s},pv=(n,l,s,i)=>{const{obj:o,k:u}=zs(n,l,Object);o[u]=o[u]||[],o[u].push(s)},ho=(n,l)=>{const{obj:s,k:i}=zs(n,l);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},gv=(n,l,s)=>{const i=ho(n,s);return i!==void 0?i:ho(l,s)},Yg=(n,l,s)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in n?De(n[i])||n[i]instanceof String||De(l[i])||l[i]instanceof String?s&&(n[i]=l[i]):Yg(n[i],l[i],s):n[i]=l[i]);return n},Tl=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var xv={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const yv=n=>De(n)?n.replace(/[&<>"'\/]/g,l=>xv[l]):n;class bv{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const s=this.regExpMap.get(l);if(s!==void 0)return s;const i=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,i),this.regExpQueue.push(l),i}}const vv=[" ",",","?","!",";"],Sv=new bv(20),_v=(n,l,s)=>{l=l||"",s=s||"";const i=vv.filter(m=>l.indexOf(m)<0&&s.indexOf(m)<0);if(i.length===0)return!0;const o=Sv.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let u=!o.test(n);if(!u){const m=n.indexOf(s);m>0&&!o.test(n.substring(0,m))&&(u=!0)}return u},nd=(n,l,s=".")=>{if(!n)return;if(n[l])return Object.prototype.hasOwnProperty.call(n,l)?n[l]:void 0;const i=l.split(s);let o=n;for(let u=0;u<i.length;){if(!o||typeof o!="object")return;let m,p="";for(let g=u;g<i.length;++g)if(g!==u&&(p+=s),p+=i[g],m=o[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;u+=g-u+1;break}o=m}return o},Ms=n=>n?.replace("_","-"),jv={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,l){console?.[n]?.apply?.(console,l)}};class po{constructor(l,s={}){this.init(l,s)}init(l,s={}){this.prefix=s.prefix||"i18next:",this.logger=l||jv,this.options=s,this.debug=s.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,s,i,o){return o&&!this.debug?null:(De(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[s](l))}create(l){return new po(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new po(this.logger,l)}}var un=new po;class yo{constructor(){this.observers={}}on(l,s){return l.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(s)||0;this.observers[i].set(s,o+1)}),this}off(l,s){if(this.observers[l]){if(!s){delete this.observers[l];return}this.observers[l].delete(s)}}emit(l,...s){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o.apply(o,[l,...s])})}}class bp extends yo{constructor(l,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const s=this.options.ns.indexOf(l);s>-1&&this.options.ns.splice(s,1)}getResource(l,s,i,o={}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,m=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;l.indexOf(".")>-1?p=l.split("."):(p=[l,s],i&&(Array.isArray(i)?p.push(...i):De(i)&&u?p.push(...i.split(u)):p.push(i)));const g=ho(this.data,p);return!g&&!s&&!i&&l.indexOf(".")>-1&&(l=p[0],s=p[1],i=p.slice(2).join(".")),g||!m||!De(i)?g:nd(this.data?.[l]?.[s],i,u)}addResource(l,s,i,o,u={silent:!1}){const m=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let p=[l,s];i&&(p=p.concat(m?i.split(m):i)),l.indexOf(".")>-1&&(p=l.split("."),o=s,s=p[1]),this.addNamespaces(s),yp(this.data,p,o),u.silent||this.emit("added",l,s,i,o)}addResources(l,s,i,o={silent:!1}){for(const u in i)(De(i[u])||Array.isArray(i[u]))&&this.addResource(l,s,u,i[u],{silent:!0});o.silent||this.emit("added",l,s,i)}addResourceBundle(l,s,i,o,u,m={silent:!1,skipCopy:!1}){let p=[l,s];l.indexOf(".")>-1&&(p=l.split("."),o=i,i=s,s=p[1]),this.addNamespaces(s);let g=ho(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?Yg(g,i,u):g={...g,...i},yp(this.data,p,g),m.silent||this.emit("added",l,s,i)}removeResourceBundle(l,s){this.hasResourceBundle(l,s)&&delete this.data[l][s],this.removeNamespaces(s),this.emit("removed",l,s)}hasResourceBundle(l,s){return this.getResource(l,s)!==void 0}getResourceBundle(l,s){return s||(s=this.options.defaultNS),this.getResource(l,s)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const s=this.getDataByLanguage(l);return!!(s&&Object.keys(s)||[]).find(o=>s[o]&&Object.keys(s[o]).length>0)}toJSON(){return this.data}}var Gg={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,l,s,i,o){return n.forEach(u=>{l=this.processors[u]?.process(l,s,i,o)??l}),l}};const Vg=Symbol("i18next/PATH_KEY");function Nv(){const n=[],l=Object.create(null);let s;return l.get=(i,o)=>(s?.revoke?.(),o===Vg?n:(n.push(o),s=Proxy.revocable(i,l),s.proxy)),Proxy.revocable(Object.create(null),l).proxy}function ld(n,l){const{[Vg]:s}=n(Nv());return s.join(l?.keySeparator??".")}const vp={},ku=n=>!De(n)&&typeof n!="boolean"&&typeof n!="number";class go extends yo{constructor(l,s={}){super(),mv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=un.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,s={interpolation:{}}){const i={...s};if(l==null)return!1;const o=this.resolve(l,i);if(o?.res===void 0)return!1;const u=ku(o.res);return!(i.returnObjects===!1&&u)}extractFromKey(l,s){let i=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=s.ns||this.options.defaultNS||[];const m=i&&l.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!_v(l,i,o);if(m&&!p){const g=l.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:l,namespaces:De(u)?[u]:u};const h=l.split(i);(i!==o||i===o&&this.options.ns.indexOf(h[0])>-1)&&(u=h.shift()),l=h.join(o)}return{key:l,namespaces:De(u)?[u]:u}}translate(l,s,i){let o=typeof s=="object"?{...s}:s;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),l==null)return"";typeof l=="function"&&(l=ld(l,{...this.options,...o})),Array.isArray(l)||(l=[String(l)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,m=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:p,namespaces:g}=this.extractFromKey(l[l.length-1],o),h=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=o.lng||this.language,j=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b?.toLowerCase()==="cimode")return j?u?{res:`${h}${v}${p}`,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:`${h}${v}${p}`:u?{res:p,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:p;const _=this.resolve(l,o);let N=_?.res;const z=_?.usedKey||p,O=_?.exactUsedKey||p,X=["[object Number]","[object Function]","[object RegExp]"],Q=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,Y=!this.i18nFormat||this.i18nFormat.handleAsObject,G=o.count!==void 0&&!De(o.count),K=go.hasDefaultValue(o),ne=G?this.pluralResolver.getSuffix(b,o.count,o):"",Z=o.ordinal&&G?this.pluralResolver.getSuffix(b,o.count,{ordinal:!1}):"",E=G&&!o.ordinal&&o.count===0,$=E&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${ne}`]||o[`defaultValue${Z}`]||o.defaultValue;let W=N;Y&&!N&&K&&(W=$);const de=ku(W),ie=Object.prototype.toString.apply(W);if(Y&&W&&de&&X.indexOf(ie)<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 re=this.options.returnedObjectHandler?this.options.returnedObjectHandler(z,W,{...o,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return u?(_.res=re,_.usedParams=this.getUsedParamsDetails(o),_):re}if(m){const re=Array.isArray(W),ue=re?[]:{},xe=re?O:z;for(const A in W)if(Object.prototype.hasOwnProperty.call(W,A)){const ee=`${xe}${m}${A}`;K&&!N?ue[A]=this.translate(ee,{...o,defaultValue:ku($)?$[A]:void 0,joinArrays:!1,ns:g}):ue[A]=this.translate(ee,{...o,joinArrays:!1,ns:g}),ue[A]===ee&&(ue[A]=W[A])}N=ue}}else if(Y&&De(Q)&&Array.isArray(N))N=N.join(Q),N&&(N=this.extendTranslation(N,l,o,i));else{let re=!1,ue=!1;!this.isValidLookup(N)&&K&&(re=!0,N=$),this.isValidLookup(N)||(ue=!0,N=p);const A=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ue?void 0:N,ee=K&&$!==N&&this.options.updateMissing;if(ue||re||ee){if(this.logger.log(ee?"updateKey":"missingKey",b,h,p,ee?$: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 ce=[];const P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&P&&P[0])for(let w=0;w<P.length;w++)ce.push(P[w]);else this.options.saveMissingTo==="all"?ce=this.languageUtils.toResolveHierarchy(o.lng||this.language):ce.push(o.lng||this.language);const Se=(w,B,F)=>{const le=K&&F!==N?F:A;this.options.missingKeyHandler?this.options.missingKeyHandler(w,h,B,le,ee,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(w,h,B,le,ee,o),this.emit("missingKey",w,h,B,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&G?ce.forEach(w=>{const B=this.pluralResolver.getSuffixes(w,o);E&&o[`defaultValue${this.options.pluralSeparator}zero`]&&B.indexOf(`${this.options.pluralSeparator}zero`)<0&&B.push(`${this.options.pluralSeparator}zero`),B.forEach(F=>{Se([w],p+F,o[`defaultValue${F}`]||$)})}):Se(ce,p,$))}N=this.extendTranslation(N,l,o,_,i),ue&&N===p&&this.options.appendNamespaceToMissingKey&&(N=`${h}${v}${p}`),(ue||re)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${v}${p}`:p,re?N:void 0,o))}return u?(_.res=N,_.usedParams=this.getUsedParamsDetails(o),_):N}extendTranslation(l,s,i,o,u){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const g=De(l)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const b=l.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}),l=this.interpolator.interpolate(l,v,i.lng||this.language||o.usedLng,i),g){const b=l.match(this.interpolator.nestingRegexp),j=b&&b.length;h<j&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...b)=>u?.[0]===b[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${b[0]} in key: ${s[0]}`),null):this.translate(...b,s),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=De(m)?[m]:m;return l!=null&&p?.length&&i.applyPostProcessor!==!1&&(l=Gg.handle(p,l,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),l}resolve(l,s={}){let i,o,u,m,p;return De(l)&&(l=[l]),l.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,s),v=h.key;o=v;let b=h.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const j=s.count!==void 0&&!De(s.count),_=j&&!s.ordinal&&s.count===0,N=s.context!==void 0&&(De(s.context)||typeof s.context=="number")&&s.context!=="",z=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);b.forEach(O=>{this.isValidLookup(i)||(p=O,!vp[`${z[0]}-${O}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(vp[`${z[0]}-${O}`]=!0,this.logger.warn(`key "${o}" for languages "${z.join(", ")}" won't get resolved as namespace "${p}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),z.forEach(X=>{if(this.isValidLookup(i))return;m=X;const Q=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(Q,v,X,O,s);else{let G;j&&(G=this.pluralResolver.getSuffix(X,s.count,s));const K=`${this.options.pluralSeparator}zero`,ne=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(j&&(s.ordinal&&G.indexOf(ne)===0&&Q.push(v+G.replace(ne,this.options.pluralSeparator)),Q.push(v+G),_&&Q.push(v+K)),N){const Z=`${v}${this.options.contextSeparator||"_"}${s.context}`;Q.push(Z),j&&(s.ordinal&&G.indexOf(ne)===0&&Q.push(Z+G.replace(ne,this.options.pluralSeparator)),Q.push(Z+G),_&&Q.push(Z+K))}}let Y;for(;Y=Q.pop();)this.isValidLookup(i)||(u=Y,i=this.getResource(X,O,Y,s))}))})}),{res:i,usedKey:o,exactUsedKey:u,usedLng:m,usedNS:p}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,s,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,s,i,o):this.resourceStore.getResource(l,s,i,o)}getUsedParamsDetails(l={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=l.replace&&!De(l.replace);let o=i?l.replace:l;if(i&&typeof l.count<"u"&&(o.count=l.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const u of s)delete o[u]}return o}static hasDefaultValue(l){const s="defaultValue";for(const i in l)if(Object.prototype.hasOwnProperty.call(l,i)&&s===i.substring(0,s.length)&&l[i]!==void 0)return!0;return!1}}class Sp{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=un.create("languageUtils")}getScriptPartFromCode(l){if(l=Ms(l),!l||l.indexOf("-")<0)return null;const s=l.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(l){if(l=Ms(l),!l||l.indexOf("-")<0)return l;const s=l.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(l){if(De(l)&&l.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(l)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let s;return l.forEach(i=>{if(s)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(s=o)}),!s&&this.options.supportedLngs&&l.forEach(i=>{if(s)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return s=o;const u=this.getLanguagePartFromCode(i);if(this.isSupportedCode(u))return s=u;s=this.options.supportedLngs.find(m=>{if(m===u)return m;if(!(m.indexOf("-")<0&&u.indexOf("-")<0)&&(m.indexOf("-")>0&&u.indexOf("-")<0&&m.substring(0,m.indexOf("-"))===u||m.indexOf(u)===0&&u.length>1))return m})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(l,s){if(!l)return[];if(typeof l=="function"&&(l=l(s)),De(l)&&(l=[l]),Array.isArray(l))return l;if(!s)return l.default||[];let i=l[s];return i||(i=l[this.getScriptPartFromCode(s)]),i||(i=l[this.formatLanguageCode(s)]),i||(i=l[this.getLanguagePartFromCode(s)]),i||(i=l.default),i||[]}toResolveHierarchy(l,s){const i=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],l),o=[],u=m=>{m&&(this.isSupportedCode(m)?o.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return De(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(l))):De(l)&&u(this.formatLanguageCode(l)),i.forEach(m=>{o.indexOf(m)<0&&u(this.formatLanguageCode(m))}),o}}const _p={zero:0,one:1,two:2,few:3,many:4,other:5},jp={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class wv{constructor(l,s={}){this.languageUtils=l,this.options=s,this.logger=un.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(l,s={}){const i=Ms(l==="dev"?"en":l),o=s.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:i,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let m;try{m=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),jp;if(!l.match(/-|_/))return jp;const g=this.languageUtils.getLanguagePartFromCode(l);m=this.getRule(g,s)}return this.pluralRulesCache[u]=m,m}needsPlural(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,s,i={}){return this.getSuffixes(l,i).map(o=>`${s}${o}`)}getSuffixes(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort((o,u)=>_p[o]-_p[u]).map(o=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(l,s,i={}){const o=this.getRule(l,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(s)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",s,i))}}const Np=(n,l,s,i=".",o=!0)=>{let u=gv(n,l,s);return!u&&o&&De(s)&&(u=nd(n,s,i),u===void 0&&(u=nd(l,s,i))),u},Lu=n=>n.replace(/\$/g,"$$$$");class wp{constructor(l={}){this.logger=un.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(s=>s),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:o,prefix:u,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:j,nestingPrefixEscaped:_,nestingSuffix:N,nestingSuffixEscaped:z,nestingOptionsSeparator:O,maxReplaces:X,alwaysFormat:Q}=l.interpolation;this.escape=s!==void 0?s:yv,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?Tl(u):m||"{{",this.suffix=p?Tl(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=j?Tl(j):_||Tl("$t("),this.nestingSuffix=N?Tl(N):z||Tl(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=X||1e3,this.alwaysFormat=Q!==void 0?Q:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(s,i)=>s?.source===i?(s.lastIndex=0,s):new RegExp(i,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,s,i,o){let u,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=_=>{if(_.indexOf(this.formatSeparator)<0){const X=Np(s,g,_,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(X,void 0,i,{...o,...s,interpolationkey:_}):X}const N=_.split(this.formatSeparator),z=N.shift().trim(),O=N.join(this.formatSeparator).trim();return this.format(Np(s,g,z,this.options.keySeparator,this.options.ignoreJSONStructure),O,i,{...o,...s,interpolationkey:z})};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:_=>Lu(_)},{regex:this.regexp,safeValue:_=>this.escapeValue?Lu(this.escape(_)):Lu(_)}].forEach(_=>{for(p=0;u=_.regex.exec(l);){const N=u[1].trim();if(m=h(N),m===void 0)if(typeof v=="function"){const O=v(l,u,o);m=De(O)?O:""}else if(o&&Object.prototype.hasOwnProperty.call(o,N))m="";else if(b){m=u[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${l}`),m="";else!De(m)&&!this.useRawValueToEscape&&(m=pp(m));const z=_.safeValue(m);if(l=l.replace(u[0],z),b?(_.regex.lastIndex+=m.length,_.regex.lastIndex-=u[0].length):_.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),l}nest(l,s,i={}){let o,u,m;const p=(g,h)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const b=g.split(new RegExp(`${Tl(v)}[ ]*{`));let j=`{${b[1]}`;g=b[0],j=this.interpolate(j,m);const _=j.match(/'/g),N=j.match(/"/g);((_?.length??0)%2===0&&!N||(N?.length??0)%2!==0)&&(j=j.replace(/'/g,'"'));try{m=JSON.parse(j),h&&(m={...h,...m})}catch(z){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,z),`${g}${v}${j}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;o=this.nestingRegexp.exec(l);){let g=[];m={...i},m=m.replace&&!De(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;const h=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(h!==-1&&(g=o[1].slice(h).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),o[1]=o[1].slice(0,h)),u=s(p.call(this,o[1].trim(),m),m),u&&o[0]===l&&!De(u))return u;De(u)||(u=pp(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${l}`),u=""),g.length&&(u=g.reduce((v,b)=>this.format(v,b,i.lng,{...i,interpolationkey:o[1].trim()}),u.trim())),l=l.replace(o[0],u),this.regexp.lastIndex=0}return l}}const Ev=n=>{let l=n.toLowerCase().trim();const s={};if(n.indexOf("(")>-1){const i=n.split("(");l=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);l==="currency"&&o.indexOf(":")<0?s.currency||(s.currency=o.trim()):l==="relativetime"&&o.indexOf(":")<0?s.range||(s.range=o.trim()):o.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),v=p.trim();s[v]||(s[v]=h),h==="false"&&(s[v]=!1),h==="true"&&(s[v]=!0),isNaN(h)||(s[v]=parseInt(h,10))}})}return{formatName:l,formatOptions:s}},Ep=n=>{const l={};return(s,i,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const m=i+JSON.stringify(u);let p=l[m];return p||(p=n(Ms(i),o),l[m]=p),p(s)}},Cv=n=>(l,s,i)=>n(Ms(s),i)(l);class Rv{constructor(l={}){this.logger=un.create("formatter"),this.options=l,this.init(l)}init(l,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?Ep:Cv;this.formats={number:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u});return p=>m.format(p)}),currency:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u,style:"currency"});return p=>m.format(p)}),datetime:i((o,u)=>{const m=new Intl.DateTimeFormat(o,{...u});return p=>m.format(p)}),relativetime:i((o,u)=>{const m=new Intl.RelativeTimeFormat(o,{...u});return p=>m.format(p,u.range||"day")}),list:i((o,u)=>{const m=new Intl.ListFormat(o,{...u});return p=>m.format(p)})}}add(l,s){this.formats[l.toLowerCase().trim()]=s}addCached(l,s){this.formats[l.toLowerCase().trim()]=Ep(s)}format(l,s,i,o={}){const u=s.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(p=>p.indexOf(")")>-1)){const p=u.findIndex(g=>g.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,p)].join(this.formatSeparator)}return u.reduce((p,g)=>{const{formatName:h,formatOptions:v}=Ev(g);if(this.formats[h]){let b=p;try{const j=o?.formatParams?.[o.interpolationkey]||{},_=j.locale||j.lng||o.locale||o.lng||i;b=this.formats[h](p,_,{...v,...o,...j})}catch(j){this.logger.warn(j)}return b}else this.logger.warn(`there was no format function for ${h}`);return p},l)}}const Tv=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class zv extends yo{constructor(l,s,i,o={}){super(),this.backend=l,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=un.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,o.backend,o)}queueLoad(l,s,i,o){const u={},m={},p={},g={};return l.forEach(h=>{let v=!0;s.forEach(b=>{const j=`${h}|${b}`;!i.reload&&this.store.hasResourceBundle(h,b)?this.state[j]=2:this.state[j]<0||(this.state[j]===1?m[j]===void 0&&(m[j]=!0):(this.state[j]=1,v=!1,m[j]===void 0&&(m[j]=!0),u[j]===void 0&&(u[j]=!0),g[b]===void 0&&(g[b]=!0)))}),v||(p[h]=!0)}),(Object.keys(u).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(l,s,i){const o=l.split("|"),u=o[0],m=o[1];s&&this.emit("failedLoading",u,m,s),!s&&i&&this.store.addResourceBundle(u,m,i,void 0,void 0,{skipCopy:!0}),this.state[l]=s?-1:2,s&&i&&(this.state[l]=0);const p={};this.queue.forEach(g=>{pv(g.loaded,[u],m),Tv(g,l),s&&g.errors.push(s),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const v=g.loaded[h];v.length&&v.forEach(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(l,s,i,o=0,u=this.retryTimeout,m){if(!l.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:s,fcName:i,tried:o,wait:u,callback:m});return}this.readingCalls++;const p=(h,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const 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,l,s,i,o+1,u*2,m)},u);return}m(h,v)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(l,s);h&&typeof h.then=="function"?h.then(v=>p(null,v)).catch(p):p(null,h)}catch(h){p(h)}return}return g(l,s,p)}prepareLoading(l,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();De(l)&&(l=this.languageUtils.toResolveHierarchy(l)),De(s)&&(s=[s]);const u=this.queueLoad(l,s,i,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(m=>{this.loadOne(m)})}load(l,s,i){this.prepareLoading(l,s,{},i)}reload(l,s,i){this.prepareLoading(l,s,{reload:!0},i)}loadOne(l,s=""){const i=l.split("|"),o=i[0],u=i[1];this.read(o,u,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${s}loading namespace ${u} for language ${o} failed`,m),!m&&p&&this.logger.log(`${s}loaded namespace ${u} for language ${o}`,p),this.loaded(l,m,p)})}saveMissing(l,s,i,o,u,m={},p=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${i}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const g={...m,isUpdate:u},h=this.backend.create.bind(this.backend);if(h.length<6)try{let v;h.length===5?v=h(l,s,i,o,g):v=h(l,s,i,o),v&&typeof v.then=="function"?v.then(b=>p(null,b)).catch(p):p(null,v)}catch(v){p(v)}else h(l,s,i,o,p,g)}!l||!l[0]||this.store.addResource(l[0],s,i,o)}}}const Uu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let l={};if(typeof n[1]=="object"&&(l=n[1]),De(n[1])&&(l.defaultValue=n[1]),De(n[2])&&(l.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const s=n[3]||n[2];Object.keys(s).forEach(i=>{l[i]=s[i]})}return l},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Cp=n=>(De(n.ns)&&(n.ns=[n.ns]),De(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),De(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),ao=()=>{},Ov=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},Kg="__i18next_supportNoticeShown",Dv=()=>typeof globalThis<"u"&&!!globalThis[Kg],Mv=()=>{typeof globalThis<"u"&&(globalThis[Kg]=!0)},Av=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(l=>l?.name?.indexOf("Locize")>0||l?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(l=>l?.projectId));class Os extends yo{constructor(l={},s){if(super(),this.options=Cp(l),this.services={},this.logger=un,this.modules={external:[]},Ov(this),s&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,s),this;setTimeout(()=>{this.init(l,s)},0)}}init(l={},s){this.isInitializing=!0,typeof l=="function"&&(s=l,l={}),l.defaultNS==null&&l.ns&&(De(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=Uu();this.options={...i,...this.options,...Cp(l)},this.options.interpolation={...i.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Av(this)&&!Dv()&&(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 💙"),Mv());const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?un.init(o(this.modules.logger),this.options):un.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=Rv;const v=new Sp(this.options);this.store=new bp(this.options.resources,this.options);const b=this.services;b.logger=un,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new wv(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 wp(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new zv(o(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(_,...N)=>{this.emit(_,...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 go(this.services,this.options),this.translator.on("*",(_,...N)=>{this.emit(_,...N)}),this.modules.external.forEach(_=>{_.init&&_.init(this)})}if(this.format=this.options.interpolation.format,s||(s=ao),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=js(),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),s(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(l,s=ao){let i=s;const o=De(l)?l:this.language;if(typeof l=="function"&&(i=l),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const u=[],m=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(h=>{h!=="cimode"&&u.indexOf(h)<0&&u.push(h)})};o?m(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>m(g)),this.options.preload?.forEach?.(p=>m(p)),this.services.backendConnector.load(u,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(p)})}else i(null)}reloadResources(l,s,i){const o=js();return typeof l=="function"&&(i=l,l=void 0),typeof s=="function"&&(i=s,s=void 0),l||(l=this.languages),s||(s=this.options.ns),i||(i=ao),this.services.backendConnector.reload(l,s,u=>{o.resolve(),i(u)}),o}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&Gg.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let s=0;s<this.languages.length;s++){const i=this.languages[s];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,s){this.isLanguageChangingTo=l;const i=js();this.emit("languageChanging",l);const o=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},u=(p,g)=>{g?this.isLanguageChangingTo===l&&(o(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,i.resolve((...h)=>this.t(...h)),s&&s(p,(...h)=>this.t(...h))},m=p=>{!l&&!p&&this.services.languageDetector&&(p=[]);const g=De(p)?p:p&&p[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(De(p)?[p]:p);h&&(this.language||o(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector?.cacheUserLanguage?.(h)),this.loadResources(h,v=>{u(v,h)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(l),i}getFixedT(l,s,i){const o=(u,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([u,m].concat(p)):g={...m},g.lng=g.lng||o.lng,g.lngs=g.lngs||o.lngs,g.ns=g.ns||o.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||o.keyPrefix);const h=this.options.keySeparator||".";let v;return g.keyPrefix&&Array.isArray(u)?v=u.map(b=>(typeof b=="function"&&(b=ld(b,{...this.options,...m})),`${g.keyPrefix}${h}${b}`)):(typeof u=="function"&&(u=ld(u,{...this.options,...m})),v=g.keyPrefix?`${g.keyPrefix}${h}${u}`:u),this.t(v,g)};return De(l)?o.lng=l:o.lngs=l,o.ns=s,o.keyPrefix=i,o}t(...l){return this.translator?.translate(...l)}exists(...l){return this.translator?.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=s.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(s.precheck){const p=s.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(i,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,l)&&(!o||m(u,l)))}loadNamespaces(l,s){const i=js();return this.options.ns?(De(l)&&(l=[l]),l.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),s&&s(o)}),i):(s&&s(),Promise.resolve())}loadLanguages(l,s){const i=js();De(l)&&(l=[l]);const o=this.options.preload||[],u=l.filter(m=>o.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return u.length?(this.options.preload=o.concat(u),this.loadResources(m=>{i.resolve(),s&&s(m)}),i):(s&&s(),Promise.resolve())}dir(l){if(l||(l=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!l)return"rtl";try{const o=new Intl.Locale(l);if(o&&o.getTextInfo){const u=o.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new Sp(Uu());return l.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(i.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},s){const i=new Os(l,s);return i.createInstance=Os.createInstance,i}cloneInstance(l={},s=ao){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const o={...this.options,...l,isClone:!0},u=new Os(o);if((l.debug!==void 0||l.prefix!==void 0)&&(u.logger=u.logger.clone(l)),["store","services","language"].forEach(p=>{u[p]=this[p]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},i){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},g[h]=Object.keys(g[h]).reduce((v,b)=>(v[b]={...g[h][b]},v),g[h]),g),{});u.store=new bp(p,o),u.services.resourceStore=u.store}if(l.interpolation){const g={...Uu().interpolation,...this.options.interpolation,...l.interpolation},h={...o,interpolation:g};u.services.interpolator=new wp(h)}return u.translator=new go(u.services,o),u.translator.on("*",(p,...g)=>{u.emit(p,...g)}),u.init(o,s),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ia=Os.createInstance();ia.createInstance;ia.dir;ia.init;ia.loadResources;ia.reloadResources;ia.use;ia.changeLanguage;ia.getFixedT;ia.t;ia.exists;ia.setDefaultNamespace;ia.hasLoadedNamespace;ia.loadNamespaces;ia.loadLanguages;var Hu={exports:{}},Ae={};var Rp;function kv(){if(Rp)return Ae;Rp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),j=Symbol.iterator;function _(w){return w===null||typeof w!="object"?null:(w=j&&w[j]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,O={};function X(w,B,F){this.props=w,this.context=B,this.refs=O,this.updater=F||N}X.prototype.isReactComponent={},X.prototype.setState=function(w,B){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,B,"setState")},X.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function Q(){}Q.prototype=X.prototype;function Y(w,B,F){this.props=w,this.context=B,this.refs=O,this.updater=F||N}var G=Y.prototype=new Q;G.constructor=Y,z(G,X.prototype),G.isPureReactComponent=!0;var K=Array.isArray;function ne(){}var Z={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function $(w,B,F){var le=F.ref;return{$$typeof:n,type:w,key:B,ref:le!==void 0?le:null,props:F}}function W(w,B){return $(w.type,B,w.props)}function de(w){return typeof w=="object"&&w!==null&&w.$$typeof===n}function ie(w){var B={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(F){return B[F]})}var re=/\/+/g;function ue(w,B){return typeof w=="object"&&w!==null&&w.key!=null?ie(""+w.key):B.toString(36)}function xe(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(ne,ne):(w.status="pending",w.then(function(B){w.status==="pending"&&(w.status="fulfilled",w.value=B)},function(B){w.status==="pending"&&(w.status="rejected",w.reason=B)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function A(w,B,F,le,pe){var Ne=typeof w;(Ne==="undefined"||Ne==="boolean")&&(w=null);var we=!1;if(w===null)we=!0;else switch(Ne){case"bigint":case"string":case"number":we=!0;break;case"object":switch(w.$$typeof){case n:case l:we=!0;break;case v:return we=w._init,A(we(w._payload),B,F,le,pe)}}if(we)return pe=pe(w),we=le===""?"."+ue(w,0):le,K(pe)?(F="",we!=null&&(F=we.replace(re,"$&/")+"/"),A(pe,B,F,"",function(xa){return xa})):pe!=null&&(de(pe)&&(pe=W(pe,F+(pe.key==null||w&&w.key===pe.key?"":(""+pe.key).replace(re,"$&/")+"/")+we)),B.push(pe)),1;we=0;var ut=le===""?".":le+":";if(K(w))for(var Be=0;Be<w.length;Be++)le=w[Be],Ne=ut+ue(le,Be),we+=A(le,B,F,Ne,pe);else if(Be=_(w),typeof Be=="function")for(w=Be.call(w),Be=0;!(le=w.next()).done;)le=le.value,Ne=ut+ue(le,Be++),we+=A(le,B,F,Ne,pe);else if(Ne==="object"){if(typeof w.then=="function")return A(xe(w),B,F,le,pe);throw B=String(w),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return we}function ee(w,B,F){if(w==null)return w;var le=[],pe=0;return A(w,le,"","",function(Ne){return B.call(F,Ne,pe++)}),le}function ce(w){if(w._status===-1){var B=w._result;B=B(),B.then(function(F){(w._status===0||w._status===-1)&&(w._status=1,w._result=F)},function(F){(w._status===0||w._status===-1)&&(w._status=2,w._result=F)}),w._status===-1&&(w._status=0,w._result=B)}if(w._status===1)return w._result.default;throw w._result}var P=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=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(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},Se={map:ee,forEach:function(w,B,F){ee(w,function(){B.apply(this,arguments)},F)},count:function(w){var B=0;return ee(w,function(){B++}),B},toArray:function(w){return ee(w,function(B){return B})||[]},only:function(w){if(!de(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Ae.Activity=b,Ae.Children=Se,Ae.Component=X,Ae.Fragment=s,Ae.Profiler=o,Ae.PureComponent=Y,Ae.StrictMode=i,Ae.Suspense=g,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(w){return Z.H.useMemoCache(w)}},Ae.cache=function(w){return function(){return w.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(w,B,F){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var le=z({},w.props),pe=w.key;if(B!=null)for(Ne in B.key!==void 0&&(pe=""+B.key),B)!E.call(B,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&B.ref===void 0||(le[Ne]=B[Ne]);var Ne=arguments.length-2;if(Ne===1)le.children=F;else if(1<Ne){for(var we=Array(Ne),ut=0;ut<Ne;ut++)we[ut]=arguments[ut+2];le.children=we}return $(w.type,pe,le)},Ae.createContext=function(w){return w={$$typeof:m,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:u,_context:w},w},Ae.createElement=function(w,B,F){var le,pe={},Ne=null;if(B!=null)for(le in B.key!==void 0&&(Ne=""+B.key),B)E.call(B,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(pe[le]=B[le]);var we=arguments.length-2;if(we===1)pe.children=F;else if(1<we){for(var ut=Array(we),Be=0;Be<we;Be++)ut[Be]=arguments[Be+2];pe.children=ut}if(w&&w.defaultProps)for(le in we=w.defaultProps,we)pe[le]===void 0&&(pe[le]=we[le]);return $(w,Ne,pe)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(w){return{$$typeof:p,render:w}},Ae.isValidElement=de,Ae.lazy=function(w){return{$$typeof:v,_payload:{_status:-1,_result:w},_init:ce}},Ae.memo=function(w,B){return{$$typeof:h,type:w,compare:B===void 0?null:B}},Ae.startTransition=function(w){var B=Z.T,F={};Z.T=F;try{var le=w(),pe=Z.S;pe!==null&&pe(F,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(ne,P)}catch(Ne){P(Ne)}finally{B!==null&&F.types!==null&&(B.types=F.types),Z.T=B}},Ae.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},Ae.use=function(w){return Z.H.use(w)},Ae.useActionState=function(w,B,F){return Z.H.useActionState(w,B,F)},Ae.useCallback=function(w,B){return Z.H.useCallback(w,B)},Ae.useContext=function(w){return Z.H.useContext(w)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(w,B){return Z.H.useDeferredValue(w,B)},Ae.useEffect=function(w,B){return Z.H.useEffect(w,B)},Ae.useEffectEvent=function(w){return Z.H.useEffectEvent(w)},Ae.useId=function(){return Z.H.useId()},Ae.useImperativeHandle=function(w,B,F){return Z.H.useImperativeHandle(w,B,F)},Ae.useInsertionEffect=function(w,B){return Z.H.useInsertionEffect(w,B)},Ae.useLayoutEffect=function(w,B){return Z.H.useLayoutEffect(w,B)},Ae.useMemo=function(w,B){return Z.H.useMemo(w,B)},Ae.useOptimistic=function(w,B){return Z.H.useOptimistic(w,B)},Ae.useReducer=function(w,B,F){return Z.H.useReducer(w,B,F)},Ae.useRef=function(w){return Z.H.useRef(w)},Ae.useState=function(w){return Z.H.useState(w)},Ae.useSyncExternalStore=function(w,B,F){return Z.H.useSyncExternalStore(w,B,F)},Ae.useTransition=function(){return Z.H.useTransition()},Ae.version="19.2.4",Ae}var Tp;function bo(){return Tp||(Tp=1,Hu.exports=kv()),Hu.exports}var y=bo();const Cr=uv(y),Lv=cv({__proto__:null,default:Cr},[y]),Uv=(n,l,s,i)=>{const o=[s,{code:l,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);Ml(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},zp={},Xg=(n,l,s,i)=>{Ml(s)&&zp[s]||(Ml(s)&&(zp[s]=new Date),Uv(n,l,s,i))},Qg=(n,l)=>()=>{if(n.isInitialized)l();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),l()};n.on("initialized",s)}},rd=(n,l,s)=>{n.loadNamespaces(l,Qg(n,s))},Op=(n,l,s,i)=>{if(Ml(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(l)>-1)return rd(n,s,i);s.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(l,Qg(n,i))},Hv=(n,l,s={})=>!l.languages||!l.languages.length?(Xg(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:s.lng,precheck:(i,o)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),Ml=n=>typeof n=="string",Bv=n=>typeof n=="object"&&n!==null,$v=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qv={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Yv=n=>qv[n],Gv=n=>n.replace($v,Yv);let sd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Gv,transDefaultProps:void 0};const Vv=(n={})=>{sd={...sd,...n}},Kv=()=>sd;let Zg;const Xv=n=>{Zg=n},Qv=()=>Zg,Zv={type:"3rdParty",init(n){Vv(n.options.react),Xv(n)}},Fv=y.createContext();class Jv{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Bu={exports:{}},$u={};var Dp;function Pv(){if(Dp)return $u;Dp=1;var n=bo();function l(b,j){return b===j&&(b!==0||1/b===1/j)||b!==b&&j!==j}var s=typeof Object.is=="function"?Object.is:l,i=n.useState,o=n.useEffect,u=n.useLayoutEffect,m=n.useDebugValue;function p(b,j){var _=j(),N=i({inst:{value:_,getSnapshot:j}}),z=N[0].inst,O=N[1];return u(function(){z.value=_,z.getSnapshot=j,g(z)&&O({inst:z})},[b,_,j]),o(function(){return g(z)&&O({inst:z}),b(function(){g(z)&&O({inst:z})})},[b]),m(_),_}function g(b){var j=b.getSnapshot;b=b.value;try{var _=j();return!s(b,_)}catch{return!0}}function h(b,j){return j()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return $u.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,$u}var Mp;function Iv(){return Mp||(Mp=1,Bu.exports=Pv()),Bu.exports}var Wv=Iv();const e0=(n,l)=>Ml(l)?l:Bv(l)&&Ml(l.defaultValue)?l.defaultValue:Array.isArray(n)?n[n.length-1]:n,t0={t:e0,ready:!1},a0=()=>()=>{},Te=(n,l={})=>{const{i18n:s}=l,{i18n:i,defaultNS:o}=y.useContext(Fv)||{},u=s||i||Qv();u&&!u.reportNamespaces&&(u.reportNamespaces=new Jv),u||Xg(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const m=y.useMemo(()=>({...Kv(),...u?.options?.react,...l}),[u,l]),{useSuspense:p,keyPrefix:g}=m,h=o||u?.options?.defaultNS,v=Ml(h)?[h]:h||["translation"],b=y.useMemo(()=>v,v);u?.reportNamespaces?.addUsedNamespaces?.(b);const j=y.useRef(0),_=y.useCallback($=>{if(!u)return a0;const{bindI18n:W,bindI18nStore:de}=m,ie=()=>{j.current+=1,$()};return W&&u.on(W,ie),de&&u.store.on(de,ie),()=>{W&&W.split(" ").forEach(re=>u.off(re,ie)),de&&de.split(" ").forEach(re=>u.store.off(re,ie))}},[u,m]),N=y.useRef(),z=y.useCallback(()=>{if(!u)return t0;const $=!!(u.isInitialized||u.initializedStoreOnce)&&b.every(xe=>Hv(xe,u,m)),W=l.lng||u.language,de=j.current,ie=N.current;if(ie&&ie.ready===$&&ie.lng===W&&ie.keyPrefix===g&&ie.revision===de)return ie;const ue={t:u.getFixedT(W,m.nsMode==="fallback"?b:b[0],g),ready:$,lng:W,keyPrefix:g,revision:de};return N.current=ue,ue},[u,b,g,m,l.lng]),[O,X]=y.useState(0),{t:Q,ready:Y}=Wv.useSyncExternalStore(_,z,z);y.useEffect(()=>{if(u&&!Y&&!p){const $=()=>X(W=>W+1);l.lng?Op(u,l.lng,b,$):rd(u,b,$)}},[u,l.lng,b,Y,p,O]);const G=u||{},K=y.useRef(null),ne=y.useRef(),Z=$=>{const W=Object.getOwnPropertyDescriptors($);W.__original&&delete W.__original;const de=Object.create(Object.getPrototypeOf($),W);if(!Object.prototype.hasOwnProperty.call(de,"__original"))try{Object.defineProperty(de,"__original",{value:$,writable:!1,enumerable:!1,configurable:!1})}catch{}return de},E=y.useMemo(()=>{const $=G,W=$?.language;let de=$;$&&(K.current&&K.current.__original===$?ne.current!==W?(de=Z($),K.current=de,ne.current=W):de=K.current:(de=Z($),K.current=de,ne.current=W));const ie=[Q,de,Y];return ie.t=Q,ie.i18n=de,ie.ready=Y,ie},[Q,G,Y,G.resolvedLanguage,G.language,G.languages]);if(u&&p&&!Y)throw new Promise($=>{const W=()=>$();l.lng?Op(u,l.lng,b,W):rd(u,b,W)});return E},{slice:n0,forEach:l0}=[];function r0(n){return l0.call(n0.call(arguments,1),l=>{if(l)for(const s in l)n[s]===void 0&&(n[s]=l[s])}),n}function s0(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(s=>s.test(n))}const Ap=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,i0=function(n,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(l);let u=`${n}=${o}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");u+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Ap.test(i.domain))throw new TypeError("option domain is invalid");u+=`; Domain=${i.domain}`}if(i.path){if(!Ap.test(i.path))throw new TypeError("option path is invalid");u+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");u+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(u+="; HttpOnly"),i.secure&&(u+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(u+="; Partitioned"),u},kp={create(n,l,s,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};s&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+s*60*1e3)),i&&(o.domain=i),document.cookie=i0(n,l,o)},read(n){const l=`${n}=`,s=document.cookie.split(";");for(let i=0;i<s.length;i++){let o=s[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(l)===0)return o.substring(l.length,o.length)}return null},remove(n,l){this.create(n,"",-1,l)}};var o0={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return kp.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:s,cookieMinutes:i,cookieDomain:o,cookieOptions:u}=l;s&&typeof document<"u"&&kp.create(s,n,i,o,u)}},c0={name:"querystring",lookup(n){let{lookupQuerystring:l}=n,s;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const u=i.substring(1).split("&");for(let m=0;m<u.length;m++){const p=u[m].indexOf("=");p>0&&u[m].substring(0,p)===l&&(s=u[m].substring(p+1))}}return s}},u0={name:"hash",lookup(n){let{lookupHash:l,lookupFromHashIndex:s}=n,i;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const u=o.substring(1);if(l){const m=u.split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===l&&(i=m[p].substring(g+1))}}if(i)return i;if(!i&&s>-1){const m=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(m)?m[typeof s=="number"?s:0]?.replace("/",""):void 0}}}return i}};let jr=null;const Lp=()=>{if(jr!==null)return jr;try{if(jr=typeof window<"u"&&window.localStorage!==null,!jr)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{jr=!1}return jr};var d0={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&Lp())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:s}=l;s&&Lp()&&window.localStorage.setItem(s,n)}};let Nr=null;const Up=()=>{if(Nr!==null)return Nr;try{if(Nr=typeof window<"u"&&window.sessionStorage!==null,!Nr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Nr=!1}return Nr};var f0={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&Up())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:s}=l;s&&Up()&&window.sessionStorage.setItem(s,n)}},m0={name:"navigator",lookup(n){const l=[];if(typeof navigator<"u"){const{languages:s,userLanguage:i,language:o}=navigator;if(s)for(let u=0;u<s.length;u++)l.push(s[u]);i&&l.push(i),o&&l.push(o)}return l.length>0?l:void 0}},h0={name:"htmlTag",lookup(n){let{htmlTag:l}=n,s;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(s=i.getAttribute("lang")),s}},p0={name:"path",lookup(n){let{lookupFromPathIndex:l}=n;if(typeof window>"u")return;const s=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof l=="number"?l:0]?.replace("/",""):void 0}},g0={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:l}=n;const s=typeof l=="number"?l+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[s]}};let Fg=!1;try{document.cookie,Fg=!0}catch{}const Jg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Fg||Jg.splice(1,1);const x0=()=>({order:Jg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Pg{constructor(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,s)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=r0(s,this.options||{},x0()),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(o0),this.addDetector(c0),this.addDetector(d0),this.addDetector(f0),this.addDetector(m0),this.addDetector(h0),this.addDetector(p0),this.addDetector(g0),this.addDetector(u0)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,s=[];return l.forEach(i=>{if(this.detectors[i]){let o=this.detectors[i].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(s=s.concat(o))}}),s=s.filter(i=>i!=null&&!s0(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?s:s.length>0?s[0]:null}cacheUserLanguage(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;s&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||s.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(l,this.options)}))}}Pg.type="languageDetector";const y0={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub · @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. All rights reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management.","page.docs.title":"Docs","page.docs.description":"Public documentation portal.","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index.","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI — only what stands up to scrutiny gets written to the knowledge graph.","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here — browse, search, analyze, and use it anytime.","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain.","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly.","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains — get notified on updates, no manual transfer needed.","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration.","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling.","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling.","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results.","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph.","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","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.library.default_cloud_name":"Personal Cloud","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.status.go_index":"Index","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain.","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge.","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Select Version","sources.import.step.confirm":"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.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory path…","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_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.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.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."},b0={"nav.home":"首页","nav.studio":"工作台","nav.docs":"文档","nav.login":"登录","nav.logout":"退出登录","header.status.connected":"已连接","header.status.disconnected":"已断开","header.status.reconnecting":"重连中","footer.copyright":"GitHub · @Context4AI {{year}}. 版权所有","footer.copyright_compact":"@Context4AI {{year}}. 版权所有","footer.tagline":"知识工厂","footer.theme.dark":"暗色","footer.theme.light":"亮色","footer.theme.system":"跟随系统","studio.sidebar.sources":"知识索引","studio.sidebar.modeling":"知识建模","studio.sidebar.brain":"知识大脑","studio.sidebar.discovery":"发现知识","studio.sidebar.sharing":"分享知识","studio.sidebar.collaboration":"知识协同","studio.sidebar.settings":"设置","placeholder.coming":"计划在 {{version}} 版本实现","page.login.title":"登录","page.login.description":"身份验证与用户管理。","page.docs.title":"文档","page.docs.description":"公开文档门户。","page.sources.title":"知识索引","page.sources.description":"添加代码仓库、文档等输入材料,让大脑完成初步索引。","page.modeling.title":"知识建模","page.modeling.description":"和 AI 一起对索引内容建模,只有经得起推敲的才写入知识图谱。","page.brain.title":"知识大脑","page.brain.description":"建模完成的全部知识都在这里——浏览、搜索、分析,随时调用。","page.discovery.title":"发现知识","page.discovery.description":"看看别人整理好的知识,发现有用的一键补充到自己的大脑。","page.sharing.title":"分享知识","page.sharing.description":"把大脑中的知识打包输出,让别人和 AI 都能直接使用。","page.collaboration.title":"知识协同","page.collaboration.description":"和其他大脑保持同步,知识更新时自动通知,不用手动搬运。","page.settings.title":"设置","page.settings.description":"管理大脑的成员和配置。","page.code_setup.title":"代码设置","page.code_setup.description":"代码建模的仓库选择与配置。","page.code_compile.title":"代码编译","page.code_compile.description":"代码建模的编译进度追踪。","page.code_review.title":"代码审查","page.code_review.description":"审查并确认建模结果。","page.code_result.title":"代码结果","page.code_result.description":"查看最终建模结果与生成的知识图谱。","home.hero.title":"Context For AI","home.hero.description":"将代码仓库和业务文档转化为结构化知识图谱。","home.hero.cta.studio":"进入工作台","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"您访问的页面不存在。","notfound.back":"返回首页","error.description":"页面出现了问题,请重试。","error.reload":"重新加载","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.library.default_cloud_name":"个人云","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"有新变更未更新索引","sources.status.go_index":"去索引","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础。","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识。","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"选择版本","sources.import.step.confirm":"导入完成","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.loading_repo":"正在加载仓库信息...","sources.import.loading_repo_slow":"大型仓库(>10 GB)可能需要 5~10 秒...","sources.import.importing":"导入中...","sources.import.error_title":"导入失败","sources.import.success":"导入完成","sources.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.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step3":"等待连接","sources.add_client.step3_desc":"连接成功后,本页面将自动更新。","sources.add_client.waiting":"等待新的客户端连接...","sources.add_client.detected":"检测到新的本地客户端","sources.add_client.machine_name":"机器标识","sources.add_client.os":"操作系统","sources.add_client.daemon_version":"Daemon 版本","sources.add_client.client_name":"客户端名称","sources.add_client.confirm":"确认添加","sources.add_client.reconnected":"客户端 {{name}} 已重新连接","sources.add_client.go_to":"前往 {{name}}","sources.detail.tab.original":"原文","sources.detail.tab.overview":"概览","sources.detail.tab.digest":"摘要","sources.detail.tab.modeling":"建模结果","sources.detail.digest_placeholder":"完成索引后,即可在此查看结构化摘要。","sources.detail.modeling_placeholder":"在推演区完成建模后,此处将展示由该源产生的知识实体。","sources.detail.type":"类型","sources.detail.origin":"来源","sources.detail.origin.upload":"直接上传","sources.detail.origin.local":"本地文件","sources.detail.path":"路径","sources.detail.status":"状态","sources.detail.repo":"仓库","sources.detail.branch":"分支","sources.detail.commit":"提交","sources.detail.tech_stack":"技术栈","sources.detail.original_code_placeholder":"完成索引后即可查看包概览。","sources.detail.original_doc_placeholder":"文档内容将在上传后展示。","sources.detail.dependencies":"依赖","sources.delete.confirm_title":"确认删除","sources.delete.resource":"确定要删除 {{name}}?","sources.delete.resource_impact":"以下数据将被永久删除:原文内容、结构化摘要(如有)。","sources.delete.session_warning":"如果你的个人推演区正在使用此知识源,相关的候选推演将受到影响。","sources.delete.entity_safe":"已汇入大脑的正式知识不受影响。","sources.delete.folder":"确定要删除文件夹 {{name}}?","sources.delete.folder_impact":"文件夹内的所有资源将被递归删除:{{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_contents":"包含 {{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","sources.delete.repo_contents":"包含 {{packages}} 个包、{{docs}} 个文档。","sources.delete.indexed_hint":"其中 {{indexed}}/{{total}} 个已建立索引,索引数据将被删除。","sources.delete.repo_impact_generic":"所有包和文档的索引记录将被删除。","sources.delete.local_safe":"本地文件不受影响。","sources.delete.client":"确定要删除客户端 {{name}}?","sources.delete.client_impact":"该客户端下的所有已导入仓库记录和相关索引数据将被删除。","sources.delete.client_reregister":"该客户端下次连接时将触发重新注册。","sources.error.name_conflict":'该目录下已存在同名项"{{name}}"。',"sources.move.current":"当前位置","sources.move.target":"移动到","sources.breadcrumb.sources":"知识索引","common.cancel":"取消","common.confirm":"确认","common.back":"返回","common.next":"下一步","common.previous":"上一步","common.items":"{{count}} 项","common.loading":"加载中...","sources.import.no_entries":"未找到任何条目","sources.import.allowed_dirs":"客户端授权目录","sources.import.allowed_dirs_tooltip_restrict":"通过参数设定有权限的目录:","sources.import.allowed_dirs_tooltip_all":"或默认允许全部目录:","sources.import.wildcard_home":"主目录","sources.import.wildcard_path_placeholder":"输入目录路径…","sources.import.wildcard_go":"前往","sources.import.wildcard_goto":"前往","sources.import.wildcard_go_title":"前往目录","sources.import.wildcard_path_not_found":"该路径在远程机器上不存在","sources.import.already_imported":"已导入","sources.import.dir_title":"导入目录","sources.import.dir_step.select":"选择目录","sources.import.dir_step.scan":"扫描","sources.import.dir_step.confirm":"确认导入","sources.import.dir_confirm_heading":"即将导入以下目录到 {{name}}:","sources.import.dir_name":"目录名","sources.import.dir_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.add":"新增","sources.actions.add_folder":"文件夹","sources.actions.add_web":"网页","sources.actions.add_feishu":"飞书文档","sources.actions.import_dir":"导入目录","sources.actions.import_repo_url":"导入仓库","sources.upgrade.title":"功能升级中","sources.upgrade.description":"此功能将在 0.5.x 版本中推出,敬请期待。","sources.upload.title":"上传文档","sources.upload.drop_hint":"点击选择文件或拖拽至此","sources.upload.supported_formats":"支持格式:.md, .doc, .docx, .pdf, .ppt, .pptx, .txt(每个最大 5MB,最多 10 个)","sources.upload.file_too_large":'"{{name}}" 超过 5MB 限制',"sources.upload.too_many_files":"最多上传 10 个文件,请重新选择","sources.upload.unsupported_type":'"{{name}}" 不是支持的文件类型',"sources.upload.uploading":"上传中...","sources.upload.success":"已上传 {{count}} 个文档","sources.upload.selected":"已选择 {{count}} 个文件","sources.upload.remove":"移除","sources.import_remote.title":"导入远程仓库","sources.import_remote.step.loading":"数据导入","sources.import_remote.url_label":"仓库地址","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"仅接受 HTTPS 地址,SSH 地址未来版本支持","sources.import_remote.url_hint_public":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务:","sources.import_remote.url_hint_no_auth":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务","sources.import_remote.url_invalid":"仅支持 HTTPS 格式的 Git URL","sources.import_remote.ref_label":"分支 / Tag","sources.import_remote.ref_branches":"分支","sources.import_remote.ref_tags":"Tag","sources.import_remote.ref_search":"搜索分支或 Tag…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"已自动填入所选分支最新 commit,也可手动输入或搜索","sources.import_remote.commit_search":"搜索 commit…","sources.import_remote.loading_refs":"正在查询仓库分支...","sources.import_remote.summary_repo":"仓库","sources.import_remote.summary_branch":"分支","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"准备执行环境","sources.import_remote.stage.clone":"克隆仓库","sources.import_remote.stage.scan":"识别项目结构","sources.import_remote.stage.save":"写入知识源","sources.import_remote.complete":"导入完成","sources.import_remote.back_to_library":"完成","sources.import_remote.retry":"重试","sources.import_remote.back":"返回","sources.import_remote.error.auth_required":"该仓库需要认证。请在 服务设置 → Git 令牌 中配置 {{host}} 的访问令牌。","sources.import_remote.error.auth_failed":"认证失败,请检查 Git 令牌配置。","sources.import_remote.error.not_found":"仓库不存在或无权访问。请检查 URL 是否正确。","sources.import_remote.error.network":"无法连接到远程仓库。请检查网络或稍后重试。","sources.import_remote.error.capacity":"当前导入任务已满,请稍后再试。","sources.import_remote.error.clone_failed":"克隆失败","sources.import_remote.error.scan_failed":"识别失败","sources.import_remote.error.save_failed":"写入失败","sources.change_detection.has_updates":"有更新","sources.change_detection.reimport":"重新导入","sources.safety.notice.remote":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。"};ia.use(Pg).use(Zv).init({resources:{en:{translation:y0},zh:{translation:b0}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var qu={exports:{}},Ns={},Yu={exports:{}},Gu={};var Hp;function v0(){return Hp||(Hp=1,(function(n){function l(A,ee){var ce=A.length;A.push(ee);e:for(;0<ce;){var P=ce-1>>>1,Se=A[P];if(0<o(Se,ee))A[P]=ee,A[ce]=Se,ce=P;else break e}}function s(A){return A.length===0?null:A[0]}function i(A){if(A.length===0)return null;var ee=A[0],ce=A.pop();if(ce!==ee){A[0]=ce;e:for(var P=0,Se=A.length,w=Se>>>1;P<w;){var B=2*(P+1)-1,F=A[B],le=B+1,pe=A[le];if(0>o(F,ce))le<Se&&0>o(pe,F)?(A[P]=pe,A[le]=ce,P=le):(A[P]=F,A[B]=ce,P=B);else if(le<Se&&0>o(pe,ce))A[P]=pe,A[le]=ce,P=le;else break e}}return ee}function o(A,ee){var ce=A.sortIndex-ee.sortIndex;return ce!==0?ce:A.id-ee.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var g=[],h=[],v=1,b=null,j=3,_=!1,N=!1,z=!1,O=!1,X=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function G(A){for(var ee=s(h);ee!==null;){if(ee.callback===null)i(h);else if(ee.startTime<=A)i(h),ee.sortIndex=ee.expirationTime,l(g,ee);else break;ee=s(h)}}function K(A){if(z=!1,G(A),!N)if(s(g)!==null)N=!0,ne||(ne=!0,ie());else{var ee=s(h);ee!==null&&xe(K,ee.startTime-A)}}var ne=!1,Z=-1,E=5,$=-1;function W(){return O?!0:!(n.unstable_now()-$<E)}function de(){if(O=!1,ne){var A=n.unstable_now();$=A;var ee=!0;try{e:{N=!1,z&&(z=!1,Q(Z),Z=-1),_=!0;var ce=j;try{t:{for(G(A),b=s(g);b!==null&&!(b.expirationTime>A&&W());){var P=b.callback;if(typeof P=="function"){b.callback=null,j=b.priorityLevel;var Se=P(b.expirationTime<=A);if(A=n.unstable_now(),typeof Se=="function"){b.callback=Se,G(A),ee=!0;break t}b===s(g)&&i(g),G(A)}else i(g);b=s(g)}if(b!==null)ee=!0;else{var w=s(h);w!==null&&xe(K,w.startTime-A),ee=!1}}break e}finally{b=null,j=ce,_=!1}ee=void 0}}finally{ee?ie():ne=!1}}}var ie;if(typeof Y=="function")ie=function(){Y(de)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,ue=re.port2;re.port1.onmessage=de,ie=function(){ue.postMessage(null)}}else ie=function(){X(de,0)};function xe(A,ee){Z=X(function(){A(n.unstable_now())},ee)}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 j},n.unstable_next=function(A){switch(j){case 1:case 2:case 3:var ee=3;break;default:ee=j}var ce=j;j=ee;try{return A()}finally{j=ce}},n.unstable_requestPaint=function(){O=!0},n.unstable_runWithPriority=function(A,ee){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var ce=j;j=A;try{return ee()}finally{j=ce}},n.unstable_scheduleCallback=function(A,ee,ce){var P=n.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?P+ce:P):ce=P,A){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=ce+Se,A={id:v++,callback:ee,priorityLevel:A,startTime:ce,expirationTime:Se,sortIndex:-1},ce>P?(A.sortIndex=ce,l(h,A),s(g)===null&&A===s(h)&&(z?(Q(Z),Z=-1):z=!0,xe(K,ce-P))):(A.sortIndex=Se,l(g,A),N||_||(N=!0,ne||(ne=!0,ie()))),A},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(A){var ee=j;return function(){var ce=j;j=ee;try{return A.apply(this,arguments)}finally{j=ce}}}})(Gu)),Gu}var Bp;function S0(){return Bp||(Bp=1,Yu.exports=v0()),Yu.exports}var Vu={exports:{}},ta={};var $p;function _0(){if($p)return ta;$p=1;var n=bo();function l(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(g,h,v){var 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 ta.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ta.createPortal=function(g,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return u(g,h,null,v)},ta.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()}},ta.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))},ta.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},ta.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var v=h.as,b=p(v,h.crossOrigin),j=typeof h.integrity=="string"?h.integrity:void 0,_=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:j,fetchPriority:_}):v==="script"&&i.d.X(g,{crossOrigin:b,integrity:j,fetchPriority:_,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ta.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)},ta.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})}},ta.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)},ta.requestFormReset=function(g){i.d.r(g)},ta.unstable_batchedUpdates=function(g,h){return g(h)},ta.useFormState=function(g,h,v){return m.H.useFormState(g,h,v)},ta.useFormStatus=function(){return m.H.useHostTransitionStatus()},ta.version="19.2.4",ta}var qp;function j0(){if(qp)return Vu.exports;qp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Vu.exports=_0(),Vu.exports}var Yp;function N0(){if(Yp)return Ns;Yp=1;var n=S0(),l=bo(),s=j0();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,r=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(r=c.return,r!==null){a=r;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return g(c),e;if(d===r)return g(c),t;d=d.sibling}throw Error(i(188))}if(a.return!==r.return)a=c,r=d;else{for(var x=!1,S=c.child;S;){if(S===a){x=!0,a=c,r=d;break}if(S===r){x=!0,r=c,a=d;break}S=S.sibling}if(!x){for(S=d.child;S;){if(S===a){x=!0,a=d,r=c;break}if(S===r){x=!0,r=d,a=c;break}S=S.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==r)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,j=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case z:return"Fragment";case X:return"Profiler";case O:return"StrictMode";case K:return"Suspense";case ne:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case Y:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var xe=Array.isArray,A=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},P=[],Se=-1;function w(e){return{current:e}}function B(e){0>Se||(e.current=P[Se],P[Se]=null,Se--)}function F(e,t){Se++,P[Se]=e.current,e.current=t}var le=w(null),pe=w(null),Ne=w(null),we=w(null);function ut(e,t){switch(F(Ne,t),F(pe,e),F(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lh(t),e=Uh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(le),F(le,e)}function Be(){B(le),B(pe),B(Ne)}function xa(e){e.memoizedState!==null&&F(we,e);var t=le.current,a=Uh(t,e.type);t!==a&&(F(pe,e),F(le,a))}function bt(e){pe.current===e&&(B(le),B(pe)),we.current===e&&(B(we),ys._currentValue=ce)}var at,Ie;function _t(e){if(at===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);at=t&&t[1]||"",Ie=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+at+e+Ie}var jt=!1;function oa(e,t){if(!e||jt)return"";jt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(q){var U=q}Reflect.construct(e,[],I)}else{try{I.call()}catch(q){U=q}e.call(I.prototype)}}else{try{throw Error()}catch(q){U=q}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(q){if(q&&U&&typeof q.stack=="string")return[q.stack,U.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),x=d[0],S=d[1];if(x&&S){var C=x.split(`
|
|
4
|
+
`),L=S.split(`
|
|
5
|
+
`);for(c=r=0;r<C.length&&!C[r].includes("DetermineComponentFrameRoot");)r++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(r===C.length||c===L.length)for(r=C.length-1,c=L.length-1;1<=r&&0<=c&&C[r]!==L[c];)c--;for(;1<=r&&0<=c;r--,c--)if(C[r]!==L[c]){if(r!==1||c!==1)do if(r--,c--,0>c||C[r]!==L[c]){var V=`
|
|
6
|
+
`+C[r].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=r&&0<=c);break}}}finally{jt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?_t(a):""}function zt(e,t){switch(e.tag){case 26:case 27:case 5:return _t(e.type);case 16:return _t("Lazy");case 13:return e.child!==t&&t!==null?_t("Suspense Fallback"):_t("Suspense");case 19:return _t("SuspenseList");case 0:case 15:return oa(e.type,!1);case 11:return oa(e.type.render,!1);case 1:return oa(e.type,!0);case 31:return _t("Activity");default:return""}}function Oa(e){try{var t="",a=null;do t+=zt(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var ya=Object.prototype.hasOwnProperty,Da=n.unstable_scheduleCallback,Vt=n.unstable_cancelCallback,na=n.unstable_shouldYield,ba=n.unstable_requestPaint,Nt=n.unstable_now,ye=n.unstable_getCurrentPriorityLevel,Oe=n.unstable_ImmediatePriority,Qe=n.unstable_UserBlockingPriority,$t=n.unstable_NormalPriority,Ot=n.unstable_LowPriority,ht=n.unstable_IdlePriority,ca=n.log,mn=n.unstable_setDisableYieldValue,Qt=null,qt=null;function wt(e){if(typeof ca=="function"&&mn(e),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(Qt,e)}catch{}}var me=Math.clz32?Math.clz32:Zt,Ue=Math.log,Ze=Math.LN2;function Zt(e){return e>>>=0,e===0?32:31-(Ue(e)/Ze|0)|0}var te=256,fe=262144,Ye=4194304;function Je(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function lt(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var c=0,d=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=r&134217727;return S!==0?(r=S&~d,r!==0?c=Je(r):(x&=S,x!==0?c=Je(x):a||(a=S&~e,a!==0&&(c=Je(a))))):(S=r&~d,S!==0?c=Je(S):x!==0?c=Je(x):a||(a=r&~e,a!==0&&(c=Je(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function la(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ma(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 Za(){var e=Ye;return Ye<<=1,(Ye&62914560)===0&&(Ye=4194304),e}function an(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function va(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $l(e,t,a,r,c,d){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var S=e.entanglements,C=e.expirationTimes,L=e.hiddenUpdates;for(a=x&~a;0<a;){var V=31-me(a),I=1<<V;S[V]=0,C[V]=-1;var U=L[V];if(U!==null)for(L[V]=null,V=0;V<U.length;V++){var q=U[V];q!==null&&(q.lane&=-536870913)}a&=~I}r!==0&&Gs(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(x&~t))}function Gs(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Vs(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-me(a),c=1<<r;c&t|e[r]&t&&(e[r]|=t),a&=~c}}function R(e,t){var a=t&-t;return a=(a&42)!==0?1:D(a),(a&(e.suspendedLanes|t))!==0?0:a}function D(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 H(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ae(){var e=ee.p;return e!==0?e:(e=window.event,e===void 0?32:sp(e.type))}function se(e,t){var a=ee.p;try{return ee.p=e,t()}finally{ee.p=a}}var be=Math.random().toString(36).slice(2),oe="__reactFiber$"+be,he="__reactProps$"+be,ge="__reactContainer$"+be,Ee="__reactEvents$"+be,Re="__reactListeners$"+be,je="__reactHandles$"+be,We="__reactResources$"+be,$e="__reactMarker$"+be;function dt(e){delete e[oe],delete e[he],delete e[Ee],delete e[Re],delete e[je]}function pt(e){var t=e[oe];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ge]||a[oe]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Vh(e);e!==null;){if(a=e[oe])return a;e=Vh(e)}return t}e=a,a=e.parentNode}return null}function Et(e){if(e=e[oe]||e[ge]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pe(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[We];return t||(t=e[We]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[$e]=!0}var kn=new Set,Fa={};function Kt(e,t){nn(e,t),nn(e+"Capture",t)}function nn(e,t){for(Fa[e]=t,e=0;e<t.length;e++)kn.add(t[e])}var dl=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={},fl={};function ql(e){return ya.call(fl,e)?!0:ya.call(ln,e)?!1:dl.test(e)?fl[e]=!0:(ln[e]=!0,!1)}function qe(e,t,a){if(ql(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Dt(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 ea(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Yl(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){a=""+x,d.call(this,x)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gl(e){if(!e._valueTracker){var t=gt(e)?"checked":"value";e._valueTracker=Yl(e,t,""+e[t])}}function Ks(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=gt(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Xs(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 ny=/[\n"\\]/g;function Aa(e){return e.replace(ny,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ro(e,t,a,r,c,d,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+kt(t)):e.value!==""+kt(t)&&(e.value=""+kt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?To(e,x,kt(t)):a!=null?To(e,x,kt(a)):r!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+kt(S):e.removeAttribute("name")}function Td(e,t,a,r,c,d,x,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Gl(e);return}a=a!=null?""+kt(a):"",t=t!=null?""+kt(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=S?e.checked:!!r,e.defaultChecked=!!r,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Gl(e)}function To(e,t,a){t==="number"&&Xs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Vl(e,t,a,r){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&r&&(e[a].defaultSelected=!0)}else{for(a=""+kt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function zd(e,t,a){if(t!=null&&(t=""+kt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+kt(a):""}function Od(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(xe(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=kt(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Gl(e)}function Kl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ly=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Dd(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||ly.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Md(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&a[c]!==r&&Dd(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&Dd(e,d,t[d])}function zo(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 ry=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"]]),sy=/^[\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 Qs(e){return sy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function hn(){}var Oo=null;function Do(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xl=null,Ql=null;function Ad(e){var t=Et(e);if(t&&(e=t.stateNode)){var a=e[he]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ro(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="'+Aa(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[he]||null;if(!c)throw Error(i(90));Ro(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Ks(r)}break e;case"textarea":zd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Vl(e,!!a.multiple,t,!1)}}}var Mo=!1;function kd(e,t,a){if(Mo)return e(t,a);Mo=!0;try{var r=e(t);return r}finally{if(Mo=!1,(Xl!==null||Ql!==null)&&(Ai(),Xl&&(t=Xl,e=Ql,Ql=Xl=null,Ad(t),e)))for(t=0;t<e.length;t++)Ad(e[t])}}function kr(e,t){var a=e.stateNode;if(a===null)return null;var r=a[he]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ao=!1;if(pn)try{var Lr={};Object.defineProperty(Lr,"passive",{get:function(){Ao=!0}}),window.addEventListener("test",Lr,Lr),window.removeEventListener("test",Lr,Lr)}catch{Ao=!1}var Ln=null,ko=null,Zs=null;function Ld(){if(Zs)return Zs;var e,t=ko,a=t.length,r,c="value"in Ln?Ln.value:Ln.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(r=1;r<=x&&t[a-r]===c[d-r];r++);return Zs=c.slice(e,1<r?1-r:void 0)}function Fs(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 Js(){return!0}function Ud(){return!1}function ua(e){function t(a,r,c,d,x){this._reactName=a,this._targetInst=c,this.type=r,this.nativeEvent=d,this.target=x,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(d):d[S]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Js:Ud,this.isPropagationStopped=Ud,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=Js)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Js)},persist:function(){},isPersistent:Js}),t}var ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ps=ua(ml),Ur=b({},ml,{view:0,detail:0}),iy=ua(Ur),Lo,Uo,Hr,Is=b({},Ur,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bo,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!==Hr&&(Hr&&e.type==="mousemove"?(Lo=e.screenX-Hr.screenX,Uo=e.screenY-Hr.screenY):Uo=Lo=0,Hr=e),Lo)},movementY:function(e){return"movementY"in e?e.movementY:Uo}}),Hd=ua(Is),oy=b({},Is,{dataTransfer:0}),cy=ua(oy),uy=b({},Ur,{relatedTarget:0}),Ho=ua(uy),dy=b({},ml,{animationName:0,elapsedTime:0,pseudoElement:0}),fy=ua(dy),my=b({},ml,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hy=ua(my),py=b({},ml,{data:0}),Bd=ua(py),gy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xy={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"},yy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function by(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yy[e])?!!t[e]:!1}function Bo(){return by}var vy=b({},Ur,{key:function(e){if(e.key){var t=gy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bo,charCode:function(e){return e.type==="keypress"?Fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Sy=ua(vy),_y=b({},Is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$d=ua(_y),jy=b({},Ur,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bo}),Ny=ua(jy),wy=b({},ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ey=ua(wy),Cy=b({},Is,{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}),Ry=ua(Cy),Ty=b({},ml,{newState:0,oldState:0}),zy=ua(Ty),Oy=[9,13,27,32],$o=pn&&"CompositionEvent"in window,Br=null;pn&&"documentMode"in document&&(Br=document.documentMode);var Dy=pn&&"TextEvent"in window&&!Br,qd=pn&&(!$o||Br&&8<Br&&11>=Br),Yd=" ",Gd=!1;function Vd(e,t){switch(e){case"keyup":return Oy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zl=!1;function My(e,t){switch(e){case"compositionend":return Kd(t);case"keypress":return t.which!==32?null:(Gd=!0,Yd);case"textInput":return e=t.data,e===Yd&&Gd?null:e;default:return null}}function Ay(e,t){if(Zl)return e==="compositionend"||!$o&&Vd(e,t)?(e=Ld(),Zs=ko=Ln=null,Zl=!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 qd&&t.locale!=="ko"?null:t.data;default:return null}}var ky={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ky[e.type]:t==="textarea"}function Qd(e,t,a,r){Xl?Ql?Ql.push(r):Ql=[r]:Xl=r,t=qi(t,"onChange"),0<t.length&&(a=new Ps("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var $r=null,qr=null;function Ly(e){zh(e,0)}function Ws(e){var t=Pe(e);if(Ks(t))return e}function Zd(e,t){if(e==="change")return t}var Fd=!1;if(pn){var qo;if(pn){var Yo="oninput"in document;if(!Yo){var Jd=document.createElement("div");Jd.setAttribute("oninput","return;"),Yo=typeof Jd.oninput=="function"}qo=Yo}else qo=!1;Fd=qo&&(!document.documentMode||9<document.documentMode)}function Pd(){$r&&($r.detachEvent("onpropertychange",Id),qr=$r=null)}function Id(e){if(e.propertyName==="value"&&Ws(qr)){var t=[];Qd(t,qr,e,Do(e)),kd(Ly,t)}}function Uy(e,t,a){e==="focusin"?(Pd(),$r=t,qr=a,$r.attachEvent("onpropertychange",Id)):e==="focusout"&&Pd()}function Hy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ws(qr)}function By(e,t){if(e==="click")return Ws(t)}function $y(e,t){if(e==="input"||e==="change")return Ws(t)}function qy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sa=typeof Object.is=="function"?Object.is:qy;function Yr(e,t){if(Sa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var c=a[r];if(!ya.call(t,c)||!Sa(e[c],t[c]))return!1}return!0}function Wd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ef(e,t){var a=Wd(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Wd(a)}}function tf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function af(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xs(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=Xs(e.document)}return t}function Go(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 Yy=pn&&"documentMode"in document&&11>=document.documentMode,Fl=null,Vo=null,Gr=null,Ko=!1;function nf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ko||Fl==null||Fl!==Xs(r)||(r=Fl,"selectionStart"in r&&Go(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gr&&Yr(Gr,r)||(Gr=r,r=qi(Vo,"onSelect"),0<r.length&&(t=new Ps("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Fl)))}function hl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Jl={animationend:hl("Animation","AnimationEnd"),animationiteration:hl("Animation","AnimationIteration"),animationstart:hl("Animation","AnimationStart"),transitionrun:hl("Transition","TransitionRun"),transitionstart:hl("Transition","TransitionStart"),transitioncancel:hl("Transition","TransitionCancel"),transitionend:hl("Transition","TransitionEnd")},Xo={},lf={};pn&&(lf=document.createElement("div").style,"AnimationEvent"in window||(delete Jl.animationend.animation,delete Jl.animationiteration.animation,delete Jl.animationstart.animation),"TransitionEvent"in window||delete Jl.transitionend.transition);function pl(e){if(Xo[e])return Xo[e];if(!Jl[e])return e;var t=Jl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in lf)return Xo[e]=t[a];return e}var rf=pl("animationend"),sf=pl("animationiteration"),of=pl("animationstart"),Gy=pl("transitionrun"),Vy=pl("transitionstart"),Ky=pl("transitioncancel"),cf=pl("transitionend"),uf=new Map,Qo="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(" ");Qo.push("scrollEnd");function Ja(e,t){uf.set(e,t),Kt(t,[e])}var ei=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ka=[],Pl=0,Zo=0;function ti(){for(var e=Pl,t=Zo=Pl=0;t<e;){var a=ka[t];ka[t++]=null;var r=ka[t];ka[t++]=null;var c=ka[t];ka[t++]=null;var d=ka[t];if(ka[t++]=null,r!==null&&c!==null){var x=r.pending;x===null?c.next=c:(c.next=x.next,x.next=c),r.pending=c}d!==0&&df(a,c,d)}}function ai(e,t,a,r){ka[Pl++]=e,ka[Pl++]=t,ka[Pl++]=a,ka[Pl++]=r,Zo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Fo(e,t,a,r){return ai(e,t,a,r),ni(e)}function gl(e,t){return ai(e,null,null,t),ni(e)}function df(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,r=d.alternate,r!==null&&(r.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-me(a),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),d):null}function ni(e){if(50<ds)throw ds=0,lu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Il={};function Xy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _a(e,t,a,r){return new Xy(e,t,a,r)}function Jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gn(e,t){var a=e.alternate;return a===null?(a=_a(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function ff(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,a,r,c,d){var x=0;if(r=e,typeof e=="function")Jo(e)&&(x=1);else if(typeof e=="string")x=Pb(e,a,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=_a(31,a,t,c),e.elementType=$,e.lanes=d,e;case z:return xl(a.children,c,d,t);case O:x=8,c|=24;break;case X:return e=_a(12,a,t,c|2),e.elementType=X,e.lanes=d,e;case K:return e=_a(13,a,t,c),e.elementType=K,e.lanes=d,e;case ne:return e=_a(19,a,t,c),e.elementType=ne,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:x=10;break e;case Q:x=9;break e;case G:x=11;break e;case Z:x=14;break e;case E:x=16,r=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=_a(x,a,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function xl(e,t,a,r){return e=_a(7,e,r,t),e.lanes=a,e}function Po(e,t,a){return e=_a(6,e,null,t),e.lanes=a,e}function mf(e){var t=_a(18,null,null,0);return t.stateNode=e,t}function Io(e,t,a){return t=_a(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hf=new WeakMap;function La(e,t){if(typeof e=="object"&&e!==null){var a=hf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Oa(t)},hf.set(e,t),t)}return{value:e,source:t,stack:Oa(t)}}var Wl=[],er=0,ri=null,Vr=0,Ua=[],Ha=0,Un=null,rn=1,sn="";function xn(e,t){Wl[er++]=Vr,Wl[er++]=ri,ri=e,Vr=t}function pf(e,t,a){Ua[Ha++]=rn,Ua[Ha++]=sn,Ua[Ha++]=Un,Un=e;var r=rn;e=sn;var c=32-me(r)-1;r&=~(1<<c),a+=1;var d=32-me(t)+c;if(30<d){var x=c-c%5;d=(r&(1<<x)-1).toString(32),r>>=x,c-=x,rn=1<<32-me(t)+c|a<<c|r,sn=d+e}else rn=1<<d|a<<c|r,sn=e}function Wo(e){e.return!==null&&(xn(e,1),pf(e,1,0))}function ec(e){for(;e===ri;)ri=Wl[--er],Wl[er]=null,Vr=Wl[--er],Wl[er]=null;for(;e===Un;)Un=Ua[--Ha],Ua[Ha]=null,sn=Ua[--Ha],Ua[Ha]=null,rn=Ua[--Ha],Ua[Ha]=null}function gf(e,t){Ua[Ha++]=rn,Ua[Ha++]=sn,Ua[Ha++]=Un,rn=t.id,sn=t.overflow,Un=e}var Ft=null,xt=null,Fe=!1,Hn=null,Ba=!1,tc=Error(i(519));function Bn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Kr(La(t,e)),tc}function xf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[oe]=e,t[he]=r,a){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(a=0;a<ms.length;a++)Ve(ms[a],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),Td(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),Od(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Ah(t.textContent,a)?(r.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),r.onScroll!=null&&Ve("scroll",t),r.onScrollEnd!=null&&Ve("scrollend",t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||Bn(e,!0)}function yf(e){for(Ft=e.return;Ft;)switch(Ft.tag){case 5:case 31:case 13:Ba=!1;return;case 27:case 3:Ba=!0;return;default:Ft=Ft.return}}function tr(e){if(e!==Ft)return!1;if(!Fe)return yf(e),Fe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||bu(e.type,e.memoizedProps)),a=!a),a&&xt&&Bn(e),yf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));xt=Gh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));xt=Gh(e)}else t===27?(t=xt,Wn(e.type)?(e=Nu,Nu=null,xt=e):xt=t):xt=Ft?qa(e.stateNode.nextSibling):null;return!0}function yl(){xt=Ft=null,Fe=!1}function ac(){var e=Hn;return e!==null&&(ha===null?ha=e:ha.push.apply(ha,e),Hn=null),e}function Kr(e){Hn===null?Hn=[e]:Hn.push(e)}var nc=w(null),bl=null,yn=null;function $n(e,t,a){F(nc,t._currentValue),t._currentValue=a}function bn(e){e._currentValue=nc.current,B(nc)}function lc(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function rc(e,t,a,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var x=c.child;d=d.firstContext;e:for(;d!==null;){var S=d;d=c;for(var C=0;C<t.length;C++)if(S.context===t[C]){d.lanes|=a,S=d.alternate,S!==null&&(S.lanes|=a),lc(d.return,a,e),r||(x=null);break e}d=S.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,d=x.alternate,d!==null&&(d.lanes|=a),lc(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 ar(e,t,a,r){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var x=c.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var S=c.type;Sa(c.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(c===we.current){if(x=c.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ys):e=[ys])}c=c.return}e!==null&&rc(t,e,a,r),t.flags|=262144}function si(e){for(e=e.firstContext;e!==null;){if(!Sa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function vl(e){bl=e,yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Jt(e){return bf(bl,e)}function ii(e,t){return bl===null&&vl(e),bf(e,t)}function bf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},yn===null){if(e===null)throw Error(i(308));yn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else yn=yn.next=t;return a}var Qy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Zy=n.unstable_scheduleCallback,Fy=n.unstable_NormalPriority,Lt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sc(){return{controller:new Qy,data:new Map,refCount:0}}function Xr(e){e.refCount--,e.refCount===0&&Zy(Fy,function(){e.controller.abort()})}var Qr=null,ic=0,nr=0,lr=null;function Jy(e,t){if(Qr===null){var a=Qr=[];ic=0,nr=uu(),lr={status:"pending",value:void 0,then:function(r){a.push(r)}}}return ic++,t.then(vf,vf),t}function vf(){if(--ic===0&&Qr!==null){lr!==null&&(lr.status="fulfilled");var e=Qr;Qr=null,nr=0,lr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Py(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),r}var Sf=A.S;A.S=function(e,t){lh=Nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Jy(e,t),Sf!==null&&Sf(e,t)};var Sl=w(null);function oc(){var e=Sl.current;return e!==null?e:ft.pooledCache}function oi(e,t){t===null?F(Sl,Sl.current):F(Sl,t.pool)}function _f(){var e=oc();return e===null?null:{parent:Lt._currentValue,pool:e}}var rr=Error(i(460)),cc=Error(i(474)),ci=Error(i(542)),ui={then:function(){}};function jf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Nf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(hn,hn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e;default:if(typeof t.status=="string")t.then(hn,hn);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e}throw jl=t,rr}}function _l(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(jl=a,rr):a}}var jl=null;function wf(){if(jl===null)throw Error(i(459));var e=jl;return jl=null,e}function Ef(e){if(e===rr||e===ci)throw Error(i(483))}var sr=null,Zr=0;function di(e){var t=Zr;return Zr+=1,sr===null&&(sr=[]),Nf(sr,e,t)}function Fr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fi(e,t){throw t.$$typeof===j?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Cf(e){function t(M,T){if(e){var k=M.deletions;k===null?(M.deletions=[T],M.flags|=16):k.push(T)}}function a(M,T){if(!e)return null;for(;T!==null;)t(M,T),T=T.sibling;return null}function r(M){for(var T=new Map;M!==null;)M.key!==null?T.set(M.key,M):T.set(M.index,M),M=M.sibling;return T}function c(M,T){return M=gn(M,T),M.index=0,M.sibling=null,M}function d(M,T,k){return M.index=k,e?(k=M.alternate,k!==null?(k=k.index,k<T?(M.flags|=67108866,T):k):(M.flags|=67108866,T)):(M.flags|=1048576,T)}function x(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function S(M,T,k,J){return T===null||T.tag!==6?(T=Po(k,M.mode,J),T.return=M,T):(T=c(T,k),T.return=M,T)}function C(M,T,k,J){var Ce=k.type;return Ce===z?V(M,T,k.props.children,J,k.key):T!==null&&(T.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===E&&_l(Ce)===T.type)?(T=c(T,k.props),Fr(T,k),T.return=M,T):(T=li(k.type,k.key,k.props,null,M.mode,J),Fr(T,k),T.return=M,T)}function L(M,T,k,J){return T===null||T.tag!==4||T.stateNode.containerInfo!==k.containerInfo||T.stateNode.implementation!==k.implementation?(T=Io(k,M.mode,J),T.return=M,T):(T=c(T,k.children||[]),T.return=M,T)}function V(M,T,k,J,Ce){return T===null||T.tag!==7?(T=xl(k,M.mode,J,Ce),T.return=M,T):(T=c(T,k),T.return=M,T)}function I(M,T,k){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=Po(""+T,M.mode,k),T.return=M,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case _:return k=li(T.type,T.key,T.props,null,M.mode,k),Fr(k,T),k.return=M,k;case N:return T=Io(T,M.mode,k),T.return=M,T;case E:return T=_l(T),I(M,T,k)}if(xe(T)||ie(T))return T=xl(T,M.mode,k,null),T.return=M,T;if(typeof T.then=="function")return I(M,di(T),k);if(T.$$typeof===Y)return I(M,ii(M,T),k);fi(M,T)}return null}function U(M,T,k,J){var Ce=T!==null?T.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return Ce!==null?null:S(M,T,""+k,J);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case _:return k.key===Ce?C(M,T,k,J):null;case N:return k.key===Ce?L(M,T,k,J):null;case E:return k=_l(k),U(M,T,k,J)}if(xe(k)||ie(k))return Ce!==null?null:V(M,T,k,J,null);if(typeof k.then=="function")return U(M,T,di(k),J);if(k.$$typeof===Y)return U(M,T,ii(M,k),J);fi(M,k)}return null}function q(M,T,k,J,Ce){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return M=M.get(k)||null,S(T,M,""+J,Ce);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case _:return M=M.get(J.key===null?k:J.key)||null,C(T,M,J,Ce);case N:return M=M.get(J.key===null?k:J.key)||null,L(T,M,J,Ce);case E:return J=_l(J),q(M,T,k,J,Ce)}if(xe(J)||ie(J))return M=M.get(k)||null,V(T,M,J,Ce,null);if(typeof J.then=="function")return q(M,T,k,di(J),Ce);if(J.$$typeof===Y)return q(M,T,k,ii(T,J),Ce);fi(T,J)}return null}function ve(M,T,k,J){for(var Ce=null,et=null,_e=T,Le=T=0,Xe=null;_e!==null&&Le<k.length;Le++){_e.index>Le?(Xe=_e,_e=null):Xe=_e.sibling;var tt=U(M,_e,k[Le],J);if(tt===null){_e===null&&(_e=Xe);break}e&&_e&&tt.alternate===null&&t(M,_e),T=d(tt,T,Le),et===null?Ce=tt:et.sibling=tt,et=tt,_e=Xe}if(Le===k.length)return a(M,_e),Fe&&xn(M,Le),Ce;if(_e===null){for(;Le<k.length;Le++)_e=I(M,k[Le],J),_e!==null&&(T=d(_e,T,Le),et===null?Ce=_e:et.sibling=_e,et=_e);return Fe&&xn(M,Le),Ce}for(_e=r(_e);Le<k.length;Le++)Xe=q(_e,M,Le,k[Le],J),Xe!==null&&(e&&Xe.alternate!==null&&_e.delete(Xe.key===null?Le:Xe.key),T=d(Xe,T,Le),et===null?Ce=Xe:et.sibling=Xe,et=Xe);return e&&_e.forEach(function(ll){return t(M,ll)}),Fe&&xn(M,Le),Ce}function ze(M,T,k,J){if(k==null)throw Error(i(151));for(var Ce=null,et=null,_e=T,Le=T=0,Xe=null,tt=k.next();_e!==null&&!tt.done;Le++,tt=k.next()){_e.index>Le?(Xe=_e,_e=null):Xe=_e.sibling;var ll=U(M,_e,tt.value,J);if(ll===null){_e===null&&(_e=Xe);break}e&&_e&&ll.alternate===null&&t(M,_e),T=d(ll,T,Le),et===null?Ce=ll:et.sibling=ll,et=ll,_e=Xe}if(tt.done)return a(M,_e),Fe&&xn(M,Le),Ce;if(_e===null){for(;!tt.done;Le++,tt=k.next())tt=I(M,tt.value,J),tt!==null&&(T=d(tt,T,Le),et===null?Ce=tt:et.sibling=tt,et=tt);return Fe&&xn(M,Le),Ce}for(_e=r(_e);!tt.done;Le++,tt=k.next())tt=q(_e,M,Le,tt.value,J),tt!==null&&(e&&tt.alternate!==null&&_e.delete(tt.key===null?Le:tt.key),T=d(tt,T,Le),et===null?Ce=tt:et.sibling=tt,et=tt);return e&&_e.forEach(function(ov){return t(M,ov)}),Fe&&xn(M,Le),Ce}function ct(M,T,k,J){if(typeof k=="object"&&k!==null&&k.type===z&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case _:e:{for(var Ce=k.key;T!==null;){if(T.key===Ce){if(Ce=k.type,Ce===z){if(T.tag===7){a(M,T.sibling),J=c(T,k.props.children),J.return=M,M=J;break e}}else if(T.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===E&&_l(Ce)===T.type){a(M,T.sibling),J=c(T,k.props),Fr(J,k),J.return=M,M=J;break e}a(M,T);break}else t(M,T);T=T.sibling}k.type===z?(J=xl(k.props.children,M.mode,J,k.key),J.return=M,M=J):(J=li(k.type,k.key,k.props,null,M.mode,J),Fr(J,k),J.return=M,M=J)}return x(M);case N:e:{for(Ce=k.key;T!==null;){if(T.key===Ce)if(T.tag===4&&T.stateNode.containerInfo===k.containerInfo&&T.stateNode.implementation===k.implementation){a(M,T.sibling),J=c(T,k.children||[]),J.return=M,M=J;break e}else{a(M,T);break}else t(M,T);T=T.sibling}J=Io(k,M.mode,J),J.return=M,M=J}return x(M);case E:return k=_l(k),ct(M,T,k,J)}if(xe(k))return ve(M,T,k,J);if(ie(k)){if(Ce=ie(k),typeof Ce!="function")throw Error(i(150));return k=Ce.call(k),ze(M,T,k,J)}if(typeof k.then=="function")return ct(M,T,di(k),J);if(k.$$typeof===Y)return ct(M,T,ii(M,k),J);fi(M,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,T!==null&&T.tag===6?(a(M,T.sibling),J=c(T,k),J.return=M,M=J):(a(M,T),J=Po(k,M.mode,J),J.return=M,M=J),x(M)):a(M,T)}return function(M,T,k,J){try{Zr=0;var Ce=ct(M,T,k,J);return sr=null,Ce}catch(_e){if(_e===rr||_e===ci)throw _e;var et=_a(29,_e,null,M.mode);return et.lanes=J,et.return=M,et}}}var Nl=Cf(!0),Rf=Cf(!1),qn=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dc(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 Yn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(nt&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=ni(e),df(e,null,a),t}return ai(e,r,t,a),ni(e)}function Jr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Vs(e,a)}}function fc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=x:d=d.next=x,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var mc=!1;function Pr(){if(mc){var e=lr;if(e!==null)throw e}}function Ir(e,t,a,r){mc=!1;var c=e.updateQueue;qn=!1;var d=c.firstBaseUpdate,x=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var C=S,L=C.next;C.next=null,x===null?d=L:x.next=L,x=C;var V=e.alternate;V!==null&&(V=V.updateQueue,S=V.lastBaseUpdate,S!==x&&(S===null?V.firstBaseUpdate=L:S.next=L,V.lastBaseUpdate=C))}if(d!==null){var I=c.baseState;x=0,V=L=C=null,S=d;do{var U=S.lane&-536870913,q=U!==S.lane;if(q?(Ke&U)===U:(r&U)===U){U!==0&&U===nr&&(mc=!0),V!==null&&(V=V.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ve=e,ze=S;U=t;var ct=a;switch(ze.tag){case 1:if(ve=ze.payload,typeof ve=="function"){I=ve.call(ct,I,U);break e}I=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ze.payload,U=typeof ve=="function"?ve.call(ct,I,U):ve,U==null)break e;I=b({},I,U);break e;case 2:qn=!0}}U=S.callback,U!==null&&(e.flags|=64,q&&(e.flags|=8192),q=c.callbacks,q===null?c.callbacks=[U]:q.push(U))}else q={lane:U,tag:S.tag,payload:S.payload,callback:S.callback,next:null},V===null?(L=V=q,C=I):V=V.next=q,x|=U;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;q=S,S=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);V===null&&(C=I),c.baseState=C,c.firstBaseUpdate=L,c.lastBaseUpdate=V,d===null&&(c.shared.lanes=0),Zn|=x,e.lanes=x,e.memoizedState=I}}function Tf(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function zf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Tf(a[e],t)}var ir=w(null),mi=w(0);function Of(e,t){e=Rn,F(mi,e),F(ir,t),Rn=e|t.baseLanes}function hc(){F(mi,Rn),F(ir,ir.current)}function pc(){Rn=mi.current,B(ir),B(mi)}var ja=w(null),$a=null;function Vn(e){var t=e.alternate;F(Mt,Mt.current&1),F(ja,e),$a===null&&(t===null||ir.current!==null||t.memoizedState!==null)&&($a=e)}function gc(e){F(Mt,Mt.current),F(ja,e),$a===null&&($a=e)}function Df(e){e.tag===22?(F(Mt,Mt.current),F(ja,e),$a===null&&($a=e)):Kn()}function Kn(){F(Mt,Mt.current),F(ja,ja.current)}function Na(e){B(ja),$a===e&&($a=null),B(Mt)}var Mt=w(0);function hi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||_u(a)||ju(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 vn=0,ke=null,it=null,Ut=null,pi=!1,or=!1,wl=!1,gi=0,Wr=0,cr=null,Iy=0;function Ct(){throw Error(i(321))}function xc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Sa(e[a],t[a]))return!1;return!0}function yc(e,t,a,r,c,d){return vn=d,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?pm:Mc,wl=!1,d=a(r,c),wl=!1,or&&(d=Af(t,a,r,c)),Mf(e),d}function Mf(e){A.H=as;var t=it!==null&&it.next!==null;if(vn=0,Ut=it=ke=null,pi=!1,Wr=0,cr=null,t)throw Error(i(300));e===null||Ht||(e=e.dependencies,e!==null&&si(e)&&(Ht=!0))}function Af(e,t,a,r){ke=e;var c=0;do{if(or&&(cr=null),Wr=0,or=!1,25<=c)throw Error(i(301));if(c+=1,Ut=it=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}A.H=gm,d=t(a,r)}while(or);return d}function Wy(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?es(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(ke.flags|=1024),t}function bc(){var e=gi!==0;return gi=0,e}function vc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Sc(e){if(pi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}pi=!1}vn=0,Ut=it=ke=null,or=!1,Wr=gi=0,cr=null}function ra(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?ke.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function At(){if(it===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Ut===null?ke.memoizedState:Ut.next;if(t!==null)Ut=t,it=e;else{if(e===null)throw ke.alternate===null?Error(i(467)):Error(i(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Ut===null?ke.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function xi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function es(e){var t=Wr;return Wr+=1,cr===null&&(cr=[]),e=Nf(cr,e,t),t=ke,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?pm:Mc),e}function yi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return es(e);if(e.$$typeof===Y)return Jt(e)}throw Error(i(438,String(e)))}function _c(e){var t=null,a=ke.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=ke.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=xi(),ke.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=W;return t.index++,a}function Sn(e,t){return typeof t=="function"?t(e):t}function bi(e){var t=At();return jc(t,it,e)}function jc(e,t,a){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=a;var c=e.baseQueue,d=r.pending;if(d!==null){if(c!==null){var x=c.next;c.next=d.next,d.next=x}t.baseQueue=c=d,r.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var S=x=null,C=null,L=t,V=!1;do{var I=L.lane&-536870913;if(I!==L.lane?(Ke&I)===I:(vn&I)===I){var U=L.revertLane;if(U===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),I===nr&&(V=!0);else if((vn&U)===U){L=L.next,U===nr&&(V=!0);continue}else I={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(S=C=I,x=d):C=C.next=I,ke.lanes|=U,Zn|=U;I=L.action,wl&&a(d,I),d=L.hasEagerState?L.eagerState:a(d,I)}else U={lane:I,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(S=C=U,x=d):C=C.next=U,ke.lanes|=I,Zn|=I;L=L.next}while(L!==null&&L!==t);if(C===null?x=d:C.next=S,!Sa(d,e.memoizedState)&&(Ht=!0,V&&(a=lr,a!==null)))throw a;e.memoizedState=d,e.baseState=x,e.baseQueue=C,r.lastRenderedState=d}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Nc(e){var t=At(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var r=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do d=e(d,x.action),x=x.next;while(x!==c);Sa(d,t.memoizedState)||(Ht=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,r]}function kf(e,t,a){var r=ke,c=At(),d=Fe;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!Sa((it||c).memoizedState,a);if(x&&(c.memoizedState=a,Ht=!0),c=c.queue,Cc(Hf.bind(null,r,c,e),[e]),c.getSnapshot!==t||x||Ut!==null&&Ut.memoizedState.tag&1){if(r.flags|=2048,ur(9,{destroy:void 0},Uf.bind(null,r,c,a,t),null),ft===null)throw Error(i(349));d||(vn&127)!==0||Lf(r,t,a)}return a}function Lf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ke.updateQueue,t===null?(t=xi(),ke.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Uf(e,t,a,r){t.value=a,t.getSnapshot=r,Bf(t)&&$f(e)}function Hf(e,t,a){return a(function(){Bf(t)&&$f(e)})}function Bf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Sa(e,a)}catch{return!0}}function $f(e){var t=gl(e,2);t!==null&&pa(t,e,2)}function wc(e){var t=ra();if(typeof e=="function"){var a=e;if(e=a(),wl){wt(!0);try{a()}finally{wt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:e},t}function qf(e,t,a,r){return e.baseState=a,jc(e,it,typeof r=="function"?r:Sn)}function eb(e,t,a,r,c){if(_i(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){d.listeners.push(x)}};A.T!==null?a(!0):d.isTransition=!1,r(d),a=t.pending,a===null?(d.next=t.pending=d,Yf(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Yf(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=A.T,x={};A.T=x;try{var S=a(c,r),C=A.S;C!==null&&C(x,S),Gf(e,t,S)}catch(L){Ec(e,t,L)}finally{d!==null&&x.types!==null&&(d.types=x.types),A.T=d}}else try{d=a(c,r),Gf(e,t,d)}catch(L){Ec(e,t,L)}}function Gf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Vf(e,t,r)},function(r){return Ec(e,t,r)}):Vf(e,t,a)}function Vf(e,t,a){t.status="fulfilled",t.value=a,Kf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Yf(e,a)))}function Ec(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Kf(t),t=t.next;while(t!==r)}e.action=null}function Kf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xf(e,t){return t}function Qf(e,t){if(Fe){var a=ft.formState;if(a!==null){e:{var r=ke;if(Fe){if(xt){t:{for(var c=xt,d=Ba;c.nodeType!==8;){if(!d){c=null;break t}if(c=qa(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){xt=qa(c.nextSibling),r=c.data==="F!";break e}}Bn(r)}r=!1}r&&(t=a[0])}}return a=ra(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xf,lastRenderedState:t},a.queue=r,a=fm.bind(null,ke,r),r.dispatch=a,r=wc(!1),d=Dc.bind(null,ke,!1,r.queue),r=ra(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=eb.bind(null,ke,c,d,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function Zf(e){var t=At();return Ff(t,it,e)}function Ff(e,t,a){if(t=jc(e,t,Xf)[0],e=bi(Sn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=es(t)}catch(x){throw x===rr?ci:x}else r=t;t=At();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(ke.flags|=2048,ur(9,{destroy:void 0},tb.bind(null,c,a),null)),[r,d,e]}function tb(e,t){e.action=t}function Jf(e){var t=At(),a=it;if(a!==null)return Ff(t,a,e);At(),t=t.memoizedState,a=At();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function ur(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=ke.updateQueue,t===null&&(t=xi(),ke.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function Pf(){return At().memoizedState}function vi(e,t,a,r){var c=ra();ke.flags|=e,c.memoizedState=ur(1|t,{destroy:void 0},a,r===void 0?null:r)}function Si(e,t,a,r){var c=At();r=r===void 0?null:r;var d=c.memoizedState.inst;it!==null&&r!==null&&xc(r,it.memoizedState.deps)?c.memoizedState=ur(t,d,a,r):(ke.flags|=e,c.memoizedState=ur(1|t,d,a,r))}function If(e,t){vi(8390656,8,e,t)}function Cc(e,t){Si(2048,8,e,t)}function ab(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=xi(),ke.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Wf(e){var t=At().memoizedState;return ab({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function em(e,t){return Si(4,2,e,t)}function tm(e,t){return Si(4,4,e,t)}function am(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nm(e,t,a){a=a!=null?a.concat([e]):null,Si(4,4,am.bind(null,t,e),a)}function Rc(){}function lm(e,t){var a=At();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&xc(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function rm(e,t){var a=At();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&xc(t,r[1]))return r[0];if(r=e(),wl){wt(!0);try{e()}finally{wt(!1)}}return a.memoizedState=[r,t],r}function Tc(e,t,a){return a===void 0||(vn&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=sh(),ke.lanes|=e,Zn|=e,a)}function sm(e,t,a,r){return Sa(a,t)?a:ir.current!==null?(e=Tc(e,a,r),Sa(e,t)||(Ht=!0),e):(vn&42)===0||(vn&1073741824)!==0&&(Ke&261930)===0?(Ht=!0,e.memoizedState=a):(e=sh(),ke.lanes|=e,Zn|=e,t)}function im(e,t,a,r,c){var d=ee.p;ee.p=d!==0&&8>d?d:8;var x=A.T,S={};A.T=S,Dc(e,!1,t,a);try{var C=c(),L=A.S;if(L!==null&&L(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var V=Py(C,r);ts(e,t,V,Ca(e))}else ts(e,t,r,Ca(e))}catch(I){ts(e,t,{then:function(){},status:"rejected",reason:I},Ca())}finally{ee.p=d,x!==null&&S.types!==null&&(x.types=S.types),A.T=x}}function nb(){}function zc(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=om(e).queue;im(e,c,t,ce,a===null?nb:function(){return cm(e),a(r)})}function om(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:ce},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cm(e){var t=om(e);t.next===null&&(t=e.alternate.memoizedState),ts(e,t.next.queue,{},Ca())}function Oc(){return Jt(ys)}function um(){return At().memoizedState}function dm(){return At().memoizedState}function lb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ca();e=Yn(a);var r=Gn(t,e,a);r!==null&&(pa(r,t,a),Jr(r,t,a)),t={cache:sc()},e.payload=t;return}t=t.return}}function rb(e,t,a){var r=Ca();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},_i(e)?mm(t,a):(a=Fo(e,t,a,r),a!==null&&(pa(a,e,r),hm(a,t,r)))}function fm(e,t,a){var r=Ca();ts(e,t,a,r)}function ts(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(_i(e))mm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var x=t.lastRenderedState,S=d(x,a);if(c.hasEagerState=!0,c.eagerState=S,Sa(S,x))return ai(e,t,c,0),ft===null&&ti(),!1}catch{}if(a=Fo(e,t,c,r),a!==null)return pa(a,e,r),hm(a,t,r),!0}return!1}function Dc(e,t,a,r){if(r={lane:2,revertLane:uu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},_i(e)){if(t)throw Error(i(479))}else t=Fo(e,a,r,2),t!==null&&pa(t,e,2)}function _i(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function mm(e,t){or=pi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function hm(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Vs(e,a)}}var as={readContext:Jt,use:yi,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};as.useEffectEvent=Ct;var pm={readContext:Jt,use:yi,useCallback:function(e,t){return ra().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:If,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,vi(4194308,4,am.bind(null,t,e),a)},useLayoutEffect:function(e,t){return vi(4194308,4,e,t)},useInsertionEffect:function(e,t){vi(4,2,e,t)},useMemo:function(e,t){var a=ra();t=t===void 0?null:t;var r=e();if(wl){wt(!0);try{e()}finally{wt(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=ra();if(a!==void 0){var c=a(t);if(wl){wt(!0);try{a(t)}finally{wt(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=rb.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=ra();return e={current:e},t.memoizedState=e},useState:function(e){e=wc(e);var t=e.queue,a=fm.bind(null,ke,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Rc,useDeferredValue:function(e,t){var a=ra();return Tc(a,e,t)},useTransition:function(){var e=wc(!1);return e=im.bind(null,ke,e.queue,!0,!1),ra().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=ke,c=ra();if(Fe){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),ft===null)throw Error(i(349));(Ke&127)!==0||Lf(r,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,If(Hf.bind(null,r,d,e),[e]),r.flags|=2048,ur(9,{destroy:void 0},Uf.bind(null,r,d,a,t),null),a},useId:function(){var e=ra(),t=ft.identifierPrefix;if(Fe){var a=sn,r=rn;a=(r&~(1<<32-me(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Iy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oc,useFormState:Qf,useActionState:Qf,useOptimistic:function(e){var t=ra();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Dc.bind(null,ke,!0,a),a.dispatch=t,[e,t]},useMemoCache:_c,useCacheRefresh:function(){return ra().memoizedState=lb.bind(null,ke)},useEffectEvent:function(e){var t=ra(),a={impl:e};return t.memoizedState=a,function(){if((nt&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Mc={readContext:Jt,use:yi,useCallback:lm,useContext:Jt,useEffect:Cc,useImperativeHandle:nm,useInsertionEffect:em,useLayoutEffect:tm,useMemo:rm,useReducer:bi,useRef:Pf,useState:function(){return bi(Sn)},useDebugValue:Rc,useDeferredValue:function(e,t){var a=At();return sm(a,it.memoizedState,e,t)},useTransition:function(){var e=bi(Sn)[0],t=At().memoizedState;return[typeof e=="boolean"?e:es(e),t]},useSyncExternalStore:kf,useId:um,useHostTransitionStatus:Oc,useFormState:Zf,useActionState:Zf,useOptimistic:function(e,t){var a=At();return qf(a,it,e,t)},useMemoCache:_c,useCacheRefresh:dm};Mc.useEffectEvent=Wf;var gm={readContext:Jt,use:yi,useCallback:lm,useContext:Jt,useEffect:Cc,useImperativeHandle:nm,useInsertionEffect:em,useLayoutEffect:tm,useMemo:rm,useReducer:Nc,useRef:Pf,useState:function(){return Nc(Sn)},useDebugValue:Rc,useDeferredValue:function(e,t){var a=At();return it===null?Tc(a,e,t):sm(a,it.memoizedState,e,t)},useTransition:function(){var e=Nc(Sn)[0],t=At().memoizedState;return[typeof e=="boolean"?e:es(e),t]},useSyncExternalStore:kf,useId:um,useHostTransitionStatus:Oc,useFormState:Jf,useActionState:Jf,useOptimistic:function(e,t){var a=At();return it!==null?qf(a,it,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:_c,useCacheRefresh:dm};gm.useEffectEvent=Wf;function Ac(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:b({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var kc={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Ca(),c=Yn(r);c.payload=t,a!=null&&(c.callback=a),t=Gn(e,c,r),t!==null&&(pa(t,e,r),Jr(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Ca(),c=Yn(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Gn(e,c,r),t!==null&&(pa(t,e,r),Jr(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ca(),r=Yn(a);r.tag=2,t!=null&&(r.callback=t),t=Gn(e,r,a),t!==null&&(pa(t,e,a),Jr(t,e,a))}};function xm(e,t,a,r,c,d,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,x):t.prototype&&t.prototype.isPureReactComponent?!Yr(a,r)||!Yr(c,d):!0}function ym(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&kc.enqueueReplaceState(t,t.state,null)}function El(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=b({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function bm(e){ei(e)}function vm(e){console.error(e)}function Sm(e){ei(e)}function ji(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function _m(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Lc(e,t,a){return a=Yn(a),a.tag=3,a.payload={element:null},a.callback=function(){ji(e,t)},a}function jm(e){return e=Yn(e),e.tag=3,e}function Nm(e,t,a,r){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=r.value;e.payload=function(){return c(d)},e.callback=function(){_m(t,a,r)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){_m(t,a,r),typeof c!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function sb(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&ar(t,a,c,!0),a=ja.current,a!==null){switch(a.tag){case 31:case 13:return $a===null?ki():a.alternate===null&&Rt===0&&(Rt=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===ui?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),iu(e,r,c)),!1;case 22:return a.flags|=65536,r===ui?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),iu(e,r,c)),!1}throw Error(i(435,a.tag))}return iu(e,r,c),ki(),!1}if(Fe)return t=ja.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==tc&&(e=Error(i(422),{cause:r}),Kr(La(e,a)))):(r!==tc&&(t=Error(i(423),{cause:r}),Kr(La(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=La(r,a),c=Lc(e.stateNode,r,c),fc(e,c),Rt!==4&&(Rt=2)),!1;var d=Error(i(520),{cause:r});if(d=La(d,a),us===null?us=[d]:us.push(d),Rt!==4&&(Rt=2),t===null)return!0;r=La(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Lc(a.stateNode,r,e),fc(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Fn===null||!Fn.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=jm(c),Nm(c,e,a,r),fc(a,c),!1}a=a.return}while(a!==null);return!1}var Uc=Error(i(461)),Ht=!1;function Pt(e,t,a,r){t.child=e===null?Rf(t,null,a,r):Nl(t,e.child,a,r)}function wm(e,t,a,r,c){a=a.render;var d=t.ref;if("ref"in r){var x={};for(var S in r)S!=="ref"&&(x[S]=r[S])}else x=r;return vl(t),r=yc(e,t,a,x,d,c),S=bc(),e!==null&&!Ht?(vc(e,t,c),_n(e,t,c)):(Fe&&S&&Wo(t),t.flags|=1,Pt(e,t,r,c),t.child)}function Em(e,t,a,r,c){if(e===null){var d=a.type;return typeof d=="function"&&!Jo(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Cm(e,t,d,r,c)):(e=li(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Kc(e,c)){var x=d.memoizedProps;if(a=a.compare,a=a!==null?a:Yr,a(x,r)&&e.ref===t.ref)return _n(e,t,c)}return t.flags|=1,e=gn(d,r),e.ref=t.ref,e.return=t,t.child=e}function Cm(e,t,a,r,c){if(e!==null){var d=e.memoizedProps;if(Yr(d,r)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=r=d,Kc(e,c))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,_n(e,t,c)}return Hc(e,t,a,r,c)}function Rm(e,t,a,r){var c=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~d}else r=0,t.child=null;return Tm(e,t,d,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&oi(t,d!==null?d.cachePool:null),d!==null?Of(t,d):hc(),Df(t);else return r=t.lanes=536870912,Tm(e,t,d!==null?d.baseLanes|a:a,a,r)}else d!==null?(oi(t,d.cachePool),Of(t,d),Kn(),t.memoizedState=null):(e!==null&&oi(t,null),hc(),Kn());return Pt(e,t,c,a),t.child}function ns(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Tm(e,t,a,r,c){var d=oc();return d=d===null?null:{parent:Lt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&oi(t,null),hc(),Df(t),e!==null&&ar(e,t,r,!0),t.childLanes=c,null}function Ni(e,t){return t=Ei({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zm(e,t,a){return Nl(t,e.child,null,a),e=Ni(t,t.pendingProps),e.flags|=2,Na(t),t.memoizedState=null,e}function ib(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Fe){if(r.mode==="hidden")return e=Ni(t,r),t.lanes=536870912,ns(null,e);if(gc(t),(e=xt)?(e=Yh(e,Ba),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Un!==null?{id:rn,overflow:sn}:null,retryLane:536870912,hydrationErrors:null},a=mf(e),a.return=t,t.child=a,Ft=t,xt=null)):e=null,e===null)throw Bn(t);return t.lanes=536870912,null}return Ni(t,r)}var d=e.memoizedState;if(d!==null){var x=d.dehydrated;if(gc(t),c)if(t.flags&256)t.flags&=-257,t=zm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ht||ar(e,t,a,!1),c=(a&e.childLanes)!==0,Ht||c){if(r=ft,r!==null&&(x=R(r,a),x!==0&&x!==d.retryLane))throw d.retryLane=x,gl(e,x),pa(r,e,x),Uc;ki(),t=zm(e,t,a)}else e=d.treeContext,xt=qa(x.nextSibling),Ft=t,Fe=!0,Hn=null,Ba=!1,e!==null&&gf(t,e),t=Ni(t,r),t.flags|=4096;return t}return e=gn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function wi(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 Hc(e,t,a,r,c){return vl(t),a=yc(e,t,a,r,void 0,c),r=bc(),e!==null&&!Ht?(vc(e,t,c),_n(e,t,c)):(Fe&&r&&Wo(t),t.flags|=1,Pt(e,t,a,c),t.child)}function Om(e,t,a,r,c,d){return vl(t),t.updateQueue=null,a=Af(t,r,a,c),Mf(e),r=bc(),e!==null&&!Ht?(vc(e,t,d),_n(e,t,d)):(Fe&&r&&Wo(t),t.flags|=1,Pt(e,t,a,d),t.child)}function Dm(e,t,a,r,c){if(vl(t),t.stateNode===null){var d=Il,x=a.contextType;typeof x=="object"&&x!==null&&(d=Jt(x)),d=new a(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=kc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},uc(t),x=a.contextType,d.context=typeof x=="object"&&x!==null?Jt(x):Il,d.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Ac(t,a,x,r),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(x=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),x!==d.state&&kc.enqueueReplaceState(d,d.state,null),Ir(t,r,d,c),Pr(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var S=t.memoizedProps,C=El(a,S);d.props=C;var L=d.context,V=a.contextType;x=Il,typeof V=="object"&&V!==null&&(x=Jt(V));var I=a.getDerivedStateFromProps;V=typeof I=="function"||typeof d.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,V||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S||L!==x)&&ym(t,d,r,x),qn=!1;var U=t.memoizedState;d.state=U,Ir(t,r,d,c),Pr(),L=t.memoizedState,S||U!==L||qn?(typeof I=="function"&&(Ac(t,a,I,r),L=t.memoizedState),(C=qn||xm(t,a,C,r,U,L,x))?(V||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=L),d.props=r,d.state=L,d.context=x,r=C):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,dc(e,t),x=t.memoizedProps,V=El(a,x),d.props=V,I=t.pendingProps,U=d.context,L=a.contextType,C=Il,typeof L=="object"&&L!==null&&(C=Jt(L)),S=a.getDerivedStateFromProps,(L=typeof S=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==I||U!==C)&&ym(t,d,r,C),qn=!1,U=t.memoizedState,d.state=U,Ir(t,r,d,c),Pr();var q=t.memoizedState;x!==I||U!==q||qn||e!==null&&e.dependencies!==null&&si(e.dependencies)?(typeof S=="function"&&(Ac(t,a,S,r),q=t.memoizedState),(V=qn||xm(t,a,V,r,U,q,C)||e!==null&&e.dependencies!==null&&si(e.dependencies))?(L||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,q,C),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,q,C)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=q),d.props=r,d.state=q,d.context=C,r=V):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,wi(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=Nl(t,e.child,null,c),t.child=Nl(t,null,a,c)):Pt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=_n(e,t,c),e}function Mm(e,t,a,r){return yl(),t.flags|=256,Pt(e,t,a,r),t.child}var Bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:_f()}}function qc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ea),e}function Am(e,t,a){var r=t.pendingProps,c=!1,d=(t.flags&128)!==0,x;if((x=d)||(x=e!==null&&e.memoizedState===null?!1:(Mt.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Fe){if(c?Vn(t):Kn(),(e=xt)?(e=Yh(e,Ba),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Un!==null?{id:rn,overflow:sn}:null,retryLane:536870912,hydrationErrors:null},a=mf(e),a.return=t,t.child=a,Ft=t,xt=null)):e=null,e===null)throw Bn(t);return ju(e)?t.lanes=32:t.lanes=536870912,null}var S=r.children;return r=r.fallback,c?(Kn(),c=t.mode,S=Ei({mode:"hidden",children:S},c),r=xl(r,c,a,null),S.return=t,r.return=t,S.sibling=r,t.child=S,r=t.child,r.memoizedState=$c(a),r.childLanes=qc(e,x,a),t.memoizedState=Bc,ns(null,r)):(Vn(t),Yc(t,S))}var C=e.memoizedState;if(C!==null&&(S=C.dehydrated,S!==null)){if(d)t.flags&256?(Vn(t),t.flags&=-257,t=Gc(e,t,a)):t.memoizedState!==null?(Kn(),t.child=e.child,t.flags|=128,t=null):(Kn(),S=r.fallback,c=t.mode,r=Ei({mode:"visible",children:r.children},c),S=xl(S,c,a,null),S.flags|=2,r.return=t,S.return=t,r.sibling=S,t.child=r,Nl(t,e.child,null,a),r=t.child,r.memoizedState=$c(a),r.childLanes=qc(e,x,a),t.memoizedState=Bc,t=ns(null,r));else if(Vn(t),ju(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var L=x.dgst;x=L,r=Error(i(419)),r.stack="",r.digest=x,Kr({value:r,source:null,stack:null}),t=Gc(e,t,a)}else if(Ht||ar(e,t,a,!1),x=(a&e.childLanes)!==0,Ht||x){if(x=ft,x!==null&&(r=R(x,a),r!==0&&r!==C.retryLane))throw C.retryLane=r,gl(e,r),pa(x,e,r),Uc;_u(S)||ki(),t=Gc(e,t,a)}else _u(S)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,xt=qa(S.nextSibling),Ft=t,Fe=!0,Hn=null,Ba=!1,e!==null&&gf(t,e),t=Yc(t,r.children),t.flags|=4096);return t}return c?(Kn(),S=r.fallback,c=t.mode,C=e.child,L=C.sibling,r=gn(C,{mode:"hidden",children:r.children}),r.subtreeFlags=C.subtreeFlags&65011712,L!==null?S=gn(L,S):(S=xl(S,c,a,null),S.flags|=2),S.return=t,r.return=t,r.sibling=S,t.child=r,ns(null,r),r=t.child,S=e.child.memoizedState,S===null?S=$c(a):(c=S.cachePool,c!==null?(C=Lt._currentValue,c=c.parent!==C?{parent:C,pool:C}:c):c=_f(),S={baseLanes:S.baseLanes|a,cachePool:c}),r.memoizedState=S,r.childLanes=qc(e,x,a),t.memoizedState=Bc,ns(e.child,r)):(Vn(t),a=e.child,e=a.sibling,a=gn(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Yc(e,t){return t=Ei({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ei(e,t){return e=_a(22,e,null,t),e.lanes=0,e}function Gc(e,t,a){return Nl(t,e.child,null,a),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function km(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),lc(e.return,t,a)}function Vc(e,t,a,r,c,d){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:c,treeForkCount:d}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=r,x.tail=a,x.tailMode=c,x.treeForkCount=d)}function Lm(e,t,a){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var x=Mt.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,F(Mt,x),Pt(e,t,r,a),r=Fe?Vr:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&km(e,a,t);else if(e.tag===19)km(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&hi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Vc(t,!1,c,a,d,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&hi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Vc(t,!0,a,null,d,r);break;case"together":Vc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function _n(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Zn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ar(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=gn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=gn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Kc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&si(e)))}function ob(e,t,a){switch(t.tag){case 3:ut(t,t.stateNode.containerInfo),$n(t,Lt,e.memoizedState.cache),yl();break;case 27:case 5:xa(t);break;case 4:ut(t,t.stateNode.containerInfo);break;case 10:$n(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Vn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Am(e,t,a):(Vn(t),e=_n(e,t,a),e!==null?e.sibling:null);Vn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(ar(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return Lm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),F(Mt,Mt.current),r)break;return null;case 22:return t.lanes=0,Rm(e,t,a,t.pendingProps);case 24:$n(t,Lt,e.memoizedState.cache)}return _n(e,t,a)}function Um(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Kc(e,a)&&(t.flags&128)===0)return Ht=!1,ob(e,t,a);Ht=(e.flags&131072)!==0}else Ht=!1,Fe&&(t.flags&1048576)!==0&&pf(t,Vr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=_l(t.elementType),t.type=e,typeof e=="function")Jo(e)?(r=El(e,r),t.tag=1,t=Dm(null,t,e,r,a)):(t.tag=0,t=Hc(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===G){t.tag=11,t=wm(null,t,e,r,a);break e}else if(c===Z){t.tag=14,t=Em(null,t,e,r,a);break e}}throw t=ue(e)||e,Error(i(306,t,""))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=El(r,t.pendingProps),Dm(e,t,r,c,a);case 3:e:{if(ut(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,dc(e,t),Ir(t,r,null,a);var x=t.memoizedState;if(r=x.cache,$n(t,Lt,r),r!==d.cache&&rc(t,[Lt],a,!0),Pr(),r=x.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Mm(e,t,r,a);break e}else if(r!==c){c=La(Error(i(424)),t),Kr(c),t=Mm(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,xt=qa(e.firstChild),Ft=t,Fe=!0,Hn=null,Ba=!0,a=Rf(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(yl(),r===c){t=_n(e,t,a);break e}Pt(e,t,r,a)}t=t.child}return t;case 26:return wi(e,t),e===null?(a=Zh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Fe||(a=t.type,e=t.pendingProps,r=Yi(Ne.current).createElement(a),r[oe]=t,r[he]=e,It(r,a,e),mt(r),t.stateNode=r):t.memoizedState=Zh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xa(t),e===null&&Fe&&(r=t.stateNode=Kh(t.type,t.pendingProps,Ne.current),Ft=t,Ba=!0,c=xt,Wn(t.type)?(Nu=c,xt=qa(r.firstChild)):xt=c),Pt(e,t,t.pendingProps.children,a),wi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fe&&((c=r=xt)&&(r=Hb(r,t.type,t.pendingProps,Ba),r!==null?(t.stateNode=r,Ft=t,xt=qa(r.firstChild),Ba=!1,c=!0):c=!1),c||Bn(t)),xa(t),c=t.type,d=t.pendingProps,x=e!==null?e.memoizedProps:null,r=d.children,bu(c,d)?r=null:x!==null&&bu(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=yc(e,t,Wy,null,null,a),ys._currentValue=c),wi(e,t),Pt(e,t,r,a),t.child;case 6:return e===null&&Fe&&((e=a=xt)&&(a=Bb(a,t.pendingProps,Ba),a!==null?(t.stateNode=a,Ft=t,xt=null,e=!0):e=!1),e||Bn(t)),null;case 13:return Am(e,t,a);case 4:return ut(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Nl(t,null,r,a):Pt(e,t,r,a),t.child;case 11:return wm(e,t,t.type,t.pendingProps,a);case 7:return Pt(e,t,t.pendingProps,a),t.child;case 8:return Pt(e,t,t.pendingProps.children,a),t.child;case 12:return Pt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,$n(t,t.type,r.value),Pt(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,vl(t),c=Jt(c),r=r(c),t.flags|=1,Pt(e,t,r,a),t.child;case 14:return Em(e,t,t.type,t.pendingProps,a);case 15:return Cm(e,t,t.type,t.pendingProps,a);case 19:return Lm(e,t,a);case 31:return ib(e,t,a);case 22:return Rm(e,t,a,t.pendingProps);case 24:return vl(t),r=Jt(Lt),e===null?(c=oc(),c===null&&(c=ft,d=sc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:r,cache:c},uc(t),$n(t,Lt,c)):((e.lanes&a)!==0&&(dc(e,t),Ir(t,null,null,a),Pr()),c=e.memoizedState,d=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),$n(t,Lt,r)):(r=d.cache,$n(t,Lt,r),r!==c.cache&&rc(t,[Lt],a,!0))),Pt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jn(e){e.flags|=4}function Xc(e,t,a,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(uh())e.flags|=8192;else throw jl=ui,cc}else e.flags&=-16777217}function Hm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wh(t))if(uh())e.flags|=8192;else throw jl=ui,cc}function Ci(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Za():536870912,e.lanes|=t,hr|=t)}function ls(e,t){if(!Fe)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function yt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function cb(e,t,a){var r=t.pendingProps;switch(ec(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(t),null;case 1:return yt(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),bn(Lt),Be(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(tr(t)?jn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ac())),yt(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(jn(t),d!==null?(yt(t),Hm(t,d)):(yt(t),Xc(t,c,null,r,a))):d?d!==e.memoizedState?(jn(t),yt(t),Hm(t,d)):(yt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&jn(t),yt(t),Xc(t,c,e,r,a)),null;case 27:if(bt(t),a=Ne.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yt(t),null}e=le.current,tr(t)?xf(t):(e=Kh(c,r,a),t.stateNode=e,jn(t))}return yt(t),null;case 5:if(bt(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yt(t),null}if(d=le.current,tr(t))xf(t);else{var x=Yi(Ne.current);switch(d){case 1:d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=x.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?x.createElement("select",{is:r.is}):x.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?x.createElement(c,{is:r.is}):x.createElement(c)}}d[oe]=t,d[he]=r;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)d.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=d;e:switch(It(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&jn(t)}}return yt(t),Xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=Ne.current,tr(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=Ft,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[oe]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Ah(e.nodeValue,a)),e||Bn(t,!0)}else e=Yi(e).createTextNode(r),e[oe]=t,t.stateNode=e}return yt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=tr(t),a!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[oe]=t}else yl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),e=!1}else a=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Na(t),t):(Na(t),null);if((t.flags&128)!==0)throw Error(i(558))}return yt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=tr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[oe]=t}else yl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),c=!1}else c=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Na(t),t):(Na(t),null)}return Na(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ci(t,t.updateQueue),yt(t),null);case 4:return Be(),e===null&&hu(t.stateNode.containerInfo),yt(t),null;case 10:return bn(t.type),yt(t),null;case 19:if(B(Mt),r=t.memoizedState,r===null)return yt(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)ls(r,!1);else{if(Rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=hi(e),d!==null){for(t.flags|=128,ls(r,!1),e=d.updateQueue,t.updateQueue=e,Ci(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)ff(a,e),a=a.sibling;return F(Mt,Mt.current&1|2),Fe&&xn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Nt()>Di&&(t.flags|=128,c=!0,ls(r,!1),t.lanes=4194304)}else{if(!c)if(e=hi(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ci(t,e),ls(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Fe)return yt(t),null}else 2*Nt()-r.renderingStartTime>Di&&a!==536870912&&(t.flags|=128,c=!0,ls(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Nt(),e.sibling=null,a=Mt.current,F(Mt,c?a&1|2:a&1),Fe&&xn(t,r.treeForkCount),e):(yt(t),null);case 22:case 23:return Na(t),pc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),a=t.updateQueue,a!==null&&Ci(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&B(Sl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),bn(Lt),yt(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function ub(e,t){switch(ec(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bn(Lt),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return bt(t),null;case 31:if(t.memoizedState!==null){if(Na(t),t.alternate===null)throw Error(i(340));yl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Na(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));yl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(Mt),null;case 4:return Be(),null;case 10:return bn(t.type),null;case 22:case 23:return Na(t),pc(),e!==null&&B(Sl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return bn(Lt),null;case 25:return null;default:return null}}function Bm(e,t){switch(ec(t),t.tag){case 3:bn(Lt),Be();break;case 26:case 27:case 5:bt(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&Na(t);break;case 13:Na(t);break;case 19:B(Mt);break;case 10:bn(t.type);break;case 22:case 23:Na(t),pc(),e!==null&&B(Sl);break;case 24:bn(Lt)}}function rs(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var c=r.next;a=c;do{if((a.tag&e)===e){r=void 0;var d=a.create,x=a.inst;r=d(),x.destroy=r}a=a.next}while(a!==c)}}catch(S){st(t,t.return,S)}}function Xn(e,t,a){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&e)===e){var x=r.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,c=t;var C=a,L=S;try{L()}catch(V){st(c,C,V)}}}r=r.next}while(r!==d)}}catch(V){st(t,t.return,V)}}function $m(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{zf(t,a)}catch(r){st(e,e.return,r)}}}function qm(e,t,a){a.props=El(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){st(e,t,r)}}function ss(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(c){st(e,t,c)}}function on(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(c){st(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){st(e,t,c)}else a.current=null}function Ym(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(c){st(e,e.return,c)}}function Qc(e,t,a){try{var r=e.stateNode;Db(r,e.type,a,t),r[he]=t}catch(c){st(e,e.return,c)}}function Gm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wn(e.type)||e.tag===4}function Zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Wn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fc(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=hn));else if(r!==4&&(r===27&&Wn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Fc(e,t,a),e=e.sibling;e!==null;)Fc(e,t,a),e=e.sibling}function Ri(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Wn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ri(e,t,a),e=e.sibling;e!==null;)Ri(e,t,a),e=e.sibling}function Vm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);It(t,r,a),t[oe]=e,t[he]=a}catch(d){st(e,e.return,d)}}var Nn=!1,Bt=!1,Jc=!1,Km=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function db(e,t){if(e=e.containerInfo,xu=Fi,e=af(e),Go(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var x=0,S=-1,C=-1,L=0,V=0,I=e,U=null;t:for(;;){for(var q;I!==a||c!==0&&I.nodeType!==3||(S=x+c),I!==d||r!==0&&I.nodeType!==3||(C=x+r),I.nodeType===3&&(x+=I.nodeValue.length),(q=I.firstChild)!==null;)U=I,I=q;for(;;){if(I===e)break t;if(U===a&&++L===c&&(S=x),U===d&&++V===r&&(C=x),(q=I.nextSibling)!==null)break;I=U,U=I.parentNode}I=q}a=S===-1||C===-1?null:{start:S,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;for(yu={focusedElem:e,selectionRange:a},Fi=!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,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,r=a.stateNode;try{var ve=El(a.type,c);e=r.getSnapshotBeforeUpdate(ve,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(ze){st(a,a.return,ze)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Su(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Su(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 Xm(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:En(e,a),r&4&&rs(5,a);break;case 1:if(En(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){st(a,a.return,x)}else{var c=El(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){st(a,a.return,x)}}r&64&&$m(a),r&512&&ss(a,a.return);break;case 3:if(En(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{zf(e,t)}catch(x){st(a,a.return,x)}}break;case 27:t===null&&r&4&&Vm(a);case 26:case 5:En(e,a),t===null&&r&4&&Ym(a),r&512&&ss(a,a.return);break;case 12:En(e,a);break;case 31:En(e,a),r&4&&Fm(e,a);break;case 13:En(e,a),r&4&&Jm(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=vb.bind(null,a),$b(e,a))));break;case 22:if(r=a.memoizedState!==null||Nn,!r){t=t!==null&&t.memoizedState!==null||Bt,c=Nn;var d=Bt;Nn=r,(Bt=t)&&!d?Cn(e,a,(a.subtreeFlags&8772)!==0):En(e,a),Nn=c,Bt=d}break;case 30:break;default:En(e,a)}}function Qm(e){var t=e.alternate;t!==null&&(e.alternate=null,Qm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dt(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 vt=null,da=!1;function wn(e,t,a){for(a=a.child;a!==null;)Zm(e,t,a),a=a.sibling}function Zm(e,t,a){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(Qt,a)}catch{}switch(a.tag){case 26:Bt||on(a,t),wn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||on(a,t);var r=vt,c=da;Wn(a.type)&&(vt=a.stateNode,da=!1),wn(e,t,a),ps(a.stateNode),vt=r,da=c;break;case 5:Bt||on(a,t);case 6:if(r=vt,c=da,vt=null,wn(e,t,a),vt=r,da=c,vt!==null)if(da)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(a.stateNode)}catch(d){st(a,t,d)}else try{vt.removeChild(a.stateNode)}catch(d){st(a,t,d)}break;case 18:vt!==null&&(da?(e=vt,$h(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),_r(e)):$h(vt,a.stateNode));break;case 4:r=vt,c=da,vt=a.stateNode.containerInfo,da=!0,wn(e,t,a),vt=r,da=c;break;case 0:case 11:case 14:case 15:Xn(2,a,t),Bt||Xn(4,a,t),wn(e,t,a);break;case 1:Bt||(on(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&qm(a,t,r)),wn(e,t,a);break;case 21:wn(e,t,a);break;case 22:Bt=(r=Bt)||a.memoizedState!==null,wn(e,t,a),Bt=r;break;default:wn(e,t,a)}}function Fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{_r(e)}catch(a){st(t,t.return,a)}}}function Jm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{_r(e)}catch(a){st(t,t.return,a)}}function fb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Km),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Km),t;default:throw Error(i(435,e.tag))}}function Ti(e,t){var a=fb(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=Sb.bind(null,e,r);r.then(c,c)}})}function fa(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var c=a[r],d=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(Wn(S.type)){vt=S.stateNode,da=!1;break e}break;case 5:vt=S.stateNode,da=!1;break e;case 3:case 4:vt=S.stateNode.containerInfo,da=!0;break e}S=S.return}if(vt===null)throw Error(i(160));Zm(d,x,c),vt=null,da=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pm(t,e),t=t.sibling}var Pa=null;function Pm(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fa(t,e),ma(e),r&4&&(Xn(3,e,e.return),rs(3,e),Xn(5,e,e.return));break;case 1:fa(t,e),ma(e),r&512&&(Bt||a===null||on(a,a.return)),r&64&&Nn&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var c=Pa;if(fa(t,e),ma(e),r&512&&(Bt||a===null||on(a,a.return)),r&4){var d=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":d=c.getElementsByTagName("title")[0],(!d||d[$e]||d[oe]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),It(d,r,a),d[oe]=e,mt(d),r=d;break e;case"link":var x=Ph("link","href",c).get(r+(a.href||""));if(x){for(var S=0;S<x.length;S++)if(d=x[S],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(S,1);break t}}d=c.createElement(r),It(d,r,a),c.head.appendChild(d);break;case"meta":if(x=Ph("meta","content",c).get(r+(a.content||""))){for(S=0;S<x.length;S++)if(d=x[S],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(S,1);break t}}d=c.createElement(r),It(d,r,a),c.head.appendChild(d);break;default:throw Error(i(468,r))}d[oe]=e,mt(d),r=d}e.stateNode=r}else Ih(c,e.type,e.stateNode);else e.stateNode=Jh(c,r,e.memoizedProps);else d!==r?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,r===null?Ih(c,e.type,e.stateNode):Jh(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,a.memoizedProps)}break;case 27:fa(t,e),ma(e),r&512&&(Bt||a===null||on(a,a.return)),a!==null&&r&4&&Qc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(fa(t,e),ma(e),r&512&&(Bt||a===null||on(a,a.return)),e.flags&32){c=e.stateNode;try{Kl(c,"")}catch(ve){st(e,e.return,ve)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Qc(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Jc=!0);break;case 6:if(fa(t,e),ma(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(ve){st(e,e.return,ve)}}break;case 3:if(Ki=null,c=Pa,Pa=Gi(t.containerInfo),fa(t,e),Pa=c,ma(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{_r(t.containerInfo)}catch(ve){st(e,e.return,ve)}Jc&&(Jc=!1,Im(e));break;case 4:r=Pa,Pa=Gi(e.stateNode.containerInfo),fa(t,e),ma(e),Pa=r;break;case 12:fa(t,e),ma(e);break;case 31:fa(t,e),ma(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ti(e,r)));break;case 13:fa(t,e),ma(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Oi=Nt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ti(e,r)));break;case 22:c=e.memoizedState!==null;var C=a!==null&&a.memoizedState!==null,L=Nn,V=Bt;if(Nn=L||c,Bt=V||C,fa(t,e),Bt=V,Nn=L,ma(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||C||Nn||Bt||Cl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){C=a=t;try{if(d=C.stateNode,c)x=d.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=C.stateNode;var I=C.memoizedProps.style,U=I!=null&&I.hasOwnProperty("display")?I.display:null;S.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(ve){st(C,C.return,ve)}}}else if(t.tag===6){if(a===null){C=t;try{C.stateNode.nodeValue=c?"":C.memoizedProps}catch(ve){st(C,C.return,ve)}}}else if(t.tag===18){if(a===null){C=t;try{var q=C.stateNode;c?qh(q,!0):qh(C.stateNode,!1)}catch(ve){st(C,C.return,ve)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ti(e,a))));break;case 19:fa(t,e),ma(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ti(e,r)));break;case 30:break;case 21:break;default:fa(t,e),ma(e)}}function ma(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Gm(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=Zc(e);Ri(e,d,c);break;case 5:var x=a.stateNode;a.flags&32&&(Kl(x,""),a.flags&=-33);var S=Zc(e);Ri(e,S,x);break;case 3:case 4:var C=a.stateNode.containerInfo,L=Zc(e);Fc(e,L,C);break;default:throw Error(i(161))}}catch(V){st(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Im(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Im(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function En(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xm(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xn(4,t,t.return),Cl(t);break;case 1:on(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&qm(t,t.return,a),Cl(t);break;case 27:ps(t.stateNode);case 26:case 5:on(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function Cn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,d=t,x=d.flags;switch(d.tag){case 0:case 11:case 15:Cn(c,d,a),rs(4,d);break;case 1:if(Cn(c,d,a),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){st(r,r.return,L)}if(r=d,c=r.updateQueue,c!==null){var S=r.stateNode;try{var C=c.shared.hiddenCallbacks;if(C!==null)for(c.shared.hiddenCallbacks=null,c=0;c<C.length;c++)Tf(C[c],S)}catch(L){st(r,r.return,L)}}a&&x&64&&$m(d),ss(d,d.return);break;case 27:Vm(d);case 26:case 5:Cn(c,d,a),a&&r===null&&x&4&&Ym(d),ss(d,d.return);break;case 12:Cn(c,d,a);break;case 31:Cn(c,d,a),a&&x&4&&Fm(c,d);break;case 13:Cn(c,d,a),a&&x&4&&Jm(c,d);break;case 22:d.memoizedState===null&&Cn(c,d,a),ss(d,d.return);break;case 30:break;default:Cn(c,d,a)}t=t.sibling}}function Pc(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&&Xr(a))}function Ic(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xr(e))}function Ia(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wm(e,t,a,r),t=t.sibling}function Wm(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Ia(e,t,a,r),c&2048&&rs(9,t);break;case 1:Ia(e,t,a,r);break;case 3:Ia(e,t,a,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xr(e)));break;case 12:if(c&2048){Ia(e,t,a,r),e=t.stateNode;try{var d=t.memoizedProps,x=d.id,S=d.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){st(t,t.return,C)}}else Ia(e,t,a,r);break;case 31:Ia(e,t,a,r);break;case 13:Ia(e,t,a,r);break;case 23:break;case 22:d=t.stateNode,x=t.alternate,t.memoizedState!==null?d._visibility&2?Ia(e,t,a,r):is(e,t):d._visibility&2?Ia(e,t,a,r):(d._visibility|=2,dr(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Pc(x,t);break;case 24:Ia(e,t,a,r),c&2048&&Ic(t.alternate,t);break;default:Ia(e,t,a,r)}}function dr(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,x=t,S=a,C=r,L=x.flags;switch(x.tag){case 0:case 11:case 15:dr(d,x,S,C,c),rs(8,x);break;case 23:break;case 22:var V=x.stateNode;x.memoizedState!==null?V._visibility&2?dr(d,x,S,C,c):is(d,x):(V._visibility|=2,dr(d,x,S,C,c)),c&&L&2048&&Pc(x.alternate,x);break;case 24:dr(d,x,S,C,c),c&&L&2048&&Ic(x.alternate,x);break;default:dr(d,x,S,C,c)}t=t.sibling}}function is(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,c=r.flags;switch(r.tag){case 22:is(a,r),c&2048&&Pc(r.alternate,r);break;case 24:is(a,r),c&2048&&Ic(r.alternate,r);break;default:is(a,r)}t=t.sibling}}var os=8192;function fr(e,t,a){if(e.subtreeFlags&os)for(e=e.child;e!==null;)eh(e,t,a),e=e.sibling}function eh(e,t,a){switch(e.tag){case 26:fr(e,t,a),e.flags&os&&e.memoizedState!==null&&Ib(a,Pa,e.memoizedState,e.memoizedProps);break;case 5:fr(e,t,a);break;case 3:case 4:var r=Pa;Pa=Gi(e.stateNode.containerInfo),fr(e,t,a),Pa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=os,os=16777216,fr(e,t,a),os=r):fr(e,t,a));break;default:fr(e,t,a)}}function th(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function cs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Xt=r,nh(r,e)}th(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ah(e),e=e.sibling}function ah(e){switch(e.tag){case 0:case 11:case 15:cs(e),e.flags&2048&&Xn(9,e,e.return);break;case 3:cs(e);break;case 12:cs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zi(e)):cs(e);break;default:cs(e)}}function zi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Xt=r,nh(r,e)}th(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xn(8,t,t.return),zi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,zi(t));break;default:zi(t)}e=e.sibling}}function nh(e,t){for(;Xt!==null;){var a=Xt;switch(a.tag){case 0:case 11:case 15:Xn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Xr(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Xt=r;else e:for(a=e;Xt!==null;){r=Xt;var c=r.sibling,d=r.return;if(Qm(r),r===a){Xt=null;break e}if(c!==null){c.return=d,Xt=c;break e}Xt=d}}}var mb={getCacheForType:function(e){var t=Jt(Lt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Jt(Lt).controller.signal}},hb=typeof WeakMap=="function"?WeakMap:Map,nt=0,ft=null,Ge=null,Ke=0,rt=0,wa=null,Qn=!1,mr=!1,Wc=!1,Rn=0,Rt=0,Zn=0,Rl=0,eu=0,Ea=0,hr=0,us=null,ha=null,tu=!1,Oi=0,lh=0,Di=1/0,Mi=null,Fn=null,Gt=0,Jn=null,pr=null,Tn=0,au=0,nu=null,rh=null,ds=0,lu=null;function Ca(){return(nt&2)!==0&&Ke!==0?Ke&-Ke:A.T!==null?uu():ae()}function sh(){if(Ea===0)if((Ke&536870912)===0||Fe){var e=fe;fe<<=1,(fe&3932160)===0&&(fe=262144),Ea=e}else Ea=536870912;return e=ja.current,e!==null&&(e.flags|=32),Ea}function pa(e,t,a){(e===ft&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(gr(e,0),Pn(e,Ke,Ea,!1)),va(e,a),((nt&2)===0||e!==ft)&&(e===ft&&((nt&2)===0&&(Rl|=a),Rt===4&&Pn(e,Ke,Ea,!1)),cn(e))}function ih(e,t,a){if((nt&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||la(e,t),c=r?xb(e,t):su(e,t,!0),d=r;do{if(c===0){mr&&!r&&Pn(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!pb(a)){c=su(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;c=us;var C=S.current.memoizedState.isDehydrated;if(C&&(gr(S,x).flags|=256),x=su(S,x,!1),x!==2){if(Wc&&!C){S.errorRecoveryDisabledLanes|=d,Rl|=d,c=4;break e}d=ha,ha=c,d!==null&&(ha===null?ha=d:ha.push.apply(ha,d))}c=x}if(d=!1,c!==2)continue}}if(c===1){gr(e,0),Pn(e,t,0,!0);break}e:{switch(r=e,d=c,d){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Pn(r,t,Ea,!Qn);break e;case 2:ha=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Oi+300-Nt(),10<c)){if(Pn(r,t,Ea,!Qn),lt(r,0,!0)!==0)break e;Tn=t,r.timeoutHandle=Hh(oh.bind(null,r,a,ha,Mi,tu,t,Ea,Rl,hr,Qn,d,"Throttled",-0,0),c);break e}oh(r,a,ha,Mi,tu,t,Ea,Rl,hr,Qn,d,null,-0,0)}}break}while(!0);cn(e)}function oh(e,t,a,r,c,d,x,S,C,L,V,I,U,q){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:hn},eh(t,d,I);var ve=(d&62914560)===d?Oi-Nt():(d&4194048)===d?lh-Nt():0;if(ve=Wb(I,ve),ve!==null){Tn=d,e.cancelPendingCommit=ve(gh.bind(null,e,t,d,a,r,c,x,S,C,V,I,null,U,q)),Pn(e,d,x,!L);return}}gh(e,t,d,a,r,c,x,S,C)}function pb(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var c=a[r],d=c.getSnapshot;c=c.value;try{if(!Sa(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Pn(e,t,a,r){t&=~eu,t&=~Rl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-me(c),x=1<<d;r[d]=-1,c&=~x}a!==0&&Gs(e,a,t)}function Ai(){return(nt&6)===0?(fs(0),!1):!0}function ru(){if(Ge!==null){if(rt===0)var e=Ge.return;else e=Ge,yn=bl=null,Sc(e),sr=null,Zr=0,e=Ge;for(;e!==null;)Bm(e.alternate,e),e=e.return;Ge=null}}function gr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,kb(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Tn=0,ru(),ft=e,Ge=a=gn(e.current,null),Ke=t,rt=0,wa=null,Qn=!1,mr=la(e,t),Wc=!1,hr=Ea=eu=Rl=Zn=Rt=0,ha=us=null,tu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-me(r),d=1<<c;t|=e[c],r&=~d}return Rn=t,ti(),a}function ch(e,t){ke=null,A.H=as,t===rr||t===ci?(t=wf(),rt=3):t===cc?(t=wf(),rt=4):rt=t===Uc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,wa=t,Ge===null&&(Rt=1,ji(e,La(t,e.current)))}function uh(){var e=ja.current;return e===null?!0:(Ke&4194048)===Ke?$a===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===$a:!1}function dh(){var e=A.H;return A.H=as,e===null?as:e}function fh(){var e=A.A;return A.A=mb,e}function ki(){Rt=4,Qn||(Ke&4194048)!==Ke&&ja.current!==null||(mr=!0),(Zn&134217727)===0&&(Rl&134217727)===0||ft===null||Pn(ft,Ke,Ea,!1)}function su(e,t,a){var r=nt;nt|=2;var c=dh(),d=fh();(ft!==e||Ke!==t)&&(Mi=null,gr(e,t)),t=!1;var x=Rt;e:do try{if(rt!==0&&Ge!==null){var S=Ge,C=wa;switch(rt){case 8:ru(),x=6;break e;case 3:case 2:case 9:case 6:ja.current===null&&(t=!0);var L=rt;if(rt=0,wa=null,xr(e,S,C,L),a&&mr){x=0;break e}break;default:L=rt,rt=0,wa=null,xr(e,S,C,L)}}gb(),x=Rt;break}catch(V){ch(e,V)}while(!0);return t&&e.shellSuspendCounter++,yn=bl=null,nt=r,A.H=c,A.A=d,Ge===null&&(ft=null,Ke=0,ti()),x}function gb(){for(;Ge!==null;)mh(Ge)}function xb(e,t){var a=nt;nt|=2;var r=dh(),c=fh();ft!==e||Ke!==t?(Mi=null,Di=Nt()+500,gr(e,t)):mr=la(e,t);e:do try{if(rt!==0&&Ge!==null){t=Ge;var d=wa;t:switch(rt){case 1:rt=0,wa=null,xr(e,t,d,1);break;case 2:case 9:if(jf(d)){rt=0,wa=null,hh(t);break}t=function(){rt!==2&&rt!==9||ft!==e||(rt=7),cn(e)},d.then(t,t);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:jf(d)?(rt=0,wa=null,hh(t)):(rt=0,wa=null,xr(e,t,d,7));break;case 5:var x=null;switch(Ge.tag){case 26:x=Ge.memoizedState;case 5:case 27:var S=Ge;if(x?Wh(x):S.stateNode.complete){rt=0,wa=null;var C=S.sibling;if(C!==null)Ge=C;else{var L=S.return;L!==null?(Ge=L,Li(L)):Ge=null}break t}}rt=0,wa=null,xr(e,t,d,5);break;case 6:rt=0,wa=null,xr(e,t,d,6);break;case 8:ru(),Rt=6;break e;default:throw Error(i(462))}}yb();break}catch(V){ch(e,V)}while(!0);return yn=bl=null,A.H=r,A.A=c,nt=a,Ge!==null?0:(ft=null,Ke=0,ti(),Rt)}function yb(){for(;Ge!==null&&!na();)mh(Ge)}function mh(e){var t=Um(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?Li(e):Ge=t}function hh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Om(a,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Om(a,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:Sc(t);default:Bm(a,t),t=Ge=ff(t,Rn),t=Um(a,t,Rn)}e.memoizedProps=e.pendingProps,t===null?Li(e):Ge=t}function xr(e,t,a,r){yn=bl=null,Sc(t),sr=null,Zr=0;var c=t.return;try{if(sb(e,c,t,a,Ke)){Rt=1,ji(e,La(a,e.current)),Ge=null;return}}catch(d){if(c!==null)throw Ge=c,d;Rt=1,ji(e,La(a,e.current)),Ge=null;return}t.flags&32768?(Fe||r===1?e=!0:mr||(Ke&536870912)!==0?e=!1:(Qn=e=!0,(r===2||r===9||r===3||r===6)&&(r=ja.current,r!==null&&r.tag===13&&(r.flags|=16384))),ph(t,e)):Li(t)}function Li(e){var t=e;do{if((t.flags&32768)!==0){ph(t,Qn);return}e=t.return;var a=cb(t.alternate,t,Rn);if(a!==null){Ge=a;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Rt===0&&(Rt=5)}function ph(e,t){do{var a=ub(e.alternate,e);if(a!==null){a.flags&=32767,Ge=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=a}while(e!==null);Rt=6,Ge=null}function gh(e,t,a,r,c,d,x,S,C){e.cancelPendingCommit=null;do Ui();while(Gt!==0);if((nt&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=Zo,$l(e,a,d,x,S,C),e===ft&&(Ge=ft=null,Ke=0),pr=t,Jn=e,Tn=a,au=d,nu=c,rh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_b($t,function(){return Sh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=A.T,A.T=null,c=ee.p,ee.p=2,x=nt,nt|=4;try{db(e,t,a)}finally{nt=x,ee.p=c,A.T=r}}Gt=1,xh(),yh(),bh()}}function xh(){if(Gt===1){Gt=0;var e=Jn,t=pr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null;var r=ee.p;ee.p=2;var c=nt;nt|=4;try{Pm(t,e);var d=yu,x=af(e.containerInfo),S=d.focusedElem,C=d.selectionRange;if(x!==S&&S&&S.ownerDocument&&tf(S.ownerDocument.documentElement,S)){if(C!==null&&Go(S)){var L=C.start,V=C.end;if(V===void 0&&(V=L),"selectionStart"in S)S.selectionStart=L,S.selectionEnd=Math.min(V,S.value.length);else{var I=S.ownerDocument||document,U=I&&I.defaultView||window;if(U.getSelection){var q=U.getSelection(),ve=S.textContent.length,ze=Math.min(C.start,ve),ct=C.end===void 0?ze:Math.min(C.end,ve);!q.extend&&ze>ct&&(x=ct,ct=ze,ze=x);var M=ef(S,ze),T=ef(S,ct);if(M&&T&&(q.rangeCount!==1||q.anchorNode!==M.node||q.anchorOffset!==M.offset||q.focusNode!==T.node||q.focusOffset!==T.offset)){var k=I.createRange();k.setStart(M.node,M.offset),q.removeAllRanges(),ze>ct?(q.addRange(k),q.extend(T.node,T.offset)):(k.setEnd(T.node,T.offset),q.addRange(k))}}}}for(I=[],q=S;q=q.parentNode;)q.nodeType===1&&I.push({element:q,left:q.scrollLeft,top:q.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}}Fi=!!xu,yu=xu=null}finally{nt=c,ee.p=r,A.T=a}}e.current=t,Gt=2}}function yh(){if(Gt===2){Gt=0;var e=Jn,t=pr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=A.T,A.T=null;var r=ee.p;ee.p=2;var c=nt;nt|=4;try{Xm(e,t.alternate,t)}finally{nt=c,ee.p=r,A.T=a}}Gt=3}}function bh(){if(Gt===4||Gt===3){Gt=0,ba();var e=Jn,t=pr,a=Tn,r=rh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Gt=5:(Gt=0,pr=Jn=null,vh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Fn=null),H(a),t=t.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(Qt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=A.T,c=ee.p,ee.p=2,A.T=null;try{for(var d=e.onRecoverableError,x=0;x<r.length;x++){var S=r[x];d(S.value,{componentStack:S.stack})}}finally{A.T=t,ee.p=c}}(Tn&3)!==0&&Ui(),cn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===lu?ds++:(ds=0,lu=e):ds=0,fs(0)}}function vh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xr(t)))}function Ui(){return xh(),yh(),bh(),Sh()}function Sh(){if(Gt!==5)return!1;var e=Jn,t=au;au=0;var a=H(Tn),r=A.T,c=ee.p;try{ee.p=32>a?32:a,A.T=null,a=nu,nu=null;var d=Jn,x=Tn;if(Gt=0,pr=Jn=null,Tn=0,(nt&6)!==0)throw Error(i(331));var S=nt;if(nt|=4,ah(d.current),Wm(d,d.current,x,a),nt=S,fs(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(Qt,d)}catch{}return!0}finally{ee.p=c,A.T=r,vh(e,t)}}function _h(e,t,a){t=La(a,t),t=Lc(e.stateNode,t,2),e=Gn(e,t,2),e!==null&&(va(e,2),cn(e))}function st(e,t,a){if(e.tag===3)_h(e,e,a);else for(;t!==null;){if(t.tag===3){_h(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fn===null||!Fn.has(r))){e=La(a,e),a=jm(2),r=Gn(t,a,2),r!==null&&(Nm(a,r,t,e),va(r,2),cn(r));break}}t=t.return}}function iu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new hb;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(a)||(Wc=!0,c.add(a),e=bb.bind(null,e,t,a),t.then(e,e))}function bb(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ft===e&&(Ke&a)===a&&(Rt===4||Rt===3&&(Ke&62914560)===Ke&&300>Nt()-Oi?(nt&2)===0&&gr(e,0):eu|=a,hr===Ke&&(hr=0)),cn(e)}function jh(e,t){t===0&&(t=Za()),e=gl(e,t),e!==null&&(va(e,t),cn(e))}function vb(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),jh(e,a)}function Sb(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),jh(e,a)}function _b(e,t){return Da(e,t)}var Hi=null,yr=null,ou=!1,Bi=!1,cu=!1,In=0;function cn(e){e!==yr&&e.next===null&&(yr===null?Hi=yr=e:yr=yr.next=e),Bi=!0,ou||(ou=!0,Nb())}function fs(e,t){if(!cu&&Bi){cu=!0;do for(var a=!1,r=Hi;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var x=r.suspendedLanes,S=r.pingedLanes;d=(1<<31-me(42|e)+1)-1,d&=c&~(x&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Ch(r,d))}else d=Ke,d=lt(r,r===ft?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||la(r,d)||(a=!0,Ch(r,d));r=r.next}while(a);cu=!1}}function jb(){Nh()}function Nh(){Bi=ou=!1;var e=0;In!==0&&Ab()&&(e=In);for(var t=Nt(),a=null,r=Hi;r!==null;){var c=r.next,d=wh(r,t);d===0?(r.next=null,a===null?Hi=c:a.next=c,c===null&&(yr=a)):(a=r,(e!==0||(d&3)!==0)&&(Bi=!0)),r=c}Gt!==0&&Gt!==5||fs(e),In!==0&&(In=0)}function wh(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var x=31-me(d),S=1<<x,C=c[x];C===-1?((S&a)===0||(S&r)!==0)&&(c[x]=Ma(S,t)):C<=t&&(e.expiredLanes|=S),d&=~S}if(t=ft,a=Ke,a=lt(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Vt(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||la(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Vt(r),H(a)){case 2:case 8:a=Qe;break;case 32:a=$t;break;case 268435456:a=ht;break;default:a=$t}return r=Eh.bind(null,e),a=Da(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Vt(r),e.callbackPriority=2,e.callbackNode=null,2}function Eh(e,t){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ui()&&e.callbackNode!==a)return null;var r=Ke;return r=lt(e,e===ft?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(ih(e,r,t),wh(e,Nt()),e.callbackNode!=null&&e.callbackNode===a?Eh.bind(null,e):null)}function Ch(e,t){if(Ui())return null;ih(e,t,!0)}function Nb(){Lb(function(){(nt&6)!==0?Da(Oe,jb):Nh()})}function uu(){if(In===0){var e=nr;e===0&&(e=te,te<<=1,(te&261888)===0&&(te=256)),In=e}return In}function Rh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qs(""+e)}function Th(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function wb(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var d=Rh((c[he]||null).action),x=r.submitter;x&&(t=(t=x[he]||null)?Rh(t.formAction):x.getAttribute("formAction"),t!==null&&(d=t,x=null));var S=new Ps("action","action",null,r,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(In!==0){var C=x?Th(c,x):new FormData(c);zc(a,{pending:!0,data:C,method:c.method,action:d},null,C)}}else typeof d=="function"&&(S.preventDefault(),C=x?Th(c,x):new FormData(c),zc(a,{pending:!0,data:C,method:c.method,action:d},d,C))},currentTarget:c}]})}}for(var du=0;du<Qo.length;du++){var fu=Qo[du],Eb=fu.toLowerCase(),Cb=fu[0].toUpperCase()+fu.slice(1);Ja(Eb,"on"+Cb)}Ja(rf,"onAnimationEnd"),Ja(sf,"onAnimationIteration"),Ja(of,"onAnimationStart"),Ja("dblclick","onDoubleClick"),Ja("focusin","onFocus"),Ja("focusout","onBlur"),Ja(Gy,"onTransitionRun"),Ja(Vy,"onTransitionStart"),Ja(Ky,"onTransitionCancel"),Ja(cf,"onTransitionEnd"),nn("onMouseEnter",["mouseout","mouseover"]),nn("onMouseLeave",["mouseout","mouseover"]),nn("onPointerEnter",["pointerout","pointerover"]),nn("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 ms="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(" "),Rb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ms));function zh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],c=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var x=r.length-1;0<=x;x--){var S=r[x],C=S.instance,L=S.currentTarget;if(S=S.listener,C!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(V){ei(V)}c.currentTarget=null,d=C}else for(x=0;x<r.length;x++){if(S=r[x],C=S.instance,L=S.currentTarget,S=S.listener,C!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(V){ei(V)}c.currentTarget=null,d=C}}}}function Ve(e,t){var a=t[Ee];a===void 0&&(a=t[Ee]=new Set);var r=e+"__bubble";a.has(r)||(Oh(t,e,2,!1),a.add(r))}function mu(e,t,a){var r=0;t&&(r|=4),Oh(a,e,r,t)}var $i="_reactListening"+Math.random().toString(36).slice(2);function hu(e){if(!e[$i]){e[$i]=!0,kn.forEach(function(a){a!=="selectionchange"&&(Rb.has(a)||mu(a,!1,e),mu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$i]||(t[$i]=!0,mu("selectionchange",!1,t))}}function Oh(e,t,a,r){switch(sp(t)){case 2:var c=av;break;case 8:c=nv;break;default:c=Tu}a=c.bind(null,t,a,e),c=void 0,!Ao||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function pu(e,t,a,r,c){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var x=r.tag;if(x===3||x===4){var S=r.stateNode.containerInfo;if(S===c)break;if(x===4)for(x=r.return;x!==null;){var C=x.tag;if((C===3||C===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;S!==null;){if(x=pt(S),x===null)return;if(C=x.tag,C===5||C===6||C===26||C===27){r=d=x;continue e}S=S.parentNode}}r=r.return}kd(function(){var L=d,V=Do(a),I=[];e:{var U=uf.get(e);if(U!==void 0){var q=Ps,ve=e;switch(e){case"keypress":if(Fs(a)===0)break e;case"keydown":case"keyup":q=Sy;break;case"focusin":ve="focus",q=Ho;break;case"focusout":ve="blur",q=Ho;break;case"beforeblur":case"afterblur":q=Ho;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":q=Hd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=cy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Ny;break;case rf:case sf:case of:q=fy;break;case cf:q=Ey;break;case"scroll":case"scrollend":q=iy;break;case"wheel":q=Ry;break;case"copy":case"cut":case"paste":q=hy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=$d;break;case"toggle":case"beforetoggle":q=zy}var ze=(t&4)!==0,ct=!ze&&(e==="scroll"||e==="scrollend"),M=ze?U!==null?U+"Capture":null:U;ze=[];for(var T=L,k;T!==null;){var J=T;if(k=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||k===null||M===null||(J=kr(T,M),J!=null&&ze.push(hs(T,J,k))),ct)break;T=T.return}0<ze.length&&(U=new q(U,ve,null,a,V),I.push({event:U,listeners:ze}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",U&&a!==Oo&&(ve=a.relatedTarget||a.fromElement)&&(pt(ve)||ve[ge]))break e;if((q||U)&&(U=V.window===V?V:(U=V.ownerDocument)?U.defaultView||U.parentWindow:window,q?(ve=a.relatedTarget||a.toElement,q=L,ve=ve?pt(ve):null,ve!==null&&(ct=u(ve),ze=ve.tag,ve!==ct||ze!==5&&ze!==27&&ze!==6)&&(ve=null)):(q=null,ve=L),q!==ve)){if(ze=Hd,J="onMouseLeave",M="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(ze=$d,J="onPointerLeave",M="onPointerEnter",T="pointer"),ct=q==null?U:Pe(q),k=ve==null?U:Pe(ve),U=new ze(J,T+"leave",q,a,V),U.target=ct,U.relatedTarget=k,J=null,pt(V)===L&&(ze=new ze(M,T+"enter",ve,a,V),ze.target=k,ze.relatedTarget=ct,J=ze),ct=J,q&&ve)t:{for(ze=Tb,M=q,T=ve,k=0,J=M;J;J=ze(J))k++;J=0;for(var Ce=T;Ce;Ce=ze(Ce))J++;for(;0<k-J;)M=ze(M),k--;for(;0<J-k;)T=ze(T),J--;for(;k--;){if(M===T||T!==null&&M===T.alternate){ze=M;break t}M=ze(M),T=ze(T)}ze=null}else ze=null;q!==null&&Dh(I,U,q,ze,!1),ve!==null&&ct!==null&&Dh(I,ct,ve,ze,!0)}}e:{if(U=L?Pe(L):window,q=U.nodeName&&U.nodeName.toLowerCase(),q==="select"||q==="input"&&U.type==="file")var et=Zd;else if(Xd(U))if(Fd)et=$y;else{et=Hy;var _e=Uy}else q=U.nodeName,!q||q.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&zo(L.elementType)&&(et=Zd):et=By;if(et&&(et=et(e,L))){Qd(I,et,a,V);break e}_e&&_e(e,U,L),e==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&To(U,"number",U.value)}switch(_e=L?Pe(L):window,e){case"focusin":(Xd(_e)||_e.contentEditable==="true")&&(Fl=_e,Vo=L,Gr=null);break;case"focusout":Gr=Vo=Fl=null;break;case"mousedown":Ko=!0;break;case"contextmenu":case"mouseup":case"dragend":Ko=!1,nf(I,a,V);break;case"selectionchange":if(Yy)break;case"keydown":case"keyup":nf(I,a,V)}var Le;if($o)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Zl?Vd(e,a)&&(Xe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Xe="onCompositionStart");Xe&&(qd&&a.locale!=="ko"&&(Zl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Zl&&(Le=Ld()):(Ln=V,ko="value"in Ln?Ln.value:Ln.textContent,Zl=!0)),_e=qi(L,Xe),0<_e.length&&(Xe=new Bd(Xe,e,null,a,V),I.push({event:Xe,listeners:_e}),Le?Xe.data=Le:(Le=Kd(a),Le!==null&&(Xe.data=Le)))),(Le=Dy?My(e,a):Ay(e,a))&&(Xe=qi(L,"onBeforeInput"),0<Xe.length&&(_e=new Bd("onBeforeInput","beforeinput",null,a,V),I.push({event:_e,listeners:Xe}),_e.data=Le)),wb(I,e,L,a,V)}zh(I,t)})}function hs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function qi(e,t){for(var a=t+"Capture",r=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=kr(e,a),c!=null&&r.unshift(hs(e,c,d)),c=kr(e,t),c!=null&&r.push(hs(e,c,d))),e.tag===3)return r;e=e.return}return[]}function Tb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dh(e,t,a,r,c){for(var d=t._reactName,x=[];a!==null&&a!==r;){var S=a,C=S.alternate,L=S.stateNode;if(S=S.tag,C!==null&&C===r)break;S!==5&&S!==26&&S!==27||L===null||(C=L,c?(L=kr(a,d),L!=null&&x.unshift(hs(a,L,C))):c||(L=kr(a,d),L!=null&&x.push(hs(a,L,C)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var zb=/\r\n?/g,Ob=/\u0000|\uFFFD/g;function Mh(e){return(typeof e=="string"?e:""+e).replace(zb,`
|
|
9
|
+
`).replace(Ob,"")}function Ah(e,t){return t=Mh(t),Mh(e)===t}function ot(e,t,a,r,c,d){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Kl(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Kl(e,""+r);break;case"className":Dt(e,"class",r);break;case"tabIndex":Dt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Dt(e,a,r);break;case"style":Md(e,r,d);break;case"data":if(t!=="object"){Dt(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Qs(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&ot(e,t,"name",c.name,c,null),ot(e,t,"formEncType",c.formEncType,c,null),ot(e,t,"formMethod",c.formMethod,c,null),ot(e,t,"formTarget",c.formTarget,c,null)):(ot(e,t,"encType",c.encType,c,null),ot(e,t,"method",c.method,c,null),ot(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Qs(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=hn);break;case"onScroll":r!=null&&Ve("scroll",e);break;case"onScrollEnd":r!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Qs(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),qe(e,"popover",r);break;case"xlinkActuate":ea(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ea(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ea(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ea(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ea(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ea(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ea(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ea(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ea(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":qe(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ry.get(a)||a,qe(e,a,r))}}function gu(e,t,a,r,c,d){switch(a){case"style":Md(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof r=="string"?Kl(e,r):(typeof r=="number"||typeof r=="bigint")&&Kl(e,""+r);break;case"onScroll":r!=null&&Ve("scroll",e);break;case"onScrollEnd":r!=null&&Ve("scrollend",e);break;case"onClick":r!=null&&(e.onclick=hn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fa.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[he]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof r=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,c);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):qe(e,a,r)}}}function It(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var r=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var x=a[d];if(x!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ot(e,t,d,x,a,null)}}c&&ot(e,t,"srcSet",a.srcSet,a,null),r&&ot(e,t,"src",a.src,a,null);return;case"input":Ve("invalid",e);var S=d=x=c=null,C=null,L=null;for(r in a)if(a.hasOwnProperty(r)){var V=a[r];if(V!=null)switch(r){case"name":c=V;break;case"type":x=V;break;case"checked":C=V;break;case"defaultChecked":L=V;break;case"value":d=V;break;case"defaultValue":S=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(137,t));break;default:ot(e,t,r,V,a,null)}}Td(e,d,S,C,L,x,c,!1);return;case"select":Ve("invalid",e),r=x=d=null;for(c in a)if(a.hasOwnProperty(c)&&(S=a[c],S!=null))switch(c){case"value":d=S;break;case"defaultValue":x=S;break;case"multiple":r=S;default:ot(e,t,c,S,a,null)}t=d,a=x,e.multiple=!!r,t!=null?Vl(e,!!r,t,!1):a!=null&&Vl(e,!!r,a,!0);return;case"textarea":Ve("invalid",e),d=c=r=null;for(x in a)if(a.hasOwnProperty(x)&&(S=a[x],S!=null))switch(x){case"value":r=S;break;case"defaultValue":c=S;break;case"children":d=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:ot(e,t,x,S,a,null)}Od(e,r,c,d);return;case"option":for(C in a)a.hasOwnProperty(C)&&(r=a[C],r!=null)&&(C==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":ot(e,t,C,r,a,null));return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(r=0;r<ms.length;r++)Ve(ms[r],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in a)if(a.hasOwnProperty(L)&&(r=a[L],r!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ot(e,t,L,r,a,null)}return;default:if(zo(t)){for(V in a)a.hasOwnProperty(V)&&(r=a[V],r!==void 0&&gu(e,t,V,r,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(r=a[S],r!=null&&ot(e,t,S,r,a,null))}function Db(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,x=null,S=null,C=null,L=null,V=null;for(q in a){var I=a[q];if(a.hasOwnProperty(q)&&I!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":C=I;default:r.hasOwnProperty(q)||ot(e,t,q,null,r,I)}}for(var U in r){var q=r[U];if(I=a[U],r.hasOwnProperty(U)&&(q!=null||I!=null))switch(U){case"type":d=q;break;case"name":c=q;break;case"checked":L=q;break;case"defaultChecked":V=q;break;case"value":x=q;break;case"defaultValue":S=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,t));break;default:q!==I&&ot(e,t,U,q,r,I)}}Ro(e,x,S,C,L,V,d,c);return;case"select":q=x=S=U=null;for(d in a)if(C=a[d],a.hasOwnProperty(d)&&C!=null)switch(d){case"value":break;case"multiple":q=C;default:r.hasOwnProperty(d)||ot(e,t,d,null,r,C)}for(c in r)if(d=r[c],C=a[c],r.hasOwnProperty(c)&&(d!=null||C!=null))switch(c){case"value":U=d;break;case"defaultValue":S=d;break;case"multiple":x=d;default:d!==C&&ot(e,t,c,d,r,C)}t=S,a=x,r=q,U!=null?Vl(e,!!a,U,!1):!!r!=!!a&&(t!=null?Vl(e,!!a,t,!0):Vl(e,!!a,a?[]:"",!1));return;case"textarea":q=U=null;for(S in a)if(c=a[S],a.hasOwnProperty(S)&&c!=null&&!r.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ot(e,t,S,null,r,c)}for(x in r)if(c=r[x],d=a[x],r.hasOwnProperty(x)&&(c!=null||d!=null))switch(x){case"value":U=c;break;case"defaultValue":q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&ot(e,t,x,c,r,d)}zd(e,U,q);return;case"option":for(var ve in a)U=a[ve],a.hasOwnProperty(ve)&&U!=null&&!r.hasOwnProperty(ve)&&(ve==="selected"?e.selected=!1:ot(e,t,ve,null,r,U));for(C in r)U=r[C],q=a[C],r.hasOwnProperty(C)&&U!==q&&(U!=null||q!=null)&&(C==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":ot(e,t,C,U,r,q));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 ze in a)U=a[ze],a.hasOwnProperty(ze)&&U!=null&&!r.hasOwnProperty(ze)&&ot(e,t,ze,null,r,U);for(L in r)if(U=r[L],q=a[L],r.hasOwnProperty(L)&&U!==q&&(U!=null||q!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,t));break;default:ot(e,t,L,U,r,q)}return;default:if(zo(t)){for(var ct in a)U=a[ct],a.hasOwnProperty(ct)&&U!==void 0&&!r.hasOwnProperty(ct)&&gu(e,t,ct,void 0,r,U);for(V in r)U=r[V],q=a[V],!r.hasOwnProperty(V)||U===q||U===void 0&&q===void 0||gu(e,t,V,U,r,q);return}}for(var M in a)U=a[M],a.hasOwnProperty(M)&&U!=null&&!r.hasOwnProperty(M)&&ot(e,t,M,null,r,U);for(I in r)U=r[I],q=a[I],!r.hasOwnProperty(I)||U===q||U==null&&q==null||ot(e,t,I,U,r,q)}function kh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Mb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var c=a[r],d=c.transferSize,x=c.initiatorType,S=c.duration;if(d&&S&&kh(x)){for(x=0,S=c.responseEnd,r+=1;r<a.length;r++){var C=a[r],L=C.startTime;if(L>S)break;var V=C.transferSize,I=C.initiatorType;V&&kh(I)&&(C=C.responseEnd,x+=V*(C<S?1:(S-L)/(C-L)))}if(--r,t+=8*(d+x)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xu=null,yu=null;function Yi(e){return e.nodeType===9?e:e.ownerDocument}function Lh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Uh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function bu(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 vu=null;function Ab(){var e=window.event;return e&&e.type==="popstate"?e===vu?!1:(vu=e,!0):(vu=null,!1)}var Hh=typeof setTimeout=="function"?setTimeout:void 0,kb=typeof clearTimeout=="function"?clearTimeout:void 0,Bh=typeof Promise=="function"?Promise:void 0,Lb=typeof queueMicrotask=="function"?queueMicrotask:typeof Bh<"u"?function(e){return Bh.resolve(null).then(e).catch(Ub)}:Hh;function Ub(e){setTimeout(function(){throw e})}function Wn(e){return e==="head"}function $h(e,t){var a=t,r=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(c),_r(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")ps(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ps(a);for(var d=a.firstChild;d;){var x=d.nextSibling,S=d.nodeName;d[$e]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=x}}else a==="body"&&ps(e.ownerDocument.body);a=c}while(a);_r(t)}function qh(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function Su(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":Su(a),dt(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Hb(e,t,a,r){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[$e])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=qa(e.nextSibling),e===null)break}return null}function Bb(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=qa(e.nextSibling),e===null))return null;return e}function Yh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qa(e.nextSibling),e===null))return null;return e}function _u(e){return e.data==="$?"||e.data==="$~"}function ju(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $b(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function qa(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 Nu=null;function Gh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return qa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Vh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Kh(e,t,a){switch(t=Yi(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 ps(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dt(e)}var Ya=new Map,Xh=new Set;function Gi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var zn=ee.d;ee.d={f:qb,r:Yb,D:Gb,C:Vb,L:Kb,m:Xb,X:Zb,S:Qb,M:Fb};function qb(){var e=zn.f(),t=Ai();return e||t}function Yb(e){var t=Et(e);t!==null&&t.tag===5&&t.type==="form"?cm(t):zn.r(e)}var br=typeof document>"u"?null:document;function Qh(e,t,a){var r=br;if(r&&typeof t=="string"&&t){var c=Aa(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Xh.has(c)||(Xh.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),It(t,"link",e),mt(t),r.head.appendChild(t)))}}function Gb(e){zn.D(e),Qh("dns-prefetch",e,null)}function Vb(e,t){zn.C(e,t),Qh("preconnect",e,t)}function Kb(e,t,a){zn.L(e,t,a);var r=br;if(r&&e&&t){var c='link[rel="preload"][as="'+Aa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+Aa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+Aa(a.imageSizes)+'"]')):c+='[href="'+Aa(e)+'"]';var d=c;switch(t){case"style":d=vr(e);break;case"script":d=Sr(e)}Ya.has(d)||(e=b({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ya.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(gs(d))||t==="script"&&r.querySelector(xs(d))||(t=r.createElement("link"),It(t,"link",e),mt(t),r.head.appendChild(t)))}}function Xb(e,t){zn.m(e,t);var a=br;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Aa(r)+'"][href="'+Aa(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Sr(e)}if(!Ya.has(d)&&(e=b({rel:"modulepreload",href:e},t),Ya.set(d,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(xs(d)))return}r=a.createElement("link"),It(r,"link",e),mt(r),a.head.appendChild(r)}}}function Qb(e,t,a){zn.S(e,t,a);var r=br;if(r&&e){var c=Yt(r).hoistableStyles,d=vr(e);t=t||"default";var x=c.get(d);if(!x){var S={loading:0,preload:null};if(x=r.querySelector(gs(d)))S.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ya.get(d))&&wu(e,a);var C=x=r.createElement("link");mt(C),It(C,"link",e),C._p=new Promise(function(L,V){C.onload=L,C.onerror=V}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Vi(x,t,r)}x={type:"stylesheet",instance:x,count:1,state:S},c.set(d,x)}}}function Zb(e,t){zn.X(e,t);var a=br;if(a&&e){var r=Yt(a).hoistableScripts,c=Sr(e),d=r.get(c);d||(d=a.querySelector(xs(c)),d||(e=b({src:e,async:!0},t),(t=Ya.get(c))&&Eu(e,t),d=a.createElement("script"),mt(d),It(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Fb(e,t){zn.M(e,t);var a=br;if(a&&e){var r=Yt(a).hoistableScripts,c=Sr(e),d=r.get(c);d||(d=a.querySelector(xs(c)),d||(e=b({src:e,async:!0,type:"module"},t),(t=Ya.get(c))&&Eu(e,t),d=a.createElement("script"),mt(d),It(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Zh(e,t,a,r){var c=(c=Ne.current)?Gi(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=vr(a.href),a=Yt(c).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=vr(a.href);var d=Yt(c).hoistableStyles,x=d.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,x),(d=c.querySelector(gs(e)))&&!d._p&&(x.instance=d,x.state.loading=5),Ya.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},Ya.set(e,a),d||Jb(c,e,a,x.state))),t&&r===null)throw Error(i(528,""));return x}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Sr(a),a=Yt(c).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function vr(e){return'href="'+Aa(e)+'"'}function gs(e){return'link[rel="stylesheet"]['+e+"]"}function Fh(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Jb(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),It(t,"link",a),mt(t),e.head.appendChild(t))}function Sr(e){return'[src="'+Aa(e)+'"]'}function xs(e){return"script[async]"+e}function Jh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Aa(a.href)+'"]');if(r)return t.instance=r,mt(r),r;var c=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),mt(r),It(r,"style",c),Vi(r,a.precedence,e),t.instance=r;case"stylesheet":c=vr(a.href);var d=e.querySelector(gs(c));if(d)return t.state.loading|=4,t.instance=d,mt(d),d;r=Fh(a),(c=Ya.get(c))&&wu(r,c),d=(e.ownerDocument||e).createElement("link"),mt(d);var x=d;return x._p=new Promise(function(S,C){x.onload=S,x.onerror=C}),It(d,"link",r),t.state.loading|=4,Vi(d,a.precedence,e),t.instance=d;case"script":return d=Sr(a.src),(c=e.querySelector(xs(d)))?(t.instance=c,mt(c),c):(r=a,(c=Ya.get(d))&&(r=b({},a),Eu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),mt(c),It(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Vi(r,a.precedence,e));return t.instance}function Vi(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,x=0;x<r.length;x++){var S=r[x];if(S.dataset.precedence===t)d=S;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function wu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Eu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ki=null;function Ph(e,t,a){if(Ki===null){var r=new Map,c=Ki=new Map;c.set(a,r)}else c=Ki,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[$e]||d[oe]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var x=d.getAttribute(t)||"";x=e+x;var S=r.get(x);S?S.push(d):r.set(x,[d])}}return r}function Ih(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Pb(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 Wh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ib(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=vr(r.href),d=t.querySelector(gs(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,mt(d);return}d=t.ownerDocument||t,r=Fh(r),(c=Ya.get(c))&&wu(r,c),d=d.createElement("link"),mt(d);var x=d;x._p=new Promise(function(S,C){x.onload=S,x.onerror=C}),It(d,"link",r),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Xi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Cu=0;function Wb(e,t){return e.stylesheets&&e.count===0&&Zi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Zi(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Cu===0&&(Cu=62500*Mb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zi(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Cu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Xi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qi=null;function Zi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qi=new Map,t.forEach(ev,e),Qi=null,Xi.call(e))}function ev(e,t){if(!(t.state.loading&4)){var a=Qi.get(e);if(a)var r=a.get(null);else{a=new Map,Qi.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var x=c[d];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),r=x)}r&&a.set(null,r)}c=t.instance,x=c.getAttribute("data-precedence"),d=a.get(x)||r,d===r&&a.set(null,c),a.set(x,c),this.count++,r=Xi.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ys={$$typeof:Y,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function tv(e,t,a,r,c,d,x,S,C){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=an(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=an(0),this.hiddenUpdates=an(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function ep(e,t,a,r,c,d,x,S,C,L,V,I){return e=new tv(e,t,a,x,C,L,V,I,S),t=1,d===!0&&(t|=24),d=_a(3,null,null,t),e.current=d,d.stateNode=e,t=sc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:a,cache:t},uc(d),e}function tp(e){return e?(e=Il,e):Il}function ap(e,t,a,r,c,d){c=tp(c),r.context===null?r.context=c:r.pendingContext=c,r=Yn(t),r.payload={element:a},d=d===void 0?null:d,d!==null&&(r.callback=d),a=Gn(e,r,t),a!==null&&(pa(a,e,t),Jr(a,e,t))}function np(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ru(e,t){np(e,t),(e=e.alternate)&&np(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=gl(e,67108864);t!==null&&pa(t,e,67108864),Ru(e,67108864)}}function rp(e){if(e.tag===13||e.tag===31){var t=Ca();t=D(t);var a=gl(e,t);a!==null&&pa(a,e,t),Ru(e,t)}}var Fi=!0;function av(e,t,a,r){var c=A.T;A.T=null;var d=ee.p;try{ee.p=2,Tu(e,t,a,r)}finally{ee.p=d,A.T=c}}function nv(e,t,a,r){var c=A.T;A.T=null;var d=ee.p;try{ee.p=8,Tu(e,t,a,r)}finally{ee.p=d,A.T=c}}function Tu(e,t,a,r){if(Fi){var c=zu(r);if(c===null)pu(e,t,r,Ji,a),ip(e,r);else if(rv(c,e,t,a,r))r.stopPropagation();else if(ip(e,r),t&4&&-1<lv.indexOf(e)){for(;c!==null;){var d=Et(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var x=Je(d.pendingLanes);if(x!==0){var S=d;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var C=1<<31-me(x);S.entanglements[1]|=C,x&=~C}cn(d),(nt&6)===0&&(Di=Nt()+500,fs(0))}}break;case 31:case 13:S=gl(d,2),S!==null&&pa(S,d,2),Ai(),Ru(d,2)}if(d=zu(r),d===null&&pu(e,t,r,Ji,a),d===c)break;c=d}c!==null&&r.stopPropagation()}else pu(e,t,r,null,a)}}function zu(e){return e=Do(e),Ou(e)}var Ji=null;function Ou(e){if(Ji=null,e=pt(e),e!==null){var t=u(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ji=e,null}function sp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ye()){case Oe:return 2;case Qe:return 8;case $t:case Ot:return 32;case ht:return 268435456;default:return 32}default:return 32}}var Du=!1,el=null,tl=null,al=null,bs=new Map,vs=new Map,nl=[],lv="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ip(e,t){switch(e){case"focusin":case"focusout":el=null;break;case"dragenter":case"dragleave":tl=null;break;case"mouseover":case"mouseout":al=null;break;case"pointerover":case"pointerout":bs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vs.delete(t.pointerId)}}function Ss(e,t,a,r,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Et(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function rv(e,t,a,r,c){switch(t){case"focusin":return el=Ss(el,e,t,a,r,c),!0;case"dragenter":return tl=Ss(tl,e,t,a,r,c),!0;case"mouseover":return al=Ss(al,e,t,a,r,c),!0;case"pointerover":var d=c.pointerId;return bs.set(d,Ss(bs.get(d)||null,e,t,a,r,c)),!0;case"gotpointercapture":return d=c.pointerId,vs.set(d,Ss(vs.get(d)||null,e,t,a,r,c)),!0}return!1}function op(e){var t=pt(e.target);if(t!==null){var a=u(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,se(e.priority,function(){rp(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,se(e.priority,function(){rp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=zu(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Oo=r,a.target.dispatchEvent(r),Oo=null}else return t=Et(a),t!==null&&lp(t),e.blockedOn=a,!1;t.shift()}return!0}function cp(e,t,a){Pi(e)&&a.delete(t)}function sv(){Du=!1,el!==null&&Pi(el)&&(el=null),tl!==null&&Pi(tl)&&(tl=null),al!==null&&Pi(al)&&(al=null),bs.forEach(cp),vs.forEach(cp)}function Ii(e,t){e.blockedOn===t&&(e.blockedOn=null,Du||(Du=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,sv)))}var Wi=null;function up(e){Wi!==e&&(Wi=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Wi===e&&(Wi=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Ou(r||a)===null)continue;break}var d=Et(a);d!==null&&(e.splice(t,3),t-=3,zc(d,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function _r(e){function t(C){return Ii(C,e)}el!==null&&Ii(el,e),tl!==null&&Ii(tl,e),al!==null&&Ii(al,e),bs.forEach(t),vs.forEach(t);for(var a=0;a<nl.length;a++){var r=nl[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<nl.length&&(a=nl[0],a.blockedOn===null);)op(a),a.blockedOn===null&&nl.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var c=a[r],d=a[r+1],x=c[he]||null;if(typeof d=="function")x||up(a);else if(x){var S=null;if(d&&d.hasAttribute("formAction")){if(c=d,x=d[he]||null)S=x.formAction;else if(Ou(c)!==null)continue}else S=x.action;typeof S=="function"?a[r+1]=S:(a.splice(r,3),r-=3),up(a)}}}function dp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(x){return c=x})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Mu(e){this._internalRoot=e}eo.prototype.render=Mu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=Ca();ap(a,r,e,t,null,null)},eo.prototype.unmount=Mu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),Ai(),t[ge]=null}};function eo(e){this._internalRoot=e}eo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ae();e={blockedOn:null,target:e,priority:t};for(var a=0;a<nl.length&&t!==0&&t<nl[a].priority;a++);nl.splice(a,0,e),a===0&&op(e)}};var fp=l.version;if(fp!=="19.2.4")throw Error(i(527,fp,"19.2.4"));ee.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 iv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var to=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!to.isDisabled&&to.supportsFiber)try{Qt=to.inject(iv),qt=to}catch{}}return Ns.createRoot=function(e,t){if(!o(e))throw Error(i(299));var a=!1,r="",c=bm,d=vm,x=Sm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=ep(e,1,!1,null,null,a,r,null,c,d,x,dp),e[ge]=t.current,hu(e),new Mu(t)},Ns.hydrateRoot=function(e,t,a){if(!o(e))throw Error(i(299));var r=!1,c="",d=bm,x=vm,S=Sm,C=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(C=a.formState)),t=ep(e,1,!0,t,a??null,r,c,C,d,x,S,dp),t.context=tp(null),a=t.current,r=Ca(),r=D(r),c=Yn(r),c.callback=null,Gn(a,c,r),a=r,t.current.lanes=a,va(t,a),cn(t),e[ge]=t.current,hu(e),new eo(t)},Ns.version="19.2.4",Ns}var Gp;function w0(){if(Gp)return qu.exports;Gp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),qu.exports=N0(),qu.exports}var E0=w0();var Ig=n=>{throw TypeError(n)},C0=(n,l,s)=>l.has(n)||Ig("Cannot "+s),Ku=(n,l,s)=>(C0(n,l,"read from private field"),s?s.call(n):l.get(n)),R0=(n,l,s)=>l.has(n)?Ig("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,s),Vp="popstate";function Kp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function T0(n={}){function l(i,o){let u=o.state?.masked,{pathname:m,search:p,hash:g}=u||i.location;return As("",{pathname:m,search:p,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function s(i,o){return typeof o=="string"?o:fn(o)}return O0(l,s,null,n)}function He(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Tt(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function z0(){return Math.random().toString(36).substring(2,10)}function Xp(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function As(n,l,s=null,i,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Mn(l):l,state:s,key:l&&l.key||i||z0(),unstable_mask:o}}function fn({pathname:n="/",search:l="",hash:s=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Mn(n){let l={};if(n){let s=n.indexOf("#");s>=0&&(l.hash=n.substring(s),n=n.substring(0,s));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function O0(n,l,s,i={}){let{window:o=document.defaultView,v5Compat:u=!1}=i,m=o.history,p="POP",g=null,h=v();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function v(){return(m.state||{idx:null}).idx}function b(){p="POP";let O=v(),X=O==null?null:O-h;h=O,g&&g({action:p,location:z.location,delta:X})}function j(O,X){p="PUSH";let Q=Kp(O)?O:As(z.location,O,X);h=v()+1;let Y=Xp(Q,h),G=z.createHref(Q.unstable_mask||Q);try{m.pushState(Y,"",G)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;o.location.assign(G)}u&&g&&g({action:p,location:z.location,delta:1})}function _(O,X){p="REPLACE";let Q=Kp(O)?O:As(z.location,O,X);h=v();let Y=Xp(Q,h),G=z.createHref(Q.unstable_mask||Q);m.replaceState(Y,"",G),u&&g&&g({action:p,location:z.location,delta:0})}function N(O){return Wg(O)}let z={get action(){return p},get location(){return n(o,m)},listen(O){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(Vp,b),g=O,()=>{o.removeEventListener(Vp,b),g=null}},createHref(O){return l(o,O)},createURL:N,encodeLocation(O){let X=N(O);return{pathname:X.pathname,search:X.search,hash:X.hash}},push:j,replace:_,go(O){return m.go(O)}};return z}function Wg(n,l=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),He(s,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:fn(n);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=s+i),new URL(i,s)}var Rs,Qp=class{constructor(n){if(R0(this,Rs,new Map),n)for(let[l,s]of n)this.set(l,s)}get(n){if(Ku(this,Rs).has(n))return Ku(this,Rs).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,l){Ku(this,Rs).set(n,l)}};Rs=new WeakMap;var D0=new Set(["lazy","caseSensitive","path","id","index","children"]);function M0(n){return D0.has(n)}var A0=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function k0(n){return A0.has(n)}function L0(n){return n.index===!0}function ks(n,l,s=[],i={},o=!1){return n.map((u,m)=>{let p=[...s,String(m)],g=typeof u.id=="string"?u.id:p.join("-");if(He(u.index!==!0||!u.children,"Cannot specify children on an index route"),He(o||!i[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),L0(u)){let h={...u,id:g};return i[g]=Zp(h,l(h)),h}else{let h={...u,id:g,children:void 0};return i[g]=Zp(h,l(h)),u.children&&(h.children=ks(u.children,l,p,i,o)),h}})}function Zp(n,l){return Object.assign(n,{...l,...typeof l.lazy=="object"&&l.lazy!=null?{lazy:{...n.lazy,...l.lazy}}:{}})}function rl(n,l,s="/"){return Ts(n,l,s,!1)}function Ts(n,l,s,i){let o=typeof l=="string"?Mn(l):l,u=Ka(o.pathname||"/",s);if(u==null)return null;let m=ex(n);H0(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=F0(u);p=Q0(m[g],h,i)}return p}function U0(n,l){let{route:s,pathname:i,params:o}=n;return{id:s.id,pathname:i,params:o,data:l[s.id],loaderData:l[s.id],handle:s.handle}}function ex(n,l=[],s=[],i="",o=!1){let u=(m,p,g=o,h)=>{let v={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(i)&&g)return;He(v.relativePath.startsWith(i),`Absolute route path "${v.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(i.length)}let b=Wa([i,v.relativePath]),j=s.concat(v);m.children&&m.children.length>0&&(He(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),ex(m.children,l,j,b,g)),!(m.path==null&&!m.index)&&l.push({path:b,score:K0(b,m.index),routesMeta:j})};return n.forEach((m,p)=>{if(m.path===""||!m.path?.includes("?"))u(m,p);else for(let g of tx(m.path))u(m,p,!0,g)}),l}function tx(n){let l=n.split("/");if(l.length===0)return[];let[s,...i]=l,o=s.endsWith("?"),u=s.replace(/\?$/,"");if(i.length===0)return o?[u,""]:[u];let m=tx(i.join("/")),p=[];return p.push(...m.map(g=>g===""?u:[u,g].join("/"))),o&&p.push(...m),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function H0(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:X0(l.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var B0=/^:[\w-]+$/,$0=3,q0=2,Y0=1,G0=10,V0=-2,Fp=n=>n==="*";function K0(n,l){let s=n.split("/"),i=s.length;return s.some(Fp)&&(i+=V0),l&&(i+=q0),s.filter(o=>!Fp(o)).reduce((o,u)=>o+(B0.test(u)?$0:u===""?Y0:G0),i)}function X0(n,l){return n.length===l.length&&n.slice(0,-1).every((i,o)=>i===l[o])?n[n.length-1]-l[l.length-1]:0}function Q0(n,l,s=!1){let{routesMeta:i}=n,o={},u="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,v=u==="/"?l:l.slice(u.length)||"/",b=xo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},v),j=g.route;if(!b&&h&&s&&!i[i.length-1].route.index&&(b=xo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!b)return null;Object.assign(o,b.params),m.push({params:o,pathname:Wa([u,b.pathname]),pathnameBase:I0(Wa([u,b.pathnameBase])),route:j}),b.pathnameBase!=="/"&&(u=Wa([u,b.pathnameBase]))}return m}function xo(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=Z0(n.path,n.caseSensitive,n.end),o=l.match(s);if(!o)return null;let u=o[0],m=u.replace(/(.)\/+$/,"$1"),p=o.slice(1);return{params:i.reduce((h,{paramName:v,isOptional:b},j)=>{if(v==="*"){let N=p[j]||"";m=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const _=p[j];return b&&!_?h[v]=void 0:h[v]=(_||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:m,pattern:n}}function Z0(n,l=!1,s=!0){Tt(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==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,l?void 0:"i"),i]}function F0(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Tt(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function Ka(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,i=n.charAt(s);return i&&i!=="/"?null:n.slice(s)||"/"}function J0({basename:n,pathname:l}){return l==="/"?n:Wa([n,l])}var ax=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yd=n=>ax.test(n);function P0(n,l="/"){let{pathname:s,search:i="",hash:o=""}=typeof n=="string"?Mn(n):n,u;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?u=Jp(s.substring(1),"/"):u=Jp(s,l)):u=l,{pathname:u,search:W0(i),hash:e1(o)}}function Jp(n,l){let s=l.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function Xu(n,l,s,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function nx(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function vo(n){let l=nx(n);return l.map((s,i)=>i===l.length-1?s.pathname:s.pathnameBase)}function Us(n,l,s,i=!1){let o;typeof n=="string"?o=Mn(n):(o={...n},He(!o.pathname||!o.pathname.includes("?"),Xu("?","pathname","search",o)),He(!o.pathname||!o.pathname.includes("#"),Xu("#","pathname","hash",o)),He(!o.search||!o.search.includes("#"),Xu("#","search","hash",o)));let u=n===""||o.pathname==="",m=u?"/":o.pathname,p;if(m==null)p=s;else{let b=l.length-1;if(!i&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),b-=1;o.pathname=j.join("/")}p=b>=0?l[b]:"/"}let g=P0(o,p),h=m&&m!=="/"&&m.endsWith("/"),v=(u||m===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(h||v)&&(g.pathname+="/"),g}var Wa=n=>n.join("/").replace(/\/\/+/g,"/"),I0=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),W0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,e1=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Hs=class{constructor(n,l,s,i=!1){this.status=n,this.statusText=l||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Or(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Bs(n){return n.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var lx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rx(n,l){let s=n;if(typeof s!="string"||!ax.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(lx)try{let u=new URL(window.location.href),m=s.startsWith("//")?new URL(u.protocol+s):new URL(s),p=Ka(m.pathname,l);m.origin===u.origin&&p!=null?s=p+m.search+m.hash:o=!0}catch{Tt(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:o,to:s}}var ol=Symbol("Uninstrumented");function t1(n,l){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(o=>o({id:l.id,index:l.index,path:l.path,instrument(u){let m=Object.keys(s);for(let p of m)u[p]&&s[p].push(u[p])}}));let i={};if(typeof l.lazy=="function"&&s.lazy.length>0){let o=Rr(s.lazy,l.lazy,()=>{});o&&(i.lazy=o)}if(typeof l.lazy=="object"){let o=l.lazy;["middleware","loader","action"].forEach(u=>{let m=o[u],p=s[`lazy.${u}`];if(typeof m=="function"&&p.length>0){let g=Rr(p,m,()=>{});g&&(i.lazy=Object.assign(i.lazy||{},{[u]:g}))}})}return["loader","action"].forEach(o=>{let u=l[o];if(typeof u=="function"&&s[o].length>0){let m=u[ol]??u,p=Rr(s[o],m,(...g)=>Pp(g[0]));p&&(o==="loader"&&m.hydrate===!0&&(p.hydrate=!0),p[ol]=m,i[o]=p)}}),l.middleware&&l.middleware.length>0&&s.middleware.length>0&&(i.middleware=l.middleware.map(o=>{let u=o[ol]??o,m=Rr(s.middleware,u,(...p)=>Pp(p[0]));return m?(m[ol]=u,m):o})),i}function a1(n,l){let s={navigate:[],fetch:[]};if(l.forEach(i=>i({instrument(o){let u=Object.keys(o);for(let m of u)o[m]&&s[m].push(o[m])}})),s.navigate.length>0){let i=n.navigate[ol]??n.navigate,o=Rr(s.navigate,i,(...u)=>{let[m,p]=u;return{to:typeof m=="number"||typeof m=="string"?m:m?fn(m):".",...Ip(n,p??{})}});o&&(o[ol]=i,n.navigate=o)}if(s.fetch.length>0){let i=n.fetch[ol]??n.fetch,o=Rr(s.fetch,i,(...u)=>{let[m,,p,g]=u;return{href:p??".",fetcherKey:m,...Ip(n,g??{})}});o&&(o[ol]=i,n.fetch=o)}return n}function Rr(n,l,s){return n.length===0?null:async(...i)=>{let o=await sx(n,s(...i),()=>l(...i),n.length-1);if(o.type==="error")throw o.value;return o.value}}async function sx(n,l,s,i){let o=n[i],u;if(o){let m,p=async()=>(m?console.error("You cannot call instrumented handlers more than once"):m=sx(n,l,s,i-1),u=await m,He(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(p,l)}catch(g){console.error("An instrumentation function threw an error:",g)}m||await p(),await m}else try{u={type:"success",value:await s()}}catch(m){u={type:"error",value:m}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Pp(n){let{request:l,context:s,params:i,unstable_pattern:o}=n;return{request:n1(l),params:{...i},unstable_pattern:o,context:l1(s)}}function Ip(n,l){return{currentUrl:fn(n.state.location),..."formMethod"in l?{formMethod:l.formMethod}:{},..."formEncType"in l?{formEncType:l.formEncType}:{},..."formData"in l?{formData:l.formData}:{},..."body"in l?{body:l.body}:{}}}function n1(n){return{method:n.method,url:n.url,headers:{get:(...l)=>n.headers.get(...l)}}}function l1(n){if(s1(n)){let l={...n};return Object.freeze(l),l}else return{get:l=>n.get(l)}}var r1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function s1(n){if(n===null||typeof n!="object")return!1;const l=Object.getPrototypeOf(n);return l===Object.prototype||l===null||Object.getOwnPropertyNames(l).sort().join("\0")===r1}var ix=["POST","PUT","PATCH","DELETE"],i1=new Set(ix),o1=["GET",...ix],c1=new Set(o1),ox=new Set([301,302,303,307,308]),u1=new Set([307,308]),Qu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},d1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ws={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},f1=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),cx="remix-router-transitions",ux=Symbol("ResetLoaderData");function m1(n){const l=n.window?n.window:typeof window<"u"?window:void 0,s=typeof l<"u"&&typeof l.document<"u"&&typeof l.document.createElement<"u";He(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=n.hydrationRouteProperties||[],o=n.mapRouteProperties||f1,u=o;if(n.unstable_instrumentations){let R=n.unstable_instrumentations;u=D=>({...o(D),...t1(R.map(H=>H.route).filter(Boolean),D)})}let m={},p=ks(n.routes,u,void 0,m),g,h=n.basename||"/";h.startsWith("/")||(h=`/${h}`);let v=n.dataStrategy||y1,b={...n.future},j=null,_=new Set,N=null,z=null,O=null,X=n.hydrationData!=null,Q=rl(p,n.history.location,h),Y=!1,G=null,K,ne;if(Q==null&&!n.patchRoutesOnNavigation){let R=Ga(404,{pathname:n.history.location.pathname}),{matches:D,route:H}=no(p);K=!0,ne=!K,Q=D,G={[H.id]:R}}else if(Q&&!n.hydrationData&&an(Q,p,n.history.location.pathname).active&&(Q=null),Q)if(Q.some(R=>R.route.lazy))K=!1,ne=!K;else if(!Q.some(R=>bd(R.route)))K=!0,ne=!K;else{let R=n.hydrationData?n.hydrationData.loaderData:null,D=n.hydrationData?n.hydrationData.errors:null,H=Q;if(D){let ae=Q.findIndex(se=>D[se.route.id]!==void 0);H=H.slice(0,ae+1)}ne=!1,K=H.every(ae=>{let se=dx(ae.route,R,D);return ne=ne||se.renderFallback,!se.shouldLoad})}else{K=!1,ne=!K,Q=[];let R=an(null,p,n.history.location.pathname);R.active&&R.matches&&(Y=!0,Q=R.matches)}let Z,E={historyAction:n.history.action,location:n.history.location,matches:Q,initialized:K,renderFallback:ne,navigation:Qu,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||G,fetchers:new Map,blockers:new Map},$="POP",W=null,de=!1,ie,re=!1,ue=new Map,xe=null,A=!1,ee=!1,ce=new Set,P=new Map,Se=0,w=-1,B=new Map,F=new Set,le=new Map,pe=new Map,Ne=new Set,we=new Map,ut,Be=null;function xa(){if(j=n.history.listen(({action:R,location:D,delta:H})=>{if(ut){ut(),ut=void 0;return}Tt(we.size===0||H!=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 ae=Ye({currentLocation:E.location,nextLocation:D,historyAction:R});if(ae&&H!=null){let se=new Promise(be=>{ut=be});n.history.go(H*-1),fe(ae,{state:"blocked",location:D,proceed(){fe(ae,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),se.then(()=>n.history.go(H))},reset(){let be=new Map(E.blockers);be.set(ae,ws),Ie({blockers:be})}}),W?.resolve(),W=null;return}return zt(R,D)}),s){L1(l,ue);let R=()=>U1(l,ue);l.addEventListener("pagehide",R),xe=()=>l.removeEventListener("pagehide",R)}return E.initialized||zt("POP",E.location,{initialHydration:!0}),Z}function bt(){j&&j(),xe&&xe(),_.clear(),ie&&ie.abort(),E.fetchers.forEach((R,D)=>Qt(D)),E.blockers.forEach((R,D)=>te(D))}function at(R){return _.add(R),()=>_.delete(R)}function Ie(R,D={}){R.matches&&(R.matches=R.matches.map(se=>{let be=m[se.route.id],oe=se.route;return oe.element!==be.element||oe.errorElement!==be.errorElement||oe.hydrateFallbackElement!==be.hydrateFallbackElement?{...se,route:be}:se})),E={...E,...R};let H=[],ae=[];E.fetchers.forEach((se,be)=>{se.state==="idle"&&(Ne.has(be)?H.push(be):ae.push(be))}),Ne.forEach(se=>{!E.fetchers.has(se)&&!P.has(se)&&H.push(se)}),[..._].forEach(se=>se(E,{deletedFetchers:H,newErrors:R.errors??null,viewTransitionOpts:D.viewTransitionOpts,flushSync:D.flushSync===!0})),H.forEach(se=>Qt(se)),ae.forEach(se=>E.fetchers.delete(se))}function _t(R,D,{flushSync:H}={}){let ae=E.actionData!=null&&E.navigation.formMethod!=null&&aa(E.navigation.formMethod)&&E.navigation.state==="loading"&&R.state?._isRedirect!==!0,se;D.actionData?Object.keys(D.actionData).length>0?se=D.actionData:se=null:ae?se=E.actionData:se=null;let be=D.loaderData?og(E.loaderData,D.loaderData,D.matches||[],D.errors):E.loaderData,oe=E.blockers;oe.size>0&&(oe=new Map(oe),oe.forEach((Re,je)=>oe.set(je,ws)));let he=A?!1:Za(R,D.matches||E.matches),ge=de===!0||E.navigation.formMethod!=null&&aa(E.navigation.formMethod)&&R.state?._isRedirect!==!0;g&&(p=g,g=void 0),A||$==="POP"||($==="PUSH"?n.history.push(R,R.state):$==="REPLACE"&&n.history.replace(R,R.state));let Ee;if($==="POP"){let Re=ue.get(E.location.pathname);Re&&Re.has(R.pathname)?Ee={currentLocation:E.location,nextLocation:R}:ue.has(R.pathname)&&(Ee={currentLocation:R,nextLocation:E.location})}else if(re){let Re=ue.get(E.location.pathname);Re?Re.add(R.pathname):(Re=new Set([R.pathname]),ue.set(E.location.pathname,Re)),Ee={currentLocation:E.location,nextLocation:R}}Ie({...D,actionData:se,loaderData:be,historyAction:$,location:R,initialized:!0,renderFallback:!1,navigation:Qu,revalidation:"idle",restoreScrollPosition:he,preventScrollReset:ge,blockers:oe},{viewTransitionOpts:Ee,flushSync:H===!0}),$="POP",de=!1,re=!1,A=!1,ee=!1,W?.resolve(),W=null,Be?.resolve(),Be=null}async function jt(R,D){if(W?.resolve(),W=null,typeof R=="number"){W||(W=fg());let dt=W.promise;return n.history.go(R),dt}let H=id(E.location,E.matches,h,R,D?.fromRouteId,D?.relative),{path:ae,submission:se,error:be}=Wp(!1,H,D),oe;D?.unstable_mask&&(oe={pathname:"",search:"",hash:"",...typeof D.unstable_mask=="string"?Mn(D.unstable_mask):{...E.location.unstable_mask,...D.unstable_mask}});let he=E.location,ge=As(he,ae,D&&D.state,void 0,oe);ge={...ge,...n.history.encodeLocation(ge)};let Ee=D&&D.replace!=null?D.replace:void 0,Re="PUSH";Ee===!0?Re="REPLACE":Ee===!1||se!=null&&aa(se.formMethod)&&se.formAction===E.location.pathname+E.location.search&&(Re="REPLACE");let je=D&&"preventScrollReset"in D?D.preventScrollReset===!0:void 0,We=(D&&D.flushSync)===!0,$e=Ye({currentLocation:he,nextLocation:ge,historyAction:Re});if($e){fe($e,{state:"blocked",location:ge,proceed(){fe($e,{state:"proceeding",proceed:void 0,reset:void 0,location:ge}),jt(R,D)},reset(){let dt=new Map(E.blockers);dt.set($e,ws),Ie({blockers:dt})}});return}await zt(Re,ge,{submission:se,pendingError:be,preventScrollReset:je,replace:D&&D.replace,enableViewTransition:D&&D.viewTransition,flushSync:We,callSiteDefaultShouldRevalidate:D&&D.unstable_defaultShouldRevalidate})}function oa(){Be||(Be=fg()),$t(),Ie({revalidation:"loading"});let R=Be.promise;return E.navigation.state==="submitting"?R:E.navigation.state==="idle"?(zt(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),R):(zt($||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:re===!0}),R)}async function zt(R,D,H){ie&&ie.abort(),ie=null,$=R,A=(H&&H.startUninterruptedRevalidation)===!0,Ma(E.location,E.matches),de=(H&&H.preventScrollReset)===!0,re=(H&&H.enableViewTransition)===!0;let ae=g||p,se=H&&H.overrideNavigation,be=H?.initialHydration&&E.matches&&E.matches.length>0&&!Y?E.matches:rl(ae,D,h),oe=(H&&H.flushSync)===!0;if(be&&E.initialized&&!ee&&E1(E.location,D)&&!(H&&H.submission&&aa(H.submission.formMethod))){_t(D,{matches:be},{flushSync:oe});return}let he=an(be,ae,D.pathname);if(he.active&&he.matches&&(be=he.matches),!be){let{error:pt,notFoundMatches:Et,route:Pe}=Je(D.pathname);_t(D,{matches:Et,loaderData:{},errors:{[Pe.id]:pt}},{flushSync:oe});return}ie=new AbortController;let ge=Er(n.history,D,ie.signal,H&&H.submission),Ee=n.getContext?await n.getContext():new Qp,Re;if(H&&H.pendingError)Re=[sl(be).route.id,{type:"error",error:H.pendingError}];else if(H&&H.submission&&aa(H.submission.formMethod)){let pt=await Oa(ge,D,H.submission,be,Ee,he.active,H&&H.initialHydration===!0,{replace:H.replace,flushSync:oe});if(pt.shortCircuited)return;if(pt.pendingActionResult){let[Et,Pe]=pt.pendingActionResult;if(Ra(Pe)&&Or(Pe.error)&&Pe.error.status===404){ie=null,_t(D,{matches:pt.matches,loaderData:{},errors:{[Et]:Pe.error}});return}}be=pt.matches||be,Re=pt.pendingActionResult,se=Zu(D,H.submission),oe=!1,he.active=!1,ge=Er(n.history,ge.url,ge.signal)}let{shortCircuited:je,matches:We,loaderData:$e,errors:dt}=await ya(ge,D,be,Ee,he.active,se,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,oe,Re,H&&H.callSiteDefaultShouldRevalidate);je||(ie=null,_t(D,{matches:We||be,...cg(Re),loaderData:$e,errors:dt}))}async function Oa(R,D,H,ae,se,be,oe,he={}){$t();let ge=A1(D,H);if(Ie({navigation:ge},{flushSync:he.flushSync===!0}),be){let je=await va(ae,D.pathname,R.signal);if(je.type==="aborted")return{shortCircuited:!0};if(je.type==="error"){if(je.partialMatches.length===0){let{matches:$e,route:dt}=no(p);return{matches:$e,pendingActionResult:[dt.id,{type:"error",error:je.error}]}}let We=sl(je.partialMatches).route.id;return{matches:je.partialMatches,pendingActionResult:[We,{type:"error",error:je.error}]}}else if(je.matches)ae=je.matches;else{let{notFoundMatches:We,error:$e,route:dt}=Je(D.pathname);return{matches:We,pendingActionResult:[dt.id,{type:"error",error:$e}]}}}let Ee,Re=uo(ae,D);if(!Re.route.action&&!Re.route.lazy)Ee={type:"error",error:Ga(405,{method:R.method,pathname:D.pathname,routeId:Re.route.id})};else{let je=Tr(u,m,R,ae,Re,oe?[]:i,se),We=await Oe(R,je,se,null);if(Ee=We[Re.route.id],!Ee){for(let $e of ae)if(We[$e.route.id]){Ee=We[$e.route.id];break}}if(R.signal.aborted)return{shortCircuited:!0}}if(zl(Ee)){let je;return he&&he.replace!=null?je=he.replace:je=rg(Ee.response.headers.get("Location"),new URL(R.url),h,n.history)===E.location.pathname+E.location.search,await ye(R,Ee,!0,{submission:H,replace:je}),{shortCircuited:!0}}if(Ra(Ee)){let je=sl(ae,Re.route.id);return(he&&he.replace)!==!0&&($="PUSH"),{matches:ae,pendingActionResult:[je.route.id,Ee,Re.route.id]}}return{matches:ae,pendingActionResult:[Re.route.id,Ee]}}async function ya(R,D,H,ae,se,be,oe,he,ge,Ee,Re,je,We){let $e=be||Zu(D,oe),dt=oe||he||dg($e),pt=!A&&!Ee;if(se){if(pt){let Dt=Da(je);Ie({navigation:$e,...Dt!==void 0?{actionData:Dt}:{}},{flushSync:Re})}let qe=await va(H,D.pathname,R.signal);if(qe.type==="aborted")return{shortCircuited:!0};if(qe.type==="error"){if(qe.partialMatches.length===0){let{matches:ea,route:kt}=no(p);return{matches:ea,loaderData:{},errors:{[kt.id]:qe.error}}}let Dt=sl(qe.partialMatches).route.id;return{matches:qe.partialMatches,loaderData:{},errors:{[Dt]:qe.error}}}else if(qe.matches)H=qe.matches;else{let{error:Dt,notFoundMatches:ea,route:kt}=Je(D.pathname);return{matches:ea,loaderData:{},errors:{[kt.id]:Dt}}}}let Et=g||p,{dsMatches:Pe,revalidatingFetchers:Yt}=eg(R,ae,u,m,n.history,E,H,dt,D,Ee?[]:i,Ee===!0,ee,ce,Ne,le,F,Et,h,n.patchRoutesOnNavigation!=null,je,We);if(w=++Se,!n.dataStrategy&&!Pe.some(qe=>qe.shouldLoad)&&!Pe.some(qe=>qe.route.middleware&&qe.route.middleware.length>0)&&Yt.length===0){let qe=Ue();return _t(D,{matches:H,loaderData:{},errors:je&&Ra(je[1])?{[je[0]]:je[1].error}:null,...cg(je),...qe?{fetchers:new Map(E.fetchers)}:{}},{flushSync:Re}),{shortCircuited:!0}}if(pt){let qe={};if(!se){qe.navigation=$e;let Dt=Da(je);Dt!==void 0&&(qe.actionData=Dt)}Yt.length>0&&(qe.fetchers=Vt(Yt)),Ie(qe,{flushSync:Re})}Yt.forEach(qe=>{wt(qe.key),qe.controller&&P.set(qe.key,qe.controller)});let mt=()=>Yt.forEach(qe=>wt(qe.key));ie&&ie.signal.addEventListener("abort",mt);let{loaderResults:kn,fetcherResults:Fa}=await Qe(Pe,Yt,R,ae);if(R.signal.aborted)return{shortCircuited:!0};ie&&ie.signal.removeEventListener("abort",mt),Yt.forEach(qe=>P.delete(qe.key));let Kt=lo(kn);if(Kt)return await ye(R,Kt.result,!0,{replace:ge}),{shortCircuited:!0};if(Kt=lo(Fa),Kt)return F.add(Kt.key),await ye(R,Kt.result,!0,{replace:ge}),{shortCircuited:!0};let{loaderData:nn,errors:dl}=ig(E,H,kn,je,Yt,Fa);Ee&&E.errors&&(dl={...E.errors,...dl});let ln=Ue(),fl=Ze(w),ql=ln||fl||Yt.length>0;return{matches:H,loaderData:nn,errors:dl,...ql?{fetchers:new Map(E.fetchers)}:{}}}function Da(R){if(R&&!Ra(R[1]))return{[R[0]]:R[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Vt(R){return R.forEach(D=>{let H=E.fetchers.get(D.key),ae=Es(void 0,H?H.data:void 0);E.fetchers.set(D.key,ae)}),new Map(E.fetchers)}async function na(R,D,H,ae){wt(R);let se=(ae&&ae.flushSync)===!0,be=g||p,oe=id(E.location,E.matches,h,H,D,ae?.relative),he=rl(be,oe,h),ge=an(he,be,oe);if(ge.active&&ge.matches&&(he=ge.matches),!he){ht(R,D,Ga(404,{pathname:oe}),{flushSync:se});return}let{path:Ee,submission:Re,error:je}=Wp(!0,oe,ae);if(je){ht(R,D,je,{flushSync:se});return}let We=n.getContext?await n.getContext():new Qp,$e=(ae&&ae.preventScrollReset)===!0;if(Re&&aa(Re.formMethod)){await ba(R,D,Ee,he,We,ge.active,se,$e,Re,ae&&ae.unstable_defaultShouldRevalidate);return}le.set(R,{routeId:D,path:Ee}),await Nt(R,D,Ee,he,We,ge.active,se,$e,Re)}async function ba(R,D,H,ae,se,be,oe,he,ge,Ee){$t(),le.delete(R);let Re=E.fetchers.get(R);Ot(R,k1(ge,Re),{flushSync:oe});let je=new AbortController,We=Er(n.history,H,je.signal,ge);if(be){let gt=await va(ae,new URL(We.url).pathname,We.signal,R);if(gt.type==="aborted")return;if(gt.type==="error"){ht(R,D,gt.error,{flushSync:oe});return}else if(gt.matches)ae=gt.matches;else{ht(R,D,Ga(404,{pathname:H}),{flushSync:oe});return}}let $e=uo(ae,H);if(!$e.route.action&&!$e.route.lazy){let gt=Ga(405,{method:ge.formMethod,pathname:H,routeId:D});ht(R,D,gt,{flushSync:oe});return}P.set(R,je);let dt=Se,pt=Tr(u,m,We,ae,$e,i,se),Et=await Oe(We,pt,se,R),Pe=Et[$e.route.id];if(!Pe){for(let gt of pt)if(Et[gt.route.id]){Pe=Et[gt.route.id];break}}if(We.signal.aborted){P.get(R)===je&&P.delete(R);return}if(Ne.has(R)){if(zl(Pe)||Ra(Pe)){Ot(R,On(void 0));return}}else{if(zl(Pe))if(P.delete(R),w>dt){Ot(R,On(void 0));return}else return F.add(R),Ot(R,Es(ge)),ye(We,Pe,!1,{fetcherSubmission:ge,preventScrollReset:he});if(Ra(Pe)){ht(R,D,Pe.error);return}}let Yt=E.navigation.location||E.location,mt=Er(n.history,Yt,je.signal),kn=g||p,Fa=E.navigation.state!=="idle"?rl(kn,E.navigation.location,h):E.matches;He(Fa,"Didn't find any matches after fetcher action");let Kt=++Se;B.set(R,Kt);let nn=Es(ge,Pe.data);E.fetchers.set(R,nn);let{dsMatches:dl,revalidatingFetchers:ln}=eg(mt,se,u,m,n.history,E,Fa,ge,Yt,i,!1,ee,ce,Ne,le,F,kn,h,n.patchRoutesOnNavigation!=null,[$e.route.id,Pe],Ee);ln.filter(gt=>gt.key!==R).forEach(gt=>{let Yl=gt.key,Gl=E.fetchers.get(Yl),Ks=Es(void 0,Gl?Gl.data:void 0);E.fetchers.set(Yl,Ks),wt(Yl),gt.controller&&P.set(Yl,gt.controller)}),Ie({fetchers:new Map(E.fetchers)});let fl=()=>ln.forEach(gt=>wt(gt.key));je.signal.addEventListener("abort",fl);let{loaderResults:ql,fetcherResults:qe}=await Qe(dl,ln,mt,se);if(je.signal.aborted)return;if(je.signal.removeEventListener("abort",fl),B.delete(R),P.delete(R),ln.forEach(gt=>P.delete(gt.key)),E.fetchers.has(R)){let gt=On(Pe.data);E.fetchers.set(R,gt)}let Dt=lo(ql);if(Dt)return ye(mt,Dt.result,!1,{preventScrollReset:he});if(Dt=lo(qe),Dt)return F.add(Dt.key),ye(mt,Dt.result,!1,{preventScrollReset:he});let{loaderData:ea,errors:kt}=ig(E,Fa,ql,void 0,ln,qe);Ze(Kt),E.navigation.state==="loading"&&Kt>w?(He($,"Expected pending action"),ie&&ie.abort(),_t(E.navigation.location,{matches:Fa,loaderData:ea,errors:kt,fetchers:new Map(E.fetchers)})):(Ie({errors:kt,loaderData:og(E.loaderData,ea,Fa,kt),fetchers:new Map(E.fetchers)}),ee=!1)}async function Nt(R,D,H,ae,se,be,oe,he,ge){let Ee=E.fetchers.get(R);Ot(R,Es(ge,Ee?Ee.data:void 0),{flushSync:oe});let Re=new AbortController,je=Er(n.history,H,Re.signal);if(be){let Pe=await va(ae,new URL(je.url).pathname,je.signal,R);if(Pe.type==="aborted")return;if(Pe.type==="error"){ht(R,D,Pe.error,{flushSync:oe});return}else if(Pe.matches)ae=Pe.matches;else{ht(R,D,Ga(404,{pathname:H}),{flushSync:oe});return}}let We=uo(ae,H);P.set(R,Re);let $e=Se,dt=Tr(u,m,je,ae,We,i,se),Et=(await Oe(je,dt,se,R))[We.route.id];if(P.get(R)===Re&&P.delete(R),!je.signal.aborted){if(Ne.has(R)){Ot(R,On(void 0));return}if(zl(Et))if(w>$e){Ot(R,On(void 0));return}else{F.add(R),await ye(je,Et,!1,{preventScrollReset:he});return}if(Ra(Et)){ht(R,D,Et.error);return}Ot(R,On(Et.data))}}async function ye(R,D,H,{submission:ae,fetcherSubmission:se,preventScrollReset:be,replace:oe}={}){H||(W?.resolve(),W=null),D.response.headers.has("X-Remix-Revalidate")&&(ee=!0);let he=D.response.headers.get("Location");He(he,"Expected a Location header on the redirect Response"),he=rg(he,new URL(R.url),h,n.history);let ge=As(E.location,he,{_isRedirect:!0});if(s){let dt=!1;if(D.response.headers.has("X-Remix-Reload-Document"))dt=!0;else if(yd(he)){const pt=Wg(he,!0);dt=pt.origin!==l.location.origin||Ka(pt.pathname,h)==null}if(dt){oe?l.location.replace(he):l.location.assign(he);return}}ie=null;let Ee=oe===!0||D.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Re,formAction:je,formEncType:We}=E.navigation;!ae&&!se&&Re&&je&&We&&(ae=dg(E.navigation));let $e=ae||se;if(u1.has(D.response.status)&&$e&&aa($e.formMethod))await zt(Ee,ge,{submission:{...$e,formAction:he},preventScrollReset:be||de,enableViewTransition:H?re:void 0});else{let dt=Zu(ge,ae);await zt(Ee,ge,{overrideNavigation:dt,fetcherSubmission:se,preventScrollReset:be||de,enableViewTransition:H?re:void 0})}}async function Oe(R,D,H,ae){let se,be={};try{se=await v1(v,R,D,ae,H,!1)}catch(oe){return D.filter(he=>he.shouldLoad).forEach(he=>{be[he.route.id]={type:"error",error:oe}}),be}if(R.signal.aborted)return be;if(!aa(R.method))for(let oe of D){if(se[oe.route.id]?.type==="error")break;!se.hasOwnProperty(oe.route.id)&&!E.loaderData.hasOwnProperty(oe.route.id)&&(!E.errors||!E.errors.hasOwnProperty(oe.route.id))&&oe.shouldCallHandler()&&(se[oe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${oe.route.id}`)})}for(let[oe,he]of Object.entries(se))if(z1(he)){let ge=he.result;be[oe]={type:"redirect",response:N1(ge,R,oe,D,h)}}else be[oe]=await j1(he);return be}async function Qe(R,D,H,ae){let se=Oe(H,R,ae,null),be=Promise.all(D.map(async ge=>{if(ge.matches&&ge.match&&ge.request&&ge.controller){let Re=(await Oe(ge.request,ge.matches,ae,ge.key))[ge.match.route.id];return{[ge.key]:Re}}else return Promise.resolve({[ge.key]:{type:"error",error:Ga(404,{pathname:ge.path})}})})),oe=await se,he=(await be).reduce((ge,Ee)=>Object.assign(ge,Ee),{});return{loaderResults:oe,fetcherResults:he}}function $t(){ee=!0,le.forEach((R,D)=>{P.has(D)&&ce.add(D),wt(D)})}function Ot(R,D,H={}){E.fetchers.set(R,D),Ie({fetchers:new Map(E.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function ht(R,D,H,ae={}){let se=sl(E.matches,D);Qt(R),Ie({errors:{[se.route.id]:H},fetchers:new Map(E.fetchers)},{flushSync:(ae&&ae.flushSync)===!0})}function ca(R){return pe.set(R,(pe.get(R)||0)+1),Ne.has(R)&&Ne.delete(R),E.fetchers.get(R)||d1}function mn(R,D){wt(R,D?.reason),Ot(R,On(null))}function Qt(R){let D=E.fetchers.get(R);P.has(R)&&!(D&&D.state==="loading"&&B.has(R))&&wt(R),le.delete(R),B.delete(R),F.delete(R),Ne.delete(R),ce.delete(R),E.fetchers.delete(R)}function qt(R){let D=(pe.get(R)||0)-1;D<=0?(pe.delete(R),Ne.add(R)):pe.set(R,D),Ie({fetchers:new Map(E.fetchers)})}function wt(R,D){let H=P.get(R);H&&(H.abort(D),P.delete(R))}function me(R){for(let D of R){let H=ca(D),ae=On(H.data);E.fetchers.set(D,ae)}}function Ue(){let R=[],D=!1;for(let H of F){let ae=E.fetchers.get(H);He(ae,`Expected fetcher: ${H}`),ae.state==="loading"&&(F.delete(H),R.push(H),D=!0)}return me(R),D}function Ze(R){let D=[];for(let[H,ae]of B)if(ae<R){let se=E.fetchers.get(H);He(se,`Expected fetcher: ${H}`),se.state==="loading"&&(wt(H),B.delete(H),D.push(H))}return me(D),D.length>0}function Zt(R,D){let H=E.blockers.get(R)||ws;return we.get(R)!==D&&we.set(R,D),H}function te(R){E.blockers.delete(R),we.delete(R)}function fe(R,D){let H=E.blockers.get(R)||ws;He(H.state==="unblocked"&&D.state==="blocked"||H.state==="blocked"&&D.state==="blocked"||H.state==="blocked"&&D.state==="proceeding"||H.state==="blocked"&&D.state==="unblocked"||H.state==="proceeding"&&D.state==="unblocked",`Invalid blocker state transition: ${H.state} -> ${D.state}`);let ae=new Map(E.blockers);ae.set(R,D),Ie({blockers:ae})}function Ye({currentLocation:R,nextLocation:D,historyAction:H}){if(we.size===0)return;we.size>1&&Tt(!1,"A router only supports one blocker at a time");let ae=Array.from(we.entries()),[se,be]=ae[ae.length-1],oe=E.blockers.get(se);if(!(oe&&oe.state==="proceeding")&&be({currentLocation:R,nextLocation:D,historyAction:H}))return se}function Je(R){let D=Ga(404,{pathname:R}),H=g||p,{matches:ae,route:se}=no(H);return{notFoundMatches:ae,route:se,error:D}}function lt(R,D,H){if(N=R,O=D,z=H||null,!X&&E.navigation===Qu){X=!0;let ae=Za(E.location,E.matches);ae!=null&&Ie({restoreScrollPosition:ae})}return()=>{N=null,O=null,z=null}}function la(R,D){return z&&z(R,D.map(ae=>U0(ae,E.loaderData)))||R.key}function Ma(R,D){if(N&&O){let H=la(R,D);N[H]=O()}}function Za(R,D){if(N){let H=la(R,D),ae=N[H];if(typeof ae=="number")return ae}return null}function an(R,D,H){if(n.patchRoutesOnNavigation)if(R){if(Object.keys(R[0].params).length>0)return{active:!0,matches:Ts(D,H,h,!0)}}else return{active:!0,matches:Ts(D,H,h,!0)||[]};return{active:!1,matches:null}}async function va(R,D,H,ae){if(!n.patchRoutesOnNavigation)return{type:"success",matches:R};let se=R;for(;;){let be=g==null,oe=g||p,he=m;try{await n.patchRoutesOnNavigation({signal:H,path:D,matches:se,fetcherKey:ae,patch:(Re,je)=>{H.aborted||tg(Re,je,oe,he,u,!1)}})}catch(Re){return{type:"error",error:Re,partialMatches:se}}finally{be&&!H.aborted&&(p=[...p])}if(H.aborted)return{type:"aborted"};let ge=rl(oe,D,h),Ee=null;if(ge){if(Object.keys(ge[0].params).length===0)return{type:"success",matches:ge};if(Ee=Ts(oe,D,h,!0),!(Ee&&se.length<Ee.length&&$l(se,Ee.slice(0,se.length))))return{type:"success",matches:ge}}if(Ee||(Ee=Ts(oe,D,h,!0)),!Ee||$l(se,Ee))return{type:"success",matches:null};se=Ee}}function $l(R,D){return R.length===D.length&&R.every((H,ae)=>H.route.id===D[ae].route.id)}function Gs(R){m={},g=ks(R,u,void 0,m)}function Vs(R,D,H=!1){let ae=g==null;tg(R,D,g||p,m,u,H),ae&&(p=[...p],Ie({}))}return Z={get basename(){return h},get future(){return b},get state(){return E},get routes(){return p},get window(){return l},initialize:xa,subscribe:at,enableScrollRestoration:lt,navigate:jt,fetch:na,revalidate:oa,createHref:R=>n.history.createHref(R),encodeLocation:R=>n.history.encodeLocation(R),getFetcher:ca,resetFetcher:mn,deleteFetcher:qt,dispose:bt,getBlocker:Zt,deleteBlocker:te,patchRoutes:Vs,_internalFetchControllers:P,_internalSetRoutes:Gs,_internalSetStateDoNotUseOrYouWillBreakYourApp(R){Ie(R)}},n.unstable_instrumentations&&(Z=a1(Z,n.unstable_instrumentations.map(R=>R.router).filter(Boolean))),Z}function h1(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function id(n,l,s,i,o,u){let m,p;if(o){m=[];for(let h of l)if(m.push(h),h.route.id===o){p=h;break}}else m=l,p=l[l.length-1];let g=Us(i||".",vo(m),Ka(n.pathname,s)||n.pathname,u==="path");if(i==null&&(g.search=n.search,g.hash=n.hash),(i==null||i===""||i===".")&&p){let h=Sd(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(_=>_).forEach(_=>v.append("index",_));let j=v.toString();g.search=j?`?${j}`:""}}return s!=="/"&&(g.pathname=J0({basename:s,pathname:g.pathname})),fn(g)}function Wp(n,l,s){if(!s||!h1(s))return{path:l};if(s.formMethod&&!M1(s.formMethod))return{path:l,error:Ga(405,{method:s.formMethod})};let i=()=>({path:l,error:Ga(400,{type:"invalid-body"})}),u=(s.formMethod||"get").toUpperCase(),m=xx(l);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!aa(u))return i();let b=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((j,[_,N])=>`${j}${_}=${N}
|
|
10
|
+
`,""):String(s.body);return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:void 0,text:b}}}else if(s.formEncType==="application/json"){if(!aa(u))return i();try{let b=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:b,text:void 0}}}catch{return i()}}}He(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=cd(s.formData),g=s.formData;else if(s.body instanceof FormData)p=cd(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=sg(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=sg(p)}catch{return i()}let h={formMethod:u,formAction:m,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(aa(h.formMethod))return{path:l,submission:h};let v=Mn(l);return n&&v.search&&Sd(v.search)&&p.append("index",""),v.search=`?${p}`,{path:fn(v),submission:h}}function eg(n,l,s,i,o,u,m,p,g,h,v,b,j,_,N,z,O,X,Q,Y,G){let K=Y?Ra(Y[1])?Y[1].error:Y[1].data:void 0,ne=o.createURL(u.location),Z=o.createURL(g),E;if(v&&u.errors){let xe=Object.keys(u.errors)[0];E=m.findIndex(A=>A.route.id===xe)}else if(Y&&Ra(Y[1])){let xe=Y[0];E=m.findIndex(A=>A.route.id===xe)-1}let $=Y?Y[1].statusCode:void 0,W=$&&$>=400,de={currentUrl:ne,currentParams:u.matches[0]?.params||{},nextUrl:Z,nextParams:m[0].params,...p,actionResult:K,actionStatus:$},ie=Bs(m),re=m.map((xe,A)=>{let{route:ee}=xe,ce=null;if(E!=null&&A>E)ce=!1;else if(ee.lazy)ce=!0;else if(!bd(ee))ce=!1;else if(v){let{shouldLoad:B}=dx(ee,u.loaderData,u.errors);ce=B}else p1(u.loaderData,u.matches[A],xe)&&(ce=!0);if(ce!==null)return od(s,i,n,ie,xe,h,l,ce);let P=!1;typeof G=="boolean"?P=G:W?P=!1:(b||ne.pathname+ne.search===Z.pathname+Z.search||ne.search!==Z.search||g1(u.matches[A],xe))&&(P=!0);let Se={...de,defaultShouldRevalidate:P},w=Ds(xe,Se);return od(s,i,n,ie,xe,h,l,w,Se,G)}),ue=[];return N.forEach((xe,A)=>{if(v||!m.some(le=>le.route.id===xe.routeId)||_.has(A))return;let ee=u.fetchers.get(A),ce=ee&&ee.state!=="idle"&&ee.data===void 0,P=rl(O,xe.path,X);if(!P){if(Q&&ce)return;ue.push({key:A,routeId:xe.routeId,path:xe.path,matches:null,match:null,request:null,controller:null});return}if(z.has(A))return;let Se=uo(P,xe.path),w=new AbortController,B=Er(o,xe.path,w.signal),F=null;if(j.has(A))j.delete(A),F=Tr(s,i,B,P,Se,h,l);else if(ce)b&&(F=Tr(s,i,B,P,Se,h,l));else{let le;typeof G=="boolean"?le=G:W?le=!1:le=b;let pe={...de,defaultShouldRevalidate:le};Ds(Se,pe)&&(F=Tr(s,i,B,P,Se,h,l,pe))}F&&ue.push({key:A,routeId:xe.routeId,path:xe.path,matches:F,match:Se,request:B,controller:w})}),{dsMatches:re,revalidatingFetchers:ue}}function bd(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function dx(n,l,s){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!bd(n))return{shouldLoad:!1,renderFallback:!1};let i=l!=null&&n.id in l,o=s!=null&&s[n.id]!==void 0;if(!i&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof n.loader=="function"&&n.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let u=!i&&!o;return{shouldLoad:u,renderFallback:u}}function p1(n,l,s){let i=!l||s.route.id!==l.route.id,o=!n.hasOwnProperty(s.route.id);return i||o}function g1(n,l){let s=n.route.path;return n.pathname!==l.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==l.params["*"]}function Ds(n,l){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(l);if(typeof s=="boolean")return s}return l.defaultShouldRevalidate}function tg(n,l,s,i,o,u){let m;if(n){let h=i[n];He(h,`No route found to patch children into: routeId = ${n}`),h.children||(h.children=[]),m=h.children}else m=s;let p=[],g=[];if(l.forEach(h=>{let v=m.find(b=>fx(h,b));v?g.push({existingRoute:v,newRoute:h}):p.push(h)}),p.length>0){let h=ks(p,o,[n||"_","patch",String(m?.length||"0")],i);m.push(...h)}if(u&&g.length>0)for(let h=0;h<g.length;h++){let{existingRoute:v,newRoute:b}=g[h],j=v,[_]=ks([b],o,[],{},!0);Object.assign(j,{element:_.element?_.element:j.element,errorElement:_.errorElement?_.errorElement:j.errorElement,hydrateFallbackElement:_.hydrateFallbackElement?_.hydrateFallbackElement:j.hydrateFallbackElement})}}function fx(n,l){return"id"in n&&"id"in l&&n.id===l.id?!0:n.index===l.index&&n.path===l.path&&n.caseSensitive===l.caseSensitive?(!n.children||n.children.length===0)&&(!l.children||l.children.length===0)?!0:n.children?.every((s,i)=>l.children?.some(o=>fx(s,o)))??!1:!1}var ag=new WeakMap,mx=({key:n,route:l,manifest:s,mapRouteProperties:i})=>{let o=s[l.id];if(He(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[n];if(!u)return;let m=ag.get(o);m||(m={},ag.set(o,m));let p=m[n];if(p)return p;let g=(async()=>{let h=M0(n),b=o[n]!==void 0&&n!=="hasErrorBoundary";if(h)Tt(!h,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),m[n]=Promise.resolve();else if(b)Tt(!1,`Route "${o.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let j=await u();j!=null&&(Object.assign(o,{[n]:j}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[n]=void 0,Object.values(o.lazy).every(j=>j===void 0)&&(o.lazy=void 0))})();return m[n]=g,g},ng=new WeakMap;function x1(n,l,s,i,o){let u=s[n.id];if(He(u,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let v=ng.get(u);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let b=(async()=>{He(typeof n.lazy=="function","No lazy route function found");let j=await n.lazy(),_={};for(let N in j){let z=j[N];if(z===void 0)continue;let O=k0(N),Q=u[N]!==void 0&&N!=="hasErrorBoundary";O?Tt(!O,"Route property "+N+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Q?Tt(!Q,`Route "${u.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.`):_[N]=z}Object.assign(u,_),Object.assign(u,{...i(u),lazy:void 0})})();return ng.set(u,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=mx({key:v,route:n,manifest:s,mapRouteProperties:i});b&&(p.push(b),v===l&&(g=b))}let h=p.length>0?Promise.all(p).then(()=>{}):void 0;return h?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:g}}async function lg(n){let l=n.matches.filter(o=>o.shouldLoad),s={};return(await Promise.all(l.map(o=>o.resolve()))).forEach((o,u)=>{s[l[u].route.id]=o}),s}async function y1(n){return n.matches.some(l=>l.route.middleware)?hx(n,()=>lg(n)):lg(n)}function hx(n,l){return b1(n,l,i=>{if(D1(i))throw i;return i},R1,s);function s(i,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:i}}));{let{matches:m}=n,p=Math.min(Math.max(m.findIndex(h=>h.route.id===o),0),Math.max(m.findIndex(h=>h.shouldCallHandler()),0)),g=sl(m,m[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:i}})}}}async function b1(n,l,s,i,o){let{matches:u,request:m,params:p,context:g,unstable_pattern:h}=n,v=u.flatMap(j=>j.route.middleware?j.route.middleware.map(_=>[j.route.id,_]):[]);return await px({request:m,params:p,context:g,unstable_pattern:h},v,l,s,i,o)}async function px(n,l,s,i,o,u,m=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=l[m];if(!g)return await s();let[h,v]=g,b,j=async()=>{if(b)throw new Error("You may only call `next()` once per middleware");try{return b={value:await px(n,l,s,i,o,u,m+1)},b.value}catch(_){return b={value:await u(_,h,b)},b.value}};try{let _=await v(n,j),N=_!=null?i(_):void 0;return o(N)?N:b?N??b.value:(b={value:await j()},b.value)}catch(_){return await u(_,h,b)}}function gx(n,l,s,i,o){let u=mx({key:"middleware",route:i.route,manifest:l,mapRouteProperties:n}),m=x1(i.route,aa(s.method)?"action":"loader",l,n,o);return{middleware:u,route:m.lazyRoutePromise,handler:m.lazyHandlerPromise}}function od(n,l,s,i,o,u,m,p,g=null,h){let v=!1,b=gx(n,l,s,o,u);return{...o,_lazyPromises:b,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(j){return v=!0,g?typeof h=="boolean"?Ds(o,{...g,defaultShouldRevalidate:h}):typeof j=="boolean"?Ds(o,{...g,defaultShouldRevalidate:j}):Ds(o,g):p},resolve(j){let{lazy:_,loader:N,middleware:z}=o.route,O=v||p||j&&!aa(s.method)&&(_||N),X=z&&z.length>0&&!N&&!_;return O&&(aa(s.method)||!X)?S1({request:s,unstable_pattern:i,match:o,lazyHandlerPromise:b?.handler,lazyRoutePromise:b?.route,handlerOverride:j,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function Tr(n,l,s,i,o,u,m,p=null){return i.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:gx(n,l,s,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:od(n,l,s,Bs(i),g,u,m,!0,p))}async function v1(n,l,s,i,o,u){s.some(h=>h._lazyPromises?.middleware)&&await Promise.all(s.map(h=>h._lazyPromises?.middleware));let m={request:l,unstable_pattern:Bs(s),params:s[0].params,context:o,matches:s},g=await n({...m,fetcherKey:i,runClientMiddleware:h=>{let v=m;return hx(v,()=>h({...v,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return g}async function S1({request:n,unstable_pattern:l,match:s,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:u,scopedContext:m}){let p,g,h=aa(n.method),v=h?"action":"loader",b=j=>{let _,N=new Promise((X,Q)=>_=Q);g=()=>_(),n.signal.addEventListener("abort",g);let z=X=>typeof j!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${s.route.id}]`)):j({request:n,unstable_pattern:l,params:s.params,context:m},...X!==void 0?[X]:[]),O=(async()=>{try{return{type:"data",result:await(u?u(Q=>z(Q)):z())}}catch(X){return{type:"error",result:X}}})();return Promise.race([O,N])};try{let j=h?s.route.action:s.route.loader;if(i||o)if(j){let _,[N]=await Promise.all([b(j).catch(z=>{_=z}),i,o]);if(_!==void 0)throw _;p=N}else{await i;let _=h?s.route.action:s.route.loader;if(_)[p]=await Promise.all([b(_),o]);else if(v==="action"){let N=new URL(n.url),z=N.pathname+N.search;throw Ga(405,{method:n.method,pathname:z,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(j)p=await b(j);else{let _=new URL(n.url),N=_.pathname+_.search;throw Ga(404,{pathname:N})}}catch(j){return{type:"error",result:j}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function _1(n){let l=n.headers.get("Content-Type");return l&&/\bapplication\/json\b/.test(l)?n.body==null?null:n.json():n.text()}async function j1(n){let{result:l,type:s}=n;if(vd(l)){let i;try{i=await _1(l)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new Hs(l.status,l.statusText,i),statusCode:l.status,headers:l.headers}:{type:"data",data:i,statusCode:l.status,headers:l.headers}}return s==="error"?ug(l)?l.data instanceof Error?{type:"error",error:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:C1(l),statusCode:Or(l)?l.status:void 0,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:l,statusCode:Or(l)?l.status:void 0}:ug(l)?{type:"data",data:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"data",data:l}}function N1(n,l,s,i,o){let u=n.headers.get("Location");if(He(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!yd(u)){let m=i.slice(0,i.findIndex(p=>p.route.id===s)+1);u=id(new URL(l.url),m,o,u),n.headers.set("Location",u)}return n}function rg(n,l,s,i){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(yd(n)){let u=n,m=u.startsWith("//")?new URL(l.protocol+u):new URL(u);if(o.includes(m.protocol))throw new Error("Invalid redirect location");let p=Ka(m.pathname,s)!=null;if(m.origin===l.origin&&p)return m.pathname+m.search+m.hash}try{let u=i.createURL(n);if(o.includes(u.protocol))throw new Error("Invalid redirect location")}catch{}return n}function Er(n,l,s,i){let o=n.createURL(xx(l)).toString(),u={signal:s};if(i&&aa(i.formMethod)){let{formMethod:m,formEncType:p}=i;u.method=m.toUpperCase(),p==="application/json"?(u.headers=new Headers({"Content-Type":p}),u.body=JSON.stringify(i.json)):p==="text/plain"?u.body=i.text:p==="application/x-www-form-urlencoded"&&i.formData?u.body=cd(i.formData):u.body=i.formData}return new Request(o,u)}function cd(n){let l=new URLSearchParams;for(let[s,i]of n.entries())l.append(s,typeof i=="string"?i:i.name);return l}function sg(n){let l=new FormData;for(let[s,i]of n.entries())l.append(s,i);return l}function w1(n,l,s,i=!1,o=!1){let u={},m=null,p,g=!1,h={},v=s&&Ra(s[1])?s[1].error:void 0;return n.forEach(b=>{if(!(b.route.id in l))return;let j=b.route.id,_=l[j];if(He(!zl(_),"Cannot handle redirect results in processLoaderData"),Ra(_)){let N=_.error;if(v!==void 0&&(N=v,v=void 0),m=m||{},o)m[j]=N;else{let z=sl(n,j);m[z.route.id]==null&&(m[z.route.id]=N)}i||(u[j]=ux),g||(g=!0,p=Or(_.error)?_.error.status:500),_.headers&&(h[j]=_.headers)}else u[j]=_.data,_.statusCode&&_.statusCode!==200&&!g&&(p=_.statusCode),_.headers&&(h[j]=_.headers)}),v!==void 0&&s&&(m={[s[0]]:v},s[2]&&(u[s[2]]=void 0)),{loaderData:u,errors:m,statusCode:p||200,loaderHeaders:h}}function ig(n,l,s,i,o,u){let{loaderData:m,errors:p}=w1(l,s,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 j=u[h];if(He(j,"Did not find corresponding fetcher result"),Ra(j)){let _=sl(n.matches,v?.route.id);p&&p[_.route.id]||(p={...p,[_.route.id]:j.error}),n.fetchers.delete(h)}else if(zl(j))He(!1,"Unhandled fetcher revalidation redirect");else{let _=On(j.data);n.fetchers.set(h,_)}}),{loaderData:m,errors:p}}function og(n,l,s,i){let o=Object.entries(l).filter(([,u])=>u!==ux).reduce((u,[m,p])=>(u[m]=p,u),{});for(let u of s){let m=u.route.id;if(!l.hasOwnProperty(m)&&n.hasOwnProperty(m)&&u.route.loader&&(o[m]=n[m]),i&&i.hasOwnProperty(m))break}return o}function cg(n){return n?Ra(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function sl(n,l){return(l?n.slice(0,n.findIndex(i=>i.route.id===l)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function no(n){let l=n.length===1?n[0]:n.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:l}],route:l}}function Ga(n,{pathname:l,routeId:s,method:i,type:o,message:u}={}){let m="Unknown Server Error",p="Unknown @remix-run/router error";return n===400?(m="Bad Request",i&&l&&s?p=`You made a ${i} request to "${l}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:o==="invalid-body"&&(p="Unable to encode submission body")):n===403?(m="Forbidden",p=`Route "${s}" does not match URL "${l}"`):n===404?(m="Not Found",p=`No route matches URL "${l}"`):n===405&&(m="Method Not Allowed",i&&l&&s?p=`You made a ${i.toUpperCase()} request to "${l}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:i&&(p=`Invalid request method "${i.toUpperCase()}"`)),new Hs(n||500,m,new Error(p),!0)}function lo(n){let l=Object.entries(n);for(let s=l.length-1;s>=0;s--){let[i,o]=l[s];if(zl(o))return{key:i,result:o}}}function xx(n){let l=typeof n=="string"?Mn(n):n;return fn({...l,hash:""})}function E1(n,l){return n.pathname!==l.pathname||n.search!==l.search?!1:n.hash===""?l.hash!=="":n.hash===l.hash?!0:l.hash!==""}function C1(n){return new Hs(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)}function R1(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([l,s])=>typeof l=="string"&&T1(s))}function T1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function z1(n){return vd(n.result)&&ox.has(n.result.status)}function Ra(n){return n.type==="error"}function zl(n){return(n&&n.type)==="redirect"}function ug(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function vd(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function O1(n){return ox.has(n)}function D1(n){return vd(n)&&O1(n.status)&&n.headers.has("Location")}function M1(n){return c1.has(n.toUpperCase())}function aa(n){return i1.has(n.toUpperCase())}function Sd(n){return new URLSearchParams(n).getAll("index").some(l=>l==="")}function uo(n,l){let s=typeof l=="string"?Mn(l).search:l.search;if(n[n.length-1].route.index&&Sd(s||""))return n[n.length-1];let i=nx(n);return i[i.length-1]}function dg(n){let{formMethod:l,formAction:s,formEncType:i,text:o,formData:u,json:m}=n;if(!(!l||!s||!i)){if(o!=null)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:l,formAction:s,formEncType:i,formData:u,json:void 0,text:void 0};if(m!==void 0)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:m,text:void 0}}}function Zu(n,l){return l?{state:"loading",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function A1(n,l){return{state:"submitting",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function Es(n,l){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:l}}function k1(n,l){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l?l.data:void 0}}function On(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 L1(n,l){try{let s=n.sessionStorage.getItem(cx);if(s){let i=JSON.parse(s);for(let[o,u]of Object.entries(i||{}))u&&Array.isArray(u)&&l.set(o,new Set(u||[]))}}catch{}}function U1(n,l){if(l.size>0){let s={};for(let[i,o]of l)s[i]=[...o];try{n.sessionStorage.setItem(cx,JSON.stringify(s))}catch(i){Tt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function fg(){let n,l,s=new Promise((i,o)=>{n=async u=>{i(u);try{await s}catch{}},l=async u=>{o(u);try{await s}catch{}}});return{promise:s,resolve:n,reject:l}}var Ll=y.createContext(null);Ll.displayName="DataRouter";var $s=y.createContext(null);$s.displayName="DataRouterState";var yx=y.createContext(!1);function H1(){return y.useContext(yx)}var _d=y.createContext({isTransitioning:!1});_d.displayName="ViewTransition";var bx=y.createContext(new Map);bx.displayName="Fetchers";var B1=y.createContext(null);B1.displayName="Await";var za=y.createContext(null);za.displayName="Navigation";var So=y.createContext(null);So.displayName="Location";var Xa=y.createContext({outlet:null,matches:[],isDataRoute:!1});Xa.displayName="Route";var jd=y.createContext(null);jd.displayName="RouteError";var vx="REACT_ROUTER_ERROR",$1="REDIRECT",q1="ROUTE_ERROR_RESPONSE";function Y1(n){if(n.startsWith(`${vx}:${$1}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function G1(n){if(n.startsWith(`${vx}:${q1}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new Hs(l.status,l.statusText,l.data)}catch{}}function V1(n,{relative:l}={}){He(Dr(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=y.useContext(za),{hash:o,pathname:u,search:m}=Ys(n,{relative:l}),p=u;return s!=="/"&&(p=u==="/"?s:Wa([s,u])),i.createHref({pathname:p,search:m,hash:o})}function Dr(){return y.useContext(So)!=null}function tn(){return He(Dr(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(So).location}var Sx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _x(n){y.useContext(za).static||y.useLayoutEffect(n)}function An(){let{isDataRoute:n}=y.useContext(Xa);return n?l4():K1()}function K1(){He(Dr(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Ll),{basename:l,navigator:s}=y.useContext(za),{matches:i}=y.useContext(Xa),{pathname:o}=tn(),u=JSON.stringify(vo(i)),m=y.useRef(!1);return _x(()=>{m.current=!0}),y.useCallback((g,h={})=>{if(Tt(m.current,Sx),!m.current)return;if(typeof g=="number"){s.go(g);return}let v=Us(g,JSON.parse(u),o,h.relative==="path");n==null&&l!=="/"&&(v.pathname=v.pathname==="/"?l:Wa([l,v.pathname])),(h.replace?s.replace:s.push)(v,h.state,h)},[l,s,u,o,n])}var X1=y.createContext(null);function Q1(n){let l=y.useContext(Xa).outlet;return y.useMemo(()=>l&&y.createElement(X1.Provider,{value:n},l),[l,n])}function qs(){let{matches:n}=y.useContext(Xa),l=n[n.length-1];return l?l.params:{}}function Ys(n,{relative:l}={}){let{matches:s}=y.useContext(Xa),{pathname:i}=tn(),o=JSON.stringify(vo(s));return y.useMemo(()=>Us(n,JSON.parse(o),i,l==="path"),[n,o,i,l])}function Z1(n,l,s){He(Dr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=y.useContext(za),{matches:o}=y.useContext(Xa),u=o[o.length-1],m=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",h=u&&u.route;{let O=h&&h.path||"";wx(p,!h||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${O}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
+
|
|
12
|
+
Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let v=tn(),b;b=v;let j=b.pathname||"/",_=j;if(g!=="/"){let O=g.replace(/^\//,"").split("/");_="/"+j.replace(/^\//,"").split("/").slice(O.length).join("/")}let N=rl(n,{pathname:_});return Tt(h||N!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Tt(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.`),W1(N&&N.map(O=>Object.assign({},O,{params:Object.assign({},m,O.params),pathname:Wa([g,i.encodeLocation?i.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?g:Wa([g,i.encodeLocation?i.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),o,s)}function F1(){let n=Nx(),l=Or(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},u={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=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:u},"ErrorBoundary")," or"," ",y.createElement("code",{style:u},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},l),s?y.createElement("pre",{style:o},s):null,m)}var J1=y.createElement(F1,null),jx=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,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=G1(n.digest);s&&(n=s)}let l=n!==void 0?y.createElement(Xa.Provider,{value:this.props.routeContext},y.createElement(jd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(P1,{error:n},l):l}};jx.contextType=yx;var Fu=new WeakMap;function P1({children:n,error:l}){let{basename:s}=y.useContext(za);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=Y1(l.digest);if(i){let o=Fu.get(l);if(o)throw o;let u=rx(i.location,s);if(lx&&!Fu.get(l))if(u.isExternal||i.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:i.replace}));throw Fu.set(l,m),m}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function I1({routeContext:n,match:l,children:s}){let i=y.useContext(Ll);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),y.createElement(Xa.Provider,{value:n},s)}function W1(n,l=[],s){let i=s?.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let o=n,u=i?.errors;if(u!=null){let v=o.findIndex(b=>b.route.id&&u?.[b.route.id]!==void 0);He(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let m=!1,p=-1;if(s&&i){m=i.renderFallback;for(let v=0;v<o.length;v++){let b=o[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(p=v),b.route.id){let{loaderData:j,errors:_}=i,N=b.route.loader&&!j.hasOwnProperty(b.route.id)&&(!_||_[b.route.id]===void 0);if(b.route.lazy||N){s.isStatic&&(m=!0),p>=0?o=o.slice(0,p+1):o=[o[0]];break}}}}let g=s?.onError,h=i&&g?(v,b)=>{g(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Bs(i.matches),errorInfo:b})}:void 0;return o.reduceRight((v,b,j)=>{let _,N=!1,z=null,O=null;i&&(_=u&&b.route.id?u[b.route.id]:void 0,z=b.route.errorElement||J1,m&&(p<0&&j===0?(wx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,O=null):p===j&&(N=!0,O=b.route.hydrateFallbackElement||null)));let X=l.concat(o.slice(0,j+1)),Q=()=>{let Y;return _?Y=z:N?Y=O:b.route.Component?Y=y.createElement(b.route.Component,null):b.route.element?Y=b.route.element:Y=v,y.createElement(I1,{match:b,routeContext:{outlet:v,matches:X,isDataRoute:i!=null},children:Y})};return i&&(b.route.ErrorBoundary||b.route.errorElement||j===0)?y.createElement(jx,{location:i.location,revalidation:i.revalidation,component:z,error:_,children:Q(),routeContext:{outlet:null,matches:X,isDataRoute:!0},onError:h}):Q()},null)}function Nd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e4(n){let l=y.useContext(Ll);return He(l,Nd(n)),l}function t4(n){let l=y.useContext($s);return He(l,Nd(n)),l}function a4(n){let l=y.useContext(Xa);return He(l,Nd(n)),l}function wd(n){let l=a4(n),s=l.matches[l.matches.length-1];return He(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function n4(){return wd("useRouteId")}function Nx(){let n=y.useContext(jd),l=t4("useRouteError"),s=wd("useRouteError");return n!==void 0?n:l.errors?.[s]}function l4(){let{router:n}=e4("useNavigate"),l=wd("useNavigate"),s=y.useRef(!1);return _x(()=>{s.current=!0}),y.useCallback(async(o,u={})=>{Tt(s.current,Sx),s.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:l,...u}))},[n,l])}var mg={};function wx(n,l,s){!l&&!mg[n]&&(mg[n]=!0,Tt(!1,s))}var hg={};function pg(n,l){!n&&!hg[l]&&(hg[l]=!0,console.warn(l))}var r4="useOptimistic",gg=Lv[r4],s4=()=>{};function i4(n){return gg?gg(n):[n,s4]}function o4(n){let l={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&Tt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(l,{element:y.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&Tt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(l,{hydrateFallbackElement:y.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&Tt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(l,{errorElement:y.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),l}var c4=["HydrateFallback","hydrateFallbackElement"],u4=class{constructor(){this.status="pending",this.promise=new Promise((n,l)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",l(s))}})}};function d4({router:n,flushSync:l,onError:s,unstable_useTransitions:i}){i=H1()||i;let[u,m]=y.useState(n.state),[p,g]=i4(u),[h,v]=y.useState(),[b,j]=y.useState({isTransitioning:!1}),[_,N]=y.useState(),[z,O]=y.useState(),[X,Q]=y.useState(),Y=y.useRef(new Map),G=y.useCallback((E,{deletedFetchers:$,newErrors:W,flushSync:de,viewTransitionOpts:ie})=>{W&&s&&Object.values(W).forEach(ue=>s(ue,{location:E.location,params:E.matches[0]?.params??{},unstable_pattern:Bs(E.matches)})),E.fetchers.forEach((ue,xe)=>{ue.data!==void 0&&Y.current.set(xe,ue.data)}),$.forEach(ue=>Y.current.delete(ue)),pg(de===!1||l!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let re=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(pg(ie==null||re,"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."),!ie||!re){l&&de?l(()=>m(E)):i===!1?m(E):y.startTransition(()=>{i===!0&&g(ue=>xg(ue,E)),m(E)});return}if(l&&de){l(()=>{z&&(_?.resolve(),z.skipTransition()),j({isTransitioning:!0,flushSync:!0,currentLocation:ie.currentLocation,nextLocation:ie.nextLocation})});let ue=n.window.document.startViewTransition(()=>{l(()=>m(E))});ue.finished.finally(()=>{l(()=>{N(void 0),O(void 0),v(void 0),j({isTransitioning:!1})})}),l(()=>O(ue));return}z?(_?.resolve(),z.skipTransition(),Q({state:E,currentLocation:ie.currentLocation,nextLocation:ie.nextLocation})):(v(E),j({isTransitioning:!0,flushSync:!1,currentLocation:ie.currentLocation,nextLocation:ie.nextLocation}))},[n.window,l,z,_,i,g,s]);y.useLayoutEffect(()=>n.subscribe(G),[n,G]),y.useEffect(()=>{b.isTransitioning&&!b.flushSync&&N(new u4)},[b]),y.useEffect(()=>{if(_&&h&&n.window){let E=h,$=_.promise,W=n.window.document.startViewTransition(async()=>{i===!1?m(E):y.startTransition(()=>{i===!0&&g(de=>xg(de,E)),m(E)}),await $});W.finished.finally(()=>{N(void 0),O(void 0),v(void 0),j({isTransitioning:!1})}),O(W)}},[h,_,n.window,i,g]),y.useEffect(()=>{_&&h&&p.location.key===h.location.key&&_.resolve()},[_,z,p.location,h]),y.useEffect(()=>{!b.isTransitioning&&X&&(v(X.state),j({isTransitioning:!0,flushSync:!1,currentLocation:X.currentLocation,nextLocation:X.nextLocation}),Q(void 0))},[b.isTransitioning,X]);let K=y.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,$,W)=>n.navigate(E,{state:$,preventScrollReset:W?.preventScrollReset}),replace:(E,$,W)=>n.navigate(E,{replace:!0,state:$,preventScrollReset:W?.preventScrollReset})}),[n]),ne=n.basename||"/",Z=y.useMemo(()=>({router:n,navigator:K,static:!1,basename:ne,onError:s}),[n,K,ne,s]);return y.createElement(y.Fragment,null,y.createElement(Ll.Provider,{value:Z},y.createElement($s.Provider,{value:p},y.createElement(bx.Provider,{value:Y.current},y.createElement(_d.Provider,{value:b},y.createElement(h4,{basename:ne,location:p.location,navigationType:p.historyAction,navigator:K,unstable_useTransitions:i},y.createElement(f4,{routes:n.routes,future:n.future,state:p,isStatic:!1,onError:s})))))),null)}function xg(n,l){return{...n,navigation:l.navigation.state!=="idle"?l.navigation:n.navigation,revalidation:l.revalidation!=="idle"?l.revalidation:n.revalidation,actionData:l.navigation.state!=="submitting"?l.actionData:n.actionData,fetchers:l.fetchers}}var f4=y.memo(m4);function m4({routes:n,future:l,state:s,isStatic:i,onError:o}){return Z1(n,void 0,{state:s,isStatic:i,onError:o})}function yg({to:n,replace:l,state:s,relative:i}){He(Dr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=y.useContext(za);Tt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=y.useContext(Xa),{pathname:m}=tn(),p=An(),g=Us(n,vo(u),m,i==="path"),h=JSON.stringify(g);return y.useEffect(()=>{p(JSON.parse(h),{replace:l,state:s,relative:i})},[p,h,i,l,s]),null}function Ex(n){return Q1(n.context)}function h4({basename:n="/",children:l=null,location:s,navigationType:i="POP",navigator:o,static:u=!1,unstable_useTransitions:m}){He(!Dr(),"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:u,unstable_useTransitions:m,future:{}}),[p,o,u,m]);typeof s=="string"&&(s=Mn(s));let{pathname:h="/",search:v="",hash:b="",state:j=null,key:_="default",unstable_mask:N}=s,z=y.useMemo(()=>{let O=Ka(h,p);return O==null?null:{location:{pathname:O,search:v,hash:b,state:j,key:_,unstable_mask:N},navigationType:i}},[p,h,v,b,j,_,i,N]);return Tt(z!=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.`),z==null?null:y.createElement(za.Provider,{value:g},y.createElement(So.Provider,{children:l,value:z}))}var fo="get",mo="application/x-www-form-urlencoded";function _o(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function p4(n){return _o(n)&&n.tagName.toLowerCase()==="button"}function g4(n){return _o(n)&&n.tagName.toLowerCase()==="form"}function x4(n){return _o(n)&&n.tagName.toLowerCase()==="input"}function y4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function b4(n,l){return n.button===0&&(!l||l==="_self")&&!y4(n)}function ud(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,s)=>{let i=n[s];return l.concat(Array.isArray(i)?i.map(o=>[s,o]):[[s,i]])},[]))}function v4(n,l){let s=ud(n);return l&&l.forEach((i,o)=>{s.has(o)||l.getAll(o).forEach(u=>{s.append(o,u)})}),s}var ro=null;function S4(){if(ro===null)try{new FormData(document.createElement("form"),0),ro=!1}catch{ro=!0}return ro}var _4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ju(n){return n!=null&&!_4.has(n)?(Tt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mo}"`),null):n}function j4(n,l){let s,i,o,u,m;if(g4(n)){let p=n.getAttribute("action");i=p?Ka(p,l):null,s=n.getAttribute("method")||fo,o=Ju(n.getAttribute("enctype"))||mo,u=new FormData(n)}else if(p4(n)||x4(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?Ka(g,l):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||fo,o=Ju(n.getAttribute("formenctype"))||Ju(p.getAttribute("enctype"))||mo,u=new FormData(p,n),!S4()){let{name:h,type:v,value:b}=n;if(v==="image"){let j=h?`${h}.`:"";u.append(`${j}x`,"0"),u.append(`${j}y`,"0")}else h&&u.append(h,b)}}else{if(_o(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=fo,i=null,o=mo,m=n}return u&&o==="text/plain"&&(m=u,u=void 0),{action:i,method:s.toLowerCase(),encType:o,formData:u,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ed(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function N4(n,l,s,i){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:l&&Ka(o.pathname,l)==="/"?o.pathname=`${l.replace(/\/$/,"")}/_root.${i}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${i}`,o}async function w4(n,l){if(n.id in l)return l[n.id];try{let s=await import(n.module);return l[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function E4(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 C4(n,l,s){let i=await Promise.all(n.map(async o=>{let u=l.routes[o.route.id];if(u){let m=await w4(u,s);return m.links?m.links():[]}return[]}));return O4(i.flat(1).filter(E4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function bg(n,l,s,i,o,u){let m=(g,h)=>s[h]?g.route.id!==s[h].route.id:!0,p=(g,h)=>s[h].pathname!==g.pathname||s[h].route.path?.endsWith("*")&&s[h].params["*"]!==g.params["*"];return u==="assets"?l.filter((g,h)=>m(g,h)||p(g,h)):u==="data"?l.filter((g,h)=>{let v=i.routes[g.route.id];if(!v||!v.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let b=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function R4(n,l,{includeHydrateFallback:s}={}){return T4(n.map(i=>{let o=l.routes[i.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),s&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function T4(n){return[...new Set(n)]}function z4(n){let l={},s=Object.keys(n).sort();for(let i of s)l[i]=n[i];return l}function O4(n,l){let s=new Set;return new Set(l),n.reduce((i,o)=>{let u=JSON.stringify(z4(o));return s.has(u)||(s.add(u),i.push({key:u,link:o})),i},[])}function Cx(){let n=y.useContext(Ll);return Ed(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function D4(){let n=y.useContext($s);return Ed(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Cd=y.createContext(void 0);Cd.displayName="FrameworkContext";function Rx(){let n=y.useContext(Cd);return Ed(n,"You must render this element inside a <HydratedRouter> element"),n}function M4(n,l){let s=y.useContext(Cd),[i,o]=y.useState(!1),[u,m]=y.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:v,onTouchStart:b}=l,j=y.useRef(null);y.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let z=X=>{X.forEach(Q=>{m(Q.isIntersecting)})},O=new IntersectionObserver(z,{threshold:.5});return j.current&&O.observe(j.current),()=>{O.disconnect()}}},[n]),y.useEffect(()=>{if(i){let z=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(z)}}},[i]);let _=()=>{o(!0)},N=()=>{o(!1),m(!1)};return s?n!=="intent"?[u,j,{}]:[u,j,{onFocus:Cs(p,_),onBlur:Cs(g,N),onMouseEnter:Cs(h,_),onMouseLeave:Cs(v,N),onTouchStart:Cs(b,_)}]:[!1,j,{}]}function Cs(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function A4({page:n,...l}){let{router:s}=Cx(),i=y.useMemo(()=>rl(s.routes,n,s.basename),[s.routes,n,s.basename]);return i?y.createElement(L4,{page:n,matches:i,...l}):null}function k4(n){let{manifest:l,routeModules:s}=Rx(),[i,o]=y.useState([]);return y.useEffect(()=>{let u=!1;return C4(n,l,s).then(m=>{u||o(m)}),()=>{u=!0}},[n,l,s]),i}function L4({page:n,matches:l,...s}){let i=tn(),{future:o,manifest:u,routeModules:m}=Rx(),{basename:p}=Cx(),{loaderData:g,matches:h}=D4(),v=y.useMemo(()=>bg(n,l,h,u,i,"data"),[n,l,h,u,i]),b=y.useMemo(()=>bg(n,l,h,u,i,"assets"),[n,l,h,u,i]),j=y.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let z=new Set,O=!1;if(l.forEach(Q=>{let Y=u.routes[Q.route.id];!Y||!Y.hasLoader||(!v.some(G=>G.route.id===Q.route.id)&&Q.route.id in g&&m[Q.route.id]?.shouldRevalidate||Y.hasClientLoader?O=!0:z.add(Q.route.id))}),z.size===0)return[];let X=N4(n,p,o.unstable_trailingSlashAwareDataRequests,"data");return O&&z.size>0&&X.searchParams.set("_routes",l.filter(Q=>z.has(Q.route.id)).map(Q=>Q.route.id).join(",")),[X.pathname+X.search]},[p,o.unstable_trailingSlashAwareDataRequests,g,i,u,v,l,n,m]),_=y.useMemo(()=>R4(b,u),[b,u]),N=k4(b);return y.createElement(y.Fragment,null,j.map(z=>y.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...s})),_.map(z=>y.createElement("link",{key:z,rel:"modulepreload",href:z,...s})),N.map(({key:z,link:O})=>y.createElement("link",{key:z,nonce:s.nonce,...O,crossOrigin:O.crossOrigin??s.crossOrigin})))}function U4(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var H4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{H4&&(window.__reactRouterVersion="7.13.1")}catch{}function B4(n,l){return m1({basename:l?.basename,getContext:l?.getContext,future:l?.future,history:T0({window:l?.window}),hydrationData:$4(),routes:n,mapRouteProperties:o4,hydrationRouteProperties:c4,dataStrategy:l?.dataStrategy,patchRoutesOnNavigation:l?.patchRoutesOnNavigation,window:l?.window,unstable_instrumentations:l?.unstable_instrumentations}).initialize()}function $4(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:q4(n.errors)}),n}function q4(n){if(!n)return null;let l=Object.entries(n),s={};for(let[i,o]of l)if(o&&o.__type==="RouteErrorResponse")s[i]=new Hs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let u=window[o.__subType];if(typeof u=="function")try{let m=new u(o.message);m.stack="",s[i]=m}catch{}}if(s[i]==null){let u=new Error(o.message);u.stack="",s[i]=u}}else s[i]=o;return s}var Tx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ga=y.forwardRef(function({onClick:l,discover:s="render",prefetch:i="none",relative:o,reloadDocument:u,replace:m,unstable_mask:p,state:g,target:h,to:v,preventScrollReset:b,viewTransition:j,unstable_defaultShouldRevalidate:_,...N},z){let{basename:O,navigator:X,unstable_useTransitions:Q}=y.useContext(za),Y=typeof v=="string"&&Tx.test(v),G=rx(v,O);v=G.to;let K=V1(v,{relative:o}),ne=tn(),Z=null;if(p){let xe=Us(p,[],ne.unstable_mask?ne.unstable_mask.pathname:"/",!0);O!=="/"&&(xe.pathname=xe.pathname==="/"?O:Wa([O,xe.pathname])),Z=X.createHref(xe)}let[E,$,W]=M4(i,N),de=V4(v,{replace:m,unstable_mask:p,state:g,target:h,preventScrollReset:b,relative:o,viewTransition:j,unstable_defaultShouldRevalidate:_,unstable_useTransitions:Q});function ie(xe){l&&l(xe),xe.defaultPrevented||de(xe)}let re=!(G.isExternal||u),ue=y.createElement("a",{...N,...W,href:(re?Z:void 0)||G.absoluteURL||K,onClick:re?ie:l,ref:U4(z,$),target:h,"data-discover":!Y&&s==="render"?"true":void 0});return E&&!Y?y.createElement(y.Fragment,null,ue,y.createElement(A4,{page:K})):ue});ga.displayName="Link";var Ls=y.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:i="",end:o=!1,style:u,to:m,viewTransition:p,children:g,...h},v){let b=Ys(m,{relative:h.relative}),j=tn(),_=y.useContext($s),{navigator:N,basename:z}=y.useContext(za),O=_!=null&&F4(b)&&p===!0,X=N.encodeLocation?N.encodeLocation(b).pathname:b.pathname,Q=j.pathname,Y=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;s||(Q=Q.toLowerCase(),Y=Y?Y.toLowerCase():null,X=X.toLowerCase()),Y&&z&&(Y=Ka(Y,z)||Y);const G=X!=="/"&&X.endsWith("/")?X.length-1:X.length;let K=Q===X||!o&&Q.startsWith(X)&&Q.charAt(G)==="/",ne=Y!=null&&(Y===X||!o&&Y.startsWith(X)&&Y.charAt(X.length)==="/"),Z={isActive:K,isPending:ne,isTransitioning:O},E=K?l:void 0,$;typeof i=="function"?$=i(Z):$=[i,K?"active":null,ne?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let W=typeof u=="function"?u(Z):u;return y.createElement(ga,{...h,"aria-current":E,className:$,ref:v,style:W,to:m,viewTransition:p},typeof g=="function"?g(Z):g)});Ls.displayName="NavLink";var Y4=y.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:i,replace:o,state:u,method:m=fo,action:p,onSubmit:g,relative:h,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:j,..._},N)=>{let{unstable_useTransitions:z}=y.useContext(za),O=Q4(),X=Z4(p,{relative:h}),Q=m.toLowerCase()==="get"?"get":"post",Y=typeof p=="string"&&Tx.test(p),G=K=>{if(g&&g(K),K.defaultPrevented)return;K.preventDefault();let ne=K.nativeEvent.submitter,Z=ne?.getAttribute("formmethod")||m,E=()=>O(ne||K.currentTarget,{fetcherKey:l,method:Z,navigate:s,replace:o,state:u,relative:h,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:j});z&&s!==!1?y.startTransition(()=>E()):E()};return y.createElement("form",{ref:N,method:Q,action:X,onSubmit:i?g:G,..._,"data-discover":!Y&&n==="render"?"true":void 0})});Y4.displayName="Form";function G4(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zx(n){let l=y.useContext(Ll);return He(l,G4(n)),l}function V4(n,{target:l,replace:s,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:h}={}){let v=An(),b=tn(),j=Ys(n,{relative:m});return y.useCallback(_=>{if(b4(_,l)){_.preventDefault();let N=s!==void 0?s:fn(b)===fn(j),z=()=>v(n,{replace:N,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g});h?y.startTransition(()=>z()):z()}},[b,v,j,s,i,o,l,n,u,m,p,g,h])}function jo(n){Tt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=y.useRef(ud(n)),s=y.useRef(!1),i=tn(),o=y.useMemo(()=>v4(i.search,s.current?null:l.current),[i.search]),u=An(),m=y.useCallback((p,g)=>{const h=ud(typeof p=="function"?p(new URLSearchParams(o)):p);s.current=!0,u("?"+h,g)},[u,o]);return[o,m]}var K4=0,X4=()=>`__${String(++K4)}__`;function Q4(){let{router:n}=zx("useSubmit"),{basename:l}=y.useContext(za),s=n4(),i=n.fetch,o=n.navigate;return y.useCallback(async(u,m={})=>{let{action:p,method:g,encType:h,formData:v,body:b}=j4(u,l);if(m.navigate===!1){let j=m.fetcherKey||X4();await i(j,s,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:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,o,l,s])}function Z4(n,{relative:l}={}){let{basename:s}=y.useContext(za),i=y.useContext(Xa);He(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),u={...Ys(n||".",{relative:l})},m=tn();if(n==null){u.search=m.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(v=>v==="")){p.delete("index"),g.filter(b=>b).forEach(b=>p.append("index",b));let v=p.toString();u.search=v?`?${v}`:""}}return(!n||n===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(u.pathname=u.pathname==="/"?s:Wa([s,u.pathname])),fn(u)}function F4(n,{relative:l}={}){let s=y.useContext(_d);He(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=zx("useViewTransitionState"),o=Ys(n,{relative:l});if(!s.isTransitioning)return!1;let u=Ka(s.currentLocation.pathname,i)||s.currentLocation.pathname,m=Ka(s.nextLocation.pathname,i)||s.nextLocation.pathname;return xo(o.pathname,m)!=null||xo(o.pathname,u)!=null}const vg=n=>{let l;const s=new Set,i=(h,v)=>{const b=typeof h=="function"?h(l):h;if(!Object.is(b,l)){const j=l;l=v??(typeof b!="object"||b===null)?b:Object.assign({},l,b),s.forEach(_=>_(l,j))}},o=()=>l,p={setState:i,getState:o,getInitialState:()=>g,subscribe:h=>(s.add(h),()=>s.delete(h))},g=l=n(i,o,p);return p},J4=(n=>n?vg(n):vg),P4=n=>n;function I4(n,l=P4){const s=Cr.useSyncExternalStore(n.subscribe,Cr.useCallback(()=>l(n.getState()),[n,l]),Cr.useCallback(()=>l(n.getInitialState()),[n,l]));return Cr.useDebugValue(s),s}const Sg=n=>{const l=J4(n),s=i=>I4(l,i);return Object.assign(s,l),s},No=(n=>n?Sg(n):Sg),Ox="/api/v1";class Ol extends Error{constructor(l,s,i){super(i),this.status=l,this.code=s,this.name="ApiError"}}async function so(n,l,s,i,o){let u=`${Ox}${l}`;if(i){const g=new URLSearchParams(i).toString();g&&(u+=`?${g}`)}const m={method:n,headers:{"Content-Type":"application/json"}};s!==void 0&&(m.body=JSON.stringify(s)),o?.signal&&(m.signal=o.signal);const p=await fetch(u,m);if(!p.ok){let g="UNKNOWN",h=p.statusText;try{const v=await p.json();v.code&&(g=v.code),v.message&&(h=v.message)}catch{}throw new Ol(p.status,g,h)}return p.json()}const Pu=new Map;function W4(n,l){let s=`${Ox}${n}`;if(l){const i=new URLSearchParams(l).toString();i&&(s+=`?${i}`)}return s}const St={get(n,l,s){const i=W4(n,l),o=Pu.get(i);if(o)return o;const u=so("GET",n,void 0,l,s).finally(()=>{Pu.delete(i)});return Pu.set(i,u),u},post(n,l,s){return so("POST",n,l,void 0,s)},put(n,l){return so("PUT",n,l)},delete(n){return so("DELETE",n)}},eS=3e4,tS=1e3,aS=3e4;class nS{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;_status="disconnected";get status(){return this._status}setStatus(l){this._status=l;for(const s of this.statusHandlers)s(l)}onStatusChange(l){return this.statusHandlers.add(l),()=>{this.statusHandlers.delete(l)}}connect(l){this.url=l,this.intentionalClose=!1,this.reconnectAttempt=0,this.open()}disconnect(){this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}on(l,s){let i=this.handlers.get(l);return i||(i=new Set,this.handlers.set(l,i)),i.add(s),()=>{i.delete(s),i.size===0&&this.handlers.delete(l)}}send(l,s){if(this.ws?.readyState!==WebSocket.OPEN)return;const i={event:l,payload:s,timestamp:Date.now()};this.ws.send(JSON.stringify(i))}open(){this.setStatus("connecting");const l=new WebSocket(this.url);l.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},l.onmessage=s=>{try{const i=JSON.parse(String(s.data));if(i.event==="pong")return;const o=this.handlers.get(i.event);if(o)for(const u of o)u(i.payload)}catch{}},l.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},l.onerror=()=>{},this.ws=l}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},eS)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const l=Math.min(tS*2**this.reconnectAttempt,aS);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},l)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const en=new nS,ul="lib_cloud_default",Wt=No((n,l)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const s=await St.get("/libraries");n({libraries:s,loading:!1})}catch(s){n({error:s instanceof Error?s.message:"Failed to load libraries",loading:!1})}},createLibrary:async s=>{const i=await St.post("/libraries",s);return n(o=>({libraries:[...o.libraries,i]})),i},deleteLibrary:async s=>{await St.delete(`/libraries/${s}`),n(i=>({libraries:i.libraries.filter(o=>o.id!==s)}))},updateLibraryName:async(s,i)=>{const o=await St.put(`/libraries/${s}`,{name:i});n(u=>({libraries:u.libraries.map(m=>m.id===s?o:m)}))},_updateLibraryOnline:(s,i)=>{n(o=>({libraries:o.libraries.map(u=>u.id===s?{...u,is_online:i}:u)}))},_refreshLibrary:async s=>{try{const i=await St.get(`/libraries/${s}`);n(o=>({libraries:o.libraries.map(u=>u.id===s?i:u)}))}catch{l().fetchLibraries()}}})),Mr=n=>{const l=n.libraries.filter(i=>i.type==="cloud").sort((i,o)=>i.created_at.localeCompare(o.created_at)),s=n.libraries.filter(i=>i.type==="daemon").sort((i,o)=>i.name.localeCompare(o.name));return[...l,...s]},lS=n=>n.libraries.filter(l=>l.type==="daemon");en.on("ws:daemon:status",n=>{const l=n;l.lib_id&&Wt.getState()._updateLibraryOnline(l.lib_id,l.is_online),Wt.getState().fetchLibraries()});en.on("ws:daemon:connected",n=>{const l=n;l.lib_id&&Wt.getState()._updateLibraryOnline(l.lib_id,!0),Wt.getState().fetchLibraries()});en.on("ws:library:updated",n=>{const l=n;Wt.getState()._refreshLibrary(l.library_id)});const Dx=(...n)=>n.filter((l,s,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===s).join(" ").trim();const rS=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const sS=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,s,i)=>i?i.toUpperCase():s.toLowerCase());const _g=n=>{const l=sS(n);return l.charAt(0).toUpperCase()+l.slice(1)};var iS={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 oS=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const cS=y.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:m,...p},g)=>y.createElement("svg",{ref:g,...iS,width:l,height:l,stroke:n,strokeWidth:i?Number(s)*24/Number(l):s,className:Dx("lucide",o),...!u&&!oS(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,v])=>y.createElement(h,v)),...Array.isArray(u)?u:[u]]));const Me=(n,l)=>{const s=y.forwardRef(({className:i,...o},u)=>y.createElement(cS,{ref:u,iconNode:l,className:Dx(`lucide-${rS(_g(n))}`,`lucide-${n}`,i),...o}));return s.displayName=_g(n),s};const uS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Mx=Me("arrow-right",uS);const dS=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],jg=Me("arrow-up-right",dS);const fS=[["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"}]],mS=Me("boxes",fS);const hS=[["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"}]],pS=Me("brain",hS);const gS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Al=Me("check",gS);const xS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sa=Me("chevron-right",xS);const yS=[["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"}]],Ax=Me("circle-alert",yS);const bS=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],vS=Me("cloud",bS);const SS=[["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"}]],dd=Me("copy",SS);const _S=[["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"}]],jS=Me("database",_S);const NS=[["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"}]],wS=Me("file-spreadsheet",NS);const ES=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],cl=Me("file-text",ES);const CS=[["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"}]],kx=Me("file",CS);const RS=[["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"}]],TS=Me("files",RS);const zS=[["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"}]],wo=Me("folder-git-2",zS);const OS=[["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"}]],DS=Me("folder-input",OS);const MS=[["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"}]],AS=Me("folder-open",MS);const kS=[["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"}]],Lx=Me("folder-plus",kS);const LS=[["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"}]],Va=Me("folder",LS);const US=[["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"}]],fd=Me("git-branch",US);const HS=[["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"}]],BS=Me("git-commit-horizontal",HS);const $S=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Ng=Me("github",$S);const qS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],YS=Me("globe",qS);const GS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],VS=Me("info",GS);const KS=[["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"}]],XS=Me("laptop",KS);const QS=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],ZS=Me("list-filter",QS);const FS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ta=Me("loader-circle",FS);const JS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],PS=Me("menu",JS);const IS=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],WS=Me("monitor",IS);const e2=[["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"}]],t2=Me("moon",e2);const a2=[["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"}]],zr=Me("package",a2);const n2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],l2=Me("panel-left",n2);const r2=[["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"}]],md=Me("pencil",r2);const s2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ux=Me("plus",s2);const i2=[["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"}]],o2=Me("refresh-cw",i2);const c2=[["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"}]],u2=Me("rotate-cw",c2);const d2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hd=Me("search",d2);const f2=[["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"}]],m2=Me("settings",f2);const h2=[["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"}]],p2=Me("share-2",h2);const g2=[["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"}]],x2=Me("sparkles",g2);const y2=[["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"}]],b2=Me("sun",y2);const v2=[["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"}]],Hx=Me("trash-2",v2);const S2=[["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"}]],pd=Me("upload",S2);const _2=[["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"}]],j2=Me("users",_2);const N2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ul=Me("x",N2),kl=No(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:l=>n({status:l}),fetchDaemonStatus:async()=>{try{const l=await St.get("/daemons/status");n({onlineCount:l.online_count,connections:l.connections})}catch{}}})),w2=n=>n==="connecting"?"disconnected":n;en.onStatusChange(n=>{kl.getState().setStatus(w2(n))});en.on("ws:daemon:connected",n=>{const l=n;kl.setState(s=>{if(s.connections.some(m=>m.machine_id===l.machine_id))return s;const o={machine_id:l.machine_id};l.lib_id&&(o.lib_id=l.lib_id);const u=[...s.connections,o];return{connections:u,onlineCount:u.length}})});en.on("ws:daemon:status",n=>{const l=n;kl.setState(s=>{if(l.is_online){if(s.connections.some(p=>p.machine_id===l.machine_id))return s;const u={machine_id:l.machine_id};l.lib_id&&(u.lib_id=l.lib_id);const m=[...s.connections,u];return{connections:m,onlineCount:m.length}}const i=s.connections.filter(o=>o.machine_id!==l.machine_id);return{connections:i,onlineCount:i.length}})});const wg=n=>Symbol.iterator in n,Eg=n=>"entries"in n,Cg=(n,l)=>{const s=n instanceof Map?n:new Map(n.entries()),i=l instanceof Map?l:new Map(l.entries());if(s.size!==i.size)return!1;for(const[o,u]of s)if(!i.has(o)||!Object.is(u,i.get(o)))return!1;return!0},E2=(n,l)=>{const s=n[Symbol.iterator](),i=l[Symbol.iterator]();let o=s.next(),u=i.next();for(;!o.done&&!u.done;){if(!Object.is(o.value,u.value))return!1;o=s.next(),u=i.next()}return!!o.done&&!!u.done};function C2(n,l){return Object.is(n,l)?!0:typeof n!="object"||n===null||typeof l!="object"||l===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(l)?!1:wg(n)&&wg(l)?Eg(n)&&Eg(l)?Cg(n,l):E2(n,l):Cg({entries:()=>Object.entries(n)},{entries:()=>Object.entries(l)})}function Hl(n){const l=Cr.useRef(void 0);return s=>{const i=n(s);return C2(l.current,i)?l.current:l.current=i}}function gd(){const{t:n}=Te(),l=kl(m=>m.onlineCount),s=kl(m=>m.connections.length);if(Wt(Hl(lS)).length===0)return null;const o=l>0,u=o?n("sources.header.daemon_status",{online:l,total:s}):n("sources.header.all_offline");return f.jsxs("div",{className:"group relative flex items-center",title:u,children:[f.jsx("span",{className:`inline-block h-[7px] w-[7px] rounded-full ${o?"bg-c4a-success":"bg-c4a-error"}`}),f.jsx("span",{className:"pointer-events-none absolute right-full mr-2 hidden whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-xs text-c4a-text-secondary shadow-c4a-md group-hover:block",children:u})]})}const Rg=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function R2(){const{t:n}=Te(),[l,s]=y.useState(!1);return f.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[f.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[f.jsxs(ga,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),f.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[f.jsx("nav",{className:"flex items-center gap-4",children:Rg.map(({to:i,labelKey:o})=>f.jsx(Ls,{to:i,end:i==="/",className:({isActive:u})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(gd,{}),f.jsx(ga,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})]}),f.jsx("button",{onClick:()=>s(!l),className:"text-c4a-text-secondary md:hidden",children:l?f.jsx(Ul,{size:20}):f.jsx(PS,{size:20})})]}),l&&f.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[f.jsx("nav",{className:"flex flex-col gap-2",children:Rg.map(({to:i,labelKey:o})=>f.jsx(Ls,{to:i,end:i==="/",onClick:()=>s(!1),className:({isActive:u})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(gd,{}),f.jsx(ga,{to:"/login",onClick:()=>s(!1),className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})})]})]})}function T2(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function Bx(n){if(typeof window>"u")return;const l=T2(n);document.documentElement.setAttribute("data-theme",l),localStorage.setItem("theme",n)}function z2(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const $x=No(n=>({theme:z2(),setTheme:l=>{Bx(l),n({theme:l})}}));let Tg=!1;function O2(){if(Tg||typeof window>"u")return;Tg=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{const{theme:s}=$x.getState();s==="system"&&Bx("system")};n.addEventListener("change",l)}O2();const D2=[{mode:"light",icon:b2,labelKey:"footer.theme.light"},{mode:"dark",icon:t2,labelKey:"footer.theme.dark"},{mode:"system",icon:WS,labelKey:"footer.theme.system"}];function qx(){const{t:n}=Te(),{theme:l,setTheme:s}=$x();return f.jsx("div",{className:"flex items-center gap-1",children:D2.map(({mode:i,icon:o,labelKey:u})=>f.jsx("button",{onClick:()=>s(i),title:n(u),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${l===i?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:f.jsx(o,{size:14})},i))})}function Yx(){const{i18n:n}=Te(),l=()=>{const s=n.language==="en"?"zh":"en";n.changeLanguage(s)};return f.jsx("button",{onClick:l,className:"cursor-pointer rounded px-2 py-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-secondary hover:bg-c4a-bg-hover",children:n.language==="en"?"CN":"EN"})}function Gx({compact:n}){const{t:l}=Te(),s=new Date().getFullYear(),i=n?"footer.copyright_compact":"footer.copyright";return f.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:l(i,{year:s})})}const M2="_brandIcon_1c7st_1",A2="_iconPulse_1c7st_35",zg={brandIcon:M2,iconPulse:A2};function k2({variant:n}){const{t:l}=Te(),s=n==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return f.jsx("footer",{className:`border-t border-c4a-border-subtle ${s} px-4 py-4`,children:f.jsxs("div",{className:"flex items-end justify-between gap-4",children:[f.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[f.jsx("div",{className:zg.brandIcon,children:f.jsx("span",{className:zg.iconPulse,children:"C4A"})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:l("footer.tagline")})]})]}),f.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(qx,{}),f.jsx(Yx,{})]}),f.jsx(Gx,{})]})]})})}function L2(){return f.jsxs("div",{className:"flex min-h-screen flex-col",children:[f.jsx(R2,{}),f.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:f.jsx(Ex,{})}),f.jsx(k2,{})]})}function U2({onToggleSidebar:n}){const{t:l}=Te();return f.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:f.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("button",{onClick:n,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:f.jsx(l2,{size:20})}),f.jsxs(ga,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),f.jsx(ga,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(gd,{}),f.jsx(ga,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:l("nav.login")})]})]})})}const H2=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"}`,B2=[{to:"/studio/modeling",icon:mS,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:pS,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:hd,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:p2,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:j2,i18nKey:"studio.sidebar.collaboration"},{to:"/studio/settings",icon:m2,i18nKey:"studio.sidebar.settings"}];function Og({onNavigate:n}){const{t:l}=Te(),s=tn(),i=An(),o=Wt(Hl(Mr)),u=s.pathname.startsWith("/studio/sources")||s.pathname.startsWith("/studio/source/"),[m,p]=y.useState(u);y.useEffect(()=>{u&&p(!0)},[u]);const g=h=>h.id===ul?l("sources.library.default_cloud_name"):h.name;return f.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("nav",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"group/sources",children:[f.jsxs("button",{onClick:()=>p(h=>!h),className:`flex w-full cursor-pointer items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[f.jsx(jS,{size:14}),l("studio.sidebar.sources"),f.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"rounded p-0.5 text-c4a-text-muted opacity-0 transition-all hover:bg-c4a-bg-hover max-md:opacity-100 group-hover/sources:opacity-100 group-hover/sources:text-c4a-accent",title:l("sources.menu.add_client"),children:f.jsx(Ux,{size:12})}),f.jsx(sa,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&f.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(h=>{const v=g(h);return f.jsxs(Ls,{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"?f.jsx(vS,{size:13,className:"shrink-0 opacity-60"}):f.jsx(XS,{size:13,className:"shrink-0 opacity-60"}),f.jsx("span",{className:"truncate",children:v}),h.type==="daemon"&&f.jsx("span",{className:`ml-auto h-[7px] w-[7px] shrink-0 rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`})]},h.id)})})]}),B2.map(({to:h,icon:v,i18nKey:b})=>f.jsxs(Ls,{to:h,onClick:n,className:({isActive:j})=>H2(j),children:[f.jsx(v,{size:14}),l(b)]},h))]}),f.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(qx,{}),f.jsx(Yx,{})]}),f.jsx(Gx,{compact:!0})]})]})}function $2(){const[n,l]=y.useState(!1);return y.useEffect(()=>{Wt.getState().fetchLibraries(),kl.getState().fetchDaemonStatus()},[]),y.useEffect(()=>en.onStatusChange(s=>{s==="connected"&&(Wt.getState().fetchLibraries(),kl.getState().fetchDaemonStatus())}),[]),f.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[f.jsx(U2,{onToggleSidebar:()=>l(!n)}),f.jsxs("div",{className:"flex min-h-0 flex-1",children:[f.jsx("div",{className:"hidden md:block",children:f.jsx(Og,{})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>l(!1)}),f.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:f.jsx(Og,{onNavigate:()=>l(!1)})})]}),f.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:f.jsx(Ex,{})})]})]})}function q2(){const{t:n}=Te();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[f.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:n("home.hero.title")}),f.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:n("home.hero.description")}),f.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[f.jsxs(ga,{to:"/studio",className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[n("home.hero.cta.studio"),f.jsx(Mx,{size:14})]}),f.jsx("a",{href:"https://github.com/context4ai/c4a",target:"_blank",rel:"noopener noreferrer",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("home.hero.cta.github")})]})]})}function Qa({title:n,version:l,description:s}){const{t:i}=Te();return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-md text-center",children:[f.jsx("h2",{className:"font-mono text-2xl font-bold uppercase text-c4a-text-primary",children:n}),l&&f.jsx("span",{className:"mt-3 inline-block rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1 font-mono text-xs uppercase text-c4a-accent",children:i("placeholder.coming",{version:l})}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:s})]})})}function Y2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.login.title"),version:"0.5.0",description:n("page.login.description")})}function G2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function V2(){const{t:n}=Te();return f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n("notfound.title")}),f.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:n("notfound.description")}),f.jsx(ga,{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 Dg(){const{t:n}=Te(),l=Nx();let s="500",i=n("error.description");return Or(l)?(s=String(l.status),l.status===404?i=n("notfound.description"):l.statusText&&(i=l.statusText)):l instanceof Error&&(i=l.message),f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:s}),f.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:i}),f.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[f.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:[f.jsx(u2,{size:14}),n("error.reload")]}),f.jsx(ga,{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 K2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function X2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function Q2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function Z2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function F2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}function J2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.settings.title"),version:"0.5.x",description:n("page.settings.description")})}function P2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function I2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function W2(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function e_(){const{t:n}=Te();return f.jsx(Qa,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const Eo=(n,l)=>{for(const s of n){if(s.path===l)return s;if(s.children){const i=Eo(s.children,l);if(i)return i}}return null},t_=(n,l)=>l===""?n:Eo(n,l)?.children??[],Vx=(n,l)=>{if(!l)return[];const s=l.split("/"),i=[];let o="";for(const u of s){o=o?`${o}/${u}`:u;const m=Eo(n,o);m&&i.push(m)}return i},Co=No(n=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:l,limit:s,offset:i})=>{n({loading:!0,error:null});try{const o={library_id:l};s!==void 0&&(o.limit=String(s)),i!==void 0&&(o.offset=String(i));const u=await St.get("/sources",o);n({rootSources:u.items,total:u.total,limit:u.limit,offset:u.offset,loading:!1})}catch(o){n({error:o instanceof Error?o.message:"Failed to load sources",loading:!1})}},fetchRootSource:async l=>{const s=await St.get(`/sources/${l}`);return n({currentRoot:s}),s},createSource:async l=>await St.post("/sources",l),addTreeNode:async(l,s)=>{const i=await St.post(`/sources/${l}/tree`,s);return n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot})),i},updateSource:async(l,s)=>{const i=await St.put(`/sources/${l}`,s);n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot}))},deleteSource:async l=>{await St.delete(`/sources/${l}`),n(s=>({rootSources:s.rootSources.filter(i=>i.id!==l),currentRoot:s.currentRoot?.id===l?null:s.currentRoot}))},deleteTreeNode:async(l,s)=>{const i=await St.delete(`/sources/${l}/tree?path=${encodeURIComponent(s)}`);return n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot})),i},uploadDoc:async l=>await St.post("/sources/upload",l),setFilter:l=>n({filter:l}),clearSources:()=>n({rootSources:[],currentRoot:null,total:0,offset:0})}));function Ar({segments:n}){const{t:l}=Te(),s=y.useRef(null),i=y.useRef(null),[o,u]=y.useState(0),m=[{label:l("sources.breadcrumb.sources")},...n],p=Math.max(0,m.length-3);y.useEffect(()=>{const h=s.current,v=i.current;if(!h||!v)return;const b=()=>{const _=h.clientWidth,N=Array.from(v.children);if(N.length===0)return;const z=N.map(Z=>Z.offsetWidth),O=4;if(z.reduce((Z,E)=>Z+E,0)+O*(z.length-1)<=_){u(0);return}const Q=20,Y=(z[0]??0)+(z[1]??0)+O,G=z[z.length-1]??0,K=Y+O+Q+O+G;let ne=p;for(let Z=1;Z<=p;Z++){let E=0;for(let $=2+Z;$<z.length-1;$++)E+=z[$]+O;if(K+E<=_){ne=Z;break}}u(ne)};b();const j=new ResizeObserver(b);return j.observe(h),()=>j.disconnect()},[p,n,l]);const g=(()=>{if(o===0||m.length<=3)return m;const h=m.slice(0,2),v=m[m.length-1],b=m.slice(2+o,m.length-1);return[...h,{label:"…"},...b,v]})();return f.jsxs("div",{ref:s,className:"relative min-w-0 overflow-hidden",children:[f.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs text-c4a-text-muted",children:g.map((h,v)=>{const b=v===g.length-1;return f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&f.jsx(sa,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!b?f.jsx(ga,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):f.jsx("span",{className:`whitespace-nowrap ${b?"text-c4a-text-primary":""}`,children:h.label})]},v)})}),f.jsx("div",{ref:i,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 items-center gap-1 overflow-visible whitespace-nowrap font-mono text-xs",children:m.map((h,v)=>f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&f.jsx(sa,{size:12}),f.jsx("span",{className:"whitespace-nowrap",children:h.label})]},v))})]})}const a_=["all","indexed","not_indexed"];function n_({value:n,onChange:l}){const{t:s}=Te(),[i,o]=y.useState(!1),u=y.useRef(null),m=y.useRef(null),p={all:s("sources.filter.all"),indexed:s("sources.filter.indexed"),not_indexed:s("sources.filter.not_indexed")},g=y.useCallback(b=>{u.current&&!u.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 f.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(ZS,{size:12}),f.jsx("span",{className:"hidden sm:inline",children:p[n]}),f.jsx(sa,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&f.jsx("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[120px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:a_.map(b=>f.jsxs("button",{onClick:()=>{l(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:[f.jsx(Al,{size:12,className:b===n?"opacity-100":"opacity-0"}),p[b]]},b))})]})}function Kx({currentName:n,onConfirm:l,onCancel:s,error:i}){const[o,u]=y.useState(n),m=y.useRef(null);y.useEffect(()=>{m.current?.select()},[]);const p=y.useCallback(()=>{const h=o.trim();h&&h!==n?l(h):s()},[o,n,l,s]),g=y.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),p()):h.key==="Escape"&&s()},[p,s]);return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,onBlur:p,className:"min-w-0 flex-1 rounded border border-c4a-accent bg-c4a-bg-surface px-2 py-1 text-sm text-c4a-text-primary outline-none",autoFocus:!0}),f.jsx("button",{onClick:h=>{h.stopPropagation(),p()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:f.jsx(Al,{size:14})}),f.jsx("button",{onClick:h=>{h.stopPropagation(),s()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:f.jsx(Ul,{size:14})}),i&&f.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:i})]})}const l_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),r_=new Set([".ts",".tsx",".md"]),s_=new Set([".md",".doc",".docx",".pdf",".ppt",".pptx",".txt"]),i_=new Set([".md",".txt"]),o_=5*1024*1024,c_=10;function xd(n){const l=n.lastIndexOf(".");return l>=0?n.slice(l).toLowerCase():""}function u_(n){const l=n.includes("/")?n.split("/").pop():n;if(l_.has(l.toLowerCase()))return!0;const s=xd(l);return r_.has(s)}const d_=n=>{const l=new Date(n);if(Number.isNaN(l.getTime()))return"";const s=o=>String(o).padStart(2,"0"),i=`${s(l.getMonth()+1)}-${s(l.getDate())} ${s(l.getHours())}:${s(l.getMinutes())}`;return l.getFullYear()===new Date().getFullYear()?i:`${l.getFullYear()}-${i}`},Mg={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function f_({source:n,isDaemonLibrary:l,isRepoRoot:s}){const{t:i}=Te(),o=n.kind==="source",u=o&&(n.source_type==="code"||u_(n.name)),m=u?"text-c4a-accent":"text-c4a-text-secondary group-hover:text-c4a-accent",p=n.metadata?.origin==="remote";let g;if(n.kind==="folder"?g=s||p?f.jsx(wo,{size:16,className:`shrink-0 ${m}`}):l?f.jsx(AS,{size:16,className:`shrink-0 ${m}`}):f.jsx(Va,{size:16,className:`shrink-0 ${m}`}):n.source_type==="code"?g=f.jsx(zr,{size:16,className:`shrink-0 ${m}`}):g=f.jsx(cl,{size:16,className:`shrink-0 ${m}`}),!o||!u)return f.jsx(f.Fragment,{children:g});const h=Mg[n.index_status]??Mg.none,v=i(`sources.status.${n.index_status}`);return f.jsxs("span",{className:"group/dot relative shrink-0",children:[g,f.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${h}`}),f.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-[10px] text-c4a-text-secondary opacity-0 shadow-lg transition-opacity group-hover/dot:opacity-100",children:v})]})}function Ag({source:n,displayName:l,childCount:s,isDaemonLibrary:i,isRepoRoot:o,hasUpdate:u,onClick:m,onRename:p,onDelete:g}){const{t:h}=Te(),[v,b]=y.useState(!1),[j,_]=y.useState(null),N=y.useCallback(async Y=>{if(!p)return;const G=await p(Y);G?_(G):(b(!1),_(null))},[p]),z=y.useCallback(()=>{b(!1),_(null)},[]),O=!o&&p,X=g,Q=n.updated_at||n.created_at;return f.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:[f.jsx(f_,{source:n,isDaemonLibrary:i??!1,isRepoRoot:o??!1}),v?f.jsx("div",{className:"min-w-0 flex-1",onClick:Y=>Y.stopPropagation(),children:f.jsx(Kx,{currentName:n.name,onConfirm:N,onCancel:z,error:j})}):f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-secondary group-hover:text-c4a-accent",children:l??n.name}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-tight text-c4a-accent/60",children:[f.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-c4a-accent"}),h("sources.change_detection.has_updates")]}),n.kind==="folder"&&s!==void 0&&f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:s})}),Q&&f.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:d_(Q)})]}),(O||X)&&f.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[O?f.jsx("button",{title:h("sources.actions.rename"),onClick:Y=>{Y.stopPropagation(),b(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(md,{size:14})}):X?f.jsx("span",{className:"p-1",children:f.jsx("span",{className:"inline-block h-[14px] w-[14px]"})}):null,X&&f.jsx("button",{title:h("sources.actions.delete"),onClick:Y=>{Y.stopPropagation(),g()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(Hx,{size:14})})]})]})}function Bl({children:n,onClose:l,className:s="",overlayClass:i="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:u=!0,disableClose:m=!1}){const p=y.useRef(null);y.useEffect(()=>{if(!u)return;const h=v=>{v.key==="Escape"&&!m&&l()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[l,u,m]);const g=y.useCallback(h=>{o&&!m&&p.current&&!p.current.contains(h.target)&&l()},[l,o,m]);return f.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${i}`,onClick:g,children:f.jsx("div",{ref:p,className:s,children:n})})}function kg({target:n,onConfirm:l,onCancel:s}){const{t:i}=Te();return f.jsxs(Bl,{onClose:s,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.delete.confirm_title")}),f.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[n.type==="resource"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.resource",{name:n.name})}),f.jsx("p",{children:i("sources.delete.resource_impact")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.session_warning")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="folder"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder",{name:n.name})}),n.folderCount!==void 0&&n.sourceCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder_contents",{folders:n.folderCount,sources:n.sourceCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.sourceCount})})]}):f.jsx("p",{children:i("sources.delete.folder_impact_generic")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")})]}),n.type==="repo"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo",{name:n.name,library:n.libraryName})}),n.packageCount!==void 0&&n.docCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo_contents",{packages:n.packageCount,docs:n.docCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.packageCount+n.docCount})})]}):f.jsx("p",{children:i("sources.delete.repo_impact_generic")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="client"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.client",{name:n.name})}),f.jsx("p",{children:i("sources.delete.client_impact")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")}),f.jsx("p",{className:"text-c4a-text-muted",children:i("sources.delete.client_reregister")})]})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:s,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:l,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:i("common.confirm")})]})]})}function m_({onConfirm:n,onCancel:l,error:s}){const{t:i}=Te(),[o,u]=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 f.jsxs(Bl,{onClose:l,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Lx,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.actions.new_folder")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,placeholder:i("sources.folder.name_placeholder"),className:"w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 text-sm text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent",autoFocus:!0}),s&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:s})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:p,disabled:!o.trim(),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:i("common.confirm")})]})]})}function Iu({label:n,icon:l,items:s,alignRight:i}){const[o,u]=y.useState(!1),m=y.useRef(null),p=y.useRef(null),g=y.useCallback(b=>{m.current&&!m.current.contains(b.target)&&u(!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),u(!0)},[]),v=y.useCallback(()=>{p.current=setTimeout(()=>u(!1),150)},[]);return f.jsxs("div",{ref:m,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:`flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${n?"p-1 sm:px-2 sm:py-1":"p-1"}`,children:[l,n&&f.jsx("span",{className:"hidden sm:inline",children:n}),n&&f.jsx(sa,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&f.jsx("div",{className:`absolute top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${i?"right-0":"left-0"}`,children:s.map(b=>f.jsxs("button",{onClick:()=>{b.onClick(),u(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[b.icon,b.label]},b.label))})]})}function h_({onClose:n}){const{t:l}=Te();return f.jsxs(Bl,{onClose:n,closeOnEsc:!1,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(x2,{size:18,className:"text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("sources.upgrade.title")})]}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("sources.upgrade.description")}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:n,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("common.confirm")})})]})}function p_(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function g_({onConfirm:n,onCancel:l,error:s,uploading:i}){const{t:o}=Te(),[u,m]=y.useState([]),[p,g]=y.useState(null),[h,v]=y.useState(!1),b=y.useRef(null),j=y.useCallback(G=>{g(null);for(const K of G){const ne=xd(K.name);if(!s_.has(ne)){g(o("sources.upload.unsupported_type",{name:K.name}));return}if(K.size>o_){g(o("sources.upload.file_too_large",{name:K.name}));return}}m(K=>{const ne=new Map(K.map(E=>[E.name,E]));for(const E of G)ne.set(E.name,{name:E.name,size:E.size,file:E});const Z=Array.from(ne.values());return Z.length>c_?(g(o("sources.upload.too_many_files")),K):Z})},[o]),_=y.useCallback(G=>{const K=G.target.files;!K||K.length===0||(j(Array.from(K)),G.target.value="")},[j]),N=y.useCallback(G=>{m(K=>K.filter((ne,Z)=>Z!==G)),g(null)},[]),z=y.useCallback(G=>{G.preventDefault(),v(!1);const K=G.dataTransfer?.files;!K||K.length===0||j(Array.from(K))},[j]),O=y.useCallback(G=>{G.preventDefault(),v(!0)},[]),X=y.useCallback(G=>{G.preventDefault(),v(!1)},[]),Q=y.useCallback(async()=>{if(u.length===0)return;const G=await Promise.all(u.map(K=>new Promise((ne,Z)=>{const E=xd(K.name),$=i_.has(E),W=new FileReader;W.onerror=()=>Z(W.error),$?(W.onload=()=>ne({name:K.name,content:W.result,encoding:"utf-8"}),W.readAsText(K.file)):(W.onload=()=>{const de=W.result,ie=de.slice(de.indexOf(",")+1);ne({name:K.name,content:ie,encoding:"base64"})},W.readAsDataURL(K.file))})));n(G)},[u,n]),Y=s||p;return f.jsxs(Bl,{onClose:l,disableClose:i??!1,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(pd,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:b,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:_,className:"hidden"}),f.jsxs("button",{type:"button",onClick:()=>b.current?.click(),onDrop:z,onDragOver:O,onDragLeave:X,disabled:i,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${h?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${i?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[f.jsx(pd,{size:24,className:"text-c4a-text-muted"}),f.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),f.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),u.length>0&&f.jsxs("div",{className:"mt-3",children:[f.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:u.length})}),f.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:u.map((G,K)=>f.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[f.jsx(cl,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:G.name}),f.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:p_(G.size)}),!i&&f.jsx("button",{type:"button",onClick:()=>N(K),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:f.jsx(Ul,{size:12})})]},`${G.name}-${K}`))})]}),Y&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:Y}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,disabled:i,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:o("common.cancel")}),f.jsxs("button",{onClick:Q,disabled:u.length===0||i,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[i&&f.jsx(Ta,{size:12,className:"animate-spin"}),o(i?"sources.upload.uploading":"common.confirm")]})]})]})}function x_({pathLabel:n,loading:l,badge:s,onNavigateUp:i,children:o}){return f.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:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:n}),s]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),f.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:l?f.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:f.jsx(Ta,{size:14,className:"animate-spin text-c4a-text-muted"})}):f.jsxs(f.Fragment,{children:[i&&f.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:[f.jsx(Va,{size:16,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{children:".."})]}),o]})})]})}function y_(n){const l=n.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(l){const s=l[1],i=l[2];return{slug:i,repoUrl:`https://${s}/${i}`,host:s}}try{const s=new URL(n),i=s.hostname,o=s.pathname.replace(/^\//,"").replace(/\.git$/,"");return o?{slug:o,repoUrl:`https://${i}/${o}`,host:i}:null}catch{return null}}function b_(n,l){return`${n}/tree/${encodeURIComponent(l)}`}function v_(n,l){return`${n}/commit/${l}`}function Xx({remoteUrl:n,fallbackName:l,branch:s,commit:i}){const o=n?y_(n):null,u=i.slice(0,7);return f.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?f.jsxs("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:o.repoUrl,children:[f.jsx(Ng,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:o.slug})]}):f.jsxs("span",{className:"flex items-center gap-1 truncate",children:[f.jsx(Ng,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:l||"repo"})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?f.jsxs("a",{href:b_(o.repoUrl,s),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[f.jsx(fd,{size:10,className:"shrink-0"}),f.jsx("span",{children:s})]}):f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(fd,{size:10,className:"shrink-0"}),f.jsx("span",{children:s})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?f.jsx("a",{href:v_(o.repoUrl,i),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:u}):f.jsx("span",{children:u})]})}function S_(n,l,s){const[i,o]=y.useState({}),u=y.useRef(new Set);return y.useEffect(()=>{if(!n||!l||s.length===0)return;const m=s.filter(p=>{const g=p.metadata;return g?.origin==="remote"&&g?.remote_url&&g?.remote_commit&&!u.current.has(p.id)});if(m.length!==0){m.forEach(p=>u.current.add(p.id));for(const p of m){const g=p.metadata;St.post("/import/remote/refs",{library_id:n,url:g.remote_url}).then(h=>{const v=g.remote_ref||"",b=h.branches?.find(j=>j.name===v)??h.tags?.find(j=>j.name===v);b&&b.commit!==g.remote_commit&&o(j=>({...j,[p.id]:!0}))}).catch(()=>{})}}},[n,l,s]),i}function __({library:n,onNewFolder:l,onImportRepo:s,onImportDir:i,onUpgrade:o}){const{t:u}=Te(),m=n.type==="daemon";return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-2xl text-center",children:[f.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:u(m?"sources.empty.daemon.title":"sources.empty.cloud.title")}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:u(m?"sources.empty.daemon.description":"sources.empty.cloud.description")}),f.jsx("div",{className:"mt-6 flex justify-center gap-3",children:m?f.jsxs(f.Fragment,{children:[i&&f.jsx("button",{onClick:i,disabled:!n.is_online,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:u("sources.actions.import_dir")}),s&&f.jsx("button",{onClick:s,disabled:!n.is_online,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:u("sources.actions.import_repo")})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:u("sources.actions.new_folder")}),o&&f.jsx("button",{onClick:o,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:u("sources.actions.import_repo_url")})]})})]})})}function j_(){const{t:n}=Te();return f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[f.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.empty.indexed.title")}),f.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:n("sources.empty.indexed.description")})]})}const Wu=n=>{let l=0,s=0,i=0,o=0,u=0;const m=p=>{for(const g of p.children??[])g.kind==="folder"?(l++,m(g)):g.kind==="source"&&(s++,g.source_type==="code"?i++:o++,(g.index_status==="indexed"||g.index_status==="stale")&&u++)};return m(n),{folders:l,sources:s,codeSources:i,docSources:o,indexedSources:u}};function N_(){const{t:n}=Te(),l=An(),{libId:s}=qs(),[i,o]=jo(),u=i.get("rootId")||null,m=i.get("path")||"",g=Wt(Hl(Mr)).find(te=>te.id===s),h=Wt(te=>te.updateLibraryName),v=Wt(te=>te.deleteLibrary),{rootSources:b,currentRoot:j,loading:_,filter:N,fetchRootSources:z,fetchRootSource:O,createSource:X,addTreeNode:Q,updateSource:Y,deleteSource:G,deleteTreeNode:K,uploadDoc:ne,setFilter:Z}=Co(),[E,$]=y.useState(!1),[W,de]=y.useState(null),[ie,re]=y.useState(null),[ue,xe]=y.useState(null),[A,ee]=y.useState(null),[ce,P]=y.useState(!1),[Se,w]=y.useState(!1),[B,F]=y.useState(null),[le,pe]=y.useState(!1),[Ne,we]=y.useState(!1),[ut,Be]=y.useState(null),[xa,bt]=y.useState(!1);y.useEffect(()=>{s&&z({library_id:s})},[s,z]),y.useEffect(()=>{u&&O(u)},[u,O]);const at=u!==null,Ie=y.useMemo(()=>at?j?[...t_(j.tree,m)].sort((Ye,Je)=>Ye.kind!==Je.kind?Ye.kind==="folder"?-1:1:Ye.name.localeCompare(Je.name)).map(Ye=>({type:"node",root:j,node:Ye})):[]:[...b].sort((Je,lt)=>Je.kind!==lt.kind?Je.kind==="folder"?-1:1:new Date(lt.created_at).getTime()-new Date(Je.created_at).getTime()).map(Je=>({type:"root",root:Je,node:null})),[at,b,j,m]),_t=y.useMemo(()=>N==="all"?Ie:Ie.filter(te=>te.type==="root"||!te.node||te.node.kind==="folder"?!0:N==="indexed"?te.node.index_status==="indexed":te.node.index_status==="none"||!te.node.index_status),[Ie,N]),jt=g?.type==="daemon",oa=g?.type==="cloud",zt=jt&&!at,Oa=S_(s,oa,b),ya=y.useMemo(()=>{if(!g)return[];const te=[{label:g.id===ul?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];return at&&j&&(te.push({label:j.name,to:`/studio/sources/${g.id}?rootId=${j.id}`}),m&&Vx(j.tree,m).forEach(Ye=>{te.push({label:Ye.name,to:`/studio/sources/${g.id}?rootId=${j.id}&path=${encodeURIComponent(Ye.path)}`})})),te},[g,at,j,m,n]),Da=y.useCallback(async te=>{if(s)try{at&&u?await Q(u,{parent_path:m,kind:"folder",name:te}):(await X({library_id:s,kind:"folder",name:te}),z({library_id:s})),$(!1),de(null)}catch(fe){fe instanceof Ol&&fe.status===409&&de(n("sources.error.name_conflict",{name:te}))}},[s,at,u,m,X,Q,z,n]),Vt=y.useCallback(te=>{s&&(te.type==="root"?te.root.kind==="source"?l(`/studio/source/${te.root.id}`):o({rootId:te.root.id}):te.node&&(te.node.kind==="folder"?o({rootId:te.root.id,path:te.node.path}):l(`/studio/source/${te.root.id}?path=${encodeURIComponent(te.node.path)}`)))},[s,l,o]),na=y.useCallback(()=>{if(!(!u||!s))if(m){const te=m.split("/");te.pop();const fe=te.join("/");o(fe?{rootId:u,path:fe}:{rootId:u})}else o({})},[u,s,m,o]),ba=y.useCallback(async(te,fe)=>{try{return await Y(te,{name:fe}),z({library_id:s}),null}catch(Ye){return Ye instanceof Ol&&Ye.status===409?n("sources.error.name_conflict",{name:fe}):null}},[s,Y,z,n]),Nt=y.useCallback(te=>{if(te.type==="root"){xe(te.root.id),ee(null);const fe=te.root.tree.length>0?Wu({children:te.root.tree}):void 0;re(jt?{type:"repo",name:te.root.name,libraryName:g.name,...fe?{packageCount:fe.codeSources,docCount:fe.docSources,indexedCount:fe.indexedSources}:{}}:{type:te.root.kind==="folder"?"folder":"resource",name:te.root.name,...te.root.kind==="folder"&&fe?{folderCount:fe.folders,sourceCount:fe.sources,indexedCount:fe.indexedSources}:{}})}else if(te.node)if(xe(te.root.id),ee(te.node.path),te.node.kind==="folder"){const fe=Wu(te.node);re({type:"folder",name:te.node.name,folderCount:fe.folders,sourceCount:fe.sources,indexedCount:fe.indexedSources})}else re({type:"resource",name:te.node.name})},[jt,g]),ye=y.useCallback(async()=>{if(!(!ue||!s)){try{A?await K(ue,A):(await G(ue),z({library_id:s}))}catch{}re(null),xe(null),ee(null)}},[ue,A,s,G,K,z]),Oe=y.useCallback(()=>{if(!s)return;const te=new URLSearchParams;u&&te.set("parentId",u),m&&te.set("parentPath",m);const fe=te.toString();l(`/studio/sources/import/${s}${fe?`?${fe}`:""}`)},[s,l,u,m]),Qe=y.useCallback(()=>{s&&l(`/studio/sources/import-dir/${s}`)},[s,l]),$t=y.useCallback(async te=>{if(s){pe(!0),F(null);try{const fe={library_id:s,files:te.map(Ye=>{const Je={file_name:Ye.name,content:Ye.content};return Ye.encoding&&(Je.encoding=Ye.encoding),Je})};at&&u&&(fe.root_source_id=u,fe.parent_path=m),await ne(fe),at&&u?O(u):z({library_id:s}),w(!1)}catch(fe){fe instanceof Ol&&fe.status===409?F(n("sources.error.name_conflict",{name:te[0]?.name??""})):fe instanceof Ol&&F(fe.message)}finally{pe(!1)}}},[s,at,u,m,ne,z,O,n]),Ot=g?.id===ul,ht=y.useCallback(async te=>{if(s)try{await h(s,te),we(!1),Be(null)}catch(fe){const Ye=fe instanceof Error?fe.message:String(fe);Be(Ye)}},[s,h]),ca=y.useCallback(()=>{we(!1),Be(null)},[]),mn=y.useCallback(async()=>{if(s){try{await v(s),l("/studio/sources/add-client")}catch{}bt(!1)}},[s,v,l]),Qt=y.useCallback(()=>{bt(!1)},[]);if(!g)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const qt=b.length===0&&N==="all"&&!_&&!at,wt=_t.filter(te=>te.type==="node"&&te.node?.kind==="source").length===0&&N==="indexed"&&!_,me=at&&j?.metadata?.origin==="remote",Ue=!zt,Ze=oa&&!me,Zt=zt;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("div",{className:"min-w-0 flex-1",children:Ne?f.jsx(Kx,{currentName:g.name,onConfirm:ht,onCancel:ca,error:ut}):f.jsx(Ar,{segments:ya})}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Ze&&f.jsxs(f.Fragment,{children:[f.jsx(Iu,{label:n("sources.actions.upload"),icon:f.jsx(pd,{size:14}),items:[{label:n("sources.actions.upload_doc"),icon:f.jsx(cl,{size:14}),onClick:()=>w(!0)}]}),f.jsx(Iu,{label:n("sources.actions.add"),icon:f.jsx(Ux,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:f.jsx(Lx,{size:14}),onClick:()=>$(!0)},{label:n("sources.actions.add_web"),icon:f.jsx(YS,{size:14}),onClick:()=>P(!0)},{label:n("sources.actions.add_feishu"),icon:f.jsx(wS,{size:14}),onClick:()=>P(!0)}]}),f.jsxs("button",{onClick:()=>{const te=new URLSearchParams;u&&te.set("parentId",u),m&&te.set("parentPath",m);const fe=te.toString();l(`/studio/sources/import-remote/${s}${fe?`?${fe}`:""}`)},className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(jg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo_url")})]})]}),Zt&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:Qe,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(DS,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_dir")})]}),f.jsxs("button",{onClick:Oe,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(jg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo")})]}),f.jsx(Iu,{label:"",icon:f.jsx(md,{size:14}),alignRight:!0,items:[{label:n("sources.library.rename"),icon:f.jsx(md,{size:14}),onClick:()=>we(!0)},...Ot?[]:[{label:n("sources.actions.delete"),icon:f.jsx(Hx,{size:14}),onClick:()=>bt(!0)}]]})]}),Ue&&f.jsx(n_,{value:N,onChange:Z})]})]}),qt?f.jsx(__,{library:g,onNewFolder:()=>$(!0),...jt?{onImportRepo:Oe,onImportDir:Qe}:{},...oa?{onUpgrade:()=>{const te=new URLSearchParams;u&&te.set("parentId",u),m&&te.set("parentPath",m);const fe=te.toString();l(`/studio/sources/import-remote/${s}${fe?`?${fe}`:""}`)}}:{}}):f.jsx(x_,{pathLabel:ya.map(te=>te.label).join(" / "),loading:_,badge:(()=>{if(!at||!j)return;const te=j.metadata,fe=te?.pinned_branch??te?.remote_ref,Ye=te?.pinned_hash??te?.remote_commit;if(!(!fe||!Ye))return f.jsx(Xx,{remoteUrl:te?.remote_url,fallbackName:j.name,branch:fe,commit:Ye})})(),onNavigateUp:at?na:void 0,children:_t.length===0?wt?f.jsx(j_,{}):at?null:f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:n("common.items",{count:0})}):f.jsx("div",{className:"flex flex-col gap-0.5",children:_t.map(te=>{if(te.type==="root"){const lt=te.root,la=jt,Ma=la?lt.metadata?.local_path:void 0,Za=lt.tree.length>0?Wu({children:lt.tree}):void 0,an=Za?Za.folders+Za.sources:0,va=lt.metadata?.origin==="remote";return f.jsx(Ag,{source:{id:lt.id,library_id:lt.library_id,owner_id:lt.owner_id,path:"",kind:lt.kind,source_type:lt.source_type,name:lt.name,content_hash:lt.content_hash,metadata:lt.metadata,index_status:lt.index_status,created_at:lt.created_at,updated_at:lt.updated_at},...typeof Ma=="string"?{displayName:Ma}:{},...lt.kind==="folder"?{childCount:an}:{},isDaemonLibrary:jt??!1,isRepoRoot:la||va,...Oa[lt.id]?{hasUpdate:!0}:{},onClick:()=>Vt(te),...va?{}:{onRename:$l=>ba(lt.id,$l)},onDelete:()=>Nt(te)},lt.id)}const fe=te.node,Ye=`${te.root.id}:${fe.path}`,Je=fe.kind==="folder"?fe.children?.length??0:void 0;return f.jsx(Ag,{source:{id:te.root.id,library_id:te.root.library_id,owner_id:te.root.owner_id,path:fe.path,kind:fe.kind,source_type:fe.source_type??null,name:fe.name,content_hash:null,metadata:fe.metadata??null,index_status:fe.index_status??"none",created_at:te.root.created_at,updated_at:te.root.updated_at},...Je!==void 0?{childCount:Je}:{},isDaemonLibrary:jt??!1,onClick:()=>Vt(te),...oa&&te.root.metadata?.origin!=="remote"?{onDelete:()=>Nt(te)}:{}},Ye)})})}),E&&f.jsx(m_,{onConfirm:Da,onCancel:()=>{$(!1),de(null)},error:W}),Se&&f.jsx(g_,{onConfirm:$t,onCancel:()=>{w(!1),F(null)},error:B,uploading:le}),ce&&f.jsx(h_,{onClose:()=>P(!1)}),ie&&f.jsx(kg,{target:ie,onConfirm:ye,onCancel:()=>{re(null),xe(null),ee(null)}}),xa&&g&&f.jsx(kg,{target:{type:"client",name:g.name},onConfirm:mn,onCancel:Qt})]})}function dn({active:n,current:l}){return f.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${l?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Dl(){return f.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function Qx({libraryName:n}){const{t:l}=Te();return f.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[f.jsx("p",{className:"text-sm text-c4a-warning",children:l("sources.import.daemon_offline",{name:n})}),f.jsx(ga,{to:"/studio/sources/add-client",className:"mt-4 inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("sources.import.view_guide")})]})}function Rd({step:n,totalSteps:l,importing:s,stepBusy:i,canProceed:o,safetyNoticeKey:u,confirmLabelKey:m,onPrev:p,onNext:g,onImport:h}){const{t:v}=Te();return f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[f.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:v(u),onClick:b=>b.currentTarget.classList.toggle("line-clamp-1"),children:v(u)}),f.jsxs("div",{className:"flex shrink-0 gap-2",children:[n>1&&f.jsx("button",{onClick:p,disabled:s||i,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover disabled:opacity-40",children:v("common.previous")}),n<l?f.jsx("button",{onClick:g,disabled:!o||i,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:v("common.next")}):f.jsxs("button",{onClick:h,disabled:s||i||!o,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[s&&f.jsx(Ta,{size:12,className:"animate-spin"}),v(s?"sources.import.importing":m)]})]})]})}function Zx(n,l){const s=y.useCallback(async(m,p)=>{if(!n)throw new Error("No library");const g=await St.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 St.get("/sources",{library_id:n,limit:"500"});if(m)return;const g=p.items.map(h=>{const v=h.metadata;return typeof v?.local_path=="string"?v.local_path:null}).filter(h=>h!==null);o(g)}catch{}})(),()=>{m=!0}},[n]);const u=y.useMemo(()=>{const m=l?.config;return!m||!Array.isArray(m.allowed_paths)?[]:m.allowed_paths},[l]);return{rpc:s,importedPaths:i,allowedPaths:u}}function w_(n,l){const s=n.toLowerCase();try{if(s.endsWith("package.json")){const i=JSON.parse(l);if(typeof i.name=="string"&&i.name.trim())return i.name.trim()}if(s.endsWith("pyproject.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("go.mod"))return l.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(s.endsWith("cargo.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("pom.xml"))return l.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(s.endsWith("build.gradle"))return l.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function Fx(n,l,s="repo"){const i=[];for(const u of n){const m=u.path.split("/"),p=m.slice(0,-1).join("/")||".",g=m.length===1||u.path==="package.json",h=p==="."?s:m[m.length-2]||p,v=w_(u.path,u.content);i.push({name:v||h,path:p,isRoot:g})}const o=l.filter(u=>/\.md$/i.test(u.path)).map(u=>u.path);return{packages:i,mdFiles:o}}const Lg=new Set(["tree","blob","commit","commits","raw","src"]),E_=new Set(["commit","commits"]);function C_(n){let l;try{l=new URL(n.trim())}catch{return{repoUrl:n.trim()}}const s=l.pathname.split("/").filter(Boolean);let i=-1;for(let h=2;h<s.length;h++){if(s[h]==="-"&&h+1<s.length&&Lg.has(s[h+1])){i=h;break}if(Lg.has(s[h])){i=h;break}}if(i===-1)return{repoUrl:`${l.protocol}//${l.host}${l.pathname}`.replace(/\/+$/,"")};const o=s.slice(0,i).join("/"),u=`${l.protocol}//${l.host}/${o}`;let m,p;if(s[i]==="-"?(m=s[i+1],p=i+2):(m=s[i],p=i+1),p>=s.length)return{repoUrl:u};const g=s[p];return E_.has(m)?{repoUrl:u,commit:g}:{repoUrl:u,ref:g}}function il(n){try{return(new URL(n).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return n.split("/").pop()||n}}function Jx(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}:${String(n.getSeconds()).padStart(2,"0")}`}function Px(){const{t:n}=Te(),[l,s]=y.useState(!1),[i,o]=y.useState(null),u=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((_,N)=>{navigator.clipboard.writeText(_),o(N),clearTimeout(u.current),u.current=setTimeout(()=>o(null),1500)},[]),b=y.useCallback(()=>{clearTimeout(m.current),s(!0)},[]),j=y.useCallback(()=>{m.current=setTimeout(()=>s(!1),150)},[]);return f.jsxs("span",{className:"relative",onMouseEnter:b,onMouseLeave:j,children:[f.jsx(Ax,{size:12,className:"text-c4a-warning"}),l&&f.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:b,onMouseLeave:j,children:[f.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:g}),f.jsx("button",{onClick:()=>v(g,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===0?f.jsx(Al,{size:10}):f.jsx(dd,{size:10})})]}),f.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_all")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),f.jsx("button",{onClick:()=>v(h,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===1?f.jsx(Al,{size:10}):f.jsx(dd,{size:10})})]})]})]})}function Ix({open:n,onClose:l,rpc:s,onNavigate:i,defaultPath:o}){const{t:u}=Te(),[m,p]=y.useState(o??""),[g,h]=y.useState(null),[v,b]=y.useState(!1),j=y.useRef(null);y.useEffect(()=>{o&&!m&&p(o)},[o]);const _=y.useCallback(async()=>{const z=m.trim();if(z){b(!0),h(null);try{(await s("fs/exists",{path:z})).exists?(i(z),p(o??""),h(null),l()):h(u("sources.import.wildcard_path_not_found"))}catch(O){h(O instanceof Error?O.message:String(O))}finally{b(!1)}}},[m,s,u,i,l]),N=y.useCallback(()=>{p(o??""),h(null),l()},[l,o]);return n?f.jsxs(Bl,{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:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:u("sources.import.wildcard_go_title")}),f.jsx("button",{onClick:N,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:f.jsx(Ul,{size:14})})]}),f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("input",{ref:j,type:"text",value:m,onChange:z=>{p(z.target.value),h(null)},onKeyDown:z=>{z.key==="Enter"&&_()},placeholder:u("sources.import.wildcard_path_placeholder"),autoFocus:!0,className:"flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent"}),f.jsxs("button",{onClick:_,disabled:v||!m.trim(),className:"flex shrink-0 items-center gap-1.5 rounded bg-c4a-accent px-3 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[v?f.jsx(Ta,{size:12,className:"animate-spin"}):f.jsx(Mx,{size:12}),u("sources.import.wildcard_go")]})]}),g&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:g})]}):null}function Wx({rpc:n,allowedPaths:l,importedPaths:s,onNavigateUpExtra:i}){const o=!!l&&l.length>0,u=o&&l.length===1&&l[0]==="*",[m,p]=y.useState(o),[g,h]=y.useState(o&&!u?"":"/"),[v,b]=y.useState([]),[j,_]=y.useState(!1),[N,z]=y.useState(null),[O,X]=y.useState(null);y.useEffect(()=>{if(o&&!u)return;let $=!1;return(async()=>{try{const W=await n("fs/homeDir",{});$||X(W.home_dir)}catch{$||X("/")}})(),()=>{$=!0}},[o,u,n]);const[Q,Y]=y.useState(!1),G=y.useCallback(async $=>{_(!0),z(null);try{const W=await n("fs/listTree",{path:$,depth:1});b(W.entries||[]),h($),p(!1)}catch(W){const de=W instanceof Error?W.message:String(W);z(de)}finally{_(!1)}},[n]);y.useEffect(()=>{o&&!u||O!==null&&G(O)},[O,o,u,G]);const K=y.useMemo(()=>new Set(s??[]),[s]),ne=y.useCallback(()=>{if(o&&!u&&l.some(de=>de===g)){p(!0),h(""),b([]),z(null),i?.();return}const $=g.split("/").slice(0,-1).join("/")||"/";i?.(),G($)},[o,u,l,g,G,i]),Z=y.useMemo(()=>v.filter($=>$.type==="directory"),[v]),E=y.useMemo(()=>v.filter($=>$.type==="file"),[v]);return{atRoot:m,currentPath:g,entries:v,loading:j,error:N,homeDir:O,goToOpen:Q,hasAllowedPaths:o,isWildcard:u,importedSet:K,dirs:Z,files:E,loadTree:G,handleNavigateUp:ne,setGoToOpen:Y}}function R_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Te(),[m,p]=y.useState(null),{atRoot:g,currentPath:h,entries:v,loading:b,error:j,homeDir:_,goToOpen:N,isWildcard:z,importedSet:O,dirs:X,files:Q,loadTree:Y,handleNavigateUp:G,setGoToOpen:K}=Wx({rpc:n,allowedPaths:i??[],importedPaths:o??[],onNavigateUpExtra:()=>p(null)}),[ne,Z]=y.useState(null),[E,$]=y.useState(!1);y.useEffect(()=>{if(!l){Z(null),$(!1);return}Z(null),$(!0);let re=!1;return(async()=>{try{const ue=await n("fs/repoStatus",{path:l});re||(Z({branch:ue.branch,hash:ue.head_hash,remoteUrl:ue.remote_url}),$(!1))}catch{re||(Z(null),$(!1))}})(),()=>{re=!0}},[l,n]);const W=y.useCallback(re=>{if(re.type==="directory")if(re.is_git_repo){if(O.has(re.path))return;p(null),s(re.path,re.name)}else p(re.path),Y(re.path)},[s,Y,O]),de=y.useMemo(()=>X.sort((re,ue)=>re.is_git_repo&&!ue.is_git_repo?-1:!re.is_git_repo&&ue.is_git_repo?1:re.name.localeCompare(ue.name)),[X]),ie=y.useMemo(()=>Q.sort((re,ue)=>re.name.localeCompare(ue.name)),[Q]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[g?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Px,{})]}):f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),l&&E?f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[f.jsx(Ta,{size:12,className:"animate-spin"}),f.jsx("span",{children:u("common.loading")})]}):l&&ne?f.jsx(Xx,{remoteUrl:ne.remoteUrl,fallbackName:l.split("/").pop()||l,branch:ne.branch,commit:ne.hash}):!l&&z&&g?f.jsx("button",{onClick:()=>K(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),g?z?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:_&&f.jsxs("button",{onClick:()=>Y(_),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Va,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[_,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(sa,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(re=>f.jsxs("button",{onClick:()=>Y(re),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Va,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:re}),f.jsx(sa,{size:12,className:"shrink-0 text-c4a-text-muted"})]},re))}):j&&!b?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:j}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[b&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Ta,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&f.jsxs("button",{onClick:G,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:[f.jsx(Va,{size:14}),f.jsx("span",{children:".."})]}),de.map(re=>{const ue=re.is_git_repo&&O.has(re.path),xe=re.is_git_repo?wo:Va;return f.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${ue?"cursor-not-allowed text-c4a-accent/60":l===re.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[f.jsxs("button",{onClick:()=>W(re),disabled:ue||b,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[f.jsx(xe,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate text-left",children:re.name}),ue&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")})]}),!ue&&f.jsx("button",{onClick:A=>{A.stopPropagation(),Y(re.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:re.path,children:f.jsx(sa,{size:12})})]},re.path)}),ie.map(re=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(kx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:re.name})]},re.path)),v.length===0&&!b&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),m&&!l&&f.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:u("sources.import.not_git")}),f.jsx(Ix,{open:N,onClose:()=>K(!1),rpc:n,onNavigate:Y,defaultPath:_??void 0})]})}const wr=50,ed=["main","master"];function T_(n){const l=[],s=[];for(const i of n)ed.includes(i.name)?l.push(i):s.push(i);return l.sort((i,o)=>ed.indexOf(i.name)-ed.indexOf(o.name)),[...l,...s]}function Ug(n,l,s){y.useEffect(()=>{if(!s)return;const i=o=>{n.current&&!n.current.contains(o.target)&&l()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,l,s])}function ey({refs:n,loading:l,error:s,selectedRef:i,commit:o,onRefChange:u,onCommitChange:m,onValidChange:p,onRetry:g,onBranchSwitch:h}){const{t:v}=Te(),[b,j]=y.useState(!1),[_,N]=y.useState(""),[z,O]=y.useState(!0),[X,Q]=y.useState(!0),Y=y.useRef(null),G=y.useRef(null),[K,ne]=y.useState(!1),[Z,E]=y.useState(""),$=y.useRef(null),W=y.useRef(null);Ug(Y,()=>{j(!1),N("")},b),Ug($,()=>{ne(!1),E("")},K),y.useEffect(()=>{b&&setTimeout(()=>G.current?.focus(),0)},[b]),y.useEffect(()=>{K&&setTimeout(()=>W.current?.focus(),0)},[K]),y.useEffect(()=>{p(!!i)},[i,p]);const de=y.useCallback(P=>{u(P.name),m(P.commit),j(!1),N(""),h?.(P.name)},[u,m,h]),ie=y.useCallback((P,Se)=>{m(P),u(Se),ne(!1),E("")},[m,u]),re=y.useMemo(()=>n?T_(n.branches):[],[n]),ue=y.useMemo(()=>{const P=_.toLowerCase();return(P?re.filter(w=>w.name.toLowerCase().includes(P)):re).slice(0,wr)},[re,_]),xe=y.useMemo(()=>{if(!n)return[];const P=_.toLowerCase();return(P?n.tags.filter(w=>w.name.toLowerCase().includes(P)):n.tags).slice(0,wr)},[n,_]),A=y.useMemo(()=>{if(!n)return[];if(n.commits&&n.commits.length>0){const F=Z.toLowerCase(),le=n.commits.map(pe=>({hash:pe.hash,refName:i||"",label:`${pe.hash.slice(0,8)} ${pe.message?`— ${pe.message.slice(0,50)}`:""}`.trim()}));return F?le.filter(pe=>pe.hash.toLowerCase().includes(F)||pe.label.toLowerCase().includes(F)).slice(0,wr):le.slice(0,wr)}const P=new Set,Se=[],w=[...n.branches??[],...n.tags??[]];for(const F of w){const le=F.commit.slice(0,8);P.has(F.commit)||(P.add(F.commit),Se.push({hash:F.commit,refName:F.name,label:`${le} (${F.name})`}))}if(!Z)return Se.slice(0,wr);const B=Z.toLowerCase();return Se.filter(F=>F.hash.toLowerCase().includes(B)||F.label.toLowerCase().includes(B)).slice(0,wr)},[n,Z,i]);if(l)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx(Ta,{size:20,className:"animate-spin text-c4a-accent"}),f.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:v("sources.import_remote.loading_refs")})]});if(s)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[f.jsx(Ul,{size:14,className:"shrink-0"}),v("sources.import.error_title")]}),f.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:s})]});if(!n)return null;const ee=n.branches.find(P=>P.name===i)?.name??n.tags.find(P=>P.name===i)?.name??i,ce=o?o.slice(0,8):"";return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:v("sources.import_remote.ref_label")}),f.jsxs("div",{ref:Y,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>j(!b),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{children:ee||"—"}),f.jsx(sa,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${b?"rotate-90":""}`})]}),b&&f.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[f.jsx(hd,{size:14,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:G,type:"text",value:_,onChange:P=>N(P.target.value),placeholder:v("sources.import_remote.ref_search"),className:"w-full bg-transparent font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),f.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[ue.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[f.jsxs("button",{onClick:()=>O(!z),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(sa,{size:12,className:`transition-transform duration-200 ${z?"rotate-90":""}`}),v("sources.import_remote.ref_branches")," (",n.branches.length,")"]}),z&&ue.map(P=>f.jsxs("button",{onClick:()=>de(P),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${P.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx("span",{className:"truncate",children:P.name}),P.name===i&&f.jsx("span",{children:"✓"})]},`b-${P.name}`))]}),xe.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[f.jsxs("button",{onClick:()=>Q(!X),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(sa,{size:12,className:`transition-transform duration-200 ${X?"rotate-90":""}`}),v("sources.import_remote.ref_tags")," (",n.tags.length,")"]}),X&&xe.map(P=>f.jsxs("button",{onClick:()=>de(P),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${P.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx("span",{className:"truncate",children:P.name}),P.name===i&&f.jsx("span",{children:"✓"})]},`t-${P.name}`))]})]}),ue.length===0&&xe.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:v("sources.import_remote.commit_label")}),f.jsxs("div",{ref:$,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>ne(!K),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:ce||"—"}),f.jsx(sa,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${K?"rotate-90":""}`})]}),K&&f.jsxs("div",{className:"c4a-scrollbar absolute z-20 mt-1 max-h-64 w-full overflow-y-auto rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[f.jsx(hd,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:W,type:"text",value:Z,onChange:P=>E(P.target.value),placeholder:v("sources.import_remote.commit_search"),className:"w-full bg-transparent font-mono text-xs text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),A.map(P=>f.jsxs("button",{onClick:()=>ie(P.hash,P.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:[f.jsx("span",{className:"truncate",children:P.label}),P.hash===o&&f.jsx("span",{className:"text-c4a-accent",children:"✓"})]},P.hash)),A.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),f.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[f.jsx(VS,{size:12,className:"shrink-0"}),v("sources.import_remote.commit_hint")]})]})]})}const z_="_pulseBar_17bq5_1",O_={pulseBar:z_};function D_({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}){const{t:u}=Te();return f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"space-y-2",children:n.map(m=>{const p=s.includes(m.key),g=i===m.key,h=l===m.key;return f.jsxs("div",{className:"flex items-center gap-3",children:[g?f.jsx(Ul,{size:14,className:"shrink-0 text-red-400"}):p||h?f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:`block h-2 w-2 rounded-full bg-c4a-accent ${h?"animate-pulse":""}`})}):f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:"block h-2 w-2 rounded-full border border-c4a-text-muted/40"})}),f.jsx("span",{className:`flex-1 text-sm ${g?"text-red-400":h?"font-medium text-c4a-text-primary":p?"text-c4a-text-secondary":"text-c4a-text-muted"}`,children:m.label}),p&&f.jsx(Al,{size:14,className:"shrink-0 text-c4a-accent/60"}),g&&f.jsx("span",{className:"font-mono text-xs text-red-400",children:u("sources.import.error_title")}),h&&o&&o.label&&f.jsx("span",{className:"max-w-[200px] truncate font-mono text-xs text-c4a-text-muted",children:o.label})]},m.key)})}),l&&!i&&f.jsx("div",{className:"space-y-1",children:o&&o.percent>=0?f.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-c4a-bg-elevated",children:f.jsx("div",{className:"h-full rounded-full bg-c4a-accent transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,o.percent))}%`}})}):f.jsx("div",{className:`h-1.5 rounded-full bg-c4a-bg-elevated ${O_.pulseBar}`})})]})}function ty({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o,failedError:u,logs:m}){const p=y.useRef(null);return y.useEffect(()=>{p.current?.scrollIntoView({behavior:"smooth"})},[m.length]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx(D_,{stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}),f.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[m.map((g,h)=>f.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:g},h)),f.jsx("div",{ref:p})]}),i&&u&&f.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:f.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:u})})]})}function Dn({icon:n,label:l,value:s,tooltip:i,size:o="sm"}){const u=o==="sm";return f.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[n,f.jsx("span",{className:"font-mono text-xs uppercase",children:l})]}),f.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${u?"text-sm truncate":"text-lg"}`,title:u?String(s):void 0,children:s}),i&&f.jsx("div",{className:"pointer-events-none absolute bottom-full left-0 z-30 mb-1.5 hidden w-max max-w-[260px] rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/stat:block",children:i})]})}const td=100;function ay({repoName:n,repoIdentifier:l,branch:s,commit:i,packages:o,mdFiles:u,importing:m,completed:p}){const{t:g}=Te(),h=i?i.slice(0,7):"",[v,b]=y.useState("packages"),[j,_]=y.useState(td),N=y.useRef(null),z=y.useRef(null);y.useEffect(()=>{_(td),z.current?.scrollTo(0,0)},[v]),y.useEffect(()=>{const G=N.current;if(!G)return;const K=v==="packages"?o.length:u.length;if(j>=K)return;const ne=new IntersectionObserver(Z=>{Z[0]?.isIntersecting&&_(E=>Math.min(E+td,K))},{root:z.current,threshold:.1});return ne.observe(G),()=>ne.disconnect()},[v,j,o.length,u.length]);const O=v==="packages"?o:u,X=O.slice(0,j),Q=j<O.length,Y=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 f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:Y}),f.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[f.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:l})]}),f.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[f.jsx(Dn,{icon:f.jsx(fd,{size:14}),label:g("sources.import.branch"),value:s}),f.jsx(Dn,{icon:f.jsx(BS,{size:14}),label:g("sources.import.commit"),value:h}),f.jsx(Dn,{icon:f.jsx(zr,{size:14}),label:g("sources.import.packages"),value:String(o.length),tooltip:g("sources.import.dir_code_packages_tip")}),f.jsx(Dn,{icon:f.jsx(cl,{size:14}),label:g("sources.import.documents"),value:String(u.length),tooltip:g("sources.import.dir_doc_files_tip")})]}),m&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Ta,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:g("sources.import.importing")})]}),(o.length>0||u.length>0)&&f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[f.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[f.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:g("sources.import.recognized",{packages:o.length,docs:u.length})}),f.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[f.jsxs("button",{onClick:()=>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:[f.jsx(zr,{size:13}),f.jsx("span",{className:"font-mono",children:o.length})]}),f.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:[f.jsx(cl,{size:13}),f.jsx("span",{className:"font-mono",children:u.length})]})]})]}),f.jsx("hr",{className:"border-c4a-border-subtle"}),f.jsx("div",{ref:z,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:O.length===0?f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:v==="packages"?g("sources.import.no_packages"):"—"}):f.jsxs(f.Fragment,{children:[v==="packages"?X.map(G=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(zr,{size:14,className:"shrink-0 text-c4a-accent"}),f.jsx("span",{className:"text-c4a-text-secondary",children:G.name}),f.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:G.path}),G.isRoot&&f.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},G.path)):X.map(G=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(cl,{size:14,className:"shrink-0 text-c4a-text-secondary"}),f.jsx("span",{className:"truncate text-c4a-text-secondary",children:G})]},G)),Q&&f.jsx("div",{ref:N,className:"h-4"})]})})]})]})}const M_=["scan","save"],io={scan:"sources.import.stage.scan",save:"sources.import.stage.save"};function A_(){const{t:n}=Te(),l=An(),{libId:s}=qs(),[i]=jo(),u=Wt(Hl(Mr)).find(ye=>ye.id===s),m=Co(ye=>ye.createSource),p=i.get("parentId")||"",g=i.get("parentPath")||"",[h,v]=y.useState(1),[b,j]=y.useState(null),[_,N]=y.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[z,O]=y.useState(null),[X,Q]=y.useState(!1),[Y,G]=y.useState(null),[K,ne]=y.useState(""),[Z,E]=y.useState(""),[$,W]=y.useState(!1),[de,ie]=y.useState(!1),[re,ue]=y.useState(!1),[xe,A]=y.useState(null),[ee,ce]=y.useState([]),[P,Se]=y.useState(null),[w,B]=y.useState(null),[F,le]=y.useState([]),pe=y.useRef(null),Ne=u?.is_online??!1,{rpc:we,importedPaths:ut,allowedPaths:Be}=Zx(s,u),xa=y.useMemo(()=>M_.map(ye=>({key:ye,label:io[ye]?n(io[ye]):ye})),[n]),bt=y.useCallback(ye=>{le(Oe=>[...Oe,`[${Jx()}] ${ye}`])},[]),at=y.useRef(null),Ie=y.useCallback(ye=>{const Oe=at.current;Oe&&Oe!==ye&&(ce(Qe=>Qe.includes(Oe)?Qe:[...Qe,Oe]),bt(`${n(io[Oe]??Oe)} ${n("sources.import.stage.done_suffix")}`)),bt(`${n(io[ye]??ye)}...`),at.current=ye,A(ye),B(null)},[bt,n]),_t=y.useCallback((ye,Oe)=>{N(Qe=>({...Qe,repoPath:ye,repoName:Oe}))},[]),jt=y.useCallback(async()=>{Q(!0),G(null);try{const ye=await we("fs/repoStatus",{path:_.repoPath}),Oe={branches:ye.branches??[{name:ye.branch,commit:ye.head_hash}],tags:ye.tags??[],default:ye.branch,commits:ye.commits??[{hash:ye.head_hash,message:"HEAD"}]};O(Oe),N(Qe=>({...Qe,isDirty:ye.is_dirty})),ne(Qe=>{if(Qe)return Qe;const $t=Oe.branches.find(ca=>ca.name===Oe.default),Ot=Oe.branches[0],ht=$t??Ot;return ht?(E(ht.commit),ht.name):Qe})}catch(ye){const Oe=ye instanceof Error?ye.message:"Failed to load repository info";G(Oe)}finally{Q(!1)}},[we,_.repoPath]);y.useEffect(()=>{h===2&&_.repoPath&&!z&&jt()},[h,_.repoPath,z,jt]);const oa=y.useCallback(async ye=>{try{const Oe=await we("fs/repoStatus",{path:_.repoPath,branch:ye});O(Qe=>Qe&&{...Qe,commits:Oe.commits??[]})}catch{}},[we,_.repoPath]),zt=y.useCallback(async()=>{if(s){ie(!0),ue(!1),j(null),Se(null),ce([]),at.current=null,A(null),B(null),le([]),v(3);try{Ie("scan");const ye=await we("fs/repoScan",{path:_.repoPath,hash:Z}),Oe=ye.files||[],Qe=ye.manifests||[],$t=il(_.repoPath),{packages:Ot,mdFiles:ht}=Fx(Qe,Oe,$t);N(Qt=>({...Qt,branch:K,commit:Z,repoFiles:Oe,packages:Ot,mdFiles:ht,repoFileContents:Qe})),Ie("save");const ca=await m({library_id:s,repo_name:_.repoName||$t,repo_root_path:_.repoPath,repo_branch:K,repo_commit:Z,repo_files:Oe.map(Qt=>Qt.path),repo_file_contents:Qe,...p?{parent_source_id:p,parent_path:g}:{}});ce(["scan","save"]),at.current=null,A(null),bt(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),bt(n("sources.import.stage.complete"));const mn=Array.isArray(ca)?ca[0]:ca;pe.current=mn?.id??null,ue(!0),ie(!1),v(4)}catch(ye){const Oe=at.current??"scan";Se(Oe),at.current=null,A(null);const Qe=ye instanceof Error?ye.message:String(ye);bt(`ERROR: ${Qe}`),j(Qe),ie(!1)}}},[s,_,K,Z,p,g,we,m,Ie,bt]),Oa=y.useCallback(()=>{Se(null),j(null),zt()},[zt]),ya=y.useCallback(()=>{if(s)if(p){const ye=_.repoName||il(_.repoPath),Oe=g?`${g}/${ye}`:ye;l(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(Oe)}`)}else pe.current?l(`/studio/sources/${s}?rootId=${pe.current}`):l(`/studio/sources/${s}`)},[s,l,p,g,_.repoPath,_.repoName]),Da=y.useMemo(()=>h===1?!!_.repoPath:h===2?$:h===3?re:!1,[h,_.repoPath,$,re]),Vt=y.useMemo(()=>{if(!u)return[];const ye=[{label:u.id===ul?n("sources.library.default_cloud_name"):u.name,to:`/studio/sources/${u.id}`}];if(p&&g){const Oe=g.split("/").filter(Boolean);for(const[Qe,$t]of Oe.entries()){const Ot=Oe.slice(0,Qe+1).join("/");ye.push({label:$t,to:`/studio/sources/${u.id}?rootId=${p}&path=${encodeURIComponent(Ot)}`})}}return ye.push({label:n("sources.import.title")}),ye},[u,p,g,n]);if(!u)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const na=h===4,ba=h===3&&!!P&&!de,Nt=h<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:Vt})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(dn,{active:h>=1,current:h===1}),f.jsx("span",{className:h===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Dl,{}),f.jsx(dn,{active:h>=2,current:h===2}),f.jsx("span",{className:h===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Dl,{}),f.jsx(dn,{active:h>=3,current:h===3}),f.jsx("span",{className:h===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import_remote.step.loading")}),f.jsx(Dl,{}),f.jsx(dn,{active:h>=4,current:h===4}),f.jsx("span",{className:h===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:Ne?f.jsxs(f.Fragment,{children:[h===1&&f.jsx(R_,{rpc:we,selectedPath:_.repoPath,onSelect:_t,allowedPaths:Be,importedPaths:ut}),h===2&&f.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:f.jsx(ey,{refs:z,loading:X,error:Y,selectedRef:K,commit:Z,onRefChange:ne,onCommitChange:E,onValidChange:W,onRetry:jt,onBranchSwitch:oa})}),h===3&&f.jsx(ty,{stages:xa,currentStage:xe,completedStages:ee,failedStage:P,progress:w,failedError:b,logs:F}),h===4&&f.jsx(ay,{repoName:_.repoName||il(_.repoPath),repoIdentifier:_.repoPath,branch:K,commit:Z,packages:_.packages,mdFiles:_.mdFiles,importing:!1,completed:re})]}):f.jsx(Qx,{libraryName:u.name})}),Ne&&f.jsx(f.Fragment,{children:na?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:ya,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.back_to_library")})}):ba?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{v(2),Se(null),j(null),ce([]),at.current=null,A(null),le([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("sources.import_remote.back")}),f.jsx("button",{onClick:Oa,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.retry")})]}):Nt?f.jsx(Rd,{step:h,totalSteps:4,importing:de,stepBusy:X||h===3&&de,canProceed:Da,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>v(ye=>ye-1),onNext:()=>{h===2?zt():v(ye=>ye+1)},onImport:zt}):null}),b&&h!==3&&f.jsxs(Bl,{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:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:b}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.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 Hg=(n,l)=>{let s=0,i=0,o=0;const u=[],m=p=>{for(const g of p)if(g.type==="directory")i++,g.is_git_repo&&o++,g.children&&m(g.children);else if(s++,/\.md$/i.test(g.name)){const h=g.path.startsWith(l)?g.path.slice(l.length).replace(/^\//,""):g.name;u.push(h)}};return m(n),{files:s,dirs:i,gitRepos:o,mdFiles:u}};function k_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Te(),{atRoot:m,currentPath:p,entries:g,loading:h,error:v,homeDir:b,goToOpen:j,isWildcard:_,importedSet:N,dirs:z,files:O,loadTree:X,handleNavigateUp:Q,setGoToOpen:Y}=Wx({rpc:n,allowedPaths:i??[],importedPaths:o??[]}),G=y.useCallback(E=>{if(E.type!=="directory"||N.has(E.path))return;const $=Hg(E.children||[],E.path);s(E.path,E.name,$),X(E.path)},[s,X,N]);y.useEffect(()=>{if(p&&!m&&g.length>=0&&!h){const E=p.split("/").pop()||p,$=Hg(g,p);s(p,E,$)}},[p,m,g,h,s]);const K=y.useMemo(()=>l?l.split("/").pop()||l:"",[l]),ne=y.useMemo(()=>z.sort((E,$)=>E.is_git_repo&&!$.is_git_repo?-1:!E.is_git_repo&&$.is_git_repo?1:E.name.localeCompare($.name)),[z]),Z=y.useMemo(()=>O.sort((E,$)=>E.name.localeCompare($.name)),[O]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Px,{})]}):f.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:p}),l?f.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[f.jsx(Va,{size:12}),f.jsx("span",{children:K})]}):_&&m?f.jsx("button",{onClick:()=>Y(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?_?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:b&&f.jsxs("button",{onClick:()=>X(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:[f.jsx(Va,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[b,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(sa,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(E=>f.jsxs("button",{onClick:()=>X(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:[f.jsx(Va,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:E}),f.jsx(sa,{size:12,className:"shrink-0 text-c4a-text-muted"})]},E))}):v&&!h?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Ta,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&f.jsxs("button",{onClick:Q,disabled:h,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(Va,{size:14}),f.jsx("span",{children:".."})]}),ne.map(E=>{const $=N.has(E.path),W=E.is_git_repo?wo:Va;return f.jsxs("button",{onClick:()=>G(E),disabled:$||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${$?"cursor-not-allowed text-c4a-accent/60":l===E.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[f.jsx(W,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate",children:E.name}),$&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")}),f.jsx(sa,{size:12,className:"shrink-0 text-c4a-text-muted"})]},E.path)}),Z.map(E=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(kx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:E.name})]},E.path)),g.length===0&&!h&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),f.jsx(Ix,{open:j,onClose:()=>Y(!1),rpc:n,onNavigate:X,defaultPath:b??void 0})]})}const L_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),U_=n=>{let l=0,s=0,i=0,o=0,u=0;const m=new Set;for(const p of n)if(p.type==="directory")s++,p.is_git_repo&&u++;else{l++,p.path.toLowerCase().endsWith(".md")&&o++;const h=p.path.split("/").pop();if(h&&L_.has(h.toLowerCase())){const v=p.path.split("/").slice(0,-1).join("/");n.some(j=>j.type==="directory"&&j.is_git_repo&&(v===j.path||v.startsWith(`${j.path}/`)))||m.add(v)}}return i=m.size,{totalFiles:l,totalDirs:s,codePackages:i,docFiles:o,gitRepos:u}};function H_({dirPath:n,rpc:l,importing:s,onScanComplete:i,onBusyChange:o}){const{t:u}=Te(),[m,p]=y.useState(!1),[g,h]=y.useState(null),[v,b]=y.useState(null),j=y.useCallback(async()=>{p(!0),o?.(!0),h(null),b(null);try{const _=await l("fs/dirScan",{path:n}),N=_.entries||[],z=_.manifests||[],O=U_(N);b(O),i(N,O,z)}catch(_){const N=_ instanceof Error?_.message:String(_);h(N)}finally{p(!1),o?.(!1)}},[n,l,i,o]);return y.useEffect(()=>{j()},[j]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),f.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[m&&f.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[f.jsx(Ta,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.dir_scanning")})]}),g&&f.jsxs("div",{className:"mt-6",children:[f.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[f.jsx(Ax,{size:14,className:"mt-0.5 shrink-0"}),u("sources.import.dir_scan_error")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:g}),f.jsxs("button",{onClick:j,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(o2,{size:12}),u("sources.import.dir_scan_retry")]})]}),v&&!m&&!g&&f.jsxs("div",{className:"mt-6 space-y-3",children:[f.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[u("sources.import.dir_scan_complete"),"!"]}),f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[f.jsx(Dn,{icon:f.jsx(cl,{size:14}),label:u("sources.import.dir_doc_files"),value:v.docFiles,tooltip:u("sources.import.dir_doc_files_tip"),size:"lg"}),f.jsx(Dn,{icon:f.jsx(zr,{size:14}),label:u("sources.import.dir_code_packages"),value:v.codePackages,tooltip:u("sources.import.dir_code_packages_tip"),size:"lg"}),v.gitRepos>0&&f.jsx(Dn,{icon:f.jsx(wo,{size:14}),label:u("sources.import.dir_git_repos"),value:v.gitRepos,size:"lg"}),f.jsx(Dn,{icon:f.jsx(Va,{size:14}),label:u("sources.import.dir_total_dirs"),value:v.totalDirs,size:"lg"}),f.jsx(Dn,{icon:f.jsx(TS,{size:14}),label:u("sources.import.dir_total_files"),value:v.totalFiles,size:"lg"})]}),v.gitRepos>0&&f.jsx("p",{className:"text-xs text-c4a-warning",children:u("sources.import.dir_git_skip_hint",{count:v.gitRepos})})]}),s&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Ta,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.importing")})]})]})]})}function B_(){const{t:n}=Te(),l=An(),{libId:s}=qs(),o=Wt(Hl(Mr)).find($=>$.id===s),u=Co($=>$.createSource),[m,p]=y.useState(1),[g,h]=y.useState(!1),[v,b]=y.useState(null),[j,_]=y.useState(!1),[N,z]=y.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),O=o?.is_online??!1,{rpc:X,importedPaths:Q,allowedPaths:Y}=Zx(s,o),G=y.useCallback(($,W,de)=>{z(ie=>({...ie,dirPath:$,dirName:W,fileCount:de.files,subDirCount:de.dirs,gitRepoCount:de.gitRepos,mdFiles:de.mdFiles}))},[]),K=y.useCallback(($,W,de)=>{z(ie=>({...ie,scanEntries:$,scanStats:W,manifests:de}))},[]),ne=y.useCallback(async()=>{if(s){h(!0);try{const $=await u({library_id:s,dir_files:N.scanEntries,dir_name:N.dirName,dir_path:N.dirPath,dir_file_contents:N.manifests}),W=Array.isArray($)?$[0]:$;W?.id?l(`/studio/sources/${s}?rootId=${W.id}`):l(`/studio/sources/${s}`)}catch($){const W=$ instanceof Error?$.message:String($);b(W),h(!1)}}},[s,N,u,l]),Z=y.useMemo(()=>m===1?!!N.dirPath:m===2?N.scanEntries.length>0:!0,[m,N]),E=y.useMemo(()=>o?[{label:o.id===ul?n("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:n("sources.import.dir_title")}]:[],[o,n]);return o?f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:E})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(dn,{active:m>=1,current:m===1}),f.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.select")}),f.jsx(Dl,{}),f.jsx(dn,{active:m>=2,current:m===2}),f.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:O?f.jsxs(f.Fragment,{children:[m===1&&f.jsx(k_,{rpc:X,selectedPath:N.dirPath,onSelect:G,allowedPaths:Y,importedPaths:Q}),m===2&&f.jsx(H_,{dirPath:N.dirPath,rpc:X,importing:g,onScanComplete:K,onBusyChange:_})]}):f.jsx(Qx,{libraryName:o.name})}),O&&f.jsx(Rd,{step:m,totalSteps:2,importing:g,stepBusy:j,canProceed:Z,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>p($=>$-1),onNext:()=>p($=>$+1),onImport:ne}),v&&f.jsxs(Bl,{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:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>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")})})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const $_=/^https:\/\/[^/]+\/.+/;function q_({url:n,onUrlChange:l,onValidChange:s,onRefHint:i}){const{t:o}=Te(),[u,m]=y.useState(null),[p,g]=y.useState([]),h=y.useRef(null);y.useEffect(()=>{St.get("/import/remote/git-hosts").then(_=>g(_.hosts),()=>{})},[]);const v=y.useCallback(_=>{if(!_){m(null),s(!1);return}const N=C_(_),z=N.repoUrl!==_.trim(),O=z?N.repoUrl:_;z&&(l(O),i?.(N.ref,N.commit)),$_.test(O)?(m(null),s(!0)):(m(o("sources.import_remote.url_invalid")),s(!1))},[l,s,i,o]),b=y.useCallback(_=>{const N=_.target.value;l(N),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>v(N),500)},[l,v]),j=y.useCallback(_=>{_.preventDefault();const N=_.clipboardData.getData("text").trim();h.current&&clearTimeout(h.current),v(N)},[v]);return y.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),y.useEffect(()=>{n&&v(n)},[]),f.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:f.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[f.jsx("input",{type:"text",value:n,onChange:b,onPaste:j,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}),f.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:u?f.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[f.jsx(Ul,{size:14,className:"shrink-0"}),u]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{children:p.length>0?f.jsxs(f.Fragment,{children:[o("sources.import_remote.url_hint_public"),p.map((_,N)=>f.jsxs("span",{children:[N>0&&"、",f.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:_})]},_))]}):o("sources.import_remote.url_hint_no_auth")}),f.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:o("sources.import_remote.url_hint_format")})]})})]})})}const Bg=["prepare","clone","scan","save"],oo={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"};function Y_(n,l,s){if(n instanceof Ol){const i=n.message.toLowerCase();if(n.status===503)return s("sources.import_remote.error.capacity");if(i.includes("connect")||i.includes("connectionrefused")||i.includes("unavailable")||i.includes("econnrefused"))return s("sources.import_remote.error.network");if(i.includes("authentication")||i.includes("token")||i.includes("credential")||i.includes("401")||i.includes("403"))try{const o=new URL(l).hostname;return s("sources.import_remote.error.auth_required",{host:o})}catch{return s("sources.import_remote.error.auth_required",{host:l})}return i.includes("not found")||i.includes("404")||i.includes("does not exist")?s("sources.import_remote.error.not_found"):n.message||s("sources.import_remote.error.network")}return n instanceof TypeError&&n.message.includes("fetch")?s("sources.import_remote.error.network"):n instanceof Error?n.message:s("sources.import_remote.error.network")}function G_(n){return n==="cloning"?"clone":n==="detecting"||n==="extracting"?"scan":n==="saving"?"save":n}function V_(){const{t:n}=Te(),l=An(),{libId:s}=qs(),[i]=jo(),o=i.get("url")||"",u=i.get("ref")||"",m=i.get("sourceUuid")||"",p=i.get("parentId")||"",g=i.get("parentPath")||"",v=Wt(Hl(Mr)).find(me=>me.id===s),[b,j]=y.useState(new Set),_=y.useCallback(async()=>{if(s)try{const me=await St.get("/sources",{library_id:s}),Ue=new Set;for(const Ze of me.items)Ue.add(Ze.name.toLowerCase());j(Ue)}catch{}},[s]);y.useEffect(()=>{_()},[_]);const[N,z]=y.useState(o?2:1),[O,X]=y.useState(o),[Q,Y]=y.useState(!!o),[G,K]=y.useState(u),[ne,Z]=y.useState(""),[E,$]=y.useState(!!u),[W,de]=y.useState(""),ie=y.useRef(void 0),re=y.useRef(void 0),[ue,xe]=y.useState(null),[A,ee]=y.useState(!1),[ce,P]=y.useState(null),[Se,w]=y.useState(!1),[B,F]=y.useState(!1),[le,pe]=y.useState(null),[Ne,we]=y.useState(null),[ut,Be]=y.useState(null),[xa,bt]=y.useState(null),[at,Ie]=y.useState([]),[_t,jt]=y.useState(null),[oa,zt]=y.useState([]),Oa=y.useRef(null),ya=y.useRef(""),Da=y.useMemo(()=>Bg.map(me=>({key:me,label:oo[me]?n(oo[me]):me})),[n]),Vt=y.useCallback(me=>{zt(Ue=>[...Ue,`[${Jx()}] ${me}`])},[]),na=y.useRef(null),ba=y.useCallback(me=>{const Ue=na.current;Ue&&Ue!==me&&(Ie(Ze=>Ze.includes(Ue)?Ze:[...Ze,Ue]),Vt(`${n(oo[Ue]??Ue)} ${n("sources.import.stage.done_suffix")}`)),Vt(`${n(oo[me]??me)}...`),na.current=me,bt(me),jt(null)},[Vt,n]),Nt=y.useCallback((me,Ue)=>{ie.current=me,re.current=Ue},[]),ye=y.useCallback(async me=>{if(s){ee(!0),P(null);try{const Ue=await St.post("/import/remote/refs",{library_id:s,url:O},me?{signal:me}:void 0);xe(Ue);const Ze=Ue.branches??[],Zt=Ue.tags??[],te=[...Ze,...Zt];te.length>0&&K(fe=>{if(fe)return fe;const Ye=ie.current,Je=re.current;if(Ye){const Ma=te.find(Za=>Za.name===Ye);if(Ma)return Z(Ma.commit),Ma.name}Je&&Z(Je);const la=Ze.find(Ma=>Ma.name===Ue.default)??Ze[0];return la?(Je||Z(la.commit),la.name):fe})}catch(Ue){if(me?.aborted)return;P(Y_(Ue,O,n))}finally{me?.aborted||ee(!1)}}},[s,O,n]);y.useEffect(()=>{if(N!==2||!s)return;const me=new AbortController;return ye(me.signal),()=>me.abort()},[N,s,ye]),y.useEffect(()=>Se?en.on("task/progress",Ue=>{const Ze=Ue,Zt=G_(Ze.stage??"");Zt&&Bg.includes(Zt)&&jt({percent:Ze.percent??-1,label:Ze.label??""})}):void 0,[Se]);const Oe=y.useCallback(async()=>{if(s){w(!0),F(!1),we(null),Be(null),Ie([]),na.current=null,bt(null),jt(null),zt([]),z(3);try{ba("prepare"),await new Promise(Je=>setTimeout(Je,300)),ba("clone");const me=il(O),Ue=W||me,Ze=await St.post("/import/remote/clone",{library_id:s,url:O,ref:G,...ne?{commit:ne}:{},repo_name:me});ya.current=Ze.commit_hash,ba("scan");const Zt=await St.post("/import/remote/scan",{library_id:s,path:Ze.path,hash:Ze.commit_hash});ba("save");const te=await St.post("/import/remote/import",{library_id:s,url:O,ref:G,commit:Ze.commit_hash,repo_name:me,dir_name:Ue,repo_files:Zt.files.map(Je=>Je.path),repo_file_contents:Zt.manifests,...m?{source_uuid:m}:{},...p?{parent_source_id:p,parent_path:g}:{}});Ie(["prepare","clone","scan","save"]),na.current=null,bt(null),Vt(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),Vt(n("sources.import.stage.complete"));const{packages:fe,mdFiles:Ye}=Fx(Zt.manifests,Zt.files,me);pe({packages:fe,mdFiles:Ye}),F(!0),w(!1),Oa.current=te.id,z(4)}catch(me){const Ue=na.current??"prepare";Be(Ue),na.current=null,bt(null);let Ze;me instanceof Ol||me instanceof Error?Ze=me.message:Ze=String(me),Vt(`ERROR: ${Ze}`),we(Ze),w(!1)}}},[s,O,G,ne,W,m,p,g,ba,Vt]),Qe=y.useCallback(()=>{Be(null),we(null),Oe()},[Oe]),$t=y.useCallback(()=>{if(s)if(p){const me=il(O),Ue=W||me,Ze=g?`${g}/${Ue}`:Ue;l(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(Ze)}`)}else Oa.current?l(`/studio/sources/${s}?rootId=${Oa.current}`):l(`/studio/sources/${s}`)},[s,l,p,g,W,O]),Ot=(W||il(O)).toLowerCase(),ht=b.has(Ot),ca=y.useMemo(()=>N===1?Q:N===2?E&&!ht:!1,[N,Q,E,ht]),mn=y.useMemo(()=>{if(!v)return[];const me=[{label:v.id===ul?n("sources.library.default_cloud_name"):v.name,to:`/studio/sources/${v.id}`}];if(p&&g){const Ue=g.split("/").filter(Boolean);for(const[Ze,Zt]of Ue.entries()){const te=Ue.slice(0,Ze+1).join("/");me.push({label:Zt,to:`/studio/sources/${v.id}?rootId=${p}&path=${encodeURIComponent(te)}`})}}return me.push({label:n("sources.import_remote.title")}),me},[v,p,g,n]);if(!v)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Qt=N===4&&B,qt=N===3&&!!ut&&!Se,wt=N<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:mn})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(dn,{active:N>=1,current:N===1}),f.jsx("span",{className:N===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Dl,{}),f.jsx(dn,{active:N>=2,current:N===2}),f.jsx("span",{className:N===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Dl,{}),f.jsx(dn,{active:N>=3,current:N===3}),f.jsx("span",{className:N===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import_remote.step.loading")}),f.jsx(Dl,{}),f.jsx(dn,{active:N>=4,current:N===4}),f.jsx("span",{className:N===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[N===1&&f.jsx(q_,{url:O,onUrlChange:X,onValidChange:Y,onRefHint:Nt}),N===2&&s&&f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[f.jsx(ey,{refs:ue,loading:A,error:ce,selectedRef:G,commit:ne,onRefChange:K,onCommitChange:Z,onValidChange:$,onRetry:()=>ye()}),!A&&ue&&f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:n("sources.import.dir_name")}),f.jsx("input",{type:"text",value:W,onChange:me=>de(me.target.value),placeholder:il(O),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 ${ht?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),ht?f.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:n("sources.import.dir_name_duplicate")}):f.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:n("sources.import.dir_name_hint")})]})]}),N===3&&f.jsx(ty,{stages:Da,currentStage:xa,completedStages:at,failedStage:ut,progress:_t,failedError:Ne,logs:oa}),N===4&&f.jsx(ay,{repoName:il(O),repoIdentifier:O,branch:G,commit:ya.current,packages:le?.packages??[],mdFiles:le?.mdFiles??[],importing:!1,completed:B})]}),Qt?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:$t,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.back_to_library")})}):qt?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{z(2),Be(null),we(null),Ie([]),na.current=null,bt(null),zt([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("sources.import_remote.back")}),f.jsx("button",{onClick:Qe,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.retry")})]}):wt?f.jsx(Rd,{step:N,totalSteps:2,importing:!1,stepBusy:A,canProceed:ca,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>z(me=>me-1),onNext:()=>z(me=>me+1),onImport:Oe}):null]})}function K_(){const{t:n}=Te(),l=An(),s=Wt(j=>j.createLibrary),[i,o]=y.useState("waiting"),[u,m]=y.useState(null),[p,g]=y.useState(""),[h,v]=y.useState(!1);y.useEffect(()=>en.on("ws:daemon:connected",_=>{const N=_;m(N),g(N.machine_id),o(N.needs_registration?"new_client":"reconnected")}),[]),y.useEffect(()=>{let j=!1;return(async()=>{try{const _=await St.get("/daemons/pending");if(j||_.pending.length===0)return;const N=_.pending[0];m({machine_id:N.machine_id,needs_registration:!0}),g(N.machine_id),o("new_client")}catch{}})(),()=>{j=!0}},[]);const b=y.useCallback(async()=>{if(u){v(!0);try{const j=await s({type:"daemon",name:p||u.machine_id,config:{machine_id:u.machine_id,os:u.os||"",daemon_version:u.daemon_version||""}});l(`/studio/sources/${j.id}`)}catch{v(!1)}}},[u,p,s,l]);return f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Ar,{segments:[{label:n("sources.add_client.title")}]}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),f.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:f.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:["npm install -g @c4a/daemon ",f.jsx($g,{text:"npm install -g @c4a/daemon"})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",n("sources.add_client.step2")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host}`," ",f.jsx($g,{text:`c4a-daemon --server ${window.location.host}`})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),f.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[i==="waiting"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Ta,{size:16,className:"animate-spin text-c4a-warning"}),f.jsx("span",{className:"text-sm text-c4a-warning",children:n("sources.add_client.waiting")})]}),i==="new_client"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:n("sources.add_client.detected")}),f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsx(ad,{label:n("sources.add_client.machine_name"),value:u.machine_id}),u.os&&f.jsx(ad,{label:n("sources.add_client.os"),value:u.os}),u.daemon_version&&f.jsx(ad,{label:n("sources.add_client.daemon_version"),value:u.daemon_version})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),f.jsx("input",{value:p,onChange:j=>g(j.target.value),className:"min-w-0 flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-2 py-1 font-mono text-xs text-c4a-text-primary outline-none focus:border-c4a-accent"})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx("button",{onClick:()=>l("/studio/sources"),className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("common.cancel")}),f.jsxs("button",{onClick: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&&f.jsx(Ta,{size:12,className:"animate-spin"}),n("sources.add_client.confirm")]})]})]}),i==="reconnected"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Al,{size:16,className:"text-c4a-success"}),f.jsx("span",{className:"text-sm text-c4a-text-primary",children:n("sources.add_client.reconnected",{name:u.machine_id})})]}),u.lib_id&&f.jsx(ga,{to:`/studio/sources/${u.lib_id}`,className:"inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.add_client.go_to",{name:u.machine_id})})]})]})]})}function $g({text:n}){const[l,s]=y.useState(!1),i=y.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[n]);return f.jsx("button",{type:"button",onClick:i,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:l?f.jsx(Al,{size:13}):f.jsx(dd,{size:13})})}function ad({label:n,value:l}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:l})]})}function X_(){const{t:n}=Te(),{sourceUuid:l}=qs(),[s]=jo(),i=s.get("path")||"",{currentRoot:o,loading:u,fetchRootSource:m}=Co(),p=Wt(Hl(Mr)),[g,h]=y.useState("original");y.useEffect(()=>{l&&m(l)},[l,m]);const v=y.useMemo(()=>o?i?Eo(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(Y=>Y.id===o?.library_id),j=v?.metadata,_=j?Object.fromEntries(Object.entries(j).map(([Y,G])=>[Y,String(G??"")])):null,N=v?.source_type==="code",z=v?.name??o?.name??"",O=v?.source_type??null,X=y.useMemo(()=>{if(!o||!b)return[];const Y=o.kind==="source"&&!i,G=[{label:b.id===ul?n("sources.library.default_cloud_name"):b.name,to:`/studio/sources/${b.id}`},{label:o.name,...Y?{}:{to:`/studio/sources/${b.id}?rootId=${o.id}`}}];if(i){const K=Vx(o.tree,i);for(let ne=0;ne<K.length-1;ne++){const Z=K[ne];G.push({label:Z.name,to:`/studio/sources/${b.id}?rootId=${o.id}&path=${encodeURIComponent(Z.path)}`})}K.length>0&&G.push({label:K[K.length-1].name})}return G},[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 u||!o||!v?f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}):f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Ar,{segments:X}),f.jsxs("div",{className:"mt-4 flex flex-wrap items-baseline gap-x-6 gap-y-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[N?f.jsx(zr,{size:20,className:"shrink-0 text-c4a-accent"}):f.jsx(cl,{size:20,className:"shrink-0 text-c4a-accent"}),f.jsx("h1",{className:"min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:z})]}),f.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[f.jsxs("span",{children:[n("sources.detail.type"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(O==="code"?"sources.type.code":"sources.type.doc")})]}),N&&_?.relative_path&&f.jsxs("span",{children:[n("sources.detail.path"),":"," ",f.jsx("span",{className:"font-mono text-c4a-text-secondary",children:_.relative_path})]}),!N&&f.jsxs("span",{children:[n("sources.detail.origin"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:b?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),f.jsxs("span",{children:[n("sources.detail.status"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${v.index_status??"none"}`)})]})]})]}),N&&_&&f.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[_.repo_name&&f.jsx(co,{label:n("sources.detail.repo"),value:_.repo_name}),_.pinned_branch&&f.jsx(co,{label:n("sources.detail.branch"),value:_.pinned_branch}),_.pinned_hash&&f.jsx(co,{label:n("sources.detail.commit"),value:_.pinned_hash.slice(0,7)}),_.tech_stack&&f.jsx(co,{label:n("sources.detail.tech_stack"),value:_.tech_stack})]})}),f.jsx("div",{className:"mt-3 flex border-b border-c4a-border-subtle",children:Q.map(Y=>f.jsx("button",{onClick:()=>h(Y.key),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${g===Y.key?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:Y.label},Y.key))}),f.jsxs("div",{className:"mt-4 flex-1",children:[g==="original"&&f.jsx(Q_,{node:v,isCode:N}),g==="digest"&&f.jsx(qg,{message:n("sources.detail.digest_placeholder")}),g==="modeling"&&f.jsx(qg,{message:n("sources.detail.modeling_placeholder")})]})]})}function co({label:n,value:l}){return f.jsxs("div",{children:[f.jsx("span",{className:"text-c4a-text-muted",children:n}),f.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:l})]})}function Q_({node:n,isCode:l}){const{t:s}=Te(),i=n.metadata;return l?f.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!i?.description&&f.jsx("p",{children:String(i.description)}),!!i?.dependencies&&f.jsxs("div",{children:[f.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:s("sources.detail.dependencies")}),f.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(i.dependencies).map(([o,u])=>f.jsxs("div",{className:"flex justify-between py-0.5",children:[f.jsx("span",{className:"text-c4a-text-primary",children:o}),f.jsx("span",{className:"text-c4a-text-muted",children:u})]},o))})]}),!i?.description&&!i?.dependencies&&f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_code_placeholder")})]}):f.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_doc_placeholder")})})}function qg({message:n}){return f.jsx("div",{className:"flex items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:f.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:n})})}const Z_=B4([{element:f.jsx(L2,{}),errorElement:f.jsx(Dg,{}),children:[{path:"/",element:f.jsx(q2,{})},{path:"/login",element:f.jsx(Y2,{})},{path:"/docs",element:f.jsx(G2,{})}]},{path:"/studio",element:f.jsx($2,{}),errorElement:f.jsx(Dg,{}),children:[{index:!0,element:f.jsx(yg,{to:"/studio/sources",replace:!0})},{path:"sources",element:f.jsx(yg,{to:`/studio/sources/${ul}`,replace:!0})},{path:"sources/add-client",element:f.jsx(K_,{})},{path:"sources/import/:libId",element:f.jsx(A_,{})},{path:"sources/import-dir/:libId",element:f.jsx(B_,{})},{path:"sources/import-remote/:libId",element:f.jsx(V_,{})},{path:"sources/:libId",element:f.jsx(N_,{})},{path:"source/:sourceUuid",element:f.jsx(X_,{})},{path:"modeling",element:f.jsx(K2,{})},{path:"modeling/code/setup",element:f.jsx(P2,{})},{path:"modeling/code/compile",element:f.jsx(I2,{})},{path:"modeling/code/review",element:f.jsx(W2,{})},{path:"modeling/code/result",element:f.jsx(e_,{})},{path:"brain",element:f.jsx(X2,{})},{path:"discovery",element:f.jsx(Q2,{})},{path:"sharing",element:f.jsx(Z2,{})},{path:"collaboration",element:f.jsx(F2,{})},{path:"settings",element:f.jsx(J2,{})}]},{path:"*",element:f.jsx(V2,{})}]);function F_(){return y.useEffect(()=>{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return en.connect(l),()=>{en.disconnect()}},[]),f.jsx(d4,{router:Z_})}E0.createRoot(document.getElementById("root")).render(f.jsx(y.StrictMode,{children:f.jsx(F_,{})}));
|