@c4a/server-cli 0.4.15-alpha.4 → 0.4.15-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/index.js +965 -90
- package/package.json +1 -1
- package/serve.js +2027 -221
- package/web/assets/ContentDetail--oZBzWh0.js +1 -0
- package/web/assets/ContentDetail-B5s8bbFo.js +1 -0
- package/web/assets/ContentDetail-C0zfArPg.js +1 -0
- package/web/assets/ContentDetail-C3kXsx-i.js +1 -0
- package/web/assets/ContentDetail-CcLGF_Yi.js +1 -0
- package/web/assets/ContentDetail-D-2xyerw.js +1 -0
- package/web/assets/ContentDetail-DlQ8URkx.js +1 -0
- package/web/assets/ContentDetail-TPc0m0eM.js +1 -0
- package/web/assets/ContentDetail-y0yi2qln.js +1 -0
- package/web/assets/EntityDetail-3CFtMmgQ.js +1 -0
- package/web/assets/EntityDetail-BI3etmj4.js +1 -0
- package/web/assets/EntityDetail-C9k4cMVL.js +1 -0
- package/web/assets/EntityDetail-CoFb-qZW.js +1 -0
- package/web/assets/EntityDetail-D_WP7tD4.js +1 -0
- package/web/assets/EntityDetail-DiJPemDY.js +1 -0
- package/web/assets/EntityDetail-DihnDvhA.js +1 -0
- package/web/assets/EntityDetail-DyDH4GAw.js +1 -0
- package/web/assets/EntityDetail-dIZiNN2t.js +1 -0
- package/web/assets/RelationDetail-B2gHrceI.js +1 -0
- package/web/assets/RelationDetail-BK8C5waL.js +1 -0
- package/web/assets/RelationDetail-CEq9vopD.js +1 -0
- package/web/assets/RelationDetail-CaYrspaS.js +1 -0
- package/web/assets/RelationDetail-CpoGdy25.js +1 -0
- package/web/assets/RelationDetail-DU9ECyHi.js +1 -0
- package/web/assets/RelationDetail-Dz7HAlU5.js +1 -0
- package/web/assets/RelationDetail-Wh3IgNaF.js +1 -0
- package/web/assets/RelationDetail-zZ_ZfkYX.js +1 -0
- package/web/assets/index-BKETuM1m.js +111 -0
- package/web/assets/index-BPMqeFze.js +111 -0
- package/web/assets/index-BgRuvBL5.js +111 -0
- package/web/assets/index-C96WspeJ.css +1 -0
- package/web/assets/index-CcrkBEZl.js +111 -0
- package/web/assets/index-DGDx8sCs.js +111 -0
- package/web/assets/index-DIyAwnqE.js +111 -0
- package/web/assets/index-DW1cCA8v.js +111 -0
- package/web/assets/index-DiAYi5t8.css +1 -0
- package/web/assets/index-FOCWvgW_.css +1 -0
- package/web/assets/index-daOjyLzy.css +1 -0
- package/web/assets/index-moF8uSEi.js +111 -0
- package/web/assets/index-sPNyENFN.js +111 -0
- package/web/assets/index-uGqDxUnx.css +1 -0
- package/web/index.html +2 -2
|
@@ -0,0 +1,111 @@
|
|
|
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 Gj(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(a,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>a[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();function M_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ep={exports:{}},$i={};var Tb;function Vj(){if(Tb)return $i;Tb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:l}}return $i.Fragment=t,$i.jsx=r,$i.jsxs=r,$i}var Ab;function Yj(){return Ab||(Ab=1,Ep.exports=Vj()),Ep.exports}var c=Yj();const Ke=e=>typeof e=="string",Bi=()=>{let e,t;const r=new Promise((a,o)=>{e=a,t=o});return r.resolve=e,r.reject=t,r},Lb=e=>e==null?"":""+e,Kj=(e,t,r)=>{e.forEach(a=>{t[a]&&(r[a]=t[a])})},Xj=/###/g,Db=e=>e&&e.indexOf("###")>-1?e.replace(Xj,"."):e,Ob=e=>!e||Ke(e),il=(e,t,r)=>{const a=Ke(t)?t.split("."):t;let o=0;for(;o<a.length-1;){if(Ob(e))return{};const l=Db(a[o]);!e[l]&&r&&(e[l]=new r),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++o}return Ob(e)?{}:{obj:e,k:Db(a[o])}},Mb=(e,t,r)=>{const{obj:a,k:o}=il(e,t,Object);if(a!==void 0||t.length===1){a[o]=r;return}let l=t[t.length-1],u=t.slice(0,t.length-1),f=il(e,u,Object);for(;f.obj===void 0&&u.length;)l=`${u[u.length-1]}.${l}`,u=u.slice(0,u.length-1),f=il(e,u,Object),f?.obj&&typeof f.obj[`${f.k}.${l}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${l}`]=r},Qj=(e,t,r,a)=>{const{obj:o,k:l}=il(e,t,Object);o[l]=o[l]||[],o[l].push(r)},Du=(e,t)=>{const{obj:r,k:a}=il(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,a))return r[a]},Zj=(e,t,r)=>{const a=Du(e,r);return a!==void 0?a:Du(t,r)},z_=(e,t,r)=>{for(const a in t)a!=="__proto__"&&a!=="constructor"&&(a in e?Ke(e[a])||e[a]instanceof String||Ke(t[a])||t[a]instanceof String?r&&(e[a]=t[a]):z_(e[a],t[a],r):e[a]=t[a]);return e},Ts=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Jj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Wj=e=>Ke(e)?e.replace(/[&<>"'\/]/g,t=>Jj[t]):e;class e2{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const a=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,a),this.regExpQueue.push(t),a}}const t2=[" ",",","?","!",";"],n2=new e2(20),r2=(e,t,r)=>{t=t||"",r=r||"";const a=t2.filter(u=>t.indexOf(u)<0&&r.indexOf(u)<0);if(a.length===0)return!0;const o=n2.getRegExp(`(${a.map(u=>u==="?"?"\\?":u).join("|")})`);let l=!o.test(e);if(!l){const u=e.indexOf(r);u>0&&!o.test(e.substring(0,u))&&(l=!0)}return l},hh=(e,t,r=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const a=t.split(r);let o=e;for(let l=0;l<a.length;){if(!o||typeof o!="object")return;let u,f="";for(let h=l;h<a.length;++h)if(h!==l&&(f+=r),f+=a[h],u=o[f],u!==void 0){if(["string","number","boolean"].indexOf(typeof u)>-1&&h<a.length-1)continue;l+=h-l+1;break}o=u}return o},fl=e=>e?.replace("_","-"),a2={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 Ou{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||a2,this.options=r,this.debug=r.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,r,a,o){return o&&!this.debug?null:(Ke(t[0])&&(t[0]=`${a}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new Ou(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Ou(this.logger,t)}}var Kr=new Ou;class td{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const o=this.observers[a].get(r)||0;this.observers[a].set(r,o+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,l])=>{for(let u=0;u<l;u++)o(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,l])=>{for(let u=0;u<l;u++)o.apply(o,[t,...r])})}}class zb extends td{constructor(t,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=r,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 r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,a,o={}){const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;t.indexOf(".")>-1?f=t.split("."):(f=[t,r],a&&(Array.isArray(a)?f.push(...a):Ke(a)&&l?f.push(...a.split(l)):f.push(a)));const h=Du(this.data,f);return!h&&!r&&!a&&t.indexOf(".")>-1&&(t=f[0],r=f[1],a=f.slice(2).join(".")),h||!u||!Ke(a)?h:hh(this.data?.[t]?.[r],a,l)}addResource(t,r,a,o,l={silent:!1}){const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=[t,r];a&&(f=f.concat(u?a.split(u):a)),t.indexOf(".")>-1&&(f=t.split("."),o=r,r=f[1]),this.addNamespaces(r),Mb(this.data,f,o),l.silent||this.emit("added",t,r,a,o)}addResources(t,r,a,o={silent:!1}){for(const l in a)(Ke(a[l])||Array.isArray(a[l]))&&this.addResource(t,r,l,a[l],{silent:!0});o.silent||this.emit("added",t,r,a)}addResourceBundle(t,r,a,o,l,u={silent:!1,skipCopy:!1}){let f=[t,r];t.indexOf(".")>-1&&(f=t.split("."),o=a,a=r,r=f[1]),this.addNamespaces(r);let h=Du(this.data,f)||{};u.skipCopy||(a=JSON.parse(JSON.stringify(a))),o?z_(h,a,l):h={...h,...a},Mb(this.data,f,h),u.silent||this.emit("added",t,r,a)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var $_={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,a,o){return e.forEach(l=>{t=this.processors[l]?.process(t,r,a,o)??t}),t}};const B_=Symbol("i18next/PATH_KEY");function s2(){const e=[],t=Object.create(null);let r;return t.get=(a,o)=>(r?.revoke?.(),o===B_?e:(e.push(o),r=Proxy.revocable(a,t),r.proxy)),Proxy.revocable(Object.create(null),t).proxy}function mh(e,t){const{[B_]:r}=e(s2());return r.join(t?.keySeparator??".")}const $b={},Cp=e=>!Ke(e)&&typeof e!="boolean"&&typeof e!="number";class Mu extends td{constructor(t,r={}){super(),Kj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Kr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const a={...r};if(t==null)return!1;const o=this.resolve(t,a);if(o?.res===void 0)return!1;const l=Cp(o.res);return!(a.returnObjects===!1&&l)}extractFromKey(t,r){let a=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let l=r.ns||this.options.defaultNS||[];const u=a&&t.indexOf(a)>-1,f=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!r2(t,a,o);if(u&&!f){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:Ke(l)?[l]:l};const p=t.split(a);(a!==o||a===o&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),t=p.join(o)}return{key:t,namespaces:Ke(l)?[l]:l}}translate(t,r,a){let o=typeof r=="object"?{...r}:r;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=mh(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]);const l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:f,namespaces:h}=this.extractFromKey(t[t.length-1],o),p=h[h.length-1];let m=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const x=o.lng||this.language,v=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x?.toLowerCase()==="cimode")return v?l?{res:`${p}${m}${f}`,usedKey:f,exactUsedKey:f,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:`${p}${m}${f}`:l?{res:f,usedKey:f,exactUsedKey:f,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:f;const _=this.resolve(t,o);let w=_?.res;const S=_?.usedKey||f,k=_?.exactUsedKey||f,N=["[object Number]","[object Function]","[object RegExp]"],R=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,D=o.count!==void 0&&!Ke(o.count),L=Mu.hasDefaultValue(o),$=D?this.pluralResolver.getSuffix(x,o.count,o):"",z=o.ordinal&&D?this.pluralResolver.getSuffix(x,o.count,{ordinal:!1}):"",T=D&&!o.ordinal&&o.count===0,B=T&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${$}`]||o[`defaultValue${z}`]||o.defaultValue;let H=w;E&&!w&&L&&(H=B);const J=Cp(H),oe=Object.prototype.toString.apply(H);if(E&&H&&J&&N.indexOf(oe)<0&&!(Ke(R)&&Array.isArray(H))){if(!o.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(S,H,{...o,ns:h}):`key '${f} (${this.language})' returned an object instead of string.`;return l?(_.res=ce,_.usedParams=this.getUsedParamsDetails(o),_):ce}if(u){const ce=Array.isArray(H),M=ce?[]:{},P=ce?k:S;for(const A in H)if(Object.prototype.hasOwnProperty.call(H,A)){const F=`${P}${u}${A}`;L&&!w?M[A]=this.translate(F,{...o,defaultValue:Cp(B)?B[A]:void 0,joinArrays:!1,ns:h}):M[A]=this.translate(F,{...o,joinArrays:!1,ns:h}),M[A]===F&&(M[A]=H[A])}w=M}}else if(E&&Ke(R)&&Array.isArray(w))w=w.join(R),w&&(w=this.extendTranslation(w,t,o,a));else{let ce=!1,M=!1;!this.isValidLookup(w)&&L&&(ce=!0,w=B),this.isValidLookup(w)||(M=!0,w=f);const A=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&M?void 0:w,F=L&&B!==w&&this.options.updateMissing;if(M||ce||F){if(this.logger.log(F?"updateKey":"missingKey",x,p,f,F?B:w),u){const O=this.resolve(f,{...o,keySeparator:!1});O&&O.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 ee=[];const ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ae&&ae[0])for(let O=0;O<ae.length;O++)ee.push(ae[O]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(o.lng||this.language):ee.push(o.lng||this.language);const W=(O,V,re)=>{const se=L&&re!==w?re:A;this.options.missingKeyHandler?this.options.missingKeyHandler(O,p,V,se,F,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(O,p,V,se,F,o),this.emit("missingKey",O,p,V,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?ee.forEach(O=>{const V=this.pluralResolver.getSuffixes(O,o);T&&o[`defaultValue${this.options.pluralSeparator}zero`]&&V.indexOf(`${this.options.pluralSeparator}zero`)<0&&V.push(`${this.options.pluralSeparator}zero`),V.forEach(re=>{W([O],f+re,o[`defaultValue${re}`]||B)})}):W(ee,f,B))}w=this.extendTranslation(w,t,o,_,a),M&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${p}${m}${f}`),(M||ce)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${m}${f}`:f,ce?w:void 0,o))}return l?(_.res=w,_.usedParams=this.getUsedParamsDetails(o),_):w}extendTranslation(t,r,a,o,l){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const h=Ke(t)&&(a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(h){const x=t.match(this.interpolator.nestingRegexp);p=x&&x.length}let m=a.replace&&!Ke(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,a.lng||this.language||o.usedLng,a),h){const x=t.match(this.interpolator.nestingRegexp),v=x&&x.length;p<v&&(a.nest=!1)}!a.lng&&o&&o.res&&(a.lng=this.language||o.usedLng),a.nest!==!1&&(t=this.interpolator.nest(t,(...x)=>l?.[0]===x[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${r[0]}`),null):this.translate(...x,r),a)),a.interpolation&&this.interpolator.reset()}const u=a.postProcess||this.options.postProcess,f=Ke(u)?[u]:u;return t!=null&&f?.length&&a.applyPostProcessor!==!1&&(t=$_.handle(f,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),t}resolve(t,r={}){let a,o,l,u,f;return Ke(t)&&(t=[t]),t.forEach(h=>{if(this.isValidLookup(a))return;const p=this.extractFromKey(h,r),m=p.key;o=m;let x=p.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const v=r.count!==void 0&&!Ke(r.count),_=v&&!r.ordinal&&r.count===0,w=r.context!==void 0&&(Ke(r.context)||typeof r.context=="number")&&r.context!=="",S=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);x.forEach(k=>{this.isValidLookup(a)||(f=k,!$b[`${S[0]}-${k}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(f)&&($b[`${S[0]}-${k}`]=!0,this.logger.warn(`key "${o}" for languages "${S.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!!!")),S.forEach(N=>{if(this.isValidLookup(a))return;u=N;const R=[m];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(R,m,N,k,r);else{let D;v&&(D=this.pluralResolver.getSuffix(N,r.count,r));const L=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(r.ordinal&&D.indexOf($)===0&&R.push(m+D.replace($,this.options.pluralSeparator)),R.push(m+D),_&&R.push(m+L)),w){const z=`${m}${this.options.contextSeparator||"_"}${r.context}`;R.push(z),v&&(r.ordinal&&D.indexOf($)===0&&R.push(z+D.replace($,this.options.pluralSeparator)),R.push(z+D),_&&R.push(z+L))}}let E;for(;E=R.pop();)this.isValidLookup(a)||(l=E,a=this.getResource(N,k,E,r))}))})}),{res:a,usedKey:o,exactUsedKey:l,usedLng:u,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,a,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,r,a,o):this.resourceStore.getResource(t,r,a,o)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=t.replace&&!Ke(t.replace);let o=a?t.replace:t;if(a&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!a){o={...o};for(const l of r)delete o[l]}return o}static hasDefaultValue(t){const r="defaultValue";for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&r===a.substring(0,r.length)&&t[a]!==void 0)return!0;return!1}}class Bb{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kr.create("languageUtils")}getScriptPartFromCode(t){if(t=fl(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=fl(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(Ke(t)&&t.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(t)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(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 r;return t.forEach(a=>{if(r)return;const o=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&t.forEach(a=>{if(r)return;const o=this.getScriptPartFromCode(a);if(this.isSupportedCode(o))return r=o;const l=this.getLanguagePartFromCode(a);if(this.isSupportedCode(l))return r=l;r=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})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),Ke(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let a=t[r];return a||(a=t[this.getScriptPartFromCode(r)]),a||(a=t[this.formatLanguageCode(r)]),a||(a=t[this.getLanguagePartFromCode(r)]),a||(a=t.default),a||[]}toResolveHierarchy(t,r){const a=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),o=[],l=u=>{u&&(this.isSupportedCode(u)?o.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return Ke(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))):Ke(t)&&l(this.formatLanguageCode(t)),a.forEach(u=>{o.indexOf(u)<0&&l(this.formatLanguageCode(u))}),o}}const Ib={zero:0,one:1,two:2,few:3,many:4,other:5},Ub={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class o2{constructor(t,r={}){this.languageUtils=t,this.options=r,this.logger=Kr.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const a=fl(t==="dev"?"en":t),o=r.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:a,type:o});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let u;try{u=new Intl.PluralRules(a,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Ub;if(!t.match(/-|_/))return Ub;const h=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(h,r)}return this.pluralRulesCache[l]=u,u}needsPlural(t,r={}){let a=this.getRule(t,r);return a||(a=this.getRule("dev",r)),a?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,r,a={}){return this.getSuffixes(t,a).map(o=>`${r}${o}`)}getSuffixes(t,r={}){let a=this.getRule(t,r);return a||(a=this.getRule("dev",r)),a?a.resolvedOptions().pluralCategories.sort((o,l)=>Ib[o]-Ib[l]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,r,a={}){const o=this.getRule(t,a);return o?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,a))}}const Pb=(e,t,r,a=".",o=!0)=>{let l=Zj(e,t,r);return!l&&o&&Ke(r)&&(l=hh(e,r,a),l===void 0&&(l=hh(t,r,a))),l},Rp=e=>e.replace(/\$/g,"$$$$");class Hb{constructor(t={}){this.logger=Kr.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:a,useRawValueToEscape:o,prefix:l,prefixEscaped:u,suffix:f,suffixEscaped:h,formatSeparator:p,unescapeSuffix:m,unescapePrefix:x,nestingPrefix:v,nestingPrefixEscaped:_,nestingSuffix:w,nestingSuffixEscaped:S,nestingOptionsSeparator:k,maxReplaces:N,alwaysFormat:R}=t.interpolation;this.escape=r!==void 0?r:Wj,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=l?Ts(l):u||"{{",this.suffix=f?Ts(f):h||"}}",this.formatSeparator=p||",",this.unescapePrefix=m?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=v?Ts(v):_||Ts("$t("),this.nestingSuffix=w?Ts(w):S||Ts(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=N||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,a)=>r?.source===a?(r.lastIndex=0,r):new RegExp(a,"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,r,a,o){let l,u,f;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=_=>{if(_.indexOf(this.formatSeparator)<0){const N=Pb(r,h,_,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,a,{...o,...r,interpolationkey:_}):N}const w=_.split(this.formatSeparator),S=w.shift().trim(),k=w.join(this.formatSeparator).trim();return this.format(Pb(r,h,S,this.options.keySeparator,this.options.ignoreJSONStructure),k,a,{...o,...r,interpolationkey:S})};this.resetRegExp();const m=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,x=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:_=>Rp(_)},{regex:this.regexp,safeValue:_=>this.escapeValue?Rp(this.escape(_)):Rp(_)}].forEach(_=>{for(f=0;l=_.regex.exec(t);){const w=l[1].trim();if(u=p(w),u===void 0)if(typeof m=="function"){const k=m(t,l,o);u=Ke(k)?k:""}else if(o&&Object.prototype.hasOwnProperty.call(o,w))u="";else if(x){u=l[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),u="";else!Ke(u)&&!this.useRawValueToEscape&&(u=Lb(u));const S=_.safeValue(u);if(t=t.replace(l[0],S),x?(_.regex.lastIndex+=u.length,_.regex.lastIndex-=l[0].length):_.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),t}nest(t,r,a={}){let o,l,u;const f=(h,p)=>{const m=this.nestingOptionsSeparator;if(h.indexOf(m)<0)return h;const x=h.split(new RegExp(`${Ts(m)}[ ]*{`));let v=`{${x[1]}`;h=x[0],v=this.interpolate(v,u);const _=v.match(/'/g),w=v.match(/"/g);((_?.length??0)%2===0&&!w||(w?.length??0)%2!==0)&&(v=v.replace(/'/g,'"'));try{u=JSON.parse(v),p&&(u={...p,...u})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,S),`${h}${m}${v}`}return u.defaultValue&&u.defaultValue.indexOf(this.prefix)>-1&&delete u.defaultValue,h};for(;o=this.nestingRegexp.exec(t);){let h=[];u={...a},u=u.replace&&!Ke(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const p=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(p!==-1&&(h=o[1].slice(p).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),o[1]=o[1].slice(0,p)),l=r(f.call(this,o[1].trim(),u),u),l&&o[0]===t&&!Ke(l))return l;Ke(l)||(l=Lb(l)),l||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),l=""),h.length&&(l=h.reduce((m,x)=>this.format(m,x,a.lng,{...a,interpolationkey:o[1].trim()}),l.trim())),t=t.replace(o[0],l),this.regexp.lastIndex=0}return t}}const i2=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const a=e.split("(");t=a[0].toLowerCase().trim();const o=a[1].substring(0,a[1].length-1);t==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(u=>{if(u){const[f,...h]=u.split(":"),p=h.join(":").trim().replace(/^'+|'+$/g,""),m=f.trim();r[m]||(r[m]=p),p==="false"&&(r[m]=!1),p==="true"&&(r[m]=!0),isNaN(p)||(r[m]=parseInt(p,10))}})}return{formatName:t,formatOptions:r}},qb=e=>{const t={};return(r,a,o)=>{let l=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(l={...l,[o.interpolationkey]:void 0});const u=a+JSON.stringify(l);let f=t[u];return f||(f=e(fl(a),o),t[u]=f),f(r)}},l2=e=>(t,r,a)=>e(fl(r),a)(t);class c2{constructor(t={}){this.logger=Kr.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const a=r.cacheInBuiltFormats?qb:l2;this.formats={number:a((o,l)=>{const u=new Intl.NumberFormat(o,{...l});return f=>u.format(f)}),currency:a((o,l)=>{const u=new Intl.NumberFormat(o,{...l,style:"currency"});return f=>u.format(f)}),datetime:a((o,l)=>{const u=new Intl.DateTimeFormat(o,{...l});return f=>u.format(f)}),relativetime:a((o,l)=>{const u=new Intl.RelativeTimeFormat(o,{...l});return f=>u.format(f,l.range||"day")}),list:a((o,l)=>{const u=new Intl.ListFormat(o,{...l});return f=>u.format(f)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=qb(r)}format(t,r,a,o={}){const l=r.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(h=>h.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,f)].join(this.formatSeparator)}return l.reduce((f,h)=>{const{formatName:p,formatOptions:m}=i2(h);if(this.formats[p]){let x=f;try{const v=o?.formatParams?.[o.interpolationkey]||{},_=v.locale||v.lng||o.locale||o.lng||a;x=this.formats[p](f,_,{...m,...o,...v})}catch(v){this.logger.warn(v)}return x}else this.logger.warn(`there was no format function for ${p}`);return f},t)}}const u2=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class d2 extends td{constructor(t,r,a,o={}){super(),this.backend=t,this.store=r,this.services=a,this.languageUtils=a.languageUtils,this.options=o,this.logger=Kr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(a,o.backend,o)}queueLoad(t,r,a,o){const l={},u={},f={},h={};return t.forEach(p=>{let m=!0;r.forEach(x=>{const v=`${p}|${x}`;!a.reload&&this.store.hasResourceBundle(p,x)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?u[v]===void 0&&(u[v]=!0):(this.state[v]=1,m=!1,u[v]===void 0&&(u[v]=!0),l[v]===void 0&&(l[v]=!0),h[x]===void 0&&(h[x]=!0)))}),m||(f[p]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}loaded(t,r,a){const o=t.split("|"),l=o[0],u=o[1];r&&this.emit("failedLoading",l,u,r),!r&&a&&this.store.addResourceBundle(l,u,a,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&a&&(this.state[t]=0);const f={};this.queue.forEach(h=>{Qj(h.loaded,[l],u),u2(h,t),r&&h.errors.push(r),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(p=>{f[p]||(f[p]={});const m=h.loaded[p];m.length&&m.forEach(x=>{f[p][x]===void 0&&(f[p][x]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(h=>!h.done)}read(t,r,a,o=0,l=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:a,tried:o,wait:l,callback:u});return}this.readingCalls++;const f=(p,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(p&&m&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,a,o+1,l*2,u)},l);return}u(p,m)},h=this.backend[a].bind(this.backend);if(h.length===2){try{const p=h(t,r);p&&typeof p.then=="function"?p.then(m=>f(null,m)).catch(f):f(null,p)}catch(p){f(p)}return}return h(t,r,f)}prepareLoading(t,r,a={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Ke(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ke(r)&&(r=[r]);const l=this.queueLoad(t,r,a,o);if(!l.toLoad.length)return l.pending.length||o(),null;l.toLoad.forEach(u=>{this.loadOne(u)})}load(t,r,a){this.prepareLoading(t,r,{},a)}reload(t,r,a){this.prepareLoading(t,r,{reload:!0},a)}loadOne(t,r=""){const a=t.split("|"),o=a[0],l=a[1];this.read(o,l,"read",void 0,void 0,(u,f)=>{u&&this.logger.warn(`${r}loading namespace ${l} for language ${o} failed`,u),!u&&f&&this.logger.log(`${r}loaded namespace ${l} for language ${o}`,f),this.loaded(t,u,f)})}saveMissing(t,r,a,o,l,u={},f=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${a}" as the namespace "${r}" 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(!(a==null||a==="")){if(this.backend?.create){const h={...u,isUpdate:l},p=this.backend.create.bind(this.backend);if(p.length<6)try{let m;p.length===5?m=p(t,r,a,o,h):m=p(t,r,a,o),m&&typeof m.then=="function"?m.then(x=>f(null,x)).catch(f):f(null,m)}catch(m){f(m)}else p(t,r,a,o,f,h)}!t||!t[0]||this.store.addResource(t[0],r,a,o)}}}const Tp=()=>({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]),Ke(e[1])&&(t.defaultValue=e[1]),Ke(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(a=>{t[a]=r[a]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Fb=e=>(Ke(e.ns)&&(e.ns=[e.ns]),Ke(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ke(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),nu=()=>{},f2=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})},I_="__i18next_supportNoticeShown",p2=()=>typeof globalThis<"u"&&!!globalThis[I_],h2=()=>{typeof globalThis<"u"&&(globalThis[I_]=!0)},m2=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 ll extends td{constructor(t={},r){if(super(),this.options=Fb(t),this.services={},this.logger=Kr,this.modules={external:[]},f2(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(Ke(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const a=Tp();this.options={...a,...this.options,...Fb(t)},this.options.interpolation={...a.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=a.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!m2(this)&&!p2()&&(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 💙"),h2());const o=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Kr.init(o(this.modules.logger),this.options):Kr.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=c2;const m=new Bb(this.options);this.store=new zb(this.options.resources,this.options);const x=this.services;x.logger=Kr,x.resourceStore=this.store,x.languageUtils=m,x.pluralResolver=new o2(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==a.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"),p&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(x.formatter=o(p),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new Hb(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new d2(o(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(_,...w)=>{this.emit(_,...w)}),this.modules.languageDetector&&(x.languageDetector=o(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=o(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new Mu(this.services,this.options),this.translator.on("*",(_,...w)=>{this.emit(_,...w)}),this.modules.external.forEach(_=>{_.init&&_.init(this)})}if(this.format=this.options.interpolation.format,r||(r=nu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[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(p=>{this[p]=(...m)=>this.store[p](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...m)=>(this.store[p](...m),this)});const f=Bi(),h=()=>{const p=(m,x)=>{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(x),r(m,x)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),f}loadResources(t,r=nu){let a=r;const o=Ke(t)?t:this.language;if(typeof t=="function"&&(a=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const l=[],u=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(p=>{p!=="cimode"&&l.indexOf(p)<0&&l.push(p)})};o?u(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>u(h)),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),a(f)})}else a(null)}reloadResources(t,r,a){const o=Bi();return typeof t=="function"&&(a=t,t=void 0),typeof r=="function"&&(a=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),a||(a=nu),this.services.backendConnector.reload(t,r,l=>{o.resolve(),a(l)}),o}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"&&$_.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 r=0;r<this.languages.length;r++){const a=this.languages[r];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const a=Bi();this.emit("languageChanging",t);const o=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,h)=>{h?this.isLanguageChangingTo===t&&(o(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,a.resolve((...p)=>this.t(...p)),r&&r(f,(...p)=>this.t(...p))},u=f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const h=Ke(f)?f:f&&f[0],p=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(Ke(f)?[f]:f);p&&(this.language||o(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,m=>{l(m,p)})};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),a}getFixedT(t,r,a){const o=(l,u,...f)=>{let h;typeof u!="object"?h=this.options.overloadTranslationOptionHandler([l,u].concat(f)):h={...u},h.lng=h.lng||o.lng,h.lngs=h.lngs||o.lngs,h.ns=h.ns||o.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||a||o.keyPrefix);const p=this.options.keySeparator||".";let m;return h.keyPrefix&&Array.isArray(l)?m=l.map(x=>(typeof x=="function"&&(x=mh(x,{...this.options,...u})),`${h.keyPrefix}${p}${x}`)):(typeof l=="function"&&(l=mh(l,{...this.options,...u})),m=h.keyPrefix?`${h.keyPrefix}${p}${l}`:l),this.t(m,h)};return Ke(t)?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=a,o}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,r={}){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 a=r.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const u=(f,h)=>{const p=this.services.backendConnector.state[`${f}|${h}`];return p===-1||p===0||p===2};if(r.precheck){const f=r.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,t)&&(!o||u(l,t)))}loadNamespaces(t,r){const a=Bi();return this.options.ns?(Ke(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{a.resolve(),r&&r(o)}),a):(r&&r(),Promise.resolve())}loadLanguages(t,r){const a=Bi();Ke(t)&&(t=[t]);const o=this.options.preload||[],l=t.filter(u=>o.indexOf(u)<0&&this.services.languageUtils.isSupportedCode(u));return l.length?(this.options.preload=o.concat(l),this.loadResources(u=>{a.resolve(),r&&r(u)}),a):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const r=["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"],a=this.services?.languageUtils||new Bb(Tp());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(a.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){const a=new ll(t,r);return a.createInstance=ll.createInstance,a}cloneInstance(t={},r=nu){const a=t.forkResourceStore;a&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},l=new ll(o);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)},a){const f=Object.keys(this.store.data).reduce((h,p)=>(h[p]={...this.store.data[p]},h[p]=Object.keys(h[p]).reduce((m,x)=>(m[x]={...h[p][x]},m),h[p]),h),{});l.store=new zb(f,o),l.services.resourceStore=l.store}if(t.interpolation){const h={...Tp().interpolation,...this.options.interpolation,...t.interpolation},p={...o,interpolation:h};l.services.interpolator=new Hb(p)}return l.translator=new Mu(l.services,o),l.translator.on("*",(f,...h)=>{l.emit(f,...h)}),l.init(o,r),l.translator.options=o,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 Cn=ll.createInstance();Cn.createInstance;Cn.dir;Cn.init;Cn.loadResources;Cn.reloadResources;Cn.use;Cn.changeLanguage;Cn.getFixedT;Cn.t;Cn.exists;Cn.setDefaultNamespace;Cn.hasLoadedNamespace;Cn.loadNamespaces;Cn.loadLanguages;var Ap={exports:{}},Qe={};var Gb;function g2(){if(Gb)return Qe;Gb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),v=Symbol.iterator;function _(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function N(O,V,re){this.props=O,this.context=V,this.refs=k,this.updater=re||w}N.prototype.isReactComponent={},N.prototype.setState=function(O,V){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,V,"setState")},N.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=N.prototype;function E(O,V,re){this.props=O,this.context=V,this.refs=k,this.updater=re||w}var D=E.prototype=new R;D.constructor=E,S(D,N.prototype),D.isPureReactComponent=!0;var L=Array.isArray;function $(){}var z={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function B(O,V,re){var se=re.ref;return{$$typeof:e,type:O,key:V,ref:se!==void 0?se:null,props:re}}function H(O,V){return B(O.type,V,O.props)}function J(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function oe(O){var V={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(re){return V[re]})}var ce=/\/+/g;function M(O,V){return typeof O=="object"&&O!==null&&O.key!=null?oe(""+O.key):V.toString(36)}function P(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then($,$):(O.status="pending",O.then(function(V){O.status==="pending"&&(O.status="fulfilled",O.value=V)},function(V){O.status==="pending"&&(O.status="rejected",O.reason=V)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function A(O,V,re,se,ne){var ge=typeof O;(ge==="undefined"||ge==="boolean")&&(O=null);var Ne=!1;if(O===null)Ne=!0;else switch(ge){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(O.$$typeof){case e:case t:Ne=!0;break;case m:return Ne=O._init,A(Ne(O._payload),V,re,se,ne)}}if(Ne)return ne=ne(O),Ne=se===""?"."+M(O,0):se,L(ne)?(re="",Ne!=null&&(re=Ne.replace(ce,"$&/")+"/"),A(ne,V,re,"",function(be){return be})):ne!=null&&(J(ne)&&(ne=H(ne,re+(ne.key==null||O&&O.key===ne.key?"":(""+ne.key).replace(ce,"$&/")+"/")+Ne)),V.push(ne)),1;Ne=0;var Fe=se===""?".":se+":";if(L(O))for(var qe=0;qe<O.length;qe++)se=O[qe],ge=Fe+M(se,qe),Ne+=A(se,V,re,ge,ne);else if(qe=_(O),typeof qe=="function")for(O=qe.call(O),qe=0;!(se=O.next()).done;)se=se.value,ge=Fe+M(se,qe++),Ne+=A(se,V,re,ge,ne);else if(ge==="object"){if(typeof O.then=="function")return A(P(O),V,re,se,ne);throw V=String(O),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function F(O,V,re){if(O==null)return O;var se=[],ne=0;return A(O,se,"","",function(ge){return V.call(re,ge,ne++)}),se}function ee(O){if(O._status===-1){var V=O._result;V=V(),V.then(function(re){(O._status===0||O._status===-1)&&(O._status=1,O._result=re)},function(re){(O._status===0||O._status===-1)&&(O._status=2,O._result=re)}),O._status===-1&&(O._status=0,O._result=V)}if(O._status===1)return O._result.default;throw O._result}var ae=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},W={map:F,forEach:function(O,V,re){F(O,function(){V.apply(this,arguments)},re)},count:function(O){var V=0;return F(O,function(){V++}),V},toArray:function(O){return F(O,function(V){return V})||[]},only:function(O){if(!J(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Qe.Activity=x,Qe.Children=W,Qe.Component=N,Qe.Fragment=r,Qe.Profiler=o,Qe.PureComponent=E,Qe.StrictMode=a,Qe.Suspense=h,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return z.H.useMemoCache(O)}},Qe.cache=function(O){return function(){return O.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(O,V,re){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var se=S({},O.props),ne=O.key;if(V!=null)for(ge in V.key!==void 0&&(ne=""+V.key),V)!T.call(V,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&V.ref===void 0||(se[ge]=V[ge]);var ge=arguments.length-2;if(ge===1)se.children=re;else if(1<ge){for(var Ne=Array(ge),Fe=0;Fe<ge;Fe++)Ne[Fe]=arguments[Fe+2];se.children=Ne}return B(O.type,ne,se)},Qe.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},Qe.createElement=function(O,V,re){var se,ne={},ge=null;if(V!=null)for(se in V.key!==void 0&&(ge=""+V.key),V)T.call(V,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ne[se]=V[se]);var Ne=arguments.length-2;if(Ne===1)ne.children=re;else if(1<Ne){for(var Fe=Array(Ne),qe=0;qe<Ne;qe++)Fe[qe]=arguments[qe+2];ne.children=Fe}if(O&&O.defaultProps)for(se in Ne=O.defaultProps,Ne)ne[se]===void 0&&(ne[se]=Ne[se]);return B(O,ge,ne)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(O){return{$$typeof:f,render:O}},Qe.isValidElement=J,Qe.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:ee}},Qe.memo=function(O,V){return{$$typeof:p,type:O,compare:V===void 0?null:V}},Qe.startTransition=function(O){var V=z.T,re={};z.T=re;try{var se=O(),ne=z.S;ne!==null&&ne(re,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then($,ae)}catch(ge){ae(ge)}finally{V!==null&&re.types!==null&&(V.types=re.types),z.T=V}},Qe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Qe.use=function(O){return z.H.use(O)},Qe.useActionState=function(O,V,re){return z.H.useActionState(O,V,re)},Qe.useCallback=function(O,V){return z.H.useCallback(O,V)},Qe.useContext=function(O){return z.H.useContext(O)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(O,V){return z.H.useDeferredValue(O,V)},Qe.useEffect=function(O,V){return z.H.useEffect(O,V)},Qe.useEffectEvent=function(O){return z.H.useEffectEvent(O)},Qe.useId=function(){return z.H.useId()},Qe.useImperativeHandle=function(O,V,re){return z.H.useImperativeHandle(O,V,re)},Qe.useInsertionEffect=function(O,V){return z.H.useInsertionEffect(O,V)},Qe.useLayoutEffect=function(O,V){return z.H.useLayoutEffect(O,V)},Qe.useMemo=function(O,V){return z.H.useMemo(O,V)},Qe.useOptimistic=function(O,V){return z.H.useOptimistic(O,V)},Qe.useReducer=function(O,V,re){return z.H.useReducer(O,V,re)},Qe.useRef=function(O){return z.H.useRef(O)},Qe.useState=function(O){return z.H.useState(O)},Qe.useSyncExternalStore=function(O,V,re){return z.H.useSyncExternalStore(O,V,re)},Qe.useTransition=function(){return z.H.useTransition()},Qe.version="19.2.4",Qe}var Vb;function nd(){return Vb||(Vb=1,Ap.exports=g2()),Ap.exports}var b=nd();const Do=M_(b),x2=Gj({__proto__:null,default:Do},[b]),y2=(e,t,r,a)=>{const o=[r,{code:t,...a||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);Us(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...o):console?.warn&&console.warn(...o)},Yb={},U_=(e,t,r,a)=>{Us(r)&&Yb[r]||(Us(r)&&(Yb[r]=new Date),y2(e,t,r,a))},P_=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},gh=(e,t,r)=>{e.loadNamespaces(t,P_(e,r))},Kb=(e,t,r,a)=>{if(Us(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return gh(e,r,a);r.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,P_(e,a))},b2=(e,t,r={})=>!t.languages||!t.languages.length?(U_(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(a,o)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,e))return!1}}),Us=e=>typeof e=="string",v2=e=>typeof e=="object"&&e!==null,_2=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,w2={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},S2=e=>w2[e],j2=e=>e.replace(_2,S2);let xh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:j2,transDefaultProps:void 0};const k2=(e={})=>{xh={...xh,...e}},N2=()=>xh;let H_;const E2=e=>{H_=e},C2=()=>H_,R2={type:"3rdParty",init(e){k2(e.options.react),E2(e)}},T2=b.createContext();class A2{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Lp={exports:{}},Dp={};var Xb;function L2(){if(Xb)return Dp;Xb=1;var e=nd();function t(x,v){return x===v&&(x!==0||1/x===1/v)||x!==x&&v!==v}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(x,v){var _=v(),w=a({inst:{value:_,getSnapshot:v}}),S=w[0].inst,k=w[1];return l(function(){S.value=_,S.getSnapshot=v,h(S)&&k({inst:S})},[x,_,v]),o(function(){return h(S)&&k({inst:S}),x(function(){h(S)&&k({inst:S})})},[x]),u(_),_}function h(x){var v=x.getSnapshot;x=x.value;try{var _=v();return!r(x,_)}catch{return!0}}function p(x,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Dp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Dp}var Qb;function D2(){return Qb||(Qb=1,Lp.exports=L2()),Lp.exports}var O2=D2();const M2=(e,t)=>Us(t)?t:v2(t)&&Us(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,z2={t:M2,ready:!1},$2=()=>()=>{},ye=(e,t={})=>{const{i18n:r}=t,{i18n:a,defaultNS:o}=b.useContext(T2)||{},l=r||a||C2();l&&!l.reportNamespaces&&(l.reportNamespaces=new A2),l||U_(l,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=b.useMemo(()=>({...N2(),...l?.options?.react,...t}),[l,t]),{useSuspense:f,keyPrefix:h}=u,p=o||l?.options?.defaultNS,m=Us(p)?[p]:p||["translation"],x=b.useMemo(()=>m,m);l?.reportNamespaces?.addUsedNamespaces?.(x);const v=b.useRef(0),_=b.useCallback(B=>{if(!l)return $2;const{bindI18n:H,bindI18nStore:J}=u,oe=()=>{v.current+=1,B()};return H&&l.on(H,oe),J&&l.store.on(J,oe),()=>{H&&H.split(" ").forEach(ce=>l.off(ce,oe)),J&&J.split(" ").forEach(ce=>l.store.off(ce,oe))}},[l,u]),w=b.useRef(),S=b.useCallback(()=>{if(!l)return z2;const B=!!(l.isInitialized||l.initializedStoreOnce)&&x.every(P=>b2(P,l,u)),H=t.lng||l.language,J=v.current,oe=w.current;if(oe&&oe.ready===B&&oe.lng===H&&oe.keyPrefix===h&&oe.revision===J)return oe;const M={t:l.getFixedT(H,u.nsMode==="fallback"?x:x[0],h),ready:B,lng:H,keyPrefix:h,revision:J};return w.current=M,M},[l,x,h,u,t.lng]),[k,N]=b.useState(0),{t:R,ready:E}=O2.useSyncExternalStore(_,S,S);b.useEffect(()=>{if(l&&!E&&!f){const B=()=>N(H=>H+1);t.lng?Kb(l,t.lng,x,B):gh(l,x,B)}},[l,t.lng,x,E,f,k]);const D=l||{},L=b.useRef(null),$=b.useRef(),z=B=>{const H=Object.getOwnPropertyDescriptors(B);H.__original&&delete H.__original;const J=Object.create(Object.getPrototypeOf(B),H);if(!Object.prototype.hasOwnProperty.call(J,"__original"))try{Object.defineProperty(J,"__original",{value:B,writable:!1,enumerable:!1,configurable:!1})}catch{}return J},T=b.useMemo(()=>{const B=D,H=B?.language;let J=B;B&&(L.current&&L.current.__original===B?$.current!==H?(J=z(B),L.current=J,$.current=H):J=L.current:(J=z(B),L.current=J,$.current=H));const oe=[R,J,E];return oe.t=R,oe.i18n=J,oe.ready=E,oe},[R,D,E,D.resolvedLanguage,D.language,D.languages]);if(l&&f&&!E)throw new Promise(B=>{const H=()=>B();t.lng?Kb(l,t.lng,x,H):gh(l,x,H)});return T},{slice:B2,forEach:I2}=[];function U2(e){return I2.call(B2.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function P2(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(r=>r.test(e))}const Zb=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,H2=function(e,t){const a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let l=`${e}=${o}`;if(a.maxAge>0){const u=a.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(u)}`}if(a.domain){if(!Zb.test(a.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${a.domain}`}if(a.path){if(!Zb.test(a.path))throw new TypeError("option path is invalid");l+=`; Path=${a.path}`}if(a.expires){if(typeof a.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${a.expires.toUTCString()}`}if(a.httpOnly&&(l+="; HttpOnly"),a.secure&&(l+="; Secure"),a.sameSite)switch(typeof a.sameSite=="string"?a.sameSite.toLowerCase():a.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 a.partitioned&&(l+="; Partitioned"),l},Jb={create(e,t,r,a){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),a&&(o.domain=a),document.cookie=H2(e,t,o)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let a=0;a<r.length;a++){let o=r[a];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var q2={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return Jb.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:a,cookieDomain:o,cookieOptions:l}=t;r&&typeof document<"u"&&Jb.create(r,e,a,o,l)}},F2={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,r;if(typeof window<"u"){let{search:a}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));const l=a.substring(1).split("&");for(let u=0;u<l.length;u++){const f=l[u].indexOf("=");f>0&&l[u].substring(0,f)===t&&(r=l[u].substring(f+1))}}return r}},G2={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:r}=e,a;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const l=o.substring(1);if(t){const u=l.split("&");for(let f=0;f<u.length;f++){const h=u[f].indexOf("=");h>0&&u[f].substring(0,h)===t&&(a=u[f].substring(h+1))}}if(a)return a;if(!a&&r>-1){const u=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(u)?u[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return a}};let Co=null;const Wb=()=>{if(Co!==null)return Co;try{if(Co=typeof window<"u"&&window.localStorage!==null,!Co)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Co=!1}return Co};var V2={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Wb())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&Wb()&&window.localStorage.setItem(r,e)}};let Ro=null;const e0=()=>{if(Ro!==null)return Ro;try{if(Ro=typeof window<"u"&&window.sessionStorage!==null,!Ro)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Ro=!1}return Ro};var Y2={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&e0())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&e0()&&window.sessionStorage.setItem(r,e)}},K2={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:r,userLanguage:a,language:o}=navigator;if(r)for(let l=0;l<r.length;l++)t.push(r[l]);a&&t.push(a),o&&t.push(o)}return t.length>0?t:void 0}},X2={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const a=t||(typeof document<"u"?document.documentElement:null);return a&&typeof a.getAttribute=="function"&&(r=a.getAttribute("lang")),r}},Q2={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof t=="number"?t:0]?.replace("/",""):void 0}},Z2={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const r=typeof t=="number"?t+1:1,a=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(a)return a[r]}};let q_=!1;try{document.cookie,q_=!0}catch{}const F_=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];q_||F_.splice(1,1);const J2=()=>({order:F_,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class G_{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=U2(r,this.options||{},J2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(q2),this.addDetector(F2),this.addDetector(V2),this.addDetector(Y2),this.addDetector(K2),this.addDetector(X2),this.addDetector(Q2),this.addDetector(Z2),this.addDetector(G2)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(a=>{if(this.detectors[a]){let o=this.detectors[a].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.filter(a=>a!=null&&!P2(a)).map(a=>this.options.convertDetectedLanguage(a)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(a=>{this.detectors[a]&&this.detectors[a].cacheUserLanguage(t,this.options)}))}}G_.type="languageDetector";const W2={"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.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.clone_polling":"","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.stage.fetch_tree":"Fetching file tree","sources.import.stage.read_packages":"Reading package descriptors","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.import_remote.api.detected":"Detected {{platform}} repo, fetch via API with partial indexing support","sources.import_remote.api.fast_available":"Fast import available","sources.import_remote.api.will_use_clone":"Fetch repo data via Clone, full indexing","sources.import_remote.api.use_clone":"Fetch repo data via Clone, full indexing","sources.import_remote.api.sub_path":"Sub path (optional)","sources.import_remote.api.sub_path_hint":"For monorepos: import only a subdirectory","sources.import_remote.api.sub_path_placeholder":"Multiple paths separated by ;","sources.import_remote.api.select_sub_paths":"Select subdirectories","sources.import_remote.api.panel_selected":"Selected","sources.import_remote.api.selected_count":"{{count}} directories selected","sources.import_remote.api.confirm_full":"Confirm (full import)","sources.import_remote.api.back_to_ref":"Back to branch select","sources.import_remote.api.method":"Import method","sources.import_remote.api.method_api":"API (fast)","sources.import_remote.api.method_clone":"Clone","sources.import_remote.api.truncated_warning":"File tree exceeds 100,000 entries, API results may be incomplete","sources.import_remote.api.truncated_suggest":"Recommend using traditional clone for complete results","sources.import_remote.api.truncated_continue":"Continue import","sources.import_remote.api.truncated_use_clone":"Use clone","sources.import_remote.api.suggest_clone":"Recommend traditional clone","sources.import_remote.api.fallback_msg":"API import failed, switching to traditional clone","sources.import_remote.api.git_host_not_configured":"Git host {{host}} is not configured. Please add it to server.yaml git_hosts section with an access token.","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.high.tip":"Confidence ≥ 0.9, cross-validated by multiple signals","confidence.ai":"AI suggestion","confidence.ai.tip":"Confidence 0.7–0.9, AI-inferred but not fully verified","confidence.low":"Low confidence","confidence.low.tip":"Confidence < 0.7, insufficient info or conflicting signals","source.field_sync":"System-derived","source.explicit":"Explicitly declared","common.empty.content_raw.title":"Not yet indexed","common.empty.content_raw.description":"Content will be available after indexing.","common.empty.content_raw.cta":"Start indexing","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","explorer.type.content":"Content","explorer.type.entity":"Entity","explorer.type.relation":"Relation","explorer.type.call_graph":"Call Graph","explorer.type.import_deps":"Import Deps","explorer.type.inheritance":"Inheritance","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","index.code.go_index":"Index","index.code.reindex":"Re-index","index.code.indexing":"Indexing...","index.stage.daemon_starting":"Daemon","index.stage.cloning":"Cloning","index.stage.preparing":"Preparing","index.stage.scanning":"Scanning","index.stage.parsing":"Parsing","index.stage.analyzing":"Analyzing","index.stage.uploading":"Uploading","index.stage.skipping":"Skipping","index.code.complete":"Index complete","index.code.unchanged_count":"{{count}} module(s) unchanged, skipped","index.code.error":"Index failed","index.code.timeout":"Index timed out","index.code.dismiss":"Dismiss","index.code.skipped":"Already up to date","index.code.delete":"Delete index","index.code.delete_confirm":"Delete index for this resource? Original content, digest and extraction data will be removed.","index.code.delete_success":"Index deleted","index.code.delete_failed":"Delete index failed","index.code.auto_continue":"Auto-continue on complete","index.code.auto_continue_pending":"Auto-continuing shortly..","index.code.done_continue":"Done","index.log.daemon_starting":"Starting cloud Daemon...","index.log.daemon_ready":"Daemon ready","index.log.cloning":"Cloning repository...","index.log.clone_done":"Clone complete","index.log.preparing":"Preparing index version...","index.log.prepare_done":"Version ready","index.log.done_suffix":"done","index.log.scan_done":"Scan complete","index.log.parse_done":"Parse complete, {{count}} files","index.log.analyze_done":"Analysis complete","index.log.upload_done":"Data saved {{name}}","index.log.restored":"(Progress restored from server, previous logs unavailable)","index.error.commit_not_available":"Target commit unavailable, check remote","index.error.daemon_start_failed":"Cloud Daemon failed to start","index.error.git_archive_failed":"Version export failed","index.doc.error.llm_unavailable":"LLM service unavailable, check configuration","index.doc.error.embedding_unavailable":"Embedding service unavailable, check configuration","index.doc.error.content_missing":"Document content missing","index.doc.error.parse_failed":"Document parsing failed","index.doc.error.llm_exhausted":"LLM call failed: {{message}}","index.stage.chunking":"Chunking","index.stage.annotating":"Annotating","index.stage.post_processing":"Post-processing","index.stage.embedding":"Embedding","index.stage.storing":"Storing","index.doc.log.chunking":"Analyzing document structure...","index.doc.log.chunking_done":"Chunking complete ({{n}} chunks)","index.doc.log.annotating_start":"LLM annotation starting...","index.doc.log.annotating":"LLM annotating ({{n}}/{{m}})","index.doc.log.post_processing":"Entity resolution & quality checks...","index.doc.log.embedding":"Generating embeddings...","index.doc.log.storing":"Saving to storage...","index.doc.msg.chunking_result":"{{chunks}} chunks, {{sections}} sections","index.doc.msg.annotating_start":"{{n}} chunks","index.doc.msg.annotating_start_model":"{{n}} chunks, LLM {{model}}","index.doc.msg.annotating_chunk":"Chunk {{current}}/{{total}} {{step}} ({{calls}} calls, {{tokens}} tokens)","index.doc.msg.annotating_chunk_done":"Chunk {{current}}/{{total}} done, total {{calls}} calls {{tokens}} tokens","index.doc.msg.post_process_start":"Entity auto-complete & normalization","index.doc.msg.extraction_stats":"{{entities}} entities, {{relations}} relations, {{withAtoms}}/{{totalParas}} paragraphs with atoms","index.doc.msg.no_resolution":"No resolution candidates","index.doc.msg.resolving":"Resolving {{duplicates}} duplicates + {{noise}} noise candidates via LLM","index.doc.msg.resolution_parse_failed":"Entity resolution parse failed","index.doc.msg.resolution_result":"Resolution: {{merges}} merges ({{mergeRefs}} refs), {{removed}} removed ({{removeRefs}} instances), {{ambiguous}} ambiguous","index.doc.msg.resolution_failed":"Entity resolution failed (non-blocking)","index.doc.msg.embedding_model":"Embedding {{model}}","index.doc.confirm_title":"Document indexing","index.doc.confirm_desc":"The following documents will be indexed using LLM, which will consume tokens:","index.doc.confirm_btn":"Confirm indexing","index.doc.estimating":"Estimating consumption...","index.doc.estimate_tokens":"Tokens","index.doc.estimate_calls":"LLM calls","index.doc.estimate_chunks":"Chunks","index.doc.estimate_summary":"Estimated ~{{tokens}} tokens, ~{{calls}} LLM calls","index.doc.cancel":"Cancel","digest.empty.title":"No code digest","digest.empty.description":"This content has not been code-indexed. Index to view structured code digest.","digest.empty.cta":"Start indexing","digest.doc.empty.title":"Document not yet indexed","digest.doc.empty.description":"Index to view the original text alongside structured annotations","digest.doc.empty.cta":"Index document","digest.doc.no_atoms":"No annotations or extracted in other paragraphs","digest.doc.atom.entities":"Entities","digest.doc.atom.relations":"Relations","digest.doc.atom.behaviors":"Behaviors","digest.doc.atom.attributes":"Attributes","digest.doc.atom.states":"States","digest.doc.atom.rules":"Rules","digest.doc.atom.transitions":"Transitions","digest.doc.atom.events":"Events","digest.doc.atom.decisions":"Decisions","digest.doc.atom.metrics":"Metrics","digest.doc.atom.roles":"Roles","digest.doc.atom.constraints":"Constraints","digest.doc.atom.comparisons":"Comparisons","digest.doc.atom.boundaries":"Boundaries","digest.stats.files":"Files","digest.stats.classes":"Classes","digest.stats.functions":"Functions","digest.stats.relations":"Relations","digest.tech_stack":"Tech stack","digest.modules":"Modules","daemon.offline_tooltip":"Please start the client","sources.detail.repo_url":"Repo URL","raw.basic_info":"Basic info","raw.field.name":"Name","raw.field.version":"Version","raw.field.license":"License","raw.field.description":"Description","raw.dependencies":"Dependencies","raw.dev_dependencies":"Dev dependencies","raw.no_dependencies":"No dependencies","raw.readme":"Readme","raw.code_files":"Code files","raw.doc_files":"Doc files","raw.total_files":"Total files","index.batch.title":"Select items to index","index.batch.panel_a_title":"Indexable content","index.batch.panel_b_title":"Selected","index.batch.selected_count":"Selected {{n}} / {{total}} available","index.batch.already_indexed":"Indexed","index.batch.reindex_tag":"Re-index","index.batch.skipped_unsupported":"Skipped (not yet supported)","index.batch.empty_selection":"Select items from the tree on the left","index.batch.warning_over_50":"Large number of items (>50), may take a while","index.batch.confirm":"Start indexing","index.batch.back":"Back","index.batch.tooltip":"Batch index","index.batch.tooltip_indexing":"Indexing...","index.batch.toast_skipped":"All selected items are up to date. No re-indexing needed.","index.batch.toast_partial_fail":"Some index tasks failed. Check console for details.","index.batch.error":"Batch index failed","error.dialog.console_hint":"Full error details have been printed to the browser console.","error.dialog.copy":"Copy","error.dialog.copied":"Copied","error.dialog.confirm":"OK","query.tab.label":"Query","query.indexing.title":"Indexing in progress","query.indexing.desc":"Query will be available once indexing completes.","query.symbol.search_placeholder":"Search symbols...","query.symbol.exported_only":"Exported only","query.symbol.load_more":"Load more ({{count}} remaining)","query.symbol.loading":"Loading symbols...","query.symbol.empty":"No symbols found","query.symbol.empty_desc":"This source has no code symbols to display.","query.symbol.methods":"Methods","query.symbol.properties":"Properties","query.symbol.extends":"Extends","query.symbol.implements":"Implements","query.symbol.signature":"Signature","query.symbol.parameters":"Parameters","query.symbol.returns":"Returns","query.symbol.async":"Async","query.call_graph.title":"Call Graph","query.call_graph.callers":"Callers","query.call_graph.callees":"Callees","query.call_graph.empty":"No call relations found","query.call_graph.empty_desc":"No {{direction}} found for this function.","query.call_graph.depth":"Depth","query.call_graph.open":"View call graph","query.import_deps.title":"Import Dependencies","query.import_deps.forward":"Imports","query.import_deps.reverse":"Imported by","query.import_deps.external":"External dependencies","query.import_deps.internal":"Internal dependencies","query.import_deps.empty":"No import relations found","query.import_deps.open":"View dependencies","query.inheritance.title":"Inheritance","query.inheritance.descendants":"Descendants","query.inheritance.ancestors":"Ancestors","query.inheritance.empty":"No inheritance relations found","query.inheritance.cross_source":"Searching {{count}} indexed code sources","query.inheritance.open":"View inheritance","query.doc.search_placeholder":"Search documents with natural language...","query.doc.search_button":"Search","query.doc.searching":"Searching...","query.doc.relevance.high":"High relevance","query.doc.relevance.medium":"Medium relevance","query.doc.relevance.low":"Low relevance","query.doc.empty.title":"No matching paragraphs","query.doc.empty.desc":"Try different keywords, or check if the document has been imported and indexed.","query.doc.error.title":"Document search failed","query.warning.more":"+{{count}} more"},ek={"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.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.clone_polling":"","sources.import.stage.scan":"扫描项目","sources.import.stage.save":"保存数据源","sources.import.stage.done_suffix":"✓","sources.import.stage.complete":"导入完成","sources.import.stage.fetch_tree":"获取文件树","sources.import.stage.read_packages":"读取包描述文件","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.import_remote.api.detected":"已识别 {{platform}} 仓库,使用 API 获取仓库数据,支持局部索引","sources.import_remote.api.fast_available":"快速导入可用","sources.import_remote.api.will_use_clone":"使用 Clone 方式获取仓库数据,全量索引","sources.import_remote.api.use_clone":"使用 Clone 方式获取仓库数据,全量索引","sources.import_remote.api.sub_path":"子路径(可选)","sources.import_remote.api.sub_path_hint":"大仓场景:仅导入指定子目录","sources.import_remote.api.sub_path_placeholder":"多个路径用 ; 分隔,留空表示全量导入","sources.import_remote.api.select_sub_paths":"选择子目录","sources.import_remote.api.panel_selected":"已选内容","sources.import_remote.api.selected_count":"已选 {{count}} 个目录","sources.import_remote.api.confirm_full":"确认(全量导入)","sources.import_remote.api.back_to_ref":"返回分支选择","sources.import_remote.api.method":"导入方式","sources.import_remote.api.method_api":"API(快速)","sources.import_remote.api.method_clone":"Clone","sources.import_remote.api.truncated_warning":"文件树超过 100,000 个条目,API 返回结果可能不完整","sources.import_remote.api.truncated_suggest":"建议使用传统克隆方式以获取完整结果","sources.import_remote.api.truncated_continue":"继续导入","sources.import_remote.api.truncated_use_clone":"传统导入","sources.import_remote.api.suggest_clone":"建议使用传统克隆方式","sources.import_remote.api.fallback_msg":"API 导入失败,切换到传统方式","sources.import_remote.api.git_host_not_configured":"Git 主机 {{host}} 未配置。请在 server.yaml 的 git_hosts 中添加该主机及访问令牌。","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.high.tip":"置信度 ≥ 0.9,多个信号交叉验证","confidence.ai":"AI 建议","confidence.ai.tip":"置信度 0.7–0.9,由 AI 推断但未充分验证","confidence.low":"低确信","confidence.low.tip":"置信度 < 0.7,信息不足或存在矛盾","source.field_sync":"系统推导","source.explicit":"显式声明","common.empty.content_raw.title":"尚未索引","common.empty.content_raw.description":"索引后可查看结构化内容。","common.empty.content_raw.cta":"开始索引","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":"关闭所有标签","explorer.type.content":"内容","explorer.type.entity":"实体","explorer.type.relation":"关系","explorer.type.call_graph":"调用图","explorer.type.import_deps":"依赖导入","explorer.type.inheritance":"继承关系","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}} 行","index.code.go_index":"索引","index.code.reindex":"重新索引","index.code.indexing":"索引中...","index.stage.daemon_starting":"启动 Daemon","index.stage.cloning":"克隆仓库","index.stage.preparing":"版本准备","index.stage.scanning":"扫描中","index.stage.parsing":"解析中","index.stage.analyzing":"分析中","index.stage.uploading":"上传中","index.stage.skipping":"跳过","index.code.complete":"索引完成","index.code.unchanged_count":"{{count}} 个模块无变化,已跳过","index.code.error":"索引失败","index.code.timeout":"索引超时","index.code.dismiss":"关闭","index.code.skipped":"已是最新","index.code.delete":"删除索引","index.code.delete_confirm":"确定要删除该资源的索引?原始内容、摘要和提取数据将被清除。","index.code.delete_success":"索引已删除","index.code.delete_failed":"删除索引失败","index.code.auto_continue":"完成后自动继续","index.code.auto_continue_pending":"即将自动继续..","index.code.done_continue":"完成","index.log.daemon_starting":"正在启动云端 Daemon...","index.log.daemon_ready":"Daemon 就绪","index.log.cloning":"正在克隆仓库...","index.log.clone_done":"克隆完成","index.log.preparing":"正在准备索引版本...","index.log.prepare_done":"版本准备完成","index.log.done_suffix":"完成","index.log.scan_done":"扫描完成","index.log.parse_done":"解析完成 {{count}}个","index.log.analyze_done":"分析完成","index.log.upload_done":"数据已保存 {{name}}","index.log.restored":"(已从服务器恢复进度,之前的日志不可用)","index.error.commit_not_available":"目标版本不可用,请检查远程仓库","index.error.daemon_start_failed":"云端 Daemon 启动失败","index.error.git_archive_failed":"版本导出失败","index.doc.error.llm_unavailable":"LLM 服务不可用,请检查配置","index.doc.error.embedding_unavailable":"Embedding 服务不可用,请检查配置","index.doc.error.content_missing":"文档内容缺失","index.doc.error.parse_failed":"文档解析失败","index.doc.error.llm_exhausted":"LLM 调用失败:{{message}}","index.stage.chunking":"分片中","index.stage.annotating":"标注中","index.stage.post_processing":"后处理","index.stage.embedding":"向量化","index.stage.storing":"存储中","index.doc.log.chunking":"分析文档结构...","index.doc.log.chunking_done":"分片完成({{n}} 个分片)","index.doc.log.annotating_start":"LLM 标注开始...","index.doc.log.annotating":"LLM 标注中 ({{n}}/{{m}})","index.doc.log.post_processing":"实体归一化 & 质量检查...","index.doc.log.embedding":"生成向量...","index.doc.log.storing":"正在保存...","index.doc.msg.chunking_result":"{{chunks}} 个分片,{{sections}} 个章节","index.doc.msg.annotating_start":"{{n}} 个分片","index.doc.msg.annotating_start_model":"{{n}} 个分片,LLM {{model}}","index.doc.msg.annotating_chunk":"分片 {{current}}/{{total}} {{step}}({{calls}} 次调用,{{tokens}} tokens)","index.doc.msg.annotating_chunk_done":"分片 {{current}}/{{total}} 完成,累计 {{calls}} 次调用 {{tokens}} tokens","index.doc.msg.post_process_start":"实体自动补全 & 归一化","index.doc.msg.extraction_stats":"{{entities}} 个实体,{{relations}} 个关系,{{withAtoms}}/{{totalParas}} 段落含标注","index.doc.msg.no_resolution":"无需实体归一化","index.doc.msg.resolving":"归一化中:{{duplicates}} 对重复 + {{noise}} 个噪声候选","index.doc.msg.resolution_parse_failed":"实体归一化解析失败","index.doc.msg.resolution_result":"归一化完成:{{merges}} 次合并({{mergeRefs}} 处引用),移除 {{removed}} 个({{removeRefs}} 处),{{ambiguous}} 个待定","index.doc.msg.resolution_failed":"实体归一化失败(非阻塞)","index.doc.msg.embedding_model":"向量化 {{model}}","index.doc.confirm_title":"文档索引确认","index.doc.confirm_desc":"以下文档将使用 LLM 进行结构化索引,会产生 token 消耗:","index.doc.confirm_btn":"确认索引","index.doc.estimating":"正在估算消耗...","index.doc.estimate_tokens":"预估 Token","index.doc.estimate_calls":"LLM 调用","index.doc.estimate_chunks":"分片数","index.doc.estimate_summary":"预计消耗约 ~{{tokens}} tokens,~{{calls}} 次 LLM 调用","index.doc.cancel":"取消","digest.empty.title":"暂无代码摘要","digest.empty.description":"该内容尚未进行代码索引,索引后可查看结构化代码摘要。","digest.empty.cta":"开始索引","digest.doc.empty.title":"文档尚未完成 LLM 索引","digest.doc.empty.description":"索引后可查看原文与结构化标注的对照视图","digest.doc.empty.cta":"索引文档","digest.doc.no_atoms":"无标注或已提取到其他段落","digest.doc.atom.entities":"实体","digest.doc.atom.relations":"关系","digest.doc.atom.behaviors":"行为","digest.doc.atom.attributes":"属性","digest.doc.atom.states":"状态","digest.doc.atom.rules":"规则","digest.doc.atom.transitions":"转换","digest.doc.atom.events":"事件","digest.doc.atom.decisions":"决策","digest.doc.atom.metrics":"指标","digest.doc.atom.roles":"角色","digest.doc.atom.constraints":"约束","digest.doc.atom.comparisons":"对比","digest.doc.atom.boundaries":"边界","digest.stats.files":"文件","digest.stats.classes":"类","digest.stats.functions":"函数","digest.stats.relations":"关系","digest.tech_stack":"技术栈","digest.modules":"模块","daemon.offline_tooltip":"请启动客户端","sources.detail.repo_url":"仓库地址","raw.basic_info":"基本信息","raw.field.name":"名称","raw.field.version":"版本","raw.field.license":"许可证","raw.field.description":"描述","raw.dependencies":"依赖","raw.dev_dependencies":"开发依赖","raw.no_dependencies":"无依赖","raw.readme":"说明文档","raw.code_files":"代码文件","raw.doc_files":"文档文件","raw.total_files":"总文件数","index.batch.title":"选择待索引内容","index.batch.panel_a_title":"可索引内容","index.batch.panel_b_title":"已选内容","index.batch.selected_count":"已选 {{n}} / 可选 {{total}}","index.batch.already_indexed":"已索引","index.batch.reindex_tag":"重索引","index.batch.skipped_unsupported":"已跳过(暂不支持)","index.batch.empty_selection":"请在左侧勾选要索引的内容","index.batch.warning_over_50":"待索引数量较多(>50),可能需要较长时间","index.batch.confirm":"开始索引","index.batch.back":"返回","index.batch.tooltip":"批量索引","index.batch.tooltip_indexing":"索引中...","index.batch.toast_skipped":"选中的内容均已是最新状态,无需重新索引。","index.batch.toast_partial_fail":"部分索引任务失败,详情请查看控制台。","index.batch.error":"批量索引失败","error.dialog.console_hint":"完整错误信息已打印到浏览器控制台。","error.dialog.copy":"复制","error.dialog.copied":"已复制","error.dialog.confirm":"确定","query.tab.label":"查询","query.indexing.title":"索引进行中","query.indexing.desc":"索引完成后即可使用查询功能。","query.symbol.search_placeholder":"搜索符号...","query.symbol.exported_only":"仅导出","query.symbol.load_more":"加载更多(剩余 {{count}} 个)","query.symbol.loading":"加载符号中...","query.symbol.empty":"未找到符号","query.symbol.empty_desc":"该源没有可展示的代码符号。","query.symbol.methods":"方法","query.symbol.properties":"属性","query.symbol.extends":"继承","query.symbol.implements":"实现","query.symbol.signature":"签名","query.symbol.parameters":"参数","query.symbol.returns":"返回值","query.symbol.async":"异步","query.call_graph.title":"调用图","query.call_graph.callers":"调用者","query.call_graph.callees":"被调用","query.call_graph.empty":"未找到调用关系","query.call_graph.empty_desc":"未找到该函数的{{direction}}。","query.call_graph.depth":"深度","query.call_graph.open":"查看调用图","query.import_deps.title":"导入依赖","query.import_deps.forward":"导入","query.import_deps.reverse":"被导入","query.import_deps.external":"外部依赖","query.import_deps.internal":"内部依赖","query.import_deps.empty":"未找到导入关系","query.import_deps.open":"查看依赖","query.inheritance.title":"继承关系","query.inheritance.descendants":"子类","query.inheritance.ancestors":"父类","query.inheritance.empty":"未找到继承关系","query.inheritance.cross_source":"正在搜索 {{count}} 个已索引代码源","query.inheritance.open":"查看继承","query.doc.search_placeholder":"用自然语言搜索文档...","query.doc.search_button":"搜索","query.doc.searching":"搜索中...","query.doc.relevance.high":"高相关度","query.doc.relevance.medium":"中相关度","query.doc.relevance.low":"低相关度","query.doc.empty.title":"未找到匹配段落","query.doc.empty.desc":"请尝试更换关键词,或检查相关文档是否已导入并完成索引。","query.doc.error.title":"文档搜索失败","query.warning.more":"还有 {{count}} 条"};Cn.use(G_).use(R2).init({resources:{en:{translation:W2},zh:{translation:ek}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Op={exports:{}},Ii={},Mp={exports:{}},zp={};var t0;function tk(){return t0||(t0=1,(function(e){function t(A,F){var ee=A.length;A.push(F);e:for(;0<ee;){var ae=ee-1>>>1,W=A[ae];if(0<o(W,F))A[ae]=F,A[ee]=W,ee=ae;else break e}}function r(A){return A.length===0?null:A[0]}function a(A){if(A.length===0)return null;var F=A[0],ee=A.pop();if(ee!==F){A[0]=ee;e:for(var ae=0,W=A.length,O=W>>>1;ae<O;){var V=2*(ae+1)-1,re=A[V],se=V+1,ne=A[se];if(0>o(re,ee))se<W&&0>o(ne,re)?(A[ae]=ne,A[se]=ee,ae=se):(A[ae]=re,A[V]=ee,ae=V);else if(se<W&&0>o(ne,ee))A[ae]=ne,A[se]=ee,ae=se;else break e}}return F}function o(A,F){var ee=A.sortIndex-F.sortIndex;return ee!==0?ee:A.id-F.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 h=[],p=[],m=1,x=null,v=3,_=!1,w=!1,S=!1,k=!1,N=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function D(A){for(var F=r(p);F!==null;){if(F.callback===null)a(p);else if(F.startTime<=A)a(p),F.sortIndex=F.expirationTime,t(h,F);else break;F=r(p)}}function L(A){if(S=!1,D(A),!w)if(r(h)!==null)w=!0,$||($=!0,oe());else{var F=r(p);F!==null&&P(L,F.startTime-A)}}var $=!1,z=-1,T=5,B=-1;function H(){return k?!0:!(e.unstable_now()-B<T)}function J(){if(k=!1,$){var A=e.unstable_now();B=A;var F=!0;try{e:{w=!1,S&&(S=!1,R(z),z=-1),_=!0;var ee=v;try{t:{for(D(A),x=r(h);x!==null&&!(x.expirationTime>A&&H());){var ae=x.callback;if(typeof ae=="function"){x.callback=null,v=x.priorityLevel;var W=ae(x.expirationTime<=A);if(A=e.unstable_now(),typeof W=="function"){x.callback=W,D(A),F=!0;break t}x===r(h)&&a(h),D(A)}else a(h);x=r(h)}if(x!==null)F=!0;else{var O=r(p);O!==null&&P(L,O.startTime-A),F=!1}}break e}finally{x=null,v=ee,_=!1}F=void 0}}finally{F?oe():$=!1}}}var oe;if(typeof E=="function")oe=function(){E(J)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,M=ce.port2;ce.port1.onmessage=J,oe=function(){M.postMessage(null)}}else oe=function(){N(J,0)};function P(A,F){z=N(function(){A(e.unstable_now())},F)}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 F=3;break;default:F=v}var ee=v;v=F;try{return A()}finally{v=ee}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(A,F){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var ee=v;v=A;try{return F()}finally{v=ee}},e.unstable_scheduleCallback=function(A,F,ee){var ae=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ae+ee:ae):ee=ae,A){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=ee+W,A={id:m++,callback:F,priorityLevel:A,startTime:ee,expirationTime:W,sortIndex:-1},ee>ae?(A.sortIndex=ee,t(p,A),r(h)===null&&A===r(p)&&(S?(R(z),z=-1):S=!0,P(L,ee-ae))):(A.sortIndex=W,t(h,A),w||_||(w=!0,$||($=!0,oe()))),A},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(A){var F=v;return function(){var ee=v;v=F;try{return A.apply(this,arguments)}finally{v=ee}}}})(zp)),zp}var n0;function nk(){return n0||(n0=1,Mp.exports=tk()),Mp.exports}var $p={exports:{}},Sn={};var r0;function rk(){if(r0)return Sn;r0=1;var e=nd();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(h,p,m){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:h,containerInfo:p,implementation:m}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Sn.createPortal=function(h,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return l(h,p,null,m)},Sn.flushSync=function(h){var p=u.T,m=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=p,a.p=m,a.d.f()}},Sn.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(h,p))},Sn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Sn.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var m=p.as,x=f(m,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:v,fetchPriority:_}):m==="script"&&a.d.X(h,{crossOrigin:x,integrity:v,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Sn.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=f(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(h)},Sn.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,x=f(m,p.crossOrigin);a.d.L(h,m,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Sn.preloadModule=function(h,p){if(typeof h=="string")if(p){var m=f(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},Sn.requestFormReset=function(h){a.d.r(h)},Sn.unstable_batchedUpdates=function(h,p){return h(p)},Sn.useFormState=function(h,p,m){return u.H.useFormState(h,p,m)},Sn.useFormStatus=function(){return u.H.useHostTransitionStatus()},Sn.version="19.2.4",Sn}var a0;function ak(){if(a0)return $p.exports;a0=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(),$p.exports=rk(),$p.exports}var s0;function sk(){if(s0)return Ii;s0=1;var e=nk(),t=nd(),r=ak();function a(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)s+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var s=n,i=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(i=s.return),n=s.return;while(n)}return s.tag===3?i:null}function u(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function f(n){if(n.tag===31){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function h(n){if(l(n)!==n)throw Error(a(188))}function p(n){var s=n.alternate;if(!s){if(s=l(n),s===null)throw Error(a(188));return s!==n?null:n}for(var i=n,d=s;;){var g=i.return;if(g===null)break;var y=g.alternate;if(y===null){if(d=g.return,d!==null){i=d;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===i)return h(g),n;if(y===d)return h(g),s;y=y.sibling}throw Error(a(188))}if(i.return!==d.return)i=g,d=y;else{for(var j=!1,C=g.child;C;){if(C===i){j=!0,i=g,d=y;break}if(C===d){j=!0,d=g,i=y;break}C=C.sibling}if(!j){for(C=y.child;C;){if(C===i){j=!0,i=y,d=g;break}if(C===d){j=!0,d=y,i=g;break}C=C.sibling}if(!j)throw Error(a(189))}}if(i.alternate!==d)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?n:s}function m(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=m(n),s!==null)return s;n=n.sibling}return null}var x=Object.assign,v=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),E=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function oe(n){return n===null||typeof n!="object"?null:(n=J&&n[J]||n["@@iterator"],typeof n=="function"?n:null)}var ce=Symbol.for("react.client.reference");function M(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 S:return"Fragment";case N:return"Profiler";case k:return"StrictMode";case L:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case E:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case D:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case z:return s=n.displayName||null,s!==null?s:M(n.type)||"Memo";case T:s=n._payload,n=n._init;try{return M(n(s))}catch{}}return null}var P=Array.isArray,A=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},ae=[],W=-1;function O(n){return{current:n}}function V(n){0>W||(n.current=ae[W],ae[W]=null,W--)}function re(n,s){W++,ae[W]=n.current,n.current=s}var se=O(null),ne=O(null),ge=O(null),Ne=O(null);function Fe(n,s){switch(re(ge,s),re(ne,n),re(se,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?Wy(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=Wy(s),n=eb(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}V(se),re(se,n)}function qe(){V(se),V(ne),V(ge)}function be(n){n.memoizedState!==null&&re(Ne,n);var s=se.current,i=eb(s,n.type);s!==i&&(re(ne,n),re(se,i))}function fe(n){ne.current===n&&(V(se),V(ne)),Ne.current===n&&(V(Ne),Di._currentValue=ee)}var _e,he;function ve(n){if(_e===void 0)try{throw Error()}catch(i){var s=i.stack.trim().match(/\n( *(at )?)/);_e=s&&s[1]||"",he=-1<i.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+_e+n+he}var Ve=!1;function De(n,s){if(!n||Ve)return"";Ve=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(te){var Q=te}Reflect.construct(n,[],pe)}else{try{pe.call()}catch(te){Q=te}n.call(pe.prototype)}}else{try{throw Error()}catch(te){Q=te}(pe=n())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(te){if(te&&Q&&typeof te.stack=="string")return[te.stack,Q.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),j=y[0],C=y[1];if(j&&C){var U=j.split(`
|
|
5
|
+
`),X=C.split(`
|
|
6
|
+
`);for(g=d=0;d<U.length&&!U[d].includes("DetermineComponentFrameRoot");)d++;for(;g<X.length&&!X[g].includes("DetermineComponentFrameRoot");)g++;if(d===U.length||g===X.length)for(d=U.length-1,g=X.length-1;1<=d&&0<=g&&U[d]!==X[g];)g--;for(;1<=d&&0<=g;d--,g--)if(U[d]!==X[g]){if(d!==1||g!==1)do if(d--,g--,0>g||U[d]!==X[g]){var ie=`
|
|
7
|
+
`+U[d].replace(" at new "," at ");return n.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",n.displayName)),ie}while(1<=d&&0<=g);break}}}finally{Ve=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?ve(i):""}function Xe(n,s){switch(n.tag){case 26:case 27:case 5:return ve(n.type);case 16:return ve("Lazy");case 13:return n.child!==s&&s!==null?ve("Suspense Fallback"):ve("Suspense");case 19:return ve("SuspenseList");case 0:case 15:return De(n.type,!1);case 11:return De(n.type.render,!1);case 1:return De(n.type,!0);case 31:return ve("Activity");default:return""}}function It(n){try{var s="",i=null;do s+=Xe(n,i),i=n,n=n.return;while(n);return s}catch(d){return`
|
|
8
|
+
Error generating stack: `+d.message+`
|
|
9
|
+
`+d.stack}}var un=Object.prototype.hasOwnProperty,Vt=e.unstable_scheduleCallback,Bn=e.unstable_cancelCallback,cr=e.unstable_shouldYield,Xn=e.unstable_requestPaint,Ht=e.unstable_now,Rn=e.unstable_getCurrentPriorityLevel,Le=e.unstable_ImmediatePriority,Ze=e.unstable_UserBlockingPriority,We=e.unstable_NormalPriority,Nt=e.unstable_LowPriority,ft=e.unstable_IdlePriority,Tn=e.log,mn=e.unstable_setDisableYieldValue,gn=null,Lt=null;function Et(n){if(typeof Tn=="function"&&mn(n),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(gn,n)}catch{}}var Pt=Math.clz32?Math.clz32:sa,Er=Math.log,zr=Math.LN2;function sa(n){return n>>>=0,n===0?32:31-(Er(n)/zr|0)|0}var me=256,Ue=262144,St=4194304;function nt(n){var s=n&42;if(s!==0)return s;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 Ct(n,s,i){var d=n.pendingLanes;if(d===0)return 0;var g=0,y=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var C=d&134217727;return C!==0?(d=C&~y,d!==0?g=nt(d):(j&=C,j!==0?g=nt(j):i||(i=C&~n,i!==0&&(g=nt(i))))):(C=d&~y,C!==0?g=nt(C):j!==0?g=nt(j):i||(i=d&~n,i!==0&&(g=nt(i)))),g===0?0:s!==0&&s!==g&&(s&y)===0&&(y=g&-g,i=s&-s,y>=i||y===32&&(i&4194048)!==0)?s:g}function Dt(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function Oa(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 oa(){var n=St;return St<<=1,(St&62914560)===0&&(St=4194304),n}function ur(n){for(var s=[],i=0;31>i;i++)s.push(n);return s}function An(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function $r(n,s,i,d,g,y){var j=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var C=n.entanglements,U=n.expirationTimes,X=n.hiddenUpdates;for(i=j&~i;0<i;){var ie=31-Pt(i),pe=1<<ie;C[ie]=0,U[ie]=-1;var Q=X[ie];if(Q!==null)for(X[ie]=null,ie=0;ie<Q.length;ie++){var te=Q[ie];te!==null&&(te.lane&=-536870913)}i&=~pe}d!==0&&ia(n,d,0),y!==0&&g===0&&n.tag!==0&&(n.suspendedLanes|=y&~(j&~s))}function ia(n,s,i){n.pendingLanes|=s,n.suspendedLanes&=~s;var d=31-Pt(s);n.entangledLanes|=s,n.entanglements[d]=n.entanglements[d]|1073741824|i&261930}function Ma(n,s){var i=n.entangledLanes|=s;for(n=n.entanglements;i;){var d=31-Pt(i),g=1<<d;g&s|n[d]&s&&(n[d]|=s),i&=~g}}function I(n,s){var i=s&-s;return i=(i&42)!==0?1:G(i),(i&(n.suspendedLanes|s))!==0?0:i}function G(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 xe(){var n=F.p;return n!==0?n:(n=window.event,n===void 0?32:Sb(n.type))}function we(n,s){var i=F.p;try{return F.p=n,s()}finally{F.p=i}}var Re=Math.random().toString(36).slice(2),je="__reactFiber$"+Re,ke="__reactProps$"+Re,Ce="__reactContainer$"+Re,Ie="__reactEvents$"+Re,Pe="__reactListeners$"+Re,Be="__reactHandles$"+Re,dt="__reactResources$"+Re,ue="__reactMarker$"+Re;function Ee(n){delete n[je],delete n[ke],delete n[Ie],delete n[Pe],delete n[Be]}function Te(n){var s=n[je];if(s)return s;for(var i=n.parentNode;i;){if(s=i[Ce]||i[je]){if(i=s.alternate,s.child!==null||i!==null&&i.child!==null)for(n=ib(n);n!==null;){if(i=n[je])return i;n=ib(n)}return s}n=i,i=n.parentNode}return null}function Ge(n){if(n=n[je]||n[Ce]){var s=n.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return n}return null}function Oe(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(a(33))}function gt(n){var s=n[dt];return s||(s=n[dt]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function it(n){n[ue]=!0}var an=new Set,_n={};function dn(n,s){Br(n,s),Br(n+"Capture",s)}function Br(n,s){for(_n[n]=s,n=0;n<s.length;n++)an.add(s[n])}var fs=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]*$"),Ir={},ps={};function Gs(n){return un.call(ps,n)?!0:un.call(Ir,n)?!1:fs.test(n)?ps[n]=!0:(Ir[n]=!0,!1)}function at(n,s,i){if(Gs(s))if(i===null)n.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+i)}}function Yt(n,s,i){if(i===null)n.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+i)}}function wn(n,s,i,d){if(d===null)n.removeAttribute(i);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(s,i,""+d)}}function Jt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ot(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Vs(n,s,i){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,s);if(!n.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,y=d.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return g.call(this)},set:function(j){i=""+j,y.call(this,j)}}),Object.defineProperty(n,s,{enumerable:d.enumerable}),{getValue:function(){return i},setValue:function(j){i=""+j},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function Ys(n){if(!n._valueTracker){var s=Ot(n)?"checked":"value";n._valueTracker=Vs(n,s,""+n[s])}}function Gl(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var i=s.getValue(),d="";return n&&(d=Ot(n)?n.checked?"true":"false":n.value),n=d,n!==i?(s.setValue(n),!0):!1}function Vl(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 Iw=/[\n"\\]/g;function dr(n){return n.replace(Iw,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function vd(n,s,i,d,g,y,j,C){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),s!=null?j==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+Jt(s)):n.value!==""+Jt(s)&&(n.value=""+Jt(s)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),s!=null?_d(n,j,Jt(s)):i!=null?_d(n,j,Jt(i)):d!=null&&n.removeAttribute("value"),g==null&&y!=null&&(n.defaultChecked=!!y),g!=null&&(n.checked=g&&typeof g!="function"&&typeof g!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.name=""+Jt(C):n.removeAttribute("name")}function Ym(n,s,i,d,g,y,j,C){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),s!=null||i!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){Ys(n);return}i=i!=null?""+Jt(i):"",s=s!=null?""+Jt(s):i,C||s===n.value||(n.value=s),n.defaultValue=s}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=C?n.checked:!!d,n.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),Ys(n)}function _d(n,s,i){s==="number"&&Vl(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function Ks(n,s,i,d){if(n=n.options,s){s={};for(var g=0;g<i.length;g++)s["$"+i[g]]=!0;for(i=0;i<n.length;i++)g=s.hasOwnProperty("$"+n[i].value),n[i].selected!==g&&(n[i].selected=g),g&&d&&(n[i].defaultSelected=!0)}else{for(i=""+Jt(i),s=null,g=0;g<n.length;g++){if(n[g].value===i){n[g].selected=!0,d&&(n[g].defaultSelected=!0);return}s!==null||n[g].disabled||(s=n[g])}s!==null&&(s.selected=!0)}}function Km(n,s,i){if(s!=null&&(s=""+Jt(s),s!==n.value&&(n.value=s),i==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=i!=null?""+Jt(i):""}function Xm(n,s,i,d){if(s==null){if(d!=null){if(i!=null)throw Error(a(92));if(P(d)){if(1<d.length)throw Error(a(93));d=d[0]}i=d}i==null&&(i=""),s=i}i=Jt(s),n.defaultValue=i,d=n.textContent,d===i&&d!==""&&d!==null&&(n.value=d),Ys(n)}function Xs(n,s){if(s){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=s;return}}n.textContent=s}var Uw=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 Qm(n,s,i){var d=s.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?d?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":d?n.setProperty(s,i):typeof i!="number"||i===0||Uw.has(s)?s==="float"?n.cssFloat=i:n[s]=(""+i).trim():n[s]=i+"px"}function Zm(n,s,i){if(s!=null&&typeof s!="object")throw Error(a(62));if(n=n.style,i!=null){for(var d in i)!i.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var g in s)d=s[g],s.hasOwnProperty(g)&&i[g]!==d&&Qm(n,g,d)}else for(var y in s)s.hasOwnProperty(y)&&Qm(n,y,s[y])}function wd(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 Pw=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"]]),Hw=/^[\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 Yl(n){return Hw.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function la(){}var Sd=null;function jd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Qs=null,Zs=null;function Jm(n){var s=Ge(n);if(s&&(n=s.stateNode)){var i=n[ke]||null;e:switch(n=s.stateNode,s.type){case"input":if(vd(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),s=i.name,i.type==="radio"&&s!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+dr(""+s)+'"][type="radio"]'),s=0;s<i.length;s++){var d=i[s];if(d!==n&&d.form===n.form){var g=d[ke]||null;if(!g)throw Error(a(90));vd(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(s=0;s<i.length;s++)d=i[s],d.form===n.form&&Gl(d)}break e;case"textarea":Km(n,i.value,i.defaultValue);break e;case"select":s=i.value,s!=null&&Ks(n,!!i.multiple,s,!1)}}}var kd=!1;function Wm(n,s,i){if(kd)return n(s,i);kd=!0;try{var d=n(s);return d}finally{if(kd=!1,(Qs!==null||Zs!==null)&&(Oc(),Qs&&(s=Qs,n=Zs,Zs=Qs=null,Jm(s),n)))for(s=0;s<n.length;s++)Jm(n[s])}}function Qo(n,s){var i=n.stateNode;if(i===null)return null;var d=i[ke]||null;if(d===null)return null;i=d[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(a(231,s,typeof i));return i}var ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nd=!1;if(ca)try{var Zo={};Object.defineProperty(Zo,"passive",{get:function(){Nd=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{Nd=!1}var za=null,Ed=null,Kl=null;function eg(){if(Kl)return Kl;var n,s=Ed,i=s.length,d,g="value"in za?za.value:za.textContent,y=g.length;for(n=0;n<i&&s[n]===g[n];n++);var j=i-n;for(d=1;d<=j&&s[i-d]===g[y-d];d++);return Kl=g.slice(n,1<d?1-d:void 0)}function Xl(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}function Ql(){return!0}function tg(){return!1}function In(n){function s(i,d,g,y,j){this._reactName=i,this._targetInst=g,this.type=d,this.nativeEvent=y,this.target=j,this.currentTarget=null;for(var C in n)n.hasOwnProperty(C)&&(i=n[C],this[C]=i?i(y):y[C]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ql:tg,this.isPropagationStopped=tg,this}return x(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ql)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ql)},persist:function(){},isPersistent:Ql}),s}var hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zl=In(hs),Jo=x({},hs,{view:0,detail:0}),qw=In(Jo),Cd,Rd,Wo,Jl=x({},Jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ad,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!==Wo&&(Wo&&n.type==="mousemove"?(Cd=n.screenX-Wo.screenX,Rd=n.screenY-Wo.screenY):Rd=Cd=0,Wo=n),Cd)},movementY:function(n){return"movementY"in n?n.movementY:Rd}}),ng=In(Jl),Fw=x({},Jl,{dataTransfer:0}),Gw=In(Fw),Vw=x({},Jo,{relatedTarget:0}),Td=In(Vw),Yw=x({},hs,{animationName:0,elapsedTime:0,pseudoElement:0}),Kw=In(Yw),Xw=x({},hs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Qw=In(Xw),Zw=x({},hs,{data:0}),rg=In(Zw),Jw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ww={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"},eS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tS(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=eS[n])?!!s[n]:!1}function Ad(){return tS}var nS=x({},Jo,{key:function(n){if(n.key){var s=Jw[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=Xl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Ww[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ad,charCode:function(n){return n.type==="keypress"?Xl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Xl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),rS=In(nS),aS=x({},Jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ag=In(aS),sS=x({},Jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ad}),oS=In(sS),iS=x({},hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),lS=In(iS),cS=x({},Jl,{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}),uS=In(cS),dS=x({},hs,{newState:0,oldState:0}),fS=In(dS),pS=[9,13,27,32],Ld=ca&&"CompositionEvent"in window,ei=null;ca&&"documentMode"in document&&(ei=document.documentMode);var hS=ca&&"TextEvent"in window&&!ei,sg=ca&&(!Ld||ei&&8<ei&&11>=ei),og=" ",ig=!1;function lg(n,s){switch(n){case"keyup":return pS.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Js=!1;function mS(n,s){switch(n){case"compositionend":return cg(s);case"keypress":return s.which!==32?null:(ig=!0,og);case"textInput":return n=s.data,n===og&&ig?null:n;default:return null}}function gS(n,s){if(Js)return n==="compositionend"||!Ld&&lg(n,s)?(n=eg(),Kl=Ed=za=null,Js=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return sg&&s.locale!=="ko"?null:s.data;default:return null}}var xS={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 ug(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!xS[n.type]:s==="textarea"}function dg(n,s,i,d){Qs?Zs?Zs.push(d):Zs=[d]:Qs=d,s=Pc(s,"onChange"),0<s.length&&(i=new Zl("onChange","change",null,i,d),n.push({event:i,listeners:s}))}var ti=null,ni=null;function yS(n){Yy(n,0)}function Wl(n){var s=Oe(n);if(Gl(s))return n}function fg(n,s){if(n==="change")return s}var pg=!1;if(ca){var Dd;if(ca){var Od="oninput"in document;if(!Od){var hg=document.createElement("div");hg.setAttribute("oninput","return;"),Od=typeof hg.oninput=="function"}Dd=Od}else Dd=!1;pg=Dd&&(!document.documentMode||9<document.documentMode)}function mg(){ti&&(ti.detachEvent("onpropertychange",gg),ni=ti=null)}function gg(n){if(n.propertyName==="value"&&Wl(ni)){var s=[];dg(s,ni,n,jd(n)),Wm(yS,s)}}function bS(n,s,i){n==="focusin"?(mg(),ti=s,ni=i,ti.attachEvent("onpropertychange",gg)):n==="focusout"&&mg()}function vS(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Wl(ni)}function _S(n,s){if(n==="click")return Wl(s)}function wS(n,s){if(n==="input"||n==="change")return Wl(s)}function SS(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var Qn=typeof Object.is=="function"?Object.is:SS;function ri(n,s){if(Qn(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var i=Object.keys(n),d=Object.keys(s);if(i.length!==d.length)return!1;for(d=0;d<i.length;d++){var g=i[d];if(!un.call(s,g)||!Qn(n[g],s[g]))return!1}return!0}function xg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function yg(n,s){var i=xg(n);n=0;for(var d;i;){if(i.nodeType===3){if(d=n+i.textContent.length,n<=s&&d>=s)return{node:i,offset:s-n};n=d}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=xg(i)}}function bg(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?bg(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function vg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=Vl(n.document);s instanceof n.HTMLIFrameElement;){try{var i=typeof s.contentWindow.location.href=="string"}catch{i=!1}if(i)n=s.contentWindow;else break;s=Vl(n.document)}return s}function Md(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}var jS=ca&&"documentMode"in document&&11>=document.documentMode,Ws=null,zd=null,ai=null,$d=!1;function _g(n,s,i){var d=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;$d||Ws==null||Ws!==Vl(d)||(d=Ws,"selectionStart"in d&&Md(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ai&&ri(ai,d)||(ai=d,d=Pc(zd,"onSelect"),0<d.length&&(s=new Zl("onSelect","select",null,s,i),n.push({event:s,listeners:d}),s.target=Ws)))}function ms(n,s){var i={};return i[n.toLowerCase()]=s.toLowerCase(),i["Webkit"+n]="webkit"+s,i["Moz"+n]="moz"+s,i}var eo={animationend:ms("Animation","AnimationEnd"),animationiteration:ms("Animation","AnimationIteration"),animationstart:ms("Animation","AnimationStart"),transitionrun:ms("Transition","TransitionRun"),transitionstart:ms("Transition","TransitionStart"),transitioncancel:ms("Transition","TransitionCancel"),transitionend:ms("Transition","TransitionEnd")},Bd={},wg={};ca&&(wg=document.createElement("div").style,"AnimationEvent"in window||(delete eo.animationend.animation,delete eo.animationiteration.animation,delete eo.animationstart.animation),"TransitionEvent"in window||delete eo.transitionend.transition);function gs(n){if(Bd[n])return Bd[n];if(!eo[n])return n;var s=eo[n],i;for(i in s)if(s.hasOwnProperty(i)&&i in wg)return Bd[n]=s[i];return n}var Sg=gs("animationend"),jg=gs("animationiteration"),kg=gs("animationstart"),kS=gs("transitionrun"),NS=gs("transitionstart"),ES=gs("transitioncancel"),Ng=gs("transitionend"),Eg=new Map,Id="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(" ");Id.push("scrollEnd");function Cr(n,s){Eg.set(n,s),dn(s,[n])}var ec=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=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(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},fr=[],to=0,Ud=0;function tc(){for(var n=to,s=Ud=to=0;s<n;){var i=fr[s];fr[s++]=null;var d=fr[s];fr[s++]=null;var g=fr[s];fr[s++]=null;var y=fr[s];if(fr[s++]=null,d!==null&&g!==null){var j=d.pending;j===null?g.next=g:(g.next=j.next,j.next=g),d.pending=g}y!==0&&Cg(i,g,y)}}function nc(n,s,i,d){fr[to++]=n,fr[to++]=s,fr[to++]=i,fr[to++]=d,Ud|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function Pd(n,s,i,d){return nc(n,s,i,d),rc(n)}function xs(n,s){return nc(n,null,null,s),rc(n)}function Cg(n,s,i){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i);for(var g=!1,y=n.return;y!==null;)y.childLanes|=i,d=y.alternate,d!==null&&(d.childLanes|=i),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(g=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,g&&s!==null&&(g=31-Pt(i),n=y.hiddenUpdates,d=n[g],d===null?n[g]=[s]:d.push(s),s.lane=i|536870912),y):null}function rc(n){if(50<Ni)throw Ni=0,Zf=null,Error(a(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}var no={};function CS(n,s,i,d){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(n,s,i,d){return new CS(n,s,i,d)}function Hd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ua(n,s){var i=n.alternate;return i===null?(i=Zn(n.tag,s,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=s,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,s=n.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function Rg(n,s){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=s,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,s=i.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}function ac(n,s,i,d,g,y){var j=0;if(d=n,typeof n=="function")Hd(n)&&(j=1);else if(typeof n=="string")j=Dj(n,i,se.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case B:return n=Zn(31,i,s,g),n.elementType=B,n.lanes=y,n;case S:return ys(i.children,g,y,s);case k:j=8,g|=24;break;case N:return n=Zn(12,i,s,g|2),n.elementType=N,n.lanes=y,n;case L:return n=Zn(13,i,s,g),n.elementType=L,n.lanes=y,n;case $:return n=Zn(19,i,s,g),n.elementType=$,n.lanes=y,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case E:j=10;break e;case R:j=9;break e;case D:j=11;break e;case z:j=14;break e;case T:j=16,d=null;break e}j=29,i=Error(a(130,n===null?"null":typeof n,"")),d=null}return s=Zn(j,i,s,g),s.elementType=n,s.type=d,s.lanes=y,s}function ys(n,s,i,d){return n=Zn(7,n,d,s),n.lanes=i,n}function qd(n,s,i){return n=Zn(6,n,null,s),n.lanes=i,n}function Tg(n){var s=Zn(18,null,null,0);return s.stateNode=n,s}function Fd(n,s,i){return s=Zn(4,n.children!==null?n.children:[],n.key,s),s.lanes=i,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}var Ag=new WeakMap;function pr(n,s){if(typeof n=="object"&&n!==null){var i=Ag.get(n);return i!==void 0?i:(s={value:n,source:s,stack:It(s)},Ag.set(n,s),s)}return{value:n,source:s,stack:It(s)}}var ro=[],ao=0,sc=null,si=0,hr=[],mr=0,$a=null,Ur=1,Pr="";function da(n,s){ro[ao++]=si,ro[ao++]=sc,sc=n,si=s}function Lg(n,s,i){hr[mr++]=Ur,hr[mr++]=Pr,hr[mr++]=$a,$a=n;var d=Ur;n=Pr;var g=32-Pt(d)-1;d&=~(1<<g),i+=1;var y=32-Pt(s)+g;if(30<y){var j=g-g%5;y=(d&(1<<j)-1).toString(32),d>>=j,g-=j,Ur=1<<32-Pt(s)+g|i<<g|d,Pr=y+n}else Ur=1<<y|i<<g|d,Pr=n}function Gd(n){n.return!==null&&(da(n,1),Lg(n,1,0))}function Vd(n){for(;n===sc;)sc=ro[--ao],ro[ao]=null,si=ro[--ao],ro[ao]=null;for(;n===$a;)$a=hr[--mr],hr[mr]=null,Pr=hr[--mr],hr[mr]=null,Ur=hr[--mr],hr[mr]=null}function Dg(n,s){hr[mr++]=Ur,hr[mr++]=Pr,hr[mr++]=$a,Ur=s.id,Pr=s.overflow,$a=n}var xn=null,Mt=null,ut=!1,Ba=null,gr=!1,Yd=Error(a(519));function Ia(n){var s=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oi(pr(s,n)),Yd}function Og(n){var s=n.stateNode,i=n.type,d=n.memoizedProps;switch(s[je]=n,s[ke]=d,i){case"dialog":ot("cancel",s),ot("close",s);break;case"iframe":case"object":case"embed":ot("load",s);break;case"video":case"audio":for(i=0;i<Ci.length;i++)ot(Ci[i],s);break;case"source":ot("error",s);break;case"img":case"image":case"link":ot("error",s),ot("load",s);break;case"details":ot("toggle",s);break;case"input":ot("invalid",s),Ym(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":ot("invalid",s);break;case"textarea":ot("invalid",s),Xm(s,d.value,d.defaultValue,d.children)}i=d.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||s.textContent===""+i||d.suppressHydrationWarning===!0||Zy(s.textContent,i)?(d.popover!=null&&(ot("beforetoggle",s),ot("toggle",s)),d.onScroll!=null&&ot("scroll",s),d.onScrollEnd!=null&&ot("scrollend",s),d.onClick!=null&&(s.onclick=la),s=!0):s=!1,s||Ia(n,!0)}function Mg(n){for(xn=n.return;xn;)switch(xn.tag){case 5:case 31:case 13:gr=!1;return;case 27:case 3:gr=!0;return;default:xn=xn.return}}function so(n){if(n!==xn)return!1;if(!ut)return Mg(n),ut=!0,!1;var s=n.tag,i;if((i=s!==3&&s!==27)&&((i=s===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||fp(n.type,n.memoizedProps)),i=!i),i&&Mt&&Ia(n),Mg(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Mt=ob(n)}else if(s===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Mt=ob(n)}else s===27?(s=Mt,Wa(n.type)?(n=xp,xp=null,Mt=n):Mt=s):Mt=xn?yr(n.stateNode.nextSibling):null;return!0}function bs(){Mt=xn=null,ut=!1}function Kd(){var n=Ba;return n!==null&&(qn===null?qn=n:qn.push.apply(qn,n),Ba=null),n}function oi(n){Ba===null?Ba=[n]:Ba.push(n)}var Xd=O(null),vs=null,fa=null;function Ua(n,s,i){re(Xd,s._currentValue),s._currentValue=i}function pa(n){n._currentValue=Xd.current,V(Xd)}function Qd(n,s,i){for(;n!==null;){var d=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),n===i)break;n=n.return}}function Zd(n,s,i,d){var g=n.child;for(g!==null&&(g.return=n);g!==null;){var y=g.dependencies;if(y!==null){var j=g.child;y=y.firstContext;e:for(;y!==null;){var C=y;y=g;for(var U=0;U<s.length;U++)if(C.context===s[U]){y.lanes|=i,C=y.alternate,C!==null&&(C.lanes|=i),Qd(y.return,i,n),d||(j=null);break e}y=C.next}}else if(g.tag===18){if(j=g.return,j===null)throw Error(a(341));j.lanes|=i,y=j.alternate,y!==null&&(y.lanes|=i),Qd(j,i,n),j=null}else j=g.child;if(j!==null)j.return=g;else for(j=g;j!==null;){if(j===n){j=null;break}if(g=j.sibling,g!==null){g.return=j.return,j=g;break}j=j.return}g=j}}function oo(n,s,i,d){n=null;for(var g=s,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var j=g.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var C=g.type;Qn(g.pendingProps.value,j.value)||(n!==null?n.push(C):n=[C])}}else if(g===Ne.current){if(j=g.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(n!==null?n.push(Di):n=[Di])}g=g.return}n!==null&&Zd(s,n,i,d),s.flags|=262144}function oc(n){for(n=n.firstContext;n!==null;){if(!Qn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function _s(n){vs=n,fa=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function yn(n){return zg(vs,n)}function ic(n,s){return vs===null&&_s(n),zg(n,s)}function zg(n,s){var i=s._currentValue;if(s={context:s,memoizedValue:i,next:null},fa===null){if(n===null)throw Error(a(308));fa=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else fa=fa.next=s;return i}var RS=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:function(i,d){n.push(d)}};this.abort=function(){s.aborted=!0,n.forEach(function(i){return i()})}},TS=e.unstable_scheduleCallback,AS=e.unstable_NormalPriority,Wt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jd(){return{controller:new RS,data:new Map,refCount:0}}function ii(n){n.refCount--,n.refCount===0&&TS(AS,function(){n.controller.abort()})}var li=null,Wd=0,io=0,lo=null;function LS(n,s){if(li===null){var i=li=[];Wd=0,io=rp(),lo={status:"pending",value:void 0,then:function(d){i.push(d)}}}return Wd++,s.then($g,$g),s}function $g(){if(--Wd===0&&li!==null){lo!==null&&(lo.status="fulfilled");var n=li;li=null,io=0,lo=null;for(var s=0;s<n.length;s++)(0,n[s])()}}function DS(n,s){var i=[],d={status:"pending",value:null,reason:null,then:function(g){i.push(g)}};return n.then(function(){d.status="fulfilled",d.value=s;for(var g=0;g<i.length;g++)(0,i[g])(s)},function(g){for(d.status="rejected",d.reason=g,g=0;g<i.length;g++)(0,i[g])(void 0)}),d}var Bg=A.S;A.S=function(n,s){_y=Ht(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&LS(n,s),Bg!==null&&Bg(n,s)};var ws=O(null);function ef(){var n=ws.current;return n!==null?n:jt.pooledCache}function lc(n,s){s===null?re(ws,ws.current):re(ws,s.pool)}function Ig(){var n=ef();return n===null?null:{parent:Wt._currentValue,pool:n}}var co=Error(a(460)),tf=Error(a(474)),cc=Error(a(542)),uc={then:function(){}};function Ug(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Pg(n,s,i){switch(i=n[i],i===void 0?n.push(s):i!==s&&(s.then(la,la),s=i),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,qg(n),n;default:if(typeof s.status=="string")s.then(la,la);else{if(n=jt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=s,n.status="pending",n.then(function(d){if(s.status==="pending"){var g=s;g.status="fulfilled",g.value=d}},function(d){if(s.status==="pending"){var g=s;g.status="rejected",g.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,qg(n),n}throw js=s,co}}function Ss(n){try{var s=n._init;return s(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(js=i,co):i}}var js=null;function Hg(){if(js===null)throw Error(a(459));var n=js;return js=null,n}function qg(n){if(n===co||n===cc)throw Error(a(483))}var uo=null,ci=0;function dc(n){var s=ci;return ci+=1,uo===null&&(uo=[]),Pg(uo,n,s)}function ui(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}function fc(n,s){throw s.$$typeof===v?Error(a(525)):(n=Object.prototype.toString.call(s),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}function Fg(n){function s(Y,q){if(n){var K=Y.deletions;K===null?(Y.deletions=[q],Y.flags|=16):K.push(q)}}function i(Y,q){if(!n)return null;for(;q!==null;)s(Y,q),q=q.sibling;return null}function d(Y){for(var q=new Map;Y!==null;)Y.key!==null?q.set(Y.key,Y):q.set(Y.index,Y),Y=Y.sibling;return q}function g(Y,q){return Y=ua(Y,q),Y.index=0,Y.sibling=null,Y}function y(Y,q,K){return Y.index=K,n?(K=Y.alternate,K!==null?(K=K.index,K<q?(Y.flags|=67108866,q):K):(Y.flags|=67108866,q)):(Y.flags|=1048576,q)}function j(Y){return n&&Y.alternate===null&&(Y.flags|=67108866),Y}function C(Y,q,K,de){return q===null||q.tag!==6?(q=qd(K,Y.mode,de),q.return=Y,q):(q=g(q,K),q.return=Y,q)}function U(Y,q,K,de){var He=K.type;return He===S?ie(Y,q,K.props.children,de,K.key):q!==null&&(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&Ss(He)===q.type)?(q=g(q,K.props),ui(q,K),q.return=Y,q):(q=ac(K.type,K.key,K.props,null,Y.mode,de),ui(q,K),q.return=Y,q)}function X(Y,q,K,de){return q===null||q.tag!==4||q.stateNode.containerInfo!==K.containerInfo||q.stateNode.implementation!==K.implementation?(q=Fd(K,Y.mode,de),q.return=Y,q):(q=g(q,K.children||[]),q.return=Y,q)}function ie(Y,q,K,de,He){return q===null||q.tag!==7?(q=ys(K,Y.mode,de,He),q.return=Y,q):(q=g(q,K),q.return=Y,q)}function pe(Y,q,K){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=qd(""+q,Y.mode,K),q.return=Y,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case _:return K=ac(q.type,q.key,q.props,null,Y.mode,K),ui(K,q),K.return=Y,K;case w:return q=Fd(q,Y.mode,K),q.return=Y,q;case T:return q=Ss(q),pe(Y,q,K)}if(P(q)||oe(q))return q=ys(q,Y.mode,K,null),q.return=Y,q;if(typeof q.then=="function")return pe(Y,dc(q),K);if(q.$$typeof===E)return pe(Y,ic(Y,q),K);fc(Y,q)}return null}function Q(Y,q,K,de){var He=q!==null?q.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return He!==null?null:C(Y,q,""+K,de);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case _:return K.key===He?U(Y,q,K,de):null;case w:return K.key===He?X(Y,q,K,de):null;case T:return K=Ss(K),Q(Y,q,K,de)}if(P(K)||oe(K))return He!==null?null:ie(Y,q,K,de,null);if(typeof K.then=="function")return Q(Y,q,dc(K),de);if(K.$$typeof===E)return Q(Y,q,ic(Y,K),de);fc(Y,K)}return null}function te(Y,q,K,de,He){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return Y=Y.get(K)||null,C(q,Y,""+de,He);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case _:return Y=Y.get(de.key===null?K:de.key)||null,U(q,Y,de,He);case w:return Y=Y.get(de.key===null?K:de.key)||null,X(q,Y,de,He);case T:return de=Ss(de),te(Y,q,K,de,He)}if(P(de)||oe(de))return Y=Y.get(K)||null,ie(q,Y,de,He,null);if(typeof de.then=="function")return te(Y,q,K,dc(de),He);if(de.$$typeof===E)return te(Y,q,K,ic(q,de),He);fc(q,de)}return null}function Ae(Y,q,K,de){for(var He=null,pt=null,Me=q,et=q=0,ct=null;Me!==null&&et<K.length;et++){Me.index>et?(ct=Me,Me=null):ct=Me.sibling;var ht=Q(Y,Me,K[et],de);if(ht===null){Me===null&&(Me=ct);break}n&&Me&&ht.alternate===null&&s(Y,Me),q=y(ht,q,et),pt===null?He=ht:pt.sibling=ht,pt=ht,Me=ct}if(et===K.length)return i(Y,Me),ut&&da(Y,et),He;if(Me===null){for(;et<K.length;et++)Me=pe(Y,K[et],de),Me!==null&&(q=y(Me,q,et),pt===null?He=Me:pt.sibling=Me,pt=Me);return ut&&da(Y,et),He}for(Me=d(Me);et<K.length;et++)ct=te(Me,Y,et,K[et],de),ct!==null&&(n&&ct.alternate!==null&&Me.delete(ct.key===null?et:ct.key),q=y(ct,q,et),pt===null?He=ct:pt.sibling=ct,pt=ct);return n&&Me.forEach(function(as){return s(Y,as)}),ut&&da(Y,et),He}function Ye(Y,q,K,de){if(K==null)throw Error(a(151));for(var He=null,pt=null,Me=q,et=q=0,ct=null,ht=K.next();Me!==null&&!ht.done;et++,ht=K.next()){Me.index>et?(ct=Me,Me=null):ct=Me.sibling;var as=Q(Y,Me,ht.value,de);if(as===null){Me===null&&(Me=ct);break}n&&Me&&as.alternate===null&&s(Y,Me),q=y(as,q,et),pt===null?He=as:pt.sibling=as,pt=as,Me=ct}if(ht.done)return i(Y,Me),ut&&da(Y,et),He;if(Me===null){for(;!ht.done;et++,ht=K.next())ht=pe(Y,ht.value,de),ht!==null&&(q=y(ht,q,et),pt===null?He=ht:pt.sibling=ht,pt=ht);return ut&&da(Y,et),He}for(Me=d(Me);!ht.done;et++,ht=K.next())ht=te(Me,Y,et,ht.value,de),ht!==null&&(n&&ht.alternate!==null&&Me.delete(ht.key===null?et:ht.key),q=y(ht,q,et),pt===null?He=ht:pt.sibling=ht,pt=ht);return n&&Me.forEach(function(Fj){return s(Y,Fj)}),ut&&da(Y,et),He}function _t(Y,q,K,de){if(typeof K=="object"&&K!==null&&K.type===S&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case _:e:{for(var He=K.key;q!==null;){if(q.key===He){if(He=K.type,He===S){if(q.tag===7){i(Y,q.sibling),de=g(q,K.props.children),de.return=Y,Y=de;break e}}else if(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&Ss(He)===q.type){i(Y,q.sibling),de=g(q,K.props),ui(de,K),de.return=Y,Y=de;break e}i(Y,q);break}else s(Y,q);q=q.sibling}K.type===S?(de=ys(K.props.children,Y.mode,de,K.key),de.return=Y,Y=de):(de=ac(K.type,K.key,K.props,null,Y.mode,de),ui(de,K),de.return=Y,Y=de)}return j(Y);case w:e:{for(He=K.key;q!==null;){if(q.key===He)if(q.tag===4&&q.stateNode.containerInfo===K.containerInfo&&q.stateNode.implementation===K.implementation){i(Y,q.sibling),de=g(q,K.children||[]),de.return=Y,Y=de;break e}else{i(Y,q);break}else s(Y,q);q=q.sibling}de=Fd(K,Y.mode,de),de.return=Y,Y=de}return j(Y);case T:return K=Ss(K),_t(Y,q,K,de)}if(P(K))return Ae(Y,q,K,de);if(oe(K)){if(He=oe(K),typeof He!="function")throw Error(a(150));return K=He.call(K),Ye(Y,q,K,de)}if(typeof K.then=="function")return _t(Y,q,dc(K),de);if(K.$$typeof===E)return _t(Y,q,ic(Y,K),de);fc(Y,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,q!==null&&q.tag===6?(i(Y,q.sibling),de=g(q,K),de.return=Y,Y=de):(i(Y,q),de=qd(K,Y.mode,de),de.return=Y,Y=de),j(Y)):i(Y,q)}return function(Y,q,K,de){try{ci=0;var He=_t(Y,q,K,de);return uo=null,He}catch(Me){if(Me===co||Me===cc)throw Me;var pt=Zn(29,Me,null,Y.mode);return pt.lanes=de,pt.return=Y,pt}}}var ks=Fg(!0),Gg=Fg(!1),Pa=!1;function nf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rf(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ha(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function qa(n,s,i){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(mt&2)!==0){var g=d.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),d.pending=s,s=rc(n),Cg(n,null,i),s}return nc(n,d,s,i),rc(n)}function di(n,s,i){if(s=s.updateQueue,s!==null&&(s=s.shared,(i&4194048)!==0)){var d=s.lanes;d&=n.pendingLanes,i|=d,s.lanes=i,Ma(n,i)}}function af(n,s){var i=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,i===d)){var g=null,y=null;if(i=i.firstBaseUpdate,i!==null){do{var j={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};y===null?g=y=j:y=y.next=j,i=i.next}while(i!==null);y===null?g=y=s:y=y.next=s}else g=y=s;i={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=s:n.next=s,i.lastBaseUpdate=s}var sf=!1;function fi(){if(sf){var n=lo;if(n!==null)throw n}}function pi(n,s,i,d){sf=!1;var g=n.updateQueue;Pa=!1;var y=g.firstBaseUpdate,j=g.lastBaseUpdate,C=g.shared.pending;if(C!==null){g.shared.pending=null;var U=C,X=U.next;U.next=null,j===null?y=X:j.next=X,j=U;var ie=n.alternate;ie!==null&&(ie=ie.updateQueue,C=ie.lastBaseUpdate,C!==j&&(C===null?ie.firstBaseUpdate=X:C.next=X,ie.lastBaseUpdate=U))}if(y!==null){var pe=g.baseState;j=0,ie=X=U=null,C=y;do{var Q=C.lane&-536870913,te=Q!==C.lane;if(te?(lt&Q)===Q:(d&Q)===Q){Q!==0&&Q===io&&(sf=!0),ie!==null&&(ie=ie.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var Ae=n,Ye=C;Q=s;var _t=i;switch(Ye.tag){case 1:if(Ae=Ye.payload,typeof Ae=="function"){pe=Ae.call(_t,pe,Q);break e}pe=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Ye.payload,Q=typeof Ae=="function"?Ae.call(_t,pe,Q):Ae,Q==null)break e;pe=x({},pe,Q);break e;case 2:Pa=!0}}Q=C.callback,Q!==null&&(n.flags|=64,te&&(n.flags|=8192),te=g.callbacks,te===null?g.callbacks=[Q]:te.push(Q))}else te={lane:Q,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ie===null?(X=ie=te,U=pe):ie=ie.next=te,j|=Q;if(C=C.next,C===null){if(C=g.shared.pending,C===null)break;te=C,C=te.next,te.next=null,g.lastBaseUpdate=te,g.shared.pending=null}}while(!0);ie===null&&(U=pe),g.baseState=U,g.firstBaseUpdate=X,g.lastBaseUpdate=ie,y===null&&(g.shared.lanes=0),Ka|=j,n.lanes=j,n.memoizedState=pe}}function Vg(n,s){if(typeof n!="function")throw Error(a(191,n));n.call(s)}function Yg(n,s){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)Vg(i[n],s)}var fo=O(null),pc=O(0);function Kg(n,s){n=wa,re(pc,n),re(fo,s),wa=n|s.baseLanes}function of(){re(pc,wa),re(fo,fo.current)}function lf(){wa=pc.current,V(fo),V(pc)}var Jn=O(null),xr=null;function Fa(n){var s=n.alternate;re(Kt,Kt.current&1),re(Jn,n),xr===null&&(s===null||fo.current!==null||s.memoizedState!==null)&&(xr=n)}function cf(n){re(Kt,Kt.current),re(Jn,n),xr===null&&(xr=n)}function Xg(n){n.tag===22?(re(Kt,Kt.current),re(Jn,n),xr===null&&(xr=n)):Ga()}function Ga(){re(Kt,Kt.current),re(Jn,Jn.current)}function Wn(n){V(Jn),xr===n&&(xr=null),V(Kt)}var Kt=O(0);function hc(n){for(var s=n;s!==null;){if(s.tag===13){var i=s.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||mp(i)||gp(i)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ha=0,Je=null,bt=null,en=null,mc=!1,po=!1,Ns=!1,gc=0,hi=0,ho=null,OS=0;function qt(){throw Error(a(321))}function uf(n,s){if(s===null)return!1;for(var i=0;i<s.length&&i<n.length;i++)if(!Qn(n[i],s[i]))return!1;return!0}function df(n,s,i,d,g,y){return ha=y,Je=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,A.H=n===null||n.memoizedState===null?Lx:Nf,Ns=!1,y=i(d,g),Ns=!1,po&&(y=Zg(s,i,d,g)),Qg(n),y}function Qg(n){A.H=xi;var s=bt!==null&&bt.next!==null;if(ha=0,en=bt=Je=null,mc=!1,hi=0,ho=null,s)throw Error(a(300));n===null||tn||(n=n.dependencies,n!==null&&oc(n)&&(tn=!0))}function Zg(n,s,i,d){Je=n;var g=0;do{if(po&&(ho=null),hi=0,po=!1,25<=g)throw Error(a(301));if(g+=1,en=bt=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}A.H=Dx,y=s(i,d)}while(po);return y}function MS(){var n=A.H,s=n.useState()[0];return s=typeof s.then=="function"?mi(s):s,n=n.useState()[0],(bt!==null?bt.memoizedState:null)!==n&&(Je.flags|=1024),s}function ff(){var n=gc!==0;return gc=0,n}function pf(n,s,i){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~i}function hf(n){if(mc){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}mc=!1}ha=0,en=bt=Je=null,po=!1,hi=gc=0,ho=null}function Ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Je.memoizedState=en=n:en=en.next=n,en}function Xt(){if(bt===null){var n=Je.alternate;n=n!==null?n.memoizedState:null}else n=bt.next;var s=en===null?Je.memoizedState:en.next;if(s!==null)en=s,bt=n;else{if(n===null)throw Je.alternate===null?Error(a(467)):Error(a(310));bt=n,n={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},en===null?Je.memoizedState=en=n:en=en.next=n}return en}function xc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mi(n){var s=hi;return hi+=1,ho===null&&(ho=[]),n=Pg(ho,n,s),s=Je,(en===null?s.memoizedState:en.next)===null&&(s=s.alternate,A.H=s===null||s.memoizedState===null?Lx:Nf),n}function yc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return mi(n);if(n.$$typeof===E)return yn(n)}throw Error(a(438,String(n)))}function mf(n){var s=null,i=Je.updateQueue;if(i!==null&&(s=i.memoCache),s==null){var d=Je.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(g){return g.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),i===null&&(i=xc(),Je.updateQueue=i),i.memoCache=s,i=s.data[s.index],i===void 0)for(i=s.data[s.index]=Array(n),d=0;d<n;d++)i[d]=H;return s.index++,i}function ma(n,s){return typeof s=="function"?s(n):s}function bc(n){var s=Xt();return gf(s,bt,n)}function gf(n,s,i){var d=n.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=i;var g=n.baseQueue,y=d.pending;if(y!==null){if(g!==null){var j=g.next;g.next=y.next,y.next=j}s.baseQueue=g=y,d.pending=null}if(y=n.baseState,g===null)n.memoizedState=y;else{s=g.next;var C=j=null,U=null,X=s,ie=!1;do{var pe=X.lane&-536870913;if(pe!==X.lane?(lt&pe)===pe:(ha&pe)===pe){var Q=X.revertLane;if(Q===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),pe===io&&(ie=!0);else if((ha&Q)===Q){X=X.next,Q===io&&(ie=!0);continue}else pe={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},U===null?(C=U=pe,j=y):U=U.next=pe,Je.lanes|=Q,Ka|=Q;pe=X.action,Ns&&i(y,pe),y=X.hasEagerState?X.eagerState:i(y,pe)}else Q={lane:pe,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},U===null?(C=U=Q,j=y):U=U.next=Q,Je.lanes|=pe,Ka|=pe;X=X.next}while(X!==null&&X!==s);if(U===null?j=y:U.next=C,!Qn(y,n.memoizedState)&&(tn=!0,ie&&(i=lo,i!==null)))throw i;n.memoizedState=y,n.baseState=j,n.baseQueue=U,d.lastRenderedState=y}return g===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function xf(n){var s=Xt(),i=s.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=n;var d=i.dispatch,g=i.pending,y=s.memoizedState;if(g!==null){i.pending=null;var j=g=g.next;do y=n(y,j.action),j=j.next;while(j!==g);Qn(y,s.memoizedState)||(tn=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),i.lastRenderedState=y}return[y,d]}function Jg(n,s,i){var d=Je,g=Xt(),y=ut;if(y){if(i===void 0)throw Error(a(407));i=i()}else i=s();var j=!Qn((bt||g).memoizedState,i);if(j&&(g.memoizedState=i,tn=!0),g=g.queue,vf(tx.bind(null,d,g,n),[n]),g.getSnapshot!==s||j||en!==null&&en.memoizedState.tag&1){if(d.flags|=2048,mo(9,{destroy:void 0},ex.bind(null,d,g,i,s),null),jt===null)throw Error(a(349));y||(ha&127)!==0||Wg(d,s,i)}return i}function Wg(n,s,i){n.flags|=16384,n={getSnapshot:s,value:i},s=Je.updateQueue,s===null?(s=xc(),Je.updateQueue=s,s.stores=[n]):(i=s.stores,i===null?s.stores=[n]:i.push(n))}function ex(n,s,i,d){s.value=i,s.getSnapshot=d,nx(s)&&rx(n)}function tx(n,s,i){return i(function(){nx(s)&&rx(n)})}function nx(n){var s=n.getSnapshot;n=n.value;try{var i=s();return!Qn(n,i)}catch{return!0}}function rx(n){var s=xs(n,2);s!==null&&Fn(s,n,2)}function yf(n){var s=Ln();if(typeof n=="function"){var i=n;if(n=i(),Ns){Et(!0);try{i()}finally{Et(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:n},s}function ax(n,s,i,d){return n.baseState=i,gf(n,bt,typeof d=="function"?d:ma)}function zS(n,s,i,d,g){if(wc(n))throw Error(a(485));if(n=s.action,n!==null){var y={payload:g,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){y.listeners.push(j)}};A.T!==null?i(!0):y.isTransition=!1,d(y),i=s.pending,i===null?(y.next=s.pending=y,sx(s,y)):(y.next=i.next,s.pending=i.next=y)}}function sx(n,s){var i=s.action,d=s.payload,g=n.state;if(s.isTransition){var y=A.T,j={};A.T=j;try{var C=i(g,d),U=A.S;U!==null&&U(j,C),ox(n,s,C)}catch(X){bf(n,s,X)}finally{y!==null&&j.types!==null&&(y.types=j.types),A.T=y}}else try{y=i(g,d),ox(n,s,y)}catch(X){bf(n,s,X)}}function ox(n,s,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(d){ix(n,s,d)},function(d){return bf(n,s,d)}):ix(n,s,i)}function ix(n,s,i){s.status="fulfilled",s.value=i,lx(s),n.state=i,s=n.pending,s!==null&&(i=s.next,i===s?n.pending=null:(i=i.next,s.next=i,sx(n,i)))}function bf(n,s,i){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=i,lx(s),s=s.next;while(s!==d)}n.action=null}function lx(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}function cx(n,s){return s}function ux(n,s){if(ut){var i=jt.formState;if(i!==null){e:{var d=Je;if(ut){if(Mt){t:{for(var g=Mt,y=gr;g.nodeType!==8;){if(!y){g=null;break t}if(g=yr(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){Mt=yr(g.nextSibling),d=g.data==="F!";break e}}Ia(d)}d=!1}d&&(s=i[0])}}return i=Ln(),i.memoizedState=i.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cx,lastRenderedState:s},i.queue=d,i=Rx.bind(null,Je,d),d.dispatch=i,d=yf(!1),y=kf.bind(null,Je,!1,d.queue),d=Ln(),g={state:s,dispatch:null,action:n,pending:null},d.queue=g,i=zS.bind(null,Je,g,y,i),g.dispatch=i,d.memoizedState=n,[s,i,!1]}function dx(n){var s=Xt();return fx(s,bt,n)}function fx(n,s,i){if(s=gf(n,s,cx)[0],n=bc(ma)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=mi(s)}catch(j){throw j===co?cc:j}else d=s;s=Xt();var g=s.queue,y=g.dispatch;return i!==s.memoizedState&&(Je.flags|=2048,mo(9,{destroy:void 0},$S.bind(null,g,i),null)),[d,y,n]}function $S(n,s){n.action=s}function px(n){var s=Xt(),i=bt;if(i!==null)return fx(s,i,n);Xt(),s=s.memoizedState,i=Xt();var d=i.queue.dispatch;return i.memoizedState=n,[s,d,!1]}function mo(n,s,i,d){return n={tag:n,create:i,deps:d,inst:s,next:null},s=Je.updateQueue,s===null&&(s=xc(),Je.updateQueue=s),i=s.lastEffect,i===null?s.lastEffect=n.next=n:(d=i.next,i.next=n,n.next=d,s.lastEffect=n),n}function hx(){return Xt().memoizedState}function vc(n,s,i,d){var g=Ln();Je.flags|=n,g.memoizedState=mo(1|s,{destroy:void 0},i,d===void 0?null:d)}function _c(n,s,i,d){var g=Xt();d=d===void 0?null:d;var y=g.memoizedState.inst;bt!==null&&d!==null&&uf(d,bt.memoizedState.deps)?g.memoizedState=mo(s,y,i,d):(Je.flags|=n,g.memoizedState=mo(1|s,y,i,d))}function mx(n,s){vc(8390656,8,n,s)}function vf(n,s){_c(2048,8,n,s)}function BS(n){Je.flags|=4;var s=Je.updateQueue;if(s===null)s=xc(),Je.updateQueue=s,s.events=[n];else{var i=s.events;i===null?s.events=[n]:i.push(n)}}function gx(n){var s=Xt().memoizedState;return BS({ref:s,nextImpl:n}),function(){if((mt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}function xx(n,s){return _c(4,2,n,s)}function yx(n,s){return _c(4,4,n,s)}function bx(n,s){if(typeof s=="function"){n=n();var i=s(n);return function(){typeof i=="function"?i():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function vx(n,s,i){i=i!=null?i.concat([n]):null,_c(4,4,bx.bind(null,s,n),i)}function _f(){}function _x(n,s){var i=Xt();s=s===void 0?null:s;var d=i.memoizedState;return s!==null&&uf(s,d[1])?d[0]:(i.memoizedState=[n,s],n)}function wx(n,s){var i=Xt();s=s===void 0?null:s;var d=i.memoizedState;if(s!==null&&uf(s,d[1]))return d[0];if(d=n(),Ns){Et(!0);try{n()}finally{Et(!1)}}return i.memoizedState=[d,s],d}function wf(n,s,i){return i===void 0||(ha&1073741824)!==0&&(lt&261930)===0?n.memoizedState=s:(n.memoizedState=i,n=Sy(),Je.lanes|=n,Ka|=n,i)}function Sx(n,s,i,d){return Qn(i,s)?i:fo.current!==null?(n=wf(n,i,d),Qn(n,s)||(tn=!0),n):(ha&42)===0||(ha&1073741824)!==0&&(lt&261930)===0?(tn=!0,n.memoizedState=i):(n=Sy(),Je.lanes|=n,Ka|=n,s)}function jx(n,s,i,d,g){var y=F.p;F.p=y!==0&&8>y?y:8;var j=A.T,C={};A.T=C,kf(n,!1,s,i);try{var U=g(),X=A.S;if(X!==null&&X(C,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ie=DS(U,d);gi(n,s,ie,nr(n))}else gi(n,s,d,nr(n))}catch(pe){gi(n,s,{then:function(){},status:"rejected",reason:pe},nr())}finally{F.p=y,j!==null&&C.types!==null&&(j.types=C.types),A.T=j}}function IS(){}function Sf(n,s,i,d){if(n.tag!==5)throw Error(a(476));var g=kx(n).queue;jx(n,g,s,ee,i===null?IS:function(){return Nx(n),i(d)})}function kx(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:ee},next:null};var i={};return s.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:i},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function Nx(n){var s=kx(n);s.next===null&&(s=n.alternate.memoizedState),gi(n,s.next.queue,{},nr())}function jf(){return yn(Di)}function Ex(){return Xt().memoizedState}function Cx(){return Xt().memoizedState}function US(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var i=nr();n=Ha(i);var d=qa(s,n,i);d!==null&&(Fn(d,s,i),di(d,s,i)),s={cache:Jd()},n.payload=s;return}s=s.return}}function PS(n,s,i){var d=nr();i={lane:d,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},wc(n)?Tx(s,i):(i=Pd(n,s,i,d),i!==null&&(Fn(i,n,d),Ax(i,s,d)))}function Rx(n,s,i){var d=nr();gi(n,s,i,d)}function gi(n,s,i,d){var g={lane:d,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(wc(n))Tx(s,g);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var j=s.lastRenderedState,C=y(j,i);if(g.hasEagerState=!0,g.eagerState=C,Qn(C,j))return nc(n,s,g,0),jt===null&&tc(),!1}catch{}if(i=Pd(n,s,g,d),i!==null)return Fn(i,n,d),Ax(i,s,d),!0}return!1}function kf(n,s,i,d){if(d={lane:2,revertLane:rp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},wc(n)){if(s)throw Error(a(479))}else s=Pd(n,i,d,2),s!==null&&Fn(s,n,2)}function wc(n){var s=n.alternate;return n===Je||s!==null&&s===Je}function Tx(n,s){po=mc=!0;var i=n.pending;i===null?s.next=s:(s.next=i.next,i.next=s),n.pending=s}function Ax(n,s,i){if((i&4194048)!==0){var d=s.lanes;d&=n.pendingLanes,i|=d,s.lanes=i,Ma(n,i)}}var xi={readContext:yn,use:yc,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt};xi.useEffectEvent=qt;var Lx={readContext:yn,use:yc,useCallback:function(n,s){return Ln().memoizedState=[n,s===void 0?null:s],n},useContext:yn,useEffect:mx,useImperativeHandle:function(n,s,i){i=i!=null?i.concat([n]):null,vc(4194308,4,bx.bind(null,s,n),i)},useLayoutEffect:function(n,s){return vc(4194308,4,n,s)},useInsertionEffect:function(n,s){vc(4,2,n,s)},useMemo:function(n,s){var i=Ln();s=s===void 0?null:s;var d=n();if(Ns){Et(!0);try{n()}finally{Et(!1)}}return i.memoizedState=[d,s],d},useReducer:function(n,s,i){var d=Ln();if(i!==void 0){var g=i(s);if(Ns){Et(!0);try{i(s)}finally{Et(!1)}}}else g=s;return d.memoizedState=d.baseState=g,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:g},d.queue=n,n=n.dispatch=PS.bind(null,Je,n),[d.memoizedState,n]},useRef:function(n){var s=Ln();return n={current:n},s.memoizedState=n},useState:function(n){n=yf(n);var s=n.queue,i=Rx.bind(null,Je,s);return s.dispatch=i,[n.memoizedState,i]},useDebugValue:_f,useDeferredValue:function(n,s){var i=Ln();return wf(i,n,s)},useTransition:function(){var n=yf(!1);return n=jx.bind(null,Je,n.queue,!0,!1),Ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,i){var d=Je,g=Ln();if(ut){if(i===void 0)throw Error(a(407));i=i()}else{if(i=s(),jt===null)throw Error(a(349));(lt&127)!==0||Wg(d,s,i)}g.memoizedState=i;var y={value:i,getSnapshot:s};return g.queue=y,mx(tx.bind(null,d,y,n),[n]),d.flags|=2048,mo(9,{destroy:void 0},ex.bind(null,d,y,i,s),null),i},useId:function(){var n=Ln(),s=jt.identifierPrefix;if(ut){var i=Pr,d=Ur;i=(d&~(1<<32-Pt(d)-1)).toString(32)+i,s="_"+s+"R_"+i,i=gc++,0<i&&(s+="H"+i.toString(32)),s+="_"}else i=OS++,s="_"+s+"r_"+i.toString(32)+"_";return n.memoizedState=s},useHostTransitionStatus:jf,useFormState:ux,useActionState:ux,useOptimistic:function(n){var s=Ln();s.memoizedState=s.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=i,s=kf.bind(null,Je,!0,i),i.dispatch=s,[n,s]},useMemoCache:mf,useCacheRefresh:function(){return Ln().memoizedState=US.bind(null,Je)},useEffectEvent:function(n){var s=Ln(),i={impl:n};return s.memoizedState=i,function(){if((mt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},Nf={readContext:yn,use:yc,useCallback:_x,useContext:yn,useEffect:vf,useImperativeHandle:vx,useInsertionEffect:xx,useLayoutEffect:yx,useMemo:wx,useReducer:bc,useRef:hx,useState:function(){return bc(ma)},useDebugValue:_f,useDeferredValue:function(n,s){var i=Xt();return Sx(i,bt.memoizedState,n,s)},useTransition:function(){var n=bc(ma)[0],s=Xt().memoizedState;return[typeof n=="boolean"?n:mi(n),s]},useSyncExternalStore:Jg,useId:Ex,useHostTransitionStatus:jf,useFormState:dx,useActionState:dx,useOptimistic:function(n,s){var i=Xt();return ax(i,bt,n,s)},useMemoCache:mf,useCacheRefresh:Cx};Nf.useEffectEvent=gx;var Dx={readContext:yn,use:yc,useCallback:_x,useContext:yn,useEffect:vf,useImperativeHandle:vx,useInsertionEffect:xx,useLayoutEffect:yx,useMemo:wx,useReducer:xf,useRef:hx,useState:function(){return xf(ma)},useDebugValue:_f,useDeferredValue:function(n,s){var i=Xt();return bt===null?wf(i,n,s):Sx(i,bt.memoizedState,n,s)},useTransition:function(){var n=xf(ma)[0],s=Xt().memoizedState;return[typeof n=="boolean"?n:mi(n),s]},useSyncExternalStore:Jg,useId:Ex,useHostTransitionStatus:jf,useFormState:px,useActionState:px,useOptimistic:function(n,s){var i=Xt();return bt!==null?ax(i,bt,n,s):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:mf,useCacheRefresh:Cx};Dx.useEffectEvent=gx;function Ef(n,s,i,d){s=n.memoizedState,i=i(d,s),i=i==null?s:x({},s,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var Cf={enqueueSetState:function(n,s,i){n=n._reactInternals;var d=nr(),g=Ha(d);g.payload=s,i!=null&&(g.callback=i),s=qa(n,g,d),s!==null&&(Fn(s,n,d),di(s,n,d))},enqueueReplaceState:function(n,s,i){n=n._reactInternals;var d=nr(),g=Ha(d);g.tag=1,g.payload=s,i!=null&&(g.callback=i),s=qa(n,g,d),s!==null&&(Fn(s,n,d),di(s,n,d))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var i=nr(),d=Ha(i);d.tag=2,s!=null&&(d.callback=s),s=qa(n,d,i),s!==null&&(Fn(s,n,i),di(s,n,i))}};function Ox(n,s,i,d,g,y,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,y,j):s.prototype&&s.prototype.isPureReactComponent?!ri(i,d)||!ri(g,y):!0}function Mx(n,s,i,d){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(i,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(i,d),s.state!==n&&Cf.enqueueReplaceState(s,s.state,null)}function Es(n,s){var i=s;if("ref"in s){i={};for(var d in s)d!=="ref"&&(i[d]=s[d])}if(n=n.defaultProps){i===s&&(i=x({},i));for(var g in n)i[g]===void 0&&(i[g]=n[g])}return i}function zx(n){ec(n)}function $x(n){console.error(n)}function Bx(n){ec(n)}function Sc(n,s){try{var i=n.onUncaughtError;i(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function Ix(n,s,i){try{var d=n.onCaughtError;d(i.value,{componentStack:i.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Rf(n,s,i){return i=Ha(i),i.tag=3,i.payload={element:null},i.callback=function(){Sc(n,s)},i}function Ux(n){return n=Ha(n),n.tag=3,n}function Px(n,s,i,d){var g=i.type.getDerivedStateFromError;if(typeof g=="function"){var y=d.value;n.payload=function(){return g(y)},n.callback=function(){Ix(s,i,d)}}var j=i.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){Ix(s,i,d),typeof g!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var C=d.stack;this.componentDidCatch(d.value,{componentStack:C!==null?C:""})})}function HS(n,s,i,d,g){if(i.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=i.alternate,s!==null&&oo(s,i,g,!0),i=Jn.current,i!==null){switch(i.tag){case 31:case 13:return xr===null?Mc():i.alternate===null&&Ft===0&&(Ft=3),i.flags&=-257,i.flags|=65536,i.lanes=g,d===uc?i.flags|=16384:(s=i.updateQueue,s===null?i.updateQueue=new Set([d]):s.add(d),ep(n,d,g)),!1;case 22:return i.flags|=65536,d===uc?i.flags|=16384:(s=i.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},i.updateQueue=s):(i=s.retryQueue,i===null?s.retryQueue=new Set([d]):i.add(d)),ep(n,d,g)),!1}throw Error(a(435,i.tag))}return ep(n,d,g),Mc(),!1}if(ut)return s=Jn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=g,d!==Yd&&(n=Error(a(422),{cause:d}),oi(pr(n,i)))):(d!==Yd&&(s=Error(a(423),{cause:d}),oi(pr(s,i))),n=n.current.alternate,n.flags|=65536,g&=-g,n.lanes|=g,d=pr(d,i),g=Rf(n.stateNode,d,g),af(n,g),Ft!==4&&(Ft=2)),!1;var y=Error(a(520),{cause:d});if(y=pr(y,i),ki===null?ki=[y]:ki.push(y),Ft!==4&&(Ft=2),s===null)return!0;d=pr(d,i),i=s;do{switch(i.tag){case 3:return i.flags|=65536,n=g&-g,i.lanes|=n,n=Rf(i.stateNode,d,n),af(i,n),!1;case 1:if(s=i.type,y=i.stateNode,(i.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Xa===null||!Xa.has(y))))return i.flags|=65536,g&=-g,i.lanes|=g,g=Ux(g),Px(g,n,i,d),af(i,g),!1}i=i.return}while(i!==null);return!1}var Tf=Error(a(461)),tn=!1;function bn(n,s,i,d){s.child=n===null?Gg(s,null,i,d):ks(s,n.child,i,d)}function Hx(n,s,i,d,g){i=i.render;var y=s.ref;if("ref"in d){var j={};for(var C in d)C!=="ref"&&(j[C]=d[C])}else j=d;return _s(s),d=df(n,s,i,j,y,g),C=ff(),n!==null&&!tn?(pf(n,s,g),ga(n,s,g)):(ut&&C&&Gd(s),s.flags|=1,bn(n,s,d,g),s.child)}function qx(n,s,i,d,g){if(n===null){var y=i.type;return typeof y=="function"&&!Hd(y)&&y.defaultProps===void 0&&i.compare===null?(s.tag=15,s.type=y,Fx(n,s,y,d,g)):(n=ac(i.type,null,d,s,s.mode,g),n.ref=s.ref,n.return=s,s.child=n)}if(y=n.child,!Bf(n,g)){var j=y.memoizedProps;if(i=i.compare,i=i!==null?i:ri,i(j,d)&&n.ref===s.ref)return ga(n,s,g)}return s.flags|=1,n=ua(y,d),n.ref=s.ref,n.return=s,s.child=n}function Fx(n,s,i,d,g){if(n!==null){var y=n.memoizedProps;if(ri(y,d)&&n.ref===s.ref)if(tn=!1,s.pendingProps=d=y,Bf(n,g))(n.flags&131072)!==0&&(tn=!0);else return s.lanes=n.lanes,ga(n,s,g)}return Af(n,s,i,d,g)}function Gx(n,s,i,d){var g=d.children,y=n!==null?n.memoizedState:null;if(n===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|i:i,n!==null){for(d=s.child=n.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~y}else d=0,s.child=null;return Vx(n,s,y,i,d)}if((i&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&lc(s,y!==null?y.cachePool:null),y!==null?Kg(s,y):of(),Xg(s);else return d=s.lanes=536870912,Vx(n,s,y!==null?y.baseLanes|i:i,i,d)}else y!==null?(lc(s,y.cachePool),Kg(s,y),Ga(),s.memoizedState=null):(n!==null&&lc(s,null),of(),Ga());return bn(n,s,g,i),s.child}function yi(n,s){return n!==null&&n.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Vx(n,s,i,d,g){var y=ef();return y=y===null?null:{parent:Wt._currentValue,pool:y},s.memoizedState={baseLanes:i,cachePool:y},n!==null&&lc(s,null),of(),Xg(s),n!==null&&oo(n,s,d,!0),s.childLanes=g,null}function jc(n,s){return s=Nc({mode:s.mode,children:s.children},n.mode),s.ref=n.ref,n.child=s,s.return=n,s}function Yx(n,s,i){return ks(s,n.child,null,i),n=jc(s,s.pendingProps),n.flags|=2,Wn(s),s.memoizedState=null,n}function qS(n,s,i){var d=s.pendingProps,g=(s.flags&128)!==0;if(s.flags&=-129,n===null){if(ut){if(d.mode==="hidden")return n=jc(s,d),s.lanes=536870912,yi(null,n);if(cf(s),(n=Mt)?(n=sb(n,gr),n=n!==null&&n.data==="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:$a!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},i=Tg(n),i.return=s,s.child=i,xn=s,Mt=null)):n=null,n===null)throw Ia(s);return s.lanes=536870912,null}return jc(s,d)}var y=n.memoizedState;if(y!==null){var j=y.dehydrated;if(cf(s),g)if(s.flags&256)s.flags&=-257,s=Yx(n,s,i);else if(s.memoizedState!==null)s.child=n.child,s.flags|=128,s=null;else throw Error(a(558));else if(tn||oo(n,s,i,!1),g=(i&n.childLanes)!==0,tn||g){if(d=jt,d!==null&&(j=I(d,i),j!==0&&j!==y.retryLane))throw y.retryLane=j,xs(n,j),Fn(d,n,j),Tf;Mc(),s=Yx(n,s,i)}else n=y.treeContext,Mt=yr(j.nextSibling),xn=s,ut=!0,Ba=null,gr=!1,n!==null&&Dg(s,n),s=jc(s,d),s.flags|=4096;return s}return n=ua(n.child,{mode:d.mode,children:d.children}),n.ref=s.ref,s.child=n,n.return=s,n}function kc(n,s){var i=s.ref;if(i===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(n===null||n.ref!==i)&&(s.flags|=4194816)}}function Af(n,s,i,d,g){return _s(s),i=df(n,s,i,d,void 0,g),d=ff(),n!==null&&!tn?(pf(n,s,g),ga(n,s,g)):(ut&&d&&Gd(s),s.flags|=1,bn(n,s,i,g),s.child)}function Kx(n,s,i,d,g,y){return _s(s),s.updateQueue=null,i=Zg(s,d,i,g),Qg(n),d=ff(),n!==null&&!tn?(pf(n,s,y),ga(n,s,y)):(ut&&d&&Gd(s),s.flags|=1,bn(n,s,i,y),s.child)}function Xx(n,s,i,d,g){if(_s(s),s.stateNode===null){var y=no,j=i.contextType;typeof j=="object"&&j!==null&&(y=yn(j)),y=new i(d,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Cf,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=d,y.state=s.memoizedState,y.refs={},nf(s),j=i.contextType,y.context=typeof j=="object"&&j!==null?yn(j):no,y.state=s.memoizedState,j=i.getDerivedStateFromProps,typeof j=="function"&&(Ef(s,i,j,d),y.state=s.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(j=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),j!==y.state&&Cf.enqueueReplaceState(y,y.state,null),pi(s,d,y,g),fi(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(n===null){y=s.stateNode;var C=s.memoizedProps,U=Es(i,C);y.props=U;var X=y.context,ie=i.contextType;j=no,typeof ie=="object"&&ie!==null&&(j=yn(ie));var pe=i.getDerivedStateFromProps;ie=typeof pe=="function"||typeof y.getSnapshotBeforeUpdate=="function",C=s.pendingProps!==C,ie||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(C||X!==j)&&Mx(s,y,d,j),Pa=!1;var Q=s.memoizedState;y.state=Q,pi(s,d,y,g),fi(),X=s.memoizedState,C||Q!==X||Pa?(typeof pe=="function"&&(Ef(s,i,pe,d),X=s.memoizedState),(U=Pa||Ox(s,i,U,d,Q,X,j))?(ie||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=X),y.props=d,y.state=X,y.context=j,d=U):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{y=s.stateNode,rf(n,s),j=s.memoizedProps,ie=Es(i,j),y.props=ie,pe=s.pendingProps,Q=y.context,X=i.contextType,U=no,typeof X=="object"&&X!==null&&(U=yn(X)),C=i.getDerivedStateFromProps,(X=typeof C=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(j!==pe||Q!==U)&&Mx(s,y,d,U),Pa=!1,Q=s.memoizedState,y.state=Q,pi(s,d,y,g),fi();var te=s.memoizedState;j!==pe||Q!==te||Pa||n!==null&&n.dependencies!==null&&oc(n.dependencies)?(typeof C=="function"&&(Ef(s,i,C,d),te=s.memoizedState),(ie=Pa||Ox(s,i,ie,d,Q,te,U)||n!==null&&n.dependencies!==null&&oc(n.dependencies))?(X||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,te,U),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,te,U)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||j===n.memoizedProps&&Q===n.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Q===n.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=te),y.props=d,y.state=te,y.context=U,d=ie):(typeof y.componentDidUpdate!="function"||j===n.memoizedProps&&Q===n.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Q===n.memoizedState||(s.flags|=1024),d=!1)}return y=d,kc(n,s),d=(s.flags&128)!==0,y||d?(y=s.stateNode,i=d&&typeof i.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,n!==null&&d?(s.child=ks(s,n.child,null,g),s.child=ks(s,null,i,g)):bn(n,s,i,g),s.memoizedState=y.state,n=s.child):n=ga(n,s,g),n}function Qx(n,s,i,d){return bs(),s.flags|=256,bn(n,s,i,d),s.child}var Lf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Df(n){return{baseLanes:n,cachePool:Ig()}}function Of(n,s,i){return n=n!==null?n.childLanes&~i:0,s&&(n|=tr),n}function Zx(n,s,i){var d=s.pendingProps,g=!1,y=(s.flags&128)!==0,j;if((j=y)||(j=n!==null&&n.memoizedState===null?!1:(Kt.current&2)!==0),j&&(g=!0,s.flags&=-129),j=(s.flags&32)!==0,s.flags&=-33,n===null){if(ut){if(g?Fa(s):Ga(),(n=Mt)?(n=sb(n,gr),n=n!==null&&n.data!=="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:$a!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},i=Tg(n),i.return=s,s.child=i,xn=s,Mt=null)):n=null,n===null)throw Ia(s);return gp(n)?s.lanes=32:s.lanes=536870912,null}var C=d.children;return d=d.fallback,g?(Ga(),g=s.mode,C=Nc({mode:"hidden",children:C},g),d=ys(d,g,i,null),C.return=s,d.return=s,C.sibling=d,s.child=C,d=s.child,d.memoizedState=Df(i),d.childLanes=Of(n,j,i),s.memoizedState=Lf,yi(null,d)):(Fa(s),Mf(s,C))}var U=n.memoizedState;if(U!==null&&(C=U.dehydrated,C!==null)){if(y)s.flags&256?(Fa(s),s.flags&=-257,s=zf(n,s,i)):s.memoizedState!==null?(Ga(),s.child=n.child,s.flags|=128,s=null):(Ga(),C=d.fallback,g=s.mode,d=Nc({mode:"visible",children:d.children},g),C=ys(C,g,i,null),C.flags|=2,d.return=s,C.return=s,d.sibling=C,s.child=d,ks(s,n.child,null,i),d=s.child,d.memoizedState=Df(i),d.childLanes=Of(n,j,i),s.memoizedState=Lf,s=yi(null,d));else if(Fa(s),gp(C)){if(j=C.nextSibling&&C.nextSibling.dataset,j)var X=j.dgst;j=X,d=Error(a(419)),d.stack="",d.digest=j,oi({value:d,source:null,stack:null}),s=zf(n,s,i)}else if(tn||oo(n,s,i,!1),j=(i&n.childLanes)!==0,tn||j){if(j=jt,j!==null&&(d=I(j,i),d!==0&&d!==U.retryLane))throw U.retryLane=d,xs(n,d),Fn(j,n,d),Tf;mp(C)||Mc(),s=zf(n,s,i)}else mp(C)?(s.flags|=192,s.child=n.child,s=null):(n=U.treeContext,Mt=yr(C.nextSibling),xn=s,ut=!0,Ba=null,gr=!1,n!==null&&Dg(s,n),s=Mf(s,d.children),s.flags|=4096);return s}return g?(Ga(),C=d.fallback,g=s.mode,U=n.child,X=U.sibling,d=ua(U,{mode:"hidden",children:d.children}),d.subtreeFlags=U.subtreeFlags&65011712,X!==null?C=ua(X,C):(C=ys(C,g,i,null),C.flags|=2),C.return=s,d.return=s,d.sibling=C,s.child=d,yi(null,d),d=s.child,C=n.child.memoizedState,C===null?C=Df(i):(g=C.cachePool,g!==null?(U=Wt._currentValue,g=g.parent!==U?{parent:U,pool:U}:g):g=Ig(),C={baseLanes:C.baseLanes|i,cachePool:g}),d.memoizedState=C,d.childLanes=Of(n,j,i),s.memoizedState=Lf,yi(n.child,d)):(Fa(s),i=n.child,n=i.sibling,i=ua(i,{mode:"visible",children:d.children}),i.return=s,i.sibling=null,n!==null&&(j=s.deletions,j===null?(s.deletions=[n],s.flags|=16):j.push(n)),s.child=i,s.memoizedState=null,i)}function Mf(n,s){return s=Nc({mode:"visible",children:s},n.mode),s.return=n,n.child=s}function Nc(n,s){return n=Zn(22,n,null,s),n.lanes=0,n}function zf(n,s,i){return ks(s,n.child,null,i),n=Mf(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function Jx(n,s,i){n.lanes|=s;var d=n.alternate;d!==null&&(d.lanes|=s),Qd(n.return,s,i)}function $f(n,s,i,d,g,y){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:i,tailMode:g,treeForkCount:y}:(j.isBackwards=s,j.rendering=null,j.renderingStartTime=0,j.last=d,j.tail=i,j.tailMode=g,j.treeForkCount=y)}function Wx(n,s,i){var d=s.pendingProps,g=d.revealOrder,y=d.tail;d=d.children;var j=Kt.current,C=(j&2)!==0;if(C?(j=j&1|2,s.flags|=128):j&=1,re(Kt,j),bn(n,s,d,i),d=ut?si:0,!C&&n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Jx(n,i,s);else if(n.tag===19)Jx(n,i,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(g){case"forwards":for(i=s.child,g=null;i!==null;)n=i.alternate,n!==null&&hc(n)===null&&(g=i),i=i.sibling;i=g,i===null?(g=s.child,s.child=null):(g=i.sibling,i.sibling=null),$f(s,!1,g,i,y,d);break;case"backwards":case"unstable_legacy-backwards":for(i=null,g=s.child,s.child=null;g!==null;){if(n=g.alternate,n!==null&&hc(n)===null){s.child=g;break}n=g.sibling,g.sibling=i,i=g,g=n}$f(s,!0,i,null,y,d);break;case"together":$f(s,!1,null,null,void 0,d);break;default:s.memoizedState=null}return s.child}function ga(n,s,i){if(n!==null&&(s.dependencies=n.dependencies),Ka|=s.lanes,(i&s.childLanes)===0)if(n!==null){if(oo(n,s,i,!1),(i&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(a(153));if(s.child!==null){for(n=s.child,i=ua(n,n.pendingProps),s.child=i,i.return=s;n.sibling!==null;)n=n.sibling,i=i.sibling=ua(n,n.pendingProps),i.return=s;i.sibling=null}return s.child}function Bf(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&oc(n)))}function FS(n,s,i){switch(s.tag){case 3:Fe(s,s.stateNode.containerInfo),Ua(s,Wt,n.memoizedState.cache),bs();break;case 27:case 5:be(s);break;case 4:Fe(s,s.stateNode.containerInfo);break;case 10:Ua(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,cf(s),null;break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(Fa(s),s.flags|=128,null):(i&s.child.childLanes)!==0?Zx(n,s,i):(Fa(s),n=ga(n,s,i),n!==null?n.sibling:null);Fa(s);break;case 19:var g=(n.flags&128)!==0;if(d=(i&s.childLanes)!==0,d||(oo(n,s,i,!1),d=(i&s.childLanes)!==0),g){if(d)return Wx(n,s,i);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),re(Kt,Kt.current),d)break;return null;case 22:return s.lanes=0,Gx(n,s,i,s.pendingProps);case 24:Ua(s,Wt,n.memoizedState.cache)}return ga(n,s,i)}function ey(n,s,i){if(n!==null)if(n.memoizedProps!==s.pendingProps)tn=!0;else{if(!Bf(n,i)&&(s.flags&128)===0)return tn=!1,FS(n,s,i);tn=(n.flags&131072)!==0}else tn=!1,ut&&(s.flags&1048576)!==0&&Lg(s,si,s.index);switch(s.lanes=0,s.tag){case 16:e:{var d=s.pendingProps;if(n=Ss(s.elementType),s.type=n,typeof n=="function")Hd(n)?(d=Es(n,d),s.tag=1,s=Xx(null,s,n,d,i)):(s.tag=0,s=Af(null,s,n,d,i));else{if(n!=null){var g=n.$$typeof;if(g===D){s.tag=11,s=Hx(null,s,n,d,i);break e}else if(g===z){s.tag=14,s=qx(null,s,n,d,i);break e}}throw s=M(n)||n,Error(a(306,s,""))}}return s;case 0:return Af(n,s,s.type,s.pendingProps,i);case 1:return d=s.type,g=Es(d,s.pendingProps),Xx(n,s,d,g,i);case 3:e:{if(Fe(s,s.stateNode.containerInfo),n===null)throw Error(a(387));d=s.pendingProps;var y=s.memoizedState;g=y.element,rf(n,s),pi(s,d,null,i);var j=s.memoizedState;if(d=j.cache,Ua(s,Wt,d),d!==y.cache&&Zd(s,[Wt],i,!0),fi(),d=j.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:j.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=Qx(n,s,d,i);break e}else if(d!==g){g=pr(Error(a(424)),s),oi(g),s=Qx(n,s,d,i);break e}else for(n=s.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Mt=yr(n.firstChild),xn=s,ut=!0,Ba=null,gr=!0,i=Gg(s,null,d,i),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(bs(),d===g){s=ga(n,s,i);break e}bn(n,s,d,i)}s=s.child}return s;case 26:return kc(n,s),n===null?(i=db(s.type,null,s.pendingProps,null))?s.memoizedState=i:ut||(i=s.type,n=s.pendingProps,d=Hc(ge.current).createElement(i),d[je]=s,d[ke]=n,vn(d,i,n),it(d),s.stateNode=d):s.memoizedState=db(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return be(s),n===null&&ut&&(d=s.stateNode=lb(s.type,s.pendingProps,ge.current),xn=s,gr=!0,g=Mt,Wa(s.type)?(xp=g,Mt=yr(d.firstChild)):Mt=g),bn(n,s,s.pendingProps.children,i),kc(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&ut&&((g=d=Mt)&&(d=vj(d,s.type,s.pendingProps,gr),d!==null?(s.stateNode=d,xn=s,Mt=yr(d.firstChild),gr=!1,g=!0):g=!1),g||Ia(s)),be(s),g=s.type,y=s.pendingProps,j=n!==null?n.memoizedProps:null,d=y.children,fp(g,y)?d=null:j!==null&&fp(g,j)&&(s.flags|=32),s.memoizedState!==null&&(g=df(n,s,MS,null,null,i),Di._currentValue=g),kc(n,s),bn(n,s,d,i),s.child;case 6:return n===null&&ut&&((n=i=Mt)&&(i=_j(i,s.pendingProps,gr),i!==null?(s.stateNode=i,xn=s,Mt=null,n=!0):n=!1),n||Ia(s)),null;case 13:return Zx(n,s,i);case 4:return Fe(s,s.stateNode.containerInfo),d=s.pendingProps,n===null?s.child=ks(s,null,d,i):bn(n,s,d,i),s.child;case 11:return Hx(n,s,s.type,s.pendingProps,i);case 7:return bn(n,s,s.pendingProps,i),s.child;case 8:return bn(n,s,s.pendingProps.children,i),s.child;case 12:return bn(n,s,s.pendingProps.children,i),s.child;case 10:return d=s.pendingProps,Ua(s,s.type,d.value),bn(n,s,d.children,i),s.child;case 9:return g=s.type._context,d=s.pendingProps.children,_s(s),g=yn(g),d=d(g),s.flags|=1,bn(n,s,d,i),s.child;case 14:return qx(n,s,s.type,s.pendingProps,i);case 15:return Fx(n,s,s.type,s.pendingProps,i);case 19:return Wx(n,s,i);case 31:return qS(n,s,i);case 22:return Gx(n,s,i,s.pendingProps);case 24:return _s(s),d=yn(Wt),n===null?(g=ef(),g===null&&(g=jt,y=Jd(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=i),g=y),s.memoizedState={parent:d,cache:g},nf(s),Ua(s,Wt,g)):((n.lanes&i)!==0&&(rf(n,s),pi(s,null,null,i),fi()),g=n.memoizedState,y=s.memoizedState,g.parent!==d?(g={parent:d,cache:d},s.memoizedState=g,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=g),Ua(s,Wt,d)):(d=y.cache,Ua(s,Wt,d),d!==g.cache&&Zd(s,[Wt],i,!0))),bn(n,s,s.pendingProps.children,i),s.child;case 29:throw s.pendingProps}throw Error(a(156,s.tag))}function xa(n){n.flags|=4}function If(n,s,i,d,g){if((s=(n.mode&32)!==0)&&(s=!1),s){if(n.flags|=16777216,(g&335544128)===g)if(n.stateNode.complete)n.flags|=8192;else if(Ey())n.flags|=8192;else throw js=uc,tf}else n.flags&=-16777217}function ty(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!gb(s))if(Ey())n.flags|=8192;else throw js=uc,tf}function Ec(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?oa():536870912,n.lanes|=s,bo|=s)}function bi(n,s){if(!ut)switch(n.tailMode){case"hidden":s=n.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var d=null;i!==null;)i.alternate!==null&&(d=i),i=i.sibling;d===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function zt(n){var s=n.alternate!==null&&n.alternate.child===n.child,i=0,d=0;if(s)for(var g=n.child;g!==null;)i|=g.lanes|g.childLanes,d|=g.subtreeFlags&65011712,d|=g.flags&65011712,g.return=n,g=g.sibling;else for(g=n.child;g!==null;)i|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=n,g=g.sibling;return n.subtreeFlags|=d,n.childLanes=i,s}function GS(n,s,i){var d=s.pendingProps;switch(Vd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(s),null;case 1:return zt(s),null;case 3:return i=s.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),pa(Wt),qe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(so(s)?xa(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Kd())),zt(s),null;case 26:var g=s.type,y=s.memoizedState;return n===null?(xa(s),y!==null?(zt(s),ty(s,y)):(zt(s),If(s,g,null,d,i))):y?y!==n.memoizedState?(xa(s),zt(s),ty(s,y)):(zt(s),s.flags&=-16777217):(n=n.memoizedProps,n!==d&&xa(s),zt(s),If(s,g,n,d,i)),null;case 27:if(fe(s),i=ge.current,g=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==d&&xa(s);else{if(!d){if(s.stateNode===null)throw Error(a(166));return zt(s),null}n=se.current,so(s)?Og(s):(n=lb(g,d,i),s.stateNode=n,xa(s))}return zt(s),null;case 5:if(fe(s),g=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==d&&xa(s);else{if(!d){if(s.stateNode===null)throw Error(a(166));return zt(s),null}if(y=se.current,so(s))Og(s);else{var j=Hc(ge.current);switch(y){case 1:y=j.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=j.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=j.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=j.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=j.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?j.createElement("select",{is:d.is}):j.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?j.createElement(g,{is:d.is}):j.createElement(g)}}y[je]=s,y[ke]=d;e:for(j=s.child;j!==null;){if(j.tag===5||j.tag===6)y.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===s)break e;for(;j.sibling===null;){if(j.return===null||j.return===s)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}s.stateNode=y;e:switch(vn(y,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&xa(s)}}return zt(s),If(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,i),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==d&&xa(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(a(166));if(n=ge.current,so(s)){if(n=s.stateNode,i=s.memoizedProps,d=null,g=xn,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}n[je]=s,n=!!(n.nodeValue===i||d!==null&&d.suppressHydrationWarning===!0||Zy(n.nodeValue,i)),n||Ia(s,!0)}else n=Hc(n).createTextNode(d),n[je]=s,s.stateNode=n}return zt(s),null;case 31:if(i=s.memoizedState,n===null||n.memoizedState!==null){if(d=so(s),i!==null){if(n===null){if(!d)throw Error(a(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[je]=s}else bs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;zt(s),n=!1}else i=Kd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return s.flags&256?(Wn(s),s):(Wn(s),null);if((s.flags&128)!==0)throw Error(a(558))}return zt(s),null;case 13:if(d=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(g=so(s),d!==null&&d.dehydrated!==null){if(n===null){if(!g)throw Error(a(318));if(g=s.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[je]=s}else bs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;zt(s),g=!1}else g=Kd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=g),g=!0;if(!g)return s.flags&256?(Wn(s),s):(Wn(s),null)}return Wn(s),(s.flags&128)!==0?(s.lanes=i,s):(i=d!==null,n=n!==null&&n.memoizedState!==null,i&&(d=s.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==g&&(d.flags|=2048)),i!==n&&i&&(s.child.flags|=8192),Ec(s,s.updateQueue),zt(s),null);case 4:return qe(),n===null&&ip(s.stateNode.containerInfo),zt(s),null;case 10:return pa(s.type),zt(s),null;case 19:if(V(Kt),d=s.memoizedState,d===null)return zt(s),null;if(g=(s.flags&128)!==0,y=d.rendering,y===null)if(g)bi(d,!1);else{if(Ft!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(y=hc(n),y!==null){for(s.flags|=128,bi(d,!1),n=y.updateQueue,s.updateQueue=n,Ec(s,n),s.subtreeFlags=0,n=i,i=s.child;i!==null;)Rg(i,n),i=i.sibling;return re(Kt,Kt.current&1|2),ut&&da(s,d.treeForkCount),s.child}n=n.sibling}d.tail!==null&&Ht()>Lc&&(s.flags|=128,g=!0,bi(d,!1),s.lanes=4194304)}else{if(!g)if(n=hc(y),n!==null){if(s.flags|=128,g=!0,n=n.updateQueue,s.updateQueue=n,Ec(s,n),bi(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!ut)return zt(s),null}else 2*Ht()-d.renderingStartTime>Lc&&i!==536870912&&(s.flags|=128,g=!0,bi(d,!1),s.lanes=4194304);d.isBackwards?(y.sibling=s.child,s.child=y):(n=d.last,n!==null?n.sibling=y:s.child=y,d.last=y)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Ht(),n.sibling=null,i=Kt.current,re(Kt,g?i&1|2:i&1),ut&&da(s,d.treeForkCount),n):(zt(s),null);case 22:case 23:return Wn(s),lf(),d=s.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(i&536870912)!==0&&(s.flags&128)===0&&(zt(s),s.subtreeFlags&6&&(s.flags|=8192)):zt(s),i=s.updateQueue,i!==null&&Ec(s,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==i&&(s.flags|=2048),n!==null&&V(ws),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),s.memoizedState.cache!==i&&(s.flags|=2048),pa(Wt),zt(s),null;case 25:return null;case 30:return null}throw Error(a(156,s.tag))}function VS(n,s){switch(Vd(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return pa(Wt),qe(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return fe(s),null;case 31:if(s.memoizedState!==null){if(Wn(s),s.alternate===null)throw Error(a(340));bs()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(Wn(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(a(340));bs()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return V(Kt),null;case 4:return qe(),null;case 10:return pa(s.type),null;case 22:case 23:return Wn(s),lf(),n!==null&&V(ws),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return pa(Wt),null;case 25:return null;default:return null}}function ny(n,s){switch(Vd(s),s.tag){case 3:pa(Wt),qe();break;case 26:case 27:case 5:fe(s);break;case 4:qe();break;case 31:s.memoizedState!==null&&Wn(s);break;case 13:Wn(s);break;case 19:V(Kt);break;case 10:pa(s.type);break;case 22:case 23:Wn(s),lf(),n!==null&&V(ws);break;case 24:pa(Wt)}}function vi(n,s){try{var i=s.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var g=d.next;i=g;do{if((i.tag&n)===n){d=void 0;var y=i.create,j=i.inst;d=y(),j.destroy=d}i=i.next}while(i!==g)}}catch(C){yt(s,s.return,C)}}function Va(n,s,i){try{var d=s.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var y=g.next;d=y;do{if((d.tag&n)===n){var j=d.inst,C=j.destroy;if(C!==void 0){j.destroy=void 0,g=s;var U=i,X=C;try{X()}catch(ie){yt(g,U,ie)}}}d=d.next}while(d!==y)}}catch(ie){yt(s,s.return,ie)}}function ry(n){var s=n.updateQueue;if(s!==null){var i=n.stateNode;try{Yg(s,i)}catch(d){yt(n,n.return,d)}}}function ay(n,s,i){i.props=Es(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(d){yt(n,s,d)}}function _i(n,s){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof i=="function"?n.refCleanup=i(d):i.current=d}}catch(g){yt(n,s,g)}}function Hr(n,s){var i=n.ref,d=n.refCleanup;if(i!==null)if(typeof d=="function")try{d()}catch(g){yt(n,s,g)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(g){yt(n,s,g)}else i.current=null}function sy(n){var s=n.type,i=n.memoizedProps,d=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":i.autoFocus&&d.focus();break e;case"img":i.src?d.src=i.src:i.srcSet&&(d.srcset=i.srcSet)}}catch(g){yt(n,n.return,g)}}function Uf(n,s,i){try{var d=n.stateNode;hj(d,n.type,i,s),d[ke]=s}catch(g){yt(n,n.return,g)}}function oy(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Wa(n.type)||n.tag===4}function Pf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||oy(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&&Wa(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 Hf(n,s,i){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,s):(s=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,s.appendChild(n),i=i._reactRootContainer,i!=null||s.onclick!==null||(s.onclick=la));else if(d!==4&&(d===27&&Wa(n.type)&&(i=n.stateNode,s=null),n=n.child,n!==null))for(Hf(n,s,i),n=n.sibling;n!==null;)Hf(n,s,i),n=n.sibling}function Cc(n,s,i){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?i.insertBefore(n,s):i.appendChild(n);else if(d!==4&&(d===27&&Wa(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(Cc(n,s,i),n=n.sibling;n!==null;)Cc(n,s,i),n=n.sibling}function iy(n){var s=n.stateNode,i=n.memoizedProps;try{for(var d=n.type,g=s.attributes;g.length;)s.removeAttributeNode(g[0]);vn(s,d,i),s[je]=n,s[ke]=i}catch(y){yt(n,n.return,y)}}var ya=!1,nn=!1,qf=!1,ly=typeof WeakSet=="function"?WeakSet:Set,fn=null;function YS(n,s){if(n=n.containerInfo,up=Xc,n=vg(n),Md(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var d=i.getSelection&&i.getSelection();if(d&&d.rangeCount!==0){i=d.anchorNode;var g=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{i.nodeType,y.nodeType}catch{i=null;break e}var j=0,C=-1,U=-1,X=0,ie=0,pe=n,Q=null;t:for(;;){for(var te;pe!==i||g!==0&&pe.nodeType!==3||(C=j+g),pe!==y||d!==0&&pe.nodeType!==3||(U=j+d),pe.nodeType===3&&(j+=pe.nodeValue.length),(te=pe.firstChild)!==null;)Q=pe,pe=te;for(;;){if(pe===n)break t;if(Q===i&&++X===g&&(C=j),Q===y&&++ie===d&&(U=j),(te=pe.nextSibling)!==null)break;pe=Q,Q=pe.parentNode}pe=te}i=C===-1||U===-1?null:{start:C,end:U}}else i=null}i=i||{start:0,end:0}}else i=null;for(dp={focusedElem:n,selectionRange:i},Xc=!1,fn=s;fn!==null;)if(s=fn,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,fn=n;else for(;fn!==null;){switch(s=fn,y=s.alternate,n=s.flags,s.tag){case 0:if((n&4)!==0&&(n=s.updateQueue,n=n!==null?n.events:null,n!==null))for(i=0;i<n.length;i++)g=n[i],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&y!==null){n=void 0,i=s,g=y.memoizedProps,y=y.memoizedState,d=i.stateNode;try{var Ae=Es(i.type,g);n=d.getSnapshotBeforeUpdate(Ae,y),d.__reactInternalSnapshotBeforeUpdate=n}catch(Ye){yt(i,i.return,Ye)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,i=n.nodeType,i===9)hp(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":hp(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(a(163))}if(n=s.sibling,n!==null){n.return=s.return,fn=n;break}fn=s.return}}function cy(n,s,i){var d=i.flags;switch(i.tag){case 0:case 11:case 15:va(n,i),d&4&&vi(5,i);break;case 1:if(va(n,i),d&4)if(n=i.stateNode,s===null)try{n.componentDidMount()}catch(j){yt(i,i.return,j)}else{var g=Es(i.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(g,s,n.__reactInternalSnapshotBeforeUpdate)}catch(j){yt(i,i.return,j)}}d&64&&ry(i),d&512&&_i(i,i.return);break;case 3:if(va(n,i),d&64&&(n=i.updateQueue,n!==null)){if(s=null,i.child!==null)switch(i.child.tag){case 27:case 5:s=i.child.stateNode;break;case 1:s=i.child.stateNode}try{Yg(n,s)}catch(j){yt(i,i.return,j)}}break;case 27:s===null&&d&4&&iy(i);case 26:case 5:va(n,i),s===null&&d&4&&sy(i),d&512&&_i(i,i.return);break;case 12:va(n,i);break;case 31:va(n,i),d&4&&fy(n,i);break;case 13:va(n,i),d&4&&py(n,i),d&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=nj.bind(null,i),wj(n,i))));break;case 22:if(d=i.memoizedState!==null||ya,!d){s=s!==null&&s.memoizedState!==null||nn,g=ya;var y=nn;ya=d,(nn=s)&&!y?_a(n,i,(i.subtreeFlags&8772)!==0):va(n,i),ya=g,nn=y}break;case 30:break;default:va(n,i)}}function uy(n){var s=n.alternate;s!==null&&(n.alternate=null,uy(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&Ee(s)),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 Ut=null,Un=!1;function ba(n,s,i){for(i=i.child;i!==null;)dy(n,s,i),i=i.sibling}function dy(n,s,i){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(gn,i)}catch{}switch(i.tag){case 26:nn||Hr(i,s),ba(n,s,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:nn||Hr(i,s);var d=Ut,g=Un;Wa(i.type)&&(Ut=i.stateNode,Un=!1),ba(n,s,i),Ti(i.stateNode),Ut=d,Un=g;break;case 5:nn||Hr(i,s);case 6:if(d=Ut,g=Un,Ut=null,ba(n,s,i),Ut=d,Un=g,Ut!==null)if(Un)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(i.stateNode)}catch(y){yt(i,s,y)}else try{Ut.removeChild(i.stateNode)}catch(y){yt(i,s,y)}break;case 18:Ut!==null&&(Un?(n=Ut,rb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),Eo(n)):rb(Ut,i.stateNode));break;case 4:d=Ut,g=Un,Ut=i.stateNode.containerInfo,Un=!0,ba(n,s,i),Ut=d,Un=g;break;case 0:case 11:case 14:case 15:Va(2,i,s),nn||Va(4,i,s),ba(n,s,i);break;case 1:nn||(Hr(i,s),d=i.stateNode,typeof d.componentWillUnmount=="function"&&ay(i,s,d)),ba(n,s,i);break;case 21:ba(n,s,i);break;case 22:nn=(d=nn)||i.memoizedState!==null,ba(n,s,i),nn=d;break;default:ba(n,s,i)}}function fy(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Eo(n)}catch(i){yt(s,s.return,i)}}}function py(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Eo(n)}catch(i){yt(s,s.return,i)}}function KS(n){switch(n.tag){case 31:case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new ly),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new ly),s;default:throw Error(a(435,n.tag))}}function Rc(n,s){var i=KS(n);s.forEach(function(d){if(!i.has(d)){i.add(d);var g=rj.bind(null,n,d);d.then(g,g)}})}function Pn(n,s){var i=s.deletions;if(i!==null)for(var d=0;d<i.length;d++){var g=i[d],y=n,j=s,C=j;e:for(;C!==null;){switch(C.tag){case 27:if(Wa(C.type)){Ut=C.stateNode,Un=!1;break e}break;case 5:Ut=C.stateNode,Un=!1;break e;case 3:case 4:Ut=C.stateNode.containerInfo,Un=!0;break e}C=C.return}if(Ut===null)throw Error(a(160));dy(y,j,g),Ut=null,Un=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)hy(s,n),s=s.sibling}var Rr=null;function hy(n,s){var i=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Pn(s,n),Hn(n),d&4&&(Va(3,n,n.return),vi(3,n),Va(5,n,n.return));break;case 1:Pn(s,n),Hn(n),d&512&&(nn||i===null||Hr(i,i.return)),d&64&&ya&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?d:i.concat(d))));break;case 26:var g=Rr;if(Pn(s,n),Hn(n),d&512&&(nn||i===null||Hr(i,i.return)),d&4){var y=i!==null?i.memoizedState:null;if(d=n.memoizedState,i===null)if(d===null)if(n.stateNode===null){e:{d=n.type,i=n.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":y=g.getElementsByTagName("title")[0],(!y||y[ue]||y[je]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(d),g.head.insertBefore(y,g.querySelector("head > title"))),vn(y,d,i),y[je]=n,it(y),d=y;break e;case"link":var j=hb("link","href",g).get(d+(i.href||""));if(j){for(var C=0;C<j.length;C++)if(y=j[C],y.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&y.getAttribute("rel")===(i.rel==null?null:i.rel)&&y.getAttribute("title")===(i.title==null?null:i.title)&&y.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){j.splice(C,1);break t}}y=g.createElement(d),vn(y,d,i),g.head.appendChild(y);break;case"meta":if(j=hb("meta","content",g).get(d+(i.content||""))){for(C=0;C<j.length;C++)if(y=j[C],y.getAttribute("content")===(i.content==null?null:""+i.content)&&y.getAttribute("name")===(i.name==null?null:i.name)&&y.getAttribute("property")===(i.property==null?null:i.property)&&y.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&y.getAttribute("charset")===(i.charSet==null?null:i.charSet)){j.splice(C,1);break t}}y=g.createElement(d),vn(y,d,i),g.head.appendChild(y);break;default:throw Error(a(468,d))}y[je]=n,it(y),d=y}n.stateNode=d}else mb(g,n.type,n.stateNode);else n.stateNode=pb(g,d,n.memoizedProps);else y!==d?(y===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):y.count--,d===null?mb(g,n.type,n.stateNode):pb(g,d,n.memoizedProps)):d===null&&n.stateNode!==null&&Uf(n,n.memoizedProps,i.memoizedProps)}break;case 27:Pn(s,n),Hn(n),d&512&&(nn||i===null||Hr(i,i.return)),i!==null&&d&4&&Uf(n,n.memoizedProps,i.memoizedProps);break;case 5:if(Pn(s,n),Hn(n),d&512&&(nn||i===null||Hr(i,i.return)),n.flags&32){g=n.stateNode;try{Xs(g,"")}catch(Ae){yt(n,n.return,Ae)}}d&4&&n.stateNode!=null&&(g=n.memoizedProps,Uf(n,g,i!==null?i.memoizedProps:g)),d&1024&&(qf=!0);break;case 6:if(Pn(s,n),Hn(n),d&4){if(n.stateNode===null)throw Error(a(162));d=n.memoizedProps,i=n.stateNode;try{i.nodeValue=d}catch(Ae){yt(n,n.return,Ae)}}break;case 3:if(Gc=null,g=Rr,Rr=qc(s.containerInfo),Pn(s,n),Rr=g,Hn(n),d&4&&i!==null&&i.memoizedState.isDehydrated)try{Eo(s.containerInfo)}catch(Ae){yt(n,n.return,Ae)}qf&&(qf=!1,my(n));break;case 4:d=Rr,Rr=qc(n.stateNode.containerInfo),Pn(s,n),Hn(n),Rr=d;break;case 12:Pn(s,n),Hn(n);break;case 31:Pn(s,n),Hn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 13:Pn(s,n),Hn(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ac=Ht()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 22:g=n.memoizedState!==null;var U=i!==null&&i.memoizedState!==null,X=ya,ie=nn;if(ya=X||g,nn=ie||U,Pn(s,n),nn=ie,ya=X,Hn(n),d&8192)e:for(s=n.stateNode,s._visibility=g?s._visibility&-2:s._visibility|1,g&&(i===null||U||ya||nn||Cs(n)),i=null,s=n;;){if(s.tag===5||s.tag===26){if(i===null){U=i=s;try{if(y=U.stateNode,g)j=y.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{C=U.stateNode;var pe=U.memoizedProps.style,Q=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;C.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Ae){yt(U,U.return,Ae)}}}else if(s.tag===6){if(i===null){U=s;try{U.stateNode.nodeValue=g?"":U.memoizedProps}catch(Ae){yt(U,U.return,Ae)}}}else if(s.tag===18){if(i===null){U=s;try{var te=U.stateNode;g?ab(te,!0):ab(U.stateNode,!1)}catch(Ae){yt(U,U.return,Ae)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===n)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;i===s&&(i=null),s=s.return}i===s&&(i=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=n.updateQueue,d!==null&&(i=d.retryQueue,i!==null&&(d.retryQueue=null,Rc(n,i))));break;case 19:Pn(s,n),Hn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 30:break;case 21:break;default:Pn(s,n),Hn(n)}}function Hn(n){var s=n.flags;if(s&2){try{for(var i,d=n.return;d!==null;){if(oy(d)){i=d;break}d=d.return}if(i==null)throw Error(a(160));switch(i.tag){case 27:var g=i.stateNode,y=Pf(n);Cc(n,y,g);break;case 5:var j=i.stateNode;i.flags&32&&(Xs(j,""),i.flags&=-33);var C=Pf(n);Cc(n,C,j);break;case 3:case 4:var U=i.stateNode.containerInfo,X=Pf(n);Hf(n,X,U);break;default:throw Error(a(161))}}catch(ie){yt(n,n.return,ie)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function my(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;my(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}function va(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)cy(n,s.alternate,s),s=s.sibling}function Cs(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:Va(4,s,s.return),Cs(s);break;case 1:Hr(s,s.return);var i=s.stateNode;typeof i.componentWillUnmount=="function"&&ay(s,s.return,i),Cs(s);break;case 27:Ti(s.stateNode);case 26:case 5:Hr(s,s.return),Cs(s);break;case 22:s.memoizedState===null&&Cs(s);break;case 30:Cs(s);break;default:Cs(s)}n=n.sibling}}function _a(n,s,i){for(i=i&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,g=n,y=s,j=y.flags;switch(y.tag){case 0:case 11:case 15:_a(g,y,i),vi(4,y);break;case 1:if(_a(g,y,i),d=y,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(X){yt(d,d.return,X)}if(d=y,g=d.updateQueue,g!==null){var C=d.stateNode;try{var U=g.shared.hiddenCallbacks;if(U!==null)for(g.shared.hiddenCallbacks=null,g=0;g<U.length;g++)Vg(U[g],C)}catch(X){yt(d,d.return,X)}}i&&j&64&&ry(y),_i(y,y.return);break;case 27:iy(y);case 26:case 5:_a(g,y,i),i&&d===null&&j&4&&sy(y),_i(y,y.return);break;case 12:_a(g,y,i);break;case 31:_a(g,y,i),i&&j&4&&fy(g,y);break;case 13:_a(g,y,i),i&&j&4&&py(g,y);break;case 22:y.memoizedState===null&&_a(g,y,i),_i(y,y.return);break;case 30:break;default:_a(g,y,i)}s=s.sibling}}function Ff(n,s){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&ii(i))}function Gf(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&ii(n))}function Tr(n,s,i,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)gy(n,s,i,d),s=s.sibling}function gy(n,s,i,d){var g=s.flags;switch(s.tag){case 0:case 11:case 15:Tr(n,s,i,d),g&2048&&vi(9,s);break;case 1:Tr(n,s,i,d);break;case 3:Tr(n,s,i,d),g&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&ii(n)));break;case 12:if(g&2048){Tr(n,s,i,d),n=s.stateNode;try{var y=s.memoizedProps,j=y.id,C=y.onPostCommit;typeof C=="function"&&C(j,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(U){yt(s,s.return,U)}}else Tr(n,s,i,d);break;case 31:Tr(n,s,i,d);break;case 13:Tr(n,s,i,d);break;case 23:break;case 22:y=s.stateNode,j=s.alternate,s.memoizedState!==null?y._visibility&2?Tr(n,s,i,d):wi(n,s):y._visibility&2?Tr(n,s,i,d):(y._visibility|=2,go(n,s,i,d,(s.subtreeFlags&10256)!==0||!1)),g&2048&&Ff(j,s);break;case 24:Tr(n,s,i,d),g&2048&&Gf(s.alternate,s);break;default:Tr(n,s,i,d)}}function go(n,s,i,d,g){for(g=g&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=n,j=s,C=i,U=d,X=j.flags;switch(j.tag){case 0:case 11:case 15:go(y,j,C,U,g),vi(8,j);break;case 23:break;case 22:var ie=j.stateNode;j.memoizedState!==null?ie._visibility&2?go(y,j,C,U,g):wi(y,j):(ie._visibility|=2,go(y,j,C,U,g)),g&&X&2048&&Ff(j.alternate,j);break;case 24:go(y,j,C,U,g),g&&X&2048&&Gf(j.alternate,j);break;default:go(y,j,C,U,g)}s=s.sibling}}function wi(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var i=n,d=s,g=d.flags;switch(d.tag){case 22:wi(i,d),g&2048&&Ff(d.alternate,d);break;case 24:wi(i,d),g&2048&&Gf(d.alternate,d);break;default:wi(i,d)}s=s.sibling}}var Si=8192;function xo(n,s,i){if(n.subtreeFlags&Si)for(n=n.child;n!==null;)xy(n,s,i),n=n.sibling}function xy(n,s,i){switch(n.tag){case 26:xo(n,s,i),n.flags&Si&&n.memoizedState!==null&&Oj(i,Rr,n.memoizedState,n.memoizedProps);break;case 5:xo(n,s,i);break;case 3:case 4:var d=Rr;Rr=qc(n.stateNode.containerInfo),xo(n,s,i),Rr=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=Si,Si=16777216,xo(n,s,i),Si=d):xo(n,s,i));break;default:xo(n,s,i)}}function yy(n){var s=n.alternate;if(s!==null&&(n=s.child,n!==null)){s.child=null;do s=n.sibling,n.sibling=null,n=s;while(n!==null)}}function ji(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var d=s[i];fn=d,vy(d,n)}yy(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)by(n),n=n.sibling}function by(n){switch(n.tag){case 0:case 11:case 15:ji(n),n.flags&2048&&Va(9,n,n.return);break;case 3:ji(n);break;case 12:ji(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,Tc(n)):ji(n);break;default:ji(n)}}function Tc(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var d=s[i];fn=d,vy(d,n)}yy(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:Va(8,s,s.return),Tc(s);break;case 22:i=s.stateNode,i._visibility&2&&(i._visibility&=-3,Tc(s));break;default:Tc(s)}n=n.sibling}}function vy(n,s){for(;fn!==null;){var i=fn;switch(i.tag){case 0:case 11:case 15:Va(8,i,s);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var d=i.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:ii(i.memoizedState.cache)}if(d=i.child,d!==null)d.return=i,fn=d;else e:for(i=n;fn!==null;){d=fn;var g=d.sibling,y=d.return;if(uy(d),d===i){fn=null;break e}if(g!==null){g.return=y,fn=g;break e}fn=y}}}var XS={getCacheForType:function(n){var s=yn(Wt),i=s.data.get(n);return i===void 0&&(i=n(),s.data.set(n,i)),i},cacheSignal:function(){return yn(Wt).controller.signal}},QS=typeof WeakMap=="function"?WeakMap:Map,mt=0,jt=null,st=null,lt=0,xt=0,er=null,Ya=!1,yo=!1,Vf=!1,wa=0,Ft=0,Ka=0,Rs=0,Yf=0,tr=0,bo=0,ki=null,qn=null,Kf=!1,Ac=0,_y=0,Lc=1/0,Dc=null,Xa=null,sn=0,Qa=null,vo=null,Sa=0,Xf=0,Qf=null,wy=null,Ni=0,Zf=null;function nr(){return(mt&2)!==0&<!==0?lt&-lt:A.T!==null?rp():xe()}function Sy(){if(tr===0)if((lt&536870912)===0||ut){var n=Ue;Ue<<=1,(Ue&3932160)===0&&(Ue=262144),tr=n}else tr=536870912;return n=Jn.current,n!==null&&(n.flags|=32),tr}function Fn(n,s,i){(n===jt&&(xt===2||xt===9)||n.cancelPendingCommit!==null)&&(_o(n,0),Za(n,lt,tr,!1)),An(n,i),((mt&2)===0||n!==jt)&&(n===jt&&((mt&2)===0&&(Rs|=i),Ft===4&&Za(n,lt,tr,!1)),qr(n))}function jy(n,s,i){if((mt&6)!==0)throw Error(a(327));var d=!i&&(s&127)===0&&(s&n.expiredLanes)===0||Dt(n,s),g=d?WS(n,s):Wf(n,s,!0),y=d;do{if(g===0){yo&&!d&&Za(n,s,0,!1);break}else{if(i=n.current.alternate,y&&!ZS(i)){g=Wf(n,s,!1),y=!1;continue}if(g===2){if(y=s,n.errorRecoveryDisabledLanes&y)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){s=j;e:{var C=n;g=ki;var U=C.current.memoizedState.isDehydrated;if(U&&(_o(C,j).flags|=256),j=Wf(C,j,!1),j!==2){if(Vf&&!U){C.errorRecoveryDisabledLanes|=y,Rs|=y,g=4;break e}y=qn,qn=g,y!==null&&(qn===null?qn=y:qn.push.apply(qn,y))}g=j}if(y=!1,g!==2)continue}}if(g===1){_o(n,0),Za(n,s,0,!0);break}e:{switch(d=n,y=g,y){case 0:case 1:throw Error(a(345));case 4:if((s&4194048)!==s)break;case 6:Za(d,s,tr,!Ya);break e;case 2:qn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((s&62914560)===s&&(g=Ac+300-Ht(),10<g)){if(Za(d,s,tr,!Ya),Ct(d,0,!0)!==0)break e;Sa=s,d.timeoutHandle=tb(ky.bind(null,d,i,qn,Dc,Kf,s,tr,Rs,bo,Ya,y,"Throttled",-0,0),g);break e}ky(d,i,qn,Dc,Kf,s,tr,Rs,bo,Ya,y,null,-0,0)}}break}while(!0);qr(n)}function ky(n,s,i,d,g,y,j,C,U,X,ie,pe,Q,te){if(n.timeoutHandle=-1,pe=s.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},xy(s,y,pe);var Ae=(y&62914560)===y?Ac-Ht():(y&4194048)===y?_y-Ht():0;if(Ae=Mj(pe,Ae),Ae!==null){Sa=y,n.cancelPendingCommit=Ae(Dy.bind(null,n,s,y,i,d,g,j,C,U,ie,pe,null,Q,te)),Za(n,y,j,!X);return}}Dy(n,s,y,i,d,g,j,C,U)}function ZS(n){for(var s=n;;){var i=s.tag;if((i===0||i===11||i===15)&&s.flags&16384&&(i=s.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var d=0;d<i.length;d++){var g=i[d],y=g.getSnapshot;g=g.value;try{if(!Qn(y(),g))return!1}catch{return!1}}if(i=s.child,s.subtreeFlags&16384&&i!==null)i.return=s,s=i;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Za(n,s,i,d){s&=~Yf,s&=~Rs,n.suspendedLanes|=s,n.pingedLanes&=~s,d&&(n.warmLanes|=s),d=n.expirationTimes;for(var g=s;0<g;){var y=31-Pt(g),j=1<<y;d[y]=-1,g&=~j}i!==0&&ia(n,i,s)}function Oc(){return(mt&6)===0?(Ei(0),!1):!0}function Jf(){if(st!==null){if(xt===0)var n=st.return;else n=st,fa=vs=null,hf(n),uo=null,ci=0,n=st;for(;n!==null;)ny(n.alternate,n),n=n.return;st=null}}function _o(n,s){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,xj(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),Sa=0,Jf(),jt=n,st=i=ua(n.current,null),lt=s,xt=0,er=null,Ya=!1,yo=Dt(n,s),Vf=!1,bo=tr=Yf=Rs=Ka=Ft=0,qn=ki=null,Kf=!1,(s&8)!==0&&(s|=s&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=s;0<d;){var g=31-Pt(d),y=1<<g;s|=n[g],d&=~y}return wa=s,tc(),i}function Ny(n,s){Je=null,A.H=xi,s===co||s===cc?(s=Hg(),xt=3):s===tf?(s=Hg(),xt=4):xt=s===Tf?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,er=s,st===null&&(Ft=1,Sc(n,pr(s,n.current)))}function Ey(){var n=Jn.current;return n===null?!0:(lt&4194048)===lt?xr===null:(lt&62914560)===lt||(lt&536870912)!==0?n===xr:!1}function Cy(){var n=A.H;return A.H=xi,n===null?xi:n}function Ry(){var n=A.A;return A.A=XS,n}function Mc(){Ft=4,Ya||(lt&4194048)!==lt&&Jn.current!==null||(yo=!0),(Ka&134217727)===0&&(Rs&134217727)===0||jt===null||Za(jt,lt,tr,!1)}function Wf(n,s,i){var d=mt;mt|=2;var g=Cy(),y=Ry();(jt!==n||lt!==s)&&(Dc=null,_o(n,s)),s=!1;var j=Ft;e:do try{if(xt!==0&&st!==null){var C=st,U=er;switch(xt){case 8:Jf(),j=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(s=!0);var X=xt;if(xt=0,er=null,wo(n,C,U,X),i&&yo){j=0;break e}break;default:X=xt,xt=0,er=null,wo(n,C,U,X)}}JS(),j=Ft;break}catch(ie){Ny(n,ie)}while(!0);return s&&n.shellSuspendCounter++,fa=vs=null,mt=d,A.H=g,A.A=y,st===null&&(jt=null,lt=0,tc()),j}function JS(){for(;st!==null;)Ty(st)}function WS(n,s){var i=mt;mt|=2;var d=Cy(),g=Ry();jt!==n||lt!==s?(Dc=null,Lc=Ht()+500,_o(n,s)):yo=Dt(n,s);e:do try{if(xt!==0&&st!==null){s=st;var y=er;t:switch(xt){case 1:xt=0,er=null,wo(n,s,y,1);break;case 2:case 9:if(Ug(y)){xt=0,er=null,Ay(s);break}s=function(){xt!==2&&xt!==9||jt!==n||(xt=7),qr(n)},y.then(s,s);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:Ug(y)?(xt=0,er=null,Ay(s)):(xt=0,er=null,wo(n,s,y,7));break;case 5:var j=null;switch(st.tag){case 26:j=st.memoizedState;case 5:case 27:var C=st;if(j?gb(j):C.stateNode.complete){xt=0,er=null;var U=C.sibling;if(U!==null)st=U;else{var X=C.return;X!==null?(st=X,zc(X)):st=null}break t}}xt=0,er=null,wo(n,s,y,5);break;case 6:xt=0,er=null,wo(n,s,y,6);break;case 8:Jf(),Ft=6;break e;default:throw Error(a(462))}}ej();break}catch(ie){Ny(n,ie)}while(!0);return fa=vs=null,A.H=d,A.A=g,mt=i,st!==null?0:(jt=null,lt=0,tc(),Ft)}function ej(){for(;st!==null&&!cr();)Ty(st)}function Ty(n){var s=ey(n.alternate,n,wa);n.memoizedProps=n.pendingProps,s===null?zc(n):st=s}function Ay(n){var s=n,i=s.alternate;switch(s.tag){case 15:case 0:s=Kx(i,s,s.pendingProps,s.type,void 0,lt);break;case 11:s=Kx(i,s,s.pendingProps,s.type.render,s.ref,lt);break;case 5:hf(s);default:ny(i,s),s=st=Rg(s,wa),s=ey(i,s,wa)}n.memoizedProps=n.pendingProps,s===null?zc(n):st=s}function wo(n,s,i,d){fa=vs=null,hf(s),uo=null,ci=0;var g=s.return;try{if(HS(n,g,s,i,lt)){Ft=1,Sc(n,pr(i,n.current)),st=null;return}}catch(y){if(g!==null)throw st=g,y;Ft=1,Sc(n,pr(i,n.current)),st=null;return}s.flags&32768?(ut||d===1?n=!0:yo||(lt&536870912)!==0?n=!1:(Ya=n=!0,(d===2||d===9||d===3||d===6)&&(d=Jn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Ly(s,n)):zc(s)}function zc(n){var s=n;do{if((s.flags&32768)!==0){Ly(s,Ya);return}n=s.return;var i=GS(s.alternate,s,wa);if(i!==null){st=i;return}if(s=s.sibling,s!==null){st=s;return}st=s=n}while(s!==null);Ft===0&&(Ft=5)}function Ly(n,s){do{var i=VS(n.alternate,n);if(i!==null){i.flags&=32767,st=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!s&&(n=n.sibling,n!==null)){st=n;return}st=n=i}while(n!==null);Ft=6,st=null}function Dy(n,s,i,d,g,y,j,C,U){n.cancelPendingCommit=null;do $c();while(sn!==0);if((mt&6)!==0)throw Error(a(327));if(s!==null){if(s===n.current)throw Error(a(177));if(y=s.lanes|s.childLanes,y|=Ud,$r(n,i,y,j,C,U),n===jt&&(st=jt=null,lt=0),vo=s,Qa=n,Sa=i,Xf=y,Qf=g,wy=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,aj(We,function(){return By(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=A.T,A.T=null,g=F.p,F.p=2,j=mt,mt|=4;try{YS(n,s,i)}finally{mt=j,F.p=g,A.T=d}}sn=1,Oy(),My(),zy()}}function Oy(){if(sn===1){sn=0;var n=Qa,s=vo,i=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||i){i=A.T,A.T=null;var d=F.p;F.p=2;var g=mt;mt|=4;try{hy(s,n);var y=dp,j=vg(n.containerInfo),C=y.focusedElem,U=y.selectionRange;if(j!==C&&C&&C.ownerDocument&&bg(C.ownerDocument.documentElement,C)){if(U!==null&&Md(C)){var X=U.start,ie=U.end;if(ie===void 0&&(ie=X),"selectionStart"in C)C.selectionStart=X,C.selectionEnd=Math.min(ie,C.value.length);else{var pe=C.ownerDocument||document,Q=pe&&pe.defaultView||window;if(Q.getSelection){var te=Q.getSelection(),Ae=C.textContent.length,Ye=Math.min(U.start,Ae),_t=U.end===void 0?Ye:Math.min(U.end,Ae);!te.extend&&Ye>_t&&(j=_t,_t=Ye,Ye=j);var Y=yg(C,Ye),q=yg(C,_t);if(Y&&q&&(te.rangeCount!==1||te.anchorNode!==Y.node||te.anchorOffset!==Y.offset||te.focusNode!==q.node||te.focusOffset!==q.offset)){var K=pe.createRange();K.setStart(Y.node,Y.offset),te.removeAllRanges(),Ye>_t?(te.addRange(K),te.extend(q.node,q.offset)):(K.setEnd(q.node,q.offset),te.addRange(K))}}}}for(pe=[],te=C;te=te.parentNode;)te.nodeType===1&&pe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<pe.length;C++){var de=pe[C];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}Xc=!!up,dp=up=null}finally{mt=g,F.p=d,A.T=i}}n.current=s,sn=2}}function My(){if(sn===2){sn=0;var n=Qa,s=vo,i=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||i){i=A.T,A.T=null;var d=F.p;F.p=2;var g=mt;mt|=4;try{cy(n,s.alternate,s)}finally{mt=g,F.p=d,A.T=i}}sn=3}}function zy(){if(sn===4||sn===3){sn=0,Xn();var n=Qa,s=vo,i=Sa,d=wy;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?sn=5:(sn=0,vo=Qa=null,$y(n,n.pendingLanes));var g=n.pendingLanes;if(g===0&&(Xa=null),Z(i),s=s.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(gn,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=A.T,g=F.p,F.p=2,A.T=null;try{for(var y=n.onRecoverableError,j=0;j<d.length;j++){var C=d[j];y(C.value,{componentStack:C.stack})}}finally{A.T=s,F.p=g}}(Sa&3)!==0&&$c(),qr(n),g=n.pendingLanes,(i&261930)!==0&&(g&42)!==0?n===Zf?Ni++:(Ni=0,Zf=n):Ni=0,Ei(0)}}function $y(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,ii(s)))}function $c(){return Oy(),My(),zy(),By()}function By(){if(sn!==5)return!1;var n=Qa,s=Xf;Xf=0;var i=Z(Sa),d=A.T,g=F.p;try{F.p=32>i?32:i,A.T=null,i=Qf,Qf=null;var y=Qa,j=Sa;if(sn=0,vo=Qa=null,Sa=0,(mt&6)!==0)throw Error(a(331));var C=mt;if(mt|=4,by(y.current),gy(y,y.current,j,i),mt=C,Ei(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(gn,y)}catch{}return!0}finally{F.p=g,A.T=d,$y(n,s)}}function Iy(n,s,i){s=pr(i,s),s=Rf(n.stateNode,s,2),n=qa(n,s,2),n!==null&&(An(n,2),qr(n))}function yt(n,s,i){if(n.tag===3)Iy(n,n,i);else for(;s!==null;){if(s.tag===3){Iy(s,n,i);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Xa===null||!Xa.has(d))){n=pr(i,n),i=Ux(2),d=qa(s,i,2),d!==null&&(Px(i,d,s,n),An(d,2),qr(d));break}}s=s.return}}function ep(n,s,i){var d=n.pingCache;if(d===null){d=n.pingCache=new QS;var g=new Set;d.set(s,g)}else g=d.get(s),g===void 0&&(g=new Set,d.set(s,g));g.has(i)||(Vf=!0,g.add(i),n=tj.bind(null,n,s,i),s.then(n,n))}function tj(n,s,i){var d=n.pingCache;d!==null&&d.delete(s),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,jt===n&&(lt&i)===i&&(Ft===4||Ft===3&&(lt&62914560)===lt&&300>Ht()-Ac?(mt&2)===0&&_o(n,0):Yf|=i,bo===lt&&(bo=0)),qr(n)}function Uy(n,s){s===0&&(s=oa()),n=xs(n,s),n!==null&&(An(n,s),qr(n))}function nj(n){var s=n.memoizedState,i=0;s!==null&&(i=s.retryLane),Uy(n,i)}function rj(n,s){var i=0;switch(n.tag){case 31:case 13:var d=n.stateNode,g=n.memoizedState;g!==null&&(i=g.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(s),Uy(n,i)}function aj(n,s){return Vt(n,s)}var Bc=null,So=null,tp=!1,Ic=!1,np=!1,Ja=0;function qr(n){n!==So&&n.next===null&&(So===null?Bc=So=n:So=So.next=n),Ic=!0,tp||(tp=!0,oj())}function Ei(n,s){if(!np&&Ic){np=!0;do for(var i=!1,d=Bc;d!==null;){if(n!==0){var g=d.pendingLanes;if(g===0)var y=0;else{var j=d.suspendedLanes,C=d.pingedLanes;y=(1<<31-Pt(42|n)+1)-1,y&=g&~(j&~C),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(i=!0,Fy(d,y))}else y=lt,y=Ct(d,d===jt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||Dt(d,y)||(i=!0,Fy(d,y));d=d.next}while(i);np=!1}}function sj(){Py()}function Py(){Ic=tp=!1;var n=0;Ja!==0&&gj()&&(n=Ja);for(var s=Ht(),i=null,d=Bc;d!==null;){var g=d.next,y=Hy(d,s);y===0?(d.next=null,i===null?Bc=g:i.next=g,g===null&&(So=i)):(i=d,(n!==0||(y&3)!==0)&&(Ic=!0)),d=g}sn!==0&&sn!==5||Ei(n),Ja!==0&&(Ja=0)}function Hy(n,s){for(var i=n.suspendedLanes,d=n.pingedLanes,g=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var j=31-Pt(y),C=1<<j,U=g[j];U===-1?((C&i)===0||(C&d)!==0)&&(g[j]=Oa(C,s)):U<=s&&(n.expiredLanes|=C),y&=~C}if(s=jt,i=lt,i=Ct(n,n===s?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,i===0||n===s&&(xt===2||xt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Bn(d),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||Dt(n,i)){if(s=i&-i,s===n.callbackPriority)return s;switch(d!==null&&Bn(d),Z(i)){case 2:case 8:i=Ze;break;case 32:i=We;break;case 268435456:i=ft;break;default:i=We}return d=qy.bind(null,n),i=Vt(i,d),n.callbackPriority=s,n.callbackNode=i,s}return d!==null&&d!==null&&Bn(d),n.callbackPriority=2,n.callbackNode=null,2}function qy(n,s){if(sn!==0&&sn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if($c()&&n.callbackNode!==i)return null;var d=lt;return d=Ct(n,n===jt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(jy(n,d,s),Hy(n,Ht()),n.callbackNode!=null&&n.callbackNode===i?qy.bind(null,n):null)}function Fy(n,s){if($c())return null;jy(n,s,!0)}function oj(){yj(function(){(mt&6)!==0?Vt(Le,sj):Py()})}function rp(){if(Ja===0){var n=io;n===0&&(n=me,me<<=1,(me&261888)===0&&(me=256)),Ja=n}return Ja}function Gy(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Yl(""+n)}function Vy(n,s){var i=s.ownerDocument.createElement("input");return i.name=s.name,i.value=s.value,n.id&&i.setAttribute("form",n.id),s.parentNode.insertBefore(i,s),n=new FormData(n),i.parentNode.removeChild(i),n}function ij(n,s,i,d,g){if(s==="submit"&&i&&i.stateNode===g){var y=Gy((g[ke]||null).action),j=d.submitter;j&&(s=(s=j[ke]||null)?Gy(s.formAction):j.getAttribute("formAction"),s!==null&&(y=s,j=null));var C=new Zl("action","action",null,d,g);n.push({event:C,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Ja!==0){var U=j?Vy(g,j):new FormData(g);Sf(i,{pending:!0,data:U,method:g.method,action:y},null,U)}}else typeof y=="function"&&(C.preventDefault(),U=j?Vy(g,j):new FormData(g),Sf(i,{pending:!0,data:U,method:g.method,action:y},y,U))},currentTarget:g}]})}}for(var ap=0;ap<Id.length;ap++){var sp=Id[ap],lj=sp.toLowerCase(),cj=sp[0].toUpperCase()+sp.slice(1);Cr(lj,"on"+cj)}Cr(Sg,"onAnimationEnd"),Cr(jg,"onAnimationIteration"),Cr(kg,"onAnimationStart"),Cr("dblclick","onDoubleClick"),Cr("focusin","onFocus"),Cr("focusout","onBlur"),Cr(kS,"onTransitionRun"),Cr(NS,"onTransitionStart"),Cr(ES,"onTransitionCancel"),Cr(Ng,"onTransitionEnd"),Br("onMouseEnter",["mouseout","mouseover"]),Br("onMouseLeave",["mouseout","mouseover"]),Br("onPointerEnter",["pointerout","pointerover"]),Br("onPointerLeave",["pointerout","pointerover"]),dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ci="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(" "),uj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ci));function Yy(n,s){s=(s&4)!==0;for(var i=0;i<n.length;i++){var d=n[i],g=d.event;d=d.listeners;e:{var y=void 0;if(s)for(var j=d.length-1;0<=j;j--){var C=d[j],U=C.instance,X=C.currentTarget;if(C=C.listener,U!==y&&g.isPropagationStopped())break e;y=C,g.currentTarget=X;try{y(g)}catch(ie){ec(ie)}g.currentTarget=null,y=U}else for(j=0;j<d.length;j++){if(C=d[j],U=C.instance,X=C.currentTarget,C=C.listener,U!==y&&g.isPropagationStopped())break e;y=C,g.currentTarget=X;try{y(g)}catch(ie){ec(ie)}g.currentTarget=null,y=U}}}}function ot(n,s){var i=s[Ie];i===void 0&&(i=s[Ie]=new Set);var d=n+"__bubble";i.has(d)||(Ky(s,n,2,!1),i.add(d))}function op(n,s,i){var d=0;s&&(d|=4),Ky(i,n,d,s)}var Uc="_reactListening"+Math.random().toString(36).slice(2);function ip(n){if(!n[Uc]){n[Uc]=!0,an.forEach(function(i){i!=="selectionchange"&&(uj.has(i)||op(i,!1,n),op(i,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[Uc]||(s[Uc]=!0,op("selectionchange",!1,s))}}function Ky(n,s,i,d){switch(Sb(s)){case 2:var g=Bj;break;case 8:g=Ij;break;default:g=wp}i=g.bind(null,s,i,n),g=void 0,!Nd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),d?g!==void 0?n.addEventListener(s,i,{capture:!0,passive:g}):n.addEventListener(s,i,!0):g!==void 0?n.addEventListener(s,i,{passive:g}):n.addEventListener(s,i,!1)}function lp(n,s,i,d,g){var y=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var j=d.tag;if(j===3||j===4){var C=d.stateNode.containerInfo;if(C===g)break;if(j===4)for(j=d.return;j!==null;){var U=j.tag;if((U===3||U===4)&&j.stateNode.containerInfo===g)return;j=j.return}for(;C!==null;){if(j=Te(C),j===null)return;if(U=j.tag,U===5||U===6||U===26||U===27){d=y=j;continue e}C=C.parentNode}}d=d.return}Wm(function(){var X=y,ie=jd(i),pe=[];e:{var Q=Eg.get(n);if(Q!==void 0){var te=Zl,Ae=n;switch(n){case"keypress":if(Xl(i)===0)break e;case"keydown":case"keyup":te=rS;break;case"focusin":Ae="focus",te=Td;break;case"focusout":Ae="blur",te=Td;break;case"beforeblur":case"afterblur":te=Td;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=ng;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Gw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=oS;break;case Sg:case jg:case kg:te=Kw;break;case Ng:te=lS;break;case"scroll":case"scrollend":te=qw;break;case"wheel":te=uS;break;case"copy":case"cut":case"paste":te=Qw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=ag;break;case"toggle":case"beforetoggle":te=fS}var Ye=(s&4)!==0,_t=!Ye&&(n==="scroll"||n==="scrollend"),Y=Ye?Q!==null?Q+"Capture":null:Q;Ye=[];for(var q=X,K;q!==null;){var de=q;if(K=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||K===null||Y===null||(de=Qo(q,Y),de!=null&&Ye.push(Ri(q,de,K))),_t)break;q=q.return}0<Ye.length&&(Q=new te(Q,Ae,null,i,ie),pe.push({event:Q,listeners:Ye}))}}if((s&7)===0){e:{if(Q=n==="mouseover"||n==="pointerover",te=n==="mouseout"||n==="pointerout",Q&&i!==Sd&&(Ae=i.relatedTarget||i.fromElement)&&(Te(Ae)||Ae[Ce]))break e;if((te||Q)&&(Q=ie.window===ie?ie:(Q=ie.ownerDocument)?Q.defaultView||Q.parentWindow:window,te?(Ae=i.relatedTarget||i.toElement,te=X,Ae=Ae?Te(Ae):null,Ae!==null&&(_t=l(Ae),Ye=Ae.tag,Ae!==_t||Ye!==5&&Ye!==27&&Ye!==6)&&(Ae=null)):(te=null,Ae=X),te!==Ae)){if(Ye=ng,de="onMouseLeave",Y="onMouseEnter",q="mouse",(n==="pointerout"||n==="pointerover")&&(Ye=ag,de="onPointerLeave",Y="onPointerEnter",q="pointer"),_t=te==null?Q:Oe(te),K=Ae==null?Q:Oe(Ae),Q=new Ye(de,q+"leave",te,i,ie),Q.target=_t,Q.relatedTarget=K,de=null,Te(ie)===X&&(Ye=new Ye(Y,q+"enter",Ae,i,ie),Ye.target=K,Ye.relatedTarget=_t,de=Ye),_t=de,te&&Ae)t:{for(Ye=dj,Y=te,q=Ae,K=0,de=Y;de;de=Ye(de))K++;de=0;for(var He=q;He;He=Ye(He))de++;for(;0<K-de;)Y=Ye(Y),K--;for(;0<de-K;)q=Ye(q),de--;for(;K--;){if(Y===q||q!==null&&Y===q.alternate){Ye=Y;break t}Y=Ye(Y),q=Ye(q)}Ye=null}else Ye=null;te!==null&&Xy(pe,Q,te,Ye,!1),Ae!==null&&_t!==null&&Xy(pe,_t,Ae,Ye,!0)}}e:{if(Q=X?Oe(X):window,te=Q.nodeName&&Q.nodeName.toLowerCase(),te==="select"||te==="input"&&Q.type==="file")var pt=fg;else if(ug(Q))if(pg)pt=wS;else{pt=vS;var Me=bS}else te=Q.nodeName,!te||te.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&wd(X.elementType)&&(pt=fg):pt=_S;if(pt&&(pt=pt(n,X))){dg(pe,pt,i,ie);break e}Me&&Me(n,Q,X),n==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&_d(Q,"number",Q.value)}switch(Me=X?Oe(X):window,n){case"focusin":(ug(Me)||Me.contentEditable==="true")&&(Ws=Me,zd=X,ai=null);break;case"focusout":ai=zd=Ws=null;break;case"mousedown":$d=!0;break;case"contextmenu":case"mouseup":case"dragend":$d=!1,_g(pe,i,ie);break;case"selectionchange":if(jS)break;case"keydown":case"keyup":_g(pe,i,ie)}var et;if(Ld)e:{switch(n){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else Js?lg(n,i)&&(ct="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(ct="onCompositionStart");ct&&(sg&&i.locale!=="ko"&&(Js||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&Js&&(et=eg()):(za=ie,Ed="value"in za?za.value:za.textContent,Js=!0)),Me=Pc(X,ct),0<Me.length&&(ct=new rg(ct,n,null,i,ie),pe.push({event:ct,listeners:Me}),et?ct.data=et:(et=cg(i),et!==null&&(ct.data=et)))),(et=hS?mS(n,i):gS(n,i))&&(ct=Pc(X,"onBeforeInput"),0<ct.length&&(Me=new rg("onBeforeInput","beforeinput",null,i,ie),pe.push({event:Me,listeners:ct}),Me.data=et)),ij(pe,n,X,i,ie)}Yy(pe,s)})}function Ri(n,s,i){return{instance:n,listener:s,currentTarget:i}}function Pc(n,s){for(var i=s+"Capture",d=[];n!==null;){var g=n,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=Qo(n,i),g!=null&&d.unshift(Ri(n,g,y)),g=Qo(n,s),g!=null&&d.push(Ri(n,g,y))),n.tag===3)return d;n=n.return}return[]}function dj(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Xy(n,s,i,d,g){for(var y=s._reactName,j=[];i!==null&&i!==d;){var C=i,U=C.alternate,X=C.stateNode;if(C=C.tag,U!==null&&U===d)break;C!==5&&C!==26&&C!==27||X===null||(U=X,g?(X=Qo(i,y),X!=null&&j.unshift(Ri(i,X,U))):g||(X=Qo(i,y),X!=null&&j.push(Ri(i,X,U)))),i=i.return}j.length!==0&&n.push({event:s,listeners:j})}var fj=/\r\n?/g,pj=/\u0000|\uFFFD/g;function Qy(n){return(typeof n=="string"?n:""+n).replace(fj,`
|
|
10
|
+
`).replace(pj,"")}function Zy(n,s){return s=Qy(s),Qy(n)===s}function vt(n,s,i,d,g,y){switch(i){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||Xs(n,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&Xs(n,""+d);break;case"className":Yt(n,"class",d);break;case"tabIndex":Yt(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Yt(n,i,d);break;case"style":Zm(n,d,y);break;case"data":if(s!=="object"){Yt(n,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||i!=="href")){n.removeAttribute(i);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(i);break}d=Yl(""+d),n.setAttribute(i,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(i,"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 y=="function"&&(i==="formAction"?(s!=="input"&&vt(n,s,"name",g.name,g,null),vt(n,s,"formEncType",g.formEncType,g,null),vt(n,s,"formMethod",g.formMethod,g,null),vt(n,s,"formTarget",g.formTarget,g,null)):(vt(n,s,"encType",g.encType,g,null),vt(n,s,"method",g.method,g,null),vt(n,s,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(i);break}d=Yl(""+d),n.setAttribute(i,d);break;case"onClick":d!=null&&(n.onclick=la);break;case"onScroll":d!=null&&ot("scroll",n);break;case"onScrollEnd":d!=null&&ot("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(i=d.__html,i!=null){if(g.children!=null)throw Error(a(60));n.innerHTML=i}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}i=Yl(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,""+d):n.removeAttribute(i);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":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":d===!0?n.setAttribute(i,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,d):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(i,d):n.removeAttribute(i);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(i):n.setAttribute(i,d);break;case"popover":ot("beforetoggle",n),ot("toggle",n),at(n,"popover",d);break;case"xlinkActuate":wn(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":wn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":wn(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":wn(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":wn(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":wn(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":wn(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":wn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":wn(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":at(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Pw.get(i)||i,at(n,i,d))}}function cp(n,s,i,d,g,y){switch(i){case"style":Zm(n,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(i=d.__html,i!=null){if(g.children!=null)throw Error(a(60));n.innerHTML=i}}break;case"children":typeof d=="string"?Xs(n,d):(typeof d=="number"||typeof d=="bigint")&&Xs(n,""+d);break;case"onScroll":d!=null&&ot("scroll",n);break;case"onScrollEnd":d!=null&&ot("scrollend",n);break;case"onClick":d!=null&&(n.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_n.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(g=i.endsWith("Capture"),s=i.slice(2,g?i.length-7:void 0),y=n[ke]||null,y=y!=null?y[i]:null,typeof y=="function"&&n.removeEventListener(s,y,g),typeof d=="function")){typeof y!="function"&&y!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(s,d,g);break e}i in n?n[i]=d:d===!0?n.setAttribute(i,""):at(n,i,d)}}}function vn(n,s,i){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",n),ot("load",n);var d=!1,g=!1,y;for(y in i)if(i.hasOwnProperty(y)){var j=i[y];if(j!=null)switch(y){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:vt(n,s,y,j,i,null)}}g&&vt(n,s,"srcSet",i.srcSet,i,null),d&&vt(n,s,"src",i.src,i,null);return;case"input":ot("invalid",n);var C=y=j=g=null,U=null,X=null;for(d in i)if(i.hasOwnProperty(d)){var ie=i[d];if(ie!=null)switch(d){case"name":g=ie;break;case"type":j=ie;break;case"checked":U=ie;break;case"defaultChecked":X=ie;break;case"value":y=ie;break;case"defaultValue":C=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,s));break;default:vt(n,s,d,ie,i,null)}}Ym(n,y,C,U,X,j,g,!1);return;case"select":ot("invalid",n),d=j=y=null;for(g in i)if(i.hasOwnProperty(g)&&(C=i[g],C!=null))switch(g){case"value":y=C;break;case"defaultValue":j=C;break;case"multiple":d=C;default:vt(n,s,g,C,i,null)}s=y,i=j,n.multiple=!!d,s!=null?Ks(n,!!d,s,!1):i!=null&&Ks(n,!!d,i,!0);return;case"textarea":ot("invalid",n),y=g=d=null;for(j in i)if(i.hasOwnProperty(j)&&(C=i[j],C!=null))switch(j){case"value":d=C;break;case"defaultValue":g=C;break;case"children":y=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(a(91));break;default:vt(n,s,j,C,i,null)}Xm(n,d,g,y);return;case"option":for(U in i)i.hasOwnProperty(U)&&(d=i[U],d!=null)&&(U==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":vt(n,s,U,d,i,null));return;case"dialog":ot("beforetoggle",n),ot("toggle",n),ot("cancel",n),ot("close",n);break;case"iframe":case"object":ot("load",n);break;case"video":case"audio":for(d=0;d<Ci.length;d++)ot(Ci[d],n);break;case"image":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"embed":case"source":case"link":ot("error",n),ot("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(X in i)if(i.hasOwnProperty(X)&&(d=i[X],d!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:vt(n,s,X,d,i,null)}return;default:if(wd(s)){for(ie in i)i.hasOwnProperty(ie)&&(d=i[ie],d!==void 0&&cp(n,s,ie,d,i,void 0));return}}for(C in i)i.hasOwnProperty(C)&&(d=i[C],d!=null&&vt(n,s,C,d,i,null))}function hj(n,s,i,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,j=null,C=null,U=null,X=null,ie=null;for(te in i){var pe=i[te];if(i.hasOwnProperty(te)&&pe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":U=pe;default:d.hasOwnProperty(te)||vt(n,s,te,null,d,pe)}}for(var Q in d){var te=d[Q];if(pe=i[Q],d.hasOwnProperty(Q)&&(te!=null||pe!=null))switch(Q){case"type":y=te;break;case"name":g=te;break;case"checked":X=te;break;case"defaultChecked":ie=te;break;case"value":j=te;break;case"defaultValue":C=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,s));break;default:te!==pe&&vt(n,s,Q,te,d,pe)}}vd(n,j,C,U,X,ie,y,g);return;case"select":te=j=C=Q=null;for(y in i)if(U=i[y],i.hasOwnProperty(y)&&U!=null)switch(y){case"value":break;case"multiple":te=U;default:d.hasOwnProperty(y)||vt(n,s,y,null,d,U)}for(g in d)if(y=d[g],U=i[g],d.hasOwnProperty(g)&&(y!=null||U!=null))switch(g){case"value":Q=y;break;case"defaultValue":C=y;break;case"multiple":j=y;default:y!==U&&vt(n,s,g,y,d,U)}s=C,i=j,d=te,Q!=null?Ks(n,!!i,Q,!1):!!d!=!!i&&(s!=null?Ks(n,!!i,s,!0):Ks(n,!!i,i?[]:"",!1));return;case"textarea":te=Q=null;for(C in i)if(g=i[C],i.hasOwnProperty(C)&&g!=null&&!d.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:vt(n,s,C,null,d,g)}for(j in d)if(g=d[j],y=i[j],d.hasOwnProperty(j)&&(g!=null||y!=null))switch(j){case"value":Q=g;break;case"defaultValue":te=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==y&&vt(n,s,j,g,d,y)}Km(n,Q,te);return;case"option":for(var Ae in i)Q=i[Ae],i.hasOwnProperty(Ae)&&Q!=null&&!d.hasOwnProperty(Ae)&&(Ae==="selected"?n.selected=!1:vt(n,s,Ae,null,d,Q));for(U in d)Q=d[U],te=i[U],d.hasOwnProperty(U)&&Q!==te&&(Q!=null||te!=null)&&(U==="selected"?n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":vt(n,s,U,Q,d,te));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 Ye in i)Q=i[Ye],i.hasOwnProperty(Ye)&&Q!=null&&!d.hasOwnProperty(Ye)&&vt(n,s,Ye,null,d,Q);for(X in d)if(Q=d[X],te=i[X],d.hasOwnProperty(X)&&Q!==te&&(Q!=null||te!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,s));break;default:vt(n,s,X,Q,d,te)}return;default:if(wd(s)){for(var _t in i)Q=i[_t],i.hasOwnProperty(_t)&&Q!==void 0&&!d.hasOwnProperty(_t)&&cp(n,s,_t,void 0,d,Q);for(ie in d)Q=d[ie],te=i[ie],!d.hasOwnProperty(ie)||Q===te||Q===void 0&&te===void 0||cp(n,s,ie,Q,d,te);return}}for(var Y in i)Q=i[Y],i.hasOwnProperty(Y)&&Q!=null&&!d.hasOwnProperty(Y)&&vt(n,s,Y,null,d,Q);for(pe in d)Q=d[pe],te=i[pe],!d.hasOwnProperty(pe)||Q===te||Q==null&&te==null||vt(n,s,pe,Q,d,te)}function Jy(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mj(){if(typeof performance.getEntriesByType=="function"){for(var n=0,s=0,i=performance.getEntriesByType("resource"),d=0;d<i.length;d++){var g=i[d],y=g.transferSize,j=g.initiatorType,C=g.duration;if(y&&C&&Jy(j)){for(j=0,C=g.responseEnd,d+=1;d<i.length;d++){var U=i[d],X=U.startTime;if(X>C)break;var ie=U.transferSize,pe=U.initiatorType;ie&&Jy(pe)&&(U=U.responseEnd,j+=ie*(U<C?1:(C-X)/(U-X)))}if(--d,s+=8*(y+j)/(g.duration/1e3),n++,10<n)break}}if(0<n)return s/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var up=null,dp=null;function Hc(n){return n.nodeType===9?n:n.ownerDocument}function Wy(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 eb(n,s){if(n===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&s==="foreignObject"?0:n}function fp(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var pp=null;function gj(){var n=window.event;return n&&n.type==="popstate"?n===pp?!1:(pp=n,!0):(pp=null,!1)}var tb=typeof setTimeout=="function"?setTimeout:void 0,xj=typeof clearTimeout=="function"?clearTimeout:void 0,nb=typeof Promise=="function"?Promise:void 0,yj=typeof queueMicrotask=="function"?queueMicrotask:typeof nb<"u"?function(n){return nb.resolve(null).then(n).catch(bj)}:tb;function bj(n){setTimeout(function(){throw n})}function Wa(n){return n==="head"}function rb(n,s){var i=s,d=0;do{var g=i.nextSibling;if(n.removeChild(i),g&&g.nodeType===8)if(i=g.data,i==="/$"||i==="/&"){if(d===0){n.removeChild(g),Eo(s);return}d--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")d++;else if(i==="html")Ti(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,Ti(i);for(var y=i.firstChild;y;){var j=y.nextSibling,C=y.nodeName;y[ue]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&y.rel.toLowerCase()==="stylesheet"||i.removeChild(y),y=j}}else i==="body"&&Ti(n.ownerDocument.body);i=g}while(i);Eo(s)}function ab(n,s){var i=n;n=0;do{var d=i.nextSibling;if(i.nodeType===1?s?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(s?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=d}while(i)}function hp(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var i=s;switch(s=s.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":hp(i),Ee(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function vj(n,s,i,d){for(;n.nodeType===1;){var g=i;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[ue])switch(s){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==g.rel||n.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||n.getAttribute("title")!==(g.title==null?null:g.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(g.src==null?null:g.src)||n.getAttribute("type")!==(g.type==null?null:g.type)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(s==="input"&&n.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=yr(n.nextSibling),n===null)break}return null}function _j(n,s,i){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=yr(n.nextSibling),n===null))return null;return n}function sb(n,s){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=yr(n.nextSibling),n===null))return null;return n}function mp(n){return n.data==="$?"||n.data==="$~"}function gp(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function wj(n,s){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=s;else if(n.data!=="$?"||i.readyState!=="loading")s();else{var d=function(){s(),i.removeEventListener("DOMContentLoaded",d)};i.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function yr(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return n}var xp=null;function ob(n){n=n.nextSibling;for(var s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(s===0)return yr(n.nextSibling);s--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||s++}n=n.nextSibling}return null}function ib(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(s===0)return n;s--}else i!=="/$"&&i!=="/&"||s++}n=n.previousSibling}return null}function lb(n,s,i){switch(s=Hc(i),n){case"html":if(n=s.documentElement,!n)throw Error(a(452));return n;case"head":if(n=s.head,!n)throw Error(a(453));return n;case"body":if(n=s.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function Ti(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);Ee(n)}var br=new Map,cb=new Set;function qc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var ja=F.d;F.d={f:Sj,r:jj,D:kj,C:Nj,L:Ej,m:Cj,X:Tj,S:Rj,M:Aj};function Sj(){var n=ja.f(),s=Oc();return n||s}function jj(n){var s=Ge(n);s!==null&&s.tag===5&&s.type==="form"?Nx(s):ja.r(n)}var jo=typeof document>"u"?null:document;function ub(n,s,i){var d=jo;if(d&&typeof s=="string"&&s){var g=dr(s);g='link[rel="'+n+'"][href="'+g+'"]',typeof i=="string"&&(g+='[crossorigin="'+i+'"]'),cb.has(g)||(cb.add(g),n={rel:n,crossOrigin:i,href:s},d.querySelector(g)===null&&(s=d.createElement("link"),vn(s,"link",n),it(s),d.head.appendChild(s)))}}function kj(n){ja.D(n),ub("dns-prefetch",n,null)}function Nj(n,s){ja.C(n,s),ub("preconnect",n,s)}function Ej(n,s,i){ja.L(n,s,i);var d=jo;if(d&&n&&s){var g='link[rel="preload"][as="'+dr(s)+'"]';s==="image"&&i&&i.imageSrcSet?(g+='[imagesrcset="'+dr(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(g+='[imagesizes="'+dr(i.imageSizes)+'"]')):g+='[href="'+dr(n)+'"]';var y=g;switch(s){case"style":y=ko(n);break;case"script":y=No(n)}br.has(y)||(n=x({rel:"preload",href:s==="image"&&i&&i.imageSrcSet?void 0:n,as:s},i),br.set(y,n),d.querySelector(g)!==null||s==="style"&&d.querySelector(Ai(y))||s==="script"&&d.querySelector(Li(y))||(s=d.createElement("link"),vn(s,"link",n),it(s),d.head.appendChild(s)))}}function Cj(n,s){ja.m(n,s);var i=jo;if(i&&n){var d=s&&typeof s.as=="string"?s.as:"script",g='link[rel="modulepreload"][as="'+dr(d)+'"][href="'+dr(n)+'"]',y=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=No(n)}if(!br.has(y)&&(n=x({rel:"modulepreload",href:n},s),br.set(y,n),i.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Li(y)))return}d=i.createElement("link"),vn(d,"link",n),it(d),i.head.appendChild(d)}}}function Rj(n,s,i){ja.S(n,s,i);var d=jo;if(d&&n){var g=gt(d).hoistableStyles,y=ko(n);s=s||"default";var j=g.get(y);if(!j){var C={loading:0,preload:null};if(j=d.querySelector(Ai(y)))C.loading=5;else{n=x({rel:"stylesheet",href:n,"data-precedence":s},i),(i=br.get(y))&&yp(n,i);var U=j=d.createElement("link");it(U),vn(U,"link",n),U._p=new Promise(function(X,ie){U.onload=X,U.onerror=ie}),U.addEventListener("load",function(){C.loading|=1}),U.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Fc(j,s,d)}j={type:"stylesheet",instance:j,count:1,state:C},g.set(y,j)}}}function Tj(n,s){ja.X(n,s);var i=jo;if(i&&n){var d=gt(i).hoistableScripts,g=No(n),y=d.get(g);y||(y=i.querySelector(Li(g)),y||(n=x({src:n,async:!0},s),(s=br.get(g))&&bp(n,s),y=i.createElement("script"),it(y),vn(y,"link",n),i.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(g,y))}}function Aj(n,s){ja.M(n,s);var i=jo;if(i&&n){var d=gt(i).hoistableScripts,g=No(n),y=d.get(g);y||(y=i.querySelector(Li(g)),y||(n=x({src:n,async:!0,type:"module"},s),(s=br.get(g))&&bp(n,s),y=i.createElement("script"),it(y),vn(y,"link",n),i.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(g,y))}}function db(n,s,i,d){var g=(g=ge.current)?qc(g):null;if(!g)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(s=ko(i.href),i=gt(g).hoistableStyles,d=i.get(s),d||(d={type:"style",instance:null,count:0,state:null},i.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=ko(i.href);var y=gt(g).hoistableStyles,j=y.get(n);if(j||(g=g.ownerDocument||g,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,j),(y=g.querySelector(Ai(n)))&&!y._p&&(j.instance=y,j.state.loading=5),br.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},br.set(n,i),y||Lj(g,n,i,j.state))),s&&d===null)throw Error(a(528,""));return j}if(s&&d!==null)throw Error(a(529,""));return null;case"script":return s=i.async,i=i.src,typeof i=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=No(i),i=gt(g).hoistableScripts,d=i.get(s),d||(d={type:"script",instance:null,count:0,state:null},i.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function ko(n){return'href="'+dr(n)+'"'}function Ai(n){return'link[rel="stylesheet"]['+n+"]"}function fb(n){return x({},n,{"data-precedence":n.precedence,precedence:null})}function Lj(n,s,i,d){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=n.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),vn(s,"link",i),it(s),n.head.appendChild(s))}function No(n){return'[src="'+dr(n)+'"]'}function Li(n){return"script[async]"+n}function pb(n,s,i){if(s.count++,s.instance===null)switch(s.type){case"style":var d=n.querySelector('style[data-href~="'+dr(i.href)+'"]');if(d)return s.instance=d,it(d),d;var g=x({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),it(d),vn(d,"style",g),Fc(d,i.precedence,n),s.instance=d;case"stylesheet":g=ko(i.href);var y=n.querySelector(Ai(g));if(y)return s.state.loading|=4,s.instance=y,it(y),y;d=fb(i),(g=br.get(g))&&yp(d,g),y=(n.ownerDocument||n).createElement("link"),it(y);var j=y;return j._p=new Promise(function(C,U){j.onload=C,j.onerror=U}),vn(y,"link",d),s.state.loading|=4,Fc(y,i.precedence,n),s.instance=y;case"script":return y=No(i.src),(g=n.querySelector(Li(y)))?(s.instance=g,it(g),g):(d=i,(g=br.get(y))&&(d=x({},i),bp(d,g)),n=n.ownerDocument||n,g=n.createElement("script"),it(g),vn(g,"link",d),n.head.appendChild(g),s.instance=g);case"void":return null;default:throw Error(a(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,Fc(d,i.precedence,n));return s.instance}function Fc(n,s,i){for(var d=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,y=g,j=0;j<d.length;j++){var C=d[j];if(C.dataset.precedence===s)y=C;else if(y!==g)break}y?y.parentNode.insertBefore(n,y.nextSibling):(s=i.nodeType===9?i.head:i,s.insertBefore(n,s.firstChild))}function yp(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.title==null&&(n.title=s.title)}function bp(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.integrity==null&&(n.integrity=s.integrity)}var Gc=null;function hb(n,s,i){if(Gc===null){var d=new Map,g=Gc=new Map;g.set(i,d)}else g=Gc,d=g.get(i),d||(d=new Map,g.set(i,d));if(d.has(n))return d;for(d.set(n,null),i=i.getElementsByTagName(n),g=0;g<i.length;g++){var y=i[g];if(!(y[ue]||y[je]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var j=y.getAttribute(s)||"";j=n+j;var C=d.get(j);C?C.push(y):d.set(j,[y])}}return d}function mb(n,s,i){n=n.ownerDocument||n,n.head.insertBefore(i,s==="title"?n.querySelector("head > title"):null)}function Dj(n,s,i){if(i===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(n=s.disabled,typeof s.precedence=="string"&&n==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function gb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function Oj(n,s,i,d){if(i.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var g=ko(d.href),y=s.querySelector(Ai(g));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=Vc.bind(n),s.then(n,n)),i.state.loading|=4,i.instance=y,it(y);return}y=s.ownerDocument||s,d=fb(d),(g=br.get(g))&&yp(d,g),y=y.createElement("link"),it(y);var j=y;j._p=new Promise(function(C,U){j.onload=C,j.onerror=U}),vn(y,"link",d),i.instance=y}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,s),(s=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=Vc.bind(n),s.addEventListener("load",i),s.addEventListener("error",i))}}var vp=0;function Mj(n,s){return n.stylesheets&&n.count===0&&Kc(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var d=setTimeout(function(){if(n.stylesheets&&Kc(n,n.stylesheets),n.unsuspend){var y=n.unsuspend;n.unsuspend=null,y()}},6e4+s);0<n.imgBytes&&vp===0&&(vp=62500*mj());var g=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Kc(n,n.stylesheets),n.unsuspend)){var y=n.unsuspend;n.unsuspend=null,y()}},(n.imgBytes>vp?50:800)+s);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function Vc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Yc=null;function Kc(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Yc=new Map,s.forEach(zj,n),Yc=null,Vc.call(n))}function zj(n,s){if(!(s.state.loading&4)){var i=Yc.get(n);if(i)var d=i.get(null);else{i=new Map,Yc.set(n,i);for(var g=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var j=g[y];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(i.set(j.dataset.precedence,j),d=j)}d&&i.set(null,d)}g=s.instance,j=g.getAttribute("data-precedence"),y=i.get(j)||d,y===d&&i.set(null,g),i.set(j,g),this.count++,d=Vc.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),y?y.parentNode.insertBefore(g,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(g,n.firstChild)),s.state.loading|=4}}var Di={$$typeof:E,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function $j(n,s,i,d,g,y,j,C,U){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=ur(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ur(0),this.hiddenUpdates=ur(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function xb(n,s,i,d,g,y,j,C,U,X,ie,pe){return n=new $j(n,s,i,j,U,X,ie,pe,C),s=1,y===!0&&(s|=24),y=Zn(3,null,null,s),n.current=y,y.stateNode=n,s=Jd(),s.refCount++,n.pooledCache=s,s.refCount++,y.memoizedState={element:d,isDehydrated:i,cache:s},nf(y),n}function yb(n){return n?(n=no,n):no}function bb(n,s,i,d,g,y){g=yb(g),d.context===null?d.context=g:d.pendingContext=g,d=Ha(s),d.payload={element:i},y=y===void 0?null:y,y!==null&&(d.callback=y),i=qa(n,d,s),i!==null&&(Fn(i,n,s),di(i,n,s))}function vb(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<s?i:s}}function _p(n,s){vb(n,s),(n=n.alternate)&&vb(n,s)}function _b(n){if(n.tag===13||n.tag===31){var s=xs(n,67108864);s!==null&&Fn(s,n,67108864),_p(n,67108864)}}function wb(n){if(n.tag===13||n.tag===31){var s=nr();s=G(s);var i=xs(n,s);i!==null&&Fn(i,n,s),_p(n,s)}}var Xc=!0;function Bj(n,s,i,d){var g=A.T;A.T=null;var y=F.p;try{F.p=2,wp(n,s,i,d)}finally{F.p=y,A.T=g}}function Ij(n,s,i,d){var g=A.T;A.T=null;var y=F.p;try{F.p=8,wp(n,s,i,d)}finally{F.p=y,A.T=g}}function wp(n,s,i,d){if(Xc){var g=Sp(d);if(g===null)lp(n,s,d,Qc,i),jb(n,d);else if(Pj(g,n,s,i,d))d.stopPropagation();else if(jb(n,d),s&4&&-1<Uj.indexOf(n)){for(;g!==null;){var y=Ge(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var j=nt(y.pendingLanes);if(j!==0){var C=y;for(C.pendingLanes|=2,C.entangledLanes|=2;j;){var U=1<<31-Pt(j);C.entanglements[1]|=U,j&=~U}qr(y),(mt&6)===0&&(Lc=Ht()+500,Ei(0))}}break;case 31:case 13:C=xs(y,2),C!==null&&Fn(C,y,2),Oc(),_p(y,2)}if(y=Sp(d),y===null&&lp(n,s,d,Qc,i),y===g)break;g=y}g!==null&&d.stopPropagation()}else lp(n,s,d,null,i)}}function Sp(n){return n=jd(n),jp(n)}var Qc=null;function jp(n){if(Qc=null,n=Te(n),n!==null){var s=l(n);if(s===null)n=null;else{var i=s.tag;if(i===13){if(n=u(s),n!==null)return n;n=null}else if(i===31){if(n=f(s),n!==null)return n;n=null}else if(i===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return Qc=n,null}function Sb(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(Rn()){case Le:return 2;case Ze:return 8;case We:case Nt:return 32;case ft:return 268435456;default:return 32}default:return 32}}var kp=!1,es=null,ts=null,ns=null,Oi=new Map,Mi=new Map,rs=[],Uj="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 jb(n,s){switch(n){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":Oi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mi.delete(s.pointerId)}}function zi(n,s,i,d,g,y){return n===null||n.nativeEvent!==y?(n={blockedOn:s,domEventName:i,eventSystemFlags:d,nativeEvent:y,targetContainers:[g]},s!==null&&(s=Ge(s),s!==null&&_b(s)),n):(n.eventSystemFlags|=d,s=n.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),n)}function Pj(n,s,i,d,g){switch(s){case"focusin":return es=zi(es,n,s,i,d,g),!0;case"dragenter":return ts=zi(ts,n,s,i,d,g),!0;case"mouseover":return ns=zi(ns,n,s,i,d,g),!0;case"pointerover":var y=g.pointerId;return Oi.set(y,zi(Oi.get(y)||null,n,s,i,d,g)),!0;case"gotpointercapture":return y=g.pointerId,Mi.set(y,zi(Mi.get(y)||null,n,s,i,d,g)),!0}return!1}function kb(n){var s=Te(n.target);if(s!==null){var i=l(s);if(i!==null){if(s=i.tag,s===13){if(s=u(i),s!==null){n.blockedOn=s,we(n.priority,function(){wb(i)});return}}else if(s===31){if(s=f(i),s!==null){n.blockedOn=s,we(n.priority,function(){wb(i)});return}}else if(s===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Zc(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var i=Sp(n.nativeEvent);if(i===null){i=n.nativeEvent;var d=new i.constructor(i.type,i);Sd=d,i.target.dispatchEvent(d),Sd=null}else return s=Ge(i),s!==null&&_b(s),n.blockedOn=i,!1;s.shift()}return!0}function Nb(n,s,i){Zc(n)&&i.delete(s)}function Hj(){kp=!1,es!==null&&Zc(es)&&(es=null),ts!==null&&Zc(ts)&&(ts=null),ns!==null&&Zc(ns)&&(ns=null),Oi.forEach(Nb),Mi.forEach(Nb)}function Jc(n,s){n.blockedOn===s&&(n.blockedOn=null,kp||(kp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Hj)))}var Wc=null;function Eb(n){Wc!==n&&(Wc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wc===n&&(Wc=null);for(var s=0;s<n.length;s+=3){var i=n[s],d=n[s+1],g=n[s+2];if(typeof d!="function"){if(jp(d||i)===null)continue;break}var y=Ge(i);y!==null&&(n.splice(s,3),s-=3,Sf(y,{pending:!0,data:g,method:i.method,action:d},d,g))}}))}function Eo(n){function s(U){return Jc(U,n)}es!==null&&Jc(es,n),ts!==null&&Jc(ts,n),ns!==null&&Jc(ns,n),Oi.forEach(s),Mi.forEach(s);for(var i=0;i<rs.length;i++){var d=rs[i];d.blockedOn===n&&(d.blockedOn=null)}for(;0<rs.length&&(i=rs[0],i.blockedOn===null);)kb(i),i.blockedOn===null&&rs.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(d=0;d<i.length;d+=3){var g=i[d],y=i[d+1],j=g[ke]||null;if(typeof y=="function")j||Eb(i);else if(j){var C=null;if(y&&y.hasAttribute("formAction")){if(g=y,j=y[ke]||null)C=j.formAction;else if(jp(g)!==null)continue}else C=j.action;typeof C=="function"?i[d+1]=C:(i.splice(d,3),d-=3),Eb(i)}}}function Cb(){function n(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(j){return g=j})},focusReset:"manual",scroll:"manual"})}function s(){g!==null&&(g(),g=null),d||setTimeout(i,20)}function i(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,g=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(i,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),g!==null&&(g(),g=null)}}}function Np(n){this._internalRoot=n}eu.prototype.render=Np.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(a(409));var i=s.current,d=nr();bb(i,d,n,s,null,null)},eu.prototype.unmount=Np.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;bb(n.current,2,null,n,null,null),Oc(),s[Ce]=null}};function eu(n){this._internalRoot=n}eu.prototype.unstable_scheduleHydration=function(n){if(n){var s=xe();n={blockedOn:null,target:n,priority:s};for(var i=0;i<rs.length&&s!==0&&s<rs[i].priority;i++);rs.splice(i,0,n),i===0&&kb(n)}};var Rb=t.version;if(Rb!=="19.2.4")throw Error(a(527,Rb,"19.2.4"));F.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=p(s),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var qj={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{gn=tu.inject(qj),Lt=tu}catch{}}return Ii.createRoot=function(n,s){if(!o(n))throw Error(a(299));var i=!1,d="",g=zx,y=$x,j=Bx;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(g=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError)),s=xb(n,1,!1,null,null,i,d,null,g,y,j,Cb),n[Ce]=s.current,ip(n),new Np(s)},Ii.hydrateRoot=function(n,s,i){if(!o(n))throw Error(a(299));var d=!1,g="",y=zx,j=$x,C=Bx,U=null;return i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(j=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError),i.formState!==void 0&&(U=i.formState)),s=xb(n,1,!0,s,i??null,d,g,U,y,j,C,Cb),s.context=yb(null),i=s.current,d=nr(),d=G(d),g=Ha(d),g.callback=null,qa(i,g,d),i=d,s.current.lanes=i,An(s,i),qr(s),n[Ce]=s.current,ip(n),new eu(s)},Ii.version="19.2.4",Ii}var o0;function ok(){if(o0)return Op.exports;o0=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(),Op.exports=sk(),Op.exports}var ik=ok();var V_=e=>{throw TypeError(e)},lk=(e,t,r)=>t.has(e)||V_("Cannot "+r),Bp=(e,t,r)=>(lk(e,t,"read from private field"),r?r.call(e):t.get(e)),ck=(e,t,r)=>t.has(e)?V_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),i0="popstate";function l0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function uk(e={}){function t(a,o){let l=o.state?.masked,{pathname:u,search:f,hash:h}=l||a.location;return pl("",{pathname:u,search:f,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",l?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:Jr(o)}return fk(t,r,null,e)}function rt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dk(){return Math.random().toString(36).substring(2,10)}function c0(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 pl(e,t,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Da(t):t,state:r,key:t&&t.key||a||dk(),unstable_mask:o}}function Jr({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Da(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function fk(e,t,r,a={}){let{window:o=document.defaultView,v5Compat:l=!1}=a,u=o.history,f="POP",h=null,p=m();p==null&&(p=0,u.replaceState({...u.state,idx:p},""));function m(){return(u.state||{idx:null}).idx}function x(){f="POP";let k=m(),N=k==null?null:k-p;p=k,h&&h({action:f,location:S.location,delta:N})}function v(k,N){f="PUSH";let R=l0(k)?k:pl(S.location,k,N);p=m()+1;let E=c0(R,p),D=S.createHref(R.unstable_mask||R);try{u.pushState(E,"",D)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(D)}l&&h&&h({action:f,location:S.location,delta:1})}function _(k,N){f="REPLACE";let R=l0(k)?k:pl(S.location,k,N);p=m();let E=c0(R,p),D=S.createHref(R.unstable_mask||R);u.replaceState(E,"",D),l&&h&&h({action:f,location:S.location,delta:0})}function w(k){return Y_(k)}let S={get action(){return f},get location(){return e(o,u)},listen(k){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(i0,x),h=k,()=>{o.removeEventListener(i0,x),h=null}},createHref(k){return t(o,k)},createURL:w,encodeLocation(k){let N=w(k);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:v,replace:_,go(k){return u.go(k)}};return S}function Y_(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),rt(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Jr(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}var tl,u0=class{constructor(e){if(ck(this,tl,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Bp(this,tl).has(e))return Bp(this,tl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Bp(this,tl).set(e,t)}};tl=new WeakMap;var pk=new Set(["lazy","caseSensitive","path","id","index","children"]);function hk(e){return pk.has(e)}var mk=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function gk(e){return mk.has(e)}function xk(e){return e.index===!0}function hl(e,t,r=[],a={},o=!1){return e.map((l,u)=>{let f=[...r,String(u)],h=typeof l.id=="string"?l.id:f.join("-");if(rt(l.index!==!0||!l.children,"Cannot specify children on an index route"),rt(o||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),xk(l)){let p={...l,id:h};return a[h]=d0(p,t(p)),p}else{let p={...l,id:h,children:void 0};return a[h]=d0(p,t(p)),l.children&&(p.children=hl(l.children,t,f,a,o)),p}})}function d0(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function os(e,t,r="/"){return nl(e,t,r,!1)}function nl(e,t,r,a){let o=typeof t=="string"?Da(t):t,l=Sr(o.pathname||"/",r);if(l==null)return null;let u=K_(e);bk(u);let f=null;for(let h=0;f==null&&h<u.length;++h){let p=Tk(l);f=Ck(u[h],p,a)}return f}function yk(e,t){let{route:r,pathname:a,params:o}=e;return{id:r.id,pathname:a,params:o,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function K_(e,t=[],r=[],a="",o=!1){let l=(u,f,h=o,p)=>{let m={relativePath:p===void 0?u.path||"":p,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&h)return;rt(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let x=Lr([a,m.relativePath]),v=r.concat(m);u.children&&u.children.length>0&&(rt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),K_(u.children,t,v,x,h)),!(u.path==null&&!u.index)&&t.push({path:x,score:Nk(x,u.index),routesMeta:v})};return e.forEach((u,f)=>{if(u.path===""||!u.path?.includes("?"))l(u,f);else for(let h of X_(u.path))l(u,f,!0,h)}),t}function X_(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,o=r.endsWith("?"),l=r.replace(/\?$/,"");if(a.length===0)return o?[l,""]:[l];let u=X_(a.join("/")),f=[];return f.push(...u.map(h=>h===""?l:[l,h].join("/"))),o&&f.push(...u),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function bk(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ek(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var vk=/^:[\w-]+$/,_k=3,wk=2,Sk=1,jk=10,kk=-2,f0=e=>e==="*";function Nk(e,t){let r=e.split("/"),a=r.length;return r.some(f0)&&(a+=kk),t&&(a+=wk),r.filter(o=>!f0(o)).reduce((o,l)=>o+(vk.test(l)?_k:l===""?Sk:jk),a)}function Ek(e,t){return e.length===t.length&&e.slice(0,-1).every((a,o)=>a===t[o])?e[e.length-1]-t[t.length-1]:0}function Ck(e,t,r=!1){let{routesMeta:a}=e,o={},l="/",u=[];for(let f=0;f<a.length;++f){let h=a[f],p=f===a.length-1,m=l==="/"?t:t.slice(l.length)||"/",x=zu({path:h.relativePath,caseSensitive:h.caseSensitive,end:p},m),v=h.route;if(!x&&p&&r&&!a[a.length-1].route.index&&(x=zu({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!x)return null;Object.assign(o,x.params),u.push({params:o,pathname:Lr([l,x.pathname]),pathnameBase:Dk(Lr([l,x.pathnameBase])),route:v}),x.pathnameBase!=="/"&&(l=Lr([l,x.pathnameBase]))}return u}function zu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Rk(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let l=o[0],u=l.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:a.reduce((p,{paramName:m,isOptional:x},v)=>{if(m==="*"){let w=f[v]||"";u=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const _=f[v];return x&&!_?p[m]=void 0:p[m]=(_||"").replace(/%2F/g,"/"),p},{}),pathname:l,pathnameBase:u,pattern:e}}function Rk(e,t=!1,r=!0){Gt(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 a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,h,p,m)=>{if(a.push({paramName:f,isOptional:h!=null}),h){let x=m.charAt(p+u.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}function Tk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gt(!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 Sr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Ak({basename:e,pathname:t}){return t==="/"?e:Lr([e,t])}var Q_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,im=e=>Q_.test(e);function Lk(e,t="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?Da(e):e,l;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?l=p0(r.substring(1),"/"):l=p0(r,t)):l=t,{pathname:l,search:Ok(a),hash:Mk(o)}}function p0(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Ip(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Z_(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function rd(e){let t=Z_(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Cl(e,t,r,a=!1){let o;typeof e=="string"?o=Da(e):(o={...e},rt(!o.pathname||!o.pathname.includes("?"),Ip("?","pathname","search",o)),rt(!o.pathname||!o.pathname.includes("#"),Ip("#","pathname","hash",o)),rt(!o.search||!o.search.includes("#"),Ip("#","search","hash",o)));let l=e===""||o.pathname==="",u=l?"/":o.pathname,f;if(u==null)f=r;else{let x=t.length-1;if(!a&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),x-=1;o.pathname=v.join("/")}f=x>=0?t[x]:"/"}let h=Lk(o,f),p=u&&u!=="/"&&u.endsWith("/"),m=(l||u===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(p||m)&&(h.pathname+="/"),h}var Lr=e=>e.join("/").replace(/\/\/+/g,"/"),Dk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ok=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Rl=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Uo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Tl(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var J_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function W_(e,t){let r=e;if(typeof r!="string"||!Q_.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(J_)try{let l=new URL(window.location.href),u=r.startsWith("//")?new URL(l.protocol+r):new URL(r),f=Sr(u.pathname,t);u.origin===l.origin&&f!=null?r=f+u.search+u.hash:o=!0}catch{Gt(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:r}}var ls=Symbol("Uninstrumented");function zk(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(l){let u=Object.keys(r);for(let f of u)l[f]&&r[f].push(l[f])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let o=Oo(r.lazy,t.lazy,()=>{});o&&(a.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(l=>{let u=o[l],f=r[`lazy.${l}`];if(typeof u=="function"&&f.length>0){let h=Oo(f,u,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[l]:h}))}})}return["loader","action"].forEach(o=>{let l=t[o];if(typeof l=="function"&&r[o].length>0){let u=l[ls]??l,f=Oo(r[o],u,(...h)=>h0(h[0]));f&&(o==="loader"&&u.hydrate===!0&&(f.hydrate=!0),f[ls]=u,a[o]=f)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(o=>{let l=o[ls]??o,u=Oo(r.middleware,l,(...f)=>h0(f[0]));return u?(u[ls]=l,u):o})),a}function $k(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(o){let l=Object.keys(o);for(let u of l)o[u]&&r[u].push(o[u])}})),r.navigate.length>0){let a=e.navigate[ls]??e.navigate,o=Oo(r.navigate,a,(...l)=>{let[u,f]=l;return{to:typeof u=="number"||typeof u=="string"?u:u?Jr(u):".",...m0(e,f??{})}});o&&(o[ls]=a,e.navigate=o)}if(r.fetch.length>0){let a=e.fetch[ls]??e.fetch,o=Oo(r.fetch,a,(...l)=>{let[u,,f,h]=l;return{href:f??".",fetcherKey:u,...m0(e,h??{})}});o&&(o[ls]=a,e.fetch=o)}return e}function Oo(e,t,r){return e.length===0?null:async(...a)=>{let o=await e1(e,r(...a),()=>t(...a),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function e1(e,t,r,a){let o=e[a],l;if(o){let u,f=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=e1(e,t,r,a-1),l=await u,rt(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await o(f,t)}catch(h){console.error("An instrumentation function threw an error:",h)}u||await f(),await u}else try{l={type:"success",value:await r()}}catch(u){l={type:"error",value:u}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function h0(e){let{request:t,context:r,params:a,unstable_pattern:o}=e;return{request:Bk(t),params:{...a},unstable_pattern:o,context:Ik(r)}}function m0(e,t){return{currentUrl:Jr(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 Bk(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ik(e){if(Pk(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Uk=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Pk(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")===Uk}var t1=["POST","PUT","PATCH","DELETE"],Hk=new Set(t1),qk=["GET",...t1],Fk=new Set(qk),n1=new Set([301,302,303,307,308]),Gk=new Set([307,308]),Up={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ui={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Yk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),r1="remix-router-transitions",a1=Symbol("ResetLoaderData");function Kk(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";rt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],o=e.mapRouteProperties||Yk,l=o;if(e.unstable_instrumentations){let I=e.unstable_instrumentations;l=G=>({...o(G),...zk(I.map(Z=>Z.route).filter(Boolean),G)})}let u={},f=hl(e.routes,l,void 0,u),h,p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let m=e.dataStrategy||Wk,x={...e.future},v=null,_=new Set,w=null,S=null,k=null,N=e.hydrationData!=null,R=os(f,e.history.location,p),E=!1,D=null,L,$;if(R==null&&!e.patchRoutesOnNavigation){let I=_r(404,{pathname:e.history.location.pathname}),{matches:G,route:Z}=ru(f);L=!0,$=!L,R=G,D={[Z.id]:I}}else if(R&&!e.hydrationData&&ur(R,f,e.history.location.pathname).active&&(R=null),R)if(R.some(I=>I.route.lazy))L=!1,$=!L;else if(!R.some(I=>lm(I.route)))L=!0,$=!L;else{let I=e.hydrationData?e.hydrationData.loaderData:null,G=e.hydrationData?e.hydrationData.errors:null,Z=R;if(G){let xe=R.findIndex(we=>G[we.route.id]!==void 0);Z=Z.slice(0,xe+1)}$=!1,L=Z.every(xe=>{let we=s1(xe.route,I,G);return $=$||we.renderFallback,!we.shouldLoad})}else{L=!1,$=!L,R=[];let I=ur(null,f,e.history.location.pathname);I.active&&I.matches&&(E=!0,R=I.matches)}let z,T={historyAction:e.history.action,location:e.history.location,matches:R,initialized:L,renderFallback:$,navigation:Up,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||D,fetchers:new Map,blockers:new Map},B="POP",H=null,J=!1,oe,ce=!1,M=new Map,P=null,A=!1,F=!1,ee=new Set,ae=new Map,W=0,O=-1,V=new Map,re=new Set,se=new Map,ne=new Map,ge=new Set,Ne=new Map,Fe,qe=null;function be(){if(v=e.history.listen(({action:I,location:G,delta:Z})=>{if(Fe){Fe(),Fe=void 0;return}Gt(Ne.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 xe=St({currentLocation:T.location,nextLocation:G,historyAction:I});if(xe&&Z!=null){let we=new Promise(Re=>{Fe=Re});e.history.go(Z*-1),Ue(xe,{state:"blocked",location:G,proceed(){Ue(xe,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),we.then(()=>e.history.go(Z))},reset(){let Re=new Map(T.blockers);Re.set(xe,Ui),he({blockers:Re})}}),H?.resolve(),H=null;return}return Xe(I,G)}),r){xN(t,M);let I=()=>yN(t,M);t.addEventListener("pagehide",I),P=()=>t.removeEventListener("pagehide",I)}return T.initialized||Xe("POP",T.location,{initialHydration:!0}),z}function fe(){v&&v(),P&&P(),_.clear(),oe&&oe.abort(),T.fetchers.forEach((I,G)=>gn(G)),T.blockers.forEach((I,G)=>me(G))}function _e(I){return _.add(I),()=>_.delete(I)}function he(I,G={}){I.matches&&(I.matches=I.matches.map(we=>{let Re=u[we.route.id],je=we.route;return je.element!==Re.element||je.errorElement!==Re.errorElement||je.hydrateFallbackElement!==Re.hydrateFallbackElement?{...we,route:Re}:we})),T={...T,...I};let Z=[],xe=[];T.fetchers.forEach((we,Re)=>{we.state==="idle"&&(ge.has(Re)?Z.push(Re):xe.push(Re))}),ge.forEach(we=>{!T.fetchers.has(we)&&!ae.has(we)&&Z.push(we)}),[..._].forEach(we=>we(T,{deletedFetchers:Z,newErrors:I.errors??null,viewTransitionOpts:G.viewTransitionOpts,flushSync:G.flushSync===!0})),Z.forEach(we=>gn(we)),xe.forEach(we=>T.fetchers.delete(we))}function ve(I,G,{flushSync:Z}={}){let xe=T.actionData!=null&&T.navigation.formMethod!=null&&kn(T.navigation.formMethod)&&T.navigation.state==="loading"&&I.state?._isRedirect!==!0,we;G.actionData?Object.keys(G.actionData).length>0?we=G.actionData:we=null:xe?we=T.actionData:we=null;let Re=G.loaderData?k0(T.loaderData,G.loaderData,G.matches||[],G.errors):T.loaderData,je=T.blockers;je.size>0&&(je=new Map(je),je.forEach((Pe,Be)=>je.set(Be,Ui)));let ke=A?!1:oa(I,G.matches||T.matches),Ce=J===!0||T.navigation.formMethod!=null&&kn(T.navigation.formMethod)&&I.state?._isRedirect!==!0;h&&(f=h,h=void 0),A||B==="POP"||(B==="PUSH"?e.history.push(I,I.state):B==="REPLACE"&&e.history.replace(I,I.state));let Ie;if(B==="POP"){let Pe=M.get(T.location.pathname);Pe&&Pe.has(I.pathname)?Ie={currentLocation:T.location,nextLocation:I}:M.has(I.pathname)&&(Ie={currentLocation:I,nextLocation:T.location})}else if(ce){let Pe=M.get(T.location.pathname);Pe?Pe.add(I.pathname):(Pe=new Set([I.pathname]),M.set(T.location.pathname,Pe)),Ie={currentLocation:T.location,nextLocation:I}}he({...G,actionData:we,loaderData:Re,historyAction:B,location:I,initialized:!0,renderFallback:!1,navigation:Up,revalidation:"idle",restoreScrollPosition:ke,preventScrollReset:Ce,blockers:je},{viewTransitionOpts:Ie,flushSync:Z===!0}),B="POP",J=!1,ce=!1,A=!1,F=!1,H?.resolve(),H=null,qe?.resolve(),qe=null}async function Ve(I,G){if(H?.resolve(),H=null,typeof I=="number"){H||(H=R0());let Ee=H.promise;return e.history.go(I),Ee}let Z=yh(T.location,T.matches,p,I,G?.fromRouteId,G?.relative),{path:xe,submission:we,error:Re}=g0(!1,Z,G),je;G?.unstable_mask&&(je={pathname:"",search:"",hash:"",...typeof G.unstable_mask=="string"?Da(G.unstable_mask):{...T.location.unstable_mask,...G.unstable_mask}});let ke=T.location,Ce=pl(ke,xe,G&&G.state,void 0,je);Ce={...Ce,...e.history.encodeLocation(Ce)};let Ie=G&&G.replace!=null?G.replace:void 0,Pe="PUSH";Ie===!0?Pe="REPLACE":Ie===!1||we!=null&&kn(we.formMethod)&&we.formAction===T.location.pathname+T.location.search&&(Pe="REPLACE");let Be=G&&"preventScrollReset"in G?G.preventScrollReset===!0:void 0,dt=(G&&G.flushSync)===!0,ue=St({currentLocation:ke,nextLocation:Ce,historyAction:Pe});if(ue){Ue(ue,{state:"blocked",location:Ce,proceed(){Ue(ue,{state:"proceeding",proceed:void 0,reset:void 0,location:Ce}),Ve(I,G)},reset(){let Ee=new Map(T.blockers);Ee.set(ue,Ui),he({blockers:Ee})}});return}await Xe(Pe,Ce,{submission:we,pendingError:Re,preventScrollReset:Be,replace:G&&G.replace,enableViewTransition:G&&G.viewTransition,flushSync:dt,callSiteDefaultShouldRevalidate:G&&G.unstable_defaultShouldRevalidate})}function De(){qe||(qe=R0()),We(),he({revalidation:"loading"});let I=qe.promise;return T.navigation.state==="submitting"?I:T.navigation.state==="idle"?(Xe(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),I):(Xe(B||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ce===!0}),I)}async function Xe(I,G,Z){oe&&oe.abort(),oe=null,B=I,A=(Z&&Z.startUninterruptedRevalidation)===!0,Oa(T.location,T.matches),J=(Z&&Z.preventScrollReset)===!0,ce=(Z&&Z.enableViewTransition)===!0;let xe=h||f,we=Z&&Z.overrideNavigation,Re=Z?.initialHydration&&T.matches&&T.matches.length>0&&!E?T.matches:os(xe,G,p),je=(Z&&Z.flushSync)===!0;if(Re&&T.initialized&&!F&&iN(T.location,G)&&!(Z&&Z.submission&&kn(Z.submission.formMethod))){ve(G,{matches:Re},{flushSync:je});return}let ke=ur(Re,xe,G.pathname);if(ke.active&&ke.matches&&(Re=ke.matches),!Re){let{error:Te,notFoundMatches:Ge,route:Oe}=nt(G.pathname);ve(G,{matches:Ge,loaderData:{},errors:{[Oe.id]:Te}},{flushSync:je});return}oe=new AbortController;let Ce=Lo(e.history,G,oe.signal,Z&&Z.submission),Ie=e.getContext?await e.getContext():new u0,Pe;if(Z&&Z.pendingError)Pe=[is(Re).route.id,{type:"error",error:Z.pendingError}];else if(Z&&Z.submission&&kn(Z.submission.formMethod)){let Te=await It(Ce,G,Z.submission,Re,Ie,ke.active,Z&&Z.initialHydration===!0,{replace:Z.replace,flushSync:je});if(Te.shortCircuited)return;if(Te.pendingActionResult){let[Ge,Oe]=Te.pendingActionResult;if(ar(Oe)&&Uo(Oe.error)&&Oe.error.status===404){oe=null,ve(G,{matches:Te.matches,loaderData:{},errors:{[Ge]:Oe.error}});return}}Re=Te.matches||Re,Pe=Te.pendingActionResult,we=Pp(G,Z.submission),je=!1,ke.active=!1,Ce=Lo(e.history,Ce.url,Ce.signal)}let{shortCircuited:Be,matches:dt,loaderData:ue,errors:Ee}=await un(Ce,G,Re,Ie,ke.active,we,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,je,Pe,Z&&Z.callSiteDefaultShouldRevalidate);Be||(oe=null,ve(G,{matches:dt||Re,...N0(Pe),loaderData:ue,errors:Ee}))}async function It(I,G,Z,xe,we,Re,je,ke={}){We();let Ce=mN(G,Z);if(he({navigation:Ce},{flushSync:ke.flushSync===!0}),Re){let Be=await An(xe,G.pathname,I.signal);if(Be.type==="aborted")return{shortCircuited:!0};if(Be.type==="error"){if(Be.partialMatches.length===0){let{matches:ue,route:Ee}=ru(f);return{matches:ue,pendingActionResult:[Ee.id,{type:"error",error:Be.error}]}}let dt=is(Be.partialMatches).route.id;return{matches:Be.partialMatches,pendingActionResult:[dt,{type:"error",error:Be.error}]}}else if(Be.matches)xe=Be.matches;else{let{notFoundMatches:dt,error:ue,route:Ee}=nt(G.pathname);return{matches:dt,pendingActionResult:[Ee.id,{type:"error",error:ue}]}}}let Ie,Pe=Su(xe,G);if(!Pe.route.action&&!Pe.route.lazy)Ie={type:"error",error:_r(405,{method:I.method,pathname:G.pathname,routeId:Pe.route.id})};else{let Be=Mo(l,u,I,xe,Pe,je?[]:a,we),dt=await Le(I,Be,we,null);if(Ie=dt[Pe.route.id],!Ie){for(let ue of xe)if(dt[ue.route.id]){Ie=dt[ue.route.id];break}}if(I.signal.aborted)return{shortCircuited:!0}}if(Ds(Ie)){let Be;return ke&&ke.replace!=null?Be=ke.replace:Be=w0(Ie.response.headers.get("Location"),new URL(I.url),p,e.history)===T.location.pathname+T.location.search,await Rn(I,Ie,!0,{submission:Z,replace:Be}),{shortCircuited:!0}}if(ar(Ie)){let Be=is(xe,Pe.route.id);return(ke&&ke.replace)!==!0&&(B="PUSH"),{matches:xe,pendingActionResult:[Be.route.id,Ie,Pe.route.id]}}return{matches:xe,pendingActionResult:[Pe.route.id,Ie]}}async function un(I,G,Z,xe,we,Re,je,ke,Ce,Ie,Pe,Be,dt){let ue=Re||Pp(G,je),Ee=je||ke||C0(ue),Te=!A&&!Ie;if(we){if(Te){let Yt=Vt(Be);he({navigation:ue,...Yt!==void 0?{actionData:Yt}:{}},{flushSync:Pe})}let at=await An(Z,G.pathname,I.signal);if(at.type==="aborted")return{shortCircuited:!0};if(at.type==="error"){if(at.partialMatches.length===0){let{matches:wn,route:Jt}=ru(f);return{matches:wn,loaderData:{},errors:{[Jt.id]:at.error}}}let Yt=is(at.partialMatches).route.id;return{matches:at.partialMatches,loaderData:{},errors:{[Yt]:at.error}}}else if(at.matches)Z=at.matches;else{let{error:Yt,notFoundMatches:wn,route:Jt}=nt(G.pathname);return{matches:wn,loaderData:{},errors:{[Jt.id]:Yt}}}}let Ge=h||f,{dsMatches:Oe,revalidatingFetchers:gt}=x0(I,xe,l,u,e.history,T,Z,Ee,G,Ie?[]:a,Ie===!0,F,ee,ge,se,re,Ge,p,e.patchRoutesOnNavigation!=null,Be,dt);if(O=++W,!e.dataStrategy&&!Oe.some(at=>at.shouldLoad)&&!Oe.some(at=>at.route.middleware&&at.route.middleware.length>0)&>.length===0){let at=Er();return ve(G,{matches:Z,loaderData:{},errors:Be&&ar(Be[1])?{[Be[0]]:Be[1].error}:null,...N0(Be),...at?{fetchers:new Map(T.fetchers)}:{}},{flushSync:Pe}),{shortCircuited:!0}}if(Te){let at={};if(!we){at.navigation=ue;let Yt=Vt(Be);Yt!==void 0&&(at.actionData=Yt)}gt.length>0&&(at.fetchers=Bn(gt)),he(at,{flushSync:Pe})}gt.forEach(at=>{Et(at.key),at.controller&&ae.set(at.key,at.controller)});let it=()=>gt.forEach(at=>Et(at.key));oe&&oe.signal.addEventListener("abort",it);let{loaderResults:an,fetcherResults:_n}=await Ze(Oe,gt,I,xe);if(I.signal.aborted)return{shortCircuited:!0};oe&&oe.signal.removeEventListener("abort",it),gt.forEach(at=>ae.delete(at.key));let dn=au(an);if(dn)return await Rn(I,dn.result,!0,{replace:Ce}),{shortCircuited:!0};if(dn=au(_n),dn)return re.add(dn.key),await Rn(I,dn.result,!0,{replace:Ce}),{shortCircuited:!0};let{loaderData:Br,errors:fs}=j0(T,Z,an,Be,gt,_n);Ie&&T.errors&&(fs={...T.errors,...fs});let Ir=Er(),ps=zr(O),Gs=Ir||ps||gt.length>0;return{matches:Z,loaderData:Br,errors:fs,...Gs?{fetchers:new Map(T.fetchers)}:{}}}function Vt(I){if(I&&!ar(I[1]))return{[I[0]]:I[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Bn(I){return I.forEach(G=>{let Z=T.fetchers.get(G.key),xe=Pi(void 0,Z?Z.data:void 0);T.fetchers.set(G.key,xe)}),new Map(T.fetchers)}async function cr(I,G,Z,xe){Et(I);let we=(xe&&xe.flushSync)===!0,Re=h||f,je=yh(T.location,T.matches,p,Z,G,xe?.relative),ke=os(Re,je,p),Ce=ur(ke,Re,je);if(Ce.active&&Ce.matches&&(ke=Ce.matches),!ke){ft(I,G,_r(404,{pathname:je}),{flushSync:we});return}let{path:Ie,submission:Pe,error:Be}=g0(!0,je,xe);if(Be){ft(I,G,Be,{flushSync:we});return}let dt=e.getContext?await e.getContext():new u0,ue=(xe&&xe.preventScrollReset)===!0;if(Pe&&kn(Pe.formMethod)){await Xn(I,G,Ie,ke,dt,Ce.active,we,ue,Pe,xe&&xe.unstable_defaultShouldRevalidate);return}se.set(I,{routeId:G,path:Ie}),await Ht(I,G,Ie,ke,dt,Ce.active,we,ue,Pe)}async function Xn(I,G,Z,xe,we,Re,je,ke,Ce,Ie){We(),se.delete(I);let Pe=T.fetchers.get(I);Nt(I,gN(Ce,Pe),{flushSync:je});let Be=new AbortController,dt=Lo(e.history,Z,Be.signal,Ce);if(Re){let Ot=await An(xe,new URL(dt.url).pathname,dt.signal,I);if(Ot.type==="aborted")return;if(Ot.type==="error"){ft(I,G,Ot.error,{flushSync:je});return}else if(Ot.matches)xe=Ot.matches;else{ft(I,G,_r(404,{pathname:Z}),{flushSync:je});return}}let ue=Su(xe,Z);if(!ue.route.action&&!ue.route.lazy){let Ot=_r(405,{method:Ce.formMethod,pathname:Z,routeId:G});ft(I,G,Ot,{flushSync:je});return}ae.set(I,Be);let Ee=W,Te=Mo(l,u,dt,xe,ue,a,we),Ge=await Le(dt,Te,we,I),Oe=Ge[ue.route.id];if(!Oe){for(let Ot of Te)if(Ge[Ot.route.id]){Oe=Ge[Ot.route.id];break}}if(dt.signal.aborted){ae.get(I)===Be&&ae.delete(I);return}if(ge.has(I)){if(Ds(Oe)||ar(Oe)){Nt(I,Ea(void 0));return}}else{if(Ds(Oe))if(ae.delete(I),O>Ee){Nt(I,Ea(void 0));return}else return re.add(I),Nt(I,Pi(Ce)),Rn(dt,Oe,!1,{fetcherSubmission:Ce,preventScrollReset:ke});if(ar(Oe)){ft(I,G,Oe.error);return}}let gt=T.navigation.location||T.location,it=Lo(e.history,gt,Be.signal),an=h||f,_n=T.navigation.state!=="idle"?os(an,T.navigation.location,p):T.matches;rt(_n,"Didn't find any matches after fetcher action");let dn=++W;V.set(I,dn);let Br=Pi(Ce,Oe.data);T.fetchers.set(I,Br);let{dsMatches:fs,revalidatingFetchers:Ir}=x0(it,we,l,u,e.history,T,_n,Ce,gt,a,!1,F,ee,ge,se,re,an,p,e.patchRoutesOnNavigation!=null,[ue.route.id,Oe],Ie);Ir.filter(Ot=>Ot.key!==I).forEach(Ot=>{let Vs=Ot.key,Ys=T.fetchers.get(Vs),Gl=Pi(void 0,Ys?Ys.data:void 0);T.fetchers.set(Vs,Gl),Et(Vs),Ot.controller&&ae.set(Vs,Ot.controller)}),he({fetchers:new Map(T.fetchers)});let ps=()=>Ir.forEach(Ot=>Et(Ot.key));Be.signal.addEventListener("abort",ps);let{loaderResults:Gs,fetcherResults:at}=await Ze(fs,Ir,it,we);if(Be.signal.aborted)return;if(Be.signal.removeEventListener("abort",ps),V.delete(I),ae.delete(I),Ir.forEach(Ot=>ae.delete(Ot.key)),T.fetchers.has(I)){let Ot=Ea(Oe.data);T.fetchers.set(I,Ot)}let Yt=au(Gs);if(Yt)return Rn(it,Yt.result,!1,{preventScrollReset:ke});if(Yt=au(at),Yt)return re.add(Yt.key),Rn(it,Yt.result,!1,{preventScrollReset:ke});let{loaderData:wn,errors:Jt}=j0(T,_n,Gs,void 0,Ir,at);zr(dn),T.navigation.state==="loading"&&dn>O?(rt(B,"Expected pending action"),oe&&oe.abort(),ve(T.navigation.location,{matches:_n,loaderData:wn,errors:Jt,fetchers:new Map(T.fetchers)})):(he({errors:Jt,loaderData:k0(T.loaderData,wn,_n,Jt),fetchers:new Map(T.fetchers)}),F=!1)}async function Ht(I,G,Z,xe,we,Re,je,ke,Ce){let Ie=T.fetchers.get(I);Nt(I,Pi(Ce,Ie?Ie.data:void 0),{flushSync:je});let Pe=new AbortController,Be=Lo(e.history,Z,Pe.signal);if(Re){let Oe=await An(xe,new URL(Be.url).pathname,Be.signal,I);if(Oe.type==="aborted")return;if(Oe.type==="error"){ft(I,G,Oe.error,{flushSync:je});return}else if(Oe.matches)xe=Oe.matches;else{ft(I,G,_r(404,{pathname:Z}),{flushSync:je});return}}let dt=Su(xe,Z);ae.set(I,Pe);let ue=W,Ee=Mo(l,u,Be,xe,dt,a,we),Ge=(await Le(Be,Ee,we,I))[dt.route.id];if(ae.get(I)===Pe&&ae.delete(I),!Be.signal.aborted){if(ge.has(I)){Nt(I,Ea(void 0));return}if(Ds(Ge))if(O>ue){Nt(I,Ea(void 0));return}else{re.add(I),await Rn(Be,Ge,!1,{preventScrollReset:ke});return}if(ar(Ge)){ft(I,G,Ge.error);return}Nt(I,Ea(Ge.data))}}async function Rn(I,G,Z,{submission:xe,fetcherSubmission:we,preventScrollReset:Re,replace:je}={}){Z||(H?.resolve(),H=null),G.response.headers.has("X-Remix-Revalidate")&&(F=!0);let ke=G.response.headers.get("Location");rt(ke,"Expected a Location header on the redirect Response"),ke=w0(ke,new URL(I.url),p,e.history);let Ce=pl(T.location,ke,{_isRedirect:!0});if(r){let Ee=!1;if(G.response.headers.has("X-Remix-Reload-Document"))Ee=!0;else if(im(ke)){const Te=Y_(ke,!0);Ee=Te.origin!==t.location.origin||Sr(Te.pathname,p)==null}if(Ee){je?t.location.replace(ke):t.location.assign(ke);return}}oe=null;let Ie=je===!0||G.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Pe,formAction:Be,formEncType:dt}=T.navigation;!xe&&!we&&Pe&&Be&&dt&&(xe=C0(T.navigation));let ue=xe||we;if(Gk.has(G.response.status)&&ue&&kn(ue.formMethod))await Xe(Ie,Ce,{submission:{...ue,formAction:ke},preventScrollReset:Re||J,enableViewTransition:Z?ce:void 0});else{let Ee=Pp(Ce,xe);await Xe(Ie,Ce,{overrideNavigation:Ee,fetcherSubmission:we,preventScrollReset:Re||J,enableViewTransition:Z?ce:void 0})}}async function Le(I,G,Z,xe){let we,Re={};try{we=await tN(m,I,G,xe,Z,!1)}catch(je){return G.filter(ke=>ke.shouldLoad).forEach(ke=>{Re[ke.route.id]={type:"error",error:je}}),Re}if(I.signal.aborted)return Re;if(!kn(I.method))for(let je of G){if(we[je.route.id]?.type==="error")break;!we.hasOwnProperty(je.route.id)&&!T.loaderData.hasOwnProperty(je.route.id)&&(!T.errors||!T.errors.hasOwnProperty(je.route.id))&&je.shouldCallHandler()&&(we[je.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${je.route.id}`)})}for(let[je,ke]of Object.entries(we))if(dN(ke)){let Ce=ke.result;Re[je]={type:"redirect",response:sN(Ce,I,je,G,p)}}else Re[je]=await aN(ke);return Re}async function Ze(I,G,Z,xe){let we=Le(Z,I,xe,null),Re=Promise.all(G.map(async Ce=>{if(Ce.matches&&Ce.match&&Ce.request&&Ce.controller){let Pe=(await Le(Ce.request,Ce.matches,xe,Ce.key))[Ce.match.route.id];return{[Ce.key]:Pe}}else return Promise.resolve({[Ce.key]:{type:"error",error:_r(404,{pathname:Ce.path})}})})),je=await we,ke=(await Re).reduce((Ce,Ie)=>Object.assign(Ce,Ie),{});return{loaderResults:je,fetcherResults:ke}}function We(){F=!0,se.forEach((I,G)=>{ae.has(G)&&ee.add(G),Et(G)})}function Nt(I,G,Z={}){T.fetchers.set(I,G),he({fetchers:new Map(T.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function ft(I,G,Z,xe={}){let we=is(T.matches,G);gn(I),he({errors:{[we.route.id]:Z},fetchers:new Map(T.fetchers)},{flushSync:(xe&&xe.flushSync)===!0})}function Tn(I){return ne.set(I,(ne.get(I)||0)+1),ge.has(I)&&ge.delete(I),T.fetchers.get(I)||Vk}function mn(I,G){Et(I,G?.reason),Nt(I,Ea(null))}function gn(I){let G=T.fetchers.get(I);ae.has(I)&&!(G&&G.state==="loading"&&V.has(I))&&Et(I),se.delete(I),V.delete(I),re.delete(I),ge.delete(I),ee.delete(I),T.fetchers.delete(I)}function Lt(I){let G=(ne.get(I)||0)-1;G<=0?(ne.delete(I),ge.add(I)):ne.set(I,G),he({fetchers:new Map(T.fetchers)})}function Et(I,G){let Z=ae.get(I);Z&&(Z.abort(G),ae.delete(I))}function Pt(I){for(let G of I){let Z=Tn(G),xe=Ea(Z.data);T.fetchers.set(G,xe)}}function Er(){let I=[],G=!1;for(let Z of re){let xe=T.fetchers.get(Z);rt(xe,`Expected fetcher: ${Z}`),xe.state==="loading"&&(re.delete(Z),I.push(Z),G=!0)}return Pt(I),G}function zr(I){let G=[];for(let[Z,xe]of V)if(xe<I){let we=T.fetchers.get(Z);rt(we,`Expected fetcher: ${Z}`),we.state==="loading"&&(Et(Z),V.delete(Z),G.push(Z))}return Pt(G),G.length>0}function sa(I,G){let Z=T.blockers.get(I)||Ui;return Ne.get(I)!==G&&Ne.set(I,G),Z}function me(I){T.blockers.delete(I),Ne.delete(I)}function Ue(I,G){let Z=T.blockers.get(I)||Ui;rt(Z.state==="unblocked"&&G.state==="blocked"||Z.state==="blocked"&&G.state==="blocked"||Z.state==="blocked"&&G.state==="proceeding"||Z.state==="blocked"&&G.state==="unblocked"||Z.state==="proceeding"&&G.state==="unblocked",`Invalid blocker state transition: ${Z.state} -> ${G.state}`);let xe=new Map(T.blockers);xe.set(I,G),he({blockers:xe})}function St({currentLocation:I,nextLocation:G,historyAction:Z}){if(Ne.size===0)return;Ne.size>1&&Gt(!1,"A router only supports one blocker at a time");let xe=Array.from(Ne.entries()),[we,Re]=xe[xe.length-1],je=T.blockers.get(we);if(!(je&&je.state==="proceeding")&&Re({currentLocation:I,nextLocation:G,historyAction:Z}))return we}function nt(I){let G=_r(404,{pathname:I}),Z=h||f,{matches:xe,route:we}=ru(Z);return{notFoundMatches:xe,route:we,error:G}}function Ct(I,G,Z){if(w=I,k=G,S=Z||null,!N&&T.navigation===Up){N=!0;let xe=oa(T.location,T.matches);xe!=null&&he({restoreScrollPosition:xe})}return()=>{w=null,k=null,S=null}}function Dt(I,G){return S&&S(I,G.map(xe=>yk(xe,T.loaderData)))||I.key}function Oa(I,G){if(w&&k){let Z=Dt(I,G);w[Z]=k()}}function oa(I,G){if(w){let Z=Dt(I,G),xe=w[Z];if(typeof xe=="number")return xe}return null}function ur(I,G,Z){if(e.patchRoutesOnNavigation)if(I){if(Object.keys(I[0].params).length>0)return{active:!0,matches:nl(G,Z,p,!0)}}else return{active:!0,matches:nl(G,Z,p,!0)||[]};return{active:!1,matches:null}}async function An(I,G,Z,xe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:I};let we=I;for(;;){let Re=h==null,je=h||f,ke=u;try{await e.patchRoutesOnNavigation({signal:Z,path:G,matches:we,fetcherKey:xe,patch:(Pe,Be)=>{Z.aborted||y0(Pe,Be,je,ke,l,!1)}})}catch(Pe){return{type:"error",error:Pe,partialMatches:we}}finally{Re&&!Z.aborted&&(f=[...f])}if(Z.aborted)return{type:"aborted"};let Ce=os(je,G,p),Ie=null;if(Ce){if(Object.keys(Ce[0].params).length===0)return{type:"success",matches:Ce};if(Ie=nl(je,G,p,!0),!(Ie&&we.length<Ie.length&&$r(we,Ie.slice(0,we.length))))return{type:"success",matches:Ce}}if(Ie||(Ie=nl(je,G,p,!0)),!Ie||$r(we,Ie))return{type:"success",matches:null};we=Ie}}function $r(I,G){return I.length===G.length&&I.every((Z,xe)=>Z.route.id===G[xe].route.id)}function ia(I){u={},h=hl(I,l,void 0,u)}function Ma(I,G,Z=!1){let xe=h==null;y0(I,G,h||f,u,l,Z),xe&&(f=[...f],he({}))}return z={get basename(){return p},get future(){return x},get state(){return T},get routes(){return f},get window(){return t},initialize:be,subscribe:_e,enableScrollRestoration:Ct,navigate:Ve,fetch:cr,revalidate:De,createHref:I=>e.history.createHref(I),encodeLocation:I=>e.history.encodeLocation(I),getFetcher:Tn,resetFetcher:mn,deleteFetcher:Lt,dispose:fe,getBlocker:sa,deleteBlocker:me,patchRoutes:Ma,_internalFetchControllers:ae,_internalSetRoutes:ia,_internalSetStateDoNotUseOrYouWillBreakYourApp(I){he(I)}},e.unstable_instrumentations&&(z=$k(z,e.unstable_instrumentations.map(I=>I.router).filter(Boolean))),z}function Xk(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function yh(e,t,r,a,o,l){let u,f;if(o){u=[];for(let p of t)if(u.push(p),p.route.id===o){f=p;break}}else u=t,f=t[t.length-1];let h=Cl(a||".",rd(u),Sr(e.pathname,r)||e.pathname,l==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&f){let p=um(h.search);if(f.route.index&&!p)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&p){let m=new URLSearchParams(h.search),x=m.getAll("index");m.delete("index"),x.filter(_=>_).forEach(_=>m.append("index",_));let v=m.toString();h.search=v?`?${v}`:""}}return r!=="/"&&(h.pathname=Ak({basename:r,pathname:h.pathname})),Jr(h)}function g0(e,t,r){if(!r||!Xk(r))return{path:t};if(r.formMethod&&!hN(r.formMethod))return{path:t,error:_r(405,{method:r.formMethod})};let a=()=>({path:t,error:_r(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),u=d1(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!kn(l))return a();let x=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((v,[_,w])=>`${v}${_}=${w}
|
|
11
|
+
`,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:x}}}else if(r.formEncType==="application/json"){if(!kn(l))return a();try{let x=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:x,text:void 0}}}catch{return a()}}}rt(typeof FormData=="function","FormData is not available in this environment");let f,h;if(r.formData)f=vh(r.formData),h=r.formData;else if(r.body instanceof FormData)f=vh(r.body),h=r.body;else if(r.body instanceof URLSearchParams)f=r.body,h=S0(f);else if(r.body==null)f=new URLSearchParams,h=new FormData;else try{f=new URLSearchParams(r.body),h=S0(f)}catch{return a()}let p={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(kn(p.formMethod))return{path:t,submission:p};let m=Da(t);return e&&m.search&&um(m.search)&&f.append("index",""),m.search=`?${f}`,{path:Jr(m),submission:p}}function x0(e,t,r,a,o,l,u,f,h,p,m,x,v,_,w,S,k,N,R,E,D){let L=E?ar(E[1])?E[1].error:E[1].data:void 0,$=o.createURL(l.location),z=o.createURL(h),T;if(m&&l.errors){let P=Object.keys(l.errors)[0];T=u.findIndex(A=>A.route.id===P)}else if(E&&ar(E[1])){let P=E[0];T=u.findIndex(A=>A.route.id===P)-1}let B=E?E[1].statusCode:void 0,H=B&&B>=400,J={currentUrl:$,currentParams:l.matches[0]?.params||{},nextUrl:z,nextParams:u[0].params,...f,actionResult:L,actionStatus:B},oe=Tl(u),ce=u.map((P,A)=>{let{route:F}=P,ee=null;if(T!=null&&A>T)ee=!1;else if(F.lazy)ee=!0;else if(!lm(F))ee=!1;else if(m){let{shouldLoad:V}=s1(F,l.loaderData,l.errors);ee=V}else Qk(l.loaderData,l.matches[A],P)&&(ee=!0);if(ee!==null)return bh(r,a,e,oe,P,p,t,ee);let ae=!1;typeof D=="boolean"?ae=D:H?ae=!1:(x||$.pathname+$.search===z.pathname+z.search||$.search!==z.search||Zk(l.matches[A],P))&&(ae=!0);let W={...J,defaultShouldRevalidate:ae},O=cl(P,W);return bh(r,a,e,oe,P,p,t,O,W,D)}),M=[];return w.forEach((P,A)=>{if(m||!u.some(se=>se.route.id===P.routeId)||_.has(A))return;let F=l.fetchers.get(A),ee=F&&F.state!=="idle"&&F.data===void 0,ae=os(k,P.path,N);if(!ae){if(R&&ee)return;M.push({key:A,routeId:P.routeId,path:P.path,matches:null,match:null,request:null,controller:null});return}if(S.has(A))return;let W=Su(ae,P.path),O=new AbortController,V=Lo(o,P.path,O.signal),re=null;if(v.has(A))v.delete(A),re=Mo(r,a,V,ae,W,p,t);else if(ee)x&&(re=Mo(r,a,V,ae,W,p,t));else{let se;typeof D=="boolean"?se=D:H?se=!1:se=x;let ne={...J,defaultShouldRevalidate:se};cl(W,ne)&&(re=Mo(r,a,V,ae,W,p,t,ne))}re&&M.push({key:A,routeId:P.routeId,path:P.path,matches:re,match:W,request:V,controller:O})}),{dsMatches:ce,revalidatingFetchers:M}}function lm(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function s1(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!lm(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,o=r!=null&&r[e.id]!==void 0;if(!a&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let l=!a&&!o;return{shouldLoad:l,renderFallback:l}}function Qk(e,t,r){let a=!t||r.route.id!==t.route.id,o=!e.hasOwnProperty(r.route.id);return a||o}function Zk(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function cl(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function y0(e,t,r,a,o,l){let u;if(e){let p=a[e];rt(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),u=p.children}else u=r;let f=[],h=[];if(t.forEach(p=>{let m=u.find(x=>o1(p,x));m?h.push({existingRoute:m,newRoute:p}):f.push(p)}),f.length>0){let p=hl(f,o,[e||"_","patch",String(u?.length||"0")],a);u.push(...p)}if(l&&h.length>0)for(let p=0;p<h.length;p++){let{existingRoute:m,newRoute:x}=h[p],v=m,[_]=hl([x],o,[],{},!0);Object.assign(v,{element:_.element?_.element:v.element,errorElement:_.errorElement?_.errorElement:v.errorElement,hydrateFallbackElement:_.hydrateFallbackElement?_.hydrateFallbackElement:v.hydrateFallbackElement})}}function o1(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((r,a)=>t.children?.some(o=>o1(r,o)))??!1:!1}var b0=new WeakMap,i1=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let o=r[t.id];if(rt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let u=b0.get(o);u||(u={},b0.set(o,u));let f=u[e];if(f)return f;let h=(async()=>{let p=hk(e),x=o[e]!==void 0&&e!=="hasErrorBoundary";if(p)Gt(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(x)Gt(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(o,{[e]:v}),Object.assign(o,a(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(v=>v===void 0)&&(o.lazy=void 0))})();return u[e]=h,h},v0=new WeakMap;function Jk(e,t,r,a,o){let l=r[e.id];if(rt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=v0.get(l);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let x=(async()=>{rt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),_={};for(let w in v){let S=v[w];if(S===void 0)continue;let k=gk(w),R=l[w]!==void 0&&w!=="hasErrorBoundary";k?Gt(!k,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Gt(!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.`):_[w]=S}Object.assign(l,_),Object.assign(l,{...a(l),lazy:void 0})})();return v0.set(l,x),x.catch(()=>{}),{lazyRoutePromise:x,lazyHandlerPromise:x}}let u=Object.keys(e.lazy),f=[],h;for(let m of u){if(o&&o.includes(m))continue;let x=i1({key:m,route:e,manifest:r,mapRouteProperties:a});x&&(f.push(x),m===t&&(h=x))}let p=f.length>0?Promise.all(f).then(()=>{}):void 0;return p?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:h}}async function _0(e){let t=e.matches.filter(o=>o.shouldLoad),r={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,l)=>{r[t[l].route.id]=o}),r}async function Wk(e){return e.matches.some(t=>t.route.middleware)?l1(e,()=>_0(e)):_0(e)}function l1(e,t){return eN(e,t,a=>{if(pN(a))throw a;return a},cN,r);function r(a,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:a}}));{let{matches:u}=e,f=Math.min(Math.max(u.findIndex(p=>p.route.id===o),0),Math.max(u.findIndex(p=>p.shouldCallHandler()),0)),h=is(u,u[f].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function eN(e,t,r,a,o){let{matches:l,request:u,params:f,context:h,unstable_pattern:p}=e,m=l.flatMap(v=>v.route.middleware?v.route.middleware.map(_=>[v.route.id,_]):[]);return await c1({request:u,params:f,context:h,unstable_pattern:p},m,t,r,a,o)}async function c1(e,t,r,a,o,l,u=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let h=t[u];if(!h)return await r();let[p,m]=h,x,v=async()=>{if(x)throw new Error("You may only call `next()` once per middleware");try{return x={value:await c1(e,t,r,a,o,l,u+1)},x.value}catch(_){return x={value:await l(_,p,x)},x.value}};try{let _=await m(e,v),w=_!=null?a(_):void 0;return o(w)?w:x?w??x.value:(x={value:await v()},x.value)}catch(_){return await l(_,p,x)}}function u1(e,t,r,a,o){let l=i1({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),u=Jk(a.route,kn(r.method)?"action":"loader",t,e,o);return{middleware:l,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function bh(e,t,r,a,o,l,u,f,h=null,p){let m=!1,x=u1(e,t,r,o,l);return{...o,_lazyPromises:x,shouldLoad:f,shouldRevalidateArgs:h,shouldCallHandler(v){return m=!0,h?typeof p=="boolean"?cl(o,{...h,defaultShouldRevalidate:p}):typeof v=="boolean"?cl(o,{...h,defaultShouldRevalidate:v}):cl(o,h):f},resolve(v){let{lazy:_,loader:w,middleware:S}=o.route,k=m||f||v&&!kn(r.method)&&(_||w),N=S&&S.length>0&&!w&&!_;return k&&(kn(r.method)||!N)?nN({request:r,unstable_pattern:a,match:o,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:v,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function Mo(e,t,r,a,o,l,u,f=null){return a.map(h=>h.route.id!==o.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:u1(e,t,r,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:bh(e,t,r,Tl(a),h,l,u,!0,f))}async function tN(e,t,r,a,o,l){r.some(p=>p._lazyPromises?.middleware)&&await Promise.all(r.map(p=>p._lazyPromises?.middleware));let u={request:t,unstable_pattern:Tl(r),params:r[0].params,context:o,matches:r},h=await e({...u,fetcherKey:a,runClientMiddleware:p=>{let m=u;return l1(m,()=>p({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return h}async function nN({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:o,handlerOverride:l,scopedContext:u}){let f,h,p=kn(e.method),m=p?"action":"loader",x=v=>{let _,w=new Promise((N,R)=>_=R);h=()=>_(),e.signal.addEventListener("abort",h);let S=N=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${r.route.id}]`)):v({request:e,unstable_pattern:t,params:r.params,context:u},...N!==void 0?[N]:[]),k=(async()=>{try{return{type:"data",result:await(l?l(R=>S(R)):S())}}catch(N){return{type:"error",result:N}}})();return Promise.race([k,w])};try{let v=p?r.route.action:r.route.loader;if(a||o)if(v){let _,[w]=await Promise.all([x(v).catch(S=>{_=S}),a,o]);if(_!==void 0)throw _;f=w}else{await a;let _=p?r.route.action:r.route.loader;if(_)[f]=await Promise.all([x(_),o]);else if(m==="action"){let w=new URL(e.url),S=w.pathname+w.search;throw _r(405,{method:e.method,pathname:S,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(v)f=await x(v);else{let _=new URL(e.url),w=_.pathname+_.search;throw _r(404,{pathname:w})}}catch(v){return{type:"error",result:v}}finally{h&&e.signal.removeEventListener("abort",h)}return f}async function rN(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 aN(e){let{result:t,type:r}=e;if(cm(t)){let a;try{a=await rN(t)}catch(o){return{type:"error",error:o}}return r==="error"?{type:"error",error:new Rl(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?E0(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:lN(t),statusCode:Uo(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Uo(t)?t.status:void 0}:E0(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 sN(e,t,r,a,o){let l=e.headers.get("Location");if(rt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!im(l)){let u=a.slice(0,a.findIndex(f=>f.route.id===r)+1);l=yh(new URL(t.url),u,o,l),e.headers.set("Location",l)}return e}function w0(e,t,r,a){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(im(e)){let l=e,u=l.startsWith("//")?new URL(t.protocol+l):new URL(l);if(o.includes(u.protocol))throw new Error("Invalid redirect location");let f=Sr(u.pathname,r)!=null;if(u.origin===t.origin&&f)return u.pathname+u.search+u.hash}try{let l=a.createURL(e);if(o.includes(l.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Lo(e,t,r,a){let o=e.createURL(d1(t)).toString(),l={signal:r};if(a&&kn(a.formMethod)){let{formMethod:u,formEncType:f}=a;l.method=u.toUpperCase(),f==="application/json"?(l.headers=new Headers({"Content-Type":f}),l.body=JSON.stringify(a.json)):f==="text/plain"?l.body=a.text:f==="application/x-www-form-urlencoded"&&a.formData?l.body=vh(a.formData):l.body=a.formData}return new Request(o,l)}function vh(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function S0(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function oN(e,t,r,a=!1,o=!1){let l={},u=null,f,h=!1,p={},m=r&&ar(r[1])?r[1].error:void 0;return e.forEach(x=>{if(!(x.route.id in t))return;let v=x.route.id,_=t[v];if(rt(!Ds(_),"Cannot handle redirect results in processLoaderData"),ar(_)){let w=_.error;if(m!==void 0&&(w=m,m=void 0),u=u||{},o)u[v]=w;else{let S=is(e,v);u[S.route.id]==null&&(u[S.route.id]=w)}a||(l[v]=a1),h||(h=!0,f=Uo(_.error)?_.error.status:500),_.headers&&(p[v]=_.headers)}else l[v]=_.data,_.statusCode&&_.statusCode!==200&&!h&&(f=_.statusCode),_.headers&&(p[v]=_.headers)}),m!==void 0&&r&&(u={[r[0]]:m},r[2]&&(l[r[2]]=void 0)),{loaderData:l,errors:u,statusCode:f||200,loaderHeaders:p}}function j0(e,t,r,a,o,l){let{loaderData:u,errors:f}=oN(t,r,a);return o.filter(h=>!h.matches||h.matches.some(p=>p.shouldLoad)).forEach(h=>{let{key:p,match:m,controller:x}=h;if(x&&x.signal.aborted)return;let v=l[p];if(rt(v,"Did not find corresponding fetcher result"),ar(v)){let _=is(e.matches,m?.route.id);f&&f[_.route.id]||(f={...f,[_.route.id]:v.error}),e.fetchers.delete(p)}else if(Ds(v))rt(!1,"Unhandled fetcher revalidation redirect");else{let _=Ea(v.data);e.fetchers.set(p,_)}}),{loaderData:u,errors:f}}function k0(e,t,r,a){let o=Object.entries(t).filter(([,l])=>l!==a1).reduce((l,[u,f])=>(l[u]=f,l),{});for(let l of r){let u=l.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&l.route.loader&&(o[u]=e[u]),a&&a.hasOwnProperty(u))break}return o}function N0(e){return e?ar(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function is(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function ru(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function _r(e,{pathname:t,routeId:r,method:a,type:o,message:l}={}){let u="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(u="Bad Request",a&&t&&r?f=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:o==="invalid-body"&&(f="Unable to encode submission body")):e===403?(u="Forbidden",f=`Route "${r}" does not match URL "${t}"`):e===404?(u="Not Found",f=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",a&&t&&r?f=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(f=`Invalid request method "${a.toUpperCase()}"`)),new Rl(e||500,u,new Error(f),!0)}function au(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,o]=t[r];if(Ds(o))return{key:a,result:o}}}function d1(e){let t=typeof e=="string"?Da(e):e;return Jr({...t,hash:""})}function iN(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function lN(e){return new Rl(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function cN(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&uN(r))}function uN(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function dN(e){return cm(e.result)&&n1.has(e.result.status)}function ar(e){return e.type==="error"}function Ds(e){return(e&&e.type)==="redirect"}function E0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function cm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function fN(e){return n1.has(e)}function pN(e){return cm(e)&&fN(e.status)&&e.headers.has("Location")}function hN(e){return Fk.has(e.toUpperCase())}function kn(e){return Hk.has(e.toUpperCase())}function um(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Su(e,t){let r=typeof t=="string"?Da(t).search:t.search;if(e[e.length-1].route.index&&um(r||""))return e[e.length-1];let a=Z_(e);return a[a.length-1]}function C0(e){let{formMethod:t,formAction:r,formEncType:a,text:o,formData:l,json:u}=e;if(!(!t||!r||!a)){if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:t,formAction:r,formEncType:a,formData:l,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:u,text:void 0}}}function Pp(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 mN(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 Pi(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 gN(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 Ea(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 xN(e,t){try{let r=e.sessionStorage.getItem(r1);if(r){let a=JSON.parse(r);for(let[o,l]of Object.entries(a||{}))l&&Array.isArray(l)&&t.set(o,new Set(l||[]))}}catch{}}function yN(e,t){if(t.size>0){let r={};for(let[a,o]of t)r[a]=[...o];try{e.sessionStorage.setItem(r1,JSON.stringify(r))}catch(a){Gt(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function R0(){let e,t,r=new Promise((a,o)=>{e=async l=>{a(l);try{await r}catch{}},t=async l=>{o(l);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Hs=b.createContext(null);Hs.displayName="DataRouter";var Al=b.createContext(null);Al.displayName="DataRouterState";var f1=b.createContext(!1);function bN(){return b.useContext(f1)}var dm=b.createContext({isTransitioning:!1});dm.displayName="ViewTransition";var p1=b.createContext(new Map);p1.displayName="Fetchers";var vN=b.createContext(null);vN.displayName="Await";var ir=b.createContext(null);ir.displayName="Navigation";var ad=b.createContext(null);ad.displayName="Location";var kr=b.createContext({outlet:null,matches:[],isDataRoute:!1});kr.displayName="Route";var fm=b.createContext(null);fm.displayName="RouteError";var h1="REACT_ROUTER_ERROR",_N="REDIRECT",wN="ROUTE_ERROR_RESPONSE";function SN(e){if(e.startsWith(`${h1}:${_N}:{`))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 jN(e){if(e.startsWith(`${h1}:${wN}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Rl(t.status,t.statusText,t.data)}catch{}}function kN(e,{relative:t}={}){rt(Go(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=b.useContext(ir),{hash:o,pathname:l,search:u}=Ll(e,{relative:t}),f=l;return r!=="/"&&(f=l==="/"?r:Lr([r,l])),a.createHref({pathname:f,search:u,hash:o})}function Go(){return b.useContext(ad)!=null}function Nr(){return rt(Go(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(ad).location}var m1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function g1(e){b.useContext(ir).static||b.useLayoutEffect(e)}function At(){let{isDataRoute:e}=b.useContext(kr);return e?IN():NN()}function NN(){rt(Go(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Hs),{basename:t,navigator:r}=b.useContext(ir),{matches:a}=b.useContext(kr),{pathname:o}=Nr(),l=JSON.stringify(rd(a)),u=b.useRef(!1);return g1(()=>{u.current=!0}),b.useCallback((h,p={})=>{if(Gt(u.current,m1),!u.current)return;if(typeof h=="number"){r.go(h);return}let m=Cl(h,JSON.parse(l),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Lr([t,m.pathname])),(p.replace?r.replace:r.push)(m,p.state,p)},[t,r,l,o,e])}var EN=b.createContext(null);function CN(e){let t=b.useContext(kr).outlet;return b.useMemo(()=>t&&b.createElement(EN.Provider,{value:e},t),[t,e])}function Vo(){let{matches:e}=b.useContext(kr),t=e[e.length-1];return t?t.params:{}}function Ll(e,{relative:t}={}){let{matches:r}=b.useContext(kr),{pathname:a}=Nr(),o=JSON.stringify(rd(r));return b.useMemo(()=>Cl(e,JSON.parse(o),a,t==="path"),[e,o,a,t])}function RN(e,t,r){rt(Go(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(ir),{matches:o}=b.useContext(kr),l=o[o.length-1],u=l?l.params:{},f=l?l.pathname:"/",h=l?l.pathnameBase:"/",p=l&&l.route;{let k=p&&p.path||"";b1(f,!p||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
12
|
+
|
|
13
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let m=Nr(),x;x=m;let v=x.pathname||"/",_=v;if(h!=="/"){let k=h.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=os(e,{pathname:_});return Gt(p||w!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Gt(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 "${x.pathname}${x.search}${x.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.`),ON(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},u,k.params),pathname:Lr([h,a.encodeLocation?a.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:Lr([h,a.encodeLocation?a.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),o,r)}function TN(){let e=y1(),t=Uo(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},l={padding:"2px 4px",backgroundColor:a},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:l},"ErrorBoundary")," or"," ",b.createElement("code",{style:l},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),r?b.createElement("pre",{style:o},r):null,u)}var AN=b.createElement(TN,null),x1=class extends b.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 r=jN(e.digest);r&&(e=r)}let t=e!==void 0?b.createElement(kr.Provider,{value:this.props.routeContext},b.createElement(fm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(LN,{error:e},t):t}};x1.contextType=f1;var Hp=new WeakMap;function LN({children:e,error:t}){let{basename:r}=b.useContext(ir);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=SN(t.digest);if(a){let o=Hp.get(t);if(o)throw o;let l=W_(a.location,r);if(J_&&!Hp.get(t))if(l.isExternal||a.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:a.replace}));throw Hp.set(t,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function DN({routeContext:e,match:t,children:r}){let a=b.useContext(Hs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(kr.Provider,{value:e},r)}function ON(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,l=a?.errors;if(l!=null){let m=o.findIndex(x=>x.route.id&&l?.[x.route.id]!==void 0);rt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let u=!1,f=-1;if(r&&a){u=a.renderFallback;for(let m=0;m<o.length;m++){let x=o[m];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(f=m),x.route.id){let{loaderData:v,errors:_}=a,w=x.route.loader&&!v.hasOwnProperty(x.route.id)&&(!_||_[x.route.id]===void 0);if(x.route.lazy||w){r.isStatic&&(u=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let h=r?.onError,p=a&&h?(m,x)=>{h(m,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:Tl(a.matches),errorInfo:x})}:void 0;return o.reduceRight((m,x,v)=>{let _,w=!1,S=null,k=null;a&&(_=l&&x.route.id?l[x.route.id]:void 0,S=x.route.errorElement||AN,u&&(f<0&&v===0?(b1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,k=null):f===v&&(w=!0,k=x.route.hydrateFallbackElement||null)));let N=t.concat(o.slice(0,v+1)),R=()=>{let E;return _?E=S:w?E=k:x.route.Component?E=b.createElement(x.route.Component,null):x.route.element?E=x.route.element:E=m,b.createElement(DN,{match:x,routeContext:{outlet:m,matches:N,isDataRoute:a!=null},children:E})};return a&&(x.route.ErrorBoundary||x.route.errorElement||v===0)?b.createElement(x1,{location:a.location,revalidation:a.revalidation,component:S,error:_,children:R(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:p}):R()},null)}function pm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function MN(e){let t=b.useContext(Hs);return rt(t,pm(e)),t}function zN(e){let t=b.useContext(Al);return rt(t,pm(e)),t}function $N(e){let t=b.useContext(kr);return rt(t,pm(e)),t}function hm(e){let t=$N(e),r=t.matches[t.matches.length-1];return rt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function BN(){return hm("useRouteId")}function y1(){let e=b.useContext(fm),t=zN("useRouteError"),r=hm("useRouteError");return e!==void 0?e:t.errors?.[r]}function IN(){let{router:e}=MN("useNavigate"),t=hm("useNavigate"),r=b.useRef(!1);return g1(()=>{r.current=!0}),b.useCallback(async(o,l={})=>{Gt(r.current,m1),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...l}))},[e,t])}var T0={};function b1(e,t,r){!t&&!T0[e]&&(T0[e]=!0,Gt(!1,r))}var A0={};function L0(e,t){!e&&!A0[t]&&(A0[t]=!0,console.warn(t))}var UN="useOptimistic",D0=x2[UN],PN=()=>{};function HN(e){return D0?D0(e):[e,PN]}function qN(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Gt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:b.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Gt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Gt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var FN=["HydrateFallback","hydrateFallbackElement"],GN=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function VN({router:e,flushSync:t,onError:r,unstable_useTransitions:a}){a=bN()||a;let[l,u]=b.useState(e.state),[f,h]=HN(l),[p,m]=b.useState(),[x,v]=b.useState({isTransitioning:!1}),[_,w]=b.useState(),[S,k]=b.useState(),[N,R]=b.useState(),E=b.useRef(new Map),D=b.useCallback((T,{deletedFetchers:B,newErrors:H,flushSync:J,viewTransitionOpts:oe})=>{H&&r&&Object.values(H).forEach(M=>r(M,{location:T.location,params:T.matches[0]?.params??{},unstable_pattern:Tl(T.matches)})),T.fetchers.forEach((M,P)=>{M.data!==void 0&&E.current.set(P,M.data)}),B.forEach(M=>E.current.delete(M)),L0(J===!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(L0(oe==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."),!oe||!ce){t&&J?t(()=>u(T)):a===!1?u(T):b.startTransition(()=>{a===!0&&h(M=>O0(M,T)),u(T)});return}if(t&&J){t(()=>{S&&(_?.resolve(),S.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})});let M=e.window.document.startViewTransition(()=>{t(()=>u(T))});M.finished.finally(()=>{t(()=>{w(void 0),k(void 0),m(void 0),v({isTransitioning:!1})})}),t(()=>k(M));return}S?(_?.resolve(),S.skipTransition(),R({state:T,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})):(m(T),v({isTransitioning:!0,flushSync:!1,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation}))},[e.window,t,S,_,a,h,r]);b.useLayoutEffect(()=>e.subscribe(D),[e,D]),b.useEffect(()=>{x.isTransitioning&&!x.flushSync&&w(new GN)},[x]),b.useEffect(()=>{if(_&&p&&e.window){let T=p,B=_.promise,H=e.window.document.startViewTransition(async()=>{a===!1?u(T):b.startTransition(()=>{a===!0&&h(J=>O0(J,T)),u(T)}),await B});H.finished.finally(()=>{w(void 0),k(void 0),m(void 0),v({isTransitioning:!1})}),k(H)}},[p,_,e.window,a,h]),b.useEffect(()=>{_&&p&&f.location.key===p.location.key&&_.resolve()},[_,S,f.location,p]),b.useEffect(()=>{!x.isTransitioning&&N&&(m(N.state),v({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}),R(void 0))},[x.isTransitioning,N]);let L=b.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,B,H)=>e.navigate(T,{state:B,preventScrollReset:H?.preventScrollReset}),replace:(T,B,H)=>e.navigate(T,{replace:!0,state:B,preventScrollReset:H?.preventScrollReset})}),[e]),$=e.basename||"/",z=b.useMemo(()=>({router:e,navigator:L,static:!1,basename:$,onError:r}),[e,L,$,r]);return b.createElement(b.Fragment,null,b.createElement(Hs.Provider,{value:z},b.createElement(Al.Provider,{value:f},b.createElement(p1.Provider,{value:E.current},b.createElement(dm.Provider,{value:x},b.createElement(QN,{basename:$,location:f.location,navigationType:f.historyAction,navigator:L,unstable_useTransitions:a},b.createElement(YN,{routes:e.routes,future:e.future,state:f,isStatic:!1,onError:r})))))),null)}function O0(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 YN=b.memo(KN);function KN({routes:e,future:t,state:r,isStatic:a,onError:o}){return RN(e,void 0,{state:r,isStatic:a,onError:o})}function XN({to:e,replace:t,state:r,relative:a}){rt(Go(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=b.useContext(ir);Gt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=b.useContext(kr),{pathname:u}=Nr(),f=At(),h=Cl(e,rd(l),u,a==="path"),p=JSON.stringify(h);return b.useEffect(()=>{f(JSON.parse(p),{replace:t,state:r,relative:a})},[f,p,a,t,r]),null}function v1(e){return CN(e.context)}function QN({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:o,static:l=!1,unstable_useTransitions:u}){rt(!Go(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:f,navigator:o,static:l,unstable_useTransitions:u,future:{}}),[f,o,l,u]);typeof r=="string"&&(r=Da(r));let{pathname:p="/",search:m="",hash:x="",state:v=null,key:_="default",unstable_mask:w}=r,S=b.useMemo(()=>{let k=Sr(p,f);return k==null?null:{location:{pathname:k,search:m,hash:x,state:v,key:_,unstable_mask:w},navigationType:a}},[f,p,m,x,v,_,a,w]);return Gt(S!=null,`<Router basename="${f}"> is not able to match the URL "${p}${m}${x}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:b.createElement(ir.Provider,{value:h},b.createElement(ad.Provider,{children:t,value:S}))}var ju="get",ku="application/x-www-form-urlencoded";function sd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ZN(e){return sd(e)&&e.tagName.toLowerCase()==="button"}function JN(e){return sd(e)&&e.tagName.toLowerCase()==="form"}function WN(e){return sd(e)&&e.tagName.toLowerCase()==="input"}function eE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tE(e,t){return e.button===0&&(!t||t==="_self")&&!eE(e)}function _h(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(o=>[r,o]):[[r,a]])},[]))}function nE(e,t){let r=_h(e);return t&&t.forEach((a,o)=>{r.has(o)||t.getAll(o).forEach(l=>{r.append(o,l)})}),r}var su=null;function rE(){if(su===null)try{new FormData(document.createElement("form"),0),su=!1}catch{su=!0}return su}var aE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qp(e){return e!=null&&!aE.has(e)?(Gt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ku}"`),null):e}function sE(e,t){let r,a,o,l,u;if(JN(e)){let f=e.getAttribute("action");a=f?Sr(f,t):null,r=e.getAttribute("method")||ju,o=qp(e.getAttribute("enctype"))||ku,l=new FormData(e)}else if(ZN(e)||WN(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 h=e.getAttribute("formaction")||f.getAttribute("action");if(a=h?Sr(h,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||ju,o=qp(e.getAttribute("formenctype"))||qp(f.getAttribute("enctype"))||ku,l=new FormData(f,e),!rE()){let{name:p,type:m,value:x}=e;if(m==="image"){let v=p?`${p}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else p&&l.append(p,x)}}else{if(sd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ju,a=null,o=ku,u=e}return l&&o==="text/plain"&&(u=l,l=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function mm(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oE(e,t,r,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:t&&Sr(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${a}`,o}async function iE(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function lE(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 cE(e,t,r){let a=await Promise.all(e.map(async o=>{let l=t.routes[o.route.id];if(l){let u=await iE(l,r);return u.links?u.links():[]}return[]}));return pE(a.flat(1).filter(lE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function M0(e,t,r,a,o,l){let u=(h,p)=>r[p]?h.route.id!==r[p].route.id:!0,f=(h,p)=>r[p].pathname!==h.pathname||r[p].route.path?.endsWith("*")&&r[p].params["*"]!==h.params["*"];return l==="assets"?t.filter((h,p)=>u(h,p)||f(h,p)):l==="data"?t.filter((h,p)=>{let m=a.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(u(h,p)||f(h,p))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function uE(e,t,{includeHydrateFallback:r}={}){return dE(e.map(a=>{let o=t.routes[a.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function dE(e){return[...new Set(e)]}function fE(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function pE(e,t){let r=new Set;return new Set(t),e.reduce((a,o)=>{let l=JSON.stringify(fE(o));return r.has(l)||(r.add(l),a.push({key:l,link:o})),a},[])}function _1(){let e=b.useContext(Hs);return mm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function hE(){let e=b.useContext(Al);return mm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var gm=b.createContext(void 0);gm.displayName="FrameworkContext";function w1(){let e=b.useContext(gm);return mm(e,"You must render this element inside a <HydratedRouter> element"),e}function mE(e,t){let r=b.useContext(gm),[a,o]=b.useState(!1),[l,u]=b.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:p,onMouseLeave:m,onTouchStart:x}=t,v=b.useRef(null);b.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let S=N=>{N.forEach(R=>{u(R.isIntersecting)})},k=new IntersectionObserver(S,{threshold:.5});return v.current&&k.observe(v.current),()=>{k.disconnect()}}},[e]),b.useEffect(()=>{if(a){let S=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(S)}}},[a]);let _=()=>{o(!0)},w=()=>{o(!1),u(!1)};return r?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Hi(f,_),onBlur:Hi(h,w),onMouseEnter:Hi(p,_),onMouseLeave:Hi(m,w),onTouchStart:Hi(x,_)}]:[!1,v,{}]}function Hi(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function gE({page:e,...t}){let{router:r}=_1(),a=b.useMemo(()=>os(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?b.createElement(yE,{page:e,matches:a,...t}):null}function xE(e){let{manifest:t,routeModules:r}=w1(),[a,o]=b.useState([]);return b.useEffect(()=>{let l=!1;return cE(e,t,r).then(u=>{l||o(u)}),()=>{l=!0}},[e,t,r]),a}function yE({page:e,matches:t,...r}){let a=Nr(),{future:o,manifest:l,routeModules:u}=w1(),{basename:f}=_1(),{loaderData:h,matches:p}=hE(),m=b.useMemo(()=>M0(e,t,p,l,a,"data"),[e,t,p,l,a]),x=b.useMemo(()=>M0(e,t,p,l,a,"assets"),[e,t,p,l,a]),v=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let S=new Set,k=!1;if(t.forEach(R=>{let E=l.routes[R.route.id];!E||!E.hasLoader||(!m.some(D=>D.route.id===R.route.id)&&R.route.id in h&&u[R.route.id]?.shouldRevalidate||E.hasClientLoader?k=!0:S.add(R.route.id))}),S.size===0)return[];let N=oE(e,f,o.unstable_trailingSlashAwareDataRequests,"data");return k&&S.size>0&&N.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[N.pathname+N.search]},[f,o.unstable_trailingSlashAwareDataRequests,h,a,l,m,t,e,u]),_=b.useMemo(()=>uE(x,l),[x,l]),w=xE(x);return b.createElement(b.Fragment,null,v.map(S=>b.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),_.map(S=>b.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),w.map(({key:S,link:k})=>b.createElement("link",{key:S,nonce:r.nonce,...k,crossOrigin:k.crossOrigin??r.crossOrigin})))}function bE(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var vE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vE&&(window.__reactRouterVersion="7.13.1")}catch{}function _E(e,t){return Kk({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:uk({window:t?.window}),hydrationData:wE(),routes:e,mapRouteProperties:qN,hydrationRouteProperties:FN,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function wE(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:SE(e.errors)}),e}function SE(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,o]of t)if(o&&o.__type==="RouteErrorResponse")r[a]=new Rl(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let l=window[o.__subType];if(typeof l=="function")try{let u=new l(o.message);u.stack="",r[a]=u}catch{}}if(r[a]==null){let l=new Error(o.message);l.stack="",r[a]=l}}else r[a]=o;return r}var S1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jr=b.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:o,reloadDocument:l,replace:u,unstable_mask:f,state:h,target:p,to:m,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:_,...w},S){let{basename:k,navigator:N,unstable_useTransitions:R}=b.useContext(ir),E=typeof m=="string"&&S1.test(m),D=W_(m,k);m=D.to;let L=kN(m,{relative:o}),$=Nr(),z=null;if(f){let P=Cl(f,[],$.unstable_mask?$.unstable_mask.pathname:"/",!0);k!=="/"&&(P.pathname=P.pathname==="/"?k:Lr([k,P.pathname])),z=N.createHref(P)}let[T,B,H]=mE(a,w),J=NE(m,{replace:u,unstable_mask:f,state:h,target:p,preventScrollReset:x,relative:o,viewTransition:v,unstable_defaultShouldRevalidate:_,unstable_useTransitions:R});function oe(P){t&&t(P),P.defaultPrevented||J(P)}let ce=!(D.isExternal||l),M=b.createElement("a",{...w,...H,href:(ce?z:void 0)||D.absoluteURL||L,onClick:ce?oe:t,ref:bE(S,B),target:p,"data-discover":!E&&r==="render"?"true":void 0});return T&&!E?b.createElement(b.Fragment,null,M,b.createElement(gE,{page:L})):M});jr.displayName="Link";var Po=b.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:o=!1,style:l,to:u,viewTransition:f,children:h,...p},m){let x=Ll(u,{relative:p.relative}),v=Nr(),_=b.useContext(Al),{navigator:w,basename:S}=b.useContext(ir),k=_!=null&&AE(x)&&f===!0,N=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,R=v.pathname,E=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;r||(R=R.toLowerCase(),E=E?E.toLowerCase():null,N=N.toLowerCase()),E&&S&&(E=Sr(E,S)||E);const D=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let L=R===N||!o&&R.startsWith(N)&&R.charAt(D)==="/",$=E!=null&&(E===N||!o&&E.startsWith(N)&&E.charAt(N.length)==="/"),z={isActive:L,isPending:$,isTransitioning:k},T=L?t:void 0,B;typeof a=="function"?B=a(z):B=[a,L?"active":null,$?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let H=typeof l=="function"?l(z):l;return b.createElement(jr,{...p,"aria-current":T,className:B,ref:m,style:H,to:u,viewTransition:f},typeof h=="function"?h(z):h)});Po.displayName="NavLink";var jE=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:o,state:l,method:u=ju,action:f,onSubmit:h,relative:p,preventScrollReset:m,viewTransition:x,unstable_defaultShouldRevalidate:v,..._},w)=>{let{unstable_useTransitions:S}=b.useContext(ir),k=RE(),N=TE(f,{relative:p}),R=u.toLowerCase()==="get"?"get":"post",E=typeof f=="string"&&S1.test(f),D=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let $=L.nativeEvent.submitter,z=$?.getAttribute("formmethod")||u,T=()=>k($||L.currentTarget,{fetcherKey:t,method:z,navigate:r,replace:o,state:l,relative:p,preventScrollReset:m,viewTransition:x,unstable_defaultShouldRevalidate:v});S&&r!==!1?b.startTransition(()=>T()):T()};return b.createElement("form",{ref:w,method:R,action:N,onSubmit:a?h:D,..._,"data-discover":!E&&e==="render"?"true":void 0})});jE.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 j1(e){let t=b.useContext(Hs);return rt(t,kE(e)),t}function NE(e,{target:t,replace:r,unstable_mask:a,state:o,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:p}={}){let m=At(),x=Nr(),v=Ll(e,{relative:u});return b.useCallback(_=>{if(tE(_,t)){_.preventDefault();let w=r!==void 0?r:Jr(x)===Jr(v),S=()=>m(e,{replace:w,unstable_mask:a,state:o,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h});p?b.startTransition(()=>S()):S()}},[x,m,v,r,a,o,t,e,l,u,f,h,p])}function Dl(e){Gt(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=b.useRef(_h(e)),r=b.useRef(!1),a=Nr(),o=b.useMemo(()=>nE(a.search,r.current?null:t.current),[a.search]),l=At(),u=b.useCallback((f,h)=>{const p=_h(typeof f=="function"?f(new URLSearchParams(o)):f);r.current=!0,l("?"+p,h)},[l,o]);return[o,u]}var EE=0,CE=()=>`__${String(++EE)}__`;function RE(){let{router:e}=j1("useSubmit"),{basename:t}=b.useContext(ir),r=BN(),a=e.fetch,o=e.navigate;return b.useCallback(async(l,u={})=>{let{action:f,method:h,encType:p,formData:m,body:x}=sE(l,t);if(u.navigate===!1){let v=u.fetcherKey||CE();await a(v,r,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:m,body:x,formMethod:u.method||h,formEncType:u.encType||p,flushSync:u.flushSync})}else await o(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:m,body:x,formMethod:u.method||h,formEncType:u.encType||p,replace:u.replace,state:u.state,fromRouteId:r,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,o,t,r])}function TE(e,{relative:t}={}){let{basename:r}=b.useContext(ir),a=b.useContext(kr);rt(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),l={...Ll(e||".",{relative:t})},u=Nr();if(e==null){l.search=u.search;let f=new URLSearchParams(l.search),h=f.getAll("index");if(h.some(m=>m==="")){f.delete("index"),h.filter(x=>x).forEach(x=>f.append("index",x));let m=f.toString();l.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:Lr([r,l.pathname])),Jr(l)}function AE(e,{relative:t}={}){let r=b.useContext(dm);rt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=j1("useViewTransitionState"),o=Ll(e,{relative:t});if(!r.isTransitioning)return!1;let l=Sr(r.currentLocation.pathname,a)||r.currentLocation.pathname,u=Sr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return zu(o.pathname,u)!=null||zu(o.pathname,l)!=null}const LE="modulepreload",DE=function(e){return"/"+e},z0={},le=function(t,r,a){let o=Promise.resolve();if(r&&r.length>0){let h=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=u?.nonce||u?.getAttribute("nonce");o=h(r.map(p=>{if(p=DE(p),p in z0)return;z0[p]=!0;const m=p.endsWith(".css"),x=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${x}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":LE,m||(v.as="script"),v.crossOrigin="",v.href=p,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((_,w)=>{v.addEventListener("load",_),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${p}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return o.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};const k1=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim();const OE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ME=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase());const $0=e=>{const t=ME(e);return t.charAt(0).toUpperCase()+t.slice(1)};var zE={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 $E=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const BE=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:o="",children:l,iconNode:u,...f},h)=>b.createElement("svg",{ref:h,...zE,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:k1("lucide",o),...!l&&!$E(f)&&{"aria-hidden":"true"},...f},[...u.map(([p,m])=>b.createElement(p,m)),...Array.isArray(l)?l:[l]]));const $e=(e,t)=>{const r=b.forwardRef(({className:a,...o},l)=>b.createElement(BE,{ref:l,iconNode:t,className:k1(`lucide-${OE($0(e))}`,`lucide-${e}`,a),...o}));return r.displayName=$0(e),r};const IE=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],UE=$e("arrow-right-left",IE);const PE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],N1=$e("arrow-right",PE);const HE=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],B0=$e("arrow-up-right",HE);const qE=[["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"}]],E1=$e("boxes",qE);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"}]],GE=$e("brain",FE);const VE=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],YE=$e("chart-column",VE);const KE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Wr=$e("check",KE);const XE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$t=$e("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"}]],C1=$e("circle-alert",QE);const ZE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],JE=$e("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=$e("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"}]],$u=$e("copy",tC);const nC=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],xm=$e("corner-left-up",nC);const rC=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],aC=$e("database-zap",rC);const sC=[["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"}]],R1=$e("database",sC);const oC=[["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 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],ym=$e("file-code",oC);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"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],lC=$e("file-spreadsheet",iC);const cC=[["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"}]],On=$e("file-text",cC);const uC=[["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"}]],bm=$e("file",uC);const dC=[["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"}]],fC=$e("files",dC);const pC=[["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"}]],Ol=$e("folder-git-2",pC);const hC=[["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"}]],mC=$e("folder-input",hC);const gC=[["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"}]],xC=$e("folder-open",gC);const yC=[["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"}]],T1=$e("folder-plus",yC);const bC=[["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"}]],Gn=$e("folder",bC);const vC=[["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"}]],Bu=$e("git-branch",vC);const _C=[["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"}]],wC=$e("git-commit-horizontal",_C);const SC=[["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"}]],jC=$e("git-fork",SC);const kC=[["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"}]],I0=$e("github",kC);const NC=[["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"}]],EC=$e("globe",NC);const CC=[["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"}]],RC=$e("grid-3x3",CC);const TC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],AC=$e("info",TC);const LC=[["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"}]],DC=$e("key",LC);const OC=[["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"}]],MC=$e("laptop",OC);const zC=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],$C=$e("layers",zC);const BC=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],IC=$e("link-2",BC);const UC=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],PC=$e("list-filter",UC);const HC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Zt=$e("loader-circle",HC);const qC=[["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"}]],FC=$e("log-out",qC);const GC=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],VC=$e("menu",GC);const YC=[["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"}]],KC=$e("monitor",YC);const XC=[["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"}]],QC=$e("moon",XC);const ZC=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],JC=$e("network",ZC);const WC=[["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"}]],Dr=$e("package",WC);const eR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],tR=$e("panel-left",eR);const nR=[["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"}]],wh=$e("pencil",nR);const rR=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],aR=$e("phone",rR);const sR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vm=$e("plus",sR);const oR=[["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"}]],iR=$e("refresh-cw",oR);const lR=[["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"}]],cR=$e("rotate-cw",lR);const uR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ml=$e("search",uR);const dR=[["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"}]],fR=$e("settings",dR);const pR=[["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"}]],hR=$e("share-2",pR);const mR=[["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"}]],gR=$e("sparkles",mR);const xR=[["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"}]],yR=$e("sun",xR);const bR=[["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"}]],od=$e("trash-2",bR);const vR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_R=$e("triangle-alert",vR);const wR=[["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"}]],Sh=$e("upload",wR);const SR=[["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"}]],jR=$e("users",SR);const kR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Or=$e("x",kR);const NR=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ER=$e("zap",NR),U0=e=>Symbol.iterator in e,P0=e=>"entries"in e,H0=(e,t)=>{const r=e instanceof Map?e:new Map(e.entries()),a=t instanceof Map?t:new Map(t.entries());if(r.size!==a.size)return!1;for(const[o,l]of r)if(!a.has(o)||!Object.is(l,a.get(o)))return!1;return!0},CR=(e,t)=>{const r=e[Symbol.iterator](),a=t[Symbol.iterator]();let o=r.next(),l=a.next();for(;!o.done&&!l.done;){if(!Object.is(o.value,l.value))return!1;o=r.next(),l=a.next()}return!!o.done&&!!l.done};function RR(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:U0(e)&&U0(t)?P0(e)&&P0(t)?H0(e,t):CR(e,t):H0({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function ds(e){const t=Do.useRef(void 0);return r=>{const a=e(r);return RR(t.current,a)?t.current:t.current=a}}const q0=e=>{let t;const r=new Set,a=(p,m)=>{const x=typeof p=="function"?p(t):p;if(!Object.is(x,t)){const v=t;t=m??(typeof x!="object"||x===null)?x:Object.assign({},t,x),r.forEach(_=>_(t,v))}},o=()=>t,f={setState:a,getState:o,getInitialState:()=>h,subscribe:p=>(r.add(p),()=>r.delete(p))},h=t=e(a,o,f);return f},TR=(e=>e?q0(e):q0),AR=e=>e;function LR(e,t=AR){const r=Do.useSyncExternalStore(e.subscribe,Do.useCallback(()=>t(e.getState()),[e,t]),Do.useCallback(()=>t(e.getInitialState()),[e,t]));return Do.useDebugValue(r),r}const F0=e=>{const t=TR(e),r=a=>LR(t,a);return Object.assign(r,t),r},ea=(e=>e?F0(e):F0),qi="c4a_token";function G0(e){try{const t=e.split(".");if(t.length!==3)return null;const r=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=atob(r),o=Uint8Array.from(a,u=>u.charCodeAt(0));return JSON.parse(new TextDecoder().decode(o))}catch{return null}}function V0(e){const t=e.userId,r=e.name,a=e.email,o=e.avatar_url,l=e.workspaceId;if(!t||!a||!l)return null;const u={id:t,name:r??a,email:a,personal_workspace_id:l};return o&&(u.avatar_url=o),u}function Y0(e){const t=e.exp;return t?Date.now()>=t*1e3:!1}const Yn=ea(e=>({token:null,user:null,isAuthenticated:!1,init:()=>{const t=localStorage.getItem(qi);if(!t){e({token:null,user:null,isAuthenticated:!1});return}const r=G0(t);if(!r||Y0(r)){localStorage.removeItem(qi),e({token:null,user:null,isAuthenticated:!1});return}const a=V0(r);if(!a){localStorage.removeItem(qi),e({token:null,user:null,isAuthenticated:!1});return}e({token:t,user:a,isAuthenticated:!0})},login:t=>{const r=G0(t);if(!r||Y0(r))return;const a=V0(r);a&&(localStorage.setItem(qi,t),e({token:t,user:a,isAuthenticated:!0}))},logout:()=>{localStorage.removeItem(qi),e({token:null,user:null,isAuthenticated:!1})}})),gl=ea(e=>({activeWorkspaceId:null,init:()=>{const t=Yn.getState().user;t?.personal_workspace_id&&e({activeWorkspaceId:t.personal_workspace_id})},setActiveWorkspace:t=>{e({activeWorkspaceId:t})}}));Yn.subscribe((e,t)=>{e.user!==t.user&&(e.user?.personal_workspace_id?gl.getState().setActiveWorkspace(e.user.personal_workspace_id):gl.getState().setActiveWorkspace(null))});const A1="/api/v1";class hn extends Error{constructor(t,r,a){super(a),this.status=t,this.code=r,this.name="ApiError"}}async function Fi(e,t,r,a,o){let l=`${A1}${t}`;if(a){const x=new URLSearchParams(a).toString();x&&(l+=`?${x}`)}const u={"Content-Type":"application/json"},f=Yn.getState().token;f&&(u.Authorization=`Bearer ${f}`);const h=gl.getState().activeWorkspaceId;h&&(u["X-Workspace-Id"]=h);const p={method:e,headers:u};r!==void 0&&(p.body=JSON.stringify(r)),o?.signal&&(p.signal=o.signal);const m=await fetch(l,p);if(!m.ok){let x="UNKNOWN",v=m.statusText;try{const _=await m.json();_.code&&(x=_.code),_.message&&(v=_.message)}catch{}throw m.status===401&&Yn.getState().logout(),new hn(m.status,x,v)}return m.json()}const Fp=new Map;function DR(e,t){let r=`${A1}${e}`;if(t){const a=new URLSearchParams(t).toString();a&&(r+=`?${a}`)}return r}const ze={get(e,t,r){if(r?.skipDedup)return Fi("GET",e,void 0,t,r);const o=`${gl.getState().activeWorkspaceId??""}::${DR(e,t)}`,l=Fp.get(o);if(l)return l;const u=Fi("GET",e,void 0,t,r).finally(()=>{Fp.delete(o)});return Fp.set(o,u),u},post(e,t,r){return Fi("POST",e,t,void 0,r)},put(e,t){return Fi("PUT",e,t)},delete(e){return Fi("DELETE",e)}},OR=3e4,MR=1e3,zR=3e4;class $R{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;disconnectTimer=null;_status="disconnected";get status(){return this._status}setStatus(t){this._status=t;for(const r of this.statusHandlers)r(t)}onStatusChange(t){return this.statusHandlers.add(t),()=>{this.statusHandlers.delete(t)}}connect(t){this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null),!(this.url===t&&this.ws&&this.ws.readyState<=WebSocket.OPEN)&&(this.url=t,this.intentionalClose=!1,this.reconnectAttempt=0,this.open())}disconnect(){this.disconnectTimer||(this.disconnectTimer=setTimeout(()=>{this.disconnectTimer=null,this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")},50))}on(t,r){let a=this.handlers.get(t);return a||(a=new Set,this.handlers.set(t,a)),a.add(r),()=>{a.delete(r),a.size===0&&this.handlers.delete(t)}}send(t,r){if(this.ws?.readyState!==WebSocket.OPEN)return;const a={event:t,payload:r,timestamp:Date.now()};this.ws.send(JSON.stringify(a))}open(){this.setStatus("connecting");const t=new WebSocket(this.url);t.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},t.onmessage=r=>{try{const a=JSON.parse(String(r.data));if(a.event==="pong")return;const o=this.handlers.get(a.event);if(o)for(const l of o)l(a.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()}))},OR)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const t=Math.min(MR*2**this.reconnectAttempt,zR);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},t)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null)}}const En=new $R,Qt=ea((e,t)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{e({loading:!0,error:null});try{const r=await ze.get("/libraries");e({libraries:r,loading:!1})}catch(r){e({error:r instanceof Error?r.message:"Failed to load libraries",loading:!1})}},createLibrary:async r=>{const a=await ze.post("/libraries",r);return e(o=>({libraries:[...o.libraries,a]})),a},deleteLibrary:async r=>{await ze.delete(`/libraries/${r}`),e(a=>({libraries:a.libraries.filter(o=>o.id!==r)}))},updateLibraryName:async(r,a)=>{const o=await ze.put(`/libraries/${r}`,{name:a});e(l=>({libraries:l.libraries.map(u=>u.id===r?o:u)}))},_updateLibraryOnline:(r,a)=>{e(o=>({libraries:o.libraries.map(l=>l.id===r?{...l,is_online:a}:l)}))},_refreshLibrary:async r=>{try{const a=await ze.get(`/libraries/${r}`);e(o=>({libraries:o.libraries.map(l=>l.id===r?a:l)}))}catch{t().fetchLibraries()}}})),qs=e=>{const t=e.libraries.filter(a=>a.type==="cloud").sort((a,o)=>a.created_at.localeCompare(o.created_at)),r=e.libraries.filter(a=>a.type==="daemon").sort((a,o)=>a.name.localeCompare(o.name));return[...t,...r]},BR=e=>e.libraries.filter(t=>t.type==="daemon");En.on("ws:daemon:status",e=>{const t=e;t.lib_id&&Qt.getState()._updateLibraryOnline(t.lib_id,t.is_online),Qt.getState().fetchLibraries()});En.on("ws:daemon:connected",e=>{const t=e;t.lib_id&&Qt.getState()._updateLibraryOnline(t.lib_id,!0),Qt.getState().fetchLibraries()});En.on("ws:library:updated",e=>{const t=e;Qt.getState()._refreshLibrary(t.library_id)});function IR({name:e,avatarUrl:t,size:r=24}){const[a,o]=b.useState(!1),l=e.charAt(0).toUpperCase();return t&&!a?c.jsx("img",{src:t,alt:"",className:"rounded-full object-cover",style:{width:r,height:r},onError:()=>o(!0)}):c.jsx("span",{className:"inline-flex items-center justify-center rounded-full bg-c4a-accent font-mono font-bold text-white",style:{width:r,height:r,fontSize:r*.48},children:l})}function UR(){const{t:e}=ye(),t=At(),r=Yn(v=>v.user),a=Yn(v=>v.logout),[o,l]=b.useState(!1),u=b.useRef(null),f=Qt(ds(BR)),h=f.some(v=>v.is_online),p=b.useCallback(()=>{a(),l(!1),t("/login",{replace:!0})},[a,t]),m=()=>{u.current&&clearTimeout(u.current),l(!0)},x=()=>{u.current=setTimeout(()=>l(!1),150)};return r?c.jsxs("div",{className:"relative",onMouseEnter:m,onMouseLeave:x,children:[c.jsxs("button",{className:"relative flex cursor-pointer items-center gap-1",children:[c.jsx(IR,{name:r.name,avatarUrl:r.avatar_url,size:30}),c.jsx("span",{className:`absolute right-0 top-0 h-2 w-2 rounded-full ${h?"bg-c4a-success":"bg-c4a-text-muted"}`})]}),o&&c.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:[c.jsxs("div",{className:"px-4 py-3",children:[c.jsx("p",{className:"text-sm text-c4a-text-primary",children:r.name}),c.jsx("p",{className:"text-xs text-c4a-text-muted",children:r.email})]}),c.jsx("div",{className:"border-t border-c4a-border-subtle",children:f.length===0?c.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:[c.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-c4a-text-muted"})}),e("user.menu.connect_source")]}):f.map(v=>c.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:[c.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:c.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${v.is_online?"bg-c4a-success":"bg-c4a-error"}`})}),v.name]},v.id))}),c.jsx("div",{className:"border-t border-c4a-border-subtle",children:c.jsxs("button",{onClick:p,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:[c.jsx(FC,{size:12,className:"shrink-0"}),e("user.menu.sign_out")]})})]})]}):null}function jh({onLoginClick:e}){const{t}=ye();return Yn(a=>a.isAuthenticated)?c.jsx(UR,{}):c.jsx(jr,{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 K0=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function PR(){const{t:e}=ye(),[t,r]=b.useState(!1);return c.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[c.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[c.jsxs(jr,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[c.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),c.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),c.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[c.jsx("nav",{className:"flex items-center gap-4",children:K0.map(({to:a,labelKey:o})=>c.jsx(Po,{to:a,end:a==="/",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(o)},a))}),c.jsx(jh,{})]}),c.jsx("button",{onClick:()=>r(!t),className:"text-c4a-text-secondary md:hidden",children:t?c.jsx(Or,{size:20}):c.jsx(VC,{size:20})})]}),t&&c.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[c.jsx("nav",{className:"flex flex-col gap-2",children:K0.map(({to:a,labelKey:o})=>c.jsx(Po,{to:a,end:a==="/",onClick:()=>r(!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(o)},a))}),c.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:c.jsx(jh,{onLoginClick:()=>r(!1)})})]})]})}function HR(e){return e==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e==="system"?"dark":e}function L1(e){if(typeof window>"u")return;const t=HR(e);document.documentElement.setAttribute("data-theme",t),localStorage.setItem("theme",e)}function qR(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const _m=ea(e=>({theme:qR(),setTheme:t=>{L1(t),e({theme:t})}}));let X0=!1;function FR(){if(X0||typeof window>"u")return;X0=!0;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{theme:r}=_m.getState();r==="system"&&L1("system")};e.addEventListener("change",t)}FR();const GR=[{mode:"light",icon:yR,labelKey:"footer.theme.light"},{mode:"dark",icon:QC,labelKey:"footer.theme.dark"},{mode:"system",icon:KC,labelKey:"footer.theme.system"}];function D1(){const{t:e}=ye(),{theme:t,setTheme:r}=_m();return c.jsx("div",{className:"flex items-center gap-1",children:GR.map(({mode:a,icon:o,labelKey:l})=>c.jsx("button",{onClick:()=>r(a),title:e(l),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${t===a?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:c.jsx(o,{size:14})},a))})}function O1(){const{i18n:e}=ye(),t=()=>{const r=e.language==="en"?"zh":"en";e.changeLanguage(r)};return c.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 M1({compact:e}){const{t}=ye(),r=new Date().getFullYear(),a=e?"footer.copyright_compact":"footer.copyright";return c.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:t(a,{year:r})})}const VR="_brandIcon_1c7st_1",YR="_iconPulse_1c7st_35",Q0={brandIcon:VR,iconPulse:YR};function KR({variant:e}){const{t}=ye(),r=e==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return c.jsx("footer",{className:`border-t border-c4a-border-subtle ${r} px-4 py-4`,children:c.jsxs("div",{className:"flex items-end justify-between gap-4",children:[c.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[c.jsx("div",{className:Q0.brandIcon,children:c.jsx("span",{className:Q0.iconPulse,children:"C4A"})}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:t("footer.tagline")})]})]}),c.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(D1,{}),c.jsx(O1,{})]}),c.jsx(M1,{})]})]})})}let XR=1;const kh=ea(e=>({items:[],show:(t,r=6e3)=>{const a=XR++;e(o=>({items:[...o.items,{id:a,message:t,duration:r}]})),setTimeout(()=>{e(o=>({items:o.items.filter(l=>l.id!==a)}))},r)},dismiss:t=>{e(r=>({items:r.items.filter(a=>a.id!==t)}))}})),Qr=(e,t)=>kh.getState().show(e,t);function z1(){const e=kh(r=>r.items),t=kh(r=>r.dismiss);return e.length===0?null:c.jsx("div",{className:"fixed top-4 left-1/2 z-50 flex -translate-x-1/2 flex-col items-center gap-2",children:e.map(r=>c.jsx("div",{role:"status",onClick:()=>t(r.id),className:"flex cursor-pointer items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-elevated px-5 py-3 font-mono text-xs uppercase tracking-tight text-c4a-accent shadow-c4a-lg transition-opacity",children:r.message},r.id))})}function QR(){return c.jsxs("div",{className:"flex min-h-screen flex-col",children:[c.jsx(PR,{}),c.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:c.jsx(v1,{})}),c.jsx(KR,{}),c.jsx(z1,{})]})}function ZR({onToggleSidebar:e}){return c.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:c.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[e&&c.jsx("button",{onClick:e,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:c.jsx(tR,{size:20})}),c.jsxs(jr,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[c.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),c.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),c.jsx(jr,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:c.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),c.jsx(jh,{})]})})}const JR=e=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${e?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,WR=[{to:"/studio/modeling",icon:E1,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:GE,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:ml,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:hR,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:jR,i18nKey:"studio.sidebar.collaboration"}],eT=[{to:"/studio/settings/api-keys",i18nKey:"settings.tab.api_keys",icon:DC}],tT=["My Drive","个人云","我的云盘"];function nT({onNavigate:e}){const{t}=ye(),a=Nr().pathname.startsWith("/studio/settings"),[o,l]=b.useState(a);return b.useEffect(()=>{a&&l(!0)},[a]),c.jsxs("div",{children:[c.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 ${a?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[c.jsx(fR,{size:14}),t("studio.sidebar.settings"),c.jsx($t,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${o?"rotate-90":""}`})]}),o&&c.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:eT.map(({to:u,i18nKey:f,icon:h})=>c.jsxs(Po,{to:u,onClick:e,className:({isActive:p})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${p?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[c.jsx(h,{size:13,className:"shrink-0 opacity-60"}),t(f)]},u))})]})}function Z0({onNavigate:e}){const{t}=ye(),r=Nr(),a=At(),o=Qt(ds(qs)),l=r.pathname.startsWith("/studio/sources")||r.pathname.startsWith("/studio/source/"),[u,f]=b.useState(l);b.useEffect(()=>{l&&f(!0)},[l]);const h=p=>p.is_default&&tT.includes(p.name)?t("sources.library.default_cloud_name"):p.name;return c.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-base p-4",children:[c.jsxs("nav",{className:"flex flex-col gap-1",children:[c.jsxs("div",{className:"group/sources",children:[c.jsxs("button",{onClick:()=>f(p=>!p),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:[c.jsx(R1,{size:14}),t("studio.sidebar.sources"),c.jsx("span",{role:"button",tabIndex:0,onClick:p=>{p.stopPropagation(),a("/studio/sources/add-client"),e?.()},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),a("/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:c.jsx(vm,{size:12})}),c.jsx($t,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${u?"rotate-90":""}`})]}),u&&c.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(p=>{const m=h(p);return c.jsxs(Po,{to:`/studio/sources/${p.id}`,onClick:e,className:({isActive:x})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${x?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[p.type==="cloud"?c.jsx(eC,{size:13,className:"shrink-0 opacity-60"}):c.jsx(MC,{size:13,className:"shrink-0 opacity-60"}),c.jsx("span",{className:"truncate",children:m}),p.type==="daemon"&&(()=>{const x=p.config?.machine_id;return c.jsxs("span",{role:"button",tabIndex:0,onClick:v=>{v.preventDefault(),v.stopPropagation(),a("/studio/sources/add-client"),e?.()},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),a("/studio/sources/add-client"),e?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[c.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${p.is_online?"bg-c4a-success":"bg-c4a-error"}`}),c.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:p.is_online?t("sources.menu.status_online",{machine:x??""}):t("sources.menu.status_offline",{machine:x??""})})]})})()]},p.id)})})]}),WR.map(({to:p,icon:m,i18nKey:x})=>c.jsxs(Po,{to:p,onClick:e,className:({isActive:v})=>JR(v),children:[c.jsx(m,{size:14}),t(x)]},p)),c.jsx(nT,{...e?{onNavigate:e}:{}})]}),c.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(D1,{}),c.jsx(O1,{})]}),c.jsx(M1,{compact:!0})]})]})}const xl=ea(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{}}})),rT=e=>e==="connecting"?"disconnected":e;En.onStatusChange(e=>{xl.getState().setStatus(rT(e))});En.on("ws:daemon:connected",e=>{const t=e;xl.setState(r=>{if(r.connections.some(u=>u.machine_id===t.machine_id))return r;const o={machine_id:t.machine_id};t.lib_id&&(o.lib_id=t.lib_id);const l=[...r.connections,o];return{connections:l,onlineCount:l.length}})});En.on("ws:daemon:status",e=>{const t=e;xl.setState(r=>{if(t.is_online){if(r.connections.some(f=>f.machine_id===t.machine_id))return r;const l={machine_id:t.machine_id};t.lib_id&&(l.lib_id=t.lib_id);const u=[...r.connections,l];return{connections:u,onlineCount:u.length}}const a=r.connections.filter(o=>o.machine_id!==t.machine_id);return{connections:a,onlineCount:a.length}})});function aT(){const e=At(),[t,r]=b.useState(!1),a=Yn(u=>u.isAuthenticated),[o,l]=b.useState(!1);return b.useEffect(()=>{const u=Yn.getState();u.isAuthenticated||u.init(),l(!0)},[]),b.useEffect(()=>{o&&!a&&e("/login",{replace:!0})},[o,a,e]),b.useEffect(()=>{!o||!a||(Qt.getState().fetchLibraries(),xl.getState().fetchDaemonStatus())},[o,a]),b.useEffect(()=>{if(!(!o||!a))return En.onStatusChange(u=>{u==="connected"&&(Qt.getState().fetchLibraries(),xl.getState().fetchDaemonStatus())})},[o,a]),!o||!a?null:c.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[c.jsx(ZR,{onToggleSidebar:()=>r(!t)}),c.jsxs("div",{className:"flex min-h-0 flex-1",children:[c.jsx("div",{className:"hidden md:block",children:c.jsx(Z0,{})}),t&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>r(!1)}),c.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:c.jsx(Z0,{onNavigate:()=>r(!1)})})]}),c.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:c.jsx(v1,{})})]}),c.jsx(z1,{})]})}function sT(){const{t:e}=ye();return c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[c.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:e("home.hero.title")}),c.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:e("home.hero.description")}),c.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[c.jsxs(jr,{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"),c.jsx(N1,{size:14})]}),c.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 oT=new Set(["github","google","feishu"]),iT=new Set(["oidc","oauth2"]);function lT(){const{t:e}=ye(),t=At(),r=Yn(D=>D.login),a=Yn(D=>D.isAuthenticated),[o,l]=b.useState([]),[u,f]=b.useState(!0),[h,p]=b.useState(null),[m,x]=b.useState(!1);b.useEffect(()=>{a&&t("/studio",{replace:!0})},[a,t]);const v=b.useCallback(async()=>{f(!0),p(null);try{const D=await ze.get("/auth/providers");l(D)}catch{p(e("login.error"))}finally{f(!1)}},[e]);b.useEffect(()=>{v()},[v]);const _=D=>{x(!0),window.location.href=`/api/v1/auth/${D}/login`},w=async()=>{x(!0);try{const D=await ze.post("/auth/test-account/login");r(D.token),t("/studio",{replace:!0})}catch{x(!1),p(e("login.error"))}},S=o.filter(D=>oT.has(D.type)),k=o.filter(D=>iT.has(D.type)),N=o.find(D=>D.type==="test_account"),R=S.length>0||k.length>0,E=(S.length>0?1:0)+(k.length>0?1:0)+(N?1:0)>1;return c.jsx("div",{className:"flex flex-1 items-center justify-center px-4 py-12",children:c.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 ${m?"border-transparent":"border-c4a-border-subtle border-t-c4a-accent"}`,children:[m&&c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
14
|
+
.login-animated-border {
|
|
15
|
+
stroke-dasharray: 92 8;
|
|
16
|
+
animation:
|
|
17
|
+
border-accel 2s cubic-bezier(0.33, 0, 0.67, 0.33) forwards,
|
|
18
|
+
border-fast 0.75s linear 2s infinite,
|
|
19
|
+
border-grow 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
|
|
20
|
+
}
|
|
21
|
+
@keyframes border-accel {
|
|
22
|
+
0% { stroke-dashoffset: 0; }
|
|
23
|
+
100% { stroke-dashoffset: -200; }
|
|
24
|
+
}
|
|
25
|
+
@keyframes border-fast {
|
|
26
|
+
0% { stroke-dashoffset: 0; }
|
|
27
|
+
100% { stroke-dashoffset: -100; }
|
|
28
|
+
}
|
|
29
|
+
@keyframes border-grow {
|
|
30
|
+
0% { stroke-dasharray: 25 75; }
|
|
31
|
+
100% { stroke-dasharray: 92 8; }
|
|
32
|
+
}
|
|
33
|
+
`}),c.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:c.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&&!m&&c.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:c.jsx(Zt,{size:24,className:"animate-spin text-c4a-text-muted"})}),!u&&!m&&h&&c.jsxs("div",{className:"flex min-h-[160px] flex-col items-center justify-center gap-4",children:[c.jsx("p",{className:"text-center font-mono text-xs text-c4a-text-muted",children:h}),c.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&&!h&&c.jsxs("div",{className:"flex flex-col gap-6",children:[c.jsx("h2",{className:"text-center font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:e("login.title")}),c.jsxs("div",{className:"flex flex-col gap-2",children:[S.map(D=>c.jsx(J0,{provider:D,onClick:()=>_(D.id),label:e("login.provider_cta",{name:D.display_name}),disabled:m},D.id)),S.length>0&&k.length>0&&c.jsx(W0,{label:e("login.or")}),k.map(D=>c.jsx(J0,{provider:D,onClick:()=>_(D.id),label:e("login.provider_cta",{name:D.display_name}),disabled:m},D.id)),R&&N&&E&&c.jsx(W0,{label:e("login.or")}),N&&c.jsxs("button",{disabled:m,onClick:w,className:"c4a-flash-accent 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:[N.icon&&c.jsx("img",{src:N.icon,alt:"",className:"relative z-10 h-5 w-5 shrink-0 opacity-90"}),c.jsx("span",{className:`relative z-10 ${m?"opacity-50":""}`,children:e("login.provider_cta",{name:e("login.test_account")})})]})]})]})]})})}function J0({provider:e,onClick:t,label:r,disabled:a}){return c.jsxs("button",{onClick:t,disabled:a,className:"group c4a-flash-outline flex h-11 w-full cursor-pointer items-center justify-center gap-3 border border-c4a-border-default bg-transparent font-mono text-xs font-bold uppercase tracking-tight text-c4a-text-primary transition-opacity duration-150 ease-out disabled:cursor-not-allowed",children:[e.icon&&c.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-[250ms] ease-out group-hover:opacity-100 group-hover:grayscale-0 group-disabled:opacity-100 group-disabled:grayscale-0"}),c.jsx("span",{className:`relative z-10 ${a?"opacity-50":""}`,children:r})]})}function W0({label:e}){return c.jsxs("div",{className:"flex items-center gap-3 py-1",children:[c.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"}),c.jsx("span",{className:"font-mono text-xs uppercase text-c4a-text-muted",children:e}),c.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"})]})}const cT="animate-pulse font-mono text-xs uppercase tracking-tight text-c4a-text-muted";function ta({labelKey:e="login.loading",className:t}){const{t:r}=ye();return c.jsx("span",{className:t??cT,children:r(e)})}function uT(){const e=At(),t=Yn(r=>r.login);return b.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("token");if(a){t(a);const o=Yn.getState().isAuthenticated;e(o?"/studio":"/login",{replace:!0})}else e("/login",{replace:!0})},[t,e]),c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ta,{labelKey:"login.authenticating",className:"animate-pulse font-mono text-sm uppercase tracking-tight text-c4a-text-muted"})})}function wt({icon:e,title:t,description:r,action:a,fullPage:o}){const l=c.jsxs("div",{className:o?"w-full max-w-[800px] text-center":"flex flex-col items-center text-center",children:[e&&c.jsx("div",{className:"mb-3 text-c4a-text-muted",children:e}),o?c.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:t}):c.jsx("p",{className:"font-mono text-sm text-c4a-text-secondary",children:t}),c.jsx("p",{className:`mt-2 ${o?"mt-3 text-sm text-c4a-text-secondary":"max-w-md text-xs text-c4a-text-muted"}`,children:r}),a&&c.jsx("div",{className:o?"mt-6 flex justify-center":"mt-4",children:a})]});return c.jsx("div",{className:`flex flex-1 items-center justify-center ${o?"p-8 pb-24":"p-8 pb-23"}`,children:l})}function na({title:e,version:t,description:r}){const{t:a}=ye();return c.jsx(wt,{fullPage:!0,title:e,description:r,action:t?c.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:a("placeholder.coming",{version:t})}):void 0})}function dT(){const{t:e}=ye();return c.jsx(na,{title:e("page.docs.title"),version:"0.4.13",description:e("page.docs.description")})}function fT(){const{t:e}=ye();return c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[c.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:e("notfound.title")}),c.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:e("notfound.description")}),c.jsx(jr,{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=y1();let r="500",a=e("error.description");return Uo(t)?(r=String(t.status),t.status===404?a=e("notfound.description"):t.statusText&&(a=t.statusText)):t instanceof Error&&(a=t.message),console.error(`[ErrorPage] ${r}:`,t),c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[c.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:r}),c.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:a}),c.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[c.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:[c.jsx(cR,{size:14}),e("error.reload")]}),c.jsx(jr,{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 pT(){const{t:e}=ye();return c.jsx(na,{title:e("page.modeling.title"),version:"0.4.16",description:e("page.modeling.description")})}function hT(){const{t:e}=ye();return c.jsx(na,{title:e("page.brain.title"),version:"0.4.18",description:e("page.brain.description")})}function mT(){const{t:e}=ye();return c.jsx(na,{title:e("page.discovery.title"),version:"0.6.x",description:e("page.discovery.description")})}function gT(){const{t:e}=ye();return c.jsx(na,{title:e("page.sharing.title"),version:"0.4.39",description:e("page.sharing.description")})}function xT(){const{t:e}=ye();return c.jsx(na,{title:e("page.collaboration.title"),version:"0.5.x",description:e("page.collaboration.description")})}function lr({children:e,onClose:t,className:r="",overlayClass:a="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:l=!0,disableClose:u=!1}){const f=b.useRef(null);b.useEffect(()=>{if(!l)return;const p=m=>{m.key==="Escape"&&!u&&t()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,l,u]);const h=b.useCallback(p=>{o&&!u&&f.current&&!f.current.contains(p.target)&&t()},[t,o,u]);return c.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${a}`,onClick:h,children:c.jsx("div",{ref:f,className:r,children:e})})}function yT(){const{t:e}=ye(),[t,r]=b.useState([]),[a,o]=b.useState(!0),[l,u]=b.useState(!1),[f,h]=b.useState(null),p=[{label:e("page.settings.title")},{label:e("settings.tab.api_keys")}],m=b.useCallback(async()=>{o(!0);try{const _=await ze.get("/auth/api-keys");r(_)}catch{}finally{o(!1)}},[]);b.useEffect(()=>{m()},[m]);const x=_=>{u(!1),h(_),m()},v=async _=>{if(confirm(e("api_keys.delete.confirm")))try{await ze.delete(`/auth/api-keys/${_}`),m()}catch{}};return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:p.map((_,w)=>{const S=w===p.length-1;return c.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[w>0&&c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:S?"text-c4a-text-primary":"",children:_.label})]},w)})}),a&&c.jsx("div",{className:"flex flex-1 items-center justify-center pb-24",children:c.jsx(ta,{})}),!a&&t.length===0&&c.jsx(wt,{fullPage:!0,title:e("api_keys.empty.title"),description:e("api_keys.empty.description"),action:c.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")})}),!a&&t.length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[c.jsx("p",{className:"text-xs text-c4a-text-muted",children:e("api_keys.description")}),c.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:[c.jsx(vm,{size:14}),e("api_keys.create")]})]}),c.jsx("div",{className:"flex flex-col gap-3",children:t.map(_=>c.jsx(bT,{apiKey:_,onDelete:()=>v(_.id)},_.id))})]}),l&&c.jsx(vT,{onClose:()=>u(!1),onCreated:x}),f&&c.jsx(_T,{apiKey:f,onClose:()=>h(null)})]})}function bT({apiKey:e,onDelete:t}){const{t:r}=ye(),a=e.last_used_at?new Date(e.last_used_at).toLocaleDateString():r("api_keys.never_used"),o=new Date(e.created_at).toLocaleDateString();return c.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-mono text-sm text-c4a-text-primary",children:e.name}),c.jsxs("p",{className:"mt-1 text-xs text-c4a-text-muted",children:[c.jsxs("span",{className:"font-mono",children:[e.key_prefix,"****"]}),c.jsx("span",{className:"mx-2",children:"·"}),a]}),c.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:r("api_keys.created_at",{date:o})})]}),c.jsx("button",{onClick:t,className:"cursor-pointer p-1 text-c4a-text-muted transition-colors hover:text-c4a-error",title:"Delete",children:c.jsx(od,{size:14})})]})})}function vT({onClose:e,onCreated:t}){const{t:r}=ye(),[a,o]=b.useState(""),[l,u]=b.useState("never"),[f,h]=b.useState(!1),p=b.useRef(null),[m,x]=b.useState(!1),v=[{value:"never",label:r("api_keys.expires.never")},{value:"30d",label:r("api_keys.expires.30d")},{value:"90d",label:r("api_keys.expires.90d")},{value:"1y",label:r("api_keys.expires.1y")}],_=v.find(S=>S.value===l);b.useEffect(()=>{if(!f)return;const S=k=>{p.current&&!p.current.contains(k.target)&&h(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const w=async()=>{if(a.trim()){x(!0);try{const S=wT(l),k=await ze.post("/auth/api-keys",{name:a.trim(),scope:["read"],expires_at:S});t(k)}catch{x(!1)}}};return c.jsxs(lr,{onClose:e,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",children:[c.jsx("h2",{className:"mb-6 font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:r("api_keys.create")}),c.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:r("api_keys.form.name")}),c.jsx("input",{value:a,onChange:S=>o(S.target.value),placeholder:r("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"}),c.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:r("api_keys.form.expiry")}),c.jsxs("div",{ref:p,className:"relative mb-6",children:[c.jsxs("button",{type:"button",onClick:()=>h(S=>!S),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:[c.jsx("span",{children:_?.label}),c.jsx($t,{size:14,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${f?"rotate-90":""}`})]}),f&&c.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(S=>c.jsxs("button",{type:"button",onClick:()=>{u(S.value),h(!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 ${S.value===l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[c.jsx(Wr,{size:12,className:`shrink-0 ${S.value===l?"opacity-100":"opacity-0"}`}),S.label]},S.value))})]}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{onClick:e,disabled:m,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:r("common.cancel")}),c.jsx("button",{onClick:w,disabled:!a.trim()||m,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:r("api_keys.create")})]})]})}function _T({apiKey:e,onClose:t}){const{t:r}=ye(),[a,o]=b.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(e.key),o(!0),setTimeout(()=>o(!1),2e3)}catch{const u=document.querySelector("[data-api-key-value]");if(u){const f=document.createRange();f.selectNodeContents(u);const h=window.getSelection();h?.removeAllRanges(),h?.addRange(f)}}};return c.jsxs(lr,{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:[c.jsx("h2",{className:"mb-4 font-mono text-sm uppercase tracking-tight text-c4a-accent",children:r("api_keys.created")}),c.jsx("p",{className:"mb-4 text-sm text-c4a-text-secondary",children:r("api_keys.copy_warning")}),c.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:[c.jsx("code",{"data-api-key-value":!0,className:"flex-1 truncate font-mono text-xs text-c4a-text-primary",children:e.key}),c.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:r(a?"api_keys.copied":"api_keys.copy")})]}),c.jsx("div",{className:"flex justify-end",children:c.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:r("api_keys.done")})})]})}function wT(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 ST(){const{t:e}=ye();return c.jsx(na,{title:e("page.code_setup.title"),version:"0.4.13",description:e("page.code_setup.description")})}function jT(){const{t:e}=ye();return c.jsx(na,{title:e("page.code_compile.title"),version:"0.4.13",description:e("page.code_compile.description")})}function kT(){const{t:e}=ye();return c.jsx(na,{title:e("page.code_review.title"),version:"0.4.14",description:e("page.code_review.description")})}function NT(){const{t:e}=ye();return c.jsx(na,{title:e("page.code_result.title"),version:"0.4.14",description:e("page.code_result.description")})}const zo=new Map;let Ca=null;const Nh=()=>{if(Ca=null,zo.size===0)return;const e=[...zo.entries()];zo.clear();const t=kt.getState(),r=new Map(t.indexingTasks);let a=!1;for(const[o,l]of e){const u=r.get(o);u?.terminalState||(r.set(o,{...u,...l,pendingSkips:u?.pendingSkips,unchangedCount:u?.unchangedCount,modules:l.modules??u?.modules}),a=!0)}a&&kt.setState({indexingTasks:r})},ET=e=>{const t=zo.get(e.sourceId);t&&t.stage!==e.stage&&(Ca!==null&&(cancelAnimationFrame(Ca),Ca=null),Nh()),zo.set(e.sourceId,e),Ca===null&&(Ca=requestAnimationFrame(Nh))},Ml=(e,t)=>{for(const r of e){if(r.path===t)return r;if(r.children){const a=Ml(r.children,t);if(a)return a}}return null},CT=(e,t)=>t===""?e:Ml(e,t)?.children??[],rl=(e,t)=>{if(!t)return[];const r=t.split("/"),a=[];let o="";for(const l of r){o=o?`${o}/${l}`:l;const u=Ml(e,o);u&&a.push(u)}return a},kt=ea((e,t)=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",indexingTasks:new Map,fetchRootSources:async({library_id:r,limit:a,offset:o})=>{e({loading:!0,error:null});try{const l={library_id:r};a!==void 0&&(l.limit=String(a)),o!==void 0&&(l.offset=String(o));const u=await ze.get("/sources",l);e({rootSources:u.items,total:u.total,limit:u.limit,offset:u.offset,loading:!1})}catch(l){e({error:l instanceof Error?l.message:"Failed to load sources",loading:!1})}},fetchRootSource:async r=>{e({loading:!0,error:null,currentRoot:null});try{const a=await ze.get(`/sources/${r}`);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 r=>await ze.post("/sources",r),addTreeNode:async(r,a)=>{const o=await ze.post(`/sources/${r}/tree`,a);return e(l=>({rootSources:l.rootSources.map(u=>u.id===r?o:u),currentRoot:l.currentRoot?.id===r?o:l.currentRoot})),o},updateSource:async(r,a)=>{const o=await ze.put(`/sources/${r}`,a);e(l=>({rootSources:l.rootSources.map(u=>u.id===r?o:u),currentRoot:l.currentRoot?.id===r?o:l.currentRoot}))},deleteSource:async r=>{await ze.delete(`/sources/${r}`),e(a=>({rootSources:a.rootSources.filter(o=>o.id!==r),currentRoot:a.currentRoot?.id===r?null:a.currentRoot}))},deleteTreeNode:async(r,a)=>{const o=await ze.delete(`/sources/${r}/tree?path=${encodeURIComponent(a)}`);return e(l=>({rootSources:l.rootSources.map(u=>u.id===r?o:u),currentRoot:l.currentRoot?.id===r?o:l.currentRoot})),o},uploadDoc:async r=>await ze.post("/sources/upload",r),triggerIndex:async(r,a)=>{const o=new Map(t().indexingTasks);o.set(r,{sourceId:r,stage:"pending",progress:0,modules:a?.map(u=>u.path)}),e({indexingTasks:o});const l={};a&&(l.modules=a);try{const u=await ze.post(`/sources/${r}/index`,l);if(u.status!=="started")t().clearIndexTask(r);else if(u.dirty_skipped&&u.dirty_skipped.length>0){const f=new Map(t().indexingTasks),h=f.get(r);h&&(f.set(r,{...h,unchangedCount:u.dirty_skipped.length}),e({indexingTasks:f}))}return u}catch(u){throw t().clearIndexTask(r),u}},updateIndexProgress:r=>{if(!t().indexingTasks.get(r.sourceId)?.terminalState){if(r.stage==="skipping"&&r.message){const o=new Map(t().indexingTasks),l=o.get(r.sourceId),u=typeof r.message=="string"?r.message:JSON.stringify(r.message),f=[...l?.pendingSkips??[],u];o.set(r.sourceId,{...l??r,pendingSkips:f}),e({indexingTasks:o});return}ET(r)}},markIndexTerminal:(r,a,o)=>{zo.has(r)&&Ca!==null&&(cancelAnimationFrame(Ca),Ca=null,Nh());const l=new Map(t().indexingTasks),u=l.get(r);u&&l.set(r,{...u,terminalState:a,errorMessage:o}),e({indexingTasks:l})},clearIndexTask:r=>{const a=new Map(t().indexingTasks);a.delete(r),e({indexingTasks:a})},deleteIndex:async(r,a)=>{const o=a?`?modules=${a.map(u=>encodeURIComponent(u.path)).join(",")}`:"";return{deleted:(await ze.delete(`/sources/${r}/index${o}`)).deleted}},setFilter:r=>e({filter:r}),clearSources:()=>e({rootSources:[],currentRoot:null,total:0,offset:0})})),Eh="__c4a_indexWsSubs",Ch=globalThis;if(Ch[Eh])for(const e of Ch[Eh])e();const zl=[];Ch[Eh]=zl;zl.push(En.on("index/progress",e=>{const t=e;kt.getState().updateIndexProgress({sourceId:t.source_id,stage:t.stage,progress:t.progress,moduleName:t.module_name,currentFile:t.current_file,totalFiles:t.total_files,processedFiles:t.processed_files,message:t.message,modules:t.modules})}));zl.push(En.on("index/done",e=>{const t=e;kt.getState().markIndexTerminal(t.source_id,"done")}));zl.push(En.on("index/error",e=>{const t=e;if(kt.getState().markIndexTerminal(t.source_id,"error",t.error),t.errorCode){const a={DOC_INDEX_LLM_UNAVAILABLE:"index.doc.error.llm_unavailable",DOC_INDEX_EMBEDDING_UNAVAILABLE:"index.doc.error.embedding_unavailable",DOC_INDEX_CONTENT_MISSING:"index.doc.error.content_missing",DOC_INDEX_PARSE_FAILED:"index.doc.error.parse_failed",DOC_INDEX_LLM_EXHAUSTED:"index.doc.error.llm_exhausted"}[t.errorCode];a?Qr(Cn.t(a,{message:t.error??""}),5e3):t.error&&Qr(t.error,5e3)}else t.error&&Qr(t.error,5e3)}));zl.push(En.on("index/timeout",e=>{const t=e;kt.getState().markIndexTerminal(t.source_id,"timeout")}));function Aa({segments:e}){const{t}=ye(),r=b.useRef(null),a=b.useRef(null),[o,l]=b.useState(0),u=[{label:t("sources.breadcrumb.sources")},...e],f=Math.max(0,u.length-3);b.useEffect(()=>{const p=r.current,m=a.current;if(!p||!m)return;const x=()=>{const _=p.clientWidth,w=Array.from(m.children);if(w.length===0)return;const S=w.map(z=>z.offsetWidth),k=4;if(S.reduce((z,T)=>z+T,0)+k*(S.length-1)<=_){l(0);return}const R=20,E=(S[0]??0)+(S[1]??0)+k,D=S[S.length-1]??0,L=E+k+R+k+D;let $=f;for(let z=1;z<=f;z++){let T=0;for(let B=2+z;B<S.length-1;B++)T+=S[B]+k;if(L+T<=_){$=z;break}}l($)};x();const v=new ResizeObserver(x);return v.observe(p),()=>v.disconnect()},[f,e,t]);const h=(()=>{if(o===0||u.length<=3)return u;const p=u.slice(0,2),m=u[u.length-1],x=u.slice(2+o,u.length-1);return[...p,{label:"…"},...x,m]})();return c.jsxs("div",{ref:r,className:"relative min-w-0 overflow-hidden",children:[c.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs tracking-tight text-c4a-text-muted",children:h.map((p,m)=>{const x=m===h.length-1;return c.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${m===0?"uppercase":""}`,children:[m>0&&c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"}),p.to&&!x?c.jsx(jr,{to:p.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:p.label}):c.jsx("span",{className:`whitespace-nowrap ${x?"text-c4a-text-primary":""}`,children:p.label})]},m)})}),c.jsx("div",{ref:a,"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((p,m)=>c.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[m>0&&c.jsx($t,{size:12}),c.jsx("span",{className:"whitespace-nowrap",children:p.label})]},m))})]})}const RT=["all","indexed","not_indexed"];function TT({value:e,onChange:t}){const{t:r}=ye(),[a,o]=b.useState(!1),l=b.useRef(null),u=b.useRef(null),f={all:r("sources.filter.all"),indexed:r("sources.filter.indexed"),not_indexed:r("sources.filter.not_indexed")},h=b.useCallback(x=>{l.current&&!l.current.contains(x.target)&&o(!1)},[]);b.useEffect(()=>{if(a)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[a,h]);const p=b.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),o(!0)},[]),m=b.useCallback(()=>{u.current=setTimeout(()=>o(!1),150)},[]);return c.jsxs("div",{ref:l,className:"relative",onMouseEnter:p,onMouseLeave:m,children:[c.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:[c.jsx(PC,{size:12}),c.jsx("span",{className:"hidden sm:inline",children:f[e]}),c.jsx($t,{size:12,className:`hidden transition-transform duration-200 sm:block ${a?"rotate-90":""}`})]}),a&&c.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:RT.map(x=>c.jsxs("button",{onClick:()=>{t(x),o(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${x===e?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[c.jsx(Wr,{size:12,className:x===e?"opacity-100":"opacity-0"}),f[x]]},x))})]})}function tv({target:e,onConfirm:t,onCancel:r}){const{t:a}=ye();return c.jsxs(lr,{onClose:r,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:a("sources.delete.confirm_title")}),c.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[e.type==="resource"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.resource",{name:e.name})}),c.jsx("p",{children:a("sources.delete.resource_impact")}),c.jsx("p",{className:"text-c4a-warning",children:a("sources.delete.session_warning")}),c.jsx("p",{children:a("sources.delete.entity_safe")})]}),e.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.folder",{name:e.name})}),e.folderCount!==void 0&&e.sourceCount!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.folder_contents",{folders:e.folderCount,sources:e.sourceCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&c.jsx("p",{children:a("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.sourceCount})})]}):c.jsx("p",{children:a("sources.delete.folder_impact_generic")}),c.jsx("p",{className:"text-c4a-warning",children:a("sources.delete.irreversible")})]}),e.type==="repo"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.repo",{name:e.name,library:e.libraryName})}),e.packageCount!==void 0&&e.docCount!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.repo_contents",{packages:e.packageCount,docs:e.docCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&c.jsx("p",{children:a("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.packageCount+e.docCount})})]}):c.jsx("p",{children:a("sources.delete.repo_impact_generic")}),c.jsx("p",{children:a("sources.delete.local_safe")}),c.jsx("p",{children:a("sources.delete.entity_safe")})]}),e.type==="client"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.client",{name:e.name})}),c.jsx("p",{children:a("sources.delete.client_impact")}),c.jsx("p",{children:a("sources.delete.local_safe")}),c.jsx("p",{children:a("sources.delete.entity_safe")}),c.jsx("p",{className:"text-c4a-warning",children:a("sources.delete.irreversible")}),c.jsx("p",{className:"text-c4a-text-muted",children:a("sources.delete.client_reregister")})]})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx("button",{onClick:r,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:a("common.cancel")}),c.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:a("common.confirm")})]})]})}function AT({onConfirm:e,onCancel:t,error:r}){const{t:a}=ye(),[o,l]=b.useState(""),u=b.useRef(null);b.useEffect(()=>{u.current?.focus()},[]);const f=b.useCallback(()=>{const p=o.trim();p&&e(p)},[o,e]),h=b.useCallback(p=>{p.key==="Enter"&&(p.preventDefault(),f())},[f]);return c.jsxs(lr,{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:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(T1,{size:16,className:"shrink-0 text-c4a-accent"}),c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:a("sources.actions.new_folder")})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("input",{ref:u,value:o,onChange:p=>l(p.target.value),onKeyDown:h,placeholder:a("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}),r&&c.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:r})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.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:a("common.cancel")}),c.jsx("button",{onClick:f,disabled:!o.trim(),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:a("common.confirm")})]})]})}function Gp({label:e,icon:t,items:r,alignRight:a}){const[o,l]=b.useState(!1),u=b.useRef(null),f=b.useRef(null),h=b.useCallback(x=>{u.current&&!u.current.contains(x.target)&&l(!1)},[]);b.useEffect(()=>{if(o)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o,h]);const p=b.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),l(!0)},[]),m=b.useCallback(()=>{f.current=setTimeout(()=>l(!1),150)},[]);return c.jsxs("div",{ref:u,className:"relative",onMouseEnter:p,onMouseLeave:m,children:[c.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&&c.jsx("span",{className:"hidden sm:inline",children:e}),e&&c.jsx($t,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&c.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 ${a?"right-0":"left-0"}`,children:r.map(x=>c.jsxs("button",{onClick:()=>{x.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:[x.icon,x.label]},x.label))})]})}function LT({onClose:e}){const{t}=ye();return c.jsxs(lr,{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:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(gR,{size:18,className:"text-c4a-accent"}),c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:t("sources.upgrade.title")})]}),c.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:t("sources.upgrade.description")}),c.jsx("div",{className:"mt-6 flex justify-end",children:c.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")})})]})}const DT=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),OT=new Set([".ts",".tsx",".md"]),MT=new Set([".md",".txt",".ts",".tsx",".doc",".docx",".pdf",".ppt",".pptx"]),zT=new Set([".md",".txt"]),$T=5*1024*1024,BT=10;function Rh(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}function IT(e){const t=e.includes("/")?e.split("/").pop():e;if(DT.has(t.toLowerCase()))return!0;const r=Rh(t);return OT.has(r)}function UT(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function PT({onConfirm:e,onCancel:t,error:r,uploading:a}){const{t:o}=ye(),[l,u]=b.useState([]),[f,h]=b.useState(null),[p,m]=b.useState(!1),[x,v]=b.useState(!1),_=b.useRef(null),w=b.useCallback($=>{h(null);for(const z of $){const T=Rh(z.name);if(!MT.has(T)){h(o("sources.upload.unsupported_type",{name:z.name}));return}if(z.size>$T){h(o("sources.upload.file_too_large",{name:z.name}));return}}u(z=>{const T=new Map(z.map(H=>[H.name,H]));for(const H of $)T.set(H.name,{name:H.name,size:H.size,file:H});const B=Array.from(T.values());return B.length>BT?(h(o("sources.upload.too_many_files")),z):B})},[o]),S=b.useCallback($=>{const z=$.target.files;!z||z.length===0||(w(Array.from(z)),$.target.value="")},[w]),k=b.useCallback($=>{u(z=>z.filter((T,B)=>B!==$)),h(null)},[]),N=b.useCallback($=>{$.preventDefault(),m(!1);const z=$.dataTransfer?.files;!z||z.length===0||w(Array.from(z))},[w]),R=b.useCallback($=>{$.preventDefault(),m(!0)},[]),E=b.useCallback($=>{$.preventDefault(),m(!1)},[]),D=b.useCallback(async()=>{if(!(l.length===0||x)){v(!0);try{const $=await Promise.all(l.map(z=>new Promise((T,B)=>{const H=Rh(z.name),J=zT.has(H),oe=new FileReader;oe.onerror=()=>B(oe.error),J?(oe.onload=()=>T({name:z.name,content:oe.result,encoding:"utf-8"}),oe.readAsText(z.file)):(oe.onload=()=>{const ce=oe.result,M=ce.slice(ce.indexOf(",")+1);T({name:z.name,content:M,encoding:"base64"})},oe.readAsDataURL(z.file))})));e($)}catch{v(!1)}}},[l,x,e]),L=r||f;return c.jsxs(lr,{onClose:t,disableClose:x||(a??!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:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Sh,{size:16,className:"shrink-0 text-c4a-accent"}),c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("input",{ref:_,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:S,className:"hidden"}),c.jsxs("button",{type:"button",onClick:()=>_.current?.click(),onDrop:N,onDragOver:R,onDragLeave:E,disabled:x||a,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${p?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${x||a?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[c.jsx(Sh,{size:24,className:"text-c4a-text-muted"}),c.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),c.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),l.length>0&&c.jsxs("div",{className:"mt-3",children:[c.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:l.length})}),c.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:l.map(($,z)=>c.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[c.jsx(On,{size:12,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:$.name}),c.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:UT($.size)}),!x&&!a&&c.jsx("button",{type:"button",onClick:()=>k(z),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:c.jsx(Or,{size:12})})]},`${$.name}-${z}`))})]}),L&&c.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:L}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx("button",{onClick:t,disabled:x||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 disabled:opacity-40",children:o("common.cancel")}),c.jsxs("button",{onClick:D,disabled:l.length===0||x||a,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:[(x||a)&&c.jsx(Zt,{size:12,className:"animate-spin"}),o(x||a?"sources.upload.uploading":"common.confirm")]})]})]})}const HT=/^v\d+\.\d+\.\d+$/;function Th(e){const t=/^v(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function qT(e,t){const r=Th(e),a=Th(t);return!r||!a?!1:r[0]!==a[0]?r[0]>a[0]:r[1]!==a[1]?r[1]>a[1]:r[2]>a[2]}function FT(e){const t=Th(e);return t?`v${t[0]}.${t[1]}.${t[2]+1}`:"v0.0.1"}function GT({currentVersion:e,onConfirm:t,onCancel:r,uploading:a,serverError:o}){const{t:l}=ye(),[u,f]=b.useState(()=>FT(e)),h=b.useMemo(()=>HT.test(u)?qT(u,e)?null:l("upload.version_must_increase",{version:e}):l("upload.version_must_increase",{version:e}),[u,e,l]),p=b.useCallback(()=>{h||a||t(u)},[h,a,t,u]);return c.jsxs(lr,{onClose:r,disableClose:a??!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:[c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("upload.new_version_title")}),c.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("upload.new_version_desc")}),c.jsxs("div",{className:"mt-4",children:[c.jsx("label",{className:"block text-xs text-c4a-text-muted uppercase",children:l("upload.version_label")}),c.jsx("input",{type:"text",value:u,onChange:m=>f(m.target.value),disabled:a,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"}),c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:l("upload.current_version",{version:e})}),h&&c.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:h}),o&&!h&&c.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:o})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:r,disabled: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 disabled:opacity-40",children:l("common.cancel")}),c.jsxs("button",{type:"button",onClick:p,disabled:!!h||a,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:[a&&c.jsx(Zt,{size:12,className:"animate-spin"}),l("upload.confirm")]})]})]})}function VT({pathLabel:e,loading:t,badge:r,onNavigateUp:a,children:o}){return c.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[c.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:e}),r]}),c.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),c.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:t?c.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:c.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}):c.jsxs(c.Fragment,{children:[a&&c.jsxs("button",{onClick:a,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(xm,{size:14,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"leading-none pb-1",children:".."})]}),o]})})]})}function YT(e){const t=e.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(t){const r=t[1],a=t[2];return{slug:a,repoUrl:`https://${r}/${a}`,host:r}}try{const r=new URL(e),a=r.hostname,o=r.pathname.replace(/^\//,"").replace(/\.git$/,"");return o?{slug:o,repoUrl:`https://${a}/${o}`,host:a}:null}catch{return null}}function KT(e,t){return`${e}/tree/${encodeURIComponent(t)}`}function XT(e,t){return`${e}/commit/${t}`}function $1({remoteUrl:e,fallbackName:t,branch:r,commit:a}){const o=e?YT(e):null,l=a.slice(0,7);return c.jsxs("div",{className:"flex min-w-0 shrink flex-wrap items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent",children:[o?c.jsxs("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:o.repoUrl,children:[c.jsx(I0,{size:12,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:o.slug})]}):c.jsxs("span",{className:"flex items-center gap-1 truncate",children:[c.jsx(I0,{size:12,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:t||"repo"})]}),c.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?c.jsxs("a",{href:KT(o.repoUrl,r),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[c.jsx(Bu,{size:10,className:"shrink-0"}),c.jsx("span",{children:r})]}):c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Bu,{size:10,className:"shrink-0"}),c.jsx("span",{children:r})]}),c.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?c.jsx("a",{href:XT(o.repoUrl,a),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:l}):c.jsx("span",{children:l})]})}function B1({currentName:e,onConfirm:t,onCancel:r,error:a}){const[o,l]=b.useState(e),u=b.useRef(null);b.useEffect(()=>{u.current?.select()},[]);const f=b.useCallback(()=>{const p=o.trim();p&&p!==e?t(p):r()},[o,e,t,r]),h=b.useCallback(p=>{p.key==="Enter"?(p.preventDefault(),f()):p.key==="Escape"&&r()},[f,r]);return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{ref:u,value:o,onChange:p=>l(p.target.value),onKeyDown:h,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}),c.jsx("button",{onClick:p=>{p.stopPropagation(),f()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:c.jsx(Wr,{size:14})}),c.jsx("button",{onClick:p=>{p.stopPropagation(),r()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:c.jsx(Or,{size:14})}),a&&c.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:a})]})}const QT=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const r=o=>String(o).padStart(2,"0"),a=`${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}`;return t.getFullYear()===new Date().getFullYear()?a:`${t.getFullYear()}-${a}`},nv={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function ZT({source:e,isDaemonLibrary:t,isRepoRoot:r}){const{t:a}=ye(),o=e.kind==="source",l=o&&(e.source_type==="code"||IT(e.name)),f=l&&e.index_status!=="none"?"text-c4a-accent":"text-c4a-text-secondary",h=e.metadata?.origin==="remote";let p;if(e.kind==="folder"?p=r||h?c.jsx(Ol,{size:14,className:`shrink-0 ${f}`}):t?c.jsx(xC,{size:14,className:`shrink-0 ${f}`}):c.jsx(Gn,{size:14,className:`shrink-0 ${f}`}):e.source_type==="code"?p=c.jsx(Dr,{size:14,className:`shrink-0 ${f}`}):p=c.jsx(On,{size:14,className:`shrink-0 ${f}`}),!o||!l)return c.jsx(c.Fragment,{children:p});const m=nv[e.index_status]??nv.none,x=a(`sources.status.${e.index_status}`);return c.jsxs("span",{className:"group/dot relative shrink-0",children:[p,c.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${m}`}),c.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 rv({source:e,displayName:t,childCount:r,isDaemonLibrary:a,isRepoRoot:o,onClick:l,onRename:u,onDelete:f}){const{t:h}=ye(),[p,m]=b.useState(!1),[x,v]=b.useState(null),_=b.useCallback(async R=>{if(!u)return;const E=await u(R);E?v(E):(m(!1),v(null))},[u]),w=b.useCallback(()=>{m(!1),v(null)},[]),S=!o&&u,k=f,N=e.updated_at||e.created_at;return c.jsxs("div",{className:"group flex cursor-pointer items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors hover:bg-c4a-bg-hover",onClick:p?void 0:l,children:[c.jsx(ZT,{source:e,isDaemonLibrary:a??!1,isRepoRoot:o??!1}),p?c.jsx("div",{className:"min-w-0 flex-1",onClick:R=>R.stopPropagation(),children:c.jsx(B1,{currentName:e.name,onConfirm:_,onCancel:w,error:x})}):c.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-secondary",children:t??e.name}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.kind==="folder"&&r!==void 0&&c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:r})}),N&&c.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:QT(N)})]}),(S||k)&&c.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[S?c.jsx("button",{title:h("sources.actions.rename"),onClick:R=>{R.stopPropagation(),m(!0)},className:"-my-0.5 rounded p-0.5 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:c.jsx(wh,{size:14})}):k?c.jsx("span",{className:"inline-block h-[14px] w-[14px]"}):null,k&&c.jsx("button",{title:h("sources.actions.delete"),onClick:R=>{R.stopPropagation(),f()},className:"-my-0.5 rounded p-0.5 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:c.jsx(od,{size:14})})]})]})}function JT({library:e,onNewFolder:t,onUploadDoc:r,onImportRepo:a,onImportDir:o,onUpgrade:l}){const{t:u}=ye(),f=e.type==="daemon",h="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",p=f?c.jsxs("div",{className:"flex gap-3",children:[o&&c.jsx("button",{onClick:o,disabled:!e.is_online,className:h,children:u("sources.actions.import_dir")}),a&&c.jsx("button",{onClick:a,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")})]}):c.jsxs("div",{className:"flex gap-3",children:[c.jsx("button",{onClick:t,className:h,children:u("sources.actions.new_folder")}),r&&c.jsx("button",{onClick:r,className:h,children:u("sources.actions.upload_document")}),l&&c.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 c.jsx(wt,{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:p})}function WT(){const{t:e}=ye();return c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[c.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:e("sources.empty.indexed.title")}),c.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:e("sources.empty.indexed.description")})]})}const Ah=e=>{let t=0,r=0,a=0,o=0,l=0;const u=f=>{for(const h of f.children??[])h.kind==="folder"?(t++,u(h)):h.kind==="source"&&(r++,h.source_type==="code"?a++:o++,(h.index_status==="indexed"||h.index_status==="stale")&&l++)};return u(e),{folders:t,sources:r,codeSources:a,docSources:o,indexedSources:l}};function eA({items:e,isDaemon:t,isCloud:r,onItemClick:a,onRename:o,onDelete:l}){return c.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(u=>{if(u.type==="root"){const m=u.root,x=t,v=x?m.metadata?.local_path:void 0,_=m.tree.length>0?Ah({children:m.tree}):void 0,w=_?_.folders+_.sources:0,S=m.metadata,k=S?.origin==="remote",N=S?.import_type==="directory",R=k||x&&!N;return c.jsx(rv,{source:{id:m.id,library_id:m.library_id,owner_id:m.owner_id,path:"",kind:m.kind,source_type:m.source_type,name:m.name,content_hash:m.content_hash,metadata:m.metadata,index_status:m.index_status,created_at:m.created_at,updated_at:m.updated_at},...typeof v=="string"?{displayName:v}:{},...m.kind==="folder"?{childCount:w}:{},isDaemonLibrary:t??!1,isRepoRoot:R,onClick:()=>a(u),...k?{}:{onRename:E=>o(m.id,E)},onDelete:()=>l(u)},m.id)}const f=u.node,h=`${u.root.id}:${f.path}`,p=f.kind==="folder"?f.children?.length??0:void 0;return c.jsx(rv,{source:{id:u.root.id,library_id:u.root.library_id,owner_id:u.root.owner_id,path:f.path,kind:f.kind,source_type:f.source_type??null,name:f.name,content_hash:null,metadata:f.metadata??null,index_status:f.index_status??"none",created_at:u.root.created_at,updated_at:u.root.updated_at},...p!==void 0?{childCount:p}:{},isDaemonLibrary:t??!1,onClick:()=>a(u),...r&&u.root.metadata?.origin!=="remote"?{onDelete:()=>l(u)}:{}},h)})})}function tA({libId:e,isBrowsingTree:t,rootSourceId:r,treePath:a}){const{t:o}=ye(),{uploadDoc:l,fetchRootSources:u,fetchRootSource:f}=kt(),[h,p]=b.useState(!1),[m,x]=b.useState(null),[v,_]=b.useState(!1),[w,S]=b.useState(null),k=b.useCallback(async(R,E)=>{if(e){_(!0),x(null);try{const D={library_id:e,files:R.map(H=>{const J={file_name:H.name,content:H.content};return H.encoding&&(J.encoding=H.encoding),E&&(J.version_label=E),J})};t&&r&&(D.root_source_id=r,D.parent_path=a);const L=await l(D),$=L.results??[],z=$.some(H=>H.status==="created")||(L.created?.length??0)>0,T=$.some(H=>H.status==="hash_changed"),B=$.filter(H=>H.status==="no_change").length;if(T&&!E){const H=$.find(J=>J.status==="hash_changed");S({files:R,currentVersion:H?.current_version_label??"v0.0.0"}),p(!1)}else if(z&&(t&&r?f(r):u({library_id:e})),p(!1),S(null),B>0){const H=B===$.length?o("upload.no_change"):o("upload.partial_no_change",{count:B});Qr(H,4e3)}}catch(D){D instanceof hn&&D.status===409?x(o("sources.error.name_conflict",{name:R[0]?.name??""})):D instanceof hn&&x(D.message)}finally{_(!1)}}},[e,t,r,a,l,u,f,o]),N=b.useCallback(async R=>{w&&await k(w.files,R)},[w,k]);return{showUploadDoc:h,setShowUploadDoc:p,uploadError:m,setUploadError:x,uploading:v,versionDialogData:w,setVersionDialogData:S,handleUploadDoc:k,handleVersionConfirm:N}}function nA(e){const t=At(),r=Qt(w=>w.updateLibraryName),a=Qt(w=>w.deleteLibrary),[o,l]=b.useState(!1),[u,f]=b.useState(null),[h,p]=b.useState(!1),m=b.useCallback(async w=>{if(e)try{await r(e,w),l(!1),f(null)}catch(S){const k=S instanceof Error?S.message:String(S);f(k)}},[e,r]),x=b.useCallback(()=>{l(!1),f(null)},[]),v=b.useCallback(async()=>{if(e){try{await a(e),t("/studio/sources/add-client")}catch{}p(!1)}},[e,a,t]),_=b.useCallback(()=>{p(!1)},[]);return{renamingLib:o,setRenamingLib:l,renameLibError:u,deletingLib:h,setDeletingLib:p,handleLibRenameConfirm:m,handleLibRenameCancel:x,handleLibDeleteConfirm:v,handleLibDeleteCancel:_}}function rA(){const{t:e}=ye(),t=At(),{libId:r}=Vo(),[a,o]=Dl(),l=a.get("rootId")||null,u=a.get("path")||"",h=Qt(ds(qs)).find(me=>me.id===r),{rootSources:p,currentRoot:m,loading:x,filter:v,fetchRootSources:_,fetchRootSource:w,createSource:S,addTreeNode:k,updateSource:N,deleteSource:R,deleteTreeNode:E,setFilter:D}=kt(),L=l!==null,{showUploadDoc:$,setShowUploadDoc:z,uploadError:T,setUploadError:B,uploading:H,versionDialogData:J,setVersionDialogData:oe,handleUploadDoc:ce,handleVersionConfirm:M}=tA({libId:r,isBrowsingTree:L,rootSourceId:l,treePath:u}),[P,A]=b.useState(!1),[F,ee]=b.useState(null),[ae,W]=b.useState(null),[O,V]=b.useState(null),[re,se]=b.useState(null),[ne,ge]=b.useState(!1),{renamingLib:Ne,setRenamingLib:Fe,renameLibError:qe,deletingLib:be,setDeletingLib:fe,handleLibRenameConfirm:_e,handleLibRenameCancel:he,handleLibDeleteConfirm:ve,handleLibDeleteCancel:Ve}=nA(r);b.useEffect(()=>{r&&_({library_id:r})},[r,_]),b.useEffect(()=>{l&&w(l)},[l,w]),b.useEffect(()=>{const me=sessionStorage.getItem("c4a_batch_toast");me&&(sessionStorage.removeItem("c4a_batch_toast"),Qr(me,4e3))},[a]);const De=b.useMemo(()=>L?m?[...CT(m.tree,u)].sort((St,nt)=>St.kind!==nt.kind?St.kind==="folder"?-1:1:St.name.localeCompare(nt.name)).map(St=>({type:"node",root:m,node:St})):[]:[...p].sort((nt,Ct)=>nt.kind!==Ct.kind?nt.kind==="folder"?-1:1:new Date(Ct.created_at).getTime()-new Date(nt.created_at).getTime()).map(nt=>({type:"root",root:nt,node:null})),[L,p,m,u]),Xe=b.useMemo(()=>v==="all"?De:De.filter(me=>me.type==="root"||!me.node||me.node.kind==="folder"?!0:v==="indexed"?me.node.index_status==="indexed":me.node.index_status==="none"||!me.node.index_status),[De,v]),It=h?.type==="daemon",un=h?.type==="cloud",Vt=It&&!L,Bn=h?.type==="cloud"?!0:h?.is_online??!1,cr=kt(me=>me.indexingTasks),Xn=b.useMemo(()=>{if(L&&l){const me=cr.get(l);return!!me&&!me.terminalState}return p.some(me=>{const Ue=cr.get(me.id);return!!Ue&&!Ue.terminalState})},[L,l,cr,p]),Ht=b.useMemo(()=>{if(!h)return[];const me=[{label:h.is_default?e("sources.library.default_cloud_name"):h.name,to:`/studio/sources/${h.id}`}];return L&&m&&(me.push({label:m.name,to:`/studio/sources/${h.id}?rootId=${m.id}`}),u&&rl(m.tree,u).forEach(St=>{me.push({label:St.name,to:`/studio/sources/${h.id}?rootId=${m.id}&path=${encodeURIComponent(St.path)}`})})),me},[h,L,m,u,e]),Rn=b.useCallback(async me=>{if(r)try{L&&l?await k(l,{parent_path:u,kind:"folder",name:me}):(await S({library_id:r,kind:"folder",name:me}),_({library_id:r})),A(!1),ee(null)}catch(Ue){Ue instanceof hn&&Ue.status===409&&ee(e("sources.error.name_conflict",{name:me}))}},[r,L,l,u,S,k,_,e]),Le=b.useCallback(me=>{r&&(me.type==="root"?me.root.kind==="source"?t(`/studio/source/${me.root.id}`):o({rootId:me.root.id}):me.node&&(me.node.kind==="folder"?o({rootId:me.root.id,path:me.node.path}):t(`/studio/source/${me.root.id}?path=${encodeURIComponent(me.node.path)}`)))},[r,t,o]),Ze=b.useCallback(()=>{if(!(!l||!r))if(u){const me=u.split("/");me.pop();const Ue=me.join("/");o(Ue?{rootId:l,path:Ue}:{rootId:l})}else o({})},[l,r,u,o]),We=b.useCallback(async(me,Ue)=>{try{return await N(me,{name:Ue}),_({library_id:r}),null}catch(St){return St instanceof hn&&St.status===409?e("sources.error.name_conflict",{name:Ue}):null}},[r,N,_,e]),Nt=b.useCallback(me=>{if(me.type==="root"){V(me.root.id),se(null);const Ue=me.root.tree.length>0?Ah({children:me.root.tree}):void 0;W(It?{type:"repo",name:me.root.name,libraryName:h.name,...Ue?{packageCount:Ue.codeSources,docCount:Ue.docSources,indexedCount:Ue.indexedSources}:{}}:{type:me.root.kind==="folder"?"folder":"resource",name:me.root.name,...me.root.kind==="folder"&&Ue?{folderCount:Ue.folders,sourceCount:Ue.sources,indexedCount:Ue.indexedSources}:{}})}else if(me.node)if(V(me.root.id),se(me.node.path),me.node.kind==="folder"){const Ue=Ah(me.node);W({type:"folder",name:me.node.name,folderCount:Ue.folders,sourceCount:Ue.sources,indexedCount:Ue.indexedSources})}else W({type:"resource",name:me.node.name})},[It,h]),ft=b.useCallback(async()=>{if(!(!O||!r)){try{re?await E(O,re):(await R(O),_({library_id:r}))}catch{}W(null),V(null),se(null)}},[O,re,r,R,E,_]),Tn=b.useCallback(()=>{if(!r)return;const me=new URLSearchParams;l&&(me.set("parentId",l),m&&me.set("parentName",m.name)),u&&me.set("parentPath",u);const Ue=me.toString();t(`/studio/sources/import/${r}${Ue?`?${Ue}`:""}`)},[r,t,l,u,m]),mn=b.useCallback(()=>{r&&t(`/studio/sources/import-dir/${r}`)},[r,t]),gn=h?.is_default===!0;if(!h)return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Lt=p.length===0&&v==="all"&&!x&&!L,Et=Xe.filter(me=>me.type==="node"&&me.node?.kind==="source").length===0&&v==="indexed"&&!x,Pt=!L||!m?!1:m.metadata?.origin==="remote"?!0:u?rl(m.tree,u).some(Ue=>Ue.metadata?.origin==="remote"):!1,Er=!Vt,zr=un&&!Pt,sa=Vt;return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("div",{className:"min-w-0 flex-1",children:Ne?c.jsx(B1,{currentName:h.name,onConfirm:_e,onCancel:he,error:qe}):c.jsx(Aa,{segments:Ht})}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[zr&&c.jsxs(c.Fragment,{children:[c.jsx(Gp,{label:e("sources.actions.upload"),icon:c.jsx(Sh,{size:14}),items:[{label:e("sources.actions.upload_doc"),icon:c.jsx(On,{size:14}),onClick:()=>z(!0)}]}),c.jsx(Gp,{label:e("sources.actions.add"),icon:c.jsx(vm,{size:14}),items:[{label:e("sources.actions.add_folder"),icon:c.jsx(T1,{size:14}),onClick:()=>A(!0)},{label:e("sources.actions.add_web"),icon:c.jsx(EC,{size:14}),onClick:()=>ge(!0)},{label:e("sources.actions.add_feishu"),icon:c.jsx(lC,{size:14}),onClick:()=>ge(!0)}]}),c.jsxs("button",{onClick:()=>{const me=new URLSearchParams;l&&(me.set("parentId",l),m&&me.set("parentName",m.name)),u&&me.set("parentPath",u);const Ue=me.toString();t(`/studio/sources/import-remote/${r}${Ue?`?${Ue}`:""}`)},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:[c.jsx(B0,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo_url")})]})]}),sa&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:mn,disabled:!h.is_online,title:h.is_online?void 0:e("sources.import.daemon_offline",{name:h.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:[c.jsx(mC,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_dir")})]}),c.jsxs("button",{onClick:Tn,disabled:!h.is_online,title:h.is_online?void 0:e("sources.import.daemon_offline",{name:h.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:[c.jsx(B0,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo")})]}),c.jsx(Gp,{label:"",icon:c.jsx(wh,{size:14}),alignRight:!0,items:[{label:e("sources.library.rename"),icon:c.jsx(wh,{size:14}),onClick:()=>Fe(!0)},...gn?[]:[{label:e("sources.actions.delete"),icon:c.jsx(od,{size:14}),onClick:()=>fe(!0)}]]})]}),(L||un)&&c.jsxs("button",{onClick:()=>{const me=new URLSearchParams;l&&me.set("rootId",l),u&&me.set("path",u),t(`/studio/sources/${r}/batch-index?${me.toString()}`)},disabled:!Bn||Xn,title:e(Bn?Xn?"index.batch.tooltip_indexing":"index.batch.tooltip":"daemon.offline_tooltip"),className:`flex items-center gap-1.5 rounded border p-1 font-mono text-xs uppercase transition-colors sm:px-2 sm:py-1 ${Xn?"border-c4a-accent/30 bg-c4a-bg-surface text-c4a-accent":Bn?"border-c4a-border-default bg-c4a-bg-surface text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary":"border-c4a-border-default bg-c4a-bg-surface text-c4a-text-secondary opacity-40"}`,children:[Xn?c.jsx(Zt,{size:14,className:"animate-spin"}):c.jsx(aC,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:e("index.batch.tooltip")})]}),Er&&c.jsx(TT,{value:v,onChange:D})]})]}),Lt?c.jsx(JT,{library:h,onNewFolder:()=>A(!0),...It?{onImportRepo:Tn,onImportDir:mn}:{},...un?{onUploadDoc:()=>z(!0),onUpgrade:()=>{const me=new URLSearchParams;l&&(me.set("parentId",l),m&&me.set("parentName",m.name)),u&&me.set("parentPath",u);const Ue=me.toString();t(`/studio/sources/import-remote/${r}${Ue?`?${Ue}`:""}`)}}:{}}):c.jsx(VT,{pathLabel:(()=>{if(!L||!m)return"/";const me=m.metadata,Ue=It?typeof me?.local_path=="string"?me.local_path:m.name:"/"+m.name;if(!u)return Ue;const St=rl(m.tree,u);return Ue+"/"+St.map(nt=>nt.name).join("/")})(),loading:x,badge:(()=>{if(!L||!m)return;let me=m.metadata,Ue=m.name;if(!me?.origin&&u){const Ct=rl(m.tree,u);for(const Dt of Ct){const Oa=Dt.metadata;if(Oa?.origin==="remote"){me=Oa,Ue=Dt.name;break}}}const St=me?.pinned_branch??me?.remote_ref,nt=me?.pinned_hash??me?.remote_commit;if(!(!St||!nt))return c.jsx($1,{remoteUrl:me?.remote_url,fallbackName:Ue,branch:St,commit:nt})})(),onNavigateUp:L?Ze:void 0,children:Xe.length===0?Et?c.jsx(WT,{}):L?null:c.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:e("common.items",{count:0})}):c.jsx(eA,{items:Xe,isDaemon:It??!1,isCloud:un??!1,onItemClick:Le,onRename:We,onDelete:Nt})}),P&&c.jsx(AT,{onConfirm:Rn,onCancel:()=>{A(!1),ee(null)},error:F}),$&&c.jsx(PT,{onConfirm:ce,onCancel:()=>{z(!1),B(null)},error:T,uploading:H}),J&&c.jsx(GT,{currentVersion:J.currentVersion,onConfirm:M,onCancel:()=>{oe(null),B(null)},uploading:H,serverError:T}),ne&&c.jsx(LT,{onClose:()=>ge(!1)}),ae&&c.jsx(tv,{target:ae,onConfirm:ft,onCancel:()=>{W(null),V(null),se(null)}}),be&&h&&c.jsx(tv,{target:{type:"client",name:h.name},onConfirm:ve,onCancel:Ve})]})}function aA(){const{t:e}=ye(),t=At(),r=Qt(u=>u.libraries),a=Qt(u=>u.loading),[o,l]=b.useState(!1);return b.useEffect(()=>{if(a)return;if(r.length===0&&!o){l(!0),Qt.getState().fetchLibraries();return}const u=r.find(f=>f.is_default);u?t(`/studio/sources/${u.id}`,{replace:!0}):r.length>0&&t(`/studio/sources/${r[0].id}`,{replace:!0})},[r,a,t,o]),o&&!a&&r.length===0?c.jsx(wt,{fullPage:!0,icon:c.jsx(R1,{size:32}),title:e("sources.empty.cloud.title"),description:e("sources.empty.cloud.description")}):c.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:c.jsx(ta,{})})}function Xr({active:e,current:t}){return c.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 $s(){return c.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function I1({libraryName:e}){const{t}=ye();return c.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[c.jsx("p",{className:"text-sm text-c4a-warning",children:t("sources.import.daemon_offline",{name:e})}),c.jsx(jr,{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 wm({step:e,totalSteps:t,importing:r,stepBusy:a,canProceed:o,safetyNoticeKey:l,confirmLabelKey:u,onPrev:f,onNext:h,onImport:p}){const{t:m}=ye();return c.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[c.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:m(l),onClick:x=>x.currentTarget.classList.toggle("line-clamp-1"),children:m(l)}),c.jsxs("div",{className:"flex shrink-0 gap-2",children:[e>1&&c.jsx("button",{onClick:f,disabled:r||a,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:m("common.previous")}),e<t?c.jsx("button",{onClick:h,disabled:!o||a,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:m("common.next")}):c.jsxs("button",{onClick:p,disabled:r||a||!o,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[r&&c.jsx(Zt,{size:12,className:"animate-spin"}),m(r?"sources.import.importing":u)]})]})]})}function U1(e,t){const r=b.useCallback(async(u,f)=>{if(!e)throw new Error("No library");const h=await ze.post(`/libraries/${e}/rpc`,{method:u,params:f});if(h.error){const p=h.error;throw new Error(p.message??JSON.stringify(h.error))}return h.result??h},[e]),[a,o]=b.useState([]);b.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 h=f.items.map(p=>{const m=p.metadata;return typeof m?.local_path=="string"?m.local_path:null}).filter(p=>p!==null);o(h)}catch{}})(),()=>{u=!0}},[e]);const l=b.useMemo(()=>{const u=t?.config;return!u||!Array.isArray(u.allowed_paths)?[]:u.allowed_paths},[t]);return{rpc:r,importedPaths:a,allowedPaths:l}}function sA(e,t){const r=e.toLowerCase();try{if(r.endsWith("package.json")){const a=JSON.parse(t);if(typeof a.name=="string"&&a.name.trim())return a.name.trim()}if(r.endsWith("pyproject.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(r.endsWith("go.mod"))return t.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(r.endsWith("cargo.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(r.endsWith("pom.xml"))return t.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(r.endsWith("build.gradle"))return t.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function Lh(e,t,r="repo"){const a=[];for(const l of e){const u=l.path.split("/"),f=u.slice(0,-1).join("/")||".",h=u.length===1||l.path==="package.json",p=f==="."?r:u[u.length-2]||f,m=sA(l.path,l.content);a.push({name:m||p,path:f,isRoot:h})}const o=t.filter(l=>/\.md$/i.test(l.path)).map(l=>l.path);return{packages:a,mdFiles:o}}const av=new Set(["tree","blob","commit","commits","raw","src"]),oA=new Set(["commit","commits"]);function iA(e){let t;try{t=new URL(e.trim())}catch{return{repoUrl:e.trim()}}const r=t.pathname.split("/").filter(Boolean);let a=-1;for(let p=2;p<r.length;p++){const m=r[p];if(m==="-"&&p+1<r.length&&av.has(r[p+1])){a=p;break}if(av.has(m)){a=p;break}}if(a===-1)return{repoUrl:`${t.protocol}//${t.host}${t.pathname}`.replace(/\/+$/,"")};const o=r.slice(0,a).join("/"),l=`${t.protocol}//${t.host}/${o}`;let u,f;if(r[a]==="-"?(u=r[a+1],f=a+2):(u=r[a],f=a+1),f>=r.length)return{repoUrl:l};const h=r[f];return oA.has(u)?{repoUrl:l,commit:h}:{repoUrl:l,ref:h}}function Os(e){try{return(new URL(e).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return e.split("/").pop()||e}}function Dh(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}const lA=1500;async function P1(e){const t=lA-(Date.now()-e);t>0&&await new Promise(r=>setTimeout(r,t))}function H1(){const{t:e}=ye(),[t,r]=b.useState(!1),[a,o]=b.useState(null),l=b.useRef(),u=b.useRef(),f=window.location.host,h=`c4a-daemon --server ${f} --allow <dir1> <dir2>`,p=`c4a-daemon --server ${f}`,m=b.useCallback((_,w)=>{navigator.clipboard.writeText(_),o(w),clearTimeout(l.current),l.current=setTimeout(()=>o(null),1500)},[]),x=b.useCallback(()=>{clearTimeout(u.current),r(!0)},[]),v=b.useCallback(()=>{u.current=setTimeout(()=>r(!1),150)},[]);return c.jsxs("span",{className:"relative",onMouseEnter:x,onMouseLeave:v,children:[c.jsx(C1,{size:12,className:"text-c4a-warning"}),t&&c.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:x,onMouseLeave:v,children:[c.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_restrict")}),c.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[c.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),c.jsx("button",{onClick:()=>m(h,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:a===0?c.jsx(Wr,{size:10}):c.jsx($u,{size:10})})]}),c.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_all")}),c.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[c.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:p}),c.jsx("button",{onClick:()=>m(p,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:a===1?c.jsx(Wr,{size:10}):c.jsx($u,{size:10})})]})]})]})}function q1({open:e,onClose:t,rpc:r,onNavigate:a,defaultPath:o}){const{t:l}=ye(),[u,f]=b.useState(o??""),[h,p]=b.useState(null),[m,x]=b.useState(!1),v=b.useRef(null);b.useEffect(()=>{o&&!u&&f(o)},[o]);const _=b.useCallback(async()=>{const S=u.trim();if(S){x(!0),p(null);try{(await r("fs/exists",{path:S})).exists?(a(S),f(o??""),p(null),t()):p(l("sources.import.wildcard_path_not_found"))}catch(k){p(k instanceof Error?k.message:String(k))}finally{x(!1)}}},[u,r,l,a,t]),w=b.useCallback(()=>{f(o??""),p(null),t()},[t,o]);return e?c.jsxs(lr,{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:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:l("sources.import.wildcard_go_title")}),c.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:c.jsx(Or,{size:14})})]}),c.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[c.jsx("input",{ref:v,type:"text",value:u,onChange:S=>{f(S.target.value),p(null)},onKeyDown:S=>{S.key==="Enter"&&_()},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"}),c.jsxs("button",{onClick:_,disabled:m||!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:[m?c.jsx(Zt,{size:12,className:"animate-spin"}):c.jsx(N1,{size:12}),l("sources.import.wildcard_go")]})]}),h&&c.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:h})]}):null}function F1({rpc:e,allowedPaths:t,importedPaths:r,onNavigateUpExtra:a}){const o=!!t&&t.length>0,l=o&&t.length===1&&t[0]==="*",[u,f]=b.useState(o),[h,p]=b.useState(o&&!l?"":"/"),[m,x]=b.useState([]),[v,_]=b.useState(!1),[w,S]=b.useState(null),[k,N]=b.useState(null);b.useEffect(()=>{if(o&&!l)return;let B=!1;return(async()=>{try{const H=await e("fs/homeDir",{});B||N(H.home_dir)}catch{B||N("/")}})(),()=>{B=!0}},[o,l,e]);const[R,E]=b.useState(!1),D=b.useCallback(async B=>{_(!0),S(null);try{const H=await e("fs/listTree",{path:B,depth:1});x(H.entries||[]),p(B),f(!1)}catch(H){const J=H instanceof Error?H.message:String(H);S(J)}finally{_(!1)}},[e]);b.useEffect(()=>{o&&!l||k!==null&&D(k)},[k,o,l,D]);const L=b.useMemo(()=>new Set(r??[]),[r]),$=b.useCallback(()=>{if(o&&!l&&t.some(J=>J===h)){f(!0),p(""),x([]),S(null),a?.();return}const B=h.split("/").slice(0,-1).join("/")||"/";a?.(),D(B)},[o,l,t,h,D,a]),z=b.useMemo(()=>m.filter(B=>B.type==="directory"),[m]),T=b.useMemo(()=>m.filter(B=>B.type==="file"),[m]);return{atRoot:u,currentPath:h,entries:m,loading:v,error:w,homeDir:k,goToOpen:R,hasAllowedPaths:o,isWildcard:l,importedSet:L,dirs:z,files:T,loadTree:D,handleNavigateUp:$,setGoToOpen:E}}function cA({rpc:e,selectedPath:t,onSelect:r,allowedPaths:a,importedPaths:o}){const{t:l}=ye(),[u,f]=b.useState(null),{atRoot:h,currentPath:p,entries:m,loading:x,error:v,homeDir:_,goToOpen:w,isWildcard:S,importedSet:k,dirs:N,files:R,loadTree:E,handleNavigateUp:D,setGoToOpen:L}=F1({rpc:e,allowedPaths:a??[],importedPaths:o??[],onNavigateUpExtra:()=>f(null)}),[$,z]=b.useState(null),[T,B]=b.useState(!1);b.useEffect(()=>{if(!t){z(null),B(!1);return}z(null),B(!0);let ce=!1;return(async()=>{try{const M=await e("fs/repoStatus",{path:t});ce||(z({branch:M.branch,hash:M.head_hash,remoteUrl:M.remote_url}),B(!1))}catch{ce||(z(null),B(!1))}})(),()=>{ce=!0}},[t,e]);const H=b.useCallback(ce=>{if(ce.type==="directory")if(ce.is_git_repo){if(k.has(ce.path))return;f(null),r(ce.path,ce.name)}else f(ce.path),E(ce.path)},[r,E,k]),J=b.useMemo(()=>N.sort((ce,M)=>ce.is_git_repo&&!M.is_git_repo?-1:!ce.is_git_repo&&M.is_git_repo?1:ce.name.localeCompare(M.name)),[N]),oe=b.useMemo(()=>R.sort((ce,M)=>ce.name.localeCompare(M.name)),[R]);return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[h?c.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[c.jsx("span",{children:l("sources.import.allowed_dirs")}),c.jsx(H1,{})]}):c.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:p}),t&&T?c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[c.jsx(Zt,{size:12,className:"animate-spin"}),c.jsx("span",{children:l("common.loading")})]}):t&&$?c.jsx($1,{remoteUrl:$.remoteUrl,fallbackName:t.split("/").pop()||t,branch:$.branch,commit:$.hash}):!t&&S&&h?c.jsx("button",{onClick:()=>L(!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]}),c.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),h?S?c.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:_&&c.jsxs("button",{onClick:()=>E(_),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:14,className:"shrink-0"}),c.jsxs("span",{className:"truncate",children:[_,c.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",l("sources.import.wildcard_home"),")"]})]}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):c.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:a.map(ce=>c.jsxs("button",{onClick:()=>E(ce),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:14,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:ce}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]},ce))}):v&&!x?c.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):c.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[x&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:c.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&c.jsxs("button",{onClick:D,disabled:x,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[c.jsx(xm,{size:14,className:"text-c4a-text-muted"}),c.jsx("span",{className:"leading-none pb-1",children:".."})]}),J.map(ce=>{const M=ce.is_git_repo&&k.has(ce.path),P=ce.is_git_repo?Ol:Gn;return c.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-xs transition-colors ${M?"cursor-not-allowed text-c4a-accent/60":t===ce.path?"bg-c4a-bg-hover":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[c.jsxs("button",{onClick:()=>H(ce),disabled:M||x,className:"flex flex-1 items-center gap-2 py-1.5",children:[c.jsx(P,{size:14,className:"shrink-0"}),c.jsx("span",{className:"flex-1 truncate text-left",children:ce.name}),M&&c.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")})]}),!M&&c.jsx("button",{onClick:A=>{A.stopPropagation(),E(ce.path)},disabled:x,className:"shrink-0 rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent disabled:pointer-events-none",title:ce.path,children:c.jsx($t,{size:12})})]},ce.path)}),oe.map(ce=>c.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-xs text-c4a-text-muted",children:[c.jsx(bm,{size:14,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:ce.name})]},ce.path)),m.length===0&&!x&&c.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:l("sources.import.no_entries")})]}),u&&!t&&c.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:l("sources.import.not_git")}),c.jsx(q1,{open:w,onClose:()=>L(!1),rpc:e,onNavigate:E,defaultPath:_??void 0})]})}const To=50,Vp=["main","master"];function uA(e){const t=[],r=[];for(const a of e)Vp.includes(a.name)?t.push(a):r.push(a);return t.sort((a,o)=>Vp.indexOf(a.name)-Vp.indexOf(o.name)),[...t,...r]}function sv(e,t,r){b.useEffect(()=>{if(!r)return;const a=o=>{e.current&&!e.current.contains(o.target)&&t()};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,t,r])}function G1({refs:e,loading:t,error:r,selectedRef:a,commit:o,onRefChange:l,onCommitChange:u,onValidChange:f,onBranchSwitch:h}){const{t:p}=ye(),[m,x]=b.useState(!1),[v,_]=b.useState(""),[w,S]=b.useState(!0),[k,N]=b.useState(!0),R=b.useRef(null),E=b.useRef(null),[D,L]=b.useState(!1),[$,z]=b.useState(""),T=b.useRef(null),B=b.useRef(null);sv(R,()=>{x(!1),_("")},m),sv(T,()=>{L(!1),z("")},D),b.useEffect(()=>{m&&setTimeout(()=>E.current?.focus(),0)},[m]),b.useEffect(()=>{D&&setTimeout(()=>B.current?.focus(),0)},[D]),b.useEffect(()=>{f(!!a)},[a,f]);const H=b.useCallback(W=>{l(W.name),u(W.commit),x(!1),_(""),h?.(W.name)},[l,u,h]),J=b.useCallback((W,O)=>{u(W),l(O),L(!1),z("")},[u,l]),oe=b.useMemo(()=>e?uA(e.branches):[],[e]),ce=b.useMemo(()=>{const W=v.toLowerCase();return(W?oe.filter(V=>V.name.toLowerCase().includes(W)):oe).slice(0,To)},[oe,v]),M=b.useMemo(()=>{if(!e)return[];const W=v.toLowerCase();return(W?e.tags.filter(V=>V.name.toLowerCase().includes(W)):e.tags).slice(0,To)},[e,v]),P=b.useMemo(()=>{if(!e)return[];if(e.commits&&e.commits.length>0){const se=$.toLowerCase(),ne=e.commits.map(ge=>({hash:ge.hash,refName:a||"",label:`${ge.hash.slice(0,8)} ${ge.message?`— ${ge.message.slice(0,50)}`:""}`.trim()}));return se?ne.filter(ge=>ge.hash.toLowerCase().includes(se)||ge.label.toLowerCase().includes(se)).slice(0,To):ne.slice(0,To)}const W=new Set,O=[],V=[...e.branches??[],...e.tags??[]];for(const se of V){const ne=se.commit.slice(0,8);W.has(se.commit)||(W.add(se.commit),O.push({hash:se.commit,refName:se.name,label:`${ne} (${se.name})`}))}if(!$)return O.slice(0,To);const re=$.toLowerCase();return O.filter(se=>se.hash.toLowerCase().includes(re)||se.label.toLowerCase().includes(re)).slice(0,To)},[e,$,a]),[A,F]=b.useState(!1);if(b.useEffect(()=>{if(!t){F(!1);return}const W=setTimeout(()=>F(!0),5e3);return()=>clearTimeout(W)},[t]),t)return c.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:[c.jsx(Zt,{size:20,className:"animate-spin text-c4a-accent"}),c.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:p("sources.import_remote.loading_refs")}),A&&c.jsx("span",{className:"mt-1.5 text-xs text-c4a-text-muted",children:p("sources.import_remote.loading_refs_slow")})]});if(r)return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[c.jsx(Or,{size:14,className:"shrink-0"}),p("sources.import.error_title")]}),c.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:r})]});if(!e)return null;const ee=e.branches.find(W=>W.name===a)?.name??e.tags.find(W=>W.name===a)?.name??a,ae=o?o.slice(0,8):"";return c.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:[c.jsxs("div",{children:[c.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:p("sources.import_remote.ref_label")}),c.jsxs("div",{ref:R,className:"relative mt-2",children:[c.jsxs("button",{onClick:()=>x(!m),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:[c.jsx("span",{children:ee||"—"}),c.jsx($t,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&c.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[c.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:c.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[c.jsx(ml,{size:14,className:"shrink-0 text-c4a-text-muted"}),c.jsx("input",{ref:E,type:"text",value:v,onChange:W=>_(W.target.value),placeholder:p("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"})]})}),c.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[ce.length>0&&c.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[c.jsxs("button",{onClick:()=>S(!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:[c.jsx($t,{size:12,className:`transition-transform duration-200 ${w?"rotate-90":""}`}),p("sources.import_remote.ref_branches")," (",e.branches.length,")"]}),w&&ce.map(W=>c.jsxs("button",{onClick:()=>H(W),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${W.name===a?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[c.jsx("span",{className:"truncate",children:W.name}),W.name===a&&c.jsx("span",{children:"✓"})]},`b-${W.name}`))]}),M.length>0&&c.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[c.jsxs("button",{onClick:()=>N(!k),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:[c.jsx($t,{size:12,className:`transition-transform duration-200 ${k?"rotate-90":""}`}),p("sources.import_remote.ref_tags")," (",e.tags.length,")"]}),k&&M.map(W=>c.jsxs("button",{onClick:()=>H(W),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${W.name===a?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[c.jsx("span",{className:"truncate",children:W.name}),W.name===a&&c.jsx("span",{children:"✓"})]},`t-${W.name}`))]})]}),ce.length===0&&M.length===0&&c.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:p("sources.import_remote.commit_label")}),c.jsxs("div",{ref:T,className:"relative mt-2",children:[c.jsxs("button",{onClick:()=>L(!D),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:[c.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:ae||"—"}),c.jsx($t,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${D?"rotate-90":""}`})]}),D&&c.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:[c.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:c.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[c.jsx(ml,{size:12,className:"shrink-0 text-c4a-text-muted"}),c.jsx("input",{ref:B,type:"text",value:$,onChange:W=>z(W.target.value),placeholder:p("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"})]})}),P.map(W=>c.jsxs("button",{onClick:()=>J(W.hash,W.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:[c.jsx("span",{className:"truncate",children:W.label}),W.hash===o&&c.jsx("span",{className:"text-c4a-accent",children:"✓"})]},W.hash)),P.length===0&&c.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),c.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[c.jsx(AC,{size:12,className:"shrink-0"}),p("sources.import_remote.commit_hint")]})]})]})}const dA="_progressTrack_1cl9k_1",fA="_progressFill_1cl9k_9",pA="_progressFillComplete_1cl9k_45",hA="_progressFillFailed_1cl9k_49",ou={progressTrack:dA,progressFill:fA,progressFillComplete:pA,progressFillFailed:hA};function mA(e){const t={},r=100/e.length;return e.forEach((a,o)=>{t[a.key]=Math.round(r*(o+1))}),t}function gA(e,t,r,a,o,l){const u=m=>m>0?t[e[m-1].key]??0:0;if(o){const m=e.findIndex(_=>_.key===o),x=u(m),v=t[o]??100;return x+l/100*(v-x)}if(!r)return a.length===e.length?100:0;const f=e.findIndex(m=>m.key===r);if(f<0)return 0;const h=u(f),p=t[r]??100;return l>=0?h+l/100*(p-h):h}function V1({stages:e,currentStage:t,completedStages:r,failedStage:a,progress:o,breakpoints:l,headerRight:u}){const f=l??mA(e),h=o?.percent??-1,p=b.useRef(0),[m,x]=b.useState(0),v=b.useRef(null),_=gA(e,f,t,r,a,h>=0?h:-1);p.current=_,b.useEffect(()=>{_>m&&x(_)},[_]),b.useEffect(()=>{if(!t||a){v.current&&(clearInterval(v.current),v.current=null);return}const E=e.findIndex(T=>T.key===t),D=f[t]??100,L=E===e.length-1?D-1:D-2,$=500,z=.025;return v.current=setInterval(()=>{x(T=>{const B=p.current;if(T>=B&&T<L){const H=Math.max(.1,(L-T)*z);return Math.min(T+H,L)}return T})},$),()=>{v.current&&(clearInterval(v.current),v.current=null)}},[t,a,e,f]);const w=b.useRef(null);b.useEffect(()=>{if(r.length===e.length&&!a)return v.current&&(clearInterval(v.current),v.current=null),w.current=setInterval(()=>{x(E=>E>=100?(w.current&&clearInterval(w.current),w.current=null,100):Math.min(100,E+4))},32),()=>{w.current&&(clearInterval(w.current),w.current=null)}},[r.length,e.length,a]);const S=Math.min(100,Math.max(0,m)),k=!!t&&!a,N=!!a,R=r.length===e.length&&!a;return c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2 flex-wrap",children:e.map(E=>{const D=r.includes(E.key),L=a===E.key,$=t===E.key;let z="inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-mono text-[11px] uppercase tracking-tight transition-colors";return L?z+=" bg-red-500/10 text-red-400":D?z+=" bg-c4a-accent/10 text-c4a-accent":$?z+=" bg-c4a-accent/15 text-c4a-accent":z+=" bg-c4a-bg-elevated text-c4a-text-muted",c.jsxs("span",{className:z,children:[L?c.jsx(Or,{size:10,className:"shrink-0"}):D?c.jsx(Wr,{size:10,className:"shrink-0"}):$?c.jsx(Zt,{size:10,className:"shrink-0 animate-spin"}):c.jsx(JE,{size:8,className:"shrink-0 opacity-40"}),E.label]},E.key)})}),u&&c.jsx("div",{className:"shrink-0",children:u})]}),c.jsx("div",{className:ou.progressTrack,children:S>0?c.jsx("div",{className:`${ou.progressFill} ${N?ou.progressFillFailed:R?ou.progressFillComplete:""}`,style:{width:`${S}%`}},"fill"):null}),c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted tabular-nums",children:R?"100%":k||N?`${Math.round(S)}%`:""}),o?.label&&k&&c.jsx("span",{className:"hidden truncate font-mono text-[11px] text-c4a-text-muted sm:block",children:o.label})]})]})}function Y1({stages:e,currentStage:t,completedStages:r,failedStage:a,progress:o,breakpoints:l,failedError:u,logs:f}){const h=b.useRef(null);return b.useEffect(()=>{h.current?.scrollIntoView({behavior:"smooth"})},[f.length]),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx(V1,{stages:e,currentStage:t,completedStages:r,failedStage:a,progress:o,...l?{breakpoints:l}:{}}),c.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((p,m)=>c.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:p},m)),c.jsx("div",{ref:h})]}),a&&u&&c.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:c.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:u})})]})}function ln({icon:e,label:t,value:r,tooltip:a,size:o="sm"}){const l=o==="sm";return c.jsxs("div",{className:"group/stat relative rounded-lg border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[e,c.jsx("span",{className:"font-mono text-xs uppercase",children:t})]}),c.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${l?"text-sm truncate":"text-lg"}`,title:l?String(r):void 0,children:r}),a&&c.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:a})]})}const Yp=100;function K1({repoName:e,repoIdentifier:t,branch:r,commit:a,packages:o,mdFiles:l,importing:u,completed:f,importMethod:h}){const{t:p}=ye(),m=a?a.slice(0,7):"",[x,v]=b.useState("packages"),[_,w]=b.useState(Yp),S=b.useRef(null),k=b.useRef(null);b.useEffect(()=>{w(Yp),k.current?.scrollTo(0,0)},[x]),b.useEffect(()=>{const L=S.current;if(!L)return;const $=x==="packages"?o.length:l.length;if(_>=$)return;const z=new IntersectionObserver(T=>{T[0]?.isIntersecting&&w(B=>Math.min(B+Yp,$))},{root:k.current,threshold:.1});return z.observe(L),()=>z.disconnect()},[x,_,o.length,l.length]);const N=x==="packages"?o:l,R=N.slice(0,_),E=_<N.length,D=b.useMemo(()=>f?p("sources.import_remote.complete"):u?p("sources.import.importing"):p("sources.import.confirm_heading",{name:e}),[f,u,e,p]);return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[c.jsx("p",{className:"text-sm text-c4a-text-secondary",children:D}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[c.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:e}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:t})]}),c.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[c.jsx(ln,{icon:c.jsx(Bu,{size:14}),label:p("sources.import.branch"),value:r}),c.jsx(ln,{icon:c.jsx(wC,{size:14}),label:p("sources.import.commit"),value:m}),c.jsx(ln,{icon:c.jsx(Dr,{size:14}),label:p("sources.import.packages"),value:String(o.length),tooltip:p("sources.import.dir_code_packages_tip")}),c.jsx(ln,{icon:c.jsx(On,{size:14}),label:p("sources.import.documents"),value:String(l.length),tooltip:p("sources.import.dir_doc_files_tip")})]}),h&&c.jsxs("p",{className:"mt-3 font-mono text-xs text-c4a-text-muted",children:[p("sources.import_remote.api.method"),":"," ",c.jsx("span",{className:"text-c4a-accent",children:p(h==="api"?"sources.import_remote.api.method_api":"sources.import_remote.api.method_clone")})]}),u&&c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[c.jsx(Zt,{size:14,className:"animate-spin text-c4a-accent"}),c.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:p("sources.import.importing")})]}),(o.length>0||l.length>0)&&c.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[c.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:p("sources.import.recognized",{packages:o.length,docs:l.length})}),c.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[c.jsxs("button",{onClick:()=>v("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:[c.jsx(Dr,{size:13}),c.jsx("span",{className:"font-mono",children:o.length})]}),c.jsxs("button",{onClick:()=>v("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:[c.jsx(On,{size:13}),c.jsx("span",{className:"font-mono",children:l.length})]})]})]}),c.jsx("hr",{className:"border-c4a-border-subtle"}),c.jsx("div",{ref:k,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:N.length===0?c.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:x==="packages"?p("sources.import.no_packages"):"—"}):c.jsxs(c.Fragment,{children:[x==="packages"?R.map(L=>c.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[c.jsx(Dr,{size:14,className:"shrink-0 text-c4a-accent"}),c.jsx("span",{className:"text-c4a-text-secondary",children:L.name}),c.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:L.path}),L.isRoot&&c.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},L.path)):R.map(L=>c.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[c.jsx(On,{size:14,className:"shrink-0 text-c4a-text-secondary"}),c.jsx("span",{className:"truncate text-c4a-text-secondary",children:L})]},L)),E&&c.jsx("div",{ref:S,className:"h-4"})]})})]})]})}const xA=["scan","save"],iu={scan:"sources.import.stage.scan",save:"sources.import.stage.save"},yA={scan:20,save:90};function bA(){const{t:e}=ye(),t=At(),{libId:r}=Vo(),[a]=Dl(),l=Qt(ds(qs)).find(Le=>Le.id===r),u=kt(Le=>Le.createSource),f=a.get("parentId")||"",h=a.get("parentName")||"",p=a.get("parentPath")||"",[m,x]=b.useState(1),[v,_]=b.useState(null),[w,S]=b.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[k,N]=b.useState(null),[R,E]=b.useState(!1),[D,L]=b.useState(null),[$,z]=b.useState(""),[T,B]=b.useState(""),[H,J]=b.useState(!1),[oe,ce]=b.useState(!1),[M,P]=b.useState(!1),[A,F]=b.useState(null),[ee,ae]=b.useState([]),[W,O]=b.useState(null),[V,re]=b.useState(null),[se,ne]=b.useState([]),ge=b.useRef(null),Ne=l?.is_online??!1,{rpc:Fe,importedPaths:qe,allowedPaths:be}=U1(r,l),fe=b.useMemo(()=>xA.map(Le=>({key:Le,label:iu[Le]?e(iu[Le]):Le})),[e]),_e=b.useCallback(Le=>{ne(Ze=>[...Ze,`[${Dh()}] ${Le}`])},[]),he=b.useRef(null),ve=b.useCallback(Le=>{const Ze=he.current;Ze&&Ze!==Le&&(ae(We=>We.includes(Ze)?We:[...We,Ze]),_e(`${e(iu[Ze]??Ze)} ${e("sources.import.stage.done_suffix")}`)),_e(`${e(iu[Le]??Le)}...`),he.current=Le,F(Le),re(null)},[_e,e]),Ve=b.useCallback((Le,Ze)=>{S(We=>({...We,repoPath:Le,repoName:Ze}))},[]),De=b.useCallback(async()=>{E(!0),L(null);try{const Le=await Fe("fs/repoStatus",{path:w.repoPath}),Ze={branches:Le.branches??[{name:Le.branch,commit:Le.head_hash}],tags:Le.tags??[],default:Le.branch,commits:Le.commits??[{hash:Le.head_hash,message:"HEAD"}]};N(Ze),S(We=>({...We,isDirty:Le.is_dirty})),z(We=>{if(We)return We;const Nt=Ze.branches.find(mn=>mn.name===Ze.default),ft=Ze.branches[0],Tn=Nt??ft;return Tn?(B(Tn.commit),Tn.name):We})}catch(Le){const Ze=Le instanceof Error?Le.message:"Failed to load repository info";L(Ze)}finally{E(!1)}},[Fe,w.repoPath]);b.useEffect(()=>{m===2&&w.repoPath&&!k&&De()},[m,w.repoPath,k,De]);const Xe=b.useCallback(async Le=>{try{const Ze=await Fe("fs/repoStatus",{path:w.repoPath,branch:Le});N(We=>We&&{...We,commits:Ze.commits??[]})}catch{}},[Fe,w.repoPath]),It=b.useCallback(async()=>{if(!r)return;const Le=Date.now();ce(!0),P(!1),_(null),O(null),ae([]),he.current=null,F(null),re(null),ne([]),x(3);try{ve("scan");const Ze=await Fe("fs/repoScan",{path:w.repoPath,hash:T}),We=Ze.files||[],Nt=Ze.manifests||[],ft=Os(w.repoPath),{packages:Tn,mdFiles:mn}=Lh(Nt,We,ft);S(Et=>({...Et,branch:$,commit:T,repoFiles:We,packages:Tn,mdFiles:mn,repoFileContents:Nt})),ve("save");const gn=await u({library_id:r,repo_name:w.repoName||ft,repo_root_path:w.repoPath,repo_branch:$,repo_commit:T,repo_files:We.map(Et=>Et.path),repo_file_contents:Nt,...f?{parent_source_id:f,parent_path:p}:{}});ae(["scan","save"]),he.current=null,F(null),_e(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),_e(e("sources.import.stage.complete"));const Lt=Array.isArray(gn)?gn[0]:gn;ge.current=Lt?.id??null,await P1(Le),P(!0),ce(!1),x(4)}catch(Ze){const We=he.current??"scan";O(We),he.current=null,F(null);const Nt=Ze instanceof Error?Ze.message:String(Ze);_e(`ERROR: ${Nt}`),_(Nt),ce(!1)}},[r,w,$,T,f,p,Fe,u,ve,_e]),un=b.useCallback(()=>{O(null),_(null),It()},[It]),Vt=b.useCallback(()=>{if(r)if(f){const Le=w.repoName||Os(w.repoPath),Ze=p?`${p}/${Le}`:Le;t(`/studio/sources/${r}?rootId=${f}&path=${encodeURIComponent(Ze)}`)}else ge.current?t(`/studio/sources/${r}?rootId=${ge.current}`):t(`/studio/sources/${r}`)},[r,t,f,p,w.repoPath,w.repoName]),Bn=b.useMemo(()=>m===1?!!w.repoPath:m===2?H:m===3?M:!1,[m,w.repoPath,H,M]),cr=b.useMemo(()=>{if(!l)return[];const Le=[{label:l.is_default?e("sources.library.default_cloud_name"):l.name,to:`/studio/sources/${l.id}`}];if(f&&(Le.push({label:h||f,to:`/studio/sources/${l.id}?rootId=${f}`}),p)){const Ze=p.split("/").filter(Boolean);for(const[We,Nt]of Ze.entries()){const ft=Ze.slice(0,We+1).join("/");Le.push({label:Nt,to:`/studio/sources/${l.id}?rootId=${f}&path=${encodeURIComponent(ft)}`})}}return Le.push({label:e("sources.import.title")}),Le},[l,f,h,p,e]);if(!l)return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Xn=m===4,Ht=m===3&&!!W&&!oe,Rn=m<=2;return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Aa,{segments:cr})}),c.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[c.jsx(Xr,{active:m>=1,current:m===1}),c.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),c.jsx($s,{}),c.jsx(Xr,{active:m>=2,current:m===2}),c.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),c.jsx($s,{}),c.jsx(Xr,{active:m>=3,current:m===3}),c.jsx("span",{className:m===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),c.jsx($s,{}),c.jsx(Xr,{active:m>=4,current:m===4}),c.jsx("span",{className:m===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),c.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:Ne?c.jsxs(c.Fragment,{children:[m===1&&c.jsx(cA,{rpc:Fe,selectedPath:w.repoPath,onSelect:Ve,allowedPaths:be,importedPaths:qe}),m===2&&c.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:c.jsx(G1,{refs:k,loading:R,error:D,selectedRef:$,commit:T,onRefChange:z,onCommitChange:B,onValidChange:J,onRetry:De,onBranchSwitch:Xe})}),m===3&&c.jsx(Y1,{stages:fe,currentStage:A,completedStages:ee,failedStage:W,progress:V,breakpoints:yA,failedError:v,logs:se}),m===4&&c.jsx(K1,{repoName:w.repoName||Os(w.repoPath),repoIdentifier:w.repoPath,branch:$,commit:T,packages:w.packages,mdFiles:w.mdFiles,importing:!1,completed:M})]}):c.jsx(I1,{libraryName:l.name})}),Ne&&c.jsx(c.Fragment,{children:Xn?c.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:c.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")})}):Ht?c.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[c.jsx("button",{onClick:()=>{x(2),O(null),_(null),ae([]),he.current=null,F(null),ne([])},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")}),c.jsx("button",{onClick:un,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.retry")})]}):Rn?c.jsx(wm,{step:m,totalSteps:4,importing:oe,stepBusy:R||m===3&&oe,canProceed:Bn,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>x(Le=>Le-1),onNext:()=>{m===2?It():x(Le=>Le+1)},onImport:It}):null}),v&&m!==3&&c.jsxs(lr,{onClose:()=>_(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),c.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),c.jsx("div",{className:"mt-6 flex justify-end",children:c.jsx("button",{onClick:()=>_(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("common.confirm")})})]})]})}const ov=(e,t)=>{let r=0,a=0,o=0;const l=[],u=f=>{for(const h of f)if(h.type==="directory")a++,h.is_git_repo&&o++,h.children&&u(h.children);else if(r++,/\.md$/i.test(h.name)){const p=h.path.startsWith(t)?h.path.slice(t.length).replace(/^\//,""):h.name;l.push(p)}};return u(e),{files:r,dirs:a,gitRepos:o,mdFiles:l}};function vA({rpc:e,selectedPath:t,onSelect:r,allowedPaths:a,importedPaths:o}){const{t:l}=ye(),{atRoot:u,currentPath:f,entries:h,loading:p,error:m,homeDir:x,goToOpen:v,isWildcard:_,importedSet:w,dirs:S,files:k,loadTree:N,handleNavigateUp:R,setGoToOpen:E}=F1({rpc:e,allowedPaths:a??[],importedPaths:o??[]}),D=b.useCallback(T=>{if(T.type!=="directory"||w.has(T.path))return;const B=ov(T.children||[],T.path);r(T.path,T.name,B),N(T.path)},[r,N,w]);b.useEffect(()=>{if(f&&!u&&h.length>=0&&!p){const T=f.split("/").pop()||f,B=ov(h,f);r(f,T,B)}},[f,u,h,p,r]);const L=b.useMemo(()=>t?t.split("/").pop()||t:"",[t]),$=b.useMemo(()=>S.sort((T,B)=>T.is_git_repo&&!B.is_git_repo?-1:!T.is_git_repo&&B.is_git_repo?1:T.name.localeCompare(B.name)),[S]),z=b.useMemo(()=>k.sort((T,B)=>T.name.localeCompare(B.name)),[k]);return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u?c.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[c.jsx("span",{children:l("sources.import.allowed_dirs")}),c.jsx(H1,{})]}):c.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:f}),t?c.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[c.jsx(Gn,{size:12}),c.jsx("span",{children:L})]}):_&&u?c.jsx("button",{onClick:()=>E(!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]}),c.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),u?_?c.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:x&&c.jsxs("button",{onClick:()=>N(x),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:14,className:"shrink-0"}),c.jsxs("span",{className:"truncate",children:[x,c.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",l("sources.import.wildcard_home"),")"]})]}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):c.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:a.map(T=>c.jsxs("button",{onClick:()=>N(T),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:14,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:T}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]},T))}):m&&!p?c.jsx("p",{className:"py-4 text-xs text-c4a-error",children:m}):c.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[p&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:c.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}),f!=="/"&&c.jsxs("button",{onClick:R,disabled:p,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[c.jsx(xm,{size:14,className:"text-c4a-text-muted"}),c.jsx("span",{className:"leading-none pb-1",children:".."})]}),$.map(T=>{const B=w.has(T.path),H=T.is_git_repo?Ol:Gn;return c.jsxs("button",{onClick:()=>D(T),disabled:B||p,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs transition-colors ${B?"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:[c.jsx(H,{size:14,className:"shrink-0"}),c.jsx("span",{className:"flex-1 truncate",children:T.name}),B&&c.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")}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]},T.path)}),z.map(T=>c.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-xs text-c4a-text-muted",children:[c.jsx(bm,{size:14,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:T.name})]},T.path)),h.length===0&&!p&&c.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:l("sources.import.no_entries")})]}),c.jsx(q1,{open:v,onClose:()=>E(!1),rpc:e,onNavigate:N,defaultPath:x??void 0})]})}const _A=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),wA=e=>{let t=0,r=0,a=0,o=0,l=0;const u=new Set;for(const f of e)if(f.type==="directory")r++,f.is_git_repo&&l++;else{t++,f.path.toLowerCase().endsWith(".md")&&o++;const p=f.path.split("/").pop();if(p&&_A.has(p.toLowerCase())){const m=f.path.split("/").slice(0,-1).join("/");e.some(v=>v.type==="directory"&&v.is_git_repo&&(m===v.path||m.startsWith(`${v.path}/`)))||u.add(m)}}return a=u.size,{totalFiles:t,totalDirs:r,codePackages:a,docFiles:o,gitRepos:l}};function SA({dirPath:e,rpc:t,importing:r,onScanComplete:a,onBusyChange:o}){const{t:l}=ye(),[u,f]=b.useState(!1),[h,p]=b.useState(null),[m,x]=b.useState(null),v=b.useCallback(async()=>{f(!0),o?.(!0),p(null),x(null);try{const _=await t("fs/dirScan",{path:e}),w=_.entries||[],S=_.manifests||[],k=wA(w);x(k),a(w,k,S)}catch(_){const w=_ instanceof Error?_.message:String(_);p(w)}finally{f(!1),o?.(!1)}},[e,t,a,o]);return b.useEffect(()=>{v()},[v]),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[c.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:e}),c.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),c.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[u&&c.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[c.jsx(Zt,{size:14,className:"animate-spin text-c4a-accent"}),c.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:l("sources.import.dir_scanning")})]}),h&&c.jsxs("div",{className:"mt-6",children:[c.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[c.jsx(C1,{size:14,className:"mt-0.5 shrink-0"}),l("sources.import.dir_scan_error")]}),c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:h}),c.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:[c.jsx(iR,{size:12}),l("sources.import.dir_scan_retry")]})]}),m&&!u&&!h&&c.jsxs("div",{className:"mt-6 space-y-3",children:[c.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[l("sources.import.dir_scan_complete"),"!"]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[c.jsx(ln,{icon:c.jsx(On,{size:14}),label:l("sources.import.dir_doc_files"),value:m.docFiles,tooltip:l("sources.import.dir_doc_files_tip"),size:"lg"}),c.jsx(ln,{icon:c.jsx(Dr,{size:14}),label:l("sources.import.dir_code_packages"),value:m.codePackages,tooltip:l("sources.import.dir_code_packages_tip"),size:"lg"}),m.gitRepos>0&&c.jsx(ln,{icon:c.jsx(Ol,{size:14}),label:l("sources.import.dir_git_repos"),value:m.gitRepos,size:"lg"}),c.jsx(ln,{icon:c.jsx(Gn,{size:14}),label:l("sources.import.dir_total_dirs"),value:m.totalDirs,size:"lg"}),c.jsx(ln,{icon:c.jsx(fC,{size:14}),label:l("sources.import.dir_total_files"),value:m.totalFiles,size:"lg"})]}),m.gitRepos>0&&c.jsx("p",{className:"text-xs text-c4a-warning",children:l("sources.import.dir_git_skip_hint",{count:m.gitRepos})})]}),r&&c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[c.jsx(Zt,{size:14,className:"animate-spin text-c4a-accent"}),c.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:l("sources.import.importing")})]})]})]})}function jA(){const{t:e}=ye(),t=At(),{libId:r}=Vo(),o=Qt(ds(qs)).find(B=>B.id===r),l=kt(B=>B.createSource),[u,f]=b.useState(1),[h,p]=b.useState(!1),[m,x]=b.useState(null),[v,_]=b.useState(!1),[w,S]=b.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),k=o?.is_online??!1,{rpc:N,importedPaths:R,allowedPaths:E}=U1(r,o),D=b.useCallback((B,H,J)=>{S(oe=>({...oe,dirPath:B,dirName:H,fileCount:J.files,subDirCount:J.dirs,gitRepoCount:J.gitRepos,mdFiles:J.mdFiles}))},[]),L=b.useCallback((B,H,J)=>{S(oe=>({...oe,scanEntries:B,scanStats:H,manifests:J}))},[]),$=b.useCallback(async()=>{if(r){p(!0);try{const B=await l({library_id:r,dir_files:w.scanEntries,dir_name:w.dirName,dir_path:w.dirPath,dir_file_contents:w.manifests}),H=Array.isArray(B)?B[0]:B;H?.id?t(`/studio/sources/${r}?rootId=${H.id}`):t(`/studio/sources/${r}`)}catch(B){const H=B instanceof Error?B.message:String(B);x(H),p(!1)}}},[r,w,l,t]),z=b.useMemo(()=>u===1?!!w.dirPath:u===2?w.scanEntries.length>0:!0,[u,w]),T=b.useMemo(()=>o?[{label:o.is_default?e("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:e("sources.import.dir_title")}]:[],[o,e]);return o?c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Aa,{segments:T})}),c.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[c.jsx(Xr,{active:u>=1,current:u===1}),c.jsx("span",{className:u===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.select")}),c.jsx($s,{}),c.jsx(Xr,{active:u>=2,current:u===2}),c.jsx("span",{className:u===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.confirm")})]}),c.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:k?c.jsxs(c.Fragment,{children:[u===1&&c.jsx(vA,{rpc:N,selectedPath:w.dirPath,onSelect:D,allowedPaths:E,importedPaths:R}),u===2&&c.jsx(SA,{dirPath:w.dirPath,rpc:N,importing:h,onScanComplete:L,onBusyChange:_})]}):c.jsx(I1,{libraryName:o.name})}),k&&c.jsx(wm,{step:u,totalSteps:2,importing:h,stepBusy:v,canProceed:z,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>f(B=>B-1),onNext:()=>f(B=>B+1),onImport:$}),m&&c.jsxs(lr,{onClose:()=>x(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:[c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),c.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:m}),c.jsx("div",{className:"mt-6 flex justify-end",children:c.jsx("button",{onClick:()=>x(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")})})]})]}):c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})})}function kA(e){return new Promise((t,r)=>{let a=!1,o=null,l=null;const u=()=>{a=!0,o&&(clearInterval(o),o=null),l&&(l(),l=null)},f=(p,m,x)=>{a||(u(),p==="done"&&m?t(m):r(new Error(x??"Clone failed")))};l=En.on("task/complete",p=>{const m=p;m.task_id===e&&f(m.status??"error",m.result,m.error)}),o=setInterval(async()=>{if(!a)try{const p=await ze.get(`/import/remote/tasks/${e}`);p.status!=="running"&&f(p.status,p.result,p.error)}catch{}},5e3)})}async function NA(e){const{task_id:t}=await ze.post("/import/remote/clone",{library_id:e.libraryId,url:e.url,ref:e.ref,...e.commit?{commit:e.commit}:{},repo_name:e.repoName});return kA(t)}async function EA(e,t,r){const{libraryId:a,url:o,ref:l,commitHash:u,scanResult:f,sourceUuid:h,parentSourceId:p,parentPath:m}=e,x={library_id:a,url:o,ref:l,commit:u,repo_files:f.files,repo_file_contents:f.manifests,...h?{source_uuid:h}:{},...p?{parent_source_id:p,parent_path:m}:{}},v=m?`${m}/${t}`:t;if(r.length>0){const k=[],N=[],R=new Set;for(const E of r){const D=E.split("/").pop()??E,L=E.endsWith("/")?E:`${E}/`,$=f.files.filter(J=>J.path.startsWith(L)||J.path===E).map(J=>({...J,path:J.path.startsWith(L)?J.path.slice(L.length):J.path})),z=f.manifests.filter(J=>J.path.startsWith(L)||J.path===E).map(J=>({...J,path:J.path.startsWith(L)?J.path.slice(L.length):J.path})),T=await ze.post("/import/remote/import",{...x,repo_files:$,repo_file_contents:z,repo_name:v,dir_name:D,sub_path:E});k.push(T.id);const{packages:B,mdFiles:H}=Lh(z,$,D);for(const J of B)N.push(J);for(const J of H)R.add(J)}return{importIds:k,packages:N,mdFiles:Array.from(R)}}const _=await ze.post("/import/remote/import",{...x,repo_name:v,dir_name:t}),{packages:w,mdFiles:S}=Lh(f.manifests,f.files,t);return{importIds:[_.id],packages:w,mdFiles:S}}function CA(e,t,r){if(e instanceof hn){const a=e.message.toLowerCase();if(e.status===503)return r("sources.import_remote.error.capacity");if(a.includes("connect")||a.includes("connectionrefused")||a.includes("unavailable")||a.includes("econnrefused"))return r("sources.import_remote.error.network");if(a.includes("authentication")||a.includes("token")||a.includes("credential")||a.includes("401")||a.includes("403"))try{return r("sources.import_remote.error.auth_required",{host:new URL(t).hostname})}catch{return r("sources.import_remote.error.auth_required",{host:t})}return a.includes("not found")||a.includes("404")||a.includes("does not exist")?r("sources.import_remote.error.not_found"):e.message||r("sources.import_remote.error.network")}return e instanceof TypeError&&e.message.includes("fetch")?r("sources.import_remote.error.network"):e instanceof Error?e.message:r("sources.import_remote.error.network")}function RA(e){return e==="cloning"?"clone":e==="detecting"||e==="extracting"?"scan":e==="saving"?"save":e}const lu=/^https:\/\/[^/]+\/.+/,iv=e=>e.toLowerCase().replace(/:\d+$/,""),TA={"github.com":"github"};function Kp(e,t){try{const r=iv(new URL(e.trim()).hostname),a=t.find(o=>iv(o.host)===r&&o.api_import);return a?a.platform:TA[r]??null}catch{}return null}function AA({url:e,onUrlChange:t,onValidChange:r,onRefHint:a,onImportModeChange:o,forceClone:l}){const{t:u}=ye(),[f,h]=b.useState(null),[p,m]=b.useState([]),[x,v]=b.useState(null),[_,w]=b.useState("clone"),S=b.useRef(null);b.useEffect(()=>{ze.get("/import/remote/git-hosts").then(B=>m(B.hosts),()=>{})},[]);const k=l?"clone":x&&_==="api"?"api":"clone",N=b.useRef(k);b.useEffect(()=>{k!==N.current&&(N.current=k,o?.(k))},[k,o]);const R=b.useCallback(B=>{if(!B){h(null),r(!1),v(null);return}lu.test(B.trim())?(h(null),r(!0),v(Kp(B,p))):(h(u("sources.import_remote.url_invalid")),r(!1),v(null))},[r,u,p]),E=b.useCallback(B=>{if(!B){h(null),r(!1),v(null);return}const H=iA(B),J=H.repoUrl!==B.trim(),oe=J?H.repoUrl:B;J&&(t(oe),a?.(H.ref,H.commit)),lu.test(oe)?(h(null),r(!0),v(Kp(oe,p))):(h(u("sources.import_remote.url_invalid")),r(!1),v(null))},[t,r,a,u,p]),D=b.useCallback(B=>{const H=B.target.value;t(H),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>R(H),500)},[t,R]),L=b.useCallback(()=>{S.current&&clearTimeout(S.current),e&&E(e)},[e,E]),$=b.useCallback(B=>{B.preventDefault();const H=B.clipboardData.getData("text").trim();t(H),S.current&&clearTimeout(S.current),E(H)},[t,E]);b.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]),b.useEffect(()=>{e&&E(e)},[]),b.useEffect(()=>{e&&lu.test(e.trim())&&p.length>0&&v(Kp(e,p))},[p]),b.useEffect(()=>{o?.(l?"clone":x&&_==="api"?"api":"clone")},[x,l]);const z=B=>{w(B),o?.(l?"clone":B==="api"&&x?"api":"clone")},T=e&&lu.test(e.trim());return c.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:c.jsxs("div",{className:"w-full max-w-2xl space-y-5",children:[c.jsx("input",{type:"text",value:e,onChange:D,onBlur:L,onPaste:$,placeholder:u("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}),c.jsx("div",{className:"min-h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:f?c.jsx("p",{className:"text-red-400",children:f}):T?c.jsx("div",{className:"flex flex-col items-center gap-2",children:x&&!l?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"checkbox",className:"c4a-check",checked:_==="clone",onChange:()=>z("clone")}),c.jsx("span",{className:_==="clone"?"text-c4a-accent":"text-c4a-text-muted",children:u("sources.import_remote.api.use_clone")})]}),c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"checkbox",className:"c4a-check",checked:_==="api",onChange:()=>z("api")}),c.jsx("span",{className:_==="api"?"text-c4a-accent":"text-c4a-text-muted",children:u("sources.import_remote.api.detected",{platform:x})})]})]}):c.jsx("p",{className:"text-c4a-text-muted",children:u("sources.import_remote.api.will_use_clone")})}):c.jsxs(c.Fragment,{children:[c.jsx("p",{children:p.length>0?c.jsxs(c.Fragment,{children:[u("sources.import_remote.url_hint_public"),p.map((B,H)=>c.jsxs("span",{children:[H>0&&"、",c.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:B.host})]},B.host))]}):u("sources.import_remote.url_hint_no_auth")}),c.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:u("sources.import_remote.url_hint_format")})]})})]})})}function LA({repoUrl:e,ref:t,selected:r,fetchTree:a,onConfirm:o,onCancel:l}){const{t:u}=ye(),[f,h]=b.useState([]),[p,m]=b.useState(!0),[x,v]=b.useState(new Set),[_,w]=b.useState(new Set(r));b.useEffect(()=>{(async()=>{m(!0);try{const L=await a(e,t,"");h(L.map($=>({entry:$,children:null,loading:!1})))}catch{h([])}finally{m(!1)}})()},[]);const S=b.useCallback((L,$,z)=>L.map(T=>T.entry.path===$?z(T):T.children?{...T,children:S(T.children,$,z)}:T),[]),k=b.useCallback(async L=>{const $=L.entry.path;if(x.has($)){v(T=>{const B=new Set(T);return B.delete($),B});return}if(v(T=>new Set(T).add($)),L.children===null&&!L.loading){h(T=>S(T,$,B=>({...B,loading:!0})));try{const B=(await a(e,t,$)).map(H=>({entry:H,children:null,loading:!1}));h(H=>S(H,$,J=>({...J,children:B,loading:!1})))}catch{h(T=>S(T,$,B=>({...B,children:[],loading:!1})))}}},[x,e,t,a,S]),N=b.useCallback(L=>{w($=>{const z=new Set($);return z.has(L)?z.delete(L):z.add(L),z})},[]),R=b.useCallback(L=>{w($=>{const z=new Set($);return z.delete(L),z})},[]),E=b.useCallback(()=>{o(Array.from(_))},[o,_]),D=Array.from(_);return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 lg:flex-row",children:[c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded-lg border border-c4a-border-default lg:w-1/2",children:[c.jsx("div",{className:"border-b border-c4a-border-subtle px-3 py-2",children:c.jsx("span",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:u("sources.import_remote.api.sub_path")})}),c.jsx("div",{className:"c4a-scrollbar flex-1 overflow-y-auto",children:p?c.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:c.jsx(ta,{labelKey:"common.loading"})}):c.jsx(X1,{nodes:f,depth:0,expandedPaths:x,selectedPaths:_,onToggleExpand:k,onToggleSelect:N})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col rounded-lg border border-c4a-border-default lg:w-1/2",children:[c.jsx("div",{className:"border-b border-c4a-border-subtle px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:u("sources.import_remote.api.panel_selected")}),c.jsx("div",{className:"px-3 py-2",children:c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:u("sources.import_remote.api.selected_count",{count:D.length}).split(/(\d+)/).map((L,$)=>/^\d+$/.test(L)?c.jsx("span",{className:"font-extrabold text-c4a-accent",children:L},$):c.jsx("span",{children:L},$))})}),c.jsx("div",{className:"c4a-scrollbar flex-1 overflow-y-auto px-3",children:D.length===0?null:c.jsx("div",{className:"flex flex-col gap-0.5",children:D.map(L=>c.jsxs("div",{className:"flex items-center gap-2 rounded-sm px-2 py-1 text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:12,className:"shrink-0"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:L}),c.jsx("button",{onClick:()=>R(L),className:"shrink-0 text-c4a-text-muted hover:text-c4a-accent",children:c.jsx(Or,{size:12})})]},L))})})]})]}),c.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[c.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:u("sources.import.back")}),c.jsx("button",{onClick:E,disabled:D.length===0,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:cursor-not-allowed disabled:opacity-40",children:D.length>0?`${u("sources.import.step.confirm")} (${D.length})`:u("sources.import.step.confirm")})]})]})}function X1({nodes:e,depth:t,expandedPaths:r,selectedPaths:a,onToggleExpand:o,onToggleSelect:l}){const u=e.filter(h=>h.entry.type==="tree"),f=e.filter(h=>h.entry.type==="blob");return c.jsxs(c.Fragment,{children:[u.map(h=>{const p=h.entry.path,m=r.has(p);return c.jsxs("div",{children:[c.jsxs("div",{className:"flex h-8 items-center font-mono text-[12px] transition-colors hover:bg-c4a-bg-hover",style:{paddingLeft:`${t*16+8}px`},children:[c.jsx("button",{onClick:()=>o(h),className:"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center text-c4a-text-muted",children:h.loading?c.jsx(Zt,{size:12,className:"animate-spin"}):c.jsx($t,{size:12,className:`transition-transform duration-200 ${m?"rotate-90":""}`})}),c.jsx("input",{type:"checkbox",checked:a.has(p),onChange:()=>l(p),className:"c4a-check mx-1.5 h-3 w-3 cursor-pointer"}),c.jsx(Gn,{size:14,className:"mr-1.5 shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"truncate text-c4a-text-secondary",children:h.entry.name})]}),m&&h.children&&c.jsx(X1,{nodes:h.children,depth:t+1,expandedPaths:r,selectedPaths:a,onToggleExpand:o,onToggleSelect:l})]},p)}),f.map(h=>c.jsxs("div",{className:"flex h-8 items-center font-mono text-[12px]",style:{paddingLeft:`${t*16+8+20+6+12+6}px`},children:[c.jsx(bm,{size:14,className:"mr-1.5 shrink-0 text-c4a-text-muted opacity-50"}),c.jsx("span",{className:"truncate text-c4a-text-muted",children:h.entry.name})]},h.entry.path)),u.length===0&&f.length===0&&c.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",style:{paddingLeft:`${t*16+8}px`},children:"—"})]})}function DA(){const e=b.useRef(new Map),t=b.useCallback(async(l,u)=>{const f=await ze.post("/import/remote/branches",{repo_url:l,...u?{search:u}:{}});if(!f.provider_matched)return{refs:{branches:[],tags:[],default:""},providerMatched:!1,platform:null};const h=f.branches.find(m=>m.isDefault)?.name??"";return{refs:{branches:f.branches.map(m=>({name:m.name,commit:m.commitSha})),tags:[],default:h},providerMatched:!0,platform:f.platform}},[]),r=b.useCallback(async(l,u,f)=>{const h=`${l}::${u}::${f}`,p=e.current.get(h);if(p)return p;const m=await ze.post("/import/remote/tree",{repo_url:l,ref:u,path:f});return e.current.set(h,m.entries),m.entries},[]),a=b.useCallback(async l=>{const u=await ze.post("/import/remote/import",{library_id:l.libraryId,url:l.url,import_method:"api",branch:l.branch,commit_sha:l.commitSha,...l.subPaths&&l.subPaths.length>0?{sub_paths:l.subPaths}:{},...l.forceTruncated?{force_truncated:!0}:{},...l.sourceUuid?{source_uuid:l.sourceUuid}:{},...l.parentSourceId?{parent_source_id:l.parentSourceId,parent_path:l.parentPath}:{}}),f=u.results?.flatMap(p=>p.packages)??[],h=new Set;for(const p of u.results??[])for(const m of p.md_files)h.add(m);return{response:u,packages:f,mdFiles:Array.from(h)}},[]),o=b.useCallback(()=>{e.current.clear()},[]);return{fetchApiBranches:t,fetchRemoteTree:r,importViaApi:a,clearTreeCache:o}}function $l({error:e,onClose:t}){const{t:r}=ye(),[a,o]=b.useState(!1),l=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e.detail),o(!0),setTimeout(()=>o(!1),2e3)}catch{const u=document.createElement("textarea");u.value=e.detail,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u),o(!0),setTimeout(()=>o(!1),2e3)}},[e.detail]);return c.jsxs(lr,{onClose:t,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsx("p",{className:"font-mono text-sm font-bold uppercase tracking-tight text-c4a-text-primary",children:e.title}),c.jsx("p",{className:"mt-3 text-xs text-c4a-text-muted",children:r("error.dialog.console_hint")}),c.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[c.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 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?c.jsx(Wr,{size:12}):c.jsx($u,{size:12}),r(a?"error.dialog.copied":"error.dialog.copy")]}),c.jsx("button",{onClick:t,className:"rounded bg-c4a-accent px-4 py-1.5 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent-hover",children:r("error.dialog.confirm")})]})]})}const Xp=["prepare","clone","scan","save"],Q1={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"},OA={prepare:5,clone:90,scan:95,save:100},lv=["prepare","fetch_tree","read_packages","save"],Z1={prepare:"sources.import.stage.prepare",fetch_tree:"sources.import.stage.fetch_tree",read_packages:"sources.import.stage.read_packages",save:"sources.import.stage.save"},MA={prepare:5,fetch_tree:50,read_packages:90,save:100},cv={...Q1,...Z1};function zA(){const{t:e}=ye(),t=At(),{libId:r}=Vo(),[a]=Dl(),o=a.get("url")||"",l=a.get("ref")||"",u=a.get("sourceUuid")||"",f=a.get("parentId")||"",h=a.get("parentName")||"",p=a.get("parentPath")||"",x=Qt(ds(qs)).find(ue=>ue.id===r),[v,_]=b.useState(new Set),w=b.useCallback(async()=>{if(r)try{const ue=new Set;if(f){const Te=(await ze.get(`/sources/${f}`)).tree??[];let Ge=p===""?Te:[];if(p){const Oe=(gt,it)=>{for(const an of gt){if(an.path===it)return an.children??[];if(an.children){const _n=Oe(an.children,it);if(_n.length>0)return _n}}return[]};Ge=Oe(Te,p)}for(const Oe of Ge)ue.add(Oe.name.toLowerCase())}else{const Ee=await ze.get("/sources",{library_id:r});for(const Te of Ee.items)ue.add(Te.name.toLowerCase())}_(ue)}catch{}},[r,f,p]);b.useEffect(()=>{w()},[w]);const[S,k]=b.useState(o?2:1),[N,R]=b.useState(o),[E,D]=b.useState(!!o),[L,$]=b.useState(l),[z,T]=b.useState(""),[B,H]=b.useState(!!l),[J,oe]=b.useState(""),ce=b.useRef(void 0),M=b.useRef(void 0),[P,A]=b.useState("clone"),[F,ee]=b.useState([]),[ae,W]=b.useState(!1),[O,V]=b.useState(null),[re,se]=b.useState(null),ne=b.useRef(0),{fetchApiBranches:ge,fetchRemoteTree:Ne,importViaApi:Fe,clearTreeCache:qe}=DA(),be=F.length>0,fe=b.useCallback(ue=>{A(ue)},[]),_e=b.useRef(N);b.useEffect(()=>{N!==_e.current&&(_e.current=N,$(""),T(""),H(!1),ve(null),It(null),ee([]))},[N]);const[he,ve]=b.useState(null),[Ve,De]=b.useState(!1),[Xe,It]=b.useState(null),[un,Vt]=b.useState(!1),[Bn,cr]=b.useState(!1),[Xn,Ht]=b.useState(null),[Rn,Le]=b.useState(null),[Ze,We]=b.useState(null),[Nt,ft]=b.useState(null),[Tn,mn]=b.useState([]),[gn,Lt]=b.useState(null),[Et,Pt]=b.useState([]),Er=b.useRef(null),zr=b.useRef(""),sa=P==="api"?Z1:Q1,me=P==="api"?lv:Xp,Ue=P==="api"?MA:OA,St=b.useMemo(()=>me.map(ue=>({key:ue,label:sa[ue]?e(sa[ue]):ue})),[e,me,sa]),nt=b.useCallback(ue=>{Pt(Ee=>[...Ee,`[${Dh()}] ${ue}`])},[]),Ct=b.useRef(null),Dt=b.useCallback(ue=>{const Ee=Ct.current;Ee&&Ee!==ue&&(mn(Te=>Te.includes(Ee)?Te:[...Te,Ee]),nt(`${e(cv[Ee]??Ee)} ${e("sources.import.stage.done_suffix")}`)),nt(`${e(cv[ue]??ue)}...`),Ct.current=ue,ft(ue),Lt(null)},[nt,e]),Oa=b.useCallback((ue,Ee)=>{ce.current=ue,M.current=Ee},[]),oa=b.useCallback((ue,Ee)=>{ue.length!==0&&$(Te=>{if(Te)return Te;const Ge=ce.current,Oe=M.current;if(Ge){const an=ue.find(_n=>_n.name===Ge);if(an)return T(an.commit),an.name}Oe&&T(Oe);const it=ue.find(an=>an.name===Ee)??ue[0];return it?(Oe||T(it.commit),it.name):Te})},[]),ur=b.useCallback(async ue=>{if(!r)return;De(!0),It(null);const Ee=async()=>{const Te=await ze.post("/import/remote/refs",{library_id:r,url:N},ue?{signal:ue}:void 0);ue?.aborted||(ve(Te),oa([...Te.branches??[],...Te.tags??[]],Te.default))};try{if(P==="api"){const{refs:Te,providerMatched:Ge}=await ge(N);if(ue?.aborted)return;if(!Ge){A("clone"),ee([]),await Ee();return}ve(Te),oa(Te.branches,Te.default)}else await Ee()}catch(Te){if(ue?.aborted)return;It(CA(Te,N,e))}finally{ue?.aborted||De(!1)}},[r,N,e,P,ge,oa]);b.useEffect(()=>{if(S!==2||!r)return;const ue=new AbortController;return ur(ue.signal),()=>ue.abort()},[S,r,ur]),b.useEffect(()=>{if(!un||P!=="clone")return;let ue="";return En.on("task/progress",Te=>{const Ge=Te,Oe=RA(Ge.stage??"");Oe&&Xp.includes(Oe)&&(Lt({percent:Ge.percent??-1,label:Ge.detail??Ge.label??""}),Ge.detail&&Ge.detail!==ue&&(ue=Ge.detail,Pt(gt=>[...gt,`[${Dh()}] ${Ge.detail}`])))})},[un,P]);const An=b.useCallback(async(ue,Ee)=>{mn([...ue]),Ct.current=null,ft(null),nt(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),nt(e("sources.import.stage.complete")),await P1(Ee),cr(!0),Vt(!1),k(4)},[nt,e]),$r=b.useCallback(async ue=>{if(!r)return;const Ee=J||Os(N);Dt("clone");const Te=p?`${p}/${Ee}`:Ee,Ge=await NA({libraryId:r,url:N,ref:L,commit:z||void 0,repoName:Te});zr.current=Ge.commit_hash,Dt("scan");const Oe=await ze.post("/import/remote/scan",{library_id:r,path:Ge.path,hash:Ge.commit_hash});Dt("save");const gt=await EA({libraryId:r,url:N,ref:L,commitHash:Ge.commit_hash,scanResult:Oe,sourceUuid:u||void 0,parentSourceId:f||void 0,parentPath:p||void 0},Ee,[]);Er.current=gt.importIds[0]??null,Ht({packages:gt.packages,mdFiles:gt.mdFiles}),await An(Xp,ue)},[r,N,L,z,J,u,f,p,Dt,An]),ia=b.useCallback(async(ue,Ee=!1)=>{if(!r)return;Dt("fetch_tree");const Te=await Fe({libraryId:r,url:N,branch:L,commitSha:z,subPaths:F.length>0?F:void 0,forceTruncated:Ee,sourceUuid:u||void 0,parentSourceId:f||void 0,parentPath:p||void 0});if(Te.response.status==="truncated"){nt(e("sources.import_remote.api.truncated_warning")),V({treeEntries:Te.response.tree_entries??0,message:Te.response.message??""}),Vt(!1);return}Dt("read_packages"),zr.current=z,Dt("save");const Ge=Te.response.results?.[0];Ge&&(Er.current=Ge.source_id),Ht({packages:Te.packages,mdFiles:Te.mdFiles});for(const Oe of Te.response.warnings??[])Qr(Oe.message);await An(lv,ue)},[r,N,L,z,F,u,f,p,Fe,Dt,nt,e,An]),Ma=b.useCallback(async()=>{if(!r)return;const ue=Date.now();ne.current=ue,Vt(!0),cr(!1),Le(null),We(null),mn([]),Ct.current=null,ft(null),Lt(null),Pt([]),k(3);try{Dt("prepare"),await new Promise(Ee=>setTimeout(Ee,300)),P==="api"?await ia(ue):await $r(ue)}catch(Ee){const Te=Ct.current??"prepare";if(Ee instanceof hn&&Ee.code==="GIT_HOST_NOT_CONFIGURED"){Ct.current=null,ft(null),Vt(!1);let Oe=N;try{Oe=new URL(N).hostname}catch{}console.error("GIT_HOST_NOT_CONFIGURED:",Ee.message),se({title:e("sources.import_remote.api.git_host_not_configured",{host:Oe}),detail:Ee.message});return}if(P==="api"){nt(e("sources.import_remote.api.fallback_msg")),A("clone"),ee([]),mn([]),Ct.current=null,ft(null),Lt(null);try{Dt("prepare"),await new Promise(Oe=>setTimeout(Oe,300)),await $r(ue);return}catch(Oe){const gt=Ct.current??"prepare";We(gt),Ct.current=null,ft(null);const it=Oe instanceof Error?Oe.message:String(Oe);nt(`ERROR: ${it}`),Le(it),Vt(!1);return}}We(Te),Ct.current=null,ft(null);const Ge=Ee instanceof Error?Ee.message:String(Ee);nt(`ERROR: ${Ge}`),Le(Ge),Vt(!1)}},[r,N,P,Dt,ia,$r,nt,e]),I=b.useCallback(()=>{We(null),Le(null),Ma()},[Ma]),G=b.useCallback(ue=>{const Ee=ue instanceof Error?ue.message:String(ue);nt(`ERROR: ${Ee}`),Le(Ee),We(Ct.current??"prepare"),Ct.current=null,ft(null),Vt(!1)},[nt]),Z=b.useCallback(async()=>{V(null),Vt(!0);try{await ia(ne.current,!0)}catch(ue){G(ue)}},[ia,G]),xe=b.useCallback(async()=>{V(null),A("clone"),ee([]),Vt(!0),mn([]),Ct.current=null,ft(null),Lt(null);try{Dt("prepare"),await new Promise(ue=>setTimeout(ue,300)),await $r(ne.current)}catch(ue){G(ue)}},[$r,Dt,G]),we=b.useCallback(()=>{if(r)if(f){const ue=`/studio/sources/${r}?rootId=${f}`;t(p?`${ue}&path=${encodeURIComponent(p)}`:ue)}else Er.current&&!be?t(`/studio/sources/${r}?rootId=${Er.current}`):t(`/studio/sources/${r}`)},[r,t,f,p,be]),Re=b.useCallback(()=>{k(2),We(null),Le(null),mn([]),Ct.current=null,ft(null),Pt([])},[]),je=(J||Os(N)).toLowerCase(),ke=!be&&v.has(je),Ce=b.useMemo(()=>S===1?E:S===2?B&&!ke&&!Ve&&!Xe:!1,[S,E,B,ke,Ve,Xe]),Ie=b.useMemo(()=>{if(!x)return[];const ue=[{label:x.is_default?e("sources.library.default_cloud_name"):x.name,to:`/studio/sources/${x.id}`}];if(f&&(ue.push({label:h||f,to:`/studio/sources/${x.id}?rootId=${f}`}),p)){const Ee=p.split("/").filter(Boolean);for(const[Te,Ge]of Ee.entries()){const Oe=Ee.slice(0,Te+1).join("/");ue.push({label:Ge,to:`/studio/sources/${x.id}?rootId=${f}&path=${encodeURIComponent(Oe)}`})}}return ue.push({label:e("sources.import_remote.title")}),ue},[x,f,h,p,e]);if(!x)return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Pe=S===4&&Bn,Be=S===3&&!!Ze&&!un,dt=S<=2&&!ae;return S===2&&ae&&P==="api"?c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Aa,{segments:Ie})}),c.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:c.jsx(LA,{repoUrl:N,ref:L,selected:F,fetchTree:Ne,onConfirm:ue=>{ee(ue),W(!1),qe()},onCancel:()=>{W(!1),qe()}})})]}):c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Aa,{segments:Ie})}),c.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[c.jsx(Xr,{active:S>=1,current:S===1}),c.jsx("span",{className:S===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),c.jsx($s,{}),c.jsx(Xr,{active:S>=2,current:S===2}),c.jsx("span",{className:S===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),c.jsx($s,{}),c.jsx(Xr,{active:S>=3,current:S===3}),c.jsx("span",{className:S===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),c.jsx($s,{}),c.jsx(Xr,{active:S>=4,current:S===4}),c.jsx("span",{className:S===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),c.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[S===1&&c.jsx(AA,{url:N,onUrlChange:R,onValidChange:D,onRefHint:Oa,onImportModeChange:fe,forceClone:!!f}),S===2&&r&&c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[c.jsx(G1,{refs:he,loading:Ve,error:Xe,selectedRef:L,commit:z,onRefChange:$,onCommitChange:T,onValidChange:H,onRetry:()=>ur()}),!Ve&&he&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:e("sources.import.dir_name")}),c.jsx("input",{type:"text",value:J,onChange:ue=>oe(ue.target.value),placeholder:Os(N),disabled:be,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 ${be?"opacity-50":""} ${ke?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),ke?c.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:e("sources.import.dir_name_duplicate")}):c.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:e("sources.import.dir_name_hint")})]}),!f&&P==="api"&&c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:e("sources.import_remote.api.sub_path")}),c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:e("sources.import_remote.api.sub_path_hint")}),c.jsx("button",{onClick:()=>W(!0),className:"mt-2 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("sources.import_remote.api.select_sub_paths")}),F.length>0&&c.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:F.map(ue=>c.jsxs("span",{className:"inline-flex items-center gap-1 rounded border border-c4a-border-subtle bg-c4a-bg-subtle px-1.5 py-0.5 font-mono text-[11px] text-c4a-text-secondary",children:[ue,c.jsx("button",{onClick:()=>ee(Ee=>Ee.filter(Te=>Te!==ue)),className:"cursor-pointer text-c4a-text-muted hover:text-c4a-text-primary",children:c.jsx(Or,{size:10})})]},ue))})]})]})]}),S===3&&c.jsx(Y1,{stages:St,currentStage:Nt,completedStages:Tn,failedStage:Ze,progress:gn,breakpoints:Ue,failedError:Rn,logs:Et}),S===4&&c.jsx(K1,{repoName:Os(N),repoIdentifier:N,branch:L,commit:zr.current||z,packages:Xn?.packages??[],mdFiles:Xn?.mdFiles??[],importing:!1,completed:Bn,importMethod:P})]}),Pe?c.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:c.jsx("button",{onClick:we,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")})}):Be?c.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[c.jsx("button",{onClick:Re,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")}),c.jsx("button",{onClick:I,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")})]}):dt?c.jsx(wm,{step:S,totalSteps:2,importing:!1,stepBusy:Ve,canProceed:Ce,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>k(ue=>ue-1),onNext:()=>k(ue=>ue+1),onImport:Ma}):null,O&&c.jsxs(lr,{onClose:()=>V(null),className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsxs("p",{className:"font-mono text-sm font-bold uppercase tracking-tight text-c4a-text-primary",children:["⚠ ",e("sources.import_remote.api.truncated_warning")]}),c.jsx("p",{className:"mt-3 text-xs text-c4a-text-muted",children:e("sources.import_remote.api.truncated_suggest")}),c.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[c.jsx("button",{onClick:Z,className:"rounded border border-c4a-border-default px-4 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import_remote.api.truncated_continue")}),c.jsx("button",{onClick:xe,className:"rounded bg-c4a-accent px-4 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import_remote.api.truncated_use_clone")})]})]}),re&&c.jsx($l,{error:re,onClose:()=>{se(null),k(1)}})]})}function $A(){const{t:e}=ye(),t=At(),r=Qt(v=>v.createLibrary),[a,o]=b.useState("waiting"),[l,u]=b.useState(null),[f,h]=b.useState(""),[p,m]=b.useState(!1);b.useEffect(()=>En.on("ws:daemon:connected",_=>{const w=_;u(w),h(w.machine_id),o(w.needs_registration?"new_client":"reconnected")}),[]),b.useEffect(()=>{let v=!1;return(async()=>{try{const _=await ze.get("/daemons/pending");if(v||_.pending.length===0)return;const w=_.pending[0];u({machine_id:w.machine_id,needs_registration:!0}),h(w.machine_id),o("new_client")}catch{}})(),()=>{v=!0}},[]);const x=b.useCallback(async()=>{if(l){m(!0);try{const v=await r({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{m(!1)}}},[l,f,r,t]);return c.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[c.jsx(Aa,{segments:[{label:e("sources.add_client.title")}]}),c.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:e("sources.add_client.description")}),c.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:c.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[c.jsxs("li",{children:[c.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",e("sources.add_client.step1")]}),c.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 ",c.jsx(Qp,{text:"npm install -g @c4a/daemon"})]})]}),c.jsxs("li",{children:[c.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",e("sources.add_client.step2")]}),c.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}`," ",c.jsx(Qp,{text:`c4a-daemon --server ${window.location.host}`})]}),c.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:e("sources.add_client.step2_allow")}),c.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`," ",c.jsx(Qp,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),c.jsxs("li",{children:[c.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",e("sources.add_client.step3")]}),c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:e("sources.add_client.step3_desc")})]})]})}),c.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[a==="waiting"&&c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Zt,{size:16,className:"animate-spin text-c4a-warning"}),c.jsx("span",{className:"text-sm text-c4a-warning",children:e("sources.add_client.waiting")})]}),a==="new_client"&&l&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:e("sources.add_client.detected")}),c.jsxs("div",{className:"space-y-2 text-sm",children:[c.jsx(Zp,{label:e("sources.add_client.machine_name"),value:l.machine_id}),l.os&&c.jsx(Zp,{label:e("sources.add_client.os"),value:l.os}),l.daemon_version&&c.jsx(Zp,{label:e("sources.add_client.daemon_version"),value:l.daemon_version})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e("sources.add_client.client_name")}),c.jsx("input",{value:f,onChange:v=>h(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"})]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[c.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")}),c.jsxs("button",{onClick:x,disabled:p||!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:[p&&c.jsx(Zt,{size:12,className:"animate-spin"}),e("sources.add_client.confirm")]})]})]}),a==="reconnected"&&l&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Wr,{size:16,className:"text-c4a-success"}),c.jsx("span",{className:"text-sm text-c4a-text-primary",children:e("sources.add_client.reconnected",{name:l.machine_id})})]}),l.lib_id&&c.jsx(jr,{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 Qp({text:e}){const[t,r]=b.useState(!1),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[e]);return c.jsx("button",{type:"button",onClick:a,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:t?c.jsx(Wr,{size:13}):c.jsx($u,{size:13})})}function Zp({label:e,value:t}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:t})]})}const uv={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 Bt({children:e,variant:t="accent",tooltip:r}){return r?c.jsxs("span",{className:"relative inline-block group cursor-default",children:[c.jsx("span",{className:`inline-block font-mono text-[10px] uppercase px-1.5 py-0.5 rounded-sm ${uv[t]}`,children:e}),c.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:r})]}):c.jsx("span",{className:`inline-block font-mono text-[10px] uppercase px-1.5 py-0.5 rounded-sm ${uv[t]}`,children:e})}function Yo(e){return e===void 0?null:e>=.9?{labelKey:"confidence.high",tipKey:"confidence.high.tip",variant:"success",value:e}:e>=.7?{labelKey:"confidence.ai",tipKey:"confidence.ai.tip",variant:"warning",value:e}:{labelKey:"confidence.low",tipKey:"confidence.low.tip",variant:"error",value:e}}const J1="c4a_explorer_mode";function BA(){try{const e=localStorage.getItem(J1);if(e==="append"||e==="replace")return e}catch{}return"append"}const Ra=ea((e,t)=>({tabs:[],activeTabId:null,mode:BA(),openTab:r=>{const{tabs:a,mode:o}=t(),l=a.find(u=>u.id===r.id);if(l){e({activeTabId:l.id});return}if(o==="append")e({tabs:[...a,{...r,isAnchor:!1}],activeTabId:r.id});else{const u=a.find(f=>f.id===t().activeTabId);if(!u||u.isAnchor)e({tabs:[...a,{...r,isAnchor:!1}],activeTabId:r.id});else{const f=a.findIndex(p=>p.id===t().activeTabId),h=[...a];h[f]={...r,isAnchor:!1},e({tabs:h,activeTabId:r.id})}}},closeTab:r=>{const{tabs:a,activeTabId:o}=t(),l=a.find(p=>p.id===r);if(!l||l.isAnchor)return;const u=a.findIndex(p=>p.id===r),f=a.filter(p=>p.id!==r);let h=o;o===r&&(h=f[u-1]?.id??f[0]?.id??null),e({tabs:f,activeTabId:h})},activateTab:r=>{e({activeTabId:r})},closeAll:()=>{const{tabs:r}=t(),a=r.filter(o=>o.isAnchor);e({tabs:a,activeTabId:a[0]?.id??null})},setAnchor:r=>{const a={...r,isAnchor:!0};e({tabs:[a],activeTabId:a.id})},toggleMode:()=>{const r=t().mode==="append"?"replace":"append";try{localStorage.setItem(J1,r)}catch{}e({mode:r})},reset:()=>{e({tabs:[],activeTabId:null})}})),W1=b.createContext(null);function IA({children:e}){const t=Ra(a=>a.openTab),r=b.useCallback((a,o,l,u)=>{t({id:`${a}:${o}`,type:a,resourceId:o,label:l,...u!=null&&{icon:u}})},[t]);return c.jsx(W1.Provider,{value:{active:!0,navigate:r},children:e})}function Ko(){return b.useContext(W1)}const e4=b.createContext(null);function t4(){const e=b.useContext(e4);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}function n4({value:e,onChange:t,children:r}){return c.jsx(e4.Provider,{value:{value:e,onChange:t},children:c.jsx("div",{className:"flex flex-1 flex-col",children:r})})}function r4({children:e}){return c.jsx("div",{className:"flex border-b border-c4a-border-subtle",children:e})}function Vr({value:e,children:t}){const{value:r,onChange:a}=t4(),o=r===e;return c.jsx("button",{onClick:()=>a(e),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${o?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:t})}function Yr({value:e,children:t}){const{value:r}=t4();return r!==e?null:c.jsx("div",{className:"flex flex-1 flex-col",children:t})}function a4(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const UA=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PA=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HA={};function dv(e,t){return(HA.jsx?PA:UA).test(e)}const qA=/[ \t\n\f\r]/g;function id(e){return typeof e=="object"?e.type==="text"?fv(e.value):!1:fv(e)}function fv(e){return e.replace(qA,"")===""}class Bl{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}Bl.prototype.normal={};Bl.prototype.property={};Bl.prototype.space=void 0;function s4(e,t){const r={},a={};for(const o of e)Object.assign(r,o.property),Object.assign(a,o.normal);return new Bl(r,a,t)}function Oh(e){return e.toLowerCase()}class Kn{constructor(t,r){this.attribute=r,this.property=t}}Kn.prototype.attribute="";Kn.prototype.booleanish=!1;Kn.prototype.boolean=!1;Kn.prototype.commaOrSpaceSeparated=!1;Kn.prototype.commaSeparated=!1;Kn.prototype.defined=!1;Kn.prototype.mustUseProperty=!1;Kn.prototype.number=!1;Kn.prototype.overloadedBoolean=!1;Kn.prototype.property="";Kn.prototype.spaceSeparated=!1;Kn.prototype.space=void 0;let FA=0;const tt=Fs(),rn=Fs(),Mh=Fs(),Se=Fs(),Rt=Fs(),$o=Fs(),rr=Fs();function Fs(){return 2**++FA}const zh=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:rn,commaOrSpaceSeparated:rr,commaSeparated:$o,number:Se,overloadedBoolean:Mh,spaceSeparated:Rt},Symbol.toStringTag,{value:"Module"})),Jp=Object.keys(zh);class Sm extends Kn{constructor(t,r,a,o){let l=-1;if(super(t,r),pv(this,"space",o),typeof a=="number")for(;++l<Jp.length;){const u=Jp[l];pv(this,Jp[l],(a&zh[u])===zh[u])}}}Sm.prototype.defined=!0;function pv(e,t,r){r&&(e[t]=r)}function Xo(e){const t={},r={};for(const[a,o]of Object.entries(e.properties)){const l=new Sm(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(l.mustUseProperty=!0),t[a]=l,r[Oh(a)]=a,r[Oh(l.attribute)]=a}return new Bl(t,r,e.space)}const o4=Xo({properties:{ariaActiveDescendant:null,ariaAtomic:rn,ariaAutoComplete:null,ariaBusy:rn,ariaChecked:rn,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:Rt,ariaCurrent:null,ariaDescribedBy:Rt,ariaDetails:null,ariaDisabled:rn,ariaDropEffect:Rt,ariaErrorMessage:null,ariaExpanded:rn,ariaFlowTo:Rt,ariaGrabbed:rn,ariaHasPopup:null,ariaHidden:rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Rt,ariaLevel:Se,ariaLive:null,ariaModal:rn,ariaMultiLine:rn,ariaMultiSelectable:rn,ariaOrientation:null,ariaOwns:Rt,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:rn,ariaReadOnly:rn,ariaRelevant:null,ariaRequired:rn,ariaRoleDescription:Rt,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:rn,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function i4(e,t){return t in e?e[t]:t}function l4(e,t){return i4(e,t.toLowerCase())}const GA=Xo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$o,acceptCharset:Rt,accessKey:Rt,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:Rt,autoFocus:tt,autoPlay:tt,blocking:Rt,capture:null,charSet:null,checked:tt,cite:null,className:Rt,cols:Se,colSpan:null,content:null,contentEditable:rn,controls:tt,controlsList:Rt,coords:Se|$o,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:Mh,draggable:rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:Rt,height:Se,hidden:Mh,high:Se,href:null,hrefLang:null,htmlFor:Rt,httpEquiv:Rt,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:Rt,itemRef:Rt,itemScope:tt,itemType:Rt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:tt,muted:tt,name:null,nonce:null,noModule:tt,noValidate:tt,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:tt,optimum:Se,pattern:null,ping:Rt,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:Rt,required:tt,reversed:tt,rows:Se,rowSpan:Se,sandbox:Rt,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:rn,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Rt,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:rn,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:tt,disableRemotePlayback:tt,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:l4}),VA=Xo({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:rr,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,className:Rt,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:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,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:$o,g2:$o,glyphName:$o,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:rr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,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:Se,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:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Rt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rr,rev:rr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rr,requiredFeatures:rr,requiredFonts:rr,requiredFormats:rr,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:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:rr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rr,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:i4}),c4=Xo({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()}}),u4=Xo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:l4}),d4=Xo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),YA={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"},KA=/[A-Z]/g,hv=/-[a-z]/g,XA=/^data[-\w.:]+$/i;function f4(e,t){const r=Oh(t);let a=t,o=Kn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&XA.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(hv,ZA);a="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!hv.test(l)){let u=l.replace(KA,QA);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=Sm}return new o(a,t)}function QA(e){return"-"+e.toLowerCase()}function ZA(e){return e.charAt(1).toUpperCase()}const p4=s4([o4,GA,c4,u4,d4],"html"),Il=s4([o4,VA,c4,u4,d4],"svg");function h4(e){return e.join(" ").trim()}var Ao={},Wp,mv;function JA(){if(mv)return Wp;mv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
34
|
+
`,p="/",m="*",x="",v="comment",_="declaration";function w(k,N){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];N=N||{};var R=1,E=1;function D(M){var P=M.match(t);P&&(R+=P.length);var A=M.lastIndexOf(h);E=~A?M.length-A:E+M.length}function L(){var M={line:R,column:E};return function(P){return P.position=new $(M),B(),P}}function $(M){this.start=M,this.end={line:R,column:E},this.source=N.source}$.prototype.content=k;function z(M){var P=new Error(N.source+":"+R+":"+E+": "+M);if(P.reason=M,P.filename=N.source,P.line=R,P.column=E,P.source=k,!N.silent)throw P}function T(M){var P=M.exec(k);if(P){var A=P[0];return D(A),k=k.slice(A.length),P}}function B(){T(r)}function H(M){var P;for(M=M||[];P=J();)P!==!1&&M.push(P);return M}function J(){var M=L();if(!(p!=k.charAt(0)||m!=k.charAt(1))){for(var P=2;x!=k.charAt(P)&&(m!=k.charAt(P)||p!=k.charAt(P+1));)++P;if(P+=2,x===k.charAt(P-1))return z("End of comment missing");var A=k.slice(2,P-2);return E+=2,D(A),k=k.slice(P),E+=2,M({type:v,comment:A})}}function oe(){var M=L(),P=T(a);if(P){if(J(),!T(o))return z("property missing ':'");var A=T(l),F=M({type:_,property:S(P[0].replace(e,x)),value:A?S(A[0].replace(e,x)):x});return T(u),F}}function ce(){var M=[];H(M);for(var P;P=oe();)P!==!1&&(M.push(P),H(M));return M}return B(),ce()}function S(k){return k?k.replace(f,x):x}return Wp=w,Wp}var gv;function WA(){if(gv)return Ao;gv=1;var e=Ao&&Ao.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.default=r;const t=e(JA());function r(a,o){let l=null;if(!a||typeof a!="string")return l;const u=(0,t.default)(a),f=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:m}=h;f?o(p,m,h):m&&(l=l||{},l[p]=m)}),l}return Ao}var Gi={},xv;function e3(){if(xv)return Gi;xv=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,l=function(p){return!p||r.test(p)||e.test(p)},u=function(p,m){return m.toUpperCase()},f=function(p,m){return"".concat(m,"-")},h=function(p,m){return m===void 0&&(m={}),l(p)?p:(p=p.toLowerCase(),m.reactCompat?p=p.replace(o,f):p=p.replace(a,f),p.replace(t,u))};return Gi.camelCase=h,Gi}var Vi,yv;function t3(){if(yv)return Vi;yv=1;var e=Vi&&Vi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(WA()),r=e3();function a(o,l){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(f,h){f&&h&&(u[(0,r.camelCase)(f,l)]=h)}),u}return a.default=a,Vi=a,Vi}var n3=t3();const r3=M_(n3),a3=s3("start");function s3(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function o3(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bv(e.position):"start"in e||"end"in e?bv(e):"line"in e||"column"in e?$h(e):""}function $h(e){return vv(e&&e.line)+":"+vv(e&&e.column)}function bv(e){return $h(e&&e.start)+"-"+$h(e&&e.end)}function vv(e){return e&&typeof e=="number"?e:1}class zn extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let o="",l={},u=!1;if(r&&("line"in r&&"column"in r?l={place:r}:"start"in r&&"end"in r?l={place:r}:"type"in r?l={ancestors:[r],place:r.position}:l={...r}),typeof t=="string"?o=t:!l.cause&&t&&(u=!0,o=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?l.ruleId=a:(l.source=a.slice(0,h),l.ruleId=a.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.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=o,this.line=f?f.line:void 0,this.name=o3(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}}zn.prototype.file="";zn.prototype.name="";zn.prototype.reason="";zn.prototype.message="";zn.prototype.stack="";zn.prototype.column=void 0;zn.prototype.line=void 0;zn.prototype.ancestors=void 0;zn.prototype.cause=void 0;zn.prototype.fatal=void 0;zn.prototype.place=void 0;zn.prototype.ruleId=void 0;zn.prototype.source=void 0;const jm={}.hasOwnProperty,i3=new Map,l3=/[A-Z]/g,c3=new Set(["table","tbody","thead","tfoot","tr"]),u3=new Set(["td","th"]),m4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function d3(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=b3(r,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");a=y3(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Il:p4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=g4(o,e,void 0);return l&&typeof l!="string"?l:o.create(e,o.Fragment,{children:l||void 0},void 0)}function g4(e,t,r){if(t.type==="element")return f3(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return p3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return m3(e,t,r);if(t.type==="mdxjsEsm")return h3(e,t);if(t.type==="root")return g3(e,t,r);if(t.type==="text")return x3(e,t)}function f3(e,t,r){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Il,e.schema=o),e.ancestors.push(t);const l=y4(e,t.tagName,!1),u=v3(e,t);let f=Nm(e,t);return c3.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!id(h):!0})),x4(e,u,l,t),km(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function p3(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}yl(e,t.position)}function h3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);yl(e,t.position)}function m3(e,t,r){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=Il,e.schema=o),e.ancestors.push(t);const l=t.name===null?e.Fragment:y4(e,t.name,!0),u=_3(e,t),f=Nm(e,t);return x4(e,u,l,t),km(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function g3(e,t,r){const a={};return km(a,Nm(e,t)),e.create(t,e.Fragment,a,r)}function x3(e,t){return t.value}function x4(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function km(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function y3(e,t,r){return a;function a(o,l,u,f){const p=Array.isArray(u.children)?r:t;return f?p(l,u,f):p(l,u)}}function b3(e,t){return r;function r(a,o,l,u){const f=Array.isArray(l.children),h=a3(a);return t(o,l,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function v3(e,t){const r={};let a,o;for(o in t.properties)if(o!=="children"&&jm.call(t.properties,o)){const l=w3(e,o,t.properties[o]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&u3.has(t.tagName)?a=f:r[u]=f}}if(a){const l=r.style||(r.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function _3(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else yl(e,t.position);else{const o=a.name;let l;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else yl(e,t.position);else l=a.value===null?!0:a.value;r[o]=l}return r}function Nm(e,t){const r=[];let a=-1;const o=e.passKeys?new Map:i3;for(;++a<t.children.length;){const l=t.children[a];let u;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const p=o.get(h)||0;u=h+"-"+p,o.set(h,p+1)}}const f=g4(e,l,u);f!==void 0&&r.push(f)}return r}function w3(e,t,r){const a=f4(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?a4(r):h4(r)),a.property==="style"){let o=typeof r=="object"?r:S3(e,String(r));return e.stylePropertyNameCase==="css"&&(o=j3(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?YA[a.property]||a.property:a.attribute,r]}}function S3(e,t){try{return r3(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,o=new zn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=m4+"#cannot-parse-style-attribute",o}}function y4(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let l=-1,u;for(;++l<o.length;){const f=dv(o[l])?{type:"Identifier",name:o[l]}:{type:"Literal",value:o[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}a=u}else a=dv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const o=a.value;return jm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);yl(e)}function yl(e,t){const r=new zn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=m4+"#cannot-handle-mdx-estrees-without-createevaluater",r}function j3(e){const t={};let r;for(r in e)jm.call(e,r)&&(t[k3(r)]=e[r]);return t}function k3(e){let t=e.replace(l3,N3);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function N3(e){return"-"+e.toLowerCase()}var Bh=Object.defineProperty,E3=Object.getOwnPropertyDescriptor,C3=Object.getOwnPropertyNames,R3=Object.prototype.hasOwnProperty,T3=(e,t)=>{let r={};for(var a in e)Bh(r,a,{get:e[a],enumerable:!0});return Bh(r,Symbol.toStringTag,{value:"Module"}),r},A3=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=C3(t),l=0,u=o.length,f;l<u;l++)f=o[l],!R3.call(e,f)&&f!==r&&Bh(e,f,{get:(h=>t[h]).bind(null,f),enumerable:!(a=E3(t,f))||a.enumerable});return e},L3=(e,t,r)=>(A3(e,t,"default"),r),Tt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function D3(e){return Em(e)}function Em(e){return Array.isArray(e)?O3(e):e instanceof RegExp?e:typeof e=="object"?M3(e):e}function O3(e){let t=[];for(let r=0,a=e.length;r<a;r++)t[r]=Em(e[r]);return t}function M3(e){let t={};for(let r in e)t[r]=Em(e[r]);return t}function b4(e,...t){return t.forEach(r=>{for(let a in r)e[a]=r[a]}),e}function v4(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?v4(e.substring(0,e.length-1)):e.substr(~t+1)}var eh=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,cu=class{static hasCaptures(e){return e===null?!1:(eh.lastIndex=0,eh.test(e))}static replaceCaptures(e,t,r){return e.replace(eh,(a,o,l,u)=>{let f=r[parseInt(o||l,10)];if(f){let h=t.substring(f.start,f.end);for(;h[0]===".";)h=h.substring(1);switch(u){case"downcase":return h.toLowerCase();case"upcase":return h.toUpperCase();default:return h}}else return a})}};function _4(e,t){return e<t?-1:e>t?1:0}function w4(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,a=t.length;if(r===a){for(let o=0;o<r;o++){let l=_4(e[o],t[o]);if(l!==0)return l}return 0}return r-a}function _v(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 S4(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var j4=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}},Iu=class{constructor(e,t,r){this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(B3(e),t)}static createFromParsedTheme(e,t){return U3(e,t)}_cachedMatchRoot=new j4(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,a=this._cachedMatchRoot.get(t).find(o=>z3(e.parent,o.parentScopes));return a?new k4(a.fontStyle,a.foreground,a.background):null}},th=class Nu{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(const a of r)t=new Nu(t,a);return t}static from(...t){let r=null;for(let a=0;a<t.length;a++)r=new Nu(r,t[a]);return r}push(t){return new Nu(this,t)}getSegments(){let t=this;const r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const r=[];let a=this;for(;a&&a!==t;)r.push(a.scopeName),a=a.parent;return a===t?r.reverse():void 0}};function z3(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let a=t[r],o=!1;if(a===">"){if(r===t.length-1)return!1;a=t[++r],o=!0}for(;e&&!$3(e.scopeName,a);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function $3(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var k4=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function B3(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],a=0;for(let o=0,l=t.length;o<l;o++){let u=t[o];if(!u.settings)continue;let f;if(typeof u.scope=="string"){let x=u.scope;x=x.replace(/^[,]+/,""),x=x.replace(/[,]+$/,""),f=x.split(",")}else Array.isArray(u.scope)?f=u.scope:f=[""];let h=-1;if(typeof u.settings.fontStyle=="string"){h=0;let x=u.settings.fontStyle.split(" ");for(let v=0,_=x.length;v<_;v++)switch(x[v]){case"italic":h=h|1;break;case"bold":h=h|2;break;case"underline":h=h|4;break;case"strikethrough":h=h|8;break}}let p=null;typeof u.settings.foreground=="string"&&_v(u.settings.foreground)&&(p=u.settings.foreground);let m=null;typeof u.settings.background=="string"&&_v(u.settings.background)&&(m=u.settings.background);for(let x=0,v=f.length;x<v;x++){let w=f[x].trim().split(" "),S=w[w.length-1],k=null;w.length>1&&(k=w.slice(0,w.length-1),k.reverse()),r[a++]=new I3(S,k,o,h,p,m)}}return r}var I3=class{constructor(e,t,r,a,o,l){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=a,this.foreground=o,this.background=l}},Nn=(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))(Nn||{});function U3(e,t){e.sort((h,p)=>{let m=_4(h.scope,p.scope);return m!==0||(m=w4(h.parentScopes,p.parentScopes),m!==0)?m:h.index-p.index});let r=0,a="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let h=e.shift();h.fontStyle!==-1&&(r=h.fontStyle),h.foreground!==null&&(a=h.foreground),h.background!==null&&(o=h.background)}let l=new P3(t),u=new k4(r,l.getId(a),l.getId(o)),f=new q3(new Ih(0,null,-1,0,0),[]);for(let h=0,p=e.length;h<p;h++){let m=e[h];f.insert(0,m.scope,m.parentScopes,m.fontStyle,l.getId(m.foreground),l.getId(m.background))}return new Iu(l,u,f)}var P3=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,r=e.length;t<r;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)}},H3=Object.freeze([]),Ih=class N4{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,r,a,o,l){this.scopeDepth=t,this.parentScopes=r||H3,this.fontStyle=a,this.foreground=o,this.background=l}clone(){return new N4(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let a=0,o=t.length;a<o;a++)r[a]=t[a].clone();return r}acceptOverwrite(t,r,a,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),a!==0&&(this.foreground=a),o!==0&&(this.background=o)}},q3=class Uh{constructor(t,r=[],a={}){this._mainRule=t,this._children=a,this._rulesWithParentScopes=r}_rulesWithParentScopes;static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let a=0,o=0;for(;t.parentScopes[a]===">"&&a++,r.parentScopes[o]===">"&&o++,!(a>=t.parentScopes.length||o>=r.parentScopes.length);){const l=r.parentScopes[o].length-t.parentScopes[a].length;if(l!==0)return l;a++,o++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let a=t.indexOf("."),o,l;if(a===-1?(o=t,l=""):(o=t.substring(0,a),l=t.substring(a+1)),this._children.hasOwnProperty(o))return this._children[o].match(l)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Uh._cmpBySpecificity),r}insert(t,r,a,o,l,u){if(r===""){this._doInsertHere(t,a,o,l,u);return}let f=r.indexOf("."),h,p;f===-1?(h=r,p=""):(h=r.substring(0,f),p=r.substring(f+1));let m;this._children.hasOwnProperty(h)?m=this._children[h]:(m=new Uh(this._mainRule.clone(),Ih.cloneArr(this._rulesWithParentScopes)),this._children[h]=m),m.insert(t+1,p,a,o,l,u)}_doInsertHere(t,r,a,o,l){if(r===null){this._mainRule.acceptOverwrite(t,a,o,l);return}for(let u=0,f=this._rulesWithParentScopes.length;u<f;u++){let h=this._rulesWithParentScopes[u];if(w4(h.parentScopes,r)===0){h.acceptOverwrite(t,a,o,l);return}}a===-1&&(a=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new Ih(t,r,a,o,l))}},Ho=class vr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const r=vr.getLanguageId(t),a=vr.getTokenType(t),o=vr.getFontStyle(t),l=vr.getForeground(t),u=vr.getBackground(t);console.log({languageId:r,tokenType:a,fontStyle:o,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,r,a,o,l,u,f){let h=vr.getLanguageId(t),p=vr.getTokenType(t),m=vr.containsBalancedBrackets(t)?1:0,x=vr.getFontStyle(t),v=vr.getForeground(t),_=vr.getBackground(t);return r!==0&&(h=r),a!==8&&(p=a),o!==null&&(m=o?1:0),l!==-1&&(x=l),u!==0&&(v=u),f!==0&&(_=f),(h<<0|p<<8|m<<10|x<<11|v<<15|_<<24)>>>0}};function Uu(e,t){const r=[],a=F3(e);let o=a.next();for(;o!==null;){let h=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":h=1;break;case"L":h=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=a.next()}let p=u();if(r.push({matcher:p,priority:h}),o!==",")break;o=a.next()}return r;function l(){if(o==="-"){o=a.next();const h=l();return p=>!!h&&!h(p)}if(o==="("){o=a.next();const h=f();return o===")"&&(o=a.next()),h}if(wv(o)){const h=[];do h.push(o),o=a.next();while(wv(o));return p=>t(h,p)}return null}function u(){const h=[];let p=l();for(;p;)h.push(p),p=l();return m=>h.every(x=>x(m))}function f(){const h=[];let p=u();for(;p&&(h.push(p),o==="|"||o===",");){do o=a.next();while(o==="|"||o===",");p=u()}return m=>h.some(x=>x(m))}}function wv(e){return!!e&&!!e.match(/[\w\.:]+/)}function F3(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;const a=r[0];return r=t.exec(e),a}}}function E4(e){typeof e.dispose=="function"&&e.dispose()}var bl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},G3=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},V3=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))}},Y3=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new bl(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new V3;for(const r of e)K3(r,this.initialScopeName,this.repo,t);for(const r of t.references)if(r instanceof bl){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function K3(e,t,r,a){const o=r.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=r.lookup(t);e instanceof bl?Eu({baseGrammar:l,selfGrammar:o},a):Ph(e.ruleName,{baseGrammar:l,selfGrammar:o,repository:o.repository},a);const u=r.injections(e.scopeName);if(u)for(const f of u)a.add(new bl(f))}function Ph(e,t,r){if(t.repository&&t.repository[e]){const a=t.repository[e];Pu([a],t,r)}}function Eu(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Pu(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Pu(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Pu(e,t,r){for(const a of e){if(r.visitedRule.has(a))continue;r.visitedRule.add(a);const o=a.repository?b4({},t.repository,a.repository):t.repository;Array.isArray(a.patterns)&&Pu(a.patterns,{...t,repository:o},r);const l=a.include;if(!l)continue;const u=C4(l);switch(u.kind){case 0:Eu({...t,selfGrammar:t.baseGrammar},r);break;case 1:Eu(t,r);break;case 2:Ph(u.ruleName,{...t,repository:o},r);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 h={baseGrammar:t.baseGrammar,selfGrammar:f,repository:o};u.kind===4?Ph(u.ruleName,h,r):Eu(h,r)}else u.kind===4?r.add(new G3(u.scopeName,u.ruleName)):r.add(new bl(u.scopeName));break}}}var X3=class{kind=0},Q3=class{kind=1},Z3=class{constructor(e){this.ruleName=e}kind=2},J3=class{constructor(e){this.scopeName=e}kind=3},W3=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function C4(e){if(e==="$base")return new X3;if(e==="$self")return new Q3;const t=e.indexOf("#");if(t===-1)return new J3(e);if(t===0)return new Z3(e.substring(1));{const r=e.substring(0,t),a=e.substring(t+1);return new W3(r,a)}}var e5=/\\(\d+)/,Sv=/\\(\d+)/g,t5=-1,R4=-2;var Ul=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,r,a){this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=cu.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=cu.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${v4(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:cu.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:cu.replaceCaptures(this._contentName,e,t)}},n5=class extends Ul{retokenizeCapturedWithRuleId;constructor(e,t,r,a,o){super(e,t,r,a),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,a){throw new Error("Not supported!")}},r5=class extends Ul{_match;captures;_cachedCompiledPatterns;constructor(e,t,r,a,o){super(e,t,r,null),this._match=new vl(a,this.id),this.captures=o,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,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new _l,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},jv=class extends Ul{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,a,o){super(e,t,r,a),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new _l,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Hh=class extends Ul{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,a,o,l,u,f,h,p){super(e,t,r,a),this._begin=new vl(o,this.id),this.beginCaptures=l,this._end=new vl(u||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=f,this.applyEndPatternLast=h||!1,this.patterns=p.patterns,this.hasMissingPatterns=p.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,r,a){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,a)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new _l;for(const r of this.patterns)e.getRule(r).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}},Hu=class extends Ul{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,r,a,o,l,u,f,h){super(e,t,r,a),this._begin=new vl(o,this.id),this.beginCaptures=l,this.whileCaptures=f,this._while=new vl(u,R4),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.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,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new _l;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,r,a){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,a)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new _l,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},T4=class jn{static createCaptureRule(t,r,a,o,l){return t.registerRule(u=>new n5(r,u,a,o,l))}static getCompiledRuleId(t,r,a){return t.id||r.registerRule(o=>{if(t.id=o,t.match)return new r5(t.$vscodeTextmateLocation,t.id,t.name,t.match,jn._compileCaptures(t.captures,r,a));if(typeof t.begin>"u"){t.repository&&(a=b4({},a,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new jv(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,jn._compilePatterns(l,r,a))}return t.while?new Hu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,jn._compileCaptures(t.beginCaptures||t.captures,r,a),t.while,jn._compileCaptures(t.whileCaptures||t.captures,r,a),jn._compilePatterns(t.patterns,r,a)):new Hh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,jn._compileCaptures(t.beginCaptures||t.captures,r,a),t.end,jn._compileCaptures(t.endCaptures||t.captures,r,a),t.applyEndPatternLast,jn._compilePatterns(t.patterns,r,a))}),t.id}static _compileCaptures(t,r,a){let o=[];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++)o[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const f=parseInt(u,10);let h=0;t[u].patterns&&(h=jn.getCompiledRuleId(t[u],r,a)),o[f]=jn.createCaptureRule(r,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,h)}}return o}static _compilePatterns(t,r,a){let o=[];if(t)for(let l=0,u=t.length;l<u;l++){const f=t[l];let h=-1;if(f.include){const p=C4(f.include);switch(p.kind){case 0:case 1:h=jn.getCompiledRuleId(a[f.include],r,a);break;case 2:let m=a[p.ruleName];m&&(h=jn.getCompiledRuleId(m,r,a));break;case 3:case 4:const x=p.scopeName,v=p.kind===4?p.ruleName:null,_=r.getExternalGrammar(x,a);if(_)if(v){let w=_.repository[v];w&&(h=jn.getCompiledRuleId(w,r,_.repository))}else h=jn.getCompiledRuleId(_.repository.$self,r,_.repository);break}}else h=jn.getCompiledRuleId(f,r,a);if(h!==-1){const p=r.getRule(h);let m=!1;if((p instanceof jv||p instanceof Hh||p instanceof Hu)&&p.hasMissingPatterns&&p.patterns.length===0&&(m=!0),m)continue;o.push(h)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},vl=class A4{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,r){if(t&&typeof t=="string"){const a=t.length;let o=0,l=[],u=!1;for(let f=0;f<a;f++)if(t.charAt(f)==="\\"&&f+1<a){const p=t.charAt(f+1);p==="z"?(l.push(t.substring(o,f)),l.push("$(?!\\n)(?<!\\n)"),o=f+2):(p==="A"||p==="G")&&(u=!0),f++}this.hasAnchor=u,o===0?this.source=t:(l.push(t.substring(o,a)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=e5.test(this.source):this.hasBackReferences=!1}clone(){return new A4(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=r.map(o=>t.substring(o.start,o.end));return Sv.lastIndex=0,this.source.replace(Sv,(o,l)=>S4(a[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=[],r=[],a=[],o=[],l,u,f,h;for(l=0,u=this.source.length;l<u;l++)f=this.source.charAt(l),t[l]=f,r[l]=f,a[l]=f,o[l]=f,f==="\\"&&l+1<u&&(h=this.source.charAt(l+1),h==="A"?(t[l+1]="",r[l+1]="",a[l+1]="A",o[l+1]="A"):h==="G"?(t[l+1]="",r[l+1]="G",a[l+1]="",o[l+1]="G"):(t[l+1]=h,r[l+1]=h,a[l+1]=h,o[l+1]=h),l++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:a.join(""),A1_G1:o.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},_l=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(r=>r.source);this._cached=new kv(e,t,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){let a=this._items.map(o=>o.resolveAnchors(t,r));return new kv(e,a,this._items.map(o=>o.ruleId))}},kv=class{constructor(e,t,r){this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
35
|
+
`)}findNextMatchSync(e,t,r){const a=this.scanner.findNextMatchSync(e,t,r);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},nh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},a5=class qh{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,r){this._defaultAttributes=new nh(t,8),this._embeddedLanguagesMatcher=new s5(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?qh._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new nh(0,0);_getBasicScopeAttributes=new j4(t=>{const r=this._scopeToLanguage(t),a=this._toStandardTokenType(t);return new nh(r,a)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const r=t.match(qh.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[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/},s5=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(([r,a])=>S4(r));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])}},Nv=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function L4(e,t,r,a,o,l,u,f){const h=t.content.length;let p=!1,m=-1;if(u){const _=o5(e,t,r,a,o,l);o=_.stack,a=_.linePos,r=_.isFirstLine,m=_.anchorPosition}const x=Date.now();for(;!p;){if(f!==0&&Date.now()-x>f)return new Nv(o,!0);v()}return new Nv(o,!1);function v(){const _=i5(e,t,r,a,o,m);if(!_){l.produce(o,h),p=!0;return}const w=_.captureIndices,S=_.matchedRuleId,k=w&&w.length>0?w[0].end>a:!1;if(S===t5){const N=o.getRule(e);l.produce(o,w[0].start),o=o.withContentNameScopesList(o.nameScopesList),al(e,t,r,o,l,N.endCaptures,w),l.produce(o,w[0].end);const R=o;if(o=o.parent,m=R.getAnchorPos(),!k&&R.getEnterPos()===a){o=R,l.produce(o,h),p=!0;return}}else{const N=e.getRule(S);l.produce(o,w[0].start);const R=o,E=N.getName(t.content,w),D=o.contentNameScopesList.pushAttributed(E,e);if(o=o.push(S,a,m,w[0].end===h,null,D,D),N instanceof Hh){const L=N;al(e,t,r,o,l,L.beginCaptures,w),l.produce(o,w[0].end),m=w[0].end;const $=L.getContentName(t.content,w),z=D.pushAttributed($,e);if(o=o.withContentNameScopesList(z),L.endHasBackReferences&&(o=o.withEndRule(L.getEndWithResolvedBackReferences(t.content,w))),!k&&R.hasSameRuleAs(o)){o=o.pop(),l.produce(o,h),p=!0;return}}else if(N instanceof Hu){const L=N;al(e,t,r,o,l,L.beginCaptures,w),l.produce(o,w[0].end),m=w[0].end;const $=L.getContentName(t.content,w),z=D.pushAttributed($,e);if(o=o.withContentNameScopesList(z),L.whileHasBackReferences&&(o=o.withEndRule(L.getWhileWithResolvedBackReferences(t.content,w))),!k&&R.hasSameRuleAs(o)){o=o.pop(),l.produce(o,h),p=!0;return}}else if(al(e,t,r,o,l,N.captures,w),l.produce(o,w[0].end),o=o.pop(),!k){o=o.safePop(),l.produce(o,h),p=!0;return}}w[0].end>a&&(a=w[0].end,r=!1)}}function o5(e,t,r,a,o,l){let u=o.beginRuleCapturedEOL?0:-1;const f=[];for(let h=o;h;h=h.pop()){const p=h.getRule(e);p instanceof Hu&&f.push({rule:p,stack:h})}for(let h=f.pop();h;h=f.pop()){const{ruleScanner:p,findOptions:m}=u5(h.rule,e,h.stack.endRule,r,a===u),x=p.findNextMatchSync(t,a,m);if(x){if(x.ruleId!==R4){o=h.stack.pop();break}x.captureIndices&&x.captureIndices.length&&(l.produce(h.stack,x.captureIndices[0].start),al(e,t,r,h.stack,l,h.rule.whileCaptures,x.captureIndices),l.produce(h.stack,x.captureIndices[0].end),u=x.captureIndices[0].end,x.captureIndices[0].end>a&&(a=x.captureIndices[0].end,r=!1))}else{o=h.stack.pop();break}}return{stack:o,linePos:a,anchorPosition:u,isFirstLine:r}}function i5(e,t,r,a,o,l){const u=l5(e,t,r,a,o,l),f=e.getInjections();if(f.length===0)return u;const h=c5(f,e,t,r,a,o,l);if(!h)return u;if(!u)return h;const p=u.captureIndices[0].start,m=h.captureIndices[0].start;return m<p||h.priorityMatch&&m===p?h:u}function l5(e,t,r,a,o,l){const u=o.getRule(e),{ruleScanner:f,findOptions:h}=D4(u,e,o.endRule,r,a===l),p=f.findNextMatchSync(t,a,h);return p?{captureIndices:p.captureIndices,matchedRuleId:p.ruleId}:null}function c5(e,t,r,a,o,l,u){let f=Number.MAX_VALUE,h=null,p,m=0;const x=l.contentNameScopesList.getScopeNames();for(let v=0,_=e.length;v<_;v++){const w=e[v];if(!w.matcher(x))continue;const S=t.getRule(w.ruleId),{ruleScanner:k,findOptions:N}=D4(S,t,null,a,o===u),R=k.findNextMatchSync(r,o,N);if(!R)continue;const E=R.captureIndices[0].start;if(!(E>=f)&&(f=E,h=R.captureIndices,p=R.ruleId,m=w.priority,f===o))break}return h?{priorityMatch:m===-1,captureIndices:h,matchedRuleId:p}:null}function D4(e,t,r,a,o){return{ruleScanner:e.compileAG(t,r,a,o),findOptions:0}}function u5(e,t,r,a,o){return{ruleScanner:e.compileWhileAG(t,r,a,o),findOptions:0}}function al(e,t,r,a,o,l,u){if(l.length===0)return;const f=t.content,h=Math.min(l.length,u.length),p=[],m=u[0].end;for(let x=0;x<h;x++){const v=l[x];if(v===null)continue;const _=u[x];if(_.length===0)continue;if(_.start>m)break;for(;p.length>0&&p[p.length-1].endPos<=_.start;)o.produceFromScopes(p[p.length-1].scopes,p[p.length-1].endPos),p.pop();if(p.length>0?o.produceFromScopes(p[p.length-1].scopes,_.start):o.produce(a,_.start),v.retokenizeCapturedWithRuleId){const S=v.getName(f,u),k=a.contentNameScopesList.pushAttributed(S,e),N=v.getContentName(f,u),R=k.pushAttributed(N,e),E=a.push(v.retokenizeCapturedWithRuleId,_.start,-1,!1,null,k,R),D=e.createOnigString(f.substring(0,_.end));L4(e,D,r&&_.start===0,_.start,E,o,!1,0),E4(D);continue}const w=v.getName(f,u);if(w!==null){const k=(p.length>0?p[p.length-1].scopes:a.contentNameScopesList).pushAttributed(w,e);p.push(new d5(k,_.end))}}for(;p.length>0;)o.produceFromScopes(p[p.length-1].scopes,p[p.length-1].endPos),p.pop()}var d5=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function f5(e,t,r,a,o,l,u,f){return new h5(e,t,r,a,o,l,u,f)}function Ev(e,t,r,a,o){const l=Uu(t,qu),u=T4.getCompiledRuleId(r,a,o.repository);for(const f of l)e.push({debugSelector:t,matcher:f.matcher,ruleId:u,grammar:o,priority:f.priority})}function qu(e,t){if(t.length<e.length)return!1;let r=0;return e.every(a=>{for(let o=r;o<t.length;o++)if(p5(t[o],a))return r=o+1,!0;return!1})}function p5(e,t){if(!e)return!1;if(e===t)return!0;const r=t.length;return e.length>r&&e.substr(0,r)===t&&e[r]==="."}var h5=class{constructor(e,t,r,a,o,l,u,f){if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=f,this._basicScopeAttributesProvider=new a5(r,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=u,this._grammar=Cv(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const h of Object.keys(o)){const p=Uu(h,qu);for(const m of p)this._tokenTypeMatchers.push({matcher:m.matcher,type:o[h]})}}_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:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],r=this._rootScopeName,a=e.lookup(r);if(a){const o=a.injections;if(o)for(let u in o)Ev(t,u,o[u],this,a);const l=this._grammarRepository.injections(r);l&&l.forEach(u=>{const f=this.getExternalGrammar(u);if(f){const h=f.injectionSelector;h&&Ev(t,h,f,this,f)}})}return t.sort((o,l)=>o.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=Cv(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){const a=this._tokenize(e,t,!1,r);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(e,t,r=0){const a=this._tokenize(e,t,!0,r);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(e,t,r,a){this._rootId===-1&&(this._rootId=T4.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Fh.NULL){o=!0;const p=this._basicScopeAttributesProvider.getDefaultAttributes(),m=this.themeProvider.getDefaults(),x=Ho.set(0,p.languageId,p.tokenType,null,m.fontStyle,m.foregroundId,m.backgroundId),v=this.getRule(this._rootId).getName(null,null);let _;v?_=ul.createRootAndLookUpScopeName(v,x,this):_=ul.createRoot("unknown",x),t=new Fh(null,this._rootId,-1,-1,!1,null,_,_)}else o=!1,t.reset();e=e+`
|
|
36
|
+
`;const l=this.createOnigString(e),u=l.content.length,f=new g5(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),h=L4(this,l,o,0,t,f,!0,a);return E4(l),{lineLength:u,lineTokens:f,ruleStack:h.stack,stoppedEarly:h.stoppedEarly}}};function Cv(e,t){return e=D3(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 ul=class Fr{constructor(t,r,a){this.parent=t,this.scopePath=r,this.tokenAttributes=a}static fromExtension(t,r){let a=t,o=t?.scopePath??null;for(const l of r)o=th.push(o,l.scopeNames),a=new Fr(a,o,l.encodedTokenAttributes);return a}static createRoot(t,r){return new Fr(null,new th(null,t),r)}static createRootAndLookUpScopeName(t,r,a){const o=a.getMetadataForScope(t),l=new th(null,t),u=a.themeProvider.themeMatch(l),f=Fr.mergeAttributes(r,o,u);return new Fr(null,l,f)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Fr.equals(this,t)}static equals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}while(!0)}static mergeAttributes(t,r,a){let o=-1,l=0,u=0;return a!==null&&(o=a.fontStyle,l=a.foregroundId,u=a.backgroundId),Ho.set(t,r.languageId,r.tokenType,null,o,l,u)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return Fr._pushAttributed(this,t,r);const a=t.split(/ /g);let o=this;for(const l of a)o=Fr._pushAttributed(o,l,r);return o}static _pushAttributed(t,r,a){const o=a.getMetadataForScope(r),l=t.scopePath.push(r),u=a.themeProvider.themeMatch(l),f=Fr.mergeAttributes(t.tokenAttributes,o,u);return new Fr(t,l,f)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const r=[];let a=this;for(;a&&a!==t;)r.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===t?r.reverse():void 0}},Fh=class Ls{constructor(t,r,a,o,l,u,f,h){this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=l,this.endRule=u,this.nameScopesList=f,this.contentNameScopesList=h,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Ls(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Ls._equals(this,t)}static _equals(t,r){return t===r?!0:this._structuralEquals(t,r)?ul.equals(t.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ls._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,a,o,l,u,f){return new Ls(this,t,r,a,o,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,r){return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}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 Ls(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.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,r){const a=ul.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new Ls(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,a,ul.fromExtension(a,r.contentNameScopesList))}},m5=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):Uu(r,qu).map(a=>a.matcher)),this.unbalancedBracketScopes=t.flatMap(r=>Uu(r,qu).map(a=>a.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}},g5=class{constructor(e,t,r,a){this.balancedBracketSelectors=a,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,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 a=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!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)&&(a=Ho.set(a,0,u.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(l))}if(o&&(a=Ho.set(a,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),this._lastTokenEndIndex=t;return}const r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),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 r=new Uint32Array(this._binaryTokens.length);for(let a=0,o=this._binaryTokens.length;a<o;a++)r[a]=this._binaryTokens[a];return r}},x5=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,r,a,o){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,f5(e,l,t,r,a,o,this,this._onigLib))}return this._grammars.get(e)}},y5=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new x5(Iu.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,r){this._syncRegistry.setTheme(Iu.createFromRawTheme(t,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,r,a){return this.loadGrammarWithConfiguration(t,r,{embeddedLanguages:a})}loadGrammarWithConfiguration(t,r,a){return this._loadGrammar(t,r,a.embeddedLanguages,a.tokenTypes,new m5(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,r,a,o,l){const u=new Y3(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(f=>this._loadSingleGrammar(f.scopeName)),u.processQueue();return this._grammarForScopeName(t,r,a,o,l)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const r=this._options.loadGrammar(t);if(r){const a=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(r,a)}}addGrammar(t,r=[],a=0,o=null){return this._syncRegistry.addGrammar(t,r),this._grammarForScopeName(t.scopeName,a,o)}_grammarForScopeName(t,r=0,a=null,o=null,l=null){return this._syncRegistry.grammarForScopeName(t,r,a,o,l)}},Gh=Fh.NULL;function Fu(e,t){const r=typeof e=="string"?{}:{...e.colorReplacements},a=typeof e=="string"?e:e.name;for(const[o,l]of Object.entries(t?.colorReplacements||{}))typeof l=="string"?r[o]=l:o===a&&Object.assign(r,l);return r}function us(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function b5(e){return Array.isArray(e)?e:[e]}async function O4(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function ld(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Cm(e){return e==="ansi"||ld(e)}function cd(e){return e==="none"}function M4(e){return cd(e)}function ud(e,t=!1){if(e.length===0)return[["",0]];const r=e.split(/(\r?\n)/g);let a=0;const o=[];for(let l=0;l<r.length;l+=2){const u=t?r[l]+(r[l+1]||""):r[l];o.push([u,a]),a+=r[l].length,a+=r[l+1]?.length||0}return o}const Rv={light:"#333333",dark:"#bbbbbb"},Tv={light:"#fffffe",dark:"#1e1e1e"},Av="__shiki_resolved";function Rm(e){if(e?.[Av])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:r,fg:a}=t;if(!r||!a){const f=t.settings?t.settings.find(h=>!h.name&&!h.scope):void 0;f?.settings?.foreground&&(a=f.settings.foreground),f?.settings?.background&&(r=f.settings.background),!a&&t?.colors?.["editor.foreground"]&&(a=t.colors["editor.foreground"]),!r&&t?.colors?.["editor.background"]&&(r=t.colors["editor.background"]),a||(a=t.type==="light"?Rv.light:Rv.dark),r||(r=t.type==="light"?Tv.light:Tv.dark),t.fg=a,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const l=new Map;function u(f){if(l.has(f))return l.get(f);o+=1;const h=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${h}`]?u(f):(l.set(f,h),h)}t.settings=t.settings.map(f=>{const h=f.settings?.foreground&&!f.settings.foreground.startsWith("#"),p=f.settings?.background&&!f.settings.background.startsWith("#");if(!h&&!p)return f;const m={...f,settings:{...f.settings}};if(h){const x=u(f.settings.foreground);t.colorReplacements[x]=f.settings.foreground,m.settings.foreground=x}if(p){const x=u(f.settings.background);t.colorReplacements[x]=f.settings.background,m.settings.background=x}return m});for(const f of Object.keys(t.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!t.colors[f]?.startsWith("#")){const h=u(t.colors[f]);t.colorReplacements[h]=t.colors[f],t.colors[f]=h}return Object.defineProperty(t,Av,{enumerable:!1,writable:!1,value:!0}),t}async function z4(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Cm(t)).map(async t=>await O4(t).then(r=>Array.isArray(r)?r:[r])))).flat()))}async function $4(e){return(await Promise.all(e.map(async t=>M4(t)?null:Rm(await O4(t))))).filter(t=>!!t)}function B4(e,t){if(!t)return e;if(t[e]){const r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new Tt(`Circular alias \`${Array.from(r).join(" -> ")} -> ${e}\``);r.add(e)}}return e}var v5=class extends y5{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,r,a={}){super(e),this._resolver=e,this._themes=t,this._langs=r,this._alias=a,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Rm(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=Iu.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=B4(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const a=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(a.name=e.name,this._resolvedGrammars.set(e.name,a),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,t.size)for(const o of t)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const a of e)this.resolveEmbeddedLanguages(a);const t=Array.from(this._langGraph.entries()),r=t.filter(([a,o])=>!o);if(r.length){const a=t.filter(([o,l])=>l?(l.embeddedLanguages||l.embeddedLangs)?.some(u=>r.map(([f])=>f).includes(u)):!1).filter(o=>!r.includes(o));throw new Tt(`Missing languages ${r.map(([o])=>`\`${o}\``).join(", ")}, required by ${a.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[a,o]of t)this._resolver.addLanguage(o);for(const[a,o]of t)this.loadLanguage(o)}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 r of t)this._langGraph.set(r,this._langMap.get(r))}},_5=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},t.forEach(r=>this.addLanguage(r))}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 r=[];for(let a=1;a<=t.length;a++){const o=t.slice(0,a).join(".");r=[...r,...this._injections.get(o)||[]]}return r}};let Yi=0;function w5(e){Yi+=1,e.warnings!==!1&&Yi>=10&&Yi%10===0&&console.warn(`[Shiki] ${Yi} 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 Tt("`engine` option is required for synchronous mode");const r=(e.langs||[]).flat(1),a=(e.themes||[]).flat(1).map(Rm),o=new v5(new _5(e.engine,r),a,r,e.langAlias);let l;function u(R){return B4(R,e.langAlias)}function f(R){k();const E=o.getGrammar(typeof R=="string"?R:R.name);if(!E)throw new Tt(`Language \`${R}\` not found, you may need to load it first`);return E}function h(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};k();const E=o.getTheme(R);if(!E)throw new Tt(`Theme \`${R}\` not found, you may need to load it first`);return E}function p(R){k();const E=h(R);return l!==R&&(o.setTheme(E),l=R),{theme:E,colorMap:o.getColorMap()}}function m(){return k(),o.getLoadedThemes()}function x(){return k(),o.getLoadedLanguages()}function v(...R){k(),o.loadLanguages(R.flat(1))}async function _(...R){return v(await z4(R))}function w(...R){k();for(const E of R.flat(1))o.loadTheme(E)}async function S(...R){return k(),w(await $4(R))}function k(){if(t)throw new Tt("Shiki instance has been disposed")}function N(){t||(t=!0,o.dispose(),Yi-=1)}return{setTheme:p,getTheme:h,getLanguage:f,getLoadedThemes:m,getLoadedLanguages:x,resolveLangAlias:u,loadLanguage:_,loadLanguageSync:v,loadTheme:S,loadThemeSync:w,dispose:N,[Symbol.dispose]:N}}async function S5(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,r,a]=await Promise.all([$4(e.themes||[]),z4(e.langs||[]),e.engine]);return w5({...e,themes:t,langs:r,engine:a})}const I4=new WeakMap;function dd(e,t){I4.set(e,t)}function wl(e){return I4.get(e)}var fd=class U4{_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,r){return new U4(Object.fromEntries(b5(r).map(a=>[a,Gh])),t)}constructor(...t){if(t.length===2){const[r,a]=t;this.lang=a,this._stacks=r}else{const[r,a,o]=t;this.lang=a,this._stacks={[o]:r}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return j5(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function j5(e){const t=[],r=new Set;function a(o){if(r.has(o))return;r.add(o);const l=o?.nameScopesList?.scopeName;l&&t.push(l),o.parent&&a(o.parent)}return a(e),t}function k5(e,t){if(!(e instanceof fd))throw new Tt("Invalid grammar state");return e.getInternalStack(t)}function P4(e,t,r={}){const{theme:a=e.getLoadedThemes()[0]}=r;if(ld(e.resolveLangAlias(r.lang||"text"))||cd(a))return ud(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:o,colorMap:l}=e.setTheme(a),u=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==u.name)throw new Tt(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${u.name}"`);if(!r.grammarState.themes.includes(o.name))throw new Tt(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return E5(t,u,o,l,r)}function N5(...e){if(e.length===2)return wl(e[1]);const[t,r,a={}]=e,{lang:o="text",theme:l=t.getLoadedThemes()[0]}=a;if(ld(o)||cd(l))throw new Tt("Plain language does not have grammar state");if(o==="ansi")throw new Tt("ANSI language does not have grammar state");const{theme:u,colorMap:f}=t.setTheme(l),h=t.getLanguage(o);return new fd(Tm(r,h,u,f,a).stateStack,h.name,u.name)}function E5(e,t,r,a,o){const l=Tm(e,t,r,a,o),u=new fd(l.stateStack,t.name,r.name);return dd(l.tokens,u),l.tokens}function Tm(e,t,r,a,o){const l=Fu(r,o),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:f=500}=o,h=ud(e);let p=o.grammarState?k5(o.grammarState,r.name)??Gh:o.grammarContextCode!=null?Tm(o.grammarContextCode,t,r,a,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:Gh,m=[];const x=[];for(let v=0,_=h.length;v<_;v++){const[w,S]=h[v];if(w===""){m=[],x.push([]);continue}if(u>0&&w.length>=u){m=[],x.push([{content:w,offset:S,color:"",fontStyle:0}]);continue}let k,N,R;o.includeExplanation&&(k=t.tokenizeLine(w,p,f),N=k.tokens,R=0);const E=t.tokenizeLine2(w,p,f),D=E.tokens.length/2;for(let L=0;L<D;L++){const $=E.tokens[2*L],z=L+1<D?E.tokens[2*L+2]:w.length;if($===z)continue;const T=E.tokens[2*L+1],B=us(a[Ho.getForeground(T)],l),H=Ho.getFontStyle(T),J={content:w.substring($,z),offset:S+$,color:B,fontStyle:H};if(o.includeExplanation){const oe=[];if(o.includeExplanation!=="scopeName")for(const M of r.settings){let P;switch(typeof M.scope){case"string":P=M.scope.split(/,/).map(A=>A.trim());break;case"object":P=M.scope;break;default:continue}oe.push({settings:M,selectors:P.map(A=>A.split(/ /))})}J.explanation=[];let ce=0;for(;$+ce<z;){const M=N[R],P=w.substring(M.startIndex,M.endIndex);ce+=P.length,J.explanation.push({content:P,scopes:o.includeExplanation==="scopeName"?C5(M.scopes):R5(oe,M.scopes)}),R+=1}}m.push(J)}x.push(m),m=[],p=E.ruleStack}return{tokens:x,stateStack:p}}function C5(e){return e.map(t=>({scopeName:t}))}function R5(e,t){const r=[];for(let a=0,o=t.length;a<o;a++){const l=t[a];r[a]={scopeName:l,themeMatches:A5(e,l,t.slice(0,a))}}return r}function Lv(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function T5(e,t,r){if(!Lv(e[e.length-1],t))return!1;let a=e.length-2,o=r.length-1;for(;a>=0&&o>=0;)Lv(e[a],r[o])&&(a-=1),o-=1;return a===-1}function A5(e,t,r){const a=[];for(const{selectors:o,settings:l}of e)for(const u of o)if(T5(u,t,r)){a.push(l);break}return a}function H4(e,t,r,a=P4){const o=Object.entries(r.themes).filter(p=>p[1]).map(p=>({color:p[0],theme:p[1]})),l=o.map(p=>{const m=a(e,t,{...r,theme:p.theme});return{tokens:m,state:wl(m),theme:typeof p.theme=="string"?p.theme:p.theme.name}}),u=L5(...l.map(p=>p.tokens)),f=u[0].map((p,m)=>p.map((x,v)=>{const _={content:x.content,variants:{},offset:x.offset};return"includeExplanation"in r&&r.includeExplanation&&(_.explanation=x.explanation),u.forEach((w,S)=>{const{content:k,explanation:N,offset:R,...E}=w[m][v];_.variants[o[S].color]=E}),_})),h=l[0].state?new fd(Object.fromEntries(l.map(p=>[p.theme,p.state?.getInternalStack(p.theme)])),l[0].state.lang):void 0;return h&&dd(f,h),f}function L5(...e){const t=e.map(()=>[]),r=e.length;for(let a=0;a<e[0].length;a++){const o=e.map(h=>h[a]),l=t.map(()=>[]);t.forEach((h,p)=>h.push(l[p]));const u=o.map(()=>0),f=o.map(h=>h[0]);for(;f.every(h=>h);){const h=Math.min(...f.map(p=>p.content.length));for(let p=0;p<r;p++){const m=f[p];m.content.length===h?(l[p].push(m),u[p]+=1,f[p]=o[p][u[p]]):(l[p].push({...m,content:m.content.slice(0,h)}),f[p]={...m,content:m.content.slice(h),offset:m.offset+h})}}}return t}const D5=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Dv={}.hasOwnProperty;function O5(e,t){const r=t||{};function a(o,...l){let u=a.invalid;const f=a.handlers;if(o&&Dv.call(o,e)){const h=String(o[e]);u=Dv.call(f,h)?f[h]:a.unknown}if(u)return u.call(this,o,...l)}return a.handlers=r.handlers||{},a.invalid=r.invalid,a.unknown=r.unknown,a}const M5=/["&'<>`]/g,z5=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$5=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,B5=/[|\\{}()[\]^$+*?.]/g,Ov=new WeakMap;function I5(e,t){if(e=e.replace(t.subset?U5(t.subset):M5,a),t.subset||t.escapeOnly)return e;return e.replace(z5,r).replace($5,a);function r(o,l,u){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,u.charCodeAt(l+2),t)}function a(o,l,u){return t.format(o.charCodeAt(0),u.charCodeAt(l+1),t)}}function U5(e){let t=Ov.get(e);return t||(t=P5(e),Ov.set(e,t)),t}function P5(e){const t=[];let r=-1;for(;++r<e.length;)t.push(e[r].replace(B5,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const H5=/[\dA-Fa-f]/;function q5(e,t,r){const a="&#x"+e.toString(16).toUpperCase();return r&&t&&!H5.test(String.fromCharCode(t))?a:a+";"}const F5=/\d/;function G5(e,t,r){const a="&#"+String(e);return r&&t&&!F5.test(String.fromCharCode(t))?a:a+";"}const V5=["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"],rh={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:"€"},Y5=["cent","copy","divide","gt","lt","not","para","times"],q4={}.hasOwnProperty,Vh={};let uu;for(uu in rh)q4.call(rh,uu)&&(Vh[rh[uu]]=uu);const K5=/[^\dA-Za-z]/;function X5(e,t,r,a){const o=String.fromCharCode(e);if(q4.call(Vh,o)){const l=Vh[o],u="&"+l;return r&&V5.includes(l)&&!Y5.includes(l)&&(!a||t&&t!==61&&K5.test(String.fromCharCode(t)))?u:u+";"}return""}function Q5(e,t,r){let a=q5(e,t,r.omitOptionalSemicolons),o;if((r.useNamedReferences||r.useShortestReferences)&&(o=X5(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!o)&&r.useShortestReferences){const l=G5(e,t,r.omitOptionalSemicolons);l.length<a.length&&(a=l)}return o&&(!r.useShortestReferences||o.length<a.length)?o:a}function Bo(e,t){return I5(e,Object.assign({format:Q5},t))}const Z5=/^>|^->|<!--|-->|--!>|<!-$/g,J5=[">"],W5=["<",">"];function eL(e,t,r,a){return a.settings.bogusComments?"<?"+Bo(e.value,Object.assign({},a.settings.characterReferences,{subset:J5}))+">":"<!--"+e.value.replace(Z5,o)+"-->";function o(l){return Bo(l,Object.assign({},a.settings.characterReferences,{subset:W5}))}}function tL(e,t,r,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function Mv(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,o=r.indexOf(t);for(;o!==-1;)a++,o=r.indexOf(t,o+t.length);return a}const cn=G4(1),F4=G4(-1),nL=[];function G4(e){return t;function t(r,a,o){const l=r?r.children:nL;let u=(a||0)+e,f=l[u];if(!o)for(;f&&id(f);)u+=e,f=l[u];return f}}const rL={}.hasOwnProperty;function V4(e){return t;function t(r,a,o){return rL.call(e,r.tagName)&&e[r.tagName](r,a,o)}}const Am=V4({body:sL,caption:ah,colgroup:ah,dd:cL,dt:lL,head:ah,html:aL,li:iL,optgroup:uL,option:dL,p:oL,rp:zv,rt:zv,tbody:pL,td:$v,tfoot:hL,th:$v,thead:fL,tr:mL});function ah(e,t,r){const a=cn(r,t,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&id(a.value.charAt(0)))}function aL(e,t,r){const a=cn(r,t);return!a||a.type!=="comment"}function sL(e,t,r){const a=cn(r,t);return!a||a.type!=="comment"}function oL(e,t,r){const a=cn(r,t);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function iL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&a.tagName==="li"}function lL(e,t,r){const a=cn(r,t);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function cL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function zv(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function uL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&a.tagName==="optgroup"}function dL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function fL(e,t,r){const a=cn(r,t);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function pL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function hL(e,t,r){return!cn(r,t)}function mL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&a.tagName==="tr"}function $v(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const gL=V4({body:bL,colgroup:vL,head:yL,html:xL,tbody:_L});function xL(e){const t=cn(e,-1);return!t||t.type!=="comment"}function yL(e){const t=new Set;for(const a of e.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(t.has(a.tagName))return!1;t.add(a.tagName)}const r=e.children[0];return!r||r.type==="element"}function bL(e){const t=cn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&id(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function vL(e,t,r){const a=F4(r,t),o=cn(e,-1,!0);return r&&a&&a.type==="element"&&a.tagName==="colgroup"&&Am(a,r.children.indexOf(a),r)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function _L(e,t,r){const a=F4(r,t),o=cn(e,-1);return r&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&Am(a,r.children.indexOf(a),r)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const du={name:[[`
|
|
37
|
+
\f\r &/=>`.split(""),`
|
|
38
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
39
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
40
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
41
|
+
\f\r &>`.split(""),`\0
|
|
42
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
43
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
44
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function wL(e,t,r,a){const o=a.schema,l=o.space==="svg"?!1:a.settings.omitOptionalTags;let u=o.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(e.tagName.toLowerCase());const f=[];let h;o.space==="html"&&e.tagName==="svg"&&(a.schema=Il);const p=SL(a,e.properties),m=a.all(o.space==="html"&&e.tagName==="template"?e.content:e);return a.schema=o,m&&(u=!1),(p||!l||!gL(e,t,r))&&(f.push("<",e.tagName,p?" "+p:""),u&&(o.space==="svg"||a.settings.closeSelfClosing)&&(h=p.charAt(p.length-1),(!a.settings.tightSelfClosing||h==="/"||h&&h!=='"'&&h!=="'")&&f.push(" "),f.push("/")),f.push(">")),f.push(m),!u&&(!l||!Am(e,t,r))&&f.push("</"+e.tagName+">"),f.join("")}function SL(e,t){const r=[];let a=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const l=jL(e,o,t[o]);l&&r.push(l)}}for(;++a<r.length;){const l=e.settings.tightAttributes?r[a].charAt(r[a].length-1):void 0;a!==r.length-1&&l!=='"'&&l!=="'"&&(r[a]+=" ")}return r.join("")}function jL(e,t,r){const a=f4(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let u=e.quote,f;if(a.overloadedBoolean&&(r===a.attribute||r==="")?r=!0:(a.boolean||a.overloadedBoolean)&&(typeof r!="string"||r===a.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const h=Bo(a.attribute,Object.assign({},e.settings.characterReferences,{subset:du.name[o][l]}));return r===!0||(r=Array.isArray(r)?(a.commaSeparated?a4:h4)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?h:(e.settings.preferUnquoted&&(f=Bo(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:du.unquoted[o][l]}))),f!==r&&(e.settings.quoteSmart&&Mv(r,u)>Mv(r,e.alternative)&&(u=e.alternative),f=u+Bo(r,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?du.single:du.double)[o][l],attribute:!0}))+u),h+(f&&"="+f))}const kL=["<","&"];function Y4(e,t,r,a){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:Bo(e.value,Object.assign({},a.settings.characterReferences,{subset:kL}))}function NL(e,t,r,a){return a.settings.allowDangerousHtml?e.value:Y4(e,t,r,a)}function EL(e,t,r,a){return a.all(e)}const CL=O5("type",{invalid:RL,unknown:TL,handlers:{comment:eL,doctype:tL,element:wL,raw:NL,root:EL,text:Y4}});function RL(e){throw new Error("Expected node, not `"+e+"`")}function TL(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const AL={},LL={},DL=[];function OL(e,t){const r=t||AL,a=r.quote||'"',o=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:ML,all:zL,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||D5,characterReferences:r.characterReferences||LL,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?Il:p4,quote:a,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ML(e,t,r){return CL(e,t,r,this)}function zL(e){const t=[],r=e&&e.children||DL;let a=-1;for(;++a<r.length;)t[a]=this.one(r[a],a,e);return t.join("")}function K4(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 r=Array.isArray(t)?t:t.split(/\s+/g);for(const a of r)a&&!e.properties.class.includes(a)&&e.properties.class.push(a);return e}function $L(e){const t=ud(e,!0).map(([o])=>o);function r(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let l=o,u=0;for(const f of t){if(l<f.length)break;l-=f.length,u++}return{line:u,character:l}}function a(o,l){let u=0;for(let f=0;f<o;f++)u+=t[f].length;return u+=l,u}return{lines:t,indexToPos:r,posToIndex:a}}function X4(e,t,r){const a=new Set;for(const l of e.matchAll(/:?lang=["']([^"']+)["']/g)){const u=l[1].toLowerCase().trim();u&&a.add(u)}for(const l of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const u=l[1].toLowerCase().trim();u&&a.add(u)}for(const l of e.matchAll(/\\begin\{([\w-]+)\}/g)){const u=l[1].toLowerCase().trim();u&&a.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&&a.add(f)}if(!r)return Array.from(a);const o=r.getBundledLanguages();return Array.from(a).filter(l=>l&&o[l])}const Lm="light-dark()",BL=["color","background-color"];function IL(e,t){let r=0;const a=[];for(const o of t)o>r&&a.push({...e,content:e.content.slice(r,o),offset:e.offset+r}),r=o;return r<e.content.length&&a.push({...e,content:e.content.slice(r),offset:e.offset+r}),a}function UL(e,t){const r=Array.from(t instanceof Set?t:new Set(t)).sort((a,o)=>a-o);return r.length?e.map(a=>a.flatMap(o=>{const l=r.filter(u=>o.offset<u&&u<o.offset+o.content.length).map(u=>u-o.offset).sort((u,f)=>u-f);return l.length?IL(o,l):o})):e}function PL(e,t,r,a,o="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(m=>Gu(e.variants[m])),f=new Set(u.flatMap(m=>Object.keys(m))),h={},p=(m,x)=>{const v=x==="color"?"":x==="background-color"?"-bg":`-${x}`;return r+t[m]+(x==="color"?"":v)};return u.forEach((m,x)=>{for(const v of f){const _=m[v]||"inherit";if(x===0&&a&&BL.includes(v))if(a===Lm&&u.length>1){const w=t.findIndex(k=>k==="light"),S=t.findIndex(k=>k==="dark");if(w===-1||S===-1)throw new Tt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');h[v]=`light-dark(${u[w][v]||"inherit"}, ${u[S][v]||"inherit"})`,o==="css-vars"&&(h[p(x,v)]=_)}else h[v]=_;else o==="css-vars"&&(h[p(x,v)]=_)}}),l.htmlStyle=h,l}function Gu(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Nn.Italic&&(t["font-style"]="italic"),e.fontStyle&Nn.Bold&&(t["font-weight"]="bold");const r=[];e.fontStyle&Nn.Underline&&r.push("underline"),e.fontStyle&Nn.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function Yh(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r}`).join(";")}function HL(){const e=new WeakMap;function t(r){if(!e.has(r.meta)){let o=function(u){if(typeof u=="number"){if(u<0||u>r.source.length)throw new Tt(`Invalid decoration offset: ${u}. Code length: ${r.source.length}`);return{...a.indexToPos(u),offset:u}}else{const f=a.lines[u.line];if(f===void 0)throw new Tt(`Invalid decoration position ${JSON.stringify(u)}. Lines length: ${a.lines.length}`);let h=u.character;if(h<0&&(h=f.length+h),h<0||h>f.length)throw new Tt(`Invalid decoration position ${JSON.stringify(u)}. Line ${u.line} length: ${f.length}`);return{...u,character:h,offset:a.posToIndex(u.line,h)}}};const a=$L(r.source),l=(r.options.decorations||[]).map(u=>({...u,start:o(u.start),end:o(u.end)}));qL(l),e.set(r.meta,{decorations:l,converter:a,source:r.source})}return e.get(r.meta)}return{name:"shiki:decorations",tokens(r){if(this.options.decorations?.length)return UL(r,t(this).decorations.flatMap(a=>[a.start.offset,a.end.offset]))},code(r){if(!this.options.decorations?.length)return;const a=t(this),o=Array.from(r.children).filter(m=>m.type==="element"&&m.tagName==="span");if(o.length!==a.converter.lines.length)throw new Tt(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function l(m,x,v,_){const w=o[m];let S="",k=-1,N=-1;if(x===0&&(k=0),v===0&&(N=0),v===Number.POSITIVE_INFINITY&&(N=w.children.length),k===-1||N===-1)for(let E=0;E<w.children.length;E++)S+=Q4(w.children[E]),k===-1&&S.length===x&&(k=E+1),N===-1&&S.length===v&&(N=E+1);if(k===-1)throw new Tt(`Failed to find start index for decoration ${JSON.stringify(_.start)}`);if(N===-1)throw new Tt(`Failed to find end index for decoration ${JSON.stringify(_.end)}`);const R=w.children.slice(k,N);if(!_.alwaysWrap&&R.length===w.children.length)f(w,_,"line");else if(!_.alwaysWrap&&R.length===1&&R[0].type==="element")f(R[0],_,"token");else{const E={type:"element",tagName:"span",properties:{},children:R};f(E,_,"wrapper"),w.children.splice(k,R.length,E)}}function u(m,x){o[m]=f(o[m],x,"line")}function f(m,x,v){const _=x.properties||{},w=x.transform||(S=>S);return m.tagName=x.tagName||"span",m.properties={...m.properties,..._,class:m.properties.class},x.properties?.class&&K4(m,x.properties.class),m=w(m,v)||m,m}const h=[],p=a.decorations.sort((m,x)=>x.start.offset-m.start.offset||m.end.offset-x.end.offset);for(const m of p){const{start:x,end:v}=m;if(x.line===v.line)l(x.line,x.character,v.character,m);else if(x.line<v.line){l(x.line,x.character,Number.POSITIVE_INFINITY,m);for(let _=x.line+1;_<v.line;_++)h.unshift(()=>u(_,m));l(v.line,0,v.character,m)}}h.forEach(m=>m())}}}function qL(e){for(let t=0;t<e.length;t++){const r=e[t];if(r.start.offset>r.end.offset)throw new Tt(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let a=t+1;a<e.length;a++){const o=e[a],l=r.start.offset<=o.start.offset&&o.start.offset<r.end.offset,u=r.start.offset<o.end.offset&&o.end.offset<=r.end.offset,f=o.start.offset<=r.start.offset&&r.start.offset<o.end.offset,h=o.start.offset<r.end.offset&&r.end.offset<=o.end.offset;if(l||u||f||h){if(l&&u||f&&h||f&&r.start.offset===r.end.offset||u&&o.start.offset===o.end.offset)continue;throw new Tt(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Q4(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Q4).join(""):""}const FL=[HL()];function Vu(e){const t=GL(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...FL]}function GL(e){const t=[],r=[],a=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":r.push(o);break;default:a.push(o)}return{pre:t,post:r,normal:a}}var Ms=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],sh={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function VL(e,t){const r=e.indexOf("\x1B",t);if(r!==-1&&e[r+1]==="["){const a=e.indexOf("m",r);if(a!==-1)return{sequence:e.substring(r+2,a).split(";"),startPosition:r,position:a+1}}return{position:e.length}}function Bv(e){const t=e.shift();if(t==="2"){const r=e.splice(0,3).map(a=>Number.parseInt(a));return r.length!==3||r.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:r}}else if(t==="5"){const r=e.shift();if(r)return{type:"table",index:Number(r)}}}function YL(e){const t=[];for(;e.length>0;){const r=e.shift();if(!r)continue;const a=Number.parseInt(r);if(!Number.isNaN(a))if(a===0)t.push({type:"resetAll"});else if(a<=9)sh[a]&&t.push({type:"setDecoration",value:sh[a]});else if(a<=29){const o=sh[a-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Ms[a-30]}});else if(a===38){const o=Bv(e);o&&t.push({type:"setForegroundColor",value:o})}else if(a===39)t.push({type:"resetForegroundColor"});else if(a<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Ms[a-40]}});else if(a===48){const o=Bv(e);o&&t.push({type:"setBackgroundColor",value:o})}else a===49?t.push({type:"resetBackgroundColor"}):a===53?t.push({type:"setDecoration",value:"overline"}):a===55?t.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Ms[a-90+8]}}):a>=100&&a<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Ms[a-100+8]}})}return t}function KL(){let e=null,t=null,r=new Set;return{parse(a){const o=[];let l=0;do{const u=VL(a,l),f=u.sequence?a.substring(l,u.startPosition):a.substring(l);if(f.length>0&&o.push({value:f,foreground:e,background:t,decorations:new Set(r)}),u.sequence){const h=YL(u.sequence);for(const p of h)p.type==="resetAll"?(e=null,t=null,r.clear()):p.type==="resetForegroundColor"?e=null:p.type==="resetBackgroundColor"?t=null:p.type==="resetDecoration"&&r.delete(p.value);for(const p of h)p.type==="setForegroundColor"?e=p.value:p.type==="setBackgroundColor"?t=p.value:p.type==="setDecoration"&&r.add(p.value)}l=u.position}while(l<a.length);return o}}}var XL={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 QL(e=XL){function t(f){return e[f]}function r(f){return`#${f.map(h=>Math.max(0,Math.min(h,255)).toString(16).padStart(2,"0")).join("")}`}let a;function o(){if(a)return a;a=[];for(let p=0;p<Ms.length;p++)a.push(t(Ms[p]));let f=[0,95,135,175,215,255];for(let p=0;p<6;p++)for(let m=0;m<6;m++)for(let x=0;x<6;x++)a.push(r([f[p],f[m],f[x]]));let h=8;for(let p=0;p<24;p++,h+=10)a.push(r([h,h,h]));return a}function l(f){return o()[f]}function u(f){switch(f.type){case"named":return t(f.name);case"rgb":return r(f.rgb);case"table":return l(f.index)}}return{value:u}}const ZL={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 JL(e,t,r){const a=Fu(e,r),o=ud(t),l=QL(Object.fromEntries(Ms.map(f=>{const h=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`;return[f,e.colors?.[h]||ZL[f]]}))),u=KL();return o.map(f=>u.parse(f[0]).map(h=>{let p,m;h.decorations.has("reverse")?(p=h.background?l.value(h.background):e.bg,m=h.foreground?l.value(h.foreground):e.fg):(p=h.foreground?l.value(h.foreground):e.fg,m=h.background?l.value(h.background):void 0),p=us(p,a),m=us(m,a),h.decorations.has("dim")&&(p=WL(p));let x=Nn.None;return h.decorations.has("bold")&&(x|=Nn.Bold),h.decorations.has("italic")&&(x|=Nn.Italic),h.decorations.has("underline")&&(x|=Nn.Underline),h.decorations.has("strikethrough")&&(x|=Nn.Strikethrough),{content:h.value,offset:f[1],color:p,bgColor:m,fontStyle:x}}))}function WL(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const a=t[1];if(a.length===8){const o=Math.round(Number.parseInt(a.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${a.slice(0,6)}${o}`}else{if(a.length===6)return`#${a}80`;if(a.length===4){const o=a[0],l=a[1],u=a[2],f=a[3];return`#${o}${o}${l}${l}${u}${u}${Math.round(Number.parseInt(`${f}${f}`,16)/2).toString(16).padStart(2,"0")}`}else if(a.length===3){const o=a[0],l=a[1],u=a[2];return`#${o}${o}${l}${l}${u}${u}80`}}}const r=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return r?`var(${r[1]}-dim)`:e}function Kh(e,t,r={}){const a=e.resolveLangAlias(r.lang||"text"),{theme:o=e.getLoadedThemes()[0]}=r;if(!ld(a)&&!cd(o)&&a==="ansi"){const{theme:l}=e.setTheme(o);return JL(l,t,r)}return P4(e,t,r)}function Yu(e,t,r){let a,o,l,u,f,h;if("themes"in r){const{defaultColor:p="light",cssVariablePrefix:m="--shiki-",colorsRendering:x="css-vars"}=r,v=Object.entries(r.themes).filter(N=>N[1]).map(N=>({color:N[0],theme:N[1]})).sort((N,R)=>N.color===p?-1:R.color===p?1:0);if(v.length===0)throw new Tt("`themes` option must not be empty");const _=H4(e,t,r,Kh);if(h=wl(_),p&&Lm!==p&&!v.find(N=>N.color===p))throw new Tt(`\`themes\` option must contain the defaultColor key \`${p}\``);const w=v.map(N=>e.getTheme(N.theme)),S=v.map(N=>N.color);l=_.map(N=>N.map(R=>PL(R,S,m,p,x))),h&&dd(l,h);const k=v.map(N=>Fu(N.theme,r));o=Iv(v,w,k,m,p,"fg",x),a=Iv(v,w,k,m,p,"bg",x),u=`shiki-themes ${w.map(N=>N.name).join(" ")}`,f=p?void 0:[o,a].join(";")}else if("theme"in r){const p=Fu(r.theme,r);l=Kh(e,t,r);const m=e.getTheme(r.theme);a=us(m.bg,p),o=us(m.fg,p),u=m.name,h=wl(l)}else throw new Tt("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:o,bg:a,themeName:u,rootStyle:f,grammarState:h}}function Iv(e,t,r,a,o,l,u){return e.map((f,h)=>{const p=us(t[h][l],r[h])||"inherit",m=`${a+f.color}${l==="bg"?"-bg":""}:${p}`;if(h===0&&o){if(o===Lm&&e.length>1){const x=e.findIndex(_=>_.color==="light"),v=e.findIndex(_=>_.color==="dark");if(x===-1||v===-1)throw new Tt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${us(t[x][l],r[x])||"inherit"}, ${us(t[v][l],r[v])||"inherit"});${m}`}return p}return u==="css-vars"?m:null}).filter(f=>!!f).join(";")}function Ku(e,t,r,a={meta:{},options:r,codeToHast:(o,l)=>Ku(e,o,l),codeToTokens:(o,l)=>Yu(e,o,l)}){let o=t;for(const w of Vu(r))o=w.preprocess?.call(a,o,r)||o;let{tokens:l,fg:u,bg:f,themeName:h,rootStyle:p,grammarState:m}=Yu(e,o,r);const{mergeWhitespaces:x=!0,mergeSameStyleTokens:v=!1}=r;x===!0?l=tD(l):x==="never"&&(l=nD(l)),v&&(l=rD(l));const _={...a,get source(){return o}};for(const w of Vu(r))l=w.tokens?.call(_,l)||l;return eD(l,{...r,fg:u,bg:f,themeName:h,rootStyle:r.rootStyle===!1?!1:r.rootStyle??p},_,m)}function eD(e,t,r,a=wl(e)){const o=Vu(t),l=[],u={type:"root",children:[]},{structure:f="classic",tabindex:h="0"}=t,p={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?p.style=t.rootStyle:p.style=`background-color:${t.bg};color:${t.fg}`),h!==!1&&h!=null&&(p.tabindex=h.toString());for(const[S,k]of Object.entries(t.meta||{}))S.startsWith("_")||(p[S]=k);let m={type:"element",tagName:"pre",properties:p,children:[],data:t.data},x={type:"element",tagName:"code",properties:{},children:l};const v=[],_={...r,structure:f,addClassToHast:K4,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return u},get pre(){return m},get code(){return x},get lines(){return v}};if(e.forEach((S,k)=>{k&&(f==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):f==="classic"&&l.push({type:"text",value:`
|
|
45
|
+
`}));let N={type:"element",tagName:"span",properties:{class:"line"},children:[]},R=0;for(const E of S){let D={type:"element",tagName:"span",properties:{...E.htmlAttrs},children:[{type:"text",value:E.content}]};const L=Yh(E.htmlStyle||Gu(E));L&&(D.properties.style=L);for(const $ of o)D=$?.span?.call(_,D,k+1,R,N,E)||D;f==="inline"?u.children.push(D):f==="classic"&&N.children.push(D),R+=E.content.length}if(f==="classic"){for(const E of o)N=E?.line?.call(_,N,k+1)||N;v.push(N),l.push(N)}else f==="inline"&&v.push(N)}),f==="classic"){for(const S of o)x=S?.code?.call(_,x)||x;m.children.push(x);for(const S of o)m=S?.pre?.call(_,m)||m;u.children.push(m)}else if(f==="inline"){const S=[];let k={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const R of u.children)R.type==="element"&&R.tagName==="br"?(S.push(k),k={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(R.type==="element"||R.type==="text")&&k.children.push(R);S.push(k);let N={type:"element",tagName:"code",properties:{},children:S};for(const R of o)N=R?.code?.call(_,N)||N;u.children=[];for(let R=0;R<N.children.length;R++){R>0&&u.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=N.children[R];E.type==="element"&&u.children.push(...E.children)}}let w=u;for(const S of o)w=S?.root?.call(_,w)||w;return a&&dd(w,a),w}function tD(e){return e.map(t=>{const r=[];let a="",o;return t.forEach((l,u)=>{const f=!(l.fontStyle&&(l.fontStyle&Nn.Underline||l.fontStyle&Nn.Strikethrough));f&&l.content.match(/^\s+$/)&&t[u+1]?(o===void 0&&(o=l.offset),a+=l.content):a?(f?r.push({...l,offset:o,content:a+l.content}):r.push({content:a,offset:o},l),o=void 0,a=""):r.push(l)}),r})}function nD(e){return e.map(t=>t.flatMap(r=>{if(r.content.match(/^\s+$/))return r;const a=r.content.match(/^(\s*)(.*?)(\s*)$/);if(!a)return r;const[,o,l,u]=a;if(!o&&!u)return r;const f=[{...r,offset:r.offset+o.length,content:l}];return o&&f.unshift({content:o,offset:r.offset}),u&&f.push({content:u,offset:r.offset+o.length+l.length}),f}))}function rD(e){return e.map(t=>{const r=[];for(const a of t){if(r.length===0){r.push({...a});continue}const o=r[r.length-1],l=Yh(o.htmlStyle||Gu(o)),u=Yh(a.htmlStyle||Gu(a)),f=o.fontStyle&&(o.fontStyle&Nn.Underline||o.fontStyle&Nn.Strikethrough),h=a.fontStyle&&(a.fontStyle&Nn.Underline||a.fontStyle&Nn.Strikethrough);!f&&!h&&l===u?o.content+=a.content:r.push({...a})}return r})}const aD=OL;function sD(e,t,r){const a={meta:{},options:r,codeToHast:(l,u)=>Ku(e,l,u),codeToTokens:(l,u)=>Yu(e,l,u)};let o=aD(Ku(e,t,r,a));for(const l of Vu(r))o=l.postprocess?.call(a,o,r)||o;return o}async function oD(e){const t=await S5(e);return{getLastGrammarState:(...r)=>N5(t,...r),codeToTokensBase:(r,a)=>Kh(t,r,a),codeToTokensWithThemes:(r,a)=>H4(t,r,a),codeToTokens:(r,a)=>Yu(t,r,a),codeToHast:(r,a)=>Ku(t,r,a),codeToHtml:(r,a)=>sD(t,r,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function iD(e){const t=e.langs,r=e.themes,a=e.engine;async function o(l){function u(x){if(typeof x=="string"){if(x=l.langAlias?.[x]||x,Cm(x))return[];const v=t[x];if(!v)throw new Tt(`Language \`${x}\` is not included in this bundle. You may want to load it from external source.`);return v}return x}function f(x){if(M4(x))return"none";if(typeof x=="string"){const v=r[x];if(!v)throw new Tt(`Theme \`${x}\` is not included in this bundle. You may want to load it from external source.`);return v}return x}const h=(l.themes??[]).map(x=>f(x)),p=(l.langs??[]).map(x=>u(x)),m=await oD({engine:l.engine??a(),...l,themes:h,langs:p});return{...m,loadLanguage(...x){return m.loadLanguage(...x.map(u))},loadTheme(...x){return m.loadTheme(...x.map(f))},getBundledLanguages(){return t},getBundledThemes(){return r}}}return o}function lD(e){let t;async function r(a={}){if(t){const o=await t;return await Promise.all([o.loadTheme(...a.themes||[]),o.loadLanguage(...a.langs||[])]),o}else{t=e({...a,themes:[],langs:[]});const o=await t;return await Promise.all([o.loadTheme(...a.themes||[]),o.loadLanguage(...a.langs||[])]),o}}return r}function cD(e,t){const r=lD(e);async function a(o,l){const u=await r({langs:[l.lang],themes:"theme"in l?[l.theme]:Object.values(l.themes)}),f=await t?.guessEmbeddedLanguages?.(o,l.lang,u);return f&&await u.loadLanguage(...f),u}return{getSingletonHighlighter(o){return r(o)},async codeToHtml(o,l){return(await a(o,l)).codeToHtml(o,l)},async codeToHast(o,l){return(await a(o,l)).codeToHast(o,l)},async codeToTokens(o,l){return(await a(o,l)).codeToTokens(o,l)},async codeToTokensBase(o,l){return(await a(o,l)).codeToTokensBase(o,l)},async codeToTokensWithThemes(o,l){return(await a(o,l)).codeToTokensWithThemes(o,l)},async getLastGrammarState(o,l){return(await r({langs:[l.lang],themes:[l.theme]})).getLastGrammarState(o,l)}}}var Uv=Object.prototype.hasOwnProperty;function Pv(e,t,r){for(r of e.keys())if(dl(r,t))return r}function dl(e,t){var r,a,o;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((a=e.length)===t.length)for(;a--&&dl(e[a],t[a]););return a===-1}if(r===Set){if(e.size!==t.size)return!1;for(a of e)if(o=a,o&&typeof o=="object"&&(o=Pv(t,o),!o)||!t.has(o))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(a of e)if(o=a[0],o&&typeof o=="object"&&(o=Pv(t,o),!o)||!dl(a[1],t.get(o)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((a=e.byteLength)===t.byteLength)for(;a--&&e.getInt8(a)===t.getInt8(a););return a===-1}if(ArrayBuffer.isView(e)){if((a=e.byteLength)===t.byteLength)for(;a--&&e[a]===t[a];);return a===-1}if(!r||typeof e=="object"){a=0;for(r in e)if(Uv.call(e,r)&&++a&&!Uv.call(t,r)||!(r in t)||!dl(e[r],t[r]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}function Z4(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Z4(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Hv(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Z4(e))&&(a&&(a+=" "),a+=t);return a}var oh=e=>{const t=b.useRef(e);return e!==t.current&&!dl(e,t.current)&&(t.current=e),t.current},uD=(e,t,r)=>{const a=Date.now();clearTimeout(t.current.timeoutId);const o=Math.max(0,t.current.nextAllowedTime-a);t.current.timeoutId=setTimeout(()=>{e().catch(console.error),t.current.nextAllowedTime=a+r},o)},J4="plaintext",qv=e=>e==null?[]:Array.isArray(e)?e:[e],dD=e=>e==null?null:typeof e=="string"?`s:${e}`:`o:${e.name}::${e.scopeName}`,Fv=e=>{const t=new Set,r=[];for(const a of e){const o=dD(a);o==null||t.has(o)||(t.add(o),r.push(a))}return r},fD=(e,t)=>e==null?!1:typeof e=="string"?e in t:typeof e.name=="string"&&typeof e.scopeName=="string",pD=(e,t)=>Cm(e)||t.includes(e)?e:J4,hD=(e,t,r,a)=>{const o=qv(t),l=qv(a),u=[...o,...l];let f=J4,h;if(e==null||typeof e=="string"&&!e.trim())return{languageId:f,langsToLoad:Fv([...l,...o])};if(typeof e=="object")f=e.name,h=e;else{const p=e.toLowerCase(),m=v=>v?.toLowerCase()===p,x=u.find(v=>typeof v=="object"&&v!=null&&!!(m(v.name)||m(v.scopeName)||m(v.scopeName?.split(".").pop())||v.aliases?.some(m)||v.fileTypes?.some(m)));x?(f=x.name||e,h=x):r?.[e]?(f=r[e],h=r[e]):(f=e,h=e)}return{languageId:f,langsToLoad:Fv([h,...l,...o])}},Gv=e=>typeof e=="object"&&e!==null&&"tokenColors"in e&&Array.isArray(e.tokenColors);function mD(e){const t=Gv(e),r=typeof e=="object"&&e!==null&&!t,a=typeof e=="object"&&e!==null&&!t&&Object.entries(e).some(([o,l])=>o.trim()!==""&&(typeof l=="string"&&l.trim()!==""||Gv(l)));return r?{isMultiTheme:!0,themeId:a?`multi-${Object.values(e).map(l=>(typeof l=="string"?l:l?.name)||"custom").sort().join("-")}`:"multi-default",multiTheme:a?e:null,themesToLoad:a?Object.values(e):[]}:{isMultiTheme:!1,themeId:typeof e=="string"?e:e?.name||"custom",singleTheme:e,themesToLoad:[e]}}function gD(e=1){return{name:"react-shiki:line-numbers",code(t){if(this.addClassToHast(t,"has-line-numbers"),e!==1){const r=t.properties?.style||"",a=r?`${r}; --line-start: ${e}`:`--line-start: ${e}`;t.properties={...t.properties,style:a}}},line(t){return this.addClassToHast(t,"line-numbers"),t}}}var Vv={light:"github-light",dark:"github-dark"},xD=(e,t)=>e.isMultiTheme?{themes:e.multiTheme??Vv,defaultColor:t.defaultColor,cssVariablePrefix:t.cssVariablePrefix}:{theme:e.singleTheme??Vv.dark},yD=e=>{const t=[...e.transformers||[]];return e.showLineNumbers&&t.push(gD(e.startingLineNumber)),t},bD=({languageId:e,resolvedTheme:t,options:r})=>{const{defaultColor:a,cssVariablePrefix:o,showLineNumbers:l,startingLineNumber:u,transformers:f,...h}=r;return{lang:e,...xD(t,r),...h,transformers:yD(r)}},vD=(e,t,r)=>{const a=r.getBundledLanguages();return X4(e).flatMap(o=>a[o]??[])},_D=(e,t,r,a={},o)=>{const[l,u]=b.useState(null),f=oh(t),h=oh(r),p=oh(a),{languageId:m,langsToLoad:x}=b.useMemo(()=>hD(f,p.customLanguages,p.langAlias,p.preloadLanguages),[f,p.customLanguages,p.preloadLanguages,p.langAlias]),v=b.useMemo(()=>mD(h),[h]),{themesToLoad:_}=v,w=b.useRef({nextAllowedTime:0,timeoutId:void 0}),S=b.useMemo(()=>bD({languageId:m,resolvedTheme:v,options:p}),[m,v,p]);return b.useEffect(()=>{let k=!0;const N=async()=>{if(!m)return;const E=p.highlighter?p.highlighter:await o(x,_,p.engine);if(!p.highlighter){const $=vD(e,m,E);$.length>0&&await E.loadLanguage(...$)}const D=pD(m,E.getLoadedLanguages()),L={...S,lang:D};if(k){const $=p.outputFormat==="html"?E.codeToHtml(e,L):d3(E.codeToHast(e,L),{jsx:c.jsx,jsxs:c.jsxs,Fragment:c.Fragment});u($)}},{delay:R}=p;return R?uD(N,w,R):N().catch(console.error),()=>{k=!1,clearTimeout(w.current.timeoutId)}},[e,S,p.delay,p.highlighter,x,_]),l};function wD(e,{insertAt:t}={}){if(typeof document>"u")return;const r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}wD(`.relative {
|
|
46
|
+
position: relative;
|
|
47
|
+
}
|
|
48
|
+
.defaultStyles pre {
|
|
49
|
+
overflow: auto;
|
|
50
|
+
border-radius: 0.5rem;
|
|
51
|
+
padding-left: 1.5rem;
|
|
52
|
+
padding-right: 1.5rem;
|
|
53
|
+
padding-top: 1.25rem;
|
|
54
|
+
padding-bottom: 1.25rem;
|
|
55
|
+
}
|
|
56
|
+
.languageLabel {
|
|
57
|
+
position: absolute;
|
|
58
|
+
right: 0.75rem;
|
|
59
|
+
top: 0.5rem;
|
|
60
|
+
font-family: monospace;
|
|
61
|
+
font-size: 0.75rem;
|
|
62
|
+
letter-spacing: -0.05em;
|
|
63
|
+
color: rgba(107, 114, 128, 0.85);
|
|
64
|
+
}
|
|
65
|
+
.line-numbers::before {
|
|
66
|
+
counter-increment: line-number;
|
|
67
|
+
content: counter(line-number);
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
align-items: flex-start;
|
|
71
|
+
box-sizing: content-box;
|
|
72
|
+
min-width: var(--line-numbers-width, 2ch);
|
|
73
|
+
padding-left: var(--line-numbers-padding-left, 2ch);
|
|
74
|
+
padding-right: var(--line-numbers-padding-right, 2ch);
|
|
75
|
+
color: var(--line-numbers-foreground, rgba(107, 114, 128, 0.6));
|
|
76
|
+
font-size: var(--line-numbers-font-size, inherit);
|
|
77
|
+
font-weight: var(--line-numbers-font-weight, inherit);
|
|
78
|
+
line-height: var(--line-numbers-line-height, inherit);
|
|
79
|
+
font-family: var(--line-numbers-font-family, inherit);
|
|
80
|
+
opacity: var(--line-numbers-opacity, 1);
|
|
81
|
+
user-select: none;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
.has-line-numbers {
|
|
85
|
+
counter-reset: line-number calc(var(--line-start, 1) - 1);
|
|
86
|
+
--line-numbers-foreground: rgba(107, 114, 128, 0.5);
|
|
87
|
+
--line-numbers-width: 2ch;
|
|
88
|
+
--line-numbers-padding-left: 0ch;
|
|
89
|
+
--line-numbers-padding-right: 2ch;
|
|
90
|
+
--line-numbers-font-size: inherit;
|
|
91
|
+
--line-numbers-font-weight: inherit;
|
|
92
|
+
--line-numbers-line-height: inherit;
|
|
93
|
+
--line-numbers-font-family: inherit;
|
|
94
|
+
--line-numbers-opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
`);var SD=e=>b.forwardRef(({language:t,theme:r,delay:a,transformers:o,defaultColor:l,cssVariablePrefix:u,addDefaultStyles:f=!0,style:h,langStyle:p,className:m,langClassName:x,showLanguage:v=!0,showLineNumbers:_=!1,startingLineNumber:w=1,children:S,as:k="pre",customLanguages:N,preloadLanguages:R,...E},D)=>{const L={delay:a,transformers:o,customLanguages:N,preloadLanguages:R,showLineNumbers:_,defaultColor:l,cssVariablePrefix:u,startingLineNumber:w,...E},$=typeof t=="object"?t.name||null:t?.trim()||null,z=e(S,t,r,L),T=typeof z=="string";return c.jsxs(k,{ref:D,"data-testid":"shiki-container",className:Hv("relative","not-prose",f&&"defaultStyles",m),style:h,id:"shiki-container",children:[v&&$?c.jsx("span",{className:Hv("languageLabel",x),style:p,id:"language-label",children:$}):null,T?c.jsx("div",{dangerouslySetInnerHTML:{__html:z}}):z]})}),Dm=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function jD(){return 2147483648}function kD(){return typeof performance<"u"?performance.now():Date.now()}const ND=(e,t)=>e+(t-e%t)%t;async function ED(e){let t,r;const a={};function o(_){r=_,a.HEAPU8=new Uint8Array(_),a.HEAPU32=new Uint32Array(_)}function l(_,w,S){a.HEAPU8.copyWithin(_,w,w+S)}function u(_){try{return t.grow(_-r.byteLength+65535>>>16),o(t.buffer),1}catch{}}function f(_){const w=a.HEAPU8.length;_=_>>>0;const S=jD();if(_>S)return!1;for(let k=1;k<=4;k*=2){let N=w*(1+.2/k);N=Math.min(N,_+100663296);const R=Math.min(S,ND(Math.max(_,N),65536));if(u(R))return!0}return!1}const h=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function p(_,w,S=1024){const k=w+S;let N=w;for(;_[N]&&!(N>=k);)++N;if(N-w>16&&_.buffer&&h)return h.decode(_.subarray(w,N));let R="";for(;w<N;){let E=_[w++];if(!(E&128)){R+=String.fromCharCode(E);continue}const D=_[w++]&63;if((E&224)===192){R+=String.fromCharCode((E&31)<<6|D);continue}const L=_[w++]&63;if((E&240)===224?E=(E&15)<<12|D<<6|L:E=(E&7)<<18|D<<12|L<<6|_[w++]&63,E<65536)R+=String.fromCharCode(E);else{const $=E-65536;R+=String.fromCharCode(55296|$>>10,56320|$&1023)}}return R}function m(_,w){return _?p(a.HEAPU8,_,w):""}const x={emscripten_get_now:kD,emscripten_memcpy_big:l,emscripten_resize_heap:f,fd_write:()=>0};async function v(){const w=await e({env:x,wasi_snapshot_preview1:x});t=w.memory,o(t.buffer),Object.assign(a,w),a.UTF8ToString=m}return await v(),a}var CD=Object.defineProperty,RD=(e,t,r)=>t in e?CD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,on=(e,t,r)=>RD(e,typeof t!="symbol"?t+"":t,r);let pn=null;function TD(e){throw new Dm(e.UTF8ToString(e.getLastOnigError()))}class pd{constructor(t){on(this,"utf16Length"),on(this,"utf8Length"),on(this,"utf16Value"),on(this,"utf8Value"),on(this,"utf16OffsetToUtf8"),on(this,"utf8OffsetToUtf16");const r=t.length,a=pd._utf8ByteLength(t),o=a!==r,l=o?new Uint32Array(r+1):null;o&&(l[r]=a);const u=o?new Uint32Array(a+1):null;o&&(u[a]=r);const f=new Uint8Array(a);let h=0;for(let p=0;p<r;p++){const m=t.charCodeAt(p);let x=m,v=!1;if(m>=55296&&m<=56319&&p+1<r){const _=t.charCodeAt(p+1);_>=56320&&_<=57343&&(x=(m-55296<<10)+65536|_-56320,v=!0)}o&&(l[p]=h,v&&(l[p+1]=h),x<=127?u[h+0]=p:x<=2047?(u[h+0]=p,u[h+1]=p):x<=65535?(u[h+0]=p,u[h+1]=p,u[h+2]=p):(u[h+0]=p,u[h+1]=p,u[h+2]=p,u[h+3]=p)),x<=127?f[h++]=x:x<=2047?(f[h++]=192|(x&1984)>>>6,f[h++]=128|(x&63)>>>0):x<=65535?(f[h++]=224|(x&61440)>>>12,f[h++]=128|(x&4032)>>>6,f[h++]=128|(x&63)>>>0):(f[h++]=240|(x&1835008)>>>18,f[h++]=128|(x&258048)>>>12,f[h++]=128|(x&4032)>>>6,f[h++]=128|(x&63)>>>0),v&&p++}this.utf16Length=r,this.utf8Length=a,this.utf16Value=t,this.utf8Value=f,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let r=0;for(let a=0,o=t.length;a<o;a++){const l=t.charCodeAt(a);let u=l,f=!1;if(l>=55296&&l<=56319&&a+1<o){const h=t.charCodeAt(a+1);h>=56320&&h<=57343&&(u=(l-55296<<10)+65536|h-56320,f=!0)}u<=127?r+=1:u<=2047?r+=2:u<=65535?r+=3:r+=4,f&&a++}return r}createString(t){const r=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,r),r}}const hd=class Gr{constructor(t){if(on(this,"id",++Gr.LAST_ID),on(this,"_onigBinding"),on(this,"content"),on(this,"utf16Length"),on(this,"utf8Length"),on(this,"utf16OffsetToUtf8"),on(this,"utf8OffsetToUtf16"),on(this,"ptr"),!pn)throw new Dm("Must invoke loadWasm first.");this._onigBinding=pn,this.content=t;const r=new pd(t);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!Gr._sharedPtrInUse?(Gr._sharedPtr||(Gr._sharedPtr=pn.omalloc(1e4)),Gr._sharedPtrInUse=!0,pn.HEAPU8.set(r.utf8Value,Gr._sharedPtr),this.ptr=Gr._sharedPtr):this.ptr=r.createString(pn)}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===Gr._sharedPtr?Gr._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};on(hd,"LAST_ID",0);on(hd,"_sharedPtr",0);on(hd,"_sharedPtrInUse",!1);let W4=hd;class AD{constructor(t){if(on(this,"_onigBinding"),on(this,"_ptr"),!pn)throw new Dm("Must invoke loadWasm first.");const r=[],a=[];for(let f=0,h=t.length;f<h;f++){const p=new pd(t[f]);r[f]=p.createString(pn),a[f]=p.utf8Length}const o=pn.omalloc(4*t.length);pn.HEAPU32.set(r,o/4);const l=pn.omalloc(4*t.length);pn.HEAPU32.set(a,l/4);const u=pn.createOnigScanner(o,l,t.length);for(let f=0,h=t.length;f<h;f++)pn.ofree(r[f]);pn.ofree(l),pn.ofree(o),u===0&&TD(pn),this._onigBinding=pn,this._ptr=u}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,r,a){let o=0;if(typeof a=="number"&&(o=a),typeof t=="string"){t=new W4(t);const l=this._findNextMatchSync(t,r,!1,o);return t.dispose(),l}return this._findNextMatchSync(t,r,!1,o)}_findNextMatchSync(t,r,a,o){const l=this._onigBinding,u=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(r),o);if(u===0)return null;const f=l.HEAPU32;let h=u/4;const p=f[h++],m=f[h++],x=[];for(let v=0;v<m;v++){const _=t.convertUtf8OffsetToUtf16(f[h++]),w=t.convertUtf8OffsetToUtf16(f[h++]);x[v]={start:_,end:w,length:w-_}}return{index:p,captureIndices:x}}}function LD(e){return typeof e.instantiator=="function"}function DD(e){return typeof e.default=="function"}function OD(e){return typeof e.data<"u"}function MD(e){return typeof Response<"u"&&e instanceof Response}function zD(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 fu;function ew(e){if(fu)return fu;async function t(){pn=await ED(async r=>{let a=e;return a=await a,typeof a=="function"&&(a=await a(r)),typeof a=="function"&&(a=await a(r)),LD(a)?a=await a.instantiator(r):DD(a)?a=await a.default(r):(OD(a)&&(a=a.data),MD(a)?typeof WebAssembly.instantiateStreaming=="function"?a=await $D(a)(r):a=await BD(a)(r):zD(a)?a=await ih(a)(r):a instanceof WebAssembly.Module?a=await ih(a)(r):"default"in a&&a.default instanceof WebAssembly.Module&&(a=await ih(a.default)(r))),"instance"in a&&(a=a.instance),"exports"in a&&(a=a.exports),a})}return fu=t(),fu}function ih(e){return t=>WebAssembly.instantiate(e,t)}function $D(e){return t=>WebAssembly.instantiateStreaming(e,t)}function BD(e){return async t=>{const r=await e.arrayBuffer();return WebAssembly.instantiate(r,t)}}let tw;function ID(e){tw=e}function UD(){return tw}async function nw(e){return e&&await ew(e),{createScanner(t){return new AD(t.map(r=>typeof r=="string"?r:r.source))},createString(t){return new W4(t)}}}const PD=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:nw,getDefaultWasmLoader:UD,loadWasm:ew,setDefaultWasmLoader:ID},Symbol.toStringTag,{value:"Module"}));var rw=T3({});L3(rw,PD);const HD=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>le(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>le(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>le(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>le(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>le(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>le(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>le(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>le(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>le(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>le(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>le(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>le(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>le(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>le(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>le(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>le(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>le(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>le(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>le(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>le(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>le(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>le(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>le(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>le(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>le(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>le(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>le(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>le(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>le(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>le(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>le(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>le(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>le(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>le(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>le(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>le(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>le(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>le(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>le(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>le(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>le(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>le(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>le(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>le(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>le(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>le(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>le(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>le(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>le(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>le(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>le(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>le(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>le(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>le(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>le(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>le(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>le(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>le(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>le(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>le(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>le(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>le(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>le(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>le(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>le(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],qD=Object.fromEntries(HD.map(e=>[e.id,e.import])),aw=[{id:"angular-html",name:"Angular HTML",import:(()=>le(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>le(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"astro",name:"Astro",import:(()=>le(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([6,7,2,8,3,9,10])))},{id:"blade",name:"Blade",import:(()=>le(()=>import("./blade-BjGOyj-B.js"),__vite__mapDeps([11,12,1,2,3,13,14,15,7])))},{id:"c",name:"C",import:(()=>le(()=>import("./c-BIGW1oBm.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>le(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([16,2])))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>le(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([17,18,19,20,15])))},{id:"css",name:"CSS",import:(()=>le(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>le(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"glsl",name:"GLSL",import:(()=>le(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([19,20])))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>le(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([21,2,8,22,10])))},{id:"haml",name:"Ruby Haml",import:(()=>le(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([23,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>le(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([24,1,2,3,25])))},{id:"html",name:"HTML",import:(()=>le(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>le(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([12,1,2,3])))},{id:"http",name:"HTTP",import:(()=>le(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([26,27,7,13,14,21,2,8,22,10])))},{id:"hurl",name:"Hurl",import:(()=>le(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([28,21,2,8,22,10,13,14,29])))},{id:"imba",name:"Imba",import:(()=>le(()=>import("./imba-DGztddWO.js"),[]))},{id:"java",name:"Java",import:(()=>le(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>le(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>le(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([30,1,2,3])))},{id:"jison",name:"Jison",import:(()=>le(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([31,2])))},{id:"json",name:"JSON",import:(()=>le(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>le(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>le(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>le(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>le(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>le(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([32,17,18,19,20,15,33,2,34])))},{id:"less",name:"Less",import:(()=>le(()=>import("./less-B1dDrJ26.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>le(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>le(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([35,3,36,5,8])))},{id:"mdc",name:"MDC",import:(()=>le(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([37,38,25,12,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>le(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"php",name:"PHP",import:(()=>le(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([39,1,2,3,13,14,15,7])))},{id:"postcss",name:"PostCSS",import:(()=>le(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>le(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([40,2,3,1])))},{id:"python",name:"Python",aliases:["py"],import:(()=>le(()=>import("./python-B6aJPvgy.js"),[]))},{id:"r",name:"R",import:(()=>le(()=>import("./r-Dspwwk_N.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>le(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"sass",name:"Sass",import:(()=>le(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scss",name:"SCSS",import:(()=>le(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>le(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"sql",name:"SQL",import:(()=>le(()=>import("./sql-BLtJtn59.js"),[]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>le(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>le(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([41,2,8,3,9])))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>le(()=>import("./ts-tags-DQrlYJgV.js"),__vite__mapDeps([42,8,3,2,19,20,1,15,13,14])))},{id:"tsx",name:"TSX",import:(()=>le(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>le(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"vue",name:"Vue",import:(()=>le(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([43,3,2,8,7,1,12])))},{id:"vue-html",name:"Vue HTML",import:(()=>le(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([44,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>le(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([45,3,5,36,46,9,2])))},{id:"wasm",name:"WebAssembly",import:(()=>le(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>le(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>le(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"xml",name:"XML",import:(()=>le(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([13,14])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>le(()=>import("./yaml-Buea-lGh.js"),[]))}],FD=Object.fromEntries(aw.map(e=>[e.id,e.import])),GD=Object.fromEntries(aw.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),sw={...FD,...GD},VD=iD({langs:sw,themes:qD,engine:()=>(0,rw.createOnigurumaEngine)(le(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{getSingletonHighlighter:YD}=cD(VD,{guessEmbeddedLanguages:X4});async function KD(e,t,r){const a=e.filter(o=>fD(o,sw));return await YD({langs:a,themes:t,engine:r??nw(le(()=>import("./wasm-CG6Dc4jp.js"),[]))})}var XD=(e,t,r,a={})=>_D(e,t,r,a,KD),QD=SD(XD),ZD=QD;const JD={"actionBar.toggledBackground":"#525761","activityBar.background":"#282c34","activityBar.foreground":"#d7dae0","activityBarBadge.background":"#4d78cc","activityBarBadge.foreground":"#f8fafd","badge.background":"#282c34","button.background":"#404754","button.secondaryBackground":"#30333d","button.secondaryForeground":"#c0bdbd","checkbox.border":"#404754","debugToolBar.background":"#21252b",descriptionForeground:"#abb2bf","diffEditor.insertedTextBackground":"#00809b33","dropdown.background":"#21252b","dropdown.border":"#21252b","editor.background":"#282c34","editor.findMatchBackground":"#d19a6644","editor.findMatchBorder":"#ffffff5a","editor.findMatchHighlightBackground":"#ffffff22","editor.foreground":"#abb2bf","editor.lineHighlightBackground":"#2c313c","editor.selectionBackground":"#67769660","editor.selectionHighlightBackground":"#ffd33d44","editor.selectionHighlightBorder":"#dddddd","editor.wordHighlightBackground":"#d2e0ff2f","editor.wordHighlightBorder":"#7f848e","editor.wordHighlightStrongBackground":"#abb2bf26","editor.wordHighlightStrongBorder":"#7f848e","editorBracketHighlight.foreground1":"#d19a66","editorBracketHighlight.foreground2":"#c678dd","editorBracketHighlight.foreground3":"#56b6c2","editorBracketMatch.background":"#515a6b","editorBracketMatch.border":"#515a6b","editorCursor.background":"#ffffffc9","editorCursor.foreground":"#528bff","editorError.foreground":"#c24038","editorGroup.background":"#181a1f","editorGroup.border":"#181a1f","editorGroupHeader.tabsBackground":"#21252b","editorGutter.addedBackground":"#109868","editorGutter.deletedBackground":"#9A353D","editorGutter.modifiedBackground":"#948B60","editorHoverWidget.background":"#21252b","editorHoverWidget.border":"#181a1f","editorHoverWidget.highlightForeground":"#61afef","editorIndentGuide.activeBackground1":"#c8c8c859","editorIndentGuide.background1":"#3b4048","editorInlayHint.background":"#2c313c","editorInlayHint.foreground":"#abb2bf","editorLineNumber.activeForeground":"#abb2bf","editorLineNumber.foreground":"#495162","editorMarkerNavigation.background":"#21252b","editorOverviewRuler.addedBackground":"#109868","editorOverviewRuler.deletedBackground":"#9A353D","editorOverviewRuler.modifiedBackground":"#948B60","editorRuler.foreground":"#abb2bf26","editorSuggestWidget.background":"#21252b","editorSuggestWidget.border":"#181a1f","editorSuggestWidget.selectedBackground":"#2c313a","editorWarning.foreground":"#d19a66","editorWhitespace.foreground":"#ffffff1d","editorWidget.background":"#21252b",focusBorder:"#3e4452","gitDecoration.ignoredResourceForeground":"#636b78","input.background":"#1d1f23","input.foreground":"#abb2bf","list.activeSelectionBackground":"#2c313a","list.activeSelectionForeground":"#d7dae0","list.focusBackground":"#323842","list.focusForeground":"#f0f0f0","list.highlightForeground":"#ecebeb","list.hoverBackground":"#2c313a","list.hoverForeground":"#abb2bf","list.inactiveSelectionBackground":"#323842","list.inactiveSelectionForeground":"#d7dae0","list.warningForeground":"#d19a66","menu.foreground":"#abb2bf","menu.separatorBackground":"#343a45","minimapGutter.addedBackground":"#109868","minimapGutter.deletedBackground":"#9A353D","minimapGutter.modifiedBackground":"#948B60","multiDiffEditor.headerBackground":"#21252b","panel.border":"#3e4452","panelSectionHeader.background":"#21252b","peekViewEditor.background":"#1b1d23","peekViewEditor.matchHighlightBackground":"#29244b","peekViewResult.background":"#22262b","scrollbar.shadow":"#23252c","scrollbarSlider.activeBackground":"#747d9180","scrollbarSlider.background":"#4e566660","scrollbarSlider.hoverBackground":"#5a637580","settings.focusedRowBackground":"#282c34","settings.headerForeground":"#fff","sideBar.background":"#21252b","sideBar.foreground":"#abb2bf","sideBarSectionHeader.background":"#282c34","sideBarSectionHeader.foreground":"#abb2bf","statusBar.background":"#21252b","statusBar.debuggingBackground":"#cc6633","statusBar.debuggingBorder":"#ff000000","statusBar.debuggingForeground":"#ffffff","statusBar.foreground":"#9da5b4","statusBar.noFolderBackground":"#21252b","statusBarItem.remoteBackground":"#4d78cc","statusBarItem.remoteForeground":"#f8fafd","tab.activeBackground":"#282c34","tab.activeBorder":"#b4b4b4","tab.activeForeground":"#dcdcdc","tab.border":"#181a1f","tab.hoverBackground":"#323842","tab.inactiveBackground":"#21252b","tab.unfocusedHoverBackground":"#323842","terminal.ansiBlack":"#3f4451","terminal.ansiBlue":"#4aa5f0","terminal.ansiBrightBlack":"#4f5666","terminal.ansiBrightBlue":"#4dc4ff","terminal.ansiBrightCyan":"#4cd1e0","terminal.ansiBrightGreen":"#a5e075","terminal.ansiBrightMagenta":"#de73ff","terminal.ansiBrightRed":"#ff616e","terminal.ansiBrightWhite":"#e6e6e6","terminal.ansiBrightYellow":"#f0a45d","terminal.ansiCyan":"#42b3c2","terminal.ansiGreen":"#8cc265","terminal.ansiMagenta":"#c162de","terminal.ansiRed":"#e05561","terminal.ansiWhite":"#d7dae0","terminal.ansiYellow":"#d18f52","terminal.background":"#282c34","terminal.border":"#3e4452","terminal.foreground":"#abb2bf","terminal.selectionBackground":"#abb2bf30","textBlockQuote.background":"#2e3440","textBlockQuote.border":"#4b5362","textLink.foreground":"#61afef","textPreformat.foreground":"#d19a66","titleBar.activeBackground":"#282c34","titleBar.activeForeground":"#9da5b4","titleBar.inactiveBackground":"#282c34","titleBar.inactiveForeground":"#6b717d","tree.indentGuidesStroke":"#ffffff1d","walkThrough.embeddedEditorBackground":"#2e3440","welcomePage.buttonHoverBackground":"#404754"},WD="C4A Dark",e6="c4a-dark",t6=!0,n6={"annotation:dart":{foreground:"#d19a66"},enumMember:{foreground:"#56b6c2"},macro:{foreground:"#d19a66"},memberOperatorOverload:{foreground:"#c678dd"},"parameter.label:dart":{foreground:"#abb2bf"},"property:dart":{foreground:"#d19a66"},tomlArrayKey:{foreground:"#e5c07b"},"variable.constant":{foreground:"#d19a66"},"variable.defaultLibrary":{foreground:"#e5c07b"},"variable:dart":{foreground:"#d19a66"}},r6=JSON.parse('[{"scope":"meta.embedded","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.definition.delayed.unison,punctuation.definition.list.begin.unison,punctuation.definition.list.end.unison,punctuation.definition.ability.begin.unison,punctuation.definition.ability.end.unison,punctuation.operator.assignment.as.unison,punctuation.separator.pipe.unison,punctuation.separator.delimiter.unison,punctuation.definition.hash.unison","settings":{"foreground":"#e06c75"}},{"scope":"variable.other.generic-type.haskell","settings":{"foreground":"#c678dd"}},{"scope":"storage.type.haskell","settings":{"foreground":"#d19a66"}},{"scope":"support.variable.magic.python","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python","settings":{"foreground":"#abb2bf"}},{"scope":"variable.parameter.function.language.special.self.python","settings":{"foreground":"#e5c07b"}},{"scope":"variable.parameter.function.language.special.cls.python","settings":{"foreground":"#e5c07b"}},{"scope":"storage.modifier.lifetime.rust","settings":{"foreground":"#abb2bf"}},{"scope":"support.function.std.rust","settings":{"foreground":"#61afef"}},{"scope":"entity.name.lifetime.rust","settings":{"foreground":"#e5c07b"}},{"scope":"variable.language.rust","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.edge","settings":{"foreground":"#c678dd"}},{"scope":"constant.other.character-class.regexp","settings":{"foreground":"#e06c75"}},{"scope":["keyword.operator.word"],"settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#d19a66"}},{"scope":"variable.parameter.function","settings":{"foreground":"#abb2bf"}},{"scope":"comment markup.link","settings":{"foreground":"#5c6370"}},{"scope":"markup.changed.diff","settings":{"foreground":"#e5c07b"}},{"scope":"meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff","settings":{"foreground":"#61afef"}},{"scope":"markup.inserted.diff","settings":{"foreground":"#98c379"}},{"scope":"markup.deleted.diff","settings":{"foreground":"#e06c75"}},{"scope":"meta.function.c,meta.function.cpp","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.block.begin.bracket.curly.cpp,punctuation.section.block.end.bracket.curly.cpp,punctuation.terminator.statement.c,punctuation.section.block.begin.bracket.curly.c,punctuation.section.block.end.bracket.curly.c,punctuation.section.parens.begin.bracket.round.c,punctuation.section.parens.end.bracket.round.c,punctuation.section.parameters.begin.bracket.round.c,punctuation.section.parameters.end.bracket.round.c","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.separator.key-value","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.expression.import","settings":{"foreground":"#61afef"}},{"scope":"support.constant.math","settings":{"foreground":"#e5c07b"}},{"scope":"support.constant.property.math","settings":{"foreground":"#d19a66"}},{"scope":"variable.other.constant","settings":{"foreground":"#e5c07b"}},{"scope":["storage.type.annotation.java","storage.type.object.array.java"],"settings":{"foreground":"#e5c07b"}},{"scope":"source.java","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.block.begin.java,punctuation.section.block.end.java,punctuation.definition.method-parameters.begin.java,punctuation.definition.method-parameters.end.java,meta.method.identifier.java,punctuation.section.method.begin.java,punctuation.section.method.end.java,punctuation.terminator.java,punctuation.section.class.begin.java,punctuation.section.class.end.java,punctuation.section.inner-class.begin.java,punctuation.section.inner-class.end.java,meta.method-call.java,punctuation.section.class.begin.bracket.curly.java,punctuation.section.class.end.bracket.curly.java,punctuation.section.method.begin.bracket.curly.java,punctuation.section.method.end.bracket.curly.java,punctuation.separator.period.java,punctuation.bracket.angle.java,punctuation.definition.annotation.java,meta.method.body.java","settings":{"foreground":"#abb2bf"}},{"scope":"meta.method.java","settings":{"foreground":"#61afef"}},{"scope":"storage.modifier.import.java,storage.type.java,storage.type.generic.java","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.operator.instanceof.java","settings":{"foreground":"#c678dd"}},{"scope":"meta.definition.variable.name.java","settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.logical","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.bitwise","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.channel","settings":{"foreground":"#56b6c2"}},{"scope":"support.constant.property-value.scss,support.constant.property-value.css","settings":{"foreground":"#d19a66"}},{"scope":"keyword.operator.css,keyword.operator.scss,keyword.operator.less","settings":{"foreground":"#56b6c2"}},{"scope":"support.constant.color.w3c-standard-color-name.css,support.constant.color.w3c-standard-color-name.scss","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.separator.list.comma.css","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.color.w3c-standard-color-name.css","settings":{"foreground":"#d19a66"}},{"scope":"support.type.vendored.property-name.css","settings":{"foreground":"#56b6c2"}},{"scope":"support.module.node,support.type.object.module,support.module.node","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.type.module","settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.json","settings":{"foreground":"#d19a66"}},{"scope":["keyword.operator.expression.instanceof","keyword.operator.new","keyword.operator.ternary","keyword.operator.optional","keyword.operator.expression.keyof"],"settings":{"foreground":"#c678dd"}},{"scope":"support.type.object.console","settings":{"foreground":"#e06c75"}},{"scope":"support.variable.property.process","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.function,support.function.console","settings":{"foreground":"#61afef"}},{"scope":"keyword.operator.misc.rust","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.sigil.rust","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.delete","settings":{"foreground":"#c678dd"}},{"scope":"support.type.object.dom","settings":{"foreground":"#56b6c2"}},{"scope":"support.variable.dom,support.variable.property.dom","settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.arithmetic,keyword.operator.comparison,keyword.operator.decrement,keyword.operator.increment,keyword.operator.relational","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.assignment.c,keyword.operator.comparison.c,keyword.operator.c,keyword.operator.increment.c,keyword.operator.decrement.c,keyword.operator.bitwise.shift.c,keyword.operator.assignment.cpp,keyword.operator.comparison.cpp,keyword.operator.cpp,keyword.operator.increment.cpp,keyword.operator.decrement.cpp,keyword.operator.bitwise.shift.cpp","settings":{"foreground":"#c678dd"}},{"scope":"punctuation.separator.delimiter","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.separator.c,punctuation.separator.cpp","settings":{"foreground":"#c678dd"}},{"scope":"support.type.posix-reserved.c,support.type.posix-reserved.cpp","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.sizeof.c,keyword.operator.sizeof.cpp","settings":{"foreground":"#c678dd"}},{"scope":"variable.parameter.function.language.python","settings":{"foreground":"#d19a66"}},{"scope":"support.type.python","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.logical.python","settings":{"foreground":"#c678dd"}},{"scope":"variable.parameter.function.python","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python","settings":{"foreground":"#abb2bf"}},{"scope":"meta.function-call.generic.python","settings":{"foreground":"#61afef"}},{"scope":"constant.character.format.placeholder.other.python","settings":{"foreground":"#d19a66"}},{"scope":"keyword.operator","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.assignment.compound","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts","settings":{"foreground":"#56b6c2"}},{"scope":"keyword","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.namespace","settings":{"foreground":"#e5c07b"}},{"scope":"variable","settings":{"foreground":"#e06c75"}},{"scope":"variable.c","settings":{"foreground":"#abb2bf"}},{"scope":"variable.language","settings":{"foreground":"#e5c07b"}},{"scope":"token.variable.parameter.java","settings":{"foreground":"#abb2bf"}},{"scope":"import.storage.java","settings":{"foreground":"#e5c07b"}},{"scope":"token.package.keyword","settings":{"foreground":"#c678dd"}},{"scope":"token.package","settings":{"foreground":"#abb2bf"}},{"scope":["entity.name.function","meta.require","support.function.any-method","variable.function"],"settings":{"foreground":"#61afef"}},{"scope":"entity.name.type.namespace","settings":{"foreground":"#e5c07b"}},{"scope":"support.class, entity.name.type.class","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.class.identifier.namespace.type","settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.class","variable.other.class.js","variable.other.class.ts"],"settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.class.php","settings":{"foreground":"#e06c75"}},{"scope":"entity.name.type","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.control","settings":{"foreground":"#c678dd"}},{"scope":"control.elements, keyword.operator.less","settings":{"foreground":"#d19a66"}},{"scope":"keyword.other.special-method","settings":{"foreground":"#61afef"}},{"scope":"storage","settings":{"foreground":"#c678dd"}},{"scope":"token.storage","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.expression.delete,keyword.operator.expression.in,keyword.operator.expression.of,keyword.operator.expression.instanceof,keyword.operator.new,keyword.operator.expression.typeof,keyword.operator.expression.void","settings":{"foreground":"#c678dd"}},{"scope":"token.storage.type.java","settings":{"foreground":"#e5c07b"}},{"scope":"support.function","settings":{"foreground":"#56b6c2"}},{"scope":"support.type.property-name","settings":{"foreground":"#abb2bf"}},{"scope":"support.type.property-name.toml, support.type.property-name.table.toml, support.type.property-name.array.toml","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.property-value","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.font-name","settings":{"foreground":"#d19a66"}},{"scope":"meta.tag","settings":{"foreground":"#abb2bf"}},{"scope":"string","settings":{"foreground":"#98c379"}},{"scope":"constant.other.symbol","settings":{"foreground":"#56b6c2"}},{"scope":"constant.numeric","settings":{"foreground":"#d19a66"}},{"scope":"constant","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.constant","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.tag","settings":{"foreground":"#e06c75"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#d19a66"}},{"scope":"entity.other.attribute-name.id","settings":{"foreground":"#61afef"}},{"scope":"entity.other.attribute-name.class.css","settings":{"foreground":"#d19a66"}},{"scope":"meta.selector","settings":{"foreground":"#c678dd"}},{"scope":"markup.heading","settings":{"foreground":"#ef6f2e"}},{"scope":"markup.heading punctuation.definition.heading, entity.name.section","settings":{"foreground":"#ef6f2e"}},{"scope":"keyword.other.unit","settings":{"foreground":"#e06c75"}},{"scope":"markup.bold,todo.bold","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.bold","settings":{"foreground":"#e5c07b"}},{"scope":"markup.italic, punctuation.definition.italic,todo.emphasis","settings":{"foreground":"#c678dd"}},{"scope":"emphasis md","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.section.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.heading.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#e5c07b"}},{"scope":"markup.heading.setext","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.bold.markdown","settings":{"foreground":"#d19a66"}},{"scope":"markup.inline.raw.markdown","settings":{"foreground":"#98c379"}},{"scope":"markup.inline.raw.string.markdown","settings":{"foreground":"#98c379"}},{"scope":"punctuation.definition.raw.markdown","settings":{"foreground":"#e5c07b"}},{"scope":"punctuation.definition.list.markdown","settings":{"foreground":"#e5c07b"}},{"scope":["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","punctuation.definition.metadata.markdown"],"settings":{"foreground":"#e06c75"}},{"scope":["beginning.punctuation.definition.list.markdown"],"settings":{"foreground":"#e06c75"}},{"scope":"punctuation.definition.metadata.markdown","settings":{"foreground":"#e06c75"}},{"scope":"markup.underline.link.markdown,markup.underline.link.image.markdown","settings":{"foreground":"#c678dd"}},{"scope":"string.other.link.title.markdown,string.other.link.description.markdown","settings":{"foreground":"#61afef"}},{"scope":"markup.raw.monospace.asciidoc","settings":{"foreground":"#98c379"}},{"scope":"punctuation.definition.asciidoc","settings":{"foreground":"#e5c07b"}},{"scope":"markup.list.asciidoc","settings":{"foreground":"#e5c07b"}},{"scope":"markup.link.asciidoc,markup.other.url.asciidoc","settings":{"foreground":"#c678dd"}},{"scope":"string.unquoted.asciidoc,markup.other.url.asciidoc","settings":{"foreground":"#61afef"}},{"scope":"string.regexp","settings":{"foreground":"#56b6c2"}},{"scope":"punctuation.section.embedded, variable.interpolation","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.embedded.begin,punctuation.section.embedded.end","settings":{"foreground":"#c678dd"}},{"scope":"invalid.illegal","settings":{"foreground":"#ffffff"}},{"scope":"invalid.illegal.bad-ampersand.html","settings":{"foreground":"#abb2bf"}},{"scope":"invalid.illegal.unrecognized-tag.html","settings":{"foreground":"#e06c75"}},{"scope":"invalid.broken","settings":{"foreground":"#ffffff"}},{"scope":"invalid.deprecated","settings":{"foreground":"#ffffff"}},{"scope":"invalid.deprecated.entity.other.attribute-name.html","settings":{"foreground":"#d19a66"}},{"scope":"invalid.unimplemented","settings":{"foreground":"#ffffff"}},{"scope":"source.json meta.structure.dictionary.json > string.quoted.json","settings":{"foreground":"#e06c75"}},{"scope":"source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string","settings":{"foreground":"#e06c75"}},{"scope":"source.json meta.structure.dictionary.json > value.json > string.quoted.json,source.json meta.structure.array.json > value.json > string.quoted.json,source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation,source.json meta.structure.array.json > value.json > string.quoted.json > punctuation","settings":{"foreground":"#98c379"}},{"scope":"source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json","settings":{"foreground":"#56b6c2"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#e06c75"}},{"scope":"support.type.property-name.json punctuation","settings":{"foreground":"#e06c75"}},{"scope":"text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade","settings":{"foreground":"#c678dd"}},{"scope":"text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade","settings":{"foreground":"#c678dd"}},{"scope":"support.other.namespace.use.php,support.other.namespace.use-as.php,entity.other.alias.php,meta.interface.php","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.operator.error-control.php","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.type.php","settings":{"foreground":"#c678dd"}},{"scope":"punctuation.section.array.begin.php","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.section.array.end.php","settings":{"foreground":"#abb2bf"}},{"scope":"invalid.illegal.non-null-typehinted.php","settings":{"foreground":"#f44747"}},{"scope":"storage.type.php,meta.other.type.phpdoc.php,keyword.other.type.php,keyword.other.array.phpdoc.php","settings":{"foreground":"#e5c07b"}},{"scope":"meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php","settings":{"foreground":"#61afef"}},{"scope":"punctuation.definition.parameters.begin.bracket.round.php,punctuation.definition.parameters.end.bracket.round.php,punctuation.separator.delimiter.php,punctuation.section.scope.begin.php,punctuation.section.scope.end.php,punctuation.terminator.expression.php,punctuation.definition.arguments.begin.bracket.round.php,punctuation.definition.arguments.end.bracket.round.php,punctuation.definition.storage-type.begin.bracket.round.php,punctuation.definition.storage-type.end.bracket.round.php,punctuation.definition.array.begin.bracket.round.php,punctuation.definition.array.end.bracket.round.php,punctuation.definition.begin.bracket.round.php,punctuation.definition.end.bracket.round.php,punctuation.definition.begin.bracket.curly.php,punctuation.definition.end.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php,punctuation.definition.section.switch-block.start.bracket.curly.php,punctuation.definition.section.switch-block.begin.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.core.rust","settings":{"foreground":"#d19a66"}},{"scope":"support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.goto-label.php,support.other.php","settings":{"foreground":"#61afef"}},{"scope":"keyword.operator.logical.php,keyword.operator.bitwise.php,keyword.operator.arithmetic.php","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.regexp.php","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.comparison.php","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.heredoc.php,keyword.operator.nowdoc.php","settings":{"foreground":"#c678dd"}},{"scope":"meta.function.decorator.python","settings":{"foreground":"#61afef"}},{"scope":"support.token.decorator.python,meta.function.decorator.identifier.python","settings":{"foreground":"#56b6c2"}},{"scope":"function.parameter","settings":{"foreground":"#abb2bf"}},{"scope":"function.brace","settings":{"foreground":"#abb2bf"}},{"scope":"function.parameter.ruby, function.parameter.cs","settings":{"foreground":"#abb2bf"}},{"scope":"constant.language.symbol.ruby","settings":{"foreground":"#56b6c2"}},{"scope":"constant.language.symbol.hashkey.ruby","settings":{"foreground":"#56b6c2"}},{"scope":"rgb-value","settings":{"foreground":"#56b6c2"}},{"scope":"inline-color-decoration rgb-value","settings":{"foreground":"#d19a66"}},{"scope":"less rgb-value","settings":{"foreground":"#d19a66"}},{"scope":"selector.sass","settings":{"foreground":"#e06c75"}},{"scope":"support.type.primitive.ts,support.type.builtin.ts,support.type.primitive.tsx,support.type.builtin.tsx","settings":{"foreground":"#e5c07b"}},{"scope":"block.scope.end,block.scope.begin","settings":{"foreground":"#abb2bf"}},{"scope":"storage.type.cs","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.variable.local.cs","settings":{"foreground":"#e06c75"}},{"scope":"token.info-token","settings":{"foreground":"#61afef"}},{"scope":"token.warn-token","settings":{"foreground":"#d19a66"}},{"scope":"token.error-token","settings":{"foreground":"#f44747"}},{"scope":"token.debug-token","settings":{"foreground":"#c678dd"}},{"scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#c678dd"}},{"scope":["meta.template.expression"],"settings":{"foreground":"#abb2bf"}},{"scope":["keyword.operator.module"],"settings":{"foreground":"#c678dd"}},{"scope":["support.type.type.flowtype"],"settings":{"foreground":"#61afef"}},{"scope":["support.type.primitive"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.property.object"],"settings":{"foreground":"#e06c75"}},{"scope":["variable.parameter.function.js"],"settings":{"foreground":"#e06c75"}},{"scope":["keyword.other.template.begin"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.template.end"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.substitution.begin"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.substitution.end"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.operator.assignment"],"settings":{"foreground":"#56b6c2"}},{"scope":["keyword.operator.assignment.go"],"settings":{"foreground":"#e5c07b"}},{"scope":["keyword.operator.arithmetic.go","keyword.operator.address.go"],"settings":{"foreground":"#c678dd"}},{"scope":["keyword.operator.arithmetic.c","keyword.operator.arithmetic.cpp"],"settings":{"foreground":"#c678dd"}},{"scope":["entity.name.package.go"],"settings":{"foreground":"#e5c07b"}},{"scope":["support.type.prelude.elm"],"settings":{"foreground":"#56b6c2"}},{"scope":["support.constant.elm"],"settings":{"foreground":"#d19a66"}},{"scope":["punctuation.quasi.element"],"settings":{"foreground":"#c678dd"}},{"scope":["constant.character.entity"],"settings":{"foreground":"#e06c75"}},{"scope":["entity.other.attribute-name.pseudo-element","entity.other.attribute-name.pseudo-class"],"settings":{"foreground":"#56b6c2"}},{"scope":["entity.global.clojure"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.symbol.clojure"],"settings":{"foreground":"#e06c75"}},{"scope":["constant.keyword.clojure"],"settings":{"foreground":"#56b6c2"}},{"scope":["meta.arguments.coffee","variable.parameter.function.coffee"],"settings":{"foreground":"#e06c75"}},{"scope":["source.ini"],"settings":{"foreground":"#98c379"}},{"scope":["meta.scope.prerequisites.makefile"],"settings":{"foreground":"#e06c75"}},{"scope":["source.makefile"],"settings":{"foreground":"#e5c07b"}},{"scope":["storage.modifier.import.groovy"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.method.groovy"],"settings":{"foreground":"#61afef"}},{"scope":["meta.definition.variable.name.groovy"],"settings":{"foreground":"#e06c75"}},{"scope":["meta.definition.class.inherited.classes.groovy"],"settings":{"foreground":"#98c379"}},{"scope":["support.variable.semantic.hlsl"],"settings":{"foreground":"#e5c07b"}},{"scope":["support.type.texture.hlsl","support.type.sampler.hlsl","support.type.object.hlsl","support.type.object.rw.hlsl","support.type.fx.hlsl","support.type.object.hlsl"],"settings":{"foreground":"#c678dd"}},{"scope":["text.variable","text.bracketed"],"settings":{"foreground":"#e06c75"}},{"scope":["support.type.swift","support.type.vb.asp"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.function.xi"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.class.xi"],"settings":{"foreground":"#56b6c2"}},{"scope":["constant.character.character-class.regexp.xi"],"settings":{"foreground":"#e06c75"}},{"scope":["constant.regexp.xi"],"settings":{"foreground":"#c678dd"}},{"scope":["keyword.control.xi"],"settings":{"foreground":"#56b6c2"}},{"scope":["invalid.xi"],"settings":{"foreground":"#abb2bf"}},{"scope":["beginning.punctuation.definition.quote.markdown.xi"],"settings":{"foreground":"#98c379"}},{"scope":["beginning.punctuation.definition.list.markdown.xi"],"settings":{"foreground":"#7f848e"}},{"scope":["constant.character.xi"],"settings":{"foreground":"#61afef"}},{"scope":["accent.xi"],"settings":{"foreground":"#61afef"}},{"scope":["wikiword.xi"],"settings":{"foreground":"#d19a66"}},{"scope":["constant.other.color.rgb-value.xi"],"settings":{"foreground":"#ffffff"}},{"scope":["punctuation.definition.tag.xi"],"settings":{"foreground":"#5c6370"}},{"scope":["entity.name.label.cs","entity.name.scope-resolution.function.call","entity.name.scope-resolution.function.definition"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.label.cs","markup.heading.setext.1.markdown","markup.heading.setext.2.markdown"],"settings":{"foreground":"#ef6f2e"}},{"scope":[" meta.brace.square"],"settings":{"foreground":"#abb2bf"}},{"scope":"comment, punctuation.definition.comment","settings":{"fontStyle":"italic","foreground":"#7f848e"}},{"scope":"markup.quote.markdown","settings":{"foreground":"#5c6370"}},{"scope":"punctuation.definition.block.sequence.item.yaml","settings":{"foreground":"#abb2bf"}},{"scope":["constant.language.symbol.elixir","constant.language.symbol.double-quoted.elixir"],"settings":{"foreground":"#56b6c2"}},{"scope":["entity.name.variable.parameter.cs"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.variable.field.cs"],"settings":{"foreground":"#e06c75"}},{"scope":"markup.deleted","settings":{"foreground":"#e06c75"}},{"scope":"markup.inserted","settings":{"foreground":"#98c379"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#BE5046"}},{"scope":["support.other.namespace.php"],"settings":{"foreground":"#abb2bf"}},{"scope":["variable.parameter.function.latex"],"settings":{"foreground":"#e06c75"}},{"scope":["variable.other.object"],"settings":{"foreground":"#e5c07b"}},{"scope":["variable.other.constant.property"],"settings":{"foreground":"#e06c75"}},{"scope":["entity.other.inherited-class"],"settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.readwrite.c","settings":{"foreground":"#e06c75"}},{"scope":"entity.name.variable.parameter.php,punctuation.separator.colon.php,constant.other.php","settings":{"foreground":"#abb2bf"}},{"scope":["constant.numeric.decimal.asm.x86_64"],"settings":{"foreground":"#c678dd"}},{"scope":["support.other.parenthesis.regexp"],"settings":{"foreground":"#d19a66"}},{"scope":["constant.character.escape"],"settings":{"foreground":"#56b6c2"}},{"scope":["string.regexp"],"settings":{"foreground":"#e06c75"}},{"scope":["log.info"],"settings":{"foreground":"#98c379"}},{"scope":["log.warning"],"settings":{"foreground":"#e5c07b"}},{"scope":["log.error"],"settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.expression.is","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.label","settings":{"foreground":"#e06c75"}},{"scope":["support.class.math.block.environment.latex","constant.other.general.math.tex"],"settings":{"foreground":"#61afef"}},{"scope":["constant.character.math.tex"],"settings":{"foreground":"#98c379"}},{"scope":"entity.other.attribute-name.js,entity.other.attribute-name.ts,entity.other.attribute-name.jsx,entity.other.attribute-name.tsx,variable.parameter,variable.language.super","settings":{"fontStyle":"italic"}},{"scope":"comment.line.double-slash,comment.block.documentation","settings":{"fontStyle":"italic"}},{"scope":"markup.italic.markdown","settings":{"fontStyle":"italic"}}]'),a6="dark",s6={colors:JD,displayName:WD,name:e6,semanticHighlighting:t6,semanticTokenColors:n6,tokenColors:r6,type:a6},o6={"activityBar.background":"#FAFAFA","activityBar.foreground":"#121417","activityBarBadge.background":"#526FFF","activityBarBadge.foreground":"#FFFFFF","badge.background":"#526FFF","badge.foreground":"#FFFFFF","button.background":"#5871EF","button.foreground":"#FFFFFF","button.hoverBackground":"#6B83ED","diffEditor.insertedTextBackground":"#00809B33","dropdown.background":"#FFFFFF","dropdown.border":"#DBDBDC","editor.background":"#FAFAFA","editor.findMatchHighlightBackground":"#526FFF33","editor.foreground":"#383A42","editor.lineHighlightBackground":"#383A420C","editor.selectionBackground":"#E5E5E6","editorCursor.foreground":"#526FFF","editorGroup.background":"#EAEAEB","editorGroup.border":"#DBDBDC","editorGroupHeader.tabsBackground":"#EAEAEB","editorHoverWidget.background":"#EAEAEB","editorHoverWidget.border":"#DBDBDC","editorIndentGuide.activeBackground":"#626772","editorIndentGuide.background":"#383A4233","editorInlayHint.background":"#F5F5F5","editorInlayHint.foreground":"#AFB2BB","editorLineNumber.activeForeground":"#383A42","editorLineNumber.foreground":"#9D9D9F","editorRuler.foreground":"#383A4233","editorSuggestWidget.background":"#EAEAEB","editorSuggestWidget.border":"#DBDBDC","editorSuggestWidget.selectedBackground":"#FFFFFF","editorWhitespace.foreground":"#383A4233","editorWidget.background":"#EAEAEB","editorWidget.border":"#E5E5E6","extensionButton.prominentBackground":"#3BBA54","extensionButton.prominentHoverBackground":"#4CC263",focusBorder:"#526FFF","input.background":"#FFFFFF","input.border":"#DBDBDC","list.activeSelectionBackground":"#DBDBDC","list.activeSelectionForeground":"#232324","list.focusBackground":"#DBDBDC","list.highlightForeground":"#121417","list.hoverBackground":"#DBDBDC66","list.inactiveSelectionBackground":"#DBDBDC","list.inactiveSelectionForeground":"#232324","notebook.cellEditorBackground":"#F5F5F5","notification.background":"#333333","peekView.border":"#526FFF","peekViewEditor.background":"#FFFFFF","peekViewResult.background":"#EAEAEB","peekViewResult.selectionBackground":"#DBDBDC","peekViewTitle.background":"#FFFFFF","pickerGroup.border":"#526FFF","scrollbarSlider.activeBackground":"#747D9180","scrollbarSlider.background":"#4E566680","scrollbarSlider.hoverBackground":"#5A637580","sideBar.background":"#EAEAEB","sideBarSectionHeader.background":"#FAFAFA","statusBar.background":"#EAEAEB","statusBar.debuggingForeground":"#FFFFFF","statusBar.foreground":"#424243","statusBar.noFolderBackground":"#EAEAEB","statusBarItem.hoverBackground":"#DBDBDC","tab.activeBackground":"#FAFAFA","tab.activeForeground":"#121417","tab.border":"#DBDBDC","tab.inactiveBackground":"#EAEAEB","titleBar.activeBackground":"#EAEAEB","titleBar.activeForeground":"#424243","titleBar.inactiveBackground":"#EAEAEB","titleBar.inactiveForeground":"#424243"},i6="C4A Light",l6="c4a-light",c6=JSON.parse('[{"scope":["comment"],"settings":{"fontStyle":"italic","foreground":"#A0A1A7"}},{"scope":["comment markup.link"],"settings":{"foreground":"#A0A1A7"}},{"scope":["entity.name.type"],"settings":{"foreground":"#C18401"}},{"scope":["entity.other.inherited-class"],"settings":{"foreground":"#C18401"}},{"scope":["keyword"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.control"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":["keyword.other.special-method"],"settings":{"foreground":"#4078F2"}},{"scope":["keyword.other.unit"],"settings":{"foreground":"#986801"}},{"scope":["storage"],"settings":{"foreground":"#A626A4"}},{"scope":["storage.type.annotation","storage.type.primitive"],"settings":{"foreground":"#A626A4"}},{"scope":["storage.modifier.package","storage.modifier.import"],"settings":{"foreground":"#383A42"}},{"scope":["constant"],"settings":{"foreground":"#986801"}},{"scope":["constant.variable"],"settings":{"foreground":"#986801"}},{"scope":["constant.character.escape"],"settings":{"foreground":"#0184BC"}},{"scope":["constant.numeric"],"settings":{"foreground":"#986801"}},{"scope":["constant.other.color"],"settings":{"foreground":"#0184BC"}},{"scope":["constant.other.symbol"],"settings":{"foreground":"#0184BC"}},{"scope":["variable"],"settings":{"foreground":"#E45649"}},{"scope":["variable.interpolation"],"settings":{"foreground":"#CA1243"}},{"scope":["variable.parameter"],"settings":{"foreground":"#383A42"}},{"scope":["string"],"settings":{"foreground":"#50A14F"}},{"scope":["string > source","string embedded"],"settings":{"foreground":"#383A42"}},{"scope":["string.regexp"],"settings":{"foreground":"#0184BC"}},{"scope":["string.regexp source.ruby.embedded"],"settings":{"foreground":"#C18401"}},{"scope":["string.other.link"],"settings":{"foreground":"#E45649"}},{"scope":["punctuation.definition.comment"],"settings":{"foreground":"#A0A1A7"}},{"scope":["punctuation.definition.method-parameters","punctuation.definition.function-parameters","punctuation.definition.parameters","punctuation.definition.separator","punctuation.definition.seperator","punctuation.definition.array"],"settings":{"foreground":"#383A42"}},{"scope":["punctuation.definition.heading","punctuation.definition.identity"],"settings":{"foreground":"#4078F2"}},{"scope":["punctuation.definition.bold"],"settings":{"fontStyle":"bold","foreground":"#C18401"}},{"scope":["punctuation.definition.italic"],"settings":{"fontStyle":"italic","foreground":"#A626A4"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#CA1243"}},{"scope":["punctuation.section.method","punctuation.section.class","punctuation.section.inner-class"],"settings":{"foreground":"#383A42"}},{"scope":["support.class"],"settings":{"foreground":"#C18401"}},{"scope":["support.type"],"settings":{"foreground":"#0184BC"}},{"scope":["support.function"],"settings":{"foreground":"#0184BC"}},{"scope":["support.function.any-method"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.function"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.class","entity.name.type.class"],"settings":{"foreground":"#C18401"}},{"scope":["entity.name.section"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.tag"],"settings":{"foreground":"#E45649"}},{"scope":["entity.other.attribute-name"],"settings":{"foreground":"#986801"}},{"scope":["entity.other.attribute-name.id"],"settings":{"foreground":"#4078F2"}},{"scope":["meta.class"],"settings":{"foreground":"#C18401"}},{"scope":["meta.class.body"],"settings":{"foreground":"#383A42"}},{"scope":["meta.method-call","meta.method"],"settings":{"foreground":"#383A42"}},{"scope":["meta.definition.variable"],"settings":{"foreground":"#E45649"}},{"scope":["meta.link"],"settings":{"foreground":"#986801"}},{"scope":["meta.require"],"settings":{"foreground":"#4078F2"}},{"scope":["meta.selector"],"settings":{"foreground":"#A626A4"}},{"scope":["meta.separator"],"settings":{"foreground":"#383A42"}},{"scope":["meta.tag"],"settings":{"foreground":"#383A42"}},{"scope":["underline"],"settings":{"text-decoration":"underline"}},{"scope":["none"],"settings":{"foreground":"#383A42"}},{"scope":["invalid.deprecated"],"settings":{"background":"#F2A60D","foreground":"#000000"}},{"scope":["invalid.illegal"],"settings":{"background":"#FF1414","foreground":"#50A14F"}},{"scope":["markup.bold"],"settings":{"fontStyle":"bold","foreground":"#986801"}},{"scope":["markup.changed"],"settings":{"foreground":"#A626A4"}},{"scope":["markup.deleted"],"settings":{"foreground":"#E45649"}},{"scope":["markup.italic"],"settings":{"fontStyle":"italic","foreground":"#A626A4"}},{"scope":["markup.heading"],"settings":{"foreground":"#ef6f2e"}},{"scope":["markup.heading punctuation.definition.heading"],"settings":{"foreground":"#ef6f2e"}},{"scope":["markup.link"],"settings":{"foreground":"#0184BC"}},{"scope":["markup.inserted"],"settings":{"foreground":"#50A14F"}},{"scope":["markup.quote"],"settings":{"foreground":"#986801"}},{"scope":["markup.raw"],"settings":{"foreground":"#50A14F"}},{"scope":["source.c keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.cpp keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.cs keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.css property-name","source.css property-value"],"settings":{"foreground":"#696C77"}},{"scope":["source.css property-name.support","source.css property-value.support"],"settings":{"foreground":"#383A42"}},{"scope":["source.elixir source.embedded.source"],"settings":{"foreground":"#383A42"}},{"scope":["source.elixir constant.language","source.elixir constant.numeric","source.elixir constant.definition"],"settings":{"foreground":"#4078F2"}},{"scope":["source.elixir variable.definition","source.elixir variable.anonymous"],"settings":{"foreground":"#A626A4"}},{"scope":["source.elixir parameter.variable.function"],"settings":{"fontStyle":"italic","foreground":"#986801"}},{"scope":["source.elixir quoted"],"settings":{"foreground":"#50A14F"}},{"scope":["source.elixir keyword.special-method","source.elixir embedded.section","source.elixir embedded.source.empty"],"settings":{"foreground":"#E45649"}},{"scope":["source.elixir readwrite.module punctuation"],"settings":{"foreground":"#E45649"}},{"scope":["source.elixir regexp.section","source.elixir regexp.string"],"settings":{"foreground":"#CA1243"}},{"scope":["source.elixir separator","source.elixir keyword.operator"],"settings":{"foreground":"#986801"}},{"scope":["source.elixir variable.constant"],"settings":{"foreground":"#C18401"}},{"scope":["source.elixir array","source.elixir scope","source.elixir section"],"settings":{"foreground":"#696C77"}},{"scope":["source.gfm markup"],"settings":{"-webkit-font-smoothing":"auto"}},{"scope":["source.gfm link entity"],"settings":{"foreground":"#4078F2"}},{"scope":["source.go storage.type.string"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ini keyword.other.definition.ini"],"settings":{"foreground":"#E45649"}},{"scope":["source.java storage.modifier.import"],"settings":{"foreground":"#C18401"}},{"scope":["source.java storage.type"],"settings":{"foreground":"#C18401"}},{"scope":["source.java keyword.operator.instanceof"],"settings":{"foreground":"#A626A4"}},{"scope":["source.java-properties meta.key-pair"],"settings":{"foreground":"#E45649"}},{"scope":["source.java-properties meta.key-pair > punctuation"],"settings":{"foreground":"#383A42"}},{"scope":["source.js keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.js keyword.operator.delete","source.js keyword.operator.in","source.js keyword.operator.of","source.js keyword.operator.instanceof","source.js keyword.operator.new","source.js keyword.operator.typeof","source.js keyword.operator.void"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ts keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.flow keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.json meta.structure.dictionary.json > string.quoted.json"],"settings":{"foreground":"#E45649"}},{"scope":["source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string"],"settings":{"foreground":"#E45649"}},{"scope":["source.json meta.structure.dictionary.json > value.json > string.quoted.json","source.json meta.structure.array.json > value.json > string.quoted.json","source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation","source.json meta.structure.array.json > value.json > string.quoted.json > punctuation"],"settings":{"foreground":"#50A14F"}},{"scope":["source.json meta.structure.dictionary.json > constant.language.json","source.json meta.structure.array.json > constant.language.json"],"settings":{"foreground":"#0184BC"}},{"scope":["ng.interpolation"],"settings":{"foreground":"#E45649"}},{"scope":["ng.interpolation.begin","ng.interpolation.end"],"settings":{"foreground":"#4078F2"}},{"scope":["ng.interpolation function"],"settings":{"foreground":"#E45649"}},{"scope":["ng.interpolation function.begin","ng.interpolation function.end"],"settings":{"foreground":"#4078F2"}},{"scope":["ng.interpolation bool"],"settings":{"foreground":"#986801"}},{"scope":["ng.interpolation bracket"],"settings":{"foreground":"#383A42"}},{"scope":["ng.pipe","ng.operator"],"settings":{"foreground":"#383A42"}},{"scope":["ng.tag"],"settings":{"foreground":"#0184BC"}},{"scope":["ng.attribute-with-value attribute-name"],"settings":{"foreground":"#C18401"}},{"scope":["ng.attribute-with-value string"],"settings":{"foreground":"#A626A4"}},{"scope":["ng.attribute-with-value string.begin","ng.attribute-with-value string.end"],"settings":{"foreground":"#383A42"}},{"scope":["source.ruby constant.other.symbol > punctuation"],"settings":{"foreground":"inherit"}},{"scope":["source.php class.bracket"],"settings":{"foreground":"#383A42"}},{"scope":["source.python keyword.operator.logical.python"],"settings":{"foreground":"#A626A4"}},{"scope":["source.python variable.parameter"],"settings":{"foreground":"#986801"}},{"scope":"customrule","settings":{"foreground":"#383A42"}},{"scope":"support.type.property-name","settings":{"foreground":"#383A42"}},{"scope":"string.quoted.double punctuation","settings":{"foreground":"#50A14F"}},{"scope":"support.constant","settings":{"foreground":"#986801"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#E45649"}},{"scope":"support.type.property-name.json punctuation","settings":{"foreground":"#E45649"}},{"scope":["punctuation.separator.key-value.ts","punctuation.separator.key-value.js","punctuation.separator.key-value.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["source.js.embedded.html keyword.operator","source.ts.embedded.html keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["variable.other.readwrite.js","variable.other.readwrite.ts","variable.other.readwrite.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["support.variable.dom.js","support.variable.dom.ts"],"settings":{"foreground":"#E45649"}},{"scope":["support.variable.property.dom.js","support.variable.property.dom.ts"],"settings":{"foreground":"#E45649"}},{"scope":["meta.template.expression.js punctuation.definition","meta.template.expression.ts punctuation.definition"],"settings":{"foreground":"#CA1243"}},{"scope":["source.ts punctuation.definition.typeparameters","source.js punctuation.definition.typeparameters","source.tsx punctuation.definition.typeparameters"],"settings":{"foreground":"#383A42"}},{"scope":["source.ts punctuation.definition.block","source.js punctuation.definition.block","source.tsx punctuation.definition.block"],"settings":{"foreground":"#383A42"}},{"scope":["source.ts punctuation.separator.comma","source.js punctuation.separator.comma","source.tsx punctuation.separator.comma"],"settings":{"foreground":"#383A42"}},{"scope":["support.variable.property.js","support.variable.property.ts","support.variable.property.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["keyword.control.default.js","keyword.control.default.ts","keyword.control.default.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["keyword.operator.expression.instanceof.js","keyword.operator.expression.instanceof.ts","keyword.operator.expression.instanceof.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.operator.expression.of.js","keyword.operator.expression.of.ts","keyword.operator.expression.of.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["meta.brace.round.js","meta.array-binding-pattern-variable.js","meta.brace.square.js","meta.brace.round.ts","meta.array-binding-pattern-variable.ts","meta.brace.square.ts","meta.brace.round.tsx","meta.array-binding-pattern-variable.tsx","meta.brace.square.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["source.js punctuation.accessor","source.ts punctuation.accessor","source.tsx punctuation.accessor"],"settings":{"foreground":"#383A42"}},{"scope":["punctuation.terminator.statement.js","punctuation.terminator.statement.ts","punctuation.terminator.statement.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["meta.array-binding-pattern-variable.js variable.other.readwrite.js","meta.array-binding-pattern-variable.ts variable.other.readwrite.ts","meta.array-binding-pattern-variable.tsx variable.other.readwrite.tsx"],"settings":{"foreground":"#986801"}},{"scope":["source.js support.variable","source.ts support.variable","source.tsx support.variable"],"settings":{"foreground":"#E45649"}},{"scope":["variable.other.constant.property.js","variable.other.constant.property.ts","variable.other.constant.property.tsx"],"settings":{"foreground":"#986801"}},{"scope":["keyword.operator.new.ts","keyword.operator.new.j","keyword.operator.new.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ts keyword.operator","source.tsx keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["punctuation.separator.parameter.js","punctuation.separator.parameter.ts","punctuation.separator.parameter.tsx "],"settings":{"foreground":"#383A42"}},{"scope":["constant.language.import-export-all.js","constant.language.import-export-all.ts"],"settings":{"foreground":"#E45649"}},{"scope":["constant.language.import-export-all.jsx","constant.language.import-export-all.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["keyword.control.as.js","keyword.control.as.ts","keyword.control.as.jsx","keyword.control.as.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["variable.other.readwrite.alias.js","variable.other.readwrite.alias.ts","variable.other.readwrite.alias.jsx","variable.other.readwrite.alias.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["variable.other.constant.js","variable.other.constant.ts","variable.other.constant.jsx","variable.other.constant.tsx"],"settings":{"foreground":"#986801"}},{"scope":["meta.export.default.js variable.other.readwrite.js","meta.export.default.ts variable.other.readwrite.ts"],"settings":{"foreground":"#E45649"}},{"scope":["source.js meta.template.expression.js punctuation.accessor","source.ts meta.template.expression.ts punctuation.accessor","source.tsx meta.template.expression.tsx punctuation.accessor"],"settings":{"foreground":"#50A14F"}},{"scope":["source.js meta.import-equals.external.js keyword.operator","source.jsx meta.import-equals.external.jsx keyword.operator","source.ts meta.import-equals.external.ts keyword.operator","source.tsx meta.import-equals.external.tsx keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":"entity.name.type.module.js,entity.name.type.module.ts,entity.name.type.module.jsx,entity.name.type.module.tsx","settings":{"foreground":"#50A14F"}},{"scope":"meta.class.js,meta.class.ts,meta.class.jsx,meta.class.tsx","settings":{"foreground":"#383A42"}},{"scope":["meta.definition.property.js variable","meta.definition.property.ts variable","meta.definition.property.jsx variable","meta.definition.property.tsx variable"],"settings":{"foreground":"#383A42"}},{"scope":["meta.type.parameters.js support.type","meta.type.parameters.jsx support.type","meta.type.parameters.ts support.type","meta.type.parameters.tsx support.type"],"settings":{"foreground":"#383A42"}},{"scope":["source.js meta.tag.js keyword.operator","source.jsx meta.tag.jsx keyword.operator","source.ts meta.tag.ts keyword.operator","source.tsx meta.tag.tsx keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":["meta.tag.js punctuation.section.embedded","meta.tag.jsx punctuation.section.embedded","meta.tag.ts punctuation.section.embedded","meta.tag.tsx punctuation.section.embedded"],"settings":{"foreground":"#383A42"}},{"scope":["meta.array.literal.js variable","meta.array.literal.jsx variable","meta.array.literal.ts variable","meta.array.literal.tsx variable"],"settings":{"foreground":"#C18401"}},{"scope":["support.type.object.module.js","support.type.object.module.jsx","support.type.object.module.ts","support.type.object.module.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["constant.language.json"],"settings":{"foreground":"#0184BC"}},{"scope":["variable.other.constant.object.js","variable.other.constant.object.jsx","variable.other.constant.object.ts","variable.other.constant.object.tsx"],"settings":{"foreground":"#986801"}},{"scope":["storage.type.property.js","storage.type.property.jsx","storage.type.property.ts","storage.type.property.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["meta.template.expression.js string.quoted punctuation.definition","meta.template.expression.jsx string.quoted punctuation.definition","meta.template.expression.ts string.quoted punctuation.definition","meta.template.expression.tsx string.quoted punctuation.definition"],"settings":{"foreground":"#50A14F"}},{"scope":["meta.template.expression.js string.template punctuation.definition.string.template","meta.template.expression.jsx string.template punctuation.definition.string.template","meta.template.expression.ts string.template punctuation.definition.string.template","meta.template.expression.tsx string.template punctuation.definition.string.template"],"settings":{"foreground":"#50A14F"}},{"scope":["keyword.operator.expression.in.js","keyword.operator.expression.in.jsx","keyword.operator.expression.in.ts","keyword.operator.expression.in.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["variable.other.object.js","variable.other.object.ts"],"settings":{"foreground":"#383A42"}},{"scope":["meta.object-literal.key.js","meta.object-literal.key.ts"],"settings":{"foreground":"#E45649"}},{"scope":"source.python constant.other","settings":{"foreground":"#383A42"}},{"scope":"source.python constant","settings":{"foreground":"#986801"}},{"scope":"constant.character.format.placeholder.other.python storage","settings":{"foreground":"#986801"}},{"scope":"support.variable.magic.python","settings":{"foreground":"#E45649"}},{"scope":"meta.function.parameters.python","settings":{"foreground":"#986801"}},{"scope":"punctuation.separator.annotation.python","settings":{"foreground":"#383A42"}},{"scope":"punctuation.separator.parameters.python","settings":{"foreground":"#383A42"}},{"scope":"entity.name.variable.field.cs","settings":{"foreground":"#E45649"}},{"scope":"source.cs keyword.operator","settings":{"foreground":"#383A42"}},{"scope":"variable.other.readwrite.cs","settings":{"foreground":"#383A42"}},{"scope":"variable.other.object.cs","settings":{"foreground":"#383A42"}},{"scope":"variable.other.object.property.cs","settings":{"foreground":"#383A42"}},{"scope":"entity.name.variable.property.cs","settings":{"foreground":"#4078F2"}},{"scope":"storage.type.cs","settings":{"foreground":"#C18401"}},{"scope":"keyword.other.unsafe.rust","settings":{"foreground":"#A626A4"}},{"scope":"entity.name.type.rust","settings":{"foreground":"#0184BC"}},{"scope":"storage.modifier.lifetime.rust","settings":{"foreground":"#383A42"}},{"scope":"entity.name.lifetime.rust","settings":{"foreground":"#986801"}},{"scope":"storage.type.core.rust","settings":{"foreground":"#0184BC"}},{"scope":"meta.attribute.rust","settings":{"foreground":"#986801"}},{"scope":"storage.class.std.rust","settings":{"foreground":"#0184BC"}},{"scope":"markup.raw.block.markdown","settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.variable.shell","settings":{"foreground":"#E45649"}},{"scope":"support.constant.property-value.css","settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.constant.css","settings":{"foreground":"#986801"}},{"scope":"punctuation.separator.key-value.scss","settings":{"foreground":"#E45649"}},{"scope":"punctuation.definition.constant.scss","settings":{"foreground":"#986801"}},{"scope":"meta.property-list.scss punctuation.separator.key-value.scss","settings":{"foreground":"#383A42"}},{"scope":"storage.type.primitive.array.java","settings":{"foreground":"#C18401"}},{"scope":"entity.name.section.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.heading.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"markup.heading.setext","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.bold.markdown","settings":{"foreground":"#986801"}},{"scope":"markup.inline.raw.markdown","settings":{"foreground":"#50A14F"}},{"scope":"beginning.punctuation.definition.list.markdown","settings":{"foreground":"#E45649"}},{"scope":"markup.quote.markdown","settings":{"fontStyle":"italic","foreground":"#A0A1A7"}},{"scope":["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","punctuation.definition.metadata.markdown"],"settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.metadata.markdown","settings":{"foreground":"#A626A4"}},{"scope":["markup.underline.link.markdown","markup.underline.link.image.markdown"],"settings":{"foreground":"#A626A4"}},{"scope":["string.other.link.title.markdown","string.other.link.description.markdown"],"settings":{"foreground":"#4078F2"}},{"scope":"punctuation.separator.variable.ruby","settings":{"foreground":"#E45649"}},{"scope":"variable.other.constant.ruby","settings":{"foreground":"#986801"}},{"scope":"keyword.operator.other.ruby","settings":{"foreground":"#50A14F"}},{"scope":"punctuation.definition.variable.php","settings":{"foreground":"#E45649"}},{"scope":"meta.class.php","settings":{"foreground":"#383A42"}}]'),u6="light",d6={colors:o6,displayName:i6,name:l6,tokenColors:c6,type:u6},f6={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 p6(e){if(!e)return"plaintext";const t=e.split(".").pop()?.toLowerCase();return t?f6[t]??"plaintext":"plaintext"}function Yv({code:e,language:t,sourcePath:r}){const a=_m(f=>f.theme),l=(a==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a)==="dark"?s6:d6,u=t??p6(r);return c.jsx("div",{className:"flex min-w-0 flex-1 flex-col rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface text-xs leading-relaxed overflow-auto c4a-scrollbar [&>*]:flex-1 [&_pre]:min-h-full [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:!bg-transparent [&_code]:!bg-transparent",children:c.jsx(ZD,{language:u,theme:l,children:e})})}let pu=null,hu=[];const mu=ea((e,t)=>({cache:new Map,pending:new Set,resolve:r=>{const{cache:a,pending:o}=t(),l=r.filter(u=>!a.has(u)&&!o.has(u)&&!hu.includes(u));l.length!==0&&(hu.push(...l),e({pending:new Set([...o,...l])}),pu&&clearTimeout(pu),pu=setTimeout(()=>{const u=[...hu];hu=[],pu=null,u.length!==0&&ze.post("/resolve",{refs:u}).then(f=>{const{cache:h,pending:p}=t(),m=new Map(h),x=new Set(p);for(const v of u){const _=f[v];_?m.set(v,_):m.set(v,{exists:!1}),x.delete(v)}e({cache:m,pending:x})}).catch(()=>{const{cache:f,pending:h}=t(),p=new Map(f),m=new Set(h);for(const x of u)p.set(x,{error:!0,exists:!1}),m.delete(x);e({cache:p,pending:m})})},50))},retry:r=>{const{cache:a}=t(),o=new Map(a);o.delete(r),e({cache:o}),t().resolve([r])}})),lh="/studio",sr={entity:e=>`${lh}/entities/${e}`,relation:e=>`${lh}/relations/${e}`,content:e=>`${lh}/contents/${e}`},ow=/^ref:(entity|relation|content):(.+)$/;function h6(e){const t=ow.exec(e);return!t||!t[2]?null:{type:t[1],id:t[2]}}function Om(e){return typeof e=="string"&&ow.test(e)}const Kv={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function m6(e,t){if(e.type==="content")return"📄";if(e.type==="relation")return"🔗";const r=t?.entity_type;return r&&Kv[r]?Kv[r]:"🔹"}function g6(e){switch(e.type){case"entity":return sr.entity(e.id);case"relation":return sr.relation(e.id);case"content":return sr.content(e.id);default:return"#"}}function Mm({pointer:e}){const t=At(),{t:r}=ye(),a=Ko(),o=mu(_=>_.cache),l=mu(_=>_.pending);b.useEffect(()=>{mu.getState().resolve([e])},[e]);const u=h6(e);if(!u)return c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:e});const f=o.get(e);if(l.has(e)||!f&&!o.has(e))return c.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 c.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted cursor-pointer",title:r("ref.retry"),onClick:()=>mu.getState().retry(e),children:["<",r("ref.unknown"),": ",u.id.slice(0,12),">"]});if(f&&!f.exists)return c.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted line-through",title:e,children:["<",r("ref.stale"),": ",u.id.slice(0,12),">"]});const p=m6(u,f),m=u.type==="relation"?f?.relation_type||u.id.slice(0,12):f?.name||u.id.slice(0,12),x=g6(u),v=()=>{a?.active?a.navigate(u.type,u.id,m,p):t(x)};return c.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:[c.jsx("span",{children:p}),c.jsx("span",{children:m})]})}function Pl({data:e,defaultExpanded:t=2}){return c.jsx("div",{className:"font-mono text-xs",children:c.jsx(Xh,{value:e,depth:0,defaultExpanded:t})})}function Xh({keyName:e,value:t,depth:r,defaultExpanded:a}){const[o,l]=b.useState(r<a);if(typeof t=="string"&&Om(t))return c.jsxs("div",{className:"flex items-baseline gap-1",style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx(Mm,{pointer:t})]});if(t==null)return c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-text-muted",children:"null"})]});if(typeof t=="string")return c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsxs("span",{className:"text-c4a-accent",children:['"',t,'"']})]});if(typeof t=="number")return c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-success",children:t})]});if(typeof t=="boolean")return c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-warning",children:String(t)})]});if(Array.isArray(t))return t.length===0?c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-text-muted",children:"[]"})]}):c.jsxs("div",{children:[c.jsxs("div",{style:{paddingLeft:r*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>l(!o),children:[c.jsx("span",{className:"text-c4a-text-muted mr-1",children:o?"▼":"▶"}),e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!o&&c.jsxs("span",{className:"text-c4a-text-muted",children:["[",t.length," items]"]})]}),o&&t.map((u,f)=>c.jsx(Xh,{keyName:String(f),value:u,depth:r+1,defaultExpanded:a},f))]});if(typeof t=="object"){const u=Object.entries(t);return u.length===0?c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-text-muted",children:"{}"})]}):c.jsxs("div",{children:[c.jsxs("div",{style:{paddingLeft:r*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>l(!o),children:[c.jsx("span",{className:"text-c4a-text-muted mr-1",children:o?"▼":"▶"}),e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!o&&c.jsx("span",{className:"text-c4a-text-muted",children:"{ ... }"})]}),o&&u.map(([f,h])=>c.jsx(Xh,{keyName:f,value:h,depth:r+1,defaultExpanded:a},f))]})}return null}const x6={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function Xv({entity:e}){const t=At(),r=Ko(),a=x6[e.type]??"🔹",o=()=>{r?.active?r.navigate("entity",e.id,e.name,a):t(sr.entity(e.id))};return c.jsx("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors",onClick:o,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"shrink-0",children:a}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:e.name}),e.kind&&c.jsx(Bt,{variant:"muted",children:e.kind})]})})}const y6=new Set(["ts","tsx","js","jsx","mts","mjs","cts","cjs","py","pyi","go","rs","java","kt","c","cpp","h","hpp","cs","rb","php","swift","scala","zig","lua","sh","bash","vue","svelte"]),b6=new Set(["md","txt","rst","adoc"]);function Qv(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function Zv({data:e}){const{t}=ye(),r=At(),a=Ko(),o=e.manifest??{},l=o.name??e.name??t("package.unknown"),u=o.version,f=o.license,h=o.description,p=o.dependencies,m=o.devDependencies,x=p?Object.entries(p):[],v=m?Object.entries(m):[],[_,w]=b.useState(!1),[S,k]=b.useState(null),N=e.files??[],R=N.filter(L=>y6.has(Qv(L.path))),E=N.filter(L=>b6.has(Qv(L.path)));b.useEffect(()=>{const L=N.find($=>{const z=$.path.toLowerCase();return(z==="readme.md"||z.endsWith("/readme.md"))&&$.hash_id});if(!L?.hash_id){k(null);return}ze.get(`/contents/${L.hash_id}/raw`).then($=>k($.content)).catch(()=>k(null))},[N]);const D=(L,$)=>{a?.active?a.navigate("content",L,$,"📄"):r(sr.content(L))};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("raw.basic_info")}),c.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 font-mono text-xs",children:[c.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.name")}),c.jsx("span",{className:"text-c4a-text-primary font-bold",children:l}),u&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.version")}),c.jsx("span",{className:"text-c4a-text-primary",children:u})]}),f&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.license")}),c.jsx("span",{className:"text-c4a-text-primary",children:f})]}),h&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.description")}),c.jsx("span",{className:"text-c4a-text-secondary",children:h})]})]}),e.manifest_type&&c.jsx("div",{className:"mt-2",children:c.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})})]}),N.length>0&&c.jsxs("div",{className:"flex flex-wrap gap-3",children:[c.jsx(ln,{icon:c.jsx(ym,{size:14}),label:t("raw.code_files"),value:R.length,size:"sm"}),c.jsx(ln,{icon:c.jsx(On,{size:14}),label:t("raw.doc_files"),value:E.length,size:"sm"}),c.jsx(ln,{icon:c.jsx(Dr,{size:14}),label:t("raw.total_files"),value:N.length,size:"sm"})]}),c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("raw.dependencies")," (",x.length,")"]}),x.length===0?c.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:t("raw.no_dependencies")}):c.jsx("div",{className:"space-y-1",children:x.map(([L,$])=>c.jsxs("div",{className:"flex justify-between font-mono text-xs",children:[c.jsx("span",{className:"text-c4a-text-primary",children:L}),c.jsx("span",{className:"text-c4a-text-muted",children:$})]},L))})]}),v.length>0&&c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5",onClick:()=>w(L=>!L),children:[c.jsx($t,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${_?"rotate-90":""}`}),c.jsxs("h4",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("raw.dev_dependencies")," (",v.length,")"]})]}),_&&c.jsx("div",{className:"mt-2 space-y-1",children:v.map(([L,$])=>c.jsxs("div",{className:"flex justify-between font-mono text-xs",children:[c.jsx("span",{className:"text-c4a-text-primary",children:L}),c.jsx("span",{className:"text-c4a-text-muted",children:$})]},L))})]}),S&&c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("raw.readme")}),c.jsx("div",{className:"max-h-64 overflow-y-auto c4a-scrollbar prose prose-invert prose-sm max-w-none text-c4a-text-secondary",children:c.jsx("pre",{className:"whitespace-pre-wrap font-sans text-sm leading-relaxed",children:S})})]}),N.length>0&&c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("package.files")," (",N.length,")"]}),c.jsx("div",{className:"space-y-1",children:N.map(L=>c.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[c.jsxs("span",{className:"flex items-center gap-1 text-c4a-text-secondary",children:[c.jsx("span",{children:"📄"}),c.jsx("span",{children:L.path})]}),L.hash_id&&c.jsx("span",{className:"font-mono text-[10px] text-c4a-accent hover:underline cursor-pointer",onClick:()=>D(L.hash_id,L.path),children:L.hash_id.slice(0,12)})]},L.path))})]})]})}const gu=["daemon_starting","cloning","preparing"],v6=["scanning","parsing","analyzing","uploading"],Ki=["chunking","annotating","post-processing","embedding","storing"],Qh={daemon_starting:"index.stage.daemon_starting",cloning:"index.stage.cloning",preparing:"index.stage.preparing",scanning:"index.stage.scanning",parsing:"index.stage.parsing",analyzing:"index.stage.analyzing",uploading:"index.stage.uploading",skipping:"index.stage.skipping",chunking:"index.stage.chunking",annotating:"index.stage.annotating","post-processing":"index.stage.post_processing",embedding:"index.stage.embedding",storing:"index.stage.storing"},Jv={daemon_starting:5,cloning:10,preparing:5,scanning:15,parsing:55,analyzing:20,uploading:10},_6={chunking:10,annotating:75,"post-processing":85,embedding:95,storing:100};function w6(e){const t=e.reduce((o,l)=>o+(Jv[l]??10),0),r={};let a=0;for(const o of e)a+=(Jv[o]??10)/t*100,r[o]=Math.round(a);return r[e[e.length-1]]=100,r}const S6={COMMIT_NOT_AVAILABLE:"index.error.commit_not_available",DAEMON_AUTO_START_FAILED:"index.error.daemon_start_failed",GIT_ARCHIVE_FAILED:"index.error.git_archive_failed"};function j6(e,t){if(e){const r=S6[e];return r?t(r):e}return t("index.code.error")}function Xi(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}function xu(e,t,r,a){switch(e){case"daemon_starting":return t("index.log.daemon_ready");case"cloning":return t("index.log.clone_done");case"preparing":return t("index.log.prepare_done");case"scanning":return t("index.log.scan_done");case"parsing":return r!=null?t("index.log.parse_done",{count:r}):`${t(Qh.parsing)} ${t("index.log.done_suffix")}`;case"analyzing":return t("index.log.analyze_done");case"uploading":return a?t("index.log.upload_done",{name:a}):t("index.log.done_suffix");default:return`${t(Qh[e])} ${t("index.log.done_suffix")}`}}function k6({sourceId:e,onComplete:t,retryModules:r}){const{t:a}=ye(),o=kt(ne=>ne.indexingTasks.get(e)),[l,u]=b.useState([]),[f,h]=b.useState(!1),[p,m]=b.useState(!1),x=b.useRef(null),v=b.useRef(!1),_=b.useRef(null),w=b.useRef(null),[S,k]=b.useState(null),N=b.useRef(null),[R,E]=b.useState([]),[D,L]=b.useState(null),[$,z]=b.useState(new Set),[T,B]=b.useState(!0);b.useEffect(()=>{if(!o)return;const ne=o.stage;S!=="doc"&&gu.includes(ne)&&!$.has(ne)&&z(ge=>new Set(ge).add(ne))},[o?.stage,S]),b.useEffect(()=>{if(o?.stage){if(Ki.includes(o.stage)){S!=="doc"&&(k("doc"),x.current=null);return}!S&&o.stage!=="pending"&&o.stage!=="skipping"&&k("code")}},[o?.stage,S]),b.useEffect(()=>{o?.stage&&o.stage!=="skipping"&&o.stage!=="pending"&&(w.current=o.stage)},[o?.stage]);const H=S==="doc"||o?.stage&&Ki.includes(o.stage)?"doc":S??"code",J=H==="doc"?Ki:[...gu.filter(ne=>$.has(ne)),...v6],oe=J.map(ne=>({key:ne,label:a(Qh[ne])})),ce=H==="doc"?_6:w6(J),M=b.useRef(0);b.useEffect(()=>{const ne=o?.pendingSkips;if(!ne||ne.length===0)return;const ge=ne.length;if(ge<=M.current)return;const Ne=ne.slice(M.current);M.current=ge;const Fe=Xi();u(qe=>[...qe,...Ne.map(be=>`[${Fe}] ⏭ ${be}`)].slice(-500))},[o?.pendingSkips]);const P=b.useRef(null),A=b.useRef(null);b.useEffect(()=>{if(!o||o.terminalState)return;const{stage:ne,currentFile:ge,totalFiles:Ne,processedFiles:Fe,moduleName:qe}=o;if(H==="doc"){const he=Xi(),ve=[],Ve=Ki.indexOf(ne);if(ne!==x.current&&(ne==="chunking"&&ve.push(`[${he}] ${a("index.doc.log.chunking")}`),ne==="annotating"&&ve.push(`[${he}] ${a("index.doc.log.annotating_start")}`),ne==="post-processing"&&ve.push(`[${he}] ${a("index.doc.log.post_processing")}`),ne==="embedding"&&ve.push(`[${he}] ${a("index.doc.log.embedding")}`),ne==="storing"&&ve.push(`[${he}] ${a("index.doc.log.storing")}`),Ve>=0&&E(De=>{const Xe=new Set(De);for(const It of Ki.slice(0,Ve))Xe.add(It);return Xe.size===De.length?De:[...Xe]}),L(ne),x.current=ne),o.message){const De=typeof o.message=="string"?o.message:a(o.message.key,o.message.params);De!==N.current&&(ve.push(`[${he}] ${De}`),N.current=De)}ve.length>0&&u(De=>[...De,...ve].slice(-500));return}if(ne==="skipping")return;const be=Xi(),fe=[],_e=qe!=null&&qe!==P.current;if(ne!==x.current){if(x.current==="pending"||x.current===null){L(ne),x.current=ne;const ve=J.indexOf(ne);ve>0&&E(Ve=>{const De=new Set(Ve);for(const Xe of J.slice(0,ve))De.add(Xe);return De.size===Ve.length?Ve:[...De]}),gu.includes(ne)&&fe.push(`[${be}] ${a(`index.log.${ne}`)}`),fe.length>0&&u(Ve=>[...Ve,...fe].slice(-500));return}const he=J.indexOf(ne);if(he>=0){const ve=J.slice(0,he);if(E(Ve=>{const De=new Set(Ve);for(const Xe of ve)De.add(Xe);return De.size===Ve.length?Ve:[...De]}),x.current&&x.current!=="skipping"){const Ve=J.indexOf(x.current);if(Ve<=he){for(let De=Ve;De<he;De++){const Xe=J[De];fe.push(`[${be}] ${xu(Xe,a,A.current,P.current)}`)}gu.includes(ne)&&fe.push(`[${be}] ${a(`index.log.${ne}`)}`)}else{for(let De=Ve;De<J.length;De++){const Xe=J[De];fe.push(`[${be}] ${xu(Xe,a,A.current,P.current)}`)}_e&&(fe.push(`[${be}] ── ${qe} ──`),P.current=qe,A.current=null);for(let De=0;De<he;De++){const Xe=J[De];fe.push(`[${be}] ${xu(Xe,a,null,null)}`)}}}}L(ne),x.current=ne}_e&&P.current!==qe&&(fe.push(`[${be}] ── ${qe} ──`),P.current=qe,A.current=null),Ne!=null&&(A.current=Ne),ge&&Fe!=null&&Ne!=null&&fe.push(`[${be}] ${ge} (${Fe}/${Ne})`),fe.length>0&&u(he=>[...he,...fe].slice(-500))},[o,a,H,J]),b.useEffect(()=>{if(!o?.terminalState){v.current=!1;return}if(v.current)return;v.current=!0;const ne=Xi();if(o.terminalState==="done"){const ge=[];x.current==="uploading"&&P.current&&ge.push(`[${ne}] ${xu("uploading",a,A.current,P.current)}`),ge.push(`[${ne}] ${a("index.code.complete")}`),o.unchangedCount&&ge.push(`[${ne}] ${a("index.code.unchanged_count",{count:o.unchangedCount})}`),u(Ne=>[...Ne,...ge].slice(-500)),E(J.slice()),L(null);return}if(o.terminalState==="error"){const ge=o.errorMessage??a("index.code.error");u(Ne=>[...Ne,`[${ne}] ERROR: ${ge}`].slice(-500)),h(!0),L(null);return}if(o.terminalState==="timeout"){u(ge=>[...ge,`[${ne}] ${a("index.code.timeout")}`].slice(-500)),m(!0),L(null);return}},[o?.terminalState,e,a,t]),b.useEffect(()=>{_.current?.scrollIntoView({behavior:"smooth"})},[l]),b.useEffect(()=>{if(o?.terminalState!=="done"||!T)return;const ne=setTimeout(()=>{kt.getState().clearIndexTask(e),t?.()},2e3);return()=>{clearTimeout(ne)}},[o?.terminalState,T,e,t]);const F=o&&!o.terminalState?{percent:o.progress,label:o.currentFile??""}:null,[ee,ae]=b.useState(!1),W=b.useCallback(async()=>{ae(!0);try{(await kt.getState().triggerIndex(e,r)).status==="skipped"?(kt.getState().clearIndexTask(e),t?.()):(m(!1),h(!1),u([]),E([]),L(null),k(null),x.current=null,w.current=null,z(new Set))}catch{h(!0);const ne=Xi();u(ge=>[...ge,`[${ne}] ${a("index.code.error")}`].slice(-500))}finally{ae(!1)}},[e,r,a,t]),O=b.useCallback(()=>{kt.getState().clearIndexTask(e),t?.()},[e,t]),V=b.useCallback(()=>{kt.getState().clearIndexTask(e),t?.()},[e,t]),re=o?.terminalState==="done",se=!!o&&!o?.terminalState;return c.jsxs("div",{className:"flex flex-col gap-4 pb-8",children:[c.jsx(V1,{stages:oe,currentStage:D,completedStages:R,failedStage:f?w.current:null,progress:F,breakpoints:ce,headerRight:re&&!T?c.jsx("button",{type:"button",className:"rounded-sm bg-c4a-accent px-2 py-0.5 font-mono text-[11px] text-white hover:bg-c4a-accent/90",onClick:V,children:a("index.code.done_continue")}):re&&T?c.jsx("span",{className:"animate-pulse font-mono text-[11px] text-c4a-text-muted",children:a("index.code.auto_continue_pending")}):se||re?c.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 select-none",children:[c.jsx("span",{className:`flex h-3.5 w-3.5 items-center justify-center rounded-sm border transition-colors ${T?"border-c4a-accent bg-c4a-accent":"border-c4a-border-default bg-transparent"}`,onClick:()=>B(ne=>!ne),children:T&&c.jsx(Wr,{size:10,className:"text-white"})}),c.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted",onClick:()=>B(ne=>!ne),children:a("index.code.auto_continue")})]}):void 0}),p&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-c4a-warning",children:a("index.code.timeout")}),c.jsx("button",{type:"button",className:`shrink-0 rounded bg-c4a-accent px-3 py-1 font-mono text-xs text-white hover:bg-c4a-accent/90 ${ee?"opacity-50 cursor-not-allowed":""}`,onClick:W,disabled:ee,children:a("sources.import.retry")}),c.jsx("button",{type:"button",className:`shrink-0 rounded border border-c4a-border-default px-3 py-1 font-mono text-xs text-c4a-text-muted hover:text-c4a-text-primary ${ee?"opacity-50 cursor-not-allowed":""}`,onClick:O,disabled:ee,children:a("index.code.dismiss")})]}),f&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-c4a-error",children:j6(o?.errorMessage,a)}),c.jsx("button",{type:"button",className:`shrink-0 rounded bg-c4a-accent px-3 py-1 font-mono text-xs text-white hover:bg-c4a-accent/90 ${ee?"opacity-50 cursor-not-allowed":""}`,onClick:W,disabled:ee,children:a("sources.import.retry")}),c.jsx("button",{type:"button",className:`shrink-0 rounded border border-c4a-border-default px-3 py-1 font-mono text-xs text-c4a-text-muted hover:text-c4a-text-primary ${ee?"opacity-50 cursor-not-allowed":""}`,onClick:O,disabled:ee,children:a("index.code.dismiss")})]}),c.jsxs("div",{className:"mt-4 min-h-[200px] max-h-[50vh] overflow-y-auto rounded bg-c4a-bg-base p-3 c4a-scrollbar",children:[l.map((ne,ge)=>c.jsx("div",{className:`font-mono text-xs leading-relaxed ${ne.includes("ERROR")?"text-red-400/80":"text-c4a-text-muted"}`,children:ne},ge)),c.jsx("div",{ref:_})]})]})}const N6=["entities","relations","behaviors","attributes","states","rules","transitions","events","decisions","metrics","roles","constraints","comparisons","boundaries"],E6={critical:{label:"CRITICAL",className:"text-red-400 bg-red-500/10"},major:{label:"MAJOR",className:"text-amber-400 bg-amber-500/10"},minor:{label:"MINOR",className:"text-c4a-text-muted bg-c4a-bg-elevated"},must:{label:"MUST",className:"text-red-400 bg-red-500/10"},should:{label:"SHOULD",className:"text-amber-400 bg-amber-500/10"},may:{label:"MAY",className:"text-c4a-text-muted bg-c4a-bg-elevated"}};function C6(e){return typeof e.description=="string"?e.description:typeof e.name=="string"?e.name:JSON.stringify(e)}function R6(e){return N6.map(t=>({type:t,atoms:Array.isArray(e[t])?e[t]:[]}))}function T6(e){return e.every(t=>t.atoms.length===0)}function A6({severity:e}){if(!e)return null;const t=E6[e];return t?c.jsxs("span",{className:"relative inline-block group cursor-default ml-2",children:[c.jsx("span",{className:`inline-flex rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${t.className}`,children:t.label}),c.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:e})]}):c.jsxs("span",{className:"relative inline-block group cursor-default ml-2",children:[c.jsx("span",{className:"inline-flex rounded-sm bg-c4a-bg-elevated px-1.5 py-0.5 font-mono text-[10px] uppercase text-c4a-text-muted",children:e}),c.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:e})]})}function L6({digest:e}){const{t}=ye(),[r,a]=b.useState(null),o=b.useMemo(()=>e.sections.map((l,u)=>({section:l,sectionIndex:u})),[e.sections]);return c.jsx("div",{className:"w-full",children:o.map(({section:l,sectionIndex:u})=>{const f=l.heading?.trim();return c.jsxs("div",{className:"border-t border-c4a-border-subtle pt-4 mt-4 first:border-t-0 first:mt-0",children:[f?c.jsx("div",{className:"mb-3 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:f}):null,l.paragraphs.map((h,p)=>{const m=`${u}-${p}`,x=R6(h.atoms),v=T6(x);return c.jsxs("div",{className:`flex flex-col lg:flex-row gap-4 py-3 border-b border-c4a-border-subtle last:border-b-0 transition-colors ${r===m?"bg-c4a-bg-hover/50 rounded-sm":""}`,onMouseEnter:()=>a(m),onMouseLeave:()=>a(null),children:[c.jsx("div",{className:"lg:w-1/2 w-full text-sm text-c4a-text-primary leading-relaxed whitespace-pre-wrap",children:h.text}),c.jsx("div",{className:"lg:w-1/2 w-full min-h-[2rem]",children:v?c.jsx("div",{className:"text-xs text-c4a-text-muted italic",children:t("digest.doc.no_atoms")}):x.map(_=>_.atoms.length>0?c.jsxs("div",{className:"mb-2 last:mb-0",children:[c.jsx("div",{className:"mb-1 font-mono text-xs uppercase tracking-tight text-c4a-accent",children:t(`digest.doc.atom.${_.type}`)}),c.jsx("div",{className:"space-y-1",children:_.atoms.map((w,S)=>{const k=w,N=typeof k.severity=="string"?k.severity:void 0,R=typeof k.confidence=="number"?k.confidence:void 0,E=Yo(R);return c.jsxs("div",{className:"pl-3 text-xs text-c4a-text-secondary leading-relaxed",children:[c.jsx("span",{children:C6(k)}),c.jsx(A6,{severity:N}),E?c.jsx("span",{className:"ml-2 inline-flex",children:c.jsx(Bt,{variant:E.variant,tooltip:`${E.value.toFixed(2)} — ${t(E.tipKey)}`,children:t(E.labelKey)})}):null]},`${_.type}-${S}`)})})]},_.type):null)})]},m)})]},`section-${u}`)})})}function ka(){return{data:null,loading:!1,error:null,warnings:[],pagination:null}}function ch(){return{data:null,loading:!1,error:null,warnings:[]}}function Qi(e){const t={};for(const[r,a]of Object.entries(e))a!=null&&(Array.isArray(a)?t[r]=a.join(","):t[r]=String(a));return t}const Wv=new Map;function Zi(e){const t=Wv.get(e);t&&t.abort();const r=new AbortController;return Wv.set(e,r),r.signal}const Mn=ea((e,t)=>({symbols:{...ka()},callGraph:{...ka()},imports:{...ka()},inheritance:{...ka()},paragraphs:{...ch()},fetchSymbols:async(r,a)=>{const o=Zi("symbols");e(l=>({symbols:{...l.symbols,loading:!0,error:null}}));try{const l=await ze.get("/query/symbols",Qi({sourceIds:r.sourceIds,exportedOnly:r.exportedOnly,kind:r.kind,namePattern:r.namePattern,filePath:r.filePath,limit:r.limit,offset:r.offset}),{signal:o,skipDedup:!0});if(o.aborted)return;const u=a?.append?t().symbols.data??[]:[];e({symbols:{data:[...u,...l.symbols],pagination:l.pagination,loading:!1,error:null,warnings:l.warnings??[]}})}catch(l){if(o.aborted||l instanceof DOMException&&l.name==="AbortError")return;e(u=>({symbols:{...u.symbols,loading:!1,error:String(l)}}))}},fetchCallGraph:async r=>{const a=Zi("callGraph");e({callGraph:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const o=await ze.get("/query/call-graph",Qi({sourceIds:r.sourceIds,functionName:r.functionName,direction:r.direction,maxDepth:r.maxDepth,limit:r.limit,offset:r.offset}),{signal:a,skipDedup:!0});if(a.aborted)return;e({callGraph:{data:o.entries,pagination:o.pagination,loading:!1,error:null,warnings:o.warnings??[]}})}catch(o){if(a.aborted||o instanceof DOMException&&o.name==="AbortError")return;e({callGraph:{data:null,loading:!1,error:String(o),warnings:[],pagination:null}})}},fetchImports:async r=>{const a=Zi("imports");e({imports:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const o=await ze.get("/query/imports",Qi({sourceIds:r.sourceIds,filePath:r.filePath,direction:r.direction,limit:r.limit,offset:r.offset}),{signal:a,skipDedup:!0});if(a.aborted)return;e({imports:{data:o.imports,pagination:o.pagination,loading:!1,error:null,warnings:o.warnings??[]}})}catch(o){if(a.aborted||o instanceof DOMException&&o.name==="AbortError")return;e({imports:{data:null,loading:!1,error:String(o),warnings:[],pagination:null}})}},fetchInheritance:async r=>{const a=Zi("inheritance");e({inheritance:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const o=await ze.get("/query/inheritance",Qi({sourceIds:r.sourceIds,className:r.className,direction:r.direction,limit:r.limit,offset:r.offset}),{signal:a,skipDedup:!0});if(a.aborted)return;e({inheritance:{data:o.relations,pagination:o.pagination,loading:!1,error:null,warnings:o.warnings??[]}})}catch(o){if(a.aborted||o instanceof DOMException&&o.name==="AbortError")return;e({inheritance:{data:null,loading:!1,error:String(o),warnings:[],pagination:null}})}},fetchParagraphs:async r=>{const a=Zi("paragraphs");e({paragraphs:{data:null,loading:!0,error:null,warnings:[]}});try{const o=await ze.get("/query/paragraphs",Qi({sourceIds:r.sourceIds,text:r.text,topK:r.topK,scoreLow:r.scoreLow}),{signal:a,skipDedup:!0});if(a.aborted)return;e({paragraphs:{data:o.results,loading:!1,error:null,warnings:[]}})}catch(o){if(a.aborted||o instanceof DOMException&&o.name==="AbortError")return;e({paragraphs:{data:null,loading:!1,error:String(o),warnings:[]}})}},resetQuery:r=>{e(r?r==="paragraphs"?{[r]:ch()}:{[r]:ka()}:{symbols:ka(),callGraph:ka(),imports:ka(),inheritance:ka(),paragraphs:ch()})}}));function md({warnings:e}){const{t}=ye(),[r,a]=b.useState(!1);return e.length===0?null:c.jsxs("div",{className:"rounded-lg bg-c4a-warning/10 border border-c4a-warning/20 px-3 py-2 mb-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_R,{size:14,className:"text-c4a-warning shrink-0"}),c.jsx("span",{className:"font-mono text-xs text-c4a-warning",children:e[0]}),e.length>1&&c.jsx("button",{type:"button",className:"font-mono text-[10px] text-c4a-warning/70 underline cursor-pointer",onClick:()=>a(!r),children:t("query.warning.more",{count:e.length-1})})]}),r&&e.slice(1).map((o,l)=>c.jsx("div",{className:"mt-1 pl-6 font-mono text-xs text-c4a-warning/80",children:o},l))]})}function D6(e){const t={children:[]},r=new Map,a=new Map;for(const l of e)a.set(l.filePath,(a.get(l.filePath)??0)+1);for(const[l,u]of a){const f=l.split("/").filter(Boolean);let h="",p=t;for(let m=0;m<f.length;m++){const x=f[m];h=h?`${h}/${x}`:x;const v=m===f.length-1;let _=r.get(h);_||(_={name:x,fullPath:h,isFile:v,children:[],symbolCount:0},r.set(h,_),p.children.push(_)),v&&(_.symbolCount=u,_.isFile=!0),p=_}}const o=l=>{l.sort((u,f)=>u.isFile!==f.isFile?u.isFile?1:-1:u.name.localeCompare(f.name));for(const u of l)u.children.length>0&&o(u.children)};return o(t.children),t.children}function O6({symbols:e,selectedFilePath:t,onSelectFile:r,sourceId:a}){const o=b.useMemo(()=>D6(e),[e]);return c.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:c.jsx(iw,{nodes:o,depth:0,selectedFilePath:t,onSelectFile:r,sourceId:a})})}function iw({nodes:e,depth:t,selectedFilePath:r,onSelectFile:a,sourceId:o}){return c.jsx(c.Fragment,{children:e.map(l=>c.jsx(M6,{node:l,depth:t,selectedFilePath:r,onSelectFile:a,sourceId:o},l.fullPath))})}function M6({node:e,depth:t,selectedFilePath:r,onSelectFile:a,sourceId:o}){const{t:l}=ye(),u=Ra(_=>_.openTab),[f,h]=b.useState(t<2),p=e.isFile&&e.fullPath===r,m=t*16,x=b.useCallback(()=>{e.isFile?a(p?null:e.fullPath):h(_=>!_)},[e.isFile,e.fullPath,p,a]),v=b.useCallback(_=>{_.stopPropagation(),u({id:`import-deps:${e.fullPath}`,type:"import-deps",resourceId:e.fullPath,label:e.name,meta:{sourceIds:[o]}})},[e.fullPath,e.name,o,u]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`group/node flex h-7 items-center cursor-pointer font-mono text-xs ${p?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-secondary hover:bg-c4a-bg-hover/50"}`,style:{paddingLeft:m},onClick:x,children:[e.isFile?c.jsx("span",{className:"w-4 shrink-0"}):c.jsx($t,{size:12,className:`shrink-0 transition-transform duration-200 text-c4a-text-muted ${f?"rotate-90":""}`}),e.isFile?c.jsx(ym,{size:13,className:"mx-1 shrink-0 text-c4a-text-muted"}):c.jsx(Gn,{size:13,className:"mx-1 shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"truncate flex-1",children:e.name}),e.isFile&&c.jsx("button",{type:"button",className:"opacity-0 group-hover/node:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0 mr-1",title:l("query.import_deps.open"),onClick:v,children:c.jsx(UE,{size:12,className:"text-c4a-text-muted"})})]}),!e.isFile&&f&&e.children.length>0&&c.jsx(iw,{nodes:e.children,depth:t+1,selectedFilePath:r,onSelectFile:a,sourceId:o})]})}function z6({symbol:e}){return e.kind==="class"||e.kind==="interface"?c.jsx($6,{symbol:e}):e.kind==="function"?c.jsx(B6,{symbol:e}):c.jsxs("div",{className:zm,children:[c.jsxs(Sl,{children:[e.kind.toUpperCase(),": ",e.name]}),e.signature&&c.jsx("p",{className:"font-mono text-xs text-c4a-text-secondary",children:e.signature})]})}function $6({symbol:e}){const{t}=ye();return c.jsxs("div",{className:zm,children:[e.methods&&e.methods.length>0&&c.jsxs("div",{className:"mb-2",children:[c.jsxs(Sl,{children:[t("query.symbol.methods")," (",e.methods.length,")"]}),c.jsx("table",{className:"w-full font-mono text-xs",children:c.jsx("tbody",{children:e.methods.map((r,a)=>c.jsxs("tr",{className:"even:bg-c4a-bg-base",children:[c.jsx("td",{className:"py-0.5 pr-3 text-c4a-text-primary",children:r.name}),c.jsxs("td",{className:"py-0.5 pr-3 text-c4a-text-muted",children:["(",r.params.map(o=>`${o.name}: ${o.type??"unknown"}`).join(", "),")"]}),c.jsx("td",{className:"py-0.5 text-c4a-text-secondary",children:r.returnType??"void"})]},a))})})]}),e.properties&&e.properties.length>0&&c.jsxs("div",{className:"mb-2",children:[c.jsxs(Sl,{children:[t("query.symbol.properties")," (",e.properties.length,")"]}),c.jsx("table",{className:"w-full font-mono text-xs",children:c.jsx("tbody",{children:e.properties.map((r,a)=>c.jsxs("tr",{className:"even:bg-c4a-bg-base",children:[c.jsx("td",{className:"py-0.5 pr-3 text-c4a-text-primary",children:r.name}),c.jsx("td",{className:"py-0.5 text-c4a-text-secondary",children:r.type??"unknown"})]},a))})})]}),e.baseClass&&c.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[c.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.extends"),":"]})," ",e.baseClass]}),e.interfaces&&e.interfaces.length>0&&c.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[c.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.implements"),":"]})," ",e.interfaces.join(", ")]})]})}function B6({symbol:e}){const{t}=ye();return c.jsxs("div",{className:zm,children:[e.signature&&c.jsxs("div",{className:"mb-1",children:[c.jsx(Sl,{children:t("query.symbol.signature")}),c.jsx("p",{className:"font-mono text-xs text-c4a-text-primary",children:e.signature})]}),e.params&&e.params.length>0&&c.jsxs("div",{className:"mb-1",children:[c.jsx(Sl,{children:t("query.symbol.parameters")}),c.jsx("div",{className:"font-mono text-xs",children:e.params.map((r,a)=>c.jsxs("div",{className:"text-c4a-text-secondary",children:[c.jsx("span",{className:"text-c4a-text-primary",children:r.name}),": ",r.type??"unknown"]},a))})]}),e.returnType&&c.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[c.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.returns"),":"]})," ",e.returnType]}),e.isAsync&&c.jsxs("div",{className:"font-mono text-xs text-c4a-text-muted",children:[t("query.symbol.async"),": ✓"]})]})}const zm="ml-6 mt-1 mb-2 rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-3";function Sl({children:e}){return c.jsx("div",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted mb-1",children:e})}const I6={class:"■",interface:"◇",function:"ƒ",enum:"▣",type_alias:"◈"};function U6(e,t){if(!t)return e;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:c.jsxs(c.Fragment,{children:[e.slice(0,r),c.jsx("mark",{className:"bg-c4a-accent/20 text-c4a-accent",children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function P6({symbols:e,searchQuery:t,sourceId:r}){const{t:a}=ye(),[o,l]=b.useState(null),u=Ra(m=>m.openTab),f=b.useCallback(m=>{l(x=>x===m?null:m)},[]),h=b.useCallback((m,x)=>{m.stopPropagation(),u({id:`call-graph:${x.filePath}:${x.name}`,type:"call-graph",resourceId:`${x.filePath}#${x.name}`,label:`Calls: ${x.name}`,icon:"🔗",meta:{sourceIds:[r]}})},[r,u]),p=b.useCallback((m,x)=>{m.stopPropagation(),u({id:`inheritance:${x.filePath}:${x.name}`,type:"inheritance",resourceId:`${x.filePath}#${x.name}`,label:`Inherit: ${x.name}`,icon:"📐",meta:{sourceIds:[r]}})},[r,u]);return e.length===0?c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:a("query.symbol.empty")})}):c.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:e.map(m=>{const x=`${m.filePath}:${m.name}:${m.line}`,v=o===x;return c.jsxs("div",{children:[c.jsxs("div",{className:"group flex h-8 items-center gap-2 px-3 cursor-pointer border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",onClick:()=>f(x),children:[c.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:I6[m.kind]??"·"}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate flex-1",children:U6(m.name,t)}),c.jsx(Bt,{variant:"muted",children:m.kind.replace("_"," ")}),m.isExported&&c.jsx(Bt,{variant:"accent",children:"Export"}),m.kind==="function"&&c.jsx("button",{type:"button",className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0",title:a("query.call_graph.open"),onClick:_=>h(_,m),children:c.jsx(Bu,{size:13,className:"text-c4a-text-muted"})}),(m.kind==="class"||m.kind==="interface")&&c.jsx("button",{type:"button",className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0",title:a("query.inheritance.open"),onClick:_=>p(_,m),children:c.jsx(JC,{size:13,className:"text-c4a-text-muted"})})]}),v&&c.jsx(z6,{symbol:m})]},x)})})}const e_=200,H6=200;function q6({sourceId:e}){const{t}=ye(),{data:r,loading:a,error:o,warnings:l,pagination:u}=Mn(z=>z.symbols),f=Mn(z=>z.fetchSymbols),h=Mn(z=>z.resetQuery),[p,m]=b.useState(!0),[x,v]=b.useState(""),[_,w]=b.useState(null),S=b.useRef(null),[k,N]=b.useState("");b.useEffect(()=>(f({sourceIds:[e],exportedOnly:!0,limit:e_}),()=>h("symbols")),[e]);const R=b.useCallback(()=>{const z=!p;m(z),w(null),f({sourceIds:[e],exportedOnly:z,limit:e_})},[p,e,f]),E=b.useCallback(z=>{const T=z.target.value;v(T),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>N(T),300)},[]),D=b.useCallback(()=>{!r||!u||f({sourceIds:[e],exportedOnly:p,limit:H6,offset:r.length},{append:!0})},[r,u,e,p,f]),L=b.useMemo(()=>{if(!r)return[];let z=r;if(_&&(z=z.filter(T=>T.filePath===_)),k){const T=k.toLowerCase();z=z.filter(B=>B.name.toLowerCase().includes(T))}return z},[r,_,k]),$=u&&r&&u.total>r.length;return a&&!r?c.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[Array.from({length:5}).map((z,T)=>c.jsx("div",{className:"h-7 bg-c4a-bg-hover animate-pulse rounded"},T)),c.jsx("div",{className:"mt-2 text-center",children:c.jsx(ta,{labelKey:"query.symbol.loading"})})]}):o&&!r?c.jsx(wt,{title:t("query.symbol.empty"),description:o}):!a&&r&&r.length===0?c.jsx(wt,{title:t("query.symbol.empty"),description:t("query.symbol.empty_desc")}):c.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.length>0&&c.jsx("div",{className:"px-4 pt-3",children:c.jsx(md,{warnings:l})}),c.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-c4a-border-subtle",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(ml,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-c4a-text-muted"}),c.jsx("input",{className:"w-full rounded-lg border border-c4a-border-default bg-c4a-bg-surface pl-8 pr-3 py-1.5 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none focus:ring-2 focus:ring-c4a-accent/30",placeholder:t("query.symbol.search_placeholder"),value:x,onChange:E})]}),c.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer shrink-0",children:[c.jsx("input",{type:"checkbox",checked:p,onChange:R,className:"accent-c4a-accent"}),c.jsx("span",{className:"font-mono text-[11px] uppercase tracking-tight text-c4a-text-secondary",children:t("query.symbol.exported_only")})]})]}),c.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[c.jsx("div",{className:"w-1/3 min-w-[200px] max-w-[300px] border-r border-c4a-border-subtle overflow-y-auto c4a-scrollbar",children:r&&c.jsx(O6,{symbols:r,selectedFilePath:_,onSelectFile:w,sourceId:e})}),c.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[c.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar",children:c.jsx(P6,{symbols:L,searchQuery:k,sourceId:e})}),$&&c.jsx("div",{className:"flex items-center justify-center border-t border-c4a-border-subtle py-2",children:c.jsx("button",{type:"button",className:"rounded-lg border border-c4a-border-default bg-c4a-bg-surface px-4 py-1.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary hover:bg-c4a-bg-hover cursor-pointer",onClick:D,disabled:a,children:a?c.jsx("span",{className:"animate-pulse",children:t("query.symbol.loading")}):t("query.symbol.load_more",{count:u.total-r.length})})})]})]})]})}function F6(e){return e>=.7?{stars:3,label:"⭐⭐⭐",key:"query.doc.relevance.high"}:e>=.5?{stars:2,label:"⭐⭐",key:"query.doc.relevance.medium"}:{stars:1,label:"⭐",key:"query.doc.relevance.low"}}function G6(e,t){if(!t)return e;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:c.jsxs(c.Fragment,{children:[e.slice(0,r),c.jsx("mark",{className:"bg-c4a-accent/20 text-c4a-accent",children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function V6({result:e,searchQuery:t}){const{t:r}=ye(),a=Ra(f=>f.openTab),o=F6(e.score),l=()=>{a({id:`content:${e.hashId}:s${e.sectionIndex}p${e.paragraphIndex}`,type:"content",resourceId:e.hashId,label:e.sourceName,meta:{sectionIndex:e.sectionIndex,paragraphIndex:e.paragraphIndex,sourcePath:e.sourcePath}})},u=e.sectionHeading?e.sectionHeading.split(" > ").filter(Boolean):[];return c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4 hover:border-c4a-accent/30 cursor-pointer transition-colors",onClick:l,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm",children:o.label}),c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:r(o.key)})]}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted truncate ml-2",children:e.sourceName})]}),c.jsx("p",{className:"text-sm text-c4a-text-primary leading-relaxed line-clamp-4",children:G6(e.paragraphText,t)}),u.length>0&&c.jsxs("div",{className:"flex items-center gap-1 mt-3 font-mono text-[11px] text-c4a-text-muted",children:[c.jsx(On,{size:12,className:"shrink-0"}),u.map((f,h)=>c.jsxs("span",{className:"flex items-center gap-1",children:[h>0&&c.jsx("span",{className:"text-c4a-text-muted/50",children:">"}),c.jsx("span",{children:f})]},h))]})]})}function Y6({sourceId:e}){const{t}=ye(),[r,a]=b.useState(""),[o,l]=b.useState(""),[u,f]=b.useState(null),{data:h,loading:p,error:m}=Mn(S=>S.paragraphs),x=Mn(S=>S.fetchParagraphs),v=Mn(S=>S.resetQuery);b.useEffect(()=>{a(""),l(""),v("paragraphs")},[e,v]),b.useEffect(()=>{m&&!p&&(console.error("[DocSearchBox] search failed:",m),f({title:t("query.doc.error.title"),detail:m}))},[m,p,t]);const _=b.useCallback(()=>{const S=r.trim();S&&(l(S),x({sourceIds:[e],text:S,topK:10}))},[r,e,x]),w=S=>{S.key==="Enter"&&_()};return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-c4a-border-subtle",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(ml,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-c4a-text-muted"}),c.jsx("input",{className:"w-full rounded-lg border border-c4a-border-default bg-c4a-bg-surface pl-8 pr-3 py-1.5 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none focus:ring-2 focus:ring-c4a-accent/30",placeholder:t("query.doc.search_placeholder"),value:r,onChange:S=>a(S.target.value),onKeyDown:w})]}),c.jsx("button",{type:"button",className:"rounded px-4 py-1.5 bg-c4a-accent text-white font-mono text-xs uppercase tracking-tight hover:bg-c4a-accent/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:_,disabled:!r.trim()||p,children:t("query.doc.search_button")})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto c4a-scrollbar p-4",children:[p&&c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(ta,{labelKey:"query.doc.searching"})}),u&&c.jsx($l,{error:u,onClose:()=>f(null)}),!p&&!m&&h&&h.length===0&&c.jsx(wt,{title:t("query.doc.empty.title"),description:t("query.doc.empty.desc")}),!p&&!m&&h&&h.length>0&&c.jsx("div",{className:"flex flex-col gap-3",children:h.map(S=>c.jsx(V6,{result:S,searchQuery:o},`${S.hashId}-${S.paragraphIndex}`))})]})]})}function K6({sourceType:e,sourceId:t,indexStatus:r}){const{t:a}=ye();return r==="indexing"?c.jsx(wt,{title:a("query.indexing.title"),description:a("query.indexing.desc")}):e==="code"&&t?c.jsx(q6,{sourceId:t}):e&&e!=="code"&&t?c.jsx(Y6,{sourceId:t}):c.jsx(wt,{title:a("query.doc.empty.title"),description:a("query.doc.empty.desc")})}function t_(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&"manifest_type"in t}catch{return!1}}function n_({sourceId:e,isDaemonOnline:t,indexModules:r}){const{t:a}=ye(),o=kt(h=>h.triggerIndex),[l,u]=b.useState(null),f=async()=>{if(e){u(null);try{(await o(e,r)).status==="skipped"&&(u(a("index.code.skipped")),setTimeout(()=>u(null),3e3))}catch{u(a("index.code.error")),setTimeout(()=>u(null),3e3)}}};return c.jsx(wt,{title:a("common.empty.content_raw.title"),description:a("common.empty.content_raw.description"),action:e?c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[c.jsx("button",{type:"button",className:`rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90 ${t?"":"opacity-40 cursor-not-allowed"}`,onClick:t?f:void 0,title:t?void 0:a("daemon.offline_tooltip"),children:a("common.empty.content_raw.cta")}),l&&c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:l})]}):void 0})}function lw({hashId:e,sourcePath:t,sourceId:r,isCodeIndexing:a,isDaemonOnline:o,indexModules:l,sourceType:u,indexStatus:f,paragraphMeta:h}){const{t:p}=ye(),[m,x]=b.useState(null),[v,_]=b.useState(null),w=h!=null&&typeof h.sectionIndex=="number",[S,k]=b.useState(w?"digest":"raw"),[N,R]=b.useState(!1);b.useEffect(()=>{w&&k("digest")},[w,h?.sectionIndex,h?.paragraphIndex]),b.useEffect(()=>{if(!e){x(null),_(null);return}_(null),ze.get(`/contents/${e}`).then(L=>{x(L),w||k("raw")}).catch(L=>{L instanceof hn&&L.status===404?_("not_found"):_("load_failed")})},[e]);const E=b.useCallback(()=>{R(!0),e&&ze.get(`/contents/${e}`).then(L=>x(L)).catch(()=>{})},[e]);b.useEffect(()=>{a&&R(!1)},[a]);const D=a&&!N&&r;return c.jsx("div",{className:"flex flex-1 flex-col",children:c.jsxs(n4,{value:S,onChange:L=>k(L),children:[c.jsxs(r4,{children:[c.jsx(Vr,{value:"raw",children:p("content.detail.tab.raw")}),c.jsx(Vr,{value:"digest",children:p("content.detail.tab.digest")}),c.jsx(Vr,{value:"extraction",children:p("content.detail.tab.extraction")}),c.jsx(Vr,{value:"entities",children:p("content.detail.tab.entities")}),f&&f!=="none"&&c.jsx(Vr,{value:"query",children:p("query.tab.label")})]}),c.jsx("div",{className:"mt-4 flex flex-1 flex-col",children:D?c.jsx(k6,{sourceId:r,onComplete:E,retryModules:l}):v?e?c.jsx(wt,{title:p(`common.error.${v}`),description:p(`common.error.${v}_description`)}):c.jsx(n_,{sourceId:r,isDaemonOnline:o,indexModules:l}):e?m?c.jsxs(c.Fragment,{children:[c.jsx(Yr,{value:"raw",children:c.jsx(X6,{hashId:m.hash_id,sourcePath:t})}),c.jsx(Yr,{value:"digest",children:c.jsx(Q6,{hashId:m.hash_id,sourceId:r,sourcePath:t,isDaemonOnline:o,available:m.stages?.digest?.available,indexModules:l})}),c.jsx(Yr,{value:"extraction",children:c.jsx(Z6,{hashId:m.hash_id,available:m.stages?.extraction?.available})}),c.jsx(Yr,{value:"entities",children:c.jsx(J6,{hashId:m.hash_id,available:m.stages?.extraction?.available})}),f&&f!=="none"&&c.jsx(Yr,{value:"query",children:c.jsx(K6,{sourceType:u,sourceId:r,indexStatus:f})})]}):c.jsx(Hl,{}):c.jsx(n_,{sourceId:r,isDaemonOnline:o,indexModules:l})})]})})}function Hl(){return c.jsx("div",{className:"flex flex-1 items-center justify-center pb-15",children:c.jsx(Zt,{size:24,className:"animate-spin text-c4a-text-muted"})})}function X6({hashId:e,sourcePath:t}){const{t:r}=ye(),[a,o]=b.useState(null),[l,u]=b.useState(!1),[f,h]=b.useState(!1);if(b.useEffect(()=>{u(!1),o(null),ze.get(`/contents/${e}/raw`).then(p=>{o(p),u(!0),h(!1)}).catch(p=>{p instanceof hn&&p.status===404&&h(!0),u(!0)})},[e]),!l){if(a){if(t_(a.content))try{return c.jsx(Zv,{data:JSON.parse(a.content)})}catch{}return c.jsx(Yv,{code:a.content,sourcePath:t})}return c.jsx(Hl,{})}if(f||!a||a.source==="unavailable")return c.jsx(wt,{title:r("common.empty.content_raw.title"),description:r("common.empty.content_raw.description")});if(t_(a.content))try{const p=JSON.parse(a.content);return c.jsx(Zv,{data:p})}catch{}return c.jsx(Yv,{code:a.content,sourcePath:t})}function Q6({hashId:e,sourceId:t,sourcePath:r,isDaemonOnline:a,available:o,indexModules:l}){const{t:u}=ye(),[f,h]=b.useState(null),[p,m]=b.useState(!1),[x,v]=b.useState(!1),[_,w]=b.useState(null),S=kt(D=>D.triggerIndex),k=kt(D=>D.currentRoot),R=(k&&r?Ml(k.tree,r):null)?.source_type==="doc",E=R?!0:!!a;return b.useEffect(()=>{if(o===!1){v(!0),m(!0),h(null);return}m(!1),v(!1),h(null);const D=R?"?digestType=doc_llm":"";ze.get(`/contents/${e}/digest${D}`).then(L=>{const $="digest"in L?L.digest:L.digests?.[0];$?h($):v(!0),m(!0)}).catch(L=>{L instanceof hn&&L.status===404&&v(!0),m(!0)})},[e,o,R]),p?x||!f?c.jsx(wt,{title:u(R?"digest.doc.empty.title":"digest.empty.title"),description:u(R?"digest.doc.empty.description":"digest.empty.description"),action:t?c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[c.jsx("button",{type:"button",className:`rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90 ${E?"":"opacity-40 cursor-not-allowed"}`,onClick:E?async()=>{w(null);try{(await S(t,l)).status==="skipped"&&(w(u("index.code.skipped")),setTimeout(()=>w(null),3e3))}catch{w(u("index.code.error")),setTimeout(()=>w(null),3e3)}}:void 0,title:!E&&!R?u("daemon.offline_tooltip"):void 0,children:u(R?"digest.doc.empty.cta":"digest.empty.cta")}),_&&c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:_})]}):void 0}):c.jsx(r_,{data:f}):f?c.jsx(r_,{data:f}):c.jsx(Hl,{})}function r_({data:e}){const{t}=ye(),r=e.digest_data,a=r.classes||r.functions||r.relations;if(e.digest_type==="doc_llm")return c.jsx(L6,{digest:r});if(!a)return c.jsxs("div",{className:"flex flex-1 flex-col gap-3",children:[r.language&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:"text-xs text-c4a-text-muted",children:[t("content.detail.language"),":"]}),c.jsx(Bt,{children:r.language})]}),c.jsx("div",{className:"flex flex-1 flex-col overflow-auto rounded border border-c4a-border-subtle p-3",children:c.jsx(Pl,{data:r,defaultExpanded:2})})]});const o=Array.isArray(r.files)?r.files.length:0,l=Array.isArray(r.classes)?r.classes.length:0,u=Array.isArray(r.functions)?r.functions.length:0,f=(Array.isArray(r.relations?.imports)?r.relations.imports.length:0)+(Array.isArray(r.relations?.calls)?r.relations.calls.length:0)+(Array.isArray(r.relations?.inheritance)?r.relations.inheritance.length:0),h=Array.isArray(r.techStack)?r.techStack:[],p=Array.isArray(r.modules)?r.modules:[];return c.jsxs("div",{className:"flex flex-1 flex-col gap-6 overflow-auto c4a-scrollbar",children:[c.jsxs("div",{className:"flex flex-wrap gap-3",children:[c.jsx(ln,{icon:c.jsx(On,{size:14}),label:t("digest.stats.files"),value:o,size:"sm"}),c.jsx(ln,{icon:c.jsx(E1,{size:14}),label:t("digest.stats.classes"),value:l,size:"sm"}),c.jsx(ln,{icon:c.jsx(ER,{size:14}),label:t("digest.stats.functions"),value:u,size:"sm"}),c.jsx(ln,{icon:c.jsx(IC,{size:14}),label:t("digest.stats.relations"),value:f,size:"sm"})]}),h.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("digest.tech_stack")}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(m=>c.jsx(Bt,{children:m},m))})]}),p.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("digest.modules")}),c.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface",children:p.map(m=>c.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 font-mono text-xs border-b border-c4a-border-subtle last:border-b-0",children:[c.jsx("span",{className:"text-c4a-text-primary",children:m.path||m.name}),c.jsxs("span",{className:"text-c4a-text-muted",children:[m.fileCount," files · ",m.totalLines>=1e3?`${(m.totalLines/1e3).toFixed(1)}k`:m.totalLines," lines"]})]},m.path))})]})]})}function Z6({hashId:e,available:t}){const{t:r}=ye(),[a,o]=b.useState(null),[l,u]=b.useState(!1),[f,h]=b.useState(!1);return b.useEffect(()=>{if(t===!1){h(!0),u(!0),o(null);return}u(!1),o(null),h(!1),ze.get(`/contents/${e}/extractions`).then(p=>{!p.extractions||p.extractions.length===0?h(!0):o(p),u(!0)}).catch(p=>{p instanceof hn&&p.status===404&&h(!0),u(!0)})},[e,t]),l?f||!a?c.jsx(wt,{title:r("common.empty.content_extraction.title"),description:r("common.empty.content_extraction.description")}):c.jsx(a_,{extractions:a.extractions}):a?c.jsx(a_,{extractions:a.extractions}):c.jsx(Hl,{})}function a_({extractions:e}){const{t}=ye();return c.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-auto c4a-scrollbar",children:e.map(r=>{const a=Yo(r.extraction_confidence);return c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.model&&c.jsx(Bt,{variant:"muted",children:r.model}),a&&c.jsx(Bt,{variant:a.variant,tooltip:`${a.value.toFixed(2)} — ${t(a.tipKey)}`,children:t(a.labelKey)})]}),c.jsx(Pl,{data:{atoms:r.atoms,candidate_entities:r.candidate_entities},defaultExpanded:2})]},r.id)})})}function J6({hashId:e,available:t}){const{t:r}=ye(),[a,o]=b.useState([]),[l,u]=b.useState(!1),[f,h]=b.useState(!1);return b.useEffect(()=>{if(t===!1){h(!0),u(!0),o([]);return}u(!1),o([]),h(!1),ze.get(`/contents/${e}/entities`).then(p=>{!p.entities||p.entities.length===0?h(!0):o(p.entities),u(!0)}).catch(p=>{p instanceof hn&&p.status===404&&h(!0),u(!0)})},[e,t]),l?f||a.length===0?c.jsx(wt,{title:r("common.empty.content_entities.title"),description:r("common.empty.content_entities.description")}):c.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(p=>c.jsx(Xv,{entity:p},p.id))})}):a.length>0?c.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(p=>c.jsx(Xv,{entity:p},p.id))})}):c.jsx(Hl,{})}const s_={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 W6({data:e,atoms:t}){return c.jsxs("div",{className:"space-y-4",children:[e&&Object.keys(e).length>0&&c.jsx("div",{children:c.jsx(Pl,{data:e,defaultExpanded:2})}),t&&c.jsx(eO,{atoms:t})]})}function eO({atoms:e}){const t=Object.keys(s_);return c.jsx("div",{className:"space-y-2",children:t.map(r=>{const a=e[r];return!a||a.length===0?null:c.jsx(tO,{type:r,label:s_[r]??r,items:a},r)})})}function tO({type:e,label:t,items:r}){const[a,o]=b.useState(!0);return c.jsxs("details",{open:a,onToggle:l=>o(l.target.open),children:[c.jsxs("summary",{className:"cursor-pointer font-mono text-xs uppercase text-c4a-text-secondary hover:text-c4a-text-primary py-1.5",children:[t," (",r.length,")"]}),c.jsx("div",{className:"pl-4 pb-2",children:c.jsx(nO,{type:e,items:r})})]})}function nO({type:e,items:t}){switch(e){case"entities":case"behaviors":case"events":case"relations":return c.jsx(o_,{items:t});case"roles":return c.jsx(rO,{items:t});case"attributes":return c.jsx(aO,{items:t});case"states":return c.jsx(sO,{items:t});case"transitions":return c.jsx(oO,{items:t});case"rules":case"constraints":return c.jsx(iO,{items:t});case"decisions":return c.jsx(lO,{items:t});case"metrics":return c.jsx(cO,{items:t});case"claims":return c.jsx(uO,{items:t});case"comparisons":return c.jsx(dO,{items:t});case"boundaries":return c.jsx(fO,{items:t});default:return c.jsx(o_,{items:t})}}function ra({value:e}){const{t}=ye(),r=Yo(e);return r?c.jsx(Bt,{variant:r.variant,tooltip:`${r.value.toFixed(2)} — ${t(r.tipKey)}`,children:t(r.labelKey)}):null}function o_({items:e}){return c.jsx("div",{className:"space-y-1",children:e.map((t,r)=>c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.ref&&Om(t.ref)?c.jsx(Mm,{pointer:t.ref}):c.jsx("span",{className:"text-c4a-text-primary",children:t.name??String(t)}),c.jsx(ra,{value:t.confidence})]},r))})}function rO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx(Bt,{variant:"accent",children:t.name??"role"}),!!t.performs&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted",children:"performs"}),Om(String(t.performs))?c.jsx(Mm,{pointer:String(t.performs)}):c.jsx("span",{className:"text-c4a-text-primary",children:String(t.performs)})]}),c.jsx(ra,{value:t.confidence})]},r))})}function aO({items:e}){return c.jsx("div",{className:"space-y-1",children:e.map((t,r)=>c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsxs("span",{className:"text-c4a-text-secondary font-mono",children:[t.name,":"]}),c.jsx("span",{className:"text-c4a-text-primary",children:String(t.value??"")}),c.jsx(ra,{value:t.confidence})]},r))})}function sO({items:e}){return c.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map((t,r)=>c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(Bt,{children:t.name??String(t)}),c.jsx(ra,{value:t.confidence})]},r))})}function oO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>{const a=t;return c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx(Bt,{variant:"muted",children:String(a.from_state??"?")}),c.jsx("span",{className:"text-c4a-text-muted",children:"→"}),c.jsx(Bt,{variant:"muted",children:String(a.to_state??"?")}),!!a.trigger&&c.jsx("span",{className:"text-c4a-text-muted italic",children:String(a.trigger)}),c.jsx(ra,{value:t.confidence})]},r)})})}function iO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>{const a=t;return c.jsx("div",{className:"text-xs",children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-c4a-warning font-mono font-bold",children:"IF"}),c.jsx("span",{className:"text-c4a-text-primary",children:String(a.condition??a.name??"")}),c.jsx("span",{className:"text-c4a-accent font-mono font-bold",children:"THEN"}),c.jsx("span",{className:"text-c4a-text-primary",children:String(a.conclusion??a.description??"")}),c.jsx(ra,{value:t.confidence})]})},r)})})}function lO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>c.jsxs("div",{className:"text-xs",children:[c.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),t.description&&c.jsx("span",{className:"text-c4a-text-muted ml-2",children:t.description}),c.jsx(ra,{value:t.confidence})]},r))})}function cO({items:e}){return c.jsx("div",{className:"space-y-1",children:e.map((t,r)=>{const a=t;return c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),!!a.unit&&c.jsx("span",{className:"text-c4a-text-muted",children:String(a.unit)}),!!a.threshold&&c.jsxs("span",{className:"text-c4a-text-secondary",children:["< ",String(a.threshold)]}),c.jsx(ra,{value:t.confidence})]},r)})})}function uO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>{const a=t;return c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[!!a.claim_type&&c.jsx(Bt,{variant:"warning",children:String(a.claim_type)}),c.jsx("span",{className:"text-c4a-text-primary",children:t.description??t.name}),!!a.valid_from&&c.jsxs("span",{className:"text-c4a-text-muted",children:[String(a.valid_from)," 起"]}),c.jsx(ra,{value:t.confidence})]},r)})})}function dO({items:e}){return c.jsx("div",{className:"space-y-3",children:e.map((t,r)=>{const a=t,o=a.criteria,l=a.options;return!o||!l?c.jsx("div",{className:"text-xs text-c4a-text-muted",children:c.jsx(Pl,{data:t,defaultExpanded:1})},r):c.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:c.jsxs("table",{className:"w-full text-xs font-mono",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted",children:[c.jsx("th",{className:"px-2 py-1 text-left",children:"Criteria"}),l.map((u,f)=>c.jsx("th",{className:"px-2 py-1 text-left",children:String(u.name??`Option ${f+1}`)},f))]})}),c.jsx("tbody",{children:o.map((u,f)=>c.jsxs("tr",{className:"border-b border-c4a-border-subtle",children:[c.jsx("td",{className:"px-2 py-1 text-c4a-text-secondary",children:u}),l.map((h,p)=>{const m=h.values;return c.jsx("td",{className:"px-2 py-1 text-c4a-text-primary",children:m?.[f]??"—"},p)})]},f))})]})},r)})})}function fO({items:e}){return c.jsx("div",{className:"space-y-1",children:e.map((t,r)=>{const a=t,o=a.included!==!1&&a.type!=="exclude";return c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx("span",{className:o?"text-c4a-success":"text-c4a-error",children:o?"✓ 包含":"✗ 排除"}),c.jsx("span",{className:"text-c4a-text-primary",children:t.name??t.description}),c.jsx(ra,{value:t.confidence})]},r)})})}function pO({relation:e}){const t=At(),{t:r}=ye(),a=Ko(),o=Yo(e.confidence),l=e.direction==="incoming"?"←":"→",u=()=>{a?.active?a.navigate("relation",e.id,e.type,"↔"):t(sr.relation(e.id))},f=(h,p)=>{h.stopPropagation(),a?.active?a.navigate("entity",p.id,p.name,"🔹"):t(sr.entity(p.id))};return c.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:[c.jsx(Bt,{variant:"accent",children:e.type}),c.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:h=>f(h,e.from),children:e.from.name}),c.jsx("span",{className:"text-c4a-text-muted text-xs shrink-0",children:l}),c.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:h=>f(h,e.to),children:e.to.name}),e.weight!==void 0&&c.jsxs("span",{className:"text-xs text-c4a-text-muted ml-auto shrink-0",children:["w: ",e.weight]}),o&&c.jsx(Bt,{variant:o.variant,tooltip:`${o.value.toFixed(2)} — ${r(o.tipKey)}`,children:r(o.labelKey)})]})}function hO({entityId:e}){const{t}=ye(),[r,a]=b.useState([]),[o,l]=b.useState(!1),[u,f]=b.useState("both"),[h,p]=b.useState(""),[m,x]=b.useState([]);return b.useEffect(()=>{const v={};u!=="both"&&(v.direction=u),h&&(v.type=h),ze.get(`/entities/${e}/relations`,v).then(_=>{if(a(_.relations),m.length===0){const w=[...new Set(_.relations.map(S=>S.type))];x(w)}l(!0)}).catch(()=>{l(!0)})},[e,u,h]),o?r.length===0?c.jsx(wt,{title:t("common.empty.entity_relations.title"),description:t("common.empty.entity_relations.description")}):c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[c.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:[c.jsx("option",{value:"both",children:t("relation.filter.direction.all")}),c.jsx("option",{value:"outgoing",children:t("relation.filter.direction.outgoing")}),c.jsx("option",{value:"incoming",children:t("relation.filter.direction.incoming")})]}),m.length>1&&c.jsxs("select",{value:h,onChange:v=>p(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:[c.jsx("option",{value:"",children:t("relation.filter.type.all")}),m.map(v=>c.jsx("option",{value:v,children:v},v))]})]}),c.jsx("div",{className:"space-y-1",children:r.map(v=>c.jsx(pO,{relation:v},v.id))})]}):c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function mO(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function cw({content:e}){const{t}=ye(),r=At(),a=Ko(),o=e.hash_id.slice(0,12),l=()=>{const u=e.source_path??o;a?.active?a.navigate("content",e.hash_id,u,"📄"):r(sr.content(e.hash_id))};return c.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:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"shrink-0",children:"📄"}),c.jsx("span",{className:"font-mono text-xs text-c4a-accent hover:underline truncate",children:o}),e.byte_size!=null&&c.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:mO(e.byte_size)})]}),e.source_path&&c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted truncate",children:e.source_path}),e.span&&c.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 gO({entityId:e}){const{t}=ye(),[r,a]=b.useState([]),[o,l]=b.useState(!1);return b.useEffect(()=>{ze.get(`/entities/${e}/contents`).then(u=>{a(u.contents??[]),l(!0)}).catch(()=>l(!0))},[e]),o?r.length===0?c.jsx(wt,{title:t("common.empty.entity_contents.title"),description:t("common.empty.entity_contents.description")}):c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map(u=>c.jsx(cw,{content:u},u.hash_id))}):c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function xO({entityId:e}){const{t}=ye(),r=At(),[a,o]=b.useState([]),[l,u]=b.useState(!1);return b.useEffect(()=>{ze.get(`/entities/${e}/referrers`).then(f=>{o(f.referrers??[]),u(!0)}).catch(()=>u(!0))},[e]),l?a.length===0?c.jsx(wt,{title:t("common.empty.entity_referrers.title"),description:t("common.empty.entity_referrers.description")}):c.jsx("div",{className:"space-y-1",children:a.map(f=>c.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>r(sr.entity(f.id)),children:[c.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline truncate",children:f.name}),c.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:f.type}),c.jsx("span",{className:"text-xs text-c4a-text-muted font-mono ml-auto shrink-0",children:f.ref_field}),c.jsxs("span",{className:"text-xs text-c4a-text-muted shrink-0",children:["(",f.ref_type,")"]})]},`${f.id}-${f.ref_field}`))}):c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function yO(e,t){var r,a=1;e==null&&(e=0),t==null&&(t=0);function o(){var l,u=r.length,f,h=0,p=0;for(l=0;l<u;++l)f=r[l],h+=f.x,p+=f.y;for(h=(h/u-e)*a,p=(p/u-t)*a,l=0;l<u;++l)f=r[l],f.x-=h,f.y-=p}return o.initialize=function(l){r=l},o.x=function(l){return arguments.length?(e=+l,o):e},o.y=function(l){return arguments.length?(t=+l,o):t},o.strength=function(l){return arguments.length?(a=+l,o):a},o}function bO(e){const t=+this._x.call(null,e),r=+this._y.call(null,e);return uw(this.cover(t,r),t,r,e)}function uw(e,t,r,a){if(isNaN(t)||isNaN(r))return e;var o,l=e._root,u={data:a},f=e._x0,h=e._y0,p=e._x1,m=e._y1,x,v,_,w,S,k,N,R;if(!l)return e._root=u,e;for(;l.length;)if((S=t>=(x=(f+p)/2))?f=x:p=x,(k=r>=(v=(h+m)/2))?h=v:m=v,o=l,!(l=l[N=k<<1|S]))return o[N]=u,e;if(_=+e._x.call(null,l.data),w=+e._y.call(null,l.data),t===_&&r===w)return u.next=l,o?o[N]=u:e._root=u,e;do o=o?o[N]=new Array(4):e._root=new Array(4),(S=t>=(x=(f+p)/2))?f=x:p=x,(k=r>=(v=(h+m)/2))?h=v:m=v;while((N=k<<1|S)===(R=(w>=v)<<1|_>=x));return o[R]=l,o[N]=u,e}function vO(e){var t,r,a=e.length,o,l,u=new Array(a),f=new Array(a),h=1/0,p=1/0,m=-1/0,x=-1/0;for(r=0;r<a;++r)isNaN(o=+this._x.call(null,t=e[r]))||isNaN(l=+this._y.call(null,t))||(u[r]=o,f[r]=l,o<h&&(h=o),o>m&&(m=o),l<p&&(p=l),l>x&&(x=l));if(h>m||p>x)return this;for(this.cover(h,p).cover(m,x),r=0;r<a;++r)uw(this,u[r],f[r],e[r]);return this}function _O(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,a=this._y0,o=this._x1,l=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,l=(a=Math.floor(t))+1;else{for(var u=o-r||1,f=this._root,h,p;r>e||e>=o||a>t||t>=l;)switch(p=(t<a)<<1|e<r,h=new Array(4),h[p]=f,f=h,u*=2,p){case 0:o=r+u,l=a+u;break;case 1:r=o-u,l=a+u;break;case 2:o=r+u,a=l-u;break;case 3:r=o-u,a=l-u;break}this._root&&this._root.length&&(this._root=f)}return this._x0=r,this._y0=a,this._x1=o,this._y1=l,this}function wO(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function SO(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 Dn(e,t,r,a,o){this.node=e,this.x0=t,this.y0=r,this.x1=a,this.y1=o}function jO(e,t,r){var a,o=this._x0,l=this._y0,u,f,h,p,m=this._x1,x=this._y1,v=[],_=this._root,w,S;for(_&&v.push(new Dn(_,o,l,m,x)),r==null?r=1/0:(o=e-r,l=t-r,m=e+r,x=t+r,r*=r);w=v.pop();)if(!(!(_=w.node)||(u=w.x0)>m||(f=w.y0)>x||(h=w.x1)<o||(p=w.y1)<l))if(_.length){var k=(u+h)/2,N=(f+p)/2;v.push(new Dn(_[3],k,N,h,p),new Dn(_[2],u,N,k,p),new Dn(_[1],k,f,h,N),new Dn(_[0],u,f,k,N)),(S=(t>=N)<<1|e>=k)&&(w=v[v.length-1],v[v.length-1]=v[v.length-1-S],v[v.length-1-S]=w)}else{var R=e-+this._x.call(null,_.data),E=t-+this._y.call(null,_.data),D=R*R+E*E;if(D<r){var L=Math.sqrt(r=D);o=e-L,l=t-L,m=e+L,x=t+L,a=_.data}}return a}function kO(e){if(isNaN(m=+this._x.call(null,e))||isNaN(x=+this._y.call(null,e)))return this;var t,r=this._root,a,o,l,u=this._x0,f=this._y0,h=this._x1,p=this._y1,m,x,v,_,w,S,k,N;if(!r)return this;if(r.length)for(;;){if((w=m>=(v=(u+h)/2))?u=v:h=v,(S=x>=(_=(f+p)/2))?f=_:p=_,t=r,!(r=r[k=S<<1|w]))return this;if(!r.length)break;(t[k+1&3]||t[k+2&3]||t[k+3&3])&&(a=t,N=k)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(l=r.next)&&delete r.next,o?(l?o.next=l:delete o.next,this):t?(l?t[k]=l:delete t[k],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(a?a[N]=r:this._root=r),this):(this._root=l,this)}function NO(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}function EO(){return this._root}function CO(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function RO(e){var t=[],r,a=this._root,o,l,u,f,h;for(a&&t.push(new Dn(a,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(a=r.node,l=r.x0,u=r.y0,f=r.x1,h=r.y1)&&a.length){var p=(l+f)/2,m=(u+h)/2;(o=a[3])&&t.push(new Dn(o,p,m,f,h)),(o=a[2])&&t.push(new Dn(o,l,m,p,h)),(o=a[1])&&t.push(new Dn(o,p,u,f,m)),(o=a[0])&&t.push(new Dn(o,l,u,p,m))}return this}function TO(e){var t=[],r=[],a;for(this._root&&t.push(new Dn(this._root,this._x0,this._y0,this._x1,this._y1));a=t.pop();){var o=a.node;if(o.length){var l,u=a.x0,f=a.y0,h=a.x1,p=a.y1,m=(u+h)/2,x=(f+p)/2;(l=o[0])&&t.push(new Dn(l,u,f,m,x)),(l=o[1])&&t.push(new Dn(l,m,f,h,x)),(l=o[2])&&t.push(new Dn(l,u,x,m,p)),(l=o[3])&&t.push(new Dn(l,m,x,h,p))}r.push(a)}for(;a=r.pop();)e(a.node,a.x0,a.y0,a.x1,a.y1);return this}function AO(e){return e[0]}function LO(e){return arguments.length?(this._x=e,this):this._x}function DO(e){return e[1]}function OO(e){return arguments.length?(this._y=e,this):this._y}function $m(e,t,r){var a=new Bm(t??AO,r??DO,NaN,NaN,NaN,NaN);return e==null?a:a.addAll(e)}function Bm(e,t,r,a,o,l){this._x=e,this._y=t,this._x0=r,this._y0=a,this._x1=o,this._y1=l,this._root=void 0}function i_(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var $n=$m.prototype=Bm.prototype;$n.copy=function(){var e=new Bm(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,a;if(!t)return e;if(!t.length)return e._root=i_(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var o=0;o<4;++o)(a=t.source[o])&&(a.length?r.push({source:a,target:t.target[o]=new Array(4)}):t.target[o]=i_(a));return e};$n.add=bO;$n.addAll=vO;$n.cover=_O;$n.data=wO;$n.extent=SO;$n.find=jO;$n.remove=kO;$n.removeAll=NO;$n.root=EO;$n.size=CO;$n.visit=RO;$n.visitAfter=TO;$n.x=LO;$n.y=OO;function Bs(e){return function(){return e}}function cs(e){return(e()-.5)*1e-6}function MO(e){return e.x+e.vx}function zO(e){return e.y+e.vy}function $O(e){var t,r,a,o=1,l=1;typeof e!="function"&&(e=Bs(e==null?1:+e));function u(){for(var p,m=t.length,x,v,_,w,S,k,N=0;N<l;++N)for(x=$m(t,MO,zO).visitAfter(f),p=0;p<m;++p)v=t[p],S=r[v.index],k=S*S,_=v.x+v.vx,w=v.y+v.vy,x.visit(R);function R(E,D,L,$,z){var T=E.data,B=E.r,H=S+B;if(T){if(T.index>v.index){var J=_-T.x-T.vx,oe=w-T.y-T.vy,ce=J*J+oe*oe;ce<H*H&&(J===0&&(J=cs(a),ce+=J*J),oe===0&&(oe=cs(a),ce+=oe*oe),ce=(H-(ce=Math.sqrt(ce)))/ce*o,v.vx+=(J*=ce)*(H=(B*=B)/(k+B)),v.vy+=(oe*=ce)*H,T.vx-=J*(H=1-H),T.vy-=oe*H)}return}return D>_+H||$<_-H||L>w+H||z<w-H}}function f(p){if(p.data)return p.r=r[p.data.index];for(var m=p.r=0;m<4;++m)p[m]&&p[m].r>p.r&&(p.r=p[m].r)}function h(){if(t){var p,m=t.length,x;for(r=new Array(m),p=0;p<m;++p)x=t[p],r[x.index]=+e(x,p,t)}}return u.initialize=function(p,m){t=p,a=m,h()},u.iterations=function(p){return arguments.length?(l=+p,u):l},u.strength=function(p){return arguments.length?(o=+p,u):o},u.radius=function(p){return arguments.length?(e=typeof p=="function"?p:Bs(+p),h(),u):e},u}function BO(e){return e.index}function l_(e,t){var r=e.get(t);if(!r)throw new Error("node not found: "+t);return r}function IO(e){var t=BO,r=x,a,o=Bs(30),l,u,f,h,p,m=1;e==null&&(e=[]);function x(k){return 1/Math.min(f[k.source.index],f[k.target.index])}function v(k){for(var N=0,R=e.length;N<m;++N)for(var E=0,D,L,$,z,T,B,H;E<R;++E)D=e[E],L=D.source,$=D.target,z=$.x+$.vx-L.x-L.vx||cs(p),T=$.y+$.vy-L.y-L.vy||cs(p),B=Math.sqrt(z*z+T*T),B=(B-l[E])/B*k*a[E],z*=B,T*=B,$.vx-=z*(H=h[E]),$.vy-=T*H,L.vx+=z*(H=1-H),L.vy+=T*H}function _(){if(u){var k,N=u.length,R=e.length,E=new Map(u.map((L,$)=>[t(L,$,u),L])),D;for(k=0,f=new Array(N);k<R;++k)D=e[k],D.index=k,typeof D.source!="object"&&(D.source=l_(E,D.source)),typeof D.target!="object"&&(D.target=l_(E,D.target)),f[D.source.index]=(f[D.source.index]||0)+1,f[D.target.index]=(f[D.target.index]||0)+1;for(k=0,h=new Array(R);k<R;++k)D=e[k],h[k]=f[D.source.index]/(f[D.source.index]+f[D.target.index]);a=new Array(R),w(),l=new Array(R),S()}}function w(){if(u)for(var k=0,N=e.length;k<N;++k)a[k]=+r(e[k],k,e)}function S(){if(u)for(var k=0,N=e.length;k<N;++k)l[k]=+o(e[k],k,e)}return v.initialize=function(k,N){u=k,p=N,_()},v.links=function(k){return arguments.length?(e=k,_(),v):e},v.id=function(k){return arguments.length?(t=k,v):t},v.iterations=function(k){return arguments.length?(m=+k,v):m},v.strength=function(k){return arguments.length?(r=typeof k=="function"?k:Bs(+k),w(),v):r},v.distance=function(k){return arguments.length?(o=typeof k=="function"?k:Bs(+k),S(),v):o},v}var UO={value:()=>{}};function gd(){for(var e=0,t=arguments.length,r={},a;e<t;++e){if(!(a=arguments[e]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new Cu(r)}function Cu(e){this._=e}function PO(e,t){return e.trim().split(/^|\s+/).map(function(r){var a="",o=r.indexOf(".");if(o>=0&&(a=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}Cu.prototype=gd.prototype={constructor:Cu,on:function(e,t){var r=this._,a=PO(e+"",r),o,l=-1,u=a.length;if(arguments.length<2){for(;++l<u;)if((o=(e=a[l]).type)&&(o=HO(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(o=(e=a[l]).type)r[o]=c_(r[o],e.name,t);else if(t==null)for(o in r)r[o]=c_(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Cu(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),a=0,o,l;a<o;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],a=0,o=l.length;a<o;++a)l[a].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,l=a.length;o<l;++o)a[o].value.apply(t,r)}};function HO(e,t){for(var r=0,a=e.length,o;r<a;++r)if((o=e[r]).name===t)return o.value}function c_(e,t,r){for(var a=0,o=e.length;a<o;++a)if(e[a].name===t){e[a]=UO,e=e.slice(0,a).concat(e.slice(a+1));break}return r!=null&&e.push({name:t,value:r}),e}var qo=0,sl=0,Ji=0,dw=1e3,Xu,ol,Qu=0,Ps=0,xd=0,jl=typeof performance=="object"&&performance.now?performance:Date,fw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Im(){return Ps||(fw(qO),Ps=jl.now()+xd)}function qO(){Ps=0}function Zu(){this._call=this._time=this._next=null}Zu.prototype=Um.prototype={constructor:Zu,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Im():+r)+(t==null?0:+t),!this._next&&ol!==this&&(ol?ol._next=this:Xu=this,ol=this),this._call=e,this._time=r,Zh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zh())}};function Um(e,t,r){var a=new Zu;return a.restart(e,t,r),a}function FO(){Im(),++qo;for(var e=Xu,t;e;)(t=Ps-e._time)>=0&&e._call.call(void 0,t),e=e._next;--qo}function u_(){Ps=(Qu=jl.now())+xd,qo=sl=0;try{FO()}finally{qo=0,VO(),Ps=0}}function GO(){var e=jl.now(),t=e-Qu;t>dw&&(xd-=t,Qu=e)}function VO(){for(var e,t=Xu,r,a=1/0;t;)t._call?(a>t._time&&(a=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Xu=r);ol=e,Zh(a)}function Zh(e){if(!qo){sl&&(sl=clearTimeout(sl));var t=e-Ps;t>24?(e<1/0&&(sl=setTimeout(u_,e-jl.now()-xd)),Ji&&(Ji=clearInterval(Ji))):(Ji||(Qu=jl.now(),Ji=setInterval(GO,dw)),qo=1,fw(u_))}}function d_(e,t,r){var a=new Zu;return t=t==null?0:+t,a.restart(o=>{a.stop(),e(o+t)},t,r),a}const YO=1664525,KO=1013904223,f_=4294967296;function XO(){let e=1;return()=>(e=(YO*e+KO)%f_)/f_}function QO(e){return e.x}function ZO(e){return e.y}var JO=10,WO=Math.PI*(3-Math.sqrt(5));function eM(e){var t,r=1,a=.001,o=1-Math.pow(a,1/300),l=0,u=.6,f=new Map,h=Um(x),p=gd("tick","end"),m=XO();e==null&&(e=[]);function x(){v(),p.call("tick",t),r<a&&(h.stop(),p.call("end",t))}function v(S){var k,N=e.length,R;S===void 0&&(S=1);for(var E=0;E<S;++E)for(r+=(l-r)*o,f.forEach(function(D){D(r)}),k=0;k<N;++k)R=e[k],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 _(){for(var S=0,k=e.length,N;S<k;++S){if(N=e[S],N.index=S,N.fx!=null&&(N.x=N.fx),N.fy!=null&&(N.y=N.fy),isNaN(N.x)||isNaN(N.y)){var R=JO*Math.sqrt(.5+S),E=S*WO;N.x=R*Math.cos(E),N.y=R*Math.sin(E)}(isNaN(N.vx)||isNaN(N.vy))&&(N.vx=N.vy=0)}}function w(S){return S.initialize&&S.initialize(e,m),S}return _(),t={tick:v,restart:function(){return h.restart(x),t},stop:function(){return h.stop(),t},nodes:function(S){return arguments.length?(e=S,_(),f.forEach(w),t):e},alpha:function(S){return arguments.length?(r=+S,t):r},alphaMin:function(S){return arguments.length?(a=+S,t):a},alphaDecay:function(S){return arguments.length?(o=+S,t):+o},alphaTarget:function(S){return arguments.length?(l=+S,t):l},velocityDecay:function(S){return arguments.length?(u=1-S,t):1-u},randomSource:function(S){return arguments.length?(m=S,f.forEach(w),t):m},force:function(S,k){return arguments.length>1?(k==null?f.delete(S):f.set(S,w(k)),t):f.get(S)},find:function(S,k,N){var R=0,E=e.length,D,L,$,z,T;for(N==null?N=1/0:N*=N,R=0;R<E;++R)z=e[R],D=S-z.x,L=k-z.y,$=D*D+L*L,$<N&&(T=z,N=$);return T},on:function(S,k){return arguments.length>1?(p.on(S,k),t):p.on(S)}}}function tM(){var e,t,r,a,o=Bs(-30),l,u=1,f=1/0,h=.81;function p(_){var w,S=e.length,k=$m(e,QO,ZO).visitAfter(x);for(a=_,w=0;w<S;++w)t=e[w],k.visit(v)}function m(){if(e){var _,w=e.length,S;for(l=new Array(w),_=0;_<w;++_)S=e[_],l[S.index]=+o(S,_,e)}}function x(_){var w=0,S,k,N=0,R,E,D;if(_.length){for(R=E=D=0;D<4;++D)(S=_[D])&&(k=Math.abs(S.value))&&(w+=S.value,N+=k,R+=k*S.x,E+=k*S.y);_.x=R/N,_.y=E/N}else{S=_,S.x=S.data.x,S.y=S.data.y;do w+=l[S.data.index];while(S=S.next)}_.value=w}function v(_,w,S,k){if(!_.value)return!0;var N=_.x-t.x,R=_.y-t.y,E=k-w,D=N*N+R*R;if(E*E/h<D)return D<f&&(N===0&&(N=cs(r),D+=N*N),R===0&&(R=cs(r),D+=R*R),D<u&&(D=Math.sqrt(u*D)),t.vx+=N*_.value*a/D,t.vy+=R*_.value*a/D),!0;if(_.length||D>=f)return;(_.data!==t||_.next)&&(N===0&&(N=cs(r),D+=N*N),R===0&&(R=cs(r),D+=R*R),D<u&&(D=Math.sqrt(u*D)));do _.data!==t&&(E=l[_.data.index]*a/D,t.vx+=N*E,t.vy+=R*E);while(_=_.next)}return p.initialize=function(_,w){e=_,r=w,m()},p.strength=function(_){return arguments.length?(o=typeof _=="function"?_:Bs(+_),m(),p):o},p.distanceMin=function(_){return arguments.length?(u=_*_,p):Math.sqrt(u)},p.distanceMax=function(_){return arguments.length?(f=_*_,p):Math.sqrt(f)},p.theta=function(_){return arguments.length?(h=_*_,p):Math.sqrt(h)},p}var Jh="http://www.w3.org/1999/xhtml";const p_={svg:"http://www.w3.org/2000/svg",xhtml:Jh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yd(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),p_.hasOwnProperty(t)?{space:p_[t],local:e}:e}function nM(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Jh&&t.documentElement.namespaceURI===Jh?t.createElement(e):t.createElementNS(r,e)}}function rM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pw(e){var t=yd(e);return(t.local?rM:nM)(t)}function aM(){}function Pm(e){return e==null?aM:function(){return this.querySelector(e)}}function sM(e){typeof e!="function"&&(e=Pm(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=new Array(u),h,p,m=0;m<u;++m)(h=l[m])&&(p=e.call(h,h.__data__,m,l))&&("__data__"in h&&(p.__data__=h.__data__),f[m]=p);return new or(a,this._parents)}function oM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function iM(){return[]}function hw(e){return e==null?iM:function(){return this.querySelectorAll(e)}}function lM(e){return function(){return oM(e.apply(this,arguments))}}function cM(e){typeof e=="function"?e=lM(e):e=hw(e);for(var t=this._groups,r=t.length,a=[],o=[],l=0;l<r;++l)for(var u=t[l],f=u.length,h,p=0;p<f;++p)(h=u[p])&&(a.push(e.call(h,h.__data__,p,u)),o.push(h));return new or(a,o)}function mw(e){return function(){return this.matches(e)}}function gw(e){return function(t){return t.matches(e)}}var uM=Array.prototype.find;function dM(e){return function(){return uM.call(this.children,e)}}function fM(){return this.firstElementChild}function pM(e){return this.select(e==null?fM:dM(typeof e=="function"?e:gw(e)))}var hM=Array.prototype.filter;function mM(){return Array.from(this.children)}function gM(e){return function(){return hM.call(this.children,e)}}function xM(e){return this.selectAll(e==null?mM:gM(typeof e=="function"?e:gw(e)))}function yM(e){typeof e!="function"&&(e=mw(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=[],h,p=0;p<u;++p)(h=l[p])&&e.call(h,h.__data__,p,l)&&f.push(h);return new or(a,this._parents)}function xw(e){return new Array(e.length)}function bM(){return new or(this._enter||this._groups.map(xw),this._parents)}function Ju(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ju.prototype={constructor:Ju,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 vM(e){return function(){return e}}function _M(e,t,r,a,o,l){for(var u=0,f,h=t.length,p=l.length;u<p;++u)(f=t[u])?(f.__data__=l[u],a[u]=f):r[u]=new Ju(e,l[u]);for(;u<h;++u)(f=t[u])&&(o[u]=f)}function wM(e,t,r,a,o,l,u){var f,h,p=new Map,m=t.length,x=l.length,v=new Array(m),_;for(f=0;f<m;++f)(h=t[f])&&(v[f]=_=u.call(h,h.__data__,f,t)+"",p.has(_)?o[f]=h:p.set(_,h));for(f=0;f<x;++f)_=u.call(e,l[f],f,l)+"",(h=p.get(_))?(a[f]=h,h.__data__=l[f],p.delete(_)):r[f]=new Ju(e,l[f]);for(f=0;f<m;++f)(h=t[f])&&p.get(v[f])===h&&(o[f]=h)}function SM(e){return e.__data__}function jM(e,t){if(!arguments.length)return Array.from(this,SM);var r=t?wM:_M,a=this._parents,o=this._groups;typeof e!="function"&&(e=vM(e));for(var l=o.length,u=new Array(l),f=new Array(l),h=new Array(l),p=0;p<l;++p){var m=a[p],x=o[p],v=x.length,_=kM(e.call(m,m&&m.__data__,p,a)),w=_.length,S=f[p]=new Array(w),k=u[p]=new Array(w),N=h[p]=new Array(v);r(m,x,S,k,N,_,t);for(var R=0,E=0,D,L;R<w;++R)if(D=S[R]){for(R>=E&&(E=R+1);!(L=k[E])&&++E<w;);D._next=L||null}}return u=new or(u,a),u._enter=f,u._exit=h,u}function kM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function NM(){return new or(this._exit||this._groups.map(xw),this._parents)}function EM(e,t,r){var a=this.enter(),o=this,l=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?l.remove():r(l),a&&o?a.merge(o).order():o}function CM(e){for(var t=e.selection?e.selection():e,r=this._groups,a=t._groups,o=r.length,l=a.length,u=Math.min(o,l),f=new Array(o),h=0;h<u;++h)for(var p=r[h],m=a[h],x=p.length,v=f[h]=new Array(x),_,w=0;w<x;++w)(_=p[w]||m[w])&&(v[w]=_);for(;h<o;++h)f[h]=r[h];return new or(f,this._parents)}function RM(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var a=e[t],o=a.length-1,l=a[o],u;--o>=0;)(u=a[o])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function TM(e){e||(e=AM);function t(x,v){return x&&v?e(x.__data__,v.__data__):!x-!v}for(var r=this._groups,a=r.length,o=new Array(a),l=0;l<a;++l){for(var u=r[l],f=u.length,h=o[l]=new Array(f),p,m=0;m<f;++m)(p=u[m])&&(h[m]=p);h.sort(t)}return new or(o,this._parents).order()}function AM(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function LM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function DM(){return Array.from(this)}function OM(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],o=0,l=a.length;o<l;++o){var u=a[o];if(u)return u}return null}function MM(){let e=0;for(const t of this)++e;return e}function zM(){return!this.node()}function $M(e){for(var t=this._groups,r=0,a=t.length;r<a;++r)for(var o=t[r],l=0,u=o.length,f;l<u;++l)(f=o[l])&&e.call(f,f.__data__,l,o);return this}function BM(e){return function(){this.removeAttribute(e)}}function IM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UM(e,t){return function(){this.setAttribute(e,t)}}function PM(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function HM(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function qM(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function FM(e,t){var r=yd(e);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((t==null?r.local?IM:BM:typeof t=="function"?r.local?qM:HM:r.local?PM:UM)(r,t))}function yw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function GM(e){return function(){this.style.removeProperty(e)}}function VM(e,t,r){return function(){this.style.setProperty(e,t,r)}}function YM(e,t,r){return function(){var a=t.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,r)}}function KM(e,t,r){return arguments.length>1?this.each((t==null?GM:typeof t=="function"?YM:VM)(e,t,r??"")):Fo(this.node(),e)}function Fo(e,t){return e.style.getPropertyValue(t)||yw(e).getComputedStyle(e,null).getPropertyValue(t)}function XM(e){return function(){delete this[e]}}function QM(e,t){return function(){this[e]=t}}function ZM(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function JM(e,t){return arguments.length>1?this.each((t==null?XM:typeof t=="function"?ZM:QM)(e,t)):this.node()[e]}function bw(e){return e.trim().split(/^|\s+/)}function Hm(e){return e.classList||new vw(e)}function vw(e){this._node=e,this._names=bw(e.getAttribute("class")||"")}vw.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 _w(e,t){for(var r=Hm(e),a=-1,o=t.length;++a<o;)r.add(t[a])}function ww(e,t){for(var r=Hm(e),a=-1,o=t.length;++a<o;)r.remove(t[a])}function WM(e){return function(){_w(this,e)}}function e8(e){return function(){ww(this,e)}}function t8(e,t){return function(){(t.apply(this,arguments)?_w:ww)(this,e)}}function n8(e,t){var r=bw(e+"");if(arguments.length<2){for(var a=Hm(this.node()),o=-1,l=r.length;++o<l;)if(!a.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?t8:t?WM:e8)(r,t))}function r8(){this.textContent=""}function a8(e){return function(){this.textContent=e}}function s8(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function o8(e){return arguments.length?this.each(e==null?r8:(typeof e=="function"?s8:a8)(e)):this.node().textContent}function i8(){this.innerHTML=""}function l8(e){return function(){this.innerHTML=e}}function c8(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function u8(e){return arguments.length?this.each(e==null?i8:(typeof e=="function"?c8:l8)(e)):this.node().innerHTML}function d8(){this.nextSibling&&this.parentNode.appendChild(this)}function f8(){return this.each(d8)}function p8(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function h8(){return this.each(p8)}function m8(e){var t=typeof e=="function"?e:pw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function g8(){return null}function x8(e,t){var r=typeof e=="function"?e:pw(e),a=t==null?g8:typeof t=="function"?t:Pm(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function y8(){var e=this.parentNode;e&&e.removeChild(this)}function b8(){return this.each(y8)}function v8(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _8(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function w8(e){return this.select(e?_8:v8)}function S8(e){return arguments.length?this.property("__data__",e):this.node().__data__}function j8(e){return function(t){e.call(this,t,this.__data__)}}function k8(e){return e.trim().split(/^|\s+/).map(function(t){var r="",a=t.indexOf(".");return a>=0&&(r=t.slice(a+1),t=t.slice(0,a)),{type:t,name:r}})}function N8(e){return function(){var t=this.__on;if(t){for(var r=0,a=-1,o=t.length,l;r<o;++r)l=t[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++a]=l;++a?t.length=a:delete this.__on}}}function E8(e,t,r){return function(){var a=this.__on,o,l=j8(t);if(a){for(var u=0,f=a.length;u<f;++u)if((o=a[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=r),o.value=t;return}}this.addEventListener(e.type,l,r),o={type:e.type,name:e.name,value:t,listener:l,options:r},a?a.push(o):this.__on=[o]}}function C8(e,t,r){var a=k8(e+""),o,l=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,p=f.length,m;h<p;++h)for(o=0,m=f[h];o<l;++o)if((u=a[o]).type===m.type&&u.name===m.name)return m.value}return}for(f=t?E8:N8,o=0;o<l;++o)this.each(f(a[o],t,r));return this}function Sw(e,t,r){var a=yw(e),o=a.CustomEvent;typeof o=="function"?o=new o(t,r):(o=a.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function R8(e,t){return function(){return Sw(this,e,t)}}function T8(e,t){return function(){return Sw(this,e,t.apply(this,arguments))}}function A8(e,t){return this.each((typeof t=="function"?T8:R8)(e,t))}function*L8(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],o=0,l=a.length,u;o<l;++o)(u=a[o])&&(yield u)}var jw=[null];function or(e,t){this._groups=e,this._parents=t}function ql(){return new or([[document.documentElement]],jw)}function D8(){return this}or.prototype=ql.prototype={constructor:or,select:sM,selectAll:cM,selectChild:pM,selectChildren:xM,filter:yM,data:jM,enter:bM,exit:NM,join:EM,merge:CM,selection:D8,order:RM,sort:TM,call:LM,nodes:DM,node:OM,size:MM,empty:zM,each:$M,attr:FM,style:KM,property:JM,classed:n8,text:o8,html:u8,raise:f8,lower:h8,append:m8,insert:x8,remove:b8,clone:w8,datum:S8,on:C8,dispatch:A8,[Symbol.iterator]:L8};function wr(e){return typeof e=="string"?new or([[document.querySelector(e)]],[document.documentElement]):new or([[e]],jw)}function O8(e){let t;for(;t=e.sourceEvent;)e=t;return e}function As(e,t){if(e=O8(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const Wh={capture:!0,passive:!1};function em(e){e.preventDefault(),e.stopImmediatePropagation()}function M8(e){var t=e.document.documentElement,r=wr(e).on("dragstart.drag",em,Wh);"onselectstart"in t?r.on("selectstart.drag",em,Wh):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function z8(e,t){var r=e.document.documentElement,a=wr(e).on("dragstart.drag",null);t&&(a.on("click.drag",em,Wh),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function qm(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function kw(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function Fl(){}var kl=.7,Wu=1/kl,Io="\\s*([+-]?\\d+)\\s*",Nl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$8=/^#([0-9a-f]{3,8})$/,B8=new RegExp(`^rgb\\(${Io},${Io},${Io}\\)$`),I8=new RegExp(`^rgb\\(${Zr},${Zr},${Zr}\\)$`),U8=new RegExp(`^rgba\\(${Io},${Io},${Io},${Nl}\\)$`),P8=new RegExp(`^rgba\\(${Zr},${Zr},${Zr},${Nl}\\)$`),H8=new RegExp(`^hsl\\(${Nl},${Zr},${Zr}\\)$`),q8=new RegExp(`^hsla\\(${Nl},${Zr},${Zr},${Nl}\\)$`),h_={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};qm(Fl,El,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:m_,formatHex:m_,formatHex8:F8,formatHsl:G8,formatRgb:g_,toString:g_});function m_(){return this.rgb().formatHex()}function F8(){return this.rgb().formatHex8()}function G8(){return Nw(this).formatHsl()}function g_(){return this.rgb().formatRgb()}function El(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=$8.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?x_(t):r===3?new Vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?yu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?yu(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=B8.exec(e))?new Vn(t[1],t[2],t[3],1):(t=I8.exec(e))?new Vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=U8.exec(e))?yu(t[1],t[2],t[3],t[4]):(t=P8.exec(e))?yu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=H8.exec(e))?v_(t[1],t[2]/100,t[3]/100,1):(t=q8.exec(e))?v_(t[1],t[2]/100,t[3]/100,t[4]):h_.hasOwnProperty(e)?x_(h_[e]):e==="transparent"?new Vn(NaN,NaN,NaN,0):null}function x_(e){return new Vn(e>>16&255,e>>8&255,e&255,1)}function yu(e,t,r,a){return a<=0&&(e=t=r=NaN),new Vn(e,t,r,a)}function V8(e){return e instanceof Fl||(e=El(e)),e?(e=e.rgb(),new Vn(e.r,e.g,e.b,e.opacity)):new Vn}function tm(e,t,r,a){return arguments.length===1?V8(e):new Vn(e,t,r,a??1)}function Vn(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}qm(Vn,tm,kw(Fl,{brighter(e){return e=e==null?Wu:Math.pow(Wu,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kl:Math.pow(kl,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vn(Is(this.r),Is(this.g),Is(this.b),ed(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:y_,formatHex:y_,formatHex8:Y8,formatRgb:b_,toString:b_}));function y_(){return`#${zs(this.r)}${zs(this.g)}${zs(this.b)}`}function Y8(){return`#${zs(this.r)}${zs(this.g)}${zs(this.b)}${zs((isNaN(this.opacity)?1:this.opacity)*255)}`}function b_(){const e=ed(this.opacity);return`${e===1?"rgb(":"rgba("}${Is(this.r)}, ${Is(this.g)}, ${Is(this.b)}${e===1?")":`, ${e})`}`}function ed(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Is(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zs(e){return e=Is(e),(e<16?"0":"")+e.toString(16)}function v_(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ar(e,t,r,a)}function Nw(e){if(e instanceof Ar)return new Ar(e.h,e.s,e.l,e.opacity);if(e instanceof Fl||(e=El(e)),!e)return new Ar;if(e instanceof Ar)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,o=Math.min(t,r,a),l=Math.max(t,r,a),u=NaN,f=l-o,h=(l+o)/2;return f?(t===l?u=(r-a)/f+(r<a)*6:r===l?u=(a-t)/f+2:u=(t-r)/f+4,f/=h<.5?l+o:2-l-o,u*=60):f=h>0&&h<1?0:u,new Ar(u,f,h,e.opacity)}function K8(e,t,r,a){return arguments.length===1?Nw(e):new Ar(e,t,r,a??1)}function Ar(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}qm(Ar,K8,kw(Fl,{brighter(e){return e=e==null?Wu:Math.pow(Wu,e),new Ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kl:Math.pow(kl,e),new Ar(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,r=this.l,a=r+(r<.5?r:1-r)*t,o=2*r-a;return new Vn(uh(e>=240?e-240:e+120,o,a),uh(e,o,a),uh(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new Ar(__(this.h),bu(this.s),bu(this.l),ed(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=ed(this.opacity);return`${e===1?"hsl(":"hsla("}${__(this.h)}, ${bu(this.s)*100}%, ${bu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function __(e){return e=(e||0)%360,e<0?e+360:e}function bu(e){return Math.max(0,Math.min(1,e||0))}function uh(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Ew=e=>()=>e;function X8(e,t){return function(r){return e+r*t}}function Q8(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function Z8(e){return(e=+e)==1?Cw:function(t,r){return r-t?Q8(t,r,e):Ew(isNaN(t)?r:t)}}function Cw(e,t){var r=t-e;return r?X8(e,r):Ew(isNaN(e)?t:e)}const w_=(function e(t){var r=Z8(t);function a(o,l){var u=r((o=tm(o)).r,(l=tm(l)).r),f=r(o.g,l.g),h=r(o.b,l.b),p=Cw(o.opacity,l.opacity);return function(m){return o.r=u(m),o.g=f(m),o.b=h(m),o.opacity=p(m),o+""}}return a.gamma=e,a})(1);function ss(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var nm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dh=new RegExp(nm.source,"g");function J8(e){return function(){return e}}function W8(e){return function(t){return e(t)+""}}function ez(e,t){var r=nm.lastIndex=dh.lastIndex=0,a,o,l,u=-1,f=[],h=[];for(e=e+"",t=t+"";(a=nm.exec(e))&&(o=dh.exec(t));)(l=o.index)>r&&(l=t.slice(r,l),f[u]?f[u]+=l:f[++u]=l),(a=a[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:ss(a,o)})),r=dh.lastIndex;return r<t.length&&(l=t.slice(r),f[u]?f[u]+=l:f[++u]=l),f.length<2?h[0]?W8(h[0].x):J8(t):(t=h.length,function(p){for(var m=0,x;m<t;++m)f[(x=h[m]).i]=x.x(p);return f.join("")})}var S_=180/Math.PI,rm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rw(e,t,r,a,o,l){var u,f,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*r+t*a)&&(r-=e*h,a-=t*h),(f=Math.sqrt(r*r+a*a))&&(r/=f,a/=f,h/=f),e*a<t*r&&(e=-e,t=-t,h=-h,u=-u),{translateX:o,translateY:l,rotate:Math.atan2(t,e)*S_,skewX:Math.atan(h)*S_,scaleX:u,scaleY:f}}var vu;function tz(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rm:Rw(t.a,t.b,t.c,t.d,t.e,t.f)}function nz(e){return e==null||(vu||(vu=document.createElementNS("http://www.w3.org/2000/svg","g")),vu.setAttribute("transform",e),!(e=vu.transform.baseVal.consolidate()))?rm:(e=e.matrix,Rw(e.a,e.b,e.c,e.d,e.e,e.f))}function Tw(e,t,r,a){function o(p){return p.length?p.pop()+" ":""}function l(p,m,x,v,_,w){if(p!==x||m!==v){var S=_.push("translate(",null,t,null,r);w.push({i:S-4,x:ss(p,x)},{i:S-2,x:ss(m,v)})}else(x||v)&&_.push("translate("+x+t+v+r)}function u(p,m,x,v){p!==m?(p-m>180?m+=360:m-p>180&&(p+=360),v.push({i:x.push(o(x)+"rotate(",null,a)-2,x:ss(p,m)})):m&&x.push(o(x)+"rotate("+m+a)}function f(p,m,x,v){p!==m?v.push({i:x.push(o(x)+"skewX(",null,a)-2,x:ss(p,m)}):m&&x.push(o(x)+"skewX("+m+a)}function h(p,m,x,v,_,w){if(p!==x||m!==v){var S=_.push(o(_)+"scale(",null,",",null,")");w.push({i:S-4,x:ss(p,x)},{i:S-2,x:ss(m,v)})}else(x!==1||v!==1)&&_.push(o(_)+"scale("+x+","+v+")")}return function(p,m){var x=[],v=[];return p=e(p),m=e(m),l(p.translateX,p.translateY,m.translateX,m.translateY,x,v),u(p.rotate,m.rotate,x,v),f(p.skewX,m.skewX,x,v),h(p.scaleX,p.scaleY,m.scaleX,m.scaleY,x,v),p=m=null,function(_){for(var w=-1,S=v.length,k;++w<S;)x[(k=v[w]).i]=k.x(_);return x.join("")}}}var rz=Tw(tz,"px, ","px)","deg)"),az=Tw(nz,", ",")",")"),sz=1e-12;function j_(e){return((e=Math.exp(e))+1/e)/2}function oz(e){return((e=Math.exp(e))-1/e)/2}function iz(e){return((e=Math.exp(2*e))-1)/(e+1)}const lz=(function e(t,r,a){function o(l,u){var f=l[0],h=l[1],p=l[2],m=u[0],x=u[1],v=u[2],_=m-f,w=x-h,S=_*_+w*w,k,N;if(S<sz)N=Math.log(v/p)/t,k=function(z){return[f+z*_,h+z*w,p*Math.exp(t*z*N)]};else{var R=Math.sqrt(S),E=(v*v-p*p+a*S)/(2*p*r*R),D=(v*v-p*p-a*S)/(2*v*r*R),L=Math.log(Math.sqrt(E*E+1)-E),$=Math.log(Math.sqrt(D*D+1)-D);N=($-L)/t,k=function(z){var T=z*N,B=j_(L),H=p/(r*R)*(B*iz(t*T+L)-oz(L));return[f+H*_,h+H*w,p*B/j_(t*T+L)]}}return k.duration=N*1e3*t/Math.SQRT2,k}return o.rho=function(l){var u=Math.max(.001,+l),f=u*u,h=f*f;return e(u,f,h)},o})(Math.SQRT2,2,4);var cz=gd("start","end","cancel","interrupt"),uz=[],Aw=0,k_=1,am=2,Ru=3,N_=4,sm=5,Tu=6;function bd(e,t,r,a,o,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;dz(e,r,{name:t,index:a,group:o,on:cz,tween:uz,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Aw})}function Fm(e,t){var r=Mr(e,t);if(r.state>Aw)throw new Error("too late; already scheduled");return r}function aa(e,t){var r=Mr(e,t);if(r.state>Ru)throw new Error("too late; already running");return r}function Mr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function dz(e,t,r){var a=e.__transition,o;a[t]=r,r.timer=Um(l,0,r.time);function l(p){r.state=k_,r.timer.restart(u,r.delay,r.time),r.delay<=p&&u(p-r.delay)}function u(p){var m,x,v,_;if(r.state!==k_)return h();for(m in a)if(_=a[m],_.name===r.name){if(_.state===Ru)return d_(u);_.state===N_?(_.state=Tu,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete a[m]):+m<t&&(_.state=Tu,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete a[m])}if(d_(function(){r.state===Ru&&(r.state=N_,r.timer.restart(f,r.delay,r.time),f(p))}),r.state=am,r.on.call("start",e,e.__data__,r.index,r.group),r.state===am){for(r.state=Ru,o=new Array(v=r.tween.length),m=0,x=-1;m<v;++m)(_=r.tween[m].value.call(e,e.__data__,r.index,r.group))&&(o[++x]=_);o.length=x+1}}function f(p){for(var m=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(h),r.state=sm,1),x=-1,v=o.length;++x<v;)o[x].call(e,m);r.state===sm&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=Tu,r.timer.stop(),delete a[t];for(var p in a)return;delete e.__transition}}function Au(e,t){var r=e.__transition,a,o,l=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((a=r[u]).name!==t){l=!1;continue}o=a.state>am&&a.state<sm,a.state=Tu,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete r[u]}l&&delete e.__transition}}function fz(e){return this.each(function(){Au(this,e)})}function pz(e,t){var r,a;return function(){var o=aa(this,e),l=o.tween;if(l!==r){a=r=l;for(var u=0,f=a.length;u<f;++u)if(a[u].name===t){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function hz(e,t,r){var a,o;if(typeof r!="function")throw new Error;return function(){var l=aa(this,e),u=l.tween;if(u!==a){o=(a=u).slice();for(var f={name:t,value:r},h=0,p=o.length;h<p;++h)if(o[h].name===t){o[h]=f;break}h===p&&o.push(f)}l.tween=o}}function mz(e,t){var r=this._id;if(e+="",arguments.length<2){for(var a=Mr(this.node(),r).tween,o=0,l=a.length,u;o<l;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((t==null?pz:hz)(r,e,t))}function Gm(e,t,r){var a=e._id;return e.each(function(){var o=aa(this,a);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return Mr(o,a).value[t]}}function Lw(e,t){var r;return(typeof t=="number"?ss:t instanceof El?w_:(r=El(t))?(t=r,w_):ez)(e,t)}function gz(e){return function(){this.removeAttribute(e)}}function xz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yz(e,t,r){var a,o=r+"",l;return function(){var u=this.getAttribute(e);return u===o?null:u===a?l:l=t(a=u,r)}}function bz(e,t,r){var a,o=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?l:l=t(a=u,r)}}function vz(e,t,r){var a,o,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f)))}}function _z(e,t,r){var a,o,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f)))}}function wz(e,t){var r=yd(e),a=r==="transform"?az:Lw;return this.attrTween(e,typeof t=="function"?(r.local?_z:vz)(r,a,Gm(this,"attr."+e,t)):t==null?(r.local?xz:gz)(r):(r.local?bz:yz)(r,a,t))}function Sz(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function jz(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function kz(e,t){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&jz(e,l)),r}return o._value=t,o}function Nz(e,t){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&Sz(e,l)),r}return o._value=t,o}function Ez(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var a=yd(e);return this.tween(r,(a.local?kz:Nz)(a,t))}function Cz(e,t){return function(){Fm(this,e).delay=+t.apply(this,arguments)}}function Rz(e,t){return t=+t,function(){Fm(this,e).delay=t}}function Tz(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cz:Rz)(t,e)):Mr(this.node(),t).delay}function Az(e,t){return function(){aa(this,e).duration=+t.apply(this,arguments)}}function Lz(e,t){return t=+t,function(){aa(this,e).duration=t}}function Dz(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Az:Lz)(t,e)):Mr(this.node(),t).duration}function Oz(e,t){if(typeof t!="function")throw new Error;return function(){aa(this,e).ease=t}}function Mz(e){var t=this._id;return arguments.length?this.each(Oz(t,e)):Mr(this.node(),t).ease}function zz(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;aa(this,e).ease=r}}function $z(e){if(typeof e!="function")throw new Error;return this.each(zz(this._id,e))}function Bz(e){typeof e!="function"&&(e=mw(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=[],h,p=0;p<u;++p)(h=l[p])&&e.call(h,h.__data__,p,l)&&f.push(h);return new La(a,this._parents,this._name,this._id)}function Iz(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,a=t.length,o=r.length,l=Math.min(a,o),u=new Array(a),f=0;f<l;++f)for(var h=t[f],p=r[f],m=h.length,x=u[f]=new Array(m),v,_=0;_<m;++_)(v=h[_]||p[_])&&(x[_]=v);for(;f<a;++f)u[f]=t[f];return new La(u,this._parents,this._name,this._id)}function Uz(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Pz(e,t,r){var a,o,l=Uz(t)?Fm:aa;return function(){var u=l(this,e),f=u.on;f!==a&&(o=(a=f).copy()).on(t,r),u.on=o}}function Hz(e,t){var r=this._id;return arguments.length<2?Mr(this.node(),r).on.on(e):this.each(Pz(r,e,t))}function qz(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Fz(){return this.on("end.remove",qz(this._id))}function Gz(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Pm(e));for(var a=this._groups,o=a.length,l=new Array(o),u=0;u<o;++u)for(var f=a[u],h=f.length,p=l[u]=new Array(h),m,x,v=0;v<h;++v)(m=f[v])&&(x=e.call(m,m.__data__,v,f))&&("__data__"in m&&(x.__data__=m.__data__),p[v]=x,bd(p[v],t,r,v,p,Mr(m,r)));return new La(l,this._parents,t,r)}function Vz(e){var t=this._name,r=this._id;typeof e!="function"&&(e=hw(e));for(var a=this._groups,o=a.length,l=[],u=[],f=0;f<o;++f)for(var h=a[f],p=h.length,m,x=0;x<p;++x)if(m=h[x]){for(var v=e.call(m,m.__data__,x,h),_,w=Mr(m,r),S=0,k=v.length;S<k;++S)(_=v[S])&&bd(_,t,r,S,v,w);l.push(v),u.push(m)}return new La(l,u,t,r)}var Yz=ql.prototype.constructor;function Kz(){return new Yz(this._groups,this._parents)}function Xz(e,t){var r,a,o;return function(){var l=Fo(this,e),u=(this.style.removeProperty(e),Fo(this,e));return l===u?null:l===r&&u===a?o:o=t(r=l,a=u)}}function Dw(e){return function(){this.style.removeProperty(e)}}function Qz(e,t,r){var a,o=r+"",l;return function(){var u=Fo(this,e);return u===o?null:u===a?l:l=t(a=u,r)}}function Zz(e,t,r){var a,o,l;return function(){var u=Fo(this,e),f=r(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),Fo(this,e))),u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f))}}function Jz(e,t){var r,a,o,l="style."+t,u="end."+l,f;return function(){var h=aa(this,e),p=h.on,m=h.value[l]==null?f||(f=Dw(t)):void 0;(p!==r||o!==m)&&(a=(r=p).copy()).on(u,o=m),h.on=a}}function Wz(e,t,r){var a=(e+="")=="transform"?rz:Lw;return t==null?this.styleTween(e,Xz(e,a)).on("end.style."+e,Dw(e)):typeof t=="function"?this.styleTween(e,Zz(e,a,Gm(this,"style."+e,t))).each(Jz(this._id,e)):this.styleTween(e,Qz(e,a,t),r).on("end.style."+e,null)}function e$(e,t,r){return function(a){this.style.setProperty(e,t.call(this,a),r)}}function t$(e,t,r){var a,o;function l(){var u=t.apply(this,arguments);return u!==o&&(a=(o=u)&&e$(e,u,r)),a}return l._value=t,l}function n$(e,t,r){var a="style."+(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;return this.tween(a,t$(e,t,r??""))}function r$(e){return function(){this.textContent=e}}function a$(e){return function(){var t=e(this);this.textContent=t??""}}function s$(e){return this.tween("text",typeof e=="function"?a$(Gm(this,"text",e)):r$(e==null?"":e+""))}function o$(e){return function(t){this.textContent=e.call(this,t)}}function i$(e){var t,r;function a(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&o$(o)),t}return a._value=e,a}function l$(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,i$(e))}function c$(){for(var e=this._name,t=this._id,r=Ow(),a=this._groups,o=a.length,l=0;l<o;++l)for(var u=a[l],f=u.length,h,p=0;p<f;++p)if(h=u[p]){var m=Mr(h,t);bd(h,e,r,p,u,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new La(a,this._parents,e,r)}function u$(){var e,t,r=this,a=r._id,o=r.size();return new Promise(function(l,u){var f={value:u},h={value:function(){--o===0&&l()}};r.each(function(){var p=aa(this,a),m=p.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),p.on=t}),o===0&&l()})}var d$=0;function La(e,t,r,a){this._groups=e,this._parents=t,this._name=r,this._id=a}function Ow(){return++d$}var Na=ql.prototype;La.prototype={constructor:La,select:Gz,selectAll:Vz,selectChild:Na.selectChild,selectChildren:Na.selectChildren,filter:Bz,merge:Iz,selection:Kz,transition:c$,call:Na.call,nodes:Na.nodes,node:Na.node,size:Na.size,empty:Na.empty,each:Na.each,on:Hz,attr:wz,attrTween:Ez,style:Wz,styleTween:n$,text:s$,textTween:l$,remove:Fz,tween:mz,delay:Tz,duration:Dz,ease:Mz,easeVarying:$z,end:u$,[Symbol.iterator]:Na[Symbol.iterator]};function f$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var p$={time:null,delay:0,duration:250,ease:f$};function h$(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function m$(e){var t,r;e instanceof La?(t=e._id,e=e._name):(t=Ow(),(r=p$).time=Im(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,l=0;l<o;++l)for(var u=a[l],f=u.length,h,p=0;p<f;++p)(h=u[p])&&bd(h,e,t,p,u,r||h$(h,t));return new La(a,this._parents,e,t)}ql.prototype.interrupt=fz;ql.prototype.transition=m$;const _u=e=>()=>e;function g$(e,{sourceEvent:t,target:r,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function Ta(e,t,r){this.k=e,this.x=t,this.y=r}Ta.prototype={constructor:Ta,scale:function(e){return e===1?this:new Ta(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ta(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 Vm=new Ta(1,0,0);Ta.prototype;function fh(e){e.stopImmediatePropagation()}function Wi(e){e.preventDefault(),e.stopImmediatePropagation()}function x$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function y$(){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 E_(){return this.__zoom||Vm}function b$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function v$(){return navigator.maxTouchPoints||"ontouchstart"in this}function _$(e,t,r){var a=e.invertX(t[0][0])-r[0][0],o=e.invertX(t[1][0])-r[1][0],l=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function w$(){var e=x$,t=y$,r=_$,a=b$,o=v$,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=lz,p=gd("start","zoom","end"),m,x,v,_=500,w=150,S=0,k=10;function N(M){M.property("__zoom",E_).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",H).filter(o).on("touchstart.zoom",J).on("touchmove.zoom",oe).on("touchend.zoom touchcancel.zoom",ce).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(M,P,A,F){var ee=M.selection?M.selection():M;ee.property("__zoom",E_),M!==ee?L(M,P,A,F):ee.interrupt().each(function(){$(this,arguments).event(F).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},N.scaleBy=function(M,P,A,F){N.scaleTo(M,function(){var ee=this.__zoom.k,ae=typeof P=="function"?P.apply(this,arguments):P;return ee*ae},A,F)},N.scaleTo=function(M,P,A,F){N.transform(M,function(){var ee=t.apply(this,arguments),ae=this.__zoom,W=A==null?D(ee):typeof A=="function"?A.apply(this,arguments):A,O=ae.invert(W),V=typeof P=="function"?P.apply(this,arguments):P;return r(E(R(ae,V),W,O),ee,u)},A,F)},N.translateBy=function(M,P,A,F){N.transform(M,function(){return r(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),u)},null,F)},N.translateTo=function(M,P,A,F,ee){N.transform(M,function(){var ae=t.apply(this,arguments),W=this.__zoom,O=F==null?D(ae):typeof F=="function"?F.apply(this,arguments):F;return r(Vm.translate(O[0],O[1]).scale(W.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof A=="function"?-A.apply(this,arguments):-A),ae,u)},F,ee)};function R(M,P){return P=Math.max(l[0],Math.min(l[1],P)),P===M.k?M:new Ta(P,M.x,M.y)}function E(M,P,A){var F=P[0]-A[0]*M.k,ee=P[1]-A[1]*M.k;return F===M.x&&ee===M.y?M:new Ta(M.k,F,ee)}function D(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function L(M,P,A,F){M.on("start.zoom",function(){$(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(F).end()}).tween("zoom",function(){var ee=this,ae=arguments,W=$(ee,ae).event(F),O=t.apply(ee,ae),V=A==null?D(O):typeof A=="function"?A.apply(ee,ae):A,re=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),se=ee.__zoom,ne=typeof P=="function"?P.apply(ee,ae):P,ge=h(se.invert(V).concat(re/se.k),ne.invert(V).concat(re/ne.k));return function(Ne){if(Ne===1)Ne=ne;else{var Fe=ge(Ne),qe=re/Fe[2];Ne=new Ta(qe,V[0]-Fe[0]*qe,V[1]-Fe[1]*qe)}W.zoom(null,Ne)}})}function $(M,P,A){return!A&&M.__zooming||new z(M,P)}function z(M,P){this.that=M,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,P),this.taps=0}z.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,P){return this.mouse&&M!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var P=wr(this.that).datum();p.call(M,this.that,new g$(M,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:p}),P)}};function T(M,...P){if(!e.apply(this,arguments))return;var A=$(this,P).event(M),F=this.__zoom,ee=Math.max(l[0],Math.min(l[1],F.k*Math.pow(2,a.apply(this,arguments)))),ae=As(M);if(A.wheel)(A.mouse[0][0]!==ae[0]||A.mouse[0][1]!==ae[1])&&(A.mouse[1]=F.invert(A.mouse[0]=ae)),clearTimeout(A.wheel);else{if(F.k===ee)return;A.mouse=[ae,F.invert(ae)],Au(this),A.start()}Wi(M),A.wheel=setTimeout(W,w),A.zoom("mouse",r(E(R(F,ee),A.mouse[0],A.mouse[1]),A.extent,u));function W(){A.wheel=null,A.end()}}function B(M,...P){if(v||!e.apply(this,arguments))return;var A=M.currentTarget,F=$(this,P,!0).event(M),ee=wr(M.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",re,!0),ae=As(M,A),W=M.clientX,O=M.clientY;M8(M.view),fh(M),F.mouse=[ae,this.__zoom.invert(ae)],Au(this),F.start();function V(se){if(Wi(se),!F.moved){var ne=se.clientX-W,ge=se.clientY-O;F.moved=ne*ne+ge*ge>S}F.event(se).zoom("mouse",r(E(F.that.__zoom,F.mouse[0]=As(se,A),F.mouse[1]),F.extent,u))}function re(se){ee.on("mousemove.zoom mouseup.zoom",null),z8(se.view,F.moved),Wi(se),F.event(se).end()}}function H(M,...P){if(e.apply(this,arguments)){var A=this.__zoom,F=As(M.changedTouches?M.changedTouches[0]:M,this),ee=A.invert(F),ae=A.k*(M.shiftKey?.5:2),W=r(E(R(A,ae),F,ee),t.apply(this,P),u);Wi(M),f>0?wr(this).transition().duration(f).call(L,W,F,M):wr(this).call(N.transform,W,F,M)}}function J(M,...P){if(e.apply(this,arguments)){var A=M.touches,F=A.length,ee=$(this,P,M.changedTouches.length===F).event(M),ae,W,O,V;for(fh(M),W=0;W<F;++W)O=A[W],V=As(O,this),V=[V,this.__zoom.invert(V),O.identifier],ee.touch0?!ee.touch1&&ee.touch0[2]!==V[2]&&(ee.touch1=V,ee.taps=0):(ee.touch0=V,ae=!0,ee.taps=1+!!m);m&&(m=clearTimeout(m)),ae&&(ee.taps<2&&(x=V[0],m=setTimeout(function(){m=null},_)),Au(this),ee.start())}}function oe(M,...P){if(this.__zooming){var A=$(this,P).event(M),F=M.changedTouches,ee=F.length,ae,W,O,V;for(Wi(M),ae=0;ae<ee;++ae)W=F[ae],O=As(W,this),A.touch0&&A.touch0[2]===W.identifier?A.touch0[0]=O:A.touch1&&A.touch1[2]===W.identifier&&(A.touch1[0]=O);if(W=A.that.__zoom,A.touch1){var re=A.touch0[0],se=A.touch0[1],ne=A.touch1[0],ge=A.touch1[1],Ne=(Ne=ne[0]-re[0])*Ne+(Ne=ne[1]-re[1])*Ne,Fe=(Fe=ge[0]-se[0])*Fe+(Fe=ge[1]-se[1])*Fe;W=R(W,Math.sqrt(Ne/Fe)),O=[(re[0]+ne[0])/2,(re[1]+ne[1])/2],V=[(se[0]+ge[0])/2,(se[1]+ge[1])/2]}else if(A.touch0)O=A.touch0[0],V=A.touch0[1];else return;A.zoom("touch",r(E(W,O,V),A.extent,u))}}function ce(M,...P){if(this.__zooming){var A=$(this,P).event(M),F=M.changedTouches,ee=F.length,ae,W;for(fh(M),v&&clearTimeout(v),v=setTimeout(function(){v=null},_),ae=0;ae<ee;++ae)W=F[ae],A.touch0&&A.touch0[2]===W.identifier?delete A.touch0:A.touch1&&A.touch1[2]===W.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&&(W=As(W,this),Math.hypot(x[0]-W[0],x[1]-W[1])<k)){var O=wr(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return N.wheelDelta=function(M){return arguments.length?(a=typeof M=="function"?M:_u(+M),N):a},N.filter=function(M){return arguments.length?(e=typeof M=="function"?M:_u(!!M),N):e},N.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:_u(!!M),N):o},N.extent=function(M){return arguments.length?(t=typeof M=="function"?M:_u([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),N):t},N.scaleExtent=function(M){return arguments.length?(l[0]=+M[0],l[1]=+M[1],N):[l[0],l[1]]},N.translateExtent=function(M){return arguments.length?(u[0][0]=+M[0][0],u[1][0]=+M[1][0],u[0][1]=+M[0][1],u[1][1]=+M[1][1],N):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},N.constrain=function(M){return arguments.length?(r=M,N):r},N.duration=function(M){return arguments.length?(f=+M,N):f},N.interpolate=function(M){return arguments.length?(h=M,N):h},N.on=function(){var M=p.on.apply(p,arguments);return M===p?N:M},N.clickDistance=function(M){return arguments.length?(S=(M=+M)*M,N):Math.sqrt(S)},N.tapDistance=function(M){return arguments.length?(k=+M,N):k},N}const S$=new Set(["CONTAINS","IMPLEMENTS","CORRESPONDS"]),j$=new Set(["REFERENCES","MENTIONS"]);function k$(e){return S$.has(e)?"skeleton":j$.has(e)?"weak":"standard"}const N$=30,wu=800,el=500;function E$({centerNode:e,neighbors:t}){const[r,a]=b.useState(t.length>N$?"table":"graph");return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-end gap-1 mb-3",children:[c.jsx("button",{onClick:()=>a("graph"),className:`p-1.5 rounded transition-colors ${r==="graph"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"力导向图",children:c.jsx(jC,{size:16})}),c.jsx("button",{onClick:()=>a("table"),className:`p-1.5 rounded transition-colors ${r==="table"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"表格模式",children:c.jsx(RC,{size:16})})]}),r==="graph"?c.jsx(C$,{centerNode:e,neighbors:t}):c.jsx(R$,{neighbors:t})]})}function C$({centerNode:e,neighbors:t}){const r=b.useRef(null),a=At(),{t:o}=ye(),l=b.useCallback(f=>a(sr.entity(f)),[a]),u=b.useCallback(f=>a(sr.relation(f)),[a]);return b.useEffect(()=>{const f=r.current;if(!f)return;const h=wr(f);h.selectAll("*").remove();const p=new Map;p.set(e.id,{id:e.id,name:e.name,type:e.type,kind:e.kind,isCenter:!0,x:wu/2,y:el/2});for(const E of t)p.has(E.neighbor.id)||p.set(E.neighbor.id,{id:E.neighbor.id,name:E.neighbor.name,type:E.neighbor.type,kind:E.neighbor.kind,isCenter:!1});const m=Array.from(p.values()),x=t.map(E=>{const D={id:E.id,type:E.type,edgeClass:k$(E.type),source:E.direction==="outgoing"?e.id:E.neighbor.id,target:E.direction==="outgoing"?E.neighbor.id:e.id};return E.confidence!==void 0&&(D.confidence=E.confidence),D});h.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 _=h.append("g"),w=w$().scaleExtent([.3,3]).on("zoom",E=>{_.attr("transform",E.transform)});h.call(w).call(w.transform,Vm);const S=_.selectAll("line.link").data(x).join("line").attr("class","link").attr("stroke",E=>E.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",E=>E.edgeClass==="skeleton"?2:1).attr("stroke-dasharray",E=>E.edgeClass==="weak"?"4 3":null).attr("opacity",E=>E.edgeClass==="weak"?.6:1).attr("marker-end","url(#arrow)").style("cursor","pointer").on("click",(E,D)=>u(D.id)).on("mouseenter",function(){wr(this).attr("stroke","var(--c4a-accent)").attr("stroke-width",function(){return Number(wr(this).attr("stroke-width"))+1})}).on("mouseleave",function(E,D){wr(this).attr("stroke",D.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",D.edgeClass==="skeleton"?2:1)});S.append("title").text(E=>{const D=Yo(E.confidence);return D?`${E.type} · ${o(D.labelKey)}`:E.type});const k=_.selectAll("text.link-label").data(x).join("text").attr("class","link-label").text(E=>E.type).attr("font-family","var(--font-mono)").attr("font-size",9).attr("fill","var(--c4a-text-muted)").attr("text-anchor","middle").attr("dy",-4),N=_.selectAll("g.node").data(m,E=>E.id).join("g").attr("class","node").style("cursor","pointer").on("click",(E,D)=>l(D.id));N.append("circle").attr("r",E=>E.isCenter?24:18).attr("fill",E=>E.isCenter?"var(--c4a-accent)":"var(--c4a-bg-elevated)").attr("stroke",E=>E.isCenter?"#fff":"var(--c4a-border-default)").attr("stroke-width",E=>E.isCenter?2:1),N.append("text").text(E=>E.name.length>12?E.name.slice(0,12)+"…":E.name).attr("font-family","var(--font-mono)").attr("font-size",10).attr("fill","var(--c4a-text-primary)").attr("text-anchor","middle").attr("dy",E=>E.isCenter?36:30),N.append("title").text(E=>{let D=`${E.name}
|
|
97
|
+
type: ${E.type}`;return E.kind&&(D+=`
|
|
98
|
+
kind: ${E.kind}`),D});const R=eM(m).force("link",IO(x).id(E=>E.id).distance(120)).force("charge",tM().strength(-300)).force("center",yO(wu/2,el/2)).force("collide",$O(30)).on("tick",()=>{S.attr("x1",E=>E.source.x??0).attr("y1",E=>E.source.y??0).attr("x2",E=>E.target.x??0).attr("y2",E=>E.target.y??0),k.attr("x",E=>{const D=E.source.x??0,L=E.target.x??0;return(D+L)/2}).attr("y",E=>{const D=E.source.y??0,L=E.target.y??0;return(D+L)/2}),N.attr("transform",E=>`translate(${E.x??0},${E.y??0})`)});return N.each(function(E,D){const L=wr(this);let $=!1;L.on("mousedown.drag",z=>{z.stopPropagation(),$=!0;const T=m[D],B=f.getBoundingClientRect(),H=oe=>{if(!$)return;const ce=_.attr("transform");let M=0,P=0,A=1;if(ce){const ae=ce.match(/translate\(([-\d.e+]+)[, ]([-\d.e+]+)\)\s*scale\(([-\d.e+]+)\)/);ae&&(M=parseFloat(ae[1]),P=parseFloat(ae[2]),A=parseFloat(ae[3]))}const F=(oe.clientX-B.left)/B.width*wu,ee=(oe.clientY-B.top)/B.height*el;T.fx=(F-M)/A,T.fy=(ee-P)/A,R.alpha(.3).restart()},J=()=>{$=!1,T.fx=null,T.fy=null,document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",J)};document.addEventListener("mousemove",H),document.addEventListener("mouseup",J)})}),()=>{R.stop()}},[e,t,l,u]),c.jsx("svg",{ref:r,width:"100%",height:el,viewBox:`0 0 ${wu} ${el}`,className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface"})}function R$({neighbors:e}){const t=At();return c.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:c.jsxs("table",{className:"w-full text-xs font-mono",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted text-left",children:[c.jsx("th",{className:"px-3 py-2",children:"NAME"}),c.jsx("th",{className:"px-3 py-2",children:"TYPE"}),c.jsx("th",{className:"px-3 py-2",children:"KIND"}),c.jsx("th",{className:"px-3 py-2",children:"EDGE"}),c.jsx("th",{className:"px-3 py-2",children:"DIRECTION"})]})}),c.jsx("tbody",{children:e.map(r=>c.jsxs("tr",{className:"border-b border-c4a-border-subtle hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>t(sr.entity(r.neighbor.id)),children:[c.jsx("td",{className:"px-3 py-2 text-c4a-accent",children:r.neighbor.name}),c.jsx("td",{className:"px-3 py-2 text-c4a-text-secondary",children:r.neighbor.type}),c.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:r.neighbor.kind??"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(Bt,{variant:"accent",children:r.type})}),c.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:r.direction==="outgoing"?"→":"←"})]},r.id))})]})})}function T$({entityId:e,centerNode:t}){const{t:r}=ye(),[a,o]=b.useState([]),[l,u]=b.useState(!1);return b.useEffect(()=>{ze.get(`/entities/${e}/neighbors`).then(f=>{const h=[];for(const p of f.neighbors)for(const m of p.via)h.push({id:m.relation_id,type:m.type,direction:m.direction,neighbor:{id:p.id,name:p.name,type:p.type,...p.kind?{kind:p.kind}:{}},...m.weight!==void 0?{weight:m.weight}:{},...m.confidence!==void 0?{confidence:m.confidence}:{}});o(h),u(!0)}).catch(()=>u(!0))},[e]),l?a.length===0?c.jsx(wt,{title:r("common.empty.entity_neighbors.title"),description:r("common.empty.entity_neighbors.description")}):c.jsx(E$,{centerNode:t,neighbors:a}):c.jsx("p",{className:"text-sm text-c4a-text-muted",children:r("common.loading")})}const A$={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function L$({entityId:e}){const{t}=ye(),[r,a]=b.useState(null),[o,l]=b.useState(null),[u,f]=b.useState("overview");if(b.useEffect(()=>{e&&(l(null),a(null),f("overview"),ze.get(`/entities/${e}`).then(a).catch(S=>{S instanceof hn&&S.status===404?l("not_found"):l("load_failed")}))},[e]),o)return c.jsx(wt,{title:t(`common.error.${o}`),description:t(`common.error.${o}_description`)});if(!r)return c.jsx("div",{className:"flex items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const h=A$[r.type]??"🔹",p=r._links,m=p?.relations?.count,x=p?.contents?.count,v=p?.referrers?.count,{atoms:_,...w}=r.data;return c.jsxs("div",{className:"flex flex-1 flex-col",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xl",children:h}),c.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:r.name})]}),c.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[c.jsx(Bt,{children:r.type}),r.kind&&c.jsx(Bt,{variant:"muted",children:r.kind})]}),(r.perspective||r.scope)&&c.jsxs("div",{className:"mt-1 flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[r.perspective&&c.jsxs("span",{children:[t("entity.detail.perspective"),":"," ",c.jsx("span",{className:"text-c4a-text-secondary",children:r.perspective})]}),r.scope&&c.jsxs("span",{children:[t("entity.detail.scope"),":"," ",c.jsx("span",{className:"text-c4a-text-secondary",children:r.scope})]})]}),c.jsxs(n4,{value:u,onChange:S=>f(S),children:[c.jsx("div",{className:"mt-3",children:c.jsxs(r4,{children:[c.jsx(Vr,{value:"overview",children:t("entity.detail.tab.overview")}),c.jsxs(Vr,{value:"relations",children:[t("entity.detail.tab.relations"),m!==void 0&&` (${m})`]}),c.jsxs(Vr,{value:"contents",children:[t("entity.detail.tab.contents"),x!==void 0&&` (${x})`]}),c.jsxs(Vr,{value:"referrers",children:[t("entity.detail.tab.referrers"),v!==void 0&&` (${v})`]}),c.jsx(Vr,{value:"neighbors",children:t("entity.detail.tab.neighbors")})]})}),c.jsxs("div",{className:"mt-4 flex-1",children:[c.jsx(Yr,{value:"overview",children:c.jsx(W6,{data:w,atoms:_})}),c.jsx(Yr,{value:"relations",children:c.jsx(hO,{entityId:r.id})}),c.jsx(Yr,{value:"contents",children:c.jsx(gO,{entityId:r.id})}),c.jsx(Yr,{value:"referrers",children:c.jsx(xO,{entityId:r.id})}),c.jsx(Yr,{value:"neighbors",children:c.jsx(T$,{entityId:r.id,centerNode:{id:r.id,name:r.name,type:r.type,...r.kind?{kind:r.kind}:{}}})})]})]})]})}const Mw={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function D$(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function O$({relationId:e}){const{t}=ye(),r=At(),a=Ko(),[o,l]=b.useState(null),[u,f]=b.useState(null),[h,p]=b.useState([]),[m,x]=b.useState(!1);b.useEffect(()=>{e&&(f(null),l(null),p([]),x(!1),ze.get(`/relations/${e}`).then(S=>{l(S),ze.get(`/relations/${e}/contents`).then(k=>{p(k.contents??[]),x(!0)}).catch(()=>x(!0))}).catch(S=>{S instanceof hn&&S.status===404?f("not_found"):f("load_failed")}))},[e]);const v=S=>{const k=Mw[S.type]??"🔹";a?.active?a.navigate("entity",S.id,S.name,k):r(sr.entity(S.id))};if(u)return c.jsx(wt,{title:t(`common.error.${u}`),description:t(`common.error.${u}_description`)});if(!o)return c.jsx("div",{className:"flex items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const _=Yo(o.confidence),w=o.metadata?._source==="field_sync"?t("relation.detail.source_field_sync"):t("relation.detail.source_explicit");return c.jsxs("div",{className:"flex flex-1 flex-col",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:o.type}),_&&c.jsx(Bt,{variant:_.variant,tooltip:`${_.value.toFixed(2)} — ${t(_.tipKey)}`,children:t(_.labelKey)})]}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-4",children:[c.jsx(C_,{label:t("relation.detail.from"),entity:o.from,onClick:()=>v(o.from)}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-c4a-text-muted text-lg",children:"→"}),c.jsx(Bt,{variant:"accent",children:o.type}),c.jsx("span",{className:"text-c4a-text-muted text-lg",children:"→"})]}),c.jsx(C_,{label:t("relation.detail.to"),entity:o.to,onClick:()=>v(o.to)})]}),!!o.data.description&&c.jsxs("div",{className:"mt-4",children:[c.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.description")}),c.jsx("p",{className:"text-sm text-c4a-text-secondary",children:String(o.data.description)})]}),Object.keys(o.data).filter(S=>S!=="description").length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.data")}),c.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3",children:c.jsx(Pl,{data:Object.fromEntries(Object.entries(o.data).filter(([S])=>S!=="description")),defaultExpanded:2})})]}),m&&h.length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.source_refs")}),c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:h.map(S=>c.jsx(cw,{content:{hash_id:S.hash_id,...S.source_path?{source_path:S.source_path}:{},...S.span?{span:S.span}:{}}},S.hash_id))})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.meta")}),c.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[c.jsxs("span",{className:"text-c4a-text-muted",children:[t("relation.detail.source_label"),":",c.jsx("span",{className:"text-c4a-text-secondary ml-1",children:w})]}),o.metadata?.created_at&&c.jsxs("span",{className:"text-c4a-text-muted",children:[t("content.detail.created_at"),":",c.jsx("span",{className:"text-c4a-text-secondary ml-1",children:D$(String(o.metadata.created_at))})]})]})]})]})}function C_({label:e,entity:t,onClick:r}){const a=Mw[t.type]??"🔹";return c.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:r,children:[c.jsx("p",{className:"text-[10px] font-mono uppercase text-c4a-text-muted mb-1",children:e}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{children:a}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:t.name})]}),c.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[c.jsx(Bt,{children:t.type}),t.kind&&c.jsx(Bt,{variant:"muted",children:t.kind})]})]})}const M$=[1,2,3];function z$({functionName:e,sourceIds:t}){const{t:r}=ye(),[a,o]=b.useState("callers"),[l,u]=b.useState(1),{data:f,loading:h,error:p,warnings:m}=Mn(S=>S.callGraph),x=Mn(S=>S.fetchCallGraph),v=Mn(S=>S.resetQuery);b.useEffect(()=>{if(t?.length)return x({sourceIds:t,functionName:e,direction:a,maxDepth:l}),()=>v("callGraph")},[e,a,l,t?.join(",")]);const _=b.useCallback(S=>{o(S)},[]),w=f??[];return c.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[r("query.call_graph.title"),": ",e.includes("#")?e.slice(e.indexOf("#")+1):e]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx(ph,{label:r("query.call_graph.callers"),active:a==="callers",onClick:()=>_("callers")}),c.jsx(ph,{label:r("query.call_graph.callees"),active:a==="callees",onClick:()=>_("callees")})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:[r("query.call_graph.depth"),":"]}),M$.map(S=>c.jsx(ph,{label:String(S),active:l===S,onClick:()=>u(S)},S))]})]})]}),m.length>0&&c.jsx(md,{warnings:m}),h?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ta,{labelKey:"query.symbol.loading"})}):p?c.jsx(wt,{title:r("query.call_graph.empty"),description:p}):w.length===0?c.jsx(wt,{title:r("query.call_graph.empty"),description:r("query.call_graph.empty_desc",{direction:r(`query.call_graph.${a}`)})}):c.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:w.map((S,k)=>c.jsx($$,{entry:S,direction:a},`${S.caller}-${S.callee}-${k}`))})]})}function ph({label:e,active:t,onClick:r}){return c.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:r,children:e})}function $$({entry:e,direction:t}){const r=t==="callers"?e.caller:e.callee,a=(e.depth-1)*16,o=r.indexOf("#"),l=o>=0?r.slice(o+1):r,u=o>=0?r.slice(0,o):null;return c.jsxs("div",{className:"flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",style:{paddingLeft:a+12},children:[c.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:"ƒ"}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:l}),u&&c.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted truncate",children:[u,e.line!=null?`:${e.line}`:""]}),e.isExternal&&c.jsx("span",{className:"font-mono text-[10px] uppercase text-c4a-text-muted bg-c4a-bg-active px-1 py-0.5 rounded-sm shrink-0",children:"ext"})]})}function B$({filePath:e,sourceIds:t}){const{t:r}=ye(),[a,o]=b.useState("forward"),{data:l,loading:u,error:f,warnings:h}=Mn(N=>N.imports),p=Mn(N=>N.fetchImports),m=Mn(N=>N.resetQuery),x=Ra(N=>N.openTab);b.useEffect(()=>{if(t?.length)return p({sourceIds:t,filePath:e,direction:a}),()=>m("imports")},[e,a,t?.join(",")]);const v=b.useCallback(N=>{o(N)},[]),_=b.useCallback(N=>{if(!N.hashId)return;const R=a==="forward"?N.to:N.from;x({id:`content:${N.hashId}`,type:"content",resourceId:N.hashId,label:R,meta:{sourcePath:R}})},[a,x]),w=l??[],{external:S,internal:k}=b.useMemo(()=>{const N=[],R=[];for(const E of w)E.isExternal?N.push(E):R.push(E);return{external:N,internal:R}},[w]);return c.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary truncate",children:[r("query.import_deps.title"),": ",e]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx(R_,{label:r("query.import_deps.forward"),active:a==="forward",onClick:()=>v("forward")}),c.jsx(R_,{label:r("query.import_deps.reverse"),active:a==="reverse",onClick:()=>v("reverse")})]})]}),h.length>0&&c.jsx(md,{warnings:h}),u?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ta,{labelKey:"query.symbol.loading"})}):f?c.jsx(wt,{title:r("query.import_deps.empty"),description:f}):w.length===0?c.jsx(wt,{title:r("query.import_deps.empty"),description:r("query.import_deps.empty")}):c.jsxs("div",{className:"overflow-y-auto c4a-scrollbar",children:[S.length>0&&c.jsx(T_,{title:r("query.import_deps.external"),count:S.length,entries:S,isExternal:!0,direction:a}),k.length>0&&c.jsx(T_,{title:r("query.import_deps.internal"),count:k.length,entries:k,isExternal:!1,direction:a,onOpen:_})]})]})}function R_({label:e,active:t,onClick:r}){return c.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:r,children:e})}function T_({title:e,count:t,entries:r,isExternal:a,direction:o,onOpen:l}){return c.jsxs("div",{className:"mb-4",children:[c.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted mb-2",children:[e," (",t,")"]}),r.map((u,f)=>c.jsx(I$,{entry:u,isExternal:a,direction:o,onOpen:l},`${u.from}-${u.to}-${f}`))]})}function I$({entry:e,isExternal:t,direction:r,onOpen:a}){const o=t?Dr:ym,l=r==="forward"?e.to:e.from,u=e.symbols.join(", "),f=!t&&!!e.hashId&&!!a;return c.jsxs("div",{className:`flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50 ${f?"cursor-pointer":""}`,onClick:f?()=>a(e):void 0,children:[c.jsx(o,{size:13,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:`font-mono text-sm truncate ${f?"text-c4a-accent hover:underline":"text-c4a-text-primary"}`,children:l}),u&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted shrink-0",children:"→"}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-secondary truncate",children:u})]})]})}function U$({className:e,sourceIds:t}){const{t:r}=ye(),[a,o]=b.useState("descendants"),{data:l,loading:u,error:f,warnings:h}=Mn(k=>k.inheritance),p=Mn(k=>k.fetchInheritance),m=Mn(k=>k.resetQuery),x=kt(k=>k.rootSources),v=b.useMemo(()=>x.filter(k=>k.source_type==="code"&&(k.index_status==="indexed"||k.index_status==="stale")).map(k=>k.id),[x]),_=v.length>0?v:t??[];b.useEffect(()=>{if(_.length)return p({sourceIds:_,className:e,direction:a}),()=>m("inheritance")},[e,a,_.join(",")]);const w=b.useCallback(k=>{o(k)},[]),S=l??[];return c.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary truncate",children:[r("query.inheritance.title"),": ",e.includes("#")?e.slice(e.indexOf("#")+1):e]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx(A_,{label:r("query.inheritance.descendants"),active:a==="descendants",onClick:()=>w("descendants")}),c.jsx(A_,{label:r("query.inheritance.ancestors"),active:a==="ancestors",onClick:()=>w("ancestors")})]})]}),h.length>0&&c.jsx(md,{warnings:h}),u?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ta,{labelKey:"query.symbol.loading"})}):f?c.jsx(wt,{title:r("query.inheritance.empty"),description:f}):S.length===0?c.jsx(wt,{title:r("query.inheritance.empty"),description:r("query.inheritance.empty")}):c.jsxs("div",{className:"overflow-y-auto c4a-scrollbar",children:[S.map((k,N)=>c.jsx(P$,{entry:k,direction:a},`${k.child}-${k.parent}-${N}`)),_.length>1&&c.jsx("div",{className:"mt-3 px-3 font-mono text-[11px] text-c4a-text-muted",children:r("query.inheritance.cross_source",{count:_.length})})]})]})}function A_({label:e,active:t,onClick:r}){return c.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:r,children:e})}function P$({entry:e,direction:t}){const r=t==="descendants"?e.child:e.parent;return c.jsxs("div",{className:"flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",children:[c.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:"■"}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:r}),c.jsx(Bt,{variant:"muted",children:e.kind}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted truncate",children:e.sourceId})]})}function H$({anchor:e,children:t}){const{t:r}=ye(),a=Ra(w=>w.tabs),o=Ra(w=>w.activeTabId),l=Ra(w=>w.mode),{reset:u,setAnchor:f,activateTab:h,closeTab:p,closeAll:m,toggleMode:x}=Ra.getState();b.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=a.find(w=>w.id===o),_=a.length>1;return c.jsx(IA,{children:c.jsxs("div",{className:"flex flex-1 flex-col",children:[c.jsx("div",{className:"flex flex-1 flex-col",children:!v||v.isAnchor?t:c.jsx(q$,{tab:v})}),_&&c.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-40 flex h-6 items-center border-t border-c4a-border-subtle bg-c4a-bg-surface md:left-[220px]",children:[c.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:a.map(w=>{const S=w.id===o;return c.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 ${S?"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:()=>h(w.id),children:[w.icon&&c.jsx("span",{className:"shrink-0 text-[10px]",children:w.icon}),c.jsx("span",{className:"truncate",children:w.label}),!w.isAnchor&&c.jsx("button",{type:"button",className:"ml-0.5 shrink-0 text-c4a-text-muted hover:text-c4a-text-primary",onClick:k=>{k.stopPropagation(),p(w.id)},children:c.jsx(Or,{className:"h-2 w-2"})})]},w.id)})}),c.jsxs("div",{className:"flex items-center gap-0.5 px-1 shrink-0",children:[c.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:r(l==="append"?"explorer.mode.append_tooltip":"explorer.mode.replace_tooltip"),onClick:x,children:c.jsx("span",{className:"text-[10px]",children:l==="append"?"📑":"📌"})}),c.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:r("explorer.close_all"),onClick:m,children:c.jsx(Or,{className:"h-2.5 w-2.5"})})]})]})]})})}function q$({tab:e}){switch(e.type){case"content":return c.jsx(lw,{hashId:e.resourceId,sourcePath:e.meta?.sourcePath??e.label,paragraphMeta:e.meta});case"entity":return c.jsx(L$,{entityId:e.resourceId});case"relation":return c.jsx(O$,{relationId:e.resourceId});case"call-graph":return c.jsx(z$,{functionName:e.resourceId,sourceIds:e.meta?.sourceIds});case"import-deps":return c.jsx(B$,{filePath:e.resourceId,sourceIds:e.meta?.sourceIds});case"inheritance":return c.jsx(U$,{className:e.resourceId,sourceIds:e.meta?.sourceIds});default:return null}}function L_(e){if(!e)return"";try{const t=new Date(e),r=new Date,a=t.getFullYear()===r.getFullYear(),o=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 a?`${o}-${l} ${u}:${f}`:`${t.getFullYear()}-${o}-${l} ${u}:${f}`}catch{return""}}function F$({versions:e,currentHashId:t,onChange:r}){const[a,o]=b.useState(!1),l=b.useRef(null),u=b.useRef(null),f=b.useCallback(v=>{l.current&&!l.current.contains(v.target)&&o(!1)},[]);b.useEffect(()=>{if(a)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a,f]);const h=b.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),e.length>1&&o(!0)},[e.length]),p=b.useCallback(()=>{u.current=setTimeout(()=>o(!1),150)},[]),m=e.find(v=>v.hash_id===t)??e[0],x=L_(m?.created_at);return c.jsxs("div",{ref:l,className:"relative",onMouseEnter:h,onMouseLeave:p,children:[c.jsxs("button",{type:"button",onClick:e.length>1?()=>o(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:[c.jsxs("span",{children:[c.jsx("span",{className:"font-extrabold",children:m?.version_label}),x?` ${x}`:""]}),e.length>1&&c.jsx($t,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${a?"rotate-90":""}`})]}),a&&c.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 _=v.hash_id===t,w=L_(v.created_at);return c.jsx("div",{className:`flex cursor-pointer items-center px-2 py-1 font-mono text-[10px] transition-colors hover:bg-c4a-bg-hover ${_?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,onClick:()=>{r(v.hash_id),o(!1)},children:c.jsxs("span",{children:[c.jsx("span",{className:"font-extrabold",children:v.version_label}),w?` ${w}`:""]})},v.hash_id)})})]})}function D_(e){if(!e)return"";try{const t=new Date(e),r=new Date,a=t.getFullYear()===r.getFullYear(),o=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 a?`${o}-${l} ${u}:${f}`:`${t.getFullYear()}-${o}-${l} ${u}:${f}`}catch{return""}}function G$({commits:e,currentHashId:t,onChange:r}){const[a,o]=b.useState(!1),l=b.useRef(null),u=b.useRef(null),f=b.useCallback(v=>{l.current&&!l.current.contains(v.target)&&o(!1)},[]);b.useEffect(()=>{if(a)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a,f]);const h=b.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),e.length>1&&o(!0)},[e.length]),p=b.useCallback(()=>{u.current=setTimeout(()=>o(!1),150)},[]),m=e.find(v=>v.hash_id===t)??e[0];if(!m)return null;const x=D_(m.created_at);return c.jsxs("div",{ref:l,className:"relative",onMouseEnter:h,onMouseLeave:p,children:[c.jsxs("button",{type:"button",onClick:e.length>1?()=>o(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:[c.jsxs("span",{children:[c.jsx("span",{className:"font-extrabold",children:m.branch})," · ",m.commit_hash.slice(0,7),x?` · ${x}`:""]}),e.length>1&&c.jsx($t,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${a?"rotate-90":""}`})]}),a&&c.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 _=v.hash_id===t,w=D_(v.created_at);return c.jsx("div",{className:`flex cursor-pointer items-center px-2 py-1 font-mono text-[10px] transition-colors hover:bg-c4a-bg-hover ${_?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,onClick:()=>{r(v.hash_id),o(!1)},children:c.jsxs("span",{children:[c.jsx("span",{className:"font-extrabold",children:v.branch})," · ",v.commit_hash.slice(0,7),w?` · ${w}`:""]})},v.hash_id)})})]})}const O_={none:"bg-c4a-bg-active text-c4a-text-secondary",indexing:"bg-c4a-accent/10 text-c4a-accent animate-pulse",indexed:"bg-c4a-success text-white",stale:"bg-c4a-warning/10 text-c4a-warning"};function V$({sourceId:e,status:t,loading:r,onDeleted:a,isDaemonOnline:o,indexModules:l,isCloudDoc:u}){const{t:f}=ye(),[h,p]=b.useState(!1),[m,x]=b.useState(null),v=kt($=>$.triggerIndex),_=kt($=>$.deleteIndex),w=b.useCallback(($,z)=>{console.error(`[IndexBadge] ${$}
|
|
99
|
+
`,z),x({title:$,detail:z})},[]),S=b.useCallback(async()=>{if(o)try{const z=(t==="indexed"||t==="stale")&&l?l.map(B=>({...B,force:!0})):l;(await v(e,z)).status==="skipped"&&Qr(f("index.code.skipped"))}catch($){const z=$ instanceof hn?`POST /sources/${e}/index
|
|
100
|
+
HTTP ${$.status} ${$.code}
|
|
101
|
+
${$.message}`:`POST /sources/${e}/index
|
|
102
|
+
${String($)}`;w(f("index.code.error"),z)}},[e,o,v,l,t,f,w]),k=b.useCallback(async()=>{if(window.confirm(f("index.code.delete_confirm"))){p(!0);try{await _(e,l),Qr(f("index.code.delete_success")),a()}catch($){const z=$ instanceof hn?`DELETE /sources/${e}/index
|
|
103
|
+
HTTP ${$.status} ${$.code}
|
|
104
|
+
${$.message}`:`DELETE /sources/${e}/index
|
|
105
|
+
${String($)}`;w(f("index.code.delete_failed"),z)}finally{p(!1)}}},[e,_,l,f,a,w]),N=b.useCallback(()=>{(t==="none"||t==="indexed"||t==="stale")&&S()},[t,S]),R=(()=>{switch(t){case"indexing":return f("index.code.indexing");case"indexed":return f("sources.status.indexed");case"stale":return f("sources.status.stale");default:return f("sources.status.none")}})(),E=(()=>{switch(t){case"none":return f("index.code.go_index");case"indexed":return f("index.code.reindex");case"stale":return f("index.code.reindex");default:return""}})(),D=t!=="indexing",L=!o;return r?null:c.jsxs(c.Fragment,{children:[t==="indexing"?c.jsx("span",{className:`rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${O_.indexing}`,children:R}):c.jsxs("span",{className:`group/idx relative inline-block rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${O_[t]} ${D&&!L?"cursor-pointer hover:bg-c4a-accent hover:text-white":""} ${L?"opacity-40 cursor-not-allowed":""}`,onClick:D&&!L?N:void 0,title:L?f("daemon.offline_tooltip"):void 0,children:[c.jsx("span",{className:D&&!L?"group-hover/idx:hidden":"",children:R}),D&&!L&&c.jsx("span",{className:"hidden group-hover/idx:inline",children:E})]}),t==="indexed"&&!h&&!u&&c.jsx("span",{className:"cursor-pointer rounded-sm p-0.5 text-c4a-text-muted hover:bg-c4a-error/10 hover:text-c4a-error",onClick:k,title:f("index.code.delete"),children:c.jsx(od,{size:12})}),h&&c.jsx("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-c4a-text-muted",children:c.jsx(Zt,{size:10,className:"animate-spin"})}),m&&c.jsx($l,{error:m,onClose:()=>x(null)})]})}function Y$(e,t){for(const r of t)if(e===r||e.startsWith(r+"/")||r.startsWith(e+"/"))return!0;return!1}function K$(){const{t:e}=ye(),{sourceUuid:t}=Vo(),[r]=Dl(),a=r.get("path")||"",o=At(),{currentRoot:l,loading:u,error:f,fetchRootSource:h}=kt(),p=Qt(ds(qs)),[m,x]=b.useState(null),[v,_]=b.useState([]),[w,S]=b.useState(!0),[k,N]=b.useState(!1),[R,E]=b.useState(""),[D,L]=b.useState([]),$=l?.library_id,z=p.find(fe=>fe.id===$),T=z?.type==="cloud"?!0:z?.is_online??!1,B=kt(fe=>l?fe.indexingTasks.get(l.id):void 0),H=b.useMemo(()=>{if(B)return!B.modules||!a||Y$(a,B.modules)?B:void 0},[B,a]),J=b.useMemo(()=>{if(l?.source_type==="code")return!0;if(!l?.tree)return!1;const fe=_e=>{for(const he of _e)if(he.kind==="source"&&he.source_type==="code"||he.children&&fe(he.children))return!0;return!1};return fe(l.tree)},[l]),[oe,ce]=b.useState(!1);b.useEffect(()=>{t&&h(t).catch(()=>{})},[t,h]),b.useEffect(()=>{N(!1),S(!0),ce(!1)},[t,a]),b.useEffect(()=>{if(!l?.id||H)return;let fe=!1;return ze.get(`/sources/${l.id}/index/status`).then(_e=>{fe||ce(!!_e.is_stale)}).catch(()=>{}),()=>{fe=!0}},[l?.id,H]);const M=b.useRef(null);b.useEffect(()=>{!l?.id||H||M.current!==l.id&&(M.current=l.id,ze.get(`/sources/${l.id}/index/status`).then(fe=>{if(fe.indexing){const _e=fe.progress?.stage??"scanning",he=fe.progress?.percent??0;kt.getState().updateIndexProgress({sourceId:l.id,stage:_e,progress:he,modules:fe.modules_scope??void 0})}}).catch(()=>{}))},[l?.id,H]);const P=b.useMemo(()=>l?a?Ml(l.tree,a):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,a]),A=z,F=l?.id,ee=l?.kind==="source"&&!a,ae=b.useCallback(async fe=>{if(!F||!P){S(!1),N(!0);return}if(!fe&&P.index_status!=="indexed"&&P.index_status!=="stale"){x(null),_([]),S(!1),N(!0);return}const _e=ee?"":a||P.path;if(_e===void 0){S(!1),N(!0);return}S(!0),x(null),_([]);try{const he=await ze.get(`/sources/${F}/files`,{path:_e});x(he.hash_id),E(he.hash_id);try{const ve=await ze.get(`/sources/${F}/files/versions`,{path:_e});_(ve.versions??[])}catch{_([{version:he.version,version_label:he.version_label,hash_id:he.hash_id,created_at:he.created_at??null}])}}catch(he){he instanceof hn&&he.status===404&&(x(null),_([]))}finally{S(!1),N(!0)}},[F,P,a,ee]);b.useEffect(()=>{ae()},[ae]);const W=b.useRef(!1);b.useEffect(()=>{const fe=W.current,_e=!!H;W.current=_e,fe&&!_e&&(F?h(F).then(()=>ae(!0)).catch(()=>{}):ae(!0))},[H,ae,F,h]),b.useEffect(()=>{const fe=l?.metadata,_e=fe?.pinned_branch?String(fe.pinned_branch):"main";if(v.length>0&&P?.source_type==="code"){const he=v.map(ve=>({hash_id:ve.hash_id,branch:_e,commit_hash:ve.version_label,created_at:ve.created_at??null}));L(he)}else fe?.pinned_hash&&fe?.pinned_branch?L([{hash_id:R||m||"",branch:String(fe.pinned_branch),commit_hash:String(fe.pinned_hash),created_at:l?.updated_at??null}]):L([])},[l,v,P?.source_type,R,m]);const O=P?.metadata,V=P?.source_type==="code"||!P?.source_type&&J,re=P?.name??l?.name??"",se=P?.source_type??null,ne=b.useMemo(()=>{if(P){if(V){if(!a)return;const fe=a.includes("/")?a.split("/").slice(0,-1).join("/"):".";return fe==="."?void 0:[{path:fe}]}return a?[{path:a}]:[{path:"."}]}},[P,V,a]),ge=b.useMemo(()=>{if(!l||!A)return[];const fe=l.kind==="source"&&!a,_e=[{label:A.is_default?e("sources.library.default_cloud_name"):A.name,to:`/studio/sources/${A.id}`},{label:l.name,...fe?{}:{to:`/studio/sources/${A.id}?rootId=${l.id}`}}];if(a){const he=rl(l.tree,a);for(let ve=0;ve<he.length-1;ve++){const Ve=he[ve];_e.push({label:Ve.name,to:`/studio/sources/${A.id}?rootId=${l.id}&path=${encodeURIComponent(Ve.path)}`})}he.length>0&&_e.push({label:he[he.length-1].name})}return _e},[l,A,a,e]);if(!u&&f)return c.jsx("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:c.jsx(wt,{fullPage:!0,title:e("sources.detail.not_found_title"),description:e("sources.detail.not_found_desc"),action:c.jsx("button",{className:"rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90",onClick:()=>o("/studio/sources"),children:e("common.back")})})});if(u||!l||!P)return c.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[c.jsx(Aa,{segments:[]}),c.jsxs("div",{className:"mt-3 mb-3 flex items-center gap-2",children:[c.jsx("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded bg-c4a-bg-hover"}),c.jsx("div",{className:"h-6 w-56 animate-pulse rounded bg-c4a-bg-hover"})]}),c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(Zt,{size:24,className:"animate-spin text-c4a-text-muted"})})]});const Ne=m!==null&&!w,Fe=ee?P?.name??"":a||P?.path||P?.name||"",qe=H&&!H.terminalState?"indexing":H?.terminalState==="done"?"indexed":k?Ne?oe?"stale":"indexed":"none":P?.index_status==="indexed"?"indexed":P?.index_status==="stale"?"stale":"none",be=!!H;return c.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[c.jsxs("div",{className:"shrink-0 px-4 pt-4 md:px-6 md:pt-6",children:[c.jsx(Aa,{segments:ge}),c.jsxs("div",{className:"mt-3 mb-3 flex items-end gap-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[V?c.jsx(Dr,{size:20,className:"shrink-0 text-c4a-accent"}):c.jsx(On,{size:20,className:"shrink-0 text-c4a-accent"}),c.jsx("h1",{className:"mb-[0.125rem] min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:re})]}),F&&c.jsx(V$,{sourceId:F,status:qe,loading:!k&&w&&P?.index_status!=="indexed",onDeleted:()=>{x(null),E(""),_([]),F&&h(F).catch(()=>{})},isDaemonOnline:T,indexModules:ne,isCloudDoc:z?.type==="cloud"&&!V}),c.jsxs("span",{className:"group relative cursor-default",children:[c.jsx(Bt,{variant:"muted",children:e(se==="code"?"sources.type.code":"sources.type.doc")}),c.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:c.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[10px]",children:[c.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.origin")}),c.jsxs("dd",{className:"text-c4a-text-secondary",children:[A?.is_default?e("sources.library.default_cloud_name"):A?.name," / ",l?.name]}),!!O?.repo_name&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.repo")}),c.jsx("dd",{className:"text-c4a-text-secondary",children:O.repo_url?c.jsx("a",{href:String(O.repo_url),target:"_blank",rel:"noopener noreferrer",className:"text-c4a-accent hover:underline",children:String(O.repo_name)}):String(O.repo_name)})]}),c.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.type")}),c.jsx("dd",{className:"text-c4a-text-secondary uppercase",children:re.includes(".")?re.slice(re.lastIndexOf(".")+1):se??"—"})]})})]}),c.jsx("div",{className:"flex-1"}),V&&D.length>0&&c.jsx("div",{className:"self-center",children:c.jsx(G$,{commits:D,currentHashId:R,onChange:E})}),!V&&Ne&&v.length>0&&c.jsx("div",{className:"self-center",children:c.jsx(F$,{versions:v,currentHashId:R,onChange:E})})]})]}),c.jsx("div",{className:"flex flex-1 flex-col overflow-y-auto c4a-scrollbar px-4 pb-8 md:px-6 md:pb-10",children:c.jsx(H$,{anchor:{id:`content:${R||"pending"}`,type:"content",resourceId:R||"pending",label:re,icon:V?"📦":"📄"},children:c.jsx(lw,{hashId:R||"",sourcePath:Fe,sourceId:F,isCodeIndexing:be,isDaemonOnline:T,indexModules:ne,sourceType:se,indexStatus:qe})})})]})}function X$({docSources:e,onConfirm:t,onCancel:r}){const{t:a}=ye(),[o,l]=b.useState(!0),[u,f]=b.useState(null),[h,p]=b.useState(null),m=b.useMemo(()=>{const x=new Map;for(const v of e)x.has(v.sourceId)||x.set(v.sourceId,[]),x.get(v.sourceId).push(v.modulePath);return[...x.entries()].map(([v,_])=>({sourceId:v,paths:_}))},[e]);return b.useEffect(()=>{let x=!1;async function v(){l(!0);try{const _=await Promise.all(m.map(({sourceId:S,paths:k})=>{const N=k.length>0?`?paths=${k.map(encodeURIComponent).join(",")}`:"";return ze.get(`/sources/${S}/index/estimate${N}`)}));if(x)return;const w=_.reduce((S,k)=>({tokens:S.tokens+k.estimated_tokens,calls:S.calls+k.estimated_calls,chunks:S.chunks+k.chunk_count}),{tokens:0,calls:0,chunks:0});f(w)}catch(_){if(x)return;const w=_ instanceof hn?`GET /sources/:id/index/estimate
|
|
106
|
+
HTTP ${_.status} ${_.code}
|
|
107
|
+
${_.message}`:`GET /sources/:id/index/estimate
|
|
108
|
+
${String(_)}`;console.error(`[DocIndexConfirmDialog] estimate failed
|
|
109
|
+
`,w),p({title:a("index.doc.confirm_title"),detail:w})}finally{x||l(!1)}}return v(),()=>{x=!0}},[m,a]),h?c.jsx($l,{error:h,onClose:()=>{p(null),r()}}):c.jsxs(lr,{onClose:r,className:"w-full max-w-lg rounded-xl bg-c4a-bg-surface p-6",children:[c.jsx("h2",{className:"font-mono text-sm uppercase tracking-tight text-c4a-text-primary mb-4",children:a("index.doc.confirm_title")}),o?c.jsx(ta,{labelKey:"index.doc.estimating"}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-sm text-c4a-text-secondary mb-4",children:a("index.doc.confirm_desc")}),c.jsx("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-base p-3 mb-4 max-h-32 overflow-y-auto c4a-scrollbar",children:e.map((x,v)=>c.jsxs("div",{className:"flex items-center gap-2 py-1",children:[c.jsx(On,{size:12,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:x.sourceName})]},`${x.sourceId}:${v}`))}),u&&c.jsxs("div",{className:"flex gap-3 mb-4",children:[c.jsx(ln,{icon:c.jsx(YE,{}),label:a("index.doc.estimate_tokens"),value:`~${u.tokens.toLocaleString()}`,size:"sm"}),c.jsx(ln,{icon:c.jsx(aR,{}),label:a("index.doc.estimate_calls"),value:`~${u.calls}`,size:"sm"}),c.jsx(ln,{icon:c.jsx($C,{}),label:a("index.doc.estimate_chunks"),value:u.chunks,size:"sm"})]}),u&&c.jsx("p",{className:"text-xs text-c4a-text-muted font-mono mb-6",children:a("index.doc.estimate_summary",{tokens:u.tokens.toLocaleString(),calls:u.calls})}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{onClick:r,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:a("index.doc.cancel")}),c.jsx("button",{onClick:t,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:a("index.doc.confirm_btn")})]})]})]})}function Lu(e){return e.source_type==="code"?e.path.includes("/")?e.path.split("/").slice(0,-1).join("/"):".":e.path}function zw(e){return e.index_status==="indexed"||e.index_status==="stale"}function Q$(e,t){const r=[],a=o=>{for(const l of o){if(l.kind==="source"){const u=Lu(l);r.push({sourceId:t,modulePath:u,moduleName:l.name,moduleType:l.source_type==="code"?"package":"document",hasDigest:zw(l),digestStale:l.index_status==="stale"})}l.children&&a(l.children)}};return a(e),r}function $w(e,t){for(const r of e){if(r.path===t&&r.children)return r.children;if(r.children){const a=$w(r.children,t);if(a.length>0)return a}}return[]}function Bw(e,t){for(const r of e){if(r.path===t)return r;if(r.children){const a=Bw(r.children,t);if(a)return a}}return null}function Z$({node:e,sourceId:t,depth:r,selected:a,indeterminate:o,expanded:l,onToggleExpand:u,onToggleSelect:f,t:h}){const p=e.kind==="folder",m=e.source_type==="code",x=zw(e),v=p?Gn:m?Dr:On,_="text-c4a-text-secondary";return c.jsxs("div",{className:"group/row flex h-8 cursor-pointer items-center gap-1.5 hover:bg-c4a-bg-hover",style:{paddingLeft:`${r*24+8}px`},children:[p?c.jsx("button",{onClick:()=>u(t,e.path),className:"flex h-4 w-4 shrink-0 items-center justify-center text-c4a-text-muted",children:c.jsx($t,{size:12,className:`transition-transform duration-200 ${l?"rotate-90":""}`})}):c.jsx("span",{className:"h-4 w-4 shrink-0"}),c.jsx("input",{type:"checkbox",checked:a,ref:w=>{w&&(w.indeterminate=o)},onChange:()=>f(t,e.path),className:"c4a-check"}),c.jsx(v,{size:14,className:`shrink-0 ${_}`}),c.jsx("span",{className:`truncate text-xs ${_}`,children:e.name}),!p&&x&&c.jsx("span",{className:"ml-1 shrink-0 rounded-sm bg-c4a-success px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",children:h("index.batch.already_indexed")})]})}function om({nodes:e,depth:t,selectedPaths:r,expandedPaths:a,sourceId:o,onToggleExpand:l,onToggleSelect:u,getSelectionState:f,t:h}){const p=b.useMemo(()=>[...e].sort((m,x)=>m.kind!==x.kind?m.kind==="folder"?-1:1:m.name.localeCompare(x.name)),[e]);return c.jsx(c.Fragment,{children:p.map(m=>{const{selected:x,indeterminate:v}=f(o,m),_=a.has(`${o}:${m.path}`);return c.jsxs("div",{children:[c.jsx(Z$,{node:m,sourceId:o,depth:t,selected:x,indeterminate:v,expanded:_,onToggleExpand:l,onToggleSelect:u,t:h}),m.kind==="folder"&&_&&m.children&&c.jsx(om,{nodes:m.children,depth:t+1,selectedPaths:r,expandedPaths:a,sourceId:o,onToggleExpand:l,onToggleSelect:u,getSelectionState:f,t:h})]},m.path)})})}function J$({root:e,expanded:t,selected:r,indeterminate:a,onToggleExpand:o,onToggleSelect:l}){const u=e.kind==="folder",h=e.metadata?.origin==="remote",p=u?h?Ol:Gn:e.source_type==="code"?Dr:On,m="text-c4a-text-secondary";return c.jsxs("div",{className:"group/row flex h-8 cursor-pointer items-center gap-1.5 hover:bg-c4a-bg-hover",style:{paddingLeft:"8px"},children:[u?c.jsx("button",{onClick:o,className:"flex h-4 w-4 shrink-0 items-center justify-center text-c4a-text-muted",children:c.jsx($t,{size:12,className:`transition-transform duration-200 ${t?"rotate-90":""}`})}):c.jsx("span",{className:"h-4 w-4 shrink-0"}),c.jsx("input",{type:"checkbox",checked:r,ref:x=>{x&&(x.indeterminate=a)},onChange:l,className:"c4a-check"}),c.jsx(p,{size:14,className:`shrink-0 ${m}`}),c.jsx("span",{className:`truncate text-xs ${m}`,children:e.name})]})}function W$({selectedNodes:e,targetRoots:t,setSelectedPaths:r,t:a}){const l=b.useMemo(()=>new Set(e.map(h=>h.sourceId)),[e]).size>1,u=b.useMemo(()=>{const h=new Map;for(const p of t)h.set(p.id,p.name);return h},[t]),f=b.useMemo(()=>{const h=[],p=new Map;for(const m of e){if(!p.has(m.sourceId)){const x=[];p.set(m.sourceId,x),h.push({sourceId:m.sourceId,nodes:x})}p.get(m.sourceId).push(m)}return h},[e]);return c.jsx("div",{className:"flex flex-col gap-0.5",children:f.map(({sourceId:h,nodes:p})=>c.jsxs("div",{children:[l&&c.jsx("div",{className:"mt-1 mb-0.5 border-b border-c4a-border-subtle px-2 pb-1 font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:u.get(h)||h}),p.map(m=>c.jsxs("div",{className:"flex items-center gap-2 rounded-sm px-2 py-1 text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover",children:[m.moduleType==="package"?c.jsx(Dr,{size:12,className:"shrink-0"}):c.jsx(On,{size:12,className:"shrink-0"}),c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[c.jsx("span",{className:"truncate",children:m.moduleName}),m.modulePath!=="."&&m.modulePath!==m.moduleName&&c.jsx("span",{className:"truncate font-mono text-[10px] text-c4a-text-muted",title:m.modulePath,children:m.modulePath})]}),m.hasDigest&&c.jsx("span",{className:"shrink-0 rounded bg-amber-500/10 px-1 font-mono text-[10px] text-amber-500",children:a("index.batch.reindex_tag")}),c.jsx("button",{onClick:()=>{r(x=>{const v=new Set(x);return v.delete(`${m.sourceId}:${m.modulePath}`),v})},className:"shrink-0 text-c4a-text-muted hover:text-c4a-accent",children:c.jsx(Or,{size:12})})]},`${m.sourceId}:${m.modulePath}`))]},h))})}function e9(){const{t:e}=ye(),t=At(),{libId:r}=Vo(),[a]=Dl(),o=a.get("rootId")||null,l=a.get("path")||"",f=Qt(ds(qs)).find(be=>be.id===r),{rootSources:h,currentRoot:p,fetchRootSources:m,fetchRootSource:x,triggerIndex:v}=kt(),_=f?.type==="cloud"?!0:f?.is_online??!1,[w,S]=b.useState(new Set),[k,N]=b.useState(new Set),[R,E]=b.useState(!1),[D,L]=b.useState(null),[$,z]=b.useState(!1),[T,B]=b.useState([]),[H,J]=b.useState([]);b.useEffect(()=>{r&&m({library_id:r})},[r,m]),b.useEffect(()=>{o&&x(o).catch(()=>{})},[o,x]);const oe=b.useMemo(()=>{let be;return o&&p?be=[p]:be=h.filter(fe=>fe.kind!=="folder"||fe.tree&&fe.tree.length>0),l?be.map(fe=>{const _e=$w(fe.tree,l);return{...fe,tree:_e}}).filter(fe=>fe.tree.length>0):be},[o,p,h,l]);b.useEffect(()=>{N(new Set)},[oe]);const ce=b.useMemo(()=>{const be=[];for(const fe of oe)if(fe.kind==="source"){const _e=fe.index_status==="indexed"||fe.index_status==="stale";be.push({sourceId:fe.id,modulePath:".",moduleName:fe.name,moduleType:fe.source_type==="code"?"package":"document",hasDigest:_e,digestStale:fe.index_status==="stale"})}else be.push(...Q$(fe.tree,fe.id));return be},[oe]),M=b.useMemo(()=>ce.filter(be=>w.has(`${be.sourceId}:${be.modulePath}`)),[ce,w]),P=b.useCallback(be=>{const fe=[],_e=he=>{he.kind==="source"&&fe.push(Lu(he)),he.children&&he.children.forEach(_e)};return _e(be),fe},[]),A=b.useCallback((be,fe)=>{const _e=oe.find(he=>he.id===be);return _e?Bw(_e.tree,fe):null},[oe]),F=b.useCallback((be,fe)=>{const _e=`${be}:${fe}`;N(he=>{const ve=new Set(he);return ve.has(_e)?ve.delete(_e):ve.add(_e),ve})},[]),ee=b.useCallback((be,fe)=>{const _e=A(be,fe);_e&&S(he=>{const ve=new Set(he);if(_e.kind==="source"){const Ve=`${be}:${Lu(_e)}`;ve.has(Ve)?ve.delete(Ve):ve.add(Ve)}else{const Ve=P(_e).map(Xe=>`${be}:${Xe}`);Ve.every(Xe=>ve.has(Xe))?Ve.forEach(Xe=>ve.delete(Xe)):Ve.forEach(Xe=>ve.add(Xe))}return ve})},[A,P]),ae=b.useCallback((be,fe)=>{if(fe.kind==="source"){const ve=`${be}:${Lu(fe)}`;return{selected:w.has(ve),indeterminate:!1}}const _e=P(fe).map(ve=>`${be}:${ve}`);if(_e.length===0)return{selected:!1,indeterminate:!1};const he=_e.filter(ve=>w.has(ve)).length;return{selected:he===_e.length,indeterminate:he>0&&he<_e.length}},[w,P]),W=!o&&oe.length>0,O=b.useCallback(be=>{const _e=ce.filter(he=>he.sourceId===be).map(he=>`${he.sourceId}:${he.modulePath}`);_e.length!==0&&S(he=>{const ve=new Set(he);return _e.every(De=>ve.has(De))?_e.forEach(De=>ve.delete(De)):_e.forEach(De=>ve.add(De)),ve})},[ce]),V=b.useCallback(be=>{const fe=ce.filter(ve=>ve.sourceId===be);if(fe.length===0)return{selected:!1,indeterminate:!1};const _e=fe.map(ve=>`${ve.sourceId}:${ve.modulePath}`),he=_e.filter(ve=>w.has(ve)).length;return{selected:he===_e.length,indeterminate:he>0&&he<_e.length}},[ce,w]),re=b.useCallback(async be=>{const fe=new Map;for(const _e of be)fe.has(_e.sourceId)||fe.set(_e.sourceId,[]),fe.get(_e.sourceId).push({path:_e.modulePath,force:!!_e.hasDigest});return Promise.allSettled(Array.from(fe.entries()).map(async([_e,he])=>{const ve=await v(_e,he);return{sourceId:_e,...ve}}))},[v]),se=b.useCallback((be,fe)=>{let _e=!1;const he=[];for(const ve of be)if(ve.status==="fulfilled")(ve.value.status==="started"||ve.value.status==="completed")&&(_e=!0);else{const Ve=ve.reason instanceof Error?ve.reason.message:String(ve.reason);he.push(Ve)}if(he.length>0&&console.error("[BatchIndex] index errors:",he),E(!1),_e&&fe.length>0){he.length>0&&Qr(e("index.batch.toast_partial_fail"));const ve=[...fe].sort((De,Xe)=>{const It=De.modulePath==="."?0:De.modulePath.split("/").length,un=Xe.modulePath==="."?0:Xe.modulePath.split("/").length;return It-un})[0],Ve=ve.modulePath==="."?"":`?path=${encodeURIComponent(ve.modulePath)}`;t(`/studio/source/${ve.sourceId}${Ve}`,{replace:!0})}else he.length>0?L({title:e("index.batch.error"),detail:he.join(`
|
|
110
|
+
|
|
111
|
+
`)}):(Qr(e("index.batch.toast_skipped")),t(-1))},[t,e]),ne=b.useCallback(async()=>{if(M.length===0)return;const be=M.filter(he=>he.moduleType==="document"),fe=M.filter(he=>he.moduleType==="package");if(be.length>0){B(be),J(fe),z(!0);return}E(!0);const _e=await re(fe);se([..._e],fe)},[M,re,se]),ge=b.useCallback(async()=>{z(!1),E(!0);const be=[...H,...T],[fe,_e]=await Promise.all([H.length>0?re(H):Promise.resolve([]),re(T)]);se([...fe,..._e],be)},[T,H,re,se]),Ne=b.useCallback(()=>{z(!1),B([]),J([])},[]),Fe=b.useMemo(()=>{if(!f)return[];const be=[{label:f.is_default?e("sources.library.default_cloud_name"):f.name,to:`/studio/sources/${f.id}`}];if(o&&p&&(be.push({label:p.name,to:`/studio/sources/${f.id}?rootId=${p.id}`}),l)){const fe=l.split("/");be.push({label:fe[fe.length-1]||l,to:`/studio/sources/${f.id}?rootId=${p.id}&path=${encodeURIComponent(l)}`})}return be.push({label:e("index.batch.title")}),be},[f,o,p,l,e]);if(!f)return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const qe=M.length>50;return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-c4a-bg-default p-4 md:p-6",children:[c.jsx(Aa,{segments:Fe}),c.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col gap-4 lg:flex-row",children:[c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border border-c4a-border-default rounded-lg lg:w-1/2",children:[c.jsx("div",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted px-3 py-2 border-b border-c4a-border-subtle",children:e("index.batch.panel_a_title")}),c.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar",children:oe.map(be=>{if(W){const fe=`${be.id}:__root__`,_e=k.has(fe),{selected:he,indeterminate:ve}=V(be.id);return c.jsxs("div",{children:[c.jsx(J$,{root:be,expanded:_e,selected:he,indeterminate:ve,onToggleExpand:()=>{N(Ve=>{const De=new Set(Ve);return De.has(fe)?De.delete(fe):De.add(fe),De})},onToggleSelect:()=>O(be.id)}),be.kind==="folder"&&_e&&c.jsx(om,{nodes:be.tree,depth:1,selectedPaths:w,expandedPaths:k,sourceId:be.id,onToggleExpand:F,onToggleSelect:ee,getSelectionState:ae,t:e})]},be.id)}return c.jsx(om,{nodes:be.tree,depth:0,selectedPaths:w,expandedPaths:k,sourceId:be.id,onToggleExpand:F,onToggleSelect:ee,getSelectionState:ae,t:e},be.id)})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col border border-c4a-border-default rounded-lg lg:w-1/2",children:[c.jsx("div",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted px-3 py-2 border-b border-c4a-border-subtle",children:e("index.batch.panel_b_title")}),c.jsx("div",{className:"px-3 py-2",children:c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:e("index.batch.selected_count",{n:M.length,total:ce.length}).split(/(\d+)/).map((be,fe)=>/^\d+$/.test(be)?c.jsx("span",{className:"text-c4a-accent font-extrabold",children:be},fe):c.jsx("span",{children:be},fe))})}),c.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar px-3",children:M.length===0?null:c.jsx(W$,{selectedNodes:M,targetRoots:oe,setSelectedPaths:S,t:e})})]})]}),c.jsxs("div",{className:"sticky bottom-0 mt-4 flex items-center justify-end gap-3 bg-c4a-bg-default px-4 py-3",children:[qe&&c.jsx("span",{className:"mr-auto font-mono text-xs text-c4a-warning",children:e("index.batch.warning_over_50")}),c.jsx("button",{onClick:()=>t(-1),className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:e("index.batch.back")}),c.jsxs("button",{onClick:ne,disabled:M.length===0||R||!_,title:_?void 0:e("daemon.offline_tooltip"),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 disabled:cursor-not-allowed",children:[e("index.batch.confirm")," (",M.length,")"]})]}),D&&c.jsx($l,{error:D,onClose:()=>{L(null),t(-1)}}),$&&c.jsx(X$,{docSources:T.map(be=>({sourceId:be.sourceId,sourceName:be.moduleName,modulePath:be.modulePath})),onConfirm:ge,onCancel:Ne})]})}const t9=b.lazy(()=>le(()=>import("./ContentDetail--oZBzWh0.js"),[]).then(e=>({default:e.ContentDetail}))),n9=b.lazy(()=>le(()=>import("./EntityDetail-D_WP7tD4.js"),[]).then(e=>({default:e.EntityDetail}))),r9=b.lazy(()=>le(()=>import("./RelationDetail-CEq9vopD.js"),[]).then(e=>({default:e.RelationDetail}))),a9=_E([{element:c.jsx(QR,{}),errorElement:c.jsx(ev,{}),children:[{path:"/",element:c.jsx(sT,{})},{path:"/login",element:c.jsx(lT,{})},{path:"/auth/callback",element:c.jsx(uT,{})},{path:"/docs",element:c.jsx(dT,{})}]},{path:"/studio",element:c.jsx(aT,{}),errorElement:c.jsx(ev,{}),children:[{index:!0,element:c.jsx(XN,{to:"/studio/sources",replace:!0})},{path:"sources",element:c.jsx(aA,{})},{path:"sources/add-client",element:c.jsx($A,{})},{path:"sources/import/:libId",element:c.jsx(bA,{})},{path:"sources/import-dir/:libId",element:c.jsx(jA,{})},{path:"sources/import-remote/:libId",element:c.jsx(zA,{})},{path:"sources/:libId",element:c.jsx(rA,{})},{path:"sources/:libId/batch-index",element:c.jsx(e9,{})},{path:"source/:sourceUuid",element:c.jsx(K$,{})},{path:"contents/:hashId",element:c.jsx(b.Suspense,{fallback:null,children:c.jsx(t9,{})})},{path:"entities/:entityId",element:c.jsx(b.Suspense,{fallback:null,children:c.jsx(n9,{})})},{path:"relations/:relationId",element:c.jsx(b.Suspense,{fallback:null,children:c.jsx(r9,{})})},{path:"modeling",element:c.jsx(pT,{})},{path:"modeling/code/setup",element:c.jsx(ST,{})},{path:"modeling/code/compile",element:c.jsx(jT,{})},{path:"modeling/code/review",element:c.jsx(kT,{})},{path:"modeling/code/result",element:c.jsx(NT,{})},{path:"brain",element:c.jsx(hT,{})},{path:"discovery",element:c.jsx(mT,{})},{path:"sharing",element:c.jsx(gT,{})},{path:"collaboration",element:c.jsx(xT,{})},{path:"settings/api-keys",element:c.jsx(yT,{})}]},{path:"*",element:c.jsx(fT,{})}]);function s9(){return b.useEffect(()=>{Yn.getState().init(),gl.getState().init();const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return En.connect(t),()=>{En.disconnect()}},[]),c.jsx(VN,{router:a9})}ik.createRoot(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(s9,{})}));export{lw as C,L$ as E,O$ as R,ye as a,Vo as b,$e as c,c as j,At as u};
|