@c4a/server-cli 0.4.12-alpha.3 → 0.4.12-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/index.js +4021 -1105
  2. package/package.json +2 -1
  3. package/serve.js +8452 -2018
  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/ContentDetail-cN2pQvDs.js +1 -0
  10. package/web/assets/EntityDetail-BBLfJ9LL.js +3 -0
  11. package/web/assets/EntityDetail-CHe5PkO9.js +1 -0
  12. package/web/assets/EntityDetail-CKrOvH7P.js +1 -0
  13. package/web/assets/EntityDetail-CQNu3A3D.js +3 -0
  14. package/web/assets/JsonTree-BRUca2ED.js +1 -0
  15. package/web/assets/JsonTree-Dd_iNoWA.js +1 -0
  16. package/web/assets/RelationDetail-B2h1kYvi.js +1 -0
  17. package/web/assets/RelationDetail-BoTv8wr4.js +1 -0
  18. package/web/assets/RelationDetail-CZwj9HUp.js +1 -0
  19. package/web/assets/RelationDetail-CkBj9cCj.js +1 -0
  20. package/web/assets/andromeeda-C4gqWexZ.js +1 -0
  21. package/web/assets/angular-html-DA-rfuFy.js +1 -0
  22. package/web/assets/angular-ts-BrjP3tb8.js +1 -0
  23. package/web/assets/astro-HNnZUWAn.js +1 -0
  24. package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
  25. package/web/assets/ayu-dark-DYE7WIF3.js +1 -0
  26. package/web/assets/ayu-light-BA47KaF1.js +1 -0
  27. package/web/assets/ayu-mirage-32ctXXKs.js +1 -0
  28. package/web/assets/blade-BjGOyj-B.js +1 -0
  29. package/web/assets/c-BIGW1oBm.js +1 -0
  30. package/web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  31. package/web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  32. package/web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  33. package/web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  34. package/web/assets/coffee-Ch7k5sss.js +1 -0
  35. package/web/assets/cpp-CofmeUqb.js +1 -0
  36. package/web/assets/css-CLj8gQPS.js +1 -0
  37. package/web/assets/csv-fuZLfV_i.js +1 -0
  38. package/web/assets/dark-plus-C3mMm8J8.js +1 -0
  39. package/web/assets/dracula-BzJJZx-M.js +1 -0
  40. package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
  41. package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
  42. package/web/assets/everforest-light-C8M2exoo.js +1 -0
  43. package/web/assets/github-dark-DHJKELXO.js +1 -0
  44. package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
  45. package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  46. package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  47. package/web/assets/github-light-DAi9KRSo.js +1 -0
  48. package/web/assets/github-light-default-D7oLnXFd.js +1 -0
  49. package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  50. package/web/assets/glsl-DplSGwfg.js +1 -0
  51. package/web/assets/graphql-ChdNCCLP.js +1 -0
  52. package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  53. package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  54. package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  55. package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  56. package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  57. package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  58. package/web/assets/haml-D5jkg6IW.js +1 -0
  59. package/web/assets/handlebars-BpdQsYii.js +1 -0
  60. package/web/assets/horizon-BUw7H-hv.js +1 -0
  61. package/web/assets/horizon-bright-CUuTKBJd.js +1 -0
  62. package/web/assets/houston-DnULxvSX.js +1 -0
  63. package/web/assets/html-derivative-DlHx6ybY.js +1 -0
  64. package/web/assets/html-pp8916En.js +1 -0
  65. package/web/assets/http-jrhK8wxY.js +1 -0
  66. package/web/assets/hurl-irOxFIW8.js +1 -0
  67. package/web/assets/imba-DGztddWO.js +1 -0
  68. package/web/assets/index-B1KeXpYL.css +1 -0
  69. package/web/assets/index-B1zrTc3w.js +12 -0
  70. package/web/assets/index-B6uGMtfP.css +1 -0
  71. package/web/assets/index-BCzQnf3x.css +1 -0
  72. package/web/assets/index-BLskFmu3.js +193 -0
  73. package/web/assets/index-BMVKFQ7h.js +238 -0
  74. package/web/assets/index-BRwgHwhm.js +12 -0
  75. package/web/assets/index-BU6YkKWq.css +1 -0
  76. package/web/assets/index-BXaK4HKi.js +12 -0
  77. package/web/assets/index-BaBWjAP7.css +1 -0
  78. package/web/assets/index-Be3yvSxB.js +12 -0
  79. package/web/assets/index-Bh0nrxkS.css +1 -0
  80. package/web/assets/index-BjM7CFih.js +12 -0
  81. package/web/assets/index-Bol5oT-i.js +193 -0
  82. package/web/assets/index-BoqItESG.js +13 -0
  83. package/web/assets/index-Bxkj7nBM.css +1 -0
  84. package/web/assets/index-ByCT34eF.css +1 -0
  85. package/web/assets/index-C1tbhKrB.css +1 -0
  86. package/web/assets/index-C6uqUNjs.js +238 -0
  87. package/web/assets/index-CU-x3HVJ.js +12 -0
  88. package/web/assets/index-CVcqJsfJ.js +12 -0
  89. package/web/assets/index-Cs1wjzzB.css +1 -0
  90. package/web/assets/index-D0FYwi5D.css +1 -0
  91. package/web/assets/index-D9pKIRoL.js +12 -0
  92. package/web/assets/index-DHMM5gmZ.js +12 -0
  93. package/web/assets/index-DMIK6qP9.js +12 -0
  94. package/web/assets/index-DW-afpe4.js +12 -0
  95. package/web/assets/index-DaUMALOp.css +1 -0
  96. package/web/assets/index-DfXQnmId.js +12 -0
  97. package/web/assets/index-DisDw0E0.css +1 -0
  98. package/web/assets/index-Dm-_KwmC.css +1 -0
  99. package/web/assets/index-DmRvWfJA.js +12 -0
  100. package/web/assets/index-Drfhm6bu.js +12 -0
  101. package/web/assets/index-DvnO8hAI.js +12 -0
  102. package/web/assets/index-JdgClnFG.css +1 -0
  103. package/web/assets/index-P648JtKx.js +12 -0
  104. package/web/assets/index-PA09G5Gn.css +1 -0
  105. package/web/assets/index-PGORoGGx.js +13 -0
  106. package/web/assets/index-ZtrM6iGG.js +12 -0
  107. package/web/assets/java-CylS5w8V.js +1 -0
  108. package/web/assets/javascript-wDzz0qaB.js +1 -0
  109. package/web/assets/jinja-f2NsQr07.js +1 -0
  110. package/web/assets/jison-wvAkD_A8.js +1 -0
  111. package/web/assets/json-Cp-IABpG.js +1 -0
  112. package/web/assets/json5-C9tS-k6U.js +1 -0
  113. package/web/assets/jsonc-Des-eS-w.js +1 -0
  114. package/web/assets/jsonl-DcaNXYhu.js +1 -0
  115. package/web/assets/jsx-g9-lgVsj.js +1 -0
  116. package/web/assets/julia-CxzCAyBv.js +1 -0
  117. package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  118. package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  119. package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
  120. package/web/assets/laserwave-DUszq2jm.js +1 -0
  121. package/web/assets/less-B1dDrJ26.js +1 -0
  122. package/web/assets/light-plus-B7mTdjB0.js +1 -0
  123. package/web/assets/markdown-Cvjx9yec.js +1 -0
  124. package/web/assets/marko-DjSrsDqO.js +1 -0
  125. package/web/assets/material-theme-D5KoaKCx.js +1 -0
  126. package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
  127. package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  128. package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
  129. package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  130. package/web/assets/mdc-DTYItulj.js +1 -0
  131. package/web/assets/mdx-Cmh6b_Ma.js +1 -0
  132. package/web/assets/min-dark-CafNBF8u.js +1 -0
  133. package/web/assets/min-light-CTRr51gU.js +1 -0
  134. package/web/assets/monokai-D4h5O-jR.js +1 -0
  135. package/web/assets/night-owl-C39BiMTA.js +1 -0
  136. package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
  137. package/web/assets/nord-Ddv68eIx.js +1 -0
  138. package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  139. package/web/assets/one-light-C3Wv6jpd.js +1 -0
  140. package/web/assets/php-R6g_5hLQ.js +1 -0
  141. package/web/assets/plastic-3e1v2bzS.js +1 -0
  142. package/web/assets/poimandres-CS3Unz2-.js +1 -0
  143. package/web/assets/postcss-CXtECtnM.js +1 -0
  144. package/web/assets/pug-DKIMFp6K.js +1 -0
  145. package/web/assets/python-B6aJPvgy.js +1 -0
  146. package/web/assets/r-Dspwwk_N.js +1 -0
  147. package/web/assets/red-bN70gL4F.js +1 -0
  148. package/web/assets/regexp-CDVJQ6XC.js +1 -0
  149. package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  150. package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  151. package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
  152. package/web/assets/sass-Cj5Yp3dK.js +1 -0
  153. package/web/assets/scss-D5BDwBP9.js +1 -0
  154. package/web/assets/shellscript-Yzrsuije.js +1 -0
  155. package/web/assets/slack-dark-BthQWCQV.js +1 -0
  156. package/web/assets/slack-ochin-DqwNpetd.js +1 -0
  157. package/web/assets/snazzy-light-Bw305WKR.js +1 -0
  158. package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
  159. package/web/assets/solarized-light-L9t79GZl.js +1 -0
  160. package/web/assets/sql-BLtJtn59.js +1 -0
  161. package/web/assets/stylus-BEDo0Tqx.js +1 -0
  162. package/web/assets/svelte-Cy7k_4gC.js +1 -0
  163. package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
  164. package/web/assets/tokyo-night-hegEt444.js +1 -0
  165. package/web/assets/ts-tags-DQrlYJgV.js +1 -0
  166. package/web/assets/tsx-COt5Ahok.js +1 -0
  167. package/web/assets/typescript-BPQ3VLAy.js +1 -0
  168. package/web/assets/vesper-DU1UobuO.js +1 -0
  169. package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
  170. package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
  171. package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
  172. package/web/assets/vue-D2xRrEX4.js +1 -0
  173. package/web/assets/vue-html-AaS7Mt5G.js +1 -0
  174. package/web/assets/vue-vine-BoDAl6tE.js +1 -0
  175. package/web/assets/wasm-CG6Dc4jp.js +1 -0
  176. package/web/assets/wasm-MzD3tlZU.js +1 -0
  177. package/web/assets/wgsl-Dx-B1_4e.js +1 -0
  178. package/web/assets/wit-5i3qLPDT.js +1 -0
  179. package/web/assets/xml-sdJ4AIDG.js +1 -0
  180. package/web/assets/yaml-Buea-lGh.js +1 -0
  181. package/web/index.html +2 -2
@@ -0,0 +1,193 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/astro-HNnZUWAn.js","assets/json-Cp-IABpG.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-BjGOyj-B.js","assets/html-derivative-DlHx6ybY.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/sql-BLtJtn59.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/haml-D5jkg6IW.js","assets/handlebars-BpdQsYii.js","assets/yaml-Buea-lGh.js","assets/http-jrhK8wxY.js","assets/shellscript-Yzrsuije.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/python-B6aJPvgy.js","assets/r-Dspwwk_N.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-DTYItulj.js","assets/markdown-Cvjx9yec.js","assets/php-R6g_5hLQ.js","assets/pug-DKIMFp6K.js","assets/svelte-Cy7k_4gC.js","assets/ts-tags-DQrlYJgV.js","assets/vue-D2xRrEX4.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]);
2
+ function K4(e,t){for(var a=0;a<t.length;a++){const s=t[a];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(s,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function a(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(i){if(i.ep)return;i.ep=!0;const l=a(i);fetch(i.href,l)}})();function Kb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oh={exports:{}},ko={};var n0;function X4(){if(n0)return ko;n0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,i,l){var u=null;if(l!==void 0&&(u=""+l),i.key!==void 0&&(u=""+i.key),"key"in i){l={};for(var f in i)f!=="key"&&(l[f]=i[f])}else l=i;return i=l.ref,{$$typeof:e,type:s,key:u,ref:i!==void 0?i:null,props:l}}return ko.Fragment=t,ko.jsx=a,ko.jsxs=a,ko}var a0;function Q4(){return a0||(a0=1,oh.exports=X4()),oh.exports}var d=Q4();const Me=e=>typeof e=="string",Ro=()=>{let e,t;const a=new Promise((s,i)=>{e=s,t=i});return a.resolve=e,a.reject=t,a},r0=e=>e==null?"":""+e,Z4=(e,t,a)=>{e.forEach(s=>{t[s]&&(a[s]=t[s])})},J4=/###/g,s0=e=>e&&e.indexOf("###")>-1?e.replace(J4,"."):e,i0=e=>!e||Me(e),Ko=(e,t,a)=>{const s=Me(t)?t.split("."):t;let i=0;for(;i<s.length-1;){if(i0(e))return{};const l=s0(s[i]);!e[l]&&a&&(e[l]=new a),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++i}return i0(e)?{}:{obj:e,k:s0(s[i])}},o0=(e,t,a)=>{const{obj:s,k:i}=Ko(e,t,Object);if(s!==void 0||t.length===1){s[i]=a;return}let l=t[t.length-1],u=t.slice(0,t.length-1),f=Ko(e,u,Object);for(;f.obj===void 0&&u.length;)l=`${u[u.length-1]}.${l}`,u=u.slice(0,u.length-1),f=Ko(e,u,Object),f?.obj&&typeof f.obj[`${f.k}.${l}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${l}`]=a},W4=(e,t,a,s)=>{const{obj:i,k:l}=Ko(e,t,Object);i[l]=i[l]||[],i[l].push(a)},hu=(e,t)=>{const{obj:a,k:s}=Ko(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,s))return a[s]},eN=(e,t,a)=>{const s=hu(e,a);return s!==void 0?s:hu(t,a)},Xb=(e,t,a)=>{for(const s in t)s!=="__proto__"&&s!=="constructor"&&(s in e?Me(e[s])||e[s]instanceof String||Me(t[s])||t[s]instanceof String?a&&(e[s]=t[s]):Xb(e[s],t[s],a):e[s]=t[s]);return e},_s=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var tN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const nN=e=>Me(e)?e.replace(/[&<>"'\/]/g,t=>tN[t]):e;class aN{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const a=this.regExpMap.get(t);if(a!==void 0)return a;const s=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,s),this.regExpQueue.push(t),s}}const rN=[" ",",","?","!",";"],sN=new aN(20),iN=(e,t,a)=>{t=t||"",a=a||"";const s=rN.filter(u=>t.indexOf(u)<0&&a.indexOf(u)<0);if(s.length===0)return!0;const i=sN.getRegExp(`(${s.map(u=>u==="?"?"\\?":u).join("|")})`);let l=!i.test(e);if(!l){const u=e.indexOf(a);u>0&&!i.test(e.substring(0,u))&&(l=!0)}return l},qh=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const s=t.split(a);let i=e;for(let l=0;l<s.length;){if(!i||typeof i!="object")return;let u,f="";for(let m=l;m<s.length;++m)if(m!==l&&(f+=a),f+=s[m],u=i[f],u!==void 0){if(["string","number","boolean"].indexOf(typeof u)>-1&&m<s.length-1)continue;l+=m-l+1;break}i=u}return i},Wo=e=>e?.replace("_","-"),oN={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class mu{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||oN,this.options=a,this.debug=a.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,a,s,i){return i&&!this.debug?null:(Me(t[0])&&(t[0]=`${s}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new mu(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new mu(this.logger,t)}}var qa=new mu;class Ou{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(a)||0;this.observers[s].set(a,i+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,l])=>{for(let u=0;u<l;u++)i(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,l])=>{for(let u=0;u<l;u++)i.apply(i,[t,...a])})}}class l0 extends Ou{constructor(t,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}getResource(t,a,s,i={}){const l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,u=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;t.indexOf(".")>-1?f=t.split("."):(f=[t,a],s&&(Array.isArray(s)?f.push(...s):Me(s)&&l?f.push(...s.split(l)):f.push(s)));const m=hu(this.data,f);return!m&&!a&&!s&&t.indexOf(".")>-1&&(t=f[0],a=f[1],s=f.slice(2).join(".")),m||!u||!Me(s)?m:qh(this.data?.[t]?.[a],s,l)}addResource(t,a,s,i,l={silent:!1}){const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=[t,a];s&&(f=f.concat(u?s.split(u):s)),t.indexOf(".")>-1&&(f=t.split("."),i=a,a=f[1]),this.addNamespaces(a),o0(this.data,f,i),l.silent||this.emit("added",t,a,s,i)}addResources(t,a,s,i={silent:!1}){for(const l in s)(Me(s[l])||Array.isArray(s[l]))&&this.addResource(t,a,l,s[l],{silent:!0});i.silent||this.emit("added",t,a,s)}addResourceBundle(t,a,s,i,l,u={silent:!1,skipCopy:!1}){let f=[t,a];t.indexOf(".")>-1&&(f=t.split("."),i=s,s=a,a=f[1]),this.addNamespaces(a);let m=hu(this.data,f)||{};u.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?Xb(m,s,l):m={...m,...s},o0(this.data,f,m),u.silent||this.emit("added",t,a,s)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(i=>a[i]&&Object.keys(a[i]).length>0)}toJSON(){return this.data}}var Qb={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,s,i){return e.forEach(l=>{t=this.processors[l]?.process(t,a,s,i)??t}),t}};const Zb=Symbol("i18next/PATH_KEY");function lN(){const e=[],t=Object.create(null);let a;return t.get=(s,i)=>(a?.revoke?.(),i===Zb?e:(e.push(i),a=Proxy.revocable(s,t),a.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Fh(e,t){const{[Zb]:a}=e(lN());return a.join(t?.keySeparator??".")}const c0={},lh=e=>!Me(e)&&typeof e!="boolean"&&typeof e!="number";class pu extends Ou{constructor(t,a={}){super(),Z4(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=qa.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){const s={...a};if(t==null)return!1;const i=this.resolve(t,s);if(i?.res===void 0)return!1;const l=lh(i.res);return!(s.returnObjects===!1&&l)}extractFromKey(t,a){let s=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let l=a.ns||this.options.defaultNS||[];const u=s&&t.indexOf(s)>-1,f=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!iN(t,s,i);if(u&&!f){const m=t.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:t,namespaces:Me(l)?[l]:l};const h=t.split(s);(s!==i||s===i&&this.options.ns.indexOf(h[0])>-1)&&(l=h.shift()),t=h.join(i)}return{key:t,namespaces:Me(l)?[l]:l}}translate(t,a,s){let i=typeof a=="object"?{...a}:a;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Fh(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]);const l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:f,namespaces:m}=this.extractFromKey(t[t.length-1],i),h=m[m.length-1];let x=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;x===void 0&&(x=":");const y=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(y?.toLowerCase()==="cimode")return v?l?{res:`${h}${x}${f}`,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(i)}:`${h}${x}${f}`:l?{res:f,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(i)}:f;const b=this.resolve(t,i);let w=b?.res;const N=b?.usedKey||f,j=b?.exactUsedKey||f,E=["[object Number]","[object Function]","[object RegExp]"],R=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,O=i.count!==void 0&&!Me(i.count),I=pu.hasDefaultValue(i),B=O?this.pluralResolver.getSuffix(y,i.count,i):"",H=i.ordinal&&O?this.pluralResolver.getSuffix(y,i.count,{ordinal:!1}):"",T=O&&!i.ordinal&&i.count===0,P=T&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${B}`]||i[`defaultValue${H}`]||i.defaultValue;let X=w;k&&!w&&I&&(X=P);const de=lh(X),le=Object.prototype.toString.apply(X);if(k&&X&&de&&E.indexOf(le)<0&&!(Me(R)&&Array.isArray(X))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ce=this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,X,{...i,ns:m}):`key '${f} (${this.language})' returned an object instead of string.`;return l?(b.res=ce,b.usedParams=this.getUsedParamsDetails(i),b):ce}if(u){const ce=Array.isArray(X),D=ce?[]:{},F=ce?j:N;for(const A in X)if(Object.prototype.hasOwnProperty.call(X,A)){const G=`${F}${u}${A}`;I&&!w?D[A]=this.translate(G,{...i,defaultValue:lh(P)?P[A]:void 0,joinArrays:!1,ns:m}):D[A]=this.translate(G,{...i,joinArrays:!1,ns:m}),D[A]===G&&(D[A]=X[A])}w=D}}else if(k&&Me(R)&&Array.isArray(w))w=w.join(R),w&&(w=this.extendTranslation(w,t,i,s));else{let ce=!1,D=!1;!this.isValidLookup(w)&&I&&(ce=!0,w=P),this.isValidLookup(w)||(D=!0,w=f);const A=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:w,G=I&&P!==w&&this.options.updateMissing;if(D||ce||G){if(this.logger.log(G?"updateKey":"missingKey",y,h,f,G?P:w),u){const L=this.resolve(f,{...i,keySeparator:!1});L&&L.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 ae=[];const ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ee&&ee[0])for(let L=0;L<ee.length;L++)ae.push(ee[L]);else this.options.saveMissingTo==="all"?ae=this.languageUtils.toResolveHierarchy(i.lng||this.language):ae.push(i.lng||this.language);const J=(L,q,re)=>{const ie=I&&re!==w?re:A;this.options.missingKeyHandler?this.options.missingKeyHandler(L,h,q,ie,G,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(L,h,q,ie,G,i),this.emit("missingKey",L,h,q,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?ae.forEach(L=>{const q=this.pluralResolver.getSuffixes(L,i);T&&i[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(re=>{J([L],f+re,i[`defaultValue${re}`]||P)})}):J(ae,f,P))}w=this.extendTranslation(w,t,i,b,s),D&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${h}${x}${f}`),(D||ce)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${x}${f}`:f,ce?w:void 0,i))}return l?(b.res=w,b.usedParams=this.getUsedParamsDetails(i),b):w}extendTranslation(t,a,s,i,l){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const m=Me(t)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(m){const y=t.match(this.interpolator.nestingRegexp);h=y&&y.length}let x=s.replace&&!Me(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),t=this.interpolator.interpolate(t,x,s.lng||this.language||i.usedLng,s),m){const y=t.match(this.interpolator.nestingRegexp),v=y&&y.length;h<v&&(s.nest=!1)}!s.lng&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(t=this.interpolator.nest(t,(...y)=>l?.[0]===y[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${a[0]}`),null):this.translate(...y,a),s)),s.interpolation&&this.interpolator.reset()}const u=s.postProcess||this.options.postProcess,f=Me(u)?[u]:u;return t!=null&&f?.length&&s.applyPostProcessor!==!1&&(t=Qb.handle(f,t,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),t}resolve(t,a={}){let s,i,l,u,f;return Me(t)&&(t=[t]),t.forEach(m=>{if(this.isValidLookup(s))return;const h=this.extractFromKey(m,a),x=h.key;i=x;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const v=a.count!==void 0&&!Me(a.count),b=v&&!a.ordinal&&a.count===0,w=a.context!==void 0&&(Me(a.context)||typeof a.context=="number")&&a.context!=="",N=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);y.forEach(j=>{this.isValidLookup(s)||(f=j,!c0[`${N[0]}-${j}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(f)&&(c0[`${N[0]}-${j}`]=!0,this.logger.warn(`key "${i}" for languages "${N.join(", ")}" won't get resolved as namespace "${f}" 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!!!")),N.forEach(E=>{if(this.isValidLookup(s))return;u=E;const R=[x];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(R,x,E,j,a);else{let O;v&&(O=this.pluralResolver.getSuffix(E,a.count,a));const I=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(a.ordinal&&O.indexOf(B)===0&&R.push(x+O.replace(B,this.options.pluralSeparator)),R.push(x+O),b&&R.push(x+I)),w){const H=`${x}${this.options.contextSeparator||"_"}${a.context}`;R.push(H),v&&(a.ordinal&&O.indexOf(B)===0&&R.push(H+O.replace(B,this.options.pluralSeparator)),R.push(H+O),b&&R.push(H+I))}}let k;for(;k=R.pop();)this.isValidLookup(s)||(l=k,s=this.getResource(E,j,k,a))}))})}),{res:s,usedKey:i,exactUsedKey:l,usedLng:u,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,s,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,a,s,i):this.resourceStore.getResource(t,a,s,i)}getUsedParamsDetails(t={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=t.replace&&!Me(t.replace);let i=s?t.replace:t;if(s&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const l of a)delete i[l]}return i}static hasDefaultValue(t){const a="defaultValue";for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&a===s.substring(0,a.length)&&t[s]!==void 0)return!0;return!1}}class u0{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qa.create("languageUtils")}getScriptPartFromCode(t){if(t=Wo(t),!t||t.indexOf("-")<0)return null;const a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=Wo(t),!t||t.indexOf("-")<0)return t;const a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(Me(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let a;return t.forEach(s=>{if(a)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(a=i)}),!a&&this.options.supportedLngs&&t.forEach(s=>{if(a)return;const i=this.getScriptPartFromCode(s);if(this.isSupportedCode(i))return a=i;const l=this.getLanguagePartFromCode(s);if(this.isSupportedCode(l))return a=l;a=this.options.supportedLngs.find(u=>{if(u===l)return u;if(!(u.indexOf("-")<0&&l.indexOf("-")<0)&&(u.indexOf("-")>0&&l.indexOf("-")<0&&u.substring(0,u.indexOf("-"))===l||u.indexOf(l)===0&&l.length>1))return u})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),Me(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let s=t[a];return s||(s=t[this.getScriptPartFromCode(a)]),s||(s=t[this.formatLanguageCode(a)]),s||(s=t[this.getLanguagePartFromCode(a)]),s||(s=t.default),s||[]}toResolveHierarchy(t,a){const s=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),i=[],l=u=>{u&&(this.isSupportedCode(u)?i.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return Me(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(t))):Me(t)&&l(this.formatLanguageCode(t)),s.forEach(u=>{i.indexOf(u)<0&&l(this.formatLanguageCode(u))}),i}}const d0={zero:0,one:1,two:2,few:3,many:4,other:5},f0={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class cN{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=qa.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){const s=Wo(t==="dev"?"en":t),i=a.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:s,type:i});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let u;try{u=new Intl.PluralRules(s,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),f0;if(!t.match(/-|_/))return f0;const m=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(m,a)}return this.pluralRulesCache[l]=u,u}needsPlural(t,a={}){let s=this.getRule(t,a);return s||(s=this.getRule("dev",a)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,a,s={}){return this.getSuffixes(t,s).map(i=>`${a}${i}`)}getSuffixes(t,a={}){let s=this.getRule(t,a);return s||(s=this.getRule("dev",a)),s?s.resolvedOptions().pluralCategories.sort((i,l)=>d0[i]-d0[l]).map(i=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,a,s={}){const i=this.getRule(t,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,s))}}const h0=(e,t,a,s=".",i=!0)=>{let l=eN(e,t,a);return!l&&i&&Me(a)&&(l=qh(e,a,s),l===void 0&&(l=qh(t,a,s))),l},ch=e=>e.replace(/\$/g,"$$$$");class m0{constructor(t={}){this.logger=qa.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:a,escapeValue:s,useRawValueToEscape:i,prefix:l,prefixEscaped:u,suffix:f,suffixEscaped:m,formatSeparator:h,unescapeSuffix:x,unescapePrefix:y,nestingPrefix:v,nestingPrefixEscaped:b,nestingSuffix:w,nestingSuffixEscaped:N,nestingOptionsSeparator:j,maxReplaces:E,alwaysFormat:R}=t.interpolation;this.escape=a!==void 0?a:nN,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=l?_s(l):u||"{{",this.suffix=f?_s(f):m||"}}",this.formatSeparator=h||",",this.unescapePrefix=x?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":x||"",this.nestingPrefix=v?_s(v):b||_s("$t("),this.nestingSuffix=w?_s(w):N||_s(")"),this.nestingOptionsSeparator=j||",",this.maxReplaces=E||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(a,s)=>a?.source===s?(a.lastIndex=0,a):new RegExp(s,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,a,s,i){let l,u,f;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=b=>{if(b.indexOf(this.formatSeparator)<0){const E=h0(a,m,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,s,{...i,...a,interpolationkey:b}):E}const w=b.split(this.formatSeparator),N=w.shift().trim(),j=w.join(this.formatSeparator).trim();return this.format(h0(a,m,N,this.options.keySeparator,this.options.ignoreJSONStructure),j,s,{...i,...a,interpolationkey:N})};this.resetRegExp();const x=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,y=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>ch(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?ch(this.escape(b)):ch(b)}].forEach(b=>{for(f=0;l=b.regex.exec(t);){const w=l[1].trim();if(u=h(w),u===void 0)if(typeof x=="function"){const j=x(t,l,i);u=Me(j)?j:""}else if(i&&Object.prototype.hasOwnProperty.call(i,w))u="";else if(y){u=l[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),u="";else!Me(u)&&!this.useRawValueToEscape&&(u=r0(u));const N=b.safeValue(u);if(t=t.replace(l[0],N),y?(b.regex.lastIndex+=u.length,b.regex.lastIndex-=l[0].length):b.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),t}nest(t,a,s={}){let i,l,u;const f=(m,h)=>{const x=this.nestingOptionsSeparator;if(m.indexOf(x)<0)return m;const y=m.split(new RegExp(`${_s(x)}[ ]*{`));let v=`{${y[1]}`;m=y[0],v=this.interpolate(v,u);const b=v.match(/'/g),w=v.match(/"/g);((b?.length??0)%2===0&&!w||(w?.length??0)%2!==0)&&(v=v.replace(/'/g,'"'));try{u=JSON.parse(v),h&&(u={...h,...u})}catch(N){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,N),`${m}${x}${v}`}return u.defaultValue&&u.defaultValue.indexOf(this.prefix)>-1&&delete u.defaultValue,m};for(;i=this.nestingRegexp.exec(t);){let m=[];u={...s},u=u.replace&&!Me(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const h=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(h!==-1&&(m=i[1].slice(h).split(this.formatSeparator).map(x=>x.trim()).filter(Boolean),i[1]=i[1].slice(0,h)),l=a(f.call(this,i[1].trim(),u),u),l&&i[0]===t&&!Me(l))return l;Me(l)||(l=r0(l)),l||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),l=""),m.length&&(l=m.reduce((x,y)=>this.format(x,y,s.lng,{...s,interpolationkey:i[1].trim()}),l.trim())),t=t.replace(i[0],l),this.regexp.lastIndex=0}return t}}const uN=e=>{let t=e.toLowerCase().trim();const a={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);t==="currency"&&i.indexOf(":")<0?a.currency||(a.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?a.range||(a.range=i.trim()):i.split(";").forEach(u=>{if(u){const[f,...m]=u.split(":"),h=m.join(":").trim().replace(/^'+|'+$/g,""),x=f.trim();a[x]||(a[x]=h),h==="false"&&(a[x]=!1),h==="true"&&(a[x]=!0),isNaN(h)||(a[x]=parseInt(h,10))}})}return{formatName:t,formatOptions:a}},p0=e=>{const t={};return(a,s,i)=>{let l=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(l={...l,[i.interpolationkey]:void 0});const u=s+JSON.stringify(l);let f=t[u];return f||(f=e(Wo(s),i),t[u]=f),f(a)}},dN=e=>(t,a,s)=>e(Wo(a),s)(t);class fN{constructor(t={}){this.logger=qa.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const s=a.cacheInBuiltFormats?p0:dN;this.formats={number:s((i,l)=>{const u=new Intl.NumberFormat(i,{...l});return f=>u.format(f)}),currency:s((i,l)=>{const u=new Intl.NumberFormat(i,{...l,style:"currency"});return f=>u.format(f)}),datetime:s((i,l)=>{const u=new Intl.DateTimeFormat(i,{...l});return f=>u.format(f)}),relativetime:s((i,l)=>{const u=new Intl.RelativeTimeFormat(i,{...l});return f=>u.format(f,l.range||"day")}),list:s((i,l)=>{const u=new Intl.ListFormat(i,{...l});return f=>u.format(f)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=p0(a)}format(t,a,s,i={}){const l=a.split(this.formatSeparator);if(l.length>1&&l[0].indexOf("(")>1&&l[0].indexOf(")")<0&&l.find(f=>f.indexOf(")")>-1)){const f=l.findIndex(m=>m.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,f)].join(this.formatSeparator)}return l.reduce((f,m)=>{const{formatName:h,formatOptions:x}=uN(m);if(this.formats[h]){let y=f;try{const v=i?.formatParams?.[i.interpolationkey]||{},b=v.locale||v.lng||i.locale||i.lng||s;y=this.formats[h](f,b,{...x,...i,...v})}catch(v){this.logger.warn(v)}return y}else this.logger.warn(`there was no format function for ${h}`);return f},t)}}const hN=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class mN extends Ou{constructor(t,a,s,i={}){super(),this.backend=t,this.store=a,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=qa.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,i.backend,i)}queueLoad(t,a,s,i){const l={},u={},f={},m={};return t.forEach(h=>{let x=!0;a.forEach(y=>{const v=`${h}|${y}`;!s.reload&&this.store.hasResourceBundle(h,y)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?u[v]===void 0&&(u[v]=!0):(this.state[v]=1,x=!1,u[v]===void 0&&(u[v]=!0),l[v]===void 0&&(l[v]=!0),m[y]===void 0&&(m[y]=!0)))}),x||(f[h]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(m)}}loaded(t,a,s){const i=t.split("|"),l=i[0],u=i[1];a&&this.emit("failedLoading",l,u,a),!a&&s&&this.store.addResourceBundle(l,u,s,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&s&&(this.state[t]=0);const f={};this.queue.forEach(m=>{W4(m.loaded,[l],u),hN(m,t),a&&m.errors.push(a),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(h=>{f[h]||(f[h]={});const x=m.loaded[h];x.length&&x.forEach(y=>{f[h][y]===void 0&&(f[h][y]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(m=>!m.done)}read(t,a,s,i=0,l=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:s,tried:i,wait:l,callback:u});return}this.readingCalls++;const f=(h,x)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&x&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,a,s,i+1,l*2,u)},l);return}u(h,x)},m=this.backend[s].bind(this.backend);if(m.length===2){try{const h=m(t,a);h&&typeof h.then=="function"?h.then(x=>f(null,x)).catch(f):f(null,h)}catch(h){f(h)}return}return m(t,a,f)}prepareLoading(t,a,s={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Me(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Me(a)&&(a=[a]);const l=this.queueLoad(t,a,s,i);if(!l.toLoad.length)return l.pending.length||i(),null;l.toLoad.forEach(u=>{this.loadOne(u)})}load(t,a,s){this.prepareLoading(t,a,{},s)}reload(t,a,s){this.prepareLoading(t,a,{reload:!0},s)}loadOne(t,a=""){const s=t.split("|"),i=s[0],l=s[1];this.read(i,l,"read",void 0,void 0,(u,f)=>{u&&this.logger.warn(`${a}loading namespace ${l} for language ${i} failed`,u),!u&&f&&this.logger.log(`${a}loaded namespace ${l} for language ${i}`,f),this.loaded(t,u,f)})}saveMissing(t,a,s,i,l,u={},f=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(a)){this.logger.warn(`did not save key "${s}" as the namespace "${a}" 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(!(s==null||s==="")){if(this.backend?.create){const m={...u,isUpdate:l},h=this.backend.create.bind(this.backend);if(h.length<6)try{let x;h.length===5?x=h(t,a,s,i,m):x=h(t,a,s,i),x&&typeof x.then=="function"?x.then(y=>f(null,y)).catch(f):f(null,x)}catch(x){f(x)}else h(t,a,s,i,f,m)}!t||!t[0]||this.store.addResource(t[0],a,s,i)}}}const uh=()=>({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:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Me(e[1])&&(t.defaultValue=e[1]),Me(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(s=>{t[s]=a[s]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),g0=e=>(Me(e.ns)&&(e.ns=[e.ns]),Me(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Me(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Uc=()=>{},pN=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})},Jb="__i18next_supportNoticeShown",gN=()=>typeof globalThis<"u"&&!!globalThis[Jb],xN=()=>{typeof globalThis<"u"&&(globalThis[Jb]=!0)},yN=e=>!!(e?.modules?.backend?.name?.indexOf("Locize")>0||e?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||e?.options?.backend?.backends&&e.options.backend.backends.some(t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(t=>t?.projectId));class Xo extends Ou{constructor(t={},a){if(super(),this.options=g0(t),this.services={},this.logger=qa,this.modules={external:[]},pN(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(Me(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=uh();this.options={...s,...this.options,...g0(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!yN(this)&&!gN()&&(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 💙"),xN());const i=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?qa.init(i(this.modules.logger),this.options):qa.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=fN;const x=new u0(this.options);this.store=new l0(this.options.resources,this.options);const y=this.services;y.logger=qa,y.resourceStore=this.store,y.languageUtils=x,y.pluralResolver=new cN(x,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.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===s.interpolation.format)&&(y.formatter=i(h),y.formatter.init&&y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new m0(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new mN(i(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",(b,...w)=>{this.emit(b,...w)}),this.modules.languageDetector&&(y.languageDetector=i(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=i(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new pu(this.services,this.options),this.translator.on("*",(b,...w)=>{this.emit(b,...w)}),this.modules.external.forEach(b=>{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,a||(a=Uc),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]=(...x)=>this.store[h](...x)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...x)=>(this.store[h](...x),this)});const f=Ro(),m=()=>{const h=(x,y)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(y),a(x,y)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),f}loadResources(t,a=Uc){let s=a;const i=Me(t)?t:this.language;if(typeof t=="function"&&(s=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const l=[],u=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(h=>{h!=="cimode"&&l.indexOf(h)<0&&l.push(h)})};i?u(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>u(m)),this.options.preload?.forEach?.(f=>u(f)),this.services.backendConnector.load(l,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(f)})}else s(null)}reloadResources(t,a,s){const i=Ro();return typeof t=="function"&&(s=t,t=void 0),typeof a=="function"&&(s=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),s||(s=Uc),this.services.backendConnector.reload(t,a,l=>{i.resolve(),s(l)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Qb.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let a=0;a<this.languages.length;a++){const s=this.languages[a];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;const s=Ro();this.emit("languageChanging",t);const i=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,m)=>{m?this.isLanguageChangingTo===t&&(i(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,s.resolve((...h)=>this.t(...h)),a&&a(f,(...h)=>this.t(...h))},u=f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const m=Me(f)?f:f&&f[0],h=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(Me(f)?[f]:f);h&&(this.language||i(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector?.cacheUserLanguage?.(h)),this.loadResources(h,x=>{l(x,h)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),s}getFixedT(t,a,s){const i=(l,u,...f)=>{let m;typeof u!="object"?m=this.options.overloadTranslationOptionHandler([l,u].concat(f)):m={...u},m.lng=m.lng||i.lng,m.lngs=m.lngs||i.lngs,m.ns=m.ns||i.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||s||i.keyPrefix);const h=this.options.keySeparator||".";let x;return m.keyPrefix&&Array.isArray(l)?x=l.map(y=>(typeof y=="function"&&(y=Fh(y,{...this.options,...u})),`${m.keyPrefix}${h}${y}`)):(typeof l=="function"&&(l=Fh(l,{...this.options,...u})),x=m.keyPrefix?`${m.keyPrefix}${h}${l}`:l),this.t(x,m)};return Me(t)?i.lng=t:i.lngs=t,i.ns=a,i.keyPrefix=s,i}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){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 s=a.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const u=(f,m)=>{const h=this.services.backendConnector.state[`${f}|${m}`];return h===-1||h===0||h===2};if(a.precheck){const f=a.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(s,t)&&(!i||u(l,t)))}loadNamespaces(t,a){const s=Ro();return this.options.ns?(Me(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),a&&a(i)}),s):(a&&a(),Promise.resolve())}loadLanguages(t,a){const s=Ro();Me(t)&&(t=[t]);const i=this.options.preload||[],l=t.filter(u=>i.indexOf(u)<0&&this.services.languageUtils.isSupportedCode(u));return l.length?(this.options.preload=i.concat(l),this.loadResources(u=>{s.resolve(),a&&a(u)}),s):(a&&a(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const l=i.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const a=["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"],s=this.services?.languageUtils||new u0(uh());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(s.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){const s=new Xo(t,a);return s.createInstance=Xo.createInstance,s}cloneInstance(t={},a=Uc){const s=t.forkResourceStore;s&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},l=new Xo(i);if((t.debug!==void 0||t.prefix!==void 0)&&(l.logger=l.logger.clone(t)),["store","services","language"].forEach(f=>{l[f]=this[f]}),l.services={...this.services},l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},s){const f=Object.keys(this.store.data).reduce((m,h)=>(m[h]={...this.store.data[h]},m[h]=Object.keys(m[h]).reduce((x,y)=>(x[y]={...m[h][y]},x),m[h]),m),{});l.store=new l0(f,i),l.services.resourceStore=l.store}if(t.interpolation){const m={...uh().interpolation,...this.options.interpolation,...t.interpolation},h={...i,interpolation:m};l.services.interpolator=new m0(h)}return l.translator=new pu(l.services,i),l.translator.on("*",(f,...m)=>{l.emit(f,...m)}),l.init(i,a),l.translator.options=i,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const On=Xo.createInstance();On.createInstance;On.dir;On.init;On.loadResources;On.reloadResources;On.use;On.changeLanguage;On.getFixedT;On.t;On.exists;On.setDefaultNamespace;On.hasLoadedNamespace;On.loadNamespaces;On.loadLanguages;var dh={exports:{}},Ue={};var x0;function vN(){if(x0)return Ue;x0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,j={};function E(L,q,re){this.props=L,this.context=q,this.refs=j,this.updater=re||w}E.prototype.isReactComponent={},E.prototype.setState=function(L,q){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,q,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=E.prototype;function k(L,q,re){this.props=L,this.context=q,this.refs=j,this.updater=re||w}var O=k.prototype=new R;O.constructor=k,N(O,E.prototype),O.isPureReactComponent=!0;var I=Array.isArray;function B(){}var H={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function P(L,q,re){var ie=re.ref;return{$$typeof:e,type:L,key:q,ref:ie!==void 0?ie:null,props:re}}function X(L,q){return P(L.type,q,L.props)}function de(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function le(L){var q={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(re){return q[re]})}var ce=/\/+/g;function D(L,q){return typeof L=="object"&&L!==null&&L.key!=null?le(""+L.key):q.toString(36)}function F(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(B,B):(L.status="pending",L.then(function(q){L.status==="pending"&&(L.status="fulfilled",L.value=q)},function(q){L.status==="pending"&&(L.status="rejected",L.reason=q)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function A(L,q,re,ie,ge){var xe=typeof L;(xe==="undefined"||xe==="boolean")&&(L=null);var Ee=!1;if(L===null)Ee=!0;else switch(xe){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(L.$$typeof){case e:case t:Ee=!0;break;case x:return Ee=L._init,A(Ee(L._payload),q,re,ie,ge)}}if(Ee)return ge=ge(L),Ee=ie===""?"."+D(L,0):ie,I(ge)?(re="",Ee!=null&&(re=Ee.replace(ce,"$&/")+"/"),A(ge,q,re,"",function(vn){return vn})):ge!=null&&(de(ge)&&(ge=X(ge,re+(ge.key==null||L&&L.key===ge.key?"":(""+ge.key).replace(ce,"$&/")+"/")+Ee)),q.push(ge)),1;Ee=0;var De=ie===""?".":ie+":";if(I(L))for(var qe=0;qe<L.length;qe++)ie=L[qe],xe=De+D(ie,qe),Ee+=A(ie,q,re,xe,ge);else if(qe=b(L),typeof qe=="function")for(L=qe.call(L),qe=0;!(ie=L.next()).done;)ie=ie.value,xe=De+D(ie,qe++),Ee+=A(ie,q,re,xe,ge);else if(xe==="object"){if(typeof L.then=="function")return A(F(L),q,re,ie,ge);throw q=String(L),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function G(L,q,re){if(L==null)return L;var ie=[],ge=0;return A(L,ie,"","",function(xe){return q.call(re,xe,ge++)}),ie}function ae(L){if(L._status===-1){var q=L._result;q=q(),q.then(function(re){(L._status===0||L._status===-1)&&(L._status=1,L._result=re)},function(re){(L._status===0||L._status===-1)&&(L._status=2,L._result=re)}),L._status===-1&&(L._status=0,L._result=q)}if(L._status===1)return L._result.default;throw L._result}var ee=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},J={map:G,forEach:function(L,q,re){G(L,function(){q.apply(this,arguments)},re)},count:function(L){var q=0;return G(L,function(){q++}),q},toArray:function(L){return G(L,function(q){return q})||[]},only:function(L){if(!de(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ue.Activity=y,Ue.Children=J,Ue.Component=E,Ue.Fragment=a,Ue.Profiler=i,Ue.PureComponent=k,Ue.StrictMode=s,Ue.Suspense=m,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(L){return H.H.useMemoCache(L)}},Ue.cache=function(L){return function(){return L.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(L,q,re){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ie=N({},L.props),ge=L.key;if(q!=null)for(xe in q.key!==void 0&&(ge=""+q.key),q)!T.call(q,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&q.ref===void 0||(ie[xe]=q[xe]);var xe=arguments.length-2;if(xe===1)ie.children=re;else if(1<xe){for(var Ee=Array(xe),De=0;De<xe;De++)Ee[De]=arguments[De+2];ie.children=Ee}return P(L.type,ge,ie)},Ue.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},Ue.createElement=function(L,q,re){var ie,ge={},xe=null;if(q!=null)for(ie in q.key!==void 0&&(xe=""+q.key),q)T.call(q,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ge[ie]=q[ie]);var Ee=arguments.length-2;if(Ee===1)ge.children=re;else if(1<Ee){for(var De=Array(Ee),qe=0;qe<Ee;qe++)De[qe]=arguments[qe+2];ge.children=De}if(L&&L.defaultProps)for(ie in Ee=L.defaultProps,Ee)ge[ie]===void 0&&(ge[ie]=Ee[ie]);return P(L,xe,ge)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(L){return{$$typeof:f,render:L}},Ue.isValidElement=de,Ue.lazy=function(L){return{$$typeof:x,_payload:{_status:-1,_result:L},_init:ae}},Ue.memo=function(L,q){return{$$typeof:h,type:L,compare:q===void 0?null:q}},Ue.startTransition=function(L){var q=H.T,re={};H.T=re;try{var ie=L(),ge=H.S;ge!==null&&ge(re,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(B,ee)}catch(xe){ee(xe)}finally{q!==null&&re.types!==null&&(q.types=re.types),H.T=q}},Ue.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Ue.use=function(L){return H.H.use(L)},Ue.useActionState=function(L,q,re){return H.H.useActionState(L,q,re)},Ue.useCallback=function(L,q){return H.H.useCallback(L,q)},Ue.useContext=function(L){return H.H.useContext(L)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(L,q){return H.H.useDeferredValue(L,q)},Ue.useEffect=function(L,q){return H.H.useEffect(L,q)},Ue.useEffectEvent=function(L){return H.H.useEffectEvent(L)},Ue.useId=function(){return H.H.useId()},Ue.useImperativeHandle=function(L,q,re){return H.H.useImperativeHandle(L,q,re)},Ue.useInsertionEffect=function(L,q){return H.H.useInsertionEffect(L,q)},Ue.useLayoutEffect=function(L,q){return H.H.useLayoutEffect(L,q)},Ue.useMemo=function(L,q){return H.H.useMemo(L,q)},Ue.useOptimistic=function(L,q){return H.H.useOptimistic(L,q)},Ue.useReducer=function(L,q,re){return H.H.useReducer(L,q,re)},Ue.useRef=function(L){return H.H.useRef(L)},Ue.useState=function(L){return H.H.useState(L)},Ue.useSyncExternalStore=function(L,q,re){return H.H.useSyncExternalStore(L,q,re)},Ue.useTransition=function(){return H.H.useTransition()},Ue.version="19.2.4",Ue}var y0;function Du(){return y0||(y0=1,dh.exports=vN()),dh.exports}var _=Du();const wi=Kb(_),bN=K4({__proto__:null,default:wi},[_]),_N=(e,t,a,s)=>{const i=[a,{code:t,...s||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Ts(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},v0={},Wb=(e,t,a,s)=>{Ts(a)&&v0[a]||(Ts(a)&&(v0[a]=new Date),_N(e,t,a,s))},e_=(e,t)=>()=>{if(e.isInitialized)t();else{const a=()=>{setTimeout(()=>{e.off("initialized",a)},0),t()};e.on("initialized",a)}},Yh=(e,t,a)=>{e.loadNamespaces(t,e_(e,a))},b0=(e,t,a,s)=>{if(Ts(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Yh(e,a,s);a.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,e_(e,s))},SN=(e,t,a={})=>!t.languages||!t.languages.length?(Wb(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:a.lng,precheck:(s,i)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!i(s.isLanguageChangingTo,e))return!1}}),Ts=e=>typeof e=="string",wN=e=>typeof e=="object"&&e!==null,NN=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,jN={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},EN=e=>jN[e],CN=e=>e.replace(NN,EN);let Kh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:CN,transDefaultProps:void 0};const kN=(e={})=>{Kh={...Kh,...e}},RN=()=>Kh;let t_;const TN=e=>{t_=e},AN=()=>t_,LN={type:"3rdParty",init(e){kN(e.options.react),TN(e)}},ON=_.createContext();class DN{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var fh={exports:{}},hh={};var _0;function MN(){if(_0)return hh;_0=1;var e=Du();function t(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var a=typeof Object.is=="function"?Object.is:t,s=e.useState,i=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(y,v){var b=v(),w=s({inst:{value:b,getSnapshot:v}}),N=w[0].inst,j=w[1];return l(function(){N.value=b,N.getSnapshot=v,m(N)&&j({inst:N})},[y,b,v]),i(function(){return m(N)&&j({inst:N}),y(function(){m(N)&&j({inst:N})})},[y]),u(b),b}function m(y){var v=y.getSnapshot;y=y.value;try{var b=v();return!a(y,b)}catch{return!0}}function h(y,v){return v()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return hh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,hh}var S0;function zN(){return S0||(S0=1,fh.exports=MN()),fh.exports}var UN=zN();const $N=(e,t)=>Ts(t)?t:wN(t)&&Ts(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,HN={t:$N,ready:!1},BN=()=>()=>{},ye=(e,t={})=>{const{i18n:a}=t,{i18n:s,defaultNS:i}=_.useContext(ON)||{},l=a||s||AN();l&&!l.reportNamespaces&&(l.reportNamespaces=new DN),l||Wb(l,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=_.useMemo(()=>({...RN(),...l?.options?.react,...t}),[l,t]),{useSuspense:f,keyPrefix:m}=u,h=i||l?.options?.defaultNS,x=Ts(h)?[h]:h||["translation"],y=_.useMemo(()=>x,x);l?.reportNamespaces?.addUsedNamespaces?.(y);const v=_.useRef(0),b=_.useCallback(P=>{if(!l)return BN;const{bindI18n:X,bindI18nStore:de}=u,le=()=>{v.current+=1,P()};return X&&l.on(X,le),de&&l.store.on(de,le),()=>{X&&X.split(" ").forEach(ce=>l.off(ce,le)),de&&de.split(" ").forEach(ce=>l.store.off(ce,le))}},[l,u]),w=_.useRef(),N=_.useCallback(()=>{if(!l)return HN;const P=!!(l.isInitialized||l.initializedStoreOnce)&&y.every(F=>SN(F,l,u)),X=t.lng||l.language,de=v.current,le=w.current;if(le&&le.ready===P&&le.lng===X&&le.keyPrefix===m&&le.revision===de)return le;const D={t:l.getFixedT(X,u.nsMode==="fallback"?y:y[0],m),ready:P,lng:X,keyPrefix:m,revision:de};return w.current=D,D},[l,y,m,u,t.lng]),[j,E]=_.useState(0),{t:R,ready:k}=UN.useSyncExternalStore(b,N,N);_.useEffect(()=>{if(l&&!k&&!f){const P=()=>E(X=>X+1);t.lng?b0(l,t.lng,y,P):Yh(l,y,P)}},[l,t.lng,y,k,f,j]);const O=l||{},I=_.useRef(null),B=_.useRef(),H=P=>{const X=Object.getOwnPropertyDescriptors(P);X.__original&&delete X.__original;const de=Object.create(Object.getPrototypeOf(P),X);if(!Object.prototype.hasOwnProperty.call(de,"__original"))try{Object.defineProperty(de,"__original",{value:P,writable:!1,enumerable:!1,configurable:!1})}catch{}return de},T=_.useMemo(()=>{const P=O,X=P?.language;let de=P;P&&(I.current&&I.current.__original===P?B.current!==X?(de=H(P),I.current=de,B.current=X):de=I.current:(de=H(P),I.current=de,B.current=X));const le=[R,de,k];return le.t=R,le.i18n=de,le.ready=k,le},[R,O,k,O.resolvedLanguage,O.language,O.languages]);if(l&&f&&!k)throw new Promise(P=>{const X=()=>P();t.lng?b0(l,t.lng,y,X):Yh(l,y,X)});return T},{slice:IN,forEach:PN}=[];function GN(e){return PN.call(IN.call(arguments,1),t=>{if(t)for(const a in t)e[a]===void 0&&(e[a]=t[a])}),e}function VN(e){return typeof e!="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(a=>a.test(e))}const w0=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,qN=function(e,t){const s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let l=`${e}=${i}`;if(s.maxAge>0){const u=s.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(u)}`}if(s.domain){if(!w0.test(s.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${s.domain}`}if(s.path){if(!w0.test(s.path))throw new TypeError("option path is invalid");l+=`; Path=${s.path}`}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${s.expires.toUTCString()}`}if(s.httpOnly&&(l+="; HttpOnly"),s.secure&&(l+="; Secure"),s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s.partitioned&&(l+="; Partitioned"),l},N0={create(e,t,a,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};a&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+a*60*1e3)),s&&(i.domain=s),document.cookie=qN(e,t,i)},read(e){const t=`${e}=`,a=document.cookie.split(";");for(let s=0;s<a.length;s++){let i=a[s];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var FN={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return N0.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:a,cookieMinutes:s,cookieDomain:i,cookieOptions:l}=t;a&&typeof document<"u"&&N0.create(a,e,s,i,l)}},YN={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,a;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const l=s.substring(1).split("&");for(let u=0;u<l.length;u++){const f=l[u].indexOf("=");f>0&&l[u].substring(0,f)===t&&(a=l[u].substring(f+1))}}return a}},KN={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:a}=e,s;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const l=i.substring(1);if(t){const u=l.split("&");for(let f=0;f<u.length;f++){const m=u[f].indexOf("=");m>0&&u[f].substring(0,m)===t&&(s=u[f].substring(m+1))}}if(s)return s;if(!s&&a>-1){const u=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(u)?u[typeof a=="number"?a:0]?.replace("/",""):void 0}}}return s}};let yi=null;const j0=()=>{if(yi!==null)return yi;try{if(yi=typeof window<"u"&&window.localStorage!==null,!yi)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{yi=!1}return yi};var XN={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&j0())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:a}=t;a&&j0()&&window.localStorage.setItem(a,e)}};let vi=null;const E0=()=>{if(vi!==null)return vi;try{if(vi=typeof window<"u"&&window.sessionStorage!==null,!vi)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{vi=!1}return vi};var QN={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&E0())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:a}=t;a&&E0()&&window.sessionStorage.setItem(a,e)}},ZN={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:a,userLanguage:s,language:i}=navigator;if(a)for(let l=0;l<a.length;l++)t.push(a[l]);s&&t.push(s),i&&t.push(i)}return t.length>0?t:void 0}},JN={name:"htmlTag",lookup(e){let{htmlTag:t}=e,a;const s=t||(typeof document<"u"?document.documentElement:null);return s&&typeof s.getAttribute=="function"&&(a=s.getAttribute("lang")),a}},WN={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof t=="number"?t:0]?.replace("/",""):void 0}},e2={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const a=typeof t=="number"?t+1:1,s=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[a]}};let n_=!1;try{document.cookie,n_=!0}catch{}const a_=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];n_||a_.splice(1,1);const t2=()=>({order:a_,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class r_{constructor(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,a)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=GN(a,this.options||{},t2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(FN),this.addDetector(YN),this.addDetector(XN),this.addDetector(QN),this.addDetector(ZN),this.addDetector(JN),this.addDetector(WN),this.addDetector(e2),this.addDetector(KN)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,a=[];return t.forEach(s=>{if(this.detectors[s]){let i=this.detectors[s].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(a=a.concat(i))}}),a=a.filter(s=>s!=null&&!VN(s)).map(s=>this.options.convertDetectedLanguage(s)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}cacheUserLanguage(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||a.forEach(s=>{this.detectors[s]&&this.detectors[s].cacheUserLanguage(t,this.options)}))}}r_.type="languageDetector";const n2={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub · @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. All rights reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management","login.title":"SIGN IN","login.provider_cta":"Sign in with {{name}}","login.loading":"LOADING...","login.authenticating":"AUTHENTICATING...","login.or":"OR","login.test_account":"Test Account","login.error":"Failed to load login options","login.retry":"Retry","user.menu.connect_source":"Connect Source","user.menu.sign_out":"Sign out","api_keys.title":"API Keys","api_keys.description":"API Keys for programmatic access to C4A API (AI Agent, CLI, CI/CD)","api_keys.create":"Create API Key","api_keys.created":"API Key Created","api_keys.copy_warning":"Copy now, this key won't be shown again.","api_keys.copy":"Copy","api_keys.copied":"Copied!","api_keys.done":"Done","api_keys.empty.title":"No API Keys","api_keys.empty.description":"API Keys for programmatic access to C4A API","api_keys.created_at":"Created {{date}}","api_keys.never_used":"Never used","api_keys.expires.never":"Never expires","api_keys.expires.30d":"30 days","api_keys.expires.90d":"90 days","api_keys.expires.1y":"1 year","api_keys.form.name":"Name","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"Expiration (optional)","api_keys.delete.confirm":"Delete this API key? This action cannot be undone.","workspace.default_name":"My Brain","settings.tab.general":"General","settings.tab.api_keys":"API Keys","page.docs.title":"Docs","page.docs.description":"Public documentation portal","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI — only what stands up to scrutiny gets written to the knowledge graph","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here — browse, search, analyze, and use it anytime","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains — get notified on updates, no manual transfer needed","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","error.description":"Something went wrong. Please try again.","error.reload":"Reload","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.menu.status_online":"{{machine}} connected","sources.menu.status_offline":"{{machine}} not connected, click for setup guide","sources.library.default_cloud_name":"My Drive","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.status.go_index":"Index","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Select Version","sources.import.step.confirm":"Import Complete","sources.import.daemon_offline":"Client {{name}} is not connected. Please start the local Daemon and connect to the server before importing.","sources.import.view_guide":"View Connection Guide","sources.import.select_root":"Select repository root directory","sources.import.current_path":"Current path","sources.import.not_git":"This directory is not a Git repository. Please select a directory containing .git.","sources.import.branch":"Branch","sources.import.commit":"Commit","sources.import.branch_warning":"Currently based on {{branch}} branch HEAD","sources.import.uncommitted_warning":"Uncommitted changes will not be collected","sources.import.recognized":"Recognized {{packages}} packages and {{docs}} documents","sources.import.no_packages":"No package structure detected. Will be imported as a single-package repository.","sources.import.confirm_heading":"About to import the following repository to {{name}}:","sources.import.packages":"Packages","sources.import.documents":"Documents","sources.import.loading_repo":"Loading repository info...","sources.import.loading_repo_slow":"Large repositories (>10 GB) may take 5–10 seconds...","sources.import.importing":"Importing...","sources.import.error_title":"Import Failed","sources.import.success":"Import complete","sources.import.stage.prepare":"Preparing environment","sources.import.stage.clone":"Cloning repository","sources.import.stage.scan":"Scanning project","sources.import.stage.save":"Saving sources","sources.import.stage.done_suffix":"done","sources.import.stage.complete":"Import complete","sources.import.step.loading":"Data Import","sources.import.done":"Done","sources.import.back":"Back","sources.import.retry":"Retry","sources.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step2_allow":"Restrict access to specific directories (does not affect existing imports)","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.not_found_title":"Source Not Found","sources.detail.not_found_desc":"This source could not be found. It may have been deleted or the ID is invalid.","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory path…","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_name_hint":"Display name in the source tree after import. Leave empty to use the default repository name.","sources.import.dir_name_duplicate":"This name already exists. Please use a different name.","sources.import.dir_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Repositories (skipped)","sources.import.dir_git_hint":"Git repositories inside the directory will not be expanded for indexing. Import them separately if needed.","sources.import.dir_scanning":"Scanning directory contents...","sources.import.dir_scan_complete":"Scan complete","sources.import.dir_scan_error":"Failed to scan directory","sources.import.dir_scan_retry":"Retry","sources.import.dir_code_packages":"Code Packages","sources.import.dir_code_packages_tip":"Supported: package.json, pyproject.toml, setup.py, go.mod, Cargo.toml, pom.xml, build.gradle","sources.import.dir_doc_files":"Documents","sources.import.dir_doc_files_tip":"Supported: Markdown (.md)","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"Git repos are skipped. Use 'Import Repository' instead.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown Document","sources.actions.upload_doc":"Document","sources.actions.upload_document":"Upload Document","sources.actions.add":"Add","sources.actions.add_folder":"Folder","sources.actions.add_web":"Web Page","sources.actions.add_feishu":"Feishu Document","sources.actions.import_dir":"Import Directory","sources.actions.import_repo_url":"Import Repository","sources.upgrade.title":"Feature Upgrading","sources.upgrade.description":"This feature will be available in version 0.5.x. Stay tuned.","sources.upload.title":"Upload Documents","sources.upload.drop_hint":"Click to select or drag files here","sources.upload.supported_formats":"Supported: .md, .doc, .docx, .pdf, .ppt, .pptx, .txt (max 5MB each, up to 10 files)","sources.upload.file_too_large":'"{{name}}" exceeds 5MB limit',"sources.upload.too_many_files":"Maximum 10 files allowed, please re-select","sources.upload.unsupported_type":'"{{name}}" is not a supported file type',"sources.upload.uploading":"Uploading...","sources.upload.success":"Uploaded {{count}} documents","sources.upload.selected":"{{count}} files selected","sources.upload.remove":"Remove","sources.import_remote.title":"Import Remote Repository","sources.import_remote.step.loading":"Data Import","sources.import_remote.url_label":"Repository URL","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"Only HTTPS URLs are accepted. SSH support is planned for a future release","sources.import_remote.url_hint_public":"Supports public Git repositories without authentication, and Git services with OAuth configured: ","sources.import_remote.url_hint_no_auth":"Supports public Git repositories and Git services with OAuth configured","sources.import_remote.url_invalid":"Only HTTPS Git URLs are supported","sources.import_remote.ref_label":"Branch / Tag","sources.import_remote.ref_branches":"Branches","sources.import_remote.ref_tags":"Tags","sources.import_remote.ref_search":"Search branches or tags…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"Auto-filled with the latest commit of selected branch. You can also type or search","sources.import_remote.commit_search":"Search commit…","sources.import_remote.loading_refs":"Querying repository branches...","sources.import_remote.loading_refs_slow":"Large projects may take 10–30s, please wait...","sources.import_remote.summary_repo":"Repository","sources.import_remote.summary_branch":"Branch","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"Preparing environment","sources.import_remote.stage.clone":"Cloning repository","sources.import_remote.stage.scan":"Scanning project","sources.import_remote.stage.save":"Saving sources","sources.import_remote.complete":"Import complete","sources.import_remote.back_to_library":"Done","sources.import_remote.retry":"Retry","sources.import_remote.back":"Back","sources.import_remote.error.auth_required":"This repository requires authentication. Please configure an access token for {{host}} in Server Settings → Git Tokens.","sources.import_remote.error.auth_failed":"Authentication failed. Please check your Git token configuration.","sources.import_remote.error.not_found":"Repository not found or no access. Please check the URL.","sources.import_remote.error.network":"Cannot connect to the remote repository. Please check your network or try again later.","sources.import_remote.error.capacity":"Import queue is full. Please try again later.","sources.import_remote.error.clone_failed":"Clone failed","sources.import_remote.error.scan_failed":"Scan failed","sources.import_remote.error.save_failed":"Save failed","sources.change_detection.has_updates":"Has updates","sources.change_detection.reimport":"Re-import","sources.safety.notice.remote":"The remote repository will be cloned to the server for analysis. Code will not be uploaded to any third-party services.","content.detail.tab.raw":"Raw Content","content.detail.tab.digest":"Digest","content.detail.tab.extraction":"LLM Extraction","content.detail.tab.entities":"Entities","content.card.lines":"Lines {{start}}-{{end}}","content.detail.size":"Size","content.detail.created_at":"Created","content.detail.sources":"Sources","content.detail.language":"Language","content.detail.model":"Model","entity.detail.tab.overview":"Overview","entity.detail.tab.relations":"Relations","entity.detail.tab.contents":"Contents","entity.detail.tab.referrers":"Referrers","entity.detail.tab.neighbors":"Neighbors","entity.detail.type":"Type","entity.detail.kind":"Kind","entity.detail.perspective":"Perspective","entity.detail.scope":"Scope","relation.detail.tab.overview":"Overview","relation.detail.weight":"Weight","relation.detail.confidence":"Confidence","relation.detail.from":"From","relation.detail.to":"To","relation.detail.description":"Description","relation.detail.data":"Additional Data","relation.detail.source_refs":"Content Sources","relation.detail.meta":"Metadata","relation.detail.source_label":"Source","relation.detail.source_field_sync":"System-derived","relation.detail.source_explicit":"Explicitly declared","relation.filter.direction.all":"All Directions","relation.filter.direction.outgoing":"Outgoing →","relation.filter.direction.incoming":"← Incoming","relation.filter.type.all":"All Types","ref.stale":"Stale ref","ref.unknown":"Unknown entity","ref.retry":"Resolve failed, click to retry","confidence.high":"High confidence","confidence.ai":"AI suggestion","confidence.low":"Low confidence","source.field_sync":"System-derived","source.explicit":"Explicitly declared","common.empty.content_raw.title":"Content unavailable","common.empty.content_raw.description":"This content was imported by a local Daemon; the raw text was not uploaded to the server.","common.empty.content_digest.title":"Not yet indexed","common.empty.content_digest.description":"This content has not been through structured indexing yet.","common.empty.content_extraction.title":"Not yet extracted","common.empty.content_extraction.description":"AI has not yet performed entity extraction and analysis on this content.","common.empty.content_entities.title":"No associated entities","common.empty.content_entities.description":"No entities have been extracted from this content yet.","common.empty.entity_relations.title":"No relations","common.empty.entity_relations.description":"This entity is currently an island with no connections to other entities.","common.empty.entity_contents.title":"No content sources","common.empty.entity_contents.description":"This entity is not linked to any source code or document content.","common.empty.entity_referrers.title":"No referrers","common.empty.entity_referrers.description":"No other entities currently reference this entity in their data fields.","common.empty.entity_neighbors.title":"No neighbors","common.empty.entity_neighbors.description":"This entity has no directly connected neighbor nodes in the graph.","common.error.not_found":"Resource not found","common.error.not_found_description":"The requested resource does not exist or has been removed.","common.error.load_failed":"Failed to load","common.error.load_failed_description":"An error occurred while loading data. Please try again.","explorer.mode.append":"Append","explorer.mode.replace":"Replace","explorer.mode.append_tooltip":"Open links in new tabs","explorer.mode.replace_tooltip":"Replace current tab","explorer.close_all":"Close All Tabs","cas.index_to_cas":"Index to CAS","cas.indexed":"Indexed","cas.reindex":"Reindex","cas.indexing":"Indexing...","cas.index_success":"Indexed {{count}} file(s) to CAS","cas.index_no_change":"Content unchanged","cas.unsupported_type":"Unsupported file type ({{ext}})","cas.index_failed":"Index failed","version.selector_label":"Version","version.current":"Current","upload.no_change":"File content unchanged, upload ignored","upload.partial_no_change":"{{count}} file(s) unchanged, ignored","upload.new_version_title":"New Version","upload.new_version_desc":"File content has changed. Enter a new version number:","upload.version_label":"Version","upload.current_version":"Current version: {{version}}","upload.version_must_increase":"Version must be greater than {{version}}","upload.confirm":"Upload","package.last_commit":"Last Commit","package.dependencies":"Dependencies","package.files":"Files","package.no_dependencies":"No dependencies","package.unknown":"Unknown"},a2={"nav.home":"首页","nav.studio":"工作台","nav.docs":"文档","nav.login":"登录","nav.logout":"退出登录","header.status.connected":"已连接","header.status.disconnected":"已断开","header.status.reconnecting":"重连中","footer.copyright":"GitHub · @Context4AI {{year}}. 版权所有","footer.copyright_compact":"@Context4AI {{year}}. 版权所有","footer.tagline":"知识工厂","footer.theme.dark":"暗色","footer.theme.light":"亮色","footer.theme.system":"跟随系统","studio.sidebar.sources":"知识索引","studio.sidebar.modeling":"知识建模","studio.sidebar.brain":"知识大脑","studio.sidebar.discovery":"发现知识","studio.sidebar.sharing":"分享知识","studio.sidebar.collaboration":"知识协同","studio.sidebar.settings":"设置","placeholder.coming":"计划在 {{version}} 版本实现","page.login.title":"登录","page.login.description":"身份验证与用户管理","login.title":"登录","login.provider_cta":"使用 {{name}} 登录","login.loading":"加载中...","login.authenticating":"认证中...","login.or":"或","login.test_account":"测试账户","login.error":"加载登录选项失败","login.retry":"重试","user.menu.connect_source":"接入知识源","user.menu.sign_out":"退出登录","api_keys.title":"API 密钥","api_keys.description":"API Key 用于程序化访问 C4A API(AI Agent、CLI、CI/CD)","api_keys.create":"创建 API Key","api_keys.created":"API Key 已创建","api_keys.copy_warning":"请立即复制,此 Key 不会再次显示。","api_keys.copy":"复制","api_keys.copied":"已复制!","api_keys.done":"完成","api_keys.empty.title":"尚无 API Key","api_keys.empty.description":"API Key 用于程序化访问 C4A API","api_keys.created_at":"创建于 {{date}}","api_keys.never_used":"从未使用","api_keys.expires.never":"永不过期","api_keys.expires.30d":"30 天","api_keys.expires.90d":"90 天","api_keys.expires.1y":"1 年","api_keys.form.name":"名称","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"过期时间(可选)","api_keys.delete.confirm":"删除此 API Key?此操作不可撤销。","workspace.default_name":"我的大脑","settings.tab.general":"常规","settings.tab.api_keys":"API 密钥","page.docs.title":"文档","page.docs.description":"公开文档门户","page.sources.title":"知识索引","page.sources.description":"添加代码仓库、文档等输入材料,让大脑完成初步索引","page.modeling.title":"知识建模","page.modeling.description":"和 AI 一起对索引内容建模,只有经得起推敲的才写入知识图谱","page.brain.title":"知识大脑","page.brain.description":"建模完成的全部知识都在这里——浏览、搜索、分析,随时调用","page.discovery.title":"发现知识","page.discovery.description":"看看别人整理好的知识,发现有用的一键补充到自己的大脑","page.sharing.title":"分享知识","page.sharing.description":"把大脑中的知识打包输出,让别人和 AI 都能直接使用","page.collaboration.title":"知识协同","page.collaboration.description":"和其他大脑保持同步,知识更新时自动通知,不用手动搬运","page.settings.title":"设置","page.settings.description":"管理大脑的成员和配置","page.code_setup.title":"代码设置","page.code_setup.description":"代码建模的仓库选择与配置","page.code_compile.title":"代码编译","page.code_compile.description":"代码建模的编译进度追踪","page.code_review.title":"代码审查","page.code_review.description":"审查并确认建模结果","page.code_result.title":"代码结果","page.code_result.description":"查看最终建模结果与生成的知识图谱","home.hero.title":"Context For AI","home.hero.description":"将代码仓库和业务文档转化为结构化知识图谱。","home.hero.cta.studio":"进入工作台","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"您访问的页面不存在。","notfound.back":"返回首页","error.description":"页面出现了问题,请重试。","error.reload":"重新加载","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.menu.status_online":"{{machine}} 已连接","sources.menu.status_offline":"{{machine}} 未连接,点击前往教程","sources.library.default_cloud_name":"我的云盘","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"有新变更未更新索引","sources.status.go_index":"去索引","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"选择版本","sources.import.step.confirm":"导入完成","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.loading_repo":"正在加载仓库信息...","sources.import.loading_repo_slow":"大型仓库(>10 GB)可能需要 5~10 秒...","sources.import.importing":"导入中...","sources.import.error_title":"导入失败","sources.import.success":"导入完成","sources.import.stage.prepare":"准备执行环境","sources.import.stage.clone":"克隆仓库","sources.import.stage.scan":"扫描项目","sources.import.stage.save":"保存数据源","sources.import.stage.done_suffix":"✓","sources.import.stage.complete":"导入完成","sources.import.step.loading":"数据导入","sources.import.done":"完成","sources.import.back":"返回","sources.import.retry":"重试","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step2_allow":"限制访问目录(不影响已有导入)","sources.add_client.step3":"等待连接","sources.add_client.step3_desc":"连接成功后,本页面将自动更新。","sources.add_client.waiting":"等待新的客户端连接...","sources.add_client.detected":"检测到新的本地客户端","sources.add_client.machine_name":"机器标识","sources.add_client.os":"操作系统","sources.add_client.daemon_version":"Daemon 版本","sources.add_client.client_name":"客户端名称","sources.add_client.confirm":"确认添加","sources.add_client.reconnected":"客户端 {{name}} 已重新连接","sources.add_client.go_to":"前往 {{name}}","sources.detail.tab.original":"原文","sources.detail.tab.overview":"概览","sources.detail.tab.digest":"摘要","sources.detail.tab.modeling":"建模结果","sources.detail.not_found_title":"来源不存在","sources.detail.not_found_desc":"未找到此来源,可能已被删除或 ID 无效。","sources.detail.digest_placeholder":"完成索引后,即可在此查看结构化摘要。","sources.detail.modeling_placeholder":"在推演区完成建模后,此处将展示由该源产生的知识实体。","sources.detail.type":"类型","sources.detail.origin":"来源","sources.detail.origin.upload":"直接上传","sources.detail.origin.local":"本地文件","sources.detail.path":"路径","sources.detail.status":"状态","sources.detail.repo":"仓库","sources.detail.branch":"分支","sources.detail.commit":"提交","sources.detail.tech_stack":"技术栈","sources.detail.original_code_placeholder":"完成索引后即可查看包概览。","sources.detail.original_doc_placeholder":"文档内容将在上传后展示。","sources.detail.dependencies":"依赖","sources.delete.confirm_title":"确认删除","sources.delete.resource":"确定要删除 {{name}}?","sources.delete.resource_impact":"以下数据将被永久删除:原文内容、结构化摘要(如有)。","sources.delete.session_warning":"如果你的个人推演区正在使用此知识源,相关的候选推演将受到影响。","sources.delete.entity_safe":"已汇入大脑的正式知识不受影响。","sources.delete.folder":"确定要删除文件夹 {{name}}?","sources.delete.folder_impact":"文件夹内的所有资源将被递归删除:{{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_contents":"包含 {{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","sources.delete.repo_contents":"包含 {{packages}} 个包、{{docs}} 个文档。","sources.delete.indexed_hint":"其中 {{indexed}}/{{total}} 个已建立索引,索引数据将被删除。","sources.delete.repo_impact_generic":"所有包和文档的索引记录将被删除。","sources.delete.local_safe":"本地文件不受影响。","sources.delete.client":"确定要删除客户端 {{name}}?","sources.delete.client_impact":"该客户端下的所有已导入仓库记录和相关索引数据将被删除。","sources.delete.client_reregister":"该客户端下次连接时将触发重新注册。","sources.error.name_conflict":'该目录下已存在同名项"{{name}}"。',"sources.move.current":"当前位置","sources.move.target":"移动到","sources.breadcrumb.sources":"知识索引","common.cancel":"取消","common.confirm":"确认","common.back":"返回","common.next":"下一步","common.previous":"上一步","common.items":"{{count}} 项","common.loading":"加载中...","sources.import.no_entries":"未找到任何条目","sources.import.allowed_dirs":"客户端授权目录","sources.import.allowed_dirs_tooltip_restrict":"通过参数设定有权限的目录:","sources.import.allowed_dirs_tooltip_all":"或默认允许全部目录:","sources.import.wildcard_home":"主目录","sources.import.wildcard_path_placeholder":"输入目录路径…","sources.import.wildcard_go":"前往","sources.import.wildcard_goto":"前往","sources.import.wildcard_go_title":"前往目录","sources.import.wildcard_path_not_found":"该路径在远程机器上不存在","sources.import.already_imported":"已导入","sources.import.dir_title":"导入目录","sources.import.dir_step.select":"选择目录","sources.import.dir_step.scan":"扫描","sources.import.dir_step.confirm":"确认导入","sources.import.dir_confirm_heading":"即将导入以下目录到 {{name}}:","sources.import.dir_name":"目录名","sources.import.dir_name_hint":"导入后在目录树中的显示名称,留空使用默认仓库名。","sources.import.dir_name_duplicate":"该名称已存在,请使用其他名称。","sources.import.dir_path":"目录路径","sources.import.dir_files":"文件数","sources.import.dir_subdirs":"子目录数","sources.import.dir_git_repos":"仓库(已跳过)","sources.import.dir_git_hint":"目录内的 Git 仓库不会被展开索引,如需索引请单独导入仓库。","sources.import.dir_scanning":"正在扫描目录内容...","sources.import.dir_scan_complete":"扫描完成","sources.import.dir_scan_error":"目录扫描失败","sources.import.dir_scan_retry":"重试","sources.import.dir_code_packages":"代码包","sources.import.dir_code_packages_tip":"支持:package.json、pyproject.toml、setup.py、go.mod、Cargo.toml、pom.xml、build.gradle","sources.import.dir_doc_files":"文档","sources.import.dir_doc_files_tip":"支持:Markdown (.md)","sources.import.dir_total_files":"文件总数","sources.import.dir_total_dirs":"目录","sources.import.dir_git_skip_hint":"Git 仓库将被跳过,建议单独使用「导入仓库」。","sources.actions.upload":"上传","sources.actions.upload_md":"Markdown 文档","sources.actions.upload_doc":"文档","sources.actions.upload_document":"上传文档","sources.actions.add":"新增","sources.actions.add_folder":"文件夹","sources.actions.add_web":"网页","sources.actions.add_feishu":"飞书文档","sources.actions.import_dir":"导入目录","sources.actions.import_repo_url":"导入仓库","sources.upgrade.title":"功能升级中","sources.upgrade.description":"此功能将在 0.5.x 版本中推出,敬请期待。","sources.upload.title":"上传文档","sources.upload.drop_hint":"点击选择文件或拖拽至此","sources.upload.supported_formats":"支持格式:.md, .doc, .docx, .pdf, .ppt, .pptx, .txt(每个最大 5MB,最多 10 个)","sources.upload.file_too_large":'"{{name}}" 超过 5MB 限制',"sources.upload.too_many_files":"最多上传 10 个文件,请重新选择","sources.upload.unsupported_type":'"{{name}}" 不是支持的文件类型',"sources.upload.uploading":"上传中...","sources.upload.success":"已上传 {{count}} 个文档","sources.upload.selected":"已选择 {{count}} 个文件","sources.upload.remove":"移除","sources.import_remote.title":"导入远程仓库","sources.import_remote.step.loading":"数据导入","sources.import_remote.url_label":"仓库地址","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"仅接受 HTTPS 地址,SSH 地址未来版本支持","sources.import_remote.url_hint_public":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务:","sources.import_remote.url_hint_no_auth":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务","sources.import_remote.url_invalid":"仅支持 HTTPS 格式的 Git URL","sources.import_remote.ref_label":"分支 / Tag","sources.import_remote.ref_branches":"分支","sources.import_remote.ref_tags":"Tag","sources.import_remote.ref_search":"搜索分支或 Tag…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"已自动填入所选分支最新 commit,也可手动输入或搜索","sources.import_remote.commit_search":"搜索 commit…","sources.import_remote.loading_refs":"正在查询仓库分支...","sources.import_remote.loading_refs_slow":"大型项目可能需要 10~30s,请耐心等待...","sources.import_remote.summary_repo":"仓库","sources.import_remote.summary_branch":"分支","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"准备执行环境","sources.import_remote.stage.clone":"克隆仓库","sources.import_remote.stage.scan":"识别项目结构","sources.import_remote.stage.save":"写入知识源","sources.import_remote.complete":"导入完成","sources.import_remote.back_to_library":"完成","sources.import_remote.retry":"重试","sources.import_remote.back":"返回","sources.import_remote.error.auth_required":"该仓库需要认证。请在 服务设置 → Git 令牌 中配置 {{host}} 的访问令牌。","sources.import_remote.error.auth_failed":"认证失败,请检查 Git 令牌配置。","sources.import_remote.error.not_found":"仓库不存在或无权访问。请检查 URL 是否正确。","sources.import_remote.error.network":"无法连接到远程仓库。请检查网络或稍后重试。","sources.import_remote.error.capacity":"当前导入任务已满,请稍后再试。","sources.import_remote.error.clone_failed":"克隆失败","sources.import_remote.error.scan_failed":"识别失败","sources.import_remote.error.save_failed":"写入失败","sources.change_detection.has_updates":"有更新","sources.change_detection.reimport":"重新导入","sources.safety.notice.remote":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。","content.detail.tab.raw":"原始内容","content.detail.tab.digest":"索引摘要","content.detail.tab.extraction":"LLM 提取","content.detail.tab.entities":"关联实体","content.detail.size":"大小","content.detail.created_at":"创建时间","content.detail.sources":"来源","content.detail.language":"语言","content.detail.model":"模型","entity.detail.tab.overview":"概览","entity.detail.tab.relations":"关系","entity.detail.tab.contents":"内容来源","entity.detail.tab.referrers":"被引用","entity.detail.tab.neighbors":"邻居","entity.detail.type":"类型","entity.detail.kind":"种类","entity.detail.perspective":"视角","entity.detail.scope":"作用域","relation.detail.tab.overview":"概览","relation.detail.weight":"权重","relation.detail.confidence":"置信度","relation.detail.from":"起点","relation.detail.to":"终点","relation.detail.description":"描述","relation.detail.data":"附加数据","relation.detail.source_refs":"内容来源","relation.detail.meta":"元信息","relation.detail.source_label":"生成方式","relation.detail.source_field_sync":"系统推导","relation.detail.source_explicit":"显式声明","relation.filter.direction.all":"全部方向","relation.filter.direction.outgoing":"出边 →","relation.filter.direction.incoming":"← 入边","relation.filter.type.all":"全部类型","ref.stale":"已失效引用","ref.unknown":"未知实体","ref.retry":"解析失败,点击重试","confidence.high":"高确信","confidence.ai":"AI 建议","confidence.low":"低确信","source.field_sync":"系统推导","source.explicit":"显式声明","common.empty.content_raw.title":"内容不可用","common.empty.content_raw.description":"此内容由本地 Daemon 导入,原始文本未上传到服务端。","common.empty.content_digest.title":"尚未索引","common.empty.content_digest.description":"此内容尚未经过结构化索引处理。","common.empty.content_extraction.title":"尚未提取","common.empty.content_extraction.description":"AI 尚未对此内容进行实体提取和分析。","common.empty.content_entities.title":"暂无关联实体","common.empty.content_entities.description":"尚未从此内容中提取出任何实体。","common.empty.entity_relations.title":"暂无关系","common.empty.entity_relations.description":"该实体目前是一个孤岛,尚未与其他实体建立关联。","common.empty.entity_contents.title":"暂无内容来源","common.empty.entity_contents.description":"该实体未关联任何源代码或文档内容。","common.empty.entity_referrers.title":"暂无被引用","common.empty.entity_referrers.description":"目前没有其他实体在 data 字段中引用此实体。","common.empty.entity_neighbors.title":"暂无邻居","common.empty.entity_neighbors.description":"该实体在图谱中没有直接关联的邻居节点。","common.error.not_found":"资源不存在","common.error.not_found_description":"请求的资源不存在或已被移除。","common.error.load_failed":"加载失败","common.error.load_failed_description":"加载数据时发生错误,请重试。","explorer.mode.append":"追加","explorer.mode.replace":"替换","explorer.mode.append_tooltip":"在新标签中打开链接","explorer.mode.replace_tooltip":"替换当前标签","explorer.close_all":"关闭所有标签","cas.index_to_cas":"索引到 CAS","cas.indexed":"已索引","cas.reindex":"重索引","cas.indexing":"索引中...","cas.index_success":"已索引 {{count}} 个文件到 CAS","cas.index_no_change":"内容无变化","cas.unsupported_type":"不支持的文件类型 ({{ext}})","cas.index_failed":"索引失败","version.selector_label":"版本","version.current":"当前","upload.no_change":"文件内容无变化,已忽略上传","upload.partial_no_change":"{{count}} 个文件内容无变化,已忽略","upload.new_version_title":"新版本","upload.new_version_desc":"文件内容已变化,请输入新版本号:","upload.version_label":"版本号","upload.current_version":"当前版本:{{version}}","upload.version_must_increase":"版本号必须大于 {{version}}","upload.confirm":"上传","package.last_commit":"最后提交","package.dependencies":"依赖","package.files":"文件","package.no_dependencies":"无依赖","package.unknown":"未知","content.card.lines":"第 {{start}}-{{end}} 行"};On.use(r_).use(LN).init({resources:{en:{translation:n2},zh:{translation:a2}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var mh={exports:{}},To={},ph={exports:{}},gh={};var C0;function r2(){return C0||(C0=1,(function(e){function t(A,G){var ae=A.length;A.push(G);e:for(;0<ae;){var ee=ae-1>>>1,J=A[ee];if(0<i(J,G))A[ee]=G,A[ae]=J,ae=ee;else break e}}function a(A){return A.length===0?null:A[0]}function s(A){if(A.length===0)return null;var G=A[0],ae=A.pop();if(ae!==G){A[0]=ae;e:for(var ee=0,J=A.length,L=J>>>1;ee<L;){var q=2*(ee+1)-1,re=A[q],ie=q+1,ge=A[ie];if(0>i(re,ae))ie<J&&0>i(ge,re)?(A[ee]=ge,A[ie]=ae,ee=ie):(A[ee]=re,A[q]=ae,ee=q);else if(ie<J&&0>i(ge,ae))A[ee]=ge,A[ie]=ae,ee=ie;else break e}}return G}function i(A,G){var ae=A.sortIndex-G.sortIndex;return ae!==0?ae:A.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],x=1,y=null,v=3,b=!1,w=!1,N=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function O(A){for(var G=a(h);G!==null;){if(G.callback===null)s(h);else if(G.startTime<=A)s(h),G.sortIndex=G.expirationTime,t(m,G);else break;G=a(h)}}function I(A){if(N=!1,O(A),!w)if(a(m)!==null)w=!0,B||(B=!0,le());else{var G=a(h);G!==null&&F(I,G.startTime-A)}}var B=!1,H=-1,T=5,P=-1;function X(){return j?!0:!(e.unstable_now()-P<T)}function de(){if(j=!1,B){var A=e.unstable_now();P=A;var G=!0;try{e:{w=!1,N&&(N=!1,R(H),H=-1),b=!0;var ae=v;try{t:{for(O(A),y=a(m);y!==null&&!(y.expirationTime>A&&X());){var ee=y.callback;if(typeof ee=="function"){y.callback=null,v=y.priorityLevel;var J=ee(y.expirationTime<=A);if(A=e.unstable_now(),typeof J=="function"){y.callback=J,O(A),G=!0;break t}y===a(m)&&s(m),O(A)}else s(m);y=a(m)}if(y!==null)G=!0;else{var L=a(h);L!==null&&F(I,L.startTime-A),G=!1}}break e}finally{y=null,v=ae,b=!1}G=void 0}}finally{G?le():B=!1}}}var le;if(typeof k=="function")le=function(){k(de)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,D=ce.port2;ce.port1.onmessage=de,le=function(){D.postMessage(null)}}else le=function(){E(de,0)};function F(A,G){H=E(function(){A(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(A){A.callback=null},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(A){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var ae=v;v=G;try{return A()}finally{v=ae}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(A,G){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var ae=v;v=A;try{return G()}finally{v=ae}},e.unstable_scheduleCallback=function(A,G,ae){var ee=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ee+ae:ee):ae=ee,A){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=ae+J,A={id:x++,callback:G,priorityLevel:A,startTime:ae,expirationTime:J,sortIndex:-1},ae>ee?(A.sortIndex=ae,t(h,A),a(m)===null&&A===a(h)&&(N?(R(H),H=-1):N=!0,F(I,ae-ee))):(A.sortIndex=J,t(m,A),w||b||(w=!0,B||(B=!0,le()))),A},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(A){var G=v;return function(){var ae=v;v=G;try{return A.apply(this,arguments)}finally{v=ae}}}})(gh)),gh}var k0;function s2(){return k0||(k0=1,ph.exports=r2()),ph.exports}var xh={exports:{}},wn={};var R0;function i2(){if(R0)return wn;R0=1;var e=Du();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)h+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(m,h,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:y==null?null:""+y,children:m,containerInfo:h,implementation:x}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,wn.createPortal=function(m,h){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(m,h,null,x)},wn.flushSync=function(m){var h=u.T,x=s.p;try{if(u.T=null,s.p=2,m)return m()}finally{u.T=h,s.p=x,s.d.f()}},wn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(m,h))},wn.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},wn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var x=h.as,y=f(x,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;x==="style"?s.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):x==="script"&&s.d.X(m,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},wn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var x=f(h.as,h.crossOrigin);s.d.M(m,{crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(m)},wn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var x=h.as,y=f(x,h.crossOrigin);s.d.L(m,x,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},wn.preloadModule=function(m,h){if(typeof m=="string")if(h){var x=f(h.as,h.crossOrigin);s.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(m)},wn.requestFormReset=function(m){s.d.r(m)},wn.unstable_batchedUpdates=function(m,h){return m(h)},wn.useFormState=function(m,h,x){return u.H.useFormState(m,h,x)},wn.useFormStatus=function(){return u.H.useHostTransitionStatus()},wn.version="19.2.4",wn}var T0;function o2(){if(T0)return xh.exports;T0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xh.exports=i2(),xh.exports}var A0;function l2(){if(A0)return To;A0=1;var e=s2(),t=Du(),a=o2();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var r=n,o=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(o=r.return),n=r.return;while(n)}return r.tag===3?o:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function m(n){if(l(n)!==n)throw Error(s(188))}function h(n){var r=n.alternate;if(!r){if(r=l(n),r===null)throw Error(s(188));return r!==n?null:n}for(var o=n,c=r;;){var p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(c=p.return,c!==null){o=c;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return m(p),n;if(g===c)return m(p),r;g=g.sibling}throw Error(s(188))}if(o.return!==c.return)o=p,c=g;else{for(var S=!1,C=p.child;C;){if(C===o){S=!0,o=p,c=g;break}if(C===c){S=!0,c=p,o=g;break}C=C.sibling}if(!S){for(C=g.child;C;){if(C===o){S=!0,o=g,c=p;break}if(C===c){S=!0,c=g,o=p;break}C=C.sibling}if(!S)throw Error(s(189))}}if(o.alternate!==c)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?n:r}function x(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=x(n),r!==null)return r;n=n.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),k=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function le(n){return n===null||typeof n!="object"?null:(n=de&&n[de]||n["@@iterator"],typeof n=="function"?n:null)}var ce=Symbol.for("react.client.reference");function D(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ce?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case N:return"Fragment";case E:return"Profiler";case j:return"StrictMode";case I:return"Suspense";case B:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case k:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case O:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case H:return r=n.displayName||null,r!==null?r:D(n.type)||"Memo";case T:r=n._payload,n=n._init;try{return D(n(r))}catch{}}return null}var F=Array.isArray,A=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ee=[],J=-1;function L(n){return{current:n}}function q(n){0>J||(n.current=ee[J],ee[J]=null,J--)}function re(n,r){J++,ee[J]=n.current,n.current=r}var ie=L(null),ge=L(null),xe=L(null),Ee=L(null);function De(n,r){switch(re(xe,r),re(ge,n),re(ie,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?jy(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=jy(r),n=Ey(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}q(ie),re(ie,n)}function qe(){q(ie),q(ge),q(xe)}function vn(n){n.memoizedState!==null&&re(Ee,n);var r=ie.current,o=Ey(r,n.type);r!==o&&(re(ge,n),re(ie,o))}function zn(n){ge.current===n&&(q(ie),q(ge)),Ee.current===n&&(q(Ee),No._currentValue=ae)}var $t,at;function Nt(n){if($t===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);$t=r&&r[1]||"",at=-1<o.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+$t+n+at}var Un=!1;function lt(n,r){if(!n||Un)return"";Un=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(W){var Q=W}Reflect.construct(n,[],ue)}else{try{ue.call()}catch(W){Q=W}n.call(ue.prototype)}}else{try{throw Error()}catch(W){Q=W}(ue=n())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(W){if(W&&Q&&typeof W.stack=="string")return[W.stack,Q.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=c.DetermineComponentFrameRoot(),S=g[0],C=g[1];if(S&&C){var z=S.split(`
5
+ `),K=C.split(`
6
+ `);for(p=c=0;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;for(;p<K.length&&!K[p].includes("DetermineComponentFrameRoot");)p++;if(c===z.length||p===K.length)for(c=z.length-1,p=K.length-1;1<=c&&0<=p&&z[c]!==K[p];)p--;for(;1<=c&&0<=p;c--,p--)if(z[c]!==K[p]){if(c!==1||p!==1)do if(c--,p--,0>p||z[c]!==K[p]){var te=`
7
+ `+z[c].replace(" at new "," at ");return n.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",n.displayName)),te}while(1<=c&&0<=p);break}}}finally{Un=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?Nt(o):""}function hn(n,r){switch(n.tag){case 26:case 27:case 5:return Nt(n.type);case 16:return Nt("Lazy");case 13:return n.child!==r&&r!==null?Nt("Suspense Fallback"):Nt("Suspense");case 19:return Nt("SuspenseList");case 0:case 15:return lt(n.type,!1);case 11:return lt(n.type.render,!1);case 1:return lt(n.type,!0);case 31:return Nt("Activity");default:return""}}function on(n){try{var r="",o=null;do r+=hn(n,o),o=n,n=n.return;while(n);return r}catch(c){return`
8
+ Error generating stack: `+c.message+`
9
+ `+c.stack}}var qt=Object.prototype.hasOwnProperty,bn=e.unstable_scheduleCallback,ia=e.unstable_cancelCallback,kn=e.unstable_shouldYield,Rn=e.unstable_requestPaint,jt=e.unstable_now,_n=e.unstable_getCurrentPriorityLevel,Ne=e.unstable_ImmediatePriority,$e=e.unstable_UserBlockingPriority,Xe=e.unstable_NormalPriority,vt=e.unstable_LowPriority,Tt=e.unstable_IdlePriority,ln=e.log,Yn=e.unstable_setDisableYieldValue,mn=null,Ht=null;function bt(n){if(typeof ln=="function"&&Yn(n),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(mn,n)}catch{}}var Ft=Math.clz32?Math.clz32:ct,Te=Math.log,He=Math.LN2;function ct(n){return n>>>=0,n===0?32:31-(Te(n)/He|0)|0}var tt=256,dt=262144,Ot=4194304;function Bt(n){var r=n&42;if(r!==0)return r;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function en(n,r,o){var c=n.pendingLanes;if(c===0)return 0;var p=0,g=n.suspendedLanes,S=n.pingedLanes;n=n.warmLanes;var C=c&134217727;return C!==0?(c=C&~g,c!==0?p=Bt(c):(S&=C,S!==0?p=Bt(S):o||(o=C&~n,o!==0&&(p=Bt(o))))):(C=c&~g,C!==0?p=Bt(C):S!==0?p=Bt(S):o||(o=c&~n,o!==0&&(p=Bt(o)))),p===0?0:r!==0&&r!==p&&(r&g)===0&&(g=p&-p,o=r&-r,g>=o||g===32&&(o&4194048)!==0)?r:p}function se(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function be(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Be(){var n=Ot;return Ot<<=1,(Ot&62914560)===0&&(Ot=4194304),n}function ut(n){for(var r=[],o=0;31>o;o++)r.push(n);return r}function Pe(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function oa(n,r,o,c,p,g){var S=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var C=n.entanglements,z=n.expirationTimes,K=n.hiddenUpdates;for(o=S&~o;0<o;){var te=31-Ft(o),ue=1<<te;C[te]=0,z[te]=-1;var Q=K[te];if(Q!==null)for(K[te]=null,te=0;te<Q.length;te++){var W=Q[te];W!==null&&(W.lane&=-536870913)}o&=~ue}c!==0&&la(n,c,0),g!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=g&~(S&~r))}function la(n,r,o){n.pendingLanes|=r,n.suspendedLanes&=~r;var c=31-Ft(r);n.entangledLanes|=r,n.entanglements[c]=n.entanglements[c]|1073741824|o&261930}function ca(n,r){var o=n.entangledLanes|=r;for(n=n.entanglements;o;){var c=31-Ft(o),p=1<<c;p&r|n[c]&r&&(n[c]|=r),o&=~p}}function M(n,r){var o=r&-r;return o=(o&42)!==0?1:$(o),(o&(n.suspendedLanes|r))!==0?0:o}function $(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Z(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function fe(){var n=G.p;return n!==0?n:(n=window.event,n===void 0?32:Xy(n.type))}function he(n,r){var o=G.p;try{return G.p=n,r()}finally{G.p=o}}var Se=Math.random().toString(36).slice(2),pe="__reactFiber$"+Se,ve="__reactProps$"+Se,_e="__reactContainer$"+Se,ke="__reactEvents$"+Se,Ae="__reactListeners$"+Se,Ce="__reactHandles$"+Se,rt="__reactResources$"+Se,Ye="__reactMarker$"+Se;function xt(n){delete n[pe],delete n[ve],delete n[ke],delete n[Ae],delete n[Ce]}function Et(n){var r=n[pe];if(r)return r;for(var o=n.parentNode;o;){if(r=o[_e]||o[pe]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(n=Oy(n);n!==null;){if(o=n[pe])return o;n=Oy(n)}return r}n=o,o=n.parentNode}return null}function Dt(n){if(n=n[pe]||n[_e]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function nt(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function tn(n){var r=n[rt];return r||(r=n[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function _t(n){n[Ye]=!0}var wr=new Set,ka={};function cn(n,r){za(n,r),za(n+"Capture",r)}function za(n,r){for(ka[n]=r,n=0;n<r.length;n++)wr.add(r[n])}var as=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]*$"),Ua={},rs={};function zs(n){return qt.call(rs,n)?!0:qt.call(Ua,n)?!1:as.test(n)?rs[n]=!0:(Ua[n]=!0,!1)}function Ke(n,r,o){if(zs(r))if(o===null)n.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+o)}}function It(n,r,o){if(o===null)n.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+o)}}function Sn(n,r,o,c){if(c===null)n.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(r,o,""+c)}}function Yt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ct(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Us(n,r,o){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,g=c.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){o=""+S,g.call(this,S)}}),Object.defineProperty(n,r,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function $s(n){if(!n._valueTracker){var r=Ct(n)?"checked":"value";n._valueTracker=Us(n,r,""+n[r])}}function El(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var o=r.getValue(),c="";return n&&(c=Ct(n)?n.checked?"true":"false":n.value),n=c,n!==o?(r.setValue(n),!0):!1}function Cl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var PS=/[\n"\\]/g;function ua(n){return n.replace(PS,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ed(n,r,o,c,p,g,S,C){n.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?n.type=S:n.removeAttribute("type"),r!=null?S==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+Yt(r)):n.value!==""+Yt(r)&&(n.value=""+Yt(r)):S!=="submit"&&S!=="reset"||n.removeAttribute("value"),r!=null?td(n,S,Yt(r)):o!=null?td(n,S,Yt(o)):c!=null&&n.removeAttribute("value"),p==null&&g!=null&&(n.defaultChecked=!!g),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.name=""+Yt(C):n.removeAttribute("name")}function vp(n,r,o,c,p,g,S,C){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),r!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){$s(n);return}o=o!=null?""+Yt(o):"",r=r!=null?""+Yt(r):o,C||r===n.value||(n.value=r),n.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=C?n.checked:!!c,n.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(n.name=S),$s(n)}function td(n,r,o){r==="number"&&Cl(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Hs(n,r,o,c){if(n=n.options,r){r={};for(var p=0;p<o.length;p++)r["$"+o[p]]=!0;for(o=0;o<n.length;o++)p=r.hasOwnProperty("$"+n[o].value),n[o].selected!==p&&(n[o].selected=p),p&&c&&(n[o].defaultSelected=!0)}else{for(o=""+Yt(o),r=null,p=0;p<n.length;p++){if(n[p].value===o){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}r!==null||n[p].disabled||(r=n[p])}r!==null&&(r.selected=!0)}}function bp(n,r,o){if(r!=null&&(r=""+Yt(r),r!==n.value&&(n.value=r),o==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=o!=null?""+Yt(o):""}function _p(n,r,o,c){if(r==null){if(c!=null){if(o!=null)throw Error(s(92));if(F(c)){if(1<c.length)throw Error(s(93));c=c[0]}o=c}o==null&&(o=""),r=o}o=Yt(r),n.defaultValue=o,c=n.textContent,c===o&&c!==""&&c!==null&&(n.value=c),$s(n)}function Bs(n,r){if(r){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=r;return}}n.textContent=r}var GS=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 Sp(n,r,o){var c=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":c?n.setProperty(r,o):typeof o!="number"||o===0||GS.has(r)?r==="float"?n.cssFloat=o:n[r]=(""+o).trim():n[r]=o+"px"}function wp(n,r,o){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var p in r)c=r[p],r.hasOwnProperty(p)&&o[p]!==c&&Sp(n,p,c)}else for(var g in r)r.hasOwnProperty(g)&&Sp(n,g,r[g])}function nd(n){if(n.indexOf("-")===-1)return!1;switch(n){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 VS=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"]]),qS=/^[\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 kl(n){return qS.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Wa(){}var ad=null;function rd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Is=null,Ps=null;function Np(n){var r=Dt(n);if(r&&(n=r.stateNode)){var o=n[ve]||null;e:switch(n=r.stateNode,r.type){case"input":if(ed(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+ua(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var c=o[r];if(c!==n&&c.form===n.form){var p=c[ve]||null;if(!p)throw Error(s(90));ed(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<o.length;r++)c=o[r],c.form===n.form&&El(c)}break e;case"textarea":bp(n,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&Hs(n,!!o.multiple,r,!1)}}}var sd=!1;function jp(n,r,o){if(sd)return n(r,o);sd=!0;try{var c=n(r);return c}finally{if(sd=!1,(Is!==null||Ps!==null)&&(pc(),Is&&(r=Is,n=Ps,Ps=Is=null,Np(r),n)))for(r=0;r<n.length;r++)Np(n[r])}}function Bi(n,r){var o=n.stateNode;if(o===null)return null;var c=o[ve]||null;if(c===null)return null;o=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(s(231,r,typeof o));return o}var er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),id=!1;if(er)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){id=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{id=!1}var Nr=null,od=null,Rl=null;function Ep(){if(Rl)return Rl;var n,r=od,o=r.length,c,p="value"in Nr?Nr.value:Nr.textContent,g=p.length;for(n=0;n<o&&r[n]===p[n];n++);var S=o-n;for(c=1;c<=S&&r[o-c]===p[g-c];c++);return Rl=p.slice(n,1<c?1-c:void 0)}function Tl(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Al(){return!0}function Cp(){return!1}function $n(n){function r(o,c,p,g,S){this._reactName=o,this._targetInst=p,this.type=c,this.nativeEvent=g,this.target=S,this.currentTarget=null;for(var C in n)n.hasOwnProperty(C)&&(o=n[C],this[C]=o?o(g):g[C]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Al:Cp,this.isPropagationStopped=Cp,this}return y(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Al)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),r}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=$n(ss),Pi=y({},ss,{view:0,detail:0}),FS=$n(Pi),ld,cd,Gi,Ol=y({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Gi&&(Gi&&n.type==="mousemove"?(ld=n.screenX-Gi.screenX,cd=n.screenY-Gi.screenY):cd=ld=0,Gi=n),ld)},movementY:function(n){return"movementY"in n?n.movementY:cd}}),kp=$n(Ol),YS=y({},Ol,{dataTransfer:0}),KS=$n(YS),XS=y({},Pi,{relatedTarget:0}),ud=$n(XS),QS=y({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),ZS=$n(QS),JS=y({},ss,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),WS=$n(JS),ew=y({},ss,{data:0}),Rp=$n(ew),tw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nw={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"},aw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rw(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=aw[n])?!!r[n]:!1}function dd(){return rw}var sw=y({},Pi,{key:function(n){if(n.key){var r=tw[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Tl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?nw[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dd,charCode:function(n){return n.type==="keypress"?Tl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Tl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),iw=$n(sw),ow=y({},Ol,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tp=$n(ow),lw=y({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dd}),cw=$n(lw),uw=y({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),dw=$n(uw),fw=y({},Ol,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),hw=$n(fw),mw=y({},ss,{newState:0,oldState:0}),pw=$n(mw),gw=[9,13,27,32],fd=er&&"CompositionEvent"in window,Vi=null;er&&"documentMode"in document&&(Vi=document.documentMode);var xw=er&&"TextEvent"in window&&!Vi,Ap=er&&(!fd||Vi&&8<Vi&&11>=Vi),Lp=" ",Op=!1;function Dp(n,r){switch(n){case"keyup":return gw.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Gs=!1;function yw(n,r){switch(n){case"compositionend":return Mp(r);case"keypress":return r.which!==32?null:(Op=!0,Lp);case"textInput":return n=r.data,n===Lp&&Op?null:n;default:return null}}function vw(n,r){if(Gs)return n==="compositionend"||!fd&&Dp(n,r)?(n=Ep(),Rl=od=Nr=null,Gs=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ap&&r.locale!=="ko"?null:r.data;default:return null}}var bw={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 zp(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!bw[n.type]:r==="textarea"}function Up(n,r,o,c){Is?Ps?Ps.push(c):Ps=[c]:Is=c,r=Sc(r,"onChange"),0<r.length&&(o=new Ll("onChange","change",null,o,c),n.push({event:o,listeners:r}))}var qi=null,Fi=null;function _w(n){vy(n,0)}function Dl(n){var r=nt(n);if(El(r))return n}function $p(n,r){if(n==="change")return r}var Hp=!1;if(er){var hd;if(er){var md="oninput"in document;if(!md){var Bp=document.createElement("div");Bp.setAttribute("oninput","return;"),md=typeof Bp.oninput=="function"}hd=md}else hd=!1;Hp=hd&&(!document.documentMode||9<document.documentMode)}function Ip(){qi&&(qi.detachEvent("onpropertychange",Pp),Fi=qi=null)}function Pp(n){if(n.propertyName==="value"&&Dl(Fi)){var r=[];Up(r,Fi,n,rd(n)),jp(_w,r)}}function Sw(n,r,o){n==="focusin"?(Ip(),qi=r,Fi=o,qi.attachEvent("onpropertychange",Pp)):n==="focusout"&&Ip()}function ww(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Dl(Fi)}function Nw(n,r){if(n==="click")return Dl(r)}function jw(n,r){if(n==="input"||n==="change")return Dl(r)}function Ew(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var Kn=typeof Object.is=="function"?Object.is:Ew;function Yi(n,r){if(Kn(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var o=Object.keys(n),c=Object.keys(r);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var p=o[c];if(!qt.call(r,p)||!Kn(n[p],r[p]))return!1}return!0}function Gp(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Vp(n,r){var o=Gp(n);n=0;for(var c;o;){if(o.nodeType===3){if(c=n+o.textContent.length,n<=r&&c>=r)return{node:o,offset:r-n};n=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Gp(o)}}function qp(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?qp(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Fp(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=Cl(n.document);r instanceof n.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)n=r.contentWindow;else break;r=Cl(n.document)}return r}function pd(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var Cw=er&&"documentMode"in document&&11>=document.documentMode,Vs=null,gd=null,Ki=null,xd=!1;function Yp(n,r,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;xd||Vs==null||Vs!==Cl(c)||(c=Vs,"selectionStart"in c&&pd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ki&&Yi(Ki,c)||(Ki=c,c=Sc(gd,"onSelect"),0<c.length&&(r=new Ll("onSelect","select",null,r,o),n.push({event:r,listeners:c}),r.target=Vs)))}function is(n,r){var o={};return o[n.toLowerCase()]=r.toLowerCase(),o["Webkit"+n]="webkit"+r,o["Moz"+n]="moz"+r,o}var qs={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},yd={},Kp={};er&&(Kp=document.createElement("div").style,"AnimationEvent"in window||(delete qs.animationend.animation,delete qs.animationiteration.animation,delete qs.animationstart.animation),"TransitionEvent"in window||delete qs.transitionend.transition);function os(n){if(yd[n])return yd[n];if(!qs[n])return n;var r=qs[n],o;for(o in r)if(r.hasOwnProperty(o)&&o in Kp)return yd[n]=r[o];return n}var Xp=os("animationend"),Qp=os("animationiteration"),Zp=os("animationstart"),kw=os("transitionrun"),Rw=os("transitionstart"),Tw=os("transitioncancel"),Jp=os("transitionend"),Wp=new Map,vd="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(" ");vd.push("scrollEnd");function Ra(n,r){Wp.set(n,r),cn(r,[n])}var Ml=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},da=[],Fs=0,bd=0;function zl(){for(var n=Fs,r=bd=Fs=0;r<n;){var o=da[r];da[r++]=null;var c=da[r];da[r++]=null;var p=da[r];da[r++]=null;var g=da[r];if(da[r++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}g!==0&&eg(o,p,g)}}function Ul(n,r,o,c){da[Fs++]=n,da[Fs++]=r,da[Fs++]=o,da[Fs++]=c,bd|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function _d(n,r,o,c){return Ul(n,r,o,c),$l(n)}function ls(n,r){return Ul(n,null,null,r),$l(n)}function eg(n,r,o){n.lanes|=o;var c=n.alternate;c!==null&&(c.lanes|=o);for(var p=!1,g=n.return;g!==null;)g.childLanes|=o,c=g.alternate,c!==null&&(c.childLanes|=o),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(p=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,p&&r!==null&&(p=31-Ft(o),n=g.hiddenUpdates,c=n[p],c===null?n[p]=[r]:c.push(r),r.lane=o|536870912),g):null}function $l(n){if(50<xo)throw xo=0,Af=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var Ys={};function Aw(n,r,o,c){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(n,r,o,c){return new Aw(n,r,o,c)}function Sd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function tr(n,r){var o=n.alternate;return o===null?(o=Xn(n.tag,r,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=r,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,r=n.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function tg(n,r){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,r=o.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Hl(n,r,o,c,p,g){var S=0;if(c=n,typeof n=="function")Sd(n)&&(S=1);else if(typeof n=="string")S=z4(n,o,ie.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=Xn(31,o,r,p),n.elementType=P,n.lanes=g,n;case N:return cs(o.children,p,g,r);case j:S=8,p|=24;break;case E:return n=Xn(12,o,r,p|2),n.elementType=E,n.lanes=g,n;case I:return n=Xn(13,o,r,p),n.elementType=I,n.lanes=g,n;case B:return n=Xn(19,o,r,p),n.elementType=B,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case k:S=10;break e;case R:S=9;break e;case O:S=11;break e;case H:S=14;break e;case T:S=16,c=null;break e}S=29,o=Error(s(130,n===null?"null":typeof n,"")),c=null}return r=Xn(S,o,r,p),r.elementType=n,r.type=c,r.lanes=g,r}function cs(n,r,o,c){return n=Xn(7,n,c,r),n.lanes=o,n}function wd(n,r,o){return n=Xn(6,n,null,r),n.lanes=o,n}function ng(n){var r=Xn(18,null,null,0);return r.stateNode=n,r}function Nd(n,r,o){return r=Xn(4,n.children!==null?n.children:[],n.key,r),r.lanes=o,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var ag=new WeakMap;function fa(n,r){if(typeof n=="object"&&n!==null){var o=ag.get(n);return o!==void 0?o:(r={value:n,source:r,stack:on(r)},ag.set(n,r),r)}return{value:n,source:r,stack:on(r)}}var Ks=[],Xs=0,Bl=null,Xi=0,ha=[],ma=0,jr=null,$a=1,Ha="";function nr(n,r){Ks[Xs++]=Xi,Ks[Xs++]=Bl,Bl=n,Xi=r}function rg(n,r,o){ha[ma++]=$a,ha[ma++]=Ha,ha[ma++]=jr,jr=n;var c=$a;n=Ha;var p=32-Ft(c)-1;c&=~(1<<p),o+=1;var g=32-Ft(r)+p;if(30<g){var S=p-p%5;g=(c&(1<<S)-1).toString(32),c>>=S,p-=S,$a=1<<32-Ft(r)+p|o<<p|c,Ha=g+n}else $a=1<<g|o<<p|c,Ha=n}function jd(n){n.return!==null&&(nr(n,1),rg(n,1,0))}function Ed(n){for(;n===Bl;)Bl=Ks[--Xs],Ks[Xs]=null,Xi=Ks[--Xs],Ks[Xs]=null;for(;n===jr;)jr=ha[--ma],ha[ma]=null,Ha=ha[--ma],ha[ma]=null,$a=ha[--ma],ha[ma]=null}function sg(n,r){ha[ma++]=$a,ha[ma++]=Ha,ha[ma++]=jr,$a=r.id,Ha=r.overflow,jr=n}var pn=null,kt=null,et=!1,Er=null,pa=!1,Cd=Error(s(519));function Cr(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qi(fa(r,n)),Cd}function ig(n){var r=n.stateNode,o=n.type,c=n.memoizedProps;switch(r[pe]=n,r[ve]=c,o){case"dialog":Ze("cancel",r),Ze("close",r);break;case"iframe":case"object":case"embed":Ze("load",r);break;case"video":case"audio":for(o=0;o<vo.length;o++)Ze(vo[o],r);break;case"source":Ze("error",r);break;case"img":case"image":case"link":Ze("error",r),Ze("load",r);break;case"details":Ze("toggle",r);break;case"input":Ze("invalid",r),vp(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ze("invalid",r);break;case"textarea":Ze("invalid",r),_p(r,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||c.suppressHydrationWarning===!0||wy(r.textContent,o)?(c.popover!=null&&(Ze("beforetoggle",r),Ze("toggle",r)),c.onScroll!=null&&Ze("scroll",r),c.onScrollEnd!=null&&Ze("scrollend",r),c.onClick!=null&&(r.onclick=Wa),r=!0):r=!1,r||Cr(n,!0)}function og(n){for(pn=n.return;pn;)switch(pn.tag){case 5:case 31:case 13:pa=!1;return;case 27:case 3:pa=!0;return;default:pn=pn.return}}function Qs(n){if(n!==pn)return!1;if(!et)return og(n),et=!0,!1;var r=n.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||Ff(n.type,n.memoizedProps)),o=!o),o&&kt&&Cr(n),og(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));kt=Ly(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));kt=Ly(n)}else r===27?(r=kt,Ir(n.type)?(n=Zf,Zf=null,kt=n):kt=r):kt=pn?xa(n.stateNode.nextSibling):null;return!0}function us(){kt=pn=null,et=!1}function kd(){var n=Er;return n!==null&&(Pn===null?Pn=n:Pn.push.apply(Pn,n),Er=null),n}function Qi(n){Er===null?Er=[n]:Er.push(n)}var Rd=L(null),ds=null,ar=null;function kr(n,r,o){re(Rd,r._currentValue),r._currentValue=o}function rr(n){n._currentValue=Rd.current,q(Rd)}function Td(n,r,o){for(;n!==null;){var c=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),n===o)break;n=n.return}}function Ad(n,r,o,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var g=p.dependencies;if(g!==null){var S=p.child;g=g.firstContext;e:for(;g!==null;){var C=g;g=p;for(var z=0;z<r.length;z++)if(C.context===r[z]){g.lanes|=o,C=g.alternate,C!==null&&(C.lanes|=o),Td(g.return,o,n),c||(S=null);break e}g=C.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(s(341));S.lanes|=o,g=S.alternate,g!==null&&(g.lanes|=o),Td(S,o,n),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===n){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Zs(n,r,o,c){n=null;for(var p=r,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var C=p.type;Kn(p.pendingProps.value,S.value)||(n!==null?n.push(C):n=[C])}}else if(p===Ee.current){if(S=p.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(No):n=[No])}p=p.return}n!==null&&Ad(r,n,o,c),r.flags|=262144}function Il(n){for(n=n.firstContext;n!==null;){if(!Kn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function fs(n){ds=n,ar=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function gn(n){return lg(ds,n)}function Pl(n,r){return ds===null&&fs(n),lg(n,r)}function lg(n,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},ar===null){if(n===null)throw Error(s(308));ar=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else ar=ar.next=r;return o}var Lw=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(o,c){n.push(c)}};this.abort=function(){r.aborted=!0,n.forEach(function(o){return o()})}},Ow=e.unstable_scheduleCallback,Dw=e.unstable_NormalPriority,Kt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ld(){return{controller:new Lw,data:new Map,refCount:0}}function Zi(n){n.refCount--,n.refCount===0&&Ow(Dw,function(){n.controller.abort()})}var Ji=null,Od=0,Js=0,Ws=null;function Mw(n,r){if(Ji===null){var o=Ji=[];Od=0,Js=Uf(),Ws={status:"pending",value:void 0,then:function(c){o.push(c)}}}return Od++,r.then(cg,cg),r}function cg(){if(--Od===0&&Ji!==null){Ws!==null&&(Ws.status="fulfilled");var n=Ji;Ji=null,Js=0,Ws=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function zw(n,r){var o=[],c={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return n.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<o.length;p++)(0,o[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),c}var ug=A.S;A.S=function(n,r){Yx=jt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Mw(n,r),ug!==null&&ug(n,r)};var hs=L(null);function Dd(){var n=hs.current;return n!==null?n:yt.pooledCache}function Gl(n,r){r===null?re(hs,hs.current):re(hs,r.pool)}function dg(){var n=Dd();return n===null?null:{parent:Kt._currentValue,pool:n}}var ei=Error(s(460)),Md=Error(s(474)),Vl=Error(s(542)),ql={then:function(){}};function fg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function hg(n,r,o){switch(o=n[o],o===void 0?n.push(r):o!==r&&(r.then(Wa,Wa),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,pg(n),n;default:if(typeof r.status=="string")r.then(Wa,Wa);else{if(n=yt,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,pg(n),n}throw ps=r,ei}}function ms(n){try{var r=n._init;return r(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(ps=o,ei):o}}var ps=null;function mg(){if(ps===null)throw Error(s(459));var n=ps;return ps=null,n}function pg(n){if(n===ei||n===Vl)throw Error(s(483))}var ti=null,Wi=0;function Fl(n){var r=Wi;return Wi+=1,ti===null&&(ti=[]),hg(ti,n,r)}function eo(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Yl(n,r){throw r.$$typeof===v?Error(s(525)):(n=Object.prototype.toString.call(r),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function gg(n){function r(V,U){if(n){var Y=V.deletions;Y===null?(V.deletions=[U],V.flags|=16):Y.push(U)}}function o(V,U){if(!n)return null;for(;U!==null;)r(V,U),U=U.sibling;return null}function c(V){for(var U=new Map;V!==null;)V.key!==null?U.set(V.key,V):U.set(V.index,V),V=V.sibling;return U}function p(V,U){return V=tr(V,U),V.index=0,V.sibling=null,V}function g(V,U,Y){return V.index=Y,n?(Y=V.alternate,Y!==null?(Y=Y.index,Y<U?(V.flags|=67108866,U):Y):(V.flags|=67108866,U)):(V.flags|=1048576,U)}function S(V){return n&&V.alternate===null&&(V.flags|=67108866),V}function C(V,U,Y,oe){return U===null||U.tag!==6?(U=wd(Y,V.mode,oe),U.return=V,U):(U=p(U,Y),U.return=V,U)}function z(V,U,Y,oe){var Re=Y.type;return Re===N?te(V,U,Y.props.children,oe,Y.key):U!==null&&(U.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===T&&ms(Re)===U.type)?(U=p(U,Y.props),eo(U,Y),U.return=V,U):(U=Hl(Y.type,Y.key,Y.props,null,V.mode,oe),eo(U,Y),U.return=V,U)}function K(V,U,Y,oe){return U===null||U.tag!==4||U.stateNode.containerInfo!==Y.containerInfo||U.stateNode.implementation!==Y.implementation?(U=Nd(Y,V.mode,oe),U.return=V,U):(U=p(U,Y.children||[]),U.return=V,U)}function te(V,U,Y,oe,Re){return U===null||U.tag!==7?(U=cs(Y,V.mode,oe,Re),U.return=V,U):(U=p(U,Y),U.return=V,U)}function ue(V,U,Y){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=wd(""+U,V.mode,Y),U.return=V,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case b:return Y=Hl(U.type,U.key,U.props,null,V.mode,Y),eo(Y,U),Y.return=V,Y;case w:return U=Nd(U,V.mode,Y),U.return=V,U;case T:return U=ms(U),ue(V,U,Y)}if(F(U)||le(U))return U=cs(U,V.mode,Y,null),U.return=V,U;if(typeof U.then=="function")return ue(V,Fl(U),Y);if(U.$$typeof===k)return ue(V,Pl(V,U),Y);Yl(V,U)}return null}function Q(V,U,Y,oe){var Re=U!==null?U.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Re!==null?null:C(V,U,""+Y,oe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:return Y.key===Re?z(V,U,Y,oe):null;case w:return Y.key===Re?K(V,U,Y,oe):null;case T:return Y=ms(Y),Q(V,U,Y,oe)}if(F(Y)||le(Y))return Re!==null?null:te(V,U,Y,oe,null);if(typeof Y.then=="function")return Q(V,U,Fl(Y),oe);if(Y.$$typeof===k)return Q(V,U,Pl(V,Y),oe);Yl(V,Y)}return null}function W(V,U,Y,oe,Re){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return V=V.get(Y)||null,C(U,V,""+oe,Re);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return V=V.get(oe.key===null?Y:oe.key)||null,z(U,V,oe,Re);case w:return V=V.get(oe.key===null?Y:oe.key)||null,K(U,V,oe,Re);case T:return oe=ms(oe),W(V,U,Y,oe,Re)}if(F(oe)||le(oe))return V=V.get(Y)||null,te(U,V,oe,Re,null);if(typeof oe.then=="function")return W(V,U,Y,Fl(oe),Re);if(oe.$$typeof===k)return W(V,U,Y,Pl(U,oe),Re);Yl(U,oe)}return null}function we(V,U,Y,oe){for(var Re=null,st=null,je=U,Ge=U=0,We=null;je!==null&&Ge<Y.length;Ge++){je.index>Ge?(We=je,je=null):We=je.sibling;var it=Q(V,je,Y[Ge],oe);if(it===null){je===null&&(je=We);break}n&&je&&it.alternate===null&&r(V,je),U=g(it,U,Ge),st===null?Re=it:st.sibling=it,st=it,je=We}if(Ge===Y.length)return o(V,je),et&&nr(V,Ge),Re;if(je===null){for(;Ge<Y.length;Ge++)je=ue(V,Y[Ge],oe),je!==null&&(U=g(je,U,Ge),st===null?Re=je:st.sibling=je,st=je);return et&&nr(V,Ge),Re}for(je=c(je);Ge<Y.length;Ge++)We=W(je,V,Ge,Y[Ge],oe),We!==null&&(n&&We.alternate!==null&&je.delete(We.key===null?Ge:We.key),U=g(We,U,Ge),st===null?Re=We:st.sibling=We,st=We);return n&&je.forEach(function(Fr){return r(V,Fr)}),et&&nr(V,Ge),Re}function Le(V,U,Y,oe){if(Y==null)throw Error(s(151));for(var Re=null,st=null,je=U,Ge=U=0,We=null,it=Y.next();je!==null&&!it.done;Ge++,it=Y.next()){je.index>Ge?(We=je,je=null):We=je.sibling;var Fr=Q(V,je,it.value,oe);if(Fr===null){je===null&&(je=We);break}n&&je&&Fr.alternate===null&&r(V,je),U=g(Fr,U,Ge),st===null?Re=Fr:st.sibling=Fr,st=Fr,je=We}if(it.done)return o(V,je),et&&nr(V,Ge),Re;if(je===null){for(;!it.done;Ge++,it=Y.next())it=ue(V,it.value,oe),it!==null&&(U=g(it,U,Ge),st===null?Re=it:st.sibling=it,st=it);return et&&nr(V,Ge),Re}for(je=c(je);!it.done;Ge++,it=Y.next())it=W(je,V,Ge,it.value,oe),it!==null&&(n&&it.alternate!==null&&je.delete(it.key===null?Ge:it.key),U=g(it,U,Ge),st===null?Re=it:st.sibling=it,st=it);return n&&je.forEach(function(Y4){return r(V,Y4)}),et&&nr(V,Ge),Re}function gt(V,U,Y,oe){if(typeof Y=="object"&&Y!==null&&Y.type===N&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:e:{for(var Re=Y.key;U!==null;){if(U.key===Re){if(Re=Y.type,Re===N){if(U.tag===7){o(V,U.sibling),oe=p(U,Y.props.children),oe.return=V,V=oe;break e}}else if(U.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===T&&ms(Re)===U.type){o(V,U.sibling),oe=p(U,Y.props),eo(oe,Y),oe.return=V,V=oe;break e}o(V,U);break}else r(V,U);U=U.sibling}Y.type===N?(oe=cs(Y.props.children,V.mode,oe,Y.key),oe.return=V,V=oe):(oe=Hl(Y.type,Y.key,Y.props,null,V.mode,oe),eo(oe,Y),oe.return=V,V=oe)}return S(V);case w:e:{for(Re=Y.key;U!==null;){if(U.key===Re)if(U.tag===4&&U.stateNode.containerInfo===Y.containerInfo&&U.stateNode.implementation===Y.implementation){o(V,U.sibling),oe=p(U,Y.children||[]),oe.return=V,V=oe;break e}else{o(V,U);break}else r(V,U);U=U.sibling}oe=Nd(Y,V.mode,oe),oe.return=V,V=oe}return S(V);case T:return Y=ms(Y),gt(V,U,Y,oe)}if(F(Y))return we(V,U,Y,oe);if(le(Y)){if(Re=le(Y),typeof Re!="function")throw Error(s(150));return Y=Re.call(Y),Le(V,U,Y,oe)}if(typeof Y.then=="function")return gt(V,U,Fl(Y),oe);if(Y.$$typeof===k)return gt(V,U,Pl(V,Y),oe);Yl(V,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,U!==null&&U.tag===6?(o(V,U.sibling),oe=p(U,Y),oe.return=V,V=oe):(o(V,U),oe=wd(Y,V.mode,oe),oe.return=V,V=oe),S(V)):o(V,U)}return function(V,U,Y,oe){try{Wi=0;var Re=gt(V,U,Y,oe);return ti=null,Re}catch(je){if(je===ei||je===Vl)throw je;var st=Xn(29,je,null,V.mode);return st.lanes=oe,st.return=V,st}}}var gs=gg(!0),xg=gg(!1),Rr=!1;function zd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ud(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Tr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ar(n,r,o){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(ot&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=$l(n),eg(n,null,o),r}return Ul(n,c,r,o),$l(n)}function to(n,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var c=r.lanes;c&=n.pendingLanes,o|=c,r.lanes=o,ca(n,o)}}function $d(n,r){var o=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?p=g=S:g=g.next=S,o=o.next}while(o!==null);g===null?p=g=r:g=g.next=r}else p=g=r;o={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=r:n.next=r,o.lastBaseUpdate=r}var Hd=!1;function no(){if(Hd){var n=Ws;if(n!==null)throw n}}function ao(n,r,o,c){Hd=!1;var p=n.updateQueue;Rr=!1;var g=p.firstBaseUpdate,S=p.lastBaseUpdate,C=p.shared.pending;if(C!==null){p.shared.pending=null;var z=C,K=z.next;z.next=null,S===null?g=K:S.next=K,S=z;var te=n.alternate;te!==null&&(te=te.updateQueue,C=te.lastBaseUpdate,C!==S&&(C===null?te.firstBaseUpdate=K:C.next=K,te.lastBaseUpdate=z))}if(g!==null){var ue=p.baseState;S=0,te=K=z=null,C=g;do{var Q=C.lane&-536870913,W=Q!==C.lane;if(W?(Je&Q)===Q:(c&Q)===Q){Q!==0&&Q===Js&&(Hd=!0),te!==null&&(te=te.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var we=n,Le=C;Q=r;var gt=o;switch(Le.tag){case 1:if(we=Le.payload,typeof we=="function"){ue=we.call(gt,ue,Q);break e}ue=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Le.payload,Q=typeof we=="function"?we.call(gt,ue,Q):we,Q==null)break e;ue=y({},ue,Q);break e;case 2:Rr=!0}}Q=C.callback,Q!==null&&(n.flags|=64,W&&(n.flags|=8192),W=p.callbacks,W===null?p.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:C.tag,payload:C.payload,callback:C.callback,next:null},te===null?(K=te=W,z=ue):te=te.next=W,S|=Q;if(C=C.next,C===null){if(C=p.shared.pending,C===null)break;W=C,C=W.next,W.next=null,p.lastBaseUpdate=W,p.shared.pending=null}}while(!0);te===null&&(z=ue),p.baseState=z,p.firstBaseUpdate=K,p.lastBaseUpdate=te,g===null&&(p.shared.lanes=0),zr|=S,n.lanes=S,n.memoizedState=ue}}function yg(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function vg(n,r){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)yg(o[n],r)}var ni=L(null),Kl=L(0);function bg(n,r){n=hr,re(Kl,n),re(ni,r),hr=n|r.baseLanes}function Bd(){re(Kl,hr),re(ni,ni.current)}function Id(){hr=Kl.current,q(ni),q(Kl)}var Qn=L(null),ga=null;function Lr(n){var r=n.alternate;re(Pt,Pt.current&1),re(Qn,n),ga===null&&(r===null||ni.current!==null||r.memoizedState!==null)&&(ga=n)}function Pd(n){re(Pt,Pt.current),re(Qn,n),ga===null&&(ga=n)}function _g(n){n.tag===22?(re(Pt,Pt.current),re(Qn,n),ga===null&&(ga=n)):Or()}function Or(){re(Pt,Pt.current),re(Qn,Qn.current)}function Zn(n){q(Qn),ga===n&&(ga=null),q(Pt)}var Pt=L(0);function Xl(n){for(var r=n;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Xf(o)||Qf(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var sr=0,Ie=null,mt=null,Xt=null,Ql=!1,ai=!1,xs=!1,Zl=0,ro=0,ri=null,Uw=0;function Mt(){throw Error(s(321))}function Gd(n,r){if(r===null)return!1;for(var o=0;o<r.length&&o<n.length;o++)if(!Kn(n[o],r[o]))return!1;return!0}function Vd(n,r,o,c,p,g){return sr=g,Ie=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,A.H=n===null||n.memoizedState===null?rx:sf,xs=!1,g=o(c,p),xs=!1,ai&&(g=wg(r,o,c,p)),Sg(n),g}function Sg(n){A.H=oo;var r=mt!==null&&mt.next!==null;if(sr=0,Xt=mt=Ie=null,Ql=!1,ro=0,ri=null,r)throw Error(s(300));n===null||Qt||(n=n.dependencies,n!==null&&Il(n)&&(Qt=!0))}function wg(n,r,o,c){Ie=n;var p=0;do{if(ai&&(ri=null),ro=0,ai=!1,25<=p)throw Error(s(301));if(p+=1,Xt=mt=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}A.H=sx,g=r(o,c)}while(ai);return g}function $w(){var n=A.H,r=n.useState()[0];return r=typeof r.then=="function"?so(r):r,n=n.useState()[0],(mt!==null?mt.memoizedState:null)!==n&&(Ie.flags|=1024),r}function qd(){var n=Zl!==0;return Zl=0,n}function Fd(n,r,o){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~o}function Yd(n){if(Ql){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Ql=!1}sr=0,Xt=mt=Ie=null,ai=!1,ro=Zl=0,ri=null}function Tn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Ie.memoizedState=Xt=n:Xt=Xt.next=n,Xt}function Gt(){if(mt===null){var n=Ie.alternate;n=n!==null?n.memoizedState:null}else n=mt.next;var r=Xt===null?Ie.memoizedState:Xt.next;if(r!==null)Xt=r,mt=n;else{if(n===null)throw Ie.alternate===null?Error(s(467)):Error(s(310));mt=n,n={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Xt===null?Ie.memoizedState=Xt=n:Xt=Xt.next=n}return Xt}function Jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function so(n){var r=ro;return ro+=1,ri===null&&(ri=[]),n=hg(ri,n,r),r=Ie,(Xt===null?r.memoizedState:Xt.next)===null&&(r=r.alternate,A.H=r===null||r.memoizedState===null?rx:sf),n}function Wl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return so(n);if(n.$$typeof===k)return gn(n)}throw Error(s(438,String(n)))}function Kd(n){var r=null,o=Ie.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var c=Ie.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Jl(),Ie.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(n),c=0;c<n;c++)o[c]=X;return r.index++,o}function ir(n,r){return typeof r=="function"?r(n):r}function ec(n){var r=Gt();return Xd(r,mt,n)}function Xd(n,r,o){var c=n.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=o;var p=n.baseQueue,g=c.pending;if(g!==null){if(p!==null){var S=p.next;p.next=g.next,g.next=S}r.baseQueue=p=g,c.pending=null}if(g=n.baseState,p===null)n.memoizedState=g;else{r=p.next;var C=S=null,z=null,K=r,te=!1;do{var ue=K.lane&-536870913;if(ue!==K.lane?(Je&ue)===ue:(sr&ue)===ue){var Q=K.revertLane;if(Q===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ue===Js&&(te=!0);else if((sr&Q)===Q){K=K.next,Q===Js&&(te=!0);continue}else ue={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},z===null?(C=z=ue,S=g):z=z.next=ue,Ie.lanes|=Q,zr|=Q;ue=K.action,xs&&o(g,ue),g=K.hasEagerState?K.eagerState:o(g,ue)}else Q={lane:ue,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},z===null?(C=z=Q,S=g):z=z.next=Q,Ie.lanes|=ue,zr|=ue;K=K.next}while(K!==null&&K!==r);if(z===null?S=g:z.next=C,!Kn(g,n.memoizedState)&&(Qt=!0,te&&(o=Ws,o!==null)))throw o;n.memoizedState=g,n.baseState=S,n.baseQueue=z,c.lastRenderedState=g}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function Qd(n){var r=Gt(),o=r.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=n;var c=o.dispatch,p=o.pending,g=r.memoizedState;if(p!==null){o.pending=null;var S=p=p.next;do g=n(g,S.action),S=S.next;while(S!==p);Kn(g,r.memoizedState)||(Qt=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),o.lastRenderedState=g}return[g,c]}function Ng(n,r,o){var c=Ie,p=Gt(),g=et;if(g){if(o===void 0)throw Error(s(407));o=o()}else o=r();var S=!Kn((mt||p).memoizedState,o);if(S&&(p.memoizedState=o,Qt=!0),p=p.queue,Wd(Cg.bind(null,c,p,n),[n]),p.getSnapshot!==r||S||Xt!==null&&Xt.memoizedState.tag&1){if(c.flags|=2048,si(9,{destroy:void 0},Eg.bind(null,c,p,o,r),null),yt===null)throw Error(s(349));g||(sr&127)!==0||jg(c,r,o)}return o}function jg(n,r,o){n.flags|=16384,n={getSnapshot:r,value:o},r=Ie.updateQueue,r===null?(r=Jl(),Ie.updateQueue=r,r.stores=[n]):(o=r.stores,o===null?r.stores=[n]:o.push(n))}function Eg(n,r,o,c){r.value=o,r.getSnapshot=c,kg(r)&&Rg(n)}function Cg(n,r,o){return o(function(){kg(r)&&Rg(n)})}function kg(n){var r=n.getSnapshot;n=n.value;try{var o=r();return!Kn(n,o)}catch{return!0}}function Rg(n){var r=ls(n,2);r!==null&&Gn(r,n,2)}function Zd(n){var r=Tn();if(typeof n=="function"){var o=n;if(n=o(),xs){bt(!0);try{o()}finally{bt(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:n},r}function Tg(n,r,o,c){return n.baseState=o,Xd(n,mt,typeof c=="function"?c:ir)}function Hw(n,r,o,c,p){if(ac(n))throw Error(s(485));if(n=r.action,n!==null){var g={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};A.T!==null?o(!0):g.isTransition=!1,c(g),o=r.pending,o===null?(g.next=r.pending=g,Ag(r,g)):(g.next=o.next,r.pending=o.next=g)}}function Ag(n,r){var o=r.action,c=r.payload,p=n.state;if(r.isTransition){var g=A.T,S={};A.T=S;try{var C=o(p,c),z=A.S;z!==null&&z(S,C),Lg(n,r,C)}catch(K){Jd(n,r,K)}finally{g!==null&&S.types!==null&&(g.types=S.types),A.T=g}}else try{g=o(p,c),Lg(n,r,g)}catch(K){Jd(n,r,K)}}function Lg(n,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Og(n,r,c)},function(c){return Jd(n,r,c)}):Og(n,r,o)}function Og(n,r,o){r.status="fulfilled",r.value=o,Dg(r),n.state=o,r=n.pending,r!==null&&(o=r.next,o===r?n.pending=null:(o=o.next,r.next=o,Ag(n,o)))}function Jd(n,r,o){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=o,Dg(r),r=r.next;while(r!==c)}n.action=null}function Dg(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function Mg(n,r){return r}function zg(n,r){if(et){var o=yt.formState;if(o!==null){e:{var c=Ie;if(et){if(kt){t:{for(var p=kt,g=pa;p.nodeType!==8;){if(!g){p=null;break t}if(p=xa(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){kt=xa(p.nextSibling),c=p.data==="F!";break e}}Cr(c)}c=!1}c&&(r=o[0])}}return o=Tn(),o.memoizedState=o.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mg,lastRenderedState:r},o.queue=c,o=tx.bind(null,Ie,c),c.dispatch=o,c=Zd(!1),g=rf.bind(null,Ie,!1,c.queue),c=Tn(),p={state:r,dispatch:null,action:n,pending:null},c.queue=p,o=Hw.bind(null,Ie,p,g,o),p.dispatch=o,c.memoizedState=n,[r,o,!1]}function Ug(n){var r=Gt();return $g(r,mt,n)}function $g(n,r,o){if(r=Xd(n,r,Mg)[0],n=ec(ir)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=so(r)}catch(S){throw S===ei?Vl:S}else c=r;r=Gt();var p=r.queue,g=p.dispatch;return o!==r.memoizedState&&(Ie.flags|=2048,si(9,{destroy:void 0},Bw.bind(null,p,o),null)),[c,g,n]}function Bw(n,r){n.action=r}function Hg(n){var r=Gt(),o=mt;if(o!==null)return $g(r,o,n);Gt(),r=r.memoizedState,o=Gt();var c=o.queue.dispatch;return o.memoizedState=n,[r,c,!1]}function si(n,r,o,c){return n={tag:n,create:o,deps:c,inst:r,next:null},r=Ie.updateQueue,r===null&&(r=Jl(),Ie.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=n.next=n:(c=o.next,o.next=n,n.next=c,r.lastEffect=n),n}function Bg(){return Gt().memoizedState}function tc(n,r,o,c){var p=Tn();Ie.flags|=n,p.memoizedState=si(1|r,{destroy:void 0},o,c===void 0?null:c)}function nc(n,r,o,c){var p=Gt();c=c===void 0?null:c;var g=p.memoizedState.inst;mt!==null&&c!==null&&Gd(c,mt.memoizedState.deps)?p.memoizedState=si(r,g,o,c):(Ie.flags|=n,p.memoizedState=si(1|r,g,o,c))}function Ig(n,r){tc(8390656,8,n,r)}function Wd(n,r){nc(2048,8,n,r)}function Iw(n){Ie.flags|=4;var r=Ie.updateQueue;if(r===null)r=Jl(),Ie.updateQueue=r,r.events=[n];else{var o=r.events;o===null?r.events=[n]:o.push(n)}}function Pg(n){var r=Gt().memoizedState;return Iw({ref:r,nextImpl:n}),function(){if((ot&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Gg(n,r){return nc(4,2,n,r)}function Vg(n,r){return nc(4,4,n,r)}function qg(n,r){if(typeof r=="function"){n=n();var o=r(n);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function Fg(n,r,o){o=o!=null?o.concat([n]):null,nc(4,4,qg.bind(null,r,n),o)}function ef(){}function Yg(n,r){var o=Gt();r=r===void 0?null:r;var c=o.memoizedState;return r!==null&&Gd(r,c[1])?c[0]:(o.memoizedState=[n,r],n)}function Kg(n,r){var o=Gt();r=r===void 0?null:r;var c=o.memoizedState;if(r!==null&&Gd(r,c[1]))return c[0];if(c=n(),xs){bt(!0);try{n()}finally{bt(!1)}}return o.memoizedState=[c,r],c}function tf(n,r,o){return o===void 0||(sr&1073741824)!==0&&(Je&261930)===0?n.memoizedState=r:(n.memoizedState=o,n=Xx(),Ie.lanes|=n,zr|=n,o)}function Xg(n,r,o,c){return Kn(o,r)?o:ni.current!==null?(n=tf(n,o,c),Kn(n,r)||(Qt=!0),n):(sr&42)===0||(sr&1073741824)!==0&&(Je&261930)===0?(Qt=!0,n.memoizedState=o):(n=Xx(),Ie.lanes|=n,zr|=n,r)}function Qg(n,r,o,c,p){var g=G.p;G.p=g!==0&&8>g?g:8;var S=A.T,C={};A.T=C,rf(n,!1,r,o);try{var z=p(),K=A.S;if(K!==null&&K(C,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var te=zw(z,c);io(n,r,te,ea(n))}else io(n,r,c,ea(n))}catch(ue){io(n,r,{then:function(){},status:"rejected",reason:ue},ea())}finally{G.p=g,S!==null&&C.types!==null&&(S.types=C.types),A.T=S}}function Pw(){}function nf(n,r,o,c){if(n.tag!==5)throw Error(s(476));var p=Zg(n).queue;Qg(n,p,r,ae,o===null?Pw:function(){return Jg(n),o(c)})}function Zg(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:ae},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:o},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Jg(n){var r=Zg(n);r.next===null&&(r=n.alternate.memoizedState),io(n,r.next.queue,{},ea())}function af(){return gn(No)}function Wg(){return Gt().memoizedState}function ex(){return Gt().memoizedState}function Gw(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var o=ea();n=Tr(o);var c=Ar(r,n,o);c!==null&&(Gn(c,r,o),to(c,r,o)),r={cache:Ld()},n.payload=r;return}r=r.return}}function Vw(n,r,o){var c=ea();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ac(n)?nx(r,o):(o=_d(n,r,o,c),o!==null&&(Gn(o,n,c),ax(o,r,c)))}function tx(n,r,o){var c=ea();io(n,r,o,c)}function io(n,r,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(ac(n))nx(r,p);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,C=g(S,o);if(p.hasEagerState=!0,p.eagerState=C,Kn(C,S))return Ul(n,r,p,0),yt===null&&zl(),!1}catch{}if(o=_d(n,r,p,c),o!==null)return Gn(o,n,c),ax(o,r,c),!0}return!1}function rf(n,r,o,c){if(c={lane:2,revertLane:Uf(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},ac(n)){if(r)throw Error(s(479))}else r=_d(n,o,c,2),r!==null&&Gn(r,n,2)}function ac(n){var r=n.alternate;return n===Ie||r!==null&&r===Ie}function nx(n,r){ai=Ql=!0;var o=n.pending;o===null?r.next=r:(r.next=o.next,o.next=r),n.pending=r}function ax(n,r,o){if((o&4194048)!==0){var c=r.lanes;c&=n.pendingLanes,o|=c,r.lanes=o,ca(n,o)}}var oo={readContext:gn,use:Wl,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};oo.useEffectEvent=Mt;var rx={readContext:gn,use:Wl,useCallback:function(n,r){return Tn().memoizedState=[n,r===void 0?null:r],n},useContext:gn,useEffect:Ig,useImperativeHandle:function(n,r,o){o=o!=null?o.concat([n]):null,tc(4194308,4,qg.bind(null,r,n),o)},useLayoutEffect:function(n,r){return tc(4194308,4,n,r)},useInsertionEffect:function(n,r){tc(4,2,n,r)},useMemo:function(n,r){var o=Tn();r=r===void 0?null:r;var c=n();if(xs){bt(!0);try{n()}finally{bt(!1)}}return o.memoizedState=[c,r],c},useReducer:function(n,r,o){var c=Tn();if(o!==void 0){var p=o(r);if(xs){bt(!0);try{o(r)}finally{bt(!1)}}}else p=r;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=Vw.bind(null,Ie,n),[c.memoizedState,n]},useRef:function(n){var r=Tn();return n={current:n},r.memoizedState=n},useState:function(n){n=Zd(n);var r=n.queue,o=tx.bind(null,Ie,r);return r.dispatch=o,[n.memoizedState,o]},useDebugValue:ef,useDeferredValue:function(n,r){var o=Tn();return tf(o,n,r)},useTransition:function(){var n=Zd(!1);return n=Qg.bind(null,Ie,n.queue,!0,!1),Tn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,o){var c=Ie,p=Tn();if(et){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),yt===null)throw Error(s(349));(Je&127)!==0||jg(c,r,o)}p.memoizedState=o;var g={value:o,getSnapshot:r};return p.queue=g,Ig(Cg.bind(null,c,g,n),[n]),c.flags|=2048,si(9,{destroy:void 0},Eg.bind(null,c,g,o,r),null),o},useId:function(){var n=Tn(),r=yt.identifierPrefix;if(et){var o=Ha,c=$a;o=(c&~(1<<32-Ft(c)-1)).toString(32)+o,r="_"+r+"R_"+o,o=Zl++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=Uw++,r="_"+r+"r_"+o.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:af,useFormState:zg,useActionState:zg,useOptimistic:function(n){var r=Tn();r.memoizedState=r.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=rf.bind(null,Ie,!0,o),o.dispatch=r,[n,r]},useMemoCache:Kd,useCacheRefresh:function(){return Tn().memoizedState=Gw.bind(null,Ie)},useEffectEvent:function(n){var r=Tn(),o={impl:n};return r.memoizedState=o,function(){if((ot&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}},sf={readContext:gn,use:Wl,useCallback:Yg,useContext:gn,useEffect:Wd,useImperativeHandle:Fg,useInsertionEffect:Gg,useLayoutEffect:Vg,useMemo:Kg,useReducer:ec,useRef:Bg,useState:function(){return ec(ir)},useDebugValue:ef,useDeferredValue:function(n,r){var o=Gt();return Xg(o,mt.memoizedState,n,r)},useTransition:function(){var n=ec(ir)[0],r=Gt().memoizedState;return[typeof n=="boolean"?n:so(n),r]},useSyncExternalStore:Ng,useId:Wg,useHostTransitionStatus:af,useFormState:Ug,useActionState:Ug,useOptimistic:function(n,r){var o=Gt();return Tg(o,mt,n,r)},useMemoCache:Kd,useCacheRefresh:ex};sf.useEffectEvent=Pg;var sx={readContext:gn,use:Wl,useCallback:Yg,useContext:gn,useEffect:Wd,useImperativeHandle:Fg,useInsertionEffect:Gg,useLayoutEffect:Vg,useMemo:Kg,useReducer:Qd,useRef:Bg,useState:function(){return Qd(ir)},useDebugValue:ef,useDeferredValue:function(n,r){var o=Gt();return mt===null?tf(o,n,r):Xg(o,mt.memoizedState,n,r)},useTransition:function(){var n=Qd(ir)[0],r=Gt().memoizedState;return[typeof n=="boolean"?n:so(n),r]},useSyncExternalStore:Ng,useId:Wg,useHostTransitionStatus:af,useFormState:Hg,useActionState:Hg,useOptimistic:function(n,r){var o=Gt();return mt!==null?Tg(o,mt,n,r):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:Kd,useCacheRefresh:ex};sx.useEffectEvent=Pg;function of(n,r,o,c){r=n.memoizedState,o=o(c,r),o=o==null?r:y({},r,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var lf={enqueueSetState:function(n,r,o){n=n._reactInternals;var c=ea(),p=Tr(c);p.payload=r,o!=null&&(p.callback=o),r=Ar(n,p,c),r!==null&&(Gn(r,n,c),to(r,n,c))},enqueueReplaceState:function(n,r,o){n=n._reactInternals;var c=ea(),p=Tr(c);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=Ar(n,p,c),r!==null&&(Gn(r,n,c),to(r,n,c))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var o=ea(),c=Tr(o);c.tag=2,r!=null&&(c.callback=r),r=Ar(n,c,o),r!==null&&(Gn(r,n,o),to(r,n,o))}};function ix(n,r,o,c,p,g,S){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,g,S):r.prototype&&r.prototype.isPureReactComponent?!Yi(o,c)||!Yi(p,g):!0}function ox(n,r,o,c){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,c),r.state!==n&&lf.enqueueReplaceState(r,r.state,null)}function ys(n,r){var o=r;if("ref"in r){o={};for(var c in r)c!=="ref"&&(o[c]=r[c])}if(n=n.defaultProps){o===r&&(o=y({},o));for(var p in n)o[p]===void 0&&(o[p]=n[p])}return o}function lx(n){Ml(n)}function cx(n){console.error(n)}function ux(n){Ml(n)}function rc(n,r){try{var o=n.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function dx(n,r,o){try{var c=n.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function cf(n,r,o){return o=Tr(o),o.tag=3,o.payload={element:null},o.callback=function(){rc(n,r)},o}function fx(n){return n=Tr(n),n.tag=3,n}function hx(n,r,o,c){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var g=c.value;n.payload=function(){return p(g)},n.callback=function(){dx(r,o,c)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(n.callback=function(){dx(r,o,c),typeof p!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var C=c.stack;this.componentDidCatch(c.value,{componentStack:C!==null?C:""})})}function qw(n,r,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=o.alternate,r!==null&&Zs(r,o,p,!0),o=Qn.current,o!==null){switch(o.tag){case 31:case 13:return ga===null?gc():o.alternate===null&&zt===0&&(zt=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===ql?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([c]):r.add(c),Df(n,c,p)),!1;case 22:return o.flags|=65536,c===ql?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([c]):o.add(c)),Df(n,c,p)),!1}throw Error(s(435,o.tag))}return Df(n,c,p),gc(),!1}if(et)return r=Qn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==Cd&&(n=Error(s(422),{cause:c}),Qi(fa(n,o)))):(c!==Cd&&(r=Error(s(423),{cause:c}),Qi(fa(r,o))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=fa(c,o),p=cf(n.stateNode,c,p),$d(n,p),zt!==4&&(zt=2)),!1;var g=Error(s(520),{cause:c});if(g=fa(g,o),go===null?go=[g]:go.push(g),zt!==4&&(zt=2),r===null)return!0;c=fa(c,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,n=p&-p,o.lanes|=n,n=cf(o.stateNode,c,n),$d(o,n),!1;case 1:if(r=o.type,g=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Ur===null||!Ur.has(g))))return o.flags|=65536,p&=-p,o.lanes|=p,p=fx(p),hx(p,n,o,c),$d(o,p),!1}o=o.return}while(o!==null);return!1}var uf=Error(s(461)),Qt=!1;function xn(n,r,o,c){r.child=n===null?xg(r,null,o,c):gs(r,n.child,o,c)}function mx(n,r,o,c,p){o=o.render;var g=r.ref;if("ref"in c){var S={};for(var C in c)C!=="ref"&&(S[C]=c[C])}else S=c;return fs(r),c=Vd(n,r,o,S,g,p),C=qd(),n!==null&&!Qt?(Fd(n,r,p),or(n,r,p)):(et&&C&&jd(r),r.flags|=1,xn(n,r,c,p),r.child)}function px(n,r,o,c,p){if(n===null){var g=o.type;return typeof g=="function"&&!Sd(g)&&g.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=g,gx(n,r,g,c,p)):(n=Hl(o.type,null,c,r,r.mode,p),n.ref=r.ref,n.return=r,r.child=n)}if(g=n.child,!yf(n,p)){var S=g.memoizedProps;if(o=o.compare,o=o!==null?o:Yi,o(S,c)&&n.ref===r.ref)return or(n,r,p)}return r.flags|=1,n=tr(g,c),n.ref=r.ref,n.return=r,r.child=n}function gx(n,r,o,c,p){if(n!==null){var g=n.memoizedProps;if(Yi(g,c)&&n.ref===r.ref)if(Qt=!1,r.pendingProps=c=g,yf(n,p))(n.flags&131072)!==0&&(Qt=!0);else return r.lanes=n.lanes,or(n,r,p)}return df(n,r,o,c,p)}function xx(n,r,o,c){var p=c.children,g=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(g=g!==null?g.baseLanes|o:o,n!==null){for(c=r.child=n.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~g}else c=0,r.child=null;return yx(n,r,g,o,c)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gl(r,g!==null?g.cachePool:null),g!==null?bg(r,g):Bd(),_g(r);else return c=r.lanes=536870912,yx(n,r,g!==null?g.baseLanes|o:o,o,c)}else g!==null?(Gl(r,g.cachePool),bg(r,g),Or(),r.memoizedState=null):(n!==null&&Gl(r,null),Bd(),Or());return xn(n,r,p,o),r.child}function lo(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function yx(n,r,o,c,p){var g=Dd();return g=g===null?null:{parent:Kt._currentValue,pool:g},r.memoizedState={baseLanes:o,cachePool:g},n!==null&&Gl(r,null),Bd(),_g(r),n!==null&&Zs(n,r,c,!0),r.childLanes=p,null}function sc(n,r){return r=oc({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function vx(n,r,o){return gs(r,n.child,null,o),n=sc(r,r.pendingProps),n.flags|=2,Zn(r),r.memoizedState=null,n}function Fw(n,r,o){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(et){if(c.mode==="hidden")return n=sc(r,c),r.lanes=536870912,lo(null,n);if(Pd(r),(n=kt)?(n=Ay(n,pa),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:jr!==null?{id:$a,overflow:Ha}:null,retryLane:536870912,hydrationErrors:null},o=ng(n),o.return=r,r.child=o,pn=r,kt=null)):n=null,n===null)throw Cr(r);return r.lanes=536870912,null}return sc(r,c)}var g=n.memoizedState;if(g!==null){var S=g.dehydrated;if(Pd(r),p)if(r.flags&256)r.flags&=-257,r=vx(n,r,o);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(Qt||Zs(n,r,o,!1),p=(o&n.childLanes)!==0,Qt||p){if(c=yt,c!==null&&(S=M(c,o),S!==0&&S!==g.retryLane))throw g.retryLane=S,ls(n,S),Gn(c,n,S),uf;gc(),r=vx(n,r,o)}else n=g.treeContext,kt=xa(S.nextSibling),pn=r,et=!0,Er=null,pa=!1,n!==null&&sg(r,n),r=sc(r,c),r.flags|=4096;return r}return n=tr(n.child,{mode:c.mode,children:c.children}),n.ref=r.ref,r.child=n,n.return=r,n}function ic(n,r){var o=r.ref;if(o===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(n===null||n.ref!==o)&&(r.flags|=4194816)}}function df(n,r,o,c,p){return fs(r),o=Vd(n,r,o,c,void 0,p),c=qd(),n!==null&&!Qt?(Fd(n,r,p),or(n,r,p)):(et&&c&&jd(r),r.flags|=1,xn(n,r,o,p),r.child)}function bx(n,r,o,c,p,g){return fs(r),r.updateQueue=null,o=wg(r,c,o,p),Sg(n),c=qd(),n!==null&&!Qt?(Fd(n,r,g),or(n,r,g)):(et&&c&&jd(r),r.flags|=1,xn(n,r,o,g),r.child)}function _x(n,r,o,c,p){if(fs(r),r.stateNode===null){var g=Ys,S=o.contextType;typeof S=="object"&&S!==null&&(g=gn(S)),g=new o(c,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=lf,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=c,g.state=r.memoizedState,g.refs={},zd(r),S=o.contextType,g.context=typeof S=="object"&&S!==null?gn(S):Ys,g.state=r.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(of(r,o,S,c),g.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&lf.enqueueReplaceState(g,g.state,null),ao(r,c,g,p),no(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(n===null){g=r.stateNode;var C=r.memoizedProps,z=ys(o,C);g.props=z;var K=g.context,te=o.contextType;S=Ys,typeof te=="object"&&te!==null&&(S=gn(te));var ue=o.getDerivedStateFromProps;te=typeof ue=="function"||typeof g.getSnapshotBeforeUpdate=="function",C=r.pendingProps!==C,te||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C||K!==S)&&ox(r,g,c,S),Rr=!1;var Q=r.memoizedState;g.state=Q,ao(r,c,g,p),no(),K=r.memoizedState,C||Q!==K||Rr?(typeof ue=="function"&&(of(r,o,ue,c),K=r.memoizedState),(z=Rr||ix(r,o,z,c,Q,K,S))?(te||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=K),g.props=c,g.state=K,g.context=S,c=z):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{g=r.stateNode,Ud(n,r),S=r.memoizedProps,te=ys(o,S),g.props=te,ue=r.pendingProps,Q=g.context,K=o.contextType,z=Ys,typeof K=="object"&&K!==null&&(z=gn(K)),C=o.getDerivedStateFromProps,(K=typeof C=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ue||Q!==z)&&ox(r,g,c,z),Rr=!1,Q=r.memoizedState,g.state=Q,ao(r,c,g,p),no();var W=r.memoizedState;S!==ue||Q!==W||Rr||n!==null&&n.dependencies!==null&&Il(n.dependencies)?(typeof C=="function"&&(of(r,o,C,c),W=r.memoizedState),(te=Rr||ix(r,o,te,c,Q,W,z)||n!==null&&n.dependencies!==null&&Il(n.dependencies))?(K||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,W,z),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,W,z)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=W),g.props=c,g.state=W,g.context=z,c=te):(typeof g.componentDidUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(r.flags|=1024),c=!1)}return g=c,ic(n,r),c=(r.flags&128)!==0,g||c?(g=r.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,n!==null&&c?(r.child=gs(r,n.child,null,p),r.child=gs(r,null,o,p)):xn(n,r,o,p),r.memoizedState=g.state,n=r.child):n=or(n,r,p),n}function Sx(n,r,o,c){return us(),r.flags|=256,xn(n,r,o,c),r.child}var ff={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hf(n){return{baseLanes:n,cachePool:dg()}}function mf(n,r,o){return n=n!==null?n.childLanes&~o:0,r&&(n|=Wn),n}function wx(n,r,o){var c=r.pendingProps,p=!1,g=(r.flags&128)!==0,S;if((S=g)||(S=n!==null&&n.memoizedState===null?!1:(Pt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,n===null){if(et){if(p?Lr(r):Or(),(n=kt)?(n=Ay(n,pa),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:jr!==null?{id:$a,overflow:Ha}:null,retryLane:536870912,hydrationErrors:null},o=ng(n),o.return=r,r.child=o,pn=r,kt=null)):n=null,n===null)throw Cr(r);return Qf(n)?r.lanes=32:r.lanes=536870912,null}var C=c.children;return c=c.fallback,p?(Or(),p=r.mode,C=oc({mode:"hidden",children:C},p),c=cs(c,p,o,null),C.return=r,c.return=r,C.sibling=c,r.child=C,c=r.child,c.memoizedState=hf(o),c.childLanes=mf(n,S,o),r.memoizedState=ff,lo(null,c)):(Lr(r),pf(r,C))}var z=n.memoizedState;if(z!==null&&(C=z.dehydrated,C!==null)){if(g)r.flags&256?(Lr(r),r.flags&=-257,r=gf(n,r,o)):r.memoizedState!==null?(Or(),r.child=n.child,r.flags|=128,r=null):(Or(),C=c.fallback,p=r.mode,c=oc({mode:"visible",children:c.children},p),C=cs(C,p,o,null),C.flags|=2,c.return=r,C.return=r,c.sibling=C,r.child=c,gs(r,n.child,null,o),c=r.child,c.memoizedState=hf(o),c.childLanes=mf(n,S,o),r.memoizedState=ff,r=lo(null,c));else if(Lr(r),Qf(C)){if(S=C.nextSibling&&C.nextSibling.dataset,S)var K=S.dgst;S=K,c=Error(s(419)),c.stack="",c.digest=S,Qi({value:c,source:null,stack:null}),r=gf(n,r,o)}else if(Qt||Zs(n,r,o,!1),S=(o&n.childLanes)!==0,Qt||S){if(S=yt,S!==null&&(c=M(S,o),c!==0&&c!==z.retryLane))throw z.retryLane=c,ls(n,c),Gn(S,n,c),uf;Xf(C)||gc(),r=gf(n,r,o)}else Xf(C)?(r.flags|=192,r.child=n.child,r=null):(n=z.treeContext,kt=xa(C.nextSibling),pn=r,et=!0,Er=null,pa=!1,n!==null&&sg(r,n),r=pf(r,c.children),r.flags|=4096);return r}return p?(Or(),C=c.fallback,p=r.mode,z=n.child,K=z.sibling,c=tr(z,{mode:"hidden",children:c.children}),c.subtreeFlags=z.subtreeFlags&65011712,K!==null?C=tr(K,C):(C=cs(C,p,o,null),C.flags|=2),C.return=r,c.return=r,c.sibling=C,r.child=c,lo(null,c),c=r.child,C=n.child.memoizedState,C===null?C=hf(o):(p=C.cachePool,p!==null?(z=Kt._currentValue,p=p.parent!==z?{parent:z,pool:z}:p):p=dg(),C={baseLanes:C.baseLanes|o,cachePool:p}),c.memoizedState=C,c.childLanes=mf(n,S,o),r.memoizedState=ff,lo(n.child,c)):(Lr(r),o=n.child,n=o.sibling,o=tr(o,{mode:"visible",children:c.children}),o.return=r,o.sibling=null,n!==null&&(S=r.deletions,S===null?(r.deletions=[n],r.flags|=16):S.push(n)),r.child=o,r.memoizedState=null,o)}function pf(n,r){return r=oc({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function oc(n,r){return n=Xn(22,n,null,r),n.lanes=0,n}function gf(n,r,o){return gs(r,n.child,null,o),n=pf(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function Nx(n,r,o){n.lanes|=r;var c=n.alternate;c!==null&&(c.lanes|=r),Td(n.return,r,o)}function xf(n,r,o,c,p,g){var S=n.memoizedState;S===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:p,treeForkCount:g}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=o,S.tailMode=p,S.treeForkCount=g)}function jx(n,r,o){var c=r.pendingProps,p=c.revealOrder,g=c.tail;c=c.children;var S=Pt.current,C=(S&2)!==0;if(C?(S=S&1|2,r.flags|=128):S&=1,re(Pt,S),xn(n,r,c,o),c=et?Xi:0,!C&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Nx(n,o,r);else if(n.tag===19)Nx(n,o,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(o=r.child,p=null;o!==null;)n=o.alternate,n!==null&&Xl(n)===null&&(p=o),o=o.sibling;o=p,o===null?(p=r.child,r.child=null):(p=o.sibling,o.sibling=null),xf(r,!1,p,o,g,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=r.child,r.child=null;p!==null;){if(n=p.alternate,n!==null&&Xl(n)===null){r.child=p;break}n=p.sibling,p.sibling=o,o=p,p=n}xf(r,!0,o,null,g,c);break;case"together":xf(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function or(n,r,o){if(n!==null&&(r.dependencies=n.dependencies),zr|=r.lanes,(o&r.childLanes)===0)if(n!==null){if(Zs(n,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(s(153));if(r.child!==null){for(n=r.child,o=tr(n,n.pendingProps),r.child=o,o.return=r;n.sibling!==null;)n=n.sibling,o=o.sibling=tr(n,n.pendingProps),o.return=r;o.sibling=null}return r.child}function yf(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Il(n)))}function Yw(n,r,o){switch(r.tag){case 3:De(r,r.stateNode.containerInfo),kr(r,Kt,n.memoizedState.cache),us();break;case 27:case 5:vn(r);break;case 4:De(r,r.stateNode.containerInfo);break;case 10:kr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Pd(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(Lr(r),r.flags|=128,null):(o&r.child.childLanes)!==0?wx(n,r,o):(Lr(r),n=or(n,r,o),n!==null?n.sibling:null);Lr(r);break;case 19:var p=(n.flags&128)!==0;if(c=(o&r.childLanes)!==0,c||(Zs(n,r,o,!1),c=(o&r.childLanes)!==0),p){if(c)return jx(n,r,o);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),re(Pt,Pt.current),c)break;return null;case 22:return r.lanes=0,xx(n,r,o,r.pendingProps);case 24:kr(r,Kt,n.memoizedState.cache)}return or(n,r,o)}function Ex(n,r,o){if(n!==null)if(n.memoizedProps!==r.pendingProps)Qt=!0;else{if(!yf(n,o)&&(r.flags&128)===0)return Qt=!1,Yw(n,r,o);Qt=(n.flags&131072)!==0}else Qt=!1,et&&(r.flags&1048576)!==0&&rg(r,Xi,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(n=ms(r.elementType),r.type=n,typeof n=="function")Sd(n)?(c=ys(n,c),r.tag=1,r=_x(null,r,n,c,o)):(r.tag=0,r=df(null,r,n,c,o));else{if(n!=null){var p=n.$$typeof;if(p===O){r.tag=11,r=mx(null,r,n,c,o);break e}else if(p===H){r.tag=14,r=px(null,r,n,c,o);break e}}throw r=D(n)||n,Error(s(306,r,""))}}return r;case 0:return df(n,r,r.type,r.pendingProps,o);case 1:return c=r.type,p=ys(c,r.pendingProps),_x(n,r,c,p,o);case 3:e:{if(De(r,r.stateNode.containerInfo),n===null)throw Error(s(387));c=r.pendingProps;var g=r.memoizedState;p=g.element,Ud(n,r),ao(r,c,null,o);var S=r.memoizedState;if(c=S.cache,kr(r,Kt,c),c!==g.cache&&Ad(r,[Kt],o,!0),no(),c=S.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=Sx(n,r,c,o);break e}else if(c!==p){p=fa(Error(s(424)),r),Qi(p),r=Sx(n,r,c,o);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,kt=xa(n.firstChild),pn=r,et=!0,Er=null,pa=!0,o=xg(r,null,c,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(us(),c===p){r=or(n,r,o);break e}xn(n,r,c,o)}r=r.child}return r;case 26:return ic(n,r),n===null?(o=Uy(r.type,null,r.pendingProps,null))?r.memoizedState=o:et||(o=r.type,n=r.pendingProps,c=wc(xe.current).createElement(o),c[pe]=r,c[ve]=n,yn(c,o,n),_t(c),r.stateNode=c):r.memoizedState=Uy(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return vn(r),n===null&&et&&(c=r.stateNode=Dy(r.type,r.pendingProps,xe.current),pn=r,pa=!0,p=kt,Ir(r.type)?(Zf=p,kt=xa(c.firstChild)):kt=p),xn(n,r,r.pendingProps.children,o),ic(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&et&&((p=c=kt)&&(c=w4(c,r.type,r.pendingProps,pa),c!==null?(r.stateNode=c,pn=r,kt=xa(c.firstChild),pa=!1,p=!0):p=!1),p||Cr(r)),vn(r),p=r.type,g=r.pendingProps,S=n!==null?n.memoizedProps:null,c=g.children,Ff(p,g)?c=null:S!==null&&Ff(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=Vd(n,r,$w,null,null,o),No._currentValue=p),ic(n,r),xn(n,r,c,o),r.child;case 6:return n===null&&et&&((n=o=kt)&&(o=N4(o,r.pendingProps,pa),o!==null?(r.stateNode=o,pn=r,kt=null,n=!0):n=!1),n||Cr(r)),null;case 13:return wx(n,r,o);case 4:return De(r,r.stateNode.containerInfo),c=r.pendingProps,n===null?r.child=gs(r,null,c,o):xn(n,r,c,o),r.child;case 11:return mx(n,r,r.type,r.pendingProps,o);case 7:return xn(n,r,r.pendingProps,o),r.child;case 8:return xn(n,r,r.pendingProps.children,o),r.child;case 12:return xn(n,r,r.pendingProps.children,o),r.child;case 10:return c=r.pendingProps,kr(r,r.type,c.value),xn(n,r,c.children,o),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,fs(r),p=gn(p),c=c(p),r.flags|=1,xn(n,r,c,o),r.child;case 14:return px(n,r,r.type,r.pendingProps,o);case 15:return gx(n,r,r.type,r.pendingProps,o);case 19:return jx(n,r,o);case 31:return Fw(n,r,o);case 22:return xx(n,r,o,r.pendingProps);case 24:return fs(r),c=gn(Kt),n===null?(p=Dd(),p===null&&(p=yt,g=Ld(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=o),p=g),r.memoizedState={parent:c,cache:p},zd(r),kr(r,Kt,p)):((n.lanes&o)!==0&&(Ud(n,r),ao(r,null,null,o),no()),p=n.memoizedState,g=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),kr(r,Kt,c)):(c=g.cache,kr(r,Kt,c),c!==p.cache&&Ad(r,[Kt],o,!0))),xn(n,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function lr(n){n.flags|=4}function vf(n,r,o,c,p){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(Wx())n.flags|=8192;else throw ps=ql,Md}else n.flags&=-16777217}function Cx(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Py(r))if(Wx())n.flags|=8192;else throw ps=ql,Md}function lc(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Be():536870912,n.lanes|=r,ci|=r)}function co(n,r){if(!et)switch(n.tailMode){case"hidden":r=n.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function Rt(n){var r=n.alternate!==null&&n.alternate.child===n.child,o=0,c=0;if(r)for(var p=n.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=o,r}function Kw(n,r,o){var c=r.pendingProps;switch(Ed(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(r),null;case 1:return Rt(r),null;case 3:return o=r.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),rr(Kt),qe(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Qs(r)?lr(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,kd())),Rt(r),null;case 26:var p=r.type,g=r.memoizedState;return n===null?(lr(r),g!==null?(Rt(r),Cx(r,g)):(Rt(r),vf(r,p,null,c,o))):g?g!==n.memoizedState?(lr(r),Rt(r),Cx(r,g)):(Rt(r),r.flags&=-16777217):(n=n.memoizedProps,n!==c&&lr(r),Rt(r),vf(r,p,n,c,o)),null;case 27:if(zn(r),o=xe.current,p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&lr(r);else{if(!c){if(r.stateNode===null)throw Error(s(166));return Rt(r),null}n=ie.current,Qs(r)?ig(r):(n=Dy(p,c,o),r.stateNode=n,lr(r))}return Rt(r),null;case 5:if(zn(r),p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&lr(r);else{if(!c){if(r.stateNode===null)throw Error(s(166));return Rt(r),null}if(g=ie.current,Qs(r))ig(r);else{var S=wc(xe.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}g[pe]=r,g[ve]=c;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=g;e:switch(yn(g,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&lr(r)}}return Rt(r),vf(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,o),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==c&&lr(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(s(166));if(n=xe.current,Qs(r)){if(n=r.stateNode,o=r.memoizedProps,c=null,p=pn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[pe]=r,n=!!(n.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||wy(n.nodeValue,o)),n||Cr(r,!0)}else n=wc(n).createTextNode(c),n[pe]=r,r.stateNode=n}return Rt(r),null;case 31:if(o=r.memoizedState,n===null||n.memoizedState!==null){if(c=Qs(r),o!==null){if(n===null){if(!c)throw Error(s(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[pe]=r}else us(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Rt(r),n=!1}else o=kd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return r.flags&256?(Zn(r),r):(Zn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Rt(r),null;case 13:if(c=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Qs(r),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[pe]=r}else us(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Rt(r),p=!1}else p=kd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(Zn(r),r):(Zn(r),null)}return Zn(r),(r.flags&128)!==0?(r.lanes=o,r):(o=c!==null,n=n!==null&&n.memoizedState!==null,o&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==p&&(c.flags|=2048)),o!==n&&o&&(r.child.flags|=8192),lc(r,r.updateQueue),Rt(r),null);case 4:return qe(),n===null&&If(r.stateNode.containerInfo),Rt(r),null;case 10:return rr(r.type),Rt(r),null;case 19:if(q(Pt),c=r.memoizedState,c===null)return Rt(r),null;if(p=(r.flags&128)!==0,g=c.rendering,g===null)if(p)co(c,!1);else{if(zt!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(g=Xl(n),g!==null){for(r.flags|=128,co(c,!1),n=g.updateQueue,r.updateQueue=n,lc(r,n),r.subtreeFlags=0,n=o,o=r.child;o!==null;)tg(o,n),o=o.sibling;return re(Pt,Pt.current&1|2),et&&nr(r,c.treeForkCount),r.child}n=n.sibling}c.tail!==null&&jt()>hc&&(r.flags|=128,p=!0,co(c,!1),r.lanes=4194304)}else{if(!p)if(n=Xl(g),n!==null){if(r.flags|=128,p=!0,n=n.updateQueue,r.updateQueue=n,lc(r,n),co(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!et)return Rt(r),null}else 2*jt()-c.renderingStartTime>hc&&o!==536870912&&(r.flags|=128,p=!0,co(c,!1),r.lanes=4194304);c.isBackwards?(g.sibling=r.child,r.child=g):(n=c.last,n!==null?n.sibling=g:r.child=g,c.last=g)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=jt(),n.sibling=null,o=Pt.current,re(Pt,p?o&1|2:o&1),et&&nr(r,c.treeForkCount),n):(Rt(r),null);case 22:case 23:return Zn(r),Id(),c=r.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(o&536870912)!==0&&(r.flags&128)===0&&(Rt(r),r.subtreeFlags&6&&(r.flags|=8192)):Rt(r),o=r.updateQueue,o!==null&&lc(r,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==o&&(r.flags|=2048),n!==null&&q(hs),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),rr(Kt),Rt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function Xw(n,r){switch(Ed(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return rr(Kt),qe(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return zn(r),null;case 31:if(r.memoizedState!==null){if(Zn(r),r.alternate===null)throw Error(s(340));us()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(Zn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));us()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return q(Pt),null;case 4:return qe(),null;case 10:return rr(r.type),null;case 22:case 23:return Zn(r),Id(),n!==null&&q(hs),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return rr(Kt),null;case 25:return null;default:return null}}function kx(n,r){switch(Ed(r),r.tag){case 3:rr(Kt),qe();break;case 26:case 27:case 5:zn(r);break;case 4:qe();break;case 31:r.memoizedState!==null&&Zn(r);break;case 13:Zn(r);break;case 19:q(Pt);break;case 10:rr(r.type);break;case 22:case 23:Zn(r),Id(),n!==null&&q(hs);break;case 24:rr(Kt)}}function uo(n,r){try{var o=r.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var p=c.next;o=p;do{if((o.tag&n)===n){c=void 0;var g=o.create,S=o.inst;c=g(),S.destroy=c}o=o.next}while(o!==p)}}catch(C){ht(r,r.return,C)}}function Dr(n,r,o){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var g=p.next;c=g;do{if((c.tag&n)===n){var S=c.inst,C=S.destroy;if(C!==void 0){S.destroy=void 0,p=r;var z=o,K=C;try{K()}catch(te){ht(p,z,te)}}}c=c.next}while(c!==g)}}catch(te){ht(r,r.return,te)}}function Rx(n){var r=n.updateQueue;if(r!==null){var o=n.stateNode;try{vg(r,o)}catch(c){ht(n,n.return,c)}}}function Tx(n,r,o){o.props=ys(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(c){ht(n,r,c)}}function fo(n,r){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof o=="function"?n.refCleanup=o(c):o.current=c}}catch(p){ht(n,r,p)}}function Ba(n,r){var o=n.ref,c=n.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){ht(n,r,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){ht(n,r,p)}else o.current=null}function Ax(n){var r=n.type,o=n.memoizedProps,c=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(p){ht(n,n.return,p)}}function bf(n,r,o){try{var c=n.stateNode;x4(c,n.type,o,r),c[ve]=r}catch(p){ht(n,n.return,p)}}function Lx(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ir(n.type)||n.tag===4}function _f(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Lx(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Ir(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Sf(n,r,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(n),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=Wa));else if(c!==4&&(c===27&&Ir(n.type)&&(o=n.stateNode,r=null),n=n.child,n!==null))for(Sf(n,r,o),n=n.sibling;n!==null;)Sf(n,r,o),n=n.sibling}function cc(n,r,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,r?o.insertBefore(n,r):o.appendChild(n);else if(c!==4&&(c===27&&Ir(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(cc(n,r,o),n=n.sibling;n!==null;)cc(n,r,o),n=n.sibling}function Ox(n){var r=n.stateNode,o=n.memoizedProps;try{for(var c=n.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);yn(r,c,o),r[pe]=n,r[ve]=o}catch(g){ht(n,n.return,g)}}var cr=!1,Zt=!1,wf=!1,Dx=typeof WeakSet=="function"?WeakSet:Set,un=null;function Qw(n,r){if(n=n.containerInfo,Vf=Tc,n=Fp(n),pd(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var p=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var S=0,C=-1,z=-1,K=0,te=0,ue=n,Q=null;t:for(;;){for(var W;ue!==o||p!==0&&ue.nodeType!==3||(C=S+p),ue!==g||c!==0&&ue.nodeType!==3||(z=S+c),ue.nodeType===3&&(S+=ue.nodeValue.length),(W=ue.firstChild)!==null;)Q=ue,ue=W;for(;;){if(ue===n)break t;if(Q===o&&++K===p&&(C=S),Q===g&&++te===c&&(z=S),(W=ue.nextSibling)!==null)break;ue=Q,Q=ue.parentNode}ue=W}o=C===-1||z===-1?null:{start:C,end:z}}else o=null}o=o||{start:0,end:0}}else o=null;for(qf={focusedElem:n,selectionRange:o},Tc=!1,un=r;un!==null;)if(r=un,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,un=n;else for(;un!==null;){switch(r=un,g=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)p=n[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,o=r,p=g.memoizedProps,g=g.memoizedState,c=o.stateNode;try{var we=ys(o.type,p);n=c.getSnapshotBeforeUpdate(we,g),c.__reactInternalSnapshotBeforeUpdate=n}catch(Le){ht(o,o.return,Le)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,o=n.nodeType,o===9)Kf(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Kf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=r.sibling,n!==null){n.return=r.return,un=n;break}un=r.return}}function Mx(n,r,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:dr(n,o),c&4&&uo(5,o);break;case 1:if(dr(n,o),c&4)if(n=o.stateNode,r===null)try{n.componentDidMount()}catch(S){ht(o,o.return,S)}else{var p=ys(o.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(p,r,n.__reactInternalSnapshotBeforeUpdate)}catch(S){ht(o,o.return,S)}}c&64&&Rx(o),c&512&&fo(o,o.return);break;case 3:if(dr(n,o),c&64&&(n=o.updateQueue,n!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{vg(n,r)}catch(S){ht(o,o.return,S)}}break;case 27:r===null&&c&4&&Ox(o);case 26:case 5:dr(n,o),r===null&&c&4&&Ax(o),c&512&&fo(o,o.return);break;case 12:dr(n,o);break;case 31:dr(n,o),c&4&&$x(n,o);break;case 13:dr(n,o),c&4&&Hx(n,o),c&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=s4.bind(null,o),j4(n,o))));break;case 22:if(c=o.memoizedState!==null||cr,!c){r=r!==null&&r.memoizedState!==null||Zt,p=cr;var g=Zt;cr=c,(Zt=r)&&!g?fr(n,o,(o.subtreeFlags&8772)!==0):dr(n,o),cr=p,Zt=g}break;case 30:break;default:dr(n,o)}}function zx(n){var r=n.alternate;r!==null&&(n.alternate=null,zx(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&xt(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var At=null,Hn=!1;function ur(n,r,o){for(o=o.child;o!==null;)Ux(n,r,o),o=o.sibling}function Ux(n,r,o){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(mn,o)}catch{}switch(o.tag){case 26:Zt||Ba(o,r),ur(n,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Zt||Ba(o,r);var c=At,p=Hn;Ir(o.type)&&(At=o.stateNode,Hn=!1),ur(n,r,o),_o(o.stateNode),At=c,Hn=p;break;case 5:Zt||Ba(o,r);case 6:if(c=At,p=Hn,At=null,ur(n,r,o),At=c,Hn=p,At!==null)if(Hn)try{(At.nodeType===9?At.body:At.nodeName==="HTML"?At.ownerDocument.body:At).removeChild(o.stateNode)}catch(g){ht(o,r,g)}else try{At.removeChild(o.stateNode)}catch(g){ht(o,r,g)}break;case 18:At!==null&&(Hn?(n=At,Ry(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),xi(n)):Ry(At,o.stateNode));break;case 4:c=At,p=Hn,At=o.stateNode.containerInfo,Hn=!0,ur(n,r,o),At=c,Hn=p;break;case 0:case 11:case 14:case 15:Dr(2,o,r),Zt||Dr(4,o,r),ur(n,r,o);break;case 1:Zt||(Ba(o,r),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Tx(o,r,c)),ur(n,r,o);break;case 21:ur(n,r,o);break;case 22:Zt=(c=Zt)||o.memoizedState!==null,ur(n,r,o),Zt=c;break;default:ur(n,r,o)}}function $x(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{xi(n)}catch(o){ht(r,r.return,o)}}}function Hx(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{xi(n)}catch(o){ht(r,r.return,o)}}function Zw(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new Dx),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new Dx),r;default:throw Error(s(435,n.tag))}}function uc(n,r){var o=Zw(n);r.forEach(function(c){if(!o.has(c)){o.add(c);var p=i4.bind(null,n,c);c.then(p,p)}})}function Bn(n,r){var o=r.deletions;if(o!==null)for(var c=0;c<o.length;c++){var p=o[c],g=n,S=r,C=S;e:for(;C!==null;){switch(C.tag){case 27:if(Ir(C.type)){At=C.stateNode,Hn=!1;break e}break;case 5:At=C.stateNode,Hn=!1;break e;case 3:case 4:At=C.stateNode.containerInfo,Hn=!0;break e}C=C.return}if(At===null)throw Error(s(160));Ux(g,S,p),At=null,Hn=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Bx(r,n),r=r.sibling}var Ta=null;function Bx(n,r){var o=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Bn(r,n),In(n),c&4&&(Dr(3,n,n.return),uo(3,n),Dr(5,n,n.return));break;case 1:Bn(r,n),In(n),c&512&&(Zt||o===null||Ba(o,o.return)),c&64&&cr&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var p=Ta;if(Bn(r,n),In(n),c&512&&(Zt||o===null||Ba(o,o.return)),c&4){var g=o!==null?o.memoizedState:null;if(c=n.memoizedState,o===null)if(c===null)if(n.stateNode===null){e:{c=n.type,o=n.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":g=p.getElementsByTagName("title")[0],(!g||g[Ye]||g[pe]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(c),p.head.insertBefore(g,p.querySelector("head > title"))),yn(g,c,o),g[pe]=n,_t(g),c=g;break e;case"link":var S=By("link","href",p).get(c+(o.href||""));if(S){for(var C=0;C<S.length;C++)if(g=S[C],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(C,1);break t}}g=p.createElement(c),yn(g,c,o),p.head.appendChild(g);break;case"meta":if(S=By("meta","content",p).get(c+(o.content||""))){for(C=0;C<S.length;C++)if(g=S[C],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(C,1);break t}}g=p.createElement(c),yn(g,c,o),p.head.appendChild(g);break;default:throw Error(s(468,c))}g[pe]=n,_t(g),c=g}n.stateNode=c}else Iy(p,n.type,n.stateNode);else n.stateNode=Hy(p,c,n.memoizedProps);else g!==c?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,c===null?Iy(p,n.type,n.stateNode):Hy(p,c,n.memoizedProps)):c===null&&n.stateNode!==null&&bf(n,n.memoizedProps,o.memoizedProps)}break;case 27:Bn(r,n),In(n),c&512&&(Zt||o===null||Ba(o,o.return)),o!==null&&c&4&&bf(n,n.memoizedProps,o.memoizedProps);break;case 5:if(Bn(r,n),In(n),c&512&&(Zt||o===null||Ba(o,o.return)),n.flags&32){p=n.stateNode;try{Bs(p,"")}catch(we){ht(n,n.return,we)}}c&4&&n.stateNode!=null&&(p=n.memoizedProps,bf(n,p,o!==null?o.memoizedProps:p)),c&1024&&(wf=!0);break;case 6:if(Bn(r,n),In(n),c&4){if(n.stateNode===null)throw Error(s(162));c=n.memoizedProps,o=n.stateNode;try{o.nodeValue=c}catch(we){ht(n,n.return,we)}}break;case 3:if(Ec=null,p=Ta,Ta=Nc(r.containerInfo),Bn(r,n),Ta=p,In(n),c&4&&o!==null&&o.memoizedState.isDehydrated)try{xi(r.containerInfo)}catch(we){ht(n,n.return,we)}wf&&(wf=!1,Ix(n));break;case 4:c=Ta,Ta=Nc(n.stateNode.containerInfo),Bn(r,n),In(n),Ta=c;break;case 12:Bn(r,n),In(n);break;case 31:Bn(r,n),In(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,uc(n,c)));break;case 13:Bn(r,n),In(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(fc=jt()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,uc(n,c)));break;case 22:p=n.memoizedState!==null;var z=o!==null&&o.memoizedState!==null,K=cr,te=Zt;if(cr=K||p,Zt=te||z,Bn(r,n),Zt=te,cr=K,In(n),c&8192)e:for(r=n.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||z||cr||Zt||vs(n)),o=null,r=n;;){if(r.tag===5||r.tag===26){if(o===null){z=o=r;try{if(g=z.stateNode,p)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{C=z.stateNode;var ue=z.memoizedProps.style,Q=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;C.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(we){ht(z,z.return,we)}}}else if(r.tag===6){if(o===null){z=r;try{z.stateNode.nodeValue=p?"":z.memoizedProps}catch(we){ht(z,z.return,we)}}}else if(r.tag===18){if(o===null){z=r;try{var W=z.stateNode;p?Ty(W,!0):Ty(z.stateNode,!1)}catch(we){ht(z,z.return,we)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=n.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,uc(n,o))));break;case 19:Bn(r,n),In(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,uc(n,c)));break;case 30:break;case 21:break;default:Bn(r,n),In(n)}}function In(n){var r=n.flags;if(r&2){try{for(var o,c=n.return;c!==null;){if(Lx(c)){o=c;break}c=c.return}if(o==null)throw Error(s(160));switch(o.tag){case 27:var p=o.stateNode,g=_f(n);cc(n,g,p);break;case 5:var S=o.stateNode;o.flags&32&&(Bs(S,""),o.flags&=-33);var C=_f(n);cc(n,C,S);break;case 3:case 4:var z=o.stateNode.containerInfo,K=_f(n);Sf(n,K,z);break;default:throw Error(s(161))}}catch(te){ht(n,n.return,te)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function Ix(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;Ix(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function dr(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Mx(n,r.alternate,r),r=r.sibling}function vs(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Dr(4,r,r.return),vs(r);break;case 1:Ba(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&Tx(r,r.return,o),vs(r);break;case 27:_o(r.stateNode);case 26:case 5:Ba(r,r.return),vs(r);break;case 22:r.memoizedState===null&&vs(r);break;case 30:vs(r);break;default:vs(r)}n=n.sibling}}function fr(n,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,p=n,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:fr(p,g,o),uo(4,g);break;case 1:if(fr(p,g,o),c=g,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(K){ht(c,c.return,K)}if(c=g,p=c.updateQueue,p!==null){var C=c.stateNode;try{var z=p.shared.hiddenCallbacks;if(z!==null)for(p.shared.hiddenCallbacks=null,p=0;p<z.length;p++)yg(z[p],C)}catch(K){ht(c,c.return,K)}}o&&S&64&&Rx(g),fo(g,g.return);break;case 27:Ox(g);case 26:case 5:fr(p,g,o),o&&c===null&&S&4&&Ax(g),fo(g,g.return);break;case 12:fr(p,g,o);break;case 31:fr(p,g,o),o&&S&4&&$x(p,g);break;case 13:fr(p,g,o),o&&S&4&&Hx(p,g);break;case 22:g.memoizedState===null&&fr(p,g,o),fo(g,g.return);break;case 30:break;default:fr(p,g,o)}r=r.sibling}}function Nf(n,r){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&Zi(o))}function jf(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Zi(n))}function Aa(n,r,o,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Px(n,r,o,c),r=r.sibling}function Px(n,r,o,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Aa(n,r,o,c),p&2048&&uo(9,r);break;case 1:Aa(n,r,o,c);break;case 3:Aa(n,r,o,c),p&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Zi(n)));break;case 12:if(p&2048){Aa(n,r,o,c),n=r.stateNode;try{var g=r.memoizedProps,S=g.id,C=g.onPostCommit;typeof C=="function"&&C(S,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(z){ht(r,r.return,z)}}else Aa(n,r,o,c);break;case 31:Aa(n,r,o,c);break;case 13:Aa(n,r,o,c);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState!==null?g._visibility&2?Aa(n,r,o,c):ho(n,r):g._visibility&2?Aa(n,r,o,c):(g._visibility|=2,ii(n,r,o,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Nf(S,r);break;case 24:Aa(n,r,o,c),p&2048&&jf(r.alternate,r);break;default:Aa(n,r,o,c)}}function ii(n,r,o,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var g=n,S=r,C=o,z=c,K=S.flags;switch(S.tag){case 0:case 11:case 15:ii(g,S,C,z,p),uo(8,S);break;case 23:break;case 22:var te=S.stateNode;S.memoizedState!==null?te._visibility&2?ii(g,S,C,z,p):ho(g,S):(te._visibility|=2,ii(g,S,C,z,p)),p&&K&2048&&Nf(S.alternate,S);break;case 24:ii(g,S,C,z,p),p&&K&2048&&jf(S.alternate,S);break;default:ii(g,S,C,z,p)}r=r.sibling}}function ho(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=n,c=r,p=c.flags;switch(c.tag){case 22:ho(o,c),p&2048&&Nf(c.alternate,c);break;case 24:ho(o,c),p&2048&&jf(c.alternate,c);break;default:ho(o,c)}r=r.sibling}}var mo=8192;function oi(n,r,o){if(n.subtreeFlags&mo)for(n=n.child;n!==null;)Gx(n,r,o),n=n.sibling}function Gx(n,r,o){switch(n.tag){case 26:oi(n,r,o),n.flags&mo&&n.memoizedState!==null&&U4(o,Ta,n.memoizedState,n.memoizedProps);break;case 5:oi(n,r,o);break;case 3:case 4:var c=Ta;Ta=Nc(n.stateNode.containerInfo),oi(n,r,o),Ta=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=mo,mo=16777216,oi(n,r,o),mo=c):oi(n,r,o));break;default:oi(n,r,o)}}function Vx(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function po(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var c=r[o];un=c,Fx(c,n)}Vx(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qx(n),n=n.sibling}function qx(n){switch(n.tag){case 0:case 11:case 15:po(n),n.flags&2048&&Dr(9,n,n.return);break;case 3:po(n);break;case 12:po(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,dc(n)):po(n);break;default:po(n)}}function dc(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var c=r[o];un=c,Fx(c,n)}Vx(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Dr(8,r,r.return),dc(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,dc(r));break;default:dc(r)}n=n.sibling}}function Fx(n,r){for(;un!==null;){var o=un;switch(o.tag){case 0:case 11:case 15:Dr(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Zi(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,un=c;else e:for(o=n;un!==null;){c=un;var p=c.sibling,g=c.return;if(zx(c),c===o){un=null;break e}if(p!==null){p.return=g,un=p;break e}un=g}}}var Jw={getCacheForType:function(n){var r=gn(Kt),o=r.data.get(n);return o===void 0&&(o=n(),r.data.set(n,o)),o},cacheSignal:function(){return gn(Kt).controller.signal}},Ww=typeof WeakMap=="function"?WeakMap:Map,ot=0,yt=null,Qe=null,Je=0,ft=0,Jn=null,Mr=!1,li=!1,Ef=!1,hr=0,zt=0,zr=0,bs=0,Cf=0,Wn=0,ci=0,go=null,Pn=null,kf=!1,fc=0,Yx=0,hc=1/0,mc=null,Ur=null,nn=0,$r=null,ui=null,mr=0,Rf=0,Tf=null,Kx=null,xo=0,Af=null;function ea(){return(ot&2)!==0&&Je!==0?Je&-Je:A.T!==null?Uf():fe()}function Xx(){if(Wn===0)if((Je&536870912)===0||et){var n=dt;dt<<=1,(dt&3932160)===0&&(dt=262144),Wn=n}else Wn=536870912;return n=Qn.current,n!==null&&(n.flags|=32),Wn}function Gn(n,r,o){(n===yt&&(ft===2||ft===9)||n.cancelPendingCommit!==null)&&(di(n,0),Hr(n,Je,Wn,!1)),Pe(n,o),((ot&2)===0||n!==yt)&&(n===yt&&((ot&2)===0&&(bs|=o),zt===4&&Hr(n,Je,Wn,!1)),Ia(n))}function Qx(n,r,o){if((ot&6)!==0)throw Error(s(327));var c=!o&&(r&127)===0&&(r&n.expiredLanes)===0||se(n,r),p=c?n4(n,r):Of(n,r,!0),g=c;do{if(p===0){li&&!c&&Hr(n,r,0,!1);break}else{if(o=n.current.alternate,g&&!e4(o)){p=Of(n,r,!1),g=!1;continue}if(p===2){if(g=r,n.errorRecoveryDisabledLanes&g)var S=0;else S=n.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var C=n;p=go;var z=C.current.memoizedState.isDehydrated;if(z&&(di(C,S).flags|=256),S=Of(C,S,!1),S!==2){if(Ef&&!z){C.errorRecoveryDisabledLanes|=g,bs|=g,p=4;break e}g=Pn,Pn=p,g!==null&&(Pn===null?Pn=g:Pn.push.apply(Pn,g))}p=S}if(g=!1,p!==2)continue}}if(p===1){di(n,0),Hr(n,r,0,!0);break}e:{switch(c=n,g=p,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Hr(c,r,Wn,!Mr);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(p=fc+300-jt(),10<p)){if(Hr(c,r,Wn,!Mr),en(c,0,!0)!==0)break e;mr=r,c.timeoutHandle=Cy(Zx.bind(null,c,o,Pn,mc,kf,r,Wn,bs,ci,Mr,g,"Throttled",-0,0),p);break e}Zx(c,o,Pn,mc,kf,r,Wn,bs,ci,Mr,g,null,-0,0)}}break}while(!0);Ia(n)}function Zx(n,r,o,c,p,g,S,C,z,K,te,ue,Q,W){if(n.timeoutHandle=-1,ue=r.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wa},Gx(r,g,ue);var we=(g&62914560)===g?fc-jt():(g&4194048)===g?Yx-jt():0;if(we=$4(ue,we),we!==null){mr=g,n.cancelPendingCommit=we(sy.bind(null,n,r,g,o,c,p,S,C,z,te,ue,null,Q,W)),Hr(n,g,S,!K);return}}sy(n,r,g,o,c,p,S,C,z)}function e4(n){for(var r=n;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var p=o[c],g=p.getSnapshot;p=p.value;try{if(!Kn(g(),p))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Hr(n,r,o,c){r&=~Cf,r&=~bs,n.suspendedLanes|=r,n.pingedLanes&=~r,c&&(n.warmLanes|=r),c=n.expirationTimes;for(var p=r;0<p;){var g=31-Ft(p),S=1<<g;c[g]=-1,p&=~S}o!==0&&la(n,o,r)}function pc(){return(ot&6)===0?(yo(0),!1):!0}function Lf(){if(Qe!==null){if(ft===0)var n=Qe.return;else n=Qe,ar=ds=null,Yd(n),ti=null,Wi=0,n=Qe;for(;n!==null;)kx(n.alternate,n),n=n.return;Qe=null}}function di(n,r){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,b4(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),mr=0,Lf(),yt=n,Qe=o=tr(n.current,null),Je=r,ft=0,Jn=null,Mr=!1,li=se(n,r),Ef=!1,ci=Wn=Cf=bs=zr=zt=0,Pn=go=null,kf=!1,(r&8)!==0&&(r|=r&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=r;0<c;){var p=31-Ft(c),g=1<<p;r|=n[p],c&=~g}return hr=r,zl(),o}function Jx(n,r){Ie=null,A.H=oo,r===ei||r===Vl?(r=mg(),ft=3):r===Md?(r=mg(),ft=4):ft=r===uf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Jn=r,Qe===null&&(zt=1,rc(n,fa(r,n.current)))}function Wx(){var n=Qn.current;return n===null?!0:(Je&4194048)===Je?ga===null:(Je&62914560)===Je||(Je&536870912)!==0?n===ga:!1}function ey(){var n=A.H;return A.H=oo,n===null?oo:n}function ty(){var n=A.A;return A.A=Jw,n}function gc(){zt=4,Mr||(Je&4194048)!==Je&&Qn.current!==null||(li=!0),(zr&134217727)===0&&(bs&134217727)===0||yt===null||Hr(yt,Je,Wn,!1)}function Of(n,r,o){var c=ot;ot|=2;var p=ey(),g=ty();(yt!==n||Je!==r)&&(mc=null,di(n,r)),r=!1;var S=zt;e:do try{if(ft!==0&&Qe!==null){var C=Qe,z=Jn;switch(ft){case 8:Lf(),S=6;break e;case 3:case 2:case 9:case 6:Qn.current===null&&(r=!0);var K=ft;if(ft=0,Jn=null,fi(n,C,z,K),o&&li){S=0;break e}break;default:K=ft,ft=0,Jn=null,fi(n,C,z,K)}}t4(),S=zt;break}catch(te){Jx(n,te)}while(!0);return r&&n.shellSuspendCounter++,ar=ds=null,ot=c,A.H=p,A.A=g,Qe===null&&(yt=null,Je=0,zl()),S}function t4(){for(;Qe!==null;)ny(Qe)}function n4(n,r){var o=ot;ot|=2;var c=ey(),p=ty();yt!==n||Je!==r?(mc=null,hc=jt()+500,di(n,r)):li=se(n,r);e:do try{if(ft!==0&&Qe!==null){r=Qe;var g=Jn;t:switch(ft){case 1:ft=0,Jn=null,fi(n,r,g,1);break;case 2:case 9:if(fg(g)){ft=0,Jn=null,ay(r);break}r=function(){ft!==2&&ft!==9||yt!==n||(ft=7),Ia(n)},g.then(r,r);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:fg(g)?(ft=0,Jn=null,ay(r)):(ft=0,Jn=null,fi(n,r,g,7));break;case 5:var S=null;switch(Qe.tag){case 26:S=Qe.memoizedState;case 5:case 27:var C=Qe;if(S?Py(S):C.stateNode.complete){ft=0,Jn=null;var z=C.sibling;if(z!==null)Qe=z;else{var K=C.return;K!==null?(Qe=K,xc(K)):Qe=null}break t}}ft=0,Jn=null,fi(n,r,g,5);break;case 6:ft=0,Jn=null,fi(n,r,g,6);break;case 8:Lf(),zt=6;break e;default:throw Error(s(462))}}a4();break}catch(te){Jx(n,te)}while(!0);return ar=ds=null,A.H=c,A.A=p,ot=o,Qe!==null?0:(yt=null,Je=0,zl(),zt)}function a4(){for(;Qe!==null&&!kn();)ny(Qe)}function ny(n){var r=Ex(n.alternate,n,hr);n.memoizedProps=n.pendingProps,r===null?xc(n):Qe=r}function ay(n){var r=n,o=r.alternate;switch(r.tag){case 15:case 0:r=bx(o,r,r.pendingProps,r.type,void 0,Je);break;case 11:r=bx(o,r,r.pendingProps,r.type.render,r.ref,Je);break;case 5:Yd(r);default:kx(o,r),r=Qe=tg(r,hr),r=Ex(o,r,hr)}n.memoizedProps=n.pendingProps,r===null?xc(n):Qe=r}function fi(n,r,o,c){ar=ds=null,Yd(r),ti=null,Wi=0;var p=r.return;try{if(qw(n,p,r,o,Je)){zt=1,rc(n,fa(o,n.current)),Qe=null;return}}catch(g){if(p!==null)throw Qe=p,g;zt=1,rc(n,fa(o,n.current)),Qe=null;return}r.flags&32768?(et||c===1?n=!0:li||(Je&536870912)!==0?n=!1:(Mr=n=!0,(c===2||c===9||c===3||c===6)&&(c=Qn.current,c!==null&&c.tag===13&&(c.flags|=16384))),ry(r,n)):xc(r)}function xc(n){var r=n;do{if((r.flags&32768)!==0){ry(r,Mr);return}n=r.return;var o=Kw(r.alternate,r,hr);if(o!==null){Qe=o;return}if(r=r.sibling,r!==null){Qe=r;return}Qe=r=n}while(r!==null);zt===0&&(zt=5)}function ry(n,r){do{var o=Xw(n.alternate,n);if(o!==null){o.flags&=32767,Qe=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(n=n.sibling,n!==null)){Qe=n;return}Qe=n=o}while(n!==null);zt=6,Qe=null}function sy(n,r,o,c,p,g,S,C,z){n.cancelPendingCommit=null;do yc();while(nn!==0);if((ot&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=bd,oa(n,o,g,S,C,z),n===yt&&(Qe=yt=null,Je=0),ui=r,$r=n,mr=o,Rf=g,Tf=p,Kx=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,o4(Xe,function(){return uy(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=A.T,A.T=null,p=G.p,G.p=2,S=ot,ot|=4;try{Qw(n,r,o)}finally{ot=S,G.p=p,A.T=c}}nn=1,iy(),oy(),ly()}}function iy(){if(nn===1){nn=0;var n=$r,r=ui,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=A.T,A.T=null;var c=G.p;G.p=2;var p=ot;ot|=4;try{Bx(r,n);var g=qf,S=Fp(n.containerInfo),C=g.focusedElem,z=g.selectionRange;if(S!==C&&C&&C.ownerDocument&&qp(C.ownerDocument.documentElement,C)){if(z!==null&&pd(C)){var K=z.start,te=z.end;if(te===void 0&&(te=K),"selectionStart"in C)C.selectionStart=K,C.selectionEnd=Math.min(te,C.value.length);else{var ue=C.ownerDocument||document,Q=ue&&ue.defaultView||window;if(Q.getSelection){var W=Q.getSelection(),we=C.textContent.length,Le=Math.min(z.start,we),gt=z.end===void 0?Le:Math.min(z.end,we);!W.extend&&Le>gt&&(S=gt,gt=Le,Le=S);var V=Vp(C,Le),U=Vp(C,gt);if(V&&U&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==U.node||W.focusOffset!==U.offset)){var Y=ue.createRange();Y.setStart(V.node,V.offset),W.removeAllRanges(),Le>gt?(W.addRange(Y),W.extend(U.node,U.offset)):(Y.setEnd(U.node,U.offset),W.addRange(Y))}}}}for(ue=[],W=C;W=W.parentNode;)W.nodeType===1&&ue.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<ue.length;C++){var oe=ue[C];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Tc=!!Vf,qf=Vf=null}finally{ot=p,G.p=c,A.T=o}}n.current=r,nn=2}}function oy(){if(nn===2){nn=0;var n=$r,r=ui,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=A.T,A.T=null;var c=G.p;G.p=2;var p=ot;ot|=4;try{Mx(n,r.alternate,r)}finally{ot=p,G.p=c,A.T=o}}nn=3}}function ly(){if(nn===4||nn===3){nn=0,Rn();var n=$r,r=ui,o=mr,c=Kx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?nn=5:(nn=0,ui=$r=null,cy(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Ur=null),Z(o),r=r.stateNode,Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(mn,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=A.T,p=G.p,G.p=2,A.T=null;try{for(var g=n.onRecoverableError,S=0;S<c.length;S++){var C=c[S];g(C.value,{componentStack:C.stack})}}finally{A.T=r,G.p=p}}(mr&3)!==0&&yc(),Ia(n),p=n.pendingLanes,(o&261930)!==0&&(p&42)!==0?n===Af?xo++:(xo=0,Af=n):xo=0,yo(0)}}function cy(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Zi(r)))}function yc(){return iy(),oy(),ly(),uy()}function uy(){if(nn!==5)return!1;var n=$r,r=Rf;Rf=0;var o=Z(mr),c=A.T,p=G.p;try{G.p=32>o?32:o,A.T=null,o=Tf,Tf=null;var g=$r,S=mr;if(nn=0,ui=$r=null,mr=0,(ot&6)!==0)throw Error(s(331));var C=ot;if(ot|=4,qx(g.current),Px(g,g.current,S,o),ot=C,yo(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(mn,g)}catch{}return!0}finally{G.p=p,A.T=c,cy(n,r)}}function dy(n,r,o){r=fa(o,r),r=cf(n.stateNode,r,2),n=Ar(n,r,2),n!==null&&(Pe(n,2),Ia(n))}function ht(n,r,o){if(n.tag===3)dy(n,n,o);else for(;r!==null;){if(r.tag===3){dy(r,n,o);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ur===null||!Ur.has(c))){n=fa(o,n),o=fx(2),c=Ar(r,o,2),c!==null&&(hx(o,c,r,n),Pe(c,2),Ia(c));break}}r=r.return}}function Df(n,r,o){var c=n.pingCache;if(c===null){c=n.pingCache=new Ww;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(o)||(Ef=!0,p.add(o),n=r4.bind(null,n,r,o),r.then(n,n))}function r4(n,r,o){var c=n.pingCache;c!==null&&c.delete(r),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,yt===n&&(Je&o)===o&&(zt===4||zt===3&&(Je&62914560)===Je&&300>jt()-fc?(ot&2)===0&&di(n,0):Cf|=o,ci===Je&&(ci=0)),Ia(n)}function fy(n,r){r===0&&(r=Be()),n=ls(n,r),n!==null&&(Pe(n,r),Ia(n))}function s4(n){var r=n.memoizedState,o=0;r!==null&&(o=r.retryLane),fy(n,o)}function i4(n,r){var o=0;switch(n.tag){case 31:case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(o=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(s(314))}c!==null&&c.delete(r),fy(n,o)}function o4(n,r){return bn(n,r)}var vc=null,hi=null,Mf=!1,bc=!1,zf=!1,Br=0;function Ia(n){n!==hi&&n.next===null&&(hi===null?vc=hi=n:hi=hi.next=n),bc=!0,Mf||(Mf=!0,c4())}function yo(n,r){if(!zf&&bc){zf=!0;do for(var o=!1,c=vc;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var g=0;else{var S=c.suspendedLanes,C=c.pingedLanes;g=(1<<31-Ft(42|n)+1)-1,g&=p&~(S&~C),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,gy(c,g))}else g=Je,g=en(c,c===yt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||se(c,g)||(o=!0,gy(c,g));c=c.next}while(o);zf=!1}}function l4(){hy()}function hy(){bc=Mf=!1;var n=0;Br!==0&&v4()&&(n=Br);for(var r=jt(),o=null,c=vc;c!==null;){var p=c.next,g=my(c,r);g===0?(c.next=null,o===null?vc=p:o.next=p,p===null&&(hi=o)):(o=c,(n!==0||(g&3)!==0)&&(bc=!0)),c=p}nn!==0&&nn!==5||yo(n),Br!==0&&(Br=0)}function my(n,r){for(var o=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var S=31-Ft(g),C=1<<S,z=p[S];z===-1?((C&o)===0||(C&c)!==0)&&(p[S]=be(C,r)):z<=r&&(n.expiredLanes|=C),g&=~C}if(r=yt,o=Je,o=en(n,n===r?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,o===0||n===r&&(ft===2||ft===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&ia(c),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||se(n,o)){if(r=o&-o,r===n.callbackPriority)return r;switch(c!==null&&ia(c),Z(o)){case 2:case 8:o=$e;break;case 32:o=Xe;break;case 268435456:o=Tt;break;default:o=Xe}return c=py.bind(null,n),o=bn(o,c),n.callbackPriority=r,n.callbackNode=o,r}return c!==null&&c!==null&&ia(c),n.callbackPriority=2,n.callbackNode=null,2}function py(n,r){if(nn!==0&&nn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(yc()&&n.callbackNode!==o)return null;var c=Je;return c=en(n,n===yt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(Qx(n,c,r),my(n,jt()),n.callbackNode!=null&&n.callbackNode===o?py.bind(null,n):null)}function gy(n,r){if(yc())return null;Qx(n,r,!0)}function c4(){_4(function(){(ot&6)!==0?bn(Ne,l4):hy()})}function Uf(){if(Br===0){var n=Js;n===0&&(n=tt,tt<<=1,(tt&261888)===0&&(tt=256)),Br=n}return Br}function xy(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:kl(""+n)}function yy(n,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,n.id&&o.setAttribute("form",n.id),r.parentNode.insertBefore(o,r),n=new FormData(n),o.parentNode.removeChild(o),n}function u4(n,r,o,c,p){if(r==="submit"&&o&&o.stateNode===p){var g=xy((p[ve]||null).action),S=c.submitter;S&&(r=(r=S[ve]||null)?xy(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var C=new Ll("action","action",null,c,p);n.push({event:C,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Br!==0){var z=S?yy(p,S):new FormData(p);nf(o,{pending:!0,data:z,method:p.method,action:g},null,z)}}else typeof g=="function"&&(C.preventDefault(),z=S?yy(p,S):new FormData(p),nf(o,{pending:!0,data:z,method:p.method,action:g},g,z))},currentTarget:p}]})}}for(var $f=0;$f<vd.length;$f++){var Hf=vd[$f],d4=Hf.toLowerCase(),f4=Hf[0].toUpperCase()+Hf.slice(1);Ra(d4,"on"+f4)}Ra(Xp,"onAnimationEnd"),Ra(Qp,"onAnimationIteration"),Ra(Zp,"onAnimationStart"),Ra("dblclick","onDoubleClick"),Ra("focusin","onFocus"),Ra("focusout","onBlur"),Ra(kw,"onTransitionRun"),Ra(Rw,"onTransitionStart"),Ra(Tw,"onTransitionCancel"),Ra(Jp,"onTransitionEnd"),za("onMouseEnter",["mouseout","mouseover"]),za("onMouseLeave",["mouseout","mouseover"]),za("onPointerEnter",["pointerout","pointerover"]),za("onPointerLeave",["pointerout","pointerover"]),cn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cn("onBeforeInput",["compositionend","keypress","textInput","paste"]),cn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),h4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function vy(n,r){r=(r&4)!==0;for(var o=0;o<n.length;o++){var c=n[o],p=c.event;c=c.listeners;e:{var g=void 0;if(r)for(var S=c.length-1;0<=S;S--){var C=c[S],z=C.instance,K=C.currentTarget;if(C=C.listener,z!==g&&p.isPropagationStopped())break e;g=C,p.currentTarget=K;try{g(p)}catch(te){Ml(te)}p.currentTarget=null,g=z}else for(S=0;S<c.length;S++){if(C=c[S],z=C.instance,K=C.currentTarget,C=C.listener,z!==g&&p.isPropagationStopped())break e;g=C,p.currentTarget=K;try{g(p)}catch(te){Ml(te)}p.currentTarget=null,g=z}}}}function Ze(n,r){var o=r[ke];o===void 0&&(o=r[ke]=new Set);var c=n+"__bubble";o.has(c)||(by(r,n,2,!1),o.add(c))}function Bf(n,r,o){var c=0;r&&(c|=4),by(o,n,c,r)}var _c="_reactListening"+Math.random().toString(36).slice(2);function If(n){if(!n[_c]){n[_c]=!0,wr.forEach(function(o){o!=="selectionchange"&&(h4.has(o)||Bf(o,!1,n),Bf(o,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[_c]||(r[_c]=!0,Bf("selectionchange",!1,r))}}function by(n,r,o,c){switch(Xy(r)){case 2:var p=I4;break;case 8:p=P4;break;default:p=nh}o=p.bind(null,r,o,n),p=void 0,!id||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?n.addEventListener(r,o,{capture:!0,passive:p}):n.addEventListener(r,o,!0):p!==void 0?n.addEventListener(r,o,{passive:p}):n.addEventListener(r,o,!1)}function Pf(n,r,o,c,p){var g=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var C=c.stateNode.containerInfo;if(C===p)break;if(S===4)for(S=c.return;S!==null;){var z=S.tag;if((z===3||z===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;C!==null;){if(S=Et(C),S===null)return;if(z=S.tag,z===5||z===6||z===26||z===27){c=g=S;continue e}C=C.parentNode}}c=c.return}jp(function(){var K=g,te=rd(o),ue=[];e:{var Q=Wp.get(n);if(Q!==void 0){var W=Ll,we=n;switch(n){case"keypress":if(Tl(o)===0)break e;case"keydown":case"keyup":W=iw;break;case"focusin":we="focus",W=ud;break;case"focusout":we="blur",W=ud;break;case"beforeblur":case"afterblur":W=ud;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=kp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=KS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=cw;break;case Xp:case Qp:case Zp:W=ZS;break;case Jp:W=dw;break;case"scroll":case"scrollend":W=FS;break;case"wheel":W=hw;break;case"copy":case"cut":case"paste":W=WS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=Tp;break;case"toggle":case"beforetoggle":W=pw}var Le=(r&4)!==0,gt=!Le&&(n==="scroll"||n==="scrollend"),V=Le?Q!==null?Q+"Capture":null:Q;Le=[];for(var U=K,Y;U!==null;){var oe=U;if(Y=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Y===null||V===null||(oe=Bi(U,V),oe!=null&&Le.push(bo(U,oe,Y))),gt)break;U=U.return}0<Le.length&&(Q=new W(Q,we,null,o,te),ue.push({event:Q,listeners:Le}))}}if((r&7)===0){e:{if(Q=n==="mouseover"||n==="pointerover",W=n==="mouseout"||n==="pointerout",Q&&o!==ad&&(we=o.relatedTarget||o.fromElement)&&(Et(we)||we[_e]))break e;if((W||Q)&&(Q=te.window===te?te:(Q=te.ownerDocument)?Q.defaultView||Q.parentWindow:window,W?(we=o.relatedTarget||o.toElement,W=K,we=we?Et(we):null,we!==null&&(gt=l(we),Le=we.tag,we!==gt||Le!==5&&Le!==27&&Le!==6)&&(we=null)):(W=null,we=K),W!==we)){if(Le=kp,oe="onMouseLeave",V="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Le=Tp,oe="onPointerLeave",V="onPointerEnter",U="pointer"),gt=W==null?Q:nt(W),Y=we==null?Q:nt(we),Q=new Le(oe,U+"leave",W,o,te),Q.target=gt,Q.relatedTarget=Y,oe=null,Et(te)===K&&(Le=new Le(V,U+"enter",we,o,te),Le.target=Y,Le.relatedTarget=gt,oe=Le),gt=oe,W&&we)t:{for(Le=m4,V=W,U=we,Y=0,oe=V;oe;oe=Le(oe))Y++;oe=0;for(var Re=U;Re;Re=Le(Re))oe++;for(;0<Y-oe;)V=Le(V),Y--;for(;0<oe-Y;)U=Le(U),oe--;for(;Y--;){if(V===U||U!==null&&V===U.alternate){Le=V;break t}V=Le(V),U=Le(U)}Le=null}else Le=null;W!==null&&_y(ue,Q,W,Le,!1),we!==null&&gt!==null&&_y(ue,gt,we,Le,!0)}}e:{if(Q=K?nt(K):window,W=Q.nodeName&&Q.nodeName.toLowerCase(),W==="select"||W==="input"&&Q.type==="file")var st=$p;else if(zp(Q))if(Hp)st=jw;else{st=ww;var je=Sw}else W=Q.nodeName,!W||W.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?K&&nd(K.elementType)&&(st=$p):st=Nw;if(st&&(st=st(n,K))){Up(ue,st,o,te);break e}je&&je(n,Q,K),n==="focusout"&&K&&Q.type==="number"&&K.memoizedProps.value!=null&&td(Q,"number",Q.value)}switch(je=K?nt(K):window,n){case"focusin":(zp(je)||je.contentEditable==="true")&&(Vs=je,gd=K,Ki=null);break;case"focusout":Ki=gd=Vs=null;break;case"mousedown":xd=!0;break;case"contextmenu":case"mouseup":case"dragend":xd=!1,Yp(ue,o,te);break;case"selectionchange":if(Cw)break;case"keydown":case"keyup":Yp(ue,o,te)}var Ge;if(fd)e:{switch(n){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Gs?Dp(n,o)&&(We="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(We="onCompositionStart");We&&(Ap&&o.locale!=="ko"&&(Gs||We!=="onCompositionStart"?We==="onCompositionEnd"&&Gs&&(Ge=Ep()):(Nr=te,od="value"in Nr?Nr.value:Nr.textContent,Gs=!0)),je=Sc(K,We),0<je.length&&(We=new Rp(We,n,null,o,te),ue.push({event:We,listeners:je}),Ge?We.data=Ge:(Ge=Mp(o),Ge!==null&&(We.data=Ge)))),(Ge=xw?yw(n,o):vw(n,o))&&(We=Sc(K,"onBeforeInput"),0<We.length&&(je=new Rp("onBeforeInput","beforeinput",null,o,te),ue.push({event:je,listeners:We}),je.data=Ge)),u4(ue,n,K,o,te)}vy(ue,r)})}function bo(n,r,o){return{instance:n,listener:r,currentTarget:o}}function Sc(n,r){for(var o=r+"Capture",c=[];n!==null;){var p=n,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=Bi(n,o),p!=null&&c.unshift(bo(n,p,g)),p=Bi(n,r),p!=null&&c.push(bo(n,p,g))),n.tag===3)return c;n=n.return}return[]}function m4(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function _y(n,r,o,c,p){for(var g=r._reactName,S=[];o!==null&&o!==c;){var C=o,z=C.alternate,K=C.stateNode;if(C=C.tag,z!==null&&z===c)break;C!==5&&C!==26&&C!==27||K===null||(z=K,p?(K=Bi(o,g),K!=null&&S.unshift(bo(o,K,z))):p||(K=Bi(o,g),K!=null&&S.push(bo(o,K,z)))),o=o.return}S.length!==0&&n.push({event:r,listeners:S})}var p4=/\r\n?/g,g4=/\u0000|\uFFFD/g;function Sy(n){return(typeof n=="string"?n:""+n).replace(p4,`
10
+ `).replace(g4,"")}function wy(n,r){return r=Sy(r),Sy(n)===r}function pt(n,r,o,c,p,g){switch(o){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||Bs(n,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&Bs(n,""+c);break;case"className":It(n,"class",c);break;case"tabIndex":It(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":It(n,o,c);break;case"style":wp(n,c,g);break;case"data":if(r!=="object"){It(n,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||o!=="href")){n.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}c=kl(""+c),n.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(o,"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 g=="function"&&(o==="formAction"?(r!=="input"&&pt(n,r,"name",p.name,p,null),pt(n,r,"formEncType",p.formEncType,p,null),pt(n,r,"formMethod",p.formMethod,p,null),pt(n,r,"formTarget",p.formTarget,p,null)):(pt(n,r,"encType",p.encType,p,null),pt(n,r,"method",p.method,p,null),pt(n,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}c=kl(""+c),n.setAttribute(o,c);break;case"onClick":c!=null&&(n.onclick=Wa);break;case"onScroll":c!=null&&Ze("scroll",n);break;case"onScrollEnd":c!=null&&Ze("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=o}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}o=kl(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""+c):n.removeAttribute(o);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":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":c===!0?n.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,c):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(o,c):n.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(o):n.setAttribute(o,c);break;case"popover":Ze("beforetoggle",n),Ze("toggle",n),Ke(n,"popover",c);break;case"xlinkActuate":Sn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Sn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Sn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Sn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Sn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Sn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Sn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Sn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Sn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Ke(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=VS.get(o)||o,Ke(n,o,c))}}function Gf(n,r,o,c,p,g){switch(o){case"style":wp(n,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=o}}break;case"children":typeof c=="string"?Bs(n,c):(typeof c=="number"||typeof c=="bigint")&&Bs(n,""+c);break;case"onScroll":c!=null&&Ze("scroll",n);break;case"onScrollEnd":c!=null&&Ze("scrollend",n);break;case"onClick":c!=null&&(n.onclick=Wa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ka.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),r=o.slice(2,p?o.length-7:void 0),g=n[ve]||null,g=g!=null?g[o]:null,typeof g=="function"&&n.removeEventListener(r,g,p),typeof c=="function")){typeof g!="function"&&g!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(r,c,p);break e}o in n?n[o]=c:c===!0?n.setAttribute(o,""):Ke(n,o,c)}}}function yn(n,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",n),Ze("load",n);var c=!1,p=!1,g;for(g in o)if(o.hasOwnProperty(g)){var S=o[g];if(S!=null)switch(g){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:pt(n,r,g,S,o,null)}}p&&pt(n,r,"srcSet",o.srcSet,o,null),c&&pt(n,r,"src",o.src,o,null);return;case"input":Ze("invalid",n);var C=g=S=p=null,z=null,K=null;for(c in o)if(o.hasOwnProperty(c)){var te=o[c];if(te!=null)switch(c){case"name":p=te;break;case"type":S=te;break;case"checked":z=te;break;case"defaultChecked":K=te;break;case"value":g=te;break;case"defaultValue":C=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,r));break;default:pt(n,r,c,te,o,null)}}vp(n,g,C,z,K,S,p,!1);return;case"select":Ze("invalid",n),c=S=g=null;for(p in o)if(o.hasOwnProperty(p)&&(C=o[p],C!=null))switch(p){case"value":g=C;break;case"defaultValue":S=C;break;case"multiple":c=C;default:pt(n,r,p,C,o,null)}r=g,o=S,n.multiple=!!c,r!=null?Hs(n,!!c,r,!1):o!=null&&Hs(n,!!c,o,!0);return;case"textarea":Ze("invalid",n),g=p=c=null;for(S in o)if(o.hasOwnProperty(S)&&(C=o[S],C!=null))switch(S){case"value":c=C;break;case"defaultValue":p=C;break;case"children":g=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:pt(n,r,S,C,o,null)}_p(n,c,p,g);return;case"option":for(z in o)o.hasOwnProperty(z)&&(c=o[z],c!=null)&&(z==="selected"?n.selected=c&&typeof c!="function"&&typeof c!="symbol":pt(n,r,z,c,o,null));return;case"dialog":Ze("beforetoggle",n),Ze("toggle",n),Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":Ze("load",n);break;case"video":case"audio":for(c=0;c<vo.length;c++)Ze(vo[c],n);break;case"image":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"embed":case"source":case"link":Ze("error",n),Ze("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in o)if(o.hasOwnProperty(K)&&(c=o[K],c!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:pt(n,r,K,c,o,null)}return;default:if(nd(r)){for(te in o)o.hasOwnProperty(te)&&(c=o[te],c!==void 0&&Gf(n,r,te,c,o,void 0));return}}for(C in o)o.hasOwnProperty(C)&&(c=o[C],c!=null&&pt(n,r,C,c,o,null))}function x4(n,r,o,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,S=null,C=null,z=null,K=null,te=null;for(W in o){var ue=o[W];if(o.hasOwnProperty(W)&&ue!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":z=ue;default:c.hasOwnProperty(W)||pt(n,r,W,null,c,ue)}}for(var Q in c){var W=c[Q];if(ue=o[Q],c.hasOwnProperty(Q)&&(W!=null||ue!=null))switch(Q){case"type":g=W;break;case"name":p=W;break;case"checked":K=W;break;case"defaultChecked":te=W;break;case"value":S=W;break;case"defaultValue":C=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(s(137,r));break;default:W!==ue&&pt(n,r,Q,W,c,ue)}}ed(n,S,C,z,K,te,g,p);return;case"select":W=S=C=Q=null;for(g in o)if(z=o[g],o.hasOwnProperty(g)&&z!=null)switch(g){case"value":break;case"multiple":W=z;default:c.hasOwnProperty(g)||pt(n,r,g,null,c,z)}for(p in c)if(g=c[p],z=o[p],c.hasOwnProperty(p)&&(g!=null||z!=null))switch(p){case"value":Q=g;break;case"defaultValue":C=g;break;case"multiple":S=g;default:g!==z&&pt(n,r,p,g,c,z)}r=C,o=S,c=W,Q!=null?Hs(n,!!o,Q,!1):!!c!=!!o&&(r!=null?Hs(n,!!o,r,!0):Hs(n,!!o,o?[]:"",!1));return;case"textarea":W=Q=null;for(C in o)if(p=o[C],o.hasOwnProperty(C)&&p!=null&&!c.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:pt(n,r,C,null,c,p)}for(S in c)if(p=c[S],g=o[S],c.hasOwnProperty(S)&&(p!=null||g!=null))switch(S){case"value":Q=p;break;case"defaultValue":W=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(s(91));break;default:p!==g&&pt(n,r,S,p,c,g)}bp(n,Q,W);return;case"option":for(var we in o)Q=o[we],o.hasOwnProperty(we)&&Q!=null&&!c.hasOwnProperty(we)&&(we==="selected"?n.selected=!1:pt(n,r,we,null,c,Q));for(z in c)Q=c[z],W=o[z],c.hasOwnProperty(z)&&Q!==W&&(Q!=null||W!=null)&&(z==="selected"?n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":pt(n,r,z,Q,c,W));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 Le in o)Q=o[Le],o.hasOwnProperty(Le)&&Q!=null&&!c.hasOwnProperty(Le)&&pt(n,r,Le,null,c,Q);for(K in c)if(Q=c[K],W=o[K],c.hasOwnProperty(K)&&Q!==W&&(Q!=null||W!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(137,r));break;default:pt(n,r,K,Q,c,W)}return;default:if(nd(r)){for(var gt in o)Q=o[gt],o.hasOwnProperty(gt)&&Q!==void 0&&!c.hasOwnProperty(gt)&&Gf(n,r,gt,void 0,c,Q);for(te in c)Q=c[te],W=o[te],!c.hasOwnProperty(te)||Q===W||Q===void 0&&W===void 0||Gf(n,r,te,Q,c,W);return}}for(var V in o)Q=o[V],o.hasOwnProperty(V)&&Q!=null&&!c.hasOwnProperty(V)&&pt(n,r,V,null,c,Q);for(ue in c)Q=c[ue],W=o[ue],!c.hasOwnProperty(ue)||Q===W||Q==null&&W==null||pt(n,r,ue,Q,c,W)}function Ny(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function y4(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var p=o[c],g=p.transferSize,S=p.initiatorType,C=p.duration;if(g&&C&&Ny(S)){for(S=0,C=p.responseEnd,c+=1;c<o.length;c++){var z=o[c],K=z.startTime;if(K>C)break;var te=z.transferSize,ue=z.initiatorType;te&&Ny(ue)&&(z=z.responseEnd,S+=te*(z<C?1:(C-K)/(z-K)))}if(--c,r+=8*(g+S)/(p.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Vf=null,qf=null;function wc(n){return n.nodeType===9?n:n.ownerDocument}function jy(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ey(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function Ff(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Yf=null;function v4(){var n=window.event;return n&&n.type==="popstate"?n===Yf?!1:(Yf=n,!0):(Yf=null,!1)}var Cy=typeof setTimeout=="function"?setTimeout:void 0,b4=typeof clearTimeout=="function"?clearTimeout:void 0,ky=typeof Promise=="function"?Promise:void 0,_4=typeof queueMicrotask=="function"?queueMicrotask:typeof ky<"u"?function(n){return ky.resolve(null).then(n).catch(S4)}:Cy;function S4(n){setTimeout(function(){throw n})}function Ir(n){return n==="head"}function Ry(n,r){var o=r,c=0;do{var p=o.nextSibling;if(n.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(c===0){n.removeChild(p),xi(r);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")_o(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,_o(o);for(var g=o.firstChild;g;){var S=g.nextSibling,C=g.nodeName;g[Ye]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=S}}else o==="body"&&_o(n.ownerDocument.body);o=p}while(o);xi(r)}function Ty(n,r){var o=n;n=0;do{var c=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=c}while(o)}function Kf(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Kf(o),xt(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function w4(n,r,o,c){for(;n.nodeType===1;){var p=o;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[Ye])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=xa(n.nextSibling),n===null)break}return null}function N4(n,r,o){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=xa(n.nextSibling),n===null))return null;return n}function Ay(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=xa(n.nextSibling),n===null))return null;return n}function Xf(n){return n.data==="$?"||n.data==="$~"}function Qf(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function j4(n,r){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||o.readyState!=="loading")r();else{var c=function(){r(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function xa(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Zf=null;function Ly(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(r===0)return xa(n.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}n=n.nextSibling}return null}function Oy(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return n;r--}else o!=="/$"&&o!=="/&"||r++}n=n.previousSibling}return null}function Dy(n,r,o){switch(r=wc(o),n){case"html":if(n=r.documentElement,!n)throw Error(s(452));return n;case"head":if(n=r.head,!n)throw Error(s(453));return n;case"body":if(n=r.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function _o(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);xt(n)}var ya=new Map,My=new Set;function Nc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var pr=G.d;G.d={f:E4,r:C4,D:k4,C:R4,L:T4,m:A4,X:O4,S:L4,M:D4};function E4(){var n=pr.f(),r=pc();return n||r}function C4(n){var r=Dt(n);r!==null&&r.tag===5&&r.type==="form"?Jg(r):pr.r(n)}var mi=typeof document>"u"?null:document;function zy(n,r,o){var c=mi;if(c&&typeof r=="string"&&r){var p=ua(r);p='link[rel="'+n+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),My.has(p)||(My.add(p),n={rel:n,crossOrigin:o,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),yn(r,"link",n),_t(r),c.head.appendChild(r)))}}function k4(n){pr.D(n),zy("dns-prefetch",n,null)}function R4(n,r){pr.C(n,r),zy("preconnect",n,r)}function T4(n,r,o){pr.L(n,r,o);var c=mi;if(c&&n&&r){var p='link[rel="preload"][as="'+ua(r)+'"]';r==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+ua(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+ua(o.imageSizes)+'"]')):p+='[href="'+ua(n)+'"]';var g=p;switch(r){case"style":g=pi(n);break;case"script":g=gi(n)}ya.has(g)||(n=y({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:n,as:r},o),ya.set(g,n),c.querySelector(p)!==null||r==="style"&&c.querySelector(So(g))||r==="script"&&c.querySelector(wo(g))||(r=c.createElement("link"),yn(r,"link",n),_t(r),c.head.appendChild(r)))}}function A4(n,r){pr.m(n,r);var o=mi;if(o&&n){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+ua(c)+'"][href="'+ua(n)+'"]',g=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=gi(n)}if(!ya.has(g)&&(n=y({rel:"modulepreload",href:n},r),ya.set(g,n),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(wo(g)))return}c=o.createElement("link"),yn(c,"link",n),_t(c),o.head.appendChild(c)}}}function L4(n,r,o){pr.S(n,r,o);var c=mi;if(c&&n){var p=tn(c).hoistableStyles,g=pi(n);r=r||"default";var S=p.get(g);if(!S){var C={loading:0,preload:null};if(S=c.querySelector(So(g)))C.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":r},o),(o=ya.get(g))&&Jf(n,o);var z=S=c.createElement("link");_t(z),yn(z,"link",n),z._p=new Promise(function(K,te){z.onload=K,z.onerror=te}),z.addEventListener("load",function(){C.loading|=1}),z.addEventListener("error",function(){C.loading|=2}),C.loading|=4,jc(S,r,c)}S={type:"stylesheet",instance:S,count:1,state:C},p.set(g,S)}}}function O4(n,r){pr.X(n,r);var o=mi;if(o&&n){var c=tn(o).hoistableScripts,p=gi(n),g=c.get(p);g||(g=o.querySelector(wo(p)),g||(n=y({src:n,async:!0},r),(r=ya.get(p))&&Wf(n,r),g=o.createElement("script"),_t(g),yn(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function D4(n,r){pr.M(n,r);var o=mi;if(o&&n){var c=tn(o).hoistableScripts,p=gi(n),g=c.get(p);g||(g=o.querySelector(wo(p)),g||(n=y({src:n,async:!0,type:"module"},r),(r=ya.get(p))&&Wf(n,r),g=o.createElement("script"),_t(g),yn(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function Uy(n,r,o,c){var p=(p=xe.current)?Nc(p):null;if(!p)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=pi(o.href),o=tn(p).hoistableStyles,c=o.get(r),c||(c={type:"style",instance:null,count:0,state:null},o.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=pi(o.href);var g=tn(p).hoistableStyles,S=g.get(n);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,S),(g=p.querySelector(So(n)))&&!g._p&&(S.instance=g,S.state.loading=5),ya.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},ya.set(n,o),g||M4(p,n,o,S.state))),r&&c===null)throw Error(s(528,""));return S}if(r&&c!==null)throw Error(s(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=gi(o),o=tn(p).hoistableScripts,c=o.get(r),c||(c={type:"script",instance:null,count:0,state:null},o.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function pi(n){return'href="'+ua(n)+'"'}function So(n){return'link[rel="stylesheet"]['+n+"]"}function $y(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function M4(n,r,o,c){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=n.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),yn(r,"link",o),_t(r),n.head.appendChild(r))}function gi(n){return'[src="'+ua(n)+'"]'}function wo(n){return"script[async]"+n}function Hy(n,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var c=n.querySelector('style[data-href~="'+ua(o.href)+'"]');if(c)return r.instance=c,_t(c),c;var p=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),_t(c),yn(c,"style",p),jc(c,o.precedence,n),r.instance=c;case"stylesheet":p=pi(o.href);var g=n.querySelector(So(p));if(g)return r.state.loading|=4,r.instance=g,_t(g),g;c=$y(o),(p=ya.get(p))&&Jf(c,p),g=(n.ownerDocument||n).createElement("link"),_t(g);var S=g;return S._p=new Promise(function(C,z){S.onload=C,S.onerror=z}),yn(g,"link",c),r.state.loading|=4,jc(g,o.precedence,n),r.instance=g;case"script":return g=gi(o.src),(p=n.querySelector(wo(g)))?(r.instance=p,_t(p),p):(c=o,(p=ya.get(g))&&(c=y({},o),Wf(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),_t(p),yn(p,"link",c),n.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,jc(c,o.precedence,n));return r.instance}function jc(n,r,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,g=p,S=0;S<c.length;S++){var C=c[S];if(C.dataset.precedence===r)g=C;else if(g!==p)break}g?g.parentNode.insertBefore(n,g.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(n,r.firstChild))}function Jf(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Wf(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var Ec=null;function By(n,r,o){if(Ec===null){var c=new Map,p=Ec=new Map;p.set(o,c)}else p=Ec,c=p.get(o),c||(c=new Map,p.set(o,c));if(c.has(n))return c;for(c.set(n,null),o=o.getElementsByTagName(n),p=0;p<o.length;p++){var g=o[p];if(!(g[Ye]||g[pe]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=n+S;var C=c.get(S);C?C.push(g):c.set(S,[g])}}return c}function Iy(n,r,o){n=n.ownerDocument||n,n.head.insertBefore(o,r==="title"?n.querySelector("head > title"):null)}function z4(n,r,o){if(o===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(n=r.disabled,typeof r.precedence=="string"&&n==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Py(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function U4(n,r,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=pi(c.href),g=r.querySelector(So(p));if(g){r=g._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=Cc.bind(n),r.then(n,n)),o.state.loading|=4,o.instance=g,_t(g);return}g=r.ownerDocument||r,c=$y(c),(p=ya.get(p))&&Jf(c,p),g=g.createElement("link"),_t(g);var S=g;S._p=new Promise(function(C,z){S.onload=C,S.onerror=z}),yn(g,"link",c),o.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=Cc.bind(n),r.addEventListener("load",o),r.addEventListener("error",o))}}var eh=0;function $4(n,r){return n.stylesheets&&n.count===0&&Rc(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var c=setTimeout(function(){if(n.stylesheets&&Rc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+r);0<n.imgBytes&&eh===0&&(eh=62500*y4());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Rc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>eh?50:800)+r);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Cc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var kc=null;function Rc(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,kc=new Map,r.forEach(H4,n),kc=null,Cc.call(n))}function H4(n,r){if(!(r.state.loading&4)){var o=kc.get(n);if(o)var c=o.get(null);else{o=new Map,kc.set(n,o);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var S=p[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),c=S)}c&&o.set(null,c)}p=r.instance,S=p.getAttribute("data-precedence"),g=o.get(S)||c,g===c&&o.set(null,p),o.set(S,p),this.count++,c=Cc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),g?g.parentNode.insertBefore(p,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),r.state.loading|=4}}var No={$$typeof:k,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function B4(n,r,o,c,p,g,S,C,z){this.tag=1,this.containerInfo=n,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=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Gy(n,r,o,c,p,g,S,C,z,K,te,ue){return n=new B4(n,r,o,S,z,K,te,ue,C),r=1,g===!0&&(r|=24),g=Xn(3,null,null,r),n.current=g,g.stateNode=n,r=Ld(),r.refCount++,n.pooledCache=r,r.refCount++,g.memoizedState={element:c,isDehydrated:o,cache:r},zd(g),n}function Vy(n){return n?(n=Ys,n):Ys}function qy(n,r,o,c,p,g){p=Vy(p),c.context===null?c.context=p:c.pendingContext=p,c=Tr(r),c.payload={element:o},g=g===void 0?null:g,g!==null&&(c.callback=g),o=Ar(n,c,r),o!==null&&(Gn(o,n,r),to(o,n,r))}function Fy(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<r?o:r}}function th(n,r){Fy(n,r),(n=n.alternate)&&Fy(n,r)}function Yy(n){if(n.tag===13||n.tag===31){var r=ls(n,67108864);r!==null&&Gn(r,n,67108864),th(n,67108864)}}function Ky(n){if(n.tag===13||n.tag===31){var r=ea();r=$(r);var o=ls(n,r);o!==null&&Gn(o,n,r),th(n,r)}}var Tc=!0;function I4(n,r,o,c){var p=A.T;A.T=null;var g=G.p;try{G.p=2,nh(n,r,o,c)}finally{G.p=g,A.T=p}}function P4(n,r,o,c){var p=A.T;A.T=null;var g=G.p;try{G.p=8,nh(n,r,o,c)}finally{G.p=g,A.T=p}}function nh(n,r,o,c){if(Tc){var p=ah(c);if(p===null)Pf(n,r,c,Ac,o),Qy(n,c);else if(V4(p,n,r,o,c))c.stopPropagation();else if(Qy(n,c),r&4&&-1<G4.indexOf(n)){for(;p!==null;){var g=Dt(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Bt(g.pendingLanes);if(S!==0){var C=g;for(C.pendingLanes|=2,C.entangledLanes|=2;S;){var z=1<<31-Ft(S);C.entanglements[1]|=z,S&=~z}Ia(g),(ot&6)===0&&(hc=jt()+500,yo(0))}}break;case 31:case 13:C=ls(g,2),C!==null&&Gn(C,g,2),pc(),th(g,2)}if(g=ah(c),g===null&&Pf(n,r,c,Ac,o),g===p)break;p=g}p!==null&&c.stopPropagation()}else Pf(n,r,c,null,o)}}function ah(n){return n=rd(n),rh(n)}var Ac=null;function rh(n){if(Ac=null,n=Et(n),n!==null){var r=l(n);if(r===null)n=null;else{var o=r.tag;if(o===13){if(n=u(r),n!==null)return n;n=null}else if(o===31){if(n=f(r),n!==null)return n;n=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return Ac=n,null}function Xy(n){switch(n){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(_n()){case Ne:return 2;case $e:return 8;case Xe:case vt:return 32;case Tt:return 268435456;default:return 32}default:return 32}}var sh=!1,Pr=null,Gr=null,Vr=null,jo=new Map,Eo=new Map,qr=[],G4="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 Qy(n,r){switch(n){case"focusin":case"focusout":Pr=null;break;case"dragenter":case"dragleave":Gr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":jo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eo.delete(r.pointerId)}}function Co(n,r,o,c,p,g){return n===null||n.nativeEvent!==g?(n={blockedOn:r,domEventName:o,eventSystemFlags:c,nativeEvent:g,targetContainers:[p]},r!==null&&(r=Dt(r),r!==null&&Yy(r)),n):(n.eventSystemFlags|=c,r=n.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),n)}function V4(n,r,o,c,p){switch(r){case"focusin":return Pr=Co(Pr,n,r,o,c,p),!0;case"dragenter":return Gr=Co(Gr,n,r,o,c,p),!0;case"mouseover":return Vr=Co(Vr,n,r,o,c,p),!0;case"pointerover":var g=p.pointerId;return jo.set(g,Co(jo.get(g)||null,n,r,o,c,p)),!0;case"gotpointercapture":return g=p.pointerId,Eo.set(g,Co(Eo.get(g)||null,n,r,o,c,p)),!0}return!1}function Zy(n){var r=Et(n.target);if(r!==null){var o=l(r);if(o!==null){if(r=o.tag,r===13){if(r=u(o),r!==null){n.blockedOn=r,he(n.priority,function(){Ky(o)});return}}else if(r===31){if(r=f(o),r!==null){n.blockedOn=r,he(n.priority,function(){Ky(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Lc(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var o=ah(n.nativeEvent);if(o===null){o=n.nativeEvent;var c=new o.constructor(o.type,o);ad=c,o.target.dispatchEvent(c),ad=null}else return r=Dt(o),r!==null&&Yy(r),n.blockedOn=o,!1;r.shift()}return!0}function Jy(n,r,o){Lc(n)&&o.delete(r)}function q4(){sh=!1,Pr!==null&&Lc(Pr)&&(Pr=null),Gr!==null&&Lc(Gr)&&(Gr=null),Vr!==null&&Lc(Vr)&&(Vr=null),jo.forEach(Jy),Eo.forEach(Jy)}function Oc(n,r){n.blockedOn===r&&(n.blockedOn=null,sh||(sh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,q4)))}var Dc=null;function Wy(n){Dc!==n&&(Dc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Dc===n&&(Dc=null);for(var r=0;r<n.length;r+=3){var o=n[r],c=n[r+1],p=n[r+2];if(typeof c!="function"){if(rh(c||o)===null)continue;break}var g=Dt(o);g!==null&&(n.splice(r,3),r-=3,nf(g,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function xi(n){function r(z){return Oc(z,n)}Pr!==null&&Oc(Pr,n),Gr!==null&&Oc(Gr,n),Vr!==null&&Oc(Vr,n),jo.forEach(r),Eo.forEach(r);for(var o=0;o<qr.length;o++){var c=qr[o];c.blockedOn===n&&(c.blockedOn=null)}for(;0<qr.length&&(o=qr[0],o.blockedOn===null);)Zy(o),o.blockedOn===null&&qr.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var p=o[c],g=o[c+1],S=p[ve]||null;if(typeof g=="function")S||Wy(o);else if(S){var C=null;if(g&&g.hasAttribute("formAction")){if(p=g,S=g[ve]||null)C=S.formAction;else if(rh(p)!==null)continue}else C=S.action;typeof C=="function"?o[c+1]=C:(o.splice(c,3),c-=3),Wy(o)}}}function e0(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function ih(n){this._internalRoot=n}Mc.prototype.render=ih.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var o=r.current,c=ea();qy(o,c,n,r,null,null)},Mc.prototype.unmount=ih.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;qy(n.current,2,null,n,null,null),pc(),r[_e]=null}};function Mc(n){this._internalRoot=n}Mc.prototype.unstable_scheduleHydration=function(n){if(n){var r=fe();n={blockedOn:null,target:n,priority:r};for(var o=0;o<qr.length&&r!==0&&r<qr[o].priority;o++);qr.splice(o,0,n),o===0&&Zy(n)}};var t0=t.version;if(t0!=="19.2.4")throw Error(s(527,t0,"19.2.4"));G.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=h(r),n=n!==null?x(n):null,n=n===null?null:n.stateNode,n};var F4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{mn=zc.inject(F4),Ht=zc}catch{}}return To.createRoot=function(n,r){if(!i(n))throw Error(s(299));var o=!1,c="",p=lx,g=cx,S=ux;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=Gy(n,1,!1,null,null,o,c,null,p,g,S,e0),n[_e]=r.current,If(n),new ih(r)},To.hydrateRoot=function(n,r,o){if(!i(n))throw Error(s(299));var c=!1,p="",g=lx,S=cx,C=ux,z=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(C=o.onRecoverableError),o.formState!==void 0&&(z=o.formState)),r=Gy(n,1,!0,r,o??null,c,p,z,g,S,C,e0),r.context=Vy(null),o=r.current,c=ea(),c=$(c),p=Tr(c),p.callback=null,Ar(o,p,c),o=c,r.current.lanes=o,Pe(r,o),Ia(r),n[_e]=r.current,If(n),new Mc(r)},To.version="19.2.4",To}var L0;function c2(){if(L0)return mh.exports;L0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),mh.exports=l2(),mh.exports}var u2=c2();var s_=e=>{throw TypeError(e)},d2=(e,t,a)=>t.has(e)||s_("Cannot "+a),yh=(e,t,a)=>(d2(e,t,"read from private field"),a?a.call(e):t.get(e)),f2=(e,t,a)=>t.has(e)?s_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),O0="popstate";function D0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function h2(e={}){function t(s,i){let l=i.state?.masked,{pathname:u,search:f,hash:m}=l||s.location;return el("",{pathname:u,search:f,hash:m},i.state&&i.state.usr||null,i.state&&i.state.key||"default",l?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,i){return typeof i=="string"?i:Ka(i)}return p2(t,a,null,e)}function Fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ut(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function m2(){return Math.random().toString(36).substring(2,10)}function M0(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function el(e,t,a=null,s,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Sr(t):t,state:a,key:t&&t.key||s||m2(),unstable_mask:i}}function Ka({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Sr(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function p2(e,t,a,s={}){let{window:i=document.defaultView,v5Compat:l=!1}=s,u=i.history,f="POP",m=null,h=x();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function x(){return(u.state||{idx:null}).idx}function y(){f="POP";let j=x(),E=j==null?null:j-h;h=j,m&&m({action:f,location:N.location,delta:E})}function v(j,E){f="PUSH";let R=D0(j)?j:el(N.location,j,E);h=x()+1;let k=M0(R,h),O=N.createHref(R.unstable_mask||R);try{u.pushState(k,"",O)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(O)}l&&m&&m({action:f,location:N.location,delta:1})}function b(j,E){f="REPLACE";let R=D0(j)?j:el(N.location,j,E);h=x();let k=M0(R,h),O=N.createHref(R.unstable_mask||R);u.replaceState(k,"",O),l&&m&&m({action:f,location:N.location,delta:0})}function w(j){return i_(j)}let N={get action(){return f},get location(){return e(i,u)},listen(j){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(O0,y),m=j,()=>{i.removeEventListener(O0,y),m=null}},createHref(j){return t(i,j)},createURL:w,encodeLocation(j){let E=w(j);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:v,replace:b,go(j){return u.go(j)}};return N}function i_(e,t=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Fe(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Ka(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=a+s),new URL(s,a)}var Io,z0=class{constructor(e){if(f2(this,Io,new Map),e)for(let[t,a]of e)this.set(t,a)}get(e){if(yh(this,Io).has(e))return yh(this,Io).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){yh(this,Io).set(e,t)}};Io=new WeakMap;var g2=new Set(["lazy","caseSensitive","path","id","index","children"]);function x2(e){return g2.has(e)}var y2=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function v2(e){return y2.has(e)}function b2(e){return e.index===!0}function tl(e,t,a=[],s={},i=!1){return e.map((l,u)=>{let f=[...a,String(u)],m=typeof l.id=="string"?l.id:f.join("-");if(Fe(l.index!==!0||!l.children,"Cannot specify children on an index route"),Fe(i||!s[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),b2(l)){let h={...l,id:m};return s[m]=U0(h,t(h)),h}else{let h={...l,id:m,children:void 0};return s[m]=U0(h,t(h)),l.children&&(h.children=tl(l.children,t,f,s,i)),h}})}function U0(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Kr(e,t,a="/"){return Po(e,t,a,!1)}function Po(e,t,a,s){let i=typeof t=="string"?Sr(t):t,l=Na(i.pathname||"/",a);if(l==null)return null;let u=o_(e);S2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=O2(l);f=A2(u[m],h,s)}return f}function _2(e,t){let{route:a,pathname:s,params:i}=e;return{id:a.id,pathname:s,params:i,data:t[a.id],loaderData:t[a.id],handle:a.handle}}function o_(e,t=[],a=[],s="",i=!1){let l=(u,f,m=i,h)=>{let x={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&m)return;Fe(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let y=Oa([s,x.relativePath]),v=a.concat(x);u.children&&u.children.length>0&&(Fe(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),o_(u.children,t,v,y,m)),!(u.path==null&&!u.index)&&t.push({path:y,score:R2(y,u.index),routesMeta:v})};return e.forEach((u,f)=>{if(u.path===""||!u.path?.includes("?"))l(u,f);else for(let m of l_(u.path))l(u,f,!0,m)}),t}function l_(e){let t=e.split("/");if(t.length===0)return[];let[a,...s]=t,i=a.endsWith("?"),l=a.replace(/\?$/,"");if(s.length===0)return i?[l,""]:[l];let u=l_(s.join("/")),f=[];return f.push(...u.map(m=>m===""?l:[l,m].join("/"))),i&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function S2(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:T2(t.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var w2=/^:[\w-]+$/,N2=3,j2=2,E2=1,C2=10,k2=-2,$0=e=>e==="*";function R2(e,t){let a=e.split("/"),s=a.length;return a.some($0)&&(s+=k2),t&&(s+=j2),a.filter(i=>!$0(i)).reduce((i,l)=>i+(w2.test(l)?N2:l===""?E2:C2),s)}function T2(e,t){return e.length===t.length&&e.slice(0,-1).every((s,i)=>s===t[i])?e[e.length-1]-t[t.length-1]:0}function A2(e,t,a=!1){let{routesMeta:s}=e,i={},l="/",u=[];for(let f=0;f<s.length;++f){let m=s[f],h=f===s.length-1,x=l==="/"?t:t.slice(l.length)||"/",y=gu({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},x),v=m.route;if(!y&&h&&a&&!s[s.length-1].route.index&&(y=gu({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},x)),!y)return null;Object.assign(i,y.params),u.push({params:i,pathname:Oa([l,y.pathname]),pathnameBase:z2(Oa([l,y.pathnameBase])),route:v}),y.pathnameBase!=="/"&&(l=Oa([l,y.pathnameBase]))}return u}function gu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=L2(e.path,e.caseSensitive,e.end),i=t.match(a);if(!i)return null;let l=i[0],u=l.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:s.reduce((h,{paramName:x,isOptional:y},v)=>{if(x==="*"){let w=f[v]||"";u=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=f[v];return y&&!b?h[x]=void 0:h[x]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:u,pattern:e}}function L2(e,t=!1,a=!0){Ut(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m,h,x)=>{if(s.push({paramName:f,isOptional:m!=null}),m){let y=x.charAt(h+u.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),s]}function O2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ut(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Na(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}function D2({basename:e,pathname:t}){return t==="/"?e:Oa([e,t])}var c_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Om=e=>c_.test(e);function M2(e,t="/"){let{pathname:a,search:s="",hash:i=""}=typeof e=="string"?Sr(e):e,l;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?l=H0(a.substring(1),"/"):l=H0(a,t)):l=t,{pathname:l,search:U2(s),hash:$2(i)}}function H0(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?a.length>1&&a.pop():i!=="."&&a.push(i)}),a.length>1?a.join("/"):"/"}function vh(e,t,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function u_(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Mu(e){let t=u_(e);return t.map((a,s)=>s===t.length-1?a.pathname:a.pathnameBase)}function hl(e,t,a,s=!1){let i;typeof e=="string"?i=Sr(e):(i={...e},Fe(!i.pathname||!i.pathname.includes("?"),vh("?","pathname","search",i)),Fe(!i.pathname||!i.pathname.includes("#"),vh("#","pathname","hash",i)),Fe(!i.search||!i.search.includes("#"),vh("#","search","hash",i)));let l=e===""||i.pathname==="",u=l?"/":i.pathname,f;if(u==null)f=a;else{let y=t.length-1;if(!s&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),y-=1;i.pathname=v.join("/")}f=y>=0?t[y]:"/"}let m=M2(i,f),h=u&&u!=="/"&&u.endsWith("/"),x=(l||u===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(h||x)&&(m.pathname+="/"),m}var Oa=e=>e.join("/").replace(/\/\/+/g,"/"),z2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),U2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ml=class{constructor(e,t,a,s=!1){this.status=e,this.statusText=t||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Ti(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pl(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var d_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function f_(e,t){let a=e;if(typeof a!="string"||!c_.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,i=!1;if(d_)try{let l=new URL(window.location.href),u=a.startsWith("//")?new URL(l.protocol+a):new URL(a),f=Na(u.pathname,t);u.origin===l.origin&&f!=null?a=f+u.search+u.hash:i=!0}catch{Ut(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:i,to:a}}var Zr=Symbol("Uninstrumented");function H2(e,t){let a={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(l){let u=Object.keys(a);for(let f of u)l[f]&&a[f].push(l[f])}}));let s={};if(typeof t.lazy=="function"&&a.lazy.length>0){let i=Ni(a.lazy,t.lazy,()=>{});i&&(s.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(l=>{let u=i[l],f=a[`lazy.${l}`];if(typeof u=="function"&&f.length>0){let m=Ni(f,u,()=>{});m&&(s.lazy=Object.assign(s.lazy||{},{[l]:m}))}})}return["loader","action"].forEach(i=>{let l=t[i];if(typeof l=="function"&&a[i].length>0){let u=l[Zr]??l,f=Ni(a[i],u,(...m)=>B0(m[0]));f&&(i==="loader"&&u.hydrate===!0&&(f.hydrate=!0),f[Zr]=u,s[i]=f)}}),t.middleware&&t.middleware.length>0&&a.middleware.length>0&&(s.middleware=t.middleware.map(i=>{let l=i[Zr]??i,u=Ni(a.middleware,l,(...f)=>B0(f[0]));return u?(u[Zr]=l,u):i})),s}function B2(e,t){let a={navigate:[],fetch:[]};if(t.forEach(s=>s({instrument(i){let l=Object.keys(i);for(let u of l)i[u]&&a[u].push(i[u])}})),a.navigate.length>0){let s=e.navigate[Zr]??e.navigate,i=Ni(a.navigate,s,(...l)=>{let[u,f]=l;return{to:typeof u=="number"||typeof u=="string"?u:u?Ka(u):".",...I0(e,f??{})}});i&&(i[Zr]=s,e.navigate=i)}if(a.fetch.length>0){let s=e.fetch[Zr]??e.fetch,i=Ni(a.fetch,s,(...l)=>{let[u,,f,m]=l;return{href:f??".",fetcherKey:u,...I0(e,m??{})}});i&&(i[Zr]=s,e.fetch=i)}return e}function Ni(e,t,a){return e.length===0?null:async(...s)=>{let i=await h_(e,a(...s),()=>t(...s),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function h_(e,t,a,s){let i=e[s],l;if(i){let u,f=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=h_(e,t,a,s-1),l=await u,Fe(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await i(f,t)}catch(m){console.error("An instrumentation function threw an error:",m)}u||await f(),await u}else try{l={type:"success",value:await a()}}catch(u){l={type:"error",value:u}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function B0(e){let{request:t,context:a,params:s,unstable_pattern:i}=e;return{request:I2(t),params:{...s},unstable_pattern:i,context:P2(a)}}function I0(e,t){return{currentUrl:Ka(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function I2(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function P2(e){if(V2(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var G2=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function V2(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===G2}var m_=["POST","PUT","PATCH","DELETE"],q2=new Set(m_),F2=["GET",...m_],Y2=new Set(F2),p_=new Set([301,302,303,307,308]),K2=new Set([307,308]),bh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},X2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ao={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Q2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),g_="remix-router-transitions",x_=Symbol("ResetLoaderData");function Z2(e){const t=e.window?e.window:typeof window<"u"?window:void 0,a=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Fe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Q2,l=i;if(e.unstable_instrumentations){let M=e.unstable_instrumentations;l=$=>({...i($),...H2(M.map(Z=>Z.route).filter(Boolean),$)})}let u={},f=tl(e.routes,l,void 0,u),m,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let x=e.dataStrategy||nj,y={...e.future},v=null,b=new Set,w=null,N=null,j=null,E=e.hydrationData!=null,R=Kr(f,e.history.location,h),k=!1,O=null,I,B;if(R==null&&!e.patchRoutesOnNavigation){let M=ba(404,{pathname:e.history.location.pathname}),{matches:$,route:Z}=$c(f);I=!0,B=!I,R=$,O={[Z.id]:M}}else if(R&&!e.hydrationData&&ut(R,f,e.history.location.pathname).active&&(R=null),R)if(R.some(M=>M.route.lazy))I=!1,B=!I;else if(!R.some(M=>Dm(M.route)))I=!0,B=!I;else{let M=e.hydrationData?e.hydrationData.loaderData:null,$=e.hydrationData?e.hydrationData.errors:null,Z=R;if($){let fe=R.findIndex(he=>$[he.route.id]!==void 0);Z=Z.slice(0,fe+1)}B=!1,I=Z.every(fe=>{let he=y_(fe.route,M,$);return B=B||he.renderFallback,!he.shouldLoad})}else{I=!1,B=!I,R=[];let M=ut(null,f,e.history.location.pathname);M.active&&M.matches&&(k=!0,R=M.matches)}let H,T={historyAction:e.history.action,location:e.history.location,matches:R,initialized:I,renderFallback:B,navigation:bh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},P="POP",X=null,de=!1,le,ce=!1,D=new Map,F=null,A=!1,G=!1,ae=new Set,ee=new Map,J=0,L=-1,q=new Map,re=new Set,ie=new Map,ge=new Map,xe=new Set,Ee=new Map,De,qe=null;function vn(){if(v=e.history.listen(({action:M,location:$,delta:Z})=>{if(De){De(),De=void 0;return}Ut(Ee.size===0||Z!=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 fe=Ot({currentLocation:T.location,nextLocation:$,historyAction:M});if(fe&&Z!=null){let he=new Promise(Se=>{De=Se});e.history.go(Z*-1),dt(fe,{state:"blocked",location:$,proceed(){dt(fe,{state:"proceeding",proceed:void 0,reset:void 0,location:$}),he.then(()=>e.history.go(Z))},reset(){let Se=new Map(T.blockers);Se.set(fe,Ao),at({blockers:Se})}}),X?.resolve(),X=null;return}return hn(M,$)}),a){bj(t,D);let M=()=>_j(t,D);t.addEventListener("pagehide",M),F=()=>t.removeEventListener("pagehide",M)}return T.initialized||hn("POP",T.location,{initialHydration:!0}),H}function zn(){v&&v(),F&&F(),b.clear(),le&&le.abort(),T.fetchers.forEach((M,$)=>mn($)),T.blockers.forEach((M,$)=>tt($))}function $t(M){return b.add(M),()=>b.delete(M)}function at(M,$={}){M.matches&&(M.matches=M.matches.map(he=>{let Se=u[he.route.id],pe=he.route;return pe.element!==Se.element||pe.errorElement!==Se.errorElement||pe.hydrateFallbackElement!==Se.hydrateFallbackElement?{...he,route:Se}:he})),T={...T,...M};let Z=[],fe=[];T.fetchers.forEach((he,Se)=>{he.state==="idle"&&(xe.has(Se)?Z.push(Se):fe.push(Se))}),xe.forEach(he=>{!T.fetchers.has(he)&&!ee.has(he)&&Z.push(he)}),[...b].forEach(he=>he(T,{deletedFetchers:Z,newErrors:M.errors??null,viewTransitionOpts:$.viewTransitionOpts,flushSync:$.flushSync===!0})),Z.forEach(he=>mn(he)),fe.forEach(he=>T.fetchers.delete(he))}function Nt(M,$,{flushSync:Z}={}){let fe=T.actionData!=null&&T.navigation.formMethod!=null&&jn(T.navigation.formMethod)&&T.navigation.state==="loading"&&M.state?._isRedirect!==!0,he;$.actionData?Object.keys($.actionData).length>0?he=$.actionData:he=null:fe?he=T.actionData:he=null;let Se=$.loaderData?Z0(T.loaderData,$.loaderData,$.matches||[],$.errors):T.loaderData,pe=T.blockers;pe.size>0&&(pe=new Map(pe),pe.forEach((Ae,Ce)=>pe.set(Ce,Ao)));let ve=A?!1:Be(M,$.matches||T.matches),_e=de===!0||T.navigation.formMethod!=null&&jn(T.navigation.formMethod)&&M.state?._isRedirect!==!0;m&&(f=m,m=void 0),A||P==="POP"||(P==="PUSH"?e.history.push(M,M.state):P==="REPLACE"&&e.history.replace(M,M.state));let ke;if(P==="POP"){let Ae=D.get(T.location.pathname);Ae&&Ae.has(M.pathname)?ke={currentLocation:T.location,nextLocation:M}:D.has(M.pathname)&&(ke={currentLocation:M,nextLocation:T.location})}else if(ce){let Ae=D.get(T.location.pathname);Ae?Ae.add(M.pathname):(Ae=new Set([M.pathname]),D.set(T.location.pathname,Ae)),ke={currentLocation:T.location,nextLocation:M}}at({...$,actionData:he,loaderData:Se,historyAction:P,location:M,initialized:!0,renderFallback:!1,navigation:bh,revalidation:"idle",restoreScrollPosition:ve,preventScrollReset:_e,blockers:pe},{viewTransitionOpts:ke,flushSync:Z===!0}),P="POP",de=!1,ce=!1,A=!1,G=!1,X?.resolve(),X=null,qe?.resolve(),qe=null}async function Un(M,$){if(X?.resolve(),X=null,typeof M=="number"){X||(X=tv());let xt=X.promise;return e.history.go(M),xt}let Z=Xh(T.location,T.matches,h,M,$?.fromRouteId,$?.relative),{path:fe,submission:he,error:Se}=P0(!1,Z,$),pe;$?.unstable_mask&&(pe={pathname:"",search:"",hash:"",...typeof $.unstable_mask=="string"?Sr($.unstable_mask):{...T.location.unstable_mask,...$.unstable_mask}});let ve=T.location,_e=el(ve,fe,$&&$.state,void 0,pe);_e={..._e,...e.history.encodeLocation(_e)};let ke=$&&$.replace!=null?$.replace:void 0,Ae="PUSH";ke===!0?Ae="REPLACE":ke===!1||he!=null&&jn(he.formMethod)&&he.formAction===T.location.pathname+T.location.search&&(Ae="REPLACE");let Ce=$&&"preventScrollReset"in $?$.preventScrollReset===!0:void 0,rt=($&&$.flushSync)===!0,Ye=Ot({currentLocation:ve,nextLocation:_e,historyAction:Ae});if(Ye){dt(Ye,{state:"blocked",location:_e,proceed(){dt(Ye,{state:"proceeding",proceed:void 0,reset:void 0,location:_e}),Un(M,$)},reset(){let xt=new Map(T.blockers);xt.set(Ye,Ao),at({blockers:xt})}});return}await hn(Ae,_e,{submission:he,pendingError:Se,preventScrollReset:Ce,replace:$&&$.replace,enableViewTransition:$&&$.viewTransition,flushSync:rt,callSiteDefaultShouldRevalidate:$&&$.unstable_defaultShouldRevalidate})}function lt(){qe||(qe=tv()),Xe(),at({revalidation:"loading"});let M=qe.promise;return T.navigation.state==="submitting"?M:T.navigation.state==="idle"?(hn(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),M):(hn(P||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ce===!0}),M)}async function hn(M,$,Z){le&&le.abort(),le=null,P=M,A=(Z&&Z.startUninterruptedRevalidation)===!0,be(T.location,T.matches),de=(Z&&Z.preventScrollReset)===!0,ce=(Z&&Z.enableViewTransition)===!0;let fe=m||f,he=Z&&Z.overrideNavigation,Se=Z?.initialHydration&&T.matches&&T.matches.length>0&&!k?T.matches:Kr(fe,$,h),pe=(Z&&Z.flushSync)===!0;if(Se&&T.initialized&&!G&&uj(T.location,$)&&!(Z&&Z.submission&&jn(Z.submission.formMethod))){Nt($,{matches:Se},{flushSync:pe});return}let ve=ut(Se,fe,$.pathname);if(ve.active&&ve.matches&&(Se=ve.matches),!Se){let{error:Et,notFoundMatches:Dt,route:nt}=Bt($.pathname);Nt($,{matches:Dt,loaderData:{},errors:{[nt.id]:Et}},{flushSync:pe});return}le=new AbortController;let _e=Si(e.history,$,le.signal,Z&&Z.submission),ke=e.getContext?await e.getContext():new z0,Ae;if(Z&&Z.pendingError)Ae=[Xr(Se).route.id,{type:"error",error:Z.pendingError}];else if(Z&&Z.submission&&jn(Z.submission.formMethod)){let Et=await on(_e,$,Z.submission,Se,ke,ve.active,Z&&Z.initialHydration===!0,{replace:Z.replace,flushSync:pe});if(Et.shortCircuited)return;if(Et.pendingActionResult){let[Dt,nt]=Et.pendingActionResult;if(na(nt)&&Ti(nt.error)&&nt.error.status===404){le=null,Nt($,{matches:Et.matches,loaderData:{},errors:{[Dt]:nt.error}});return}}Se=Et.matches||Se,Ae=Et.pendingActionResult,he=_h($,Z.submission),pe=!1,ve.active=!1,_e=Si(e.history,_e.url,_e.signal)}let{shortCircuited:Ce,matches:rt,loaderData:Ye,errors:xt}=await qt(_e,$,Se,ke,ve.active,he,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,pe,Ae,Z&&Z.callSiteDefaultShouldRevalidate);Ce||(le=null,Nt($,{matches:rt||Se,...J0(Ae),loaderData:Ye,errors:xt}))}async function on(M,$,Z,fe,he,Se,pe,ve={}){Xe();let _e=yj($,Z);if(at({navigation:_e},{flushSync:ve.flushSync===!0}),Se){let Ce=await Pe(fe,$.pathname,M.signal);if(Ce.type==="aborted")return{shortCircuited:!0};if(Ce.type==="error"){if(Ce.partialMatches.length===0){let{matches:Ye,route:xt}=$c(f);return{matches:Ye,pendingActionResult:[xt.id,{type:"error",error:Ce.error}]}}let rt=Xr(Ce.partialMatches).route.id;return{matches:Ce.partialMatches,pendingActionResult:[rt,{type:"error",error:Ce.error}]}}else if(Ce.matches)fe=Ce.matches;else{let{notFoundMatches:rt,error:Ye,route:xt}=Bt($.pathname);return{matches:rt,pendingActionResult:[xt.id,{type:"error",error:Ye}]}}}let ke,Ae=ru(fe,$);if(!Ae.route.action&&!Ae.route.lazy)ke={type:"error",error:ba(405,{method:M.method,pathname:$.pathname,routeId:Ae.route.id})};else{let Ce=ji(l,u,M,fe,Ae,pe?[]:s,he),rt=await Ne(M,Ce,he,null);if(ke=rt[Ae.route.id],!ke){for(let Ye of fe)if(rt[Ye.route.id]){ke=rt[Ye.route.id];break}}if(M.signal.aborted)return{shortCircuited:!0}}if(Ns(ke)){let Ce;return ve&&ve.replace!=null?Ce=ve.replace:Ce=K0(ke.response.headers.get("Location"),new URL(M.url),h,e.history)===T.location.pathname+T.location.search,await _n(M,ke,!0,{submission:Z,replace:Ce}),{shortCircuited:!0}}if(na(ke)){let Ce=Xr(fe,Ae.route.id);return(ve&&ve.replace)!==!0&&(P="PUSH"),{matches:fe,pendingActionResult:[Ce.route.id,ke,Ae.route.id]}}return{matches:fe,pendingActionResult:[Ae.route.id,ke]}}async function qt(M,$,Z,fe,he,Se,pe,ve,_e,ke,Ae,Ce,rt){let Ye=Se||_h($,pe),xt=pe||ve||ev(Ye),Et=!A&&!ke;if(he){if(Et){let It=bn(Ce);at({navigation:Ye,...It!==void 0?{actionData:It}:{}},{flushSync:Ae})}let Ke=await Pe(Z,$.pathname,M.signal);if(Ke.type==="aborted")return{shortCircuited:!0};if(Ke.type==="error"){if(Ke.partialMatches.length===0){let{matches:Sn,route:Yt}=$c(f);return{matches:Sn,loaderData:{},errors:{[Yt.id]:Ke.error}}}let It=Xr(Ke.partialMatches).route.id;return{matches:Ke.partialMatches,loaderData:{},errors:{[It]:Ke.error}}}else if(Ke.matches)Z=Ke.matches;else{let{error:It,notFoundMatches:Sn,route:Yt}=Bt($.pathname);return{matches:Sn,loaderData:{},errors:{[Yt.id]:It}}}}let Dt=m||f,{dsMatches:nt,revalidatingFetchers:tn}=G0(M,fe,l,u,e.history,T,Z,xt,$,ke?[]:s,ke===!0,G,ae,xe,ie,re,Dt,h,e.patchRoutesOnNavigation!=null,Ce,rt);if(L=++J,!e.dataStrategy&&!nt.some(Ke=>Ke.shouldLoad)&&!nt.some(Ke=>Ke.route.middleware&&Ke.route.middleware.length>0)&&tn.length===0){let Ke=Te();return Nt($,{matches:Z,loaderData:{},errors:Ce&&na(Ce[1])?{[Ce[0]]:Ce[1].error}:null,...J0(Ce),...Ke?{fetchers:new Map(T.fetchers)}:{}},{flushSync:Ae}),{shortCircuited:!0}}if(Et){let Ke={};if(!he){Ke.navigation=Ye;let It=bn(Ce);It!==void 0&&(Ke.actionData=It)}tn.length>0&&(Ke.fetchers=ia(tn)),at(Ke,{flushSync:Ae})}tn.forEach(Ke=>{bt(Ke.key),Ke.controller&&ee.set(Ke.key,Ke.controller)});let _t=()=>tn.forEach(Ke=>bt(Ke.key));le&&le.signal.addEventListener("abort",_t);let{loaderResults:wr,fetcherResults:ka}=await $e(nt,tn,M,fe);if(M.signal.aborted)return{shortCircuited:!0};le&&le.signal.removeEventListener("abort",_t),tn.forEach(Ke=>ee.delete(Ke.key));let cn=Hc(wr);if(cn)return await _n(M,cn.result,!0,{replace:_e}),{shortCircuited:!0};if(cn=Hc(ka),cn)return re.add(cn.key),await _n(M,cn.result,!0,{replace:_e}),{shortCircuited:!0};let{loaderData:za,errors:as}=Q0(T,Z,wr,Ce,tn,ka);ke&&T.errors&&(as={...T.errors,...as});let Ua=Te(),rs=He(L),zs=Ua||rs||tn.length>0;return{matches:Z,loaderData:za,errors:as,...zs?{fetchers:new Map(T.fetchers)}:{}}}function bn(M){if(M&&!na(M[1]))return{[M[0]]:M[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function ia(M){return M.forEach($=>{let Z=T.fetchers.get($.key),fe=Lo(void 0,Z?Z.data:void 0);T.fetchers.set($.key,fe)}),new Map(T.fetchers)}async function kn(M,$,Z,fe){bt(M);let he=(fe&&fe.flushSync)===!0,Se=m||f,pe=Xh(T.location,T.matches,h,Z,$,fe?.relative),ve=Kr(Se,pe,h),_e=ut(ve,Se,pe);if(_e.active&&_e.matches&&(ve=_e.matches),!ve){Tt(M,$,ba(404,{pathname:pe}),{flushSync:he});return}let{path:ke,submission:Ae,error:Ce}=P0(!0,pe,fe);if(Ce){Tt(M,$,Ce,{flushSync:he});return}let rt=e.getContext?await e.getContext():new z0,Ye=(fe&&fe.preventScrollReset)===!0;if(Ae&&jn(Ae.formMethod)){await Rn(M,$,ke,ve,rt,_e.active,he,Ye,Ae,fe&&fe.unstable_defaultShouldRevalidate);return}ie.set(M,{routeId:$,path:ke}),await jt(M,$,ke,ve,rt,_e.active,he,Ye,Ae)}async function Rn(M,$,Z,fe,he,Se,pe,ve,_e,ke){Xe(),ie.delete(M);let Ae=T.fetchers.get(M);vt(M,vj(_e,Ae),{flushSync:pe});let Ce=new AbortController,rt=Si(e.history,Z,Ce.signal,_e);if(Se){let Ct=await Pe(fe,new URL(rt.url).pathname,rt.signal,M);if(Ct.type==="aborted")return;if(Ct.type==="error"){Tt(M,$,Ct.error,{flushSync:pe});return}else if(Ct.matches)fe=Ct.matches;else{Tt(M,$,ba(404,{pathname:Z}),{flushSync:pe});return}}let Ye=ru(fe,Z);if(!Ye.route.action&&!Ye.route.lazy){let Ct=ba(405,{method:_e.formMethod,pathname:Z,routeId:$});Tt(M,$,Ct,{flushSync:pe});return}ee.set(M,Ce);let xt=J,Et=ji(l,u,rt,fe,Ye,s,he),Dt=await Ne(rt,Et,he,M),nt=Dt[Ye.route.id];if(!nt){for(let Ct of Et)if(Dt[Ct.route.id]){nt=Dt[Ct.route.id];break}}if(rt.signal.aborted){ee.get(M)===Ce&&ee.delete(M);return}if(xe.has(M)){if(Ns(nt)||na(nt)){vt(M,xr(void 0));return}}else{if(Ns(nt))if(ee.delete(M),L>xt){vt(M,xr(void 0));return}else return re.add(M),vt(M,Lo(_e)),_n(rt,nt,!1,{fetcherSubmission:_e,preventScrollReset:ve});if(na(nt)){Tt(M,$,nt.error);return}}let tn=T.navigation.location||T.location,_t=Si(e.history,tn,Ce.signal),wr=m||f,ka=T.navigation.state!=="idle"?Kr(wr,T.navigation.location,h):T.matches;Fe(ka,"Didn't find any matches after fetcher action");let cn=++J;q.set(M,cn);let za=Lo(_e,nt.data);T.fetchers.set(M,za);let{dsMatches:as,revalidatingFetchers:Ua}=G0(_t,he,l,u,e.history,T,ka,_e,tn,s,!1,G,ae,xe,ie,re,wr,h,e.patchRoutesOnNavigation!=null,[Ye.route.id,nt],ke);Ua.filter(Ct=>Ct.key!==M).forEach(Ct=>{let Us=Ct.key,$s=T.fetchers.get(Us),El=Lo(void 0,$s?$s.data:void 0);T.fetchers.set(Us,El),bt(Us),Ct.controller&&ee.set(Us,Ct.controller)}),at({fetchers:new Map(T.fetchers)});let rs=()=>Ua.forEach(Ct=>bt(Ct.key));Ce.signal.addEventListener("abort",rs);let{loaderResults:zs,fetcherResults:Ke}=await $e(as,Ua,_t,he);if(Ce.signal.aborted)return;if(Ce.signal.removeEventListener("abort",rs),q.delete(M),ee.delete(M),Ua.forEach(Ct=>ee.delete(Ct.key)),T.fetchers.has(M)){let Ct=xr(nt.data);T.fetchers.set(M,Ct)}let It=Hc(zs);if(It)return _n(_t,It.result,!1,{preventScrollReset:ve});if(It=Hc(Ke),It)return re.add(It.key),_n(_t,It.result,!1,{preventScrollReset:ve});let{loaderData:Sn,errors:Yt}=Q0(T,ka,zs,void 0,Ua,Ke);He(cn),T.navigation.state==="loading"&&cn>L?(Fe(P,"Expected pending action"),le&&le.abort(),Nt(T.navigation.location,{matches:ka,loaderData:Sn,errors:Yt,fetchers:new Map(T.fetchers)})):(at({errors:Yt,loaderData:Z0(T.loaderData,Sn,ka,Yt),fetchers:new Map(T.fetchers)}),G=!1)}async function jt(M,$,Z,fe,he,Se,pe,ve,_e){let ke=T.fetchers.get(M);vt(M,Lo(_e,ke?ke.data:void 0),{flushSync:pe});let Ae=new AbortController,Ce=Si(e.history,Z,Ae.signal);if(Se){let nt=await Pe(fe,new URL(Ce.url).pathname,Ce.signal,M);if(nt.type==="aborted")return;if(nt.type==="error"){Tt(M,$,nt.error,{flushSync:pe});return}else if(nt.matches)fe=nt.matches;else{Tt(M,$,ba(404,{pathname:Z}),{flushSync:pe});return}}let rt=ru(fe,Z);ee.set(M,Ae);let Ye=J,xt=ji(l,u,Ce,fe,rt,s,he),Dt=(await Ne(Ce,xt,he,M))[rt.route.id];if(ee.get(M)===Ae&&ee.delete(M),!Ce.signal.aborted){if(xe.has(M)){vt(M,xr(void 0));return}if(Ns(Dt))if(L>Ye){vt(M,xr(void 0));return}else{re.add(M),await _n(Ce,Dt,!1,{preventScrollReset:ve});return}if(na(Dt)){Tt(M,$,Dt.error);return}vt(M,xr(Dt.data))}}async function _n(M,$,Z,{submission:fe,fetcherSubmission:he,preventScrollReset:Se,replace:pe}={}){Z||(X?.resolve(),X=null),$.response.headers.has("X-Remix-Revalidate")&&(G=!0);let ve=$.response.headers.get("Location");Fe(ve,"Expected a Location header on the redirect Response"),ve=K0(ve,new URL(M.url),h,e.history);let _e=el(T.location,ve,{_isRedirect:!0});if(a){let xt=!1;if($.response.headers.has("X-Remix-Reload-Document"))xt=!0;else if(Om(ve)){const Et=i_(ve,!0);xt=Et.origin!==t.location.origin||Na(Et.pathname,h)==null}if(xt){pe?t.location.replace(ve):t.location.assign(ve);return}}le=null;let ke=pe===!0||$.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ae,formAction:Ce,formEncType:rt}=T.navigation;!fe&&!he&&Ae&&Ce&&rt&&(fe=ev(T.navigation));let Ye=fe||he;if(K2.has($.response.status)&&Ye&&jn(Ye.formMethod))await hn(ke,_e,{submission:{...Ye,formAction:ve},preventScrollReset:Se||de,enableViewTransition:Z?ce:void 0});else{let xt=_h(_e,fe);await hn(ke,_e,{overrideNavigation:xt,fetcherSubmission:he,preventScrollReset:Se||de,enableViewTransition:Z?ce:void 0})}}async function Ne(M,$,Z,fe){let he,Se={};try{he=await rj(x,M,$,fe,Z,!1)}catch(pe){return $.filter(ve=>ve.shouldLoad).forEach(ve=>{Se[ve.route.id]={type:"error",error:pe}}),Se}if(M.signal.aborted)return Se;if(!jn(M.method))for(let pe of $){if(he[pe.route.id]?.type==="error")break;!he.hasOwnProperty(pe.route.id)&&!T.loaderData.hasOwnProperty(pe.route.id)&&(!T.errors||!T.errors.hasOwnProperty(pe.route.id))&&pe.shouldCallHandler()&&(he[pe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${pe.route.id}`)})}for(let[pe,ve]of Object.entries(he))if(mj(ve)){let _e=ve.result;Se[pe]={type:"redirect",response:lj(_e,M,pe,$,h)}}else Se[pe]=await oj(ve);return Se}async function $e(M,$,Z,fe){let he=Ne(Z,M,fe,null),Se=Promise.all($.map(async _e=>{if(_e.matches&&_e.match&&_e.request&&_e.controller){let Ae=(await Ne(_e.request,_e.matches,fe,_e.key))[_e.match.route.id];return{[_e.key]:Ae}}else return Promise.resolve({[_e.key]:{type:"error",error:ba(404,{pathname:_e.path})}})})),pe=await he,ve=(await Se).reduce((_e,ke)=>Object.assign(_e,ke),{});return{loaderResults:pe,fetcherResults:ve}}function Xe(){G=!0,ie.forEach((M,$)=>{ee.has($)&&ae.add($),bt($)})}function vt(M,$,Z={}){T.fetchers.set(M,$),at({fetchers:new Map(T.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function Tt(M,$,Z,fe={}){let he=Xr(T.matches,$);mn(M),at({errors:{[he.route.id]:Z},fetchers:new Map(T.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function ln(M){return ge.set(M,(ge.get(M)||0)+1),xe.has(M)&&xe.delete(M),T.fetchers.get(M)||X2}function Yn(M,$){bt(M,$?.reason),vt(M,xr(null))}function mn(M){let $=T.fetchers.get(M);ee.has(M)&&!($&&$.state==="loading"&&q.has(M))&&bt(M),ie.delete(M),q.delete(M),re.delete(M),xe.delete(M),ae.delete(M),T.fetchers.delete(M)}function Ht(M){let $=(ge.get(M)||0)-1;$<=0?(ge.delete(M),xe.add(M)):ge.set(M,$),at({fetchers:new Map(T.fetchers)})}function bt(M,$){let Z=ee.get(M);Z&&(Z.abort($),ee.delete(M))}function Ft(M){for(let $ of M){let Z=ln($),fe=xr(Z.data);T.fetchers.set($,fe)}}function Te(){let M=[],$=!1;for(let Z of re){let fe=T.fetchers.get(Z);Fe(fe,`Expected fetcher: ${Z}`),fe.state==="loading"&&(re.delete(Z),M.push(Z),$=!0)}return Ft(M),$}function He(M){let $=[];for(let[Z,fe]of q)if(fe<M){let he=T.fetchers.get(Z);Fe(he,`Expected fetcher: ${Z}`),he.state==="loading"&&(bt(Z),q.delete(Z),$.push(Z))}return Ft($),$.length>0}function ct(M,$){let Z=T.blockers.get(M)||Ao;return Ee.get(M)!==$&&Ee.set(M,$),Z}function tt(M){T.blockers.delete(M),Ee.delete(M)}function dt(M,$){let Z=T.blockers.get(M)||Ao;Fe(Z.state==="unblocked"&&$.state==="blocked"||Z.state==="blocked"&&$.state==="blocked"||Z.state==="blocked"&&$.state==="proceeding"||Z.state==="blocked"&&$.state==="unblocked"||Z.state==="proceeding"&&$.state==="unblocked",`Invalid blocker state transition: ${Z.state} -> ${$.state}`);let fe=new Map(T.blockers);fe.set(M,$),at({blockers:fe})}function Ot({currentLocation:M,nextLocation:$,historyAction:Z}){if(Ee.size===0)return;Ee.size>1&&Ut(!1,"A router only supports one blocker at a time");let fe=Array.from(Ee.entries()),[he,Se]=fe[fe.length-1],pe=T.blockers.get(he);if(!(pe&&pe.state==="proceeding")&&Se({currentLocation:M,nextLocation:$,historyAction:Z}))return he}function Bt(M){let $=ba(404,{pathname:M}),Z=m||f,{matches:fe,route:he}=$c(Z);return{notFoundMatches:fe,route:he,error:$}}function en(M,$,Z){if(w=M,j=$,N=Z||null,!E&&T.navigation===bh){E=!0;let fe=Be(T.location,T.matches);fe!=null&&at({restoreScrollPosition:fe})}return()=>{w=null,j=null,N=null}}function se(M,$){return N&&N(M,$.map(fe=>_2(fe,T.loaderData)))||M.key}function be(M,$){if(w&&j){let Z=se(M,$);w[Z]=j()}}function Be(M,$){if(w){let Z=se(M,$),fe=w[Z];if(typeof fe=="number")return fe}return null}function ut(M,$,Z){if(e.patchRoutesOnNavigation)if(M){if(Object.keys(M[0].params).length>0)return{active:!0,matches:Po($,Z,h,!0)}}else return{active:!0,matches:Po($,Z,h,!0)||[]};return{active:!1,matches:null}}async function Pe(M,$,Z,fe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:M};let he=M;for(;;){let Se=m==null,pe=m||f,ve=u;try{await e.patchRoutesOnNavigation({signal:Z,path:$,matches:he,fetcherKey:fe,patch:(Ae,Ce)=>{Z.aborted||V0(Ae,Ce,pe,ve,l,!1)}})}catch(Ae){return{type:"error",error:Ae,partialMatches:he}}finally{Se&&!Z.aborted&&(f=[...f])}if(Z.aborted)return{type:"aborted"};let _e=Kr(pe,$,h),ke=null;if(_e){if(Object.keys(_e[0].params).length===0)return{type:"success",matches:_e};if(ke=Po(pe,$,h,!0),!(ke&&he.length<ke.length&&oa(he,ke.slice(0,he.length))))return{type:"success",matches:_e}}if(ke||(ke=Po(pe,$,h,!0)),!ke||oa(he,ke))return{type:"success",matches:null};he=ke}}function oa(M,$){return M.length===$.length&&M.every((Z,fe)=>Z.route.id===$[fe].route.id)}function la(M){u={},m=tl(M,l,void 0,u)}function ca(M,$,Z=!1){let fe=m==null;V0(M,$,m||f,u,l,Z),fe&&(f=[...f],at({}))}return H={get basename(){return h},get future(){return y},get state(){return T},get routes(){return f},get window(){return t},initialize:vn,subscribe:$t,enableScrollRestoration:en,navigate:Un,fetch:kn,revalidate:lt,createHref:M=>e.history.createHref(M),encodeLocation:M=>e.history.encodeLocation(M),getFetcher:ln,resetFetcher:Yn,deleteFetcher:Ht,dispose:zn,getBlocker:ct,deleteBlocker:tt,patchRoutes:ca,_internalFetchControllers:ee,_internalSetRoutes:la,_internalSetStateDoNotUseOrYouWillBreakYourApp(M){at(M)}},e.unstable_instrumentations&&(H=B2(H,e.unstable_instrumentations.map(M=>M.router).filter(Boolean))),H}function J2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Xh(e,t,a,s,i,l){let u,f;if(i){u=[];for(let h of t)if(u.push(h),h.route.id===i){f=h;break}}else u=t,f=t[t.length-1];let m=hl(s||".",Mu(u),Na(e.pathname,a)||e.pathname,l==="path");if(s==null&&(m.search=e.search,m.hash=e.hash),(s==null||s===""||s===".")&&f){let h=zm(m.search);if(f.route.index&&!h)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&h){let x=new URLSearchParams(m.search),y=x.getAll("index");x.delete("index"),y.filter(b=>b).forEach(b=>x.append("index",b));let v=x.toString();m.search=v?`?${v}`:""}}return a!=="/"&&(m.pathname=D2({basename:a,pathname:m.pathname})),Ka(m)}function P0(e,t,a){if(!a||!J2(a))return{path:t};if(a.formMethod&&!xj(a.formMethod))return{path:t,error:ba(405,{method:a.formMethod})};let s=()=>({path:t,error:ba(400,{type:"invalid-body"})}),l=(a.formMethod||"get").toUpperCase(),u=N_(t);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!jn(l))return s();let y=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((v,[b,w])=>`${v}${b}=${w}
11
+ `,""):String(a.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:a.formEncType,formData:void 0,json:void 0,text:y}}}else if(a.formEncType==="application/json"){if(!jn(l))return s();try{let y=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:a.formEncType,formData:void 0,json:y,text:void 0}}}catch{return s()}}}Fe(typeof FormData=="function","FormData is not available in this environment");let f,m;if(a.formData)f=Zh(a.formData),m=a.formData;else if(a.body instanceof FormData)f=Zh(a.body),m=a.body;else if(a.body instanceof URLSearchParams)f=a.body,m=X0(f);else if(a.body==null)f=new URLSearchParams,m=new FormData;else try{f=new URLSearchParams(a.body),m=X0(f)}catch{return s()}let h={formMethod:l,formAction:u,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(jn(h.formMethod))return{path:t,submission:h};let x=Sr(t);return e&&x.search&&zm(x.search)&&f.append("index",""),x.search=`?${f}`,{path:Ka(x),submission:h}}function G0(e,t,a,s,i,l,u,f,m,h,x,y,v,b,w,N,j,E,R,k,O){let I=k?na(k[1])?k[1].error:k[1].data:void 0,B=i.createURL(l.location),H=i.createURL(m),T;if(x&&l.errors){let F=Object.keys(l.errors)[0];T=u.findIndex(A=>A.route.id===F)}else if(k&&na(k[1])){let F=k[0];T=u.findIndex(A=>A.route.id===F)-1}let P=k?k[1].statusCode:void 0,X=P&&P>=400,de={currentUrl:B,currentParams:l.matches[0]?.params||{},nextUrl:H,nextParams:u[0].params,...f,actionResult:I,actionStatus:P},le=pl(u),ce=u.map((F,A)=>{let{route:G}=F,ae=null;if(T!=null&&A>T)ae=!1;else if(G.lazy)ae=!0;else if(!Dm(G))ae=!1;else if(x){let{shouldLoad:q}=y_(G,l.loaderData,l.errors);ae=q}else W2(l.loaderData,l.matches[A],F)&&(ae=!0);if(ae!==null)return Qh(a,s,e,le,F,h,t,ae);let ee=!1;typeof O=="boolean"?ee=O:X?ee=!1:(y||B.pathname+B.search===H.pathname+H.search||B.search!==H.search||ej(l.matches[A],F))&&(ee=!0);let J={...de,defaultShouldRevalidate:ee},L=Qo(F,J);return Qh(a,s,e,le,F,h,t,L,J,O)}),D=[];return w.forEach((F,A)=>{if(x||!u.some(ie=>ie.route.id===F.routeId)||b.has(A))return;let G=l.fetchers.get(A),ae=G&&G.state!=="idle"&&G.data===void 0,ee=Kr(j,F.path,E);if(!ee){if(R&&ae)return;D.push({key:A,routeId:F.routeId,path:F.path,matches:null,match:null,request:null,controller:null});return}if(N.has(A))return;let J=ru(ee,F.path),L=new AbortController,q=Si(i,F.path,L.signal),re=null;if(v.has(A))v.delete(A),re=ji(a,s,q,ee,J,h,t);else if(ae)y&&(re=ji(a,s,q,ee,J,h,t));else{let ie;typeof O=="boolean"?ie=O:X?ie=!1:ie=y;let ge={...de,defaultShouldRevalidate:ie};Qo(J,ge)&&(re=ji(a,s,q,ee,J,h,t,ge))}re&&D.push({key:A,routeId:F.routeId,path:F.path,matches:re,match:J,request:q,controller:L})}),{dsMatches:ce,revalidatingFetchers:D}}function Dm(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function y_(e,t,a){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Dm(e))return{shouldLoad:!1,renderFallback:!1};let s=t!=null&&e.id in t,i=a!=null&&a[e.id]!==void 0;if(!s&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let l=!s&&!i;return{shouldLoad:l,renderFallback:l}}function W2(e,t,a){let s=!t||a.route.id!==t.route.id,i=!e.hasOwnProperty(a.route.id);return s||i}function ej(e,t){let a=e.route.path;return e.pathname!==t.pathname||a!=null&&a.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qo(e,t){if(e.route.shouldRevalidate){let a=e.route.shouldRevalidate(t);if(typeof a=="boolean")return a}return t.defaultShouldRevalidate}function V0(e,t,a,s,i,l){let u;if(e){let h=s[e];Fe(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),u=h.children}else u=a;let f=[],m=[];if(t.forEach(h=>{let x=u.find(y=>v_(h,y));x?m.push({existingRoute:x,newRoute:h}):f.push(h)}),f.length>0){let h=tl(f,i,[e||"_","patch",String(u?.length||"0")],s);u.push(...h)}if(l&&m.length>0)for(let h=0;h<m.length;h++){let{existingRoute:x,newRoute:y}=m[h],v=x,[b]=tl([y],i,[],{},!0);Object.assign(v,{element:b.element?b.element:v.element,errorElement:b.errorElement?b.errorElement:v.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:v.hydrateFallbackElement})}}function v_(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((a,s)=>t.children?.some(i=>v_(a,i)))??!1:!1}var q0=new WeakMap,b_=({key:e,route:t,manifest:a,mapRouteProperties:s})=>{let i=a[t.id];if(Fe(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let l=i.lazy[e];if(!l)return;let u=q0.get(i);u||(u={},q0.set(i,u));let f=u[e];if(f)return f;let m=(async()=>{let h=x2(e),y=i[e]!==void 0&&e!=="hasErrorBoundary";if(h)Ut(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(y)Ut(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(i,{[e]:v}),Object.assign(i,s(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(v=>v===void 0)&&(i.lazy=void 0))})();return u[e]=m,m},F0=new WeakMap;function tj(e,t,a,s,i){let l=a[e.id];if(Fe(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let x=F0.get(l);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let y=(async()=>{Fe(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let w in v){let N=v[w];if(N===void 0)continue;let j=v2(w),R=l[w]!==void 0&&w!=="hasErrorBoundary";j?Ut(!j,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Ut(!R,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=N}Object.assign(l,b),Object.assign(l,{...s(l),lazy:void 0})})();return F0.set(l,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let u=Object.keys(e.lazy),f=[],m;for(let x of u){if(i&&i.includes(x))continue;let y=b_({key:x,route:e,manifest:a,mapRouteProperties:s});y&&(f.push(y),x===t&&(m=y))}let h=f.length>0?Promise.all(f).then(()=>{}):void 0;return h?.catch(()=>{}),m?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:m}}async function Y0(e){let t=e.matches.filter(i=>i.shouldLoad),a={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,l)=>{a[t[l].route.id]=i}),a}async function nj(e){return e.matches.some(t=>t.route.middleware)?__(e,()=>Y0(e)):Y0(e)}function __(e,t){return aj(e,t,s=>{if(gj(s))throw s;return s},fj,a);function a(s,i,l){if(l)return Promise.resolve(Object.assign(l.value,{[i]:{type:"error",result:s}}));{let{matches:u}=e,f=Math.min(Math.max(u.findIndex(h=>h.route.id===i),0),Math.max(u.findIndex(h=>h.shouldCallHandler()),0)),m=Xr(u,u[f].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:s}})}}}async function aj(e,t,a,s,i){let{matches:l,request:u,params:f,context:m,unstable_pattern:h}=e,x=l.flatMap(v=>v.route.middleware?v.route.middleware.map(b=>[v.route.id,b]):[]);return await S_({request:u,params:f,context:m,unstable_pattern:h},x,t,a,s,i)}async function S_(e,t,a,s,i,l,u=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let m=t[u];if(!m)return await a();let[h,x]=m,y,v=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await S_(e,t,a,s,i,l,u+1)},y.value}catch(b){return y={value:await l(b,h,y)},y.value}};try{let b=await x(e,v),w=b!=null?s(b):void 0;return i(w)?w:y?w??y.value:(y={value:await v()},y.value)}catch(b){return await l(b,h,y)}}function w_(e,t,a,s,i){let l=b_({key:"middleware",route:s.route,manifest:t,mapRouteProperties:e}),u=tj(s.route,jn(a.method)?"action":"loader",t,e,i);return{middleware:l,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function Qh(e,t,a,s,i,l,u,f,m=null,h){let x=!1,y=w_(e,t,a,i,l);return{...i,_lazyPromises:y,shouldLoad:f,shouldRevalidateArgs:m,shouldCallHandler(v){return x=!0,m?typeof h=="boolean"?Qo(i,{...m,defaultShouldRevalidate:h}):typeof v=="boolean"?Qo(i,{...m,defaultShouldRevalidate:v}):Qo(i,m):f},resolve(v){let{lazy:b,loader:w,middleware:N}=i.route,j=x||f||v&&!jn(a.method)&&(b||w),E=N&&N.length>0&&!w&&!b;return j&&(jn(a.method)||!E)?sj({request:a,unstable_pattern:s,match:i,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:v,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function ji(e,t,a,s,i,l,u,f=null){return s.map(m=>m.route.id!==i.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:w_(e,t,a,m,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Qh(e,t,a,pl(s),m,l,u,!0,f))}async function rj(e,t,a,s,i,l){a.some(h=>h._lazyPromises?.middleware)&&await Promise.all(a.map(h=>h._lazyPromises?.middleware));let u={request:t,unstable_pattern:pl(a),params:a[0].params,context:i,matches:a},m=await e({...u,fetcherKey:s,runClientMiddleware:h=>{let x=u;return __(x,()=>h({...x,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(a.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return m}async function sj({request:e,unstable_pattern:t,match:a,lazyHandlerPromise:s,lazyRoutePromise:i,handlerOverride:l,scopedContext:u}){let f,m,h=jn(e.method),x=h?"action":"loader",y=v=>{let b,w=new Promise((E,R)=>b=R);m=()=>b(),e.signal.addEventListener("abort",m);let N=E=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${x}" [routeId: ${a.route.id}]`)):v({request:e,unstable_pattern:t,params:a.params,context:u},...E!==void 0?[E]:[]),j=(async()=>{try{return{type:"data",result:await(l?l(R=>N(R)):N())}}catch(E){return{type:"error",result:E}}})();return Promise.race([j,w])};try{let v=h?a.route.action:a.route.loader;if(s||i)if(v){let b,[w]=await Promise.all([y(v).catch(N=>{b=N}),s,i]);if(b!==void 0)throw b;f=w}else{await s;let b=h?a.route.action:a.route.loader;if(b)[f]=await Promise.all([y(b),i]);else if(x==="action"){let w=new URL(e.url),N=w.pathname+w.search;throw ba(405,{method:e.method,pathname:N,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(v)f=await y(v);else{let b=new URL(e.url),w=b.pathname+b.search;throw ba(404,{pathname:w})}}catch(v){return{type:"error",result:v}}finally{m&&e.signal.removeEventListener("abort",m)}return f}async function ij(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function oj(e){let{result:t,type:a}=e;if(Mm(t)){let s;try{s=await ij(t)}catch(i){return{type:"error",error:i}}return a==="error"?{type:"error",error:new ml(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return a==="error"?W0(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:dj(t),statusCode:Ti(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ti(t)?t.status:void 0}:W0(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function lj(e,t,a,s,i){let l=e.headers.get("Location");if(Fe(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!Om(l)){let u=s.slice(0,s.findIndex(f=>f.route.id===a)+1);l=Xh(new URL(t.url),u,i,l),e.headers.set("Location",l)}return e}function K0(e,t,a,s){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Om(e)){let l=e,u=l.startsWith("//")?new URL(t.protocol+l):new URL(l);if(i.includes(u.protocol))throw new Error("Invalid redirect location");let f=Na(u.pathname,a)!=null;if(u.origin===t.origin&&f)return u.pathname+u.search+u.hash}try{let l=s.createURL(e);if(i.includes(l.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Si(e,t,a,s){let i=e.createURL(N_(t)).toString(),l={signal:a};if(s&&jn(s.formMethod)){let{formMethod:u,formEncType:f}=s;l.method=u.toUpperCase(),f==="application/json"?(l.headers=new Headers({"Content-Type":f}),l.body=JSON.stringify(s.json)):f==="text/plain"?l.body=s.text:f==="application/x-www-form-urlencoded"&&s.formData?l.body=Zh(s.formData):l.body=s.formData}return new Request(i,l)}function Zh(e){let t=new URLSearchParams;for(let[a,s]of e.entries())t.append(a,typeof s=="string"?s:s.name);return t}function X0(e){let t=new FormData;for(let[a,s]of e.entries())t.append(a,s);return t}function cj(e,t,a,s=!1,i=!1){let l={},u=null,f,m=!1,h={},x=a&&na(a[1])?a[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let v=y.route.id,b=t[v];if(Fe(!Ns(b),"Cannot handle redirect results in processLoaderData"),na(b)){let w=b.error;if(x!==void 0&&(w=x,x=void 0),u=u||{},i)u[v]=w;else{let N=Xr(e,v);u[N.route.id]==null&&(u[N.route.id]=w)}s||(l[v]=x_),m||(m=!0,f=Ti(b.error)?b.error.status:500),b.headers&&(h[v]=b.headers)}else l[v]=b.data,b.statusCode&&b.statusCode!==200&&!m&&(f=b.statusCode),b.headers&&(h[v]=b.headers)}),x!==void 0&&a&&(u={[a[0]]:x},a[2]&&(l[a[2]]=void 0)),{loaderData:l,errors:u,statusCode:f||200,loaderHeaders:h}}function Q0(e,t,a,s,i,l){let{loaderData:u,errors:f}=cj(t,a,s);return i.filter(m=>!m.matches||m.matches.some(h=>h.shouldLoad)).forEach(m=>{let{key:h,match:x,controller:y}=m;if(y&&y.signal.aborted)return;let v=l[h];if(Fe(v,"Did not find corresponding fetcher result"),na(v)){let b=Xr(e.matches,x?.route.id);f&&f[b.route.id]||(f={...f,[b.route.id]:v.error}),e.fetchers.delete(h)}else if(Ns(v))Fe(!1,"Unhandled fetcher revalidation redirect");else{let b=xr(v.data);e.fetchers.set(h,b)}}),{loaderData:u,errors:f}}function Z0(e,t,a,s){let i=Object.entries(t).filter(([,l])=>l!==x_).reduce((l,[u,f])=>(l[u]=f,l),{});for(let l of a){let u=l.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&l.route.loader&&(i[u]=e[u]),s&&s.hasOwnProperty(u))break}return i}function J0(e){return e?na(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Xr(e,t){return(t?e.slice(0,e.findIndex(s=>s.route.id===t)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function $c(e){let t=e.length===1?e[0]:e.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ba(e,{pathname:t,routeId:a,method:s,type:i,message:l}={}){let u="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(u="Bad Request",s&&t&&a?f=`You made a ${s} request to "${t}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:i==="invalid-body"&&(f="Unable to encode submission body")):e===403?(u="Forbidden",f=`Route "${a}" does not match URL "${t}"`):e===404?(u="Not Found",f=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",s&&t&&a?f=`You made a ${s.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:s&&(f=`Invalid request method "${s.toUpperCase()}"`)),new ml(e||500,u,new Error(f),!0)}function Hc(e){let t=Object.entries(e);for(let a=t.length-1;a>=0;a--){let[s,i]=t[a];if(Ns(i))return{key:s,result:i}}}function N_(e){let t=typeof e=="string"?Sr(e):e;return Ka({...t,hash:""})}function uj(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function dj(e){return new ml(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function fj(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,a])=>typeof t=="string"&&hj(a))}function hj(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function mj(e){return Mm(e.result)&&p_.has(e.result.status)}function na(e){return e.type==="error"}function Ns(e){return(e&&e.type)==="redirect"}function W0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Mm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function pj(e){return p_.has(e)}function gj(e){return Mm(e)&&pj(e.status)&&e.headers.has("Location")}function xj(e){return Y2.has(e.toUpperCase())}function jn(e){return q2.has(e.toUpperCase())}function zm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ru(e,t){let a=typeof t=="string"?Sr(t).search:t.search;if(e[e.length-1].route.index&&zm(a||""))return e[e.length-1];let s=u_(e);return s[s.length-1]}function ev(e){let{formMethod:t,formAction:a,formEncType:s,text:i,formData:l,json:u}=e;if(!(!t||!a||!s)){if(i!=null)return{formMethod:t,formAction:a,formEncType:s,formData:void 0,json:void 0,text:i};if(l!=null)return{formMethod:t,formAction:a,formEncType:s,formData:l,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:a,formEncType:s,formData:void 0,json:u,text:void 0}}}function _h(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function yj(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Lo(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function vj(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function xr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function bj(e,t){try{let a=e.sessionStorage.getItem(g_);if(a){let s=JSON.parse(a);for(let[i,l]of Object.entries(s||{}))l&&Array.isArray(l)&&t.set(i,new Set(l||[]))}}catch{}}function _j(e,t){if(t.size>0){let a={};for(let[s,i]of t)a[s]=[...i];try{e.sessionStorage.setItem(g_,JSON.stringify(a))}catch(s){Ut(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function tv(){let e,t,a=new Promise((s,i)=>{e=async l=>{s(l);try{await a}catch{}},t=async l=>{i(l);try{await a}catch{}}});return{promise:a,resolve:e,reject:t}}var Os=_.createContext(null);Os.displayName="DataRouter";var gl=_.createContext(null);gl.displayName="DataRouterState";var j_=_.createContext(!1);function Sj(){return _.useContext(j_)}var Um=_.createContext({isTransitioning:!1});Um.displayName="ViewTransition";var E_=_.createContext(new Map);E_.displayName="Fetchers";var wj=_.createContext(null);wj.displayName="Await";var sa=_.createContext(null);sa.displayName="Navigation";var zu=_.createContext(null);zu.displayName="Location";var Ea=_.createContext({outlet:null,matches:[],isDataRoute:!1});Ea.displayName="Route";var $m=_.createContext(null);$m.displayName="RouteError";var C_="REACT_ROUTER_ERROR",Nj="REDIRECT",jj="ROUTE_ERROR_RESPONSE";function Ej(e){if(e.startsWith(`${C_}:${Nj}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Cj(e){if(e.startsWith(`${C_}:${jj}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ml(t.status,t.statusText,t.data)}catch{}}function kj(e,{relative:t}={}){Fe(zi(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=_.useContext(sa),{hash:i,pathname:l,search:u}=yl(e,{relative:t}),f=l;return a!=="/"&&(f=l==="/"?a:Oa([a,l])),s.createHref({pathname:f,search:u,hash:i})}function zi(){return _.useContext(zu)!=null}function Ca(){return Fe(zi(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(zu).location}var k_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function R_(e){_.useContext(sa).static||_.useLayoutEffect(e)}function Lt(){let{isDataRoute:e}=_.useContext(Ea);return e?Pj():Rj()}function Rj(){Fe(zi(),"useNavigate() may be used only in the context of a <Router> component.");let e=_.useContext(Os),{basename:t,navigator:a}=_.useContext(sa),{matches:s}=_.useContext(Ea),{pathname:i}=Ca(),l=JSON.stringify(Mu(s)),u=_.useRef(!1);return R_(()=>{u.current=!0}),_.useCallback((m,h={})=>{if(Ut(u.current,k_),!u.current)return;if(typeof m=="number"){a.go(m);return}let x=hl(m,JSON.parse(l),i,h.relative==="path");e==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:Oa([t,x.pathname])),(h.replace?a.replace:a.push)(x,h.state,h)},[t,a,l,i,e])}var Tj=_.createContext(null);function Aj(e){let t=_.useContext(Ea).outlet;return _.useMemo(()=>t&&_.createElement(Tj.Provider,{value:e},t),[t,e])}function xl(){let{matches:e}=_.useContext(Ea),t=e[e.length-1];return t?t.params:{}}function yl(e,{relative:t}={}){let{matches:a}=_.useContext(Ea),{pathname:s}=Ca(),i=JSON.stringify(Mu(a));return _.useMemo(()=>hl(e,JSON.parse(i),s,t==="path"),[e,i,s,t])}function Lj(e,t,a){Fe(zi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=_.useContext(sa),{matches:i}=_.useContext(Ea),l=i[i.length-1],u=l?l.params:{},f=l?l.pathname:"/",m=l?l.pathnameBase:"/",h=l&&l.route;{let j=h&&h.path||"";L_(f,!h||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
12
+
13
+ Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let x=Ca(),y;y=x;let v=y.pathname||"/",b=v;if(m!=="/"){let j=m.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=Kr(e,{pathname:b});return Ut(h||w!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Ut(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Uj(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},u,j.params),pathname:Oa([m,s.encodeLocation?s.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?m:Oa([m,s.encodeLocation?s.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,a)}function Oj(){let e=A_(),t=Ti(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:l},"ErrorBoundary")," or"," ",_.createElement("code",{style:l},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),a?_.createElement("pre",{style:i},a):null,u)}var Dj=_.createElement(Oj,null),T_=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=Cj(e.digest);a&&(e=a)}let t=e!==void 0?_.createElement(Ea.Provider,{value:this.props.routeContext},_.createElement($m.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?_.createElement(Mj,{error:e},t):t}};T_.contextType=j_;var Sh=new WeakMap;function Mj({children:e,error:t}){let{basename:a}=_.useContext(sa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=Ej(t.digest);if(s){let i=Sh.get(t);if(i)throw i;let l=f_(s.location,a);if(d_&&!Sh.get(t))if(l.isExternal||s.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:s.replace}));throw Sh.set(t,u),u}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function zj({routeContext:e,match:t,children:a}){let s=_.useContext(Os);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Ea.Provider,{value:e},a)}function Uj(e,t=[],a){let s=a?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let i=e,l=s?.errors;if(l!=null){let x=i.findIndex(y=>y.route.id&&l?.[y.route.id]!==void 0);Fe(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,x+1))}let u=!1,f=-1;if(a&&s){u=s.renderFallback;for(let x=0;x<i.length;x++){let y=i[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(f=x),y.route.id){let{loaderData:v,errors:b}=s,w=y.route.loader&&!v.hasOwnProperty(y.route.id)&&(!b||b[y.route.id]===void 0);if(y.route.lazy||w){a.isStatic&&(u=!0),f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}}let m=a?.onError,h=s&&m?(x,y)=>{m(x,{location:s.location,params:s.matches?.[0]?.params??{},unstable_pattern:pl(s.matches),errorInfo:y})}:void 0;return i.reduceRight((x,y,v)=>{let b,w=!1,N=null,j=null;s&&(b=l&&y.route.id?l[y.route.id]:void 0,N=y.route.errorElement||Dj,u&&(f<0&&v===0?(L_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,j=null):f===v&&(w=!0,j=y.route.hydrateFallbackElement||null)));let E=t.concat(i.slice(0,v+1)),R=()=>{let k;return b?k=N:w?k=j:y.route.Component?k=_.createElement(y.route.Component,null):y.route.element?k=y.route.element:k=x,_.createElement(zj,{match:y,routeContext:{outlet:x,matches:E,isDataRoute:s!=null},children:k})};return s&&(y.route.ErrorBoundary||y.route.errorElement||v===0)?_.createElement(T_,{location:s.location,revalidation:s.revalidation,component:N,error:b,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):R()},null)}function Hm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $j(e){let t=_.useContext(Os);return Fe(t,Hm(e)),t}function Hj(e){let t=_.useContext(gl);return Fe(t,Hm(e)),t}function Bj(e){let t=_.useContext(Ea);return Fe(t,Hm(e)),t}function Bm(e){let t=Bj(e),a=t.matches[t.matches.length-1];return Fe(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function Ij(){return Bm("useRouteId")}function A_(){let e=_.useContext($m),t=Hj("useRouteError"),a=Bm("useRouteError");return e!==void 0?e:t.errors?.[a]}function Pj(){let{router:e}=$j("useNavigate"),t=Bm("useNavigate"),a=_.useRef(!1);return R_(()=>{a.current=!0}),_.useCallback(async(i,l={})=>{Ut(a.current,k_),a.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var nv={};function L_(e,t,a){!t&&!nv[e]&&(nv[e]=!0,Ut(!1,a))}var av={};function rv(e,t){!e&&!av[t]&&(av[t]=!0,console.warn(t))}var Gj="useOptimistic",sv=bN[Gj],Vj=()=>{};function qj(e){return sv?sv(e):[e,Vj]}function Fj(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Ut(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Ut(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Ut(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Yj=["HydrateFallback","hydrateFallbackElement"],Kj=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",e(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",t(a))}})}};function Xj({router:e,flushSync:t,onError:a,unstable_useTransitions:s}){s=Sj()||s;let[l,u]=_.useState(e.state),[f,m]=qj(l),[h,x]=_.useState(),[y,v]=_.useState({isTransitioning:!1}),[b,w]=_.useState(),[N,j]=_.useState(),[E,R]=_.useState(),k=_.useRef(new Map),O=_.useCallback((T,{deletedFetchers:P,newErrors:X,flushSync:de,viewTransitionOpts:le})=>{X&&a&&Object.values(X).forEach(D=>a(D,{location:T.location,params:T.matches[0]?.params??{},unstable_pattern:pl(T.matches)})),T.fetchers.forEach((D,F)=>{D.data!==void 0&&k.current.set(F,D.data)}),P.forEach(D=>k.current.delete(D)),rv(de===!1||t!=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 ce=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(rv(le==null||ce,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!le||!ce){t&&de?t(()=>u(T)):s===!1?u(T):_.startTransition(()=>{s===!0&&m(D=>iv(D,T)),u(T)});return}if(t&&de){t(()=>{N&&(b?.resolve(),N.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:le.currentLocation,nextLocation:le.nextLocation})});let D=e.window.document.startViewTransition(()=>{t(()=>u(T))});D.finished.finally(()=>{t(()=>{w(void 0),j(void 0),x(void 0),v({isTransitioning:!1})})}),t(()=>j(D));return}N?(b?.resolve(),N.skipTransition(),R({state:T,currentLocation:le.currentLocation,nextLocation:le.nextLocation})):(x(T),v({isTransitioning:!0,flushSync:!1,currentLocation:le.currentLocation,nextLocation:le.nextLocation}))},[e.window,t,N,b,s,m,a]);_.useLayoutEffect(()=>e.subscribe(O),[e,O]),_.useEffect(()=>{y.isTransitioning&&!y.flushSync&&w(new Kj)},[y]),_.useEffect(()=>{if(b&&h&&e.window){let T=h,P=b.promise,X=e.window.document.startViewTransition(async()=>{s===!1?u(T):_.startTransition(()=>{s===!0&&m(de=>iv(de,T)),u(T)}),await P});X.finished.finally(()=>{w(void 0),j(void 0),x(void 0),v({isTransitioning:!1})}),j(X)}},[h,b,e.window,s,m]),_.useEffect(()=>{b&&h&&f.location.key===h.location.key&&b.resolve()},[b,N,f.location,h]),_.useEffect(()=>{!y.isTransitioning&&E&&(x(E.state),v({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),R(void 0))},[y.isTransitioning,E]);let I=_.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,P,X)=>e.navigate(T,{state:P,preventScrollReset:X?.preventScrollReset}),replace:(T,P,X)=>e.navigate(T,{replace:!0,state:P,preventScrollReset:X?.preventScrollReset})}),[e]),B=e.basename||"/",H=_.useMemo(()=>({router:e,navigator:I,static:!1,basename:B,onError:a}),[e,I,B,a]);return _.createElement(_.Fragment,null,_.createElement(Os.Provider,{value:H},_.createElement(gl.Provider,{value:f},_.createElement(E_.Provider,{value:k.current},_.createElement(Um.Provider,{value:y},_.createElement(Wj,{basename:B,location:f.location,navigationType:f.historyAction,navigator:I,unstable_useTransitions:s},_.createElement(Qj,{routes:e.routes,future:e.future,state:f,isStatic:!1,onError:a})))))),null)}function iv(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Qj=_.memo(Zj);function Zj({routes:e,future:t,state:a,isStatic:s,onError:i}){return Lj(e,void 0,{state:a,isStatic:s,onError:i})}function Jj({to:e,replace:t,state:a,relative:s}){Fe(zi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=_.useContext(sa);Ut(!i,"<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:l}=_.useContext(Ea),{pathname:u}=Ca(),f=Lt(),m=hl(e,Mu(l),u,s==="path"),h=JSON.stringify(m);return _.useEffect(()=>{f(JSON.parse(h),{replace:t,state:a,relative:s})},[f,h,s,t,a]),null}function O_(e){return Aj(e.context)}function Wj({basename:e="/",children:t=null,location:a,navigationType:s="POP",navigator:i,static:l=!1,unstable_useTransitions:u}){Fe(!zi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=_.useMemo(()=>({basename:f,navigator:i,static:l,unstable_useTransitions:u,future:{}}),[f,i,l,u]);typeof a=="string"&&(a=Sr(a));let{pathname:h="/",search:x="",hash:y="",state:v=null,key:b="default",unstable_mask:w}=a,N=_.useMemo(()=>{let j=Na(h,f);return j==null?null:{location:{pathname:j,search:x,hash:y,state:v,key:b,unstable_mask:w},navigationType:s}},[f,h,x,y,v,b,s,w]);return Ut(N!=null,`<Router basename="${f}"> is not able to match the URL "${h}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:_.createElement(sa.Provider,{value:m},_.createElement(zu.Provider,{children:t,value:N}))}var su="get",iu="application/x-www-form-urlencoded";function Uu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function eE(e){return Uu(e)&&e.tagName.toLowerCase()==="button"}function tE(e){return Uu(e)&&e.tagName.toLowerCase()==="form"}function nE(e){return Uu(e)&&e.tagName.toLowerCase()==="input"}function aE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rE(e,t){return e.button===0&&(!t||t==="_self")&&!aE(e)}function Jh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let s=e[a];return t.concat(Array.isArray(s)?s.map(i=>[a,i]):[[a,s]])},[]))}function sE(e,t){let a=Jh(e);return t&&t.forEach((s,i)=>{a.has(i)||t.getAll(i).forEach(l=>{a.append(i,l)})}),a}var Bc=null;function iE(){if(Bc===null)try{new FormData(document.createElement("form"),0),Bc=!1}catch{Bc=!0}return Bc}var oE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wh(e){return e!=null&&!oE.has(e)?(Ut(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${iu}"`),null):e}function lE(e,t){let a,s,i,l,u;if(tE(e)){let f=e.getAttribute("action");s=f?Na(f,t):null,a=e.getAttribute("method")||su,i=wh(e.getAttribute("enctype"))||iu,l=new FormData(e)}else if(eE(e)||nE(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(s=m?Na(m,t):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||su,i=wh(e.getAttribute("formenctype"))||wh(f.getAttribute("enctype"))||iu,l=new FormData(f,e),!iE()){let{name:h,type:x,value:y}=e;if(x==="image"){let v=h?`${h}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else h&&l.append(h,y)}}else{if(Uu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=su,s=null,i=iu,u=e}return l&&i==="text/plain"&&(u=l,l=void 0),{action:s,method:a.toLowerCase(),encType:i,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Im(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cE(e,t,a,s){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${s}`:i.pathname=`${i.pathname}.${s}`:i.pathname==="/"?i.pathname=`_root.${s}`:t&&Na(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${s}`,i}async function uE(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dE(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function fE(e,t,a){let s=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let u=await uE(l,a);return u.links?u.links():[]}return[]}));return gE(s.flat(1).filter(dE).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function ov(e,t,a,s,i,l){let u=(m,h)=>a[h]?m.route.id!==a[h].route.id:!0,f=(m,h)=>a[h].pathname!==m.pathname||a[h].route.path?.endsWith("*")&&a[h].params["*"]!==m.params["*"];return l==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):l==="data"?t.filter((m,h)=>{let x=s.routes[m.route.id];if(!x||!x.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let y=m.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function hE(e,t,{includeHydrateFallback:a}={}){return mE(e.map(s=>{let i=t.routes[s.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),a&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function mE(e){return[...new Set(e)]}function pE(e){let t={},a=Object.keys(e).sort();for(let s of a)t[s]=e[s];return t}function gE(e,t){let a=new Set;return new Set(t),e.reduce((s,i)=>{let l=JSON.stringify(pE(i));return a.has(l)||(a.add(l),s.push({key:l,link:i})),s},[])}function D_(){let e=_.useContext(Os);return Im(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function xE(){let e=_.useContext(gl);return Im(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Pm=_.createContext(void 0);Pm.displayName="FrameworkContext";function M_(){let e=_.useContext(Pm);return Im(e,"You must render this element inside a <HydratedRouter> element"),e}function yE(e,t){let a=_.useContext(Pm),[s,i]=_.useState(!1),[l,u]=_.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:x,onTouchStart:y}=t,v=_.useRef(null);_.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let N=E=>{E.forEach(R=>{u(R.isIntersecting)})},j=new IntersectionObserver(N,{threshold:.5});return v.current&&j.observe(v.current),()=>{j.disconnect()}}},[e]),_.useEffect(()=>{if(s){let N=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(N)}}},[s]);let b=()=>{i(!0)},w=()=>{i(!1),u(!1)};return a?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Oo(f,b),onBlur:Oo(m,w),onMouseEnter:Oo(h,b),onMouseLeave:Oo(x,w),onTouchStart:Oo(y,b)}]:[!1,v,{}]}function Oo(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function vE({page:e,...t}){let{router:a}=D_(),s=_.useMemo(()=>Kr(a.routes,e,a.basename),[a.routes,e,a.basename]);return s?_.createElement(_E,{page:e,matches:s,...t}):null}function bE(e){let{manifest:t,routeModules:a}=M_(),[s,i]=_.useState([]);return _.useEffect(()=>{let l=!1;return fE(e,t,a).then(u=>{l||i(u)}),()=>{l=!0}},[e,t,a]),s}function _E({page:e,matches:t,...a}){let s=Ca(),{future:i,manifest:l,routeModules:u}=M_(),{basename:f}=D_(),{loaderData:m,matches:h}=xE(),x=_.useMemo(()=>ov(e,t,h,l,s,"data"),[e,t,h,l,s]),y=_.useMemo(()=>ov(e,t,h,l,s,"assets"),[e,t,h,l,s]),v=_.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let N=new Set,j=!1;if(t.forEach(R=>{let k=l.routes[R.route.id];!k||!k.hasLoader||(!x.some(O=>O.route.id===R.route.id)&&R.route.id in m&&u[R.route.id]?.shouldRevalidate||k.hasClientLoader?j=!0:N.add(R.route.id))}),N.size===0)return[];let E=cE(e,f,i.unstable_trailingSlashAwareDataRequests,"data");return j&&N.size>0&&E.searchParams.set("_routes",t.filter(R=>N.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[f,i.unstable_trailingSlashAwareDataRequests,m,s,l,x,t,e,u]),b=_.useMemo(()=>hE(y,l),[y,l]),w=bE(y);return _.createElement(_.Fragment,null,v.map(N=>_.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...a})),b.map(N=>_.createElement("link",{key:N,rel:"modulepreload",href:N,...a})),w.map(({key:N,link:j})=>_.createElement("link",{key:N,nonce:a.nonce,...j,crossOrigin:j.crossOrigin??a.crossOrigin})))}function SE(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var wE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wE&&(window.__reactRouterVersion="7.13.1")}catch{}function NE(e,t){return Z2({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:h2({window:t?.window}),hydrationData:jE(),routes:e,mapRouteProperties:Fj,hydrationRouteProperties:Yj,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function jE(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:EE(e.errors)}),e}function EE(e){if(!e)return null;let t=Object.entries(e),a={};for(let[s,i]of t)if(i&&i.__type==="RouteErrorResponse")a[s]=new ml(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let l=window[i.__subType];if(typeof l=="function")try{let u=new l(i.message);u.stack="",a[s]=u}catch{}}if(a[s]==null){let l=new Error(i.message);l.stack="",a[s]=l}}else a[s]=i;return a}var z_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ja=_.forwardRef(function({onClick:t,discover:a="render",prefetch:s="none",relative:i,reloadDocument:l,replace:u,unstable_mask:f,state:m,target:h,to:x,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b,...w},N){let{basename:j,navigator:E,unstable_useTransitions:R}=_.useContext(sa),k=typeof x=="string"&&z_.test(x),O=f_(x,j);x=O.to;let I=kj(x,{relative:i}),B=Ca(),H=null;if(f){let F=hl(f,[],B.unstable_mask?B.unstable_mask.pathname:"/",!0);j!=="/"&&(F.pathname=F.pathname==="/"?j:Oa([j,F.pathname])),H=E.createHref(F)}let[T,P,X]=yE(s,w),de=RE(x,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:y,relative:i,viewTransition:v,unstable_defaultShouldRevalidate:b,unstable_useTransitions:R});function le(F){t&&t(F),F.defaultPrevented||de(F)}let ce=!(O.isExternal||l),D=_.createElement("a",{...w,...X,href:(ce?H:void 0)||O.absoluteURL||I,onClick:ce?le:t,ref:SE(N,P),target:h,"data-discover":!k&&a==="render"?"true":void 0});return T&&!k?_.createElement(_.Fragment,null,D,_.createElement(vE,{page:I})):D});ja.displayName="Link";var Ai=_.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:s="",end:i=!1,style:l,to:u,viewTransition:f,children:m,...h},x){let y=yl(u,{relative:h.relative}),v=Ca(),b=_.useContext(gl),{navigator:w,basename:N}=_.useContext(sa),j=b!=null&&DE(y)&&f===!0,E=w.encodeLocation?w.encodeLocation(y).pathname:y.pathname,R=v.pathname,k=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;a||(R=R.toLowerCase(),k=k?k.toLowerCase():null,E=E.toLowerCase()),k&&N&&(k=Na(k,N)||k);const O=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let I=R===E||!i&&R.startsWith(E)&&R.charAt(O)==="/",B=k!=null&&(k===E||!i&&k.startsWith(E)&&k.charAt(E.length)==="/"),H={isActive:I,isPending:B,isTransitioning:j},T=I?t:void 0,P;typeof s=="function"?P=s(H):P=[s,I?"active":null,B?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let X=typeof l=="function"?l(H):l;return _.createElement(ja,{...h,"aria-current":T,className:P,ref:x,style:X,to:u,viewTransition:f},typeof m=="function"?m(H):m)});Ai.displayName="NavLink";var CE=_.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:s,replace:i,state:l,method:u=su,action:f,onSubmit:m,relative:h,preventScrollReset:x,viewTransition:y,unstable_defaultShouldRevalidate:v,...b},w)=>{let{unstable_useTransitions:N}=_.useContext(sa),j=LE(),E=OE(f,{relative:h}),R=u.toLowerCase()==="get"?"get":"post",k=typeof f=="string"&&z_.test(f),O=I=>{if(m&&m(I),I.defaultPrevented)return;I.preventDefault();let B=I.nativeEvent.submitter,H=B?.getAttribute("formmethod")||u,T=()=>j(B||I.currentTarget,{fetcherKey:t,method:H,navigate:a,replace:i,state:l,relative:h,preventScrollReset:x,viewTransition:y,unstable_defaultShouldRevalidate:v});N&&a!==!1?_.startTransition(()=>T()):T()};return _.createElement("form",{ref:w,method:R,action:E,onSubmit:s?m:O,...b,"data-discover":!k&&e==="render"?"true":void 0})});CE.displayName="Form";function kE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function U_(e){let t=_.useContext(Os);return Fe(t,kE(e)),t}function RE(e,{target:t,replace:a,unstable_mask:s,state:i,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let x=Lt(),y=Ca(),v=yl(e,{relative:u});return _.useCallback(b=>{if(rE(b,t)){b.preventDefault();let w=a!==void 0?a:Ka(y)===Ka(v),N=()=>x(e,{replace:w,unstable_mask:s,state:i,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?_.startTransition(()=>N()):N()}},[y,x,v,a,s,i,t,e,l,u,f,m,h])}function $u(e){Ut(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 t=_.useRef(Jh(e)),a=_.useRef(!1),s=Ca(),i=_.useMemo(()=>sE(s.search,a.current?null:t.current),[s.search]),l=Lt(),u=_.useCallback((f,m)=>{const h=Jh(typeof f=="function"?f(new URLSearchParams(i)):f);a.current=!0,l("?"+h,m)},[l,i]);return[i,u]}var TE=0,AE=()=>`__${String(++TE)}__`;function LE(){let{router:e}=U_("useSubmit"),{basename:t}=_.useContext(sa),a=Ij(),s=e.fetch,i=e.navigate;return _.useCallback(async(l,u={})=>{let{action:f,method:m,encType:h,formData:x,body:y}=lE(l,t);if(u.navigate===!1){let v=u.fetcherKey||AE();await s(v,a,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:x,body:y,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await i(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:x,body:y,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[s,i,t,a])}function OE(e,{relative:t}={}){let{basename:a}=_.useContext(sa),s=_.useContext(Ea);Fe(s,"useFormAction must be used inside a RouteContext");let[i]=s.matches.slice(-1),l={...yl(e||".",{relative:t})},u=Ca();if(e==null){l.search=u.search;let f=new URLSearchParams(l.search),m=f.getAll("index");if(m.some(x=>x==="")){f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let x=f.toString();l.search=x?`?${x}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(l.pathname=l.pathname==="/"?a:Oa([a,l.pathname])),Ka(l)}function DE(e,{relative:t}={}){let a=_.useContext(Um);Fe(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=U_("useViewTransitionState"),i=yl(e,{relative:t});if(!a.isTransitioning)return!1;let l=Na(a.currentLocation.pathname,s)||a.currentLocation.pathname,u=Na(a.nextLocation.pathname,s)||a.nextLocation.pathname;return gu(i.pathname,u)!=null||gu(i.pathname,l)!=null}const ME="modulepreload",zE=function(e){return"/"+e},lv={},ne=function(t,a,s){let i=Promise.resolve();if(a&&a.length>0){let m=function(h){return Promise.all(h.map(x=>Promise.resolve(x).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=u?.nonce||u?.getAttribute("nonce");i=m(a.map(h=>{if(h=zE(h),h in lv)return;lv[h]=!0;const x=h.endsWith(".css"),y=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const v=document.createElement("link");if(v.rel=x?"stylesheet":ME,x||(v.as="script"),v.crossOrigin="",v.href=h,f&&v.setAttribute("nonce",f),document.head.appendChild(v),x)return new Promise((b,w)=>{v.addEventListener("load",b),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return i.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};const $_=(...e)=>e.filter((t,a,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===a).join(" ").trim();const UE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const $E=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,s)=>s?s.toUpperCase():a.toLowerCase());const cv=e=>{const t=$E(e);return t.charAt(0).toUpperCase()+t.slice(1)};var HE={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 BE=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const IE=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:i="",children:l,iconNode:u,...f},m)=>_.createElement("svg",{ref:m,...HE,width:t,height:t,stroke:e,strokeWidth:s?Number(a)*24/Number(t):a,className:$_("lucide",i),...!l&&!BE(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,x])=>_.createElement(h,x)),...Array.isArray(l)?l:[l]]));const Oe=(e,t)=>{const a=_.forwardRef(({className:s,...i},l)=>_.createElement(IE,{ref:l,iconNode:t,className:$_(`lucide-${UE(cv(e))}`,`lucide-${e}`,s),...i}));return a.displayName=cv(e),a};const PE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],H_=Oe("arrow-right",PE);const GE=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],uv=Oe("arrow-up-right",GE);const VE=[["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"}]],qE=Oe("boxes",VE);const FE=[["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"}]],YE=Oe("brain",FE);const KE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ts=Oe("check",KE);const XE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],rn=Oe("chevron-right",XE);const QE=[["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"}]],B_=Oe("circle-alert",QE);const ZE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],JE=Oe("circle",ZE);const WE=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],eC=Oe("cloud",WE);const tC=[["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"}]],Wh=Oe("copy",tC);const nC=[["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"}]],I_=Oe("database",nC);const aC=[["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"}]],rC=Oe("file-spreadsheet",aC);const sC=[["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"}]],Wr=Oe("file-text",sC);const iC=[["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"}]],P_=Oe("file",iC);const oC=[["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"}]],lC=Oe("files",oC);const cC=[["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"}]],Hu=Oe("folder-git-2",cC);const uC=[["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"}]],dC=Oe("folder-input",uC);const fC=[["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"}]],hC=Oe("folder-open",fC);const mC=[["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"}]],G_=Oe("folder-plus",mC);const pC=[["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"}]],_a=Oe("folder",pC);const gC=[["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"}]],em=Oe("git-branch",gC);const xC=[["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"}]],yC=Oe("git-commit-horizontal",xC);const vC=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],bC=Oe("git-fork",vC);const _C=[["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"}]],dv=Oe("github",_C);const SC=[["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"}]],wC=Oe("globe",SC);const NC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],jC=Oe("grid-3x3",NC);const EC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],CC=Oe("info",EC);const kC=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],RC=Oe("key",kC);const TC=[["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"}]],AC=Oe("laptop",TC);const LC=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],OC=Oe("list-filter",LC);const DC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fn=Oe("loader-circle",DC);const MC=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],zC=Oe("log-out",MC);const UC=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],$C=Oe("menu",UC);const HC=[["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"}]],BC=Oe("monitor",HC);const IC=[["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"}]],PC=Oe("moon",IC);const GC=[["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"}]],Ei=Oe("package",GC);const VC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],qC=Oe("panel-left",VC);const FC=[["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"}]],tm=Oe("pencil",FC);const YC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Gm=Oe("plus",YC);const KC=[["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"}]],XC=Oe("refresh-cw",KC);const QC=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],ZC=Oe("rotate-cw",QC);const JC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],nm=Oe("search",JC);const WC=[["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"}]],ek=Oe("settings",WC);const tk=[["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"}]],nk=Oe("share-2",tk);const ak=[["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"}]],rk=Oe("sparkles",ak);const sk=[["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"}]],ik=Oe("sun",sk);const ok=[["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"}]],Vm=Oe("trash-2",ok);const lk=[["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"}]],am=Oe("upload",lk);const ck=[["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"}]],uk=Oe("users",ck);const dk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],br=Oe("x",dk),fv=e=>Symbol.iterator in e,hv=e=>"entries"in e,mv=(e,t)=>{const a=e instanceof Map?e:new Map(e.entries()),s=t instanceof Map?t:new Map(t.entries());if(a.size!==s.size)return!1;for(const[i,l]of a)if(!s.has(i)||!Object.is(l,s.get(i)))return!1;return!0},fk=(e,t)=>{const a=e[Symbol.iterator](),s=t[Symbol.iterator]();let i=a.next(),l=s.next();for(;!i.done&&!l.done;){if(!Object.is(i.value,l.value))return!1;i=a.next(),l=s.next()}return!!i.done&&!!l.done};function hk(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:fv(e)&&fv(t)?hv(e)&&hv(t)?mv(e,t):fk(e,t):mv({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Ds(e){const t=wi.useRef(void 0);return a=>{const s=e(a);return hk(t.current,s)?t.current:t.current=s}}const pv=e=>{let t;const a=new Set,s=(h,x)=>{const y=typeof h=="function"?h(t):h;if(!Object.is(y,t)){const v=t;t=x??(typeof y!="object"||y===null)?y:Object.assign({},t,y),a.forEach(b=>b(t,v))}},i=()=>t,f={setState:s,getState:i,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=t=e(s,i,f);return f},mk=(e=>e?pv(e):pv),pk=e=>e;function gk(e,t=pk){const a=wi.useSyncExternalStore(e.subscribe,wi.useCallback(()=>t(e.getState()),[e,t]),wi.useCallback(()=>t(e.getInitialState()),[e,t]));return wi.useDebugValue(a),a}const gv=e=>{const t=mk(e),a=s=>gk(t,s);return Object.assign(a,t),a},ns=(e=>e?gv(e):gv),Do="c4a_token";function xv(e){try{const t=e.split(".");if(t.length!==3)return null;const a=t[1].replace(/-/g,"+").replace(/_/g,"/"),s=atob(a),i=Uint8Array.from(s,u=>u.charCodeAt(0));return JSON.parse(new TextDecoder().decode(i))}catch{return null}}function yv(e){const t=e.userId,a=e.name,s=e.email,i=e.avatar_url,l=e.workspaceId;if(!t||!s||!l)return null;const u={id:t,name:a??s,email:s,personal_workspace_id:l};return i&&(u.avatar_url=i),u}function vv(e){const t=e.exp;return t?Date.now()>=t*1e3:!1}const qn=ns(e=>({token:null,user:null,isAuthenticated:!1,init:()=>{const t=localStorage.getItem(Do);if(!t){e({token:null,user:null,isAuthenticated:!1});return}const a=xv(t);if(!a||vv(a)){localStorage.removeItem(Do),e({token:null,user:null,isAuthenticated:!1});return}const s=yv(a);if(!s){localStorage.removeItem(Do),e({token:null,user:null,isAuthenticated:!1});return}e({token:t,user:s,isAuthenticated:!0})},login:t=>{const a=xv(t);if(!a||vv(a))return;const s=yv(a);s&&(localStorage.setItem(Do,t),e({token:t,user:s,isAuthenticated:!0}))},logout:()=>{localStorage.removeItem(Do),e({token:null,user:null,isAuthenticated:!1})}})),nl=ns(e=>({activeWorkspaceId:null,init:()=>{const t=qn.getState().user;t?.personal_workspace_id&&e({activeWorkspaceId:t.personal_workspace_id})},setActiveWorkspace:t=>{e({activeWorkspaceId:t})}}));qn.subscribe((e,t)=>{e.user!==t.user&&(e.user?.personal_workspace_id?nl.getState().setActiveWorkspace(e.user.personal_workspace_id):nl.getState().setActiveWorkspace(null))});const V_="/api/v1";class Ln extends Error{constructor(t,a,s){super(s),this.status=t,this.code=a,this.name="ApiError"}}async function Ic(e,t,a,s,i){let l=`${V_}${t}`;if(s){const y=new URLSearchParams(s).toString();y&&(l+=`?${y}`)}const u={"Content-Type":"application/json"},f=qn.getState().token;f&&(u.Authorization=`Bearer ${f}`);const m=nl.getState().activeWorkspaceId;m&&(u["X-Workspace-Id"]=m);const h={method:e,headers:u};a!==void 0&&(h.body=JSON.stringify(a)),i?.signal&&(h.signal=i.signal);const x=await fetch(l,h);if(!x.ok){let y="UNKNOWN",v=x.statusText;try{const b=await x.json();b.code&&(y=b.code),b.message&&(v=b.message)}catch{}throw x.status===401&&qn.getState().logout(),new Ln(x.status,y,v)}return x.json()}const Nh=new Map;function xk(e,t){let a=`${V_}${e}`;if(t){const s=new URLSearchParams(t).toString();s&&(a+=`?${s}`)}return a}const ze={get(e,t,a){const i=`${nl.getState().activeWorkspaceId??""}::${xk(e,t)}`,l=Nh.get(i);if(l)return l;const u=Ic("GET",e,void 0,t,a).finally(()=>{Nh.delete(i)});return Nh.set(i,u),u},post(e,t,a){return Ic("POST",e,t,void 0,a)},put(e,t){return Ic("PUT",e,t)},delete(e){return Ic("DELETE",e)}},yk=3e4,vk=1e3,bk=3e4;class _k{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(t){this._status=t;for(const a of this.statusHandlers)a(t)}onStatusChange(t){return this.statusHandlers.add(t),()=>{this.statusHandlers.delete(t)}}connect(t){this.url=t,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(t,a){let s=this.handlers.get(t);return s||(s=new Set,this.handlers.set(t,s)),s.add(a),()=>{s.delete(a),s.size===0&&this.handlers.delete(t)}}send(t,a){if(this.ws?.readyState!==WebSocket.OPEN)return;const s={event:t,payload:a,timestamp:Date.now()};this.ws.send(JSON.stringify(s))}open(){this.setStatus("connecting");const t=new WebSocket(this.url);t.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},t.onmessage=a=>{try{const s=JSON.parse(String(a.data));if(s.event==="pong")return;const i=this.handlers.get(s.event);if(i)for(const l of i)l(s.payload)}catch{}},t.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},t.onerror=()=>{},this.ws=t}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},yk)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const t=Math.min(vk*2**this.reconnectAttempt,bk);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},t)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const Da=new _k,Wt=ns((e,t)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{e({loading:!0,error:null});try{const a=await ze.get("/libraries");e({libraries:a,loading:!1})}catch(a){e({error:a instanceof Error?a.message:"Failed to load libraries",loading:!1})}},createLibrary:async a=>{const s=await ze.post("/libraries",a);return e(i=>({libraries:[...i.libraries,s]})),s},deleteLibrary:async a=>{await ze.delete(`/libraries/${a}`),e(s=>({libraries:s.libraries.filter(i=>i.id!==a)}))},updateLibraryName:async(a,s)=>{const i=await ze.put(`/libraries/${a}`,{name:s});e(l=>({libraries:l.libraries.map(u=>u.id===a?i:u)}))},_updateLibraryOnline:(a,s)=>{e(i=>({libraries:i.libraries.map(l=>l.id===a?{...l,is_online:s}:l)}))},_refreshLibrary:async a=>{try{const s=await ze.get(`/libraries/${a}`);e(i=>({libraries:i.libraries.map(l=>l.id===a?s:l)}))}catch{t().fetchLibraries()}}})),Ui=e=>{const t=e.libraries.filter(s=>s.type==="cloud").sort((s,i)=>s.created_at.localeCompare(i.created_at)),a=e.libraries.filter(s=>s.type==="daemon").sort((s,i)=>s.name.localeCompare(i.name));return[...t,...a]},Sk=e=>e.libraries.filter(t=>t.type==="daemon");Da.on("ws:daemon:status",e=>{const t=e;t.lib_id&&Wt.getState()._updateLibraryOnline(t.lib_id,t.is_online),Wt.getState().fetchLibraries()});Da.on("ws:daemon:connected",e=>{const t=e;t.lib_id&&Wt.getState()._updateLibraryOnline(t.lib_id,!0),Wt.getState().fetchLibraries()});Da.on("ws:library:updated",e=>{const t=e;Wt.getState()._refreshLibrary(t.library_id)});function wk({name:e,avatarUrl:t,size:a=24}){const[s,i]=_.useState(!1),l=e.charAt(0).toUpperCase();return t&&!s?d.jsx("img",{src:t,alt:"",className:"rounded-full object-cover",style:{width:a,height:a},onError:()=>i(!0)}):d.jsx("span",{className:"inline-flex items-center justify-center rounded-full bg-c4a-accent font-mono font-bold text-white",style:{width:a,height:a,fontSize:a*.48},children:l})}function Nk(){const{t:e}=ye(),t=Lt(),a=qn(v=>v.user),s=qn(v=>v.logout),[i,l]=_.useState(!1),u=_.useRef(null),f=Wt(Ds(Sk)),m=f.some(v=>v.is_online),h=_.useCallback(()=>{s(),l(!1),t("/login",{replace:!0})},[s,t]),x=()=>{u.current&&clearTimeout(u.current),l(!0)},y=()=>{u.current=setTimeout(()=>l(!1),150)};return a?d.jsxs("div",{className:"relative",onMouseEnter:x,onMouseLeave:y,children:[d.jsxs("button",{className:"relative flex cursor-pointer items-center gap-1",children:[d.jsx(wk,{name:a.name,avatarUrl:a.avatar_url,size:30}),d.jsx("span",{className:`absolute right-0 top-0 h-2 w-2 rounded-full ${m?"bg-c4a-success":"bg-c4a-text-muted"}`})]}),i&&d.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 min-w-[180px] rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md",children:[d.jsxs("div",{className:"px-4 py-3",children:[d.jsx("p",{className:"text-sm text-c4a-text-primary",children:a.name}),d.jsx("p",{className:"text-xs text-c4a-text-muted",children:a.email})]}),d.jsx("div",{className:"border-t border-c4a-border-subtle",children:f.length===0?d.jsxs("button",{onClick:()=>{l(!1),t("/studio/sources/add-client")},className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-c4a-text-muted"})}),e("user.menu.connect_source")]}):f.map(v=>d.jsxs("button",{onClick:()=>{l(!1),t(`/studio/sources/${v.id}`)},className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:d.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${v.is_online?"bg-c4a-success":"bg-c4a-error"}`})}),v.name]},v.id))}),d.jsx("div",{className:"border-t border-c4a-border-subtle",children:d.jsxs("button",{onClick:h,className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(zC,{size:12,className:"shrink-0"}),e("user.menu.sign_out")]})})]})]}):null}function rm({onLoginClick:e}){const{t}=ye();return qn(s=>s.isAuthenticated)?d.jsx(Nk,{}):d.jsx(ja,{to:"/login",onClick:e,className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:t("nav.login")})}const bv=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function jk(){const{t:e}=ye(),[t,a]=_.useState(!1);return d.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[d.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[d.jsxs(ja,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[d.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),d.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),d.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[d.jsx("nav",{className:"flex items-center gap-4",children:bv.map(({to:s,labelKey:i})=>d.jsx(Ai,{to:s,end:s==="/",className:({isActive:l})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:e(i)},s))}),d.jsx(rm,{})]}),d.jsx("button",{onClick:()=>a(!t),className:"text-c4a-text-secondary md:hidden",children:t?d.jsx(br,{size:20}):d.jsx($C,{size:20})})]}),t&&d.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[d.jsx("nav",{className:"flex flex-col gap-2",children:bv.map(({to:s,labelKey:i})=>d.jsx(Ai,{to:s,end:s==="/",onClick:()=>a(!1),className:({isActive:l})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:e(i)},s))}),d.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:d.jsx(rm,{onLoginClick:()=>a(!1)})})]})]})}function Ek(e){return e==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e==="system"?"dark":e}function q_(e){if(typeof window>"u")return;const t=Ek(e);document.documentElement.setAttribute("data-theme",t),localStorage.setItem("theme",e)}function Ck(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const qm=ns(e=>({theme:Ck(),setTheme:t=>{q_(t),e({theme:t})}}));let _v=!1;function kk(){if(_v||typeof window>"u")return;_v=!0;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{theme:a}=qm.getState();a==="system"&&q_("system")};e.addEventListener("change",t)}kk();const Rk=[{mode:"light",icon:ik,labelKey:"footer.theme.light"},{mode:"dark",icon:PC,labelKey:"footer.theme.dark"},{mode:"system",icon:BC,labelKey:"footer.theme.system"}];function F_(){const{t:e}=ye(),{theme:t,setTheme:a}=qm();return d.jsx("div",{className:"flex items-center gap-1",children:Rk.map(({mode:s,icon:i,labelKey:l})=>d.jsx("button",{onClick:()=>a(s),title:e(l),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${t===s?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:d.jsx(i,{size:14})},s))})}function Y_(){const{i18n:e}=ye(),t=()=>{const a=e.language==="en"?"zh":"en";e.changeLanguage(a)};return d.jsx("button",{onClick:t,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:e.language==="en"?"CN":"EN"})}function K_({compact:e}){const{t}=ye(),a=new Date().getFullYear(),s=e?"footer.copyright_compact":"footer.copyright";return d.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:t(s,{year:a})})}const Tk="_brandIcon_1c7st_1",Ak="_iconPulse_1c7st_35",Sv={brandIcon:Tk,iconPulse:Ak};function Lk({variant:e}){const{t}=ye(),a=e==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return d.jsx("footer",{className:`border-t border-c4a-border-subtle ${a} px-4 py-4`,children:d.jsxs("div",{className:"flex items-end justify-between gap-4",children:[d.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[d.jsx("div",{className:Sv.brandIcon,children:d.jsx("span",{className:Sv.iconPulse,children:"C4A"})}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:t("footer.tagline")})]})]}),d.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(F_,{}),d.jsx(Y_,{})]}),d.jsx(K_,{})]})]})})}function Ok(){return d.jsxs("div",{className:"flex min-h-screen flex-col",children:[d.jsx(jk,{}),d.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:d.jsx(O_,{})}),d.jsx(Lk,{})]})}function Dk({onToggleSidebar:e}){return d.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:d.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[e&&d.jsx("button",{onClick:e,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:d.jsx(qC,{size:20})}),d.jsxs(ja,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[d.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),d.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),d.jsx(ja,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:d.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),d.jsx(rm,{})]})})}const Mk=e=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${e?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,zk=[{to:"/studio/modeling",icon:qE,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:YE,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:nm,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:nk,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:uk,i18nKey:"studio.sidebar.collaboration"}],Uk=[{to:"/studio/settings/api-keys",i18nKey:"settings.tab.api_keys",icon:RC}],$k=["My Drive","个人云","我的云盘"];function Hk({onNavigate:e}){const{t}=ye(),s=Ca().pathname.startsWith("/studio/settings"),[i,l]=_.useState(s);return _.useEffect(()=>{s&&l(!0)},[s]),d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>l(u=>!u),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 ${s?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[d.jsx(ek,{size:14}),t("studio.sidebar.settings"),d.jsx(rn,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${i?"rotate-90":""}`})]}),i&&d.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:Uk.map(({to:u,i18nKey:f,icon:m})=>d.jsxs(Ai,{to:u,onClick:e,className:({isActive:h})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${h?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[d.jsx(m,{size:13,className:"shrink-0 opacity-60"}),t(f)]},u))})]})}function wv({onNavigate:e}){const{t}=ye(),a=Ca(),s=Lt(),i=Wt(Ds(Ui)),l=a.pathname.startsWith("/studio/sources")||a.pathname.startsWith("/studio/source/"),[u,f]=_.useState(l);_.useEffect(()=>{l&&f(!0)},[l]);const m=h=>h.is_default&&$k.includes(h.name)?t("sources.library.default_cloud_name"):h.name;return d.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:[d.jsxs("nav",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"group/sources",children:[d.jsxs("button",{onClick:()=>f(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 ${l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[d.jsx(I_,{size:14}),t("studio.sidebar.sources"),d.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),s("/studio/sources/add-client"),e?.()},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),s("/studio/sources/add-client"),e?.())},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:t("sources.menu.add_client"),children:d.jsx(Gm,{size:12})}),d.jsx(rn,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${u?"rotate-90":""}`})]}),u&&d.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:i.map(h=>{const x=m(h);return d.jsxs(Ai,{to:`/studio/sources/${h.id}`,onClick:e,className:({isActive:y})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${y?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[h.type==="cloud"?d.jsx(eC,{size:13,className:"shrink-0 opacity-60"}):d.jsx(AC,{size:13,className:"shrink-0 opacity-60"}),d.jsx("span",{className:"truncate",children:x}),h.type==="daemon"&&(()=>{const y=h.config?.machine_id;return d.jsxs("span",{role:"button",tabIndex:0,onClick:v=>{v.preventDefault(),v.stopPropagation(),s("/studio/sources/add-client"),e?.()},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),s("/studio/sources/add-client"),e?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[d.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`}),d.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 z-50 ml-2 hidden -translate-y-1/2 whitespace-nowrap rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/dot:block",children:h.is_online?t("sources.menu.status_online",{machine:y??""}):t("sources.menu.status_offline",{machine:y??""})})]})})()]},h.id)})})]}),zk.map(({to:h,icon:x,i18nKey:y})=>d.jsxs(Ai,{to:h,onClick:e,className:({isActive:v})=>Mk(v),children:[d.jsx(x,{size:14}),t(y)]},h)),d.jsx(Hk,{...e?{onNavigate:e}:{}})]}),d.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(F_,{}),d.jsx(Y_,{})]}),d.jsx(K_,{compact:!0})]})]})}const al=ns(e=>({status:"disconnected",onlineCount:0,connections:[],setStatus:t=>e({status:t}),fetchDaemonStatus:async()=>{try{const t=await ze.get("/daemons/status");e({onlineCount:t.online_count,connections:t.connections})}catch{}}})),Bk=e=>e==="connecting"?"disconnected":e;Da.onStatusChange(e=>{al.getState().setStatus(Bk(e))});Da.on("ws:daemon:connected",e=>{const t=e;al.setState(a=>{if(a.connections.some(u=>u.machine_id===t.machine_id))return a;const i={machine_id:t.machine_id};t.lib_id&&(i.lib_id=t.lib_id);const l=[...a.connections,i];return{connections:l,onlineCount:l.length}})});Da.on("ws:daemon:status",e=>{const t=e;al.setState(a=>{if(t.is_online){if(a.connections.some(f=>f.machine_id===t.machine_id))return a;const l={machine_id:t.machine_id};t.lib_id&&(l.lib_id=t.lib_id);const u=[...a.connections,l];return{connections:u,onlineCount:u.length}}const s=a.connections.filter(i=>i.machine_id!==t.machine_id);return{connections:s,onlineCount:s.length}})});function Ik(){const e=Lt(),[t,a]=_.useState(!1),s=qn(u=>u.isAuthenticated),[i,l]=_.useState(!1);return _.useEffect(()=>{const u=qn.getState();u.isAuthenticated||u.init(),l(!0)},[]),_.useEffect(()=>{i&&!s&&e("/login",{replace:!0})},[i,s,e]),_.useEffect(()=>{!i||!s||(Wt.getState().fetchLibraries(),al.getState().fetchDaemonStatus())},[i,s]),_.useEffect(()=>{if(!(!i||!s))return Da.onStatusChange(u=>{u==="connected"&&(Wt.getState().fetchLibraries(),al.getState().fetchDaemonStatus())})},[i,s]),!i||!s?null:d.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[d.jsx(Dk,{onToggleSidebar:()=>a(!t)}),d.jsxs("div",{className:"flex min-h-0 flex-1",children:[d.jsx("div",{className:"hidden md:block",children:d.jsx(wv,{})}),t&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>a(!1)}),d.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:d.jsx(wv,{onNavigate:()=>a(!1)})})]}),d.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:d.jsx(O_,{})})]})]})}function Pk(){const{t:e}=ye();return d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[d.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:e("home.hero.title")}),d.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:e("home.hero.description")}),d.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[d.jsxs(ja,{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:[e("home.hero.cta.studio"),d.jsx(H_,{size:14})]}),d.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:e("home.hero.cta.github")})]})]})}const Gk=new Set(["github","google","feishu"]),Vk=new Set(["oidc","oauth2"]);function qk(){const{t:e}=ye(),t=Lt(),a=qn(O=>O.login),s=qn(O=>O.isAuthenticated),[i,l]=_.useState([]),[u,f]=_.useState(!0),[m,h]=_.useState(null),[x,y]=_.useState(!1);_.useEffect(()=>{s&&t("/studio",{replace:!0})},[s,t]);const v=_.useCallback(async()=>{f(!0),h(null);try{const O=await ze.get("/auth/providers");l(O)}catch{h(e("login.error"))}finally{f(!1)}},[e]);_.useEffect(()=>{v()},[v]);const b=O=>{y(!0),window.location.href=`/api/v1/auth/${O}/login`},w=async()=>{y(!0);try{const O=await ze.post("/auth/test-account/login");a(O.token),t("/studio",{replace:!0})}catch{y(!1),h(e("login.error"))}},N=i.filter(O=>Gk.has(O.type)),j=i.filter(O=>Vk.has(O.type)),E=i.find(O=>O.type==="test_account"),R=N.length>0||j.length>0,k=(N.length>0?1:0)+(j.length>0?1:0)+(E?1:0)>1;return d.jsx("div",{className:"flex flex-1 items-center justify-center px-4 py-12",children:d.jsxs("div",{className:`relative w-full max-w-sm bg-c4a-bg-surface px-8 pt-8 pb-10 transition-all duration-300 border-t-2 border-x border-b ${x?"border-transparent":"border-c4a-border-subtle border-t-c4a-accent"}`,children:[d.jsx("style",{children:`
14
+ .login-provider-btn {
15
+ position: relative;
16
+ }
17
+ .login-provider-btn::before {
18
+ content: '';
19
+ position: absolute;
20
+ inset: 0;
21
+ background: #fff;
22
+ opacity: 0;
23
+ pointer-events: none;
24
+ border-radius: inherit;
25
+ }
26
+ /* 日间:普通按钮用黑闪(更轻);主题色按钮保持白闪在橙底上更明显 */
27
+ :root[data-theme="light"] .login-provider-btn::before {
28
+ background: #000;
29
+ }
30
+ :root[data-theme="light"] .login-provider-btn:hover::before {
31
+ animation: login-btn-flash-light-soft 0.42s forwards;
32
+ }
33
+ :root[data-theme="light"] .login-test-account-btn::before {
34
+ background: #fff;
35
+ }
36
+ :root[data-theme="light"] .login-test-account-btn:hover::before {
37
+ animation: login-btn-flash-accent 0.42s forwards;
38
+ }
39
+ .login-provider-btn:hover {
40
+ animation: login-provider-hover-in 0.42s forwards;
41
+ }
42
+ /* 普通按钮:闪动再轻一档 */
43
+ .login-provider-btn:hover::before {
44
+ animation: login-btn-flash-soft 0.42s forwards;
45
+ }
46
+ .login-test-account-btn {
47
+ position: relative;
48
+ }
49
+ .login-test-account-btn::before {
50
+ content: '';
51
+ position: absolute;
52
+ inset: 0;
53
+ background: #fff;
54
+ opacity: 0;
55
+ pointer-events: none;
56
+ border-radius: inherit;
57
+ }
58
+ .login-test-account-btn:hover {
59
+ animation: login-test-account-hover-in 0.42s forwards;
60
+ }
61
+ /* 主题色按钮:白闪略加强,在橙底上更明显 */
62
+ .login-test-account-btn:hover::before {
63
+ animation: login-btn-flash-accent 0.42s forwards;
64
+ }
65
+ /* 普通按钮(暗黑):更轻 */
66
+ @keyframes login-btn-flash-soft {
67
+ 0% { opacity: 0; }
68
+ 8% { opacity: 0.04; }
69
+ 14% { opacity: 0; }
70
+ 24% { opacity: 0.04; }
71
+ 30% { opacity: 0; }
72
+ 40% { opacity: 0.04; }
73
+ 46% { opacity: 0; }
74
+ 100% { opacity: 0; }
75
+ }
76
+ /* 普通按钮(日间):黑闪更轻 */
77
+ @keyframes login-btn-flash-light-soft {
78
+ 0% { opacity: 0; }
79
+ 8% { opacity: 0.045; }
80
+ 14% { opacity: 0; }
81
+ 24% { opacity: 0.045; }
82
+ 30% { opacity: 0; }
83
+ 40% { opacity: 0.045; }
84
+ 46% { opacity: 0; }
85
+ 100% { opacity: 0; }
86
+ }
87
+ /* 主题色按钮:白闪略深一档,闪动看得清 */
88
+ @keyframes login-btn-flash-accent {
89
+ 0% { opacity: 0; }
90
+ 8% { opacity: 0.14; }
91
+ 14% { opacity: 0; }
92
+ 24% { opacity: 0.14; }
93
+ 30% { opacity: 0; }
94
+ 40% { opacity: 0.14; }
95
+ 46% { opacity: 0; }
96
+ 100% { opacity: 0; }
97
+ }
98
+ /* 边框/背景/文字尽快进入 hover 态,后面只保留 ::before 闪动 */
99
+ @keyframes login-provider-hover-in {
100
+ 0% { border-color: var(--c4a-border-default); background-color: transparent; color: var(--c4a-text-secondary); }
101
+ 18% { border-color: var(--c4a-border-strong); background-color: var(--c4a-bg-hover); color: var(--c4a-text-primary); }
102
+ 100% { border-color: var(--c4a-border-strong); background-color: var(--c4a-bg-hover); color: var(--c4a-text-primary); }
103
+ }
104
+ @keyframes login-test-account-hover-in {
105
+ 0% { filter: brightness(1); }
106
+ 100% { filter: brightness(1.1); }
107
+ }
108
+ `}),x&&d.jsxs(d.Fragment,{children:[d.jsx("style",{children:`
109
+ .login-animated-border {
110
+ stroke-dasharray: 92 8;
111
+ animation:
112
+ border-accel 2s cubic-bezier(0.33, 0, 0.67, 0.33) forwards,
113
+ border-fast 0.75s linear 2s infinite,
114
+ border-grow 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
115
+ }
116
+ @keyframes border-accel {
117
+ 0% { stroke-dashoffset: 0; }
118
+ 100% { stroke-dashoffset: -200; }
119
+ }
120
+ @keyframes border-fast {
121
+ 0% { stroke-dashoffset: 0; }
122
+ 100% { stroke-dashoffset: -100; }
123
+ }
124
+ @keyframes border-grow {
125
+ 0% { stroke-dasharray: 25 75; }
126
+ 100% { stroke-dasharray: 92 8; }
127
+ }
128
+ `}),d.jsx("svg",{className:"pointer-events-none absolute -inset-x-[1px] -bottom-[1px] -top-[2px] h-[calc(100%+3px)] w-[calc(100%+2px)] overflow-visible",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("rect",{x:"1",y:"1",width:"calc(100% - 2px)",height:"calc(100% - 2px)",fill:"none",stroke:"var(--c4a-accent)",strokeWidth:"2",pathLength:"100",className:"login-animated-border"})})]}),u&&!x&&d.jsxs("div",{className:"flex flex-col items-center gap-6",children:[d.jsx("h2",{className:"font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:e("login.loading")}),d.jsx("div",{className:"h-0.5 w-16 animate-pulse bg-c4a-accent/40"})]}),!u&&!x&&m&&d.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d.jsx("p",{className:"text-xs text-c4a-error",children:m}),d.jsx("button",{onClick:v,className:"border border-c4a-border-default bg-transparent px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("login.retry")})]}),!u&&!m&&d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsx("h2",{className:"text-center font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:e("login.title")}),d.jsxs("div",{className:"flex flex-col gap-2",children:[N.map(O=>d.jsx(Nv,{provider:O,onClick:()=>b(O.id),label:e("login.provider_cta",{name:O.display_name}),disabled:x},O.id)),N.length>0&&j.length>0&&d.jsx(jv,{label:e("login.or")}),j.map(O=>d.jsx(Nv,{provider:O,onClick:()=>b(O.id),label:e("login.provider_cta",{name:O.display_name}),disabled:x},O.id)),R&&E&&k&&d.jsx(jv,{label:e("login.or")}),E&&d.jsxs("button",{disabled:x,onClick:w,className:"login-test-account-btn flex h-11 w-full cursor-pointer items-center justify-center gap-3 bg-c4a-accent font-mono text-xs font-bold uppercase tracking-widest text-white transition-all duration-300 disabled:cursor-not-allowed",children:[E.icon&&d.jsx("img",{src:E.icon,alt:"",className:"relative z-10 h-5 w-5 shrink-0 opacity-90"}),d.jsx("span",{className:`relative z-10 ${x?"opacity-50":""}`,children:e("login.provider_cta",{name:e("login.test_account")})})]})]})]})]})})}function Nv({provider:e,onClick:t,label:a,disabled:s}){return d.jsxs("button",{onClick:t,disabled:s,className:"group login-provider-btn flex h-11 w-full cursor-pointer items-center justify-center gap-3 border border-c4a-border-default bg-transparent font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-all duration-150 ease-out disabled:cursor-not-allowed",children:[e.icon&&d.jsx("img",{src:e.icon,alt:"",className:"login-provider-btn-icon relative z-10 h-5 w-5 shrink-0 opacity-70 grayscale transition-all duration-150 ease-out group-hover:opacity-100 group-hover:grayscale-0 group-disabled:opacity-100 group-disabled:grayscale-0"}),d.jsx("span",{className:`relative z-10 ${s?"opacity-50":""}`,children:a})]})}function jv({label:e}){return d.jsxs("div",{className:"flex items-center gap-3 py-1",children:[d.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"}),d.jsx("span",{className:"font-mono text-xs uppercase text-c4a-text-muted",children:e}),d.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"})]})}const Fk="animate-pulse font-mono text-xs uppercase tracking-tight text-c4a-text-muted";function Fm({labelKey:e="login.loading",className:t}){const{t:a}=ye();return d.jsx("span",{className:t??Fk,children:a(e)})}function Yk(){const e=Lt(),t=qn(a=>a.login);return _.useEffect(()=>{const s=new URLSearchParams(window.location.search).get("token");if(s){t(s);const i=qn.getState().isAuthenticated;e(i?"/studio":"/login",{replace:!0})}else e("/login",{replace:!0})},[t,e]),d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(Fm,{labelKey:"login.authenticating",className:"animate-pulse font-mono text-sm uppercase tracking-tight text-c4a-text-muted"})})}function Cn({icon:e,title:t,description:a,action:s,fullPage:i}){const l=d.jsxs("div",{className:i?"w-full max-w-[800px] text-center":"flex flex-col items-center text-center",children:[e&&d.jsx("div",{className:"mb-3 text-c4a-text-muted",children:e}),i?d.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:t}):d.jsx("p",{className:"font-mono text-sm text-c4a-text-secondary",children:t}),d.jsx("p",{className:`mt-2 ${i?"mt-3 text-sm text-c4a-text-secondary":"max-w-md text-xs text-c4a-text-muted"}`,children:a}),s&&d.jsx("div",{className:i?"mt-6 flex justify-center":"mt-4",children:s})]});return d.jsx("div",{className:`flex flex-1 items-center justify-center ${i?"p-8 pb-24":"p-8 pb-23"}`,children:l})}function Xa({title:e,version:t,description:a}){const{t:s}=ye();return d.jsx(Cn,{fullPage:!0,title:e,description:a,action:t?d.jsx("span",{className:"inline-block rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1 font-mono text-xs uppercase text-c4a-accent",children:s("placeholder.coming",{version:t})}):void 0})}function Kk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.docs.title"),version:"0.4.13",description:e("page.docs.description")})}function Xk(){const{t:e}=ye();return d.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[d.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:e("notfound.title")}),d.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:e("notfound.description")}),d.jsx(ja,{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:e("notfound.back")})]})}function Ev(){const{t:e}=ye(),t=A_();let a="500",s=e("error.description");return Ti(t)?(a=String(t.status),t.status===404?s=e("notfound.description"):t.statusText&&(s=t.statusText)):t instanceof Error&&(s=t.message),console.error(`[ErrorPage] ${a}:`,t),d.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[d.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:a}),d.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:s}),d.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[d.jsxs("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[d.jsx(ZC,{size:14}),e("error.reload")]}),d.jsx(ja,{to:"/",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("notfound.back")})]})]})}function Qk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.modeling.title"),version:"0.4.16",description:e("page.modeling.description")})}function Zk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.brain.title"),version:"0.4.18",description:e("page.brain.description")})}function Jk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.discovery.title"),version:"0.6.x",description:e("page.discovery.description")})}function Wk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.sharing.title"),version:"0.4.39",description:e("page.sharing.description")})}function eR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.collaboration.title"),version:"0.5.x",description:e("page.collaboration.description")})}function Qa({children:e,onClose:t,className:a="",overlayClass:s="bg-black/50",closeOnOverlay:i=!0,closeOnEsc:l=!0,disableClose:u=!1}){const f=_.useRef(null);_.useEffect(()=>{if(!l)return;const h=x=>{x.key==="Escape"&&!u&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[t,l,u]);const m=_.useCallback(h=>{i&&!u&&f.current&&!f.current.contains(h.target)&&t()},[t,i,u]);return d.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${s}`,onClick:m,children:d.jsx("div",{ref:f,className:a,children:e})})}function tR(){const{t:e}=ye(),[t,a]=_.useState([]),[s,i]=_.useState(!0),[l,u]=_.useState(!1),[f,m]=_.useState(null),h=[{label:e("page.settings.title")},{label:e("settings.tab.api_keys")}],x=_.useCallback(async()=>{i(!0);try{const b=await ze.get("/auth/api-keys");a(b)}catch{}finally{i(!1)}},[]);_.useEffect(()=>{x()},[x]);const y=b=>{u(!1),m(b),x()},v=async b=>{if(confirm(e("api_keys.delete.confirm")))try{await ze.delete(`/auth/api-keys/${b}`),x()}catch{}};return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:h.map((b,w)=>{const N=w===h.length-1;return d.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[w>0&&d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"}),d.jsx("span",{className:N?"text-c4a-text-primary":"",children:b.label})]},w)})}),s&&d.jsx("div",{className:"flex flex-1 items-center justify-center pb-24",children:d.jsx(Fm,{})}),!s&&t.length===0&&d.jsx(Cn,{fullPage:!0,title:e("api_keys.empty.title"),description:e("api_keys.empty.description"),action:d.jsx("button",{onClick:()=>u(!0),className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent",children:e("api_keys.create")})}),!s&&t.length>0&&d.jsxs("div",{className:"mt-4",children:[d.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[d.jsx("p",{className:"text-xs text-c4a-text-muted",children:e("api_keys.description")}),d.jsxs("button",{onClick:()=>u(!0),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[d.jsx(Gm,{size:14}),e("api_keys.create")]})]}),d.jsx("div",{className:"flex flex-col gap-3",children:t.map(b=>d.jsx(nR,{apiKey:b,onDelete:()=>v(b.id)},b.id))})]}),l&&d.jsx(aR,{onClose:()=>u(!1),onCreated:y}),f&&d.jsx(rR,{apiKey:f,onClose:()=>m(null)})]})}function nR({apiKey:e,onDelete:t}){const{t:a}=ye(),s=e.last_used_at?new Date(e.last_used_at).toLocaleDateString():a("api_keys.never_used"),i=new Date(e.created_at).toLocaleDateString();return d.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-mono text-sm text-c4a-text-primary",children:e.name}),d.jsxs("p",{className:"mt-1 text-xs text-c4a-text-muted",children:[d.jsxs("span",{className:"font-mono",children:[e.key_prefix,"****"]}),d.jsx("span",{className:"mx-2",children:"·"}),s]}),d.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:a("api_keys.created_at",{date:i})})]}),d.jsx("button",{onClick:t,className:"cursor-pointer p-1 text-c4a-text-muted transition-colors hover:text-c4a-error",title:"Delete",children:d.jsx(Vm,{size:14})})]})})}function aR({onClose:e,onCreated:t}){const{t:a}=ye(),[s,i]=_.useState(""),[l,u]=_.useState("never"),[f,m]=_.useState(!1),h=_.useRef(null),[x,y]=_.useState(!1),v=[{value:"never",label:a("api_keys.expires.never")},{value:"30d",label:a("api_keys.expires.30d")},{value:"90d",label:a("api_keys.expires.90d")},{value:"1y",label:a("api_keys.expires.1y")}],b=v.find(N=>N.value===l);_.useEffect(()=>{if(!f)return;const N=j=>{h.current&&!h.current.contains(j.target)&&m(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[f]);const w=async()=>{if(s.trim()){y(!0);try{const N=sR(l),j=await ze.post("/auth/api-keys",{name:s.trim(),scope:["read"],expires_at:N});t(j)}catch{y(!1)}}};return d.jsxs(Qa,{onClose:e,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",children:[d.jsx("h2",{className:"mb-6 font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:a("api_keys.create")}),d.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:a("api_keys.form.name")}),d.jsx("input",{value:s,onChange:N=>i(N.target.value),placeholder:a("api_keys.form.name_placeholder"),className:"mb-4 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none"}),d.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:a("api_keys.form.expiry")}),d.jsxs("div",{ref:h,className:"relative mb-6",children:[d.jsxs("button",{type:"button",onClick:()=>m(N=>!N),className:"flex w-full cursor-pointer items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary transition-colors hover:border-c4a-border-strong",children:[d.jsx("span",{children:b?.label}),d.jsx(rn,{size:14,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${f?"rotate-90":""}`})]}),f&&d.jsx("div",{className:"absolute left-0 top-full z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:v.map(N=>d.jsxs("button",{type:"button",onClick:()=>{u(N.value),m(!1)},className:`flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors hover:bg-c4a-bg-hover ${N.value===l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[d.jsx(ts,{size:12,className:`shrink-0 ${N.value===l?"opacity-100":"opacity-0"}`}),N.label]},N.value))})]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx("button",{onClick:e,disabled:x,className:"cursor-pointer rounded border border-c4a-border-default px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:a("common.cancel")}),d.jsx("button",{onClick:w,disabled:!s.trim()||x,className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent disabled:opacity-50",children:a("api_keys.create")})]})]})}function rR({apiKey:e,onClose:t}){const{t:a}=ye(),[s,i]=_.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(e.key),i(!0),setTimeout(()=>i(!1),2e3)}catch{const u=document.querySelector("[data-api-key-value]");if(u){const f=document.createRange();f.selectNodeContents(u);const m=window.getSelection();m?.removeAllRanges(),m?.addRange(f)}}};return d.jsxs(Qa,{onClose:t,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",closeOnOverlay:!1,closeOnEsc:!1,children:[d.jsx("h2",{className:"mb-4 font-mono text-sm uppercase tracking-tight text-c4a-accent",children:a("api_keys.created")}),d.jsx("p",{className:"mb-4 text-sm text-c4a-text-secondary",children:a("api_keys.copy_warning")}),d.jsxs("div",{className:"mb-6 flex items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-base px-3 py-2",children:[d.jsx("code",{"data-api-key-value":!0,className:"flex-1 truncate font-mono text-xs text-c4a-text-primary",children:e.key}),d.jsx("button",{onClick:l,className:"cursor-pointer shrink-0 font-mono text-xs uppercase text-c4a-accent transition-colors hover:text-c4a-accent/80",children:a(s?"api_keys.copied":"api_keys.copy")})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx("button",{onClick:t,className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent",children:a("api_keys.done")})})]})}function sR(e){if(e==="never")return null;const t=new Date;switch(e){case"30d":t.setDate(t.getDate()+30);break;case"90d":t.setDate(t.getDate()+90);break;case"1y":t.setFullYear(t.getFullYear()+1);break;default:return null}return t.toISOString()}function iR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.code_setup.title"),version:"0.4.13",description:e("page.code_setup.description")})}function oR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.code_compile.title"),version:"0.4.13",description:e("page.code_compile.description")})}function lR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.code_review.title"),version:"0.4.14",description:e("page.code_review.description")})}function cR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.code_result.title"),version:"0.4.14",description:e("page.code_result.description")})}const Bu=(e,t)=>{for(const a of e){if(a.path===t)return a;if(a.children){const s=Bu(a.children,t);if(s)return s}}return null},uR=(e,t)=>t===""?e:Bu(e,t)?.children??[],Go=(e,t)=>{if(!t)return[];const a=t.split("/"),s=[];let i="";for(const l of a){i=i?`${i}/${l}`:l;const u=Bu(e,i);u&&s.push(u)}return s},Iu=ns(e=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:t,limit:a,offset:s})=>{e({loading:!0,error:null});try{const i={library_id:t};a!==void 0&&(i.limit=String(a)),s!==void 0&&(i.offset=String(s));const l=await ze.get("/sources",i);e({rootSources:l.items,total:l.total,limit:l.limit,offset:l.offset,loading:!1})}catch(i){e({error:i instanceof Error?i.message:"Failed to load sources",loading:!1})}},fetchRootSource:async t=>{e({loading:!0,error:null,currentRoot:null});try{const a=await ze.get(`/sources/${t}`);return e({currentRoot:a,loading:!1}),a}catch(a){throw e({currentRoot:null,loading:!1,error:a instanceof Error?a.message:"Source not found"}),a}},createSource:async t=>await ze.post("/sources",t),addTreeNode:async(t,a)=>{const s=await ze.post(`/sources/${t}/tree`,a);return e(i=>({rootSources:i.rootSources.map(l=>l.id===t?s:l),currentRoot:i.currentRoot?.id===t?s:i.currentRoot})),s},updateSource:async(t,a)=>{const s=await ze.put(`/sources/${t}`,a);e(i=>({rootSources:i.rootSources.map(l=>l.id===t?s:l),currentRoot:i.currentRoot?.id===t?s:i.currentRoot}))},deleteSource:async t=>{await ze.delete(`/sources/${t}`),e(a=>({rootSources:a.rootSources.filter(s=>s.id!==t),currentRoot:a.currentRoot?.id===t?null:a.currentRoot}))},deleteTreeNode:async(t,a)=>{const s=await ze.delete(`/sources/${t}/tree?path=${encodeURIComponent(a)}`);return e(i=>({rootSources:i.rootSources.map(l=>l.id===t?s:l),currentRoot:i.currentRoot?.id===t?s:i.currentRoot})),s},uploadDoc:async t=>await ze.post("/sources/upload",t),setFilter:t=>e({filter:t}),clearSources:()=>e({rootSources:[],currentRoot:null,total:0,offset:0})}));function As({segments:e}){const{t}=ye(),a=_.useRef(null),s=_.useRef(null),[i,l]=_.useState(0),u=[{label:t("sources.breadcrumb.sources")},...e],f=Math.max(0,u.length-3);_.useEffect(()=>{const h=a.current,x=s.current;if(!h||!x)return;const y=()=>{const b=h.clientWidth,w=Array.from(x.children);if(w.length===0)return;const N=w.map(H=>H.offsetWidth),j=4;if(N.reduce((H,T)=>H+T,0)+j*(N.length-1)<=b){l(0);return}const R=20,k=(N[0]??0)+(N[1]??0)+j,O=N[N.length-1]??0,I=k+j+R+j+O;let B=f;for(let H=1;H<=f;H++){let T=0;for(let P=2+H;P<N.length-1;P++)T+=N[P]+j;if(I+T<=b){B=H;break}}l(B)};y();const v=new ResizeObserver(y);return v.observe(h),()=>v.disconnect()},[f,e,t]);const m=(()=>{if(i===0||u.length<=3)return u;const h=u.slice(0,2),x=u[u.length-1],y=u.slice(2+i,u.length-1);return[...h,{label:"…"},...y,x]})();return d.jsxs("div",{ref:a,className:"relative min-w-0 overflow-hidden",children:[d.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs tracking-tight text-c4a-text-muted",children:m.map((h,x)=>{const y=x===m.length-1;return d.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${x===0?"uppercase":""}`,children:[x>0&&d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!y?d.jsx(ja,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):d.jsx("span",{className:`whitespace-nowrap ${y?"text-c4a-text-primary":""}`,children:h.label})]},x)})}),d.jsx("div",{ref:s,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 items-center gap-1 overflow-visible whitespace-nowrap font-mono text-xs tracking-tight",children:u.map((h,x)=>d.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[x>0&&d.jsx(rn,{size:12}),d.jsx("span",{className:"whitespace-nowrap",children:h.label})]},x))})]})}const dR=["all","indexed","not_indexed"];function fR({value:e,onChange:t}){const{t:a}=ye(),[s,i]=_.useState(!1),l=_.useRef(null),u=_.useRef(null),f={all:a("sources.filter.all"),indexed:a("sources.filter.indexed"),not_indexed:a("sources.filter.not_indexed")},m=_.useCallback(y=>{l.current&&!l.current.contains(y.target)&&i(!1)},[]);_.useEffect(()=>{if(s)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s,m]);const h=_.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),i(!0)},[]),x=_.useCallback(()=>{u.current=setTimeout(()=>i(!1),150)},[]);return d.jsxs("div",{ref:l,className:"relative",onMouseEnter:h,onMouseLeave:x,children:[d.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:[d.jsx(OC,{size:12}),d.jsx("span",{className:"hidden sm:inline",children:f[e]}),d.jsx(rn,{size:12,className:`hidden transition-transform duration-200 sm:block ${s?"rotate-90":""}`})]}),s&&d.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:dR.map(y=>d.jsxs("button",{onClick:()=>{t(y),i(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${y===e?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[d.jsx(ts,{size:12,className:y===e?"opacity-100":"opacity-0"}),f[y]]},y))})]})}function X_({currentName:e,onConfirm:t,onCancel:a,error:s}){const[i,l]=_.useState(e),u=_.useRef(null);_.useEffect(()=>{u.current?.select()},[]);const f=_.useCallback(()=>{const h=i.trim();h&&h!==e?t(h):a()},[i,e,t,a]),m=_.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),f()):h.key==="Escape"&&a()},[f,a]);return d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{ref:u,value:i,onChange:h=>l(h.target.value),onKeyDown:m,onBlur:f,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}),d.jsx("button",{onClick:h=>{h.stopPropagation(),f()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:d.jsx(ts,{size:14})}),d.jsx("button",{onClick:h=>{h.stopPropagation(),a()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:d.jsx(br,{size:14})}),s&&d.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:s})]})}const hR=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),mR=new Set([".ts",".tsx",".md"]),pR=new Set([".md",".txt",".ts",".tsx",".doc",".docx",".pdf",".ppt",".pptx"]),gR=new Set([".md",".txt"]),xR=5*1024*1024,yR=10;function sm(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}function vR(e){const t=e.includes("/")?e.split("/").pop():e;if(hR.has(t.toLowerCase()))return!0;const a=sm(t);return mR.has(a)}const bR=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const a=i=>String(i).padStart(2,"0"),s=`${a(t.getMonth()+1)}-${a(t.getDate())} ${a(t.getHours())}:${a(t.getMinutes())}`;return t.getFullYear()===new Date().getFullYear()?s:`${t.getFullYear()}-${s}`},Cv={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function _R({source:e,isDaemonLibrary:t,isRepoRoot:a}){const{t:s}=ye(),i=e.kind==="source",l=i&&(e.source_type==="code"||vR(e.name)),u=l?"text-c4a-accent":"text-c4a-text-secondary group-hover:text-c4a-accent",f=e.metadata?.origin==="remote";let m;if(e.kind==="folder"?m=a||f?d.jsx(Hu,{size:16,className:`shrink-0 ${u}`}):t?d.jsx(hC,{size:16,className:`shrink-0 ${u}`}):d.jsx(_a,{size:16,className:`shrink-0 ${u}`}):e.source_type==="code"?m=d.jsx(Ei,{size:16,className:`shrink-0 ${u}`}):m=d.jsx(Wr,{size:16,className:`shrink-0 ${u}`}),!i||!l)return d.jsx(d.Fragment,{children:m});const h=Cv[e.index_status]??Cv.none,x=s(`sources.status.${e.index_status}`);return d.jsxs("span",{className:"group/dot relative shrink-0",children:[m,d.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${h}`}),d.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:x})]})}function kv({source:e,displayName:t,childCount:a,isDaemonLibrary:s,isRepoRoot:i,hasUpdate:l,onClick:u,onRename:f,onDelete:m}){const{t:h}=ye(),[x,y]=_.useState(!1),[v,b]=_.useState(null),w=_.useCallback(async k=>{if(!f)return;const O=await f(k);O?b(O):(y(!1),b(null))},[f]),N=_.useCallback(()=>{y(!1),b(null)},[]),j=!i&&f,E=m,R=e.updated_at||e.created_at;return d.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:x?void 0:u,children:[d.jsx(_R,{source:e,isDaemonLibrary:s??!1,isRepoRoot:i??!1}),x?d.jsx("div",{className:"min-w-0 flex-1",onClick:k=>k.stopPropagation(),children:d.jsx(X_,{currentName:e.name,onConfirm:w,onCancel:N,error:v})}):d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-secondary group-hover:text-c4a-accent",children:t??e.name}),d.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l&&d.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:[d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-c4a-accent"}),h("sources.change_detection.has_updates")]}),e.kind==="folder"&&a!==void 0&&d.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:a})}),R&&d.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:bR(R)})]}),(j||E)&&d.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[j?d.jsx("button",{title:h("sources.actions.rename"),onClick:k=>{k.stopPropagation(),y(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:d.jsx(tm,{size:14})}):E?d.jsx("span",{className:"p-1",children:d.jsx("span",{className:"inline-block h-[14px] w-[14px]"})}):null,E&&d.jsx("button",{title:h("sources.actions.delete"),onClick:k=>{k.stopPropagation(),m()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:d.jsx(Vm,{size:14})})]})]})}function Rv({target:e,onConfirm:t,onCancel:a}){const{t:s}=ye();return d.jsxs(Qa,{onClose:a,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:s("sources.delete.confirm_title")}),d.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[e.type==="resource"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:s("sources.delete.resource",{name:e.name})}),d.jsx("p",{children:s("sources.delete.resource_impact")}),d.jsx("p",{className:"text-c4a-warning",children:s("sources.delete.session_warning")}),d.jsx("p",{children:s("sources.delete.entity_safe")})]}),e.type==="folder"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:s("sources.delete.folder",{name:e.name})}),e.folderCount!==void 0&&e.sourceCount!==void 0?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:s("sources.delete.folder_contents",{folders:e.folderCount,sources:e.sourceCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&d.jsx("p",{children:s("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.sourceCount})})]}):d.jsx("p",{children:s("sources.delete.folder_impact_generic")}),d.jsx("p",{className:"text-c4a-warning",children:s("sources.delete.irreversible")})]}),e.type==="repo"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:s("sources.delete.repo",{name:e.name,library:e.libraryName})}),e.packageCount!==void 0&&e.docCount!==void 0?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:s("sources.delete.repo_contents",{packages:e.packageCount,docs:e.docCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&d.jsx("p",{children:s("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.packageCount+e.docCount})})]}):d.jsx("p",{children:s("sources.delete.repo_impact_generic")}),d.jsx("p",{children:s("sources.delete.local_safe")}),d.jsx("p",{children:s("sources.delete.entity_safe")})]}),e.type==="client"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:s("sources.delete.client",{name:e.name})}),d.jsx("p",{children:s("sources.delete.client_impact")}),d.jsx("p",{children:s("sources.delete.local_safe")}),d.jsx("p",{children:s("sources.delete.entity_safe")}),d.jsx("p",{className:"text-c4a-warning",children:s("sources.delete.irreversible")}),d.jsx("p",{className:"text-c4a-text-muted",children:s("sources.delete.client_reregister")})]})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:a,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:s("common.cancel")}),d.jsx("button",{onClick:t,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:s("common.confirm")})]})]})}function SR({onConfirm:e,onCancel:t,error:a}){const{t:s}=ye(),[i,l]=_.useState(""),u=_.useRef(null);_.useEffect(()=>{u.current?.focus()},[]);const f=_.useCallback(()=>{const h=i.trim();h&&e(h)},[i,e]),m=_.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),f())},[f]);return d.jsxs(Qa,{onClose:t,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(G_,{size:16,className:"shrink-0 text-c4a-accent"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:s("sources.actions.new_folder")})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("input",{ref:u,value:i,onChange:h=>l(h.target.value),onKeyDown:m,placeholder:s("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}),a&&d.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:a})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:t,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:s("common.cancel")}),d.jsx("button",{onClick:f,disabled:!i.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:s("common.confirm")})]})]})}function jh({label:e,icon:t,items:a,alignRight:s}){const[i,l]=_.useState(!1),u=_.useRef(null),f=_.useRef(null),m=_.useCallback(y=>{u.current&&!u.current.contains(y.target)&&l(!1)},[]);_.useEffect(()=>{if(i)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i,m]);const h=_.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),l(!0)},[]),x=_.useCallback(()=>{f.current=setTimeout(()=>l(!1),150)},[]);return d.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:x,children:[d.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 ${e?"p-1 sm:px-2 sm:py-1":"p-1"}`,children:[t,e&&d.jsx("span",{className:"hidden sm:inline",children:e}),e&&d.jsx(rn,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&d.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 ${s?"right-0":"left-0"}`,children:a.map(y=>d.jsxs("button",{onClick:()=>{y.onClick(),l(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[y.icon,y.label]},y.label))})]})}function wR({onClose:e}){const{t}=ye();return d.jsxs(Qa,{onClose:e,closeOnEsc:!1,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(rk,{size:18,className:"text-c4a-accent"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:t("sources.upgrade.title")})]}),d.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:t("sources.upgrade.description")}),d.jsx("div",{className:"mt-6 flex justify-end",children:d.jsx("button",{onClick:e,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:t("common.confirm")})})]})}function NR(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function jR({onConfirm:e,onCancel:t,error:a,uploading:s}){const{t:i}=ye(),[l,u]=_.useState([]),[f,m]=_.useState(null),[h,x]=_.useState(!1),[y,v]=_.useState(!1),b=_.useRef(null),w=_.useCallback(B=>{m(null);for(const H of B){const T=sm(H.name);if(!pR.has(T)){m(i("sources.upload.unsupported_type",{name:H.name}));return}if(H.size>xR){m(i("sources.upload.file_too_large",{name:H.name}));return}}u(H=>{const T=new Map(H.map(X=>[X.name,X]));for(const X of B)T.set(X.name,{name:X.name,size:X.size,file:X});const P=Array.from(T.values());return P.length>yR?(m(i("sources.upload.too_many_files")),H):P})},[i]),N=_.useCallback(B=>{const H=B.target.files;!H||H.length===0||(w(Array.from(H)),B.target.value="")},[w]),j=_.useCallback(B=>{u(H=>H.filter((T,P)=>P!==B)),m(null)},[]),E=_.useCallback(B=>{B.preventDefault(),x(!1);const H=B.dataTransfer?.files;!H||H.length===0||w(Array.from(H))},[w]),R=_.useCallback(B=>{B.preventDefault(),x(!0)},[]),k=_.useCallback(B=>{B.preventDefault(),x(!1)},[]),O=_.useCallback(async()=>{if(!(l.length===0||y)){v(!0);try{const B=await Promise.all(l.map(H=>new Promise((T,P)=>{const X=sm(H.name),de=gR.has(X),le=new FileReader;le.onerror=()=>P(le.error),de?(le.onload=()=>T({name:H.name,content:le.result,encoding:"utf-8"}),le.readAsText(H.file)):(le.onload=()=>{const ce=le.result,D=ce.slice(ce.indexOf(",")+1);T({name:H.name,content:D,encoding:"base64"})},le.readAsDataURL(H.file))})));e(B)}catch{v(!1)}}},[l,y,e]),I=a||f;return d.jsxs(Qa,{onClose:t,disableClose:y||(s??!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:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(am,{size:16,className:"shrink-0 text-c4a-accent"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.upload.title")})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("input",{ref:b,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:N,className:"hidden"}),d.jsxs("button",{type:"button",onClick:()=>b.current?.click(),onDrop:E,onDragOver:R,onDragLeave:k,disabled:y||s,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"} ${y||s?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[d.jsx(am,{size:24,className:"text-c4a-text-muted"}),d.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:i("sources.upload.drop_hint")}),d.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:i("sources.upload.supported_formats")})]})]}),l.length>0&&d.jsxs("div",{className:"mt-3",children:[d.jsx("p",{className:"text-xs text-c4a-text-muted",children:i("sources.upload.selected",{count:l.length})}),d.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:l.map((B,H)=>d.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[d.jsx(Wr,{size:12,className:"shrink-0 text-c4a-text-muted"}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:B.name}),d.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:NR(B.size)}),!y&&!s&&d.jsx("button",{type:"button",onClick:()=>j(H),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:i("sources.upload.remove"),children:d.jsx(br,{size:12})})]},`${B.name}-${H}`))})]}),I&&d.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:I}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:t,disabled:y||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 disabled:opacity-40",children:i("common.cancel")}),d.jsxs("button",{onClick:O,disabled:l.length===0||y||s,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:[(y||s)&&d.jsx(fn,{size:12,className:"animate-spin"}),i(y||s?"sources.upload.uploading":"common.confirm")]})]})]})}const ER=/^v\d+\.\d+\.\d+$/;function im(e){const t=/^v(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function CR(e,t){const a=im(e),s=im(t);return!a||!s?!1:a[0]!==s[0]?a[0]>s[0]:a[1]!==s[1]?a[1]>s[1]:a[2]>s[2]}function kR(e){const t=im(e);return t?`v${t[0]}.${t[1]}.${t[2]+1}`:"v0.0.1"}function RR({currentVersion:e,onConfirm:t,onCancel:a,uploading:s,serverError:i}){const{t:l}=ye(),[u,f]=_.useState(()=>kR(e)),m=_.useMemo(()=>ER.test(u)?CR(u,e)?null:l("upload.version_must_increase",{version:e}):l("upload.version_must_increase",{version:e}),[u,e,l]),h=_.useCallback(()=>{m||s||t(u)},[m,s,t,u]);return d.jsxs(Qa,{onClose:a,disableClose:s??!1,className:"mx-4 w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("upload.new_version_title")}),d.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("upload.new_version_desc")}),d.jsxs("div",{className:"mt-4",children:[d.jsx("label",{className:"block text-xs text-c4a-text-muted uppercase",children:l("upload.version_label")}),d.jsx("input",{type:"text",value:u,onChange:x=>f(x.target.value),disabled:s,className:"mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-1.5 font-mono text-sm text-c4a-text-primary focus:border-c4a-accent focus:outline-none disabled:opacity-40"}),d.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:l("upload.current_version",{version:e})}),m&&d.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:m}),i&&!m&&d.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:i})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:a,disabled: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 disabled:opacity-40",children:l("common.cancel")}),d.jsxs("button",{type:"button",onClick:h,disabled:!!m||s,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:[s&&d.jsx(fn,{size:12,className:"animate-spin"}),l("upload.confirm")]})]})]})}function TR({pathLabel:e,loading:t,badge:a,onNavigateUp:s,children:i}){return d.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[d.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:e}),a]}),d.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),d.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:t?d.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:d.jsx(fn,{size:14,className:"animate-spin text-c4a-text-muted"})}):d.jsxs(d.Fragment,{children:[s&&d.jsxs("button",{onClick:s,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(_a,{size:16,className:"shrink-0 text-c4a-text-muted"}),d.jsx("span",{children:".."})]}),i]})})]})}function AR(e){const t=e.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(t){const a=t[1],s=t[2];return{slug:s,repoUrl:`https://${a}/${s}`,host:a}}try{const a=new URL(e),s=a.hostname,i=a.pathname.replace(/^\//,"").replace(/\.git$/,"");return i?{slug:i,repoUrl:`https://${s}/${i}`,host:s}:null}catch{return null}}function LR(e,t){return`${e}/tree/${encodeURIComponent(t)}`}function OR(e,t){return`${e}/commit/${t}`}function Q_({remoteUrl:e,fallbackName:t,branch:a,commit:s}){const i=e?AR(e):null,l=s.slice(0,7);return d.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:[i?d.jsxs("a",{href:i.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:i.repoUrl,children:[d.jsx(dv,{size:12,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:i.slug})]}):d.jsxs("span",{className:"flex items-center gap-1 truncate",children:[d.jsx(dv,{size:12,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:t||"repo"})]}),d.jsx("span",{className:"text-c4a-text-muted",children:"/"}),i?d.jsxs("a",{href:LR(i.repoUrl,a),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[d.jsx(em,{size:10,className:"shrink-0"}),d.jsx("span",{children:a})]}):d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(em,{size:10,className:"shrink-0"}),d.jsx("span",{children:a})]}),d.jsx("span",{className:"text-c4a-text-muted",children:"/"}),i?d.jsx("a",{href:OR(i.repoUrl,s),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:l}):d.jsx("span",{children:l})]})}function DR(e,t,a){const[s,i]=_.useState({}),l=_.useRef(new Set);return _.useEffect(()=>{if(!e||!t||a.length===0)return;const u=a.filter(f=>{const m=f.metadata;return m?.origin==="remote"&&m?.remote_url&&m?.remote_commit&&!l.current.has(f.id)});if(u.length!==0){u.forEach(f=>l.current.add(f.id));for(const f of u){const m=f.metadata;ze.post("/import/remote/refs",{library_id:e,url:m.remote_url}).then(h=>{const x=m.remote_ref||"",y=h.branches?.find(v=>v.name===x)??h.tags?.find(v=>v.name===x);y&&y.commit!==m.remote_commit&&i(v=>({...v,[f.id]:!0}))}).catch(()=>{})}}},[e,t,a]),s}function MR({library:e,onNewFolder:t,onUploadDoc:a,onImportRepo:s,onImportDir:i,onUpgrade:l}){const{t:u}=ye(),f=e.type==="daemon",m="rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",h=f?d.jsxs("div",{className:"flex gap-3",children:[i&&d.jsx("button",{onClick:i,disabled:!e.is_online,className:m,children:u("sources.actions.import_dir")}),s&&d.jsx("button",{onClick:s,disabled:!e.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")})]}):d.jsxs("div",{className:"flex gap-3",children:[d.jsx("button",{onClick:t,className:m,children:u("sources.actions.new_folder")}),a&&d.jsx("button",{onClick:a,className:m,children:u("sources.actions.upload_document")}),l&&d.jsx("button",{onClick:l,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")})]});return d.jsx(Cn,{fullPage:!0,title:u(f?"sources.empty.daemon.title":"sources.empty.cloud.title"),description:u(f?"sources.empty.daemon.description":"sources.empty.cloud.description"),action:h})}function zR(){const{t:e}=ye();return d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[d.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:e("sources.empty.indexed.title")}),d.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:e("sources.empty.indexed.description")})]})}const Eh=e=>{let t=0,a=0,s=0,i=0,l=0;const u=f=>{for(const m of f.children??[])m.kind==="folder"?(t++,u(m)):m.kind==="source"&&(a++,m.source_type==="code"?s++:i++,(m.index_status==="indexed"||m.index_status==="stale")&&l++)};return u(e),{folders:t,sources:a,codeSources:s,docSources:i,indexedSources:l}};function UR(){const{t:e}=ye(),t=Lt(),{libId:a}=xl(),[s,i]=$u(),l=s.get("rootId")||null,u=s.get("path")||"",m=Wt(Ds(Ui)).find(se=>se.id===a),h=Wt(se=>se.updateLibraryName),x=Wt(se=>se.deleteLibrary),{rootSources:y,currentRoot:v,loading:b,filter:w,fetchRootSources:N,fetchRootSource:j,createSource:E,addTreeNode:R,updateSource:k,deleteSource:O,deleteTreeNode:I,uploadDoc:B,setFilter:H}=Iu(),[T,P]=_.useState(!1),[X,de]=_.useState(null),[le,ce]=_.useState(null),[D,F]=_.useState(null),[A,G]=_.useState(null),[ae,ee]=_.useState(!1),[J,L]=_.useState(!1),[q,re]=_.useState(null),[ie,ge]=_.useState(!1),[xe,Ee]=_.useState(null),[De,qe]=_.useState(null),[vn,zn]=_.useState(!1),[$t,at]=_.useState(null),[Nt,Un]=_.useState(!1);_.useEffect(()=>{a&&N({library_id:a})},[a,N]),_.useEffect(()=>{l&&j(l)},[l,j]);const lt=l!==null,hn=_.useMemo(()=>lt?v?[...uR(v.tree,u)].sort((Be,ut)=>Be.kind!==ut.kind?Be.kind==="folder"?-1:1:Be.name.localeCompare(ut.name)).map(Be=>({type:"node",root:v,node:Be})):[]:[...y].sort((ut,Pe)=>ut.kind!==Pe.kind?ut.kind==="folder"?-1:1:new Date(Pe.created_at).getTime()-new Date(ut.created_at).getTime()).map(ut=>({type:"root",root:ut,node:null})),[lt,y,v,u]),on=_.useMemo(()=>w==="all"?hn:hn.filter(se=>se.type==="root"||!se.node||se.node.kind==="folder"?!0:w==="indexed"?se.node.index_status==="indexed":se.node.index_status==="none"||!se.node.index_status),[hn,w]),qt=m?.type==="daemon",bn=m?.type==="cloud",ia=qt&&!lt,kn=DR(a,bn,y),Rn=_.useMemo(()=>{if(!m)return[];const se=[{label:m.is_default?e("sources.library.default_cloud_name"):m.name,to:`/studio/sources/${m.id}`}];return lt&&v&&(se.push({label:v.name,to:`/studio/sources/${m.id}?rootId=${v.id}`}),u&&Go(v.tree,u).forEach(Be=>{se.push({label:Be.name,to:`/studio/sources/${m.id}?rootId=${v.id}&path=${encodeURIComponent(Be.path)}`})})),se},[m,lt,v,u,e]),jt=_.useCallback(async se=>{if(a)try{lt&&l?await R(l,{parent_path:u,kind:"folder",name:se}):(await E({library_id:a,kind:"folder",name:se}),N({library_id:a})),P(!1),de(null)}catch(be){be instanceof Ln&&be.status===409&&de(e("sources.error.name_conflict",{name:se}))}},[a,lt,l,u,E,R,N,e]),_n=_.useCallback(se=>{a&&(se.type==="root"?se.root.kind==="source"?t(`/studio/source/${se.root.id}`):i({rootId:se.root.id}):se.node&&(se.node.kind==="folder"?i({rootId:se.root.id,path:se.node.path}):t(`/studio/source/${se.root.id}?path=${encodeURIComponent(se.node.path)}`)))},[a,t,i]),Ne=_.useCallback(()=>{if(!(!l||!a))if(u){const se=u.split("/");se.pop();const be=se.join("/");i(be?{rootId:l,path:be}:{rootId:l})}else i({})},[l,a,u,i]),$e=_.useCallback(async(se,be)=>{try{return await k(se,{name:be}),N({library_id:a}),null}catch(Be){return Be instanceof Ln&&Be.status===409?e("sources.error.name_conflict",{name:be}):null}},[a,k,N,e]),Xe=_.useCallback(se=>{if(se.type==="root"){F(se.root.id),G(null);const be=se.root.tree.length>0?Eh({children:se.root.tree}):void 0;ce(qt?{type:"repo",name:se.root.name,libraryName:m.name,...be?{packageCount:be.codeSources,docCount:be.docSources,indexedCount:be.indexedSources}:{}}:{type:se.root.kind==="folder"?"folder":"resource",name:se.root.name,...se.root.kind==="folder"&&be?{folderCount:be.folders,sourceCount:be.sources,indexedCount:be.indexedSources}:{}})}else if(se.node)if(F(se.root.id),G(se.node.path),se.node.kind==="folder"){const be=Eh(se.node);ce({type:"folder",name:se.node.name,folderCount:be.folders,sourceCount:be.sources,indexedCount:be.indexedSources})}else ce({type:"resource",name:se.node.name})},[qt,m]),vt=_.useCallback(async()=>{if(!(!D||!a)){try{A?await I(D,A):(await O(D),N({library_id:a}))}catch{}ce(null),F(null),G(null)}},[D,A,a,O,I,N]),Tt=_.useCallback(()=>{if(!a)return;const se=new URLSearchParams;l&&(se.set("parentId",l),v&&se.set("parentName",v.name)),u&&se.set("parentPath",u);const be=se.toString();t(`/studio/sources/import/${a}${be?`?${be}`:""}`)},[a,t,l,u,v]),ln=_.useCallback(()=>{a&&t(`/studio/sources/import-dir/${a}`)},[a,t]),Yn=_.useCallback(async(se,be)=>{if(a){ge(!0),re(null);try{const Be={library_id:a,files:se.map(M=>{const $={file_name:M.name,content:M.content};return M.encoding&&($.encoding=M.encoding),be&&($.version_label=be),$})};lt&&l&&(Be.root_source_id=l,Be.parent_path=u);const ut=await B(Be),Pe=ut.results??[],oa=Pe.some(M=>M.status==="created")||(ut.created?.length??0)>0,la=Pe.some(M=>M.status==="hash_changed"),ca=Pe.filter(M=>M.status==="no_change").length;if(la&&!be){const M=Pe.find($=>$.status==="hash_changed");Ee({files:se,currentVersion:M?.current_version_label??"v0.0.0"}),L(!1)}else if(oa&&(lt&&l?j(l):N({library_id:a})),L(!1),Ee(null),ca>0){const M=ca===Pe.length?e("upload.no_change"):e("upload.partial_no_change",{count:ca});qe(M),setTimeout(()=>qe(null),4e3)}}catch(Be){Be instanceof Ln&&Be.status===409?re(e("sources.error.name_conflict",{name:se[0]?.name??""})):Be instanceof Ln&&re(Be.message)}finally{ge(!1)}}},[a,lt,l,u,B,N,j,e]),mn=_.useCallback(async se=>{xe&&await Yn(xe.files,se)},[xe,Yn]),Ht=m?.is_default===!0,bt=_.useCallback(async se=>{if(a)try{await h(a,se),zn(!1),at(null)}catch(be){const Be=be instanceof Error?be.message:String(be);at(Be)}},[a,h]),Ft=_.useCallback(()=>{zn(!1),at(null)},[]),Te=_.useCallback(async()=>{if(a){try{await x(a),t("/studio/sources/add-client")}catch{}Un(!1)}},[a,x,t]),He=_.useCallback(()=>{Un(!1)},[]);if(!m)return d.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const ct=y.length===0&&w==="all"&&!b&&!lt,tt=on.filter(se=>se.type==="node"&&se.node?.kind==="source").length===0&&w==="indexed"&&!b,dt=!lt||!v?!1:v.metadata?.origin==="remote"?!0:u?Go(v.tree,u).some(be=>be.metadata?.origin==="remote"):!1,Ot=!ia,Bt=bn&&!dt,en=ia;return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("div",{className:"min-w-0 flex-1",children:vn?d.jsx(X_,{currentName:m.name,onConfirm:bt,onCancel:Ft,error:$t}):d.jsx(As,{segments:Rn})}),d.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Bt&&d.jsxs(d.Fragment,{children:[d.jsx(jh,{label:e("sources.actions.upload"),icon:d.jsx(am,{size:14}),items:[{label:e("sources.actions.upload_doc"),icon:d.jsx(Wr,{size:14}),onClick:()=>L(!0)}]}),d.jsx(jh,{label:e("sources.actions.add"),icon:d.jsx(Gm,{size:14}),items:[{label:e("sources.actions.add_folder"),icon:d.jsx(G_,{size:14}),onClick:()=>P(!0)},{label:e("sources.actions.add_web"),icon:d.jsx(wC,{size:14}),onClick:()=>ee(!0)},{label:e("sources.actions.add_feishu"),icon:d.jsx(rC,{size:14}),onClick:()=>ee(!0)}]}),d.jsxs("button",{onClick:()=>{const se=new URLSearchParams;l&&(se.set("parentId",l),v&&se.set("parentName",v.name)),u&&se.set("parentPath",u);const be=se.toString();t(`/studio/sources/import-remote/${a}${be?`?${be}`:""}`)},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:[d.jsx(uv,{size:14}),d.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo_url")})]})]}),en&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:ln,disabled:!m.is_online,title:m.is_online?void 0:e("sources.import.daemon_offline",{name:m.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:[d.jsx(dC,{size:14}),d.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_dir")})]}),d.jsxs("button",{onClick:Tt,disabled:!m.is_online,title:m.is_online?void 0:e("sources.import.daemon_offline",{name:m.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:[d.jsx(uv,{size:14}),d.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo")})]}),d.jsx(jh,{label:"",icon:d.jsx(tm,{size:14}),alignRight:!0,items:[{label:e("sources.library.rename"),icon:d.jsx(tm,{size:14}),onClick:()=>zn(!0)},...Ht?[]:[{label:e("sources.actions.delete"),icon:d.jsx(Vm,{size:14}),onClick:()=>Un(!0)}]]})]}),Ot&&d.jsx(fR,{value:w,onChange:H})]})]}),ct?d.jsx(MR,{library:m,onNewFolder:()=>P(!0),...qt?{onImportRepo:Tt,onImportDir:ln}:{},...bn?{onUploadDoc:()=>L(!0),onUpgrade:()=>{const se=new URLSearchParams;l&&(se.set("parentId",l),v&&se.set("parentName",v.name)),u&&se.set("parentPath",u);const be=se.toString();t(`/studio/sources/import-remote/${a}${be?`?${be}`:""}`)}}:{}}):d.jsx(TR,{pathLabel:(()=>{if(!lt||!v)return"/";const se=v.metadata,be=qt?typeof se?.local_path=="string"?se.local_path:v.name:"/"+v.name;if(!u)return be;const Be=Go(v.tree,u);return be+"/"+Be.map(ut=>ut.name).join("/")})(),loading:b,badge:(()=>{if(!lt||!v)return;let se=v.metadata,be=v.name;if(!se?.origin&&u){const Pe=Go(v.tree,u);for(const oa of Pe){const la=oa.metadata;if(la?.origin==="remote"){se=la,be=oa.name;break}}}const Be=se?.pinned_branch??se?.remote_ref,ut=se?.pinned_hash??se?.remote_commit;if(!(!Be||!ut))return d.jsx(Q_,{remoteUrl:se?.remote_url,fallbackName:be,branch:Be,commit:ut})})(),onNavigateUp:lt?Ne:void 0,children:on.length===0?tt?d.jsx(zR,{}):lt?null:d.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:e("common.items",{count:0})}):d.jsx("div",{className:"flex flex-col gap-0.5",children:on.map(se=>{if(se.type==="root"){const Pe=se.root,oa=qt,la=oa?Pe.metadata?.local_path:void 0,ca=Pe.tree.length>0?Eh({children:Pe.tree}):void 0,M=ca?ca.folders+ca.sources:0,$=Pe.metadata,Z=$?.origin==="remote",fe=$?.import_type==="directory",he=Z||oa&&!fe;return d.jsx(kv,{source:{id:Pe.id,library_id:Pe.library_id,owner_id:Pe.owner_id,path:"",kind:Pe.kind,source_type:Pe.source_type,name:Pe.name,content_hash:Pe.content_hash,metadata:Pe.metadata,index_status:Pe.index_status,created_at:Pe.created_at,updated_at:Pe.updated_at},...typeof la=="string"?{displayName:la}:{},...Pe.kind==="folder"?{childCount:M}:{},isDaemonLibrary:qt??!1,isRepoRoot:he,...kn[Pe.id]?{hasUpdate:!0}:{},onClick:()=>_n(se),...Z?{}:{onRename:Se=>$e(Pe.id,Se)},onDelete:()=>Xe(se)},Pe.id)}const be=se.node,Be=`${se.root.id}:${be.path}`,ut=be.kind==="folder"?be.children?.length??0:void 0;return d.jsx(kv,{source:{id:se.root.id,library_id:se.root.library_id,owner_id:se.root.owner_id,path:be.path,kind:be.kind,source_type:be.source_type??null,name:be.name,content_hash:null,metadata:be.metadata??null,index_status:be.index_status??"none",created_at:se.root.created_at,updated_at:se.root.updated_at},...ut!==void 0?{childCount:ut}:{},isDaemonLibrary:qt??!1,onClick:()=>_n(se),...bn&&se.root.metadata?.origin!=="remote"?{onDelete:()=>Xe(se)}:{}},Be)})})}),T&&d.jsx(SR,{onConfirm:jt,onCancel:()=>{P(!1),de(null)},error:X}),J&&d.jsx(jR,{onConfirm:Yn,onCancel:()=>{L(!1),re(null)},error:q,uploading:ie}),xe&&d.jsx(RR,{currentVersion:xe.currentVersion,onConfirm:mn,onCancel:()=>{Ee(null),re(null)},uploading:ie,serverError:q}),De&&d.jsxs("div",{className:"fixed top-4 left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-elevated px-5 py-3 font-mono text-sm text-c4a-accent shadow-c4a-lg",children:[d.jsx("span",{children:"ⓘ"}),De]}),ae&&d.jsx(wR,{onClose:()=>ee(!1)}),le&&d.jsx(Rv,{target:le,onConfirm:vt,onCancel:()=>{ce(null),F(null),G(null)}}),Nt&&m&&d.jsx(Rv,{target:{type:"client",name:m.name},onConfirm:Te,onCancel:He})]})}function $R(){const{t:e}=ye(),t=Lt(),a=Wt(u=>u.libraries),s=Wt(u=>u.loading),[i,l]=_.useState(!1);return _.useEffect(()=>{if(s)return;if(a.length===0&&!i){l(!0),Wt.getState().fetchLibraries();return}const u=a.find(f=>f.is_default);u?t(`/studio/sources/${u.id}`,{replace:!0}):a.length>0&&t(`/studio/sources/${a[0].id}`,{replace:!0})},[a,s,t,i]),i&&!s&&a.length===0?d.jsx(Cn,{fullPage:!0,icon:d.jsx(I_,{size:32}),title:e("sources.empty.cloud.title"),description:e("sources.empty.cloud.description")}):d.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:d.jsx(Fm,{})})}function Fa({active:e,current:t}){return d.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${t?"border-c4a-accent bg-c4a-accent":e?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Cs(){return d.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function Z_({libraryName:e}){const{t}=ye();return d.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[d.jsx("p",{className:"text-sm text-c4a-warning",children:t("sources.import.daemon_offline",{name:e})}),d.jsx(ja,{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:t("sources.import.view_guide")})]})}function Ym({step:e,totalSteps:t,importing:a,stepBusy:s,canProceed:i,safetyNoticeKey:l,confirmLabelKey:u,onPrev:f,onNext:m,onImport:h}){const{t:x}=ye();return d.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[d.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:x(l),onClick:y=>y.currentTarget.classList.toggle("line-clamp-1"),children:x(l)}),d.jsxs("div",{className:"flex shrink-0 gap-2",children:[e>1&&d.jsx("button",{onClick:f,disabled:a||s,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:x("common.previous")}),e<t?d.jsx("button",{onClick:m,disabled:!i||s,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:x("common.next")}):d.jsxs("button",{onClick:h,disabled:a||s||!i,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:[a&&d.jsx(fn,{size:12,className:"animate-spin"}),x(a?"sources.import.importing":u)]})]})]})}function J_(e,t){const a=_.useCallback(async(u,f)=>{if(!e)throw new Error("No library");const m=await ze.post(`/libraries/${e}/rpc`,{method:u,params:f});if(m.error){const h=m.error;throw new Error(h.message??JSON.stringify(m.error))}return m.result??m},[e]),[s,i]=_.useState([]);_.useEffect(()=>{if(!e)return;let u=!1;return(async()=>{try{const f=await ze.get("/sources",{library_id:e,limit:"500"});if(u)return;const m=f.items.map(h=>{const x=h.metadata;return typeof x?.local_path=="string"?x.local_path:null}).filter(h=>h!==null);i(m)}catch{}})(),()=>{u=!0}},[e]);const l=_.useMemo(()=>{const u=t?.config;return!u||!Array.isArray(u.allowed_paths)?[]:u.allowed_paths},[t]);return{rpc:a,importedPaths:s,allowedPaths:l}}function HR(e,t){const a=e.toLowerCase();try{if(a.endsWith("package.json")){const s=JSON.parse(t);if(typeof s.name=="string"&&s.name.trim())return s.name.trim()}if(a.endsWith("pyproject.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(a.endsWith("go.mod"))return t.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(a.endsWith("cargo.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(a.endsWith("pom.xml"))return t.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(a.endsWith("build.gradle"))return t.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function W_(e,t,a="repo"){const s=[];for(const l of e){const u=l.path.split("/"),f=u.slice(0,-1).join("/")||".",m=u.length===1||l.path==="package.json",h=f==="."?a:u[u.length-2]||f,x=HR(l.path,l.content);s.push({name:x||h,path:f,isRoot:m})}const i=t.filter(l=>/\.md$/i.test(l.path)).map(l=>l.path);return{packages:s,mdFiles:i}}const Tv=new Set(["tree","blob","commit","commits","raw","src"]),BR=new Set(["commit","commits"]);function IR(e){let t;try{t=new URL(e.trim())}catch{return{repoUrl:e.trim()}}const a=t.pathname.split("/").filter(Boolean);let s=-1;for(let h=2;h<a.length;h++){const x=a[h];if(x==="-"&&h+1<a.length&&Tv.has(a[h+1])){s=h;break}if(Tv.has(x)){s=h;break}}if(s===-1)return{repoUrl:`${t.protocol}//${t.host}${t.pathname}`.replace(/\/+$/,"")};const i=a.slice(0,s).join("/"),l=`${t.protocol}//${t.host}/${i}`;let u,f;if(a[s]==="-"?(u=a[s+1],f=s+2):(u=a[s],f=s+1),f>=a.length)return{repoUrl:l};const m=a[f];return BR.has(u)?{repoUrl:l,commit:m}:{repoUrl:l,ref:m}}function Qr(e){try{return(new URL(e).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return e.split("/").pop()||e}}function om(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}const PR=1500;async function e1(e){const t=PR-(Date.now()-e);t>0&&await new Promise(a=>setTimeout(a,t))}function t1(){const{t:e}=ye(),[t,a]=_.useState(!1),[s,i]=_.useState(null),l=_.useRef(),u=_.useRef(),f=window.location.host,m=`c4a-daemon --server ${f} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${f}`,x=_.useCallback((b,w)=>{navigator.clipboard.writeText(b),i(w),clearTimeout(l.current),l.current=setTimeout(()=>i(null),1500)},[]),y=_.useCallback(()=>{clearTimeout(u.current),a(!0)},[]),v=_.useCallback(()=>{u.current=setTimeout(()=>a(!1),150)},[]);return d.jsxs("span",{className:"relative",onMouseEnter:y,onMouseLeave:v,children:[d.jsx(B_,{size:12,className:"text-c4a-warning"}),t&&d.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:y,onMouseLeave:v,children:[d.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_restrict")}),d.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[d.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:m}),d.jsx("button",{onClick:()=>x(m,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:s===0?d.jsx(ts,{size:10}):d.jsx(Wh,{size:10})})]}),d.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_all")}),d.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[d.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),d.jsx("button",{onClick:()=>x(h,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:s===1?d.jsx(ts,{size:10}):d.jsx(Wh,{size:10})})]})]})]})}function n1({open:e,onClose:t,rpc:a,onNavigate:s,defaultPath:i}){const{t:l}=ye(),[u,f]=_.useState(i??""),[m,h]=_.useState(null),[x,y]=_.useState(!1),v=_.useRef(null);_.useEffect(()=>{i&&!u&&f(i)},[i]);const b=_.useCallback(async()=>{const N=u.trim();if(N){y(!0),h(null);try{(await a("fs/exists",{path:N})).exists?(s(N),f(i??""),h(null),t()):h(l("sources.import.wildcard_path_not_found"))}catch(j){h(j instanceof Error?j.message:String(j))}finally{y(!1)}}},[u,a,l,s,t]),w=_.useCallback(()=>{f(i??""),h(null),t()},[t,i]);return e?d.jsxs(Qa,{onClose:w,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:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:l("sources.import.wildcard_go_title")}),d.jsx("button",{onClick:w,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:d.jsx(br,{size:14})})]}),d.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[d.jsx("input",{ref:v,type:"text",value:u,onChange:N=>{f(N.target.value),h(null)},onKeyDown:N=>{N.key==="Enter"&&b()},placeholder:l("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"}),d.jsxs("button",{onClick:b,disabled:x||!u.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:[x?d.jsx(fn,{size:12,className:"animate-spin"}):d.jsx(H_,{size:12}),l("sources.import.wildcard_go")]})]}),m&&d.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:m})]}):null}function a1({rpc:e,allowedPaths:t,importedPaths:a,onNavigateUpExtra:s}){const i=!!t&&t.length>0,l=i&&t.length===1&&t[0]==="*",[u,f]=_.useState(i),[m,h]=_.useState(i&&!l?"":"/"),[x,y]=_.useState([]),[v,b]=_.useState(!1),[w,N]=_.useState(null),[j,E]=_.useState(null);_.useEffect(()=>{if(i&&!l)return;let P=!1;return(async()=>{try{const X=await e("fs/homeDir",{});P||E(X.home_dir)}catch{P||E("/")}})(),()=>{P=!0}},[i,l,e]);const[R,k]=_.useState(!1),O=_.useCallback(async P=>{b(!0),N(null);try{const X=await e("fs/listTree",{path:P,depth:1});y(X.entries||[]),h(P),f(!1)}catch(X){const de=X instanceof Error?X.message:String(X);N(de)}finally{b(!1)}},[e]);_.useEffect(()=>{i&&!l||j!==null&&O(j)},[j,i,l,O]);const I=_.useMemo(()=>new Set(a??[]),[a]),B=_.useCallback(()=>{if(i&&!l&&t.some(de=>de===m)){f(!0),h(""),y([]),N(null),s?.();return}const P=m.split("/").slice(0,-1).join("/")||"/";s?.(),O(P)},[i,l,t,m,O,s]),H=_.useMemo(()=>x.filter(P=>P.type==="directory"),[x]),T=_.useMemo(()=>x.filter(P=>P.type==="file"),[x]);return{atRoot:u,currentPath:m,entries:x,loading:v,error:w,homeDir:j,goToOpen:R,hasAllowedPaths:i,isWildcard:l,importedSet:I,dirs:H,files:T,loadTree:O,handleNavigateUp:B,setGoToOpen:k}}function GR({rpc:e,selectedPath:t,onSelect:a,allowedPaths:s,importedPaths:i}){const{t:l}=ye(),[u,f]=_.useState(null),{atRoot:m,currentPath:h,entries:x,loading:y,error:v,homeDir:b,goToOpen:w,isWildcard:N,importedSet:j,dirs:E,files:R,loadTree:k,handleNavigateUp:O,setGoToOpen:I}=a1({rpc:e,allowedPaths:s??[],importedPaths:i??[],onNavigateUpExtra:()=>f(null)}),[B,H]=_.useState(null),[T,P]=_.useState(!1);_.useEffect(()=>{if(!t){H(null),P(!1);return}H(null),P(!0);let ce=!1;return(async()=>{try{const D=await e("fs/repoStatus",{path:t});ce||(H({branch:D.branch,hash:D.head_hash,remoteUrl:D.remote_url}),P(!1))}catch{ce||(H(null),P(!1))}})(),()=>{ce=!0}},[t,e]);const X=_.useCallback(ce=>{if(ce.type==="directory")if(ce.is_git_repo){if(j.has(ce.path))return;f(null),a(ce.path,ce.name)}else f(ce.path),k(ce.path)},[a,k,j]),de=_.useMemo(()=>E.sort((ce,D)=>ce.is_git_repo&&!D.is_git_repo?-1:!ce.is_git_repo&&D.is_git_repo?1:ce.name.localeCompare(D.name)),[E]),le=_.useMemo(()=>R.sort((ce,D)=>ce.name.localeCompare(D.name)),[R]);return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[m?d.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[d.jsx("span",{children:l("sources.import.allowed_dirs")}),d.jsx(t1,{})]}):d.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),t&&T?d.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[d.jsx(fn,{size:12,className:"animate-spin"}),d.jsx("span",{children:l("common.loading")})]}):t&&B?d.jsx(Q_,{remoteUrl:B.remoteUrl,fallbackName:t.split("/").pop()||t,branch:B.branch,commit:B.hash}):!t&&N&&m?d.jsx("button",{onClick:()=>I(!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:l("sources.import.wildcard_goto")}):null]}),d.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?N?d.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:b&&d.jsxs("button",{onClick:()=>k(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:[d.jsx(_a,{size:14,className:"shrink-0"}),d.jsxs("span",{className:"truncate",children:[b,d.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",l("sources.import.wildcard_home"),")"]})]}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):d.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:s.map(ce=>d.jsxs("button",{onClick:()=>k(ce),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:[d.jsx(_a,{size:14,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:ce}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},ce))}):v&&!y?d.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):d.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[y&&d.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:d.jsx(fn,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&d.jsxs("button",{onClick:O,disabled:y,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[d.jsx(_a,{size:14}),d.jsx("span",{children:".."})]}),de.map(ce=>{const D=ce.is_git_repo&&j.has(ce.path),F=ce.is_git_repo?Hu:_a;return d.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${D?"cursor-not-allowed text-c4a-accent/60":t===ce.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[d.jsxs("button",{onClick:()=>X(ce),disabled:D||y,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[d.jsx(F,{size:14,className:"shrink-0"}),d.jsx("span",{className:"flex-1 truncate text-left",children:ce.name}),D&&d.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:l("sources.import.already_imported")})]}),!D&&d.jsx("button",{onClick:A=>{A.stopPropagation(),k(ce.path)},disabled:y,className:"shrink-0 rounded p-1.5 text-c4a-text-muted transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent disabled:pointer-events-none",title:ce.path,children:d.jsx(rn,{size:12})})]},ce.path)}),le.map(ce=>d.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[d.jsx(P_,{size:14,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:ce.name})]},ce.path)),x.length===0&&!y&&d.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:l("sources.import.no_entries")})]}),u&&!t&&d.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:l("sources.import.not_git")}),d.jsx(n1,{open:w,onClose:()=>I(!1),rpc:e,onNavigate:k,defaultPath:b??void 0})]})}const bi=50,Ch=["main","master"];function VR(e){const t=[],a=[];for(const s of e)Ch.includes(s.name)?t.push(s):a.push(s);return t.sort((s,i)=>Ch.indexOf(s.name)-Ch.indexOf(i.name)),[...t,...a]}function Av(e,t,a){_.useEffect(()=>{if(!a)return;const s=i=>{e.current&&!e.current.contains(i.target)&&t()};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[e,t,a])}function r1({refs:e,loading:t,error:a,selectedRef:s,commit:i,onRefChange:l,onCommitChange:u,onValidChange:f,onBranchSwitch:m}){const{t:h}=ye(),[x,y]=_.useState(!1),[v,b]=_.useState(""),[w,N]=_.useState(!0),[j,E]=_.useState(!0),R=_.useRef(null),k=_.useRef(null),[O,I]=_.useState(!1),[B,H]=_.useState(""),T=_.useRef(null),P=_.useRef(null);Av(R,()=>{y(!1),b("")},x),Av(T,()=>{I(!1),H("")},O),_.useEffect(()=>{x&&setTimeout(()=>k.current?.focus(),0)},[x]),_.useEffect(()=>{O&&setTimeout(()=>P.current?.focus(),0)},[O]),_.useEffect(()=>{f(!!s)},[s,f]);const X=_.useCallback(J=>{l(J.name),u(J.commit),y(!1),b(""),m?.(J.name)},[l,u,m]),de=_.useCallback((J,L)=>{u(J),l(L),I(!1),H("")},[u,l]),le=_.useMemo(()=>e?VR(e.branches):[],[e]),ce=_.useMemo(()=>{const J=v.toLowerCase();return(J?le.filter(q=>q.name.toLowerCase().includes(J)):le).slice(0,bi)},[le,v]),D=_.useMemo(()=>{if(!e)return[];const J=v.toLowerCase();return(J?e.tags.filter(q=>q.name.toLowerCase().includes(J)):e.tags).slice(0,bi)},[e,v]),F=_.useMemo(()=>{if(!e)return[];if(e.commits&&e.commits.length>0){const ie=B.toLowerCase(),ge=e.commits.map(xe=>({hash:xe.hash,refName:s||"",label:`${xe.hash.slice(0,8)} ${xe.message?`— ${xe.message.slice(0,50)}`:""}`.trim()}));return ie?ge.filter(xe=>xe.hash.toLowerCase().includes(ie)||xe.label.toLowerCase().includes(ie)).slice(0,bi):ge.slice(0,bi)}const J=new Set,L=[],q=[...e.branches??[],...e.tags??[]];for(const ie of q){const ge=ie.commit.slice(0,8);J.has(ie.commit)||(J.add(ie.commit),L.push({hash:ie.commit,refName:ie.name,label:`${ge} (${ie.name})`}))}if(!B)return L.slice(0,bi);const re=B.toLowerCase();return L.filter(ie=>ie.hash.toLowerCase().includes(re)||ie.label.toLowerCase().includes(re)).slice(0,bi)},[e,B,s]),[A,G]=_.useState(!1);if(_.useEffect(()=>{if(!t){G(!1);return}const J=setTimeout(()=>G(!0),5e3);return()=>clearTimeout(J)},[t]),t)return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsx(fn,{size:20,className:"animate-spin text-c4a-accent"}),d.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:h("sources.import_remote.loading_refs")}),A&&d.jsx("span",{className:"mt-1.5 text-xs text-c4a-text-muted",children:h("sources.import_remote.loading_refs_slow")})]});if(a)return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[d.jsx(br,{size:14,className:"shrink-0"}),h("sources.import.error_title")]}),d.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:a})]});if(!e)return null;const ae=e.branches.find(J=>J.name===s)?.name??e.tags.find(J=>J.name===s)?.name??s,ee=i?i.slice(0,8):"";return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.ref_label")}),d.jsxs("div",{ref:R,className:"relative mt-2",children:[d.jsxs("button",{onClick:()=>y(!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:[d.jsx("span",{children:ae||"—"}),d.jsx(rn,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${x?"rotate-90":""}`})]}),x&&d.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[d.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:d.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[d.jsx(nm,{size:14,className:"shrink-0 text-c4a-text-muted"}),d.jsx("input",{ref:k,type:"text",value:v,onChange:J=>b(J.target.value),placeholder:h("sources.import_remote.ref_search"),className:"w-full bg-transparent font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),d.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[ce.length>0&&d.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[d.jsxs("button",{onClick:()=>N(!w),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:[d.jsx(rn,{size:12,className:`transition-transform duration-200 ${w?"rotate-90":""}`}),h("sources.import_remote.ref_branches")," (",e.branches.length,")"]}),w&&ce.map(J=>d.jsxs("button",{onClick:()=>X(J),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${J.name===s?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[d.jsx("span",{className:"truncate",children:J.name}),J.name===s&&d.jsx("span",{children:"✓"})]},`b-${J.name}`))]}),D.length>0&&d.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[d.jsxs("button",{onClick:()=>E(!j),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:[d.jsx(rn,{size:12,className:`transition-transform duration-200 ${j?"rotate-90":""}`}),h("sources.import_remote.ref_tags")," (",e.tags.length,")"]}),j&&D.map(J=>d.jsxs("button",{onClick:()=>X(J),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${J.name===s?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[d.jsx("span",{className:"truncate",children:J.name}),J.name===s&&d.jsx("span",{children:"✓"})]},`t-${J.name}`))]})]}),ce.length===0&&D.length===0&&d.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.commit_label")}),d.jsxs("div",{ref:T,className:"relative mt-2",children:[d.jsxs("button",{onClick:()=>I(!O),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:[d.jsx("span",{className:i?"":"font-normal text-c4a-text-muted",children:ee||"—"}),d.jsx(rn,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${O?"rotate-90":""}`})]}),O&&d.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:[d.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:d.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[d.jsx(nm,{size:12,className:"shrink-0 text-c4a-text-muted"}),d.jsx("input",{ref:P,type:"text",value:B,onChange:J=>H(J.target.value),placeholder:h("sources.import_remote.commit_search"),className:"w-full bg-transparent font-mono text-xs text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),F.map(J=>d.jsxs("button",{onClick:()=>de(J.hash,J.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:[d.jsx("span",{className:"truncate",children:J.label}),J.hash===i&&d.jsx("span",{className:"text-c4a-accent",children:"✓"})]},J.hash)),F.length===0&&d.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),d.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[d.jsx(CC,{size:12,className:"shrink-0"}),h("sources.import_remote.commit_hint")]})]})]})}const qR="_progressTrack_4p57j_1",FR="_progressFill_4p57j_9",YR="_progressFillFailed_4p57j_45",KR="_indeterminate_4p57j_53",Pc={progressTrack:qR,progressFill:FR,progressFillFailed:YR,indeterminate:KR};function XR(e){const t={},a=100/e.length;return e.forEach((s,i)=>{t[s.key]=Math.round(a*(i+1))}),t}function QR(e,t,a,s,i,l){const u=x=>x>0?t[e[x-1].key]??0:0;if(i){const x=e.findIndex(b=>b.key===i),y=u(x),v=t[i]??100;return y+l/100*(v-y)}if(!a)return s.length===e.length?100:0;const f=e.findIndex(x=>x.key===a);if(f<0)return 0;const m=u(f),h=t[a]??100;return l>=0?m+l/100*(h-m):m}function ZR({stages:e,currentStage:t,completedStages:a,failedStage:s,progress:i,breakpoints:l}){const u=l??XR(e),f=i?.percent??-1,m=_.useRef(0),[h,x]=_.useState(0),y=_.useRef(null),v=QR(e,u,t,a,s,f>=0?f:-1);m.current=v,_.useEffect(()=>{v>h&&x(v)},[v]),_.useEffect(()=>{if(!t||s){y.current&&(clearInterval(y.current),y.current=null);return}const R=e.findIndex(H=>H.key===t),k=u[t]??100,O=R===e.length-1?k-1:k-2,I=500,B=.025;return y.current=setInterval(()=>{x(H=>{const T=m.current;if(H>=T&&H<O){const P=Math.max(.1,(O-H)*B);return Math.min(H+P,O)}return H})},I),()=>{y.current&&(clearInterval(y.current),y.current=null)}},[t,s,e,u]);const b=_.useRef(null);_.useEffect(()=>{if(a.length===e.length&&!s)return y.current&&(clearInterval(y.current),y.current=null),b.current=setInterval(()=>{x(R=>R>=100?(b.current&&clearInterval(b.current),b.current=null,100):Math.min(100,R+4))},32),()=>{b.current&&(clearInterval(b.current),b.current=null)}},[a.length,e.length,s]);const w=Math.min(100,Math.max(0,h)),N=!!t&&!s,j=!!s,E=a.length===e.length&&!s;return d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.map(R=>{const k=a.includes(R.key),O=s===R.key,I=t===R.key;let B="inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-mono text-[11px] uppercase tracking-tight transition-colors";return O?B+=" bg-red-500/10 text-red-400":k?B+=" bg-c4a-accent/10 text-c4a-accent":I?B+=" bg-c4a-accent/15 text-c4a-accent":B+=" bg-c4a-bg-elevated text-c4a-text-muted",d.jsxs("span",{className:B,children:[O?d.jsx(br,{size:10,className:"shrink-0"}):k?d.jsx(ts,{size:10,className:"shrink-0"}):I?d.jsx(fn,{size:10,className:"shrink-0 animate-spin"}):d.jsx(JE,{size:8,className:"shrink-0 opacity-40"}),R.label]},R.key)})}),d.jsx("div",{className:Pc.progressTrack,children:w>0?d.jsx("div",{className:`${Pc.progressFill} ${j?Pc.progressFillFailed:""}`,style:{width:`${w}%`}},"fill"):N?d.jsx("div",{className:Pc.indeterminate,style:{width:"100%",height:"100%"}},"pulse"):null}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted tabular-nums",children:E?"100%":N||j?`${Math.round(w)}%`:""}),i?.label&&N&&d.jsx("span",{className:"max-w-[320px] truncate font-mono text-[11px] text-c4a-text-muted",children:i.label})]})]})}function s1({stages:e,currentStage:t,completedStages:a,failedStage:s,progress:i,breakpoints:l,failedError:u,logs:f}){const m=_.useRef(null);return _.useEffect(()=>{m.current?.scrollIntoView({behavior:"smooth"})},[f.length]),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsx(ZR,{stages:e,currentStage:t,completedStages:a,failedStage:s,progress:i,...l?{breakpoints:l}:{}}),d.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[f.map((h,x)=>d.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:h},x)),d.jsx("div",{ref:m})]}),s&&u&&d.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:d.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:u})})]})}function yr({icon:e,label:t,value:a,tooltip:s,size:i="sm"}){const l=i==="sm";return d.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[e,d.jsx("span",{className:"font-mono text-xs uppercase",children:t})]}),d.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${l?"text-sm truncate":"text-lg"}`,title:l?String(a):void 0,children:a}),s&&d.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:s})]})}const kh=100;function i1({repoName:e,repoIdentifier:t,branch:a,commit:s,packages:i,mdFiles:l,importing:u,completed:f}){const{t:m}=ye(),h=s?s.slice(0,7):"",[x,y]=_.useState("packages"),[v,b]=_.useState(kh),w=_.useRef(null),N=_.useRef(null);_.useEffect(()=>{b(kh),N.current?.scrollTo(0,0)},[x]),_.useEffect(()=>{const O=w.current;if(!O)return;const I=x==="packages"?i.length:l.length;if(v>=I)return;const B=new IntersectionObserver(H=>{H[0]?.isIntersecting&&b(T=>Math.min(T+kh,I))},{root:N.current,threshold:.1});return B.observe(O),()=>B.disconnect()},[x,v,i.length,l.length]);const j=x==="packages"?i:l,E=j.slice(0,v),R=v<j.length,k=_.useMemo(()=>f?m("sources.import_remote.complete"):u?m("sources.import.importing"):m("sources.import.confirm_heading",{name:e}),[f,u,e,m]);return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[d.jsx("p",{className:"text-sm text-c4a-text-secondary",children:k}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[d.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:e}),d.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:t})]}),d.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[d.jsx(yr,{icon:d.jsx(em,{size:14}),label:m("sources.import.branch"),value:a}),d.jsx(yr,{icon:d.jsx(yC,{size:14}),label:m("sources.import.commit"),value:h}),d.jsx(yr,{icon:d.jsx(Ei,{size:14}),label:m("sources.import.packages"),value:String(i.length),tooltip:m("sources.import.dir_code_packages_tip")}),d.jsx(yr,{icon:d.jsx(Wr,{size:14}),label:m("sources.import.documents"),value:String(l.length),tooltip:m("sources.import.dir_doc_files_tip")})]}),u&&d.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[d.jsx(fn,{size:14,className:"animate-spin text-c4a-accent"}),d.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:m("sources.import.importing")})]}),(i.length>0||l.length>0)&&d.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[d.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[d.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:m("sources.import.recognized",{packages:i.length,docs:l.length})}),d.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[d.jsxs("button",{onClick:()=>y("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${x==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[d.jsx(Ei,{size:13}),d.jsx("span",{className:"font-mono",children:i.length})]}),d.jsxs("button",{onClick:()=>y("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${x==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[d.jsx(Wr,{size:13}),d.jsx("span",{className:"font-mono",children:l.length})]})]})]}),d.jsx("hr",{className:"border-c4a-border-subtle"}),d.jsx("div",{ref:N,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:j.length===0?d.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:x==="packages"?m("sources.import.no_packages"):"—"}):d.jsxs(d.Fragment,{children:[x==="packages"?E.map(O=>d.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[d.jsx(Ei,{size:14,className:"shrink-0 text-c4a-accent"}),d.jsx("span",{className:"text-c4a-text-secondary",children:O.name}),d.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:O.path}),O.isRoot&&d.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},O.path)):E.map(O=>d.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[d.jsx(Wr,{size:14,className:"shrink-0 text-c4a-text-secondary"}),d.jsx("span",{className:"truncate text-c4a-text-secondary",children:O})]},O)),R&&d.jsx("div",{ref:w,className:"h-4"})]})})]})]})}const JR=["scan","save"],Gc={scan:"sources.import.stage.scan",save:"sources.import.stage.save"},WR={scan:20,save:90};function eT(){const{t:e}=ye(),t=Lt(),{libId:a}=xl(),[s]=$u(),l=Wt(Ds(Ui)).find(Ne=>Ne.id===a),u=Iu(Ne=>Ne.createSource),f=s.get("parentId")||"",m=s.get("parentName")||"",h=s.get("parentPath")||"",[x,y]=_.useState(1),[v,b]=_.useState(null),[w,N]=_.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[j,E]=_.useState(null),[R,k]=_.useState(!1),[O,I]=_.useState(null),[B,H]=_.useState(""),[T,P]=_.useState(""),[X,de]=_.useState(!1),[le,ce]=_.useState(!1),[D,F]=_.useState(!1),[A,G]=_.useState(null),[ae,ee]=_.useState([]),[J,L]=_.useState(null),[q,re]=_.useState(null),[ie,ge]=_.useState([]),xe=_.useRef(null),Ee=l?.is_online??!1,{rpc:De,importedPaths:qe,allowedPaths:vn}=J_(a,l),zn=_.useMemo(()=>JR.map(Ne=>({key:Ne,label:Gc[Ne]?e(Gc[Ne]):Ne})),[e]),$t=_.useCallback(Ne=>{ge($e=>[...$e,`[${om()}] ${Ne}`])},[]),at=_.useRef(null),Nt=_.useCallback(Ne=>{const $e=at.current;$e&&$e!==Ne&&(ee(Xe=>Xe.includes($e)?Xe:[...Xe,$e]),$t(`${e(Gc[$e]??$e)} ${e("sources.import.stage.done_suffix")}`)),$t(`${e(Gc[Ne]??Ne)}...`),at.current=Ne,G(Ne),re(null)},[$t,e]),Un=_.useCallback((Ne,$e)=>{N(Xe=>({...Xe,repoPath:Ne,repoName:$e}))},[]),lt=_.useCallback(async()=>{k(!0),I(null);try{const Ne=await De("fs/repoStatus",{path:w.repoPath}),$e={branches:Ne.branches??[{name:Ne.branch,commit:Ne.head_hash}],tags:Ne.tags??[],default:Ne.branch,commits:Ne.commits??[{hash:Ne.head_hash,message:"HEAD"}]};E($e),N(Xe=>({...Xe,isDirty:Ne.is_dirty})),H(Xe=>{if(Xe)return Xe;const vt=$e.branches.find(Yn=>Yn.name===$e.default),Tt=$e.branches[0],ln=vt??Tt;return ln?(P(ln.commit),ln.name):Xe})}catch(Ne){const $e=Ne instanceof Error?Ne.message:"Failed to load repository info";I($e)}finally{k(!1)}},[De,w.repoPath]);_.useEffect(()=>{x===2&&w.repoPath&&!j&&lt()},[x,w.repoPath,j,lt]);const hn=_.useCallback(async Ne=>{try{const $e=await De("fs/repoStatus",{path:w.repoPath,branch:Ne});E(Xe=>Xe&&{...Xe,commits:$e.commits??[]})}catch{}},[De,w.repoPath]),on=_.useCallback(async()=>{if(!a)return;const Ne=Date.now();ce(!0),F(!1),b(null),L(null),ee([]),at.current=null,G(null),re(null),ge([]),y(3);try{Nt("scan");const $e=await De("fs/repoScan",{path:w.repoPath,hash:T}),Xe=$e.files||[],vt=$e.manifests||[],Tt=Qr(w.repoPath),{packages:ln,mdFiles:Yn}=W_(vt,Xe,Tt);N(bt=>({...bt,branch:B,commit:T,repoFiles:Xe,packages:ln,mdFiles:Yn,repoFileContents:vt})),Nt("save");const mn=await u({library_id:a,repo_name:w.repoName||Tt,repo_root_path:w.repoPath,repo_branch:B,repo_commit:T,repo_files:Xe.map(bt=>bt.path),repo_file_contents:vt,...f?{parent_source_id:f,parent_path:h}:{}});ee(["scan","save"]),at.current=null,G(null),$t(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),$t(e("sources.import.stage.complete"));const Ht=Array.isArray(mn)?mn[0]:mn;xe.current=Ht?.id??null,await e1(Ne),F(!0),ce(!1),y(4)}catch($e){const Xe=at.current??"scan";L(Xe),at.current=null,G(null);const vt=$e instanceof Error?$e.message:String($e);$t(`ERROR: ${vt}`),b(vt),ce(!1)}},[a,w,B,T,f,h,De,u,Nt,$t]),qt=_.useCallback(()=>{L(null),b(null),on()},[on]),bn=_.useCallback(()=>{if(a)if(f){const Ne=w.repoName||Qr(w.repoPath),$e=h?`${h}/${Ne}`:Ne;t(`/studio/sources/${a}?rootId=${f}&path=${encodeURIComponent($e)}`)}else xe.current?t(`/studio/sources/${a}?rootId=${xe.current}`):t(`/studio/sources/${a}`)},[a,t,f,h,w.repoPath,w.repoName]),ia=_.useMemo(()=>x===1?!!w.repoPath:x===2?X:x===3?D:!1,[x,w.repoPath,X,D]),kn=_.useMemo(()=>{if(!l)return[];const Ne=[{label:l.is_default?e("sources.library.default_cloud_name"):l.name,to:`/studio/sources/${l.id}`}];if(f&&(Ne.push({label:m||f,to:`/studio/sources/${l.id}?rootId=${f}`}),h)){const $e=h.split("/").filter(Boolean);for(const[Xe,vt]of $e.entries()){const Tt=$e.slice(0,Xe+1).join("/");Ne.push({label:vt,to:`/studio/sources/${l.id}?rootId=${f}&path=${encodeURIComponent(Tt)}`})}}return Ne.push({label:e("sources.import.title")}),Ne},[l,f,m,h,e]);if(!l)return d.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Rn=x===4,jt=x===3&&!!J&&!le,_n=x<=2;return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsx("div",{className:"shrink-0",children:d.jsx(As,{segments:kn})}),d.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[d.jsx(Fa,{active:x>=1,current:x===1}),d.jsx("span",{className:x===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),d.jsx(Cs,{}),d.jsx(Fa,{active:x>=2,current:x===2}),d.jsx("span",{className:x===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),d.jsx(Cs,{}),d.jsx(Fa,{active:x>=3,current:x===3}),d.jsx("span",{className:x===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),d.jsx(Cs,{}),d.jsx(Fa,{active:x>=4,current:x===4}),d.jsx("span",{className:x===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),d.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:Ee?d.jsxs(d.Fragment,{children:[x===1&&d.jsx(GR,{rpc:De,selectedPath:w.repoPath,onSelect:Un,allowedPaths:vn,importedPaths:qe}),x===2&&d.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:d.jsx(r1,{refs:j,loading:R,error:O,selectedRef:B,commit:T,onRefChange:H,onCommitChange:P,onValidChange:de,onRetry:lt,onBranchSwitch:hn})}),x===3&&d.jsx(s1,{stages:zn,currentStage:A,completedStages:ae,failedStage:J,progress:q,breakpoints:WR,failedError:v,logs:ie}),x===4&&d.jsx(i1,{repoName:w.repoName||Qr(w.repoPath),repoIdentifier:w.repoPath,branch:B,commit:T,packages:w.packages,mdFiles:w.mdFiles,importing:!1,completed:D})]}):d.jsx(Z_,{libraryName:l.name})}),Ee&&d.jsx(d.Fragment,{children:Rn?d.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:d.jsx("button",{onClick:bn,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.done")})}):jt?d.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[d.jsx("button",{onClick:()=>{y(2),L(null),b(null),ee([]),at.current=null,G(null),ge([])},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:e("sources.import.back")}),d.jsx("button",{onClick:qt,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.retry")})]}):_n?d.jsx(Ym,{step:x,totalSteps:4,importing:le,stepBusy:R||x===3&&le,canProceed:ia,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>y(Ne=>Ne-1),onNext:()=>{x===2?on():y(Ne=>Ne+1)},onImport:on}):null}),v&&x!==3&&d.jsxs(Qa,{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:[d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),d.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),d.jsx("div",{className:"mt-6 flex justify-end",children:d.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:e("common.confirm")})})]})]})}const Lv=(e,t)=>{let a=0,s=0,i=0;const l=[],u=f=>{for(const m of f)if(m.type==="directory")s++,m.is_git_repo&&i++,m.children&&u(m.children);else if(a++,/\.md$/i.test(m.name)){const h=m.path.startsWith(t)?m.path.slice(t.length).replace(/^\//,""):m.name;l.push(h)}};return u(e),{files:a,dirs:s,gitRepos:i,mdFiles:l}};function tT({rpc:e,selectedPath:t,onSelect:a,allowedPaths:s,importedPaths:i}){const{t:l}=ye(),{atRoot:u,currentPath:f,entries:m,loading:h,error:x,homeDir:y,goToOpen:v,isWildcard:b,importedSet:w,dirs:N,files:j,loadTree:E,handleNavigateUp:R,setGoToOpen:k}=a1({rpc:e,allowedPaths:s??[],importedPaths:i??[]}),O=_.useCallback(T=>{if(T.type!=="directory"||w.has(T.path))return;const P=Lv(T.children||[],T.path);a(T.path,T.name,P),E(T.path)},[a,E,w]);_.useEffect(()=>{if(f&&!u&&m.length>=0&&!h){const T=f.split("/").pop()||f,P=Lv(m,f);a(f,T,P)}},[f,u,m,h,a]);const I=_.useMemo(()=>t?t.split("/").pop()||t:"",[t]),B=_.useMemo(()=>N.sort((T,P)=>T.is_git_repo&&!P.is_git_repo?-1:!T.is_git_repo&&P.is_git_repo?1:T.name.localeCompare(P.name)),[N]),H=_.useMemo(()=>j.sort((T,P)=>T.name.localeCompare(P.name)),[j]);return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u?d.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[d.jsx("span",{children:l("sources.import.allowed_dirs")}),d.jsx(t1,{})]}):d.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:f}),t?d.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[d.jsx(_a,{size:12}),d.jsx("span",{children:I})]}):b&&u?d.jsx("button",{onClick:()=>k(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:l("sources.import.wildcard_goto")}):null]}),d.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),u?b?d.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:y&&d.jsxs("button",{onClick:()=>E(y),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(_a,{size:14,className:"shrink-0"}),d.jsxs("span",{className:"truncate",children:[y,d.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",l("sources.import.wildcard_home"),")"]})]}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):d.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:s.map(T=>d.jsxs("button",{onClick:()=>E(T),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:[d.jsx(_a,{size:14,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:T}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},T))}):x&&!h?d.jsx("p",{className:"py-4 text-xs text-c4a-error",children:x}):d.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&d.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:d.jsx(fn,{size:14,className:"animate-spin text-c4a-text-muted"})}),f!=="/"&&d.jsxs("button",{onClick:R,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:[d.jsx(_a,{size:14}),d.jsx("span",{children:".."})]}),B.map(T=>{const P=w.has(T.path),X=T.is_git_repo?Hu:_a;return d.jsxs("button",{onClick:()=>O(T),disabled:P||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${P?"cursor-not-allowed text-c4a-accent/60":t===T.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[d.jsx(X,{size:14,className:"shrink-0"}),d.jsx("span",{className:"flex-1 truncate",children:T.name}),P&&d.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:l("sources.import.already_imported")}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},T.path)}),H.map(T=>d.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[d.jsx(P_,{size:14,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:T.name})]},T.path)),m.length===0&&!h&&d.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:l("sources.import.no_entries")})]}),d.jsx(n1,{open:v,onClose:()=>k(!1),rpc:e,onNavigate:E,defaultPath:y??void 0})]})}const nT=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),aT=e=>{let t=0,a=0,s=0,i=0,l=0;const u=new Set;for(const f of e)if(f.type==="directory")a++,f.is_git_repo&&l++;else{t++,f.path.toLowerCase().endsWith(".md")&&i++;const h=f.path.split("/").pop();if(h&&nT.has(h.toLowerCase())){const x=f.path.split("/").slice(0,-1).join("/");e.some(v=>v.type==="directory"&&v.is_git_repo&&(x===v.path||x.startsWith(`${v.path}/`)))||u.add(x)}}return s=u.size,{totalFiles:t,totalDirs:a,codePackages:s,docFiles:i,gitRepos:l}};function rT({dirPath:e,rpc:t,importing:a,onScanComplete:s,onBusyChange:i}){const{t:l}=ye(),[u,f]=_.useState(!1),[m,h]=_.useState(null),[x,y]=_.useState(null),v=_.useCallback(async()=>{f(!0),i?.(!0),h(null),y(null);try{const b=await t("fs/dirScan",{path:e}),w=b.entries||[],N=b.manifests||[],j=aT(w);y(j),s(w,j,N)}catch(b){const w=b instanceof Error?b.message:String(b);h(w)}finally{f(!1),i?.(!1)}},[e,t,s,i]);return _.useEffect(()=>{v()},[v]),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[d.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:e}),d.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),d.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[u&&d.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[d.jsx(fn,{size:14,className:"animate-spin text-c4a-accent"}),d.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:l("sources.import.dir_scanning")})]}),m&&d.jsxs("div",{className:"mt-6",children:[d.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[d.jsx(B_,{size:14,className:"mt-0.5 shrink-0"}),l("sources.import.dir_scan_error")]}),d.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:m}),d.jsxs("button",{onClick:v,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(XC,{size:12}),l("sources.import.dir_scan_retry")]})]}),x&&!u&&!m&&d.jsxs("div",{className:"mt-6 space-y-3",children:[d.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[l("sources.import.dir_scan_complete"),"!"]}),d.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[d.jsx(yr,{icon:d.jsx(Wr,{size:14}),label:l("sources.import.dir_doc_files"),value:x.docFiles,tooltip:l("sources.import.dir_doc_files_tip"),size:"lg"}),d.jsx(yr,{icon:d.jsx(Ei,{size:14}),label:l("sources.import.dir_code_packages"),value:x.codePackages,tooltip:l("sources.import.dir_code_packages_tip"),size:"lg"}),x.gitRepos>0&&d.jsx(yr,{icon:d.jsx(Hu,{size:14}),label:l("sources.import.dir_git_repos"),value:x.gitRepos,size:"lg"}),d.jsx(yr,{icon:d.jsx(_a,{size:14}),label:l("sources.import.dir_total_dirs"),value:x.totalDirs,size:"lg"}),d.jsx(yr,{icon:d.jsx(lC,{size:14}),label:l("sources.import.dir_total_files"),value:x.totalFiles,size:"lg"})]}),x.gitRepos>0&&d.jsx("p",{className:"text-xs text-c4a-warning",children:l("sources.import.dir_git_skip_hint",{count:x.gitRepos})})]}),a&&d.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[d.jsx(fn,{size:14,className:"animate-spin text-c4a-accent"}),d.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:l("sources.import.importing")})]})]})]})}function sT(){const{t:e}=ye(),t=Lt(),{libId:a}=xl(),i=Wt(Ds(Ui)).find(P=>P.id===a),l=Iu(P=>P.createSource),[u,f]=_.useState(1),[m,h]=_.useState(!1),[x,y]=_.useState(null),[v,b]=_.useState(!1),[w,N]=_.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),j=i?.is_online??!1,{rpc:E,importedPaths:R,allowedPaths:k}=J_(a,i),O=_.useCallback((P,X,de)=>{N(le=>({...le,dirPath:P,dirName:X,fileCount:de.files,subDirCount:de.dirs,gitRepoCount:de.gitRepos,mdFiles:de.mdFiles}))},[]),I=_.useCallback((P,X,de)=>{N(le=>({...le,scanEntries:P,scanStats:X,manifests:de}))},[]),B=_.useCallback(async()=>{if(a){h(!0);try{const P=await l({library_id:a,dir_files:w.scanEntries,dir_name:w.dirName,dir_path:w.dirPath,dir_file_contents:w.manifests}),X=Array.isArray(P)?P[0]:P;X?.id?t(`/studio/sources/${a}?rootId=${X.id}`):t(`/studio/sources/${a}`)}catch(P){const X=P instanceof Error?P.message:String(P);y(X),h(!1)}}},[a,w,l,t]),H=_.useMemo(()=>u===1?!!w.dirPath:u===2?w.scanEntries.length>0:!0,[u,w]),T=_.useMemo(()=>i?[{label:i.is_default?e("sources.library.default_cloud_name"):i.name,to:`/studio/sources/${i.id}`},{label:e("sources.import.dir_title")}]:[],[i,e]);return i?d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsx("div",{className:"shrink-0",children:d.jsx(As,{segments:T})}),d.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[d.jsx(Fa,{active:u>=1,current:u===1}),d.jsx("span",{className:u===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.select")}),d.jsx(Cs,{}),d.jsx(Fa,{active:u>=2,current:u===2}),d.jsx("span",{className:u===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.confirm")})]}),d.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:j?d.jsxs(d.Fragment,{children:[u===1&&d.jsx(tT,{rpc:E,selectedPath:w.dirPath,onSelect:O,allowedPaths:k,importedPaths:R}),u===2&&d.jsx(rT,{dirPath:w.dirPath,rpc:E,importing:m,onScanComplete:I,onBusyChange:b})]}):d.jsx(Z_,{libraryName:i.name})}),j&&d.jsx(Ym,{step:u,totalSteps:2,importing:m,stepBusy:v,canProceed:H,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>f(P=>P-1),onNext:()=>f(P=>P+1),onImport:B}),x&&d.jsxs(Qa,{onClose:()=>y(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),d.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:x}),d.jsx("div",{className:"mt-6 flex justify-end",children:d.jsx("button",{onClick:()=>y(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("common.confirm")})})]})]}):d.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})})}const iT=/^https:\/\/[^/]+\/.+/;function oT({url:e,onUrlChange:t,onValidChange:a,onRefHint:s}){const{t:i}=ye(),[l,u]=_.useState(null),[f,m]=_.useState([]),h=_.useRef(null);_.useEffect(()=>{ze.get("/import/remote/git-hosts").then(b=>m(b.hosts),()=>{})},[]);const x=_.useCallback(b=>{if(!b){u(null),a(!1);return}const w=IR(b),N=w.repoUrl!==b.trim(),j=N?w.repoUrl:b;N&&(t(j),s?.(w.ref,w.commit)),iT.test(j)?(u(null),a(!0)):(u(i("sources.import_remote.url_invalid")),a(!1))},[t,a,s,i]),y=_.useCallback(b=>{const w=b.target.value;t(w),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>x(w),500)},[t,x]),v=_.useCallback(b=>{b.preventDefault();const w=b.clipboardData.getData("text").trim();t(w),h.current&&clearTimeout(h.current),x(w)},[t,x]);return _.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),_.useEffect(()=>{e&&x(e)},[]),d.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface px-6 py-10",children:d.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[d.jsx("input",{type:"text",value:e,onChange:y,onPaste:v,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}),d.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:l?d.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[d.jsx(br,{size:14,className:"shrink-0"}),l]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{children:f.length>0?d.jsxs(d.Fragment,{children:[i("sources.import_remote.url_hint_public"),f.map((b,w)=>d.jsxs("span",{children:[w>0&&"、",d.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:b})]},b))]}):i("sources.import_remote.url_hint_no_auth")}),d.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:i("sources.import_remote.url_hint_format")})]})})]})})}const Ov=["prepare","clone","scan","save"],Vc={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"},lT={prepare:5,clone:90,scan:95,save:100};function cT(e,t,a){if(e instanceof Ln){const s=e.message.toLowerCase();if(e.status===503)return a("sources.import_remote.error.capacity");if(s.includes("connect")||s.includes("connectionrefused")||s.includes("unavailable")||s.includes("econnrefused"))return a("sources.import_remote.error.network");if(s.includes("authentication")||s.includes("token")||s.includes("credential")||s.includes("401")||s.includes("403"))try{const i=new URL(t).hostname;return a("sources.import_remote.error.auth_required",{host:i})}catch{return a("sources.import_remote.error.auth_required",{host:t})}return s.includes("not found")||s.includes("404")||s.includes("does not exist")?a("sources.import_remote.error.not_found"):e.message||a("sources.import_remote.error.network")}return e instanceof TypeError&&e.message.includes("fetch")?a("sources.import_remote.error.network"):e instanceof Error?e.message:a("sources.import_remote.error.network")}function uT(e){return e==="cloning"?"clone":e==="detecting"||e==="extracting"?"scan":e==="saving"?"save":e}function dT(){const{t:e}=ye(),t=Lt(),{libId:a}=xl(),[s]=$u(),i=s.get("url")||"",l=s.get("ref")||"",u=s.get("sourceUuid")||"",f=s.get("parentId")||"",m=s.get("parentName")||"",h=s.get("parentPath")||"",y=Wt(Ds(Ui)).find(Te=>Te.id===a),[v,b]=_.useState(new Set),w=_.useCallback(async()=>{if(a)try{const Te=new Set;if(f){const ct=(await ze.get(`/sources/${f}`)).tree??[];let tt=h===""?ct:[];if(h){const dt=(Ot,Bt)=>{for(const en of Ot){if(en.path===Bt)return en.children??[];if(en.children){const se=dt(en.children,Bt);if(se.length>0)return se}}return[]};tt=dt(ct,h)}for(const dt of tt)Te.add(dt.name.toLowerCase())}else{const He=await ze.get("/sources",{library_id:a});for(const ct of He.items)Te.add(ct.name.toLowerCase())}b(Te)}catch{}},[a,f,h]);_.useEffect(()=>{w()},[w]);const[N,j]=_.useState(i?2:1),[E,R]=_.useState(i),[k,O]=_.useState(!!i),[I,B]=_.useState(l),[H,T]=_.useState(""),[P,X]=_.useState(!!l),[de,le]=_.useState(""),ce=_.useRef(void 0),D=_.useRef(void 0),[F,A]=_.useState(null),[G,ae]=_.useState(!1),[ee,J]=_.useState(null),[L,q]=_.useState(!1),[re,ie]=_.useState(!1),[ge,xe]=_.useState(null),[Ee,De]=_.useState(null),[qe,vn]=_.useState(null),[zn,$t]=_.useState(null),[at,Nt]=_.useState([]),[Un,lt]=_.useState(null),[hn,on]=_.useState([]),qt=_.useRef(null),bn=_.useRef(""),ia=_.useMemo(()=>Ov.map(Te=>({key:Te,label:Vc[Te]?e(Vc[Te]):Te})),[e]),kn=_.useCallback(Te=>{on(He=>[...He,`[${om()}] ${Te}`])},[]),Rn=_.useRef(null),jt=_.useCallback(Te=>{const He=Rn.current;He&&He!==Te&&(Nt(ct=>ct.includes(He)?ct:[...ct,He]),kn(`${e(Vc[He]??He)} ${e("sources.import.stage.done_suffix")}`)),kn(`${e(Vc[Te]??Te)}...`),Rn.current=Te,$t(Te),lt(null)},[kn,e]),_n=_.useCallback((Te,He)=>{ce.current=Te,D.current=He},[]),Ne=_.useCallback(async Te=>{if(a){ae(!0),J(null);try{const He=await ze.post("/import/remote/refs",{library_id:a,url:E},Te?{signal:Te}:void 0);A(He);const ct=He.branches??[],tt=He.tags??[],dt=[...ct,...tt];dt.length>0&&B(Ot=>{if(Ot)return Ot;const Bt=ce.current,en=D.current;if(Bt){const Be=dt.find(ut=>ut.name===Bt);if(Be)return T(Be.commit),Be.name}en&&T(en);const be=ct.find(Be=>Be.name===He.default)??ct[0];return be?(en||T(be.commit),be.name):Ot})}catch(He){if(Te?.aborted)return;J(cT(He,E,e))}finally{Te?.aborted||ae(!1)}}},[a,E,e]);_.useEffect(()=>{if(N!==2||!a)return;const Te=new AbortController;return Ne(Te.signal),()=>Te.abort()},[N,a,Ne]),_.useEffect(()=>{if(!L)return;let Te="";return Da.on("task/progress",ct=>{const tt=ct,dt=uT(tt.stage??"");dt&&Ov.includes(dt)&&(lt({percent:tt.percent??-1,label:tt.detail??tt.label??""}),tt.detail&&tt.detail!==Te&&(Te=tt.detail,on(Ot=>[...Ot,`[${om()}] ${tt.detail}`])))})},[L]);const $e=_.useCallback(async()=>{if(!a)return;const Te=Date.now();q(!0),ie(!1),De(null),vn(null),Nt([]),Rn.current=null,$t(null),lt(null),on([]),j(3);try{jt("prepare"),await new Promise(be=>setTimeout(be,300)),jt("clone");const He=Qr(E),ct=de||He,tt=h?`${h}/${ct}`:ct,dt=await ze.post("/import/remote/clone",{library_id:a,url:E,ref:I,...H?{commit:H}:{},repo_name:tt});bn.current=dt.commit_hash,jt("scan");const Ot=await ze.post("/import/remote/scan",{library_id:a,path:dt.path,hash:dt.commit_hash});jt("save");const Bt=await ze.post("/import/remote/import",{library_id:a,url:E,ref:I,commit:dt.commit_hash,repo_name:tt,dir_name:ct,repo_files:Ot.files,repo_file_contents:Ot.manifests,...u?{source_uuid:u}:{},...f?{parent_source_id:f,parent_path:h}:{}});Nt(["prepare","clone","scan","save"]),Rn.current=null,$t(null),kn(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),kn(e("sources.import.stage.complete"));const{packages:en,mdFiles:se}=W_(Ot.manifests,Ot.files,He);xe({packages:en,mdFiles:se}),qt.current=Bt.id,await e1(Te),ie(!0),q(!1),j(4)}catch(He){const ct=Rn.current??"prepare";vn(ct),Rn.current=null,$t(null);let tt;He instanceof Ln||He instanceof Error?tt=He.message:tt=String(He),kn(`ERROR: ${tt}`),De(tt),q(!1)}},[a,E,I,H,de,u,f,h,jt,kn]),Xe=_.useCallback(()=>{vn(null),De(null),$e()},[$e]),vt=_.useCallback(()=>{if(a)if(f){const Te=Qr(E),He=de||Te,ct=h?`${h}/${He}`:He;t(`/studio/sources/${a}?rootId=${f}&path=${encodeURIComponent(ct)}`)}else qt.current?t(`/studio/sources/${a}?rootId=${qt.current}`):t(`/studio/sources/${a}`)},[a,t,f,h,de,E]),Tt=(de||Qr(E)).toLowerCase(),ln=v.has(Tt),Yn=_.useMemo(()=>N===1?k:N===2?P&&!ln:!1,[N,k,P,ln]),mn=_.useMemo(()=>{if(!y)return[];const Te=[{label:y.is_default?e("sources.library.default_cloud_name"):y.name,to:`/studio/sources/${y.id}`}];if(f&&(Te.push({label:m||f,to:`/studio/sources/${y.id}?rootId=${f}`}),h)){const He=h.split("/").filter(Boolean);for(const[ct,tt]of He.entries()){const dt=He.slice(0,ct+1).join("/");Te.push({label:tt,to:`/studio/sources/${y.id}?rootId=${f}&path=${encodeURIComponent(dt)}`})}}return Te.push({label:e("sources.import_remote.title")}),Te},[y,f,m,h,e]);if(!y)return d.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Ht=N===4&&re,bt=N===3&&!!qe&&!L,Ft=N<=2;return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsx("div",{className:"shrink-0",children:d.jsx(As,{segments:mn})}),d.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[d.jsx(Fa,{active:N>=1,current:N===1}),d.jsx("span",{className:N===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),d.jsx(Cs,{}),d.jsx(Fa,{active:N>=2,current:N===2}),d.jsx("span",{className:N===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),d.jsx(Cs,{}),d.jsx(Fa,{active:N>=3,current:N===3}),d.jsx("span",{className:N===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),d.jsx(Cs,{}),d.jsx(Fa,{active:N>=4,current:N===4}),d.jsx("span",{className:N===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),d.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[N===1&&d.jsx(oT,{url:E,onUrlChange:R,onValidChange:O,onRefHint:_n}),N===2&&a&&d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[d.jsx(r1,{refs:F,loading:G,error:ee,selectedRef:I,commit:H,onRefChange:B,onCommitChange:T,onValidChange:X,onRetry:()=>Ne()}),!G&&F&&d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:e("sources.import.dir_name")}),d.jsx("input",{type:"text",value:de,onChange:Te=>le(Te.target.value),placeholder:Qr(E),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 ${ln?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),ln?d.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:e("sources.import.dir_name_duplicate")}):d.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:e("sources.import.dir_name_hint")})]})]}),N===3&&d.jsx(s1,{stages:ia,currentStage:zn,completedStages:at,failedStage:qe,progress:Un,breakpoints:lT,failedError:Ee,logs:hn}),N===4&&d.jsx(i1,{repoName:Qr(E),repoIdentifier:E,branch:I,commit:bn.current,packages:ge?.packages??[],mdFiles:ge?.mdFiles??[],importing:!1,completed:re})]}),Ht?d.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:d.jsx("button",{onClick:vt,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.done")})}):bt?d.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[d.jsx("button",{onClick:()=>{j(2),vn(null),De(null),Nt([]),Rn.current=null,$t(null),on([])},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:e("sources.import.back")}),d.jsx("button",{onClick:Xe,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.retry")})]}):Ft?d.jsx(Ym,{step:N,totalSteps:2,importing:!1,stepBusy:G,canProceed:Yn,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>j(Te=>Te-1),onNext:()=>j(Te=>Te+1),onImport:$e}):null]})}function fT(){const{t:e}=ye(),t=Lt(),a=Wt(v=>v.createLibrary),[s,i]=_.useState("waiting"),[l,u]=_.useState(null),[f,m]=_.useState(""),[h,x]=_.useState(!1);_.useEffect(()=>Da.on("ws:daemon:connected",b=>{const w=b;u(w),m(w.machine_id),i(w.needs_registration?"new_client":"reconnected")}),[]),_.useEffect(()=>{let v=!1;return(async()=>{try{const b=await ze.get("/daemons/pending");if(v||b.pending.length===0)return;const w=b.pending[0];u({machine_id:w.machine_id,needs_registration:!0}),m(w.machine_id),i("new_client")}catch{}})(),()=>{v=!0}},[]);const y=_.useCallback(async()=>{if(l){x(!0);try{const v=await a({type:"daemon",name:f||l.machine_id,config:{machine_id:l.machine_id,os:l.os||"",daemon_version:l.daemon_version||""}});t(`/studio/sources/${v.id}`)}catch{x(!1)}}},[l,f,a,t]);return d.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[d.jsx(As,{segments:[{label:e("sources.add_client.title")}]}),d.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:e("sources.add_client.description")}),d.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:d.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[d.jsxs("li",{children:[d.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",e("sources.add_client.step1")]}),d.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 ",d.jsx(Rh,{text:"npm install -g @c4a/daemon"})]})]}),d.jsxs("li",{children:[d.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",e("sources.add_client.step2")]}),d.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}`," ",d.jsx(Rh,{text:`c4a-daemon --server ${window.location.host}`})]}),d.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:e("sources.add_client.step2_allow")}),d.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`," ",d.jsx(Rh,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),d.jsxs("li",{children:[d.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",e("sources.add_client.step3")]}),d.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:e("sources.add_client.step3_desc")})]})]})}),d.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[s==="waiting"&&d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(fn,{size:16,className:"animate-spin text-c4a-warning"}),d.jsx("span",{className:"text-sm text-c4a-warning",children:e("sources.add_client.waiting")})]}),s==="new_client"&&l&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:e("sources.add_client.detected")}),d.jsxs("div",{className:"space-y-2 text-sm",children:[d.jsx(Th,{label:e("sources.add_client.machine_name"),value:l.machine_id}),l.os&&d.jsx(Th,{label:e("sources.add_client.os"),value:l.os}),l.daemon_version&&d.jsx(Th,{label:e("sources.add_client.daemon_version"),value:l.daemon_version})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e("sources.add_client.client_name")}),d.jsx("input",{value:f,onChange:v=>m(v.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"})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[d.jsx("button",{onClick:()=>t("/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:e("common.cancel")}),d.jsxs("button",{onClick:y,disabled:h||!f.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&&d.jsx(fn,{size:12,className:"animate-spin"}),e("sources.add_client.confirm")]})]})]}),s==="reconnected"&&l&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ts,{size:16,className:"text-c4a-success"}),d.jsx("span",{className:"text-sm text-c4a-text-primary",children:e("sources.add_client.reconnected",{name:l.machine_id})})]}),l.lib_id&&d.jsx(ja,{to:`/studio/sources/${l.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:e("sources.add_client.go_to",{name:l.machine_id})})]})]})]})}function Rh({text:e}){const[t,a]=_.useState(!1),s=_.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})},[e]);return d.jsx("button",{type:"button",onClick:s,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:t?d.jsx(ts,{size:13}):d.jsx(Wh,{size:13})})}function Th({label:e,value:t}){return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e}),d.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:t})]})}const o1=_.createContext(null);function l1(){const e=_.useContext(o1);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}function Km({value:e,onChange:t,children:a}){return d.jsx(o1.Provider,{value:{value:e,onChange:t},children:d.jsx("div",{className:"flex flex-1 flex-col",children:a})})}function Xm({children:e}){return d.jsx("div",{className:"flex border-b border-c4a-border-subtle",children:e})}function Va({value:e,children:t}){const{value:a,onChange:s}=l1(),i=a===e;return d.jsx("button",{onClick:()=>s(e),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${i?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:t})}function Sa({value:e,children:t}){const{value:a}=l1();return a!==e?null:d.jsx("div",{className:"flex flex-1 flex-col",children:t})}const hT={accent:"bg-c4a-accent/10 text-c4a-accent/60",success:"bg-c4a-success/10 text-c4a-success",warning:"bg-c4a-warning/10 text-c4a-warning",error:"bg-c4a-error/10 text-c4a-error",muted:"bg-c4a-bg-active text-c4a-text-secondary"};function Vt({children:e,variant:t="accent",tooltip:a}){return d.jsx("span",{className:`inline-block font-mono text-[10px] uppercase px-1.5 py-0.5 rounded-sm ${hT[t]}`,title:a,children:e})}function vl(e){return e===void 0?null:e>=.9?{labelKey:"confidence.high",variant:"success",value:e}:e>=.7?{labelKey:"confidence.ai",variant:"warning",value:e}:{labelKey:"confidence.low",variant:"error",value:e}}const c1="c4a_explorer_mode";function mT(){try{const e=localStorage.getItem(c1);if(e==="append"||e==="replace")return e}catch{}return"append"}const Vo=ns((e,t)=>({tabs:[],activeTabId:null,mode:mT(),openTab:a=>{const{tabs:s,mode:i}=t(),l=s.find(u=>u.id===a.id);if(l){e({activeTabId:l.id});return}if(i==="append")e({tabs:[...s,{...a,isAnchor:!1}],activeTabId:a.id});else{const u=s.find(f=>f.id===t().activeTabId);if(!u||u.isAnchor)e({tabs:[...s,{...a,isAnchor:!1}],activeTabId:a.id});else{const f=s.findIndex(h=>h.id===t().activeTabId),m=[...s];m[f]={...a,isAnchor:!1},e({tabs:m,activeTabId:a.id})}}},closeTab:a=>{const{tabs:s,activeTabId:i}=t(),l=s.find(h=>h.id===a);if(!l||l.isAnchor)return;const u=s.findIndex(h=>h.id===a),f=s.filter(h=>h.id!==a);let m=i;i===a&&(m=f[u-1]?.id??f[0]?.id??null),e({tabs:f,activeTabId:m})},activateTab:a=>{e({activeTabId:a})},closeAll:()=>{const{tabs:a}=t(),s=a.filter(i=>i.isAnchor);e({tabs:s,activeTabId:s[0]?.id??null})},setAnchor:a=>{const s={...a,isAnchor:!0};e({tabs:[s],activeTabId:s.id})},toggleMode:()=>{const a=t().mode==="append"?"replace":"append";try{localStorage.setItem(c1,a)}catch{}e({mode:a})},reset:()=>{e({tabs:[],activeTabId:null})}})),u1=_.createContext(null);function pT({children:e}){const t=Vo(s=>s.openTab),a=_.useCallback((s,i,l,u)=>{t({id:`${s}:${i}`,type:s,resourceId:i,label:l,...u!=null&&{icon:u}})},[t]);return d.jsx(u1.Provider,{value:{active:!0,navigate:a},children:e})}function $i(){return _.useContext(u1)}function d1(e,t){const a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const gT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yT={};function Dv(e,t){return(yT.jsx?xT:gT).test(e)}const vT=/[ \t\n\f\r]/g;function Pu(e){return typeof e=="object"?e.type==="text"?Mv(e.value):!1:Mv(e)}function Mv(e){return e.replace(vT,"")===""}class bl{constructor(t,a,s){this.normal=a,this.property=t,s&&(this.space=s)}}bl.prototype.normal={};bl.prototype.property={};bl.prototype.space=void 0;function f1(e,t){const a={},s={};for(const i of e)Object.assign(a,i.property),Object.assign(s,i.normal);return new bl(a,s,t)}function lm(e){return e.toLowerCase()}class Fn{constructor(t,a){this.attribute=a,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let bT=0;const Ve=Ms(),Jt=Ms(),cm=Ms(),me=Ms(),St=Ms(),Ci=Ms(),ta=Ms();function Ms(){return 2**++bT}const um=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Jt,commaOrSpaceSeparated:ta,commaSeparated:Ci,number:me,overloadedBoolean:cm,spaceSeparated:St},Symbol.toStringTag,{value:"Module"})),Ah=Object.keys(um);class Qm extends Fn{constructor(t,a,s,i){let l=-1;if(super(t,a),zv(this,"space",i),typeof s=="number")for(;++l<Ah.length;){const u=Ah[l];zv(this,Ah[l],(s&um[u])===um[u])}}}Qm.prototype.defined=!0;function zv(e,t,a){a&&(e[t]=a)}function Hi(e){const t={},a={};for(const[s,i]of Object.entries(e.properties)){const l=new Qm(s,e.transform(e.attributes||{},s),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),t[s]=l,a[lm(s)]=s,a[lm(l.attribute)]=s}return new bl(t,a,e.space)}const h1=Hi({properties:{ariaActiveDescendant:null,ariaAtomic:Jt,ariaAutoComplete:null,ariaBusy:Jt,ariaChecked:Jt,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:St,ariaCurrent:null,ariaDescribedBy:St,ariaDetails:null,ariaDisabled:Jt,ariaDropEffect:St,ariaErrorMessage:null,ariaExpanded:Jt,ariaFlowTo:St,ariaGrabbed:Jt,ariaHasPopup:null,ariaHidden:Jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:St,ariaLevel:me,ariaLive:null,ariaModal:Jt,ariaMultiLine:Jt,ariaMultiSelectable:Jt,ariaOrientation:null,ariaOwns:St,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:Jt,ariaReadOnly:Jt,ariaRelevant:null,ariaRequired:Jt,ariaRoleDescription:St,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:Jt,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function m1(e,t){return t in e?e[t]:t}function p1(e,t){return m1(e,t.toLowerCase())}const _T=Hi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ci,acceptCharset:St,accessKey:St,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:St,autoFocus:Ve,autoPlay:Ve,blocking:St,capture:null,charSet:null,checked:Ve,cite:null,className:St,cols:me,colSpan:null,content:null,contentEditable:Jt,controls:Ve,controlsList:St,coords:me|Ci,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:cm,draggable:Jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:St,height:me,hidden:cm,high:me,href:null,hrefLang:null,htmlFor:St,httpEquiv:St,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:St,itemRef:St,itemScope:Ve,itemType:St,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ve,optimum:me,pattern:null,ping:St,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:St,required:Ve,reversed:Ve,rows:me,rowSpan:me,sandbox:St,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:Jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Jt,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:St,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:Jt,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:p1}),ST=Hi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ta,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:St,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ci,g2:Ci,glyphName:Ci,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:ta,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:me,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:St,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ta,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ta,rev:ta,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ta,requiredFeatures:ta,requiredFonts:ta,requiredFormats:ta,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:ta,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ta,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ta,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:m1}),g1=Hi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),x1=Hi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:p1}),y1=Hi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},NT=/[A-Z]/g,Uv=/-[a-z]/g,jT=/^data[-\w.:]+$/i;function v1(e,t){const a=lm(t);let s=t,i=Fn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&jT.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Uv,CT);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Uv.test(l)){let u=l.replace(NT,ET);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}i=Qm}return new i(s,t)}function ET(e){return"-"+e.toLowerCase()}function CT(e){return e.charAt(1).toUpperCase()}const b1=f1([h1,_T,g1,x1,y1],"html"),_l=f1([h1,ST,g1,x1,y1],"svg");function _1(e){return e.join(" ").trim()}var _i={},Lh,$v;function kT(){if($v)return Lh;$v=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
129
+ `,h="/",x="*",y="",v="comment",b="declaration";function w(j,E){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];E=E||{};var R=1,k=1;function O(D){var F=D.match(t);F&&(R+=F.length);var A=D.lastIndexOf(m);k=~A?D.length-A:k+D.length}function I(){var D={line:R,column:k};return function(F){return F.position=new B(D),P(),F}}function B(D){this.start=D,this.end={line:R,column:k},this.source=E.source}B.prototype.content=j;function H(D){var F=new Error(E.source+":"+R+":"+k+": "+D);if(F.reason=D,F.filename=E.source,F.line=R,F.column=k,F.source=j,!E.silent)throw F}function T(D){var F=D.exec(j);if(F){var A=F[0];return O(A),j=j.slice(A.length),F}}function P(){T(a)}function X(D){var F;for(D=D||[];F=de();)F!==!1&&D.push(F);return D}function de(){var D=I();if(!(h!=j.charAt(0)||x!=j.charAt(1))){for(var F=2;y!=j.charAt(F)&&(x!=j.charAt(F)||h!=j.charAt(F+1));)++F;if(F+=2,y===j.charAt(F-1))return H("End of comment missing");var A=j.slice(2,F-2);return k+=2,O(A),j=j.slice(F),k+=2,D({type:v,comment:A})}}function le(){var D=I(),F=T(s);if(F){if(de(),!T(i))return H("property missing ':'");var A=T(l),G=D({type:b,property:N(F[0].replace(e,y)),value:A?N(A[0].replace(e,y)):y});return T(u),G}}function ce(){var D=[];X(D);for(var F;F=le();)F!==!1&&(D.push(F),X(D));return D}return P(),ce()}function N(j){return j?j.replace(f,y):y}return Lh=w,Lh}var Hv;function RT(){if(Hv)return _i;Hv=1;var e=_i&&_i.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=a;const t=e(kT());function a(s,i){let l=null;if(!s||typeof s!="string")return l;const u=(0,t.default)(s),f=typeof i=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:x}=m;f?i(h,x,m):x&&(l=l||{},l[h]=x)}),l}return _i}var Mo={},Bv;function TT(){if(Bv)return Mo;Bv=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(h){return!h||a.test(h)||e.test(h)},u=function(h,x){return x.toUpperCase()},f=function(h,x){return"".concat(x,"-")},m=function(h,x){return x===void 0&&(x={}),l(h)?h:(h=h.toLowerCase(),x.reactCompat?h=h.replace(i,f):h=h.replace(s,f),h.replace(t,u))};return Mo.camelCase=m,Mo}var zo,Iv;function AT(){if(Iv)return zo;Iv=1;var e=zo&&zo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(RT()),a=TT();function s(i,l){var u={};return!i||typeof i!="string"||(0,t.default)(i,function(f,m){f&&m&&(u[(0,a.camelCase)(f,l)]=m)}),u}return s.default=s,zo=s,zo}var LT=AT();const OT=Kb(LT),DT=MT("start");function MT(e){return t;function t(a){const s=a&&a.position&&a.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function zT(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Pv(e.position):"start"in e||"end"in e?Pv(e):"line"in e||"column"in e?dm(e):""}function dm(e){return Gv(e&&e.line)+":"+Gv(e&&e.column)}function Pv(e){return dm(e&&e.start)+"-"+dm(e&&e.end)}function Gv(e){return e&&typeof e=="number"?e:1}class Dn extends Error{constructor(t,a,s){super(),typeof a=="string"&&(s=a,a=void 0);let i="",l={},u=!1;if(a&&("line"in a&&"column"in a?l={place:a}:"start"in a&&"end"in a?l={place:a}:"type"in a?l={ancestors:[a],place:a.position}:l={...a}),typeof t=="string"?i=t:!l.cause&&t&&(u=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof s=="string"){const m=s.indexOf(":");m===-1?l.ruleId=s:(l.source=s.slice(0,m),l.ruleId=s.slice(m+1))}if(!l.place&&l.ancestors&&l.ancestors){const m=l.ancestors[l.ancestors.length-1];m&&(l.place=m.position)}const f=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=f?f.line:void 0,this.name=zT(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dn.prototype.file="";Dn.prototype.name="";Dn.prototype.reason="";Dn.prototype.message="";Dn.prototype.stack="";Dn.prototype.column=void 0;Dn.prototype.line=void 0;Dn.prototype.ancestors=void 0;Dn.prototype.cause=void 0;Dn.prototype.fatal=void 0;Dn.prototype.place=void 0;Dn.prototype.ruleId=void 0;Dn.prototype.source=void 0;const Zm={}.hasOwnProperty,UT=new Map,$T=/[A-Z]/g,HT=new Set(["table","tbody","thead","tfoot","tr"]),BT=new Set(["td","th"]),S1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function IT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=XT(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=KT(a,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?_l:b1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=w1(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function w1(e,t,a){if(t.type==="element")return PT(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return GT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return qT(e,t,a);if(t.type==="mdxjsEsm")return VT(e,t);if(t.type==="root")return FT(e,t,a);if(t.type==="text")return YT(e,t)}function PT(e,t,a){const s=e.schema;let i=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(i=_l,e.schema=i),e.ancestors.push(t);const l=j1(e,t.tagName,!1),u=QT(e,t);let f=Wm(e,t);return HT.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!Pu(m):!0})),N1(e,u,l,t),Jm(u,f),e.ancestors.pop(),e.schema=s,e.create(t,l,u,a)}function GT(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}rl(e,t.position)}function VT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);rl(e,t.position)}function qT(e,t,a){const s=e.schema;let i=s;t.name==="svg"&&s.space==="html"&&(i=_l,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:j1(e,t.name,!0),u=ZT(e,t),f=Wm(e,t);return N1(e,u,l,t),Jm(u,f),e.ancestors.pop(),e.schema=s,e.create(t,l,u,a)}function FT(e,t,a){const s={};return Jm(s,Wm(e,t)),e.create(t,e.Fragment,s,a)}function YT(e,t){return t.value}function N1(e,t,a,s){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=s)}function Jm(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function KT(e,t,a){return s;function s(i,l,u,f){const h=Array.isArray(u.children)?a:t;return f?h(l,u,f):h(l,u)}}function XT(e,t){return a;function a(s,i,l,u){const f=Array.isArray(l.children),m=DT(s);return t(i,l,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function QT(e,t){const a={};let s,i;for(i in t.properties)if(i!=="children"&&Zm.call(t.properties,i)){const l=JT(e,i,t.properties[i]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&BT.has(t.tagName)?s=f:a[u]=f}}if(s){const l=a.style||(a.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return a}function ZT(e,t){const a={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const l=s.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else rl(e,t.position);else{const i=s.name;let l;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const f=s.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else rl(e,t.position);else l=s.value===null?!0:s.value;a[i]=l}return a}function Wm(e,t){const a=[];let s=-1;const i=e.passKeys?new Map:UT;for(;++s<t.children.length;){const l=t.children[s];let u;if(e.passKeys){const m=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(m){const h=i.get(m)||0;u=m+"-"+h,i.set(m,h+1)}}const f=w1(e,l,u);f!==void 0&&a.push(f)}return a}function JT(e,t,a){const s=v1(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=s.commaSeparated?d1(a):_1(a)),s.property==="style"){let i=typeof a=="object"?a:WT(e,String(a));return e.stylePropertyNameCase==="css"&&(i=eA(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&s.space?wT[s.property]||s.property:s.attribute,a]}}function WT(e,t){try{return OT(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const s=a,i=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=S1+"#cannot-parse-style-attribute",i}}function j1(e,t,a){let s;if(!a)s={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,u;for(;++l<i.length;){const f=Dv(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}s=u}else s=Dv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const i=s.value;return Zm.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(s);rl(e)}function rl(e,t){const a=new Dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=S1+"#cannot-handle-mdx-estrees-without-createevaluater",a}function eA(e){const t={};let a;for(a in e)Zm.call(e,a)&&(t[tA(a)]=e[a]);return t}function tA(e){let t=e.replace($T,nA);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nA(e){return"-"+e.toLowerCase()}var fm=Object.defineProperty,aA=Object.getOwnPropertyDescriptor,rA=Object.getOwnPropertyNames,sA=Object.prototype.hasOwnProperty,iA=(e,t)=>{let a={};for(var s in e)fm(a,s,{get:e[s],enumerable:!0});return fm(a,Symbol.toStringTag,{value:"Module"}),a},oA=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=rA(t),l=0,u=i.length,f;l<u;l++)f=i[l],!sA.call(e,f)&&f!==a&&fm(e,f,{get:(m=>t[m]).bind(null,f),enumerable:!(s=aA(t,f))||s.enumerable});return e},lA=(e,t,a)=>(oA(e,t,"default"),a),wt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function cA(e){return ep(e)}function ep(e){return Array.isArray(e)?uA(e):e instanceof RegExp?e:typeof e=="object"?dA(e):e}function uA(e){let t=[];for(let a=0,s=e.length;a<s;a++)t[a]=ep(e[a]);return t}function dA(e){let t={};for(let a in e)t[a]=ep(e[a]);return t}function E1(e,...t){return t.forEach(a=>{for(let s in a)e[s]=a[s]}),e}function C1(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?C1(e.substring(0,e.length-1)):e.substr(~t+1)}var Oh=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,qc=class{static hasCaptures(e){return e===null?!1:(Oh.lastIndex=0,Oh.test(e))}static replaceCaptures(e,t,a){return e.replace(Oh,(s,i,l,u)=>{let f=a[parseInt(i||l,10)];if(f){let m=t.substring(f.start,f.end);for(;m[0]===".";)m=m.substring(1);switch(u){case"downcase":return m.toLowerCase();case"upcase":return m.toUpperCase();default:return m}}else return s})}};function k1(e,t){return e<t?-1:e>t?1:0}function R1(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let a=e.length,s=t.length;if(a===s){for(let i=0;i<a;i++){let l=k1(e[i],t[i]);if(l!==0)return l}return 0}return a-s}function Vv(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function T1(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var A1=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},xu=class{constructor(e,t,a){this._colorMap=e,this._defaults=t,this._root=a}static createFromRawTheme(e,t){return this.createFromParsedTheme(mA(e),t)}static createFromParsedTheme(e,t){return gA(e,t)}_cachedMatchRoot=new A1(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,s=this._cachedMatchRoot.get(t).find(i=>fA(e.parent,i.parentScopes));return s?new L1(s.fontStyle,s.foreground,s.background):null}},Dh=class ou{constructor(t,a){this.parent=t,this.scopeName=a}static push(t,a){for(const s of a)t=new ou(t,s);return t}static from(...t){let a=null;for(let s=0;s<t.length;s++)a=new ou(a,t[s]);return a}push(t){return new ou(this,t)}getSegments(){let t=this;const a=[];for(;t;)a.push(t.scopeName),t=t.parent;return a.reverse(),a}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const a=[];let s=this;for(;s&&s!==t;)a.push(s.scopeName),s=s.parent;return s===t?a.reverse():void 0}};function fA(e,t){if(t.length===0)return!0;for(let a=0;a<t.length;a++){let s=t[a],i=!1;if(s===">"){if(a===t.length-1)return!1;s=t[++a],i=!0}for(;e&&!hA(e.scopeName,s);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function hA(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var L1=class{constructor(e,t,a){this.fontStyle=e,this.foregroundId=t,this.backgroundId=a}};function mA(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,a=[],s=0;for(let i=0,l=t.length;i<l;i++){let u=t[i];if(!u.settings)continue;let f;if(typeof u.scope=="string"){let y=u.scope;y=y.replace(/^[,]+/,""),y=y.replace(/[,]+$/,""),f=y.split(",")}else Array.isArray(u.scope)?f=u.scope:f=[""];let m=-1;if(typeof u.settings.fontStyle=="string"){m=0;let y=u.settings.fontStyle.split(" ");for(let v=0,b=y.length;v<b;v++)switch(y[v]){case"italic":m=m|1;break;case"bold":m=m|2;break;case"underline":m=m|4;break;case"strikethrough":m=m|8;break}}let h=null;typeof u.settings.foreground=="string"&&Vv(u.settings.foreground)&&(h=u.settings.foreground);let x=null;typeof u.settings.background=="string"&&Vv(u.settings.background)&&(x=u.settings.background);for(let y=0,v=f.length;y<v;y++){let w=f[y].trim().split(" "),N=w[w.length-1],j=null;w.length>1&&(j=w.slice(0,w.length-1),j.reverse()),a[s++]=new pA(N,j,i,m,h,x)}}return a}var pA=class{constructor(e,t,a,s,i,l){this.scope=e,this.parentScopes=t,this.index=a,this.fontStyle=s,this.foreground=i,this.background=l}},En=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(En||{});function gA(e,t){e.sort((m,h)=>{let x=k1(m.scope,h.scope);return x!==0||(x=R1(m.parentScopes,h.parentScopes),x!==0)?x:m.index-h.index});let a=0,s="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let m=e.shift();m.fontStyle!==-1&&(a=m.fontStyle),m.foreground!==null&&(s=m.foreground),m.background!==null&&(i=m.background)}let l=new xA(t),u=new L1(a,l.getId(s),l.getId(i)),f=new vA(new hm(0,null,-1,0,0),[]);for(let m=0,h=e.length;m<h;m++){let x=e[m];f.insert(0,x.scope,x.parentScopes,x.fontStyle,l.getId(x.foreground),l.getId(x.background))}return new xu(l,u,f)}var xA=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,a=e.length;t<a;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},yA=Object.freeze([]),hm=class O1{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,a,s,i,l){this.scopeDepth=t,this.parentScopes=a||yA,this.fontStyle=s,this.foreground=i,this.background=l}clone(){return new O1(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let a=[];for(let s=0,i=t.length;s<i;s++)a[s]=t[s].clone();return a}acceptOverwrite(t,a,s,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,a!==-1&&(this.fontStyle=a),s!==0&&(this.foreground=s),i!==0&&(this.background=i)}},vA=class mm{constructor(t,a=[],s={}){this._mainRule=t,this._children=s,this._rulesWithParentScopes=a}_rulesWithParentScopes;static _cmpBySpecificity(t,a){if(t.scopeDepth!==a.scopeDepth)return a.scopeDepth-t.scopeDepth;let s=0,i=0;for(;t.parentScopes[s]===">"&&s++,a.parentScopes[i]===">"&&i++,!(s>=t.parentScopes.length||i>=a.parentScopes.length);){const l=a.parentScopes[i].length-t.parentScopes[s].length;if(l!==0)return l;s++,i++}return a.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let s=t.indexOf("."),i,l;if(s===-1?(i=t,l=""):(i=t.substring(0,s),l=t.substring(s+1)),this._children.hasOwnProperty(i))return this._children[i].match(l)}const a=this._rulesWithParentScopes.concat(this._mainRule);return a.sort(mm._cmpBySpecificity),a}insert(t,a,s,i,l,u){if(a===""){this._doInsertHere(t,s,i,l,u);return}let f=a.indexOf("."),m,h;f===-1?(m=a,h=""):(m=a.substring(0,f),h=a.substring(f+1));let x;this._children.hasOwnProperty(m)?x=this._children[m]:(x=new mm(this._mainRule.clone(),hm.cloneArr(this._rulesWithParentScopes)),this._children[m]=x),x.insert(t+1,h,s,i,l,u)}_doInsertHere(t,a,s,i,l){if(a===null){this._mainRule.acceptOverwrite(t,s,i,l);return}for(let u=0,f=this._rulesWithParentScopes.length;u<f;u++){let m=this._rulesWithParentScopes[u];if(R1(m.parentScopes,a)===0){m.acceptOverwrite(t,s,i,l);return}}s===-1&&(s=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new hm(t,a,s,i,l))}},Li=class va{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const a=va.getLanguageId(t),s=va.getTokenType(t),i=va.getFontStyle(t),l=va.getForeground(t),u=va.getBackground(t);console.log({languageId:a,tokenType:s,fontStyle:i,foreground:l,background:u})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,a,s,i,l,u,f){let m=va.getLanguageId(t),h=va.getTokenType(t),x=va.containsBalancedBrackets(t)?1:0,y=va.getFontStyle(t),v=va.getForeground(t),b=va.getBackground(t);return a!==0&&(m=a),s!==8&&(h=s),i!==null&&(x=i?1:0),l!==-1&&(y=l),u!==0&&(v=u),f!==0&&(b=f),(m<<0|h<<8|x<<10|y<<11|v<<15|b<<24)>>>0}};function yu(e,t){const a=[],s=bA(e);let i=s.next();for(;i!==null;){let m=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":m=1;break;case"L":m=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=s.next()}let h=u();if(a.push({matcher:h,priority:m}),i!==",")break;i=s.next()}return a;function l(){if(i==="-"){i=s.next();const m=l();return h=>!!m&&!m(h)}if(i==="("){i=s.next();const m=f();return i===")"&&(i=s.next()),m}if(qv(i)){const m=[];do m.push(i),i=s.next();while(qv(i));return h=>t(m,h)}return null}function u(){const m=[];let h=l();for(;h;)m.push(h),h=l();return x=>m.every(y=>y(x))}function f(){const m=[];let h=u();for(;h&&(m.push(h),i==="|"||i===",");){do i=s.next();while(i==="|"||i===",");h=u()}return x=>m.some(y=>y(x))}}function qv(e){return!!e&&!!e.match(/[\w\.:]+/)}function bA(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,a=t.exec(e);return{next:()=>{if(!a)return null;const s=a[0];return a=t.exec(e),s}}}function D1(e){typeof e.dispose=="function"&&e.dispose()}var sl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_A=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},SA=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},wA=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new sl(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new SA;for(const a of e)NA(a,this.initialScopeName,this.repo,t);for(const a of t.references)if(a instanceof sl){if(this.seenFullScopeRequests.has(a.scopeName))continue;this.seenFullScopeRequests.add(a.scopeName),this.Q.push(a)}else{if(this.seenFullScopeRequests.has(a.scopeName)||this.seenPartialScopeRequests.has(a.toKey()))continue;this.seenPartialScopeRequests.add(a.toKey()),this.Q.push(a)}}};function NA(e,t,a,s){const i=a.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=a.lookup(t);e instanceof sl?lu({baseGrammar:l,selfGrammar:i},s):pm(e.ruleName,{baseGrammar:l,selfGrammar:i,repository:i.repository},s);const u=a.injections(e.scopeName);if(u)for(const f of u)s.add(new sl(f))}function pm(e,t,a){if(t.repository&&t.repository[e]){const s=t.repository[e];vu([s],t,a)}}function lu(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&vu(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&vu(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function vu(e,t,a){for(const s of e){if(a.visitedRule.has(s))continue;a.visitedRule.add(s);const i=s.repository?E1({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&vu(s.patterns,{...t,repository:i},a);const l=s.include;if(!l)continue;const u=M1(l);switch(u.kind){case 0:lu({...t,selfGrammar:t.baseGrammar},a);break;case 1:lu(t,a);break;case 2:pm(u.ruleName,{...t,repository:i},a);break;case 3:case 4:const f=u.scopeName===t.selfGrammar.scopeName?t.selfGrammar:u.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(f){const m={baseGrammar:t.baseGrammar,selfGrammar:f,repository:i};u.kind===4?pm(u.ruleName,m,a):lu(m,a)}else u.kind===4?a.add(new _A(u.scopeName,u.ruleName)):a.add(new sl(u.scopeName));break}}}var jA=class{kind=0},EA=class{kind=1},CA=class{constructor(e){this.ruleName=e}kind=2},kA=class{constructor(e){this.scopeName=e}kind=3},RA=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function M1(e){if(e==="$base")return new jA;if(e==="$self")return new EA;const t=e.indexOf("#");if(t===-1)return new kA(e);if(t===0)return new CA(e.substring(1));{const a=e.substring(0,t),s=e.substring(t+1);return new RA(a,s)}}var TA=/\\(\d+)/,Fv=/\\(\d+)/g,AA=-1,z1=-2;var Sl=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,a,s){this.$location=e,this.id=t,this._name=a||null,this._nameIsCapturing=qc.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=qc.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${C1(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:qc.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:qc.replaceCaptures(this._contentName,e,t)}},LA=class extends Sl{retokenizeCapturedWithRuleId;constructor(e,t,a,s,i){super(e,t,a,s),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,a,s){throw new Error("Not supported!")}},OA=class extends Sl{_match;captures;_cachedCompiledPatterns;constructor(e,t,a,s,i){super(e,t,a,null),this._match=new il(s,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,a,s){return this._getCachedCompiledPatterns(e).compileAG(e,a,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ol,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Yv=class extends Sl{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,a,s,i){super(e,t,a,s),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const a of this.patterns)e.getRule(a).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,a,s){return this._getCachedCompiledPatterns(e).compileAG(e,a,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ol,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},gm=class extends Sl{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,a,s,i,l,u,f,m,h){super(e,t,a,s),this._begin=new il(i,this.id),this.beginCaptures=l,this._end=new il(u||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=f,this.applyEndPatternLast=m||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,a,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,a,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ol;for(const a of this.patterns)e.getRule(a).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},bu=class extends Sl{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,a,s,i,l,u,f,m){super(e,t,a,s),this._begin=new il(i,this.id),this.beginCaptures=l,this.whileCaptures=f,this._while=new il(u,z1),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=m.patterns,this.hasMissingPatterns=m.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,a,s){return this._getCachedCompiledPatterns(e).compileAG(e,a,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ol;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,a,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,a,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ol,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},U1=class Nn{static createCaptureRule(t,a,s,i,l){return t.registerRule(u=>new LA(a,u,s,i,l))}static getCompiledRuleId(t,a,s){return t.id||a.registerRule(i=>{if(t.id=i,t.match)return new OA(t.$vscodeTextmateLocation,t.id,t.name,t.match,Nn._compileCaptures(t.captures,a,s));if(typeof t.begin>"u"){t.repository&&(s=E1({},s,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new Yv(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Nn._compilePatterns(l,a,s))}return t.while?new bu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Nn._compileCaptures(t.beginCaptures||t.captures,a,s),t.while,Nn._compileCaptures(t.whileCaptures||t.captures,a,s),Nn._compilePatterns(t.patterns,a,s)):new gm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Nn._compileCaptures(t.beginCaptures||t.captures,a,s),t.end,Nn._compileCaptures(t.endCaptures||t.captures,a,s),t.applyEndPatternLast,Nn._compilePatterns(t.patterns,a,s))}),t.id}static _compileCaptures(t,a,s){let i=[];if(t){let l=0;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const f=parseInt(u,10);f>l&&(l=f)}for(let u=0;u<=l;u++)i[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const f=parseInt(u,10);let m=0;t[u].patterns&&(m=Nn.getCompiledRuleId(t[u],a,s)),i[f]=Nn.createCaptureRule(a,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,m)}}return i}static _compilePatterns(t,a,s){let i=[];if(t)for(let l=0,u=t.length;l<u;l++){const f=t[l];let m=-1;if(f.include){const h=M1(f.include);switch(h.kind){case 0:case 1:m=Nn.getCompiledRuleId(s[f.include],a,s);break;case 2:let x=s[h.ruleName];x&&(m=Nn.getCompiledRuleId(x,a,s));break;case 3:case 4:const y=h.scopeName,v=h.kind===4?h.ruleName:null,b=a.getExternalGrammar(y,s);if(b)if(v){let w=b.repository[v];w&&(m=Nn.getCompiledRuleId(w,a,b.repository))}else m=Nn.getCompiledRuleId(b.repository.$self,a,b.repository);break}}else m=Nn.getCompiledRuleId(f,a,s);if(m!==-1){const h=a.getRule(m);let x=!1;if((h instanceof Yv||h instanceof gm||h instanceof bu)&&h.hasMissingPatterns&&h.patterns.length===0&&(x=!0),x)continue;i.push(m)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},il=class $1{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,a){if(t&&typeof t=="string"){const s=t.length;let i=0,l=[],u=!1;for(let f=0;f<s;f++)if(t.charAt(f)==="\\"&&f+1<s){const h=t.charAt(f+1);h==="z"?(l.push(t.substring(i,f)),l.push("$(?!\\n)(?<!\\n)"),i=f+2):(h==="A"||h==="G")&&(u=!0),f++}this.hasAnchor=u,i===0?this.source=t:(l.push(t.substring(i,s)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=a,typeof this.source=="string"?this.hasBackReferences=TA.test(this.source):this.hasBackReferences=!1}clone(){return new $1(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,a){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=a.map(i=>t.substring(i.start,i.end));return Fv.lastIndex=0,this.source.replace(Fv,(i,l)=>T1(s[parseInt(l,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],a=[],s=[],i=[],l,u,f,m;for(l=0,u=this.source.length;l<u;l++)f=this.source.charAt(l),t[l]=f,a[l]=f,s[l]=f,i[l]=f,f==="\\"&&l+1<u&&(m=this.source.charAt(l+1),m==="A"?(t[l+1]="￿",a[l+1]="￿",s[l+1]="A",i[l+1]="A"):m==="G"?(t[l+1]="￿",a[l+1]="G",s[l+1]="￿",i[l+1]="G"):(t[l+1]=m,a[l+1]=m,s[l+1]=m,i[l+1]=m),l++);return{A0_G0:t.join(""),A0_G1:a.join(""),A1_G0:s.join(""),A1_G1:i.join("")}}resolveAnchors(t,a){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?a?this._anchorCache.A1_G1:this._anchorCache.A1_G0:a?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ol=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(a=>a.source);this._cached=new Kv(e,t,this._items.map(a=>a.ruleId))}return this._cached}compileAG(e,t,a){return this._hasAnchors?t?a?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,a)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,a)),this._anchorCache.A1_G0):a?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,a)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,a)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,a){let s=this._items.map(i=>i.resolveAnchors(t,a));return new Kv(e,s,this._items.map(i=>i.ruleId))}},Kv=class{constructor(e,t,a){this.regExps=t,this.rules=a,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,a=this.rules.length;t<a;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
130
+ `)}findNextMatchSync(e,t,a){const s=this.scanner.findNextMatchSync(e,t,a);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Mh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},DA=class xm{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,a){this._defaultAttributes=new Mh(t,8),this._embeddedLanguagesMatcher=new MA(Object.entries(a||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?xm._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Mh(0,0);_getBasicScopeAttributes=new A1(t=>{const a=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Mh(a,s)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const a=t.match(xm.STANDARD_TOKEN_TYPE_REGEXP);if(!a)return 8;switch(a[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},MA=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([a,s])=>T1(a));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Xv=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function H1(e,t,a,s,i,l,u,f){const m=t.content.length;let h=!1,x=-1;if(u){const b=zA(e,t,a,s,i,l);i=b.stack,s=b.linePos,a=b.isFirstLine,x=b.anchorPosition}const y=Date.now();for(;!h;){if(f!==0&&Date.now()-y>f)return new Xv(i,!0);v()}return new Xv(i,!1);function v(){const b=UA(e,t,a,s,i,x);if(!b){l.produce(i,m),h=!0;return}const w=b.captureIndices,N=b.matchedRuleId,j=w&&w.length>0?w[0].end>s:!1;if(N===AA){const E=i.getRule(e);l.produce(i,w[0].start),i=i.withContentNameScopesList(i.nameScopesList),qo(e,t,a,i,l,E.endCaptures,w),l.produce(i,w[0].end);const R=i;if(i=i.parent,x=R.getAnchorPos(),!j&&R.getEnterPos()===s){i=R,l.produce(i,m),h=!0;return}}else{const E=e.getRule(N);l.produce(i,w[0].start);const R=i,k=E.getName(t.content,w),O=i.contentNameScopesList.pushAttributed(k,e);if(i=i.push(N,s,x,w[0].end===m,null,O,O),E instanceof gm){const I=E;qo(e,t,a,i,l,I.beginCaptures,w),l.produce(i,w[0].end),x=w[0].end;const B=I.getContentName(t.content,w),H=O.pushAttributed(B,e);if(i=i.withContentNameScopesList(H),I.endHasBackReferences&&(i=i.withEndRule(I.getEndWithResolvedBackReferences(t.content,w))),!j&&R.hasSameRuleAs(i)){i=i.pop(),l.produce(i,m),h=!0;return}}else if(E instanceof bu){const I=E;qo(e,t,a,i,l,I.beginCaptures,w),l.produce(i,w[0].end),x=w[0].end;const B=I.getContentName(t.content,w),H=O.pushAttributed(B,e);if(i=i.withContentNameScopesList(H),I.whileHasBackReferences&&(i=i.withEndRule(I.getWhileWithResolvedBackReferences(t.content,w))),!j&&R.hasSameRuleAs(i)){i=i.pop(),l.produce(i,m),h=!0;return}}else if(qo(e,t,a,i,l,E.captures,w),l.produce(i,w[0].end),i=i.pop(),!j){i=i.safePop(),l.produce(i,m),h=!0;return}}w[0].end>s&&(s=w[0].end,a=!1)}}function zA(e,t,a,s,i,l){let u=i.beginRuleCapturedEOL?0:-1;const f=[];for(let m=i;m;m=m.pop()){const h=m.getRule(e);h instanceof bu&&f.push({rule:h,stack:m})}for(let m=f.pop();m;m=f.pop()){const{ruleScanner:h,findOptions:x}=BA(m.rule,e,m.stack.endRule,a,s===u),y=h.findNextMatchSync(t,s,x);if(y){if(y.ruleId!==z1){i=m.stack.pop();break}y.captureIndices&&y.captureIndices.length&&(l.produce(m.stack,y.captureIndices[0].start),qo(e,t,a,m.stack,l,m.rule.whileCaptures,y.captureIndices),l.produce(m.stack,y.captureIndices[0].end),u=y.captureIndices[0].end,y.captureIndices[0].end>s&&(s=y.captureIndices[0].end,a=!1))}else{i=m.stack.pop();break}}return{stack:i,linePos:s,anchorPosition:u,isFirstLine:a}}function UA(e,t,a,s,i,l){const u=$A(e,t,a,s,i,l),f=e.getInjections();if(f.length===0)return u;const m=HA(f,e,t,a,s,i,l);if(!m)return u;if(!u)return m;const h=u.captureIndices[0].start,x=m.captureIndices[0].start;return x<h||m.priorityMatch&&x===h?m:u}function $A(e,t,a,s,i,l){const u=i.getRule(e),{ruleScanner:f,findOptions:m}=B1(u,e,i.endRule,a,s===l),h=f.findNextMatchSync(t,s,m);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function HA(e,t,a,s,i,l,u){let f=Number.MAX_VALUE,m=null,h,x=0;const y=l.contentNameScopesList.getScopeNames();for(let v=0,b=e.length;v<b;v++){const w=e[v];if(!w.matcher(y))continue;const N=t.getRule(w.ruleId),{ruleScanner:j,findOptions:E}=B1(N,t,null,s,i===u),R=j.findNextMatchSync(a,i,E);if(!R)continue;const k=R.captureIndices[0].start;if(!(k>=f)&&(f=k,m=R.captureIndices,h=R.ruleId,x=w.priority,f===i))break}return m?{priorityMatch:x===-1,captureIndices:m,matchedRuleId:h}:null}function B1(e,t,a,s,i){return{ruleScanner:e.compileAG(t,a,s,i),findOptions:0}}function BA(e,t,a,s,i){return{ruleScanner:e.compileWhileAG(t,a,s,i),findOptions:0}}function qo(e,t,a,s,i,l,u){if(l.length===0)return;const f=t.content,m=Math.min(l.length,u.length),h=[],x=u[0].end;for(let y=0;y<m;y++){const v=l[y];if(v===null)continue;const b=u[y];if(b.length===0)continue;if(b.start>x)break;for(;h.length>0&&h[h.length-1].endPos<=b.start;)i.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?i.produceFromScopes(h[h.length-1].scopes,b.start):i.produce(s,b.start),v.retokenizeCapturedWithRuleId){const N=v.getName(f,u),j=s.contentNameScopesList.pushAttributed(N,e),E=v.getContentName(f,u),R=j.pushAttributed(E,e),k=s.push(v.retokenizeCapturedWithRuleId,b.start,-1,!1,null,j,R),O=e.createOnigString(f.substring(0,b.end));H1(e,O,a&&b.start===0,b.start,k,i,!1,0),D1(O);continue}const w=v.getName(f,u);if(w!==null){const j=(h.length>0?h[h.length-1].scopes:s.contentNameScopesList).pushAttributed(w,e);h.push(new IA(j,b.end))}}for(;h.length>0;)i.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var IA=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function PA(e,t,a,s,i,l,u,f){return new VA(e,t,a,s,i,l,u,f)}function Qv(e,t,a,s,i){const l=yu(t,_u),u=U1.getCompiledRuleId(a,s,i.repository);for(const f of l)e.push({debugSelector:t,matcher:f.matcher,ruleId:u,grammar:i,priority:f.priority})}function _u(e,t){if(t.length<e.length)return!1;let a=0;return e.every(s=>{for(let i=a;i<t.length;i++)if(GA(t[i],s))return a=i+1,!0;return!1})}function GA(e,t){if(!e)return!1;if(e===t)return!0;const a=t.length;return e.length>a&&e.substr(0,a)===t&&e[a]==="."}var VA=class{constructor(e,t,a,s,i,l,u,f){if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=f,this._basicScopeAttributesProvider=new DA(a,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=u,this._grammar=Zv(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const m of Object.keys(i)){const h=yu(m,_u);for(const x of h)this._tokenTypeMatchers.push({matcher:x.matcher,type:i[m]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],a=this._rootScopeName,s=e.lookup(a);if(s){const i=s.injections;if(i)for(let u in i)Qv(t,u,i[u],this,s);const l=this._grammarRepository.injections(a);l&&l.forEach(u=>{const f=this.getExternalGrammar(u);if(f){const m=f.injectionSelector;m&&Qv(t,m,f,this,f)}})}return t.sort((i,l)=>i.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,a=e(t);return this._ruleId2desc[t]=a,a}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const a=this._grammarRepository.lookup(e);if(a)return this._includedGrammars[e]=Zv(a,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,a=0){const s=this._tokenize(e,t,!1,a);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(e,t,a=0){const s=this._tokenize(e,t,!0,a);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(e,t,a,s){this._rootId===-1&&(this._rootId=U1.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===ym.NULL){i=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),x=this.themeProvider.getDefaults(),y=Li.set(0,h.languageId,h.tokenType,null,x.fontStyle,x.foregroundId,x.backgroundId),v=this.getRule(this._rootId).getName(null,null);let b;v?b=Zo.createRootAndLookUpScopeName(v,y,this):b=Zo.createRoot("unknown",y),t=new ym(null,this._rootId,-1,-1,!1,null,b,b)}else i=!1,t.reset();e=e+`
131
+ `;const l=this.createOnigString(e),u=l.content.length,f=new FA(a,e,this._tokenTypeMatchers,this.balancedBracketSelectors),m=H1(this,l,i,0,t,f,!0,s);return D1(l),{lineLength:u,lineTokens:f,ruleStack:m.stack,stoppedEarly:m.stoppedEarly}}};function Zv(e,t){return e=cA(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Zo=class Pa{constructor(t,a,s){this.parent=t,this.scopePath=a,this.tokenAttributes=s}static fromExtension(t,a){let s=t,i=t?.scopePath??null;for(const l of a)i=Dh.push(i,l.scopeNames),s=new Pa(s,i,l.encodedTokenAttributes);return s}static createRoot(t,a){return new Pa(null,new Dh(null,t),a)}static createRootAndLookUpScopeName(t,a,s){const i=s.getMetadataForScope(t),l=new Dh(null,t),u=s.themeProvider.themeMatch(l),f=Pa.mergeAttributes(a,i,u);return new Pa(null,l,f)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Pa.equals(this,t)}static equals(t,a){do{if(t===a||!t&&!a)return!0;if(!t||!a||t.scopeName!==a.scopeName||t.tokenAttributes!==a.tokenAttributes)return!1;t=t.parent,a=a.parent}while(!0)}static mergeAttributes(t,a,s){let i=-1,l=0,u=0;return s!==null&&(i=s.fontStyle,l=s.foregroundId,u=s.backgroundId),Li.set(t,a.languageId,a.tokenType,null,i,l,u)}pushAttributed(t,a){if(t===null)return this;if(t.indexOf(" ")===-1)return Pa._pushAttributed(this,t,a);const s=t.split(/ /g);let i=this;for(const l of s)i=Pa._pushAttributed(i,l,a);return i}static _pushAttributed(t,a,s){const i=s.getMetadataForScope(a),l=t.scopePath.push(a),u=s.themeProvider.themeMatch(l),f=Pa.mergeAttributes(t.tokenAttributes,i,u);return new Pa(t,l,f)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const a=[];let s=this;for(;s&&s!==t;)a.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===t?a.reverse():void 0}},ym=class ws{constructor(t,a,s,i,l,u,f,m){this.parent=t,this.ruleId=a,this.beginRuleCapturedEOL=l,this.endRule=u,this.nameScopesList=f,this.contentNameScopesList=m,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new ws(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ws._equals(this,t)}static _equals(t,a){return t===a?!0:this._structuralEquals(t,a)?Zo.equals(t.contentNameScopesList,a.contentNameScopesList):!1}static _structuralEquals(t,a){do{if(t===a||!t&&!a)return!0;if(!t||!a||t.depth!==a.depth||t.ruleId!==a.ruleId||t.endRule!==a.endRule)return!1;t=t.parent,a=a.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){ws._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,a,s,i,l,u,f){return new ws(this,t,a,s,i,l,u,f)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,a){return this.parent&&(a=this.parent._writeString(t,a)),t[a++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,a}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new ws(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let a=this;for(;a&&a._enterPos===t._enterPos;){if(a.ruleId===t.ruleId)return!0;a=a.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,a){const s=Zo.fromExtension(t?.nameScopesList??null,a.nameScopesList);return new ws(t,a.ruleId,a.enterPos??-1,a.anchorPos??-1,a.beginRuleCapturedEOL,a.endRule,s,Zo.fromExtension(s,a.contentNameScopesList))}},qA=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(a=>a==="*"?(this.allowAny=!0,[]):yu(a,_u).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(a=>yu(a,_u).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},FA=class{constructor(e,t,a,s){this.balancedBracketSelectors=s,this._emitBinaryTokens=e,this._tokenTypeOverrides=a,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let s=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const l=e?.getScopeNames()??[];for(const u of this._tokenTypeOverrides)u.matcher(l)&&(s=Li.set(s,0,u.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(l))}if(i&&(s=Li.set(s,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=t;return}const a=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:a}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const a=new Uint32Array(this._binaryTokens.length);for(let s=0,i=this._binaryTokens.length;s<i;s++)a[s]=this._binaryTokens[s];return a}},YA=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,a,s,i){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,PA(e,l,t,a,s,i,this,this._onigLib))}return this._grammars.get(e)}},KA=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new YA(xu.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,a){this._syncRegistry.setTheme(xu.createFromRawTheme(t,a))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,a,s){return this.loadGrammarWithConfiguration(t,a,{embeddedLanguages:s})}loadGrammarWithConfiguration(t,a,s){return this._loadGrammar(t,a,s.embeddedLanguages,s.tokenTypes,new qA(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,a,s,i,l){const u=new wA(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(f=>this._loadSingleGrammar(f.scopeName)),u.processQueue();return this._grammarForScopeName(t,a,s,i,l)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const a=this._options.loadGrammar(t);if(a){const s=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(a,s)}}addGrammar(t,a=[],s=0,i=null){return this._syncRegistry.addGrammar(t,a),this._grammarForScopeName(t.scopeName,s,i)}_grammarForScopeName(t,a=0,s=null,i=null,l=null){return this._syncRegistry.grammarForScopeName(t,a,s,i,l)}},vm=ym.NULL;function Su(e,t){const a=typeof e=="string"?{}:{...e.colorReplacements},s=typeof e=="string"?e:e.name;for(const[i,l]of Object.entries(t?.colorReplacements||{}))typeof l=="string"?a[i]=l:i===s&&Object.assign(a,l);return a}function es(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function XA(e){return Array.isArray(e)?e:[e]}async function I1(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Gu(e){return!e||["plaintext","txt","text","plain"].includes(e)}function tp(e){return e==="ansi"||Gu(e)}function Vu(e){return e==="none"}function P1(e){return Vu(e)}function qu(e,t=!1){if(e.length===0)return[["",0]];const a=e.split(/(\r?\n)/g);let s=0;const i=[];for(let l=0;l<a.length;l+=2){const u=t?a[l]+(a[l+1]||""):a[l];i.push([u,s]),s+=a[l].length,s+=a[l+1]?.length||0}return i}const Jv={light:"#333333",dark:"#bbbbbb"},Wv={light:"#fffffe",dark:"#1e1e1e"},eb="__shiki_resolved";function np(e){if(e?.[eb])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:a,fg:s}=t;if(!a||!s){const f=t.settings?t.settings.find(m=>!m.name&&!m.scope):void 0;f?.settings?.foreground&&(s=f.settings.foreground),f?.settings?.background&&(a=f.settings.background),!s&&t?.colors?.["editor.foreground"]&&(s=t.colors["editor.foreground"]),!a&&t?.colors?.["editor.background"]&&(a=t.colors["editor.background"]),s||(s=t.type==="light"?Jv.light:Jv.dark),a||(a=t.type==="light"?Wv.light:Wv.dark),t.fg=s,t.bg=a}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const l=new Map;function u(f){if(l.has(f))return l.get(f);i+=1;const m=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${m}`]?u(f):(l.set(f,m),m)}t.settings=t.settings.map(f=>{const m=f.settings?.foreground&&!f.settings.foreground.startsWith("#"),h=f.settings?.background&&!f.settings.background.startsWith("#");if(!m&&!h)return f;const x={...f,settings:{...f.settings}};if(m){const y=u(f.settings.foreground);t.colorReplacements[y]=f.settings.foreground,x.settings.foreground=y}if(h){const y=u(f.settings.background);t.colorReplacements[y]=f.settings.background,x.settings.background=y}return x});for(const f of Object.keys(t.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!t.colors[f]?.startsWith("#")){const m=u(t.colors[f]);t.colorReplacements[m]=t.colors[f],t.colors[f]=m}return Object.defineProperty(t,eb,{enumerable:!1,writable:!1,value:!0}),t}async function G1(e){return Array.from(new Set((await Promise.all(e.filter(t=>!tp(t)).map(async t=>await I1(t).then(a=>Array.isArray(a)?a:[a])))).flat()))}async function V1(e){return(await Promise.all(e.map(async t=>P1(t)?null:np(await I1(t))))).filter(t=>!!t)}function q1(e,t){if(!t)return e;if(t[e]){const a=new Set([e]);for(;t[e];){if(e=t[e],a.has(e))throw new wt(`Circular alias \`${Array.from(a).join(" -> ")} -> ${e}\``);a.add(e)}}return e}var QA=class extends KA{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,a,s={}){super(e),this._resolver=e,this._themes=t,this._langs=a,this._alias=s,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=np(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=xu.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=q1(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const a={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const s=this.loadGrammarWithConfiguration(e.scopeName,1,a);if(s.name=e.name,this._resolvedGrammars.set(e.name,s),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const s of e)this.resolveEmbeddedLanguages(s);const t=Array.from(this._langGraph.entries()),a=t.filter(([s,i])=>!i);if(a.length){const s=t.filter(([i,l])=>l?(l.embeddedLanguages||l.embeddedLangs)?.some(u=>a.map(([f])=>f).includes(u)):!1).filter(i=>!a.includes(i));throw new wt(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${s.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[s,i]of t)this._resolver.addLanguage(i);for(const[s,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const a of t)this._langGraph.set(a,this._langMap.get(a))}},ZA=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:a=>e.createScanner(a),createOnigString:a=>e.createString(a)},t.forEach(a=>this.addLanguage(a))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let a=[];for(let s=1;s<=t.length;s++){const i=t.slice(0,s).join(".");a=[...a,...this._injections.get(i)||[]]}return a}};let Uo=0;function JA(e){Uo+=1,e.warnings!==!1&&Uo>=10&&Uo%10===0&&console.warn(`[Shiki] ${Uo} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new wt("`engine` option is required for synchronous mode");const a=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(np),i=new QA(new ZA(e.engine,a),s,a,e.langAlias);let l;function u(R){return q1(R,e.langAlias)}function f(R){j();const k=i.getGrammar(typeof R=="string"?R:R.name);if(!k)throw new wt(`Language \`${R}\` not found, you may need to load it first`);return k}function m(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};j();const k=i.getTheme(R);if(!k)throw new wt(`Theme \`${R}\` not found, you may need to load it first`);return k}function h(R){j();const k=m(R);return l!==R&&(i.setTheme(k),l=R),{theme:k,colorMap:i.getColorMap()}}function x(){return j(),i.getLoadedThemes()}function y(){return j(),i.getLoadedLanguages()}function v(...R){j(),i.loadLanguages(R.flat(1))}async function b(...R){return v(await G1(R))}function w(...R){j();for(const k of R.flat(1))i.loadTheme(k)}async function N(...R){return j(),w(await V1(R))}function j(){if(t)throw new wt("Shiki instance has been disposed")}function E(){t||(t=!0,i.dispose(),Uo-=1)}return{setTheme:h,getTheme:m,getLanguage:f,getLoadedThemes:x,getLoadedLanguages:y,resolveLangAlias:u,loadLanguage:b,loadLanguageSync:v,loadTheme:N,loadThemeSync:w,dispose:E,[Symbol.dispose]:E}}async function WA(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,a,s]=await Promise.all([V1(e.themes||[]),G1(e.langs||[]),e.engine]);return JA({...e,themes:t,langs:a,engine:s})}const F1=new WeakMap;function Fu(e,t){F1.set(e,t)}function ll(e){return F1.get(e)}var Yu=class Y1{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,a){return new Y1(Object.fromEntries(XA(a).map(s=>[s,vm])),t)}constructor(...t){if(t.length===2){const[a,s]=t;this.lang=s,this._stacks=a}else{const[a,s,i]=t;this.lang=s,this._stacks={[i]:a}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return eL(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function eL(e){const t=[],a=new Set;function s(i){if(a.has(i))return;a.add(i);const l=i?.nameScopesList?.scopeName;l&&t.push(l),i.parent&&s(i.parent)}return s(e),t}function tL(e,t){if(!(e instanceof Yu))throw new wt("Invalid grammar state");return e.getInternalStack(t)}function K1(e,t,a={}){const{theme:s=e.getLoadedThemes()[0]}=a;if(Gu(e.resolveLangAlias(a.lang||"text"))||Vu(s))return qu(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:i,colorMap:l}=e.setTheme(s),u=e.getLanguage(a.lang||"text");if(a.grammarState){if(a.grammarState.lang!==u.name)throw new wt(`Grammar state language "${a.grammarState.lang}" does not match highlight language "${u.name}"`);if(!a.grammarState.themes.includes(i.name))throw new wt(`Grammar state themes "${a.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return aL(t,u,i,l,a)}function nL(...e){if(e.length===2)return ll(e[1]);const[t,a,s={}]=e,{lang:i="text",theme:l=t.getLoadedThemes()[0]}=s;if(Gu(i)||Vu(l))throw new wt("Plain language does not have grammar state");if(i==="ansi")throw new wt("ANSI language does not have grammar state");const{theme:u,colorMap:f}=t.setTheme(l),m=t.getLanguage(i);return new Yu(ap(a,m,u,f,s).stateStack,m.name,u.name)}function aL(e,t,a,s,i){const l=ap(e,t,a,s,i),u=new Yu(l.stateStack,t.name,a.name);return Fu(l.tokens,u),l.tokens}function ap(e,t,a,s,i){const l=Su(a,i),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:f=500}=i,m=qu(e);let h=i.grammarState?tL(i.grammarState,a.name)??vm:i.grammarContextCode!=null?ap(i.grammarContextCode,t,a,s,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:vm,x=[];const y=[];for(let v=0,b=m.length;v<b;v++){const[w,N]=m[v];if(w===""){x=[],y.push([]);continue}if(u>0&&w.length>=u){x=[],y.push([{content:w,offset:N,color:"",fontStyle:0}]);continue}let j,E,R;i.includeExplanation&&(j=t.tokenizeLine(w,h,f),E=j.tokens,R=0);const k=t.tokenizeLine2(w,h,f),O=k.tokens.length/2;for(let I=0;I<O;I++){const B=k.tokens[2*I],H=I+1<O?k.tokens[2*I+2]:w.length;if(B===H)continue;const T=k.tokens[2*I+1],P=es(s[Li.getForeground(T)],l),X=Li.getFontStyle(T),de={content:w.substring(B,H),offset:N+B,color:P,fontStyle:X};if(i.includeExplanation){const le=[];if(i.includeExplanation!=="scopeName")for(const D of a.settings){let F;switch(typeof D.scope){case"string":F=D.scope.split(/,/).map(A=>A.trim());break;case"object":F=D.scope;break;default:continue}le.push({settings:D,selectors:F.map(A=>A.split(/ /))})}de.explanation=[];let ce=0;for(;B+ce<H;){const D=E[R],F=w.substring(D.startIndex,D.endIndex);ce+=F.length,de.explanation.push({content:F,scopes:i.includeExplanation==="scopeName"?rL(D.scopes):sL(le,D.scopes)}),R+=1}}x.push(de)}y.push(x),x=[],h=k.ruleStack}return{tokens:y,stateStack:h}}function rL(e){return e.map(t=>({scopeName:t}))}function sL(e,t){const a=[];for(let s=0,i=t.length;s<i;s++){const l=t[s];a[s]={scopeName:l,themeMatches:oL(e,l,t.slice(0,s))}}return a}function tb(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function iL(e,t,a){if(!tb(e[e.length-1],t))return!1;let s=e.length-2,i=a.length-1;for(;s>=0&&i>=0;)tb(e[s],a[i])&&(s-=1),i-=1;return s===-1}function oL(e,t,a){const s=[];for(const{selectors:i,settings:l}of e)for(const u of i)if(iL(u,t,a)){s.push(l);break}return s}function X1(e,t,a,s=K1){const i=Object.entries(a.themes).filter(h=>h[1]).map(h=>({color:h[0],theme:h[1]})),l=i.map(h=>{const x=s(e,t,{...a,theme:h.theme});return{tokens:x,state:ll(x),theme:typeof h.theme=="string"?h.theme:h.theme.name}}),u=lL(...l.map(h=>h.tokens)),f=u[0].map((h,x)=>h.map((y,v)=>{const b={content:y.content,variants:{},offset:y.offset};return"includeExplanation"in a&&a.includeExplanation&&(b.explanation=y.explanation),u.forEach((w,N)=>{const{content:j,explanation:E,offset:R,...k}=w[x][v];b.variants[i[N].color]=k}),b})),m=l[0].state?new Yu(Object.fromEntries(l.map(h=>[h.theme,h.state?.getInternalStack(h.theme)])),l[0].state.lang):void 0;return m&&Fu(f,m),f}function lL(...e){const t=e.map(()=>[]),a=e.length;for(let s=0;s<e[0].length;s++){const i=e.map(m=>m[s]),l=t.map(()=>[]);t.forEach((m,h)=>m.push(l[h]));const u=i.map(()=>0),f=i.map(m=>m[0]);for(;f.every(m=>m);){const m=Math.min(...f.map(h=>h.content.length));for(let h=0;h<a;h++){const x=f[h];x.content.length===m?(l[h].push(x),u[h]+=1,f[h]=i[h][u[h]]):(l[h].push({...x,content:x.content.slice(0,m)}),f[h]={...x,content:x.content.slice(m),offset:x.offset+m})}}}return t}const cL=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],nb={}.hasOwnProperty;function uL(e,t){const a=t||{};function s(i,...l){let u=s.invalid;const f=s.handlers;if(i&&nb.call(i,e)){const m=String(i[e]);u=nb.call(f,m)?f[m]:s.unknown}if(u)return u.call(this,i,...l)}return s.handlers=a.handlers||{},s.invalid=a.invalid,s.unknown=a.unknown,s}const dL=/["&'<>`]/g,fL=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,hL=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,mL=/[|\\{}()[\]^$+*?.]/g,ab=new WeakMap;function pL(e,t){if(e=e.replace(t.subset?gL(t.subset):dL,s),t.subset||t.escapeOnly)return e;return e.replace(fL,a).replace(hL,s);function a(i,l,u){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,u.charCodeAt(l+2),t)}function s(i,l,u){return t.format(i.charCodeAt(0),u.charCodeAt(l+1),t)}}function gL(e){let t=ab.get(e);return t||(t=xL(e),ab.set(e,t)),t}function xL(e){const t=[];let a=-1;for(;++a<e.length;)t.push(e[a].replace(mL,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const yL=/[\dA-Fa-f]/;function vL(e,t,a){const s="&#x"+e.toString(16).toUpperCase();return a&&t&&!yL.test(String.fromCharCode(t))?s:s+";"}const bL=/\d/;function _L(e,t,a){const s="&#"+String(e);return a&&t&&!bL.test(String.fromCharCode(t))?s:s+";"}const SL=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],zh={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},wL=["cent","copy","divide","gt","lt","not","para","times"],Q1={}.hasOwnProperty,bm={};let Fc;for(Fc in zh)Q1.call(zh,Fc)&&(bm[zh[Fc]]=Fc);const NL=/[^\dA-Za-z]/;function jL(e,t,a,s){const i=String.fromCharCode(e);if(Q1.call(bm,i)){const l=bm[i],u="&"+l;return a&&SL.includes(l)&&!wL.includes(l)&&(!s||t&&t!==61&&NL.test(String.fromCharCode(t)))?u:u+";"}return""}function EL(e,t,a){let s=vL(e,t,a.omitOptionalSemicolons),i;if((a.useNamedReferences||a.useShortestReferences)&&(i=jL(e,t,a.omitOptionalSemicolons,a.attribute)),(a.useShortestReferences||!i)&&a.useShortestReferences){const l=_L(e,t,a.omitOptionalSemicolons);l.length<s.length&&(s=l)}return i&&(!a.useShortestReferences||i.length<s.length)?i:s}function ki(e,t){return pL(e,Object.assign({format:EL},t))}const CL=/^>|^->|<!--|-->|--!>|<!-$/g,kL=[">"],RL=["<",">"];function TL(e,t,a,s){return s.settings.bogusComments?"<?"+ki(e.value,Object.assign({},s.settings.characterReferences,{subset:kL}))+">":"<!--"+e.value.replace(CL,i)+"-->";function i(l){return ki(l,Object.assign({},s.settings.characterReferences,{subset:RL}))}}function AL(e,t,a,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function rb(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,i=a.indexOf(t);for(;i!==-1;)s++,i=a.indexOf(t,i+t.length);return s}const sn=J1(1),Z1=J1(-1),LL=[];function J1(e){return t;function t(a,s,i){const l=a?a.children:LL;let u=(s||0)+e,f=l[u];if(!i)for(;f&&Pu(f);)u+=e,f=l[u];return f}}const OL={}.hasOwnProperty;function W1(e){return t;function t(a,s,i){return OL.call(e,a.tagName)&&e[a.tagName](a,s,i)}}const rp=W1({body:ML,caption:Uh,colgroup:Uh,dd:HL,dt:$L,head:Uh,html:DL,li:UL,optgroup:BL,option:IL,p:zL,rp:sb,rt:sb,tbody:GL,td:ib,tfoot:VL,th:ib,thead:PL,tr:qL});function Uh(e,t,a){const s=sn(a,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Pu(s.value.charAt(0)))}function DL(e,t,a){const s=sn(a,t);return!s||s.type!=="comment"}function ML(e,t,a){const s=sn(a,t);return!s||s.type!=="comment"}function zL(e,t,a){const s=sn(a,t);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!a||!(a.type==="element"&&(a.tagName==="a"||a.tagName==="audio"||a.tagName==="del"||a.tagName==="ins"||a.tagName==="map"||a.tagName==="noscript"||a.tagName==="video"))}function UL(e,t,a){const s=sn(a,t);return!s||s.type==="element"&&s.tagName==="li"}function $L(e,t,a){const s=sn(a,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function HL(e,t,a){const s=sn(a,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function sb(e,t,a){const s=sn(a,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function BL(e,t,a){const s=sn(a,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function IL(e,t,a){const s=sn(a,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function PL(e,t,a){const s=sn(a,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function GL(e,t,a){const s=sn(a,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function VL(e,t,a){return!sn(a,t)}function qL(e,t,a){const s=sn(a,t);return!s||s.type==="element"&&s.tagName==="tr"}function ib(e,t,a){const s=sn(a,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const FL=W1({body:XL,colgroup:QL,head:KL,html:YL,tbody:ZL});function YL(e){const t=sn(e,-1);return!t||t.type!=="comment"}function KL(e){const t=new Set;for(const s of e.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(t.has(s.tagName))return!1;t.add(s.tagName)}const a=e.children[0];return!a||a.type==="element"}function XL(e){const t=sn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Pu(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function QL(e,t,a){const s=Z1(a,t),i=sn(e,-1,!0);return a&&s&&s.type==="element"&&s.tagName==="colgroup"&&rp(s,a.children.indexOf(s),a)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function ZL(e,t,a){const s=Z1(a,t),i=sn(e,-1);return a&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&rp(s,a.children.indexOf(s),a)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Yc={name:[[`
132
+ \f\r &/=>`.split(""),`
133
+ \f\r "&'/=>\``.split("")],[`\0
134
+ \f\r "&'/<=>`.split(""),`\0
135
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
136
+ \f\r &>`.split(""),`\0
137
+ \f\r "&'<=>\``.split("")],[`\0
138
+ \f\r "&'<=>\``.split(""),`\0
139
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function JL(e,t,a,s){const i=s.schema,l=i.space==="svg"?!1:s.settings.omitOptionalTags;let u=i.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const f=[];let m;i.space==="html"&&e.tagName==="svg"&&(s.schema=_l);const h=WL(s,e.properties),x=s.all(i.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=i,x&&(u=!1),(h||!l||!FL(e,t,a))&&(f.push("<",e.tagName,h?" "+h:""),u&&(i.space==="svg"||s.settings.closeSelfClosing)&&(m=h.charAt(h.length-1),(!s.settings.tightSelfClosing||m==="/"||m&&m!=='"'&&m!=="'")&&f.push(" "),f.push("/")),f.push(">")),f.push(x),!u&&(!l||!rp(e,t,a))&&f.push("</"+e.tagName+">"),f.join("")}function WL(e,t){const a=[];let s=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const l=eO(e,i,t[i]);l&&a.push(l)}}for(;++s<a.length;){const l=e.settings.tightAttributes?a[s].charAt(a[s].length-1):void 0;s!==a.length-1&&l!=='"'&&l!=="'"&&(a[s]+=" ")}return a.join("")}function eO(e,t,a){const s=v1(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let u=e.quote,f;if(s.overloadedBoolean&&(a===s.attribute||a==="")?a=!0:(s.boolean||s.overloadedBoolean)&&(typeof a!="string"||a===s.attribute||a==="")&&(a=!!a),a==null||a===!1||typeof a=="number"&&Number.isNaN(a))return"";const m=ki(s.attribute,Object.assign({},e.settings.characterReferences,{subset:Yc.name[i][l]}));return a===!0||(a=Array.isArray(a)?(s.commaSeparated?d1:_1)(a,{padLeft:!e.settings.tightCommaSeparatedLists}):String(a),e.settings.collapseEmptyAttributes&&!a)?m:(e.settings.preferUnquoted&&(f=ki(a,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Yc.unquoted[i][l]}))),f!==a&&(e.settings.quoteSmart&&rb(a,u)>rb(a,e.alternative)&&(u=e.alternative),f=u+ki(a,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?Yc.single:Yc.double)[i][l],attribute:!0}))+u),m+(f&&"="+f))}const tO=["<","&"];function eS(e,t,a,s){return a&&a.type==="element"&&(a.tagName==="script"||a.tagName==="style")?e.value:ki(e.value,Object.assign({},s.settings.characterReferences,{subset:tO}))}function nO(e,t,a,s){return s.settings.allowDangerousHtml?e.value:eS(e,t,a,s)}function aO(e,t,a,s){return s.all(e)}const rO=uL("type",{invalid:sO,unknown:iO,handlers:{comment:TL,doctype:AL,element:JL,raw:nO,root:aO,text:eS}});function sO(e){throw new Error("Expected node, not `"+e+"`")}function iO(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const oO={},lO={},cO=[];function uO(e,t){const a=t||oO,s=a.quote||'"',i=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:dO,all:fO,settings:{omitOptionalTags:a.omitOptionalTags||!1,allowParseErrors:a.allowParseErrors||!1,allowDangerousCharacters:a.allowDangerousCharacters||!1,quoteSmart:a.quoteSmart||!1,preferUnquoted:a.preferUnquoted||!1,tightAttributes:a.tightAttributes||!1,upperDoctype:a.upperDoctype||!1,tightDoctype:a.tightDoctype||!1,bogusComments:a.bogusComments||!1,tightCommaSeparatedLists:a.tightCommaSeparatedLists||!1,tightSelfClosing:a.tightSelfClosing||!1,collapseEmptyAttributes:a.collapseEmptyAttributes||!1,allowDangerousHtml:a.allowDangerousHtml||!1,voids:a.voids||cL,characterReferences:a.characterReferences||lO,closeSelfClosing:a.closeSelfClosing||!1,closeEmptyElements:a.closeEmptyElements||!1},schema:a.space==="svg"?_l:b1,quote:s,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function dO(e,t,a){return rO(e,t,a,this)}function fO(e){const t=[],a=e&&e.children||cO;let s=-1;for(;++s<a.length;)t[s]=this.one(a[s],s,e);return t.join("")}function tS(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const a=Array.isArray(t)?t:t.split(/\s+/g);for(const s of a)s&&!e.properties.class.includes(s)&&e.properties.class.push(s);return e}function hO(e){const t=qu(e,!0).map(([i])=>i);function a(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let l=i,u=0;for(const f of t){if(l<f.length)break;l-=f.length,u++}return{line:u,character:l}}function s(i,l){let u=0;for(let f=0;f<i;f++)u+=t[f].length;return u+=l,u}return{lines:t,indexToPos:a,posToIndex:s}}function nS(e,t,a){const s=new Set;for(const l of e.matchAll(/:?lang=["']([^"']+)["']/g)){const u=l[1].toLowerCase().trim();u&&s.add(u)}for(const l of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const u=l[1].toLowerCase().trim();u&&s.add(u)}for(const l of e.matchAll(/\\begin\{([\w-]+)\}/g)){const u=l[1].toLowerCase().trim();u&&s.add(u)}for(const l of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const u=l[1].toLowerCase().trim(),f=u.includes("/")?u.split("/").pop():u;f&&s.add(f)}if(!a)return Array.from(s);const i=a.getBundledLanguages();return Array.from(s).filter(l=>l&&i[l])}const sp="light-dark()",mO=["color","background-color"];function pO(e,t){let a=0;const s=[];for(const i of t)i>a&&s.push({...e,content:e.content.slice(a,i),offset:e.offset+a}),a=i;return a<e.content.length&&s.push({...e,content:e.content.slice(a),offset:e.offset+a}),s}function gO(e,t){const a=Array.from(t instanceof Set?t:new Set(t)).sort((s,i)=>s-i);return a.length?e.map(s=>s.flatMap(i=>{const l=a.filter(u=>i.offset<u&&u<i.offset+i.content.length).map(u=>u-i.offset).sort((u,f)=>u-f);return l.length?pO(i,l):i})):e}function xO(e,t,a,s,i="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(x=>wu(e.variants[x])),f=new Set(u.flatMap(x=>Object.keys(x))),m={},h=(x,y)=>{const v=y==="color"?"":y==="background-color"?"-bg":`-${y}`;return a+t[x]+(y==="color"?"":v)};return u.forEach((x,y)=>{for(const v of f){const b=x[v]||"inherit";if(y===0&&s&&mO.includes(v))if(s===sp&&u.length>1){const w=t.findIndex(j=>j==="light"),N=t.findIndex(j=>j==="dark");if(w===-1||N===-1)throw new wt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');m[v]=`light-dark(${u[w][v]||"inherit"}, ${u[N][v]||"inherit"})`,i==="css-vars"&&(m[h(y,v)]=b)}else m[v]=b;else i==="css-vars"&&(m[h(y,v)]=b)}}),l.htmlStyle=m,l}function wu(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&En.Italic&&(t["font-style"]="italic"),e.fontStyle&En.Bold&&(t["font-weight"]="bold");const a=[];e.fontStyle&En.Underline&&a.push("underline"),e.fontStyle&En.Strikethrough&&a.push("line-through"),a.length&&(t["text-decoration"]=a.join(" "))}return t}function _m(e){return typeof e=="string"?e:Object.entries(e).map(([t,a])=>`${t}:${a}`).join(";")}function yO(){const e=new WeakMap;function t(a){if(!e.has(a.meta)){let i=function(u){if(typeof u=="number"){if(u<0||u>a.source.length)throw new wt(`Invalid decoration offset: ${u}. Code length: ${a.source.length}`);return{...s.indexToPos(u),offset:u}}else{const f=s.lines[u.line];if(f===void 0)throw new wt(`Invalid decoration position ${JSON.stringify(u)}. Lines length: ${s.lines.length}`);let m=u.character;if(m<0&&(m=f.length+m),m<0||m>f.length)throw new wt(`Invalid decoration position ${JSON.stringify(u)}. Line ${u.line} length: ${f.length}`);return{...u,character:m,offset:s.posToIndex(u.line,m)}}};const s=hO(a.source),l=(a.options.decorations||[]).map(u=>({...u,start:i(u.start),end:i(u.end)}));vO(l),e.set(a.meta,{decorations:l,converter:s,source:a.source})}return e.get(a.meta)}return{name:"shiki:decorations",tokens(a){if(this.options.decorations?.length)return gO(a,t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]))},code(a){if(!this.options.decorations?.length)return;const s=t(this),i=Array.from(a.children).filter(x=>x.type==="element"&&x.tagName==="span");if(i.length!==s.converter.lines.length)throw new wt(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function l(x,y,v,b){const w=i[x];let N="",j=-1,E=-1;if(y===0&&(j=0),v===0&&(E=0),v===Number.POSITIVE_INFINITY&&(E=w.children.length),j===-1||E===-1)for(let k=0;k<w.children.length;k++)N+=aS(w.children[k]),j===-1&&N.length===y&&(j=k+1),E===-1&&N.length===v&&(E=k+1);if(j===-1)throw new wt(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(E===-1)throw new wt(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const R=w.children.slice(j,E);if(!b.alwaysWrap&&R.length===w.children.length)f(w,b,"line");else if(!b.alwaysWrap&&R.length===1&&R[0].type==="element")f(R[0],b,"token");else{const k={type:"element",tagName:"span",properties:{},children:R};f(k,b,"wrapper"),w.children.splice(j,R.length,k)}}function u(x,y){i[x]=f(i[x],y,"line")}function f(x,y,v){const b=y.properties||{},w=y.transform||(N=>N);return x.tagName=y.tagName||"span",x.properties={...x.properties,...b,class:x.properties.class},y.properties?.class&&tS(x,y.properties.class),x=w(x,v)||x,x}const m=[],h=s.decorations.sort((x,y)=>y.start.offset-x.start.offset||x.end.offset-y.end.offset);for(const x of h){const{start:y,end:v}=x;if(y.line===v.line)l(y.line,y.character,v.character,x);else if(y.line<v.line){l(y.line,y.character,Number.POSITIVE_INFINITY,x);for(let b=y.line+1;b<v.line;b++)m.unshift(()=>u(b,x));l(v.line,0,v.character,x)}}m.forEach(x=>x())}}}function vO(e){for(let t=0;t<e.length;t++){const a=e[t];if(a.start.offset>a.end.offset)throw new wt(`Invalid decoration range: ${JSON.stringify(a.start)} - ${JSON.stringify(a.end)}`);for(let s=t+1;s<e.length;s++){const i=e[s],l=a.start.offset<=i.start.offset&&i.start.offset<a.end.offset,u=a.start.offset<i.end.offset&&i.end.offset<=a.end.offset,f=i.start.offset<=a.start.offset&&a.start.offset<i.end.offset,m=i.start.offset<a.end.offset&&a.end.offset<=i.end.offset;if(l||u||f||m){if(l&&u||f&&m||f&&a.start.offset===a.end.offset||u&&i.start.offset===i.end.offset)continue;throw new wt(`Decorations ${JSON.stringify(a.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function aS(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(aS).join(""):""}const bO=[yO()];function Nu(e){const t=_O(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...bO]}function _O(e){const t=[],a=[],s=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":a.push(i);break;default:s.push(i)}return{pre:t,post:a,normal:s}}var js=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],$h={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function SO(e,t){const a=e.indexOf("\x1B",t);if(a!==-1&&e[a+1]==="["){const s=e.indexOf("m",a);if(s!==-1)return{sequence:e.substring(a+2,s).split(";"),startPosition:a,position:s+1}}return{position:e.length}}function ob(e){const t=e.shift();if(t==="2"){const a=e.splice(0,3).map(s=>Number.parseInt(s));return a.length!==3||a.some(s=>Number.isNaN(s))?void 0:{type:"rgb",rgb:a}}else if(t==="5"){const a=e.shift();if(a)return{type:"table",index:Number(a)}}}function wO(e){const t=[];for(;e.length>0;){const a=e.shift();if(!a)continue;const s=Number.parseInt(a);if(!Number.isNaN(s))if(s===0)t.push({type:"resetAll"});else if(s<=9)$h[s]&&t.push({type:"setDecoration",value:$h[s]});else if(s<=29){const i=$h[s-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)t.push({type:"setForegroundColor",value:{type:"named",name:js[s-30]}});else if(s===38){const i=ob(e);i&&t.push({type:"setForegroundColor",value:i})}else if(s===39)t.push({type:"resetForegroundColor"});else if(s<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:js[s-40]}});else if(s===48){const i=ob(e);i&&t.push({type:"setBackgroundColor",value:i})}else s===49?t.push({type:"resetBackgroundColor"}):s===53?t.push({type:"setDecoration",value:"overline"}):s===55?t.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?t.push({type:"setForegroundColor",value:{type:"named",name:js[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:js[s-100+8]}})}return t}function NO(){let e=null,t=null,a=new Set;return{parse(s){const i=[];let l=0;do{const u=SO(s,l),f=u.sequence?s.substring(l,u.startPosition):s.substring(l);if(f.length>0&&i.push({value:f,foreground:e,background:t,decorations:new Set(a)}),u.sequence){const m=wO(u.sequence);for(const h of m)h.type==="resetAll"?(e=null,t=null,a.clear()):h.type==="resetForegroundColor"?e=null:h.type==="resetBackgroundColor"?t=null:h.type==="resetDecoration"&&a.delete(h.value);for(const h of m)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?t=h.value:h.type==="setDecoration"&&a.add(h.value)}l=u.position}while(l<s.length);return i}}}var jO={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function EO(e=jO){function t(f){return e[f]}function a(f){return`#${f.map(m=>Math.max(0,Math.min(m,255)).toString(16).padStart(2,"0")).join("")}`}let s;function i(){if(s)return s;s=[];for(let h=0;h<js.length;h++)s.push(t(js[h]));let f=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let x=0;x<6;x++)for(let y=0;y<6;y++)s.push(a([f[h],f[x],f[y]]));let m=8;for(let h=0;h<24;h++,m+=10)s.push(a([m,m,m]));return s}function l(f){return i()[f]}function u(f){switch(f.type){case"named":return t(f.name);case"rgb":return a(f.rgb);case"table":return l(f.index)}}return{value:u}}const CO={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function kO(e,t,a){const s=Su(e,a),i=qu(t),l=EO(Object.fromEntries(js.map(f=>{const m=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`;return[f,e.colors?.[m]||CO[f]]}))),u=NO();return i.map(f=>u.parse(f[0]).map(m=>{let h,x;m.decorations.has("reverse")?(h=m.background?l.value(m.background):e.bg,x=m.foreground?l.value(m.foreground):e.fg):(h=m.foreground?l.value(m.foreground):e.fg,x=m.background?l.value(m.background):void 0),h=es(h,s),x=es(x,s),m.decorations.has("dim")&&(h=RO(h));let y=En.None;return m.decorations.has("bold")&&(y|=En.Bold),m.decorations.has("italic")&&(y|=En.Italic),m.decorations.has("underline")&&(y|=En.Underline),m.decorations.has("strikethrough")&&(y|=En.Strikethrough),{content:m.value,offset:f[1],color:h,bgColor:x,fontStyle:y}}))}function RO(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const s=t[1];if(s.length===8){const i=Math.round(Number.parseInt(s.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${s.slice(0,6)}${i}`}else{if(s.length===6)return`#${s}80`;if(s.length===4){const i=s[0],l=s[1],u=s[2],f=s[3];return`#${i}${i}${l}${l}${u}${u}${Math.round(Number.parseInt(`${f}${f}`,16)/2).toString(16).padStart(2,"0")}`}else if(s.length===3){const i=s[0],l=s[1],u=s[2];return`#${i}${i}${l}${l}${u}${u}80`}}}const a=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return a?`var(${a[1]}-dim)`:e}function Sm(e,t,a={}){const s=e.resolveLangAlias(a.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=a;if(!Gu(s)&&!Vu(i)&&s==="ansi"){const{theme:l}=e.setTheme(i);return kO(l,t,a)}return K1(e,t,a)}function ju(e,t,a){let s,i,l,u,f,m;if("themes"in a){const{defaultColor:h="light",cssVariablePrefix:x="--shiki-",colorsRendering:y="css-vars"}=a,v=Object.entries(a.themes).filter(E=>E[1]).map(E=>({color:E[0],theme:E[1]})).sort((E,R)=>E.color===h?-1:R.color===h?1:0);if(v.length===0)throw new wt("`themes` option must not be empty");const b=X1(e,t,a,Sm);if(m=ll(b),h&&sp!==h&&!v.find(E=>E.color===h))throw new wt(`\`themes\` option must contain the defaultColor key \`${h}\``);const w=v.map(E=>e.getTheme(E.theme)),N=v.map(E=>E.color);l=b.map(E=>E.map(R=>xO(R,N,x,h,y))),m&&Fu(l,m);const j=v.map(E=>Su(E.theme,a));i=lb(v,w,j,x,h,"fg",y),s=lb(v,w,j,x,h,"bg",y),u=`shiki-themes ${w.map(E=>E.name).join(" ")}`,f=h?void 0:[i,s].join(";")}else if("theme"in a){const h=Su(a.theme,a);l=Sm(e,t,a);const x=e.getTheme(a.theme);s=es(x.bg,h),i=es(x.fg,h),u=x.name,m=ll(l)}else throw new wt("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:i,bg:s,themeName:u,rootStyle:f,grammarState:m}}function lb(e,t,a,s,i,l,u){return e.map((f,m)=>{const h=es(t[m][l],a[m])||"inherit",x=`${s+f.color}${l==="bg"?"-bg":""}:${h}`;if(m===0&&i){if(i===sp&&e.length>1){const y=e.findIndex(b=>b.color==="light"),v=e.findIndex(b=>b.color==="dark");if(y===-1||v===-1)throw new wt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${es(t[y][l],a[y])||"inherit"}, ${es(t[v][l],a[v])||"inherit"});${x}`}return h}return u==="css-vars"?x:null}).filter(f=>!!f).join(";")}function Eu(e,t,a,s={meta:{},options:a,codeToHast:(i,l)=>Eu(e,i,l),codeToTokens:(i,l)=>ju(e,i,l)}){let i=t;for(const w of Nu(a))i=w.preprocess?.call(s,i,a)||i;let{tokens:l,fg:u,bg:f,themeName:m,rootStyle:h,grammarState:x}=ju(e,i,a);const{mergeWhitespaces:y=!0,mergeSameStyleTokens:v=!1}=a;y===!0?l=AO(l):y==="never"&&(l=LO(l)),v&&(l=OO(l));const b={...s,get source(){return i}};for(const w of Nu(a))l=w.tokens?.call(b,l)||l;return TO(l,{...a,fg:u,bg:f,themeName:m,rootStyle:a.rootStyle===!1?!1:a.rootStyle??h},b,x)}function TO(e,t,a,s=ll(e)){const i=Nu(t),l=[],u={type:"root",children:[]},{structure:f="classic",tabindex:m="0"}=t,h={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?h.style=t.rootStyle:h.style=`background-color:${t.bg};color:${t.fg}`),m!==!1&&m!=null&&(h.tabindex=m.toString());for(const[N,j]of Object.entries(t.meta||{}))N.startsWith("_")||(h[N]=j);let x={type:"element",tagName:"pre",properties:h,children:[],data:t.data},y={type:"element",tagName:"code",properties:{},children:l};const v=[],b={...a,structure:f,addClassToHast:tS,get source(){return a.source},get tokens(){return e},get options(){return t},get root(){return u},get pre(){return x},get code(){return y},get lines(){return v}};if(e.forEach((N,j)=>{j&&(f==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):f==="classic"&&l.push({type:"text",value:`
140
+ `}));let E={type:"element",tagName:"span",properties:{class:"line"},children:[]},R=0;for(const k of N){let O={type:"element",tagName:"span",properties:{...k.htmlAttrs},children:[{type:"text",value:k.content}]};const I=_m(k.htmlStyle||wu(k));I&&(O.properties.style=I);for(const B of i)O=B?.span?.call(b,O,j+1,R,E,k)||O;f==="inline"?u.children.push(O):f==="classic"&&E.children.push(O),R+=k.content.length}if(f==="classic"){for(const k of i)E=k?.line?.call(b,E,j+1)||E;v.push(E),l.push(E)}else f==="inline"&&v.push(E)}),f==="classic"){for(const N of i)y=N?.code?.call(b,y)||y;x.children.push(y);for(const N of i)x=N?.pre?.call(b,x)||x;u.children.push(x)}else if(f==="inline"){const N=[];let j={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const R of u.children)R.type==="element"&&R.tagName==="br"?(N.push(j),j={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(R.type==="element"||R.type==="text")&&j.children.push(R);N.push(j);let E={type:"element",tagName:"code",properties:{},children:N};for(const R of i)E=R?.code?.call(b,E)||E;u.children=[];for(let R=0;R<E.children.length;R++){R>0&&u.children.push({type:"element",tagName:"br",properties:{},children:[]});const k=E.children[R];k.type==="element"&&u.children.push(...k.children)}}let w=u;for(const N of i)w=N?.root?.call(b,w)||w;return s&&Fu(w,s),w}function AO(e){return e.map(t=>{const a=[];let s="",i;return t.forEach((l,u)=>{const f=!(l.fontStyle&&(l.fontStyle&En.Underline||l.fontStyle&En.Strikethrough));f&&l.content.match(/^\s+$/)&&t[u+1]?(i===void 0&&(i=l.offset),s+=l.content):s?(f?a.push({...l,offset:i,content:s+l.content}):a.push({content:s,offset:i},l),i=void 0,s=""):a.push(l)}),a})}function LO(e){return e.map(t=>t.flatMap(a=>{if(a.content.match(/^\s+$/))return a;const s=a.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return a;const[,i,l,u]=s;if(!i&&!u)return a;const f=[{...a,offset:a.offset+i.length,content:l}];return i&&f.unshift({content:i,offset:a.offset}),u&&f.push({content:u,offset:a.offset+i.length+l.length}),f}))}function OO(e){return e.map(t=>{const a=[];for(const s of t){if(a.length===0){a.push({...s});continue}const i=a[a.length-1],l=_m(i.htmlStyle||wu(i)),u=_m(s.htmlStyle||wu(s)),f=i.fontStyle&&(i.fontStyle&En.Underline||i.fontStyle&En.Strikethrough),m=s.fontStyle&&(s.fontStyle&En.Underline||s.fontStyle&En.Strikethrough);!f&&!m&&l===u?i.content+=s.content:a.push({...s})}return a})}const DO=uO;function MO(e,t,a){const s={meta:{},options:a,codeToHast:(l,u)=>Eu(e,l,u),codeToTokens:(l,u)=>ju(e,l,u)};let i=DO(Eu(e,t,a,s));for(const l of Nu(a))i=l.postprocess?.call(s,i,a)||i;return i}async function zO(e){const t=await WA(e);return{getLastGrammarState:(...a)=>nL(t,...a),codeToTokensBase:(a,s)=>Sm(t,a,s),codeToTokensWithThemes:(a,s)=>X1(t,a,s),codeToTokens:(a,s)=>ju(t,a,s),codeToHast:(a,s)=>Eu(t,a,s),codeToHtml:(a,s)=>MO(t,a,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function UO(e){const t=e.langs,a=e.themes,s=e.engine;async function i(l){function u(y){if(typeof y=="string"){if(y=l.langAlias?.[y]||y,tp(y))return[];const v=t[y];if(!v)throw new wt(`Language \`${y}\` is not included in this bundle. You may want to load it from external source.`);return v}return y}function f(y){if(P1(y))return"none";if(typeof y=="string"){const v=a[y];if(!v)throw new wt(`Theme \`${y}\` is not included in this bundle. You may want to load it from external source.`);return v}return y}const m=(l.themes??[]).map(y=>f(y)),h=(l.langs??[]).map(y=>u(y)),x=await zO({engine:l.engine??s(),...l,themes:m,langs:h});return{...x,loadLanguage(...y){return x.loadLanguage(...y.map(u))},loadTheme(...y){return x.loadTheme(...y.map(f))},getBundledLanguages(){return t},getBundledThemes(){return a}}}return i}function $O(e){let t;async function a(s={}){if(t){const i=await t;return await Promise.all([i.loadTheme(...s.themes||[]),i.loadLanguage(...s.langs||[])]),i}else{t=e({...s,themes:[],langs:[]});const i=await t;return await Promise.all([i.loadTheme(...s.themes||[]),i.loadLanguage(...s.langs||[])]),i}}return a}function HO(e,t){const a=$O(e);async function s(i,l){const u=await a({langs:[l.lang],themes:"theme"in l?[l.theme]:Object.values(l.themes)}),f=await t?.guessEmbeddedLanguages?.(i,l.lang,u);return f&&await u.loadLanguage(...f),u}return{getSingletonHighlighter(i){return a(i)},async codeToHtml(i,l){return(await s(i,l)).codeToHtml(i,l)},async codeToHast(i,l){return(await s(i,l)).codeToHast(i,l)},async codeToTokens(i,l){return(await s(i,l)).codeToTokens(i,l)},async codeToTokensBase(i,l){return(await s(i,l)).codeToTokensBase(i,l)},async codeToTokensWithThemes(i,l){return(await s(i,l)).codeToTokensWithThemes(i,l)},async getLastGrammarState(i,l){return(await a({langs:[l.lang],themes:[l.theme]})).getLastGrammarState(i,l)}}}var cb=Object.prototype.hasOwnProperty;function ub(e,t,a){for(a of e.keys())if(Jo(a,t))return a}function Jo(e,t){var a,s,i;if(e===t)return!0;if(e&&t&&(a=e.constructor)===t.constructor){if(a===Date)return e.getTime()===t.getTime();if(a===RegExp)return e.toString()===t.toString();if(a===Array){if((s=e.length)===t.length)for(;s--&&Jo(e[s],t[s]););return s===-1}if(a===Set){if(e.size!==t.size)return!1;for(s of e)if(i=s,i&&typeof i=="object"&&(i=ub(t,i),!i)||!t.has(i))return!1;return!0}if(a===Map){if(e.size!==t.size)return!1;for(s of e)if(i=s[0],i&&typeof i=="object"&&(i=ub(t,i),!i)||!Jo(s[1],t.get(i)))return!1;return!0}if(a===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(a===DataView){if((s=e.byteLength)===t.byteLength)for(;s--&&e.getInt8(s)===t.getInt8(s););return s===-1}if(ArrayBuffer.isView(e)){if((s=e.byteLength)===t.byteLength)for(;s--&&e[s]===t[s];);return s===-1}if(!a||typeof e=="object"){s=0;for(a in e)if(cb.call(e,a)&&++s&&!cb.call(t,a)||!(a in t)||!Jo(e[a],t[a]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}function rS(e){var t,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(a=rS(e[t]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function db(){for(var e,t,a=0,s="",i=arguments.length;a<i;a++)(e=arguments[a])&&(t=rS(e))&&(s&&(s+=" "),s+=t);return s}var Hh=e=>{const t=_.useRef(e);return e!==t.current&&!Jo(e,t.current)&&(t.current=e),t.current},BO=(e,t,a)=>{const s=Date.now();clearTimeout(t.current.timeoutId);const i=Math.max(0,t.current.nextAllowedTime-s);t.current.timeoutId=setTimeout(()=>{e().catch(console.error),t.current.nextAllowedTime=s+a},i)},sS="plaintext",fb=e=>e==null?[]:Array.isArray(e)?e:[e],IO=e=>e==null?null:typeof e=="string"?`s:${e}`:`o:${e.name}::${e.scopeName}`,hb=e=>{const t=new Set,a=[];for(const s of e){const i=IO(s);i==null||t.has(i)||(t.add(i),a.push(s))}return a},PO=(e,t)=>e==null?!1:typeof e=="string"?e in t:typeof e.name=="string"&&typeof e.scopeName=="string",GO=(e,t)=>tp(e)||t.includes(e)?e:sS,VO=(e,t,a,s)=>{const i=fb(t),l=fb(s),u=[...i,...l];let f=sS,m;if(e==null||typeof e=="string"&&!e.trim())return{languageId:f,langsToLoad:hb([...l,...i])};if(typeof e=="object")f=e.name,m=e;else{const h=e.toLowerCase(),x=v=>v?.toLowerCase()===h,y=u.find(v=>typeof v=="object"&&v!=null&&!!(x(v.name)||x(v.scopeName)||x(v.scopeName?.split(".").pop())||v.aliases?.some(x)||v.fileTypes?.some(x)));y?(f=y.name||e,m=y):a?.[e]?(f=a[e],m=a[e]):(f=e,m=e)}return{languageId:f,langsToLoad:hb([m,...l,...i])}},mb=e=>typeof e=="object"&&e!==null&&"tokenColors"in e&&Array.isArray(e.tokenColors);function qO(e){const t=mb(e),a=typeof e=="object"&&e!==null&&!t,s=typeof e=="object"&&e!==null&&!t&&Object.entries(e).some(([i,l])=>i.trim()!==""&&(typeof l=="string"&&l.trim()!==""||mb(l)));return a?{isMultiTheme:!0,themeId:s?`multi-${Object.values(e).map(l=>(typeof l=="string"?l:l?.name)||"custom").sort().join("-")}`:"multi-default",multiTheme:s?e:null,themesToLoad:s?Object.values(e):[]}:{isMultiTheme:!1,themeId:typeof e=="string"?e:e?.name||"custom",singleTheme:e,themesToLoad:[e]}}function FO(e=1){return{name:"react-shiki:line-numbers",code(t){if(this.addClassToHast(t,"has-line-numbers"),e!==1){const a=t.properties?.style||"",s=a?`${a}; --line-start: ${e}`:`--line-start: ${e}`;t.properties={...t.properties,style:s}}},line(t){return this.addClassToHast(t,"line-numbers"),t}}}var pb={light:"github-light",dark:"github-dark"},YO=(e,t)=>e.isMultiTheme?{themes:e.multiTheme??pb,defaultColor:t.defaultColor,cssVariablePrefix:t.cssVariablePrefix}:{theme:e.singleTheme??pb.dark},KO=e=>{const t=[...e.transformers||[]];return e.showLineNumbers&&t.push(FO(e.startingLineNumber)),t},XO=({languageId:e,resolvedTheme:t,options:a})=>{const{defaultColor:s,cssVariablePrefix:i,showLineNumbers:l,startingLineNumber:u,transformers:f,...m}=a;return{lang:e,...YO(t,a),...m,transformers:KO(a)}},QO=(e,t,a)=>{const s=a.getBundledLanguages();return nS(e).flatMap(i=>s[i]??[])},ZO=(e,t,a,s={},i)=>{const[l,u]=_.useState(null),f=Hh(t),m=Hh(a),h=Hh(s),{languageId:x,langsToLoad:y}=_.useMemo(()=>VO(f,h.customLanguages,h.langAlias,h.preloadLanguages),[f,h.customLanguages,h.preloadLanguages,h.langAlias]),v=_.useMemo(()=>qO(m),[m]),{themesToLoad:b}=v,w=_.useRef({nextAllowedTime:0,timeoutId:void 0}),N=_.useMemo(()=>XO({languageId:x,resolvedTheme:v,options:h}),[x,v,h]);return _.useEffect(()=>{let j=!0;const E=async()=>{if(!x)return;const k=h.highlighter?h.highlighter:await i(y,b,h.engine);if(!h.highlighter){const B=QO(e,x,k);B.length>0&&await k.loadLanguage(...B)}const O=GO(x,k.getLoadedLanguages()),I={...N,lang:O};if(j){const B=h.outputFormat==="html"?k.codeToHtml(e,I):IT(k.codeToHast(e,I),{jsx:d.jsx,jsxs:d.jsxs,Fragment:d.Fragment});u(B)}},{delay:R}=h;return R?BO(E,w,R):E().catch(console.error),()=>{j=!1,clearTimeout(w.current.timeoutId)}},[e,N,h.delay,h.highlighter,y,b]),l};function JO(e,{insertAt:t}={}){if(typeof document>"u")return;const a=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&a.firstChild?a.insertBefore(s,a.firstChild):a.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}JO(`.relative {
141
+ position: relative;
142
+ }
143
+ .defaultStyles pre {
144
+ overflow: auto;
145
+ border-radius: 0.5rem;
146
+ padding-left: 1.5rem;
147
+ padding-right: 1.5rem;
148
+ padding-top: 1.25rem;
149
+ padding-bottom: 1.25rem;
150
+ }
151
+ .languageLabel {
152
+ position: absolute;
153
+ right: 0.75rem;
154
+ top: 0.5rem;
155
+ font-family: monospace;
156
+ font-size: 0.75rem;
157
+ letter-spacing: -0.05em;
158
+ color: rgba(107, 114, 128, 0.85);
159
+ }
160
+ .line-numbers::before {
161
+ counter-increment: line-number;
162
+ content: counter(line-number);
163
+ display: inline-flex;
164
+ justify-content: flex-end;
165
+ align-items: flex-start;
166
+ box-sizing: content-box;
167
+ min-width: var(--line-numbers-width, 2ch);
168
+ padding-left: var(--line-numbers-padding-left, 2ch);
169
+ padding-right: var(--line-numbers-padding-right, 2ch);
170
+ color: var(--line-numbers-foreground, rgba(107, 114, 128, 0.6));
171
+ font-size: var(--line-numbers-font-size, inherit);
172
+ font-weight: var(--line-numbers-font-weight, inherit);
173
+ line-height: var(--line-numbers-line-height, inherit);
174
+ font-family: var(--line-numbers-font-family, inherit);
175
+ opacity: var(--line-numbers-opacity, 1);
176
+ user-select: none;
177
+ pointer-events: none;
178
+ }
179
+ .has-line-numbers {
180
+ counter-reset: line-number calc(var(--line-start, 1) - 1);
181
+ --line-numbers-foreground: rgba(107, 114, 128, 0.5);
182
+ --line-numbers-width: 2ch;
183
+ --line-numbers-padding-left: 0ch;
184
+ --line-numbers-padding-right: 2ch;
185
+ --line-numbers-font-size: inherit;
186
+ --line-numbers-font-weight: inherit;
187
+ --line-numbers-line-height: inherit;
188
+ --line-numbers-font-family: inherit;
189
+ --line-numbers-opacity: 1;
190
+ }
191
+ `);var WO=e=>_.forwardRef(({language:t,theme:a,delay:s,transformers:i,defaultColor:l,cssVariablePrefix:u,addDefaultStyles:f=!0,style:m,langStyle:h,className:x,langClassName:y,showLanguage:v=!0,showLineNumbers:b=!1,startingLineNumber:w=1,children:N,as:j="pre",customLanguages:E,preloadLanguages:R,...k},O)=>{const I={delay:s,transformers:i,customLanguages:E,preloadLanguages:R,showLineNumbers:b,defaultColor:l,cssVariablePrefix:u,startingLineNumber:w,...k},B=typeof t=="object"?t.name||null:t?.trim()||null,H=e(N,t,a,I),T=typeof H=="string";return d.jsxs(j,{ref:O,"data-testid":"shiki-container",className:db("relative","not-prose",f&&"defaultStyles",x),style:m,id:"shiki-container",children:[v&&B?d.jsx("span",{className:db("languageLabel",y),style:h,id:"language-label",children:B}):null,T?d.jsx("div",{dangerouslySetInnerHTML:{__html:H}}):H]})}),ip=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function e3(){return 2147483648}function t3(){return typeof performance<"u"?performance.now():Date.now()}const n3=(e,t)=>e+(t-e%t)%t;async function a3(e){let t,a;const s={};function i(b){a=b,s.HEAPU8=new Uint8Array(b),s.HEAPU32=new Uint32Array(b)}function l(b,w,N){s.HEAPU8.copyWithin(b,w,w+N)}function u(b){try{return t.grow(b-a.byteLength+65535>>>16),i(t.buffer),1}catch{}}function f(b){const w=s.HEAPU8.length;b=b>>>0;const N=e3();if(b>N)return!1;for(let j=1;j<=4;j*=2){let E=w*(1+.2/j);E=Math.min(E,b+100663296);const R=Math.min(N,n3(Math.max(b,E),65536));if(u(R))return!0}return!1}const m=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(b,w,N=1024){const j=w+N;let E=w;for(;b[E]&&!(E>=j);)++E;if(E-w>16&&b.buffer&&m)return m.decode(b.subarray(w,E));let R="";for(;w<E;){let k=b[w++];if(!(k&128)){R+=String.fromCharCode(k);continue}const O=b[w++]&63;if((k&224)===192){R+=String.fromCharCode((k&31)<<6|O);continue}const I=b[w++]&63;if((k&240)===224?k=(k&15)<<12|O<<6|I:k=(k&7)<<18|O<<12|I<<6|b[w++]&63,k<65536)R+=String.fromCharCode(k);else{const B=k-65536;R+=String.fromCharCode(55296|B>>10,56320|B&1023)}}return R}function x(b,w){return b?h(s.HEAPU8,b,w):""}const y={emscripten_get_now:t3,emscripten_memcpy_big:l,emscripten_resize_heap:f,fd_write:()=>0};async function v(){const w=await e({env:y,wasi_snapshot_preview1:y});t=w.memory,i(t.buffer),Object.assign(s,w),s.UTF8ToString=x}return await v(),s}var r3=Object.defineProperty,s3=(e,t,a)=>t in e?r3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,an=(e,t,a)=>s3(e,typeof t!="symbol"?t+"":t,a);let dn=null;function i3(e){throw new ip(e.UTF8ToString(e.getLastOnigError()))}class Ku{constructor(t){an(this,"utf16Length"),an(this,"utf8Length"),an(this,"utf16Value"),an(this,"utf8Value"),an(this,"utf16OffsetToUtf8"),an(this,"utf8OffsetToUtf16");const a=t.length,s=Ku._utf8ByteLength(t),i=s!==a,l=i?new Uint32Array(a+1):null;i&&(l[a]=s);const u=i?new Uint32Array(s+1):null;i&&(u[s]=a);const f=new Uint8Array(s);let m=0;for(let h=0;h<a;h++){const x=t.charCodeAt(h);let y=x,v=!1;if(x>=55296&&x<=56319&&h+1<a){const b=t.charCodeAt(h+1);b>=56320&&b<=57343&&(y=(x-55296<<10)+65536|b-56320,v=!0)}i&&(l[h]=m,v&&(l[h+1]=m),y<=127?u[m+0]=h:y<=2047?(u[m+0]=h,u[m+1]=h):y<=65535?(u[m+0]=h,u[m+1]=h,u[m+2]=h):(u[m+0]=h,u[m+1]=h,u[m+2]=h,u[m+3]=h)),y<=127?f[m++]=y:y<=2047?(f[m++]=192|(y&1984)>>>6,f[m++]=128|(y&63)>>>0):y<=65535?(f[m++]=224|(y&61440)>>>12,f[m++]=128|(y&4032)>>>6,f[m++]=128|(y&63)>>>0):(f[m++]=240|(y&1835008)>>>18,f[m++]=128|(y&258048)>>>12,f[m++]=128|(y&4032)>>>6,f[m++]=128|(y&63)>>>0),v&&h++}this.utf16Length=a,this.utf8Length=s,this.utf16Value=t,this.utf8Value=f,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let a=0;for(let s=0,i=t.length;s<i;s++){const l=t.charCodeAt(s);let u=l,f=!1;if(l>=55296&&l<=56319&&s+1<i){const m=t.charCodeAt(s+1);m>=56320&&m<=57343&&(u=(l-55296<<10)+65536|m-56320,f=!0)}u<=127?a+=1:u<=2047?a+=2:u<=65535?a+=3:a+=4,f&&s++}return a}createString(t){const a=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,a),a}}const Xu=class Ga{constructor(t){if(an(this,"id",++Ga.LAST_ID),an(this,"_onigBinding"),an(this,"content"),an(this,"utf16Length"),an(this,"utf8Length"),an(this,"utf16OffsetToUtf8"),an(this,"utf8OffsetToUtf16"),an(this,"ptr"),!dn)throw new ip("Must invoke loadWasm first.");this._onigBinding=dn,this.content=t;const a=new Ku(t);this.utf16Length=a.utf16Length,this.utf8Length=a.utf8Length,this.utf16OffsetToUtf8=a.utf16OffsetToUtf8,this.utf8OffsetToUtf16=a.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ga._sharedPtrInUse?(Ga._sharedPtr||(Ga._sharedPtr=dn.omalloc(1e4)),Ga._sharedPtrInUse=!0,dn.HEAPU8.set(a.utf8Value,Ga._sharedPtr),this.ptr=Ga._sharedPtr):this.ptr=a.createString(dn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Ga._sharedPtr?Ga._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};an(Xu,"LAST_ID",0);an(Xu,"_sharedPtr",0);an(Xu,"_sharedPtrInUse",!1);let iS=Xu;class o3{constructor(t){if(an(this,"_onigBinding"),an(this,"_ptr"),!dn)throw new ip("Must invoke loadWasm first.");const a=[],s=[];for(let f=0,m=t.length;f<m;f++){const h=new Ku(t[f]);a[f]=h.createString(dn),s[f]=h.utf8Length}const i=dn.omalloc(4*t.length);dn.HEAPU32.set(a,i/4);const l=dn.omalloc(4*t.length);dn.HEAPU32.set(s,l/4);const u=dn.createOnigScanner(i,l,t.length);for(let f=0,m=t.length;f<m;f++)dn.ofree(a[f]);dn.ofree(l),dn.ofree(i),u===0&&i3(dn),this._onigBinding=dn,this._ptr=u}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,a,s){let i=0;if(typeof s=="number"&&(i=s),typeof t=="string"){t=new iS(t);const l=this._findNextMatchSync(t,a,!1,i);return t.dispose(),l}return this._findNextMatchSync(t,a,!1,i)}_findNextMatchSync(t,a,s,i){const l=this._onigBinding,u=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(a),i);if(u===0)return null;const f=l.HEAPU32;let m=u/4;const h=f[m++],x=f[m++],y=[];for(let v=0;v<x;v++){const b=t.convertUtf8OffsetToUtf16(f[m++]),w=t.convertUtf8OffsetToUtf16(f[m++]);y[v]={start:b,end:w,length:w-b}}return{index:h,captureIndices:y}}}function l3(e){return typeof e.instantiator=="function"}function c3(e){return typeof e.default=="function"}function u3(e){return typeof e.data<"u"}function d3(e){return typeof Response<"u"&&e instanceof Response}function f3(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Kc;function oS(e){if(Kc)return Kc;async function t(){dn=await a3(async a=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(a)),typeof s=="function"&&(s=await s(a)),l3(s)?s=await s.instantiator(a):c3(s)?s=await s.default(a):(u3(s)&&(s=s.data),d3(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await h3(s)(a):s=await m3(s)(a):f3(s)?s=await Bh(s)(a):s instanceof WebAssembly.Module?s=await Bh(s)(a):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Bh(s.default)(a))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return Kc=t(),Kc}function Bh(e){return t=>WebAssembly.instantiate(e,t)}function h3(e){return t=>WebAssembly.instantiateStreaming(e,t)}function m3(e){return async t=>{const a=await e.arrayBuffer();return WebAssembly.instantiate(a,t)}}let lS;function p3(e){lS=e}function g3(){return lS}async function cS(e){return e&&await oS(e),{createScanner(t){return new o3(t.map(a=>typeof a=="string"?a:a.source))},createString(t){return new iS(t)}}}const x3=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:cS,getDefaultWasmLoader:g3,loadWasm:oS,setDefaultWasmLoader:p3},Symbol.toStringTag,{value:"Module"}));var uS=iA({});lA(uS,x3);const y3=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>ne(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>ne(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>ne(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>ne(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>ne(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>ne(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>ne(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>ne(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>ne(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>ne(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>ne(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>ne(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>ne(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>ne(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>ne(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>ne(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>ne(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>ne(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>ne(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>ne(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>ne(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>ne(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>ne(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>ne(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>ne(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>ne(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>ne(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>ne(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>ne(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>ne(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>ne(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>ne(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>ne(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>ne(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>ne(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>ne(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>ne(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>ne(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>ne(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>ne(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>ne(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>ne(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>ne(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>ne(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>ne(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>ne(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>ne(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>ne(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>ne(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>ne(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>ne(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>ne(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>ne(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>ne(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>ne(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>ne(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>ne(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>ne(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>ne(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>ne(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>ne(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>ne(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>ne(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>ne(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>ne(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],v3=Object.fromEntries(y3.map(e=>[e.id,e.import])),dS=[{id:"angular-html",name:"Angular HTML",import:(()=>ne(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>ne(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"astro",name:"Astro",import:(()=>ne(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([6,7,2,8,3,9,10])))},{id:"blade",name:"Blade",import:(()=>ne(()=>import("./blade-BjGOyj-B.js"),__vite__mapDeps([11,12,1,2,3,13,14,15,7])))},{id:"c",name:"C",import:(()=>ne(()=>import("./c-BIGW1oBm.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>ne(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([16,2])))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>ne(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([17,18,19,20,15])))},{id:"css",name:"CSS",import:(()=>ne(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>ne(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"glsl",name:"GLSL",import:(()=>ne(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([19,20])))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>ne(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([21,2,8,22,10])))},{id:"haml",name:"Ruby Haml",import:(()=>ne(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([23,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>ne(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([24,1,2,3,25])))},{id:"html",name:"HTML",import:(()=>ne(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>ne(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([12,1,2,3])))},{id:"http",name:"HTTP",import:(()=>ne(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([26,27,7,13,14,21,2,8,22,10])))},{id:"hurl",name:"Hurl",import:(()=>ne(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([28,21,2,8,22,10,13,14,29])))},{id:"imba",name:"Imba",import:(()=>ne(()=>import("./imba-DGztddWO.js"),[]))},{id:"java",name:"Java",import:(()=>ne(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>ne(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>ne(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([30,1,2,3])))},{id:"jison",name:"Jison",import:(()=>ne(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([31,2])))},{id:"json",name:"JSON",import:(()=>ne(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>ne(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>ne(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>ne(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>ne(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>ne(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([32,17,18,19,20,15,33,2,34])))},{id:"less",name:"Less",import:(()=>ne(()=>import("./less-B1dDrJ26.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>ne(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>ne(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([35,3,36,5,8])))},{id:"mdc",name:"MDC",import:(()=>ne(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([37,38,25,12,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>ne(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"php",name:"PHP",import:(()=>ne(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([39,1,2,3,13,14,15,7])))},{id:"postcss",name:"PostCSS",import:(()=>ne(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>ne(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([40,2,3,1])))},{id:"python",name:"Python",aliases:["py"],import:(()=>ne(()=>import("./python-B6aJPvgy.js"),[]))},{id:"r",name:"R",import:(()=>ne(()=>import("./r-Dspwwk_N.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>ne(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"sass",name:"Sass",import:(()=>ne(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scss",name:"SCSS",import:(()=>ne(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>ne(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"sql",name:"SQL",import:(()=>ne(()=>import("./sql-BLtJtn59.js"),[]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>ne(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>ne(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([41,2,8,3,9])))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>ne(()=>import("./ts-tags-DQrlYJgV.js"),__vite__mapDeps([42,8,3,2,19,20,1,15,13,14])))},{id:"tsx",name:"TSX",import:(()=>ne(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>ne(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"vue",name:"Vue",import:(()=>ne(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([43,3,2,8,7,1,12])))},{id:"vue-html",name:"Vue HTML",import:(()=>ne(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([44,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>ne(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([45,3,5,36,46,9,2])))},{id:"wasm",name:"WebAssembly",import:(()=>ne(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>ne(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>ne(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"xml",name:"XML",import:(()=>ne(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([13,14])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>ne(()=>import("./yaml-Buea-lGh.js"),[]))}],b3=Object.fromEntries(dS.map(e=>[e.id,e.import])),_3=Object.fromEntries(dS.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),fS={...b3,..._3},S3=UO({langs:fS,themes:v3,engine:()=>(0,uS.createOnigurumaEngine)(ne(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{getSingletonHighlighter:w3}=HO(S3,{guessEmbeddedLanguages:nS});async function N3(e,t,a){const s=e.filter(i=>PO(i,fS));return await w3({langs:s,themes:t,engine:a??cS(ne(()=>import("./wasm-CG6Dc4jp.js"),[]))})}var j3=(e,t,a,s={})=>ZO(e,t,a,s,N3),E3=WO(j3),C3=E3;const k3={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",go:"go",rs:"rust",java:"java",kt:"kotlin",rb:"ruby",php:"php",cs:"csharp",cpp:"cpp",c:"c",h:"c",swift:"swift",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",dockerfile:"dockerfile"};function R3(e){if(!e)return"plaintext";const t=e.split(".").pop()?.toLowerCase();return t?k3[t]??"plaintext":"plaintext"}function gb({code:e,language:t,sourcePath:a}){const s=qm(f=>f.theme),l=(s==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":s)==="dark"?"github-dark":"github-light",u=t??R3(a);return d.jsx("div",{className:"flex min-w-0 flex-1 flex-col rounded border border-c4a-border-subtle overflow-auto c4a-scrollbar [&>*]:flex-1 [&_pre]:min-h-full [&_pre]:whitespace-pre-wrap [&_pre]:break-words",children:d.jsx(C3,{language:u,theme:l,children:e})})}let Xc=null,Qc=[];const Zc=ns((e,t)=>({cache:new Map,pending:new Set,resolve:a=>{const{cache:s,pending:i}=t(),l=a.filter(u=>!s.has(u)&&!i.has(u)&&!Qc.includes(u));l.length!==0&&(Qc.push(...l),e({pending:new Set([...i,...l])}),Xc&&clearTimeout(Xc),Xc=setTimeout(()=>{const u=[...Qc];Qc=[],Xc=null,u.length!==0&&ze.post("/resolve",{refs:u}).then(f=>{const{cache:m,pending:h}=t(),x=new Map(m),y=new Set(h);for(const v of u){const b=f[v];b?x.set(v,b):x.set(v,{exists:!1}),y.delete(v)}e({cache:x,pending:y})}).catch(()=>{const{cache:f,pending:m}=t(),h=new Map(f),x=new Set(m);for(const y of u)h.set(y,{error:!0,exists:!1}),x.delete(y);e({cache:h,pending:x})})},50))},retry:a=>{const{cache:s}=t(),i=new Map(s);i.delete(a),e({cache:i}),t().resolve([a])}})),Ih="/studio",aa={entity:e=>`${Ih}/entities/${e}`,relation:e=>`${Ih}/relations/${e}`,content:e=>`${Ih}/contents/${e}`},hS=/^ref:(entity|relation|content):(.+)$/;function T3(e){const t=hS.exec(e);return!t||!t[2]?null:{type:t[1],id:t[2]}}function op(e){return typeof e=="string"&&hS.test(e)}const xb={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function A3(e,t){if(e.type==="content")return"📄";if(e.type==="relation")return"🔗";const a=t?.entity_type;return a&&xb[a]?xb[a]:"🔹"}function L3(e){switch(e.type){case"entity":return aa.entity(e.id);case"relation":return aa.relation(e.id);case"content":return aa.content(e.id);default:return"#"}}function lp({pointer:e}){const t=Lt(),{t:a}=ye(),s=$i(),i=Zc(b=>b.cache),l=Zc(b=>b.pending);_.useEffect(()=>{Zc.getState().resolve([e])},[e]);const u=T3(e);if(!u)return d.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:e});const f=i.get(e);if(l.has(e)||!f&&!i.has(e))return d.jsx("span",{className:"inline-block animate-pulse bg-c4a-bg-hover rounded px-2 py-0.5 text-xs font-mono w-24 h-4"});if(f?.error)return d.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted cursor-pointer",title:a("ref.retry"),onClick:()=>Zc.getState().retry(e),children:["<",a("ref.unknown"),": ",u.id.slice(0,12),">"]});if(f&&!f.exists)return d.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted line-through",title:e,children:["<",a("ref.stale"),": ",u.id.slice(0,12),">"]});const h=A3(u,f),x=u.type==="relation"?f?.relation_type||u.id.slice(0,12):f?.name||u.id.slice(0,12),y=L3(u),v=()=>{s?.active?s.navigate(u.type,u.id,x,h):t(y)};return d.jsxs("span",{className:"inline-flex items-center gap-1 text-c4a-accent hover:underline cursor-pointer text-xs font-mono",onClick:v,title:e,children:[d.jsx("span",{children:h}),d.jsx("span",{children:x})]})}function Oi({data:e,defaultExpanded:t=2}){return d.jsx("div",{className:"font-mono text-xs",children:d.jsx(wm,{value:e,depth:0,defaultExpanded:t})})}function wm({keyName:e,value:t,depth:a,defaultExpanded:s}){const[i,l]=_.useState(a<s);if(typeof t=="string"&&op(t))return d.jsxs("div",{className:"flex items-baseline gap-1",style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx(lp,{pointer:t})]});if(t==null)return d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-text-muted",children:"null"})]});if(typeof t=="string")return d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsxs("span",{className:"text-c4a-accent",children:['"',t,'"']})]});if(typeof t=="number")return d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-success",children:t})]});if(typeof t=="boolean")return d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-warning",children:String(t)})]});if(Array.isArray(t))return t.length===0?d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-text-muted",children:"[]"})]}):d.jsxs("div",{children:[d.jsxs("div",{style:{paddingLeft:a*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>l(!i),children:[d.jsx("span",{className:"text-c4a-text-muted mr-1",children:i?"▼":"▶"}),e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!i&&d.jsxs("span",{className:"text-c4a-text-muted",children:["[",t.length," items]"]})]}),i&&t.map((u,f)=>d.jsx(wm,{keyName:String(f),value:u,depth:a+1,defaultExpanded:s},f))]});if(typeof t=="object"){const u=Object.entries(t);return u.length===0?d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-text-muted",children:"{}"})]}):d.jsxs("div",{children:[d.jsxs("div",{style:{paddingLeft:a*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>l(!i),children:[d.jsx("span",{className:"text-c4a-text-muted mr-1",children:i?"▼":"▶"}),e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!i&&d.jsx("span",{className:"text-c4a-text-muted",children:"{ ... }"})]}),i&&u.map(([f,m])=>d.jsx(wm,{keyName:f,value:m,depth:a+1,defaultExpanded:s},f))]})}return null}const O3={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function yb({entity:e}){const t=Lt(),a=$i(),s=O3[e.type]??"🔹",i=()=>{a?.active?a.navigate("entity",e.id,e.name,s):t(aa.entity(e.id))};return d.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors",onClick:i,children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"shrink-0",children:s}),d.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:e.name}),e.kind&&d.jsx(Vt,{variant:"muted",children:e.kind})]})})}function vb({data:e}){const{t}=ye(),a=Lt(),s=$i(),i=e.manifest?.dependencies,l=i?Object.entries(i):[],u=(f,m)=>{s?.active?s.navigate("content",f,m,"📄"):a(aa.content(f))};return d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{children:"📦"}),d.jsx("span",{className:"font-mono text-lg font-bold text-c4a-text-primary",children:e.name??t("package.unknown")})]}),d.jsxs("div",{className:"mt-1 flex items-center gap-2 text-xs",children:[e.manifest_type&&d.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase text-c4a-accent/60",children:e.manifest_type}),e.path&&d.jsx("span",{className:"font-mono text-c4a-text-muted",children:e.path})]})]}),e.last_commit_hash&&d.jsxs("div",{className:"mt-3",children:[d.jsx("h4",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-tertiary mb-2",children:t("package.last_commit")}),d.jsxs("div",{className:"font-mono text-xs text-c4a-text-muted",children:[d.jsx("span",{children:e.last_commit_hash.slice(0,7)}),e.last_commit_message&&d.jsx("span",{className:"ml-2 text-c4a-text-secondary",children:e.last_commit_message}),e.last_commit_date&&d.jsx("span",{className:"ml-2",children:e.last_commit_date})]})]}),d.jsxs("div",{className:"mt-3",children:[d.jsx("h4",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-tertiary mb-2",children:t("package.dependencies")}),l.length===0?d.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:t("package.no_dependencies")}):d.jsx("div",{className:"space-y-0.5",children:l.map(([f,m])=>d.jsxs("div",{className:"flex justify-between font-mono text-xs",children:[d.jsx("span",{className:"text-c4a-text-primary",children:f}),d.jsx("span",{className:"text-c4a-text-muted",children:m})]},f))})]}),e.files&&e.files.length>0&&d.jsxs("div",{className:"mt-3",children:[d.jsxs("h4",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-tertiary mb-2",children:[t("package.files")," (",e.files.length,")"]}),d.jsx("div",{className:"space-y-0.5",children:e.files.map(f=>d.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[d.jsxs("span",{className:"flex items-center gap-1 text-c4a-text-secondary",children:[d.jsx("span",{children:"📄"}),d.jsx("span",{children:f.path})]}),f.hash_id&&d.jsx("span",{className:"font-mono text-[10px] text-c4a-accent hover:underline cursor-pointer",onClick:()=>u(f.hash_id,f.path),children:f.hash_id.slice(0,12)})]},f.path))})]})]})}function bb(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&"manifest_type"in t}catch{return!1}}function mS({hashId:e,sourcePath:t}){const{t:a}=ye(),[s,i]=_.useState(null),[l,u]=_.useState(null),[f,m]=_.useState("raw");_.useEffect(()=>{e&&(u(null),ze.get(`/contents/${e}`).then(x=>{i(x),m("raw")}).catch(x=>{x instanceof Ln&&x.status===404?u("not_found"):u("load_failed")}))},[e]);const h=!l&&s;return d.jsx("div",{className:"flex flex-1 flex-col",children:d.jsxs(Km,{value:f,onChange:x=>m(x),children:[d.jsx("div",{children:d.jsxs(Xm,{children:[d.jsx(Va,{value:"raw",children:a("content.detail.tab.raw")}),d.jsx(Va,{value:"digest",children:a("content.detail.tab.digest")}),d.jsx(Va,{value:"extraction",children:a("content.detail.tab.extraction")}),d.jsx(Va,{value:"entities",children:a("content.detail.tab.entities")})]})}),d.jsx("div",{className:"mt-4 flex flex-1 flex-col",children:l?d.jsx(Cn,{title:a(`common.error.${l}`),description:a(`common.error.${l}_description`)}):h?d.jsxs(d.Fragment,{children:[d.jsx(Sa,{value:"raw",children:d.jsx(D3,{hashId:s.hash_id,sourcePath:t})}),d.jsx(Sa,{value:"digest",children:d.jsx(M3,{hashId:s.hash_id})}),d.jsx(Sa,{value:"extraction",children:d.jsx(z3,{hashId:s.hash_id})}),d.jsx(Sa,{value:"entities",children:d.jsx(U3,{hashId:s.hash_id})})]}):d.jsx(wl,{})})]})})}function wl(){return d.jsx("div",{className:"flex flex-1 items-center justify-center pb-15",children:d.jsx(fn,{size:24,className:"animate-spin text-c4a-text-muted"})})}function D3({hashId:e,sourcePath:t}){const{t:a}=ye(),[s,i]=_.useState(null),[l,u]=_.useState(!1),[f,m]=_.useState(!1);if(_.useEffect(()=>{u(!1),ze.get(`/contents/${e}/raw`).then(h=>{i(h),u(!0),m(!1)}).catch(h=>{h instanceof Ln&&h.status===404&&m(!0),u(!0)})},[e]),!l){if(s){if(bb(s.content))try{return d.jsx(vb,{data:JSON.parse(s.content)})}catch{}return d.jsx(gb,{code:s.content,sourcePath:t})}return d.jsx(wl,{})}if(f||!s||s.source==="unavailable")return d.jsx(Cn,{title:a("common.empty.content_raw.title"),description:a("common.empty.content_raw.description")});if(bb(s.content))try{const h=JSON.parse(s.content);return d.jsx(vb,{data:h})}catch{}return d.jsx(gb,{code:s.content,sourcePath:t})}function M3({hashId:e}){const{t}=ye(),[a,s]=_.useState(null),[i,l]=_.useState(!1),[u,f]=_.useState(!1);return _.useEffect(()=>{l(!1),ze.get(`/contents/${e}/digest`).then(m=>{s(m),l(!0),f(!1)}).catch(m=>{m instanceof Ln&&m.status===404&&f(!0),l(!0)})},[e]),i?u||!a?d.jsx(Cn,{title:t("common.empty.content_digest.title"),description:t("common.empty.content_digest.description")}):d.jsxs("div",{className:"flex flex-1 flex-col gap-3",children:[a.digest_data.language&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-xs text-c4a-text-muted",children:[t("content.detail.language"),":"]}),d.jsx(Vt,{children:a.digest_data.language})]}),d.jsx("div",{className:"flex flex-1 flex-col overflow-auto rounded border border-c4a-border-subtle p-3",children:d.jsx(Oi,{data:a.digest_data,defaultExpanded:2})})]}):a?d.jsxs("div",{className:"flex flex-1 flex-col gap-3",children:[a.digest_data.language&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-xs text-c4a-text-muted",children:[t("content.detail.language"),":"]}),d.jsx(Vt,{children:a.digest_data.language})]}),d.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar rounded border border-c4a-border-subtle p-3",children:d.jsx(Oi,{data:a.digest_data,defaultExpanded:2})})]}):d.jsx(wl,{})}function z3({hashId:e}){const{t}=ye(),[a,s]=_.useState(null),[i,l]=_.useState(!1),[u,f]=_.useState(!1);return _.useEffect(()=>{l(!1),ze.get(`/contents/${e}/extractions`).then(m=>{!m.extractions||m.extractions.length===0?f(!0):s(m),l(!0)}).catch(m=>{m instanceof Ln&&m.status===404&&f(!0),l(!0)})},[e]),i?u||!a?d.jsx(Cn,{title:t("common.empty.content_extraction.title"),description:t("common.empty.content_extraction.description")}):d.jsx(_b,{extractions:a.extractions}):a?d.jsx(_b,{extractions:a.extractions}):d.jsx(wl,{})}function _b({extractions:e}){const{t}=ye();return d.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-auto c4a-scrollbar",children:e.map(a=>{const s=vl(a.extraction_confidence);return d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.model&&d.jsx(Vt,{variant:"muted",children:a.model}),s&&d.jsx(Vt,{variant:s.variant,tooltip:`confidence: ${s.value}`,children:t(s.labelKey)})]}),d.jsx(Oi,{data:{atoms:a.atoms,candidate_entities:a.candidate_entities},defaultExpanded:2})]},a.id)})})}function U3({hashId:e}){const{t}=ye(),[a,s]=_.useState([]),[i,l]=_.useState(!1),[u,f]=_.useState(!1);return _.useEffect(()=>{l(!1),ze.get(`/contents/${e}/entities`).then(m=>{!m.entities||m.entities.length===0?f(!0):s(m.entities),l(!0)}).catch(m=>{m instanceof Ln&&m.status===404&&f(!0),l(!0)})},[e]),i?u||a.length===0?d.jsx(Cn,{title:t("common.empty.content_entities.title"),description:t("common.empty.content_entities.description")}):d.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:d.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(m=>d.jsx(yb,{entity:m},m.id))})}):a.length>0?d.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:d.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(m=>d.jsx(yb,{entity:m},m.id))})}):d.jsx(wl,{})}const Sb={entities:"Entities",behaviors:"Behaviors",roles:"Roles",attributes:"Attributes",states:"States",transitions:"Transitions",events:"Events",rules:"Rules",constraints:"Constraints",decisions:"Decisions",metrics:"Metrics",claims:"Claims",relations:"Relations",comparisons:"Comparisons",boundaries:"Boundaries"};function $3({data:e,atoms:t}){return d.jsxs("div",{className:"space-y-4",children:[e&&Object.keys(e).length>0&&d.jsx("div",{children:d.jsx(Oi,{data:e,defaultExpanded:2})}),t&&d.jsx(H3,{atoms:t})]})}function H3({atoms:e}){const t=Object.keys(Sb);return d.jsx("div",{className:"space-y-2",children:t.map(a=>{const s=e[a];return!s||s.length===0?null:d.jsx(B3,{type:a,label:Sb[a]??a,items:s},a)})})}function B3({type:e,label:t,items:a}){const[s,i]=_.useState(!0);return d.jsxs("details",{open:s,onToggle:l=>i(l.target.open),children:[d.jsxs("summary",{className:"cursor-pointer font-mono text-xs uppercase text-c4a-text-secondary hover:text-c4a-text-primary py-1.5",children:[t," (",a.length,")"]}),d.jsx("div",{className:"pl-4 pb-2",children:d.jsx(I3,{type:e,items:a})})]})}function I3({type:e,items:t}){switch(e){case"entities":case"behaviors":case"events":case"relations":return d.jsx(wb,{items:t});case"roles":return d.jsx(P3,{items:t});case"attributes":return d.jsx(G3,{items:t});case"states":return d.jsx(V3,{items:t});case"transitions":return d.jsx(q3,{items:t});case"rules":case"constraints":return d.jsx(F3,{items:t});case"decisions":return d.jsx(Y3,{items:t});case"metrics":return d.jsx(K3,{items:t});case"claims":return d.jsx(X3,{items:t});case"comparisons":return d.jsx(Q3,{items:t});case"boundaries":return d.jsx(Z3,{items:t});default:return d.jsx(wb,{items:t})}}function Za({value:e}){const{t}=ye(),a=vl(e);return a?d.jsx(Vt,{variant:a.variant,tooltip:`confidence: ${a.value}`,children:t(a.labelKey)}):null}function wb({items:e}){return d.jsx("div",{className:"space-y-1",children:e.map((t,a)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.ref&&op(t.ref)?d.jsx(lp,{pointer:t.ref}):d.jsx("span",{className:"text-c4a-text-primary",children:t.name??String(t)}),d.jsx(Za,{value:t.confidence})]},a))})}function P3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx(Vt,{variant:"accent",children:t.name??"role"}),!!t.performs&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-c4a-text-muted",children:"performs"}),op(String(t.performs))?d.jsx(lp,{pointer:String(t.performs)}):d.jsx("span",{className:"text-c4a-text-primary",children:String(t.performs)})]}),d.jsx(Za,{value:t.confidence})]},a))})}function G3({items:e}){return d.jsx("div",{className:"space-y-1",children:e.map((t,a)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsxs("span",{className:"text-c4a-text-secondary font-mono",children:[t.name,":"]}),d.jsx("span",{className:"text-c4a-text-primary",children:String(t.value??"")}),d.jsx(Za,{value:t.confidence})]},a))})}function V3({items:e}){return d.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map((t,a)=>d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(Vt,{children:t.name??String(t)}),d.jsx(Za,{value:t.confidence})]},a))})}function q3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>{const s=t;return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx(Vt,{variant:"muted",children:String(s.from_state??"?")}),d.jsx("span",{className:"text-c4a-text-muted",children:"→"}),d.jsx(Vt,{variant:"muted",children:String(s.to_state??"?")}),!!s.trigger&&d.jsx("span",{className:"text-c4a-text-muted italic",children:String(s.trigger)}),d.jsx(Za,{value:t.confidence})]},a)})})}function F3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>{const s=t;return d.jsx("div",{className:"text-xs",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-c4a-warning font-mono font-bold",children:"IF"}),d.jsx("span",{className:"text-c4a-text-primary",children:String(s.condition??s.name??"")}),d.jsx("span",{className:"text-c4a-accent font-mono font-bold",children:"THEN"}),d.jsx("span",{className:"text-c4a-text-primary",children:String(s.conclusion??s.description??"")}),d.jsx(Za,{value:t.confidence})]})},a)})})}function Y3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),t.description&&d.jsx("span",{className:"text-c4a-text-muted ml-2",children:t.description}),d.jsx(Za,{value:t.confidence})]},a))})}function K3({items:e}){return d.jsx("div",{className:"space-y-1",children:e.map((t,a)=>{const s=t;return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),!!s.unit&&d.jsx("span",{className:"text-c4a-text-muted",children:String(s.unit)}),!!s.threshold&&d.jsxs("span",{className:"text-c4a-text-secondary",children:["< ",String(s.threshold)]}),d.jsx(Za,{value:t.confidence})]},a)})})}function X3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>{const s=t;return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[!!s.claim_type&&d.jsx(Vt,{variant:"warning",children:String(s.claim_type)}),d.jsx("span",{className:"text-c4a-text-primary",children:t.description??t.name}),!!s.valid_from&&d.jsxs("span",{className:"text-c4a-text-muted",children:[String(s.valid_from)," 起"]}),d.jsx(Za,{value:t.confidence})]},a)})})}function Q3({items:e}){return d.jsx("div",{className:"space-y-3",children:e.map((t,a)=>{const s=t,i=s.criteria,l=s.options;return!i||!l?d.jsx("div",{className:"text-xs text-c4a-text-muted",children:d.jsx(Oi,{data:t,defaultExpanded:1})},a):d.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:d.jsxs("table",{className:"w-full text-xs font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted",children:[d.jsx("th",{className:"px-2 py-1 text-left",children:"Criteria"}),l.map((u,f)=>d.jsx("th",{className:"px-2 py-1 text-left",children:String(u.name??`Option ${f+1}`)},f))]})}),d.jsx("tbody",{children:i.map((u,f)=>d.jsxs("tr",{className:"border-b border-c4a-border-subtle",children:[d.jsx("td",{className:"px-2 py-1 text-c4a-text-secondary",children:u}),l.map((m,h)=>{const x=m.values;return d.jsx("td",{className:"px-2 py-1 text-c4a-text-primary",children:x?.[f]??"—"},h)})]},f))})]})},a)})})}function Z3({items:e}){return d.jsx("div",{className:"space-y-1",children:e.map((t,a)=>{const s=t,i=s.included!==!1&&s.type!=="exclude";return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:i?"text-c4a-success":"text-c4a-error",children:i?"✓ 包含":"✗ 排除"}),d.jsx("span",{className:"text-c4a-text-primary",children:t.name??t.description}),d.jsx(Za,{value:t.confidence})]},a)})})}function J3({relation:e}){const t=Lt(),{t:a}=ye(),s=$i(),i=vl(e.confidence),l=e.direction==="incoming"?"←":"→",u=()=>{s?.active?s.navigate("relation",e.id,e.type,"↔"):t(aa.relation(e.id))},f=(m,h)=>{m.stopPropagation(),s?.active?s.navigate("entity",h.id,h.name,"🔹"):t(aa.entity(h.id))};return d.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:u,children:[d.jsx(Vt,{variant:"accent",children:e.type}),d.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:m=>f(m,e.from),children:e.from.name}),d.jsx("span",{className:"text-c4a-text-muted text-xs shrink-0",children:l}),d.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:m=>f(m,e.to),children:e.to.name}),e.weight!==void 0&&d.jsxs("span",{className:"text-xs text-c4a-text-muted ml-auto shrink-0",children:["w: ",e.weight]}),i&&d.jsx(Vt,{variant:i.variant,tooltip:`confidence: ${i.value}`,children:a(i.labelKey)})]})}function W3({entityId:e}){const{t}=ye(),[a,s]=_.useState([]),[i,l]=_.useState(!1),[u,f]=_.useState("both"),[m,h]=_.useState(""),[x,y]=_.useState([]);return _.useEffect(()=>{const v={};u!=="both"&&(v.direction=u),m&&(v.type=m),ze.get(`/entities/${e}/relations`,v).then(b=>{if(s(b.relations),x.length===0){const w=[...new Set(b.relations.map(N=>N.type))];y(w)}l(!0)}).catch(()=>{l(!0)})},[e,u,m]),i?a.length===0?d.jsx(Cn,{title:t("common.empty.entity_relations.title"),description:t("common.empty.entity_relations.description")}):d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[d.jsxs("select",{value:u,onChange:v=>f(v.target.value),className:"bg-c4a-bg-surface border border-c4a-border-subtle rounded px-2 py-1 text-xs font-mono text-c4a-text-secondary",children:[d.jsx("option",{value:"both",children:t("relation.filter.direction.all")}),d.jsx("option",{value:"outgoing",children:t("relation.filter.direction.outgoing")}),d.jsx("option",{value:"incoming",children:t("relation.filter.direction.incoming")})]}),x.length>1&&d.jsxs("select",{value:m,onChange:v=>h(v.target.value),className:"bg-c4a-bg-surface border border-c4a-border-subtle rounded px-2 py-1 text-xs font-mono text-c4a-text-secondary",children:[d.jsx("option",{value:"",children:t("relation.filter.type.all")}),x.map(v=>d.jsx("option",{value:v,children:v},v))]})]}),d.jsx("div",{className:"space-y-1",children:a.map(v=>d.jsx(J3,{relation:v},v.id))})]}):d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function eD(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function pS({content:e}){const{t}=ye(),a=Lt(),s=$i(),i=e.hash_id.slice(0,12),l=()=>{const u=e.source_path??i;s?.active?s.navigate("content",e.hash_id,u,"📄"):a(aa.content(e.hash_id))};return d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors",onClick:l,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"shrink-0",children:"📄"}),d.jsx("span",{className:"font-mono text-xs text-c4a-accent hover:underline truncate",children:i}),e.byte_size!=null&&d.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:eD(e.byte_size)})]}),e.source_path&&d.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted truncate",children:e.source_path}),e.span&&d.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:t("content.card.lines",{start:e.span.start,end:e.span.end})})]})}function tD({entityId:e}){const{t}=ye(),[a,s]=_.useState([]),[i,l]=_.useState(!1);return _.useEffect(()=>{ze.get(`/entities/${e}/contents`).then(u=>{s(u.contents??[]),l(!0)}).catch(()=>l(!0))},[e]),i?a.length===0?d.jsx(Cn,{title:t("common.empty.entity_contents.title"),description:t("common.empty.entity_contents.description")}):d.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(u=>d.jsx(pS,{content:u},u.hash_id))}):d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function nD({entityId:e}){const{t}=ye(),a=Lt(),[s,i]=_.useState([]),[l,u]=_.useState(!1);return _.useEffect(()=>{ze.get(`/entities/${e}/referrers`).then(f=>{i(f.referrers??[]),u(!0)}).catch(()=>u(!0))},[e]),l?s.length===0?d.jsx(Cn,{title:t("common.empty.entity_referrers.title"),description:t("common.empty.entity_referrers.description")}):d.jsx("div",{className:"space-y-1",children:s.map(f=>d.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>a(aa.entity(f.id)),children:[d.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline truncate",children:f.name}),d.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:f.type}),d.jsx("span",{className:"text-xs text-c4a-text-muted font-mono ml-auto shrink-0",children:f.ref_field}),d.jsxs("span",{className:"text-xs text-c4a-text-muted shrink-0",children:["(",f.ref_type,")"]})]},`${f.id}-${f.ref_field}`))}):d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function aD(e,t){var a,s=1;e==null&&(e=0),t==null&&(t=0);function i(){var l,u=a.length,f,m=0,h=0;for(l=0;l<u;++l)f=a[l],m+=f.x,h+=f.y;for(m=(m/u-e)*s,h=(h/u-t)*s,l=0;l<u;++l)f=a[l],f.x-=m,f.y-=h}return i.initialize=function(l){a=l},i.x=function(l){return arguments.length?(e=+l,i):e},i.y=function(l){return arguments.length?(t=+l,i):t},i.strength=function(l){return arguments.length?(s=+l,i):s},i}function rD(e){const t=+this._x.call(null,e),a=+this._y.call(null,e);return gS(this.cover(t,a),t,a,e)}function gS(e,t,a,s){if(isNaN(t)||isNaN(a))return e;var i,l=e._root,u={data:s},f=e._x0,m=e._y0,h=e._x1,x=e._y1,y,v,b,w,N,j,E,R;if(!l)return e._root=u,e;for(;l.length;)if((N=t>=(y=(f+h)/2))?f=y:h=y,(j=a>=(v=(m+x)/2))?m=v:x=v,i=l,!(l=l[E=j<<1|N]))return i[E]=u,e;if(b=+e._x.call(null,l.data),w=+e._y.call(null,l.data),t===b&&a===w)return u.next=l,i?i[E]=u:e._root=u,e;do i=i?i[E]=new Array(4):e._root=new Array(4),(N=t>=(y=(f+h)/2))?f=y:h=y,(j=a>=(v=(m+x)/2))?m=v:x=v;while((E=j<<1|N)===(R=(w>=v)<<1|b>=y));return i[R]=l,i[E]=u,e}function sD(e){var t,a,s=e.length,i,l,u=new Array(s),f=new Array(s),m=1/0,h=1/0,x=-1/0,y=-1/0;for(a=0;a<s;++a)isNaN(i=+this._x.call(null,t=e[a]))||isNaN(l=+this._y.call(null,t))||(u[a]=i,f[a]=l,i<m&&(m=i),i>x&&(x=i),l<h&&(h=l),l>y&&(y=l));if(m>x||h>y)return this;for(this.cover(m,h).cover(x,y),a=0;a<s;++a)gS(this,u[a],f[a],e[a]);return this}function iD(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var a=this._x0,s=this._y0,i=this._x1,l=this._y1;if(isNaN(a))i=(a=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var u=i-a||1,f=this._root,m,h;a>e||e>=i||s>t||t>=l;)switch(h=(t<s)<<1|e<a,m=new Array(4),m[h]=f,f=m,u*=2,h){case 0:i=a+u,l=s+u;break;case 1:a=i-u,l=s+u;break;case 2:i=a+u,s=l-u;break;case 3:a=i-u,s=l-u;break}this._root&&this._root.length&&(this._root=f)}return this._x0=a,this._y0=s,this._x1=i,this._y1=l,this}function oD(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function lD(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function An(e,t,a,s,i){this.node=e,this.x0=t,this.y0=a,this.x1=s,this.y1=i}function cD(e,t,a){var s,i=this._x0,l=this._y0,u,f,m,h,x=this._x1,y=this._y1,v=[],b=this._root,w,N;for(b&&v.push(new An(b,i,l,x,y)),a==null?a=1/0:(i=e-a,l=t-a,x=e+a,y=t+a,a*=a);w=v.pop();)if(!(!(b=w.node)||(u=w.x0)>x||(f=w.y0)>y||(m=w.x1)<i||(h=w.y1)<l))if(b.length){var j=(u+m)/2,E=(f+h)/2;v.push(new An(b[3],j,E,m,h),new An(b[2],u,E,j,h),new An(b[1],j,f,m,E),new An(b[0],u,f,j,E)),(N=(t>=E)<<1|e>=j)&&(w=v[v.length-1],v[v.length-1]=v[v.length-1-N],v[v.length-1-N]=w)}else{var R=e-+this._x.call(null,b.data),k=t-+this._y.call(null,b.data),O=R*R+k*k;if(O<a){var I=Math.sqrt(a=O);i=e-I,l=t-I,x=e+I,y=t+I,s=b.data}}return s}function uD(e){if(isNaN(x=+this._x.call(null,e))||isNaN(y=+this._y.call(null,e)))return this;var t,a=this._root,s,i,l,u=this._x0,f=this._y0,m=this._x1,h=this._y1,x,y,v,b,w,N,j,E;if(!a)return this;if(a.length)for(;;){if((w=x>=(v=(u+m)/2))?u=v:m=v,(N=y>=(b=(f+h)/2))?f=b:h=b,t=a,!(a=a[j=N<<1|w]))return this;if(!a.length)break;(t[j+1&3]||t[j+2&3]||t[j+3&3])&&(s=t,E=j)}for(;a.data!==e;)if(i=a,!(a=a.next))return this;return(l=a.next)&&delete a.next,i?(l?i.next=l:delete i.next,this):t?(l?t[j]=l:delete t[j],(a=t[0]||t[1]||t[2]||t[3])&&a===(t[3]||t[2]||t[1]||t[0])&&!a.length&&(s?s[E]=a:this._root=a),this):(this._root=l,this)}function dD(e){for(var t=0,a=e.length;t<a;++t)this.remove(e[t]);return this}function fD(){return this._root}function hD(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function mD(e){var t=[],a,s=this._root,i,l,u,f,m;for(s&&t.push(new An(s,this._x0,this._y0,this._x1,this._y1));a=t.pop();)if(!e(s=a.node,l=a.x0,u=a.y0,f=a.x1,m=a.y1)&&s.length){var h=(l+f)/2,x=(u+m)/2;(i=s[3])&&t.push(new An(i,h,x,f,m)),(i=s[2])&&t.push(new An(i,l,x,h,m)),(i=s[1])&&t.push(new An(i,h,u,f,x)),(i=s[0])&&t.push(new An(i,l,u,h,x))}return this}function pD(e){var t=[],a=[],s;for(this._root&&t.push(new An(this._root,this._x0,this._y0,this._x1,this._y1));s=t.pop();){var i=s.node;if(i.length){var l,u=s.x0,f=s.y0,m=s.x1,h=s.y1,x=(u+m)/2,y=(f+h)/2;(l=i[0])&&t.push(new An(l,u,f,x,y)),(l=i[1])&&t.push(new An(l,x,f,m,y)),(l=i[2])&&t.push(new An(l,u,y,x,h)),(l=i[3])&&t.push(new An(l,x,y,m,h))}a.push(s)}for(;s=a.pop();)e(s.node,s.x0,s.y0,s.x1,s.y1);return this}function gD(e){return e[0]}function xD(e){return arguments.length?(this._x=e,this):this._x}function yD(e){return e[1]}function vD(e){return arguments.length?(this._y=e,this):this._y}function cp(e,t,a){var s=new up(t??gD,a??yD,NaN,NaN,NaN,NaN);return e==null?s:s.addAll(e)}function up(e,t,a,s,i,l){this._x=e,this._y=t,this._x0=a,this._y0=s,this._x1=i,this._y1=l,this._root=void 0}function Nb(e){for(var t={data:e.data},a=t;e=e.next;)a=a.next={data:e.data};return t}var Mn=cp.prototype=up.prototype;Mn.copy=function(){var e=new up(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,a,s;if(!t)return e;if(!t.length)return e._root=Nb(t),e;for(a=[{source:t,target:e._root=new Array(4)}];t=a.pop();)for(var i=0;i<4;++i)(s=t.source[i])&&(s.length?a.push({source:s,target:t.target[i]=new Array(4)}):t.target[i]=Nb(s));return e};Mn.add=rD;Mn.addAll=sD;Mn.cover=iD;Mn.data=oD;Mn.extent=lD;Mn.find=cD;Mn.remove=uD;Mn.removeAll=dD;Mn.root=fD;Mn.size=hD;Mn.visit=mD;Mn.visitAfter=pD;Mn.x=xD;Mn.y=vD;function ks(e){return function(){return e}}function Jr(e){return(e()-.5)*1e-6}function bD(e){return e.x+e.vx}function _D(e){return e.y+e.vy}function SD(e){var t,a,s,i=1,l=1;typeof e!="function"&&(e=ks(e==null?1:+e));function u(){for(var h,x=t.length,y,v,b,w,N,j,E=0;E<l;++E)for(y=cp(t,bD,_D).visitAfter(f),h=0;h<x;++h)v=t[h],N=a[v.index],j=N*N,b=v.x+v.vx,w=v.y+v.vy,y.visit(R);function R(k,O,I,B,H){var T=k.data,P=k.r,X=N+P;if(T){if(T.index>v.index){var de=b-T.x-T.vx,le=w-T.y-T.vy,ce=de*de+le*le;ce<X*X&&(de===0&&(de=Jr(s),ce+=de*de),le===0&&(le=Jr(s),ce+=le*le),ce=(X-(ce=Math.sqrt(ce)))/ce*i,v.vx+=(de*=ce)*(X=(P*=P)/(j+P)),v.vy+=(le*=ce)*X,T.vx-=de*(X=1-X),T.vy-=le*X)}return}return O>b+X||B<b-X||I>w+X||H<w-X}}function f(h){if(h.data)return h.r=a[h.data.index];for(var x=h.r=0;x<4;++x)h[x]&&h[x].r>h.r&&(h.r=h[x].r)}function m(){if(t){var h,x=t.length,y;for(a=new Array(x),h=0;h<x;++h)y=t[h],a[y.index]=+e(y,h,t)}}return u.initialize=function(h,x){t=h,s=x,m()},u.iterations=function(h){return arguments.length?(l=+h,u):l},u.strength=function(h){return arguments.length?(i=+h,u):i},u.radius=function(h){return arguments.length?(e=typeof h=="function"?h:ks(+h),m(),u):e},u}function wD(e){return e.index}function jb(e,t){var a=e.get(t);if(!a)throw new Error("node not found: "+t);return a}function ND(e){var t=wD,a=y,s,i=ks(30),l,u,f,m,h,x=1;e==null&&(e=[]);function y(j){return 1/Math.min(f[j.source.index],f[j.target.index])}function v(j){for(var E=0,R=e.length;E<x;++E)for(var k=0,O,I,B,H,T,P,X;k<R;++k)O=e[k],I=O.source,B=O.target,H=B.x+B.vx-I.x-I.vx||Jr(h),T=B.y+B.vy-I.y-I.vy||Jr(h),P=Math.sqrt(H*H+T*T),P=(P-l[k])/P*j*s[k],H*=P,T*=P,B.vx-=H*(X=m[k]),B.vy-=T*X,I.vx+=H*(X=1-X),I.vy+=T*X}function b(){if(u){var j,E=u.length,R=e.length,k=new Map(u.map((I,B)=>[t(I,B,u),I])),O;for(j=0,f=new Array(E);j<R;++j)O=e[j],O.index=j,typeof O.source!="object"&&(O.source=jb(k,O.source)),typeof O.target!="object"&&(O.target=jb(k,O.target)),f[O.source.index]=(f[O.source.index]||0)+1,f[O.target.index]=(f[O.target.index]||0)+1;for(j=0,m=new Array(R);j<R;++j)O=e[j],m[j]=f[O.source.index]/(f[O.source.index]+f[O.target.index]);s=new Array(R),w(),l=new Array(R),N()}}function w(){if(u)for(var j=0,E=e.length;j<E;++j)s[j]=+a(e[j],j,e)}function N(){if(u)for(var j=0,E=e.length;j<E;++j)l[j]=+i(e[j],j,e)}return v.initialize=function(j,E){u=j,h=E,b()},v.links=function(j){return arguments.length?(e=j,b(),v):e},v.id=function(j){return arguments.length?(t=j,v):t},v.iterations=function(j){return arguments.length?(x=+j,v):x},v.strength=function(j){return arguments.length?(a=typeof j=="function"?j:ks(+j),w(),v):a},v.distance=function(j){return arguments.length?(i=typeof j=="function"?j:ks(+j),N(),v):i},v}var jD={value:()=>{}};function Qu(){for(var e=0,t=arguments.length,a={},s;e<t;++e){if(!(s=arguments[e]+"")||s in a||/[\s.]/.test(s))throw new Error("illegal type: "+s);a[s]=[]}return new cu(a)}function cu(e){this._=e}function ED(e,t){return e.trim().split(/^|\s+/).map(function(a){var s="",i=a.indexOf(".");if(i>=0&&(s=a.slice(i+1),a=a.slice(0,i)),a&&!t.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:s}})}cu.prototype=Qu.prototype={constructor:cu,on:function(e,t){var a=this._,s=ED(e+"",a),i,l=-1,u=s.length;if(arguments.length<2){for(;++l<u;)if((i=(e=s[l]).type)&&(i=CD(a[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(i=(e=s[l]).type)a[i]=Eb(a[i],e.name,t);else if(t==null)for(i in a)a[i]=Eb(a[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var a in t)e[a]=t[a].slice();return new cu(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var a=new Array(i),s=0,i,l;s<i;++s)a[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],s=0,i=l.length;s<i;++s)l[s].value.apply(t,a)},apply:function(e,t,a){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],i=0,l=s.length;i<l;++i)s[i].value.apply(t,a)}};function CD(e,t){for(var a=0,s=e.length,i;a<s;++a)if((i=e[a]).name===t)return i.value}function Eb(e,t,a){for(var s=0,i=e.length;s<i;++s)if(e[s].name===t){e[s]=jD,e=e.slice(0,s).concat(e.slice(s+1));break}return a!=null&&e.push({name:t,value:a}),e}var Di=0,Fo=0,$o=0,xS=1e3,Cu,Yo,ku=0,Ls=0,Zu=0,cl=typeof performance=="object"&&performance.now?performance:Date,yS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function dp(){return Ls||(yS(kD),Ls=cl.now()+Zu)}function kD(){Ls=0}function Ru(){this._call=this._time=this._next=null}Ru.prototype=fp.prototype={constructor:Ru,restart:function(e,t,a){if(typeof e!="function")throw new TypeError("callback is not a function");a=(a==null?dp():+a)+(t==null?0:+t),!this._next&&Yo!==this&&(Yo?Yo._next=this:Cu=this,Yo=this),this._call=e,this._time=a,Nm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nm())}};function fp(e,t,a){var s=new Ru;return s.restart(e,t,a),s}function RD(){dp(),++Di;for(var e=Cu,t;e;)(t=Ls-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Di}function Cb(){Ls=(ku=cl.now())+Zu,Di=Fo=0;try{RD()}finally{Di=0,AD(),Ls=0}}function TD(){var e=cl.now(),t=e-ku;t>xS&&(Zu-=t,ku=e)}function AD(){for(var e,t=Cu,a,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(a=t._next,t._next=null,t=e?e._next=a:Cu=a);Yo=e,Nm(s)}function Nm(e){if(!Di){Fo&&(Fo=clearTimeout(Fo));var t=e-Ls;t>24?(e<1/0&&(Fo=setTimeout(Cb,e-cl.now()-Zu)),$o&&($o=clearInterval($o))):($o||(ku=cl.now(),$o=setInterval(TD,xS)),Di=1,yS(Cb))}}function kb(e,t,a){var s=new Ru;return t=t==null?0:+t,s.restart(i=>{s.stop(),e(i+t)},t,a),s}const LD=1664525,OD=1013904223,Rb=4294967296;function DD(){let e=1;return()=>(e=(LD*e+OD)%Rb)/Rb}function MD(e){return e.x}function zD(e){return e.y}var UD=10,$D=Math.PI*(3-Math.sqrt(5));function HD(e){var t,a=1,s=.001,i=1-Math.pow(s,1/300),l=0,u=.6,f=new Map,m=fp(y),h=Qu("tick","end"),x=DD();e==null&&(e=[]);function y(){v(),h.call("tick",t),a<s&&(m.stop(),h.call("end",t))}function v(N){var j,E=e.length,R;N===void 0&&(N=1);for(var k=0;k<N;++k)for(a+=(l-a)*i,f.forEach(function(O){O(a)}),j=0;j<E;++j)R=e[j],R.fx==null?R.x+=R.vx*=u:(R.x=R.fx,R.vx=0),R.fy==null?R.y+=R.vy*=u:(R.y=R.fy,R.vy=0);return t}function b(){for(var N=0,j=e.length,E;N<j;++N){if(E=e[N],E.index=N,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),isNaN(E.x)||isNaN(E.y)){var R=UD*Math.sqrt(.5+N),k=N*$D;E.x=R*Math.cos(k),E.y=R*Math.sin(k)}(isNaN(E.vx)||isNaN(E.vy))&&(E.vx=E.vy=0)}}function w(N){return N.initialize&&N.initialize(e,x),N}return b(),t={tick:v,restart:function(){return m.restart(y),t},stop:function(){return m.stop(),t},nodes:function(N){return arguments.length?(e=N,b(),f.forEach(w),t):e},alpha:function(N){return arguments.length?(a=+N,t):a},alphaMin:function(N){return arguments.length?(s=+N,t):s},alphaDecay:function(N){return arguments.length?(i=+N,t):+i},alphaTarget:function(N){return arguments.length?(l=+N,t):l},velocityDecay:function(N){return arguments.length?(u=1-N,t):1-u},randomSource:function(N){return arguments.length?(x=N,f.forEach(w),t):x},force:function(N,j){return arguments.length>1?(j==null?f.delete(N):f.set(N,w(j)),t):f.get(N)},find:function(N,j,E){var R=0,k=e.length,O,I,B,H,T;for(E==null?E=1/0:E*=E,R=0;R<k;++R)H=e[R],O=N-H.x,I=j-H.y,B=O*O+I*I,B<E&&(T=H,E=B);return T},on:function(N,j){return arguments.length>1?(h.on(N,j),t):h.on(N)}}}function BD(){var e,t,a,s,i=ks(-30),l,u=1,f=1/0,m=.81;function h(b){var w,N=e.length,j=cp(e,MD,zD).visitAfter(y);for(s=b,w=0;w<N;++w)t=e[w],j.visit(v)}function x(){if(e){var b,w=e.length,N;for(l=new Array(w),b=0;b<w;++b)N=e[b],l[N.index]=+i(N,b,e)}}function y(b){var w=0,N,j,E=0,R,k,O;if(b.length){for(R=k=O=0;O<4;++O)(N=b[O])&&(j=Math.abs(N.value))&&(w+=N.value,E+=j,R+=j*N.x,k+=j*N.y);b.x=R/E,b.y=k/E}else{N=b,N.x=N.data.x,N.y=N.data.y;do w+=l[N.data.index];while(N=N.next)}b.value=w}function v(b,w,N,j){if(!b.value)return!0;var E=b.x-t.x,R=b.y-t.y,k=j-w,O=E*E+R*R;if(k*k/m<O)return O<f&&(E===0&&(E=Jr(a),O+=E*E),R===0&&(R=Jr(a),O+=R*R),O<u&&(O=Math.sqrt(u*O)),t.vx+=E*b.value*s/O,t.vy+=R*b.value*s/O),!0;if(b.length||O>=f)return;(b.data!==t||b.next)&&(E===0&&(E=Jr(a),O+=E*E),R===0&&(R=Jr(a),O+=R*R),O<u&&(O=Math.sqrt(u*O)));do b.data!==t&&(k=l[b.data.index]*s/O,t.vx+=E*k,t.vy+=R*k);while(b=b.next)}return h.initialize=function(b,w){e=b,a=w,x()},h.strength=function(b){return arguments.length?(i=typeof b=="function"?b:ks(+b),x(),h):i},h.distanceMin=function(b){return arguments.length?(u=b*b,h):Math.sqrt(u)},h.distanceMax=function(b){return arguments.length?(f=b*b,h):Math.sqrt(f)},h.theta=function(b){return arguments.length?(m=b*b,h):Math.sqrt(m)},h}var jm="http://www.w3.org/1999/xhtml";const Tb={svg:"http://www.w3.org/2000/svg",xhtml:jm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ju(e){var t=e+="",a=t.indexOf(":");return a>=0&&(t=e.slice(0,a))!=="xmlns"&&(e=e.slice(a+1)),Tb.hasOwnProperty(t)?{space:Tb[t],local:e}:e}function ID(e){return function(){var t=this.ownerDocument,a=this.namespaceURI;return a===jm&&t.documentElement.namespaceURI===jm?t.createElement(e):t.createElementNS(a,e)}}function PD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vS(e){var t=Ju(e);return(t.local?PD:ID)(t)}function GD(){}function hp(e){return e==null?GD:function(){return this.querySelector(e)}}function VD(e){typeof e!="function"&&(e=hp(e));for(var t=this._groups,a=t.length,s=new Array(a),i=0;i<a;++i)for(var l=t[i],u=l.length,f=s[i]=new Array(u),m,h,x=0;x<u;++x)(m=l[x])&&(h=e.call(m,m.__data__,x,l))&&("__data__"in m&&(h.__data__=m.__data__),f[x]=h);return new ra(s,this._parents)}function qD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function FD(){return[]}function bS(e){return e==null?FD:function(){return this.querySelectorAll(e)}}function YD(e){return function(){return qD(e.apply(this,arguments))}}function KD(e){typeof e=="function"?e=YD(e):e=bS(e);for(var t=this._groups,a=t.length,s=[],i=[],l=0;l<a;++l)for(var u=t[l],f=u.length,m,h=0;h<f;++h)(m=u[h])&&(s.push(e.call(m,m.__data__,h,u)),i.push(m));return new ra(s,i)}function _S(e){return function(){return this.matches(e)}}function SS(e){return function(t){return t.matches(e)}}var XD=Array.prototype.find;function QD(e){return function(){return XD.call(this.children,e)}}function ZD(){return this.firstElementChild}function JD(e){return this.select(e==null?ZD:QD(typeof e=="function"?e:SS(e)))}var WD=Array.prototype.filter;function eM(){return Array.from(this.children)}function tM(e){return function(){return WD.call(this.children,e)}}function nM(e){return this.selectAll(e==null?eM:tM(typeof e=="function"?e:SS(e)))}function aM(e){typeof e!="function"&&(e=_S(e));for(var t=this._groups,a=t.length,s=new Array(a),i=0;i<a;++i)for(var l=t[i],u=l.length,f=s[i]=[],m,h=0;h<u;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new ra(s,this._parents)}function wS(e){return new Array(e.length)}function rM(){return new ra(this._enter||this._groups.map(wS),this._parents)}function Tu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tu.prototype={constructor:Tu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function sM(e){return function(){return e}}function iM(e,t,a,s,i,l){for(var u=0,f,m=t.length,h=l.length;u<h;++u)(f=t[u])?(f.__data__=l[u],s[u]=f):a[u]=new Tu(e,l[u]);for(;u<m;++u)(f=t[u])&&(i[u]=f)}function oM(e,t,a,s,i,l,u){var f,m,h=new Map,x=t.length,y=l.length,v=new Array(x),b;for(f=0;f<x;++f)(m=t[f])&&(v[f]=b=u.call(m,m.__data__,f,t)+"",h.has(b)?i[f]=m:h.set(b,m));for(f=0;f<y;++f)b=u.call(e,l[f],f,l)+"",(m=h.get(b))?(s[f]=m,m.__data__=l[f],h.delete(b)):a[f]=new Tu(e,l[f]);for(f=0;f<x;++f)(m=t[f])&&h.get(v[f])===m&&(i[f]=m)}function lM(e){return e.__data__}function cM(e,t){if(!arguments.length)return Array.from(this,lM);var a=t?oM:iM,s=this._parents,i=this._groups;typeof e!="function"&&(e=sM(e));for(var l=i.length,u=new Array(l),f=new Array(l),m=new Array(l),h=0;h<l;++h){var x=s[h],y=i[h],v=y.length,b=uM(e.call(x,x&&x.__data__,h,s)),w=b.length,N=f[h]=new Array(w),j=u[h]=new Array(w),E=m[h]=new Array(v);a(x,y,N,j,E,b,t);for(var R=0,k=0,O,I;R<w;++R)if(O=N[R]){for(R>=k&&(k=R+1);!(I=j[k])&&++k<w;);O._next=I||null}}return u=new ra(u,s),u._enter=f,u._exit=m,u}function uM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dM(){return new ra(this._exit||this._groups.map(wS),this._parents)}function fM(e,t,a){var s=this.enter(),i=this,l=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),a==null?l.remove():a(l),s&&i?s.merge(i).order():i}function hM(e){for(var t=e.selection?e.selection():e,a=this._groups,s=t._groups,i=a.length,l=s.length,u=Math.min(i,l),f=new Array(i),m=0;m<u;++m)for(var h=a[m],x=s[m],y=h.length,v=f[m]=new Array(y),b,w=0;w<y;++w)(b=h[w]||x[w])&&(v[w]=b);for(;m<i;++m)f[m]=a[m];return new ra(f,this._parents)}function mM(){for(var e=this._groups,t=-1,a=e.length;++t<a;)for(var s=e[t],i=s.length-1,l=s[i],u;--i>=0;)(u=s[i])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function pM(e){e||(e=gM);function t(y,v){return y&&v?e(y.__data__,v.__data__):!y-!v}for(var a=this._groups,s=a.length,i=new Array(s),l=0;l<s;++l){for(var u=a[l],f=u.length,m=i[l]=new Array(f),h,x=0;x<f;++x)(h=u[x])&&(m[x]=h);m.sort(t)}return new ra(i,this._parents).order()}function gM(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function xM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function yM(){return Array.from(this)}function vM(){for(var e=this._groups,t=0,a=e.length;t<a;++t)for(var s=e[t],i=0,l=s.length;i<l;++i){var u=s[i];if(u)return u}return null}function bM(){let e=0;for(const t of this)++e;return e}function _M(){return!this.node()}function SM(e){for(var t=this._groups,a=0,s=t.length;a<s;++a)for(var i=t[a],l=0,u=i.length,f;l<u;++l)(f=i[l])&&e.call(f,f.__data__,l,i);return this}function wM(e){return function(){this.removeAttribute(e)}}function NM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jM(e,t){return function(){this.setAttribute(e,t)}}function EM(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function CM(e,t){return function(){var a=t.apply(this,arguments);a==null?this.removeAttribute(e):this.setAttribute(e,a)}}function kM(e,t){return function(){var a=t.apply(this,arguments);a==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,a)}}function RM(e,t){var a=Ju(e);if(arguments.length<2){var s=this.node();return a.local?s.getAttributeNS(a.space,a.local):s.getAttribute(a)}return this.each((t==null?a.local?NM:wM:typeof t=="function"?a.local?kM:CM:a.local?EM:jM)(a,t))}function NS(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function TM(e){return function(){this.style.removeProperty(e)}}function AM(e,t,a){return function(){this.style.setProperty(e,t,a)}}function LM(e,t,a){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,a)}}function OM(e,t,a){return arguments.length>1?this.each((t==null?TM:typeof t=="function"?LM:AM)(e,t,a??"")):Mi(this.node(),e)}function Mi(e,t){return e.style.getPropertyValue(t)||NS(e).getComputedStyle(e,null).getPropertyValue(t)}function DM(e){return function(){delete this[e]}}function MM(e,t){return function(){this[e]=t}}function zM(e,t){return function(){var a=t.apply(this,arguments);a==null?delete this[e]:this[e]=a}}function UM(e,t){return arguments.length>1?this.each((t==null?DM:typeof t=="function"?zM:MM)(e,t)):this.node()[e]}function jS(e){return e.trim().split(/^|\s+/)}function mp(e){return e.classList||new ES(e)}function ES(e){this._node=e,this._names=jS(e.getAttribute("class")||"")}ES.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function CS(e,t){for(var a=mp(e),s=-1,i=t.length;++s<i;)a.add(t[s])}function kS(e,t){for(var a=mp(e),s=-1,i=t.length;++s<i;)a.remove(t[s])}function $M(e){return function(){CS(this,e)}}function HM(e){return function(){kS(this,e)}}function BM(e,t){return function(){(t.apply(this,arguments)?CS:kS)(this,e)}}function IM(e,t){var a=jS(e+"");if(arguments.length<2){for(var s=mp(this.node()),i=-1,l=a.length;++i<l;)if(!s.contains(a[i]))return!1;return!0}return this.each((typeof t=="function"?BM:t?$M:HM)(a,t))}function PM(){this.textContent=""}function GM(e){return function(){this.textContent=e}}function VM(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function qM(e){return arguments.length?this.each(e==null?PM:(typeof e=="function"?VM:GM)(e)):this.node().textContent}function FM(){this.innerHTML=""}function YM(e){return function(){this.innerHTML=e}}function KM(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function XM(e){return arguments.length?this.each(e==null?FM:(typeof e=="function"?KM:YM)(e)):this.node().innerHTML}function QM(){this.nextSibling&&this.parentNode.appendChild(this)}function ZM(){return this.each(QM)}function JM(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function WM(){return this.each(JM)}function e5(e){var t=typeof e=="function"?e:vS(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function t5(){return null}function n5(e,t){var a=typeof e=="function"?e:vS(e),s=t==null?t5:typeof t=="function"?t:hp(t);return this.select(function(){return this.insertBefore(a.apply(this,arguments),s.apply(this,arguments)||null)})}function a5(){var e=this.parentNode;e&&e.removeChild(this)}function r5(){return this.each(a5)}function s5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function i5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function o5(e){return this.select(e?i5:s5)}function l5(e){return arguments.length?this.property("__data__",e):this.node().__data__}function c5(e){return function(t){e.call(this,t,this.__data__)}}function u5(e){return e.trim().split(/^|\s+/).map(function(t){var a="",s=t.indexOf(".");return s>=0&&(a=t.slice(s+1),t=t.slice(0,s)),{type:t,name:a}})}function d5(e){return function(){var t=this.__on;if(t){for(var a=0,s=-1,i=t.length,l;a<i;++a)l=t[a],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++s]=l;++s?t.length=s:delete this.__on}}}function f5(e,t,a){return function(){var s=this.__on,i,l=c5(t);if(s){for(var u=0,f=s.length;u<f;++u)if((i=s[u]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=l,i.options=a),i.value=t;return}}this.addEventListener(e.type,l,a),i={type:e.type,name:e.name,value:t,listener:l,options:a},s?s.push(i):this.__on=[i]}}function h5(e,t,a){var s=u5(e+""),i,l=s.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var m=0,h=f.length,x;m<h;++m)for(i=0,x=f[m];i<l;++i)if((u=s[i]).type===x.type&&u.name===x.name)return x.value}return}for(f=t?f5:d5,i=0;i<l;++i)this.each(f(s[i],t,a));return this}function RS(e,t,a){var s=NS(e),i=s.CustomEvent;typeof i=="function"?i=new i(t,a):(i=s.document.createEvent("Event"),a?(i.initEvent(t,a.bubbles,a.cancelable),i.detail=a.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function m5(e,t){return function(){return RS(this,e,t)}}function p5(e,t){return function(){return RS(this,e,t.apply(this,arguments))}}function g5(e,t){return this.each((typeof t=="function"?p5:m5)(e,t))}function*x5(){for(var e=this._groups,t=0,a=e.length;t<a;++t)for(var s=e[t],i=0,l=s.length,u;i<l;++i)(u=s[i])&&(yield u)}var TS=[null];function ra(e,t){this._groups=e,this._parents=t}function Nl(){return new ra([[document.documentElement]],TS)}function y5(){return this}ra.prototype=Nl.prototype={constructor:ra,select:VD,selectAll:KD,selectChild:JD,selectChildren:nM,filter:aM,data:cM,enter:rM,exit:dM,join:fM,merge:hM,selection:y5,order:mM,sort:pM,call:xM,nodes:yM,node:vM,size:bM,empty:_M,each:SM,attr:RM,style:OM,property:UM,classed:IM,text:qM,html:XM,raise:ZM,lower:WM,append:e5,insert:n5,remove:r5,clone:o5,datum:l5,on:h5,dispatch:g5,[Symbol.iterator]:x5};function wa(e){return typeof e=="string"?new ra([[document.querySelector(e)]],[document.documentElement]):new ra([[e]],TS)}function v5(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ss(e,t){if(e=v5(e),t===void 0&&(t=e.currentTarget),t){var a=t.ownerSVGElement||t;if(a.createSVGPoint){var s=a.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Em={capture:!0,passive:!1};function Cm(e){e.preventDefault(),e.stopImmediatePropagation()}function b5(e){var t=e.document.documentElement,a=wa(e).on("dragstart.drag",Cm,Em);"onselectstart"in t?a.on("selectstart.drag",Cm,Em):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function _5(e,t){var a=e.document.documentElement,s=wa(e).on("dragstart.drag",null);t&&(s.on("click.drag",Cm,Em),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in a?s.on("selectstart.drag",null):(a.style.MozUserSelect=a.__noselect,delete a.__noselect)}function pp(e,t,a){e.prototype=t.prototype=a,a.constructor=e}function AS(e,t){var a=Object.create(e.prototype);for(var s in t)a[s]=t[s];return a}function jl(){}var ul=.7,Au=1/ul,Ri="\\s*([+-]?\\d+)\\s*",dl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ya="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",S5=/^#([0-9a-f]{3,8})$/,w5=new RegExp(`^rgb\\(${Ri},${Ri},${Ri}\\)$`),N5=new RegExp(`^rgb\\(${Ya},${Ya},${Ya}\\)$`),j5=new RegExp(`^rgba\\(${Ri},${Ri},${Ri},${dl}\\)$`),E5=new RegExp(`^rgba\\(${Ya},${Ya},${Ya},${dl}\\)$`),C5=new RegExp(`^hsl\\(${dl},${Ya},${Ya}\\)$`),k5=new RegExp(`^hsla\\(${dl},${Ya},${Ya},${dl}\\)$`),Ab={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};pp(jl,fl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lb,formatHex:Lb,formatHex8:R5,formatHsl:T5,formatRgb:Ob,toString:Ob});function Lb(){return this.rgb().formatHex()}function R5(){return this.rgb().formatHex8()}function T5(){return LS(this).formatHsl()}function Ob(){return this.rgb().formatRgb()}function fl(e){var t,a;return e=(e+"").trim().toLowerCase(),(t=S5.exec(e))?(a=t[1].length,t=parseInt(t[1],16),a===6?Db(t):a===3?new Vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):a===8?Jc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):a===4?Jc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=w5.exec(e))?new Vn(t[1],t[2],t[3],1):(t=N5.exec(e))?new Vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=j5.exec(e))?Jc(t[1],t[2],t[3],t[4]):(t=E5.exec(e))?Jc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=C5.exec(e))?Ub(t[1],t[2]/100,t[3]/100,1):(t=k5.exec(e))?Ub(t[1],t[2]/100,t[3]/100,t[4]):Ab.hasOwnProperty(e)?Db(Ab[e]):e==="transparent"?new Vn(NaN,NaN,NaN,0):null}function Db(e){return new Vn(e>>16&255,e>>8&255,e&255,1)}function Jc(e,t,a,s){return s<=0&&(e=t=a=NaN),new Vn(e,t,a,s)}function A5(e){return e instanceof jl||(e=fl(e)),e?(e=e.rgb(),new Vn(e.r,e.g,e.b,e.opacity)):new Vn}function km(e,t,a,s){return arguments.length===1?A5(e):new Vn(e,t,a,s??1)}function Vn(e,t,a,s){this.r=+e,this.g=+t,this.b=+a,this.opacity=+s}pp(Vn,km,AS(jl,{brighter(e){return e=e==null?Au:Math.pow(Au,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ul:Math.pow(ul,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vn(Rs(this.r),Rs(this.g),Rs(this.b),Lu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mb,formatHex:Mb,formatHex8:L5,formatRgb:zb,toString:zb}));function Mb(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}`}function L5(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}${Es((isNaN(this.opacity)?1:this.opacity)*255)}`}function zb(){const e=Lu(this.opacity);return`${e===1?"rgb(":"rgba("}${Rs(this.r)}, ${Rs(this.g)}, ${Rs(this.b)}${e===1?")":`, ${e})`}`}function Lu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Es(e){return e=Rs(e),(e<16?"0":"")+e.toString(16)}function Ub(e,t,a,s){return s<=0?e=t=a=NaN:a<=0||a>=1?e=t=NaN:t<=0&&(e=NaN),new La(e,t,a,s)}function LS(e){if(e instanceof La)return new La(e.h,e.s,e.l,e.opacity);if(e instanceof jl||(e=fl(e)),!e)return new La;if(e instanceof La)return e;e=e.rgb();var t=e.r/255,a=e.g/255,s=e.b/255,i=Math.min(t,a,s),l=Math.max(t,a,s),u=NaN,f=l-i,m=(l+i)/2;return f?(t===l?u=(a-s)/f+(a<s)*6:a===l?u=(s-t)/f+2:u=(t-a)/f+4,f/=m<.5?l+i:2-l-i,u*=60):f=m>0&&m<1?0:u,new La(u,f,m,e.opacity)}function O5(e,t,a,s){return arguments.length===1?LS(e):new La(e,t,a,s??1)}function La(e,t,a,s){this.h=+e,this.s=+t,this.l=+a,this.opacity=+s}pp(La,O5,AS(jl,{brighter(e){return e=e==null?Au:Math.pow(Au,e),new La(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ul:Math.pow(ul,e),new La(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,a=this.l,s=a+(a<.5?a:1-a)*t,i=2*a-s;return new Vn(Ph(e>=240?e-240:e+120,i,s),Ph(e,i,s),Ph(e<120?e+240:e-120,i,s),this.opacity)},clamp(){return new La($b(this.h),Wc(this.s),Wc(this.l),Lu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lu(this.opacity);return`${e===1?"hsl(":"hsla("}${$b(this.h)}, ${Wc(this.s)*100}%, ${Wc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $b(e){return e=(e||0)%360,e<0?e+360:e}function Wc(e){return Math.max(0,Math.min(1,e||0))}function Ph(e,t,a){return(e<60?t+(a-t)*e/60:e<180?a:e<240?t+(a-t)*(240-e)/60:t)*255}const OS=e=>()=>e;function D5(e,t){return function(a){return e+a*t}}function M5(e,t,a){return e=Math.pow(e,a),t=Math.pow(t,a)-e,a=1/a,function(s){return Math.pow(e+s*t,a)}}function z5(e){return(e=+e)==1?DS:function(t,a){return a-t?M5(t,a,e):OS(isNaN(t)?a:t)}}function DS(e,t){var a=t-e;return a?D5(e,a):OS(isNaN(e)?t:e)}const Hb=(function e(t){var a=z5(t);function s(i,l){var u=a((i=km(i)).r,(l=km(l)).r),f=a(i.g,l.g),m=a(i.b,l.b),h=DS(i.opacity,l.opacity);return function(x){return i.r=u(x),i.g=f(x),i.b=m(x),i.opacity=h(x),i+""}}return s.gamma=e,s})(1);function Yr(e,t){return e=+e,t=+t,function(a){return e*(1-a)+t*a}}var Rm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gh=new RegExp(Rm.source,"g");function U5(e){return function(){return e}}function $5(e){return function(t){return e(t)+""}}function H5(e,t){var a=Rm.lastIndex=Gh.lastIndex=0,s,i,l,u=-1,f=[],m=[];for(e=e+"",t=t+"";(s=Rm.exec(e))&&(i=Gh.exec(t));)(l=i.index)>a&&(l=t.slice(a,l),f[u]?f[u]+=l:f[++u]=l),(s=s[0])===(i=i[0])?f[u]?f[u]+=i:f[++u]=i:(f[++u]=null,m.push({i:u,x:Yr(s,i)})),a=Gh.lastIndex;return a<t.length&&(l=t.slice(a),f[u]?f[u]+=l:f[++u]=l),f.length<2?m[0]?$5(m[0].x):U5(t):(t=m.length,function(h){for(var x=0,y;x<t;++x)f[(y=m[x]).i]=y.x(h);return f.join("")})}var Bb=180/Math.PI,Tm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function MS(e,t,a,s,i,l){var u,f,m;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(m=e*a+t*s)&&(a-=e*m,s-=t*m),(f=Math.sqrt(a*a+s*s))&&(a/=f,s/=f,m/=f),e*s<t*a&&(e=-e,t=-t,m=-m,u=-u),{translateX:i,translateY:l,rotate:Math.atan2(t,e)*Bb,skewX:Math.atan(m)*Bb,scaleX:u,scaleY:f}}var eu;function B5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Tm:MS(t.a,t.b,t.c,t.d,t.e,t.f)}function I5(e){return e==null||(eu||(eu=document.createElementNS("http://www.w3.org/2000/svg","g")),eu.setAttribute("transform",e),!(e=eu.transform.baseVal.consolidate()))?Tm:(e=e.matrix,MS(e.a,e.b,e.c,e.d,e.e,e.f))}function zS(e,t,a,s){function i(h){return h.length?h.pop()+" ":""}function l(h,x,y,v,b,w){if(h!==y||x!==v){var N=b.push("translate(",null,t,null,a);w.push({i:N-4,x:Yr(h,y)},{i:N-2,x:Yr(x,v)})}else(y||v)&&b.push("translate("+y+t+v+a)}function u(h,x,y,v){h!==x?(h-x>180?x+=360:x-h>180&&(h+=360),v.push({i:y.push(i(y)+"rotate(",null,s)-2,x:Yr(h,x)})):x&&y.push(i(y)+"rotate("+x+s)}function f(h,x,y,v){h!==x?v.push({i:y.push(i(y)+"skewX(",null,s)-2,x:Yr(h,x)}):x&&y.push(i(y)+"skewX("+x+s)}function m(h,x,y,v,b,w){if(h!==y||x!==v){var N=b.push(i(b)+"scale(",null,",",null,")");w.push({i:N-4,x:Yr(h,y)},{i:N-2,x:Yr(x,v)})}else(y!==1||v!==1)&&b.push(i(b)+"scale("+y+","+v+")")}return function(h,x){var y=[],v=[];return h=e(h),x=e(x),l(h.translateX,h.translateY,x.translateX,x.translateY,y,v),u(h.rotate,x.rotate,y,v),f(h.skewX,x.skewX,y,v),m(h.scaleX,h.scaleY,x.scaleX,x.scaleY,y,v),h=x=null,function(b){for(var w=-1,N=v.length,j;++w<N;)y[(j=v[w]).i]=j.x(b);return y.join("")}}}var P5=zS(B5,"px, ","px)","deg)"),G5=zS(I5,", ",")",")"),V5=1e-12;function Ib(e){return((e=Math.exp(e))+1/e)/2}function q5(e){return((e=Math.exp(e))-1/e)/2}function F5(e){return((e=Math.exp(2*e))-1)/(e+1)}const Y5=(function e(t,a,s){function i(l,u){var f=l[0],m=l[1],h=l[2],x=u[0],y=u[1],v=u[2],b=x-f,w=y-m,N=b*b+w*w,j,E;if(N<V5)E=Math.log(v/h)/t,j=function(H){return[f+H*b,m+H*w,h*Math.exp(t*H*E)]};else{var R=Math.sqrt(N),k=(v*v-h*h+s*N)/(2*h*a*R),O=(v*v-h*h-s*N)/(2*v*a*R),I=Math.log(Math.sqrt(k*k+1)-k),B=Math.log(Math.sqrt(O*O+1)-O);E=(B-I)/t,j=function(H){var T=H*E,P=Ib(I),X=h/(a*R)*(P*F5(t*T+I)-q5(I));return[f+X*b,m+X*w,h*P/Ib(t*T+I)]}}return j.duration=E*1e3*t/Math.SQRT2,j}return i.rho=function(l){var u=Math.max(.001,+l),f=u*u,m=f*f;return e(u,f,m)},i})(Math.SQRT2,2,4);var K5=Qu("start","end","cancel","interrupt"),X5=[],US=0,Pb=1,Am=2,uu=3,Gb=4,Lm=5,du=6;function Wu(e,t,a,s,i,l){var u=e.__transition;if(!u)e.__transition={};else if(a in u)return;Q5(e,a,{name:t,index:s,group:i,on:K5,tween:X5,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:US})}function gp(e,t){var a=Ma(e,t);if(a.state>US)throw new Error("too late; already scheduled");return a}function Ja(e,t){var a=Ma(e,t);if(a.state>uu)throw new Error("too late; already running");return a}function Ma(e,t){var a=e.__transition;if(!a||!(a=a[t]))throw new Error("transition not found");return a}function Q5(e,t,a){var s=e.__transition,i;s[t]=a,a.timer=fp(l,0,a.time);function l(h){a.state=Pb,a.timer.restart(u,a.delay,a.time),a.delay<=h&&u(h-a.delay)}function u(h){var x,y,v,b;if(a.state!==Pb)return m();for(x in s)if(b=s[x],b.name===a.name){if(b.state===uu)return kb(u);b.state===Gb?(b.state=du,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete s[x]):+x<t&&(b.state=du,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete s[x])}if(kb(function(){a.state===uu&&(a.state=Gb,a.timer.restart(f,a.delay,a.time),f(h))}),a.state=Am,a.on.call("start",e,e.__data__,a.index,a.group),a.state===Am){for(a.state=uu,i=new Array(v=a.tween.length),x=0,y=-1;x<v;++x)(b=a.tween[x].value.call(e,e.__data__,a.index,a.group))&&(i[++y]=b);i.length=y+1}}function f(h){for(var x=h<a.duration?a.ease.call(null,h/a.duration):(a.timer.restart(m),a.state=Lm,1),y=-1,v=i.length;++y<v;)i[y].call(e,x);a.state===Lm&&(a.on.call("end",e,e.__data__,a.index,a.group),m())}function m(){a.state=du,a.timer.stop(),delete s[t];for(var h in s)return;delete e.__transition}}function fu(e,t){var a=e.__transition,s,i,l=!0,u;if(a){t=t==null?null:t+"";for(u in a){if((s=a[u]).name!==t){l=!1;continue}i=s.state>Am&&s.state<Lm,s.state=du,s.timer.stop(),s.on.call(i?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete a[u]}l&&delete e.__transition}}function Z5(e){return this.each(function(){fu(this,e)})}function J5(e,t){var a,s;return function(){var i=Ja(this,e),l=i.tween;if(l!==a){s=a=l;for(var u=0,f=s.length;u<f;++u)if(s[u].name===t){s=s.slice(),s.splice(u,1);break}}i.tween=s}}function W5(e,t,a){var s,i;if(typeof a!="function")throw new Error;return function(){var l=Ja(this,e),u=l.tween;if(u!==s){i=(s=u).slice();for(var f={name:t,value:a},m=0,h=i.length;m<h;++m)if(i[m].name===t){i[m]=f;break}m===h&&i.push(f)}l.tween=i}}function ez(e,t){var a=this._id;if(e+="",arguments.length<2){for(var s=Ma(this.node(),a).tween,i=0,l=s.length,u;i<l;++i)if((u=s[i]).name===e)return u.value;return null}return this.each((t==null?J5:W5)(a,e,t))}function xp(e,t,a){var s=e._id;return e.each(function(){var i=Ja(this,s);(i.value||(i.value={}))[t]=a.apply(this,arguments)}),function(i){return Ma(i,s).value[t]}}function $S(e,t){var a;return(typeof t=="number"?Yr:t instanceof fl?Hb:(a=fl(t))?(t=a,Hb):H5)(e,t)}function tz(e){return function(){this.removeAttribute(e)}}function nz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function az(e,t,a){var s,i=a+"",l;return function(){var u=this.getAttribute(e);return u===i?null:u===s?l:l=t(s=u,a)}}function rz(e,t,a){var s,i=a+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===i?null:u===s?l:l=t(s=u,a)}}function sz(e,t,a){var s,i,l;return function(){var u,f=a(this),m;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),m=f+"",u===m?null:u===s&&m===i?l:(i=m,l=t(s=u,f)))}}function iz(e,t,a){var s,i,l;return function(){var u,f=a(this),m;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),m=f+"",u===m?null:u===s&&m===i?l:(i=m,l=t(s=u,f)))}}function oz(e,t){var a=Ju(e),s=a==="transform"?G5:$S;return this.attrTween(e,typeof t=="function"?(a.local?iz:sz)(a,s,xp(this,"attr."+e,t)):t==null?(a.local?nz:tz)(a):(a.local?rz:az)(a,s,t))}function lz(e,t){return function(a){this.setAttribute(e,t.call(this,a))}}function cz(e,t){return function(a){this.setAttributeNS(e.space,e.local,t.call(this,a))}}function uz(e,t){var a,s;function i(){var l=t.apply(this,arguments);return l!==s&&(a=(s=l)&&cz(e,l)),a}return i._value=t,i}function dz(e,t){var a,s;function i(){var l=t.apply(this,arguments);return l!==s&&(a=(s=l)&&lz(e,l)),a}return i._value=t,i}function fz(e,t){var a="attr."+e;if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;var s=Ju(e);return this.tween(a,(s.local?uz:dz)(s,t))}function hz(e,t){return function(){gp(this,e).delay=+t.apply(this,arguments)}}function mz(e,t){return t=+t,function(){gp(this,e).delay=t}}function pz(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hz:mz)(t,e)):Ma(this.node(),t).delay}function gz(e,t){return function(){Ja(this,e).duration=+t.apply(this,arguments)}}function xz(e,t){return t=+t,function(){Ja(this,e).duration=t}}function yz(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gz:xz)(t,e)):Ma(this.node(),t).duration}function vz(e,t){if(typeof t!="function")throw new Error;return function(){Ja(this,e).ease=t}}function bz(e){var t=this._id;return arguments.length?this.each(vz(t,e)):Ma(this.node(),t).ease}function _z(e,t){return function(){var a=t.apply(this,arguments);if(typeof a!="function")throw new Error;Ja(this,e).ease=a}}function Sz(e){if(typeof e!="function")throw new Error;return this.each(_z(this._id,e))}function wz(e){typeof e!="function"&&(e=_S(e));for(var t=this._groups,a=t.length,s=new Array(a),i=0;i<a;++i)for(var l=t[i],u=l.length,f=s[i]=[],m,h=0;h<u;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new _r(s,this._parents,this._name,this._id)}function Nz(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,a=e._groups,s=t.length,i=a.length,l=Math.min(s,i),u=new Array(s),f=0;f<l;++f)for(var m=t[f],h=a[f],x=m.length,y=u[f]=new Array(x),v,b=0;b<x;++b)(v=m[b]||h[b])&&(y[b]=v);for(;f<s;++f)u[f]=t[f];return new _r(u,this._parents,this._name,this._id)}function jz(e){return(e+"").trim().split(/^|\s+/).every(function(t){var a=t.indexOf(".");return a>=0&&(t=t.slice(0,a)),!t||t==="start"})}function Ez(e,t,a){var s,i,l=jz(t)?gp:Ja;return function(){var u=l(this,e),f=u.on;f!==s&&(i=(s=f).copy()).on(t,a),u.on=i}}function Cz(e,t){var a=this._id;return arguments.length<2?Ma(this.node(),a).on.on(e):this.each(Ez(a,e,t))}function kz(e){return function(){var t=this.parentNode;for(var a in this.__transition)if(+a!==e)return;t&&t.removeChild(this)}}function Rz(){return this.on("end.remove",kz(this._id))}function Tz(e){var t=this._name,a=this._id;typeof e!="function"&&(e=hp(e));for(var s=this._groups,i=s.length,l=new Array(i),u=0;u<i;++u)for(var f=s[u],m=f.length,h=l[u]=new Array(m),x,y,v=0;v<m;++v)(x=f[v])&&(y=e.call(x,x.__data__,v,f))&&("__data__"in x&&(y.__data__=x.__data__),h[v]=y,Wu(h[v],t,a,v,h,Ma(x,a)));return new _r(l,this._parents,t,a)}function Az(e){var t=this._name,a=this._id;typeof e!="function"&&(e=bS(e));for(var s=this._groups,i=s.length,l=[],u=[],f=0;f<i;++f)for(var m=s[f],h=m.length,x,y=0;y<h;++y)if(x=m[y]){for(var v=e.call(x,x.__data__,y,m),b,w=Ma(x,a),N=0,j=v.length;N<j;++N)(b=v[N])&&Wu(b,t,a,N,v,w);l.push(v),u.push(x)}return new _r(l,u,t,a)}var Lz=Nl.prototype.constructor;function Oz(){return new Lz(this._groups,this._parents)}function Dz(e,t){var a,s,i;return function(){var l=Mi(this,e),u=(this.style.removeProperty(e),Mi(this,e));return l===u?null:l===a&&u===s?i:i=t(a=l,s=u)}}function HS(e){return function(){this.style.removeProperty(e)}}function Mz(e,t,a){var s,i=a+"",l;return function(){var u=Mi(this,e);return u===i?null:u===s?l:l=t(s=u,a)}}function zz(e,t,a){var s,i,l;return function(){var u=Mi(this,e),f=a(this),m=f+"";return f==null&&(m=f=(this.style.removeProperty(e),Mi(this,e))),u===m?null:u===s&&m===i?l:(i=m,l=t(s=u,f))}}function Uz(e,t){var a,s,i,l="style."+t,u="end."+l,f;return function(){var m=Ja(this,e),h=m.on,x=m.value[l]==null?f||(f=HS(t)):void 0;(h!==a||i!==x)&&(s=(a=h).copy()).on(u,i=x),m.on=s}}function $z(e,t,a){var s=(e+="")=="transform"?P5:$S;return t==null?this.styleTween(e,Dz(e,s)).on("end.style."+e,HS(e)):typeof t=="function"?this.styleTween(e,zz(e,s,xp(this,"style."+e,t))).each(Uz(this._id,e)):this.styleTween(e,Mz(e,s,t),a).on("end.style."+e,null)}function Hz(e,t,a){return function(s){this.style.setProperty(e,t.call(this,s),a)}}function Bz(e,t,a){var s,i;function l(){var u=t.apply(this,arguments);return u!==i&&(s=(i=u)&&Hz(e,u,a)),s}return l._value=t,l}function Iz(e,t,a){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,Bz(e,t,a??""))}function Pz(e){return function(){this.textContent=e}}function Gz(e){return function(){var t=e(this);this.textContent=t??""}}function Vz(e){return this.tween("text",typeof e=="function"?Gz(xp(this,"text",e)):Pz(e==null?"":e+""))}function qz(e){return function(t){this.textContent=e.call(this,t)}}function Fz(e){var t,a;function s(){var i=e.apply(this,arguments);return i!==a&&(t=(a=i)&&qz(i)),t}return s._value=e,s}function Yz(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Fz(e))}function Kz(){for(var e=this._name,t=this._id,a=BS(),s=this._groups,i=s.length,l=0;l<i;++l)for(var u=s[l],f=u.length,m,h=0;h<f;++h)if(m=u[h]){var x=Ma(m,t);Wu(m,e,a,h,u,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new _r(s,this._parents,e,a)}function Xz(){var e,t,a=this,s=a._id,i=a.size();return new Promise(function(l,u){var f={value:u},m={value:function(){--i===0&&l()}};a.each(function(){var h=Ja(this,s),x=h.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(m)),h.on=t}),i===0&&l()})}var Qz=0;function _r(e,t,a,s){this._groups=e,this._parents=t,this._name=a,this._id=s}function BS(){return++Qz}var gr=Nl.prototype;_r.prototype={constructor:_r,select:Tz,selectAll:Az,selectChild:gr.selectChild,selectChildren:gr.selectChildren,filter:wz,merge:Nz,selection:Oz,transition:Kz,call:gr.call,nodes:gr.nodes,node:gr.node,size:gr.size,empty:gr.empty,each:gr.each,on:Cz,attr:oz,attrTween:fz,style:$z,styleTween:Iz,text:Vz,textTween:Yz,remove:Rz,tween:ez,delay:pz,duration:yz,ease:bz,easeVarying:Sz,end:Xz,[Symbol.iterator]:gr[Symbol.iterator]};function Zz(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Jz={time:null,delay:0,duration:250,ease:Zz};function Wz(e,t){for(var a;!(a=e.__transition)||!(a=a[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return a}function e6(e){var t,a;e instanceof _r?(t=e._id,e=e._name):(t=BS(),(a=Jz).time=dp(),e=e==null?null:e+"");for(var s=this._groups,i=s.length,l=0;l<i;++l)for(var u=s[l],f=u.length,m,h=0;h<f;++h)(m=u[h])&&Wu(m,e,t,h,u,a||Wz(m,t));return new _r(s,this._parents,e,t)}Nl.prototype.interrupt=Z5;Nl.prototype.transition=e6;const tu=e=>()=>e;function t6(e,{sourceEvent:t,target:a,transform:s,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:i}})}function vr(e,t,a){this.k=e,this.x=t,this.y=a}vr.prototype={constructor:vr,scale:function(e){return e===1?this:new vr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new vr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var yp=new vr(1,0,0);vr.prototype;function Vh(e){e.stopImmediatePropagation()}function Ho(e){e.preventDefault(),e.stopImmediatePropagation()}function n6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function a6(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Vb(){return this.__zoom||yp}function r6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function s6(){return navigator.maxTouchPoints||"ontouchstart"in this}function i6(e,t,a){var s=e.invertX(t[0][0])-a[0][0],i=e.invertX(t[1][0])-a[1][0],l=e.invertY(t[0][1])-a[0][1],u=e.invertY(t[1][1])-a[1][1];return e.translate(i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function o6(){var e=n6,t=a6,a=i6,s=r6,i=s6,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,m=Y5,h=Qu("start","zoom","end"),x,y,v,b=500,w=150,N=0,j=10;function E(D){D.property("__zoom",Vb).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",X).filter(i).on("touchstart.zoom",de).on("touchmove.zoom",le).on("touchend.zoom touchcancel.zoom",ce).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(D,F,A,G){var ae=D.selection?D.selection():D;ae.property("__zoom",Vb),D!==ae?I(D,F,A,G):ae.interrupt().each(function(){B(this,arguments).event(G).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},E.scaleBy=function(D,F,A,G){E.scaleTo(D,function(){var ae=this.__zoom.k,ee=typeof F=="function"?F.apply(this,arguments):F;return ae*ee},A,G)},E.scaleTo=function(D,F,A,G){E.transform(D,function(){var ae=t.apply(this,arguments),ee=this.__zoom,J=A==null?O(ae):typeof A=="function"?A.apply(this,arguments):A,L=ee.invert(J),q=typeof F=="function"?F.apply(this,arguments):F;return a(k(R(ee,q),J,L),ae,u)},A,G)},E.translateBy=function(D,F,A,G){E.transform(D,function(){return a(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),u)},null,G)},E.translateTo=function(D,F,A,G,ae){E.transform(D,function(){var ee=t.apply(this,arguments),J=this.__zoom,L=G==null?O(ee):typeof G=="function"?G.apply(this,arguments):G;return a(yp.translate(L[0],L[1]).scale(J.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof A=="function"?-A.apply(this,arguments):-A),ee,u)},G,ae)};function R(D,F){return F=Math.max(l[0],Math.min(l[1],F)),F===D.k?D:new vr(F,D.x,D.y)}function k(D,F,A){var G=F[0]-A[0]*D.k,ae=F[1]-A[1]*D.k;return G===D.x&&ae===D.y?D:new vr(D.k,G,ae)}function O(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function I(D,F,A,G){D.on("start.zoom",function(){B(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){B(this,arguments).event(G).end()}).tween("zoom",function(){var ae=this,ee=arguments,J=B(ae,ee).event(G),L=t.apply(ae,ee),q=A==null?O(L):typeof A=="function"?A.apply(ae,ee):A,re=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),ie=ae.__zoom,ge=typeof F=="function"?F.apply(ae,ee):F,xe=m(ie.invert(q).concat(re/ie.k),ge.invert(q).concat(re/ge.k));return function(Ee){if(Ee===1)Ee=ge;else{var De=xe(Ee),qe=re/De[2];Ee=new vr(qe,q[0]-De[0]*qe,q[1]-De[1]*qe)}J.zoom(null,Ee)}})}function B(D,F,A){return!A&&D.__zooming||new H(D,F)}function H(D,F){this.that=D,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,F),this.taps=0}H.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,F){return this.mouse&&D!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var F=wa(this.that).datum();h.call(D,this.that,new t6(D,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:h}),F)}};function T(D,...F){if(!e.apply(this,arguments))return;var A=B(this,F).event(D),G=this.__zoom,ae=Math.max(l[0],Math.min(l[1],G.k*Math.pow(2,s.apply(this,arguments)))),ee=Ss(D);if(A.wheel)(A.mouse[0][0]!==ee[0]||A.mouse[0][1]!==ee[1])&&(A.mouse[1]=G.invert(A.mouse[0]=ee)),clearTimeout(A.wheel);else{if(G.k===ae)return;A.mouse=[ee,G.invert(ee)],fu(this),A.start()}Ho(D),A.wheel=setTimeout(J,w),A.zoom("mouse",a(k(R(G,ae),A.mouse[0],A.mouse[1]),A.extent,u));function J(){A.wheel=null,A.end()}}function P(D,...F){if(v||!e.apply(this,arguments))return;var A=D.currentTarget,G=B(this,F,!0).event(D),ae=wa(D.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",re,!0),ee=Ss(D,A),J=D.clientX,L=D.clientY;b5(D.view),Vh(D),G.mouse=[ee,this.__zoom.invert(ee)],fu(this),G.start();function q(ie){if(Ho(ie),!G.moved){var ge=ie.clientX-J,xe=ie.clientY-L;G.moved=ge*ge+xe*xe>N}G.event(ie).zoom("mouse",a(k(G.that.__zoom,G.mouse[0]=Ss(ie,A),G.mouse[1]),G.extent,u))}function re(ie){ae.on("mousemove.zoom mouseup.zoom",null),_5(ie.view,G.moved),Ho(ie),G.event(ie).end()}}function X(D,...F){if(e.apply(this,arguments)){var A=this.__zoom,G=Ss(D.changedTouches?D.changedTouches[0]:D,this),ae=A.invert(G),ee=A.k*(D.shiftKey?.5:2),J=a(k(R(A,ee),G,ae),t.apply(this,F),u);Ho(D),f>0?wa(this).transition().duration(f).call(I,J,G,D):wa(this).call(E.transform,J,G,D)}}function de(D,...F){if(e.apply(this,arguments)){var A=D.touches,G=A.length,ae=B(this,F,D.changedTouches.length===G).event(D),ee,J,L,q;for(Vh(D),J=0;J<G;++J)L=A[J],q=Ss(L,this),q=[q,this.__zoom.invert(q),L.identifier],ae.touch0?!ae.touch1&&ae.touch0[2]!==q[2]&&(ae.touch1=q,ae.taps=0):(ae.touch0=q,ee=!0,ae.taps=1+!!x);x&&(x=clearTimeout(x)),ee&&(ae.taps<2&&(y=q[0],x=setTimeout(function(){x=null},b)),fu(this),ae.start())}}function le(D,...F){if(this.__zooming){var A=B(this,F).event(D),G=D.changedTouches,ae=G.length,ee,J,L,q;for(Ho(D),ee=0;ee<ae;++ee)J=G[ee],L=Ss(J,this),A.touch0&&A.touch0[2]===J.identifier?A.touch0[0]=L:A.touch1&&A.touch1[2]===J.identifier&&(A.touch1[0]=L);if(J=A.that.__zoom,A.touch1){var re=A.touch0[0],ie=A.touch0[1],ge=A.touch1[0],xe=A.touch1[1],Ee=(Ee=ge[0]-re[0])*Ee+(Ee=ge[1]-re[1])*Ee,De=(De=xe[0]-ie[0])*De+(De=xe[1]-ie[1])*De;J=R(J,Math.sqrt(Ee/De)),L=[(re[0]+ge[0])/2,(re[1]+ge[1])/2],q=[(ie[0]+xe[0])/2,(ie[1]+xe[1])/2]}else if(A.touch0)L=A.touch0[0],q=A.touch0[1];else return;A.zoom("touch",a(k(J,L,q),A.extent,u))}}function ce(D,...F){if(this.__zooming){var A=B(this,F).event(D),G=D.changedTouches,ae=G.length,ee,J;for(Vh(D),v&&clearTimeout(v),v=setTimeout(function(){v=null},b),ee=0;ee<ae;++ee)J=G[ee],A.touch0&&A.touch0[2]===J.identifier?delete A.touch0:A.touch1&&A.touch1[2]===J.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(J=Ss(J,this),Math.hypot(y[0]-J[0],y[1]-J[1])<j)){var L=wa(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return E.wheelDelta=function(D){return arguments.length?(s=typeof D=="function"?D:tu(+D),E):s},E.filter=function(D){return arguments.length?(e=typeof D=="function"?D:tu(!!D),E):e},E.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:tu(!!D),E):i},E.extent=function(D){return arguments.length?(t=typeof D=="function"?D:tu([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),E):t},E.scaleExtent=function(D){return arguments.length?(l[0]=+D[0],l[1]=+D[1],E):[l[0],l[1]]},E.translateExtent=function(D){return arguments.length?(u[0][0]=+D[0][0],u[1][0]=+D[1][0],u[0][1]=+D[0][1],u[1][1]=+D[1][1],E):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},E.constrain=function(D){return arguments.length?(a=D,E):a},E.duration=function(D){return arguments.length?(f=+D,E):f},E.interpolate=function(D){return arguments.length?(m=D,E):m},E.on=function(){var D=h.on.apply(h,arguments);return D===h?E:D},E.clickDistance=function(D){return arguments.length?(N=(D=+D)*D,E):Math.sqrt(N)},E.tapDistance=function(D){return arguments.length?(j=+D,E):j},E}const l6=new Set(["CONTAINS","IMPLEMENTS","CORRESPONDS"]),c6=new Set(["REFERENCES","MENTIONS"]);function u6(e){return l6.has(e)?"skeleton":c6.has(e)?"weak":"standard"}const d6=30,nu=800,Bo=500;function f6({centerNode:e,neighbors:t}){const[a,s]=_.useState(t.length>d6?"table":"graph");return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-end gap-1 mb-3",children:[d.jsx("button",{onClick:()=>s("graph"),className:`p-1.5 rounded transition-colors ${a==="graph"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"力导向图",children:d.jsx(bC,{size:16})}),d.jsx("button",{onClick:()=>s("table"),className:`p-1.5 rounded transition-colors ${a==="table"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"表格模式",children:d.jsx(jC,{size:16})})]}),a==="graph"?d.jsx(h6,{centerNode:e,neighbors:t}):d.jsx(m6,{neighbors:t})]})}function h6({centerNode:e,neighbors:t}){const a=_.useRef(null),s=Lt(),{t:i}=ye(),l=_.useCallback(f=>s(aa.entity(f)),[s]),u=_.useCallback(f=>s(aa.relation(f)),[s]);return _.useEffect(()=>{const f=a.current;if(!f)return;const m=wa(f);m.selectAll("*").remove();const h=new Map;h.set(e.id,{id:e.id,name:e.name,type:e.type,kind:e.kind,isCenter:!0,x:nu/2,y:Bo/2});for(const k of t)h.has(k.neighbor.id)||h.set(k.neighbor.id,{id:k.neighbor.id,name:k.neighbor.name,type:k.neighbor.type,kind:k.neighbor.kind,isCenter:!1});const x=Array.from(h.values()),y=t.map(k=>{const O={id:k.id,type:k.type,edgeClass:u6(k.type),source:k.direction==="outgoing"?e.id:k.neighbor.id,target:k.direction==="outgoing"?k.neighbor.id:e.id};return k.confidence!==void 0&&(O.confidence=k.confidence),O});m.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 6").attr("refX",28).attr("refY",3).attr("markerWidth",10).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M0,0L10,3L0,6").attr("fill","var(--c4a-border-subtle)");const b=m.append("g"),w=o6().scaleExtent([.3,3]).on("zoom",k=>{b.attr("transform",k.transform)});m.call(w).call(w.transform,yp);const N=b.selectAll("line.link").data(y).join("line").attr("class","link").attr("stroke",k=>k.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",k=>k.edgeClass==="skeleton"?2:1).attr("stroke-dasharray",k=>k.edgeClass==="weak"?"4 3":null).attr("opacity",k=>k.edgeClass==="weak"?.6:1).attr("marker-end","url(#arrow)").style("cursor","pointer").on("click",(k,O)=>u(O.id)).on("mouseenter",function(){wa(this).attr("stroke","var(--c4a-accent)").attr("stroke-width",function(){return Number(wa(this).attr("stroke-width"))+1})}).on("mouseleave",function(k,O){wa(this).attr("stroke",O.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",O.edgeClass==="skeleton"?2:1)});N.append("title").text(k=>{const O=vl(k.confidence);return O?`${k.type} · ${i(O.labelKey)}`:k.type});const j=b.selectAll("text.link-label").data(y).join("text").attr("class","link-label").text(k=>k.type).attr("font-family","var(--font-mono)").attr("font-size",9).attr("fill","var(--c4a-text-muted)").attr("text-anchor","middle").attr("dy",-4),E=b.selectAll("g.node").data(x,k=>k.id).join("g").attr("class","node").style("cursor","pointer").on("click",(k,O)=>l(O.id));E.append("circle").attr("r",k=>k.isCenter?24:18).attr("fill",k=>k.isCenter?"var(--c4a-accent)":"var(--c4a-bg-elevated)").attr("stroke",k=>k.isCenter?"#fff":"var(--c4a-border-default)").attr("stroke-width",k=>k.isCenter?2:1),E.append("text").text(k=>k.name.length>12?k.name.slice(0,12)+"…":k.name).attr("font-family","var(--font-mono)").attr("font-size",10).attr("fill","var(--c4a-text-primary)").attr("text-anchor","middle").attr("dy",k=>k.isCenter?36:30),E.append("title").text(k=>{let O=`${k.name}
192
+ type: ${k.type}`;return k.kind&&(O+=`
193
+ kind: ${k.kind}`),O});const R=HD(x).force("link",ND(y).id(k=>k.id).distance(120)).force("charge",BD().strength(-300)).force("center",aD(nu/2,Bo/2)).force("collide",SD(30)).on("tick",()=>{N.attr("x1",k=>k.source.x??0).attr("y1",k=>k.source.y??0).attr("x2",k=>k.target.x??0).attr("y2",k=>k.target.y??0),j.attr("x",k=>{const O=k.source.x??0,I=k.target.x??0;return(O+I)/2}).attr("y",k=>{const O=k.source.y??0,I=k.target.y??0;return(O+I)/2}),E.attr("transform",k=>`translate(${k.x??0},${k.y??0})`)});return E.each(function(k,O){const I=wa(this);let B=!1;I.on("mousedown.drag",H=>{H.stopPropagation(),B=!0;const T=x[O],P=f.getBoundingClientRect(),X=le=>{if(!B)return;const ce=b.attr("transform");let D=0,F=0,A=1;if(ce){const ee=ce.match(/translate\(([-\d.e+]+)[, ]([-\d.e+]+)\)\s*scale\(([-\d.e+]+)\)/);ee&&(D=parseFloat(ee[1]),F=parseFloat(ee[2]),A=parseFloat(ee[3]))}const G=(le.clientX-P.left)/P.width*nu,ae=(le.clientY-P.top)/P.height*Bo;T.fx=(G-D)/A,T.fy=(ae-F)/A,R.alpha(.3).restart()},de=()=>{B=!1,T.fx=null,T.fy=null,document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",de)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",de)})}),()=>{R.stop()}},[e,t,l,u]),d.jsx("svg",{ref:a,width:"100%",height:Bo,viewBox:`0 0 ${nu} ${Bo}`,className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface"})}function m6({neighbors:e}){const t=Lt();return d.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:d.jsxs("table",{className:"w-full text-xs font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted text-left",children:[d.jsx("th",{className:"px-3 py-2",children:"NAME"}),d.jsx("th",{className:"px-3 py-2",children:"TYPE"}),d.jsx("th",{className:"px-3 py-2",children:"KIND"}),d.jsx("th",{className:"px-3 py-2",children:"EDGE"}),d.jsx("th",{className:"px-3 py-2",children:"DIRECTION"})]})}),d.jsx("tbody",{children:e.map(a=>d.jsxs("tr",{className:"border-b border-c4a-border-subtle hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>t(aa.entity(a.neighbor.id)),children:[d.jsx("td",{className:"px-3 py-2 text-c4a-accent",children:a.neighbor.name}),d.jsx("td",{className:"px-3 py-2 text-c4a-text-secondary",children:a.neighbor.type}),d.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:a.neighbor.kind??"—"}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(Vt,{variant:"accent",children:a.type})}),d.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:a.direction==="outgoing"?"→":"←"})]},a.id))})]})})}function p6({entityId:e,centerNode:t}){const{t:a}=ye(),[s,i]=_.useState([]),[l,u]=_.useState(!1);return _.useEffect(()=>{ze.get(`/entities/${e}/neighbors`).then(f=>{const m=[];for(const h of f.neighbors)for(const x of h.via)m.push({id:x.relation_id,type:x.type,direction:x.direction,neighbor:{id:h.id,name:h.name,type:h.type,...h.kind?{kind:h.kind}:{}},...x.weight!==void 0?{weight:x.weight}:{},...x.confidence!==void 0?{confidence:x.confidence}:{}});i(m),u(!0)}).catch(()=>u(!0))},[e]),l?s.length===0?d.jsx(Cn,{title:a("common.empty.entity_neighbors.title"),description:a("common.empty.entity_neighbors.description")}):d.jsx(f6,{centerNode:t,neighbors:s}):d.jsx("p",{className:"text-sm text-c4a-text-muted",children:a("common.loading")})}const g6={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function x6({entityId:e}){const{t}=ye(),[a,s]=_.useState(null),[i,l]=_.useState(null),[u,f]=_.useState("overview");if(_.useEffect(()=>{e&&(l(null),s(null),f("overview"),ze.get(`/entities/${e}`).then(s).catch(N=>{N instanceof Ln&&N.status===404?l("not_found"):l("load_failed")}))},[e]),i)return d.jsx(Cn,{title:t(`common.error.${i}`),description:t(`common.error.${i}_description`)});if(!a)return d.jsx("div",{className:"flex items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const m=g6[a.type]??"🔹",h=a._links,x=h?.relations?.count,y=h?.contents?.count,v=h?.referrers?.count,{atoms:b,...w}=a.data;return d.jsxs("div",{className:"flex flex-1 flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xl",children:m}),d.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:a.name})]}),d.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[d.jsx(Vt,{children:a.type}),a.kind&&d.jsx(Vt,{variant:"muted",children:a.kind})]}),(a.perspective||a.scope)&&d.jsxs("div",{className:"mt-1 flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[a.perspective&&d.jsxs("span",{children:[t("entity.detail.perspective"),":"," ",d.jsx("span",{className:"text-c4a-text-secondary",children:a.perspective})]}),a.scope&&d.jsxs("span",{children:[t("entity.detail.scope"),":"," ",d.jsx("span",{className:"text-c4a-text-secondary",children:a.scope})]})]}),d.jsxs(Km,{value:u,onChange:N=>f(N),children:[d.jsx("div",{className:"mt-3",children:d.jsxs(Xm,{children:[d.jsx(Va,{value:"overview",children:t("entity.detail.tab.overview")}),d.jsxs(Va,{value:"relations",children:[t("entity.detail.tab.relations"),x!==void 0&&` (${x})`]}),d.jsxs(Va,{value:"contents",children:[t("entity.detail.tab.contents"),y!==void 0&&` (${y})`]}),d.jsxs(Va,{value:"referrers",children:[t("entity.detail.tab.referrers"),v!==void 0&&` (${v})`]}),d.jsx(Va,{value:"neighbors",children:t("entity.detail.tab.neighbors")})]})}),d.jsxs("div",{className:"mt-4 flex-1",children:[d.jsx(Sa,{value:"overview",children:d.jsx($3,{data:w,atoms:b})}),d.jsx(Sa,{value:"relations",children:d.jsx(W3,{entityId:a.id})}),d.jsx(Sa,{value:"contents",children:d.jsx(tD,{entityId:a.id})}),d.jsx(Sa,{value:"referrers",children:d.jsx(nD,{entityId:a.id})}),d.jsx(Sa,{value:"neighbors",children:d.jsx(p6,{entityId:a.id,centerNode:{id:a.id,name:a.name,type:a.type,...a.kind?{kind:a.kind}:{}}})})]})]})]})}const IS={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function y6(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function v6({relationId:e}){const{t}=ye(),a=Lt(),s=$i(),[i,l]=_.useState(null),[u,f]=_.useState(null),[m,h]=_.useState([]),[x,y]=_.useState(!1);_.useEffect(()=>{e&&(f(null),l(null),h([]),y(!1),ze.get(`/relations/${e}`).then(N=>{l(N),ze.get(`/relations/${e}/contents`).then(j=>{h(j.contents??[]),y(!0)}).catch(()=>y(!0))}).catch(N=>{N instanceof Ln&&N.status===404?f("not_found"):f("load_failed")}))},[e]);const v=N=>{const j=IS[N.type]??"🔹";s?.active?s.navigate("entity",N.id,N.name,j):a(aa.entity(N.id))};if(u)return d.jsx(Cn,{title:t(`common.error.${u}`),description:t(`common.error.${u}_description`)});if(!i)return d.jsx("div",{className:"flex items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const b=vl(i.confidence),w=i.metadata?._source==="field_sync"?t("relation.detail.source_field_sync"):t("relation.detail.source_explicit");return d.jsxs("div",{className:"flex flex-1 flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:i.type}),b&&d.jsx(Vt,{variant:b.variant,tooltip:`confidence: ${b.value}`,children:t(b.labelKey)})]}),d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-4",children:[d.jsx(qb,{label:t("relation.detail.from"),entity:i.from,onClick:()=>v(i.from)}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-c4a-text-muted text-lg",children:"→"}),d.jsx(Vt,{variant:"accent",children:i.type}),d.jsx("span",{className:"text-c4a-text-muted text-lg",children:"→"})]}),d.jsx(qb,{label:t("relation.detail.to"),entity:i.to,onClick:()=>v(i.to)})]}),!!i.data.description&&d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.description")}),d.jsx("p",{className:"text-sm text-c4a-text-secondary",children:String(i.data.description)})]}),Object.keys(i.data).filter(N=>N!=="description").length>0&&d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.data")}),d.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3",children:d.jsx(Oi,{data:Object.fromEntries(Object.entries(i.data).filter(([N])=>N!=="description")),defaultExpanded:2})})]}),x&&m.length>0&&d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.source_refs")}),d.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:m.map(N=>d.jsx(pS,{content:{hash_id:N.hash_id,...N.source_path?{source_path:N.source_path}:{},...N.span?{span:N.span}:{}}},N.hash_id))})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.meta")}),d.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[d.jsxs("span",{className:"text-c4a-text-muted",children:[t("relation.detail.source_label"),":",d.jsx("span",{className:"text-c4a-text-secondary ml-1",children:w})]}),i.metadata?.created_at&&d.jsxs("span",{className:"text-c4a-text-muted",children:[t("content.detail.created_at"),":",d.jsx("span",{className:"text-c4a-text-secondary ml-1",children:y6(String(i.metadata.created_at))})]})]})]})]})}function qb({label:e,entity:t,onClick:a}){const s=IS[t.type]??"🔹";return d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors min-w-[160px]",onClick:a,children:[d.jsx("p",{className:"text-[10px] font-mono uppercase text-c4a-text-muted mb-1",children:e}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{children:s}),d.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:t.name})]}),d.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[d.jsx(Vt,{children:t.type}),t.kind&&d.jsx(Vt,{variant:"muted",children:t.kind})]})]})}function b6({anchor:e,children:t}){const{t:a}=ye(),s=Vo(w=>w.tabs),i=Vo(w=>w.activeTabId),l=Vo(w=>w.mode),{reset:u,setAnchor:f,activateTab:m,closeTab:h,closeAll:x,toggleMode:y}=Vo.getState();_.useEffect(()=>(u(),f({id:`${e.type}:${e.resourceId}`,type:e.type,resourceId:e.resourceId,label:e.label,...e.icon!=null&&{icon:e.icon}}),()=>u()),[e.id]);const v=s.find(w=>w.id===i),b=s.length>1;return d.jsx(pT,{children:d.jsxs("div",{className:"flex flex-1 flex-col",children:[d.jsx("div",{className:"flex flex-1 flex-col",children:!v||v.isAnchor?t:d.jsx(_6,{tab:v})}),b&&d.jsxs("div",{className:"flex h-5 items-center border-t border-c4a-border-subtle bg-c4a-bg-surface",children:[d.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.map(w=>{const N=w.id===i;return d.jsxs("div",{className:`flex min-w-0 shrink items-center gap-1 px-2 h-5 font-mono text-[10px] uppercase tracking-tight truncate cursor-pointer border-r border-c4a-border-subtle ${N?"bg-c4a-bg-base text-c4a-text-primary border-b border-b-c4a-accent":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:()=>m(w.id),children:[w.icon&&d.jsx("span",{className:"shrink-0 text-[10px]",children:w.icon}),d.jsx("span",{className:"truncate",children:w.label}),!w.isAnchor&&d.jsx("button",{type:"button",className:"ml-0.5 shrink-0 text-c4a-text-muted hover:text-c4a-text-primary",onClick:j=>{j.stopPropagation(),h(w.id)},children:d.jsx(br,{className:"h-2 w-2"})})]},w.id)})}),d.jsxs("div",{className:"flex items-center gap-0.5 px-1 shrink-0",children:[d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-c4a-text-muted hover:text-c4a-text-primary hover:bg-c4a-bg-hover cursor-pointer",title:a(l==="append"?"explorer.mode.append_tooltip":"explorer.mode.replace_tooltip"),onClick:y,children:d.jsx("span",{className:"text-[10px]",children:l==="append"?"📑":"📌"})}),d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-c4a-text-muted hover:text-c4a-text-primary hover:bg-c4a-bg-hover cursor-pointer",title:a("explorer.close_all"),onClick:x,children:d.jsx(br,{className:"h-2.5 w-2.5"})})]})]})]})})}function _6({tab:e}){switch(e.type){case"content":return d.jsx(mS,{hashId:e.resourceId,sourcePath:e.label});case"entity":return d.jsx(x6,{entityId:e.resourceId});case"relation":return d.jsx(v6,{relationId:e.resourceId});default:return null}}function Fb(e){if(!e)return"";try{const t=new Date(e),a=new Date,s=t.getFullYear()===a.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0"),u=String(t.getHours()).padStart(2,"0"),f=String(t.getMinutes()).padStart(2,"0");return s?`${i}-${l} ${u}:${f}`:`${t.getFullYear()}-${i}-${l} ${u}:${f}`}catch{return""}}function S6({versions:e,currentHashId:t,onChange:a}){const[s,i]=_.useState(!1),l=_.useRef(null),u=_.useRef(null),f=_.useCallback(v=>{l.current&&!l.current.contains(v.target)&&i(!1)},[]);_.useEffect(()=>{if(s)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[s,f]);const m=_.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),e.length>1&&i(!0)},[e.length]),h=_.useCallback(()=>{u.current=setTimeout(()=>i(!1),150)},[]),x=e.find(v=>v.hash_id===t)??e[0],y=Fb(x?.created_at);return d.jsxs("div",{ref:l,className:"relative",onMouseEnter:m,onMouseLeave:h,children:[d.jsxs("button",{type:"button",onClick:e.length>1?()=>i(v=>!v):void 0,className:`flex h-7 items-center gap-1.5 rounded-sm border border-c4a-border-default px-2 font-mono text-[10px] text-c4a-text-secondary transition-colors ${e.length>1?"cursor-pointer hover:border-c4a-border-strong hover:bg-c4a-bg-hover hover:text-c4a-text-primary":""}`,children:[d.jsxs("span",{children:[d.jsx("span",{className:"font-extrabold",children:x?.version_label}),y?` ${y}`:""]}),e.length>1&&d.jsx(rn,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${s?"rotate-90":""}`})]}),s&&d.jsx("div",{className:"absolute right-0 top-full z-10 mt-1 min-w-full rounded-sm border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md max-h-40 overflow-y-auto c4a-scrollbar",children:e.map(v=>{const b=v.hash_id===t,w=Fb(v.created_at);return d.jsx("div",{className:`flex cursor-pointer items-center px-2 py-1 font-mono text-[10px] transition-colors hover:bg-c4a-bg-hover ${b?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,onClick:()=>{a(v.hash_id),i(!1)},children:d.jsxs("span",{children:[d.jsx("span",{className:"font-extrabold",children:v.version_label}),w?` ${w}`:""]})},v.hash_id)})})]})}const w6={none:"bg-c4a-bg-hover text-c4a-text-muted",indexed:"bg-c4a-success/10 text-c4a-success",stale:"bg-c4a-warning/10 text-c4a-warning"};function N6({sourceId:e,sourcePath:t,status:a,loading:s,onIndexed:i}){const{t:l}=ye(),[u,f]=_.useState(!1),[m,h]=_.useState(null),[x,y]=_.useState(null),v=_.useCallback(async()=>{f(!0),h(null);try{const N=await ze.post(`/sources/${e}/index`,{paths:[t]});if(N.errors&&N.errors.length>0){const j=N.errors[0];if(j.error==="unsupported_type"){const E=t.slice(t.lastIndexOf("."));h(l("cas.unsupported_type",{ext:E}))}else h(j.error)}else{if(N.indexed?.every(E=>E.status==="exists"))y(l("cas.index_no_change"));else{const E=N.indexed?.filter(R=>R.status==="created").length??0;y(l("cas.index_success",{count:E})),i()}setTimeout(()=>y(null),3e3)}}catch{h(l("cas.index_failed"))}finally{f(!1)}},[e,t,l,i]),b=l(a==="indexed"?"sources.status.indexed":a==="stale"?"sources.status.stale":"sources.status.none"),w=l(a==="none"?"sources.status.go_index":"cas.reindex");return s?null:d.jsxs(d.Fragment,{children:[u?d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",children:[d.jsx(fn,{size:10,className:"animate-spin"}),l("cas.indexing")]}):d.jsxs("span",{className:`group/idx relative inline-block cursor-pointer rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${w6[a]} hover:bg-c4a-accent hover:text-white`,onClick:v,children:[d.jsx("span",{className:"group-hover/idx:hidden",children:b}),d.jsx("span",{className:"hidden group-hover/idx:inline",children:w})]}),m&&d.jsx("span",{className:"font-mono text-[10px] text-c4a-error",children:m}),x&&d.jsx("span",{className:"font-mono text-[10px] text-c4a-success",children:x})]})}function j6(){const{t:e}=ye(),{sourceUuid:t}=xl(),[a]=$u(),s=a.get("path")||"",i=Lt(),{currentRoot:l,loading:u,error:f,fetchRootSource:m}=Iu(),h=Wt(Ds(Ui)),[x,y]=_.useState("original"),[v,b]=_.useState(null),[w,N]=_.useState([]),[j,E]=_.useState(!1),[R,k]=_.useState("");_.useEffect(()=>{t&&m(t).catch(()=>{})},[t,m]);const O=_.useMemo(()=>l?s?Bu(l.tree,s):l.kind==="source"?{path:"",kind:l.kind,source_type:l.source_type,name:l.name,metadata:l.metadata,index_status:l.index_status}:null:null,[l,s]),I=h.find(ee=>ee.id===l?.library_id),B=l?.id,H=l?.kind==="source"&&!s,T=_.useCallback(async()=>{if(!B||!O)return;const ee=H?"":s||O.path;if(ee!==void 0){E(!0),b(null),N([]);try{const J=await ze.get(`/sources/${B}/files`,{path:ee});b(J.hash_id),k(J.hash_id);try{const L=await ze.get(`/sources/${B}/files/versions`,{path:ee});N(L.versions??[])}catch{N([{version:J.version,version_label:J.version_label,hash_id:J.hash_id,created_at:J.created_at??null}])}}catch(J){J instanceof Ln&&J.status===404&&(b(null),N([]))}finally{E(!1)}}},[B,O,s,H]);_.useEffect(()=>{T()},[T]);const P=O?.metadata,X=P?Object.fromEntries(Object.entries(P).map(([ee,J])=>[ee,String(J??"")])):null,de=O?.source_type==="code",le=O?.name??l?.name??"",ce=O?.source_type??null,D=_.useMemo(()=>{if(!l||!I)return[];const ee=l.kind==="source"&&!s,J=[{label:I.is_default?e("sources.library.default_cloud_name"):I.name,to:`/studio/sources/${I.id}`},{label:l.name,...ee?{}:{to:`/studio/sources/${I.id}?rootId=${l.id}`}}];if(s){const L=Go(l.tree,s);for(let q=0;q<L.length-1;q++){const re=L[q];J.push({label:re.name,to:`/studio/sources/${I.id}?rootId=${l.id}&path=${encodeURIComponent(re.path)}`})}L.length>0&&J.push({label:L[L.length-1].name})}return J},[l,I,s,e]),F=[{key:"original",label:e(de?"sources.detail.tab.overview":"sources.detail.tab.original")},{key:"digest",label:e("sources.detail.tab.digest")},{key:"modeling",label:e("sources.detail.tab.modeling")}];if(!u&&f)return d.jsx("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:d.jsx(Cn,{fullPage:!0,title:e("sources.detail.not_found_title"),description:e("sources.detail.not_found_desc"),action:d.jsx("button",{className:"rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90",onClick:()=>i("/studio/sources"),children:e("common.back")})})});if(u||!l||!O)return d.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[d.jsx(As,{segments:[]}),d.jsxs("div",{className:"mt-3 mb-3 flex items-center gap-2",children:[d.jsx("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded bg-c4a-bg-hover"}),d.jsx("div",{className:"h-6 w-56 animate-pulse rounded bg-c4a-bg-hover"})]}),d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(fn,{size:24,className:"animate-spin text-c4a-text-muted"})})]});const A=v!==null&&!j,G=j?"none":v!==null?O?.index_status==="stale"?"stale":"indexed":"none",ae=H?O?.name??"":s||O?.path||O?.name||"";return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto c4a-scrollbar p-4 pb-8 md:p-6 md:pb-10",children:[d.jsx(As,{segments:D}),d.jsxs("div",{className:"mt-3 mb-3 flex items-end gap-3",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[de?d.jsx(Ei,{size:20,className:"shrink-0 text-c4a-accent"}):d.jsx(Wr,{size:20,className:"shrink-0 text-c4a-accent"}),d.jsx("h1",{className:"mb-[0.125rem] min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:le})]}),B&&d.jsx(N6,{sourceId:B,sourcePath:ae,status:G,loading:j,onIndexed:T}),d.jsxs("span",{className:"group relative cursor-default",children:[d.jsx(Vt,{variant:"muted",children:e(ce==="code"?"sources.type.code":"sources.type.doc")}),d.jsx("div",{className:"pointer-events-none absolute left-0 top-full z-10 mt-1.5 hidden w-max rounded border border-c4a-border-default bg-c4a-bg-elevated px-3 py-2 shadow-c4a-md group-hover:block",children:d.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[10px]",children:[d.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.origin")}),d.jsxs("dd",{className:"text-c4a-text-secondary",children:[I?.is_default?e("sources.library.default_cloud_name"):I?.name," / ",l?.name]}),d.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.type")}),d.jsx("dd",{className:"text-c4a-text-secondary uppercase",children:le.includes(".")?le.slice(le.lastIndexOf(".")+1):ce??"—"})]})})]}),d.jsx("div",{className:"flex-1"}),A&&w.length>0&&d.jsx("div",{className:"self-center",children:d.jsx(S6,{versions:w,currentHashId:R,onChange:k})})]}),de&&X&&d.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:d.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[X.repo_name&&d.jsx(au,{label:e("sources.detail.repo"),value:X.repo_name}),X.pinned_branch&&d.jsx(au,{label:e("sources.detail.branch"),value:X.pinned_branch}),X.pinned_hash&&d.jsx(au,{label:e("sources.detail.commit"),value:X.pinned_hash.slice(0,7)}),X.tech_stack&&d.jsx(au,{label:e("sources.detail.tech_stack"),value:X.tech_stack})]})}),A&&R?d.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:d.jsx(b6,{anchor:{id:`content:${R}`,type:"content",resourceId:R,label:le,icon:de?"📦":"📄"},children:d.jsx(mS,{hashId:R,sourcePath:ae})})}):d.jsxs(Km,{value:x,onChange:ee=>y(ee),children:[d.jsx("div",{className:"mt-3",children:d.jsx(Xm,{children:F.map(ee=>d.jsx(Va,{value:ee.key,children:ee.label},ee.key))})}),d.jsxs("div",{className:"mt-4 flex flex-1 flex-col",children:[d.jsx(Sa,{value:"original",children:d.jsx(E6,{node:O,isCode:de})}),d.jsx(Sa,{value:"digest",children:d.jsx(Yb,{message:e("sources.detail.digest_placeholder")})}),d.jsx(Sa,{value:"modeling",children:d.jsx(Yb,{message:e("sources.detail.modeling_placeholder")})})]})]})]})}function au({label:e,value:t}){return d.jsxs("div",{children:[d.jsx("span",{className:"text-c4a-text-muted",children:e}),d.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:t})]})}function E6({node:e,isCode:t}){const{t:a}=ye(),s=e.metadata;return t?d.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!s?.description&&d.jsx("p",{children:String(s.description)}),!!s?.dependencies&&d.jsxs("div",{children:[d.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:a("sources.detail.dependencies")}),d.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(s.dependencies).map(([i,l])=>d.jsxs("div",{className:"flex justify-between py-0.5",children:[d.jsx("span",{className:"text-c4a-text-primary",children:i}),d.jsx("span",{className:"text-c4a-text-muted",children:l})]},i))})]}),!s?.description&&!s?.dependencies&&d.jsx("p",{className:"text-c4a-text-muted",children:a("sources.detail.original_code_placeholder")})]}):d.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:d.jsx("p",{className:"text-c4a-text-muted",children:a("sources.detail.original_doc_placeholder")})})}function Yb({message:e}){return d.jsx("div",{className:"flex flex-1 items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:d.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:e})})}const C6=_.lazy(()=>ne(()=>import("./ContentDetail-BtrIxG3F.js"),[]).then(e=>({default:e.ContentDetail}))),k6=_.lazy(()=>ne(()=>import("./EntityDetail-CHe5PkO9.js"),[]).then(e=>({default:e.EntityDetail}))),R6=_.lazy(()=>ne(()=>import("./RelationDetail-CkBj9cCj.js"),[]).then(e=>({default:e.RelationDetail}))),T6=NE([{element:d.jsx(Ok,{}),errorElement:d.jsx(Ev,{}),children:[{path:"/",element:d.jsx(Pk,{})},{path:"/login",element:d.jsx(qk,{})},{path:"/auth/callback",element:d.jsx(Yk,{})},{path:"/docs",element:d.jsx(Kk,{})}]},{path:"/studio",element:d.jsx(Ik,{}),errorElement:d.jsx(Ev,{}),children:[{index:!0,element:d.jsx(Jj,{to:"/studio/sources",replace:!0})},{path:"sources",element:d.jsx($R,{})},{path:"sources/add-client",element:d.jsx(fT,{})},{path:"sources/import/:libId",element:d.jsx(eT,{})},{path:"sources/import-dir/:libId",element:d.jsx(sT,{})},{path:"sources/import-remote/:libId",element:d.jsx(dT,{})},{path:"sources/:libId",element:d.jsx(UR,{})},{path:"source/:sourceUuid",element:d.jsx(j6,{})},{path:"contents/:hashId",element:d.jsx(_.Suspense,{fallback:null,children:d.jsx(C6,{})})},{path:"entities/:entityId",element:d.jsx(_.Suspense,{fallback:null,children:d.jsx(k6,{})})},{path:"relations/:relationId",element:d.jsx(_.Suspense,{fallback:null,children:d.jsx(R6,{})})},{path:"modeling",element:d.jsx(Qk,{})},{path:"modeling/code/setup",element:d.jsx(iR,{})},{path:"modeling/code/compile",element:d.jsx(oR,{})},{path:"modeling/code/review",element:d.jsx(lR,{})},{path:"modeling/code/result",element:d.jsx(cR,{})},{path:"brain",element:d.jsx(Zk,{})},{path:"discovery",element:d.jsx(Jk,{})},{path:"sharing",element:d.jsx(Wk,{})},{path:"collaboration",element:d.jsx(eR,{})},{path:"settings/api-keys",element:d.jsx(tR,{})}]},{path:"*",element:d.jsx(Xk,{})}]);function A6(){return _.useEffect(()=>{qn.getState().init(),nl.getState().init();const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return Da.connect(t),()=>{Da.disconnect()}},[]),d.jsx(Xj,{router:T6})}u2.createRoot(document.getElementById("root")).render(d.jsx(_.StrictMode,{children:d.jsx(A6,{})}));export{mS as C,x6 as E,v6 as R,ye as a,xl as b,Oe as c,d as j,Lt as u};