@c4a/server-cli 0.4.12-alpha.3 → 0.4.12-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4021 -1105
- package/package.json +2 -1
- package/serve.js +8449 -2018
- package/web/assets/ContentCard-D0mL7yOO.js +1 -0
- package/web/assets/ContentCard-_I22pq8z.js +1 -0
- package/web/assets/ContentDetail-BlCJjlr2.js +65 -0
- package/web/assets/ContentDetail-BtrIxG3F.js +1 -0
- package/web/assets/ContentDetail-DVIbcpNs.js +65 -0
- package/web/assets/EntityDetail-BBLfJ9LL.js +3 -0
- package/web/assets/EntityDetail-CHe5PkO9.js +1 -0
- package/web/assets/EntityDetail-CQNu3A3D.js +3 -0
- package/web/assets/JsonTree-BRUca2ED.js +1 -0
- package/web/assets/JsonTree-Dd_iNoWA.js +1 -0
- package/web/assets/RelationDetail-BoTv8wr4.js +1 -0
- package/web/assets/RelationDetail-CZwj9HUp.js +1 -0
- package/web/assets/RelationDetail-CkBj9cCj.js +1 -0
- package/web/assets/andromeeda-C4gqWexZ.js +1 -0
- package/web/assets/angular-html-DA-rfuFy.js +1 -0
- package/web/assets/angular-ts-BrjP3tb8.js +1 -0
- package/web/assets/astro-HNnZUWAn.js +1 -0
- package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/web/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/web/assets/ayu-light-BA47KaF1.js +1 -0
- package/web/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/web/assets/blade-BjGOyj-B.js +1 -0
- package/web/assets/c-BIGW1oBm.js +1 -0
- package/web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/web/assets/coffee-Ch7k5sss.js +1 -0
- package/web/assets/cpp-CofmeUqb.js +1 -0
- package/web/assets/css-CLj8gQPS.js +1 -0
- package/web/assets/csv-fuZLfV_i.js +1 -0
- package/web/assets/dark-plus-C3mMm8J8.js +1 -0
- package/web/assets/dracula-BzJJZx-M.js +1 -0
- package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/web/assets/everforest-light-C8M2exoo.js +1 -0
- package/web/assets/github-dark-DHJKELXO.js +1 -0
- package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/web/assets/github-light-DAi9KRSo.js +1 -0
- package/web/assets/github-light-default-D7oLnXFd.js +1 -0
- package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/web/assets/glsl-DplSGwfg.js +1 -0
- package/web/assets/graphql-ChdNCCLP.js +1 -0
- package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/web/assets/haml-D5jkg6IW.js +1 -0
- package/web/assets/handlebars-BpdQsYii.js +1 -0
- package/web/assets/horizon-BUw7H-hv.js +1 -0
- package/web/assets/horizon-bright-CUuTKBJd.js +1 -0
- package/web/assets/houston-DnULxvSX.js +1 -0
- package/web/assets/html-derivative-DlHx6ybY.js +1 -0
- package/web/assets/html-pp8916En.js +1 -0
- package/web/assets/http-jrhK8wxY.js +1 -0
- package/web/assets/hurl-irOxFIW8.js +1 -0
- package/web/assets/imba-DGztddWO.js +1 -0
- package/web/assets/index-B1KeXpYL.css +1 -0
- package/web/assets/index-B1zrTc3w.js +12 -0
- package/web/assets/index-B6uGMtfP.css +1 -0
- package/web/assets/index-BCzQnf3x.css +1 -0
- package/web/assets/index-BLskFmu3.js +193 -0
- package/web/assets/index-BMVKFQ7h.js +238 -0
- package/web/assets/index-BRwgHwhm.js +12 -0
- package/web/assets/index-BU6YkKWq.css +1 -0
- package/web/assets/index-BXaK4HKi.js +12 -0
- package/web/assets/index-BaBWjAP7.css +1 -0
- package/web/assets/index-Be3yvSxB.js +12 -0
- package/web/assets/index-Bh0nrxkS.css +1 -0
- package/web/assets/index-BjM7CFih.js +12 -0
- package/web/assets/index-BoqItESG.js +13 -0
- package/web/assets/index-Bxkj7nBM.css +1 -0
- package/web/assets/index-ByCT34eF.css +1 -0
- package/web/assets/index-C1tbhKrB.css +1 -0
- package/web/assets/index-C6uqUNjs.js +238 -0
- package/web/assets/index-CU-x3HVJ.js +12 -0
- package/web/assets/index-CVcqJsfJ.js +12 -0
- package/web/assets/index-Cs1wjzzB.css +1 -0
- package/web/assets/index-D0FYwi5D.css +1 -0
- package/web/assets/index-D9pKIRoL.js +12 -0
- package/web/assets/index-DHMM5gmZ.js +12 -0
- package/web/assets/index-DMIK6qP9.js +12 -0
- package/web/assets/index-DW-afpe4.js +12 -0
- package/web/assets/index-DaUMALOp.css +1 -0
- package/web/assets/index-DfXQnmId.js +12 -0
- package/web/assets/index-DisDw0E0.css +1 -0
- package/web/assets/index-Dm-_KwmC.css +1 -0
- package/web/assets/index-DmRvWfJA.js +12 -0
- package/web/assets/index-Drfhm6bu.js +12 -0
- package/web/assets/index-DvnO8hAI.js +12 -0
- package/web/assets/index-JdgClnFG.css +1 -0
- package/web/assets/index-P648JtKx.js +12 -0
- package/web/assets/index-PGORoGGx.js +13 -0
- package/web/assets/index-ZtrM6iGG.js +12 -0
- package/web/assets/java-CylS5w8V.js +1 -0
- package/web/assets/javascript-wDzz0qaB.js +1 -0
- package/web/assets/jinja-f2NsQr07.js +1 -0
- package/web/assets/jison-wvAkD_A8.js +1 -0
- package/web/assets/json-Cp-IABpG.js +1 -0
- package/web/assets/json5-C9tS-k6U.js +1 -0
- package/web/assets/jsonc-Des-eS-w.js +1 -0
- package/web/assets/jsonl-DcaNXYhu.js +1 -0
- package/web/assets/jsx-g9-lgVsj.js +1 -0
- package/web/assets/julia-CxzCAyBv.js +1 -0
- package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/web/assets/laserwave-DUszq2jm.js +1 -0
- package/web/assets/less-B1dDrJ26.js +1 -0
- package/web/assets/light-plus-B7mTdjB0.js +1 -0
- package/web/assets/markdown-Cvjx9yec.js +1 -0
- package/web/assets/marko-DjSrsDqO.js +1 -0
- package/web/assets/material-theme-D5KoaKCx.js +1 -0
- package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/web/assets/mdc-DTYItulj.js +1 -0
- package/web/assets/mdx-Cmh6b_Ma.js +1 -0
- package/web/assets/min-dark-CafNBF8u.js +1 -0
- package/web/assets/min-light-CTRr51gU.js +1 -0
- package/web/assets/monokai-D4h5O-jR.js +1 -0
- package/web/assets/night-owl-C39BiMTA.js +1 -0
- package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/web/assets/nord-Ddv68eIx.js +1 -0
- package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/web/assets/one-light-C3Wv6jpd.js +1 -0
- package/web/assets/php-R6g_5hLQ.js +1 -0
- package/web/assets/plastic-3e1v2bzS.js +1 -0
- package/web/assets/poimandres-CS3Unz2-.js +1 -0
- package/web/assets/postcss-CXtECtnM.js +1 -0
- package/web/assets/pug-DKIMFp6K.js +1 -0
- package/web/assets/python-B6aJPvgy.js +1 -0
- package/web/assets/r-Dspwwk_N.js +1 -0
- package/web/assets/red-bN70gL4F.js +1 -0
- package/web/assets/regexp-CDVJQ6XC.js +1 -0
- package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/web/assets/sass-Cj5Yp3dK.js +1 -0
- package/web/assets/scss-D5BDwBP9.js +1 -0
- package/web/assets/shellscript-Yzrsuije.js +1 -0
- package/web/assets/slack-dark-BthQWCQV.js +1 -0
- package/web/assets/slack-ochin-DqwNpetd.js +1 -0
- package/web/assets/snazzy-light-Bw305WKR.js +1 -0
- package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/web/assets/solarized-light-L9t79GZl.js +1 -0
- package/web/assets/sql-BLtJtn59.js +1 -0
- package/web/assets/stylus-BEDo0Tqx.js +1 -0
- package/web/assets/svelte-Cy7k_4gC.js +1 -0
- package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/web/assets/tokyo-night-hegEt444.js +1 -0
- package/web/assets/ts-tags-DQrlYJgV.js +1 -0
- package/web/assets/tsx-COt5Ahok.js +1 -0
- package/web/assets/typescript-BPQ3VLAy.js +1 -0
- package/web/assets/vesper-DU1UobuO.js +1 -0
- package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/web/assets/vue-D2xRrEX4.js +1 -0
- package/web/assets/vue-html-AaS7Mt5G.js +1 -0
- package/web/assets/vue-vine-BoDAl6tE.js +1 -0
- package/web/assets/wasm-CG6Dc4jp.js +1 -0
- package/web/assets/wasm-MzD3tlZU.js +1 -0
- package/web/assets/wgsl-Dx-B1_4e.js +1 -0
- package/web/assets/wit-5i3qLPDT.js +1 -0
- package/web/assets/xml-sdJ4AIDG.js +1 -0
- package/web/assets/yaml-Buea-lGh.js +1 -0
- package/web/index.html +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function I0(n,l){for(var s=0;s<l.length;s++){const i=l[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(n,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=s(o);fetch(o.href,u)}})();function ev(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zu={exports:{}},xs={};var up;function tv(){if(up)return xs;up=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 xs.Fragment=l,xs.jsx=s,xs.jsxs=s,xs}var dp;function av(){return dp||(dp=1,zu.exports=tv()),zu.exports}var f=av();const Oe=n=>typeof n=="string",ys=()=>{let n,l;const s=new Promise((i,o)=>{n=i,l=o});return s.resolve=n,s.reject=l,s},fp=n=>n==null?"":""+n,nv=(n,l,s)=>{n.forEach(i=>{l[i]&&(s[i]=l[i])})},lv=/###/g,mp=n=>n&&n.indexOf("###")>-1?n.replace(lv,"."):n,hp=n=>!n||Oe(n),ws=(n,l,s)=>{const i=Oe(l)?l.split("."):l;let o=0;for(;o<i.length-1;){if(hp(n))return{};const u=mp(i[o]);!n[u]&&s&&(n[u]=new s),Object.prototype.hasOwnProperty.call(n,u)?n=n[u]:n={},++o}return hp(n)?{}:{obj:n,k:mp(i[o])}},pp=(n,l,s)=>{const{obj:i,k:o}=ws(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=ws(n,m,Object);for(;p.obj===void 0&&m.length;)u=`${m[m.length-1]}.${u}`,m=m.slice(0,m.length-1),p=ws(n,m,Object),p?.obj&&typeof p.obj[`${p.k}.${u}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${u}`]=s},rv=(n,l,s,i)=>{const{obj:o,k:u}=ws(n,l,Object);o[u]=o[u]||[],o[u].push(s)},co=(n,l)=>{const{obj:s,k:i}=ws(n,l);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},sv=(n,l,s)=>{const i=co(n,s);return i!==void 0?i:co(l,s)},Ug=(n,l,s)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in n?Oe(n[i])||n[i]instanceof String||Oe(l[i])||l[i]instanceof String?s&&(n[i]=l[i]):Ug(n[i],l[i],s):n[i]=l[i]);return n},wl=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var iv={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ov=n=>Oe(n)?n.replace(/[&<>"'\/]/g,l=>iv[l]):n;class cv{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 uv=[" ",",","?","!",";"],dv=new cv(20),fv=(n,l,s)=>{l=l||"",s=s||"";const i=uv.filter(m=>l.indexOf(m)<0&&s.indexOf(m)<0);if(i.length===0)return!0;const o=dv.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},Ju=(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},Rs=n=>n?.replace("_","-"),mv={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 uo{constructor(l,s={}){this.init(l,s)}init(l,s={}){this.prefix=s.prefix||"i18next:",this.logger=l||mv,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:(Oe(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[s](l))}create(l){return new uo(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new uo(this.logger,l)}}var en=new uo;class po{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 gp extends po{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):Oe(i)&&u?p.push(...i.split(u)):p.push(i)));const g=co(this.data,p);return!g&&!s&&!i&&l.indexOf(".")>-1&&(l=p[0],s=p[1],i=p.slice(2).join(".")),g||!m||!Oe(i)?g:Ju(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),pp(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)(Oe(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=co(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?Ug(g,i,u):g={...g,...i},pp(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 Hg={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 Bg=Symbol("i18next/PATH_KEY");function hv(){const n=[],l=Object.create(null);let s;return l.get=(i,o)=>(s?.revoke?.(),o===Bg?n:(n.push(o),s=Proxy.revocable(i,l),s.proxy)),Proxy.revocable(Object.create(null),l).proxy}function Pu(n,l){const{[Bg]:s}=n(hv());return s.join(l?.keySeparator??".")}const xp={},Tu=n=>!Oe(n)&&typeof n!="boolean"&&typeof n!="number";class fo extends po{constructor(l,s={}){super(),nv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=en.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=Tu(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&&!fv(l,i,o);if(m&&!p){const g=l.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:l,namespaces:Oe(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:Oe(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=Pu(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 b=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const y=o.lng||this.language,_=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(y?.toLowerCase()==="cimode")return _?u?{res:`${h}${b}${p}`,usedKey:p,exactUsedKey:p,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:`${h}${b}${p}`:u?{res:p,usedKey:p,exactUsedKey:p,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:p;const j=this.resolve(l,o);let N=j?.res;const T=j?.usedKey||p,k=j?.exactUsedKey||p,X=["[object Number]","[object Function]","[object RegExp]"],F=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,G=!this.i18nFormat||this.i18nFormat.handleAsObject,J=o.count!==void 0&&!Oe(o.count),V=fo.hasDefaultValue(o),I=J?this.pluralResolver.getSuffix(y,o.count,o):"",$=o.ordinal&&J?this.pluralResolver.getSuffix(y,o.count,{ordinal:!1}):"",w=J&&!o.ordinal&&o.count===0,A=w&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${I}`]||o[`defaultValue${$}`]||o.defaultValue;let Q=N;G&&!N&&V&&(Q=A);const ue=Tu(Q),se=Object.prototype.toString.apply(Q);if(G&&Q&&ue&&X.indexOf(se)<0&&!(Oe(F)&&Array.isArray(Q))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const xe=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,Q,{...o,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return u?(j.res=xe,j.usedParams=this.getUsedParamsDetails(o),j):xe}if(m){const xe=Array.isArray(Q),ae=xe?[]:{},ie=xe?k:T;for(const M in Q)if(Object.prototype.hasOwnProperty.call(Q,M)){const P=`${ie}${m}${M}`;V&&!N?ae[M]=this.translate(P,{...o,defaultValue:Tu(A)?A[M]:void 0,joinArrays:!1,ns:g}):ae[M]=this.translate(P,{...o,joinArrays:!1,ns:g}),ae[M]===P&&(ae[M]=Q[M])}N=ae}}else if(G&&Oe(F)&&Array.isArray(N))N=N.join(F),N&&(N=this.extendTranslation(N,l,o,i));else{let xe=!1,ae=!1;!this.isValidLookup(N)&&V&&(xe=!0,N=A),this.isValidLookup(N)||(ae=!0,N=p);const M=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ae?void 0:N,P=V&&A!==N&&this.options.updateMissing;if(ae||xe||P){if(this.logger.log(P?"updateKey":"missingKey",y,h,p,P?A:N),m){const E=this.resolve(p,{...o,keySeparator:!1});E&&E.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 de=[];const ce=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ce&&ce[0])for(let E=0;E<ce.length;E++)de.push(ce[E]);else this.options.saveMissingTo==="all"?de=this.languageUtils.toResolveHierarchy(o.lng||this.language):de.push(o.lng||this.language);const Re=(E,q,ee)=>{const ne=V&&ee!==N?ee:M;this.options.missingKeyHandler?this.options.missingKeyHandler(E,h,q,ne,P,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(E,h,q,ne,P,o),this.emit("missingKey",E,h,q,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&J?de.forEach(E=>{const q=this.pluralResolver.getSuffixes(E,o);w&&o[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(ee=>{Re([E],p+ee,o[`defaultValue${ee}`]||A)})}):Re(de,p,A))}N=this.extendTranslation(N,l,o,j,i),ae&&N===p&&this.options.appendNamespaceToMissingKey&&(N=`${h}${b}${p}`),(ae||xe)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${b}${p}`:p,xe?N:void 0,o))}return u?(j.res=N,j.usedParams=this.getUsedParamsDetails(o),j):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=Oe(l)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const y=l.match(this.interpolator.nestingRegexp);h=y&&y.length}let b=i.replace&&!Oe(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),l=this.interpolator.interpolate(l,b,i.lng||this.language||o.usedLng,i),g){const y=l.match(this.interpolator.nestingRegexp),_=y&&y.length;h<_&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...y)=>u?.[0]===y[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${s[0]}`),null):this.translate(...y,s),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=Oe(m)?[m]:m;return l!=null&&p?.length&&i.applyPostProcessor!==!1&&(l=Hg.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 Oe(l)&&(l=[l]),l.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,s),b=h.key;o=b;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const _=s.count!==void 0&&!Oe(s.count),j=_&&!s.ordinal&&s.count===0,N=s.context!==void 0&&(Oe(s.context)||typeof s.context=="number")&&s.context!=="",T=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);y.forEach(k=>{this.isValidLookup(i)||(p=k,!xp[`${T[0]}-${k}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(xp[`${T[0]}-${k}`]=!0,this.logger.warn(`key "${o}" for languages "${T.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!!!")),T.forEach(X=>{if(this.isValidLookup(i))return;m=X;const F=[b];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(F,b,X,k,s);else{let J;_&&(J=this.pluralResolver.getSuffix(X,s.count,s));const V=`${this.options.pluralSeparator}zero`,I=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(s.ordinal&&J.indexOf(I)===0&&F.push(b+J.replace(I,this.options.pluralSeparator)),F.push(b+J),j&&F.push(b+V)),N){const $=`${b}${this.options.contextSeparator||"_"}${s.context}`;F.push($),_&&(s.ordinal&&J.indexOf(I)===0&&F.push($+J.replace(I,this.options.pluralSeparator)),F.push($+J),j&&F.push($+V))}}let G;for(;G=F.pop();)this.isValidLookup(i)||(u=G,i=this.getResource(X,k,G,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&&!Oe(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 yp{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=en.create("languageUtils")}getScriptPartFromCode(l){if(l=Rs(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=Rs(l),!l||l.indexOf("-")<0)return l;const s=l.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(l){if(Oe(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)),Oe(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 Oe(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))):Oe(l)&&u(this.formatLanguageCode(l)),i.forEach(m=>{o.indexOf(m)<0&&u(this.formatLanguageCode(m))}),o}}const vp={zero:0,one:1,two:2,few:3,many:4,other:5},bp={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class pv{constructor(l,s={}){this.languageUtils=l,this.options=s,this.logger=en.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(l,s={}){const i=Rs(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!"),bp;if(!l.match(/-|_/))return bp;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)=>vp[o]-vp[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 Sp=(n,l,s,i=".",o=!0)=>{let u=sv(n,l,s);return!u&&o&&Oe(s)&&(u=Ju(n,s,i),u===void 0&&(u=Ju(l,s,i))),u},Ou=n=>n.replace(/\$/g,"$$$$");class _p{constructor(l={}){this.logger=en.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:b,unescapePrefix:y,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:N,nestingSuffixEscaped:T,nestingOptionsSeparator:k,maxReplaces:X,alwaysFormat:F}=l.interpolation;this.escape=s!==void 0?s:ov,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?wl(u):m||"{{",this.suffix=p?wl(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=b?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=_?wl(_):j||wl("$t("),this.nestingSuffix=N?wl(N):T||wl(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=X||1e3,this.alwaysFormat=F!==void 0?F:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(s,i)=>s?.source===i?(s.lastIndex=0,s):new RegExp(i,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,s,i,o){let u,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=j=>{if(j.indexOf(this.formatSeparator)<0){const X=Sp(s,g,j,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(X,void 0,i,{...o,...s,interpolationkey:j}):X}const N=j.split(this.formatSeparator),T=N.shift().trim(),k=N.join(this.formatSeparator).trim();return this.format(Sp(s,g,T,this.options.keySeparator,this.options.ignoreJSONStructure),k,i,{...o,...s,interpolationkey:T})};this.resetRegExp();const b=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,y=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:j=>Ou(j)},{regex:this.regexp,safeValue:j=>this.escapeValue?Ou(this.escape(j)):Ou(j)}].forEach(j=>{for(p=0;u=j.regex.exec(l);){const N=u[1].trim();if(m=h(N),m===void 0)if(typeof b=="function"){const k=b(l,u,o);m=Oe(k)?k:""}else if(o&&Object.prototype.hasOwnProperty.call(o,N))m="";else if(y){m=u[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${l}`),m="";else!Oe(m)&&!this.useRawValueToEscape&&(m=fp(m));const T=j.safeValue(m);if(l=l.replace(u[0],T),y?(j.regex.lastIndex+=m.length,j.regex.lastIndex-=u[0].length):j.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),l}nest(l,s,i={}){let o,u,m;const p=(g,h)=>{const b=this.nestingOptionsSeparator;if(g.indexOf(b)<0)return g;const y=g.split(new RegExp(`${wl(b)}[ ]*{`));let _=`{${y[1]}`;g=y[0],_=this.interpolate(_,m);const j=_.match(/'/g),N=_.match(/"/g);((j?.length??0)%2===0&&!N||(N?.length??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{m=JSON.parse(_),h&&(m={...h,...m})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${b}${_}`}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&&!Oe(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(b=>b.trim()).filter(Boolean),o[1]=o[1].slice(0,h)),u=s(p.call(this,o[1].trim(),m),m),u&&o[0]===l&&!Oe(u))return u;Oe(u)||(u=fp(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${l}`),u=""),g.length&&(u=g.reduce((b,y)=>this.format(b,y,i.lng,{...i,interpolationkey:o[1].trim()}),u.trim())),l=l.replace(o[0],u),this.regexp.lastIndex=0}return l}}const gv=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,""),b=p.trim();s[b]||(s[b]=h),h==="false"&&(s[b]=!1),h==="true"&&(s[b]=!0),isNaN(h)||(s[b]=parseInt(h,10))}})}return{formatName:l,formatOptions:s}},jp=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(Rs(i),o),l[m]=p),p(s)}},xv=n=>(l,s,i)=>n(Rs(s),i)(l);class yv{constructor(l={}){this.logger=en.create("formatter"),this.options=l,this.init(l)}init(l,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?jp:xv;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()]=jp(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:b}=gv(g);if(this.formats[h]){let y=p;try{const _=o?.formatParams?.[o.interpolationkey]||{},j=_.locale||_.lng||o.locale||o.lng||i;y=this.formats[h](p,j,{...b,...o,..._})}catch(_){this.logger.warn(_)}return y}else this.logger.warn(`there was no format function for ${h}`);return p},l)}}const vv=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class bv extends po{constructor(l,s,i,o={}){super(),this.backend=l,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=en.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 b=!0;s.forEach(y=>{const _=`${h}|${y}`;!i.reload&&this.store.hasResourceBundle(h,y)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?m[_]===void 0&&(m[_]=!0):(this.state[_]=1,b=!1,m[_]===void 0&&(m[_]=!0),u[_]===void 0&&(u[_]=!0),g[y]===void 0&&(g[y]=!0)))}),b||(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=>{rv(g.loaded,[u],m),vv(g,l),s&&g.errors.push(s),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const b=g.loaded[h];b.length&&b.forEach(y=>{p[h][y]===void 0&&(p[h][y]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(l,s,i,o=0,u=this.retryTimeout,m){if(!l.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:s,fcName:i,tried:o,wait:u,callback:m});return}this.readingCalls++;const p=(h,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&b&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,l,s,i,o+1,u*2,m)},u);return}m(h,b)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(l,s);h&&typeof h.then=="function"?h.then(b=>p(null,b)).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();Oe(l)&&(l=this.languageUtils.toResolveHierarchy(l)),Oe(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 b;h.length===5?b=h(l,s,i,o,g):b=h(l,s,i,o),b&&typeof b.then=="function"?b.then(y=>p(null,y)).catch(p):p(null,b)}catch(b){p(b)}else h(l,s,i,o,p,g)}!l||!l[0]||this.store.addResource(l[0],s,i,o)}}}const Du=()=>({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]),Oe(n[1])&&(l.defaultValue=n[1]),Oe(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}),Np=n=>(Oe(n.ns)&&(n.ns=[n.ns]),Oe(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Oe(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),eo=()=>{},Sv=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},qg="__i18next_supportNoticeShown",_v=()=>typeof globalThis<"u"&&!!globalThis[qg],jv=()=>{typeof globalThis<"u"&&(globalThis[qg]=!0)},Nv=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 Es extends po{constructor(l={},s){if(super(),this.options=Np(l),this.services={},this.logger=en,this.modules={external:[]},Sv(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&&(Oe(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=Du();this.options={...i,...this.options,...Np(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&&!Nv(this)&&!_v()&&(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 💙"),jv());const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?en.init(o(this.modules.logger),this.options):en.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=yv;const b=new yp(this.options);this.store=new gp(this.options.resources,this.options);const y=this.services;y.logger=en,y.resourceStore=this.store,y.languageUtils=b,y.pluralResolver=new pv(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(y.formatter=o(h),y.formatter.init&&y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new _p(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new bv(o(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.languageDetector&&(y.languageDetector=o(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=o(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new fo(this.services,this.options),this.translator.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.external.forEach(j=>{j.init&&j.init(this)})}if(this.format=this.options.interpolation.format,s||(s=eo),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]=(...b)=>this.store[h](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...b)=>(this.store[h](...b),this)});const p=ys(),g=()=>{const h=(b,y)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),p.resolve(y),s(b,y)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),p}loadResources(l,s=eo){let i=s;const o=Oe(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=ys();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=eo),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"&&Hg.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=ys();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=Oe(p)?p:p&&p[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(Oe(p)?[p]:p);h&&(this.language||o(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector?.cacheUserLanguage?.(h)),this.loadResources(h,b=>{u(b,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 b;return g.keyPrefix&&Array.isArray(u)?b=u.map(y=>(typeof y=="function"&&(y=Pu(y,{...this.options,...m})),`${g.keyPrefix}${h}${y}`)):(typeof u=="function"&&(u=Pu(u,{...this.options,...m})),b=g.keyPrefix?`${g.keyPrefix}${h}${u}`:u),this.t(b,g)};return Oe(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=ys();return this.options.ns?(Oe(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=ys();Oe(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 yp(Du());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 Es(l,s);return i.createInstance=Es.createInstance,i}cloneInstance(l={},s=eo){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const o={...this.options,...l,isClone:!0},u=new Es(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((b,y)=>(b[y]={...g[h][y]},b),g[h]),g),{});u.store=new gp(p,o),u.services.resourceStore=u.store}if(l.interpolation){const g={...Du().interpolation,...this.options.interpolation,...l.interpolation},h={...o,interpolation:g};u.services.interpolator=new _p(h)}return u.translator=new fo(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 Pt=Es.createInstance();Pt.createInstance;Pt.dir;Pt.init;Pt.loadResources;Pt.reloadResources;Pt.use;Pt.changeLanguage;Pt.getFixedT;Pt.t;Pt.exists;Pt.setDefaultNamespace;Pt.hasLoadedNamespace;Pt.loadNamespaces;Pt.loadLanguages;var Mu={exports:{}},Me={};var wp;function wv(){if(wp)return Me;wp=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"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),_=Symbol.iterator;function j(E){return E===null||typeof E!="object"?null:(E=_&&E[_]||E["@@iterator"],typeof E=="function"?E:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,k={};function X(E,q,ee){this.props=E,this.context=q,this.refs=k,this.updater=ee||N}X.prototype.isReactComponent={},X.prototype.setState=function(E,q){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,q,"setState")},X.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function F(){}F.prototype=X.prototype;function G(E,q,ee){this.props=E,this.context=q,this.refs=k,this.updater=ee||N}var J=G.prototype=new F;J.constructor=G,T(J,X.prototype),J.isPureReactComponent=!0;var V=Array.isArray;function I(){}var $={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function A(E,q,ee){var ne=ee.ref;return{$$typeof:n,type:E,key:q,ref:ne!==void 0?ne:null,props:ee}}function Q(E,q){return A(E.type,q,E.props)}function ue(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function se(E){var q={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(ee){return q[ee]})}var xe=/\/+/g;function ae(E,q){return typeof E=="object"&&E!==null&&E.key!=null?se(""+E.key):q.toString(36)}function ie(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(I,I):(E.status="pending",E.then(function(q){E.status==="pending"&&(E.status="fulfilled",E.value=q)},function(q){E.status==="pending"&&(E.status="rejected",E.reason=q)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function M(E,q,ee,ne,ve){var Se=typeof E;(Se==="undefined"||Se==="boolean")&&(E=null);var ze=!1;if(E===null)ze=!0;else switch(Se){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(E.$$typeof){case n:case l:ze=!0;break;case b:return ze=E._init,M(ze(E._payload),q,ee,ne,ve)}}if(ze)return ve=ve(E),ze=ne===""?"."+ae(E,0):ne,V(ve)?(ee="",ze!=null&&(ee=ze.replace(xe,"$&/")+"/"),M(ve,q,ee,"",function(jt){return jt})):ve!=null&&(ue(ve)&&(ve=Q(ve,ee+(ve.key==null||E&&E.key===ve.key?"":(""+ve.key).replace(xe,"$&/")+"/")+ze)),q.push(ve)),1;ze=0;var it=ne===""?".":ne+":";if(V(E))for(var fe=0;fe<E.length;fe++)ne=E[fe],Se=it+ae(ne,fe),ze+=M(ne,q,ee,Se,ve);else if(fe=j(E),typeof fe=="function")for(E=fe.call(E),fe=0;!(ne=E.next()).done;)ne=ne.value,Se=it+ae(ne,fe++),ze+=M(ne,q,ee,Se,ve);else if(Se==="object"){if(typeof E.then=="function")return M(ie(E),q,ee,ne,ve);throw q=String(E),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ze}function P(E,q,ee){if(E==null)return E;var ne=[],ve=0;return M(E,ne,"","",function(Se){return q.call(ee,Se,ve++)}),ne}function de(E){if(E._status===-1){var q=E._result;q=q(),q.then(function(ee){(E._status===0||E._status===-1)&&(E._status=1,E._result=ee)},function(ee){(E._status===0||E._status===-1)&&(E._status=2,E._result=ee)}),E._status===-1&&(E._status=0,E._result=q)}if(E._status===1)return E._result.default;throw E._result}var ce=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=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(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},Re={map:P,forEach:function(E,q,ee){P(E,function(){q.apply(this,arguments)},ee)},count:function(E){var q=0;return P(E,function(){q++}),q},toArray:function(E){return P(E,function(q){return q})||[]},only:function(E){if(!ue(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Me.Activity=y,Me.Children=Re,Me.Component=X,Me.Fragment=s,Me.Profiler=o,Me.PureComponent=G,Me.StrictMode=i,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Me.__COMPILER_RUNTIME={__proto__:null,c:function(E){return $.H.useMemoCache(E)}},Me.cache=function(E){return function(){return E.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(E,q,ee){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ne=T({},E.props),ve=E.key;if(q!=null)for(Se in q.key!==void 0&&(ve=""+q.key),q)!w.call(q,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&q.ref===void 0||(ne[Se]=q[Se]);var Se=arguments.length-2;if(Se===1)ne.children=ee;else if(1<Se){for(var ze=Array(Se),it=0;it<Se;it++)ze[it]=arguments[it+2];ne.children=ze}return A(E.type,ve,ne)},Me.createContext=function(E){return E={$$typeof:m,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:u,_context:E},E},Me.createElement=function(E,q,ee){var ne,ve={},Se=null;if(q!=null)for(ne in q.key!==void 0&&(Se=""+q.key),q)w.call(q,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(ve[ne]=q[ne]);var ze=arguments.length-2;if(ze===1)ve.children=ee;else if(1<ze){for(var it=Array(ze),fe=0;fe<ze;fe++)it[fe]=arguments[fe+2];ve.children=it}if(E&&E.defaultProps)for(ne in ze=E.defaultProps,ze)ve[ne]===void 0&&(ve[ne]=ze[ne]);return A(E,Se,ve)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(E){return{$$typeof:p,render:E}},Me.isValidElement=ue,Me.lazy=function(E){return{$$typeof:b,_payload:{_status:-1,_result:E},_init:de}},Me.memo=function(E,q){return{$$typeof:h,type:E,compare:q===void 0?null:q}},Me.startTransition=function(E){var q=$.T,ee={};$.T=ee;try{var ne=E(),ve=$.S;ve!==null&&ve(ee,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(I,ce)}catch(Se){ce(Se)}finally{q!==null&&ee.types!==null&&(q.types=ee.types),$.T=q}},Me.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Me.use=function(E){return $.H.use(E)},Me.useActionState=function(E,q,ee){return $.H.useActionState(E,q,ee)},Me.useCallback=function(E,q){return $.H.useCallback(E,q)},Me.useContext=function(E){return $.H.useContext(E)},Me.useDebugValue=function(){},Me.useDeferredValue=function(E,q){return $.H.useDeferredValue(E,q)},Me.useEffect=function(E,q){return $.H.useEffect(E,q)},Me.useEffectEvent=function(E){return $.H.useEffectEvent(E)},Me.useId=function(){return $.H.useId()},Me.useImperativeHandle=function(E,q,ee){return $.H.useImperativeHandle(E,q,ee)},Me.useInsertionEffect=function(E,q){return $.H.useInsertionEffect(E,q)},Me.useLayoutEffect=function(E,q){return $.H.useLayoutEffect(E,q)},Me.useMemo=function(E,q){return $.H.useMemo(E,q)},Me.useOptimistic=function(E,q){return $.H.useOptimistic(E,q)},Me.useReducer=function(E,q,ee){return $.H.useReducer(E,q,ee)},Me.useRef=function(E){return $.H.useRef(E)},Me.useState=function(E){return $.H.useState(E)},Me.useSyncExternalStore=function(E,q,ee){return $.H.useSyncExternalStore(E,q,ee)},Me.useTransition=function(){return $.H.useTransition()},Me.version="19.2.4",Me}var Ep;function go(){return Ep||(Ep=1,Mu.exports=wv()),Mu.exports}var v=go();const jr=ev(v),Ev=I0({__proto__:null,default:jr},[v]),Cv=(n,l,s,i)=>{const o=[s,{code:l,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);Rl(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},Cp={},Yg=(n,l,s,i)=>{Rl(s)&&Cp[s]||(Rl(s)&&(Cp[s]=new Date),Cv(n,l,s,i))},$g=(n,l)=>()=>{if(n.isInitialized)l();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),l()};n.on("initialized",s)}},Wu=(n,l,s)=>{n.loadNamespaces(l,$g(n,s))},Rp=(n,l,s,i)=>{if(Rl(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(l)>-1)return Wu(n,s,i);s.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(l,$g(n,i))},Rv=(n,l,s={})=>!l.languages||!l.languages.length?(Yg(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:s.lng,precheck:(i,o)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),Rl=n=>typeof n=="string",zv=n=>typeof n=="object"&&n!==null,Tv=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ov={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Dv=n=>Ov[n],Mv=n=>n.replace(Tv,Dv);let Iu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Mv,transDefaultProps:void 0};const kv=(n={})=>{Iu={...Iu,...n}},Av=()=>Iu;let Vg;const Lv=n=>{Vg=n},Uv=()=>Vg,Hv={type:"3rdParty",init(n){kv(n.options.react),Lv(n)}},Bv=v.createContext();class qv{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var ku={exports:{}},Au={};var zp;function Yv(){if(zp)return Au;zp=1;var n=go();function l(y,_){return y===_&&(y!==0||1/y===1/_)||y!==y&&_!==_}var s=typeof Object.is=="function"?Object.is:l,i=n.useState,o=n.useEffect,u=n.useLayoutEffect,m=n.useDebugValue;function p(y,_){var j=_(),N=i({inst:{value:j,getSnapshot:_}}),T=N[0].inst,k=N[1];return u(function(){T.value=j,T.getSnapshot=_,g(T)&&k({inst:T})},[y,j,_]),o(function(){return g(T)&&k({inst:T}),y(function(){g(T)&&k({inst:T})})},[y]),m(j),j}function g(y){var _=y.getSnapshot;y=y.value;try{var j=_();return!s(y,j)}catch{return!0}}function h(y,_){return _()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return Au.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:b,Au}var Tp;function $v(){return Tp||(Tp=1,ku.exports=Yv()),ku.exports}var Vv=$v();const Gv=(n,l)=>Rl(l)?l:zv(l)&&Rl(l.defaultValue)?l.defaultValue:Array.isArray(n)?n[n.length-1]:n,Kv={t:Gv,ready:!1},Xv=()=>()=>{},Ee=(n,l={})=>{const{i18n:s}=l,{i18n:i,defaultNS:o}=v.useContext(Bv)||{},u=s||i||Uv();u&&!u.reportNamespaces&&(u.reportNamespaces=new qv),u||Yg(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const m=v.useMemo(()=>({...Av(),...u?.options?.react,...l}),[u,l]),{useSuspense:p,keyPrefix:g}=m,h=o||u?.options?.defaultNS,b=Rl(h)?[h]:h||["translation"],y=v.useMemo(()=>b,b);u?.reportNamespaces?.addUsedNamespaces?.(y);const _=v.useRef(0),j=v.useCallback(A=>{if(!u)return Xv;const{bindI18n:Q,bindI18nStore:ue}=m,se=()=>{_.current+=1,A()};return Q&&u.on(Q,se),ue&&u.store.on(ue,se),()=>{Q&&Q.split(" ").forEach(xe=>u.off(xe,se)),ue&&ue.split(" ").forEach(xe=>u.store.off(xe,se))}},[u,m]),N=v.useRef(),T=v.useCallback(()=>{if(!u)return Kv;const A=!!(u.isInitialized||u.initializedStoreOnce)&&y.every(ie=>Rv(ie,u,m)),Q=l.lng||u.language,ue=_.current,se=N.current;if(se&&se.ready===A&&se.lng===Q&&se.keyPrefix===g&&se.revision===ue)return se;const ae={t:u.getFixedT(Q,m.nsMode==="fallback"?y:y[0],g),ready:A,lng:Q,keyPrefix:g,revision:ue};return N.current=ae,ae},[u,y,g,m,l.lng]),[k,X]=v.useState(0),{t:F,ready:G}=Vv.useSyncExternalStore(j,T,T);v.useEffect(()=>{if(u&&!G&&!p){const A=()=>X(Q=>Q+1);l.lng?Rp(u,l.lng,y,A):Wu(u,y,A)}},[u,l.lng,y,G,p,k]);const J=u||{},V=v.useRef(null),I=v.useRef(),$=A=>{const Q=Object.getOwnPropertyDescriptors(A);Q.__original&&delete Q.__original;const ue=Object.create(Object.getPrototypeOf(A),Q);if(!Object.prototype.hasOwnProperty.call(ue,"__original"))try{Object.defineProperty(ue,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return ue},w=v.useMemo(()=>{const A=J,Q=A?.language;let ue=A;A&&(V.current&&V.current.__original===A?I.current!==Q?(ue=$(A),V.current=ue,I.current=Q):ue=V.current:(ue=$(A),V.current=ue,I.current=Q));const se=[F,ue,G];return se.t=F,se.i18n=ue,se.ready=G,se},[F,J,G,J.resolvedLanguage,J.language,J.languages]);if(u&&p&&!G)throw new Promise(A=>{const Q=()=>A();l.lng?Rp(u,l.lng,y,Q):Wu(u,y,Q)});return w},{slice:Qv,forEach:Zv}=[];function Fv(n){return Zv.call(Qv.call(arguments,1),l=>{if(l)for(const s in l)n[s]===void 0&&(n[s]=l[s])}),n}function Jv(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 Op=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Pv=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(!Op.test(i.domain))throw new TypeError("option domain is invalid");u+=`; Domain=${i.domain}`}if(i.path){if(!Op.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},Dp={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=Pv(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 Wv={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return Dp.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:s,cookieMinutes:i,cookieDomain:o,cookieOptions:u}=l;s&&typeof document<"u"&&Dp.create(s,n,i,o,u)}},Iv={name:"querystring",lookup(n){let{lookupQuerystring:l}=n,s;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const u=i.substring(1).split("&");for(let m=0;m<u.length;m++){const p=u[m].indexOf("=");p>0&&u[m].substring(0,p)===l&&(s=u[m].substring(p+1))}}return s}},eb={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 br=null;const Mp=()=>{if(br!==null)return br;try{if(br=typeof window<"u"&&window.localStorage!==null,!br)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{br=!1}return br};var tb={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&Mp())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:s}=l;s&&Mp()&&window.localStorage.setItem(s,n)}};let Sr=null;const kp=()=>{if(Sr!==null)return Sr;try{if(Sr=typeof window<"u"&&window.sessionStorage!==null,!Sr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Sr=!1}return Sr};var ab={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&kp())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:s}=l;s&&kp()&&window.sessionStorage.setItem(s,n)}},nb={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}},lb={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}},rb={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}},sb={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 Gg=!1;try{document.cookie,Gg=!0}catch{}const Kg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Gg||Kg.splice(1,1);const ib=()=>({order:Kg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Xg{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=Fv(s,this.options||{},ib()),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(Wv),this.addDetector(Iv),this.addDetector(tb),this.addDetector(ab),this.addDetector(nb),this.addDetector(lb),this.addDetector(rb),this.addDetector(sb),this.addDetector(eb)}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&&!Jv(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)}))}}Xg.type="languageDetector";const ob={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub · @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. All rights reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management.","page.docs.title":"Docs","page.docs.description":"Public documentation portal.","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index.","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI — only what stands up to scrutiny gets written to the knowledge graph.","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here — browse, search, analyze, and use it anytime.","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain.","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly.","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains — get notified on updates, no manual transfer needed.","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration.","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling.","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling.","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results.","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph.","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.library.default_cloud_name":"Personal Cloud","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.status.go_index":"Index","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain.","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge.","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Version Selection","sources.import.step.confirm":"Confirm Import","sources.import.daemon_offline":"Client {{name}} is not connected. Please start the local Daemon and connect to the server before importing.","sources.import.view_guide":"View Connection Guide","sources.import.select_root":"Select repository root directory","sources.import.current_path":"Current path","sources.import.not_git":"This directory is not a Git repository. Please select a directory containing .git.","sources.import.branch":"Branch","sources.import.commit":"Commit","sources.import.branch_warning":"Currently based on {{branch}} branch HEAD","sources.import.uncommitted_warning":"Uncommitted changes will not be collected","sources.import.recognized":"Recognized {{packages}} packages and {{docs}} documents","sources.import.no_packages":"No package structure detected. Will be imported as a single-package repository.","sources.import.confirm_heading":"About to import the following repository to {{name}}:","sources.import.packages":"Packages","sources.import.documents":"Documents","sources.import.loading_repo":"Loading repository info...","sources.import.loading_repo_slow":"Large repositories (>10 GB) may take 5–10 seconds...","sources.import.importing":"Importing...","sources.import.error_title":"Import Failed","sources.import.success":"Import complete","sources.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory path…","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Repositories (skipped)","sources.import.dir_git_hint":"Git repositories inside the directory will not be expanded for indexing. Import them separately if needed.","sources.import.dir_scanning":"Scanning directory contents...","sources.import.dir_scan_complete":"Scan complete","sources.import.dir_scan_error":"Failed to scan directory","sources.import.dir_scan_retry":"Retry","sources.import.dir_code_packages":"Code Packages","sources.import.dir_code_packages_tip":"Supported: package.json, pyproject.toml, setup.py, go.mod, Cargo.toml, pom.xml, build.gradle","sources.import.dir_doc_files":"Documents","sources.import.dir_doc_files_tip":"Supported: Markdown (.md)","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"Git repos are skipped. Use 'Import Repository' instead.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown Document","sources.actions.upload_doc":"Document","sources.actions.add":"Add","sources.actions.add_folder":"Folder","sources.actions.add_web":"Web Page","sources.actions.add_feishu":"Feishu Document","sources.actions.import_dir":"Import Directory","sources.actions.import_repo_url":"Import Repository","sources.upgrade.title":"Feature Upgrading","sources.upgrade.description":"This feature will be available in version 0.5.x. Stay tuned.","sources.upload.title":"Upload Documents","sources.upload.drop_hint":"Click to select or drag files here","sources.upload.supported_formats":"Supported: .md, .doc, .docx, .pdf, .ppt, .pptx, .txt (max 5MB each, up to 10 files)","sources.upload.file_too_large":'"{{name}}" exceeds 5MB limit',"sources.upload.too_many_files":"Maximum 10 files allowed, please re-select","sources.upload.unsupported_type":'"{{name}}" is not a supported file type',"sources.upload.uploading":"Uploading...","sources.upload.success":"Uploaded {{count}} documents","sources.upload.selected":"{{count}} files selected","sources.upload.remove":"Remove","sources.import_remote.title":"Import Remote Repository","sources.import_remote.step.url":"URL","sources.import_remote.step.version":"Version","sources.import_remote.step.confirm":"Confirm","sources.import_remote.url_label":"Repository URL","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint":"Supports HTTPS Git repository URLs","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.commit_label":"Commit (optional)","sources.import_remote.commit_hint":"Leave empty to use the latest commit of selected branch","sources.import_remote.loading_refs":"Querying repository branches...","sources.import_remote.summary_repo":"Repository","sources.import_remote.summary_branch":"Branch","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"Preparing environment","sources.import_remote.stage.clone":"Cloning repository","sources.import_remote.stage.scan":"Scanning project","sources.import_remote.stage.save":"Saving sources","sources.import_remote.complete":"Import complete","sources.import_remote.back_to_library":"Back to Sources","sources.import_remote.retry":"Retry","sources.import_remote.back":"Back","sources.import_remote.error.auth_required":"This repository requires authentication. Please configure an access token for {{host}} in Server Settings → Git Tokens.","sources.import_remote.error.auth_failed":"Authentication failed. Please check your Git token configuration.","sources.import_remote.error.not_found":"Repository not found or no access. Please check the URL.","sources.import_remote.error.network":"Cannot connect to the remote repository. Please check your network or try again later.","sources.import_remote.error.capacity":"Import queue is full. Please try again later.","sources.import_remote.error.clone_failed":"Clone failed","sources.import_remote.error.scan_failed":"Scan failed","sources.import_remote.error.save_failed":"Save failed","sources.change_detection.has_updates":"Has updates","sources.change_detection.reimport":"Re-import","sources.safety.notice.remote":"The remote repository will be cloned to the server for analysis. Code will not be uploaded to any third-party services."},cb={"nav.home":"首页","nav.studio":"工作台","nav.docs":"文档","nav.login":"登录","nav.logout":"退出登录","header.status.connected":"已连接","header.status.disconnected":"已断开","header.status.reconnecting":"重连中","footer.copyright":"GitHub · @Context4AI {{year}}. 版权所有","footer.copyright_compact":"@Context4AI {{year}}. 版权所有","footer.tagline":"知识工厂","footer.theme.dark":"暗色","footer.theme.light":"亮色","footer.theme.system":"跟随系统","studio.sidebar.sources":"知识索引","studio.sidebar.modeling":"知识建模","studio.sidebar.brain":"知识大脑","studio.sidebar.discovery":"发现知识","studio.sidebar.sharing":"分享知识","studio.sidebar.collaboration":"知识协同","studio.sidebar.settings":"设置","placeholder.coming":"计划在 {{version}} 版本实现","page.login.title":"登录","page.login.description":"身份验证与用户管理。","page.docs.title":"文档","page.docs.description":"公开文档门户。","page.sources.title":"知识索引","page.sources.description":"添加代码仓库、文档等输入材料,让大脑完成初步索引。","page.modeling.title":"知识建模","page.modeling.description":"和 AI 一起对索引内容建模,只有经得起推敲的才写入知识图谱。","page.brain.title":"知识大脑","page.brain.description":"建模完成的全部知识都在这里——浏览、搜索、分析,随时调用。","page.discovery.title":"发现知识","page.discovery.description":"看看别人整理好的知识,发现有用的一键补充到自己的大脑。","page.sharing.title":"分享知识","page.sharing.description":"把大脑中的知识打包输出,让别人和 AI 都能直接使用。","page.collaboration.title":"知识协同","page.collaboration.description":"和其他大脑保持同步,知识更新时自动通知,不用手动搬运。","page.settings.title":"设置","page.settings.description":"管理大脑的成员和配置。","page.code_setup.title":"代码设置","page.code_setup.description":"代码建模的仓库选择与配置。","page.code_compile.title":"代码编译","page.code_compile.description":"代码建模的编译进度追踪。","page.code_review.title":"代码审查","page.code_review.description":"审查并确认建模结果。","page.code_result.title":"代码结果","page.code_result.description":"查看最终建模结果与生成的知识图谱。","home.hero.title":"Context For AI","home.hero.description":"将代码仓库和业务文档转化为结构化知识图谱。","home.hero.cta.studio":"进入工作台","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"您访问的页面不存在。","notfound.back":"返回首页","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.library.default_cloud_name":"个人云","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"有新变更未更新索引","sources.status.go_index":"去索引","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础。","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识。","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"版本选择","sources.import.step.confirm":"确认导入","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.loading_repo":"正在加载仓库信息...","sources.import.loading_repo_slow":"大型仓库(>10 GB)可能需要 5~10 秒...","sources.import.importing":"导入中...","sources.import.error_title":"导入失败","sources.import.success":"导入完成","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step3":"等待连接","sources.add_client.step3_desc":"连接成功后,本页面将自动更新。","sources.add_client.waiting":"等待新的客户端连接...","sources.add_client.detected":"检测到新的本地客户端","sources.add_client.machine_name":"机器标识","sources.add_client.os":"操作系统","sources.add_client.daemon_version":"Daemon 版本","sources.add_client.client_name":"客户端名称","sources.add_client.confirm":"确认添加","sources.add_client.reconnected":"客户端 {{name}} 已重新连接","sources.add_client.go_to":"前往 {{name}}","sources.detail.tab.original":"原文","sources.detail.tab.overview":"概览","sources.detail.tab.digest":"摘要","sources.detail.tab.modeling":"建模结果","sources.detail.digest_placeholder":"完成索引后,即可在此查看结构化摘要。","sources.detail.modeling_placeholder":"在推演区完成建模后,此处将展示由该源产生的知识实体。","sources.detail.type":"类型","sources.detail.origin":"来源","sources.detail.origin.upload":"直接上传","sources.detail.origin.local":"本地文件","sources.detail.path":"路径","sources.detail.status":"状态","sources.detail.repo":"仓库","sources.detail.branch":"分支","sources.detail.commit":"提交","sources.detail.tech_stack":"技术栈","sources.detail.original_code_placeholder":"完成索引后即可查看包概览。","sources.detail.original_doc_placeholder":"文档内容将在上传后展示。","sources.detail.dependencies":"依赖","sources.delete.confirm_title":"确认删除","sources.delete.resource":"确定要删除 {{name}}?","sources.delete.resource_impact":"以下数据将被永久删除:原文内容、结构化摘要(如有)。","sources.delete.session_warning":"如果你的个人推演区正在使用此知识源,相关的候选推演将受到影响。","sources.delete.entity_safe":"已汇入大脑的正式知识不受影响。","sources.delete.folder":"确定要删除文件夹 {{name}}?","sources.delete.folder_impact":"文件夹内的所有资源将被递归删除:{{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_contents":"包含 {{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","sources.delete.repo_contents":"包含 {{packages}} 个包、{{docs}} 个文档。","sources.delete.indexed_hint":"其中 {{indexed}}/{{total}} 个已建立索引,索引数据将被删除。","sources.delete.repo_impact_generic":"所有包和文档的索引记录将被删除。","sources.delete.local_safe":"本地文件不受影响。","sources.delete.client":"确定要删除客户端 {{name}}?","sources.delete.client_impact":"该客户端下的所有已导入仓库记录和相关索引数据将被删除。","sources.delete.client_reregister":"该客户端下次连接时将触发重新注册。","sources.error.name_conflict":'该目录下已存在同名项"{{name}}"。',"sources.move.current":"当前位置","sources.move.target":"移动到","sources.breadcrumb.sources":"知识索引","common.cancel":"取消","common.confirm":"确认","common.back":"返回","common.next":"下一步","common.previous":"上一步","common.items":"{{count}} 项","common.loading":"加载中...","sources.import.no_entries":"未找到任何条目","sources.import.allowed_dirs":"客户端授权目录","sources.import.allowed_dirs_tooltip_restrict":"通过参数设定有权限的目录:","sources.import.allowed_dirs_tooltip_all":"或默认允许全部目录:","sources.import.wildcard_home":"主目录","sources.import.wildcard_path_placeholder":"输入目录路径…","sources.import.wildcard_go":"前往","sources.import.wildcard_goto":"前往","sources.import.wildcard_go_title":"前往目录","sources.import.wildcard_path_not_found":"该路径在远程机器上不存在","sources.import.already_imported":"已导入","sources.import.dir_title":"导入目录","sources.import.dir_step.select":"选择目录","sources.import.dir_step.scan":"扫描","sources.import.dir_step.confirm":"确认导入","sources.import.dir_confirm_heading":"即将导入以下目录到 {{name}}:","sources.import.dir_name":"目录名","sources.import.dir_path":"目录路径","sources.import.dir_files":"文件数","sources.import.dir_subdirs":"子目录数","sources.import.dir_git_repos":"仓库(已跳过)","sources.import.dir_git_hint":"目录内的 Git 仓库不会被展开索引,如需索引请单独导入仓库。","sources.import.dir_scanning":"正在扫描目录内容...","sources.import.dir_scan_complete":"扫描完成","sources.import.dir_scan_error":"目录扫描失败","sources.import.dir_scan_retry":"重试","sources.import.dir_code_packages":"代码包","sources.import.dir_code_packages_tip":"支持:package.json、pyproject.toml、setup.py、go.mod、Cargo.toml、pom.xml、build.gradle","sources.import.dir_doc_files":"文档","sources.import.dir_doc_files_tip":"支持:Markdown (.md)","sources.import.dir_total_files":"文件总数","sources.import.dir_total_dirs":"目录","sources.import.dir_git_skip_hint":"Git 仓库将被跳过,建议单独使用「导入仓库」。","sources.actions.upload":"上传","sources.actions.upload_md":"Markdown 文档","sources.actions.upload_doc":"文档","sources.actions.add":"新增","sources.actions.add_folder":"文件夹","sources.actions.add_web":"网页","sources.actions.add_feishu":"飞书文档","sources.actions.import_dir":"导入目录","sources.actions.import_repo_url":"导入仓库","sources.upgrade.title":"功能升级中","sources.upgrade.description":"此功能将在 0.5.x 版本中推出,敬请期待。","sources.upload.title":"上传文档","sources.upload.drop_hint":"点击选择文件或拖拽至此","sources.upload.supported_formats":"支持格式:.md, .doc, .docx, .pdf, .ppt, .pptx, .txt(每个最大 5MB,最多 10 个)","sources.upload.file_too_large":'"{{name}}" 超过 5MB 限制',"sources.upload.too_many_files":"最多上传 10 个文件,请重新选择","sources.upload.unsupported_type":'"{{name}}" 不是支持的文件类型',"sources.upload.uploading":"上传中...","sources.upload.success":"已上传 {{count}} 个文档","sources.upload.selected":"已选择 {{count}} 个文件","sources.upload.remove":"移除","sources.import_remote.title":"导入远程仓库","sources.import_remote.step.url":"URL","sources.import_remote.step.version":"版本","sources.import_remote.step.confirm":"确认","sources.import_remote.url_label":"仓库地址","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint":"支持 HTTPS 格式的 Git 仓库地址","sources.import_remote.url_invalid":"仅支持 HTTPS 格式的 Git URL","sources.import_remote.ref_label":"分支 / 标签","sources.import_remote.ref_branches":"分支","sources.import_remote.ref_tags":"标签","sources.import_remote.commit_label":"Commit (可选)","sources.import_remote.commit_hint":"留空则使用所选分支的最新 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":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。"};Pt.use(Xg).use(Hv).init({resources:{en:{translation:ob},zh:{translation:cb}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Lu={exports:{}},vs={},Uu={exports:{}},Hu={};var Ap;function ub(){return Ap||(Ap=1,(function(n){function l(M,P){var de=M.length;M.push(P);e:for(;0<de;){var ce=de-1>>>1,Re=M[ce];if(0<o(Re,P))M[ce]=P,M[de]=Re,de=ce;else break e}}function s(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var P=M[0],de=M.pop();if(de!==P){M[0]=de;e:for(var ce=0,Re=M.length,E=Re>>>1;ce<E;){var q=2*(ce+1)-1,ee=M[q],ne=q+1,ve=M[ne];if(0>o(ee,de))ne<Re&&0>o(ve,ee)?(M[ce]=ve,M[ne]=de,ce=ne):(M[ce]=ee,M[q]=de,ce=q);else if(ne<Re&&0>o(ve,de))M[ce]=ve,M[ne]=de,ce=ne;else break e}}return P}function o(M,P){var de=M.sortIndex-P.sortIndex;return de!==0?de:M.id-P.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=[],b=1,y=null,_=3,j=!1,N=!1,T=!1,k=!1,X=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function J(M){for(var P=s(h);P!==null;){if(P.callback===null)i(h);else if(P.startTime<=M)i(h),P.sortIndex=P.expirationTime,l(g,P);else break;P=s(h)}}function V(M){if(T=!1,J(M),!N)if(s(g)!==null)N=!0,I||(I=!0,se());else{var P=s(h);P!==null&&ie(V,P.startTime-M)}}var I=!1,$=-1,w=5,A=-1;function Q(){return k?!0:!(n.unstable_now()-A<w)}function ue(){if(k=!1,I){var M=n.unstable_now();A=M;var P=!0;try{e:{N=!1,T&&(T=!1,F($),$=-1),j=!0;var de=_;try{t:{for(J(M),y=s(g);y!==null&&!(y.expirationTime>M&&Q());){var ce=y.callback;if(typeof ce=="function"){y.callback=null,_=y.priorityLevel;var Re=ce(y.expirationTime<=M);if(M=n.unstable_now(),typeof Re=="function"){y.callback=Re,J(M),P=!0;break t}y===s(g)&&i(g),J(M)}else i(g);y=s(g)}if(y!==null)P=!0;else{var E=s(h);E!==null&&ie(V,E.startTime-M),P=!1}}break e}finally{y=null,_=de,j=!1}P=void 0}}finally{P?se():I=!1}}}var se;if(typeof G=="function")se=function(){G(ue)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,ae=xe.port2;xe.port1.onmessage=ue,se=function(){ae.postMessage(null)}}else se=function(){X(ue,0)};function ie(M,P){$=X(function(){M(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<M?Math.floor(1e3/M):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(M){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var de=_;_=P;try{return M()}finally{_=de}},n.unstable_requestPaint=function(){k=!0},n.unstable_runWithPriority=function(M,P){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var de=_;_=M;try{return P()}finally{_=de}},n.unstable_scheduleCallback=function(M,P,de){var ce=n.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?ce+de:ce):de=ce,M){case 1:var Re=-1;break;case 2:Re=250;break;case 5:Re=1073741823;break;case 4:Re=1e4;break;default:Re=5e3}return Re=de+Re,M={id:b++,callback:P,priorityLevel:M,startTime:de,expirationTime:Re,sortIndex:-1},de>ce?(M.sortIndex=de,l(h,M),s(g)===null&&M===s(h)&&(T?(F($),$=-1):T=!0,ie(V,de-ce))):(M.sortIndex=Re,l(g,M),N||j||(N=!0,I||(I=!0,se()))),M},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(M){var P=_;return function(){var de=_;_=P;try{return M.apply(this,arguments)}finally{_=de}}}})(Hu)),Hu}var Lp;function db(){return Lp||(Lp=1,Uu.exports=ub()),Uu.exports}var Bu={exports:{}},Xt={};var Up;function fb(){if(Up)return Xt;Up=1;var n=go();function l(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}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,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:g,containerInfo:h,implementation:b}}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 Xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Xt.createPortal=function(g,h){var b=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,b)},Xt.flushSync=function(g){var h=m.T,b=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=b,i.d.f()}},Xt.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))},Xt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Xt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var b=h.as,y=p(b,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:_,fetchPriority:j}):b==="script"&&i.d.X(g,{crossOrigin:y,integrity:_,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Xt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=p(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:b,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)},Xt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,y=p(b,h.crossOrigin);i.d.L(g,b,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Xt.preloadModule=function(g,h){if(typeof g=="string")if(h){var b=p(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},Xt.requestFormReset=function(g){i.d.r(g)},Xt.unstable_batchedUpdates=function(g,h){return g(h)},Xt.useFormState=function(g,h,b){return m.H.useFormState(g,h,b)},Xt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Xt.version="19.2.4",Xt}var Hp;function mb(){if(Hp)return Bu.exports;Hp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Bu.exports=fb(),Bu.exports}var Bp;function hb(){if(Bp)return vs;Bp=1;var n=db(),l=go(),s=mb();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 b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),G=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=ue&&e[ue]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Symbol.for("react.client.reference");function ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case X:return"Profiler";case k:return"StrictMode";case V:return"Suspense";case I:return"SuspenseList";case A:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case G:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case J:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:ae(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var ie=Array.isArray,M=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},ce=[],Re=-1;function E(e){return{current:e}}function q(e){0>Re||(e.current=ce[Re],ce[Re]=null,Re--)}function ee(e,t){Re++,ce[Re]=e.current,e.current=t}var ne=E(null),ve=E(null),Se=E(null),ze=E(null);function it(e,t){switch(ee(Se,t),ee(ve,e),ee(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Mh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Mh(t),e=kh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ne),ee(ne,e)}function fe(){q(ne),q(ve),q(Se)}function jt(e){e.memoizedState!==null&&ee(ze,e);var t=ne.current,a=kh(t,e.type);t!==a&&(ee(ve,e),ee(ne,a))}function Mt(e){ve.current===e&&(q(ne),q(ve)),ze.current===e&&(q(ze),ms._currentValue=de)}var Te,De;function Xe(e){if(Te===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||"",De=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Te+e+De}var lt=!1;function Wt(e,t){if(!e||lt)return"";lt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(Y){var H=Y}Reflect.construct(e,[],W)}else{try{W.call()}catch(Y){H=Y}e.call(W.prototype)}}else{try{throw Error()}catch(Y){H=Y}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(Y){if(Y&&H&&typeof Y.stack=="string")return[Y.stack,H.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
|
+
`),U=S.split(`
|
|
5
|
+
`);for(c=r=0;r<C.length&&!C[r].includes("DetermineComponentFrameRoot");)r++;for(;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;if(r===C.length||c===U.length)for(r=C.length-1,c=U.length-1;1<=r&&0<=c&&C[r]!==U[c];)c--;for(;1<=r&&0<=c;r--,c--)if(C[r]!==U[c]){if(r!==1||c!==1)do if(r--,c--,0>c||C[r]!==U[c]){var K=`
|
|
6
|
+
`+C[r].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=r&&0<=c);break}}}finally{lt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Xe(a):""}function Gt(e,t){switch(e.tag){case 26:case 27:case 5:return Xe(e.type);case 16:return Xe("Lazy");case 13:return e.child!==t&&t!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return Wt(e.type,!1);case 11:return Wt(e.type.render,!1);case 1:return Wt(e.type,!0);case 31:return Xe("Activity");default:return""}}function Tt(e){try{var t="",a=null;do t+=Gt(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var sa=Object.prototype.hasOwnProperty,ya=n.unstable_scheduleCallback,Ga=n.unstable_cancelCallback,nl=n.unstable_shouldYield,ll=n.unstable_requestPaint,kt=n.unstable_now,Ma=n.unstable_getCurrentPriorityLevel,ka=n.unstable_ImmediatePriority,En=n.unstable_UserBlockingPriority,Ka=n.unstable_NormalPriority,ia=n.unstable_LowPriority,It=n.unstable_IdlePriority,Al=n.log,zr=n.unstable_setDisableYieldValue,Aa=null,Ht=null;function Nt(e){if(typeof Al=="function"&&zr(e),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(Aa,e)}catch{}}var At=Math.clz32?Math.clz32:oe,Ll=Math.log,Ul=Math.LN2;function oe(e){return e>>>=0,e===0?32:31-(Ll(e)/Ul|0)|0}var Ne=256,Pe=262144,ht=4194304;function Qe(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 an(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=Qe(r):(x&=S,x!==0?c=Qe(x):a||(a=S&~e,a!==0&&(c=Qe(a))))):(S=r&~d,S!==0?c=Qe(S):x!==0?c=Qe(x):a||(a=r&~e,a!==0&&(c=Qe(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 rl(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 sl(){var e=ht;return ht<<=1,(ht&62914560)===0&&(ht=4194304),e}function Xa(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Qa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qs(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,U=e.hiddenUpdates;for(a=x&~a;0<a;){var K=31-At(a),W=1<<K;S[K]=0,C[K]=-1;var H=U[K];if(H!==null)for(U[K]=null,K=0;K<H.length;K++){var Y=H[K];Y!==null&&(Y.lane&=-536870913)}a&=~W}r!==0&&Ys(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(x&~t))}function Ys(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-At(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function $s(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-At(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:O(a),(a&(e.suspendedLanes|t))!==0?0:a}function O(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function B(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function te(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:np(e.type))}function le(e,t){var a=P.p;try{return P.p=e,t()}finally{P.p=a}}var pe=Math.random().toString(36).slice(2),re="__reactFiber$"+pe,me="__reactProps$"+pe,he="__reactContainer$"+pe,_e="__reactEvents$"+pe,we="__reactListeners$"+pe,be="__reactHandles$"+pe,Ze="__reactResources$"+pe,He="__reactMarker$"+pe;function rt(e){delete e[re],delete e[me],delete e[_e],delete e[we],delete e[be]}function ct(e){var t=e[re];if(t)return t;for(var a=e.parentNode;a;){if(t=a[he]||a[re]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Yh(e);e!==null;){if(a=e[re])return a;e=Yh(e)}return t}e=a,a=e.parentNode}return null}function pt(e){if(e=e[re]||e[he]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ke(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ot(e){var t=e[Ze];return t||(t=e[Ze]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ot(e){e[He]=!0}var Cn=new Set,Ua={};function Lt(e,t){Za(e,t),Za(e+"Capture",t)}function Za(e,t){for(Ua[e]=t,e=0;e<t.length;e++)Cn.add(t[e])}var il=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]*$"),Fa={},ol={};function Hl(e){return sa.call(ol,e)?!0:sa.call(Fa,e)?!1:il.test(e)?ol[e]=!0:(Fa[e]=!0,!1)}function Be(e,t,a){if(Hl(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function bt(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 Kt(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 wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bl(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){a=""+x,d.call(this,x)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ql(e){if(!e._valueTracker){var t=ut(e)?"checked":"value";e._valueTracker=Bl(e,t,""+e[t])}}function Vs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=ut(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Gs(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 Qx=/[\n"\\]/g;function va(e){return e.replace(Qx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function jo(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=""+wt(t)):e.value!==""+wt(t)&&(e.value=""+wt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?No(e,x,wt(t)):a!=null?No(e,x,wt(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=""+wt(S):e.removeAttribute("name")}function Ed(e,t,a,r,c,d,x,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){ql(e);return}a=a!=null?""+wt(a):"",t=t!=null?""+wt(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=S?e.checked:!!r,e.defaultChecked=!!r,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),ql(e)}function No(e,t,a){t==="number"&&Gs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Yl(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=""+wt(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 Cd(e,t,a){if(t!=null&&(t=""+wt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+wt(a):""}function Rd(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=wt(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),ql(e)}function $l(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Zx=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 zd(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||Zx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Td(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&&zd(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&zd(e,d,t[d])}function wo(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 Fx=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"]]),Jx=/^[\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 Ks(e){return Jx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nn(){}var Eo=null;function Co(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vl=null,Gl=null;function Od(e){var t=pt(e);if(t&&(e=t.stateNode)){var a=e[me]||null;e:switch(e=t.stateNode,t.type){case"input":if(jo(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="'+va(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[me]||null;if(!c)throw Error(i(90));jo(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Vs(r)}break e;case"textarea":Cd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Yl(e,!!a.multiple,t,!1)}}}var Ro=!1;function Dd(e,t,a){if(Ro)return e(t,a);Ro=!0;try{var r=e(t);return r}finally{if(Ro=!1,(Vl!==null||Gl!==null)&&(Di(),Vl&&(t=Vl,e=Gl,Gl=Vl=null,Od(t),e)))for(t=0;t<e.length;t++)Od(e[t])}}function Tr(e,t){var a=e.stateNode;if(a===null)return null;var r=a[me]||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 ln=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zo=!1;if(ln)try{var Or={};Object.defineProperty(Or,"passive",{get:function(){zo=!0}}),window.addEventListener("test",Or,Or),window.removeEventListener("test",Or,Or)}catch{zo=!1}var Rn=null,To=null,Xs=null;function Md(){if(Xs)return Xs;var e,t=To,a=t.length,r,c="value"in Rn?Rn.value:Rn.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 Xs=c.slice(e,1<r?1-r:void 0)}function Qs(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 Zs(){return!0}function kd(){return!1}function ea(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)?Zs:kd,this.isPropagationStopped=kd,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Zs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Zs)},persist:function(){},isPersistent:Zs}),t}var cl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fs=ea(cl),Dr=y({},cl,{view:0,detail:0}),Px=ea(Dr),Oo,Do,Mr,Js=y({},Dr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ko,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!==Mr&&(Mr&&e.type==="mousemove"?(Oo=e.screenX-Mr.screenX,Do=e.screenY-Mr.screenY):Do=Oo=0,Mr=e),Oo)},movementY:function(e){return"movementY"in e?e.movementY:Do}}),Ad=ea(Js),Wx=y({},Js,{dataTransfer:0}),Ix=ea(Wx),ey=y({},Dr,{relatedTarget:0}),Mo=ea(ey),ty=y({},cl,{animationName:0,elapsedTime:0,pseudoElement:0}),ay=ea(ty),ny=y({},cl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ly=ea(ny),ry=y({},cl,{data:0}),Ld=ea(ry),sy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iy={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"},oy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=oy[e])?!!t[e]:!1}function ko(){return cy}var uy=y({},Dr,{key:function(e){if(e.key){var t=sy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Qs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?iy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ko,charCode:function(e){return e.type==="keypress"?Qs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Qs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),dy=ea(uy),fy=y({},Js,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ud=ea(fy),my=y({},Dr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ko}),hy=ea(my),py=y({},cl,{propertyName:0,elapsedTime:0,pseudoElement:0}),gy=ea(py),xy=y({},Js,{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}),yy=ea(xy),vy=y({},cl,{newState:0,oldState:0}),by=ea(vy),Sy=[9,13,27,32],Ao=ln&&"CompositionEvent"in window,kr=null;ln&&"documentMode"in document&&(kr=document.documentMode);var _y=ln&&"TextEvent"in window&&!kr,Hd=ln&&(!Ao||kr&&8<kr&&11>=kr),Bd=" ",qd=!1;function Yd(e,t){switch(e){case"keyup":return Sy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $d(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kl=!1;function jy(e,t){switch(e){case"compositionend":return $d(t);case"keypress":return t.which!==32?null:(qd=!0,Bd);case"textInput":return e=t.data,e===Bd&&qd?null:e;default:return null}}function Ny(e,t){if(Kl)return e==="compositionend"||!Ao&&Yd(e,t)?(e=Md(),Xs=To=Rn=null,Kl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Hd&&t.locale!=="ko"?null:t.data;default:return null}}var wy={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 Vd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wy[e.type]:t==="textarea"}function Gd(e,t,a,r){Vl?Gl?Gl.push(r):Gl=[r]:Vl=r,t=Bi(t,"onChange"),0<t.length&&(a=new Fs("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Ar=null,Lr=null;function Ey(e){Ch(e,0)}function Ps(e){var t=Ke(e);if(Vs(t))return e}function Kd(e,t){if(e==="change")return t}var Xd=!1;if(ln){var Lo;if(ln){var Uo="oninput"in document;if(!Uo){var Qd=document.createElement("div");Qd.setAttribute("oninput","return;"),Uo=typeof Qd.oninput=="function"}Lo=Uo}else Lo=!1;Xd=Lo&&(!document.documentMode||9<document.documentMode)}function Zd(){Ar&&(Ar.detachEvent("onpropertychange",Fd),Lr=Ar=null)}function Fd(e){if(e.propertyName==="value"&&Ps(Lr)){var t=[];Gd(t,Lr,e,Co(e)),Dd(Ey,t)}}function Cy(e,t,a){e==="focusin"?(Zd(),Ar=t,Lr=a,Ar.attachEvent("onpropertychange",Fd)):e==="focusout"&&Zd()}function Ry(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ps(Lr)}function zy(e,t){if(e==="click")return Ps(t)}function Ty(e,t){if(e==="input"||e==="change")return Ps(t)}function Oy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oa=typeof Object.is=="function"?Object.is:Oy;function Ur(e,t){if(oa(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(!sa.call(t,c)||!oa(e[c],t[c]))return!1}return!0}function Jd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pd(e,t){var a=Jd(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=Jd(a)}}function Wd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Id(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gs(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=Gs(e.document)}return t}function Ho(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 Dy=ln&&"documentMode"in document&&11>=document.documentMode,Xl=null,Bo=null,Hr=null,qo=!1;function ef(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;qo||Xl==null||Xl!==Gs(r)||(r=Xl,"selectionStart"in r&&Ho(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}),Hr&&Ur(Hr,r)||(Hr=r,r=Bi(Bo,"onSelect"),0<r.length&&(t=new Fs("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Xl)))}function ul(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ql={animationend:ul("Animation","AnimationEnd"),animationiteration:ul("Animation","AnimationIteration"),animationstart:ul("Animation","AnimationStart"),transitionrun:ul("Transition","TransitionRun"),transitionstart:ul("Transition","TransitionStart"),transitioncancel:ul("Transition","TransitionCancel"),transitionend:ul("Transition","TransitionEnd")},Yo={},tf={};ln&&(tf=document.createElement("div").style,"AnimationEvent"in window||(delete Ql.animationend.animation,delete Ql.animationiteration.animation,delete Ql.animationstart.animation),"TransitionEvent"in window||delete Ql.transitionend.transition);function dl(e){if(Yo[e])return Yo[e];if(!Ql[e])return e;var t=Ql[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in tf)return Yo[e]=t[a];return e}var af=dl("animationend"),nf=dl("animationiteration"),lf=dl("animationstart"),My=dl("transitionrun"),ky=dl("transitionstart"),Ay=dl("transitioncancel"),rf=dl("transitionend"),sf=new Map,$o="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(" ");$o.push("scrollEnd");function Ha(e,t){sf.set(e,t),Lt(t,[e])}var Ws=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)},ba=[],Zl=0,Vo=0;function Is(){for(var e=Zl,t=Vo=Zl=0;t<e;){var a=ba[t];ba[t++]=null;var r=ba[t];ba[t++]=null;var c=ba[t];ba[t++]=null;var d=ba[t];if(ba[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&&of(a,c,d)}}function ei(e,t,a,r){ba[Zl++]=e,ba[Zl++]=t,ba[Zl++]=a,ba[Zl++]=r,Vo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Go(e,t,a,r){return ei(e,t,a,r),ti(e)}function fl(e,t){return ei(e,null,null,t),ti(e)}function of(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-At(a),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),d):null}function ti(e){if(50<ss)throw ss=0,Ic=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Fl={};function Ly(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 ca(e,t,a,r){return new Ly(e,t,a,r)}function Ko(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rn(e,t){var a=e.alternate;return a===null?(a=ca(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 cf(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 ai(e,t,a,r,c,d){var x=0;if(r=e,typeof e=="function")Ko(e)&&(x=1);else if(typeof e=="string")x=Y0(e,a,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case A:return e=ca(31,a,t,c),e.elementType=A,e.lanes=d,e;case T:return ml(a.children,c,d,t);case k:x=8,c|=24;break;case X:return e=ca(12,a,t,c|2),e.elementType=X,e.lanes=d,e;case V:return e=ca(13,a,t,c),e.elementType=V,e.lanes=d,e;case I:return e=ca(19,a,t,c),e.elementType=I,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:x=10;break e;case F:x=9;break e;case J:x=11;break e;case $:x=14;break e;case w:x=16,r=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=ca(x,a,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function ml(e,t,a,r){return e=ca(7,e,r,t),e.lanes=a,e}function Xo(e,t,a){return e=ca(6,e,null,t),e.lanes=a,e}function uf(e){var t=ca(18,null,null,0);return t.stateNode=e,t}function Qo(e,t,a){return t=ca(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var df=new WeakMap;function Sa(e,t){if(typeof e=="object"&&e!==null){var a=df.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Tt(t)},df.set(e,t),t)}return{value:e,source:t,stack:Tt(t)}}var Jl=[],Pl=0,ni=null,Br=0,_a=[],ja=0,zn=null,Ja=1,Pa="";function sn(e,t){Jl[Pl++]=Br,Jl[Pl++]=ni,ni=e,Br=t}function ff(e,t,a){_a[ja++]=Ja,_a[ja++]=Pa,_a[ja++]=zn,zn=e;var r=Ja;e=Pa;var c=32-At(r)-1;r&=~(1<<c),a+=1;var d=32-At(t)+c;if(30<d){var x=c-c%5;d=(r&(1<<x)-1).toString(32),r>>=x,c-=x,Ja=1<<32-At(t)+c|a<<c|r,Pa=d+e}else Ja=1<<d|a<<c|r,Pa=e}function Zo(e){e.return!==null&&(sn(e,1),ff(e,1,0))}function Fo(e){for(;e===ni;)ni=Jl[--Pl],Jl[Pl]=null,Br=Jl[--Pl],Jl[Pl]=null;for(;e===zn;)zn=_a[--ja],_a[ja]=null,Pa=_a[--ja],_a[ja]=null,Ja=_a[--ja],_a[ja]=null}function mf(e,t){_a[ja++]=Ja,_a[ja++]=Pa,_a[ja++]=zn,Ja=t.id,Pa=t.overflow,zn=e}var Bt=null,dt=null,Ge=!1,Tn=null,Na=!1,Jo=Error(i(519));function On(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qr(Sa(t,e)),Jo}function hf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[re]=e,t[me]=r,a){case"dialog":Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":case"embed":Ye("load",t);break;case"video":case"audio":for(a=0;a<os.length;a++)Ye(os[a],t);break;case"source":Ye("error",t);break;case"img":case"image":case"link":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"input":Ye("invalid",t),Ed(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ye("invalid",t);break;case"textarea":Ye("invalid",t),Rd(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||Oh(t.textContent,a)?(r.popover!=null&&(Ye("beforetoggle",t),Ye("toggle",t)),r.onScroll!=null&&Ye("scroll",t),r.onScrollEnd!=null&&Ye("scrollend",t),r.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||On(e,!0)}function pf(e){for(Bt=e.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Na=!1;return;case 27:case 3:Na=!0;return;default:Bt=Bt.return}}function Wl(e){if(e!==Bt)return!1;if(!Ge)return pf(e),Ge=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||hu(e.type,e.memoizedProps)),a=!a),a&&dt&&On(e),pf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));dt=qh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));dt=qh(e)}else t===27?(t=dt,Kn(e.type)?(e=vu,vu=null,dt=e):dt=t):dt=Bt?Ea(e.stateNode.nextSibling):null;return!0}function hl(){dt=Bt=null,Ge=!1}function Po(){var e=Tn;return e!==null&&(la===null?la=e:la.push.apply(la,e),Tn=null),e}function qr(e){Tn===null?Tn=[e]:Tn.push(e)}var Wo=E(null),pl=null,on=null;function Dn(e,t,a){ee(Wo,t._currentValue),t._currentValue=a}function cn(e){e._currentValue=Wo.current,q(Wo)}function Io(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 ec(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),Io(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),Io(x,a,e),x=null}else x=c.child;if(x!==null)x.return=c;else for(x=c;x!==null;){if(x===e){x=null;break}if(c=x.sibling,c!==null){c.return=x.return,x=c;break}x=x.return}c=x}}function Il(e,t,a,r){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var x=c.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var S=c.type;oa(c.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(c===ze.current){if(x=c.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ms):e=[ms])}c=c.return}e!==null&&ec(t,e,a,r),t.flags|=262144}function li(e){for(e=e.firstContext;e!==null;){if(!oa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function gl(e){pl=e,on=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qt(e){return gf(pl,e)}function ri(e,t){return pl===null&&gl(e),gf(e,t)}function gf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},on===null){if(e===null)throw Error(i(308));on=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else on=on.next=t;return a}var Uy=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()})}},Hy=n.unstable_scheduleCallback,By=n.unstable_NormalPriority,Et={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tc(){return{controller:new Uy,data:new Map,refCount:0}}function Yr(e){e.refCount--,e.refCount===0&&Hy(By,function(){e.controller.abort()})}var $r=null,ac=0,er=0,tr=null;function qy(e,t){if($r===null){var a=$r=[];ac=0,er=ru(),tr={status:"pending",value:void 0,then:function(r){a.push(r)}}}return ac++,t.then(xf,xf),t}function xf(){if(--ac===0&&$r!==null){tr!==null&&(tr.status="fulfilled");var e=$r;$r=null,er=0,tr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Yy(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 yf=M.S;M.S=function(e,t){th=kt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&qy(e,t),yf!==null&&yf(e,t)};var xl=E(null);function nc(){var e=xl.current;return e!==null?e:st.pooledCache}function si(e,t){t===null?ee(xl,xl.current):ee(xl,t.pool)}function vf(){var e=nc();return e===null?null:{parent:Et._currentValue,pool:e}}var ar=Error(i(460)),lc=Error(i(474)),ii=Error(i(542)),oi={then:function(){}};function bf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(nn,nn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jf(e),e;default:if(typeof t.status=="string")t.then(nn,nn);else{if(e=st,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,jf(e),e}throw vl=t,ar}}function yl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(vl=a,ar):a}}var vl=null;function _f(){if(vl===null)throw Error(i(459));var e=vl;return vl=null,e}function jf(e){if(e===ar||e===ii)throw Error(i(483))}var nr=null,Vr=0;function ci(e){var t=Vr;return Vr+=1,nr===null&&(nr=[]),Sf(nr,e,t)}function Gr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ui(e,t){throw t.$$typeof===_?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Nf(e){function t(D,z){if(e){var L=D.deletions;L===null?(D.deletions=[z],D.flags|=16):L.push(z)}}function a(D,z){if(!e)return null;for(;z!==null;)t(D,z),z=z.sibling;return null}function r(D){for(var z=new Map;D!==null;)D.key!==null?z.set(D.key,D):z.set(D.index,D),D=D.sibling;return z}function c(D,z){return D=rn(D,z),D.index=0,D.sibling=null,D}function d(D,z,L){return D.index=L,e?(L=D.alternate,L!==null?(L=L.index,L<z?(D.flags|=67108866,z):L):(D.flags|=67108866,z)):(D.flags|=1048576,z)}function x(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function S(D,z,L,Z){return z===null||z.tag!==6?(z=Xo(L,D.mode,Z),z.return=D,z):(z=c(z,L),z.return=D,z)}function C(D,z,L,Z){var je=L.type;return je===T?K(D,z,L.props.children,Z,L.key):z!==null&&(z.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===w&&yl(je)===z.type)?(z=c(z,L.props),Gr(z,L),z.return=D,z):(z=ai(L.type,L.key,L.props,null,D.mode,Z),Gr(z,L),z.return=D,z)}function U(D,z,L,Z){return z===null||z.tag!==4||z.stateNode.containerInfo!==L.containerInfo||z.stateNode.implementation!==L.implementation?(z=Qo(L,D.mode,Z),z.return=D,z):(z=c(z,L.children||[]),z.return=D,z)}function K(D,z,L,Z,je){return z===null||z.tag!==7?(z=ml(L,D.mode,Z,je),z.return=D,z):(z=c(z,L),z.return=D,z)}function W(D,z,L){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Xo(""+z,D.mode,L),z.return=D,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case j:return L=ai(z.type,z.key,z.props,null,D.mode,L),Gr(L,z),L.return=D,L;case N:return z=Qo(z,D.mode,L),z.return=D,z;case w:return z=yl(z),W(D,z,L)}if(ie(z)||se(z))return z=ml(z,D.mode,L,null),z.return=D,z;if(typeof z.then=="function")return W(D,ci(z),L);if(z.$$typeof===G)return W(D,ri(D,z),L);ui(D,z)}return null}function H(D,z,L,Z){var je=z!==null?z.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return je!==null?null:S(D,z,""+L,Z);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case j:return L.key===je?C(D,z,L,Z):null;case N:return L.key===je?U(D,z,L,Z):null;case w:return L=yl(L),H(D,z,L,Z)}if(ie(L)||se(L))return je!==null?null:K(D,z,L,Z,null);if(typeof L.then=="function")return H(D,z,ci(L),Z);if(L.$$typeof===G)return H(D,z,ri(D,L),Z);ui(D,L)}return null}function Y(D,z,L,Z,je){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return D=D.get(L)||null,S(z,D,""+Z,je);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case j:return D=D.get(Z.key===null?L:Z.key)||null,C(z,D,Z,je);case N:return D=D.get(Z.key===null?L:Z.key)||null,U(z,D,Z,je);case w:return Z=yl(Z),Y(D,z,L,Z,je)}if(ie(Z)||se(Z))return D=D.get(L)||null,K(z,D,Z,je,null);if(typeof Z.then=="function")return Y(D,z,L,ci(Z),je);if(Z.$$typeof===G)return Y(D,z,L,ri(z,Z),je);ui(z,Z)}return null}function ge(D,z,L,Z){for(var je=null,Fe=null,ye=z,Le=z=0,Ve=null;ye!==null&&Le<L.length;Le++){ye.index>Le?(Ve=ye,ye=null):Ve=ye.sibling;var Je=H(D,ye,L[Le],Z);if(Je===null){ye===null&&(ye=Ve);break}e&&ye&&Je.alternate===null&&t(D,ye),z=d(Je,z,Le),Fe===null?je=Je:Fe.sibling=Je,Fe=Je,ye=Ve}if(Le===L.length)return a(D,ye),Ge&&sn(D,Le),je;if(ye===null){for(;Le<L.length;Le++)ye=W(D,L[Le],Z),ye!==null&&(z=d(ye,z,Le),Fe===null?je=ye:Fe.sibling=ye,Fe=ye);return Ge&&sn(D,Le),je}for(ye=r(ye);Le<L.length;Le++)Ve=Y(ye,D,Le,L[Le],Z),Ve!==null&&(e&&Ve.alternate!==null&&ye.delete(Ve.key===null?Le:Ve.key),z=d(Ve,z,Le),Fe===null?je=Ve:Fe.sibling=Ve,Fe=Ve);return e&&ye.forEach(function(Jn){return t(D,Jn)}),Ge&&sn(D,Le),je}function Ce(D,z,L,Z){if(L==null)throw Error(i(151));for(var je=null,Fe=null,ye=z,Le=z=0,Ve=null,Je=L.next();ye!==null&&!Je.done;Le++,Je=L.next()){ye.index>Le?(Ve=ye,ye=null):Ve=ye.sibling;var Jn=H(D,ye,Je.value,Z);if(Jn===null){ye===null&&(ye=Ve);break}e&&ye&&Jn.alternate===null&&t(D,ye),z=d(Jn,z,Le),Fe===null?je=Jn:Fe.sibling=Jn,Fe=Jn,ye=Ve}if(Je.done)return a(D,ye),Ge&&sn(D,Le),je;if(ye===null){for(;!Je.done;Le++,Je=L.next())Je=W(D,Je.value,Z),Je!==null&&(z=d(Je,z,Le),Fe===null?je=Je:Fe.sibling=Je,Fe=Je);return Ge&&sn(D,Le),je}for(ye=r(ye);!Je.done;Le++,Je=L.next())Je=Y(ye,D,Le,Je.value,Z),Je!==null&&(e&&Je.alternate!==null&&ye.delete(Je.key===null?Le:Je.key),z=d(Je,z,Le),Fe===null?je=Je:Fe.sibling=Je,Fe=Je);return e&&ye.forEach(function(W0){return t(D,W0)}),Ge&&sn(D,Le),je}function nt(D,z,L,Z){if(typeof L=="object"&&L!==null&&L.type===T&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case j:e:{for(var je=L.key;z!==null;){if(z.key===je){if(je=L.type,je===T){if(z.tag===7){a(D,z.sibling),Z=c(z,L.props.children),Z.return=D,D=Z;break e}}else if(z.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===w&&yl(je)===z.type){a(D,z.sibling),Z=c(z,L.props),Gr(Z,L),Z.return=D,D=Z;break e}a(D,z);break}else t(D,z);z=z.sibling}L.type===T?(Z=ml(L.props.children,D.mode,Z,L.key),Z.return=D,D=Z):(Z=ai(L.type,L.key,L.props,null,D.mode,Z),Gr(Z,L),Z.return=D,D=Z)}return x(D);case N:e:{for(je=L.key;z!==null;){if(z.key===je)if(z.tag===4&&z.stateNode.containerInfo===L.containerInfo&&z.stateNode.implementation===L.implementation){a(D,z.sibling),Z=c(z,L.children||[]),Z.return=D,D=Z;break e}else{a(D,z);break}else t(D,z);z=z.sibling}Z=Qo(L,D.mode,Z),Z.return=D,D=Z}return x(D);case w:return L=yl(L),nt(D,z,L,Z)}if(ie(L))return ge(D,z,L,Z);if(se(L)){if(je=se(L),typeof je!="function")throw Error(i(150));return L=je.call(L),Ce(D,z,L,Z)}if(typeof L.then=="function")return nt(D,z,ci(L),Z);if(L.$$typeof===G)return nt(D,z,ri(D,L),Z);ui(D,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,z!==null&&z.tag===6?(a(D,z.sibling),Z=c(z,L),Z.return=D,D=Z):(a(D,z),Z=Xo(L,D.mode,Z),Z.return=D,D=Z),x(D)):a(D,z)}return function(D,z,L,Z){try{Vr=0;var je=nt(D,z,L,Z);return nr=null,je}catch(ye){if(ye===ar||ye===ii)throw ye;var Fe=ca(29,ye,null,D.mode);return Fe.lanes=Z,Fe.return=D,Fe}}}var bl=Nf(!0),wf=Nf(!1),Mn=!1;function rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sc(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 kn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function An(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(We&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=ti(e),of(e,null,a),t}return ei(e,r,t,a),ti(e)}function Kr(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,$s(e,a)}}function ic(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 oc=!1;function Xr(){if(oc){var e=tr;if(e!==null)throw e}}function Qr(e,t,a,r){oc=!1;var c=e.updateQueue;Mn=!1;var d=c.firstBaseUpdate,x=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var C=S,U=C.next;C.next=null,x===null?d=U:x.next=U,x=C;var K=e.alternate;K!==null&&(K=K.updateQueue,S=K.lastBaseUpdate,S!==x&&(S===null?K.firstBaseUpdate=U:S.next=U,K.lastBaseUpdate=C))}if(d!==null){var W=c.baseState;x=0,K=U=C=null,S=d;do{var H=S.lane&-536870913,Y=H!==S.lane;if(Y?($e&H)===H:(r&H)===H){H!==0&&H===er&&(oc=!0),K!==null&&(K=K.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ge=e,Ce=S;H=t;var nt=a;switch(Ce.tag){case 1:if(ge=Ce.payload,typeof ge=="function"){W=ge.call(nt,W,H);break e}W=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ce.payload,H=typeof ge=="function"?ge.call(nt,W,H):ge,H==null)break e;W=y({},W,H);break e;case 2:Mn=!0}}H=S.callback,H!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=c.callbacks,Y===null?c.callbacks=[H]:Y.push(H))}else Y={lane:H,tag:S.tag,payload:S.payload,callback:S.callback,next:null},K===null?(U=K=Y,C=W):K=K.next=Y,x|=H;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;Y=S,S=Y.next,Y.next=null,c.lastBaseUpdate=Y,c.shared.pending=null}}while(!0);K===null&&(C=W),c.baseState=C,c.firstBaseUpdate=U,c.lastBaseUpdate=K,d===null&&(c.shared.lanes=0),qn|=x,e.lanes=x,e.memoizedState=W}}function Ef(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Cf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Ef(a[e],t)}var lr=E(null),di=E(0);function Rf(e,t){e=yn,ee(di,e),ee(lr,t),yn=e|t.baseLanes}function cc(){ee(di,yn),ee(lr,lr.current)}function uc(){yn=di.current,q(lr),q(di)}var ua=E(null),wa=null;function Ln(e){var t=e.alternate;ee(St,St.current&1),ee(ua,e),wa===null&&(t===null||lr.current!==null||t.memoizedState!==null)&&(wa=e)}function dc(e){ee(St,St.current),ee(ua,e),wa===null&&(wa=e)}function zf(e){e.tag===22?(ee(St,St.current),ee(ua,e),wa===null&&(wa=e)):Un()}function Un(){ee(St,St.current),ee(ua,ua.current)}function da(e){q(ua),wa===e&&(wa=null),q(St)}var St=E(0);function fi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xu(a)||yu(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 un=0,Ae=null,tt=null,Ct=null,mi=!1,rr=!1,Sl=!1,hi=0,Zr=0,sr=null,$y=0;function gt(){throw Error(i(321))}function fc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!oa(e[a],t[a]))return!1;return!0}function mc(e,t,a,r,c,d){return un=d,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?fm:Rc,Sl=!1,d=a(r,c),Sl=!1,rr&&(d=Of(t,a,r,c)),Tf(e),d}function Tf(e){M.H=Pr;var t=tt!==null&&tt.next!==null;if(un=0,Ct=tt=Ae=null,mi=!1,Zr=0,sr=null,t)throw Error(i(300));e===null||Rt||(e=e.dependencies,e!==null&&li(e)&&(Rt=!0))}function Of(e,t,a,r){Ae=e;var c=0;do{if(rr&&(sr=null),Zr=0,rr=!1,25<=c)throw Error(i(301));if(c+=1,Ct=tt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}M.H=mm,d=t(a,r)}while(rr);return d}function Vy(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Fr(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(Ae.flags|=1024),t}function hc(){var e=hi!==0;return hi=0,e}function pc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function gc(e){if(mi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mi=!1}un=0,Ct=tt=Ae=null,rr=!1,Zr=hi=0,sr=null}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Ae.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function _t(){if(tt===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=Ct===null?Ae.memoizedState:Ct.next;if(t!==null)Ct=t,tt=e;else{if(e===null)throw Ae.alternate===null?Error(i(467)):Error(i(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Ct===null?Ae.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function pi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fr(e){var t=Zr;return Zr+=1,sr===null&&(sr=[]),e=Sf(sr,e,t),t=Ae,(Ct===null?t.memoizedState:Ct.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?fm:Rc),e}function gi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Fr(e);if(e.$$typeof===G)return qt(e)}throw Error(i(438,String(e)))}function xc(e){var t=null,a=Ae.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=Ae.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=pi(),Ae.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]=Q;return t.index++,a}function dn(e,t){return typeof t=="function"?t(e):t}function xi(e){var t=_t();return yc(t,tt,e)}function yc(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,U=t,K=!1;do{var W=U.lane&-536870913;if(W!==U.lane?($e&W)===W:(un&W)===W){var H=U.revertLane;if(H===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),W===er&&(K=!0);else if((un&H)===H){U=U.next,H===er&&(K=!0);continue}else W={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},C===null?(S=C=W,x=d):C=C.next=W,Ae.lanes|=H,qn|=H;W=U.action,Sl&&a(d,W),d=U.hasEagerState?U.eagerState:a(d,W)}else H={lane:W,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},C===null?(S=C=H,x=d):C=C.next=H,Ae.lanes|=W,qn|=W;U=U.next}while(U!==null&&U!==t);if(C===null?x=d:C.next=S,!oa(d,e.memoizedState)&&(Rt=!0,K&&(a=tr,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 vc(e){var t=_t(),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);oa(d,t.memoizedState)||(Rt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,r]}function Df(e,t,a){var r=Ae,c=_t(),d=Ge;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!oa((tt||c).memoizedState,a);if(x&&(c.memoizedState=a,Rt=!0),c=c.queue,_c(Af.bind(null,r,c,e),[e]),c.getSnapshot!==t||x||Ct!==null&&Ct.memoizedState.tag&1){if(r.flags|=2048,ir(9,{destroy:void 0},kf.bind(null,r,c,a,t),null),st===null)throw Error(i(349));d||(un&127)!==0||Mf(r,t,a)}return a}function Mf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ae.updateQueue,t===null?(t=pi(),Ae.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function kf(e,t,a,r){t.value=a,t.getSnapshot=r,Lf(t)&&Uf(e)}function Af(e,t,a){return a(function(){Lf(t)&&Uf(e)})}function Lf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!oa(e,a)}catch{return!0}}function Uf(e){var t=fl(e,2);t!==null&&ra(t,e,2)}function bc(e){var t=Ft();if(typeof e=="function"){var a=e;if(e=a(),Sl){Nt(!0);try{a()}finally{Nt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:e},t}function Hf(e,t,a,r){return e.baseState=a,yc(e,tt,typeof r=="function"?r:dn)}function Gy(e,t,a,r,c){if(bi(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){d.listeners.push(x)}};M.T!==null?a(!0):d.isTransition=!1,r(d),a=t.pending,a===null?(d.next=t.pending=d,Bf(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Bf(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=M.T,x={};M.T=x;try{var S=a(c,r),C=M.S;C!==null&&C(x,S),qf(e,t,S)}catch(U){Sc(e,t,U)}finally{d!==null&&x.types!==null&&(d.types=x.types),M.T=d}}else try{d=a(c,r),qf(e,t,d)}catch(U){Sc(e,t,U)}}function qf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Yf(e,t,r)},function(r){return Sc(e,t,r)}):Yf(e,t,a)}function Yf(e,t,a){t.status="fulfilled",t.value=a,$f(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Bf(e,a)))}function Sc(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,$f(t),t=t.next;while(t!==r)}e.action=null}function $f(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Vf(e,t){return t}function Gf(e,t){if(Ge){var a=st.formState;if(a!==null){e:{var r=Ae;if(Ge){if(dt){t:{for(var c=dt,d=Na;c.nodeType!==8;){if(!d){c=null;break t}if(c=Ea(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){dt=Ea(c.nextSibling),r=c.data==="F!";break e}}On(r)}r=!1}r&&(t=a[0])}}return a=Ft(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vf,lastRenderedState:t},a.queue=r,a=cm.bind(null,Ae,r),r.dispatch=a,r=bc(!1),d=Cc.bind(null,Ae,!1,r.queue),r=Ft(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=Gy.bind(null,Ae,c,d,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function Kf(e){var t=_t();return Xf(t,tt,e)}function Xf(e,t,a){if(t=yc(e,t,Vf)[0],e=xi(dn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Fr(t)}catch(x){throw x===ar?ii:x}else r=t;t=_t();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(Ae.flags|=2048,ir(9,{destroy:void 0},Ky.bind(null,c,a),null)),[r,d,e]}function Ky(e,t){e.action=t}function Qf(e){var t=_t(),a=tt;if(a!==null)return Xf(t,a,e);_t(),t=t.memoizedState,a=_t();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function ir(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=pi(),Ae.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 Zf(){return _t().memoizedState}function yi(e,t,a,r){var c=Ft();Ae.flags|=e,c.memoizedState=ir(1|t,{destroy:void 0},a,r===void 0?null:r)}function vi(e,t,a,r){var c=_t();r=r===void 0?null:r;var d=c.memoizedState.inst;tt!==null&&r!==null&&fc(r,tt.memoizedState.deps)?c.memoizedState=ir(t,d,a,r):(Ae.flags|=e,c.memoizedState=ir(1|t,d,a,r))}function Ff(e,t){yi(8390656,8,e,t)}function _c(e,t){vi(2048,8,e,t)}function Xy(e){Ae.flags|=4;var t=Ae.updateQueue;if(t===null)t=pi(),Ae.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Jf(e){var t=_t().memoizedState;return Xy({ref:t,nextImpl:e}),function(){if((We&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Pf(e,t){return vi(4,2,e,t)}function Wf(e,t){return vi(4,4,e,t)}function If(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 em(e,t,a){a=a!=null?a.concat([e]):null,vi(4,4,If.bind(null,t,e),a)}function jc(){}function tm(e,t){var a=_t();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&fc(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function am(e,t){var a=_t();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&fc(t,r[1]))return r[0];if(r=e(),Sl){Nt(!0);try{e()}finally{Nt(!1)}}return a.memoizedState=[r,t],r}function Nc(e,t,a){return a===void 0||(un&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=nh(),Ae.lanes|=e,qn|=e,a)}function nm(e,t,a,r){return oa(a,t)?a:lr.current!==null?(e=Nc(e,a,r),oa(e,t)||(Rt=!0),e):(un&42)===0||(un&1073741824)!==0&&($e&261930)===0?(Rt=!0,e.memoizedState=a):(e=nh(),Ae.lanes|=e,qn|=e,t)}function lm(e,t,a,r,c){var d=P.p;P.p=d!==0&&8>d?d:8;var x=M.T,S={};M.T=S,Cc(e,!1,t,a);try{var C=c(),U=M.S;if(U!==null&&U(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var K=Yy(C,r);Jr(e,t,K,ha(e))}else Jr(e,t,r,ha(e))}catch(W){Jr(e,t,{then:function(){},status:"rejected",reason:W},ha())}finally{P.p=d,x!==null&&S.types!==null&&(x.types=S.types),M.T=x}}function Qy(){}function wc(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=rm(e).queue;lm(e,c,t,de,a===null?Qy:function(){return sm(e),a(r)})}function rm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:de},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sm(e){var t=rm(e);t.next===null&&(t=e.alternate.memoizedState),Jr(e,t.next.queue,{},ha())}function Ec(){return qt(ms)}function im(){return _t().memoizedState}function om(){return _t().memoizedState}function Zy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ha();e=kn(a);var r=An(t,e,a);r!==null&&(ra(r,t,a),Kr(r,t,a)),t={cache:tc()},e.payload=t;return}t=t.return}}function Fy(e,t,a){var r=ha();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},bi(e)?um(t,a):(a=Go(e,t,a,r),a!==null&&(ra(a,e,r),dm(a,t,r)))}function cm(e,t,a){var r=ha();Jr(e,t,a,r)}function Jr(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(bi(e))um(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,oa(S,x))return ei(e,t,c,0),st===null&&Is(),!1}catch{}if(a=Go(e,t,c,r),a!==null)return ra(a,e,r),dm(a,t,r),!0}return!1}function Cc(e,t,a,r){if(r={lane:2,revertLane:ru(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bi(e)){if(t)throw Error(i(479))}else t=Go(e,a,r,2),t!==null&&ra(t,e,2)}function bi(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function um(e,t){rr=mi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function dm(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,$s(e,a)}}var Pr={readContext:qt,use:gi,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Pr.useEffectEvent=gt;var fm={readContext:qt,use:gi,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:Ff,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,yi(4194308,4,If.bind(null,t,e),a)},useLayoutEffect:function(e,t){return yi(4194308,4,e,t)},useInsertionEffect:function(e,t){yi(4,2,e,t)},useMemo:function(e,t){var a=Ft();t=t===void 0?null:t;var r=e();if(Sl){Nt(!0);try{e()}finally{Nt(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ft();if(a!==void 0){var c=a(t);if(Sl){Nt(!0);try{a(t)}finally{Nt(!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=Fy.bind(null,Ae,e),[r.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:function(e){e=bc(e);var t=e.queue,a=cm.bind(null,Ae,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:jc,useDeferredValue:function(e,t){var a=Ft();return Nc(a,e,t)},useTransition:function(){var e=bc(!1);return e=lm.bind(null,Ae,e.queue,!0,!1),Ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=Ae,c=Ft();if(Ge){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),st===null)throw Error(i(349));($e&127)!==0||Mf(r,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Ff(Af.bind(null,r,d,e),[e]),r.flags|=2048,ir(9,{destroy:void 0},kf.bind(null,r,d,a,t),null),a},useId:function(){var e=Ft(),t=st.identifierPrefix;if(Ge){var a=Pa,r=Ja;a=(r&~(1<<32-At(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=hi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=$y++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ec,useFormState:Gf,useActionState:Gf,useOptimistic:function(e){var t=Ft();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Cc.bind(null,Ae,!0,a),a.dispatch=t,[e,t]},useMemoCache:xc,useCacheRefresh:function(){return Ft().memoizedState=Zy.bind(null,Ae)},useEffectEvent:function(e){var t=Ft(),a={impl:e};return t.memoizedState=a,function(){if((We&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Rc={readContext:qt,use:gi,useCallback:tm,useContext:qt,useEffect:_c,useImperativeHandle:em,useInsertionEffect:Pf,useLayoutEffect:Wf,useMemo:am,useReducer:xi,useRef:Zf,useState:function(){return xi(dn)},useDebugValue:jc,useDeferredValue:function(e,t){var a=_t();return nm(a,tt.memoizedState,e,t)},useTransition:function(){var e=xi(dn)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:Fr(e),t]},useSyncExternalStore:Df,useId:im,useHostTransitionStatus:Ec,useFormState:Kf,useActionState:Kf,useOptimistic:function(e,t){var a=_t();return Hf(a,tt,e,t)},useMemoCache:xc,useCacheRefresh:om};Rc.useEffectEvent=Jf;var mm={readContext:qt,use:gi,useCallback:tm,useContext:qt,useEffect:_c,useImperativeHandle:em,useInsertionEffect:Pf,useLayoutEffect:Wf,useMemo:am,useReducer:vc,useRef:Zf,useState:function(){return vc(dn)},useDebugValue:jc,useDeferredValue:function(e,t){var a=_t();return tt===null?Nc(a,e,t):nm(a,tt.memoizedState,e,t)},useTransition:function(){var e=vc(dn)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:Fr(e),t]},useSyncExternalStore:Df,useId:im,useHostTransitionStatus:Ec,useFormState:Qf,useActionState:Qf,useOptimistic:function(e,t){var a=_t();return tt!==null?Hf(a,tt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:xc,useCacheRefresh:om};mm.useEffectEvent=Jf;function zc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Tc={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=ha(),c=kn(r);c.payload=t,a!=null&&(c.callback=a),t=An(e,c,r),t!==null&&(ra(t,e,r),Kr(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=ha(),c=kn(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=An(e,c,r),t!==null&&(ra(t,e,r),Kr(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ha(),r=kn(a);r.tag=2,t!=null&&(r.callback=t),t=An(e,r,a),t!==null&&(ra(t,e,a),Kr(t,e,a))}};function hm(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?!Ur(a,r)||!Ur(c,d):!0}function pm(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&&Tc.enqueueReplaceState(t,t.state,null)}function _l(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function gm(e){Ws(e)}function xm(e){console.error(e)}function ym(e){Ws(e)}function Si(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function vm(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 Oc(e,t,a){return a=kn(a),a.tag=3,a.payload={element:null},a.callback=function(){Si(e,t)},a}function bm(e){return e=kn(e),e.tag=3,e}function Sm(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(){vm(t,a,r)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){vm(t,a,r),typeof c!="function"&&(Yn===null?Yn=new Set([this]):Yn.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function Jy(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&Il(t,a,c,!0),a=ua.current,a!==null){switch(a.tag){case 31:case 13:return wa===null?Mi():a.alternate===null&&xt===0&&(xt=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===oi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),au(e,r,c)),!1;case 22:return a.flags|=65536,r===oi?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)),au(e,r,c)),!1}throw Error(i(435,a.tag))}return au(e,r,c),Mi(),!1}if(Ge)return t=ua.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==Jo&&(e=Error(i(422),{cause:r}),qr(Sa(e,a)))):(r!==Jo&&(t=Error(i(423),{cause:r}),qr(Sa(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=Sa(r,a),c=Oc(e.stateNode,r,c),ic(e,c),xt!==4&&(xt=2)),!1;var d=Error(i(520),{cause:r});if(d=Sa(d,a),rs===null?rs=[d]:rs.push(d),xt!==4&&(xt=2),t===null)return!0;r=Sa(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Oc(a.stateNode,r,e),ic(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"&&(Yn===null||!Yn.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=bm(c),Sm(c,e,a,r),ic(a,c),!1}a=a.return}while(a!==null);return!1}var Dc=Error(i(461)),Rt=!1;function Yt(e,t,a,r){t.child=e===null?wf(t,null,a,r):bl(t,e.child,a,r)}function _m(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 gl(t),r=mc(e,t,a,x,d,c),S=hc(),e!==null&&!Rt?(pc(e,t,c),fn(e,t,c)):(Ge&&S&&Zo(t),t.flags|=1,Yt(e,t,r,c),t.child)}function jm(e,t,a,r,c){if(e===null){var d=a.type;return typeof d=="function"&&!Ko(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Nm(e,t,d,r,c)):(e=ai(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!qc(e,c)){var x=d.memoizedProps;if(a=a.compare,a=a!==null?a:Ur,a(x,r)&&e.ref===t.ref)return fn(e,t,c)}return t.flags|=1,e=rn(d,r),e.ref=t.ref,e.return=t,t.child=e}function Nm(e,t,a,r,c){if(e!==null){var d=e.memoizedProps;if(Ur(d,r)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=r=d,qc(e,c))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,fn(e,t,c)}return Mc(e,t,a,r,c)}function wm(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 Em(e,t,d,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&si(t,d!==null?d.cachePool:null),d!==null?Rf(t,d):cc(),zf(t);else return r=t.lanes=536870912,Em(e,t,d!==null?d.baseLanes|a:a,a,r)}else d!==null?(si(t,d.cachePool),Rf(t,d),Un(),t.memoizedState=null):(e!==null&&si(t,null),cc(),Un());return Yt(e,t,c,a),t.child}function Wr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Em(e,t,a,r,c){var d=nc();return d=d===null?null:{parent:Et._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&si(t,null),cc(),zf(t),e!==null&&Il(e,t,r,!0),t.childLanes=c,null}function _i(e,t){return t=Ni({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Cm(e,t,a){return bl(t,e.child,null,a),e=_i(t,t.pendingProps),e.flags|=2,da(t),t.memoizedState=null,e}function Py(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(r.mode==="hidden")return e=_i(t,r),t.lanes=536870912,Wr(null,e);if(dc(t),(e=dt)?(e=Bh(e,Na),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zn!==null?{id:Ja,overflow:Pa}:null,retryLane:536870912,hydrationErrors:null},a=uf(e),a.return=t,t.child=a,Bt=t,dt=null)):e=null,e===null)throw On(t);return t.lanes=536870912,null}return _i(t,r)}var d=e.memoizedState;if(d!==null){var x=d.dehydrated;if(dc(t),c)if(t.flags&256)t.flags&=-257,t=Cm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Rt||Il(e,t,a,!1),c=(a&e.childLanes)!==0,Rt||c){if(r=st,r!==null&&(x=R(r,a),x!==0&&x!==d.retryLane))throw d.retryLane=x,fl(e,x),ra(r,e,x),Dc;Mi(),t=Cm(e,t,a)}else e=d.treeContext,dt=Ea(x.nextSibling),Bt=t,Ge=!0,Tn=null,Na=!1,e!==null&&mf(t,e),t=_i(t,r),t.flags|=4096;return t}return e=rn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ji(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 Mc(e,t,a,r,c){return gl(t),a=mc(e,t,a,r,void 0,c),r=hc(),e!==null&&!Rt?(pc(e,t,c),fn(e,t,c)):(Ge&&r&&Zo(t),t.flags|=1,Yt(e,t,a,c),t.child)}function Rm(e,t,a,r,c,d){return gl(t),t.updateQueue=null,a=Of(t,r,a,c),Tf(e),r=hc(),e!==null&&!Rt?(pc(e,t,d),fn(e,t,d)):(Ge&&r&&Zo(t),t.flags|=1,Yt(e,t,a,d),t.child)}function zm(e,t,a,r,c){if(gl(t),t.stateNode===null){var d=Fl,x=a.contextType;typeof x=="object"&&x!==null&&(d=qt(x)),d=new a(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Tc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},rc(t),x=a.contextType,d.context=typeof x=="object"&&x!==null?qt(x):Fl,d.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(zc(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&&Tc.enqueueReplaceState(d,d.state,null),Qr(t,r,d,c),Xr(),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=_l(a,S);d.props=C;var U=d.context,K=a.contextType;x=Fl,typeof K=="object"&&K!==null&&(x=qt(K));var W=a.getDerivedStateFromProps;K=typeof W=="function"||typeof d.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,K||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S||U!==x)&&pm(t,d,r,x),Mn=!1;var H=t.memoizedState;d.state=H,Qr(t,r,d,c),Xr(),U=t.memoizedState,S||H!==U||Mn?(typeof W=="function"&&(zc(t,a,W,r),U=t.memoizedState),(C=Mn||hm(t,a,C,r,H,U,x))?(K||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=U),d.props=r,d.state=U,d.context=x,r=C):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,sc(e,t),x=t.memoizedProps,K=_l(a,x),d.props=K,W=t.pendingProps,H=d.context,U=a.contextType,C=Fl,typeof U=="object"&&U!==null&&(C=qt(U)),S=a.getDerivedStateFromProps,(U=typeof S=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==W||H!==C)&&pm(t,d,r,C),Mn=!1,H=t.memoizedState,d.state=H,Qr(t,r,d,c),Xr();var Y=t.memoizedState;x!==W||H!==Y||Mn||e!==null&&e.dependencies!==null&&li(e.dependencies)?(typeof S=="function"&&(zc(t,a,S,r),Y=t.memoizedState),(K=Mn||hm(t,a,K,r,H,Y,C)||e!==null&&e.dependencies!==null&&li(e.dependencies))?(U||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,Y,C),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,Y,C)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=Y),d.props=r,d.state=Y,d.context=C,r=K):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,ji(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=bl(t,e.child,null,c),t.child=bl(t,null,a,c)):Yt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=fn(e,t,c),e}function Tm(e,t,a,r){return hl(),t.flags|=256,Yt(e,t,a,r),t.child}var kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ac(e){return{baseLanes:e,cachePool:vf()}}function Lc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ma),e}function Om(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:(St.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(c?Ln(t):Un(),(e=dt)?(e=Bh(e,Na),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zn!==null?{id:Ja,overflow:Pa}:null,retryLane:536870912,hydrationErrors:null},a=uf(e),a.return=t,t.child=a,Bt=t,dt=null)):e=null,e===null)throw On(t);return yu(e)?t.lanes=32:t.lanes=536870912,null}var S=r.children;return r=r.fallback,c?(Un(),c=t.mode,S=Ni({mode:"hidden",children:S},c),r=ml(r,c,a,null),S.return=t,r.return=t,S.sibling=r,t.child=S,r=t.child,r.memoizedState=Ac(a),r.childLanes=Lc(e,x,a),t.memoizedState=kc,Wr(null,r)):(Ln(t),Uc(t,S))}var C=e.memoizedState;if(C!==null&&(S=C.dehydrated,S!==null)){if(d)t.flags&256?(Ln(t),t.flags&=-257,t=Hc(e,t,a)):t.memoizedState!==null?(Un(),t.child=e.child,t.flags|=128,t=null):(Un(),S=r.fallback,c=t.mode,r=Ni({mode:"visible",children:r.children},c),S=ml(S,c,a,null),S.flags|=2,r.return=t,S.return=t,r.sibling=S,t.child=r,bl(t,e.child,null,a),r=t.child,r.memoizedState=Ac(a),r.childLanes=Lc(e,x,a),t.memoizedState=kc,t=Wr(null,r));else if(Ln(t),yu(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var U=x.dgst;x=U,r=Error(i(419)),r.stack="",r.digest=x,qr({value:r,source:null,stack:null}),t=Hc(e,t,a)}else if(Rt||Il(e,t,a,!1),x=(a&e.childLanes)!==0,Rt||x){if(x=st,x!==null&&(r=R(x,a),r!==0&&r!==C.retryLane))throw C.retryLane=r,fl(e,r),ra(x,e,r),Dc;xu(S)||Mi(),t=Hc(e,t,a)}else xu(S)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,dt=Ea(S.nextSibling),Bt=t,Ge=!0,Tn=null,Na=!1,e!==null&&mf(t,e),t=Uc(t,r.children),t.flags|=4096);return t}return c?(Un(),S=r.fallback,c=t.mode,C=e.child,U=C.sibling,r=rn(C,{mode:"hidden",children:r.children}),r.subtreeFlags=C.subtreeFlags&65011712,U!==null?S=rn(U,S):(S=ml(S,c,a,null),S.flags|=2),S.return=t,r.return=t,r.sibling=S,t.child=r,Wr(null,r),r=t.child,S=e.child.memoizedState,S===null?S=Ac(a):(c=S.cachePool,c!==null?(C=Et._currentValue,c=c.parent!==C?{parent:C,pool:C}:c):c=vf(),S={baseLanes:S.baseLanes|a,cachePool:c}),r.memoizedState=S,r.childLanes=Lc(e,x,a),t.memoizedState=kc,Wr(e.child,r)):(Ln(t),a=e.child,e=a.sibling,a=rn(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 Uc(e,t){return t=Ni({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ni(e,t){return e=ca(22,e,null,t),e.lanes=0,e}function Hc(e,t,a){return bl(t,e.child,null,a),e=Uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dm(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Io(e.return,t,a)}function Bc(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 Mm(e,t,a){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var x=St.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,ee(St,x),Yt(e,t,r,a),r=Ge?Br:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dm(e,a,t);else if(e.tag===19)Dm(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&&fi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Bc(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&&fi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Bc(t,!0,a,null,d,r);break;case"together":Bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function fn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),qn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Il(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=rn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=rn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function qc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&li(e)))}function Wy(e,t,a){switch(t.tag){case 3:it(t,t.stateNode.containerInfo),Dn(t,Et,e.memoizedState.cache),hl();break;case 27:case 5:jt(t);break;case 4:it(t,t.stateNode.containerInfo);break;case 10:Dn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,dc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Ln(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Om(e,t,a):(Ln(t),e=fn(e,t,a),e!==null?e.sibling:null);Ln(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(Il(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return Mm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ee(St,St.current),r)break;return null;case 22:return t.lanes=0,wm(e,t,a,t.pendingProps);case 24:Dn(t,Et,e.memoizedState.cache)}return fn(e,t,a)}function km(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!qc(e,a)&&(t.flags&128)===0)return Rt=!1,Wy(e,t,a);Rt=(e.flags&131072)!==0}else Rt=!1,Ge&&(t.flags&1048576)!==0&&ff(t,Br,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=yl(t.elementType),t.type=e,typeof e=="function")Ko(e)?(r=_l(e,r),t.tag=1,t=zm(null,t,e,r,a)):(t.tag=0,t=Mc(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===J){t.tag=11,t=_m(null,t,e,r,a);break e}else if(c===$){t.tag=14,t=jm(null,t,e,r,a);break e}}throw t=ae(e)||e,Error(i(306,t,""))}}return t;case 0:return Mc(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=_l(r,t.pendingProps),zm(e,t,r,c,a);case 3:e:{if(it(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,sc(e,t),Qr(t,r,null,a);var x=t.memoizedState;if(r=x.cache,Dn(t,Et,r),r!==d.cache&&ec(t,[Et],a,!0),Xr(),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=Tm(e,t,r,a);break e}else if(r!==c){c=Sa(Error(i(424)),t),qr(c),t=Tm(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,dt=Ea(e.firstChild),Bt=t,Ge=!0,Tn=null,Na=!0,a=wf(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(hl(),r===c){t=fn(e,t,a);break e}Yt(e,t,r,a)}t=t.child}return t;case 26:return ji(e,t),e===null?(a=Kh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ge||(a=t.type,e=t.pendingProps,r=qi(Se.current).createElement(a),r[re]=t,r[me]=e,$t(r,a,e),ot(r),t.stateNode=r):t.memoizedState=Kh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return jt(t),e===null&&Ge&&(r=t.stateNode=$h(t.type,t.pendingProps,Se.current),Bt=t,Na=!0,c=dt,Kn(t.type)?(vu=c,dt=Ea(r.firstChild)):dt=c),Yt(e,t,t.pendingProps.children,a),ji(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((c=r=dt)&&(r=R0(r,t.type,t.pendingProps,Na),r!==null?(t.stateNode=r,Bt=t,dt=Ea(r.firstChild),Na=!1,c=!0):c=!1),c||On(t)),jt(t),c=t.type,d=t.pendingProps,x=e!==null?e.memoizedProps:null,r=d.children,hu(c,d)?r=null:x!==null&&hu(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=mc(e,t,Vy,null,null,a),ms._currentValue=c),ji(e,t),Yt(e,t,r,a),t.child;case 6:return e===null&&Ge&&((e=a=dt)&&(a=z0(a,t.pendingProps,Na),a!==null?(t.stateNode=a,Bt=t,dt=null,e=!0):e=!1),e||On(t)),null;case 13:return Om(e,t,a);case 4:return it(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bl(t,null,r,a):Yt(e,t,r,a),t.child;case 11:return _m(e,t,t.type,t.pendingProps,a);case 7:return Yt(e,t,t.pendingProps,a),t.child;case 8:return Yt(e,t,t.pendingProps.children,a),t.child;case 12:return Yt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,Dn(t,t.type,r.value),Yt(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,gl(t),c=qt(c),r=r(c),t.flags|=1,Yt(e,t,r,a),t.child;case 14:return jm(e,t,t.type,t.pendingProps,a);case 15:return Nm(e,t,t.type,t.pendingProps,a);case 19:return Mm(e,t,a);case 31:return Py(e,t,a);case 22:return wm(e,t,a,t.pendingProps);case 24:return gl(t),r=qt(Et),e===null?(c=nc(),c===null&&(c=st,d=tc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:r,cache:c},rc(t),Dn(t,Et,c)):((e.lanes&a)!==0&&(sc(e,t),Qr(t,null,null,a),Xr()),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),Dn(t,Et,r)):(r=d.cache,Dn(t,Et,r),r!==c.cache&&ec(t,[Et],a,!0))),Yt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function mn(e){e.flags|=4}function Yc(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(ih())e.flags|=8192;else throw vl=oi,lc}else e.flags&=-16777217}function Am(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Jh(t))if(ih())e.flags|=8192;else throw vl=oi,lc}function wi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?sl():536870912,e.lanes|=t,dr|=t)}function Ir(e,t){if(!Ge)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 ft(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 Iy(e,t,a){var r=t.pendingProps;switch(Fo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),cn(Et),fe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Wl(t)?mn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Po())),ft(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(mn(t),d!==null?(ft(t),Am(t,d)):(ft(t),Yc(t,c,null,r,a))):d?d!==e.memoizedState?(mn(t),ft(t),Am(t,d)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&mn(t),ft(t),Yc(t,c,e,r,a)),null;case 27:if(Mt(t),a=Se.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&mn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ft(t),null}e=ne.current,Wl(t)?hf(t):(e=$h(c,r,a),t.stateNode=e,mn(t))}return ft(t),null;case 5:if(Mt(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&mn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ft(t),null}if(d=ne.current,Wl(t))hf(t);else{var x=qi(Se.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[re]=t,d[me]=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($t(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&&mn(t)}}return ft(t),Yc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&mn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=Se.current,Wl(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=Bt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[re]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Oh(e.nodeValue,a)),e||On(t,!0)}else e=qi(e).createTextNode(r),e[re]=t,t.stateNode=e}return ft(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wl(t),a!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[re]=t}else hl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else a=Po(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(da(t),t):(da(t),null);if((t.flags&128)!==0)throw Error(i(558))}return ft(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Wl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[re]=t}else hl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),c=!1}else c=Po(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(da(t),t):(da(t),null)}return da(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),wi(t,t.updateQueue),ft(t),null);case 4:return fe(),e===null&&cu(t.stateNode.containerInfo),ft(t),null;case 10:return cn(t.type),ft(t),null;case 19:if(q(St),r=t.memoizedState,r===null)return ft(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)Ir(r,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=fi(e),d!==null){for(t.flags|=128,Ir(r,!1),e=d.updateQueue,t.updateQueue=e,wi(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)cf(a,e),a=a.sibling;return ee(St,St.current&1|2),Ge&&sn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&kt()>Ti&&(t.flags|=128,c=!0,Ir(r,!1),t.lanes=4194304)}else{if(!c)if(e=fi(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,wi(t,e),Ir(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Ge)return ft(t),null}else 2*kt()-r.renderingStartTime>Ti&&a!==536870912&&(t.flags|=128,c=!0,Ir(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=kt(),e.sibling=null,a=St.current,ee(St,c?a&1|2:a&1),Ge&&sn(t,r.treeForkCount),e):(ft(t),null);case 22:case 23:return da(t),uc(),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&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),a=t.updateQueue,a!==null&&wi(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&&q(xl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),cn(Et),ft(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function e0(e,t){switch(Fo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cn(Et),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Mt(t),null;case 31:if(t.memoizedState!==null){if(da(t),t.alternate===null)throw Error(i(340));hl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(da(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));hl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(St),null;case 4:return fe(),null;case 10:return cn(t.type),null;case 22:case 23:return da(t),uc(),e!==null&&q(xl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return cn(Et),null;case 25:return null;default:return null}}function Lm(e,t){switch(Fo(t),t.tag){case 3:cn(Et),fe();break;case 26:case 27:case 5:Mt(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&da(t);break;case 13:da(t);break;case 19:q(St);break;case 10:cn(t.type);break;case 22:case 23:da(t),uc(),e!==null&&q(xl);break;case 24:cn(Et)}}function es(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){et(t,t.return,S)}}function Hn(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,U=S;try{U()}catch(K){et(c,C,K)}}}r=r.next}while(r!==d)}}catch(K){et(t,t.return,K)}}function Um(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Cf(t,a)}catch(r){et(e,e.return,r)}}}function Hm(e,t,a){a.props=_l(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){et(e,t,r)}}function ts(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){et(e,t,c)}}function Wa(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(c){et(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){et(e,t,c)}else a.current=null}function Bm(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){et(e,e.return,c)}}function $c(e,t,a){try{var r=e.stateNode;_0(r,e.type,a,t),r[me]=t}catch(c){et(e,e.return,c)}}function qm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kn(e.type)||e.tag===4}function Vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qm(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&&Kn(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 Gc(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=nn));else if(r!==4&&(r===27&&Kn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,a),e=e.sibling;e!==null;)Gc(e,t,a),e=e.sibling}function Ei(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&&Kn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ei(e,t,a),e=e.sibling;e!==null;)Ei(e,t,a),e=e.sibling}function Ym(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);$t(t,r,a),t[re]=e,t[me]=a}catch(d){et(e,e.return,d)}}var hn=!1,zt=!1,Kc=!1,$m=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function t0(e,t){if(e=e.containerInfo,fu=Qi,e=Id(e),Ho(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,U=0,K=0,W=e,H=null;t:for(;;){for(var Y;W!==a||c!==0&&W.nodeType!==3||(S=x+c),W!==d||r!==0&&W.nodeType!==3||(C=x+r),W.nodeType===3&&(x+=W.nodeValue.length),(Y=W.firstChild)!==null;)H=W,W=Y;for(;;){if(W===e)break t;if(H===a&&++U===c&&(S=x),H===d&&++K===r&&(C=x),(Y=W.nextSibling)!==null)break;W=H,H=W.parentNode}W=Y}a=S===-1||C===-1?null:{start:S,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;for(mu={focusedElem:e,selectionRange:a},Qi=!1,Ut=t;Ut!==null;)if(t=Ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ut=e;else for(;Ut!==null;){switch(t=Ut,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 ge=_l(a.type,c);e=r.getSnapshotBeforeUpdate(ge,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){et(a,a.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)gu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":gu(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,Ut=e;break}Ut=t.return}}function Vm(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:gn(e,a),r&4&&es(5,a);break;case 1:if(gn(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){et(a,a.return,x)}else{var c=_l(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){et(a,a.return,x)}}r&64&&Um(a),r&512&&ts(a,a.return);break;case 3:if(gn(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{Cf(e,t)}catch(x){et(a,a.return,x)}}break;case 27:t===null&&r&4&&Ym(a);case 26:case 5:gn(e,a),t===null&&r&4&&Bm(a),r&512&&ts(a,a.return);break;case 12:gn(e,a);break;case 31:gn(e,a),r&4&&Xm(e,a);break;case 13:gn(e,a),r&4&&Qm(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=u0.bind(null,a),T0(e,a))));break;case 22:if(r=a.memoizedState!==null||hn,!r){t=t!==null&&t.memoizedState!==null||zt,c=hn;var d=zt;hn=r,(zt=t)&&!d?xn(e,a,(a.subtreeFlags&8772)!==0):gn(e,a),hn=c,zt=d}break;case 30:break;default:gn(e,a)}}function Gm(e){var t=e.alternate;t!==null&&(e.alternate=null,Gm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rt(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 mt=null,ta=!1;function pn(e,t,a){for(a=a.child;a!==null;)Km(e,t,a),a=a.sibling}function Km(e,t,a){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(Aa,a)}catch{}switch(a.tag){case 26:zt||Wa(a,t),pn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:zt||Wa(a,t);var r=mt,c=ta;Kn(a.type)&&(mt=a.stateNode,ta=!1),pn(e,t,a),us(a.stateNode),mt=r,ta=c;break;case 5:zt||Wa(a,t);case 6:if(r=mt,c=ta,mt=null,pn(e,t,a),mt=r,ta=c,mt!==null)if(ta)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(a.stateNode)}catch(d){et(a,t,d)}else try{mt.removeChild(a.stateNode)}catch(d){et(a,t,d)}break;case 18:mt!==null&&(ta?(e=mt,Uh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),vr(e)):Uh(mt,a.stateNode));break;case 4:r=mt,c=ta,mt=a.stateNode.containerInfo,ta=!0,pn(e,t,a),mt=r,ta=c;break;case 0:case 11:case 14:case 15:Hn(2,a,t),zt||Hn(4,a,t),pn(e,t,a);break;case 1:zt||(Wa(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Hm(a,t,r)),pn(e,t,a);break;case 21:pn(e,t,a);break;case 22:zt=(r=zt)||a.memoizedState!==null,pn(e,t,a),zt=r;break;default:pn(e,t,a)}}function Xm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{vr(e)}catch(a){et(t,t.return,a)}}}function Qm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{vr(e)}catch(a){et(t,t.return,a)}}function a0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $m),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $m),t;default:throw Error(i(435,e.tag))}}function Ci(e,t){var a=a0(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=d0.bind(null,e,r);r.then(c,c)}})}function aa(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(Kn(S.type)){mt=S.stateNode,ta=!1;break e}break;case 5:mt=S.stateNode,ta=!1;break e;case 3:case 4:mt=S.stateNode.containerInfo,ta=!0;break e}S=S.return}if(mt===null)throw Error(i(160));Km(d,x,c),mt=null,ta=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zm(t,e),t=t.sibling}var Ba=null;function Zm(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:aa(t,e),na(e),r&4&&(Hn(3,e,e.return),es(3,e),Hn(5,e,e.return));break;case 1:aa(t,e),na(e),r&512&&(zt||a===null||Wa(a,a.return)),r&64&&hn&&(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=Ba;if(aa(t,e),na(e),r&512&&(zt||a===null||Wa(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[He]||d[re]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),$t(d,r,a),d[re]=e,ot(d),r=d;break e;case"link":var x=Zh("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),$t(d,r,a),c.head.appendChild(d);break;case"meta":if(x=Zh("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),$t(d,r,a),c.head.appendChild(d);break;default:throw Error(i(468,r))}d[re]=e,ot(d),r=d}e.stateNode=r}else Fh(c,e.type,e.stateNode);else e.stateNode=Qh(c,r,e.memoizedProps);else d!==r?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,r===null?Fh(c,e.type,e.stateNode):Qh(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&$c(e,e.memoizedProps,a.memoizedProps)}break;case 27:aa(t,e),na(e),r&512&&(zt||a===null||Wa(a,a.return)),a!==null&&r&4&&$c(e,e.memoizedProps,a.memoizedProps);break;case 5:if(aa(t,e),na(e),r&512&&(zt||a===null||Wa(a,a.return)),e.flags&32){c=e.stateNode;try{$l(c,"")}catch(ge){et(e,e.return,ge)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,$c(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Kc=!0);break;case 6:if(aa(t,e),na(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(ge){et(e,e.return,ge)}}break;case 3:if(Vi=null,c=Ba,Ba=Yi(t.containerInfo),aa(t,e),Ba=c,na(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{vr(t.containerInfo)}catch(ge){et(e,e.return,ge)}Kc&&(Kc=!1,Fm(e));break;case 4:r=Ba,Ba=Yi(e.stateNode.containerInfo),aa(t,e),na(e),Ba=r;break;case 12:aa(t,e),na(e);break;case 31:aa(t,e),na(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ci(e,r)));break;case 13:aa(t,e),na(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(zi=kt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ci(e,r)));break;case 22:c=e.memoizedState!==null;var C=a!==null&&a.memoizedState!==null,U=hn,K=zt;if(hn=U||c,zt=K||C,aa(t,e),zt=K,hn=U,na(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||C||hn||zt||jl(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 W=C.memoizedProps.style,H=W!=null&&W.hasOwnProperty("display")?W.display:null;S.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(ge){et(C,C.return,ge)}}}else if(t.tag===6){if(a===null){C=t;try{C.stateNode.nodeValue=c?"":C.memoizedProps}catch(ge){et(C,C.return,ge)}}}else if(t.tag===18){if(a===null){C=t;try{var Y=C.stateNode;c?Hh(Y,!0):Hh(C.stateNode,!1)}catch(ge){et(C,C.return,ge)}}}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,Ci(e,a))));break;case 19:aa(t,e),na(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ci(e,r)));break;case 30:break;case 21:break;default:aa(t,e),na(e)}}function na(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(qm(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=Vc(e);Ei(e,d,c);break;case 5:var x=a.stateNode;a.flags&32&&($l(x,""),a.flags&=-33);var S=Vc(e);Ei(e,S,x);break;case 3:case 4:var C=a.stateNode.containerInfo,U=Vc(e);Gc(e,U,C);break;default:throw Error(i(161))}}catch(K){et(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Vm(e,t.alternate,t),t=t.sibling}function jl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hn(4,t,t.return),jl(t);break;case 1:Wa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Hm(t,t.return,a),jl(t);break;case 27:us(t.stateNode);case 26:case 5:Wa(t,t.return),jl(t);break;case 22:t.memoizedState===null&&jl(t);break;case 30:jl(t);break;default:jl(t)}e=e.sibling}}function xn(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:xn(c,d,a),es(4,d);break;case 1:if(xn(c,d,a),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(U){et(r,r.return,U)}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++)Ef(C[c],S)}catch(U){et(r,r.return,U)}}a&&x&64&&Um(d),ts(d,d.return);break;case 27:Ym(d);case 26:case 5:xn(c,d,a),a&&r===null&&x&4&&Bm(d),ts(d,d.return);break;case 12:xn(c,d,a);break;case 31:xn(c,d,a),a&&x&4&&Xm(c,d);break;case 13:xn(c,d,a),a&&x&4&&Qm(c,d);break;case 22:d.memoizedState===null&&xn(c,d,a),ts(d,d.return);break;case 30:break;default:xn(c,d,a)}t=t.sibling}}function Xc(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&&Yr(a))}function Qc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yr(e))}function qa(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Jm(e,t,a,r),t=t.sibling}function Jm(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:qa(e,t,a,r),c&2048&&es(9,t);break;case 1:qa(e,t,a,r);break;case 3:qa(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&&Yr(e)));break;case 12:if(c&2048){qa(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){et(t,t.return,C)}}else qa(e,t,a,r);break;case 31:qa(e,t,a,r);break;case 13:qa(e,t,a,r);break;case 23:break;case 22:d=t.stateNode,x=t.alternate,t.memoizedState!==null?d._visibility&2?qa(e,t,a,r):as(e,t):d._visibility&2?qa(e,t,a,r):(d._visibility|=2,or(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Xc(x,t);break;case 24:qa(e,t,a,r),c&2048&&Qc(t.alternate,t);break;default:qa(e,t,a,r)}}function or(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,x=t,S=a,C=r,U=x.flags;switch(x.tag){case 0:case 11:case 15:or(d,x,S,C,c),es(8,x);break;case 23:break;case 22:var K=x.stateNode;x.memoizedState!==null?K._visibility&2?or(d,x,S,C,c):as(d,x):(K._visibility|=2,or(d,x,S,C,c)),c&&U&2048&&Xc(x.alternate,x);break;case 24:or(d,x,S,C,c),c&&U&2048&&Qc(x.alternate,x);break;default:or(d,x,S,C,c)}t=t.sibling}}function as(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:as(a,r),c&2048&&Xc(r.alternate,r);break;case 24:as(a,r),c&2048&&Qc(r.alternate,r);break;default:as(a,r)}t=t.sibling}}var ns=8192;function cr(e,t,a){if(e.subtreeFlags&ns)for(e=e.child;e!==null;)Pm(e,t,a),e=e.sibling}function Pm(e,t,a){switch(e.tag){case 26:cr(e,t,a),e.flags&ns&&e.memoizedState!==null&&$0(a,Ba,e.memoizedState,e.memoizedProps);break;case 5:cr(e,t,a);break;case 3:case 4:var r=Ba;Ba=Yi(e.stateNode.containerInfo),cr(e,t,a),Ba=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ns,ns=16777216,cr(e,t,a),ns=r):cr(e,t,a));break;default:cr(e,t,a)}}function Wm(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 ls(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];Ut=r,eh(r,e)}Wm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Im(e),e=e.sibling}function Im(e){switch(e.tag){case 0:case 11:case 15:ls(e),e.flags&2048&&Hn(9,e,e.return);break;case 3:ls(e);break;case 12:ls(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ri(e)):ls(e);break;default:ls(e)}}function Ri(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];Ut=r,eh(r,e)}Wm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hn(8,t,t.return),Ri(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ri(t));break;default:Ri(t)}e=e.sibling}}function eh(e,t){for(;Ut!==null;){var a=Ut;switch(a.tag){case 0:case 11:case 15:Hn(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:Yr(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Ut=r;else e:for(a=e;Ut!==null;){r=Ut;var c=r.sibling,d=r.return;if(Gm(r),r===a){Ut=null;break e}if(c!==null){c.return=d,Ut=c;break e}Ut=d}}}var n0={getCacheForType:function(e){var t=qt(Et),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return qt(Et).controller.signal}},l0=typeof WeakMap=="function"?WeakMap:Map,We=0,st=null,qe=null,$e=0,Ie=0,fa=null,Bn=!1,ur=!1,Zc=!1,yn=0,xt=0,qn=0,Nl=0,Fc=0,ma=0,dr=0,rs=null,la=null,Jc=!1,zi=0,th=0,Ti=1/0,Oi=null,Yn=null,Dt=0,$n=null,fr=null,vn=0,Pc=0,Wc=null,ah=null,ss=0,Ic=null;function ha(){return(We&2)!==0&&$e!==0?$e&-$e:M.T!==null?ru():te()}function nh(){if(ma===0)if(($e&536870912)===0||Ge){var e=Pe;Pe<<=1,(Pe&3932160)===0&&(Pe=262144),ma=e}else ma=536870912;return e=ua.current,e!==null&&(e.flags|=32),ma}function ra(e,t,a){(e===st&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(mr(e,0),Vn(e,$e,ma,!1)),Qa(e,a),((We&2)===0||e!==st)&&(e===st&&((We&2)===0&&(Nl|=a),xt===4&&Vn(e,$e,ma,!1)),Ia(e))}function lh(e,t,a){if((We&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||La(e,t),c=r?i0(e,t):tu(e,t,!0),d=r;do{if(c===0){ur&&!r&&Vn(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!r0(a)){c=tu(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=rs;var C=S.current.memoizedState.isDehydrated;if(C&&(mr(S,x).flags|=256),x=tu(S,x,!1),x!==2){if(Zc&&!C){S.errorRecoveryDisabledLanes|=d,Nl|=d,c=4;break e}d=la,la=c,d!==null&&(la===null?la=d:la.push.apply(la,d))}c=x}if(d=!1,c!==2)continue}}if(c===1){mr(e,0),Vn(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:Vn(r,t,ma,!Bn);break e;case 2:la=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=zi+300-kt(),10<c)){if(Vn(r,t,ma,!Bn),an(r,0,!0)!==0)break e;vn=t,r.timeoutHandle=Ah(rh.bind(null,r,a,la,Oi,Jc,t,ma,Nl,dr,Bn,d,"Throttled",-0,0),c);break e}rh(r,a,la,Oi,Jc,t,ma,Nl,dr,Bn,d,null,-0,0)}}break}while(!0);Ia(e)}function rh(e,t,a,r,c,d,x,S,C,U,K,W,H,Y){if(e.timeoutHandle=-1,W=t.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Pm(t,d,W);var ge=(d&62914560)===d?zi-kt():(d&4194048)===d?th-kt():0;if(ge=V0(W,ge),ge!==null){vn=d,e.cancelPendingCommit=ge(mh.bind(null,e,t,d,a,r,c,x,S,C,K,W,null,H,Y)),Vn(e,d,x,!U);return}}mh(e,t,d,a,r,c,x,S,C)}function r0(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(!oa(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 Vn(e,t,a,r){t&=~Fc,t&=~Nl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-At(c),x=1<<d;r[d]=-1,c&=~x}a!==0&&Ys(e,a,t)}function Di(){return(We&6)===0?(is(0),!1):!0}function eu(){if(qe!==null){if(Ie===0)var e=qe.return;else e=qe,on=pl=null,gc(e),nr=null,Vr=0,e=qe;for(;e!==null;)Lm(e.alternate,e),e=e.return;qe=null}}function mr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,w0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),vn=0,eu(),st=e,qe=a=rn(e.current,null),$e=t,Ie=0,fa=null,Bn=!1,ur=La(e,t),Zc=!1,dr=ma=Fc=Nl=qn=xt=0,la=rs=null,Jc=!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-At(r),d=1<<c;t|=e[c],r&=~d}return yn=t,Is(),a}function sh(e,t){Ae=null,M.H=Pr,t===ar||t===ii?(t=_f(),Ie=3):t===lc?(t=_f(),Ie=4):Ie=t===Dc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,fa=t,qe===null&&(xt=1,Si(e,Sa(t,e.current)))}function ih(){var e=ua.current;return e===null?!0:($e&4194048)===$e?wa===null:($e&62914560)===$e||($e&536870912)!==0?e===wa:!1}function oh(){var e=M.H;return M.H=Pr,e===null?Pr:e}function ch(){var e=M.A;return M.A=n0,e}function Mi(){xt=4,Bn||($e&4194048)!==$e&&ua.current!==null||(ur=!0),(qn&134217727)===0&&(Nl&134217727)===0||st===null||Vn(st,$e,ma,!1)}function tu(e,t,a){var r=We;We|=2;var c=oh(),d=ch();(st!==e||$e!==t)&&(Oi=null,mr(e,t)),t=!1;var x=xt;e:do try{if(Ie!==0&&qe!==null){var S=qe,C=fa;switch(Ie){case 8:eu(),x=6;break e;case 3:case 2:case 9:case 6:ua.current===null&&(t=!0);var U=Ie;if(Ie=0,fa=null,hr(e,S,C,U),a&&ur){x=0;break e}break;default:U=Ie,Ie=0,fa=null,hr(e,S,C,U)}}s0(),x=xt;break}catch(K){sh(e,K)}while(!0);return t&&e.shellSuspendCounter++,on=pl=null,We=r,M.H=c,M.A=d,qe===null&&(st=null,$e=0,Is()),x}function s0(){for(;qe!==null;)uh(qe)}function i0(e,t){var a=We;We|=2;var r=oh(),c=ch();st!==e||$e!==t?(Oi=null,Ti=kt()+500,mr(e,t)):ur=La(e,t);e:do try{if(Ie!==0&&qe!==null){t=qe;var d=fa;t:switch(Ie){case 1:Ie=0,fa=null,hr(e,t,d,1);break;case 2:case 9:if(bf(d)){Ie=0,fa=null,dh(t);break}t=function(){Ie!==2&&Ie!==9||st!==e||(Ie=7),Ia(e)},d.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:bf(d)?(Ie=0,fa=null,dh(t)):(Ie=0,fa=null,hr(e,t,d,7));break;case 5:var x=null;switch(qe.tag){case 26:x=qe.memoizedState;case 5:case 27:var S=qe;if(x?Jh(x):S.stateNode.complete){Ie=0,fa=null;var C=S.sibling;if(C!==null)qe=C;else{var U=S.return;U!==null?(qe=U,ki(U)):qe=null}break t}}Ie=0,fa=null,hr(e,t,d,5);break;case 6:Ie=0,fa=null,hr(e,t,d,6);break;case 8:eu(),xt=6;break e;default:throw Error(i(462))}}o0();break}catch(K){sh(e,K)}while(!0);return on=pl=null,M.H=r,M.A=c,We=a,qe!==null?0:(st=null,$e=0,Is(),xt)}function o0(){for(;qe!==null&&!nl();)uh(qe)}function uh(e){var t=km(e.alternate,e,yn);e.memoizedProps=e.pendingProps,t===null?ki(e):qe=t}function dh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Rm(a,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Rm(a,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:gc(t);default:Lm(a,t),t=qe=cf(t,yn),t=km(a,t,yn)}e.memoizedProps=e.pendingProps,t===null?ki(e):qe=t}function hr(e,t,a,r){on=pl=null,gc(t),nr=null,Vr=0;var c=t.return;try{if(Jy(e,c,t,a,$e)){xt=1,Si(e,Sa(a,e.current)),qe=null;return}}catch(d){if(c!==null)throw qe=c,d;xt=1,Si(e,Sa(a,e.current)),qe=null;return}t.flags&32768?(Ge||r===1?e=!0:ur||($e&536870912)!==0?e=!1:(Bn=e=!0,(r===2||r===9||r===3||r===6)&&(r=ua.current,r!==null&&r.tag===13&&(r.flags|=16384))),fh(t,e)):ki(t)}function ki(e){var t=e;do{if((t.flags&32768)!==0){fh(t,Bn);return}e=t.return;var a=Iy(t.alternate,t,yn);if(a!==null){qe=a;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);xt===0&&(xt=5)}function fh(e,t){do{var a=e0(e.alternate,e);if(a!==null){a.flags&=32767,qe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=a}while(e!==null);xt=6,qe=null}function mh(e,t,a,r,c,d,x,S,C){e.cancelPendingCommit=null;do Ai();while(Dt!==0);if((We&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=Vo,qs(e,a,d,x,S,C),e===st&&(qe=st=null,$e=0),fr=t,$n=e,vn=a,Pc=d,Wc=c,ah=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,f0(Ka,function(){return yh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=M.T,M.T=null,c=P.p,P.p=2,x=We,We|=4;try{t0(e,t,a)}finally{We=x,P.p=c,M.T=r}}Dt=1,hh(),ph(),gh()}}function hh(){if(Dt===1){Dt=0;var e=$n,t=fr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var r=P.p;P.p=2;var c=We;We|=4;try{Zm(t,e);var d=mu,x=Id(e.containerInfo),S=d.focusedElem,C=d.selectionRange;if(x!==S&&S&&S.ownerDocument&&Wd(S.ownerDocument.documentElement,S)){if(C!==null&&Ho(S)){var U=C.start,K=C.end;if(K===void 0&&(K=U),"selectionStart"in S)S.selectionStart=U,S.selectionEnd=Math.min(K,S.value.length);else{var W=S.ownerDocument||document,H=W&&W.defaultView||window;if(H.getSelection){var Y=H.getSelection(),ge=S.textContent.length,Ce=Math.min(C.start,ge),nt=C.end===void 0?Ce:Math.min(C.end,ge);!Y.extend&&Ce>nt&&(x=nt,nt=Ce,Ce=x);var D=Pd(S,Ce),z=Pd(S,nt);if(D&&z&&(Y.rangeCount!==1||Y.anchorNode!==D.node||Y.anchorOffset!==D.offset||Y.focusNode!==z.node||Y.focusOffset!==z.offset)){var L=W.createRange();L.setStart(D.node,D.offset),Y.removeAllRanges(),Ce>nt?(Y.addRange(L),Y.extend(z.node,z.offset)):(L.setEnd(z.node,z.offset),Y.addRange(L))}}}}for(W=[],Y=S;Y=Y.parentNode;)Y.nodeType===1&&W.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<W.length;S++){var Z=W[S];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Qi=!!fu,mu=fu=null}finally{We=c,P.p=r,M.T=a}}e.current=t,Dt=2}}function ph(){if(Dt===2){Dt=0;var e=$n,t=fr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var r=P.p;P.p=2;var c=We;We|=4;try{Vm(e,t.alternate,t)}finally{We=c,P.p=r,M.T=a}}Dt=3}}function gh(){if(Dt===4||Dt===3){Dt=0,ll();var e=$n,t=fr,a=vn,r=ah;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dt=5:(Dt=0,fr=$n=null,xh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Yn=null),B(a),t=t.stateNode,Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(Aa,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=M.T,c=P.p,P.p=2,M.T=null;try{for(var d=e.onRecoverableError,x=0;x<r.length;x++){var S=r[x];d(S.value,{componentStack:S.stack})}}finally{M.T=t,P.p=c}}(vn&3)!==0&&Ai(),Ia(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===Ic?ss++:(ss=0,Ic=e):ss=0,is(0)}}function xh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Yr(t)))}function Ai(){return hh(),ph(),gh(),yh()}function yh(){if(Dt!==5)return!1;var e=$n,t=Pc;Pc=0;var a=B(vn),r=M.T,c=P.p;try{P.p=32>a?32:a,M.T=null,a=Wc,Wc=null;var d=$n,x=vn;if(Dt=0,fr=$n=null,vn=0,(We&6)!==0)throw Error(i(331));var S=We;if(We|=4,Im(d.current),Jm(d,d.current,x,a),We=S,is(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(Aa,d)}catch{}return!0}finally{P.p=c,M.T=r,xh(e,t)}}function vh(e,t,a){t=Sa(a,t),t=Oc(e.stateNode,t,2),e=An(e,t,2),e!==null&&(Qa(e,2),Ia(e))}function et(e,t,a){if(e.tag===3)vh(e,e,a);else for(;t!==null;){if(t.tag===3){vh(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Yn===null||!Yn.has(r))){e=Sa(a,e),a=bm(2),r=An(t,a,2),r!==null&&(Sm(a,r,t,e),Qa(r,2),Ia(r));break}}t=t.return}}function au(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new l0;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)||(Zc=!0,c.add(a),e=c0.bind(null,e,t,a),t.then(e,e))}function c0(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,st===e&&($e&a)===a&&(xt===4||xt===3&&($e&62914560)===$e&&300>kt()-zi?(We&2)===0&&mr(e,0):Fc|=a,dr===$e&&(dr=0)),Ia(e)}function bh(e,t){t===0&&(t=sl()),e=fl(e,t),e!==null&&(Qa(e,t),Ia(e))}function u0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),bh(e,a)}function d0(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),bh(e,a)}function f0(e,t){return ya(e,t)}var Li=null,pr=null,nu=!1,Ui=!1,lu=!1,Gn=0;function Ia(e){e!==pr&&e.next===null&&(pr===null?Li=pr=e:pr=pr.next=e),Ui=!0,nu||(nu=!0,h0())}function is(e,t){if(!lu&&Ui){lu=!0;do for(var a=!1,r=Li;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-At(42|e)+1)-1,d&=c&~(x&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Nh(r,d))}else d=$e,d=an(r,r===st?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||La(r,d)||(a=!0,Nh(r,d));r=r.next}while(a);lu=!1}}function m0(){Sh()}function Sh(){Ui=nu=!1;var e=0;Gn!==0&&N0()&&(e=Gn);for(var t=kt(),a=null,r=Li;r!==null;){var c=r.next,d=_h(r,t);d===0?(r.next=null,a===null?Li=c:a.next=c,c===null&&(pr=a)):(a=r,(e!==0||(d&3)!==0)&&(Ui=!0)),r=c}Dt!==0&&Dt!==5||is(e),Gn!==0&&(Gn=0)}function _h(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var x=31-At(d),S=1<<x,C=c[x];C===-1?((S&a)===0||(S&r)!==0)&&(c[x]=rl(S,t)):C<=t&&(e.expiredLanes|=S),d&=~S}if(t=st,a=$e,a=an(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ga(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&&Ga(r),B(a)){case 2:case 8:a=En;break;case 32:a=Ka;break;case 268435456:a=It;break;default:a=Ka}return r=jh.bind(null,e),a=ya(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Ga(r),e.callbackPriority=2,e.callbackNode=null,2}function jh(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ai()&&e.callbackNode!==a)return null;var r=$e;return r=an(e,e===st?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(lh(e,r,t),_h(e,kt()),e.callbackNode!=null&&e.callbackNode===a?jh.bind(null,e):null)}function Nh(e,t){if(Ai())return null;lh(e,t,!0)}function h0(){E0(function(){(We&6)!==0?ya(ka,m0):Sh()})}function ru(){if(Gn===0){var e=er;e===0&&(e=Ne,Ne<<=1,(Ne&261888)===0&&(Ne=256)),Gn=e}return Gn}function wh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ks(""+e)}function Eh(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 p0(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var d=wh((c[me]||null).action),x=r.submitter;x&&(t=(t=x[me]||null)?wh(t.formAction):x.getAttribute("formAction"),t!==null&&(d=t,x=null));var S=new Fs("action","action",null,r,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Gn!==0){var C=x?Eh(c,x):new FormData(c);wc(a,{pending:!0,data:C,method:c.method,action:d},null,C)}}else typeof d=="function"&&(S.preventDefault(),C=x?Eh(c,x):new FormData(c),wc(a,{pending:!0,data:C,method:c.method,action:d},d,C))},currentTarget:c}]})}}for(var su=0;su<$o.length;su++){var iu=$o[su],g0=iu.toLowerCase(),x0=iu[0].toUpperCase()+iu.slice(1);Ha(g0,"on"+x0)}Ha(af,"onAnimationEnd"),Ha(nf,"onAnimationIteration"),Ha(lf,"onAnimationStart"),Ha("dblclick","onDoubleClick"),Ha("focusin","onFocus"),Ha("focusout","onBlur"),Ha(My,"onTransitionRun"),Ha(ky,"onTransitionStart"),Ha(Ay,"onTransitionCancel"),Ha(rf,"onTransitionEnd"),Za("onMouseEnter",["mouseout","mouseover"]),Za("onMouseLeave",["mouseout","mouseover"]),Za("onPointerEnter",["pointerout","pointerover"]),Za("onPointerLeave",["pointerout","pointerover"]),Lt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Lt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Lt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Lt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Lt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Lt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var os="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(" "),y0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(os));function Ch(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,U=S.currentTarget;if(S=S.listener,C!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=U;try{d(c)}catch(K){Ws(K)}c.currentTarget=null,d=C}else for(x=0;x<r.length;x++){if(S=r[x],C=S.instance,U=S.currentTarget,S=S.listener,C!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=U;try{d(c)}catch(K){Ws(K)}c.currentTarget=null,d=C}}}}function Ye(e,t){var a=t[_e];a===void 0&&(a=t[_e]=new Set);var r=e+"__bubble";a.has(r)||(Rh(t,e,2,!1),a.add(r))}function ou(e,t,a){var r=0;t&&(r|=4),Rh(a,e,r,t)}var Hi="_reactListening"+Math.random().toString(36).slice(2);function cu(e){if(!e[Hi]){e[Hi]=!0,Cn.forEach(function(a){a!=="selectionchange"&&(y0.has(a)||ou(a,!1,e),ou(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hi]||(t[Hi]=!0,ou("selectionchange",!1,t))}}function Rh(e,t,a,r){switch(np(t)){case 2:var c=X0;break;case 8:c=Q0;break;default:c=Nu}a=c.bind(null,t,a,e),c=void 0,!zo||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 uu(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=ct(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}Dd(function(){var U=d,K=Co(a),W=[];e:{var H=sf.get(e);if(H!==void 0){var Y=Fs,ge=e;switch(e){case"keypress":if(Qs(a)===0)break e;case"keydown":case"keyup":Y=dy;break;case"focusin":ge="focus",Y=Mo;break;case"focusout":ge="blur",Y=Mo;break;case"beforeblur":case"afterblur":Y=Mo;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":Y=Ad;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Ix;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=hy;break;case af:case nf:case lf:Y=ay;break;case rf:Y=gy;break;case"scroll":case"scrollend":Y=Px;break;case"wheel":Y=yy;break;case"copy":case"cut":case"paste":Y=ly;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Ud;break;case"toggle":case"beforetoggle":Y=by}var Ce=(t&4)!==0,nt=!Ce&&(e==="scroll"||e==="scrollend"),D=Ce?H!==null?H+"Capture":null:H;Ce=[];for(var z=U,L;z!==null;){var Z=z;if(L=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||L===null||D===null||(Z=Tr(z,D),Z!=null&&Ce.push(cs(z,Z,L))),nt)break;z=z.return}0<Ce.length&&(H=new Y(H,ge,null,a,K),W.push({event:H,listeners:Ce}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",H&&a!==Eo&&(ge=a.relatedTarget||a.fromElement)&&(ct(ge)||ge[he]))break e;if((Y||H)&&(H=K.window===K?K:(H=K.ownerDocument)?H.defaultView||H.parentWindow:window,Y?(ge=a.relatedTarget||a.toElement,Y=U,ge=ge?ct(ge):null,ge!==null&&(nt=u(ge),Ce=ge.tag,ge!==nt||Ce!==5&&Ce!==27&&Ce!==6)&&(ge=null)):(Y=null,ge=U),Y!==ge)){if(Ce=Ad,Z="onMouseLeave",D="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Ud,Z="onPointerLeave",D="onPointerEnter",z="pointer"),nt=Y==null?H:Ke(Y),L=ge==null?H:Ke(ge),H=new Ce(Z,z+"leave",Y,a,K),H.target=nt,H.relatedTarget=L,Z=null,ct(K)===U&&(Ce=new Ce(D,z+"enter",ge,a,K),Ce.target=L,Ce.relatedTarget=nt,Z=Ce),nt=Z,Y&&ge)t:{for(Ce=v0,D=Y,z=ge,L=0,Z=D;Z;Z=Ce(Z))L++;Z=0;for(var je=z;je;je=Ce(je))Z++;for(;0<L-Z;)D=Ce(D),L--;for(;0<Z-L;)z=Ce(z),Z--;for(;L--;){if(D===z||z!==null&&D===z.alternate){Ce=D;break t}D=Ce(D),z=Ce(z)}Ce=null}else Ce=null;Y!==null&&zh(W,H,Y,Ce,!1),ge!==null&&nt!==null&&zh(W,nt,ge,Ce,!0)}}e:{if(H=U?Ke(U):window,Y=H.nodeName&&H.nodeName.toLowerCase(),Y==="select"||Y==="input"&&H.type==="file")var Fe=Kd;else if(Vd(H))if(Xd)Fe=Ty;else{Fe=Ry;var ye=Cy}else Y=H.nodeName,!Y||Y.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?U&&wo(U.elementType)&&(Fe=Kd):Fe=zy;if(Fe&&(Fe=Fe(e,U))){Gd(W,Fe,a,K);break e}ye&&ye(e,H,U),e==="focusout"&&U&&H.type==="number"&&U.memoizedProps.value!=null&&No(H,"number",H.value)}switch(ye=U?Ke(U):window,e){case"focusin":(Vd(ye)||ye.contentEditable==="true")&&(Xl=ye,Bo=U,Hr=null);break;case"focusout":Hr=Bo=Xl=null;break;case"mousedown":qo=!0;break;case"contextmenu":case"mouseup":case"dragend":qo=!1,ef(W,a,K);break;case"selectionchange":if(Dy)break;case"keydown":case"keyup":ef(W,a,K)}var Le;if(Ao)e:{switch(e){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Kl?Yd(e,a)&&(Ve="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(Hd&&a.locale!=="ko"&&(Kl||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Kl&&(Le=Md()):(Rn=K,To="value"in Rn?Rn.value:Rn.textContent,Kl=!0)),ye=Bi(U,Ve),0<ye.length&&(Ve=new Ld(Ve,e,null,a,K),W.push({event:Ve,listeners:ye}),Le?Ve.data=Le:(Le=$d(a),Le!==null&&(Ve.data=Le)))),(Le=_y?jy(e,a):Ny(e,a))&&(Ve=Bi(U,"onBeforeInput"),0<Ve.length&&(ye=new Ld("onBeforeInput","beforeinput",null,a,K),W.push({event:ye,listeners:Ve}),ye.data=Le)),p0(W,e,U,a,K)}Ch(W,t)})}function cs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Bi(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=Tr(e,a),c!=null&&r.unshift(cs(e,c,d)),c=Tr(e,t),c!=null&&r.push(cs(e,c,d))),e.tag===3)return r;e=e.return}return[]}function v0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zh(e,t,a,r,c){for(var d=t._reactName,x=[];a!==null&&a!==r;){var S=a,C=S.alternate,U=S.stateNode;if(S=S.tag,C!==null&&C===r)break;S!==5&&S!==26&&S!==27||U===null||(C=U,c?(U=Tr(a,d),U!=null&&x.unshift(cs(a,U,C))):c||(U=Tr(a,d),U!=null&&x.push(cs(a,U,C)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var b0=/\r\n?/g,S0=/\u0000|\uFFFD/g;function Th(e){return(typeof e=="string"?e:""+e).replace(b0,`
|
|
9
|
+
`).replace(S0,"")}function Oh(e,t){return t=Th(t),Th(e)===t}function at(e,t,a,r,c,d){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||$l(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&$l(e,""+r);break;case"className":bt(e,"class",r);break;case"tabIndex":bt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":bt(e,a,r);break;case"style":Td(e,r,d);break;case"data":if(t!=="object"){bt(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=Ks(""+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"&&at(e,t,"name",c.name,c,null),at(e,t,"formEncType",c.formEncType,c,null),at(e,t,"formMethod",c.formMethod,c,null),at(e,t,"formTarget",c.formTarget,c,null)):(at(e,t,"encType",c.encType,c,null),at(e,t,"method",c.method,c,null),at(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ks(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=nn);break;case"onScroll":r!=null&&Ye("scroll",e);break;case"onScrollEnd":r!=null&&Ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Ks(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),Be(e,"popover",r);break;case"xlinkActuate":Kt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Kt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Kt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Kt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Kt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Kt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Be(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=Fx.get(a)||a,Be(e,a,r))}}function du(e,t,a,r,c,d){switch(a){case"style":Td(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"?$l(e,r):(typeof r=="number"||typeof r=="bigint")&&$l(e,""+r);break;case"onScroll":r!=null&&Ye("scroll",e);break;case"onScrollEnd":r!=null&&Ye("scrollend",e);break;case"onClick":r!=null&&(e.onclick=nn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ua.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[me]||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,""):Be(e,a,r)}}}function $t(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var r=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var x=a[d];if(x!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:at(e,t,d,x,a,null)}}c&&at(e,t,"srcSet",a.srcSet,a,null),r&&at(e,t,"src",a.src,a,null);return;case"input":Ye("invalid",e);var S=d=x=c=null,C=null,U=null;for(r in a)if(a.hasOwnProperty(r)){var K=a[r];if(K!=null)switch(r){case"name":c=K;break;case"type":x=K;break;case"checked":C=K;break;case"defaultChecked":U=K;break;case"value":d=K;break;case"defaultValue":S=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,t));break;default:at(e,t,r,K,a,null)}}Ed(e,d,S,C,U,x,c,!1);return;case"select":Ye("invalid",e),r=x=d=null;for(c in a)if(a.hasOwnProperty(c)&&(S=a[c],S!=null))switch(c){case"value":d=S;break;case"defaultValue":x=S;break;case"multiple":r=S;default:at(e,t,c,S,a,null)}t=d,a=x,e.multiple=!!r,t!=null?Yl(e,!!r,t,!1):a!=null&&Yl(e,!!r,a,!0);return;case"textarea":Ye("invalid",e),d=c=r=null;for(x in a)if(a.hasOwnProperty(x)&&(S=a[x],S!=null))switch(x){case"value":r=S;break;case"defaultValue":c=S;break;case"children":d=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:at(e,t,x,S,a,null)}Rd(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":at(e,t,C,r,a,null));return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(r=0;r<os.length;r++)Ye(os[r],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in a)if(a.hasOwnProperty(U)&&(r=a[U],r!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:at(e,t,U,r,a,null)}return;default:if(wo(t)){for(K in a)a.hasOwnProperty(K)&&(r=a[K],r!==void 0&&du(e,t,K,r,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(r=a[S],r!=null&&at(e,t,S,r,a,null))}function _0(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,U=null,K=null;for(Y in a){var W=a[Y];if(a.hasOwnProperty(Y)&&W!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":C=W;default:r.hasOwnProperty(Y)||at(e,t,Y,null,r,W)}}for(var H in r){var Y=r[H];if(W=a[H],r.hasOwnProperty(H)&&(Y!=null||W!=null))switch(H){case"type":d=Y;break;case"name":c=Y;break;case"checked":U=Y;break;case"defaultChecked":K=Y;break;case"value":x=Y;break;case"defaultValue":S=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:Y!==W&&at(e,t,H,Y,r,W)}}jo(e,x,S,C,U,K,d,c);return;case"select":Y=x=S=H=null;for(d in a)if(C=a[d],a.hasOwnProperty(d)&&C!=null)switch(d){case"value":break;case"multiple":Y=C;default:r.hasOwnProperty(d)||at(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":H=d;break;case"defaultValue":S=d;break;case"multiple":x=d;default:d!==C&&at(e,t,c,d,r,C)}t=S,a=x,r=Y,H!=null?Yl(e,!!a,H,!1):!!r!=!!a&&(t!=null?Yl(e,!!a,t,!0):Yl(e,!!a,a?[]:"",!1));return;case"textarea":Y=H=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:at(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":H=c;break;case"defaultValue":Y=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&at(e,t,x,c,r,d)}Cd(e,H,Y);return;case"option":for(var ge in a)H=a[ge],a.hasOwnProperty(ge)&&H!=null&&!r.hasOwnProperty(ge)&&(ge==="selected"?e.selected=!1:at(e,t,ge,null,r,H));for(C in r)H=r[C],Y=a[C],r.hasOwnProperty(C)&&H!==Y&&(H!=null||Y!=null)&&(C==="selected"?e.selected=H&&typeof H!="function"&&typeof H!="symbol":at(e,t,C,H,r,Y));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 Ce in a)H=a[Ce],a.hasOwnProperty(Ce)&&H!=null&&!r.hasOwnProperty(Ce)&&at(e,t,Ce,null,r,H);for(U in r)if(H=r[U],Y=a[U],r.hasOwnProperty(U)&&H!==Y&&(H!=null||Y!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(i(137,t));break;default:at(e,t,U,H,r,Y)}return;default:if(wo(t)){for(var nt in a)H=a[nt],a.hasOwnProperty(nt)&&H!==void 0&&!r.hasOwnProperty(nt)&&du(e,t,nt,void 0,r,H);for(K in r)H=r[K],Y=a[K],!r.hasOwnProperty(K)||H===Y||H===void 0&&Y===void 0||du(e,t,K,H,r,Y);return}}for(var D in a)H=a[D],a.hasOwnProperty(D)&&H!=null&&!r.hasOwnProperty(D)&&at(e,t,D,null,r,H);for(W in r)H=r[W],Y=a[W],!r.hasOwnProperty(W)||H===Y||H==null&&Y==null||at(e,t,W,H,r,Y)}function Dh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function j0(){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&&Dh(x)){for(x=0,S=c.responseEnd,r+=1;r<a.length;r++){var C=a[r],U=C.startTime;if(U>S)break;var K=C.transferSize,W=C.initiatorType;K&&Dh(W)&&(C=C.responseEnd,x+=K*(C<S?1:(S-U)/(C-U)))}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 fu=null,mu=null;function qi(e){return e.nodeType===9?e:e.ownerDocument}function Mh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function kh(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 hu(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 pu=null;function N0(){var e=window.event;return e&&e.type==="popstate"?e===pu?!1:(pu=e,!0):(pu=null,!1)}var Ah=typeof setTimeout=="function"?setTimeout:void 0,w0=typeof clearTimeout=="function"?clearTimeout:void 0,Lh=typeof Promise=="function"?Promise:void 0,E0=typeof queueMicrotask=="function"?queueMicrotask:typeof Lh<"u"?function(e){return Lh.resolve(null).then(e).catch(C0)}:Ah;function C0(e){setTimeout(function(){throw e})}function Kn(e){return e==="head"}function Uh(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),vr(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")us(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,us(a);for(var d=a.firstChild;d;){var x=d.nextSibling,S=d.nodeName;d[He]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=x}}else a==="body"&&us(e.ownerDocument.body);a=c}while(a);vr(t)}function Hh(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 gu(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":gu(a),rt(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function R0(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[He])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=Ea(e.nextSibling),e===null)break}return null}function z0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Ea(e.nextSibling),e===null))return null;return e}function Bh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ea(e.nextSibling),e===null))return null;return e}function xu(e){return e.data==="$?"||e.data==="$~"}function yu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function T0(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 Ea(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 vu=null;function qh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Ea(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Yh(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 $h(e,t,a){switch(t=qi(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 us(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rt(e)}var Ca=new Map,Vh=new Set;function Yi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bn=P.d;P.d={f:O0,r:D0,D:M0,C:k0,L:A0,m:L0,X:H0,S:U0,M:B0};function O0(){var e=bn.f(),t=Di();return e||t}function D0(e){var t=pt(e);t!==null&&t.tag===5&&t.type==="form"?sm(t):bn.r(e)}var gr=typeof document>"u"?null:document;function Gh(e,t,a){var r=gr;if(r&&typeof t=="string"&&t){var c=va(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Vh.has(c)||(Vh.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),$t(t,"link",e),ot(t),r.head.appendChild(t)))}}function M0(e){bn.D(e),Gh("dns-prefetch",e,null)}function k0(e,t){bn.C(e,t),Gh("preconnect",e,t)}function A0(e,t,a){bn.L(e,t,a);var r=gr;if(r&&e&&t){var c='link[rel="preload"][as="'+va(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+va(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+va(a.imageSizes)+'"]')):c+='[href="'+va(e)+'"]';var d=c;switch(t){case"style":d=xr(e);break;case"script":d=yr(e)}Ca.has(d)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ca.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(ds(d))||t==="script"&&r.querySelector(fs(d))||(t=r.createElement("link"),$t(t,"link",e),ot(t),r.head.appendChild(t)))}}function L0(e,t){bn.m(e,t);var a=gr;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+va(r)+'"][href="'+va(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=yr(e)}if(!Ca.has(d)&&(e=y({rel:"modulepreload",href:e},t),Ca.set(d,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fs(d)))return}r=a.createElement("link"),$t(r,"link",e),ot(r),a.head.appendChild(r)}}}function U0(e,t,a){bn.S(e,t,a);var r=gr;if(r&&e){var c=Ot(r).hoistableStyles,d=xr(e);t=t||"default";var x=c.get(d);if(!x){var S={loading:0,preload:null};if(x=r.querySelector(ds(d)))S.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ca.get(d))&&bu(e,a);var C=x=r.createElement("link");ot(C),$t(C,"link",e),C._p=new Promise(function(U,K){C.onload=U,C.onerror=K}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,$i(x,t,r)}x={type:"stylesheet",instance:x,count:1,state:S},c.set(d,x)}}}function H0(e,t){bn.X(e,t);var a=gr;if(a&&e){var r=Ot(a).hoistableScripts,c=yr(e),d=r.get(c);d||(d=a.querySelector(fs(c)),d||(e=y({src:e,async:!0},t),(t=Ca.get(c))&&Su(e,t),d=a.createElement("script"),ot(d),$t(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function B0(e,t){bn.M(e,t);var a=gr;if(a&&e){var r=Ot(a).hoistableScripts,c=yr(e),d=r.get(c);d||(d=a.querySelector(fs(c)),d||(e=y({src:e,async:!0,type:"module"},t),(t=Ca.get(c))&&Su(e,t),d=a.createElement("script"),ot(d),$t(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Kh(e,t,a,r){var c=(c=Se.current)?Yi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=xr(a.href),a=Ot(c).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=xr(a.href);var d=Ot(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(ds(e)))&&!d._p&&(x.instance=d,x.state.loading=5),Ca.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},Ca.set(e,a),d||q0(c,e,a,x.state))),t&&r===null)throw Error(i(528,""));return x}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=yr(a),a=Ot(c).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function xr(e){return'href="'+va(e)+'"'}function ds(e){return'link[rel="stylesheet"]['+e+"]"}function Xh(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function q0(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}),$t(t,"link",a),ot(t),e.head.appendChild(t))}function yr(e){return'[src="'+va(e)+'"]'}function fs(e){return"script[async]"+e}function Qh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+va(a.href)+'"]');if(r)return t.instance=r,ot(r),r;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),ot(r),$t(r,"style",c),$i(r,a.precedence,e),t.instance=r;case"stylesheet":c=xr(a.href);var d=e.querySelector(ds(c));if(d)return t.state.loading|=4,t.instance=d,ot(d),d;r=Xh(a),(c=Ca.get(c))&&bu(r,c),d=(e.ownerDocument||e).createElement("link"),ot(d);var x=d;return x._p=new Promise(function(S,C){x.onload=S,x.onerror=C}),$t(d,"link",r),t.state.loading|=4,$i(d,a.precedence,e),t.instance=d;case"script":return d=yr(a.src),(c=e.querySelector(fs(d)))?(t.instance=c,ot(c),c):(r=a,(c=Ca.get(d))&&(r=y({},a),Su(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),ot(c),$t(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,$i(r,a.precedence,e));return t.instance}function $i(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 bu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vi=null;function Zh(e,t,a){if(Vi===null){var r=new Map,c=Vi=new Map;c.set(a,r)}else c=Vi,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[He]||d[re]||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 Fh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Y0(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 Jh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $0(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=xr(r.href),d=t.querySelector(ds(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Gi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,ot(d);return}d=t.ownerDocument||t,r=Xh(r),(c=Ca.get(c))&&bu(r,c),d=d.createElement("link"),ot(d);var x=d;x._p=new Promise(function(S,C){x.onload=S,x.onerror=C}),$t(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=Gi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var _u=0;function V0(e,t){return e.stylesheets&&e.count===0&&Xi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Xi(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&_u===0&&(_u=62500*j0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xi(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>_u?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Gi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ki=null;function Xi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ki=new Map,t.forEach(G0,e),Ki=null,Gi.call(e))}function G0(e,t){if(!(t.state.loading&4)){var a=Ki.get(e);if(a)var r=a.get(null);else{a=new Map,Ki.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=Gi.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 ms={$$typeof:G,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function K0(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=Xa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xa(0),this.hiddenUpdates=Xa(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 Ph(e,t,a,r,c,d,x,S,C,U,K,W){return e=new K0(e,t,a,x,C,U,K,W,S),t=1,d===!0&&(t|=24),d=ca(3,null,null,t),e.current=d,d.stateNode=e,t=tc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:a,cache:t},rc(d),e}function Wh(e){return e?(e=Fl,e):Fl}function Ih(e,t,a,r,c,d){c=Wh(c),r.context===null?r.context=c:r.pendingContext=c,r=kn(t),r.payload={element:a},d=d===void 0?null:d,d!==null&&(r.callback=d),a=An(e,r,t),a!==null&&(ra(a,e,t),Kr(a,e,t))}function ep(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function ju(e,t){ep(e,t),(e=e.alternate)&&ep(e,t)}function tp(e){if(e.tag===13||e.tag===31){var t=fl(e,67108864);t!==null&&ra(t,e,67108864),ju(e,67108864)}}function ap(e){if(e.tag===13||e.tag===31){var t=ha();t=O(t);var a=fl(e,t);a!==null&&ra(a,e,t),ju(e,t)}}var Qi=!0;function X0(e,t,a,r){var c=M.T;M.T=null;var d=P.p;try{P.p=2,Nu(e,t,a,r)}finally{P.p=d,M.T=c}}function Q0(e,t,a,r){var c=M.T;M.T=null;var d=P.p;try{P.p=8,Nu(e,t,a,r)}finally{P.p=d,M.T=c}}function Nu(e,t,a,r){if(Qi){var c=wu(r);if(c===null)uu(e,t,r,Zi,a),lp(e,r);else if(F0(c,e,t,a,r))r.stopPropagation();else if(lp(e,r),t&4&&-1<Z0.indexOf(e)){for(;c!==null;){var d=pt(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var x=Qe(d.pendingLanes);if(x!==0){var S=d;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var C=1<<31-At(x);S.entanglements[1]|=C,x&=~C}Ia(d),(We&6)===0&&(Ti=kt()+500,is(0))}}break;case 31:case 13:S=fl(d,2),S!==null&&ra(S,d,2),Di(),ju(d,2)}if(d=wu(r),d===null&&uu(e,t,r,Zi,a),d===c)break;c=d}c!==null&&r.stopPropagation()}else uu(e,t,r,null,a)}}function wu(e){return e=Co(e),Eu(e)}var Zi=null;function Eu(e){if(Zi=null,e=ct(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 Zi=e,null}function np(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(Ma()){case ka:return 2;case En:return 8;case Ka:case ia:return 32;case It:return 268435456;default:return 32}default:return 32}}var Cu=!1,Xn=null,Qn=null,Zn=null,hs=new Map,ps=new Map,Fn=[],Z0="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 lp(e,t){switch(e){case"focusin":case"focusout":Xn=null;break;case"dragenter":case"dragleave":Qn=null;break;case"mouseover":case"mouseout":Zn=null;break;case"pointerover":case"pointerout":hs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ps.delete(t.pointerId)}}function gs(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=pt(t),t!==null&&tp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function F0(e,t,a,r,c){switch(t){case"focusin":return Xn=gs(Xn,e,t,a,r,c),!0;case"dragenter":return Qn=gs(Qn,e,t,a,r,c),!0;case"mouseover":return Zn=gs(Zn,e,t,a,r,c),!0;case"pointerover":var d=c.pointerId;return hs.set(d,gs(hs.get(d)||null,e,t,a,r,c)),!0;case"gotpointercapture":return d=c.pointerId,ps.set(d,gs(ps.get(d)||null,e,t,a,r,c)),!0}return!1}function rp(e){var t=ct(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,le(e.priority,function(){ap(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,le(e.priority,function(){ap(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 Fi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=wu(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Eo=r,a.target.dispatchEvent(r),Eo=null}else return t=pt(a),t!==null&&tp(t),e.blockedOn=a,!1;t.shift()}return!0}function sp(e,t,a){Fi(e)&&a.delete(t)}function J0(){Cu=!1,Xn!==null&&Fi(Xn)&&(Xn=null),Qn!==null&&Fi(Qn)&&(Qn=null),Zn!==null&&Fi(Zn)&&(Zn=null),hs.forEach(sp),ps.forEach(sp)}function Ji(e,t){e.blockedOn===t&&(e.blockedOn=null,Cu||(Cu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,J0)))}var Pi=null;function ip(e){Pi!==e&&(Pi=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Pi===e&&(Pi=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(Eu(r||a)===null)continue;break}var d=pt(a);d!==null&&(e.splice(t,3),t-=3,wc(d,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function vr(e){function t(C){return Ji(C,e)}Xn!==null&&Ji(Xn,e),Qn!==null&&Ji(Qn,e),Zn!==null&&Ji(Zn,e),hs.forEach(t),ps.forEach(t);for(var a=0;a<Fn.length;a++){var r=Fn[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fn.length&&(a=Fn[0],a.blockedOn===null);)rp(a),a.blockedOn===null&&Fn.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[me]||null;if(typeof d=="function")x||ip(a);else if(x){var S=null;if(d&&d.hasAttribute("formAction")){if(c=d,x=d[me]||null)S=x.formAction;else if(Eu(c)!==null)continue}else S=x.action;typeof S=="function"?a[r+1]=S:(a.splice(r,3),r-=3),ip(a)}}}function op(){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 Ru(e){this._internalRoot=e}Wi.prototype.render=Ru.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=ha();Ih(a,r,e,t,null,null)},Wi.prototype.unmount=Ru.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ih(e.current,2,null,e,null,null),Di(),t[he]=null}};function Wi(e){this._internalRoot=e}Wi.prototype.unstable_scheduleHydration=function(e){if(e){var t=te();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Fn.length&&t!==0&&t<Fn[a].priority;a++);Fn.splice(a,0,e),a===0&&rp(e)}};var cp=l.version;if(cp!=="19.2.4")throw Error(i(527,cp,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=h(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var P0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ii=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ii.isDisabled&&Ii.supportsFiber)try{Aa=Ii.inject(P0),Ht=Ii}catch{}}return vs.createRoot=function(e,t){if(!o(e))throw Error(i(299));var a=!1,r="",c=gm,d=xm,x=ym;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=Ph(e,1,!1,null,null,a,r,null,c,d,x,op),e[he]=t.current,cu(e),new Ru(t)},vs.hydrateRoot=function(e,t,a){if(!o(e))throw Error(i(299));var r=!1,c="",d=gm,x=xm,S=ym,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=Ph(e,1,!0,t,a??null,r,c,C,d,x,S,op),t.context=Wh(null),a=t.current,r=ha(),r=O(r),c=kn(r),c.callback=null,An(a,c,r),a=r,t.current.lanes=a,Qa(t,a),Ia(t),e[he]=t.current,cu(e),new Wi(t)},vs.version="19.2.4",vs}var qp;function pb(){if(qp)return Lu.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(),Lu.exports=hb(),Lu.exports}var gb=pb();var Qg=n=>{throw TypeError(n)},xb=(n,l,s)=>l.has(n)||Qg("Cannot "+s),qu=(n,l,s)=>(xb(n,l,"read from private field"),s?s.call(n):l.get(n)),yb=(n,l,s)=>l.has(n)?Qg("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,s),Yp="popstate";function $p(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function vb(n={}){function l(i,o){let u=o.state?.masked,{pathname:m,search:p,hash:g}=u||i.location;return zs("",{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:tn(o)}return Sb(l,s,null,n)}function Ue(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function vt(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function bb(){return Math.random().toString(36).substring(2,10)}function Vp(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 zs(n,l,s=null,i,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Nn(l):l,state:s,key:l&&l.key||i||bb(),unstable_mask:o}}function tn({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 Nn(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 Sb(n,l,s,i={}){let{window:o=document.defaultView,v5Compat:u=!1}=i,m=o.history,p="POP",g=null,h=b();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function b(){return(m.state||{idx:null}).idx}function y(){p="POP";let k=b(),X=k==null?null:k-h;h=k,g&&g({action:p,location:T.location,delta:X})}function _(k,X){p="PUSH";let F=$p(k)?k:zs(T.location,k,X);h=b()+1;let G=Vp(F,h),J=T.createHref(F.unstable_mask||F);try{m.pushState(G,"",J)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;o.location.assign(J)}u&&g&&g({action:p,location:T.location,delta:1})}function j(k,X){p="REPLACE";let F=$p(k)?k:zs(T.location,k,X);h=b();let G=Vp(F,h),J=T.createHref(F.unstable_mask||F);m.replaceState(G,"",J),u&&g&&g({action:p,location:T.location,delta:0})}function N(k){return Zg(k)}let T={get action(){return p},get location(){return n(o,m)},listen(k){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(Yp,y),g=k,()=>{o.removeEventListener(Yp,y),g=null}},createHref(k){return l(o,k)},createURL:N,encodeLocation(k){let X=N(k);return{pathname:X.pathname,search:X.search,hash:X.hash}},push:_,replace:j,go(k){return m.go(k)}};return T}function Zg(n,l=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),Ue(s,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:tn(n);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=s+i),new URL(i,s)}var js,Gp=class{constructor(n){if(yb(this,js,new Map),n)for(let[l,s]of n)this.set(l,s)}get(n){if(qu(this,js).has(n))return qu(this,js).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,l){qu(this,js).set(n,l)}};js=new WeakMap;var _b=new Set(["lazy","caseSensitive","path","id","index","children"]);function jb(n){return _b.has(n)}var Nb=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function wb(n){return Nb.has(n)}function Eb(n){return n.index===!0}function Ts(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(Ue(u.index!==!0||!u.children,"Cannot specify children on an index route"),Ue(o||!i[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),Eb(u)){let h={...u,id:g};return i[g]=Kp(h,l(h)),h}else{let h={...u,id:g,children:void 0};return i[g]=Kp(h,l(h)),u.children&&(h.children=Ts(u.children,l,p,i,o)),h}})}function Kp(n,l){return Object.assign(n,{...l,...typeof l.lazy=="object"&&l.lazy!=null?{lazy:{...n.lazy,...l.lazy}}:{}})}function Pn(n,l,s="/"){return Ns(n,l,s,!1)}function Ns(n,l,s,i){let o=typeof l=="string"?Nn(l):l,u=Ta(o.pathname||"/",s);if(u==null)return null;let m=Fg(n);Rb(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Bb(u);p=Ub(m[g],h,i)}return p}function Cb(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 Fg(n,l=[],s=[],i="",o=!1){let u=(m,p,g=o,h)=>{let b={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(i)&&g)return;Ue(b.relativePath.startsWith(i),`Absolute route path "${b.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(i.length)}let y=Ya([i,b.relativePath]),_=s.concat(b);m.children&&m.children.length>0&&(Ue(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Fg(m.children,l,_,y,g)),!(m.path==null&&!m.index)&&l.push({path:y,score:Ab(y,m.index),routesMeta:_})};return n.forEach((m,p)=>{if(m.path===""||!m.path?.includes("?"))u(m,p);else for(let g of Jg(m.path))u(m,p,!0,g)}),l}function Jg(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=Jg(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 Rb(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:Lb(l.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var zb=/^:[\w-]+$/,Tb=3,Ob=2,Db=1,Mb=10,kb=-2,Xp=n=>n==="*";function Ab(n,l){let s=n.split("/"),i=s.length;return s.some(Xp)&&(i+=kb),l&&(i+=Ob),s.filter(o=>!Xp(o)).reduce((o,u)=>o+(zb.test(u)?Tb:u===""?Db:Mb),i)}function Lb(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 Ub(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,b=u==="/"?l:l.slice(u.length)||"/",y=mo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},b),_=g.route;if(!y&&h&&s&&!i[i.length-1].route.index&&(y=mo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!y)return null;Object.assign(o,y.params),m.push({params:o,pathname:Ya([u,y.pathname]),pathnameBase:$b(Ya([u,y.pathnameBase])),route:_}),y.pathnameBase!=="/"&&(u=Ya([u,y.pathnameBase]))}return m}function mo(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=Hb(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:b,isOptional:y},_)=>{if(b==="*"){let N=p[_]||"";m=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const j=p[_];return y&&!j?h[b]=void 0:h[b]=(j||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:m,pattern:n}}function Hb(n,l=!1,s=!0){vt(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,b)=>{if(i.push({paramName:p,isOptional:g!=null}),g){let y=b.charAt(h+m.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,l?void 0:"i"),i]}function Bb(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return vt(!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 Ta(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 qb({basename:n,pathname:l}){return l==="/"?n:Ya([n,l])}var Pg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dd=n=>Pg.test(n);function Yb(n,l="/"){let{pathname:s,search:i="",hash:o=""}=typeof n=="string"?Nn(n):n,u;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?u=Qp(s.substring(1),"/"):u=Qp(s,l)):u=l,{pathname:u,search:Vb(i),hash:Gb(o)}}function Qp(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 Yu(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 Wg(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function xo(n){let l=Wg(n);return l.map((s,i)=>i===l.length-1?s.pathname:s.pathnameBase)}function ks(n,l,s,i=!1){let o;typeof n=="string"?o=Nn(n):(o={...n},Ue(!o.pathname||!o.pathname.includes("?"),Yu("?","pathname","search",o)),Ue(!o.pathname||!o.pathname.includes("#"),Yu("#","pathname","hash",o)),Ue(!o.search||!o.search.includes("#"),Yu("#","search","hash",o)));let u=n===""||o.pathname==="",m=u?"/":o.pathname,p;if(m==null)p=s;else{let y=l.length-1;if(!i&&m.startsWith("..")){let _=m.split("/");for(;_[0]==="..";)_.shift(),y-=1;o.pathname=_.join("/")}p=y>=0?l[y]:"/"}let g=Yb(o,p),h=m&&m!=="/"&&m.endsWith("/"),b=(u||m===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(h||b)&&(g.pathname+="/"),g}var Ya=n=>n.join("/").replace(/\/\/+/g,"/"),$b=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Vb=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Gb=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,As=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 Os(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Ls(n){return n.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ig=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ex(n,l){let s=n;if(typeof s!="string"||!Pg.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(Ig)try{let u=new URL(window.location.href),m=s.startsWith("//")?new URL(u.protocol+s):new URL(s),p=Ta(m.pathname,l);m.origin===u.origin&&p!=null?s=p+m.search+m.hash:o=!0}catch{vt(!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 In=Symbol("Uninstrumented");function Kb(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=Nr(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=Nr(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[In]??u,p=Nr(s[o],m,(...g)=>Zp(g[0]));p&&(o==="loader"&&m.hydrate===!0&&(p.hydrate=!0),p[In]=m,i[o]=p)}}),l.middleware&&l.middleware.length>0&&s.middleware.length>0&&(i.middleware=l.middleware.map(o=>{let u=o[In]??o,m=Nr(s.middleware,u,(...p)=>Zp(p[0]));return m?(m[In]=u,m):o})),i}function Xb(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[In]??n.navigate,o=Nr(s.navigate,i,(...u)=>{let[m,p]=u;return{to:typeof m=="number"||typeof m=="string"?m:m?tn(m):".",...Fp(n,p??{})}});o&&(o[In]=i,n.navigate=o)}if(s.fetch.length>0){let i=n.fetch[In]??n.fetch,o=Nr(s.fetch,i,(...u)=>{let[m,,p,g]=u;return{href:p??".",fetcherKey:m,...Fp(n,g??{})}});o&&(o[In]=i,n.fetch=o)}return n}function Nr(n,l,s){return n.length===0?null:async(...i)=>{let o=await tx(n,s(...i),()=>l(...i),n.length-1);if(o.type==="error")throw o.value;return o.value}}async function tx(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=tx(n,l,s,i-1),u=await m,Ue(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 Zp(n){let{request:l,context:s,params:i,unstable_pattern:o}=n;return{request:Qb(l),params:{...i},unstable_pattern:o,context:Zb(s)}}function Fp(n,l){return{currentUrl:tn(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 Qb(n){return{method:n.method,url:n.url,headers:{get:(...l)=>n.headers.get(...l)}}}function Zb(n){if(Jb(n)){let l={...n};return Object.freeze(l),l}else return{get:l=>n.get(l)}}var Fb=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jb(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")===Fb}var ax=["POST","PUT","PATCH","DELETE"],Pb=new Set(ax),Wb=["GET",...ax],Ib=new Set(Wb),nx=new Set([301,302,303,307,308]),e1=new Set([307,308]),$u={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},t1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bs={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},a1=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),lx="remix-router-transitions",rx=Symbol("ResetLoaderData");function n1(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";Ue(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=n.hydrationRouteProperties||[],o=n.mapRouteProperties||a1,u=o;if(n.unstable_instrumentations){let R=n.unstable_instrumentations;u=O=>({...o(O),...Kb(R.map(B=>B.route).filter(Boolean),O)})}let m={},p=Ts(n.routes,u,void 0,m),g,h=n.basename||"/";h.startsWith("/")||(h=`/${h}`);let b=n.dataStrategy||o1,y={...n.future},_=null,j=new Set,N=null,T=null,k=null,X=n.hydrationData!=null,F=Pn(p,n.history.location,h),G=!1,J=null,V,I;if(F==null&&!n.patchRoutesOnNavigation){let R=Ra(404,{pathname:n.history.location.pathname}),{matches:O,route:B}=to(p);V=!0,I=!V,F=O,J={[B.id]:R}}else if(F&&!n.hydrationData&&Xa(F,p,n.history.location.pathname).active&&(F=null),F)if(F.some(R=>R.route.lazy))V=!1,I=!V;else if(!F.some(R=>fd(R.route)))V=!0,I=!V;else{let R=n.hydrationData?n.hydrationData.loaderData:null,O=n.hydrationData?n.hydrationData.errors:null,B=F;if(O){let te=F.findIndex(le=>O[le.route.id]!==void 0);B=B.slice(0,te+1)}I=!1,V=B.every(te=>{let le=sx(te.route,R,O);return I=I||le.renderFallback,!le.shouldLoad})}else{V=!1,I=!V,F=[];let R=Xa(null,p,n.history.location.pathname);R.active&&R.matches&&(G=!0,F=R.matches)}let $,w={historyAction:n.history.action,location:n.history.location,matches:F,initialized:V,renderFallback:I,navigation:$u,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||J,fetchers:new Map,blockers:new Map},A="POP",Q=null,ue=!1,se,xe=!1,ae=new Map,ie=null,M=!1,P=!1,de=new Set,ce=new Map,Re=0,E=-1,q=new Map,ee=new Set,ne=new Map,ve=new Map,Se=new Set,ze=new Map,it,fe=null;function jt(){if(_=n.history.listen(({action:R,location:O,delta:B})=>{if(it){it(),it=void 0;return}vt(ze.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let te=ht({currentLocation:w.location,nextLocation:O,historyAction:R});if(te&&B!=null){let le=new Promise(pe=>{it=pe});n.history.go(B*-1),Pe(te,{state:"blocked",location:O,proceed(){Pe(te,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),le.then(()=>n.history.go(B))},reset(){let pe=new Map(w.blockers);pe.set(te,bs),De({blockers:pe})}}),Q?.resolve(),Q=null;return}return Gt(R,O)}),s){E1(l,ae);let R=()=>C1(l,ae);l.addEventListener("pagehide",R),ie=()=>l.removeEventListener("pagehide",R)}return w.initialized||Gt("POP",w.location,{initialHydration:!0}),$}function Mt(){_&&_(),ie&&ie(),j.clear(),se&&se.abort(),w.fetchers.forEach((R,O)=>Aa(O)),w.blockers.forEach((R,O)=>Ne(O))}function Te(R){return j.add(R),()=>j.delete(R)}function De(R,O={}){R.matches&&(R.matches=R.matches.map(le=>{let pe=m[le.route.id],re=le.route;return re.element!==pe.element||re.errorElement!==pe.errorElement||re.hydrateFallbackElement!==pe.hydrateFallbackElement?{...le,route:pe}:le})),w={...w,...R};let B=[],te=[];w.fetchers.forEach((le,pe)=>{le.state==="idle"&&(Se.has(pe)?B.push(pe):te.push(pe))}),Se.forEach(le=>{!w.fetchers.has(le)&&!ce.has(le)&&B.push(le)}),[...j].forEach(le=>le(w,{deletedFetchers:B,newErrors:R.errors??null,viewTransitionOpts:O.viewTransitionOpts,flushSync:O.flushSync===!0})),B.forEach(le=>Aa(le)),te.forEach(le=>w.fetchers.delete(le))}function Xe(R,O,{flushSync:B}={}){let te=w.actionData!=null&&w.navigation.formMethod!=null&&Qt(w.navigation.formMethod)&&w.navigation.state==="loading"&&R.state?._isRedirect!==!0,le;O.actionData?Object.keys(O.actionData).length>0?le=O.actionData:le=null:te?le=w.actionData:le=null;let pe=O.loaderData?rg(w.loaderData,O.loaderData,O.matches||[],O.errors):w.loaderData,re=w.blockers;re.size>0&&(re=new Map(re),re.forEach((we,be)=>re.set(be,bs)));let me=M?!1:sl(R,O.matches||w.matches),he=ue===!0||w.navigation.formMethod!=null&&Qt(w.navigation.formMethod)&&R.state?._isRedirect!==!0;g&&(p=g,g=void 0),M||A==="POP"||(A==="PUSH"?n.history.push(R,R.state):A==="REPLACE"&&n.history.replace(R,R.state));let _e;if(A==="POP"){let we=ae.get(w.location.pathname);we&&we.has(R.pathname)?_e={currentLocation:w.location,nextLocation:R}:ae.has(R.pathname)&&(_e={currentLocation:R,nextLocation:w.location})}else if(xe){let we=ae.get(w.location.pathname);we?we.add(R.pathname):(we=new Set([R.pathname]),ae.set(w.location.pathname,we)),_e={currentLocation:w.location,nextLocation:R}}De({...O,actionData:le,loaderData:pe,historyAction:A,location:R,initialized:!0,renderFallback:!1,navigation:$u,revalidation:"idle",restoreScrollPosition:me,preventScrollReset:he,blockers:re},{viewTransitionOpts:_e,flushSync:B===!0}),A="POP",ue=!1,xe=!1,M=!1,P=!1,Q?.resolve(),Q=null,fe?.resolve(),fe=null}async function lt(R,O){if(Q?.resolve(),Q=null,typeof R=="number"){Q||(Q=cg());let rt=Q.promise;return n.history.go(R),rt}let B=ed(w.location,w.matches,h,R,O?.fromRouteId,O?.relative),{path:te,submission:le,error:pe}=Jp(!1,B,O),re;O?.unstable_mask&&(re={pathname:"",search:"",hash:"",...typeof O.unstable_mask=="string"?Nn(O.unstable_mask):{...w.location.unstable_mask,...O.unstable_mask}});let me=w.location,he=zs(me,te,O&&O.state,void 0,re);he={...he,...n.history.encodeLocation(he)};let _e=O&&O.replace!=null?O.replace:void 0,we="PUSH";_e===!0?we="REPLACE":_e===!1||le!=null&&Qt(le.formMethod)&&le.formAction===w.location.pathname+w.location.search&&(we="REPLACE");let be=O&&"preventScrollReset"in O?O.preventScrollReset===!0:void 0,Ze=(O&&O.flushSync)===!0,He=ht({currentLocation:me,nextLocation:he,historyAction:we});if(He){Pe(He,{state:"blocked",location:he,proceed(){Pe(He,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),lt(R,O)},reset(){let rt=new Map(w.blockers);rt.set(He,bs),De({blockers:rt})}});return}await Gt(we,he,{submission:le,pendingError:pe,preventScrollReset:be,replace:O&&O.replace,enableViewTransition:O&&O.viewTransition,flushSync:Ze,callSiteDefaultShouldRevalidate:O&&O.unstable_defaultShouldRevalidate})}function Wt(){fe||(fe=cg()),Ka(),De({revalidation:"loading"});let R=fe.promise;return w.navigation.state==="submitting"?R:w.navigation.state==="idle"?(Gt(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),R):(Gt(A||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:xe===!0}),R)}async function Gt(R,O,B){se&&se.abort(),se=null,A=R,M=(B&&B.startUninterruptedRevalidation)===!0,rl(w.location,w.matches),ue=(B&&B.preventScrollReset)===!0,xe=(B&&B.enableViewTransition)===!0;let te=g||p,le=B&&B.overrideNavigation,pe=B?.initialHydration&&w.matches&&w.matches.length>0&&!G?w.matches:Pn(te,O,h),re=(B&&B.flushSync)===!0;if(pe&&w.initialized&&!P&&g1(w.location,O)&&!(B&&B.submission&&Qt(B.submission.formMethod))){Xe(O,{matches:pe},{flushSync:re});return}let me=Xa(pe,te,O.pathname);if(me.active&&me.matches&&(pe=me.matches),!pe){let{error:ct,notFoundMatches:pt,route:Ke}=Qe(O.pathname);Xe(O,{matches:pt,loaderData:{},errors:{[Ke.id]:ct}},{flushSync:re});return}se=new AbortController;let he=_r(n.history,O,se.signal,B&&B.submission),_e=n.getContext?await n.getContext():new Gp,we;if(B&&B.pendingError)we=[Wn(pe).route.id,{type:"error",error:B.pendingError}];else if(B&&B.submission&&Qt(B.submission.formMethod)){let ct=await Tt(he,O,B.submission,pe,_e,me.active,B&&B.initialHydration===!0,{replace:B.replace,flushSync:re});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[pt,Ke]=ct.pendingActionResult;if(pa(Ke)&&Os(Ke.error)&&Ke.error.status===404){se=null,Xe(O,{matches:ct.matches,loaderData:{},errors:{[pt]:Ke.error}});return}}pe=ct.matches||pe,we=ct.pendingActionResult,le=Vu(O,B.submission),re=!1,me.active=!1,he=_r(n.history,he.url,he.signal)}let{shortCircuited:be,matches:Ze,loaderData:He,errors:rt}=await sa(he,O,pe,_e,me.active,le,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,re,we,B&&B.callSiteDefaultShouldRevalidate);be||(se=null,Xe(O,{matches:Ze||pe,...sg(we),loaderData:He,errors:rt}))}async function Tt(R,O,B,te,le,pe,re,me={}){Ka();let he=N1(O,B);if(De({navigation:he},{flushSync:me.flushSync===!0}),pe){let be=await Qa(te,O.pathname,R.signal);if(be.type==="aborted")return{shortCircuited:!0};if(be.type==="error"){if(be.partialMatches.length===0){let{matches:He,route:rt}=to(p);return{matches:He,pendingActionResult:[rt.id,{type:"error",error:be.error}]}}let Ze=Wn(be.partialMatches).route.id;return{matches:be.partialMatches,pendingActionResult:[Ze,{type:"error",error:be.error}]}}else if(be.matches)te=be.matches;else{let{notFoundMatches:Ze,error:He,route:rt}=Qe(O.pathname);return{matches:Ze,pendingActionResult:[rt.id,{type:"error",error:He}]}}}let _e,we=so(te,O);if(!we.route.action&&!we.route.lazy)_e={type:"error",error:Ra(405,{method:R.method,pathname:O.pathname,routeId:we.route.id})};else{let be=wr(u,m,R,te,we,re?[]:i,le),Ze=await ka(R,be,le,null);if(_e=Ze[we.route.id],!_e){for(let He of te)if(Ze[He.route.id]){_e=Ze[He.route.id];break}}if(R.signal.aborted)return{shortCircuited:!0}}if(El(_e)){let be;return me&&me.replace!=null?be=me.replace:be=ag(_e.response.headers.get("Location"),new URL(R.url),h,n.history)===w.location.pathname+w.location.search,await Ma(R,_e,!0,{submission:B,replace:be}),{shortCircuited:!0}}if(pa(_e)){let be=Wn(te,we.route.id);return(me&&me.replace)!==!0&&(A="PUSH"),{matches:te,pendingActionResult:[be.route.id,_e,we.route.id]}}return{matches:te,pendingActionResult:[we.route.id,_e]}}async function sa(R,O,B,te,le,pe,re,me,he,_e,we,be,Ze){let He=pe||Vu(O,re),rt=re||me||og(He),ct=!M&&!_e;if(le){if(ct){let bt=ya(be);De({navigation:He,...bt!==void 0?{actionData:bt}:{}},{flushSync:we})}let Be=await Qa(B,O.pathname,R.signal);if(Be.type==="aborted")return{shortCircuited:!0};if(Be.type==="error"){if(Be.partialMatches.length===0){let{matches:Kt,route:wt}=to(p);return{matches:Kt,loaderData:{},errors:{[wt.id]:Be.error}}}let bt=Wn(Be.partialMatches).route.id;return{matches:Be.partialMatches,loaderData:{},errors:{[bt]:Be.error}}}else if(Be.matches)B=Be.matches;else{let{error:bt,notFoundMatches:Kt,route:wt}=Qe(O.pathname);return{matches:Kt,loaderData:{},errors:{[wt.id]:bt}}}}let pt=g||p,{dsMatches:Ke,revalidatingFetchers:Ot}=Pp(R,te,u,m,n.history,w,B,rt,O,_e?[]:i,_e===!0,P,de,Se,ne,ee,pt,h,n.patchRoutesOnNavigation!=null,be,Ze);if(E=++Re,!n.dataStrategy&&!Ke.some(Be=>Be.shouldLoad)&&!Ke.some(Be=>Be.route.middleware&&Be.route.middleware.length>0)&&Ot.length===0){let Be=Ll();return Xe(O,{matches:B,loaderData:{},errors:be&&pa(be[1])?{[be[0]]:be[1].error}:null,...sg(be),...Be?{fetchers:new Map(w.fetchers)}:{}},{flushSync:we}),{shortCircuited:!0}}if(ct){let Be={};if(!le){Be.navigation=He;let bt=ya(be);bt!==void 0&&(Be.actionData=bt)}Ot.length>0&&(Be.fetchers=Ga(Ot)),De(Be,{flushSync:we})}Ot.forEach(Be=>{Nt(Be.key),Be.controller&&ce.set(Be.key,Be.controller)});let ot=()=>Ot.forEach(Be=>Nt(Be.key));se&&se.signal.addEventListener("abort",ot);let{loaderResults:Cn,fetcherResults:Ua}=await En(Ke,Ot,R,te);if(R.signal.aborted)return{shortCircuited:!0};se&&se.signal.removeEventListener("abort",ot),Ot.forEach(Be=>ce.delete(Be.key));let Lt=ao(Cn);if(Lt)return await Ma(R,Lt.result,!0,{replace:he}),{shortCircuited:!0};if(Lt=ao(Ua),Lt)return ee.add(Lt.key),await Ma(R,Lt.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:Za,errors:il}=lg(w,B,Cn,be,Ot,Ua);_e&&w.errors&&(il={...w.errors,...il});let Fa=Ll(),ol=Ul(E),Hl=Fa||ol||Ot.length>0;return{matches:B,loaderData:Za,errors:il,...Hl?{fetchers:new Map(w.fetchers)}:{}}}function ya(R){if(R&&!pa(R[1]))return{[R[0]]:R[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Ga(R){return R.forEach(O=>{let B=w.fetchers.get(O.key),te=Ss(void 0,B?B.data:void 0);w.fetchers.set(O.key,te)}),new Map(w.fetchers)}async function nl(R,O,B,te){Nt(R);let le=(te&&te.flushSync)===!0,pe=g||p,re=ed(w.location,w.matches,h,B,O,te?.relative),me=Pn(pe,re,h),he=Xa(me,pe,re);if(he.active&&he.matches&&(me=he.matches),!me){It(R,O,Ra(404,{pathname:re}),{flushSync:le});return}let{path:_e,submission:we,error:be}=Jp(!0,re,te);if(be){It(R,O,be,{flushSync:le});return}let Ze=n.getContext?await n.getContext():new Gp,He=(te&&te.preventScrollReset)===!0;if(we&&Qt(we.formMethod)){await ll(R,O,_e,me,Ze,he.active,le,He,we,te&&te.unstable_defaultShouldRevalidate);return}ne.set(R,{routeId:O,path:_e}),await kt(R,O,_e,me,Ze,he.active,le,He,we)}async function ll(R,O,B,te,le,pe,re,me,he,_e){Ka(),ne.delete(R);let we=w.fetchers.get(R);ia(R,w1(he,we),{flushSync:re});let be=new AbortController,Ze=_r(n.history,B,be.signal,he);if(pe){let ut=await Qa(te,new URL(Ze.url).pathname,Ze.signal,R);if(ut.type==="aborted")return;if(ut.type==="error"){It(R,O,ut.error,{flushSync:re});return}else if(ut.matches)te=ut.matches;else{It(R,O,Ra(404,{pathname:B}),{flushSync:re});return}}let He=so(te,B);if(!He.route.action&&!He.route.lazy){let ut=Ra(405,{method:he.formMethod,pathname:B,routeId:O});It(R,O,ut,{flushSync:re});return}ce.set(R,be);let rt=Re,ct=wr(u,m,Ze,te,He,i,le),pt=await ka(Ze,ct,le,R),Ke=pt[He.route.id];if(!Ke){for(let ut of ct)if(pt[ut.route.id]){Ke=pt[ut.route.id];break}}if(Ze.signal.aborted){ce.get(R)===be&&ce.delete(R);return}if(Se.has(R)){if(El(Ke)||pa(Ke)){ia(R,Sn(void 0));return}}else{if(El(Ke))if(ce.delete(R),E>rt){ia(R,Sn(void 0));return}else return ee.add(R),ia(R,Ss(he)),Ma(Ze,Ke,!1,{fetcherSubmission:he,preventScrollReset:me});if(pa(Ke)){It(R,O,Ke.error);return}}let Ot=w.navigation.location||w.location,ot=_r(n.history,Ot,be.signal),Cn=g||p,Ua=w.navigation.state!=="idle"?Pn(Cn,w.navigation.location,h):w.matches;Ue(Ua,"Didn't find any matches after fetcher action");let Lt=++Re;q.set(R,Lt);let Za=Ss(he,Ke.data);w.fetchers.set(R,Za);let{dsMatches:il,revalidatingFetchers:Fa}=Pp(ot,le,u,m,n.history,w,Ua,he,Ot,i,!1,P,de,Se,ne,ee,Cn,h,n.patchRoutesOnNavigation!=null,[He.route.id,Ke],_e);Fa.filter(ut=>ut.key!==R).forEach(ut=>{let Bl=ut.key,ql=w.fetchers.get(Bl),Vs=Ss(void 0,ql?ql.data:void 0);w.fetchers.set(Bl,Vs),Nt(Bl),ut.controller&&ce.set(Bl,ut.controller)}),De({fetchers:new Map(w.fetchers)});let ol=()=>Fa.forEach(ut=>Nt(ut.key));be.signal.addEventListener("abort",ol);let{loaderResults:Hl,fetcherResults:Be}=await En(il,Fa,ot,le);if(be.signal.aborted)return;if(be.signal.removeEventListener("abort",ol),q.delete(R),ce.delete(R),Fa.forEach(ut=>ce.delete(ut.key)),w.fetchers.has(R)){let ut=Sn(Ke.data);w.fetchers.set(R,ut)}let bt=ao(Hl);if(bt)return Ma(ot,bt.result,!1,{preventScrollReset:me});if(bt=ao(Be),bt)return ee.add(bt.key),Ma(ot,bt.result,!1,{preventScrollReset:me});let{loaderData:Kt,errors:wt}=lg(w,Ua,Hl,void 0,Fa,Be);Ul(Lt),w.navigation.state==="loading"&&Lt>E?(Ue(A,"Expected pending action"),se&&se.abort(),Xe(w.navigation.location,{matches:Ua,loaderData:Kt,errors:wt,fetchers:new Map(w.fetchers)})):(De({errors:wt,loaderData:rg(w.loaderData,Kt,Ua,wt),fetchers:new Map(w.fetchers)}),P=!1)}async function kt(R,O,B,te,le,pe,re,me,he){let _e=w.fetchers.get(R);ia(R,Ss(he,_e?_e.data:void 0),{flushSync:re});let we=new AbortController,be=_r(n.history,B,we.signal);if(pe){let Ke=await Qa(te,new URL(be.url).pathname,be.signal,R);if(Ke.type==="aborted")return;if(Ke.type==="error"){It(R,O,Ke.error,{flushSync:re});return}else if(Ke.matches)te=Ke.matches;else{It(R,O,Ra(404,{pathname:B}),{flushSync:re});return}}let Ze=so(te,B);ce.set(R,we);let He=Re,rt=wr(u,m,be,te,Ze,i,le),pt=(await ka(be,rt,le,R))[Ze.route.id];if(ce.get(R)===we&&ce.delete(R),!be.signal.aborted){if(Se.has(R)){ia(R,Sn(void 0));return}if(El(pt))if(E>He){ia(R,Sn(void 0));return}else{ee.add(R),await Ma(be,pt,!1,{preventScrollReset:me});return}if(pa(pt)){It(R,O,pt.error);return}ia(R,Sn(pt.data))}}async function Ma(R,O,B,{submission:te,fetcherSubmission:le,preventScrollReset:pe,replace:re}={}){B||(Q?.resolve(),Q=null),O.response.headers.has("X-Remix-Revalidate")&&(P=!0);let me=O.response.headers.get("Location");Ue(me,"Expected a Location header on the redirect Response"),me=ag(me,new URL(R.url),h,n.history);let he=zs(w.location,me,{_isRedirect:!0});if(s){let rt=!1;if(O.response.headers.has("X-Remix-Reload-Document"))rt=!0;else if(dd(me)){const ct=Zg(me,!0);rt=ct.origin!==l.location.origin||Ta(ct.pathname,h)==null}if(rt){re?l.location.replace(me):l.location.assign(me);return}}se=null;let _e=re===!0||O.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:we,formAction:be,formEncType:Ze}=w.navigation;!te&&!le&&we&&be&&Ze&&(te=og(w.navigation));let He=te||le;if(e1.has(O.response.status)&&He&&Qt(He.formMethod))await Gt(_e,he,{submission:{...He,formAction:me},preventScrollReset:pe||ue,enableViewTransition:B?xe:void 0});else{let rt=Vu(he,te);await Gt(_e,he,{overrideNavigation:rt,fetcherSubmission:le,preventScrollReset:pe||ue,enableViewTransition:B?xe:void 0})}}async function ka(R,O,B,te){let le,pe={};try{le=await u1(b,R,O,te,B,!1)}catch(re){return O.filter(me=>me.shouldLoad).forEach(me=>{pe[me.route.id]={type:"error",error:re}}),pe}if(R.signal.aborted)return pe;if(!Qt(R.method))for(let re of O){if(le[re.route.id]?.type==="error")break;!le.hasOwnProperty(re.route.id)&&!w.loaderData.hasOwnProperty(re.route.id)&&(!w.errors||!w.errors.hasOwnProperty(re.route.id))&&re.shouldCallHandler()&&(le[re.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${re.route.id}`)})}for(let[re,me]of Object.entries(le))if(b1(me)){let he=me.result;pe[re]={type:"redirect",response:h1(he,R,re,O,h)}}else pe[re]=await m1(me);return pe}async function En(R,O,B,te){let le=ka(B,R,te,null),pe=Promise.all(O.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let we=(await ka(he.request,he.matches,te,he.key))[he.match.route.id];return{[he.key]:we}}else return Promise.resolve({[he.key]:{type:"error",error:Ra(404,{pathname:he.path})}})})),re=await le,me=(await pe).reduce((he,_e)=>Object.assign(he,_e),{});return{loaderResults:re,fetcherResults:me}}function Ka(){P=!0,ne.forEach((R,O)=>{ce.has(O)&&de.add(O),Nt(O)})}function ia(R,O,B={}){w.fetchers.set(R,O),De({fetchers:new Map(w.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function It(R,O,B,te={}){let le=Wn(w.matches,O);Aa(R),De({errors:{[le.route.id]:B},fetchers:new Map(w.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Al(R){return ve.set(R,(ve.get(R)||0)+1),Se.has(R)&&Se.delete(R),w.fetchers.get(R)||t1}function zr(R,O){Nt(R,O?.reason),ia(R,Sn(null))}function Aa(R){let O=w.fetchers.get(R);ce.has(R)&&!(O&&O.state==="loading"&&q.has(R))&&Nt(R),ne.delete(R),q.delete(R),ee.delete(R),Se.delete(R),de.delete(R),w.fetchers.delete(R)}function Ht(R){let O=(ve.get(R)||0)-1;O<=0?(ve.delete(R),Se.add(R)):ve.set(R,O),De({fetchers:new Map(w.fetchers)})}function Nt(R,O){let B=ce.get(R);B&&(B.abort(O),ce.delete(R))}function At(R){for(let O of R){let B=Al(O),te=Sn(B.data);w.fetchers.set(O,te)}}function Ll(){let R=[],O=!1;for(let B of ee){let te=w.fetchers.get(B);Ue(te,`Expected fetcher: ${B}`),te.state==="loading"&&(ee.delete(B),R.push(B),O=!0)}return At(R),O}function Ul(R){let O=[];for(let[B,te]of q)if(te<R){let le=w.fetchers.get(B);Ue(le,`Expected fetcher: ${B}`),le.state==="loading"&&(Nt(B),q.delete(B),O.push(B))}return At(O),O.length>0}function oe(R,O){let B=w.blockers.get(R)||bs;return ze.get(R)!==O&&ze.set(R,O),B}function Ne(R){w.blockers.delete(R),ze.delete(R)}function Pe(R,O){let B=w.blockers.get(R)||bs;Ue(B.state==="unblocked"&&O.state==="blocked"||B.state==="blocked"&&O.state==="blocked"||B.state==="blocked"&&O.state==="proceeding"||B.state==="blocked"&&O.state==="unblocked"||B.state==="proceeding"&&O.state==="unblocked",`Invalid blocker state transition: ${B.state} -> ${O.state}`);let te=new Map(w.blockers);te.set(R,O),De({blockers:te})}function ht({currentLocation:R,nextLocation:O,historyAction:B}){if(ze.size===0)return;ze.size>1&&vt(!1,"A router only supports one blocker at a time");let te=Array.from(ze.entries()),[le,pe]=te[te.length-1],re=w.blockers.get(le);if(!(re&&re.state==="proceeding")&&pe({currentLocation:R,nextLocation:O,historyAction:B}))return le}function Qe(R){let O=Ra(404,{pathname:R}),B=g||p,{matches:te,route:le}=to(B);return{notFoundMatches:te,route:le,error:O}}function an(R,O,B){if(N=R,k=O,T=B||null,!X&&w.navigation===$u){X=!0;let te=sl(w.location,w.matches);te!=null&&De({restoreScrollPosition:te})}return()=>{N=null,k=null,T=null}}function La(R,O){return T&&T(R,O.map(te=>Cb(te,w.loaderData)))||R.key}function rl(R,O){if(N&&k){let B=La(R,O);N[B]=k()}}function sl(R,O){if(N){let B=La(R,O),te=N[B];if(typeof te=="number")return te}return null}function Xa(R,O,B){if(n.patchRoutesOnNavigation)if(R){if(Object.keys(R[0].params).length>0)return{active:!0,matches:Ns(O,B,h,!0)}}else return{active:!0,matches:Ns(O,B,h,!0)||[]};return{active:!1,matches:null}}async function Qa(R,O,B,te){if(!n.patchRoutesOnNavigation)return{type:"success",matches:R};let le=R;for(;;){let pe=g==null,re=g||p,me=m;try{await n.patchRoutesOnNavigation({signal:B,path:O,matches:le,fetcherKey:te,patch:(we,be)=>{B.aborted||Wp(we,be,re,me,u,!1)}})}catch(we){return{type:"error",error:we,partialMatches:le}}finally{pe&&!B.aborted&&(p=[...p])}if(B.aborted)return{type:"aborted"};let he=Pn(re,O,h),_e=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(_e=Ns(re,O,h,!0),!(_e&&le.length<_e.length&&qs(le,_e.slice(0,le.length))))return{type:"success",matches:he}}if(_e||(_e=Ns(re,O,h,!0)),!_e||qs(le,_e))return{type:"success",matches:null};le=_e}}function qs(R,O){return R.length===O.length&&R.every((B,te)=>B.route.id===O[te].route.id)}function Ys(R){m={},g=Ts(R,u,void 0,m)}function $s(R,O,B=!1){let te=g==null;Wp(R,O,g||p,m,u,B),te&&(p=[...p],De({}))}return $={get basename(){return h},get future(){return y},get state(){return w},get routes(){return p},get window(){return l},initialize:jt,subscribe:Te,enableScrollRestoration:an,navigate:lt,fetch:nl,revalidate:Wt,createHref:R=>n.history.createHref(R),encodeLocation:R=>n.history.encodeLocation(R),getFetcher:Al,resetFetcher:zr,deleteFetcher:Ht,dispose:Mt,getBlocker:oe,deleteBlocker:Ne,patchRoutes:$s,_internalFetchControllers:ce,_internalSetRoutes:Ys,_internalSetStateDoNotUseOrYouWillBreakYourApp(R){De(R)}},n.unstable_instrumentations&&($=Xb($,n.unstable_instrumentations.map(R=>R.router).filter(Boolean))),$}function l1(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function ed(n,l,s,i,o,u){let m,p;if(o){m=[];for(let h of l)if(m.push(h),h.route.id===o){p=h;break}}else m=l,p=l[l.length-1];let g=ks(i||".",xo(m),Ta(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=hd(g.search);if(p.route.index&&!h)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&h){let b=new URLSearchParams(g.search),y=b.getAll("index");b.delete("index"),y.filter(j=>j).forEach(j=>b.append("index",j));let _=b.toString();g.search=_?`?${_}`:""}}return s!=="/"&&(g.pathname=qb({basename:s,pathname:g.pathname})),tn(g)}function Jp(n,l,s){if(!s||!l1(s))return{path:l};if(s.formMethod&&!j1(s.formMethod))return{path:l,error:Ra(405,{method:s.formMethod})};let i=()=>({path:l,error:Ra(400,{type:"invalid-body"})}),u=(s.formMethod||"get").toUpperCase(),m=fx(l);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!Qt(u))return i();let y=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((_,[j,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:y}}}else if(s.formEncType==="application/json"){if(!Qt(u))return i();try{let y=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:y,text:void 0}}}catch{return i()}}}Ue(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=ad(s.formData),g=s.formData;else if(s.body instanceof FormData)p=ad(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=ng(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=ng(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(Qt(h.formMethod))return{path:l,submission:h};let b=Nn(l);return n&&b.search&&hd(b.search)&&p.append("index",""),b.search=`?${p}`,{path:tn(b),submission:h}}function Pp(n,l,s,i,o,u,m,p,g,h,b,y,_,j,N,T,k,X,F,G,J){let V=G?pa(G[1])?G[1].error:G[1].data:void 0,I=o.createURL(u.location),$=o.createURL(g),w;if(b&&u.errors){let ie=Object.keys(u.errors)[0];w=m.findIndex(M=>M.route.id===ie)}else if(G&&pa(G[1])){let ie=G[0];w=m.findIndex(M=>M.route.id===ie)-1}let A=G?G[1].statusCode:void 0,Q=A&&A>=400,ue={currentUrl:I,currentParams:u.matches[0]?.params||{},nextUrl:$,nextParams:m[0].params,...p,actionResult:V,actionStatus:A},se=Ls(m),xe=m.map((ie,M)=>{let{route:P}=ie,de=null;if(w!=null&&M>w)de=!1;else if(P.lazy)de=!0;else if(!fd(P))de=!1;else if(b){let{shouldLoad:q}=sx(P,u.loaderData,u.errors);de=q}else r1(u.loaderData,u.matches[M],ie)&&(de=!0);if(de!==null)return td(s,i,n,se,ie,h,l,de);let ce=!1;typeof J=="boolean"?ce=J:Q?ce=!1:(y||I.pathname+I.search===$.pathname+$.search||I.search!==$.search||s1(u.matches[M],ie))&&(ce=!0);let Re={...ue,defaultShouldRevalidate:ce},E=Cs(ie,Re);return td(s,i,n,se,ie,h,l,E,Re,J)}),ae=[];return N.forEach((ie,M)=>{if(b||!m.some(ne=>ne.route.id===ie.routeId)||j.has(M))return;let P=u.fetchers.get(M),de=P&&P.state!=="idle"&&P.data===void 0,ce=Pn(k,ie.path,X);if(!ce){if(F&&de)return;ae.push({key:M,routeId:ie.routeId,path:ie.path,matches:null,match:null,request:null,controller:null});return}if(T.has(M))return;let Re=so(ce,ie.path),E=new AbortController,q=_r(o,ie.path,E.signal),ee=null;if(_.has(M))_.delete(M),ee=wr(s,i,q,ce,Re,h,l);else if(de)y&&(ee=wr(s,i,q,ce,Re,h,l));else{let ne;typeof J=="boolean"?ne=J:Q?ne=!1:ne=y;let ve={...ue,defaultShouldRevalidate:ne};Cs(Re,ve)&&(ee=wr(s,i,q,ce,Re,h,l,ve))}ee&&ae.push({key:M,routeId:ie.routeId,path:ie.path,matches:ee,match:Re,request:q,controller:E})}),{dsMatches:xe,revalidatingFetchers:ae}}function fd(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function sx(n,l,s){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!fd(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 r1(n,l,s){let i=!l||s.route.id!==l.route.id,o=!n.hasOwnProperty(s.route.id);return i||o}function s1(n,l){let s=n.route.path;return n.pathname!==l.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==l.params["*"]}function Cs(n,l){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(l);if(typeof s=="boolean")return s}return l.defaultShouldRevalidate}function Wp(n,l,s,i,o,u){let m;if(n){let h=i[n];Ue(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 b=m.find(y=>ix(h,y));b?g.push({existingRoute:b,newRoute:h}):p.push(h)}),p.length>0){let h=Ts(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:b,newRoute:y}=g[h],_=b,[j]=Ts([y],o,[],{},!0);Object.assign(_,{element:j.element?j.element:_.element,errorElement:j.errorElement?j.errorElement:_.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:_.hydrateFallbackElement})}}function ix(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=>ix(s,o)))??!1:!1}var Ip=new WeakMap,ox=({key:n,route:l,manifest:s,mapRouteProperties:i})=>{let o=s[l.id];if(Ue(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[n];if(!u)return;let m=Ip.get(o);m||(m={},Ip.set(o,m));let p=m[n];if(p)return p;let g=(async()=>{let h=jb(n),y=o[n]!==void 0&&n!=="hasErrorBoundary";if(h)vt(!h,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),m[n]=Promise.resolve();else if(y)vt(!1,`Route "${o.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let _=await u();_!=null&&(Object.assign(o,{[n]:_}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[n]=void 0,Object.values(o.lazy).every(_=>_===void 0)&&(o.lazy=void 0))})();return m[n]=g,g},eg=new WeakMap;function i1(n,l,s,i,o){let u=s[n.id];if(Ue(u,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let b=eg.get(u);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let y=(async()=>{Ue(typeof n.lazy=="function","No lazy route function found");let _=await n.lazy(),j={};for(let N in _){let T=_[N];if(T===void 0)continue;let k=wb(N),F=u[N]!==void 0&&N!=="hasErrorBoundary";k?vt(!k,"Route property "+N+" is not a supported property to be returned from a lazy route function. This property will be ignored."):F?vt(!F,`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.`):j[N]=T}Object.assign(u,j),Object.assign(u,{...i(u),lazy:void 0})})();return eg.set(u,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let m=Object.keys(n.lazy),p=[],g;for(let b of m){if(o&&o.includes(b))continue;let y=ox({key:b,route:n,manifest:s,mapRouteProperties:i});y&&(p.push(y),b===l&&(g=y))}let h=p.length>0?Promise.all(p).then(()=>{}):void 0;return h?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:g}}async function tg(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 o1(n){return n.matches.some(l=>l.route.middleware)?cx(n,()=>tg(n)):tg(n)}function cx(n,l){return c1(n,l,i=>{if(_1(i))throw i;return i},y1,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=Wn(m,m[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:i}})}}}async function c1(n,l,s,i,o){let{matches:u,request:m,params:p,context:g,unstable_pattern:h}=n,b=u.flatMap(_=>_.route.middleware?_.route.middleware.map(j=>[_.route.id,j]):[]);return await ux({request:m,params:p,context:g,unstable_pattern:h},b,l,s,i,o)}async function ux(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,b]=g,y,_=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await ux(n,l,s,i,o,u,m+1)},y.value}catch(j){return y={value:await u(j,h,y)},y.value}};try{let j=await b(n,_),N=j!=null?i(j):void 0;return o(N)?N:y?N??y.value:(y={value:await _()},y.value)}catch(j){return await u(j,h,y)}}function dx(n,l,s,i,o){let u=ox({key:"middleware",route:i.route,manifest:l,mapRouteProperties:n}),m=i1(i.route,Qt(s.method)?"action":"loader",l,n,o);return{middleware:u,route:m.lazyRoutePromise,handler:m.lazyHandlerPromise}}function td(n,l,s,i,o,u,m,p,g=null,h){let b=!1,y=dx(n,l,s,o,u);return{...o,_lazyPromises:y,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(_){return b=!0,g?typeof h=="boolean"?Cs(o,{...g,defaultShouldRevalidate:h}):typeof _=="boolean"?Cs(o,{...g,defaultShouldRevalidate:_}):Cs(o,g):p},resolve(_){let{lazy:j,loader:N,middleware:T}=o.route,k=b||p||_&&!Qt(s.method)&&(j||N),X=T&&T.length>0&&!N&&!j;return k&&(Qt(s.method)||!X)?d1({request:s,unstable_pattern:i,match:o,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:_,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function wr(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:dx(n,l,s,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:td(n,l,s,Ls(i),g,u,m,!0,p))}async function u1(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:Ls(s),params:s[0].params,context:o,matches:s},g=await n({...m,fetcherKey:i,runClientMiddleware:h=>{let b=m;return cx(b,()=>h({...b,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 d1({request:n,unstable_pattern:l,match:s,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:u,scopedContext:m}){let p,g,h=Qt(n.method),b=h?"action":"loader",y=_=>{let j,N=new Promise((X,F)=>j=F);g=()=>j(),n.signal.addEventListener("abort",g);let T=X=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${b}" [routeId: ${s.route.id}]`)):_({request:n,unstable_pattern:l,params:s.params,context:m},...X!==void 0?[X]:[]),k=(async()=>{try{return{type:"data",result:await(u?u(F=>T(F)):T())}}catch(X){return{type:"error",result:X}}})();return Promise.race([k,N])};try{let _=h?s.route.action:s.route.loader;if(i||o)if(_){let j,[N]=await Promise.all([y(_).catch(T=>{j=T}),i,o]);if(j!==void 0)throw j;p=N}else{await i;let j=h?s.route.action:s.route.loader;if(j)[p]=await Promise.all([y(j),o]);else if(b==="action"){let N=new URL(n.url),T=N.pathname+N.search;throw Ra(405,{method:n.method,pathname:T,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(_)p=await y(_);else{let j=new URL(n.url),N=j.pathname+j.search;throw Ra(404,{pathname:N})}}catch(_){return{type:"error",result:_}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function f1(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 m1(n){let{result:l,type:s}=n;if(md(l)){let i;try{i=await f1(l)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new As(l.status,l.statusText,i),statusCode:l.status,headers:l.headers}:{type:"data",data:i,statusCode:l.status,headers:l.headers}}return s==="error"?ig(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:x1(l),statusCode:Os(l)?l.status:void 0,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:l,statusCode:Os(l)?l.status:void 0}:ig(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 h1(n,l,s,i,o){let u=n.headers.get("Location");if(Ue(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!dd(u)){let m=i.slice(0,i.findIndex(p=>p.route.id===s)+1);u=ed(new URL(l.url),m,o,u),n.headers.set("Location",u)}return n}function ag(n,l,s,i){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(dd(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=Ta(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 _r(n,l,s,i){let o=n.createURL(fx(l)).toString(),u={signal:s};if(i&&Qt(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=ad(i.formData):u.body=i.formData}return new Request(o,u)}function ad(n){let l=new URLSearchParams;for(let[s,i]of n.entries())l.append(s,typeof i=="string"?i:i.name);return l}function ng(n){let l=new FormData;for(let[s,i]of n.entries())l.append(s,i);return l}function p1(n,l,s,i=!1,o=!1){let u={},m=null,p,g=!1,h={},b=s&&pa(s[1])?s[1].error:void 0;return n.forEach(y=>{if(!(y.route.id in l))return;let _=y.route.id,j=l[_];if(Ue(!El(j),"Cannot handle redirect results in processLoaderData"),pa(j)){let N=j.error;if(b!==void 0&&(N=b,b=void 0),m=m||{},o)m[_]=N;else{let T=Wn(n,_);m[T.route.id]==null&&(m[T.route.id]=N)}i||(u[_]=rx),g||(g=!0,p=Os(j.error)?j.error.status:500),j.headers&&(h[_]=j.headers)}else u[_]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(h[_]=j.headers)}),b!==void 0&&s&&(m={[s[0]]:b},s[2]&&(u[s[2]]=void 0)),{loaderData:u,errors:m,statusCode:p||200,loaderHeaders:h}}function lg(n,l,s,i,o,u){let{loaderData:m,errors:p}=p1(l,s,i);return o.filter(g=>!g.matches||g.matches.some(h=>h.shouldLoad)).forEach(g=>{let{key:h,match:b,controller:y}=g;if(y&&y.signal.aborted)return;let _=u[h];if(Ue(_,"Did not find corresponding fetcher result"),pa(_)){let j=Wn(n.matches,b?.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:_.error}),n.fetchers.delete(h)}else if(El(_))Ue(!1,"Unhandled fetcher revalidation redirect");else{let j=Sn(_.data);n.fetchers.set(h,j)}}),{loaderData:m,errors:p}}function rg(n,l,s,i){let o=Object.entries(l).filter(([,u])=>u!==rx).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 sg(n){return n?pa(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function Wn(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 to(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 Ra(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 As(n||500,m,new Error(p),!0)}function ao(n){let l=Object.entries(n);for(let s=l.length-1;s>=0;s--){let[i,o]=l[s];if(El(o))return{key:i,result:o}}}function fx(n){let l=typeof n=="string"?Nn(n):n;return tn({...l,hash:""})}function g1(n,l){return n.pathname!==l.pathname||n.search!==l.search?!1:n.hash===""?l.hash!=="":n.hash===l.hash?!0:l.hash!==""}function x1(n){return new As(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)}function y1(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([l,s])=>typeof l=="string"&&v1(s))}function v1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function b1(n){return md(n.result)&&nx.has(n.result.status)}function pa(n){return n.type==="error"}function El(n){return(n&&n.type)==="redirect"}function ig(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function md(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function S1(n){return nx.has(n)}function _1(n){return md(n)&&S1(n.status)&&n.headers.has("Location")}function j1(n){return Ib.has(n.toUpperCase())}function Qt(n){return Pb.has(n.toUpperCase())}function hd(n){return new URLSearchParams(n).getAll("index").some(l=>l==="")}function so(n,l){let s=typeof l=="string"?Nn(l).search:l.search;if(n[n.length-1].route.index&&hd(s||""))return n[n.length-1];let i=Wg(n);return i[i.length-1]}function og(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 Vu(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 N1(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 Ss(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 w1(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 Sn(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 E1(n,l){try{let s=n.sessionStorage.getItem(lx);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 C1(n,l){if(l.size>0){let s={};for(let[i,o]of l)s[i]=[...o];try{n.sessionStorage.setItem(lx,JSON.stringify(s))}catch(i){vt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function cg(){let n,l,s=new Promise((i,o)=>{n=async u=>{i(u);try{await s}catch{}},l=async u=>{o(u);try{await s}catch{}}});return{promise:s,resolve:n,reject:l}}var Ol=v.createContext(null);Ol.displayName="DataRouter";var Us=v.createContext(null);Us.displayName="DataRouterState";var mx=v.createContext(!1);function R1(){return v.useContext(mx)}var pd=v.createContext({isTransitioning:!1});pd.displayName="ViewTransition";var hx=v.createContext(new Map);hx.displayName="Fetchers";var z1=v.createContext(null);z1.displayName="Await";var xa=v.createContext(null);xa.displayName="Navigation";var yo=v.createContext(null);yo.displayName="Location";var Oa=v.createContext({outlet:null,matches:[],isDataRoute:!1});Oa.displayName="Route";var gd=v.createContext(null);gd.displayName="RouteError";var px="REACT_ROUTER_ERROR",T1="REDIRECT",O1="ROUTE_ERROR_RESPONSE";function D1(n){if(n.startsWith(`${px}:${T1}:{`))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 M1(n){if(n.startsWith(`${px}:${O1}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new As(l.status,l.statusText,l.data)}catch{}}function k1(n,{relative:l}={}){Ue(Er(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=v.useContext(xa),{hash:o,pathname:u,search:m}=Bs(n,{relative:l}),p=u;return s!=="/"&&(p=u==="/"?s:Ya([s,u])),i.createHref({pathname:p,search:m,hash:o})}function Er(){return v.useContext(yo)!=null}function Va(){return Ue(Er(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(yo).location}var gx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function xx(n){v.useContext(xa).static||v.useLayoutEffect(n)}function wn(){let{isDataRoute:n}=v.useContext(Oa);return n?F1():A1()}function A1(){Ue(Er(),"useNavigate() may be used only in the context of a <Router> component.");let n=v.useContext(Ol),{basename:l,navigator:s}=v.useContext(xa),{matches:i}=v.useContext(Oa),{pathname:o}=Va(),u=JSON.stringify(xo(i)),m=v.useRef(!1);return xx(()=>{m.current=!0}),v.useCallback((g,h={})=>{if(vt(m.current,gx),!m.current)return;if(typeof g=="number"){s.go(g);return}let b=ks(g,JSON.parse(u),o,h.relative==="path");n==null&&l!=="/"&&(b.pathname=b.pathname==="/"?l:Ya([l,b.pathname])),(h.replace?s.replace:s.push)(b,h.state,h)},[l,s,u,o,n])}var L1=v.createContext(null);function U1(n){let l=v.useContext(Oa).outlet;return v.useMemo(()=>l&&v.createElement(L1.Provider,{value:n},l),[l,n])}function Hs(){let{matches:n}=v.useContext(Oa),l=n[n.length-1];return l?l.params:{}}function Bs(n,{relative:l}={}){let{matches:s}=v.useContext(Oa),{pathname:i}=Va(),o=JSON.stringify(xo(s));return v.useMemo(()=>ks(n,JSON.parse(o),i,l==="path"),[n,o,i,l])}function H1(n,l,s){Ue(Er(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(xa),{matches:o}=v.useContext(Oa),u=o[o.length-1],m=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",h=u&&u.route;{let k=h&&h.path||"";vx(p,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${k}">) 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="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let b=Va(),y;y=b;let _=y.pathname||"/",j=_;if(g!=="/"){let k=g.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let N=Pn(n,{pathname:j});return vt(h||N!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),vt(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 "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),V1(N&&N.map(k=>Object.assign({},k,{params:Object.assign({},m,k.params),pathname:Ya([g,i.encodeLocation?i.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?g:Ya([g,i.encodeLocation?i.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),o,s)}function B1(){let n=Z1(),l=Os(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=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:u},"ErrorBoundary")," or"," ",v.createElement("code",{style:u},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},l),s?v.createElement("pre",{style:o},s):null,m)}var q1=v.createElement(B1,null),yx=class extends v.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=M1(n.digest);s&&(n=s)}let l=n!==void 0?v.createElement(Oa.Provider,{value:this.props.routeContext},v.createElement(gd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?v.createElement(Y1,{error:n},l):l}};yx.contextType=mx;var Gu=new WeakMap;function Y1({children:n,error:l}){let{basename:s}=v.useContext(xa);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=D1(l.digest);if(i){let o=Gu.get(l);if(o)throw o;let u=ex(i.location,s);if(Ig&&!Gu.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 Gu.set(l,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function $1({routeContext:n,match:l,children:s}){let i=v.useContext(Ol);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),v.createElement(Oa.Provider,{value:n},s)}function V1(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 b=o.findIndex(y=>y.route.id&&u?.[y.route.id]!==void 0);Ue(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let m=!1,p=-1;if(s&&i){m=i.renderFallback;for(let b=0;b<o.length;b++){let y=o[b];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=b),y.route.id){let{loaderData:_,errors:j}=i,N=y.route.loader&&!_.hasOwnProperty(y.route.id)&&(!j||j[y.route.id]===void 0);if(y.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?(b,y)=>{g(b,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Ls(i.matches),errorInfo:y})}:void 0;return o.reduceRight((b,y,_)=>{let j,N=!1,T=null,k=null;i&&(j=u&&y.route.id?u[y.route.id]:void 0,T=y.route.errorElement||q1,m&&(p<0&&_===0?(vx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,k=null):p===_&&(N=!0,k=y.route.hydrateFallbackElement||null)));let X=l.concat(o.slice(0,_+1)),F=()=>{let G;return j?G=T:N?G=k:y.route.Component?G=v.createElement(y.route.Component,null):y.route.element?G=y.route.element:G=b,v.createElement($1,{match:y,routeContext:{outlet:b,matches:X,isDataRoute:i!=null},children:G})};return i&&(y.route.ErrorBoundary||y.route.errorElement||_===0)?v.createElement(yx,{location:i.location,revalidation:i.revalidation,component:T,error:j,children:F(),routeContext:{outlet:null,matches:X,isDataRoute:!0},onError:h}):F()},null)}function xd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function G1(n){let l=v.useContext(Ol);return Ue(l,xd(n)),l}function K1(n){let l=v.useContext(Us);return Ue(l,xd(n)),l}function X1(n){let l=v.useContext(Oa);return Ue(l,xd(n)),l}function yd(n){let l=X1(n),s=l.matches[l.matches.length-1];return Ue(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function Q1(){return yd("useRouteId")}function Z1(){let n=v.useContext(gd),l=K1("useRouteError"),s=yd("useRouteError");return n!==void 0?n:l.errors?.[s]}function F1(){let{router:n}=G1("useNavigate"),l=yd("useNavigate"),s=v.useRef(!1);return xx(()=>{s.current=!0}),v.useCallback(async(o,u={})=>{vt(s.current,gx),s.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:l,...u}))},[n,l])}var ug={};function vx(n,l,s){!l&&!ug[n]&&(ug[n]=!0,vt(!1,s))}var dg={};function fg(n,l){!n&&!dg[l]&&(dg[l]=!0,console.warn(l))}var J1="useOptimistic",mg=Ev[J1],P1=()=>{};function W1(n){return mg?mg(n):[n,P1]}function I1(n){let l={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&vt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(l,{element:v.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&vt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(l,{hydrateFallbackElement:v.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&vt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(l,{errorElement:v.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),l}var e4=["HydrateFallback","hydrateFallbackElement"],t4=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 a4({router:n,flushSync:l,onError:s,unstable_useTransitions:i}){i=R1()||i;let[u,m]=v.useState(n.state),[p,g]=W1(u),[h,b]=v.useState(),[y,_]=v.useState({isTransitioning:!1}),[j,N]=v.useState(),[T,k]=v.useState(),[X,F]=v.useState(),G=v.useRef(new Map),J=v.useCallback((w,{deletedFetchers:A,newErrors:Q,flushSync:ue,viewTransitionOpts:se})=>{Q&&s&&Object.values(Q).forEach(ae=>s(ae,{location:w.location,params:w.matches[0]?.params??{},unstable_pattern:Ls(w.matches)})),w.fetchers.forEach((ae,ie)=>{ae.data!==void 0&&G.current.set(ie,ae.data)}),A.forEach(ae=>G.current.delete(ae)),fg(ue===!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 xe=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(fg(se==null||xe,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!se||!xe){l&&ue?l(()=>m(w)):i===!1?m(w):v.startTransition(()=>{i===!0&&g(ae=>hg(ae,w)),m(w)});return}if(l&&ue){l(()=>{T&&(j?.resolve(),T.skipTransition()),_({isTransitioning:!0,flushSync:!0,currentLocation:se.currentLocation,nextLocation:se.nextLocation})});let ae=n.window.document.startViewTransition(()=>{l(()=>m(w))});ae.finished.finally(()=>{l(()=>{N(void 0),k(void 0),b(void 0),_({isTransitioning:!1})})}),l(()=>k(ae));return}T?(j?.resolve(),T.skipTransition(),F({state:w,currentLocation:se.currentLocation,nextLocation:se.nextLocation})):(b(w),_({isTransitioning:!0,flushSync:!1,currentLocation:se.currentLocation,nextLocation:se.nextLocation}))},[n.window,l,T,j,i,g,s]);v.useLayoutEffect(()=>n.subscribe(J),[n,J]),v.useEffect(()=>{y.isTransitioning&&!y.flushSync&&N(new t4)},[y]),v.useEffect(()=>{if(j&&h&&n.window){let w=h,A=j.promise,Q=n.window.document.startViewTransition(async()=>{i===!1?m(w):v.startTransition(()=>{i===!0&&g(ue=>hg(ue,w)),m(w)}),await A});Q.finished.finally(()=>{N(void 0),k(void 0),b(void 0),_({isTransitioning:!1})}),k(Q)}},[h,j,n.window,i,g]),v.useEffect(()=>{j&&h&&p.location.key===h.location.key&&j.resolve()},[j,T,p.location,h]),v.useEffect(()=>{!y.isTransitioning&&X&&(b(X.state),_({isTransitioning:!0,flushSync:!1,currentLocation:X.currentLocation,nextLocation:X.nextLocation}),F(void 0))},[y.isTransitioning,X]);let V=v.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:w=>n.navigate(w),push:(w,A,Q)=>n.navigate(w,{state:A,preventScrollReset:Q?.preventScrollReset}),replace:(w,A,Q)=>n.navigate(w,{replace:!0,state:A,preventScrollReset:Q?.preventScrollReset})}),[n]),I=n.basename||"/",$=v.useMemo(()=>({router:n,navigator:V,static:!1,basename:I,onError:s}),[n,V,I,s]);return v.createElement(v.Fragment,null,v.createElement(Ol.Provider,{value:$},v.createElement(Us.Provider,{value:p},v.createElement(hx.Provider,{value:G.current},v.createElement(pd.Provider,{value:y},v.createElement(r4,{basename:I,location:p.location,navigationType:p.historyAction,navigator:V,unstable_useTransitions:i},v.createElement(n4,{routes:n.routes,future:n.future,state:p,isStatic:!1,onError:s})))))),null)}function hg(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 n4=v.memo(l4);function l4({routes:n,future:l,state:s,isStatic:i,onError:o}){return H1(n,void 0,{state:s,isStatic:i,onError:o})}function pg({to:n,replace:l,state:s,relative:i}){Ue(Er(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=v.useContext(xa);vt(!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}=v.useContext(Oa),{pathname:m}=Va(),p=wn(),g=ks(n,xo(u),m,i==="path"),h=JSON.stringify(g);return v.useEffect(()=>{p(JSON.parse(h),{replace:l,state:s,relative:i})},[p,h,i,l,s]),null}function bx(n){return U1(n.context)}function r4({basename:n="/",children:l=null,location:s,navigationType:i="POP",navigator:o,static:u=!1,unstable_useTransitions:m}){Ue(!Er(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=v.useMemo(()=>({basename:p,navigator:o,static:u,unstable_useTransitions:m,future:{}}),[p,o,u,m]);typeof s=="string"&&(s=Nn(s));let{pathname:h="/",search:b="",hash:y="",state:_=null,key:j="default",unstable_mask:N}=s,T=v.useMemo(()=>{let k=Ta(h,p);return k==null?null:{location:{pathname:k,search:b,hash:y,state:_,key:j,unstable_mask:N},navigationType:i}},[p,h,b,y,_,j,i,N]);return vt(T!=null,`<Router basename="${p}"> is not able to match the URL "${h}${b}${y}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:v.createElement(xa.Provider,{value:g},v.createElement(yo.Provider,{children:l,value:T}))}var io="get",oo="application/x-www-form-urlencoded";function vo(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function s4(n){return vo(n)&&n.tagName.toLowerCase()==="button"}function i4(n){return vo(n)&&n.tagName.toLowerCase()==="form"}function o4(n){return vo(n)&&n.tagName.toLowerCase()==="input"}function c4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function u4(n,l){return n.button===0&&(!l||l==="_self")&&!c4(n)}function nd(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 d4(n,l){let s=nd(n);return l&&l.forEach((i,o)=>{s.has(o)||l.getAll(o).forEach(u=>{s.append(o,u)})}),s}var no=null;function f4(){if(no===null)try{new FormData(document.createElement("form"),0),no=!1}catch{no=!0}return no}var m4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ku(n){return n!=null&&!m4.has(n)?(vt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oo}"`),null):n}function h4(n,l){let s,i,o,u,m;if(i4(n)){let p=n.getAttribute("action");i=p?Ta(p,l):null,s=n.getAttribute("method")||io,o=Ku(n.getAttribute("enctype"))||oo,u=new FormData(n)}else if(s4(n)||o4(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?Ta(g,l):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||io,o=Ku(n.getAttribute("formenctype"))||Ku(p.getAttribute("enctype"))||oo,u=new FormData(p,n),!f4()){let{name:h,type:b,value:y}=n;if(b==="image"){let _=h?`${h}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else h&&u.append(h,y)}}else{if(vo(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=io,i=null,o=oo,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 vd(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function p4(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&&Ta(o.pathname,l)==="/"?o.pathname=`${l.replace(/\/$/,"")}/_root.${i}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${i}`,o}async function g4(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 x4(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 y4(n,l,s){let i=await Promise.all(n.map(async o=>{let u=l.routes[o.route.id];if(u){let m=await g4(u,s);return m.links?m.links():[]}return[]}));return _4(i.flat(1).filter(x4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function gg(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 b=i.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let y=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function v4(n,l,{includeHydrateFallback:s}={}){return b4(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 b4(n){return[...new Set(n)]}function S4(n){let l={},s=Object.keys(n).sort();for(let i of s)l[i]=n[i];return l}function _4(n,l){let s=new Set;return new Set(l),n.reduce((i,o)=>{let u=JSON.stringify(S4(o));return s.has(u)||(s.add(u),i.push({key:u,link:o})),i},[])}function Sx(){let n=v.useContext(Ol);return vd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function j4(){let n=v.useContext(Us);return vd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var bd=v.createContext(void 0);bd.displayName="FrameworkContext";function _x(){let n=v.useContext(bd);return vd(n,"You must render this element inside a <HydratedRouter> element"),n}function N4(n,l){let s=v.useContext(bd),[i,o]=v.useState(!1),[u,m]=v.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:b,onTouchStart:y}=l,_=v.useRef(null);v.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let T=X=>{X.forEach(F=>{m(F.isIntersecting)})},k=new IntersectionObserver(T,{threshold:.5});return _.current&&k.observe(_.current),()=>{k.disconnect()}}},[n]),v.useEffect(()=>{if(i){let T=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(T)}}},[i]);let j=()=>{o(!0)},N=()=>{o(!1),m(!1)};return s?n!=="intent"?[u,_,{}]:[u,_,{onFocus:_s(p,j),onBlur:_s(g,N),onMouseEnter:_s(h,j),onMouseLeave:_s(b,N),onTouchStart:_s(y,j)}]:[!1,_,{}]}function _s(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function w4({page:n,...l}){let{router:s}=Sx(),i=v.useMemo(()=>Pn(s.routes,n,s.basename),[s.routes,n,s.basename]);return i?v.createElement(C4,{page:n,matches:i,...l}):null}function E4(n){let{manifest:l,routeModules:s}=_x(),[i,o]=v.useState([]);return v.useEffect(()=>{let u=!1;return y4(n,l,s).then(m=>{u||o(m)}),()=>{u=!0}},[n,l,s]),i}function C4({page:n,matches:l,...s}){let i=Va(),{future:o,manifest:u,routeModules:m}=_x(),{basename:p}=Sx(),{loaderData:g,matches:h}=j4(),b=v.useMemo(()=>gg(n,l,h,u,i,"data"),[n,l,h,u,i]),y=v.useMemo(()=>gg(n,l,h,u,i,"assets"),[n,l,h,u,i]),_=v.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let T=new Set,k=!1;if(l.forEach(F=>{let G=u.routes[F.route.id];!G||!G.hasLoader||(!b.some(J=>J.route.id===F.route.id)&&F.route.id in g&&m[F.route.id]?.shouldRevalidate||G.hasClientLoader?k=!0:T.add(F.route.id))}),T.size===0)return[];let X=p4(n,p,o.unstable_trailingSlashAwareDataRequests,"data");return k&&T.size>0&&X.searchParams.set("_routes",l.filter(F=>T.has(F.route.id)).map(F=>F.route.id).join(",")),[X.pathname+X.search]},[p,o.unstable_trailingSlashAwareDataRequests,g,i,u,b,l,n,m]),j=v.useMemo(()=>v4(y,u),[y,u]),N=E4(y);return v.createElement(v.Fragment,null,_.map(T=>v.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...s})),j.map(T=>v.createElement("link",{key:T,rel:"modulepreload",href:T,...s})),N.map(({key:T,link:k})=>v.createElement("link",{key:T,nonce:s.nonce,...k,crossOrigin:k.crossOrigin??s.crossOrigin})))}function R4(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var z4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{z4&&(window.__reactRouterVersion="7.13.1")}catch{}function T4(n,l){return n1({basename:l?.basename,getContext:l?.getContext,future:l?.future,history:vb({window:l?.window}),hydrationData:O4(),routes:n,mapRouteProperties:I1,hydrationRouteProperties:e4,dataStrategy:l?.dataStrategy,patchRoutesOnNavigation:l?.patchRoutesOnNavigation,window:l?.window,unstable_instrumentations:l?.unstable_instrumentations}).initialize()}function O4(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:D4(n.errors)}),n}function D4(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 As(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 jx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ga=v.forwardRef(function({onClick:l,discover:s="render",prefetch:i="none",relative:o,reloadDocument:u,replace:m,unstable_mask:p,state:g,target:h,to:b,preventScrollReset:y,viewTransition:_,unstable_defaultShouldRevalidate:j,...N},T){let{basename:k,navigator:X,unstable_useTransitions:F}=v.useContext(xa),G=typeof b=="string"&&jx.test(b),J=ex(b,k);b=J.to;let V=k1(b,{relative:o}),I=Va(),$=null;if(p){let ie=ks(p,[],I.unstable_mask?I.unstable_mask.pathname:"/",!0);k!=="/"&&(ie.pathname=ie.pathname==="/"?k:Ya([k,ie.pathname])),$=X.createHref(ie)}let[w,A,Q]=N4(i,N),ue=A4(b,{replace:m,unstable_mask:p,state:g,target:h,preventScrollReset:y,relative:o,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:F});function se(ie){l&&l(ie),ie.defaultPrevented||ue(ie)}let xe=!(J.isExternal||u),ae=v.createElement("a",{...N,...Q,href:(xe?$:void 0)||J.absoluteURL||V,onClick:xe?se:l,ref:R4(T,A),target:h,"data-discover":!G&&s==="render"?"true":void 0});return w&&!G?v.createElement(v.Fragment,null,ae,v.createElement(w4,{page:V})):ae});ga.displayName="Link";var Ds=v.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:i="",end:o=!1,style:u,to:m,viewTransition:p,children:g,...h},b){let y=Bs(m,{relative:h.relative}),_=Va(),j=v.useContext(Us),{navigator:N,basename:T}=v.useContext(xa),k=j!=null&&q4(y)&&p===!0,X=N.encodeLocation?N.encodeLocation(y).pathname:y.pathname,F=_.pathname,G=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(F=F.toLowerCase(),G=G?G.toLowerCase():null,X=X.toLowerCase()),G&&T&&(G=Ta(G,T)||G);const J=X!=="/"&&X.endsWith("/")?X.length-1:X.length;let V=F===X||!o&&F.startsWith(X)&&F.charAt(J)==="/",I=G!=null&&(G===X||!o&&G.startsWith(X)&&G.charAt(X.length)==="/"),$={isActive:V,isPending:I,isTransitioning:k},w=V?l:void 0,A;typeof i=="function"?A=i($):A=[i,V?"active":null,I?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let Q=typeof u=="function"?u($):u;return v.createElement(ga,{...h,"aria-current":w,className:A,ref:b,style:Q,to:m,viewTransition:p},typeof g=="function"?g($):g)});Ds.displayName="NavLink";var M4=v.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:i,replace:o,state:u,method:m=io,action:p,onSubmit:g,relative:h,preventScrollReset:b,viewTransition:y,unstable_defaultShouldRevalidate:_,...j},N)=>{let{unstable_useTransitions:T}=v.useContext(xa),k=H4(),X=B4(p,{relative:h}),F=m.toLowerCase()==="get"?"get":"post",G=typeof p=="string"&&jx.test(p),J=V=>{if(g&&g(V),V.defaultPrevented)return;V.preventDefault();let I=V.nativeEvent.submitter,$=I?.getAttribute("formmethod")||m,w=()=>k(I||V.currentTarget,{fetcherKey:l,method:$,navigate:s,replace:o,state:u,relative:h,preventScrollReset:b,viewTransition:y,unstable_defaultShouldRevalidate:_});T&&s!==!1?v.startTransition(()=>w()):w()};return v.createElement("form",{ref:N,method:F,action:X,onSubmit:i?g:J,...j,"data-discover":!G&&n==="render"?"true":void 0})});M4.displayName="Form";function k4(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nx(n){let l=v.useContext(Ol);return Ue(l,k4(n)),l}function A4(n,{target:l,replace:s,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:h}={}){let b=wn(),y=Va(),_=Bs(n,{relative:m});return v.useCallback(j=>{if(u4(j,l)){j.preventDefault();let N=s!==void 0?s:tn(y)===tn(_),T=()=>b(n,{replace:N,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g});h?v.startTransition(()=>T()):T()}},[y,b,_,s,i,o,l,n,u,m,p,g,h])}function Sd(n){vt(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=v.useRef(nd(n)),s=v.useRef(!1),i=Va(),o=v.useMemo(()=>d4(i.search,s.current?null:l.current),[i.search]),u=wn(),m=v.useCallback((p,g)=>{const h=nd(typeof p=="function"?p(new URLSearchParams(o)):p);s.current=!0,u("?"+h,g)},[u,o]);return[o,m]}var L4=0,U4=()=>`__${String(++L4)}__`;function H4(){let{router:n}=Nx("useSubmit"),{basename:l}=v.useContext(xa),s=Q1(),i=n.fetch,o=n.navigate;return v.useCallback(async(u,m={})=>{let{action:p,method:g,encType:h,formData:b,body:y}=h4(u,l);if(m.navigate===!1){let _=m.fetcherKey||U4();await i(_,s,m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:y,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await o(m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:y,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,o,l,s])}function B4(n,{relative:l}={}){let{basename:s}=v.useContext(xa),i=v.useContext(Oa);Ue(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),u={...Bs(n||".",{relative:l})},m=Va();if(n==null){u.search=m.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(b=>b==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let b=p.toString();u.search=b?`?${b}`:""}}return(!n||n===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(u.pathname=u.pathname==="/"?s:Ya([s,u.pathname])),tn(u)}function q4(n,{relative:l}={}){let s=v.useContext(pd);Ue(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Nx("useViewTransitionState"),o=Bs(n,{relative:l});if(!s.isTransitioning)return!1;let u=Ta(s.currentLocation.pathname,i)||s.currentLocation.pathname,m=Ta(s.nextLocation.pathname,i)||s.nextLocation.pathname;return mo(o.pathname,m)!=null||mo(o.pathname,u)!=null}const xg=n=>{let l;const s=new Set,i=(h,b)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const _=l;l=b??(typeof y!="object"||y===null)?y:Object.assign({},l,y),s.forEach(j=>j(l,_))}},o=()=>l,p={setState:i,getState:o,getInitialState:()=>g,subscribe:h=>(s.add(h),()=>s.delete(h))},g=l=n(i,o,p);return p},Y4=(n=>n?xg(n):xg),$4=n=>n;function V4(n,l=$4){const s=jr.useSyncExternalStore(n.subscribe,jr.useCallback(()=>l(n.getState()),[n,l]),jr.useCallback(()=>l(n.getInitialState()),[n,l]));return jr.useDebugValue(s),s}const yg=n=>{const l=Y4(n),s=i=>V4(l,i);return Object.assign(s,l),s},bo=(n=>n?yg(n):yg),G4="/api/v1";class Cl extends Error{constructor(l,s,i){super(i),this.status=l,this.code=s,this.name="ApiError"}}async function lo(n,l,s,i){let o=`${G4}${l}`;if(i){const p=new URLSearchParams(i).toString();p&&(o+=`?${p}`)}const u={method:n,headers:{"Content-Type":"application/json"}};s!==void 0&&(u.body=JSON.stringify(s));const m=await fetch(o,u);if(!m.ok){let p="UNKNOWN",g=m.statusText;try{const h=await m.json();h.code&&(p=h.code),h.message&&(g=h.message)}catch{}throw new Cl(m.status,p,g)}return m.json()}const yt={get(n,l){return lo("GET",n,void 0,l)},post(n,l){return lo("POST",n,l)},put(n,l){return lo("PUT",n,l)},delete(n){return lo("DELETE",n)}},K4=3e4,X4=1e3,Q4=3e4;class Z4{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()}))},K4)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const l=Math.min(X4*2**this.reconnectAttempt,Q4);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},l)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const $a=new Z4,tl="lib_cloud_default",Vt=bo((n,l)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const s=await yt.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 yt.post("/libraries",s);return n(o=>({libraries:[...o.libraries,i]})),i},deleteLibrary:async s=>{await yt.delete(`/libraries/${s}`),n(i=>({libraries:i.libraries.filter(o=>o.id!==s)}))},updateLibraryName:async(s,i)=>{const o=await yt.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 yt.get(`/libraries/${s}`);n(o=>({libraries:o.libraries.map(u=>u.id===s?i:u)}))}catch{l().fetchLibraries()}}})),Cr=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]},F4=n=>n.libraries.filter(l=>l.type==="daemon");$a.on("ws:daemon:status",n=>{const l=n;l.lib_id&&Vt.getState()._updateLibraryOnline(l.lib_id,l.is_online),Vt.getState().fetchLibraries()});$a.on("ws:daemon:connected",n=>{const l=n;l.lib_id&&Vt.getState()._updateLibraryOnline(l.lib_id,!0),Vt.getState().fetchLibraries()});$a.on("ws:library:updated",n=>{const l=n;Vt.getState()._refreshLibrary(l.library_id)});const wx=(...n)=>n.filter((l,s,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===s).join(" ").trim();const J4=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const P4=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,s,i)=>i?i.toUpperCase():s.toLowerCase());const vg=n=>{const l=P4(n);return l.charAt(0).toUpperCase()+l.slice(1)};var W4={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 I4=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const e2=v.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:m,...p},g)=>v.createElement("svg",{ref:g,...W4,width:l,height:l,stroke:n,strokeWidth:i?Number(s)*24/Number(l):s,className:wx("lucide",o),...!u&&!I4(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,b])=>v.createElement(h,b)),...Array.isArray(u)?u:[u]]));const ke=(n,l)=>{const s=v.forwardRef(({className:i,...o},u)=>v.createElement(e2,{ref:u,iconNode:l,className:wx(`lucide-${J4(vg(n))}`,`lucide-${n}`,i),...o}));return s.displayName=vg(n),s};const t2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ex=ke("arrow-right",t2);const a2=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],bg=ke("arrow-up-right",a2);const n2=[["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"}]],l2=ke("boxes",n2);const r2=[["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"}]],s2=ke("brain",r2);const i2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],al=ke("check",i2);const o2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jt=ke("chevron-right",o2);const c2=[["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"}]],_d=ke("circle-alert",c2);const u2=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],d2=ke("cloud",u2);const f2=[["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"}]],ld=ke("copy",f2);const m2=[["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"}]],h2=ke("database",m2);const p2=[["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"}]],g2=ke("file-spreadsheet",p2);const x2=[["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"}]],jn=ke("file-text",x2);const y2=[["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"}]],Cx=ke("file",y2);const v2=[["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"}]],b2=ke("files",v2);const S2=[["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"}]],jd=ke("folder-git-2",S2);const _2=[["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"}]],j2=ke("folder-input",_2);const N2=[["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"}]],w2=ke("folder-open",N2);const E2=[["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"}]],Rx=ke("folder-plus",E2);const C2=[["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"}]],za=ke("folder",C2);const R2=[["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"}]],ho=ke("git-branch",R2);const z2=[["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"}]],rd=ke("git-commit-horizontal",z2);const T2=[["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"}]],sd=ke("github",T2);const O2=[["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"}]],D2=ke("globe",O2);const M2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Nd=ke("info",M2);const k2=[["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"}]],A2=ke("laptop",k2);const L2=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],U2=ke("list-filter",L2);const H2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Zt=ke("loader-circle",H2);const B2=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],q2=ke("menu",B2);const Y2=[["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"}]],$2=ke("monitor",Y2);const V2=[["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"}]],G2=ke("moon",V2);const K2=[["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"}]],zl=ke("package",K2);const X2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Q2=ke("panel-left",X2);const Z2=[["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"}]],id=ke("pencil",Z2);const F2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zx=ke("plus",F2);const J2=[["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"}]],Tx=ke("refresh-cw",J2);const P2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],W2=ke("search",P2);const I2=[["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"}]],eS=ke("settings",I2);const tS=[["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"}]],aS=ke("share-2",tS);const nS=[["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"}]],lS=ke("sparkles",nS);const rS=[["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"}]],sS=ke("sun",rS);const iS=[["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"}]],Ox=ke("trash-2",iS);const oS=[["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"}]],od=ke("upload",oS);const cS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],uS=ke("users",cS);const dS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dl=ke("x",dS),Tl=bo(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:l=>n({status:l}),fetchDaemonStatus:async()=>{try{const l=await yt.get("/daemons/status");n({onlineCount:l.online_count,connections:l.connections})}catch{}}})),fS=n=>n==="connecting"?"disconnected":n;$a.onStatusChange(n=>{Tl.getState().setStatus(fS(n))});$a.on("ws:daemon:connected",n=>{const l=n;Tl.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}})});$a.on("ws:daemon:status",n=>{const l=n;Tl.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 Sg=n=>Symbol.iterator in n,_g=n=>"entries"in n,jg=(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},mS=(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 hS(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:Sg(n)&&Sg(l)?_g(n)&&_g(l)?jg(n,l):mS(n,l):jg({entries:()=>Object.entries(n)},{entries:()=>Object.entries(l)})}function Ml(n){const l=jr.useRef(void 0);return s=>{const i=n(s);return hS(l.current,i)?l.current:l.current=i}}function cd(){const{t:n}=Ee(),l=Tl(m=>m.onlineCount),s=Tl(m=>m.connections.length);if(Vt(Ml(F4)).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 Ng=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function pS(){const{t:n}=Ee(),[l,s]=v.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:Ng.map(({to:i,labelKey:o})=>f.jsx(Ds,{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(cd,{}),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(Dl,{size:20}):f.jsx(q2,{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:Ng.map(({to:i,labelKey:o})=>f.jsx(Ds,{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(cd,{}),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 gS(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function Dx(n){if(typeof window>"u")return;const l=gS(n);document.documentElement.setAttribute("data-theme",l),localStorage.setItem("theme",n)}function xS(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const Mx=bo(n=>({theme:xS(),setTheme:l=>{Dx(l),n({theme:l})}}));let wg=!1;function yS(){if(wg||typeof window>"u")return;wg=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{const{theme:s}=Mx.getState();s==="system"&&Dx("system")};n.addEventListener("change",l)}yS();const vS=[{mode:"light",icon:sS,labelKey:"footer.theme.light"},{mode:"dark",icon:G2,labelKey:"footer.theme.dark"},{mode:"system",icon:$2,labelKey:"footer.theme.system"}];function kx(){const{t:n}=Ee(),{theme:l,setTheme:s}=Mx();return f.jsx("div",{className:"flex items-center gap-1",children:vS.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 Ax(){const{i18n:n}=Ee(),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 Lx({compact:n}){const{t:l}=Ee(),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 bS="_brandIcon_1c7st_1",SS="_iconPulse_1c7st_35",Eg={brandIcon:bS,iconPulse:SS};function _S({variant:n}){const{t:l}=Ee(),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:Eg.brandIcon,children:f.jsx("span",{className:Eg.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(kx,{}),f.jsx(Ax,{})]}),f.jsx(Lx,{})]})]})})}function jS(){return f.jsxs("div",{className:"flex min-h-screen flex-col",children:[f.jsx(pS,{}),f.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:f.jsx(bx,{})}),f.jsx(_S,{})]})}function NS({onToggleSidebar:n}){const{t:l}=Ee();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(Q2,{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(cd,{}),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 wS=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"}`,ES=[{to:"/studio/modeling",icon:l2,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:s2,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:W2,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:aS,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:uS,i18nKey:"studio.sidebar.collaboration"},{to:"/studio/settings",icon:eS,i18nKey:"studio.sidebar.settings"}];function Cg({onNavigate:n}){const{t:l}=Ee(),s=Va(),i=wn(),o=Vt(Ml(Cr)),u=s.pathname.startsWith("/studio/sources")||s.pathname.startsWith("/studio/source/"),[m,p]=v.useState(u);v.useEffect(()=>{u&&p(!0)},[u]);const g=h=>h.id===tl?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(h2,{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(zx,{size:12})}),f.jsx(Jt,{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 b=g(h);return f.jsxs(Ds,{to:`/studio/sources/${h.id}`,onClick:n,className:({isActive:y})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${y?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[h.type==="cloud"?f.jsx(d2,{size:13,className:"shrink-0 opacity-60"}):f.jsx(A2,{size:13,className:"shrink-0 opacity-60"}),f.jsx("span",{className:"truncate",children:b}),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)})})]}),ES.map(({to:h,icon:b,i18nKey:y})=>f.jsxs(Ds,{to:h,onClick:n,className:({isActive:_})=>wS(_),children:[f.jsx(b,{size:14}),l(y)]},h))]}),f.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(kx,{}),f.jsx(Ax,{})]}),f.jsx(Lx,{compact:!0})]})]})}function CS(){const[n,l]=v.useState(!1);return v.useEffect(()=>{Vt.getState().fetchLibraries(),Tl.getState().fetchDaemonStatus()},[]),v.useEffect(()=>$a.onStatusChange(s=>{s==="connected"&&(Vt.getState().fetchLibraries(),Tl.getState().fetchDaemonStatus())}),[]),f.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[f.jsx(NS,{onToggleSidebar:()=>l(!n)}),f.jsxs("div",{className:"flex min-h-0 flex-1",children:[f.jsx("div",{className:"hidden md:block",children:f.jsx(Cg,{})}),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(Cg,{onNavigate:()=>l(!1)})})]}),f.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:f.jsx(bx,{})})]})]})}function RS(){const{t:n}=Ee();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(Ex,{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 Da({title:n,version:l,description:s}){const{t:i}=Ee();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 zS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.login.title"),version:"0.5.0",description:n("page.login.description")})}function TS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function OS(){const{t:n}=Ee();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 DS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function MS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function kS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function AS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function LS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}function US(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.settings.title"),version:"0.5.x",description:n("page.settings.description")})}function HS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function BS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function qS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function YS(){const{t:n}=Ee();return f.jsx(Da,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const So=(n,l)=>{for(const s of n){if(s.path===l)return s;if(s.children){const i=So(s.children,l);if(i)return i}}return null},$S=(n,l)=>l===""?n:So(n,l)?.children??[],Ux=(n,l)=>{if(!l)return[];const s=l.split("/"),i=[];let o="";for(const u of s){o=o?`${o}/${u}`:u;const m=So(n,o);m&&i.push(m)}return i},_o=bo(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 yt.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 yt.get(`/sources/${l}`);return n({currentRoot:s}),s},createSource:async l=>await yt.post("/sources",l),addTreeNode:async(l,s)=>{const i=await yt.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 yt.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 yt.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 yt.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 yt.post("/sources/upload",l),setFilter:l=>n({filter:l}),clearSources:()=>n({rootSources:[],currentRoot:null,total:0,offset:0})}));function Rr({segments:n}){const{t:l}=Ee(),s=v.useRef(null),i=v.useRef(null),[o,u]=v.useState(0),m=[{label:l("sources.breadcrumb.sources")},...n],p=Math.max(0,m.length-3);v.useEffect(()=>{const h=s.current,b=i.current;if(!h||!b)return;const y=()=>{const j=h.clientWidth,N=Array.from(b.children);if(N.length===0)return;const T=N.map($=>$.offsetWidth),k=4;if(T.reduce(($,w)=>$+w,0)+k*(T.length-1)<=j){u(0);return}const F=20,G=(T[0]??0)+(T[1]??0)+k,J=T[T.length-1]??0,V=G+k+F+k+J;let I=p;for(let $=1;$<=p;$++){let w=0;for(let A=2+$;A<T.length-1;A++)w+=T[A]+k;if(V+w<=j){I=$;break}}u(I)};y();const _=new ResizeObserver(y);return _.observe(h),()=>_.disconnect()},[p,n,l]);const g=(()=>{if(o===0||m.length<=3)return m;const h=m.slice(0,2),b=m[m.length-1],y=m.slice(2+o,m.length-1);return[...h,{label:"…"},...y,b]})();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,b)=>{const y=b===g.length-1;return f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[b>0&&f.jsx(Jt,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!y?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 ${y?"text-c4a-text-primary":""}`,children:h.label})]},b)})}),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,b)=>f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[b>0&&f.jsx(Jt,{size:12}),f.jsx("span",{className:"whitespace-nowrap",children:h.label})]},b))})]})}const VS=["all","indexed","not_indexed"];function GS({value:n,onChange:l}){const{t:s}=Ee(),[i,o]=v.useState(!1),u=v.useRef(null),m=v.useRef(null),p={all:s("sources.filter.all"),indexed:s("sources.filter.indexed"),not_indexed:s("sources.filter.not_indexed")},g=v.useCallback(y=>{u.current&&!u.current.contains(y.target)&&o(!1)},[]);v.useEffect(()=>{if(i)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i,g]);const h=v.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),o(!0)},[]),b=v.useCallback(()=>{m.current=setTimeout(()=>o(!1),150)},[]);return f.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:b,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(U2,{size:12}),f.jsx("span",{className:"hidden sm:inline",children:p[n]}),f.jsx(Jt,{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:VS.map(y=>f.jsxs("button",{onClick:()=>{l(y),o(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${y===n?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx(al,{size:12,className:y===n?"opacity-100":"opacity-0"}),p[y]]},y))})]})}function Hx({currentName:n,onConfirm:l,onCancel:s,error:i}){const[o,u]=v.useState(n),m=v.useRef(null);v.useEffect(()=>{m.current?.select()},[]);const p=v.useCallback(()=>{const h=o.trim();h&&h!==n?l(h):s()},[o,n,l,s]),g=v.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(Dl,{size:14})}),i&&f.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:i})]})}const KS=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),XS=new Set([".ts",".tsx",".md"]),QS=new Set([".md",".doc",".docx",".pdf",".ppt",".pptx",".txt"]),ZS=new Set([".md",".txt"]),FS=5*1024*1024,JS=10;function ud(n){const l=n.lastIndexOf(".");return l>=0?n.slice(l).toLowerCase():""}function Bx(n){const l=n.includes("/")?n.split("/").pop():n;if(KS.has(l.toLowerCase()))return!0;const s=ud(l);return XS.has(s)}const PS=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}`},Rg={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function WS({source:n,isDaemonLibrary:l}){const{t:s}=Ee(),i=n.kind==="source",o=i&&(n.source_type==="code"||Bx(n.name)),u=o?"text-c4a-accent":"text-c4a-text-muted";let m;if(n.kind==="folder"?m=l?f.jsx(w2,{size:16,className:`shrink-0 ${u}`}):f.jsx(za,{size:16,className:`shrink-0 ${u}`}):n.source_type==="code"?m=f.jsx(zl,{size:16,className:`shrink-0 ${u}`}):m=f.jsx(jn,{size:16,className:`shrink-0 ${u}`}),!i||!o)return f.jsx(f.Fragment,{children:m});const p=Rg[n.index_status]??Rg.none,g=s(`sources.status.${n.index_status}`);return f.jsxs("span",{className:"group/dot relative shrink-0",children:[m,f.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${p}`}),f.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-[10px] text-c4a-text-secondary opacity-0 shadow-lg transition-opacity group-hover/dot:opacity-100",children:g})]})}function zg({source:n,displayName:l,childCount:s,isDaemonLibrary:i,isRepoRoot:o,hasUpdate:u,onClick:m,onRename:p,onDelete:g}){const{t:h}=Ee(),[b,y]=v.useState(!1),[_,j]=v.useState(null),N=v.useCallback(async V=>{if(!p)return;const I=await p(V);I?j(I):(y(!1),j(null))},[p]),T=v.useCallback(()=>{y(!1),j(null)},[]),k=!o&&p,X=g,F=n.updated_at||n.created_at,G=n.kind==="source"&&n.source_type!=="code"&&!Bx(n.name),J=!G;return f.jsxs("div",{className:`group flex items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors ${J?"cursor-pointer hover:bg-c4a-bg-hover":"cursor-default"}`,onClick:b||!J?void 0:m,children:[f.jsx(WS,{source:n,isDaemonLibrary:i??!1}),b?f.jsx("div",{className:"min-w-0 flex-1",onClick:V=>V.stopPropagation(),children:f.jsx(Hx,{currentName:n.name,onConfirm:N,onCancel:T,error:_})}):f.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${G?"text-c4a-text-muted":"text-c4a-text-primary"}`,children:l??n.name}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-tight text-c4a-accent/60",children:[f.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-c4a-accent"}),h("sources.change_detection.has_updates")]}),n.kind==="folder"&&s!==void 0&&f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:s})}),F&&f.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:PS(F)})]}),(k||X)&&f.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[k&&f.jsx("button",{title:h("sources.actions.rename"),onClick:V=>{V.stopPropagation(),y(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(id,{size:14})}),X&&f.jsx("button",{title:h("sources.actions.delete"),onClick:V=>{V.stopPropagation(),g()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(Ox,{size:14})})]})]})}function kl({children:n,onClose:l,className:s="",overlayClass:i="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:u=!0,disableClose:m=!1}){const p=v.useRef(null);v.useEffect(()=>{if(!u)return;const h=b=>{b.key==="Escape"&&!m&&l()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[l,u,m]);const g=v.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 Tg({target:n,onConfirm:l,onCancel:s}){const{t:i}=Ee();return f.jsxs(kl,{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 IS({onConfirm:n,onCancel:l,error:s}){const{t:i}=Ee(),[o,u]=v.useState(""),m=v.useRef(null);v.useEffect(()=>{m.current?.focus()},[]);const p=v.useCallback(()=>{const h=o.trim();h&&n(h)},[o,n]),g=v.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),p())},[p]);return f.jsxs(kl,{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(Rx,{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 Xu({label:n,icon:l,items:s,alignRight:i}){const[o,u]=v.useState(!1),m=v.useRef(null),p=v.useRef(null),g=v.useCallback(y=>{m.current&&!m.current.contains(y.target)&&u(!1)},[]);v.useEffect(()=>{if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,g]);const h=v.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),b=v.useCallback(()=>{p.current=setTimeout(()=>u(!1),150)},[]);return f.jsxs("div",{ref:m,className:"relative",onMouseEnter:h,onMouseLeave:b,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(Jt,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&f.jsx("div",{className:`absolute top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${i?"right-0":"left-0"}`,children:s.map(y=>f.jsxs("button",{onClick:()=>{y.onClick(),u(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[y.icon,y.label]},y.label))})]})}function e_({onClose:n}){const{t:l}=Ee();return f.jsxs(kl,{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(lS,{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 t_(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function a_({onConfirm:n,onCancel:l,error:s,uploading:i}){const{t:o}=Ee(),[u,m]=v.useState([]),[p,g]=v.useState(null),[h,b]=v.useState(!1),y=v.useRef(null),_=v.useCallback(J=>{g(null);for(const V of J){const I=ud(V.name);if(!QS.has(I)){g(o("sources.upload.unsupported_type",{name:V.name}));return}if(V.size>FS){g(o("sources.upload.file_too_large",{name:V.name}));return}}m(V=>{const I=new Map(V.map(w=>[w.name,w]));for(const w of J)I.set(w.name,{name:w.name,size:w.size,file:w});const $=Array.from(I.values());return $.length>JS?(g(o("sources.upload.too_many_files")),V):$})},[o]),j=v.useCallback(J=>{const V=J.target.files;!V||V.length===0||(_(Array.from(V)),J.target.value="")},[_]),N=v.useCallback(J=>{m(V=>V.filter((I,$)=>$!==J)),g(null)},[]),T=v.useCallback(J=>{J.preventDefault(),b(!1);const V=J.dataTransfer?.files;!V||V.length===0||_(Array.from(V))},[_]),k=v.useCallback(J=>{J.preventDefault(),b(!0)},[]),X=v.useCallback(J=>{J.preventDefault(),b(!1)},[]),F=v.useCallback(async()=>{if(u.length===0)return;const J=await Promise.all(u.map(V=>new Promise((I,$)=>{const w=ud(V.name),A=ZS.has(w),Q=new FileReader;Q.onerror=()=>$(Q.error),A?(Q.onload=()=>I({name:V.name,content:Q.result,encoding:"utf-8"}),Q.readAsText(V.file)):(Q.onload=()=>{const ue=Q.result,se=ue.slice(ue.indexOf(",")+1);I({name:V.name,content:se,encoding:"base64"})},Q.readAsDataURL(V.file))})));n(J)},[u,n]),G=s||p;return f.jsxs(kl,{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(od,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:y,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:j,className:"hidden"}),f.jsxs("button",{type:"button",onClick:()=>y.current?.click(),onDrop:T,onDragOver:k,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(od,{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((J,V)=>f.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[f.jsx(jn,{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:J.name}),f.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:t_(J.size)}),!i&&f.jsx("button",{type:"button",onClick:()=>N(V),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:f.jsx(Dl,{size:12})})]},`${J.name}-${V}`))})]}),G&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:G}),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:F,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(Zt,{size:12,className:"animate-spin"}),o(i?"sources.upload.uploading":"common.confirm")]})]})]})}function n_({pathLabel:n,loading:l,onNavigateUp:s,children:i}){return f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),f.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:l?f.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:f.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}):f.jsxs(f.Fragment,{children:[s&&f.jsxs("button",{onClick:s,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(za,{size:16,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{children:".."})]}),i]})})]})}function l_(n,l,s){const[i,o]=v.useState({}),u=v.useRef(new Set);return v.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;yt.post("/import/remote/refs",{library_id:n,url:g.remote_url}).then(h=>{const b=g.remote_ref||"",y=h.branches?.find(_=>_.name===b)??h.tags?.find(_=>_.name===b);y&&y.commit!==g.remote_commit&&o(_=>({..._,[p.id]:!0}))}).catch(()=>{})}}},[n,l,s]),i}function r_({library:n,onNewFolder:l,onImportRepo:s,onImportDir:i,onUpgrade:o}){const{t:u}=Ee(),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 s_(){const{t:n}=Ee();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 Qu=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 i_(){const{t:n}=Ee(),l=wn(),{libId:s}=Hs(),[i,o]=Sd(),u=i.get("rootId")||null,m=i.get("path")||"",g=Vt(Ml(Cr)).find(oe=>oe.id===s),h=Vt(oe=>oe.updateLibraryName),b=Vt(oe=>oe.deleteLibrary),{rootSources:y,currentRoot:_,loading:j,filter:N,fetchRootSources:T,fetchRootSource:k,createSource:X,addTreeNode:F,updateSource:G,deleteSource:J,deleteTreeNode:V,uploadDoc:I,setFilter:$}=_o(),[w,A]=v.useState(!1),[Q,ue]=v.useState(null),[se,xe]=v.useState(null),[ae,ie]=v.useState(null),[M,P]=v.useState(null),[de,ce]=v.useState(!1),[Re,E]=v.useState(!1),[q,ee]=v.useState(null),[ne,ve]=v.useState(!1),[Se,ze]=v.useState(!1),[it,fe]=v.useState(null),[jt,Mt]=v.useState(!1);v.useEffect(()=>{s&&T({library_id:s})},[s,T]),v.useEffect(()=>{u&&k(u)},[u,k]);const Te=u!==null,De=v.useMemo(()=>Te?_?[...$S(_.tree,m)].sort((Pe,ht)=>Pe.kind!==ht.kind?Pe.kind==="folder"?-1:1:Pe.name.localeCompare(ht.name)).map(Pe=>({type:"node",root:_,node:Pe})):[]:[...y].sort((ht,Qe)=>ht.kind!==Qe.kind?ht.kind==="folder"?-1:1:new Date(Qe.created_at).getTime()-new Date(ht.created_at).getTime()).map(ht=>({type:"root",root:ht,node:null})),[Te,y,_,m]),Xe=v.useMemo(()=>N==="all"?De:De.filter(oe=>oe.type==="root"||!oe.node||oe.node.kind==="folder"?!0:N==="indexed"?oe.node.index_status==="indexed":oe.node.index_status==="none"||!oe.node.index_status),[De,N]),lt=g?.type==="daemon",Wt=g?.type==="cloud",Gt=lt&&!Te,Tt=l_(s,Wt,y),sa=v.useMemo(()=>{if(!g)return[];const oe=[{label:g.id===tl?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];return Te&&_&&(oe.push({label:_.name,to:`/studio/sources/${g.id}?rootId=${_.id}`}),m&&Ux(_.tree,m).forEach(Pe=>{oe.push({label:Pe.name,to:`/studio/sources/${g.id}?rootId=${_.id}&path=${encodeURIComponent(Pe.path)}`})})),oe},[g,Te,_,m,n]),ya=v.useCallback(async oe=>{if(s)try{Te&&u?await F(u,{parent_path:m,kind:"folder",name:oe}):(await X({library_id:s,kind:"folder",name:oe}),T({library_id:s})),A(!1),ue(null)}catch(Ne){Ne instanceof Cl&&Ne.status===409&&ue(n("sources.error.name_conflict",{name:oe}))}},[s,Te,u,m,X,F,T,n]),Ga=v.useCallback(oe=>{s&&(oe.type==="root"?oe.root.kind==="source"?l(`/studio/source/${oe.root.id}`):o({rootId:oe.root.id}):oe.node&&(oe.node.kind==="folder"?o({rootId:oe.root.id,path:oe.node.path}):l(`/studio/source/${oe.root.id}?path=${encodeURIComponent(oe.node.path)}`)))},[s,l,o]),nl=v.useCallback(()=>{if(!(!u||!s))if(m){const oe=m.split("/");oe.pop();const Ne=oe.join("/");o(Ne?{rootId:u,path:Ne}:{rootId:u})}else o({})},[u,s,m,o]),ll=v.useCallback(async(oe,Ne)=>{try{return await G(oe,{name:Ne}),T({library_id:s}),null}catch(Pe){return Pe instanceof Cl&&Pe.status===409?n("sources.error.name_conflict",{name:Ne}):null}},[s,G,T,n]),kt=v.useCallback(oe=>{if(oe.type==="root"){ie(oe.root.id),P(null);const Ne=oe.root.tree.length>0?Qu({children:oe.root.tree}):void 0;xe(lt?{type:"repo",name:oe.root.name,libraryName:g.name,...Ne?{packageCount:Ne.codeSources,docCount:Ne.docSources,indexedCount:Ne.indexedSources}:{}}:{type:oe.root.kind==="folder"?"folder":"resource",name:oe.root.name,...oe.root.kind==="folder"&&Ne?{folderCount:Ne.folders,sourceCount:Ne.sources,indexedCount:Ne.indexedSources}:{}})}else if(oe.node)if(ie(oe.root.id),P(oe.node.path),oe.node.kind==="folder"){const Ne=Qu(oe.node);xe({type:"folder",name:oe.node.name,folderCount:Ne.folders,sourceCount:Ne.sources,indexedCount:Ne.indexedSources})}else xe({type:"resource",name:oe.node.name})},[lt,g]),Ma=v.useCallback(async()=>{if(!(!ae||!s)){try{M?await V(ae,M):(await J(ae),T({library_id:s}))}catch{}xe(null),ie(null),P(null)}},[ae,M,s,J,V,T]),ka=v.useCallback(()=>{s&&l(`/studio/sources/import/${s}`)},[s,l]),En=v.useCallback(()=>{s&&l(`/studio/sources/import-dir/${s}`)},[s,l]),Ka=v.useCallback(async oe=>{if(s){ve(!0),ee(null);try{const Ne={library_id:s,files:oe.map(Pe=>{const ht={file_name:Pe.name,content:Pe.content};return Pe.encoding&&(ht.encoding=Pe.encoding),ht})};Te&&u&&(Ne.root_source_id=u,Ne.parent_path=m),await I(Ne),Te&&u?k(u):T({library_id:s}),E(!1)}catch(Ne){Ne instanceof Cl&&Ne.status===409?ee(n("sources.error.name_conflict",{name:oe[0]?.name??""})):Ne instanceof Cl&&ee(Ne.message)}finally{ve(!1)}}},[s,Te,u,m,I,T,k,n]),ia=g?.id===tl,It=v.useCallback(async oe=>{if(s)try{await h(s,oe),ze(!1),fe(null)}catch(Ne){const Pe=Ne instanceof Error?Ne.message:String(Ne);fe(Pe)}},[s,h]),Al=v.useCallback(()=>{ze(!1),fe(null)},[]),zr=v.useCallback(async()=>{if(s){try{await b(s),l("/studio/sources/add-client")}catch{}Mt(!1)}},[s,b,l]),Aa=v.useCallback(()=>{Mt(!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 Ht=y.length===0&&N==="all"&&!j&&!Te,Nt=Xe.filter(oe=>oe.type==="node"&&oe.node?.kind==="source").length===0&&N==="indexed"&&!j,At=!Gt,Ll=Wt,Ul=Gt;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:Se?f.jsx(Hx,{currentName:g.name,onConfirm:It,onCancel:Al,error:it}):f.jsx(Rr,{segments:sa})}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Ll&&f.jsxs(f.Fragment,{children:[f.jsx(Xu,{label:n("sources.actions.upload"),icon:f.jsx(od,{size:14}),items:[{label:n("sources.actions.upload_doc"),icon:f.jsx(jn,{size:14}),onClick:()=>E(!0)}]}),f.jsx(Xu,{label:n("sources.actions.add"),icon:f.jsx(zx,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:f.jsx(Rx,{size:14}),onClick:()=>A(!0)},{label:n("sources.actions.add_web"),icon:f.jsx(D2,{size:14}),onClick:()=>ce(!0)},{label:n("sources.actions.add_feishu"),icon:f.jsx(g2,{size:14}),onClick:()=>ce(!0)}]}),f.jsxs("button",{onClick:()=>l(`/studio/sources/import-remote/${s}`),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(bg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo_url")})]})]}),Ul&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:En,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(j2,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_dir")})]}),f.jsxs("button",{onClick:ka,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(bg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo")})]}),f.jsx(Xu,{label:"",icon:f.jsx(id,{size:14}),alignRight:!0,items:[{label:n("sources.library.rename"),icon:f.jsx(id,{size:14}),onClick:()=>ze(!0)},...ia?[]:[{label:n("sources.actions.delete"),icon:f.jsx(Ox,{size:14}),onClick:()=>Mt(!0)}]]})]}),At&&f.jsx(GS,{value:N,onChange:$})]})]}),Ht?f.jsx(r_,{library:g,onNewFolder:()=>A(!0),...lt?{onImportRepo:ka,onImportDir:En}:{},...Wt?{onUpgrade:()=>l(`/studio/sources/import-remote/${s}`)}:{}}):f.jsx(n_,{pathLabel:sa.map(oe=>oe.label).join(" / "),loading:j,onNavigateUp:Te?nl:void 0,children:Xe.length===0?Nt?f.jsx(s_,{}):Te?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:Xe.map(oe=>{if(oe.type==="root"){const Qe=oe.root,an=lt,La=an?Qe.metadata?.local_path:void 0,rl=Qe.tree.length>0?Qu({children:Qe.tree}):void 0,sl=rl?rl.folders+rl.sources:0;return f.jsx(zg,{source:{id:Qe.id,library_id:Qe.library_id,owner_id:Qe.owner_id,path:"",kind:Qe.kind,source_type:Qe.source_type,name:Qe.name,content_hash:Qe.content_hash,metadata:Qe.metadata,index_status:Qe.index_status,created_at:Qe.created_at,updated_at:Qe.updated_at},...typeof La=="string"?{displayName:La}:{},...Qe.kind==="folder"?{childCount:sl}:{},isDaemonLibrary:lt??!1,isRepoRoot:an,...Tt[Qe.id]?{hasUpdate:!0}:{},onClick:()=>Ga(oe),onRename:Xa=>ll(Qe.id,Xa),onDelete:()=>kt(oe)},Qe.id)}const Ne=oe.node,Pe=`${oe.root.id}:${Ne.path}`,ht=Ne.kind==="folder"?Ne.children?.length??0:void 0;return f.jsx(zg,{source:{id:oe.root.id,library_id:oe.root.library_id,owner_id:oe.root.owner_id,path:Ne.path,kind:Ne.kind,source_type:Ne.source_type??null,name:Ne.name,content_hash:null,metadata:Ne.metadata??null,index_status:Ne.index_status??"none",created_at:oe.root.created_at,updated_at:oe.root.updated_at},...ht!==void 0?{childCount:ht}:{},isDaemonLibrary:lt??!1,onClick:()=>Ga(oe),...Wt?{onDelete:()=>kt(oe)}:{}},Pe)})})}),w&&f.jsx(IS,{onConfirm:ya,onCancel:()=>{A(!1),ue(null)},error:Q}),Re&&f.jsx(a_,{onConfirm:Ka,onCancel:()=>{E(!1),ee(null)},error:q,uploading:ne}),de&&f.jsx(e_,{onClose:()=>ce(!1)}),se&&f.jsx(Tg,{target:se,onConfirm:Ma,onCancel:()=>{xe(null),ie(null),P(null)}}),jt&&g&&f.jsx(Tg,{target:{type:"client",name:g.name},onConfirm:zr,onCancel:Aa})]})}function el({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 Ms(){return f.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function qx({libraryName:n}){const{t:l}=Ee();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 wd({step:n,totalSteps:l,importing:s,stepBusy:i,canProceed:o,safetyNoticeKey:u,confirmLabelKey:m,onPrev:p,onNext:g,onImport:h}){const{t:b}=Ee();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:b(u),onClick:y=>y.currentTarget.classList.toggle("line-clamp-1"),children:b(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:b("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:b("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(Zt,{size:12,className:"animate-spin"}),b(s?"sources.import.importing":m)]})]})]})}function Yx(n,l){const s=v.useCallback(async(m,p)=>{if(!n)throw new Error("No library");const g=await yt.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]=v.useState([]);v.useEffect(()=>{if(!n)return;let m=!1;return(async()=>{try{const p=await yt.get("/sources",{library_id:n,limit:"500"});if(m)return;const g=p.items.map(h=>{const b=h.metadata;return typeof b?.local_path=="string"?b.local_path:null}).filter(h=>h!==null);o(g)}catch{}})(),()=>{m=!0}},[n]);const u=v.useMemo(()=>{const m=l?.config;return!m||!Array.isArray(m.allowed_paths)?[]:m.allowed_paths},[l]);return{rpc:s,importedPaths:i,allowedPaths:u}}function $x(){const{t:n}=Ee(),[l,s]=v.useState(!1),[i,o]=v.useState(null),u=v.useRef(),m=v.useRef(),p=window.location.host,g=`c4a-daemon --server ${p} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${p}`,b=v.useCallback((j,N)=>{navigator.clipboard.writeText(j),o(N),clearTimeout(u.current),u.current=setTimeout(()=>o(null),1500)},[]),y=v.useCallback(()=>{clearTimeout(m.current),s(!0)},[]),_=v.useCallback(()=>{m.current=setTimeout(()=>s(!1),150)},[]);return f.jsxs("span",{className:"relative",onMouseEnter:y,onMouseLeave:_,children:[f.jsx(_d,{size:12,className:"text-c4a-warning"}),l&&f.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:y,onMouseLeave:_,children:[f.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:g}),f.jsx("button",{onClick:()=>b(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(ld,{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:()=>b(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(ld,{size:10})})]})]})]})}function Vx({open:n,onClose:l,rpc:s,onNavigate:i,defaultPath:o}){const{t:u}=Ee(),[m,p]=v.useState(o??""),[g,h]=v.useState(null),[b,y]=v.useState(!1),_=v.useRef(null);v.useEffect(()=>{o&&!m&&p(o)},[o]);const j=v.useCallback(async()=>{const T=m.trim();if(T){y(!0),h(null);try{(await s("fs/exists",{path:T})).exists?(i(T),p(o??""),h(null),l()):h(u("sources.import.wildcard_path_not_found"))}catch(k){h(k instanceof Error?k.message:String(k))}finally{y(!1)}}},[m,s,u,i,l]),N=v.useCallback(()=>{p(o??""),h(null),l()},[l,o]);return n?f.jsxs(kl,{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(Dl,{size:14})})]}),f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("input",{ref:_,type:"text",value:m,onChange:T=>{p(T.target.value),h(null)},onKeyDown:T=>{T.key==="Enter"&&j()},placeholder:u("sources.import.wildcard_path_placeholder"),autoFocus:!0,className:"flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent"}),f.jsxs("button",{onClick:j,disabled:b||!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:[b?f.jsx(Zt,{size:12,className:"animate-spin"}):f.jsx(Ex,{size:12}),u("sources.import.wildcard_go")]})]}),g&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:g})]}):null}function Gx(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 o_(n,l){return`${n}/tree/${encodeURIComponent(l)}`}function c_(n,l){return`${n}/commit/${l}`}function Kx({rpc:n,allowedPaths:l,importedPaths:s,onNavigateUpExtra:i}){const o=!!l&&l.length>0,u=o&&l.length===1&&l[0]==="*",[m,p]=v.useState(o),[g,h]=v.useState(o&&!u?"":"/"),[b,y]=v.useState([]),[_,j]=v.useState(!1),[N,T]=v.useState(null),[k,X]=v.useState(null);v.useEffect(()=>{if(o&&!u)return;let A=!1;return(async()=>{try{const Q=await n("fs/homeDir",{});A||X(Q.home_dir)}catch{A||X("/")}})(),()=>{A=!0}},[o,u,n]);const[F,G]=v.useState(!1),J=v.useCallback(async A=>{j(!0),T(null);try{const Q=await n("fs/listTree",{path:A,depth:1});y(Q.entries||[]),h(A),p(!1)}catch(Q){const ue=Q instanceof Error?Q.message:String(Q);T(ue)}finally{j(!1)}},[n]);v.useEffect(()=>{o&&!u||k!==null&&J(k)},[k,o,u,J]);const V=v.useMemo(()=>new Set(s??[]),[s]),I=v.useCallback(()=>{if(o&&!u&&l.some(ue=>ue===g)){p(!0),h(""),y([]),T(null),i?.();return}const A=g.split("/").slice(0,-1).join("/")||"/";i?.(),J(A)},[o,u,l,g,J,i]),$=v.useMemo(()=>b.filter(A=>A.type==="directory"),[b]),w=v.useMemo(()=>b.filter(A=>A.type==="file"),[b]);return{atRoot:m,currentPath:g,entries:b,loading:_,error:N,homeDir:k,goToOpen:F,hasAllowedPaths:o,isWildcard:u,importedSet:V,dirs:$,files:w,loadTree:J,handleNavigateUp:I,setGoToOpen:G}}function u_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Ee(),[m,p]=v.useState(null),{atRoot:g,currentPath:h,entries:b,loading:y,error:_,homeDir:j,goToOpen:N,isWildcard:T,importedSet:k,dirs:X,files:F,loadTree:G,handleNavigateUp:J,setGoToOpen:V}=Kx({rpc:n,allowedPaths:i??[],importedPaths:o??[],onNavigateUpExtra:()=>p(null)}),[I,$]=v.useState(null),[w,A]=v.useState(!1);v.useEffect(()=>{if(!l){$(null),A(!1);return}$(null),A(!0);let ae=!1;return(async()=>{try{const ie=await n("fs/repoStatus",{path:l});ae||($({branch:ie.branch,hash:ie.head_hash,remoteUrl:ie.remote_url}),A(!1))}catch{ae||($(null),A(!1))}})(),()=>{ae=!0}},[l,n]);const Q=v.useMemo(()=>I?.remoteUrl?Gx(I.remoteUrl):null,[I?.remoteUrl]),ue=v.useCallback(ae=>{if(ae.type==="directory")if(ae.is_git_repo){if(k.has(ae.path))return;p(null),s(ae.path,ae.name)}else p(ae.path),G(ae.path)},[s,G,k]),se=v.useMemo(()=>X.sort((ae,ie)=>ae.is_git_repo&&!ie.is_git_repo?-1:!ae.is_git_repo&&ie.is_git_repo?1:ae.name.localeCompare(ie.name)),[X]),xe=v.useMemo(()=>F.sort((ae,ie)=>ae.name.localeCompare(ie.name)),[F]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[g?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx($x,{})]}):f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),l&&w?f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[f.jsx(Zt,{size:12,className:"animate-spin"}),f.jsx("span",{children:u("common.loading")})]}):l&&I?f.jsxs("div",{className:"flex min-w-0 shrink items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent flex-wrap",children:[Q?f.jsxs("a",{href:Q.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:Q.repoUrl,children:[f.jsx(sd,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:Q.slug})]}):f.jsxs("span",{className:"flex items-center gap-1 truncate",children:[f.jsx(sd,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:l.split("/").pop()||l})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),Q?f.jsxs("a",{href:o_(Q.repoUrl,I.branch),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[f.jsx(ho,{size:10,className:"shrink-0"}),f.jsx("span",{children:I.branch})]}):f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(ho,{size:10,className:"shrink-0"}),f.jsx("span",{children:I.branch})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),Q?f.jsx("a",{href:c_(Q.repoUrl,I.hash),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:I.hash.slice(0,7)}):f.jsx("span",{children:I.hash.slice(0,7)})]}):!l&&T&&g?f.jsx("button",{onClick:()=>V(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),g?T?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:j&&f.jsxs("button",{onClick:()=>G(j),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(za,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[j,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(Jt,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(ae=>f.jsxs("button",{onClick:()=>G(ae),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(za,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:ae}),f.jsx(Jt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},ae))}):_&&!y?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:_}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[y&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&f.jsxs("button",{onClick:J,disabled:y,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(za,{size:14}),f.jsx("span",{children:".."})]}),se.map(ae=>{const ie=ae.is_git_repo&&k.has(ae.path),M=ae.is_git_repo?jd:za;return f.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${ie?"cursor-not-allowed text-c4a-accent/60":l===ae.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[f.jsxs("button",{onClick:()=>ue(ae),disabled:ie||y,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[f.jsx(M,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate text-left",children:ae.name}),ie&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")})]}),!ie&&f.jsx("button",{onClick:P=>{P.stopPropagation(),G(ae.path)},disabled:y,className:"shrink-0 rounded p-1.5 text-c4a-text-muted transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent disabled:pointer-events-none",title:ae.path,children:f.jsx(Jt,{size:12})})]},ae.path)}),xe.map(ae=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Cx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:ae.name})]},ae.path)),b.length===0&&!y&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),m&&!l&&f.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:u("sources.import.not_git")}),f.jsx(Vx,{open:N,onClose:()=>V(!1),rpc:n,onNavigate:G,defaultPath:j??void 0})]})}function Og({value:n,options:l,onChange:s,icon:i,maxHeight:o="max-h-60"}){const[u,m]=v.useState(!1),p=v.useRef(null),g=v.useRef(null),h=v.useCallback(j=>{p.current&&!p.current.contains(j.target)&&m(!1)},[]);v.useEffect(()=>{if(u)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[u,h]);const b=v.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null),m(!0)},[]),y=v.useCallback(()=>{g.current=setTimeout(()=>m(!1),150)},[]),_=l.find(j=>j.value===n);return f.jsxs("div",{ref:p,className:"relative",onMouseEnter:b,onMouseLeave:y,children:[f.jsxs("button",{onClick:()=>m(j=>!j),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[i,f.jsx("span",{className:"max-w-[200px] truncate",children:_?.label??n}),f.jsx(Jt,{size:12,className:`shrink-0 transition-transform duration-200 ${u?"rotate-90":""}`})]}),u&&f.jsx("div",{className:`absolute left-0 top-full z-20 mt-1 min-w-[180px] max-w-[360px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${o} c4a-scrollbar overflow-y-auto`,children:l.map(j=>f.jsxs("button",{onClick:()=>{s(j.value),m(!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 ${j.value===n?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[f.jsx(al,{size:12,className:`shrink-0 ${j.value===n?"opacity-100":"opacity-0"}`}),f.jsx("span",{className:"truncate",children:j.label})]},j.value))})]})}const d_=/\.md$/i,Zu=100,f_=(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 m_({rpc:n,repoPath:l,onReady:s,onBusyChange:i}){const{t:o}=Ee(),[u,m]=v.useState(""),[p,g]=v.useState([]),[h,b]=v.useState(""),[y,_]=v.useState([]),[j,N]=v.useState(!1),[T,k]=v.useState(!0),[X,F]=v.useState(!1),[G,J]=v.useState(!1),[V,I]=v.useState([]),[$,w]=v.useState([]),[,A]=v.useState([]),[Q,ue]=v.useState(),se=v.useMemo(()=>Q?Gx(Q):null,[Q]),[xe,ae]=v.useState("packages"),[ie,M]=v.useState(Zu),P=v.useRef(null),de=v.useRef(null);v.useEffect(()=>{if(!T){F(!1);return}const fe=setTimeout(()=>F(!0),2e3);return()=>clearTimeout(fe)},[T]),v.useEffect(()=>{M(Zu),de.current?.scrollTo(0,0)},[xe]),v.useEffect(()=>{const fe=P.current;if(!fe)return;const jt=xe==="packages"?V.length:$.length;if(ie>=jt)return;const Mt=new IntersectionObserver(Te=>{Te[0]?.isIntersecting&&M(De=>Math.min(De+Zu,jt))},{root:de.current,threshold:.1});return Mt.observe(fe),()=>Mt.disconnect()},[xe,ie,V.length,$.length]);const ce=v.useCallback(async(fe,jt)=>{J(!0),i?.(!0);try{const Mt=await n("fs/repoScan",{path:l,hash:fe}),Te=Mt.files||[],De=Mt.manifests||[];A(Te);const Xe=[];for(const Tt of De){const sa=Tt.path.split("/"),ya=sa.slice(0,-1).join("/")||".",Ga=sa.length===1||Tt.path==="package.json",nl=ya==="."?l.split("/").pop()||"root":sa[sa.length-2]||ya,ll=f_(Tt.path,Tt.content);Xe.push({name:ll||nl,path:ya,isRoot:Ga})}const lt=Te.filter(Tt=>d_.test(Tt.path)).map(Tt=>Tt.path);w(lt),I(Xe);const Wt=jt?.branch??u,Gt=jt?.isDirty??j;s({branch:Wt,commit:fe,isDirty:Gt,repoFiles:Te,packages:Xe,mdFiles:lt,repoFileContents:De})}catch{}finally{J(!1),i?.(!1)}},[n,l,u,j,s,i]);v.useEffect(()=>{(async()=>{k(!0),i?.(!0);try{const fe=await n("fs/repoStatus",{path:l});m(fe.branch),g(fe.branches||[fe.branch]),b(fe.head_hash),N(fe.is_dirty),ue(fe.remote_url),_(fe.commits||[{hash:fe.head_hash,message:"HEAD"}]),await ce(fe.head_hash,{branch:fe.branch,isDirty:fe.is_dirty})}catch{}finally{k(!1),i?.(!1)}})()},[l]),v.useEffect(()=>{s({branch:u,commit:h,isDirty:j,packages:V,mdFiles:$,repoFileContents:[]})},[u,h,j]);const Re=v.useCallback(async fe=>{m(fe);try{const jt=await n("fs/repoStatus",{path:l});b(jt.head_hash),await ce(jt.head_hash)}catch{}},[l,n,ce]),E=u&&u!=="main"&&u!=="master",q=l.split("/").pop()||l;if(T)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center",children:[f.jsx(Zt,{size:20,className:"animate-spin text-c4a-accent"}),X&&f.jsx("p",{className:"mt-3 font-mono text-xs text-c4a-accent",children:o("sources.import.loading_repo_slow")})]});const ee=p.map(fe=>({value:fe,label:fe})),ne=y.map(fe=>({value:fe.hash,label:`${fe.hash.slice(0,7)} ${fe.message!=="HEAD"?`— ${fe.message.slice(0,50)}`:""}`.trim()})),ve=y.length<=1,Se=xe==="packages"?V:$,ze=Se.slice(0,ie),it=ie<Se.length;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsxs("div",{className:"shrink-0",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[f.jsx("span",{className:"flex items-center gap-1.5",children:se?f.jsxs("a",{href:se.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 font-mono text-sm font-bold text-c4a-accent hover:underline",children:[f.jsx(sd,{size:14,className:"shrink-0"}),q]}):f.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:q})}),f.jsx("span",{className:"hidden font-mono text-xs text-c4a-text-muted sm:inline",children:l}),f.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[f.jsx(Og,{value:u,options:ee,onChange:Re,icon:f.jsx(ho,{size:12})}),ve?f.jsxs("span",{className:"hidden items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1 font-mono text-xs text-c4a-text-muted sm:flex",children:[f.jsx(rd,{size:12}),h.slice(0,7)]}):f.jsx("div",{className:"hidden sm:block",children:f.jsx(Og,{value:h,options:ne,onChange:fe=>{b(fe),ce(fe)},icon:f.jsx(rd,{size:12})})})]})]}),(E||j)&&f.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1",children:[E&&f.jsxs("p",{className:"flex items-center gap-1 text-xs text-c4a-info",children:[f.jsx(Nd,{size:12}),o("sources.import.branch_warning",{branch:u})]}),j&&f.jsxs("p",{className:"flex items-center gap-1 text-xs text-c4a-warning",children:[f.jsx(_d,{size:12}),o("sources.import.uncommitted_warning")]})]})]}),f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface",children:[f.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[f.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-primary sm:block",children:G?f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(Zt,{size:12,className:"animate-spin text-c4a-text-muted"}),f.jsx("span",{className:"text-c4a-text-muted",children:"Analyzing repository..."})]}):V.length>0?o("sources.import.recognized",{packages:V.length,docs:$.length}):o("sources.import.no_packages")}),!G&&(V.length>0||$.length>0)&&f.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[f.jsxs("button",{onClick:()=>ae("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${xe==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(zl,{size:13}),f.jsx("span",{className:"font-mono",children:V.length})]}),f.jsxs("button",{onClick:()=>ae("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${xe==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(jn,{size:13}),f.jsx("span",{className:"font-mono",children:$.length})]})]})]}),f.jsx("hr",{className:"border-c4a-border-subtle"}),f.jsx("div",{ref:de,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:G?f.jsx("div",{className:"flex items-center justify-center py-8",children:f.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}):Se.length===0?f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:xe==="packages"?o("sources.import.no_packages"):"—"}):f.jsxs(f.Fragment,{children:[xe==="packages"?ze.map(fe=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(zl,{size:14,className:"shrink-0 text-c4a-accent"}),f.jsx("span",{className:"text-c4a-text-primary",children:fe.name}),f.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:fe.path}),fe.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"})]},fe.path)):ze.map(fe=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(jn,{size:14,className:"shrink-0 text-c4a-text-secondary"}),f.jsx("span",{className:"truncate text-c4a-text-primary",children:fe})]},fe)),it&&f.jsx("div",{ref:P,className:"h-4"})]})})]})]})}function _n({icon:n,label:l,value:s,tooltip:i,size:o="sm"}){const u=o==="sm";return f.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted",children:[n,f.jsx("span",{className:"font-mono text-[10px] uppercase",children:l})]}),f.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-primary ${u?"text-sm truncate":"text-lg"}`,title:u?String(s):void 0,children:s}),i&&f.jsx("div",{className:"pointer-events-none absolute bottom-full left-0 z-30 mb-1.5 hidden w-max max-w-[260px] rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/stat:block",children:i})]})}function h_({importState:n,libraryName:l,importing:s}){const{t:i}=Ee(),o=n.repoName||n.repoPath.split("/").pop()||"";return f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:i("sources.import.confirm_heading",{name:l})}),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:o}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:n.repoPath})]}),f.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[f.jsx(_n,{icon:f.jsx(ho,{size:14}),label:i("sources.import.branch"),value:n.branch}),f.jsx(_n,{icon:f.jsx(rd,{size:14}),label:i("sources.import.commit"),value:n.commit.slice(0,7)}),f.jsx(_n,{icon:f.jsx(zl,{size:14}),label:i("sources.import.packages"),value:String(n.packages.length),tooltip:i("sources.import.dir_code_packages_tip")}),f.jsx(_n,{icon:f.jsx(jn,{size:14}),label:i("sources.import.documents"),value:String(n.mdFiles.length),tooltip:i("sources.import.dir_doc_files_tip")})]}),s&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Zt,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:i("sources.import.importing")})]})]})}function p_(){const{t:n}=Ee(),l=wn(),{libId:s}=Hs(),o=Vt(Ml(Cr)).find(A=>A.id===s),u=_o(A=>A.createSource),[m,p]=v.useState(1),[g,h]=v.useState(!1),[b,y]=v.useState(null),[_,j]=v.useState(!1),[N,T]=v.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),k=o?.is_online??!1,{rpc:X,importedPaths:F,allowedPaths:G}=Yx(s,o),J=v.useCallback((A,Q)=>{T(ue=>({...ue,repoPath:A,repoName:Q}))},[]),V=v.useCallback(A=>{T(Q=>({...Q,...A}))},[]),I=v.useCallback(async()=>{if(s){h(!0);try{const A=await u({library_id:s,repo_name:N.repoName,repo_root_path:N.repoPath,repo_branch:N.branch,repo_commit:N.commit,repo_files:N.repoFiles.map(ue=>ue.path),repo_file_contents:N.repoFileContents}),Q=Array.isArray(A)?A[0]:A;Q?.id?l(`/studio/sources/${s}?rootId=${Q.id}`):l(`/studio/sources/${s}`)}catch(A){const Q=A instanceof Error?A.message:String(A);y(Q),h(!1)}}},[s,N,u,l]),$=v.useMemo(()=>m===1?!!N.repoPath:m===2?!!N.commit:!0,[m,N]),w=v.useMemo(()=>o?[{label:o.id===tl?n("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:n("sources.import.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(Rr,{segments:w})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(el,{active:m>=1,current:m===1}),f.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Ms,{}),f.jsx(el,{active:m>=2,current:m===2}),f.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Ms,{}),f.jsx(el,{active:m>=3,current:m===3}),f.jsx("span",{className:m===3?"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:k?f.jsxs(f.Fragment,{children:[m===1&&f.jsx(u_,{rpc:X,selectedPath:N.repoPath,onSelect:J,allowedPaths:G,importedPaths:F}),m===2&&f.jsx(m_,{rpc:X,repoPath:N.repoPath,onReady:V,onBusyChange:j}),m===3&&f.jsx(h_,{importState:N,libraryName:o.name,importing:g})]}):f.jsx(qx,{libraryName:o.name})}),k&&f.jsx(wd,{step:m,totalSteps:3,importing:g,stepBusy:_,canProceed:$,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>p(A=>A-1),onNext:()=>p(A=>A+1),onImport:I}),b&&f.jsxs(kl,{onClose:()=>y(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:b}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>y(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const Dg=(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 g_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Ee(),{atRoot:m,currentPath:p,entries:g,loading:h,error:b,homeDir:y,goToOpen:_,isWildcard:j,importedSet:N,dirs:T,files:k,loadTree:X,handleNavigateUp:F,setGoToOpen:G}=Kx({rpc:n,allowedPaths:i??[],importedPaths:o??[]}),J=v.useCallback(w=>{if(w.type!=="directory"||N.has(w.path))return;const A=Dg(w.children||[],w.path);s(w.path,w.name,A),X(w.path)},[s,X,N]);v.useEffect(()=>{if(p&&!m&&g.length>=0&&!h){const w=p.split("/").pop()||p,A=Dg(g,p);s(p,w,A)}},[p,m,g,h,s]);const V=v.useMemo(()=>l?l.split("/").pop()||l:"",[l]),I=v.useMemo(()=>T.sort((w,A)=>w.is_git_repo&&!A.is_git_repo?-1:!w.is_git_repo&&A.is_git_repo?1:w.name.localeCompare(A.name)),[T]),$=v.useMemo(()=>k.sort((w,A)=>w.name.localeCompare(A.name)),[k]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx($x,{})]}):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(za,{size:12}),f.jsx("span",{children:V})]}):j&&m?f.jsx("button",{onClick:()=>G(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?j?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:y&&f.jsxs("button",{onClick:()=>X(y),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(za,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[y,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(Jt,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(w=>f.jsxs("button",{onClick:()=>X(w),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(za,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:w}),f.jsx(Jt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},w))}):b&&!h?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:b}):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(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&f.jsxs("button",{onClick:F,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(za,{size:14}),f.jsx("span",{children:".."})]}),I.map(w=>{const A=N.has(w.path),Q=w.is_git_repo?jd:za;return f.jsxs("button",{onClick:()=>J(w),disabled:A||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${A?"cursor-not-allowed text-c4a-accent/60":l===w.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[f.jsx(Q,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate",children:w.name}),A&&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(Jt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},w.path)}),$.map(w=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Cx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:w.name})]},w.path)),g.length===0&&!h&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),f.jsx(Vx,{open:_,onClose:()=>G(!1),rpc:n,onNavigate:X,defaultPath:y??void 0})]})}const x_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),y_=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&&x_.has(h.toLowerCase())){const b=p.path.split("/").slice(0,-1).join("/");n.some(_=>_.type==="directory"&&_.is_git_repo&&(b===_.path||b.startsWith(`${_.path}/`)))||m.add(b)}}return i=m.size,{totalFiles:l,totalDirs:s,codePackages:i,docFiles:o,gitRepos:u}};function v_({dirPath:n,rpc:l,importing:s,onScanComplete:i,onBusyChange:o}){const{t:u}=Ee(),[m,p]=v.useState(!1),[g,h]=v.useState(null),[b,y]=v.useState(null),_=v.useCallback(async()=>{p(!0),o?.(!0),h(null),y(null);try{const j=await l("fs/dirScan",{path:n}),N=j.entries||[],T=j.manifests||[],k=y_(N);y(k),i(N,k,T)}catch(j){const N=j instanceof Error?j.message:String(j);h(N)}finally{p(!1),o?.(!1)}},[n,l,i,o]);return v.useEffect(()=>{_()},[_]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),f.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[m&&f.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[f.jsx(Zt,{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(_d,{size:14,className:"mt-0.5 shrink-0"}),u("sources.import.dir_scan_error")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:g}),f.jsxs("button",{onClick:_,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Tx,{size:12}),u("sources.import.dir_scan_retry")]})]}),b&&!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(_n,{icon:f.jsx(jn,{size:14}),label:u("sources.import.dir_doc_files"),value:b.docFiles,tooltip:u("sources.import.dir_doc_files_tip"),size:"lg"}),f.jsx(_n,{icon:f.jsx(zl,{size:14}),label:u("sources.import.dir_code_packages"),value:b.codePackages,tooltip:u("sources.import.dir_code_packages_tip"),size:"lg"}),b.gitRepos>0&&f.jsx(_n,{icon:f.jsx(jd,{size:14}),label:u("sources.import.dir_git_repos"),value:b.gitRepos,size:"lg"}),f.jsx(_n,{icon:f.jsx(za,{size:14}),label:u("sources.import.dir_total_dirs"),value:b.totalDirs,size:"lg"}),f.jsx(_n,{icon:f.jsx(b2,{size:14}),label:u("sources.import.dir_total_files"),value:b.totalFiles,size:"lg"})]}),b.gitRepos>0&&f.jsx("p",{className:"text-xs text-c4a-warning",children:u("sources.import.dir_git_skip_hint",{count:b.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(Zt,{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}=Ee(),l=wn(),{libId:s}=Hs(),o=Vt(Ml(Cr)).find(A=>A.id===s),u=_o(A=>A.createSource),[m,p]=v.useState(1),[g,h]=v.useState(!1),[b,y]=v.useState(null),[_,j]=v.useState(!1),[N,T]=v.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),k=o?.is_online??!1,{rpc:X,importedPaths:F,allowedPaths:G}=Yx(s,o),J=v.useCallback((A,Q,ue)=>{T(se=>({...se,dirPath:A,dirName:Q,fileCount:ue.files,subDirCount:ue.dirs,gitRepoCount:ue.gitRepos,mdFiles:ue.mdFiles}))},[]),V=v.useCallback((A,Q,ue)=>{T(se=>({...se,scanEntries:A,scanStats:Q,manifests:ue}))},[]),I=v.useCallback(async()=>{if(s){h(!0);try{const A=await u({library_id:s,dir_files:N.scanEntries,dir_name:N.dirName,dir_path:N.dirPath,dir_file_contents:N.manifests}),Q=Array.isArray(A)?A[0]:A;Q?.id?l(`/studio/sources/${s}?rootId=${Q.id}`):l(`/studio/sources/${s}`)}catch(A){const Q=A instanceof Error?A.message:String(A);y(Q),h(!1)}}},[s,N,u,l]),$=v.useMemo(()=>m===1?!!N.dirPath:m===2?N.scanEntries.length>0:!0,[m,N]),w=v.useMemo(()=>o?[{label:o.id===tl?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(Rr,{segments:w})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(el,{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(Ms,{}),f.jsx(el,{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:k?f.jsxs(f.Fragment,{children:[m===1&&f.jsx(g_,{rpc:X,selectedPath:N.dirPath,onSelect:J,allowedPaths:G,importedPaths:F}),m===2&&f.jsx(v_,{dirPath:N.dirPath,rpc:X,importing:g,onScanComplete:V,onBusyChange:j})]}):f.jsx(qx,{libraryName:o.name})}),k&&f.jsx(wd,{step:m,totalSteps:2,importing:g,stepBusy:_,canProceed:$,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>p(A=>A-1),onNext:()=>p(A=>A+1),onImport:I}),b&&f.jsxs(kl,{onClose:()=>y(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:b}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>y(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const S_=/^https:\/\/[^/]+\/.+/;function __({url:n,onUrlChange:l,onValidChange:s}){const{t:i}=Ee(),[o,u]=v.useState(null),m=v.useRef(null),p=v.useCallback(b=>{if(!b){u(null),s(!1);return}S_.test(b)?(u(null),s(!0)):(u(i("sources.import_remote.url_invalid")),s(!1))},[s,i]),g=v.useCallback(b=>{const y=b.target.value;l(y),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>p(y),300)},[l,p]),h=v.useCallback(b=>{b.preventDefault();const y=b.clipboardData.getData("text").trim();l(y),m.current&&clearTimeout(m.current),p(y)},[l,p]);return v.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),v.useEffect(()=>{n&&p(n)},[]),f.jsxs("div",{className:"mx-auto w-full max-w-xl space-y-4 py-8",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:i("sources.import_remote.url_label")}),f.jsx("input",{type:"text",value:n,onChange:g,onPaste:h,placeholder:i("sources.import_remote.url_placeholder"),className:"mt-2 w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none",autoFocus:!0})]}),o?f.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[f.jsx(Dl,{size:12,className:"shrink-0"}),o]}):f.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[f.jsx(Nd,{size:12,className:"shrink-0"}),i("sources.import_remote.url_hint")]})]})}function Mg(n){try{return new URL(n).hostname}catch{return n}}function j_(n,l,s){if(n instanceof Cl){const i=n.message.toLowerCase();if(n.status===503)return s("sources.import_remote.error.capacity");if(i.includes("authentication")||i.includes("token")||i.includes("credential")||i.includes("401")||i.includes("403"))return s("sources.import_remote.error.auth_required",{host:Mg(l)});if(i.includes("not found")||i.includes("404")||i.includes("does not exist"))return s("sources.import_remote.error.not_found")}return n instanceof TypeError&&n.message.includes("fetch")?s("sources.import_remote.error.network"):s("sources.import_remote.error.auth_required",{host:Mg(l)})}function N_({libraryId:n,url:l,selectedRef:s,commit:i,onRefChange:o,onCommitChange:u,onRefsLoaded:m,onValidChange:p}){const{t:g}=Ee(),[h,b]=v.useState(!1),[y,_]=v.useState(null),[j,N]=v.useState(null),[T,k]=v.useState(!0),[X,F]=v.useState(!0),[G,J]=v.useState(!1),V=v.useCallback(async()=>{b(!0),_(null);try{const $=await yt.post("/import/remote/refs",{library_id:n,url:l});N($),m($);const w=$.branches??[];if(!s&&w.length>0){const A=w.find(ue=>ue.name===$.default),Q=w[0];o(A?.name??Q?.name??"")}}catch($){_(j_($,l,g))}finally{b(!1)}},[n,l,s,o,m,g]);if(v.useEffect(()=>{V()},[]),v.useEffect(()=>{p(!!s)},[s,p]),h)return f.jsxs("div",{className:"flex flex-1 items-center justify-center py-12",children:[f.jsx(Zt,{size:20,className:"animate-spin text-c4a-text-muted"}),f.jsx("span",{className:"ml-2 text-sm text-c4a-text-muted",children:g("sources.import_remote.loading_refs")})]});if(y)return f.jsx("div",{className:"mx-auto w-full max-w-xl py-8",children:f.jsxs("div",{className:"rounded-sm border border-red-500/20 bg-red-500/10 p-4",children:[f.jsxs("p",{className:"font-mono text-sm font-medium text-red-400",children:[f.jsx(Dl,{size:14,className:"mr-1 inline-block"}),g("sources.import_remote.error.auth_failed")]}),f.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:y}),f.jsxs("button",{onClick:V,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(Tx,{size:12}),g("sources.import_remote.retry")]})]})});if(!j)return null;const I=j.branches.find($=>$.name===s)?.name??j.tags.find($=>$.name===s)?.name??s;return f.jsxs("div",{className:"mx-auto w-full max-w-xl space-y-6 py-8",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:g("sources.import_remote.ref_label")}),f.jsxs("div",{className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>J(!G),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 text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{children:I||"—"}),f.jsx(Jt,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${G?"rotate-90":""}`})]}),G&&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:[j.branches.length>0&&f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>k(!T),className:"flex w-full items-center gap-1 px-3 py-1.5 font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(Jt,{size:10,className:`transition-transform duration-200 ${T?"rotate-90":""}`}),g("sources.import_remote.ref_branches")]}),T&&j.branches.map($=>f.jsxs("button",{onClick:()=>{o($.name),J(!1)},className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:"truncate",children:$.name}),$.name===s&&f.jsx("span",{className:"text-c4a-accent",children:"✓"})]},`b-${$.name}`))]}),j.tags.length>0&&f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>F(!X),className:"flex w-full items-center gap-1 px-3 py-1.5 font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(Jt,{size:10,className:`transition-transform duration-200 ${X?"rotate-90":""}`}),g("sources.import_remote.ref_tags")]}),X&&j.tags.map($=>f.jsxs("button",{onClick:()=>{o($.name),J(!1)},className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:"truncate",children:$.name}),$.name===s&&f.jsx("span",{className:"text-c4a-accent",children:"✓"})]},`t-${$.name}`))]})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:g("sources.import_remote.commit_label")}),f.jsx("input",{type:"text",value:i,onChange:$=>u($.target.value.slice(0,40)),placeholder:"e.g. a1b2c3d",maxLength:40,className:"mt-2 w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none"}),f.jsxs("p",{className:"mt-1.5 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[f.jsx(Nd,{size:12,className:"shrink-0"}),g("sources.import_remote.commit_hint")]})]})]})}const w_="_pulseBar_17bq5_1",E_={pulseBar:w_};function C_({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}){const{t:u}=Ee();return f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"space-y-2",children:n.map(m=>{const p=s.includes(m.key),g=i===m.key,h=l===m.key;return f.jsxs("div",{className:"flex items-center gap-3",children:[g?f.jsx(Dl,{size:14,className:"shrink-0 text-red-400"}):p||h?f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:`block h-2 w-2 rounded-full bg-c4a-accent ${h?"animate-pulse":""}`})}):f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:"block h-2 w-2 rounded-full border border-c4a-text-muted/40"})}),f.jsx("span",{className:`flex-1 text-sm ${g?"text-red-400":h?"font-medium text-c4a-text-primary":p?"text-c4a-text-secondary":"text-c4a-text-muted"}`,children:m.label}),p&&f.jsx(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.jsxs("div",{className:"space-y-1",children:[o&&o.percent>=0?f.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-c4a-bg-elevated",children:f.jsx("div",{className:"h-full rounded-full bg-c4a-accent transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,o.percent))}%`}})}):f.jsx("div",{className:`h-1.5 rounded-full bg-c4a-bg-elevated ${E_.pulseBar}`}),o&&o.label&&f.jsx("p",{className:"truncate font-mono text-xs text-c4a-text-muted",children:o.label})]})]})}function R_({url:n,ref:l,commit:s,importing:i,importDone:o,importResult:u,stages:m,currentStage:p,completedStages:g,failedStage:h,progress:b,failedError:y}){const{t:_}=Ee(),j=s?s.slice(0,7):_("sources.import_remote.commit_latest");return!i&&!o?f.jsx("div",{className:"mx-auto w-full max-w-xl py-8",children:f.jsxs("div",{className:"rounded-sm border border-c4a-border-subtle bg-c4a-bg-surface p-6 space-y-4",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:_("sources.import_remote.summary_repo")}),f.jsx("p",{className:"mt-1 font-mono text-sm text-c4a-text-primary",children:n})]}),f.jsxs("div",{children:[f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:_("sources.import_remote.summary_branch")}),f.jsx("p",{className:"mt-1 font-mono text-sm text-c4a-text-primary",children:l})]}),f.jsxs("div",{children:[f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:_("sources.import_remote.summary_commit")}),f.jsxs("p",{className:"mt-1 font-mono text-sm text-c4a-text-primary",children:[j,!s&&f.jsx("span",{className:"ml-1 text-c4a-text-muted",children:_("sources.import_remote.commit_latest")})]})]})]})}):f.jsxs("div",{className:"mx-auto w-full max-w-xl space-y-4 py-8",children:[f.jsx(C_,{stages:m,currentStage:p,completedStages:g,failedStage:h,progress:b}),h&&y&&f.jsx("div",{className:"rounded-sm border border-red-500/20 bg-red-500/10 p-4",children:f.jsx("p",{className:"font-mono text-sm font-medium text-red-400",children:y})}),o&&u&&f.jsxs("div",{className:"rounded-sm border border-c4a-border-subtle bg-c4a-bg-surface p-4 space-y-3",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:_("sources.import.recognized",{packages:String(u.packages.length),docs:String(u.mdFiles.length)})}),u.packages.length>0&&f.jsx("div",{className:"space-y-1",children:u.packages.map(N=>f.jsxs("div",{className:"flex items-center gap-2 text-sm text-c4a-text-primary",children:[f.jsx(zl,{size:14,className:"shrink-0 text-c4a-accent"}),f.jsx("span",{className:"font-mono",children:N.name}),N.isRoot&&f.jsx("span",{className:"font-mono text-[10px] text-c4a-text-muted",children:"(monorepo)"})]},N.path))}),u.mdFiles.length>0&&f.jsxs("div",{className:"flex items-center gap-2 text-sm text-c4a-text-muted",children:[f.jsx(jn,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"font-mono truncate",children:[u.mdFiles.slice(0,3).join(", "),u.mdFiles.length>3&&", ..."]})]})]})]})}const kg=["prepare","clone","scan","save"];function Xx(n){try{return(new URL(n).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return"repo"}}function z_(n){return n==="cloning"?"clone":n==="detecting"||n==="extracting"?"scan":n==="saving"?"save":n}function T_(n,l){const s=[];for(const o of n)try{const u=JSON.parse(o.content);if(u.name){const m=o.path==="package.json";s.push({name:u.name,path:o.path,isRoot:m})}}catch{const u=o.path.includes("/")?o.path.split("/").slice(0,-1).join("/"):"";s.push({name:u||Xx(""),path:o.path})}const i=l.filter(o=>o.path.toLowerCase().endsWith(".md")).map(o=>o.path);return{packages:s,mdFiles:i}}function O_(){const{t:n}=Ee(),l=wn(),{libId:s}=Hs(),[i]=Sd(),o=i.get("url")||"",u=i.get("ref")||"",m=i.get("sourceUuid")||"",g=Vt(Ml(Cr)).find(Te=>Te.id===s),[h,b]=v.useState(o?2:1),[y,_]=v.useState(o),[j,N]=v.useState(!!o),[T,k]=v.useState(u),[X,F]=v.useState(""),[,G]=v.useState(null),[J,V]=v.useState(!!u),[I,$]=v.useState(!1),[w,A]=v.useState(!1),[Q,ue]=v.useState(null),[se,xe]=v.useState(null),[ae,ie]=v.useState(null),[M,P]=v.useState(null),[de,ce]=v.useState([]),[Re,E]=v.useState(null),q=v.useRef(null),ee=v.useMemo(()=>kg.map(Te=>({key:Te,label:n(`sources.import_remote.stage.${Te}`)})),[n]),ne=v.useCallback(Te=>{P(De=>(De&&De!==Te&&ce(Xe=>Xe.includes(De)?Xe:[...Xe,De]),Te)),E(null)},[]);v.useEffect(()=>I?$a.on("task/progress",De=>{const Xe=De,lt=z_(Xe.stage??"");lt&&kg.includes(lt)&&(ne(lt),E({percent:Xe.percent??-1,label:Xe.label??""}))}):void 0,[I,ne]);const ve=v.useCallback(async()=>{if(s){$(!0),A(!1),xe(null),ie(null),ce([]),P(null),E(null);try{ne("prepare"),await new Promise(Tt=>setTimeout(Tt,300)),ne("clone");const Te=await yt.post("/import/remote/clone",{library_id:s,url:y,ref:T,...X?{commit:X}:{}});ne("scan");const De=await yt.post("/import/remote/scan",{library_id:s,path:Te.path,hash:Te.commit_hash});ne("save");const Xe=Xx(y),lt=await yt.post("/import/remote/import",{library_id:s,url:y,ref:T,commit:Te.commit_hash,repo_name:Xe,repo_files:De.files.map(Tt=>Tt.path),repo_file_contents:De.manifests,...m?{source_uuid:m}:{}});ce(["prepare","clone","scan","save"]),P(null);const{packages:Wt,mdFiles:Gt}=T_(De.manifests,De.files);ue({packages:Wt,mdFiles:Gt}),A(!0),$(!1),q.current=lt.id}catch(Te){const De=M??"prepare";ie(De),P(null);let lt=n(`sources.import_remote.error.${De==="clone"?"clone":De==="scan"?"scan":De==="save"?"save":"clone"}_failed`);(Te instanceof Cl||Te instanceof Error)&&(lt=Te.message),xe(lt),$(!1)}}},[s,y,T,X,m,ne,M,n]),Se=v.useCallback(()=>{ie(null),xe(null),ve()},[ve]),ze=v.useCallback(()=>{s&&(q.current?l(`/studio/sources/${s}?rootId=${q.current}`):l(`/studio/sources/${s}`))},[s,l]),it=v.useMemo(()=>h===1?j:h===2?J:!I,[h,j,J,I]),fe=v.useMemo(()=>g?[{label:g.id===tl?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`},{label:n("sources.import_remote.title")}]:[],[g,n]);if(!g)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const jt=w,Mt=!!ae&&!I;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(Rr,{segments:fe})}),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(el,{active:h>=1,current:h===1}),f.jsx("span",{className:h===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import_remote.step.url")}),f.jsx(Ms,{}),f.jsx(el,{active:h>=2,current:h===2}),f.jsx("span",{className:h===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import_remote.step.version")}),f.jsx(Ms,{}),f.jsx(el,{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.confirm")})]}),f.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[h===1&&f.jsx(__,{url:y,onUrlChange:_,onValidChange:N}),h===2&&s&&f.jsx(N_,{libraryId:s,url:y,selectedRef:T,commit:X,onRefChange:k,onCommitChange:F,onRefsLoaded:G,onValidChange:V}),h===3&&f.jsx(R_,{url:y,ref:T,commit:X,importing:I,importDone:w,importResult:Q,stages:ee,currentStage:M,completedStages:de,failedStage:ae,progress:Re,failedError:se})]}),jt?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:ze,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")})}):Mt?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{b(1),ie(null),xe(null),ce([]),P(null)},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:Se,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")})]}):f.jsx(wd,{step:h,totalSteps:3,importing:I,stepBusy:!1,canProceed:it,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"sources.import_remote.step.confirm",onPrev:()=>b(Te=>Te-1),onNext:()=>b(Te=>Te+1),onImport:ve})]})}function D_(){const{t:n}=Ee(),l=wn(),s=Vt(_=>_.createLibrary),[i,o]=v.useState("waiting"),[u,m]=v.useState(null),[p,g]=v.useState(""),[h,b]=v.useState(!1);v.useEffect(()=>$a.on("ws:daemon:connected",j=>{const N=j;m(N),g(N.machine_id),o(N.needs_registration?"new_client":"reconnected")}),[]),v.useEffect(()=>{let _=!1;return(async()=>{try{const j=await yt.get("/daemons/pending");if(_||j.pending.length===0)return;const N=j.pending[0];m({machine_id:N.machine_id,needs_registration:!0}),g(N.machine_id),o("new_client")}catch{}})(),()=>{_=!0}},[]);const y=v.useCallback(async()=>{if(u){b(!0);try{const _=await s({type:"daemon",name:p||u.machine_id,config:{machine_id:u.machine_id,os:u.os||"",daemon_version:u.daemon_version||""}});l(`/studio/sources/${_.id}`)}catch{b(!1)}}},[u,p,s,l]);return f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Rr,{segments:[{label:n("sources.add_client.title")}]}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),f.jsx("div",{className:"mt-6 rounded border border-c4a-border-default bg-c4a-bg-surface p-5",children:f.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:["npm install -g @c4a/daemon ",f.jsx(Ag,{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(Ag,{text:`c4a-daemon --server ${window.location.host}`})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),f.jsxs("div",{className:"mt-6 rounded border border-c4a-border-default bg-c4a-bg-surface p-5",children:[i==="waiting"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Zt,{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(Fu,{label:n("sources.add_client.machine_name"),value:u.machine_id}),u.os&&f.jsx(Fu,{label:n("sources.add_client.os"),value:u.os}),u.daemon_version&&f.jsx(Fu,{label:n("sources.add_client.daemon_version"),value:u.daemon_version})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),f.jsx("input",{value:p,onChange:_=>g(_.target.value),className:"min-w-0 flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-2 py-1 font-mono text-xs text-c4a-text-primary outline-none focus:border-c4a-accent"})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx("button",{onClick:()=>l("/studio/sources"),className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("common.cancel")}),f.jsxs("button",{onClick:y,disabled:h||!p.trim(),className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-50",children:[h&&f.jsx(Zt,{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 Ag({text:n}){const[l,s]=v.useState(!1),i=v.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(ld,{size:13})})}function Fu({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 M_(){const{t:n}=Ee(),{sourceUuid:l}=Hs(),[s]=Sd(),i=s.get("path")||"",{currentRoot:o,loading:u,fetchRootSource:m}=_o(),p=Vt(Ml(Cr)),[g,h]=v.useState("original");v.useEffect(()=>{l&&m(l)},[l,m]);const b=v.useMemo(()=>o?i?So(o.tree,i):o.kind==="source"?{path:"",kind:o.kind,source_type:o.source_type,name:o.name,metadata:o.metadata,index_status:o.index_status}:null:null,[o,i]),y=p.find(G=>G.id===o?.library_id),_=b?.metadata,j=_?Object.fromEntries(Object.entries(_).map(([G,J])=>[G,String(J??"")])):null,N=b?.source_type==="code",T=b?.name??o?.name??"",k=b?.source_type??null,X=v.useMemo(()=>{if(!o||!y)return[];const G=o.kind==="source"&&!i,J=[{label:y.id===tl?n("sources.library.default_cloud_name"):y.name,to:`/studio/sources/${y.id}`},{label:o.name,...G?{}:{to:`/studio/sources/${y.id}?rootId=${o.id}`}}];if(i){const V=Ux(o.tree,i);for(let I=0;I<V.length-1;I++){const $=V[I];J.push({label:$.name,to:`/studio/sources/${y.id}?rootId=${o.id}&path=${encodeURIComponent($.path)}`})}V.length>0&&J.push({label:V[V.length-1].name})}return J},[o,y,i,n]),F=[{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||!b?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(Rr,{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(zl,{size:20,className:"shrink-0 text-c4a-accent"}):f.jsx(jn,{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:T})]}),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(k==="code"?"sources.type.code":"sources.type.doc")})]}),N&&j?.relative_path&&f.jsxs("span",{children:[n("sources.detail.path"),":"," ",f.jsx("span",{className:"font-mono text-c4a-text-secondary",children:j.relative_path})]}),!N&&f.jsxs("span",{children:[n("sources.detail.origin"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:y?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),f.jsxs("span",{children:[n("sources.detail.status"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${b.index_status??"none"}`)})]})]})]}),N&&j&&f.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[j.repo_name&&f.jsx(ro,{label:n("sources.detail.repo"),value:j.repo_name}),j.pinned_branch&&f.jsx(ro,{label:n("sources.detail.branch"),value:j.pinned_branch}),j.pinned_hash&&f.jsx(ro,{label:n("sources.detail.commit"),value:j.pinned_hash.slice(0,7)}),j.tech_stack&&f.jsx(ro,{label:n("sources.detail.tech_stack"),value:j.tech_stack})]})}),f.jsx("div",{className:"mt-3 flex border-b border-c4a-border-subtle",children:F.map(G=>f.jsx("button",{onClick:()=>h(G.key),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${g===G.key?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:G.label},G.key))}),f.jsxs("div",{className:"mt-4 flex-1",children:[g==="original"&&f.jsx(k_,{node:b,isCode:N}),g==="digest"&&f.jsx(Lg,{message:n("sources.detail.digest_placeholder")}),g==="modeling"&&f.jsx(Lg,{message:n("sources.detail.modeling_placeholder")})]})]})}function ro({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 k_({node:n,isCode:l}){const{t:s}=Ee(),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 Lg({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 A_=T4([{element:f.jsx(jS,{}),children:[{path:"/",element:f.jsx(RS,{})},{path:"/login",element:f.jsx(zS,{})},{path:"/docs",element:f.jsx(TS,{})}]},{path:"/studio",element:f.jsx(CS,{}),children:[{index:!0,element:f.jsx(pg,{to:"/studio/sources",replace:!0})},{path:"sources",element:f.jsx(pg,{to:`/studio/sources/${tl}`,replace:!0})},{path:"sources/add-client",element:f.jsx(D_,{})},{path:"sources/import/:libId",element:f.jsx(p_,{})},{path:"sources/import-dir/:libId",element:f.jsx(b_,{})},{path:"sources/import-remote/:libId",element:f.jsx(O_,{})},{path:"sources/:libId",element:f.jsx(i_,{})},{path:"source/:sourceUuid",element:f.jsx(M_,{})},{path:"modeling",element:f.jsx(DS,{})},{path:"modeling/code/setup",element:f.jsx(HS,{})},{path:"modeling/code/compile",element:f.jsx(BS,{})},{path:"modeling/code/review",element:f.jsx(qS,{})},{path:"modeling/code/result",element:f.jsx(YS,{})},{path:"brain",element:f.jsx(MS,{})},{path:"discovery",element:f.jsx(kS,{})},{path:"sharing",element:f.jsx(AS,{})},{path:"collaboration",element:f.jsx(LS,{})},{path:"settings",element:f.jsx(US,{})}]},{path:"*",element:f.jsx(OS,{})}]);function L_(){return v.useEffect(()=>{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return $a.connect(l),()=>{$a.disconnect()}},[]),f.jsx(a4,{router:A_})}gb.createRoot(document.getElementById("root")).render(f.jsx(v.StrictMode,{children:f.jsx(L_,{})}));
|