@c4a/server-cli 0.4.12-alpha.2 → 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.
Files changed (194) hide show
  1. package/index.js +4255 -1109
  2. package/package.json +2 -1
  3. package/serve.js +11236 -2504
  4. package/web/assets/ContentCard-D0mL7yOO.js +1 -0
  5. package/web/assets/ContentCard-_I22pq8z.js +1 -0
  6. package/web/assets/ContentDetail-BlCJjlr2.js +65 -0
  7. package/web/assets/ContentDetail-BtrIxG3F.js +1 -0
  8. package/web/assets/ContentDetail-DVIbcpNs.js +65 -0
  9. package/web/assets/EntityDetail-BBLfJ9LL.js +3 -0
  10. package/web/assets/EntityDetail-CHe5PkO9.js +1 -0
  11. package/web/assets/EntityDetail-CQNu3A3D.js +3 -0
  12. package/web/assets/JsonTree-BRUca2ED.js +1 -0
  13. package/web/assets/JsonTree-Dd_iNoWA.js +1 -0
  14. package/web/assets/RelationDetail-BoTv8wr4.js +1 -0
  15. package/web/assets/RelationDetail-CZwj9HUp.js +1 -0
  16. package/web/assets/RelationDetail-CkBj9cCj.js +1 -0
  17. package/web/assets/andromeeda-C4gqWexZ.js +1 -0
  18. package/web/assets/angular-html-DA-rfuFy.js +1 -0
  19. package/web/assets/angular-ts-BrjP3tb8.js +1 -0
  20. package/web/assets/astro-HNnZUWAn.js +1 -0
  21. package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
  22. package/web/assets/ayu-dark-DYE7WIF3.js +1 -0
  23. package/web/assets/ayu-light-BA47KaF1.js +1 -0
  24. package/web/assets/ayu-mirage-32ctXXKs.js +1 -0
  25. package/web/assets/blade-BjGOyj-B.js +1 -0
  26. package/web/assets/c-BIGW1oBm.js +1 -0
  27. package/web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  28. package/web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  29. package/web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  30. package/web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  31. package/web/assets/coffee-Ch7k5sss.js +1 -0
  32. package/web/assets/cpp-CofmeUqb.js +1 -0
  33. package/web/assets/css-CLj8gQPS.js +1 -0
  34. package/web/assets/csv-fuZLfV_i.js +1 -0
  35. package/web/assets/dark-plus-C3mMm8J8.js +1 -0
  36. package/web/assets/dracula-BzJJZx-M.js +1 -0
  37. package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
  38. package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
  39. package/web/assets/everforest-light-C8M2exoo.js +1 -0
  40. package/web/assets/github-dark-DHJKELXO.js +1 -0
  41. package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
  42. package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  43. package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  44. package/web/assets/github-light-DAi9KRSo.js +1 -0
  45. package/web/assets/github-light-default-D7oLnXFd.js +1 -0
  46. package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  47. package/web/assets/glsl-DplSGwfg.js +1 -0
  48. package/web/assets/graphql-ChdNCCLP.js +1 -0
  49. package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  50. package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  51. package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  52. package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  53. package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  54. package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  55. package/web/assets/haml-D5jkg6IW.js +1 -0
  56. package/web/assets/handlebars-BpdQsYii.js +1 -0
  57. package/web/assets/horizon-BUw7H-hv.js +1 -0
  58. package/web/assets/horizon-bright-CUuTKBJd.js +1 -0
  59. package/web/assets/houston-DnULxvSX.js +1 -0
  60. package/web/assets/html-derivative-DlHx6ybY.js +1 -0
  61. package/web/assets/html-pp8916En.js +1 -0
  62. package/web/assets/http-jrhK8wxY.js +1 -0
  63. package/web/assets/hurl-irOxFIW8.js +1 -0
  64. package/web/assets/imba-DGztddWO.js +1 -0
  65. package/web/assets/index-1QkfhsIS.js +12 -0
  66. package/web/assets/index-8J6WgTr0.js +238 -0
  67. package/web/assets/index-B1KeXpYL.css +1 -0
  68. package/web/assets/index-B1zrTc3w.js +12 -0
  69. package/web/assets/index-B6uGMtfP.css +1 -0
  70. package/web/assets/index-BCzQnf3x.css +1 -0
  71. package/web/assets/index-BE9z9PQF.js +238 -0
  72. package/web/assets/index-BF6rVrre.js +238 -0
  73. package/web/assets/index-BLskFmu3.js +193 -0
  74. package/web/assets/index-BMVKFQ7h.js +238 -0
  75. package/web/assets/index-BRwgHwhm.js +12 -0
  76. package/web/assets/index-BU6YkKWq.css +1 -0
  77. package/web/assets/index-BXaK4HKi.js +12 -0
  78. package/web/assets/index-BaBWjAP7.css +1 -0
  79. package/web/assets/index-Be3yvSxB.js +12 -0
  80. package/web/assets/index-Bh0nrxkS.css +1 -0
  81. package/web/assets/index-BjM7CFih.js +12 -0
  82. package/web/assets/index-BoqItESG.js +13 -0
  83. package/web/assets/index-Bxc-msf3.js +238 -0
  84. package/web/assets/index-Bxkj7nBM.css +1 -0
  85. package/web/assets/index-ByCT34eF.css +1 -0
  86. package/web/assets/index-C0SbV7Fr.js +238 -0
  87. package/web/assets/index-C1T-mIJp.js +238 -0
  88. package/web/assets/index-C1tbhKrB.css +1 -0
  89. package/web/assets/index-C6uqUNjs.js +238 -0
  90. package/web/assets/index-CKPy6nsr.js +238 -0
  91. package/web/assets/index-CSQvEPnB.js +238 -0
  92. package/web/assets/index-CU-x3HVJ.js +12 -0
  93. package/web/assets/index-CVcqJsfJ.js +12 -0
  94. package/web/assets/index-CWKka1Dm.css +1 -0
  95. package/web/assets/index-Cs1wjzzB.css +1 -0
  96. package/web/assets/index-D0FYwi5D.css +1 -0
  97. package/web/assets/index-D9pKIRoL.js +12 -0
  98. package/web/assets/index-DHMM5gmZ.js +12 -0
  99. package/web/assets/index-DMIK6qP9.js +12 -0
  100. package/web/assets/index-DNSKIsZU.js +238 -0
  101. package/web/assets/index-DW-afpe4.js +12 -0
  102. package/web/assets/index-DYi5EQi6.css +1 -0
  103. package/web/assets/index-DaUMALOp.css +1 -0
  104. package/web/assets/index-DeStbuhs.css +1 -0
  105. package/web/assets/index-DfXQnmId.js +12 -0
  106. package/web/assets/index-DisDw0E0.css +1 -0
  107. package/web/assets/index-Dm-_KwmC.css +1 -0
  108. package/web/assets/index-DmRvWfJA.js +12 -0
  109. package/web/assets/index-Drfhm6bu.js +12 -0
  110. package/web/assets/index-DvnO8hAI.js +12 -0
  111. package/web/assets/index-G3fxfqeh.js +238 -0
  112. package/web/assets/index-JdgClnFG.css +1 -0
  113. package/web/assets/index-P648JtKx.js +12 -0
  114. package/web/assets/index-PGORoGGx.js +13 -0
  115. package/web/assets/index-VCinLKUc.css +1 -0
  116. package/web/assets/index-ZtrM6iGG.js +12 -0
  117. package/web/assets/index-oRdZsAv2.js +238 -0
  118. package/web/assets/index-snZ8He7E.js +12 -0
  119. package/web/assets/index-zH92nrE5.css +1 -0
  120. package/web/assets/java-CylS5w8V.js +1 -0
  121. package/web/assets/javascript-wDzz0qaB.js +1 -0
  122. package/web/assets/jinja-f2NsQr07.js +1 -0
  123. package/web/assets/jison-wvAkD_A8.js +1 -0
  124. package/web/assets/json-Cp-IABpG.js +1 -0
  125. package/web/assets/json5-C9tS-k6U.js +1 -0
  126. package/web/assets/jsonc-Des-eS-w.js +1 -0
  127. package/web/assets/jsonl-DcaNXYhu.js +1 -0
  128. package/web/assets/jsx-g9-lgVsj.js +1 -0
  129. package/web/assets/julia-CxzCAyBv.js +1 -0
  130. package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  131. package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  132. package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
  133. package/web/assets/laserwave-DUszq2jm.js +1 -0
  134. package/web/assets/less-B1dDrJ26.js +1 -0
  135. package/web/assets/light-plus-B7mTdjB0.js +1 -0
  136. package/web/assets/markdown-Cvjx9yec.js +1 -0
  137. package/web/assets/marko-DjSrsDqO.js +1 -0
  138. package/web/assets/material-theme-D5KoaKCx.js +1 -0
  139. package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
  140. package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  141. package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
  142. package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  143. package/web/assets/mdc-DTYItulj.js +1 -0
  144. package/web/assets/mdx-Cmh6b_Ma.js +1 -0
  145. package/web/assets/min-dark-CafNBF8u.js +1 -0
  146. package/web/assets/min-light-CTRr51gU.js +1 -0
  147. package/web/assets/monokai-D4h5O-jR.js +1 -0
  148. package/web/assets/night-owl-C39BiMTA.js +1 -0
  149. package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
  150. package/web/assets/nord-Ddv68eIx.js +1 -0
  151. package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  152. package/web/assets/one-light-C3Wv6jpd.js +1 -0
  153. package/web/assets/php-R6g_5hLQ.js +1 -0
  154. package/web/assets/plastic-3e1v2bzS.js +1 -0
  155. package/web/assets/poimandres-CS3Unz2-.js +1 -0
  156. package/web/assets/postcss-CXtECtnM.js +1 -0
  157. package/web/assets/pug-DKIMFp6K.js +1 -0
  158. package/web/assets/python-B6aJPvgy.js +1 -0
  159. package/web/assets/r-Dspwwk_N.js +1 -0
  160. package/web/assets/red-bN70gL4F.js +1 -0
  161. package/web/assets/regexp-CDVJQ6XC.js +1 -0
  162. package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  163. package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  164. package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
  165. package/web/assets/sass-Cj5Yp3dK.js +1 -0
  166. package/web/assets/scss-D5BDwBP9.js +1 -0
  167. package/web/assets/shellscript-Yzrsuije.js +1 -0
  168. package/web/assets/slack-dark-BthQWCQV.js +1 -0
  169. package/web/assets/slack-ochin-DqwNpetd.js +1 -0
  170. package/web/assets/snazzy-light-Bw305WKR.js +1 -0
  171. package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
  172. package/web/assets/solarized-light-L9t79GZl.js +1 -0
  173. package/web/assets/sql-BLtJtn59.js +1 -0
  174. package/web/assets/stylus-BEDo0Tqx.js +1 -0
  175. package/web/assets/svelte-Cy7k_4gC.js +1 -0
  176. package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
  177. package/web/assets/tokyo-night-hegEt444.js +1 -0
  178. package/web/assets/ts-tags-DQrlYJgV.js +1 -0
  179. package/web/assets/tsx-COt5Ahok.js +1 -0
  180. package/web/assets/typescript-BPQ3VLAy.js +1 -0
  181. package/web/assets/vesper-DU1UobuO.js +1 -0
  182. package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
  183. package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
  184. package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
  185. package/web/assets/vue-D2xRrEX4.js +1 -0
  186. package/web/assets/vue-html-AaS7Mt5G.js +1 -0
  187. package/web/assets/vue-vine-BoDAl6tE.js +1 -0
  188. package/web/assets/wasm-CG6Dc4jp.js +1 -0
  189. package/web/assets/wasm-MzD3tlZU.js +1 -0
  190. package/web/assets/wgsl-Dx-B1_4e.js +1 -0
  191. package/web/assets/wit-5i3qLPDT.js +1 -0
  192. package/web/assets/xml-sdJ4AIDG.js +1 -0
  193. package/web/assets/yaml-Buea-lGh.js +1 -0
  194. package/web/index.html +2 -2
@@ -0,0 +1,12 @@
1
+ function i0(n,l){for(var s=0;s<l.length;s++){const i=l[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(n,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=s(o);fetch(o.href,u)}})();function o0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Au={exports:{}},vs={};var mp;function c0(){if(mp)return vs;mp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(i,o,u){var m=null;if(u!==void 0&&(m=""+u),o.key!==void 0&&(m=""+o.key),"key"in o){u={};for(var p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:n,type:i,key:m,ref:o!==void 0?o:null,props:u}}return vs.Fragment=l,vs.jsx=s,vs.jsxs=s,vs}var hp;function u0(){return hp||(hp=1,Au.exports=c0()),Au.exports}var f=u0();const Oe=n=>typeof n=="string",Ss=()=>{let n,l;const s=new Promise((i,o)=>{n=i,l=o});return s.resolve=n,s.reject=l,s},pp=n=>n==null?"":""+n,d0=(n,l,s)=>{n.forEach(i=>{l[i]&&(s[i]=l[i])})},f0=/###/g,gp=n=>n&&n.indexOf("###")>-1?n.replace(f0,"."):n,xp=n=>!n||Oe(n),Rs=(n,l,s)=>{const i=Oe(l)?l.split("."):l;let o=0;for(;o<i.length-1;){if(xp(n))return{};const u=gp(i[o]);!n[u]&&s&&(n[u]=new s),Object.prototype.hasOwnProperty.call(n,u)?n=n[u]:n={},++o}return xp(n)?{}:{obj:n,k:gp(i[o])}},yp=(n,l,s)=>{const{obj:i,k:o}=Rs(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=Rs(n,m,Object);for(;p.obj===void 0&&m.length;)u=`${m[m.length-1]}.${u}`,m=m.slice(0,m.length-1),p=Rs(n,m,Object),p?.obj&&typeof p.obj[`${p.k}.${u}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${u}`]=s},m0=(n,l,s,i)=>{const{obj:o,k:u}=Rs(n,l,Object);o[u]=o[u]||[],o[u].push(s)},ho=(n,l)=>{const{obj:s,k:i}=Rs(n,l);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},h0=(n,l,s)=>{const i=ho(n,s);return i!==void 0?i:ho(l,s)},$g=(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]):$g(n[i],l[i],s):n[i]=l[i]);return n},Tl=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var p0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const g0=n=>Oe(n)?n.replace(/[&<>"'\/]/g,l=>p0[l]):n;class x0{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const s=this.regExpMap.get(l);if(s!==void 0)return s;const i=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,i),this.regExpQueue.push(l),i}}const y0=[" ",",","?","!",";"],b0=new x0(20),v0=(n,l,s)=>{l=l||"",s=s||"";const i=y0.filter(m=>l.indexOf(m)<0&&s.indexOf(m)<0);if(i.length===0)return!0;const o=b0.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let u=!o.test(n);if(!u){const m=n.indexOf(s);m>0&&!o.test(n.substring(0,m))&&(u=!0)}return u},nd=(n,l,s=".")=>{if(!n)return;if(n[l])return Object.prototype.hasOwnProperty.call(n,l)?n[l]:void 0;const i=l.split(s);let o=n;for(let u=0;u<i.length;){if(!o||typeof o!="object")return;let m,p="";for(let g=u;g<i.length;++g)if(g!==u&&(p+=s),p+=i[g],m=o[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;u+=g-u+1;break}o=m}return o},Os=n=>n?.replace("_","-"),S0={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,l){console?.[n]?.apply?.(console,l)}};class po{constructor(l,s={}){this.init(l,s)}init(l,s={}){this.prefix=s.prefix||"i18next:",this.logger=l||S0,this.options=s,this.debug=s.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,s,i,o){return o&&!this.debug?null:(Oe(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[s](l))}create(l){return new po(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new po(this.logger,l)}}var rn=new po;class yo{constructor(){this.observers={}}on(l,s){return l.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(s)||0;this.observers[i].set(s,o+1)}),this}off(l,s){if(this.observers[l]){if(!s){delete this.observers[l];return}this.observers[l].delete(s)}}emit(l,...s){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o.apply(o,[l,...s])})}}class bp extends yo{constructor(l,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const s=this.options.ns.indexOf(l);s>-1&&this.options.ns.splice(s,1)}getResource(l,s,i,o={}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,m=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;l.indexOf(".")>-1?p=l.split("."):(p=[l,s],i&&(Array.isArray(i)?p.push(...i):Oe(i)&&u?p.push(...i.split(u)):p.push(i)));const g=ho(this.data,p);return!g&&!s&&!i&&l.indexOf(".")>-1&&(l=p[0],s=p[1],i=p.slice(2).join(".")),g||!m||!Oe(i)?g:nd(this.data?.[l]?.[s],i,u)}addResource(l,s,i,o,u={silent:!1}){const m=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let p=[l,s];i&&(p=p.concat(m?i.split(m):i)),l.indexOf(".")>-1&&(p=l.split("."),o=s,s=p[1]),this.addNamespaces(s),yp(this.data,p,o),u.silent||this.emit("added",l,s,i,o)}addResources(l,s,i,o={silent:!1}){for(const u in i)(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=ho(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?$g(g,i,u):g={...g,...i},yp(this.data,p,g),m.silent||this.emit("added",l,s,i)}removeResourceBundle(l,s){this.hasResourceBundle(l,s)&&delete this.data[l][s],this.removeNamespaces(s),this.emit("removed",l,s)}hasResourceBundle(l,s){return this.getResource(l,s)!==void 0}getResourceBundle(l,s){return s||(s=this.options.defaultNS),this.getResource(l,s)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const s=this.getDataByLanguage(l);return!!(s&&Object.keys(s)||[]).find(o=>s[o]&&Object.keys(s[o]).length>0)}toJSON(){return this.data}}var qg={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,l,s,i,o){return n.forEach(u=>{l=this.processors[u]?.process(l,s,i,o)??l}),l}};const Yg=Symbol("i18next/PATH_KEY");function _0(){const n=[],l=Object.create(null);let s;return l.get=(i,o)=>(s?.revoke?.(),o===Yg?n:(n.push(o),s=Proxy.revocable(i,l),s.proxy)),Proxy.revocable(Object.create(null),l).proxy}function ld(n,l){const{[Yg]:s}=n(_0());return s.join(l?.keySeparator??".")}const vp={},ku=n=>!Oe(n)&&typeof n!="boolean"&&typeof n!="number";class go extends yo{constructor(l,s={}){super(),d0(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=rn.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,s={interpolation:{}}){const i={...s};if(l==null)return!1;const o=this.resolve(l,i);if(o?.res===void 0)return!1;const u=ku(o.res);return!(i.returnObjects===!1&&u)}extractFromKey(l,s){let i=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=s.ns||this.options.defaultNS||[];const m=i&&l.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!v0(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=ld(l,{...this.options,...o})),Array.isArray(l)||(l=[String(l)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,m=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:p,namespaces:g}=this.extractFromKey(l[l.length-1],o),h=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=o.lng||this.language,_=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b?.toLowerCase()==="cimode")return _?u?{res:`${h}${v}${p}`,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:`${h}${v}${p}`:u?{res:p,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:p;const j=this.resolve(l,o);let R=j?.res;const T=j?.usedKey||p,A=j?.exactUsedKey||p,G=["[object Number]","[object Function]","[object RegExp]"],Z=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,Y=!this.i18nFormat||this.i18nFormat.handleAsObject,K=o.count!==void 0&&!Oe(o.count),X=go.hasDefaultValue(o),ne=K?this.pluralResolver.getSuffix(b,o.count,o):"",J=o.ordinal&&K?this.pluralResolver.getSuffix(b,o.count,{ordinal:!1}):"",w=K&&!o.ordinal&&o.count===0,H=w&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${ne}`]||o[`defaultValue${J}`]||o.defaultValue;let ee=R;Y&&!R&&X&&(ee=H);const de=ku(ee),ce=Object.prototype.toString.apply(ee);if(Y&&ee&&de&&G.indexOf(ce)<0&&!(Oe(Z)&&Array.isArray(ee))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const re=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,ee,{...o,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return u?(j.res=re,j.usedParams=this.getUsedParamsDetails(o),j):re}if(m){const re=Array.isArray(ee),ue=re?[]:{},me=re?A:T;for(const M in ee)if(Object.prototype.hasOwnProperty.call(ee,M)){const I=`${me}${m}${M}`;X&&!R?ue[M]=this.translate(I,{...o,defaultValue:ku(H)?H[M]:void 0,joinArrays:!1,ns:g}):ue[M]=this.translate(I,{...o,joinArrays:!1,ns:g}),ue[M]===I&&(ue[M]=ee[M])}R=ue}}else if(Y&&Oe(Z)&&Array.isArray(R))R=R.join(Z),R&&(R=this.extendTranslation(R,l,o,i));else{let re=!1,ue=!1;!this.isValidLookup(R)&&X&&(re=!0,R=H),this.isValidLookup(R)||(ue=!0,R=p);const M=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ue?void 0:R,I=X&&H!==R&&this.options.updateMissing;if(ue||re||I){if(this.logger.log(I?"updateKey":"missingKey",b,h,p,I?H:R),m){const N=this.resolve(p,{...o,keySeparator:!1});N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ie=[];const P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&P&&P[0])for(let N=0;N<P.length;N++)ie.push(P[N]);else this.options.saveMissingTo==="all"?ie=this.languageUtils.toResolveHierarchy(o.lng||this.language):ie.push(o.lng||this.language);const be=(N,$,F)=>{const le=X&&F!==R?F:M;this.options.missingKeyHandler?this.options.missingKeyHandler(N,h,$,le,I,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(N,h,$,le,I,o),this.emit("missingKey",N,h,$,R)};this.options.saveMissing&&(this.options.saveMissingPlurals&&K?ie.forEach(N=>{const $=this.pluralResolver.getSuffixes(N,o);w&&o[`defaultValue${this.options.pluralSeparator}zero`]&&$.indexOf(`${this.options.pluralSeparator}zero`)<0&&$.push(`${this.options.pluralSeparator}zero`),$.forEach(F=>{be([N],p+F,o[`defaultValue${F}`]||H)})}):be(ie,p,H))}R=this.extendTranslation(R,l,o,j,i),ue&&R===p&&this.options.appendNamespaceToMissingKey&&(R=`${h}${v}${p}`),(ue||re)&&this.options.parseMissingKeyHandler&&(R=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${v}${p}`:p,re?R:void 0,o))}return u?(j.res=R,j.usedParams=this.getUsedParamsDetails(o),j):R}extendTranslation(l,s,i,o,u){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const g=Oe(l)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const b=l.match(this.interpolator.nestingRegexp);h=b&&b.length}let v=i.replace&&!Oe(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),l=this.interpolator.interpolate(l,v,i.lng||this.language||o.usedLng,i),g){const b=l.match(this.interpolator.nestingRegexp),_=b&&b.length;h<_&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...b)=>u?.[0]===b[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${b[0]} in key: ${s[0]}`),null):this.translate(...b,s),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=Oe(m)?[m]:m;return l!=null&&p?.length&&i.applyPostProcessor!==!1&&(l=qg.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),v=h.key;o=v;let b=h.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const _=s.count!==void 0&&!Oe(s.count),j=_&&!s.ordinal&&s.count===0,R=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);b.forEach(A=>{this.isValidLookup(i)||(p=A,!vp[`${T[0]}-${A}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(vp[`${T[0]}-${A}`]=!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(G=>{if(this.isValidLookup(i))return;m=G;const Z=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(Z,v,G,A,s);else{let K;_&&(K=this.pluralResolver.getSuffix(G,s.count,s));const X=`${this.options.pluralSeparator}zero`,ne=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(s.ordinal&&K.indexOf(ne)===0&&Z.push(v+K.replace(ne,this.options.pluralSeparator)),Z.push(v+K),j&&Z.push(v+X)),R){const J=`${v}${this.options.contextSeparator||"_"}${s.context}`;Z.push(J),_&&(s.ordinal&&K.indexOf(ne)===0&&Z.push(J+K.replace(ne,this.options.pluralSeparator)),Z.push(J+K),j&&Z.push(J+X))}}let Y;for(;Y=Z.pop();)this.isValidLookup(i)||(u=Y,i=this.getResource(G,A,Y,s))}))})}),{res:i,usedKey:o,exactUsedKey:u,usedLng:m,usedNS:p}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,s,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,s,i,o):this.resourceStore.getResource(l,s,i,o)}getUsedParamsDetails(l={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=l.replace&&!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 Sp{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rn.create("languageUtils")}getScriptPartFromCode(l){if(l=Os(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=Os(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 _p={zero:0,one:1,two:2,few:3,many:4,other:5},jp={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class j0{constructor(l,s={}){this.languageUtils=l,this.options=s,this.logger=rn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(l,s={}){const i=Os(l==="dev"?"en":l),o=s.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:i,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let m;try{m=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),jp;if(!l.match(/-|_/))return jp;const g=this.languageUtils.getLanguagePartFromCode(l);m=this.getRule(g,s)}return this.pluralRulesCache[u]=m,m}needsPlural(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,s,i={}){return this.getSuffixes(l,i).map(o=>`${s}${o}`)}getSuffixes(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort((o,u)=>_p[o]-_p[u]).map(o=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(l,s,i={}){const o=this.getRule(l,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(s)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",s,i))}}const Np=(n,l,s,i=".",o=!0)=>{let u=h0(n,l,s);return!u&&o&&Oe(s)&&(u=nd(n,s,i),u===void 0&&(u=nd(l,s,i))),u},Lu=n=>n.replace(/\$/g,"$$$$");class wp{constructor(l={}){this.logger=rn.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(s=>s),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:o,prefix:u,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:R,nestingSuffixEscaped:T,nestingOptionsSeparator:A,maxReplaces:G,alwaysFormat:Z}=l.interpolation;this.escape=s!==void 0?s:g0,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?Tl(u):m||"{{",this.suffix=p?Tl(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=_?Tl(_):j||Tl("$t("),this.nestingSuffix=R?Tl(R):T||Tl(")"),this.nestingOptionsSeparator=A||",",this.maxReplaces=G||1e3,this.alwaysFormat=Z!==void 0?Z:!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 G=Np(s,g,j,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(G,void 0,i,{...o,...s,interpolationkey:j}):G}const R=j.split(this.formatSeparator),T=R.shift().trim(),A=R.join(this.formatSeparator).trim();return this.format(Np(s,g,T,this.options.keySeparator,this.options.ignoreJSONStructure),A,i,{...o,...s,interpolationkey:T})};this.resetRegExp();const v=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:j=>Lu(j)},{regex:this.regexp,safeValue:j=>this.escapeValue?Lu(this.escape(j)):Lu(j)}].forEach(j=>{for(p=0;u=j.regex.exec(l);){const R=u[1].trim();if(m=h(R),m===void 0)if(typeof v=="function"){const A=v(l,u,o);m=Oe(A)?A:""}else if(o&&Object.prototype.hasOwnProperty.call(o,R))m="";else if(b){m=u[0];continue}else this.logger.warn(`missed to pass in variable ${R} for interpolating ${l}`),m="";else!Oe(m)&&!this.useRawValueToEscape&&(m=pp(m));const T=j.safeValue(m);if(l=l.replace(u[0],T),b?(j.regex.lastIndex+=m.length,j.regex.lastIndex-=u[0].length):j.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),l}nest(l,s,i={}){let o,u,m;const p=(g,h)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const b=g.split(new RegExp(`${Tl(v)}[ ]*{`));let _=`{${b[1]}`;g=b[0],_=this.interpolate(_,m);const j=_.match(/'/g),R=_.match(/"/g);((j?.length??0)%2===0&&!R||(R?.length??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{m=JSON.parse(_),h&&(m={...h,...m})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${v}${_}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;o=this.nestingRegexp.exec(l);){let g=[];m={...i},m=m.replace&&!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(v=>v.trim()).filter(Boolean),o[1]=o[1].slice(0,h)),u=s(p.call(this,o[1].trim(),m),m),u&&o[0]===l&&!Oe(u))return u;Oe(u)||(u=pp(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${l}`),u=""),g.length&&(u=g.reduce((v,b)=>this.format(v,b,i.lng,{...i,interpolationkey:o[1].trim()}),u.trim())),l=l.replace(o[0],u),this.regexp.lastIndex=0}return l}}const N0=n=>{let l=n.toLowerCase().trim();const s={};if(n.indexOf("(")>-1){const i=n.split("(");l=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);l==="currency"&&o.indexOf(":")<0?s.currency||(s.currency=o.trim()):l==="relativetime"&&o.indexOf(":")<0?s.range||(s.range=o.trim()):o.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),v=p.trim();s[v]||(s[v]=h),h==="false"&&(s[v]=!1),h==="true"&&(s[v]=!0),isNaN(h)||(s[v]=parseInt(h,10))}})}return{formatName:l,formatOptions:s}},Ep=n=>{const l={};return(s,i,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const m=i+JSON.stringify(u);let p=l[m];return p||(p=n(Os(i),o),l[m]=p),p(s)}},w0=n=>(l,s,i)=>n(Os(s),i)(l);class E0{constructor(l={}){this.logger=rn.create("formatter"),this.options=l,this.init(l)}init(l,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?Ep:w0;this.formats={number:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u});return p=>m.format(p)}),currency:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u,style:"currency"});return p=>m.format(p)}),datetime:i((o,u)=>{const m=new Intl.DateTimeFormat(o,{...u});return p=>m.format(p)}),relativetime:i((o,u)=>{const m=new Intl.RelativeTimeFormat(o,{...u});return p=>m.format(p,u.range||"day")}),list:i((o,u)=>{const m=new Intl.ListFormat(o,{...u});return p=>m.format(p)})}}add(l,s){this.formats[l.toLowerCase().trim()]=s}addCached(l,s){this.formats[l.toLowerCase().trim()]=Ep(s)}format(l,s,i,o={}){const u=s.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(p=>p.indexOf(")")>-1)){const p=u.findIndex(g=>g.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,p)].join(this.formatSeparator)}return u.reduce((p,g)=>{const{formatName:h,formatOptions:v}=N0(g);if(this.formats[h]){let b=p;try{const _=o?.formatParams?.[o.interpolationkey]||{},j=_.locale||_.lng||o.locale||o.lng||i;b=this.formats[h](p,j,{...v,...o,..._})}catch(_){this.logger.warn(_)}return b}else this.logger.warn(`there was no format function for ${h}`);return p},l)}}const C0=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class R0 extends yo{constructor(l,s,i,o={}){super(),this.backend=l,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=rn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,o.backend,o)}queueLoad(l,s,i,o){const u={},m={},p={},g={};return l.forEach(h=>{let v=!0;s.forEach(b=>{const _=`${h}|${b}`;!i.reload&&this.store.hasResourceBundle(h,b)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?m[_]===void 0&&(m[_]=!0):(this.state[_]=1,v=!1,m[_]===void 0&&(m[_]=!0),u[_]===void 0&&(u[_]=!0),g[b]===void 0&&(g[b]=!0)))}),v||(p[h]=!0)}),(Object.keys(u).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(l,s,i){const o=l.split("|"),u=o[0],m=o[1];s&&this.emit("failedLoading",u,m,s),!s&&i&&this.store.addResourceBundle(u,m,i,void 0,void 0,{skipCopy:!0}),this.state[l]=s?-1:2,s&&i&&(this.state[l]=0);const p={};this.queue.forEach(g=>{m0(g.loaded,[u],m),C0(g,l),s&&g.errors.push(s),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const v=g.loaded[h];v.length&&v.forEach(b=>{p[h][b]===void 0&&(p[h][b]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(l,s,i,o=0,u=this.retryTimeout,m){if(!l.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:s,fcName:i,tried:o,wait:u,callback:m});return}this.readingCalls++;const p=(h,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(h&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,l,s,i,o+1,u*2,m)},u);return}m(h,v)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(l,s);h&&typeof h.then=="function"?h.then(v=>p(null,v)).catch(p):p(null,h)}catch(h){p(h)}return}return g(l,s,p)}prepareLoading(l,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();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 v;h.length===5?v=h(l,s,i,o,g):v=h(l,s,i,o),v&&typeof v.then=="function"?v.then(b=>p(null,b)).catch(p):p(null,v)}catch(v){p(v)}else h(l,s,i,o,p,g)}!l||!l[0]||this.store.addResource(l[0],s,i,o)}}}const Uu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let l={};if(typeof n[1]=="object"&&(l=n[1]),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}),Cp=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),ao=()=>{},T0=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},Gg="__i18next_supportNoticeShown",z0=()=>typeof globalThis<"u"&&!!globalThis[Gg],O0=()=>{typeof globalThis<"u"&&(globalThis[Gg]=!0)},D0=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(l=>l?.name?.indexOf("Locize")>0||l?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(l=>l?.projectId));class Ts extends yo{constructor(l={},s){if(super(),this.options=Cp(l),this.services={},this.logger=rn,this.modules={external:[]},T0(this),s&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,s),this;setTimeout(()=>{this.init(l,s)},0)}}init(l={},s){this.isInitializing=!0,typeof l=="function"&&(s=l,l={}),l.defaultNS==null&&l.ns&&(Oe(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=Uu();this.options={...i,...this.options,...Cp(l)},this.options.interpolation={...i.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!D0(this)&&!z0()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),O0());const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?rn.init(o(this.modules.logger),this.options):rn.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=E0;const v=new Sp(this.options);this.store=new bp(this.options.resources,this.options);const b=this.services;b.logger=rn,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new j0(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(b.formatter=o(h),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new wp(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new R0(o(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(j,...R)=>{this.emit(j,...R)}),this.modules.languageDetector&&(b.languageDetector=o(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=o(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new go(this.services,this.options),this.translator.on("*",(j,...R)=>{this.emit(j,...R)}),this.modules.external.forEach(j=>{j.init&&j.init(this)})}if(this.format=this.options.interpolation.format,s||(s=ao),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...v)=>this.store[h](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...v)=>(this.store[h](...v),this)});const p=Ss(),g=()=>{const h=(v,b)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),p.resolve(b),s(v,b)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),p}loadResources(l,s=ao){let i=s;const o=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=Ss();return typeof l=="function"&&(i=l,l=void 0),typeof s=="function"&&(i=s,s=void 0),l||(l=this.languages),s||(s=this.options.ns),i||(i=ao),this.services.backendConnector.reload(l,s,u=>{o.resolve(),i(u)}),o}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&qg.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=Ss();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,v=>{u(v,h)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(l),i}getFixedT(l,s,i){const o=(u,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([u,m].concat(p)):g={...m},g.lng=g.lng||o.lng,g.lngs=g.lngs||o.lngs,g.ns=g.ns||o.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||o.keyPrefix);const h=this.options.keySeparator||".";let v;return g.keyPrefix&&Array.isArray(u)?v=u.map(b=>(typeof b=="function"&&(b=ld(b,{...this.options,...m})),`${g.keyPrefix}${h}${b}`)):(typeof u=="function"&&(u=ld(u,{...this.options,...m})),v=g.keyPrefix?`${g.keyPrefix}${h}${u}`:u),this.t(v,g)};return 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=Ss();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=Ss();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 Sp(Uu());return l.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(i.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},s){const i=new Ts(l,s);return i.createInstance=Ts.createInstance,i}cloneInstance(l={},s=ao){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const o={...this.options,...l,isClone:!0},u=new Ts(o);if((l.debug!==void 0||l.prefix!==void 0)&&(u.logger=u.logger.clone(l)),["store","services","language"].forEach(p=>{u[p]=this[p]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},i){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},g[h]=Object.keys(g[h]).reduce((v,b)=>(v[b]={...g[h][b]},v),g[h]),g),{});u.store=new bp(p,o),u.services.resourceStore=u.store}if(l.interpolation){const g={...Uu().interpolation,...this.options.interpolation,...l.interpolation},h={...o,interpolation:g};u.services.interpolator=new wp(h)}return u.translator=new go(u.services,o),u.translator.on("*",(p,...g)=>{u.emit(p,...g)}),u.init(o,s),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const sa=Ts.createInstance();sa.createInstance;sa.dir;sa.init;sa.loadResources;sa.reloadResources;sa.use;sa.changeLanguage;sa.getFixedT;sa.t;sa.exists;sa.setDefaultNamespace;sa.hasLoadedNamespace;sa.loadNamespaces;sa.loadLanguages;var Hu={exports:{}},De={};var Rp;function M0(){if(Rp)return De;Rp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function j(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,A={};function G(N,$,F){this.props=N,this.context=$,this.refs=A,this.updater=F||R}G.prototype.isReactComponent={},G.prototype.setState=function(N,$){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,$,"setState")},G.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function Z(){}Z.prototype=G.prototype;function Y(N,$,F){this.props=N,this.context=$,this.refs=A,this.updater=F||R}var K=Y.prototype=new Z;K.constructor=Y,T(K,G.prototype),K.isPureReactComponent=!0;var X=Array.isArray;function ne(){}var J={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function H(N,$,F){var le=F.ref;return{$$typeof:n,type:N,key:$,ref:le!==void 0?le:null,props:F}}function ee(N,$){return H(N.type,$,N.props)}function de(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function ce(N){var $={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(F){return $[F]})}var re=/\/+/g;function ue(N,$){return typeof N=="object"&&N!==null&&N.key!=null?ce(""+N.key):$.toString(36)}function me(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(ne,ne):(N.status="pending",N.then(function($){N.status==="pending"&&(N.status="fulfilled",N.value=$)},function($){N.status==="pending"&&(N.status="rejected",N.reason=$)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function M(N,$,F,le,pe){var _e=typeof N;(_e==="undefined"||_e==="boolean")&&(N=null);var ze=!1;if(N===null)ze=!0;else switch(_e){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(N.$$typeof){case n:case l:ze=!0;break;case v:return ze=N._init,M(ze(N._payload),$,F,le,pe)}}if(ze)return pe=pe(N),ze=le===""?"."+ue(N,0):le,X(pe)?(F="",ze!=null&&(F=ze.replace(re,"$&/")+"/"),M(pe,$,F,"",function(It){return It})):pe!=null&&(de(pe)&&(pe=ee(pe,F+(pe.key==null||N&&N.key===pe.key?"":(""+pe.key).replace(re,"$&/")+"/")+ze)),$.push(pe)),1;ze=0;var at=le===""?".":le+":";if(X(N))for(var Le=0;Le<N.length;Le++)le=N[Le],_e=at+ue(le,Le),ze+=M(le,$,F,_e,pe);else if(Le=j(N),typeof Le=="function")for(N=Le.call(N),Le=0;!(le=N.next()).done;)le=le.value,_e=at+ue(le,Le++),ze+=M(le,$,F,_e,pe);else if(_e==="object"){if(typeof N.then=="function")return M(me(N),$,F,le,pe);throw $=String(N),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ze}function I(N,$,F){if(N==null)return N;var le=[],pe=0;return M(N,le,"","",function(_e){return $.call(F,_e,pe++)}),le}function ie(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(F){(N._status===0||N._status===-1)&&(N._status=1,N._result=F)},function(F){(N._status===0||N._status===-1)&&(N._status=2,N._result=F)}),N._status===-1&&(N._status=0,N._result=$)}if(N._status===1)return N._result.default;throw N._result}var P=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},be={map:I,forEach:function(N,$,F){I(N,function(){$.apply(this,arguments)},F)},count:function(N){var $=0;return I(N,function(){$++}),$},toArray:function(N){return I(N,function($){return $})||[]},only:function(N){if(!de(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return De.Activity=b,De.Children=be,De.Component=G,De.Fragment=s,De.Profiler=o,De.PureComponent=Y,De.StrictMode=i,De.Suspense=g,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,De.__COMPILER_RUNTIME={__proto__:null,c:function(N){return J.H.useMemoCache(N)}},De.cache=function(N){return function(){return N.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(N,$,F){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var le=T({},N.props),pe=N.key;if($!=null)for(_e in $.key!==void 0&&(pe=""+$.key),$)!w.call($,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&$.ref===void 0||(le[_e]=$[_e]);var _e=arguments.length-2;if(_e===1)le.children=F;else if(1<_e){for(var ze=Array(_e),at=0;at<_e;at++)ze[at]=arguments[at+2];le.children=ze}return H(N.type,pe,le)},De.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:u,_context:N},N},De.createElement=function(N,$,F){var le,pe={},_e=null;if($!=null)for(le in $.key!==void 0&&(_e=""+$.key),$)w.call($,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(pe[le]=$[le]);var ze=arguments.length-2;if(ze===1)pe.children=F;else if(1<ze){for(var at=Array(ze),Le=0;Le<ze;Le++)at[Le]=arguments[Le+2];pe.children=at}if(N&&N.defaultProps)for(le in ze=N.defaultProps,ze)pe[le]===void 0&&(pe[le]=ze[le]);return H(N,_e,pe)},De.createRef=function(){return{current:null}},De.forwardRef=function(N){return{$$typeof:p,render:N}},De.isValidElement=de,De.lazy=function(N){return{$$typeof:v,_payload:{_status:-1,_result:N},_init:ie}},De.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},De.startTransition=function(N){var $=J.T,F={};J.T=F;try{var le=N(),pe=J.S;pe!==null&&pe(F,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(ne,P)}catch(_e){P(_e)}finally{$!==null&&F.types!==null&&($.types=F.types),J.T=$}},De.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},De.use=function(N){return J.H.use(N)},De.useActionState=function(N,$,F){return J.H.useActionState(N,$,F)},De.useCallback=function(N,$){return J.H.useCallback(N,$)},De.useContext=function(N){return J.H.useContext(N)},De.useDebugValue=function(){},De.useDeferredValue=function(N,$){return J.H.useDeferredValue(N,$)},De.useEffect=function(N,$){return J.H.useEffect(N,$)},De.useEffectEvent=function(N){return J.H.useEffectEvent(N)},De.useId=function(){return J.H.useId()},De.useImperativeHandle=function(N,$,F){return J.H.useImperativeHandle(N,$,F)},De.useInsertionEffect=function(N,$){return J.H.useInsertionEffect(N,$)},De.useLayoutEffect=function(N,$){return J.H.useLayoutEffect(N,$)},De.useMemo=function(N,$){return J.H.useMemo(N,$)},De.useOptimistic=function(N,$){return J.H.useOptimistic(N,$)},De.useReducer=function(N,$,F){return J.H.useReducer(N,$,F)},De.useRef=function(N){return J.H.useRef(N)},De.useState=function(N){return J.H.useState(N)},De.useSyncExternalStore=function(N,$,F){return J.H.useSyncExternalStore(N,$,F)},De.useTransition=function(){return J.H.useTransition()},De.version="19.2.4",De}var Tp;function bo(){return Tp||(Tp=1,Hu.exports=M0()),Hu.exports}var y=bo();const Er=o0(y),A0=i0({__proto__:null,default:Er},[y]),k0=(n,l,s,i)=>{const o=[s,{code:l,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);Ml(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},zp={},Vg=(n,l,s,i)=>{Ml(s)&&zp[s]||(Ml(s)&&(zp[s]=new Date),k0(n,l,s,i))},Kg=(n,l)=>()=>{if(n.isInitialized)l();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),l()};n.on("initialized",s)}},rd=(n,l,s)=>{n.loadNamespaces(l,Kg(n,s))},Op=(n,l,s,i)=>{if(Ml(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(l)>-1)return rd(n,s,i);s.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(l,Kg(n,i))},L0=(n,l,s={})=>!l.languages||!l.languages.length?(Vg(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:s.lng,precheck:(i,o)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),Ml=n=>typeof n=="string",U0=n=>typeof n=="object"&&n!==null,H0=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,B0={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},$0=n=>B0[n],q0=n=>n.replace(H0,$0);let sd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:q0,transDefaultProps:void 0};const Y0=(n={})=>{sd={...sd,...n}},G0=()=>sd;let Xg;const V0=n=>{Xg=n},K0=()=>Xg,X0={type:"3rdParty",init(n){Y0(n.options.react),V0(n)}},Q0=y.createContext();class Z0{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Bu={exports:{}},$u={};var Dp;function F0(){if(Dp)return $u;Dp=1;var n=bo();function l(b,_){return b===_&&(b!==0||1/b===1/_)||b!==b&&_!==_}var s=typeof Object.is=="function"?Object.is:l,i=n.useState,o=n.useEffect,u=n.useLayoutEffect,m=n.useDebugValue;function p(b,_){var j=_(),R=i({inst:{value:j,getSnapshot:_}}),T=R[0].inst,A=R[1];return u(function(){T.value=j,T.getSnapshot=_,g(T)&&A({inst:T})},[b,j,_]),o(function(){return g(T)&&A({inst:T}),b(function(){g(T)&&A({inst:T})})},[b]),m(j),j}function g(b){var _=b.getSnapshot;b=b.value;try{var j=_();return!s(b,j)}catch{return!0}}function h(b,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return $u.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,$u}var Mp;function J0(){return Mp||(Mp=1,Bu.exports=F0()),Bu.exports}var P0=J0();const I0=(n,l)=>Ml(l)?l:U0(l)&&Ml(l.defaultValue)?l.defaultValue:Array.isArray(n)?n[n.length-1]:n,W0={t:I0,ready:!1},ev=()=>()=>{},Te=(n,l={})=>{const{i18n:s}=l,{i18n:i,defaultNS:o}=y.useContext(Q0)||{},u=s||i||K0();u&&!u.reportNamespaces&&(u.reportNamespaces=new Z0),u||Vg(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const m=y.useMemo(()=>({...G0(),...u?.options?.react,...l}),[u,l]),{useSuspense:p,keyPrefix:g}=m,h=o||u?.options?.defaultNS,v=Ml(h)?[h]:h||["translation"],b=y.useMemo(()=>v,v);u?.reportNamespaces?.addUsedNamespaces?.(b);const _=y.useRef(0),j=y.useCallback(H=>{if(!u)return ev;const{bindI18n:ee,bindI18nStore:de}=m,ce=()=>{_.current+=1,H()};return ee&&u.on(ee,ce),de&&u.store.on(de,ce),()=>{ee&&ee.split(" ").forEach(re=>u.off(re,ce)),de&&de.split(" ").forEach(re=>u.store.off(re,ce))}},[u,m]),R=y.useRef(),T=y.useCallback(()=>{if(!u)return W0;const H=!!(u.isInitialized||u.initializedStoreOnce)&&b.every(me=>L0(me,u,m)),ee=l.lng||u.language,de=_.current,ce=R.current;if(ce&&ce.ready===H&&ce.lng===ee&&ce.keyPrefix===g&&ce.revision===de)return ce;const ue={t:u.getFixedT(ee,m.nsMode==="fallback"?b:b[0],g),ready:H,lng:ee,keyPrefix:g,revision:de};return R.current=ue,ue},[u,b,g,m,l.lng]),[A,G]=y.useState(0),{t:Z,ready:Y}=P0.useSyncExternalStore(j,T,T);y.useEffect(()=>{if(u&&!Y&&!p){const H=()=>G(ee=>ee+1);l.lng?Op(u,l.lng,b,H):rd(u,b,H)}},[u,l.lng,b,Y,p,A]);const K=u||{},X=y.useRef(null),ne=y.useRef(),J=H=>{const ee=Object.getOwnPropertyDescriptors(H);ee.__original&&delete ee.__original;const de=Object.create(Object.getPrototypeOf(H),ee);if(!Object.prototype.hasOwnProperty.call(de,"__original"))try{Object.defineProperty(de,"__original",{value:H,writable:!1,enumerable:!1,configurable:!1})}catch{}return de},w=y.useMemo(()=>{const H=K,ee=H?.language;let de=H;H&&(X.current&&X.current.__original===H?ne.current!==ee?(de=J(H),X.current=de,ne.current=ee):de=X.current:(de=J(H),X.current=de,ne.current=ee));const ce=[Z,de,Y];return ce.t=Z,ce.i18n=de,ce.ready=Y,ce},[Z,K,Y,K.resolvedLanguage,K.language,K.languages]);if(u&&p&&!Y)throw new Promise(H=>{const ee=()=>H();l.lng?Op(u,l.lng,b,ee):rd(u,b,ee)});return w},{slice:tv,forEach:av}=[];function nv(n){return av.call(tv.call(arguments,1),l=>{if(l)for(const s in l)n[s]===void 0&&(n[s]=l[s])}),n}function lv(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(s=>s.test(n))}const Ap=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rv=function(n,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(l);let u=`${n}=${o}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");u+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Ap.test(i.domain))throw new TypeError("option domain is invalid");u+=`; Domain=${i.domain}`}if(i.path){if(!Ap.test(i.path))throw new TypeError("option path is invalid");u+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");u+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(u+="; HttpOnly"),i.secure&&(u+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(u+="; Partitioned"),u},kp={create(n,l,s,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};s&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+s*60*1e3)),i&&(o.domain=i),document.cookie=rv(n,l,o)},read(n){const l=`${n}=`,s=document.cookie.split(";");for(let i=0;i<s.length;i++){let o=s[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(l)===0)return o.substring(l.length,o.length)}return null},remove(n,l){this.create(n,"",-1,l)}};var sv={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return kp.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:s,cookieMinutes:i,cookieDomain:o,cookieOptions:u}=l;s&&typeof document<"u"&&kp.create(s,n,i,o,u)}},iv={name:"querystring",lookup(n){let{lookupQuerystring:l}=n,s;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const u=i.substring(1).split("&");for(let m=0;m<u.length;m++){const p=u[m].indexOf("=");p>0&&u[m].substring(0,p)===l&&(s=u[m].substring(p+1))}}return s}},ov={name:"hash",lookup(n){let{lookupHash:l,lookupFromHashIndex:s}=n,i;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const u=o.substring(1);if(l){const m=u.split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===l&&(i=m[p].substring(g+1))}}if(i)return i;if(!i&&s>-1){const m=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(m)?m[typeof s=="number"?s:0]?.replace("/",""):void 0}}}return i}};let _r=null;const Lp=()=>{if(_r!==null)return _r;try{if(_r=typeof window<"u"&&window.localStorage!==null,!_r)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{_r=!1}return _r};var cv={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&Lp())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:s}=l;s&&Lp()&&window.localStorage.setItem(s,n)}};let jr=null;const Up=()=>{if(jr!==null)return jr;try{if(jr=typeof window<"u"&&window.sessionStorage!==null,!jr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{jr=!1}return jr};var uv={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&Up())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:s}=l;s&&Up()&&window.sessionStorage.setItem(s,n)}},dv={name:"navigator",lookup(n){const l=[];if(typeof navigator<"u"){const{languages:s,userLanguage:i,language:o}=navigator;if(s)for(let u=0;u<s.length;u++)l.push(s[u]);i&&l.push(i),o&&l.push(o)}return l.length>0?l:void 0}},fv={name:"htmlTag",lookup(n){let{htmlTag:l}=n,s;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(s=i.getAttribute("lang")),s}},mv={name:"path",lookup(n){let{lookupFromPathIndex:l}=n;if(typeof window>"u")return;const s=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof l=="number"?l:0]?.replace("/",""):void 0}},hv={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:l}=n;const s=typeof l=="number"?l+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[s]}};let Qg=!1;try{document.cookie,Qg=!0}catch{}const Zg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Qg||Zg.splice(1,1);const pv=()=>({order:Zg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Fg{constructor(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,s)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=nv(s,this.options||{},pv()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(sv),this.addDetector(iv),this.addDetector(cv),this.addDetector(uv),this.addDetector(dv),this.addDetector(fv),this.addDetector(mv),this.addDetector(hv),this.addDetector(ov)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,s=[];return l.forEach(i=>{if(this.detectors[i]){let o=this.detectors[i].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(s=s.concat(o))}}),s=s.filter(i=>i!=null&&!lv(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?s:s.length>0?s[0]:null}cacheUserLanguage(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;s&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||s.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(l,this.options)}))}}Fg.type="languageDetector";const gv={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub · @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. All rights reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management.","page.docs.title":"Docs","page.docs.description":"Public documentation portal.","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index.","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI — only what stands up to scrutiny gets written to the knowledge graph.","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here — browse, search, analyze, and use it anytime.","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain.","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly.","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains — get notified on updates, no manual transfer needed.","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration.","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling.","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling.","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results.","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph.","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.library.default_cloud_name":"Personal Cloud","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.status.go_index":"Index","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain.","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge.","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Select Version","sources.import.step.confirm":"Import Complete","sources.import.daemon_offline":"Client {{name}} is not connected. Please start the local Daemon and connect to the server before importing.","sources.import.view_guide":"View Connection Guide","sources.import.select_root":"Select repository root directory","sources.import.current_path":"Current path","sources.import.not_git":"This directory is not a Git repository. Please select a directory containing .git.","sources.import.branch":"Branch","sources.import.commit":"Commit","sources.import.branch_warning":"Currently based on {{branch}} branch HEAD","sources.import.uncommitted_warning":"Uncommitted changes will not be collected","sources.import.recognized":"Recognized {{packages}} packages and {{docs}} documents","sources.import.no_packages":"No package structure detected. Will be imported as a single-package repository.","sources.import.confirm_heading":"About to import the following repository to {{name}}:","sources.import.packages":"Packages","sources.import.documents":"Documents","sources.import.loading_repo":"Loading repository info...","sources.import.loading_repo_slow":"Large repositories (>10 GB) may take 5–10 seconds...","sources.import.importing":"Importing...","sources.import.error_title":"Import Failed","sources.import.success":"Import complete","sources.import.stage.prepare":"Preparing environment","sources.import.stage.clone":"Cloning repository","sources.import.stage.scan":"Scanning project","sources.import.stage.save":"Saving sources","sources.import.stage.done_suffix":"done","sources.import.stage.complete":"Import complete","sources.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory path…","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_name_hint":"Display name in the source tree after import. Leave empty to use the default repository name.","sources.import.dir_name_duplicate":"This name already exists. Please use a different name.","sources.import.dir_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Repositories (skipped)","sources.import.dir_git_hint":"Git repositories inside the directory will not be expanded for indexing. Import them separately if needed.","sources.import.dir_scanning":"Scanning directory contents...","sources.import.dir_scan_complete":"Scan complete","sources.import.dir_scan_error":"Failed to scan directory","sources.import.dir_scan_retry":"Retry","sources.import.dir_code_packages":"Code Packages","sources.import.dir_code_packages_tip":"Supported: package.json, pyproject.toml, setup.py, go.mod, Cargo.toml, pom.xml, build.gradle","sources.import.dir_doc_files":"Documents","sources.import.dir_doc_files_tip":"Supported: Markdown (.md)","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"Git repos are skipped. Use 'Import Repository' instead.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown Document","sources.actions.upload_doc":"Document","sources.actions.add":"Add","sources.actions.add_folder":"Folder","sources.actions.add_web":"Web Page","sources.actions.add_feishu":"Feishu Document","sources.actions.import_dir":"Import Directory","sources.actions.import_repo_url":"Import Repository","sources.upgrade.title":"Feature Upgrading","sources.upgrade.description":"This feature will be available in version 0.5.x. Stay tuned.","sources.upload.title":"Upload Documents","sources.upload.drop_hint":"Click to select or drag files here","sources.upload.supported_formats":"Supported: .md, .doc, .docx, .pdf, .ppt, .pptx, .txt (max 5MB each, up to 10 files)","sources.upload.file_too_large":'"{{name}}" exceeds 5MB limit',"sources.upload.too_many_files":"Maximum 10 files allowed, please re-select","sources.upload.unsupported_type":'"{{name}}" is not a supported file type',"sources.upload.uploading":"Uploading...","sources.upload.success":"Uploaded {{count}} documents","sources.upload.selected":"{{count}} files selected","sources.upload.remove":"Remove","sources.import_remote.title":"Import Remote Repository","sources.import_remote.step.loading":"Data Import","sources.import_remote.url_label":"Repository URL","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"Only HTTPS URLs are accepted. SSH support is planned for a future release","sources.import_remote.url_hint_public":"Supports public Git repositories without authentication, and Git services with OAuth configured: ","sources.import_remote.url_hint_no_auth":"Supports public Git repositories and Git services with OAuth configured","sources.import_remote.url_invalid":"Only HTTPS Git URLs are supported","sources.import_remote.ref_label":"Branch / Tag","sources.import_remote.ref_branches":"Branches","sources.import_remote.ref_tags":"Tags","sources.import_remote.ref_search":"Search branches or tags…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"Auto-filled with the latest commit of selected branch. You can also type or search","sources.import_remote.commit_search":"Search commit…","sources.import_remote.loading_refs":"Querying repository branches...","sources.import_remote.summary_repo":"Repository","sources.import_remote.summary_branch":"Branch","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"Preparing environment","sources.import_remote.stage.clone":"Cloning repository","sources.import_remote.stage.scan":"Scanning project","sources.import_remote.stage.save":"Saving sources","sources.import_remote.complete":"Import complete","sources.import_remote.back_to_library":"Done","sources.import_remote.retry":"Retry","sources.import_remote.back":"Back","sources.import_remote.error.auth_required":"This repository requires authentication. Please configure an access token for {{host}} in Server Settings → Git Tokens.","sources.import_remote.error.auth_failed":"Authentication failed. Please check your Git token configuration.","sources.import_remote.error.not_found":"Repository not found or no access. Please check the URL.","sources.import_remote.error.network":"Cannot connect to the remote repository. Please check your network or try again later.","sources.import_remote.error.capacity":"Import queue is full. Please try again later.","sources.import_remote.error.clone_failed":"Clone failed","sources.import_remote.error.scan_failed":"Scan failed","sources.import_remote.error.save_failed":"Save failed","sources.change_detection.has_updates":"Has updates","sources.change_detection.reimport":"Re-import","sources.safety.notice.remote":"The remote repository will be cloned to the server for analysis. Code will not be uploaded to any third-party services."},xv={"nav.home":"首页","nav.studio":"工作台","nav.docs":"文档","nav.login":"登录","nav.logout":"退出登录","header.status.connected":"已连接","header.status.disconnected":"已断开","header.status.reconnecting":"重连中","footer.copyright":"GitHub · @Context4AI {{year}}. 版权所有","footer.copyright_compact":"@Context4AI {{year}}. 版权所有","footer.tagline":"知识工厂","footer.theme.dark":"暗色","footer.theme.light":"亮色","footer.theme.system":"跟随系统","studio.sidebar.sources":"知识索引","studio.sidebar.modeling":"知识建模","studio.sidebar.brain":"知识大脑","studio.sidebar.discovery":"发现知识","studio.sidebar.sharing":"分享知识","studio.sidebar.collaboration":"知识协同","studio.sidebar.settings":"设置","placeholder.coming":"计划在 {{version}} 版本实现","page.login.title":"登录","page.login.description":"身份验证与用户管理。","page.docs.title":"文档","page.docs.description":"公开文档门户。","page.sources.title":"知识索引","page.sources.description":"添加代码仓库、文档等输入材料,让大脑完成初步索引。","page.modeling.title":"知识建模","page.modeling.description":"和 AI 一起对索引内容建模,只有经得起推敲的才写入知识图谱。","page.brain.title":"知识大脑","page.brain.description":"建模完成的全部知识都在这里——浏览、搜索、分析,随时调用。","page.discovery.title":"发现知识","page.discovery.description":"看看别人整理好的知识,发现有用的一键补充到自己的大脑。","page.sharing.title":"分享知识","page.sharing.description":"把大脑中的知识打包输出,让别人和 AI 都能直接使用。","page.collaboration.title":"知识协同","page.collaboration.description":"和其他大脑保持同步,知识更新时自动通知,不用手动搬运。","page.settings.title":"设置","page.settings.description":"管理大脑的成员和配置。","page.code_setup.title":"代码设置","page.code_setup.description":"代码建模的仓库选择与配置。","page.code_compile.title":"代码编译","page.code_compile.description":"代码建模的编译进度追踪。","page.code_review.title":"代码审查","page.code_review.description":"审查并确认建模结果。","page.code_result.title":"代码结果","page.code_result.description":"查看最终建模结果与生成的知识图谱。","home.hero.title":"Context For AI","home.hero.description":"将代码仓库和业务文档转化为结构化知识图谱。","home.hero.cta.studio":"进入工作台","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"您访问的页面不存在。","notfound.back":"返回首页","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.library.default_cloud_name":"个人云","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"有新变更未更新索引","sources.status.go_index":"去索引","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础。","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识。","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"选择版本","sources.import.step.confirm":"导入完成","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.loading_repo":"正在加载仓库信息...","sources.import.loading_repo_slow":"大型仓库(>10 GB)可能需要 5~10 秒...","sources.import.importing":"导入中...","sources.import.error_title":"导入失败","sources.import.success":"导入完成","sources.import.stage.prepare":"准备执行环境","sources.import.stage.clone":"克隆仓库","sources.import.stage.scan":"扫描项目","sources.import.stage.save":"保存数据源","sources.import.stage.done_suffix":"✓","sources.import.stage.complete":"导入完成","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step3":"等待连接","sources.add_client.step3_desc":"连接成功后,本页面将自动更新。","sources.add_client.waiting":"等待新的客户端连接...","sources.add_client.detected":"检测到新的本地客户端","sources.add_client.machine_name":"机器标识","sources.add_client.os":"操作系统","sources.add_client.daemon_version":"Daemon 版本","sources.add_client.client_name":"客户端名称","sources.add_client.confirm":"确认添加","sources.add_client.reconnected":"客户端 {{name}} 已重新连接","sources.add_client.go_to":"前往 {{name}}","sources.detail.tab.original":"原文","sources.detail.tab.overview":"概览","sources.detail.tab.digest":"摘要","sources.detail.tab.modeling":"建模结果","sources.detail.digest_placeholder":"完成索引后,即可在此查看结构化摘要。","sources.detail.modeling_placeholder":"在推演区完成建模后,此处将展示由该源产生的知识实体。","sources.detail.type":"类型","sources.detail.origin":"来源","sources.detail.origin.upload":"直接上传","sources.detail.origin.local":"本地文件","sources.detail.path":"路径","sources.detail.status":"状态","sources.detail.repo":"仓库","sources.detail.branch":"分支","sources.detail.commit":"提交","sources.detail.tech_stack":"技术栈","sources.detail.original_code_placeholder":"完成索引后即可查看包概览。","sources.detail.original_doc_placeholder":"文档内容将在上传后展示。","sources.detail.dependencies":"依赖","sources.delete.confirm_title":"确认删除","sources.delete.resource":"确定要删除 {{name}}?","sources.delete.resource_impact":"以下数据将被永久删除:原文内容、结构化摘要(如有)。","sources.delete.session_warning":"如果你的个人推演区正在使用此知识源,相关的候选推演将受到影响。","sources.delete.entity_safe":"已汇入大脑的正式知识不受影响。","sources.delete.folder":"确定要删除文件夹 {{name}}?","sources.delete.folder_impact":"文件夹内的所有资源将被递归删除:{{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_contents":"包含 {{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","sources.delete.repo_contents":"包含 {{packages}} 个包、{{docs}} 个文档。","sources.delete.indexed_hint":"其中 {{indexed}}/{{total}} 个已建立索引,索引数据将被删除。","sources.delete.repo_impact_generic":"所有包和文档的索引记录将被删除。","sources.delete.local_safe":"本地文件不受影响。","sources.delete.client":"确定要删除客户端 {{name}}?","sources.delete.client_impact":"该客户端下的所有已导入仓库记录和相关索引数据将被删除。","sources.delete.client_reregister":"该客户端下次连接时将触发重新注册。","sources.error.name_conflict":'该目录下已存在同名项"{{name}}"。',"sources.move.current":"当前位置","sources.move.target":"移动到","sources.breadcrumb.sources":"知识索引","common.cancel":"取消","common.confirm":"确认","common.back":"返回","common.next":"下一步","common.previous":"上一步","common.items":"{{count}} 项","common.loading":"加载中...","sources.import.no_entries":"未找到任何条目","sources.import.allowed_dirs":"客户端授权目录","sources.import.allowed_dirs_tooltip_restrict":"通过参数设定有权限的目录:","sources.import.allowed_dirs_tooltip_all":"或默认允许全部目录:","sources.import.wildcard_home":"主目录","sources.import.wildcard_path_placeholder":"输入目录路径…","sources.import.wildcard_go":"前往","sources.import.wildcard_goto":"前往","sources.import.wildcard_go_title":"前往目录","sources.import.wildcard_path_not_found":"该路径在远程机器上不存在","sources.import.already_imported":"已导入","sources.import.dir_title":"导入目录","sources.import.dir_step.select":"选择目录","sources.import.dir_step.scan":"扫描","sources.import.dir_step.confirm":"确认导入","sources.import.dir_confirm_heading":"即将导入以下目录到 {{name}}:","sources.import.dir_name":"目录名","sources.import.dir_name_hint":"导入后在目录树中的显示名称,留空使用默认仓库名。","sources.import.dir_name_duplicate":"该名称已存在,请使用其他名称。","sources.import.dir_path":"目录路径","sources.import.dir_files":"文件数","sources.import.dir_subdirs":"子目录数","sources.import.dir_git_repos":"仓库(已跳过)","sources.import.dir_git_hint":"目录内的 Git 仓库不会被展开索引,如需索引请单独导入仓库。","sources.import.dir_scanning":"正在扫描目录内容...","sources.import.dir_scan_complete":"扫描完成","sources.import.dir_scan_error":"目录扫描失败","sources.import.dir_scan_retry":"重试","sources.import.dir_code_packages":"代码包","sources.import.dir_code_packages_tip":"支持:package.json、pyproject.toml、setup.py、go.mod、Cargo.toml、pom.xml、build.gradle","sources.import.dir_doc_files":"文档","sources.import.dir_doc_files_tip":"支持:Markdown (.md)","sources.import.dir_total_files":"文件总数","sources.import.dir_total_dirs":"目录","sources.import.dir_git_skip_hint":"Git 仓库将被跳过,建议单独使用「导入仓库」。","sources.actions.upload":"上传","sources.actions.upload_md":"Markdown 文档","sources.actions.upload_doc":"文档","sources.actions.add":"新增","sources.actions.add_folder":"文件夹","sources.actions.add_web":"网页","sources.actions.add_feishu":"飞书文档","sources.actions.import_dir":"导入目录","sources.actions.import_repo_url":"导入仓库","sources.upgrade.title":"功能升级中","sources.upgrade.description":"此功能将在 0.5.x 版本中推出,敬请期待。","sources.upload.title":"上传文档","sources.upload.drop_hint":"点击选择文件或拖拽至此","sources.upload.supported_formats":"支持格式:.md, .doc, .docx, .pdf, .ppt, .pptx, .txt(每个最大 5MB,最多 10 个)","sources.upload.file_too_large":'"{{name}}" 超过 5MB 限制',"sources.upload.too_many_files":"最多上传 10 个文件,请重新选择","sources.upload.unsupported_type":'"{{name}}" 不是支持的文件类型',"sources.upload.uploading":"上传中...","sources.upload.success":"已上传 {{count}} 个文档","sources.upload.selected":"已选择 {{count}} 个文件","sources.upload.remove":"移除","sources.import_remote.title":"导入远程仓库","sources.import_remote.step.loading":"数据导入","sources.import_remote.url_label":"仓库地址","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"仅接受 HTTPS 地址,SSH 地址未来版本支持","sources.import_remote.url_hint_public":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务:","sources.import_remote.url_hint_no_auth":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务","sources.import_remote.url_invalid":"仅支持 HTTPS 格式的 Git URL","sources.import_remote.ref_label":"分支 / Tag","sources.import_remote.ref_branches":"分支","sources.import_remote.ref_tags":"Tag","sources.import_remote.ref_search":"搜索分支或 Tag…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"已自动填入所选分支最新 commit,也可手动输入或搜索","sources.import_remote.commit_search":"搜索 commit…","sources.import_remote.loading_refs":"正在查询仓库分支...","sources.import_remote.summary_repo":"仓库","sources.import_remote.summary_branch":"分支","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"准备执行环境","sources.import_remote.stage.clone":"克隆仓库","sources.import_remote.stage.scan":"识别项目结构","sources.import_remote.stage.save":"写入知识源","sources.import_remote.complete":"导入完成","sources.import_remote.back_to_library":"完成","sources.import_remote.retry":"重试","sources.import_remote.back":"返回","sources.import_remote.error.auth_required":"该仓库需要认证。请在 服务设置 → Git 令牌 中配置 {{host}} 的访问令牌。","sources.import_remote.error.auth_failed":"认证失败,请检查 Git 令牌配置。","sources.import_remote.error.not_found":"仓库不存在或无权访问。请检查 URL 是否正确。","sources.import_remote.error.network":"无法连接到远程仓库。请检查网络或稍后重试。","sources.import_remote.error.capacity":"当前导入任务已满,请稍后再试。","sources.import_remote.error.clone_failed":"克隆失败","sources.import_remote.error.scan_failed":"识别失败","sources.import_remote.error.save_failed":"写入失败","sources.change_detection.has_updates":"有更新","sources.change_detection.reimport":"重新导入","sources.safety.notice.remote":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。"};sa.use(Fg).use(X0).init({resources:{en:{translation:gv},zh:{translation:xv}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var qu={exports:{}},_s={},Yu={exports:{}},Gu={};var Hp;function yv(){return Hp||(Hp=1,(function(n){function l(M,I){var ie=M.length;M.push(I);e:for(;0<ie;){var P=ie-1>>>1,be=M[P];if(0<o(be,I))M[P]=I,M[ie]=be,ie=P;else break e}}function s(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var I=M[0],ie=M.pop();if(ie!==I){M[0]=ie;e:for(var P=0,be=M.length,N=be>>>1;P<N;){var $=2*(P+1)-1,F=M[$],le=$+1,pe=M[le];if(0>o(F,ie))le<be&&0>o(pe,F)?(M[P]=pe,M[le]=ie,P=le):(M[P]=F,M[$]=ie,P=$);else if(le<be&&0>o(pe,ie))M[P]=pe,M[le]=ie,P=le;else break e}}return I}function o(M,I){var ie=M.sortIndex-I.sortIndex;return ie!==0?ie:M.id-I.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var g=[],h=[],v=1,b=null,_=3,j=!1,R=!1,T=!1,A=!1,G=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function K(M){for(var I=s(h);I!==null;){if(I.callback===null)i(h);else if(I.startTime<=M)i(h),I.sortIndex=I.expirationTime,l(g,I);else break;I=s(h)}}function X(M){if(T=!1,K(M),!R)if(s(g)!==null)R=!0,ne||(ne=!0,ce());else{var I=s(h);I!==null&&me(X,I.startTime-M)}}var ne=!1,J=-1,w=5,H=-1;function ee(){return A?!0:!(n.unstable_now()-H<w)}function de(){if(A=!1,ne){var M=n.unstable_now();H=M;var I=!0;try{e:{R=!1,T&&(T=!1,Z(J),J=-1),j=!0;var ie=_;try{t:{for(K(M),b=s(g);b!==null&&!(b.expirationTime>M&&ee());){var P=b.callback;if(typeof P=="function"){b.callback=null,_=b.priorityLevel;var be=P(b.expirationTime<=M);if(M=n.unstable_now(),typeof be=="function"){b.callback=be,K(M),I=!0;break t}b===s(g)&&i(g),K(M)}else i(g);b=s(g)}if(b!==null)I=!0;else{var N=s(h);N!==null&&me(X,N.startTime-M),I=!1}}break e}finally{b=null,_=ie,j=!1}I=void 0}}finally{I?ce():ne=!1}}}var ce;if(typeof Y=="function")ce=function(){Y(de)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,ue=re.port2;re.port1.onmessage=de,ce=function(){ue.postMessage(null)}}else ce=function(){G(de,0)};function me(M,I){J=G(function(){M(n.unstable_now())},I)}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 I=3;break;default:I=_}var ie=_;_=I;try{return M()}finally{_=ie}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(M,I){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ie=_;_=M;try{return I()}finally{_=ie}},n.unstable_scheduleCallback=function(M,I,ie){var P=n.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?P+ie:P):ie=P,M){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=ie+be,M={id:v++,callback:I,priorityLevel:M,startTime:ie,expirationTime:be,sortIndex:-1},ie>P?(M.sortIndex=ie,l(h,M),s(g)===null&&M===s(h)&&(T?(Z(J),J=-1):T=!0,me(X,ie-P))):(M.sortIndex=be,l(g,M),R||j||(R=!0,ne||(ne=!0,ce()))),M},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(M){var I=_;return function(){var ie=_;_=I;try{return M.apply(this,arguments)}finally{_=ie}}}})(Gu)),Gu}var Bp;function bv(){return Bp||(Bp=1,Yu.exports=yv()),Yu.exports}var Vu={exports:{}},aa={};var $p;function vv(){if($p)return aa;$p=1;var n=bo();function l(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(g,h,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:g,containerInfo:h,implementation:v}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return aa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,aa.createPortal=function(g,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return u(g,h,null,v)},aa.flushSync=function(g){var h=m.T,v=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=v,i.d.f()}},aa.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))},aa.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},aa.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var v=h.as,b=p(v,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:j}):v==="script"&&i.d.X(g,{crossOrigin:b,integrity:_,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},aa.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=p(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},aa.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,b=p(v,h.crossOrigin);i.d.L(g,v,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},aa.preloadModule=function(g,h){if(typeof g=="string")if(h){var v=p(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},aa.requestFormReset=function(g){i.d.r(g)},aa.unstable_batchedUpdates=function(g,h){return g(h)},aa.useFormState=function(g,h,v){return m.H.useFormState(g,h,v)},aa.useFormStatus=function(){return m.H.useHostTransitionStatus()},aa.version="19.2.4",aa}var qp;function Sv(){if(qp)return Vu.exports;qp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Vu.exports=vv(),Vu.exports}var Yp;function _v(){if(Yp)return _s;Yp=1;var n=bv(),l=bo(),s=Sv();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,r=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(r=c.return,r!==null){a=r;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return g(c),e;if(d===r)return g(c),t;d=d.sibling}throw Error(i(188))}if(a.return!==r.return)a=c,r=d;else{for(var x=!1,S=c.child;S;){if(S===a){x=!0,a=c,r=d;break}if(S===r){x=!0,r=c,a=d;break}S=S.sibling}if(!x){for(S=d.child;S;){if(S===a){x=!0,a=d,r=c;break}if(S===r){x=!0,r=d,a=c;break}S=S.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==r)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function ce(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case G:return"Profiler";case A:return"StrictMode";case X:return"Suspense";case ne:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case Y:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var me=Array.isArray,M=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},P=[],be=-1;function N(e){return{current:e}}function $(e){0>be||(e.current=P[be],P[be]=null,be--)}function F(e,t){be++,P[be]=e.current,e.current=t}var le=N(null),pe=N(null),_e=N(null),ze=N(null);function at(e,t){switch(F(_e,t),F(pe,e),F(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lh(t),e=Uh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(le),F(le,e)}function Le(){$(le),$(pe),$(_e)}function It(e){e.memoizedState!==null&&F(ze,e);var t=le.current,a=Uh(t,e.type);t!==a&&(F(pe,e),F(le,a))}function ia(e){pe.current===e&&($(le),$(pe)),ze.current===e&&($(ze),gs._currentValue=ie)}var mt,Ie;function ht(e){if(mt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);mt=t&&t[1]||"",Ie=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+mt+e+Ie}var Dt=!1;function Xt(e,t){if(!e||Dt)return"";Dt=!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(q){var U=q}Reflect.construct(e,[],W)}else{try{W.call()}catch(q){U=q}e.call(W.prototype)}}else{try{throw Error()}catch(q){U=q}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(q){if(q&&U&&typeof q.stack=="string")return[q.stack,U.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),x=d[0],S=d[1];if(x&&S){var E=x.split(`
4
+ `),L=S.split(`
5
+ `);for(c=r=0;r<E.length&&!E[r].includes("DetermineComponentFrameRoot");)r++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(r===E.length||c===L.length)for(r=E.length-1,c=L.length-1;1<=r&&0<=c&&E[r]!==L[c];)c--;for(;1<=r&&0<=c;r--,c--)if(E[r]!==L[c]){if(r!==1||c!==1)do if(r--,c--,0>c||E[r]!==L[c]){var V=`
6
+ `+E[r].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=r&&0<=c);break}}}finally{Dt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ht(a):""}function Wt(e,t){switch(e.tag){case 26:case 27:case 5:return ht(e.type);case 16:return ht("Lazy");case 13:return e.child!==t&&t!==null?ht("Suspense Fallback"):ht("Suspense");case 19:return ht("SuspenseList");case 0:case 15:return Xt(e.type,!1);case 11:return Xt(e.type.render,!1);case 1:return Xt(e.type,!0);case 31:return ht("Activity");default:return""}}function $t(e){try{var t="",a=null;do t+=Wt(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var ea=Object.prototype.hasOwnProperty,oa=n.unstable_scheduleCallback,ca=n.unstable_cancelCallback,cn=n.unstable_shouldYield,un=n.unstable_requestPaint,jt=n.unstable_now,Gt=n.unstable_getCurrentPriorityLevel,Se=n.unstable_ImmediatePriority,Be=n.unstable_UserBlockingPriority,Ye=n.unstable_NormalPriority,Mt=n.unstable_LowPriority,At=n.unstable_IdlePriority,je=n.log,Ze=n.unstable_setDisableYieldValue,Ae=null,nt=null;function ut(e){if(typeof je=="function"&&Ze(e),nt&&typeof nt.setStrictMode=="function")try{nt.setStrictMode(Ae,e)}catch{}}var vt=Math.clz32?Math.clz32:te,Pa=Math.log,Ia=Math.LN2;function te(e){return e>>>=0,e===0?32:31-(Pa(e)/Ia|0)|0}var ge=256,Fe=262144,Nt=4194304;function Je(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function dn(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var c=0,d=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=r&134217727;return S!==0?(r=S&~d,r!==0?c=Je(r):(x&=S,x!==0?c=Je(x):a||(a=S&~e,a!==0&&(c=Je(a))))):(S=r&~d,S!==0?c=Je(S):x!==0?c=Je(x):a||(a=r&~e,a!==0&&(c=Je(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function Ya(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function cl(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 ul(){var e=Nt;return Nt<<=1,(Nt&62914560)===0&&(Nt=4194304),e}function Ga(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ca(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ys(e,t,a,r,c,d){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var S=e.entanglements,E=e.expirationTimes,L=e.hiddenUpdates;for(a=x&~a;0<a;){var V=31-vt(a),W=1<<V;S[V]=0,E[V]=-1;var U=L[V];if(U!==null)for(L[V]=null,V=0;V<U.length;V++){var q=U[V];q!==null&&(q.lane&=-536870913)}a&=~W}r!==0&&Gs(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(x&~t))}function Gs(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-vt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Vs(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-vt(a),c=1<<r;c&t|e[r]&t&&(e[r]|=t),a&=~c}}function C(e,t){var a=t&-t;return a=(a&42)!==0?1:O(a),(a&(e.suspendedLanes|t))!==0?0:a}function O(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function B(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ae(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:sp(e.type))}function se(e,t){var a=I.p;try{return I.p=e,t()}finally{I.p=a}}var xe=Math.random().toString(36).slice(2),oe="__reactFiber$"+xe,fe="__reactProps$"+xe,he="__reactContainer$"+xe,we="__reactEvents$"+xe,Ce="__reactListeners$"+xe,Ne="__reactHandles$"+xe,We="__reactResources$"+xe,$e="__reactMarker$"+xe;function dt(e){delete e[oe],delete e[fe],delete e[we],delete e[Ce],delete e[Ne]}function gt(e){var t=e[oe];if(t)return t;for(var a=e.parentNode;a;){if(t=a[he]||a[oe]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Vh(e);e!==null;){if(a=e[oe])return a;e=Vh(e)}return t}e=a,a=e.parentNode}return null}function wt(e){if(e=e[oe]||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 Pe(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function qt(e){var t=e[We];return t||(t=e[We]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function pt(e){e[$e]=!0}var An=new Set,Va={};function Vt(e,t){Wa(e,t),Wa(e+"Capture",t)}function Wa(e,t){for(Va[e]=t,e=0;e<t.length;e++)An.add(t[e])}var dl=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),en={},fl={};function $l(e){return ea.call(fl,e)?!0:ea.call(en,e)?!1:dl.test(e)?fl[e]=!0:(en[e]=!0,!1)}function qe(e,t,a){if($l(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 Tt(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function ta(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ql(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 Yl(e){if(!e._valueTracker){var t=xt(e)?"checked":"value";e._valueTracker=ql(e,t,""+e[t])}}function Ks(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=xt(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Xs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ty=/[\n"\\]/g;function Ra(e){return e.replace(ty,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ro(e,t,a,r,c,d,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+kt(t)):e.value!==""+kt(t)&&(e.value=""+kt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?To(e,x,kt(t)):a!=null?To(e,x,kt(a)):r!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+kt(S):e.removeAttribute("name")}function Td(e,t,a,r,c,d,x,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Yl(e);return}a=a!=null?""+kt(a):"",t=t!=null?""+kt(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=S?e.checked:!!r,e.defaultChecked=!!r,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Yl(e)}function To(e,t,a){t==="number"&&Xs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Gl(e,t,a,r){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&r&&(e[a].defaultSelected=!0)}else{for(a=""+kt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function zd(e,t,a){if(t!=null&&(t=""+kt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+kt(a):""}function Od(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(me(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=kt(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Yl(e)}function Vl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ay=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Dd(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||ay.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Md(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&a[c]!==r&&Dd(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&Dd(e,d,t[d])}function zo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ny=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ly=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qs(e){return ly.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function fn(){}var Oo=null;function Do(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kl=null,Xl=null;function Ad(e){var t=wt(e);if(t&&(e=t.stateNode)){var a=e[fe]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ro(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Ra(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[fe]||null;if(!c)throw Error(i(90));Ro(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Ks(r)}break e;case"textarea":zd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Gl(e,!!a.multiple,t,!1)}}}var Mo=!1;function kd(e,t,a){if(Mo)return e(t,a);Mo=!0;try{var r=e(t);return r}finally{if(Mo=!1,(Kl!==null||Xl!==null)&&(Ai(),Kl&&(t=Kl,e=Xl,Xl=Kl=null,Ad(t),e)))for(t=0;t<e.length;t++)Ad(e[t])}}function Mr(e,t){var a=e.stateNode;if(a===null)return null;var r=a[fe]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ao=!1;if(mn)try{var Ar={};Object.defineProperty(Ar,"passive",{get:function(){Ao=!0}}),window.addEventListener("test",Ar,Ar),window.removeEventListener("test",Ar,Ar)}catch{Ao=!1}var kn=null,ko=null,Zs=null;function Ld(){if(Zs)return Zs;var e,t=ko,a=t.length,r,c="value"in kn?kn.value:kn.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(r=1;r<=x&&t[a-r]===c[d-r];r++);return Zs=c.slice(e,1<r?1-r:void 0)}function Fs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Js(){return!0}function Ud(){return!1}function ua(e){function t(a,r,c,d,x){this._reactName=a,this._targetInst=c,this.type=r,this.nativeEvent=d,this.target=x,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(d):d[S]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Js:Ud,this.isPropagationStopped=Ud,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Js)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Js)},persist:function(){},isPersistent:Js}),t}var ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ps=ua(ml),kr=b({},ml,{view:0,detail:0}),ry=ua(kr),Lo,Uo,Lr,Is=b({},kr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Lr&&(Lr&&e.type==="mousemove"?(Lo=e.screenX-Lr.screenX,Uo=e.screenY-Lr.screenY):Uo=Lo=0,Lr=e),Lo)},movementY:function(e){return"movementY"in e?e.movementY:Uo}}),Hd=ua(Is),sy=b({},Is,{dataTransfer:0}),iy=ua(sy),oy=b({},kr,{relatedTarget:0}),Ho=ua(oy),cy=b({},ml,{animationName:0,elapsedTime:0,pseudoElement:0}),uy=ua(cy),dy=b({},ml,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fy=ua(dy),my=b({},ml,{data:0}),Bd=ua(my),hy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},py={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},gy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gy[e])?!!t[e]:!1}function Bo(){return xy}var yy=b({},kr,{key:function(e){if(e.key){var t=hy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?py[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bo,charCode:function(e){return e.type==="keypress"?Fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),by=ua(yy),vy=b({},Is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$d=ua(vy),Sy=b({},kr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bo}),_y=ua(Sy),jy=b({},ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ny=ua(jy),wy=b({},Is,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ey=ua(wy),Cy=b({},ml,{newState:0,oldState:0}),Ry=ua(Cy),Ty=[9,13,27,32],$o=mn&&"CompositionEvent"in window,Ur=null;mn&&"documentMode"in document&&(Ur=document.documentMode);var zy=mn&&"TextEvent"in window&&!Ur,qd=mn&&(!$o||Ur&&8<Ur&&11>=Ur),Yd=" ",Gd=!1;function Vd(e,t){switch(e){case"keyup":return Ty.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ql=!1;function Oy(e,t){switch(e){case"compositionend":return Kd(t);case"keypress":return t.which!==32?null:(Gd=!0,Yd);case"textInput":return e=t.data,e===Yd&&Gd?null:e;default:return null}}function Dy(e,t){if(Ql)return e==="compositionend"||!$o&&Vd(e,t)?(e=Ld(),Zs=ko=kn=null,Ql=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return qd&&t.locale!=="ko"?null:t.data;default:return null}}var My={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!My[e.type]:t==="textarea"}function Qd(e,t,a,r){Kl?Xl?Xl.push(r):Xl=[r]:Kl=r,t=qi(t,"onChange"),0<t.length&&(a=new Ps("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Hr=null,Br=null;function Ay(e){zh(e,0)}function Ws(e){var t=Pe(e);if(Ks(t))return e}function Zd(e,t){if(e==="change")return t}var Fd=!1;if(mn){var qo;if(mn){var Yo="oninput"in document;if(!Yo){var Jd=document.createElement("div");Jd.setAttribute("oninput","return;"),Yo=typeof Jd.oninput=="function"}qo=Yo}else qo=!1;Fd=qo&&(!document.documentMode||9<document.documentMode)}function Pd(){Hr&&(Hr.detachEvent("onpropertychange",Id),Br=Hr=null)}function Id(e){if(e.propertyName==="value"&&Ws(Br)){var t=[];Qd(t,Br,e,Do(e)),kd(Ay,t)}}function ky(e,t,a){e==="focusin"?(Pd(),Hr=t,Br=a,Hr.attachEvent("onpropertychange",Id)):e==="focusout"&&Pd()}function Ly(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ws(Br)}function Uy(e,t){if(e==="click")return Ws(t)}function Hy(e,t){if(e==="input"||e==="change")return Ws(t)}function By(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ga=typeof Object.is=="function"?Object.is:By;function $r(e,t){if(ga(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(!ea.call(t,c)||!ga(e[c],t[c]))return!1}return!0}function Wd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ef(e,t){var a=Wd(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Wd(a)}}function tf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function af(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Xs(e.document)}return t}function Go(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var $y=mn&&"documentMode"in document&&11>=document.documentMode,Zl=null,Vo=null,qr=null,Ko=!1;function nf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ko||Zl==null||Zl!==Xs(r)||(r=Zl,"selectionStart"in r&&Go(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qr&&$r(qr,r)||(qr=r,r=qi(Vo,"onSelect"),0<r.length&&(t=new Ps("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Zl)))}function hl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Fl={animationend:hl("Animation","AnimationEnd"),animationiteration:hl("Animation","AnimationIteration"),animationstart:hl("Animation","AnimationStart"),transitionrun:hl("Transition","TransitionRun"),transitionstart:hl("Transition","TransitionStart"),transitioncancel:hl("Transition","TransitionCancel"),transitionend:hl("Transition","TransitionEnd")},Xo={},lf={};mn&&(lf=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function pl(e){if(Xo[e])return Xo[e];if(!Fl[e])return e;var t=Fl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in lf)return Xo[e]=t[a];return e}var rf=pl("animationend"),sf=pl("animationiteration"),of=pl("animationstart"),qy=pl("transitionrun"),Yy=pl("transitionstart"),Gy=pl("transitioncancel"),cf=pl("transitionend"),uf=new Map,Qo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Qo.push("scrollEnd");function Ka(e,t){uf.set(e,t),Vt(t,[e])}var ei=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ta=[],Jl=0,Zo=0;function ti(){for(var e=Jl,t=Zo=Jl=0;t<e;){var a=Ta[t];Ta[t++]=null;var r=Ta[t];Ta[t++]=null;var c=Ta[t];Ta[t++]=null;var d=Ta[t];if(Ta[t++]=null,r!==null&&c!==null){var x=r.pending;x===null?c.next=c:(c.next=x.next,x.next=c),r.pending=c}d!==0&&df(a,c,d)}}function ai(e,t,a,r){Ta[Jl++]=e,Ta[Jl++]=t,Ta[Jl++]=a,Ta[Jl++]=r,Zo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Fo(e,t,a,r){return ai(e,t,a,r),ni(e)}function gl(e,t){return ai(e,null,null,t),ni(e)}function df(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,r=d.alternate,r!==null&&(r.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-vt(a),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),d):null}function ni(e){if(50<cs)throw cs=0,lu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pl={};function Vy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xa(e,t,a,r){return new Vy(e,t,a,r)}function Jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hn(e,t){var a=e.alternate;return a===null?(a=xa(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function ff(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,a,r,c,d){var x=0;if(r=e,typeof e=="function")Jo(e)&&(x=1);else if(typeof e=="string")x=Fb(e,a,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=xa(31,a,t,c),e.elementType=H,e.lanes=d,e;case T:return xl(a.children,c,d,t);case A:x=8,c|=24;break;case G:return e=xa(12,a,t,c|2),e.elementType=G,e.lanes=d,e;case X:return e=xa(13,a,t,c),e.elementType=X,e.lanes=d,e;case ne:return e=xa(19,a,t,c),e.elementType=ne,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:x=10;break e;case Z:x=9;break e;case K:x=11;break e;case J: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=xa(x,a,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function xl(e,t,a,r){return e=xa(7,e,r,t),e.lanes=a,e}function Po(e,t,a){return e=xa(6,e,null,t),e.lanes=a,e}function mf(e){var t=xa(18,null,null,0);return t.stateNode=e,t}function Io(e,t,a){return t=xa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hf=new WeakMap;function za(e,t){if(typeof e=="object"&&e!==null){var a=hf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:$t(t)},hf.set(e,t),t)}return{value:e,source:t,stack:$t(t)}}var Il=[],Wl=0,ri=null,Yr=0,Oa=[],Da=0,Ln=null,tn=1,an="";function pn(e,t){Il[Wl++]=Yr,Il[Wl++]=ri,ri=e,Yr=t}function pf(e,t,a){Oa[Da++]=tn,Oa[Da++]=an,Oa[Da++]=Ln,Ln=e;var r=tn;e=an;var c=32-vt(r)-1;r&=~(1<<c),a+=1;var d=32-vt(t)+c;if(30<d){var x=c-c%5;d=(r&(1<<x)-1).toString(32),r>>=x,c-=x,tn=1<<32-vt(t)+c|a<<c|r,an=d+e}else tn=1<<d|a<<c|r,an=e}function Wo(e){e.return!==null&&(pn(e,1),pf(e,1,0))}function ec(e){for(;e===ri;)ri=Il[--Wl],Il[Wl]=null,Yr=Il[--Wl],Il[Wl]=null;for(;e===Ln;)Ln=Oa[--Da],Oa[Da]=null,an=Oa[--Da],Oa[Da]=null,tn=Oa[--Da],Oa[Da]=null}function gf(e,t){Oa[Da++]=tn,Oa[Da++]=an,Oa[Da++]=Ln,tn=t.id,an=t.overflow,Ln=e}var Qt=null,yt=null,Qe=!1,Un=null,Ma=!1,tc=Error(i(519));function Hn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gr(za(t,e)),tc}function xf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[oe]=e,t[fe]=r,a){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(a=0;a<ds.length;a++)Ve(ds[a],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),Td(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),Od(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Ah(t.textContent,a)?(r.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),r.onScroll!=null&&Ve("scroll",t),r.onScrollEnd!=null&&Ve("scrollend",t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||Hn(e,!0)}function yf(e){for(Qt=e.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:Ma=!1;return;case 27:case 3:Ma=!0;return;default:Qt=Qt.return}}function er(e){if(e!==Qt)return!1;if(!Qe)return yf(e),Qe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||bu(e.type,e.memoizedProps)),a=!a),a&&yt&&Hn(e),yf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));yt=Gh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));yt=Gh(e)}else t===27?(t=yt,In(e.type)?(e=Nu,Nu=null,yt=e):yt=t):yt=Qt?ka(e.stateNode.nextSibling):null;return!0}function yl(){yt=Qt=null,Qe=!1}function ac(){var e=Un;return e!==null&&(ha===null?ha=e:ha.push.apply(ha,e),Un=null),e}function Gr(e){Un===null?Un=[e]:Un.push(e)}var nc=N(null),bl=null,gn=null;function Bn(e,t,a){F(nc,t._currentValue),t._currentValue=a}function xn(e){e._currentValue=nc.current,$(nc)}function lc(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function rc(e,t,a,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var x=c.child;d=d.firstContext;e:for(;d!==null;){var S=d;d=c;for(var E=0;E<t.length;E++)if(S.context===t[E]){d.lanes|=a,S=d.alternate,S!==null&&(S.lanes|=a),lc(d.return,a,e),r||(x=null);break e}d=S.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,d=x.alternate,d!==null&&(d.lanes|=a),lc(x,a,e),x=null}else x=c.child;if(x!==null)x.return=c;else for(x=c;x!==null;){if(x===e){x=null;break}if(c=x.sibling,c!==null){c.return=x.return,x=c;break}x=x.return}c=x}}function tr(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;ga(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(gs):e=[gs])}c=c.return}e!==null&&rc(t,e,a,r),t.flags|=262144}function si(e){for(e=e.firstContext;e!==null;){if(!ga(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function vl(e){bl=e,gn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zt(e){return bf(bl,e)}function ii(e,t){return bl===null&&vl(e),bf(e,t)}function bf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},gn===null){if(e===null)throw Error(i(308));gn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else gn=gn.next=t;return a}var Ky=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Xy=n.unstable_scheduleCallback,Qy=n.unstable_NormalPriority,Lt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sc(){return{controller:new Ky,data:new Map,refCount:0}}function Vr(e){e.refCount--,e.refCount===0&&Xy(Qy,function(){e.controller.abort()})}var Kr=null,ic=0,ar=0,nr=null;function Zy(e,t){if(Kr===null){var a=Kr=[];ic=0,ar=uu(),nr={status:"pending",value:void 0,then:function(r){a.push(r)}}}return ic++,t.then(vf,vf),t}function vf(){if(--ic===0&&Kr!==null){nr!==null&&(nr.status="fulfilled");var e=Kr;Kr=null,ar=0,nr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),r}var Sf=M.S;M.S=function(e,t){lh=jt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Zy(e,t),Sf!==null&&Sf(e,t)};var Sl=N(null);function oc(){var e=Sl.current;return e!==null?e:ft.pooledCache}function oi(e,t){t===null?F(Sl,Sl.current):F(Sl,t.pool)}function _f(){var e=oc();return e===null?null:{parent:Lt._currentValue,pool:e}}var lr=Error(i(460)),cc=Error(i(474)),ci=Error(i(542)),ui={then:function(){}};function jf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Nf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(fn,fn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e;default:if(typeof t.status=="string")t.then(fn,fn);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e}throw jl=t,lr}}function _l(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(jl=a,lr):a}}var jl=null;function wf(){if(jl===null)throw Error(i(459));var e=jl;return jl=null,e}function Ef(e){if(e===lr||e===ci)throw Error(i(483))}var rr=null,Xr=0;function di(e){var t=Xr;return Xr+=1,rr===null&&(rr=[]),Nf(rr,e,t)}function Qr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fi(e,t){throw t.$$typeof===_?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Cf(e){function t(D,z){if(e){var k=D.deletions;k===null?(D.deletions=[z],D.flags|=16):k.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=hn(D,z),D.index=0,D.sibling=null,D}function d(D,z,k){return D.index=k,e?(k=D.alternate,k!==null?(k=k.index,k<z?(D.flags|=67108866,z):k):(D.flags|=67108866,z)):(D.flags|=1048576,z)}function x(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function S(D,z,k,Q){return z===null||z.tag!==6?(z=Po(k,D.mode,Q),z.return=D,z):(z=c(z,k),z.return=D,z)}function E(D,z,k,Q){var Ee=k.type;return Ee===T?V(D,z,k.props.children,Q,k.key):z!==null&&(z.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===w&&_l(Ee)===z.type)?(z=c(z,k.props),Qr(z,k),z.return=D,z):(z=li(k.type,k.key,k.props,null,D.mode,Q),Qr(z,k),z.return=D,z)}function L(D,z,k,Q){return z===null||z.tag!==4||z.stateNode.containerInfo!==k.containerInfo||z.stateNode.implementation!==k.implementation?(z=Io(k,D.mode,Q),z.return=D,z):(z=c(z,k.children||[]),z.return=D,z)}function V(D,z,k,Q,Ee){return z===null||z.tag!==7?(z=xl(k,D.mode,Q,Ee),z.return=D,z):(z=c(z,k),z.return=D,z)}function W(D,z,k){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Po(""+z,D.mode,k),z.return=D,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case j:return k=li(z.type,z.key,z.props,null,D.mode,k),Qr(k,z),k.return=D,k;case R:return z=Io(z,D.mode,k),z.return=D,z;case w:return z=_l(z),W(D,z,k)}if(me(z)||ce(z))return z=xl(z,D.mode,k,null),z.return=D,z;if(typeof z.then=="function")return W(D,di(z),k);if(z.$$typeof===Y)return W(D,ii(D,z),k);fi(D,z)}return null}function U(D,z,k,Q){var Ee=z!==null?z.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return Ee!==null?null:S(D,z,""+k,Q);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case j:return k.key===Ee?E(D,z,k,Q):null;case R:return k.key===Ee?L(D,z,k,Q):null;case w:return k=_l(k),U(D,z,k,Q)}if(me(k)||ce(k))return Ee!==null?null:V(D,z,k,Q,null);if(typeof k.then=="function")return U(D,z,di(k),Q);if(k.$$typeof===Y)return U(D,z,ii(D,k),Q);fi(D,k)}return null}function q(D,z,k,Q,Ee){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return D=D.get(k)||null,S(z,D,""+Q,Ee);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case j:return D=D.get(Q.key===null?k:Q.key)||null,E(z,D,Q,Ee);case R:return D=D.get(Q.key===null?k:Q.key)||null,L(z,D,Q,Ee);case w:return Q=_l(Q),q(D,z,k,Q,Ee)}if(me(Q)||ce(Q))return D=D.get(k)||null,V(z,D,Q,Ee,null);if(typeof Q.then=="function")return q(D,z,k,di(Q),Ee);if(Q.$$typeof===Y)return q(D,z,k,ii(z,Q),Ee);fi(z,Q)}return null}function ye(D,z,k,Q){for(var Ee=null,et=null,ve=z,Ue=z=0,Xe=null;ve!==null&&Ue<k.length;Ue++){ve.index>Ue?(Xe=ve,ve=null):Xe=ve.sibling;var tt=U(D,ve,k[Ue],Q);if(tt===null){ve===null&&(ve=Xe);break}e&&ve&&tt.alternate===null&&t(D,ve),z=d(tt,z,Ue),et===null?Ee=tt:et.sibling=tt,et=tt,ve=Xe}if(Ue===k.length)return a(D,ve),Qe&&pn(D,Ue),Ee;if(ve===null){for(;Ue<k.length;Ue++)ve=W(D,k[Ue],Q),ve!==null&&(z=d(ve,z,Ue),et===null?Ee=ve:et.sibling=ve,et=ve);return Qe&&pn(D,Ue),Ee}for(ve=r(ve);Ue<k.length;Ue++)Xe=q(ve,D,Ue,k[Ue],Q),Xe!==null&&(e&&Xe.alternate!==null&&ve.delete(Xe.key===null?Ue:Xe.key),z=d(Xe,z,Ue),et===null?Ee=Xe:et.sibling=Xe,et=Xe);return e&&ve.forEach(function(nl){return t(D,nl)}),Qe&&pn(D,Ue),Ee}function Re(D,z,k,Q){if(k==null)throw Error(i(151));for(var Ee=null,et=null,ve=z,Ue=z=0,Xe=null,tt=k.next();ve!==null&&!tt.done;Ue++,tt=k.next()){ve.index>Ue?(Xe=ve,ve=null):Xe=ve.sibling;var nl=U(D,ve,tt.value,Q);if(nl===null){ve===null&&(ve=Xe);break}e&&ve&&nl.alternate===null&&t(D,ve),z=d(nl,z,Ue),et===null?Ee=nl:et.sibling=nl,et=nl,ve=Xe}if(tt.done)return a(D,ve),Qe&&pn(D,Ue),Ee;if(ve===null){for(;!tt.done;Ue++,tt=k.next())tt=W(D,tt.value,Q),tt!==null&&(z=d(tt,z,Ue),et===null?Ee=tt:et.sibling=tt,et=tt);return Qe&&pn(D,Ue),Ee}for(ve=r(ve);!tt.done;Ue++,tt=k.next())tt=q(ve,D,Ue,tt.value,Q),tt!==null&&(e&&tt.alternate!==null&&ve.delete(tt.key===null?Ue:tt.key),z=d(tt,z,Ue),et===null?Ee=tt:et.sibling=tt,et=tt);return e&&ve.forEach(function(s0){return t(D,s0)}),Qe&&pn(D,Ue),Ee}function ct(D,z,k,Q){if(typeof k=="object"&&k!==null&&k.type===T&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case j:e:{for(var Ee=k.key;z!==null;){if(z.key===Ee){if(Ee=k.type,Ee===T){if(z.tag===7){a(D,z.sibling),Q=c(z,k.props.children),Q.return=D,D=Q;break e}}else if(z.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===w&&_l(Ee)===z.type){a(D,z.sibling),Q=c(z,k.props),Qr(Q,k),Q.return=D,D=Q;break e}a(D,z);break}else t(D,z);z=z.sibling}k.type===T?(Q=xl(k.props.children,D.mode,Q,k.key),Q.return=D,D=Q):(Q=li(k.type,k.key,k.props,null,D.mode,Q),Qr(Q,k),Q.return=D,D=Q)}return x(D);case R:e:{for(Ee=k.key;z!==null;){if(z.key===Ee)if(z.tag===4&&z.stateNode.containerInfo===k.containerInfo&&z.stateNode.implementation===k.implementation){a(D,z.sibling),Q=c(z,k.children||[]),Q.return=D,D=Q;break e}else{a(D,z);break}else t(D,z);z=z.sibling}Q=Io(k,D.mode,Q),Q.return=D,D=Q}return x(D);case w:return k=_l(k),ct(D,z,k,Q)}if(me(k))return ye(D,z,k,Q);if(ce(k)){if(Ee=ce(k),typeof Ee!="function")throw Error(i(150));return k=Ee.call(k),Re(D,z,k,Q)}if(typeof k.then=="function")return ct(D,z,di(k),Q);if(k.$$typeof===Y)return ct(D,z,ii(D,k),Q);fi(D,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,z!==null&&z.tag===6?(a(D,z.sibling),Q=c(z,k),Q.return=D,D=Q):(a(D,z),Q=Po(k,D.mode,Q),Q.return=D,D=Q),x(D)):a(D,z)}return function(D,z,k,Q){try{Xr=0;var Ee=ct(D,z,k,Q);return rr=null,Ee}catch(ve){if(ve===lr||ve===ci)throw ve;var et=xa(29,ve,null,D.mode);return et.lanes=Q,et.return=D,et}}}var Nl=Cf(!0),Rf=Cf(!1),$n=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function qn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Yn(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(lt&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=ni(e),df(e,null,a),t}return ai(e,r,t,a),ni(e)}function Zr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Vs(e,a)}}function fc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=x:d=d.next=x,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var mc=!1;function Fr(){if(mc){var e=nr;if(e!==null)throw e}}function Jr(e,t,a,r){mc=!1;var c=e.updateQueue;$n=!1;var d=c.firstBaseUpdate,x=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var E=S,L=E.next;E.next=null,x===null?d=L:x.next=L,x=E;var V=e.alternate;V!==null&&(V=V.updateQueue,S=V.lastBaseUpdate,S!==x&&(S===null?V.firstBaseUpdate=L:S.next=L,V.lastBaseUpdate=E))}if(d!==null){var W=c.baseState;x=0,V=L=E=null,S=d;do{var U=S.lane&-536870913,q=U!==S.lane;if(q?(Ke&U)===U:(r&U)===U){U!==0&&U===ar&&(mc=!0),V!==null&&(V=V.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ye=e,Re=S;U=t;var ct=a;switch(Re.tag){case 1:if(ye=Re.payload,typeof ye=="function"){W=ye.call(ct,W,U);break e}W=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Re.payload,U=typeof ye=="function"?ye.call(ct,W,U):ye,U==null)break e;W=b({},W,U);break e;case 2:$n=!0}}U=S.callback,U!==null&&(e.flags|=64,q&&(e.flags|=8192),q=c.callbacks,q===null?c.callbacks=[U]:q.push(U))}else q={lane:U,tag:S.tag,payload:S.payload,callback:S.callback,next:null},V===null?(L=V=q,E=W):V=V.next=q,x|=U;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;q=S,S=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);V===null&&(E=W),c.baseState=E,c.firstBaseUpdate=L,c.lastBaseUpdate=V,d===null&&(c.shared.lanes=0),Qn|=x,e.lanes=x,e.memoizedState=W}}function Tf(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function zf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Tf(a[e],t)}var sr=N(null),mi=N(0);function Of(e,t){e=En,F(mi,e),F(sr,t),En=e|t.baseLanes}function hc(){F(mi,En),F(sr,sr.current)}function pc(){En=mi.current,$(sr),$(mi)}var ya=N(null),Aa=null;function Gn(e){var t=e.alternate;F(zt,zt.current&1),F(ya,e),Aa===null&&(t===null||sr.current!==null||t.memoizedState!==null)&&(Aa=e)}function gc(e){F(zt,zt.current),F(ya,e),Aa===null&&(Aa=e)}function Df(e){e.tag===22?(F(zt,zt.current),F(ya,e),Aa===null&&(Aa=e)):Vn()}function Vn(){F(zt,zt.current),F(ya,ya.current)}function ba(e){$(ya),Aa===e&&(Aa=null),$(zt)}var zt=N(0);function hi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||_u(a)||ju(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var yn=0,ke=null,it=null,Ut=null,pi=!1,ir=!1,wl=!1,gi=0,Pr=0,or=null,Jy=0;function Et(){throw Error(i(321))}function xc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ga(e[a],t[a]))return!1;return!0}function yc(e,t,a,r,c,d){return yn=d,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?pm:Mc,wl=!1,d=a(r,c),wl=!1,ir&&(d=Af(t,a,r,c)),Mf(e),d}function Mf(e){M.H=es;var t=it!==null&&it.next!==null;if(yn=0,Ut=it=ke=null,pi=!1,Pr=0,or=null,t)throw Error(i(300));e===null||Ht||(e=e.dependencies,e!==null&&si(e)&&(Ht=!0))}function Af(e,t,a,r){ke=e;var c=0;do{if(ir&&(or=null),Pr=0,ir=!1,25<=c)throw Error(i(301));if(c+=1,Ut=it=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}M.H=gm,d=t(a,r)}while(ir);return d}function Py(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Ir(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(ke.flags|=1024),t}function bc(){var e=gi!==0;return gi=0,e}function vc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Sc(e){if(pi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}pi=!1}yn=0,Ut=it=ke=null,ir=!1,Pr=gi=0,or=null}function la(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?ke.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Ot(){if(it===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Ut===null?ke.memoizedState:Ut.next;if(t!==null)Ut=t,it=e;else{if(e===null)throw ke.alternate===null?Error(i(467)):Error(i(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Ut===null?ke.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function xi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ir(e){var t=Pr;return Pr+=1,or===null&&(or=[]),e=Nf(or,e,t),t=ke,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?pm:Mc),e}function yi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ir(e);if(e.$$typeof===Y)return Zt(e)}throw Error(i(438,String(e)))}function _c(e){var t=null,a=ke.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=ke.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=xi(),ke.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=ee;return t.index++,a}function bn(e,t){return typeof t=="function"?t(e):t}function bi(e){var t=Ot();return jc(t,it,e)}function jc(e,t,a){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=a;var c=e.baseQueue,d=r.pending;if(d!==null){if(c!==null){var x=c.next;c.next=d.next,d.next=x}t.baseQueue=c=d,r.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var S=x=null,E=null,L=t,V=!1;do{var W=L.lane&-536870913;if(W!==L.lane?(Ke&W)===W:(yn&W)===W){var U=L.revertLane;if(U===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),W===ar&&(V=!0);else if((yn&U)===U){L=L.next,U===ar&&(V=!0);continue}else W={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},E===null?(S=E=W,x=d):E=E.next=W,ke.lanes|=U,Qn|=U;W=L.action,wl&&a(d,W),d=L.hasEagerState?L.eagerState:a(d,W)}else U={lane:W,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},E===null?(S=E=U,x=d):E=E.next=U,ke.lanes|=W,Qn|=W;L=L.next}while(L!==null&&L!==t);if(E===null?x=d:E.next=S,!ga(d,e.memoizedState)&&(Ht=!0,V&&(a=nr,a!==null)))throw a;e.memoizedState=d,e.baseState=x,e.baseQueue=E,r.lastRenderedState=d}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Nc(e){var t=Ot(),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);ga(d,t.memoizedState)||(Ht=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,r]}function kf(e,t,a){var r=ke,c=Ot(),d=Qe;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!ga((it||c).memoizedState,a);if(x&&(c.memoizedState=a,Ht=!0),c=c.queue,Cc(Hf.bind(null,r,c,e),[e]),c.getSnapshot!==t||x||Ut!==null&&Ut.memoizedState.tag&1){if(r.flags|=2048,cr(9,{destroy:void 0},Uf.bind(null,r,c,a,t),null),ft===null)throw Error(i(349));d||(yn&127)!==0||Lf(r,t,a)}return a}function Lf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ke.updateQueue,t===null?(t=xi(),ke.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Uf(e,t,a,r){t.value=a,t.getSnapshot=r,Bf(t)&&$f(e)}function Hf(e,t,a){return a(function(){Bf(t)&&$f(e)})}function Bf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ga(e,a)}catch{return!0}}function $f(e){var t=gl(e,2);t!==null&&pa(t,e,2)}function wc(e){var t=la();if(typeof e=="function"){var a=e;if(e=a(),wl){ut(!0);try{a()}finally{ut(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bn,lastRenderedState:e},t}function qf(e,t,a,r){return e.baseState=a,jc(e,it,typeof r=="function"?r:bn)}function Iy(e,t,a,r,c){if(_i(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){d.listeners.push(x)}};M.T!==null?a(!0):d.isTransition=!1,r(d),a=t.pending,a===null?(d.next=t.pending=d,Yf(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Yf(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=M.T,x={};M.T=x;try{var S=a(c,r),E=M.S;E!==null&&E(x,S),Gf(e,t,S)}catch(L){Ec(e,t,L)}finally{d!==null&&x.types!==null&&(d.types=x.types),M.T=d}}else try{d=a(c,r),Gf(e,t,d)}catch(L){Ec(e,t,L)}}function Gf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Vf(e,t,r)},function(r){return Ec(e,t,r)}):Vf(e,t,a)}function Vf(e,t,a){t.status="fulfilled",t.value=a,Kf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Yf(e,a)))}function Ec(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Kf(t),t=t.next;while(t!==r)}e.action=null}function Kf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xf(e,t){return t}function Qf(e,t){if(Qe){var a=ft.formState;if(a!==null){e:{var r=ke;if(Qe){if(yt){t:{for(var c=yt,d=Ma;c.nodeType!==8;){if(!d){c=null;break t}if(c=ka(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){yt=ka(c.nextSibling),r=c.data==="F!";break e}}Hn(r)}r=!1}r&&(t=a[0])}}return a=la(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xf,lastRenderedState:t},a.queue=r,a=fm.bind(null,ke,r),r.dispatch=a,r=wc(!1),d=Dc.bind(null,ke,!1,r.queue),r=la(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=Iy.bind(null,ke,c,d,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function Zf(e){var t=Ot();return Ff(t,it,e)}function Ff(e,t,a){if(t=jc(e,t,Xf)[0],e=bi(bn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Ir(t)}catch(x){throw x===lr?ci:x}else r=t;t=Ot();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(ke.flags|=2048,cr(9,{destroy:void 0},Wy.bind(null,c,a),null)),[r,d,e]}function Wy(e,t){e.action=t}function Jf(e){var t=Ot(),a=it;if(a!==null)return Ff(t,a,e);Ot(),t=t.memoizedState,a=Ot();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function cr(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=ke.updateQueue,t===null&&(t=xi(),ke.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function Pf(){return Ot().memoizedState}function vi(e,t,a,r){var c=la();ke.flags|=e,c.memoizedState=cr(1|t,{destroy:void 0},a,r===void 0?null:r)}function Si(e,t,a,r){var c=Ot();r=r===void 0?null:r;var d=c.memoizedState.inst;it!==null&&r!==null&&xc(r,it.memoizedState.deps)?c.memoizedState=cr(t,d,a,r):(ke.flags|=e,c.memoizedState=cr(1|t,d,a,r))}function If(e,t){vi(8390656,8,e,t)}function Cc(e,t){Si(2048,8,e,t)}function eb(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=xi(),ke.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Wf(e){var t=Ot().memoizedState;return eb({ref:t,nextImpl:e}),function(){if((lt&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function em(e,t){return Si(4,2,e,t)}function tm(e,t){return Si(4,4,e,t)}function am(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nm(e,t,a){a=a!=null?a.concat([e]):null,Si(4,4,am.bind(null,t,e),a)}function Rc(){}function lm(e,t){var a=Ot();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&xc(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function rm(e,t){var a=Ot();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&xc(t,r[1]))return r[0];if(r=e(),wl){ut(!0);try{e()}finally{ut(!1)}}return a.memoizedState=[r,t],r}function Tc(e,t,a){return a===void 0||(yn&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=sh(),ke.lanes|=e,Qn|=e,a)}function sm(e,t,a,r){return ga(a,t)?a:sr.current!==null?(e=Tc(e,a,r),ga(e,t)||(Ht=!0),e):(yn&42)===0||(yn&1073741824)!==0&&(Ke&261930)===0?(Ht=!0,e.memoizedState=a):(e=sh(),ke.lanes|=e,Qn|=e,t)}function im(e,t,a,r,c){var d=I.p;I.p=d!==0&&8>d?d:8;var x=M.T,S={};M.T=S,Dc(e,!1,t,a);try{var E=c(),L=M.S;if(L!==null&&L(S,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var V=Fy(E,r);Wr(e,t,V,_a(e))}else Wr(e,t,r,_a(e))}catch(W){Wr(e,t,{then:function(){},status:"rejected",reason:W},_a())}finally{I.p=d,x!==null&&S.types!==null&&(x.types=S.types),M.T=x}}function tb(){}function zc(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=om(e).queue;im(e,c,t,ie,a===null?tb:function(){return cm(e),a(r)})}function om(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bn,lastRenderedState:ie},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cm(e){var t=om(e);t.next===null&&(t=e.alternate.memoizedState),Wr(e,t.next.queue,{},_a())}function Oc(){return Zt(gs)}function um(){return Ot().memoizedState}function dm(){return Ot().memoizedState}function ab(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=_a();e=qn(a);var r=Yn(t,e,a);r!==null&&(pa(r,t,a),Zr(r,t,a)),t={cache:sc()},e.payload=t;return}t=t.return}}function nb(e,t,a){var r=_a();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},_i(e)?mm(t,a):(a=Fo(e,t,a,r),a!==null&&(pa(a,e,r),hm(a,t,r)))}function fm(e,t,a){var r=_a();Wr(e,t,a,r)}function Wr(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(_i(e))mm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var x=t.lastRenderedState,S=d(x,a);if(c.hasEagerState=!0,c.eagerState=S,ga(S,x))return ai(e,t,c,0),ft===null&&ti(),!1}catch{}if(a=Fo(e,t,c,r),a!==null)return pa(a,e,r),hm(a,t,r),!0}return!1}function Dc(e,t,a,r){if(r={lane:2,revertLane:uu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},_i(e)){if(t)throw Error(i(479))}else t=Fo(e,a,r,2),t!==null&&pa(t,e,2)}function _i(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function mm(e,t){ir=pi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function hm(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Vs(e,a)}}var es={readContext:Zt,use:yi,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};es.useEffectEvent=Et;var pm={readContext:Zt,use:yi,useCallback:function(e,t){return la().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:If,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,vi(4194308,4,am.bind(null,t,e),a)},useLayoutEffect:function(e,t){return vi(4194308,4,e,t)},useInsertionEffect:function(e,t){vi(4,2,e,t)},useMemo:function(e,t){var a=la();t=t===void 0?null:t;var r=e();if(wl){ut(!0);try{e()}finally{ut(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=la();if(a!==void 0){var c=a(t);if(wl){ut(!0);try{a(t)}finally{ut(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=nb.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=la();return e={current:e},t.memoizedState=e},useState:function(e){e=wc(e);var t=e.queue,a=fm.bind(null,ke,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Rc,useDeferredValue:function(e,t){var a=la();return Tc(a,e,t)},useTransition:function(){var e=wc(!1);return e=im.bind(null,ke,e.queue,!0,!1),la().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=ke,c=la();if(Qe){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),ft===null)throw Error(i(349));(Ke&127)!==0||Lf(r,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,If(Hf.bind(null,r,d,e),[e]),r.flags|=2048,cr(9,{destroy:void 0},Uf.bind(null,r,d,a,t),null),a},useId:function(){var e=la(),t=ft.identifierPrefix;if(Qe){var a=an,r=tn;a=(r&~(1<<32-vt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Jy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oc,useFormState:Qf,useActionState:Qf,useOptimistic:function(e){var t=la();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Dc.bind(null,ke,!0,a),a.dispatch=t,[e,t]},useMemoCache:_c,useCacheRefresh:function(){return la().memoizedState=ab.bind(null,ke)},useEffectEvent:function(e){var t=la(),a={impl:e};return t.memoizedState=a,function(){if((lt&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Mc={readContext:Zt,use:yi,useCallback:lm,useContext:Zt,useEffect:Cc,useImperativeHandle:nm,useInsertionEffect:em,useLayoutEffect:tm,useMemo:rm,useReducer:bi,useRef:Pf,useState:function(){return bi(bn)},useDebugValue:Rc,useDeferredValue:function(e,t){var a=Ot();return sm(a,it.memoizedState,e,t)},useTransition:function(){var e=bi(bn)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:Ir(e),t]},useSyncExternalStore:kf,useId:um,useHostTransitionStatus:Oc,useFormState:Zf,useActionState:Zf,useOptimistic:function(e,t){var a=Ot();return qf(a,it,e,t)},useMemoCache:_c,useCacheRefresh:dm};Mc.useEffectEvent=Wf;var gm={readContext:Zt,use:yi,useCallback:lm,useContext:Zt,useEffect:Cc,useImperativeHandle:nm,useInsertionEffect:em,useLayoutEffect:tm,useMemo:rm,useReducer:Nc,useRef:Pf,useState:function(){return Nc(bn)},useDebugValue:Rc,useDeferredValue:function(e,t){var a=Ot();return it===null?Tc(a,e,t):sm(a,it.memoizedState,e,t)},useTransition:function(){var e=Nc(bn)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:Ir(e),t]},useSyncExternalStore:kf,useId:um,useHostTransitionStatus:Oc,useFormState:Jf,useActionState:Jf,useOptimistic:function(e,t){var a=Ot();return it!==null?qf(a,it,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:_c,useCacheRefresh:dm};gm.useEffectEvent=Wf;function Ac(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:b({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var kc={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=_a(),c=qn(r);c.payload=t,a!=null&&(c.callback=a),t=Yn(e,c,r),t!==null&&(pa(t,e,r),Zr(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=_a(),c=qn(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Yn(e,c,r),t!==null&&(pa(t,e,r),Zr(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=_a(),r=qn(a);r.tag=2,t!=null&&(r.callback=t),t=Yn(e,r,a),t!==null&&(pa(t,e,a),Zr(t,e,a))}};function xm(e,t,a,r,c,d,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,x):t.prototype&&t.prototype.isPureReactComponent?!$r(a,r)||!$r(c,d):!0}function ym(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&kc.enqueueReplaceState(t,t.state,null)}function El(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=b({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function bm(e){ei(e)}function vm(e){console.error(e)}function Sm(e){ei(e)}function ji(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function _m(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Lc(e,t,a){return a=qn(a),a.tag=3,a.payload={element:null},a.callback=function(){ji(e,t)},a}function jm(e){return e=qn(e),e.tag=3,e}function Nm(e,t,a,r){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=r.value;e.payload=function(){return c(d)},e.callback=function(){_m(t,a,r)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){_m(t,a,r),typeof c!="function"&&(Zn===null?Zn=new Set([this]):Zn.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function lb(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&tr(t,a,c,!0),a=ya.current,a!==null){switch(a.tag){case 31:case 13:return Aa===null?ki():a.alternate===null&&Ct===0&&(Ct=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===ui?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),iu(e,r,c)),!1;case 22:return a.flags|=65536,r===ui?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),iu(e,r,c)),!1}throw Error(i(435,a.tag))}return iu(e,r,c),ki(),!1}if(Qe)return t=ya.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==tc&&(e=Error(i(422),{cause:r}),Gr(za(e,a)))):(r!==tc&&(t=Error(i(423),{cause:r}),Gr(za(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=za(r,a),c=Lc(e.stateNode,r,c),fc(e,c),Ct!==4&&(Ct=2)),!1;var d=Error(i(520),{cause:r});if(d=za(d,a),os===null?os=[d]:os.push(d),Ct!==4&&(Ct=2),t===null)return!0;r=za(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Lc(a.stateNode,r,e),fc(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Zn===null||!Zn.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=jm(c),Nm(c,e,a,r),fc(a,c),!1}a=a.return}while(a!==null);return!1}var Uc=Error(i(461)),Ht=!1;function Ft(e,t,a,r){t.child=e===null?Rf(t,null,a,r):Nl(t,e.child,a,r)}function wm(e,t,a,r,c){a=a.render;var d=t.ref;if("ref"in r){var x={};for(var S in r)S!=="ref"&&(x[S]=r[S])}else x=r;return vl(t),r=yc(e,t,a,x,d,c),S=bc(),e!==null&&!Ht?(vc(e,t,c),vn(e,t,c)):(Qe&&S&&Wo(t),t.flags|=1,Ft(e,t,r,c),t.child)}function Em(e,t,a,r,c){if(e===null){var d=a.type;return typeof d=="function"&&!Jo(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Cm(e,t,d,r,c)):(e=li(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Kc(e,c)){var x=d.memoizedProps;if(a=a.compare,a=a!==null?a:$r,a(x,r)&&e.ref===t.ref)return vn(e,t,c)}return t.flags|=1,e=hn(d,r),e.ref=t.ref,e.return=t,t.child=e}function Cm(e,t,a,r,c){if(e!==null){var d=e.memoizedProps;if($r(d,r)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=r=d,Kc(e,c))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,vn(e,t,c)}return Hc(e,t,a,r,c)}function Rm(e,t,a,r){var c=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~d}else r=0,t.child=null;return Tm(e,t,d,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&oi(t,d!==null?d.cachePool:null),d!==null?Of(t,d):hc(),Df(t);else return r=t.lanes=536870912,Tm(e,t,d!==null?d.baseLanes|a:a,a,r)}else d!==null?(oi(t,d.cachePool),Of(t,d),Vn(),t.memoizedState=null):(e!==null&&oi(t,null),hc(),Vn());return Ft(e,t,c,a),t.child}function ts(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Tm(e,t,a,r,c){var d=oc();return d=d===null?null:{parent:Lt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&oi(t,null),hc(),Df(t),e!==null&&tr(e,t,r,!0),t.childLanes=c,null}function Ni(e,t){return t=Ei({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zm(e,t,a){return Nl(t,e.child,null,a),e=Ni(t,t.pendingProps),e.flags|=2,ba(t),t.memoizedState=null,e}function rb(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Qe){if(r.mode==="hidden")return e=Ni(t,r),t.lanes=536870912,ts(null,e);if(gc(t),(e=yt)?(e=Yh(e,Ma),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ln!==null?{id:tn,overflow:an}:null,retryLane:536870912,hydrationErrors:null},a=mf(e),a.return=t,t.child=a,Qt=t,yt=null)):e=null,e===null)throw Hn(t);return t.lanes=536870912,null}return Ni(t,r)}var d=e.memoizedState;if(d!==null){var x=d.dehydrated;if(gc(t),c)if(t.flags&256)t.flags&=-257,t=zm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ht||tr(e,t,a,!1),c=(a&e.childLanes)!==0,Ht||c){if(r=ft,r!==null&&(x=C(r,a),x!==0&&x!==d.retryLane))throw d.retryLane=x,gl(e,x),pa(r,e,x),Uc;ki(),t=zm(e,t,a)}else e=d.treeContext,yt=ka(x.nextSibling),Qt=t,Qe=!0,Un=null,Ma=!1,e!==null&&gf(t,e),t=Ni(t,r),t.flags|=4096;return t}return e=hn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function wi(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Hc(e,t,a,r,c){return vl(t),a=yc(e,t,a,r,void 0,c),r=bc(),e!==null&&!Ht?(vc(e,t,c),vn(e,t,c)):(Qe&&r&&Wo(t),t.flags|=1,Ft(e,t,a,c),t.child)}function Om(e,t,a,r,c,d){return vl(t),t.updateQueue=null,a=Af(t,r,a,c),Mf(e),r=bc(),e!==null&&!Ht?(vc(e,t,d),vn(e,t,d)):(Qe&&r&&Wo(t),t.flags|=1,Ft(e,t,a,d),t.child)}function Dm(e,t,a,r,c){if(vl(t),t.stateNode===null){var d=Pl,x=a.contextType;typeof x=="object"&&x!==null&&(d=Zt(x)),d=new a(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=kc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},uc(t),x=a.contextType,d.context=typeof x=="object"&&x!==null?Zt(x):Pl,d.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Ac(t,a,x,r),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(x=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),x!==d.state&&kc.enqueueReplaceState(d,d.state,null),Jr(t,r,d,c),Fr(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var S=t.memoizedProps,E=El(a,S);d.props=E;var L=d.context,V=a.contextType;x=Pl,typeof V=="object"&&V!==null&&(x=Zt(V));var W=a.getDerivedStateFromProps;V=typeof W=="function"||typeof d.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,V||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S||L!==x)&&ym(t,d,r,x),$n=!1;var U=t.memoizedState;d.state=U,Jr(t,r,d,c),Fr(),L=t.memoizedState,S||U!==L||$n?(typeof W=="function"&&(Ac(t,a,W,r),L=t.memoizedState),(E=$n||xm(t,a,E,r,U,L,x))?(V||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=L),d.props=r,d.state=L,d.context=x,r=E):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,dc(e,t),x=t.memoizedProps,V=El(a,x),d.props=V,W=t.pendingProps,U=d.context,L=a.contextType,E=Pl,typeof L=="object"&&L!==null&&(E=Zt(L)),S=a.getDerivedStateFromProps,(L=typeof S=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==W||U!==E)&&ym(t,d,r,E),$n=!1,U=t.memoizedState,d.state=U,Jr(t,r,d,c),Fr();var q=t.memoizedState;x!==W||U!==q||$n||e!==null&&e.dependencies!==null&&si(e.dependencies)?(typeof S=="function"&&(Ac(t,a,S,r),q=t.memoizedState),(V=$n||xm(t,a,V,r,U,q,E)||e!==null&&e.dependencies!==null&&si(e.dependencies))?(L||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,q,E),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,q,E)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=q),d.props=r,d.state=q,d.context=E,r=V):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,wi(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=Nl(t,e.child,null,c),t.child=Nl(t,null,a,c)):Ft(e,t,a,c),t.memoizedState=d.state,e=t.child):e=vn(e,t,c),e}function Mm(e,t,a,r){return yl(),t.flags|=256,Ft(e,t,a,r),t.child}var Bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:_f()}}function qc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Sa),e}function Am(e,t,a){var r=t.pendingProps,c=!1,d=(t.flags&128)!==0,x;if((x=d)||(x=e!==null&&e.memoizedState===null?!1:(zt.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Qe){if(c?Gn(t):Vn(),(e=yt)?(e=Yh(e,Ma),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ln!==null?{id:tn,overflow:an}:null,retryLane:536870912,hydrationErrors:null},a=mf(e),a.return=t,t.child=a,Qt=t,yt=null)):e=null,e===null)throw Hn(t);return ju(e)?t.lanes=32:t.lanes=536870912,null}var S=r.children;return r=r.fallback,c?(Vn(),c=t.mode,S=Ei({mode:"hidden",children:S},c),r=xl(r,c,a,null),S.return=t,r.return=t,S.sibling=r,t.child=S,r=t.child,r.memoizedState=$c(a),r.childLanes=qc(e,x,a),t.memoizedState=Bc,ts(null,r)):(Gn(t),Yc(t,S))}var E=e.memoizedState;if(E!==null&&(S=E.dehydrated,S!==null)){if(d)t.flags&256?(Gn(t),t.flags&=-257,t=Gc(e,t,a)):t.memoizedState!==null?(Vn(),t.child=e.child,t.flags|=128,t=null):(Vn(),S=r.fallback,c=t.mode,r=Ei({mode:"visible",children:r.children},c),S=xl(S,c,a,null),S.flags|=2,r.return=t,S.return=t,r.sibling=S,t.child=r,Nl(t,e.child,null,a),r=t.child,r.memoizedState=$c(a),r.childLanes=qc(e,x,a),t.memoizedState=Bc,t=ts(null,r));else if(Gn(t),ju(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var L=x.dgst;x=L,r=Error(i(419)),r.stack="",r.digest=x,Gr({value:r,source:null,stack:null}),t=Gc(e,t,a)}else if(Ht||tr(e,t,a,!1),x=(a&e.childLanes)!==0,Ht||x){if(x=ft,x!==null&&(r=C(x,a),r!==0&&r!==E.retryLane))throw E.retryLane=r,gl(e,r),pa(x,e,r),Uc;_u(S)||ki(),t=Gc(e,t,a)}else _u(S)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,yt=ka(S.nextSibling),Qt=t,Qe=!0,Un=null,Ma=!1,e!==null&&gf(t,e),t=Yc(t,r.children),t.flags|=4096);return t}return c?(Vn(),S=r.fallback,c=t.mode,E=e.child,L=E.sibling,r=hn(E,{mode:"hidden",children:r.children}),r.subtreeFlags=E.subtreeFlags&65011712,L!==null?S=hn(L,S):(S=xl(S,c,a,null),S.flags|=2),S.return=t,r.return=t,r.sibling=S,t.child=r,ts(null,r),r=t.child,S=e.child.memoizedState,S===null?S=$c(a):(c=S.cachePool,c!==null?(E=Lt._currentValue,c=c.parent!==E?{parent:E,pool:E}:c):c=_f(),S={baseLanes:S.baseLanes|a,cachePool:c}),r.memoizedState=S,r.childLanes=qc(e,x,a),t.memoizedState=Bc,ts(e.child,r)):(Gn(t),a=e.child,e=a.sibling,a=hn(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Yc(e,t){return t=Ei({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ei(e,t){return e=xa(22,e,null,t),e.lanes=0,e}function Gc(e,t,a){return Nl(t,e.child,null,a),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function km(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),lc(e.return,t,a)}function Vc(e,t,a,r,c,d){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:c,treeForkCount:d}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=r,x.tail=a,x.tailMode=c,x.treeForkCount=d)}function Lm(e,t,a){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var x=zt.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,F(zt,x),Ft(e,t,r,a),r=Qe?Yr:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&km(e,a,t);else if(e.tag===19)km(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&hi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Vc(t,!1,c,a,d,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&hi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Vc(t,!0,a,null,d,r);break;case"together":Vc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function vn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Qn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(tr(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=hn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=hn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Kc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&si(e)))}function sb(e,t,a){switch(t.tag){case 3:at(t,t.stateNode.containerInfo),Bn(t,Lt,e.memoizedState.cache),yl();break;case 27:case 5:It(t);break;case 4:at(t,t.stateNode.containerInfo);break;case 10:Bn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Gn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Am(e,t,a):(Gn(t),e=vn(e,t,a),e!==null?e.sibling:null);Gn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(tr(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return Lm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),F(zt,zt.current),r)break;return null;case 22:return t.lanes=0,Rm(e,t,a,t.pendingProps);case 24:Bn(t,Lt,e.memoizedState.cache)}return vn(e,t,a)}function Um(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Kc(e,a)&&(t.flags&128)===0)return Ht=!1,sb(e,t,a);Ht=(e.flags&131072)!==0}else Ht=!1,Qe&&(t.flags&1048576)!==0&&pf(t,Yr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=_l(t.elementType),t.type=e,typeof e=="function")Jo(e)?(r=El(e,r),t.tag=1,t=Dm(null,t,e,r,a)):(t.tag=0,t=Hc(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===K){t.tag=11,t=wm(null,t,e,r,a);break e}else if(c===J){t.tag=14,t=Em(null,t,e,r,a);break e}}throw t=ue(e)||e,Error(i(306,t,""))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=El(r,t.pendingProps),Dm(e,t,r,c,a);case 3:e:{if(at(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,dc(e,t),Jr(t,r,null,a);var x=t.memoizedState;if(r=x.cache,Bn(t,Lt,r),r!==d.cache&&rc(t,[Lt],a,!0),Fr(),r=x.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Mm(e,t,r,a);break e}else if(r!==c){c=za(Error(i(424)),t),Gr(c),t=Mm(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,yt=ka(e.firstChild),Qt=t,Qe=!0,Un=null,Ma=!0,a=Rf(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(yl(),r===c){t=vn(e,t,a);break e}Ft(e,t,r,a)}t=t.child}return t;case 26:return wi(e,t),e===null?(a=Zh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Qe||(a=t.type,e=t.pendingProps,r=Yi(_e.current).createElement(a),r[oe]=t,r[fe]=e,Jt(r,a,e),pt(r),t.stateNode=r):t.memoizedState=Zh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return It(t),e===null&&Qe&&(r=t.stateNode=Kh(t.type,t.pendingProps,_e.current),Qt=t,Ma=!0,c=yt,In(t.type)?(Nu=c,yt=ka(r.firstChild)):yt=c),Ft(e,t,t.pendingProps.children,a),wi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Qe&&((c=r=yt)&&(r=Lb(r,t.type,t.pendingProps,Ma),r!==null?(t.stateNode=r,Qt=t,yt=ka(r.firstChild),Ma=!1,c=!0):c=!1),c||Hn(t)),It(t),c=t.type,d=t.pendingProps,x=e!==null?e.memoizedProps:null,r=d.children,bu(c,d)?r=null:x!==null&&bu(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=yc(e,t,Py,null,null,a),gs._currentValue=c),wi(e,t),Ft(e,t,r,a),t.child;case 6:return e===null&&Qe&&((e=a=yt)&&(a=Ub(a,t.pendingProps,Ma),a!==null?(t.stateNode=a,Qt=t,yt=null,e=!0):e=!1),e||Hn(t)),null;case 13:return Am(e,t,a);case 4:return at(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Nl(t,null,r,a):Ft(e,t,r,a),t.child;case 11:return wm(e,t,t.type,t.pendingProps,a);case 7:return Ft(e,t,t.pendingProps,a),t.child;case 8:return Ft(e,t,t.pendingProps.children,a),t.child;case 12:return Ft(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,Bn(t,t.type,r.value),Ft(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,vl(t),c=Zt(c),r=r(c),t.flags|=1,Ft(e,t,r,a),t.child;case 14:return Em(e,t,t.type,t.pendingProps,a);case 15:return Cm(e,t,t.type,t.pendingProps,a);case 19:return Lm(e,t,a);case 31:return rb(e,t,a);case 22:return Rm(e,t,a,t.pendingProps);case 24:return vl(t),r=Zt(Lt),e===null?(c=oc(),c===null&&(c=ft,d=sc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:r,cache:c},uc(t),Bn(t,Lt,c)):((e.lanes&a)!==0&&(dc(e,t),Jr(t,null,null,a),Fr()),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),Bn(t,Lt,r)):(r=d.cache,Bn(t,Lt,r),r!==c.cache&&rc(t,[Lt],a,!0))),Ft(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Sn(e){e.flags|=4}function Xc(e,t,a,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(uh())e.flags|=8192;else throw jl=ui,cc}else e.flags&=-16777217}function Hm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wh(t))if(uh())e.flags|=8192;else throw jl=ui,cc}function Ci(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ul():536870912,e.lanes|=t,mr|=t)}function as(e,t){if(!Qe)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function ib(e,t,a){var r=t.pendingProps;switch(ec(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(t),null;case 1:return bt(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xn(Lt),Le(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(er(t)?Sn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ac())),bt(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(Sn(t),d!==null?(bt(t),Hm(t,d)):(bt(t),Xc(t,c,null,r,a))):d?d!==e.memoizedState?(Sn(t),bt(t),Hm(t,d)):(bt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Sn(t),bt(t),Xc(t,c,e,r,a)),null;case 27:if(ia(t),a=_e.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bt(t),null}e=le.current,er(t)?xf(t):(e=Kh(c,r,a),t.stateNode=e,Sn(t))}return bt(t),null;case 5:if(ia(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bt(t),null}if(d=le.current,er(t))xf(t);else{var x=Yi(_e.current);switch(d){case 1:d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=x.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?x.createElement("select",{is:r.is}):x.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?x.createElement(c,{is:r.is}):x.createElement(c)}}d[oe]=t,d[fe]=r;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)d.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=d;e:switch(Jt(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&&Sn(t)}}return bt(t),Xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Sn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=_e.current,er(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=Qt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[oe]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Ah(e.nodeValue,a)),e||Hn(t,!0)}else e=Yi(e).createTextNode(r),e[oe]=t,t.stateNode=e}return bt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=er(t),a!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[oe]=t}else yl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),e=!1}else a=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ba(t),t):(ba(t),null);if((t.flags&128)!==0)throw Error(i(558))}return bt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=er(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[oe]=t}else yl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),c=!1}else c=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(ba(t),t):(ba(t),null)}return ba(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ci(t,t.updateQueue),bt(t),null);case 4:return Le(),e===null&&hu(t.stateNode.containerInfo),bt(t),null;case 10:return xn(t.type),bt(t),null;case 19:if($(zt),r=t.memoizedState,r===null)return bt(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)as(r,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=hi(e),d!==null){for(t.flags|=128,as(r,!1),e=d.updateQueue,t.updateQueue=e,Ci(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)ff(a,e),a=a.sibling;return F(zt,zt.current&1|2),Qe&&pn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&jt()>Di&&(t.flags|=128,c=!0,as(r,!1),t.lanes=4194304)}else{if(!c)if(e=hi(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ci(t,e),as(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Qe)return bt(t),null}else 2*jt()-r.renderingStartTime>Di&&a!==536870912&&(t.flags|=128,c=!0,as(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=jt(),e.sibling=null,a=zt.current,F(zt,c?a&1|2:a&1),Qe&&pn(t,r.treeForkCount),e):(bt(t),null);case 22:case 23:return ba(t),pc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),a=t.updateQueue,a!==null&&Ci(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&$(Sl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),xn(Lt),bt(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function ob(e,t){switch(ec(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xn(Lt),Le(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ia(t),null;case 31:if(t.memoizedState!==null){if(ba(t),t.alternate===null)throw Error(i(340));yl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ba(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));yl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(zt),null;case 4:return Le(),null;case 10:return xn(t.type),null;case 22:case 23:return ba(t),pc(),e!==null&&$(Sl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xn(Lt),null;case 25:return null;default:return null}}function Bm(e,t){switch(ec(t),t.tag){case 3:xn(Lt),Le();break;case 26:case 27:case 5:ia(t);break;case 4:Le();break;case 31:t.memoizedState!==null&&ba(t);break;case 13:ba(t);break;case 19:$(zt);break;case 10:xn(t.type);break;case 22:case 23:ba(t),pc(),e!==null&&$(Sl);break;case 24:xn(Lt)}}function ns(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var c=r.next;a=c;do{if((a.tag&e)===e){r=void 0;var d=a.create,x=a.inst;r=d(),x.destroy=r}a=a.next}while(a!==c)}}catch(S){st(t,t.return,S)}}function Kn(e,t,a){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&e)===e){var x=r.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,c=t;var E=a,L=S;try{L()}catch(V){st(c,E,V)}}}r=r.next}while(r!==d)}}catch(V){st(t,t.return,V)}}function $m(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{zf(t,a)}catch(r){st(e,e.return,r)}}}function qm(e,t,a){a.props=El(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){st(e,t,r)}}function ls(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(c){st(e,t,c)}}function nn(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(c){st(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){st(e,t,c)}else a.current=null}function Ym(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(c){st(e,e.return,c)}}function Qc(e,t,a){try{var r=e.stateNode;zb(r,e.type,a,t),r[fe]=t}catch(c){st(e,e.return,c)}}function Gm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&In(e.type)||e.tag===4}function Zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&In(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fc(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=fn));else if(r!==4&&(r===27&&In(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Fc(e,t,a),e=e.sibling;e!==null;)Fc(e,t,a),e=e.sibling}function Ri(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&In(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ri(e,t,a),e=e.sibling;e!==null;)Ri(e,t,a),e=e.sibling}function Vm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Jt(t,r,a),t[oe]=e,t[fe]=a}catch(d){st(e,e.return,d)}}var _n=!1,Bt=!1,Jc=!1,Km=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function cb(e,t){if(e=e.containerInfo,xu=Fi,e=af(e),Go(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var x=0,S=-1,E=-1,L=0,V=0,W=e,U=null;t:for(;;){for(var q;W!==a||c!==0&&W.nodeType!==3||(S=x+c),W!==d||r!==0&&W.nodeType!==3||(E=x+r),W.nodeType===3&&(x+=W.nodeValue.length),(q=W.firstChild)!==null;)U=W,W=q;for(;;){if(W===e)break t;if(U===a&&++L===c&&(S=x),U===d&&++V===r&&(E=x),(q=W.nextSibling)!==null)break;W=U,U=W.parentNode}W=q}a=S===-1||E===-1?null:{start:S,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(yu={focusedElem:e,selectionRange:a},Fi=!1,Kt=t;Kt!==null;)if(t=Kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Kt=e;else for(;Kt!==null;){switch(t=Kt,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 ye=El(a.type,c);e=r.getSnapshotBeforeUpdate(ye,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(Re){st(a,a.return,Re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Su(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Su(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Kt=e;break}Kt=t.return}}function Xm(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Nn(e,a),r&4&&ns(5,a);break;case 1:if(Nn(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){st(a,a.return,x)}else{var c=El(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){st(a,a.return,x)}}r&64&&$m(a),r&512&&ls(a,a.return);break;case 3:if(Nn(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{zf(e,t)}catch(x){st(a,a.return,x)}}break;case 27:t===null&&r&4&&Vm(a);case 26:case 5:Nn(e,a),t===null&&r&4&&Ym(a),r&512&&ls(a,a.return);break;case 12:Nn(e,a);break;case 31:Nn(e,a),r&4&&Fm(e,a);break;case 13:Nn(e,a),r&4&&Jm(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=yb.bind(null,a),Hb(e,a))));break;case 22:if(r=a.memoizedState!==null||_n,!r){t=t!==null&&t.memoizedState!==null||Bt,c=_n;var d=Bt;_n=r,(Bt=t)&&!d?wn(e,a,(a.subtreeFlags&8772)!==0):Nn(e,a),_n=c,Bt=d}break;case 30:break;default:Nn(e,a)}}function Qm(e){var t=e.alternate;t!==null&&(e.alternate=null,Qm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var St=null,da=!1;function jn(e,t,a){for(a=a.child;a!==null;)Zm(e,t,a),a=a.sibling}function Zm(e,t,a){if(nt&&typeof nt.onCommitFiberUnmount=="function")try{nt.onCommitFiberUnmount(Ae,a)}catch{}switch(a.tag){case 26:Bt||nn(a,t),jn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||nn(a,t);var r=St,c=da;In(a.type)&&(St=a.stateNode,da=!1),jn(e,t,a),ms(a.stateNode),St=r,da=c;break;case 5:Bt||nn(a,t);case 6:if(r=St,c=da,St=null,jn(e,t,a),St=r,da=c,St!==null)if(da)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(a.stateNode)}catch(d){st(a,t,d)}else try{St.removeChild(a.stateNode)}catch(d){st(a,t,d)}break;case 18:St!==null&&(da?(e=St,$h(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Sr(e)):$h(St,a.stateNode));break;case 4:r=St,c=da,St=a.stateNode.containerInfo,da=!0,jn(e,t,a),St=r,da=c;break;case 0:case 11:case 14:case 15:Kn(2,a,t),Bt||Kn(4,a,t),jn(e,t,a);break;case 1:Bt||(nn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&qm(a,t,r)),jn(e,t,a);break;case 21:jn(e,t,a);break;case 22:Bt=(r=Bt)||a.memoizedState!==null,jn(e,t,a),Bt=r;break;default:jn(e,t,a)}}function Fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Sr(e)}catch(a){st(t,t.return,a)}}}function Jm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Sr(e)}catch(a){st(t,t.return,a)}}function ub(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Km),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Km),t;default:throw Error(i(435,e.tag))}}function Ti(e,t){var a=ub(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=bb.bind(null,e,r);r.then(c,c)}})}function fa(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var c=a[r],d=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(In(S.type)){St=S.stateNode,da=!1;break e}break;case 5:St=S.stateNode,da=!1;break e;case 3:case 4:St=S.stateNode.containerInfo,da=!0;break e}S=S.return}if(St===null)throw Error(i(160));Zm(d,x,c),St=null,da=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pm(t,e),t=t.sibling}var Xa=null;function Pm(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fa(t,e),ma(e),r&4&&(Kn(3,e,e.return),ns(3,e),Kn(5,e,e.return));break;case 1:fa(t,e),ma(e),r&512&&(Bt||a===null||nn(a,a.return)),r&64&&_n&&(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=Xa;if(fa(t,e),ma(e),r&512&&(Bt||a===null||nn(a,a.return)),r&4){var d=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":d=c.getElementsByTagName("title")[0],(!d||d[$e]||d[oe]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),Jt(d,r,a),d[oe]=e,pt(d),r=d;break e;case"link":var x=Ph("link","href",c).get(r+(a.href||""));if(x){for(var S=0;S<x.length;S++)if(d=x[S],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(S,1);break t}}d=c.createElement(r),Jt(d,r,a),c.head.appendChild(d);break;case"meta":if(x=Ph("meta","content",c).get(r+(a.content||""))){for(S=0;S<x.length;S++)if(d=x[S],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(S,1);break t}}d=c.createElement(r),Jt(d,r,a),c.head.appendChild(d);break;default:throw Error(i(468,r))}d[oe]=e,pt(d),r=d}e.stateNode=r}else Ih(c,e.type,e.stateNode);else e.stateNode=Jh(c,r,e.memoizedProps);else d!==r?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,r===null?Ih(c,e.type,e.stateNode):Jh(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,a.memoizedProps)}break;case 27:fa(t,e),ma(e),r&512&&(Bt||a===null||nn(a,a.return)),a!==null&&r&4&&Qc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(fa(t,e),ma(e),r&512&&(Bt||a===null||nn(a,a.return)),e.flags&32){c=e.stateNode;try{Vl(c,"")}catch(ye){st(e,e.return,ye)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Qc(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Jc=!0);break;case 6:if(fa(t,e),ma(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(ye){st(e,e.return,ye)}}break;case 3:if(Ki=null,c=Xa,Xa=Gi(t.containerInfo),fa(t,e),Xa=c,ma(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Sr(t.containerInfo)}catch(ye){st(e,e.return,ye)}Jc&&(Jc=!1,Im(e));break;case 4:r=Xa,Xa=Gi(e.stateNode.containerInfo),fa(t,e),ma(e),Xa=r;break;case 12:fa(t,e),ma(e);break;case 31:fa(t,e),ma(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ti(e,r)));break;case 13:fa(t,e),ma(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Oi=jt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ti(e,r)));break;case 22:c=e.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,L=_n,V=Bt;if(_n=L||c,Bt=V||E,fa(t,e),Bt=V,_n=L,ma(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||E||_n||Bt||Cl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){E=a=t;try{if(d=E.stateNode,c)x=d.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=E.stateNode;var W=E.memoizedProps.style,U=W!=null&&W.hasOwnProperty("display")?W.display:null;S.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(ye){st(E,E.return,ye)}}}else if(t.tag===6){if(a===null){E=t;try{E.stateNode.nodeValue=c?"":E.memoizedProps}catch(ye){st(E,E.return,ye)}}}else if(t.tag===18){if(a===null){E=t;try{var q=E.stateNode;c?qh(q,!0):qh(E.stateNode,!1)}catch(ye){st(E,E.return,ye)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ti(e,a))));break;case 19:fa(t,e),ma(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ti(e,r)));break;case 30:break;case 21:break;default:fa(t,e),ma(e)}}function ma(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Gm(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=Zc(e);Ri(e,d,c);break;case 5:var x=a.stateNode;a.flags&32&&(Vl(x,""),a.flags&=-33);var S=Zc(e);Ri(e,S,x);break;case 3:case 4:var E=a.stateNode.containerInfo,L=Zc(e);Fc(e,L,E);break;default:throw Error(i(161))}}catch(V){st(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Im(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Im(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Nn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xm(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kn(4,t,t.return),Cl(t);break;case 1:nn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&qm(t,t.return,a),Cl(t);break;case 27:ms(t.stateNode);case 26:case 5:nn(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function wn(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:wn(c,d,a),ns(4,d);break;case 1:if(wn(c,d,a),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){st(r,r.return,L)}if(r=d,c=r.updateQueue,c!==null){var S=r.stateNode;try{var E=c.shared.hiddenCallbacks;if(E!==null)for(c.shared.hiddenCallbacks=null,c=0;c<E.length;c++)Tf(E[c],S)}catch(L){st(r,r.return,L)}}a&&x&64&&$m(d),ls(d,d.return);break;case 27:Vm(d);case 26:case 5:wn(c,d,a),a&&r===null&&x&4&&Ym(d),ls(d,d.return);break;case 12:wn(c,d,a);break;case 31:wn(c,d,a),a&&x&4&&Fm(c,d);break;case 13:wn(c,d,a),a&&x&4&&Jm(c,d);break;case 22:d.memoizedState===null&&wn(c,d,a),ls(d,d.return);break;case 30:break;default:wn(c,d,a)}t=t.sibling}}function Pc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Vr(a))}function Ic(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Vr(e))}function Qa(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wm(e,t,a,r),t=t.sibling}function Wm(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Qa(e,t,a,r),c&2048&&ns(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&&Vr(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(E){st(t,t.return,E)}}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):rs(e,t):d._visibility&2?Qa(e,t,a,r):(d._visibility|=2,ur(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Pc(x,t);break;case 24:Qa(e,t,a,r),c&2048&&Ic(t.alternate,t);break;default:Qa(e,t,a,r)}}function ur(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,x=t,S=a,E=r,L=x.flags;switch(x.tag){case 0:case 11:case 15:ur(d,x,S,E,c),ns(8,x);break;case 23:break;case 22:var V=x.stateNode;x.memoizedState!==null?V._visibility&2?ur(d,x,S,E,c):rs(d,x):(V._visibility|=2,ur(d,x,S,E,c)),c&&L&2048&&Pc(x.alternate,x);break;case 24:ur(d,x,S,E,c),c&&L&2048&&Ic(x.alternate,x);break;default:ur(d,x,S,E,c)}t=t.sibling}}function rs(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:rs(a,r),c&2048&&Pc(r.alternate,r);break;case 24:rs(a,r),c&2048&&Ic(r.alternate,r);break;default:rs(a,r)}t=t.sibling}}var ss=8192;function dr(e,t,a){if(e.subtreeFlags&ss)for(e=e.child;e!==null;)eh(e,t,a),e=e.sibling}function eh(e,t,a){switch(e.tag){case 26:dr(e,t,a),e.flags&ss&&e.memoizedState!==null&&Jb(a,Xa,e.memoizedState,e.memoizedProps);break;case 5:dr(e,t,a);break;case 3:case 4:var r=Xa;Xa=Gi(e.stateNode.containerInfo),dr(e,t,a),Xa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ss,ss=16777216,dr(e,t,a),ss=r):dr(e,t,a));break;default:dr(e,t,a)}}function th(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function is(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];Kt=r,nh(r,e)}th(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ah(e),e=e.sibling}function ah(e){switch(e.tag){case 0:case 11:case 15:is(e),e.flags&2048&&Kn(9,e,e.return);break;case 3:is(e);break;case 12:is(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zi(e)):is(e);break;default:is(e)}}function zi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Kt=r,nh(r,e)}th(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kn(8,t,t.return),zi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,zi(t));break;default:zi(t)}e=e.sibling}}function nh(e,t){for(;Kt!==null;){var a=Kt;switch(a.tag){case 0:case 11:case 15:Kn(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:Vr(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Kt=r;else e:for(a=e;Kt!==null;){r=Kt;var c=r.sibling,d=r.return;if(Qm(r),r===a){Kt=null;break e}if(c!==null){c.return=d,Kt=c;break e}Kt=d}}}var db={getCacheForType:function(e){var t=Zt(Lt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Zt(Lt).controller.signal}},fb=typeof WeakMap=="function"?WeakMap:Map,lt=0,ft=null,Ge=null,Ke=0,rt=0,va=null,Xn=!1,fr=!1,Wc=!1,En=0,Ct=0,Qn=0,Rl=0,eu=0,Sa=0,mr=0,os=null,ha=null,tu=!1,Oi=0,lh=0,Di=1/0,Mi=null,Zn=null,Yt=0,Fn=null,hr=null,Cn=0,au=0,nu=null,rh=null,cs=0,lu=null;function _a(){return(lt&2)!==0&&Ke!==0?Ke&-Ke:M.T!==null?uu():ae()}function sh(){if(Sa===0)if((Ke&536870912)===0||Qe){var e=Fe;Fe<<=1,(Fe&3932160)===0&&(Fe=262144),Sa=e}else Sa=536870912;return e=ya.current,e!==null&&(e.flags|=32),Sa}function pa(e,t,a){(e===ft&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(pr(e,0),Jn(e,Ke,Sa,!1)),Ca(e,a),((lt&2)===0||e!==ft)&&(e===ft&&((lt&2)===0&&(Rl|=a),Ct===4&&Jn(e,Ke,Sa,!1)),ln(e))}function ih(e,t,a){if((lt&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ya(e,t),c=r?pb(e,t):su(e,t,!0),d=r;do{if(c===0){fr&&!r&&Jn(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!mb(a)){c=su(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;c=os;var E=S.current.memoizedState.isDehydrated;if(E&&(pr(S,x).flags|=256),x=su(S,x,!1),x!==2){if(Wc&&!E){S.errorRecoveryDisabledLanes|=d,Rl|=d,c=4;break e}d=ha,ha=c,d!==null&&(ha===null?ha=d:ha.push.apply(ha,d))}c=x}if(d=!1,c!==2)continue}}if(c===1){pr(e,0),Jn(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:Jn(r,t,Sa,!Xn);break e;case 2:ha=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Oi+300-jt(),10<c)){if(Jn(r,t,Sa,!Xn),dn(r,0,!0)!==0)break e;Cn=t,r.timeoutHandle=Hh(oh.bind(null,r,a,ha,Mi,tu,t,Sa,Rl,mr,Xn,d,"Throttled",-0,0),c);break e}oh(r,a,ha,Mi,tu,t,Sa,Rl,mr,Xn,d,null,-0,0)}}break}while(!0);ln(e)}function oh(e,t,a,r,c,d,x,S,E,L,V,W,U,q){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:fn},eh(t,d,W);var ye=(d&62914560)===d?Oi-jt():(d&4194048)===d?lh-jt():0;if(ye=Pb(W,ye),ye!==null){Cn=d,e.cancelPendingCommit=ye(gh.bind(null,e,t,d,a,r,c,x,S,E,V,W,null,U,q)),Jn(e,d,x,!L);return}}gh(e,t,d,a,r,c,x,S,E)}function mb(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var c=a[r],d=c.getSnapshot;c=c.value;try{if(!ga(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 Jn(e,t,a,r){t&=~eu,t&=~Rl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-vt(c),x=1<<d;r[d]=-1,c&=~x}a!==0&&Gs(e,a,t)}function Ai(){return(lt&6)===0?(us(0),!1):!0}function ru(){if(Ge!==null){if(rt===0)var e=Ge.return;else e=Ge,gn=bl=null,Sc(e),rr=null,Xr=0,e=Ge;for(;e!==null;)Bm(e.alternate,e),e=e.return;Ge=null}}function pr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Mb(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Cn=0,ru(),ft=e,Ge=a=hn(e.current,null),Ke=t,rt=0,va=null,Xn=!1,fr=Ya(e,t),Wc=!1,mr=Sa=eu=Rl=Qn=Ct=0,ha=os=null,tu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-vt(r),d=1<<c;t|=e[c],r&=~d}return En=t,ti(),a}function ch(e,t){ke=null,M.H=es,t===lr||t===ci?(t=wf(),rt=3):t===cc?(t=wf(),rt=4):rt=t===Uc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,va=t,Ge===null&&(Ct=1,ji(e,za(t,e.current)))}function uh(){var e=ya.current;return e===null?!0:(Ke&4194048)===Ke?Aa===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===Aa:!1}function dh(){var e=M.H;return M.H=es,e===null?es:e}function fh(){var e=M.A;return M.A=db,e}function ki(){Ct=4,Xn||(Ke&4194048)!==Ke&&ya.current!==null||(fr=!0),(Qn&134217727)===0&&(Rl&134217727)===0||ft===null||Jn(ft,Ke,Sa,!1)}function su(e,t,a){var r=lt;lt|=2;var c=dh(),d=fh();(ft!==e||Ke!==t)&&(Mi=null,pr(e,t)),t=!1;var x=Ct;e:do try{if(rt!==0&&Ge!==null){var S=Ge,E=va;switch(rt){case 8:ru(),x=6;break e;case 3:case 2:case 9:case 6:ya.current===null&&(t=!0);var L=rt;if(rt=0,va=null,gr(e,S,E,L),a&&fr){x=0;break e}break;default:L=rt,rt=0,va=null,gr(e,S,E,L)}}hb(),x=Ct;break}catch(V){ch(e,V)}while(!0);return t&&e.shellSuspendCounter++,gn=bl=null,lt=r,M.H=c,M.A=d,Ge===null&&(ft=null,Ke=0,ti()),x}function hb(){for(;Ge!==null;)mh(Ge)}function pb(e,t){var a=lt;lt|=2;var r=dh(),c=fh();ft!==e||Ke!==t?(Mi=null,Di=jt()+500,pr(e,t)):fr=Ya(e,t);e:do try{if(rt!==0&&Ge!==null){t=Ge;var d=va;t:switch(rt){case 1:rt=0,va=null,gr(e,t,d,1);break;case 2:case 9:if(jf(d)){rt=0,va=null,hh(t);break}t=function(){rt!==2&&rt!==9||ft!==e||(rt=7),ln(e)},d.then(t,t);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:jf(d)?(rt=0,va=null,hh(t)):(rt=0,va=null,gr(e,t,d,7));break;case 5:var x=null;switch(Ge.tag){case 26:x=Ge.memoizedState;case 5:case 27:var S=Ge;if(x?Wh(x):S.stateNode.complete){rt=0,va=null;var E=S.sibling;if(E!==null)Ge=E;else{var L=S.return;L!==null?(Ge=L,Li(L)):Ge=null}break t}}rt=0,va=null,gr(e,t,d,5);break;case 6:rt=0,va=null,gr(e,t,d,6);break;case 8:ru(),Ct=6;break e;default:throw Error(i(462))}}gb();break}catch(V){ch(e,V)}while(!0);return gn=bl=null,M.H=r,M.A=c,lt=a,Ge!==null?0:(ft=null,Ke=0,ti(),Ct)}function gb(){for(;Ge!==null&&!cn();)mh(Ge)}function mh(e){var t=Um(e.alternate,e,En);e.memoizedProps=e.pendingProps,t===null?Li(e):Ge=t}function hh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Om(a,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Om(a,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:Sc(t);default:Bm(a,t),t=Ge=ff(t,En),t=Um(a,t,En)}e.memoizedProps=e.pendingProps,t===null?Li(e):Ge=t}function gr(e,t,a,r){gn=bl=null,Sc(t),rr=null,Xr=0;var c=t.return;try{if(lb(e,c,t,a,Ke)){Ct=1,ji(e,za(a,e.current)),Ge=null;return}}catch(d){if(c!==null)throw Ge=c,d;Ct=1,ji(e,za(a,e.current)),Ge=null;return}t.flags&32768?(Qe||r===1?e=!0:fr||(Ke&536870912)!==0?e=!1:(Xn=e=!0,(r===2||r===9||r===3||r===6)&&(r=ya.current,r!==null&&r.tag===13&&(r.flags|=16384))),ph(t,e)):Li(t)}function Li(e){var t=e;do{if((t.flags&32768)!==0){ph(t,Xn);return}e=t.return;var a=ib(t.alternate,t,En);if(a!==null){Ge=a;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Ct===0&&(Ct=5)}function ph(e,t){do{var a=ob(e.alternate,e);if(a!==null){a.flags&=32767,Ge=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=a}while(e!==null);Ct=6,Ge=null}function gh(e,t,a,r,c,d,x,S,E){e.cancelPendingCommit=null;do Ui();while(Yt!==0);if((lt&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=Zo,Ys(e,a,d,x,S,E),e===ft&&(Ge=ft=null,Ke=0),hr=t,Fn=e,Cn=a,au=d,nu=c,rh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,vb(Ye,function(){return Sh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=M.T,M.T=null,c=I.p,I.p=2,x=lt,lt|=4;try{cb(e,t,a)}finally{lt=x,I.p=c,M.T=r}}Yt=1,xh(),yh(),bh()}}function xh(){if(Yt===1){Yt=0;var e=Fn,t=hr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var r=I.p;I.p=2;var c=lt;lt|=4;try{Pm(t,e);var d=yu,x=af(e.containerInfo),S=d.focusedElem,E=d.selectionRange;if(x!==S&&S&&S.ownerDocument&&tf(S.ownerDocument.documentElement,S)){if(E!==null&&Go(S)){var L=E.start,V=E.end;if(V===void 0&&(V=L),"selectionStart"in S)S.selectionStart=L,S.selectionEnd=Math.min(V,S.value.length);else{var W=S.ownerDocument||document,U=W&&W.defaultView||window;if(U.getSelection){var q=U.getSelection(),ye=S.textContent.length,Re=Math.min(E.start,ye),ct=E.end===void 0?Re:Math.min(E.end,ye);!q.extend&&Re>ct&&(x=ct,ct=Re,Re=x);var D=ef(S,Re),z=ef(S,ct);if(D&&z&&(q.rangeCount!==1||q.anchorNode!==D.node||q.anchorOffset!==D.offset||q.focusNode!==z.node||q.focusOffset!==z.offset)){var k=W.createRange();k.setStart(D.node,D.offset),q.removeAllRanges(),Re>ct?(q.addRange(k),q.extend(z.node,z.offset)):(k.setEnd(z.node,z.offset),q.addRange(k))}}}}for(W=[],q=S;q=q.parentNode;)q.nodeType===1&&W.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<W.length;S++){var Q=W[S];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Fi=!!xu,yu=xu=null}finally{lt=c,I.p=r,M.T=a}}e.current=t,Yt=2}}function yh(){if(Yt===2){Yt=0;var e=Fn,t=hr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var r=I.p;I.p=2;var c=lt;lt|=4;try{Xm(e,t.alternate,t)}finally{lt=c,I.p=r,M.T=a}}Yt=3}}function bh(){if(Yt===4||Yt===3){Yt=0,un();var e=Fn,t=hr,a=Cn,r=rh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Yt=5:(Yt=0,hr=Fn=null,vh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Zn=null),B(a),t=t.stateNode,nt&&typeof nt.onCommitFiberRoot=="function")try{nt.onCommitFiberRoot(Ae,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=M.T,c=I.p,I.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,I.p=c}}(Cn&3)!==0&&Ui(),ln(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===lu?cs++:(cs=0,lu=e):cs=0,us(0)}}function vh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Vr(t)))}function Ui(){return xh(),yh(),bh(),Sh()}function Sh(){if(Yt!==5)return!1;var e=Fn,t=au;au=0;var a=B(Cn),r=M.T,c=I.p;try{I.p=32>a?32:a,M.T=null,a=nu,nu=null;var d=Fn,x=Cn;if(Yt=0,hr=Fn=null,Cn=0,(lt&6)!==0)throw Error(i(331));var S=lt;if(lt|=4,ah(d.current),Wm(d,d.current,x,a),lt=S,us(0,!1),nt&&typeof nt.onPostCommitFiberRoot=="function")try{nt.onPostCommitFiberRoot(Ae,d)}catch{}return!0}finally{I.p=c,M.T=r,vh(e,t)}}function _h(e,t,a){t=za(a,t),t=Lc(e.stateNode,t,2),e=Yn(e,t,2),e!==null&&(Ca(e,2),ln(e))}function st(e,t,a){if(e.tag===3)_h(e,e,a);else for(;t!==null;){if(t.tag===3){_h(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Zn===null||!Zn.has(r))){e=za(a,e),a=jm(2),r=Yn(t,a,2),r!==null&&(Nm(a,r,t,e),Ca(r,2),ln(r));break}}t=t.return}}function iu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new fb;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(a)||(Wc=!0,c.add(a),e=xb.bind(null,e,t,a),t.then(e,e))}function xb(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ft===e&&(Ke&a)===a&&(Ct===4||Ct===3&&(Ke&62914560)===Ke&&300>jt()-Oi?(lt&2)===0&&pr(e,0):eu|=a,mr===Ke&&(mr=0)),ln(e)}function jh(e,t){t===0&&(t=ul()),e=gl(e,t),e!==null&&(Ca(e,t),ln(e))}function yb(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),jh(e,a)}function bb(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),jh(e,a)}function vb(e,t){return oa(e,t)}var Hi=null,xr=null,ou=!1,Bi=!1,cu=!1,Pn=0;function ln(e){e!==xr&&e.next===null&&(xr===null?Hi=xr=e:xr=xr.next=e),Bi=!0,ou||(ou=!0,_b())}function us(e,t){if(!cu&&Bi){cu=!0;do for(var a=!1,r=Hi;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var x=r.suspendedLanes,S=r.pingedLanes;d=(1<<31-vt(42|e)+1)-1,d&=c&~(x&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Ch(r,d))}else d=Ke,d=dn(r,r===ft?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||Ya(r,d)||(a=!0,Ch(r,d));r=r.next}while(a);cu=!1}}function Sb(){Nh()}function Nh(){Bi=ou=!1;var e=0;Pn!==0&&Db()&&(e=Pn);for(var t=jt(),a=null,r=Hi;r!==null;){var c=r.next,d=wh(r,t);d===0?(r.next=null,a===null?Hi=c:a.next=c,c===null&&(xr=a)):(a=r,(e!==0||(d&3)!==0)&&(Bi=!0)),r=c}Yt!==0&&Yt!==5||us(e),Pn!==0&&(Pn=0)}function wh(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var x=31-vt(d),S=1<<x,E=c[x];E===-1?((S&a)===0||(S&r)!==0)&&(c[x]=cl(S,t)):E<=t&&(e.expiredLanes|=S),d&=~S}if(t=ft,a=Ke,a=dn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ca(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ya(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&ca(r),B(a)){case 2:case 8:a=Be;break;case 32:a=Ye;break;case 268435456:a=At;break;default:a=Ye}return r=Eh.bind(null,e),a=oa(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&ca(r),e.callbackPriority=2,e.callbackNode=null,2}function Eh(e,t){if(Yt!==0&&Yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ui()&&e.callbackNode!==a)return null;var r=Ke;return r=dn(e,e===ft?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(ih(e,r,t),wh(e,jt()),e.callbackNode!=null&&e.callbackNode===a?Eh.bind(null,e):null)}function Ch(e,t){if(Ui())return null;ih(e,t,!0)}function _b(){Ab(function(){(lt&6)!==0?oa(Se,Sb):Nh()})}function uu(){if(Pn===0){var e=ar;e===0&&(e=ge,ge<<=1,(ge&261888)===0&&(ge=256)),Pn=e}return Pn}function Rh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qs(""+e)}function Th(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function jb(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var d=Rh((c[fe]||null).action),x=r.submitter;x&&(t=(t=x[fe]||null)?Rh(t.formAction):x.getAttribute("formAction"),t!==null&&(d=t,x=null));var S=new Ps("action","action",null,r,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Pn!==0){var E=x?Th(c,x):new FormData(c);zc(a,{pending:!0,data:E,method:c.method,action:d},null,E)}}else typeof d=="function"&&(S.preventDefault(),E=x?Th(c,x):new FormData(c),zc(a,{pending:!0,data:E,method:c.method,action:d},d,E))},currentTarget:c}]})}}for(var du=0;du<Qo.length;du++){var fu=Qo[du],Nb=fu.toLowerCase(),wb=fu[0].toUpperCase()+fu.slice(1);Ka(Nb,"on"+wb)}Ka(rf,"onAnimationEnd"),Ka(sf,"onAnimationIteration"),Ka(of,"onAnimationStart"),Ka("dblclick","onDoubleClick"),Ka("focusin","onFocus"),Ka("focusout","onBlur"),Ka(qy,"onTransitionRun"),Ka(Yy,"onTransitionStart"),Ka(Gy,"onTransitionCancel"),Ka(cf,"onTransitionEnd"),Wa("onMouseEnter",["mouseout","mouseover"]),Wa("onMouseLeave",["mouseout","mouseover"]),Wa("onPointerEnter",["pointerout","pointerover"]),Wa("onPointerLeave",["pointerout","pointerover"]),Vt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ds="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Eb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ds));function zh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],c=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var x=r.length-1;0<=x;x--){var S=r[x],E=S.instance,L=S.currentTarget;if(S=S.listener,E!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(V){ei(V)}c.currentTarget=null,d=E}else for(x=0;x<r.length;x++){if(S=r[x],E=S.instance,L=S.currentTarget,S=S.listener,E!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(V){ei(V)}c.currentTarget=null,d=E}}}}function Ve(e,t){var a=t[we];a===void 0&&(a=t[we]=new Set);var r=e+"__bubble";a.has(r)||(Oh(t,e,2,!1),a.add(r))}function mu(e,t,a){var r=0;t&&(r|=4),Oh(a,e,r,t)}var $i="_reactListening"+Math.random().toString(36).slice(2);function hu(e){if(!e[$i]){e[$i]=!0,An.forEach(function(a){a!=="selectionchange"&&(Eb.has(a)||mu(a,!1,e),mu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$i]||(t[$i]=!0,mu("selectionchange",!1,t))}}function Oh(e,t,a,r){switch(sp(t)){case 2:var c=e0;break;case 8:c=t0;break;default:c=Tu}a=c.bind(null,t,a,e),c=void 0,!Ao||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function pu(e,t,a,r,c){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var x=r.tag;if(x===3||x===4){var S=r.stateNode.containerInfo;if(S===c)break;if(x===4)for(x=r.return;x!==null;){var E=x.tag;if((E===3||E===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;S!==null;){if(x=gt(S),x===null)return;if(E=x.tag,E===5||E===6||E===26||E===27){r=d=x;continue e}S=S.parentNode}}r=r.return}kd(function(){var L=d,V=Do(a),W=[];e:{var U=uf.get(e);if(U!==void 0){var q=Ps,ye=e;switch(e){case"keypress":if(Fs(a)===0)break e;case"keydown":case"keyup":q=by;break;case"focusin":ye="focus",q=Ho;break;case"focusout":ye="blur",q=Ho;break;case"beforeblur":case"afterblur":q=Ho;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Hd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=iy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=_y;break;case rf:case sf:case of:q=uy;break;case cf:q=Ny;break;case"scroll":case"scrollend":q=ry;break;case"wheel":q=Ey;break;case"copy":case"cut":case"paste":q=fy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=$d;break;case"toggle":case"beforetoggle":q=Ry}var Re=(t&4)!==0,ct=!Re&&(e==="scroll"||e==="scrollend"),D=Re?U!==null?U+"Capture":null:U;Re=[];for(var z=L,k;z!==null;){var Q=z;if(k=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||k===null||D===null||(Q=Mr(z,D),Q!=null&&Re.push(fs(z,Q,k))),ct)break;z=z.return}0<Re.length&&(U=new q(U,ye,null,a,V),W.push({event:U,listeners:Re}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",U&&a!==Oo&&(ye=a.relatedTarget||a.fromElement)&&(gt(ye)||ye[he]))break e;if((q||U)&&(U=V.window===V?V:(U=V.ownerDocument)?U.defaultView||U.parentWindow:window,q?(ye=a.relatedTarget||a.toElement,q=L,ye=ye?gt(ye):null,ye!==null&&(ct=u(ye),Re=ye.tag,ye!==ct||Re!==5&&Re!==27&&Re!==6)&&(ye=null)):(q=null,ye=L),q!==ye)){if(Re=Hd,Q="onMouseLeave",D="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Re=$d,Q="onPointerLeave",D="onPointerEnter",z="pointer"),ct=q==null?U:Pe(q),k=ye==null?U:Pe(ye),U=new Re(Q,z+"leave",q,a,V),U.target=ct,U.relatedTarget=k,Q=null,gt(V)===L&&(Re=new Re(D,z+"enter",ye,a,V),Re.target=k,Re.relatedTarget=ct,Q=Re),ct=Q,q&&ye)t:{for(Re=Cb,D=q,z=ye,k=0,Q=D;Q;Q=Re(Q))k++;Q=0;for(var Ee=z;Ee;Ee=Re(Ee))Q++;for(;0<k-Q;)D=Re(D),k--;for(;0<Q-k;)z=Re(z),Q--;for(;k--;){if(D===z||z!==null&&D===z.alternate){Re=D;break t}D=Re(D),z=Re(z)}Re=null}else Re=null;q!==null&&Dh(W,U,q,Re,!1),ye!==null&&ct!==null&&Dh(W,ct,ye,Re,!0)}}e:{if(U=L?Pe(L):window,q=U.nodeName&&U.nodeName.toLowerCase(),q==="select"||q==="input"&&U.type==="file")var et=Zd;else if(Xd(U))if(Fd)et=Hy;else{et=Ly;var ve=ky}else q=U.nodeName,!q||q.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&zo(L.elementType)&&(et=Zd):et=Uy;if(et&&(et=et(e,L))){Qd(W,et,a,V);break e}ve&&ve(e,U,L),e==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&To(U,"number",U.value)}switch(ve=L?Pe(L):window,e){case"focusin":(Xd(ve)||ve.contentEditable==="true")&&(Zl=ve,Vo=L,qr=null);break;case"focusout":qr=Vo=Zl=null;break;case"mousedown":Ko=!0;break;case"contextmenu":case"mouseup":case"dragend":Ko=!1,nf(W,a,V);break;case"selectionchange":if($y)break;case"keydown":case"keyup":nf(W,a,V)}var Ue;if($o)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Ql?Vd(e,a)&&(Xe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Xe="onCompositionStart");Xe&&(qd&&a.locale!=="ko"&&(Ql||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Ql&&(Ue=Ld()):(kn=V,ko="value"in kn?kn.value:kn.textContent,Ql=!0)),ve=qi(L,Xe),0<ve.length&&(Xe=new Bd(Xe,e,null,a,V),W.push({event:Xe,listeners:ve}),Ue?Xe.data=Ue:(Ue=Kd(a),Ue!==null&&(Xe.data=Ue)))),(Ue=zy?Oy(e,a):Dy(e,a))&&(Xe=qi(L,"onBeforeInput"),0<Xe.length&&(ve=new Bd("onBeforeInput","beforeinput",null,a,V),W.push({event:ve,listeners:Xe}),ve.data=Ue)),jb(W,e,L,a,V)}zh(W,t)})}function fs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function qi(e,t){for(var a=t+"Capture",r=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Mr(e,a),c!=null&&r.unshift(fs(e,c,d)),c=Mr(e,t),c!=null&&r.push(fs(e,c,d))),e.tag===3)return r;e=e.return}return[]}function Cb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dh(e,t,a,r,c){for(var d=t._reactName,x=[];a!==null&&a!==r;){var S=a,E=S.alternate,L=S.stateNode;if(S=S.tag,E!==null&&E===r)break;S!==5&&S!==26&&S!==27||L===null||(E=L,c?(L=Mr(a,d),L!=null&&x.unshift(fs(a,L,E))):c||(L=Mr(a,d),L!=null&&x.push(fs(a,L,E)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var Rb=/\r\n?/g,Tb=/\u0000|\uFFFD/g;function Mh(e){return(typeof e=="string"?e:""+e).replace(Rb,`
9
+ `).replace(Tb,"")}function Ah(e,t){return t=Mh(t),Mh(e)===t}function ot(e,t,a,r,c,d){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Vl(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Vl(e,""+r);break;case"className":Tt(e,"class",r);break;case"tabIndex":Tt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Tt(e,a,r);break;case"style":Md(e,r,d);break;case"data":if(t!=="object"){Tt(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Qs(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&ot(e,t,"name",c.name,c,null),ot(e,t,"formEncType",c.formEncType,c,null),ot(e,t,"formMethod",c.formMethod,c,null),ot(e,t,"formTarget",c.formTarget,c,null)):(ot(e,t,"encType",c.encType,c,null),ot(e,t,"method",c.method,c,null),ot(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Qs(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=fn);break;case"onScroll":r!=null&&Ve("scroll",e);break;case"onScrollEnd":r!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Qs(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),qe(e,"popover",r);break;case"xlinkActuate":ta(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ta(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ta(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ta(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ta(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ta(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ta(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ta(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ta(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":qe(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ny.get(a)||a,qe(e,a,r))}}function gu(e,t,a,r,c,d){switch(a){case"style":Md(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof r=="string"?Vl(e,r):(typeof r=="number"||typeof r=="bigint")&&Vl(e,""+r);break;case"onScroll":r!=null&&Ve("scroll",e);break;case"onScrollEnd":r!=null&&Ve("scrollend",e);break;case"onClick":r!=null&&(e.onclick=fn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Va.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[fe]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof r=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,c);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):qe(e,a,r)}}}function Jt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var r=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var x=a[d];if(x!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ot(e,t,d,x,a,null)}}c&&ot(e,t,"srcSet",a.srcSet,a,null),r&&ot(e,t,"src",a.src,a,null);return;case"input":Ve("invalid",e);var S=d=x=c=null,E=null,L=null;for(r in a)if(a.hasOwnProperty(r)){var V=a[r];if(V!=null)switch(r){case"name":c=V;break;case"type":x=V;break;case"checked":E=V;break;case"defaultChecked":L=V;break;case"value":d=V;break;case"defaultValue":S=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(137,t));break;default:ot(e,t,r,V,a,null)}}Td(e,d,S,E,L,x,c,!1);return;case"select":Ve("invalid",e),r=x=d=null;for(c in a)if(a.hasOwnProperty(c)&&(S=a[c],S!=null))switch(c){case"value":d=S;break;case"defaultValue":x=S;break;case"multiple":r=S;default:ot(e,t,c,S,a,null)}t=d,a=x,e.multiple=!!r,t!=null?Gl(e,!!r,t,!1):a!=null&&Gl(e,!!r,a,!0);return;case"textarea":Ve("invalid",e),d=c=r=null;for(x in a)if(a.hasOwnProperty(x)&&(S=a[x],S!=null))switch(x){case"value":r=S;break;case"defaultValue":c=S;break;case"children":d=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:ot(e,t,x,S,a,null)}Od(e,r,c,d);return;case"option":for(E in a)a.hasOwnProperty(E)&&(r=a[E],r!=null)&&(E==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":ot(e,t,E,r,a,null));return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(r=0;r<ds.length;r++)Ve(ds[r],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in a)if(a.hasOwnProperty(L)&&(r=a[L],r!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ot(e,t,L,r,a,null)}return;default:if(zo(t)){for(V in a)a.hasOwnProperty(V)&&(r=a[V],r!==void 0&&gu(e,t,V,r,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(r=a[S],r!=null&&ot(e,t,S,r,a,null))}function zb(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,x=null,S=null,E=null,L=null,V=null;for(q in a){var W=a[q];if(a.hasOwnProperty(q)&&W!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":E=W;default:r.hasOwnProperty(q)||ot(e,t,q,null,r,W)}}for(var U in r){var q=r[U];if(W=a[U],r.hasOwnProperty(U)&&(q!=null||W!=null))switch(U){case"type":d=q;break;case"name":c=q;break;case"checked":L=q;break;case"defaultChecked":V=q;break;case"value":x=q;break;case"defaultValue":S=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,t));break;default:q!==W&&ot(e,t,U,q,r,W)}}Ro(e,x,S,E,L,V,d,c);return;case"select":q=x=S=U=null;for(d in a)if(E=a[d],a.hasOwnProperty(d)&&E!=null)switch(d){case"value":break;case"multiple":q=E;default:r.hasOwnProperty(d)||ot(e,t,d,null,r,E)}for(c in r)if(d=r[c],E=a[c],r.hasOwnProperty(c)&&(d!=null||E!=null))switch(c){case"value":U=d;break;case"defaultValue":S=d;break;case"multiple":x=d;default:d!==E&&ot(e,t,c,d,r,E)}t=S,a=x,r=q,U!=null?Gl(e,!!a,U,!1):!!r!=!!a&&(t!=null?Gl(e,!!a,t,!0):Gl(e,!!a,a?[]:"",!1));return;case"textarea":q=U=null;for(S in a)if(c=a[S],a.hasOwnProperty(S)&&c!=null&&!r.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ot(e,t,S,null,r,c)}for(x in r)if(c=r[x],d=a[x],r.hasOwnProperty(x)&&(c!=null||d!=null))switch(x){case"value":U=c;break;case"defaultValue":q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&ot(e,t,x,c,r,d)}zd(e,U,q);return;case"option":for(var ye in a)U=a[ye],a.hasOwnProperty(ye)&&U!=null&&!r.hasOwnProperty(ye)&&(ye==="selected"?e.selected=!1:ot(e,t,ye,null,r,U));for(E in r)U=r[E],q=a[E],r.hasOwnProperty(E)&&U!==q&&(U!=null||q!=null)&&(E==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":ot(e,t,E,U,r,q));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in a)U=a[Re],a.hasOwnProperty(Re)&&U!=null&&!r.hasOwnProperty(Re)&&ot(e,t,Re,null,r,U);for(L in r)if(U=r[L],q=a[L],r.hasOwnProperty(L)&&U!==q&&(U!=null||q!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,t));break;default:ot(e,t,L,U,r,q)}return;default:if(zo(t)){for(var ct in a)U=a[ct],a.hasOwnProperty(ct)&&U!==void 0&&!r.hasOwnProperty(ct)&&gu(e,t,ct,void 0,r,U);for(V in r)U=r[V],q=a[V],!r.hasOwnProperty(V)||U===q||U===void 0&&q===void 0||gu(e,t,V,U,r,q);return}}for(var D in a)U=a[D],a.hasOwnProperty(D)&&U!=null&&!r.hasOwnProperty(D)&&ot(e,t,D,null,r,U);for(W in r)U=r[W],q=a[W],!r.hasOwnProperty(W)||U===q||U==null&&q==null||ot(e,t,W,U,r,q)}function kh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ob(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var c=a[r],d=c.transferSize,x=c.initiatorType,S=c.duration;if(d&&S&&kh(x)){for(x=0,S=c.responseEnd,r+=1;r<a.length;r++){var E=a[r],L=E.startTime;if(L>S)break;var V=E.transferSize,W=E.initiatorType;V&&kh(W)&&(E=E.responseEnd,x+=V*(E<S?1:(S-L)/(E-L)))}if(--r,t+=8*(d+x)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xu=null,yu=null;function Yi(e){return e.nodeType===9?e:e.ownerDocument}function Lh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Uh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function bu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vu=null;function Db(){var e=window.event;return e&&e.type==="popstate"?e===vu?!1:(vu=e,!0):(vu=null,!1)}var Hh=typeof setTimeout=="function"?setTimeout:void 0,Mb=typeof clearTimeout=="function"?clearTimeout:void 0,Bh=typeof Promise=="function"?Promise:void 0,Ab=typeof queueMicrotask=="function"?queueMicrotask:typeof Bh<"u"?function(e){return Bh.resolve(null).then(e).catch(kb)}:Hh;function kb(e){setTimeout(function(){throw e})}function In(e){return e==="head"}function $h(e,t){var a=t,r=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(c),Sr(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")ms(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ms(a);for(var d=a.firstChild;d;){var x=d.nextSibling,S=d.nodeName;d[$e]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=x}}else a==="body"&&ms(e.ownerDocument.body);a=c}while(a);Sr(t)}function qh(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function Su(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Su(a),dt(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Lb(e,t,a,r){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[$e])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=ka(e.nextSibling),e===null)break}return null}function Ub(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ka(e.nextSibling),e===null))return null;return e}function Yh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ka(e.nextSibling),e===null))return null;return e}function _u(e){return e.data==="$?"||e.data==="$~"}function ju(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Hb(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ka(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Nu=null;function Gh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ka(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Vh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Kh(e,t,a){switch(t=Yi(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function ms(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dt(e)}var La=new Map,Xh=new Set;function Gi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Rn=I.d;I.d={f:Bb,r:$b,D:qb,C:Yb,L:Gb,m:Vb,X:Xb,S:Kb,M:Qb};function Bb(){var e=Rn.f(),t=Ai();return e||t}function $b(e){var t=wt(e);t!==null&&t.tag===5&&t.type==="form"?cm(t):Rn.r(e)}var yr=typeof document>"u"?null:document;function Qh(e,t,a){var r=yr;if(r&&typeof t=="string"&&t){var c=Ra(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Xh.has(c)||(Xh.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Jt(t,"link",e),pt(t),r.head.appendChild(t)))}}function qb(e){Rn.D(e),Qh("dns-prefetch",e,null)}function Yb(e,t){Rn.C(e,t),Qh("preconnect",e,t)}function Gb(e,t,a){Rn.L(e,t,a);var r=yr;if(r&&e&&t){var c='link[rel="preload"][as="'+Ra(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+Ra(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+Ra(a.imageSizes)+'"]')):c+='[href="'+Ra(e)+'"]';var d=c;switch(t){case"style":d=br(e);break;case"script":d=vr(e)}La.has(d)||(e=b({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),La.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(hs(d))||t==="script"&&r.querySelector(ps(d))||(t=r.createElement("link"),Jt(t,"link",e),pt(t),r.head.appendChild(t)))}}function Vb(e,t){Rn.m(e,t);var a=yr;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Ra(r)+'"][href="'+Ra(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=vr(e)}if(!La.has(d)&&(e=b({rel:"modulepreload",href:e},t),La.set(d,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ps(d)))return}r=a.createElement("link"),Jt(r,"link",e),pt(r),a.head.appendChild(r)}}}function Kb(e,t,a){Rn.S(e,t,a);var r=yr;if(r&&e){var c=qt(r).hoistableStyles,d=br(e);t=t||"default";var x=c.get(d);if(!x){var S={loading:0,preload:null};if(x=r.querySelector(hs(d)))S.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},a),(a=La.get(d))&&wu(e,a);var E=x=r.createElement("link");pt(E),Jt(E,"link",e),E._p=new Promise(function(L,V){E.onload=L,E.onerror=V}),E.addEventListener("load",function(){S.loading|=1}),E.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Vi(x,t,r)}x={type:"stylesheet",instance:x,count:1,state:S},c.set(d,x)}}}function Xb(e,t){Rn.X(e,t);var a=yr;if(a&&e){var r=qt(a).hoistableScripts,c=vr(e),d=r.get(c);d||(d=a.querySelector(ps(c)),d||(e=b({src:e,async:!0},t),(t=La.get(c))&&Eu(e,t),d=a.createElement("script"),pt(d),Jt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Qb(e,t){Rn.M(e,t);var a=yr;if(a&&e){var r=qt(a).hoistableScripts,c=vr(e),d=r.get(c);d||(d=a.querySelector(ps(c)),d||(e=b({src:e,async:!0,type:"module"},t),(t=La.get(c))&&Eu(e,t),d=a.createElement("script"),pt(d),Jt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Zh(e,t,a,r){var c=(c=_e.current)?Gi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=br(a.href),a=qt(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=br(a.href);var d=qt(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(hs(e)))&&!d._p&&(x.instance=d,x.state.loading=5),La.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},La.set(e,a),d||Zb(c,e,a,x.state))),t&&r===null)throw Error(i(528,""));return x}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=vr(a),a=qt(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 br(e){return'href="'+Ra(e)+'"'}function hs(e){return'link[rel="stylesheet"]['+e+"]"}function Fh(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Zb(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Jt(t,"link",a),pt(t),e.head.appendChild(t))}function vr(e){return'[src="'+Ra(e)+'"]'}function ps(e){return"script[async]"+e}function Jh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Ra(a.href)+'"]');if(r)return t.instance=r,pt(r),r;var c=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),pt(r),Jt(r,"style",c),Vi(r,a.precedence,e),t.instance=r;case"stylesheet":c=br(a.href);var d=e.querySelector(hs(c));if(d)return t.state.loading|=4,t.instance=d,pt(d),d;r=Fh(a),(c=La.get(c))&&wu(r,c),d=(e.ownerDocument||e).createElement("link"),pt(d);var x=d;return x._p=new Promise(function(S,E){x.onload=S,x.onerror=E}),Jt(d,"link",r),t.state.loading|=4,Vi(d,a.precedence,e),t.instance=d;case"script":return d=vr(a.src),(c=e.querySelector(ps(d)))?(t.instance=c,pt(c),c):(r=a,(c=La.get(d))&&(r=b({},a),Eu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),pt(c),Jt(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Vi(r,a.precedence,e));return t.instance}function Vi(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,x=0;x<r.length;x++){var S=r[x];if(S.dataset.precedence===t)d=S;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function wu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Eu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ki=null;function Ph(e,t,a){if(Ki===null){var r=new Map,c=Ki=new Map;c.set(a,r)}else c=Ki,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[$e]||d[oe]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var x=d.getAttribute(t)||"";x=e+x;var S=r.get(x);S?S.push(d):r.set(x,[d])}}return r}function Ih(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Fb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Wh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jb(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=br(r.href),d=t.querySelector(hs(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,pt(d);return}d=t.ownerDocument||t,r=Fh(r),(c=La.get(c))&&wu(r,c),d=d.createElement("link"),pt(d);var x=d;x._p=new Promise(function(S,E){x.onload=S,x.onerror=E}),Jt(d,"link",r),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Xi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Cu=0;function Pb(e,t){return e.stylesheets&&e.count===0&&Zi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Zi(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Cu===0&&(Cu=62500*Ob());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zi(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Cu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Xi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qi=null;function Zi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qi=new Map,t.forEach(Ib,e),Qi=null,Xi.call(e))}function Ib(e,t){if(!(t.state.loading&4)){var a=Qi.get(e);if(a)var r=a.get(null);else{a=new Map,Qi.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var x=c[d];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),r=x)}r&&a.set(null,r)}c=t.instance,x=c.getAttribute("data-precedence"),d=a.get(x)||r,d===r&&a.set(null,c),a.set(x,c),this.count++,r=Xi.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var gs={$$typeof:Y,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function Wb(e,t,a,r,c,d,x,S,E){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ga(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ga(0),this.hiddenUpdates=Ga(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function ep(e,t,a,r,c,d,x,S,E,L,V,W){return e=new Wb(e,t,a,x,E,L,V,W,S),t=1,d===!0&&(t|=24),d=xa(3,null,null,t),e.current=d,d.stateNode=e,t=sc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:a,cache:t},uc(d),e}function tp(e){return e?(e=Pl,e):Pl}function ap(e,t,a,r,c,d){c=tp(c),r.context===null?r.context=c:r.pendingContext=c,r=qn(t),r.payload={element:a},d=d===void 0?null:d,d!==null&&(r.callback=d),a=Yn(e,r,t),a!==null&&(pa(a,e,t),Zr(a,e,t))}function np(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ru(e,t){np(e,t),(e=e.alternate)&&np(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=gl(e,67108864);t!==null&&pa(t,e,67108864),Ru(e,67108864)}}function rp(e){if(e.tag===13||e.tag===31){var t=_a();t=O(t);var a=gl(e,t);a!==null&&pa(a,e,t),Ru(e,t)}}var Fi=!0;function e0(e,t,a,r){var c=M.T;M.T=null;var d=I.p;try{I.p=2,Tu(e,t,a,r)}finally{I.p=d,M.T=c}}function t0(e,t,a,r){var c=M.T;M.T=null;var d=I.p;try{I.p=8,Tu(e,t,a,r)}finally{I.p=d,M.T=c}}function Tu(e,t,a,r){if(Fi){var c=zu(r);if(c===null)pu(e,t,r,Ji,a),ip(e,r);else if(n0(c,e,t,a,r))r.stopPropagation();else if(ip(e,r),t&4&&-1<a0.indexOf(e)){for(;c!==null;){var d=wt(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var x=Je(d.pendingLanes);if(x!==0){var S=d;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var E=1<<31-vt(x);S.entanglements[1]|=E,x&=~E}ln(d),(lt&6)===0&&(Di=jt()+500,us(0))}}break;case 31:case 13:S=gl(d,2),S!==null&&pa(S,d,2),Ai(),Ru(d,2)}if(d=zu(r),d===null&&pu(e,t,r,Ji,a),d===c)break;c=d}c!==null&&r.stopPropagation()}else pu(e,t,r,null,a)}}function zu(e){return e=Do(e),Ou(e)}var Ji=null;function Ou(e){if(Ji=null,e=gt(e),e!==null){var t=u(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ji=e,null}function sp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Gt()){case Se:return 2;case Be:return 8;case Ye:case Mt:return 32;case At:return 268435456;default:return 32}default:return 32}}var Du=!1,Wn=null,el=null,tl=null,xs=new Map,ys=new Map,al=[],a0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ip(e,t){switch(e){case"focusin":case"focusout":Wn=null;break;case"dragenter":case"dragleave":el=null;break;case"mouseover":case"mouseout":tl=null;break;case"pointerover":case"pointerout":xs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ys.delete(t.pointerId)}}function bs(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=wt(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function n0(e,t,a,r,c){switch(t){case"focusin":return Wn=bs(Wn,e,t,a,r,c),!0;case"dragenter":return el=bs(el,e,t,a,r,c),!0;case"mouseover":return tl=bs(tl,e,t,a,r,c),!0;case"pointerover":var d=c.pointerId;return xs.set(d,bs(xs.get(d)||null,e,t,a,r,c)),!0;case"gotpointercapture":return d=c.pointerId,ys.set(d,bs(ys.get(d)||null,e,t,a,r,c)),!0}return!1}function op(e){var t=gt(e.target);if(t!==null){var a=u(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,se(e.priority,function(){rp(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,se(e.priority,function(){rp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=zu(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Oo=r,a.target.dispatchEvent(r),Oo=null}else return t=wt(a),t!==null&&lp(t),e.blockedOn=a,!1;t.shift()}return!0}function cp(e,t,a){Pi(e)&&a.delete(t)}function l0(){Du=!1,Wn!==null&&Pi(Wn)&&(Wn=null),el!==null&&Pi(el)&&(el=null),tl!==null&&Pi(tl)&&(tl=null),xs.forEach(cp),ys.forEach(cp)}function Ii(e,t){e.blockedOn===t&&(e.blockedOn=null,Du||(Du=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,l0)))}var Wi=null;function up(e){Wi!==e&&(Wi=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Wi===e&&(Wi=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Ou(r||a)===null)continue;break}var d=wt(a);d!==null&&(e.splice(t,3),t-=3,zc(d,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function Sr(e){function t(E){return Ii(E,e)}Wn!==null&&Ii(Wn,e),el!==null&&Ii(el,e),tl!==null&&Ii(tl,e),xs.forEach(t),ys.forEach(t);for(var a=0;a<al.length;a++){var r=al[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<al.length&&(a=al[0],a.blockedOn===null);)op(a),a.blockedOn===null&&al.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var c=a[r],d=a[r+1],x=c[fe]||null;if(typeof d=="function")x||up(a);else if(x){var S=null;if(d&&d.hasAttribute("formAction")){if(c=d,x=d[fe]||null)S=x.formAction;else if(Ou(c)!==null)continue}else S=x.action;typeof S=="function"?a[r+1]=S:(a.splice(r,3),r-=3),up(a)}}}function dp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(x){return c=x})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Mu(e){this._internalRoot=e}eo.prototype.render=Mu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=_a();ap(a,r,e,t,null,null)},eo.prototype.unmount=Mu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),Ai(),t[he]=null}};function eo(e){this._internalRoot=e}eo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ae();e={blockedOn:null,target:e,priority:t};for(var a=0;a<al.length&&t!==0&&t<al[a].priority;a++);al.splice(a,0,e),a===0&&op(e)}};var fp=l.version;if(fp!=="19.2.4")throw Error(i(527,fp,"19.2.4"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=h(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var r0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var to=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!to.isDisabled&&to.supportsFiber)try{Ae=to.inject(r0),nt=to}catch{}}return _s.createRoot=function(e,t){if(!o(e))throw Error(i(299));var a=!1,r="",c=bm,d=vm,x=Sm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=ep(e,1,!1,null,null,a,r,null,c,d,x,dp),e[he]=t.current,hu(e),new Mu(t)},_s.hydrateRoot=function(e,t,a){if(!o(e))throw Error(i(299));var r=!1,c="",d=bm,x=vm,S=Sm,E=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=ep(e,1,!0,t,a??null,r,c,E,d,x,S,dp),t.context=tp(null),a=t.current,r=_a(),r=O(r),c=qn(r),c.callback=null,Yn(a,c,r),a=r,t.current.lanes=a,Ca(t,a),ln(t),e[he]=t.current,hu(e),new eo(t)},_s.version="19.2.4",_s}var Gp;function jv(){if(Gp)return qu.exports;Gp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),qu.exports=_v(),qu.exports}var Nv=jv();var Jg=n=>{throw TypeError(n)},wv=(n,l,s)=>l.has(n)||Jg("Cannot "+s),Ku=(n,l,s)=>(wv(n,l,"read from private field"),s?s.call(n):l.get(n)),Ev=(n,l,s)=>l.has(n)?Jg("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,s),Vp="popstate";function Kp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function Cv(n={}){function l(i,o){let u=o.state?.masked,{pathname:m,search:p,hash:g}=u||i.location;return Ds("",{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:on(o)}return Tv(l,s,null,n)}function He(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Rt(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Rv(){return Math.random().toString(36).substring(2,10)}function Xp(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Ds(n,l,s=null,i,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Dn(l):l,state:s,key:l&&l.key||i||Rv(),unstable_mask:o}}function on({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 Dn(n){let l={};if(n){let s=n.indexOf("#");s>=0&&(l.hash=n.substring(s),n=n.substring(0,s));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function Tv(n,l,s,i={}){let{window:o=document.defaultView,v5Compat:u=!1}=i,m=o.history,p="POP",g=null,h=v();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function v(){return(m.state||{idx:null}).idx}function b(){p="POP";let A=v(),G=A==null?null:A-h;h=A,g&&g({action:p,location:T.location,delta:G})}function _(A,G){p="PUSH";let Z=Kp(A)?A:Ds(T.location,A,G);h=v()+1;let Y=Xp(Z,h),K=T.createHref(Z.unstable_mask||Z);try{m.pushState(Y,"",K)}catch(X){if(X instanceof DOMException&&X.name==="DataCloneError")throw X;o.location.assign(K)}u&&g&&g({action:p,location:T.location,delta:1})}function j(A,G){p="REPLACE";let Z=Kp(A)?A:Ds(T.location,A,G);h=v();let Y=Xp(Z,h),K=T.createHref(Z.unstable_mask||Z);m.replaceState(Y,"",K),u&&g&&g({action:p,location:T.location,delta:0})}function R(A){return Pg(A)}let T={get action(){return p},get location(){return n(o,m)},listen(A){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(Vp,b),g=A,()=>{o.removeEventListener(Vp,b),g=null}},createHref(A){return l(o,A)},createURL:R,encodeLocation(A){let G=R(A);return{pathname:G.pathname,search:G.search,hash:G.hash}},push:_,replace:j,go(A){return m.go(A)}};return T}function Pg(n,l=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),He(s,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:on(n);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=s+i),new URL(i,s)}var Es,Qp=class{constructor(n){if(Ev(this,Es,new Map),n)for(let[l,s]of n)this.set(l,s)}get(n){if(Ku(this,Es).has(n))return Ku(this,Es).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,l){Ku(this,Es).set(n,l)}};Es=new WeakMap;var zv=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ov(n){return zv.has(n)}var Dv=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Mv(n){return Dv.has(n)}function Av(n){return n.index===!0}function Ms(n,l,s=[],i={},o=!1){return n.map((u,m)=>{let p=[...s,String(m)],g=typeof u.id=="string"?u.id:p.join("-");if(He(u.index!==!0||!u.children,"Cannot specify children on an index route"),He(o||!i[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),Av(u)){let h={...u,id:g};return i[g]=Zp(h,l(h)),h}else{let h={...u,id:g,children:void 0};return i[g]=Zp(h,l(h)),u.children&&(h.children=Ms(u.children,l,p,i,o)),h}})}function Zp(n,l){return Object.assign(n,{...l,...typeof l.lazy=="object"&&l.lazy!=null?{lazy:{...n.lazy,...l.lazy}}:{}})}function ll(n,l,s="/"){return Cs(n,l,s,!1)}function Cs(n,l,s,i){let o=typeof l=="string"?Dn(l):l,u=Ba(o.pathname||"/",s);if(u==null)return null;let m=Ig(n);Lv(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Qv(u);p=Kv(m[g],h,i)}return p}function kv(n,l){let{route:s,pathname:i,params:o}=n;return{id:s.id,pathname:i,params:o,data:l[s.id],loaderData:l[s.id],handle:s.handle}}function Ig(n,l=[],s=[],i="",o=!1){let u=(m,p,g=o,h)=>{let v={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(i)&&g)return;He(v.relativePath.startsWith(i),`Absolute route path "${v.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(i.length)}let b=Za([i,v.relativePath]),_=s.concat(v);m.children&&m.children.length>0&&(He(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),Ig(m.children,l,_,b,g)),!(m.path==null&&!m.index)&&l.push({path:b,score:Gv(b,m.index),routesMeta:_})};return n.forEach((m,p)=>{if(m.path===""||!m.path?.includes("?"))u(m,p);else for(let g of Wg(m.path))u(m,p,!0,g)}),l}function Wg(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=Wg(i.join("/")),p=[];return p.push(...m.map(g=>g===""?u:[u,g].join("/"))),o&&p.push(...m),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function Lv(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:Vv(l.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var Uv=/^:[\w-]+$/,Hv=3,Bv=2,$v=1,qv=10,Yv=-2,Fp=n=>n==="*";function Gv(n,l){let s=n.split("/"),i=s.length;return s.some(Fp)&&(i+=Yv),l&&(i+=Bv),s.filter(o=>!Fp(o)).reduce((o,u)=>o+(Uv.test(u)?Hv:u===""?$v:qv),i)}function Vv(n,l){return n.length===l.length&&n.slice(0,-1).every((i,o)=>i===l[o])?n[n.length-1]-l[l.length-1]:0}function Kv(n,l,s=!1){let{routesMeta:i}=n,o={},u="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,v=u==="/"?l:l.slice(u.length)||"/",b=xo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},v),_=g.route;if(!b&&h&&s&&!i[i.length-1].route.index&&(b=xo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!b)return null;Object.assign(o,b.params),m.push({params:o,pathname:Za([u,b.pathname]),pathnameBase:Jv(Za([u,b.pathnameBase])),route:_}),b.pathnameBase!=="/"&&(u=Za([u,b.pathnameBase]))}return m}function xo(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=Xv(n.path,n.caseSensitive,n.end),o=l.match(s);if(!o)return null;let u=o[0],m=u.replace(/(.)\/+$/,"$1"),p=o.slice(1);return{params:i.reduce((h,{paramName:v,isOptional:b},_)=>{if(v==="*"){let R=p[_]||"";m=u.slice(0,u.length-R.length).replace(/(.)\/+$/,"$1")}const j=p[_];return b&&!j?h[v]=void 0:h[v]=(j||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:m,pattern:n}}function Xv(n,l=!1,s=!0){Rt(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],o="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g,h,v)=>{if(i.push({paramName:p,isOptional:g!=null}),g){let b=v.charAt(h+m.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,l?void 0:"i"),i]}function Qv(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Rt(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function Ba(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,i=n.charAt(s);return i&&i!=="/"?null:n.slice(s)||"/"}function Zv({basename:n,pathname:l}){return l==="/"?n:Za([n,l])}var ex=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yd=n=>ex.test(n);function Fv(n,l="/"){let{pathname:s,search:i="",hash:o=""}=typeof n=="string"?Dn(n):n,u;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?u=Jp(s.substring(1),"/"):u=Jp(s,l)):u=l,{pathname:u,search:Pv(i),hash:Iv(o)}}function Jp(n,l){let s=l.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function Xu(n,l,s,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function tx(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function vo(n){let l=tx(n);return l.map((s,i)=>i===l.length-1?s.pathname:s.pathnameBase)}function Ls(n,l,s,i=!1){let o;typeof n=="string"?o=Dn(n):(o={...n},He(!o.pathname||!o.pathname.includes("?"),Xu("?","pathname","search",o)),He(!o.pathname||!o.pathname.includes("#"),Xu("#","pathname","hash",o)),He(!o.search||!o.search.includes("#"),Xu("#","search","hash",o)));let u=n===""||o.pathname==="",m=u?"/":o.pathname,p;if(m==null)p=s;else{let b=l.length-1;if(!i&&m.startsWith("..")){let _=m.split("/");for(;_[0]==="..";)_.shift(),b-=1;o.pathname=_.join("/")}p=b>=0?l[b]:"/"}let g=Fv(o,p),h=m&&m!=="/"&&m.endsWith("/"),v=(u||m===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(h||v)&&(g.pathname+="/"),g}var Za=n=>n.join("/").replace(/\/\/+/g,"/"),Jv=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Pv=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Iv=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Us=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 As(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Hs(n){return n.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ax=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function nx(n,l){let s=n;if(typeof s!="string"||!ex.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(ax)try{let u=new URL(window.location.href),m=s.startsWith("//")?new URL(u.protocol+s):new URL(s),p=Ba(m.pathname,l);m.origin===u.origin&&p!=null?s=p+m.search+m.hash:o=!0}catch{Rt(!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 sl=Symbol("Uninstrumented");function Wv(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=Cr(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=Cr(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[sl]??u,p=Cr(s[o],m,(...g)=>Pp(g[0]));p&&(o==="loader"&&m.hydrate===!0&&(p.hydrate=!0),p[sl]=m,i[o]=p)}}),l.middleware&&l.middleware.length>0&&s.middleware.length>0&&(i.middleware=l.middleware.map(o=>{let u=o[sl]??o,m=Cr(s.middleware,u,(...p)=>Pp(p[0]));return m?(m[sl]=u,m):o})),i}function e1(n,l){let s={navigate:[],fetch:[]};if(l.forEach(i=>i({instrument(o){let u=Object.keys(o);for(let m of u)o[m]&&s[m].push(o[m])}})),s.navigate.length>0){let i=n.navigate[sl]??n.navigate,o=Cr(s.navigate,i,(...u)=>{let[m,p]=u;return{to:typeof m=="number"||typeof m=="string"?m:m?on(m):".",...Ip(n,p??{})}});o&&(o[sl]=i,n.navigate=o)}if(s.fetch.length>0){let i=n.fetch[sl]??n.fetch,o=Cr(s.fetch,i,(...u)=>{let[m,,p,g]=u;return{href:p??".",fetcherKey:m,...Ip(n,g??{})}});o&&(o[sl]=i,n.fetch=o)}return n}function Cr(n,l,s){return n.length===0?null:async(...i)=>{let o=await lx(n,s(...i),()=>l(...i),n.length-1);if(o.type==="error")throw o.value;return o.value}}async function lx(n,l,s,i){let o=n[i],u;if(o){let m,p=async()=>(m?console.error("You cannot call instrumented handlers more than once"):m=lx(n,l,s,i-1),u=await m,He(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(p,l)}catch(g){console.error("An instrumentation function threw an error:",g)}m||await p(),await m}else try{u={type:"success",value:await s()}}catch(m){u={type:"error",value:m}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Pp(n){let{request:l,context:s,params:i,unstable_pattern:o}=n;return{request:t1(l),params:{...i},unstable_pattern:o,context:a1(s)}}function Ip(n,l){return{currentUrl:on(n.state.location),..."formMethod"in l?{formMethod:l.formMethod}:{},..."formEncType"in l?{formEncType:l.formEncType}:{},..."formData"in l?{formData:l.formData}:{},..."body"in l?{body:l.body}:{}}}function t1(n){return{method:n.method,url:n.url,headers:{get:(...l)=>n.headers.get(...l)}}}function a1(n){if(l1(n)){let l={...n};return Object.freeze(l),l}else return{get:l=>n.get(l)}}var n1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function l1(n){if(n===null||typeof n!="object")return!1;const l=Object.getPrototypeOf(n);return l===Object.prototype||l===null||Object.getOwnPropertyNames(l).sort().join("\0")===n1}var rx=["POST","PUT","PATCH","DELETE"],r1=new Set(rx),s1=["GET",...rx],i1=new Set(s1),sx=new Set([301,302,303,307,308]),o1=new Set([307,308]),Qu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},c1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},js={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},u1=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),ix="remix-router-transitions",ox=Symbol("ResetLoaderData");function d1(n){const l=n.window?n.window:typeof window<"u"?window:void 0,s=typeof l<"u"&&typeof l.document<"u"&&typeof l.document.createElement<"u";He(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=n.hydrationRouteProperties||[],o=n.mapRouteProperties||u1,u=o;if(n.unstable_instrumentations){let C=n.unstable_instrumentations;u=O=>({...o(O),...Wv(C.map(B=>B.route).filter(Boolean),O)})}let m={},p=Ms(n.routes,u,void 0,m),g,h=n.basename||"/";h.startsWith("/")||(h=`/${h}`);let v=n.dataStrategy||g1,b={...n.future},_=null,j=new Set,R=null,T=null,A=null,G=n.hydrationData!=null,Z=ll(p,n.history.location,h),Y=!1,K=null,X,ne;if(Z==null&&!n.patchRoutesOnNavigation){let C=Ua(404,{pathname:n.history.location.pathname}),{matches:O,route:B}=no(p);X=!0,ne=!X,Z=O,K={[B.id]:C}}else if(Z&&!n.hydrationData&&Ga(Z,p,n.history.location.pathname).active&&(Z=null),Z)if(Z.some(C=>C.route.lazy))X=!1,ne=!X;else if(!Z.some(C=>bd(C.route)))X=!0,ne=!X;else{let C=n.hydrationData?n.hydrationData.loaderData:null,O=n.hydrationData?n.hydrationData.errors:null,B=Z;if(O){let ae=Z.findIndex(se=>O[se.route.id]!==void 0);B=B.slice(0,ae+1)}ne=!1,X=B.every(ae=>{let se=cx(ae.route,C,O);return ne=ne||se.renderFallback,!se.shouldLoad})}else{X=!1,ne=!X,Z=[];let C=Ga(null,p,n.history.location.pathname);C.active&&C.matches&&(Y=!0,Z=C.matches)}let J,w={historyAction:n.history.action,location:n.history.location,matches:Z,initialized:X,renderFallback:ne,navigation:Qu,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||K,fetchers:new Map,blockers:new Map},H="POP",ee=null,de=!1,ce,re=!1,ue=new Map,me=null,M=!1,I=!1,ie=new Set,P=new Map,be=0,N=-1,$=new Map,F=new Set,le=new Map,pe=new Map,_e=new Set,ze=new Map,at,Le=null;function It(){if(_=n.history.listen(({action:C,location:O,delta:B})=>{if(at){at(),at=void 0;return}Rt(ze.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ae=Nt({currentLocation:w.location,nextLocation:O,historyAction:C});if(ae&&B!=null){let se=new Promise(xe=>{at=xe});n.history.go(B*-1),Fe(ae,{state:"blocked",location:O,proceed(){Fe(ae,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),se.then(()=>n.history.go(B))},reset(){let xe=new Map(w.blockers);xe.set(ae,js),Ie({blockers:xe})}}),ee?.resolve(),ee=null;return}return Wt(C,O)}),s){A1(l,ue);let C=()=>k1(l,ue);l.addEventListener("pagehide",C),me=()=>l.removeEventListener("pagehide",C)}return w.initialized||Wt("POP",w.location,{initialHydration:!0}),J}function ia(){_&&_(),me&&me(),j.clear(),ce&&ce.abort(),w.fetchers.forEach((C,O)=>Ae(O)),w.blockers.forEach((C,O)=>ge(O))}function mt(C){return j.add(C),()=>j.delete(C)}function Ie(C,O={}){C.matches&&(C.matches=C.matches.map(se=>{let xe=m[se.route.id],oe=se.route;return oe.element!==xe.element||oe.errorElement!==xe.errorElement||oe.hydrateFallbackElement!==xe.hydrateFallbackElement?{...se,route:xe}:se})),w={...w,...C};let B=[],ae=[];w.fetchers.forEach((se,xe)=>{se.state==="idle"&&(_e.has(xe)?B.push(xe):ae.push(xe))}),_e.forEach(se=>{!w.fetchers.has(se)&&!P.has(se)&&B.push(se)}),[...j].forEach(se=>se(w,{deletedFetchers:B,newErrors:C.errors??null,viewTransitionOpts:O.viewTransitionOpts,flushSync:O.flushSync===!0})),B.forEach(se=>Ae(se)),ae.forEach(se=>w.fetchers.delete(se))}function ht(C,O,{flushSync:B}={}){let ae=w.actionData!=null&&w.navigation.formMethod!=null&&na(w.navigation.formMethod)&&w.navigation.state==="loading"&&C.state?._isRedirect!==!0,se;O.actionData?Object.keys(O.actionData).length>0?se=O.actionData:se=null:ae?se=w.actionData:se=null;let xe=O.loaderData?og(w.loaderData,O.loaderData,O.matches||[],O.errors):w.loaderData,oe=w.blockers;oe.size>0&&(oe=new Map(oe),oe.forEach((Ce,Ne)=>oe.set(Ne,js)));let fe=M?!1:ul(C,O.matches||w.matches),he=de===!0||w.navigation.formMethod!=null&&na(w.navigation.formMethod)&&C.state?._isRedirect!==!0;g&&(p=g,g=void 0),M||H==="POP"||(H==="PUSH"?n.history.push(C,C.state):H==="REPLACE"&&n.history.replace(C,C.state));let we;if(H==="POP"){let Ce=ue.get(w.location.pathname);Ce&&Ce.has(C.pathname)?we={currentLocation:w.location,nextLocation:C}:ue.has(C.pathname)&&(we={currentLocation:C,nextLocation:w.location})}else if(re){let Ce=ue.get(w.location.pathname);Ce?Ce.add(C.pathname):(Ce=new Set([C.pathname]),ue.set(w.location.pathname,Ce)),we={currentLocation:w.location,nextLocation:C}}Ie({...O,actionData:se,loaderData:xe,historyAction:H,location:C,initialized:!0,renderFallback:!1,navigation:Qu,revalidation:"idle",restoreScrollPosition:fe,preventScrollReset:he,blockers:oe},{viewTransitionOpts:we,flushSync:B===!0}),H="POP",de=!1,re=!1,M=!1,I=!1,ee?.resolve(),ee=null,Le?.resolve(),Le=null}async function Dt(C,O){if(ee?.resolve(),ee=null,typeof C=="number"){ee||(ee=fg());let dt=ee.promise;return n.history.go(C),dt}let B=id(w.location,w.matches,h,C,O?.fromRouteId,O?.relative),{path:ae,submission:se,error:xe}=Wp(!1,B,O),oe;O?.unstable_mask&&(oe={pathname:"",search:"",hash:"",...typeof O.unstable_mask=="string"?Dn(O.unstable_mask):{...w.location.unstable_mask,...O.unstable_mask}});let fe=w.location,he=Ds(fe,ae,O&&O.state,void 0,oe);he={...he,...n.history.encodeLocation(he)};let we=O&&O.replace!=null?O.replace:void 0,Ce="PUSH";we===!0?Ce="REPLACE":we===!1||se!=null&&na(se.formMethod)&&se.formAction===w.location.pathname+w.location.search&&(Ce="REPLACE");let Ne=O&&"preventScrollReset"in O?O.preventScrollReset===!0:void 0,We=(O&&O.flushSync)===!0,$e=Nt({currentLocation:fe,nextLocation:he,historyAction:Ce});if($e){Fe($e,{state:"blocked",location:he,proceed(){Fe($e,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),Dt(C,O)},reset(){let dt=new Map(w.blockers);dt.set($e,js),Ie({blockers:dt})}});return}await Wt(Ce,he,{submission:se,pendingError:xe,preventScrollReset:Ne,replace:O&&O.replace,enableViewTransition:O&&O.viewTransition,flushSync:We,callSiteDefaultShouldRevalidate:O&&O.unstable_defaultShouldRevalidate})}function Xt(){Le||(Le=fg()),Ye(),Ie({revalidation:"loading"});let C=Le.promise;return w.navigation.state==="submitting"?C:w.navigation.state==="idle"?(Wt(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),C):(Wt(H||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:re===!0}),C)}async function Wt(C,O,B){ce&&ce.abort(),ce=null,H=C,M=(B&&B.startUninterruptedRevalidation)===!0,cl(w.location,w.matches),de=(B&&B.preventScrollReset)===!0,re=(B&&B.enableViewTransition)===!0;let ae=g||p,se=B&&B.overrideNavigation,xe=B?.initialHydration&&w.matches&&w.matches.length>0&&!Y?w.matches:ll(ae,O,h),oe=(B&&B.flushSync)===!0;if(xe&&w.initialized&&!I&&N1(w.location,O)&&!(B&&B.submission&&na(B.submission.formMethod))){ht(O,{matches:xe},{flushSync:oe});return}let fe=Ga(xe,ae,O.pathname);if(fe.active&&fe.matches&&(xe=fe.matches),!xe){let{error:gt,notFoundMatches:wt,route:Pe}=Je(O.pathname);ht(O,{matches:wt,loaderData:{},errors:{[Pe.id]:gt}},{flushSync:oe});return}ce=new AbortController;let he=wr(n.history,O,ce.signal,B&&B.submission),we=n.getContext?await n.getContext():new Qp,Ce;if(B&&B.pendingError)Ce=[rl(xe).route.id,{type:"error",error:B.pendingError}];else if(B&&B.submission&&na(B.submission.formMethod)){let gt=await $t(he,O,B.submission,xe,we,fe.active,B&&B.initialHydration===!0,{replace:B.replace,flushSync:oe});if(gt.shortCircuited)return;if(gt.pendingActionResult){let[wt,Pe]=gt.pendingActionResult;if(ja(Pe)&&As(Pe.error)&&Pe.error.status===404){ce=null,ht(O,{matches:gt.matches,loaderData:{},errors:{[wt]:Pe.error}});return}}xe=gt.matches||xe,Ce=gt.pendingActionResult,se=Zu(O,B.submission),oe=!1,fe.active=!1,he=wr(n.history,he.url,he.signal)}let{shortCircuited:Ne,matches:We,loaderData:$e,errors:dt}=await ea(he,O,xe,we,fe.active,se,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,oe,Ce,B&&B.callSiteDefaultShouldRevalidate);Ne||(ce=null,ht(O,{matches:We||xe,...cg(Ce),loaderData:$e,errors:dt}))}async function $t(C,O,B,ae,se,xe,oe,fe={}){Ye();let he=D1(O,B);if(Ie({navigation:he},{flushSync:fe.flushSync===!0}),xe){let Ne=await Ca(ae,O.pathname,C.signal);if(Ne.type==="aborted")return{shortCircuited:!0};if(Ne.type==="error"){if(Ne.partialMatches.length===0){let{matches:$e,route:dt}=no(p);return{matches:$e,pendingActionResult:[dt.id,{type:"error",error:Ne.error}]}}let We=rl(Ne.partialMatches).route.id;return{matches:Ne.partialMatches,pendingActionResult:[We,{type:"error",error:Ne.error}]}}else if(Ne.matches)ae=Ne.matches;else{let{notFoundMatches:We,error:$e,route:dt}=Je(O.pathname);return{matches:We,pendingActionResult:[dt.id,{type:"error",error:$e}]}}}let we,Ce=uo(ae,O);if(!Ce.route.action&&!Ce.route.lazy)we={type:"error",error:Ua(405,{method:C.method,pathname:O.pathname,routeId:Ce.route.id})};else{let Ne=Rr(u,m,C,ae,Ce,oe?[]:i,se),We=await Se(C,Ne,se,null);if(we=We[Ce.route.id],!we){for(let $e of ae)if(We[$e.route.id]){we=We[$e.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(zl(we)){let Ne;return fe&&fe.replace!=null?Ne=fe.replace:Ne=rg(we.response.headers.get("Location"),new URL(C.url),h,n.history)===w.location.pathname+w.location.search,await Gt(C,we,!0,{submission:B,replace:Ne}),{shortCircuited:!0}}if(ja(we)){let Ne=rl(ae,Ce.route.id);return(fe&&fe.replace)!==!0&&(H="PUSH"),{matches:ae,pendingActionResult:[Ne.route.id,we,Ce.route.id]}}return{matches:ae,pendingActionResult:[Ce.route.id,we]}}async function ea(C,O,B,ae,se,xe,oe,fe,he,we,Ce,Ne,We){let $e=xe||Zu(O,oe),dt=oe||fe||dg($e),gt=!M&&!we;if(se){if(gt){let Tt=oa(Ne);Ie({navigation:$e,...Tt!==void 0?{actionData:Tt}:{}},{flushSync:Ce})}let qe=await Ca(B,O.pathname,C.signal);if(qe.type==="aborted")return{shortCircuited:!0};if(qe.type==="error"){if(qe.partialMatches.length===0){let{matches:ta,route:kt}=no(p);return{matches:ta,loaderData:{},errors:{[kt.id]:qe.error}}}let Tt=rl(qe.partialMatches).route.id;return{matches:qe.partialMatches,loaderData:{},errors:{[Tt]:qe.error}}}else if(qe.matches)B=qe.matches;else{let{error:Tt,notFoundMatches:ta,route:kt}=Je(O.pathname);return{matches:ta,loaderData:{},errors:{[kt.id]:Tt}}}}let wt=g||p,{dsMatches:Pe,revalidatingFetchers:qt}=eg(C,ae,u,m,n.history,w,B,dt,O,we?[]:i,we===!0,I,ie,_e,le,F,wt,h,n.patchRoutesOnNavigation!=null,Ne,We);if(N=++be,!n.dataStrategy&&!Pe.some(qe=>qe.shouldLoad)&&!Pe.some(qe=>qe.route.middleware&&qe.route.middleware.length>0)&&qt.length===0){let qe=Pa();return ht(O,{matches:B,loaderData:{},errors:Ne&&ja(Ne[1])?{[Ne[0]]:Ne[1].error}:null,...cg(Ne),...qe?{fetchers:new Map(w.fetchers)}:{}},{flushSync:Ce}),{shortCircuited:!0}}if(gt){let qe={};if(!se){qe.navigation=$e;let Tt=oa(Ne);Tt!==void 0&&(qe.actionData=Tt)}qt.length>0&&(qe.fetchers=ca(qt)),Ie(qe,{flushSync:Ce})}qt.forEach(qe=>{ut(qe.key),qe.controller&&P.set(qe.key,qe.controller)});let pt=()=>qt.forEach(qe=>ut(qe.key));ce&&ce.signal.addEventListener("abort",pt);let{loaderResults:An,fetcherResults:Va}=await Be(Pe,qt,C,ae);if(C.signal.aborted)return{shortCircuited:!0};ce&&ce.signal.removeEventListener("abort",pt),qt.forEach(qe=>P.delete(qe.key));let Vt=lo(An);if(Vt)return await Gt(C,Vt.result,!0,{replace:he}),{shortCircuited:!0};if(Vt=lo(Va),Vt)return F.add(Vt.key),await Gt(C,Vt.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:Wa,errors:dl}=ig(w,B,An,Ne,qt,Va);we&&w.errors&&(dl={...w.errors,...dl});let en=Pa(),fl=Ia(N),$l=en||fl||qt.length>0;return{matches:B,loaderData:Wa,errors:dl,...$l?{fetchers:new Map(w.fetchers)}:{}}}function oa(C){if(C&&!ja(C[1]))return{[C[0]]:C[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function ca(C){return C.forEach(O=>{let B=w.fetchers.get(O.key),ae=Ns(void 0,B?B.data:void 0);w.fetchers.set(O.key,ae)}),new Map(w.fetchers)}async function cn(C,O,B,ae){ut(C);let se=(ae&&ae.flushSync)===!0,xe=g||p,oe=id(w.location,w.matches,h,B,O,ae?.relative),fe=ll(xe,oe,h),he=Ga(fe,xe,oe);if(he.active&&he.matches&&(fe=he.matches),!fe){At(C,O,Ua(404,{pathname:oe}),{flushSync:se});return}let{path:we,submission:Ce,error:Ne}=Wp(!0,oe,ae);if(Ne){At(C,O,Ne,{flushSync:se});return}let We=n.getContext?await n.getContext():new Qp,$e=(ae&&ae.preventScrollReset)===!0;if(Ce&&na(Ce.formMethod)){await un(C,O,we,fe,We,he.active,se,$e,Ce,ae&&ae.unstable_defaultShouldRevalidate);return}le.set(C,{routeId:O,path:we}),await jt(C,O,we,fe,We,he.active,se,$e,Ce)}async function un(C,O,B,ae,se,xe,oe,fe,he,we){Ye(),le.delete(C);let Ce=w.fetchers.get(C);Mt(C,M1(he,Ce),{flushSync:oe});let Ne=new AbortController,We=wr(n.history,B,Ne.signal,he);if(xe){let xt=await Ca(ae,new URL(We.url).pathname,We.signal,C);if(xt.type==="aborted")return;if(xt.type==="error"){At(C,O,xt.error,{flushSync:oe});return}else if(xt.matches)ae=xt.matches;else{At(C,O,Ua(404,{pathname:B}),{flushSync:oe});return}}let $e=uo(ae,B);if(!$e.route.action&&!$e.route.lazy){let xt=Ua(405,{method:he.formMethod,pathname:B,routeId:O});At(C,O,xt,{flushSync:oe});return}P.set(C,Ne);let dt=be,gt=Rr(u,m,We,ae,$e,i,se),wt=await Se(We,gt,se,C),Pe=wt[$e.route.id];if(!Pe){for(let xt of gt)if(wt[xt.route.id]){Pe=wt[xt.route.id];break}}if(We.signal.aborted){P.get(C)===Ne&&P.delete(C);return}if(_e.has(C)){if(zl(Pe)||ja(Pe)){Mt(C,Tn(void 0));return}}else{if(zl(Pe))if(P.delete(C),N>dt){Mt(C,Tn(void 0));return}else return F.add(C),Mt(C,Ns(he)),Gt(We,Pe,!1,{fetcherSubmission:he,preventScrollReset:fe});if(ja(Pe)){At(C,O,Pe.error);return}}let qt=w.navigation.location||w.location,pt=wr(n.history,qt,Ne.signal),An=g||p,Va=w.navigation.state!=="idle"?ll(An,w.navigation.location,h):w.matches;He(Va,"Didn't find any matches after fetcher action");let Vt=++be;$.set(C,Vt);let Wa=Ns(he,Pe.data);w.fetchers.set(C,Wa);let{dsMatches:dl,revalidatingFetchers:en}=eg(pt,se,u,m,n.history,w,Va,he,qt,i,!1,I,ie,_e,le,F,An,h,n.patchRoutesOnNavigation!=null,[$e.route.id,Pe],we);en.filter(xt=>xt.key!==C).forEach(xt=>{let ql=xt.key,Yl=w.fetchers.get(ql),Ks=Ns(void 0,Yl?Yl.data:void 0);w.fetchers.set(ql,Ks),ut(ql),xt.controller&&P.set(ql,xt.controller)}),Ie({fetchers:new Map(w.fetchers)});let fl=()=>en.forEach(xt=>ut(xt.key));Ne.signal.addEventListener("abort",fl);let{loaderResults:$l,fetcherResults:qe}=await Be(dl,en,pt,se);if(Ne.signal.aborted)return;if(Ne.signal.removeEventListener("abort",fl),$.delete(C),P.delete(C),en.forEach(xt=>P.delete(xt.key)),w.fetchers.has(C)){let xt=Tn(Pe.data);w.fetchers.set(C,xt)}let Tt=lo($l);if(Tt)return Gt(pt,Tt.result,!1,{preventScrollReset:fe});if(Tt=lo(qe),Tt)return F.add(Tt.key),Gt(pt,Tt.result,!1,{preventScrollReset:fe});let{loaderData:ta,errors:kt}=ig(w,Va,$l,void 0,en,qe);Ia(Vt),w.navigation.state==="loading"&&Vt>N?(He(H,"Expected pending action"),ce&&ce.abort(),ht(w.navigation.location,{matches:Va,loaderData:ta,errors:kt,fetchers:new Map(w.fetchers)})):(Ie({errors:kt,loaderData:og(w.loaderData,ta,Va,kt),fetchers:new Map(w.fetchers)}),I=!1)}async function jt(C,O,B,ae,se,xe,oe,fe,he){let we=w.fetchers.get(C);Mt(C,Ns(he,we?we.data:void 0),{flushSync:oe});let Ce=new AbortController,Ne=wr(n.history,B,Ce.signal);if(xe){let Pe=await Ca(ae,new URL(Ne.url).pathname,Ne.signal,C);if(Pe.type==="aborted")return;if(Pe.type==="error"){At(C,O,Pe.error,{flushSync:oe});return}else if(Pe.matches)ae=Pe.matches;else{At(C,O,Ua(404,{pathname:B}),{flushSync:oe});return}}let We=uo(ae,B);P.set(C,Ce);let $e=be,dt=Rr(u,m,Ne,ae,We,i,se),wt=(await Se(Ne,dt,se,C))[We.route.id];if(P.get(C)===Ce&&P.delete(C),!Ne.signal.aborted){if(_e.has(C)){Mt(C,Tn(void 0));return}if(zl(wt))if(N>$e){Mt(C,Tn(void 0));return}else{F.add(C),await Gt(Ne,wt,!1,{preventScrollReset:fe});return}if(ja(wt)){At(C,O,wt.error);return}Mt(C,Tn(wt.data))}}async function Gt(C,O,B,{submission:ae,fetcherSubmission:se,preventScrollReset:xe,replace:oe}={}){B||(ee?.resolve(),ee=null),O.response.headers.has("X-Remix-Revalidate")&&(I=!0);let fe=O.response.headers.get("Location");He(fe,"Expected a Location header on the redirect Response"),fe=rg(fe,new URL(C.url),h,n.history);let he=Ds(w.location,fe,{_isRedirect:!0});if(s){let dt=!1;if(O.response.headers.has("X-Remix-Reload-Document"))dt=!0;else if(yd(fe)){const gt=Pg(fe,!0);dt=gt.origin!==l.location.origin||Ba(gt.pathname,h)==null}if(dt){oe?l.location.replace(fe):l.location.assign(fe);return}}ce=null;let we=oe===!0||O.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ce,formAction:Ne,formEncType:We}=w.navigation;!ae&&!se&&Ce&&Ne&&We&&(ae=dg(w.navigation));let $e=ae||se;if(o1.has(O.response.status)&&$e&&na($e.formMethod))await Wt(we,he,{submission:{...$e,formAction:fe},preventScrollReset:xe||de,enableViewTransition:B?re:void 0});else{let dt=Zu(he,ae);await Wt(we,he,{overrideNavigation:dt,fetcherSubmission:se,preventScrollReset:xe||de,enableViewTransition:B?re:void 0})}}async function Se(C,O,B,ae){let se,xe={};try{se=await y1(v,C,O,ae,B,!1)}catch(oe){return O.filter(fe=>fe.shouldLoad).forEach(fe=>{xe[fe.route.id]={type:"error",error:oe}}),xe}if(C.signal.aborted)return xe;if(!na(C.method))for(let oe of O){if(se[oe.route.id]?.type==="error")break;!se.hasOwnProperty(oe.route.id)&&!w.loaderData.hasOwnProperty(oe.route.id)&&(!w.errors||!w.errors.hasOwnProperty(oe.route.id))&&oe.shouldCallHandler()&&(se[oe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${oe.route.id}`)})}for(let[oe,fe]of Object.entries(se))if(R1(fe)){let he=fe.result;xe[oe]={type:"redirect",response:_1(he,C,oe,O,h)}}else xe[oe]=await S1(fe);return xe}async function Be(C,O,B,ae){let se=Se(B,C,ae,null),xe=Promise.all(O.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let Ce=(await Se(he.request,he.matches,ae,he.key))[he.match.route.id];return{[he.key]:Ce}}else return Promise.resolve({[he.key]:{type:"error",error:Ua(404,{pathname:he.path})}})})),oe=await se,fe=(await xe).reduce((he,we)=>Object.assign(he,we),{});return{loaderResults:oe,fetcherResults:fe}}function Ye(){I=!0,le.forEach((C,O)=>{P.has(O)&&ie.add(O),ut(O)})}function Mt(C,O,B={}){w.fetchers.set(C,O),Ie({fetchers:new Map(w.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function At(C,O,B,ae={}){let se=rl(w.matches,O);Ae(C),Ie({errors:{[se.route.id]:B},fetchers:new Map(w.fetchers)},{flushSync:(ae&&ae.flushSync)===!0})}function je(C){return pe.set(C,(pe.get(C)||0)+1),_e.has(C)&&_e.delete(C),w.fetchers.get(C)||c1}function Ze(C,O){ut(C,O?.reason),Mt(C,Tn(null))}function Ae(C){let O=w.fetchers.get(C);P.has(C)&&!(O&&O.state==="loading"&&$.has(C))&&ut(C),le.delete(C),$.delete(C),F.delete(C),_e.delete(C),ie.delete(C),w.fetchers.delete(C)}function nt(C){let O=(pe.get(C)||0)-1;O<=0?(pe.delete(C),_e.add(C)):pe.set(C,O),Ie({fetchers:new Map(w.fetchers)})}function ut(C,O){let B=P.get(C);B&&(B.abort(O),P.delete(C))}function vt(C){for(let O of C){let B=je(O),ae=Tn(B.data);w.fetchers.set(O,ae)}}function Pa(){let C=[],O=!1;for(let B of F){let ae=w.fetchers.get(B);He(ae,`Expected fetcher: ${B}`),ae.state==="loading"&&(F.delete(B),C.push(B),O=!0)}return vt(C),O}function Ia(C){let O=[];for(let[B,ae]of $)if(ae<C){let se=w.fetchers.get(B);He(se,`Expected fetcher: ${B}`),se.state==="loading"&&(ut(B),$.delete(B),O.push(B))}return vt(O),O.length>0}function te(C,O){let B=w.blockers.get(C)||js;return ze.get(C)!==O&&ze.set(C,O),B}function ge(C){w.blockers.delete(C),ze.delete(C)}function Fe(C,O){let B=w.blockers.get(C)||js;He(B.state==="unblocked"&&O.state==="blocked"||B.state==="blocked"&&O.state==="blocked"||B.state==="blocked"&&O.state==="proceeding"||B.state==="blocked"&&O.state==="unblocked"||B.state==="proceeding"&&O.state==="unblocked",`Invalid blocker state transition: ${B.state} -> ${O.state}`);let ae=new Map(w.blockers);ae.set(C,O),Ie({blockers:ae})}function Nt({currentLocation:C,nextLocation:O,historyAction:B}){if(ze.size===0)return;ze.size>1&&Rt(!1,"A router only supports one blocker at a time");let ae=Array.from(ze.entries()),[se,xe]=ae[ae.length-1],oe=w.blockers.get(se);if(!(oe&&oe.state==="proceeding")&&xe({currentLocation:C,nextLocation:O,historyAction:B}))return se}function Je(C){let O=Ua(404,{pathname:C}),B=g||p,{matches:ae,route:se}=no(B);return{notFoundMatches:ae,route:se,error:O}}function dn(C,O,B){if(R=C,A=O,T=B||null,!G&&w.navigation===Qu){G=!0;let ae=ul(w.location,w.matches);ae!=null&&Ie({restoreScrollPosition:ae})}return()=>{R=null,A=null,T=null}}function Ya(C,O){return T&&T(C,O.map(ae=>kv(ae,w.loaderData)))||C.key}function cl(C,O){if(R&&A){let B=Ya(C,O);R[B]=A()}}function ul(C,O){if(R){let B=Ya(C,O),ae=R[B];if(typeof ae=="number")return ae}return null}function Ga(C,O,B){if(n.patchRoutesOnNavigation)if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:Cs(O,B,h,!0)}}else return{active:!0,matches:Cs(O,B,h,!0)||[]};return{active:!1,matches:null}}async function Ca(C,O,B,ae){if(!n.patchRoutesOnNavigation)return{type:"success",matches:C};let se=C;for(;;){let xe=g==null,oe=g||p,fe=m;try{await n.patchRoutesOnNavigation({signal:B,path:O,matches:se,fetcherKey:ae,patch:(Ce,Ne)=>{B.aborted||tg(Ce,Ne,oe,fe,u,!1)}})}catch(Ce){return{type:"error",error:Ce,partialMatches:se}}finally{xe&&!B.aborted&&(p=[...p])}if(B.aborted)return{type:"aborted"};let he=ll(oe,O,h),we=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(we=Cs(oe,O,h,!0),!(we&&se.length<we.length&&Ys(se,we.slice(0,se.length))))return{type:"success",matches:he}}if(we||(we=Cs(oe,O,h,!0)),!we||Ys(se,we))return{type:"success",matches:null};se=we}}function Ys(C,O){return C.length===O.length&&C.every((B,ae)=>B.route.id===O[ae].route.id)}function Gs(C){m={},g=Ms(C,u,void 0,m)}function Vs(C,O,B=!1){let ae=g==null;tg(C,O,g||p,m,u,B),ae&&(p=[...p],Ie({}))}return J={get basename(){return h},get future(){return b},get state(){return w},get routes(){return p},get window(){return l},initialize:It,subscribe:mt,enableScrollRestoration:dn,navigate:Dt,fetch:cn,revalidate:Xt,createHref:C=>n.history.createHref(C),encodeLocation:C=>n.history.encodeLocation(C),getFetcher:je,resetFetcher:Ze,deleteFetcher:nt,dispose:ia,getBlocker:te,deleteBlocker:ge,patchRoutes:Vs,_internalFetchControllers:P,_internalSetRoutes:Gs,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){Ie(C)}},n.unstable_instrumentations&&(J=e1(J,n.unstable_instrumentations.map(C=>C.router).filter(Boolean))),J}function f1(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function id(n,l,s,i,o,u){let m,p;if(o){m=[];for(let h of l)if(m.push(h),h.route.id===o){p=h;break}}else m=l,p=l[l.length-1];let g=Ls(i||".",vo(m),Ba(n.pathname,s)||n.pathname,u==="path");if(i==null&&(g.search=n.search,g.hash=n.hash),(i==null||i===""||i===".")&&p){let h=Sd(g.search);if(p.route.index&&!h)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&h){let v=new URLSearchParams(g.search),b=v.getAll("index");v.delete("index"),b.filter(j=>j).forEach(j=>v.append("index",j));let _=v.toString();g.search=_?`?${_}`:""}}return s!=="/"&&(g.pathname=Zv({basename:s,pathname:g.pathname})),on(g)}function Wp(n,l,s){if(!s||!f1(s))return{path:l};if(s.formMethod&&!O1(s.formMethod))return{path:l,error:Ua(405,{method:s.formMethod})};let i=()=>({path:l,error:Ua(400,{type:"invalid-body"})}),u=(s.formMethod||"get").toUpperCase(),m=px(l);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!na(u))return i();let b=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((_,[j,R])=>`${_}${j}=${R}
10
+ `,""):String(s.body);return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:void 0,text:b}}}else if(s.formEncType==="application/json"){if(!na(u))return i();try{let b=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:b,text:void 0}}}catch{return i()}}}He(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=cd(s.formData),g=s.formData;else if(s.body instanceof FormData)p=cd(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=sg(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=sg(p)}catch{return i()}let h={formMethod:u,formAction:m,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(na(h.formMethod))return{path:l,submission:h};let v=Dn(l);return n&&v.search&&Sd(v.search)&&p.append("index",""),v.search=`?${p}`,{path:on(v),submission:h}}function eg(n,l,s,i,o,u,m,p,g,h,v,b,_,j,R,T,A,G,Z,Y,K){let X=Y?ja(Y[1])?Y[1].error:Y[1].data:void 0,ne=o.createURL(u.location),J=o.createURL(g),w;if(v&&u.errors){let me=Object.keys(u.errors)[0];w=m.findIndex(M=>M.route.id===me)}else if(Y&&ja(Y[1])){let me=Y[0];w=m.findIndex(M=>M.route.id===me)-1}let H=Y?Y[1].statusCode:void 0,ee=H&&H>=400,de={currentUrl:ne,currentParams:u.matches[0]?.params||{},nextUrl:J,nextParams:m[0].params,...p,actionResult:X,actionStatus:H},ce=Hs(m),re=m.map((me,M)=>{let{route:I}=me,ie=null;if(w!=null&&M>w)ie=!1;else if(I.lazy)ie=!0;else if(!bd(I))ie=!1;else if(v){let{shouldLoad:$}=cx(I,u.loaderData,u.errors);ie=$}else m1(u.loaderData,u.matches[M],me)&&(ie=!0);if(ie!==null)return od(s,i,n,ce,me,h,l,ie);let P=!1;typeof K=="boolean"?P=K:ee?P=!1:(b||ne.pathname+ne.search===J.pathname+J.search||ne.search!==J.search||h1(u.matches[M],me))&&(P=!0);let be={...de,defaultShouldRevalidate:P},N=zs(me,be);return od(s,i,n,ce,me,h,l,N,be,K)}),ue=[];return R.forEach((me,M)=>{if(v||!m.some(le=>le.route.id===me.routeId)||j.has(M))return;let I=u.fetchers.get(M),ie=I&&I.state!=="idle"&&I.data===void 0,P=ll(A,me.path,G);if(!P){if(Z&&ie)return;ue.push({key:M,routeId:me.routeId,path:me.path,matches:null,match:null,request:null,controller:null});return}if(T.has(M))return;let be=uo(P,me.path),N=new AbortController,$=wr(o,me.path,N.signal),F=null;if(_.has(M))_.delete(M),F=Rr(s,i,$,P,be,h,l);else if(ie)b&&(F=Rr(s,i,$,P,be,h,l));else{let le;typeof K=="boolean"?le=K:ee?le=!1:le=b;let pe={...de,defaultShouldRevalidate:le};zs(be,pe)&&(F=Rr(s,i,$,P,be,h,l,pe))}F&&ue.push({key:M,routeId:me.routeId,path:me.path,matches:F,match:be,request:$,controller:N})}),{dsMatches:re,revalidatingFetchers:ue}}function bd(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function cx(n,l,s){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!bd(n))return{shouldLoad:!1,renderFallback:!1};let i=l!=null&&n.id in l,o=s!=null&&s[n.id]!==void 0;if(!i&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof n.loader=="function"&&n.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let u=!i&&!o;return{shouldLoad:u,renderFallback:u}}function m1(n,l,s){let i=!l||s.route.id!==l.route.id,o=!n.hasOwnProperty(s.route.id);return i||o}function h1(n,l){let s=n.route.path;return n.pathname!==l.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==l.params["*"]}function zs(n,l){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(l);if(typeof s=="boolean")return s}return l.defaultShouldRevalidate}function tg(n,l,s,i,o,u){let m;if(n){let h=i[n];He(h,`No route found to patch children into: routeId = ${n}`),h.children||(h.children=[]),m=h.children}else m=s;let p=[],g=[];if(l.forEach(h=>{let v=m.find(b=>ux(h,b));v?g.push({existingRoute:v,newRoute:h}):p.push(h)}),p.length>0){let h=Ms(p,o,[n||"_","patch",String(m?.length||"0")],i);m.push(...h)}if(u&&g.length>0)for(let h=0;h<g.length;h++){let{existingRoute:v,newRoute:b}=g[h],_=v,[j]=Ms([b],o,[],{},!0);Object.assign(_,{element:j.element?j.element:_.element,errorElement:j.errorElement?j.errorElement:_.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:_.hydrateFallbackElement})}}function ux(n,l){return"id"in n&&"id"in l&&n.id===l.id?!0:n.index===l.index&&n.path===l.path&&n.caseSensitive===l.caseSensitive?(!n.children||n.children.length===0)&&(!l.children||l.children.length===0)?!0:n.children?.every((s,i)=>l.children?.some(o=>ux(s,o)))??!1:!1}var ag=new WeakMap,dx=({key:n,route:l,manifest:s,mapRouteProperties:i})=>{let o=s[l.id];if(He(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[n];if(!u)return;let m=ag.get(o);m||(m={},ag.set(o,m));let p=m[n];if(p)return p;let g=(async()=>{let h=Ov(n),b=o[n]!==void 0&&n!=="hasErrorBoundary";if(h)Rt(!h,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),m[n]=Promise.resolve();else if(b)Rt(!1,`Route "${o.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let _=await u();_!=null&&(Object.assign(o,{[n]:_}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[n]=void 0,Object.values(o.lazy).every(_=>_===void 0)&&(o.lazy=void 0))})();return m[n]=g,g},ng=new WeakMap;function p1(n,l,s,i,o){let u=s[n.id];if(He(u,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let v=ng.get(u);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let b=(async()=>{He(typeof n.lazy=="function","No lazy route function found");let _=await n.lazy(),j={};for(let R in _){let T=_[R];if(T===void 0)continue;let A=Mv(R),Z=u[R]!==void 0&&R!=="hasErrorBoundary";A?Rt(!A,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Z?Rt(!Z,`Route "${u.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):j[R]=T}Object.assign(u,j),Object.assign(u,{...i(u),lazy:void 0})})();return ng.set(u,b),b.catch(()=>{}),{lazyRoutePromise:b,lazyHandlerPromise:b}}let m=Object.keys(n.lazy),p=[],g;for(let v of m){if(o&&o.includes(v))continue;let b=dx({key:v,route:n,manifest:s,mapRouteProperties:i});b&&(p.push(b),v===l&&(g=b))}let h=p.length>0?Promise.all(p).then(()=>{}):void 0;return h?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:g}}async function lg(n){let l=n.matches.filter(o=>o.shouldLoad),s={};return(await Promise.all(l.map(o=>o.resolve()))).forEach((o,u)=>{s[l[u].route.id]=o}),s}async function g1(n){return n.matches.some(l=>l.route.middleware)?fx(n,()=>lg(n)):lg(n)}function fx(n,l){return x1(n,l,i=>{if(z1(i))throw i;return i},E1,s);function s(i,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:i}}));{let{matches:m}=n,p=Math.min(Math.max(m.findIndex(h=>h.route.id===o),0),Math.max(m.findIndex(h=>h.shouldCallHandler()),0)),g=rl(m,m[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:i}})}}}async function x1(n,l,s,i,o){let{matches:u,request:m,params:p,context:g,unstable_pattern:h}=n,v=u.flatMap(_=>_.route.middleware?_.route.middleware.map(j=>[_.route.id,j]):[]);return await mx({request:m,params:p,context:g,unstable_pattern:h},v,l,s,i,o)}async function mx(n,l,s,i,o,u,m=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=l[m];if(!g)return await s();let[h,v]=g,b,_=async()=>{if(b)throw new Error("You may only call `next()` once per middleware");try{return b={value:await mx(n,l,s,i,o,u,m+1)},b.value}catch(j){return b={value:await u(j,h,b)},b.value}};try{let j=await v(n,_),R=j!=null?i(j):void 0;return o(R)?R:b?R??b.value:(b={value:await _()},b.value)}catch(j){return await u(j,h,b)}}function hx(n,l,s,i,o){let u=dx({key:"middleware",route:i.route,manifest:l,mapRouteProperties:n}),m=p1(i.route,na(s.method)?"action":"loader",l,n,o);return{middleware:u,route:m.lazyRoutePromise,handler:m.lazyHandlerPromise}}function od(n,l,s,i,o,u,m,p,g=null,h){let v=!1,b=hx(n,l,s,o,u);return{...o,_lazyPromises:b,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(_){return v=!0,g?typeof h=="boolean"?zs(o,{...g,defaultShouldRevalidate:h}):typeof _=="boolean"?zs(o,{...g,defaultShouldRevalidate:_}):zs(o,g):p},resolve(_){let{lazy:j,loader:R,middleware:T}=o.route,A=v||p||_&&!na(s.method)&&(j||R),G=T&&T.length>0&&!R&&!j;return A&&(na(s.method)||!G)?b1({request:s,unstable_pattern:i,match:o,lazyHandlerPromise:b?.handler,lazyRoutePromise:b?.route,handlerOverride:_,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function Rr(n,l,s,i,o,u,m,p=null){return i.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:hx(n,l,s,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:od(n,l,s,Hs(i),g,u,m,!0,p))}async function y1(n,l,s,i,o,u){s.some(h=>h._lazyPromises?.middleware)&&await Promise.all(s.map(h=>h._lazyPromises?.middleware));let m={request:l,unstable_pattern:Hs(s),params:s[0].params,context:o,matches:s},g=await n({...m,fetcherKey:i,runClientMiddleware:h=>{let v=m;return fx(v,()=>h({...v,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return g}async function b1({request:n,unstable_pattern:l,match:s,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:u,scopedContext:m}){let p,g,h=na(n.method),v=h?"action":"loader",b=_=>{let j,R=new Promise((G,Z)=>j=Z);g=()=>j(),n.signal.addEventListener("abort",g);let T=G=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${s.route.id}]`)):_({request:n,unstable_pattern:l,params:s.params,context:m},...G!==void 0?[G]:[]),A=(async()=>{try{return{type:"data",result:await(u?u(Z=>T(Z)):T())}}catch(G){return{type:"error",result:G}}})();return Promise.race([A,R])};try{let _=h?s.route.action:s.route.loader;if(i||o)if(_){let j,[R]=await Promise.all([b(_).catch(T=>{j=T}),i,o]);if(j!==void 0)throw j;p=R}else{await i;let j=h?s.route.action:s.route.loader;if(j)[p]=await Promise.all([b(j),o]);else if(v==="action"){let R=new URL(n.url),T=R.pathname+R.search;throw Ua(405,{method:n.method,pathname:T,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(_)p=await b(_);else{let j=new URL(n.url),R=j.pathname+j.search;throw Ua(404,{pathname:R})}}catch(_){return{type:"error",result:_}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function v1(n){let l=n.headers.get("Content-Type");return l&&/\bapplication\/json\b/.test(l)?n.body==null?null:n.json():n.text()}async function S1(n){let{result:l,type:s}=n;if(vd(l)){let i;try{i=await v1(l)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new Us(l.status,l.statusText,i),statusCode:l.status,headers:l.headers}:{type:"data",data:i,statusCode:l.status,headers:l.headers}}return s==="error"?ug(l)?l.data instanceof Error?{type:"error",error:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:w1(l),statusCode:As(l)?l.status:void 0,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:l,statusCode:As(l)?l.status:void 0}:ug(l)?{type:"data",data:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"data",data:l}}function _1(n,l,s,i,o){let u=n.headers.get("Location");if(He(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!yd(u)){let m=i.slice(0,i.findIndex(p=>p.route.id===s)+1);u=id(new URL(l.url),m,o,u),n.headers.set("Location",u)}return n}function rg(n,l,s,i){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(yd(n)){let u=n,m=u.startsWith("//")?new URL(l.protocol+u):new URL(u);if(o.includes(m.protocol))throw new Error("Invalid redirect location");let p=Ba(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 wr(n,l,s,i){let o=n.createURL(px(l)).toString(),u={signal:s};if(i&&na(i.formMethod)){let{formMethod:m,formEncType:p}=i;u.method=m.toUpperCase(),p==="application/json"?(u.headers=new Headers({"Content-Type":p}),u.body=JSON.stringify(i.json)):p==="text/plain"?u.body=i.text:p==="application/x-www-form-urlencoded"&&i.formData?u.body=cd(i.formData):u.body=i.formData}return new Request(o,u)}function cd(n){let l=new URLSearchParams;for(let[s,i]of n.entries())l.append(s,typeof i=="string"?i:i.name);return l}function sg(n){let l=new FormData;for(let[s,i]of n.entries())l.append(s,i);return l}function j1(n,l,s,i=!1,o=!1){let u={},m=null,p,g=!1,h={},v=s&&ja(s[1])?s[1].error:void 0;return n.forEach(b=>{if(!(b.route.id in l))return;let _=b.route.id,j=l[_];if(He(!zl(j),"Cannot handle redirect results in processLoaderData"),ja(j)){let R=j.error;if(v!==void 0&&(R=v,v=void 0),m=m||{},o)m[_]=R;else{let T=rl(n,_);m[T.route.id]==null&&(m[T.route.id]=R)}i||(u[_]=ox),g||(g=!0,p=As(j.error)?j.error.status:500),j.headers&&(h[_]=j.headers)}else u[_]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(h[_]=j.headers)}),v!==void 0&&s&&(m={[s[0]]:v},s[2]&&(u[s[2]]=void 0)),{loaderData:u,errors:m,statusCode:p||200,loaderHeaders:h}}function ig(n,l,s,i,o,u){let{loaderData:m,errors:p}=j1(l,s,i);return o.filter(g=>!g.matches||g.matches.some(h=>h.shouldLoad)).forEach(g=>{let{key:h,match:v,controller:b}=g;if(b&&b.signal.aborted)return;let _=u[h];if(He(_,"Did not find corresponding fetcher result"),ja(_)){let j=rl(n.matches,v?.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:_.error}),n.fetchers.delete(h)}else if(zl(_))He(!1,"Unhandled fetcher revalidation redirect");else{let j=Tn(_.data);n.fetchers.set(h,j)}}),{loaderData:m,errors:p}}function og(n,l,s,i){let o=Object.entries(l).filter(([,u])=>u!==ox).reduce((u,[m,p])=>(u[m]=p,u),{});for(let u of s){let m=u.route.id;if(!l.hasOwnProperty(m)&&n.hasOwnProperty(m)&&u.route.loader&&(o[m]=n[m]),i&&i.hasOwnProperty(m))break}return o}function cg(n){return n?ja(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function rl(n,l){return(l?n.slice(0,n.findIndex(i=>i.route.id===l)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function no(n){let l=n.length===1?n[0]:n.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:l}],route:l}}function Ua(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 Us(n||500,m,new Error(p),!0)}function lo(n){let l=Object.entries(n);for(let s=l.length-1;s>=0;s--){let[i,o]=l[s];if(zl(o))return{key:i,result:o}}}function px(n){let l=typeof n=="string"?Dn(n):n;return on({...l,hash:""})}function N1(n,l){return n.pathname!==l.pathname||n.search!==l.search?!1:n.hash===""?l.hash!=="":n.hash===l.hash?!0:l.hash!==""}function w1(n){return new Us(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)}function E1(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([l,s])=>typeof l=="string"&&C1(s))}function C1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function R1(n){return vd(n.result)&&sx.has(n.result.status)}function ja(n){return n.type==="error"}function zl(n){return(n&&n.type)==="redirect"}function ug(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function vd(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function T1(n){return sx.has(n)}function z1(n){return vd(n)&&T1(n.status)&&n.headers.has("Location")}function O1(n){return i1.has(n.toUpperCase())}function na(n){return r1.has(n.toUpperCase())}function Sd(n){return new URLSearchParams(n).getAll("index").some(l=>l==="")}function uo(n,l){let s=typeof l=="string"?Dn(l).search:l.search;if(n[n.length-1].route.index&&Sd(s||""))return n[n.length-1];let i=tx(n);return i[i.length-1]}function dg(n){let{formMethod:l,formAction:s,formEncType:i,text:o,formData:u,json:m}=n;if(!(!l||!s||!i)){if(o!=null)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:l,formAction:s,formEncType:i,formData:u,json:void 0,text:void 0};if(m!==void 0)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:m,text:void 0}}}function Zu(n,l){return l?{state:"loading",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function D1(n,l){return{state:"submitting",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function Ns(n,l){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:l}}function M1(n,l){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l?l.data:void 0}}function Tn(n){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function A1(n,l){try{let s=n.sessionStorage.getItem(ix);if(s){let i=JSON.parse(s);for(let[o,u]of Object.entries(i||{}))u&&Array.isArray(u)&&l.set(o,new Set(u||[]))}}catch{}}function k1(n,l){if(l.size>0){let s={};for(let[i,o]of l)s[i]=[...o];try{n.sessionStorage.setItem(ix,JSON.stringify(s))}catch(i){Rt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function fg(){let n,l,s=new Promise((i,o)=>{n=async u=>{i(u);try{await s}catch{}},l=async u=>{o(u);try{await s}catch{}}});return{promise:s,resolve:n,reject:l}}var Ll=y.createContext(null);Ll.displayName="DataRouter";var Bs=y.createContext(null);Bs.displayName="DataRouterState";var gx=y.createContext(!1);function L1(){return y.useContext(gx)}var _d=y.createContext({isTransitioning:!1});_d.displayName="ViewTransition";var xx=y.createContext(new Map);xx.displayName="Fetchers";var U1=y.createContext(null);U1.displayName="Await";var Ea=y.createContext(null);Ea.displayName="Navigation";var So=y.createContext(null);So.displayName="Location";var $a=y.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var jd=y.createContext(null);jd.displayName="RouteError";var yx="REACT_ROUTER_ERROR",H1="REDIRECT",B1="ROUTE_ERROR_RESPONSE";function $1(n){if(n.startsWith(`${yx}:${H1}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function q1(n){if(n.startsWith(`${yx}:${B1}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new Us(l.status,l.statusText,l.data)}catch{}}function Y1(n,{relative:l}={}){He(zr(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=y.useContext(Ea),{hash:o,pathname:u,search:m}=qs(n,{relative:l}),p=u;return s!=="/"&&(p=u==="/"?s:Za([s,u])),i.createHref({pathname:p,search:m,hash:o})}function zr(){return y.useContext(So)!=null}function Ja(){return He(zr(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(So).location}var bx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function vx(n){y.useContext(Ea).static||y.useLayoutEffect(n)}function Mn(){let{isDataRoute:n}=y.useContext($a);return n?n4():G1()}function G1(){He(zr(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Ll),{basename:l,navigator:s}=y.useContext(Ea),{matches:i}=y.useContext($a),{pathname:o}=Ja(),u=JSON.stringify(vo(i)),m=y.useRef(!1);return vx(()=>{m.current=!0}),y.useCallback((g,h={})=>{if(Rt(m.current,bx),!m.current)return;if(typeof g=="number"){s.go(g);return}let v=Ls(g,JSON.parse(u),o,h.relative==="path");n==null&&l!=="/"&&(v.pathname=v.pathname==="/"?l:Za([l,v.pathname])),(h.replace?s.replace:s.push)(v,h.state,h)},[l,s,u,o,n])}var V1=y.createContext(null);function K1(n){let l=y.useContext($a).outlet;return y.useMemo(()=>l&&y.createElement(V1.Provider,{value:n},l),[l,n])}function $s(){let{matches:n}=y.useContext($a),l=n[n.length-1];return l?l.params:{}}function qs(n,{relative:l}={}){let{matches:s}=y.useContext($a),{pathname:i}=Ja(),o=JSON.stringify(vo(s));return y.useMemo(()=>Ls(n,JSON.parse(o),i,l==="path"),[n,o,i,l])}function X1(n,l,s){He(zr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=y.useContext(Ea),{matches:o}=y.useContext($a),u=o[o.length-1],m=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",h=u&&u.route;{let A=h&&h.path||"";_x(p,!h||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let v=Ja(),b;b=v;let _=b.pathname||"/",j=_;if(g!=="/"){let A=g.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(A.length).join("/")}let R=ll(n,{pathname:j});return Rt(h||R!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Rt(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),P1(R&&R.map(A=>Object.assign({},A,{params:Object.assign({},m,A.params),pathname:Za([g,i.encodeLocation?i.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?g:Za([g,i.encodeLocation?i.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),o,s)}function Q1(){let n=a4(),l=As(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},u={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:u},"ErrorBoundary")," or"," ",y.createElement("code",{style:u},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},l),s?y.createElement("pre",{style:o},s):null,m)}var Z1=y.createElement(Q1,null),Sx=class extends y.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=q1(n.digest);s&&(n=s)}let l=n!==void 0?y.createElement($a.Provider,{value:this.props.routeContext},y.createElement(jd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(F1,{error:n},l):l}};Sx.contextType=gx;var Fu=new WeakMap;function F1({children:n,error:l}){let{basename:s}=y.useContext(Ea);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=$1(l.digest);if(i){let o=Fu.get(l);if(o)throw o;let u=nx(i.location,s);if(ax&&!Fu.get(l))if(u.isExternal||i.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:i.replace}));throw Fu.set(l,m),m}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function J1({routeContext:n,match:l,children:s}){let i=y.useContext(Ll);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),y.createElement($a.Provider,{value:n},s)}function P1(n,l=[],s){let i=s?.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let o=n,u=i?.errors;if(u!=null){let v=o.findIndex(b=>b.route.id&&u?.[b.route.id]!==void 0);He(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let m=!1,p=-1;if(s&&i){m=i.renderFallback;for(let v=0;v<o.length;v++){let b=o[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(p=v),b.route.id){let{loaderData:_,errors:j}=i,R=b.route.loader&&!_.hasOwnProperty(b.route.id)&&(!j||j[b.route.id]===void 0);if(b.route.lazy||R){s.isStatic&&(m=!0),p>=0?o=o.slice(0,p+1):o=[o[0]];break}}}}let g=s?.onError,h=i&&g?(v,b)=>{g(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Hs(i.matches),errorInfo:b})}:void 0;return o.reduceRight((v,b,_)=>{let j,R=!1,T=null,A=null;i&&(j=u&&b.route.id?u[b.route.id]:void 0,T=b.route.errorElement||Z1,m&&(p<0&&_===0?(_x("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,A=null):p===_&&(R=!0,A=b.route.hydrateFallbackElement||null)));let G=l.concat(o.slice(0,_+1)),Z=()=>{let Y;return j?Y=T:R?Y=A:b.route.Component?Y=y.createElement(b.route.Component,null):b.route.element?Y=b.route.element:Y=v,y.createElement(J1,{match:b,routeContext:{outlet:v,matches:G,isDataRoute:i!=null},children:Y})};return i&&(b.route.ErrorBoundary||b.route.errorElement||_===0)?y.createElement(Sx,{location:i.location,revalidation:i.revalidation,component:T,error:j,children:Z(),routeContext:{outlet:null,matches:G,isDataRoute:!0},onError:h}):Z()},null)}function Nd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function I1(n){let l=y.useContext(Ll);return He(l,Nd(n)),l}function W1(n){let l=y.useContext(Bs);return He(l,Nd(n)),l}function e4(n){let l=y.useContext($a);return He(l,Nd(n)),l}function wd(n){let l=e4(n),s=l.matches[l.matches.length-1];return He(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function t4(){return wd("useRouteId")}function a4(){let n=y.useContext(jd),l=W1("useRouteError"),s=wd("useRouteError");return n!==void 0?n:l.errors?.[s]}function n4(){let{router:n}=I1("useNavigate"),l=wd("useNavigate"),s=y.useRef(!1);return vx(()=>{s.current=!0}),y.useCallback(async(o,u={})=>{Rt(s.current,bx),s.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:l,...u}))},[n,l])}var mg={};function _x(n,l,s){!l&&!mg[n]&&(mg[n]=!0,Rt(!1,s))}var hg={};function pg(n,l){!n&&!hg[l]&&(hg[l]=!0,console.warn(l))}var l4="useOptimistic",gg=A0[l4],r4=()=>{};function s4(n){return gg?gg(n):[n,r4]}function i4(n){let l={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&Rt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(l,{element:y.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&Rt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(l,{hydrateFallbackElement:y.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&Rt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(l,{errorElement:y.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),l}var o4=["HydrateFallback","hydrateFallbackElement"],c4=class{constructor(){this.status="pending",this.promise=new Promise((n,l)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",l(s))}})}};function u4({router:n,flushSync:l,onError:s,unstable_useTransitions:i}){i=L1()||i;let[u,m]=y.useState(n.state),[p,g]=s4(u),[h,v]=y.useState(),[b,_]=y.useState({isTransitioning:!1}),[j,R]=y.useState(),[T,A]=y.useState(),[G,Z]=y.useState(),Y=y.useRef(new Map),K=y.useCallback((w,{deletedFetchers:H,newErrors:ee,flushSync:de,viewTransitionOpts:ce})=>{ee&&s&&Object.values(ee).forEach(ue=>s(ue,{location:w.location,params:w.matches[0]?.params??{},unstable_pattern:Hs(w.matches)})),w.fetchers.forEach((ue,me)=>{ue.data!==void 0&&Y.current.set(me,ue.data)}),H.forEach(ue=>Y.current.delete(ue)),pg(de===!1||l!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let re=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(pg(ce==null||re,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!ce||!re){l&&de?l(()=>m(w)):i===!1?m(w):y.startTransition(()=>{i===!0&&g(ue=>xg(ue,w)),m(w)});return}if(l&&de){l(()=>{T&&(j?.resolve(),T.skipTransition()),_({isTransitioning:!0,flushSync:!0,currentLocation:ce.currentLocation,nextLocation:ce.nextLocation})});let ue=n.window.document.startViewTransition(()=>{l(()=>m(w))});ue.finished.finally(()=>{l(()=>{R(void 0),A(void 0),v(void 0),_({isTransitioning:!1})})}),l(()=>A(ue));return}T?(j?.resolve(),T.skipTransition(),Z({state:w,currentLocation:ce.currentLocation,nextLocation:ce.nextLocation})):(v(w),_({isTransitioning:!0,flushSync:!1,currentLocation:ce.currentLocation,nextLocation:ce.nextLocation}))},[n.window,l,T,j,i,g,s]);y.useLayoutEffect(()=>n.subscribe(K),[n,K]),y.useEffect(()=>{b.isTransitioning&&!b.flushSync&&R(new c4)},[b]),y.useEffect(()=>{if(j&&h&&n.window){let w=h,H=j.promise,ee=n.window.document.startViewTransition(async()=>{i===!1?m(w):y.startTransition(()=>{i===!0&&g(de=>xg(de,w)),m(w)}),await H});ee.finished.finally(()=>{R(void 0),A(void 0),v(void 0),_({isTransitioning:!1})}),A(ee)}},[h,j,n.window,i,g]),y.useEffect(()=>{j&&h&&p.location.key===h.location.key&&j.resolve()},[j,T,p.location,h]),y.useEffect(()=>{!b.isTransitioning&&G&&(v(G.state),_({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}),Z(void 0))},[b.isTransitioning,G]);let X=y.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:w=>n.navigate(w),push:(w,H,ee)=>n.navigate(w,{state:H,preventScrollReset:ee?.preventScrollReset}),replace:(w,H,ee)=>n.navigate(w,{replace:!0,state:H,preventScrollReset:ee?.preventScrollReset})}),[n]),ne=n.basename||"/",J=y.useMemo(()=>({router:n,navigator:X,static:!1,basename:ne,onError:s}),[n,X,ne,s]);return y.createElement(y.Fragment,null,y.createElement(Ll.Provider,{value:J},y.createElement(Bs.Provider,{value:p},y.createElement(xx.Provider,{value:Y.current},y.createElement(_d.Provider,{value:b},y.createElement(m4,{basename:ne,location:p.location,navigationType:p.historyAction,navigator:X,unstable_useTransitions:i},y.createElement(d4,{routes:n.routes,future:n.future,state:p,isStatic:!1,onError:s})))))),null)}function xg(n,l){return{...n,navigation:l.navigation.state!=="idle"?l.navigation:n.navigation,revalidation:l.revalidation!=="idle"?l.revalidation:n.revalidation,actionData:l.navigation.state!=="submitting"?l.actionData:n.actionData,fetchers:l.fetchers}}var d4=y.memo(f4);function f4({routes:n,future:l,state:s,isStatic:i,onError:o}){return X1(n,void 0,{state:s,isStatic:i,onError:o})}function yg({to:n,replace:l,state:s,relative:i}){He(zr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=y.useContext(Ea);Rt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=y.useContext($a),{pathname:m}=Ja(),p=Mn(),g=Ls(n,vo(u),m,i==="path"),h=JSON.stringify(g);return y.useEffect(()=>{p(JSON.parse(h),{replace:l,state:s,relative:i})},[p,h,i,l,s]),null}function jx(n){return K1(n.context)}function m4({basename:n="/",children:l=null,location:s,navigationType:i="POP",navigator:o,static:u=!1,unstable_useTransitions:m}){He(!zr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=y.useMemo(()=>({basename:p,navigator:o,static:u,unstable_useTransitions:m,future:{}}),[p,o,u,m]);typeof s=="string"&&(s=Dn(s));let{pathname:h="/",search:v="",hash:b="",state:_=null,key:j="default",unstable_mask:R}=s,T=y.useMemo(()=>{let A=Ba(h,p);return A==null?null:{location:{pathname:A,search:v,hash:b,state:_,key:j,unstable_mask:R},navigationType:i}},[p,h,v,b,_,j,i,R]);return Rt(T!=null,`<Router basename="${p}"> is not able to match the URL "${h}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:y.createElement(Ea.Provider,{value:g},y.createElement(So.Provider,{children:l,value:T}))}var fo="get",mo="application/x-www-form-urlencoded";function _o(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function h4(n){return _o(n)&&n.tagName.toLowerCase()==="button"}function p4(n){return _o(n)&&n.tagName.toLowerCase()==="form"}function g4(n){return _o(n)&&n.tagName.toLowerCase()==="input"}function x4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function y4(n,l){return n.button===0&&(!l||l==="_self")&&!x4(n)}function ud(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,s)=>{let i=n[s];return l.concat(Array.isArray(i)?i.map(o=>[s,o]):[[s,i]])},[]))}function b4(n,l){let s=ud(n);return l&&l.forEach((i,o)=>{s.has(o)||l.getAll(o).forEach(u=>{s.append(o,u)})}),s}var ro=null;function v4(){if(ro===null)try{new FormData(document.createElement("form"),0),ro=!1}catch{ro=!0}return ro}var S4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ju(n){return n!=null&&!S4.has(n)?(Rt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mo}"`),null):n}function _4(n,l){let s,i,o,u,m;if(p4(n)){let p=n.getAttribute("action");i=p?Ba(p,l):null,s=n.getAttribute("method")||fo,o=Ju(n.getAttribute("enctype"))||mo,u=new FormData(n)}else if(h4(n)||g4(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(i=g?Ba(g,l):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||fo,o=Ju(n.getAttribute("formenctype"))||Ju(p.getAttribute("enctype"))||mo,u=new FormData(p,n),!v4()){let{name:h,type:v,value:b}=n;if(v==="image"){let _=h?`${h}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else h&&u.append(h,b)}}else{if(_o(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=fo,i=null,o=mo,m=n}return u&&o==="text/plain"&&(m=u,u=void 0),{action:i,method:s.toLowerCase(),encType:o,formData:u,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ed(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function j4(n,l,s,i){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:l&&Ba(o.pathname,l)==="/"?o.pathname=`${l.replace(/\/$/,"")}/_root.${i}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${i}`,o}async function N4(n,l){if(n.id in l)return l[n.id];try{let s=await import(n.module);return l[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function w4(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function E4(n,l,s){let i=await Promise.all(n.map(async o=>{let u=l.routes[o.route.id];if(u){let m=await N4(u,s);return m.links?m.links():[]}return[]}));return z4(i.flat(1).filter(w4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function bg(n,l,s,i,o,u){let m=(g,h)=>s[h]?g.route.id!==s[h].route.id:!0,p=(g,h)=>s[h].pathname!==g.pathname||s[h].route.path?.endsWith("*")&&s[h].params["*"]!==g.params["*"];return u==="assets"?l.filter((g,h)=>m(g,h)||p(g,h)):u==="data"?l.filter((g,h)=>{let v=i.routes[g.route.id];if(!v||!v.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let b=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function C4(n,l,{includeHydrateFallback:s}={}){return R4(n.map(i=>{let o=l.routes[i.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),s&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function R4(n){return[...new Set(n)]}function T4(n){let l={},s=Object.keys(n).sort();for(let i of s)l[i]=n[i];return l}function z4(n,l){let s=new Set;return new Set(l),n.reduce((i,o)=>{let u=JSON.stringify(T4(o));return s.has(u)||(s.add(u),i.push({key:u,link:o})),i},[])}function Nx(){let n=y.useContext(Ll);return Ed(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function O4(){let n=y.useContext(Bs);return Ed(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Cd=y.createContext(void 0);Cd.displayName="FrameworkContext";function wx(){let n=y.useContext(Cd);return Ed(n,"You must render this element inside a <HydratedRouter> element"),n}function D4(n,l){let s=y.useContext(Cd),[i,o]=y.useState(!1),[u,m]=y.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:v,onTouchStart:b}=l,_=y.useRef(null);y.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let T=G=>{G.forEach(Z=>{m(Z.isIntersecting)})},A=new IntersectionObserver(T,{threshold:.5});return _.current&&A.observe(_.current),()=>{A.disconnect()}}},[n]),y.useEffect(()=>{if(i){let T=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(T)}}},[i]);let j=()=>{o(!0)},R=()=>{o(!1),m(!1)};return s?n!=="intent"?[u,_,{}]:[u,_,{onFocus:ws(p,j),onBlur:ws(g,R),onMouseEnter:ws(h,j),onMouseLeave:ws(v,R),onTouchStart:ws(b,j)}]:[!1,_,{}]}function ws(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function M4({page:n,...l}){let{router:s}=Nx(),i=y.useMemo(()=>ll(s.routes,n,s.basename),[s.routes,n,s.basename]);return i?y.createElement(k4,{page:n,matches:i,...l}):null}function A4(n){let{manifest:l,routeModules:s}=wx(),[i,o]=y.useState([]);return y.useEffect(()=>{let u=!1;return E4(n,l,s).then(m=>{u||o(m)}),()=>{u=!0}},[n,l,s]),i}function k4({page:n,matches:l,...s}){let i=Ja(),{future:o,manifest:u,routeModules:m}=wx(),{basename:p}=Nx(),{loaderData:g,matches:h}=O4(),v=y.useMemo(()=>bg(n,l,h,u,i,"data"),[n,l,h,u,i]),b=y.useMemo(()=>bg(n,l,h,u,i,"assets"),[n,l,h,u,i]),_=y.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let T=new Set,A=!1;if(l.forEach(Z=>{let Y=u.routes[Z.route.id];!Y||!Y.hasLoader||(!v.some(K=>K.route.id===Z.route.id)&&Z.route.id in g&&m[Z.route.id]?.shouldRevalidate||Y.hasClientLoader?A=!0:T.add(Z.route.id))}),T.size===0)return[];let G=j4(n,p,o.unstable_trailingSlashAwareDataRequests,"data");return A&&T.size>0&&G.searchParams.set("_routes",l.filter(Z=>T.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[G.pathname+G.search]},[p,o.unstable_trailingSlashAwareDataRequests,g,i,u,v,l,n,m]),j=y.useMemo(()=>C4(b,u),[b,u]),R=A4(b);return y.createElement(y.Fragment,null,_.map(T=>y.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...s})),j.map(T=>y.createElement("link",{key:T,rel:"modulepreload",href:T,...s})),R.map(({key:T,link:A})=>y.createElement("link",{key:T,nonce:s.nonce,...A,crossOrigin:A.crossOrigin??s.crossOrigin})))}function L4(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var U4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{U4&&(window.__reactRouterVersion="7.13.1")}catch{}function H4(n,l){return d1({basename:l?.basename,getContext:l?.getContext,future:l?.future,history:Cv({window:l?.window}),hydrationData:B4(),routes:n,mapRouteProperties:i4,hydrationRouteProperties:o4,dataStrategy:l?.dataStrategy,patchRoutesOnNavigation:l?.patchRoutesOnNavigation,window:l?.window,unstable_instrumentations:l?.unstable_instrumentations}).initialize()}function B4(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:$4(n.errors)}),n}function $4(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 Us(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let u=window[o.__subType];if(typeof u=="function")try{let m=new u(o.message);m.stack="",s[i]=m}catch{}}if(s[i]==null){let u=new Error(o.message);u.stack="",s[i]=u}}else s[i]=o;return s}var Ex=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Na=y.forwardRef(function({onClick:l,discover:s="render",prefetch:i="none",relative:o,reloadDocument:u,replace:m,unstable_mask:p,state:g,target:h,to:v,preventScrollReset:b,viewTransition:_,unstable_defaultShouldRevalidate:j,...R},T){let{basename:A,navigator:G,unstable_useTransitions:Z}=y.useContext(Ea),Y=typeof v=="string"&&Ex.test(v),K=nx(v,A);v=K.to;let X=Y1(v,{relative:o}),ne=Ja(),J=null;if(p){let me=Ls(p,[],ne.unstable_mask?ne.unstable_mask.pathname:"/",!0);A!=="/"&&(me.pathname=me.pathname==="/"?A:Za([A,me.pathname])),J=G.createHref(me)}let[w,H,ee]=D4(i,R),de=G4(v,{replace:m,unstable_mask:p,state:g,target:h,preventScrollReset:b,relative:o,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:Z});function ce(me){l&&l(me),me.defaultPrevented||de(me)}let re=!(K.isExternal||u),ue=y.createElement("a",{...R,...ee,href:(re?J:void 0)||K.absoluteURL||X,onClick:re?ce:l,ref:L4(T,H),target:h,"data-discover":!Y&&s==="render"?"true":void 0});return w&&!Y?y.createElement(y.Fragment,null,ue,y.createElement(M4,{page:X})):ue});Na.displayName="Link";var ks=y.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:i="",end:o=!1,style:u,to:m,viewTransition:p,children:g,...h},v){let b=qs(m,{relative:h.relative}),_=Ja(),j=y.useContext(Bs),{navigator:R,basename:T}=y.useContext(Ea),A=j!=null&&Z4(b)&&p===!0,G=R.encodeLocation?R.encodeLocation(b).pathname:b.pathname,Z=_.pathname,Y=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(Z=Z.toLowerCase(),Y=Y?Y.toLowerCase():null,G=G.toLowerCase()),Y&&T&&(Y=Ba(Y,T)||Y);const K=G!=="/"&&G.endsWith("/")?G.length-1:G.length;let X=Z===G||!o&&Z.startsWith(G)&&Z.charAt(K)==="/",ne=Y!=null&&(Y===G||!o&&Y.startsWith(G)&&Y.charAt(G.length)==="/"),J={isActive:X,isPending:ne,isTransitioning:A},w=X?l:void 0,H;typeof i=="function"?H=i(J):H=[i,X?"active":null,ne?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let ee=typeof u=="function"?u(J):u;return y.createElement(Na,{...h,"aria-current":w,className:H,ref:v,style:ee,to:m,viewTransition:p},typeof g=="function"?g(J):g)});ks.displayName="NavLink";var q4=y.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:i,replace:o,state:u,method:m=fo,action:p,onSubmit:g,relative:h,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_,...j},R)=>{let{unstable_useTransitions:T}=y.useContext(Ea),A=X4(),G=Q4(p,{relative:h}),Z=m.toLowerCase()==="get"?"get":"post",Y=typeof p=="string"&&Ex.test(p),K=X=>{if(g&&g(X),X.defaultPrevented)return;X.preventDefault();let ne=X.nativeEvent.submitter,J=ne?.getAttribute("formmethod")||m,w=()=>A(ne||X.currentTarget,{fetcherKey:l,method:J,navigate:s,replace:o,state:u,relative:h,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_});T&&s!==!1?y.startTransition(()=>w()):w()};return y.createElement("form",{ref:R,method:Z,action:G,onSubmit:i?g:K,...j,"data-discover":!Y&&n==="render"?"true":void 0})});q4.displayName="Form";function Y4(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Cx(n){let l=y.useContext(Ll);return He(l,Y4(n)),l}function G4(n,{target:l,replace:s,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:h}={}){let v=Mn(),b=Ja(),_=qs(n,{relative:m});return y.useCallback(j=>{if(y4(j,l)){j.preventDefault();let R=s!==void 0?s:on(b)===on(_),T=()=>v(n,{replace:R,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g});h?y.startTransition(()=>T()):T()}},[b,v,_,s,i,o,l,n,u,m,p,g,h])}function jo(n){Rt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=y.useRef(ud(n)),s=y.useRef(!1),i=Ja(),o=y.useMemo(()=>b4(i.search,s.current?null:l.current),[i.search]),u=Mn(),m=y.useCallback((p,g)=>{const h=ud(typeof p=="function"?p(new URLSearchParams(o)):p);s.current=!0,u("?"+h,g)},[u,o]);return[o,m]}var V4=0,K4=()=>`__${String(++V4)}__`;function X4(){let{router:n}=Cx("useSubmit"),{basename:l}=y.useContext(Ea),s=t4(),i=n.fetch,o=n.navigate;return y.useCallback(async(u,m={})=>{let{action:p,method:g,encType:h,formData:v,body:b}=_4(u,l);if(m.navigate===!1){let _=m.fetcherKey||K4();await i(_,s,m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:b,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await o(m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:b,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,o,l,s])}function Q4(n,{relative:l}={}){let{basename:s}=y.useContext(Ea),i=y.useContext($a);He(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),u={...qs(n||".",{relative:l})},m=Ja();if(n==null){u.search=m.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(v=>v==="")){p.delete("index"),g.filter(b=>b).forEach(b=>p.append("index",b));let v=p.toString();u.search=v?`?${v}`:""}}return(!n||n===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(u.pathname=u.pathname==="/"?s:Za([s,u.pathname])),on(u)}function Z4(n,{relative:l}={}){let s=y.useContext(_d);He(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Cx("useViewTransitionState"),o=qs(n,{relative:l});if(!s.isTransitioning)return!1;let u=Ba(s.currentLocation.pathname,i)||s.currentLocation.pathname,m=Ba(s.nextLocation.pathname,i)||s.nextLocation.pathname;return xo(o.pathname,m)!=null||xo(o.pathname,u)!=null}const vg=n=>{let l;const s=new Set,i=(h,v)=>{const b=typeof h=="function"?h(l):h;if(!Object.is(b,l)){const _=l;l=v??(typeof b!="object"||b===null)?b:Object.assign({},l,b),s.forEach(j=>j(l,_))}},o=()=>l,p={setState:i,getState:o,getInitialState:()=>g,subscribe:h=>(s.add(h),()=>s.delete(h))},g=l=n(i,o,p);return p},F4=(n=>n?vg(n):vg),J4=n=>n;function P4(n,l=J4){const s=Er.useSyncExternalStore(n.subscribe,Er.useCallback(()=>l(n.getState()),[n,l]),Er.useCallback(()=>l(n.getInitialState()),[n,l]));return Er.useDebugValue(s),s}const Sg=n=>{const l=F4(n),s=i=>P4(l,i);return Object.assign(s,l),s},No=(n=>n?Sg(n):Sg),Rx="/api/v1";class Ol extends Error{constructor(l,s,i){super(i),this.status=l,this.code=s,this.name="ApiError"}}async function so(n,l,s,i,o){let u=`${Rx}${l}`;if(i){const g=new URLSearchParams(i).toString();g&&(u+=`?${g}`)}const m={method:n,headers:{"Content-Type":"application/json"}};s!==void 0&&(m.body=JSON.stringify(s)),o?.signal&&(m.signal=o.signal);const p=await fetch(u,m);if(!p.ok){let g="UNKNOWN",h=p.statusText;try{const v=await p.json();v.code&&(g=v.code),v.message&&(h=v.message)}catch{}throw new Ol(p.status,g,h)}return p.json()}const Pu=new Map;function I4(n,l){let s=`${Rx}${n}`;if(l){const i=new URLSearchParams(l).toString();i&&(s+=`?${i}`)}return s}const _t={get(n,l,s){const i=I4(n,l),o=Pu.get(i);if(o)return o;const u=so("GET",n,void 0,l,s).finally(()=>{Pu.delete(i)});return Pu.set(i,u),u},post(n,l,s){return so("POST",n,l,void 0,s)},put(n,l){return so("PUT",n,l)},delete(n){return so("DELETE",n)}},W4=3e4,eS=1e3,tS=3e4;class aS{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;_status="disconnected";get status(){return this._status}setStatus(l){this._status=l;for(const s of this.statusHandlers)s(l)}onStatusChange(l){return this.statusHandlers.add(l),()=>{this.statusHandlers.delete(l)}}connect(l){this.url=l,this.intentionalClose=!1,this.reconnectAttempt=0,this.open()}disconnect(){this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}on(l,s){let i=this.handlers.get(l);return i||(i=new Set,this.handlers.set(l,i)),i.add(s),()=>{i.delete(s),i.size===0&&this.handlers.delete(l)}}send(l,s){if(this.ws?.readyState!==WebSocket.OPEN)return;const i={event:l,payload:s,timestamp:Date.now()};this.ws.send(JSON.stringify(i))}open(){this.setStatus("connecting");const l=new WebSocket(this.url);l.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},l.onmessage=s=>{try{const i=JSON.parse(String(s.data));if(i.event==="pong")return;const o=this.handlers.get(i.event);if(o)for(const u of o)u(i.payload)}catch{}},l.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},l.onerror=()=>{},this.ws=l}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},W4)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const l=Math.min(eS*2**this.reconnectAttempt,tS);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},l)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const Fa=new aS,ol="lib_cloud_default",Pt=No((n,l)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const s=await _t.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 _t.post("/libraries",s);return n(o=>({libraries:[...o.libraries,i]})),i},deleteLibrary:async s=>{await _t.delete(`/libraries/${s}`),n(i=>({libraries:i.libraries.filter(o=>o.id!==s)}))},updateLibraryName:async(s,i)=>{const o=await _t.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 _t.get(`/libraries/${s}`);n(o=>({libraries:o.libraries.map(u=>u.id===s?i:u)}))}catch{l().fetchLibraries()}}})),Or=n=>{const l=n.libraries.filter(i=>i.type==="cloud").sort((i,o)=>i.created_at.localeCompare(o.created_at)),s=n.libraries.filter(i=>i.type==="daemon").sort((i,o)=>i.name.localeCompare(o.name));return[...l,...s]},nS=n=>n.libraries.filter(l=>l.type==="daemon");Fa.on("ws:daemon:status",n=>{const l=n;l.lib_id&&Pt.getState()._updateLibraryOnline(l.lib_id,l.is_online),Pt.getState().fetchLibraries()});Fa.on("ws:daemon:connected",n=>{const l=n;l.lib_id&&Pt.getState()._updateLibraryOnline(l.lib_id,!0),Pt.getState().fetchLibraries()});Fa.on("ws:library:updated",n=>{const l=n;Pt.getState()._refreshLibrary(l.library_id)});const Tx=(...n)=>n.filter((l,s,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===s).join(" ").trim();const lS=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const rS=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,s,i)=>i?i.toUpperCase():s.toLowerCase());const _g=n=>{const l=rS(n);return l.charAt(0).toUpperCase()+l.slice(1)};var sS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const iS=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const oS=y.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:m,...p},g)=>y.createElement("svg",{ref:g,...sS,width:l,height:l,stroke:n,strokeWidth:i?Number(s)*24/Number(l):s,className:Tx("lucide",o),...!u&&!iS(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,v])=>y.createElement(h,v)),...Array.isArray(u)?u:[u]]));const Me=(n,l)=>{const s=y.forwardRef(({className:i,...o},u)=>y.createElement(oS,{ref:u,iconNode:l,className:Tx(`lucide-${lS(_g(n))}`,`lucide-${n}`,i),...o}));return s.displayName=_g(n),s};const cS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zx=Me("arrow-right",cS);const uS=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],jg=Me("arrow-up-right",uS);const dS=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],fS=Me("boxes",dS);const mS=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],hS=Me("brain",mS);const pS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Al=Me("check",pS);const gS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ra=Me("chevron-right",gS);const xS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ox=Me("circle-alert",xS);const yS=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],bS=Me("cloud",yS);const vS=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],dd=Me("copy",vS);const SS=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],_S=Me("database",SS);const jS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],NS=Me("file-spreadsheet",jS);const wS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],il=Me("file-text",wS);const ES=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Dx=Me("file",ES);const CS=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],RS=Me("files",CS);const TS=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],wo=Me("folder-git-2",TS);const zS=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],OS=Me("folder-input",zS);const DS=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],MS=Me("folder-open",DS);const AS=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Mx=Me("folder-plus",AS);const kS=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ha=Me("folder",kS);const LS=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],fd=Me("git-branch",LS);const US=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],HS=Me("git-commit-horizontal",US);const BS=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Ng=Me("github",BS);const $S=[["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"}]],qS=Me("globe",$S);const YS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],GS=Me("info",YS);const VS=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],KS=Me("laptop",VS);const XS=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],QS=Me("list-filter",XS);const ZS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],wa=Me("loader-circle",ZS);const FS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],JS=Me("menu",FS);const PS=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],IS=Me("monitor",PS);const WS=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],e2=Me("moon",WS);const t2=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Tr=Me("package",t2);const a2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],n2=Me("panel-left",a2);const l2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],md=Me("pencil",l2);const r2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ax=Me("plus",r2);const s2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],kx=Me("refresh-cw",s2);const i2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hd=Me("search",i2);const o2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],c2=Me("settings",o2);const u2=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],d2=Me("share-2",u2);const f2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],m2=Me("sparkles",f2);const h2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],p2=Me("sun",h2);const g2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Lx=Me("trash-2",g2);const x2=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],pd=Me("upload",x2);const y2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],b2=Me("users",y2);const v2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ul=Me("x",v2),kl=No(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:l=>n({status:l}),fetchDaemonStatus:async()=>{try{const l=await _t.get("/daemons/status");n({onlineCount:l.online_count,connections:l.connections})}catch{}}})),S2=n=>n==="connecting"?"disconnected":n;Fa.onStatusChange(n=>{kl.getState().setStatus(S2(n))});Fa.on("ws:daemon:connected",n=>{const l=n;kl.setState(s=>{if(s.connections.some(m=>m.machine_id===l.machine_id))return s;const o={machine_id:l.machine_id};l.lib_id&&(o.lib_id=l.lib_id);const u=[...s.connections,o];return{connections:u,onlineCount:u.length}})});Fa.on("ws:daemon:status",n=>{const l=n;kl.setState(s=>{if(l.is_online){if(s.connections.some(p=>p.machine_id===l.machine_id))return s;const u={machine_id:l.machine_id};l.lib_id&&(u.lib_id=l.lib_id);const m=[...s.connections,u];return{connections:m,onlineCount:m.length}}const i=s.connections.filter(o=>o.machine_id!==l.machine_id);return{connections:i,onlineCount:i.length}})});const wg=n=>Symbol.iterator in n,Eg=n=>"entries"in n,Cg=(n,l)=>{const s=n instanceof Map?n:new Map(n.entries()),i=l instanceof Map?l:new Map(l.entries());if(s.size!==i.size)return!1;for(const[o,u]of s)if(!i.has(o)||!Object.is(u,i.get(o)))return!1;return!0},_2=(n,l)=>{const s=n[Symbol.iterator](),i=l[Symbol.iterator]();let o=s.next(),u=i.next();for(;!o.done&&!u.done;){if(!Object.is(o.value,u.value))return!1;o=s.next(),u=i.next()}return!!o.done&&!!u.done};function j2(n,l){return Object.is(n,l)?!0:typeof n!="object"||n===null||typeof l!="object"||l===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(l)?!1:wg(n)&&wg(l)?Eg(n)&&Eg(l)?Cg(n,l):_2(n,l):Cg({entries:()=>Object.entries(n)},{entries:()=>Object.entries(l)})}function Hl(n){const l=Er.useRef(void 0);return s=>{const i=n(s);return j2(l.current,i)?l.current:l.current=i}}function gd(){const{t:n}=Te(),l=kl(m=>m.onlineCount),s=kl(m=>m.connections.length);if(Pt(Hl(nS)).length===0)return null;const o=l>0,u=o?n("sources.header.daemon_status",{online:l,total:s}):n("sources.header.all_offline");return f.jsxs("div",{className:"group relative flex items-center",title:u,children:[f.jsx("span",{className:`inline-block h-[7px] w-[7px] rounded-full ${o?"bg-c4a-success":"bg-c4a-error"}`}),f.jsx("span",{className:"pointer-events-none absolute right-full mr-2 hidden whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-xs text-c4a-text-secondary shadow-c4a-md group-hover:block",children:u})]})}const Rg=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function N2(){const{t:n}=Te(),[l,s]=y.useState(!1);return f.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[f.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[f.jsxs(Na,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),f.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[f.jsx("nav",{className:"flex items-center gap-4",children:Rg.map(({to:i,labelKey:o})=>f.jsx(ks,{to:i,end:i==="/",className:({isActive:u})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(gd,{}),f.jsx(Na,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})]}),f.jsx("button",{onClick:()=>s(!l),className:"text-c4a-text-secondary md:hidden",children:l?f.jsx(Ul,{size:20}):f.jsx(JS,{size:20})})]}),l&&f.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[f.jsx("nav",{className:"flex flex-col gap-2",children:Rg.map(({to:i,labelKey:o})=>f.jsx(ks,{to:i,end:i==="/",onClick:()=>s(!1),className:({isActive:u})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(gd,{}),f.jsx(Na,{to:"/login",onClick:()=>s(!1),className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})})]})]})}function w2(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function Ux(n){if(typeof window>"u")return;const l=w2(n);document.documentElement.setAttribute("data-theme",l),localStorage.setItem("theme",n)}function E2(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const Hx=No(n=>({theme:E2(),setTheme:l=>{Ux(l),n({theme:l})}}));let Tg=!1;function C2(){if(Tg||typeof window>"u")return;Tg=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{const{theme:s}=Hx.getState();s==="system"&&Ux("system")};n.addEventListener("change",l)}C2();const R2=[{mode:"light",icon:p2,labelKey:"footer.theme.light"},{mode:"dark",icon:e2,labelKey:"footer.theme.dark"},{mode:"system",icon:IS,labelKey:"footer.theme.system"}];function Bx(){const{t:n}=Te(),{theme:l,setTheme:s}=Hx();return f.jsx("div",{className:"flex items-center gap-1",children:R2.map(({mode:i,icon:o,labelKey:u})=>f.jsx("button",{onClick:()=>s(i),title:n(u),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${l===i?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:f.jsx(o,{size:14})},i))})}function $x(){const{i18n:n}=Te(),l=()=>{const s=n.language==="en"?"zh":"en";n.changeLanguage(s)};return f.jsx("button",{onClick:l,className:"cursor-pointer rounded px-2 py-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-secondary hover:bg-c4a-bg-hover",children:n.language==="en"?"CN":"EN"})}function qx({compact:n}){const{t:l}=Te(),s=new Date().getFullYear(),i=n?"footer.copyright_compact":"footer.copyright";return f.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:l(i,{year:s})})}const T2="_brandIcon_1c7st_1",z2="_iconPulse_1c7st_35",zg={brandIcon:T2,iconPulse:z2};function O2({variant:n}){const{t:l}=Te(),s=n==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return f.jsx("footer",{className:`border-t border-c4a-border-subtle ${s} px-4 py-4`,children:f.jsxs("div",{className:"flex items-end justify-between gap-4",children:[f.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[f.jsx("div",{className:zg.brandIcon,children:f.jsx("span",{className:zg.iconPulse,children:"C4A"})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:l("footer.tagline")})]})]}),f.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Bx,{}),f.jsx($x,{})]}),f.jsx(qx,{})]})]})})}function D2(){return f.jsxs("div",{className:"flex min-h-screen flex-col",children:[f.jsx(N2,{}),f.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:f.jsx(jx,{})}),f.jsx(O2,{})]})}function M2({onToggleSidebar:n}){const{t:l}=Te();return f.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:f.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("button",{onClick:n,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:f.jsx(n2,{size:20})}),f.jsxs(Na,{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(Na,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(gd,{}),f.jsx(Na,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:l("nav.login")})]})]})})}const A2=n=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${n?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,k2=[{to:"/studio/modeling",icon:fS,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:hS,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:hd,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:d2,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:b2,i18nKey:"studio.sidebar.collaboration"},{to:"/studio/settings",icon:c2,i18nKey:"studio.sidebar.settings"}];function Og({onNavigate:n}){const{t:l}=Te(),s=Ja(),i=Mn(),o=Pt(Hl(Or)),u=s.pathname.startsWith("/studio/sources")||s.pathname.startsWith("/studio/source/"),[m,p]=y.useState(u);y.useEffect(()=>{u&&p(!0)},[u]);const g=h=>h.id===ol?l("sources.library.default_cloud_name"):h.name;return f.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("nav",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"group/sources",children:[f.jsxs("button",{onClick:()=>p(h=>!h),className:`flex w-full cursor-pointer items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[f.jsx(_S,{size:14}),l("studio.sidebar.sources"),f.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"rounded p-0.5 text-c4a-text-muted opacity-0 transition-all hover:bg-c4a-bg-hover max-md:opacity-100 group-hover/sources:opacity-100 group-hover/sources:text-c4a-accent",title:l("sources.menu.add_client"),children:f.jsx(Ax,{size:12})}),f.jsx(ra,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&f.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(h=>{const v=g(h);return f.jsxs(ks,{to:`/studio/sources/${h.id}`,onClick:n,className:({isActive:b})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${b?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[h.type==="cloud"?f.jsx(bS,{size:13,className:"shrink-0 opacity-60"}):f.jsx(KS,{size:13,className:"shrink-0 opacity-60"}),f.jsx("span",{className:"truncate",children:v}),h.type==="daemon"&&f.jsx("span",{className:`ml-auto h-[7px] w-[7px] shrink-0 rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`})]},h.id)})})]}),k2.map(({to:h,icon:v,i18nKey:b})=>f.jsxs(ks,{to:h,onClick:n,className:({isActive:_})=>A2(_),children:[f.jsx(v,{size:14}),l(b)]},h))]}),f.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(Bx,{}),f.jsx($x,{})]}),f.jsx(qx,{compact:!0})]})]})}function L2(){const[n,l]=y.useState(!1);return y.useEffect(()=>{Pt.getState().fetchLibraries(),kl.getState().fetchDaemonStatus()},[]),y.useEffect(()=>Fa.onStatusChange(s=>{s==="connected"&&(Pt.getState().fetchLibraries(),kl.getState().fetchDaemonStatus())}),[]),f.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[f.jsx(M2,{onToggleSidebar:()=>l(!n)}),f.jsxs("div",{className:"flex min-h-0 flex-1",children:[f.jsx("div",{className:"hidden md:block",children:f.jsx(Og,{})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>l(!1)}),f.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:f.jsx(Og,{onNavigate:()=>l(!1)})})]}),f.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:f.jsx(jx,{})})]})]})}function U2(){const{t:n}=Te();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[f.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:n("home.hero.title")}),f.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:n("home.hero.description")}),f.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[f.jsxs(Na,{to:"/studio",className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[n("home.hero.cta.studio"),f.jsx(zx,{size:14})]}),f.jsx("a",{href:"https://github.com/context4ai/c4a",target:"_blank",rel:"noopener noreferrer",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("home.hero.cta.github")})]})]})}function qa({title:n,version:l,description:s}){const{t:i}=Te();return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-md text-center",children:[f.jsx("h2",{className:"font-mono text-2xl font-bold uppercase text-c4a-text-primary",children:n}),l&&f.jsx("span",{className:"mt-3 inline-block rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1 font-mono text-xs uppercase text-c4a-accent",children:i("placeholder.coming",{version:l})}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:s})]})})}function H2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.login.title"),version:"0.5.0",description:n("page.login.description")})}function B2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function $2(){const{t:n}=Te();return f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n("notfound.title")}),f.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:n("notfound.description")}),f.jsx(Na,{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 q2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function Y2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function G2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function V2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function K2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}function X2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.settings.title"),version:"0.5.x",description:n("page.settings.description")})}function Q2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function Z2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function F2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function J2(){const{t:n}=Te();return f.jsx(qa,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const Eo=(n,l)=>{for(const s of n){if(s.path===l)return s;if(s.children){const i=Eo(s.children,l);if(i)return i}}return null},P2=(n,l)=>l===""?n:Eo(n,l)?.children??[],Yx=(n,l)=>{if(!l)return[];const s=l.split("/"),i=[];let o="";for(const u of s){o=o?`${o}/${u}`:u;const m=Eo(n,o);m&&i.push(m)}return i},Co=No(n=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:l,limit:s,offset:i})=>{n({loading:!0,error:null});try{const o={library_id:l};s!==void 0&&(o.limit=String(s)),i!==void 0&&(o.offset=String(i));const u=await _t.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 _t.get(`/sources/${l}`);return n({currentRoot:s}),s},createSource:async l=>await _t.post("/sources",l),addTreeNode:async(l,s)=>{const i=await _t.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 _t.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 _t.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 _t.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 _t.post("/sources/upload",l),setFilter:l=>n({filter:l}),clearSources:()=>n({rootSources:[],currentRoot:null,total:0,offset:0})}));function Dr({segments:n}){const{t:l}=Te(),s=y.useRef(null),i=y.useRef(null),[o,u]=y.useState(0),m=[{label:l("sources.breadcrumb.sources")},...n],p=Math.max(0,m.length-3);y.useEffect(()=>{const h=s.current,v=i.current;if(!h||!v)return;const b=()=>{const j=h.clientWidth,R=Array.from(v.children);if(R.length===0)return;const T=R.map(J=>J.offsetWidth),A=4;if(T.reduce((J,w)=>J+w,0)+A*(T.length-1)<=j){u(0);return}const Z=20,Y=(T[0]??0)+(T[1]??0)+A,K=T[T.length-1]??0,X=Y+A+Z+A+K;let ne=p;for(let J=1;J<=p;J++){let w=0;for(let H=2+J;H<T.length-1;H++)w+=T[H]+A;if(X+w<=j){ne=J;break}}u(ne)};b();const _=new ResizeObserver(b);return _.observe(h),()=>_.disconnect()},[p,n,l]);const g=(()=>{if(o===0||m.length<=3)return m;const h=m.slice(0,2),v=m[m.length-1],b=m.slice(2+o,m.length-1);return[...h,{label:"…"},...b,v]})();return f.jsxs("div",{ref:s,className:"relative min-w-0 overflow-hidden",children:[f.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs text-c4a-text-muted",children:g.map((h,v)=>{const b=v===g.length-1;return f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&f.jsx(ra,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!b?f.jsx(Na,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):f.jsx("span",{className:`whitespace-nowrap ${b?"text-c4a-text-primary":""}`,children:h.label})]},v)})}),f.jsx("div",{ref:i,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 items-center gap-1 overflow-visible whitespace-nowrap font-mono text-xs",children:m.map((h,v)=>f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&f.jsx(ra,{size:12}),f.jsx("span",{className:"whitespace-nowrap",children:h.label})]},v))})]})}const I2=["all","indexed","not_indexed"];function W2({value:n,onChange:l}){const{t:s}=Te(),[i,o]=y.useState(!1),u=y.useRef(null),m=y.useRef(null),p={all:s("sources.filter.all"),indexed:s("sources.filter.indexed"),not_indexed:s("sources.filter.not_indexed")},g=y.useCallback(b=>{u.current&&!u.current.contains(b.target)&&o(!1)},[]);y.useEffect(()=>{if(i)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i,g]);const h=y.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),o(!0)},[]),v=y.useCallback(()=>{m.current=setTimeout(()=>o(!1),150)},[]);return f.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(QS,{size:12}),f.jsx("span",{className:"hidden sm:inline",children:p[n]}),f.jsx(ra,{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:I2.map(b=>f.jsxs("button",{onClick:()=>{l(b),o(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${b===n?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx(Al,{size:12,className:b===n?"opacity-100":"opacity-0"}),p[b]]},b))})]})}function Gx({currentName:n,onConfirm:l,onCancel:s,error:i}){const[o,u]=y.useState(n),m=y.useRef(null);y.useEffect(()=>{m.current?.select()},[]);const p=y.useCallback(()=>{const h=o.trim();h&&h!==n?l(h):s()},[o,n,l,s]),g=y.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),p()):h.key==="Escape"&&s()},[p,s]);return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,onBlur:p,className:"min-w-0 flex-1 rounded border border-c4a-accent bg-c4a-bg-surface px-2 py-1 text-sm text-c4a-text-primary outline-none",autoFocus:!0}),f.jsx("button",{onClick:h=>{h.stopPropagation(),p()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:f.jsx(Al,{size:14})}),f.jsx("button",{onClick:h=>{h.stopPropagation(),s()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:f.jsx(Ul,{size:14})}),i&&f.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:i})]})}const e_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),t_=new Set([".ts",".tsx",".md"]),a_=new Set([".md",".doc",".docx",".pdf",".ppt",".pptx",".txt"]),n_=new Set([".md",".txt"]),l_=5*1024*1024,r_=10;function xd(n){const l=n.lastIndexOf(".");return l>=0?n.slice(l).toLowerCase():""}function s_(n){const l=n.includes("/")?n.split("/").pop():n;if(e_.has(l.toLowerCase()))return!0;const s=xd(l);return t_.has(s)}const i_=n=>{const l=new Date(n);if(Number.isNaN(l.getTime()))return"";const s=o=>String(o).padStart(2,"0"),i=`${s(l.getMonth()+1)}-${s(l.getDate())} ${s(l.getHours())}:${s(l.getMinutes())}`;return l.getFullYear()===new Date().getFullYear()?i:`${l.getFullYear()}-${i}`},Dg={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function o_({source:n,isDaemonLibrary:l,isRepoRoot:s}){const{t:i}=Te(),o=n.kind==="source",u=o&&(n.source_type==="code"||s_(n.name)),m=u?"text-c4a-accent":"text-c4a-text-secondary group-hover:text-c4a-accent",p=n.metadata?.origin==="remote";let g;if(n.kind==="folder"?g=s||p?f.jsx(wo,{size:16,className:`shrink-0 ${m}`}):l?f.jsx(MS,{size:16,className:`shrink-0 ${m}`}):f.jsx(Ha,{size:16,className:`shrink-0 ${m}`}):n.source_type==="code"?g=f.jsx(Tr,{size:16,className:`shrink-0 ${m}`}):g=f.jsx(il,{size:16,className:`shrink-0 ${m}`}),!o||!u)return f.jsx(f.Fragment,{children:g});const h=Dg[n.index_status]??Dg.none,v=i(`sources.status.${n.index_status}`);return f.jsxs("span",{className:"group/dot relative shrink-0",children:[g,f.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${h}`}),f.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-[10px] text-c4a-text-secondary opacity-0 shadow-lg transition-opacity group-hover/dot:opacity-100",children:v})]})}function Mg({source:n,displayName:l,childCount:s,isDaemonLibrary:i,isRepoRoot:o,hasUpdate:u,onClick:m,onRename:p,onDelete:g}){const{t:h}=Te(),[v,b]=y.useState(!1),[_,j]=y.useState(null),R=y.useCallback(async Y=>{if(!p)return;const K=await p(Y);K?j(K):(b(!1),j(null))},[p]),T=y.useCallback(()=>{b(!1),j(null)},[]),A=!o&&p,G=g,Z=n.updated_at||n.created_at;return f.jsxs("div",{className:"group flex cursor-pointer items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent",onClick:v?void 0:m,children:[f.jsx(o_,{source:n,isDaemonLibrary:i??!1,isRepoRoot:o??!1}),v?f.jsx("div",{className:"min-w-0 flex-1",onClick:Y=>Y.stopPropagation(),children:f.jsx(Gx,{currentName:n.name,onConfirm:R,onCancel:T,error:_})}):f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-secondary group-hover:text-c4a-accent",children:l??n.name}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-tight text-c4a-accent/60",children:[f.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-c4a-accent"}),h("sources.change_detection.has_updates")]}),n.kind==="folder"&&s!==void 0&&f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:s})}),Z&&f.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:i_(Z)})]}),(A||G)&&f.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[A?f.jsx("button",{title:h("sources.actions.rename"),onClick:Y=>{Y.stopPropagation(),b(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(md,{size:14})}):G?f.jsx("span",{className:"p-1",children:f.jsx("span",{className:"inline-block h-[14px] w-[14px]"})}):null,G&&f.jsx("button",{title:h("sources.actions.delete"),onClick:Y=>{Y.stopPropagation(),g()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(Lx,{size:14})})]})]})}function Bl({children:n,onClose:l,className:s="",overlayClass:i="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:u=!0,disableClose:m=!1}){const p=y.useRef(null);y.useEffect(()=>{if(!u)return;const h=v=>{v.key==="Escape"&&!m&&l()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[l,u,m]);const g=y.useCallback(h=>{o&&!m&&p.current&&!p.current.contains(h.target)&&l()},[l,o,m]);return f.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${i}`,onClick:g,children:f.jsx("div",{ref:p,className:s,children:n})})}function Ag({target:n,onConfirm:l,onCancel:s}){const{t:i}=Te();return f.jsxs(Bl,{onClose:s,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.delete.confirm_title")}),f.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[n.type==="resource"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.resource",{name:n.name})}),f.jsx("p",{children:i("sources.delete.resource_impact")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.session_warning")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="folder"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder",{name:n.name})}),n.folderCount!==void 0&&n.sourceCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder_contents",{folders:n.folderCount,sources:n.sourceCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.sourceCount})})]}):f.jsx("p",{children:i("sources.delete.folder_impact_generic")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")})]}),n.type==="repo"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo",{name:n.name,library:n.libraryName})}),n.packageCount!==void 0&&n.docCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo_contents",{packages:n.packageCount,docs:n.docCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.packageCount+n.docCount})})]}):f.jsx("p",{children:i("sources.delete.repo_impact_generic")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="client"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.client",{name:n.name})}),f.jsx("p",{children:i("sources.delete.client_impact")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")}),f.jsx("p",{className:"text-c4a-text-muted",children:i("sources.delete.client_reregister")})]})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:s,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:l,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:i("common.confirm")})]})]})}function c_({onConfirm:n,onCancel:l,error:s}){const{t:i}=Te(),[o,u]=y.useState(""),m=y.useRef(null);y.useEffect(()=>{m.current?.focus()},[]);const p=y.useCallback(()=>{const h=o.trim();h&&n(h)},[o,n]),g=y.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),p())},[p]);return f.jsxs(Bl,{onClose:l,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Mx,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.actions.new_folder")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,placeholder:i("sources.folder.name_placeholder"),className:"w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 text-sm text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent",autoFocus:!0}),s&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:s})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:p,disabled:!o.trim(),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:i("common.confirm")})]})]})}function Iu({label:n,icon:l,items:s,alignRight:i}){const[o,u]=y.useState(!1),m=y.useRef(null),p=y.useRef(null),g=y.useCallback(b=>{m.current&&!m.current.contains(b.target)&&u(!1)},[]);y.useEffect(()=>{if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,g]);const h=y.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),v=y.useCallback(()=>{p.current=setTimeout(()=>u(!1),150)},[]);return f.jsxs("div",{ref:m,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:`flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${n?"p-1 sm:px-2 sm:py-1":"p-1"}`,children:[l,n&&f.jsx("span",{className:"hidden sm:inline",children:n}),n&&f.jsx(ra,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&f.jsx("div",{className:`absolute top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${i?"right-0":"left-0"}`,children:s.map(b=>f.jsxs("button",{onClick:()=>{b.onClick(),u(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[b.icon,b.label]},b.label))})]})}function u_({onClose:n}){const{t:l}=Te();return f.jsxs(Bl,{onClose:n,closeOnEsc:!1,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(m2,{size:18,className:"text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("sources.upgrade.title")})]}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("sources.upgrade.description")}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:n,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("common.confirm")})})]})}function d_(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function f_({onConfirm:n,onCancel:l,error:s,uploading:i}){const{t:o}=Te(),[u,m]=y.useState([]),[p,g]=y.useState(null),[h,v]=y.useState(!1),b=y.useRef(null),_=y.useCallback(K=>{g(null);for(const X of K){const ne=xd(X.name);if(!a_.has(ne)){g(o("sources.upload.unsupported_type",{name:X.name}));return}if(X.size>l_){g(o("sources.upload.file_too_large",{name:X.name}));return}}m(X=>{const ne=new Map(X.map(w=>[w.name,w]));for(const w of K)ne.set(w.name,{name:w.name,size:w.size,file:w});const J=Array.from(ne.values());return J.length>r_?(g(o("sources.upload.too_many_files")),X):J})},[o]),j=y.useCallback(K=>{const X=K.target.files;!X||X.length===0||(_(Array.from(X)),K.target.value="")},[_]),R=y.useCallback(K=>{m(X=>X.filter((ne,J)=>J!==K)),g(null)},[]),T=y.useCallback(K=>{K.preventDefault(),v(!1);const X=K.dataTransfer?.files;!X||X.length===0||_(Array.from(X))},[_]),A=y.useCallback(K=>{K.preventDefault(),v(!0)},[]),G=y.useCallback(K=>{K.preventDefault(),v(!1)},[]),Z=y.useCallback(async()=>{if(u.length===0)return;const K=await Promise.all(u.map(X=>new Promise((ne,J)=>{const w=xd(X.name),H=n_.has(w),ee=new FileReader;ee.onerror=()=>J(ee.error),H?(ee.onload=()=>ne({name:X.name,content:ee.result,encoding:"utf-8"}),ee.readAsText(X.file)):(ee.onload=()=>{const de=ee.result,ce=de.slice(de.indexOf(",")+1);ne({name:X.name,content:ce,encoding:"base64"})},ee.readAsDataURL(X.file))})));n(K)},[u,n]),Y=s||p;return f.jsxs(Bl,{onClose:l,disableClose:i??!1,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(pd,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:b,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:j,className:"hidden"}),f.jsxs("button",{type:"button",onClick:()=>b.current?.click(),onDrop:T,onDragOver:A,onDragLeave:G,disabled:i,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${h?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${i?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[f.jsx(pd,{size:24,className:"text-c4a-text-muted"}),f.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),f.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),u.length>0&&f.jsxs("div",{className:"mt-3",children:[f.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:u.length})}),f.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:u.map((K,X)=>f.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[f.jsx(il,{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:K.name}),f.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:d_(K.size)}),!i&&f.jsx("button",{type:"button",onClick:()=>R(X),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:f.jsx(Ul,{size:12})})]},`${K.name}-${X}`))})]}),Y&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:Y}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,disabled:i,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:o("common.cancel")}),f.jsxs("button",{onClick:Z,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(wa,{size:12,className:"animate-spin"}),o(i?"sources.upload.uploading":"common.confirm")]})]})]})}function m_({pathLabel:n,loading:l,badge:s,onNavigateUp:i,children:o}){return f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-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:[f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:n}),s]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),f.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:l?f.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:f.jsx(wa,{size:14,className:"animate-spin text-c4a-text-muted"})}):f.jsxs(f.Fragment,{children:[i&&f.jsxs("button",{onClick:i,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Ha,{size:16,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{children:".."})]}),o]})})]})}function h_(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 p_(n,l){return`${n}/tree/${encodeURIComponent(l)}`}function g_(n,l){return`${n}/commit/${l}`}function Vx({remoteUrl:n,fallbackName:l,branch:s,commit:i}){const o=n?h_(n):null,u=i.slice(0,7);return f.jsxs("div",{className:"flex min-w-0 shrink flex-wrap items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent",children:[o?f.jsxs("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:o.repoUrl,children:[f.jsx(Ng,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:o.slug})]}):f.jsxs("span",{className:"flex items-center gap-1 truncate",children:[f.jsx(Ng,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:l||"repo"})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?f.jsxs("a",{href:p_(o.repoUrl,s),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[f.jsx(fd,{size:10,className:"shrink-0"}),f.jsx("span",{children:s})]}):f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(fd,{size:10,className:"shrink-0"}),f.jsx("span",{children:s})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?f.jsx("a",{href:g_(o.repoUrl,i),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:u}):f.jsx("span",{children:u})]})}function x_(n,l,s){const[i,o]=y.useState({}),u=y.useRef(new Set);return y.useEffect(()=>{if(!n||!l||s.length===0)return;const m=s.filter(p=>{const g=p.metadata;return g?.origin==="remote"&&g?.remote_url&&g?.remote_commit&&!u.current.has(p.id)});if(m.length!==0){m.forEach(p=>u.current.add(p.id));for(const p of m){const g=p.metadata;_t.post("/import/remote/refs",{library_id:n,url:g.remote_url}).then(h=>{const v=g.remote_ref||"",b=h.branches?.find(_=>_.name===v)??h.tags?.find(_=>_.name===v);b&&b.commit!==g.remote_commit&&o(_=>({..._,[p.id]:!0}))}).catch(()=>{})}}},[n,l,s]),i}function y_({library:n,onNewFolder:l,onImportRepo:s,onImportDir:i,onUpgrade:o}){const{t:u}=Te(),m=n.type==="daemon";return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-2xl text-center",children:[f.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:u(m?"sources.empty.daemon.title":"sources.empty.cloud.title")}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:u(m?"sources.empty.daemon.description":"sources.empty.cloud.description")}),f.jsx("div",{className:"mt-6 flex justify-center gap-3",children:m?f.jsxs(f.Fragment,{children:[i&&f.jsx("button",{onClick:i,disabled:!n.is_online,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:u("sources.actions.import_dir")}),s&&f.jsx("button",{onClick:s,disabled:!n.is_online,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:u("sources.actions.import_repo")})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:u("sources.actions.new_folder")}),o&&f.jsx("button",{onClick:o,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:u("sources.actions.import_repo_url")})]})})]})})}function b_(){const{t:n}=Te();return f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[f.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.empty.indexed.title")}),f.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:n("sources.empty.indexed.description")})]})}const Wu=n=>{let l=0,s=0,i=0,o=0,u=0;const m=p=>{for(const g of p.children??[])g.kind==="folder"?(l++,m(g)):g.kind==="source"&&(s++,g.source_type==="code"?i++:o++,(g.index_status==="indexed"||g.index_status==="stale")&&u++)};return m(n),{folders:l,sources:s,codeSources:i,docSources:o,indexedSources:u}};function v_(){const{t:n}=Te(),l=Mn(),{libId:s}=$s(),[i,o]=jo(),u=i.get("rootId")||null,m=i.get("path")||"",g=Pt(Hl(Or)).find(te=>te.id===s),h=Pt(te=>te.updateLibraryName),v=Pt(te=>te.deleteLibrary),{rootSources:b,currentRoot:_,loading:j,filter:R,fetchRootSources:T,fetchRootSource:A,createSource:G,addTreeNode:Z,updateSource:Y,deleteSource:K,deleteTreeNode:X,uploadDoc:ne,setFilter:J}=Co(),[w,H]=y.useState(!1),[ee,de]=y.useState(null),[ce,re]=y.useState(null),[ue,me]=y.useState(null),[M,I]=y.useState(null),[ie,P]=y.useState(!1),[be,N]=y.useState(!1),[$,F]=y.useState(null),[le,pe]=y.useState(!1),[_e,ze]=y.useState(!1),[at,Le]=y.useState(null),[It,ia]=y.useState(!1);y.useEffect(()=>{s&&T({library_id:s})},[s,T]),y.useEffect(()=>{u&&A(u)},[u,A]);const mt=u!==null,Ie=y.useMemo(()=>mt?_?[...P2(_.tree,m)].sort((Fe,Nt)=>Fe.kind!==Nt.kind?Fe.kind==="folder"?-1:1:Fe.name.localeCompare(Nt.name)).map(Fe=>({type:"node",root:_,node:Fe})):[]:[...b].sort((Nt,Je)=>Nt.kind!==Je.kind?Nt.kind==="folder"?-1:1:new Date(Je.created_at).getTime()-new Date(Nt.created_at).getTime()).map(Nt=>({type:"root",root:Nt,node:null})),[mt,b,_,m]),ht=y.useMemo(()=>R==="all"?Ie:Ie.filter(te=>te.type==="root"||!te.node||te.node.kind==="folder"?!0:R==="indexed"?te.node.index_status==="indexed":te.node.index_status==="none"||!te.node.index_status),[Ie,R]),Dt=g?.type==="daemon",Xt=g?.type==="cloud",Wt=Dt&&!mt,$t=x_(s,Xt,b),ea=y.useMemo(()=>{if(!g)return[];const te=[{label:g.id===ol?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];return mt&&_&&(te.push({label:_.name,to:`/studio/sources/${g.id}?rootId=${_.id}`}),m&&Yx(_.tree,m).forEach(Fe=>{te.push({label:Fe.name,to:`/studio/sources/${g.id}?rootId=${_.id}&path=${encodeURIComponent(Fe.path)}`})})),te},[g,mt,_,m,n]),oa=y.useCallback(async te=>{if(s)try{mt&&u?await Z(u,{parent_path:m,kind:"folder",name:te}):(await G({library_id:s,kind:"folder",name:te}),T({library_id:s})),H(!1),de(null)}catch(ge){ge instanceof Ol&&ge.status===409&&de(n("sources.error.name_conflict",{name:te}))}},[s,mt,u,m,G,Z,T,n]),ca=y.useCallback(te=>{s&&(te.type==="root"?te.root.kind==="source"?l(`/studio/source/${te.root.id}`):o({rootId:te.root.id}):te.node&&(te.node.kind==="folder"?o({rootId:te.root.id,path:te.node.path}):l(`/studio/source/${te.root.id}?path=${encodeURIComponent(te.node.path)}`)))},[s,l,o]),cn=y.useCallback(()=>{if(!(!u||!s))if(m){const te=m.split("/");te.pop();const ge=te.join("/");o(ge?{rootId:u,path:ge}:{rootId:u})}else o({})},[u,s,m,o]),un=y.useCallback(async(te,ge)=>{try{return await Y(te,{name:ge}),T({library_id:s}),null}catch(Fe){return Fe instanceof Ol&&Fe.status===409?n("sources.error.name_conflict",{name:ge}):null}},[s,Y,T,n]),jt=y.useCallback(te=>{if(te.type==="root"){me(te.root.id),I(null);const ge=te.root.tree.length>0?Wu({children:te.root.tree}):void 0;re(Dt?{type:"repo",name:te.root.name,libraryName:g.name,...ge?{packageCount:ge.codeSources,docCount:ge.docSources,indexedCount:ge.indexedSources}:{}}:{type:te.root.kind==="folder"?"folder":"resource",name:te.root.name,...te.root.kind==="folder"&&ge?{folderCount:ge.folders,sourceCount:ge.sources,indexedCount:ge.indexedSources}:{}})}else if(te.node)if(me(te.root.id),I(te.node.path),te.node.kind==="folder"){const ge=Wu(te.node);re({type:"folder",name:te.node.name,folderCount:ge.folders,sourceCount:ge.sources,indexedCount:ge.indexedSources})}else re({type:"resource",name:te.node.name})},[Dt,g]),Gt=y.useCallback(async()=>{if(!(!ue||!s)){try{M?await X(ue,M):(await K(ue),T({library_id:s}))}catch{}re(null),me(null),I(null)}},[ue,M,s,K,X,T]),Se=y.useCallback(()=>{if(!s)return;const te=new URLSearchParams;u&&te.set("parentId",u),m&&te.set("parentPath",m);const ge=te.toString();l(`/studio/sources/import/${s}${ge?`?${ge}`:""}`)},[s,l,u,m]),Be=y.useCallback(()=>{s&&l(`/studio/sources/import-dir/${s}`)},[s,l]),Ye=y.useCallback(async te=>{if(s){pe(!0),F(null);try{const ge={library_id:s,files:te.map(Fe=>{const Nt={file_name:Fe.name,content:Fe.content};return Fe.encoding&&(Nt.encoding=Fe.encoding),Nt})};mt&&u&&(ge.root_source_id=u,ge.parent_path=m),await ne(ge),mt&&u?A(u):T({library_id:s}),N(!1)}catch(ge){ge instanceof Ol&&ge.status===409?F(n("sources.error.name_conflict",{name:te[0]?.name??""})):ge instanceof Ol&&F(ge.message)}finally{pe(!1)}}},[s,mt,u,m,ne,T,A,n]),Mt=g?.id===ol,At=y.useCallback(async te=>{if(s)try{await h(s,te),ze(!1),Le(null)}catch(ge){const Fe=ge instanceof Error?ge.message:String(ge);Le(Fe)}},[s,h]),je=y.useCallback(()=>{ze(!1),Le(null)},[]),Ze=y.useCallback(async()=>{if(s){try{await v(s),l("/studio/sources/add-client")}catch{}ia(!1)}},[s,v,l]),Ae=y.useCallback(()=>{ia(!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 nt=b.length===0&&R==="all"&&!j&&!mt,ut=ht.filter(te=>te.type==="node"&&te.node?.kind==="source").length===0&&R==="indexed"&&!j,vt=!Wt,Pa=Xt,Ia=Wt;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("div",{className:"min-w-0 flex-1",children:_e?f.jsx(Gx,{currentName:g.name,onConfirm:At,onCancel:je,error:at}):f.jsx(Dr,{segments:ea})}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Pa&&f.jsxs(f.Fragment,{children:[f.jsx(Iu,{label:n("sources.actions.upload"),icon:f.jsx(pd,{size:14}),items:[{label:n("sources.actions.upload_doc"),icon:f.jsx(il,{size:14}),onClick:()=>N(!0)}]}),f.jsx(Iu,{label:n("sources.actions.add"),icon:f.jsx(Ax,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:f.jsx(Mx,{size:14}),onClick:()=>H(!0)},{label:n("sources.actions.add_web"),icon:f.jsx(qS,{size:14}),onClick:()=>P(!0)},{label:n("sources.actions.add_feishu"),icon:f.jsx(NS,{size:14}),onClick:()=>P(!0)}]}),f.jsxs("button",{onClick:()=>{const te=new URLSearchParams;u&&te.set("parentId",u),m&&te.set("parentPath",m);const ge=te.toString();l(`/studio/sources/import-remote/${s}${ge?`?${ge}`:""}`)},className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(jg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo_url")})]})]}),Ia&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:Be,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(OS,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_dir")})]}),f.jsxs("button",{onClick:Se,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(jg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo")})]}),f.jsx(Iu,{label:"",icon:f.jsx(md,{size:14}),alignRight:!0,items:[{label:n("sources.library.rename"),icon:f.jsx(md,{size:14}),onClick:()=>ze(!0)},...Mt?[]:[{label:n("sources.actions.delete"),icon:f.jsx(Lx,{size:14}),onClick:()=>ia(!0)}]]})]}),vt&&f.jsx(W2,{value:R,onChange:J})]})]}),nt?f.jsx(y_,{library:g,onNewFolder:()=>H(!0),...Dt?{onImportRepo:Se,onImportDir:Be}:{},...Xt?{onUpgrade:()=>{const te=new URLSearchParams;u&&te.set("parentId",u),m&&te.set("parentPath",m);const ge=te.toString();l(`/studio/sources/import-remote/${s}${ge?`?${ge}`:""}`)}}:{}}):f.jsx(m_,{pathLabel:ea.map(te=>te.label).join(" / "),loading:j,badge:(()=>{if(!mt||!_)return;const te=_.metadata,ge=te?.pinned_branch??te?.remote_ref,Fe=te?.pinned_hash??te?.remote_commit;if(!(!ge||!Fe))return f.jsx(Vx,{remoteUrl:te?.remote_url,fallbackName:_.name,branch:ge,commit:Fe})})(),onNavigateUp:mt?cn:void 0,children:ht.length===0?ut?f.jsx(b_,{}):mt?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:ht.map(te=>{if(te.type==="root"){const Je=te.root,dn=Dt,Ya=dn?Je.metadata?.local_path:void 0,cl=Je.tree.length>0?Wu({children:Je.tree}):void 0,ul=cl?cl.folders+cl.sources:0,Ga=Je.metadata?.origin==="remote";return f.jsx(Mg,{source:{id:Je.id,library_id:Je.library_id,owner_id:Je.owner_id,path:"",kind:Je.kind,source_type:Je.source_type,name:Je.name,content_hash:Je.content_hash,metadata:Je.metadata,index_status:Je.index_status,created_at:Je.created_at,updated_at:Je.updated_at},...typeof Ya=="string"?{displayName:Ya}:{},...Je.kind==="folder"?{childCount:ul}:{},isDaemonLibrary:Dt??!1,isRepoRoot:dn||Ga,...$t[Je.id]?{hasUpdate:!0}:{},onClick:()=>ca(te),...Ga?{}:{onRename:Ca=>un(Je.id,Ca)},onDelete:()=>jt(te)},Je.id)}const ge=te.node,Fe=`${te.root.id}:${ge.path}`,Nt=ge.kind==="folder"?ge.children?.length??0:void 0;return f.jsx(Mg,{source:{id:te.root.id,library_id:te.root.library_id,owner_id:te.root.owner_id,path:ge.path,kind:ge.kind,source_type:ge.source_type??null,name:ge.name,content_hash:null,metadata:ge.metadata??null,index_status:ge.index_status??"none",created_at:te.root.created_at,updated_at:te.root.updated_at},...Nt!==void 0?{childCount:Nt}:{},isDaemonLibrary:Dt??!1,onClick:()=>ca(te),...Xt&&te.root.metadata?.origin!=="remote"?{onDelete:()=>jt(te)}:{}},Fe)})})}),w&&f.jsx(c_,{onConfirm:oa,onCancel:()=>{H(!1),de(null)},error:ee}),be&&f.jsx(f_,{onConfirm:Ye,onCancel:()=>{N(!1),F(null)},error:$,uploading:le}),ie&&f.jsx(u_,{onClose:()=>P(!1)}),ce&&f.jsx(Ag,{target:ce,onConfirm:Gt,onCancel:()=>{re(null),me(null),I(null)}}),It&&g&&f.jsx(Ag,{target:{type:"client",name:g.name},onConfirm:Ze,onCancel:Ae})]})}function sn({active:n,current:l}){return f.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${l?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Dl(){return f.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function Kx({libraryName:n}){const{t:l}=Te();return f.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[f.jsx("p",{className:"text-sm text-c4a-warning",children:l("sources.import.daemon_offline",{name:n})}),f.jsx(Na,{to:"/studio/sources/add-client",className:"mt-4 inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("sources.import.view_guide")})]})}function Rd({step:n,totalSteps:l,importing:s,stepBusy:i,canProceed:o,safetyNoticeKey:u,confirmLabelKey:m,onPrev:p,onNext:g,onImport:h}){const{t:v}=Te();return f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[f.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:v(u),onClick:b=>b.currentTarget.classList.toggle("line-clamp-1"),children:v(u)}),f.jsxs("div",{className:"flex shrink-0 gap-2",children:[n>1&&f.jsx("button",{onClick:p,disabled:s||i,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover disabled:opacity-40",children:v("common.previous")}),n<l?f.jsx("button",{onClick:g,disabled:!o||i,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:v("common.next")}):f.jsxs("button",{onClick:h,disabled:s||i||!o,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[s&&f.jsx(wa,{size:12,className:"animate-spin"}),v(s?"sources.import.importing":m)]})]})]})}function Xx(n,l){const s=y.useCallback(async(m,p)=>{if(!n)throw new Error("No library");const g=await _t.post(`/libraries/${n}/rpc`,{method:m,params:p});if(g.error){const h=g.error;throw new Error(h.message??JSON.stringify(g.error))}return g.result??g},[n]),[i,o]=y.useState([]);y.useEffect(()=>{if(!n)return;let m=!1;return(async()=>{try{const p=await _t.get("/sources",{library_id:n,limit:"500"});if(m)return;const g=p.items.map(h=>{const v=h.metadata;return typeof v?.local_path=="string"?v.local_path:null}).filter(h=>h!==null);o(g)}catch{}})(),()=>{m=!0}},[n]);const u=y.useMemo(()=>{const m=l?.config;return!m||!Array.isArray(m.allowed_paths)?[]:m.allowed_paths},[l]);return{rpc:s,importedPaths:i,allowedPaths:u}}function S_(n,l){const s=n.toLowerCase();try{if(s.endsWith("package.json")){const i=JSON.parse(l);if(typeof i.name=="string"&&i.name.trim())return i.name.trim()}if(s.endsWith("pyproject.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("go.mod"))return l.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(s.endsWith("cargo.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("pom.xml"))return l.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(s.endsWith("build.gradle"))return l.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function Qx(n,l,s="repo"){const i=[];for(const u of n){const m=u.path.split("/"),p=m.slice(0,-1).join("/")||".",g=m.length===1||u.path==="package.json",h=p==="."?s:m[m.length-2]||p,v=S_(u.path,u.content);i.push({name:v||h,path:p,isRoot:g})}const o=l.filter(u=>/\.md$/i.test(u.path)).map(u=>u.path);return{packages:i,mdFiles:o}}function zn(n){try{return(new URL(n).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return n.split("/").pop()||n}}function Zx(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}:${String(n.getSeconds()).padStart(2,"0")}`}function Fx(){const{t:n}=Te(),[l,s]=y.useState(!1),[i,o]=y.useState(null),u=y.useRef(),m=y.useRef(),p=window.location.host,g=`c4a-daemon --server ${p} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${p}`,v=y.useCallback((j,R)=>{navigator.clipboard.writeText(j),o(R),clearTimeout(u.current),u.current=setTimeout(()=>o(null),1500)},[]),b=y.useCallback(()=>{clearTimeout(m.current),s(!0)},[]),_=y.useCallback(()=>{m.current=setTimeout(()=>s(!1),150)},[]);return f.jsxs("span",{className:"relative",onMouseEnter:b,onMouseLeave:_,children:[f.jsx(Ox,{size:12,className:"text-c4a-warning"}),l&&f.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:b,onMouseLeave:_,children:[f.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:g}),f.jsx("button",{onClick:()=>v(g,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===0?f.jsx(Al,{size:10}):f.jsx(dd,{size:10})})]}),f.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_all")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),f.jsx("button",{onClick:()=>v(h,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===1?f.jsx(Al,{size:10}):f.jsx(dd,{size:10})})]})]})]})}function Jx({open:n,onClose:l,rpc:s,onNavigate:i,defaultPath:o}){const{t:u}=Te(),[m,p]=y.useState(o??""),[g,h]=y.useState(null),[v,b]=y.useState(!1),_=y.useRef(null);y.useEffect(()=>{o&&!m&&p(o)},[o]);const j=y.useCallback(async()=>{const T=m.trim();if(T){b(!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(A){h(A instanceof Error?A.message:String(A))}finally{b(!1)}}},[m,s,u,i,l]),R=y.useCallback(()=>{p(o??""),h(null),l()},[l,o]);return n?f.jsxs(Bl,{onClose:R,closeOnOverlay:!1,closeOnEsc:!1,overlayClass:"bg-black/40",className:"w-full max-w-md rounded-lg border border-c4a-border-default bg-c4a-bg-surface p-5 shadow-xl",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:u("sources.import.wildcard_go_title")}),f.jsx("button",{onClick:R,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:f.jsx(Ul,{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:v||!m.trim(),className:"flex shrink-0 items-center gap-1.5 rounded bg-c4a-accent px-3 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[v?f.jsx(wa,{size:12,className:"animate-spin"}):f.jsx(zx,{size:12}),u("sources.import.wildcard_go")]})]}),g&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:g})]}):null}function Px({rpc:n,allowedPaths:l,importedPaths:s,onNavigateUpExtra:i}){const o=!!l&&l.length>0,u=o&&l.length===1&&l[0]==="*",[m,p]=y.useState(o),[g,h]=y.useState(o&&!u?"":"/"),[v,b]=y.useState([]),[_,j]=y.useState(!1),[R,T]=y.useState(null),[A,G]=y.useState(null);y.useEffect(()=>{if(o&&!u)return;let H=!1;return(async()=>{try{const ee=await n("fs/homeDir",{});H||G(ee.home_dir)}catch{H||G("/")}})(),()=>{H=!0}},[o,u,n]);const[Z,Y]=y.useState(!1),K=y.useCallback(async H=>{j(!0),T(null);try{const ee=await n("fs/listTree",{path:H,depth:1});b(ee.entries||[]),h(H),p(!1)}catch(ee){const de=ee instanceof Error?ee.message:String(ee);T(de)}finally{j(!1)}},[n]);y.useEffect(()=>{o&&!u||A!==null&&K(A)},[A,o,u,K]);const X=y.useMemo(()=>new Set(s??[]),[s]),ne=y.useCallback(()=>{if(o&&!u&&l.some(de=>de===g)){p(!0),h(""),b([]),T(null),i?.();return}const H=g.split("/").slice(0,-1).join("/")||"/";i?.(),K(H)},[o,u,l,g,K,i]),J=y.useMemo(()=>v.filter(H=>H.type==="directory"),[v]),w=y.useMemo(()=>v.filter(H=>H.type==="file"),[v]);return{atRoot:m,currentPath:g,entries:v,loading:_,error:R,homeDir:A,goToOpen:Z,hasAllowedPaths:o,isWildcard:u,importedSet:X,dirs:J,files:w,loadTree:K,handleNavigateUp:ne,setGoToOpen:Y}}function __({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Te(),[m,p]=y.useState(null),{atRoot:g,currentPath:h,entries:v,loading:b,error:_,homeDir:j,goToOpen:R,isWildcard:T,importedSet:A,dirs:G,files:Z,loadTree:Y,handleNavigateUp:K,setGoToOpen:X}=Px({rpc:n,allowedPaths:i??[],importedPaths:o??[],onNavigateUpExtra:()=>p(null)}),[ne,J]=y.useState(null),[w,H]=y.useState(!1);y.useEffect(()=>{if(!l){J(null),H(!1);return}J(null),H(!0);let re=!1;return(async()=>{try{const ue=await n("fs/repoStatus",{path:l});re||(J({branch:ue.branch,hash:ue.head_hash,remoteUrl:ue.remote_url}),H(!1))}catch{re||(J(null),H(!1))}})(),()=>{re=!0}},[l,n]);const ee=y.useCallback(re=>{if(re.type==="directory")if(re.is_git_repo){if(A.has(re.path))return;p(null),s(re.path,re.name)}else p(re.path),Y(re.path)},[s,Y,A]),de=y.useMemo(()=>G.sort((re,ue)=>re.is_git_repo&&!ue.is_git_repo?-1:!re.is_git_repo&&ue.is_git_repo?1:re.name.localeCompare(ue.name)),[G]),ce=y.useMemo(()=>Z.sort((re,ue)=>re.name.localeCompare(ue.name)),[Z]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[g?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Fx,{})]}):f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),l&&w?f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[f.jsx(wa,{size:12,className:"animate-spin"}),f.jsx("span",{children:u("common.loading")})]}):l&&ne?f.jsx(Vx,{remoteUrl:ne.remoteUrl,fallbackName:l.split("/").pop()||l,branch:ne.branch,commit:ne.hash}):!l&&T&&g?f.jsx("button",{onClick:()=>X(!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:()=>Y(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(Ha,{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(ra,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(re=>f.jsxs("button",{onClick:()=>Y(re),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Ha,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:re}),f.jsx(ra,{size:12,className:"shrink-0 text-c4a-text-muted"})]},re))}):_&&!b?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:[b&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(wa,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&f.jsxs("button",{onClick:K,disabled:b,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(Ha,{size:14}),f.jsx("span",{children:".."})]}),de.map(re=>{const ue=re.is_git_repo&&A.has(re.path),me=re.is_git_repo?wo:Ha;return f.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${ue?"cursor-not-allowed text-c4a-accent/60":l===re.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[f.jsxs("button",{onClick:()=>ee(re),disabled:ue||b,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[f.jsx(me,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate text-left",children:re.name}),ue&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")})]}),!ue&&f.jsx("button",{onClick:M=>{M.stopPropagation(),Y(re.path)},disabled:b,className:"shrink-0 rounded p-1.5 text-c4a-text-muted transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent disabled:pointer-events-none",title:re.path,children:f.jsx(ra,{size:12})})]},re.path)}),ce.map(re=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Dx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:re.name})]},re.path)),v.length===0&&!b&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),m&&!l&&f.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:u("sources.import.not_git")}),f.jsx(Jx,{open:R,onClose:()=>X(!1),rpc:n,onNavigate:Y,defaultPath:j??void 0})]})}const Nr=50,ed=["main","master"];function j_(n){const l=[],s=[];for(const i of n)ed.includes(i.name)?l.push(i):s.push(i);return l.sort((i,o)=>ed.indexOf(i.name)-ed.indexOf(o.name)),[...l,...s]}function kg(n,l,s){y.useEffect(()=>{if(!s)return;const i=o=>{n.current&&!n.current.contains(o.target)&&l()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,l,s])}function Ix({refs:n,loading:l,error:s,selectedRef:i,commit:o,onRefChange:u,onCommitChange:m,onValidChange:p,onRetry:g,onBranchSwitch:h}){const{t:v}=Te(),[b,_]=y.useState(!1),[j,R]=y.useState(""),[T,A]=y.useState(!0),[G,Z]=y.useState(!0),Y=y.useRef(null),K=y.useRef(null),[X,ne]=y.useState(!1),[J,w]=y.useState(""),H=y.useRef(null),ee=y.useRef(null);kg(Y,()=>{_(!1),R("")},b),kg(H,()=>{ne(!1),w("")},X),y.useEffect(()=>{b&&setTimeout(()=>K.current?.focus(),0)},[b]),y.useEffect(()=>{X&&setTimeout(()=>ee.current?.focus(),0)},[X]),y.useEffect(()=>{p(!!i)},[i,p]);const de=y.useCallback(P=>{u(P.name),m(P.commit),_(!1),R(""),h?.(P.name)},[u,m,h]),ce=y.useCallback((P,be)=>{m(P),u(be),ne(!1),w("")},[m,u]),re=y.useMemo(()=>n?j_(n.branches):[],[n]),ue=y.useMemo(()=>{const P=j.toLowerCase();return(P?re.filter(N=>N.name.toLowerCase().includes(P)):re).slice(0,Nr)},[re,j]),me=y.useMemo(()=>{if(!n)return[];const P=j.toLowerCase();return(P?n.tags.filter(N=>N.name.toLowerCase().includes(P)):n.tags).slice(0,Nr)},[n,j]),M=y.useMemo(()=>{if(!n)return[];if(n.commits&&n.commits.length>0){const F=J.toLowerCase(),le=n.commits.map(pe=>({hash:pe.hash,refName:i||"",label:`${pe.hash.slice(0,8)} ${pe.message?`— ${pe.message.slice(0,50)}`:""}`.trim()}));return F?le.filter(pe=>pe.hash.toLowerCase().includes(F)||pe.label.toLowerCase().includes(F)).slice(0,Nr):le.slice(0,Nr)}const P=new Set,be=[],N=[...n.branches??[],...n.tags??[]];for(const F of N){const le=F.commit.slice(0,8);P.has(F.commit)||(P.add(F.commit),be.push({hash:F.commit,refName:F.name,label:`${le} (${F.name})`}))}if(!J)return be.slice(0,Nr);const $=J.toLowerCase();return be.filter(F=>F.hash.toLowerCase().includes($)||F.label.toLowerCase().includes($)).slice(0,Nr)},[n,J,i]);if(l)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsx(wa,{size:20,className:"animate-spin text-c4a-accent"}),f.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:v("sources.import_remote.loading_refs")})]});if(s)return f.jsx("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"rounded-sm border border-red-500/20 bg-red-500/10 p-4",children:[f.jsxs("p",{className:"font-mono text-sm font-medium text-red-400",children:[f.jsx(Ul,{size:14,className:"mr-1 inline-block"}),v("sources.import.error_title")]}),f.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:s}),g&&f.jsxs("button",{onClick:g,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(kx,{size:12}),v("sources.import_remote.retry")]})]})});if(!n)return null;const I=n.branches.find(P=>P.name===i)?.name??n.tags.find(P=>P.name===i)?.name??i,ie=o?o.slice(0,8):"";return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:v("sources.import_remote.ref_label")}),f.jsxs("div",{ref:Y,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>_(!b),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{children:I||"—"}),f.jsx(ra,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${b?"rotate-90":""}`})]}),b&&f.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[f.jsx(hd,{size:14,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:K,type:"text",value:j,onChange:P=>R(P.target.value),placeholder:v("sources.import_remote.ref_search"),className:"w-full bg-transparent font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),f.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[ue.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[f.jsxs("button",{onClick:()=>A(!T),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(ra,{size:12,className:`transition-transform duration-200 ${T?"rotate-90":""}`}),v("sources.import_remote.ref_branches")," (",n.branches.length,")"]}),T&&ue.map(P=>f.jsxs("button",{onClick:()=>de(P),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${P.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx("span",{className:"truncate",children:P.name}),P.name===i&&f.jsx("span",{children:"✓"})]},`b-${P.name}`))]}),me.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[f.jsxs("button",{onClick:()=>Z(!G),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(ra,{size:12,className:`transition-transform duration-200 ${G?"rotate-90":""}`}),v("sources.import_remote.ref_tags")," (",n.tags.length,")"]}),G&&me.map(P=>f.jsxs("button",{onClick:()=>de(P),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${P.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx("span",{className:"truncate",children:P.name}),P.name===i&&f.jsx("span",{children:"✓"})]},`t-${P.name}`))]})]}),ue.length===0&&me.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:v("sources.import_remote.commit_label")}),f.jsxs("div",{ref:H,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>ne(!X),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:ie||"—"}),f.jsx(ra,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${X?"rotate-90":""}`})]}),X&&f.jsxs("div",{className:"c4a-scrollbar absolute z-20 mt-1 max-h-64 w-full overflow-y-auto rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[f.jsx(hd,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:ee,type:"text",value:J,onChange:P=>w(P.target.value),placeholder:v("sources.import_remote.commit_search"),className:"w-full bg-transparent font-mono text-xs text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),M.map(P=>f.jsxs("button",{onClick:()=>ce(P.hash,P.refName),className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:"truncate",children:P.label}),P.hash===o&&f.jsx("span",{className:"text-c4a-accent",children:"✓"})]},P.hash)),M.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),f.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[f.jsx(GS,{size:12,className:"shrink-0"}),v("sources.import_remote.commit_hint")]})]})]})}const N_="_pulseBar_17bq5_1",w_={pulseBar:N_};function E_({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}){const{t:u}=Te();return f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"space-y-2",children:n.map(m=>{const p=s.includes(m.key),g=i===m.key,h=l===m.key;return f.jsxs("div",{className:"flex items-center gap-3",children:[g?f.jsx(Ul,{size:14,className:"shrink-0 text-red-400"}):p||h?f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:`block h-2 w-2 rounded-full bg-c4a-accent ${h?"animate-pulse":""}`})}):f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:"block h-2 w-2 rounded-full border border-c4a-text-muted/40"})}),f.jsx("span",{className:`flex-1 text-sm ${g?"text-red-400":h?"font-medium text-c4a-text-primary":p?"text-c4a-text-secondary":"text-c4a-text-muted"}`,children:m.label}),p&&f.jsx(Al,{size:14,className:"shrink-0 text-c4a-accent/60"}),g&&f.jsx("span",{className:"font-mono text-xs text-red-400",children:u("sources.import.error_title")}),h&&o&&o.label&&f.jsx("span",{className:"max-w-[200px] truncate font-mono text-xs text-c4a-text-muted",children:o.label})]},m.key)})}),l&&!i&&f.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 ${w_.pulseBar}`}),o&&o.label&&f.jsx("p",{className:"truncate font-mono text-xs text-c4a-text-muted",children:o.label})]})]})}function Wx({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o,failedError:u,logs:m}){const p=y.useRef(null);return y.useEffect(()=>{p.current?.scrollIntoView({behavior:"smooth"})},[m.length]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsx(E_,{stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}),f.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[m.map((g,h)=>f.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:g},h)),f.jsx("div",{ref:p})]}),i&&u&&f.jsx("div",{className:"mt-3 rounded-sm border border-red-500/20 bg-red-500/10 p-4",children:f.jsx("p",{className:"font-mono text-sm font-medium text-red-400",children:u})})]})}function On({icon:n,label:l,value:s,tooltip:i,size:o="sm"}){const u=o==="sm";return f.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[n,f.jsx("span",{className:"font-mono text-xs uppercase",children:l})]}),f.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${u?"text-sm truncate":"text-lg"}`,title:u?String(s):void 0,children:s}),i&&f.jsx("div",{className:"pointer-events-none absolute bottom-full left-0 z-30 mb-1.5 hidden w-max max-w-[260px] rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/stat:block",children:i})]})}const td=100;function ey({repoName:n,repoIdentifier:l,branch:s,commit:i,packages:o,mdFiles:u,importing:m,completed:p}){const{t:g}=Te(),h=i?i.slice(0,7):"",[v,b]=y.useState("packages"),[_,j]=y.useState(td),R=y.useRef(null),T=y.useRef(null);y.useEffect(()=>{j(td),T.current?.scrollTo(0,0)},[v]),y.useEffect(()=>{const K=R.current;if(!K)return;const X=v==="packages"?o.length:u.length;if(_>=X)return;const ne=new IntersectionObserver(J=>{J[0]?.isIntersecting&&j(w=>Math.min(w+td,X))},{root:T.current,threshold:.1});return ne.observe(K),()=>ne.disconnect()},[v,_,o.length,u.length]);const A=v==="packages"?o:u,G=A.slice(0,_),Z=_<A.length,Y=y.useMemo(()=>p?g("sources.import_remote.complete"):m?g("sources.import.importing"):g("sources.import.confirm_heading",{name:n}),[p,m,n,g]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:Y}),f.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[f.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:l})]}),f.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[f.jsx(On,{icon:f.jsx(fd,{size:14}),label:g("sources.import.branch"),value:s}),f.jsx(On,{icon:f.jsx(HS,{size:14}),label:g("sources.import.commit"),value:h}),f.jsx(On,{icon:f.jsx(Tr,{size:14}),label:g("sources.import.packages"),value:String(o.length),tooltip:g("sources.import.dir_code_packages_tip")}),f.jsx(On,{icon:f.jsx(il,{size:14}),label:g("sources.import.documents"),value:String(u.length),tooltip:g("sources.import.dir_doc_files_tip")})]}),m&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(wa,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:g("sources.import.importing")})]}),(o.length>0||u.length>0)&&f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-base",children:[f.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[f.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:g("sources.import.recognized",{packages:o.length,docs:u.length})}),f.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[f.jsxs("button",{onClick:()=>b("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${v==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(Tr,{size:13}),f.jsx("span",{className:"font-mono",children:o.length})]}),f.jsxs("button",{onClick:()=>b("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${v==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(il,{size:13}),f.jsx("span",{className:"font-mono",children:u.length})]})]})]}),f.jsx("hr",{className:"border-c4a-border-subtle"}),f.jsx("div",{ref:T,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:A.length===0?f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:v==="packages"?g("sources.import.no_packages"):"—"}):f.jsxs(f.Fragment,{children:[v==="packages"?G.map(K=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(Tr,{size:14,className:"shrink-0 text-c4a-accent"}),f.jsx("span",{className:"text-c4a-text-secondary",children:K.name}),f.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:K.path}),K.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"})]},K.path)):G.map(K=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(il,{size:14,className:"shrink-0 text-c4a-text-secondary"}),f.jsx("span",{className:"truncate text-c4a-text-secondary",children:K})]},K)),Z&&f.jsx("div",{ref:R,className:"h-4"})]})})]})]})}const C_=["scan","save"],io={scan:"sources.import.stage.scan",save:"sources.import.stage.save"};function R_(){const{t:n}=Te(),l=Mn(),{libId:s}=$s(),[i]=jo(),u=Pt(Hl(Or)).find(Se=>Se.id===s),m=Co(Se=>Se.createSource),p=i.get("parentId")||"",g=i.get("parentPath")||"",[h,v]=y.useState(1),[b,_]=y.useState(null),[j,R]=y.useState(""),[T,A]=y.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[G,Z]=y.useState(null),[Y,K]=y.useState(!1),[X,ne]=y.useState(null),[J,w]=y.useState(""),[H,ee]=y.useState(""),[de,ce]=y.useState(!1),[re,ue]=y.useState(!1),[me,M]=y.useState(!1),[I,ie]=y.useState(null),[P,be]=y.useState([]),[N,$]=y.useState(null),[F,le]=y.useState(null),[pe,_e]=y.useState([]),ze=y.useRef(null),at=u?.is_online??!1,{rpc:Le,importedPaths:It,allowedPaths:ia}=Xx(s,u),mt=y.useMemo(()=>C_.map(Se=>({key:Se,label:io[Se]?n(io[Se]):Se})),[n]),Ie=y.useCallback(Se=>{_e(Be=>[...Be,`[${Zx()}] ${Se}`])},[]),ht=y.useCallback(Se=>{ie(Be=>(Be&&Be!==Se&&(be(Ye=>Ye.includes(Be)?Ye:[...Ye,Be]),Ie(`${n(io[Be]??Be)} ${n("sources.import.stage.done_suffix")}`)),Ie(`${n(io[Se]??Se)}...`),Se)),le(null)},[Ie,n]),Dt=y.useCallback((Se,Be)=>{A(Ye=>({...Ye,repoPath:Se,repoName:Be}))},[]),Xt=y.useCallback(async()=>{K(!0),ne(null);try{const Se=await Le("fs/repoStatus",{path:T.repoPath}),Be={branches:Se.branches??[{name:Se.branch,commit:Se.head_hash}],tags:Se.tags??[],default:Se.branch,commits:Se.commits??[{hash:Se.head_hash,message:"HEAD"}]};Z(Be),A(Ye=>({...Ye,isDirty:Se.is_dirty})),w(Ye=>{if(Ye)return Ye;const Mt=Be.branches.find(Ze=>Ze.name===Be.default),At=Be.branches[0],je=Mt??At;return je?(ee(je.commit),je.name):Ye})}catch(Se){const Be=Se instanceof Error?Se.message:"Failed to load repository info";ne(Be)}finally{K(!1)}},[Le,T.repoPath]);y.useEffect(()=>{h===2&&T.repoPath&&!G&&Xt()},[h,T.repoPath,G,Xt]);const Wt=y.useCallback(async Se=>{try{const Be=await Le("fs/repoStatus",{path:T.repoPath,branch:Se});Z(Ye=>Ye&&{...Ye,commits:Be.commits??[]})}catch{}},[Le,T.repoPath]),$t=y.useCallback(async()=>{if(s){ue(!0),M(!1),_(null),$(null),be([]),ie(null),le(null),_e([]),v(3);try{ht("scan");const Se=await Le("fs/repoScan",{path:T.repoPath,hash:H}),Be=Se.files||[],Ye=Se.manifests||[],Mt=zn(T.repoPath),{packages:At,mdFiles:je}=Qx(Ye,Be,Mt);A(ut=>({...ut,branch:J,commit:H,repoFiles:Be,packages:At,mdFiles:je,repoFileContents:Ye})),ht("save");const Ze=j||T.repoName||Mt,Ae=await m({library_id:s,repo_name:Ze,repo_root_path:T.repoPath,repo_branch:J,repo_commit:H,repo_files:Be.map(ut=>ut.path),repo_file_contents:Ye,...p?{parent_source_id:p,parent_path:g}:{}});be(["scan","save"]),ie(null),Ie(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),Ie(n("sources.import.stage.complete"));const nt=Array.isArray(Ae)?Ae[0]:Ae;ze.current=nt?.id??null,M(!0),ue(!1),v(4)}catch(Se){$(I??"scan"),ie(null);const Ye=Se instanceof Error?Se.message:String(Se);Ie(`ERROR: ${Ye}`),_(Ye),ue(!1)}}},[s,T,J,H,j,p,g,Le,m,ht,I,Ie]),ea=y.useCallback(()=>{$(null),_(null),$t()},[$t]),oa=y.useCallback(()=>{if(s)if(p){const Se=zn(T.repoPath),Be=j||T.repoName||Se,Ye=g?`${g}/${Be}`:Be;l(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(Ye)}`)}else ze.current?l(`/studio/sources/${s}?rootId=${ze.current}`):l(`/studio/sources/${s}`)},[s,l,p,g,j,T.repoPath,T.repoName]),ca=y.useMemo(()=>h===1?!!T.repoPath:h===2?de:h===3?me:!1,[h,T.repoPath,de,me]),cn=y.useMemo(()=>u?[{label:u.id===ol?n("sources.library.default_cloud_name"):u.name,to:`/studio/sources/${u.id}`},{label:n("sources.import.title")}]:[],[u,n]);if(!u)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const un=h===4,jt=h===3&&!!N&&!re,Gt=h<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Dr,{segments:cn})}),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(sn,{active:h>=1,current:h===1}),f.jsx("span",{className:h===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Dl,{}),f.jsx(sn,{active:h>=2,current:h===2}),f.jsx("span",{className:h===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Dl,{}),f.jsx(sn,{active:h>=3,current:h===3}),f.jsx("span",{className:h===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import_remote.step.loading")}),f.jsx(Dl,{}),f.jsx(sn,{active:h>=4,current:h===4}),f.jsx("span",{className:h===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:at?f.jsxs(f.Fragment,{children:[h===1&&f.jsx(__,{rpc:Le,selectedPath:T.repoPath,onSelect:Dt,allowedPaths:ia,importedPaths:It}),h===2&&f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[f.jsx(Ix,{refs:G,loading:Y,error:X,selectedRef:J,commit:H,onRefChange:w,onCommitChange:ee,onValidChange:ce,onRetry:Xt,onBranchSwitch:Wt}),!Y&&G&&f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:n("sources.import.dir_name")}),f.jsx("input",{type:"text",value:j,onChange:Se=>R(Se.target.value),placeholder:T.repoName||zn(T.repoPath),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-accent placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none"}),f.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:n("sources.import.dir_name_hint")})]})]}),h===3&&f.jsx(Wx,{stages:mt,currentStage:I,completedStages:P,failedStage:N,progress:F,failedError:b,logs:pe}),h===4&&f.jsx(ey,{repoName:T.repoName||zn(T.repoPath),repoIdentifier:T.repoPath,branch:J,commit:H,packages:T.packages,mdFiles:T.mdFiles,importing:!1,completed:me})]}):f.jsx(Kx,{libraryName:u.name})}),at&&f.jsx(f.Fragment,{children:un?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:oa,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import_remote.back_to_library")})}):jt?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{v(2),$(null),_(null),be([]),ie(null),_e([])},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:ea,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")})]}):Gt?f.jsx(Rd,{step:h,totalSteps:4,importing:re,stepBusy:Y||h===3&&re,canProceed:ca,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>v(Se=>Se-1),onNext:()=>{h===2?$t():v(Se=>Se+1)},onImport:$t}):null}),b&&h!==3&&f.jsxs(Bl,{onClose:()=>_(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:()=>_(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]})}const Lg=(n,l)=>{let s=0,i=0,o=0;const u=[],m=p=>{for(const g of p)if(g.type==="directory")i++,g.is_git_repo&&o++,g.children&&m(g.children);else if(s++,/\.md$/i.test(g.name)){const h=g.path.startsWith(l)?g.path.slice(l.length).replace(/^\//,""):g.name;u.push(h)}};return m(n),{files:s,dirs:i,gitRepos:o,mdFiles:u}};function T_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Te(),{atRoot:m,currentPath:p,entries:g,loading:h,error:v,homeDir:b,goToOpen:_,isWildcard:j,importedSet:R,dirs:T,files:A,loadTree:G,handleNavigateUp:Z,setGoToOpen:Y}=Px({rpc:n,allowedPaths:i??[],importedPaths:o??[]}),K=y.useCallback(w=>{if(w.type!=="directory"||R.has(w.path))return;const H=Lg(w.children||[],w.path);s(w.path,w.name,H),G(w.path)},[s,G,R]);y.useEffect(()=>{if(p&&!m&&g.length>=0&&!h){const w=p.split("/").pop()||p,H=Lg(g,p);s(p,w,H)}},[p,m,g,h,s]);const X=y.useMemo(()=>l?l.split("/").pop()||l:"",[l]),ne=y.useMemo(()=>T.sort((w,H)=>w.is_git_repo&&!H.is_git_repo?-1:!w.is_git_repo&&H.is_git_repo?1:w.name.localeCompare(H.name)),[T]),J=y.useMemo(()=>A.sort((w,H)=>w.name.localeCompare(H.name)),[A]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Fx,{})]}):f.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:p}),l?f.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[f.jsx(Ha,{size:12}),f.jsx("span",{children:X})]}):j&&m?f.jsx("button",{onClick:()=>Y(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?j?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:b&&f.jsxs("button",{onClick:()=>G(b),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Ha,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[b,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(ra,{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:()=>G(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(Ha,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:w}),f.jsx(ra,{size:12,className:"shrink-0 text-c4a-text-muted"})]},w))}):v&&!h?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(wa,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&f.jsxs("button",{onClick:Z,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(Ha,{size:14}),f.jsx("span",{children:".."})]}),ne.map(w=>{const H=R.has(w.path),ee=w.is_git_repo?wo:Ha;return f.jsxs("button",{onClick:()=>K(w),disabled:H||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${H?"cursor-not-allowed text-c4a-accent/60":l===w.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[f.jsx(ee,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate",children:w.name}),H&&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(ra,{size:12,className:"shrink-0 text-c4a-text-muted"})]},w.path)}),J.map(w=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Dx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:w.name})]},w.path)),g.length===0&&!h&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),f.jsx(Jx,{open:_,onClose:()=>Y(!1),rpc:n,onNavigate:G,defaultPath:b??void 0})]})}const z_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),O_=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&&z_.has(h.toLowerCase())){const v=p.path.split("/").slice(0,-1).join("/");n.some(_=>_.type==="directory"&&_.is_git_repo&&(v===_.path||v.startsWith(`${_.path}/`)))||m.add(v)}}return i=m.size,{totalFiles:l,totalDirs:s,codePackages:i,docFiles:o,gitRepos:u}};function D_({dirPath:n,rpc:l,importing:s,onScanComplete:i,onBusyChange:o}){const{t:u}=Te(),[m,p]=y.useState(!1),[g,h]=y.useState(null),[v,b]=y.useState(null),_=y.useCallback(async()=>{p(!0),o?.(!0),h(null),b(null);try{const j=await l("fs/dirScan",{path:n}),R=j.entries||[],T=j.manifests||[],A=O_(R);b(A),i(R,A,T)}catch(j){const R=j instanceof Error?j.message:String(j);h(R)}finally{p(!1),o?.(!1)}},[n,l,i,o]);return y.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(wa,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.dir_scanning")})]}),g&&f.jsxs("div",{className:"mt-6",children:[f.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[f.jsx(Ox,{size:14,className:"mt-0.5 shrink-0"}),u("sources.import.dir_scan_error")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:g}),f.jsxs("button",{onClick:_,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(kx,{size:12}),u("sources.import.dir_scan_retry")]})]}),v&&!m&&!g&&f.jsxs("div",{className:"mt-6 space-y-3",children:[f.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[u("sources.import.dir_scan_complete"),"!"]}),f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[f.jsx(On,{icon:f.jsx(il,{size:14}),label:u("sources.import.dir_doc_files"),value:v.docFiles,tooltip:u("sources.import.dir_doc_files_tip"),size:"lg"}),f.jsx(On,{icon:f.jsx(Tr,{size:14}),label:u("sources.import.dir_code_packages"),value:v.codePackages,tooltip:u("sources.import.dir_code_packages_tip"),size:"lg"}),v.gitRepos>0&&f.jsx(On,{icon:f.jsx(wo,{size:14}),label:u("sources.import.dir_git_repos"),value:v.gitRepos,size:"lg"}),f.jsx(On,{icon:f.jsx(Ha,{size:14}),label:u("sources.import.dir_total_dirs"),value:v.totalDirs,size:"lg"}),f.jsx(On,{icon:f.jsx(RS,{size:14}),label:u("sources.import.dir_total_files"),value:v.totalFiles,size:"lg"})]}),v.gitRepos>0&&f.jsx("p",{className:"text-xs text-c4a-warning",children:u("sources.import.dir_git_skip_hint",{count:v.gitRepos})})]}),s&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(wa,{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 M_(){const{t:n}=Te(),l=Mn(),{libId:s}=$s(),o=Pt(Hl(Or)).find(H=>H.id===s),u=Co(H=>H.createSource),[m,p]=y.useState(1),[g,h]=y.useState(!1),[v,b]=y.useState(null),[_,j]=y.useState(!1),[R,T]=y.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),A=o?.is_online??!1,{rpc:G,importedPaths:Z,allowedPaths:Y}=Xx(s,o),K=y.useCallback((H,ee,de)=>{T(ce=>({...ce,dirPath:H,dirName:ee,fileCount:de.files,subDirCount:de.dirs,gitRepoCount:de.gitRepos,mdFiles:de.mdFiles}))},[]),X=y.useCallback((H,ee,de)=>{T(ce=>({...ce,scanEntries:H,scanStats:ee,manifests:de}))},[]),ne=y.useCallback(async()=>{if(s){h(!0);try{const H=await u({library_id:s,dir_files:R.scanEntries,dir_name:R.dirName,dir_path:R.dirPath,dir_file_contents:R.manifests}),ee=Array.isArray(H)?H[0]:H;ee?.id?l(`/studio/sources/${s}?rootId=${ee.id}`):l(`/studio/sources/${s}`)}catch(H){const ee=H instanceof Error?H.message:String(H);b(ee),h(!1)}}},[s,R,u,l]),J=y.useMemo(()=>m===1?!!R.dirPath:m===2?R.scanEntries.length>0:!0,[m,R]),w=y.useMemo(()=>o?[{label:o.id===ol?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(Dr,{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(sn,{active:m>=1,current:m===1}),f.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.select")}),f.jsx(Dl,{}),f.jsx(sn,{active:m>=2,current:m===2}),f.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:A?f.jsxs(f.Fragment,{children:[m===1&&f.jsx(T_,{rpc:G,selectedPath:R.dirPath,onSelect:K,allowedPaths:Y,importedPaths:Z}),m===2&&f.jsx(D_,{dirPath:R.dirPath,rpc:G,importing:g,onScanComplete:X,onBusyChange:j})]}):f.jsx(Kx,{libraryName:o.name})}),A&&f.jsx(Rd,{step:m,totalSteps:2,importing:g,stepBusy:_,canProceed:J,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>p(H=>H-1),onNext:()=>p(H=>H+1),onImport:ne}),v&&f.jsxs(Bl,{onClose:()=>b(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>b(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const A_=/^https:\/\/[^/]+\/.+/;function k_({url:n,onUrlChange:l,onValidChange:s}){const{t:i}=Te(),[o,u]=y.useState(null),[m,p]=y.useState([]),g=y.useRef(null);y.useEffect(()=>{_t.get("/import/remote/git-hosts").then(_=>p(_.hosts),()=>{})},[]);const h=y.useCallback(_=>{if(!_){u(null),s(!1);return}A_.test(_)?(u(null),s(!0)):(u(i("sources.import_remote.url_invalid")),s(!1))},[s,i]),v=y.useCallback(_=>{const j=_.target.value;l(j),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>h(j),300)},[l,h]),b=y.useCallback(_=>{_.preventDefault();const j=_.clipboardData.getData("text").trim();l(j),g.current&&clearTimeout(g.current),h(j)},[l,h]);return y.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),y.useEffect(()=>{n&&h(n)},[]),f.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-default bg-c4a-bg-surface px-6 py-10",children:f.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[f.jsx("input",{type:"text",value:n,onChange:v,onPaste:b,placeholder:i("sources.import_remote.url_placeholder"),className:"w-full rounded-md border border-c4a-border-default bg-c4a-bg-surface px-4 py-3 text-center font-mono text-base font-semibold text-c4a-accent placeholder:font-normal placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none",autoFocus:!0}),f.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:o?f.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[f.jsx(Ul,{size:14,className:"shrink-0"}),o]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{children:m.length>0?f.jsxs(f.Fragment,{children:[i("sources.import_remote.url_hint_public"),m.map((_,j)=>f.jsxs("span",{children:[j>0&&"、",f.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:_})]},_))]}):i("sources.import_remote.url_hint_no_auth")}),f.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:i("sources.import_remote.url_hint_format")})]})})]})})}const Ug=["prepare","clone","scan","save"],oo={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"};function L_(n,l,s){if(n instanceof Ol){const i=n.message.toLowerCase();if(n.status===503)return s("sources.import_remote.error.capacity");if(i.includes("connect")||i.includes("connectionrefused")||i.includes("unavailable")||i.includes("econnrefused"))return s("sources.import_remote.error.network");if(i.includes("authentication")||i.includes("token")||i.includes("credential")||i.includes("401")||i.includes("403"))try{const o=new URL(l).hostname;return s("sources.import_remote.error.auth_required",{host:o})}catch{return s("sources.import_remote.error.auth_required",{host:l})}return i.includes("not found")||i.includes("404")||i.includes("does not exist")?s("sources.import_remote.error.not_found"):n.message||s("sources.import_remote.error.network")}return n instanceof TypeError&&n.message.includes("fetch")?s("sources.import_remote.error.network"):n instanceof Error?n.message:s("sources.import_remote.error.network")}function U_(n){return n==="cloning"?"clone":n==="detecting"||n==="extracting"?"scan":n==="saving"?"save":n}function H_(){const{t:n}=Te(),l=Mn(),{libId:s}=$s(),[i]=jo(),o=i.get("url")||"",u=i.get("ref")||"",m=i.get("sourceUuid")||"",p=i.get("parentId")||"",g=i.get("parentPath")||"",v=Pt(Hl(Or)).find(je=>je.id===s),[b,_]=y.useState(new Set);y.useEffect(()=>{if(!s)return;let je=!1;return _t.get("/sources",{library_id:s}).then(Ze=>{je||_(new Set(Ze.items.map(Ae=>Ae.name.toLowerCase())))}).catch(()=>{}),()=>{je=!0}},[s]);const[j,R]=y.useState(o?2:1),[T,A]=y.useState(o),[G,Z]=y.useState(!!o),[Y,K]=y.useState(u),[X,ne]=y.useState(""),[J,w]=y.useState(!!u),[H,ee]=y.useState(""),[de,ce]=y.useState(null),[re,ue]=y.useState(!1),[me,M]=y.useState(null),[I,ie]=y.useState(!1),[P,be]=y.useState(!1),[N,$]=y.useState(null),[F,le]=y.useState(null),[pe,_e]=y.useState(null),[ze,at]=y.useState(null),[Le,It]=y.useState([]),[ia,mt]=y.useState(null),[Ie,ht]=y.useState([]),Dt=y.useRef(null),Xt=y.useRef(""),Wt=y.useMemo(()=>Ug.map(je=>({key:je,label:oo[je]?n(oo[je]):je})),[n]),$t=y.useCallback(je=>{ht(Ze=>[...Ze,`[${Zx()}] ${je}`])},[]),ea=y.useCallback(je=>{at(Ze=>(Ze&&Ze!==je&&(It(Ae=>Ae.includes(Ze)?Ae:[...Ae,Ze]),$t(`${n(oo[Ze]??Ze)} ${n("sources.import.stage.done_suffix")}`)),$t(`${n(oo[je]??je)}...`),je)),mt(null)},[$t,n]),oa=y.useCallback(async je=>{if(s){ue(!0),M(null);try{const Ze=await _t.post("/import/remote/refs",{library_id:s,url:T},je?{signal:je}:void 0);ce(Ze);const Ae=Ze.branches??[];Ae.length>0&&K(nt=>{if(nt)return nt;const vt=Ae.find(Pa=>Pa.name===Ze.default)??Ae[0];return vt?(ne(vt.commit),vt.name):nt})}catch(Ze){if(je?.aborted)return;M(L_(Ze,T,n))}finally{je?.aborted||ue(!1)}}},[s,T,n]);y.useEffect(()=>{if(j!==2||!s)return;const je=new AbortController;return oa(je.signal),()=>je.abort()},[j,s,oa]),y.useEffect(()=>I?Fa.on("task/progress",Ze=>{const Ae=Ze,nt=U_(Ae.stage??"");nt&&Ug.includes(nt)&&mt({percent:Ae.percent??-1,label:Ae.label??""})}):void 0,[I]);const ca=y.useCallback(async()=>{if(s){ie(!0),be(!1),le(null),_e(null),It([]),at(null),mt(null),ht([]),R(3);try{ea("prepare"),await new Promise(Ia=>setTimeout(Ia,300)),ea("clone");const je=zn(T),Ze=H||je,Ae=await _t.post("/import/remote/clone",{library_id:s,url:T,ref:Y,...X?{commit:X}:{},repo_name:je});Xt.current=Ae.commit_hash,ea("scan");const nt=await _t.post("/import/remote/scan",{library_id:s,path:Ae.path,hash:Ae.commit_hash});ea("save");const ut=await _t.post("/import/remote/import",{library_id:s,url:T,ref:Y,commit:Ae.commit_hash,repo_name:je,dir_name:Ze,repo_files:nt.files.map(Ia=>Ia.path),repo_file_contents:nt.manifests,...m?{source_uuid:m}:{},...p?{parent_source_id:p,parent_path:g}:{}});It(["prepare","clone","scan","save"]),at(null),$t(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),$t(n("sources.import.stage.complete"));const{packages:vt,mdFiles:Pa}=Qx(nt.manifests,nt.files,je);$({packages:vt,mdFiles:Pa}),be(!0),ie(!1),Dt.current=ut.id,R(4)}catch(je){_e(ze??"prepare"),at(null);let Ae;je instanceof Ol||je instanceof Error?Ae=je.message:Ae=String(je),$t(`ERROR: ${Ae}`),le(Ae),ie(!1)}}},[s,T,Y,X,H,m,p,g,ea,ze,$t]),cn=y.useCallback(()=>{_e(null),le(null),ca()},[ca]),un=y.useCallback(()=>{if(s)if(p){const je=zn(T),Ze=H||je,Ae=g?`${g}/${Ze}`:Ze;l(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(Ae)}`)}else Dt.current?l(`/studio/sources/${s}?rootId=${Dt.current}`):l(`/studio/sources/${s}`)},[s,l,p,g,H,T]),jt=(H||zn(T)).toLowerCase(),Gt=b.has(jt),Se=y.useMemo(()=>j===1?G:j===2?J&&!Gt:!1,[j,G,J,Gt]),Be=y.useMemo(()=>v?[{label:v.id===ol?n("sources.library.default_cloud_name"):v.name,to:`/studio/sources/${v.id}`},{label:n("sources.import_remote.title")}]:[],[v,n]);if(!v)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Ye=j===4&&P,Mt=j===3&&!!pe&&!I,At=j<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Dr,{segments:Be})}),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(sn,{active:j>=1,current:j===1}),f.jsx("span",{className:j===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Dl,{}),f.jsx(sn,{active:j>=2,current:j===2}),f.jsx("span",{className:j===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Dl,{}),f.jsx(sn,{active:j>=3,current:j===3}),f.jsx("span",{className:j===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import_remote.step.loading")}),f.jsx(Dl,{}),f.jsx(sn,{active:j>=4,current:j===4}),f.jsx("span",{className:j===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[j===1&&f.jsx(k_,{url:T,onUrlChange:A,onValidChange:Z}),j===2&&s&&f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[f.jsx(Ix,{refs:de,loading:re,error:me,selectedRef:Y,commit:X,onRefChange:K,onCommitChange:ne,onValidChange:w,onRetry:()=>oa()}),!re&&de&&f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:n("sources.import.dir_name")}),f.jsx("input",{type:"text",value:H,onChange:je=>ee(je.target.value),placeholder:zn(T),className:`mt-2 w-full rounded border bg-c4a-bg-surface px-3 py-2 font-mono text-sm text-c4a-accent placeholder:text-c4a-text-muted focus:outline-none ${Gt?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),Gt?f.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:n("sources.import.dir_name_duplicate")}):f.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:n("sources.import.dir_name_hint")})]})]}),j===3&&f.jsx(Wx,{stages:Wt,currentStage:ze,completedStages:Le,failedStage:pe,progress:ia,failedError:F,logs:Ie}),j===4&&f.jsx(ey,{repoName:zn(T),repoIdentifier:T,branch:Y,commit:Xt.current,packages:N?.packages??[],mdFiles:N?.mdFiles??[],importing:!1,completed:P})]}),Ye?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:un,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:()=>{R(2),_e(null),le(null),It([]),at(null),ht([])},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:cn,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")})]}):At?f.jsx(Rd,{step:j,totalSteps:2,importing:!1,stepBusy:re,canProceed:Se,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>R(je=>je-1),onNext:()=>R(je=>je+1),onImport:ca}):null]})}function B_(){const{t:n}=Te(),l=Mn(),s=Pt(_=>_.createLibrary),[i,o]=y.useState("waiting"),[u,m]=y.useState(null),[p,g]=y.useState(""),[h,v]=y.useState(!1);y.useEffect(()=>Fa.on("ws:daemon:connected",j=>{const R=j;m(R),g(R.machine_id),o(R.needs_registration?"new_client":"reconnected")}),[]),y.useEffect(()=>{let _=!1;return(async()=>{try{const j=await _t.get("/daemons/pending");if(_||j.pending.length===0)return;const R=j.pending[0];m({machine_id:R.machine_id,needs_registration:!0}),g(R.machine_id),o("new_client")}catch{}})(),()=>{_=!0}},[]);const b=y.useCallback(async()=>{if(u){v(!0);try{const _=await s({type:"daemon",name:p||u.machine_id,config:{machine_id:u.machine_id,os:u.os||"",daemon_version:u.daemon_version||""}});l(`/studio/sources/${_.id}`)}catch{v(!1)}}},[u,p,s,l]);return f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Dr,{segments:[{label:n("sources.add_client.title")}]}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),f.jsx("div",{className:"mt-6 rounded border border-c4a-border-default bg-c4a-bg-surface p-5",children:f.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:["npm install -g @c4a/daemon ",f.jsx(Hg,{text:"npm install -g @c4a/daemon"})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",n("sources.add_client.step2")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host}`," ",f.jsx(Hg,{text:`c4a-daemon --server ${window.location.host}`})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),f.jsxs("div",{className:"mt-6 rounded border border-c4a-border-default bg-c4a-bg-surface p-5",children:[i==="waiting"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(wa,{size:16,className:"animate-spin text-c4a-warning"}),f.jsx("span",{className:"text-sm text-c4a-warning",children:n("sources.add_client.waiting")})]}),i==="new_client"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:n("sources.add_client.detected")}),f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsx(ad,{label:n("sources.add_client.machine_name"),value:u.machine_id}),u.os&&f.jsx(ad,{label:n("sources.add_client.os"),value:u.os}),u.daemon_version&&f.jsx(ad,{label:n("sources.add_client.daemon_version"),value:u.daemon_version})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),f.jsx("input",{value:p,onChange:_=>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:b,disabled:h||!p.trim(),className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-50",children:[h&&f.jsx(wa,{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(Na,{to:`/studio/sources/${u.lib_id}`,className:"inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.add_client.go_to",{name:u.machine_id})})]})]})]})}function Hg({text:n}){const[l,s]=y.useState(!1),i=y.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[n]);return f.jsx("button",{type:"button",onClick:i,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:l?f.jsx(Al,{size:13}):f.jsx(dd,{size:13})})}function ad({label:n,value:l}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:l})]})}function $_(){const{t:n}=Te(),{sourceUuid:l}=$s(),[s]=jo(),i=s.get("path")||"",{currentRoot:o,loading:u,fetchRootSource:m}=Co(),p=Pt(Hl(Or)),[g,h]=y.useState("original");y.useEffect(()=>{l&&m(l)},[l,m]);const v=y.useMemo(()=>o?i?Eo(o.tree,i):o.kind==="source"?{path:"",kind:o.kind,source_type:o.source_type,name:o.name,metadata:o.metadata,index_status:o.index_status}:null:null,[o,i]),b=p.find(Y=>Y.id===o?.library_id),_=v?.metadata,j=_?Object.fromEntries(Object.entries(_).map(([Y,K])=>[Y,String(K??"")])):null,R=v?.source_type==="code",T=v?.name??o?.name??"",A=v?.source_type??null,G=y.useMemo(()=>{if(!o||!b)return[];const Y=o.kind==="source"&&!i,K=[{label:b.id===ol?n("sources.library.default_cloud_name"):b.name,to:`/studio/sources/${b.id}`},{label:o.name,...Y?{}:{to:`/studio/sources/${b.id}?rootId=${o.id}`}}];if(i){const X=Yx(o.tree,i);for(let ne=0;ne<X.length-1;ne++){const J=X[ne];K.push({label:J.name,to:`/studio/sources/${b.id}?rootId=${o.id}&path=${encodeURIComponent(J.path)}`})}X.length>0&&K.push({label:X[X.length-1].name})}return K},[o,b,i,n]),Z=[{key:"original",label:n(R?"sources.detail.tab.overview":"sources.detail.tab.original")},{key:"digest",label:n("sources.detail.tab.digest")},{key:"modeling",label:n("sources.detail.tab.modeling")}];return u||!o||!v?f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}):f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Dr,{segments:G}),f.jsxs("div",{className:"mt-4 flex flex-wrap items-baseline gap-x-6 gap-y-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[R?f.jsx(Tr,{size:20,className:"shrink-0 text-c4a-accent"}):f.jsx(il,{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(A==="code"?"sources.type.code":"sources.type.doc")})]}),R&&j?.relative_path&&f.jsxs("span",{children:[n("sources.detail.path"),":"," ",f.jsx("span",{className:"font-mono text-c4a-text-secondary",children:j.relative_path})]}),!R&&f.jsxs("span",{children:[n("sources.detail.origin"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:b?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),f.jsxs("span",{children:[n("sources.detail.status"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${v.index_status??"none"}`)})]})]})]}),R&&j&&f.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[j.repo_name&&f.jsx(co,{label:n("sources.detail.repo"),value:j.repo_name}),j.pinned_branch&&f.jsx(co,{label:n("sources.detail.branch"),value:j.pinned_branch}),j.pinned_hash&&f.jsx(co,{label:n("sources.detail.commit"),value:j.pinned_hash.slice(0,7)}),j.tech_stack&&f.jsx(co,{label:n("sources.detail.tech_stack"),value:j.tech_stack})]})}),f.jsx("div",{className:"mt-3 flex border-b border-c4a-border-subtle",children:Z.map(Y=>f.jsx("button",{onClick:()=>h(Y.key),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${g===Y.key?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:Y.label},Y.key))}),f.jsxs("div",{className:"mt-4 flex-1",children:[g==="original"&&f.jsx(q_,{node:v,isCode:R}),g==="digest"&&f.jsx(Bg,{message:n("sources.detail.digest_placeholder")}),g==="modeling"&&f.jsx(Bg,{message:n("sources.detail.modeling_placeholder")})]})]})}function co({label:n,value:l}){return f.jsxs("div",{children:[f.jsx("span",{className:"text-c4a-text-muted",children:n}),f.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:l})]})}function q_({node:n,isCode:l}){const{t:s}=Te(),i=n.metadata;return l?f.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!i?.description&&f.jsx("p",{children:String(i.description)}),!!i?.dependencies&&f.jsxs("div",{children:[f.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:s("sources.detail.dependencies")}),f.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(i.dependencies).map(([o,u])=>f.jsxs("div",{className:"flex justify-between py-0.5",children:[f.jsx("span",{className:"text-c4a-text-primary",children:o}),f.jsx("span",{className:"text-c4a-text-muted",children:u})]},o))})]}),!i?.description&&!i?.dependencies&&f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_code_placeholder")})]}):f.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_doc_placeholder")})})}function Bg({message:n}){return f.jsx("div",{className:"flex items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:f.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:n})})}const Y_=H4([{element:f.jsx(D2,{}),children:[{path:"/",element:f.jsx(U2,{})},{path:"/login",element:f.jsx(H2,{})},{path:"/docs",element:f.jsx(B2,{})}]},{path:"/studio",element:f.jsx(L2,{}),children:[{index:!0,element:f.jsx(yg,{to:"/studio/sources",replace:!0})},{path:"sources",element:f.jsx(yg,{to:`/studio/sources/${ol}`,replace:!0})},{path:"sources/add-client",element:f.jsx(B_,{})},{path:"sources/import/:libId",element:f.jsx(R_,{})},{path:"sources/import-dir/:libId",element:f.jsx(M_,{})},{path:"sources/import-remote/:libId",element:f.jsx(H_,{})},{path:"sources/:libId",element:f.jsx(v_,{})},{path:"source/:sourceUuid",element:f.jsx($_,{})},{path:"modeling",element:f.jsx(q2,{})},{path:"modeling/code/setup",element:f.jsx(Q2,{})},{path:"modeling/code/compile",element:f.jsx(Z2,{})},{path:"modeling/code/review",element:f.jsx(F2,{})},{path:"modeling/code/result",element:f.jsx(J2,{})},{path:"brain",element:f.jsx(Y2,{})},{path:"discovery",element:f.jsx(G2,{})},{path:"sharing",element:f.jsx(V2,{})},{path:"collaboration",element:f.jsx(K2,{})},{path:"settings",element:f.jsx(X2,{})}]},{path:"*",element:f.jsx($2,{})}]);function G_(){return y.useEffect(()=>{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return Fa.connect(l),()=>{Fa.disconnect()}},[]),f.jsx(u4,{router:Y_})}Nv.createRoot(document.getElementById("root")).render(f.jsx(y.StrictMode,{children:f.jsx(G_,{})}));