texlite 0.7.6 → 0.7.7
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/dist/client/assets/{GitDialog-W3hLOWrF.js → GitDialog-Bm5yMpQK.js} +1 -1
- package/dist/client/assets/{HistoryDialog-7ADYJcGi.js → HistoryDialog-Po4KHT_2.js} +1 -1
- package/dist/client/assets/{LatexEditor-ChHQwJXZ.js → LatexEditor-CnKCXaHr.js} +1 -1
- package/dist/client/assets/{PdfPreview-CuvWphzY.js → PdfPreview-Cd20VIjT.js} +1 -1
- package/dist/client/assets/{ProjectNavigationDialogs-CzFhIw6B.js → ProjectNavigationDialogs-BDOtIoTy.js} +1 -1
- package/dist/client/assets/{SystemMetricsDialog-C0m9JUDy.js → SystemMetricsDialog-DdOlcqqK.js} +1 -1
- package/dist/client/assets/{index-DzcH7hBu.css → index-MDwr9W9R.css} +1 -1
- package/dist/client/assets/index-zIjCeZFK.js +64 -0
- package/dist/client/assets/{minus-BfqMIeUg.js → minus-O6pK-6mA.js} +1 -1
- package/dist/client/assets/{spellCheck-BBnCnxmQ.js → spellCheck-Ce3o_xO-.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/collaboration.js +33 -9
- package/package.json +1 -1
- package/dist/client/assets/index-DRShM2ob.js +0 -64
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PdfPreview-CuvWphzY.js","assets/react-BoEjKzFZ.js","assets/pdf-BB1XvBIF.js","assets/minus-BfqMIeUg.js","assets/SystemMetricsDialog-C0m9JUDy.js","assets/spellCheck-BBnCnxmQ.js","assets/LatexEditor-ChHQwJXZ.js","assets/editor-DMLs-XWi.js","assets/GitDialog-W3hLOWrF.js","assets/HistoryDialog-7ADYJcGi.js","assets/ProjectNavigationDialogs-CzFhIw6B.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as Dm,u as Qe,j as i,r as f,R as Lr,a as Dl,b as gm,P as Bi,c as Ca,d as Fm,e as bm}from"./react-BoEjKzFZ.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();var co={};const Se=t=>typeof t=="string",or=()=>{let t,e;const n=new Promise((s,r)=>{t=s,e=r});return n.resolve=t,n.reject=e,n},Gc=t=>t==null?"":""+t,ym=(t,e,n)=>{t.forEach(s=>{e[s]&&(n[s]=e[s])})},Cm=/###/g,Yc=t=>t&&t.indexOf("###")>-1?t.replace(Cm,"."):t,Xc=t=>!t||Se(t),fr=(t,e,n)=>{const s=Se(e)?e.split("."):e;let r=0;for(;r<s.length-1;){if(Xc(t))return{};const o=Yc(s[r]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++r}return Xc(t)?{}:{obj:t,k:Yc(s[r])}},Jc=(t,e,n)=>{const{obj:s,k:r}=fr(t,e,Object);if(s!==void 0||e.length===1){s[r]=n;return}let o=e[e.length-1],a=e.slice(0,e.length-1),c=fr(t,a,Object);for(;c.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),c=fr(t,a,Object),c?.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},Em=(t,e,n,s)=>{const{obj:r,k:o}=fr(t,e,Object);r[o]=r[o]||[],r[o].push(n)},ci=(t,e)=>{const{obj:n,k:s}=fr(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},wm=(t,e,n)=>{const s=ci(t,n);return s!==void 0?s:ci(e,n)},gl=(t,e,n)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in t?Se(t[s])||t[s]instanceof String||Se(e[s])||e[s]instanceof String?n&&(t[s]=e[s]):gl(t[s],e[s],n):t[s]=e[s]);return t},Jn=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var xm={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const vm=t=>Se(t)?t.replace(/[&<>"'\/]/g,e=>xm[e]):t;class Am{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const km=[" ",",","?","!",";"],Sm=new Am(20),jm=(t,e,n)=>{e=e||"",n=n||"";const s=km.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(s.length===0)return!0;const r=Sm.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!r.test(t);if(!o){const a=t.indexOf(n);a>0&&!r.test(t.substring(0,a))&&(o=!0)}return o},Io=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const s=e.split(n);let r=t;for(let o=0;o<s.length;){if(!r||typeof r!="object")return;let a,c="";for(let u=o;u<s.length;++u)if(u!==o&&(c+=n),c+=s[u],a=r[c],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<s.length-1)continue;o+=u-o+1;break}r=a}return r},Fr=t=>t?.replace(/_/g,"-"),Bm={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class ui{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||Bm,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,s,r){return r&&!this.debug?null:(Se(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new ui(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new ui(this.logger,e)}}var Fn=new ui;class Ti{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const r=this.observers[s].get(n)||0;this.observers[s].set(n,r+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([r,o])=>{for(let a=0;a<o;a++)r(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,o])=>{for(let a=0;a<o;a++)r.apply(r,[e,...n])})}}class Zc extends Ti{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,s,r={}){const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,a=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;e.indexOf(".")>-1?c=e.split("."):(c=[e,n],s&&(Array.isArray(s)?c.push(...s):Se(s)&&o?c.push(...s.split(o)):c.push(s)));const u=ci(this.data,c);return!u&&!n&&!s&&e.indexOf(".")>-1&&(e=c[0],n=c[1],s=c.slice(2).join(".")),u||!a||!Se(s)?u:Io(this.data?.[e]?.[n],s,o)}addResource(e,n,s,r,o={silent:!1}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[e,n];s&&(c=c.concat(a?s.split(a):s)),e.indexOf(".")>-1&&(c=e.split("."),r=n,n=c[1]),this.addNamespaces(n),Jc(this.data,c,r),o.silent||this.emit("added",e,n,s,r)}addResources(e,n,s,r={silent:!1}){for(const o in s)(Se(s[o])||Array.isArray(s[o]))&&this.addResource(e,n,o,s[o],{silent:!0});r.silent||this.emit("added",e,n,s)}addResourceBundle(e,n,s,r,o,a={silent:!1,skipCopy:!1}){let c=[e,n];e.indexOf(".")>-1&&(c=e.split("."),r=s,s=n,n=c[1]),this.addNamespaces(n);let u=ci(this.data,c)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),r?gl(u,s,o):u={...u,...s},Jc(this.data,c,u),a.silent||this.emit("added",e,n,s)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var Fl={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,s,r){return t.forEach(o=>{e=this.processors[o]?.process(e,n,s,r)??e}),e}};const bl=Symbol("i18next/PATH_KEY");function Tm(){const t=[],e=Object.create(null);let n;return e.get=(s,r)=>(n?.revoke?.(),r===bl?t:(t.push(r),n=Proxy.revocable(s,e),n.proxy)),Proxy.revocable(Object.create(null),e).proxy}function Ss(t,e){const{[bl]:n}=t(Tm()),s=e?.keySeparator??".",r=e?.nsSeparator??":";if(n.length>1&&r){const o=e?.ns,a=Array.isArray(o)?o:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(s)}`}return n.join(s)}const Qc={},uo=t=>!Se(t)&&typeof t!="boolean"&&typeof t!="number";class li extends Ti{constructor(e,n={}){super(),ym(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Fn.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const s={...n};if(e==null)return!1;const r=this.resolve(e,s);if(r?.res===void 0)return!1;const o=uo(r.res);return!(s.returnObjects===!1&&o)}extractFromKey(e,n){let s=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=s&&e.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!jm(e,s,r);if(a&&!c){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:Se(o)?[o]:o};const l=e.split(s);(s!==r||s===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return{key:e,namespaces:Se(o)?[o]:o}}translate(e,n,s){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";typeof e=="function"&&(e=Ss(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]),e=e.map(K=>typeof K=="function"?Ss(K,{...this.options,...r}):String(K));const o=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:c,namespaces:u}=this.extractFromKey(e[e.length-1],r),l=u[u.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const h=r.lng||this.language,D=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return D?o?{res:`${l}${d}${c}`,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${d}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:c;const p=this.resolve(e,r);let F=p?.res;const y=p?.usedKey||c,b=p?.exactUsedKey||c,E=["[object Number]","[object Function]","[object RegExp]"],x=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,N=!this.i18nFormat||this.i18nFormat.handleAsObject,O=r.count!==void 0&&!Se(r.count),I=li.hasDefaultValue(r),q=O?this.pluralResolver.getSuffix(h,r.count,r):"",z=r.ordinal&&O?this.pluralResolver.getSuffix(h,r.count,{ordinal:!1}):"",X=O&&!r.ordinal&&r.count===0,G=X&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${q}`]||r[`defaultValue${z}`]||r.defaultValue;let A=F;N&&!F&&I&&(A=G);const ie=uo(A),M=Object.prototype.toString.apply(A);if(N&&A&&ie&&E.indexOf(M)<0&&!(Se(x)&&Array.isArray(A))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const K=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,A,{...r,ns:u}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(p.res=K,p.usedParams=this.getUsedParamsDetails(r),p):K}if(a){const K=Array.isArray(A),L=K?[]:{},S=K?b:y;for(const P in A)if(Object.prototype.hasOwnProperty.call(A,P)){const he=`${S}${a}${P}`;I&&!F?L[P]=this.translate(he,{...r,defaultValue:uo(G)?G[P]:void 0,joinArrays:!1,ns:u}):L[P]=this.translate(he,{...r,joinArrays:!1,ns:u}),L[P]===he&&(L[P]=A[P])}F=L}}else if(N&&Se(x)&&Array.isArray(F))F=F.join(x),F&&(F=this.extendTranslation(F,e,r,s));else{let K=!1,L=!1;!this.isValidLookup(F)&&I&&(K=!0,F=G),this.isValidLookup(F)||(L=!0,F=c);const P=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:F,he=I&&G!==F&&this.options.updateMissing;if(L||K||he){if(this.logger.log(he?"updateKey":"missingKey",h,l,c,he?G:F),a){const W=this.resolve(c,{...r,keySeparator:!1});W&&W.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let xe=[];const Fe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Fe&&Fe[0])for(let W=0;W<Fe.length;W++)xe.push(Fe[W]);else this.options.saveMissingTo==="all"?xe=this.languageUtils.toResolveHierarchy(r.lng||this.language):xe.push(r.lng||this.language);const ye=(W,U,ve)=>{const pe=I&&ve!==F?ve:P;this.options.missingKeyHandler?this.options.missingKeyHandler(W,l,U,pe,he,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(W,l,U,pe,he,r),this.emit("missingKey",W,l,U,F)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?xe.forEach(W=>{const U=this.pluralResolver.getSuffixes(W,r);X&&r[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(ve=>{ye([W],c+ve,r[`defaultValue${ve}`]||G)})}):ye(xe,c,G))}F=this.extendTranslation(F,e,r,p,s),L&&F===c&&this.options.appendNamespaceToMissingKey&&(F=`${l}${d}${c}`),(L||K)&&this.options.parseMissingKeyHandler&&(F=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${d}${c}`:c,K?F:void 0,r))}return o?(p.res=F,p.usedParams=this.getUsedParamsDetails(r),p):F}extendTranslation(e,n,s,r,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const u=Se(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(u){const h=e.match(this.interpolator.nestingRegexp);l=h&&h.length}let d=s.replace&&!Se(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,s.lng||this.language||r.usedLng,s),u){const h=e.match(this.interpolator.nestingRegexp),D=h&&h.length;l<D&&(s.nest=!1)}!s.lng&&r&&r.res&&(s.lng=this.language||r.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>o?.[0]===h[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):this.translate(...h,n),s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,c=Se(a)?[a]:a;return e!=null&&c?.length&&s.applyPostProcessor!==!1&&(e=Fl.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,n={}){let s,r,o,a,c;return Se(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(u=>typeof u=="function"?Ss(u,{...this.options,...n}):u)),e.forEach(u=>{if(this.isValidLookup(s))return;const l=this.extractFromKey(u,n),d=l.key;r=d;let h=l.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const D=n.count!==void 0&&!Se(n.count),p=D&&!n.ordinal&&n.count===0,F=n.context!==void 0&&(Se(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(b=>{this.isValidLookup(s)||(c=b,!Qc[`${y[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(c)&&(Qc[`${y[0]}-${b}`]=!0,this.logger.warn(`key "${r}" for languages "${y.join(", ")}" won't get resolved as namespace "${c}" 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!!!")),y.forEach(E=>{if(this.isValidLookup(s))return;a=E;const x=[d];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,d,E,b,n);else{let O;D&&(O=this.pluralResolver.getSuffix(E,n.count,n));const I=`${this.options.pluralSeparator}zero`,q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(D&&(n.ordinal&&O.indexOf(q)===0&&x.push(d+O.replace(q,this.options.pluralSeparator)),x.push(d+O),p&&x.push(d+I)),F){const z=`${d}${this.options.contextSeparator||"_"}${n.context}`;x.push(z),D&&(n.ordinal&&O.indexOf(q)===0&&x.push(z+O.replace(q,this.options.pluralSeparator)),x.push(z+O),p&&x.push(z+I))}}let N;for(;N=x.pop();)this.isValidLookup(s)||(o=N,s=this.getResource(E,b,N,n))}))})}),{res:s,usedKey:r,exactUsedKey:o,usedLng:a,usedNS:c}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,s,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,s,r):this.resourceStore.getResource(e,n,s,r)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!Se(e.replace);let r=s?e.replace:e;if(s&&typeof e.count<"u"&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!s){r={...r};for(const o of n)delete r[o]}return r}static hasDefaultValue(e){const n="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&n===s.substring(0,n.length)&&e[s]!==void 0)return!0;return!1}}class eu{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fn.create("languageUtils")}getScriptPartFromCode(e){if(e=Fr(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Fr(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(Se(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(s=>{if(n)return;const r=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&e.forEach(s=>{if(n)return;const r=this.getScriptPartFromCode(s);if(this.isSupportedCode(r))return n=r;const o=this.getLanguagePartFromCode(s);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),Se(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let s=e[n];return s||(s=e[this.getScriptPartFromCode(n)]),s||(s=e[this.formatLanguageCode(n)]),s||(s=e[this.getLanguagePartFromCode(n)]),s||(s=e.default),s||[]}toResolveHierarchy(e,n){const s=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),r=[],o=a=>{a&&(this.isSupportedCode(a)?r.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return Se(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):Se(e)&&o(this.formatLanguageCode(e)),s.forEach(a=>{r.indexOf(a)<0&&o(this.formatLanguageCode(a))}),r}}const tu={zero:0,one:1,two:2,few:3,many:4,other:5},nu={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Lm{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Fn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const s=Fr(e==="dev"?"en":e),r=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:s,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(s,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),nu;if(!e.match(/-|_/))return nu;const u=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(u,n)}return this.pluralRulesCache[o]=a,a}needsPlural(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n,s={}){return this.getSuffixes(e,s).map(r=>`${n}${r}`)}getSuffixes(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),s?s.resolvedOptions().pluralCategories.sort((r,o)=>tu[r]-tu[o]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(e,n,s={}){const r=this.getRule(e,s);return r?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,s))}}const su=(t,e,n,s=".",r=!0)=>{let o=wm(t,e,n);return!o&&r&&Se(n)&&(o=Io(t,n,s),o===void 0&&(o=Io(e,n,s))),o},lo=t=>t.replace(/\$/g,"$$$$");class ru{constructor(e={}){this.logger=Fn.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:s,useRawValueToEscape:r,prefix:o,prefixEscaped:a,suffix:c,suffixEscaped:u,formatSeparator:l,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:D,nestingPrefixEscaped:p,nestingSuffix:F,nestingSuffixEscaped:y,nestingOptionsSeparator:b,maxReplaces:E,alwaysFormat:x}=e.interpolation;this.escape=n!==void 0?n:vm,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=o?Jn(o):a||"{{",this.suffix=c?Jn(c):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=D?Jn(D):p||Jn("$t("),this.nestingSuffix=F?Jn(F):y||Jn(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=E||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,s)=>n?.source===s?(n.lastIndex=0,n):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,s,r){let o,a,c;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=p=>{if(p.indexOf(this.formatSeparator)<0){const E=su(n,u,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,s,{...r,...n,interpolationkey:p}):E}const F=p.split(this.formatSeparator),y=F.shift().trim(),b=F.join(this.formatSeparator).trim();return this.format(su(n,u,y,this.options.keySeparator,this.options.ignoreJSONStructure),b,s,{...r,...n,interpolationkey:y})};this.resetRegExp();const d=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>lo(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?lo(this.escape(p)):lo(p)}].forEach(p=>{for(c=0;o=p.regex.exec(e);){const F=o[1].trim();if(a=l(F),a===void 0)if(typeof d=="function"){const b=d(e,o,r);a=Se(b)?b:""}else if(r&&Object.prototype.hasOwnProperty.call(r,F))a="";else if(h){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${F} for interpolating ${e}`),a="";else!Se(a)&&!this.useRawValueToEscape&&(a=Gc(a));const y=p.safeValue(a);if(e=e.replace(o[0],y),h?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,n,s={}){let r,o,a;const c=(u,l)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const h=u.split(new RegExp(`${Jn(d)}[ ]*{`));let D=`{${h[1]}`;u=h[0],D=this.interpolate(D,a);const p=D.match(/'/g),F=D.match(/"/g);((p?.length??0)%2===0&&!F||(F?.length??0)%2!==0)&&(D=D.replace(/'/g,'"'));try{a=JSON.parse(D),l&&(a={...l,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,y),`${u}${d}${D}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;r=this.nestingRegexp.exec(e);){let u=[];a={...s},a=a.replace&&!Se(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(l!==-1&&(u=r[1].slice(l).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=n(c.call(this,r[1].trim(),a),a),o&&r[0]===e&&!Se(o))return o;Se(o)||(o=Gc(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),u.length&&(o=u.reduce((d,h)=>this.format(d,h,s.lng,{...s,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}const Nm=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const s=t.split("(");e=s[0].toLowerCase().trim();const r=s[1].substring(0,s[1].length-1);e==="currency"&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):e==="relativetime"&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach(a=>{if(a){const[c,...u]=a.split(":"),l=u.join(":").trim().replace(/^'+|'+$/g,""),d=c.trim();n[d]||(n[d]=l),l==="false"&&(n[d]=!1),l==="true"&&(n[d]=!0),isNaN(l)||(n[d]=parseInt(l,10))}})}return{formatName:e,formatOptions:n}},iu=t=>{const e={};return(n,s,r)=>{let o=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(o={...o,[r.interpolationkey]:void 0});const a=s+JSON.stringify(o);let c=e[a];return c||(c=t(Fr(s),r),e[a]=c),c(n)}},Rm=t=>(e,n,s)=>t(Fr(n),s)(e);class Om{constructor(e={}){this.logger=Fn.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const s=n.cacheInBuiltFormats?iu:Rm;this.formats={number:s((r,o)=>{const a=new Intl.NumberFormat(r,{...o});return c=>a.format(c)}),currency:s((r,o)=>{const a=new Intl.NumberFormat(r,{...o,style:"currency"});return c=>a.format(c)}),datetime:s((r,o)=>{const a=new Intl.DateTimeFormat(r,{...o});return c=>a.format(c)}),relativetime:s((r,o)=>{const a=new Intl.RelativeTimeFormat(r,{...o});return c=>a.format(c,o.range||"day")}),list:s((r,o)=>{const a=new Intl.ListFormat(r,{...o});return c=>a.format(c)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=iu(n)}format(e,n,s,r={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(c=>c.indexOf(")")>-1)){const c=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,u)=>{const{formatName:l,formatOptions:d}=Nm(u);if(this.formats[l]){let h=c;try{const D=r?.formatParams?.[r.interpolationkey]||{},p=D.locale||D.lng||r.locale||r.lng||s;h=this.formats[l](c,p,{...d,...r,...D})}catch(D){this.logger.warn(D)}return h}else this.logger.warn(`there was no format function for ${l}`);return c},e)}}const Pm=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class _m extends Ti{constructor(e,n,s,r={}){super(),this.backend=e,this.store=n,this.services=s,this.languageUtils=s.languageUtils,this.options=r,this.logger=Fn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,r.backend,r)}queueLoad(e,n,s,r){const o={},a={},c={},u={};return e.forEach(l=>{let d=!0;n.forEach(h=>{const D=`${l}|${h}`;!s.reload&&this.store.hasResourceBundle(l,h)?this.state[D]=2:this.state[D]<0||(this.state[D]===1?a[D]===void 0&&(a[D]=!0):(this.state[D]=1,d=!1,a[D]===void 0&&(a[D]=!0),o[D]===void 0&&(o[D]=!0),u[h]===void 0&&(u[h]=!0)))}),d||(c[l]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(u)}}loaded(e,n,s){const r=e.split("|"),o=r[0],a=r[1];n&&this.emit("failedLoading",o,a,n),!n&&s&&this.store.addResourceBundle(o,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&s&&(this.state[e]=0);const c={};this.queue.forEach(u=>{Em(u.loaded,[o],a),Pm(u,e),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{c[l]||(c[l]={});const d=u.loaded[l];d.length&&d.forEach(h=>{c[l][h]===void 0&&(c[l][h]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(u=>!u.done)}read(e,n,s,r=0,o=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:s,tried:r,wait:o,callback:a});return}this.readingCalls++;const c=(l,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(l&&d&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,s,r+1,o*2,a)},o);return}a(l,d)},u=this.backend[s].bind(this.backend);if(u.length===2){try{const l=u(e,n);l&&typeof l.then=="function"?l.then(d=>c(null,d)).catch(c):c(null,l)}catch(l){c(l)}return}return u(e,n,c)}prepareLoading(e,n,s={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Se(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Se(n)&&(n=[n]);const o=this.queueLoad(e,n,s,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,s){this.prepareLoading(e,n,{},s)}reload(e,n,s){this.prepareLoading(e,n,{reload:!0},s)}loadOne(e,n=""){const s=e.split("|"),r=s[0],o=s[1];this.read(r,o,"read",void 0,void 0,(a,c)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${r} failed`,a),!a&&c&&this.logger.log(`${n}loaded namespace ${o} for language ${r}`,c),this.loaded(e,a,c)})}saveMissing(e,n,s,r,o,a={},c=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${s}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend?.create){const u={...a,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let d;l.length===5?d=l(e,n,s,r,u):d=l(e,n,s,r),d&&typeof d.then=="function"?d.then(h=>c(null,h)).catch(c):c(null,d)}catch(d){c(d)}else l(e,n,s,r,c,u)}!e||!e[0]||this.store.addResource(e[0],n,s,r)}}}const ho=()=>({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:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Se(t[1])&&(e.defaultValue=t[1]),Se(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(s=>{e[s]=n[s]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ou=t=>(Se(t.ns)&&(t.ns=[t.ns]),Se(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Se(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),qr=()=>{},Im=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},yl="__i18next_supportNoticeShown",Mm=()=>!!(typeof globalThis<"u"&&globalThis[yl]||typeof process<"u"&&co&&co.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&co),$m=()=>{typeof globalThis<"u"&&(globalThis[yl]=!0)},Um=t=>!!(t?.modules?.backend?.name?.indexOf("Locize")>0||t?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||t?.options?.backend?.backends&&t.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||t?.options?.backend?.projectId||t?.options?.backend?.backendOptions&&t.options.backend.backendOptions.some(e=>e?.projectId));class mr extends Ti{constructor(e={},n){if(super(),this.options=ou(e),this.services={},this.logger=Fn,this.modules={external:[]},Im(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(Se(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=ho();this.options={...s,...this.options,...ou(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Um(this)&&!Mm()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),$m());const r=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?Fn.init(r(this.modules.logger),this.options):Fn.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Om;const d=new eu(this.options);this.store=new Zc(this.options.resources,this.options);const h=this.services;h.logger=Fn,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new Lm(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),l&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=r(l),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new ru(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new _m(r(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(p,...F)=>{this.emit(p,...F)}),this.modules.languageDetector&&(h.languageDetector=r(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=r(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new li(this.services,this.options),this.translator.on("*",(p,...F)=>{this.emit(p,...F)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,n||(n=qr),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[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(l=>{this[l]=(...d)=>this.store[l](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...d)=>(this.store[l](...d),this)});const c=or(),u=()=>{const l=(d,h)=>{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),c.resolve(h),n(d,h)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),c}loadResources(e,n=qr){let s=n;const r=Se(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const o=[],a=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(l=>{l!=="cimode"&&o.indexOf(l)<0&&o.push(l)})};r?a(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload?.forEach?.(c=>a(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(c)})}else s(null)}reloadResources(e,n,s){const r=or();return typeof e=="function"&&(s=e,e=void 0),typeof n=="function"&&(s=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),s||(s=qr),this.services.backendConnector.reload(e,n,o=>{r.resolve(),s(o)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Fl.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const s=this.languages[n];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const s=or();this.emit("languageChanging",e);const r=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,u)=>{u?this.isLanguageChangingTo===e&&(r(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve((...l)=>this.t(...l)),n&&n(c,(...l)=>this.t(...l))},a=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const u=Se(c)?c:c&&c[0],l=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(Se(c)?[c]:c);l&&(this.language||r(l),this.translator.language||this.translator.changeLanguage(l),this.services.languageDetector?.cacheUserLanguage?.(l)),this.loadResources(l,d=>{o(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,n,s){const r=(o,a,...c)=>{let u;typeof a!="object"?u=this.options.overloadTranslationOptionHandler([o,a].concat(c)):u={...a},u.lng=u.lng||r.lng,u.lngs=u.lngs||r.lngs,u.ns=u.ns||r.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||s||r.keyPrefix);const l={...this.options,...u};typeof u.keyPrefix=="function"&&(u.keyPrefix=Ss(u.keyPrefix,l));const d=this.options.keySeparator||".";let h;return u.keyPrefix&&Array.isArray(o)?h=o.map(D=>(typeof D=="function"&&(D=Ss(D,l)),`${u.keyPrefix}${d}${D}`)):(typeof o=="function"&&(o=Ss(o,l)),h=u.keyPrefix?`${u.keyPrefix}${d}${o}`:o),this.t(h,u)};return Se(e)?r.lng=e:r.lngs=e,r.ns=n,r.keyPrefix=s,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(c,u)=>{const l=this.services.backendConnector.state[`${c}|${u}`];return l===-1||l===0||l===2};if(n.precheck){const c=n.precheck(this,a);if(c!==void 0)return c}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!r||a(o,e)))}loadNamespaces(e,n){const s=or();return this.options.ns?(Se(e)&&(e=[e]),e.forEach(r=>{this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}),this.loadResources(r=>{s.resolve(),n&&n(r)}),s):(n&&n(),Promise.resolve())}loadLanguages(e,n){const s=or();Se(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(a=>r.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=r.concat(o),this.loadResources(a=>{s.resolve(),n&&n(a)}),s):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const r=new Intl.Locale(e);if(r&&r.getTextInfo){const o=r.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services?.languageUtils||new eu(ho());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const s=new mr(e,n);return s.createInstance=mr.createInstance,s}cloneInstance(e={},n=qr){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new mr(r);if((e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},s){const c=Object.keys(this.store.data).reduce((u,l)=>(u[l]={...this.store.data[l]},u[l]=Object.keys(u[l]).reduce((d,h)=>(d[h]={...u[l][h]},d),u[l]),u),{});o.store=new Zc(c,r),o.services.resourceStore=o.store}if(e.interpolation){const u={...ho().interpolation,...this.options.interpolation,...e.interpolation},l={...r,interpolation:u};o.services.interpolator=new ru(l)}return o.translator=new li(o.services,r),o.translator.on("*",(c,...u)=>{o.emit(c,...u)}),o.init(r,n),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ke=mr.createInstance();Ke.createInstance;Ke.dir;Ke.init;Ke.loadResources;Ke.reloadResources;Ke.use;Ke.changeLanguage;Ke.getFixedT;Ke.t;Ke.exists;Ke.setDefaultNamespace;Ke.hasLoadedNamespace;Ke.loadNamespaces;Ke.loadLanguages;const{slice:zm,forEach:Vm}=[];function Hm(t){return Vm.call(zm.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function qm(t){return typeof t!="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(n=>n.test(t))}const au=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Km=function(t,e){const s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},r=encodeURIComponent(e);let o=`${t}=${r}`;if(s.maxAge>0){const a=s.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(s.domain){if(!au.test(s.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${s.domain}`}if(s.path){if(!au.test(s.path))throw new TypeError("option path is invalid");o+=`; Path=${s.path}`}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${s.expires.toUTCString()}`}if(s.httpOnly&&(o+="; HttpOnly"),s.secure&&(o+="; Secure"),s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s.partitioned&&(o+="; Partitioned"),o},cu={create(t,e,n,s){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+n*60*1e3)),s&&(r.domain=s),document.cookie=Km(t,e,r)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let s=0;s<n.length;s++){let r=n[s];for(;r.charAt(0)===" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return r.substring(e.length,r.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var Wm={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return cu.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:s,cookieDomain:r,cookieOptions:o}=e;n&&typeof document<"u"&&cu.create(n,t,s,r,o)}},Gm={name:"querystring",lookup(t){let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const o=s.substring(1).split("&");for(let a=0;a<o.length;a++){const c=o[a].indexOf("=");c>0&&o[a].substring(0,c)===e&&(n=o[a].substring(c+1))}}return n}},Ym={name:"hash",lookup(t){let{lookupHash:e,lookupFromHashIndex:n}=t,s;if(typeof window<"u"){const{hash:r}=window.location;if(r&&r.length>2){const o=r.substring(1);if(e){const a=o.split("&");for(let c=0;c<a.length;c++){const u=a[c].indexOf("=");u>0&&a[c].substring(0,u)===e&&(s=a[c].substring(u+1))}}if(s)return s;if(!s&&n>-1){const a=r.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return s}};let Ds=null;const uu=()=>{if(Ds!==null)return Ds;try{if(Ds=typeof window<"u"&&window.localStorage!==null,!Ds)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ds=!1}return Ds};var Xm={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&uu())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&uu()&&window.localStorage.setItem(n,t)}};let gs=null;const lu=()=>{if(gs!==null)return gs;try{if(gs=typeof window<"u"&&window.sessionStorage!==null,!gs)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{gs=!1}return gs};var Jm={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&lu())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&lu()&&window.sessionStorage.setItem(n,t)}},Zm={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:s,language:r}=navigator;if(n)for(let o=0;o<n.length;o++)e.push(n[o]);s&&e.push(s),r&&e.push(r)}return e.length>0?e:void 0}},Qm={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const s=e||(typeof document<"u"?document.documentElement:null);return s&&typeof s.getAttribute=="function"&&(n=s.getAttribute("lang")),n}},ep={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof e=="number"?e:0]?.replace("/",""):void 0}},tp={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,s=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[n]}};let Cl=!1;try{document.cookie,Cl=!0}catch{}const El=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Cl||El.splice(1,1);const np=()=>({order:El,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class wl{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Hm(n,this.options||{},np()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=r=>r.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(Wm),this.addDetector(Gm),this.addDetector(Xm),this.addDetector(Jm),this.addDetector(Zm),this.addDetector(Qm),this.addDetector(ep),this.addDetector(tp),this.addDetector(Ym)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(s=>{if(this.detectors[s]){let r=this.detectors[s].lookup(this.options);r&&typeof r=="string"&&(r=[r]),r&&(n=n.concat(r))}}),n=n.filter(s=>s!=null&&!qm(s)).map(s=>this.options.convertDetectedLanguage(s)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(s=>{this.detectors[s]&&this.detectors[s].cacheUserLanguage(e,this.options)}))}}wl.type="languageDetector";const sp={cancel:"Cancel",create:"Create",add:"Add",remove:"Remove",delete:"Delete",close:"Close",user:"User",permission:"Permission",readOnly:"Read only",readWrite:"Read & write",settings:"Settings",comments:"Comments",files:"Files",outline:"Outline",version:"Version",loading:"Loading…",enabled:"Enabled",disabled:"Disabled",normal:"Active",admin:"Administrator",language:"Language",save:"Save",edit:"Edit",retry:"Retry",reload:"Reload page",languageEnglish:"English",languageChinese:"中文"},rp={tagline:"A lightweight LaTeX writing environment",username:"Username",password:"Password",login:"Sign in",contact:"Need an account? Contact {{email}}",firstLogin:"Change your temporary password to continue",currentPassword:"Current password",newPassword:"New password",confirmPassword:"Confirm new password",updatePassword:"Update password",mismatch:"The new passwords do not match",passwordMinimum:"At least {{count}} characters",sessionExpired:"Your session has expired. Please sign in again.",logout:"Sign out"},ip={title:"Projects",subtitle:"Create, edit and share LaTeX documents",restricted:"You can access projects shared with you. Project creation requires administrator permission.",new:"New project",newDescription:"The project will use the configured default LaTeX engine.",name:"Project name",emptyTitle:"Let’s build something great",emptyDescription:"Create a project or upload an existing LaTeX archive to get started.",emptyRestricted:"Projects shared with you will appear here.",noMatches:"No projects match the current search or tag filter.",upload:"Upload project",uploadDescription:"Upload a ZIP archive. A single top-level folder is removed automatically. Maximum file size: {{size}} MB.",zipFile:"ZIP archive",import:"Import project",importing:"Importing…",search:"Search projects…",grid:"Grid",list:"List",scope:"Project status",active:"Active",archived:"Archived",archive:"Archive",unarchive:"Restore",noArchived:"No archived projects.",allTags:"All tags",sortBy:"Sort",sortModified:"Last modified",sortCreated:"Created",pagination:"Project pages",pageOf:"Page {{page}} of {{totalPages}} · {{count}} projects",previousPage:"Previous",nextPage:"Next",owner:"Owner",created:"Created",modified:"Last modified",relativeHoursPast:"{{hours}}h ago",relativeHoursMinutesPast:"{{hours}}h {{minutes}}m ago",relativeHoursFuture:"in {{hours}}h",relativeHoursMinutesFuture:"in {{hours}}h {{minutes}}m",relativeDaysPast:"{{days}}d ago",relativeDaysHoursPast:"{{days}}d {{hours}}h ago",relativeDaysFuture:"in {{days}}d",relativeDaysHoursFuture:"in {{days}}d {{hours}}h",comments:"Comments",unresolvedComments:"{{count}} unresolved comments",unresolvedCommentsTooltip:"{{unresolved}} unresolved / {{total}} total comments",allResolved:"All resolved ({{count}})",allCommentsResolvedTooltip:"All {{count}} comments resolved",noComments:"No comments",unresolvedCount:"{{count}} unresolved",modifiedBy:"Modified by",byUser:"By {{user}}",modifiedByUser:"{{time}} · By {{user}}",deletedUser:"Deleted user",filterTags:"Filter by tag",rename:"Rename",renameTitle:"Rename project",duplicate:"Duplicate",duplicating:"Duplicating…",duplicateTitle:"Duplicate project",duplicateDescription:"Create an independent copy of {{project}}. Files and project settings are copied; members, comments, Git history and compile output are not.",transfer:"Transfer",transferOwnership:"Transfer ownership",transferDescription:"Choose a new owner for {{project}}.",newOwner:"New owner",chooseNewOwner:"Choose a user",noTransferUsers:"No other active users",transferWarning:"You will keep read/write access. Source files, history, comments and members remain; the saved GitHub token is removed so the new owner can add their own credential.",transferForbidden:"Only the current project owner can transfer ownership.",transferTargetInvalid:"Choose a new project owner.",transferSelf:"You already own this project.",download:"Download",deleteTitle:"Delete project",deleteDescription:"Permanently delete {{project}} and all of its files? This cannot be undone.",chooseZip:"Choose a ZIP project",dropZip:"Drag and drop a ZIP archive here",browse:"Browse files",selectedFileSize:"Selected · {{size}}",clearFile:"Clear selected file"},op={manage:"User management",back:"Back to projects",onlyAdmin:"Only administrators can create users",add:"Add user",role:"Role",createProjects:"Create projects",ownedProjects:"Owned projects",status:"Status",actions:"Actions",adminRequired:"Administrator permission is required.",allow:"Allow",deny:"Deny",enable:"Enable",disable:"Disable",promote:"Make administrator",demote:"Make user",allowCreate:"Allow creation",denyCreate:"Deny creation",resetPassword:"Reset password",initialPassword:"Login password",displayName:"Display name",addDescription:"Set a login password or generate a secure random one.",createUser:"Create user",randomPassword:"Random password",generatePassword:"Generate a random password",resetDescription:"Set a temporary password for {{username}}. Existing sessions will be signed out.",reset:"Reset",deleteTitle:"Delete user",deleteDescription:"Delete {{username}}? This cannot be undone.",ownedChoice:"{{count}} owned projects",transferProjects:"Transfer them to the current administrator",deleteProjects:"Permanently delete projects and files"},ap=JSON.parse(`{"saved":"Saved","savedAt":"Saved to server at {{time}}","loading":"Loading","pending":"Waiting to save","saving":"Saving to server","saveFailed":"Save failed","offlineDraft":"Offline · local draft retained","harperRecoveryTitle":"Harper is unavailable.","harperFallbackHint":" The browser's built-in spellchecker is being used instead.","texFmtRecoveryTitle":"tex-fmt could not load.","texFmtOptionsRecoveryTitle":"tex-fmt rejected the source or options.","texFmtRuntimeRecoveryTitle":"tex-fmt returned an unexpected result.","clientToolRecoveryHint":" Retry now, or reload the page to use the latest browser assets.","resetFormatterOptions":"Clear options and retry","texFmtDiagnosticsTitle":"tex-fmt produced diagnostics.","texFmtDiagnosticsHint":" The formatted text was applied; review the details below.","viewFormatterDiagnostics":"View diagnostics","dismissFormatterDiagnostics":"Dismiss formatter diagnostics","formattingBy":"{{name}} is formatting this file. Please wait…","compile":"Compile · {{engine}}","compiling":"Compiling…","compileQueued":"Compile queued…","compileFailedRetained":"Compilation failed; showing the last successful PDF from {{time}}.","compileFailedNoPdf":"Compilation failed and no successful PDF is available.","upToDate":"Files are up to date; no compilation was needed.","compileSnapshotStale":"PDF compiled from a consistent earlier snapshot; newer source changes are not included.","addComment":"Add comment","sourceComments":"Source comments","projectSettings":"Project settings","uploadAttachment":"Upload attachment","newFile":"New text file","binary":"The binary attachment is stored but cannot be opened in the text editor.","noOutline":"No sections in this file","preview":"PDF preview","previewHint":"Compile to generate the document","loadingPdf":"Loading PDF…","pdfCompiledAt":"Compiled successfully at {{time}}","pdfCompiledAtFor":"{{file}} compiled successfully at {{time}}","currentMainDocument":"Current document compiled as the root: {{path}}","mainDocumentCandidate":"LaTeX root document candidate: {{path}}","currentMainShort":"root","deletedUser":"Deleted User","orphaned":"Anchor lost","line":"Line {{line}}","reopen":"Reopen","resolve":"Mark resolved","noComments":"No comments in this file","newFileDescription":"Directories are allowed, for example chapters/introduction.tex.","filePath":"File path","commentDescription":"Selected {{count}} characters","pointComment":"No text selected; the comment will be anchored at the cursor.","commentContent":"Comment","backToProjects":"Back to projects","outputTabs":"Compile output","log":"Log","warnings":"Warnings","errors":"Errors","artifacts":"Artifacts","clean":"Recovery","noLog":"Compile to see the log.","noWarnings":"No warnings in the latest compile.","noErrors":"No errors in the latest compile.","projectRoot":"Project root","uploadTo":"Upload to {{folder}}","dropFiles":"Drop files to upload","newFolder":"New folder","folderName":"Folder name","noArtifacts":"Compile to see generated artifacts.","selectArtifact":"Select a text artifact to preview it.","viewArtifact":"View artifact","downloadArtifact":"Download artifact","downloadToView":"Download this artifact to view it","cleanTitle":"Compilation recovery","cleanDescription":"Use these advanced actions only when compilation is stuck, a previous error is left behind, or generated output is inconsistent. They do not change source files, project settings, comments, history, or Git data.","cleanCache":"Force a clean rebuild","cleanCacheDescription":"Use after a compilation failure or stale latexmk state. Removes the incremental cache while keeping the current successful PDF.","cleanArtifacts":"Remove generated output","cleanArtifactsDescription":"Use when generated files are inconsistent. Removes the PDF, SyncTeX, logs, and intermediate files for this root document.","cleanCacheConfirmTitle":"Force a clean rebuild?","cleanCacheConfirmDescription":"This recovery action removes the incremental latexmk cache. The current PDF remains visible, and the next compilation starts from a clean cache.","cleanArtifactsConfirmTitle":"Remove generated output?","cleanArtifactsConfirmDescription":"This recovery action removes the current PDF and all generated files for this root document. Source files are not affected.","cleanConfirm":"Run recovery","cleanCacheComplete":"Recovery cache cleared. The next compilation will be a full rebuild.","cleanArtifactsComplete":"Generated compilation output removed.","cleanBusy":"This root document is compiling. Try recovery again after it finishes.","folderDestination":"The folder will be created in {{folder}}.","uploadOverwriteTitle":"File already exists","uploadOverwriteDescription":"These files already exist: {{files}}. Replace them?","uploadOverwrite":"Replace files","collapseFiles":"Collapse file panel","move":"Move","moveTitle":"Move or rename {{name}}","moveDescription":"Choose a destination folder and name. Files, comments and project paths stay linked.","pathName":"Name","moveApply":"Move / rename","deletePath":"Delete file or folder","deletePathTitle":"Delete {{name}}","deletePathDescription":"Delete {{path}}? This cannot be undone.","deletePathActiveDescription":"Delete {{path}}? It is currently open for {{users}} and will close in those sessions.","deletePathWillClose":"Any late edits to this path will be rejected to prevent silent data loss.","fileDeletedByCollaborator":"{{path}} was deleted in another session. A safe fallback file has been opened.","destinationFolder":"Destination folder","compileShortcut":"Save and compile (Ctrl+S / Cmd+S)","compilingBy":"{{name}} is compiling","format":"Format","formatFile":"File","formatFileHint":"Format the current file","formatFileComplete":"Current file formatted.","formatFileFailed":"Unable to format the current file: {{message}}","formatSelected":"Selected","commentsAdd":"Add","commentsAll":"View","formatSelection":"Format selection","formatting":"Formatting…","formatSelectionHint":"Select LaTeX source to format","formatSelectionRequired":"Select LaTeX source before formatting.","formatSelectionComplete":"Selected LaTeX source formatted.","formatFailedContinue":"Formatting failed; compilation will continue: {{message}}","formatFailed":"Unable to format the selection: {{message}}","formatSourceChanged":"The source changed during formatting, so formatting was skipped.","formatSelectionChanged":"The selected source changed during formatting. Select it again and retry.","writingSuggestions":"Writing suggestions","noWritingSuggestions":"No suggestions available","removeText":"Remove text","replaceWith":"Replace with {{word}}","spellCheckReadOnly":"Read-only: choose a suggestion in an editor with write permission.","spellCheckSourceChanged":"The source changed before the writing correction could be applied.","vimOn":"Vim ON","vimOnHint":"Vim keybindings are enabled for this editor.","reply":"Reply","replyPlaceholder":"Write a reply…","sendReply":"Send reply","editComment":"Edit comment","deleteComment":"Delete comment","saveChanges":"Save changes","deleteCommentTitle":"Delete comment","deleteCommentDescription":"Delete this comment and its {{count}} replies? This cannot be undone.","editReply":"Edit reply","deleteReply":"Delete reply","deleteReplyTitle":"Delete reply","deleteReplyDescription":"Delete this reply? This cannot be undone.","editedAt":"Edited {{time}}","outlineJump":"Go to source line {{line}} and locate it in the PDF","lineNumber":"line {{line}}","showInSource":"Show the visible PDF location in source","showInPdf":"Show the source cursor location in PDF","syncTexOnlyForTex":"PDF sync is only available for TeX (.tex) files","syncTexOnlyForMain":"PDF sync is only available for the current main TeX document","openFiles":"Open files","pdfLoadFailed":"The PDF preview could not be loaded","pdfZoomControls":"PDF zoom controls","downloadPdf":"Download PDF","downloadResource":"Download file","resourceTooLarge":"This file is {{size}} and exceeds the direct preview limit of {{limit}}.","resourceTooLargeTitle":"File is too large to preview","resourceTooLargeDescription":"Download the file to open it locally.","resourceUnsupportedTitle":"Preview unavailable","resourceUnsupportedDescription":"This file type cannot be rendered in the browser. Download it to open it locally.","resourcePreview":{"image":"Image preview","pdf":"PDF preview","text":"Text preview","unsupported":"File preview"},"pdfZoomOut":"Zoom out","pdfZoomIn":"Zoom in","pdfFitWidth":"Fit width","pdfLink":"PDF link","pdfLinks":"PDF links","layout":{"label":"Layout","choose":"Choose layout","current":"Current layout: {{layout}}","editor-pdf":{"name":"Editor & PDF","description":"Show the source editor and PDF preview side by side"},"editor-only":{"name":"Editor only","description":"Use the workspace for source editing"},"pdf-only":{"name":"PDF only","description":"Use the workspace for the PDF and compile output"}},"collaboration":{"connecting":"Connecting collaboration…","connected":"Live collaboration connected","disconnected":"Collaboration disconnected","editing":"Editing","viewing":"Viewing","joining":"Joining project","reconnect":"Reconnect","permissionDowngradeTitle":"Edit permission changed","permissionDowngradeDescription":"Your access changed from {{previous}} to read-only. Any unsaved local draft is still retained in this tab and cannot be saved. Keep it visible, or discard it and reload the latest server version.","permissionDowngradeKeep":"Keep local draft","permissionDowngradeDiscard":"Discard draft and reload","permissionDowngradeReload":"Reload server version","permissionDowngradeNoDraft":"Your access changed to read-only. Reload to use the latest server version, or continue viewing this tab.","permissionDowngradeOtherTab":"Your access changed to read-only. Another browser tab still has an unsaved draft; return to that tab to handle it. This page cannot clear the shared local draft safely.","permissionDowngradeMultipleDrafts":"Your access changed to read-only. This tab and another browser tab both have unsaved drafts. Handle the other tab first; this page will not clear shared local data.","permissionDowngradeOtherTabBlocked":"Another browser tab just created an unsaved draft, so cleanup was cancelled to protect it.","activeSessions":"{{count}} active sessions","showMoreSessions":"Show {{count}} more sessions","showFewerSessions":"Collapse session list","sessionTooltip":"{{name}} (@{{username}}) · {{file}} · {{activity}} · {{permission}}"},"search":{"button":"Find","title":"Find and replace (Ctrl+F / Cmd+F)","find":"Find","replace":"Replace","next":"Next","previous":"Previous","all":"Select all","matchCase":"Match case","regexp":"Regular expression","wholeWord":"Whole word","replaceNext":"Replace","replaceAll":"Replace all","currentMatch":"Current match","onLine":"on line","replacedMatchOnLine":"replaced match on line $","replacedMatches":"replaced $ matches","goToLine":"Go to line","go":"Go","matchCount":"{{count}} matches","noMatches":"No matches","invalidQuery":"Invalid regular expression"}}`),cp={title:"Citation library",description:"Save references from {{file}} and import them into this BibTeX file. Your library and its tags are private to your account.",myLibrary:"My library",currentFile:"Current file",searchPlaceholder:"Search citations…",searchHint:"Search key, title, author, or year",emptyTitle:"Your library is empty",emptyDescription:"Open the current-file tab to save a BibTeX entry.",noEntries:"No BibTeX entries found",noEntriesDescription:"Add a valid @article, @inproceedings, or similar entry to this file.",currentFileTitle:"Entries from the current file",currentFileDescription:"Select an entry to save it to your citation library.",backToLibrary:"Back to library",save:"Save",update:"Update",saving:"Saving…",saved:"Citation saved to your library.",updated:"Citation updated.",deleted:"Citation deleted.",deleteTitle:"Delete citation",deleteDescription:"Delete the citation {{key}} from your private library? This cannot be undone.",fileTooLarge:"This BibTeX file exceeds the {{size}} limit.",fileTooLargeHint:"The file is too large to parse in the browser. Save individual entries from a smaller file or split it first.",fileInvalid:"The current BibTeX file contains syntax errors.",fileInvalidHint:"Fix the current file before formatting it or importing another citation.",savedLabel:"Saved",import:"Import",importToFile:"Import into the current BibTeX file",importRequiresWrite:"Import requires write permission for this project.",imported:"Imported {{key}} into the current file.",untitled:"Untitled citation",authorUnknown:"Author not specified",allTags:"All tags",noTags:"No tags yet",noTagMatches:"No citations match this tag.",newTagPlaceholder:"New tag name",tagColor:"Tag color",createTag:"Create tag",tagCreated:"Tag created.",tags:"Tags",tagsTitle:"Tags for {{key}}",noTagsToAssign:"Create a tag first.",saveTags:"Save tags",tagsUpdated:"Tags updated.",editTitle:"Edit {{key}}"},up={invalid:"Enter one valid BibTeX entry.",tooLarge:"This BibTeX entry is too large.",notFound:"The citation does not exist.",keyExists:"That citation key already exists. Review the existing entry before replacing it.",tagNotFound:"The citation tag does not exist.",conflict:"This citation changed elsewhere. Refresh the library and try again.",alreadyInFile:"{{key}} is already present in this BibTeX file."},lp="Manage your private BibTeX references and tags from the homepage. Open a .bib file to save or import entries.",dp={addEntry:"Add entry",addEntryTitle:"Add a BibTeX entry",addEntryDescription:"Paste one complete BibTeX entry. It will be validated before it is saved.",addEntryPlaceholder:`@article{key,
|
|
3
|
-
author = {Author},
|
|
4
|
-
title = {Title},
|
|
5
|
-
year = {2026}
|
|
6
|
-
}`,added:"Citation added to your library."},hp={pageOf:"Page {{page}} of {{totalPages}} · {{count}} entries",previous:"Previous",next:"Next"},fp={quickOpen:"Quick open",quickOpenDescription:"Open a project file by name (Ctrl/Cmd+P).",filePlaceholder:"Type a file name…",noFiles:"No matching files.",projectSearch:"Project search",projectSearchDescription:"Search and replace across project source files (Ctrl/Cmd+Shift+F).",searchPlaceholder:"Search all source files…",replacePlaceholder:"Replace with…",matchSummary:"{{count}} matches",truncated:"Showing the first {{count}} matches.",replaceAll:"Replace all {{count}}",replaceConfirmTitle:"Replace across the project",replaceConfirmDescription:"Replace all {{count}} matches? Automatic history records every changed file first.",replaced:"Replaced {{count}} matches in {{files}} files."},mp={title:"History",description:"Browse automatic project versions, compare files and safely restore earlier work.",empty:"No history versions yet.",changedCount:"{{count}} changed files",fileCount:"{{count}} files",changed:"changed",labelPlaceholder:"Name this version",saveLabel:"Save label",compareCurrent:"Compare with current",comparingCurrent:"Earlier version compared with the current file",chooseFile:"Choose a file, then compare it with the current source.",restore:"Restore",restoreFile:"Restore file",restoreProject:"Restore project",restoreFileTitle:"Restore this file",restoreProjectTitle:"Restore this project version",restoreFileDescription:"Restore {{path}} from this version? The current project is checkpointed first.",restoreProjectDescription:"Restore all source files and compiler settings from this version? The current project is checkpointed first.",storage:"History storage",storageUsage:"{{used}} of {{limit}}",versionUsage:"{{count}} of {{limit}} ordinary versions",protectedVersions:"{{count}} labeled",storageExceeded:"Protected or current data exceeds the soft storage limit.",deleteVersion:"Delete version",deleteVersionTitle:"Delete this history version",deleteVersionDescription:"Permanently delete {{name}}? Current project files are not changed.",clearAll:"Clear history",clearAllTitle:"Clear all project history",clearAllDescription:"Permanently delete every history version and its unreferenced stored data? Current project files are not changed.",reasons:{initial:"Project created",autosave:"Automatic save",file:"File operation",settings:"Compiler settings",git:"Git operation",restore:"Restored version",checkpoint:"Safety checkpoint"}},pp={mainFile:"Main document",invalidMainFileOption:"{{path}} (not a root document)",engine:"Compiler",latexmkrc:"Project latexmkrc",save:"Save project settings",members:"Shared members",recentLog:"Latest compile log",share:"Share",shareDescription:"Projects can only be shared with users created by an administrator.",chooseUser:"Choose a user",latexmkrcPlaceholder:`# Empty disables the project rc file
|
|
7
|
-
$pdf_mode = 1;`,addMember:"Add member",noMembers:"This project has not been shared with anyone.",removeTitle:"Remove shared member",removeDescription:"Remove {{username}}? Their account and other projects are unaffected.",editorTab:"Editor appearance",compilerTab:"LaTeX compiler",compilerDescription:"Choose the main document and compiler options shared by everyone in this project.",editorAppearance:"Editor appearance",editorAppearanceDescription:"These preferences are private to this user and project on this browser. The project dictionary is shared.",browserTools:"Formatting tools",toolStatus:{loading:"Loading",working:"Working",error:"Error"},reloadTool:"Reload",saveAppearance:"Save appearance",saveCompiler:"Save compiler settings",writingCheckDescription:"Harper runs once on the TexLite server and is shared by all projects. If it is unavailable, the browser spellchecker takes over. Spelling issues use a red wavy underline; grammar issues use yellow. Right-click an issue for suggestions.",projectConfiguration:"Project configuration",fontFamily:"English font",fontSize:"Font size",lineHeight:"Line spacing",dictionary:"Project dictionary",dictionaryDescription:"Words added here are imported into Harper's custom dictionary and ignored by spelling checks for this project. Editors can maintain this list.",dictionaryPlaceholder:"Add a custom word",addWord:"Add word",dictionaryEmpty:"No custom words yet.",lineWrapping:"Wrap long lines",spellCheck:"Spelling and grammar checking",vimMode:"Vim keybindings",vimModeDescription:"Use Vim normal/insert/visual modes in this editor.",vimHelp:"View help",formatOnCompile:"Format LaTeX before compiling",formatOnCompileDescription:"Off by default. Formatting runs before compilation.",formatRequiresWrite:"Formatting requires permission to edit this project.",formatterDescription:"Tex, cls, and sty files use the bundled browser-side tex-fmt WASM formatter; BibTeX files use browser-side bibtex-tidy.",formatterInstall:"View tex-fmt package/docs",bibtexTidyInstall:"View bibtex-tidy",texFmtOptions:"tex-fmt options (TOML)",texFmtOptionsPlaceholder:`wrap = true
|
|
8
|
-
wraplen = 80`,texFmtOptionsDescription:"These options are private to this user and project. They are passed directly to tex-fmt in the browser.",openFilesInTabs:"Open LaTeX files in editor tabs",openFilesInTabsDescription:"Open .tex, .bib, .sty and other source files in tabs at the top of the editor.",writingIssues:"{{count}} writing issues ({{uniqueCount}} unique)",noWritingIssues:"No spelling or grammar issues found.",spellCheckFirst:"First writing issue",spellCheckPrevious:"Previous writing issue",spellCheckNext:"Next writing issue",spellCheckLast:"Last writing issue",spellCheckPosition:"{{current}}/{{total}}",fontJetBrains:"JetBrains Mono",fontSourceCode:"Source Code Pro",fontIbmPlex:"IBM Plex Mono",fontFiraCode:"Fira Code",fontIosevka:"Iosevka",lineHeightCompact:"Compact",lineHeightNormal:"Normal",lineHeightRelaxed:"Relaxed"},Dp={title:"Git backup",description:"Manage the local Git history and its GitHub backup. Only the project owner can use these actions.",ownerOnly:"Only the project owner can use Git backup.",authentication:"GitHub authentication",authenticationHint:"Use a token with repository Administration and Contents write access. It is encrypted at rest and never written to the repository or remote URL.",recommendedAccessTitle:"Recommended repository access: All repositories",recommendedAccess:"texLite is intended for trusted users. Select All repositories so this token can create a repository and access repositories created later. Grant Administration and Contents read and write permissions.",token:"Personal access token",tokenPlaceholder:"Paste your GitHub token",replaceToken:"Replace personal access token",saveToken:"Save and verify token",createToken:"Create a fine-grained token",connectedAs:"Connected as @{{login}}",removeToken:"Remove token",tokenSaved:"GitHub token saved; the local repository is ready.",tokenRemoved:"GitHub token removed.",repository:"Repository",localReady:"The project source is managed by a local Git repository.",localPending:"Saving a valid token initializes the local Git repository.",repositoryName:"GitHub repository name",privateRepository:"Create as a private repository",createRepository:"Create GitHub repository",repositoryCreated:"GitHub repository created.",origin:"origin",openGitHub:"Open GitHub",clean:"Working tree clean",changedFiles:"{{count}} changed files",commitAndPush:"Commit and push",identity:"Commits use {{username}} <{{username}}@texlite.com> for this command only.",detachedHead:"Detached HEAD: return to the default branch before committing or pushing.",detachedAt:"detached at {{revision}}",commitMessage:"Commit message",commitPlaceholder:"Describe this backup…",commit:"Commit",committed:"Changes committed.",noChangesToCommit:"There are no new changes to commit.",push:"Push",pushed:"Push succeeded. The backup is up to date on GitHub.",pushFailed:"Push failed",workingDiff:"Working diff",refresh:"Refresh",diffTitle:"Diff",diffTruncated:"output truncated",diffFontSize:"Diff font size",diffFontDecrease:"Decrease diff font size",diffFontIncrease:"Increase diff font size",fullscreenDiff:"View diff full screen",exitFullscreenDiff:"Exit full screen",noChanges:"No differences to display.",history:"History",historyHint:"Up to 100 recent commits",noCommits:"No commits yet.",viewCommitDiff:"View this commit's diff",checkoutVersion:"Checkout this version",checkoutTitle:"Checkout version",checkout:"Checkout",checkoutDescription:"Checkout {{revision}} — {{message}}. By default Git preserves compatible uncommitted changes and refuses conflicts.",forceCheckout:"Force overwrite",forceCheckoutDescription:"Explicitly discard tracked and untracked working changes before checkout. This cannot be undone.",returnToBranch:"Return to {{branch}}",returnTitle:"Return to default branch",returnDescription:"Checkout {{branch}}. By default Git preserves compatible uncommitted changes and refuses conflicts.",discardChanges:"Discard changes",noChangesToDiscard:"There are no changes to discard.",discardTitle:"Discard uncommitted changes",discardDescription:"Restore all tracked files to the current HEAD commit. Untracked files are unaffected.",discardConfirm:"Discard changes"},gp={title:"System status",description:"Live server health and recent operation latency. Values refresh every five seconds.",refresh:"Refresh",uptime:"Uptime",memory:"Memory",heap:"heap",compileQueue:"Compile jobs",pending:"{{count}} pending",collaboration:"Collaboration",sessions:"{{count}} sessions",roomsAndDirty:"{{rooms}} rooms · {{dirty}} dirty files",eventLoop:"Event-loop latency",latencySummary:"P50 {{p50Ms}} ms · P95 {{p95Ms}} ms · max {{maxMs}} ms",operationDurations:"Recent operation durations",noSamples:"No operation samples have been collected yet.",operation:"Operation",samples:"Samples",last:"Last",max:"Max",operations:{collaboration:{connect:"Open collaboration room",persist:"Save collaboration changes"},workspace:{project:"Load project metadata",files:"Load project files",compileState:"Load retained PDF state"},compile:{snapshot:"Prepare compile snapshot",request:"Compile request total",cacheSync:"Update compiler cache",latexmk:"Run latexmk",artifactCopy:"Publish compile artifacts"},outline:{build:"Build project outline"},search:{project:"Search project"},completions:{build:"Build completion index"}}},Fp={title:"Tags",add:"Add tag",create:"Create tag",createDescription:"Create a private reusable colored tag for organizing your projects.",assign:"Tags",assignTitle:"Tags for {{project}}",assignDescription:"Select your private tags for this project. Other users have their own tags.",empty:"Create a tag first.",allAssigned:"All available tags are already assigned.",name:"Tag name",color:"Color",filter:"Filter",red:"Red",orange:"Orange",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",gray:"Gray"},bp={generic:"Operation failed",request:"Request failed ({{status}})",upload:"Upload failed",boundaryTitle:"Something went wrong",boundaryDescription:"An unexpected error occurred while rendering the page. You can try recovering, or reload the page.",boundaryRetry:"Retry",boundaryReload:"Reload page",fileExists:"A file or folder with this name already exists.",pathConflict:"The destination path is already used by a folder or file.",duplicateUploadNames:"The selected files contain duplicate names: {{files}}.",fileTooLarge:"The file exceeds the {{size}} MB limit.",zipOnly:"Please choose a ZIP archive.",collaborationUnavailable:"Live collaboration is not connected. Reconnect before saving or compiling.",codes:{AUTH_INVALID:"The username or password is incorrect.",CURRENT_PASSWORD_INVALID:"The current password is incorrect.",USER_NOT_FOUND:"The user no longer exists.",LAST_ADMIN:"At least one administrator must remain active.",SELF_DELETE_FORBIDDEN:"You cannot delete the currently signed-in administrator.",PROJECT_CREATE_FORBIDDEN:"You do not have permission to create projects.",PROJECT_NOT_FOUND:"The project does not exist or is no longer accessible.",PROJECT_OWNER_ONLY:"Only the project owner can change this setting.",PROJECT_EDIT_FORBIDDEN:"You do not have edit permission for this project.",DICTIONARY_EDIT_FORBIDDEN:"You do not have permission to maintain this project's dictionary.",TAG_NOT_FOUND:"The selected tag does not exist.",GIT_TOKEN_INVALID:"Enter a GitHub token.",GIT_REPOSITORY_NAME_INVALID:"Enter a GitHub repository name.",GIT_REVISION_INVALID:"Choose a Git revision to check out.",PROJECT_DELETE_FORBIDDEN:"Only the project owner can delete this project.",MEMBERS_MANAGE_FORBIDDEN:"Only the project owner can manage project members.",OWNER_MEMBER_FORBIDDEN:"The project owner cannot be added as a member.",INVALID_PATH:"The file path is invalid.",RESERVED_PATH:"This path is reserved by TexLite.",PATH_EXISTS:"The destination path is already used by a file or folder.",FILE_EXISTS:"A file with this name already exists.",PATH_NOT_FOUND:"The file or folder does not exist.",FILE_NOT_FOUND:"The file does not exist.",DIRECTORY_NOT_FOUND:"The destination folder does not exist.",MOVE_INTO_SELF:"A folder cannot be moved into itself.",MAIN_FILE_DELETE_FORBIDDEN:"The main document cannot be deleted.",FILE_TOO_LARGE:"This file is too large to open or upload.",UPLOAD_EMPTY:"No file was selected for upload.",COMMENT_FILE_NOT_FOUND:"The file for this comment does not exist.",COMMENT_RANGE_INVALID:"The comment source range is invalid.",COMMENT_NOT_FOUND:"The comment does not exist.",COMMENT_EDIT_FORBIDDEN:"You can only edit your own comments.",COMMENT_DELETE_FORBIDDEN:"You can only delete your own comments.",REPLY_NOT_FOUND:"The reply does not exist.",REPLY_EDIT_FORBIDDEN:"You can only edit your own replies.",REPLY_DELETE_FORBIDDEN:"You can only delete your own replies.",COMMENT_UPDATE_EMPTY:"There is no comment content to update.",MAIN_FILE_NOT_FOUND:"The selected main document does not exist.",LATEXMKRC_DISABLED:"Project latexmkrc files are disabled by the administrator.",LATEXMKRC_NOT_FOUND:"The selected latexmkrc file does not exist.",COMPILE_ARTIFACTS_NOT_FOUND:"No compiled artifacts are available yet.",COMPILE_ARTIFACT_NOT_FOUND:"The compiled artifact does not exist.",ARTIFACT_PREVIEW_UNSUPPORTED:"This artifact cannot be previewed as text; download it instead.",SYNC_SOURCE_INVALID:"The source location is invalid.",SOURCE_FILE_NOT_FOUND:"The source file does not exist.",SYNCTEX_NOT_AVAILABLE:"No SyncTeX data is available. Compile the project again.",SYNC_PDF_INVALID:"The PDF location is invalid.",SYNCTEX_EXTERNAL_PATH:"SyncTeX returned a source path outside the project.",COMPILE_FORBIDDEN:"You do not have permission to compile this project.",PDF_NOT_FOUND:"No PDF has been generated yet.",API_NOT_FOUND:"The API endpoint does not exist.",SERVER_ERROR:"The server could not complete the request.",REQUEST_INVALID:"The request is invalid."}},yp={historyVersionNotFound:"The selected history version no longer exists.",historyFileNotFound:"This file does not exist in the selected history version.",historyTargetConflict:"The current restore target is a directory or another non-file path.",historyPreviewUnsupported:"This historical file cannot be compared as text.",searchInvalid:"Enter valid text to search for.",gitUnavailable:"Git integration is unavailable. Install Git on the host or correct git.binary in the configuration, then try again.",formatFailed:"tex-fmt could not format this source.",mainDocumentInvalid:"The selected file is not a valid LaTeX root document.",compileSnapshotBusy:"The source has not finished saving durably. Wait a moment and try compiling again."},Cp={copyright:"© {{year}}",credit:"Designed and developed by CHEN Zhongpu"},Ep={section:"Section",subsection:"Subsection",bold:"Bold",emphasis:"Emphasis",citation:"Citation",reference:"Cross-reference",label:"Label",image:"Image",unordered:"Unordered list",ordered:"Ordered list",equation:"Equation",figure:"Figure",projectCommand:"Project command",projectCommandArgs:"Project command ({{count}} arguments)",projectMacro:"Project macro",expl3Command:"Expl3 project command",mathOperator:"Project math operator",mathDelimiter:"Project math delimiter",projectEnvironment:"Project environment",projectFile:"Project file",package:"Package",documentClass:"Document class",currentFile:"Current file",project:"Project",latex:"LaTeX",standard:"LaTeX command"},wp={common:sp,auth:rp,projects:ip,users:op,editor:ap,citationLibrary:cp,citationErrors:up,citationLibraryHomeDescription:lp,citationLibraryActions:dp,citationLibraryPagination:hp,navigation:fp,history:mp,projectSettings:pp,git:Dp,metrics:gp,tags:Fp,errors:bp,apiErrors:yp,footer:Cp,completions:Ep},xp={cancel:"取消",create:"创建",add:"添加",remove:"移除",delete:"删除",close:"关闭",user:"用户",permission:"权限",readOnly:"只读",readWrite:"读写",settings:"设置",comments:"批注",files:"文件",outline:"大纲",version:"版本",loading:"正在载入…",enabled:"允许",disabled:"禁止",normal:"正常",admin:"管理员",language:"语言",save:"保存",edit:"编辑",retry:"重试",reload:"刷新页面",languageEnglish:"English",languageChinese:"中文"},vp={tagline:"轻量 LaTeX 写作环境",username:"用户名",password:"密码",login:"登录",contact:"需要账号?请联系 {{email}}",firstLogin:"首次登录,请修改初始密码",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认新密码",updatePassword:"更新密码",mismatch:"两次输入的新密码不一致",passwordMinimum:"至少 {{count}} 位",sessionExpired:"登录状态已过期,请重新登录。",logout:"退出"},Ap={title:"项目",subtitle:"创建、编辑和分享 LaTeX 文档",restricted:"你可以访问别人共享给你的项目;创建权限由管理员授予",new:"新建项目",newDescription:"项目会使用配置文件中的默认 LaTeX 引擎。",name:"项目名称",emptyTitle:"一起创造出色的作品",emptyDescription:"创建新项目,或上传已有的 LaTeX 压缩包开始写作。",emptyRestricted:"共享给你的项目会显示在这里。",noMatches:"没有符合当前搜索或标签筛选条件的项目。",upload:"上传项目",uploadDescription:"上传 ZIP 压缩包;若只有一个顶层目录会自动去除。单文件最大 {{size}} MB。",zipFile:"ZIP 压缩包",import:"导入项目",importing:"正在导入…",search:"搜索项目…",grid:"网格",list:"列表",allTags:"全部标签",sortBy:"排序",sortModified:"最后修改时间",sortCreated:"创建时间",scope:"项目状态",active:"活跃项目",archived:"已归档",archive:"归档",unarchive:"取消归档",noArchived:"还没有归档项目。",pagination:"项目分页",pageOf:"第 {{page}} / {{totalPages}} 页 · 共 {{count}} 个项目",previousPage:"上一页",nextPage:"下一页",owner:"所有者",created:"创建时间",modified:"最后修改",relativeHoursPast:"{{hours}}小时前",relativeHoursMinutesPast:"{{hours}}小时{{minutes}}分钟前",relativeHoursFuture:"{{hours}}小时后",relativeHoursMinutesFuture:"{{hours}}小时{{minutes}}分钟后",relativeDaysPast:"{{days}}天前",relativeDaysHoursPast:"{{days}}天{{hours}}小时前",relativeDaysFuture:"{{days}}天后",relativeDaysHoursFuture:"{{days}}天{{hours}}小时后",modifiedBy:"最后修改人",byUser:"由 {{user}} 修改",modifiedByUser:"{{time}} · 由 {{user}} 修改",deletedUser:"已删除用户",comments:"批注",unresolvedComments:"{{count}} 条未解决批注",unresolvedCommentsTooltip:"{{unresolved}} 条未解决批注 / 共 {{total}} 条",allResolved:"全部已解决 ({{count}})",allCommentsResolvedTooltip:"全部 {{count}} 条批注已解决",noComments:"暂无批注",unresolvedCount:"{{count}} 条待解决",filterTags:"按标签过滤",rename:"重命名",renameTitle:"重命名项目",duplicate:"复制项目",duplicating:"正在复制…",duplicateTitle:"复制项目",duplicateDescription:"创建“{{project}}”的独立副本。会复制文件和项目设置,但不会复制成员、批注、Git 历史和编译产物。",download:"下载",transfer:"转让",transferOwnership:"转让项目",transferDescription:"为“{{project}}”选择新的所有者。",newOwner:"新所有者",chooseNewOwner:"请选择用户",noTransferUsers:"没有其他可用用户",transferWarning:"转让后你仍保留读写权限。源码、历史、批注和成员不会改变;已保存的 GitHub token 会被移除,由新所有者配置自己的凭据。",transferForbidden:"只有当前项目所有者可以转让项目。",transferTargetInvalid:"请选择新的项目所有者。",transferSelf:"你已经是该项目的所有者。",deleteTitle:"删除项目",deleteDescription:"确定永久删除“{{project}}”及其全部文件吗?此操作不可撤销。",chooseZip:"选择 ZIP 项目",dropZip:"将 ZIP 压缩包拖放到这里",browse:"浏览文件",selectedFileSize:"已选择 · {{size}}",clearFile:"清除已选文件"},kp={manage:"用户管理",back:"返回项目",onlyAdmin:"仅管理员可以创建用户",add:"添加用户",role:"角色",createProjects:"创建项目",ownedProjects:"拥有项目",status:"状态",actions:"操作",adminRequired:"需要管理员权限。",allow:"允许",deny:"禁止",enable:"启用",disable:"禁用",promote:"设为管理员",demote:"降为用户",allowCreate:"允许创建",denyCreate:"禁止创建",resetPassword:"重置密码",initialPassword:"登录密码",displayName:"显示名称",addDescription:"设置登录密码,或生成一个安全的随机密码。",createUser:"创建用户",randomPassword:"随机密码",generatePassword:"生成随机密码",resetDescription:"为 {{username}} 设置初始密码;其现有会话会被注销。",reset:"重置",deleteTitle:"删除用户",deleteDescription:"确认删除 {{username}}?此操作不可撤销。",ownedChoice:"其拥有的 {{count}} 个项目",transferProjects:"转移给当前管理员",deleteProjects:"永久删除项目及全部文件"},Sp={saved:"已保存",savedAt:"已于 {{time}} 保存到服务器",loading:"载入中",pending:"等待保存",saving:"正在保存到服务器",saveFailed:"保存失败",offlineDraft:"离线 · 本地草稿已保留",harperRecoveryTitle:"Harper 暂不可用。",harperFallbackHint:" 已自动改用浏览器内置拼写检查。",texFmtRecoveryTitle:"tex-fmt 无法加载。",texFmtOptionsRecoveryTitle:"tex-fmt 无法处理当前源码或参数。",texFmtRuntimeRecoveryTitle:"tex-fmt 返回了异常结果。",clientToolRecoveryHint:" 可立即重试;如果页面在系统更新前已经打开,请刷新页面加载最新资源。",resetFormatterOptions:"清空参数并重试",texFmtDiagnosticsTitle:"tex-fmt 生成了诊断信息。",texFmtDiagnosticsHint:" 格式化内容已应用,请查看下方详情。",viewFormatterDiagnostics:"查看诊断",dismissFormatterDiagnostics:"关闭格式化诊断",formattingBy:"{{name}} 正在格式化此文件,请稍候…",compile:"编译 · {{engine}}",compiling:"编译中…",compileQueued:"编译已排队…",compileFailedRetained:"编译失败,当前显示上一次成功生成的 PDF({{time}})。",compileFailedNoPdf:"编译失败,且没有可用的成功 PDF。",upToDate:"文件已是最新,无需重新编译。",compileSnapshotStale:"PDF 基于较早的一致快照编译,未包含之后的源码修改。",addComment:"添加批注",sourceComments:"源码批注",projectSettings:"项目设置",uploadAttachment:"上传附件",newFile:"新建文本文件",binary:"二进制附件已保存,但不能在文本编辑器中打开。",noOutline:"当前文件没有章节",preview:"PDF 预览",previewHint:"点击“编译”生成文档",loadingPdf:"正在加载 PDF…",pdfCompiledAt:"成功编译于 {{time}}",pdfCompiledAtFor:"{{file}} 成功编译于 {{time}}",currentMainDocument:"当前作为主文档编译:{{path}}",mainDocumentCandidate:"LaTeX 主文档候选:{{path}}",currentMainShort:"主文档",deletedUser:"已删除用户",orphaned:"锚点已丢失",line:"第 {{line}} 行",reopen:"重新打开",resolve:"标记为已解决",noComments:"当前文件没有批注",newFileDescription:"可以包含目录,例如 chapters/introduction.tex。",filePath:"文件路径",commentDescription:"已选择 {{count}} 个字符",pointComment:"未选择文本,将在当前光标位置添加批注。",commentContent:"批注内容",backToProjects:"返回项目列表",outputTabs:"编译输出",log:"日志",warnings:"警告",errors:"错误",artifacts:"产物",clean:"故障恢复",noLog:"编译后将在此显示日志。",noWarnings:"最近一次编译没有警告。",noErrors:"最近一次编译没有错误。",projectRoot:"项目根目录",uploadTo:"上传到 {{folder}}",dropFiles:"拖放文件以上传",newFolder:"新建文件夹",folderName:"文件夹名称",folderDestination:"文件夹将创建在 {{folder}} 中。",uploadOverwriteTitle:"文件已存在",uploadOverwriteDescription:"以下文件已经存在:{{files}}。要覆盖它们吗?",uploadOverwrite:"覆盖文件",noArtifacts:"编译后将在此显示输出产物。",selectArtifact:"选择一个文本产物进行预览。",viewArtifact:"查看产物",downloadArtifact:"下载产物",downloadToView:"该产物需要下载后查看",cleanTitle:"编译故障恢复",cleanDescription:"这里只提供高级故障恢复操作:仅在编译卡住、历史错误状态残留或生成产物异常时使用。不会修改源码、项目设置、批注、历史或 Git 数据。",cleanCache:"强制完整重编译",cleanCacheDescription:"仅在编译失败或 latexmk 缓存状态异常时使用。删除增量缓存,但保留当前成功的 PDF。",cleanArtifacts:"删除生成输出",cleanArtifactsDescription:"仅在生成产物状态异常时使用。删除该主文档的 PDF、SyncTeX、日志和中间文件。",cleanCacheConfirmTitle:"强制完整重编译?",cleanCacheConfirmDescription:"此故障恢复操作会删除 latexmk 增量缓存。当前 PDF 会保留,下一次编译将从干净缓存开始。",cleanArtifactsConfirmTitle:"删除生成输出?",cleanArtifactsConfirmDescription:"此故障恢复操作会删除当前 PDF 以及该主文档的全部生成文件,但不会影响源码。",cleanConfirm:"执行恢复",cleanCacheComplete:"故障恢复缓存已清理,下一次编译将完整执行。",cleanArtifactsComplete:"编译生成输出已删除。",cleanBusy:"当前主文档正在编译,请完成后再执行故障恢复。",collapseFiles:"折叠文件面板",move:"移动",moveTitle:"移动或重命名 {{name}}",moveDescription:"选择目标文件夹和名称;源码、批注和项目路径会保持关联。",pathName:"名称",moveApply:"移动/重命名",destinationFolder:"目标文件夹",deletePath:"删除文件或文件夹",deletePathTitle:"删除 {{name}}",deletePathDescription:"确定删除 {{path}}?此操作不可撤销。",deletePathActiveDescription:"确定删除 {{path}}?{{users}} 当前正在打开它,删除后这些会话将关闭该文件。",deletePathWillClose:"系统会拒绝该路径上迟到的修改,避免内容被静默丢失。",fileDeletedByCollaborator:"{{path}} 已在其他会话中删除,现已打开安全的备用文件。",compileShortcut:"保存并编译(Ctrl+S / Cmd+S)",compilingBy:"{{name}} 正在编译",format:"格式化",formatFile:"文件",formatFileHint:"格式化当前文件",formatFileComplete:"当前文件已格式化。",formatFileFailed:"无法格式化当前文件:{{message}}",formatSelected:"选区",commentsAdd:"添加",commentsAll:"查看",formatSelection:"格式化选区",formatting:"正在格式化…",formatSelectionHint:"选择一段 LaTeX 源码后格式化",formatSelectionRequired:"请先选择 LaTeX 源码,再进行格式化。",formatSelectionComplete:"所选 LaTeX 源码已格式化。",formatFailedContinue:"格式化失败,仍将继续编译:{{message}}",formatFailed:"无法格式化选区:{{message}}",formatSourceChanged:"格式化期间源码已发生变化,已跳过本次格式化。",formatSelectionChanged:"格式化期间所选源码已发生变化,请重新选择后再试。",writingSuggestions:"写作建议",noWritingSuggestions:"没有可用的修改建议",removeText:"删除文本",replaceWith:"替换为 {{word}}",spellCheckReadOnly:"当前为只读,需要编辑权限才能替换。",spellCheckSourceChanged:"源码在应用写作修正前发生了变化。",vimOn:"Vim 已开启",vimOnHint:"当前编辑器已启用 Vim 键位。",reply:"回复",replyPlaceholder:"输入回复内容…",sendReply:"发送回复",editComment:"编辑批注",deleteComment:"删除批注",saveChanges:"保存修改",deleteCommentTitle:"删除批注",deleteCommentDescription:"确定删除这条批注及其 {{count}} 条回复吗?此操作不可撤销。",editReply:"编辑回复",deleteReply:"删除回复",deleteReplyTitle:"删除回复",deleteReplyDescription:"确定删除这条回复吗?此操作不可撤销。",editedAt:"编辑于 {{time}}",outlineJump:"跳转到源码第 {{line}} 行并定位 PDF",lineNumber:"第 {{line}} 行",showInSource:"在源码中显示当前 PDF 位置",showInPdf:"在 PDF 中显示当前源码光标位置",syncTexOnlyForTex:"PDF 跳转仅支持 TeX 源文件(.tex)",syncTexOnlyForMain:"PDF 跳转仅支持当前主 TeX 文档",openFiles:"打开的文件",pdfLoadFailed:"无法载入 PDF 预览",pdfZoomControls:"PDF 缩放控件",downloadPdf:"下载 PDF",downloadResource:"下载文件",resourceTooLarge:"该文件大小为 {{size}},超过 {{limit}} 的直接预览上限。",resourceTooLargeTitle:"文件过大,无法直接预览",resourceTooLargeDescription:"请下载文件后在本地打开。",resourceUnsupportedTitle:"无法预览",resourceUnsupportedDescription:"浏览器不能直接渲染此文件类型,请下载后在本地打开。",resourcePreview:{image:"图片预览",pdf:"PDF 预览",text:"文本预览",unsupported:"文件预览"},pdfZoomOut:"缩小",pdfZoomIn:"放大",pdfFitWidth:"适合宽度",pdfLink:"PDF 链接",pdfLinks:"PDF 链接",layout:{label:"布局",choose:"选择布局",current:"当前布局:{{layout}}","editor-pdf":{name:"编辑器与 PDF",description:"并排显示源码编辑器和 PDF 预览"},"editor-only":{name:"仅编辑器",description:"将工作区用于源码编辑"},"pdf-only":{name:"仅 PDF",description:"将工作区用于 PDF 和编译输出"}},collaboration:{connecting:"正在连接协作服务…",connected:"实时协作已连接",disconnected:"实时协作连接已断开",editing:"正在编辑",viewing:"正在查看",joining:"正在进入项目",reconnect:"重新连接",permissionDowngradeTitle:"编辑权限已变更",permissionDowngradeDescription:"您的权限已从{{previous}}变为只读。任何尚未保存的本地草稿仍保留在当前标签页中,但无法保存。您可以继续查看草稿,或放弃草稿并重新加载服务器上的最新版本。",permissionDowngradeKeep:"保留本地草稿",permissionDowngradeDiscard:"放弃草稿并重新加载",permissionDowngradeReload:"重新加载服务器版本",permissionDowngradeNoDraft:"您的权限已变为只读。您可以继续查看当前标签页,或重新加载服务器上的最新版本。",permissionDowngradeOtherTab:"您的权限已变为只读。另一个浏览器标签页中仍有尚未保存的草稿,请返回该标签页处理。为避免误删,该页面不能清理共享的本地草稿。",permissionDowngradeMultipleDrafts:"您的权限已变为只读。当前标签页和其他浏览器标签页都存在尚未保存的草稿。请先在其他标签页中处理草稿;当前页面不会清理共享数据。",permissionDowngradeOtherTabBlocked:"另一个浏览器标签页刚刚产生了尚未保存的草稿,已取消清理以保护该草稿。",activeSessions:"{{count}} 个活跃会话",showMoreSessions:"展开另外 {{count}} 个会话",showFewerSessions:"收起会话列表",sessionTooltip:"{{name}}(@{{username}})· {{file}} · {{activity}} · {{permission}}"},search:{button:"查找",title:"查找和替换(Ctrl+F / Cmd+F)",find:"查找",replace:"替换为",next:"下一个",previous:"上一个",all:"选择全部",matchCase:"区分大小写",regexp:"正则表达式",wholeWord:"全字匹配",replaceNext:"替换",replaceAll:"全部替换",currentMatch:"当前匹配",onLine:"位于行",replacedMatchOnLine:"已替换第 $ 行的匹配项",replacedMatches:"已替换 $ 个匹配项",goToLine:"跳转到行",go:"跳转",matchCount:"共 {{count}} 个匹配",noMatches:"没有匹配项",invalidQuery:"正则表达式无效"}},jp={title:"引用库",description:"从 {{file}} 保存文献,并将它们导入当前 BibTeX 文件。引用库及其标签仅属于你自己。",myLibrary:"我的引用库",currentFile:"当前文件",searchPlaceholder:"搜索引用…",searchHint:"可搜索 key、标题、作者或年份",emptyTitle:"引用库还是空的",emptyDescription:"打开“当前文件”标签页,保存一个 BibTeX 文献条目。",noEntries:"没有找到 BibTeX 条目",noEntriesDescription:"请在当前文件中添加有效的 @article、@inproceedings 或其他文献条目。",currentFileTitle:"当前文件中的条目",currentFileDescription:"选择一个条目保存到你的引用库。",backToLibrary:"返回引用库",save:"保存",update:"更新",saving:"正在保存…",saved:"引用已保存到你的引用库。",updated:"引用已更新。",deleted:"引用已删除。",deleteTitle:"删除引用",deleteDescription:"确定从你的私有引用库中删除引用 {{key}}?此操作不可撤销。",fileTooLarge:"该 BibTeX 文件超过 {{size}} 限制。",fileTooLargeHint:"文件过大,浏览器不会解析其中的条目。请拆分文件后再保存单条引用。",fileInvalid:"当前 BibTeX 文件存在语法错误。",fileInvalidHint:"请先修复当前文件,再格式化或导入新的引用。",savedLabel:"已保存",import:"导入",importToFile:"导入到当前 BibTeX 文件",importRequiresWrite:"导入需要当前项目的写权限。",imported:"已将 {{key}} 导入当前文件。",untitled:"未命名引用",authorUnknown:"未填写作者",allTags:"全部标签",noTags:"还没有标签",noTagMatches:"没有匹配此标签的引用。",newTagPlaceholder:"新标签名称",tagColor:"标签颜色",createTag:"创建标签",tagCreated:"标签已创建。",tags:"标签",tagsTitle:"{{key}} 的标签",noTagsToAssign:"请先创建标签。",saveTags:"保存标签",tagsUpdated:"标签已更新。",editTitle:"编辑 {{key}}"},Bp={invalid:"请输入一个有效的 BibTeX 条目。",tooLarge:"BibTeX 条目过大。",notFound:"引用条目不存在。",keyExists:"引用 key 已经存在,请检查现有条目后再决定是否替换。",tagNotFound:"引用标签不存在。",conflict:"该引用已在其他位置发生修改,请刷新引用库后重试。",alreadyInFile:"{{key}} 已经存在于当前 BibTeX 文件中。"},Tp="在首页管理属于你自己的 BibTeX 文献和标签。打开 .bib 文件后即可保存或导入条目。",Lp={addEntry:"添加条目",addEntryTitle:"添加 BibTeX 条目",addEntryDescription:"粘贴一个完整的 BibTeX 文献条目,保存前会进行校验。",addEntryPlaceholder:`@article{key,
|
|
9
|
-
author = {Author},
|
|
10
|
-
title = {Title},
|
|
11
|
-
year = {2026}
|
|
12
|
-
}`,added:"引用已添加到你的引用库。"},Np={pageOf:"第 {{page}} / {{totalPages}} 页 · {{count}} 条引用",previous:"上一页",next:"下一页"},Rp={quickOpen:"快速打开",quickOpenDescription:"按名称打开项目文件(Ctrl/Cmd+P)。",filePlaceholder:"输入文件名…",noFiles:"没有匹配的文件。",projectSearch:"项目搜索",projectSearchDescription:"在项目源码文件中搜索和替换(Ctrl/Cmd+Shift+F)。",searchPlaceholder:"搜索全部源码文件…",replacePlaceholder:"替换为…",matchSummary:"共 {{count}} 个匹配",truncated:"仅显示前 {{count}} 个匹配。",replaceAll:"替换全部 {{count}} 项",replaceConfirmTitle:"在项目中批量替换",replaceConfirmDescription:"确定替换全部 {{count}} 个匹配?自动历史会记录所有修改文件。",replaced:"已在 {{files}} 个文件中替换 {{count}} 项。"},Op={title:"历史",description:"浏览自动项目版本、比较文件,并安全恢复较早的工作。",empty:"尚无历史版本。",changedCount:"{{count}} 个文件有变化",fileCount:"{{count}} 个文件",changed:"有修改",labelPlaceholder:"为此版本命名",saveLabel:"保存标签",compareCurrent:"与当前版本比较",comparingCurrent:"历史版本与当前文件的比较",chooseFile:"选择文件后,可与当前源码进行比较。",restore:"恢复",restoreFile:"恢复文件",restoreProject:"恢复项目",restoreFileTitle:"恢复此文件",restoreProjectTitle:"恢复此项目版本",restoreFileDescription:"从此版本恢复 {{path}}?系统会先为当前项目创建安全检查点。",restoreProjectDescription:"恢复此版本的全部源码和编译器设置?系统会先为当前项目创建安全检查点。",storage:"历史存储",storageUsage:"已使用 {{used}},上限 {{limit}}",versionUsage:"普通版本 {{count}} / {{limit}}",protectedVersions:"{{count}} 个已标记版本",storageExceeded:"受保护版本或当前基线已超过存储软上限。",deleteVersion:"删除版本",deleteVersionTitle:"删除此历史版本",deleteVersionDescription:"永久删除“{{name}}”?当前项目文件不会改变。",clearAll:"清空历史",clearAllTitle:"清空全部项目历史",clearAllDescription:"永久删除全部历史版本及不再引用的存储数据?当前项目文件不会改变。",reasons:{initial:"项目创建",autosave:"自动保存",file:"文件操作",settings:"编译器设置",git:"Git 操作",restore:"恢复版本",checkpoint:"安全检查点"}},Pp={mainFile:"主文档",invalidMainFileOption:"{{path}}(不是主文档)",engine:"编译引擎",latexmkrc:"项目 latexmkrc",save:"保存项目设置",members:"共享成员",recentLog:"最近编译日志",share:"共享",shareDescription:"仅可共享给管理员已创建的用户。",chooseUser:"请选择用户",latexmkrcPlaceholder:`# 留空表示不使用项目 rc 文件
|
|
13
|
-
$pdf_mode = 1;`,addMember:"添加成员",noMembers:"该项目尚未分享给其他成员。",removeTitle:"移除共享成员",removeDescription:"确认移除 {{username}}?其账号和其他项目不会受到影响。",editorTab:"编辑器外观",compilerTab:"LaTeX 编译器",compilerDescription:"选择本项目所有成员共享的主文档和 LaTeX 编译选项。",editorAppearance:"编辑器外观",editorAppearanceDescription:"这些偏好仅作用于当前浏览器中的当前用户和项目;项目词典是共享的。",browserTools:"格式化工具",toolStatus:{loading:"加载中",working:"运行正常",error:"错误"},reloadTool:"重新加载",saveAppearance:"保存外观设置",saveCompiler:"保存编译器设置",writingCheckDescription:"Harper 在 TexLite 后端单例运行并由所有项目共享;服务不可用时自动改用浏览器内置拼写检查。拼写问题使用红色波浪线,语法问题使用黄色波浪线;右键问题可以查看修改建议。",projectConfiguration:"项目配置",fontFamily:"英文字体",fontSize:"字体大小",lineHeight:"行间距",dictionary:"项目词典",dictionaryDescription:"添加到这里的词会导入 Harper 的自定义词典,并在本项目的拼写检查中忽略;具有编辑权限的用户可以维护此列表。",dictionaryPlaceholder:"添加自定义词",addWord:"添加词",dictionaryEmpty:"暂未添加自定义词。",lineWrapping:"自动换行",spellCheck:"拼写和语法检查",vimMode:"Vim 键位",vimModeDescription:"在当前编辑器中使用 Vim 的普通、插入和可视模式。",vimHelp:"查看帮助",formatOnCompile:"编译前自动格式化 LaTeX",formatOnCompileDescription:"默认关闭;格式化会在编译前执行。",formatRequiresWrite:"需要项目编辑权限才能使用格式化。",formatterDescription:"tex、cls、sty 使用内置的浏览器 tex-fmt WASM 格式化器;BibTeX 使用浏览器中的 bibtex-tidy。",formatterInstall:"查看 tex-fmt 包和文档",bibtexTidyInstall:"查看 bibtex-tidy",texFmtOptions:"tex-fmt 参数(TOML)",texFmtOptionsPlaceholder:`wrap = true
|
|
14
|
-
wraplen = 80`,texFmtOptionsDescription:"这些参数仅保存于当前用户和项目,并直接在浏览器中传递给 tex-fmt。",openFilesInTabs:"使用新 Tab 打开 LaTeX 文件",openFilesInTabsDescription:"在编辑器顶部通过标签页管理打开的 .tex、.bib、.sty 等源码文件。",writingIssues:"发现 {{count}} 个写作问题(去重后 {{uniqueCount}} 个)",noWritingIssues:"未发现拼写或语法问题。",spellCheckFirst:"第一个写作问题",spellCheckPrevious:"上一个写作问题",spellCheckNext:"下一个写作问题",spellCheckLast:"最后一个写作问题",spellCheckPosition:"第 {{current}}/{{total}} 个",fontJetBrains:"JetBrains Mono",fontSourceCode:"Source Code Pro",fontIbmPlex:"IBM Plex Mono",fontFiraCode:"Fira Code",fontIosevka:"Iosevka",lineHeightCompact:"紧凑",lineHeightNormal:"标准",lineHeightRelaxed:"宽松"},_p={title:"Git 备份",description:"管理本地 Git 历史及 GitHub 备份;只有项目创建者可以执行这些操作。",ownerOnly:"只有项目所有者可以使用 Git 备份。",authentication:"GitHub 身份验证",authenticationHint:"token 需要仓库 Administration 与 Contents 写权限;它会加密保存,不会写入项目仓库或远程地址。",recommendedAccessTitle:"建议的仓库访问范围:All repositories(所有仓库)",recommendedAccess:"texLite 面向相互信任的用户。请选择 All repositories,使该 token 能创建仓库,并访问之后新建的仓库;同时授予 Administration 和 Contents 的 Read and write 权限。",token:"个人访问 token",tokenPlaceholder:"在此粘贴 GitHub token",replaceToken:"替换个人访问 token",saveToken:"保存并验证 token",createToken:"创建细粒度 token",connectedAs:"已连接为 @{{login}}",removeToken:"移除 token",tokenSaved:"GitHub token 已保存,本地仓库已就绪。",tokenRemoved:"GitHub token 已移除。",repository:"仓库",localReady:"项目源码已由本地 Git 仓库管理。",localPending:"保存有效 token 后将自动初始化本地 Git 仓库。",repositoryName:"GitHub 仓库名称",privateRepository:"创建为私有仓库",createRepository:"创建 GitHub 仓库",repositoryCreated:"GitHub 仓库创建成功。",origin:"远程仓库",openGitHub:"打开 GitHub",clean:"工作区干净",changedFiles:"{{count}} 个文件有修改",commitAndPush:"提交与推送",identity:"本次提交临时使用 {{username}} <{{username}}@texlite.com>,不会写入 Git 配置。",detachedHead:"当前处于 detached HEAD;请先返回默认分支再提交或推送。",detachedAt:"detached 于 {{revision}}",commitMessage:"提交说明",commitPlaceholder:"说明本次备份的内容…",commit:"提交",committed:"修改已提交。",noChangesToCommit:"当前没有新的修改可以提交。",push:"推送",pushed:"推送成功,GitHub 备份已是最新。",pushFailed:"推送失败",workingDiff:"当前差异",refresh:"刷新",diffTitle:"差异",diffTruncated:"输出已截断",diffFontSize:"差异字体大小",diffFontDecrease:"减小差异字体",diffFontIncrease:"增大差异字体",fullscreenDiff:"全屏查看差异",exitFullscreenDiff:"退出全屏",noChanges:"没有可显示的差异。",history:"提交历史",historyHint:"最多显示最近 100 次提交",noCommits:"尚无提交。",viewCommitDiff:"查看该提交的差异",checkoutVersion:"checkout 到该版本",checkoutTitle:"Checkout 版本",checkout:"Checkout",checkoutDescription:"将 checkout 到 {{revision}} — {{message}}。默认由 Git 保留兼容的未提交修改,发生冲突时拒绝操作。",forceCheckout:"强制覆盖",forceCheckoutDescription:"明确丢弃所有已跟踪及未跟踪的工作区修改后再 checkout;此操作不可撤销。",returnToBranch:"返回 {{branch}}",returnTitle:"返回默认分支",returnDescription:"将 checkout 到 {{branch}}。默认由 Git 保留兼容的未提交修改,发生冲突时拒绝操作。",discardChanges:"撤销修改",noChangesToDiscard:"当前没有可以撤销的修改。",discardTitle:"撤销未提交修改",discardDescription:"把所有已跟踪文件恢复到当前 HEAD(上次 commit)。未跟踪文件不受影响。",discardConfirm:"确认撤销"},Ip={title:"系统状态",description:"服务器实时健康状态和近期操作耗时,每五秒自动刷新。",refresh:"刷新",uptime:"运行时间",memory:"内存",heap:"堆内存",compileQueue:"编译任务",pending:"{{count}} 个等待中",collaboration:"协作",sessions:"{{count}} 个会话",roomsAndDirty:"{{rooms}} 个房间 · {{dirty}} 个待保存文件",eventLoop:"事件循环延迟",latencySummary:"P50 {{p50Ms}} ms · P95 {{p95Ms}} ms · 最大 {{maxMs}} ms",operationDurations:"近期操作耗时",noSamples:"尚未采集到操作样本。",operation:"操作",samples:"样本",last:"最近",max:"最大",operations:{collaboration:{connect:"打开协作房间",persist:"保存协作修改"},workspace:{project:"加载项目元数据",files:"加载项目文件",compileState:"加载保留的 PDF 状态"},compile:{snapshot:"准备编译快照",request:"编译请求总耗时",cacheSync:"更新编译缓存",latexmk:"运行 latexmk",artifactCopy:"发布编译产物"},outline:{build:"生成项目大纲"},search:{project:"项目内搜索"},completions:{build:"生成补全索引"}}},Mp={title:"标签",add:"添加标签",create:"新建标签",createDescription:"创建仅自己可见的可复用彩色标签,用于整理项目。",assign:"标签",assignTitle:"“{{project}}”的标签",assignDescription:"勾选你为此项目设置的私有标签;其他用户拥有各自的标签。",empty:"请先创建标签。",allAssigned:"所有可用标签均已添加。",name:"标签名称",color:"颜色",filter:"筛选",red:"红色",orange:"橙色",yellow:"黄色",green:"绿色",blue:"蓝色",purple:"紫色",gray:"灰色"},$p={generic:"操作失败",request:"请求失败({{status}})",upload:"上传失败",boundaryTitle:"页面遇到问题",boundaryDescription:"渲染组件时发生异常。你可以尝试恢复,或刷新页面重新载入。",boundaryRetry:"重试",boundaryReload:"刷新页面",fileExists:"同名文件或文件夹已经存在。",pathConflict:"目标路径已经被文件或文件夹占用。",duplicateUploadNames:"所选文件中存在重复名称:{{files}}。",fileTooLarge:"文件超过 {{size}} MB 限制。",zipOnly:"请选择 ZIP 压缩包。",collaborationUnavailable:"实时协作尚未连接,请在重新连接后保存或编译。",codes:{AUTH_INVALID:"用户名或密码错误。",CURRENT_PASSWORD_INVALID:"当前密码错误。",USER_NOT_FOUND:"用户不存在或已被删除。",LAST_ADMIN:"系统必须保留至少一名可用管理员。",SELF_DELETE_FORBIDDEN:"不能删除当前登录的管理员。",PROJECT_CREATE_FORBIDDEN:"管理员尚未授予你创建项目的权限。",PROJECT_NOT_FOUND:"项目不存在或你已无法访问。",PROJECT_OWNER_ONLY:"只有项目所有者可以修改此设置。",PROJECT_EDIT_FORBIDDEN:"你没有此项目的编辑权限。",DICTIONARY_EDIT_FORBIDDEN:"你没有维护本项目词典的权限。",TAG_NOT_FOUND:"所选标签不存在。",GIT_TOKEN_INVALID:"请输入 GitHub token。",GIT_REPOSITORY_NAME_INVALID:"请输入 GitHub 仓库名称。",GIT_REVISION_INVALID:"请选择要 checkout 的 Git 版本。",PROJECT_DELETE_FORBIDDEN:"只有项目所有者可以删除项目。",MEMBERS_MANAGE_FORBIDDEN:"只有项目所有者可以管理项目成员。",OWNER_MEMBER_FORBIDDEN:"项目所有者不能作为成员添加。",INVALID_PATH:"文件路径无效。",RESERVED_PATH:"此路径由 TexLite 保留。",PATH_EXISTS:"目标路径已被文件或文件夹占用。",FILE_EXISTS:"同名文件已经存在。",PATH_NOT_FOUND:"文件或文件夹不存在。",FILE_NOT_FOUND:"文件不存在。",DIRECTORY_NOT_FOUND:"目标文件夹不存在。",MOVE_INTO_SELF:"不能把文件夹移动到自身内部。",MAIN_FILE_DELETE_FORBIDDEN:"不能删除主文档。",FILE_TOO_LARGE:"文件过大,无法打开或上传。",UPLOAD_EMPTY:"没有选择要上传的文件。",COMMENT_FILE_NOT_FOUND:"批注对应的文件不存在。",COMMENT_RANGE_INVALID:"批注的源码区间无效。",COMMENT_NOT_FOUND:"批注不存在。",COMMENT_EDIT_FORBIDDEN:"只能编辑自己的批注。",COMMENT_DELETE_FORBIDDEN:"只能删除自己的批注。",REPLY_NOT_FOUND:"回复不存在。",REPLY_EDIT_FORBIDDEN:"只能编辑自己的回复。",REPLY_DELETE_FORBIDDEN:"只能删除自己的回复。",COMMENT_UPDATE_EMPTY:"没有可更新的批注内容。",MAIN_FILE_NOT_FOUND:"所选主文档不存在。",LATEXMKRC_DISABLED:"管理员已禁用项目级 latexmkrc。",LATEXMKRC_NOT_FOUND:"所选 latexmkrc 文件不存在。",COMPILE_ARTIFACTS_NOT_FOUND:"尚无可用的编译产物。",COMPILE_ARTIFACT_NOT_FOUND:"编译产物不存在。",ARTIFACT_PREVIEW_UNSUPPORTED:"该产物不能作为文本预览,请下载后查看。",SYNC_SOURCE_INVALID:"源码位置无效。",SOURCE_FILE_NOT_FOUND:"源码文件不存在。",SYNCTEX_NOT_AVAILABLE:"尚无可用的 SyncTeX 数据,请重新编译。",SYNC_PDF_INVALID:"PDF 位置无效。",SYNCTEX_EXTERNAL_PATH:"SyncTeX 返回了项目外部的源码路径。",COMPILE_FORBIDDEN:"你没有编译此项目的权限。",PDF_NOT_FOUND:"尚未生成 PDF。",API_NOT_FOUND:"接口不存在。",SERVER_ERROR:"服务器无法完成请求。",REQUEST_INVALID:"请求格式无效。"}},Up={historyVersionNotFound:"所选历史版本已不存在。",historyFileNotFound:"所选历史版本中没有这个文件。",historyTargetConflict:"当前恢复目标是目录或其他非普通文件路径。",historyPreviewUnsupported:"这个历史文件不能作为文本比较。",searchInvalid:"请输入有效的搜索内容。",gitUnavailable:"Git 集成功能不可用。请在宿主机安装 Git,或修正配置中的 git.binary 后重试。",formatFailed:"tex-fmt 无法格式化这段源码。",mainDocumentInvalid:"所选文件不是有效的 LaTeX 主文档。",compileSnapshotBusy:"源码尚未完成稳定保存,请稍后再试编译。"},zp={copyright:"© {{year}}",credit:"Designed and developed by CHEN Zhongpu"},Vp={section:"章节",subsection:"小节",bold:"粗体",emphasis:"强调",citation:"引用文献",reference:"交叉引用",label:"标签",image:"插入图片",unordered:"无序列表",ordered:"有序列表",equation:"公式",figure:"图片环境",projectCommand:"项目命令",projectCommandArgs:"项目命令({{count}} 个参数)",projectMacro:"项目宏",expl3Command:"Expl3 项目命令",mathOperator:"项目数学算子",mathDelimiter:"项目数学定界符",projectEnvironment:"项目环境",projectFile:"项目文件",package:"宏包",documentClass:"文档类",currentFile:"当前文件",project:"项目",latex:"LaTeX",standard:"LaTeX 命令"},Hp={common:xp,auth:vp,projects:Ap,users:kp,editor:Sp,citationLibrary:jp,citationErrors:Bp,citationLibraryHomeDescription:Tp,citationLibraryActions:Lp,citationLibraryPagination:Np,navigation:Rp,history:Op,projectSettings:Pp,git:_p,metrics:Ip,tags:Mp,errors:$p,apiErrors:Up,footer:zp,completions:Vp};Ke.use(wl).use(Dm).init({resources:{en:{translation:wp},zh:{translation:Hp}},fallbackLng:"en",supportedLngs:["en","zh"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});class xl extends Error{constructor(e,n,s=null){super(e),this.status=n,this.code=s}status;code}async function re(t,e={}){const{suppressSessionExpired:n=!1,...s}=e,r=new Headers(s.headers);r.has("Accept-Language")||r.set("Accept-Language",Ke.resolvedLanguage?.startsWith("zh")?"zh":"en"),s.body&&!r.has("Content-Type")&&r.set("Content-Type","application/json");const o=await fetch(t,{...s,headers:r}),c=(o.headers.get("content-type")??"").includes("application/json")?await o.json():null;if(!o.ok)throw o.status===401&&!n&&typeof window<"u"&&window.dispatchEvent(new Event("texlite:session-expired")),new xl(Ea(c,o.status),o.status,vl(c));return c}function Ea(t,e,n="errors.request"){const s=typeof t=="object"&&t!==null&&"error"in t&&typeof t.error=="string"?t.error:"",r=vl(t);if(r){const o={AUTH_REQUIRED:"auth.sessionExpired",ADMIN_REQUIRED:"users.adminRequired",HISTORY_VERSION_NOT_FOUND:"apiErrors.historyVersionNotFound",HISTORY_FILE_NOT_FOUND:"apiErrors.historyFileNotFound",HISTORY_TARGET_CONFLICT:"apiErrors.historyTargetConflict",HISTORY_FILE_PREVIEW_UNSUPPORTED:"apiErrors.historyPreviewUnsupported",SEARCH_QUERY_INVALID:"apiErrors.searchInvalid",GIT_UNAVAILABLE:"apiErrors.gitUnavailable",FORMAT_FAILED:"apiErrors.formatFailed",PROJECT_TRANSFER_FORBIDDEN:"projects.transferForbidden",PROJECT_TRANSFER_TARGET_INVALID:"projects.transferTargetInvalid",PROJECT_TRANSFER_SELF:"projects.transferSelf",MAIN_DOCUMENT_INVALID:"apiErrors.mainDocumentInvalid",COMPILE_SNAPSHOT_BUSY:"apiErrors.compileSnapshotBusy",COMPILE_CLEAN_BUSY:"editor.cleanBusy",CITATION_INVALID:"citationErrors.invalid",CITATION_TOO_LARGE:"citationErrors.tooLarge",CITATION_NOT_FOUND:"citationErrors.notFound",CITATION_KEY_EXISTS:"citationErrors.keyExists",CITATION_TAG_NOT_FOUND:"citationErrors.tagNotFound",CITATION_CONFLICT:"citationErrors.conflict"}[r]??`errors.codes.${r}`;if(Ke.exists(o))return Ke.t(o,{status:e,...typeof t=="object"&&t!==null?t:{}})}return s||Ke.t(n,{status:e})}function vl(t){return typeof t!="object"||t===null||!("code"in t)||typeof t.code!="string"?null:t.code}const qp=/^\/projects?\/([^/]+)\/?$/;function ur(t){return`/project/${encodeURIComponent(t)}`}function Es(t){const e=qp.exec(t);if(!e)return null;try{const n=decodeURIComponent(e[1]);return n&&!n.includes("/")?n:null}catch{return null}}function Kp(t){return"/?"+new URLSearchParams({return:ur(t)}).toString()}function Wp(t){const e=new URLSearchParams(t).get("return");return e?Es(e):null}function Gp(t){if(!t||typeof t!="object")return!1;const e=t;return e.texliteRoute==="project"&&typeof e.projectId=="string"&&typeof e.fromDashboard=="boolean"}const Yp="modulepreload",Xp=function(t){return"/"+t},du={},Wn=function(e,n,s){let r=Promise.resolve();if(n&&n.length>0){let u=function(l){return Promise.all(l.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");r=u(n.map(l=>{if(l=Xp(l),l in du)return;du[l]=!0;const d=l.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${h}`))return;const D=document.createElement("link");if(D.rel=d?"stylesheet":Yp,d||(D.as="script"),D.crossOrigin="",D.href=l,c&&D.setAttribute("nonce",c),document.head.appendChild(D),d)return new Promise((p,F)=>{D.addEventListener("load",p),D.addEventListener("error",()=>F(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return r.then(a=>{for(const c of a||[])c.status==="rejected"&&o(c.reason);return e().catch(o)})},Li=()=>Wn(()=>import("./PdfPreview-CuvWphzY.js"),__vite__mapDeps([0,1,2,3])),Kr=new Map,hu=2e3;function Wr(t,e={}){const n=Date.now(),s=Kr.get(t);if(!e.force&&s&&n-s.createdAt<hu)return s.preload;const r=re(`/api/projects/${t}`,{suppressSessionExpired:!0}),o=re(`/api/projects/${t}/compile/latest`,{suppressSessionExpired:!0}),a=Li(),c={projectId:t,project:r,latestCompile:o};return Kr.set(t,{preload:c,createdAt:n}),r.catch(()=>{}),Promise.all([a,o]).then(([u,l])=>{l.pdfUrl&&u.preloadPdf(l.pdfUrl,l.pdfLoadingMode??"full")}).catch(()=>{}),window.setTimeout(()=>{Kr.get(t)?.preload===c&&Kr.delete(t)},hu),c}function ce(t){return t instanceof Error?t.message:Ke.t("errors.generic")}function wa({compact:t=!1}){const{i18n:e,t:n}=Qe(),s=e.resolvedLanguage?.startsWith("zh")?"zh":"en";return i.jsxs("label",{className:`language-switcher${t?" compact":""}`,title:n("common.language"),children:[i.jsx("span",{children:"文/A"}),i.jsxs("select",{value:s,"aria-label":n("common.language"),onChange:r=>{e.changeLanguage(r.target.value)},children:[i.jsx("option",{value:"en",children:n("common.languageEnglish")}),i.jsx("option",{value:"zh",children:n("common.languageChinese")})]})]})}const Jp="0.7.6";function Ni({siteName:t,compact:e=!1,auth:n=!1}){return i.jsx("span",{className:`site-logo${e?" compact":""}${n?" auth-logo":""}`,children:i.jsx("img",{src:"/logo.svg",alt:t})})}function xa(){const{t}=Qe();return i.jsxs("footer",{className:"site-footer",children:[i.jsxs("span",{children:[t("footer.copyright",{year:new Date().getFullYear()})," ",i.jsxs("a",{href:"https://github.com/SWUFE-DB-Group/TexLite",target:"_blank",rel:"noreferrer",children:["TexLite v",Jp]})]}),i.jsx("span",{children:t("footer.credit")})]})}function Zp({site:t,user:e,onChanged:n}){const{t:s}=Qe(),[r,o]=f.useState(""),[a,c]=f.useState(""),[u,l]=f.useState(""),[d,h]=f.useState(""),D=async p=>{if(p.preventDefault(),a!==u)return h(s("auth.mismatch"));if(a.length<t.minPasswordLength)return h(s("auth.passwordMinimum",{count:t.minPasswordLength}));try{await re("/api/me/password",{method:"PUT",body:JSON.stringify({currentPassword:r,newPassword:a})}),n({...e,mustChangePassword:!1})}catch(F){h(ce(F))}};return i.jsxs("main",{className:"login-page",children:[i.jsx(wa,{}),i.jsxs("form",{className:"login-card",onSubmit:D,children:[i.jsx(Ni,{siteName:t.siteName,auth:!0}),i.jsx("h1",{className:"sr-only",children:t.siteName}),i.jsx("p",{className:"muted",children:s("auth.firstLogin")}),i.jsxs("label",{children:[s("auth.currentPassword"),i.jsx("input",{type:"password",value:r,onChange:p=>o(p.target.value)})]}),i.jsxs("label",{children:[s("auth.newPassword"),i.jsx("input",{type:"password",minLength:t.minPasswordLength,autoComplete:"new-password",value:a,onChange:p=>c(p.target.value)}),i.jsx("small",{className:"field-hint",children:s("auth.passwordMinimum",{count:t.minPasswordLength})})]}),i.jsxs("label",{children:[s("auth.confirmPassword"),i.jsx("input",{type:"password",minLength:t.minPasswordLength,autoComplete:"new-password",value:u,onChange:p=>l(p.target.value)})]}),d&&i.jsx("p",{className:"error",children:d}),i.jsx("button",{className:"primary",children:s("auth.updatePassword")})]}),i.jsx(xa,{})]})}function Qp({site:t,onLogin:e}){const{t:n}=Qe(),[s,r]=f.useState(""),[o,a]=f.useState(""),[c,u]=f.useState(""),l=async d=>{d.preventDefault(),u("");try{const h=await re("/api/auth/login",{method:"POST",body:JSON.stringify({username:s,password:o}),suppressSessionExpired:!0});e(h.user)}catch(h){u(ce(h))}};return i.jsxs("main",{className:"login-page",children:[i.jsx(wa,{}),i.jsxs("form",{className:"login-card",onSubmit:l,children:[i.jsx(Ni,{siteName:t.siteName,auth:!0}),i.jsx("h1",{className:"sr-only",children:t.siteName}),i.jsx("p",{className:"muted",children:n("auth.tagline")}),i.jsxs("label",{children:[n("auth.username"),i.jsx("input",{autoFocus:!0,value:s,onChange:d=>r(d.target.value)})]}),i.jsxs("label",{children:[n("auth.password"),i.jsx("input",{type:"password",value:o,onChange:d=>a(d.target.value)})]}),c&&i.jsx("p",{className:"error",children:c}),i.jsx("button",{className:"primary",type:"submit",children:n("auth.login")}),t.adminEmail&&i.jsx("small",{className:"support",children:n("auth.contact",{email:t.adminEmail})})]}),i.jsx(xa,{})]})}var eD=Object.defineProperty,Ys=(t,e)=>eD(t,"name",{value:e,configurable:!0}),Al=!!(typeof window<"u"&&window.document&&window.document.createElement);function zn(t,e,{checkForDefaultPrevented:n=!0}={}){return Ys(function(r){if(t?.(r),n===!1||!r||!r.defaultPrevented)return e?.(r)},"handleEvent")}Ys(zn,"composeEventHandlers");function tD(t){if(!Al)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}Ys(tD,"getOwnerWindow");function Mo(t){if(!Al)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}Ys(Mo,"getOwnerDocument");function kl(t,e=!1){const{activeElement:n}=Mo(t);if(!n?.nodeName)return null;if(Sl(n)&&n.contentDocument)return kl(n.contentDocument.body,e);if(e){const s=n.getAttribute("aria-activedescendant");if(s){const r=Mo(n).getElementById(s);if(r)return r}}return n}Ys(kl,"getActiveElement");function Sl(t){return t.tagName==="IFRAME"}Ys(Sl,"isFrame");var nD=Object.defineProperty,va=(t,e)=>nD(t,"name",{value:e,configurable:!0});function $o(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}va($o,"setRef");function jl(...t){return e=>{let n=!1;const s=t.map(r=>{const o=$o(r,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<s.length;r++){const o=s[r];typeof o=="function"?o():$o(t[r],null)}}}}va(jl,"composeRefs");function Xs(...t){return f.useCallback(jl(...t),t)}va(Xs,"useComposedRefs");var sD=Object.defineProperty,en=(t,e)=>sD(t,"name",{value:e,configurable:!0});function rD(t,e){const n=f.createContext(e);n.displayName=t+"Context";const s=en(o=>{const{children:a,...c}=o,u=f.useMemo(()=>c,Object.values(c));return i.jsx(n.Provider,{value:u,children:a})},"Provider");s.displayName=t+"Provider";function r(o,a={}){const{optional:c=!1}=a,u=f.useContext(n);if(u)return u;if(e!==void 0)return e;if(!c)throw new Error(`\`${o}\` must be used within \`${t}\``)}return en(r,"useContext"),[s,r]}en(rD,"createContext");function Bl(t,e=[]){let n=[];function s(o,a){const c=f.createContext(a);c.displayName=o+"Context";const u=n.length;n=[...n,a];const l=en(h=>{const{scope:D,children:p,...F}=h,y=D?.[t]?.[u]||c,b=f.useMemo(()=>F,Object.values(F));return i.jsx(y.Provider,{value:b,children:p})},"Provider");l.displayName=o+"Provider";function d(h,D,p={}){const{optional:F=!1}=p,y=D?.[t]?.[u]||c,b=f.useContext(y);if(b)return b;if(a!==void 0)return a;if(!F)throw new Error(`\`${h}\` must be used within \`${o}\``)}return en(d,"useContext"),[l,d]}en(s,"createContext");const r=en(()=>{const o=n.map(a=>f.createContext(a));return en(function(c){const u=c?.[t]||o;return f.useMemo(()=>({[`__scope${t}`]:{...c,[t]:u}}),[c,u])},"useScope")},"createScope");return r.scopeName=t,[s,Tl(r,...e)]}en(Bl,"createContextScope");function Tl(...t){const e=t[0];if(t.length===1)return e;const n=en(()=>{const s=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return en(function(o){const a=s.reduce((c,{useScope:u,scopeName:l})=>{const h=u(o)[`__scope${l}`];return{...c,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}en(Tl,"composeContextScopes");var Vn=globalThis?.document?f.useLayoutEffect:()=>{},iD=Object.defineProperty,oD=(t,e)=>iD(t,"name",{value:e,configurable:!0}),aD=Lr[" useId ".trim().toString()]||(()=>{}),cD=0;function ni(t){const[e,n]=f.useState(aD());return Vn(()=>{t||n(s=>s??String(cD++))},[t]),t||(e?`radix-${e}`:"")}oD(ni,"useId");var uD=Object.defineProperty,lD=(t,e)=>uD(t,"name",{value:e,configurable:!0}),fu=Lr[" useEffectEvent ".trim().toString()],mu=Lr[" useInsertionEffect ".trim().toString()];function Ll(t){if(typeof fu=="function")return fu(t);const e=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof mu=="function"?mu(()=>{e.current=t}):Vn(()=>{e.current=t}),f.useMemo(()=>((...n)=>e.current?.(...n)),[])}lD(Ll,"useEffectEvent");var dD=Object.defineProperty,Nr=(t,e)=>dD(t,"name",{value:e,configurable:!0}),hD=Lr[" useInsertionEffect ".trim().toString()]||Vn;function Nl({prop:t,defaultProp:e,onChange:n=Nr(()=>{},"onChange"),caller:s}){const[r,o,a]=Rl({defaultProp:e,onChange:n}),c=t!==void 0,u=c?t:r,l=f.useCallback(d=>{if(c){const h=Ol(d)?d(t):d;h!==t&&a.current?.(h)}else o(d)},[c,t,o,a]);return[u,l]}Nr(Nl,"useControllableState");function Rl({defaultProp:t,onChange:e}){const[n,s]=f.useState(t),r=f.useRef(n),o=f.useRef(e);return hD(()=>{o.current=e},[e]),f.useEffect(()=>{r.current!==n&&(o.current?.(n),r.current=n)},[n,r]),[n,s,o]}Nr(Rl,"useUncontrolledState");function Ol(t){return typeof t=="function"}Nr(Ol,"isFunction");var pu=Symbol("RADIX:SYNC_STATE");function fD(t,e,n,s){const{prop:r,defaultProp:o,onChange:a,caller:c}=e,u=r!==void 0,l=Ll(a),d=[{...n,state:o}];s&&d.push(s);const[h,D]=f.useReducer((b,E)=>{if(E.type===pu)return{...b,state:E.state};const x=t(b,E);return u&&!Object.is(x.state,b.state)&&l(x.state),x},...d),p=h.state,F=f.useRef(p);f.useEffect(()=>{F.current!==p&&(F.current=p,u||l(p))},[p,F,u]);const y=f.useMemo(()=>r!==void 0?{...h,state:r}:h,[h,r]);return f.useEffect(()=>{u&&!Object.is(r,h.state)&&D({type:pu,state:r})},[r,h.state,u]),[y,D]}Nr(fD,"useControllableStateReducer");var mD=Object.defineProperty,mn=(t,e)=>mD(t,"name",{value:e,configurable:!0});function Aa(t){const e=f.forwardRef((n,s)=>{let{children:r,...o}=n,a=null,c=!1;const u=[];Uo(r)&&typeof Gr=="function"&&(r=Gr(r._payload)),f.Children.forEach(r,D=>{if(Ml(D)){c=!0;const p=D;let F="child"in p.props?p.props.child:p.props.children;Uo(F)&&typeof Gr=="function"&&(F=Gr(F._payload)),a=DD(p,F),u.push(a?.props?.children)}else u.push(D)}),a?a=f.cloneElement(a,void 0,u):!c&&f.Children.count(r)===1&&f.isValidElement(r)&&(a=r);const l=a?Il(a):void 0,d=Xs(s,l);if(!a){if(r||r===0)throw new Error(c?bD(t):FD(t));return r}const h=_l(o,a.props??{});return a.type!==f.Fragment&&(h.ref=s?d:l),f.cloneElement(a,h)});return e.displayName=`${t}.Slot`,e}mn(Aa,"createSlot");var Pl=Symbol.for("radix.slottable");function pD(t){const e=mn(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Pl,e}mn(pD,"createSlottable");var DD=mn((t,e)=>{if("child"in t.props){const n=t.props.child;return f.isValidElement(n)?f.cloneElement(n,void 0,t.props.children(n.props.children)):null}return f.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function _l(t,e){const n={...e};for(const s in e){const r=t[s],o=e[s];/^on[A-Z]/.test(s)?r&&o?n[s]=(...c)=>{const u=o(...c);return r(...c),u}:r&&(n[s]=r):s==="style"?n[s]={...r,...o}:s==="className"&&(n[s]=[r,o].filter(Boolean).join(" "))}return{...t,...n}}mn(_l,"mergeProps");function Il(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}mn(Il,"getElementRef");function Ml(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Pl}mn(Ml,"isSlottable");var gD=Symbol.for("react.lazy");function Uo(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===gD&&"_payload"in t&&$l(t._payload)}mn(Uo,"isLazyComponent");function $l(t){return typeof t=="object"&&t!==null&&"then"in t}mn($l,"isPromiseLike");var FD=mn(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),bD=mn(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Gr=Lr[" use ".trim().toString()],yD=Object.defineProperty,CD=(t,e)=>yD(t,"name",{value:e,configurable:!0}),ED=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cs=ED.reduce((t,e)=>{const n=Aa(`Primitive.${e}`),s=f.forwardRef((r,o)=>{const{asChild:a,...c}=r,u=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:o})});return s.displayName=`Primitive.${e}`,{...t,[e]:s}},{});function Ul(t,e){t&&Dl.flushSync(()=>t.dispatchEvent(e))}CD(Ul,"dispatchDiscreteCustomEvent");var wD=Object.defineProperty,xD=(t,e)=>wD(t,"name",{value:e,configurable:!0});function Is(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>((...n)=>e.current?.(...n)),[])}xD(Is,"useCallbackRef");var vD=Object.defineProperty,Tt=(t,e)=>vD(t,"name",{value:e,configurable:!0}),zo="dismissableLayer.update",AD="dismissableLayer.pointerDownOutside",kD="dismissableLayer.focusOutside",Du,zl=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),SD=f.forwardRef(Tt(function(e,n){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,onDismiss:l,...d}=e,h=f.useContext(zl),[D,p]=f.useState(null),F=D?.ownerDocument??globalThis?.document,[,y]=f.useState({}),b=Xs(n,p),E=Array.from(h.layers),[x]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),N=x?E.indexOf(x):-1,O=D?E.indexOf(D):-1,I=h.layersWithOutsidePointerEventsDisabled.size>0,q=O>=N,z=f.useRef(!1),X=Hl(M=>{a?.(M),u?.(M),M.defaultPrevented||l?.()},{ownerDocument:F,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:z,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:f.useCallback(M=>{if(!(M instanceof Node))return!1;const K=[...h.branches].some(L=>L.contains(M));return q&&!K},[h.branches,q])}),G=ql(M=>{if(r&&z.current)return;const K=M.target;[...h.branches].some(S=>S.contains(K))||(c?.(M),u?.(M),M.defaultPrevented||l?.())},F),A=D?O===E.length-1:!1,ie=Is(M=>{M.key==="Escape"&&(o?.(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))});return f.useEffect(()=>{if(A)return F.addEventListener("keydown",ie,{capture:!0}),()=>F.removeEventListener("keydown",ie,{capture:!0})},[F,A,ie]),f.useEffect(()=>{if(D)return s&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Du=F.body.style.pointerEvents,F.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(D)),h.layers.add(D),Vo(),()=>{s&&(h.layersWithOutsidePointerEventsDisabled.delete(D),h.layersWithOutsidePointerEventsDisabled.size===0&&(F.body.style.pointerEvents=Du))}},[D,F,s,h]),f.useEffect(()=>()=>{D&&(h.layers.delete(D),h.layersWithOutsidePointerEventsDisabled.delete(D),Vo())},[D,h]),f.useEffect(()=>{const M=Tt(()=>y({}),"handleUpdate");return document.addEventListener(zo,M),()=>document.removeEventListener(zo,M)},[]),i.jsx(cs.div,{...d,ref:b,style:{pointerEvents:I?q?"auto":"none":void 0,...e.style},onFocusCapture:zn(e.onFocusCapture,G.onFocusCapture),onBlurCapture:zn(e.onBlurCapture,G.onBlurCapture),onPointerDownCapture:zn(e.onPointerDownCapture,X.onPointerDownCapture)})},"DismissableLayer"));function Vl(){const t=f.useContext(zl),[e,n]=f.useState(null);return f.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Tt(Vl,"useDismissableLayerSurface");var jD=Tt(()=>!0,"IS_TRUE");function Hl(t,e){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:o,shouldHandlePointerDownOutside:a=jD}=e,c=Is(t),u=f.useRef(!1),l=f.useRef(!1),d=f.useRef(new Map),h=f.useRef(()=>{});return f.useEffect(()=>{function D(){l.current=!1,r.current=!1,d.current.clear()}Tt(D,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}Tt(p,"isOutsideInteractionIntercepted");function F(N){if(!l.current)return;const O=N.target;O instanceof Node&&[...o].some(q=>q.contains(O))||d.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{l.current&&h.current()},0)}Tt(F,"handleInteractionCapture");function y(N){l.current&&d.current.set(N.type,!1)}Tt(y,"handleInteractionBubble");const b=Tt(N=>{if(N.target&&!u.current){let O=function(){n.removeEventListener("click",h.current);const q=p();D(),q||ka(AD,c,I,{discrete:!0})};if(Tt(O,"handleAndDispatchPointerDownOutsideEvent"),!a(N.target)){n.removeEventListener("click",h.current),D(),u.current=!1;return}const I={originalEvent:N};l.current=!0,r.current=s&&N.button===0,d.current.clear(),!s||N.button!==0?O():(n.removeEventListener("click",h.current),h.current=O,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),D();u.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const N of E)n.addEventListener(N,F,!0),n.addEventListener(N,y);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",b),n.removeEventListener("click",h.current);for(const N of E)n.removeEventListener(N,F,!0),n.removeEventListener(N,y)}},[n,c,s,r,o,a]),{onPointerDownCapture:Tt(()=>u.current=!0,"onPointerDownCapture")}}Tt(Hl,"usePointerDownOutside");function ql(t,e=globalThis?.document){const n=Is(t),s=f.useRef(!1);return f.useEffect(()=>{const r=Tt(o=>{o.target&&!s.current&&ka(kD,n,{originalEvent:o},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:Tt(()=>s.current=!0,"onFocusCapture"),onBlurCapture:Tt(()=>s.current=!1,"onBlurCapture")}}Tt(ql,"useFocusOutside");function Vo(){const t=new CustomEvent(zo);document.dispatchEvent(t)}Tt(Vo,"dispatchUpdate");function ka(t,e,n,{discrete:s}){const r=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),s?Ul(r,o):r.dispatchEvent(o)}Tt(ka,"handleAndDispatchCustomEvent");var BD=Object.defineProperty,$t=(t,e)=>BD(t,"name",{value:e,configurable:!0}),fo="focusScope.autoFocusOnMount",mo="focusScope.autoFocusOnUnmount",gu={bubbles:!1,cancelable:!0},TD=f.forwardRef($t(function(e,n){const{loop:s=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[u,l]=f.useState(null),d=Is(o),h=Is(a),D=f.useRef(null),p=Xs(n,l),F=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let b=function(O){if(F.paused||!u)return;const I=O.target;u.contains(I)?D.current=I:Bn(D.current,{select:!0})},E=function(O){if(F.paused||!u)return;const I=O.relatedTarget;I!==null&&(u.contains(I)||Bn(D.current,{select:!0}))},x=function(O){if(document.activeElement===document.body)for(const q of O)q.removedNodes.length>0&&Bn(u)};$t(b,"handleFocusIn"),$t(E,"handleFocusOut"),$t(x,"handleMutations"),document.addEventListener("focusin",b),document.addEventListener("focusout",E);const N=new MutationObserver(x);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",E),N.disconnect()}}},[r,u,F.paused]),f.useEffect(()=>{if(u){Fu.add(F);const b=document.activeElement;if(!u.contains(b)){const x=new CustomEvent(fo,gu);u.addEventListener(fo,d),u.dispatchEvent(x),x.defaultPrevented||(Kl(Jl(Sa(u)),{select:!0}),document.activeElement===b&&Bn(u))}return()=>{u.removeEventListener(fo,d),setTimeout(()=>{const x=new CustomEvent(mo,gu);u.addEventListener(mo,h),u.dispatchEvent(x),x.defaultPrevented||Bn(b??document.body,{select:!0}),u.removeEventListener(mo,h),Fu.remove(F)},0)}}},[u,d,h,F]);const y=f.useCallback(b=>{if(!s&&!r||F.paused)return;const E=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(E&&x){const N=b.currentTarget,[O,I]=Wl(N);O&&I?!b.shiftKey&&x===I?(b.preventDefault(),s&&Bn(O,{select:!0})):b.shiftKey&&x===O&&(b.preventDefault(),s&&Bn(I,{select:!0})):x===N&&b.preventDefault()}},[s,r,F.paused]);return i.jsx(cs.div,{tabIndex:-1,...c,ref:p,onKeyDown:y})},"FocusScope"));function Kl(t,{select:e=!1}={}){const n=document.activeElement;for(const s of t)if(Bn(s,{select:e}),document.activeElement!==n)return}$t(Kl,"focusFirst");function Wl(t){const e=Sa(t),n=Ho(e,t),s=Ho(e.reverse(),t);return[n,s]}$t(Wl,"getTabbableEdges");function Sa(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:$t(s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}$t(Sa,"getTabbableCandidates");function Ho(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const s of t)if(!(n?!s.checkVisibility({checkVisibilityCSS:!0}):Gl(s,{upTo:e})))return s}$t(Ho,"findVisible");function Gl(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}$t(Gl,"isHidden");function Yl(t){return t instanceof HTMLInputElement&&"select"in t}$t(Yl,"isSelectableInput");function Bn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Yl(t)&&e&&t.select()}}$t(Bn,"focus");var Fu=Xl();function Xl(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=qo(t,e),t.unshift(e)},remove(e){t=qo(t,e),t[0]?.resume()}}}$t(Xl,"createFocusScopesStack");function qo(t,e){const n=[...t],s=n.indexOf(e);return s!==-1&&n.splice(s,1),n}$t(qo,"arrayRemove");function Jl(t){return t.filter(e=>e.tagName!=="A")}$t(Jl,"removeLinks");var LD=Object.defineProperty,ND=(t,e)=>LD(t,"name",{value:e,configurable:!0}),RD=f.forwardRef(ND(function(e,n){const{container:s,...r}=e,[o,a]=f.useState(!1);Vn(()=>a(!0),[]);const c=s||o&&globalThis?.document?.body;return c?Dl.createPortal(i.jsx(cs.div,{...r,ref:n}),c):null},"Portal")),OD=Object.defineProperty,Nn=(t,e)=>OD(t,"name",{value:e,configurable:!0});function Zl(t,e){return f.useReducer((n,s)=>e[n][s]??n,t)}Nn(Zl,"useStateMachine");var ja=Nn(t=>{const{present:e,children:n}=t,s=Ql(e),r=typeof n=="function"?n({present:s.isPresent}):f.Children.only(n),o=ed(s.ref,td(r));return typeof n=="function"||s.isPresent?f.cloneElement(r,{ref:o}):null},"Presence");function Ql(t){const[e,n]=f.useState(),s=f.useRef(null),r=f.useRef(t),o=f.useRef("none"),a=f.useRef(void 0),c=t?"mounted":"unmounted",[u,l]=Zl(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{u==="mounted"?(o.current=a.current??ws(s.current),a.current=void 0):o.current="none"},[u]),Vn(()=>{const d=s.current,h=r.current;if(h!==t){const p=o.current,F=ws(d);t?(a.current=F,l("MOUNT")):F==="none"||d?.display==="none"?l("UNMOUNT"):l(h&&p!==F?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,l]),Vn(()=>{if(e){let d;const h=e.ownerDocument.defaultView??window,D=Nn(F=>{const b=ws(s.current).includes(CSS.escape(F.animationName));if(F.target===e&&b&&(l("ANIMATION_END"),!r.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",d=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},"handleAnimationEnd"),p=Nn(F=>{F.target===e&&(o.current=ws(s.current))},"handleAnimationStart");return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",D),e.addEventListener("animationend",D),()=>{h.clearTimeout(d),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",D),e.removeEventListener("animationend",D)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:f.useCallback(d=>{if(d){const h=getComputedStyle(d);s.current=h,a.current=ws(h)}else s.current=null;n(d)},[])}}Nn(Ql,"usePresence");function Ko(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Nn(Ko,"setRef");function ed(...t){const e=f.useRef(t);return e.current=t,f.useCallback(n=>{const s=e.current;let r=!1;const o=s.map(a=>{const c=Ko(a,n);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let a=0;a<o.length;a++){const c=o[a];typeof c=="function"?c():Ko(s[a],null)}}},[])}Nn(ed,"useStableComposedRefs");function ws(t){return t?.animationName||"none"}Nn(ws,"getAnimationName");function td(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Nn(td,"getElementRef");var PD=Object.defineProperty,Ba=(t,e)=>PD(t,"name",{value:e,configurable:!0}),Yr=0,Fs=null;function _D(t){return Ta(),t.children}Ba(_D,"FocusGuards");function Ta(){f.useEffect(()=>{Fs||(Fs={start:Wo(),end:Wo()});const{start:t,end:e}=Fs;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Yr++,()=>{Yr===1&&(Fs?.start.remove(),Fs?.end.remove(),Fs=null),Yr=Math.max(0,Yr-1)}},[])}Ba(Ta,"useFocusGuards");function Wo(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Ba(Wo,"createFocusGuard");var ID=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},bs=new WeakMap,Xr=new WeakMap,Jr={},po=0,nd=function(t){return t&&(t.host||nd(t.parentNode))},MD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var s=nd(n);return s&&t.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},$D=function(t,e,n,s){var r=MD(e,Array.isArray(t)?t:[t]);Jr[n]||(Jr[n]=new WeakMap);var o=Jr[n],a=[],c=new Set,u=new Set(r),l=function(h){!h||c.has(h)||(c.add(h),l(h.parentNode))};r.forEach(l);var d=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(D){if(c.has(D))d(D);else try{var p=D.getAttribute(s),F=p!==null&&p!=="false",y=(bs.get(D)||0)+1,b=(o.get(D)||0)+1;bs.set(D,y),o.set(D,b),a.push(D),y===1&&F&&Xr.set(D,!0),b===1&&D.setAttribute(n,"true"),F||D.setAttribute(s,"true")}catch(E){console.error("aria-hidden: cannot operate on ",D,E)}})};return d(e),c.clear(),po++,function(){a.forEach(function(h){var D=bs.get(h)-1,p=o.get(h)-1;bs.set(h,D),o.set(h,p),D||(Xr.has(h)||h.removeAttribute(s),Xr.delete(h)),p||h.removeAttribute(n)}),po--,po||(bs=new WeakMap,bs=new WeakMap,Xr=new WeakMap,Jr={})}},UD=function(t,e,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),r=ID(t);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),$D(s,r,n,"aria-hidden")):function(){return null}},zD=Object.defineProperty,rn=(t,e)=>zD(t,"name",{value:e,configurable:!0}),La="Dialog",[sd,k2]=Bl(La),[VD,Cn]=sd(La),HD=rn(t=>{const{__scopeDialog:e,children:n,open:s,defaultOpen:r,onOpenChange:o,modal:a=!0}=t,c=f.useRef(null),u=f.useRef(null),[l,d]=Nl({prop:s,defaultProp:r??!1,onChange:o,caller:La}),[h,D]=f.useState(0),[p,F]=f.useState(0);return i.jsx(VD,{scope:e,triggerRef:c,contentRef:u,contentId:ni(),titleId:ni(),descriptionId:ni(),titlePresent:h>0,descriptionPresent:p>0,setTitleCount:D,setDescriptionCount:F,open:l,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(y=>!y),[d]),modal:a,children:n})},"Dialog"),rd="DialogPortal",[qD,id]=sd(rd,{forceMount:void 0}),KD=rn(t=>{const{__scopeDialog:e,forceMount:n,children:s,container:r}=t,o=Cn(rd,e);return i.jsx(qD,{scope:e,forceMount:n,children:f.Children.map(s,a=>i.jsx(ja,{present:n||o.open,children:i.jsx(RD,{asChild:!0,container:r,children:a})}))})},"DialogPortal"),Go="DialogOverlay",WD=f.forwardRef(rn(function(e,n){const s=id(Go,e.__scopeDialog),{forceMount:r=s.forceMount,...o}=e,a=Cn(Go,e.__scopeDialog);return a.modal?i.jsx(ja,{present:r||a.open,children:i.jsx(YD,{...o,ref:n})}):null},"DialogOverlay")),GD=Aa("DialogOverlay.RemoveScroll"),YD=f.forwardRef(rn(function(e,n){const{__scopeDialog:s,...r}=e,o=Cn(Go,s),a=Vl(),c=Xs(n,a);return i.jsx(gm,{as:GD,allowPinchZoom:!0,shards:[o.contentRef],children:i.jsx(cs.div,{"data-state":Na(o.open),...r,ref:c,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),br="DialogContent",XD=f.forwardRef(rn(function(e,n){const s=id(br,e.__scopeDialog),{forceMount:r=s.forceMount,...o}=e,a=Cn(br,e.__scopeDialog);return i.jsx(ja,{present:r||a.open,children:a.modal?i.jsx(JD,{...o,ref:n}):i.jsx(ZD,{...o,ref:n})})},"DialogContent")),JD=f.forwardRef(rn(function(e,n){const s=Cn(br,e.__scopeDialog),r=f.useRef(null),o=Xs(n,s.contentRef,r);return f.useEffect(()=>{const a=r.current;if(a)return UD(a)},[]),i.jsx(od,{...e,ref:o,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:zn(e.onCloseAutoFocus,a=>{a.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:zn(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&a.preventDefault()}),onFocusOutside:zn(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),ZD=f.forwardRef(rn(function(e,n){const s=Cn(br,e.__scopeDialog),r=f.useRef(!1),o=f.useRef(!1);return i.jsx(od,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||s.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;s.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})},"DialogContentNonModal")),od=f.forwardRef(rn(function(e,n){const{__scopeDialog:s,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...c}=e,u=Cn(br,s);return Ta(),i.jsx(i.Fragment,{children:i.jsx(TD,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:i.jsx(SD,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":Na(u.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),QD="DialogTitle",e0=f.forwardRef(rn(function(e,n){const{__scopeDialog:s,...r}=e,o=Cn(QD,s),{setTitleCount:a}=o;return Vn(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),i.jsx(cs.h2,{id:o.titleId,...r,ref:n})},"DialogTitle")),t0="DialogDescription",n0=f.forwardRef(rn(function(e,n){const{__scopeDialog:s,...r}=e,o=Cn(t0,s),{setDescriptionCount:a}=o;return Vn(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),i.jsx(cs.p,{id:o.descriptionId,...r,ref:n})},"DialogDescription")),s0="DialogClose",r0=f.forwardRef(rn(function(e,n){const{__scopeDialog:s,...r}=e,o=Cn(s0,s);return i.jsx(cs.button,{type:"button",...r,ref:n,onClick:zn(e.onClick,()=>o.onOpenChange(!1))})},"DialogClose"));function Na(t){return t?"open":"closed"}rn(Na,"getState");function dt({open:t,title:e,description:n,onOpenChange:s,children:r,footer:o,wide:a,extraWide:c,className:u}){const{t:l}=Qe();return i.jsx(HD,{open:t,onOpenChange:s,children:i.jsxs(KD,{children:[i.jsx(WD,{className:"dialog-overlay"}),i.jsxs(XD,{className:`dialog-content${a?" dialog-wide":""}${c?" dialog-extra-wide":""}${u?` ${u}`:""}`,children:[i.jsxs("div",{className:"dialog-header",children:[i.jsxs("div",{children:[i.jsx(e0,{children:e}),n&&i.jsx(n0,{children:n})]}),i.jsx(r0,{className:"dialog-close","aria-label":l("common.close"),children:"×"})]}),i.jsx("div",{className:"dialog-body",children:r}),o&&i.jsx("div",{className:"dialog-footer",children:o})]})]})})}function ns({open:t,title:e,description:n,confirmLabel:s,danger:r,onCancel:o,onConfirm:a,error:c,busy:u=!1}){const{t:l}=Qe();return i.jsx(dt,{open:t,title:e,description:n,onOpenChange:d=>{!d&&!u&&o()},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{disabled:u,onClick:o,children:l("common.cancel")}),i.jsx("button",{className:r?"danger":"primary",disabled:u,"aria-busy":u,onClick:a,children:s??l("common.remove")})]}),children:i.jsxs(i.Fragment,{children:[c&&i.jsx("p",{className:"error dialog-error",children:c}),i.jsx("div",{})]})})}const i0=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ad=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim();var o0={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 a0=f.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:r="",children:o,iconNode:a,...c},u)=>f.createElement("svg",{ref:u,...o0,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:ad("lucide",r),...c},[...a.map(([l,d])=>f.createElement(l,d)),...Array.isArray(o)?o:[o]]));const se=(t,e)=>{const n=f.forwardRef(({className:s,...r},o)=>f.createElement(a0,{ref:o,iconNode:e,className:ad(`lucide-${i0(t)}`,s),...r}));return n.displayName=`${t}`,n};const c0=se("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const cd=se("AlignLeft",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);const u0=se("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);const bu=se("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const l0=se("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);const Yo=se("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Do=se("ArrowRightLeft",[["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"}]]);const As=se("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);const Ra=se("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);const d0=se("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);const ss=se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const ud=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pr=se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const Ri=se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const h0=se("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);const f0=se("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);const m0=se("CircleAlert",[["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"}]]);const ld=se("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Oa=se("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const yu=se("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);const p0=se("Copy",[["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"}]]);const D0=se("Dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);const yr=se("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const Xo=se("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);const Jo=se("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);const g0=se("FilePlus2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]);const F0=se("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);const Ms=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const b0=se("FolderCheck",[["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"}],["path",{d:"m9 13 2 2 4-4",key:"6343dt"}]]);const Zo=se("FolderOpen",[["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"}]]);const dd=se("FolderPlus",[["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"}]]);const y0=se("FolderX",[["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"}],["path",{d:"m9.5 10.5 5 5",key:"ra9qjz"}],["path",{d:"m14.5 10.5-5 5",key:"l2rkpq"}]]);const C0=se("Folder",[["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"}]]);const E0=se("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);const hd=se("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const w0=se("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const x0=se("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);const Cu=se("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);const v0=se("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);const A0=se("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);const Et=se("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const fd=se("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const Eu=se("Move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);const md=se("PackageOpen",[["path",{d:"M12 22v-9",key:"x3hkom"}],["path",{d:"M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z",key:"2ntwy6"}],["path",{d:"M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13",key:"1pmm1c"}],["path",{d:"M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z",key:"12ttoo"}]]);const pd=se("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);const k0=se("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);const S0=se("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const j0=se("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const B0=se("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);const T0=se("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);const Qo=se("Pencil",[["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"}]]);const L0=se("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const si=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Dd=se("RefreshCw",[["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"}]]);const N0=se("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);const R0=se("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const di=se("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const ea=se("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);const gd=se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const O0=se("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const ta=se("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const P0=se("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const _0=se("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);const I0=se("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const M0=se("SpellCheck2",[["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M4 21c1.1 0 1.1-1 2.3-1s1.1 1 2.3 1c1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1",key:"8mdmtu"}]]);const na=se("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);const sn=se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const ln=se("TriangleAlert",[["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"}]]);const wu=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);const hi=se("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const $0=se("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);const sa=se("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);const U0=se("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);const Cr=se("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const z0=se("WrapText",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["polyline",{points:"16 16 14 18 16 20",key:"1jznyi"}],["line",{x1:"3",x2:"10",y1:"18",y2:"18",key:"1h33wv"}]]);const qt=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var go,xu;function V0(){if(xu)return go;xu=1;var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,r=(m,w)=>t(m,"name",{value:w,configurable:!0}),o=(m,w)=>{for(var g in w)t(m,g,{get:w[g],enumerable:!0})},a=(m,w,g,_)=>{if(w&&typeof w=="object"||typeof w=="function")for(let H of n(w))!s.call(m,H)&&H!==g&&t(m,H,{get:()=>w[H],enumerable:!(_=e(w,H))||_.enumerable});return m},c=m=>a(t({},"__esModule",{value:!0}),m),u={};o(u,{getEntries:()=>Vt,tidy:()=>Ae}),go=c(u);var l=class{constructor(m=[]){this.children=m,this.type="root"}static{r(this,"RootNode")}},d=class{constructor(m,w){this.parent=m,this.text=w,this.type="text",m.children.push(this)}static{r(this,"TextNode")}},h=class{constructor(m){this.parent=m,this.type="block",this.command="",m.children.push(this)}static{r(this,"BlockNode")}},D=class{constructor(m,w,g,_){this.parent=m,this.raw=w,this.braces=g,this.parens=_,this.type="comment",m.block=this}static{r(this,"CommentNode")}},p=class{constructor(m,w,g,_){this.parent=m,this.raw=w,this.braces=g,this.parens=_,this.type="preamble",m.block=this}static{r(this,"PreambleNode")}},F=class{constructor(m,w,g,_){this.parent=m,this.raw=w,this.braces=g,this.parens=_,this.type="string",m.block=this}static{r(this,"StringNode")}},y=class{constructor(m,w){this.parent=m,this.wrapType=w,this.type="entry",m.block=this,this.fields=[]}static{r(this,"EntryNode")}},b=class{constructor(m,w=""){this.parent=m,this.name=w,this.type="field",this.value=new E(this)}static{r(this,"FieldNode")}},E=class{constructor(m){this.parent=m,this.type="concat",this.canConsumeValue=!0,this.concat=[]}static{r(this,"ConcatNode")}},x=class{constructor(m,w){this.parent=m,this.value=w,this.type="literal",m.concat.push(this)}static{r(this,"LiteralNode")}},N=class{constructor(m){this.parent=m,this.type="braced",this.value="",this.depth=0,m.concat.push(this)}static{r(this,"BracedNode")}},O=class{constructor(m){this.parent=m,this.type="quoted",this.value="",this.depth=0,m.concat.push(this)}static{r(this,"QuotedNode")}};function I(m){const w=new l;let g=w,_=1,H=0;for(let J=0;J<m.length;J++){const T=m[J]??"",fe=m[J-1]??"";switch(T===`
|
|
15
|
-
`&&(_++,H=0),H++,g.type){case"root":{g=T==="@"?new h(g):new d(g,T);break}case"text":{T==="@"&&/[\s\r\n}]/.test(fe)?g=new h(g.parent):g.text+=T;break}case"block":{if(T==="@"){const be=g.parent.children[g.parent.children.length-2];be?.type==="text"?be.text+=`@${g.command}`:(g.parent.children.pop(),new d(g.parent,`@${g.command}`),g.parent.children.push(g)),g.command=""}else if(T==="{"||T==="("){const be=g.command.trim();if(be===""||/\s/.test(be))g.parent.children.pop(),g=new d(g.parent,`@${g.command}${T}`);else{g.command=be;const Le=g.command.toLowerCase(),[Ee,Be]=T==="{"?[1,0]:[0,1],Ft=`@${Le}${T}`;switch(Le){case"string":g=new F(g,Ft,Ee,Be);break;case"preamble":g=new p(g,Ft,Ee,Be);break;case"comment":g=new D(g,Ft,Ee,Be);break;default:g=new y(g,T);break}}}else T.match(/[=#,})[\]]/)?(g.parent.children.pop(),g=new d(g.parent,`@${g.command}${T}`)):g.command+=T;break}case"comment":case"string":case"preamble":T==="{"?g.braces++:T==="}"?g.braces--:T==="("?g.parens++:T===")"&&g.parens--,g.raw+=T,g.braces===0&&g.parens===0&&(g=g.parent.parent);break;case"entry":{if(q(T))g.key&&(g.keyEnded=!0);else if(T===",")g=new b(g);else if(g.wrapType==="{"&&T==="}"||g.wrapType==="("&&T===")")g=g.parent.parent;else if(T==="="&&g.key&&X(g.key)){const be=new b(g,g.key);g.fields.push(be),g.key=void 0,g=be.value}else{if(g.keyEnded)throw new G(m,g,J,_,H,"The entry key cannot contain whitespace");if(z(T))g.key=(g.key??"")+T;else throw new G(m,g,J,_,H,`The entry key cannot contain the character (${T})`)}break}case"field":{if(T==="}"||T===")")g.name=g.name.trim(),g=g.parent.parent.parent;else if(T==="=")g.name=g.name.trim(),g=g.value;else if(T===",")g.name=g.name.trim(),g=new b(g.parent);else if(X(T))g.name?g.name+=T:q(T)||(g.parent.fields.push(g),g.name=T);else throw new G(m,g,J,_,H);break}case"concat":{if(q(T))break;if(g.canConsumeValue){if(/[#=,}()[\]]/.test(T))throw new G(m,g,J,_,H);g.canConsumeValue=!1,T==="{"?g=new N(g):T==='"'?g=new O(g):g=new x(g,T)}else if(T===",")g=new b(g.parent.parent);else if(T==="}"||T===")")g=g.parent.parent.parent.parent;else if(T==="#")g.canConsumeValue=!0;else throw new G(m,g,J,_,H);break}case"literal":q(T)?g=g.parent:T===","?g=new b(g.parent.parent.parent):T==="}"?g=g.parent.parent.parent.parent.parent:T==="#"?(g=g.parent,g.canConsumeValue=!0):g.value+=T;break;case"braced":if(T==="}"&&g.depth===0){g=g.parent;break}T==="{"?g.depth++:T==="}"&&g.depth--,g.value+=T;break;case"quoted":if(T==='"'&&g.depth===0){g=g.parent;break}if(T==="{")g.depth++;else if(T==="}"&&(g.depth--,g.depth<0))throw new G(m,g,J,_,H);g.value+=T;break}}return w}r(I,"generateAST");function q(m){return/^[ \t\n\r]*$/.test(m)}r(q,"isWhitespace");function z(m){return!/[#%{}~$,]/.test(m)}r(z,"isValidKeyCharacter");function X(m){return!/[=,{}()[\]]/.test(m)}r(X,"isValidFieldName");var G=class extends Error{constructor(m,w,g,_,H,J){super(`Line ${_}:${H}: Syntax Error in ${w.type} (${J})
|
|
16
|
-
${m.slice(Math.max(0,g-20),g)}>>${m[g]}<<${m.slice(g+1,g+20)}`),this.node=w,this.line=_,this.column=H,this.hint=J,this.name="Syntax Error",this.char=m[g]??""}static{r(this,"BibTeXSyntaxError")}};function A(m,w){return m.replace(/\s+/g," ").split(/ and /i).map(g=>{let _=g.trim();w&&(_=_.replace(/["{}]/g,""));const H=_.indexOf(",");if(H>-1)return{firstNames:_.slice(H+1).trim(),lastName:_.slice(0,H).trim()};const J=_.lastIndexOf(" ");return{firstNames:_.slice(0,J).trim(),lastName:_.slice(J).trim()}})}r(A,"parseAuthors");var ie=class Fd{constructor(w,g,_=[]){this.kind=w,this.parent=g,this.children=_,this.type="block",g instanceof Fd?g.children.push(this):g instanceof K&&g.args.push(this)}static{r(this,"BlockNode")}},M=class{constructor(m,w=""){this.parent=m,this.text=w,this.type="text",m.children.push(this)}static{r(this,"TextNode")}},K=class{constructor(m,w="",g=[]){this.parent=m,this.command=w,this.args=g,this.type="command",m.children.push(this)}static{r(this,"CommandNode")}};function L(m){const w=new ie("root");let g=w;for(let _=0;_<m.length;_++){const H=m[_];if(!H)break;switch(g.type){case"block":{H==="\\"?g=new K(g):H==="{"?g=new ie("curly",g):(H==="}"&&g.kind==="curly"||H==="]"&&g.kind==="square")&&g.parent?g=g.parent:g=new M(g,H);break}case"text":{H==="\\"||H==="{"||H==="}"&&g.parent.kind==="curly"||H==="]"&&g.parent.kind==="square"?(g=g.parent,_--):g.text+=H;break}case"command":H==="{"?g=new ie("curly",g):H==="["?g=new ie("square",g):H==="}"&&g.parent.kind==="curly"||H==="]"&&g.parent.kind==="square"||/\s/.test(H)||g.args.length>0?(g=g.parent,_--):g.command+=H}}return w}r(L,"parseLaTeX");function S(m){return P(m)}r(S,"stringifyLaTeX");function P(m){const w=m.children.map(g=>{switch(g.type){case"block":return P(g);case"command":return he(g);case"text":return g.text}}).join("");switch(m.kind){case"root":return w;case"curly":return`{${w}}`;case"square":return`[${w}]`}}r(P,"stringifyBlock");function he(m){return`\\${m.command}${m.args.map(P).join("")}`}r(he,"stringifyCommand");function xe(m){const w={...m,children:[]};for(const g of m.children)if(g.type==="block"&&g.kind==="curly"&&g.children.every(_=>_.type!=="command")){const _=xe(g);w.children.push(..._.children)}else w.children.push(g);return w}r(xe,"flattenLaTeX");var Fe=new Map([["0023","\\#"],["0024","\\$"],["0025","\\%"],["0026","\\&"],["0027","'"],["0040","\\@"],["002a","\\textasteriskcentered"],["005f","\\_"],["007c","\\vert{}"],["00a0","~"],["00a1","\\textexclamdown{}"],["00a2","\\textcent{}"],["00a3","\\textsterling{}"],["00a4","\\textcurrency{}"],["00a5","\\textyen{}"],["00a6","\\textbrokenbar{}"],["00a7","\\textsection{}"],["00a8","\\textasciidieresis{}"],["00a9","\\textcopyright{}"],["00aa","\\textordfeminine{}"],["00ab","\\guillemotleft{}"],["00ac","\\lnot{}"],["00ad","\\-"],["00ae","\\textregistered{}"],["00af","\\textasciimacron{}"],["00b0","\\textdegree{}"],["00b1","\\pm{}"],["00b2","\\ensuremath{^2}"],["00b3","\\ensuremath{^3}"],["00b4","\\textasciiacute{}"],["00b5","\\mathrm{\\mu}"],["00b6","\\textparagraph{}"],["00b7","\\cdot{}"],["00b8","\\c{}"],["00b9","\\ensuremath{^1}"],["00ba","\\textordmasculine{}"],["00bb","\\guillemotright{}"],["00bc","\\textonequarter{}"],["00bd","\\textonehalf{}"],["00be","\\textthreequarters{}"],["00bf","\\textquestiondown{}"],["00c0","\\`{A}"],["00c1","\\'{A}"],["00c2","\\^{A}"],["00c3","\\~{A}"],["00c4",'\\"{A}'],["00c5","\\AA{}"],["00c6","\\AE{}"],["00c7","\\c{C}"],["00c8","\\`{E}"],["00c9","\\'{E}"],["00ca","\\^{E}"],["00cb",'\\"{E}'],["00cc","\\`{I}"],["00cd","\\'{I}"],["00ce","\\^{I}"],["00cf",'\\"{I}'],["00d0","\\DH{}"],["00d1","\\~{N}"],["00d2","\\`{O}"],["00d3","\\'{O}"],["00d4","\\^{O}"],["00d5","\\~{O}"],["00d6",'\\"{O}'],["00d7","\\texttimes{}"],["00d8","\\O{}"],["00d9","\\`{U}"],["00da","\\'{U}"],["00db","\\^{U}"],["00dc",'\\"{U}'],["00dd","\\'{Y}"],["00de","\\TH{}"],["00df","\\ss{}"],["00e0","\\`{a}"],["00e1","\\'{a}"],["00e2","\\^{a}"],["00e3","\\~{a}"],["00e4",'\\"{a}'],["00e5","\\aa{}"],["00e6","\\ae{}"],["00e7","\\c{c}"],["00e8","\\`{e}"],["00e9","\\'{e}"],["00ea","\\^{e}"],["00eb",'\\"{e}'],["00ec","\\`{\\i}"],["00ed","\\'{\\i}"],["00ee","\\^{\\i}"],["00ef",'\\"{\\i}'],["00f0","\\dh{}"],["00f1","\\~{n}"],["00f2","\\`{o}"],["00f3","\\'{o}"],["00f4","\\^{o}"],["00f5","\\~{o}"],["00f6",'\\"{o}'],["00f7","\\div{}"],["00f8","\\o{}"],["00f9","\\`{u}"],["00fa","\\'{u}"],["00fb","\\^{u}"],["00fc",'\\"{u}'],["00fd","\\'{y}"],["00fe","\\th{}"],["00ff",'\\"{y}'],["0100","\\={A}"],["0101","\\={a}"],["0102","\\u{A}"],["0103","\\u{a}"],["0104","\\k{A}"],["0105","\\k{a}"],["0106","\\'{C}"],["0107","\\'{c}"],["0108","\\^{C}"],["0109","\\^{c}"],["010a","\\.{C}"],["010b","\\.{c}"],["010c","\\v{C}"],["010d","\\v{c}"],["010e","\\v{D}"],["010f","\\v{d}"],["0110","\\DJ{}"],["0111","\\dj{}"],["0112","\\={E}"],["0113","\\={e}"],["0114","\\u{E}"],["0115","\\u{e}"],["0116","\\.{E}"],["0117","\\.{e}"],["0118","\\k{E}"],["0119","\\k{e}"],["011a","\\v{E}"],["011b","\\v{e}"],["011c","\\^{G}"],["011d","\\^{g}"],["011e","\\u{G}"],["011f","\\u{g}"],["0120","\\.{G}"],["0121","\\.{g}"],["0122","\\c{G}"],["0123","\\c{g}"],["0124","\\^{H}"],["0125","\\^{h}"],["0126","{\\fontencoding{LELA}\\selectfont\\char40}"],["0127","\\Elzxh{}"],["0128","\\~{I}"],["0129","\\~{\\i}"],["012a","\\={I}"],["012b","\\={\\i}"],["012c","\\u{I}"],["012d","\\u{\\i}"],["012e","\\k{I}"],["012f","\\k{i}"],["0130","\\.{I}"],["0131","\\i{}"],["0132","IJ"],["0133","ij"],["0134","\\^{J}"],["0135","\\^{\\j}"],["0136","\\c{K}"],["0137","\\c{k}"],["0138","{\\fontencoding{LELA}\\selectfont\\char91}"],["0139","\\'{L}"],["013a","\\'{l}"],["013b","\\c{L}"],["013c","\\c{l}"],["013d","\\v{L}"],["013e","\\v{l}"],["013f","{\\fontencoding{LELA}\\selectfont\\char201}"],["0140","{\\fontencoding{LELA}\\selectfont\\char202}"],["0141","\\L{}"],["0142","\\l{}"],["0143","\\'{N}"],["0144","\\'{n}"],["0145","\\c{N}"],["0146","\\c{n}"],["0147","\\v{N}"],["0148","\\v{n}"],["0149","'n"],["014a","\\NG{}"],["014b","\\ng{}"],["014c","\\={O}"],["014d","\\={o}"],["014e","\\u{O}"],["014f","\\u{o}"],["0150","\\H{O}"],["0151","\\H{o}"],["0152","\\OE{}"],["0153","\\oe{}"],["0154","\\'{R}"],["0155","\\'{r}"],["0156","\\c{R}"],["0157","\\c{r}"],["0158","\\v{R}"],["0159","\\v{r}"],["015a","\\'{S}"],["015b","\\'{s}"],["015c","\\^{S}"],["015d","\\^{s}"],["015e","\\c{S}"],["015f","\\c{s}"],["0160","\\v{S}"],["0161","\\v{s}"],["0162","\\c{T}"],["0163","\\c{t}"],["0164","\\v{T}"],["0165","\\v{t}"],["0166","{\\fontencoding{LELA}\\selectfont\\char47}"],["0167","{\\fontencoding{LELA}\\selectfont\\char63}"],["0168","\\~{U}"],["0169","\\~{u}"],["016a","\\={U}"],["016b","\\={u}"],["016c","\\u{U}"],["016d","\\u{u}"],["016e","\\r{U}"],["016f","\\r{u}"],["0170","\\H{U}"],["0171","\\H{u}"],["0172","\\k{U}"],["0173","\\k{u}"],["0174","\\^{W}"],["0175","\\^{w}"],["0176","\\^{Y}"],["0177","\\^{y}"],["0178",'\\"{Y}'],["0179","\\'{Z}"],["017a","\\'{z}"],["017b","\\.{Z}"],["017c","\\.{z}"],["017d","\\v{Z}"],["017e","\\v{z}"],["0195","\\texthvlig{}"],["019e","\\textnrleg{}"],["01aa","\\eth{}"],["01ba","{\\fontencoding{LELA}\\selectfont\\char195}"],["01c2","\\textdoublepipe{}"],["01f5","\\'{g}"],["0250","\\Elztrna{}"],["0252","\\Elztrnsa{}"],["0254","\\Elzopeno{}"],["0256","\\Elzrtld{}"],["0258","{\\fontencoding{LEIP}\\selectfont\\char61}"],["0259","\\Elzschwa{}"],["025b","\\varepsilon{}"],["0263","\\Elzpgamma{}"],["0264","\\Elzpbgam{}"],["0265","\\Elztrnh{}"],["026c","\\Elzbtdl{}"],["026d","\\Elzrtll{}"],["026f","\\Elztrnm{}"],["0270","\\Elztrnmlr{}"],["0271","\\Elzltlmr{}"],["0272","\\Elzltln{}"],["0273","\\Elzrtln{}"],["0277","\\Elzclomeg{}"],["0278","\\textphi{}"],["0279","\\Elztrnr{}"],["027a","\\Elztrnrl{}"],["027b","\\Elzrttrnr{}"],["027c","\\Elzrl{}"],["027d","\\Elzrtlr{}"],["027e","\\Elzfhr{}"],["027f","{\\fontencoding{LEIP}\\selectfont\\char202}"],["0282","\\Elzrtls{}"],["0283","\\Elzesh{}"],["0287","\\Elztrnt{}"],["0288","\\Elzrtlt{}"],["028a","\\Elzpupsil{}"],["028b","\\Elzpscrv{}"],["028c","\\Elzinvv{}"],["028d","\\Elzinvw{}"],["028e","\\Elztrny{}"],["0290","\\Elzrtlz{}"],["0292","\\Elzyogh{}"],["0294","\\Elzglst{}"],["0295","\\Elzreglst{}"],["0296","\\Elzinglst{}"],["029e","\\textturnk{}"],["02a4","\\Elzdyogh{}"],["02a7","\\Elztesh{}"],["02c7","\\textasciicaron{}"],["02c8","\\Elzverts{}"],["02cc","\\Elzverti{}"],["02d0","\\Elzlmrk{}"],["02d1","\\Elzhlmrk{}"],["02d2","\\Elzsbrhr{}"],["02d3","\\Elzsblhr{}"],["02d4","\\Elzrais{}"],["02d5","\\Elzlow{}"],["02d8","\\textasciibreve{}"],["02d9","\\textperiodcentered{}"],["02da","\\r{}"],["02db","\\k{}"],["02dc","\\texttildelow{}"],["02dd","\\H{}"],["02e5","\\tone{55}"],["02e6","\\tone{44}"],["02e7","\\tone{33}"],["02e8","\\tone{22}"],["02e9","\\tone{11}"],["0300","\\`"],["0301","\\'"],["0302","\\^"],["0303","\\~"],["0304","\\="],["0306","\\u"],["0307","\\."],["0308",'\\"'],["030a","\\r"],["030b","\\H"],["030c","\\v"],["030f","\\cyrchar\\C"],["0311","{\\fontencoding{LECO}\\selectfont\\char177}"],["0318","{\\fontencoding{LECO}\\selectfont\\char184}"],["0319","{\\fontencoding{LECO}\\selectfont\\char185}"],["0321","\\Elzpalh{}"],["0322","\\Elzrh{}"],["0327","\\c"],["0328","\\k"],["032a","\\Elzsbbrg{}"],["032b","{\\fontencoding{LECO}\\selectfont\\char203}"],["032f","{\\fontencoding{LECO}\\selectfont\\char207}"],["0335","\\Elzxl{}"],["0336","\\Elzbar{}"],["0337","{\\fontencoding{LECO}\\selectfont\\char215}"],["0338","{\\fontencoding{LECO}\\selectfont\\char216}"],["033a","{\\fontencoding{LECO}\\selectfont\\char218}"],["033b","{\\fontencoding{LECO}\\selectfont\\char219}"],["033c","{\\fontencoding{LECO}\\selectfont\\char220}"],["033d","{\\fontencoding{LECO}\\selectfont\\char221}"],["0361","{\\fontencoding{LECO}\\selectfont\\char225}"],["0386","\\'{A}"],["0388","\\'{E}"],["0389","\\'{H}"],["038a","\\'{}{I}"],["038c","\\'{}O"],["038e","\\mathrm{'Y}"],["038f","\\mathrm{'\\Omega}"],["0390","\\acute{\\ddot{\\iota}}"],["0391","\\ensuremath{\\Alpha}"],["0392","\\ensuremath{\\Beta}"],["0393","\\ensuremath{\\Gamma}"],["0394","\\ensuremath{\\Delta}"],["0395","\\ensuremath{\\Epsilon}"],["0396","\\ensuremath{\\Zeta}"],["0397","\\ensuremath{\\Eta}"],["0398","\\ensuremath{\\Theta}"],["0399","\\ensuremath{\\Iota}"],["039a","\\ensuremath{\\Kappa}"],["039b","\\ensuremath{\\Lambda}"],["039e","\\ensuremath{\\Xi}"],["03a0","\\ensuremath{\\Pi}"],["03a1","\\ensuremath{\\Rho}"],["03a3","\\ensuremath{\\Sigma}"],["03a4","\\ensuremath{\\Tau}"],["03a5","\\ensuremath{\\Upsilon}"],["03a6","\\ensuremath{\\Phi}"],["03a7","\\ensuremath{\\Chi}"],["03a8","\\ensuremath{\\Psi}"],["03a9","\\ensuremath{\\Omega}"],["03aa","\\mathrm{\\ddot{I}}"],["03ab","\\mathrm{\\ddot{Y}}"],["03ac","\\'{$\\alpha$}"],["03ad","\\acute{\\epsilon}"],["03ae","\\acute{\\eta}"],["03af","\\acute{\\iota}"],["03b0","\\acute{\\ddot{\\upsilon}}"],["03b1","\\ensuremath{\\alpha}"],["03b2","\\ensuremath{\\beta}"],["03b3","\\ensuremath{\\gamma}"],["03b4","\\ensuremath{\\delta}"],["03b5","\\ensuremath{\\epsilon}"],["03b6","\\ensuremath{\\zeta}"],["03b7","\\ensuremath{\\eta}"],["03b8","\\texttheta{}"],["03b9","\\ensuremath{\\iota}"],["03ba","\\ensuremath{\\kappa}"],["03bb","\\ensuremath{\\lambda}"],["03bc","\\ensuremath{\\mu}"],["03bd","\\ensuremath{\\nu}"],["03be","\\ensuremath{\\xi}"],["03c0","\\ensuremath{\\pi}"],["03c1","\\ensuremath{\\rho}"],["03c2","\\ensuremath{\\varsigma}"],["03c3","\\ensuremath{\\sigma}"],["03c4","\\ensuremath{\\tau}"],["03c5","\\ensuremath{\\upsilon}"],["03c6","\\ensuremath{\\varphi}"],["03c7","\\ensuremath{\\chi}"],["03c8","\\ensuremath{\\psi}"],["03c9","\\ensuremath{\\omega}"],["03ca","\\ensuremath{\\ddot{\\iota}}"],["03cb","\\ensuremath{\\ddot{\\upsilon}}"],["03cc","\\'{o}"],["03cd","\\acute{\\upsilon}"],["03ce","\\acute{\\omega}"],["03d0","\\Pisymbol{ppi022}{87}"],["03d1","\\textvartheta{}"],["03d2","\\ensuremath{\\Upsilon}"],["03d5","\\ensuremath{\\phi}"],["03d6","\\ensuremath{\\varpi}"],["03da","\\Stigma{}"],["03dc","\\Digamma{}"],["03dd","\\digamma{}"],["03de","\\Koppa{}"],["03e0","\\Sampi{}"],["03f0","\\varkappa{}"],["03f1","\\varrho{}"],["03f4","\\textTheta{}"],["03f6","\\backepsilon{}"],["0401","\\cyrchar\\CYRYO{}"],["0402","\\cyrchar\\CYRDJE{}"],["0403","\\cyrchar{\\'\\CYRG}"],["0404","\\cyrchar\\CYRIE{}"],["0405","\\cyrchar\\CYRDZE{}"],["0406","\\cyrchar\\CYRII{}"],["0407","\\cyrchar\\CYRYI{}"],["0408","\\cyrchar\\CYRJE{}"],["0409","\\cyrchar\\CYRLJE{}"],["040a","\\cyrchar\\CYRNJE{}"],["040b","\\cyrchar\\CYRTSHE{}"],["040c","\\cyrchar{\\'\\CYRK}"],["040e","\\cyrchar\\CYRUSHRT{}"],["040f","\\cyrchar\\CYRDZHE{}"],["0410","\\cyrchar\\CYRA{}"],["0411","\\cyrchar\\CYRB{}"],["0412","\\cyrchar\\CYRV{}"],["0413","\\cyrchar\\CYRG{}"],["0414","\\cyrchar\\CYRD{}"],["0415","\\cyrchar\\CYRE{}"],["0416","\\cyrchar\\CYRZH{}"],["0417","\\cyrchar\\CYRZ{}"],["0418","\\cyrchar\\CYRI{}"],["0419","\\cyrchar\\CYRISHRT{}"],["041a","\\cyrchar\\CYRK{}"],["041b","\\cyrchar\\CYRL{}"],["041c","\\cyrchar\\CYRM{}"],["041d","\\cyrchar\\CYRN{}"],["041e","\\cyrchar\\CYRO{}"],["041f","\\cyrchar\\CYRP{}"],["0420","\\cyrchar\\CYRR{}"],["0421","\\cyrchar\\CYRS{}"],["0422","\\cyrchar\\CYRT{}"],["0423","\\cyrchar\\CYRU{}"],["0424","\\cyrchar\\CYRF{}"],["0425","\\cyrchar\\CYRH{}"],["0426","\\cyrchar\\CYRC{}"],["0427","\\cyrchar\\CYRCH{}"],["0428","\\cyrchar\\CYRSH{}"],["0429","\\cyrchar\\CYRSHCH{}"],["042a","\\cyrchar\\CYRHRDSN{}"],["042b","\\cyrchar\\CYRERY{}"],["042c","\\cyrchar\\CYRSFTSN{}"],["042d","\\cyrchar\\CYREREV{}"],["042e","\\cyrchar\\CYRYU{}"],["042f","\\cyrchar\\CYRYA{}"],["0430","\\cyrchar\\cyra{}"],["0431","\\cyrchar\\cyrb{}"],["0432","\\cyrchar\\cyrv{}"],["0433","\\cyrchar\\cyrg{}"],["0434","\\cyrchar\\cyrd{}"],["0435","\\cyrchar\\cyre{}"],["0436","\\cyrchar\\cyrzh{}"],["0437","\\cyrchar\\cyrz{}"],["0438","\\cyrchar\\cyri{}"],["0439","\\cyrchar\\cyrishrt{}"],["043a","\\cyrchar\\cyrk{}"],["043b","\\cyrchar\\cyrl{}"],["043c","\\cyrchar\\cyrm{}"],["043d","\\cyrchar\\cyrn{}"],["043e","\\cyrchar\\cyro{}"],["043f","\\cyrchar\\cyrp{}"],["0440","\\cyrchar\\cyrr{}"],["0441","\\cyrchar\\cyrs{}"],["0442","\\cyrchar\\cyrt{}"],["0443","\\cyrchar\\cyru{}"],["0444","\\cyrchar\\cyrf{}"],["0445","\\cyrchar\\cyrh{}"],["0446","\\cyrchar\\cyrc{}"],["0447","\\cyrchar\\cyrch{}"],["0448","\\cyrchar\\cyrsh{}"],["0449","\\cyrchar\\cyrshch{}"],["044a","\\cyrchar\\cyrhrdsn{}"],["044b","\\cyrchar\\cyrery{}"],["044c","\\cyrchar\\cyrsftsn{}"],["044d","\\cyrchar\\cyrerev{}"],["044e","\\cyrchar\\cyryu{}"],["044f","\\cyrchar\\cyrya{}"],["0451","\\cyrchar\\cyryo{}"],["0452","\\cyrchar\\cyrdje{}"],["0453","\\cyrchar{\\'\\cyrg}"],["0454","\\cyrchar\\cyrie{}"],["0455","\\cyrchar\\cyrdze{}"],["0456","\\cyrchar\\cyrii{}"],["0457","\\cyrchar\\cyryi{}"],["0458","\\cyrchar\\cyrje{}"],["0459","\\cyrchar\\cyrlje{}"],["045a","\\cyrchar\\cyrnje{}"],["045b","\\cyrchar\\cyrtshe{}"],["045c","\\cyrchar{\\'\\cyrk}"],["045e","\\cyrchar\\cyrushrt{}"],["045f","\\cyrchar\\cyrdzhe{}"],["0460","\\cyrchar\\CYROMEGA{}"],["0461","\\cyrchar\\cyromega{}"],["0462","\\cyrchar\\CYRYAT{}"],["0464","\\cyrchar\\CYRIOTE{}"],["0465","\\cyrchar\\cyriote{}"],["0466","\\cyrchar\\CYRLYUS{}"],["0467","\\cyrchar\\cyrlyus{}"],["0468","\\cyrchar\\CYRIOTLYUS{}"],["0469","\\cyrchar\\cyriotlyus{}"],["046a","\\cyrchar\\CYRBYUS{}"],["046c","\\cyrchar\\CYRIOTBYUS{}"],["046d","\\cyrchar\\cyriotbyus{}"],["046e","\\cyrchar\\CYRKSI{}"],["046f","\\cyrchar\\cyrksi{}"],["0470","\\cyrchar\\CYRPSI{}"],["0471","\\cyrchar\\cyrpsi{}"],["0472","\\cyrchar\\CYRFITA{}"],["0474","\\cyrchar\\CYRIZH{}"],["0478","\\cyrchar\\CYRUK{}"],["0479","\\cyrchar\\cyruk{}"],["047a","\\cyrchar\\CYROMEGARND{}"],["047b","\\cyrchar\\cyromegarnd{}"],["047c","\\cyrchar\\CYROMEGATITLO{}"],["047d","\\cyrchar\\cyromegatitlo{}"],["047e","\\cyrchar\\CYROT{}"],["047f","\\cyrchar\\cyrot{}"],["0480","\\cyrchar\\CYRKOPPA{}"],["0481","\\cyrchar\\cyrkoppa{}"],["0482","\\cyrchar\\cyrthousands{}"],["0488","\\cyrchar\\cyrhundredthousands{}"],["0489","\\cyrchar\\cyrmillions{}"],["048c","\\cyrchar\\CYRSEMISFTSN{}"],["048d","\\cyrchar\\cyrsemisftsn{}"],["048e","\\cyrchar\\CYRRTICK{}"],["048f","\\cyrchar\\cyrrtick{}"],["0490","\\cyrchar\\CYRGUP{}"],["0491","\\cyrchar\\cyrgup{}"],["0492","\\cyrchar\\CYRGHCRS{}"],["0493","\\cyrchar\\cyrghcrs{}"],["0494","\\cyrchar\\CYRGHK{}"],["0495","\\cyrchar\\cyrghk{}"],["0496","\\cyrchar\\CYRZHDSC{}"],["0497","\\cyrchar\\cyrzhdsc{}"],["0498","\\cyrchar\\CYRZDSC{}"],["0499","\\cyrchar\\cyrzdsc{}"],["049a","\\cyrchar\\CYRKDSC{}"],["049b","\\cyrchar\\cyrkdsc{}"],["049c","\\cyrchar\\CYRKVCRS{}"],["049d","\\cyrchar\\cyrkvcrs{}"],["049e","\\cyrchar\\CYRKHCRS{}"],["049f","\\cyrchar\\cyrkhcrs{}"],["04a0","\\cyrchar\\CYRKBEAK{}"],["04a1","\\cyrchar\\cyrkbeak{}"],["04a2","\\cyrchar\\CYRNDSC{}"],["04a3","\\cyrchar\\cyrndsc{}"],["04a4","\\cyrchar\\CYRNG{}"],["04a5","\\cyrchar\\cyrng{}"],["04a6","\\cyrchar\\CYRPHK{}"],["04a7","\\cyrchar\\cyrphk{}"],["04a8","\\cyrchar\\CYRABHHA{}"],["04a9","\\cyrchar\\cyrabhha{}"],["04aa","\\cyrchar\\CYRSDSC{}"],["04ab","\\cyrchar\\cyrsdsc{}"],["04ac","\\cyrchar\\CYRTDSC{}"],["04ad","\\cyrchar\\cyrtdsc{}"],["04ae","\\cyrchar\\CYRY{}"],["04af","\\cyrchar\\cyry{}"],["04b0","\\cyrchar\\CYRYHCRS{}"],["04b1","\\cyrchar\\cyryhcrs{}"],["04b2","\\cyrchar\\CYRHDSC{}"],["04b3","\\cyrchar\\cyrhdsc{}"],["04b4","\\cyrchar\\CYRTETSE{}"],["04b5","\\cyrchar\\cyrtetse{}"],["04b6","\\cyrchar\\CYRCHRDSC{}"],["04b7","\\cyrchar\\cyrchrdsc{}"],["04b8","\\cyrchar\\CYRCHVCRS{}"],["04b9","\\cyrchar\\cyrchvcrs{}"],["04ba","\\cyrchar\\CYRSHHA{}"],["04bb","\\cyrchar\\cyrshha{}"],["04bc","\\cyrchar\\CYRABHCH{}"],["04bd","\\cyrchar\\cyrabhch{}"],["04be","\\cyrchar\\CYRABHCHDSC{}"],["04bf","\\cyrchar\\cyrabhchdsc{}"],["04c0","\\cyrchar\\CYRpalochka{}"],["04c3","\\cyrchar\\CYRKHK{}"],["04c4","\\cyrchar\\cyrkhk{}"],["04c7","\\cyrchar\\CYRNHK{}"],["04c8","\\cyrchar\\cyrnhk{}"],["04cb","\\cyrchar\\CYRCHLDSC{}"],["04cc","\\cyrchar\\cyrchldsc{}"],["04d4","\\cyrchar\\CYRAE{}"],["04d5","\\cyrchar\\cyrae{}"],["04d8","\\cyrchar\\CYRSCHWA{}"],["04d9","\\cyrchar\\cyrschwa{}"],["04e0","\\cyrchar\\CYRABHDZE{}"],["04e1","\\cyrchar\\cyrabhdze{}"],["04e8","\\cyrchar\\CYROTLD{}"],["04e9","\\cyrchar\\cyrotld{}"],["2002","\\hspace{0.6em}"],["2003","\\hspace{1em}"],["2004","\\hspace{0.33em}"],["2005","\\hspace{0.25em}"],["2006","\\hspace{0.166em}"],["2007","\\hphantom{0}"],["2008","\\hphantom{,}"],["2009","\\hspace{0.167em}"],["200a","\\mkern1mu{}"],["2010","-"],["2014","--"],["2015","\\rule{1em}{1pt}"],["2016","\\Vert{}"],["2018","`"],["2019","'"],["201b","\\Elzreapos{}"],["201c","``"],["201d","''"],["201e",",,"],["2020","\\textdagger{}"],["2021","\\textdaggerdbl{}"],["2022","\\textbullet{}"],["2025",".."],["2026","\\ldots{}"],["2030","\\textperthousand{}"],["2031","\\textpertenthousand{}"],["2032","\\ensuremath{'}"],["2033","\\ensuremath{''}"],["2034","\\ensuremath{'''}"],["2035","\\backprime{}"],["2039","\\guilsinglleft{}"],["203a","\\guilsinglright{}"],["2057","''''"],["205f","\\mkern4mu{}"],["2060","\\nolinebreak{}"],["20a7","\\ensuremath{\\Elzpes}"],["20ac","\\mbox{\\texteuro}{}"],["20db","\\dddot{}"],["20dc","\\ddddot{}"],["2102","\\mathbb{C}"],["210a","\\mathscr{g}"],["210b","\\mathscr{H}"],["210c","\\mathfrak{H}"],["210d","\\mathbb{H}"],["210f","\\hslash{}"],["2110","\\mathscr{I}"],["2111","\\mathfrak{I}"],["2112","\\mathscr{L}"],["2113","\\mathscr{l}"],["2115","\\mathbb{N}"],["2116","\\cyrchar\\textnumero{}"],["2118","\\wp{}"],["2119","\\mathbb{P}"],["211a","\\mathbb{Q}"],["211b","\\mathscr{R}"],["211c","\\mathfrak{R}"],["211d","\\mathbb{R}"],["211e","\\Elzxrat{}"],["2122","\\texttrademark{}"],["2124","\\mathbb{Z}"],["2126","\\Omega{}"],["2127","\\mho{}"],["2128","\\mathfrak{Z}"],["2129","\\ElsevierGlyph{2129}"],["212b","\\AA{}"],["212c","\\mathscr{B}"],["212d","\\mathfrak{C}"],["212f","\\mathscr{e}"],["2130","\\mathscr{E}"],["2131","\\mathscr{F}"],["2133","\\mathscr{M}"],["2134","\\mathscr{o}"],["2135","\\aleph{}"],["2136","\\beth{}"],["2137","\\gimel{}"],["2138","\\daleth{}"],["2153","\\textfrac{1}{3}"],["2154","\\textfrac{2}{3}"],["2155","\\textfrac{1}{5}"],["2156","\\textfrac{2}{5}"],["2157","\\textfrac{3}{5}"],["2158","\\textfrac{4}{5}"],["2159","\\textfrac{1}{6}"],["215a","\\textfrac{5}{6}"],["215b","\\textfrac{1}{8}"],["215c","\\textfrac{3}{8}"],["215d","\\textfrac{5}{8}"],["215e","\\textfrac{7}{8}"],["2190","\\leftarrow{}"],["2191","\\uparrow{}"],["2192","\\rightarrow{}"],["2193","\\downarrow{}"],["2194","\\leftrightarrow{}"],["2195","\\updownarrow{}"],["2196","\\nwarrow{}"],["2197","\\nearrow{}"],["2198","\\searrow{}"],["2199","\\swarrow{}"],["219a","\\nleftarrow{}"],["219b","\\nrightarrow{}"],["219c","\\arrowwaveright{}"],["219d","\\arrowwaveright{}"],["219e","\\twoheadleftarrow{}"],["21a0","\\twoheadrightarrow{}"],["21a2","\\leftarrowtail{}"],["21a3","\\rightarrowtail{}"],["21a6","\\mapsto{}"],["21a9","\\hookleftarrow{}"],["21aa","\\hookrightarrow{}"],["21ab","\\looparrowleft{}"],["21ac","\\looparrowright{}"],["21ad","\\leftrightsquigarrow{}"],["21ae","\\nleftrightarrow{}"],["21b0","\\Lsh{}"],["21b1","\\Rsh{}"],["21b3","\\ElsevierGlyph{21B3}"],["21b6","\\curvearrowleft{}"],["21b7","\\curvearrowright{}"],["21ba","\\circlearrowleft{}"],["21bb","\\circlearrowright{}"],["21bc","\\leftharpoonup{}"],["21bd","\\leftharpoondown{}"],["21be","\\upharpoonright{}"],["21bf","\\upharpoonleft{}"],["21c0","\\rightharpoonup{}"],["21c1","\\rightharpoondown{}"],["21c2","\\downharpoonright{}"],["21c3","\\downharpoonleft{}"],["21c4","\\rightleftarrows{}"],["21c5","\\dblarrowupdown{}"],["21c6","\\leftrightarrows{}"],["21c7","\\leftleftarrows{}"],["21c8","\\upuparrows{}"],["21c9","\\rightrightarrows{}"],["21ca","\\downdownarrows{}"],["21cb","\\leftrightharpoons{}"],["21cc","\\rightleftharpoons{}"],["21cd","\\nLeftarrow{}"],["21ce","\\nLeftrightarrow{}"],["21cf","\\nRightarrow{}"],["21d0","\\Leftarrow{}"],["21d1","\\Uparrow{}"],["21d2","\\Rightarrow{}"],["21d3","\\Downarrow{}"],["21d4","\\Leftrightarrow{}"],["21d5","\\Updownarrow{}"],["21da","\\Lleftarrow{}"],["21db","\\Rrightarrow{}"],["21dd","\\rightsquigarrow{}"],["21f5","\\DownArrowUpArrow{}"],["2200","\\forall{}"],["2201","\\complement{}"],["2202","\\partial{}"],["2203","\\exists{}"],["2204","\\nexists{}"],["2205","\\varnothing{}"],["2207","\\nabla{}"],["2208","\\in{}"],["2209","\\not\\in{}"],["220b","\\ni{}"],["220c","\\not\\ni{}"],["220f","\\prod{}"],["2210","\\coprod{}"],["2211","\\sum{}"],["2212","-"],["2213","\\mp{}"],["2214","\\dotplus{}"],["2216","\\setminus{}"],["2217","{\\_\\ast}"],["2218","\\circ{}"],["2219","\\bullet{}"],["221a","\\surd{}"],["221d","\\propto{}"],["221e","\\infty{}"],["221f","\\rightangle{}"],["2220","\\angle{}"],["2221","\\measuredangle{}"],["2222","\\sphericalangle{}"],["2223","\\mid{}"],["2224","\\nmid{}"],["2225","\\parallel{}"],["2226","\\nparallel{}"],["2227","\\wedge{}"],["2228","\\vee{}"],["2229","\\cap{}"],["222a","\\cup{}"],["222b","\\int{}"],["222c","\\int\\!\\int{}"],["222d","\\int\\!\\int\\!\\int{}"],["222e","\\oint{}"],["222f","\\surfintegral{}"],["2230","\\volintegral{}"],["2231","\\clwintegral{}"],["2232","\\ElsevierGlyph{2232}"],["2233","\\ElsevierGlyph{2233}"],["2234","\\therefore{}"],["2235","\\because{}"],["2237","\\Colon{}"],["2238","\\ElsevierGlyph{2238}"],["223a","\\mathbin{{:}\\!\\!{-}\\!\\!{:}}"],["223b","\\homothetic{}"],["223c","\\sim{}"],["223d","\\backsim{}"],["223e","\\lazysinv{}"],["2240","\\wr{}"],["2241","\\not\\sim{}"],["2242","\\ElsevierGlyph{2242}"],["2243","\\simeq{}"],["2244","\\not\\simeq{}"],["2245","\\cong{}"],["2246","\\approxnotequal{}"],["2247","\\not\\cong{}"],["2248","\\approx{}"],["2249","\\not\\approx{}"],["224a","\\approxeq{}"],["224b","\\tildetrpl{}"],["224c","\\allequal{}"],["224d","\\asymp{}"],["224e","\\Bumpeq{}"],["224f","\\bumpeq{}"],["2250","\\doteq{}"],["2251","\\doteqdot{}"],["2252","\\fallingdotseq{}"],["2253","\\risingdotseq{}"],["2254",":="],["2255","=:"],["2256","\\eqcirc{}"],["2257","\\circeq{}"],["2259","\\estimates{}"],["225a","\\ElsevierGlyph{225A}"],["225b","\\starequal{}"],["225c","\\triangleq{}"],["225f","\\ElsevierGlyph{225F}"],["2260","\\not ="],["2261","\\equiv{}"],["2262","\\not\\equiv{}"],["2264","\\leq{}"],["2265","\\geq{}"],["2266","\\leqq{}"],["2267","\\geqq{}"],["2268","\\lneqq{}"],["2269","\\gneqq{}"],["226a","\\ll{}"],["226b","\\gg{}"],["226c","\\between{}"],["226d","\\not\\kern-0.3em\\times{}"],["226e","\\not<"],["226f","\\not>"],["2270","\\not\\leq{}"],["2271","\\not\\geq{}"],["2272","\\lessequivlnt{}"],["2273","\\greaterequivlnt{}"],["2274","\\ElsevierGlyph{2274}"],["2275","\\ElsevierGlyph{2275}"],["2276","\\lessgtr{}"],["2277","\\gtrless{}"],["2278","\\notlessgreater{}"],["2279","\\notgreaterless{}"],["227a","\\prec{}"],["227b","\\succ{}"],["227c","\\preccurlyeq{}"],["227d","\\succcurlyeq{}"],["227e","\\precapprox{}"],["227f","\\succapprox{}"],["2280","\\not\\prec{}"],["2281","\\not\\succ{}"],["2282","\\subset{}"],["2283","\\supset{}"],["2284","\\not\\subset{}"],["2285","\\not\\supset{}"],["2286","\\subseteq{}"],["2287","\\supseteq{}"],["2288","\\not\\subseteq{}"],["2289","\\not\\supseteq{}"],["228a","\\subsetneq{}"],["228b","\\supsetneq{}"],["228e","\\uplus{}"],["228f","\\sqsubset{}"],["2290","\\sqsupset{}"],["2291","\\sqsubseteq{}"],["2292","\\sqsupseteq{}"],["2293","\\sqcap{}"],["2294","\\sqcup{}"],["2295","\\oplus{}"],["2296","\\ominus{}"],["2297","\\otimes{}"],["2298","\\oslash{}"],["2299","\\odot{}"],["229a","\\circledcirc{}"],["229b","\\circledast{}"],["229d","\\circleddash{}"],["229e","\\boxplus{}"],["229f","\\boxminus{}"],["22a0","\\boxtimes{}"],["22a1","\\boxdot{}"],["22a2","\\vdash{}"],["22a3","\\dashv{}"],["22a4","\\top{}"],["22a5","\\perp{}"],["22a7","\\truestate{}"],["22a8","\\forcesextra{}"],["22a9","\\Vdash{}"],["22aa","\\Vvdash{}"],["22ab","\\VDash{}"],["22ac","\\nvdash{}"],["22ad","\\nvDash{}"],["22ae","\\nVdash{}"],["22af","\\nVDash{}"],["22b2","\\vartriangleleft{}"],["22b3","\\vartriangleright{}"],["22b4","\\trianglelefteq{}"],["22b5","\\trianglerighteq{}"],["22b6","\\original{}"],["22b7","\\image{}"],["22b8","\\multimap{}"],["22b9","\\hermitconjmatrix{}"],["22ba","\\intercal{}"],["22bb","\\veebar{}"],["22be","\\rightanglearc{}"],["22c0","\\ElsevierGlyph{22C0}"],["22c1","\\ElsevierGlyph{22C1}"],["22c2","\\bigcap{}"],["22c3","\\bigcup{}"],["22c4","\\diamond{}"],["22c5","\\cdot{}"],["22c6","\\star{}"],["22c7","\\divideontimes{}"],["22c8","\\bowtie{}"],["22c9","\\ltimes{}"],["22ca","\\rtimes{}"],["22cb","\\leftthreetimes{}"],["22cc","\\rightthreetimes{}"],["22cd","\\backsimeq{}"],["22ce","\\curlyvee{}"],["22cf","\\curlywedge{}"],["22d0","\\Subset{}"],["22d1","\\Supset{}"],["22d2","\\Cap{}"],["22d3","\\Cup{}"],["22d4","\\pitchfork{}"],["22d6","\\lessdot{}"],["22d7","\\gtrdot{}"],["22d8","\\verymuchless{}"],["22d9","\\verymuchgreater{}"],["22da","\\lesseqgtr{}"],["22db","\\gtreqless{}"],["22de","\\curlyeqprec{}"],["22df","\\curlyeqsucc{}"],["22e2","\\not\\sqsubseteq{}"],["22e3","\\not\\sqsupseteq{}"],["22e5","\\Elzsqspne{}"],["22e6","\\lnsim{}"],["22e7","\\gnsim{}"],["22e8","\\precedesnotsimilar{}"],["22e9","\\succnsim{}"],["22ea","\\ntriangleleft{}"],["22eb","\\ntriangleright{}"],["22ec","\\ntrianglelefteq{}"],["22ed","\\ntrianglerighteq{}"],["22ee","\\vdots{}"],["22ef","\\cdots{}"],["22f0","\\upslopeellipsis{}"],["22f1","\\downslopeellipsis{}"],["2305","\\barwedge{}"],["2306","\\perspcorrespond{}"],["2308","\\lceil{}"],["2309","\\rceil{}"],["230a","\\lfloor{}"],["230b","\\rfloor{}"],["2315","\\recorder{}"],["2316",'\\mathchar"2208'],["231c","\\ulcorner{}"],["231d","\\urcorner{}"],["231e","\\llcorner{}"],["231f","\\lrcorner{}"],["2322","\\frown{}"],["2323","\\smile{}"],["2329","\\langle{}"],["232a","\\rangle{}"],["233d","\\ElsevierGlyph{E838}"],["23a3","\\Elzdlcorn{}"],["23b0","\\lmoustache{}"],["23b1","\\rmoustache{}"],["2423","\\textvisiblespace{}"],["2460","\\ding{172}"],["2461","\\ding{173}"],["2462","\\ding{174}"],["2463","\\ding{175}"],["2464","\\ding{176}"],["2465","\\ding{177}"],["2466","\\ding{178}"],["2467","\\ding{179}"],["2468","\\ding{180}"],["2469","\\ding{181}"],["24c8","\\circledS{}"],["2506","\\Elzdshfnc{}"],["2519","\\Elzsqfnw{}"],["2571","\\diagup{}"],["25a0","\\ding{110}"],["25a1","\\square{}"],["25aa","\\blacksquare{}"],["25ad","\\fbox{~~}"],["25af","\\Elzvrecto{}"],["25b1","\\ElsevierGlyph{E381}"],["25b2","\\ding{115}"],["25b3","\\bigtriangleup{}"],["25b4","\\blacktriangle{}"],["25b5","\\vartriangle{}"],["25b8","\\blacktriangleright{}"],["25b9","\\triangleright{}"],["25bc","\\ding{116}"],["25bd","\\bigtriangledown{}"],["25be","\\blacktriangledown{}"],["25bf","\\triangledown{}"],["25c2","\\blacktriangleleft{}"],["25c3","\\triangleleft{}"],["25c6","\\ding{117}"],["25ca","\\lozenge{}"],["25cb","\\bigcirc{}"],["25cf","\\ding{108}"],["25d0","\\Elzcirfl{}"],["25d1","\\Elzcirfr{}"],["25d2","\\Elzcirfb{}"],["25d7","\\ding{119}"],["25d8","\\Elzrvbull{}"],["25e7","\\Elzsqfl{}"],["25e8","\\Elzsqfr{}"],["25ea","\\Elzsqfse{}"],["25ef","\\bigcirc{}"],["2605","\\ding{72}"],["2606","\\ding{73}"],["260e","\\ding{37}"],["261b","\\ding{42}"],["261e","\\ding{43}"],["263e","\\rightmoon{}"],["263f","\\mercury{}"],["2640","\\venus{}"],["2642","\\male{}"],["2643","\\jupiter{}"],["2644","\\saturn{}"],["2645","\\uranus{}"],["2646","\\neptune{}"],["2647","\\pluto{}"],["2648","\\aries{}"],["2649","\\taurus{}"],["264a","\\gemini{}"],["264b","\\cancer{}"],["264c","\\leo{}"],["264d","\\virgo{}"],["264e","\\libra{}"],["264f","\\scorpio{}"],["2650","\\sagittarius{}"],["2651","\\capricornus{}"],["2652","\\aquarius{}"],["2653","\\pisces{}"],["2660","\\ding{171}"],["2662","\\diamond{}"],["2663","\\ding{168}"],["2665","\\ding{170}"],["2666","\\ding{169}"],["2669","\\quarternote{}"],["266a","\\eighthnote{}"],["266d","\\flat{}"],["266e","\\natural{}"],["266f","\\sharp{}"],["2701","\\ding{33}"],["2702","\\ding{34}"],["2703","\\ding{35}"],["2704","\\ding{36}"],["2706","\\ding{38}"],["2707","\\ding{39}"],["2708","\\ding{40}"],["2709","\\ding{41}"],["270c","\\ding{44}"],["270d","\\ding{45}"],["270e","\\ding{46}"],["270f","\\ding{47}"],["2710","\\ding{48}"],["2711","\\ding{49}"],["2712","\\ding{50}"],["2713","\\ding{51}"],["2714","\\ding{52}"],["2715","\\ding{53}"],["2716","\\ding{54}"],["2717","\\ding{55}"],["2718","\\ding{56}"],["2719","\\ding{57}"],["271a","\\ding{58}"],["271b","\\ding{59}"],["271c","\\ding{60}"],["271d","\\ding{61}"],["271e","\\ding{62}"],["271f","\\ding{63}"],["2720","\\ding{64}"],["2721","\\ding{65}"],["2722","\\ding{66}"],["2723","\\ding{67}"],["2724","\\ding{68}"],["2725","\\ding{69}"],["2726","\\ding{70}"],["2727","\\ding{71}"],["2729","\\ding{73}"],["272a","\\ding{74}"],["272b","\\ding{75}"],["272c","\\ding{76}"],["272d","\\ding{77}"],["272e","\\ding{78}"],["272f","\\ding{79}"],["2730","\\ding{80}"],["2731","\\ding{81}"],["2732","\\ding{82}"],["2733","\\ding{83}"],["2734","\\ding{84}"],["2735","\\ding{85}"],["2736","\\ding{86}"],["2737","\\ding{87}"],["2738","\\ding{88}"],["2739","\\ding{89}"],["273a","\\ding{90}"],["273b","\\ding{91}"],["273c","\\ding{92}"],["273d","\\ding{93}"],["273e","\\ding{94}"],["273f","\\ding{95}"],["2740","\\ding{96}"],["2741","\\ding{97}"],["2742","\\ding{98}"],["2743","\\ding{99}"],["2744","\\ding{100}"],["2745","\\ding{101}"],["2746","\\ding{102}"],["2747","\\ding{103}"],["2748","\\ding{104}"],["2749","\\ding{105}"],["274a","\\ding{106}"],["274b","\\ding{107}"],["274d","\\ding{109}"],["274f","\\ding{111}"],["2750","\\ding{112}"],["2751","\\ding{113}"],["2752","\\ding{114}"],["2756","\\ding{118}"],["2758","\\ding{120}"],["2759","\\ding{121}"],["275a","\\ding{122}"],["275b","\\ding{123}"],["275c","\\ding{124}"],["275d","\\ding{125}"],["275e","\\ding{126}"],["2761","\\ding{161}"],["2762","\\ding{162}"],["2763","\\ding{163}"],["2764","\\ding{164}"],["2765","\\ding{165}"],["2766","\\ding{166}"],["2767","\\ding{167}"],["2776","\\ding{182}"],["2777","\\ding{183}"],["2778","\\ding{184}"],["2779","\\ding{185}"],["277a","\\ding{186}"],["277b","\\ding{187}"],["277c","\\ding{188}"],["277d","\\ding{189}"],["277e","\\ding{190}"],["277f","\\ding{191}"],["2780","\\ding{192}"],["2781","\\ding{193}"],["2782","\\ding{194}"],["2783","\\ding{195}"],["2784","\\ding{196}"],["2785","\\ding{197}"],["2786","\\ding{198}"],["2787","\\ding{199}"],["2788","\\ding{200}"],["2789","\\ding{201}"],["278a","\\ding{202}"],["278b","\\ding{203}"],["278c","\\ding{204}"],["278d","\\ding{205}"],["278e","\\ding{206}"],["278f","\\ding{207}"],["2790","\\ding{208}"],["2791","\\ding{209}"],["2792","\\ding{210}"],["2793","\\ding{211}"],["2794","\\ding{212}"],["2798","\\ding{216}"],["2799","\\ding{217}"],["279a","\\ding{218}"],["279b","\\ding{219}"],["279c","\\ding{220}"],["279d","\\ding{221}"],["279e","\\ding{222}"],["279f","\\ding{223}"],["27a0","\\ding{224}"],["27a1","\\ding{225}"],["27a2","\\ding{226}"],["27a3","\\ding{227}"],["27a4","\\ding{228}"],["27a5","\\ding{229}"],["27a6","\\ding{230}"],["27a7","\\ding{231}"],["27a8","\\ding{232}"],["27a9","\\ding{233}"],["27aa","\\ding{234}"],["27ab","\\ding{235}"],["27ac","\\ding{236}"],["27ad","\\ding{237}"],["27ae","\\ding{238}"],["27af","\\ding{239}"],["27b1","\\ding{241}"],["27b2","\\ding{242}"],["27b3","\\ding{243}"],["27b4","\\ding{244}"],["27b5","\\ding{245}"],["27b6","\\ding{246}"],["27b7","\\ding{247}"],["27b8","\\ding{248}"],["27b9","\\ding{249}"],["27ba","\\ding{250}"],["27bb","\\ding{251}"],["27bc","\\ding{252}"],["27bd","\\ding{253}"],["27be","\\ding{254}"],["27f5","\\longleftarrow{}"],["27f6","\\longrightarrow{}"],["27f7","\\longleftrightarrow{}"],["27f8","\\Longleftarrow{}"],["27f9","\\Longrightarrow{}"],["27fa","\\Longleftrightarrow{}"],["27fc","\\longmapsto{}"],["27ff","\\sim\\joinrel\\leadsto"],["2905","\\ElsevierGlyph{E212}"],["2912","\\UpArrowBar{}"],["2913","\\DownArrowBar{}"],["2923","\\ElsevierGlyph{E20C}"],["2924","\\ElsevierGlyph{E20D}"],["2925","\\ElsevierGlyph{E20B}"],["2926","\\ElsevierGlyph{E20A}"],["2927","\\ElsevierGlyph{E211}"],["2928","\\ElsevierGlyph{E20E}"],["2929","\\ElsevierGlyph{E20F}"],["292a","\\ElsevierGlyph{E210}"],["2933","\\ElsevierGlyph{E21C}"],["2936","\\ElsevierGlyph{E21A}"],["2937","\\ElsevierGlyph{E219}"],["2940","\\Elolarr{}"],["2941","\\Elorarr{}"],["2942","\\ElzRlarr{}"],["2944","\\ElzrLarr{}"],["2947","\\Elzrarrx{}"],["294e","\\LeftRightVector{}"],["294f","\\RightUpDownVector{}"],["2950","\\DownLeftRightVector{}"],["2951","\\LeftUpDownVector{}"],["2952","\\LeftVectorBar{}"],["2953","\\RightVectorBar{}"],["2954","\\RightUpVectorBar{}"],["2955","\\RightDownVectorBar{}"],["2956","\\DownLeftVectorBar{}"],["2957","\\DownRightVectorBar{}"],["2958","\\LeftUpVectorBar{}"],["2959","\\LeftDownVectorBar{}"],["295a","\\LeftTeeVector{}"],["295b","\\RightTeeVector{}"],["295c","\\RightUpTeeVector{}"],["295d","\\RightDownTeeVector{}"],["295e","\\DownLeftTeeVector{}"],["295f","\\DownRightTeeVector{}"],["2960","\\LeftUpTeeVector{}"],["2961","\\LeftDownTeeVector{}"],["296e","\\UpEquilibrium{}"],["296f","\\ReverseUpEquilibrium{}"],["2970","\\RoundImplies{}"],["297c","\\ElsevierGlyph{E214}"],["297d","\\ElsevierGlyph{E215}"],["2980","\\Elztfnc{}"],["2985","\\ElsevierGlyph{3018}"],["2986","\\Elroang{}"],["2993","<\\kern-0.58em("],["2994","\\ElsevierGlyph{E291}"],["2999","\\Elzddfnc{}"],["299c","\\Angle{}"],["29a0","\\Elzlpargt{}"],["29b5","\\ElsevierGlyph{E260}"],["29b6","\\ElsevierGlyph{E61B}"],["29ca","\\ElzLap{}"],["29cb","\\Elzdefas{}"],["29cf","\\LeftTriangleBar{}"],["29d0","\\RightTriangleBar{}"],["29dc","\\ElsevierGlyph{E372}"],["29eb","\\blacklozenge{}"],["29f4","\\RuleDelayed{}"],["2a04","\\Elxuplus{}"],["2a05","\\ElzThr{}"],["2a06","\\Elxsqcup{}"],["2a07","\\ElzInf{}"],["2a08","\\ElzSup{}"],["2a0d","\\ElzCint{}"],["2a0f","\\clockoint{}"],["2a10","\\ElsevierGlyph{E395}"],["2a16","\\sqrint{}"],["2a25","\\ElsevierGlyph{E25A}"],["2a2a","\\ElsevierGlyph{E25B}"],["2a2d","\\ElsevierGlyph{E25C}"],["2a2e","\\ElsevierGlyph{E25D}"],["2a2f","\\ElzTimes{}"],["2a34","\\ElsevierGlyph{E25E}"],["2a35","\\ElsevierGlyph{E25E}"],["2a3c","\\ElsevierGlyph{E259}"],["2a3f","\\amalg{}"],["2a53","\\ElzAnd{}"],["2a54","\\ElzOr{}"],["2a55","\\ElsevierGlyph{E36E}"],["2a56","\\ElOr{}"],["2a5e","\\perspcorrespond{}"],["2a5f","\\Elzminhat{}"],["2a63","\\ElsevierGlyph{225A}"],["2a6e","\\stackrel{*}{=}"],["2a75","\\Equal{}"],["2a7d","\\leqslant{}"],["2a7e","\\geqslant{}"],["2a85","\\lessapprox{}"],["2a86","\\gtrapprox{}"],["2a87","\\lneq{}"],["2a88","\\gneq{}"],["2a89","\\lnapprox{}"],["2a8a","\\gnapprox{}"],["2a8b","\\lesseqqgtr{}"],["2a8c","\\gtreqqless{}"],["2a95","\\eqslantless{}"],["2a96","\\eqslantgtr{}"],["2a9d","\\Pisymbol{ppi020}{117}"],["2a9e","\\Pisymbol{ppi020}{105}"],["2aa1","\\NestedLessLess{}"],["2aa2","\\NestedGreaterGreater{}"],["2aaf","\\preceq{}"],["2ab0","\\succeq{}"],["2ab5","\\precneqq{}"],["2ab6","\\succneqq{}"],["2ab7","\\precapprox{}"],["2ab8","\\succapprox{}"],["2ab9","\\precnapprox{}"],["2aba","\\succnapprox{}"],["2ac5","\\subseteqq{}"],["2ac6","\\supseteqq{}"],["2acb","\\subsetneqq{}"],["2acc","\\supsetneqq{}"],["2aeb","\\ElsevierGlyph{E30D}"],["2af6","\\Elztdcol{}"],["2afd","{{/}\\!\\!{/}}"],["300a","\\ElsevierGlyph{300A}"],["300b","\\ElsevierGlyph{300B}"],["3018","\\ElsevierGlyph{3018}"],["3019","\\ElsevierGlyph{3019}"],["301a","\\openbracketleft{}"],["301b","\\openbracketright{}"],["fb00","ff"],["fb01","fi"],["fb02","fl"],["fb03","ffi"],["fb04","ffl"],["d400","\\mathbf{A}"],["d401","\\mathbf{B}"],["d402","\\mathbf{C}"],["d403","\\mathbf{D}"],["d404","\\mathbf{E}"],["d405","\\mathbf{F}"],["d406","\\mathbf{G}"],["d407","\\mathbf{H}"],["d408","\\mathbf{I}"],["d409","\\mathbf{J}"],["d40a","\\mathbf{K}"],["d40b","\\mathbf{L}"],["d40c","\\mathbf{M}"],["d40d","\\mathbf{N}"],["d40e","\\mathbf{O}"],["d40f","\\mathbf{P}"],["d410","\\mathbf{Q}"],["d411","\\mathbf{R}"],["d412","\\mathbf{S}"],["d413","\\mathbf{T}"],["d414","\\mathbf{U}"],["d415","\\mathbf{V}"],["d416","\\mathbf{W}"],["d417","\\mathbf{X}"],["d418","\\mathbf{Y}"],["d419","\\mathbf{Z}"],["d41a","\\mathbf{a}"],["d41b","\\mathbf{b}"],["d41c","\\mathbf{c}"],["d41d","\\mathbf{d}"],["d41e","\\mathbf{e}"],["d41f","\\mathbf{f}"],["d420","\\mathbf{g}"],["d421","\\mathbf{h}"],["d422","\\mathbf{i}"],["d423","\\mathbf{j}"],["d424","\\mathbf{k}"],["d425","\\mathbf{l}"],["d426","\\mathbf{m}"],["d427","\\mathbf{n}"],["d428","\\mathbf{o}"],["d429","\\mathbf{p}"],["d42a","\\mathbf{q}"],["d42b","\\mathbf{r}"],["d42c","\\mathbf{s}"],["d42d","\\mathbf{t}"],["d42e","\\mathbf{u}"],["d42f","\\mathbf{v}"],["d430","\\mathbf{w}"],["d431","\\mathbf{x}"],["d432","\\mathbf{y}"],["d433","\\mathbf{z}"],["d434","\\mathsl{A}"],["d435","\\mathsl{B}"],["d436","\\mathsl{C}"],["d437","\\mathsl{D}"],["d438","\\mathsl{E}"],["d439","\\mathsl{F}"],["d43a","\\mathsl{G}"],["d43b","\\mathsl{H}"],["d43c","\\mathsl{I}"],["d43d","\\mathsl{J}"],["d43e","\\mathsl{K}"],["d43f","\\mathsl{L}"],["d440","\\mathsl{M}"],["d441","\\mathsl{N}"],["d442","\\mathsl{O}"],["d443","\\mathsl{P}"],["d444","\\mathsl{Q}"],["d445","\\mathsl{R}"],["d446","\\mathsl{S}"],["d447","\\mathsl{T}"],["d448","\\mathsl{U}"],["d449","\\mathsl{V}"],["d44a","\\mathsl{W}"],["d44b","\\mathsl{X}"],["d44c","\\mathsl{Y}"],["d44d","\\mathsl{Z}"],["d44e","\\mathsl{a}"],["d44f","\\mathsl{b}"],["d450","\\mathsl{c}"],["d451","\\mathsl{d}"],["d452","\\mathsl{e}"],["d453","\\mathsl{f}"],["d454","\\mathsl{g}"],["d456","\\mathsl{i}"],["d457","\\mathsl{j}"],["d458","\\mathsl{k}"],["d459","\\mathsl{l}"],["d45a","\\mathsl{m}"],["d45b","\\mathsl{n}"],["d45c","\\mathsl{o}"],["d45d","\\mathsl{p}"],["d45e","\\mathsl{q}"],["d45f","\\mathsl{r}"],["d460","\\mathsl{s}"],["d461","\\mathsl{t}"],["d462","\\mathsl{u}"],["d463","\\mathsl{v}"],["d464","\\mathsl{w}"],["d465","\\mathsl{x}"],["d466","\\mathsl{y}"],["d467","\\mathsl{z}"],["d468","\\mathbit{A}"],["d469","\\mathbit{B}"],["d46a","\\mathbit{C}"],["d46b","\\mathbit{D}"],["d46c","\\mathbit{E}"],["d46d","\\mathbit{F}"],["d46e","\\mathbit{G}"],["d46f","\\mathbit{H}"],["d470","\\mathbit{I}"],["d471","\\mathbit{J}"],["d472","\\mathbit{K}"],["d473","\\mathbit{L}"],["d474","\\mathbit{M}"],["d475","\\mathbit{N}"],["d476","\\mathbit{O}"],["d477","\\mathbit{P}"],["d478","\\mathbit{Q}"],["d479","\\mathbit{R}"],["d47a","\\mathbit{S}"],["d47b","\\mathbit{T}"],["d47c","\\mathbit{U}"],["d47d","\\mathbit{V}"],["d47e","\\mathbit{W}"],["d47f","\\mathbit{X}"],["d480","\\mathbit{Y}"],["d481","\\mathbit{Z}"],["d482","\\mathbit{a}"],["d483","\\mathbit{b}"],["d484","\\mathbit{c}"],["d485","\\mathbit{d}"],["d486","\\mathbit{e}"],["d487","\\mathbit{f}"],["d488","\\mathbit{g}"],["d489","\\mathbit{h}"],["d48a","\\mathbit{i}"],["d48b","\\mathbit{j}"],["d48c","\\mathbit{k}"],["d48d","\\mathbit{l}"],["d48e","\\mathbit{m}"],["d48f","\\mathbit{n}"],["d490","\\mathbit{o}"],["d491","\\mathbit{p}"],["d492","\\mathbit{q}"],["d493","\\mathbit{r}"],["d494","\\mathbit{s}"],["d495","\\mathbit{t}"],["d496","\\mathbit{u}"],["d497","\\mathbit{v}"],["d498","\\mathbit{w}"],["d499","\\mathbit{x}"],["d49a","\\mathbit{y}"],["d49b","\\mathbit{z}"],["d49c","\\mathscr{A}"],["d49e","\\mathscr{C}"],["d49f","\\mathscr{D}"],["d4a2","\\mathscr{G}"],["d4a5","\\mathscr{J}"],["d4a6","\\mathscr{K}"],["d4a9","\\mathscr{N}"],["d4aa","\\mathscr{O}"],["d4ab","\\mathscr{P}"],["d4ac","\\mathscr{Q}"],["d4ae","\\mathscr{S}"],["d4af","\\mathscr{T}"],["d4b0","\\mathscr{U}"],["d4b1","\\mathscr{V}"],["d4b2","\\mathscr{W}"],["d4b3","\\mathscr{X}"],["d4b4","\\mathscr{Y}"],["d4b5","\\mathscr{Z}"],["d4b6","\\mathscr{a}"],["d4b7","\\mathscr{b}"],["d4b8","\\mathscr{c}"],["d4b9","\\mathscr{d}"],["d4bb","\\mathscr{f}"],["d4bd","\\mathscr{h}"],["d4be","\\mathscr{i}"],["d4bf","\\mathscr{j}"],["d4c0","\\mathscr{k}"],["d4c1","\\mathscr{l}"],["d4c2","\\mathscr{m}"],["d4c3","\\mathscr{n}"],["d4c5","\\mathscr{p}"],["d4c6","\\mathscr{q}"],["d4c7","\\mathscr{r}"],["d4c8","\\mathscr{s}"],["d4c9","\\mathscr{t}"],["d4ca","\\mathscr{u}"],["d4cb","\\mathscr{v}"],["d4cc","\\mathscr{w}"],["d4cd","\\mathscr{x}"],["d4ce","\\mathscr{y}"],["d4cf","\\mathscr{z}"],["d4d0","\\mathmit{A}"],["d4d1","\\mathmit{B}"],["d4d2","\\mathmit{C}"],["d4d3","\\mathmit{D}"],["d4d4","\\mathmit{E}"],["d4d5","\\mathmit{F}"],["d4d6","\\mathmit{G}"],["d4d7","\\mathmit{H}"],["d4d8","\\mathmit{I}"],["d4d9","\\mathmit{J}"],["d4da","\\mathmit{K}"],["d4db","\\mathmit{L}"],["d4dc","\\mathmit{M}"],["d4dd","\\mathmit{N}"],["d4de","\\mathmit{O}"],["d4df","\\mathmit{P}"],["d4e0","\\mathmit{Q}"],["d4e1","\\mathmit{R}"],["d4e2","\\mathmit{S}"],["d4e3","\\mathmit{T}"],["d4e4","\\mathmit{U}"],["d4e5","\\mathmit{V}"],["d4e6","\\mathmit{W}"],["d4e7","\\mathmit{X}"],["d4e8","\\mathmit{Y}"],["d4e9","\\mathmit{Z}"],["d4ea","\\mathmit{a}"],["d4eb","\\mathmit{b}"],["d4ec","\\mathmit{c}"],["d4ed","\\mathmit{d}"],["d4ee","\\mathmit{e}"],["d4ef","\\mathmit{f}"],["d4f0","\\mathmit{g}"],["d4f1","\\mathmit{h}"],["d4f2","\\mathmit{i}"],["d4f3","\\mathmit{j}"],["d4f4","\\mathmit{k}"],["d4f5","\\mathmit{l}"],["d4f6","\\mathmit{m}"],["d4f7","\\mathmit{n}"],["d4f8","\\mathmit{o}"],["d4f9","\\mathmit{p}"],["d4fa","\\mathmit{q}"],["d4fb","\\mathmit{r}"],["d4fc","\\mathmit{s}"],["d4fd","\\mathmit{t}"],["d4fe","\\mathmit{u}"],["d4ff","\\mathmit{v}"],["d500","\\mathmit{w}"],["d501","\\mathmit{x}"],["d502","\\mathmit{y}"],["d503","\\mathmit{z}"],["d504","\\mathfrak{A}"],["d505","\\mathfrak{B}"],["d507","\\mathfrak{D}"],["d508","\\mathfrak{E}"],["d509","\\mathfrak{F}"],["d50a","\\mathfrak{G}"],["d50d","\\mathfrak{J}"],["d50e","\\mathfrak{K}"],["d50f","\\mathfrak{L}"],["d510","\\mathfrak{M}"],["d511","\\mathfrak{N}"],["d512","\\mathfrak{O}"],["d513","\\mathfrak{P}"],["d514","\\mathfrak{Q}"],["d516","\\mathfrak{S}"],["d517","\\mathfrak{T}"],["d518","\\mathfrak{U}"],["d519","\\mathfrak{V}"],["d51a","\\mathfrak{W}"],["d51b","\\mathfrak{X}"],["d51c","\\mathfrak{Y}"],["d51e","\\mathfrak{a}"],["d51f","\\mathfrak{b}"],["d520","\\mathfrak{c}"],["d521","\\mathfrak{d}"],["d522","\\mathfrak{e}"],["d523","\\mathfrak{f}"],["d524","\\mathfrak{g}"],["d525","\\mathfrak{h}"],["d526","\\mathfrak{i}"],["d527","\\mathfrak{j}"],["d528","\\mathfrak{k}"],["d529","\\mathfrak{l}"],["d52a","\\mathfrak{m}"],["d52b","\\mathfrak{n}"],["d52c","\\mathfrak{o}"],["d52d","\\mathfrak{p}"],["d52e","\\mathfrak{q}"],["d52f","\\mathfrak{r}"],["d530","\\mathfrak{s}"],["d531","\\mathfrak{t}"],["d532","\\mathfrak{u}"],["d533","\\mathfrak{v}"],["d534","\\mathfrak{w}"],["d535","\\mathfrak{x}"],["d536","\\mathfrak{y}"],["d537","\\mathfrak{z}"],["d538","\\mathbb{A}"],["d539","\\mathbb{B}"],["d53b","\\mathbb{D}"],["d53c","\\mathbb{E}"],["d53d","\\mathbb{F}"],["d53e","\\mathbb{G}"],["d540","\\mathbb{I}"],["d541","\\mathbb{J}"],["d542","\\mathbb{K}"],["d543","\\mathbb{L}"],["d544","\\mathbb{M}"],["d546","\\mathbb{O}"],["d54a","\\mathbb{S}"],["d54b","\\mathbb{T}"],["d54c","\\mathbb{U}"],["d54d","\\mathbb{V}"],["d54e","\\mathbb{W}"],["d54f","\\mathbb{X}"],["d550","\\mathbb{Y}"],["d552","\\mathbb{a}"],["d553","\\mathbb{b}"],["d554","\\mathbb{c}"],["d555","\\mathbb{d}"],["d556","\\mathbb{e}"],["d557","\\mathbb{f}"],["d558","\\mathbb{g}"],["d559","\\mathbb{h}"],["d55a","\\mathbb{i}"],["d55b","\\mathbb{j}"],["d55c","\\mathbb{k}"],["d55d","\\mathbb{l}"],["d55e","\\mathbb{m}"],["d55f","\\mathbb{n}"],["d560","\\mathbb{o}"],["d561","\\mathbb{p}"],["d562","\\mathbb{q}"],["d563","\\mathbb{r}"],["d564","\\mathbb{s}"],["d565","\\mathbb{t}"],["d566","\\mathbb{u}"],["d567","\\mathbb{v}"],["d568","\\mathbb{w}"],["d569","\\mathbb{x}"],["d56a","\\mathbb{y}"],["d56b","\\mathbb{z}"],["d56c","\\mathslbb{A}"],["d56d","\\mathslbb{B}"],["d56e","\\mathslbb{C}"],["d56f","\\mathslbb{D}"],["d570","\\mathslbb{E}"],["d571","\\mathslbb{F}"],["d572","\\mathslbb{G}"],["d573","\\mathslbb{H}"],["d574","\\mathslbb{I}"],["d575","\\mathslbb{J}"],["d576","\\mathslbb{K}"],["d577","\\mathslbb{L}"],["d578","\\mathslbb{M}"],["d579","\\mathslbb{N}"],["d57a","\\mathslbb{O}"],["d57b","\\mathslbb{P}"],["d57c","\\mathslbb{Q}"],["d57d","\\mathslbb{R}"],["d57e","\\mathslbb{S}"],["d57f","\\mathslbb{T}"],["d580","\\mathslbb{U}"],["d581","\\mathslbb{V}"],["d582","\\mathslbb{W}"],["d583","\\mathslbb{X}"],["d584","\\mathslbb{Y}"],["d585","\\mathslbb{Z}"],["d586","\\mathslbb{a}"],["d587","\\mathslbb{b}"],["d588","\\mathslbb{c}"],["d589","\\mathslbb{d}"],["d58a","\\mathslbb{e}"],["d58b","\\mathslbb{f}"],["d58c","\\mathslbb{g}"],["d58d","\\mathslbb{h}"],["d58e","\\mathslbb{i}"],["d58f","\\mathslbb{j}"],["d590","\\mathslbb{k}"],["d591","\\mathslbb{l}"],["d592","\\mathslbb{m}"],["d593","\\mathslbb{n}"],["d594","\\mathslbb{o}"],["d595","\\mathslbb{p}"],["d596","\\mathslbb{q}"],["d597","\\mathslbb{r}"],["d598","\\mathslbb{s}"],["d599","\\mathslbb{t}"],["d59a","\\mathslbb{u}"],["d59b","\\mathslbb{v}"],["d59c","\\mathslbb{w}"],["d59d","\\mathslbb{x}"],["d59e","\\mathslbb{y}"],["d59f","\\mathslbb{z}"],["d5a0","\\mathsf{A}"],["d5a1","\\mathsf{B}"],["d5a2","\\mathsf{C}"],["d5a3","\\mathsf{D}"],["d5a4","\\mathsf{E}"],["d5a5","\\mathsf{F}"],["d5a6","\\mathsf{G}"],["d5a7","\\mathsf{H}"],["d5a8","\\mathsf{I}"],["d5a9","\\mathsf{J}"],["d5aa","\\mathsf{K}"],["d5ab","\\mathsf{L}"],["d5ac","\\mathsf{M}"],["d5ad","\\mathsf{N}"],["d5ae","\\mathsf{O}"],["d5af","\\mathsf{P}"],["d5b0","\\mathsf{Q}"],["d5b1","\\mathsf{R}"],["d5b2","\\mathsf{S}"],["d5b3","\\mathsf{T}"],["d5b4","\\mathsf{U}"],["d5b5","\\mathsf{V}"],["d5b6","\\mathsf{W}"],["d5b7","\\mathsf{X}"],["d5b8","\\mathsf{Y}"],["d5b9","\\mathsf{Z}"],["d5ba","\\mathsf{a}"],["d5bb","\\mathsf{b}"],["d5bc","\\mathsf{c}"],["d5bd","\\mathsf{d}"],["d5be","\\mathsf{e}"],["d5bf","\\mathsf{f}"],["d5c0","\\mathsf{g}"],["d5c1","\\mathsf{h}"],["d5c2","\\mathsf{i}"],["d5c3","\\mathsf{j}"],["d5c4","\\mathsf{k}"],["d5c5","\\mathsf{l}"],["d5c6","\\mathsf{m}"],["d5c7","\\mathsf{n}"],["d5c8","\\mathsf{o}"],["d5c9","\\mathsf{p}"],["d5ca","\\mathsf{q}"],["d5cb","\\mathsf{r}"],["d5cc","\\mathsf{s}"],["d5cd","\\mathsf{t}"],["d5ce","\\mathsf{u}"],["d5cf","\\mathsf{v}"],["d5d0","\\mathsf{w}"],["d5d1","\\mathsf{x}"],["d5d2","\\mathsf{y}"],["d5d3","\\mathsf{z}"],["d5d4","\\mathsfbf{A}"],["d5d5","\\mathsfbf{B}"],["d5d6","\\mathsfbf{C}"],["d5d7","\\mathsfbf{D}"],["d5d8","\\mathsfbf{E}"],["d5d9","\\mathsfbf{F}"],["d5da","\\mathsfbf{G}"],["d5db","\\mathsfbf{H}"],["d5dc","\\mathsfbf{I}"],["d5dd","\\mathsfbf{J}"],["d5de","\\mathsfbf{K}"],["d5df","\\mathsfbf{L}"],["d5e0","\\mathsfbf{M}"],["d5e1","\\mathsfbf{N}"],["d5e2","\\mathsfbf{O}"],["d5e3","\\mathsfbf{P}"],["d5e4","\\mathsfbf{Q}"],["d5e5","\\mathsfbf{R}"],["d5e6","\\mathsfbf{S}"],["d5e7","\\mathsfbf{T}"],["d5e8","\\mathsfbf{U}"],["d5e9","\\mathsfbf{V}"],["d5ea","\\mathsfbf{W}"],["d5eb","\\mathsfbf{X}"],["d5ec","\\mathsfbf{Y}"],["d5ed","\\mathsfbf{Z}"],["d5ee","\\mathsfbf{a}"],["d5ef","\\mathsfbf{b}"],["d5f0","\\mathsfbf{c}"],["d5f1","\\mathsfbf{d}"],["d5f2","\\mathsfbf{e}"],["d5f3","\\mathsfbf{f}"],["d5f4","\\mathsfbf{g}"],["d5f5","\\mathsfbf{h}"],["d5f6","\\mathsfbf{i}"],["d5f7","\\mathsfbf{j}"],["d5f8","\\mathsfbf{k}"],["d5f9","\\mathsfbf{l}"],["d5fa","\\mathsfbf{m}"],["d5fb","\\mathsfbf{n}"],["d5fc","\\mathsfbf{o}"],["d5fd","\\mathsfbf{p}"],["d5fe","\\mathsfbf{q}"],["d5ff","\\mathsfbf{r}"],["d600","\\mathsfbf{s}"],["d601","\\mathsfbf{t}"],["d602","\\mathsfbf{u}"],["d603","\\mathsfbf{v}"],["d604","\\mathsfbf{w}"],["d605","\\mathsfbf{x}"],["d606","\\mathsfbf{y}"],["d607","\\mathsfbf{z}"],["d608","\\mathsfsl{A}"],["d609","\\mathsfsl{B}"],["d60a","\\mathsfsl{C}"],["d60b","\\mathsfsl{D}"],["d60c","\\mathsfsl{E}"],["d60d","\\mathsfsl{F}"],["d60e","\\mathsfsl{G}"],["d60f","\\mathsfsl{H}"],["d610","\\mathsfsl{I}"],["d611","\\mathsfsl{J}"],["d612","\\mathsfsl{K}"],["d613","\\mathsfsl{L}"],["d614","\\mathsfsl{M}"],["d615","\\mathsfsl{N}"],["d616","\\mathsfsl{O}"],["d617","\\mathsfsl{P}"],["d618","\\mathsfsl{Q}"],["d619","\\mathsfsl{R}"],["d61a","\\mathsfsl{S}"],["d61b","\\mathsfsl{T}"],["d61c","\\mathsfsl{U}"],["d61d","\\mathsfsl{V}"],["d61e","\\mathsfsl{W}"],["d61f","\\mathsfsl{X}"],["d620","\\mathsfsl{Y}"],["d621","\\mathsfsl{Z}"],["d622","\\mathsfsl{a}"],["d623","\\mathsfsl{b}"],["d624","\\mathsfsl{c}"],["d625","\\mathsfsl{d}"],["d626","\\mathsfsl{e}"],["d627","\\mathsfsl{f}"],["d628","\\mathsfsl{g}"],["d629","\\mathsfsl{h}"],["d62a","\\mathsfsl{i}"],["d62b","\\mathsfsl{j}"],["d62c","\\mathsfsl{k}"],["d62d","\\mathsfsl{l}"],["d62e","\\mathsfsl{m}"],["d62f","\\mathsfsl{n}"],["d630","\\mathsfsl{o}"],["d631","\\mathsfsl{p}"],["d632","\\mathsfsl{q}"],["d633","\\mathsfsl{r}"],["d634","\\mathsfsl{s}"],["d635","\\mathsfsl{t}"],["d636","\\mathsfsl{u}"],["d637","\\mathsfsl{v}"],["d638","\\mathsfsl{w}"],["d639","\\mathsfsl{x}"],["d63a","\\mathsfsl{y}"],["d63b","\\mathsfsl{z}"],["d63c","\\mathsfbfsl{A}"],["d63d","\\mathsfbfsl{B}"],["d63e","\\mathsfbfsl{C}"],["d63f","\\mathsfbfsl{D}"],["d640","\\mathsfbfsl{E}"],["d641","\\mathsfbfsl{F}"],["d642","\\mathsfbfsl{G}"],["d643","\\mathsfbfsl{H}"],["d644","\\mathsfbfsl{I}"],["d645","\\mathsfbfsl{J}"],["d646","\\mathsfbfsl{K}"],["d647","\\mathsfbfsl{L}"],["d648","\\mathsfbfsl{M}"],["d649","\\mathsfbfsl{N}"],["d64a","\\mathsfbfsl{O}"],["d64b","\\mathsfbfsl{P}"],["d64c","\\mathsfbfsl{Q}"],["d64d","\\mathsfbfsl{R}"],["d64e","\\mathsfbfsl{S}"],["d64f","\\mathsfbfsl{T}"],["d650","\\mathsfbfsl{U}"],["d651","\\mathsfbfsl{V}"],["d652","\\mathsfbfsl{W}"],["d653","\\mathsfbfsl{X}"],["d654","\\mathsfbfsl{Y}"],["d655","\\mathsfbfsl{Z}"],["d656","\\mathsfbfsl{a}"],["d657","\\mathsfbfsl{b}"],["d658","\\mathsfbfsl{c}"],["d659","\\mathsfbfsl{d}"],["d65a","\\mathsfbfsl{e}"],["d65b","\\mathsfbfsl{f}"],["d65c","\\mathsfbfsl{g}"],["d65d","\\mathsfbfsl{h}"],["d65e","\\mathsfbfsl{i}"],["d65f","\\mathsfbfsl{j}"],["d660","\\mathsfbfsl{k}"],["d661","\\mathsfbfsl{l}"],["d662","\\mathsfbfsl{m}"],["d663","\\mathsfbfsl{n}"],["d664","\\mathsfbfsl{o}"],["d665","\\mathsfbfsl{p}"],["d666","\\mathsfbfsl{q}"],["d667","\\mathsfbfsl{r}"],["d668","\\mathsfbfsl{s}"],["d669","\\mathsfbfsl{t}"],["d66a","\\mathsfbfsl{u}"],["d66b","\\mathsfbfsl{v}"],["d66c","\\mathsfbfsl{w}"],["d66d","\\mathsfbfsl{x}"],["d66e","\\mathsfbfsl{y}"],["d66f","\\mathsfbfsl{z}"],["d670","\\mathtt{A}"],["d671","\\mathtt{B}"],["d672","\\mathtt{C}"],["d673","\\mathtt{D}"],["d674","\\mathtt{E}"],["d675","\\mathtt{F}"],["d676","\\mathtt{G}"],["d677","\\mathtt{H}"],["d678","\\mathtt{I}"],["d679","\\mathtt{J}"],["d67a","\\mathtt{K}"],["d67b","\\mathtt{L}"],["d67c","\\mathtt{M}"],["d67d","\\mathtt{N}"],["d67e","\\mathtt{O}"],["d67f","\\mathtt{P}"],["d680","\\mathtt{Q}"],["d681","\\mathtt{R}"],["d682","\\mathtt{S}"],["d683","\\mathtt{T}"],["d684","\\mathtt{U}"],["d685","\\mathtt{V}"],["d686","\\mathtt{W}"],["d687","\\mathtt{X}"],["d688","\\mathtt{Y}"],["d689","\\mathtt{Z}"],["d68a","\\mathtt{a}"],["d68b","\\mathtt{b}"],["d68c","\\mathtt{c}"],["d68d","\\mathtt{d}"],["d68e","\\mathtt{e}"],["d68f","\\mathtt{f}"],["d690","\\mathtt{g}"],["d691","\\mathtt{h}"],["d692","\\mathtt{i}"],["d693","\\mathtt{j}"],["d694","\\mathtt{k}"],["d695","\\mathtt{l}"],["d696","\\mathtt{m}"],["d697","\\mathtt{n}"],["d698","\\mathtt{o}"],["d699","\\mathtt{p}"],["d69a","\\mathtt{q}"],["d69b","\\mathtt{r}"],["d69c","\\mathtt{s}"],["d69d","\\mathtt{t}"],["d69e","\\mathtt{u}"],["d69f","\\mathtt{v}"],["d6a0","\\mathtt{w}"],["d6a1","\\mathtt{x}"],["d6a2","\\mathtt{y}"],["d6a3","\\mathtt{z}"],["d6a8","\\mathbf{\\Alpha}"],["d6a9","\\mathbf{\\Beta}"],["d6aa","\\mathbf{\\Gamma}"],["d6ab","\\mathbf{\\Delta}"],["d6ac","\\mathbf{\\Epsilon}"],["d6ad","\\mathbf{\\Zeta}"],["d6ae","\\mathbf{\\Eta}"],["d6af","\\mathbf{\\Theta}"],["d6b0","\\mathbf{\\Iota}"],["d6b1","\\mathbf{\\Kappa}"],["d6b2","\\mathbf{\\Lambda}"],["d6b5","\\mathbf{\\Xi}"],["d6b7","\\mathbf{\\Pi}"],["d6b8","\\mathbf{\\Rho}"],["d6b9","\\mathbf{\\vartheta}"],["d6ba","\\mathbf{\\Sigma}"],["d6bb","\\mathbf{\\Tau}"],["d6bc","\\mathbf{\\Upsilon}"],["d6bd","\\mathbf{\\Phi}"],["d6be","\\mathbf{\\Chi}"],["d6bf","\\mathbf{\\Psi}"],["d6c0","\\mathbf{\\Omega}"],["d6c1","\\mathbf{\\nabla}"],["d6c2","\\mathbf{\\Alpha}"],["d6c3","\\mathbf{\\Beta}"],["d6c4","\\mathbf{\\Gamma}"],["d6c5","\\mathbf{\\Delta}"],["d6c6","\\mathbf{\\Epsilon}"],["d6c7","\\mathbf{\\Zeta}"],["d6c8","\\mathbf{\\Eta}"],["d6c9","\\mathbf{\\theta}"],["d6ca","\\mathbf{\\Iota}"],["d6cb","\\mathbf{\\Kappa}"],["d6cc","\\mathbf{\\Lambda}"],["d6cf","\\mathbf{\\Xi}"],["d6d1","\\mathbf{\\Pi}"],["d6d2","\\mathbf{\\Rho}"],["d6d3","\\mathbf{\\varsigma}"],["d6d4","\\mathbf{\\Sigma}"],["d6d5","\\mathbf{\\Tau}"],["d6d6","\\mathbf{\\Upsilon}"],["d6d7","\\mathbf{\\Phi}"],["d6d8","\\mathbf{\\Chi}"],["d6d9","\\mathbf{\\Psi}"],["d6da","\\mathbf{\\Omega}"],["d6db","\\partial{}"],["d6dc","\\in"],["d6dd","\\mathbf{\\vartheta}"],["d6de","\\mathbf{\\varkappa}"],["d6df","\\mathbf{\\phi}"],["d6e0","\\mathbf{\\varrho}"],["d6e1","\\mathbf{\\varpi}"],["d6e2","\\mathsl{\\Alpha}"],["d6e3","\\mathsl{\\Beta}"],["d6e4","\\mathsl{\\Gamma}"],["d6e5","\\mathsl{\\Delta}"],["d6e6","\\mathsl{\\Epsilon}"],["d6e7","\\mathsl{\\Zeta}"],["d6e8","\\mathsl{\\Eta}"],["d6e9","\\mathsl{\\Theta}"],["d6ea","\\mathsl{\\Iota}"],["d6eb","\\mathsl{\\Kappa}"],["d6ec","\\mathsl{\\Lambda}"],["d6ef","\\mathsl{\\Xi}"],["d6f1","\\mathsl{\\Pi}"],["d6f2","\\mathsl{\\Rho}"],["d6f3","\\mathsl{\\vartheta}"],["d6f4","\\mathsl{\\Sigma}"],["d6f5","\\mathsl{\\Tau}"],["d6f6","\\mathsl{\\Upsilon}"],["d6f7","\\mathsl{\\Phi}"],["d6f8","\\mathsl{\\Chi}"],["d6f9","\\mathsl{\\Psi}"],["d6fa","\\mathsl{\\Omega}"],["d6fb","\\mathsl{\\nabla}"],["d6fc","\\mathsl{\\Alpha}"],["d6fd","\\mathsl{\\Beta}"],["d6fe","\\mathsl{\\Gamma}"],["d6ff","\\mathsl{\\Delta}"],["d700","\\mathsl{\\Epsilon}"],["d701","\\mathsl{\\Zeta}"],["d702","\\mathsl{\\Eta}"],["d703","\\mathsl{\\Theta}"],["d704","\\mathsl{\\Iota}"],["d705","\\mathsl{\\Kappa}"],["d706","\\mathsl{\\Lambda}"],["d709","\\mathsl{\\Xi}"],["d70b","\\mathsl{\\Pi}"],["d70c","\\mathsl{\\Rho}"],["d70d","\\mathsl{\\varsigma}"],["d70e","\\mathsl{\\Sigma}"],["d70f","\\mathsl{\\Tau}"],["d710","\\mathsl{\\Upsilon}"],["d711","\\mathsl{\\Phi}"],["d712","\\mathsl{\\Chi}"],["d713","\\mathsl{\\Psi}"],["d714","\\mathsl{\\Omega}"],["d715","\\partial{}"],["d716","\\in"],["d717","\\mathsl{\\vartheta}"],["d718","\\mathsl{\\varkappa}"],["d719","\\mathsl{\\phi}"],["d71a","\\mathsl{\\varrho}"],["d71b","\\mathsl{\\varpi}"],["d71c","\\mathbit{\\Alpha}"],["d71d","\\mathbit{\\Beta}"],["d71e","\\mathbit{\\Gamma}"],["d71f","\\mathbit{\\Delta}"],["d720","\\mathbit{\\Epsilon}"],["d721","\\mathbit{\\Zeta}"],["d722","\\mathbit{\\Eta}"],["d723","\\mathbit{\\Theta}"],["d724","\\mathbit{\\Iota}"],["d725","\\mathbit{\\Kappa}"],["d726","\\mathbit{\\Lambda}"],["d729","\\mathbit{\\Xi}"],["d72b","\\mathbit{\\Pi}"],["d72c","\\mathbit{\\Rho}"],["d72d","\\mathbit{O}"],["d72e","\\mathbit{\\Sigma}"],["d72f","\\mathbit{\\Tau}"],["d730","\\mathbit{\\Upsilon}"],["d731","\\mathbit{\\Phi}"],["d732","\\mathbit{\\Chi}"],["d733","\\mathbit{\\Psi}"],["d734","\\mathbit{\\Omega}"],["d735","\\mathbit{\\nabla}"],["d736","\\mathbit{\\Alpha}"],["d737","\\mathbit{\\Beta}"],["d738","\\mathbit{\\Gamma}"],["d739","\\mathbit{\\Delta}"],["d73a","\\mathbit{\\Epsilon}"],["d73b","\\mathbit{\\Zeta}"],["d73c","\\mathbit{\\Eta}"],["d73d","\\mathbit{\\Theta}"],["d73e","\\mathbit{\\Iota}"],["d73f","\\mathbit{\\Kappa}"],["d740","\\mathbit{\\Lambda}"],["d743","\\mathbit{\\Xi}"],["d745","\\mathbit{\\Pi}"],["d746","\\mathbit{\\Rho}"],["d747","\\mathbit{\\varsigma}"],["d748","\\mathbit{\\Sigma}"],["d749","\\mathbit{\\Tau}"],["d74a","\\mathbit{\\Upsilon}"],["d74b","\\mathbit{\\Phi}"],["d74c","\\mathbit{\\Chi}"],["d74d","\\mathbit{\\Psi}"],["d74e","\\mathbit{\\Omega}"],["d74f","\\partial{}"],["d750","\\in"],["d751","\\mathbit{\\vartheta}"],["d752","\\mathbit{\\varkappa}"],["d753","\\mathbit{\\phi}"],["d754","\\mathbit{\\varrho}"],["d755","\\mathbit{\\varpi}"],["d756","\\mathsfbf{\\Alpha}"],["d757","\\mathsfbf{\\Beta}"],["d758","\\mathsfbf{\\Gamma}"],["d759","\\mathsfbf{\\Delta}"],["d75a","\\mathsfbf{\\Epsilon}"],["d75b","\\mathsfbf{\\Zeta}"],["d75c","\\mathsfbf{\\Eta}"],["d75d","\\mathsfbf{\\Theta}"],["d75e","\\mathsfbf{\\Iota}"],["d75f","\\mathsfbf{\\Kappa}"],["d760","\\mathsfbf{\\Lambda}"],["d763","\\mathsfbf{\\Xi}"],["d765","\\mathsfbf{\\Pi}"],["d766","\\mathsfbf{\\Rho}"],["d767","\\mathsfbf{\\vartheta}"],["d768","\\mathsfbf{\\Sigma}"],["d769","\\mathsfbf{\\Tau}"],["d76a","\\mathsfbf{\\Upsilon}"],["d76b","\\mathsfbf{\\Phi}"],["d76c","\\mathsfbf{\\Chi}"],["d76d","\\mathsfbf{\\Psi}"],["d76e","\\mathsfbf{\\Omega}"],["d76f","\\mathsfbf{\\nabla}"],["d770","\\mathsfbf{\\Alpha}"],["d771","\\mathsfbf{\\Beta}"],["d772","\\mathsfbf{\\Gamma}"],["d773","\\mathsfbf{\\Delta}"],["d774","\\mathsfbf{\\Epsilon}"],["d775","\\mathsfbf{\\Zeta}"],["d776","\\mathsfbf{\\Eta}"],["d777","\\mathsfbf{\\Theta}"],["d778","\\mathsfbf{\\Iota}"],["d779","\\mathsfbf{\\Kappa}"],["d77a","\\mathsfbf{\\Lambda}"],["d77d","\\mathsfbf{\\Xi}"],["d77f","\\mathsfbf{\\Pi}"],["d780","\\mathsfbf{\\Rho}"],["d781","\\mathsfbf{\\varsigma}"],["d782","\\mathsfbf{\\Sigma}"],["d783","\\mathsfbf{\\Tau}"],["d784","\\mathsfbf{\\Upsilon}"],["d785","\\mathsfbf{\\Phi}"],["d786","\\mathsfbf{\\Chi}"],["d787","\\mathsfbf{\\Psi}"],["d788","\\mathsfbf{\\Omega}"],["d789","\\partial{}"],["d78a","\\in"],["d78b","\\mathsfbf{\\vartheta}"],["d78c","\\mathsfbf{\\varkappa}"],["d78d","\\mathsfbf{\\phi}"],["d78e","\\mathsfbf{\\varrho}"],["d78f","\\mathsfbf{\\varpi}"],["d790","\\mathsfbfsl{\\Alpha}"],["d791","\\mathsfbfsl{\\Beta}"],["d792","\\mathsfbfsl{\\Gamma}"],["d793","\\mathsfbfsl{\\Delta}"],["d794","\\mathsfbfsl{\\Epsilon}"],["d795","\\mathsfbfsl{\\Zeta}"],["d796","\\mathsfbfsl{\\Eta}"],["d797","\\mathsfbfsl{\\vartheta}"],["d798","\\mathsfbfsl{\\Iota}"],["d799","\\mathsfbfsl{\\Kappa}"],["d79a","\\mathsfbfsl{\\Lambda}"],["d79d","\\mathsfbfsl{\\Xi}"],["d79f","\\mathsfbfsl{\\Pi}"],["d7a0","\\mathsfbfsl{\\Rho}"],["d7a1","\\mathsfbfsl{\\vartheta}"],["d7a2","\\mathsfbfsl{\\Sigma}"],["d7a3","\\mathsfbfsl{\\Tau}"],["d7a4","\\mathsfbfsl{\\Upsilon}"],["d7a5","\\mathsfbfsl{\\Phi}"],["d7a6","\\mathsfbfsl{\\Chi}"],["d7a7","\\mathsfbfsl{\\Psi}"],["d7a8","\\mathsfbfsl{\\Omega}"],["d7a9","\\mathsfbfsl{\\nabla}"],["d7aa","\\mathsfbfsl{\\Alpha}"],["d7ab","\\mathsfbfsl{\\Beta}"],["d7ac","\\mathsfbfsl{\\Gamma}"],["d7ad","\\mathsfbfsl{\\Delta}"],["d7ae","\\mathsfbfsl{\\Epsilon}"],["d7af","\\mathsfbfsl{\\Zeta}"],["d7b0","\\mathsfbfsl{\\Eta}"],["d7b1","\\mathsfbfsl{\\vartheta}"],["d7b2","\\mathsfbfsl{\\Iota}"],["d7b3","\\mathsfbfsl{\\Kappa}"],["d7b4","\\mathsfbfsl{\\Lambda}"],["d7b7","\\mathsfbfsl{\\Xi}"],["d7b9","\\mathsfbfsl{\\Pi}"],["d7ba","\\mathsfbfsl{\\Rho}"],["d7bb","\\mathsfbfsl{\\varsigma}"],["d7bc","\\mathsfbfsl{\\Sigma}"],["d7bd","\\mathsfbfsl{\\Tau}"],["d7be","\\mathsfbfsl{\\Upsilon}"],["d7bf","\\mathsfbfsl{\\Phi}"],["d7c0","\\mathsfbfsl{\\Chi}"],["d7c1","\\mathsfbfsl{\\Psi}"],["d7c2","\\mathsfbfsl{\\Omega}"],["d7c3","\\partial{}"],["d7c4","\\in"],["d7c5","\\mathsfbfsl{\\vartheta}"],["d7c6","\\mathsfbfsl{\\varkappa}"],["d7c7","\\mathsfbfsl{\\phi}"],["d7c8","\\mathsfbfsl{\\varrho}"],["d7c9","\\mathsfbfsl{\\varpi}"],["d7ce","\\mathbf{0}"],["d7cf","\\mathbf{1}"],["d7d0","\\mathbf{2}"],["d7d1","\\mathbf{3}"],["d7d2","\\mathbf{4}"],["d7d3","\\mathbf{5}"],["d7d4","\\mathbf{6}"],["d7d5","\\mathbf{7}"],["d7d6","\\mathbf{8}"],["d7d7","\\mathbf{9}"],["d7d8","\\mathbb{0}"],["d7d9","\\mathbb{1}"],["d7da","\\mathbb{2}"],["d7db","\\mathbb{3}"],["d7dc","\\mathbb{4}"],["d7dd","\\mathbb{5}"],["d7de","\\mathbb{6}"],["d7df","\\mathbb{7}"],["d7e0","\\mathbb{8}"],["d7e1","\\mathbb{9}"],["d7e2","\\mathsf{0}"],["d7e3","\\mathsf{1}"],["d7e4","\\mathsf{2}"],["d7e5","\\mathsf{3}"],["d7e6","\\mathsf{4}"],["d7e7","\\mathsf{5}"],["d7e8","\\mathsf{6}"],["d7e9","\\mathsf{7}"],["d7ea","\\mathsf{8}"],["d7eb","\\mathsf{9}"],["d7ec","\\mathsfbf{0}"],["d7ed","\\mathsfbf{1}"],["d7ee","\\mathsfbf{2}"],["d7ef","\\mathsfbf{3}"],["d7f0","\\mathsfbf{4}"],["d7f1","\\mathsfbf{5}"],["d7f2","\\mathsfbf{6}"],["d7f3","\\mathsfbf{7}"],["d7f4","\\mathsfbf{8}"],["d7f5","\\mathsfbf{9}"],["d7f6","\\mathtt{0}"],["d7f7","\\mathtt{1}"],["d7f8","\\mathtt{2}"],["d7f9","\\mathtt{3}"],["d7fa","\\mathtt{4}"],["d7fb","\\mathtt{5}"],["d7fc","\\mathtt{6}"],["d7fd","\\mathtt{7}"],["d7fe","\\mathtt{8}"],["d7ff","\\mathtt{9}"]]);function ye(m){let w=m;const g=[];w=w.replace(/\$[^$]+\$/g,J=>(g.push(J),`MATH.EXP.${g.length-1}`));let _="",H=!1;for(let J=0;J<w.length;J++){if(H){H=!1,_+=w[J];continue}if(w[J]==="\\"){H=!0,_+=w[J];continue}const T=w.charCodeAt(J).toString(16).padStart(4,"0");_+=Fe.get(T)??w[J]}return _.replace(/MATH\.EXP\.(\d+)/g,(J,T)=>g[Number(T)]??"")}r(ye,"escapeSpecialCharacters");function W(m){return m.replace(/(\w)(\S*)/g,(w,g,_)=>{const H=g+_;return U(H)?H:g.toLocaleUpperCase()+_.toLocaleLowerCase()})}r(W,"titleCase");function U(m){return/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/.test(m)}r(U,"isRomanNumeral");function ve(m){return m.replace(/[^0-9A-Za-z]/g,"").toLocaleLowerCase()}r(ve,"alphaNum");function pe(m){return m.replace(/\r\n?/g,`
|
|
17
|
-
`)}r(pe,"convertCRLF");function B(m,w){const g=m.split(" "),_=[];let H="";for(const[J,T]of g.entries())H.length+T.length+1>w&&J>0&&(_.push(H.trim()),H=""),H+=`${T} `;return[..._,H.trim()]}r(B,"wrapText");function ue(m){return m.replace(/\s*\n\s*\n\s*/g,"<<BIBTEX_TIDY_PARA>>").replace(/\s*\n\s*/g," ").replace(/<<BIBTEX_TIDY_PARA>>/g,`
|
|
18
|
-
|
|
19
|
-
`)}r(ue,"unwrapText");function De(m){const w=L(m),g=w.children.length===1&&w.children[0]?.type==="block"&&w.children[0]?.kind==="curly"&&w.children[0].children.length===1&&w.children[0].children[0]?.type==="block"&&w.children[0].children[0]?.kind==="curly",_=S(w);return g?_:`{${_}}`}r(De,"doubleEnclose");function Me(m){return m.replace(/^\{([^{}]*)\}$/g,"$1")}r(Me,"removeEnclosingBraces");function j(m){return m.replace(/\\?_/g,"\\%5F")}r(j,"escapeURL");function ae(m,w){const g=m.split(" and ");return g.length>w?[...g.slice(0,w),"others"].join(" and "):m}r(ae,"limitAuthors");function ge(m){let w=m;for(let g=0;g<4;g++)w=w.replace(/(\d)\s*-\s*(\d)/g,"$1--$2");return w}r(ge,"formatPageRange");function We(m){return m.type!=="text"&&m.block?.type==="entry"}r(We,"isEntryNode");function Oe(m,w,g,_){const H=new Map;if(g)for(const Be of g)H.set(Be,!!_);H.has("key")||H.set("key",!1);const J=new Set,T=[],fe=new Map,be=new Map,Le=new Map,Ee=new Map;for(const Be of Vt(m)){const Ft=w.get(Be);if(Ft)for(const[jt,Wt]of H){let Ne,qe;switch(jt){case"key":{if(!Be.key)continue;const _e=Be.key.toLocaleLowerCase();Ne=fe.get(_e),Ne?qe=`The citation key ${Be.key} has already been used.`:fe.set(_e,Be);break}case"doi":{const _e=ve(Ft.get("doi")??"");if(!_e)continue;Ne=be.get(_e),Ne?qe=`Entry ${Be.key} has an identical DOI to entry ${Ne.key}.`:be.set(_e,Be);break}case"citation":{const _e=Ft.get("title"),Ot=Ft.get("author"),Zt=Ft.get("number");if(!_e||!Ot)continue;const ot=[ve(A(Ot)[0]?.lastName??Ot),ve(_e),ve(Zt??"0")].join(":");Ne=Le.get(ot),Ne?qe=`Entry ${Be.key} has similar content to entry ${Ne.key}.`:Le.set(ot,Be);break}case"abstract":{const Ot=ve(Ft.get("abstract")??"").slice(0,100);if(!Ot)continue;Ne=Ee.get(Ot),Ne?qe=`Entry ${Be.key} has a similar abstract to entry ${Ne.key}.`:Ee.set(Ot,Be);break}}Ne&&Wt&&(J.add(Be),Ve(_,Ne,Be)),qe&&T.push({code:"DUPLICATE_ENTRY",rule:jt,message:`Duplicate ${Wt?"removed":"detected"}. ${qe}`})}}return{entries:J,warnings:T}}r(Oe,"checkForDuplicates");function Ve(m,w,g){if(m)switch(m){case"last":w.key=g.key,w.fields=g.fields;break;case"combine":case"overwrite":for(const _ of g.fields){const H=w.fields.find(J=>J.name.toLocaleLowerCase()===_.name.toLocaleLowerCase());H?m==="overwrite"&&(H.value=_.value):w.fields.push(_)}break;case"first":return}}r(Ve,"mergeEntries");var ht=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],me=new Set(ht),xt={1:"jan",2:"feb",3:"mar",4:"apr",5:"may",6:"jun",7:"jul",8:"aug",9:"sep",10:"oct",11:"nov",12:"dec",jan:"jan",feb:"feb",mar:"mar",apr:"apr",may:"may",jun:"jun",jul:"jul",aug:"aug",sep:"sep",oct:"oct",nov:"nov",dec:"dec",january:"jan",february:"feb",march:"mar",april:"apr",june:"jun",july:"jul",august:"aug",september:"sep",october:"oct",november:"nov",december:"dec"},vt=["url","doi","eprint","file","verba","verbb","verbc","pdf"];function it(m,w,g){const{omit:_,tab:H,space:J}=w,T=H?" ":" ".repeat(J),fe=new Set(_);let be=m.children.map(Le=>ze(Le,w,T,fe,g)).join("").trimEnd();return be.endsWith(`
|
|
20
|
-
`)||(be+=`
|
|
21
|
-
`),be}r(it,"formatBibtex");function ze(m,w,g,_,H){if(m.type==="text")return R(m.text,w);if(!m.block)throw new Error("FATAL!");switch(m.block.type){case"preamble":case"string":return`${m.block.raw}
|
|
22
|
-
${w.blankLines?`
|
|
23
|
-
`:""}`;case"comment":return R(m.block.raw,w);case"entry":return Rt(m.command,m.block,w,g,_,H?.get(m.block))+(w.blankLines?`
|
|
24
|
-
`:"")}}r(ze,"formatNode");function Rt(m,w,g,_,H,J){const{align:T,trailingCommas:fe,removeDuplicateFields:be,removeEmptyFields:Le,lowercase:Ee}=g;let Be="";const Ft=Ee?m.toLocaleLowerCase():m;Be+=`@${Ft}{`;const jt=J??w.key;jt&&(Be+=`${jt},`);const Wt=new Set;for(const[Ne,qe]of w.fields.entries()){const _e=qe.name.toLocaleLowerCase(),Ot=Ee?_e:qe.name;if(qe.name!==""&&!H.has(_e)&&!(be&&Wt.has(_e))){if(Wt.add(_e),qe.value.concat.length===0){if(Le)continue;Be+=`
|
|
25
|
-
${_}${Ot}`}else{const Zt=Q(qe,g);if(Le&&(Zt==="{}"||Zt==='""'))continue;Be+=`
|
|
26
|
-
${_}${Ot.trim().padEnd(T-1)} = ${Zt}`}(Ne<w.fields.length-1||fe)&&(Be+=",")}}return Be+=`
|
|
27
|
-
}
|
|
28
|
-
`,Be}r(Rt,"formatEntry");function R(m,{stripComments:w,tidyComments:g}){if(w)return"";if(g){const _=m.trim();return _===""?"":`${_}
|
|
29
|
-
`}return m.replace(/^[ \t]*\n|[ \t]*$/g,"")}r(R,"formatComment");function Q(m,w){const{curly:g,numeric:_,align:H,stripEnclosingBraces:J,dropAllCaps:T,escape:fe,encodeUrls:be,wrap:Le,maxAuthors:Ee,tab:Be,space:Ft,enclosingBraces:jt,removeBraces:Wt,months:Ne}=w,qe=m.name.toLocaleLowerCase(),_e=Be?" ":" ".repeat(Ft),Ot=new Set((jt??[]).map(ot=>ot.toLocaleLowerCase())),Zt=new Set((Wt??[]).map(ot=>ot.toLocaleLowerCase()));return m.value.concat.map(({type:ot,value:$e})=>{const nt=$e.match(/^[1-9][0-9]*$/);if(nt&&g&&(ot="braced"),Ne&&qe==="month"){const vn=xt[$e.toLowerCase()];if(vn)return vn}if(ot==="literal"||_&&nt)return $e;const Pn=$e.slice(0,3).toLowerCase(),fs=qe==="month"&&me.has(Pn);if(!g&&_&&fs)return Pn;if($e=ue($e),J&&($e=Me($e)),T&&!$e.match(/[a-z]/)&&($e=W($e)),qe==="url"&&be&&($e=j($e)),!vt.includes(qe)&&fe&&($e=ye($e)),qe==="pages"&&($e=ge($e)),qe==="author"&&Ee&&($e=ae($e,Ee)),Zt.has(qe)&&($e=S(xe(L($e)))),Ot.has(qe)&&(ot==="braced"||g)&&($e=De($e)),ot==="braced"&&m.value.concat.length===1&&($e=$e.trim()),ot==="braced"||g){const vn=`${_e}${H}{${$e}}`.length,Yn=$e.includes(`
|
|
30
|
-
|
|
31
|
-
`);if(Le&&vn>Le||Yn){let _n=$e.split(`
|
|
32
|
-
|
|
33
|
-
`);const An=_e.repeat(2);if(Le){const tr=Le;_n=_n.map(ms=>B(ms,tr-An.length).join(`
|
|
34
|
-
${An}`))}$e=`
|
|
35
|
-
${An}${_n.join(`
|
|
36
|
-
|
|
37
|
-
${An}`)}
|
|
38
|
-
${_e}`}return De($e)}return`"${$e}"`}).join(" # ")}r(Q,"formatValue");var V={auth:{description:"Last name of first authors",callback:r(m=>{const g=A(m.get("author")??"",!0)[0]?.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_");return g?[g]:[]},"callback")},authEtAl:{description:"If 1 or 2 authors, both authors, otherwise first author and EtAl",callback:r(m=>{const w=A(m.get("author")??"",!0);return[...w.slice(0,2).map(g=>g.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_")),...w.length>2?["Et","Al"]:[]]},"callback")},authors:{description:"Last name all authors",callback:r(m=>A(m.get("author")??"",!0).map(g=>g.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_")),"callback")},authorsN:{description:"Last name N authors, with EtAl if more",callback:r((m,w=0)=>{const g=A(m.get("author")??"",!0);return[...g.slice(0,w).map(_=>_.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_")),...g.length>w?["Et","Al"]:[]]},"callback")},veryshorttitle:{description:"First non-function word of the title",callback:r(m=>ct(Ce(m)).slice(0,1),"callback")},shorttitle:{description:"First three non-function words of the title",callback:r(m=>ct(Ce(m)).slice(0,3),"callback")},title:{description:"Full title, capitalized",callback:r(m=>ft(de(Ce(m))),"callback")},fulltitle:{description:"Full title, verbatim",callback:r(m=>de(Ce(m)),"callback")},year:{description:"Year",callback:r(m=>{const w=m.get("year")?.replace(/[^0-9]/g,"");return w?[w]:[]},"callback")},duplicateLetter:{description:"If the multiple entries end up with the same key, then insert a letter a-z. By default this will be inserted at the end.",callback:r(()=>["[duplicateLetter]"],"callback")},duplicateNumber:{description:"If the multiple entries end up with the same key, then insert a number.",callback:r(()=>["[duplicateNumber]"],"callback")}},Ye={required:{description:"If data is missing, revert to existing key",callback:r(m=>{if(m.length===0)throw new Ge;return m},"callback")},lower:{description:"Convert to lowercase",callback:r(m=>m.map(w=>w.toLocaleLowerCase()),"callback")},upper:{description:"Convert to uppercase",callback:r(m=>m.map(w=>w.toLocaleUpperCase()),"callback")},capitalize:{description:"Capitalize first letter of each word",callback:ft}},Ge=class extends Error{static{r(this,"MissingRequiredData")}};function je(m,w,g){let _=g;!g.includes("[duplicateLetter]")&&!g.includes("[duplicateNumber]")&&(_=`${g}[duplicateLetter]`);const H=new Map;for(const T of m.children)if(We(T)){const fe=w.get(T.block);if(!fe)continue;const be=at(fe,_);if(!be)continue;const Le=H.get(be)??[];H.set(be,[...Le,T.block])}const J=new Map;for(const[T,fe]of H)for(const[be,Le]of fe.entries()){const Ee=fe.length>1?String.fromCharCode(97+be):"",Be=fe.length>1?String(be+1):"";Le.key=T.replace(/\[duplicateLetter\]/g,Ee).replace(/\[duplicateNumber\]/g,Be)}return J}r(je,"generateKeys");function at(m,w){try{const g=w.replace(/\[[^:\]]+(?::[^:\]]+)*\]/g,_=>{const[H,...J]=_.slice(1,-1).split(":");if(!H)throw new Error("Token parse error");let T;const fe=H.replace(/[0-9]+/g,Ee=>(T=Number(Ee),"N")),be=V[fe];let Le;if(be)Le=be.callback(m,T);else if(fe===fe.toLocaleUpperCase()){const Ee=m.get(fe.toLocaleLowerCase());Le=Ee?de(Ee):[]}else throw new Error(`Invalid citation key token ${fe}`);for(const Ee of J){const Be=Ye[Ee];if(Be)Le=Be.callback(Le);else throw new Error(`Invalid modifier ${Ee}`)}return Le.join("")});return g===""?void 0:g}catch(g){if(g instanceof Ge)return;throw g}}r(at,"generateKey");var tt=new Set(["a","about","above","across","against","along","among","an","and","around","at","before","behind","below","beneath","beside","between","beyond","but","by","down","during","except","for","for","from","in","inside","into","like","near","nor","of","off","on","onto","or","since","so","the","through","to","toward","under","until","up","upon","with","within","without","yet"]);function ct(m){return de(m).filter(w=>!tt.has(w.toLocaleLowerCase()))}r(ct,"nonFunctionWords");function de(m){return m.split(/(?:[\0-\/:-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/).filter(w=>w.length>0)}r(de,"words");function ft(m){return m.map(w=>w.slice(0,1).toLocaleUpperCase()+w.slice(1).toLocaleLowerCase())}r(ft,"capitalize");function Ce(m){return m.get("title")??m.get("booktitle")??""}r(Ce,"title");var Dt=["doi","citation","abstract"],ee=14,oe=2,et=80,gt=["title","shorttitle","author","year","month","day","journal","booktitle","location","on","publisher","address","series","volume","number","pages","doi","isbn","issn","url","urldate","copyright","category","note","metadata"],mt=["key"],At="[auth:required:lower][year:required][veryshorttitle:lower][duplicateNumber]",kt=[{key:"help",cli:{"--help":!0,"-h":!0},title:"Help",description:["Show help"],type:"boolean"},{key:"v2",cli:{"--v2":!0},title:"Enable planned v2 CLI changes",description:["Input files will no longer be modified by default. Instead, you will need to specify `--modify`/`-m` option to overwrite the file, or `--output`/`-o` to output to a different file."],type:"string",defaultValue:void 0},{key:"outputPath",cli:{"--output":r(m=>m[0],"--output"),"-o":r(m=>m[0],"-o")},title:"Output path",description:["Write output to specified path. When omitted (and -m/--modify is not used), the result will be printed to stdout."],type:"string",defaultValue:void 0},{key:"modify",cli:{"--modify":!0,"-m":!0,"--no-modify":!1},title:"Modify input files",description:["Overwrite the original input files with the tidied result. This is enabled by default but will be disabled by default in v2. For v1, use --no-modify to output to stdout instead of overwriting the input files."],type:"boolean",defaultValue:!0},{key:"omit",cli:{"--omit":r(m=>(m.length===0&&(console.error("Expected a omit list"),process.exit(1)),m),"--omit")},toCLI:r(m=>Array.isArray(m)&&m.length>0?`--omit=${m.join(",")}`:void 0,"toCLI"),title:"Remove fields",description:["Remove specified fields from bibliography entries."],examples:["--omit=id,name"],type:"string[]",defaultValue:[]},{key:"curly",cli:{"--curly":!0,"--no-curly":!1},toCLI:r(m=>m?"--curly":void 0,"toCLI"),title:"Enclose values in braces",description:['Enclose all property values in braces. Quoted values will be converted to braces. For example, "Journal of Tea" will become {Journal of Tea}.'],type:"boolean",defaultValue:!1},{key:"numeric",cli:{"--numeric":!0,"--no-numeric":!1},toCLI:r(m=>m?"--numeric":void 0,"toCLI"),title:"Use numeric values where possible",description:["Strip quotes and braces from numeric/month values. For example, {1998} will become 1998."],type:"boolean",defaultValue:!1},{key:"months",cli:{"--months":!0},toCLI:r(m=>m?"--months":void 0,"toCLI"),title:"Abbreviate months",description:["Convert all months to three letter abbreviations (jan, feb, etc)."],type:"boolean",defaultValue:!1},{key:"space",cli:{"--space":r(m=>m.length>0?Number(m[0]):!0,"--space")},toCLI:r((m,w)=>{if(!w.tab){if(typeof m=="number"&&m!==oe)return`--space=${m}`;if(m&&m!==oe)return"--space"}},"toCLI"),title:"Indent with spaces",description:["Indent all fields with the specified number of spaces. Ignored if tab is set."],examples:["--space=2 (default)","--space=4"],type:"boolean | number",convertBoolean:{true:oe,false:void 0},defaultValue:oe},{key:"tab",cli:{"--tab":!0,"--no-tab":!1},toCLI:r(m=>m?"--tab":void 0,"toCLI"),title:"Indent with tabs",description:["Indent all fields with a tab."],type:"boolean",defaultValue:!1},{key:"align",cli:{"--align":r(m=>Number(m[0]),"--align"),"--no-align":!1},toCLI:r(m=>{if(m===!1||m===1||m===0)return"--no-align";if(typeof m=="number"&&m!==ee)return`--align=${m}`},"toCLI"),title:"Align values",description:["Insert whitespace between fields and values so that values are visually aligned."],examples:["--align=14 (default)"],type:"boolean | number",convertBoolean:{true:ee,false:1},defaultValue:ee},{key:"blankLines",cli:{"--blank-lines":!0,"--no-blank-lines":!1},toCLI:r(m=>m?"--blank-lines":void 0,"toCLI"),title:"Insert blank lines",description:["Insert an empty line between each entry."],type:"boolean"},{key:"sort",cli:{"--sort":r(m=>m.length>0?m:!0,"--sort"),"--no-sort":!1},toCLI:r(m=>{if(Array.isArray(m)&&m.length>0)return`--sort=${m.join(",")}`;if(m===!0)return"--sort"},"toCLI"),title:"Sort bibliography entries",description:["Sort entries by the specified field names (citation key is used if no fields are specified). For descending order, prefix the field with a dash (-).","Multiple fields may be specified to sort everything by first field, then by the second field whenever the first field for entries are equal, etc.","The following additional fields are also permitted: key (entry citation key), type (sorts by the type of entry, e.g. article), and special (ensures that @string, @preamble, @set, and @xdata entries are first). "],examples:["--sort (sort by citation key)","--sort=-year,name (sort year descending then name ascending)","--sort=name,year"],type:"boolean | string[]",convertBoolean:{true:mt,false:void 0}},{key:"duplicates",cli:{"--duplicates":r(m=>{if(m.length===0)return!0;for(const w of m)w!=="doi"&&w!=="key"&&w!=="abstract"&&w!=="citation"&&(console.error(`Invalid key for merge option: "${w}"`),process.exit(1));return m},"--duplicates")},toCLI:r(m=>{if(Array.isArray(m)&&m.length>0)return`--duplicates=${m.join(",")}`;if(m===!0)return"--duplicates"},"toCLI"),title:"Check for duplicates",description:["Warn if duplicates are found, which are entries where DOI, abstract, or author and title are the same."],examples:["--duplicates doi (same DOIs)","--duplicates key (same IDs)","--duplicates abstract (similar abstracts)","--duplicates citation (similar author and titles)","--duplicates doi, key (identical DOI or keys)","--duplicates (same DOI, key, abstract, or citation)"],type:"boolean | ('doi' | 'key' | 'abstract' | 'citation')[]",convertBoolean:{true:Dt,false:void 0},defaultValue:r(m=>m.merge?Dt:void 0,"defaultValue")},{key:"merge",cli:{"--merge":r(m=>m.length===0?!0:(m[0]!=="first"&&m[0]!=="last"&&m[0]!=="combine"&&m[0]!=="overwrite"&&(console.error(`Invalid merge strategy: "${m[0]}"`),process.exit(1)),m[0]),"--merge"),"--no-merge":!1},toCLI:r(m=>{if(typeof m=="string")return`--merge=${m}`;if(m)return"--merge"},"toCLI"),title:"Merge duplicate entries",description:["Merge duplicates entries. Use the duplicates option to determine how duplicates are identified. There are different ways to merge:","- first: only keep the original entry","- last: only keep the last found duplicate","- combine: keep original entry and merge in fields of duplicates if they do not already exist","- overwrite: keep original entry and merge in fields of duplicates, overwriting existing fields if they exist"],type:"boolean | 'first' | 'last' | 'combine' | 'overwrite'",convertBoolean:{true:"combine",false:void 0}},{key:"stripEnclosingBraces",cli:{"--strip-enclosing-braces":!0},toCLI:r(m=>m?"--strip-enclosing-braces":void 0,"toCLI"),title:"Strip double-braced values",description:["Where an entire value is enclosed in double braces, remove the extra braces. For example, {{Journal of Tea}} will become {Journal of Tea}."],type:"boolean",defaultValue:!1},{key:"dropAllCaps",cli:{"--drop-all-caps":!0},toCLI:r(m=>m?"--drop-all-caps":void 0,"toCLI"),title:"Drop all caps",description:["Where values are all caps, make them title case. For example, {JOURNAL OF TEA} will become {Journal of Tea}. Roman numerals will be left unchanged."],type:"boolean",defaultValue:!1},{key:"escape",cli:{"--escape":!0,"--no-escape":!1},toCLI:r(m=>m===!1?"--no-escape":void 0,"toCLI"),title:"Escape special characters",description:["Escape special characters, such as umlaut. This ensures correct typesetting with latex. Enabled by default."],type:"boolean",defaultValue:!0},{key:"sortFields",cli:{"--sort-fields":r(m=>m.length>0?m:!0,"--sort-fields")},toCLI:r(m=>{if(Array.isArray(m)&&m.length>0)return JSON.stringify(m)===JSON.stringify(gt)?"--sort-fields":`--sort-fields=${m.join(",")}`;if(m===!0)return"--sort-fields"},"toCLI"),title:"Sort fields",description:["Sort the fields within entries.","If no fields are specified fields will be sorted by: title, shorttitle, author, year, month, day, journal, booktitle, location, on, publisher, address, series, volume, number, pages, doi, isbn, issn, url, urldate, copyright, category, note, metadata"],examples:["--sort-fields=name,author"],type:"boolean | string[]",convertBoolean:{true:gt,false:void 0},defaultValue:void 0},{key:"sortProperties",cli:{"--sort-properties":r(m=>m.length>0?m:!0,"--sort-properties")},title:"Sort properties",description:["Alias of sort fields (legacy)"],type:"boolean | string[]",deprecated:!0},{key:"stripComments",cli:{"--strip-comments":!0,"--no-strip-comments":!1},toCLI:r(m=>m?"--strip-comments":void 0,"toCLI"),title:"Remove comments",description:["Remove all comments from the bibtex source."],type:"boolean",defaultValue:!1},{key:"trailingCommas",cli:{"--trailing-commas":!0,"--no-trailing-commas":!0},toCLI:r(m=>m?"--trailing-commas":void 0,"toCLI"),title:"Trailing commas",description:["End the last key value pair in each entry with a comma."],type:"boolean",defaultValue:!1},{key:"encodeUrls",cli:{"--encode-urls":!0,"--no-encode-urls":!0},toCLI:r(m=>m?"--encode-urls":void 0,"toCLI"),title:"Encode URLs",description:["Replace invalid URL characters with percent encoded values."],type:"boolean",defaultValue:!1},{key:"tidyComments",cli:{"--tidy-comments":!0,"--no-tidy-comments":!1},toCLI:r(m=>m===!1?"--no-tidy-comments":void 0,"toCLI"),title:"Tidy comments",description:["Remove whitespace surrounding comments."],type:"boolean",defaultValue:!0},{key:"removeEmptyFields",cli:{"--remove-empty-fields":!0,"--no-remove-empty-fields":!1},toCLI:r(m=>m?"--remove-empty-fields":void 0,"toCLI"),title:"Remove empty fields",description:["Remove any fields that have empty values."],type:"boolean",defaultValue:!1},{key:"removeDuplicateFields",cli:{"--remove-dupe-fields":!0,"--no-remove-dupe-fields":!1},toCLI:r(m=>m===!1?"--no-remove-dupe-fields":void 0,"toCLI"),title:"Remove duplicate fields",description:["Only allow one of each field in each entry. Enabled by default."],type:"boolean",defaultValue:!0},{key:"generateKeys",cli:{"--generate-keys":r(m=>m.length>0?m:!0,"--generate-keys")},toCLI:r(m=>{if(m===!0||m===At)return"--generate-keys";if(typeof m=="string")return`--generate-keys="${m.replace(/"/g,'\\"')}"`},"toCLI"),title:"Generate citation keys [Experimental]",description:["For all entries replace the key with a new key of the form <author><year><title>. A JabRef citation pattern can be provided. This is an experimental option that may change without warning."],type:"boolean | string",convertBoolean:{true:At,false:void 0},defaultValue:void 0},{key:"maxAuthors",cli:{"--max-authors":r(m=>Number(m[0]),"--max-authors")},toCLI:r(m=>m?`--max-authors=${m}`:void 0,"toCLI"),title:"Maximum authors",description:['Truncate authors if above a given number into "and others".'],type:"number"},{key:"lowercase",cli:{"--no-lowercase":!1},toCLI:r(m=>m===!1?"--no-lowercase":void 0,"toCLI"),title:"Lowercase fields",description:["Lowercase field names and entry type. Enabled by default."],type:"boolean",defaultValue:!0},{key:"enclosingBraces",cli:{"--enclosing-braces":r(m=>m.length>0?m:!0,"--enclosing-braces")},toCLI:r(m=>{if(Array.isArray(m)&&m.length>0)return`--enclosing-braces=${m.join(",")}`;if(m===!0)return"--enclosing-braces"},"toCLI"),title:"Enclose values in double braces",description:["Enclose the given fields in double braces, such that case is preserved during BibTeX compilation."],examples:["--enclosing-braces=title,journal (output title and journal fields will be of the form {{This is a title}})","--enclosing-braces (equivalent to ---enclosing-braces=title)"],type:"boolean | string[]",convertBoolean:{true:["title"],false:void 0}},{key:"removeBraces",cli:{"--remove-braces":r(m=>m.length>0?m:!0,"--remove-braces")},toCLI:r(m=>{if(Array.isArray(m)&&m.length>0)return`--remove-braces=${m.join(",")}`;if(m===!0)return"--remove-braces"},"toCLI"),title:"Remove braces",description:["Remove any curly braces within the value, unless they are part of a command."],examples:["--remove-braces=title,journal","--remove-braces (equivalent to ---remove-braces=title)"],type:"boolean | string[]",convertBoolean:{true:["title"],false:void 0}},{key:"wrap",cli:{"--wrap":r(m=>m.length>0?Number(m[0]):!0,"--wrap"),"--no-wrap":!1},toCLI:r(m=>m?`--wrap=${m}`:void 0,"toCLI"),title:"Wrap values",description:["Wrap long values at the given column"],examples:["--wrap (80 by default)","--wrap=82"],type:"boolean | number",convertBoolean:{true:et,false:void 0}},{key:"version",cli:{"--version":!0,"-v":!0},title:"Version",description:["Show bibtex-tidy version."],type:"boolean"},{key:"quiet",cli:{"--quiet":!0},title:"Quiet",description:["Suppress logs on stdout."],type:"boolean"},{key:"backup",cli:{"--backup":!0,"--no-backup":!1},title:"Backup",description:["Make a backup <filename>.original. Enabled by default (unless --modify is explicitly provided or outputting to a different file/stdio). Deprecated but provided for backward compatibility."],type:"boolean",defaultValue:!0,deprecated:!0}];function st(m){return Object.fromEntries(kt.map(w=>{const g=w.key,_=m[g];return w.convertBoolean&&typeof _=="boolean"?[g,_?w.convertBoolean.true:w.convertBoolean.false]:typeof _>"u"&&w.defaultValue!==void 0?typeof w.defaultValue=="function"?[g,w.defaultValue(m)]:[g,w.defaultValue]:[g,_]}))}r(st,"normalizeOptions");function zt(m,w,g){const _=new Map,H=[];for(const J of m.children){if(J.type==="text"||J.block?.type!=="entry"&&!g.includes("special")){H.push(J);continue}const T=new Map;for(let fe of g){fe.startsWith("-")&&(fe=fe.slice(1));let be;switch(fe){case"key":if(J.block?.type!=="entry")continue;be=J.block.key??"";break;case"type":be=J.command;break;case"month":{if(J.block?.type!=="entry")continue;const Le=w.get(J.block)?.get(fe),Ee=Le?ht.indexOf(Le):-1;be=Ee>-1?Ee:"";break}case"special":be=te(J)?0:1;break;default:if(J.block?.type!=="entry")continue;be=w.get(J.block)?.get(fe)??""}T.set(fe,typeof be=="string"?be.toLowerCase():be)}for(_.set(J,T);H.length>0;){const fe=H.pop();if(!fe)break;_.set(fe,T)}}for(const J of[...g].reverse()){const T=J.startsWith("-"),fe=T?J.slice(1):J;m.children.sort((be,Le)=>{let Ee=_.get(be)?.get(fe)??"",Be=_.get(Le)?.get(fe)??"";return typeof Ee=="number"&&(Ee=String(Ee).padStart(50,"0")),typeof Be=="number"&&(Be=String(Be).padStart(50,"0")),(T?Be:Ee).localeCompare(T?Ee:Be)})}}r(zt,"sortEntries");var k=new Set(["string","preamble","set","xdata"]);function te(m){return k.has(m.command.toLowerCase())}r(te,"isBibLaTeXSpecialEntry");function Z(m,w){for(const g of Vt(m))g.fields.sort((_,H)=>{const J=w.indexOf(_.name.toLocaleLowerCase()),T=w.indexOf(H.name.toLocaleLowerCase());return J===-1&&T===-1?0:J===-1?1:T===-1?-1:T<J?1:T>J?-1:0})}r(Z,"sortEntryFields");function Ae(m,w={}){const g=st(w),_=pe(m),H=I(_),J=Vt(H).filter(Ee=>!Ee.key).map(Ee=>({code:"MISSING_KEY",message:`${Ee.parent.command} entry does not have a citation key.`})),T=St(H,g),fe=Oe(H,T,g.duplicates,g.merge);J.push(...fe.warnings),H.children=H.children.filter(Ee=>!We(Ee)||!fe.entries.has(Ee.block)),g.sort&&zt(H,T,g.sort),g.sortFields&&Z(H,g.sortFields);const be=g.generateKeys?je(H,T,g.generateKeys):void 0;return{bibtex:it(H,g,be),warnings:J,count:Vt(H).length}}r(Ae,"tidy");function St(m,w){return new Map(Vt(m).map(g=>[g,new Map(g.fields.map(_=>[_.name.toLocaleLowerCase(),Q(_,w)??""]))]))}r(St,"generateValueLookup");function Vt(m){return m.children.filter(We).map(w=>w.block)}return r(Vt,"getEntries"),go}var H0=V0();class ra extends Error{constructor(e){super(e==="too-large"?"BibTeX input is too large to format":"BibTeX input is invalid"),this.kind=e,this.name="BibtexFormatError"}kind}const q0=new Set(["comment","string","preamble"]),K0={lowercase:!1,removeDuplicateFields:!1};function W0(t){return new TextEncoder().encode(t).byteLength}function bd(t){if(!Number.isSafeInteger(t)||t<1)throw new RangeError("Citation BibTeX limit must be a positive integer.");return t}function ia(t){return`${Math.round(bd(t)/1024)} KB`}function Pa(t,e){return W0(t)>bd(e)}function _a(t,e){if(!t.trim()||Pa(t,e))return null;try{const n=H0.tidy(t,K0);return{bibtex:n.bibtex,count:n.count}}catch{return null}}function G0(t,e){if(!t.trim())return t;if(Pa(t,e))throw new ra("too-large");const n=_a(t,e);if(!n)throw new ra("invalid");return n.bibtex}function yd(t,e){if(!t.trim())return{status:"empty",entries:[]};if(Pa(t,e))return{status:"too-large",entries:[]};const n=_a(t,e);if(!n)return{status:"invalid",entries:[]};if(n.count===0)return{status:"empty",entries:[]};const s=[];let r=0;for(;r<t.length;){const o=t.indexOf("@",r);if(o<0)break;r=o+1;const a=t.lastIndexOf(`
|
|
39
|
-
`,o-1)+1;if(X0(t,a,o))continue;const c=t.slice(o).match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])/);if(!c||c.index===void 0)continue;const u=o+c[0].length-1,l=Ia(t,u,c[2]==="{"?"}":")");if(l<0)continue;const d=Cd(t.slice(o,l+1));d&&s.push(d),r=l+1}return{status:"ok",entries:s}}function vu(t,e){const n=t.trim(),s=_a(n,e);return!s||s.count!==1?null:Cd(n)}function Y0(t){const e=t.bibtex.match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])\s*[^,\s\}\)]+\s*,/s);if(!e||e.index===void 0)return null;const n=t.bibtex.indexOf(e[2],e.index);if(Ia(t.bibtex,n,e[2]==="{"?"}":")")<0)return null;const r=Ed(t.bibtex.slice(e[0].length,-1));if(!r)return null;const o=e[1].toLowerCase();return(/inproceedings|conference|incollection/.test(o)?r.booktitle??r.journal:r.journal??r.booktitle)?.trim()||null}function Cd(t){const e=t.match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])\s*([^,\s\}\)]+)\s*,/s);if(!e)return null;const n=t.indexOf(e[2],e.index??0);if(Ia(t,n,e[2]==="{"?"}":")")!==t.length-1)return null;const r=e[1];if(q0.has(r.toLowerCase()))return null;const o=Ed(t.slice(e[0].length,-1));return o?{citationKey:e[3],entryType:r,bibtex:t,title:o.title??null,authors:o.author??null,year:o.year??null}:null}function X0(t,e,n){let s=!1;for(let r=e;r<n;r+=1){const o=t[r];if(o==="%"&&!s)return!0;o==="\\"?s=!s:s=!1}return!1}function Ia(t,e,n){let s=0,r=0,o=!1,a=!1;for(let c=e;c<t.length;c+=1){const u=t[c];if(a){a=!1;continue}if(u==="\\"){a=!0;continue}if(n==="}"){if(u==='"'&&s===1&&(o=!o),u==="{")s+=1;else if(u==="}"&&--s===0)return c;continue}if(u==="{"&&!o){r+=1;continue}if(u==="}"&&!o&&r>0){r-=1;continue}if(!(r>0)){if(u==='"'){o=!o;continue}if(!o){if(u==="(")s+=1;else if(u===")"&&--s===0)return c}}}return-1}function Ed(t){const e={};for(const n of J0(t,",")){if(!n.trim())continue;const s=n.replace(/(^|[\r\n])\s*%[^\r\n]*/g,"$1").trim();if(!s)continue;const r=s.match(/^\s*([A-Za-z][A-Za-z0-9_-]*)\s*=\s*([\s\S]*)$/);if(!r||!r[2].trim())return null;const o=Z0(r[2]);o&&(e[r[1].toLowerCase()]=o)}return e}function J0(t,e){const n=[];let s=0,r=0,o=!1,a=!1;for(let c=0;c<t.length;c+=1){const u=t[c];if(a){a=!1;continue}if(u==="\\"){a=!0;continue}if(u==='"'){o=!o;continue}o||(u==="{"?r+=1:u==="}"?r=Math.max(0,r-1):u===e&&r===0&&(n.push(t.slice(s,c)),s=c+1))}return n.push(t.slice(s)),n}function Z0(t){let e=t.trim();return(e.startsWith("{")&&e.endsWith("}")||e.startsWith('"')&&e.endsWith('"'))&&(e=e.slice(1,-1)),e.replace(/\s+/g," ").trim()}const Q0=[],eg={status:"empty",entries:Q0};function wd({open:t,onOpenChange:e,page:n=!1,onBack:s,currentFile:r="",currentSource:o="",readOnly:a=!1,currentUserId:c,maxBibtexBytes:u,onInsert:l}){const{t:d}=Qe(),[h,D]=f.useState("library"),[p,F]=f.useState(""),[y,b]=f.useState(""),[E,x]=f.useState([]),[N,O]=f.useState(1),[I,q]=f.useState({page:1,pageSize:60,total:0,totalPages:0}),[z,X]=f.useState(0),[G,A]=f.useState([]),[ie,M]=f.useState(""),[K,L]=f.useState("green"),[S,P]=f.useState(null),[he,xe]=f.useState([]),[Fe,ye]=f.useState(!1),[W,U]=f.useState(!1),[ve,pe]=f.useState(null),[B,ue]=f.useState(null),[De,Me]=f.useState(""),[j,ae]=f.useState(!1),[ge,We]=f.useState(""),[Oe,Ve]=f.useState(null),[ht,me]=f.useState(null),[xt,vt]=f.useState(""),[it,ze]=f.useState(""),[Rt,R]=f.useState(""),[Q,V]=f.useState(new Map),[Ye,Ge]=f.useState(!1),[je,at]=f.useState(0),tt=!!(/\.bib$/i.test(r)&&l),ct=f.useMemo(()=>t&&tt?yd(o,u):eg,[t,o,tt,u]),de=ct.status==="too-large",ft=ct.status==="invalid",Ce=ct.entries,Dt=f.useMemo(()=>new Set(Ce.map(k=>k.citationKey.toLowerCase())),[Ce]);f.useEffect(()=>{if(!t)return;const k=new AbortController,te=window.setTimeout(()=>{U(!0),ze("");const Z=new URLSearchParams;p.trim()&&Z.set("q",p.trim()),y&&Z.set("tag",y),Z.set("page",String(N)),Z.set("pageSize","60"),re(`/api/citations?${Z.toString()}`,{signal:k.signal}).then(Ae=>{x(Ae.entries),q(Ae.pagination),Ae.pagination.page!==N&&O(Ae.pagination.page)}).catch(Ae=>{Ae instanceof Error&&Ae.name==="AbortError"||ze(ce(Ae))}).finally(()=>{k.signal.aborted||U(!1)})},p.trim()?180:0);return()=>{window.clearTimeout(te),k.abort()}},[t,p,y,N,z]),f.useEffect(()=>{if(!t)return;const k=new AbortController;return re("/api/citations/tags",{signal:k.signal}).then(te=>A(te.tags)).catch(te=>{te instanceof Error&&te.name==="AbortError"||ze(ce(te))}),()=>k.abort()},[t]),f.useEffect(()=>{if(!t||!tt){V(new Map),Ge(!1);return}const k=new AbortController,te=[...new Set(Ce.map(Z=>Z.citationKey))];return te.length?(Ge(!0),re("/api/citations/lookup",{method:"POST",body:JSON.stringify({keys:te}),signal:k.signal}).then(Z=>{V(new Map(Z.matches.map(Ae=>[Ae.citationKey.toLowerCase(),Ae])))}).catch(Z=>{Z instanceof Error&&Z.name==="AbortError"||ze(ce(Z))}).finally(()=>{k.signal.aborted||Ge(!1)}),()=>k.abort()):(V(new Map),Ge(!1),()=>k.abort())},[t,tt,Ce,je]),f.useEffect(()=>{t&&(D("library"),F(""),b(""),O(1),q({page:1,pageSize:60,total:0,totalPages:0}),ue(null),ae(!1),We(""),P(null),Ve(null),me(null),vt(""),ze(""),R(""),V(new Map))},[t,tt]);const ee=async k=>{pe(k.citationKey),ze("");try{const te=Q.get(k.citationKey.toLowerCase()),Z=await re("/api/citations",{method:"POST",body:JSON.stringify({bibtex:k.bibtex,citationKey:k.citationKey,entryType:k.entryType,title:k.title,authors:k.authors,year:k.year,overwrite:!!te,expectedRevision:te?.revision})});x(Ae=>[Z.entry,...Ae.filter(St=>St.id!==Z.entry.id&&St.citationKey.toLowerCase()!==Z.entry.citationKey.toLowerCase())]),V(Ae=>new Map(Ae).set(Z.entry.citationKey.toLowerCase(),{id:Z.entry.id,citationKey:Z.entry.citationKey,revision:Z.entry.revision})),P(Z.entry),xe(Z.entry.tags.map(Ae=>Ae.id)),R(Z.updated?d("citationLibrary.updated"):d("citationLibrary.saved")),O(1),X(Ae=>Ae+1)}catch(te){ze(ce(te)),at(Z=>Z+1)}finally{pe(null)}},oe=async()=>{if(B){pe(B.citationKey),ze("");try{const k=vu(De,u);if(!k){ze(d("citationErrors.invalid"));return}const te=await re(`/api/citations/${encodeURIComponent(B.id)}`,{method:"PATCH",body:JSON.stringify({bibtex:k.bibtex,citationKey:k.citationKey,entryType:k.entryType,title:k.title,authors:k.authors,year:k.year,expectedRevision:B.revision})});x(Z=>[te.entry,...Z.filter(Ae=>Ae.id!==te.entry.id)]),V(Z=>{const Ae=new Map(Z);return Ae.delete(B.citationKey.toLowerCase()),Ae.set(te.entry.citationKey.toLowerCase(),{id:te.entry.id,citationKey:te.entry.citationKey,revision:te.entry.revision}),Ae}),ue(null),R(d("citationLibrary.updated")),O(1),X(Z=>Z+1)}catch(k){ze(ce(k))}finally{pe(null)}}},et=async()=>{if(ge.trim()){pe("__new__"),ze("");try{const k=vu(ge,u);if(!k){ze(d("citationErrors.invalid"));return}const te=await re("/api/citations",{method:"POST",body:JSON.stringify({bibtex:k.bibtex,citationKey:k.citationKey,entryType:k.entryType,title:k.title,authors:k.authors,year:k.year})});x(Z=>[te.entry,...Z.filter(Ae=>Ae.id!==te.entry.id&&Ae.citationKey.toLowerCase()!==te.entry.citationKey.toLowerCase())]),V(Z=>new Map(Z).set(te.entry.citationKey.toLowerCase(),{id:te.entry.id,citationKey:te.entry.citationKey,revision:te.entry.revision})),ae(!1),We(""),R(te.updated?d("citationLibrary.updated"):d("citationLibraryActions.added")),P(te.entry),xe(te.entry.tags.map(Z=>Z.id)),O(1),X(Z=>Z+1)}catch(k){ze(ce(k))}finally{pe(null)}}},gt=async()=>{if(ie.trim()){ze("");try{const k=await re("/api/citations/tags",{method:"POST",body:JSON.stringify({name:ie.trim(),color:K})});A(te=>[...te.filter(Z=>Z.id!==k.tag.id),k.tag].sort((Z,Ae)=>Z.name.localeCompare(Ae.name))),M(""),R(d("citationLibrary.tagCreated"))}catch(k){ze(ce(k))}}},mt=k=>{ue(null),ae(!1),P(k),xe(k.tags.map(te=>te.id))},At=async()=>{if(S){ye(!0),ze("");try{const k=await re(`/api/citations/${encodeURIComponent(S.id)}/tags`,{method:"PATCH",body:JSON.stringify({tagIds:he,expectedRevision:S.revision})});x(te=>te.map(Z=>Z.id===k.entry.id?k.entry:Z)),V(te=>new Map(te).set(k.entry.citationKey.toLowerCase(),{id:k.entry.id,citationKey:k.entry.citationKey,revision:k.entry.revision})),P(k.entry),xe(k.entry.tags.map(te=>te.id)),R(d("citationLibrary.tagsUpdated")),X(te=>te+1)}catch(k){ze(ce(k))}finally{ye(!1)}}},kt=async k=>{Ve(k.id),vt("");try{await re(`/api/citations/${encodeURIComponent(k.id)}`,{method:"DELETE"}),x(te=>te.filter(Z=>Z.id!==k.id)),V(te=>{const Z=new Map(te);return Z.delete(k.citationKey.toLowerCase()),Z}),B?.id===k.id&&ue(null),S?.id===k.id&&P(null),R(d("citationLibrary.deleted")),O(1),X(te=>te+1),me(null)}catch(te){vt(ce(te))}finally{Ve(null)}},st=i.jsxs("div",{className:"citation-library-dialog",children:[i.jsxs("div",{className:"citation-library-tabs",role:"tablist","aria-label":d("citationLibrary.title"),children:[i.jsxs("button",{type:"button",role:"tab","aria-selected":h==="library",className:h==="library"?"active":"",onClick:()=>D("library"),children:[i.jsx(As,{size:15}),d("citationLibrary.myLibrary"),i.jsx("span",{children:I.total})]}),tt&&i.jsxs("button",{type:"button",role:"tab","aria-selected":h==="current",className:h==="current"?"active":"",onClick:()=>D("current"),children:[i.jsx(si,{size:15}),d("citationLibrary.currentFile"),i.jsx("span",{children:Ce.length})]})]}),it&&!(n&&(S||B))&&i.jsx("p",{className:"error dialog-error",children:it}),Rt&&i.jsxs("p",{className:"citation-library-notice",role:"status",children:[i.jsx(ss,{size:14}),Rt,i.jsx("button",{type:"button","aria-label":d("common.close"),onClick:()=>R(""),children:i.jsx(qt,{size:13})})]}),h==="library"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"citation-library-search-row",children:[i.jsxs("label",{className:"citation-library-search",children:[i.jsx(gd,{size:15}),i.jsx("input",{autoFocus:!0,placeholder:d("citationLibrary.searchPlaceholder"),value:p,onChange:k=>{F(k.target.value),O(1)}}),i.jsx("span",{children:d("citationLibrary.searchHint")})]}),i.jsxs("button",{type:"button",className:"citation-add-entry-button",onClick:()=>{ae(!0),ue(null),P(null)},children:[i.jsx(si,{size:14}),d("citationLibraryActions.addEntry")]})]}),i.jsxs("div",{className:"citation-tag-bar",children:[i.jsxs("div",{className:"citation-tag-filters",children:[i.jsx("button",{type:"button",className:y?"":"active",onClick:()=>{b(""),O(1)},children:d("citationLibrary.allTags")}),G.map(k=>i.jsxs("button",{type:"button",className:y===k.id?"active":"",onClick:()=>{b(y===k.id?"":k.id),O(1)},children:[i.jsx("span",{className:`citation-tag-dot tag-${k.color}`}),k.name]},k.id)),G.length===0&&i.jsx("span",{className:"muted",children:d("citationLibrary.noTags")})]}),i.jsxs("div",{className:"citation-tag-create",children:[i.jsx("input",{value:ie,placeholder:d("citationLibrary.newTagPlaceholder"),onChange:k=>M(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),gt())}}),i.jsx("select",{"aria-label":d("citationLibrary.tagColor"),value:K,onChange:k=>L(k.target.value),children:["red","orange","yellow","green","blue","purple","gray"].map(k=>i.jsx("option",{value:k,children:d(`tags.${k}`)},k))}),i.jsxs("button",{type:"button",disabled:!ie.trim(),title:d("citationLibrary.createTag"),onClick:()=>{gt()},children:[i.jsx(si,{size:13}),d("citationLibrary.createTag")]})]})]}),j&&i.jsxs("div",{className:"citation-edit-panel",children:[i.jsxs("div",{className:"citation-edit-header",children:[i.jsxs("div",{children:[i.jsx("strong",{children:d("citationLibraryActions.addEntryTitle")}),i.jsx("small",{children:d("citationLibraryActions.addEntryDescription")})]}),i.jsx("button",{type:"button","aria-label":d("common.close"),onClick:()=>ae(!1),children:i.jsx(qt,{size:15})})]}),i.jsx("textarea",{autoFocus:!0,value:ge,onChange:k=>We(k.target.value),placeholder:d("citationLibraryActions.addEntryPlaceholder"),spellCheck:!1,rows:9}),i.jsxs("div",{className:"citation-edit-actions",children:[i.jsx("button",{type:"button",onClick:()=>ae(!1),children:d("common.cancel")}),i.jsxs("button",{type:"button",className:"primary",disabled:!ge.trim()||ve==="__new__",onClick:()=>{et()},children:[ve==="__new__"?i.jsx(Et,{className:"spin",size:14}):i.jsx(ss,{size:14}),d("citationLibraryActions.addEntry")]})]})]}),W?i.jsxs("div",{className:"citation-library-empty",children:[i.jsx(Et,{className:"spin",size:22}),i.jsx("span",{children:d("common.loading")})]}):E.length===0?i.jsxs("div",{className:"citation-library-empty",children:[i.jsx(As,{size:28}),i.jsx("strong",{children:d("citationLibrary.emptyTitle")}),i.jsx("span",{children:d(y?"citationLibrary.noTagMatches":"citationLibrary.emptyDescription")})]}):i.jsx("div",{className:"citation-entry-list",children:E.map(k=>i.jsxs("div",{className:"citation-entry-item",children:[i.jsx(Au,{entry:k,currentUserId:c,selected:S?.id===k.id||B?.id===k.id,alreadyInFile:!n&&Dt.has(k.citationKey.toLowerCase()),importDisabled:a,deleting:Oe===k.id,onImport:l?async()=>{await l(k)&&e(!1)}:void 0,onEdit:k.ownerId===c?()=>{P(null),ae(!1),ue(k),Me(k.bibtex)}:void 0,onTags:k.ownerId===c?()=>mt(k):void 0,onDelete:k.ownerId===c?()=>{me(k),vt("")}:void 0,t:d}),!n&&S?.id===k.id&&i.jsx(Fo,{entry:S,tags:G,selectedIds:he,saving:Fe,onClose:()=>P(null),onToggle:te=>xe(Z=>Z.includes(te)?Z.filter(Ae=>Ae!==te):[...Z,te]),onSave:()=>{At()},t:d}),!n&&B?.id===k.id&&i.jsx(ku,{title:d("citationLibrary.editTitle",{key:B.citationKey}),value:De,saving:ve===B.citationKey,onChange:Me,onClose:()=>ue(null),onSave:()=>{oe()},t:d})]},k.id))}),I.totalPages>1&&i.jsxs("nav",{className:"citation-library-pagination","aria-label":d("citationLibraryPagination.pageOf",{page:I.page,totalPages:I.totalPages,count:I.total}),children:[i.jsxs("button",{type:"button",disabled:I.page<=1,onClick:()=>O(k=>Math.max(1,k-1)),children:[i.jsx(pr,{size:14}),d("citationLibraryPagination.previous")]}),i.jsx("span",{children:d("citationLibraryPagination.pageOf",{page:I.page,totalPages:I.totalPages,count:I.total})}),i.jsxs("button",{type:"button",disabled:I.page>=I.totalPages,onClick:()=>O(k=>Math.min(I.totalPages,k+1)),children:[d("citationLibraryPagination.next"),i.jsx(Ri,{size:14})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"citation-current-heading",children:[i.jsxs("div",{children:[i.jsx("strong",{children:d("citationLibrary.currentFileTitle")}),i.jsx("span",{children:d("citationLibrary.currentFileDescription")})]}),i.jsxs("button",{type:"button",onClick:()=>D("library"),children:[i.jsx(pr,{size:14}),d("citationLibrary.backToLibrary")]})]}),de&&i.jsxs("p",{className:"warning citation-library-warning",children:[i.jsx(ln,{size:15}),d("citationLibrary.fileTooLarge",{size:ia(u)})]}),ft&&i.jsxs("p",{className:"warning citation-library-warning",children:[i.jsx(ln,{size:15}),d("citationLibrary.fileInvalid")]}),Ce.length===0?i.jsxs("div",{className:"citation-library-empty",children:[i.jsx(As,{size:28}),i.jsx("strong",{children:d("citationLibrary.noEntries")}),i.jsx("span",{children:d(de?"citationLibrary.fileTooLargeHint":ft?"citationLibrary.fileInvalidHint":"citationLibrary.noEntriesDescription")})]}):i.jsx("div",{className:"citation-entry-list",children:Ce.map((k,te)=>i.jsxs("div",{className:"citation-entry-item",children:[i.jsx(Au,{entry:k,saved:Q.has(k.citationKey.toLowerCase()),saving:ve===k.citationKey,saveDisabled:Ye,onSave:()=>{ee(k)},t:d}),!n&&S?.citationKey.toLowerCase()===k.citationKey.toLowerCase()&&i.jsx(Fo,{entry:S,tags:G,selectedIds:he,saving:Fe,onClose:()=>P(null),onToggle:Z=>xe(Ae=>Ae.includes(Z)?Ae.filter(St=>St!==Z):[...Ae,Z]),onSave:()=>{At()},t:d})]},`${k.citationKey}-${te}`))})]})]}),zt=i.jsx(ns,{open:!!ht,title:d("citationLibrary.deleteTitle"),description:d("citationLibrary.deleteDescription",{key:ht?.citationKey??""}),confirmLabel:d("common.delete"),danger:!0,error:xt,busy:!!Oe,onCancel:()=>{me(null),vt("")},onConfirm:()=>{const k=ht;k&&kt(k)}});return n?i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:"citation-library-page",children:[i.jsxs("header",{className:"citation-library-page-header",children:[i.jsxs("div",{children:[i.jsxs("h1",{children:[i.jsx(As,{"aria-hidden":!0,size:26}),d("citationLibrary.title")]}),i.jsx("p",{children:d("citationLibraryHomeDescription")})]}),s&&i.jsxs("button",{type:"button",onClick:s,children:[i.jsx(pr,{size:15}),d("projects.title")]})]}),st]}),S&&i.jsx(dt,{open:!0,title:d("citationLibrary.tagsTitle",{key:S.citationKey}),description:d("citationLibrary.tags"),onOpenChange:k=>{k||(P(null),ze(""))},children:i.jsxs(i.Fragment,{children:[it&&i.jsx("p",{className:"error dialog-error",children:it}),i.jsx(Fo,{entry:S,tags:G,selectedIds:he,saving:Fe,modal:!0,onClose:()=>{P(null),ze("")},onToggle:k=>xe(te=>te.includes(k)?te.filter(Z=>Z!==k):[...te,k]),onSave:()=>{At()},t:d})]})}),B&&i.jsx(dt,{open:!0,extraWide:!0,title:d("citationLibrary.editTitle",{key:B.citationKey}),description:d("citationLibrary.title"),onOpenChange:k=>{k||(ue(null),ze(""))},children:i.jsxs(i.Fragment,{children:[it&&i.jsx("p",{className:"error dialog-error",children:it}),i.jsx(ku,{title:d("citationLibrary.editTitle",{key:B.citationKey}),value:De,saving:ve===B.citationKey,modal:!0,onChange:Me,onClose:()=>{ue(null),ze("")},onSave:()=>{oe()},t:d})]})}),zt]}):i.jsxs(i.Fragment,{children:[i.jsx(dt,{open:t,extraWide:!0,className:"citation-library-modal",title:d("citationLibrary.title"),description:d(tt?"citationLibrary.description":"citationLibraryHomeDescription",{file:r}),onOpenChange:e,footer:i.jsx("button",{onClick:()=>e(!1),children:d("common.close")}),children:st}),zt]})}function Au({entry:t,currentUserId:e,selected:n,alreadyInFile:s,saved:r,saving:o,saveDisabled:a,importDisabled:c,deleting:u,onSave:l,onImport:d,onEdit:h,onTags:D,onDelete:p,t:F}){const y="id"in t,b=y?t:null,E=Y0(t);return i.jsxs("article",{className:`citation-entry-card${n?" selected":""}${s?" already-in-file":""}`,title:s?F("citationErrors.alreadyInFile",{key:t.citationKey}):void 0,children:[i.jsxs("div",{className:"citation-entry-main",children:[i.jsxs("div",{className:"citation-entry-heading",children:[i.jsx("code",{children:t.citationKey}),i.jsxs("span",{children:["@",t.entryType]}),E&&i.jsx("span",{className:"citation-entry-venue",title:E,children:E}),r&&i.jsxs("em",{children:[i.jsx(ss,{size:11}),F("citationLibrary.savedLabel")]})]}),i.jsx("strong",{children:t.title||F("citationLibrary.untitled")}),i.jsxs("p",{children:[t.authors||F("citationLibrary.authorUnknown"),t.year&&i.jsxs("span",{children:[" · ",t.year]})]}),b&&b.tags.length>0&&i.jsx("div",{className:"citation-entry-tags",children:b.tags.map(x=>i.jsxs("span",{className:`citation-tag-pill tag-${x.color}`,children:[i.jsx("span",{className:"citation-tag-dot"}),x.name]},x.id))})]}),i.jsxs("div",{className:"citation-entry-actions",children:[l&&i.jsxs("button",{type:"button",className:r?"saved":"primary",disabled:o||a,onClick:l,children:[o||a?i.jsx(Et,{className:"spin",size:13}):r?i.jsx(ss,{size:13}):i.jsx(si,{size:13}),F(o?"citationLibrary.saving":r?"citationLibrary.update":"citationLibrary.save")]}),d&&i.jsxs("button",{type:"button",disabled:c||s,title:s?F("citationErrors.alreadyInFile",{key:t.citationKey}):F(c?"citationLibrary.importRequiresWrite":"citationLibrary.importToFile"),onClick:()=>{d()},children:[i.jsx(x0,{size:13}),F("citationLibrary.import")]}),b&&D&&i.jsxs("button",{type:"button",onClick:D,children:[i.jsx(na,{size:13}),F("citationLibrary.tags")]}),y&&h&&i.jsxs("button",{type:"button",onClick:h,children:[i.jsx(T0,{size:13}),F("common.edit")]}),y&&p&&i.jsxs("button",{type:"button",className:"danger-text",disabled:u,onClick:p,children:[u?i.jsx(Et,{className:"spin",size:13}):i.jsx(sn,{size:13}),F("common.delete")]})]})]})}function Fo({entry:t,tags:e,selectedIds:n,saving:s,modal:r=!1,onClose:o,onToggle:a,onSave:c,t:u}){const l=i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"citation-tag-choice-list",children:e.length===0?i.jsx("span",{className:"muted",children:u("citationLibrary.noTagsToAssign")}):e.map(d=>i.jsxs("label",{children:[i.jsx("input",{type:"checkbox",checked:n.includes(d.id),onChange:()=>a(d.id)}),i.jsx("span",{className:`citation-tag-dot tag-${d.color}`}),d.name]},d.id))}),i.jsxs("div",{className:"citation-edit-actions",children:[i.jsx("button",{type:"button",onClick:o,children:u("common.cancel")}),i.jsxs("button",{type:"button",className:"primary",disabled:s||e.length===0,onClick:c,children:[s?i.jsx(Et,{className:"spin",size:14}):i.jsx(ss,{size:14}),u("citationLibrary.saveTags")]})]})]});return r?i.jsx("div",{className:"citation-modal-form",children:l}):i.jsxs("div",{className:"citation-tag-editor",children:[i.jsxs("div",{className:"citation-edit-header",children:[i.jsx("strong",{children:u("citationLibrary.tagsTitle",{key:t.citationKey})}),i.jsx("button",{type:"button","aria-label":u("common.close"),onClick:o,children:i.jsx(qt,{size:15})})]}),l]})}function ku({title:t,value:e,saving:n,modal:s=!1,onChange:r,onClose:o,onSave:a,t:c}){const u=i.jsxs(i.Fragment,{children:[i.jsx("textarea",{autoFocus:!s,value:e,onChange:l=>r(l.target.value),spellCheck:!1,rows:12}),i.jsxs("div",{className:"citation-edit-actions",children:[i.jsx("button",{type:"button",onClick:o,children:c("common.cancel")}),i.jsxs("button",{type:"button",className:"primary",disabled:!e.trim()||n,onClick:a,children:[n?i.jsx(Et,{className:"spin",size:14}):i.jsx(ss,{size:14}),c("common.save")]})]})]});return s?i.jsx("div",{className:"citation-modal-form citation-edit-panel",children:u}):i.jsxs("div",{className:"citation-edit-panel",children:[i.jsxs("div",{className:"citation-edit-header",children:[i.jsx("strong",{children:t}),i.jsx("button",{type:"button","aria-label":c("common.close"),onClick:o,children:i.jsx(qt,{size:15})})]}),u]})}function tg(t=10){const e="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789!@#$%",n=crypto.getRandomValues(new Uint8Array(t));return Array.from(n,s=>e[s%e.length]).join("")}function ng({currentUser:t,minPasswordLength:e}){const{t:n}=Qe(),[s,r]=f.useState([]),[o,a]=f.useState(""),[c,u]=f.useState(!1),[l,d]=f.useState({username:"",displayName:"",password:"",role:"user",canCreateProjects:!1}),[h,D]=f.useState(null),[p,F]=f.useState(""),[y,b]=f.useState(null),[E,x]=f.useState(!1),N=()=>re("/api/admin/users").then(({users:A})=>r(A)).catch(A=>a(ce(A)));f.useEffect(()=>{N()},[]);const O=async()=>{if(l.password.length<e)return a(n("auth.passwordMinimum",{count:e}));try{await re("/api/admin/users",{method:"POST",body:JSON.stringify({username:l.username,displayName:l.displayName||l.username,password:l.password,role:l.role,canCreateProjects:l.canCreateProjects})}),u(!1),d({username:"",displayName:"",password:"",role:"user",canCreateProjects:!1}),await N()}catch(A){a(ce(A))}},I=async A=>{try{await re(`/api/admin/users/${A.id}`,{method:"PATCH",body:JSON.stringify({disabled:!A.disabled})}),await N()}catch(ie){a(ce(ie))}},q=async A=>{try{await re(`/api/admin/users/${A.id}`,{method:"PATCH",body:JSON.stringify({role:A.role==="admin"?"user":"admin"})}),await N()}catch(ie){a(ce(ie))}},z=async A=>{try{await re(`/api/admin/users/${A.id}`,{method:"PATCH",body:JSON.stringify({canCreateProjects:!A.canCreateProjects})}),await N()}catch(ie){a(ce(ie))}},X=async()=>{if(!(!h||!p)){if(p.length<e)return a(n("auth.passwordMinimum",{count:e}));try{await re(`/api/admin/users/${h.id}`,{method:"PATCH",body:JSON.stringify({password:p})}),D(null),F("")}catch(A){a(ce(A))}}},G=async()=>{if(y)try{await re(`/api/admin/users/${y.id}`,{method:"DELETE",body:JSON.stringify({deleteProjects:E})}),b(null),x(!1),await N()}catch(A){a(ce(A))}};return i.jsxs("main",{className:"dashboard",children:[i.jsxs("div",{className:"section-title",children:[i.jsxs("div",{children:[i.jsxs("h1",{children:[i.jsx(Cr,{"aria-hidden":!0,size:25}),n("users.manage")]}),i.jsx("p",{className:"muted",children:n("users.onlyAdmin")})]}),i.jsxs("button",{className:"primary icon-button",onClick:()=>u(!0),children:[i.jsx(sa,{"aria-hidden":!0,size:15}),n("users.add")]})]}),o&&i.jsx("p",{className:"error",children:o}),i.jsx("div",{className:"table-card",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:n("common.user")}),i.jsx("th",{children:n("users.role")}),i.jsx("th",{children:n("users.createProjects")}),i.jsx("th",{children:n("users.ownedProjects")}),i.jsx("th",{children:n("users.status")}),i.jsx("th",{children:n("users.actions")})]})}),i.jsx("tbody",{children:s.map(A=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:A.displayName}),i.jsxs("small",{children:["@",A.username]})]}),i.jsx("td",{children:A.role==="admin"?n("common.admin"):n("common.user")}),i.jsx("td",{children:A.canCreateProjects?n("users.allow"):n("users.deny")}),i.jsx("td",{children:A.ownedProjects}),i.jsx("td",{children:A.disabled?n("common.disabled"):n("common.normal")}),i.jsxs("td",{children:[i.jsxs("button",{className:"icon-button",disabled:A.id===t.id,onClick:()=>I(A),children:[A.disabled?i.jsx($0,{"aria-hidden":!0,size:13}):i.jsx(U0,{"aria-hidden":!0,size:13}),A.disabled?n("users.enable"):n("users.disable")]}),i.jsxs("button",{className:"icon-button",disabled:A.id===t.id,onClick:()=>q(A),children:[A.role==="admin"?i.jsx(_0,{"aria-hidden":!0,size:13}):i.jsx(P0,{"aria-hidden":!0,size:13}),A.role==="admin"?n("users.demote"):n("users.promote")]}),i.jsxs("button",{className:"icon-button",disabled:A.role==="admin",onClick:()=>z(A),children:[A.canCreateProjects?i.jsx(y0,{"aria-hidden":!0,size:13}):i.jsx(b0,{"aria-hidden":!0,size:13}),A.canCreateProjects?n("users.denyCreate"):n("users.allowCreate")]}),i.jsxs("button",{className:"icon-button",onClick:()=>{D(A),F("")},children:[i.jsx(Cu,{"aria-hidden":!0,size:13}),n("users.resetPassword")]}),i.jsxs("button",{className:"icon-button danger-text",disabled:A.id===t.id,onClick:()=>{b(A),x(!1)},children:[i.jsx(sn,{"aria-hidden":!0,size:13}),n("common.delete")]})]})]},A.id))})]})}),i.jsx(dt,{open:c,title:n("users.add"),description:n("users.addDescription"),onOpenChange:u,footer:i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"icon-button",onClick:()=>u(!1),children:[i.jsx(qt,{"aria-hidden":!0,size:14}),n("common.cancel")]}),i.jsxs("button",{className:"primary icon-button",disabled:l.password.length<e,onClick:()=>{O()},children:[i.jsx(sa,{"aria-hidden":!0,size:14}),n("users.createUser")]})]}),children:i.jsxs("div",{className:"form-stack",children:[i.jsxs("label",{className:"form-field",children:[n("auth.username"),i.jsx("input",{value:l.username,onChange:A=>d({...l,username:A.target.value})})]}),i.jsxs("label",{className:"form-field",children:[n("users.displayName"),i.jsx("input",{value:l.displayName,onChange:A=>d({...l,displayName:A.target.value})})]}),i.jsxs("label",{className:"form-field",children:[n("users.initialPassword"),i.jsxs("span",{className:"password-generator",children:[i.jsx("input",{minLength:e,autoComplete:"new-password",value:l.password,onChange:A=>d({...l,password:A.target.value})}),i.jsxs("button",{type:"button",title:n("users.generatePassword"),onClick:()=>d({...l,password:tg()}),children:[i.jsx(D0,{size:15}),n("users.randomPassword")]})]}),i.jsx("small",{className:"field-hint",children:n("auth.passwordMinimum",{count:e})})]}),i.jsxs("label",{className:"form-field",children:[n("users.role"),i.jsxs("select",{value:l.role,onChange:A=>d({...l,role:A.target.value}),children:[i.jsx("option",{value:"user",children:n("common.user")}),i.jsx("option",{value:"admin",children:n("common.admin")})]})]}),i.jsxs("label",{className:"checkbox-field",children:[i.jsx("input",{type:"checkbox",checked:l.canCreateProjects||l.role==="admin",disabled:l.role==="admin",onChange:A=>d({...l,canCreateProjects:A.target.checked})})," ",n("users.allowCreate")]})]})}),i.jsx(dt,{open:!!h,title:n("users.resetPassword"),description:n("users.resetDescription",{username:h?.username??""}),onOpenChange:A=>{A||D(null)},footer:i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"icon-button",onClick:()=>D(null),children:[i.jsx(qt,{"aria-hidden":!0,size:14}),n("common.cancel")]}),i.jsxs("button",{className:"primary icon-button",disabled:p.length<e,onClick:()=>{X()},children:[i.jsx(Cu,{"aria-hidden":!0,size:14}),n("users.reset")]})]}),children:i.jsxs("label",{className:"form-field",children:[n("auth.newPassword"),i.jsx("input",{autoFocus:!0,type:"password",minLength:e,autoComplete:"new-password",value:p,onChange:A=>F(A.target.value)}),i.jsx("small",{className:"field-hint",children:n("auth.passwordMinimum",{count:e})})]})}),i.jsx(dt,{open:!!y,title:n("users.deleteTitle"),description:n("users.deleteDescription",{username:y?.username??""}),onOpenChange:A=>{A||b(null)},footer:i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"icon-button",onClick:()=>b(null),children:[i.jsx(qt,{"aria-hidden":!0,size:14}),n("common.cancel")]}),i.jsxs("button",{className:"danger icon-button",onClick:()=>{G()},children:[i.jsx(sn,{"aria-hidden":!0,size:14}),n("users.deleteTitle")]})]}),children:i.jsxs("fieldset",{className:"choice-group",children:[i.jsx("legend",{children:n("users.ownedChoice",{count:y?.ownedProjects??0})}),i.jsxs("label",{children:[i.jsx("input",{type:"radio",checked:!E,onChange:()=>x(!1)})," ",n("users.transferProjects")]}),i.jsxs("label",{children:[i.jsx("input",{type:"radio",checked:E,onChange:()=>x(!0)})," ",n("users.deleteProjects")]})]})})]})}const sg=f.lazy(()=>Wn(()=>import("./SystemMetricsDialog-C0m9JUDy.js"),__vite__mapDeps([4,1])).then(t=>({default:t.SystemMetricsDialog})));function rg(t){return t instanceof Error&&t.name==="AbortError"}function ig(t,e,n,s){const r=new Date(t).getTime();if(!Number.isFinite(r))return t;const o=r-n,a=Math.abs(o),c=60*1e3,u=60*c,l=24*u,d=3*l;if(a>d){const F=Math.floor(a/l),y=o<0?"Past":"Future";return s(`projects.relativeDays${y}`,{days:F,hours:0,minutes:0})}if(a>=l){const F=Math.floor(a/l),y=Math.floor(a%l/u),b=o<0?"Past":"Future",E=y>0?"DaysHours":"Days";return s(`projects.relative${E}${b}`,{days:F,hours:y,minutes:0})}if(a>=u){const F=Math.floor(a/u),y=Math.floor(a%u/c),b=o<0?"Past":"Future",E=y>0?"HoursMinutes":"Hours";return s(`projects.relative${E}${b}`,{days:0,hours:F,minutes:y})}const h="minute",D=c,p=Math.sign(o)*Math.max(1,Math.floor(a/D));return new Intl.RelativeTimeFormat(e,{numeric:"always"}).format(p,h)}function og(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}function ag({site:t,user:e,initialData:n,onDataChange:s,onUser:r,onOpenProject:o}){const{t:a}=Qe(),[c,u]=f.useState(()=>n?.projects??[]),[l,d]=f.useState(()=>n?.tags??[]),[h,D]=f.useState(()=>n?.pagination??{page:1,pageSize:20,total:n?.projects.length??0,totalPages:n?.projects.length?1:0}),[p,F]=f.useState(!!n),[y,b]=f.useState(!1),[E,x]=f.useState(!1),[N,O]=f.useState(!1),[I,q]=f.useState(""),[z,X]=f.useState(""),[G,A]=f.useState(""),[ie,M]=f.useState(""),[K,L]=f.useState(""),[S,P]=f.useState(""),[he,xe]=f.useState(""),[Fe,ye]=f.useState(!1),[W,U]=f.useState(""),[ve,pe]=f.useState(!1),[B,ue]=f.useState(""),[De,Me]=f.useState(null),[j,ae]=f.useState(""),ge=f.useRef(null),[We,Oe]=f.useState(!1),[Ve,ht]=f.useState(""),[me,xt]=f.useState(""),[vt,it]=f.useState(!1),[ze,Rt]=f.useState(""),[R,Q]=f.useState("blue"),[V,Ye]=f.useState(null),[Ge,je]=f.useState(null),[at,tt]=f.useState(""),[ct,de]=f.useState(null),[ft,Ce]=f.useState(""),[Dt,ee]=f.useState(!1),[oe,et]=f.useState(null),[gt,mt]=f.useState(null),[At,kt]=f.useState([]),[st,zt]=f.useState(""),[k,te]=f.useState(!1),[Z,Ae]=f.useState(""),[St,Vt]=f.useState(()=>localStorage.getItem("texlite-project-view")==="list"?"list":"grid"),[m,w]=f.useState(()=>localStorage.getItem("texlite-project-sort")==="created"?"created":"updated"),[g,_]=f.useState(!1),[H,J]=f.useState(""),[T,fe]=f.useState(1),[be,Le]=f.useState(()=>Date.now()),[Ee,Be]=f.useState(""),Ft=f.useRef(0),jt=f.useRef(null),Wt=(C,Ue,Pe,He,Ct)=>`${C?"archived":"active"}|${Ue}|${Pe}|${He}|${Ct}`,Ne=Wt(g,T,Ve,me,m),qe=(C,Ue,Pe,He,Ct)=>{const bt=new URLSearchParams({page:String(Ue),pageSize:"20",sort:Ct});C&&bt.set("archived","1"),Pe.trim()&&bt.set("search",Pe.trim()),He&&bt.set("tag",He);const on=Wt(C,Ue,Pe,He,Ct),Xn=++Ft.current;jt.current?.abort();const kn=new AbortController;return jt.current=kn,Promise.all([re(`/api/projects?${bt.toString()}`,{signal:kn.signal}),re("/api/tags",{signal:kn.signal})]).then(([an,rr])=>{Xn===Ft.current&&(u(an.projects),d(rr.tags),D(an.pagination),fe(an.pagination.page),F(!0),Be(on))}).catch(an=>{!rg(an)&&Xn===Ft.current&&q(ce(an))}).finally(()=>{jt.current===kn&&(jt.current=null)})};f.useEffect(()=>(qe(g,T,Ve,me,m),()=>jt.current?.abort()),[g,T,Ve,me,m]),f.useEffect(()=>{p&&!g&&Ee===Ne&&s(c,l,h)},[c,l,h,p,Ee,Ne,g]),f.useEffect(()=>{const C=window.setInterval(()=>Le(Date.now()),6e4);return()=>window.clearInterval(C)},[]);const _e=C=>{Vt(C),localStorage.setItem("texlite-project-view",C)},Ot=C=>{w(C),fe(1),localStorage.setItem("texlite-project-sort",C)},Zt=C=>{_(C),fe(1)},ot=C=>{xt(C),fe(1)},$e=async()=>{if(W.trim()){X("");try{const{project:C}=await re("/api/projects",{method:"POST",body:JSON.stringify({name:W})});ye(!1),U("");const Ue=g||T!==1?c:[C,...c].slice(0,h.pageSize),Pe=g?h:{...h,total:h.total+1,totalPages:Math.ceil((h.total+1)/h.pageSize)};u(Ue),D(Pe),g||s(Ue,l,Pe),o(C.id)}catch(C){X(ce(C))}}},nt=async()=>{if(!De)return;const C=t.maxUploadSizeMB;if(De.size>C*1024*1024)return ae(a("errors.fileTooLarge",{size:C}));Oe(!0),ae("");const Ue=new FormData;Ue.append("file",De);try{const Pe=await fetch(`/api/projects/import?name=${encodeURIComponent(B.trim())}`,{method:"POST",body:Ue}),He=await Pe.json();if(!Pe.ok)throw new Error(Ea(He,Pe.status,"errors.upload"));const Ct=He.project,bt=g||T!==1?c:[Ct,...c].slice(0,h.pageSize),on=g?h:{...h,total:h.total+1,totalPages:Math.ceil((h.total+1)/h.pageSize)};u(bt),D(on),g||s(bt,l,on),pe(!1),Me(null),ue(""),o(Ct.id)}catch(Pe){ae(ce(Pe))}finally{Oe(!1)}},Pn=C=>{if(C&&!C.name.toLocaleLowerCase().endsWith(".zip")){ae(a("errors.zipOnly"));return}ae(""),Me(C),C&&!B&&ue(C.name.replace(/\.zip$/i,""))},fs=async()=>{await re("/api/auth/logout",{method:"POST"}),r(null)},vn=async()=>{if(ze.trim()){A("");try{const C=await re("/api/tags",{method:"POST",body:JSON.stringify({name:ze,color:R})});d(Ue=>[...Ue,C.tag].sort((Pe,He)=>Pe.name.localeCompare(He.name))),it(!1),Rt(""),Q("blue")}catch(C){A(ce(C))}}},Yn=async C=>{if(!V)return;const Ue=V.tags.some(Pe=>Pe.id===C.id);M("");try{const He=(await re(Ue?`/api/projects/${V.id}/tags/${C.id}`:`/api/projects/${V.id}/tags`,Ue?{method:"DELETE"}:{method:"POST",body:JSON.stringify({tagId:C.id})})).project;Ye(He),u(Ct=>Ct.map(bt=>bt.id===He.id?He:bt))}catch(Pe){M(ce(Pe))}},_n=async()=>{if(!(!Ge||!at.trim())){L("");try{const C=await re(`/api/projects/${Ge.id}`,{method:"PATCH",body:JSON.stringify({name:at})});u(Ue=>Ue.map(Pe=>Pe.id===C.project.id?C.project:Pe)),je(null),tt("")}catch(C){L(ce(C))}}},An=async()=>{if(!(!ct||!ft.trim())){ee(!0),P("");try{await re(`/api/projects/${ct.id}/duplicate`,{method:"POST",body:JSON.stringify({name:ft})}),de(null),Ce(""),qe(g,T,Ve,me,m)}catch(C){P(ce(C))}finally{ee(!1)}}},tr=async()=>{if(oe){xe("");try{await re(`/api/projects/${oe.id}`,{method:"DELETE"}),u(Ct=>Ct.filter(bt=>bt.id!==oe.id));const C=Math.max(0,h.total-1),Ue=Math.ceil(C/h.pageSize),Pe=Ue===0?1:Math.min(T,Ue),He={...h,page:Pe,total:C,totalPages:Ue};D(He),et(null),Pe!==T?fe(Pe):qe(g,T,Ve,me,m)}catch(C){xe(ce(C))}}},ms=async C=>{mt(C),zt(""),kt([]),Ae(""),te(!0);try{const Ue=await re("/api/users");kt(Ue.users.filter(Pe=>Pe.id!==C.ownerId))}catch(Ue){Ae(ce(Ue))}finally{te(!1)}},Gi=async()=>{if(!(!gt||!st)){te(!0),Ae("");try{await re(`/api/projects/${gt.id}/owner`,{method:"PUT",body:JSON.stringify({userId:st})}),mt(null),zt(""),qe(g,T,Ve,me,m)}catch(C){Ae(ce(C))}finally{te(!1)}}},Yi=async C=>{const Ue=!g;J(C.id),q("");try{await re(`/api/projects/${C.id}/archive`,{method:Ue?"PUT":"DELETE"});const Pe=c.filter(Xn=>Xn.id!==C.id);u(Pe);const He=Math.max(0,h.total-1),Ct=Math.ceil(He/h.pageSize),bt=Ct===0?1:Math.min(T,Ct),on={...h,page:bt,total:He,totalPages:Ct};D(on),g||s(Pe,l,on),bt!==T?fe(bt):qe(g,T,Ve,me,m)}catch(Pe){q(ce(Pe))}finally{J("")}},Ur=c,Xi=["red","orange","yellow","green","blue","purple","gray"],nr=C=>new Date(C).toLocaleString(Ke.resolvedLanguage),sr=C=>ig(C,Ke.resolvedLanguage??"en",be,(Ue,Pe)=>a(Ue,Pe));return i.jsxs("div",{className:"page",children:[i.jsxs("header",{className:"topbar",children:[i.jsxs("a",{className:"brand-link",href:"/","aria-label":t.siteName,children:[i.jsx("span",{className:"site-title",children:t.siteName}),i.jsx(Ni,{siteName:t.siteName})]}),i.jsxs("div",{className:"top-actions",children:[e.role==="admin"&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"ghost",onClick:()=>x(!0),children:[i.jsx(c0,{"aria-hidden":!0,size:14}),a("metrics.title")]}),i.jsxs("button",{className:`ghost${y?" top-return-action":""}`,onClick:()=>{b(C=>!C),O(!1)},children:[y?i.jsx(Yo,{"aria-hidden":!0,size:14}):i.jsx(Cr,{"aria-hidden":!0,size:14}),a(y?"users.back":"users.manage")]})]}),i.jsxs("button",{className:`ghost${N?" top-return-action":""}`,onClick:()=>{b(!1),O(C=>!C)},children:[N?i.jsx(Yo,{"aria-hidden":!0,size:14}):i.jsx(As,{"aria-hidden":!0,size:14}),a(N?"users.back":"citationLibrary.title")]}),i.jsx(wa,{compact:!0}),i.jsxs("span",{className:"top-user-identity",children:[i.jsx("strong",{children:e.displayName}),i.jsxs("small",{children:["@",e.username]})]}),i.jsx("button",{className:"ghost",onClick:fs,children:a("auth.logout")})]})]}),y?i.jsx(ng,{currentUser:e,minPasswordLength:t.minPasswordLength}):N?i.jsx("main",{className:"dashboard citation-library-page-shell",children:i.jsx(wd,{page:!0,open:!0,onOpenChange:O,onBack:()=>O(!1),currentUserId:e.id,maxBibtexBytes:t.maxCitationBibtexBytes})}):i.jsxs("main",{className:"dashboard",children:[i.jsxs("div",{className:"section-title",children:[i.jsxs("div",{children:[i.jsxs("h1",{children:[i.jsx(Zo,{"aria-hidden":!0,size:25}),a("projects.title")]}),i.jsx("p",{className:"muted",children:e.canCreateProjects?a("projects.subtitle"):a("projects.restricted")})]}),i.jsxs("div",{className:"section-actions",children:[i.jsxs("button",{onClick:()=>{A(""),it(!0)},children:[i.jsx(na,{"aria-hidden":!0,size:15}),a("tags.create")]}),e.canCreateProjects&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>{ae(""),pe(!0)},children:[i.jsx(hi,{"aria-hidden":!0,size:15}),a("projects.upload")]}),i.jsxs("button",{className:"primary",onClick:()=>{X(""),ye(!0)},children:[i.jsx(dd,{"aria-hidden":!0,size:15}),a("projects.new")]})]})]})]}),I&&i.jsx("p",{className:"error",children:I}),i.jsxs("div",{className:"project-toolbar",children:[i.jsx("input",{type:"search",placeholder:a("projects.search"),value:Ve,onChange:C=>{ht(C.target.value),fe(1)}}),i.jsxs("div",{className:"project-scope",role:"tablist","aria-label":a("projects.scope"),children:[i.jsxs("button",{className:g?"":"active",onClick:()=>Zt(!1),role:"tab","aria-selected":!g,children:[i.jsx(Zo,{size:14}),a("projects.active")]}),i.jsxs("button",{className:g?"active":"",onClick:()=>Zt(!0),role:"tab","aria-selected":g,children:[i.jsx(bu,{size:14}),a("projects.archived")]})]}),i.jsxs("div",{className:"tag-filters",children:[i.jsx("button",{className:me?"":"active",onClick:()=>ot(""),children:a("projects.allTags")}),l.map(C=>i.jsxs("button",{className:me===C.id?"active":"",onClick:()=>ot(me===C.id?"":C.id),children:[i.jsx(bo,{color:C.color}),C.name]},C.id))]}),i.jsxs("label",{className:"project-sort",children:[i.jsx(l0,{size:14}),i.jsx("span",{children:a("projects.sortBy")}),i.jsxs("select",{value:m,onChange:C=>Ot(C.target.value),children:[i.jsx("option",{value:"updated",children:a("projects.sortModified")}),i.jsx("option",{value:"created",children:a("projects.sortCreated")})]})]}),i.jsxs("div",{className:"view-toggle",children:[i.jsx("button",{className:St==="grid"?"active":"",onClick:()=>_e("grid"),title:a("projects.grid"),children:"▦"}),i.jsx("button",{className:St==="list"?"active":"",onClick:()=>_e("list"),title:a("projects.list"),children:"☷"})]})]}),i.jsxs("div",{className:`project-grid ${St==="list"?"list-view":""}`,children:[Ur.map(C=>i.jsxs("article",{className:`project-card${C.ownerId===e.id?" owned-project":""}`,children:[St==="grid"&&C.ownerId===e.id&&i.jsxs("button",{className:"project-transfer-action",title:a("projects.transferOwnership"),onClick:()=>{ms(C)},children:[i.jsx(Do,{"aria-hidden":!0,size:13}),a("projects.transfer")]}),i.jsxs("button",{className:"project-card-open",onClick:()=>o(C.id),children:[i.jsx("span",{className:"owner-badge",title:C.ownerDisplayName??C.ownerUsername,children:C.ownerDisplayName??C.ownerUsername}),i.jsxs("span",{className:"project-card-main",children:[i.jsx("strong",{children:C.name}),i.jsxs("span",{className:"project-tags",children:[C.tags?.map(Ue=>i.jsx("span",{className:`tag tag-${Ue.color}`,children:Ue.name},Ue.id)),!!(C.unresolvedCommentCount&&C.unresolvedCommentCount>0)&&i.jsxs("span",{className:"project-comments-badge unresolved",title:a("projects.unresolvedCommentsTooltip",{unresolved:C.unresolvedCommentCount,total:C.commentCount??C.unresolvedCommentCount}),children:[i.jsx(fd,{"aria-hidden":!0,size:10}),i.jsx("span",{children:a("projects.unresolvedCount",{count:C.unresolvedCommentCount})})]})]})]}),i.jsxs("dl",{className:"project-meta",children:[i.jsxs("div",{children:[i.jsxs("dt",{children:[i.jsx(d0,{"aria-hidden":!0,size:13}),a("projects.created")]}),i.jsx("dd",{children:i.jsx("time",{dateTime:C.createdAt,children:nr(C.createdAt)})})]}),i.jsxs("div",{children:[i.jsxs("dt",{children:[i.jsx(w0,{"aria-hidden":!0,size:13}),a("projects.modified")]}),i.jsxs("dd",{title:a("projects.modifiedByUser",{time:nr(C.updatedAt),user:C.lastModifiedDisplayName??C.lastModifiedUsername??a("projects.deletedUser")}),children:[i.jsx("time",{dateTime:C.updatedAt,children:sr(C.updatedAt)}),i.jsxs("span",{className:"project-modified-by",children:[" · ",a("projects.byUser",{user:C.lastModifiedDisplayName??C.lastModifiedUsername??a("projects.deletedUser")})]})]})]})]})]}),i.jsxs("div",{className:"project-card-actions",children:[i.jsxs("button",{onClick:()=>{M(""),Ye(C)},children:[i.jsx(na,{"aria-hidden":!0,size:14}),a("tags.assign")]}),C.permission==="owner"&&i.jsxs("button",{onClick:()=>{L(""),je(C),tt(C.name)},children:[i.jsx(Qo,{"aria-hidden":!0,size:14}),a("projects.rename")]}),(e.role==="admin"||e.canCreateProjects)&&i.jsxs("button",{onClick:()=>{P(""),de(C),Ce(`${C.name} (1)`)},children:[i.jsx(p0,{"aria-hidden":!0,size:14}),a("projects.duplicate")]}),i.jsxs("a",{href:`/api/projects/${C.id}/download`,download:!0,children:[i.jsx(yr,{"aria-hidden":!0,size:14}),a("projects.download")]}),i.jsxs("button",{disabled:H===C.id,onClick:()=>{Yi(C)},children:[g?i.jsx(u0,{"aria-hidden":!0,size:14}):i.jsx(bu,{"aria-hidden":!0,size:14}),a(g?"projects.unarchive":"projects.archive")]}),St==="list"&&C.ownerId===e.id&&i.jsxs("button",{onClick:()=>{ms(C)},children:[i.jsx(Do,{"aria-hidden":!0,size:14}),a("projects.transfer")]}),C.permission==="owner"&&i.jsxs("button",{className:"danger-text",onClick:()=>{et(C),xe("")},children:[i.jsx(sn,{"aria-hidden":!0,size:14}),a("common.delete")]})]})]},C.id)),Ur.length===0&&(c.length===0?g?i.jsx("div",{className:"empty",children:a("projects.noArchived")}):i.jsxs("div",{className:"project-empty",children:[i.jsx("span",{className:"project-empty-icon",children:i.jsx(I0,{size:28})}),i.jsx("h2",{children:a("projects.emptyTitle")}),i.jsx("p",{children:e.canCreateProjects?a("projects.emptyDescription"):a("projects.emptyRestricted")})]}):i.jsx("div",{className:"empty",children:a("projects.noMatches")}))]}),h.totalPages>1&&i.jsxs("nav",{className:"project-pagination","aria-label":a("projects.pagination"),children:[i.jsxs("button",{disabled:h.page<=1,onClick:()=>fe(C=>Math.max(1,C-1)),title:a("projects.previousPage"),children:[i.jsx(pr,{size:15}),a("projects.previousPage")]}),i.jsx("span",{children:a("projects.pageOf",{page:h.page,totalPages:h.totalPages,count:h.total})}),i.jsxs("button",{disabled:h.page>=h.totalPages,onClick:()=>fe(C=>Math.min(h.totalPages,C+1)),title:a("projects.nextPage"),children:[i.jsx(Ri,{size:15}),a("projects.nextPage")]})]}),i.jsx(dt,{open:Fe,title:a("projects.new"),description:a("projects.newDescription"),onOpenChange:C=>{ye(C),C||X("")},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>ye(!1),children:a("common.cancel")}),i.jsx("button",{className:"primary",onClick:()=>{$e()},children:a("common.create")})]}),children:i.jsxs(i.Fragment,{children:[z&&i.jsx("p",{className:"error dialog-error",children:z}),i.jsxs("label",{className:"form-field",children:[a("projects.name"),i.jsx("input",{autoFocus:!0,value:W,onChange:C=>{U(C.target.value),X("")},onKeyDown:C=>{C.key==="Enter"&&$e()}})]})]})}),i.jsx(dt,{open:ve,title:a("projects.upload"),description:a("projects.uploadDescription",{size:t.maxUploadSizeMB}),onOpenChange:C=>{pe(C),C||ae("")},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>{pe(!1),ae("")},children:a("common.cancel")}),i.jsx("button",{className:"primary",disabled:!De||We,onClick:()=>{nt()},children:a(We?"projects.importing":"projects.import")})]}),children:i.jsxs("div",{className:"form-stack",children:[j&&i.jsx("p",{className:"error import-error",children:j}),i.jsxs("div",{className:`upload-picker${De?" has-file":""}`,onDragOver:C=>{C.preventDefault(),C.dataTransfer.dropEffect="copy"},onDrop:C=>{C.preventDefault(),Pn(C.dataTransfer.files[0]??null)},children:[i.jsx("input",{ref:ge,className:"sr-only",type:"file",accept:".zip,application/zip",onChange:C=>Pn(C.target.files?.[0]??null)}),i.jsx(Jo,{size:34}),i.jsxs("div",{className:"upload-picker-copy",children:[i.jsx("strong",{children:De?.name??a("projects.chooseZip")}),i.jsx("span",{children:De?a("projects.selectedFileSize",{size:og(De.size)}):a("projects.dropZip")})]}),i.jsxs("button",{type:"button",onClick:()=>ge.current?.click(),children:[i.jsx(hi,{size:15}),a("projects.browse")]}),De&&i.jsx("button",{className:"upload-clear",type:"button",title:a("projects.clearFile"),"aria-label":a("projects.clearFile"),onClick:()=>{Pn(null),ge.current&&(ge.current.value="")},children:i.jsx(qt,{size:14})})]}),i.jsxs("label",{className:"form-field",children:[a("projects.name"),i.jsx("input",{value:B,onChange:C=>ue(C.target.value)})]})]})}),i.jsx(dt,{open:vt,title:a("tags.create"),description:a("tags.createDescription"),onOpenChange:C=>{it(C),C||A("")},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>it(!1),children:a("common.cancel")}),i.jsx("button",{className:"primary",onClick:()=>{vn()},children:a("common.create")})]}),children:i.jsxs("div",{className:"form-stack",children:[G&&i.jsx("p",{className:"error dialog-error",children:G}),i.jsxs("label",{className:"form-field",children:[a("tags.name"),i.jsx("input",{autoFocus:!0,value:ze,onChange:C=>{Rt(C.target.value),A("")}})]}),i.jsxs("fieldset",{className:"color-picker",children:[i.jsx("legend",{children:a("tags.color")}),Xi.map(C=>i.jsxs("label",{className:R===C?"active":"",children:[i.jsx("input",{type:"radio",name:"dashboard-tag-color",checked:R===C,onChange:()=>Q(C)}),i.jsx(bo,{color:C}),a(`tags.${C}`)]},C))]})]})}),i.jsx(dt,{open:!!V,title:a("tags.assignTitle",{project:V?.name??""}),description:a("tags.assignDescription"),onOpenChange:C=>{C||(Ye(null),M(""))},footer:i.jsx("button",{onClick:()=>{Ye(null),M("")},children:a("common.close")}),children:i.jsxs("div",{className:"tag-assignment-list",children:[ie&&i.jsx("p",{className:"error dialog-error",children:ie}),l.map(C=>i.jsxs("label",{children:[i.jsx("input",{type:"checkbox",checked:!!V?.tags.some(Ue=>Ue.id===C.id),onChange:()=>{Yn(C)}}),i.jsx(bo,{color:C.color}),i.jsx("span",{children:C.name})]},C.id)),l.length===0&&i.jsx("p",{className:"muted",children:a("tags.empty")})]})}),i.jsx(dt,{open:!!Ge,title:a("projects.renameTitle"),onOpenChange:C=>{C||(je(null),L(""))},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>{je(null),L("")},children:a("common.cancel")}),i.jsx("button",{className:"primary",onClick:()=>{_n()},children:a("projects.rename")})]}),children:i.jsxs(i.Fragment,{children:[K&&i.jsx("p",{className:"error dialog-error",children:K}),i.jsxs("label",{className:"form-field",children:[a("projects.name"),i.jsx("input",{autoFocus:!0,value:at,onChange:C=>{tt(C.target.value),L("")},onKeyDown:C=>{C.key==="Enter"&&_n()}})]})]})}),i.jsx(dt,{open:!!ct,title:a("projects.duplicateTitle"),description:a("projects.duplicateDescription",{project:ct?.name??""}),onOpenChange:C=>{!C&&!Dt&&(de(null),Ce(""),P(""))},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{disabled:Dt,onClick:()=>{de(null),Ce(""),P("")},children:a("common.cancel")}),i.jsx("button",{className:"primary",disabled:Dt||!ft.trim(),onClick:()=>{An()},children:a(Dt?"projects.duplicating":"projects.duplicate")})]}),children:i.jsxs(i.Fragment,{children:[S&&i.jsx("p",{className:"error dialog-error",children:S}),i.jsxs("label",{className:"form-field",children:[a("projects.name"),i.jsx("input",{autoFocus:!0,value:ft,onChange:C=>{Ce(C.target.value),P("")},onKeyDown:C=>{C.key==="Enter"&&An()}})]})]})}),i.jsx(dt,{open:!!gt,title:a("projects.transferOwnership"),description:a("projects.transferDescription",{project:gt?.name??""}),onOpenChange:C=>{!C&&!k&&(mt(null),zt(""),Ae(""))},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{disabled:k,onClick:()=>{mt(null),zt(""),Ae("")},children:a("common.cancel")}),i.jsxs("button",{className:"primary",disabled:k||!st,onClick:()=>{Gi()},children:[k?i.jsx(Et,{className:"spin",size:14}):i.jsx(Do,{size:14}),a("projects.transfer")]})]}),children:i.jsxs("div",{className:"form-stack",children:[Z&&i.jsx("p",{className:"error dialog-error",children:Z}),i.jsxs("label",{className:"form-field",children:[a("projects.newOwner"),i.jsxs("select",{disabled:k||At.length===0,value:st,onChange:C=>zt(C.target.value),children:[i.jsx("option",{value:"",children:k?a("common.loading"):At.length>0?a("projects.chooseNewOwner"):a("projects.noTransferUsers")}),At.map(C=>i.jsxs("option",{value:C.id,children:[C.displayName??C.username," (@",C.username,")"]},C.id))]})]}),i.jsxs("p",{className:"warning",children:[i.jsx(ln,{size:15}),a("projects.transferWarning")]})]})}),i.jsx(ns,{open:!!oe,title:a("projects.deleteTitle"),description:a("projects.deleteDescription",{project:oe?.name??""}),confirmLabel:a("common.delete"),danger:!0,error:he,onCancel:()=>{et(null),xe("")},onConfirm:()=>{tr()}})]}),E&&i.jsx(f.Suspense,{fallback:null,children:i.jsx(sg,{open:!0,onOpenChange:x})}),i.jsx(xa,{})]})}function bo({color:t}){return i.jsx("span",{className:`tag-dot tag-${t}`})}const fi=[{id:"jetbrains",labelKey:"projectSettings.fontJetBrains",stack:'"JetBrains Mono", ui-monospace, monospace'},{id:"source-code",labelKey:"projectSettings.fontSourceCode",stack:'"Source Code Pro", ui-monospace, monospace'},{id:"ibm-plex",labelKey:"projectSettings.fontIbmPlex",stack:'"IBM Plex Mono", ui-monospace, monospace'},{id:"fira-code",labelKey:"projectSettings.fontFiraCode",stack:'"Fira Code", ui-monospace, monospace'},{id:"iosevka",labelKey:"projectSettings.fontIosevka",stack:'"Iosevka", ui-monospace, monospace'}],Dn={font:"jetbrains",fontSize:14,lineHeight:1.65,lineWrapping:!0,spellCheck:!0,vimMode:!1,formatOnCompile:!1,texFmtConfig:"",openFilesInTabs:!1},cg="texlite-editor-preferences";function xd(t,e){return`${cg}:${encodeURIComponent(t)}:${encodeURIComponent(e)}`}function S2(t){return fi.find(e=>e.id===t)?.stack??fi[0].stack}function Su(t,e){try{const n=JSON.parse(localStorage.getItem(xd(t,e))??"{}");return{font:fi.some(s=>s.id===n.font)?n.font:Dn.font,fontSize:[12,13,14,15,16,18,20].includes(Number(n.fontSize))?Number(n.fontSize):Dn.fontSize,lineHeight:[1.45,1.65,1.85].includes(Number(n.lineHeight))?Number(n.lineHeight):Dn.lineHeight,lineWrapping:typeof n.lineWrapping=="boolean"?n.lineWrapping:Dn.lineWrapping,spellCheck:typeof n.spellCheck=="boolean"?n.spellCheck:Dn.spellCheck,vimMode:typeof n.vimMode=="boolean"?n.vimMode:Dn.vimMode,formatOnCompile:typeof n.formatOnCompile=="boolean"?n.formatOnCompile:Dn.formatOnCompile,texFmtConfig:typeof n.texFmtConfig=="string"&&n.texFmtConfig.length<=16*1024?n.texFmtConfig:Dn.texFmtConfig,openFilesInTabs:typeof n.openFilesInTabs=="boolean"?n.openFilesInTabs:Dn.openFilesInTabs}}catch{return Dn}}function ug(t,e,n){localStorage.setItem(xd(t,e),JSON.stringify(n))}function lg(){let t={status:"loading",error:""};const e=new Set,n=(s,r="")=>{if(!(t.status===s&&t.error===r)){t={status:s,error:r};for(const o of e)o()}};return{getSnapshot:()=>t,subscribe:s=>(e.add(s),()=>e.delete(s)),loading:()=>n("loading"),working:()=>n("working"),failed:s=>n("error",s instanceof Error?s.message:String(s))}}const Yt=lg(),dg=/\.(?:tex|bib|cls|sty)$/i,vd=3e4;let un=null,mi=!1,Qn=null,hg=1;const rs=new Map,pi=[];let js=null,lr=null;class Gt extends Error{constructor(e,n){super(n),this.kind=e,this.name="TexFmtError"}kind}function yo(t){return t instanceof Gt}function Tn(t){un?.terminate(),un=null,mi=!1,Qn!==null&&window.clearTimeout(Qn),Qn=null,js=null,pi.length=0,lr=null,Yt.failed(t);for(const e of rs.values())e.timeout!==null&&window.clearTimeout(e.timeout),e.reject(t);rs.clear()}function Dr(){if(js!==null||pi.length===0)return;let t;try{t=fg()}catch(s){Tn(s instanceof Gt?s:new Gt("load","The bundled tex-fmt formatter could not be loaded."));return}if(!mi)return;const e=pi.shift();if(e===void 0)return;const n=rs.get(e);if(!n){Dr();return}js=e,n.timeout=window.setTimeout(()=>{js===e&&Tn(new Gt("result","The formatter did not respond within 30 seconds."))},vd);try{t.postMessage({...n.request,id:e})}catch{Tn(new Gt("load","The formatter worker could not receive the source."))}}function fg(){if(un)return un;if(typeof Worker>"u"){const t=new Gt("load","This browser does not support formatter workers.");throw Yt.failed(t),t}Yt.loading();try{un=new Worker(new URL("/assets/latexFormatterWorker-DYkYtcFy.js",import.meta.url),{type:"module",name:"texlite-latex-formatter"}),Qn=window.setTimeout(()=>{mi||Tn(new Gt("load","The formatter did not finish loading within 30 seconds."))},vd)}catch{const t=new Gt("load","The bundled tex-fmt formatter could not be loaded.");throw Yt.failed(t),t}return un.onmessage=t=>{const e=t.data;if(e&&"type"in e){e.type==="ready"&&(mi=!0,Qn!==null&&window.clearTimeout(Qn),Qn=null,Dr());return}if(!e||typeof e.id!="number"){Tn(new Gt("result","The formatter worker returned an invalid response."));return}const n=rs.get(e.id);if(n)if(rs.delete(e.id),n.timeout!==null&&window.clearTimeout(n.timeout),js===e.id&&(js=null),e.ok)Yt.working(),n.resolve(e.result),Dr();else{const s=new Gt(e.kind,e.message);e.kind==="format"?(Yt.working(),n.reject(s),Dr()):(n.reject(s),Tn(s))}},un.onerror=()=>{Tn(new Gt("load","The bundled tex-fmt formatter could not be loaded."))},un.onmessageerror=()=>{Tn(new Gt("result","The formatter worker returned an unreadable response."))},un}function Ma(t){const e=hg++;return new Promise((n,s)=>{rs.set(e,{request:t,resolve:n,reject:s,timeout:null}),pi.push(e),Dr()})}function mg(t,e=""){return Ma({action:"format",source:t,config:e})}async function Ad(){un&&Yt.getSnapshot().status==="working"||(lr||(lr=Ma({action:"probe"}).then(()=>{}).finally(()=>{lr=null})),await lr)}async function pg(){(un||rs.size)&&Tn(new Gt("load","The formatter runtime was reloaded.")),Yt.loading(),await Ad()}function Zr(t){return dg.test(t)}function Dg(t){return t.match(/(?:\r?\n)+$/)?.[0]??""}function gg(t,e){const n=Dg(t),a=(n?t.slice(0,-n.length):t).split(/\r?\n/).find(l=>l.trim())?.match(/^[\t ]*/)?.[0]??"",c=e.replace(/(?:\r?\n)+$/,"");return`${a?c.split(`
|
|
40
|
-
`).map(l=>l&&`${a}${l}`).join(`
|
|
41
|
-
`):c}${n}`}async function Co(t,e,n=0){return Ma({action:"diff",source:t,formatted:e,baseOffset:n})}function Fg(t,e=null){const n=ju(t),r=e==="succeeded"||e===null&&yg(t)?[]:Bu(n.filter(Tu)),o=ju(bg(t));return{warnings:Bu(o.filter(c=>!Tu(c)&&Cg(c))),errors:r}}function ju(t){return t.split(`
|
|
42
|
-
`).map(e=>e.trim()).filter(Boolean)}function Bu(t){return[...new Set(t)]}function bg(t){const e=/^Running ['"][^\n]*(?:pdf|xe|lua)latex(?:\s|['"])[^\n]*$/gim;let n=-1;for(const s of t.matchAll(e))n=s.index;return n>=0?t.slice(n):t}function yg(t){return/Latexmk: All targets .* are up-to-date/i.test(t)&&/Output written on .*\.pdf/i.test(t)}function Tu(t){return/^!\s/.test(t)||/(?:^|:\s)(?:LaTeX|Package|Class|pdfTeX|XeTeX|LuaTeX)?\s*Error:/i.test(t)||/^Latexmk:.*(?:\bErrors?,|did not complete making targets|failure)/i.test(t)||/^Collected error summary/i.test(t)||/\b(?:fatal error|emergency stop|undefined control sequence|no output pdf|no pages of output)\b/i.test(t)||/\b(?:bibtex|biber) errors?:/i.test(t)||/^error, and then rerun latexmk/i.test(t)}function Cg(t){return/\bwarnings?\b|overfull|underfull|badness/i.test(t)}function Eg(t){return t instanceof Error&&t.name==="AbortError"}function wg({projectId:t,activeFile:e,permission:n,revision:s,selection:r,save:o,onError:a,onAdded:c}){const[u,l]=f.useState([]),[d,h]=f.useState(null),[D,p]=f.useState(!1),[F,y]=f.useState(""),b=f.useRef(null),E=f.useRef(e),x=f.useRef(o),N=f.useRef(a),O=f.useRef(c);E.current=e,x.current=o,N.current=a,O.current=c;const I=async K=>{b.current?.abort();const L=new AbortController;b.current=L;try{const S=await re(`/api/projects/${t}/comments?path=${encodeURIComponent(K)}`,{signal:L.signal});E.current===K&&l(S.comments)}catch(S){!Eg(S)&&E.current===K&&l([])}finally{b.current===L&&(b.current=null)}};return f.useEffect(()=>{h(null)},[t,e]),f.useEffect(()=>(e?I(e):l([]),()=>{b.current?.abort(),b.current=null}),[t,e,s]),{comments:u,focusComment:d,setFocusComment:h,commentOpen:D,setCommentOpen:p,commentText:F,setCommentText:y,addComment:async()=>{if(!(!F.trim()||!e))try{if(n!=="read"&&!await x.current())return;await re(`/api/projects/${t}/comments`,{method:"POST",body:JSON.stringify({path:e,content:F,...r})}),await I(e),p(!1),y(""),O.current()}catch(K){N.current(ce(K))}},toggleComment:async K=>{try{await re(`/api/projects/${t}/comments/${K.id}`,{method:"PATCH",body:JSON.stringify({resolved:!K.resolved})}),await I(e)}catch(L){N.current(ce(L))}},replyToComment:async(K,L)=>{try{return await re(`/api/projects/${t}/comments/${K.id}/replies`,{method:"POST",body:JSON.stringify({content:L})}),await I(e),!0}catch(S){return N.current(ce(S)),!1}},editComment:async(K,L)=>{try{return await re(`/api/projects/${t}/comments/${K.id}`,{method:"PATCH",body:JSON.stringify({content:L})}),await I(e),!0}catch(S){return N.current(ce(S)),!1}},deleteComment:async K=>{try{return await re(`/api/projects/${t}/comments/${K.id}`,{method:"DELETE"}),await I(e),h(L=>L?.id===K.id?null:L),!0}catch(L){return N.current(ce(L)),!1}},editCommentReply:async(K,L,S)=>{try{return await re(`/api/projects/${t}/comments/${K.id}/replies/${L}`,{method:"PATCH",body:JSON.stringify({content:S})}),await I(e),!0}catch(P){return N.current(ce(P)),!1}},deleteCommentReply:async(K,L)=>{try{return await re(`/api/projects/${t}/comments/${K.id}/replies/${L}`,{method:"DELETE"}),await I(e),!0}catch(S){return N.current(ce(S)),!1}}}}const Kt=()=>new Map,oa=t=>{const e=Kt();return t.forEach((n,s)=>{e.set(s,n)}),e},En=(t,e,n)=>{let s=t.get(e);return s===void 0&&t.set(e,s=n()),s},xg=(t,e)=>{const n=[];for(const[s,r]of t)n.push(e(r,s));return n},vg=(t,e)=>{for(const[n,s]of t)if(e(s,n))return!0;return!1},Hn=()=>new Set,Eo=t=>t[t.length-1],Ag=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},Rn=Array.from,$a=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},Ua=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},kg=(t,e)=>{const n=new Array(t);for(let s=0;s<t;s++)n[s]=e(s,n);return n},$s=Array.isArray;class za{constructor(){this._observers=Kt()}on(e,n){return En(this._observers,e,Hn).add(n),n}once(e,n){const s=(...r)=>{this.off(e,s),n(...r)};this.on(e,s)}off(e,n){const s=this._observers.get(e);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(e))}emit(e,n){return Rn((this._observers.get(e)||Kt()).values()).forEach(s=>s(...n))}destroy(){this._observers=Kt()}}class kd{constructor(){this._observers=Kt()}on(e,n){En(this._observers,e,Hn).add(n)}once(e,n){const s=(...r)=>{this.off(e,s),n(...r)};this.on(e,s)}off(e,n){const s=this._observers.get(e);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(e))}emit(e,n){return Rn((this._observers.get(e)||Kt()).values()).forEach(s=>s(...n))}destroy(){this._observers=Kt()}}const hn=Math.floor,ri=Math.abs,Va=(t,e)=>t<e?t:e,us=(t,e)=>t>e?t:e,Sg=Math.pow,Sd=t=>t!==0?t<0:1/t<0,Lu=1,Nu=2,wo=4,xo=8,Er=32,Ln=64,Xt=128,Oi=31,aa=63,ts=127,jg=2147483647,Di=Number.MAX_SAFE_INTEGER,Ru=Number.MIN_SAFE_INTEGER,Bg=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&hn(t)===t),jd=String.fromCharCode,Tg=t=>t.toLowerCase(),Lg=/^\s*/g,Ng=t=>t.replace(Lg,""),Rg=/([A-Z])/g,Ou=(t,e)=>Ng(t.replace(Rg,n=>`${e}${Tg(n)}`)),Og=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=e.codePointAt(r);return s},wr=typeof TextEncoder<"u"?new TextEncoder:null,Pg=t=>wr.encode(t),_g=wr?Pg:Og;let gr=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});gr&&gr.decode(new Uint8Array).length===1&&(gr=null);const Ig=(t,e)=>kg(e,()=>t).join("");class Rr{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const lt=()=>new Rr,Ha=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},Xe=t=>{const e=new Uint8Array(Ha(t));let n=0;for(let s=0;s<t.bufs.length;s++){const r=t.bufs[s];e.set(r,n),n+=r.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},Mg=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(us(n,e)*2),t.cpos=0)},Bt=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},ca=Bt,le=(t,e)=>{for(;e>ts;)Bt(t,Xt|ts&e),e=hn(e/128);Bt(t,ts&e)},qa=(t,e)=>{const n=Sd(e);for(n&&(e=-e),Bt(t,(e>aa?Xt:0)|(n?Ln:0)|aa&e),e=hn(e/64);e>0;)Bt(t,(e>ts?Xt:0)|ts&e),e=hn(e/128)},ua=new Uint8Array(3e4),$g=ua.length/3,Ug=(t,e)=>{if(e.length<$g){const n=wr.encodeInto(e,ua).written||0;le(t,n);for(let s=0;s<n;s++)Bt(t,ua[s])}else ut(t,_g(e))},zg=(t,e)=>{const n=unescape(encodeURIComponent(e)),s=n.length;le(t,s);for(let r=0;r<s;r++)Bt(t,n.codePointAt(r))},_t=wr&&wr.encodeInto?Ug:zg,Pi=(t,e)=>{const n=t.cbuf.length,s=t.cpos,r=Va(n-s,e.length),o=e.length-r;t.cbuf.set(e.subarray(0,r),s),t.cpos+=r,o>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(us(n*2,o)),t.cbuf.set(e.subarray(r)),t.cpos=o)},ut=(t,e)=>{le(t,e.byteLength),Pi(t,e)},Ka=(t,e)=>{Mg(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},Vg=(t,e)=>Ka(t,4).setFloat32(0,e,!1),Hg=(t,e)=>Ka(t,8).setFloat64(0,e,!1),qg=(t,e)=>Ka(t,8).setBigInt64(0,e,!1),Pu=new DataView(new ArrayBuffer(4)),Kg=t=>(Pu.setFloat32(0,t),Pu.getFloat32(0)===t),xr=(t,e)=>{switch(typeof e){case"string":Bt(t,119),_t(t,e);break;case"number":Bg(e)&&ri(e)<=jg?(Bt(t,125),qa(t,e)):Kg(e)?(Bt(t,124),Vg(t,e)):(Bt(t,123),Hg(t,e));break;case"bigint":Bt(t,122),qg(t,e);break;case"object":if(e===null)Bt(t,126);else if($s(e)){Bt(t,117),le(t,e.length);for(let n=0;n<e.length;n++)xr(t,e[n])}else if(e instanceof Uint8Array)Bt(t,116),ut(t,e);else{Bt(t,118);const n=Object.keys(e);le(t,n.length);for(let s=0;s<n.length;s++){const r=n[s];_t(t,r),xr(t,e[r])}}break;case"boolean":Bt(t,e?120:121);break;default:Bt(t,127)}};class _u extends Rr{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&le(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const Iu=t=>{t.count>0&&(qa(t.encoder,t.count===1?t.s:-t.s),t.count>1&&le(t.encoder,t.count-2))};class ii{constructor(){this.encoder=new Rr,this.s=0,this.count=0}write(e){this.s===e?this.count++:(Iu(this),this.count=1,this.s=e)}toUint8Array(){return Iu(this),Xe(this.encoder)}}const Mu=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);qa(t.encoder,e),t.count>1&&le(t.encoder,t.count-2)}};class vo{constructor(){this.encoder=new Rr,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Mu(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Mu(this),Xe(this.encoder)}}class Wg{constructor(){this.sarr=[],this.s="",this.lensE=new ii}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Rr;return this.sarr.push(this.s),this.s="",_t(e,this.sarr.join("")),Pi(e,this.lensE.toUint8Array()),Xe(e)}}const fn=t=>new Error(t),dn=()=>{throw fn("Method unimplemented")},Jt=()=>{throw fn("Unexpected case")},Bd=fn("Unexpected end of array"),Td=fn("Integer out of Range");class _i{constructor(e){this.arr=e,this.pos=0}}const Gn=t=>new _i(t),la=t=>t.pos!==t.arr.length,Gg=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},It=t=>Gg(t,ke(t)),Us=t=>t.arr[t.pos++],ke=t=>{let e=0,n=1;const s=t.arr.length;for(;t.pos<s;){const r=t.arr[t.pos++];if(e=e+(r&ts)*n,n*=128,r<Xt)return e;if(e>Di)throw Td}throw Bd},Wa=t=>{let e=t.arr[t.pos++],n=e&aa,s=64;const r=(e&Ln)>0?-1:1;if((e&Xt)===0)return r*n;const o=t.arr.length;for(;t.pos<o;){if(e=t.arr[t.pos++],n=n+(e&ts)*s,s*=128,e<Xt)return r*n;if(n>Di)throw Td}throw Bd},Yg=t=>{let e=ke(t);if(e===0)return"";{let n=String.fromCodePoint(Us(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(Us(t));else for(;e>0;){const s=e<1e4?e:1e4,r=t.arr.subarray(t.pos,t.pos+s);t.pos+=s,n+=String.fromCodePoint.apply(null,r),e-=s}return decodeURIComponent(escape(n))}},Xg=t=>gr.decode(It(t)),rt=gr?Xg:Yg,Ga=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},Jg=t=>Ga(t,4).getFloat32(0,!1),Zg=t=>Ga(t,8).getFloat64(0,!1),Qg=t=>Ga(t,8).getBigInt64(0,!1),e1=[t=>{},t=>null,Wa,Jg,Zg,Qg,t=>!1,t=>!0,rt,t=>{const e=ke(t),n={};for(let s=0;s<e;s++){const r=rt(t);n[r]=vr(t)}return n},t=>{const e=ke(t),n=[];for(let s=0;s<e;s++)n.push(vr(t));return n},It],vr=t=>e1[127-Us(t)](t);class $u extends _i{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),la(this)?this.count=ke(this)+1:this.count=-1),this.count--,this.s}}class oi extends _i{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Wa(this);const e=Sd(this.s);this.count=1,e&&(this.s=-this.s,this.count=ke(this)+2)}return this.count--,this.s}}class Ao extends _i{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=Wa(this),n=e&1;this.diff=hn(e/2),this.count=1,n&&(this.count=ke(this)+2)}return this.s+=this.diff,this.count--,this.s}}class t1{constructor(e){this.decoder=new oi(e),this.str=rt(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),n=this.str.slice(this.spos,e);return this.spos=e,n}}const n1=crypto.getRandomValues.bind(crypto),Ld=()=>n1(new Uint32Array(1))[0],s1="10000000-1000-4000-8000"+-1e11,r1=()=>s1.replace(/[018]/g,t=>(t^Ld()&15>>t/4).toString(16)),qn=Date.now,zs=t=>new Promise(t);Promise.all.bind(Promise);const Uu=t=>t===void 0?null:t;class i1{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let Nd=new i1,Ya=!0;try{typeof localStorage<"u"&&localStorage&&(Nd=localStorage,Ya=!1)}catch{}const Rd=Nd,o1=t=>Ya||addEventListener("storage",t),a1=t=>Ya||removeEventListener("storage",t),Ar=Symbol("Equality"),Od=(t,e)=>t===e||!!t?.[Ar]?.(e)||!1,c1=t=>typeof t=="object",u1=Object.assign,l1=Object.keys,d1=(t,e)=>{for(const n in t)e(t[n],n)},h1=(t,e)=>{const n=[];for(const s in t)n.push(e(t[s],s));return n},gi=t=>l1(t).length,f1=t=>{for(const e in t)return!1;return!0},Or=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},Xa=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),m1=(t,e)=>t===e||gi(t)===gi(e)&&Or(t,(n,s)=>(n!==void 0||Xa(e,s))&&Od(e[s],n)),p1=Object.freeze,Pd=t=>{for(const e in t){const n=t[e];(typeof n=="object"||typeof n=="function")&&Pd(t[e])}return p1(t)},Ja=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&Ja(t,e,n+1)}},D1=t=>t,Bs=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[Ar]!=null)return t[Ar](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!Bs(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(gi(t)!==gi(e))return!1;for(const n in t)if(!Xa(t,n)||!Bs(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Bs(t[n],e[n]))return!1;break;default:return!1}return!0},g1=(t,e)=>e.includes(t);var _d={};const Kn=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",Id=typeof window<"u"&&typeof document<"u"&&!Kn;let gn;const F1=()=>{if(gn===void 0)if(Kn){gn=Kt();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const s=t[n];s[0]==="-"?(e!==null&&gn.set(e,""),e=s):e!==null&&(gn.set(e,s),e=null)}e!==null&&gn.set(e,"")}else typeof location=="object"?(gn=Kt(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");gn.set(`--${Ou(e,"-")}`,n),gn.set(`-${Ou(e,"-")}`,n)}})):gn=Kt();return gn},da=t=>F1().has(t),Fi=t=>Uu(Kn?_d[t.toUpperCase().replaceAll("-","_")]:Rd.getItem(t)),Md=t=>da("--"+t)||Fi(t)!==null,b1=Md("production"),y1=Kn&&g1(_d.FORCE_COLOR,["true","1","2"]),C1=y1||!da("--no-colors")&&!Md("no-color")&&(!Kn||process.stdout.isTTY)&&(!Kn||da("--color")||Fi("COLORTERM")!==null||(Fi("TERM")||"").includes("color")),$d=t=>new Uint8Array(t),E1=(t,e,n)=>new Uint8Array(t,e,n),w1=t=>new Uint8Array(t),x1=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=jd(t[n]);return btoa(e)},v1=t=>Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),A1=t=>{const e=atob(t),n=$d(e.length);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return n},k1=t=>{const e=Buffer.from(t,"base64");return E1(e.buffer,e.byteOffset,e.byteLength)},S1=Id?x1:v1,j1=Id?A1:k1,B1=t=>{const e=$d(t.byteLength);return e.set(t),e};class T1{constructor(e,n){this.left=e,this.right=n}}const jn=(t,e)=>new T1(t,e),L1=(t,e)=>t.forEach(n=>e(n.left,n.right)),zu=t=>t.next()>=.5,ko=(t,e,n)=>hn(t.next()*(n+1-e)+e),Ud=(t,e,n)=>hn(t.next()*(n+1-e)+e),Za=(t,e,n)=>Ud(t,e,n),N1=t=>jd(Za(t,97,122)),R1=(t,e=0,n=20)=>{const s=Za(t,e,n);let r="";for(let o=0;o<s;o++)r+=N1(t);return r},So=(t,e)=>e[Za(t,0,e.length-1)],O1=Symbol("0schema");class P1{constructor(){this._rerrs=[]}extend(e,n,s,r=null){this._rerrs.push({path:e,expected:n,has:s,message:r})}toString(){const e=[];for(let n=this._rerrs.length-1;n>0;n--){const s=this._rerrs[n];e.push(Ig(" ",(this._rerrs.length-n)*2)+`${s.path!=null?`[${s.path}] `:""}${s.has} doesn't match ${s.expected}. ${s.message}`)}return e.join(`
|
|
43
|
-
`)}}const ha=(t,e)=>t===e?!0:t==null||e==null||t.constructor!==e.constructor?!1:t[Ar]?Od(t,e):$s(t)?$a(t,n=>Ua(e,s=>ha(n,s))):c1(t)?Or(t,(n,s)=>ha(n,e[s])):!1;class Ut{static _dilutes=!1;extends(e){let[n,s]=[this.shape,e.shape];return this.constructor._dilutes&&([s,n]=[n,s]),ha(n,s)}equals(e){return this.constructor===e.constructor&&Bs(this.shape,e.shape)}[O1](){return!0}[Ar](e){return this.equals(e)}validate(e){return this.check(e)}check(e,n){dn()}get nullable(){return Js(this,zi)}get optional(){return new Hd(this)}cast(e){return Vu(e,this),e}expect(e){return Vu(e,this),e}}class Qa extends Ut{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n=void 0){const s=e?.constructor===this.shape&&(this._c==null||this._c(e));return!s&&n?.extend(null,this.shape.name,e?.constructor.name,e?.constructor!==this.shape?"Constructor match failed":"Check failed"),s}}const yt=(t,e=null)=>new Qa(t,e);yt(Qa);class ec extends Ut{constructor(e){super(),this.shape=e}check(e,n){const s=this.shape(e);return!s&&n?.extend(null,"custom prop",e?.constructor.name,"failed to check custom prop"),s}}const Nt=t=>new ec(t);yt(ec);class Ii extends Ut{constructor(e){super(),this.shape=e}check(e,n){const s=this.shape.some(r=>r===e);return!s&&n?.extend(null,this.shape.join(" | "),e.toString()),s}}const Mi=(...t)=>new Ii(t),zd=yt(Ii),_1=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),Vd=t=>{if(Vs.check(t))return[_1(t)];if(zd.check(t))return t.shape.map(e=>e+"");if(Qd.check(t))return["[+-]?\\d+.?\\d*"];if(eh.check(t))return[".*"];if(bi.check(t))return t.shape.map(Vd).flat(1);Jt()};class I1 extends Ut{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(Vd).map(n=>`(${n.join("|")})`).join("")+"$")}check(e,n){const s=this._r.exec(e)!=null;return!s&&n?.extend(null,this._r.toString(),e.toString(),"String doesn't match string template."),s}}yt(I1);const M1=Symbol("optional");class Hd extends Ut{constructor(e){super(),this.shape=e}check(e,n){const s=e===void 0||this.shape.check(e);return!s&&n?.extend(null,"undefined (optional)","()"),s}get[M1](){return!0}}const $1=yt(Hd);class U1 extends Ut{check(e,n){return n?.extend(null,"never",typeof e),!1}}yt(U1);class $i extends Ut{constructor(e,n=!1){super(),this.shape=e,this._isPartial=n}static _dilutes=!0;get partial(){return new $i(this.shape,!0)}check(e,n){return e==null?(n?.extend(null,"object","null"),!1):Or(this.shape,(s,r)=>{const o=this._isPartial&&!Xa(e,r)||s.check(e[r],n);return!o&&n?.extend(r.toString(),s.toString(),typeof e[r],"Object property does not match"),o})}}const z1=t=>new $i(t),V1=yt($i),H1=Nt(t=>t!=null&&(t.constructor===Object||t.constructor==null));class qd extends Ut{constructor(e,n){super(),this.shape={keys:e,values:n}}check(e,n){return e!=null&&Or(e,(s,r)=>{const o=this.shape.keys.check(r,n);return!o&&n?.extend(r+"","Record",typeof e,o?"Key doesn't match schema":"Value doesn't match value"),o&&this.shape.values.check(s,n)})}}const Kd=(t,e)=>new qd(t,e),q1=yt(qd);class Wd extends Ut{constructor(e){super(),this.shape=e}check(e,n){return e!=null&&Or(this.shape,(s,r)=>{const o=s.check(e[r],n);return!o&&n?.extend(r.toString(),"Tuple",typeof s),o})}}const K1=(...t)=>new Wd(t);yt(Wd);class Gd extends Ut{constructor(e){super(),this.shape=e.length===1?e[0]:new tc(e)}check(e,n){const s=$s(e)&&$a(e,r=>this.shape.check(r));return!s&&n?.extend(null,"Array",""),s}}const Yd=(...t)=>new Gd(t),W1=yt(Gd),G1=Nt(t=>$s(t));class Xd extends Ut{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n){const s=e instanceof this.shape&&(this._c==null||this._c(e));return!s&&n?.extend(null,this.shape.name,e?.constructor.name),s}}const Y1=(t,e=null)=>new Xd(t,e);yt(Xd);const X1=Y1(Ut);class J1 extends Ut{constructor(e){super(),this.len=e.length-1,this.args=K1(...e.slice(-1)),this.res=e[this.len]}check(e,n){const s=e.constructor===Function&&e.length<=this.len;return!s&&n?.extend(null,"function",typeof e),s}}const Z1=yt(J1),Q1=Nt(t=>typeof t=="function");class eF extends Ut{constructor(e){super(),this.shape=e}check(e,n){const s=$a(this.shape,r=>r.check(e,n));return!s&&n?.extend(null,"Intersectinon",typeof e),s}}yt(eF,t=>t.shape.length>0);class tc extends Ut{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,n){const s=Ua(this.shape,r=>r.check(e,n));return n?.extend(null,"Union",typeof e),s}}const Js=(...t)=>t.findIndex(e=>bi.check(e))>=0?Js(...t.map(e=>kr(e)).map(e=>bi.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new tc(t),bi=yt(tc),Jd=()=>!0,yi=Nt(Jd),tF=yt(ec,t=>t.shape===Jd),nc=Nt(t=>typeof t=="bigint"),nF=Nt(t=>t===nc),Zd=Nt(t=>typeof t=="symbol");Nt(t=>t===Zd);const Ts=Nt(t=>typeof t=="number"),Qd=Nt(t=>t===Ts),Vs=Nt(t=>typeof t=="string"),eh=Nt(t=>t===Vs),Ui=Nt(t=>typeof t=="boolean"),sF=Nt(t=>t===Ui),th=Mi(void 0);yt(Ii,t=>t.shape.length===1&&t.shape[0]===void 0);Mi(void 0);const zi=Mi(null),rF=yt(Ii,t=>t.shape.length===1&&t.shape[0]===null);yt(Uint8Array);yt(Qa,t=>t.shape===Uint8Array);const iF=Js(Ts,Vs,zi,th,nc,Ui,Zd);(()=>{const t=Yd(yi),e=Kd(Vs,yi),n=Js(Ts,Vs,zi,Ui,t,e);return t.shape=n,e.shape.values=n,n})();const kr=t=>{if(X1.check(t))return t;if(H1.check(t)){const e={};for(const n in t)e[n]=kr(t[n]);return z1(e)}else{if(G1.check(t))return Js(...t.map(kr));if(iF.check(t))return Mi(t);if(Q1.check(t))return yt(t)}Jt()},Vu=b1?()=>{}:(t,e)=>{const n=new P1;if(!e.check(t,n))throw fn(`Expected value to be of type ${e.constructor.name}.
|
|
44
|
-
${n.toString()}`)};class oF{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:kr(e),h:n}),this}else(e){return this.if(yi,e)}done(){return(e,n)=>{for(let s=0;s<this.patterns.length;s++){const r=this.patterns[s];if(r.if.check(e))return r.h(e,n)}throw fn("Unhandled pattern")}}}const aF=t=>new oF(t),nh=aF(yi).if(Qd,(t,e)=>ko(e,Ru,Di)).if(eh,(t,e)=>R1(e)).if(sF,(t,e)=>zu(e)).if(nF,(t,e)=>BigInt(ko(e,Ru,Di))).if(bi,(t,e)=>ys(e,So(e,t.shape))).if(V1,(t,e)=>{const n={};for(const s in t.shape){let r=t.shape[s];if($1.check(r)){if(zu(e))continue;r=r.shape}n[s]=nh(r,e)}return n}).if(W1,(t,e)=>{const n=[],s=Ud(e,0,42);for(let r=0;r<s;r++)n.push(ys(e,t.shape));return n}).if(zd,(t,e)=>So(e,t.shape)).if(rF,(t,e)=>null).if(Z1,(t,e)=>{const n=ys(e,t.res);return()=>n}).if(tF,(t,e)=>ys(e,So(e,[Ts,Vs,zi,th,nc,Ui,Yd(Ts),Kd(Js("a","b","c"),Ts)]))).if(q1,(t,e)=>{const n={},s=ko(e,0,3);for(let r=0;r<s;r++){const o=ys(e,t.shape.keys),a=ys(e,t.shape.values);n[o]=a}return n}).done(),ys=(t,e)=>nh(kr(e),t),wn=typeof document<"u"?document:{},cF=t=>wn.createElement(t),uF=()=>wn.createDocumentFragment();Nt(t=>t.nodeType===FF);const lF=t=>wn.createTextNode(t);typeof DOMParser<"u"&&new DOMParser;const dF=(t,e)=>(L1(e,(n,s)=>{s===!1?t.removeAttribute(n):s===!0?t.setAttribute(n,""):t.setAttribute(n,s)}),t),hF=t=>{const e=uF();for(let n=0;n<t.length;n++)sh(e,t[n]);return e},fF=(t,e)=>(sh(t,hF(e)),t),j2=(t,e=[],n=[])=>fF(dF(cF(t),e),n);Nt(t=>t.nodeType===pF);const B2=lF;Nt(t=>t.nodeType===DF);const mF=t=>xg(t,(e,n)=>`${n}:${e};`).join(""),sh=(t,e)=>t.appendChild(e),pF=wn.ELEMENT_NODE,DF=wn.TEXT_NODE;wn.CDATA_SECTION_NODE;wn.COMMENT_NODE;const gF=wn.DOCUMENT_NODE;wn.DOCUMENT_TYPE_NODE;const FF=wn.DOCUMENT_FRAGMENT_NODE;Nt(t=>t.nodeType===gF);const On=Symbol,rh=On(),ih=On(),bF=On(),yF=On(),CF=On(),oh=On(),EF=On(),sc=On(),wF=On(),xF=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[];let s=0;for(;s<t.length;s++){const r=t[s];if(r===void 0)break;if(r.constructor===String||r.constructor===Number)e.push(r);else if(r.constructor===Object)break}for(s>0&&n.push(e.join(""));s<t.length;s++){const r=t[s];r instanceof Symbol||n.push(r)}return n},vF={[rh]:jn("font-weight","bold"),[ih]:jn("font-weight","normal"),[bF]:jn("color","blue"),[CF]:jn("color","green"),[yF]:jn("color","grey"),[oh]:jn("color","red"),[EF]:jn("color","purple"),[sc]:jn("color","orange"),[wF]:jn("color","black")},AF=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[],s=Kt();let r=[],o=0;for(;o<t.length;o++){const a=t[o],c=vF[a];if(c!==void 0)s.set(c.left,c.right);else{if(a===void 0)break;if(a.constructor===String||a.constructor===Number){const u=mF(s);o>0||u.length>0?(e.push("%c"+a),n.push(u)):e.push(a)}else break}}for(o>0&&(r=n,r.unshift(e.join("")));o<t.length;o++){const a=t[o];a instanceof Symbol||r.push(a)}return r},ah=C1?AF:xF,kF=(...t)=>{console.log(...ah(t)),uh.forEach(e=>e.print(t))},ch=(...t)=>{console.warn(...ah(t)),t.unshift(sc),uh.forEach(e=>e.print(t))},uh=Hn(),lh=t=>({[Symbol.iterator](){return this},next:t}),SF=(t,e)=>lh(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),jo=(t,e)=>lh(()=>{const{done:n,value:s}=t.next();return{done:n,value:n?void 0:e(s)}});class Vi{constructor(e,n){this.clock=e,this.len=n}}class Zs{constructor(){this.clients=new Map}}const Hs=(t,e,n)=>e.clients.forEach((s,r)=>{const o=t.doc.store.clients.get(r);if(o!=null){const a=o[o.length-1],c=a.id.clock+a.length;for(let u=0,l=s[u];u<s.length&&l.clock<c;l=s[++u])vh(t,o,l.clock,l.len,n)}}),jF=(t,e)=>{let n=0,s=t.length-1;for(;n<=s;){const r=hn((n+s)/2),o=t[r],a=o.clock;if(a<=e){if(e<a+o.len)return r;n=r+1}else s=r-1}return null},Pr=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&jF(n,e.clock)!==null},rc=t=>{t.clients.forEach(e=>{e.sort((r,o)=>r.clock-o.clock);let n,s;for(n=1,s=1;n<e.length;n++){const r=e[s-1],o=e[n];r.clock+r.len>=o.clock?e[s-1]=new Vi(r.clock,us(r.len,o.clock+o.len-r.clock)):(s<n&&(e[s]=o),s++)}e.length=s})},fa=t=>{const e=new Zs;for(let n=0;n<t.length;n++)t[n].clients.forEach((s,r)=>{if(!e.clients.has(r)){const o=s.slice();for(let a=n+1;a<t.length;a++)Ag(o,t[a].clients.get(r)||[]);e.clients.set(r,o)}});return rc(e),e},Sr=(t,e,n,s)=>{En(t.clients,e,()=>[]).push(new Vi(n,s))},BF=()=>new Zs,TF=t=>{const e=BF();return t.clients.forEach((n,s)=>{const r=[];for(let o=0;o<n.length;o++){const a=n[o];if(a.deleted){const c=a.id.clock;let u=a.length;if(o+1<n.length)for(let l=n[o+1];o+1<n.length&&l.deleted;l=n[++o+1])u+=l.length;r.push(new Vi(c,u))}}r.length>0&&e.clients.set(s,r)}),e},Qs=(t,e)=>{le(t.restEncoder,e.clients.size),Rn(e.clients.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{t.resetDsCurVal(),le(t.restEncoder,n);const r=s.length;le(t.restEncoder,r);for(let o=0;o<r;o++){const a=s[o];t.writeDsClock(a.clock),t.writeDsLen(a.len)}})},ic=t=>{const e=new Zs,n=ke(t.restDecoder);for(let s=0;s<n;s++){t.resetDsCurVal();const r=ke(t.restDecoder),o=ke(t.restDecoder);if(o>0){const a=En(e.clients,r,()=>[]);for(let c=0;c<o;c++)a.push(new Vi(t.readDsClock(),t.readDsLen()))}}return e},Hu=(t,e,n)=>{const s=new Zs,r=ke(t.restDecoder);for(let o=0;o<r;o++){t.resetDsCurVal();const a=ke(t.restDecoder),c=ke(t.restDecoder),u=n.clients.get(a)||[],l=pt(n,a);for(let d=0;d<c;d++){const h=t.readDsClock(),D=h+t.readDsLen();if(h<l){l<D&&Sr(s,a,l,D-l);let p=bn(u,h),F=u[p];for(!F.deleted&&F.id.clock<h&&(u.splice(p+1,0,Si(e,F,h-F.id.clock)),p++);p<u.length&&(F=u[p++],F.id.clock<D);)F.deleted||(D<F.id.clock+F.length&&u.splice(p,0,Si(e,F,D-F.id.clock)),F.delete(e))}else Sr(s,a,h,D-h)}}if(s.clients.size>0){const o=new is;return le(o.restEncoder,0),Qs(o,s),o.toUint8Array()}return null},dh=Ld;class ls extends za{constructor({guid:e=r1(),collectionid:n=null,gc:s=!0,gcFilter:r=()=>!0,meta:o=null,autoLoad:a=!1,shouldLoad:c=!0}={}){super(),this.gc=s,this.gcFilter=r,this.clientID=dh(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new wh,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=a,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=zs(l=>{this.on("load",()=>{this.isLoaded=!0,l(this)})});const u=()=>zs(l=>{const d=h=>{(h===void 0||h===!0)&&(this.off("sync",d),l())};this.on("sync",d)});this.on("sync",l=>{l===!1&&this.isSynced&&(this.whenSynced=u()),this.isSynced=l===void 0||l===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=u()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Je(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Rn(this.subdocs).map(e=>e.guid))}transact(e,n=null){return Je(this,e,n)}get(e,n=Lt){const s=En(this.share,e,()=>{const o=new n;return o._integrate(this,null),o}),r=s.constructor;if(n!==Lt&&r!==n)if(r===Lt){const o=new n;o._map=s._map,s._map.forEach(a=>{for(;a!==null;a=a.left)a.parent=o}),o._start=s._start;for(let a=o._start;a!==null;a=a.right)a.parent=o;return o._length=s._length,this.share.set(e,o),o._integrate(this,null),o}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return s}getArray(e=""){return this.get(e,Rs)}getText(e=""){return this.get(e,Ws)}getMap(e=""){return this.get(e,Ks)}getXmlElement(e=""){return this.get(e,Gs)}getXmlFragment(e=""){return this.get(e,os)}toJSON(){const e={};return this.share.forEach((n,s)=>{e[s]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,Rn(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new ls({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,Je(e.parent.doc,s=>{const r=n.doc;e.deleted||s.subdocsAdded.add(r),s.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class hh{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return ke(this.restDecoder)}readDsLen(){return ke(this.restDecoder)}}class fh extends hh{readLeftID(){return Re(ke(this.restDecoder),ke(this.restDecoder))}readRightID(){return Re(ke(this.restDecoder),ke(this.restDecoder))}readClient(){return ke(this.restDecoder)}readInfo(){return Us(this.restDecoder)}readString(){return rt(this.restDecoder)}readParentInfo(){return ke(this.restDecoder)===1}readTypeRef(){return ke(this.restDecoder)}readLen(){return ke(this.restDecoder)}readAny(){return vr(this.restDecoder)}readBuf(){return B1(It(this.restDecoder))}readJSON(){return JSON.parse(rt(this.restDecoder))}readKey(){return rt(this.restDecoder)}}class LF{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=ke(this.restDecoder),this.dsCurrVal}readDsLen(){const e=ke(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class qs extends LF{constructor(e){super(e),this.keys=[],ke(e),this.keyClockDecoder=new Ao(It(e)),this.clientDecoder=new oi(It(e)),this.leftClockDecoder=new Ao(It(e)),this.rightClockDecoder=new Ao(It(e)),this.infoDecoder=new $u(It(e),Us),this.stringDecoder=new t1(It(e)),this.parentInfoDecoder=new $u(It(e),Us),this.typeRefDecoder=new oi(It(e)),this.lenDecoder=new oi(It(e))}readLeftID(){return new Ls(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Ls(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return vr(this.restDecoder)}readBuf(){return It(this.restDecoder)}readJSON(){return vr(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class mh{constructor(){this.restEncoder=lt()}toUint8Array(){return Xe(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){le(this.restEncoder,e)}writeDsLen(e){le(this.restEncoder,e)}}class _r extends mh{writeLeftID(e){le(this.restEncoder,e.client),le(this.restEncoder,e.clock)}writeRightID(e){le(this.restEncoder,e.client),le(this.restEncoder,e.clock)}writeClient(e){le(this.restEncoder,e)}writeInfo(e){ca(this.restEncoder,e)}writeString(e){_t(this.restEncoder,e)}writeParentInfo(e){le(this.restEncoder,e?1:0)}writeTypeRef(e){le(this.restEncoder,e)}writeLen(e){le(this.restEncoder,e)}writeAny(e){xr(this.restEncoder,e)}writeBuf(e){ut(this.restEncoder,e)}writeJSON(e){_t(this.restEncoder,JSON.stringify(e))}writeKey(e){_t(this.restEncoder,e)}}class ph{constructor(){this.restEncoder=lt(),this.dsCurrVal=0}toUint8Array(){return Xe(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,le(this.restEncoder,n)}writeDsLen(e){e===0&&Jt(),le(this.restEncoder,e-1),this.dsCurrVal+=e}}class is extends ph{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new vo,this.clientEncoder=new ii,this.leftClockEncoder=new vo,this.rightClockEncoder=new vo,this.infoEncoder=new _u(ca),this.stringEncoder=new Wg,this.parentInfoEncoder=new _u(ca),this.typeRefEncoder=new ii,this.lenEncoder=new ii}toUint8Array(){const e=lt();return le(e,0),ut(e,this.keyClockEncoder.toUint8Array()),ut(e,this.clientEncoder.toUint8Array()),ut(e,this.leftClockEncoder.toUint8Array()),ut(e,this.rightClockEncoder.toUint8Array()),ut(e,Xe(this.infoEncoder)),ut(e,this.stringEncoder.toUint8Array()),ut(e,Xe(this.parentInfoEncoder)),ut(e,this.typeRefEncoder.toUint8Array()),ut(e,this.lenEncoder.toUint8Array()),Pi(e,Xe(this.restEncoder)),Xe(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){xr(this.restEncoder,e)}writeBuf(e){ut(this.restEncoder,e)}writeJSON(e){xr(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const NF=(t,e,n,s)=>{s=us(s,e[0].id.clock);const r=bn(e,s);le(t.restEncoder,e.length-r),t.writeClient(n),le(t.restEncoder,s);const o=e[r];o.write(t,s-o.id.clock);for(let a=r+1;a<e.length;a++)e[a].write(t,0)},oc=(t,e,n)=>{const s=new Map;n.forEach((r,o)=>{pt(e,o)>r&&s.set(o,r)}),Hi(e).forEach((r,o)=>{n.has(o)||s.set(o,0)}),le(t.restEncoder,s.size),Rn(s.entries()).sort((r,o)=>o[0]-r[0]).forEach(([r,o])=>{NF(t,e.clients.get(r),r,o)})},RF=(t,e)=>{const n=Kt(),s=ke(t.restDecoder);for(let r=0;r<s;r++){const o=ke(t.restDecoder),a=new Array(o),c=t.readClient();let u=ke(t.restDecoder);n.set(c,{i:0,refs:a});for(let l=0;l<o;l++){const d=t.readInfo();switch(Oi&d){case 0:{const h=t.readLen();a[l]=new tn(Re(c,u),h),u+=h;break}case 10:{const h=ke(t.restDecoder);a[l]=new nn(Re(c,u),h),u+=h;break}default:{const h=(d&(Ln|Xt))===0,D=new Ze(Re(c,u),null,(d&Xt)===Xt?t.readLeftID():null,null,(d&Ln)===Ln?t.readRightID():null,h?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,h&&(d&Er)===Er?t.readString():null,qh(t,d));a[l]=D,u+=D.length}}}}return n},OF=(t,e,n)=>{const s=[];let r=Rn(n.keys()).sort((p,F)=>p-F);if(r.length===0)return null;const o=()=>{if(r.length===0)return null;let p=n.get(r[r.length-1]);for(;p.refs.length===p.i;)if(r.pop(),r.length>0)p=n.get(r[r.length-1]);else return null;return p};let a=o();if(a===null)return null;const c=new wh,u=new Map,l=(p,F)=>{const y=u.get(p);(y==null||y>F)&&u.set(p,F)};let d=a.refs[a.i++];const h=new Map,D=()=>{for(const p of s){const F=p.id.client,y=n.get(F);y?(y.i--,c.clients.set(F,y.refs.slice(y.i)),n.delete(F),y.i=0,y.refs=[]):c.clients.set(F,[p]),r=r.filter(b=>b!==F)}s.length=0};for(;;){if(d.constructor!==nn){const F=En(h,d.id.client,()=>pt(e,d.id.client))-d.id.clock;if(F<0)s.push(d),l(d.id.client,d.id.clock-1),D();else{const y=d.getMissing(t,e);if(y!==null){s.push(d);const b=n.get(y)||{refs:[],i:0};if(b.refs.length===b.i)l(y,pt(e,y)),D();else{d=b.refs[b.i++];continue}}else(F===0||F<d.length)&&(d.integrate(t,F),h.set(d.id.client,d.id.clock+d.length))}}if(s.length>0)d=s.pop();else if(a!==null&&a.i<a.refs.length)d=a.refs[a.i++];else{if(a=o(),a===null)break;d=a.refs[a.i++]}}if(c.clients.size>0){const p=new is;return oc(p,c,new Map),le(p.restEncoder,0),{missing:u,update:p.toUint8Array()}}return null},PF=(t,e)=>oc(t,e.doc.store,e.beforeState),_F=(t,e,n,s=new qs(t))=>Je(e,r=>{r.local=!1;let o=!1;const a=r.doc,c=a.store,u=RF(s,a),l=OF(r,c,u),d=c.pendingStructs;if(d){for(const[D,p]of d.missing)if(p<pt(c,D)){o=!0;break}if(l){for(const[D,p]of l.missing){const F=d.missing.get(D);(F==null||F>p)&&d.missing.set(D,p)}d.update=Ei([d.update,l.update])}}else c.pendingStructs=l;const h=Hu(s,r,c);if(c.pendingDs){const D=new qs(Gn(c.pendingDs));ke(D.restDecoder);const p=Hu(D,r,c);h&&p?c.pendingDs=Ei([h,p]):c.pendingDs=h||p}else c.pendingDs=h;if(o){const D=c.pendingStructs.update;c.pendingStructs=null,Dh(r.doc,D)}},n,!1),Dh=(t,e,n,s=qs)=>{const r=Gn(e);_F(r,t,n,new s(r))},gh=(t,e,n)=>Dh(t,e,n,fh),IF=(t,e,n=new Map)=>{oc(t,e.store,n),Qs(t,TF(e.store))},MF=(t,e=new Uint8Array([0]),n=new is)=>{const s=Fh(e);IF(n,t,s);const r=[n.toUint8Array()];if(t.store.pendingDs&&r.push(t.store.pendingDs),t.store.pendingStructs&&r.push(rb(t.store.pendingStructs.update,e)),r.length>1){if(n.constructor===_r)return nb(r.map((o,a)=>a===0?o:ob(o)));if(n.constructor===is)return Ei(r)}return r[0]},ac=(t,e)=>MF(t,e,new _r),$F=t=>{const e=new Map,n=ke(t.restDecoder);for(let s=0;s<n;s++){const r=ke(t.restDecoder),o=ke(t.restDecoder);e.set(r,o)}return e},Fh=t=>$F(new hh(Gn(t))),bh=(t,e)=>(le(t.restEncoder,e.size),Rn(e.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{le(t.restEncoder,n),le(t.restEncoder,s)}),t),UF=(t,e)=>bh(t,Hi(e.store)),zF=(t,e=new ph)=>(t instanceof Map?bh(e,t):UF(e,t),e.toUint8Array()),VF=t=>zF(t,new mh);class HF{constructor(){this.l=[]}}const qu=()=>new HF,Ku=(t,e)=>t.l.push(e),Wu=(t,e)=>{const n=t.l,s=n.length;t.l=n.filter(r=>e!==r),s===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},yh=(t,e,n)=>Ja(t.l,[e,n]);class Ls{constructor(e,n){this.client=e,this.clock=n}}const ks=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Re=(t,e)=>new Ls(t,e),Ch=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw Jt()},Ci=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class Eh{constructor(e,n,s,r=0){this.type=e,this.tname=n,this.item=s,this.assoc=r}}const T2=t=>{const e={};return t.type&&(e.type=t.type),t.tname&&(e.tname=t.tname),t.item&&(e.item=t.item),t.assoc!=null&&(e.assoc=t.assoc),e},L2=t=>new Eh(t.type==null?null:Re(t.type.client,t.type.clock),t.tname??null,t.item==null?null:Re(t.item.client,t.item.clock),t.assoc==null?0:t.assoc);class qF{constructor(e,n,s=0){this.type=e,this.index=n,this.assoc=s}}const KF=(t,e,n=0)=>new qF(t,e,n),Qr=(t,e,n)=>{let s=null,r=null;return t._item===null?r=Ch(t):s=Re(t._item.id.client,t._item.id.clock),new Eh(s,r,e,n)},N2=(t,e,n=0)=>{let s=t._start;if(n<0){if(e===0)return Qr(t,null,n);e--}for(;s!==null;){if(!s.deleted&&s.countable){if(s.length>e)return Qr(t,Re(s.id.client,s.id.clock+e),n);e-=s.length}if(s.right===null&&n<0)return Qr(t,s.lastId,n);s=s.right}return Qr(t,null,n)},WF=(t,e)=>{const n=Ns(t,e),s=e.clock-n.id.clock;return{item:n,diff:s}},R2=(t,e,n=!0)=>{const s=e.store,r=t.item,o=t.type,a=t.tname,c=t.assoc;let u=null,l=0;if(r!==null){if(pt(s,r.client)<=r.clock)return null;const d=n?ga(s,r):WF(s,r),h=d.item;if(!(h instanceof Ze))return null;if(u=h.parent,u._item===null||!u._item.deleted){l=h.deleted||!h.countable?0:d.diff+(c>=0?0:1);let D=h.left;for(;D!==null;)!D.deleted&&D.countable&&(l+=D.length),D=D.left}}else{if(a!==null)u=e.get(a);else if(o!==null){if(pt(s,o.client)<=o.clock)return null;const{item:d}=n?ga(s,o):{item:Ns(s,o)};if(d instanceof Ze&&d.content instanceof xn)u=d.content.type;else return null}else throw Jt();c>=0?l=u._length:l=0}return KF(u,l,t.assoc)},O2=(t,e)=>t===e||t!==null&&e!==null&&t.tname===e.tname&&ks(t.item,e.item)&&ks(t.type,e.type)&&t.assoc===e.assoc,xs=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!Pr(e.ds,t.id),ma=(t,e)=>{const n=En(t.meta,ma,Hn),s=t.doc.store;n.has(e)||(e.sv.forEach((r,o)=>{r<pt(s,o)&&Ht(t,Re(o,r))}),Hs(t,e.ds,r=>{}),n.add(e))};class wh{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Hi=t=>{const e=new Map;return t.clients.forEach((n,s)=>{const r=n[n.length-1];e.set(s,r.id.clock+r.length)}),e},pt=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const s=n[n.length-1];return s.id.clock+s.length},xh=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const s=n[n.length-1];if(s.id.clock+s.length!==e.id.clock)throw Jt()}n.push(e)},bn=(t,e)=>{let n=0,s=t.length-1,r=t[s],o=r.id.clock;if(o===e)return s;let a=hn(e/(o+r.length-1)*s);for(;n<=s;){if(r=t[a],o=r.id.clock,o<=e){if(e<o+r.length)return a;n=a+1}else s=a-1;a=hn((n+s)/2)}throw Jt()},GF=(t,e)=>{const n=t.clients.get(e.client);return n[bn(n,e.clock)]},Ns=GF,pa=(t,e,n)=>{const s=bn(e,n),r=e[s];return r.id.clock<n&&r instanceof Ze?(e.splice(s+1,0,Si(t,r,n-r.id.clock)),s+1):s},Ht=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[pa(t,n,e.clock)]},Gu=(t,e,n)=>{const s=e.clients.get(n.client),r=bn(s,n.clock),o=s[r];return n.clock!==o.id.clock+o.length-1&&o.constructor!==tn&&s.splice(r+1,0,Si(t,o,n.clock-o.id.clock+1)),o},YF=(t,e,n)=>{const s=t.clients.get(e.id.client);s[bn(s,e.id.clock)]=n},vh=(t,e,n,s,r)=>{if(s===0)return;const o=n+s;let a=pa(t,e,n),c;do c=e[a++],o<c.id.clock+c.length&&pa(t,e,o),r(c);while(a<e.length&&e[a].id.clock<o)};class XF{constructor(e,n,s){this.doc=e,this.deleteSet=new Zs,this.beforeState=Hi(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=s,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const Yu=(t,e)=>e.deleteSet.clients.size===0&&!vg(e.afterState,(n,s)=>e.beforeState.get(s)!==n)?!1:(rc(e.deleteSet),PF(t,e),Qs(t,e.deleteSet),!0),Xu=(t,e,n)=>{const s=e._item;(s===null||s.id.clock<(t.beforeState.get(s.id.client)||0)&&!s.deleted)&&En(t.changed,e,Hn).add(n)},ai=(t,e)=>{let n=t[e],s=t[e-1],r=e;for(;r>0;n=s,s=t[--r-1]){if(s.deleted===n.deleted&&s.constructor===n.constructor&&s.mergeWith(n)){n instanceof Ze&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,s);continue}break}const o=e-r;return o&&t.splice(e+1-o,o),o},JF=(t,e,n)=>{for(const[s,r]of t.clients.entries()){const o=e.clients.get(s);for(let a=r.length-1;a>=0;a--){const c=r[a],u=c.clock+c.len;for(let l=bn(o,c.clock),d=o[l];l<o.length&&d.id.clock<u;d=o[++l]){const h=o[l];if(c.clock+c.len<=h.id.clock)break;h instanceof Ze&&h.deleted&&!h.keep&&n(h)&&h.gc(e,!1)}}}},ZF=(t,e)=>{t.clients.forEach((n,s)=>{const r=e.clients.get(s);for(let o=n.length-1;o>=0;o--){const a=n[o],c=Va(r.length-1,1+bn(r,a.clock+a.len-1));for(let u=c,l=r[u];u>0&&l.id.clock>=a.clock;l=r[u])u-=1+ai(r,u)}})},Ah=(t,e)=>{if(e<t.length){const n=t[e],s=n.doc,r=s.store,o=n.deleteSet,a=n._mergeStructs;try{rc(o),n.afterState=Hi(n.doc.store),s.emit("beforeObserverCalls",[n,s]);const c=[];n.changed.forEach((u,l)=>c.push(()=>{(l._item===null||!l._item.deleted)&&l._callObserver(n,u)})),c.push(()=>{n.changedParentTypes.forEach((u,l)=>{l._dEH.l.length>0&&(l._item===null||!l._item.deleted)&&(u=u.filter(d=>d.target._item===null||!d.target._item.deleted),u.forEach(d=>{d.currentTarget=l,d._path=null}),u.sort((d,h)=>d.path.length-h.path.length),c.push(()=>{yh(l._dEH,u,n)}))}),c.push(()=>s.emit("afterTransaction",[n,s])),c.push(()=>{n._needFormattingCleanup&&yb(n)})}),Ja(c,[])}finally{s.gc&&JF(o,r,s.gcFilter),ZF(o,r),n.afterState.forEach((d,h)=>{const D=n.beforeState.get(h)||0;if(D!==d){const p=r.clients.get(h),F=us(bn(p,D),1);for(let y=p.length-1;y>=F;)y-=1+ai(p,y)}});for(let d=a.length-1;d>=0;d--){const{client:h,clock:D}=a[d].id,p=r.clients.get(h),F=bn(p,D);F+1<p.length&&ai(p,F+1)>1||F>0&&ai(p,F)}if(!n.local&&n.afterState.get(s.clientID)!==n.beforeState.get(s.clientID)&&(kF(sc,rh,"[yjs] ",ih,oh,"Changed the client-id because another client seems to be using it."),s.clientID=dh()),s.emit("afterTransactionCleanup",[n,s]),s._observers.has("update")){const d=new _r;Yu(d,n)&&s.emit("update",[d.toUint8Array(),n.origin,s,n])}if(s._observers.has("updateV2")){const d=new is;Yu(d,n)&&s.emit("updateV2",[d.toUint8Array(),n.origin,s,n])}const{subdocsAdded:c,subdocsLoaded:u,subdocsRemoved:l}=n;(c.size>0||l.size>0||u.size>0)&&(c.forEach(d=>{d.clientID=s.clientID,d.collectionid==null&&(d.collectionid=s.collectionid),s.subdocs.add(d)}),l.forEach(d=>s.subdocs.delete(d)),s.emit("subdocs",[{loaded:u,added:c,removed:l},s,n]),l.forEach(d=>d.destroy())),t.length<=e+1?(s._transactionCleanups=[],s.emit("afterAllTransactions",[s,t])):Ah(t,e+1)}}},Je=(t,e,n=null,s=!0)=>{const r=t._transactionCleanups;let o=!1,a=null;t._transaction===null&&(o=!0,t._transaction=new XF(t,n,s),r.push(t._transaction),r.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{a=e(t._transaction)}finally{if(o){const c=t._transaction===r[0];t._transaction=null,c&&Ah(r,0)}}return a};class QF{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const Ju=(t,e,n)=>{Hs(t,n.deletions,s=>{s instanceof Ze&&e.scope.some(r=>r===t.doc||Ci(r,s))&&pc(s,!1)})},Zu=(t,e,n)=>{let s=null;const r=t.doc,o=t.scope;Je(r,c=>{for(;e.length>0&&t.currStackItem===null;){const u=r.store,l=e.pop(),d=new Set,h=[];let D=!1;Hs(c,l.insertions,p=>{if(p instanceof Ze){if(p.redone!==null){let{item:F,diff:y}=ga(u,p.id);y>0&&(F=Ht(c,Re(F.id.client,F.id.clock+y))),p=F}!p.deleted&&o.some(F=>F===c.doc||Ci(F,p))&&h.push(p)}}),Hs(c,l.deletions,p=>{p instanceof Ze&&o.some(F=>F===c.doc||Ci(F,p))&&!Pr(l.insertions,p.id)&&d.add(p)}),d.forEach(p=>{D=Hh(c,p,d,l.insertions,t.ignoreRemoteMapChanges,t)!==null||D});for(let p=h.length-1;p>=0;p--){const F=h[p];t.deleteFilter(F)&&(F.delete(c),D=!0)}t.currStackItem=D?l:null}c.changed.forEach((u,l)=>{u.has(null)&&l._searchMarker&&(l._searchMarker.length=0)}),s=c},t);const a=t.currStackItem;if(a!=null){const c=s.changedParentTypes;t.emit("stack-item-popped",[{stackItem:a,type:n,changedParentTypes:c,origin:t},t]),t.currStackItem=null}return a};class eb extends za{constructor(e,{captureTimeout:n=500,captureTransaction:s=u=>!0,deleteFilter:r=()=>!0,trackedOrigins:o=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:c=$s(e)?e[0].doc:e instanceof ls?e:e.doc}={}){super(),this.scope=[],this.doc=c,this.addToScope(e),this.deleteFilter=r,o.add(this),this.trackedOrigins=o,this.captureTransaction=s,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=n,this.afterTransactionHandler=u=>{if(!this.captureTransaction(u)||!this.scope.some(b=>u.changedParentTypes.has(b)||b===this.doc)||!this.trackedOrigins.has(u.origin)&&(!u.origin||!this.trackedOrigins.has(u.origin.constructor)))return;const l=this.undoing,d=this.redoing,h=l?this.redoStack:this.undoStack;l?this.stopCapturing():d||this.clear(!1,!0);const D=new Zs;u.afterState.forEach((b,E)=>{const x=u.beforeState.get(E)||0,N=b-x;N>0&&Sr(D,E,x,N)});const p=qn();let F=!1;if(this.lastChange>0&&p-this.lastChange<this.captureTimeout&&h.length>0&&!l&&!d){const b=h[h.length-1];b.deletions=fa([b.deletions,u.deleteSet]),b.insertions=fa([b.insertions,D])}else h.push(new QF(u.deleteSet,D)),F=!0;!l&&!d&&(this.lastChange=p),Hs(u,u.deleteSet,b=>{b instanceof Ze&&this.scope.some(E=>E===u.doc||Ci(E,b))&&pc(b,!0)});const y=[{stackItem:h[h.length-1],origin:u.origin,type:l?"redo":"undo",changedParentTypes:u.changedParentTypes},this];F?this.emit("stack-item-added",y):this.emit("stack-item-updated",y)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const n=new Set(this.scope);e=$s(e)?e:[e],e.forEach(s=>{n.has(s)||(n.add(s),(s instanceof Lt?s.doc!==this.doc:s!==this.doc)&&ch("[yjs#509] Not same Y.Doc"),this.scope.push(s))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(s=>{e&&(this.undoStack.forEach(r=>Ju(s,this,r)),this.undoStack=[]),n&&(this.redoStack.forEach(r=>Ju(s,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=Zu(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=Zu(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*tb(t){const e=ke(t.restDecoder);for(let n=0;n<e;n++){const s=ke(t.restDecoder),r=t.readClient();let o=ke(t.restDecoder);for(let a=0;a<s;a++){const c=t.readInfo();if(c===10){const u=ke(t.restDecoder);yield new nn(Re(r,o),u),o+=u}else if((Oi&c)!==0){const u=(c&(Ln|Xt))===0,l=new Ze(Re(r,o),null,(c&Xt)===Xt?t.readLeftID():null,null,(c&Ln)===Ln?t.readRightID():null,u?t.readParentInfo()?t.readString():t.readLeftID():null,u&&(c&Er)===Er?t.readString():null,qh(t,c));yield l,o+=l.length}else{const u=t.readLen();yield new tn(Re(r,o),u),o+=u}}}}class cc{constructor(e,n){this.gen=tb(e),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===nn);return this.curr}}class uc{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const nb=t=>Ei(t,fh,_r),sb=(t,e)=>{if(t.constructor===tn){const{client:n,clock:s}=t.id;return new tn(Re(n,s+e),t.length-e)}else if(t.constructor===nn){const{client:n,clock:s}=t.id;return new nn(Re(n,s+e),t.length-e)}else{const n=t,{client:s,clock:r}=n.id;return new Ze(Re(s,r+e),null,Re(s,r+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Ei=(t,e=qs,n=is)=>{if(t.length===1)return t[0];const s=t.map(d=>new e(Gn(d)));let r=s.map(d=>new cc(d,!0)),o=null;const a=new n,c=new uc(a);for(;r=r.filter(D=>D.curr!==null),r.sort((D,p)=>{if(D.curr.id.client===p.curr.id.client){const F=D.curr.id.clock-p.curr.id.clock;return F===0?D.curr.constructor===p.curr.constructor?0:D.curr.constructor===nn?1:-1:F}else return p.curr.id.client-D.curr.id.client}),r.length!==0;){const d=r[0],h=d.curr.id.client;if(o!==null){let D=d.curr,p=!1;for(;D!==null&&D.id.clock+D.length<=o.struct.id.clock+o.struct.length&&D.id.client>=o.struct.id.client;)D=d.next(),p=!0;if(D===null||D.id.client!==h||p&&D.id.clock>o.struct.id.clock+o.struct.length)continue;if(h!==o.struct.id.client)$n(c,o.struct,o.offset),o={struct:D,offset:0},d.next();else if(o.struct.id.clock+o.struct.length<D.id.clock)if(o.struct.constructor===nn)o.struct.length=D.id.clock+D.length-o.struct.id.clock;else{$n(c,o.struct,o.offset);const F=D.id.clock-o.struct.id.clock-o.struct.length;o={struct:new nn(Re(h,o.struct.id.clock+o.struct.length),F),offset:0}}else{const F=o.struct.id.clock+o.struct.length-D.id.clock;F>0&&(o.struct.constructor===nn?o.struct.length-=F:D=sb(D,F)),o.struct.mergeWith(D)||($n(c,o.struct,o.offset),o={struct:D,offset:0},d.next())}}else o={struct:d.curr,offset:0},d.next();for(let D=d.curr;D!==null&&D.id.client===h&&D.id.clock===o.struct.id.clock+o.struct.length&&D.constructor!==nn;D=d.next())$n(c,o.struct,o.offset),o={struct:D,offset:0}}o!==null&&($n(c,o.struct,o.offset),o=null),lc(c);const u=s.map(d=>ic(d)),l=fa(u);return Qs(a,l),a.toUint8Array()},rb=(t,e,n=qs,s=is)=>{const r=Fh(e),o=new s,a=new uc(o),c=new n(Gn(t)),u=new cc(c,!1);for(;u.curr;){const d=u.curr,h=d.id.client,D=r.get(h)||0;if(u.curr.constructor===nn){u.next();continue}if(d.id.clock+d.length>D)for($n(a,d,us(D-d.id.clock,0)),u.next();u.curr&&u.curr.id.client===h;)$n(a,u.curr,0),u.next();else for(;u.curr&&u.curr.id.client===h&&u.curr.id.clock+u.curr.length<=D;)u.next()}lc(a);const l=ic(c);return Qs(o,l),o.toUint8Array()},kh=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:Xe(t.encoder.restEncoder)}),t.encoder.restEncoder=lt(),t.written=0)},$n=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&kh(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),le(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},lc=t=>{kh(t);const e=t.encoder.restEncoder;le(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){const s=t.clientStructs[n];le(e,s.written),Pi(e,s.restEncoder)}},ib=(t,e,n,s)=>{const r=new n(Gn(t)),o=new cc(r,!1),a=new s,c=new uc(a);for(let l=o.curr;l!==null;l=o.next())$n(c,e(l),0);lc(c);const u=ic(r);return Qs(a,u),a.toUint8Array()},ob=t=>ib(t,D1,qs,_r),Qu="You must not compute changes after the event-handler fired.";class qi{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=ab(this.currentTarget,this.target))}deletes(e){return Pr(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw fn(Qu);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const o=n._map.get(r);let a,c;if(this.adds(o)){let u=o.left;for(;u!==null&&this.adds(u);)u=u.left;if(this.deletes(o))if(u!==null&&this.deletes(u))a="delete",c=Eo(u.content.getContent());else return;else u!==null&&this.deletes(u)?(a="update",c=Eo(u.content.getContent())):(a="add",c=void 0)}else if(this.deletes(o))a="delete",c=Eo(o.content.getContent());else return;e.set(r,{action:a,oldValue:c})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw fn(Qu);const n=this.target,s=Hn(),r=Hn(),o=[];if(e={added:s,deleted:r,delta:o,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const u=()=>{c&&o.push(c)};for(let l=n._start;l!==null;l=l.right)l.deleted?this.deletes(l)&&!this.adds(l)&&((c===null||c.delete===void 0)&&(u(),c={delete:0}),c.delete+=l.length,r.add(l)):this.adds(l)?((c===null||c.insert===void 0)&&(u(),c={insert:[]}),c.insert=c.insert.concat(l.content.getContent()),s.add(l)):((c===null||c.retain===void 0)&&(u(),c={retain:0}),c.retain+=l.length);c!==null&&c.retain===void 0&&u()}this._changes=e}return e}}const ab=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let s=0,r=e._item.parent._start;for(;r!==e._item&&r!==null;)!r.deleted&&r.countable&&(s+=r.length),r=r.right;n.unshift(s)}e=e._item.parent}return n},Mt=()=>{ch("Invalid access: Add Yjs type to a document before reading data.")},Sh=80;let dc=0;class cb{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=dc++}}const ub=t=>{t.timestamp=dc++},jh=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=dc++},lb=(t,e,n)=>{if(t.length>=Sh){const s=t.reduce((r,o)=>r.timestamp<o.timestamp?r:o);return jh(s,e,n),s}else{const s=new cb(e,n);return t.push(s),s}},Ki=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((o,a)=>ri(e-o.index)<ri(e-a.index)?o:a);let s=t._start,r=0;for(n!==null&&(s=n.p,r=n.index,ub(n));s.right!==null&&r<e;){if(!s.deleted&&s.countable){if(e<r+s.length)break;r+=s.length}s=s.right}for(;s.left!==null&&r>e;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);for(;s.left!==null&&s.left.id.client===s.id.client&&s.left.id.clock+s.left.length===s.id.clock;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);return n!==null&&ri(n.index-r)<s.parent.length/Sh?(jh(n,s,r),n):lb(t._searchMarker,s,r)},jr=(t,e,n)=>{for(let s=t.length-1;s>=0;s--){const r=t[s];if(n>0){let o=r.p;for(o.marker=!1;o&&(o.deleted||!o.countable);)o=o.left,o&&!o.deleted&&o.countable&&(r.index-=o.length);if(o===null||o.marker===!0){t.splice(s,1);continue}r.p=o,o.marker=!0}(e<r.index||n>0&&e===r.index)&&(r.index=us(e,r.index+n))}},Wi=(t,e,n)=>{const s=t,r=e.changedParentTypes;for(;En(r,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;yh(s._eH,n,e)};class Lt{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=qu(),this._dEH=qu(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw dn()}clone(){throw dn()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Ku(this._eH,e)}observeDeep(e){Ku(this._dEH,e)}unobserve(e){Wu(this._eH,e)}unobserveDeep(e){Wu(this._dEH,e)}toJSON(){}}const Bh=(t,e,n)=>{t.doc??Mt(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let s=n-e;const r=[];let o=t._start;for(;o!==null&&s>0;){if(o.countable&&!o.deleted){const a=o.content.getContent();if(a.length<=e)e-=a.length;else{for(let c=e;c<a.length&&s>0;c++)r.push(a[c]),s--;e=0}}o=o.right}return r},Th=t=>{t.doc??Mt();const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const s=n.content.getContent();for(let r=0;r<s.length;r++)e.push(s[r])}n=n.right}return e},Br=(t,e)=>{let n=0,s=t._start;for(t.doc??Mt();s!==null;){if(s.countable&&!s.deleted){const r=s.content.getContent();for(let o=0;o<r.length;o++)e(r[o],n++,t)}s=s.right}},Lh=(t,e)=>{const n=[];return Br(t,(s,r)=>{n.push(e(s,r,t))}),n},db=t=>{let e=t._start,n=null,s=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),s=0,e=e.right}const r=n[s++];return n.length<=s&&(n=null),{done:!1,value:r}}}},Nh=(t,e)=>{t.doc??Mt();const n=Ki(t,e);let s=t._start;for(n!==null&&(s=n.p,e-=n.index);s!==null;s=s.right)if(!s.deleted&&s.countable){if(e<s.length)return s.content.getContent()[e];e-=s.length}},wi=(t,e,n,s)=>{let r=n;const o=t.doc,a=o.clientID,c=o.store,u=n===null?e._start:n.right;let l=[];const d=()=>{l.length>0&&(r=new Ze(Re(a,pt(c,a)),r,r&&r.lastId,u,u&&u.id,e,null,new as(l)),r.integrate(t,0),l=[])};s.forEach(h=>{if(h===null)l.push(h);else switch(h.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(h);break;default:switch(d(),h.constructor){case Uint8Array:case ArrayBuffer:r=new Ze(Re(a,pt(c,a)),r,r&&r.lastId,u,u&&u.id,e,null,new Ir(new Uint8Array(h))),r.integrate(t,0);break;case ls:r=new Ze(Re(a,pt(c,a)),r,r&&r.lastId,u,u&&u.id,e,null,new Mr(h)),r.integrate(t,0);break;default:if(h instanceof Lt)r=new Ze(Re(a,pt(c,a)),r,r&&r.lastId,u,u&&u.id,e,null,new xn(h)),r.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},Rh=()=>fn("Length exceeded!"),Oh=(t,e,n,s)=>{if(n>e._length)throw Rh();if(n===0)return e._searchMarker&&jr(e._searchMarker,n,s.length),wi(t,e,null,s);const r=n,o=Ki(e,n);let a=e._start;for(o!==null&&(a=o.p,n-=o.index,n===0&&(a=a.prev,n+=a&&a.countable&&!a.deleted?a.length:0));a!==null;a=a.right)if(!a.deleted&&a.countable){if(n<=a.length){n<a.length&&Ht(t,Re(a.id.client,a.id.clock+n));break}n-=a.length}return e._searchMarker&&jr(e._searchMarker,r,s.length),wi(t,e,a,s)},hb=(t,e,n)=>{let r=(e._searchMarker||[]).reduce((o,a)=>a.index>o.index?a:o,{index:0,p:e._start}).p;if(r)for(;r.right;)r=r.right;return wi(t,e,r,n)},Ph=(t,e,n,s)=>{if(s===0)return;const r=n,o=s,a=Ki(e,n);let c=e._start;for(a!==null&&(c=a.p,n-=a.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n<c.length&&Ht(t,Re(c.id.client,c.id.clock+n)),n-=c.length);for(;s>0&&c!==null;)c.deleted||(s<c.length&&Ht(t,Re(c.id.client,c.id.clock+s)),c.delete(t),s-=c.length),c=c.right;if(s>0)throw Rh();e._searchMarker&&jr(e._searchMarker,r,-o+s)},xi=(t,e,n)=>{const s=e._map.get(n);s!==void 0&&s.delete(t)},hc=(t,e,n,s)=>{const r=e._map.get(n)||null,o=t.doc,a=o.clientID;let c;if(s==null)c=new as([s]);else switch(s.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new as([s]);break;case Uint8Array:c=new Ir(s);break;case ls:c=new Mr(s);break;default:if(s instanceof Lt)c=new xn(s);else throw new Error("Unexpected content type")}new Ze(Re(a,pt(o.store,a)),r,r&&r.lastId,null,null,e,n,c).integrate(t,0)},fc=(t,e)=>{t.doc??Mt();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},_h=t=>{const e={};return t.doc??Mt(),t._map.forEach((n,s)=>{n.deleted||(e[s]=n.content.getContent()[n.length-1])}),e},Ih=(t,e)=>{t.doc??Mt();const n=t._map.get(e);return n!==void 0&&!n.deleted},fb=(t,e)=>{const n={};return t._map.forEach((s,r)=>{let o=s;for(;o!==null&&(!e.sv.has(o.id.client)||o.id.clock>=(e.sv.get(o.id.client)||0));)o=o.left;o!==null&&xs(o,e)&&(n[r]=o.content.getContent()[o.length-1])}),n},ei=t=>(t.doc??Mt(),SF(t._map.entries(),e=>!e[1].deleted));class mb extends qi{}class Rs extends Lt{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Rs;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Rs}clone(){const e=new Rs;return e.insert(0,this.toArray().map(n=>n instanceof Lt?n.clone():n)),e}get length(){return this.doc??Mt(),this._length}_callObserver(e,n){super._callObserver(e,n),Wi(this,e,new mb(this,e))}insert(e,n){this.doc!==null?Je(this.doc,s=>{Oh(s,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?Je(this.doc,n=>{hb(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?Je(this.doc,s=>{Ph(s,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return Nh(this,e)}toArray(){return Th(this)}slice(e=0,n=this.length){return Bh(this,e,n)}toJSON(){return this.map(e=>e instanceof Lt?e.toJSON():e)}map(e){return Lh(this,e)}forEach(e){Br(this,e)}[Symbol.iterator](){return db(this)}_write(e){e.writeTypeRef(Mb)}}const pb=t=>new Rs;class Db extends qi{constructor(e,n,s){super(e,n),this.keysChanged=s}}class Ks extends Lt{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((s,r)=>{this.set(r,s)}),this._prelimContent=null}_copy(){return new Ks}clone(){const e=new Ks;return this.forEach((n,s)=>{e.set(s,n instanceof Lt?n.clone():n)}),e}_callObserver(e,n){Wi(this,e,new Db(this,e,n))}toJSON(){this.doc??Mt();const e={};return this._map.forEach((n,s)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];e[s]=r instanceof Lt?r.toJSON():r}}),e}get size(){return[...ei(this)].length}keys(){return jo(ei(this),e=>e[0])}values(){return jo(ei(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return jo(ei(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Mt(),this._map.forEach((n,s)=>{n.deleted||e(n.content.getContent()[n.length-1],s,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Je(this.doc,n=>{xi(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?Je(this.doc,s=>{hc(s,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return fc(this,e)}has(e){return Ih(this,e)}clear(){this.doc!==null?Je(this.doc,e=>{this.forEach(function(n,s,r){xi(e,r,s)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef($b)}}const gb=t=>new Ks,Un=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&m1(t,e);class Da{constructor(e,n,s,r){this.left=e,this.right=n,this.index=s,this.currentAttributes=r}forward(){this.right===null&&Jt(),this.right.content.constructor===wt?this.right.deleted||er(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const el=(t,e,n)=>{for(;e.right!==null&&n>0;)e.right.content.constructor===wt?e.right.deleted||er(e.currentAttributes,e.right.content):e.right.deleted||(n<e.right.length&&Ht(t,Re(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length),e.left=e.right,e.right=e.right.right;return e},ti=(t,e,n,s)=>{const r=new Map,o=s?Ki(e,n):null;if(o){const a=new Da(o.p.left,o.p,o.index,r);return el(t,a,n-o.index)}else{const a=new Da(null,e._start,0,r);return el(t,a,n)}},Mh=(t,e,n,s)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===wt&&Un(s.get(n.right.content.key),n.right.content.value));)n.right.deleted||s.delete(n.right.content.key),n.forward();const r=t.doc,o=r.clientID;s.forEach((a,c)=>{const u=n.left,l=n.right,d=new Ze(Re(o,pt(r.store,o)),u,u&&u.lastId,l,l&&l.id,e,null,new wt(c,a));d.integrate(t,0),n.right=d,n.forward()})},er=(t,e)=>{const{key:n,value:s}=e;s===null?t.delete(n):t.set(n,s)},$h=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===wt&&Un(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},Uh=(t,e,n,s)=>{const r=t.doc,o=r.clientID,a=new Map;for(const c in s){const u=s[c],l=n.currentAttributes.get(c)??null;if(!Un(l,u)){a.set(c,l);const{left:d,right:h}=n;n.right=new Ze(Re(o,pt(r.store,o)),d,d&&d.lastId,h,h&&h.id,e,null,new wt(c,u)),n.right.integrate(t,0),n.forward()}}return a},Bo=(t,e,n,s,r)=>{n.currentAttributes.forEach((D,p)=>{r[p]===void 0&&(r[p]=null)});const o=t.doc,a=o.clientID;$h(n,r);const c=Uh(t,e,n,r),u=s.constructor===String?new yn(s):s instanceof Lt?new xn(s):new ds(s);let{left:l,right:d,index:h}=n;e._searchMarker&&jr(e._searchMarker,n.index,u.getLength()),d=new Ze(Re(a,pt(o.store,a)),l,l&&l.lastId,d,d&&d.id,e,null,u),d.integrate(t,0),n.right=d,n.index=h,n.forward(),Mh(t,e,n,c)},tl=(t,e,n,s,r)=>{const o=t.doc,a=o.clientID;$h(n,r);const c=Uh(t,e,n,r);e:for(;n.right!==null&&(s>0||c.size>0&&(n.right.deleted||n.right.content.constructor===wt));){if(!n.right.deleted)switch(n.right.content.constructor){case wt:{const{key:u,value:l}=n.right.content,d=r[u];if(d!==void 0){if(Un(d,l))c.delete(u);else{if(s===0)break e;c.set(u,l)}n.right.delete(t)}else n.currentAttributes.set(u,l);break}default:s<n.right.length&&Ht(t,Re(n.right.id.client,n.right.id.clock+s)),s-=n.right.length;break}n.forward()}if(s>0){let u="";for(;s>0;s--)u+=`
|
|
45
|
-
`;n.right=new Ze(Re(a,pt(o.store,a)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new yn(u)),n.right.integrate(t,0),n.forward()}Mh(t,e,n,c)},zh=(t,e,n,s,r)=>{let o=e;const a=Kt();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===wt){const l=o.content;a.set(l.key,l)}o=o.right}let c=0,u=!1;for(;e!==o;){if(n===e&&(u=!0),!e.deleted){const l=e.content;if(l.constructor===wt){const{key:d,value:h}=l,D=s.get(d)??null;(a.get(d)!==l||D===h)&&(e.delete(t),c++,!u&&(r.get(d)??null)===h&&D!==h&&(D===null?r.delete(d):r.set(d,D))),!u&&!e.deleted&&er(r,l)}}e=e.right}return c},Fb=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===wt){const s=e.content.key;n.has(s)?e.delete(t):n.add(s)}e=e.left}},bb=t=>{let e=0;return Je(t.doc,n=>{let s=t._start,r=t._start,o=Kt();const a=oa(o);for(;r;)r.deleted===!1&&(r.content.constructor===wt?er(a,r.content):(e+=zh(n,s,r,o,a),o=oa(a),s=r)),r=r.right}),e},yb=t=>{const e=new Set,n=t.doc;for(const[s,r]of t.afterState.entries()){const o=t.beforeState.get(s)||0;r!==o&&vh(t,n.store.clients.get(s),o,r,a=>{!a.deleted&&a.content.constructor===wt&&a.constructor!==tn&&e.add(a.parent)})}Je(n,s=>{Hs(t,t.deleteSet,r=>{if(r instanceof tn||!r.parent._hasFormatting||e.has(r.parent))return;const o=r.parent;r.content.constructor===wt?e.add(o):Fb(s,r)});for(const r of e)bb(r)})},nl=(t,e,n)=>{const s=n,r=oa(e.currentAttributes),o=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case xn:case ds:case yn:n<e.right.length&&Ht(t,Re(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}o&&zh(t,o,e.right,r,e.currentAttributes);const a=(e.left||e.right).parent;return a._searchMarker&&jr(a._searchMarker,e.index,-s+n),e};class Cb extends qi{constructor(e,n,s){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,s.forEach(r=>{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];Je(e,s=>{const r=new Map,o=new Map;let a=this.target._start,c=null;const u={};let l="",d=0,h=0;const D=()=>{if(c!==null){let p=null;switch(c){case"delete":h>0&&(p={delete:h}),h=0;break;case"insert":(typeof l=="object"||l.length>0)&&(p={insert:l},r.size>0&&(p.attributes={},r.forEach((F,y)=>{F!==null&&(p.attributes[y]=F)}))),l="";break;case"retain":d>0&&(p={retain:d},f1(u)||(p.attributes=u1({},u))),d=0;break}p&&n.push(p),c=null}};for(;a!==null;){switch(a.content.constructor){case xn:case ds:this.adds(a)?this.deletes(a)||(D(),c="insert",l=a.content.getContent()[0],D()):this.deletes(a)?(c!=="delete"&&(D(),c="delete"),h+=1):a.deleted||(c!=="retain"&&(D(),c="retain"),d+=1);break;case yn:this.adds(a)?this.deletes(a)||(c!=="insert"&&(D(),c="insert"),l+=a.content.str):this.deletes(a)?(c!=="delete"&&(D(),c="delete"),h+=a.length):a.deleted||(c!=="retain"&&(D(),c="retain"),d+=a.length);break;case wt:{const{key:p,value:F}=a.content;if(this.adds(a)){if(!this.deletes(a)){const y=r.get(p)??null;Un(y,F)?F!==null&&a.delete(s):(c==="retain"&&D(),Un(F,o.get(p)??null)?delete u[p]:u[p]=F)}}else if(this.deletes(a)){o.set(p,F);const y=r.get(p)??null;Un(y,F)||(c==="retain"&&D(),u[p]=y)}else if(!a.deleted){o.set(p,F);const y=u[p];y!==void 0&&(Un(y,F)?y!==null&&a.delete(s):(c==="retain"&&D(),F===null?delete u[p]:u[p]=F))}a.deleted||(c==="insert"&&D(),er(r,a.content));break}}a=a.right}for(D();n.length>0;){const p=n[n.length-1];if(p.retain!==void 0&&p.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class Ws extends Lt{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Mt(),this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(s=>s())}catch(s){console.error(s)}this._pending=null}_copy(){return new Ws}clone(){const e=new Ws;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const s=new Cb(this,e,n);Wi(this,e,s),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Mt();let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===yn&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?Je(this.doc,s=>{const r=new Da(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const a=e[o];if(a.insert!==void 0){const c=!n&&typeof a.insert=="string"&&o===e.length-1&&r.right===null&&a.insert.slice(-1)===`
|
|
46
|
-
`?a.insert.slice(0,-1):a.insert;(typeof c!="string"||c.length>0)&&Bo(s,this,r,c,a.attributes||{})}else a.retain!==void 0?tl(s,this,r,a.retain,a.attributes||{}):a.delete!==void 0&&nl(s,r,a.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,s){this.doc??Mt();const r=[],o=new Map,a=this.doc;let c="",u=this._start;function l(){if(c.length>0){const h={};let D=!1;o.forEach((F,y)=>{D=!0,h[y]=F});const p={insert:c};D&&(p.attributes=h),r.push(p),c=""}}const d=()=>{for(;u!==null;){if(xs(u,e)||n!==void 0&&xs(u,n))switch(u.content.constructor){case yn:{const h=o.get("ychange");e!==void 0&&!xs(u,e)?(h===void 0||h.user!==u.id.client||h.type!=="removed")&&(l(),o.set("ychange",s?s("removed",u.id):{type:"removed"})):n!==void 0&&!xs(u,n)?(h===void 0||h.user!==u.id.client||h.type!=="added")&&(l(),o.set("ychange",s?s("added",u.id):{type:"added"})):h!==void 0&&(l(),o.delete("ychange")),c+=u.content.str;break}case xn:case ds:{l();const h={insert:u.content.getContent()[0]};if(o.size>0){const D={};h.attributes=D,o.forEach((p,F)=>{D[F]=p})}r.push(h);break}case wt:xs(u,e)&&(l(),er(o,u.content));break}u=u.right}l()};return e||n?Je(a,h=>{e&&ma(h,e),n&&ma(h,n),d()},"cleanup"):d(),r}insert(e,n,s){if(n.length<=0)return;const r=this.doc;r!==null?Je(r,o=>{const a=ti(o,this,e,!s);s||(s={},a.currentAttributes.forEach((c,u)=>{s[u]=c})),Bo(o,this,a,n,s)}):this._pending.push(()=>this.insert(e,n,s))}insertEmbed(e,n,s){const r=this.doc;r!==null?Je(r,o=>{const a=ti(o,this,e,!s);Bo(o,this,a,n,s||{})}):this._pending.push(()=>this.insertEmbed(e,n,s||{}))}delete(e,n){if(n===0)return;const s=this.doc;s!==null?Je(s,r=>{nl(r,ti(r,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,s){if(n===0)return;const r=this.doc;r!==null?Je(r,o=>{const a=ti(o,this,e,!1);a.right!==null&&tl(o,this,a,n,s)}):this._pending.push(()=>this.format(e,n,s))}removeAttribute(e){this.doc!==null?Je(this.doc,n=>{xi(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?Je(this.doc,s=>{hc(s,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return fc(this,e)}getAttributes(){return _h(this)}_write(e){e.writeTypeRef(Ub)}}const Eb=t=>new Ws;class To{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Mt()}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===Gs||n.constructor===os)&&n._start!==null)e=n._start;else for(;e!==null;){const s=e.next;if(s!==null){e=s;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class os extends Lt{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new os}clone(){const e=new os;return e.insert(0,this.toArray().map(n=>n instanceof Lt?n.clone():n)),e}get length(){return this.doc??Mt(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new To(this,e)}querySelector(e){e=e.toUpperCase();const s=new To(this,r=>r.nodeName&&r.nodeName.toUpperCase()===e).next();return s.done?null:s.value}querySelectorAll(e){return e=e.toUpperCase(),Rn(new To(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Wi(this,e,new vb(this,n,e))}toString(){return Lh(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},s){const r=e.createDocumentFragment();return s!==void 0&&s._createAssociation(r,this),Br(this,o=>{r.insertBefore(o.toDOM(e,n,s),null)}),r}insert(e,n){this.doc!==null?Je(this.doc,s=>{Oh(s,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)Je(this.doc,s=>{const r=e&&e instanceof Lt?e._item:e;wi(s,this,r,n)});else{const s=this._prelimContent,r=e===null?0:s.findIndex(o=>o===e)+1;if(r===0&&e!==null)throw fn("Reference item not found");s.splice(r,0,...n)}}delete(e,n=1){this.doc!==null?Je(this.doc,s=>{Ph(s,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return Th(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Nh(this,e)}slice(e=0,n=this.length){return Bh(this,e,n)}forEach(e){Br(this,e)}_write(e){e.writeTypeRef(Vb)}}const wb=t=>new os;class Gs extends os{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((s,r)=>{this.setAttribute(r,s)}),this._prelimAttrs=null}_copy(){return new Gs(this.nodeName)}clone(){const e=new Gs(this.nodeName),n=this.getAttributes();return d1(n,(s,r)=>{e.setAttribute(r,s)}),e.insert(0,this.toArray().map(s=>s instanceof Lt?s.clone():s)),e}toString(){const e=this.getAttributes(),n=[],s=[];for(const c in e)s.push(c);s.sort();const r=s.length;for(let c=0;c<r;c++){const u=s[c];n.push(u+'="'+e[u]+'"')}const o=this.nodeName.toLocaleLowerCase(),a=n.length>0?" "+n.join(" "):"";return`<${o}${a}>${super.toString()}</${o}>`}removeAttribute(e){this.doc!==null?Je(this.doc,n=>{xi(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?Je(this.doc,s=>{hc(s,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return fc(this,e)}hasAttribute(e){return Ih(this,e)}getAttributes(e){return e?fb(this,e):_h(this)}toDOM(e=document,n={},s){const r=e.createElement(this.nodeName),o=this.getAttributes();for(const a in o){const c=o[a];typeof c=="string"&&r.setAttribute(a,c)}return Br(this,a=>{r.appendChild(a.toDOM(e,n,s))}),s!==void 0&&s._createAssociation(r,this),r}_write(e){e.writeTypeRef(zb),e.writeKey(this.nodeName)}}const xb=t=>new Gs(t.readKey());class vb extends qi{constructor(e,n,s){super(e,s),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class vi extends Ks{constructor(e){super(),this.hookName=e}_copy(){return new vi(this.hookName)}clone(){const e=new vi(this.hookName);return this.forEach((n,s)=>{e.set(s,n)}),e}toDOM(e=document,n={},s){const r=n[this.hookName];let o;return r!==void 0?o=r.createDom(this):o=document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),s!==void 0&&s._createAssociation(o,this),o}_write(e){e.writeTypeRef(Hb),e.writeKey(this.hookName)}}const Ab=t=>new vi(t.readKey());class Ai extends Ws{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Ai}clone(){const e=new Ai;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,s){const r=e.createTextNode(this.toString());return s!==void 0&&s._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{const n=[];for(const r in e.attributes){const o=[];for(const a in e.attributes[r])o.push({key:a,value:e.attributes[r][a]});o.sort((a,c)=>a.key<c.key?-1:1),n.push({nodeName:r,attrs:o})}n.sort((r,o)=>r.nodeName<o.nodeName?-1:1);let s="";for(let r=0;r<n.length;r++){const o=n[r];s+=`<${o.nodeName}`;for(let a=0;a<o.attrs.length;a++){const c=o.attrs[a];s+=` ${c.key}="${c.value}"`}s+=">"}s+=e.insert;for(let r=n.length-1;r>=0;r--)s+=`</${n[r].nodeName}>`;return s}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(qb)}}const kb=t=>new Ai;class mc{constructor(e,n){this.id=e,this.length=n}get deleted(){throw dn()}mergeWith(e){return!1}write(e,n,s){throw dn()}integrate(e,n){throw dn()}}const Sb=0;class tn extends mc{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),xh(e.doc.store,this)}write(e,n){e.writeInfo(Sb),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Ir{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Ir(this.content)}splice(e){throw dn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const jb=t=>new Ir(t.readBuf());class Tr{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Tr(this.len)}splice(e){const n=new Tr(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){Sr(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const Bb=t=>new Tr(t.readLen()),Vh=(t,e)=>new ls({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Mr{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Mr(Vh(this.doc.guid,this.opts))}splice(e){throw dn()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const Tb=t=>new Mr(Vh(t.readString(),t.readAny()));class ds{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ds(this.embed)}splice(e){throw dn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const Lb=t=>new ds(t.readJSON());class wt{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new wt(this.key,this.value)}splice(e){throw dn()}mergeWith(e){return!1}integrate(e,n){const s=n.parent;s._searchMarker=null,s._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const Nb=t=>new wt(t.readKey(),t.readJSON());class ki{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new ki(this.arr)}splice(e){const n=new ki(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const s=this.arr.length;e.writeLen(s-n);for(let r=n;r<s;r++){const o=this.arr[r];e.writeString(o===void 0?"undefined":JSON.stringify(o))}}getRef(){return 2}}const Rb=t=>{const e=t.readLen(),n=[];for(let s=0;s<e;s++){const r=t.readString();r==="undefined"?n.push(void 0):n.push(JSON.parse(r))}return new ki(n)},Ob=Fi("node_env")==="development";class as{constructor(e){this.arr=e,Ob&&Pd(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new as(this.arr)}splice(e){const n=new as(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const s=this.arr.length;e.writeLen(s-n);for(let r=n;r<s;r++){const o=this.arr[r];e.writeAny(o)}}getRef(){return 8}}const Pb=t=>{const e=t.readLen(),n=[];for(let s=0;s<e;s++)n.push(t.readAny());return new as(n)};class yn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new yn(this.str)}splice(e){const n=new yn(this.str.slice(e));this.str=this.str.slice(0,e);const s=this.str.charCodeAt(e-1);return s>=55296&&s<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const _b=t=>new yn(t.readString()),Ib=[pb,gb,Eb,xb,wb,Ab,kb],Mb=0,$b=1,Ub=2,zb=3,Vb=4,Hb=5,qb=6;class xn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new xn(this.type._copy())}splice(e){throw dn()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(s=>{s.deleted?s.id.clock<(e.beforeState.get(s.id.client)||0)&&e._mergeStructs.push(s):s.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(s=>{for(;s!==null;)s.gc(e,!0),s=s.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const Kb=t=>new xn(Ib[t.readTypeRef()](t)),ga=(t,e)=>{let n=e,s=0,r;do s>0&&(n=Re(n.client,n.clock+s)),r=Ns(t,n),s=n.clock-r.id.clock,n=r.redone;while(n!==null&&r instanceof Ze);return{item:r,diff:s}},pc=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},Si=(t,e,n)=>{const{client:s,clock:r}=e.id,o=new Ze(Re(s,r+n),e,Re(s,r+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&o.markDeleted(),e.keep&&(o.keep=!0),e.redone!==null&&(o.redone=Re(e.redone.client,e.redone.clock+n)),e.right=o,o.right!==null&&(o.right.left=o),t._mergeStructs.push(o),o.parentSub!==null&&o.right===null&&o.parent._map.set(o.parentSub,o),e.length=n,o},sl=(t,e)=>Ua(t,n=>Pr(n.deletions,e)),Hh=(t,e,n,s,r,o)=>{const a=t.doc,c=a.store,u=a.clientID,l=e.redone;if(l!==null)return Ht(t,l);let d=e.parent._item,h=null,D;if(d!==null&&d.deleted===!0){if(d.redone===null&&(!n.has(d)||Hh(t,d,n,s,r,o)===null))return null;for(;d.redone!==null;)d=Ht(t,d.redone)}const p=d===null?e.parent:d.content.type;if(e.parentSub===null){for(h=e.left,D=e;h!==null;){let E=h;for(;E!==null&&E.parent._item!==d;)E=E.redone===null?null:Ht(t,E.redone);if(E!==null&&E.parent._item===d){h=E;break}h=h.left}for(;D!==null;){let E=D;for(;E!==null&&E.parent._item!==d;)E=E.redone===null?null:Ht(t,E.redone);if(E!==null&&E.parent._item===d){D=E;break}D=D.right}}else{if(D=null,e.right&&!r){for(h=e;h!==null&&h.right!==null&&(h.right.redone||Pr(s,h.right.id)||sl(o.undoStack,h.right.id)||sl(o.redoStack,h.right.id));)for(h=h.right;h.redone;)h=Ht(t,h.redone);if(h&&h.right!==null)return null}else h=p._map.get(e.parentSub)||null;h!==null&&h.parent._item!==d&&(h=p._map.get(e.parentSub)||null)}const F=pt(c,u),y=Re(u,F),b=new Ze(y,h,h&&h.lastId,D,D&&D.id,p,e.parentSub,e.content.copy());return e.redone=y,pc(b,!0),b.integrate(t,0),b};class Ze extends mc{constructor(e,n,s,r,o,a,c,u){super(e,u.getLength()),this.origin=s,this.left=n,this.right=r,this.rightOrigin=o,this.parent=a,this.parentSub=c,this.redone=null,this.content=u,this.info=this.content.isCountable()?Nu:0}set marker(e){(this.info&xo)>0!==e&&(this.info^=xo)}get marker(){return(this.info&xo)>0}get keep(){return(this.info&Lu)>0}set keep(e){this.keep!==e&&(this.info^=Lu)}get countable(){return(this.info&Nu)>0}get deleted(){return(this.info&wo)>0}set deleted(e){this.deleted!==e&&(this.info^=wo)}markDeleted(){this.info|=wo}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=pt(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=pt(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Ls&&this.id.client!==this.parent.client&&this.parent.clock>=pt(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=Gu(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Ht(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===tn||this.right&&this.right.constructor===tn)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Ze?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Ze&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Ls){const s=Ns(n,this.parent);s.constructor===tn?this.parent=null:this.parent=s.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=Gu(e,e.doc.store,Re(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let s=this.left,r;if(s!==null)r=s.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const o=new Set,a=new Set;for(;r!==null&&r!==this.right;){if(a.add(r),o.add(r),ks(this.origin,r.origin)){if(r.id.client<this.id.client)s=r,o.clear();else if(ks(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&a.has(Ns(e.doc.store,r.origin)))o.has(Ns(e.doc.store,r.origin))||(s=r,o.clear());else break;r=r.right}this.left=s}if(this.left!==null){const s=this.left.right;this.right=s,this.left.right=this}else{let s;if(this.parentSub!==null)for(s=this.parent._map.get(this.parentSub)||null;s!==null&&s.left!==null;)s=s.left;else s=this.parent._start,this.parent._start=this;this.right=s}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),xh(e.doc.store,this),this.content.integrate(e,this),Xu(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new tn(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Re(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&ks(e.origin,this.lastId)&&this.right===e&&ks(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(s=>{s.p===e&&(s.p=this,!this.deleted&&this.countable&&(s.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Sr(e.deleteSet,this.id.client,this.id.clock,this.length),Xu(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw Jt();this.content.gc(e),n?YF(e,this,new tn(this.id,this.length)):this.content=new Tr(this.length)}write(e,n){const s=n>0?Re(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,o=this.parentSub,a=this.content.getRef()&Oi|(s===null?0:Xt)|(r===null?0:Ln)|(o===null?0:Er);if(e.writeInfo(a),s!==null&&e.writeLeftID(s),r!==null&&e.writeRightID(r),s===null&&r===null){const c=this.parent;if(c._item!==void 0){const u=c._item;if(u===null){const l=Ch(c);e.writeParentInfo(!0),e.writeString(l)}else e.writeParentInfo(!1),e.writeLeftID(u.id)}else c.constructor===String?(e.writeParentInfo(!0),e.writeString(c)):c.constructor===Ls?(e.writeParentInfo(!1),e.writeLeftID(c)):Jt();o!==null&&e.writeString(o)}this.content.write(e,n)}}const qh=(t,e)=>Wb[e&Oi](t),Wb=[()=>{Jt()},Bb,Rb,jb,_b,Lb,Nb,Kb,Pb,Tb,()=>{Jt()}],Gb=10;class nn extends mc{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){Jt()}write(e,n){e.writeInfo(Gb),le(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const Kh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},Wh="__ $YJS$ __";Kh[Wh]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Kh[Wh]=!0;const Gh=new Map;class Yb{constructor(e){this.room=e,this.onmessage=null,this._onChange=n=>n.key===e&&this.onmessage!==null&&this.onmessage({data:j1(n.newValue||"")}),o1(this._onChange)}postMessage(e){Rd.setItem(this.room,S1(w1(e)))}close(){a1(this._onChange)}}const Xb=typeof BroadcastChannel>"u"?Yb:BroadcastChannel,Dc=t=>En(Gh,t,()=>{const e=Hn(),n=new Xb(t);return n.onmessage=s=>e.forEach(r=>r(s.data,"broadcastchannel")),{bc:n,subs:e}}),Jb=(t,e)=>(Dc(t).subs.add(e),e),Zb=(t,e)=>{const n=Dc(t),s=n.subs.delete(e);return s&&n.subs.size===0&&(n.bc.close(),Gh.delete(t)),s},vs=(t,e,n=null)=>{const s=Dc(t);s.bc.postMessage(e),s.subs.forEach(r=>r(e,n))},Yh=0,gc=1,Xh=2,ji=(t,e)=>{le(t,Yh);const n=VF(e);ut(t,n)},Jh=(t,e,n)=>{le(t,gc),ut(t,ac(e,n))},Qb=(t,e,n)=>Jh(e,n,It(t)),Zh=(t,e,n,s)=>{try{gh(e,It(t),n)}catch(r){s?.(r),console.error("Caught error while handling a Yjs update",r)}},ey=(t,e)=>{le(t,Xh),ut(t,e)},ty=Zh,ny=(t,e,n,s,r)=>{const o=ke(t);switch(o){case Yh:Qb(t,e,n);break;case gc:Zh(t,n,s,r);break;case Xh:ty(t,n,s,r);break;default:throw new Error("Unknown message type")}return o},sy=0,ry=(t,e,n)=>{ke(t)===sy&&n(e,rt(t))},Lo=3e4;class iy extends kd{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=qn();this.getLocalState()!==null&&Lo/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((r,o)=>{o!==this.clientID&&Lo<=n-r.lastUpdated&&this.states.has(o)&&s.push(o)}),s.length>0&&Fc(this,s,"timeout")},hn(Lo/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const n=this.clientID,s=this.meta.get(n),r=s===void 0?0:s.clock+1,o=this.states.get(n);e===null?this.states.delete(n):this.states.set(n,e),this.meta.set(n,{clock:r,lastUpdated:qn()});const a=[],c=[],u=[],l=[];e===null?l.push(n):o==null?e!=null&&a.push(n):(c.push(n),Bs(o,e)||u.push(n)),(a.length>0||u.length>0||l.length>0)&&this.emit("change",[{added:a,updated:u,removed:l},"local"]),this.emit("update",[{added:a,updated:c,removed:l},"local"])}setLocalStateField(e,n){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[e]:n})}getStates(){return this.states}}const Fc=(t,e,n)=>{const s=[];for(let r=0;r<e.length;r++){const o=e[r];if(t.states.has(o)){if(t.states.delete(o),o===t.clientID){const a=t.meta.get(o);t.meta.set(o,{clock:a.clock+1,lastUpdated:qn()})}s.push(o)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},n]),t.emit("update",[{added:[],updated:[],removed:s},n]))},Os=(t,e,n=t.states)=>{const s=e.length,r=lt();le(r,s);for(let o=0;o<s;o++){const a=e[o],c=n.get(a)||null,u=t.meta.get(a).clock;le(r,a),le(r,u),_t(r,JSON.stringify(c))}return Xe(r)},oy=(t,e,n)=>{const s=Gn(e),r=qn(),o=[],a=[],c=[],u=[],l=ke(s);for(let d=0;d<l;d++){const h=ke(s);let D=ke(s);const p=JSON.parse(rt(s)),F=t.meta.get(h),y=t.states.get(h),b=F===void 0?0:F.clock;(b<D||b===D&&p===null&&t.states.has(h))&&(p===null?h===t.clientID&&t.getLocalState()!=null?D++:t.states.delete(h):t.states.set(h,p),t.meta.set(h,{clock:D,lastUpdated:r}),F===void 0&&p!==null?o.push(h):F!==void 0&&p===null?u.push(h):p!==null&&(Bs(p,y)||c.push(h),a.push(h)))}(o.length>0||c.length>0||u.length>0)&&t.emit("change",[{added:o,updated:c,removed:u},n]),(o.length>0||a.length>0||u.length>0)&&t.emit("update",[{added:o,updated:a,removed:u},n])},ay=t=>h1(t,(e,n)=>`${encodeURIComponent(n)}=${encodeURIComponent(e)}`).join("&"),es=0,Qh=3,Ps=1,cy=2,$r=[];$r[es]=(t,e,n,s,r)=>{le(t,es);const o=ny(e,t,n.doc,n);s&&o===gc&&!n.synced&&(n.synced=!0)};$r[Qh]=(t,e,n,s,r)=>{le(t,Ps),ut(t,Os(n.awareness,Array.from(n.awareness.getStates().keys())))};$r[Ps]=(t,e,n,s,r)=>{oy(n.awareness,It(e),n)};$r[cy]=(t,e,n,s,r)=>{ry(e,n.doc,(o,a)=>uy(n,a))};const rl=3e4,uy=(t,e)=>console.warn(`Permission denied to access ${t.url}.
|
|
47
|
-
${e}`),ef=(t,e,n)=>{const s=Gn(e),r=lt(),o=ke(s),a=t.messageHandlers[o];return a?a(r,s,t,n,o):console.error("Unable to compute message"),r},Fa=(t,e,n)=>{e===t.ws&&(t.emit("connection-close",[n,t]),t.ws=null,e.close(),t.wsconnecting=!1,t.wsconnected?(t.wsconnected=!1,t.synced=!1,Fc(t.awareness,Array.from(t.awareness.getStates().keys()).filter(s=>s!==t.doc.clientID),t),t.emit("status",[{status:"disconnected"}])):t.wsUnsuccessfulReconnects++,setTimeout(tf,Va(Sg(2,t.wsUnsuccessfulReconnects)*100,t.maxBackoffTime),t))},tf=t=>{if(t.shouldConnect&&t.ws===null){const e=new t._WS(t.url,t.protocols);e.binaryType="arraybuffer",t.ws=e,t.wsconnecting=!0,t.wsconnected=!1,t.synced=!1,e.onmessage=n=>{t.wsLastMessageReceived=qn();const s=ef(t,new Uint8Array(n.data),!0);Ha(s)>1&&e.send(Xe(s))},e.onerror=n=>{t.emit("connection-error",[n,t])},e.onclose=n=>{Fa(t,e,n)},e.onopen=()=>{t.wsLastMessageReceived=qn(),t.wsconnecting=!1,t.wsconnected=!0,t.wsUnsuccessfulReconnects=0,t.emit("status",[{status:"connected"}]);const n=lt();if(le(n,es),ji(n,t.doc),e.send(Xe(n)),t.awareness.getLocalState()!==null){const s=lt();le(s,Ps),ut(s,Os(t.awareness,[t.doc.clientID])),e.send(Xe(s))}},t.emit("status",[{status:"connecting"}])}},No=(t,e)=>{const n=t.ws;t.wsconnected&&n&&n.readyState===n.OPEN&&n.send(e),t.bcconnected&&vs(t.bcChannel,e,t)};class ly extends za{constructor(e,n,s,{connect:r=!0,awareness:o=new iy(s),params:a={},protocols:c=[],WebSocketPolyfill:u=WebSocket,resyncInterval:l=-1,maxBackoffTime:d=2500,disableBc:h=!1}={}){for(super();e[e.length-1]==="/";)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+"/"+n,this.maxBackoffTime=d,this.params=a,this.protocols=c,this.roomname=n,this.doc=s,this._WS=u,this.awareness=o,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=h,this.wsUnsuccessfulReconnects=0,this.messageHandlers=$r.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=r,this._resyncInterval=0,l>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){const D=lt();le(D,es),ji(D,s),this.ws.send(Xe(D))}},l)),this._bcSubscriber=(D,p)=>{if(p!==this){const F=ef(this,new Uint8Array(D),!1);Ha(F)>1&&vs(this.bcChannel,Xe(F),this)}},this._updateHandler=(D,p)=>{if(p!==this){const F=lt();le(F,es),ey(F,D),No(this,Xe(F))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:D,updated:p,removed:F},y)=>{const b=D.concat(p).concat(F),E=lt();le(E,Ps),ut(E,Os(o,b)),No(this,Xe(E))},this._exitHandler=()=>{Fc(this.awareness,[s.clientID],"app closed")},Kn&&typeof process<"u"&&process.on("exit",this._exitHandler),o.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&rl<qn()-this.wsLastMessageReceived&&Fa(this,this.ws,null)},rl/10),r&&this.connect()}get url(){const e=ay(this.params);return this.serverUrl+"/"+this.roomname+(e.length===0?"":"?"+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,this.emit("synced",[e]),this.emit("sync",[e]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),Kn&&typeof process<"u"&&process.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||(Jb(this.bcChannel,this._bcSubscriber),this.bcconnected=!0);const e=lt();le(e,es),ji(e,this.doc),vs(this.bcChannel,Xe(e),this);const n=lt();le(n,es),Jh(n,this.doc),vs(this.bcChannel,Xe(n),this);const s=lt();le(s,Qh),vs(this.bcChannel,Xe(s),this);const r=lt();le(r,Ps),ut(r,Os(this.awareness,[this.doc.clientID])),vs(this.bcChannel,Xe(r),this)}disconnectBc(){const e=lt();le(e,Ps),ut(e,Os(this.awareness,[this.doc.clientID],new Map)),No(this,Xe(e)),this.bcconnected&&(Zb(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&Fa(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(tf(this),this.connectBc())}}const hs=t=>zs((e,n)=>{t.onerror=s=>n(new Error(s.target.error)),t.onsuccess=s=>e(s.target.result)}),dy=(t,e)=>zs((n,s)=>{const r=indexedDB.open(t);r.onupgradeneeded=o=>e(o.target.result),r.onerror=o=>s(fn(o.target.error)),r.onsuccess=o=>{const a=o.target.result;a.onversionchange=()=>{a.close()},n(a)}}),hy=t=>hs(indexedDB.deleteDatabase(t)),fy=(t,e)=>e.forEach(n=>t.createObjectStore.apply(t,n)),dr=(t,e,n="readwrite")=>{const s=t.transaction(e,n);return e.map(r=>Cy(s,r))},nf=(t,e)=>hs(t.count(e)),my=(t,e)=>hs(t.get(e)),sf=(t,e)=>hs(t.delete(e)),py=(t,e,n)=>hs(t.put(e,n)),ba=(t,e)=>hs(t.add(e)),Dy=(t,e,n)=>hs(t.getAll(e,n)),gy=(t,e,n)=>{let s=null;return yy(t,e,r=>(s=r,!1),n).then(()=>s)},Fy=(t,e=null)=>gy(t,e,"prev"),by=(t,e)=>zs((n,s)=>{t.onerror=s,t.onsuccess=async r=>{const o=r.target.result;if(o===null||await e(o)===!1)return n();o.continue()}}),yy=(t,e,n,s="next")=>by(t.openKeyCursor(e,s),r=>n(r.key)),Cy=(t,e)=>t.objectStore(e),Ey=(t,e)=>IDBKeyRange.upperBound(t,e),wy=(t,e)=>IDBKeyRange.lowerBound(t,e),Ro="custom",rf="updates",of=500,af=(t,e=()=>{},n=()=>{})=>{const[s]=dr(t.db,[rf]);return Dy(s,wy(t._dbref,!1)).then(r=>{t._destroyed||(e(s),Je(t.doc,()=>{r.forEach(o=>gh(t.doc,o))},t,!1),n(s))}).then(()=>Fy(s).then(r=>{t._dbref=r+1})).then(()=>nf(s).then(r=>{t._dbsize=r})).then(()=>s)},xy=(t,e=!0)=>af(t).then(n=>{(e||t._dbsize>=of)&&ba(n,ac(t.doc)).then(()=>sf(n,Ey(t._dbref,!0))).then(()=>nf(n).then(s=>{t._dbsize=s}))});class vy extends kd{constructor(e,n){super(),this.doc=n,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=dy(e,s=>fy(s,[["updates",{autoIncrement:!0}],["custom"]])),this.whenSynced=zs(s=>this.on("synced",()=>s(this))),this._db.then(s=>{this.db=s,af(this,a=>ba(a,ac(n)),()=>{if(this._destroyed)return this;this.synced=!0,this.emit("synced",[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(s,r)=>{if(this.db&&r!==this){const[o]=dr(this.db,[rf]);ba(o,s),++this._dbsize>=of&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{xy(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},n.on("update",this._storeUpdate),this.destroy=this.destroy.bind(this),n.on("destroy",this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off("update",this._storeUpdate),this.doc.off("destroy",this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{hy(this.name)})}get(e){return this._db.then(n=>{const[s]=dr(n,[Ro],"readonly");return my(s,e)})}set(e,n){return this._db.then(s=>{const[r]=dr(s,[Ro]);return py(r,n,e)})}del(e){return this._db.then(n=>{const[s]=dr(n,[Ro]);return sf(s,e)})}}const il=[["#1677c8","#1677c833"],["#d65745","#d6574533"],["#16866a","#16866a33"],["#9a58b5","#9a58b533"],["#d27b18","#d27b1833"],["#3f7d20","#3f7d2033"],["#be3e7b","#be3e7b33"],["#4964c6","#4964c633"],["#8a6a14","#8a6a1433"],["#087f8c","#087f8c33"]],ol=4,al=5,Ay=6,ky=7,Sy=8,Oo=9,jy=3,By=6e4,Ty=720*60*60*1e3,Ly=15e3,Ny=5*6e4;function Ry(t){if(!t||typeof t!="object")return null;const e=t,n=e.requestedBy;return typeof e.mainFile!="string"||typeof e.runId!="string"||!["queued","running","succeeded","failed","cleaned"].includes(e.status??"")||e.status==="cleaned"&&e.cleanMode!=="cache"&&e.cleanMode!=="artifacts"||e.stale!==void 0&&typeof e.stale!="boolean"||typeof e.updatedAt!="string"||!n||typeof n.id!="string"||typeof n.username!="string"||typeof n.name!="string"?null:e}function cl(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const e={};for(const[n,s]of Object.entries(t)){const r=Ry(s);r&&r.mainFile===n&&(e[n]=r)}return e}function Oy(t,e,n){return t<=n&&e<=n}function ul(t,e,n){const s=r=>r>0&&n-r<=Ny;return{recoverable:t.some(r=>r.tabId===e||!s(r.activeAt)),otherActive:t.some(r=>r.tabId!==e&&s(r.activeAt))}}class Py{constructor(e,n){this.projectId=e,this.user=n;const s=window.location.protocol==="https:"?"wss:":"ws:";this.draftTabId=$y(`texlite:collaboration-tab:${n.id}:${e}`);const r=this.readOwnWritableDraftMarker();this.draftGeneration=r?.generation??0,this.draftUpdatedAt=r?.updatedAt??0,this.draftMarkerPresent=r!==null,this.markDraftTabInactive=()=>this.setOwnDraftActivity(!1),this.markDraftTabActive=()=>this.resumeOwnDraftActivity(),window.addEventListener("pagehide",this.markDraftTabInactive),window.addEventListener("pageshow",this.markDraftTabActive),r&&(this.setOwnDraftActivity(!0),this.startDraftHeartbeat()),this.persistence=new vy(`texlite:${n.id}:${e}`,this.doc),this.localDraftTransactionObserver=a=>{if(a.local){for(const[c,u]of this.doc.share)if(c.startsWith("source:")&&(a.changed.has(u)||a.changedParentTypes.has(u))){this.markWritableDraft();return}}},this.doc.on("afterTransaction",this.localDraftTransactionObserver),this.persistence.on("synced",()=>{this.localDraftReady=!0;for(const a of this.draftListeners)a()}),this.provider=new ly(`${s}//${window.location.host}/api/collaboration`,e,this.doc,{connect:!1,disableBc:!0,maxBackoffTime:2500}),this.awareness=this.provider.awareness;const o=this.doc.getMap("texlite:meta");this.metaObserver=(a,c)=>{c.origin===this.provider&&a.keysChanged.has("compileStates")&&(this.authoritativeCompileStates=null,this.notifyCompileStateListeners())},o.observe(this.metaObserver),this.provider.messageHandlers[ol]=(a,c)=>{const u=rt(c),l=this.flushRequests.get(u);if(!l)return;const d=ke(c)===1,h=ke(c),D=rt(c),p=ke(c),F=[];for(let y=0;y<p;y++)F.push(rt(c));if(window.clearTimeout(l.timer),this.flushRequests.delete(u),d)this.clearOwnWritableDraftMarker(l.draftGeneration),l.resolve({revision:h,persistedAt:D,ok:!0,failedPaths:[]});else{const y=Object.assign(new Error(F.length?`保存失败:${F.join(", ")}`:"源码保存到服务器磁盘失败"),{failedPaths:F});l.reject(y)}},this.provider.messageHandlers[al]=(a,c)=>{const u=rt(c),l=this.epochStorageKey(),d=ll(l);if(this.epoch&&this.epoch!==u||d&&d!==u){this.provider.disconnect(),this.rejectFlushes(new Error("Collaboration state changed"));const y=/^([0-9]+):/.exec(u)?.[1]??null,b=d?/^([0-9]+):/.exec(d)?.[1]??null:null,E=u.endsWith(":reload")||y!==null&&y!==b,x=()=>{Po(l,u.replace(/:reload$/,"")),window.location.reload()};E?x():this.persistence.clearData().then(()=>{this.clearWritableDraftMarkers(),x()});return}this.epoch=u,Po(l,u);const h=this.provider.ws;if(!h||h.readyState!==WebSocket.OPEN)return;const D=lt();le(D,al),_t(D,u),le(D,jy),h.send(Xe(D));const p=lt();le(p,0),ji(p,this.doc),h.send(Xe(p));const F=lt();le(F,1),ut(F,Os(this.awareness,[this.doc.clientID])),h.send(Xe(F))},this.provider.messageHandlers[ky]=(a,c)=>{const u=rt(c),l=rt(c);if(u!==this.user.id)return;if(l==="revoked"){this.rejectFlushes(new Error("Project access revoked")),this.provider.disconnect();for(const h of this.permissionListeners)h("revoked",this.permission);return}if(l!=="read"&&l!=="edit"&&l!=="owner")return;const d=this.permission;if(this.setPermission(l),d!==l){l==="read"&&this.rejectFlushes(new Error("Project permission changed to read-only"));for(const h of this.permissionListeners)h(l,d)}},this.provider.messageHandlers[Ay]=(a,c)=>{rt(c)},this.provider.messageHandlers[Sy]=(a,c)=>{let u={};try{u=cl(JSON.parse(rt(c)))}catch{}this.authoritativeCompileStates=u,this.notifyCompileStateListeners()},this.provider.messageHandlers[Oo]=(a,c)=>{const u=rt(c),l=rt(c),d=rt(c),h=rt(c),D=rt(c),p=rt(c);if(u==="state"){const y=la(c)?rt(c):"",b=la(c)?rt(c):"",E=Number(D);if(!y||!Number.isFinite(E)||E<=Date.now())this.removeFormatLeaseState(d),this.notifyFormatLeaseListeners(null);else{const x={path:d,holderUserId:y,holderName:b,expiresAt:E};this.formatLeaseStatesByPath.set(d,x);const N=this.formatLeaseExpiryTimers.get(d);N!==void 0&&window.clearTimeout(N);const O=window.setTimeout(()=>{const I=this.formatLeaseStatesByPath.get(d);!I||I.expiresAt>Date.now()||(this.removeFormatLeaseState(d),this.notifyFormatLeaseListeners(null))},Math.max(0,E-Date.now())+25);this.formatLeaseExpiryTimers.set(d,O),this.notifyFormatLeaseListeners(x)}return}const F=this.formatLeaseRequests.get(l);F&&(window.clearTimeout(F.timer),this.formatLeaseRequests.delete(l),u==="denied"?F.reject(new Error(p||"Format lease request was denied")):F.resolve({status:u,filePath:d,token:h,expiresAt:Number(D)}))},this.provider.on("status",({status:a})=>{a==="disconnected"&&(this.authoritativeCompileStates=null,this.notifyCompileStateListeners(),this.rejectFlushes(new Error("Collaboration connection closed")),this.rejectFormatLeaseRequests(new Error("Collaboration connection closed")),this.clearFormatLeaseStates())}),this.updateLocalAwareness()}projectId;user;doc=new ls;provider;awareness;persistence;permission="read";activeFile="";epoch=null;destroyed=!1;localDraftReady=!1;draftListeners=new Set;permissionListeners=new Set;compileStateListeners=new Set;flushRequests=new Map;formatLeaseRequests=new Map;formatLeaseListeners=new Set;formatLeaseStatesByPath=new Map;formatLeaseExpiryTimers=new Map;draftTabId;draftGeneration=0;draftUpdatedAt=0;draftMarkerPresent=!1;draftHeartbeatTimer=null;markDraftTabInactive;markDraftTabActive;undoManagers=new Map;authoritativeCompileStates=null;metaObserver;localDraftTransactionObserver;connect(){this.destroyed||(this.provider.connect(),this.updateLocalAwareness())}getText(e){return this.doc.getText(`source:${e}`)}getUndoManager(e){const n=this.undoManagers.get(e);if(n)return n;const s=new eb(this.getText(e));return this.undoManagers.set(e,s),s}applyTextEdits(e,n){if(this.permission==="read")throw new Error("Read-only collaborators cannot edit source files");const s=this.getText(e);let r=0;for(const o of n){if(!Number.isInteger(o.from)||!Number.isInteger(o.to)||o.from<r||o.to<o.from||o.to>s.length)throw new RangeError("Invalid collaborative text edits");r=o.to}this.doc.transact(()=>{for(let o=n.length-1;o>=0;o-=1){const a=n[o];a.to>a.from&&s.delete(a.from,a.to-a.from),a.replacement&&s.insert(a.from,a.replacement)}})}get meta(){return this.doc.getMap("texlite:meta")}compileStates(){return this.authoritativeCompileStates??cl(this.meta.get("compileStates"))}onCompileStates(e){return this.compileStateListeners.add(e),()=>this.compileStateListeners.delete(e)}get synced(){return this.provider.synced}get connected(){return this.provider.wsconnected}get draftReady(){return this.localDraftReady}get currentPermission(){return this.permission}onDraftReady(e){return this.draftListeners.add(e),this.localDraftReady&&e(),()=>this.draftListeners.delete(e)}onPermissionChanged(e){return this.permissionListeners.add(e),()=>this.permissionListeners.delete(e)}async discardLocalDraft(){return this.hasOtherWritableDraft?!1:(await this.persistence.clearData(),this.localDraftReady=!1,this.clearWritableDraftMarkers(),!0)}get hasWritableDraft(){const e=this.readWritableDraftMarkers();return ul(e.map(({tabId:n,marker:s})=>({tabId:n,activeAt:s.activeAt})),this.draftTabId,Date.now()).recoverable}get hasOtherWritableDraft(){const e=this.readWritableDraftMarkers();return ul(e.map(({tabId:n,marker:s})=>({tabId:n,activeAt:s.activeAt})),this.draftTabId,Date.now()).otherActive}setPermission(e,n=!1){const s=this.permission;if(this.permission=e,e==="read"&&(s!=="read"&&this.rejectFlushes(new Error("Project permission changed to read-only")),this.destroyUndoManagers(),this.clearFormatLeaseStates()),this.updateLocalAwareness(),n&&s!==e)for(const r of this.permissionListeners)r(e,s)}setActiveFile(e){this.activeFile!==e&&(this.activeFile=e,this.awareness.setLocalStateField("cursor",null),this.updateLocalAwareness())}sessions(){const e=[];return this.awareness.getStates().forEach((n,s)=>{const r=n?.user;!r||typeof r.id!="string"||typeof r.name!="string"||e.push({clientId:s,userId:r.id,username:typeof r.username=="string"?r.username:r.name,name:r.name,color:typeof r.color=="string"?r.color:"#1677c8",colorLight:typeof r.colorLight=="string"?r.colorLight:"#1677c833",permission:r.permission==="owner"||r.permission==="edit"?r.permission:"read",filePath:typeof n.filePath=="string"?n.filePath:"",editing:!!n.cursor,local:s===this.doc.clientID})}),e.sort((n,s)=>Number(s.local)-Number(n.local)||n.name.localeCompare(s.name))}flush(){const e=this.provider.ws;if(!this.provider.synced||!e||e.readyState!==WebSocket.OPEN)return Promise.reject(new Error("Collaboration connection is unavailable"));const n=crypto.randomUUID(),s=this.draftGeneration,r=lt();return le(r,ol),_t(r,n),new Promise((o,a)=>{const c=window.setTimeout(()=>{this.flushRequests.delete(n),a(new Error("Collaboration save timed out"))},5e3);this.flushRequests.set(n,{resolve:o,reject:a,timer:c,draftGeneration:s}),e.send(Xe(r))})}onFormatLeaseState(e){this.formatLeaseListeners.add(e);for(const n of this.formatLeaseStatesByPath.values())e(n);return()=>this.formatLeaseListeners.delete(e)}formatLeaseStates(){const e=Date.now();for(const[n,s]of this.formatLeaseStatesByPath)s.expiresAt<=e&&this.removeFormatLeaseState(n);return[...this.formatLeaseStatesByPath.values()]}async acquireFormatLease(e){if(this.permission==="read")throw new Error("Formatting requires write permission");const n=await this.requestFormatLease("acquire",e);if(n.status!=="grant"||!n.token||!Number.isFinite(n.expiresAt))throw new Error("Format lease was not granted");let s=n.token,r=n.expiresAt,o=!1;const a=async()=>{if(o)throw new Error("Format lease has already been released");const u=await this.requestFormatLease("renew",e,s);if(u.status!=="renewed"||!Number.isFinite(u.expiresAt))throw new Error("Format lease renewal failed");s=u.token||s,r=u.expiresAt};return{path:e,get token(){return s},get expiresAt(){return r},confirm:a,renew:a,release:async()=>{if(o)return;o=!0;const u=this.provider.ws;if(!(!u||u.readyState!==WebSocket.OPEN))try{await this.requestFormatLease("release",e,s)}catch{}}}}reconnect(){this.destroyed||(this.rejectFlushes(new Error("Collaboration connection reset")),this.provider.disconnect(),this.provider.connect(),this.updateLocalAwareness())}destroy(){this.destroyed=!0,this.setOwnDraftActivity(!1),this.stopDraftHeartbeat(),window.removeEventListener("pagehide",this.markDraftTabInactive),window.removeEventListener("pageshow",this.markDraftTabActive),this.rejectFlushes(new Error("Collaboration connection closed")),this.provider.destroy(),this.persistence.destroy(),this.draftListeners.clear(),this.compileStateListeners.clear(),this.rejectFormatLeaseRequests(new Error("Collaboration connection closed")),this.clearFormatLeaseStates(),this.formatLeaseListeners.clear(),this.meta.unobserve(this.metaObserver),this.doc.off("afterTransaction",this.localDraftTransactionObserver),this.destroyUndoManagers(),this.doc.destroy()}destroyUndoManagers(){for(const e of this.undoManagers.values())e.destroy();this.undoManagers.clear()}notifyCompileStateListeners(){for(const e of this.compileStateListeners)e()}rejectFlushes(e){for(const n of this.flushRequests.values())window.clearTimeout(n.timer),n.reject(e);this.flushRequests.clear()}requestFormatLease(e,n,s=""){const r=this.provider.ws;if(!this.provider.synced||!r||r.readyState!==WebSocket.OPEN)return Promise.reject(new Error("Collaboration connection is unavailable"));const o=crypto.randomUUID(),a=lt();return le(a,Oo),_t(a,e),_t(a,o),_t(a,n),_t(a,s),new Promise((c,u)=>{const l=window.setTimeout(()=>{if(this.formatLeaseRequests.delete(o),e==="acquire"){const d=this.provider.ws;if(d?.readyState===WebSocket.OPEN){const h=lt();le(h,Oo),_t(h,"cancel"),_t(h,o),_t(h,n),_t(h,""),d.send(Xe(h))}}u(new Error("Format lease request timed out"))},e==="acquire"?By:5e3);this.formatLeaseRequests.set(o,{resolve:c,reject:u,timer:l}),r.send(Xe(a))})}rejectFormatLeaseRequests(e){for(const n of this.formatLeaseRequests.values())window.clearTimeout(n.timer),n.reject(e);this.formatLeaseRequests.clear()}clearFormatLeaseStates(){for(const e of this.formatLeaseExpiryTimers.values())window.clearTimeout(e);this.formatLeaseExpiryTimers.clear(),this.formatLeaseStatesByPath.size&&(this.formatLeaseStatesByPath.clear(),this.notifyFormatLeaseListeners(null))}removeFormatLeaseState(e){const n=this.formatLeaseExpiryTimers.get(e);n!==void 0&&window.clearTimeout(n),this.formatLeaseExpiryTimers.delete(e),this.formatLeaseStatesByPath.delete(e)}notifyFormatLeaseListeners(e){for(const n of this.formatLeaseListeners)n(e)}updateLocalAwareness(){const[e,n]=il[Math.abs(this.doc.clientID)%il.length];this.awareness.setLocalStateField("user",{id:this.user.id,username:this.user.username,name:this.user.displayName,color:e,colorLight:n,permission:this.permission,sessionId:String(this.doc.clientID)}),this.awareness.setLocalStateField("filePath",this.activeFile)}epochStorageKey(){return`texlite:collaboration-epoch:${this.user.id}:${this.projectId}`}writableDraftStoragePrefix(){return`texlite:collaboration-writable:${this.user.id}:${this.projectId}:`}ownWritableDraftStorageKey(){return`${this.writableDraftStoragePrefix()}${this.draftTabId}`}markWritableDraft(){this.draftGeneration+=1,this.draftUpdatedAt=Date.now(),this.draftMarkerPresent||this.writeOwnWritableDraftMarker(!0),this.startDraftHeartbeat()}clearWritableDraftMarkers(){for(const{key:e}of this.readWritableDraftMarkers())ar(e);this.draftMarkerPresent=!1,this.stopDraftHeartbeat(),ar(this.writableDraftStoragePrefix().slice(0,-1))}clearOwnWritableDraftMarker(e){const n=this.readOwnWritableDraftMarker();!n||!Oy(n.generation,this.draftGeneration,e)||(ar(this.ownWritableDraftStorageKey()),this.draftMarkerPresent=!1,this.stopDraftHeartbeat())}readOwnWritableDraftMarker(){return this.readWritableDraftMarker(this.ownWritableDraftStorageKey())}readWritableDraftMarkers(){const e=this.writableDraftStoragePrefix(),n=[];for(const s of _y()){if(!s.startsWith(e))continue;const r=this.readWritableDraftMarker(s);r&&n.push({key:s,tabId:s.slice(e.length),marker:r})}return n}readWritableDraftMarker(e){const n=ll(e);if(!n)return null;try{const s=JSON.parse(n);if(!s||typeof s!="object"||Array.isArray(s))return null;const r=s,o=Date.now();if(!Number.isInteger(r.generation)||(r.generation??0)<0||typeof r.updatedAt!="number"||!Number.isFinite(r.updatedAt)||r.updatedAt<=0||o-r.updatedAt>Ty)return ar(e),null;const a=typeof r.activeAt=="number"&&Number.isFinite(r.activeAt)?Math.max(0,r.activeAt):0;return{generation:r.generation,updatedAt:r.updatedAt,activeAt:a}}catch{return ar(e),null}}writeOwnWritableDraftMarker(e){if(!this.draftMarkerPresent&&this.draftUpdatedAt<=0)return;const n={generation:this.draftGeneration,updatedAt:this.draftUpdatedAt||Date.now(),activeAt:e?Date.now():0};Po(this.ownWritableDraftStorageKey(),JSON.stringify(n)),this.draftMarkerPresent=!0}setOwnDraftActivity(e){this.draftMarkerPresent&&(this.writeOwnWritableDraftMarker(e),e?this.startDraftHeartbeat():this.stopDraftHeartbeat())}resumeOwnDraftActivity(){const e=this.readOwnWritableDraftMarker();if(!e){this.draftMarkerPresent=!1,this.stopDraftHeartbeat();return}this.draftGeneration=Math.max(this.draftGeneration,e.generation),this.draftUpdatedAt=e.updatedAt,this.draftMarkerPresent=!0,this.setOwnDraftActivity(!0)}startDraftHeartbeat(){this.draftHeartbeatTimer!==null||!this.draftMarkerPresent||(this.draftHeartbeatTimer=window.setInterval(()=>{this.writeOwnWritableDraftMarker(!0)},Ly))}stopDraftHeartbeat(){this.draftHeartbeatTimer!==null&&(window.clearInterval(this.draftHeartbeatTimer),this.draftHeartbeatTimer=null)}}function ll(t){try{return window.localStorage.getItem(t)}catch{return null}}function Po(t,e){try{window.localStorage.setItem(t,e)}catch{}}function ar(t){try{window.localStorage.removeItem(t)}catch{}}function _y(){try{const t=[];for(let e=0;e<window.localStorage.length;e+=1){const n=window.localStorage.key(e);n&&t.push(n)}return t}catch{return[]}}function Iy(t){try{return window.sessionStorage.getItem(t)}catch{return null}}function My(t,e){try{window.sessionStorage.setItem(t,e)}catch{}}function $y(t){const e=Iy(t);if(e)return e;const n=typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`;return My(t,n),n}function Uy(t,e){return Array.from(t.trim()||e.trim()||"?")[0]?.toLocaleUpperCase()??"?"}function zy(t){if(!t||typeof t!="object")return!1;const e=t;return(e.kind==="update"||e.kind==="move"||e.kind==="delete")&&typeof e.revision=="string"}function Vy(t,e,n,s,r,o){const[a]=f.useState(()=>new Py(t,e)),[c,u]=f.useState("connecting"),[l,d]=f.useState(!1),[h,D]=f.useState([]),[p,F]=f.useState(null),[y,b]=f.useState(null),[E,x]=f.useState(""),[N,O]=f.useState(""),[I,q]=f.useState([]),[z,X]=f.useState(!1),[G,A]=f.useState(s),[ie,M]=f.useState(null),K=f.useRef(n),L=f.useRef(o),S=f.useRef(r);K.current=n,L.current=o,S.current=r,f.useEffect(()=>{const ye=a.compileStates();F(ye[n]??null)},[n,a]),f.useEffect(()=>{const ye=()=>D(a.sessions()),W=()=>{d(!1),D([]),F(null),b(null),x(""),O(""),q([]),L.current()},U=({status:Oe})=>{u(Oe),Oe!=="connected"&&W()},ve=Oe=>{d(Oe),Oe||W()},pe=()=>{u("disconnected"),W()},B=()=>{const Oe=a.meta.get("filesEvent");zy(Oe)&&b(Oe);const Ve=a.meta.get("commentsRevision");typeof Ve=="string"&&x(Ve);const ht=a.meta.get("dictionaryRevision");typeof ht=="string"&&O(ht);const me=a.compileStates();F(me[K.current]??null)},ue=()=>{const Oe=a.compileStates();F(Oe[K.current]??null)};a.awareness.on("change",ye),a.provider.on("status",U),a.provider.on("sync",ve),a.provider.on("connection-close",pe),a.provider.on("connection-error",pe),a.meta.observe(B);const De=a.onCompileStates(ue),Me=()=>q(a.formatLeaseStates()),j=a.onFormatLeaseState(Me),ae=()=>{if(!S.current||a.currentPermission!=="read")return;const Oe=a.hasWritableDraft,Ve=a.hasOtherWritableDraft;!Oe&&!Ve||M({previous:"edit",localDraftReady:Oe,otherTabDraft:Ve})},ge=a.onDraftReady(()=>{X(!0),ae()}),We=a.onPermissionChanged((Oe,Ve)=>{if(Oe==="revoked"){u("disconnected"),d(!1),L.current();return}A(Oe),Oe==="read"&&Ve!=="read"?M({previous:Ve,localDraftReady:a.hasWritableDraft,otherTabDraft:a.hasOtherWritableDraft}):Oe!=="read"&&M(null)});return ye(),B(),u(a.connected?"connected":"connecting"),d(a.synced),()=>{a.awareness.off("change",ye),a.provider.off("status",U),a.provider.off("sync",ve),a.provider.off("connection-close",pe),a.provider.off("connection-error",pe),a.meta.unobserve(B),De(),j(),ge(),We(),a.destroy()}},[a]),f.useEffect(()=>{r&&a.connect()},[a,r]),f.useEffect(()=>{a.setPermission(s),A(s),r&&s==="read"&&(a.hasWritableDraft||a.hasOtherWritableDraft)?M({previous:"edit",localDraftReady:a.hasWritableDraft,otherTabDraft:a.hasOtherWritableDraft}):s!=="read"&&M(null)},[a,s,r]);const P=ie!==null;return f.useEffect(()=>{if(!P)return;const ye=()=>{if(a.currentPermission!=="read")return;const U=a.hasWritableDraft,ve=a.hasOtherWritableDraft;M(pe=>!pe||pe.localDraftReady===U&&pe.otherTabDraft===ve?pe:{...pe,localDraftReady:U,otherTabDraft:ve})};ye();const W=window.setInterval(ye,2e3);return()=>window.clearInterval(W)},[a,P]),{collaboration:a,status:c,synced:l,activeSessions:h,compileState:p,setCompileState:F,formatLeaseStates:I,filesEvent:y,commentsRevision:E,dictionaryRevision:N,localDraftReady:z,permission:G,reconnect:()=>{u("connecting"),d(!1),D([]),F(null),q([]),a.reconnect()},permissionDowngrade:ie,dismissPermissionDowngrade:()=>M(null),discardLocalDraft:async()=>await a.discardLocalDraft()?(M(null),window.location.reload(),!0):(M(W=>W&&{...W,otherTabDraft:!0}),!1)}}function Cs(t){return t instanceof Error&&t.name==="AbortError"}function Hy({projectId:t,project:e,mainFile:n,initialLatest:s,collaborationSynced:r,sharedState:o,onSharedState:a,save:c,loadOutline:u,onPreviewTab:l,onError:d,onCompileStart:h,onCompileSuccess:D,onPdfChanged:p}){const{t:F}=Qe(),[y,b]=f.useState(""),[E,x]=f.useState(!0),[N,O]=f.useState(null),[I,q]=f.useState("full"),[z,X]=f.useState(""),[G,A]=f.useState(null),[ie,M]=f.useState(null),[K,L]=f.useState([]),[S,P]=f.useState(null),[he,xe]=f.useState(!1),[Fe,ye]=f.useState(!1),[W,U]=f.useState(()=>new Set),[ve,pe]=f.useState(""),B=f.useRef(n),ue=f.useRef(""),De=f.useRef(null),Me=f.useRef(s),j=f.useRef(!1),ae=f.useRef(null),ge=f.useRef(null),We=f.useRef(new Set),Oe=f.useRef(new Map),Ve=f.useRef(null),ht=f.useRef(()=>{}),me=f.useRef({onSharedState:a,save:c,loadOutline:u,onPreviewTab:l,onError:d,onCompileStart:h,onCompileSuccess:D,onPdfChanged:p});B.current=n,me.current={onSharedState:a,save:c,loadOutline:u,onPreviewTab:l,onError:d,onCompileStart:h,onCompileSuccess:D,onPdfChanged:p};const xt=R=>{Ve.current!==R&&(Ve.current=R,me.current.onCompileSuccess())},vt=async(R,Q)=>{Q||(ae.current?.abort(),ae.current=new AbortController,Q=ae.current.signal);try{const V=R?`?mainFile=${encodeURIComponent(R)}`:"",Ye=await re(`/api/projects/${t}/compile/artifacts${V}`,{signal:Q});B.current===R&&(L(Ye.artifacts),P(null))}catch(V){!Cs(V)&&B.current===R&&(L([]),P(null))}finally{ae.current?.signal===Q&&(ae.current=null)}};f.useEffect(()=>{if(De.current?.abort(),!n){x(!1),b(""),O(null),q("full"),X(""),A(null),M(null),L([]),P(null),me.current.onPdfChanged();return}const R=new AbortController;De.current=R,x(!0),X(""),A(null),M(null),y&&n&&ue.current===n||(b(""),O(null),q("full")),L([]),P(null),me.current.onPdfChanged();let V=null;const Ye=`?mainFile=${encodeURIComponent(n)}`,Ge=j.current?null:Me.current;Ge&&(j.current=!0);const je=()=>re(`/api/projects/${t}/compile/latest${Ye}`,{signal:R.signal}),at=Ge?Ge.then(de=>de.mainFile!==n?je():de,()=>je()):je();let tt=!1;const ct=()=>{if(tt||R.signal.aborted||!n)return;tt=!0;const de=new AbortController;We.current.add(de),vt(n,de.signal).finally(()=>{We.current.delete(de)}),me.current.loadOutline(R.signal,n).catch(()=>{})};return at.then(de=>{R.signal.aborted||n&&de.mainFile!==B.current||(X(de.latestRun?.log??""),A(de.latestRun?.diagnostics??null),M(de.latestRun?.status==="succeeded"||de.latestRun?.status==="failed"?de.latestRun.status:null),n&&de.latestRun?.requestedBy&&(de.latestRun.status==="queued"||de.latestRun.status==="running")&&me.current.onSharedState({mainFile:n,runId:de.latestRun.id,status:de.latestRun.status,requestedBy:de.latestRun.requestedBy,updatedAt:new Date().toISOString()}),de.pdfUrl&&(ue.current=de.mainFile,b(de.pdfUrl),O(de.pdfCompiledAt),q(de.pdfLoadingMode??"full"),me.current.onPreviewTab("pdf")))}).catch(de=>{!Cs(de)&&B.current===n&&me.current.onError(ce(de))}).finally(()=>{De.current===R&&(De.current=null),R.signal.aborted||(x(!1),V=window.setTimeout(ct,0))}),()=>{V!==null&&window.clearTimeout(V),R.abort(),ge.current?.abort();for(const de of We.current)de.abort();We.current.clear()}},[t,n]),f.useEffect(()=>{if(!(!o||o.mainFile!==n||o.status!=="cleaned"||!o.cleanMode)){De.current?.abort(),ae.current?.abort(),ge.current?.abort();for(const R of We.current)R.abort();We.current.clear(),o.cleanMode==="artifacts"?(X(""),A(null),M(null),b(""),O(null),q("full"),L([]),P(null),me.current.onPdfChanged(),me.current.onPreviewTab("pdf"),pe(F("editor.cleanArtifactsComplete"))):pe(F("editor.cleanCacheComplete"))}},[o?.runId,o?.status,o?.cleanMode,o?.mainFile,n,F]),f.useEffect(()=>{if(!o||o.mainFile!==n||o.status!=="succeeded"&&o.status!=="failed")return;let R=!1;De.current?.abort(),ge.current?.abort();const Q=new AbortController;return De.current=Q,x(!0),re(`/api/projects/${t}/compile/latest?mainFile=${encodeURIComponent(n)}`,{signal:Q.signal}).then(V=>{R||V.mainFile!==B.current||V.latestRun?.id!==o.runId||(X(V.latestRun.log),A(V.latestRun.diagnostics),M(o.status==="succeeded"?"succeeded":"failed"),o.status==="succeeded"&&o.stale&&pe(F("editor.compileSnapshotStale")),o.status==="succeeded"&&V.pdfUrl?(me.current.onPdfChanged(),b(V.pdfUrl),O(V.pdfCompiledAt),q(V.pdfLoadingMode??"full"),me.current.onPreviewTab("pdf"),xt(o.runId),vt(n)):o.status==="failed"&&me.current.onPreviewTab(V.latestRun.diagnostics.errors.length?"errors":"log"))}).catch(V=>{!Cs(V)&&!R&&me.current.onError(ce(V))}).finally(()=>{R||x(!1)}),()=>{R=!0,Q.abort(),De.current===Q&&(De.current=null)}},[o?.runId,o?.status,o?.mainFile,o?.stale,n,t,F]);const it=async()=>{if(!e||!n||e.permission==="read"||!r||Oe.current.has(n)||o?.mainFile===n&&(o.status==="queued"||o.status==="running"))return;const R=n;U(V=>new Set([...V,R])),me.current.onCompileStart(),pe(""),ge.current?.abort(),ge.current=null,X(""),A(null),M(null),me.current.onPreviewTab(y?"pdf":"log");const Q=new AbortController;Oe.current.set(R,Q);try{if(!await me.current.save())return;const V=await re(`/api/projects/${t}/compile`,{method:"POST",signal:Q.signal,body:JSON.stringify({mainFile:R})});if(V.mainFile!==B.current)return;X(V.log),A(V.diagnostics),M(V.ok?"succeeded":"failed"),V.skipped&&pe(F("editor.upToDate")),V.ok&&V.stale&&pe(F("editor.compileSnapshotStale")),V.pdfUrl?(me.current.onPdfChanged(),b(V.pdfUrl),O(V.pdfCompiledAt),q(V.pdfLoadingMode??"full"),me.current.onPreviewTab("pdf"),V.ok&&(V.skipped?me.current.onCompileSuccess():xt(V.runId))):me.current.onPreviewTab(V.diagnostics.errors.length?"errors":"log")}catch(V){!Cs(V)&&B.current===R&&me.current.onError(ce(V))}finally{Oe.current.get(R)===Q&&(Oe.current.delete(R),U(V=>{const Ye=new Set(V);return Ye.delete(R),Ye}))}},ze=async R=>{if(!e||!n||e.permission==="read"||!r||Fe||Oe.current.has(n)||o?.mainFile===n&&(o.status==="queued"||o.status==="running"))return;const Q=n;ye(!0),De.current?.abort(),ae.current?.abort(),ge.current?.abort();try{if((await re(`/api/projects/${t}/compile/clean`,{method:"POST",body:JSON.stringify({mainFile:Q,mode:R})})).mainFile!==B.current)return;me.current.onSharedState(null),R==="artifacts"&&(X(""),A(null),M(null),b(""),O(null),q("full"),L([]),P(null),me.current.onPdfChanged()),pe(F(R==="cache"?"editor.cleanCacheComplete":"editor.cleanArtifactsComplete"))}catch(V){!Cs(V)&&B.current===Q&&me.current.onError(ce(V))}finally{ye(!1)}};ht.current=()=>{it()},f.useEffect(()=>{if(!ve)return;const R=window.setTimeout(()=>pe(""),3e3);return()=>window.clearTimeout(R)},[ve]),f.useEffect(()=>{const R=Q=>{!(Q.ctrlKey||Q.metaKey)||Q.key.toLocaleLowerCase()!=="s"||(Q.preventDefault(),Q.stopPropagation(),Q.repeat||ht.current())};return window.addEventListener("keydown",R,!0),()=>window.removeEventListener("keydown",R,!0)},[]),f.useEffect(()=>()=>{De.current?.abort(),ae.current?.abort(),ge.current?.abort();for(const R of We.current)R.abort();We.current.clear();for(const R of Oe.current.values())R.abort();Oe.current.clear()},[]);const Rt=async R=>{if(!R.viewable)return;ge.current?.abort();const Q=new AbortController;ge.current=Q,xe(!0);try{const V=await re(`/api/projects/${t}/compile/artifacts?mainFile=${encodeURIComponent(n)}&path=${encodeURIComponent(R.path)}`,{signal:Q.signal});!Q.signal.aborted&&ge.current===Q&&B.current===n&&P(V)}catch(V){Cs(V)||me.current.onError(ce(V))}finally{ge.current===Q&&(ge.current=null,xe(!1))}};return{pdfUrl:y,pdfCompiledAt:N,pdfLoadingMode:I,pdfLoading:E,compileLog:z,compileDiagnostics:G,compileOutcome:ie,artifacts:K,artifactPreview:S,artifactLoading:he,editorNotice:ve,localCompiling:W.has(n),cleaning:Fe,compile:it,cleanCompile:ze,viewArtifact:Rt}}const ya=10*1024*1024,qy=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".avif",".pdf",".zip",".gz",".bz2",".xz",".tar",".rar",".7z",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odt",".ods",".odp",".mp3",".mp4",".wav",".ogg",".webm",".mov",".avi",".wasm",".exe",".bin",".so",".dll",".class",".jar"]);function dl(t){return t instanceof Error&&t.name==="AbortError"}function hr(t){const e=t.split("/").filter(Boolean);return e.pop(),e.map((n,s)=>e.slice(0,s+1).join("/"))}function Zn(t,e){return!!(t&&e)&&(e===t||e.startsWith(`${t}/`))}function Ky(t){const e=`.${t.split(".").at(-1)?.toLocaleLowerCase()??""}`;return!qy.has(e)}function _s(t){return/(?:\.(?:tex|bib|sty|cls|txt|md)|latexmkrc)$/i.test(t)}function hl(t){const e=t.split(".").at(-1)?.toLocaleLowerCase()??"";return e==="pdf"?"pdf":["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"].includes(e)?"image":Ky(t)?"text":"unsupported"}function Wy(t,e){return`/api/projects/${t}/file/raw?path=${encodeURIComponent(e)}`}function Gy({projectId:t,site:e,activeFile:n,dirty:s,save:r,onError:o,onProject:a,onActiveFile:c,onActiveMainFile:u,onRootDocuments:l}){const{t:d}=Qe(),[h,D]=f.useState([]),[p,F]=f.useState(!1),[y,b]=f.useState(""),[E,x]=f.useState(null),[N,O]=f.useState(!1),[I,q]=f.useState(!1),[z,X]=f.useState(""),[G,A]=f.useState(""),[ie,M]=f.useState(""),[K,L]=f.useState(new Set),[S,P]=f.useState(null),[he,xe]=f.useState(""),[Fe,ye]=f.useState(""),[W,U]=f.useState(null),[ve,pe]=f.useState(!1),[B,ue]=f.useState(null),[De,Me]=f.useState(!1),j=f.useRef(null),ae=f.useRef(null),ge=async(R={})=>{j.current?.abort(),j.current=null;const Q=R.signal?null:new AbortController;Q&&(j.current=Q);try{const V=await re(`/api/projects/${t}/files`,{signal:R.signal??Q?.signal});return(!R.isCurrent||R.isCurrent())&&D(V.files),V.files}catch(V){if(!dl(V))throw V;return}finally{Q&&j.current===Q&&(j.current=null)}},We=async()=>{if(!(!y.trim()||y.trim().endsWith("/"))){A("");try{await re(`/api/projects/${t}/file`,{method:"POST",body:JSON.stringify({path:y,content:""})}),await ge(),c(y),L(R=>new Set([...R,...hr(y)])),F(!1),b("")}catch(R){A(ce(R))}}},Oe=async()=>{if(!z.trim())return;A("");const R=ie?`${ie}/${z.trim()}`:z.trim();try{const Q=await re(`/api/projects/${t}/folders`,{method:"POST",body:JSON.stringify({path:R})});await ge(),L(V=>new Set([...V,...hr(Q.path),Q.path])),M(Q.path),q(!1),X("")}catch(Q){A(ce(Q))}},Ve=async(R,Q=new Set,V=ie)=>{if(!R.length)return;const Ye=e.maxUploadSizeMB;if(R.find(Ce=>Ce.size>Ye*1024*1024))return o(d("errors.fileTooLarge",{size:Ye}));const je=V,at=R.map(Ce=>je?`${je}/${Ce.name}`:Ce.name),tt=new Map;for(const Ce of at)tt.set(Ce,(tt.get(Ce)??0)+1);const ct=[...tt.entries()].filter(([,Ce])=>Ce>1).map(([Ce])=>Ce);if(ct.length)return o(d("errors.duplicateUploadNames",{files:ct.join(", ")}));const de=new Set(h.map(Ce=>Ce.path)),ft=[...new Set(at.filter(Ce=>de.has(Ce)&&!Q.has(Ce)))];if(ft.length){ue({files:R,directory:je,collisions:ft});return}ue(null),Me(!0);try{const Ce=new URLSearchParams;je&&Ce.set("directory",je);let Dt="";for(const[ee,oe]of R.entries()){const et=at[ee];Ce.delete("overwrite"),Q.has(et)&&Ce.set("overwrite","1");const gt=Ce.toString()?`?${Ce.toString()}`:"",mt=new FormData;mt.append("file",oe);const At=await fetch(`/api/projects/${t}/upload${gt}`,{method:"POST",body:mt}),kt=await At.json().catch(()=>({}));if(!At.ok){if(At.status===409&&!Q.has(et)&&kt.code==="FILE_EXISTS"){ee>0&&await ge(),ue({files:R.slice(ee),directory:je,collisions:[typeof kt.path=="string"?kt.path:et]});return}throw new Error(At.status===409?d("errors.pathConflict"):Ea(kt,At.status,"errors.upload"))}typeof kt.path=="string"&&_s(kt.path)&&(Dt=kt.path)}await ge(),Dt&&c(Dt)}catch(Ce){o(ce(Ce))}finally{Me(!1)}},ht=async R=>{await Ve(Array.from(R.target.files??[])),R.target.value=""},me=async R=>{ae.current?.abort(),ae.current=null,O(!1);const Q=Wy(t,R.path);if((R.size??0)>ya){x({path:R.path,kind:"large",size:R.size??0,url:Q});return}const V=hl(R.path);if(V!=="text"){x({path:R.path,kind:V,size:R.size??0,url:Q});return}x({path:R.path,kind:V,size:R.size??0,url:Q,content:""}),O(!0);const Ye=new AbortController;ae.current=Ye;try{const Ge=await fetch(Q,{signal:Ye.signal}),je=await Ge.text();if(!Ge.ok)throw new Error(je||d("errors.request",{status:Ge.status}));x(at=>at?.path===R.path?{...at,content:je}:at)}catch(Ge){dl(Ge)||(x(null),o(ce(Ge)))}finally{ae.current===Ye&&(ae.current=null,O(!1))}},xt=R=>{const Q=hl(R.path),V=e.maxCollaborativeFileSizeMB*1024*1024;(R.size??0)>ya||_s(R.path)&&(R.size??0)>V||Q!=="text"||!_s(R.path)?me(R):c(R.path)},vt=async()=>{if(!S)return;const R=he.trim();if(R){A("");try{if(!await r())return;const Q=await re(`/api/projects/${t}/path`,{method:"PATCH",body:JSON.stringify({source:S.path,destinationDirectory:Fe,destinationName:R})}),V=je=>je===S.path?Q.path:je.startsWith(`${S.path}/`)?`${Q.path}${je.slice(S.path.length)}`:je;c(je=>V(je)),u(je=>V(je)),l(je=>new Set([...je].map(V))),M(je=>je&&V(je));const[Ye,Ge]=await Promise.all([re(`/api/projects/${t}/files`),re(`/api/projects/${t}`)]);D(Ye.files),a(Ge.project),L(je=>new Set([...je,...hr(Q.path),Fe].filter(Boolean))),P(null),xe(""),ye("")}catch(Q){A(ce(Q))}}},it=async()=>{if(W){A("");try{if(s&&!await r())return;await re(`/api/projects/${t}/file?path=${encodeURIComponent(W.path)}`,{method:"DELETE"}),U(null)}catch(R){A(ce(R))}}};f.useEffect(()=>()=>{j.current?.abort(),ae.current?.abort()},[]),f.useEffect(()=>{ae.current?.abort(),ae.current=null,O(!1)},[n]);const ze=h.filter(R=>R.type==="directory"),Rt=h.filter(R=>hr(R.path).every(Q=>K.has(Q)));return{files:h,setFiles:D,loadFiles:ge,newFileOpen:p,setNewFileOpen:F,newFilePath:y,setNewFilePath:b,resourcePreview:E,setResourcePreview:x,resourcePreviewLoading:N,setResourcePreviewLoading:O,newFolderOpen:I,setNewFolderOpen:q,newFolderName:z,setNewFolderName:X,fileDialogError:G,setFileDialogError:A,selectedFolder:ie,setSelectedFolder:M,expandedFolders:K,setExpandedFolders:L,moveEntry:S,setMoveEntry:P,moveName:he,setMoveName:xe,moveDestination:Fe,setMoveDestination:ye,deleteEntry:W,setDeleteEntry:U,fileDragActive:ve,setFileDragActive:pe,uploadConflict:B,setUploadConflict:ue,uploadingFiles:De,directoryEntries:ze,visibleEntries:Rt,createFile:We,createFolder:Oe,uploadFiles:Ve,upload:ht,openFile:xt,movePath:vt,removePath:it}}function Yy({active:t,projectId:e,activeFile:n,content:s,dictionaryWords:r}){const[o,a]=f.useState([]),[c,u]=f.useState(""),[l,d]=f.useState(""),[h,D]=f.useState(0),[p,F]=f.useState(null),[y,b]=f.useState(null),[E,x]=f.useState(!1),[N,O]=f.useState(0),I=f.useRef(0),q=f.useRef(!1),z=f.useRef(!1),X=f.useRef(s),G=f.useRef(n),A=f.useRef(0);X.current=s,G.current=n,z.current=E,f.useEffect(()=>{a([]),u(""),d(""),F(null),b(null),x(!1)},[n,r]),f.useEffect(()=>{b(null),x(!1)},[e]),f.useEffect(()=>{D(L=>o.length?Math.min(L,o.length-1):0)},[o]),f.useEffect(()=>{const L=++I.current;if(!t||!n){a([]),u(""),d(""),F(null);return}if(y){a([]),u(""),d("");return}const S=s,P=n;let he=!1;const xe=window.setTimeout(()=>{b(null),(async()=>{try{const{lintLatex:Fe,isHarperLintSupersededError:ye}=await Wn(async()=>{const{lintLatex:U,isHarperLintSupersededError:ve}=await import("./spellCheck-BBnCnxmQ.js");return{lintLatex:U,isHarperLintSupersededError:ve}},__vite__mapDeps([5,1]));if(he||L!==I.current||X.current!==S||G.current!==P)return;let W;try{W=await Fe(e,P,S,r)}catch(U){if(ye(U))return;throw U}if(he||L!==I.current||X.current!==S||G.current!==P)return;q.current=!1,x(!1),a(W),u(S),d(P),D(0),F(null)}catch(Fe){if(he||L!==I.current||X.current!==S||G.current!==P)return;a([]),u(""),d(""),b(Fe instanceof Error?Fe.message:String(Fe));const ye=q.current;q.current=!1,x(ye?z.current:!1)}})()},700);return()=>{he=!0,window.clearTimeout(xe)}},[t,e,n,s,r,N,y]),f.useEffect(()=>{if(!y||!t)return;let L=!1;const S=()=>{L||(L=!0,q.current=!0,b(null),O(he=>he+1))},P=window.setTimeout(S,15e3);return window.addEventListener("online",S,{once:!0}),()=>{window.clearTimeout(P),window.removeEventListener("online",S)}},[y,t]);const ie=l===n&&c===s,M=f.useMemo(()=>ie?{total:o.length,unique:new Set(o.map(L=>`${L.kind}:${L.word.toLocaleLowerCase("en-US")}`)).size}:null,[ie,o]);return{issues:ie?o:[],jump:ie?p:null,index:h,summary:M,jumpToIssue:L=>{if(!o.length)return;const S=Math.max(0,Math.min(L,o.length-1)),P=o[S];D(S),F({from:P.from,to:P.to,nonce:++A.current})},error:E?null:y,nativeFallback:t&&!!y,retry:()=>{q.current=!1,b(null),x(!1),O(L=>L+1)},dismissError:()=>{q.current=!1,x(!0)}}}function fl(t){return t instanceof Error&&t.name==="AbortError"}function Xy({projectId:t,mainFile:e,activeFile:n,onActiveFile:s,onError:r,onShowPdf:o}){const[a,c]=f.useState(null),[u,l]=f.useState(null),[d,h]=f.useState(null),D=f.useRef(null),p=f.useRef(0),F=f.useRef(n),y=f.useRef(s),b=f.useRef(r),E=f.useRef(o),x=z=>z===e&&/\.tex$/i.test(z);F.current=n,y.current=s,b.current=r,E.current=o,f.useEffect(()=>(D.current?.abort(),D.current=null,c(null),l(null),h(null),()=>D.current?.abort()),[t,e]);const N=(z,X,G)=>{h({path:z,line:X,column:G,nonce:++p.current}),F.current!==z&&y.current(z)},O=async(z,X,G,A={})=>{if(!x(z))return;D.current?.abort();const ie=new AbortController;D.current=ie;try{const M=await re(`/api/projects/${t}/sync/pdf?mainFile=${encodeURIComponent(e)}&path=${encodeURIComponent(z)}&line=${X}&column=${G}`,{signal:ie.signal});if(D.current!==ie||!M)return;c({...M,nonce:++p.current}),E.current()}catch(M){!fl(M)&&!A.silent&&b.current(ce(M))}finally{D.current===ie&&(D.current=null)}},I=async(z,X,G)=>{if(!x(F.current))return;const A=F.current;D.current?.abort();const ie=new AbortController;D.current=ie;try{const M=await re(`/api/projects/${t}/sync/source?mainFile=${encodeURIComponent(e)}&page=${z}&x=${X}&y=${G}`,{signal:ie.signal});if(D.current!==ie||F.current!==A||!x(F.current))return;N(M.path,M.line,M.column)}catch(M){fl(M)||b.current(ce(M))}finally{D.current===ie&&(D.current=null)}};return{pdfTarget:a,pdfViewport:u,sourceJump:d,setPdfViewport:l,clearPdfViewport:()=>l(null),jumpToSource:N,syncSourceToPdf:O,syncPdfToSource:I,syncVisiblePdfToSource:()=>{u&&I(u.page,u.x,u.y)}}}function cf(t,e){return`texlite.workspaceLayout:${encodeURIComponent(t)}:${encodeURIComponent(e)}`}function ml(t,e){try{const n=window.localStorage.getItem(cf(t,e));if(n==="editor-pdf"||n==="editor-only"||n==="pdf-only")return n}catch{}return"editor-pdf"}function Jy(t,e){const[n,s]=f.useState(()=>ml(t,e));return f.useEffect(()=>{s(ml(t,e))},[t,e]),{workspaceLayout:n,setWorkspaceLayout:o=>{s(o);try{window.localStorage.setItem(cf(t,e),o)}catch{}}}}function Zy(t){const n=t.split(/(?<=\n)/).map(s=>{for(let r=0;r<s.length;r+=1){if(s[r]!=="%")continue;let o=0;for(let a=r-1;a>=0&&s[a]==="\\";a-=1)o+=1;if(o%2===0)return s.slice(0,r)+(s.endsWith(`
|
|
48
|
-
`)?`
|
|
49
|
-
`:"")}return s}).join("").replace(/\\verb\*?([^\s]).*?\1/g,"").replace(/\\begin\{(?:verbatim\*?|Verbatim|lstlisting|minted)\}(?:\[[^\]]*\])?[\s\S]*?\\end\{(?:verbatim\*?|Verbatim|lstlisting|minted)\}/g,"");return/\\documentclass\s*(?:\[[^\]]*\]\s*)?\{/.test(n)}function Qy({sessions:t,status:e}){const{t:n}=Qe(),[s,r]=f.useState(!1),o=Math.max(0,t.length-5),a=s&&o>0,c=a?t:t.slice(0,5);return f.useEffect(()=>{t.length<=5&&r(!1)},[t.length]),t.length<=1?null:i.jsxs("div",{className:`collaboration-presence collaboration-${e}`,title:n(`editor.collaboration.${e}`),children:[i.jsx("span",{className:"collaboration-status-dot","aria-label":n(`editor.collaboration.${e}`)}),i.jsxs("div",{className:"collaboration-avatars","aria-label":n("editor.collaboration.activeSessions",{count:t.length}),children:[c.map(u=>{const l=u.editing?n("editor.collaboration.editing"):n("editor.collaboration.viewing"),d=u.permission==="read"?n("common.readOnly"):n("common.readWrite"),h=n("editor.collaboration.sessionTooltip",{name:u.name,username:u.username,file:u.filePath||n("editor.collaboration.joining"),activity:l,permission:d});return i.jsxs("span",{className:`collaboration-avatar${u.editing?" editing":""}${u.local?" local":""}`,style:{"--session-color":u.color},title:h,"aria-label":h,tabIndex:0,children:[Uy(u.name,u.username),i.jsxs("span",{className:"collaboration-avatar-tooltip",role:"tooltip",children:[i.jsx("strong",{children:u.name}),i.jsxs("span",{children:["@",u.username]}),i.jsxs("small",{children:[u.filePath||n("editor.collaboration.joining")," · ",l," · ",d]})]})]},u.clientId)}),o>0&&i.jsx("button",{type:"button",className:"collaboration-avatar collaboration-avatar-overflow","aria-expanded":a,"aria-label":a?n("editor.collaboration.showFewerSessions"):n("editor.collaboration.showMoreSessions",{count:o}),title:a?n("editor.collaboration.showFewerSessions"):n("editor.collaboration.showMoreSessions",{count:o}),onClick:()=>r(u=>!u),children:a?"−":`+${o}`})]})]})}function e2({value:t,onChange:e}){const{t:n}=Qe(),[s,r]=f.useState(!1),o=f.useRef(null),a=[{value:"editor-pdf",icon:yu},{value:"editor-only",icon:S0},{value:"pdf-only",icon:j0}];return f.useEffect(()=>{if(!s)return;const c=l=>{o.current?.contains(l.target)||r(!1)},u=l=>{l.key==="Escape"&&r(!1)};return document.addEventListener("pointerdown",c),document.addEventListener("keydown",u),()=>{document.removeEventListener("pointerdown",c),document.removeEventListener("keydown",u)}},[s]),i.jsxs("div",{className:"layout-menu",ref:o,children:[i.jsxs("button",{type:"button",className:`layout-trigger${s?" active":""}`,"aria-haspopup":"menu","aria-expanded":s,title:n("editor.layout.current",{layout:n(`editor.layout.${t}.name`)}),onClick:()=>r(c=>!c),children:[i.jsx(yu,{size:15}),i.jsxs("span",{children:[i.jsx("small",{children:n("editor.layout.label")}),n(`editor.layout.${t}.name`)]}),i.jsx(ud,{size:13})]}),s&&i.jsxs("div",{className:"layout-popover",role:"menu","aria-label":n("editor.layout.label"),children:[i.jsx("div",{className:"layout-popover-title",children:n("editor.layout.choose")}),a.map(c=>{const u=c.icon,l=c.value===t;return i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":l,className:`layout-option${l?" selected":""}`,onClick:()=>{e(c.value),r(!1)},children:[i.jsx(u,{size:19}),i.jsxs("span",{children:[i.jsx("strong",{children:n(`editor.layout.${c.value}.name`)}),i.jsx("small",{children:n(`editor.layout.${c.value}.description`)})]}),l&&i.jsx(ss,{size:16})]},c.value)})]})]})}function t2({site:t,project:e,activeFile:n,saveStateLabel:s,editorPreferences:r,activeSessions:o,collaborationStatus:a,reconnectCollaboration:c,showEditor:u,filesCollapsed:l,toggleFilesPanel:d,workspaceLayout:h,changeWorkspaceLayout:D,onBack:p,onShare:F,showCitationLibrary:y,citationLibraryOpen:b,onCitationLibrary:E,onHistory:x,onGit:N,canManageGit:O,formatting:I,readOnly:q,collaborationSynced:z,canFormat:X,activeFormatLease:G,onFormatFile:A,onFormatSelection:ie,hasSelection:M,onAddComment:K,onToggleComments:L,commentsOpen:S,unresolvedCommentCount:P,hasActiveFile:he,onToggleSettings:xe,settingsOpen:Fe,compileBusy:ye,sharedCompiling:W,localCompiling:U,compileState:ve,onCompile:pe}){const{t:B}=Qe();return i.jsxs("header",{className:"editor-topbar",children:[i.jsx("button",{className:"back",title:B("editor.backToProjects"),"aria-label":B("editor.backToProjects"),onClick:p,children:i.jsx(Yo,{size:18})}),i.jsx("a",{className:"brand-link compact-brand-link",href:"/","aria-label":t.siteName,onClick:ue=>{ue.preventDefault(),p()},children:i.jsx(Ni,{siteName:t.siteName,compact:!0})}),i.jsxs("div",{className:"project-heading",children:[i.jsx("strong",{children:e.name}),i.jsxs("small",{children:[n," · ",s]})]}),r.vimMode&&i.jsxs("span",{className:"vim-status-badge",title:B("editor.vimOnHint"),children:[i.jsx(v0,{size:14}),B("editor.vimOn")]}),i.jsx(Qy,{sessions:o,status:a}),a==="disconnected"&&i.jsxs("div",{className:"collaboration-recovery",role:"status",children:[i.jsx("span",{children:B("editor.collaboration.disconnected")}),i.jsx("button",{type:"button",onClick:c,children:B("editor.collaboration.reconnect")})]}),i.jsxs("div",{className:"editor-actions",children:[u&&i.jsxs("button",{className:l?"":"active",onClick:d,children:[l?i.jsx(k0,{size:15}):i.jsx(pd,{size:15}),B("common.files")]}),i.jsx(e2,{value:h,onChange:D}),i.jsxs("button",{onClick:F,children:[i.jsx(Cr,{size:15}),B("projectSettings.share")]}),y&&i.jsxs("button",{className:b?"active":"",onClick:E,children:[i.jsx(As,{size:15}),B("citationLibrary.title")]}),i.jsxs("div",{className:"version-action",role:"group","aria-label":B("common.version"),children:[i.jsxs("div",{className:"version-action-label",children:[i.jsx(E0,{size:14}),i.jsx("span",{children:B("common.version")})]}),i.jsxs("div",{className:"version-action-options",children:[i.jsx("button",{type:"button",className:"version-action-history",title:B("history.title"),onClick:x,children:B("history.title")}),i.jsx("button",{type:"button",className:"version-action-git",title:B(O?"git.title":"git.ownerOnly"),disabled:!O,onClick:N,children:"Git"})]})]}),u&&e.permission!=="read"&&X&&i.jsxs("div",{className:"format-action",role:"group","aria-label":B("editor.format"),"aria-busy":I,children:[i.jsxs("div",{className:"format-action-label",children:[i.jsx(cd,{size:14}),i.jsx("span",{children:B("editor.format")})]}),i.jsxs("div",{className:"format-action-options",children:[i.jsx("button",{type:"button",className:"format-action-file",title:B("editor.formatFileHint"),onMouseDown:ue=>ue.preventDefault(),onClick:A,disabled:I||G||!z,children:B("editor.formatFile")}),i.jsx("button",{type:"button",className:"format-action-selected",title:B(M?"editor.formatSelection":"editor.formatSelectionHint"),onMouseDown:ue=>ue.preventDefault(),onClick:ie,disabled:I||G||!z||!M,children:B("editor.formatSelected")})]})]}),i.jsxs("div",{className:"comments-action",role:"group","aria-label":B("common.comments"),children:[i.jsxs("div",{className:"comments-action-label",children:[i.jsx(fd,{size:14}),i.jsx("span",{children:B("common.comments")})]}),i.jsxs("div",{className:"comments-action-options",children:[i.jsx("button",{type:"button",className:"comments-action-add",title:B("editor.addComment"),"aria-label":B("editor.addComment"),onMouseDown:ue=>ue.preventDefault(),onClick:K,disabled:!he,children:B("editor.commentsAdd")}),i.jsxs("button",{type:"button",className:`comments-action-all${S?" active":""}`,title:B("editor.commentsAll"),onClick:L,children:[B("editor.commentsAll")," ",P||""]})]})]}),i.jsxs("button",{className:Fe?"active":"",onClick:xe,children:[i.jsx(ta,{size:15}),B("common.settings")]}),i.jsxs("button",{className:"compile",title:W?B("editor.compilingBy",{name:ve?.requestedBy.name??""}):B("editor.compileShortcut"),onClick:pe,disabled:ye||I||q||!z,children:[ye?i.jsx(Et,{className:"spin",size:15}):i.jsx(L0,{size:15}),W?B("editor.compilingBy",{name:ve?.requestedBy.name??""}):U?B("editor.compiling"):B("editor.compile",{engine:e.engine})]})]})]})}function n2({project:t,filesPanel:e,files:n,visibleEntries:s,activeFile:r,activeMainFile:o,rootDocuments:a,selectedFolder:c,expandedFolders:u,fileDragActive:l,uploadingFiles:d,readOnly:h,editorFontSize:D,outline:p,sourceCursor:F,uploadInput:y,setSelectedFolder:b,setExpandedFolders:E,setMoveEntry:x,setMoveName:N,setMoveDestination:O,setDeleteEntry:I,setFileDialogError:q,setNewFolderName:z,setNewFolderOpen:X,setNewFilePath:G,setNewFileOpen:A,setQuickOpen:ie,setProjectSearchOpen:M,setFileDragActive:K,setFilesCollapsed:L,toggleFilesPanel:S,uploadFiles:P,upload:he,openFile:xe,jumpToSource:Fe,syncSourceToPdf:ye}){const{t:W}=Qe();return i.jsx(Bi,{id:"files",order:1,ref:e,defaultSize:16,minSize:12,maxSize:30,collapsible:!0,collapsedSize:0,onCollapse:()=>L(!0),onExpand:()=>L(!1),children:i.jsxs("aside",{className:"left-panel",children:[i.jsxs("section",{className:`files-panel${l?" drop-active":""}`,onDragEnter:U=>{U.dataTransfer.types.includes("Files")&&(U.preventDefault(),!h&&!d&&K(!0))},onDragOver:U=>{U.dataTransfer.types.includes("Files")&&(U.preventDefault(),U.dataTransfer.dropEffect=h||d?"none":"copy")},onDragLeave:U=>{U.currentTarget.contains(U.relatedTarget)||K(!1)},onDrop:U=>{U.preventDefault(),K(!1),!h&&!d&&P(Array.from(U.dataTransfer.files))},children:[i.jsxs("div",{className:"panel-title",children:[i.jsx("span",{children:W("common.files")}),i.jsxs("span",{className:"file-tools",children:[i.jsx("button",{"aria-label":W("navigation.quickOpen"),title:`${W("navigation.quickOpen")} (Ctrl/Cmd+P)`,onClick:()=>ie(!0),children:i.jsx(F0,{size:15})}),i.jsx("button",{"aria-label":W("navigation.projectSearch"),title:`${W("navigation.projectSearch")} (Ctrl/Cmd+Shift+F)`,onClick:()=>M(!0),children:i.jsx(gd,{size:15})}),!h&&i.jsxs(i.Fragment,{children:[i.jsx("button",{disabled:d,"aria-label":W("editor.uploadAttachment"),title:W("editor.uploadTo",{folder:c||W("editor.projectRoot")}),onClick:()=>y.current?.click(),children:i.jsx(hi,{size:15})}),i.jsx("button",{"aria-label":W("editor.newFolder"),title:W("editor.newFolder"),onClick:()=>{z(""),X(!0)},children:i.jsx(dd,{size:15})}),i.jsx("button",{"aria-label":W("editor.newFile"),title:W("editor.newFile"),onClick:()=>{G(c?`${c}/`:""),A(!0)},children:i.jsx(g0,{size:15})}),i.jsx("input",{ref:y,type:"file",multiple:!0,hidden:!0,onChange:U=>{he(U)}})]}),i.jsx("button",{"aria-label":W("editor.collapseFiles"),title:W("editor.collapseFiles"),onClick:S,children:i.jsx(pd,{size:15})})]})]}),l&&i.jsxs("div",{className:"file-drop-overlay",children:[i.jsx(hi,{size:24}),i.jsx("strong",{children:W("editor.dropFiles")}),i.jsx("span",{children:W("editor.uploadTo",{folder:c||W("editor.projectRoot")})})]}),i.jsxs("div",{className:"file-list",style:{fontSize:`${D}px`},children:[i.jsx("div",{className:`file-entry folder-entry root-entry${c===""?" selected":""}`,children:i.jsxs("button",{className:"file-entry-main",onClick:()=>b(""),children:[i.jsx(Zo,{size:15}),i.jsx("span",{children:W("editor.projectRoot")})]})}),s.map(U=>{const ve=U.path.split("/").length-1,pe=U.path.split("/").at(-1),B=u.has(U.path),ue=a.has(U.path),De=o===U.path,Me=U.path!==t.mainFile&&!t.mainFile.startsWith(`${U.path}/`);return U.type==="directory"?i.jsxs("div",{className:`file-entry folder-entry${c===U.path?" selected":""}`,style:{paddingLeft:`${ve*13+5}px`},children:[i.jsxs("button",{className:"file-entry-main",title:U.path,onClick:()=>{b(U.path),E(j=>{const ae=new Set(j);return ae.has(U.path)?ae.delete(U.path):ae.add(U.path),ae})},children:[B?i.jsx(ud,{size:13}):i.jsx(Ri,{size:13}),i.jsx(C0,{size:14}),i.jsx("span",{children:pe})]}),!h&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"file-entry-action",title:W("editor.move"),"aria-label":W("editor.move"),onClick:()=>{x(U),N(pe??""),O("")},children:i.jsx(Eu,{size:13})}),Me&&i.jsx("button",{className:"file-entry-action danger-text",title:W("editor.deletePath"),"aria-label":W("editor.deletePath"),onClick:()=>{I(U),q("")},children:i.jsx(sn,{size:13})})]})]},U.path):i.jsxs("div",{className:`file-entry${r===U.path?" active":""}${ue?" root-document":""}${De?" compile-target":""}`,style:{paddingLeft:`${ve*13+18}px`},children:[i.jsxs("button",{className:"file-entry-main",title:De?W("editor.currentMainDocument",{path:U.path}):ue?W("editor.mainDocumentCandidate",{path:U.path}):U.path,onClick:()=>xe(U),children:[ue?i.jsx(Ra,{size:13}):i.jsx(Ms,{size:13}),i.jsx("span",{children:pe}),De&&i.jsx("small",{children:W("editor.currentMainShort")})]}),!h&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"file-entry-action",title:W("editor.move"),"aria-label":W("editor.move"),onClick:()=>{x(U),N(pe??""),O("")},children:i.jsx(Eu,{size:13})}),Me&&i.jsx("button",{className:"file-entry-action danger-text",title:W("editor.deletePath"),"aria-label":W("editor.deletePath"),onClick:()=>{I(U),q("")},children:i.jsx(sn,{size:13})})]})]},U.path)})]})]}),i.jsxs("section",{className:"outline-panel",children:[i.jsx("div",{className:"panel-title",children:i.jsxs("span",{children:[i.jsx(A0,{size:14}),W("common.outline")]})}),i.jsxs("div",{className:"outline",children:[p.map((U,ve)=>i.jsxs("button",{className:`outline-item${r===U.path&&F.line===U.line?" current":""}`,title:`${U.path}:${U.line}`,onClick:()=>{Fe(U.path,U.line,1),ye(U.path,U.line,1)},children:[i.jsx("span",{className:"outline-guides","aria-hidden":!0,style:{width:`${U.level*12}px`}}),i.jsx("small",{children:U.path===r?U.line:U.path.split("/").at(-1)}),i.jsx("span",{className:"outline-title",children:U.title})]},`${U.path}-${U.line}-${ve}`)),p.length===0&&i.jsx("p",{className:"muted padded",children:W("editor.noOutline")})]})]})]})})}const s2=f.lazy(()=>Wn(()=>import("./LatexEditor-ChHQwJXZ.js"),__vite__mapDeps([6,1,7])).then(t=>({default:t.LatexEditor})));function r2({project:t,activeFile:e,activeMainFile:n,openTabs:s,content:r,loadedFile:o,readOnly:a,comments:c,focusComment:u,editorPreferences:l,completionIndex:d,nativeSpellCheck:h,spellCheckIssues:D,spellCheckJump:p,sourceJump:F,collaborativeText:y,collaborationAwareness:b,undoManager:E,editorNotice:x,activateTab:N,closeTab:O,handleTabKeyDown:I,updateEditorContent:q,setSelection:z,onCommentClick:X,onSpellCheckReplace:G,onCursor:A}){const{t:ie}=Qe();return i.jsx(Bi,{id:"source",order:2,defaultSize:42,minSize:22,children:i.jsxs("main",{className:"source-panel",children:[l.openFilesInTabs&&s.length>0&&i.jsx("div",{className:"editor-tabs-bar",role:"tablist","aria-label":ie("editor.openFiles"),children:i.jsx("div",{className:"editor-tabs-scroll",children:s.map((M,K)=>{const L=M===e,S=M===(n||t.mainFile),P=M.split("/").at(-1)||M;return i.jsxs("div",{className:`editor-tab-item${L?" active":""}`,role:"presentation",children:[i.jsxs("button",{id:`editor-tab-${encodeURIComponent(M)}`,type:"button",role:"tab","aria-selected":L,"aria-controls":"editor-source-content",tabIndex:L?0:-1,className:`editor-tab${L?" active":""}${S?" main-tab":""}`,onClick:()=>N(M),onKeyDown:he=>I(he,K),title:M,children:[i.jsx("span",{className:"editor-tab-icon",children:S?i.jsx(Ra,{size:13}):i.jsx(Ms,{size:13})}),i.jsx("span",{className:"editor-tab-title",children:P}),S&&i.jsx("small",{className:"editor-tab-badge",children:ie("editor.currentMainShort")})]}),i.jsx("button",{type:"button",className:"editor-tab-close",title:ie("common.close"),"aria-label":`${ie("common.close")} ${P}`,onClick:()=>O(M),children:i.jsx(qt,{size:12})})]},M)})})}),i.jsxs("div",{id:"editor-source-content",className:"editor-content-container",children:[i.jsx(f.Suspense,{fallback:i.jsxs("div",{className:"preview-empty",children:[i.jsx(Et,{className:"spin",size:22}),i.jsx("span",{children:ie("common.loading")})]}),children:i.jsx(s2,{value:r,filePath:e,readOnly:a,comments:c,focusComment:u,preferences:l,nativeSpellCheck:h,completionIndex:d,spellCheckIssues:D,spellCheckJump:p,jumpTo:o===e&&F?.path===e?F:null,searchRequest:0,collaboration:y?{text:y,awareness:b,undoManager:a?void 0:E}:void 0,onChange:q,onSelection:z,onCommentClick:X,onSpellCheckReplace:G,onCursor:A},e)}),x&&i.jsx("div",{className:"editor-centered-notice",role:"status","aria-live":"polite",children:x})]})]})})}function pl({diagnostics:t,files:e,empty:n,tone:s,onJump:r}){const{t:o}=Qe(),a=s==="error"?Oa:ln;return t.length?i.jsx("div",{className:`compile-diagnostic-list compile-${s}`,children:t.map((c,u)=>{const l=a2(c.file,e),d=!!(l&&c.line);return i.jsxs("button",{type:"button",disabled:!d,className:"compile-diagnostic-row",onClick:()=>{l&&c.line&&r(l,c.line,c.column??1)},children:[i.jsx(a,{size:15}),i.jsxs("span",{children:[i.jsx("strong",{children:c.message}),i.jsxs("small",{children:[c.phase,l?` · ${l}${c.line?`:${c.line}`:""}`:c.line?` · ${o("editor.lineNumber",{line:c.line})}`:""]})]})]},`${c.phase}-${c.file??""}-${c.line??0}-${u}`)})}):i.jsxs("div",{className:`compile-empty compile-${s}`,children:[i.jsx(a,{size:26}),i.jsx("span",{children:n})]})}function _o({lines:t,empty:e,tone:n="log"}){const s=n==="error"?Oa:n==="warning"?ln:ea;return t.length?i.jsx("pre",{className:`compile-output compile-${n}`,children:t.join(`
|
|
50
|
-
`)}):i.jsxs("div",{className:`compile-empty compile-${n}`,children:[i.jsx(s,{size:26}),i.jsx("span",{children:e})]})}function i2({projectId:t,mainFile:e,artifacts:n,preview:s,loading:r,onView:o}){const{t:a}=Qe(),c=u=>`/api/projects/${t}/compile/artifacts?mainFile=${encodeURIComponent(e)}&path=${encodeURIComponent(u)}&download=1`;return n.length?i.jsxs("div",{className:"artifact-browser",children:[i.jsx("div",{className:"artifact-list",children:n.map(u=>i.jsxs("div",{className:`artifact-row${s?.path===u.path?" active":""}`,children:[i.jsxs("button",{type:"button",disabled:!u.viewable,title:u.viewable?a("editor.viewArtifact"):a("editor.downloadToView"),onClick:()=>o(u),children:[i.jsx(Ms,{size:14}),i.jsxs("span",{children:[i.jsx("strong",{children:u.path}),i.jsx("small",{children:c2(u.size)})]})]}),i.jsx("a",{href:c(u.path),title:a("editor.downloadArtifact"),"aria-label":a("editor.downloadArtifact"),children:i.jsx(yr,{size:14})})]},u.path))}),i.jsx("div",{className:"artifact-preview",children:r?i.jsxs("div",{className:"compile-empty",children:[i.jsx(Et,{className:"spin",size:24}),i.jsx("span",{children:a("common.loading")})]}):s?i.jsxs(i.Fragment,{children:[i.jsxs("header",{children:[i.jsx("strong",{children:s.path}),i.jsxs("a",{href:c(s.path),children:[i.jsx(yr,{size:13}),a("projects.download")]})]}),i.jsx("pre",{children:s.content})]}):i.jsxs("div",{className:"compile-empty",children:[i.jsx(Ms,{size:24}),i.jsx("span",{children:a("editor.selectArtifact")})]})})]}):i.jsxs("div",{className:"compile-empty",children:[i.jsx(md,{size:26}),i.jsx("span",{children:a("editor.noArtifacts")})]})}function o2({mainFile:t,disabled:e,cleaning:n,onCleanCache:s,onCleanArtifacts:r}){const{t:o}=Qe();return i.jsxs("div",{className:"compile-clean-panel",children:[i.jsxs("div",{className:"compile-clean-intro",children:[i.jsx(ln,{size:28}),i.jsxs("div",{children:[i.jsx("strong",{children:o("editor.cleanTitle")}),i.jsx("p",{children:o("editor.cleanDescription",{file:t})})]})]}),i.jsxs("div",{className:"compile-clean-actions",children:[i.jsxs("article",{children:[i.jsx("div",{className:"compile-clean-action-icon",children:i.jsx(Xo,{size:19})}),i.jsxs("div",{children:[i.jsx("strong",{children:o("editor.cleanCache")}),i.jsx("p",{children:o("editor.cleanCacheDescription")}),i.jsxs("button",{type:"button",disabled:e||n,onClick:s,children:[n?i.jsx(Et,{className:"spin",size:14}):i.jsx(Xo,{size:14}),o("editor.cleanCache")]})]})]}),i.jsxs("article",{className:"danger",children:[i.jsx("div",{className:"compile-clean-action-icon",children:i.jsx(sn,{size:19})}),i.jsxs("div",{children:[i.jsx("strong",{children:o("editor.cleanArtifacts")}),i.jsx("p",{children:o("editor.cleanArtifactsDescription")}),i.jsxs("button",{type:"button",className:"danger",disabled:e||n,onClick:r,children:[n?i.jsx(Et,{className:"spin",size:14}):i.jsx(sn,{size:14}),o("editor.cleanArtifacts")]})]})]})]})]})}function a2(t,e){if(!t)return null;const n=e.filter(c=>c.type==="file").map(c=>c.path),s=t.replaceAll("\\","/").replace(/^\.\//,"");if(n.includes(s))return s;const r=n.filter(c=>s.endsWith(`/${c}`));if(r.length===1)return r[0];const o=s.split("/").at(-1),a=n.filter(c=>c.split("/").at(-1)===o);return a.length===1?a[0]:null}function c2(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}const u2=f.lazy(()=>Li().then(t=>({default:t.PdfPreview})));function l2({projectId:t,activeMainFile:e,previewTab:n,diagnosticTab:s,pdfUrl:r,pdfLoadingMode:o,pdfLoading:a,pdfCompiledAt:c,pdfCompiledLabel:u,pdfTargetLabel:l,pdfDownloadUrl:d,pdfTarget:h,pdfViewport:D,activeFile:p,sourceCursor:F,compileBusy:y,compileLog:b,compileDiagnostics:E,compileMessages:x,artifacts:N,artifactPreview:O,artifactLoading:I,cleaning:q,readOnly:z,collaborationSynced:X,workspaceLayout:G,showSyncResize:A,diagnosticCount:ie,selectPreviewTab:M,changeWorkspaceLayout:K,onSetNotice:L,onSetPdfViewport:S,syncVisiblePdfToSource:P,syncSourceToPdf:he,syncPdfToSource:xe,canSyncWithPdf:Fe,files:ye,jumpToSource:W,onSetCleanMode:U,cleanCompile:ve,viewArtifact:pe}){const{t:B}=Qe();return i.jsxs(i.Fragment,{children:[A&&i.jsxs(Ca,{className:"resize-handle sync-resize-handle",children:[i.jsx(hd,{className:"resize-grip",size:12}),i.jsxs("span",{className:"sync-direction-buttons",onPointerDown:ue=>ue.stopPropagation(),children:[i.jsx("button",{disabled:!D||!Fe,title:B(Fe?"editor.showInSource":"editor.syncTexOnlyForMain"),"aria-label":B("editor.showInSource"),onClick:()=>{if(!Fe){L(B("editor.syncTexOnlyForMain"));return}P()},children:i.jsx("span",{"aria-hidden":!0,children:"←"})}),i.jsx("button",{disabled:!p||!r||!Fe,title:B(Fe?"editor.showInPdf":"editor.syncTexOnlyForMain"),"aria-label":B("editor.showInPdf"),onClick:()=>{if(!Fe){L(B("editor.syncTexOnlyForMain"));return}he(p,F.line,F.column)},children:i.jsx("span",{"aria-hidden":!0,children:"→"})})]})]}),i.jsx(Bi,{id:"preview",order:3,defaultSize:42,minSize:22,children:i.jsxs("section",{className:"preview-panel",children:[i.jsxs("div",{className:"preview-tabs",children:[i.jsxs("div",{className:"preview-tab-list",role:"tablist","aria-label":B("editor.outputTabs"),children:[i.jsxs("button",{role:"tab","aria-selected":n==="pdf",className:`pdf-tab${n==="pdf"?" active":""}`,onClick:()=>M("pdf"),title:c?B("editor.pdfCompiledAtFor",{file:e,time:new Date(c).toLocaleString(Ke.resolvedLanguage)}):B("editor.currentMainDocument",{path:e}),children:[i.jsx(Ms,{size:16}),i.jsxs("span",{className:"pdf-tab-label",children:["PDF · ",l,u&&i.jsx("small",{children:u})]})]}),i.jsxs("button",{role:"tab","aria-selected":n==="diagnostics",className:`diagnostics-tab${n==="diagnostics"?" active":""}`,onClick:()=>M("diagnostics"),children:[i.jsx(ea,{size:14}),B("editor.outputTabs"),i.jsx("span",{children:ie})]})]}),d&&i.jsxs("a",{className:"pdf-download-top",href:d,download:!0,title:B("editor.downloadPdf"),"aria-label":B("editor.downloadPdf"),children:[i.jsx(yr,{size:15}),i.jsx("span",{children:B("editor.downloadPdf")})]})]}),n==="diagnostics"&&i.jsxs("div",{className:"preview-subtabs",role:"tablist","aria-label":B("editor.outputTabs"),children:[i.jsxs("button",{role:"tab","aria-selected":s==="log",className:s==="log"?"active":"",onClick:()=>M("log"),children:[i.jsx(ea,{size:13}),B("editor.log")]}),i.jsxs("button",{role:"tab","aria-selected":s==="warnings",className:s==="warnings"?"active":"",onClick:()=>M("warnings"),children:[i.jsx(ln,{size:13}),B("editor.warnings"),i.jsx("span",{children:x.warnings.length})]}),i.jsxs("button",{role:"tab","aria-selected":s==="errors",className:s==="errors"?"active":"",onClick:()=>M("errors"),children:[i.jsx(Oa,{size:13}),B("editor.errors"),i.jsx("span",{children:x.errors.length})]}),i.jsxs("button",{role:"tab","aria-selected":s==="artifacts",className:s==="artifacts"?"active":"",onClick:()=>M("artifacts"),children:[i.jsx(md,{size:13}),B("editor.artifacts"),i.jsx("span",{children:N.length})]}),i.jsxs("button",{role:"tab","aria-selected":s==="clean",className:s==="clean"?"active":"",onClick:()=>M("clean"),children:[i.jsx(Xo,{size:13}),B("editor.clean")]})]}),i.jsxs("div",{className:`preview-content preview-${n} ${n==="diagnostics"?`preview-${s}`:""}`,children:[n==="pdf"&&(r?i.jsx(f.Suspense,{fallback:i.jsxs("div",{className:"pdf-loading-state",role:"status","aria-live":"polite",children:[i.jsx(Et,{className:"spin",size:24}),i.jsx("span",{children:B("editor.loadingPdf")})]}),children:i.jsx(u2,{url:r,loadingMode:o,target:h,compiling:y,onViewportLocation:(ue,De,Me)=>S({page:ue,x:De,y:Me}),onDoubleClickLocation:(ue,De,Me)=>{if(S({page:ue,x:De,y:Me}),!Fe){L(B("editor.syncTexOnlyForMain"));return}xe(ue,De,Me)}})}):a?i.jsxs("div",{className:"pdf-loading-state",role:"status","aria-live":"polite",children:[i.jsx(Et,{className:"spin",size:24}),i.jsx("span",{children:B("editor.loadingPdf")})]}):i.jsxs("div",{className:"preview-empty",children:[i.jsx(Ms,{size:28}),i.jsx("strong",{children:B("editor.preview")}),i.jsx("span",{children:B("editor.previewHint")})]})),n==="diagnostics"&&s==="log"&&i.jsx(_o,{lines:b?b.split(`
|
|
51
|
-
`):[],empty:B(y?"editor.compiling":"editor.noLog")}),n==="diagnostics"&&s==="warnings"&&(E?i.jsx(pl,{tone:"warning",diagnostics:E.warnings,files:ye,empty:B("editor.noWarnings"),onJump:(ue,De,Me)=>{G==="pdf-only"&&K("editor-pdf"),W(ue,De,Me)}}):i.jsx(_o,{tone:"warning",lines:x.warnings,empty:B("editor.noWarnings")})),n==="diagnostics"&&s==="errors"&&(E?i.jsx(pl,{tone:"error",diagnostics:E.errors,files:ye,empty:B("editor.noErrors"),onJump:(ue,De,Me)=>{G==="pdf-only"&&K("editor-pdf"),W(ue,De,Me)}}):i.jsx(_o,{tone:"error",lines:x.errors,empty:B("editor.noErrors")})),n==="diagnostics"&&s==="artifacts"&&i.jsx(i2,{projectId:t,mainFile:e,artifacts:N,preview:O,loading:I,onView:ue=>{pe(ue)}}),n==="diagnostics"&&s==="clean"&&i.jsx(o2,{mainFile:e,disabled:z||!X||y,cleaning:q,onCleanCache:()=>U("cache"),onCleanArtifacts:()=>U("artifacts")})]})]})})]})}function d2({comment:t,currentUserId:e,onFocus:n,onToggle:s,onReply:r,onEdit:o,onDelete:a,onEditReply:c,onDeleteReply:u}){const{t:l}=Qe(),[d,h]=f.useState(!1),[D,p]=f.useState(""),[F,y]=f.useState(!1),[b,E]=f.useState(t.content),[x,N]=f.useState(!1),[O,I]=f.useState(null),[q,z]=f.useState(""),[X,G]=f.useState(null),A=async S=>{S.preventDefault(),D.trim()&&await r(D)&&(p(""),h(!1))},ie=async S=>{S.preventDefault(),b.trim()&&await o(b)&&y(!1)},M=async S=>{S.preventDefault(),!(!O||!q.trim())&&await c(O,q)&&I(null)},K=t.authorUsername,L=S=>new Date(S).toLocaleString(Ke.resolvedLanguage);return i.jsxs(i.Fragment,{children:[i.jsxs("article",{className:`comment-thread${t.resolved?" resolved":""}${t.orphaned?" orphaned":""}`,onClick:()=>{window.getSelection()?.toString()||n()},children:[i.jsxs("header",{className:"comment-header",children:[i.jsxs("span",{className:"comment-author",children:[i.jsx("strong",{children:t.authorDisplayName??K??l("editor.deletedUser")}),K&&i.jsxs("small",{children:["@",K]})]}),i.jsxs("span",{className:"comment-times",children:[i.jsx("time",{dateTime:t.createdAt,title:new Date(t.createdAt).toISOString(),children:L(t.createdAt)}),t.editedAt&&i.jsx("small",{children:l("editor.editedAt",{time:L(t.editedAt)})})]})]}),i.jsx("div",{className:"comment-location",children:t.orphaned?l("editor.orphaned"):l("editor.line",{line:t.startLine})}),t.selectedText&&i.jsx("blockquote",{className:"comment-selected-text",children:t.selectedText}),F?i.jsxs("form",{className:"comment-reply-form comment-edit-form",onSubmit:S=>{ie(S)},onClick:S=>S.stopPropagation(),children:[i.jsx("textarea",{autoFocus:!0,rows:4,value:b,onChange:S=>E(S.target.value)}),i.jsxs("div",{children:[i.jsx("button",{type:"button",onClick:()=>y(!1),children:l("common.cancel")}),i.jsxs("button",{className:"primary",type:"submit",disabled:!b.trim(),children:[i.jsx(di,{size:13}),l("editor.saveChanges")]})]})]}):i.jsx("p",{className:"comment-content",children:t.content}),t.replies.length>0&&i.jsx("div",{className:"comment-replies",children:t.replies.map(S=>i.jsxs("div",{className:"comment-reply",children:[i.jsxs("header",{children:[i.jsxs("span",{className:"comment-author",children:[i.jsx("strong",{children:S.authorDisplayName??S.authorUsername??l("editor.deletedUser")}),S.authorUsername&&i.jsxs("small",{children:["@",S.authorUsername]})]}),i.jsxs("span",{className:"comment-times",children:[i.jsx("time",{dateTime:S.createdAt,title:new Date(S.createdAt).toISOString(),children:L(S.createdAt)}),S.editedAt&&i.jsx("small",{children:l("editor.editedAt",{time:L(S.editedAt)})})]})]}),O===S.id?i.jsxs("form",{className:"comment-reply-form comment-edit-form",onSubmit:P=>{M(P)},onClick:P=>P.stopPropagation(),children:[i.jsx("textarea",{autoFocus:!0,rows:3,value:q,onChange:P=>z(P.target.value)}),i.jsxs("div",{children:[i.jsx("button",{type:"button",onClick:()=>I(null),children:l("common.cancel")}),i.jsxs("button",{className:"primary",type:"submit",disabled:!q.trim(),children:[i.jsx(di,{size:13}),l("editor.saveChanges")]})]})]}):i.jsx("p",{className:"comment-content",children:S.content}),S.authorId===e&&O!==S.id&&i.jsxs("div",{className:"comment-owner-actions",children:[i.jsx("button",{title:l("editor.editReply"),"aria-label":l("editor.editReply"),onClick:P=>{P.stopPropagation(),I(S.id),z(S.content)},children:i.jsx(Qo,{size:12})}),i.jsx("button",{className:"danger-text",title:l("editor.deleteReply"),"aria-label":l("editor.deleteReply"),onClick:P=>{P.stopPropagation(),G(S.id)},children:i.jsx(sn,{size:12})})]})]},S.id))}),i.jsxs("div",{className:"comment-actions",children:[i.jsxs("button",{className:"resolve",onClick:S=>{S.stopPropagation(),s()},children:[t.resolved?i.jsx(R0,{size:13}):i.jsx(ld,{size:13}),t.resolved?l("editor.reopen"):l("editor.resolve")]}),i.jsxs("button",{className:"reply-action",onClick:S=>{S.stopPropagation(),h(P=>!P)},children:[i.jsx(N0,{size:13}),l("editor.reply")]}),t.authorId===e&&!F&&i.jsxs("span",{className:"comment-owner-actions",children:[i.jsx("button",{title:l("editor.editComment"),"aria-label":l("editor.editComment"),onClick:S=>{S.stopPropagation(),E(t.content),y(!0)},children:i.jsx(Qo,{size:13})}),i.jsx("button",{className:"danger-text",title:l("editor.deleteComment"),"aria-label":l("editor.deleteComment"),onClick:S=>{S.stopPropagation(),N(!0)},children:i.jsx(sn,{size:13})})]})]}),d&&i.jsxs("form",{className:"comment-reply-form",onSubmit:S=>{A(S)},onClick:S=>S.stopPropagation(),children:[i.jsx("textarea",{autoFocus:!0,rows:3,value:D,placeholder:l("editor.replyPlaceholder"),onChange:S=>p(S.target.value)}),i.jsxs("div",{children:[i.jsx("button",{type:"button",onClick:()=>{h(!1),p("")},children:l("common.cancel")}),i.jsxs("button",{className:"primary",type:"submit",disabled:!D.trim(),children:[i.jsx(O0,{size:13}),l("editor.sendReply")]})]})]})]}),i.jsx(ns,{open:x,title:l("editor.deleteCommentTitle"),description:l("editor.deleteCommentDescription",{count:t.replies.length}),confirmLabel:l("common.delete"),danger:!0,onCancel:()=>N(!1),onConfirm:()=>{a().then(S=>{S&&N(!1)})}}),i.jsx(ns,{open:!!X,title:l("editor.deleteReplyTitle"),description:l("editor.deleteReplyDescription"),confirmLabel:l("common.delete"),danger:!0,onCancel:()=>G(null),onConfirm:()=>{X&&u(X).then(S=>{S&&G(null)})}})]})}function h2({open:t,onOpenChange:e,project:n,projectId:s}){const{t:r}=Qe(),[o,a]=f.useState([]),[c,u]=f.useState([]),[l,d]=f.useState(""),[h,D]=f.useState("read"),[p,F]=f.useState(null),[y,b]=f.useState(""),E=n.permission==="owner",x=async()=>{try{const[z,X]=await Promise.all([re(`/api/projects/${s}/members`),re("/api/users")]);a(z.members),u(X.users.filter(G=>G.id!==n.ownerId))}catch(z){b(ce(z))}};f.useEffect(()=>{t&&x()},[t,s]);const N=async()=>{if(l)try{await re(`/api/projects/${s}/members/${l}`,{method:"PUT",body:JSON.stringify({permission:h})}),d(""),D("read"),await x()}catch(z){b(ce(z))}},O=async(z,X)=>{try{await re(`/api/projects/${s}/members/${z.id}`,{method:"PUT",body:JSON.stringify({permission:X})}),await x()}catch(G){b(ce(G))}},I=async()=>{if(p)try{await re(`/api/projects/${s}/members/${p.id}`,{method:"DELETE"}),F(null),await x()}catch(z){b(ce(z))}},q=c.filter(z=>!o.some(X=>X.id===z.id));return i.jsxs(i.Fragment,{children:[i.jsx(dt,{open:t,wide:!0,title:r("projectSettings.share"),description:r("projectSettings.shareDescription"),onOpenChange:e,footer:i.jsx("button",{onClick:()=>e(!1),children:r("common.close")}),children:i.jsxs("div",{className:"share-dialog",children:[y&&i.jsx("p",{className:"error",children:y}),i.jsxs("div",{className:"share-owner",children:[i.jsx(Cr,{size:17}),i.jsxs("span",{children:[i.jsx("small",{children:r("projects.owner")}),i.jsx("strong",{children:n.ownerDisplayName??n.ownerUsername})]})]}),E&&i.jsxs("div",{className:"share-add",children:[i.jsxs("label",{className:"form-field",children:[r("common.user"),i.jsxs("select",{value:l,onChange:z=>d(z.target.value),children:[i.jsx("option",{value:"",children:r("projectSettings.chooseUser")}),q.map(z=>i.jsx("option",{value:z.id,children:z.displayName??z.username},z.id))]})]}),i.jsxs("label",{className:"form-field",children:[r("common.permission"),i.jsxs("select",{value:h,onChange:z=>D(z.target.value),children:[i.jsx("option",{value:"read",children:r("common.readOnly")}),i.jsx("option",{value:"edit",children:r("common.readWrite")})]})]}),i.jsxs("button",{className:"primary icon-button",disabled:!l,onClick:()=>{N()},children:[i.jsx(sa,{size:15}),r("projectSettings.addMember")]})]}),i.jsxs("div",{className:"shared-members-heading",children:[i.jsx("strong",{children:r("projectSettings.members")}),i.jsx("span",{children:o.length})]}),i.jsxs("div",{className:"shared-members",children:[o.map(z=>i.jsxs("div",{className:"shared-member",children:[i.jsxs("span",{className:"member-identity",children:[i.jsx("span",{className:"member-avatar",children:(z.displayName??z.username).slice(0,1).toLocaleUpperCase()}),i.jsxs("span",{children:[i.jsx("strong",{children:z.displayName??z.username}),i.jsxs("small",{children:["@",z.username]})]})]}),i.jsxs("span",{className:"member-controls",children:[i.jsxs("select",{"aria-label":r("common.permission"),disabled:!E,value:z.permission,onChange:X=>{O(z,X.target.value)},children:[i.jsx("option",{value:"read",children:r("common.readOnly")}),i.jsx("option",{value:"edit",children:r("common.readWrite")})]}),E&&i.jsx("button",{className:"icon-only danger-text",title:r("common.remove"),"aria-label":r("common.remove"),onClick:()=>F(z),children:i.jsx(sn,{size:15})})]})]},z.id)),o.length===0&&i.jsxs("div",{className:"share-empty",children:[i.jsx(Cr,{size:24}),i.jsx("span",{children:r("projectSettings.noMembers")})]})]})]})}),i.jsx(ns,{open:!!p,title:r("projectSettings.removeTitle"),description:r("projectSettings.removeDescription",{username:p?.username??""}),confirmLabel:r("common.remove"),danger:!0,onCancel:()=>F(null),onConfirm:()=>{I()}})]})}const f2=f.lazy(()=>Wn(()=>import("./GitDialog-W3hLOWrF.js"),__vite__mapDeps([8,1,3])).then(t=>({default:t.GitDialog}))),m2=f.lazy(()=>Wn(()=>import("./HistoryDialog-7ADYJcGi.js"),__vite__mapDeps([9,1])).then(t=>({default:t.HistoryDialog}))),p2=f.lazy(()=>Wn(()=>import("./ProjectNavigationDialogs-CzFhIw6B.js"),__vite__mapDeps([10,1])).then(t=>({default:t.ProjectSearchDialog}))),D2=f.lazy(()=>Wn(()=>import("./ProjectNavigationDialogs-CzFhIw6B.js"),__vite__mapDeps([10,1])).then(t=>({default:t.QuickOpenDialog})));function g2({user:t,project:e,projectId:n,activeFile:s,content:r,maxCitationBibtexBytes:o,files:a,directoryEntries:c,readOnly:u,workspaceLayout:l,changeWorkspaceLayout:d,resourcePreview:h,resourcePreviewLoading:D,setResourcePreview:p,setResourcePreviewLoading:F,uploadConflict:y,setUploadConflict:b,uploadFiles:E,cleanMode:x,setCleanMode:N,cleanCompile:O,newFileOpen:I,setNewFileOpen:q,newFilePath:z,setNewFilePath:X,newFolderOpen:G,setNewFolderOpen:A,newFolderName:ie,setNewFolderName:M,selectedFolder:K,fileDialogError:L,setFileDialogError:S,createFile:P,createFolder:he,moveEntry:xe,setMoveEntry:Fe,moveName:ye,setMoveName:W,moveDestination:U,setMoveDestination:ve,movePath:pe,deleteEntry:B,setDeleteEntry:ue,deleteActiveSessions:De,removePath:Me,commentOpen:j,setCommentOpen:ae,selection:ge,commentText:We,setCommentText:Oe,addComment:Ve,shareOpen:ht,setShareOpen:me,citationLibraryOpen:xt,setCitationLibraryOpen:vt,insertCitationAtCursor:it,quickOpen:ze,setQuickOpen:Rt,projectSearchOpen:R,setProjectSearchOpen:Q,openFile:V,jumpToSource:Ye,historyOpen:Ge,setHistoryOpen:je,gitOpen:at,setGitOpen:tt,save:ct,permissionDowngrade:de,permissionDowngradeBusy:ft,dismissPermissionDowngrade:Ce,discardPermissionDraft:Dt}){const{t:ee}=Qe();return i.jsxs(i.Fragment,{children:[de&&i.jsx(dt,{open:!0,title:ee("editor.collaboration.permissionDowngradeTitle"),description:de.localDraftReady&&de.otherTabDraft?ee("editor.collaboration.permissionDowngradeMultipleDrafts"):de.otherTabDraft?ee("editor.collaboration.permissionDowngradeOtherTab"):de.localDraftReady?ee("editor.collaboration.permissionDowngradeDescription",{previous:ee("common.readWrite")}):ee("editor.collaboration.permissionDowngradeNoDraft"),onOpenChange:oe=>{!oe&&!ft&&Ce()},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",disabled:ft,onClick:Ce,children:de.localDraftReady?ee("editor.collaboration.permissionDowngradeKeep"):ee("common.close")}),!de.otherTabDraft&&i.jsxs("button",{type:"button",className:"danger",disabled:ft,onClick:()=>{Dt()},children:[ft?i.jsx(Et,{className:"spin",size:14}):de.localDraftReady?i.jsx(sn,{size:14}):i.jsx(Dd,{size:14}),de.localDraftReady?ee("editor.collaboration.permissionDowngradeDiscard"):ee("editor.collaboration.permissionDowngradeReload")]})]}),children:i.jsx("div",{})}),i.jsxs(dt,{open:!!h,extraWide:h?.kind==="image"||h?.kind==="pdf"||h?.kind==="text",title:h?.path??"",description:h?.kind==="large"?ee("editor.resourceTooLarge",{size:F2(h.size),limit:`${ya/1024/1024} MB`}):ee(`editor.resourcePreview.${h?.kind??"text"}`),onOpenChange:oe=>{oe||(p(null),F(!1))},footer:h&&i.jsxs("a",{className:"primary resource-download",href:`${h.url}&download=1`,download:!0,children:[i.jsx(yr,{size:14}),ee("editor.downloadResource")]}),children:[h?.kind==="large"&&i.jsxs("div",{className:"resource-preview-message",children:[i.jsx(Jo,{size:34}),i.jsx("strong",{children:ee("editor.resourceTooLargeTitle")}),i.jsx("span",{children:ee("editor.resourceTooLargeDescription")})]}),h?.kind==="unsupported"&&i.jsxs("div",{className:"resource-preview-message",children:[i.jsx(Jo,{size:34}),i.jsx("strong",{children:ee("editor.resourceUnsupportedTitle")}),i.jsx("span",{children:ee("editor.resourceUnsupportedDescription")})]}),h?.kind==="image"&&i.jsx("div",{className:"resource-image-wrap",children:i.jsx("img",{className:"resource-image",src:h.url,alt:h.path})}),h?.kind==="pdf"&&i.jsx("iframe",{className:"resource-pdf",src:h.url,title:h.path}),h?.kind==="text"&&(D?i.jsxs("div",{className:"resource-preview-message",children:[i.jsx(Et,{className:"spin",size:24}),i.jsx("span",{children:ee("common.loading")})]}):i.jsx("pre",{className:"resource-text",children:h.content}))]}),i.jsx(ns,{open:!!y,title:ee("editor.uploadOverwriteTitle"),description:ee("editor.uploadOverwriteDescription",{files:y?.collisions.join(", ")??""}),confirmLabel:ee("editor.uploadOverwrite"),danger:!0,onCancel:()=>b(null),onConfirm:()=>{const oe=y;b(null),oe&&E(oe.files,new Set(oe.collisions),oe.directory)}}),i.jsx(ns,{open:!!x,title:ee(x==="cache"?"editor.cleanCacheConfirmTitle":"editor.cleanArtifactsConfirmTitle"),description:ee(x==="cache"?"editor.cleanCacheConfirmDescription":"editor.cleanArtifactsConfirmDescription"),confirmLabel:ee("editor.cleanConfirm"),danger:x==="artifacts",onCancel:()=>N(null),onConfirm:()=>{const oe=x;N(null),oe&&O(oe)}}),i.jsx(dt,{open:I,title:ee("editor.newFile"),description:ee("editor.newFileDescription"),onOpenChange:oe=>{q(oe),oe||S("")},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>q(!1),children:ee("common.cancel")}),i.jsx("button",{className:"primary",onClick:()=>{P()},children:ee("common.create")})]}),children:i.jsxs(i.Fragment,{children:[L&&i.jsx("p",{className:"error dialog-error",children:L}),i.jsxs("label",{className:"form-field",children:[ee("editor.filePath"),i.jsx("input",{autoFocus:!0,value:z,onChange:oe=>X(oe.target.value)})]})]})}),i.jsx(dt,{open:G,title:ee("editor.newFolder"),description:ee("editor.folderDestination",{folder:K||ee("editor.projectRoot")}),onOpenChange:oe=>{A(oe),oe||S("")},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>A(!1),children:ee("common.cancel")}),i.jsx("button",{className:"primary",onClick:()=>{he()},children:ee("common.create")})]}),children:i.jsxs(i.Fragment,{children:[L&&i.jsx("p",{className:"error dialog-error",children:L}),i.jsxs("label",{className:"form-field",children:[ee("editor.folderName"),i.jsx("input",{autoFocus:!0,value:ie,onChange:oe=>M(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&he()}})]})]})}),i.jsx(dt,{open:!!xe,title:ee("editor.moveTitle",{name:xe?.path.split("/").at(-1)??""}),description:ee("editor.moveDescription"),onOpenChange:oe=>{oe||(Fe(null),W(""),S(""))},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>Fe(null),children:ee("common.cancel")}),i.jsx("button",{className:"primary",disabled:!ye.trim(),onClick:()=>{pe()},children:ee("editor.moveApply")})]}),children:i.jsxs(i.Fragment,{children:[L&&i.jsx("p",{className:"error dialog-error",children:L}),i.jsxs("label",{className:"form-field",children:[ee("editor.pathName"),i.jsx("input",{autoFocus:!0,value:ye,onChange:oe=>W(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&pe()}})]}),i.jsxs("label",{className:"form-field",children:[ee("editor.destinationFolder"),i.jsxs("select",{value:U,onChange:oe=>ve(oe.target.value),children:[i.jsx("option",{value:"",children:ee("editor.projectRoot")}),c.filter(oe=>xe?.type!=="directory"||oe.path!==xe.path&&!oe.path.startsWith(`${xe.path}/`)).map(oe=>i.jsx("option",{value:oe.path,children:oe.path},oe.path))]})]})]})}),i.jsx(dt,{open:!!B,title:ee("editor.deletePathTitle",{name:B?.path.split("/").at(-1)??""}),description:De.length?ee("editor.deletePathActiveDescription",{path:B?.path??"",users:[...new Set(De.map(oe=>oe.name))].join(", ")}):ee("editor.deletePathDescription",{path:B?.path??""}),onOpenChange:oe=>{oe||(ue(null),S(""))},footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>ue(null),children:ee("common.cancel")}),i.jsx("button",{className:"danger",onClick:()=>{Me()},children:ee("common.delete")})]}),children:i.jsxs(i.Fragment,{children:[L&&i.jsx("p",{className:"error dialog-error",children:L}),De.length>0&&i.jsxs("p",{className:"warning",children:[i.jsx(ln,{size:15}),ee("editor.deletePathWillClose")]})]})}),i.jsxs(dt,{open:j,title:ee("editor.addComment"),description:ge.selectedText?ee("editor.commentDescription",{count:ge.endOffset-ge.startOffset}):ee("editor.pointComment"),onOpenChange:ae,footer:i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>ae(!1),children:ee("common.cancel")}),i.jsx("button",{className:"primary",onClick:()=>{Ve()},children:ee("editor.addComment")})]}),children:[i.jsxs("label",{className:"form-field",children:[ee("editor.commentContent"),i.jsx("textarea",{autoFocus:!0,rows:5,value:We,onChange:oe=>Oe(oe.target.value)})]}),ge.selectedText&&i.jsx("blockquote",{className:"selection-preview",children:ge.selectedText})]}),i.jsx(h2,{open:ht,onOpenChange:me,project:e,projectId:n}),i.jsx(wd,{open:xt,onOpenChange:vt,currentFile:s,currentSource:r,readOnly:u,currentUserId:t.id,maxBibtexBytes:o,onInsert:it}),ze&&i.jsx(f.Suspense,{fallback:null,children:i.jsx(D2,{open:!0,files:a,onOpenChange:Rt,onOpenFile:oe=>{const et=a.find(gt=>gt.path===oe);et&&V(et)}})}),R&&i.jsx(f.Suspense,{fallback:null,children:i.jsx(p2,{open:!0,project:e,onOpenChange:Q,onJump:(oe,et,gt)=>{l==="pdf-only"&&d("editor-pdf"),Ye(oe,et,gt)}})}),Ge&&i.jsx(f.Suspense,{fallback:null,children:i.jsx(m2,{open:!0,onOpenChange:je,project:e,onBeforeMutation:e.permission==="read"?async()=>!0:ct})}),e.ownerId===t.id&&at&&i.jsx(f.Suspense,{fallback:null,children:i.jsx(f2,{open:!0,onOpenChange:tt,project:e,onBeforeMutation:ct})})]})}function F2(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}function b2({name:t,state:e,label:n,reloadLabel:s,onReload:r}){const o=e.status==="loading"?i.jsx(Et,{className:"spin",size:14}):e.status==="working"?i.jsx(ld,{size:14}):i.jsx(m0,{size:14});return i.jsxs("div",{className:`browser-tool-status ${e.status}`,title:e.error||void 0,children:[o,i.jsx("strong",{children:t}),i.jsx("span",{children:n}),e.status==="error"&&i.jsxs("button",{type:"button",className:"browser-tool-reload",onClick:r,children:[i.jsx(Dd,{size:12}),s]})]})}function y2({project:t,projectId:e,site:n,files:s,dictionaryWords:r,onDictionaryChange:o,editorPreferences:a,onEditorPreferences:c,spellCheckCount:u,spellCheckUniqueCount:l,spellCheckIndex:d,onSpellCheckNavigate:h,onProject:D}){const{t:p}=Qe(),[F,y]=f.useState(t.engine),[b,E]=f.useState(""),[x,N]=f.useState(t.name),[O,I]=f.useState(t.mainFile),[q,z]=f.useState(null),[X,G]=f.useState(""),[A,ie]=f.useState(""),[M,K]=f.useState(""),[L,S]=f.useState("appearance"),[P,he]=f.useState(a),xe=f.useSyncExternalStore(Yt.subscribe,Yt.getSnapshot,Yt.getSnapshot),Fe=t.permission==="owner",ye=t.permission!=="read",W=t.permission!=="read";f.useEffect(()=>he(a),[a]),f.useEffect(()=>{Ad().catch(Yt.failed)},[e]);const U=()=>{pg().catch(Yt.failed)};f.useEffect(()=>{if(!t.latexmkrc)return E("");re(`/api/projects/${e}/file?path=${encodeURIComponent(t.latexmkrc)}`).then(({content:j})=>E(j)).catch(j=>G(ce(j)))},[t.latexmkrc]),f.useEffect(()=>{if(L!=="compiler")return;const j=new AbortController;return z(null),re(`/api/projects/${e}/main-files`,{signal:j.signal}).then(ae=>z(ae.mainFiles)).catch(ae=>{ae instanceof Error&&ae.name==="AbortError"||G(ce(ae))}),()=>j.abort()},[e,s,L]);const ve=q??[t.mainFile],pe=q!==null&&!q.includes(O),B=async()=>{try{const j=b.trim()&&n.allowProjectLatexmkrc!==!1?".latexmkrc":null;j&&await re(`/api/projects/${e}/file`,{method:"PUT",body:JSON.stringify({path:j,content:b})});const ae=await re(`/api/projects/${e}`,{method:"PATCH",body:JSON.stringify({name:x,mainFile:O,engine:F,latexmkrc:j})});D(ae.project)}catch(j){G(ce(j))}},ue=()=>c(P),De=async()=>{const j=A.trim();if(j)try{const ae=await re(`/api/projects/${e}/dictionary`,{method:"POST",body:JSON.stringify({word:j})});o(ae.words),ie(""),K("")}catch(ae){K(ce(ae))}},Me=async j=>{try{const ae=await re(`/api/projects/${e}/dictionary/${encodeURIComponent(j)}`,{method:"DELETE"});o(ae.words),K("")}catch(ae){K(ce(ae))}};return i.jsxs("div",{className:"settings padded",children:[X&&i.jsx("p",{className:"error",children:X}),i.jsxs("div",{className:"settings-tabs",role:"tablist","aria-label":p("common.settings"),children:[i.jsxs("button",{id:"settings-tab-appearance",type:"button",role:"tab","aria-selected":L==="appearance","aria-controls":"settings-panel-appearance",className:`settings-tab${L==="appearance"?" active":""}`,onClick:()=>S("appearance"),children:[i.jsx(wu,{size:15}),p("projectSettings.editorTab")]}),i.jsxs("button",{id:"settings-tab-compiler",type:"button",role:"tab","aria-selected":L==="compiler","aria-controls":"settings-panel-compiler",className:`settings-tab${L==="compiler"?" active":""}`,onClick:()=>S("compiler"),children:[i.jsx(ta,{size:15}),p("projectSettings.compilerTab")]})]}),L==="appearance"?i.jsxs("section",{id:"settings-panel-appearance",role:"tabpanel","aria-labelledby":"settings-tab-appearance",children:[i.jsxs("div",{className:"settings-section-title",children:[i.jsx(wu,{size:15}),i.jsx("strong",{children:p("projectSettings.editorAppearance")})]}),i.jsx("p",{className:"settings-description appearance-description",children:p("projectSettings.editorAppearanceDescription")}),i.jsxs("label",{children:[p("projectSettings.fontFamily"),i.jsx("select",{value:P.font,onChange:j=>he({...P,font:j.target.value}),children:fi.map(j=>i.jsx("option",{value:j.id,children:p(j.labelKey)},j.id))})]}),i.jsxs("label",{children:[p("projectSettings.fontSize"),i.jsx("select",{value:P.fontSize,onChange:j=>he({...P,fontSize:Number(j.target.value)}),children:[12,13,14,15,16,18,20].map(j=>i.jsxs("option",{value:j,children:[j," px"]},j))})]}),i.jsxs("label",{children:[p("projectSettings.lineHeight"),i.jsxs("select",{value:P.lineHeight,onChange:j=>he({...P,lineHeight:Number(j.target.value)}),children:[i.jsx("option",{value:1.45,children:p("projectSettings.lineHeightCompact")}),i.jsx("option",{value:1.65,children:p("projectSettings.lineHeightNormal")}),i.jsx("option",{value:1.85,children:p("projectSettings.lineHeightRelaxed")})]})]}),i.jsxs("label",{className:"editor-checkbox",children:[i.jsx("input",{type:"checkbox",checked:P.lineWrapping,onChange:j=>he({...P,lineWrapping:j.target.checked})}),i.jsx(z0,{size:15}),i.jsx("span",{children:p("projectSettings.lineWrapping")})]}),i.jsxs("div",{className:"editor-preference",children:[i.jsxs("label",{className:"editor-checkbox",children:[i.jsx("input",{type:"checkbox",checked:P.spellCheck,onChange:j=>he({...P,spellCheck:j.target.checked})}),i.jsx("span",{children:p("projectSettings.spellCheck")})]}),i.jsxs("p",{className:"field-hint",children:[p("projectSettings.writingCheckDescription")," ",i.jsx("a",{href:"https://writewithharper.com/docs/harperjs/introduction",target:"_blank",rel:"noreferrer",children:"Harper.js"})]})]}),i.jsxs("div",{className:"editor-preference",children:[i.jsxs("label",{className:"editor-checkbox",children:[i.jsx("input",{type:"checkbox",checked:P.vimMode,onChange:j=>he({...P,vimMode:j.target.checked})}),i.jsx("span",{children:p("projectSettings.vimMode")})]}),i.jsxs("p",{className:"field-hint",children:[p("projectSettings.vimModeDescription")," ",i.jsx("a",{href:"https://replit-codemirror-vim.mintlify.app/",target:"_blank",rel:"noreferrer",children:p("projectSettings.vimHelp")})]})]}),i.jsxs("div",{className:"editor-preference",children:[i.jsxs("label",{className:"editor-checkbox",children:[i.jsx("input",{type:"checkbox",checked:P.openFilesInTabs,onChange:j=>he({...P,openFilesInTabs:j.target.checked})}),i.jsx(B0,{size:15}),i.jsx("span",{children:p("projectSettings.openFilesInTabs")})]}),i.jsx("p",{className:"field-hint",children:p("projectSettings.openFilesInTabsDescription")})]}),i.jsxs("div",{className:"editor-preference",children:[i.jsxs("label",{className:"editor-checkbox",children:[i.jsx("input",{type:"checkbox",disabled:!ye,checked:P.formatOnCompile,onChange:j=>he({...P,formatOnCompile:j.target.checked})}),i.jsx(cd,{size:15}),i.jsx("span",{children:p("projectSettings.formatOnCompile")})]}),i.jsxs("p",{className:"field-hint",children:[p(ye?"projectSettings.formatOnCompileDescription":"projectSettings.formatRequiresWrite")," ",p("projectSettings.formatterDescription")," ",i.jsx("a",{href:"https://www.npmjs.com/package/tex-fmt",target:"_blank",rel:"noreferrer",children:p("projectSettings.formatterInstall")})," · ",i.jsx("a",{href:"https://github.com/FlamingTempura/bibtex-tidy",target:"_blank",rel:"noreferrer",children:p("projectSettings.bibtexTidyInstall")})]})]}),i.jsxs("div",{className:"editor-preference",children:[i.jsxs("label",{children:[p("projectSettings.texFmtOptions"),i.jsx("textarea",{className:"tex-fmt-options-editor",rows:6,maxLength:16*1024,spellCheck:!1,value:P.texFmtConfig,placeholder:p("projectSettings.texFmtOptionsPlaceholder"),onChange:j=>he({...P,texFmtConfig:j.target.value})})]}),i.jsx("p",{className:"field-hint",children:p("projectSettings.texFmtOptionsDescription")}),i.jsx("div",{className:"tex-fmt-status",role:"status","aria-live":"polite","aria-label":p("projectSettings.browserTools"),children:i.jsx(b2,{name:"tex-fmt",state:xe,label:p(`projectSettings.toolStatus.${xe.status}`),reloadLabel:p("projectSettings.reloadTool"),onReload:U})})]}),u!==null&&i.jsxs("div",{className:`spell-check-result${u?" has-issues":""}`,role:"status","aria-live":"polite",children:[i.jsx(M0,{size:14}),i.jsx("span",{children:u?p("projectSettings.writingIssues",{count:u,uniqueCount:l??0}):p("projectSettings.noWritingIssues")}),u>0&&i.jsxs("span",{className:"spell-check-controls",children:[i.jsx("button",{type:"button",title:p("projectSettings.spellCheckFirst"),"aria-label":p("projectSettings.spellCheckFirst"),disabled:d<=0,onClick:()=>h(0),children:i.jsx(h0,{size:14})}),i.jsx("button",{type:"button",title:p("projectSettings.spellCheckPrevious"),"aria-label":p("projectSettings.spellCheckPrevious"),disabled:d<=0,onClick:()=>h(d-1),children:i.jsx(pr,{size:14})}),i.jsx("span",{className:"spell-check-position",children:p("projectSettings.spellCheckPosition",{current:Math.min(d+1,u),total:u})}),i.jsx("button",{type:"button",title:p("projectSettings.spellCheckNext"),"aria-label":p("projectSettings.spellCheckNext"),disabled:d>=u-1,onClick:()=>h(d+1),children:i.jsx(Ri,{size:14})}),i.jsx("button",{type:"button",title:p("projectSettings.spellCheckLast"),"aria-label":p("projectSettings.spellCheckLast"),disabled:d>=u-1,onClick:()=>h(u-1),children:i.jsx(f0,{size:14})})]})]}),i.jsxs("div",{className:"settings-section-title",children:[i.jsx(Ra,{size:15}),i.jsx("strong",{children:p("projectSettings.dictionary")})]}),i.jsx("p",{className:"settings-description",children:p("projectSettings.dictionaryDescription")}),M&&i.jsx("p",{className:"error dictionary-error",children:M}),W&&i.jsxs("div",{className:"dictionary-add",children:[i.jsx("input",{value:A,placeholder:p("projectSettings.dictionaryPlaceholder"),onChange:j=>ie(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),De())}}),i.jsx("button",{type:"button",disabled:!A.trim(),onClick:()=>{De()},children:p("projectSettings.addWord")})]}),i.jsxs("div",{className:"dictionary-words",children:[r.map(j=>i.jsxs("span",{className:"dictionary-word",children:[i.jsx("code",{children:j}),W&&i.jsx("button",{type:"button",title:p("common.delete"),"aria-label":`${p("common.delete")} ${j}`,onClick:()=>{Me(j)},children:i.jsx(qt,{size:13})})]},j)),r.length===0&&i.jsx("span",{className:"dictionary-empty",children:p("projectSettings.dictionaryEmpty")})]}),i.jsx("div",{className:"settings-actions",children:i.jsxs("button",{className:"settings-save",onClick:ue,children:[i.jsx(di,{size:15}),p("projectSettings.saveAppearance")]})})]}):i.jsxs("section",{id:"settings-panel-compiler",role:"tabpanel","aria-labelledby":"settings-tab-compiler",children:[i.jsxs("div",{className:"settings-section-title",children:[i.jsx(ta,{size:15}),i.jsx("strong",{children:p("projectSettings.compilerTab")})]}),i.jsx("p",{className:"settings-description compiler-description",children:p("projectSettings.compilerDescription")}),i.jsxs("label",{children:[p("projects.name"),i.jsx("input",{disabled:!Fe,value:x,onChange:j=>N(j.target.value)})]}),i.jsxs("label",{children:[p("projectSettings.mainFile"),i.jsxs("select",{disabled:!Fe||q===null||q.length===0,value:O,onChange:j=>I(j.target.value),children:[pe&&i.jsx("option",{value:O,disabled:!0,children:p("projectSettings.invalidMainFileOption",{path:O})}),ve.map(j=>i.jsx("option",{value:j,children:j},j))]})]}),i.jsxs("label",{children:[p("projectSettings.engine"),i.jsx("select",{disabled:!Fe,value:F,onChange:j=>y(j.target.value),children:(n.allowedEngines??["pdflatex","xelatex","lualatex"]).map(j=>i.jsx("option",{children:j},j))})]}),i.jsxs("label",{children:[p("projectSettings.latexmkrc"),i.jsx("textarea",{className:"latexmkrc-editor",rows:10,spellCheck:!1,disabled:!Fe||n.allowProjectLatexmkrc===!1,value:b,placeholder:p("projectSettings.latexmkrcPlaceholder"),onChange:j=>E(j.target.value)})]}),i.jsx("div",{className:"settings-actions",children:Fe&&i.jsxs("button",{className:"settings-save",onClick:()=>{B()},children:[i.jsx(di,{size:15}),p("projectSettings.saveCompiler")]})})]})]})}function C2({sidePanel:t,onClose:e,project:n,projectId:s,site:r,files:o,currentUserId:a,comments:c,onFocusComment:u,onToggleComment:l,onReplyComment:d,onEditComment:h,onDeleteComment:D,onEditCommentReply:p,onDeleteCommentReply:F,dictionaryWords:y,onDictionaryChange:b,editorPreferences:E,onEditorPreferences:x,spellCheckCount:N,spellCheckUniqueCount:O,spellCheckIndex:I,onSpellCheckNavigate:q,onProject:z}){const{t:X}=Qe();return t?i.jsxs(i.Fragment,{children:[i.jsx(Ca,{className:"resize-handle"}),i.jsx(Bi,{id:"context",order:4,defaultSize:20,minSize:15,maxSize:38,children:i.jsxs("aside",{className:"context-panel",children:[i.jsxs("div",{className:"drawer-title",children:[i.jsx("strong",{children:X(t==="comments"?"editor.sourceComments":"editor.projectSettings")}),i.jsx("button",{"aria-label":X("common.close"),onClick:e,children:i.jsx(qt,{size:17})})]}),t==="comments"&&i.jsxs("div",{className:"comments",children:[c.map(G=>i.jsx(d2,{comment:G,currentUserId:a,onFocus:()=>u(G),onToggle:()=>{l(G)},onReply:A=>d(G,A),onEdit:A=>h(G,A),onDelete:()=>D(G),onEditReply:(A,ie)=>p(G,A,ie),onDeleteReply:A=>F(G,A)},G.id)),c.length===0&&i.jsx("p",{className:"muted padded",children:X("editor.noComments")})]}),t==="settings"&&i.jsx(y2,{project:n,projectId:s,site:r,files:o,dictionaryWords:y,onDictionaryChange:b,editorPreferences:E,onEditorPreferences:x,spellCheckCount:N,spellCheckUniqueCount:O,spellCheckIndex:I,onSpellCheckNavigate:q,onProject:z})]})})]}):null}function cr(t){return t instanceof Error&&t.name==="AbortError"}function E2({site:t,user:e,projectId:n,preload:s,onBack:r}){const{t:o}=Qe(),[a,c]=f.useState(null),[u,l]=f.useState(!1),[d,h]=f.useState([]),[D,p]=f.useState(null),[F,y]=f.useState([]),[b,E]=f.useState(""),[x,N]=f.useState(""),[O,I]=f.useState(new Set),[q,z]=f.useState(""),[X,G]=f.useState(""),[A,ie]=f.useState(!1),[M,K]=f.useState("editor.saved"),[L,S]=f.useState(null),P=f.useRef(L);P.current=L;const[he,xe]=f.useState({line:1,column:1}),Fe=f.useRef(he),ye=f.useRef(0),[W,U]=f.useState("pdf"),[ve,pe]=f.useState("log"),B=v=>{if(v==="pdf"){U("pdf");return}if(v==="diagnostics"){U("diagnostics");return}pe(v),U("diagnostics")},{workspaceLayout:ue,setWorkspaceLayout:De}=Jy(e.id,n),[Me,j]=f.useState(""),[ae,ge]=f.useState(""),[We,Oe]=f.useState({selectedText:"",startOffset:0,endOffset:0}),Ve=f.useRef({selectedText:"",startOffset:0,endOffset:0}),ht=v=>{Ve.current=v,Oe(v)},[me,xt]=f.useState(null),[vt,it]=f.useState(!1),[ze,Rt]=f.useState(!1),[R,Q]=f.useState(!1),[V,Ye]=f.useState(!1),[Ge,je]=f.useState(!1),[at,tt]=f.useState(null),[ct,de]=f.useState(!1),[ft,Ce]=f.useState(!1),[Dt,ee]=f.useState(!1),[oe,et]=f.useState(null),[gt,mt]=f.useState(""),[At,kt]=f.useState(!1),[st,zt]=f.useState(()=>Su(e.id,n)),[k,te]=f.useState([]),Z=f.useRef([]);Z.current=k;const Ae=f.useRef(null),St=f.useRef(null),Vt=f.useRef(0),m=f.useRef(0),w=f.useRef(""),g=f.useRef(""),_=f.useRef(""),H=f.useRef(0),J=f.useRef(null),T=f.useRef(null),fe=f.useRef(null),be=f.useRef(null),Le=f.useRef(!1),Ee=f.useRef(null),Be=f.useRef(r);Be.current=r,_.current=x,f.useEffect(()=>{if(!ae)return;const v=window.setTimeout(()=>ge(""),3e3);return()=>window.clearTimeout(v)},[ae]);const Ft=(v,$,ne=0)=>{const Y={line:v,column:$};Fe.current=Y,ye.current=ne,xe(Y)},jt=v=>{const $=Z.current,ne=v($);ne!==$&&(Z.current=ne,te(ne))};f.useEffect(()=>{Z.current=[],te([]),et(null),mt("")},[n]);const Wt=v=>{const $=Z.current,ne=$.indexOf(v);if(ne<0)return;const Y=$.filter(Ie=>Ie!==v);if(Z.current=Y,te(Y),g.current!==v)return;const Te=Y.length>0?Y[Math.min(ne,Y.length-1)]:a?.mainFile??"";E(Te)},{collaboration:Ne,status:qe,synced:_e,activeSessions:Ot,formatLeaseStates:Zt,compileState:ot,setCompileState:$e,filesEvent:nt,commentsRevision:Pn,dictionaryRevision:fs,localDraftReady:vn,permission:Yn,reconnect:_n,permissionDowngrade:An,dismissPermissionDowngrade:tr,discardLocalDraft:ms}=Vy(n,e,x,a?.permission??"read",u,()=>K("editor.offlineDraft")),{pdfTarget:Gi,pdfViewport:Yi,sourceJump:Ur,setPdfViewport:Xi,clearPdfViewport:nr,jumpToSource:sr,syncSourceToPdf:C,syncPdfToSource:Ue,syncVisiblePdfToSource:Pe}=Xy({projectId:n,mainFile:x,activeFile:b,onActiveFile:E,onError:j,onShowPdf:()=>B("pdf")}),He=Yy({active:!!(a&&b&&_e&&st.spellCheck),projectId:n,activeFile:b,content:q,dictionaryWords:d});f.useEffect(()=>{zt(Su(e.id,n))},[e.id,n]);const Ct=v=>{w.current=v,z(v)};f.useEffect(()=>{if(g.current=b,Fe.current={line:1,column:1},ye.current=0,xe({line:1,column:1}),ht({selectedText:"",startOffset:0,endOffset:0}),!st.openFilesInTabs){Z.current.length>0&&(Z.current=[],te([]));return}b&&jt(v=>v.includes(b)?v:[...v,b])},[b,st.openFilesInTabs,n]),f.useEffect(()=>{if(!A)return;const v=$=>{$.preventDefault(),$.returnValue=""};return window.addEventListener("beforeunload",v),()=>window.removeEventListener("beforeunload",v)},[A]),f.useEffect(()=>{if(qe!=="disconnected")return;const v=new AbortController;return re(`/api/projects/${n}`,{signal:v.signal}).then(({project:$})=>{v.signal.aborted||(c($),j(""))}).catch($=>{if(!cr($)){if($ instanceof xl&&[401,403,404].includes($.status)){j(ce($)),Be.current();return}j(o("errors.collaborationUnavailable"))}}),()=>v.abort()},[qe,n,o]);const bt=async(v={})=>{J.current?.abort(),J.current=null;const $=v.signal?null:new AbortController;$&&(J.current=$);try{const ne=await re(`/api/projects/${n}/completions`,{signal:v.signal??$?.signal});(!v.isCurrent||v.isCurrent())&&p(ne.index)}catch(ne){if(cr(ne))return;(!v.isCurrent||v.isCurrent())&&p(null)}finally{$&&J.current===$&&(J.current=null)}},on=async(v={},$=_.current)=>{T.current?.abort(),T.current=null;const ne=v.signal?null:new AbortController;ne&&(T.current=ne);try{const Y=$?`?mainFile=${encodeURIComponent($)}`:"",Te=await re(`/api/projects/${n}/outline${Y}`,{signal:v.signal??ne?.signal});(!v.isCurrent||v.isCurrent())&&y(Te.outline)}catch(Y){!cr(Y)&&(!v.isCurrent||v.isCurrent())&&y([])}finally{ne&&T.current===ne&&(T.current=null)}},Xn=async(v={})=>{fe.current?.abort(),fe.current=null;const $=v.signal?null:new AbortController;$&&(fe.current=$);try{const ne=await re(`/api/projects/${n}/dictionary`,{signal:v.signal??$?.signal});(!v.isCurrent||v.isCurrent())&&h(ne.words)}catch(ne){if(cr(ne))return;(!v.isCurrent||v.isCurrent())&&h([])}finally{$&&fe.current===$&&(fe.current=null)}};f.useEffect(()=>{let v=!1;const $=++H.current,ne=new AbortController,Y=()=>!v&&H.current===$;let Te=!1;c(null),Cc([]),y([]),E(""),N(""),I(new Set),z(""),G(""),$e(null),nr(),p(null),h([]),Li();const Ie=(s?.projectId===n?s.project:re(`/api/projects/${n}`,{signal:ne.signal})).then(Pt=>{Y()&&(Te=!0,c(Pt.project),E(Pt.project.mainFile),N(Pt.project.mainFile),I(new Set),jc(new Set(hr(Pt.project.mainFile))))}).catch(Pt=>{Y()&&j(ce(Pt))}),we=re(`/api/projects/${n}/files`,{signal:ne.signal}).then(Pt=>{Y()&&Cc(Pt.files)}).catch(Pt=>{Y()&&j(ce(Pt))});let Qt=null;return Promise.allSettled([Ie,we]).then(()=>{!Y()||!Te||(Qt=window.setTimeout(()=>{Y()&&Promise.all([bt({signal:ne.signal,isCurrent:Y}),Xn({signal:ne.signal,isCurrent:Y})])},0))}),()=>{v=!0,Qt!==null&&window.clearTimeout(Qt),ne.abort(),J.current?.abort(),J.current=null,T.current?.abort(),T.current=null,fe.current?.abort(),fe.current=null,be.current?.abort(),be.current=null}},[n,s]),f.useEffect(()=>{fs&&Xn()},[fs,n]),f.useEffect(()=>{!a||qe!=="connected"||Yn===a.permission||c(v=>v&&{...v,permission:Yn})},[Yn,a?.permission]),f.useEffect(()=>{if(!nt)return;const v=nt.kind==="delete"&&!!nt.path&&Zn(nt.path,g.current),$=nt.kind==="delete"&&!!nt.path&&Zn(nt.path,_.current);if(nt.kind==="move"&&nt.source&&nt.destination){const Y=nt.source,Te=nt.destination,Ie=we=>we===Y?Te:we.startsWith(`${Y}/`)?`${Te}${we.slice(Y.length)}`:we;E(we=>Ie(we)),N(we=>Ie(we)),I(we=>new Set([...we].map(Ie))),Ji(we=>we&&Ie(we)),jt(we=>we.map(Ie))}v&&(E(""),G(""),Ct(""),ge(o("editor.fileDeletedByCollaborator",{path:nt.path}))),nt.kind==="delete"&&nt.path&&(I(Y=>new Set([...Y].filter(Te=>!Zn(nt.path,Te)))),Ji(Y=>Zn(nt.path,Y)?"":Y),xc(Y=>Y&&Zn(nt.path,Y.path)?null:Y),jt(Y=>Y.filter(Te=>!Zn(nt.path,Te)))),be.current?.abort();const ne=new AbortController;be.current=ne,Promise.all([hf({signal:ne.signal}),re(`/api/projects/${n}`,{signal:ne.signal})]).then(([Y,Te])=>{if(c(Te.project),$&&N(Te.project.mainFile),v&&Y){const Ie=Y.find(we=>we.type==="file"&&we.path===Te.project.mainFile)??Y.find(we=>we.type==="file"&&_s(we.path));E(Ie?.path??"")}bt({signal:ne.signal}),on({signal:ne.signal},$?Te.project.mainFile:_.current)}).catch(Y=>{cr(Y)}).finally(()=>{be.current===ne&&(be.current=null)})},[nt?.revision]),f.useEffect(()=>{if(Ne.setActiveFile(b),!b)return;G(""),K("editor.loading");const v=Ne.getText(b),$=(ne,Y)=>{Ct(v.toString()),G(b),Y?.local&&a?.permission!=="read"?(Vt.current+=1,ie(!0),K("editor.pending")):Vt.current<=m.current&&K(P.current?"editor.savedAt":"editor.saved")};return v.observe($),(_e||vn)&&$(),()=>{v.unobserve($)}},[b,Ne,_e,vn,a?.permission]);const kn=async()=>{if(!_e)throw new Error("Collaboration is not synchronized");const v=Vt.current,$=await Ne.flush();return m.current=Math.max(m.current,v),S($.persistedAt),/\.tex$/i.test(g.current)&&on(),Vt.current===v?(ie(!1),K("editor.savedAt")):K("editor.pending"),$};f.useEffect(()=>{if(!A||!b)return;if(!_e){K("editor.offlineDraft");return}K("editor.pending");const v=window.setTimeout(()=>{K("editor.saving"),kn().catch(()=>{K(Ne.connected?"editor.saveFailed":"editor.offlineDraft")})},750);return()=>window.clearTimeout(v)},[q,A,b,_e]);const an=async()=>{if(!a||a.permission==="read"||!_e||!b)return!1;K("editor.saving");try{return await kn(),bt(),!0}catch(v){return K("editor.saveFailed"),j(ce(v)||o("errors.collaborationUnavailable")),!1}},rr=async(v,$,ne=st.texFmtConfig)=>{if(/\.bib$/i.test(v))try{return{formatted:G0($,t.maxCitationBibtexBytes),diagnostics:""}}catch(Te){throw Te instanceof ra?Te.kind==="too-large"?new Error(o("citationLibrary.fileTooLarge",{size:ia(t.maxCitationBibtexBytes)})):new Error(o("citationLibrary.fileInvalid")):Te}const Y=await mg($,ne);return{formatted:Y.output,diagnostics:Y.logs.trim()}},bc=async v=>{if(!a||a.permission==="read"||!_e||Le.current||!Zr(g.current))return;const $=g.current,ne=Ne.getText($);Le.current=!0,ee(!0);let Y=()=>{};const Te=new Promise(we=>{Y=we});Ee.current=Te,mt("");let Ie=null;try{Ie=await Ne.acquireFormatLease($);const we=ne.toString(),{formatted:Qt,diagnostics:Pt}=await rr($,we,v);if(g.current!==$||ne.toString()!==we){j(o("editor.formatSourceChanged"));return}await Ie.confirm();const cn=await Co(we,Qt);if(g.current!==$||ne.toString()!==we){j(o("editor.formatSourceChanged"));return}if(await Ie.confirm(),g.current!==$||ne.toString()!==we){j(o("editor.formatSourceChanged"));return}cn.length&&Ne.applyTextEdits($,cn),cn.length&&await kn(),et(null),mt(Pt),j(""),ge(o("editor.formatFileComplete"))}catch(we){yo(we)?(et({action:"file",kind:we.kind,detail:we.message}),j("")):j(o("editor.formatFileFailed",{message:ce(we)}))}finally{Ie&&await Ie.release(),Le.current=!1,ee(!1),Y(),Ee.current===Te&&(Ee.current=null)}},uf=async()=>{if(!st.formatOnCompile||!a||a.permission==="read"||!_e||!Zr(g.current)||Le.current)return;const v=g.current,$=Ne.getText(v);Le.current=!0,ee(!0),mt("");let ne=null;try{ne=await Ne.acquireFormatLease(v);const Y=$.toString(),{formatted:Te,diagnostics:Ie}=await rr(v,Y);await ne.confirm();const we=await Co(Y,Te);if(g.current!==v||$.toString()!==Y)throw new Error(o("editor.formatSourceChanged"));if(await ne.confirm(),g.current!==v||$.toString()!==Y)throw new Error(o("editor.formatSourceChanged"));we.length&&Ne.applyTextEdits(v,we),we.length&&await Ne.flush(),et(null),mt(Ie)}catch(Y){yo(Y)?(et({action:"file",kind:Y.kind,detail:Y.message}),j("")):j(o("editor.formatFailedContinue",{message:ce(Y)}))}finally{ne&&await ne.release(),Le.current=!1,ee(!1)}},lf=async()=>(Ee.current&&await Ee.current,await uf(),an()),yc=async v=>{if(!a||a.permission==="read"||!_e||Le.current||!Zr(g.current))return;const $=Ve.current;if(!$.selectedText.trim()){ge(o("editor.formatSelectionRequired"));return}const ne=g.current,{startOffset:Y,endOffset:Te,selectedText:Ie}=$,we=Ne.getText(ne);if(we.toString().slice(Y,Te)!==Ie){j(o("editor.formatSelectionChanged"));return}Le.current=!0,ee(!0);let Qt=()=>{};const Pt=new Promise(Sn=>{Qt=Sn});Ee.current=Pt,mt("");let cn=null;try{if(cn=await Ne.acquireFormatLease(ne),we.toString().slice(Y,Te)!==Ie){j(o("editor.formatSelectionChanged"));return}const Wc=await rr(ne,Ie,v),pm=gg(Ie,Wc.formatted);await cn.confirm();const ao=await Co(Ie,pm,Y);if(g.current!==ne||we.toString().slice(Y,Te)!==Ie){j(o("editor.formatSelectionChanged"));return}if(await cn.confirm(),g.current!==ne||we.toString().slice(Y,Te)!==Ie){j(o("editor.formatSelectionChanged"));return}ao.length&&Ne.applyTextEdits(ne,ao),ao.length&&await kn(),et(null),mt(Wc.diagnostics),j(""),ge(o("editor.formatSelectionComplete"))}catch(Sn){yo(Sn)?(et({action:"selection",kind:Sn.kind,detail:Sn.message}),j("")):j(o("editor.formatFailed",{message:ce(Sn)}))}finally{cn&&await cn.release(),Le.current=!1,ee(!1),Qt(),Ee.current===Pt&&(Ee.current=null)}},df=v=>{const $=g.current;if(!/\.bib$/i.test($)||a?.permission==="read"||!_e)return ge(o("citationLibrary.importRequiresWrite")),!1;const Y=Ne.getText($).toString(),Te=yd(Y,t.maxCitationBibtexBytes);if(Te.status==="too-large")return ge(o("citationLibrary.fileTooLarge",{size:ia(t.maxCitationBibtexBytes)})),!1;if(Te.status==="invalid")return ge(o("citationLibrary.fileInvalid")),!1;if(Te.entries.some(Sn=>Sn.citationKey.toLowerCase()===v.citationKey.toLowerCase()))return ge(o("citationErrors.alreadyInFile",{key:v.citationKey})),!1;const Ie=Math.max(0,Math.min(Y.length,ye.current)),we=Y.slice(0,Ie),Qt=Y.slice(Ie),Pt=we?we.endsWith(`
|
|
52
|
-
|
|
53
|
-
`)?"":we.endsWith(`
|
|
54
|
-
`)?`
|
|
55
|
-
`:`
|
|
56
|
-
|
|
57
|
-
`:"",cn=Qt?Qt.startsWith(`
|
|
58
|
-
|
|
59
|
-
`)?"":Qt.startsWith(`
|
|
60
|
-
`)?`
|
|
61
|
-
`:`
|
|
62
|
-
|
|
63
|
-
`:"";return Ne.applyTextEdits($,[{from:Ie,to:Ie,replacement:`${Pt}${v.bibtex.trim()}${cn}`}]),ge(o("citationLibrary.imported",{key:v.citationKey})),!0},{files:pn,setFiles:Cc,loadFiles:hf,newFileOpen:ff,setNewFileOpen:Ec,newFilePath:mf,setNewFilePath:wc,resourcePreview:pf,setResourcePreview:xc,resourcePreviewLoading:Df,setResourcePreviewLoading:gf,newFolderOpen:Ff,setNewFolderOpen:vc,newFolderName:bf,setNewFolderName:Ac,fileDialogError:yf,setFileDialogError:kc,selectedFolder:Sc,setSelectedFolder:Ji,expandedFolders:Cf,setExpandedFolders:jc,moveEntry:Ef,setMoveEntry:Bc,moveName:wf,setMoveName:Tc,moveDestination:xf,setMoveDestination:Lc,deleteEntry:Zi,setDeleteEntry:Nc,fileDragActive:vf,setFileDragActive:Af,uploadConflict:kf,setUploadConflict:Sf,uploadingFiles:jf,directoryEntries:Bf,visibleEntries:Tf,createFile:Lf,createFolder:Nf,uploadFiles:Rc,upload:Rf,openFile:Qi,movePath:Of,removePath:Pf}=Gy({projectId:n,site:t,activeFile:b,dirty:A,save:an,onError:j,onProject:c,onActiveFile:E,onActiveMainFile:N,onRootDocuments:I});f.useEffect(()=>{if(!b||X!==b||!b.toLocaleLowerCase().endsWith(".tex"))return;const v=pn.filter(Te=>Te.type==="file"&&/\.tex$/i.test(Te.path)).length;if(v===0)return;const $=b===a?.mainFile,Y=Zy(q)||v===1;I(Te=>{if(Te.has(b)===Y)return Te;const Ie=new Set(Te);return Y?Ie.add(b):Ie.delete(b),Ie}),Y&&!$&&_.current!==b?N(b):!Y&&_.current===b&&a?.mainFile&&N(a.mainFile)},[b,X,q,pn,a?.mainFile]),f.useEffect(()=>{if(!st.openFilesInTabs||pn.length===0)return;const v=new Set(pn.filter($=>$.type==="file"&&_s($.path)).map($=>$.path));jt($=>{const ne=$.filter(Y=>v.has(Y));return ne.length===$.length?$:ne})},[pn,st.openFilesInTabs]);const{comments:zr,focusComment:_f,setFocusComment:Oc,commentOpen:If,setCommentOpen:Pc,commentText:Mf,setCommentText:$f,addComment:Uf,toggleComment:zf,replyToComment:Vf,editComment:Hf,deleteComment:qf,editCommentReply:Kf,deleteCommentReply:Wf}=wg({projectId:n,activeFile:b,permission:a?.permission,revision:Pn,selection:We,save:an,onError:j,onAdded:()=>xt("comments")}),{pdfUrl:In,pdfCompiledAt:ir,pdfLoadingMode:Gf,pdfLoading:eo,compileLog:to,compileDiagnostics:Yf,compileOutcome:Vr,artifacts:_c,artifactPreview:Xf,artifactLoading:Jf,editorNotice:Zf,localCompiling:Ic,cleaning:Mc,compile:Qf,cleanCompile:$c,viewArtifact:em}=Hy({projectId:n,project:a,mainFile:x,initialLatest:s?.projectId===n?s.latestCompile:null,collaborationSynced:_e,sharedState:ot,onSharedState:$e,save:lf,loadOutline:(v,$)=>on({signal:v},$),onPreviewTab:B,onError:j,onCompileStart:()=>{j(""),ge("")},onCompileSuccess:()=>{const v=g.current;v&&C(v,Fe.current.line,Fe.current.column,{silent:!0})},onPdfChanged:nr});f.useEffect(()=>{if(!a||!x||!In&&eo)return;const v=window.setTimeout(()=>l(!0),In?150:0);return()=>window.clearTimeout(v)},[a,eo,In]),f.useEffect(()=>{const v=$=>{($.ctrlKey||$.metaKey)&&(!$.shiftKey&&$.key.toLocaleLowerCase()==="p"?($.preventDefault(),de(!0)):$.shiftKey&&$.key.toLocaleLowerCase()==="f"&&($.preventDefault(),Ce(!0)))};return window.addEventListener("keydown",v,!0),()=>window.removeEventListener("keydown",v,!0)},[]);const Uc=v=>{zt(v),ug(e.id,n,v)},zc=(v=!1)=>{const $=oe;if(!$)return;et(null),mt(""),j(""),v&&Uc({...st,texFmtConfig:""});const ne=v?"":void 0;$.action==="selection"?yc(ne):bc(ne)},tm=async()=>{kt(!0);try{await ms()||(j(o("editor.collaboration.permissionDowngradeOtherTabBlocked")),kt(!1))}catch(v){j(ce(v)),kt(!1)}},Vc=()=>{St.current?.isCollapsed()?St.current.expand():St.current?.collapse()},nm=f.useMemo(()=>F.length?F:w2(q).map(v=>({...v,path:b})),[F,q,b]),no=f.useMemo(()=>Fg(to,Vr),[to,Vr]),ps=ue!=="pdf-only",Hc=ue!=="editor-only",so=v=>{De(v),v==="pdf-only"&&B("pdf")},sm=Zi?Ot.filter(v=>v.filePath&&Zn(Zi.path,v.filePath)):[];if(!a)return i.jsxs("div",{className:"center-card",children:[i.jsx("p",{children:Me||o("common.loading")}),Me&&i.jsx("button",{className:"primary",onClick:r,children:o("editor.backToProjects")})]});const Mn=a.permission==="read"||!_e,ro=Zt.find(v=>v.path===b),io=ro&&!Dt?ro:null,rm=(v,$)=>{if(Mn)return;const ne=g.current;if(!ne)return;if(Ne.getText(ne).toString().slice(v.from,v.to)!==v.word){j(o("editor.spellCheckSourceChanged"));return}try{Ne.applyTextEdits(ne,[{from:v.from,to:v.to,replacement:$}])}catch(Ie){j(ce(Ie))}},oo=ot?.mainFile===x&&(ot.status==="queued"||ot.status==="running"),Hr=Ic||oo||Mc,im=b?Ne.getText(b):null,om=ir?new Date(ir).toLocaleString(Ke.resolvedLanguage,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"",am=x.split("/").at(-1)??x,cm=no.warnings.length+no.errors.length+_c.length,um=In?`${In}${In.includes("?")?"&":"?"}download=1`:"",lm=x||a.mainFile,dm=!!(b&&b===lm&&/\.tex$/i.test(b)),qc=v=>{const $=pn.find(ne=>ne.path===v);$&&_s($.path)?Qi($):Wt(v)},hm=v=>{document.getElementById(`editor-tab-${encodeURIComponent(v)}`)?.focus()},fm=(v,$)=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(v.key))return;v.preventDefault();const ne=v.key==="Home"?0:v.key==="End"?k.length-1:($+(v.key==="ArrowLeft"?-1:1)+k.length)%k.length,Y=k[ne];Y&&(qc(Y),window.requestAnimationFrame(()=>hm(Y)))},Kc=Hr?oo?ot?.status==="queued"?o("editor.compileQueued"):o("editor.compilingBy",{name:ot?.requestedBy.name??o("common.user")}):o("editor.compiling"):Vr==="failed"?In&&ir?o("editor.compileFailedRetained",{time:new Date(ir).toLocaleString(Ke.resolvedLanguage)}):o("editor.compileFailedNoPdf"):"",mm=M==="editor.savedAt"&&L?o("editor.savedAt",{time:new Date(L).toLocaleTimeString(Ke.resolvedLanguage,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}):o(M);return i.jsxs("div",{className:"workspace",children:[i.jsx(t2,{site:t,project:a,activeFile:b,saveStateLabel:mm,editorPreferences:st,activeSessions:Ot,collaborationStatus:qe,reconnectCollaboration:_n,showEditor:ps,filesCollapsed:vt,toggleFilesPanel:Vc,workspaceLayout:ue,changeWorkspaceLayout:so,onBack:r,onShare:()=>Rt(!0),showCitationLibrary:ps&&/\.bib$/i.test(b),citationLibraryOpen:Ge,onCitationLibrary:()=>je(!0),onHistory:()=>Ye(!0),onGit:()=>Q(!0),canManageGit:a.ownerId===e.id,formatting:Dt,canFormat:Zr(b),readOnly:Mn,collaborationSynced:_e,activeFormatLease:!!ro,onFormatFile:()=>{bc()},onFormatSelection:()=>{yc()},hasSelection:!!We.selectedText.trim(),onAddComment:()=>Pc(!0),onToggleComments:()=>xt(me==="comments"?null:"comments"),commentsOpen:me==="comments",unresolvedCommentCount:zr.filter(v=>!v.resolved).length,hasActiveFile:!!b,onToggleSettings:()=>xt(me==="settings"?null:"settings"),settingsOpen:me==="settings",compileBusy:Hr,sharedCompiling:oo,localCompiling:Ic,compileState:ot,onCompile:Qf}),Kc&&i.jsxs("div",{className:`compile-status-strip${Vr==="failed"?" failed":""}`,role:"status","aria-live":"polite",children:[i.jsx(Et,{className:Hr?"spin":"",size:14}),i.jsx("span",{children:Kc})]}),(He.error||oe||gt||io)&&i.jsxs("div",{className:"client-tool-recoveries",children:[He.error&&i.jsxs("div",{className:"client-tool-recovery",role:"alert",title:He.error,children:[i.jsx(ln,{size:15}),i.jsxs("span",{children:[i.jsx("strong",{children:o("editor.harperRecoveryTitle")}),o("editor.harperFallbackHint")]}),i.jsx("div",{className:"client-tool-recovery-actions",children:i.jsx("button",{type:"button",onClick:He.retry,children:o("common.retry")})}),i.jsx("button",{type:"button",className:"formatter-diagnostics-dismiss",title:o("common.close"),"aria-label":o("common.close"),onClick:He.dismissError,children:i.jsx(qt,{size:13})})]}),oe&&i.jsxs("div",{className:"client-tool-recovery",role:"alert",title:oe.detail,children:[i.jsx(ln,{size:15}),i.jsxs("span",{children:[i.jsx("strong",{children:o(oe.kind==="format"?"editor.texFmtOptionsRecoveryTitle":oe.kind==="load"?"editor.texFmtRecoveryTitle":"editor.texFmtRuntimeRecoveryTitle")}),o("editor.clientToolRecoveryHint")]}),i.jsxs("div",{className:"client-tool-recovery-actions",children:[i.jsx("button",{type:"button",disabled:Dt||Mn,onClick:()=>zc(),children:o("common.retry")}),oe.kind==="format"&&st.texFmtConfig.trim()&&i.jsx("button",{type:"button",disabled:Dt||Mn,onClick:()=>zc(!0),children:o("editor.resetFormatterOptions")}),i.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:o("common.reload")})]}),i.jsx("button",{type:"button",className:"formatter-diagnostics-dismiss",title:o("common.close"),"aria-label":o("common.close"),onClick:()=>et(null),children:i.jsx(qt,{size:13})})]}),gt&&i.jsxs("div",{className:"client-tool-recovery formatter-diagnostics",role:"status",children:[i.jsx(ln,{size:15}),i.jsxs("span",{children:[i.jsx("strong",{children:o("editor.texFmtDiagnosticsTitle")}),o("editor.texFmtDiagnosticsHint")]}),i.jsxs("details",{children:[i.jsx("summary",{children:o("editor.viewFormatterDiagnostics")}),i.jsx("pre",{children:gt})]}),i.jsx("button",{type:"button",className:"formatter-diagnostics-dismiss",title:o("editor.dismissFormatterDiagnostics"),"aria-label":o("editor.dismissFormatterDiagnostics"),onClick:()=>mt(""),children:i.jsx(qt,{size:13})})]}),io&&i.jsxs("div",{className:"client-tool-recovery format-lease-status",role:"status",children:[i.jsx(Et,{className:"spin",size:15}),i.jsx("span",{children:o("editor.formattingBy",{name:io.holderName})})]})]}),Me&&i.jsx("div",{className:"toast",onClick:()=>j(""),children:Me}),ae&&i.jsx("div",{className:"toast success",onClick:()=>ge(""),children:ae}),i.jsxs(Fm,{autoSaveId:"texlite-workspace-layout",direction:"horizontal",className:"work-grid",children:[ps&&i.jsx(n2,{project:a,filesPanel:St,files:pn,visibleEntries:Tf,activeFile:b,activeMainFile:x,rootDocuments:O,selectedFolder:Sc,expandedFolders:Cf,fileDragActive:vf,uploadingFiles:jf,readOnly:Mn,editorFontSize:st.fontSize,outline:nm,sourceCursor:he,uploadInput:Ae,setSelectedFolder:Ji,setExpandedFolders:jc,setMoveEntry:Bc,setMoveName:Tc,setMoveDestination:Lc,setDeleteEntry:Nc,setFileDialogError:kc,setNewFolderName:Ac,setNewFolderOpen:vc,setNewFilePath:wc,setNewFileOpen:Ec,setQuickOpen:de,setProjectSearchOpen:Ce,setFileDragActive:Af,setFilesCollapsed:it,toggleFilesPanel:Vc,uploadFiles:Rc,upload:Rf,openFile:Qi,jumpToSource:sr,syncSourceToPdf:C}),ps&&i.jsx(Ca,{className:"resize-handle",children:i.jsx(hd,{size:12})}),ps&&i.jsx(r2,{project:a,activeFile:b,activeMainFile:x,openTabs:k,content:q,loadedFile:X,readOnly:Mn,comments:zr,focusComment:_f,editorPreferences:st,completionIndex:D,nativeSpellCheck:He.nativeFallback,spellCheckIssues:He.issues,spellCheckJump:He.jump,sourceJump:Ur,collaborativeText:im,collaborationAwareness:Ne.awareness,undoManager:b?Ne.getUndoManager(b):void 0,editorNotice:Zf,activateTab:qc,closeTab:Wt,handleTabKeyDown:fm,updateEditorContent:Ct,setSelection:(v,$,ne)=>ht({selectedText:v,startOffset:$,endOffset:ne}),onCommentClick:v=>{const $=zr.find(ne=>ne.id===v);$&&(Oc({...$}),xt("comments"))},onSpellCheckReplace:rm,onCursor:Ft}),Hc&&i.jsx(l2,{projectId:n,activeMainFile:x,previewTab:W,diagnosticTab:ve,pdfUrl:In,pdfLoadingMode:Gf,pdfLoading:eo,pdfCompiledAt:ir,pdfCompiledLabel:om,pdfTargetLabel:am,pdfDownloadUrl:um,pdfTarget:Gi,pdfViewport:Yi,activeFile:b,sourceCursor:he,compileBusy:Hr,compileLog:to,compileDiagnostics:Yf,compileMessages:no,artifacts:_c,artifactPreview:Xf,artifactLoading:Jf,cleaning:Mc,readOnly:Mn,collaborationSynced:_e,workspaceLayout:ue,showSyncResize:ps&&Hc,diagnosticCount:cm,selectPreviewTab:B,changeWorkspaceLayout:so,onSetNotice:ge,onSetPdfViewport:Xi,syncVisiblePdfToSource:Pe,syncSourceToPdf:C,syncPdfToSource:Ue,canSyncWithPdf:dm,files:pn,jumpToSource:sr,onSetCleanMode:tt,cleanCompile:$c,viewArtifact:em}),i.jsx(C2,{sidePanel:me,onClose:()=>xt(null),project:a,projectId:n,site:t,files:pn,currentUserId:e.id,comments:zr,onFocusComment:v=>Oc({...v}),onToggleComment:zf,onReplyComment:Vf,onEditComment:Hf,onDeleteComment:qf,onEditCommentReply:Kf,onDeleteCommentReply:Wf,dictionaryWords:d,onDictionaryChange:h,editorPreferences:st,onEditorPreferences:Uc,spellCheckCount:He.summary?.total??null,spellCheckUniqueCount:He.summary?.unique??null,spellCheckIndex:He.summary?He.index:-1,onSpellCheckNavigate:He.jumpToIssue,onProject:c})]}),i.jsx(g2,{user:e,project:a,projectId:n,activeFile:b,content:q,maxCitationBibtexBytes:t.maxCitationBibtexBytes,files:pn,directoryEntries:Bf,readOnly:Mn,workspaceLayout:ue,changeWorkspaceLayout:so,resourcePreview:pf,resourcePreviewLoading:Df,setResourcePreview:xc,setResourcePreviewLoading:gf,uploadConflict:kf,setUploadConflict:Sf,uploadFiles:Rc,cleanMode:at,setCleanMode:tt,cleanCompile:$c,newFileOpen:ff,setNewFileOpen:Ec,newFilePath:mf,setNewFilePath:wc,newFolderOpen:Ff,setNewFolderOpen:vc,newFolderName:bf,setNewFolderName:Ac,selectedFolder:Sc,fileDialogError:yf,setFileDialogError:kc,createFile:Lf,createFolder:Nf,moveEntry:Ef,setMoveEntry:Bc,moveName:wf,setMoveName:Tc,moveDestination:xf,setMoveDestination:Lc,movePath:Of,deleteEntry:Zi,setDeleteEntry:Nc,deleteActiveSessions:sm,removePath:Pf,commentOpen:If,setCommentOpen:Pc,selection:We,commentText:Mf,setCommentText:$f,addComment:Uf,shareOpen:ze,setShareOpen:Rt,citationLibraryOpen:Ge,setCitationLibraryOpen:je,insertCitationAtCursor:df,quickOpen:ct,setQuickOpen:de,projectSearchOpen:ft,setProjectSearchOpen:Ce,openFile:Qi,jumpToSource:sr,historyOpen:V,setHistoryOpen:Ye,gitOpen:R,setGitOpen:Q,save:an,permissionDowngrade:An,permissionDowngradeBusy:At,dismissPermissionDowngrade:tr,discardPermissionDraft:tm})]})}function w2(t){const e=[],n=/^\s*\\(part|chapter|section|subsection|subsubsection)\*?(?:\[[^\]]*\])?\{([^}]*)\}/,s={part:0,chapter:0,section:1,subsection:2,subsubsection:3};return t.split(`
|
|
64
|
-
`).forEach((r,o)=>{const a=r.match(n);a&&e.push({level:s[a[1]],title:a[2],line:o+1})}),e}function x2(){const{t}=Qe(),[e,n]=f.useState(null),[s,r]=f.useState(),[o,a]=f.useState(()=>typeof window>"u"?null:Es(window.location.pathname)),[c,u]=f.useState(()=>{if(typeof window>"u")return null;const b=Es(window.location.pathname);return b?Wr(b):null}),[l,d]=f.useState(null),h=()=>{const b=Es(window.location.pathname);if(!b)return;const E={texliteRoute:"dashboard"};window.history.replaceState(E,"",Kp(b)),a(null),u(null)},D=b=>{const E=Wp(window.location.search);if(E){const x={texliteRoute:"project",projectId:E,fromDashboard:!1};window.history.replaceState(x,"",ur(E)),u(Wr(E,{force:!0})),a(E)}else if(new URLSearchParams(window.location.search).has("return")){const x={texliteRoute:"dashboard"};window.history.replaceState(x,"","/")}r(b)};f.useEffect(()=>{const b=Es(window.location.pathname);if(b&&window.location.pathname!==ur(b)){const N={texliteRoute:"project",projectId:b,fromDashboard:!1};window.history.replaceState(N,"",ur(b))}const E=()=>{const N=Es(window.location.pathname);a(N),u(N?Wr(N):null)},x=()=>{d(null),r(null),h()};return window.addEventListener("popstate",E),window.addEventListener("texlite:session-expired",x),()=>{window.removeEventListener("popstate",E),window.removeEventListener("texlite:session-expired",x)}},[]);const p=b=>{const E=ur(b);if(window.location.pathname!==E){const x={texliteRoute:"project",projectId:b,fromDashboard:!0};window.history.pushState(x,"",E)}u(Wr(b)),a(b)},F=()=>{const b=window.history.state;if(Gp(b)&&b.fromDashboard){window.history.back();return}const E={texliteRoute:"dashboard"};window.history.replaceState(E,"","/"),a(null),u(null)};if(f.useEffect(()=>{re("/api/config").then(b=>{n(b),document.title=b.siteName}),re("/api/me",{suppressSessionExpired:!0}).then(({user:b})=>D(b)).catch(()=>{h(),r(null)})},[]),f.useEffect(()=>{if(!s||s.mustChangePassword||o)return;let b=!1,E=null,x=null;const N=()=>{b||Li().then(I=>I.preloadPdfRuntime()).catch(()=>{})},O=window;return O.requestIdleCallback?x=O.requestIdleCallback(N,{timeout:1200}):E=window.setTimeout(N,400),()=>{b=!0,E!==null&&window.clearTimeout(E),x!==null&&O.cancelIdleCallback?.(x)}},[s?.id,s?.mustChangePassword,o]),s===void 0||!e)return i.jsx("div",{className:"center-card",children:t("common.loading")});if(!s)return i.jsx(Qp,{site:e,onLogin:D});if(s.mustChangePassword)return i.jsx(Zp,{site:e,user:s,onChanged:b=>r(b)});if(o)return i.jsx(E2,{site:e,user:s,projectId:o,preload:c?.projectId===o?c:null,onBack:F},o);const y=l?.userId===s.id?l:null;return i.jsx(ag,{site:e,user:s,initialData:y?{projects:y.projects,tags:y.tags,pagination:y.pagination}:null,onDataChange:(b,E,x)=>d({userId:s.id,projects:b,tags:E,pagination:x}),onUser:b=>{(!b||b.id!==s.id)&&d(null),r(b),b||F()},onOpenProject:p})}class v2 extends f.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("Uncaught error in component tree:",e,n)}handleReset=()=>{this.setState({hasError:!1,error:null}),this.props.onReset?.()};render(){return this.state.hasError?typeof this.props.fallback=="function"?this.props.fallback(this.state.error??new Error("Unknown error"),this.handleReset):this.props.fallback?this.props.fallback:i.jsxs("div",{role:"alert",style:{padding:"2rem",margin:"1rem",borderRadius:"8px",backgroundColor:"var(--bg-secondary, #f8f9fa)",border:"1px solid var(--border-color, #e9ecef)",color:"var(--text-primary, #212529)",fontFamily:"system-ui, -apple-system, sans-serif"},children:[i.jsx("h2",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.5rem",color:"#dc3545"},children:this.props.title??Ke.t("errors.boundaryTitle")}),i.jsx("p",{style:{fontSize:"0.9rem",color:"var(--text-secondary, #6c757d)",marginBottom:"1rem"},children:Ke.t("errors.boundaryDescription")}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[i.jsx("button",{type:"button",onClick:this.handleReset,className:"primary",style:{padding:"0.4rem 0.8rem",borderRadius:"4px",cursor:"pointer"},children:Ke.t("errors.boundaryRetry")}),i.jsx("button",{type:"button",onClick:()=>window.location.reload(),style:{padding:"0.4rem 0.8rem",borderRadius:"4px",cursor:"pointer"},children:Ke.t("errors.boundaryReload")})]})]}):this.props.children}}bm.createRoot(document.getElementById("root")).render(i.jsx(f.StrictMode,{children:i.jsx(v2,{children:i.jsx(x2,{})})}));export{c0 as A,ud as C,Ms as F,E0 as G,Cu as K,Et as L,dt as M,si as P,Dd as R,di as S,sn as T,eb as U,re as a,N2 as b,L2 as c,R2 as d,O2 as e,us as f,j2 as g,jn as h,S2 as i,se as j,Ri as k,R0 as l,Va as m,ns as n,gd as o,F0 as p,ss as q,T2 as r,B2 as t};
|