diff --git a/DatenLord.png b/DatenLord.png new file mode 100644 index 0000000..f87d53e Binary files /dev/null and b/DatenLord.png differ diff --git a/assets/cncf-logo-text-9f32c1ea.png b/assets/cncf-logo-text-9f32c1ea.png new file mode 100644 index 0000000..2c09bb4 Binary files /dev/null and b/assets/cncf-logo-text-9f32c1ea.png differ diff --git a/assets/contribute-cover-754f3436.svg b/assets/contribute-cover-754f3436.svg new file mode 100644 index 0000000..2818940 --- /dev/null +++ b/assets/contribute-cover-754f3436.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/contribute-how-f55a255f.svg b/assets/contribute-how-f55a255f.svg new file mode 100644 index 0000000..1c15b88 --- /dev/null +++ b/assets/contribute-how-f55a255f.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/discord-icon-7417d9bb.svg b/assets/discord-icon-7417d9bb.svg new file mode 100644 index 0000000..952f47f --- /dev/null +++ b/assets/discord-icon-7417d9bb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/dot-37a9b3fe.svg b/assets/dot-37a9b3fe.svg new file mode 100644 index 0000000..7a9ffca --- /dev/null +++ b/assets/dot-37a9b3fe.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/dropIcon-525fd0e1.svg b/assets/dropIcon-525fd0e1.svg new file mode 100644 index 0000000..dcdb17d --- /dev/null +++ b/assets/dropIcon-525fd0e1.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/dropIconActive-9bdef1aa.svg b/assets/dropIconActive-9bdef1aa.svg new file mode 100644 index 0000000..daf414d --- /dev/null +++ b/assets/dropIconActive-9bdef1aa.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/dropdown-active-7d279a33.svg b/assets/dropdown-active-7d279a33.svg new file mode 100644 index 0000000..c1625a6 --- /dev/null +++ b/assets/dropdown-active-7d279a33.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/dropdown-close-533c3c65.svg b/assets/dropdown-close-533c3c65.svg new file mode 100644 index 0000000..c57875f --- /dev/null +++ b/assets/dropdown-close-533c3c65.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/footer-background-8643bf7b.svg b/assets/footer-background-8643bf7b.svg new file mode 100644 index 0000000..efd7d38 --- /dev/null +++ b/assets/footer-background-8643bf7b.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/github-icon-7701b5d6.svg b/assets/github-icon-7701b5d6.svg new file mode 100644 index 0000000..256b1a3 --- /dev/null +++ b/assets/github-icon-7701b5d6.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/home-cover-d1b85aac.png b/assets/home-cover-d1b85aac.png new file mode 100644 index 0000000..46042d7 Binary files /dev/null and b/assets/home-cover-d1b85aac.png differ diff --git a/assets/home-feature-e6cc5478.png b/assets/home-feature-e6cc5478.png new file mode 100644 index 0000000..7847209 Binary files /dev/null and b/assets/home-feature-e6cc5478.png differ diff --git a/assets/home-feature-icon-1-633a0944.svg b/assets/home-feature-icon-1-633a0944.svg new file mode 100644 index 0000000..81c584b --- /dev/null +++ b/assets/home-feature-icon-1-633a0944.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/home-feature-icon-2-f72f9c54.svg b/assets/home-feature-icon-2-f72f9c54.svg new file mode 100644 index 0000000..14e807f --- /dev/null +++ b/assets/home-feature-icon-2-f72f9c54.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/home-feature-icon-3-f98e76a4.svg b/assets/home-feature-icon-3-f98e76a4.svg new file mode 100644 index 0000000..b6056de --- /dev/null +++ b/assets/home-feature-icon-3-f98e76a4.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/assets/home-feature-icon-4-25befa9a.svg b/assets/home-feature-icon-4-25befa9a.svg new file mode 100644 index 0000000..38e3457 --- /dev/null +++ b/assets/home-feature-icon-4-25befa9a.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/home-innovation-48569455.svg b/assets/home-innovation-48569455.svg new file mode 100644 index 0000000..b3b4ebc --- /dev/null +++ b/assets/home-innovation-48569455.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/home-introduction-7de62c15.png b/assets/home-introduction-7de62c15.png new file mode 100644 index 0000000..24b4738 Binary files /dev/null and b/assets/home-introduction-7de62c15.png differ diff --git a/assets/home-menu-icon-459d13f5.svg b/assets/home-menu-icon-459d13f5.svg new file mode 100644 index 0000000..26f88ef --- /dev/null +++ b/assets/home-menu-icon-459d13f5.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/image1-177e3788.png b/assets/image1-177e3788.png new file mode 100644 index 0000000..05b00bb Binary files /dev/null and b/assets/image1-177e3788.png differ diff --git a/assets/image1-9be52310.png b/assets/image1-9be52310.png new file mode 100644 index 0000000..b9bd183 Binary files /dev/null and b/assets/image1-9be52310.png differ diff --git a/assets/image2-baebe8ee.png b/assets/image2-baebe8ee.png new file mode 100644 index 0000000..7acd7c0 Binary files /dev/null and b/assets/image2-baebe8ee.png differ diff --git a/assets/image3-a2f91129.png b/assets/image3-a2f91129.png new file mode 100644 index 0000000..7ac3e0d Binary files /dev/null and b/assets/image3-a2f91129.png differ diff --git a/assets/image4-feb06521.png b/assets/image4-feb06521.png new file mode 100644 index 0000000..f360dde Binary files /dev/null and b/assets/image4-feb06521.png differ diff --git a/assets/index-ae5cdb07.js b/assets/index-ae5cdb07.js new file mode 100644 index 0000000..ccce29d --- /dev/null +++ b/assets/index-ae5cdb07.js @@ -0,0 +1,6638 @@ +var oS=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var oX=oS((fX,pd)=>{function sS(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function h2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k={},lS={get exports(){return k},set exports(e){k=e}},hh={},ce={},cS={get exports(){return ce},set exports(e){ce=e}},Qe={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hc=Symbol.for("react.element"),uS=Symbol.for("react.portal"),dS=Symbol.for("react.fragment"),hS=Symbol.for("react.strict_mode"),fS=Symbol.for("react.profiler"),pS=Symbol.for("react.provider"),mS=Symbol.for("react.context"),gS=Symbol.for("react.forward_ref"),yS=Symbol.for("react.suspense"),bS=Symbol.for("react.memo"),wS=Symbol.for("react.lazy"),Ly=Symbol.iterator;function vS(e){return e===null||typeof e!="object"?null:(e=Ly&&e[Ly]||e["@@iterator"],typeof e=="function"?e:null)}var f2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p2=Object.assign,m2={};function Rs(e,t,n){this.props=e,this.context=t,this.refs=m2,this.updater=n||f2}Rs.prototype.isReactComponent={};Rs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Rs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function g2(){}g2.prototype=Rs.prototype;function ig(e,t,n){this.props=e,this.context=t,this.refs=m2,this.updater=n||f2}var ag=ig.prototype=new g2;ag.constructor=ig;p2(ag,Rs.prototype);ag.isPureReactComponent=!0;var Py=Array.isArray,y2=Object.prototype.hasOwnProperty,og={current:null},b2={key:!0,ref:!0,__self:!0,__source:!0};function w2(e,t,n){var r,i={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)y2.call(t,r)&&!b2.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,T=B[R];if(0>>1;Ri(ge,G))$i(Ee,ge)?(B[R]=Ee,B[$]=G,R=$):(B[R]=ge,B[ne]=G,R=ne);else if($i(Ee,G))B[R]=Ee,B[$]=G,R=$;else break e}}return V}function i(B,V){var G=B.sortIndex-V.sortIndex;return G!==0?G:B.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(B){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=B)r(c),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(c)}}function _(B){if(h=!1,x(B),!m)if(n(l)!==null)m=!0,O(A);else{var V=n(c);V!==null&&Y(_,V.startTime-B)}}function A(B,V){m=!1,h&&(h=!1,y(F),F=-1),p=!0;var G=f;try{for(x(V),d=n(l);d!==null&&(!(d.expirationTime>V)||B&&!W());){var R=d.callback;if(typeof R=="function"){d.callback=null,f=d.priorityLevel;var T=R(d.expirationTime<=V);V=e.unstable_now(),typeof T=="function"?d.callback=T:d===n(l)&&r(l),x(V)}else r(l);d=n(l)}if(d!==null)var Q=!0;else{var ne=n(c);ne!==null&&Y(_,ne.startTime-V),Q=!1}return Q}finally{d=null,f=G,p=!1}}var E=!1,N=null,F=-1,q=5,K=-1;function W(){return!(e.unstable_now()-KB||125R?(B.sortIndex=G,t(c,B),n(l)===null&&B===n(c)&&(h?(y(F),F=-1):h=!0,Y(_,G-R))):(B.sortIndex=T,t(l,B),m||p||(m=!0,O(A))),B},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(B){var V=f;return function(){var G=f;f=V;try{return B.apply(this,arguments)}finally{f=G}}}})(x2);(function(e){e.exports=x2})(IS);/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var k2=ce,Qn=wp;function re(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vp=Object.prototype.hasOwnProperty,OS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Fy={},By={};function DS(e){return vp.call(By,e)?!0:vp.call(Fy,e)?!1:OS.test(e)?By[e]=!0:(Fy[e]=!0,!1)}function LS(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function PS(e,t,n,r){if(t===null||typeof t>"u"||LS(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function An(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var hn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hn[e]=new An(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hn[t]=new An(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hn[e]=new An(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hn[e]=new An(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){hn[e]=new An(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hn[e]=new An(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hn[e]=new An(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hn[e]=new An(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hn[e]=new An(e,5,!1,e.toLowerCase(),null,!1,!1)});var lg=/[\-:]([a-z])/g;function cg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(lg,cg);hn[t]=new An(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(lg,cg);hn[t]=new An(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(lg,cg);hn[t]=new An(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hn[e]=new An(e,1,!1,e.toLowerCase(),null,!1,!1)});hn.xlinkHref=new An("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hn[e]=new An(e,1,!1,e.toLowerCase(),null,!0,!0)});function ug(e,t,n,r){var i=hn.hasOwnProperty(t)?hn[t]:null;(i!==null?i.type!==0:r||!(2s||i[o]!==a[s]){var l=` +`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{q0=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?sl(e):""}function zS(e){switch(e.tag){case 5:return sl(e.type);case 16:return sl("Lazy");case 13:return sl("Suspense");case 19:return sl("SuspenseList");case 0:case 2:case 15:return e=H0(e.type,!1),e;case 11:return e=H0(e.type.render,!1),e;case 1:return e=H0(e.type,!0),e;default:return""}}function _p(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fo:return"Fragment";case zo:return"Portal";case xp:return"Profiler";case dg:return"StrictMode";case kp:return"Suspense";case Sp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E2:return(e.displayName||"Context")+".Consumer";case _2:return(e._context.displayName||"Context")+".Provider";case hg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fg:return t=e.displayName||null,t!==null?t:_p(e.type)||"Memo";case ta:t=e._payload,e=e._init;try{return _p(e(t))}catch{}}return null}function FS(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _p(t);case 8:return t===dg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Sa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function T2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function BS(e){var t=T2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yc(e){e._valueTracker||(e._valueTracker=BS(e))}function A2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=T2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function md(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ep(e,t){var n=t.checked;return Ft({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Uy(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Sa(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function R2(e,t){t=t.checked,t!=null&&ug(e,"checked",t,!1)}function Cp(e,t){R2(e,t);var n=Sa(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tp(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tp(e,t.type,Sa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jy(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Tp(e,t,n){(t!=="number"||md(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ll=Array.isArray;function ns(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Xc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ol(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$S=["Webkit","ms","Moz","O"];Object.keys(pl).forEach(function(e){$S.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pl[t]=pl[e]})});function O2(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||pl.hasOwnProperty(e)&&pl[e]?(""+t).trim():t+"px"}function D2(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=O2(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var US=Ft({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mp(e,t){if(t){if(US[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function Np(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ip=null;function pg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Op=null,rs=null,is=null;function Wy(e){if(e=mc(e)){if(typeof Op!="function")throw Error(re(280));var t=e.stateNode;t&&(t=yh(t),Op(e.stateNode,e.type,t))}}function L2(e){rs?is?is.push(e):is=[e]:rs=e}function P2(){if(rs){var e=rs,t=is;if(is=rs=null,Wy(e),t)for(e=0;e>>=0,e===0?32:31-(ZS(e)/JS|0)|0}var Kc=64,Gc=4194304;function cl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s!==0?r=cl(s):(a&=o,a!==0&&(r=cl(a)))}else o=n&~i,o!==0?r=cl(o):a!==0&&(r=cl(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function fc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lr(t),e[t]=n}function r9(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=gl),eb=String.fromCharCode(32),tb=!1;function nx(e,t){switch(e){case"keyup":return N9.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bo=!1;function O9(e,t){switch(e){case"compositionend":return rx(t);case"keypress":return t.which!==32?null:(tb=!0,eb);case"textInput":return e=t.data,e===eb&&tb?null:e;default:return null}}function D9(e,t){if(Bo)return e==="compositionend"||!kg&&nx(e,t)?(e=ex(),Vu=wg=aa=null,Bo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ab(n)}}function sx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lx(){for(var e=window,t=md();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=md(e.document)}return t}function Sg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function q9(e){var t=lx(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&sx(n.ownerDocument.documentElement,n)){if(r!==null&&Sg(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=ob(n,a);var o=ob(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,$o=null,Bp=null,bl=null,$p=!1;function sb(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$p||$o==null||$o!==md(r)||(r=$o,"selectionStart"in r&&Sg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bl&&Bl(bl,r)||(bl=r,r=kd(Bp,"onSelect"),0qo||(e.current=Vp[qo],Vp[qo]=null,qo--)}function wt(e,t){qo++,Vp[qo]=e.current,e.current=t}var _a={},wn=Ma(_a),Bn=Ma(!1),ro=_a;function ws(e,t){var n=e.type.contextTypes;if(!n)return _a;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function $n(e){return e=e.childContextTypes,e!=null}function _d(){Ct(Bn),Ct(wn)}function pb(e,t,n){if(wn.current!==_a)throw Error(re(168));wt(wn,t),wt(Bn,n)}function yx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(re(108,FS(e)||"Unknown",i));return Ft({},n,r)}function Ed(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_a,ro=wn.current,wt(wn,e),wt(Bn,Bn.current),!0}function mb(e,t,n){var r=e.stateNode;if(!r)throw Error(re(169));n?(e=yx(e,t,ro),r.__reactInternalMemoizedMergedChildContext=e,Ct(Bn),Ct(wn),wt(wn,e)):Ct(Bn),wt(Bn,n)}var xi=null,bh=!1,af=!1;function bx(e){xi===null?xi=[e]:xi.push(e)}function t_(e){bh=!0,bx(e)}function Na(){if(!af&&xi!==null){af=!0;var e=0,t=dt;try{var n=xi;for(dt=1;e>=o,i-=o,Si=1<<32-Lr(t)+i|n<F?(q=N,N=null):q=N.sibling;var K=f(y,N,x[F],_);if(K===null){N===null&&(N=q);break}e&&N&&K.alternate===null&&t(y,N),w=a(K,w,F),E===null?A=K:E.sibling=K,E=K,N=q}if(F===x.length)return n(y,N),Mt&&ja(y,F),A;if(N===null){for(;FF?(q=N,N=null):q=N.sibling;var W=f(y,N,K.value,_);if(W===null){N===null&&(N=q);break}e&&N&&W.alternate===null&&t(y,N),w=a(W,w,F),E===null?A=W:E.sibling=W,E=W,N=q}if(K.done)return n(y,N),Mt&&ja(y,F),A;if(N===null){for(;!K.done;F++,K=x.next())K=d(y,K.value,_),K!==null&&(w=a(K,w,F),E===null?A=K:E.sibling=K,E=K);return Mt&&ja(y,F),A}for(N=r(y,N);!K.done;F++,K=x.next())K=p(N,y,F,K.value,_),K!==null&&(e&&K.alternate!==null&&N.delete(K.key===null?F:K.key),w=a(K,w,F),E===null?A=K:E.sibling=K,E=K);return e&&N.forEach(function(X){return t(y,X)}),Mt&&ja(y,F),A}function v(y,w,x,_){if(typeof x=="object"&&x!==null&&x.type===Fo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Vc:e:{for(var A=x.key,E=w;E!==null;){if(E.key===A){if(A=x.type,A===Fo){if(E.tag===7){n(y,E.sibling),w=i(E,x.props.children),w.return=y,y=w;break e}}else if(E.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===ta&&kb(A)===E.type){n(y,E.sibling),w=i(E,x.props),w.ref=Zs(y,E,x),w.return=y,y=w;break e}n(y,E);break}else t(y,E);E=E.sibling}x.type===Fo?(w=eo(x.props.children,y.mode,_,x.key),w.return=y,y=w):(_=ed(x.type,x.key,x.props,null,y.mode,_),_.ref=Zs(y,w,x),_.return=y,y=_)}return o(y);case zo:e:{for(E=x.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),w=i(w,x.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else t(y,w);w=w.sibling}w=ff(x,y.mode,_),w.return=y,y=w}return o(y);case ta:return E=x._init,v(y,w,E(x._payload),_)}if(ll(x))return m(y,w,x,_);if(Ys(x))return h(y,w,x,_);ru(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),w=i(w,x),w.return=y,y=w):(n(y,w),w=hf(x,y.mode,_),w.return=y,y=w),o(y)):n(y,w)}return v}var xs=Cx(!0),Tx=Cx(!1),gc={},ei=Ma(gc),ql=Ma(gc),Hl=Ma(gc);function Xa(e){if(e===gc)throw Error(re(174));return e}function Ig(e,t){switch(wt(Hl,t),wt(ql,e),wt(ei,gc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rp(t,e)}Ct(ei),wt(ei,t)}function ks(){Ct(ei),Ct(ql),Ct(Hl)}function Ax(e){Xa(Hl.current);var t=Xa(ei.current),n=Rp(t,e.type);t!==n&&(wt(ql,e),wt(ei,n))}function Og(e){ql.current===e&&(Ct(ei),Ct(ql))}var Dt=Ma(0);function Nd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var of=[];function Dg(){for(var e=0;en?n:4,e(!0);var r=sf.transition;sf.transition={};try{e(!1),t()}finally{dt=n,sf.transition=r}}function Hx(){return mr().memoizedState}function a_(e,t,n){var r=ba(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wx(e))Vx(t,n);else if(n=kx(e,t,n,r),n!==null){var i=Cn();Pr(n,e,r,i),Yx(n,t,r)}}function o_(e,t,n){var r=ba(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wx(e))Vx(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Fr(s,o)){var l=t.interleaved;l===null?(i.next=i,Mg(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=kx(e,t,i,r),n!==null&&(i=Cn(),Pr(n,e,r,i),Yx(n,t,r))}}function Wx(e){var t=e.alternate;return e===zt||t!==null&&t===zt}function Vx(e,t){wl=Id=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gg(e,n)}}var Od={readContext:pr,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useInsertionEffect:pn,useLayoutEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useMutableSource:pn,useSyncExternalStore:pn,useId:pn,unstable_isNewReconciler:!1},s_={readContext:pr,useCallback:function(e,t){return Vr().memoizedState=[e,t===void 0?null:t],e},useContext:pr,useEffect:_b,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gu(4194308,4,Bx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gu(4,2,e,t)},useMemo:function(e,t){var n=Vr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=a_.bind(null,zt,e),[r.memoizedState,e]},useRef:function(e){var t=Vr();return e={current:e},t.memoizedState=e},useState:Sb,useDebugValue:Bg,useDeferredValue:function(e){return Vr().memoizedState=e},useTransition:function(){var e=Sb(!1),t=e[0];return e=i_.bind(null,e[1]),Vr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=zt,i=Vr();if(Mt){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),sn===null)throw Error(re(349));ao&30||Nx(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,_b(Ox.bind(null,r,a,e),[e]),r.flags|=2048,Yl(9,Ix.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Vr(),t=sn.identifierPrefix;if(Mt){var n=_i,r=Si;n=(r&~(1<<32-Lr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Wl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Gr]=t,e[jl]=r,n3(e,t,!1,!1),t.stateNode=e;e:{switch(o=Np(n,r),n){case"dialog":St("cancel",e),St("close",e),i=r;break;case"iframe":case"object":case"embed":St("load",e),i=r;break;case"video":case"audio":for(i=0;i_s&&(t.flags|=128,r=!0,Js(a,!1),t.lanes=4194304)}else{if(!r)if(e=Nd(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Js(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Mt)return mn(t),null}else 2*Ht()-a.renderingStartTime>_s&&n!==1073741824&&(t.flags|=128,r=!0,Js(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ht(),t.sibling=null,n=Dt.current,wt(Dt,r?n&1|2:n&1),t):(mn(t),null);case 22:case 23:return Wg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Wn&1073741824&&(mn(t),t.subtreeFlags&6&&(t.flags|=8192)):mn(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function m_(e,t){switch(Eg(t),t.tag){case 1:return $n(t.type)&&_d(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ks(),Ct(Bn),Ct(wn),Dg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Og(t),null;case 13:if(Ct(Dt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));vs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ct(Dt),null;case 4:return ks(),null;case 10:return Rg(t.type._context),null;case 22:case 23:return Wg(),null;case 24:return null;default:return null}}var au=!1,gn=!1,g_=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Yo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Bt(e,t,r)}else n.current=null}function im(e,t,n){try{n()}catch(r){Bt(e,t,r)}}var Ob=!1;function y_(e,t){if(Up=vd,e=lx(),Sg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=o+i),d!==a||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===i&&(s=o),f===a&&++u===r&&(l=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(jp={focusedElem:e,selectionRange:n},vd=!1,ve=t;ve!==null;)if(t=ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ve=e;else for(;ve!==null;){t=ve;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var h=m.memoizedProps,v=m.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?h:Ar(t.type,h),v);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(_){Bt(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,ve=e;break}ve=t.return}return m=Ob,Ob=!1,m}function vl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&im(t,n,a)}i=i.next}while(i!==r)}}function xh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function am(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function a3(e){var t=e.alternate;t!==null&&(e.alternate=null,a3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gr],delete t[jl],delete t[Wp],delete t[J9],delete t[e_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function o3(e){return e.tag===5||e.tag===3||e.tag===4}function Db(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||o3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function om(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Sd));else if(r!==4&&(e=e.child,e!==null))for(om(e,t,n),e=e.sibling;e!==null;)om(e,t,n),e=e.sibling}function sm(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(sm(e,t,n),e=e.sibling;e!==null;)sm(e,t,n),e=e.sibling}var un=null,Rr=!1;function Gi(e,t,n){for(n=n.child;n!==null;)s3(e,t,n),n=n.sibling}function s3(e,t,n){if(Jr&&typeof Jr.onCommitFiberUnmount=="function")try{Jr.onCommitFiberUnmount(fh,n)}catch{}switch(n.tag){case 5:gn||Yo(n,t);case 6:var r=un,i=Rr;un=null,Gi(e,t,n),un=r,Rr=i,un!==null&&(Rr?(e=un,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):un.removeChild(n.stateNode));break;case 18:un!==null&&(Rr?(e=un,n=n.stateNode,e.nodeType===8?rf(e.parentNode,n):e.nodeType===1&&rf(e,n),zl(e)):rf(un,n.stateNode));break;case 4:r=un,i=Rr,un=n.stateNode.containerInfo,Rr=!0,Gi(e,t,n),un=r,Rr=i;break;case 0:case 11:case 14:case 15:if(!gn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&im(n,t,o),i=i.next}while(i!==r)}Gi(e,t,n);break;case 1:if(!gn&&(Yo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Bt(n,t,s)}Gi(e,t,n);break;case 21:Gi(e,t,n);break;case 22:n.mode&1?(gn=(r=gn)||n.memoizedState!==null,Gi(e,t,n),gn=r):Gi(e,t,n);break;default:Gi(e,t,n)}}function Lb(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new g_),t.forEach(function(r){var i=C_.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Cr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~a}if(r=i,r=Ht()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*w_(r/1960))-r,10e?16:e,oa===null)var r=!1;else{if(e=oa,oa=null,Pd=0,rt&6)throw Error(re(331));var i=rt;for(rt|=4,ve=e.current;ve!==null;){var a=ve,o=a.child;if(ve.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lHt()-qg?Ja(e,0):jg|=n),Un(e,t)}function m3(e,t){t===0&&(e.mode&1?(t=Gc,Gc<<=1,!(Gc&130023424)&&(Gc=4194304)):t=1);var n=Cn();e=Li(e,t),e!==null&&(fc(e,t,n),Un(e,n))}function E_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),m3(e,n)}function C_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(re(314))}r!==null&&r.delete(t),m3(e,n)}var g3;g3=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bn.current)zn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return zn=!1,f_(e,t,n);zn=!!(e.flags&131072)}else zn=!1,Mt&&t.flags&1048576&&wx(t,Td,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qu(e,t),e=t.pendingProps;var i=ws(t,wn.current);os(t,n),i=Pg(null,t,r,e,i,n);var a=zg();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$n(r)?(a=!0,Ed(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ng(t),i.updater=wh,t.stateNode=i,i._reactInternals=t,Qp(t,r,e,n),t=em(null,t,r,!0,a,n)):(t.tag=0,Mt&&a&&_g(t),kn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qu(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=A_(r),e=Ar(r,e),i){case 0:t=Jp(null,t,r,e,n);break e;case 1:t=Mb(null,t,r,e,n);break e;case 11:t=Ab(null,t,r,e,n);break e;case 14:t=Rb(null,t,r,Ar(r.type,e),n);break e}throw Error(re(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ar(r,i),Jp(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ar(r,i),Mb(e,t,r,i,n);case 3:e:{if(Jx(t),e===null)throw Error(re(387));r=t.pendingProps,a=t.memoizedState,i=a.element,Sx(e,t),Md(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Ss(Error(re(423)),t),t=Nb(e,t,r,n,i);break e}else if(r!==i){i=Ss(Error(re(424)),t),t=Nb(e,t,r,n,i);break e}else for(Xn=ma(t.stateNode.containerInfo.firstChild),Kn=t,Mt=!0,Nr=null,n=Tx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vs(),r===i){t=Pi(e,t,n);break e}kn(e,t,r,n)}t=t.child}return t;case 5:return Ax(t),e===null&&Xp(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,qp(r,i)?o=null:a!==null&&qp(r,a)&&(t.flags|=32),Zx(e,t),kn(e,t,o,n),t.child;case 6:return e===null&&Xp(t),null;case 13:return e3(e,t,n);case 4:return Ig(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xs(t,null,r,n):kn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ar(r,i),Ab(e,t,r,i,n);case 7:return kn(e,t,t.pendingProps,n),t.child;case 8:return kn(e,t,t.pendingProps.children,n),t.child;case 12:return kn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,wt(Ad,r._currentValue),r._currentValue=o,a!==null)if(Fr(a.value,o)){if(a.children===i.children&&!Bn.current){t=Pi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(a.tag===1){l=Ai(-1,n&-n),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Kp(a.return,n,t),s.lanes|=n;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(re(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Kp(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}kn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,os(t,n),i=pr(i),r=r(i),t.flags|=1,kn(e,t,r,n),t.child;case 14:return r=t.type,i=Ar(r,t.pendingProps),i=Ar(r.type,i),Rb(e,t,r,i,n);case 15:return Gx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ar(r,i),Qu(e,t),t.tag=1,$n(r)?(e=!0,Ed(t)):e=!1,os(t,n),Ex(t,r,i),Qp(t,r,i,n),em(null,t,r,!0,e,n);case 19:return t3(e,t,n);case 22:return Qx(e,t,n)}throw Error(re(156,t.tag))};function y3(e,t){return q2(e,t)}function T_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dr(e,t,n,r){return new T_(e,t,n,r)}function Yg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function A_(e){if(typeof e=="function")return Yg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hg)return 11;if(e===fg)return 14}return 2}function wa(e,t){var n=e.alternate;return n===null?(n=dr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ed(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")Yg(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Fo:return eo(n.children,i,a,t);case dg:o=8,i|=8;break;case xp:return e=dr(12,n,t,i|2),e.elementType=xp,e.lanes=a,e;case kp:return e=dr(13,n,t,i),e.elementType=kp,e.lanes=a,e;case Sp:return e=dr(19,n,t,i),e.elementType=Sp,e.lanes=a,e;case C2:return Sh(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _2:o=10;break e;case E2:o=9;break e;case hg:o=11;break e;case fg:o=14;break e;case ta:o=16,r=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=dr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function eo(e,t,n,r){return e=dr(7,e,r,t),e.lanes=n,e}function Sh(e,t,n,r){return e=dr(22,e,r,t),e.elementType=C2,e.lanes=n,e.stateNode={isHidden:!1},e}function hf(e,t,n){return e=dr(6,e,null,t),e.lanes=n,e}function ff(e,t,n){return t=dr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function R_(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=V0(0),this.expirationTimes=V0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=V0(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Xg(e,t,n,r,i,a,o,s,l){return e=new R_(e,t,n,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=dr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ng(a),e}function M_(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Zn})(NS);var qb=bp;yp.createRoot=qb.createRoot,yp.hydrateRoot=qb.hydrateRoot;/** + * @remix-run/router v1.4.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function nt(){return nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function lo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function P_(){return Math.random().toString(36).substr(2,8)}function Wb(e,t){return{usr:e.state,key:e.key,idx:t}}function Kl(e,t,n,r){return n===void 0&&(n=null),nt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?si(t):t,{state:n,key:t&&t.key||r||P_()})}function zi(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function si(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function z_(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=jt.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(nt({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function d(){s=jt.Pop;let v=u(),y=v==null?null:v-c;c=v,l&&l({action:s,location:h.location,delta:y})}function f(v,y){s=jt.Push;let w=Kl(h.location,v,y);n&&n(w,v),c=u()+1;let x=Wb(w,c),_=h.createHref(w);try{o.pushState(x,"",_)}catch{i.location.assign(_)}a&&l&&l({action:s,location:h.location,delta:1})}function p(v,y){s=jt.Replace;let w=Kl(h.location,v,y);n&&n(w,v),c=u();let x=Wb(w,c),_=h.createHref(w);o.replaceState(x,"",_),a&&l&&l({action:s,location:h.location,delta:0})}function m(v){let y=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof v=="string"?v:zi(v);return He(y,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,y)}let h={get action(){return s},get location(){return e(i,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Hb,d),l=v,()=>{i.removeEventListener(Hb,d),l=null}},createHref(v){return t(i,v)},createURL:m,encodeLocation(v){let y=m(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(v){return o.go(v)}};return h}var Jt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Jt||(Jt={}));const F_=new Set(["lazy","caseSensitive","path","id","index","children"]);function B_(e){return e.index===!0}function x3(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,a)=>{let o=[...n,a],s=typeof i.id=="string"?i.id:o.join("-");if(He(i.index!==!0||!i.children,"Cannot specify children on an index route"),He(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),B_(i)){let l=nt({},i,{hasErrorBoundary:t(i),id:s});return r[s]=l,l}else{let l=nt({},i,{id:s,hasErrorBoundary:t(i),children:void 0});return r[s]=l,i.children&&(l.children=x3(i.children,t,o,r)),l}})}function Ko(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?si(t):t,i=yc(r.pathname||"/",n);if(i==null)return null;let a=k3(e);$_(a);let o=null;for(let s=0;o==null&&s{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(He(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Ri([r,l.relativePath]),u=n.concat(l);a.children&&a.children.length>0&&(He(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),k3(a.children,t,u,c)),!(a.path==null&&!a.index)&&t.push({path:c,score:Y_(c,a.index),routesMeta:u})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of S3(a.path))i(a,o,l)}),t}function S3(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=S3(r.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function $_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:X_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const U_=/^:\w+$/,j_=3,q_=2,H_=1,W_=10,V_=-2,Vb=e=>e==="*";function Y_(e,t){let n=e.split("/"),r=n.length;return n.some(Vb)&&(r+=V_),t&&(r+=q_),n.filter(i=>!Vb(i)).reduce((i,a)=>i+(U_.test(a)?j_:a===""?H_:W_),r)}function X_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function K_(e,t){let{routesMeta:n}=e,r={},i="/",a=[];for(let o=0;o{if(u==="*"){let f=s[d]||"";o=a.slice(0,a.length-f.length).replace(/(.)\/+$/,"$1")}return c[u]=J_(s[d]||"",u),c},{}),pathname:a,pathnameBase:o,pattern:e}}function Q_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),lo(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Z_(e){try{return decodeURI(e)}catch(t){return lo(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function J_(e,t){try{return decodeURIComponent(e)}catch(n){return lo(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function yc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function eE(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?si(e):e;return{pathname:n?n.startsWith("/")?n:tE(n,t):t,search:rE(r),hash:iE(i)}}function tE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function pf(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ah(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Zg(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=si(e):(i=nt({},e),He(!i.pathname||!i.pathname.includes("?"),pf("?","pathname","search",i)),He(!i.pathname||!i.pathname.includes("#"),pf("#","pathname","hash",i)),He(!i.search||!i.search.includes("#"),pf("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(r||o==null)s=n;else{let d=t.length-1;if(o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}s=d>=0?t[d]:"/"}let l=eE(i,s),c=o&&o!=="/"&&o.endsWith("/"),u=(a||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ri=e=>e.join("/").replace(/\/\/+/g,"/"),nE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Yb extends Error{}class aE{constructor(t,n){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],He(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let r;this.abortPromise=new Promise((a,o)=>r=o),this.controller=new AbortController;let i=()=>r(new Yb("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",i),this.controller.signal.addEventListener("abort",i),this.data=Object.entries(t).reduce((a,o)=>{let[s,l]=o;return Object.assign(a,{[s]:this.trackPromise(s,l)})},{}),this.done&&this.unlistenAbortSignal(),this.init=n}trackPromise(t,n){if(!(n instanceof Promise))return n;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let r=Promise.race([n,this.abortPromise]).then(i=>this.onSettle(r,t,null,i),i=>this.onSettle(r,t,i));return r.catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(t,n,r,i){return this.controller.signal.aborted&&r instanceof Yb?(this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>r}),Promise.reject(r)):(this.pendingKeysSet.delete(n),this.done&&this.unlistenAbortSignal(),r?(Object.defineProperty(t,"_error",{get:()=>r}),this.emit(!1,n),Promise.reject(r)):(Object.defineProperty(t,"_data",{get:()=>i}),this.emit(!1,n),i))}emit(t,n){this.subscribers.forEach(r=>r(t,n))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,n)=>this.pendingKeysSet.delete(n)),this.emit(!0)}async resolveData(t){let n=!1;if(!this.done){let r=()=>this.cancel();t.addEventListener("abort",r),n=await new Promise(i=>{this.subscribe(a=>{t.removeEventListener("abort",r),(a||this.done)&&i(a)})})}return n}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return He(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,n)=>{let[r,i]=n;return Object.assign(t,{[r]:sE(i)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function oE(e){return e instanceof Promise&&e._tracked===!0}function sE(e){if(!oE(e))return e;if(e._error)throw e._error;return e._data}class Jg{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function _3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const E3=["post","put","patch","delete"],lE=new Set(E3),cE=["get",...E3],uE=new Set(cE),dE=new Set([301,302,303,307,308]),hE=new Set([307,308]),mf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fE={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Xb={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},C3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,T3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pE=!T3,mE=e=>!!e.hasErrorBoundary;function gE(e){He(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let t=e.detectErrorBoundary||mE,n={},r=x3(e.routes,t,void 0,n),i,a=null,o=new Set,s=null,l=null,c=null,u=e.hydrationData!=null,d=Ko(r,e.history.location,e.basename),f=null;if(d==null){let M=Yr(404,{pathname:e.history.location.pathname}),{matches:z,route:H}=ew(r);d=z,f={[H.id]:M}}let p=!d.some(M=>M.route.lazy)&&(!d.some(M=>M.route.loader)||e.hydrationData!=null),m,h={historyAction:e.history.action,location:e.history.location,matches:d,initialized:p,navigation:mf,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||f,fetchers:new Map,blockers:new Map},v=jt.Pop,y=!1,w,x=!1,_=!1,A=[],E=[],N=new Map,F=0,q=-1,K=new Map,W=new Set,X=new Map,ue=new Map,fe=new Map,Ce=!1;function O(){if(a=e.history.listen(H=>{let{action:le,location:ye,delta:Te}=H;if(Ce){Ce=!1;return}lo(fe.size===0||Te!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ke=an({currentLocation:h.location,nextLocation:ye,historyAction:le});if(ke&&Te!=null){Ce=!0,e.history.go(Te*-1),cn(ke,{state:"blocked",location:ye,proceed(){cn(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),e.history.go(Te)},reset(){Ie(ke),V({blockers:new Map(m.state.blockers)})}});return}return Q(le,ye)}),h.initialized)return m;let M=h.matches.filter(H=>H.route.lazy);if(M.length===0)return Q(jt.Pop,h.location),m;let z=M.map(H=>hm(H.route,t,n));return Promise.all(z).then(()=>{!h.matches.some(le=>le.route.loader)||e.hydrationData!=null?V({initialized:!0}):Q(jt.Pop,h.location)}),m}function Y(){a&&a(),o.clear(),w&&w.abort(),h.fetchers.forEach((M,z)=>et(z)),h.blockers.forEach((M,z)=>Ie(z))}function B(M){return o.add(M),()=>o.delete(M)}function V(M){h=nt({},h,M),o.forEach(z=>z(h))}function G(M,z){var H,le;let ye=h.actionData!=null&&h.navigation.formMethod!=null&&wi(h.navigation.formMethod)&&h.navigation.state==="loading"&&((H=M.state)==null?void 0:H._isRedirect)!==!0,Te;z.actionData?Object.keys(z.actionData).length>0?Te=z.actionData:Te=null:ye?Te=h.actionData:Te=null;let ke=z.loaderData?Jb(h.loaderData,z.loaderData,z.matches||[],z.errors):h.loaderData;for(let[_e]of fe)Ie(_e);let ze=y===!0||h.navigation.formMethod!=null&&wi(h.navigation.formMethod)&&((le=M.state)==null?void 0:le._isRedirect)!==!0;i&&(r=i,i=void 0),V(nt({},z,{actionData:Te,loaderData:ke,historyAction:v,location:M,initialized:!0,navigation:mf,revalidation:"idle",restoreScrollPosition:xe(M,z.matches||h.matches),preventScrollReset:ze,blockers:new Map(h.blockers)})),x||v===jt.Pop||(v===jt.Push?e.history.push(M,M.state):v===jt.Replace&&e.history.replace(M,M.state)),v=jt.Pop,y=!1,x=!1,_=!1,A=[],E=[]}async function R(M,z){if(typeof M=="number"){e.history.go(M);return}let{path:H,submission:le,error:ye}=Kb(M,z),Te=h.location,ke=Kl(h.location,H,z&&z.state);ke=nt({},ke,e.history.encodeLocation(ke));let ze=z&&z.replace!=null?z.replace:void 0,_e=jt.Push;ze===!0?_e=jt.Replace:ze===!1||le!=null&&wi(le.formMethod)&&le.formAction===h.location.pathname+h.location.search&&(_e=jt.Replace);let Ke=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Ze=an({currentLocation:Te,nextLocation:ke,historyAction:_e});if(Ze){cn(Ze,{state:"blocked",location:ke,proceed(){cn(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ke}),R(M,z)},reset(){Ie(Ze),V({blockers:new Map(h.blockers)})}});return}return await Q(_e,ke,{submission:le,pendingError:ye,preventScrollReset:Ke,replace:z&&z.replace})}function T(){if(Ae(),V({revalidation:"loading"}),h.navigation.state!=="submitting"){if(h.navigation.state==="idle"){Q(h.historyAction,h.location,{startUninterruptedRevalidation:!0});return}Q(v||h.historyAction,h.navigation.location,{overrideNavigation:h.navigation})}}async function Q(M,z,H){w&&w.abort(),w=null,v=M,x=(H&&H.startUninterruptedRevalidation)===!0,ee(h.location,h.matches),y=(H&&H.preventScrollReset)===!0;let le=i||r,ye=H&&H.overrideNavigation,Te=Ko(le,z,e.basename);if(!Te){let Ut=Yr(404,{pathname:z.pathname}),{matches:qr,route:Er}=ew(le);$t(),G(z,{matches:qr,loaderData:{},errors:{[Er.id]:Ut}});return}if(xE(h.location,z)&&!(H&&H.submission&&wi(H.submission.formMethod))){G(z,{matches:Te});return}w=new AbortController;let ke=nl(e.history,z,w.signal,H&&H.submission),ze,_e;if(H&&H.pendingError)_e={[Go(Te).route.id]:H.pendingError};else if(H&&H.submission&&wi(H.submission.formMethod)){let Ut=await ne(ke,z,H.submission,Te,{replace:H.replace});if(Ut.shortCircuited)return;ze=Ut.pendingActionData,_e=Ut.pendingActionError,ye=nt({state:"loading",location:z},H.submission),ke=new Request(ke.url,{signal:ke.signal})}let{shortCircuited:Ke,loaderData:Ze,errors:kt}=await ge(ke,z,Te,ye,H&&H.submission,H&&H.replace,ze,_e);Ke||(w=null,G(z,nt({matches:Te},ze?{actionData:ze}:{},{loaderData:Ze,errors:kt})))}async function ne(M,z,H,le,ye){Ae();let Te=nt({state:"submitting",location:z},H);V({navigation:Te});let ke,ze=fm(le,z);if(!ze.route.action&&!ze.route.lazy)ke={type:Jt.error,error:Yr(405,{method:M.method,pathname:z.pathname,routeId:ze.route.id})};else if(ke=await tl("action",M,ze,le,n,t,m.basename),M.signal.aborted)return{shortCircuited:!0};if(ls(ke)){let _e;return ye&&ye.replace!=null?_e=ye.replace:_e=ke.location===h.location.pathname+h.location.search,await Ne(h,ke,{submission:H,replace:_e}),{shortCircuited:!0}}if(Sl(ke)){let _e=Go(le,ze.route.id);return(ye&&ye.replace)!==!0&&(v=jt.Push),{pendingActionData:{},pendingActionError:{[_e.route.id]:ke.error}}}if(Ka(ke))throw Yr(400,{type:"defer-action"});return{pendingActionData:{[ze.route.id]:ke.data}}}async function ge(M,z,H,le,ye,Te,ke,ze){let _e=le;_e||(_e=nt({state:"loading",location:z,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},ye));let Ke=ye||(_e.formMethod&&_e.formAction&&_e.formData&&_e.formEncType?{formMethod:_e.formMethod,formAction:_e.formAction,formData:_e.formData,formEncType:_e.formEncType}:void 0),Ze=i||r,[kt,Ut]=Gb(e.history,h,H,Ke,z,_,A,E,X,Ze,e.basename,ke,ze);if($t(fn=>!(H&&H.some(Hr=>Hr.route.id===fn))||kt&&kt.some(Hr=>Hr.route.id===fn)),kt.length===0&&Ut.length===0)return G(z,nt({matches:H,loaderData:{},errors:ze||null},ke?{actionData:ke}:{})),{shortCircuited:!0};if(!x){Ut.forEach(Hr=>{let Pa=h.fetchers.get(Hr.key),Hc={state:"loading",data:Pa&&Pa.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};h.fetchers.set(Hr.key,Hc)});let fn=ke||h.actionData;V(nt({navigation:_e},fn?Object.keys(fn).length===0?{actionData:null}:{actionData:fn}:{},Ut.length>0?{fetchers:new Map(h.fetchers)}:{}))}q=++F,Ut.forEach(fn=>N.set(fn.key,w));let{results:qr,loaderResults:Er,fetcherResults:Vs}=await Ue(h.matches,H,kt,Ut,M);if(M.signal.aborted)return{shortCircuited:!0};Ut.forEach(fn=>N.delete(fn.key));let jc=tw(qr);if(jc)return await Ne(h,jc,{replace:Te}),{shortCircuited:!0};let{loaderData:qc,errors:Co}=Zb(h,H,kt,Er,ze,Ut,Vs,ue);ue.forEach((fn,Hr)=>{fn.subscribe(Pa=>{(Pa||fn.done)&&ue.delete(Hr)})}),de();let F0=lt(q);return nt({loaderData:qc,errors:Co},F0||Ut.length>0?{fetchers:new Map(h.fetchers)}:{})}function $(M){return h.fetchers.get(M)||fE}function Ee(M,z,H,le){if(pE)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");N.has(M)&&$e(M);let Te=Ko(i||r,H,e.basename);if(!Te){pt(M,z,Yr(404,{pathname:H}));return}let{path:ke,submission:ze}=Kb(H,le,!0),_e=fm(Te,ke);if(y=(le&&le.preventScrollReset)===!0,ze&&wi(ze.formMethod)){J(M,z,ke,_e,Te,ze);return}X.set(M,{routeId:z,path:ke}),Se(M,z,ke,_e,Te,ze)}async function J(M,z,H,le,ye,Te){if(Ae(),X.delete(M),!le.route.action&&!le.route.lazy){let pi=Yr(405,{method:Te.formMethod,pathname:H,routeId:z});pt(M,z,pi);return}let ke=h.fetchers.get(M),ze=nt({state:"submitting"},Te,{data:ke&&ke.data," _hasFetcherDoneAnything ":!0});h.fetchers.set(M,ze),V({fetchers:new Map(h.fetchers)});let _e=new AbortController,Ke=nl(e.history,H,_e.signal,Te);N.set(M,_e);let Ze=await tl("action",Ke,le,ye,n,t,m.basename);if(Ke.signal.aborted){N.get(M)===_e&&N.delete(M);return}if(ls(Ze)){N.delete(M),W.add(M);let pi=nt({state:"loading"},Te,{data:void 0," _hasFetcherDoneAnything ":!0});return h.fetchers.set(M,pi),V({fetchers:new Map(h.fetchers)}),Ne(h,Ze,{isFetchActionRedirect:!0})}if(Sl(Ze)){pt(M,z,Ze.error);return}if(Ka(Ze))throw Yr(400,{type:"defer-action"});let kt=h.navigation.location||h.location,Ut=nl(e.history,kt,_e.signal),qr=i||r,Er=h.navigation.state!=="idle"?Ko(qr,h.navigation.location,e.basename):h.matches;He(Er,"Didn't find any matches after fetcher action");let Vs=++F;K.set(M,Vs);let jc=nt({state:"loading",data:Ze.data},Te,{" _hasFetcherDoneAnything ":!0});h.fetchers.set(M,jc);let[qc,Co]=Gb(e.history,h,Er,Te,kt,_,A,E,X,qr,e.basename,{[le.route.id]:Ze.data},void 0);Co.filter(pi=>pi.key!==M).forEach(pi=>{let $0=pi.key,Dy=h.fetchers.get($0),aS={state:"loading",data:Dy&&Dy.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};h.fetchers.set($0,aS),N.set($0,_e)}),V({fetchers:new Map(h.fetchers)});let{results:F0,loaderResults:fn,fetcherResults:Hr}=await Ue(h.matches,Er,qc,Co,Ut);if(_e.signal.aborted)return;K.delete(M),N.delete(M),Co.forEach(pi=>N.delete(pi.key));let Pa=tw(F0);if(Pa)return Ne(h,Pa);let{loaderData:Hc,errors:B0}=Zb(h,h.matches,qc,fn,void 0,Co,Hr,ue),rS={state:"idle",data:Ze.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};h.fetchers.set(M,rS);let iS=lt(Vs);h.navigation.state==="loading"&&Vs>q?(He(v,"Expected pending action"),w&&w.abort(),G(h.navigation.location,{matches:Er,loaderData:Hc,errors:B0,fetchers:new Map(h.fetchers)})):(V(nt({errors:B0,loaderData:Jb(h.loaderData,Hc,Er,B0)},iS?{fetchers:new Map(h.fetchers)}:{})),_=!1)}async function Se(M,z,H,le,ye,Te){let ke=h.fetchers.get(M),ze=nt({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Te,{data:ke&&ke.data," _hasFetcherDoneAnything ":!0});h.fetchers.set(M,ze),V({fetchers:new Map(h.fetchers)});let _e=new AbortController,Ke=nl(e.history,H,_e.signal);N.set(M,_e);let Ze=await tl("loader",Ke,le,ye,n,t,m.basename);if(Ka(Ze)&&(Ze=await N3(Ze,Ke.signal,!0)||Ze),N.get(M)===_e&&N.delete(M),Ke.signal.aborted)return;if(ls(Ze)){await Ne(h,Ze);return}if(Sl(Ze)){let Ut=Go(h.matches,z);h.fetchers.delete(M),V({fetchers:new Map(h.fetchers),errors:{[Ut.route.id]:Ze.error}});return}He(!Ka(Ze),"Unhandled fetcher deferred data");let kt={state:"idle",data:Ze.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};h.fetchers.set(M,kt),V({fetchers:new Map(h.fetchers)})}async function Ne(M,z,H){var le;let{submission:ye,replace:Te,isFetchActionRedirect:ke}=H===void 0?{}:H;z.revalidate&&(_=!0);let ze=Kl(M.location,z.location,nt({_isRedirect:!0},ke?{_isFetchActionRedirect:!0}:{}));if(He(ze,"Expected a location on the redirect navigation"),C3.test(z.location)&&T3&&typeof((le=window)==null?void 0:le.location)<"u"){let qr=e.history.createURL(z.location),Er=yc(qr.pathname,e.basename||"/")==null;if(window.location.origin!==qr.origin||Er){Te?window.location.replace(z.location):window.location.assign(z.location);return}}w=null;let _e=Te===!0?jt.Replace:jt.Push,{formMethod:Ke,formAction:Ze,formEncType:kt,formData:Ut}=M.navigation;!ye&&Ke&&Ze&&Ut&&kt&&(ye={formMethod:Ke,formAction:Ze,formEncType:kt,formData:Ut}),hE.has(z.status)&&ye&&wi(ye.formMethod)?await Q(_e,ze,{submission:nt({},ye,{formAction:z.location}),preventScrollReset:y}):await Q(_e,ze,{overrideNavigation:{state:"loading",location:ze,formMethod:ye?ye.formMethod:void 0,formAction:ye?ye.formAction:void 0,formEncType:ye?ye.formEncType:void 0,formData:ye?ye.formData:void 0},preventScrollReset:y})}async function Ue(M,z,H,le,ye){let Te=await Promise.all([...H.map(_e=>tl("loader",ye,_e,z,n,t,m.basename)),...le.map(_e=>_e.matches&&_e.match?tl("loader",nl(e.history,_e.path,ye.signal),_e.match,_e.matches,n,t,m.basename):{type:Jt.error,error:Yr(404,{pathname:_e.path})})]),ke=Te.slice(0,H.length),ze=Te.slice(H.length);return await Promise.all([nw(M,H,ke,ye.signal,!1,h.loaderData),nw(M,le.map(_e=>_e.match),ze,ye.signal,!0)]),{results:Te,loaderResults:ke,fetcherResults:ze}}function Ae(){_=!0,A.push(...$t()),X.forEach((M,z)=>{N.has(z)&&(E.push(z),$e(z))})}function pt(M,z,H){let le=Go(h.matches,z);et(M),V({errors:{[le.route.id]:H},fetchers:new Map(h.fetchers)})}function et(M){N.has(M)&&$e(M),X.delete(M),K.delete(M),W.delete(M),h.fetchers.delete(M)}function $e(M){let z=N.get(M);He(z,"Expected fetch controller: "+M),z.abort(),N.delete(M)}function ut(M){for(let z of M){let le={state:"idle",data:$(z).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};h.fetchers.set(z,le)}}function de(){let M=[];for(let z of W){let H=h.fetchers.get(z);He(H,"Expected fetcher: "+z),H.state==="loading"&&(W.delete(z),M.push(z))}ut(M)}function lt(M){let z=[];for(let[H,le]of K)if(le0}function tt(M,z){let H=h.blockers.get(M)||Xb;return fe.get(M)!==z&&fe.set(M,z),H}function Ie(M){h.blockers.delete(M),fe.delete(M)}function cn(M,z){let H=h.blockers.get(M)||Xb;He(H.state==="unblocked"&&z.state==="blocked"||H.state==="blocked"&&z.state==="blocked"||H.state==="blocked"&&z.state==="proceeding"||H.state==="blocked"&&z.state==="unblocked"||H.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+H.state+" -> "+z.state),h.blockers.set(M,z),V({blockers:new Map(h.blockers)})}function an(M){let{currentLocation:z,nextLocation:H,historyAction:le}=M;if(fe.size===0)return;fe.size>1&&lo(!1,"A router only supports one blocker at a time");let ye=Array.from(fe.entries()),[Te,ke]=ye[ye.length-1],ze=h.blockers.get(Te);if(!(ze&&ze.state==="proceeding")&&ke({currentLocation:z,nextLocation:H,historyAction:le}))return Te}function $t(M){let z=[];return ue.forEach((H,le)=>{(!M||M(le))&&(H.cancel(),z.push(le),ue.delete(le))}),z}function Oe(M,z,H){if(s=M,c=z,l=H||(le=>le.key),!u&&h.navigation===mf){u=!0;let le=xe(h.location,h.matches);le!=null&&V({restoreScrollPosition:le})}return()=>{s=null,c=null,l=null}}function ee(M,z){if(s&&l&&c){let H=z.map(ye=>rw(ye,h.loaderData)),le=l(M,H)||M.key;s[le]=c()}}function xe(M,z){if(s&&l&&c){let H=z.map(Te=>rw(Te,h.loaderData)),le=l(M,H)||M.key,ye=s[le];if(typeof ye=="number")return ye}return null}function U(M){i=M}return m={get basename(){return e.basename},get state(){return h},get routes(){return r},initialize:O,subscribe:B,enableScrollRestoration:Oe,navigate:R,fetch:Ee,revalidate:T,createHref:M=>e.history.createHref(M),encodeLocation:M=>e.history.encodeLocation(M),getFetcher:$,deleteFetcher:et,dispose:Y,getBlocker:tt,deleteBlocker:Ie,_internalFetchControllers:N,_internalActiveDeferreds:ue,_internalSetRoutes:U},m}function yE(e){return e!=null&&"formData"in e}function Kb(e,t,n){n===void 0&&(n=!1);let r=typeof e=="string"?e:zi(e);if(!t||!yE(t))return{path:r};if(t.formMethod&&!SE(t.formMethod))return{path:r,error:Yr(405,{method:t.formMethod})};let i;if(t.formData&&(i={formMethod:t.formMethod||"get",formAction:M3(r),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData},wi(i.formMethod)))return{path:r,submission:i};let a=si(r),o=R3(t.formData);return n&&a.search&&I3(a.search)&&o.append("index",""),a.search="?"+o,{path:zi(a),submission:i}}function bE(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Gb(e,t,n,r,i,a,o,s,l,c,u,d,f){let p=f?Object.values(f)[0]:d?Object.values(d)[0]:void 0,m=e.createURL(t.location),h=e.createURL(i),v=a||m.toString()===h.toString()||m.search!==h.search,y=f?Object.keys(f)[0]:void 0,x=bE(n,y).filter((A,E)=>{if(A.route.lazy)return!0;if(A.route.loader==null)return!1;if(wE(t.loaderData,t.matches[E],A)||o.some(q=>q===A.route.id))return!0;let N=t.matches[E],F=A;return Qb(A,nt({currentUrl:m,currentParams:N.params,nextUrl:h,nextParams:F.params},r,{actionResult:p,defaultShouldRevalidate:v||A3(N,F)}))}),_=[];return l.forEach((A,E)=>{if(!n.some(K=>K.route.id===A.routeId))return;let N=Ko(c,A.path,u);if(!N){_.push(nt({key:E},A,{matches:null,match:null}));return}let F=fm(N,A.path);if(s.includes(E)){_.push(nt({key:E,matches:N,match:F},A));return}Qb(F,nt({currentUrl:m,currentParams:t.matches[t.matches.length-1].params,nextUrl:h,nextParams:n[n.length-1].params},r,{actionResult:p,defaultShouldRevalidate:v}))&&_.push(nt({key:E,matches:N,match:F},A))}),[x,_]}function wE(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function A3(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qb(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function hm(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];He(i,"No route found in manifest");let a={};for(let o in r){let l=i[o]!==void 0&&o!=="hasErrorBoundary";lo(!l,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!F_.has(o)&&(a[o]=r[o])}Object.assign(i,a),Object.assign(i,{hasErrorBoundary:t(nt({},i)),lazy:void 0})}async function tl(e,t,n,r,i,a,o,s,l,c){o===void 0&&(o="/"),s===void 0&&(s=!1),l===void 0&&(l=!1);let u,d,f,p=v=>{let y,w=new Promise((x,_)=>y=_);return f=()=>y(),t.signal.addEventListener("abort",f),Promise.race([v({request:t,params:n.params,context:c}),w])};try{let v=n.route[e];if(n.route.lazy)if(v)d=(await Promise.all([p(v),hm(n.route,a,i)]))[0];else if(await hm(n.route,a,i),v=n.route[e],v)d=await p(v);else{if(e==="action")throw Yr(405,{method:t.method,pathname:new URL(t.url).pathname,routeId:n.route.id});return{type:Jt.data,data:void 0}}else He(v,"Could not find the "+e+' to run on the "'+n.route.id+'" route'),d=await p(v);He(d!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(v){u=Jt.error,d=v}finally{f&&t.signal.removeEventListener("abort",f)}if(kE(d)){let v=d.status;if(dE.has(v)){let x=d.headers.get("Location");if(He(x,"Redirects returned/thrown from loaders/actions must have a Location header"),C3.test(x)){if(!s){let _=new URL(t.url),A=x.startsWith("//")?new URL(_.protocol+x):new URL(x),E=yc(A.pathname,o)!=null;A.origin===_.origin&&E&&(x=A.pathname+A.search+A.hash)}}else{let _=r.slice(0,r.indexOf(n)+1),A=Ah(_).map(N=>N.pathnameBase),E=Zg(x,A,new URL(t.url).pathname);if(He(zi(E),"Unable to resolve redirect location: "+x),o){let N=E.pathname;E.pathname=N==="/"?o:Ri([o,N])}x=zi(E)}if(s)throw d.headers.set("Location",x),d;return{type:Jt.redirect,status:v,location:x,revalidate:d.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:u||Jt.data,response:d};let y,w=d.headers.get("Content-Type");return w&&/\bapplication\/json\b/.test(w)?y=await d.json():y=await d.text(),u===Jt.error?{type:u,error:new Jg(v,d.statusText,y),headers:d.headers}:{type:Jt.data,data:y,statusCode:d.status,headers:d.headers}}if(u===Jt.error)return{type:u,error:d};if(d instanceof aE){var m,h;return{type:Jt.deferred,deferredData:d,statusCode:(m=d.init)==null?void 0:m.status,headers:((h=d.init)==null?void 0:h.headers)&&new Headers(d.init.headers)}}return{type:Jt.data,data:d}}function nl(e,t,n,r){let i=e.createURL(M3(t)).toString(),a={signal:n};if(r&&wi(r.formMethod)){let{formMethod:o,formEncType:s,formData:l}=r;a.method=o.toUpperCase(),a.body=s==="application/x-www-form-urlencoded"?R3(l):l}return new Request(i,a)}function R3(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,r instanceof File?r.name:r);return t}function vE(e,t,n,r,i){let a={},o=null,s,l=!1,c={};return n.forEach((u,d)=>{let f=t[d].route.id;if(He(!ls(u),"Cannot handle redirect results in processLoaderData"),Sl(u)){let p=Go(e,f),m=u.error;r&&(m=Object.values(r)[0],r=void 0),o=o||{},o[p.route.id]==null&&(o[p.route.id]=m),a[f]=void 0,l||(l=!0,s=_3(u.error)?u.error.status:500),u.headers&&(c[f]=u.headers)}else Ka(u)?(i.set(f,u.deferredData),a[f]=u.deferredData.data):a[f]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(s=u.statusCode),u.headers&&(c[f]=u.headers)}),r&&(o=r,a[Object.keys(r)[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:c}}function Zb(e,t,n,r,i,a,o,s){let{loaderData:l,errors:c}=vE(t,n,r,i,s);for(let u=0;ur.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function ew(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Yr(e,t){let{pathname:n,routeId:r,method:i,type:a}=t===void 0?{}:t,o="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"&&(s="defer() is not supported in actions")):e===403?(o="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",s='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new Jg(e||500,o,new Error(s),!0)}function tw(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(ls(n))return n}}function M3(e){let t=typeof e=="string"?si(e):e;return zi(nt({},t,{hash:""}))}function xE(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash!==t.hash}function Ka(e){return e.type===Jt.deferred}function Sl(e){return e.type===Jt.error}function ls(e){return(e&&e.type)===Jt.redirect}function kE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function SE(e){return uE.has(e)}function wi(e){return lE.has(e)}async function nw(e,t,n,r,i,a){for(let o=0;od.route.id===l.route.id),u=c!=null&&!A3(c,l)&&(a&&a[l.route.id])!==void 0;Ka(s)&&(i||u)&&await N3(s,r,i).then(d=>{d&&(n[o]=d||n[o])})}}async function N3(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Jt.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Jt.error,error:i}}return{type:Jt.data,data:e.deferredData.data}}}function I3(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function rw(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function fm(e,t){let n=typeof t=="string"?si(t).search:t.search;if(e[e.length-1].route.index&&I3(n||""))return e[e.length-1];let r=Ah(e);return r[r.length-1]}/** + * React Router v6.9.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function _E(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const EE=typeof Object.is=="function"?Object.is:_E,{useState:CE,useEffect:TE,useLayoutEffect:AE,useDebugValue:RE}=gp;function ME(e,t,n){const r=t(),[{inst:i},a]=CE({inst:{value:r,getSnapshot:t}});return AE(()=>{i.value=r,i.getSnapshot=t,gf(i)&&a({inst:i})},[e,r,t]),TE(()=>(gf(i)&&a({inst:i}),e(()=>{gf(i)&&a({inst:i})})),[e]),RE(r),r}function gf(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!EE(n,r)}catch{return!0}}function NE(e,t,n){return t()}const IE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",OE=!IE,DE=OE?NE:ME,LE="useSyncExternalStore"in gp?(e=>e.useSyncExternalStore)(gp):DE,e1=ce.createContext(null),t1=ce.createContext(null),bc=ce.createContext(null),Rh=ce.createContext(null),Ia=ce.createContext({outlet:null,matches:[]}),O3=ce.createContext(null);function pm(){return pm=Object.assign?Object.assign.bind():function(e){for(var t=1;ts.pathnameBase)),a=ce.useRef(!1);return ce.useEffect(()=>{a.current=!0}),ce.useCallback(function(s,l){if(l===void 0&&(l={}),!a.current)return;if(typeof s=="number"){t.go(s);return}let c=Zg(s,JSON.parse(i),r,l.relative==="path");e!=="/"&&(c.pathname=c.pathname==="/"?e:Ri([e,c.pathname])),(l.replace?t.replace:t.push)(c,l.state,l)},[e,t,i,r])}const zE=ce.createContext(null);function FE(e){let t=ce.useContext(Ia).outlet;return t&&ce.createElement(zE.Provider,{value:e},t)}function n1(){let{matches:e}=ce.useContext(Ia),t=e[e.length-1];return t?t.params:{}}function D3(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=ce.useContext(Ia),{pathname:i}=Mh(),a=JSON.stringify(Ah(r).map(o=>o.pathnameBase));return ce.useMemo(()=>Zg(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function BE(e,t){wc()||He(!1);let{navigator:n}=ce.useContext(bc),r=ce.useContext(t1),{matches:i}=ce.useContext(Ia),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:"/";a&&a.route;let l=Mh(),c;if(t){var u;let h=typeof t=="string"?si(t):t;s==="/"||(u=h.pathname)!=null&&u.startsWith(s)||He(!1),c=h}else c=l;let d=c.pathname||"/",f=s==="/"?d:d.slice(s.length)||"/",p=Ko(e,{pathname:f}),m=qE(p&&p.map(h=>Object.assign({},h,{params:Object.assign({},o,h.params),pathname:Ri([s,n.encodeLocation?n.encodeLocation(h.pathname).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?s:Ri([s,n.encodeLocation?n.encodeLocation(h.pathnameBase).pathname:h.pathnameBase])})),i,r||void 0);return t&&m?ce.createElement(Rh.Provider,{value:{location:pm({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:jt.Pop}},m):m}function $E(){let e=YE(),t=_3(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},a=null;return ce.createElement(ce.Fragment,null,ce.createElement("h2",null,"Unexpected Application Error!"),ce.createElement("h3",{style:{fontStyle:"italic"}},t),n?ce.createElement("pre",{style:i},n):null,a)}class UE extends ce.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?ce.createElement(Ia.Provider,{value:this.props.routeContext},ce.createElement(O3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function jE(e){let{routeContext:t,match:n,children:r}=e,i=ce.useContext(e1);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),ce.createElement(Ia.Provider,{value:t},r)}function qE(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,i=n==null?void 0:n.errors;if(i!=null){let a=r.findIndex(o=>o.route.id&&(i==null?void 0:i[o.route.id]));a>=0||He(!1),r=r.slice(0,Math.min(r.length,a+1))}return r.reduceRight((a,o,s)=>{let l=o.route.id?i==null?void 0:i[o.route.id]:null,c=null;n&&(o.route.ErrorBoundary?c=ce.createElement(o.route.ErrorBoundary,null):o.route.errorElement?c=o.route.errorElement:c=ce.createElement($E,null));let u=t.concat(r.slice(0,s+1)),d=()=>{let f=a;return l?f=c:o.route.Component?f=ce.createElement(o.route.Component,null):o.route.element&&(f=o.route.element),ce.createElement(jE,{match:o,routeContext:{outlet:a,matches:u},children:f})};return n&&(o.route.ErrorBoundary||o.route.errorElement||s===0)?ce.createElement(UE,{location:n.location,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u}}):d()},null)}var iw;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(iw||(iw={}));var Bd;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(Bd||(Bd={}));function HE(e){let t=ce.useContext(t1);return t||He(!1),t}function WE(e){let t=ce.useContext(Ia);return t||He(!1),t}function VE(e){let t=WE(),n=t.matches[t.matches.length-1];return n.route.id||He(!1),n.route.id}function YE(){var e;let t=ce.useContext(O3),n=HE(Bd.UseRouteError),r=VE(Bd.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function XE(e){let{fallbackElement:t,router:n}=e,r=ce.useCallback(()=>n.state,[n]),i=LE(n.subscribe,r,r),a=ce.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:l=>n.navigate(l),push:(l,c,u)=>n.navigate(l,{state:c,preventScrollReset:u==null?void 0:u.preventScrollReset}),replace:(l,c,u)=>n.navigate(l,{replace:!0,state:c,preventScrollReset:u==null?void 0:u.preventScrollReset})}),[n]),o=n.basename||"/",s=ce.useMemo(()=>({router:n,navigator:a,static:!1,basename:o}),[n,a,o]);return ce.createElement(ce.Fragment,null,ce.createElement(e1.Provider,{value:s},ce.createElement(t1.Provider,{value:i},ce.createElement(QE,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:a},n.state.initialized?ce.createElement(ZE,null):t))),null)}function KE(e){return FE(e.context)}function GE(e){He(!1)}function QE(e){let{basename:t="/",children:n=null,location:r,navigationType:i=jt.Pop,navigator:a,static:o=!1}=e;wc()&&He(!1);let s=t.replace(/^\/*/,"/"),l=ce.useMemo(()=>({basename:s,navigator:a,static:o}),[s,a,o]);typeof r=="string"&&(r=si(r));let{pathname:c="/",search:u="",hash:d="",state:f=null,key:p="default"}=r,m=ce.useMemo(()=>{let h=yc(c,s);return h==null?null:{location:{pathname:h,search:u,hash:d,state:f,key:p},navigationType:i}},[s,c,u,d,f,p,i]);return m==null?null:ce.createElement(bc.Provider,{value:l},ce.createElement(Rh.Provider,{children:n,value:m}))}function ZE(e){let{children:t,location:n}=e,r=ce.useContext(e1),i=r&&!t?r.router.routes:mm(t);return BE(i,n)}var aw;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(aw||(aw={}));new Promise(()=>{});function mm(e,t){t===void 0&&(t=[]);let n=[];return ce.Children.forEach(e,(r,i)=>{if(!ce.isValidElement(r))return;if(r.type===ce.Fragment){n.push.apply(n,mm(r.props.children,t));return}r.type!==GE&&He(!1),!r.props.index||!r.props.children||He(!1);let a=[...t,i],o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=mm(r.props.children,a)),n.push(o)}),n}function JE(e){return!!e.ErrorBoundary||!!e.errorElement}/** + * React Router DOM v6.9.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function tC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nC(e,t){return e.button===0&&(!t||t==="_self")&&!tC(e)}const rC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function iC(e,t){return gE({basename:t==null?void 0:t.basename,history:L_({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||aC(),routes:e,detectErrorBoundary:JE}).initialize()}function aC(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=$d({},t,{errors:oC(t.errors)})),t}function oC(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Jg(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){let a=new Error(i.message);a.stack="",n[r]=a}else n[r]=i;return n}const sC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Oa=ce.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:c,preventScrollReset:u}=t,d=eC(t,rC),{basename:f}=ce.useContext(bc),p,m=!1;if(typeof c=="string"&&lC.test(c)&&(p=c,sC)){let w=new URL(window.location.href),x=c.startsWith("//")?new URL(w.protocol+c):new URL(c),_=yc(x.pathname,f);x.origin===w.origin&&_!=null?c=_+x.search+x.hash:m=!0}let h=PE(c,{relative:i}),v=cC(c,{replace:o,state:s,target:l,preventScrollReset:u,relative:i});function y(w){r&&r(w),w.defaultPrevented||v(w)}return ce.createElement("a",$d({},d,{href:p||h,onClick:m||a?r:y,ref:n,target:l}))});var ow;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(ow||(ow={}));var sw;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(sw||(sw={}));function cC(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o}=t===void 0?{}:t,s=Hi(),l=Mh(),c=D3(e,{relative:o});return ce.useCallback(u=>{if(nC(u,n)){u.preventDefault();let d=r!==void 0?r:zi(l)===zi(c);s(e,{replace:d,state:i,preventScrollReset:a,relative:o})}},[l,s,c,r,i,n,e,a,o])}var Gl={},uC={get exports(){return Gl},set exports(e){Gl=e}},ht={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r1=Symbol.for("react.element"),i1=Symbol.for("react.portal"),Nh=Symbol.for("react.fragment"),Ih=Symbol.for("react.strict_mode"),Oh=Symbol.for("react.profiler"),Dh=Symbol.for("react.provider"),Lh=Symbol.for("react.context"),dC=Symbol.for("react.server_context"),Ph=Symbol.for("react.forward_ref"),zh=Symbol.for("react.suspense"),Fh=Symbol.for("react.suspense_list"),Bh=Symbol.for("react.memo"),$h=Symbol.for("react.lazy"),hC=Symbol.for("react.offscreen"),L3;L3=Symbol.for("react.module.reference");function wr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case r1:switch(e=e.type,e){case Nh:case Oh:case Ih:case zh:case Fh:return e;default:switch(e=e&&e.$$typeof,e){case dC:case Lh:case Ph:case $h:case Bh:case Dh:return e;default:return t}}case i1:return t}}}ht.ContextConsumer=Lh;ht.ContextProvider=Dh;ht.Element=r1;ht.ForwardRef=Ph;ht.Fragment=Nh;ht.Lazy=$h;ht.Memo=Bh;ht.Portal=i1;ht.Profiler=Oh;ht.StrictMode=Ih;ht.Suspense=zh;ht.SuspenseList=Fh;ht.isAsyncMode=function(){return!1};ht.isConcurrentMode=function(){return!1};ht.isContextConsumer=function(e){return wr(e)===Lh};ht.isContextProvider=function(e){return wr(e)===Dh};ht.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===r1};ht.isForwardRef=function(e){return wr(e)===Ph};ht.isFragment=function(e){return wr(e)===Nh};ht.isLazy=function(e){return wr(e)===$h};ht.isMemo=function(e){return wr(e)===Bh};ht.isPortal=function(e){return wr(e)===i1};ht.isProfiler=function(e){return wr(e)===Oh};ht.isStrictMode=function(e){return wr(e)===Ih};ht.isSuspense=function(e){return wr(e)===zh};ht.isSuspenseList=function(e){return wr(e)===Fh};ht.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Nh||e===Oh||e===Ih||e===zh||e===Fh||e===hC||typeof e=="object"&&e!==null&&(e.$$typeof===$h||e.$$typeof===Bh||e.$$typeof===Dh||e.$$typeof===Lh||e.$$typeof===Ph||e.$$typeof===L3||e.getModuleId!==void 0)};ht.typeOf=wr;(function(e){e.exports=ht})(uC);const fC=h2(Gl);function pC(e){function t(T,Q,ne,ge,$){for(var Ee=0,J=0,Se=0,Ne=0,Ue,Ae,pt=0,et=0,$e,ut=$e=Ue=0,de=0,lt=0,tt=0,Ie=0,cn=ne.length,an=cn-1,$t,Oe="",ee="",xe="",U="",M;deUe)&&(Ie=(Oe=Oe.replace(" ",":")).length),0ge&&(ge=(Q=Q.trim()).charCodeAt(0)),ge){case 38:return Q.replace(y,"$1"+T.trim());case 58:return T.trim()+Q.replace(y,"$1"+T.trim());default:if(0<1*ne&&0J.charCodeAt(8))break;case 115:$=$.replace(J,"-webkit-"+J)+";"+$;break;case 207:case 102:$=$.replace(J,"-webkit-"+(102ne.charCodeAt(0)&&(ne=ne.trim()),R=ne,ne=[R],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var DC=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,i=0;i=this.groupSizes.length){for(var i=this.groupSizes,a=i.length,o=a;n>=o;)(o<<=1)<0&&co(16,""+n);this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var s=a;s=this.length||this.groupSizes[n]===0)return r;for(var i=this.groupSizes[n],a=this.indexOfGroup(n),o=a+i,s=a;s=_l&&(_l=t+1),td.set(e,t),jd.set(t,e)},zC="style["+Cs+'][data-styled-version="5.3.9"]',FC=new RegExp("^"+Cs+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),BC=function(e,t,n){for(var r,i=n.split(","),a=0,o=i.length;a=0;c--){var u=l[c];if(u&&u.nodeType===1&&u.hasAttribute(Cs))return u}}(n),a=i!==void 0?i.nextSibling:null;r.setAttribute(Cs,"active"),r.setAttribute("data-styled-version","5.3.9");var o=UC();return o&&r.setAttribute("nonce",o),n.insertBefore(r,a),r},jC=function(){function e(n){var r=this.element=B3(n);r.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var a=document.styleSheets,o=0,s=a.length;o=0){var i=document.createTextNode(r),a=this.nodes[n];return this.element.insertBefore(i,a||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(d+=f+",")}),a+=""+c+u+'{content:"'+d+`"}/*!sc*/ +`}}}return a}(this)},e}(),VC=/(a)(d)/gi,mw=function(e){return String.fromCharCode(e+(e>25?39:97))};function bm(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=mw(t%52)+n;return(mw(t%52)+n).replace(VC,"$1-$2")}var Qo=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},$3=function(e){return Qo(5381,e)};function U3(e){for(var t=0;t>>0);if(!n.hasNameForId(i,s)){var l=r(o,"."+s,void 0,i);n.insertRules(i,s,l)}a.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=Qo(this.baseHash,r.hash),d="",f=0;f>>0);if(!n.hasNameForId(i,v)){var y=r(d,"."+v,void 0,i);n.insertRules(i,v,y)}a.push(v)}}return a.join(" ")},e}(),KC=/^\s*\/\/.*$/gm,GC=[":","[",".","#"];function QC(e){var t,n,r,i,a=e===void 0?va:e,o=a.options,s=o===void 0?va:o,l=a.plugins,c=l===void 0?Ud:l,u=new pC(s),d=[],f=function(h){function v(y){if(y)try{h(y+"}")}catch{}}return function(y,w,x,_,A,E,N,F,q,K){switch(y){case 1:if(q===0&&w.charCodeAt(0)===64)return h(w+";"),"";break;case 2:if(F===0)return w+"/*|*/";break;case 3:switch(F){case 102:case 112:return h(x[0]+w),"";default:return w+(K===0?"/*|*/":"")}case-2:w.split("/*|*/}").forEach(v)}}}(function(h){d.push(h)}),p=function(h,v,y){return v===0&&GC.indexOf(y[n.length])!==-1||y.match(i)?h:"."+t};function m(h,v,y,w){w===void 0&&(w="&");var x=h.replace(KC,""),_=v&&y?y+" "+v+" { "+x+" }":x;return t=w,n=v,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),u(y||!v?"":v,_)}return u.use([].concat(c,[function(h,v,y){h===2&&y.length&&y[0].lastIndexOf(n)>0&&(y[0]=y[0].replace(r,p))},f,function(h){if(h===-2){var v=d;return d=[],v}}])),m.hash=c.length?c.reduce(function(h,v){return v.name||co(15),Qo(h,v.name)},5381).toString():"",m}var j3=Fn.createContext();j3.Consumer;var q3=Fn.createContext(),ZC=(q3.Consumer,new qd),wm=QC();function H3(){return ce.useContext(j3)||ZC}function W3(){return ce.useContext(q3)||wm}var JC=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=wm);var o=r.name+a.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,a(r.rules,o,"@keyframes"))},this.toString=function(){return co(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=wm),this.name+t.hash},e}(),eT=/([A-Z])/,tT=/([A-Z])/g,nT=/^ms-/,rT=function(e){return"-"+e.toLowerCase()};function gw(e){return eT.test(e)?e.replace(tT,rT).replace(nT,"-ms-"):e}var yw=function(e){return e==null||e===!1||e===""};function uo(e,t,n,r){if(Array.isArray(e)){for(var i,a=[],o=0,s=e.length;o1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,aT=/(^-|-$)/g;function yf(e){return e.replace(iT,"-").replace(aT,"")}var X3=function(e){return bm($3(e)>>>0)};function cu(e){return typeof e=="string"&&!0}var vm=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},oT=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function sT(e,t,n){var r=e[n];vm(t)&&vm(r)?K3(r,t):e[n]=t}function K3(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(K[F]=E[F]);return K}(t,["componentId"]),A=x&&x+"-"+(cu(w)?w:yf(fw(w)));return G3(w,Ir({},_,{attrs:f,componentId:A}),n)},Object.defineProperty(m,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(w){this._foldedDefaultProps=r?K3({},e.defaultProps,w):w}}),Object.defineProperty(m,"toString",{value:function(){return"."+m.styledComponentId}}),i&&NC(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),m}var xm=function(e){return function t(n,r,i){if(i===void 0&&(i=va),!Gl.isValidElementType(r))return co(1,String(r));var a=function(){return n(r,i,V3.apply(void 0,arguments))};return a.withConfig=function(o){return t(n,r,Ir({},i,{},o))},a.attrs=function(o){return t(n,r,Ir({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},a}(G3,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){xm[e]=xm(e)});var cT=function(){function e(n,r){this.rules=n,this.componentId=r,this.isStatic=U3(n),qd.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(n,r,i,a){var o=a(uo(this.rules,r,i,a).join(""),""),s=this.componentId+n;i.insertRules(s,s,o)},t.removeStyles=function(n,r){r.clearRules(this.componentId+n)},t.renderStyles=function(n,r,i,a){n>2&&qd.registerId(this.componentId+n),this.removeStyles(n,i),this.createStyles(n,r,i,a)},e}();function uT(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;re.isDropdown?"4px solid hsla(234, 60%, 66%, 1)":"none"}; + transition: all 0.05s; + cursor: pointer; + @media screen and (max-width: 1024px) { + font-size: 16px; + font-weight: 300; + padding-inline: 16px; + } +`,fT=L.ul` + position: absolute; + top: 86px; + left: 0; + display: ${e=>e.isDropdown?"block":"none"}; + padding: 16px 20px; + background: hsl(231, 14%, 18%); + border-radius: 8px; + transition: all 0s ease 0.1s; + width: 200px; +`,pT=L.li` + display: block; + padding-block: 8px; + color: hsl(0, 0%, 88%); + font-weight: 400; + font-size: 14px; + &:hover { + color: hsl(234, 60%, 66%); + } +`,Q3=(e,t)=>{t&&(t.startsWith("http")||t.startsWith("https")?window.location.href=t:e(t))},mT=({label:e,url:t})=>{const n=Hi();return k.jsx(pT,{onClick:()=>Q3(n,t),children:e})},gT=({subNavItems:e,isDropdown:t})=>k.jsx(fT,{isDropdown:t,children:e==null?void 0:e.map(({key:n,label:r,url:i})=>k.jsx(mT,{label:r,url:i},n))}),yT=({label:e,subNavItems:t,url:n})=>{const r=Hi(),[i,a]=ce.useState(!1);return k.jsxs(hT,{isDropdown:i,onMouseOver:()=>a(!0),onMouseOut:()=>a(!1),onClick:()=>Q3(r,n),children:[e,t&&k.jsx(gT,{subNavItems:t,isDropdown:i})]})},bT=({items:e})=>k.jsx(dT,{children:e.map(({key:t,label:n,url:r,children:i})=>k.jsx(yT,{label:n,url:r,subNavItems:i},t))}),wT="/xline-home/assets/home-menu-icon-459d13f5.svg",vT="/xline-home/assets/dropIcon-525fd0e1.svg",xT="/xline-home/assets/dropIconActive-9bdef1aa.svg",kT=L.img` + display: none; + margin-left: 12px; + @media screen and (max-width: 768px) { + display: block; + } +`,ST=L.ul` + display: ${e=>e.isDropDown?"flex":"none"}; + flex-direction: column; + position: absolute; + top: 53px; + left: 0; + width: 100%; + z-index: 1000; + @media screen and (min-width: 768px) { + display: none; + } +`,_T=L.li` + display: flex; + align-items: center; + height: 42px; + padding-inline: 20px; +`,ET=L(_T)` + background: #111429; + color: ${e=>e.isDropdown?"#7680DD":"#E0E0E0"}; + font-weight: 500; + font-size: 16px; + line-height: 1; +`,CT=L.p` + /* min-width: 100px; */ +`,TT=L.ul` + display: ${e=>e.isDropdown?"block":"none"}; + height: ${e=>e.isDropdown?"min-content":"0px"}; + transition: all 1s; +`,AT=L.li` + display: flex; + align-items: center; + height: 42px; + padding-inline: 20px; +`,RT=L(AT)` + background: #242840; + color: #e0e0e0; +`,ww=L.img` + margin-left: 12px; + height: 12px; + width: 12px; +`,Z3=(e,t,n,r)=>{t?t.startsWith("http")||t.startsWith("https")?window.location.href=t:e(t):r&&r(!n)},MT=({label:e,url:t})=>{const n=Hi();return k.jsx(RT,{onClick:()=>Z3(n,t),children:e})},NT=({isDropdown:e,subNavItems:t})=>k.jsx(TT,{isDropdown:e,children:t==null?void 0:t.map(({key:n,label:r,url:i})=>k.jsx(MT,{label:r,url:i},n))}),IT=({label:e,url:t,subNavItems:n})=>{const r=Hi(),[i,a]=ce.useState(!1);return k.jsxs(k.Fragment,{children:[k.jsxs(ET,{isDropdown:i,onClick:()=>Z3(r,t,i,a),children:[k.jsx(CT,{children:e}),(n==null?void 0:n.length)!==0&&k.jsx(k.Fragment,{children:i?k.jsx(ww,{src:xT}):k.jsx(ww,{src:vT})})]}),k.jsx(NT,{isDropdown:i,subNavItems:n})]})},OT=({items:e})=>{const[t,n]=ce.useState(!1);return k.jsxs(k.Fragment,{children:[k.jsx(kT,{src:wT,onClick:()=>n(!t)}),k.jsx(ST,{isDropDown:t,children:(e||[]).map(({key:r,label:i,url:a,children:o})=>k.jsx(IT,{label:i,url:a,subNavItems:o},r))})]})},h1="/xline-home/assets/logo-9c6940ee.svg",J3="/xline-home/assets/github-icon-7701b5d6.svg",vw=[{key:"docs",label:"Docs",children:[{key:"what's-new",label:"What's new",url:"/docs/What's-New"},{key:"get-started",label:"Get started",url:"/docs/Get-Started"},{key:"deploy",label:"Deploy",url:"/docs/Deploy"},{key:"develop",label:"Develop",url:"/docs/Develop"},{key:"reference",label:"reference",url:"/docs/Xline-Architecture-Details"}]},{key:"deep-dive",label:"Deep dive",children:[{key:"consensus",label:"Consensus",url:"/deep-dive/Consensus"},{key:"kv-engine",label:"KV engine",url:"/deep-dive/Key-value-Engine"},{key:"rpc",label:"RPC",url:"/deep-dive/Remote-Procedure-Calls-(RPC)"},{key:"test",label:"Test",url:"/deep-dive/Testing"}]},{key:"community",label:"Community",children:[{key:"chat",label:"Chat",url:"https://discord.gg/XyFXGpSfvb"},{key:"contribute",label:"Contribute",url:"/contribute"},{key:"2024 GSoC",label:"2024 GSoC",url:"/GSoC"},{key:"Community Meeting",label:"Community Meeting",url:"/meeting"}]},{key:"resources",label:"Resources",children:[{key:"blog",label:"Blog",url:"/blog"},{key:"video",label:"Video",url:"/video"}]}],DT=L.header` + position: absolute; + top: 0; + left: 0; + height: 86px; + width: 100%; + background-color: hsla(236, 60%, 10%, 0.4); + color: ${e=>e.theme.color.white}; + @media screen and (max-width: 1024px) { + height: 69px; + } + @media screen and (max-width: 768px) { + height: 53px; + } +`,LT=L.div` + position: relative; + display: flex; + align-items: center; + height: inherit; + width: 100%; + max-width: 1440px; + margin-inline: auto; + padding-left: 105px; + padding-right: 101px; + @media screen and (max-width: 1024px) { + padding-inline: 64px; + } + @media screen and (max-width: 768px) { + padding-inline: 20px; + } +`,PT=L.img` + width: 111px; + height: 32px; + margin-right: calc(68px - 20px); + @media screen and (max-width: 1024px) { + width: 86px; + height: 22px; + margin-right: 24px; + } + @media screen and (max-width: 768px) { + width: 64px; + height: 18px; + margin-right: 0; + } +`,zT=L.div` + flex: 1; + min-width: ${e=>e.theme.scale.md}; + @media screen and (max-width: 1024px) { + min-width: 16px; + } +`,FT=L.button` + display: flex; + align-items: center; + justify-content: center; + width: 131px; + height: 48px; + /* padding: 8px 16px; */ + color: ${e=>e.theme.color.white}; + background: linear-gradient( + 90deg, + hsla(270, 50%, 60%, 1), + hsla(257, 97%, 73%, 1) 50%, + hsla(266, 87%, 75%, 1) + ); + border: none; + border-radius: 50vh; + cursor: pointer; + @media screen and (max-width: 1024px) { + width: 106px; + height: 36px; + } + @media screen and (max-width: 768px) { + width: 84px; + height: 24px; + } +`,BT=L.img` + width: 24.94px; + height: 24.94px; + margin-right: 8px; + @media screen and (max-width: 1024px) { + width: 18px; + margin-right: 7px; + } + @media screen and (max-width: 768px) { + width: 15px; + margin-right: 6px; + } +`,$T=L.p` + font-size: 18px; + line-height: 1; + text-transform: capitalize; + transform: translateY(5%); + @media screen and (max-width: 1024px) { + font-size: 15px; + } + @media screen and (max-width: 768px) { + font-size: 11px; + } +`,UT=()=>{const e=Hi();return k.jsx(DT,{children:k.jsxs(LT,{children:[k.jsx(PT,{src:h1,alt:"Xline",onClick:()=>e("/")}),k.jsx(bT,{items:vw}),k.jsx(zT,{}),k.jsxs(FT,{as:"a",href:"https://github.com/datenlord/xline",children:[k.jsx(BT,{src:J3,alt:"icon"}),k.jsx($T,{children:"github"})]}),k.jsx(OT,{items:vw})]})})},e6=[{title:"What's New",url:"/docs/What's-New",children:[{type:"heading",title:"v0.1.0",url:"/docs/What's-New",id:"v0.1.0"},{type:"heading",title:"v0.2.0",url:"/docs/What's-New",id:"v0.2.0"},{type:"heading",title:"v0.3.0",url:"/docs/What's-New",id:"v0.3.0"},{type:"heading",title:"v0.4.0",url:"/docs/What's-New",id:"v0.4.0"},{type:"heading",title:"v0.4.1",url:"/docs/What's-New",id:"v0.4.1"},{type:"heading",title:"v0.5.0",url:"/docs/What's-New",id:"v0.5.0"},{type:"heading",title:"v0.6.0",url:"/docs/What's-New",id:"v0.6.0"},{type:"heading",title:"v0.6.1",url:"/docs/What's-New",id:"v0.6.1"}]},{title:"Get Started",url:"/docs/Get-Started",children:[{type:"heading",title:"Architecture",url:"/docs/Get-Started",id:"Architecture"},{type:"heading",title:"Xline In 5 Minutes",url:"/docs/Get-Started",id:"Xline-In-5-Minutes"}]},{title:"Deploy",url:"/docs/Deploy",children:[{type:"heading",title:"Install",url:"/docs/Deploy",id:"Install"}]},{title:"Develop",url:"/docs/Develop",children:[{type:"heading",title:"Xline API",url:"/docs/Develop",id:"Xline-API"}]},{title:"Reference",url:"/docs/Xline-Architecture-Details",children:[{type:"article",title:"Xline Architecture Details",url:"/docs/Xline-Architecture-Details"},{type:"article",title:"Performance Comparison",url:"/docs/Performance-Comparison"}]}],t6=[{title:"Consensus",url:"/deep-dive/Consensus",children:[{type:"heading",title:"Basic Concept",url:"/deep-dive/Consensus",id:"Basic-Concept"},{type:"heading",title:"Consensus Protocol",url:"/deep-dive/Consensus",id:"Consensus-Protocol"}]},{title:"KV Engine",url:"/deep-dive/Key-value-Engine",children:[{type:"heading",title:"Metrics",url:"/deep-dive/Key-value-Engine",id:"Metrics"},{type:"heading",title:"LSM Tree And B-Tree",url:"/deep-dive/Key-value-Engine",id:"LSM-Tree-And-B-Tree"}]},{title:"RPC",url:"/deep-dive/Remote-Procedure-Calls-(RPC)",children:[{type:"heading",title:"Remote Procedure Call (RPC)",url:"/deep-dive/Remote-Procedure-Calls-(RPC)"}]},{title:"Test",url:"/deep-dive/Testing",children:[{type:"heading",title:"Unit Testing",url:"/deep-dive/Testing",id:"Unit-Testing"},{type:"heading",title:"Mock Testing",url:"/deep-dive/Testing",id:"Mock-Testing"},{type:"heading",title:"Integration Testing",url:"/deep-dive/Testing",id:"Integration-Testing"},{type:"heading",title:"Validation Testing",url:"/deep-dive/Testing",id:"Validation-Testing"}]}],jT="/xline-home/assets/footer-background-8643bf7b.svg",qT="/xline-home/assets/discord-icon-7417d9bb.svg",HT="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAuCAYAAACh8K6vAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANFSURBVHgB7Zs/axRBGId/s7N7t8YoKtqkUjSlKOQ7iNqInZ0gUcFWBK3UQkXUQksLO8HCNDYBxS+gnWAZSCEiqFFMJJvb3Xl99yRkY+YMcznmz2Yf2LvNuzebvWcnM+/OTIAWJwhY4kePjkcKEyZl4hjUIZQwpCcgi8Lsu5UCn/Z1xQdYIoYlpMIVIXDRpIxQvA1xhaIAIsMqJQiz/HYalojQ4oRWvCNa8Y5oxTvCWuc6CCI84H5wXnswwm5+vcrb/lpUcZmH3BnODTpnqSAxIGPj7GUPH7wDxzgXH0d4OdYR7wYdz3N6LyReYE1+xErPFjlOpamYgyFfiSZkz71475uaJBFvqcQ53v22GuOqPCk7mM0yOoxACaKNb6L8YDrXpskPKqtpkvzg0smmyA8yj2+CfGvpZDdBorvLLOwyEaeMgjNzA/ryiY7yblqPx10scDzh8+W6cuNcNI71F2ITe3k8KSEi7R/YBX7g4YciumQqnz//RRfPS3rMNf+JLs/Pskzs6qYbLw928aOpEZhm+U9Z/mjqnfjb7PD5DsBT/GnjRyy/avNL6svfCw/xq3Mddc0Hplj+Gx/lOxfPbevsusA2ke9evMAtHm28vy64VfklHqGWasJD+V40NYkU13Xyecr1Loagluf/rIX78jsy9UK+N228Vj7hJIakkg+Fad4tauGpbowZeIBXnatW/haIYzHD8quaX5d/CB7g3ZCBJfnO8XKsZjvI93aQrJKfK9zEiKjk52W/z1iGB1gbqykQFaQ2xpUcXCaNxStOAQ9ysfP1eFnicyLxjMdqjJb37eAON8vpDGdMr/89RpYHa6yJLwsopcnKpfp/OZY7z4Ne/LZW+6uxtkJhkm/KDVP5izE+pr2Ncdviw5hzlaJ6yLpdj/GNuMby77F8iQAJZ861YfLDmnNtkPzw5lwbIj/MOdcGyA920Wro8p2vnSwIz3+t0ILuWByBOnLTf8VZ4a27+kMlf7nACT7nivbTPXhxU5yL59T+yMCDw+bWhGOWFw0Y066Pd0Qr3hGteEdYa+O5zc345bdpIUbBnMh0ZZioul2LWOuDOMUbW1rCThgyPm4ufrFKbpbMvlv1e3jA7TtaWlpamsMfwGp0UFDsZm0AAAAASUVORK5CYII=",WT="/xline-home/assets/cncf-logo-text-9f32c1ea.png",VT=L.footer` + background-image: url(${jT}); + background-size: cover; +`,YT=L.div` + max-width: 1440px; + margin-inline: auto; + padding-inline: 128px; + padding-block: 64px; + @media screen and (max-width: 1024px) { + padding-inline: 96px; + padding-block: 48px; + } + @media screen and (max-width: 768px) { + padding-inline: 64px; + padding-block: 32px; + } +`,XT=L.div` + display: flex; + flex-wrap: wrap; + justify-content: space-around; +`,uu=L.div` + margin-inline: 32px; + margin-bottom: 48px; + color: white; + width: 200px; + @media screen and (max-width: 1024px) { + margin-inline: 24px; + margin-bottom: 36px; + } + @media screen and (max-width: 768px) { + margin-inline: 16px; + margin-bottom: 24px; + } +`,du=L.h2` + padding-bottom: 32px; + margin-bottom: 32px; + font-weight: 500; + font-size: 28px; + text-transform: capitalize; + border-bottom: 1px solid white; + cursor: default; + @media screen and (max-width: 1024px) { + font-size: 21px; + padding-bottom: 24px; + margin-bottom: 24px; + } + @media screen and (max-width: 768px) { + font-size: 14px; + padding-bottom: 16px; + margin-bottom: 16px; + } +`,hu=L.ul``,Qi=L.li` + margin-bottom: 28px; + font-weight: 400; + font-size: 22px; + text-transform: capitalize; + cursor: pointer; + @media screen and (max-width: 1024px) { + margin-bottom: 21px; + font-size: 16.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 14px; + font-size: 11px; + } +`,KT=L.div` + padding-bottom: 40px; + display: flex; + justify-content: space-between; + align-items: center; + /* flex-wrap: wrap; */ + @media screen and (max-width: 1024px) { + padding-bottom: 36px; + } + @media screen and (max-width: 768px) { + padding-bottom: 24px; + } +`,GT=L.img` + height: 48px; + margin-bottom: 8px; + cursor: pointer; + @media screen and (max-width: 1024px) { + height: 34px; + } + @media screen and (max-width: 768px) { + height: 22px; + } + /* @media screen and (max-width: 512px) { + display: none; + } */ + @media screen and (max-width: 320px) { + height: 18px; + } +`;L.div` + flex: 1; + /* @media screen and (max-width: 512px) { + display: none; + } */ +`;const km=L.div` + display: flex; + align-items: center; + height: 32px; + margin-left: 32px; + margin-bottom: 8px; + color: white; + cursor: pointer; + @media screen and (max-width: 1024px) { + height: 24px; + margin-left: 24px; + } + @media screen and (max-width: 768px) { + height: 16px; + margin-left: 16px; + } +`,xw=L.img` + height: 100%; + margin-right: 16px; + @media screen and (max-width: 1024px) { + margin-right: 12px; + } + @media screen and (max-width: 768px) { + margin-right: 8px; + } +`,kw=L.p` + font-weight: 600; + font-size: 24px; + line-height: 1; + @media screen and (max-width: 1024px) { + font-size: 18px; + } + @media screen and (max-width: 768px) { + font-size: 12px; + } +`,QT=L.div` + margin-left: -4%; + width: 108%; + padding-top: 32px; + + color: #fff; + border-top: 1px solid #fff; +`,Sw=L.div` + padding-bottom: 16px; + text-align: center; + font-weight: 600; + font-size: 18px; + line-height: 1; + &:last-child { + padding-bottom: 0; + } + @media screen and (max-width: 1024px) { + padding-bottom: 12px; + font-size: 13.5px; + } + @media screen and (max-width: 768px) { + padding-bottom: 8px; + font-size: 9px; + } +`,ZT=L(km)` + cursor: default; +`,JT=L.img` + height: 100%; +`,eA=L.img` + height: 100%; +`,tA=()=>{const e=Hi();return k.jsx(k.Fragment,{children:k.jsx(VT,{children:k.jsxs(YT,{children:[k.jsxs(XT,{children:[k.jsxs(uu,{children:[k.jsx(du,{children:"docs"}),k.jsx(hu,{children:e6.map(({title:t,url:n})=>k.jsx(Qi,{onClick:()=>{e(n),window.scrollTo(0,0)},children:t},t))})]}),k.jsxs(uu,{children:[k.jsx(du,{children:"deep dive"}),k.jsx(hu,{children:t6.map(({title:t,url:n})=>k.jsx(Qi,{onClick:()=>{e(n),window.scrollTo(0,0)},children:t},t))})]}),k.jsxs(uu,{children:[k.jsx(du,{children:"community"}),k.jsxs(hu,{children:[k.jsx(Qi,{onClick:()=>{e("/contribute"),window.scrollTo(0,0)},children:"contribute"}),k.jsx(Qi,{onClick:()=>window.location.href="https://discord.gg/XyFXGpSfvb",children:"chat"}),k.jsx(Qi,{onClick:()=>{e("/GSoC"),window.scrollTo(0,0)},children:"2024 GSoC"}),k.jsx(Qi,{onClick:()=>{e("/meeting"),window.scrollTo(0,0)},children:"Community Meeting"})]})]}),k.jsxs(uu,{children:[k.jsx(du,{children:"resources"}),k.jsxs(hu,{children:[k.jsx(Qi,{onClick:()=>{e("/blog"),window.scrollTo(0,0)},children:"blog"}),k.jsx(Qi,{onClick:()=>{e("/video"),window.scrollTo(0,0)},children:"video"})]})]})]}),k.jsxs(KT,{children:[k.jsx(GT,{src:h1,alt:"Xline",onClick:()=>{window.scrollTo(0,0),e("/")}}),k.jsxs("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center"},children:[k.jsxs(ZT,{children:[k.jsx(JT,{src:HT}),k.jsx(eA,{src:WT})]}),k.jsxs(km,{as:"a",href:"https://github.com/datenlord/xline",children:[k.jsx(xw,{src:J3,alt:"icon"}),k.jsx(kw,{children:"GitHub"})]}),k.jsxs(km,{as:"a",href:"https://discord.gg/XyFXGpSfvb",children:[k.jsx(xw,{src:qT,alt:"icon"}),k.jsx(kw,{children:"Discord"})]})]})]}),k.jsxs(QT,{children:[k.jsx(Sw,{children:"We are a Cloud Native Computing Foundation sandbox project."}),k.jsx(Sw,{children:"Xline for The Linux Foundation®"})]})]})})})},nA=()=>k.jsxs(k.Fragment,{children:[k.jsx(UT,{}),k.jsx(KE,{}),k.jsx(tA,{})]}),rA="/xline-home/assets/home-cover-d1b85aac.png",Wi="/xline-home/assets/underline-992439df.svg",iA="/xline-home/assets/home-introduction-7de62c15.png",aA="/xline-home/assets/home-feature-e6cc5478.png",oA="/xline-home/assets/home-feature-icon-1-633a0944.svg",sA="/xline-home/assets/home-feature-icon-2-f72f9c54.svg",lA="/xline-home/assets/home-feature-icon-3-f98e76a4.svg",cA="/xline-home/assets/home-feature-icon-4-25befa9a.svg",uA="/xline-home/assets/home-innovation-48569455.svg",dA=L.div` + background-image: url(${rA}); + background-size: cover; +`,hA=L.div` + max-width: 1440px; + margin-inline: auto; + padding-top: calc(86px + 134px); + padding-bottom: 96px; + padding-inline: 156px; + color: white; + @media screen and (max-width: 1024px) { + padding-top: calc(69px + 100px); + padding-bottom: 72px; + padding-inline: 117px; + } + @media screen and (max-width: 768px) { + padding-top: calc(53px + 67px); + padding-bottom: 48px; + padding-inline: 78px; + } +`,fA=L.img` + width: 346px; + height: 100px; + margin-bottom: 36px; + @media screen and (max-width: 1024px) { + width: 225px; + height: 65px; + margin-bottom: 28px; + } + @media screen and (max-width: 786px) { + width: 104px; + height: 30px; + margin-bottom: 24px; + } +`,pA=L.h1` + max-width: 90%; + margin-bottom: 32px; + font-weight: 500; + font-size: 39px; + @media screen and (max-width: 1024px) { + margin-bottom: 24px; + font-size: 28.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 16px; + font-size: 19px; + } +`,mA=L.button` + display: flex; + align-items: center; + height: 56px; + padding-inline: 48px; + color: ${e=>e.theme.color.white}; + font-size: 26px; + text-transform: capitalize; + background: linear-gradient( + 90deg, + hsla(270, 50%, 60%, 1), + hsla(257, 97%, 73%, 1) 50%, + hsla(266, 87%, 75%, 1) + ); + border: none; + border-radius: 50vh; + cursor: pointer; + @media screen and (max-width: 1024px) { + height: 42px; + padding-inline: 36px; + font-size: 19.5px; + } + @media screen and (max-width: 768px) { + height: 28px; + padding-inline: 24px; + font-size: 13px; + } +`,gA=L.div` + background: hsl(210, 20%, 98%); +`,yA=L.div` + /* display: flex; */ + max-width: 1440px; + margin-inline: auto; + padding-block: ${({theme:e})=>e.scale.xxl}; + padding-inline: 96px; + @media screen and (max-width: 1024px) { + padding-block: 96px; + padding-inline: 72px; + } + @media screen and (max-width: 768px) { + padding-block: 64px; + padding-inline: 48px; + } +`,bA=L.img` + float: right; + width: 40%; + margin-left: 40px; + margin-bottom: 40px; + object-fit: contain; + @media screen and (max-width: 1024px) { + margin-left: 30px; + margin-bottom: 30px; + } + @media screen and (max-width: 768px) { + margin-left: 20px; + margin-bottom: 20px; + } + @media screen and (max-width: 425px) { + width: 100%; + margin-left: 0px; + } +`,wA=L.div``,vA=L.p` + margin-bottom: ${({theme:e})=>e.scale.md}; + font-weight: 400; + font-size: 20px; + line-height: 1.6; + @media screen and (max-width: 1024px) { + font-size: 15px; + } + @media screen and (max-width: 768px) { + font-size: 10px; + } +`,xA=L.ul` + padding-left: ${({theme:e})=>e.scale.lg}; + @media screen and (max-width: 1024px) { + padding-left: 48px; + } + @media screen and (max-width: 768px) { + padding-left: 32px; + } +`,wf=L.li` + position: relative; + margin-bottom: ${({theme:e})=>e.scale.sm}; + font-weight: 400; + font-size: 20px; + line-height: 1.7; + @media screen and (max-width: 1024px) { + font-size: 15px; + } + @media screen and (max-width: 768px) { + font-size: 10px; + } + ::before { + content: ''; + position: absolute; + left: -48px; + top: 4px; + height: 32px; + width: 32px; + background: linear-gradient(90deg, #767ee5, #9966cc); + border-radius: 50%; + @media screen and (max-width: 1024px) { + left: -36px; + top: 3px; + width: 24px; + height: 24px; + } + @media screen and (max-width: 768px) { + left: -24px; + top: 2px; + width: 16px; + height: 16px; + } + } +`,kA=L.div``,SA=L.div` + display: flex; + /* align-items: center; */ + max-width: 1440px; + margin-inline: auto; + padding-block: ${({theme:e})=>e.scale.xxl}; + padding-inline: 96px; + @media screen and (max-width: 1440px) { + flex-direction: column; + } + @media screen and (max-width: 1024px) { + padding-block: 96px; + padding-inline: 72px; + } + @media screen and (max-width: 768px) { + padding-block: 64px; + padding-inline: 48px; + } +`,_A=L.div` + flex-shrink: 0; + width: 25%; + margin-right: 48px; + @media screen and (max-width: 1440px) { + width: 100%; + margin-right: 0; + margin-bottom: 16px; + } +`,EA=L.h2` + position: relative; + margin-top: 104px; + margin-bottom: 96px; + font-weight: 700; + font-size: 44px; + line-height: 1.4; + @media screen and (max-width: 1440px) { + margin-top: 0; + margin-bottom: 0px; + text-align: center; + } + @media screen and (max-width: 1024px) { + font-size: 36px; + } + @media screen and (max-width: 768px) { + font-size: 24px; + } + /* ::after { + content: ''; + z-index: -1; + position: absolute; + bottom: 0; + right: 50px; + display: inline-block; + width: 250px; + height: 30px; + background-image: url(${Wi}); + background-repeat: no-repeat; + background-size: contain; + } */ +`,CA=L.img` + display: block; + margin-inline: auto; + width: 100%; + @media screen and (max-width: 1440px) { + width: 30%; + } +`,TA=L.div` + display: flex; + justify-content: space-between; + align-content: space-between; + flex: 1; + flex-flow: wrap; +`,fu=L.div` + width: 48%; + padding: 16px; + @media screen and (max-width: 425px) { + width: 100%; + } +`,pu=L.div` + display: flex; + align-items: center; + justify-content: center; + width: 102px; + height: 102px; + margin-bottom: 32px; + background: linear-gradient(90deg, #767ee5, #9966cc); + border-radius: 24px; + @media screen and (max-width: 1024px) { + width: 76.5px; + height: 76.5px; + margin-bottom: 24px; + border-radius: 18px; + } + @media screen and (max-width: 768px) { + width: 51px; + height: 51px; + margin-bottom: 16px; + border-radius: 12px; + } +`,mu=L.img` + width: 50%; + height: 50%; +`,gu=L.h3` + margin-bottom: 16px; + font-weight: 500; + font-size: 28px; + line-height: 1.2; + @media screen and (max-width: 1024px) { + font-size: 21px; + margin-bottom: 12px; + } + @media screen and (max-width: 768px) { + font-size: 14px; + margin-bottom: 8px; + } +`,yu=L.p` + font-weight: 400; + font-size: 16px; + line-height: 1.5; + color: hsla(0, 0%, 0%, 0.6); + @media screen and (max-width: 1024px) { + font-size: 12px; + line-height: 1.3; + } + @media screen and (max-width: 768px) { + font-size: 8px; + line-height: 1.1; + } +`,AA=L.div` + background: #f9fafb; +`,RA=L.div` + display: flex; + max-width: 1440px; + margin-inline: auto; + padding-block: ${({theme:e})=>e.scale.xxl}; + padding-inline: 96px; + @media screen and (max-width: 1440px) { + flex-direction: column; + } + @media screen and (max-width: 1024px) { + padding-block: 96px; + padding-inline: 72px; + } + @media screen and (max-width: 768px) { + padding-block: 64px; + padding-inline: 48px; + } +`,MA=L.div` + flex-shrink: 0; + width: 25%; + margin-right: 48px; + @media screen and (max-width: 1440px) { + width: 100%; + margin-right: 0; + margin-bottom: 16px; + } +`,NA=L.div` + text-align: center; +`,IA=L.div` + display: inline-block; + position: relative; + width: 100%; + /* height: 70px; */ + margin-inline: auto; + margin-top: 72px; + margin-bottom: 48px; + font-weight: 700; + font-size: 44px; + line-height: 1.4; + /* background-image: url(${Wi}); + background-repeat: no-repeat; + background-position: bottom 0 right 0; */ + @media screen and (max-width: 1440px) { + margin-top: 0; + margin-bottom: 0; + } + @media screen and (max-width: 1024px) { + font-size: 36px; + } + @media screen and (max-width: 768px) { + font-size: 24px; + } +`,OA=L.img` + display: block; + position: relative; + left: 16px; + width: 100%; + margin-inline: auto; + object-fit: contain; + @media screen and (max-width: 1440px) { + left: 12px; + width: 30%; + } +`,DA=L.div` + flex: 1; + padding: 48px; + height: min-content; + background: white; + border-radius: 24px; + @media screen and (max-width: 1024px) { + padding: 36px; + border-radius: 18px; + } + @media screen and (max-width: 768px) { + padding: 24px; + border-radius: 12px; + } +`,vf=L.p` + margin-bottom: 32px; + font-weight: 400; + font-size: 18px; + line-height: 1.4; + @media screen and (max-width: 1024px) { + margin-bottom: 24px; + font-size: 13.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 16px; + font-size: 9px; + } +`,LA=()=>{const e=Hi();return k.jsxs(k.Fragment,{children:[k.jsx(dA,{children:k.jsxs(hA,{children:[k.jsx(fA,{src:h1,alt:"Xline"}),k.jsx(pA,{children:"A High-Performance Geo-distributed Metadata Management System"}),k.jsx(mA,{onClick:()=>e("/docs/Get-Started"),children:"get start"})]})}),k.jsx(gA,{children:k.jsxs(yA,{children:[k.jsx(bA,{src:iA,alt:"Image"}),k.jsxs(wA,{children:[k.jsx(vA,{children:"Data isolation and data fragmentation resulting from cloud barriers have become impediments to business growth. The biggest challenge of multi-data center architecture is how to maintain strong data consistency and ensure high performance. Traditional single-data center solutions cannot meet the availability, performance, and consistency requirements of multi-data center scenarios."}),k.jsxs(xA,{children:[k.jsx(wf,{children:"Xline is a distributed KV storage for metadata management. Xline makes it possible to manage metadata, such as indexes, permissions, and configurations across multiple clusters."}),k.jsx(wf,{children:"Xline can achieve high-performance data access and strong consistency in cross data center scenarios."}),k.jsx(wf,{children:"Xline is compatible with the ETCD interface, so that existing ETCD users can seamlessly switch to Xline and get high-performance metadata management across multiple clusters."})]})]})]})}),k.jsx(kA,{children:k.jsxs(SA,{children:[k.jsxs(_A,{children:[k.jsx(EA,{children:"Key Features of Xline"}),k.jsx(CA,{src:aA,alt:"Image"})]}),k.jsxs(TA,{children:[k.jsxs(fu,{children:[k.jsx(pu,{children:k.jsx(mu,{src:oA,alt:"icon"})}),k.jsx(gu,{children:"A distributed KV storage engine for multi-cluster"}),k.jsx(yu,{children:"Unified data management for multi-cluster scenarios, making mutual access, discovery, and modification simple and convenient."})]}),k.jsxs(fu,{children:[k.jsx(pu,{children:k.jsx(mu,{src:sA,alt:"icon"})}),k.jsx(gu,{children:"A unified metadata management system"}),k.jsx(yu,{children:"Data access across clouds by caching hot data in memory, and provide unified data management to automate data migration and backup."})]}),k.jsxs(fu,{children:[k.jsx(pu,{children:k.jsx(mu,{src:lA,alt:"icon"})}),k.jsx(gu,{children:"A high-performance multi-datacenter consensus protocol"}),k.jsx(yu,{children:"It is the first geo distributed consistency management service based on the WAN consensus protocol. It addresses the challenges of convergence and consistency across clouds."})]}),k.jsxs(fu,{children:[k.jsx(pu,{children:k.jsx(mu,{src:cA,alt:"icon"})}),k.jsx(gu,{children:"Compatible with the ETCD interface"}),k.jsx(yu,{children:"Provide KV interface, Multi-Version Concurrency Control and is compatible with K8S."})]})]})]})}),k.jsx(AA,{children:k.jsxs(RA,{children:[k.jsxs(MA,{children:[k.jsx(NA,{children:k.jsx(IA,{children:"Innovation"})}),k.jsx(OA,{src:uA,alt:"image"})]}),k.jsxs(DA,{children:[k.jsx(vf,{children:"Cross-datacenter network latency is the most important factor that impacts the performance of geo-distributed systems, especially when a consensus protocol is used. As is well known, consensus protocols are frequently used to achieve high availability. For instance, Etcd uses the Raft protocol, which is quite popular in recently developed systems."}),k.jsx(vf,{children:"Although Raft is stable and easy to implement, it takes 2 RTTs to complete a consensus request from the view of a client. One RTT takes place between the client and the leader server, and the leader server takes another RTT to broadcast the message to the follower servers. In a geo-distributed environment where an RTT can run from tens to hundreds of milliseconds, two RTTs would be too expensive."}),k.jsx(vf,{children:"We adopt a new consensus protocol named CURP to resolve the above issue. Please refer to the paper for a detailed description. The main benefit of the protocol is reducing 1 RTT when contention is not too high. As far as we know, Xline is the first product to use CURP."})]})]})})]})},PA="/xline-home/assets/contribute-cover-754f3436.svg",zA="/xline-home/assets/contribute-how-f55a255f.svg",FA="/xline-home/assets/protocol-icon-f31ce54b.svg",BA="/xline-home/assets/sever-icon-1e1bff49.svg",bu=L.div` + text-align: center; + margin-bottom: 24px; + @media screen and (max-width: 1024px) { + margin-bottom: 18px; + } + @media screen and (max-width: 768px) { + margin-bottom: 12px; + } +`,wu=L.div` + display: inline-block; + position: relative; + margin-inline: auto; + font-weight: 700; + font-size: 46px; + line-height: 2; + background-image: url(${Wi}); + background-repeat: no-repeat; + background-position: bottom 0 right 0; + background-size: 50%; + @media screen and (max-width: 1024px) { + font-size: 34.5px; + line-height: 1.3; + } + @media screen and (max-width: 768px) { + font-size: 23px; + } +`,_w=L.p` + text-align: center; + margin-bottom: 48px; + font-weight: 500; + font-size: 28px; + line-height: 1.5; + @media screen and (max-width: 1024px) { + margin-bottom: 36px; + font-size: 21px; + } + @media screen and (max-width: 768px) { + margin-bottom: 24px; + font-size: 14px; + } +`,$A=L.div` + display: flex; + align-items: center; + padding-block: calc(160px + 86px); + color: white; + background-image: url(${PA}); + background-repeat: no-repeat; + background-size: cover; + @media screen and (max-width: 1024px) { + padding-block: calc(120px + 69px); + } + @media screen and (max-width: 768px) { + padding-block: calc(80px + 53px); + } +`,UA=L.div` + width: 100%; + max-width: ${e=>e.theme.scale.scale12}; + margin-inline: auto; + padding-inline: 128px; + @media screen and (max-width: 1024px) { + padding-inline: 96px; + } + @media screen and (max-width: 768px) { + padding-inline: 64px; + } +`,jA=L.h1` + margin-bottom: 20px; + font-weight: 700; + font-size: 72px; + line-height: 80px; + text-transform: capitalize; + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 54px; + line-height: 60px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 36px; + line-height: 40px; + } +`,qA=L.p` + font-weight: 500; + font-size: 30px; + line-height: 1.5; + @media screen and (max-width: 1024px) { + font-size: 22.5px; + } + @media screen and (max-width: 768px) { + font-size: 22.5px; + } +`,HA=L.div``,WA=L.div` + max-width: ${e=>e.theme.scale.scale12}; + margin-inline: auto; + padding-inline: 128px; + padding-block: 80px; + line-height: 1.5; + @media screen and (max-width: 1024px) { + padding-inline: 96px; + padding-block: 60px; + } + @media screen and (max-width: 768px) { + padding-inline: 64px; + padding-block: 40px; + } +`,VA=L.div` + display: flex; + align-items: center; + text-align: left; + @media screen and (max-width: 768px) { + flex-direction: column; + } +`,YA=L.p` + height: min-content; + padding: ${e=>e.theme.scale.scale06}; + background: #f9fafb; + font-weight: 600; + font-size: 28px; + line-height: 1.5; + border-radius: 24px; + @media screen and (max-width: 1024px) { + padding: 60px; + font-size: 21px; + border-radius: 18px; + } + @media screen and (max-width: 768px) { + padding: 40px; + font-size: 14px; + border-radius: 12px; + margin-bottom: 24px; + } + @media screen and (max-width: 768px) { + padding: 20px; + } +`,XA=L.img` + width: 40%; + @media screen and (max-width: 425px) { + width: 70%; + } +`,KA=L.div` + background: #f9fafb; +`,GA=L.div` + width: 100%; + max-width: ${e=>e.theme.scale.scale12}; + margin-inline: auto; + padding-inline: 128px; + padding-block: ${e=>e.theme.scale.scale06}; + @media screen and (max-width: 1024px) { + padding-inline: 96px; + padding-block: 60px; + } + @media screen and (max-width: 768px) { + padding-inline: 64px; + padding-block: 40px; + } +`,QA=L.div` + display: flex; + justify-content: space-between; + @media screen and (max-width: 768px) { + flex-direction: column; + } +`,Ew=L.div` + display: flex; + flex-flow: column; + align-items: center; + width: 48%; + padding: 64px; + background: #fff; + box-shadow: 0px 2px 15px -4px rgba(0, 0, 0, 0.11); + border-radius: 24px; + @media screen and (max-width: 1024px) { + padding: 48px; + border-radius: 18px; + } + @media screen and (max-width: 768px) { + padding: 32px; + border-radius: 12px; + width: 100%; + margin-bottom: 24px; + :last-child { + margin-bottom: 0; + } + } +`,Cw=L.img` + width: 54px; + margin-bottom: 32px; + @media screen and (max-width: 1024px) { + width: 40.5px; + } + @media screen and (max-width: 768px) { + width: 27px; + } +`,Tw=L.h3` + margin-bottom: 32px; + font-weight: 500; + font-size: 28px; + line-height: 1.5; + @media screen and (max-width: 1024px) { + font-size: 21px; + margin-bottom: 24px; + } + @media screen and (max-width: 768px) { + font-size: 14px; + margin-bottom: 16px; + } +`,Aw=L.p` + font-weight: 400; + font-size: 18px; + line-height: 1.5; + @media screen and (max-width: 1024px) { + font-size: 13.5px; + } + @media screen and (max-width: 768px) { + font-size: 9px; + } +`,ZA=L.div``,JA=L.div` + max-width: ${e=>e.theme.scale.scale12}; + margin-inline: auto; + padding-inline: ${e=>e.theme.scale.scale07}; + padding-block: ${e=>e.theme.scale.scale06}; + @media screen and (max-width: 1024px) { + padding-inline: 96px; + padding-block: 60px; + } + @media screen and (max-width: 768px) { + padding-inline: 64px; + padding-block: 40px; + } +`,eR=L.div` + padding: 64px; + background: #f9fafb; + border-radius: 24px; + text-align: left; + @media screen and (max-width: 1024px) { + padding: 48px; + border-radius: 18px; + } + @media screen and (max-width: 768px) { + padding: 32px; + border-radius: 12px; + } +`,tR=L.p` + font-weight: 400; + font-size: 22px; + line-height: 1.6; + @media screen and (max-width: 1024px) { + font-size: 16.5px; + } + @media screen and (max-width: 768px) { + font-size: 11px; + } +`,nR=L.ul` + list-style-type: disc; + padding-left: 2em; +`,Ao=L.li` + font-weight: 400; + font-size: 22px; + line-height: 1.6; + @media screen and (max-width: 1024px) { + font-size: 16.5px; + } + @media screen and (max-width: 768px) { + font-size: 11px; + } +`,rR=L.div` + background: #f9fafb; +`,iR=L.div` + max-width: ${e=>e.theme.scale.scale12}; + margin-inline: auto; + padding-inline: ${e=>e.theme.scale.scale07}; + padding-block: ${e=>e.theme.scale.scale06}; + @media screen and (max-width: 1024px) { + padding-inline: 96px; + padding-block: 60px; + } + @media screen and (max-width: 768px) { + padding-inline: 64px; + padding-block: 40px; + } +`,aR=L.p` + text-align: center; + font-weight: 500; + font-size: 28px; + line-height: 1.5; + margin-bottom: 256px; + @media screen and (max-width: 1024px) { + margin-bottom: 192px; + font-size: 21px; + } + @media screen and (max-width: 768px) { + margin-bottom: 128px; + font-size: 14px; + } +`,oR=()=>k.jsxs(k.Fragment,{children:[k.jsx($A,{children:k.jsxs(UA,{children:[k.jsx(jA,{children:"contribute"}),k.jsx(qA,{children:"As an open-source project, Xline cannot grow without the support and participation of contributors from the community. If you would like to contribute to this project, be it Xline's code, documentation, or even our website, we would appreciate your help. We are glad to provide any support along the way."})]})}),k.jsx(HA,{children:k.jsxs(WA,{children:[k.jsx(bu,{children:k.jsx(wu,{children:"How to be a contributor?"})}),k.jsxs(VA,{children:[k.jsx(YA,{children:"As soon as a PR(Pull Request) proposed by you is approved and merged, you can become an Xline contributor!"}),k.jsx(XA,{src:zA,alt:"image"})]})]})}),k.jsx(KA,{children:k.jsxs(GA,{children:[k.jsx(bu,{children:k.jsx(wu,{children:"Pick an area to contribute"})}),k.jsx(_w,{children:"You can choose one of the following areas to contribute to:"}),k.jsxs(QA,{children:[k.jsxs(Ew,{children:[k.jsx(Cw,{src:FA,alt:"icon"}),k.jsx(Tw,{children:"CURP Protocol"}),k.jsx(Aw,{children:"The CURP distributed consensus algorithm implemented in Rust. Read Contribute to Xline for details on how to make contributions to the CURP code base."})]}),k.jsxs(Ew,{children:[k.jsx(Cw,{src:BA,alt:"icon"}),k.jsx(Tw,{children:"Xline Server"}),k.jsx(Aw,{children:"The Xline distributed KV storage backend implemented in Rust. Read Contribute to Xline for details on how to make contributions to the CURP code base."})]})]})]})}),k.jsx(ZA,{children:k.jsxs(JA,{children:[k.jsx(bu,{children:k.jsx(wu,{children:"Find an issue to work on"})}),k.jsx(_w,{children:"For beginners, we have prepared many suitable tasks for you. You can check out, for example, our Help Wanted issues in the repository."}),k.jsxs(eR,{children:[k.jsx(tR,{children:"See below for some commonly used labels across major repositories listed in:"}),k.jsxs(nR,{children:[k.jsx(Ao,{children:"bug - Indicates an unexpected problem or unintended behavior; it can be small or big in scope"}),k.jsx(Ao,{children:"good first issue - An ideal first issue to work on for first-time contributors, with mentoring available"}),k.jsx(Ao,{children:"help wanted - Indicates that a maintainer wants help on an issue or pull request"}),k.jsx(Ao,{children:"discussion - Status: Under discussion or needs discussion"}),k.jsx(Ao,{children:"enhancement - New feature or request"}),k.jsx(Ao,{children:"question - Further information is requested, or the question is to be answered."})]})]})]})}),k.jsx(rR,{children:k.jsxs(iR,{children:[k.jsx(bu,{children:k.jsx(wu,{children:"Ask a question"})}),k.jsxs(aR,{children:["If you need any help to get started, understand the codebase, or make a PR(or anything else really), please feel free to ask us on",k.jsx("a",{href:"https://discord.gg/8PrRCP3s",children:" Discord"}),"."]})]})})]}),Rw=["http","https","mailto","tel"];function sR(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */var lR=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const n6=lR;function El(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Mw(e.position):"start"in e||"end"in e?Mw(e):"line"in e||"column"in e?Sm(e):""}function Sm(e){return Nw(e&&e.line)+":"+Nw(e&&e.column)}function Mw(e){return Sm(e&&e.start)+"-"+Sm(e&&e.end)}function Nw(e){return e&&typeof e=="number"?e:1}class vr extends Error{constructor(t,n,r){const i=[null,null];let a={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const o=r.indexOf(":");o===-1?i[1]=r:(i[0]=r.slice(0,o),i[1]=r.slice(o+1))}n&&("type"in n||"position"in n?n.position&&(a=n.position):"start"in n||"end"in n?a=n:("line"in n||"column"in n)&&(a.start=n)),this.name=El(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=a.start.line,this.column=a.start.column,this.position=a,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}vr.prototype.file="";vr.prototype.name="";vr.prototype.reason="";vr.prototype.message="";vr.prototype.stack="";vr.prototype.fatal=null;vr.prototype.column=null;vr.prototype.line=null;vr.prototype.source=null;vr.prototype.ruleId=null;vr.prototype.position=null;const Xr={basename:cR,dirname:uR,extname:dR,join:hR,sep:"/"};function cR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');vc(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function uR(e){if(vc(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function dR(e){vc(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function hR(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pR(e,t){let n="",r=0,i=-1,a=0,o=-1,s,l;for(;++o<=e.length;){if(o2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function vc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mR={cwd:gR};function gR(){return"/"}function _m(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function yR(e){if(typeof e=="string")e=new URL(e);else if(!_m(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return bR(e)}function bR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||nd.call(t,i)},Fw=function(t,n){Dw&&n.name==="__proto__"?Dw(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Bw=function(t,n){if(n==="__proto__")if(nd.call(t,n)){if(Lw)return Lw(t,n).value}else return;return t[n]},$w=function e(){var t,n,r,i,a,o,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});lo.length;let l;s&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l instanceof Promise?l.then(a,i):l instanceof Error?i(l):a(l))}function i(o,...s){n||(n=!0,t(o,...s))}function a(o){i(null,o)}}const kR=o6().freeze(),a6={}.hasOwnProperty;function o6(){const e=vR(),t=[];let n={},r,i=-1;return a.data=o,a.Parser=void 0,a.Compiler=void 0,a.freeze=s,a.attachers=t,a.use=l,a.parse=c,a.stringify=u,a.run=d,a.runSync=f,a.process=p,a.processSync=m,a;function a(){const h=o6();let v=-1;for(;++v{if(E||!N||!F)A(E);else{const q=a.stringify(N,F);q==null||(ER(q)?F.value=q:F.result=q),A(E,F)}});function A(E,N){E||!N?x(E):w?w(N):v(null,N)}}}function m(h){let v;a.freeze(),_f("processSync",a.Parser),Ef("processSync",a.Compiler);const y=rl(h);return a.process(y,w),qw("processSync","process",v),y;function w(x){v=!0,Ow(x)}}}function Uw(e,t){return typeof e=="function"&&e.prototype&&(SR(e.prototype)||t in e.prototype)}function SR(e){let t;for(t in e)if(a6.call(e,t))return!0;return!1}function _f(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function Ef(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function Cf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jw(e){if(!Em(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function qw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function rl(e){return _R(e)?e:new r6(e)}function _R(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ER(e){return typeof e=="string"||n6(e)}function CR(e,t){const n=(t||{}).includeImageAlt;return s6(e,typeof n=="boolean"?n:!0)}function s6(e,t){return TR(e)&&("value"in e&&e.value||t&&"alt"in e&&e.alt||"children"in e&&Hw(e.children,t))||Array.isArray(e)&&Hw(e,t)||""}function Hw(e,t){const n=[];let r=-1;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),[].splice.apply(e,o);else for(n&&[].splice.apply(e,[t,n]);a0?(Gn(e,e.length,0,t),e):t}const Ww={}.hasOwnProperty;function l6(e){const t={};let n=-1;for(;++no))return;const N=t.events.length;let F=N,q,K;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(q){K=t.events[F][1].end;break}q=!0}for(y(r),E=N;Ex;){const A=n[_];t.containerState=A[1],A[0].exit.call(t,e)}n.length=x}function w(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function zR(e,t,n){return it(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Wd(e){if(e===null||Qt(e)||Qh(e))return 1;if(Zh(e))return 2}function Jh(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),f=Object.assign({},e[n][1].start);Xw(d,-l),Xw(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:f},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=or(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=or(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=or(c,Jh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=or(c,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=or(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Gn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n=4?o(c):n(c)}function o(c){return c===null?l(c):Me(c)?e.attempt(KR,o,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||Me(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function QR(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Me(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):it(e,a,"linePrefix",4+1)(o)}function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):Me(o)?i(o):n(o)}}const ZR={name:"codeText",tokenize:tM,resolve:JR,previous:eM};function JR(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function f6(e,t,n,r,i,a,o,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(y),e.exit(a),f):y===null||y===41||Zl(y)?n(y):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function f(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(s),f(y)):y===null||y===60||Me(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function h(y){return y===40?++u>c?n(y):(e.consume(y),h):y===41?u--?(e.consume(y),h):(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(y)):y===null||Qt(y)?u?n(y):(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(y)):Zl(y)?n(y):(e.consume(y),y===92?v:h)}function v(y){return y===40||y===41||y===92?(e.consume(y),h):h(y)}}function p6(e,t,n,r,i,a){const o=this;let s=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),u}function u(p){return p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs||s>999?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Me(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Me(p)||s++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l=l||!gt(p),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function m6(e,t,n,r,i,a){let o;return s;function s(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,l}function l(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(a),c(f))}function c(f){return f===o?(e.exit(a),l(o)):f===null?n(f):Me(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),it(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===o||f===null||Me(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===o||f===92?(e.consume(f),u):u(f)}}function Cl(e,t){let n;return r;function r(i){return Me(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):gt(i)?it(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function zr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lM={name:"definition",tokenize:uM},cM={tokenize:dM,partial:!0};function uM(e,t,n){const r=this;let i;return a;function a(l){return e.enter("definition"),p6.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(l)}function o(l){return i=zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),l===58?(e.enter("definitionMarker"),e.consume(l),e.exit("definitionMarker"),Cl(e,f6(e,e.attempt(cM,it(e,s,"whitespace"),it(e,s,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(l)}function s(l){return l===null||Me(l)?(e.exit("definition"),r.parser.defined.includes(i)||r.parser.defined.push(i),t(l)):n(l)}}function dM(e,t,n){return r;function r(o){return Qt(o)?Cl(e,i)(o):n(o)}function i(o){return o===34||o===39||o===40?m6(e,it(e,a,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o):n(o)}function a(o){return o===null||Me(o)?t(o):n(o)}}const hM={name:"hardBreakEscape",tokenize:fM};function fM(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(a),i}function i(a){return Me(a)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(a)):n(a)}}const pM={name:"headingAtx",tokenize:gM,resolve:mM};function mM(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Gn(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function gM(e,t,n){const r=this;let i=0;return a;function a(u){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&i++<6?(e.consume(u),o):u===null||Qt(u)?(e.exit("atxHeadingSequence"),r.interrupt?t(u):s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Me(u)?(e.exit("atxHeading"),t(u)):gt(u)?it(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Qt(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const yM=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Qw=["pre","script","style","textarea"],bM={name:"htmlFlow",tokenize:xM,resolveTo:vM,concrete:!0},wM={tokenize:kM,partial:!0};function vM(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xM(e,t,n){const r=this;let i,a,o,s,l;return c;function c(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),u}function u(T){return T===33?(e.consume(T),d):T===47?(e.consume(T),m):T===63?(e.consume(T),i=3,r.interrupt?t:V):lr(T)?(e.consume(T),o=String.fromCharCode(T),a=!0,h):n(T)}function d(T){return T===45?(e.consume(T),i=2,f):T===91?(e.consume(T),i=5,o="CDATA[",s=0,p):lr(T)?(e.consume(T),i=4,r.interrupt?t:V):n(T)}function f(T){return T===45?(e.consume(T),r.interrupt?t:V):n(T)}function p(T){return T===o.charCodeAt(s++)?(e.consume(T),s===o.length?r.interrupt?t:W:p):n(T)}function m(T){return lr(T)?(e.consume(T),o=String.fromCharCode(T),h):n(T)}function h(T){return T===null||T===47||T===62||Qt(T)?T!==47&&a&&Qw.includes(o.toLowerCase())?(i=1,r.interrupt?t(T):W(T)):yM.includes(o.toLowerCase())?(i=6,T===47?(e.consume(T),v):r.interrupt?t(T):W(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):a?w(T):y(T)):T===45||_n(T)?(e.consume(T),o+=String.fromCharCode(T),h):n(T)}function v(T){return T===62?(e.consume(T),r.interrupt?t:W):n(T)}function y(T){return gt(T)?(e.consume(T),y):q(T)}function w(T){return T===47?(e.consume(T),q):T===58||T===95||lr(T)?(e.consume(T),x):gt(T)?(e.consume(T),w):q(T)}function x(T){return T===45||T===46||T===58||T===95||_n(T)?(e.consume(T),x):_(T)}function _(T){return T===61?(e.consume(T),A):gt(T)?(e.consume(T),_):w(T)}function A(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,E):gt(T)?(e.consume(T),A):(l=null,N(T))}function E(T){return T===null||Me(T)?n(T):T===l?(e.consume(T),F):(e.consume(T),E)}function N(T){return T===null||T===34||T===39||T===60||T===61||T===62||T===96||Qt(T)?_(T):(e.consume(T),N)}function F(T){return T===47||T===62||gt(T)?w(T):n(T)}function q(T){return T===62?(e.consume(T),K):n(T)}function K(T){return gt(T)?(e.consume(T),K):T===null||Me(T)?W(T):n(T)}function W(T){return T===45&&i===2?(e.consume(T),Ce):T===60&&i===1?(e.consume(T),O):T===62&&i===4?(e.consume(T),G):T===63&&i===3?(e.consume(T),V):T===93&&i===5?(e.consume(T),B):Me(T)&&(i===6||i===7)?e.check(wM,G,X)(T):T===null||Me(T)?X(T):(e.consume(T),W)}function X(T){return e.exit("htmlFlowData"),ue(T)}function ue(T){return T===null?R(T):Me(T)?e.attempt({tokenize:fe,partial:!0},ue,R)(T):(e.enter("htmlFlowData"),W(T))}function fe(T,Q,ne){return ge;function ge(Ee){return T.enter("lineEnding"),T.consume(Ee),T.exit("lineEnding"),$}function $(Ee){return r.parser.lazy[r.now().line]?ne(Ee):Q(Ee)}}function Ce(T){return T===45?(e.consume(T),V):W(T)}function O(T){return T===47?(e.consume(T),o="",Y):W(T)}function Y(T){return T===62&&Qw.includes(o.toLowerCase())?(e.consume(T),G):lr(T)&&o.length<8?(e.consume(T),o+=String.fromCharCode(T),Y):W(T)}function B(T){return T===93?(e.consume(T),V):W(T)}function V(T){return T===62?(e.consume(T),G):T===45&&i===2?(e.consume(T),V):W(T)}function G(T){return T===null||Me(T)?(e.exit("htmlFlowData"),R(T)):(e.consume(T),G)}function R(T){return e.exit("htmlFlow"),t(T)}}function kM(e,t,n){return r;function r(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(xc,t,n)}}const SM={name:"htmlText",tokenize:_M};function _M(e,t,n){const r=this;let i,a,o,s;return l;function l(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),c}function c(R){return R===33?(e.consume(R),u):R===47?(e.consume(R),N):R===63?(e.consume(R),A):lr(R)?(e.consume(R),K):n(R)}function u(R){return R===45?(e.consume(R),d):R===91?(e.consume(R),a="CDATA[",o=0,v):lr(R)?(e.consume(R),_):n(R)}function d(R){return R===45?(e.consume(R),f):n(R)}function f(R){return R===null||R===62?n(R):R===45?(e.consume(R),p):m(R)}function p(R){return R===null||R===62?n(R):m(R)}function m(R){return R===null?n(R):R===45?(e.consume(R),h):Me(R)?(s=m,B(R)):(e.consume(R),m)}function h(R){return R===45?(e.consume(R),G):m(R)}function v(R){return R===a.charCodeAt(o++)?(e.consume(R),o===a.length?y:v):n(R)}function y(R){return R===null?n(R):R===93?(e.consume(R),w):Me(R)?(s=y,B(R)):(e.consume(R),y)}function w(R){return R===93?(e.consume(R),x):y(R)}function x(R){return R===62?G(R):R===93?(e.consume(R),x):y(R)}function _(R){return R===null||R===62?G(R):Me(R)?(s=_,B(R)):(e.consume(R),_)}function A(R){return R===null?n(R):R===63?(e.consume(R),E):Me(R)?(s=A,B(R)):(e.consume(R),A)}function E(R){return R===62?G(R):A(R)}function N(R){return lr(R)?(e.consume(R),F):n(R)}function F(R){return R===45||_n(R)?(e.consume(R),F):q(R)}function q(R){return Me(R)?(s=q,B(R)):gt(R)?(e.consume(R),q):G(R)}function K(R){return R===45||_n(R)?(e.consume(R),K):R===47||R===62||Qt(R)?W(R):n(R)}function W(R){return R===47?(e.consume(R),G):R===58||R===95||lr(R)?(e.consume(R),X):Me(R)?(s=W,B(R)):gt(R)?(e.consume(R),W):G(R)}function X(R){return R===45||R===46||R===58||R===95||_n(R)?(e.consume(R),X):ue(R)}function ue(R){return R===61?(e.consume(R),fe):Me(R)?(s=ue,B(R)):gt(R)?(e.consume(R),ue):W(R)}function fe(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,Ce):Me(R)?(s=fe,B(R)):gt(R)?(e.consume(R),fe):(e.consume(R),i=void 0,Y)}function Ce(R){return R===i?(e.consume(R),O):R===null?n(R):Me(R)?(s=Ce,B(R)):(e.consume(R),Ce)}function O(R){return R===62||R===47||Qt(R)?W(R):n(R)}function Y(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===62||Qt(R)?W(R):(e.consume(R),Y)}function B(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),it(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function V(R){return e.enter("htmlTextData"),s(R)}function G(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}}const p1={name:"labelEnd",tokenize:MM,resolveTo:RM,resolveAll:AM},EM={tokenize:NM},CM={tokenize:IM},TM={tokenize:OM};function AM(e){let t=-1,n;for(;++t-1&&(o[0]=o[0].slice(r)),a>0&&o.push(e[i].slice(0,a))),o}function rN(e,t){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const yN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function w6(e){return e.replace(yN,bN)}function bN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return b6(n.slice(a?2:1),a?16:10)}return f1(n)||e}const v6={}.hasOwnProperty,wN=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),vN(n)(gN(pN(n).document().write(mN()(e,t,!0))))};function vN(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ie),autolinkProtocol:W,autolinkEmail:W,atxHeading:s(ut),blockQuote:s(Ue),characterEscape:W,characterReference:W,codeFenced:s(Ae),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Ae,l),codeText:s(pt,l),codeTextData:W,data:W,codeFlowValue:W,definition:s(et),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s($e),hardBreakEscape:s(de),hardBreakTrailing:s(de),htmlFlow:s(lt,l),htmlFlowData:W,htmlText:s(lt,l),htmlTextData:W,image:s(tt),label:l,link:s(Ie),listItem:s(an),listItemValue:m,listOrdered:s(cn,p),listUnordered:s(cn),paragraph:s($t),reference:ge,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(ut),strong:s(Oe),thematicBreak:s(xe)},exit:{atxHeading:u(),atxHeadingSequence:N,autolink:u(),autolinkEmail:Ne,autolinkProtocol:Se,blockQuote:u(),characterEscapeValue:X,characterReferenceMarkerHexadecimal:Ee,characterReferenceMarkerNumeric:Ee,characterReferenceValue:J,codeFenced:u(w),codeFencedFence:y,codeFencedFenceInfo:h,codeFencedFenceMeta:v,codeFlowValue:X,codeIndented:u(x),codeText:u(Y),codeTextData:X,data:X,definition:u(),definitionDestinationString:E,definitionLabelString:_,definitionTitleString:A,emphasis:u(),hardBreakEscape:u(fe),hardBreakTrailing:u(fe),htmlFlow:u(Ce),htmlFlowData:X,htmlText:u(O),htmlTextData:X,image:u(V),label:R,labelText:G,lineEnding:ue,link:u(B),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:$,resourceDestinationString:T,resourceTitleString:Q,resource:ne,setextHeading:u(K),setextHeadingLineSequence:q,setextHeadingText:F,strong:u(),thematicBreak:u()}};x6(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let M={type:"root",children:[]};const z={stack:[M],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:f,setData:a,getData:o},H=[];let le=-1;for(;++le0){const ye=z.tokenStack[z.tokenStack.length-1];(ye[1]||ev).call(z,void 0,ye[0])}for(M.position={start:Zi(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Zi(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++le{const r=this.data("settings");return wN(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function SN(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function _N(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`}]}function EN(e,t){const n=t.value?t.value+` +`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function CN(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TN(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Is(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function k6(e,t){const n=String(t.identifier).toUpperCase(),r=Is(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let a;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,a=e.footnoteOrder.length):(e.footnoteCounts[n]++,a=i+1);const o=e.footnoteCounts[n],s={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,l),e.applyData(t,l)}function AN(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},k6(e,{type:"footnoteReference",identifier:i,position:t.position})}function RN(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MN(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function S6(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function NN(e,t){const n=e.definition(t.identifier);if(!n)return S6(e,t);const r={src:Is(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function IN(e,t){const n={src:Is(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ON(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function DN(e,t){const n=e.definition(t.identifier);if(!n)return S6(e,t);const r={href:Is(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function LN(e,t){const n={href:Is(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function PN(e,t,n){const r=e.all(t),i=n?zN(n):_6(t),a={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s1}function FN(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i-1?r.offset:null}}}function qN(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=m1(t.children[1]),l=g1(t.children[t.children.length-1]);s.line&&l.line&&(o.position={start:s,end:l}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function HN(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,s=o?o.length:t.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(rv(t.slice(i),i>0,!1)),a.join("")}function rv(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===tv||a===nv;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===tv||a===nv;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function YN(e,t){const n={type:"text",value:VN(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function XN(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const KN={blockquote:SN,break:_N,code:EN,delete:CN,emphasis:TN,footnoteReference:k6,footnote:AN,heading:RN,html:MN,imageReference:NN,image:IN,inlineCode:ON,linkReference:DN,link:LN,listItem:PN,list:FN,paragraph:BN,root:$N,strong:UN,table:qN,tableCell:WN,tableRow:HN,text:YN,thematicBreak:XN,toml:vu,yaml:vu,definition:vu,footnoteDefinition:vu};function vu(){return null}const e0=function(e){if(e==null)return JN;if(typeof e=="string")return ZN(e);if(typeof e=="object")return Array.isArray(e)?GN(e):QN(e);if(typeof e=="function")return t0(e);throw new Error("Expected function, string, or object as test")};function GN(e){const t=[];let n=-1;for(;++n":""))+")"})}return d;function d(){let f=[],p,m,h;if((!t||i(s,l,c[c.length-1]||null))&&(f=nI(n(s,c)),f[0]===iv))return f;if(s.children&&f[0]!==tI)for(m=(r?s.children.length:-1)+a,h=c.concat(s);m>-1&&m{const i=ov(r.identifier);i&&!av.call(t,i)&&(t[i]=r)}),n;function n(r){const i=ov(r);return i&&av.call(t,i)?t[i]:null}}function ov(e){return String(e||"").toUpperCase()}const Vd={}.hasOwnProperty;function aI(e,t){const n=t||{},r=n.allowDangerousHtml||!1,i={};return o.dangerous=r,o.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,o.footnoteLabel=n.footnoteLabel||"Footnotes",o.footnoteLabelTagName=n.footnoteLabelTagName||"h2",o.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},o.footnoteBackLabel=n.footnoteBackLabel||"Back to content",o.unknownHandler=n.unknownHandler,o.passThrough=n.passThrough,o.handlers={...KN,...n.handlers},o.definition=iI(e),o.footnoteById=i,o.footnoteOrder=[],o.footnoteCounts={},o.patch=oI,o.applyData=sI,o.one=s,o.all=l,o.wrap=cI,o.augment=a,n0(e,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();Vd.call(i,u)||(i[u]=c)}),o;function a(c,u){if(c&&"data"in c&&c.data){const d=c.data;d.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=d.hName),u.type==="element"&&d.hProperties&&(u.properties={...u.properties,...d.hProperties}),"children"in u&&u.children&&d.hChildren&&(u.children=d.hChildren)}if(c){const d="type"in c?c:{position:c};rI(d)||(u.position={start:m1(d),end:g1(d)})}return u}function o(c,u,d,f){return Array.isArray(d)&&(f=d,d={}),a(c,{type:"element",tagName:u,properties:d||{},children:f||[]})}function s(c,u){return T6(o,c,u)}function l(c){return y1(o,c)}}function oI(e,t){e.position&&(t.position=jN(e))}function sI(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&a&&(n.properties={...n.properties,...a}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function T6(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return Vd.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:y1(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):lI(e,t)}function y1(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i0&&n.push({type:"text",value:` +`}),n}function uI(e){const t=[];let n=-1;for(;++n1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};s>1&&d.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(d)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const d=c.children[c.children.length-1];d&&d.type==="text"?d.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+o},children:e.wrap(i,!0)};e.patch(r,u),t.push(u)}if(t.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:` +`}]}}function A6(e,t){const n=aI(e,t),r=n.one(e,null),i=uI(n);return i&&r.children.push({type:"text",value:` +`},i),Array.isArray(r)?{type:"root",children:r}:r}const dI=function(e,t){return e&&"run"in e?fI(e,t):pI(e||t)},hI=dI;function fI(e,t){return(n,r,i)=>{e.run(A6(n,t),r,a=>{i(a)})}}function pI(e){return t=>A6(t,e)}var Fe={},mI={get exports(){return Fe},set exports(e){Fe=e}},gI="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",yI=gI,bI=yI;function R6(){}function M6(){}M6.resetWarningCache=R6;var wI=function(){function e(r,i,a,o,s,l){if(l!==bI){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:M6,resetWarningCache:R6};return n.PropTypes=n,n};mI.exports=wI();let kc=class{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}};kc.prototype.property={};kc.prototype.normal={};kc.prototype.space=null;function N6(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&_I.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(lv,AI);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!lv.test(a)){let o=a.replace(EI,TI);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=b1}return new i(r,t)}function TI(e){return"-"+e.toLowerCase()}function AI(e){return e.charAt(1).toUpperCase()}const cv={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},RI=N6([D6,O6,z6,F6,kI],"html"),MI=N6([D6,O6,z6,F6,SI],"svg");function NI(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{n0(t,"element",(n,r,i)=>{const a=i;let o;if(e.allowedElements?o=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(o=e.disallowedElements.includes(n.tagName)),!o&&e.allowElement&&typeof r=="number"&&(o=!e.allowElement(n,r,a)),o&&typeof r=="number")return e.unwrapDisallowed&&n.children?a.children.splice(r,1,...n.children):a.children.splice(r,1),r})}}function II(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function OI(e){return e.join(" ").trim()}function DI(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var Yd={},LI={get exports(){return Yd},set exports(e){Yd=e}},uv=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,PI=/\n/g,zI=/^\s*/,FI=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,BI=/^:\s*/,$I=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,UI=/^[;\s]*/,jI=/^\s+|\s+$/g,qI=` +`,dv="/",hv="*",Ha="",HI="comment",WI="declaration",VI=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var h=m.match(PI);h&&(n+=h.length);var v=m.lastIndexOf(qI);r=~v?m.length-v:r+m.length}function a(){var m={line:n,column:r};return function(h){return h.position=new o(m),c(),h}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(m){var h=new Error(t.source+":"+n+":"+r+": "+m);if(h.reason=m,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function l(m){var h=m.exec(e);if(h){var v=h[0];return i(v),e=e.slice(v.length),h}}function c(){l(zI)}function u(m){var h;for(m=m||[];h=d();)h!==!1&&m.push(h);return m}function d(){var m=a();if(!(dv!=e.charAt(0)||hv!=e.charAt(1))){for(var h=2;Ha!=e.charAt(h)&&(hv!=e.charAt(h)||dv!=e.charAt(h+1));)++h;if(h+=2,Ha===e.charAt(h-1))return s("End of comment missing");var v=e.slice(2,h-2);return r+=2,i(v),e=e.slice(h),r+=2,m({type:HI,comment:v})}}function f(){var m=a(),h=l(FI);if(h){if(d(),!l(BI))return s("property missing ':'");var v=l($I),y=m({type:WI,property:fv(h[0].replace(uv,Ha)),value:v?fv(v[0].replace(uv,Ha)):Ha});return l(UI),y}}function p(){var m=[];u(m);for(var h;h=f();)h!==!1&&(m.push(h),u(m));return m}return c(),p()};function fv(e){return e?e.replace(jI,Ha):Ha}var YI=VI;function B6(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=YI(e),a=typeof t=="function",o,s,l=0,c=i.length;l0?Fn.createElement(p,l,d):Fn.createElement(p,l)}function QI(e){let t=-1;for(;++t for more info)`),delete xu[a]}const t=kR().use(kN).use(e.remarkPlugins||[]).use(hI,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(NI,e),n=new r6;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=Fn.createElement(Fn.Fragment,{},$6({options:e,schema:RI,listDepth:0},r));return e.className&&(i=Fn.createElement("div",{className:e.className},i)),i}Ds.propTypes={children:Fe.string,className:Fe.string,allowElement:Fe.func,allowedElements:Fe.arrayOf(Fe.string),disallowedElements:Fe.arrayOf(Fe.string),unwrapDisallowed:Fe.bool,remarkPlugins:Fe.arrayOf(Fe.oneOfType([Fe.object,Fe.func,Fe.arrayOf(Fe.oneOfType([Fe.bool,Fe.string,Fe.object,Fe.func,Fe.arrayOf(Fe.any)]))])),rehypePlugins:Fe.arrayOf(Fe.oneOfType([Fe.object,Fe.func,Fe.arrayOf(Fe.oneOfType([Fe.bool,Fe.string,Fe.object,Fe.func,Fe.arrayOf(Fe.any)]))])),sourcePos:Fe.bool,rawSourcePos:Fe.bool,skipHtml:Fe.bool,includeElementIndex:Fe.bool,transformLinkUri:Fe.oneOfType([Fe.func,Fe.bool]),linkTarget:Fe.oneOfType([Fe.func,Fe.string]),transformImageUri:Fe.func,components:Fe.object};const rO={tokenize:lO,partial:!0},U6={tokenize:cO,partial:!0},j6={tokenize:uO,partial:!0},us={tokenize:hO,partial:!0},q6={tokenize:dO,partial:!0},H6={tokenize:oO,previous:Y6},W6={tokenize:sO,previous:v1},Vi={tokenize:aO,previous:X6},li={},iO={text:li};let za=48;for(;za<123;)li[za]=Vi,za++,za===58?za=65:za===91&&(za=97);li[43]=Vi;li[45]=Vi;li[46]=Vi;li[95]=Vi;li[72]=[Vi,W6];li[104]=[Vi,W6];li[87]=[Vi,H6];li[119]=[Vi,H6];function aO(e,t,n){const r=this;let i,a;return o;function o(p){return!mv(p)||!X6(r.previous)||x1(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(p))}function s(p){return mv(p)?(e.consume(p),s):p===64?(e.consume(p),l):n(p)}function l(p){return p===46?e.check(us,f,c)(p):p===45||p===95?e.check(us,n,u)(p):_n(p)?(!a&&Hd(p)&&(a=!0),e.consume(p),l):f(p)}function c(p){return e.consume(p),i=!0,a=void 0,l}function u(p){return e.consume(p),d}function d(p){return p===46?e.check(us,n,c)(p):l(p)}function f(p){return i&&!a?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function oO(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Y6(r.previous)||x1(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rO,e.attempt(U6,e.attempt(j6,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function sO(e,t,n){const r=this;return i;function i(m){return m!==72&&m!==104||!v1(r.previous)||x1(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),e.consume(m),a)}function a(m){return m===84||m===116?(e.consume(m),o):n(m)}function o(m){return m===84||m===116?(e.consume(m),s):n(m)}function s(m){return m===80||m===112?(e.consume(m),l):n(m)}function l(m){return m===83||m===115?(e.consume(m),c):c(m)}function c(m){return m===58?(e.consume(m),u):n(m)}function u(m){return m===47?(e.consume(m),d):n(m)}function d(m){return m===47?(e.consume(m),f):n(m)}function f(m){return m===null||Zl(m)||Qh(m)||Zh(m)?n(m):e.attempt(U6,e.attempt(j6,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function lO(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return l===87||l===119?(e.consume(l),a):n(l)}function a(l){return l===87||l===119?(e.consume(l),o):n(l)}function o(l){return l===46?(e.consume(l),s):n(l)}function s(l){return l===null||Me(l)?n(l):t(l)}}function cO(e,t,n){let r,i;return a;function a(l){return l===38?e.check(q6,s,o)(l):l===46||l===95?e.check(us,s,o)(l):l===null||Zl(l)||Qh(l)||l!==45&&Zh(l)?s(l):(e.consume(l),a)}function o(l){return l===46?(i=r,r=void 0,e.consume(l),a):(l===95&&(r=!0),e.consume(l),a)}function s(l){return!i&&!r?t(l):n(l)}}function uO(e,t){let n=0;return r;function r(o){return o===38?e.check(q6,t,i)(o):(o===40&&n++,o===41?e.check(us,a,i)(o):w1(o)?t(o):V6(o)?e.check(us,t,i)(o):(e.consume(o),r))}function i(o){return e.consume(o),r}function a(o){return n--,n<0?t(o):i(o)}}function dO(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return lr(o)?(e.consume(o),i):o===59?(e.consume(o),a):n(o)}function a(o){return w1(o)?t(o):n(o)}}function hO(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return V6(a)?(e.consume(a),i):w1(a)?t(a):n(a)}}function V6(e){return e===33||e===34||e===39||e===41||e===42||e===44||e===46||e===58||e===59||e===60||e===63||e===95||e===126}function w1(e){return e===null||e===60||Qt(e)}function mv(e){return e===43||e===45||e===46||e===95||_n(e)}function Y6(e){return e===null||e===40||e===42||e===95||e===126||Qt(e)}function v1(e){return e===null||!lr(e)}function X6(e){return e!==47&&v1(e)}function x1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const fO={tokenize:xO,partial:!0};function pO(){return{document:{[91]:{tokenize:bO,continuation:{tokenize:wO},exit:vO}},text:{[91]:{tokenize:yO},[93]:{add:"after",tokenize:mO,resolveTo:gO}}}}function mO(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!o||!o._balanced)return n(l);const c=zr(r.sliceSerialize({start:o.end,end:r.now()}));return c.charCodeAt(0)!==94||!a.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function gO(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function yO(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return s;function s(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){let p;return f===null||f===91||a++>999?n(f):f===93?o?(e.exit("chunkString"),p=e.exit("gfmFootnoteCallString"),i.includes(zr(r.sliceSerialize(p)))?d(f):n(f)):n(f):(e.consume(f),Qt(f)||(o=!0),f===92?u:c)}function u(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}function d(f){return e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}}function bO(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,s;return l;function l(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),u):n(h)}function u(h){let v;return h===null||h===91||o>999?n(h):h===93?s?(v=e.exit("gfmFootnoteDefinitionLabelString"),a=zr(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p):n(h):Me(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),o++,u):(e.enter("chunkString").contentType="string",d(h))}function d(h){return h===null||Me(h)||h===91||h===93||o>999?(e.exit("chunkString"),u(h)):(Qt(h)||(s=!0),o++,e.consume(h),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,d):d(h)}function p(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),it(e,m,"gfmFootnoteDefinitionWhitespace")):n(h)}function m(h){return i.includes(a)||i.push(a),t(h)}}function wO(e,t,n){return e.check(xc,t,e.attempt(fO,t,n))}function vO(e){e.exit("gfmFootnoteDefinition")}function xO(e,t,n){const r=this;return it(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function kO(e={}){let t=e.singleTilde;const n={tokenize:i,resolveAll:r};return t==null&&(t=!0),{text:{[126]:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(a,o){let s=-1;for(;++s1?s(p):(a.consume(p),u++,f);if(u<2&&!t)return s(p);const h=a.exit("strikethroughSequenceTemporary"),v=Wd(p);return h._open=!v||v===2&&!!m,h._close=!m||m===2&&!!v,o(p)}}}const SO={flow:{null:{tokenize:EO,resolve:_O}}},gv={tokenize:CO,partial:!0};function _O(e,t){let n=-1,r,i,a,o,s,l,c;for(;++n=4?B(R):(r._gfmTableDynamicInterruptHack=!0,O.check(r.parser.constructs.flow,function(Q){return r._gfmTableDynamicInterruptHack=!1,B(Q)},function(Q){return r._gfmTableDynamicInterruptHack=!1,Y(Q)})(R))}}}function CO(e,t,n){let r=0;return i;function i(o){return e.enter("check"),e.consume(o),a}function a(o){return o===-1||o===32?(e.consume(o),r++,r===4?t:a):o===null||Qt(o)?t(o):n(o)}}const TO={tokenize:RO},AO={text:{[91]:TO}};function RO(e,t,n){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),a)}function a(s){return Qt(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),o):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),o):n(s)}function o(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),e.check({tokenize:MO},t,n)):n(s)}}function MO(e,t,n){const r=this;return it(e,i,"whitespace");function i(a){const o=r.events[r.events.length-1];return(o&&o[1].type==="whitespace"||Me(a))&&a!==null?t(a):n(a)}}function NO(e){return l6([iO,pO(),kO(e),SO,AO])}function yv(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function IO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const OO={}.hasOwnProperty,DO=function(e,t,n,r){let i,a;typeof t=="string"||t instanceof RegExp?(a=[[t,n]],i=r):(a=t,i=n),i||(i={});const o=e0(i.ignore||[]),s=LO(a);let l=-1;for(;++l0?{type:"text",value:N}:void 0),N!==!1&&(v!==A&&x.push({type:"text",value:d.value.slice(v,A)}),Array.isArray(N)?x.push(...N):N&&x.push(N),v=A+_[0].length,w=!0),!m.global)break;_=m.exec(d.value)}return w?(ve}const Nf="phrasing",If=["autolink","link","image","label"],PO={transforms:[qO],enter:{literalAutolink:FO,literalAutolinkEmail:Of,literalAutolinkHttp:Of,literalAutolinkWww:Of},exit:{literalAutolink:jO,literalAutolinkEmail:UO,literalAutolinkHttp:BO,literalAutolinkWww:$O}},zO={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Nf,notInConstruct:If},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Nf,notInConstruct:If},{character:":",before:"[ps]",after:"\\/",inConstruct:Nf,notInConstruct:If}]};function FO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Of(e){this.config.enter.autolinkProtocol.call(this,e)}function BO(e){this.config.exit.autolinkProtocol.call(this,e)}function $O(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function UO(e){this.config.exit.autolinkEmail.call(this,e)}function jO(e){this.exit(e)}function qO(e){DO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,HO],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,WO]],{ignore:["link","linkReference"]})}function HO(e,t,n,r,i){let a="";if(!K6(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!VO(n)))return!1;const o=YO(n+r);if(!o[0])return!1;const s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function WO(e,t,n,r){return!K6(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function VO(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function YO(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=yv(e,"(");let a=yv(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function K6(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Qh(n)||Zh(n))&&(!t||n!==47)}function G6(e){return e.label||!e.identifier?e.label||"":w6(e.identifier)}function XO(e,t,n){const r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[];let s=-1;for(r.push(-1);++s + +`}return` + +`}const GO=/\r?\n|\r/g;function QO(e,t){const n=[];let r=0,i=0,a;for(;a=GO.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join("");function o(s){n.push(t(s,i,!s))}}function Q6(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function ZO(e,t){return vv(e,t.inConstruct,!0)&&!vv(e,t.notInConstruct,!1)}function vv(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r=c||u+10?" ":"")),i.shift(4),a+=i.move(QO(XO(e,n,i.current()),hD)),o(),a}function hD(e,t,n){return t===0?e:(n?"":" ")+e}function e5(e,t,n){const r=t.indexStack,i=e.children||[],a=[];let o=-1,s=n.before;r.push(-1);let l=t.createTracker(n);for(;++o0&&(s==="\r"||s===` +`)&&c.type==="html"&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/," "),s=" ",l=t.createTracker(n),l.move(a.join(""))),a.push(l.move(t.handle(c,e,t,{...l.current(),before:s,after:u}))),s=a[a.length-1].slice(-1)}return r.pop(),a.join("")}const fD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];t5.peek=bD;const pD={canContainEols:["delete"],enter:{strikethrough:gD},exit:{strikethrough:yD}},mD={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:fD}],handlers:{delete:t5}};function gD(e){this.enter({type:"delete",children:[]},e)}function yD(e){this.exit(e)}function t5(e,t,n,r){const i=r0(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=e5(e,n,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function bD(){return"~"}n5.peek=wD;function n5(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++al&&(l=e[c].length);++vs[v])&&(s[v]=w)}m.push(y)}a[c]=m,o[c]=h}let u=-1;if(typeof n=="object"&&"length"in n)for(;++us[u]&&(s[u]=y),f[u]=y),d[u]=w}a.splice(1,0,d),o.splice(1,0,f),c=-1;const p=[];for(;++cn==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function ED(e){this.exit(e),this.setData("inTable")}function CD(e){this.enter({type:"tableRow",children:[]},e)}function Df(e){this.exit(e)}function Sv(e){this.enter({type:"tableCell",children:[]},e)}function TD(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,AD));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function AD(e,t){return t==="|"?t:e}function RD(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:o,tableRow:s,tableCell:l,inlineCode:f}};function o(p,m,h,v){return c(u(p,h,v),p.align)}function s(p,m,h,v){const y=d(p,h,v),w=c([y]);return w.slice(0,w.indexOf(` +`))}function l(p,m,h,v){const y=h.enter("tableCell"),w=h.enter("phrasing"),x=e5(p,h,{...v,before:a,after:a});return w(),y(),x}function c(p,m){return vD(p,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(p,m,h){const v=p.children;let y=-1;const w=[],x=m.enter("table");for(;++y-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const s=n.createTracker(r);s.move(a+" ".repeat(o-a.length)),s.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),u);return l(),c;function u(d,f,p){return f?(p?"":" ".repeat(o))+d:(p?a:a+" ".repeat(o-a.length))+d}}const OD={exit:{taskListCheckValueChecked:_v,taskListCheckValueUnchecked:_v,paragraph:LD}},DD={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:PD}};function _v(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function LD(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1],r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,o;for(;++a]+>",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional(a)+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:h,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},A={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},E=[A,d,s,n,e.C_BLOCK_COMMENT_MODE,u,c],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:E.concat([{begin:/\(/,end:/\)/,keywords:_,contains:E.concat(["self"]),relevance:0}]),relevance:0},F={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function $D(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=BD(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function UD(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(o);const s={className:"",begin:/\\"/},l={className:"string",begin:/'/,end:/'/},c={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=e.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),f={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},p=["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],m=["true","false"],h={match:/(\/[a-z._-]+)+/},v=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],y=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],x=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:p,literal:m,built_in:[...v,...y,"set","shopt",...w,...x]},contains:[d,e.SHEBANG(),f,c,e.HASH_COMMENT_MODE,a,h,o,s,l,n]}}function jD(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="<[^<>]+>",o="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional(a)+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[d,s,n,e.C_BLOCK_COMMENT_MODE,u,c],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:v}}}function qD(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="<[^<>]+>",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional(a)+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:h,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},A={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},E=[A,d,s,n,e.C_BLOCK_COMMENT_MODE,u,c],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:E.concat([{begin:/\(/,end:/\)/,keywords:_,contains:E.concat(["self"]),relevance:0}]),relevance:0},F={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function HD(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(a),built_in:t,literal:r},s=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=e.inherit(c,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:o},f=e.inherit(d,{illegal:/\n/}),p={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,f]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},h=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});d.contains=[m,p,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],f.contains=[h,p,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const v={variants:[m,p,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},s]},w=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",x={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},v,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},s,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+w+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,y],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[v,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},x]}}const WD=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),VD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],YD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],XD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],KD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],GD=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function QD(e){const t=e.regex,n=WD(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",s=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+XD.join("|")+")"},{begin:":(:)?("+KD.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+GD.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:YD.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+VD.join("|")+")\\b"}]}}function ZD(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function JD(e){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"r5(e,t,n-1))}function nL(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+r5("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Ev,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Ev,c]}}const Cv="[A-Za-z$_][0-9A-Za-z$_]*",rL=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],iL=["true","false","null","undefined","NaN","Infinity"],i5=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a5=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o5=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],aL=["arguments","this","super","console","window","document","localStorage","module","global"],oL=[].concat(o5,i5,a5);function sL(e){const t=e.regex,n=(Y,{after:B})=>{const V="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,B)=>{const V=Y[0].length+Y.index,G=Y.input[V];if(G==="<"||G===","){B.ignoreMatch();return}G===">"&&(n(Y,{after:V})||B.ignoreMatch());let R;const T=Y.input.substring(V);if(R=T.match(/^\s*=/)){B.ignoreMatch();return}if((R=T.match(/^\s+extends\s+/))&&R.index===0){B.ignoreMatch();return}}},s={$pattern:Cv,keyword:rL,literal:iL,built_in:oL,"variable.language":aL},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},h={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,{match:/\$\d+/},d];f.contains=w.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(w)});const x=[].concat(y,f.contains),_=x.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(x)}]),A={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:_},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...i5,...a5]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(Y){return t.concat("(?!",Y.join("|"),")")}const X={match:t.concat(/\b/,W([...o5,"super","import"]),r,t.lookahead(/\(/)),className:"title.function",relevance:0},ue={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},Ce="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Ce)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,y,{match:/\$\d+/},d,N,{className:"attr",begin:r+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:Ce,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ue,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},X,K,E,fe,{match:/\$[(.]/}]}}function lL(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Lo="[0-9](_*[0-9])*",_u=`\\.(${Lo})`,Eu="[0-9a-fA-F](_*[0-9a-fA-F])*",cL={className:"number",variants:[{begin:`(\\b(${Lo})((${_u})|\\.)?|(${_u}))[eE][+-]?(${Lo})[fFdD]?\\b`},{begin:`\\b(${Lo})((${_u})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_u})[fFdD]?\\b`},{begin:`\\b(${Lo})[fFdD]\\b`},{begin:`\\b0[xX]((${Eu})\\.?|(${Eu})?\\.(${Eu}))[pP][+-]?(${Lo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Eu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function uL(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(o);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},c=cL,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,n,r,s,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,l,o,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},c]}}const dL=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),hL=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fL=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],s5=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],l5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],pL=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),mL=s5.concat(l5);function gL(e){const t=dL(e),n=mL,r="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",o=[],s=[],l=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},c=function(x,_,A){return{className:x,begin:_,relevance:A}},u={$pattern:/[a-z-]+/,keyword:r,attribute:fL.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:u,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const f=s.concat({begin:/\{/,end:/\}/,contains:o}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},m={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pL.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},h={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:s,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+hL.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",a,0),c("selector-id","#"+a),c("selector-class","\\."+a,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+s5.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+l5.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,v,w,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function yL(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function bL(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),f=e.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let p=[n,l];return[c,u,d,f].forEach(v=>{v.contains=v.contains.concat(p)}),p=p.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,a,c,u,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,o]}}function vL(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,s={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:s,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function xL(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[e.BACKSLASH_ESCAPE,a,s],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(p,m,h="\\1")=>{const v=h==="\\1"?h:t.concat(h,m);return t.concat(t.concat("(?:",p,")"),m,/(?:\\.|[^\\\/])*?/,v,/(?:\\.|[^\\\/])*?/,h,r)},d=(p,m,h)=>t.concat(t.concat("(?:",p,")"),m,/(?:\\.|[^\\\/])*?/,h,r),f=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",t.either(...c,{capture:!0}))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",t.either(...c,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=f,o.contains=f,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:f}}function kL(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),u=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),d=`[ +]`,f={scope:"string",variants:[c,l,u]},p={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},m=["false","null","true"],h=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:h,literal:(X=>{const ue=[];return X.forEach(fe=>{ue.push(fe),fe.toLowerCase()===fe?ue.push(fe.toUpperCase()):ue.push(fe.toLowerCase())}),ue})(m),built_in:v},x=X=>X.map(ue=>ue.replace(/\|\d+$/,"")),_={variants:[{match:[/new/,t.concat(d,"+"),t.concat("(?!",x(v).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(r,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},F={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[N,a,E,e.C_BLOCK_COMMENT_MODE,f,p,_]},q={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",x(h).join("\\b|"),"|",x(v).join("\\b|"),"\\b)"),r,t.concat(d,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[F]};F.contains.push(q);const K=[N,E,e.C_BLOCK_COMMENT_MODE,f,p,_],W={begin:t.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:m,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:m,keyword:["new","array"]},contains:["self",...K]},...K,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:w,contains:[W,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},a,q,E,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},_,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",a,E,e.C_BLOCK_COMMENT_MODE,f,p]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},f,p]}}function SL(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function _L(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function EL(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,m=`\\b|${r.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${f})[jJ](?=${m})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",l,h,d,e.HASH_COMMENT_MODE]}]};return c.contains=[d,h,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|->|\?)|=>/,contains:[l,h,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},d,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,y,d]}]}}function CL(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function TL(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[a,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function AL(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:o},d={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},E=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=E,h.contains=E;const N="[>?]>",F="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",q="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",K=[{begin:/^\s*=>/,starts:{end:"$",contains:E}},{className:"meta.prompt",begin:"^("+N+"|"+F+"|"+q+")(?=[ ])",starts:{end:"$",keywords:o,contains:E}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(K).concat(c).concat(E)}}function RL(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],a=["true","false","Some","None","Ok","Err"],o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],s=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:s,keyword:i,literal:a,built_in:o},illegal:""},n]}}const ML=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),NL=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],IL=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],OL=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],DL=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],LL=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function PL(e){const t=ML(e),n=DL,r=OL,i="@[a-z-]+",a="and or not only",s={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+NL.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+LL.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,s,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:IL.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function zL(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function FL(e){const t=e.regex,n=e.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],s=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,m=[...c,...l].filter(x=>!u.includes(x)),h={className:"variable",begin:/@[a-z0-9]+/},v={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={begin:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function w(x,{exceptions:_,when:A}={}){const E=A;return _=_||[],x.map(N=>N.match(/\|\d+$/)||_.includes(N)?N:E(N)?`${N}|0`:N)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(m,{when:x=>x.length<3}),literal:a,type:s,built_in:d},contains:[{begin:t.either(...f),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:m.concat(f),literal:a,type:s}},{className:"type",begin:t.either(...o)},y,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function c5(e){return e?typeof e=="string"?e:e.source:null}function Cu(e){return bt("(?=",e,")")}function bt(...e){return e.map(n=>c5(n)).join("")}function BL(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Dn(...e){return"("+(BL(e).capture?"":"?:")+e.map(r=>c5(r)).join("|")+")"}const k1=e=>bt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),$L=["Protocol","Type"].map(k1),Tv=["init","self"].map(k1),UL=["Any","Self"],Lf=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Av=["false","nil","true"],jL=["assignment","associativity","higherThan","left","lowerThan","none","right"],qL=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],Rv=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],u5=Dn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),d5=Dn(u5,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Pf=bt(u5,d5,"*"),h5=Dn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Xd=Dn(h5,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),yi=bt(h5,Xd,"*"),zf=bt(/[A-Z]/,Xd,"*"),HL=["autoclosure",bt(/convention\(/,Dn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",bt(/objc\(/,yi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],WL=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function VL(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Dn(...$L,...Tv)],className:{2:"keyword"}},a={match:bt(/\./,Dn(...Lf)),relevance:0},o=Lf.filter(Se=>typeof Se=="string").concat(["_|0"]),s=Lf.filter(Se=>typeof Se!="string").concat(UL).map(k1),l={variants:[{className:"keyword",match:Dn(...s,...Tv)}]},c={$pattern:Dn(/\b\w+/,/#\w+/),keyword:o.concat(qL),literal:Av},u=[i,a,l],d={match:bt(/\./,Dn(...Rv)),relevance:0},f={className:"built_in",match:bt(/\b/,Dn(...Rv),/(?=\()/)},p=[d,f],m={match:/->/,relevance:0},h={className:"operator",relevance:0,variants:[{match:Pf},{match:`\\.(\\.|${d5})+`}]},v=[m,h],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Se="")=>({className:"subst",variants:[{match:bt(/\\/,Se,/[0\\tnr"']/)},{match:bt(/\\/,Se,/u\{[0-9a-fA-F]{1,8}\}/)}]}),A=(Se="")=>({className:"subst",match:bt(/\\/,Se,/[\t ]*(?:[\r\n]|\r\n)/)}),E=(Se="")=>({className:"subst",label:"interpol",begin:bt(/\\/,Se,/\(/),end:/\)/}),N=(Se="")=>({begin:bt(Se,/"""/),end:bt(/"""/,Se),contains:[_(Se),A(Se),E(Se)]}),F=(Se="")=>({begin:bt(Se,/"/),end:bt(/"/,Se),contains:[_(Se),E(Se)]}),q={className:"string",variants:[N(),N("#"),N("##"),N("###"),F(),F("#"),F("##"),F("###")]},K={match:bt(/`/,yi,/`/)},W={className:"variable",match:/\$\d+/},X={className:"variable",match:`\\$${Xd}+`},ue=[K,W,X],fe={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:WL,contains:[...v,x,q]}]}},Ce={className:"keyword",match:bt(/@/,Dn(...HL))},O={className:"meta",match:bt(/@/,yi)},Y=[fe,Ce,O],B={match:Cu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:bt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Xd,"+")},{className:"type",match:zf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:bt(/\s+&\s+/,Cu(zf)),relevance:0}]},V={begin://,keywords:c,contains:[...r,...u,...Y,m,B]};B.contains.push(V);const G={match:bt(yi,/\s*:/),keywords:"_|0",relevance:0},R={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",G,...r,...u,...p,...v,x,q,...ue,...Y,B]},T={begin://,contains:[...r,B]},Q={begin:Dn(Cu(bt(yi,/\s*:/)),Cu(bt(yi,/\s+/,yi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:yi}]},ne={begin:/\(/,end:/\)/,keywords:c,contains:[Q,...r,...u,...v,x,q,...Y,B,R],endsParent:!0,illegal:/["']/},ge={match:[/func/,/\s+/,Dn(K.match,yi,Pf)],className:{1:"keyword",3:"title.function"},contains:[T,ne,t],illegal:[/\[/,/%/]},$={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[T,ne,t],illegal:/\[|%/},Ee={match:[/operator/,/\s+/,Pf],className:{1:"keyword",3:"title"}},J={begin:[/precedencegroup/,/\s+/,zf],className:{1:"keyword",3:"title"},contains:[B],keywords:[...jL,...Av],end:/}/};for(const Se of q.variants){const Ne=Se.contains.find(Ae=>Ae.label==="interpol");Ne.keywords=c;const Ue=[...u,...p,...v,x,q,...ue];Ne.contains=[...Ue,{begin:/\(/,end:/\)/,contains:["self",...Ue]}]}return{name:"Swift",keywords:c,contains:[...r,ge,$,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:c,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...u]},Ee,J,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...u,...p,...v,x,q,...ue,...Y,B,R]}}const Kd="[A-Za-z$_][0-9A-Za-z$_]*",f5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],p5=["true","false","null","undefined","NaN","Infinity"],m5=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],g5=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],y5=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],b5=["arguments","this","super","console","window","document","localStorage","module","global"],w5=[].concat(y5,m5,g5);function YL(e){const t=e.regex,n=(Y,{after:B})=>{const V="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,B)=>{const V=Y[0].length+Y.index,G=Y.input[V];if(G==="<"||G===","){B.ignoreMatch();return}G===">"&&(n(Y,{after:V})||B.ignoreMatch());let R;const T=Y.input.substring(V);if(R=T.match(/^\s*=/)){B.ignoreMatch();return}if((R=T.match(/^\s+extends\s+/))&&R.index===0){B.ignoreMatch();return}}},s={$pattern:Kd,keyword:f5,literal:p5,built_in:w5,"variable.language":b5},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},h={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,{match:/\$\d+/},d];f.contains=w.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(w)});const x=[].concat(y,f.contains),_=x.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(x)}]),A={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:_},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...m5,...g5]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(Y){return t.concat("(?!",Y.join("|"),")")}const X={match:t.concat(/\b/,W([...y5,"super","import"]),r,t.lookahead(/\(/)),className:"title.function",relevance:0},ue={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},Ce="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Ce)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,y,{match:/\$\d+/},d,N,{className:"attr",begin:r+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:Ce,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ue,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},X,K,E,fe,{match:/\$[(.]/}]}}function XL(e){const t=YL(e),n=Kd,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},s=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:Kd,keyword:f5.concat(s),literal:p5,built_in:w5.concat(r),"variable.language":b5},c={className:"meta",begin:"@"+n},u=(f,p,m)=>{const h=f.contains.findIndex(v=>v.label===p);if(h===-1)throw new Error("can not find mode to replace");f.contains.splice(h,1,m)};Object.assign(t.keywords,l),t.exports.PARAMS_CONTAINS.push(c),t.contains=t.contains.concat([c,i,a]),u(t,"shebang",e.SHEBANG()),u(t,"use_strict",o);const d=t.contains.find(f=>f.label==="func.def");return d.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx"]}),t}function KL(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,u,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function GL(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},s={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,o,i,e.QUOTE_STRING_MODE,l,c,s]}}function QL(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[a,l,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,o,l,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ZL(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",c="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+s+l+c+u+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},h=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},d,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,m,a],v=[...h];return v.pop(),v.push(o),f.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:h}}var S1={exports:{}};function _1(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var n=e[t];typeof n=="object"&&!Object.isFrozen(n)&&_1(n)}),e}S1.exports=_1;S1.exports.default=_1;class Mv{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function v5(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function sa(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const JL="",Nv=e=>!!e.scope||e.sublanguage&&e.language,eP=(e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class tP{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=v5(t)}openNode(t){if(!Nv(t))return;let n="";t.sublanguage?n=`language-${t.language}`:n=eP(t.scope,{prefix:this.classPrefix}),this.span(n)}closeNode(t){Nv(t)&&(this.buffer+=JL)}value(){return this.buffer}span(t){this.buffer+=``}}const Iv=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class E1{constructor(){this.rootNode=Iv(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=Iv({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{E1._collapse(n)}))}}class nP extends E1{constructor(t){super(),this.options=t}addKeyword(t,n){t!==""&&(this.openNode(n),this.addText(t),this.closeNode())}addText(t){t!==""&&this.add(t)}addSublanguage(t,n){const r=t.root;r.sublanguage=!0,r.language=n,this.add(r)}toHTML(){return new tP(this,this.options).value()}finalize(){return!0}}function Jl(e){return e?typeof e=="string"?e:e.source:null}function x5(e){return yo("(?=",e,")")}function rP(e){return yo("(?:",e,")*")}function iP(e){return yo("(?:",e,")?")}function yo(...e){return e.map(n=>Jl(n)).join("")}function aP(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function C1(...e){return"("+(aP(e).capture?"":"?:")+e.map(r=>Jl(r)).join("|")+")"}function k5(e){return new RegExp(e.toString()+"|").exec("").length-1}function oP(e,t){const n=e&&e.exec(t);return n&&n.index===0}const sP=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function T1(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let a=Jl(r),o="";for(;a.length>0;){const s=sP.exec(a);if(!s){o+=a;break}o+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?o+="\\"+String(Number(s[1])+i):(o+=s[0],s[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const lP=/\b\B/,S5="[a-zA-Z]\\w*",A1="[a-zA-Z_]\\w*",_5="\\b\\d+(\\.\\d+)?",E5="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",C5="\\b(0b[01]+)",cP="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",uP=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=yo(t,/.*\b/,e.binary,/\b.*/)),sa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},ec={begin:"\\\\[\\s\\S]",relevance:0},dP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ec]},hP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ec]},fP={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},i0=function(e,t,n={}){const r=sa({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=C1("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:yo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},pP=i0("//","$"),mP=i0("/\\*","\\*/"),gP=i0("#","$"),yP={scope:"number",begin:_5,relevance:0},bP={scope:"number",begin:E5,relevance:0},wP={scope:"number",begin:C5,relevance:0},vP={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[ec,{begin:/\[/,end:/\]/,relevance:0,contains:[ec]}]}]},xP={scope:"title",begin:S5,relevance:0},kP={scope:"title",begin:A1,relevance:0},SP={begin:"\\.\\s*"+A1,relevance:0},_P=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var Tu=Object.freeze({__proto__:null,MATCH_NOTHING_RE:lP,IDENT_RE:S5,UNDERSCORE_IDENT_RE:A1,NUMBER_RE:_5,C_NUMBER_RE:E5,BINARY_NUMBER_RE:C5,RE_STARTERS_RE:cP,SHEBANG:uP,BACKSLASH_ESCAPE:ec,APOS_STRING_MODE:dP,QUOTE_STRING_MODE:hP,PHRASAL_WORDS_MODE:fP,COMMENT:i0,C_LINE_COMMENT_MODE:pP,C_BLOCK_COMMENT_MODE:mP,HASH_COMMENT_MODE:gP,NUMBER_MODE:yP,C_NUMBER_MODE:bP,BINARY_NUMBER_MODE:wP,REGEXP_MODE:vP,TITLE_MODE:xP,UNDERSCORE_TITLE_MODE:kP,METHOD_GUARD:SP,END_SAME_AS_BEGIN:_P});function EP(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function CP(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function TP(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=EP,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function AP(e,t){Array.isArray(e.illegal)&&(e.illegal=C1(...e.illegal))}function RP(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function MP(e,t){e.relevance===void 0&&(e.relevance=1)}const NP=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=yo(n.beforeMatch,x5(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},IP=["of","and","for","in","not","or","if","then","parent","list","value"],OP="keyword";function T5(e,t,n=OP){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(a){Object.assign(r,T5(e[a],t,a))}),r;function i(a,o){t&&(o=o.map(s=>s.toLowerCase())),o.forEach(function(s){const l=s.split("|");r[l[0]]=[a,DP(l[0],l[1])]})}}function DP(e,t){return t?Number(t):LP(e)?0:1}function LP(e){return IP.includes(e.toLowerCase())}const Ov={},to=e=>{console.error(e)},Dv=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ro=(e,t)=>{Ov[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Ov[`${e}/${t}`]=!0)},Gd=new Error;function A5(e,t,{key:n}){let r=0;const i=e[n],a={},o={};for(let s=1;s<=t.length;s++)o[s+r]=i[s],a[s+r]=!0,r+=k5(t[s-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function PP(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw to("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Gd;if(typeof e.beginScope!="object"||e.beginScope===null)throw to("beginScope must be object"),Gd;A5(e,e.begin,{key:"beginScope"}),e.begin=T1(e.begin,{joinWith:""})}}function zP(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw to("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Gd;if(typeof e.endScope!="object"||e.endScope===null)throw to("endScope must be object"),Gd;A5(e,e.end,{key:"endScope"}),e.end=T1(e.end,{joinWith:""})}}function FP(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function BP(e){FP(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),PP(e),zP(e)}function $P(e){function t(o,s){return new RegExp(Jl(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=k5(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(l=>l[1]);this.matcherRe=t(T1(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(s);if(!l)return null;const c=l.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const l=new n;return this.rules.slice(s).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(s);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(s)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(o){const s=new r;return o.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&s.addRule(o.illegal,{type:"illegal"}),s}function a(o,s){const l=o;if(o.isCompiled)return l;[CP,RP,BP,NP].forEach(u=>u(o,s)),e.compilerExtensions.forEach(u=>u(o,s)),o.__beforeBegin=null,[TP,AP,MP].forEach(u=>u(o,s)),o.isCompiled=!0;let c=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),c=o.keywords.$pattern,delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=T5(o.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),s&&(o.begin||(o.begin=/\B|\b/),l.beginRe=t(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=t(l.end)),l.terminatorEnd=Jl(l.end)||"",o.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(l.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(u){return UP(u==="self"?o:u)})),o.contains.forEach(function(u){a(u,l)}),o.starts&&a(o.starts,s),l.matcher=i(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=sa(e.classNameAliases||{}),a(e)}function R5(e){return e?e.endsWithParent||R5(e.starts):!1}function UP(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return sa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:R5(e)?sa(e,{starts:e.starts?sa(e.starts):null}):Object.isFrozen(e)?sa(e):e}var jP="11.7.0";class qP extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Ff=v5,Lv=sa,Pv=Symbol("nomatch"),HP=7,WP=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:nP};function l(O){return s.noHighlightRe.test(O)}function c(O){let Y=O.className+" ";Y+=O.parentNode?O.parentNode.className:"";const B=s.languageDetectRe.exec(Y);if(B){const V=q(B[1]);return V||(Dv(a.replace("{}",B[1])),Dv("Falling back to no-highlight mode for this block.",O)),V?B[1]:"no-highlight"}return Y.split(/\s+/).find(V=>l(V)||q(V))}function u(O,Y,B){let V="",G="";typeof Y=="object"?(V=O,B=Y.ignoreIllegals,G=Y.language):(Ro("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ro("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),G=O,V=Y),B===void 0&&(B=!0);const R={code:V,language:G};fe("before:highlight",R);const T=R.result?R.result:d(R.language,R.code,B);return T.code=R.code,fe("after:highlight",T),T}function d(O,Y,B,V){const G=Object.create(null);function R(ee,xe){return ee.keywords[xe]}function T(){if(!de.keywords){tt.addText(Ie);return}let ee=0;de.keywordPatternRe.lastIndex=0;let xe=de.keywordPatternRe.exec(Ie),U="";for(;xe;){U+=Ie.substring(ee,xe.index);const M=et.case_insensitive?xe[0].toLowerCase():xe[0],z=R(de,M);if(z){const[H,le]=z;if(tt.addText(U),U="",G[M]=(G[M]||0)+1,G[M]<=HP&&(cn+=le),H.startsWith("_"))U+=xe[0];else{const ye=et.classNameAliases[H]||H;tt.addKeyword(xe[0],ye)}}else U+=xe[0];ee=de.keywordPatternRe.lastIndex,xe=de.keywordPatternRe.exec(Ie)}U+=Ie.substring(ee),tt.addText(U)}function Q(){if(Ie==="")return;let ee=null;if(typeof de.subLanguage=="string"){if(!t[de.subLanguage]){tt.addText(Ie);return}ee=d(de.subLanguage,Ie,!0,lt[de.subLanguage]),lt[de.subLanguage]=ee._top}else ee=p(Ie,de.subLanguage.length?de.subLanguage:null);de.relevance>0&&(cn+=ee.relevance),tt.addSublanguage(ee._emitter,ee.language)}function ne(){de.subLanguage!=null?Q():T(),Ie=""}function ge(ee,xe){let U=1;const M=xe.length-1;for(;U<=M;){if(!ee._emit[U]){U++;continue}const z=et.classNameAliases[ee[U]]||ee[U],H=xe[U];z?tt.addKeyword(H,z):(Ie=H,T(),Ie=""),U++}}function $(ee,xe){return ee.scope&&typeof ee.scope=="string"&&tt.openNode(et.classNameAliases[ee.scope]||ee.scope),ee.beginScope&&(ee.beginScope._wrap?(tt.addKeyword(Ie,et.classNameAliases[ee.beginScope._wrap]||ee.beginScope._wrap),Ie=""):ee.beginScope._multi&&(ge(ee.beginScope,xe),Ie="")),de=Object.create(ee,{parent:{value:de}}),de}function Ee(ee,xe,U){let M=oP(ee.endRe,U);if(M){if(ee["on:end"]){const z=new Mv(ee);ee["on:end"](xe,z),z.isMatchIgnored&&(M=!1)}if(M){for(;ee.endsParent&&ee.parent;)ee=ee.parent;return ee}}if(ee.endsWithParent)return Ee(ee.parent,xe,U)}function J(ee){return de.matcher.regexIndex===0?(Ie+=ee[0],1):(Oe=!0,0)}function Se(ee){const xe=ee[0],U=ee.rule,M=new Mv(U),z=[U.__beforeBegin,U["on:begin"]];for(const H of z)if(H&&(H(ee,M),M.isMatchIgnored))return J(xe);return U.skip?Ie+=xe:(U.excludeBegin&&(Ie+=xe),ne(),!U.returnBegin&&!U.excludeBegin&&(Ie=xe)),$(U,ee),U.returnBegin?0:xe.length}function Ne(ee){const xe=ee[0],U=Y.substring(ee.index),M=Ee(de,ee,U);if(!M)return Pv;const z=de;de.endScope&&de.endScope._wrap?(ne(),tt.addKeyword(xe,de.endScope._wrap)):de.endScope&&de.endScope._multi?(ne(),ge(de.endScope,ee)):z.skip?Ie+=xe:(z.returnEnd||z.excludeEnd||(Ie+=xe),ne(),z.excludeEnd&&(Ie=xe));do de.scope&&tt.closeNode(),!de.skip&&!de.subLanguage&&(cn+=de.relevance),de=de.parent;while(de!==M.parent);return M.starts&&$(M.starts,ee),z.returnEnd?0:xe.length}function Ue(){const ee=[];for(let xe=de;xe!==et;xe=xe.parent)xe.scope&&ee.unshift(xe.scope);ee.forEach(xe=>tt.openNode(xe))}let Ae={};function pt(ee,xe){const U=xe&&xe[0];if(Ie+=ee,U==null)return ne(),0;if(Ae.type==="begin"&&xe.type==="end"&&Ae.index===xe.index&&U===""){if(Ie+=Y.slice(xe.index,xe.index+1),!i){const M=new Error(`0 width match regex (${O})`);throw M.languageName=O,M.badRule=Ae.rule,M}return 1}if(Ae=xe,xe.type==="begin")return Se(xe);if(xe.type==="illegal"&&!B){const M=new Error('Illegal lexeme "'+U+'" for mode "'+(de.scope||"")+'"');throw M.mode=de,M}else if(xe.type==="end"){const M=Ne(xe);if(M!==Pv)return M}if(xe.type==="illegal"&&U==="")return 1;if($t>1e5&&$t>xe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ie+=U,U.length}const et=q(O);if(!et)throw to(a.replace("{}",O)),new Error('Unknown language: "'+O+'"');const $e=$P(et);let ut="",de=V||$e;const lt={},tt=new s.__emitter(s);Ue();let Ie="",cn=0,an=0,$t=0,Oe=!1;try{for(de.matcher.considerAll();;){$t++,Oe?Oe=!1:de.matcher.considerAll(),de.matcher.lastIndex=an;const ee=de.matcher.exec(Y);if(!ee)break;const xe=Y.substring(an,ee.index),U=pt(xe,ee);an=ee.index+U}return pt(Y.substring(an)),tt.closeAllNodes(),tt.finalize(),ut=tt.toHTML(),{language:O,value:ut,relevance:cn,illegal:!1,_emitter:tt,_top:de}}catch(ee){if(ee.message&&ee.message.includes("Illegal"))return{language:O,value:Ff(Y),illegal:!0,relevance:0,_illegalBy:{message:ee.message,index:an,context:Y.slice(an-100,an+100),mode:ee.mode,resultSoFar:ut},_emitter:tt};if(i)return{language:O,value:Ff(Y),illegal:!1,relevance:0,errorRaised:ee,_emitter:tt,_top:de};throw ee}}function f(O){const Y={value:Ff(O),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return Y._emitter.addText(O),Y}function p(O,Y){Y=Y||s.languages||Object.keys(t);const B=f(O),V=Y.filter(q).filter(W).map(ne=>d(ne,O,!1));V.unshift(B);const G=V.sort((ne,ge)=>{if(ne.relevance!==ge.relevance)return ge.relevance-ne.relevance;if(ne.language&&ge.language){if(q(ne.language).supersetOf===ge.language)return 1;if(q(ge.language).supersetOf===ne.language)return-1}return 0}),[R,T]=G,Q=R;return Q.secondBest=T,Q}function m(O,Y,B){const V=Y&&n[Y]||B;O.classList.add("hljs"),O.classList.add(`language-${V}`)}function h(O){let Y=null;const B=c(O);if(l(B))return;if(fe("before:highlightElement",{el:O,language:B}),O.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(O)),s.throwUnescapedHTML))throw new qP("One of your code blocks includes unescaped HTML.",O.innerHTML);Y=O;const V=Y.textContent,G=B?u(V,{language:B,ignoreIllegals:!0}):p(V);O.innerHTML=G.value,m(O,B,G.language),O.result={language:G.language,re:G.relevance,relevance:G.relevance},G.secondBest&&(O.secondBest={language:G.secondBest.language,relevance:G.secondBest.relevance}),fe("after:highlightElement",{el:O,result:G,text:V})}function v(O){s=Lv(s,O)}const y=()=>{_(),Ro("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){_(),Ro("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){if(document.readyState==="loading"){x=!0;return}document.querySelectorAll(s.cssSelector).forEach(h)}function A(){x&&_()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",A,!1);function E(O,Y){let B=null;try{B=Y(e)}catch(V){if(to("Language definition for '{}' could not be registered.".replace("{}",O)),i)to(V);else throw V;B=o}B.name||(B.name=O),t[O]=B,B.rawDefinition=Y.bind(null,e),B.aliases&&K(B.aliases,{languageName:O})}function N(O){delete t[O];for(const Y of Object.keys(n))n[Y]===O&&delete n[Y]}function F(){return Object.keys(t)}function q(O){return O=(O||"").toLowerCase(),t[O]||t[n[O]]}function K(O,{languageName:Y}){typeof O=="string"&&(O=[O]),O.forEach(B=>{n[B.toLowerCase()]=Y})}function W(O){const Y=q(O);return Y&&!Y.disableAutodetect}function X(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=Y=>{O["before:highlightBlock"](Object.assign({block:Y.el},Y))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=Y=>{O["after:highlightBlock"](Object.assign({block:Y.el},Y))})}function ue(O){X(O),r.push(O)}function fe(O,Y){const B=O;r.forEach(function(V){V[B]&&V[B](Y)})}function Ce(O){return Ro("10.7.0","highlightBlock will be removed entirely in v12.0"),Ro("10.7.0","Please use highlightElement now."),h(O)}Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:_,highlightElement:h,highlightBlock:Ce,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:E,unregisterLanguage:N,listLanguages:F,getLanguage:q,registerAliases:K,autoDetection:W,inherit:Lv,addPlugin:ue}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=jP,e.regex={concat:yo,lookahead:x5,either:C1,optional:iP,anyNumberOfTimes:rP};for(const O in Tu)typeof Tu[O]=="object"&&S1.exports(Tu[O]);return Object.assign(e,Tu),e};var tc=WP({}),VP=tc;tc.HighlightJS=tc;tc.default=tc;const Or=VP;var Mm={},YP={get exports(){return Mm},set exports(e){Mm=e}};(function(e){(function(){var t;t=e.exports=i,t.format=i,t.vsprintf=r,typeof console<"u"&&typeof console.log=="function"&&(t.printf=n);function n(){console.log(i.apply(null,arguments))}function r(a,o){return i.apply(null,[a].concat(o))}function i(a){for(var o=1,s=[].slice.call(arguments),l=0,c=a.length,u="",d,f=!1,p,m,h=!1,v,y=function(){return s[o++]},w=function(){for(var x="";/\d/.test(a[l]);)x+=a[l++],d=a[l];return x.length>0?parseInt(x):null};li.data.relevance&&(i=o)}return i}function ZP(e,t){Or.registerLanguage(e,t)}const JP=function(e,t){if(typeof e=="string")Or.registerAliases(t,{languageName:e});else{let n;for(n in e)KP.call(e,n)&&Or.registerAliases(e[n],{languageName:n})}};function ez(e){return!!Or.getLanguage(e)}function tz(){return Or.listLanguages()}class nz{constructor(t){this.options=t,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}addKeyword(t,n){this.openNode(n),this.addText(t),this.closeNode()}addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=t.split(".").map((a,o)=>o?a+"_".repeat(o):this.options.classPrefix+a),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const We={highlight:M5,highlightAuto:QP,registerLanguage:ZP,registered:ez,listLanguages:tz,registerAlias:JP};We.registerLanguage("arduino",$D);We.registerLanguage("bash",UD);We.registerLanguage("c",jD);We.registerLanguage("cpp",qD);We.registerLanguage("csharp",HD);We.registerLanguage("css",QD);We.registerLanguage("diff",ZD);We.registerLanguage("go",JD);We.registerLanguage("graphql",eL);We.registerLanguage("ini",tL);We.registerLanguage("java",nL);We.registerLanguage("javascript",sL);We.registerLanguage("json",lL);We.registerLanguage("kotlin",uL);We.registerLanguage("less",gL);We.registerLanguage("lua",yL);We.registerLanguage("makefile",bL);We.registerLanguage("markdown",wL);We.registerLanguage("objectivec",vL);We.registerLanguage("perl",xL);We.registerLanguage("php",kL);We.registerLanguage("php-template",SL);We.registerLanguage("plaintext",_L);We.registerLanguage("python",EL);We.registerLanguage("python-repl",CL);We.registerLanguage("r",TL);We.registerLanguage("ruby",AL);We.registerLanguage("rust",RL);We.registerLanguage("scss",PL);We.registerLanguage("shell",zL);We.registerLanguage("sql",FL);We.registerLanguage("swift",VL);We.registerLanguage("typescript",XL);We.registerLanguage("vbnet",KL);We.registerLanguage("wasm",GL);We.registerLanguage("xml",QL);We.registerLanguage("yaml",ZL);const bo=function(e){if(e==null)return R1;if(typeof e=="string")return iz(e);if(typeof e=="object")return rz(e);if(typeof e=="function")return N5(e);throw new Error("Expected function, string, or array as test")};function rz(e){const t=[];let n=-1;for(;++nl&&(l=c):c&&(l!==void 0&&l>-1&&s.push(` +`.repeat(l)||" "),l=-1,s.push(c))}return s.join("")}function O5(e,t,n){return e.type==="element"?sz(e,t,n):e.type==="text"?n.whitespace==="normal"?D5(e,n):lz(e):[]}function sz(e,t,n){const r=L5(e,n),i=e.children||[];let a=-1,o=[];if(oz(e))return o;let s,l;for(Nm(e)||Uv(e)&&zv(t,e,Uv)?l=` +`:az(e)?(s=2,l=2):I5(e)&&(s=1,l=1);++a-1?r.slice(0,c):r}return(c,u)=>{n0(c,"element",(d,f,p)=>{const m=p;if(!m||!("tagName"in m)||m.tagName!=="pre"||d.tagName!=="code"||!d.properties)return;const h=fz(d);if(h===!1||!h&&!s||h&&i&&i.includes(h))return;Array.isArray(d.properties.className)||(d.properties.className=[]),d.properties.className.includes(l)||d.properties.className.unshift(l);let v;try{v=h?We.highlight(h,jv(m),{prefix:r}):We.highlightAuto(jv(m),{prefix:r,subset:o})}catch(y){const w=y;(!a||!/Unknown language/.test(w.message))&&u.fail(w,d,"rehype-highlight:missing-language");return}!h&&v.data.language&&d.properties.className.push("language-"+v.data.language),Array.isArray(v.children)&&v.children.length>0&&(d.children=v.children)})}}function fz(e){const t=e.properties&&e.properties.className;let n=-1;if(Array.isArray(t))for(;++ne.theme.font.fontFamily}; + font-weight: 700; +`,qv=L(Ls)` + margin-block: 48px; + font-size: 48px; + line-height: 56px; + @media screen and (max-width: 768px) { + margin-block: 36px; + font-size: 36px; + line-height: 42px; + } +`,pz=L(Ls)` + margin-block: 48px; + font-size: 36px; + line-height: 44px; + @media screen and (max-width: 768px) { + margin-block: 36px; + font-size: 27px; + line-height: 33px; + } +`,mz=L(Ls)` + margin-block: 40px; + font-size: 28px; + line-height: 36px; + @media screen and (max-width: 768px) { + margin-block: 30px; + font-size: 21px; + line-height: 27px; + } +`,gz=L(Ls)` + margin-block: 32px; + font-size: 24px; + line-height: 32px; + @media screen and (max-width: 768px) { + margin-block: 24px; + font-size: 18px; + line-height: 24px; + } +`,yz=L(Ls)` + margin-block: 32px; + font-size: 20px; + line-height: 28px; + @media screen and (max-width: 768px) { + margin-block: 24px; + font-size: 15px; + line-height: 21px; + } +`,bz=L(Ls)` + margin-block: 24px; + font-size: 16px; + line-height: 24px; + @media screen and (max-width: 768px) { + margin-block: 18px; + font-size: 12px; + line-height: 18px; + } +`,ct=({level:e,children:t})=>{const n=String(t).split(" ").join("-");switch(e){case 1:return k.jsx(qv,{id:n,children:t});case 2:return k.jsx(pz,{id:n,as:"h2",children:t});case 3:return k.jsx(mz,{id:n,as:"h3",children:t});case 4:return k.jsx(gz,{id:n,as:"h4",children:t});case 5:return k.jsx(yz,{id:n,as:"h5",children:t});case 6:return k.jsx(bz,{id:n,as:"h6",children:t});default:return k.jsx(qv,{id:n,children:t})}},wz=L.p` + margin-block: 0; + margin-block: 32px; + color: #000000e5; + font-family: ${e=>e.theme.font.fontFamily}; + font-weight: 400; + font-size: 18px; + line-height: 28px; + @media screen and (max-width: 768px) { + margin-block: 24px; + font-size: 13.5px; + line-height: 21px; + } +`,Ec=({children:e})=>k.jsx(wz,{children:e}),vz=L.strong` + font-weight: ${e=>e.theme.font.fontWeightBold}; +`,ii=({children:e,type:t="italic"})=>{switch(t){case"italic":return k.jsx("em",{children:e});case"bold":return k.jsx(vz,{children:e});default:return k.jsx("em",{children:e})}},xz=L.div` + height: 1px; + margin-bottom: ${e=>e.theme.scale.scale04}; + background: ${e=>e.theme.color.neutral.gray08}; +`,Cc=()=>k.jsx(xz,{}),Bf=L.ul` + margin-block: 0; + margin-block: 32px; + padding-inline-start: ${e=>e.theme.scale.scale03}; + list-style-type: ${e=>e.ordered?"decimal":"disc"}; + @media screen and (max-width: 768px) { + margin-block: 24px; + } +`,kz=L.li` + margin-block: 8px; + font-weight: 400px; + font-size: 18px; + line-height: 28px; + @media screen and (max-width: 768px) { + margin-block: 6px; + font-size: 13.5px; + line-height: 21px; + } +`,ai=({ordered:e,children:t})=>{switch(e){case!1:return k.jsx(Bf,{ordered:e,children:t});case!0:return k.jsx(Bf,{as:"ol",ordered:e,children:t});default:return k.jsx(Bf,{ordered:e,children:t})}},Tc=({children:e})=>k.jsx(kz,{children:e}),Sz=L.img` + display: block; + max-width: 90%; + margin-block: 32px; + margin-inline: auto; + border-radius: 12px; + @media screen and (max-width: 768px) { + margin-block: 24px; + } +`,Ac=({src:e,alt:t})=>k.jsx(Sz,{src:e,alt:t}),_z=L.blockquote` + margin-inline: 0; + margin-block: 0; + margin-block: 32px; + padding-left: 12px; + border-left: 4px solid #c8c8c8; +`,Rc=({children:e})=>k.jsx(_z,{children:e}),Ez=L.main` + padding: 64px; +`,Cz=` + # Header 1 + ## Header 2 + ### Header 3 + #### Header 4 + ##### Header 5 + ###### Header 6 + + + This text is *italic* _italic_. + + This text is **bold** __bold__. + + This text is ***mix*** ___mix___. + + This text is ~~mix~~ ~~mix~~. + + - - - + + This is a unordered list + + - list 1 + - list 2 + - list 3 + + This is a ordered list + + 1. list 1 + 2. list 2 + 3. list 3 + + > This is a zone + + This is a javascripe code block: \`const hello = 'Hello Word'\` + + ~~~ ts + let num: number = 1 + console.log(num) + ~~~ + +`,Tz=()=>k.jsx(Ez,{children:k.jsx(Ds,{children:Cz,remarkPlugins:[Sc],rehypePlugins:[_c],components:{h1:({level:e,children:t})=>k.jsx(ct,{level:e,children:t}),h2:({level:e,children:t})=>k.jsx(ct,{level:e,children:t}),h3:({level:e,children:t})=>k.jsx(ct,{level:e,children:t}),h4:({level:e,children:t})=>k.jsx(ct,{level:e,children:t}),h5:({level:e,children:t})=>k.jsx(ct,{level:e,children:t}),h6:({level:e,children:t})=>k.jsx(ct,{level:e,children:t}),p:({children:e})=>k.jsx(Ec,{children:e}),em:({children:e})=>k.jsx(ii,{children:e}),strong:({children:e})=>k.jsx(ii,{type:"bold",children:e}),hr:()=>k.jsx(Cc,{}),ul:({depth:e,ordered:t,className:n,children:r})=>k.jsx(ai,{depth:e,ordered:t,className:n,children:r}),ol:({depth:e,ordered:t,className:n,children:r})=>k.jsx(ai,{depth:e,ordered:t,className:n,children:r}),li:({children:e})=>k.jsx(Tc,{children:e}),img:({src:e,alt:t})=>k.jsx(Ac,{src:e,alt:t}),blockquote:({children:e})=>k.jsx(Rc,{children:e})}})}),Az=`# Install + +Read the [quick start](https://github.com/xline-kv/Xline/blob/master/doc/quick-start/README.md) for more information about how to start an xline cluster.`,Rz=`# Xline API + +The current version of Xline implements some etcd-compatible APIs, such as KV API, Auth API, Watch API and so on. In the next release, we will further implement the remaining etcd APIs ( v0.3 ~ v0.5 ) ,such as Maintenance, Lease, and provide a client in different languages ( v0.6 ~ v0.8 ). Read the [roadmap](https://github.com/datenlord/Xline#roadmap) for more details. + +Since Xline is fully compatible with etcd interfaces, you can use etcdctl to interact with Xline cluster in the current version. etcdctl can be used as described in the documentation. For more information, please refer to the [documentation](https://github.com/etcd-io/etcd/tree/main/etcdctl) on how to use etcdctl. Read the etcd-compatible API validation test report for more details.`,Mz=`Xline is a high-performance distributed key-value storage engine for multi-cluster. It can provide unified data management for multi-cluster scenarios, making mutual access, discovery, and modification simple and convenient. It also provides KV interface, Multi-Version Concurrency Control and is compatible with etcd and K8S. + +Xline is the first geo-distributed consistency management service based on CURP(a WAN consensus protocol, read the paper for more details). It addresses the challenges of convergence and consistency across clouds. + +# Architecture + +**An Xline instance consists of the following layers:** + +- Client Layer: Provides a simple and easy-to-use API for clients to use, which can greatly reduce the complexity of using Xline for business. Xline clients in different languages will be implemented in the later release, and currently etcdctl can be used to initiate requests because Xline APIs are compatible with etcd. +- Access Layer: The access layer mainly includes the communication protocol between client to server or server to server. Xline API is based on gRPC protocol. +- CURP Protocol Layer: The CURP protocol layer implements the core algorithm features, such as leader election, log replication, fast-path and slow-path, which are used to ensure data consistency among Xline multi-node and improve service availability. CURP protocol is the cornerstone and highlight of Xline. +- Functional Logic Layer: This layer implements Xline business logic, including the typical KV Server, Auth Server, Lease Server and Watch Server, etc. Client sends requests to Xline Server through the access layer, and Xline Server dispatches the requests to specific servers for execution. +- Storage Layer: This layer contains two components, Index and DB, where Index is based on BTreeMap while DB is mainly responsible for persistent storage of data. At present, Xline is still in the early stage of development, so DB is mainly implemented based on memory. We will introduce persistent storage in the next release. + +![image](/xline-home/docs/Get-Started/image1.png) + +For more information about the Architecture of Xline, read [Xline Architecture Details](/xline-home/#/docs/Xline-Architecture-Details). + +# Xline In 5 Minutes + +1. Download binary from [release](https://github.com/datenlord/Xline/releases) page. +2. Use the following command to start cluster: + +\`\`\`bash +xline --name node1 --members node1=172.20.0.3:2380,172.20.0.3:2381,node2=172.20.0.4:2380,172.20.0.4:2381,node3=172.20.0.5:2380,172.20.0.5:2381 --storage-engine rocksdb --data-dir /usr/local/xline/data-dir --client-listen-urls=http://172.20.0.3:2379 --peer-listen-urls=http://172.20.0.3:2380,http://172.20.0.3:2381 --client-advertise-urls=http://172.20.0.3:2379 --peer-advertise-urls=http://172.20.0.3:2380,http://172.20.0.3:2381 + +xline --name node2 --members node1=172.20.0.3:2380,172.20.0.3:2381,node2=172.20.0.4:2380,172.20.0.4:2381,node3=172.20.0.5:2380,172.20.0.5:2381 --storage-engine rocksdb --data-dir /usr/local/xline/data-dir --client-listen-urls=http://172.20.0.3:2379 --peer-listen-urls=http://172.20.0.3:2380,http://172.20.0.3:2381 --client-advertise-urls=http://172.20.0.3:2379 --peer-advertise-urls=http://172.20.0.3:2380,http://172.20.0.3:2381 + +xline --name node3 --members node1=172.20.0.3:2380,172.20.0.3:2381,node2=172.20.0.4:2380,172.20.0.4:2381,node3=172.20.0.5:2380,172.20.0.5:2381 --storage-engine rocksdb --data-dir /usr/local/xline/data-dir --client-listen-urls=http://172.20.0.3:2379 --peer-listen-urls=http://172.20.0.3:2380,http://172.20.0.3:2381 --client-advertise-urls=http://172.20.0.3:2379 --peer-advertise-urls=http://172.20.0.3:2380,http://172.20.0.3:2381 +\`\`\` + +3. Download or build etcdctl from [etcd](https://github.com/etcd-io/etcd) project. +4. Use etcdctl to operate the cluster: + +\`\`\`bash +$ etcdctl --endpoints=http://127.0.0.1:2379 put foo bar +$ etcdctl --endpoints=http://127.0.0.1:2379 get foo +\`\`\` +`,Nz=`# Performance Comparison + +We compare Xline with ETCD in a simulated multi-cluster environment. The details of the deployment are shown below. + +![image](/xline-home/docs/Deploy/image1.png) + +We compare the performance with two different workloads. One is 1 key case, the other is 100k key space case. Here is the test result. + +![image](/xline-home/docs/Deploy/xline-key-perf.png)`,Iz=`# v0.1.0 + +#### What is it? + +\`Xline\` is a geo-distributed KV store for metadata management, which is based on the \`Curp\` protocol. + +#### Why make it? + +Existing distributed KV stores mostly adopt the \`Raft\` consensus protocol, which takes two RTTs to complete a request. When deployed in a single data center, the latency between nodes is low, so it will not have a big impact on performance. However, when deployed across data centers, the latency between nodes may be tens or hundreds of milliseconds, at which point the \`Raft\` protocol will become a performance bottleneck. The \`Curp\` protocol is designed to solve this problem. It can reduce one RTT when commands do not conflict, thus improving performance. + +#### What does it provide? + +- Etcd Compatible API + - \`Kv\` service + - \`Watch\` service + - \`Auth\` service +- basic implementation of the \`Curp\` protocol +- basic \`Xline\` client (use \`Curp\` directly) +- benchmark tool + +#### Usage + +[Usage doc](https://github.com/datenlord/Xline/blob/v0.1.0/USAGE.md) + +#### Note + +In this release, we only provide binary files for X86_64 linux. Other platforms need to be compiled by yourself. we will add more support in the future. + +#### Links + +GitHub: https://github.com/datenlord/Xline +Paper of Curp: https://www.usenix.org/system/files/nsdi19-park.pdf + +# v0.2.0 + +#### Features: + +- Enable Xline to boot up from the config file xline_server.conf ([#145](https://github.com/datenlord/Xline/pull/145)) +- Support ETCD APIs, like the lease API and the lock API ([#142](https://github.com/datenlord/Xline/pull/145), [#153](https://github.com/datenlord/Xline/pull/145)) +- Enable the recovery mechanism in the CURP module ([#146](https://github.com/datenlord/Xline/pull/145)) +- Add ETCD APIs compatibility test (test report: (report)[./VALIDATION_REPORT.md]) + +#### Fix Bugs + +- Fix panic in the benchmark ([#123](https://github.com/datenlord/Xline/pull/123)) +- Fix the issue that modifies kv pairs will fail after watching them in etcdctl ([#148](https://github.com/datenlord/Xline/pull/123)) + +# v0.3.0 + +#### Features: + +Implement a persistent storage layer to enable durability, including: +Implement a storage engine layer to abstract the concrete storage engine, like rocksdb, +and enable upper layer storage function ([#185](https://github.com/datenlord/Xline/pull/185), [#187](https://github.com/datenlord/Xline/pull/187)) +Enable recover logic for curp and xline ([#194](https://github.com/datenlord/Xline/pull/194), [#184](https://github.com/datenlord/Xline/pull/194)) + +#### Fix Bugs: + +Fix concurrent cmd order bug ([#197](https://github.com/datenlord/Xline/issues/197)) + +# v0.4.0 + +#### Features: + +1. Introduce batching mechanism to improve network bandwidth utilization +2. Implement the snapshot feature for CURP consensus protocol, +3. Implement the snapshot relevant API,which is compatible with etcdctl. The rest of other APIs in etcdctl maintenance will be implemented in the future. + +#### Fix Bugs: + +1. Fix a bug that commands will execute out of order in some concurrent cases (issue [#197](https://github.com/datenlord/Xline/issues/197)), resolve in the pr [#195](https://github.com/datenlord/Xline/issues/195) +2. Fix a bug that the gc task will panic during benchmark(issue [#206](https://github.com/datenlord/Xline/issues/206)), resolve in the pr [#210](https://github.com/datenlord/Xline/issues/210) +3. Fix a bug that the lock feature will work abnormally in some cases(issue [#209](https://github.com/datenlord/Xline/issues/209)), resolve in the pr [#212](https://github.com/datenlord/Xline/issues/212) +4. Fix a bug that some concurrent put requests will get wrong revisions (issue [#209](https://github.com/datenlord/Xline/issues/212)), resolve in the pr [#238](https://github.com/datenlord/Xline/issues/238) + +#### Benchmark: + +Since we implemented the persistence feature for xline in v0.3.0, we have re-benchmarked xline in this release. The benchmark report can be viewed in the Performance Comparison section in our README file. + +# v0.4.1 + +#### Features + +- Watch Progress Notify [#309](https://github.com/datenlord/Xline/issues/309) + +#### Refactors + +- Sharing state between CurpServer and CurpClient [#299](https://github.com/datenlord/Xline/issues/299) +- Refactor the XlineServer [#293](https://github.com/datenlord/Xline/issues/293) +- Refactor curp fast read implementation [#270](https://github.com/datenlord/Xline/issues/270) +- Improve the read and write logic for the RocksSnapshot [#263](https://github.com/datenlord/Xline/issues/263) +- Refactor the watch server implementation [#253](https://github.com/datenlord/Xline/issues/253) +- Refactor the dependencies of lease server [#251](https://github.com/datenlord/Xline/issues/251) + +#### Fix Bugs + +- Test_kv_authorization block [#291](https://github.com/datenlord/Xline/issues/291) +- The background command workers will panic in the integration test "recovery_after_compaction" [#285](https://github.com/datenlord/Xline/issues/285) +- Handle_propose in raw_cup will panic when try notify events [#280](https://github.com/datenlord/Xline/issues/280) +- Watch prev_kv [#277](https://github.com/datenlord/Xline/issues/277) + +# v0.5.0 + +#### Features: + +- [Feature]: Implemented the Compact feature, which includes the following two aspects (Read issue [#188](https://github.com/xline-kv/Xline/issues/188) for more details about compaction design): + - Implemented historical version compaction feature. The compaction API is compatible with the etcd interface. Resolved in pr [#311](https://github.com/xline-kv/Xline/pull/311) + - Implemented an automatic compaction mode, supporting both periodic Strategy and Revision Strategy. It is not enabled by default. Resolved in pr [#401](https://github.com/xline-kv/Xline/pull/401) +- [Feature]: Implement a Rust SDK for the Xline client (xline-client crate) to fully leverage the performance of CURP protocol. Currently, the SDK covers functionalities: + - Watch: Implemented in pr #[321](https://github.com/xline-kv/Xline/pull/321) + - Kv: Implemented in pr #[318](https://github.com/xline-kv/Xline/pull/318) + - Maintenance: Implemented in pr #[323](https://github.com/xline-kv/Xline/pull/323) + - Auth: Implemented in pr #[320](https://github.com/xline-kv/Xline/pull/320) + - Lease: Implemented in pr #[319](https://github.com/xline-kv/Xline/pull/319) + - Lock: Implemented in pr #[322](https://github.com/xline-kv/Xline/pull/322) + - Compaction: Implemented in pr #[389](https://github.com/xline-kv/Xline/pull/389) +- [Feature]: Implement a command line tool for Xline, which is named xlinectl. Resolved in pr #[348](https://github.com/xline-kv/Xline/pull/348) +- [Feature]: Support single node cluster #[335](https://github.com/xline-kv/Xline/issues/335) +- [Feature]: Support multiplatform for Xline. Read #[doc](https://github.com/xline-kv/Xline/tree/master/doc/quick-start) for more details. +- [Feature]: Support dns resolution for Xline cluster #[351](https://github.com/xline-kv/Xline/issues/351) +- [Feature]: Support grpc health checking protocol, resolved in pr #[385](https://github.com/xline-kv/Xline/pull/385) +- [Feature]: Add madsim simulation in Curp tests #[282](https://github.com/xline-kv/Xline/issues/282) + +#### Fix Bugs + +- [Bug]: Madsim Curp integration tests sometimes fail #[361](https://github.com/xline-kv/Xline/issues/361) +- [Bug]: lease may not synced in lease server #[343](https://github.com/xline-kv/Xline/issues/343) +- [Bug]: EventListener will lose event since it's not cancellation safe. #[339](https://github.com/xline-kv/Xline/issues/339) +- [Bug]: Resolve failing tests related to serialized size. #[259](https://github.com/xline-kv/Xline/issues/259) + +#### Contributors + +We'd like to thank all the contributors who worked on this release! + +[@liubog2008](https://github.com/liubog2008) + +# v0.6.0 + +#### New Features + +- [Feature]: Add membership change mechanism for CUPR consensus Protocol (Read design doc [#306](https://github.com/xline-kv/Xline/issues/306) for more details) +- [Feature]: Implement cluster server and client [#464](https://github.com/xline-kv/Xline/pull/464), [#465](https://github.com/xline-kv/Xline/pull/465) +- [Feature]: Implement the graceful shutdown feature. +- [Feature]: Implement the xlinctl to communicate with the xline cluster. Currently, the xlinectl covers functionalities: + - Compaction and member command: Implemented in pr [#484](https://github.com/xline-kv/Xline/pull/484) + - Txn, watch and lock command: Implemented in pr [#428](https://github.com/xline-kv/Xline/pull/484) + - Role command: Implemented in pr [#427](https://github.com/xline-kv/Xline/pull/427) + - User command: Implemented in pr [#426](https://github.com/xline-kv/Xline/pull/426) + - Snapshot and auth command: Implemented in pr [#425](https://github.com/xline-kv/Xline/pull/425) + - Delete and lease command: Implemented in pr [#424](https://github.com/xline-kv/Xline/pull/424) + +#### Bug Fixes + +- [Bug]: benchmark client cannot connect to server [#462](https://github.com/xline-kv/Xline/pull/462) +- [Bug]: remove stop in simulation tests [#458](https://github.com/xline-kv/Xline/pull/458) +- [Bug]: execute out of order [#454](https://github.com/xline-kv/Xline/pull/454) +- [Bug]: check the password on leader [#435](https://github.com/xline-kv/Xline/pull/435) +- [Bug]: remove recovery of uncommitted pool [#419](https://github.com/xline-kv/Xline/pull/419) +- [Bug]: CURP TLA+ quorum size calculation & property check [#418](https://github.com/xline-kv/Xline/pull/418) +- [Bug]: fix propose doesn't handle SyncedError [#407](https://github.com/xline-kv/Xline/pull/407) + +#### Refactor + +- [Refactor]: reduce code duplication [#407](https://github.com/xline-kv/Xline/pull/407) +- [Refactor]: Take into account the interleaving states of a request broadcast in TLA+ [#429](https://github.com/xline-kv/Xline/pull/429) +- [Refactor]: Refine the bench client implementation [#496](https://github.com/xline-kv/Xline/pull/496) +- [Refactor]: Simplified the error handling logic [#480](https://github.com/xline-kv/Xline/pull/480) +- [Refactor]: Improve readability of bootstrap errors [#432](https://github.com/xline-kv/Xline/pull/432) +- [Refactor]: Imporve command serialization in execution and after-sync [#421](https://github.com/xline-kv/Xline/pull/421), [#422](https://github.com/xline-kv/Xline/pull/422) + +#### Contributors + +- [@EAimTY](https://github.com/EAimTY) +- [@MarkGaox](https://github.com/MarkGaox) +- [@Kikkon](https://github.com/Kikkon) + +Note: +Known issue: If the cluster is shut down immediately after adding a member, the leader node may not shut down properly, continuously trying to send entries to the shut-down new node. Read issue [#526](https://github.com/xline-kv/Xline/issues/526) for more details. + +# v0.6.1 + +#### Bug Fixes + +- [Bug]: Fixed a bug causing panic during the update node process. [issue #531](https://github.com/xline-kv/Xline/issues/531) +- [Bug]: Fixed a bug causing panic during the CI process due to reading state. [issue #527](https://github.com/xline-kv/Xline/issues/527) +- [Bug]: Fixed a bug in the previous version where immediately shutting down the cluster after executing "member add" would cause the leader to fail to shut down properly. [issue #526](https://github.com/xline-kv/Xline/issues/526) +- [Bug]: Fixed an issue in TXN where the conflict detection process would ignore the key of child requests. [issue #470](https://github.com/xline-kv/Xline/issues/470) +- [Bug]: Fixed a panic issue in watch caused by closing the channel. [issue #370](https://github.com/xline-kv/Xline/issues/370) + - pr 576: [fix: fix ce event tx logs](https://github.com/xline-kv/Xline/pull/576) + - pr 556: [[Fix]: kv update channel panic](https://github.com/xline-kv/Xline/pull/556) +- [Bug]: Changed the calculation method for the cluster version to a hash to avoid misjudgments. [pr #590](https://github.com/xline-kv/Xline/pull/590) +- [Bug]: Fixed a bug that caused the compact operation to behave abnormally in specific scenarios. [pr #570](https://github.com/xline-kv/Xline/pull/570) + +#### Refactor + +- [Refactor]: Refactored the implementation of the Curp client, reducing code complexity. : + - pr 582: [Refactor/curp client tests suits](https://github.com/xline-kv/Xline/pull/582) + - pr 584: [Refactor/curp client retry](https://github.com/xline-kv/Xline/pull/584) + - pr 585: [Refactor/replace curp client](https://github.com/xline-kv/Xline/pull/585) +- [Refactor]: Removed some command-related data structures from xline and xline-client. [pr #469](https://github.com/xline-kv/Xline/pull/469) +`,Oz=`# Xline Architecture Details + +![image](/xline-home/docs/Xline-Architecture-Details/image1.jpg)`,Dz="/xline-home/assets/dropdown-close-533c3c65.svg",Lz="/xline-home/assets/dropdown-active-7d279a33.svg",Pz=L.div` + height: 10px; + width: 10px; + margin-inline: 8px; + border-radius: 50%; + background: ${e=>e.theme.color.neutral.gray05}; +`,P5=L.li` + display: flex; + align-items: center; + margin-bottom: ${e=>e.theme.scale.scale03}; +`,zz=L(P5)` + display: ${e=>e.isActive?"flex":"none"}; + padding-left: 14px; +`,Fz=L.div` + display: inline-block; + padding-inline: 8px; + height: 100%; +`,Hv=L.img` + width: 12px; + height: 12px; +`,z5=L.p` + color: ${e=>e.theme.color.neutral.gray10}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: 16px; + line-height: 18px; + cursor: pointer; +`,Bz=L(z5)` + font-weight: ${e=>e.theme.font.fontWeightRegular}; + cursor: pointer; +`,F5=({item:e})=>k.jsx("ul",{children:e.map(t=>k.jsx($z,{items:t},t.title))}),$z=({items:e})=>{const[t,n]=ce.useState(!1);return k.jsxs(k.Fragment,{children:[k.jsxs(P5,{onClick:()=>n(!t),children:[k.jsx(Fz,{children:t?k.jsx(Hv,{src:Lz}):k.jsx(Hv,{src:Dz})}),k.jsx(z5,{children:e.title})]}),k.jsx("ul",{children:k.jsx(Uz,{items:e.children,isActive:t})})]})},Uz=({items:e,isActive:t})=>{const n=Hi();return k.jsx(k.Fragment,{children:e.map(r=>k.jsxs(zz,{isActive:t,children:[k.jsx(Pz,{}),k.jsx(Bz,{onClick:()=>{n(r.url),setTimeout(()=>{const i=document.getElementById(r.id||"");console.log(i),i==null||i.scrollIntoView({behavior:"smooth"})},100)},children:r.title})]},r.id))})},jz=Object.assign({"/src/docs/Deploy.md":Az,"/src/docs/Develop.md":Rz,"/src/docs/Get-Started.md":Mz,"/src/docs/Performance-Comparison.md":Nz,"/src/docs/What's-New.md":Iz,"/src/docs/Xline-Architecture-Details.md":Oz}),qz=L.div` + display: flex; + align-items: center; + justify-content: center; + height: calc(86px + 416px); + padding-top: 86px; + background: #0a0c28; + @media screen and (max-width: 1024px) { + height: calc(63px + 312px); + padding-top: 64.5px; + } + @media screen and (max-width: 768px) { + height: calc(53px + 208px); + padding-top: 43px; + } +`,Hz=L.h1` + position: relative; + display: inline-block; + padding-inline: 32px; + color: white; + font-weight: 700; + font-size: 72px; + line-height: 80.64px; + /* text-transform: capitalize; */ + line-height: 1.1; + transform: translateY(-10%); + @media screen and (max-width: 1024px) { + padding-inline: 24px; + font-size: 54px; + } + @media screen and (max-width: 768px) { + padding-inline: 16px; + font-size: 36px; + } +`,Wz=L.img` + z-index: -1; + position: absolute; + left: 50%; + bottom: -17px; + transform: translateX(-45%); + width: 295.01px; + height: 35.35px; + @media screen and (max-width: 1024px) { + bottom: -12px; + width: 222px; + height: 27px; + } + @media screen and (max-width: 768px) { + bottom: -8px; + width: 148px; + height: 18px; + } +`,Vz=L.main` + display: flex; + margin-inline: auto; + padding-block: ${e=>e.theme.scale.scale05}; + padding-inline: ${e=>e.theme.scale.scale07}; + max-width: ${e=>e.theme.scale.scale12}; + // - - - + /* height: 200px; + background-color: lightcoral; */ + @media screen and (max-width: 1024px) { + padding-block: 36px; + padding-inline: 96px; + } + @media screen and (max-width: 768px) { + padding-block: 24px; + padding-inline: 64px; + } +`,Yz=L.div` + width: 75%; + /* flex: 1; */ + + // - - - + /* min-height: 100px; + background-color: lightcyan; */ + @media screen and (max-width: 1024px) { + width: 100%; + } +`,Xz=L.div` + flex-shrink: 0; + width: 25%; + margin-right: ${e=>e.theme.scale.scale05}; + // - - - + /* height: 100px; + background-color: lightblue; */ + @media screen and (max-width: 1024px) { + display: none; + } +`,Kz=L.p` + margin-bottom: ${e=>e.theme.scale.scale06}; + color: ${e=>e.theme.color.neutral.gray07}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize5}; + line-height: ${e=>e.theme.font.lineHeight5}; +`,Gz=()=>{const{params:e}=n1();return ce.useEffect(()=>{e==="Xline-Architecture-Details"&&window.scrollTo(0,0)},[e]),k.jsxs(k.Fragment,{children:[k.jsx(qz,{children:k.jsxs(Hz,{children:[e==null?void 0:e.split("-").join(" "),k.jsx(Wz,{src:Wi,alt:"underline"})]})}),k.jsxs(Vz,{children:[k.jsxs(Xz,{children:[k.jsx(Kz,{children:"Docs"}),k.jsx(F5,{item:e6})]}),k.jsx(Yz,{children:k.jsx(Ds,{children:jz[`/src/docs/${e}.md`],remarkPlugins:[Sc],rehypePlugins:[_c],components:{h1:({level:t,children:n})=>k.jsx(ct,{level:t,children:n}),h2:({level:t,children:n})=>k.jsx(ct,{level:t,children:n}),h3:({level:t,children:n})=>k.jsx(ct,{level:t,children:n}),h4:({level:t,children:n})=>k.jsx(ct,{level:t,children:n}),h5:({level:t,children:n})=>k.jsx(ct,{level:t,children:n}),h6:({level:t,children:n})=>k.jsx(ct,{level:t,children:n}),p:({children:t})=>k.jsx(Ec,{children:t}),em:({children:t})=>k.jsx(ii,{children:t}),strong:({children:t})=>k.jsx(ii,{type:"bold",children:t}),hr:()=>k.jsx(Cc,{}),ul:({depth:t,ordered:n,className:r,children:i})=>k.jsx(ai,{depth:t,ordered:n,className:r,children:i}),ol:({depth:t,ordered:n,className:r,children:i})=>k.jsx(ai,{depth:t,ordered:n,className:r,children:i}),li:({children:t})=>k.jsx(Tc,{children:t}),img:({src:t,alt:n})=>k.jsx(Ac,{src:t,alt:n}),blockquote:({children:t})=>k.jsx(Rc,{children:t})}})})]})]})},Qz=`# Basic Concept + +## CAP Theorem and PACELC theorem + +In theoretical computer science, the CAP theorem, also named Brewer's theorem after computer scientist Eric Brewer, states that any distributed data store can provide only two of the following three guarantees: + +- Consistency: Every read receives the most recent write or an error. +- Availability: Every Request receives a (non-error) response, without the guarantee that it contains the most recent write. +- Partition tolerance: The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes. + +To deal with a [network partition](https://en.wikipedia.org/wiki/Network_partition) failure, one of the following options must be chosen: + +- cancel the operation and thus decrease the availability but ensure consistency. +- proceed with the operation and thus provide availability but risk inconsistency. + +Thus, if there is a network partition, one has to choose between consistency or availability. Note that consistency as defined in the CAP theorem is quite different from the consistency guaranteed in [ACID database transactions](https://en.wikipedia.org/wiki/ACID). + +Eric Brewer argues that the often-used "two out of three" concept can be somewhat misleading because system designers need only to sacrifice consistency or availability in the presence of partitions, but that in many systems partitions are rare. The **PACELC theorem** is an extension to the CAP theorem. It states that in case of network partitioning (P) in a distributed computer system, one has to choose between availability (A) and consistency (C) (as per the CAP theorem), but else (E), even when the system is running normally in the absence of partitions, one has to choose between latency (L) and consistency (C). + +Read the following docs for more information: + +1. CAP Theorem: + - Paper: [Brewer's Conjecture and the Feasibility of Consistent Available Partition-Tolerant Web Services](https://users.ece.cmu.edu/~adrian/731-sp04/readings/GL-cap.pdf) + - Blog: [An Illustrated Proof of the CAP Theorem](https://mwhittaker.github.io/blog/an_illustrated_proof_of_the_cap_theorem/) +2. PACELC Theorem(Paper): [Consistency Tradeoffs in Modern Distributed Database System Design](https://www.cs.umd.edu/~abadi/papers/abadi-pacelc.pdf) + +## FLP Impossibility + +The paper "[Impossibility of Distributed Consensus with One Faulty Process](https://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf)", published by Fischer, Lynch and Patterson in April 1985, proposed the "FLP Impossibility", specifying an upper bound on what is possible using distributed processes in an asynchronous environment. The consensus problem is solvable in a synchronous environment where processes can proceed simultaneously. The synchronous model allows detecting faults by waiting the entire length of a step for a process to reply, and assuming it has crashed if no reply is received. + +Mechanisms that determine whether a failure has occurred based on how long a reply has been received do not work in a fully asynchronous message-passing distributed system. This is because in an asynchronous environment, there is no upper limit to how long a process can reply to a message after completing its work. Thus, it is impossible to tell whether a process has crashed or has taken a long time to respond. The FLP impossibility shows that in a completely asynchronous system, even if only one node fails, there is no algorithm that can bring the system to consensus. This impossibility comes from the worst-case scheduling scenario, which is unlikely to happen in practice except in adversarial situations, such as an intelligent denial-of-service attacker in the network. In most normal cases, process scheduling has a degree of natural randomness. + +A randomized consensus algorithm can circumvent the FLP Impossibility, achieving security and effectiveness with overwhelming probability, even in the worst case scheduling scenario, such as an intelligent denial-of-service attacker in the network. + +# Consensus Protocol + +## Paxos + +Paxos is a consensus algorithm proposed by Leslie Lamport in 1989. The initial paper was "[The Part-Time Parliament](http://lamport.azurewebsites.net/pubs/pubs.html#lamport-paxos)", but it was not published. Lamport wrote “[Paxos Made Simple](https://lamport.azurewebsites.net/pubs/paxos-simple.pdf)” in 2001 and formally proposed the algorithm. + +Paxos uses proposals to drive the entire algorithm, so that the system resolves to the same proposal. Each node continuously proposes a proposal through messaging, and each proposal includes a proposal number and a proposal value. Paxos considers that if more than half of the nodes in the cluster unanimously accept the proposal, a consensus on the proposal is reached and the proposal is said to be **chosen**. + +Paxos divides the system into the following roles: + +- Client: The client sends a request to the distributed system and waits for a response. +- Proposer: When the proposer receives a request from the client, it makes a relevant proposal, tries to get the receiver to accept the proposal, and coordinates in case of conflict to drive the algorithm to run. +- Acceptor: also called voter, votes to accept or reject the proposer's proposal, and if more than half of the receivers accept the proposal, the proposal is chosen. +- Learners: Learners can only learn the chosen proposal and do not participate in the proposal voting. Once the client's request is unified by the acceptors, the learner can execute the requested operation in the proposal and initiate a response to the client. To improve system availability, multiple learners can be added. + +Paxos represents a family of protocols, including: + +- Basic Paxos: The basic protocol, allowing consensus about a single value. +- Multi Paxos: Allow the protocol to handle a stream of messages with less overhead than Basic Paxos. +- [Cheap Paxos](https://lamport.azurewebsites.net/pubs/web-dsn-submission.pdf): Reduce number of nodes needed via dynamic reconfiguration in exchange for reduced burst fault tolerance. +- [Fast Paxos](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-2005-112.pdf): Reduce the number of round trips in exchange for reduced fault tolerance. + +Since Paxos is difficult to understand, algorithms like Raft are designed to be easier to understand. + +## Raft + +In 2013, Diego Ongaro and John Ousterhout of Stanford University published “[In Search of an Understandable Consensus Algorithm with the goal of comprehensibility](https://raft.github.io/raft.pdf)”, formally proposing the Raft algorithm, which aims to optimize the Paxos family of algorithms into a consensus algorithm that is easier to understand and equally satisfying in terms of [safety and liveness](https://en.wikipedia.org/wiki/Safety_and_liveness_properties). + +Raft is similar to Multi-Paxos in that it is a leader-based consensus algorithm. Nodes in the Raft algorithm can only be in one of three states at any given time. + +- Leader: The leader is responsible for handling all client requests and log replication. There can be at most one working leader in the system at the same time. +- Follower: Passively handling requests from the leader. Most of the nodes in the cluster are in this state. +- Candidate: A transitional state between leader and follower, used to elect a new leader. + +Follower persists requests from the leader as log entries as soon as they are received. When a quorum (majority) of nodes confirm that the entry has persisted in their logs, the leader commits the log and followers apply the log entry to its own state machine. When there is a network partition in the system, the partition containing the majority of nodes can still process client requests normally. + +Raft ensures strong consistency of the distributed system through the leader. Raft supports leader election. When the leader crashes, one of the followers is elected as the new leader. Only the follower with more complete logs than the majority of nodes in the cluster can be elected as a leader. From this implementation of leader election, Raft is not a Byzantine fault-tolerant consensus algorithm. Any node can interfere with the cluster by initiating an election and falsely claiming to have the latest logs. + +In addition, there are several optimizations that can be applied to Raft. Prevote can be used to introduce a pre-selection of possible leaders, allowing them to gauge their ability to become leaders before potentially disrupting the cluster. Joint consensus can support arbitrary grouping changes, allowing for better scaling. Batching and pipelining can help high-throughput systems perform better. + +## CURP + +The CURP algorithm was proposed by Seo Jin Park and John Ousterhout of Stanford University in their paper “[Exploiting Commutativity For Practical Fast Replication](https://www.usenix.org/system/files/nsdi19-park.pdf)” published in 2019. + +Traditional approaches to replication, be it Raft or Multi-Paxos, require client requests to be ordered before making them durable by copying them to replica. As a result, clients must wait for two round-trip times (RTTs) before updates complete. The Consistent Unordered Replication Protocol (CURP) allows clients to replicate requests that have not yet been ordered, as long as they are commutative. This strategy allows most operations to complete in 1 RTT. + +CURP supplements a system's existing replication mechanism with a lightweight form of replication without ordering based on witness. A client replicates each operation to one or more witnesses in parallel with sending the request to the primary server. The primary can execute the operation and return to the client without waiting for normal replication, which happens asynchronously. This allows operations to complete in 1 RTT, as long as all witnessed-but-not-yet-replicated operations are commutative. Noncommutative operations still require 2 RTTs. If the primary crashes, information from witnesses is combined with that from the normal replicas to re-create a consistent server state. + +Xline is a distributed key-value store engine which can achieve high-performance data access and strong consistency in cross data center scenarios. The network latency between different data centers is very high, often tens or even hundreds of milliseconds. Ideally, since CURP protocol can save an RTT to reach consensus than Raft or Multi-Paxos does, Xline uses CURP to achieve high-performance data access and strong consistency in cross data center situations. + +Read the [blog](/xline-home/#/blog) for more information about the CURP Protocol.`,Zz=`Key-value stores are used as stand-alone NoSQL systems but they are also used as a part of more complex pipelines and systems such as machine learning and relational systems. + +B-trees and Log-Structured Merge-trees (LSM trees) are two of the most widely used data structures for organizing and storing data in data-intensive applications. However, each of them has its own trade-offs. The purpose of this paper is to compare these two data structures using a quantitative approach. + +# Metrics + +In general, there are three key metrics to measure the performance of a data structure: write amplification, read amplification, and spatial amplification. This section aims to describe these metrics. + +For hard disk drives (HDDs), the cost of disk seek is enormous, such that the performance of random read/write is worse than that of sequential read/write. Therefore, the performance of sequential disk reads and writes is much better than that of random reads and writes. Even for SSDs, sequential read and write performance is better than random read and write. + +## Write Amplification + +Write amplification means that the actual amount of data written to the storage media is greater than the amount of data expected to be written. + +Write amplification occurs because the database itself, in addition to storing data, also needs to store some metadata, such as indexes, wal logs, etc., to improve performance or crash consistency. In addition to metadata, write amplification can also occur on the storage media itself. For example, SSDs have their own garbage collection mechanism that can cause write amplification. Since the lifetime of flash-based storage devices is related to the number of erases, write amplification can reduce the lifetime of flash memory. + +## Read Amplification + +Read amplification is when the amount of data needed to be read per query is greater than the amount of data expected to be read. + +Read amplification occurs because databases often require metadata, such as indexes, to be queried first. The use of caching can reduce read amplification. Also, note that the units of write amplification and read amplification are different. Write amplification measures how much more data is written than the application thinks, while read amplification counts the number of disk reads to execute a query. + +## Space Amplification + +Space amplification is when the data stored in a storage medium is larger than the data stored in a database application + +# LSM Tree And B-Tree + +In the [LSM tree](https://en.wikipedia.org/wiki/Log-structured_merge-tree), data is organized into levels. The data at level 0 resides entirely in memory, while the rest of the levels reside on disk. New records are inserted into level 0. As more data is inserted, when level 0 exceeds a certain size threshold, it is merged into leve 1. If level 1 exceeds a certain size threshold, it is merged into level 2, and so on, with a limit on the size of each level. In order to perform a query on a specific key to get its associated value, a search must be performed in level 0 and also in each level. + +[B-tree](https://en.wikipedia.org/wiki/B-tree) is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing for nodes with more than two children.([2]) Unlike other self-balancing binary search trees, the B-tree is well suited for storage systems that read and write relatively large blocks of data, such as databases and file systems. + +Generally speaking, a data structure can be optimized in at most two ways: read, write, or space amplification. This means that one data structure is unlikely to be better than another in all three. The LSM-tree has a better writer performance than the B+ tree, while its read performance is not as good as the B+ tree. + +LSM Tree has better write performance than B+ Tree because the former has lower write amplification than the latter. B+ Tree indexes require at least two writes of data, one to the WAL and one to the page itself. LSMs can have greater write throughput than B+ Trees partly because they sometimes have lower write amplification (which requires the right configuration) and partly because they write compact SSTable files sequentially. LSM Trees can be compressed well enough to produce smaller files on the disk. The B+ Tree storage engine, on the other hand, generates some space fragmentation due to the paging mechanism. + +The B+ Tree has better read performance compared to the LSM Tree because the former has lower read amplification than the latter. LSM Tree requires reading several different data structures with SSTable during the read process. In addition, since each key of the B tree exists in only one location in the index, the LSM tree storage engine, on the other hand, may have multiple copies of the same key in different segments. This also makes B-trees attractive in databases that need to provide strong transactional semantics, because in most relational databases, transactional isolation is achieved by using locks on key ranges. In a B-tree index, these locks can be attached directly to the tree.`,Jz=`In [distributed computing](https://en.wikipedia.org/wiki/Distributed_computing), a **remote procedure call (RPC)** is when a computer program causes a procedure (subroutine) to execute in a different address space (commonly on another computer on a shared network), which is coded as if it were a normal (local) procedure call, without the programmer explicitly coding the details for the remote interaction. That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote. This is a form of client–server interaction (caller is client, executor is server), typically implemented via a request–response message-passing system. In the object-oriented programming paradigm, RPCs are represented by remote method invocation (RMI). The RPC model implies a level of location transparency, namely that calling procedures are largely the same whether they are local or remote, but usually, they are not identical, so local calls can be distinguished from remote calls. Remote calls are usually orders of magnitude slower and less reliable than local calls, so distinguishing them is important. + +RPCs are a form of [inter-process communication](https://en.wikipedia.org/wiki/Inter-process_communication) (IPC), in that different processes have different address spaces: if on the same host machine, they have distinct virtual address spaces, even though the physical address space is the same; while if they are on different hosts, the physical address space is different. Many different (often incompatible) technologies have been used to implement the concept. + +Read the [protobuf doc](https://protobuf.dev/programming-guides/encoding/) and the [gRPC](https://grpc.io/docs/) doc for more details. + +[tonic]() is a gRPC over HTTP/2 implementation focused on **high performance**, **interoperability**, and **flexibility**. This library was created to have first-class support of async/await and to act as a core building block for production systems written in Rust.`,eF=`Few can argue against the need for quality control when developing software. Any known or unknown software defects can be very costly for the users of the software. Testing can help developers identify these software defects in advance. The sooner development teams receive feedback from testing, the sooner they can address issues such as: + +- Architectural flaws +- Poor design decisions +- Invalid or incorrect functionality +- Security vulnerabilites +- Scalability issues + +Xline, as a distributed key-value store engine, is designed to run in the presence of many failure scenarios and degraded states, which greatly increases the testing surface. These states also must be tested in addition to the normal testing done on a project. + +In futher sections we’ll investigate how to test distributed systems under the influence of these almost infinite variables. For now, let's examine the basics that every project requires. These simple tests will lay the foundation for many later tests that can be run millions of times throughout the life of a project. + +Often, these tests are written before or alongside the code which they test, and they're used to guide the development process. + +# Unit Testing + +Unit testing is a software development process in which the smallest testable parts of an application, called units, are individually and independently scrutinized for proper operation. This testing methodology is done during the development process by the software developers and sometimes QA staff. + +Xline includes many unit tests that run by cargo test. These tests typically involve simple functionality and are tested using assertions. Many languages, like Rust, offer built-in unit testing functionality: + +~~~rust +#[test] +fn test_parse_members() { + let s1 = ""; + assert!(parse_members(s1).is_err()); + let s2 = "a=1"; + let m2 = HashMap::from_iter(vec![("a".to_owned(), "1".to_owned())]); + assert_eq!(parse_members(s2).unwrap(), m2); + + let s3 = "a=1,b=2,c=3"; + let m3 = HashMap::from_iter(vec![ + ("a".to_owned(), "1".to_owned()), + ("b".to_owned(), "2".to_owned()), + ("c".to_owned(), "3".to_owned()), + ]); + assert_eq!(parse_members(s3).unwrap(), m3); + let s4 = "abcde"; + assert!(parse_members(s4).is_err()); +} +~~~ + +The main objective of unit testing is to isolate written code to test and determine if it works as intended. + +# Mock Testing + +Doing testing is essentially a way to test system or component in a controlled environment. The biggest problem with having a lot of reliance on third-party code is that the third-party code is not controllable. So we need to isolate the tested code and replace the uncontrollable component with a controllable one. That's a so-called mock test. + +mockall is a powerful mock object library for Rust. It provides tools to create mock versions of almost any trait or struct. They can be used in unit tests as a stand-in for the real object. We use mockall to do some mock tests in Xline: + +~~~rust +#[traced_test] +#[tokio::test] +async fn logs_will_be_resent() { + let state = new_test_state(); + + let mut mock_connect = MockConnectInterface::default(); + mock_connect + .expect_append_entries() + .times(4) + .returning(|_, _| Err(ProposeError::RpcStatus("timeout".to_owned()))); + mock_connect + .expect_id() + .return_const(FOLLOWER_ID1.to_owned()); + + let handle = tokio::spawn(async move { + let req = AppendEntriesRequest::new( + 1, + LEADER_ID.to_owned(), + 0, + 0, + vec![LogEntry::new(1, &[Arc::new(TestCommand::default())])], + 0, + ) + .unwrap(); + send_log_until_succeed(1, req, Arc::new(mock_connect), state).await; + }); + sleep_secs(3).await; + assert!(!handle.is_finished()); + handle.abort(); +} +~~~ + +Read the [mock document](https://docs.rs/mockall/0.11.3/mockall/) for more information. + +# Integration Testing + +ntegration tests are often used to ensure that software components or functions operate together properly. + +In Rust, integration tests are entirely external to your library and use your code in the same way any other external code would, using only the public interface and potentially exercising multiple modules per test. It can also exist as documentation. That means it's possible to document your project and benefit from a full test suite simultaneously. + +~~~rust +/// Create a new Xline Server instance with the given config +/// +/// \`\`\`rust +/// let config = if let Ok(path) = env::var("XLINE_SERVER_CONFIG") { +/// fs::read_to_string(&path).await? +/// } else { +/// include_str!("/etc/xline/xline_server.conf").to_owned() +/// }; +/// let xline_server = XlineServer::new(config)?; +/// \`\`\` +struct XlineServer { /*...*/ } +~~~ + +The [Rust Book](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) has a great chapter on how to write tests in Rust, and which testing strategies are appropriate for which problems. + +# Validation Testing + +Since one of the design goals of Xline is to be fully compatible with the etcd API, the validation test is mainly used to test the compatibility of the Xline interface with the etcd client. We used etcdctl to test the compatibility. + +Read the "[Start Xline Servers](https://github.com/datenlord/Xline/blob/master/QUICK_START.md#start-xline-servers)" and "[Send Etcd requests](https://github.com/datenlord/Xline/blob/master/QUICK_START.md#send-etcd-requests)" for more information. + +Read the etcdctl doc for more detail about how to use etcdctl + +Click [here](https://datenlord.feishu.cn/sheets/shtcnTuzElmgDO6NMOlobsCG2Jd) to view the test report.`,tF=Object.assign({"/src/deep-dive/Consensus.md":Qz,"/src/deep-dive/Key-value-Engine.md":Zz,"/src/deep-dive/Remote-Procedure-Calls-(RPC).md":Jz,"/src/deep-dive/Testing.md":eF}),nF=L.div` + display: flex; + align-items: center; + justify-content: center; + height: calc(86px + 416px); + padding-top: 86px; + background: #0a0c28; + @media screen and (max-width: 1024px) { + height: calc(63px + 312px); + padding-top: 64.5px; + } + @media screen and (max-width: 768px) { + height: calc(53px + 208px); + padding-top: 43px; + } +`,rF=L.h1` + position: relative; + display: inline-block; + padding-inline: 32px; + color: white; + font-weight: 700; + font-size: 72px; + /* line-height: 80.64px; */ + line-height: 1.1; + text-transform: capitalize; + transform: translateY(-10%); + @media screen and (max-width: 1024px) { + padding-inline: 24px; + font-size: 54px; + } + @media screen and (max-width: 768px) { + padding-inline: 16px; + font-size: 36px; + } +`,iF=L.img` + z-index: -1; + position: absolute; + left: 50%; + bottom: -17px; + transform: translateX(-45%); + width: 295.01px; + height: 35.35px; + @media screen and (max-width: 1024px) { + bottom: -12px; + width: 222px; + height: 27px; + } + @media screen and (max-width: 768px) { + bottom: -8px; + width: 148px; + height: 18px; + } +`,aF=L.main` + display: flex; + margin-inline: auto; + padding-block: ${e=>e.theme.scale.scale05}; + padding-inline: ${e=>e.theme.scale.scale07}; + max-width: ${e=>e.theme.scale.scale12}; + // - - - + /* height: 200px; + background-color: lightcoral; */ + @media screen and (max-width: 1024px) { + padding-block: 36px; + padding-inline: 96px; + } + @media screen and (max-width: 768px) { + padding-block: 24px; + padding-inline: 64px; + } +`,oF=L.div` + width: 75%; + /* flex: 1; */ + + // - - - + /* min-height: 100px; + background-color: lightcyan; */ + @media screen and (max-width: 1024px) { + width: 100%; + } +`,sF=L.div` + flex-shrink: 0; + width: 25%; + margin-right: ${e=>e.theme.scale.scale05}; + // - - - + /* height: 100px; + background-color: lightblue; */ + @media screen and (max-width: 1024px) { + display: none; + } +`,lF=L.p` + margin-bottom: ${e=>e.theme.scale.scale06}; + color: ${e=>e.theme.color.neutral.gray07}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize5}; + line-height: ${e=>e.theme.font.lineHeight5}; +`,cF=()=>{const{params:e}=n1(),t=e==null?void 0:e.split("-").join(" ");return k.jsxs(k.Fragment,{children:[k.jsx(nF,{children:k.jsxs(rF,{children:[t==="Testing"?"Test":t,k.jsx(iF,{src:Wi,alt:"underline"})]})}),k.jsxs(aF,{children:[k.jsxs(sF,{children:[k.jsx(lF,{children:"Deep Dive"}),k.jsx(F5,{item:t6})]}),k.jsx(oF,{children:k.jsx(Ds,{children:tF[`/src/deep-dive/${e}.md`],remarkPlugins:[Sc],rehypePlugins:[_c],components:{h1:({level:n,children:r})=>k.jsx(ct,{level:n,children:r}),h2:({level:n,children:r})=>k.jsx(ct,{level:n,children:r}),h3:({level:n,children:r})=>k.jsx(ct,{level:n,children:r}),h4:({level:n,children:r})=>k.jsx(ct,{level:n,children:r}),h5:({level:n,children:r})=>k.jsx(ct,{level:n,children:r}),h6:({level:n,children:r})=>k.jsx(ct,{level:n,children:r}),p:({children:n})=>k.jsx(Ec,{children:n}),em:({children:n})=>k.jsx(ii,{children:n}),strong:({children:n})=>k.jsx(ii,{type:"bold",children:n}),hr:()=>k.jsx(Cc,{}),ul:({depth:n,ordered:r,className:i,children:a})=>k.jsx(ai,{depth:n,ordered:r,className:i,children:a}),ol:({depth:n,ordered:r,className:i,children:a})=>k.jsx(ai,{depth:n,ordered:r,className:i,children:a}),li:({children:n})=>k.jsx(Tc,{children:n}),img:({src:n,alt:r})=>k.jsx(Ac,{src:n,alt:r}),blockquote:({children:n})=>k.jsx(Rc,{children:n})}})})]})]})},B5=`--- + cover: /xline-home/blog/Revisit-the-Consensus-Protocol/cover.png + author: + name: Jicheng Shi + url: https://github.com/rogercloud + img_url: https://avatars.githubusercontent.com/u/939078?v=4 + read_time: 7 +--- + +Revisit-Consensus protocol is a protocol to keep the information consistent and durable in multiple servers. + +--- + +## Introduction of consensus + +Consensus protocol is a protocol to keep the information consistent and durable in multiple servers, and the property is kept even if some servers fail. When we talk about consensus, usually protocols like classic Paxos or Raft come into our minds. They are the foundation of many later invented protocols like Multi-Paxos or Fast-Paxos. Let’s first review these two protocols to see how they work. + +First let’s take a look at Paxos, which is shown in the below graph. Paxos has two phases. The first phase is Prepare, and its main assignment is to take a Slot on the Log. The second phase is Accept, which makes sure this specific Slot has been explicitly occupied, and not taken by others between two phases. When Client receives OK response from the majority of servers, it means this particular record has been submitted and a consensus is reached. Here we can take Client and Proposer as a whole, and there are two messages delivered in the whole process and one message in each phase respectively. + +![image](/xline-home/blog/Revisit-the-Consensus-Protocol/image1.jpg) + +Then let’s move on to talk about Raft, which is also shown below. In Raft protocol a Client sends a request to the leader server, then the leader broadcast the request to all the follower servers. When the leader collects the OK response from the majority of all servers, including itself, a consensus is reached, then it tells the result to Client. There are two messages delivered during the process, one is between Client and the leader, the other is between the leader and the followers. + +![image](/xline-home/blog/Revisit-the-Consensus-Protocol/image2.webp) + +It thus can be told that the above two protocols take two RTTs to complete a request and reach a consensus. It usually does not have a big impact on performance if the protocol runs in a single data center, while the situation is totally different if we run the protocol in multiple data centers. Because the latency between the data-centers is too high, up to hundreds of milliseconds. Therefore, in multi-data center scenarios, it is critical to reduce the number of messages delivered in the process. + +Then, the next question is “Are two phases necessary?”. The answer is yes if we want to keep the following properties: + +1. Any committed request cannot be revised or lost. +2. The order of committed requests cannot be revised or lost.d +3. The order of committed requests cannot be revised or lost.d + +In terms of the protocol that has no leader, like Paxos, one-message delivery can only make sure that the majority learns the message, but the ordering is out of control. And for the protocol that has a leader (e.g., Raft), two messages are also required to duplicate the message to all the servers, as one message can only make sure the leader learns the request. In other words, one-message delivery can only make the leader decide the execution sequence (the 2nd property),but cannot guarantee the committed request will not be lost, since only the leader is entitled to acquire this particular request. + +Then how do we come up with a way to reduce one number of message delivery? The answer is to compromise the second property, which is to abandon the “globally unique execution order” and change it to “guarantee a globally unique execution order for conflicting requests, and irrelevant requests can be executed out of order”. The CURP protocol introduces this idea and partially gives up the second property. Let’s see how CURP works in the next section. + +## CURP protocol + +We won’t discuss all the details of the CURP protocol for it’s too complicated, so only the critical parts will be covered. Here’s the process diagram of the CURP protocol: + +![image](/xline-home/blog/Revisit-the-Consensus-Protocol/image3.webp) + +To start with, let’s describe the main procedures briefly below: + +1. The Client sends a request to all the CURP servers including the master (leader). +2. Every server maintains a waiting pool, which is the blue part in the above graph. The requests in the waiting pool maybe haven’t reached a consensus yet. +3. Once a server receives a request from the Client, it checks if the request conflicts with the requests in the waiting pool. +4. If there’s a conflict, the server rejects the Client request. +5. Otherwise, it accepts the request and let the Client knows. +6. If the Client received no less than (f + (f + 1)/ 2 + 1) Accept replies, including the reply from the master, it knows the request has been committed. Otherwise, Client waits for the master server to duplicate the request to the follower servers. Once the duplication process completes, the request is removed from the waiting pool and the master server tells the Client that the request has been committed. + +It’s not easy to understand the protocol if we only list the above four steps. Let me put it in a question-and-answer format for further explanations. + +**Q1: Why can the Client make sure a request is committed when no less than (f + (f + 1)/ 2 + 1) Accept responses including the reply from the master are received?** + +A1: Because the waiting pool is exclusive as conflict requests won’t be in the same pool at the same time, once a request is accepted by the majority, the other conflict request won’t get the majority vote until the previous one is removed. Even if there’s f server failures, we can easily recover the request from the remaining (f + 1)/ 2 + 1 servers, which are also the majority of the remaining servers. So as a result CURP protocol keeps the committed request and the ordering of the conflicting requests. + +**Q2: The number (f + (f + 1)/ 2 + 1) is strange, why not f + 1?** + +A2: The reason is the recovery procedure requires the number. In the worst case, there are at most f failures, we must find out the committed requests in the waiting pool according to the remaining informed (f + 1)/ 2 + 1 servers, which are the majority of all remaining servers. + +The consensus protocol allows at most f server failures, so the remaining server is f+1. In the worst case, all failed servers contain that request, then the remaining f+1 still have at least (f+1\\_)/2+1 servers containing that particular request, accounting for the vast majority and is convenient for the recovery process to restore the request and prevent any losses. + +**Q3: Do all the requests reach the consensus after one message delivery?** + +A3: It is not guaranteed. If there’s no conflicting request, one message is enough to reach the consensus. Otherwise, in terms of conflicting requests, the Client must wait for the master (leader) server to complete synchronization, which takes another message delivery. Then the Client can confirm that the request is committed. In this case, two messages are delivered, similar to Raft. Therefore, 1RTT for the best case and 2RTT for the worst case. + +**Q4: How does the master duplicate the message to the follower servers?** + +A4: The same as Raft. + +**Q5: What is the recovery process for the CURP protocol?** + +A5: First, the recovery process needs to elect a new master (leader), which is the same as Raft. Then the process can be roughly divided into two modules. For the synchronized request, the recovery process is consistent with the Raft protocol. For the requests that have not been synchronized yet, they need to be collected from all servers. When f+1 servers (including the new leader itself) are collected information, keep the requests that appear at least (f+1)/2+1 times, because these requests may have been committed, thus cannot be lost. + +## Summary + +We find that the CURP protocol is very similar to the Raft protocol except for the waiting pool. The pool is used to keep the ordering of the conflicting requests, making sure there’s at most one request committed among all the conflicts. In other words, all requests need to wait for the synchronization of the master at the time when the pool is sorting conflicting requests. The waiting pool is the root reason for the outperforming result. + +To sum up, under optimal condition, the CURP takes one round of message delivery to reach consensus. In the worst case, it takes two rounds of message delivery to achieve consensus, just as the Raft protocol. + +For more details about the CURP protocol, please refer here to the original paper. + +Xline, an open source project by DatenLord, is a geo-distributed KV store for metadata management, which is based on the CURP protocol. + +GitHub Links: https://github.com/datenlord/Xline +`,$5=`--- + + cover: /xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/cover.png + author: + name: Ye Tian + url: https://github.com/datenlord + img_url: /xline-home/DatenLord.png + read_time: 13 + +--- + +Thinking About-The purpose of this article is concerning how to think about computer systems and algorithms from a mathematics perspective. + +--- + +The purpose of this article is to provide readers who have not been exposed to formal methods with a new perspective on computer systems and algorithms, rather than formal methods or TLA+ tutorials. Therefore, the focus of this article is how to think about programs from a mathematical perspective, without using a lot of space to explain the syntax of TLA+. + +## How do we write correct programs? + +The goal of programming is always to write correct programs. Our programs become more complex over time, and the errors that may exist in them become more numerous. To write correct programs, we should first understand what errors may occur in our programs. + +### What errors will there be in the program? + +I will roughly divide the errors that may occur in the program into two categories: simple errors and logical errors. + +#### Simple errors + +Simple errors include semantic errors, memory errors, etc. For these easy-to-analyze errors, we already have many mature methods and tools to avoid them, such as compilers, static analysis tools, garbage collector. Because these errors can be relatively easily found and fixed, they are not the focus of our attention. + +#### Logical errors + +Logical errors are the most difficult to find and fix in programs, such as deadlocks, race conditions, data inconsistencies. Logical errors affect the correctness, performance and reliability of the program, and are usually caused by insufficient design of the program. For these errors, we need to analyze and solve them from a higher level, rather than just from the implementation details of the code. + +We usually use some methods to avoid logical errors, such as: + +- **Optimize software architecture design** - Consider the correctness of the program in the design stage +- **Testing** - Use various testing methods to reduce the errors in the program, but it cannot guarantee the complete correctness of the program + +### Experience + +It is not hard to see that the theories above are derived from experience. Experience is accumulated in practice, and we summarize the experience to derive guiding principles, methods and steps that can help us design better programs. + +#### But can we rely only on experience? + +The more experienced people are, the more details and possibilities they can think of, and the systems they design are usually more stable. But we can't just rely on experience: + +- **Experience is limited** - Human experience is limited and unreliable +- **The behavior and state of complex systems are numerous** - A complex system has too many behaviors and states to predict +- **The requirements for correctness of a specific program are very high** - Some programs have very high requirements for correctness, such as financial systems, medical systems, which are difficult to guarantee through experience +- **Unable to verify correctness from theory** - Can only reduce the occurrence of errors as much as possible, but cannot prove the correctness of the program from theory + +Therefore, we need a more rigorous method to guarantee the correctness of the program from the design. + +### Formal methods + +If we can verify the correctness of a program from mathematical perspective, we can solve the above problems. Actually, this is the goal of formal methods. + +Formal methods are based on mathematics, by establishing mathematical models for systems to define the behavior, state, etc. of the system, and then defining the constraints of the system, such as safety, liveness, and finally proving that the model satisfies the formal specification of the system to verify the correctness of the system. For finite-state systems, model checking based on finite-state search can be used to verify the behavior of the system to verify whether the system has the expected properties. For systems with infinite state spaces, deductive verification based on logical inference is used to verify the correctness of the system using induction. + +This article uses the TLA+ language as a tool to introduce formal methods. + +## TLA+ + +Leslie Lamport, the author of TLA+, is a computer scientist who won the Turing Award in 2013 for his groundbreaking work in the field of concurrent and distributed systems. + +### What's TLA+ + +TLA+ is an high-level language for modeling programs and systems - especially concurrent and distributed programs and systems. Its core idea is that the best way to precisely describe things is to use simple mathematics. TLA+ and its tools can be used to eliminate design errors that are difficult to find and correct in code and are expensive to correct. + +TLA+ specifications are not real engineering code and cannot be used in production environments because the goal of TLA+ is to find and solve logical errors at the design stage of the system. In TLA+ we abstract programs as finite-state mathematical models, usually state machines, and then use the TLC Model Checker to exhaustively search all possible states of the program and verify its correctness. + +The following two simple examples introduce TLA+. These two examples are from [Leslie Lamport's The TLA+ Video Course](https://www.youtube.com/playlist?list=PLWAv2Etpa7AOAwkreYImYt0gIpOdWQevD). The goal of this article is to provide a new perspective on computer systems and algorithms for readers who have not been exposed to formal methods, rather than a TLA+ tutorial, so the syntax and use of TLA+ tools will not be discussed in detail. + +### Simple Example + +TLA+ allows us to use simple mathematics to abstract system models, mainly set theory and boolean logic. In the process of abstraction, we need to abandon some implementation details and only focus on the logic of the program itself. + +Here is a simple C program that we try to abstract as a TLA+ program: + +\`\`\`c +int i; +void main() { + i = someNumber(); // someNumber() returns a number between 0 and 1000 + i = i + 1; +} +\`\`\` + +#### State Abstraction + +We need to abstract this program into a series of independent **states**. Obviously, the difference between each state is only the value of \`i\`. Suppose that the default value of \`i\` is 0 after initialization, and that \`someNumber()\` returns 42 when this program is run, then the state transition relationship of this program is: + +[i : 0] -> [i : 42] -> [i : 43] + +There are three states in this, and the difference between each state is that the value of \`i\` is different. + +It seems that the abstraction is complete, but there are problems. Suppose that \`someNumber()\` returns 43 in another run, then the state transition relationship of this program is: + +[i : 0] -> [i : 43] -> [i : 44] + +This is inconsistent with the previous abstraction, because the state transition relationship of the two runs is different. This is because we have not considered the return value of \`someNumber()\`. + +The _state_ of a program refers to the time point when the program is at each stage, not the process of the program running. Therefore, each state is independent, and the transition between states is atomic. This is very different from traditional programming, which is procedural, and TLA+ is state-oriented. We only care about what state the program is currently running in, so we can introduce a new variable \`pc\` to represent which stage the program is running in, so that we can clearly represent the sub-state relationship of the program: + +\`\`\`c +int i; +void main() { + i = someNumber(); // pc = "start" + i = i + 1; // pc = "middle" +} // pc = "done" +\`\`\` + +In this way, we no longer need to consider the value of \`i\`, but only the value of \`pc\`: + +[pc : start] -> [pc : middle] -> [pc : done] + +#### Writing States + +The initial value of \`i\` is 0, and the initial value of \`pc\` is \`start\`, so we can write the sub-state relationship as: + +![image1](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image1.png) + +In which, for the variable \`i\`, its next state is represented as \`i'\`, which is the way TLA+ defines the state transition of variables. \`i' ∈ 0..1000\` means that the value of \`i\` in the next state is a number between 0 and 1000, that is, \`someNumber()\`, \`0..1000\` represents the set \`{0,1,...,1000}\`. \`∧\` is the logical and in Boolean logic, which can be understood as "and". Finally, the program runs to completion and there is no next state, so it is represented as \`FALSE\`. + +In TLA+ , we write a state. Therefore, it is not "because \`pc = start\` so \`i' ∈ 0..1000\`", in fact, the relationship between the two is parallel: **In this state, the value of \`pc\` is \`start\` and the value of \`i\` in the next state \`∈ 0..1000\`**. With this idea, we can rewrite the above abstraction as: + +![image2](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image2.png) + +In which, the "or" is used to connect two states, which can be represented by the logical or \`∨\` in Boolean logic. In this way, we can clearly represent the state transition relationship of the program. For the sake of beauty, the same Boolean logic symbol can also be supplemented before the first sentence in TLA+ : + +![image3](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image3.png) + +We finally get the two states after the initial state of this simple program, and then we will complete the initial state and supplement the entire specification according to the requirements of the TLA+ language: + +![image4](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image4.png) + +- \`EXTENDS\` is used to introduce modules defined in other specifications, which is mainly used in \`i' ∈ 0..1000\` here. +- \`VARIABLES\` is used to define variables, which are defined as \`i\` and \`pc\` here. +- \`Init\` is used to define the initial state, which is defined as \`i = 0\` and \`pc = "start"\` here. +- \`Next\` is used to define the state transition relationship. + +Now we have a complete TLA+ specification. Later, we can use the TLC Model Checker to check the model, but this is not within the scope of this article. + +For simple systems, modeling with TLA+ cannot bring many benefits. Generally speaking, TLA+ is only used when designing very complex, very critical, and very experience-based systems. Concurrency and distributed systems are usually the fields where TLA+ is used. Let's take a look at an example of a distributed system algorithm: Two-Phase Commit. + +### Two-Phase Commit + +> In transaction processing, databases, and computer networking, the two-phase commit protocol (2PC) is a type of atomic commitment protocol (ACP). It is a distributed algorithm that coordinates all the processes that participate in a distributed atomic transaction on whether to commit or abort (roll back) the transaction. This protocol (a specialised type of consensus protocol) achieves its goal even in many cases of temporary system failure (involving either process, network node, communication, etc. failures), and is thus widely used. —— [Two-phase commit protocol (Wikipedia)](https://en.wikipedia.org/wiki/Two-phase_commit_protocol) + +Lamport explains Two-Phase Commit in the following analogy in [Leslie Lamport's The TLA+ Video Course](https://www.youtube.com/playlist?list=PLWAv2Etpa7AOAwkreYImYt0gIpOdWQevD): + +![image5](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image5.png) + +In a wedding, the minister is the coordinator, the groom and the bride are the participants. When the groom and the bride both agree to the marriage, the minister will officially announce the marriage. If one of them does not agree, the minister will abort the marriage: + +1. The minister asks the groom: Do you agree to this marriage? +2. The groom answers: I agree (prepared). +3. The minister asks the bride: Do you agree to this marriage? +4. The bride answers: I agree (prepared). +5. The minister announces: The marriage is officially established (committed). + +If one of them does not agree, the minister will abort the marriage. + +In a database, the Transaction Manager is the coordinator (the minister). When the Transaction Manager asks all the participants Resource Managers (the groom / bride), if all the Resource Managers agree to commit the transaction, the Transaction Manager will commit the transaction. If one of them does not agree, the Transaction Manager will abort the transaction. + +The detailed introduction and process of Two-Phase Commit can be found on [Wikipedia](https://en.wikipedia.org/wiki/Two-phase_commit_protocol). + +First, let's define some constants and variables and their initial state: + +![image6](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image6.png) + +- The constant \`RM\` is the set of all Resource Manager identifiers, for example, it can be set to the set \`{"r1", "r2", "r3"}\`. +- The variable \`rmState\` is used to record the state of each Resource Manager, and \`rmState[r]\` is used to represent the state of \`r\`, which has four states: \`working\`, \`prepared\`, \`committed\`, \`aborted\`. The initial state of each \`RM\` is \`working\`. +- The variable \`tmState\` is used to record the state of the Transaction Manager, which has three states: \`init\`, \`committed\`, \`aborted\`. The initial state is \`init\`. +- The variable \`tmPrepared\` is used to record the Resource Manager that is ready (in the \`prepared\` state). The initial value is an empty set. +- The variable \`msgs\` is used as a message pool to record all messages that are being transmitted. The initial value is an empty set. + +Next, let's define the actions that the system may perform. + +![image7](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image7.png) + +- In TLA+, expressions similar to the "function" concept in other programming languages can be defined in the above way, so there is no need to define an expression for each Resource Manager. +- \`[type → "prepare", rm → r]\` is a record in TLA+, similar to a struct in other programming languages. +- \`UNCHANGED ⟨rmState, tmState, msgs⟩\` means that this action will not change the values of the variables \`rmState\`, \`tmState\`, \`msgs\`. In TLA+, it is necessary to explicitly declare whether the value of each variable changes or not. + +When the state of \`TM\` is \`init\`, and there is a \`Prepared\` message from \`r\` in the message pool, the value of \`tmPrepared\` in the next state will be the union of \`tmPrepared\` and \`{r}\`. + +![image8](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image8.png) + +The above two actions are Transaction Manager performing Commit and Abort. + +![image9](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image9.png) + +The above 4 Resource Manager actions are Resource Manager choosing Prepare and Abort, and handling the Commit and Abort decided by the Transaction Manager. + +The syntax \`rmState' = [rmState except ![r] = "prepared"]\` means "in the next state, the value of \`rmState[r]\` is changed to \`prepared\`, and the other parts remain unchanged". + +If we use a form like \`rmState[r]' = "prepared"\`, we have not explicitly stated the values of the other parts of \`rmState\` in the next state, so it is incorrect. + +TLA+ is different from the programs we usually write, it is mathematics. In programming, we use arrays, and in TLA+, we use functions to express similar concepts, and the set of array indices is the domain of the function. + +After writing all the actions that the system may exist, we can start to deduce the state transition of the system: + +![image10](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image10.png) + +We use the existential quantifier \`∃r ∈ RM\` to represent "for any element \`r\` in the set \`RM\`, there is such an action". The state transition in TLA+ is atomic, so in a state, only one \`r\` will be selected in this "or" branch, which can be compared to the \`for r in RM\` in the programming language, but fundamentally different. + +At this point, the modeling of the system is complete. Now we need to write the system's constraint conditions: + +![image11](/xline-home/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image11.png) + +In the constraint condition \`TypeOK\`, we have limited the possible values of each variable. The \`[RM → {"working", "prepared", "committed", "aborted"}]\` is similar to the Cartesian product of the set \`RM\` and the set \`{"working", "prepared", "committed", "aborted"}\`, but the result is a set composed of records: + +\`\`\`rust +{ + [r1 |-> "working", r2 |-> "working"], + [r1 |-> "working", r2 |-> "prepared"], + [r1 |-> "working", r2 |-> "committed"], + ... + [r1 |-> "aborted", r2 |-> "committed"], + [r1 |-> "aborted", r2 |-> "aborted"] +} +\`\`\` + +In \`TypeOK\`, we use the set \`Messages\` defined above. When defining \`Messages\`, we used the syntax: \`[type: {"Prepared"}, rm: RM]\`. This syntax is also similar to the Cartesian product of \`{"Prepared"}\` and \`RM\`, but the result is also a record set: + +\`\`\`rust +{ + [type |-> "Prepared", rm |-> r1], + [type |-> "Prepared", rm |-> r2], + ... +} +\`\`\` + +The final constraint condition \`Consistent\` is used to ensure the consistency of the system: at any time, it is impossible for two Resource Managers to be in the \`committed\` and \`abort\` state respectively. + +Finally, we will give the constraint conditions as invariants, together with the system model, to the TLC Model Checker for verification, and we can prove the correctness of the system. + +## Summary + +From the above two examples, we have a preliminary understanding of the idea of formal methods. TLA+ is designed for verifying distributed systems, but its ideas can be applied to fields far beyond distributed systems. When writing programs, if we can not only consider the contents on the code level, but also think from a higher level, from a mathematical point of view, we can write more robust programs. + +If you are interested in TLA+, you can refer to [Leslie Lamport's The TLA+ Video Course - YouTube](https://youtube.com/playlist?list=PLWAv2Etpa7AOAwkreYImYt0gIpOdWQevD) and [Learn TLA+](https://learntla.com). +`,U5=`--- + + cover: /xline-home/blog/How-to-elegantly-organize-async-Rust-code/cover.png + author: + name: Tianyu Chen + url: https://github.com/datenlord + img_url: /xline-home/DatenLord.png + read_time: 5 + +--- + +Elegant-The article starts from my experience of writing async Rust code and concludes with my practice of applying the principles in a recent refractoring of Curp. + +--- + +## Summary + +Anyone who has worked with async Rust has likely struggled with the bounds it requires, e.g., the \`'static\` bound on spawned tasks, \`MutexGuard\` can not be held across \`.await\` point. Overcoming these constraints requires carefully structured scopes, which might result in opaque and nested code that is challenging for both the developer to write and for reviewers to read. In this talk, I will first list some pain points from my experience of writing async Rust code. Then, I will point out scenarios where we actually need async code and argue why we should separate async and non-async code. Finally, I will demonstrate how I've practiced this principle in a recent refactoring of Curp. + +## Pain Point + +### Spawned Task must be \`'static\` + +The compiler has no idea how long an asynchronous task will run for when we create it; it may be ephemeral or it may continue to run until the program terminates. For this reason, the compiler requires all types owned by the tasks to be \`'static\`. +Such a limitation often leads to a lot of cloning before spawning a task. Admittedly, these codes help programmers to better understand which variables' ownership should be transferred to the new task. Unfortunately, the code will look tedious. + +\`\`\`rust +let a_arc = Arc::clone(&a); +let b_arc = Arc::clone(&b); +tokio::spawn(async move { + // ... +}); +\`\`\` + +### \`Non-Send\` variables cannot be held across \`.await\` point + +The Tokio runtime can move a task between threads at every \`.await\`. That's why all variables that are held across\` .await\` must be sent, bringing a lot of trouble when writing async functions. + +For example, the following code does not compile because \`log_l\`, a non-\`Send\` \`MutexGuard\`, can not be held across the \`.await\` point. + +\`\`\`rust +let mut log_l = log.lock(); +log_l.append(new_entry.clone()); +broadcast(new_entry).await; +\`\`\` + +As the broadcast could take a while, we don't want the \`MutexGuard\` to be held across the.await point either. The compiler does a great job at pointing up places for possible performance improvement. + +To avoid this, we naturally add a line to drop the lock just before broadcasting. + +\`\`\`rust +let mut log_l = log.lock(); +log_l.append(new_entry.clone()); +drop(log_l); +broadcast(new_entry).await; +\`\`\` + +Sadly, it still won't compile. The explanation here is from \`tokio\` official website: + +> The compiler currently calculates whether a future is \`Send\` based on scope information only. The compiler will hopefully be updated to support explicitly dropping it in the future, but for now, you must explicitly use a scope. + +To get around, we must wrap our code in an redundant scope. The code is not elegant anymore🙁. + +\`\`\`rust +{ + let mut log_w = log.write(); + log_w.append(new_entry.clone()); +} +broadcast(new_entry).await; +\`\`\` + +More nested scope will be created if multiple locks must be acquired by an async function. When this happens, the code becomes unreadable and unmaintainable. + +> Side Note: You might be wondering why we don't make use of the async lock(\`tokio::sync::Mutex\`) tokio offers. It can be held across the \`.await\` point and will save us a lot of trouble. That's because it has relatively limited use cases in practice. Normally, we don't want critical sections to be too long. For example, we don't want to hold the lock when we are broadcasting the new entry. Therefore, be careful about async mutex, you don't want to accidentally use it. + +## Async scenarios + +The previously mentioned problems are, in my opinion, caused by a lack of clarity in the separation between async and non-async code. In other words, we may fail to separate the async part and non-async part when designing our application's architecture. So, I will sort out the scenarios where we can actually take advantage of async Rust. + +### I/O + +You don't want I/O to block the current thread since I/O can take a long time. Async I/O helps us to hand out control flow to other tasks when we are waiting for I/O resources. + +\`\`\`rust +// .await will enable other scheduled tasks to progress +let mut file = File::create("foo.txt").await?; + +file.write(b"some bytes").await?; +\`\`\` + +### Background tasks + +You want to spawn a background task in order to handle things in the background(usually paired with the receive end of an async channel). + +\`\`\`rust +tokio::spawn(async move { + while let Some(job) = rx.recv().await { + // ... + } +}; +\`\`\` + +### Concurrent tasks + +You want to spawn multiple tasks to utilize multicore. + +\`\`\`rust +let chunks = data.chunks(data.len() / N_TASKS); +for chunk in chunks { + tokio::spawn(work_on(chunk)); +} +\`\`\` + +### Wait for others + +You want to pause the current thread and wait for some other events. + +\`\`\`rust +// wait for some event +event.listen().await; + +// barrier +barrier.wait().await; +\`\`\` + +As can be seen, async code usually resides in limited places: I/O, concurrent, and background tasks. Therefore, when we are designing our code, we can consciously identify async functions and try to minimize them. Separating these two parts can not only alleviate the pain points mentioned at the beginning of the article, but also help us to clarify the code structure. + +\`\`\`rust +// before +{ + let mut log_w = log.write(); + log_w.append(new_entry.clone()); + // ... +} +broadcast(new_entry).await; + +// after: move the logic to another function instead + +fn update_log(log: &mut Log, new_entry: Entry) { + log.append(new_entry); + // ... +} + +update_log(&mut log.write(), new_entry.clone()); +broadcast(new_entry).await; +\`\`\` + +## Regarding a recent major refactor of curp + +Before refactoring, due to multiple iterations, the readability and structure of the code became increasingly poor. Specifically, we had several lock structures that needed to be shared among various parts of the Curp server, and most functions of Curp server were async. The async and locking code were mixed together, frequently leading to the aforementioned pain points during development. + +Therefore, we reorganized the structure of Curp server, dividing it into an async part called CurpNode and a non-async part called Rawcurp: + +- CurpNode includes only async code + - I/O tasks: receiving, sending network requests, persisting log entries + - Background tasks: periodically checking leader activity, copying and aligning data on each node +- Rawcurp can be considered as a state machine that receives calls from CurpNode and updates the state. It includes only non-async code. If RawCurp wants to perform some async operations (such as broadcasting heartbeat), it can use return values and channels to let CurpNode make requests on its behalf. + +![image1](/xline-home/blog/How-to-elegantly-organize-async-Rust-code/image1.png) + +Take our tick function as an example. Before refactoring, due to the limitation that LockGuard cannot pass the await point and the restriction of multiple logical branches, we had to organize the code in this way: + +\`\`\`rust + loop { + let _now = ticker.tick().await; + let task = { + let state_c = Arc::clone(&state); + let state_r = state.upgradable_read(); + if state_r.is_leader() { + if state_r.needs_hb + { + let resps = bcast_heartbeats(connects.clone(), state_r, rpc_timeout); + Either::Left(handle_heartbeat_responses( + resps, + state_c, + Arc::clone(&timeout), + )) + } else { + continue; + } + } else { + let mut state_w = RwLockUgradableReadGuard::upgrade(state_r); + // ... + let resps = bcast_votes(connects.clone(), state_r, rpc_timeout); + Either::Right(handle_vote_responses(resps, state_c)) + } + }; + task.await; + } +\`\`\` + +After the refactoring, the code is significantly more understandable because all of the non-async functionality has been transferred to \`RawCurp\`. + +\`\`\`rust +loop { + let _now = ticker.tick().await; + let action = raw_curp.tick(); + match action { + TickAction::Heartbeat(hbs) => { + Self::bcast_heartbeats(Arc::clone(&raw_curp), &connects, hbs).await; + } + TickAction::Votes(votes) => { + Self::bcast_votes(Arc::clone(&raw_curp), &connects, votes).await; + } + TickAction::Nothing => {} + } +} +\`\`\` +`,j5=`--- + cover: /xline-home/blog/Database-Isolation-Levels-and-MVCC/cover.png + author: + name: Jicheng Shi + url: https://github.com/rogercloud + img_url: https://avatars.githubusercontent.com/u/939078?v=4 + read_time: 5 +--- + +When processing multiple transactions at the same time, the database needs to decide whether the transactions can see each other's changes, how much they can see, etc. + +--- + +## Introduction to database isolation levels + +When processing multiple transactions at the same time, the database needs to decide whether the transactions can see each other's changes, how much they can see, etc. According to the strict level of isolation, they can be classified from strict to loose as Serializable, Repeatable reads, Read committed, Read uncommitted. We use the following example of KV storage to explain these four isolation levels. The initial situations of the KV storage are as follows: + +![image1](/xline-home/blog/Database-Isolation-Levels-and-MVCC/image1.png) + +### Read uncommitted + +When two transactions are being executed at the same time, top-down is the order of execution. + +![image2](/xline-home/blog/Database-Isolation-Levels-and-MVCC/image2.png) + +Under the isolation level of Read uncommitted, multiple transactions executing at the same time are able to see each other not committing the writing operations, which can be considered almost useless. +In the above example, Operation 2 reads "AA" and even though the second transaction eventually Rollback, Operation 4 still reads "DD". When two transactions are being executed simultaneously in the Read committed, they follow top-down order. + +![image3](/xline-home/blog/Database-Isolation-Levels-and-MVCC/image3.png) + +Under the isolation level of Read committed, only the result after Commit can be seen. So in the execution order of Table 2, both Operation 2 and 4 can read the value of "AA", that is, the value of Key 1 is not changed. If two transactions are executed as in Table 3, Operation 2 will read "AA" and Operation 5 will read "DD", because Transaction 2 has been executed successfully at the time. + +### Repeatable read + +If Transaction 1 in Table 3 has two consecutive read operations while the user wants to guarantee that the same value is read, then the repeatable read isolation level should be used. Under this isolation level, multiple reads of the same data in the same transaction are guaranteed to yield the same value, even if the data is modified by other committed transactions in the process. Of course, there are cases where isolation is not guaranteed in this isolation level, which is shown as follows: + +![image4](/xline-home/blog/Database-Isolation-Levels-and-MVCC/image4.png) + +Under the isolation level of repeatable read, Operation 2 returns ["CC"] as result, which means only the value of Key 3 is returned, while that of Operation 5 is [“CC", "DD"]. To summarize, the isolation level of repeatable read still cannot perfectly handle situations involving multiple pieces of data, especially when new data is inserted or deleted. + +### Serializable + +The strictest isolation level is called Serializable, which is also the most perspicuously defined. The execution result under this level is "as if" all transactions were serialized and executed one by one. + +It is worth emphasizing the word "as if" in the above sentence. To improve performance, few databases use serial execution on the real meaning of physical to ensure Serializable, but only to achieve a similar effect, which can be achieved in a variety of ways. There is a subcategory under the Serializable level called Snapshot, which is similar to Serializable but slightly less constrained. It is because of the relaxation of constraints that gives a better-performed implementation and makes it the default supported isolation level by most databases. + +Let's talk about Snapshot, and by extension, the MVCC implementation. + +## Snapshot isolation level and MVCC + +To distinguish between the strictest Serializable and Snapshot, let's look at the following two transactions as examples. + +![image5](/xline-home/blog/Database-Isolation-Levels-and-MVCC/image5.png) + +If strictly following the Serializable isolation level, regardless of either Transaction 1 or 2 is executed first, the ultimate value of Key 1 and 2 is the same, either "AA" or "BB". + +However, when executed under the Snapshot level, the result is that the values of Key 1 and 2 are swapped. + +The isolation power of Snapshot is obviously weaker in this case. Isolation seems helpless in dealing with the order of transactions with read-write intersections, while only ensuring the order of transactions with write conflicts. + +While the above example looks specifically at the differences between the Snapshot isolation level and Serializable, we have not yet fully described the characteristics of Snapshot: + +- Transactions in Snapshot have two important timestamps, a read timestamp R and a write timestamp W. All read operations after R can only read the data committed before R. +- Snapshot allows two transactions that do not have a write intersection to execute simultaneously and in parallel. + +In order to satisfy both of these features, it is natural to think of saving multiple versions for each data, so that when a write operation is committed, the new data is saved in the new version while the old one is not covered, which is what we call MVCC (Multiversion concurrency control). + +We know that there is no conflict between read operations, and write operations cannot be executed simultaneously under the Snapshot level (or Roll back if a conflict is found), so MVCC works mainly when there is a conflict between read and write operations, allowing two seemingly conflicting transactions to execute concurrently. + +MVCC also requires garbage collection, otherwise too much old version data will take up unnecessary storage space. The next question is, how do you determine whether a version of data can be deleted? The answer is that it can be deleted when all read operations involved in such version of data are completed, provided that there is a newer version of data ahead. + +## Some little thoughts + +In the process of introducing MVCC we can easily capture the following key points: +1.Multiple versions. +2.Garbage handling. +3.Improving the efficiency of concurrent operations. + +In a previous article by DatenLord titled "Memory Management for Rust Language Lock-Free Data Structures", we introduced another technology related to these keywords, which is the "epoch-based memory management" (epoch) method for lock-free data structures. Epoch maintains the memory state of two generations, and when the memory of the oldest generation is no longer accessible, then the corresponding memory will be reclaimed and released, and a new generation will be opened. The purpose of doing this is also to allow the operation of modifying the data of the new generation and the operation of reading the data of the old generation to be parallelized, also to achieve read-write concurrency optimization. Of course, in addition to these similarities, there are also differences in that MVCC can simultaneously exist in many versions, while epoch always exists in two versions. This can be interpreted as epoch's memory management being more granular, so when contention is heavy epoch can sometimes cause an increase in memory pressure. + +In general, MVCC and epoch are similar in the central idea of using multi-version memory control technology to solve the problem of concurrent read/write conflicts. + +## Summary + +In this paper, we introduced the four isolation levels of the database and the differences between the different isolation levels with examples. + +Later, we dug into details about Snapshot, a most widely used insolation level and its most frequently used implementing method MVCC. +Finally, compared and discussed the memory management mechanisms of MVCC and lock-free data structures. + +DatenLord project Xline focuses on cross-cloud metadata management KV storage and is currently using MVCC for database isolation in practice. If you want to learn more about it, please refer to the Xline GitHub link: [https://github.com/datenlord/Xline](https://github.com/datenlord/Xline) +`,q5=`--- + cover: /xline-home/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/cover.png + author: + name: Jiawei Zhao + url: https://github.com/Phoenix500526 + img_url: https://avatars.githubusercontent.com/u/9337239?v=4 + read_time: 20 +--- + +In the early prototype phase of Xline, we used in-memory storage for data persistence. While this simplified the complexity of the Xline prototype design and speeded up the development and iteration of the project, it also had significant consequences: since the data was stored in memory, the recovery of node data after a process crash relied on pulling the full data from other healthy nodes, resulting in longer recovery times. + +--- + +## Introduction + +In the early prototype phase of Xline, we used in-memory storage for data persistence. While this simplified the complexity of the Xline prototype design and speeded up the development and iteration of the project, it also had significant consequences: since the data was stored in memory, the recovery of node data after a process crash relied on pulling the full data from other healthy nodes, resulting in longer recovery times. + +With this consideration in mind, Xline introduced a Persistent Storage Layer in its latest release v0.3.0 to persist data to disk and shield upper-layer callers from irrelevant low-level details. + +## Selection of Storage Engines + +Currently, mainstream storage engines in the industry can be broadly categorized into B+ Tree-based storage engines and LSM Tree-based storage engines. Each has its own advantages and disadvantages. + +### Analysis of B+ Tree Read and Write Amplification + +When reading data from B+ Tree, we need to first search along the root node, and then move down the index until we finally reach the bottom leaf node. Each access corresponds to one disk IO. Similarly, when writing data, the search starts from the root node and goes down to the appropriate leaf node for data insertion. + +To facilitate the analysis, let's make the following assumption: the block size of the B+ Tree is denoted as B, so each internal node contains O(B) child nodes, and each leaf node contains O(B) data entries. Assuming the size of the dataset is N, the height of the B+ Tree is approximately $$O(\\log_B(\\frac{N}{B}))$$ + +Write Amplification: Each insert operation in the B+ Tree writes data to a leaf node, regardless of the actual size of the data. This means that each insert operation requires writing a block of size B, resulting in a write amplification of O(B). + +Read Amplification: A single query in the B+ Tree requires traversing from the root node to a specific leaf node, resulting in a number of I/O operations equal to the height of the tree, which is approximately O(log_B(N/B)). Thus, the read amplification is O(log_B(N/B)). + +### LSM Tree Read and Write Amplification Analysis + +In LSM Tree, when data is written, it is first written to an in-memory file called the memtable (Level 0) in an append-only manner. When the memtable reaches a certain size, it is converted into an immutable memtable and merged into the next level. For data retrieval, the search starts in the memtable, and if the search fails, it proceeds to search in lower levels until the element is found. LSM Tree often utilizes Bloom Filters to optimize read operations by filtering out elements that do not exist in the database. + +Assuming the dataset size is N, the amplification factor is k, and the minimum file size in each level is B, with each level having the same file size as B but a different number of files. + +Write Amplification: Assuming we write a record, it will be compacted to the next level after being written k times in the current level. Therefore, the average write amplification per level is $$\\frac{\\sum_{i=1}^{k} k_i}{k} = \\frac{k+1}{2} $$. There are $$\\log_k(\\frac{N}{B} ) $$ levels in total, so the write amplification is $$O(k\\log_k(\\frac{N}{B}))$$. + +Read Amplification: In the worst-case scenario, data is compacted to the last level, and a binary search is required at each level until the data is found at the last level. +For the highest level, $$level_i$$, with data size O(N), a binary search requires $$O(\\log \\frac{N}{B}) $$ disk read operations. +For the next level, $$level_{i-1}$$, with data size $$O(\\frac{N}{k})$$, a binary search requires $$O(\\log \\frac{N}{kB}) $$ disk read operations. +For $$level_{i-2}$$, with data size $$O(\\frac{N}{k^2})$$, a binary search requires $$O(\\log \\frac{N}{k^2B})$$ disk read operations. +..... +Continuing this pattern, the final read amplification can be calculated as R = $$\\sum_{i=0}^{n}(\\log(\\frac{N}{k^iB} )) = O(\\frac{\\log^2\\frac{N}{B}}{log_k}) $$ + +### Summary + +![image](/xline-home/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image1.PNG) + +From the analysis of read and write amplification, it can be concluded that B+ Tree-based storage engines are more suitable for scenarios with more reads and fewer writes, while LSM Tree-based storage engines are more suitable for scenarios with more writes and fewer reads. + +As an open-source distributed KV storage software written in Rust, Xline needs to consider the following factors when selecting a persistent storage engine: + +1. In terms of Performance: Storage engines often become one of the performance bottlenecks in a system, so it is necessary to choose a high-performance storage engine. High-performance storage engines are typically implemented in high-performance languages, preferably with asynchronous implementations. Rust language is the first choice, followed by C/C++. + +2. From a development perspective: Prioritize the implementation in Rust language to reduce additional development work at the current stage. + +3. From a maintenance perspective: + +- Consider the supporters behind the engine, with priority given to large commercial companies and open-source communities. +- It should be widely used in the industry to facilitate learning from experiences in debugging and tuning processes. +- It should have high visibility and popularity (GitHub stars) to attract excellent contributors. + +4. From a functional perspective: The storage engine should provide transactional semantics, support basic KV operations, and batch processing operations. + +The priority order of requirements is: Functionality > Maintenance > =Performance > Development. + +We conducted research on several open-source embedded databases, including Sled, ForestDB, RocksDB, Bbolt, and Badger. Among them, only RocksDB fulfilled all four requirements mentioned earlier. RocksDB, implemented and open-sourced by Facebook, has been widely adopted in the industry with good production practices. It also maintains a stable release cycle and perfectly covers our functional requirements. + +Xline primarily serves the consistency metadata management across cloud data centers, where the workload is predominantly read-intensive with fewer writes. Some readers may wonder why we chose RocksDB even though it is an LSM Tree-based storage engine, which is more suitable for write-intensive, read-light scenarios. + +Indeed, in theory, the most suitable storage engine should be based on B+ Trees. However, considering that B+ Tree-based embedded databases like Sled and ForestDB lack extensive production practices and their version maintenance has stalled, we made a trade-off and selected RocksDB as the storage backend for Xline. Additionally, we designed the Persistent Storage Layer with good interface separation and encapsulation to minimize the cost of changing the storage engine in the future, considering the possibility of more suitable storage engines becoming available. + +## Design and Implementation of the Persistent Storage Layer + +Before discussing the design and implementation of the persistent storage layer, it is important to clarify our expectations and requirements for persistent storage: + +1. As mentioned earlier, after considering the trade-offs, we have chosen RocksDB as the backend storage engine for Xline. However, we cannot rule out the possibility of replacing this storage engine in the future. Therefore, the design of the StorageEngine should adhere to the Open-Closed Principle (OCP) and support configurability and easy replacement. +2. We need to provide a basic key-value (KV) interface for the upper-layer users. +3. A comprehensive recovery mechanism needs to be implemented. + +### Overall Architecture and Write Flow + +Let's first take a look at the current overall architecture of Xline, as shown in the following diagram: +![image](/xline-home/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image2.png) +From top to bottom, the overall architecture of Xline can be divided into the access layer, consensus module, business logic module, storage API layer, and storage engine layer. The storage API layer is responsible for providing business-related StorageApi to both the business module and the consensus module, while abstracting the implementation details of the underlying storage engine. The storage engine layer is responsible for the actual data persistence operations. +Let's take a PUT request as an example to understand the data writing process. When a client initiates a PUT request to the Xline Server, the following events occur: + +1. The KvServer receives the PutRequest from the client and performs validity checks. Once the request passes the checks, it sends a propose RPC request to the Curp Server using its own CurpClient. +2. Upon receiving the Propose request, the Curp Server first enters the fast path flow. It stores the command from the request in the Speculative Executed Pool (aka. spec_pool) to determine if it conflicts with any existing commands in the pool. If there is a conflict, it returns ProposeError::KeyConflict and waits for the slow path to complete. Otherwise, it continues with the current fast path. +3. In the fast path, if a command is neither conflicting nor duplicated, it notifies the background cmd_worker for execution through a specific channel. Once the cmd_worker starts executing the command, it stores the corresponding command in the CommandBoard to track the execution progress. +4. When consensus is reached among multiple nodes in the cluster, the state machine log is committed and persisted in the CurpStore. Finally, the log is applied, triggering the corresponding CommandExecutor in the business module. Each server's store module is responsible for persisting the actual data to the backend database using the DB interface during the apply process. + +### Interface Design + +The following diagram illustrates the relationships between the StorageApi and StorageEngine traits, as well as their corresponding data structures. + +![image](/xline-home/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image3.png) + +#### Storage Engine Layer + +The Storage Engine Layer primarily defines the StorageEngine trait and related errors. +Definition of StorageEngine Trait (engine/src/engine_api.rs): + +\`\`\`rust +/// Write operation +#[non_exhaustive] +#[derive(Debug)] +pub enum WriteOperation<'a> { + /// \`Put\` operation + Put { table: &'a str, key: Vec, value: Vec }, + /// \`Delete\` operation + Delete { table: &'a str, key: &'a [u8] }, + /// Delete range operation, it will remove the database entries in the range [from, to) + DeleteRange { table: &'a str, from: &'a [u8], to: &'a [u8] }, +} + +/// The \`StorageEngine\` trait +pub trait StorageEngine: Send + Sync + 'static + std::fmt::Debug { + /// Get the value associated with a key value and the given table + /// + /// # Errors + /// Return \`EngineError::TableNotFound\` if the given table does not exist + /// Return \`EngineError\` if met some errors + fn get(&self, table: &str, key: impl AsRef<[u8]>) -> Result>, EngineError>; + + /// Get the values associated with the given keys + /// + /// # Errors + /// Return \`EngineError::TableNotFound\` if the given table does not exist + /// Return \`EngineError\` if met some errors + fn get_multi( + &self, + table: &str, + keys: &[impl AsRef<[u8]>], + ) -> Result>>, EngineError>; + + /// Get all the values of the given table + /// # Errors + /// Return \`EngineError::TableNotFound\` if the given table does not exist + /// Return \`EngineError\` if met some errors + #[allow(clippy::type_complexity)] // it's clear that (Vec, Vec) is a key-value pair + fn get_all(&self, table: &str) -> Result, Vec)>, EngineError>; + + /// Commit a batch of write operations + /// If sync is true, the write will be flushed from the operating system + /// buffer cache before the write is considered complete. If this + /// flag is true, writes will be slower. + /// + /// # Errors + /// Return \`EngineError::TableNotFound\` if the given table does not exist + /// Return \`EngineError\` if met some errors + fn write_batch(&self, wr_ops: Vec>, sync: bool) -> Result<(), EngineError>; +} +\`\`\` + +Related Error Definitions + +\`\`\`rust +#[non_exhaustive] +#[derive(Error, Debug)] +pub enum EngineError { + /// Met I/O Error during persisting data + #[error("I/O Error: {0}")] + IoError(#[from] std::io::Error), + /// Table Not Found + #[error("Table {0} Not Found")] + TableNotFound(String), + /// DB File Corrupted + #[error("DB File {0} Corrupted")] + Corruption(String), + /// Invalid Argument Error + #[error("Invalid Argument: {0}")] + InvalidArgument(String), + /// The Underlying Database Error + #[error("The Underlying Database Error: {0}")] + UnderlyingError(String), +} +\`\`\` + +\`MemoryEngine\` (engine/src/memory_engine.rs) and \`RocksEngine\` (engine/src/rocksdb_engine.rs) implement the StorageEngine trait. MemoryEngine is mainly used for testing purposes, while the definition of RocksEngine is as follows: + +\`\`\`rust +/// \`RocksDB\` Storage Engine +#[derive(Debug, Clone)] +pub struct RocksEngine { + /// The inner storage engine of \`RocksDB\` + inner: Arc, +} + +/// Translate a \`RocksError\` into an \`EngineError\` +impl From for EngineError { + #[inline] + fn from(err: RocksError) -> Self { + let err = err.into_string(); + if let Some((err_kind, err_msg)) = err.split_once(':') { + match err_kind { + "Corruption" => EngineError::Corruption(err_msg.to_owned()), + "Invalid argument" => { + if let Some(table_name) = err_msg.strip_prefix(" Column family not found: ") { + EngineError::TableNotFound(table_name.to_owned()) + } else { + EngineError::InvalidArgument(err_msg.to_owned()) + } + } + "IO error" => EngineError::IoError(IoError::new(Other, err_msg)), + _ => EngineError::UnderlyingError(err_msg.to_owned()), + } + } else { + EngineError::UnderlyingError(err) + } + } +} + +impl StorageEngine for RocksEngine { + /// omit some code +} +\`\`\` + +#### StorageApi Layer + +##### Business Module + +Definition of StorageApi in the business module: + +\`\`\`rust +/// The Stable Storage Api +pub trait StorageApi: Send + Sync + 'static + std::fmt::Debug { + /// Get values by keys from storage + fn get_values(&self, table: &'static str, keys: &[K]) -> Result>>, ExecuteError> + where + K: AsRef<[u8]> + std::fmt::Debug; + + /// Get values by keys from storage + fn get_value(&self, table: &'static str, key: K) -> Result>, ExecuteError> + where + K: AsRef<[u8]> + std::fmt::Debug; + + /// Get all values of the given table from the storage + fn get_all(&self, table: &'static str) -> Result, Vec)>, ExecuteError>; + + /// Reset the storage + fn reset(&self) -> Result<(), ExecuteError>; + + /// Flush the operations to storage + fn flush_ops(&self, ops: Vec) -> Result<(), ExecuteError>; +} +\`\`\` + +In the business module, \`DB\` (xline/src/storage/db.rs) is responsible for converting StorageEngine into \`StorageApi\` for upper-level calls. Its definition is as follows: + +\`\`\`rust +/// Database to store revision to kv mapping +#[derive(Debug)] +pub struct DB { + /// internal storage of \`DB\` + engine: Arc, +} + +impl StorageApi for DB +where + S: StorageEngine +{ + /// omit some code +} +\`\`\` + +In the business module, different servers have their own Store backends, and the core data structure is the \`DB\` in the \`StorageApi\` Layer. + +##### Consensus Module + +The \`StorageApi\` definition of the Curp module is located in curp/src/server/storage/mod.rs. + +\`\`\`rust +/// Curp storage api +#[async_trait] +pub(super) trait StorageApi: Send + Sync { + /// Command + type Command: Command; + + /// Put \`voted_for\` in storage, must be flushed on disk before returning + async fn flush_voted_for(&self, term: u64, voted_for: ServerId) -> Result<(), StorageError>; + + /// Put log entries in the storage + async fn put_log_entry(&self, entry: LogEntry) -> Result<(), StorageError>; + + /// Recover from persisted storage + /// Return \`voted_for\` and all log entries + async fn recover( + &self, + ) -> Result<(Option<(u64, ServerId)>, Vec>), StorageError>; +} +\`\`\` + +\`RocksDBStorage\` (curp/src/server/storage/rocksdb.rs) is the CurpStore mentioned in the previous architectural diagram. It is responsible for converting \`StorageApi\` into underlying \`RocksEngine\` operations. + +\`\`\`rust +/// \`RocksDB\` storage implementation +pub(in crate::server) struct RocksDBStorage { + /// DB handle + db: RocksEngine, + /// Phantom + phantom: PhantomData, +} + +#[async_trait] +impl StorageApi for RocksDBStorage { + /// Command + type Command = C; + /// omit some code +} +\`\`\` + +#### Implementation Details + +##### Data Views + +With the introduction of the Persistent Storage Layer, Xline uses logical tables to separate different namespaces. Currently, these tables correspond to Column Families in the underlying RocksDB. +The following tables are currently available: + +1. curp: Stores persistent information related to curp, including log entries, voted_for, and corresponding term information. +2. lease: Stores granted lease information. +3. kv: Stores key-value information. +4. auth: Stores the enablement status of auth in Xline and the corresponding enable revision. +5. user: Stores user information added in Xline. +6. role: Stores role information added in Xline. +7. meta: Stores the current applied log index. + +##### Scalability + +Xline separates storage-related operations into two different traits, StorageEngine and StorageApi, and distributes them across two different layers to isolate changes. The StorageEngine trait provides a mechanism, while the StorageApi is defined by upper-level modules, allowing different modules to have their own definitions and implement specific storage strategies. The CurpStore and DB in the StorageApi layer are responsible for implementing the conversion between these two traits. Since the upper-level callers do not directly depend on the underlying Storage Engine, changing the storage engine later would not require extensive modifications to the code of the upper-level modules. + +##### Recovery Process + +For the recovery process, two important aspects need to be considered: what data to recover and when to perform the recovery. Let's first examine the data involved in recovery between different modules. + +###### Consensus Module + +In the consensus module, since RocksDBStorage is exclusive to Curp Server, the recovery process can be directly added to the respective StorageApi trait. The specific implementation is as follows: + +\`\`\`rust +#[async_trait] +impl StorageApi for RocksDBStorage { + /// Command + type Command = C; + /// omit some code + async fn recover( + &self, + ) -> Result<(Option<(u64, ServerId)>, Vec>), StorageError> { + let voted_for = self + .db + .get(CF, VOTE_FOR)? + .map(|bytes| bincode::deserialize::<(u64, ServerId)>(&bytes)) + .transpose()?; + + let mut entries = vec![]; + let mut prev_index = 0; + for (k, v) in self.db.get_all(CF)? { + // we can identify whether a kv is a state or entry by the key length + if k.len() == VOTE_FOR.len() { + continue; + } + let entry: LogEntry = bincode::deserialize(&v)?; + #[allow(clippy::integer_arithmetic)] // won't overflow + if entry.index != prev_index + 1 { + // break when logs are no longer consistent + break; + } + prev_index = entry.index; + entries.push(entry); + } + + Ok((voted_for, entries)) + } +} +\`\`\` + +For the consensus module, during the recovery process, the voted_for value and the corresponding term are first loaded from the underlying database. This is a security guarantee for the consensus algorithm to prevent voting twice within the same term. Subsequently, the corresponding log entries are loaded. + +###### Business Module + +For the business module, different servers have different stores and rely on the mechanisms provided by the underlying DB. Therefore, the recovery process is not defined in the StorageApi trait but exists as separate methods in LeaseStore (xline/src/storage/lease_store/mod.rs), AuthStore (xline/src/storage/auth_store/store.rs), and KvStore (xline/src/storage/kv_store.rs). + +\`\`\`rust +/// Lease store +#[derive(Debug)] +pub(crate) struct LeaseStore +where + DB: StorageApi, +{ + /// Lease store Backend + inner: Arc>, +} + +impl LeaseStoreBackend +where + DB: StorageApi, +{ + /// omit some code + /// Recover data form persistent storage + fn recover_from_current_db(&self) -> Result<(), ExecuteError> { + let leases = self.get_all()?; + for lease in leases { + let _ignore = self + .lease_collection + .write() + .grant(lease.id, lease.ttl, false); + } + Ok(()) + } +} + +impl AuthStore +where + S: StorageApi, +{ + /// Recover data from persistent storage + pub(crate) fn recover(&self) -> Result<(), ExecuteError> { + let enabled = self.backend.get_enable()?; + if enabled { + self.enabled.store(true, AtomicOrdering::Relaxed); + } + let revision = self.backend.get_revision()?; + self.revision.set(revision); + self.create_permission_cache()?; + Ok(()) + } +} +\`\`\` + +Among them, the recovery logic for \`LeaseStore\` and \`AuthStore\` is relatively simple, and we won't delve into it too much. Let's focus on the recovery process of \`KvStore\`. The flowchart for its recovery process is as follows: + +![image](/xline-home/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image4.png) + +###### Recovery Timing + +The recovery timing in Xline primarily occurs during the initial system startup. The recovery of the business module is prioritized, followed by the recovery of the consensus module. Since the recovery of KvStore depends on the recovery of LeaseStore, the recovery of LeaseStore needs to take place before the recovery of KvStore. The corresponding code in xline/src/server/xline_server.rs is as follows: + +\`\`\`rust +impl XlineServer +where + S: StorageApi, +{ + /// Start \`XlineServer\` + #[inline] + pub async fn start(&self, addr: SocketAddr) -> Result<()> { + // lease storage must recover before kv storage + self.lease_storage.recover()?; + self.kv_storage.recover().await?; + self.auth_storage.recover()?; + let (kv_server, lock_server, lease_server, auth_server, watch_server, curp_server) = + self.init_servers().await; + Ok(Server::builder() + .add_service(RpcLockServer::new(lock_server)) + .add_service(RpcKvServer::new(kv_server)) + .add_service(RpcLeaseServer::from_arc(lease_server)) + .add_service(RpcAuthServer::new(auth_server)) + .add_service(RpcWatchServer::new(watch_server)) + .add_service(ProtocolServer::new(curp_server)) + .serve(addr) + .await?) + } +\`\`\` + +The recovery process of the consensus module (curp/src/server/curp_node.rs) is as follows, with the function call chain: XlineServer::start -> XlineServer::init_servers -> CurpServer::new -> CurpNode::new + +\`\`\`rust +// utils +impl CurpNode { + /// Create a new server instance + #[inline] + pub(super) async fn new + 'static>( + id: ServerId, + is_leader: bool, + others: HashMap, + cmd_executor: CE, + curp_cfg: Arc, + tx_filter: Option>, + ) -> Result { + // omit some code + // create curp state machine + let (voted_for, entries) = storage.recover().await?; + let curp = if voted_for.is_none() && entries.is_empty() { + Arc::new(RawCurp::new( + id, + others.keys().cloned().collect(), + is_leader, + Arc::clone(&cmd_board), + Arc::clone(&spec_pool), + uncommitted_pool, + curp_cfg, + Box::new(exe_tx), + sync_tx, + calibrate_tx, + log_tx, + )) + } else { + info!( + "{} recovered voted_for({voted_for:?}), entries from {:?} to {:?}", + id, + entries.first(), + entries.last() + ); + Arc::new(RawCurp::recover_from( + id, + others.keys().cloned().collect(), + is_leader, + Arc::clone(&cmd_board), + Arc::clone(&spec_pool), + uncommitted_pool, + curp_cfg, + Box::new(exe_tx), + sync_tx, + calibrate_tx, + log_tx, + voted_for, + entries, + last_applied.numeric_cast(), + )) + }; + // omit some code + Ok(Self { + curp, + spec_pool, + cmd_board, + shutdown_trigger, + storage, + }) + } +\`\`\` + +Performance Evaluation +In v0.3.0, except for introducing the persistent storage layer, we also conducted significant refactoring on certain parts of CURP. After completing the refactoring and adding new features, we recently passed the validation test and integration test. The performance testing information has already been released in Xline v 0.4.0. +Xline GitHub :https://github.com/datenlord/Xline +`,H5=`--- + cover: /xline-home/blog/Introduction-to-CURP-Protocol/cover.png + author: + name: Jiawei Zhao + url: https://github.com/Phoenix500526 + img_url: https://avatars.githubusercontent.com/u/9337239?v=4 + read_time: 20 +--- + +Xline is an open source distributed KV storage engine, its core purpose is to achieve high-performance strong consistency across data centers, providing cross-data center metadata management. So how does Xline achieve this high-performance strong consistency across data centers? This article will lead you to find out. + +--- + +## 1. What is Xline + +Xline is an open source distributed KV storage engine, its core purpose is to achieve high-performance strong consistency across data centers, providing cross-data center metadata management. So how does Xline achieve this high-performance strong consistency across data centers? This article will lead you to find out. + +## 2. The Overall Architecture of Xline + +Let's take a look at the overall architecture of Xline, as shown below: + +![Graph1](/xline-home/blog/Introduction-to-CURP-Protocol/graph1.jpg) + +From top to bottom, Xline can be roughly divided into three layers, namely + +- Access layer: Implemented using the gRPC framework, responsible for receiving requests from clients. +- Middle Layer: it can be divided into CURP Consensus Module (left) and Business Server Module (right), where: + - CURP Consensus Module: Implements the CURP consensus algorithm, the code corresponds to the curp crate in Xline, while the corresponding RPC service is defined in curp/proto. + - Business Server Module: It is responsible for realizing the upper layer business logic of Xline, such as KvServer for KV-related requests and AuthServer for authentication requests, etc. The code corresponds to the xline crate, while the corresponding RPC service is defined in the xlineapi crate. +- Storage layer: responsible for the persistence of data and metadata within Xline, providing abstract interfaces to the upper layer, the code corresponds to the engine crate. + +## 3. Introduction to the CURP protocol + +### What is CURP? + +The consensus protocol used in Xline is not Paxos or Raft, but a new consensus protocol called CURP, which is called "Consistent Unordered Replication Protocol (CURP)". It was initiated in NSDI 2019's paper "Exploiting Commutativity For Practical Fast Replication," which was authored by Seo Jin Park, a PhD student from Stanford, and Prof. John Ousterhout, who is also the authors of Raft algorithm. + +### Why the CURP Protocol? + +Why did Xline use a new protocol like CURP instead of Raft or Multi-Paxos as the underlying consensus protocol? To illustrate, let's look at the problems with Raft and Multi-Paxos. +The following figure shows a flow of Raft's consensus process: + +![Graph2](/xline-home/blog/Introduction-to-CURP-Protocol/graph2.jpg) + +In this timing diagram, we can see how the Raft protocol reaches consensus: + +1. The client makes a proposal request to the leader. +2. The leader receives the proposal request from the client, appends it to its state machine log, and broadcasts the AppendEntries request to other followers in the cluster. +3. After receiving the AppendEntries request from the leader, the follower performs a log consistency check to determine whether it can be added to its own state machine log. It responds with a success message if the check is successful or a failure message if the check fails. +4. The leader counts the number of successful responses received, and if it exceeds half of the number of cluster nodes, the consensus is considered reached and the proposal is successful, otherwise the proposal is considered to have failed and the result is returned to the client. + +The following figure shows the flow of Multi-Paxos protocol to reach a consensus: + +![Graph3](/xline-home/blog/Introduction-to-CURP-Protocol/graph3.jpg) + +In this timing diagram, we can understand the flow of Multi-Paxos protocol to reach consensus: + +1. The client makes a proposal request to the leader. +2. The leader finds the index of the first unapproved log entry in its state machine log, and then executes the Basic Paxos algorithm to propose the log at index with the proposal value requested by the client. +3. The follower receives the proposal value from the leader and decides whether to accept the proposal value and return a successful response, or to return a failing response. +4. The leader counts the number of successful responses received, and if it exceeds half of the number of nodes in the cluster, it considers that the consensus has been reached and the proposal is successful, otherwise, it considers that the proposal fails and returns the result to the client. + +Be it Multi-Paxos or Raft, reaching consensus inevitably requires 2 RTTs. Both of them are based on a core assumption: the criteria of being durably stored and ordered must be met after command approval or log commit. As a result, the state machine can directly perform the approved commands or apply committed logs. Due to the inherent asynchrony of the network, ensuring orderliness is challenging. Therefore, a leader is required to enforce the execution order of different commands and achieve persistence by obtaining replication from the majority through broadcasting. This process cannot be completed within a single RTT. + +That's why Xline didn't choose Raft or Multi-Paxos as the underlying consensus algorithm. Xline was primarily designed to manage metadata across data centers. As we all know, for a single data center, the latency of its intranet is often very low, only a few milliseconds or even less than 1ms, while for a cross-datacenter wide area network, the network latency can reach tens of milliseconds or even hundreds of milliseconds. Traditional consensus algorithms, such as Raft or Multi-Paxos, require 2 RTTs to reach a consensus, regardless of the state of the consensus, which often leads to serious performance bottlenecks in such high latency network environments. This makes us wonder whether two or more RTTs are necessary to reach consensus in any case. + +The CURP algorithm is an unordered replication algorithm that breaks down the consensus scenarios into the following two categories: +**Fast path**: In non-conflicting scenarios , relaxing the ordering requirements for consensus does not affect the final consensus under the premise of persistent storage. Since the fast path only requires storage persistency, only 1 RTT is needed to reach consensus. We call fast path the front-end of the protocol. +**Slow path**: In conflicting scenarios, both the requirement for ordered concurrent request and persistent storage need to be satisfied, thus requring 2 RTTs to achieve consensus. We refer to the slow path as the back-end of the protocol. + +Then reader may wonder, what exactly is the conflict here? Let's use a simple KV operation as an example. In the nodes of a distributed system, the operations we do on the state machine are just read and write, and in the case of concurrent operations on the state machine, there are four scenarios: read-after-read, read-after-write, write-after-read, and write-after-write. Obviously, for read-after-read, which is a read-only operation with no side-effects, there is no conflict under any circumstances, and the final result is always the same, whether it is read first or next. When operating on different keys, for example, PUT A=1, PUT B=2, then for the final state of the state machine, no matter whether to execute PUT A=1 first, PUT B=2 next, or vice versa, the final result of reading from the state machine is A=1, B=2. The same applies to the scenario of read-write mixing. Therefore, when there is no intersection between the keys of multiple operations performed concurrently on a state machine, we say that these operations are non-conflicting. Conversely, if the concurrent operations include at least one write operation, and the keys of those operations are intersected, the operations are in conflict. + +### fast path vs. slow path + +How does CURP implement fast path and slow path? Below is a sketch of the cluster topology in the CURP algorithm. + +Let's take a look at what's going on in this diagram: + +![Graph4](/xline-home/blog/Introduction-to-CURP-Protocol/graph4.jpg) + +1. Client: the client that makes the request to the cluster. +2. Master: Corresponds to the leader node in the cluster, which holds the state machine logs, where the green part represents the logs that have been persisted to disk, and the blue part represents the logs that are stored in memory. +3. Follower nodes: Corresponds to the yellow dotted box in the figure above, each follower contains the following two components. + a. Witness: it can be approximated as a memory-based HashMap, on one hand, it is responsible for logging the current requests in the cluster in the fast path process, on the other hand, CURP will also use Witness to determine whether there is a conflict in the current request. All the records saved in Witness are unordered. + b. Backup: Keeps state machine logs that are persisted to disk. + +Next, let's take the example PUT z=7 in the figure to see the execution flow of fast path: + +1. Client broadcasts a request for PUT z=7 to all nodes in the cluster. +2. When a node in the cluster receives the request, it executes different logic depending on its role. + a. The leader receives the request and immediately writes the data z = 7 locally (that is, the blue part in the state machine log) and returns OK immediately. + b. When the follower receives the request, it uses witness to determine whether the request is in conflict . Since z = 7 does not conflict with y = 5, which is the only one in the witness, the follower saves z = 7 to the witness and returns OK to the client. +3. Client collects and counts the number of successful responses received. For a cluster with 2f + 1 nodes, when the number of received successful responses reaches f+f/2+1, the operation is confirmed to be persisted to the cluster, which takes 1 RTT for the whole process. + +Next, based on the previous fast path example, let's take PUT z = 9 as an example to see the execution flow of slow path. Since z = 9 conflicts with z = 7, the fast path initiated by the client will fail and the slow path will be executed: + +1. Client broadcasts a PUT z=9 request to all nodes in the cluster. +2. The nodes in the cluster receive the request and perform different logic according to their roles. + a. The leader receives the request and writes z = 9 to the state machine log. Since z = 9 conflicts with z = 7, it returns a KeyConflict response to the client and asynchronously initiates an AppendEntries request to synchronize the state machine log to the other nodes in the cluster. + b. The follower receives the request and refuses to save the proposal since z = 9 conflicts with z = 7 in the witness. +3. Client collects and counts the number of successful responses received. Since the number of rejected responses received exceeds f/2, client needs to wait for the slow path to complete. +4. When the AppendEntries in step 2 are executed successfully, the follower appends all three state machine logs (y = 5, z = 7, z = 9) of the leader to the Backup, removes the relevant logs from the witness, and returns the successful responses to the leader. +5. The leader counts the number of successful responses received. If it exceeds half of the number of cluster nodes, the consensus is considered reached and the proposal succeeds. Otherwise, the proposal fails and the result is returned to the client. + +## 4. Summary + +Xline is a distributed KV storage that provides strong consistency across data centers. One of its core problems is how to provide high-performance strong consistency in a high latency WAN environment across data centers. Traditional distributed consensus algorithms, such as Raft and Multi-Paxos, guarantee state machine consistency by making all operations satisfy storage persistency and the ordering prerequisite. The CURP protocol, makes a finer-grained division of consensus scenarios, splitting the protocol into front-end (fast path) and back-end (slow path), where the front-end only guarantees that the proposal will be persisted to the cluster, while the back-end not only guarantees persistence, but also ensures that all nodes that have saved the proposal will execute the commands in the same order, guaranteeing the consistency of the state machine. + +This is the end of the introduction to the CURP protocol. For more details, please refer to our other articles and shares, as follows: +Rethinking the Curp Consensus Protocol +DatenLord | Xline Geo-distributed KV Storage + +Xline is a geo-distributed KV storage for metadata management. Xline project is written in Rust, and you are welcomed to participate in our open-source project! +GitHub link: +https://github.com/xline-kv/Xline +Xline official website: www.xline.cloud +Xline Discord: +https://discord.gg/XyFXGpSfvb +`,W5=`--- + cover: /xline-home/blog/Mechanism-and-Implementation-of-Lease/cover.png + author: + name: Yu Guan + url: https://github.com/themanforfree + img_url: https://avatars.githubusercontent.com/u/56149350?v=4 + read_time: 20 +--- + +Xline is an open source distributed KV storage engine for managing small amounts of critical data, with the aim of high performance data access and strong consistency across data centers. Xline provides a series of etcd-compatible access interfaces, including KV, Watch, Lease, and more. In this article, we will focus on the Lease interface. + +--- + +## 1. Introduction + +Xline is an open source distributed KV storage engine for managing small amounts of critical data, with the aim of high performance data access and strong consistency across data centers. Xline provides a series of etcd-compatible access interfaces, including KV, Watch, Lease, and more. In this article, we will focus on the Lease interface. + +Lease is a lease mechanism between client and server. Similar to the car rental service in our real life, when we need to use a car, we can apply for a lease from the car rental company, the car rental company will assign a car to us, and guarantee that the car will not be assigned to other people during the validity period agreed between us and the car rental company. If we want to use it for a longer period of time, we can renew the lease to the car rental company. If we no longer want to use the car, we can either return and cancel it, or wait for the lease to expire and return it automatically. + +The use of Lease in Xline is very similar to the real life car rental service. The client can apply for a lease from the server, the server will then ensure that the lease will not be revoked during the validity period. The client can also end the lease early or extend the TTL of lease through the corresponding interface. Unlike real-life car rental, we can bind some key-values to the lease, while they will be deleted with the expiration of the lease. + +According to the ability of Lease introduced above, we can use Lease to realize our purpose in many scenarios, the following are some common Lease application scenarios: +Distributed locks: Distributed locks are realized through several mechanisms, while Lease play a role in avoiding deadlocks in distributed locks. When a client requests for a distributed lock, it creates a lease and renews the lease continuously, while also writes key-value and attaches it to the lease. This key-value represents the occupancy state of the distributed lock, and if the client occupying the lock is unable to release the lock actively due to a failure, the Lease mechanism ensures that the corresponding key-value will be deleted automatically to release the current lock after the expiration of the lease. +Service Registry: A lease is created when registering a new service, and written the key-value of service-related information with lease. During the survival of the service, the service will renew its lease continuously. If the lease cannot be renewed automatically after the service fails, the corresponding key-value will be deleted automatically, and the corresponding service will be deregistered in the registry center. +Authorization Management in Distributed Systems: Clients apply for a lease to gain permissions for resources, if the client loses connection with the server, or if the lease expires due to failure to renew the lease in time, the client loses the corresponding permissions. + +## 2. Architecture + +![Image](/xline-home/blog/Mechanism-and-Implementation-of-Lease/image1.PNG) + +The above figure is a simple architecture diagram of Lease implementation. There are two ways for an external client to send a request to the Xline cluster. One is to directly broadcast the request to all nodes in the cluster through the Curp protocol. After the Curp module reaches a consensus, it applies the request to the state machine, which is to write the request to the storage layer. + +Another way is for the client to directly send the request to the LeaseServer of one of the nodes in the cluster, which is also the service request method that is compatible with etcd. After the request reaches the LeaseServer, there will be two different processing paths, most of the requests will be broadcasted to all the nodes in the cluster through the Curp client bound to the server, and the remaining small number of requests may only be handled by some of the nodes, which will be forwarded to the LeaseServer of the specific nodes and applied to the state machine. + +## 3. Source Code Analysis + +### Source Code Organization + +The Lease-related source code is mainly stored in the following files, which are roughly organized into three sections: + +1. RPC Definitions: + +- xlineapi/proto/rpc.proto: rpc interface definitions for each Server within Xline, including the LeaseServer interface definition. +- xlineapi/proto/lease.proto: rpc message definition for Lease. + +2. LeaseServer implementation: + +- xline/src/server/lease_server.rs: Responsible for providing the implementation of the Lease RPC service, the main purpose is to provide etcd compliant interface.If the client send the propose directly through the external curp, this interface can be omitted, while some of the requests that do not go through the consensus protocol must be processed through the LeaseServer. + +3. LeaseStore implementation: + +- xline/src/storage/lease_store/lease.rs: Defines the Lease data structure, which is used to store Lease-related information, such as all the keys bound on the Lease, the expiration time of the Lease, the remaining TTL of the Lease, etc. It also implements some practical methods for it. +- xline/src/storage/lease_store/lease_queue.rs: Defines LeaseQueue and related methods. LeaseQueue is a priority queue consisting of lease IDs and lease expiration times, while a background-resident task will capture all the expired lease IDs through this structure at regular intervals. +- xline/src/storage/lease_store/lease_collection.rs: Defines the LeaseCollection and related methods. The LeaseCollection is a collection of the core data structures of a lease, providing the core capabilities of the lease mechanism. The structure contains three parts: lease_map saves all the lease structures; item_map caches the key to lease ID mapping; and expired_queue manages the lease expiration time. expired_queue is only used on the leader node, and is empty on other nodes. +- xline/src/storage/lease_store/mod.rs: Definition and method implementation of LeaseStore. It is responsible for providing the storage layer abstraction for lease and the storage layer interface for all lease related operations externally. Its inner part contains LeaseCollection and some data structures which are shared with KvStore. + +### Lease Creation + +If you want to use a lease, you must create a lease first, and when doing so, you need to use the LeaseGrant interface provided by LeaseServer. The LeaseGrant RPC is quite straightforward, which is to assign a lease ID, and submit the request to the consensus protocol through propose interface?. Once consensus is reached, the request is executed in the LeaseStore. + +LeaseStore will create and insert a new lease in LeaseCollection. The core code logic is as follows: + +\`\`\`rust +... +if is_leader { + let expiry = lease.refresh(Duration::ZERO); + let _ignore = inner.expired_queue.insert(lease_id, expiry); +} else { + lease.forever(); +} +let _ignore = inner.lease_map.insert(lease_id, lease.clone()); +... +\`\`\` + +Note that if the current node is the leader node, it also needs to manage the lease's expiration time. Therefore, it must calculate the expiration time of the lease through the refresh method and insert it into the expired_queue. The other nodes do not need this step, they just need to insert the new lease into the lease_map. + +After the lease is created, the server returns a response to the client containing the lease ID. + +### Using Lease + +![Image](/xline-home/blog/Mechanism-and-Implementation-of-Lease/image2.png) + +After getting the lease ID, the client can use the lease through the lease ID. When putting a pair of key values, lease ID can be attached. When this Put request is applied to the state machine, in addition to writing the key-value directly to the index and DB of the KvStore, it will detach the current key from the old lease by the detach method provided by the LeaseCollection, and attach the key that needs to be put to the new lease ID by attach. + +\`\`\`bash +pub(crate) fn attach(&self, lease_id: i64, key: Vec) -> Result<(), ExecuteError> { + let mut inner = self.inner.write(); + let Some(lease) = inner.lease_map.get_mut(&lease_id) else { + return Err(ExecuteError::lease_not_found(lease_id)); + }; + lease.insert_key(key.clone()); + let _ignore = inner.item_map.insert(key, lease_id); + Ok(()) +} +\`\`\` + +The implementation of attach is to find the corresponding lease by the lease ID, attach the key to the lease, and add the mapping of the key to the lease ID to the item_map. Detach is the opposite of attach, it removes the content inserted when attaching. + +After the above process, we have successfully associated the key with the lease ID. If the lease is actively revoked or times out, the lease and all the keys associated with it will be deleted. + +## Active Lease Deletion + +To delete a lease, you need to use the LeaseRevoke interface, which is basically the same as LeaseGrant in LeaseServer. Both of them pass the request to the consensus protocol for processing, while the only difference is that LeaseRevoke doesn't need to assign a lease ID. + +\`\`\`rust +let del_keys = match self.lease_collection.look_up(req.id) { + Some(l) => l.keys(), + None => return Err(ExecuteError::lease_not_found(req.id)), +}; +if del_keys.is_empty() { + let _ignore = self.lease_collection.revoke(req.id); + return Ok(Vec::new()); +} + +// delete keys ... + +let _ignore = self.lease_collection.revoke(req.id); +\`\`\` + +When LeaseRevoke is executed, it first tries to find out if the lease has any associated keys, if not, it can directly remove the lease through the revoke method on the LeaseCollection. If there are associated keys, it needs to remove all associated keys from the KV Store and clean up the relationship between these keys and the lease ID in the LeaseCollection before you can revoke the lease from the LeaseCollection. + +### Lease expiration + +![Image](/xline-home/blog/Mechanism-and-Implementation-of-Lease/image3.png) + +The Lease expiration process is shown in the above figure, which omits the consensus part. When initializing LeaseServer, a background resident revoke_expired_leases_task is created, the main code of this task is as follows: + +\`\`\`bash +loop { + // only leader will check expired lease + if lease_server.lease_storage.is_primary() { + for id in lease_server.lease_storage.find_expired_leases() { + let _handle = tokio::spawn({ + let s = Arc::clone(&lease_server); + async move { + let request = tonic::Request::new(LeaseRevokeRequest { id }); + if let Err(e) = s.lease_revoke(request).await { + warn!("Failed to revoke expired leases: {}", e); + } + } + }); + } + } + time::sleep(DEFAULT_LEASE_REQUEST_TIME).await; +} +\`\`\` + +On the node responsible for managing Lease expiration time, this task will periodically captures all the expired lease IDs through find_expired_leases, and calls the lease_revoke interface on the lease server to delete the expired Leases, utilizing the same interface as clients use to actively delete Leases. +find_expired_leases is a core method in LeaseCollection, and its implementation is as follows: + +\`\`\`rust +pub(crate) fn find_expired_leases(&self) -> Vec { + let mut expired_leases = vec![]; + let mut inner = self.inner.write(); + while let Some(expiry) = inner.expired_queue.peek() { + if *expiry <= Instant::now() { + #[allow(clippy::unwrap_used)] // queue.peek() returns Some + let id = inner.expired_queue.pop().unwrap(); + if inner.lease_map.contains_key(&id) { + expired_leases.push(id); + } + } else { + break; + } + } + expired_leases +} +\`\`\` + +When a lease is created, the expiration time of the lease is already calculated and inserted into the expired_queue. When calling find_expired_queue, the process continuously attempts to extract the expired leases from the head of the priority queue until it encounters the first one that has not yet expired. It then returns all the lease ID obtained in this process. + +### Lease Renewal + +If you want the created lease to last longer, you need to maintain a stream between the client and the server, where the client sends LeaseKeepAlive requests to the server at regular intervals. Unlike the previous requests, LeaseKeepAlive requests do not need to go through the consensus protocol because they rely on the expiration time of a lease that exists only on the leader node, so only the leader node can process LeaseKeepAlive requests, while the follower node forwards the request to the leader node for processing. The forwarding logic can be found in the source code of lease_server.rs. +After the stream is established between the leader and the client, whenever the leader receives a lease ID from the stream, it will renew the lease. The final renewal logic is realized by the renewal method provided by LeaseCollection. This method is defined as follows: + +\`\`\`bash +pub(crate) fn renew(&self, lease_id: i64) -> Result { + let mut inner = self.inner.write(); + let (expiry, ttl) = { + let Some(lease) = inner.lease_map.get_mut(&lease_id) else { + return Err(ExecuteError::lease_not_found(lease_id)); + }; + if lease.expired() { + return Err(ExecuteError::lease_expired(lease_id)); + } + let expiry = lease.refresh(Duration::default()); + let ttl = lease.ttl().as_secs().cast(); + (expiry, ttl) + }; + let _ignore = inner.expired_queue.update(lease_id, expiry); + Ok(ttl) +} +\`\`\` + +Renew will first check whether the corresponding lease has expired or not. If not, it will recalculate the expiration time, and then update its order in the expired_queue. +As long as the connection between the client and the server is not interrupted, the client will continue to send LeaseKeepAlive requests to the server via stream, preventing the lease from timing out. The primary application scenarios for leases, as mentioned in the previous section, almost always use this feature to determine whether the client is running normally. + +### Lease information reading + +Lease has two reading interfaces. One is LeaseTimeToLive, which will read the detailed information of a lease, including its expiration time. Same as LeaseKeepAlive, because the expiration time only exists in the leader node, so the request needs to be forwarded to only the leader for processing. +Another reading interface is LeaseLeases, which lists all the lease IDs in the system. This interface doesn't need information about the lease expiration time, so it can be handed over to the consensus protocol directly, which makes the processing in LeaseServer similar to that of LeaseGrant and LeaseRevoke. We wouldn’t go into further details here. +The ability of LeaseTimeToLive and LeaseLeases to read information is finally realized by LeaseCollection, the source code is as follows: + +\`\`\`rust +pub(crate) fn look_up(&self, lease_id: i64) -> Option { + self.inner.read().lease_map.get(&lease_id).cloned() +} + +pub(crate) fn leases(&self) -> Vec { + let mut leases = self + .inner + .read() + .lease_map + .values() + .cloned() + .collect::>(); + leases.sort_by_key(Lease::remaining); + leases +} +\`\`\` + +## 4. Summary + +In this article, we have introduced Lease, an important interface of Xline, which allows users to realize the on-time expiration of a set of keys and renew the lease through KeepAlive interface. This feature also allows the server to monitor the client's status. Relying on these features of the Lease mechanism, many typical application scenarios have been born, such as distributed locks, service registries, authorization management and so on, as described in this article. +The article also explains how users can utilize the Lease interface, and outlines the realization of key functionalities within this process. If you want to learn more about the detailed code, you can also refer to our open source repository: https://github.com/xline-kv/Xline . + +Xline is a geo-distributed KV storage for metadata management. the Xline project is written in Rust, and you are welcome to participate in our open source project! + +GitHub link: +https://github.com/xline-kv/Xline +Xline official website: www.xline.cloud +Xline Discord: +https://discord.gg/XyFXGpSfvb +`,V5=`--- + cover: /xline-home/blog/Implementation-of-CURP-Server/cover.jpg + author: + name: Jiawei Zhao + url: https://github.com/Phoenix500526 + img_url: https://avatars.githubusercontent.com/u/9337239?v=4 + read_time: 14 +--- + +In the previous article, An Introduction to the CURP Protocol, we gave a preliminary introduction to the CURP Protocol. Now, let’s continue from where we left off and delve into the internal workings of the CURP Server. + +--- + +In the previous article, An Introduction to the CURP Protocol, we gave a preliminary introduction to the CURP Protocol. Now, let’s continue from where we left off and delve into the internal workings of the CURP Server. + +## Organization of the Curp Crate’s Source Code + +Now, let’s focus on the curp consensus module. The curp module is a separate crate in Xline, with all of its source code stored in the curp directory, which is organized as follows: + +> curp/proto: Holds the definition of the rpc interfaces and messages related to the curp protocol. +> curp/tla+: Holds content related to the tla+ specification of the curp protocol +> curp/tests: integration tests +> curp/src: the main implementation code of the CURP protocol, which can be divided into: +> client.rs: CURP client-side implementation. +> cmd.rs: defines key traits for interacting with external mods +> log_entry.rs: state machine log entries. +> rpc/: CURP server implementation of rpc methods. +> server/: CURP server-side implementation, including the following + +Key data structure definitions: cmd_board.rs, spec_pool.rs + +Key background tasks: cmd_worker/, gc.rs + +CURP server front and backend implementations: curp_node.rs, raw_curp/ + +storage/: implements the interface definition of the persistence layer, used to interact with the storage layer + +## Curp Server Architecture and Task Division + +After understanding the rpc services provided by Curp Server and the corresponding traits, let’s take a look at the architecture and startup process of Curp Server. + +![image1](/xline-home/blog/Implementation-of-CURP-Server/image1.png) + +Architecturally, the entire Curp Server can be divided into the front-end CurpNode and the back-end RawCurp. Such a design primarily aims to separate synchronous and asynchronous code. Regarding Rust’s asynchronous code: + +1. For tasks spawned by tokio, since the compiler inherently doesn’t know how long the task will run, it enforces that all tasks must have a ‘static lifetime. This often requires us to clone certain reference data structures. +2. Non-Send variables, like MutexGuard, are prohibited from crossing .await statements. When synchronous and asynchronous code are mixed, it necessitates manually releasing this MutexGuard before the await, either within a block or through an explicit drop. This leads to nested code structures, making it more challenging to read.By separating CurpNode (handling synchronous requests) and RawCurp (handling asynchronous requests), the code boundaries are more transparent, enhancing code readability. + +For insights on organizing asynchronous code gracefully in Rust projects, you can refer to another article: How to Gracefully Organize Asynchronous Code in Rust Projects. + +Within the CurpNode structure, there are spec_pool and cmd_board structures. The spec_pool corresponds to the witness structure in the CURP paper, responsible for storing commands executed in the fast path. In contrast, cmd_board stores the results of command executions. CurpNode can register a listener to cmd_board. Once the RawCurp backend asynchronously completes command execution, the result is inserted into cmd_board, and CurpNode is notified via the listener to return the command execution outcome to the user. When RawCurp receives a request from CurpNode, it inserts the command into the conflict detection queue — the conflict_checked_channel. + +As the name implies, a conflict_checked_channel is essentially an mpmc channel that accepts cmd’s from a CurpNode concurrently and dynamically maintains conflict relationships between different cmd’s to ensure that the commands a command worker receives from the channel will always conflict with the currently executing command. + +As the name suggests, the conflict_checked_channel is essentially an mpmc channel, capable of concurrently accepting cmds from CurpNode. It dynamically maintains the conflict relationships between different cmds, ensuring that commands retrieved by the command worker from the channel always not conflict with the currently executed commands. The command worker is the command execution entity. While the conflict_checked_channel focuses on relationships between various commands, the command worker is concerned with how to execute the commands. After the command worker completes the command and obtains the result, it inserts the result into cmd_board, triggering the listener and notifying CurpNode that the command execution is finished. + +## How Curp Server Interacts with Business Server + +From the architecture diagram mentioned earlier, we can see that the Curp consensus module provides a Curp Server, which offers rpc services externally. In Xline, the Business Servers make requests to Curp Server via rpc calls. Once the Curp Server processes the request, it notifies the Business Server through the corresponding trait. + +## Service Definitions + +Let’s first take a look at the services defined by Curp Server: + +\`\`\` +service Protocol { + rpc Propose (ProposeRequest) returns (ProposeResponse); + rpc WaitSynced (WaitSyncedRequest) returns (WaitSyncedResponse); + rpc AppendEntries (AppendEntriesRequest) returns (AppendEntriesResponse); + rpc Vote (VoteRequest) returns (VoteResponse); + rpc FetchLeader (FetchLeaderRequest) returns (FetchLeaderResponse); + rpc InstallSnapshot (stream InstallSnapshotRequest) returns (InstallSnapshotResponse); +} +\`\`\` + +The purposes of these services are: + +- Propose: To initiate a proposal request to the Curp cluster. +- WaitSynced: To wait for the Curp cluster to complete requests in the after-sync phase. +- AppendEntries: To initiate a request to the Curp cluster to append state machine logs. +- Vote: When a Curp Server initiates an election, it transitions its role to Candidate and uses this interface to send voting requests to other Curp Servers. If it receives a majority of positive responses, it becomes the leader; otherwise, it reverts to follower. +- FetchLeader: To retrieve the current leader node of the Curp cluster. +- InstallSnapshot: If a Curp Server’s state machine log lags significantly behind the leader, it can request a snapshot from the leader through this interface to catch up with the leader’s state machine log. Except for Propose and FetchLeader, the other services are primarily for internal use by Curp Server. The Business Servers fetch the current leader information via FetchLeader and makes proposals to the Curp cluster through Propose. + +## Interface Definitions + +Next, let’s see which traits are defined by the Curp module. From a design perspective, the traits defined in Curp can be divided into two categories: + +1. Command-related: Once the Curp module reaches a consensus on a specific command, it notifies the Business Server to execute the corresponding command via related traits. +2. Role-related: When the role of a Curp node changes, it notifies the corresponding business component (e.g., Lessor, Compactor) via related traits. + +### Command-related Traits + +The command-related traits defined in the Curp module mainly include Command, ConflictCheck, and CommandExecutor. Let’s first examine the Command and ConflictCheck traits, which are defined as: + +\`\`\`rust +pub trait ConflictCheck { + fn is_conflict(&self, other: &Self) -> bool; +} + +#[async_trait] +pub trait Command{ + /// omit some code... + + #[inline] + fn prepare(&self, e: &E, index: LogIndex) -> Result + where + E: CommandExecutor + Send + Sync, + { + >::prepare(e, self, index) + } + + #[inline] + async fn execute(&self, e: &E, index: LogIndex) -> Result + where + E: CommandExecutor + Send + Sync, + { + >::execute(e, self, index).await + } + + #[inline] + async fn after_sync( + &self, + e: &E, + index: LogIndex, + prepare_res: Self::PR, + ) -> Result + where + E: CommandExecutor + Send + Sync, + { + >::after_sync(e, self, index, prepare_res).await + } +}The Command trait describes a command entity that can be executed by Business Server. ConflictCheck detects whether conflicts exist between multiple commands. The conflict criterion is whether there’s an intersection between keys of two different commands. +\`\`\` + +Command defines four associated types (K, PR, ER, and ASR). Here, K represents the Key corresponding to the command, while ER and ASR correspond to the results of the command in the execute and after_sync phases of the Curp protocol, respectively. What does PR represent? PR denotes the result of the command in the prepare phase. + +To explain the need for a prepare phase, let’s consider an example. Since Xline employs the MVCC mechanism for multi-version management of key-value pairs, each key is assigned a revision. If a client sends two consecutive commands to Xline: PUT A=1 and PUT B=1 (denoted as cmd1 and cmd2) with expected revisions of 3 and 4, respectively, Xline can execute these two non-conflicting commands concurrently and out of order. If cmd2 finishes before cmd1, the revision order may be reversed, leading to errors. + +To solve this, a prepare phase is introduced to Command. Curp ensures that the execution in the prepare phase is serialized and always precedes the execute phase. By moving the revision calculation from the after_sync phase to the prepare phase, Xline ensures that the revision order matches the order of user requests arriving at Xline while still allowing for concurrent out-of-order execution of non-conflicting commands. + +Next, let’s look at the CommandExecutor trait definition: + +\`\`\`rust +#[async_trait] +pub trait CommandExecutor{ + fn prepare(&self, cmd: &C, index: LogIndex) -> Result; + + async fn execute(&self, cmd: &C, index: LogIndex) -> Result; + + async fn after_sync( + &self, + cmd: &C, + index: LogIndex, + prepare_res: C::PR, + ) -> Result; + + /// omit some code ... +} + +\`\`\` + +CommandExecutor describes the command execution entity. The Curp module uses it to notify the Business Server to execute related commands. + +The relationship among these three traits is: ConflictCheck describes the relationship between two different commands; the Curp Server cares only about whether commands conflict, not how they are executed. CommandExecutor describes how commands are executed without concerning themselves with their interrelationships. Their dependency is CommandExecutor ←> Command → ConflictCheck. + +### Traits for Role Change + +The role-related trait defined in Curp is RoleChange: + +\`\`\`rust +/// Callback when the leadership changes +pub trait RoleChange { + /// The \`on_election_win\` will be invoked when the current server win the election. + /// It means that the current server's role will change from Candidate to Leader. + fn on_election_win(&self); + + /// The \`on_calibrate\` will be invoked when the current server has been calibrated. + /// It means that the current server's role will change from Leader to Follower. + fn on_calibrate(&self); +} +\`\`\` + +In Xline’s Curp module, the protocol backend uses the Raft protocol. The so-called backend means that when a conflict occurs, the Curp module automatically falls back to the Raft protocol. In this scenario, the latency to reach a consensus is the same as the Raft protocol, both being 2 RTT. As we know, the original Raft paper defined three roles for nodes in a Raft cluster: Leader, Follower, and Candidate, with their transition relationships as follows: + +![image2](/xline-home/blog/Implementation-of-CURP-Server/image2.png) + +Initially, a node is a Follower. If it doesn’t receive any messages from the current cluster Leader within the election_timeout, including heartbeats or AppendEntries requests, it initiates an election operation and transitions to Candidate. If it wins the election, it becomes the Leader; otherwise, it reverts to the Follower. If a network partition occurs, two Leaders might emerge. Once the network partition resolves, the Leader with a smaller term will calibrate itself upon receiving any message from the Leader with a larger term, updating its term and transitioning to the Follower. + +Why does Xline need to define a trait like RoleChange? In some Xline business scenarios, some components, like LeaseServer and LeaseStore, perform different operations on Leader node and non-Leader nodes. Thus, when a node’s role changes, the corresponding components need to be notified. Currently, because Lease-related components only differentiate between Leader and non-Leader nodes, the defined callback only covers the election_win and calibrate events. If future business requires finer-grained role differentiation, more callback methods will be added to cover those requirements. + +## How Curp Server Handles Requests + +Let’s assume there are two PutRequests: PUT A=1 and PUT A=2. Let’s see how the curp server handles these conflicting requests. As mentioned earlier, users need to initiate a proposal to Curp Server through the propose method of the Curp Client. Let’s first look at the pseudocode implementation of propose. + +\`\`\`rust +/// Propose the request to servers +#[inline] +pub async fn propose(&self, cmd: C) -> Result { + // create two futures + let fast_round = self.fast_round(cmd); + let slow_round = self.slow_round(cmd); + + // Wait for the fast and slow round at the same time + match which_one_complete_first(fast_round, slow_round).await { + fast_round returns fast_result => { + let (fast_er, success) = fast_result?; + if success { + Ok(fast_er.unwrap()) + } else { + let (_asr, er) = wait for slow_round to finish; + Ok(er) + } + } + slow_round returns slow_result => match slow_result { + Ok((_asr, er)) => Ok(er), + Err(e) => { + if let Ok((Some(er), true)) = wait for fast_round to finish { + return Ok(er); + } + Err(e) + } + }, + } +} +\`\`\` + +As the code suggests, when a Client calls propose, it simultaneously starts two different futures, namely fast_round and slow_round, corresponding to the fast path and slow path of the Curp protocol, respectively. The process waits for one of the futures to complete. Clearly, when the first request arrives, there will be no conflict with other requests. Thus, it can be assumed that this request will be processed during the fast round. Let’s first look at the implementation of fast_round. + +## Curp Consensus Process — Fast Round + +The fast_round code is defined in curp/src/client, corresponding to the frontend process of the Curp protocol. + +\`\`\`rust +/// The fast round of Curp protocol +/// It broadcasts the requests to all the curp servers. +async fn fast_round( + &self, + cmd_arc: Arc, +) -> Result<(Option<::ER>, bool), ProposeError> { + let request = create a new ProposeRequest; + let mut rpcs = broadcast request to each node and put responses into a stream; + + let mut ok_cnt: usize = 0; + let mut execute_result: Option = None; + let superquorum = superquorum(self.connects.len()); + + while let Some(resp_result) = rpcs.next().await { + let resp = match resp_result { + Ok(resp) => resp.into_inner(), + Err(e) => { + warn!("Propose error: {}", e); + continue; + } + }; + + update_state(resp.term, resp.leader_id); + + resp.map_or_else::( + |er| { + if let Some(er) = er { + execute_result = Some(er); + } + ok_cnt += 1; + Ok(()) + }, + |err| { + if let ProposeError::ExecutionError(_) = err { + return Err(err); + } + Ok(()) + }, + )??; + if (ok_cnt >= superquorum) && execute_result.is_some() { + return Ok((execute_result, true)); + } + } + Ok((execute_result, false)) +} +\`\`\` + +Overall, the logic of fast_round can be divided into three steps: + +1. Wrap Command into the corresponding ProposeRequest. +2. Broadcast the ProposeRequest to all nodes in the Curp cluster. +3. Summarize the results. If the current Command doesn’t conflict with the others, a successful execution result will be obtained. If the number of successful ProposeResponses received exceeds the super quorum (approximately 3/4 of the cluster node count), the command is deemed successfully executed; otherwise, it fails. + +Some readers might wonder why, in a distributed cluster with 2f + 1 nodes, consensus protocols like Raft or Paxos only need f + 1 nodes to return a successful response, but Curp requires more than f + f/2+1 nodes to return successful responses in the fast path. Here, f represents the fault tolerance of the cluster. To understand this discrepancy, let’s consider what would happen if the Curp protocol also used f+1as the criterion for success in the fast path. + +Assume Client_A broadcasts ProposeRequest (marked as A) to 2f + 1 nodes and receives f + 1 successful responses. There must be one leader node among them, with the remaining f nodes being followers. Suppose f nodes, including the leader, crashed and all had request A. Among the remaining f+1 nodes, only one follower retains request A in its in-memory spec_pool. Then, the client broadcasts another ProposeRequest (marked as B, conflicting with A). Since each node uses its in-memory spec_pool to determine whether incoming requests conflict with speculatively executed requests, even though Client_B won’t receive a successful result, request B will still be saved in the spec_pool of f nodes. If the leader node recovers and replays all requests saved in spec_pool across all nodes to restore the state machine (a process we call “recover”), the originally executed request A becomes the minority, while the unsuccessfully executed request B becomes the majority. This leads to an error during the leader’s recovery process. + +When the Curp protocol usesf+ f/2+ 1 as the criterion for success in the fast path, even if all f nodes containing request A crash, there are still more than half the nodes in the remaining f + 1 nodes that retain the request. This ensures that a later conflicting request will not outnumber the originally successfully executed request. + +Returning to our example, since Curp Server didn’t encounter conflicts when processing the request PUT A=1, it smoothly completes in the fast_round. For the Leader node, the request goes through CurpNode, to RawCurp, to the conflict detection queue Conflict_Checked_MPMC, and finally handed over to cmd_worker for execution. After the cmd_worker executes PUT A=1, it inserts the corresponding result into cmd_board, notifying CurpNode to return the command execution response to the Client. The following diagram depicts the sequence of events in the fast_round process. + +![image3](/xline-home/blog/Implementation-of-CURP-Server/image3.png) + +## Curp Consensus Process — Slow Round + +When the Client sends the request PUT A=2 to the Curp Server, as known from the previous propose method, the Client will simultaneously start both the fast_round and slow_round futures. Clearly, since the request PUT A=2 is in obvious conflict with the previous request PUT A=1, fast_round cannot be successfully executed, hence waiting for the completion of slow_round. The code for slow_round is defined in curp/src/client, corresponding to the backend process of the Curp protocol, i.e., the wait_synced process. + +\`\`\`rust +/// The slow round of Curp protocol +async fn slow_round( + &self, + cmd: Arc, +) -> Result<(::ASR, ::ER), ProposeError> { + loop { + let leader_id = self.get_leader_id().await; + + let resp = match call wait_synced from leader node { + Ok(resp) => resp.into_inner(), + Err(e) => { + wait for retry_timeout to retry propose again; + continue; + } + }; + + match resp? { + SyncResult::Success { er, asr } => { + return Ok((asr, er)); + } + SyncResult::Error(Redirect(new_leader, term)) => { + let new_leader = new_leader.and_then(|id| { + update_state(new_leader, term) + }) + }); + self.resend_propose(Arc::clone(&cmd), new_leader).await?; // resend the propose to the new leader + } + SyncResult::Error(Timeout) => { + return Err(ProposeError::SyncedError("wait sync timeout".to_owned())); + } + SyncResult::Error(e) => { + return Err(ProposeError::SyncedError(format!("{e:?}"))); + } + } + } +}Overall, the slow_round logic can also be divided into two steps: +\`\`\` + +1. Obtain the current leader of the cluster and send a WaitSyncedRequest to it. +2. Wait for the leader to return the execution result of WaitSyncedRequest. If failed, wait for retry_timeout and try again. + +In the Client’s propose method, because fast_round determines that the newly arrived request conflicts with the previously speculatively executed request, RawCurp will first save this Command in the state machine log and initiate an AppendEntries request to the cluster. After completion, it will return a ProposeError::KeyConflict error to the client, waiting for the end of slow_round. After the Leader completes the AppendEntries operation to the Followers in the cluster, the apply operation will be performed to apply the log to the state machine. It’s during this process that the leader will send the Command to the conflict detection queue, Conflict_Checked_MPMC. Only after the cmd_worker has executed all commands conflicting with PUT A=2 can the PUT A=2 command be popped from the conflict detection queue for execution. Unlike fast_round, in the slow_round process, after the command is executed and the execution result is saved in cmd_board, it will not return directly. Instead, the command will be put back into the conflict detection queue until the command completes the after_sync operation and saves the corresponding result to cmd_board. Only then will it return to CurpNode and finally return the corresponding ProposeResponse to the Client. The sequence diagram for the entire slow_round operation is as follows: + +![image4](/xline-home/blog/Implementation-of-CURP-Server/image4.png) + +## Summary + +In this article, we discussed how the Curp Server in Xline interacts with the business Servers. The business Server initiates requests to the Curp Server through the RPC interfaces predefined by Curp Server. Curp Server, on the other hand, notifies the business Server through two different types of traits. The command-related Traits, such as Command, ConflictCheck, and CommandExecutor, are mainly responsible for notifying the business Server after reaching consensus on commands. The RoleChange trait mainly notifies the business Server when the role of a cluster node changes. + +In Xline, the Curp Server is divided into two parts: the front-end CurpNode and the backend RawCurp. CurpNode mainly handles synchronous RPC call requests and forwards the requests to RawCurp for asynchronous execution. RawCurp submits commands to the conflict_checked_channel, with the command workers responsible for execution. After execution, the result is inserted into cmd_board, notifying CurpNode of the execution result. +`,Y5=`--- + cover: /xline-home/blog/CURP-State-Machine-Engine/cover.png + author: + name: Jiawei Zhao + url: https://github.com/Phoenix500526 + img_url: https://avatars.githubusercontent.com/u/9337239?v=4 + read_time: 20 +--- + +In the previous article on code interpretation, we briefly explained how the CurpServer of Xline is implemented. Now, let's delve deeper into some core data structures in the CurpServer, particularly the conflict_checked_channel and command worker, as they collaborate to drive the state transitions of the internal state machine in the CurpServer. + +--- + +In the previous article on code interpretation, we briefly explained how the CurpServer of Xline is implemented. Now, let's delve deeper into some core data structures in the CurpServer, particularly the conflict_checked_channel and command worker, as they collaborate to drive the state transitions of the internal state machine in the CurpServer. + +## Why do we need a conflict detection queue? + +The conflict detection queue serves as a multi-producer multi-consumer channel, and its primary responsibility is to maintain dynamical conflict relationships. It ensures that, at any given time, all receivers will not receive conflicting commands. The order of commands received by the receiver (referred to as the "conflict order") follows these criteria: + +1. If cmd A conflicts with cmd B, and A is enqueued before B, A will be dequeued first. B can only be dequeued after A has executed. +2. If cmd A doesn't conflict with cmd B, and A is enqueued before B, they will be dequeued in FIFO order, with A dequeued first and B afterwards. + +Understanding this in text might seem abstract, but no worries. Let's look at a simple example: Assume we now have commands A, B, and C. They enter the conflict detection queue in the order A, B, and C. Where A conflicts with B, and C does not conflict with either A or B, the initial state of the conflict detection queue is as follows: + +![图片](/xline-home/blog/CURP-State-Machine-Engine/image1.PNG) + +After A, B, and C enter the queue, three different cmd_workers retrieve commands from the channel. Since cmd_worker_1 receives A first, B remains in the queue due to its conflict with A. C, having no conflicts, can be received by cmd_worker_2. B will only be dequeued after A has been executed and dropped, as illustrated in the following diagram: + +![图片](/xline-home/blog/CURP-State-Machine-Engine/image2.PNG) + +Some readers might question why we introduce another conflict detection queue when the spec_pool's duty is to determine conflicts in the fast path, corresponding to the "witness" in the CURP paper. There are two main reasons for this: + +1. Every command, whether it's on the fast path or the slow path, must ultimately be executed on the leader. Hence, the leader must find a reasonable execution order among these mixed commands to ensure the execution does not break CURP's assumptions about command execution order. Spec_pool only stores commands executable in the fast path and doesn't involve commands in the slow path. +2. During the consensus process, we first determine whether a command exists in the spec_pool. This is a synchronous operation. If we put the complicated conflict order calculations into the spec_pool, it would easily create a bottleneck. Hence, we split the responsibilities of determining conflicts and calculating conflict order, placing the former in the synchronous spec_pool and the latter in the asynchronous conflict detection queue. + +## How does the conflict detection queue work? + +To understand the working principle of the conflict detection queue, we need to address two questions: + +1. How should we model the conflict relationships? +2. Given dynamic conflict relationships, how do we quickly identify all non-conflicting commands? + +For the first question, we can view all commands as vertices in a Directed Acyclic Graph (DAG), with the conflict relationships represented as directed edges between vertices. Suppose there's a conflict between command A and command B (A arrives before B), we can represent this conflict with an arc , where the head of the arc always points to the later-arriving vertex (this ensures no cycles in the graph). + +Once we define the conflict relationship as an edge in a disconnected DAG, the problem of determining the conflict order when executing a command becomes a matter of finding the topological order of the connected component in the DAG that the command belongs to. For each command, successors store which cmds conflict with the current cmd. The length of successors represents the out-degree of the vertex. Predecessor_cnt represents the in-degree, indicating how many preceding cmds conflict with the current cmd. + +Returning to the earlier example of commands A, B, and C, when using a DAG to describe their conflict relationships, the situation is shown in the following diagram: + +![图片](/xline-home/blog/CURP-State-Machine-Engine/image3.PNG) + +When cmd_workers retrieve commands from the channel, the channel only needs to traverse each connected component of this DAG and find the first vertex with an in-degree of 0. Only after the command has been executed will the channel update B's predecessor_cnt to resolve the conflict between A and B. + +## Architecture of the state machine engine + +As mentioned at the beginning of this article, the conflict detection queue and command worker together constitute the state machine engine of CurpServer. The conflict detection queue supplies conflict-free commands to the command workers, which then executes these commands and updates the conflict relationships in the conflict detection queue based on the results. + +Structurally, the CurpServer's state machine engine consists of three pairs of channels and a filter. These three channel pairs are: +(send_tx, filter_rx), (filter_tx, recv_rx), and (done_tx, done_rx). The specific structure can be seen in the diagram below: + +![图片](/xline-home/blog/CURP-State-Machine-Engine/image4.PNG) + +The data flow direction is: send_tx -> filter_rx -> filter -> filter_tx -> recv_rx -> done_tx -> done_rx. + +Here, the send_tx owned by the RawCurp object is responsible for sending the corresponding CEEvent to the Conflict Detection Queue during propose (corresponding to CURP's fast path) and applying logs (corresponding to CURP's slow path). After determining the conflict order, the Conflict Detection Queue converts the CEEvent into a Task and delivers it to the command worker for execution via (filter_tx, recv_rx). After executing the Task, the command worker sends the results back to the Conflict Detection Queue through (done_tx, done_rx) and updates the vertex information in the dependency graph. + +## How States Transition + +To understand the working principle of a state machine, we need to address the following two questions: + +1. What events and states are provided by the state machine? +2. Which events will cause the state to transition? + +Let's first look at the events provided by the Curp Server's state machine engine. + +\`\`\`rust +/// Event for command executor +enum CEEvent { + /// The cmd is ready for speculative execution + SpecExeReady(Arc>), + /// The cmd is ready for after sync + ASReady(Arc>), + /// omit some code... +} + +/// CE task +struct Task { + /// Corresponding vertex id + vid: u64, + /// Task type + inner: TaskType, +} + +/// Task Type +enum TaskType { + /// Execute a cmd + SpecExe(Arc>, Option), + /// After sync a cmd + AS(Arc>, C::PR), + /// omit some code... +} +\`\`\` + +From the previous description, we can see that the main events of the CurpServer's state machine engine can be divided into two types. One type is CEEvent, which describes the information of the command itself, including the source of the command. Here, SpecExeReady indicates that the command comes from the fast path, while ASReadey indicates that it comes from the slow path. The other type is Task, describing the vertex id of the command in the dependency graph and the operations that the current command needs to perform. + +The state machine engine of CurpServer also defines the following states: + +\`\`\`rust +/// Execute state of a cmd +enum ExeState { + /// Is ready to execute + ExecuteReady, + /// Executing + Executing, + /// Has been executed, and the result + Executed(bool), +} + +/// After sync state of a cmd +enum AsState { + /// Not Synced yet + NotSynced(Option), + /// Is ready to do after sync + AfterSyncReady(Option), + /// Is doing after syncing + AfterSyncing, + /// Has been after synced + AfterSynced, +} +\`\`\` + +Here, ExeState represents the execution state of the command, while AsState represents whether the command has completed the after_sync phase. CurpServer uses a combination of ExeState and AsState to represent different stages in the command execution process. The semantics represented by different states are as follows: + +- (ExecuteReady, NotSynced(None)): Represents that the command is ready to proceed to the execute phase and that the command belongs to the fast path. There's no need to wait for the after_sync to complete before returning results to the user. This state is also the initial state of the state machine engine in the fast path. +- (ExecuteReady, AfterSyncRead(None)): Indicates the command is ready for the execute phase and belongs to the slow path. It needs to wait for after_sync to finish before results can be returned to the user. This is also the initial state of the state machine engine in the slow path. +- (Executing, NotSynced(Some(C::PR))): Represents successful pre_execute execution of the command, having obtained the execution result of pre_execute as Some(C::PR), and the command has also entered the execution state. +- (Executing, NotSynced(None)): Represents the failure of the command's pre_execute phase. +- (Executed(true), NotSynced(Some(C::PR))): Represents successful command execution. +- (Executed(false), NotSynced(None)): Indicates a command failure in the fast path. +- (Executed(true), AfterSyncRead(LogIndex, Some(C::PR))): Indicates the command has been executed and is preparing for the after_sync phase. +- (Executed(true), AfterSyncing): Represents the command has been executed and is currently in the after_sync phase. +- (Executed(true), AfterSynced): Indicates the successful command execution, and the after_sync phase was also successful. +- (Executing, AfterSyncReady(Some(C::PR))): Represents the command is executing and is preparing for the after_sync phase. +- (Executing, AfterSyncReady(None)): Represents the failure of the command's pre_execute phase. +- (Executed(false), AfterSyncReady(None)): Indicates a command failure in the slow path. + +The relationship between various state transitions is as follows: + +![图片](/xline-home/blog/CURP-State-Machine-Engine/image5.png) + +## Summary + +In Xline, whether commands are from the fast path or the slow path, these commands will eventually be executed on the leader node. It is evident that just relying on spec_pool to determine if there's a command conflict is not enough. This is because spec_pool can only judge whether a new command conflicts with a command that is currently in the execute phase but hasn't gone through the after_sync yet. It cannot dynamically maintain command conflict relationships. To address the dynamic maintenance of conflict relationships, we introduced the Conflict Detection Queue and constructed the CurpServer's state machine engine in conjunction with the command worker. Through the execution by the command worker, commands from different paths (fast path and slow path) can transition states based on their current state and return corresponding results to users. +`,X5=`--- + cover: /xline-home/blog/Xline-Command-Deduplication-Mechanism-(Part-One)—Introduction-to-RIFL/cover.png + author: + name: Wenhui Tang + url: https://github.com/iGxnon + img_url: https://avatars.githubusercontent.com/u/59405399?v=4 + read_time: 20 +--- + +In a system that receives external commands, it is common for a command to be executed at least once, which we refer to as at-least-once semantics. If a command fails, the system often implements a retry mechanism to attempt to resolve the issue. This raises a problem: repeated submission of the same command can impact the system's state. + +--- + +## Why is deduplication of commands necessary? + +In a system that receives external commands, it is common for a command to be executed at least once, which we refer to as at-least-once semantics. If a command fails, the system often implements a retry mechanism to attempt to resolve the issue. This raises a problem: repeated submission of the same command can impact the system's state. + +For example, to achieve linearizable semantics (where each user operation appears to be executed immediately, exactly once, and at some point between its invocation and response), it's necessary to deduplicate commands. In Raft implementations without command deduplication, a command might be executed multiple times. The leader might crash after committing but before responding to the client, and if the client retries the same command with a new leader, the command could be executed twice. + +There are two solutions to this problem: one is similar to the etcd approach, which distinguishes between commands that can be retried and commands that cannot be retried, and returns the error results of the commands that cannot be retried to the user, without providing any guarantees, even though the command may have already been executed by the system. Another option is to implement a command tracking mechanism that checks the commands executed in the system to realize command de-duplication. When the system implements this deduplication mechanism, it can realize exactly-once semantics of command execution, and thus realize a higher level of consistency assurance. + +The implementation of retries in etcd's gRPC client interceptor: + +\`\`\`go +// unaryClientInterceptor returns a new retrying unary client interceptor. +// +// The default configuration of the interceptor is to not retry *at all*. This behaviour can be +// changed through options (e.g. WithMax) on creation of the interceptor or on call (through grpc.CallOptions). +func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClientInterceptor { + intOpts := reuseOrNewWithCallOptions(defaultOptions, optFuncs) + return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { + ctx = withVersion(ctx) + grpcOpts, retryOpts := filterCallOptions(opts) + callOpts := reuseOrNewWithCallOptions(intOpts, retryOpts) + ... + var lastErr error + for attempt := uint(0); attempt < callOpts.max; attempt++ { + if err := waitRetryBackoff(ctx, attempt, callOpts); err != nil { + return err + } + + ... + + lastErr = invoker(ctx, method, req, reply, cc, grpcOpts...) + if lastErr == nil { + return nil + } + + ... + + // Retry here + if !isSafeRetry(c, lastErr, callOpts) { + return lastErr + } + } + return lastErr + } +} +\`\`\` + +## At what stage is deduplication completed? + +First, it's important to understand the purpose of deduplication: to prevent duplicate commands from affecting the state machine. There are two stages where commands can be deduplicated: upon receiving the command and when applying it to the state machine. + +Regardless of the method, a data structure is needed to track the progress of received and executed commands for deduplicating incoming client commands. + +Deduplicating commands at the stage of applying them to the state machine naturally involves using the backend storage of the state machine to retrieve previously executed commands (for example, Log::get_cmd_ids can retrieve all command IDs in the log). This set of command IDs can be used to deduplicate commands about to be applied to the state machine. + +To deduplicate upon receiving a command, an additional data structure must be maintained, typically in memory for efficient read-write access. This structure should not occupy a significant amount of memory and may need a garbage collection mechanism. + +For the first approach, a primary issue is that log compaction mechanisms can render the deduplication ineffective. In Raft systems, log compaction is implemented to prevent excessive memory usage by logs. If a command log has been compacted, deduplication for the repeated command becomes impossible. Secondly, duplicate commands still undergo preparation and speculative execution before being sent to the state machine, consuming additional CPU. Finally, accessing the state machine is costly, and this method of deduplication can significantly impact performance. + +Therefore, it's more efficient to deduplicate commands upon receipt, rejecting duplicate command submissions as early as possible. + +## Current Flaws in Command Deduplication Design + +In Xline CURP, commands are implemented as a trait by external mechanisms. Unlike etcd, we do not differentiate the retry behavior of some commands, so we have not defined retry characteristics in the command trait. + +Currently, the CURP client retries all commands, so a simple deduplication mechanism has been implemented in the curp server: + +The CommandBoard contains an IndexSet for recording the IDs of previously executed commands. + +\`\`\`rust +/// Command board is a buffer to track cmd states and store notifiers for requests that need to wait for a cmd +#[derive(Debug)] +pub(super) struct CommandBoard { + ... + /// The cmd has been received before, this is used for dedup + pub(super) sync: IndexSet, + ... +} +\`\`\` + +Thus, we can deduplicate commands at the propose stage with an O(1) overhead. + +\`\`\`rust +pub(super) fn handle_propose( + &self, + cmd: Arc, + ) -> Result<((Option, u64), Result), CurpError> { + ... + if !self.ctx.cb.map_write(|mut cb_w| cb_w.sync.insert(id)) { + return Ok((info, Err(ProposeError::Duplicated))); + } + ... + } +\`\`\` + +To ensure that CURP does not lose the IDs of commands currently being executed during a leadership transfer, this structure is also restored in the recovery of the Speculative Pool. + +\`\`\`rust +/// Recover from all voter's spec pools + fn recover_from_spec_pools( + &self, + st: &mut State, + log: &mut Log, + spec_pools: HashMap>>, + ) { + ... + for cmd in recovered_cmds { + let _ig_sync = cb_w.sync.insert(cmd.id()); // may have been inserted before + ... + } + } +\`\`\` + +Finally, to prevent the IndexSet from occupying too much memory, the GC mechanism mentioned in the Xline source code analysis article periodically clears this structure. + +However, under extreme network conditions, if the interval between a client initiating a command and receiving a response exceeds the GC interval, the ProposeId recorded in the IndexSet might be cleared by GC. In such cases, if the client retries the command, the deduplication mechanism would fail. We observed this extreme scenario in madsim tests (due to madsim's clock running much faster than real time, this issue was triggered), necessitating a new deduplication structure to address the problem. The latter part of this article will introduce the working principle of RIFL (Reusable Infrastructure for Linearizability) and how it is applied in CURP. + +## Introduction to RIFL + +[RIFL (Reusable Infrastructure for Linearizability)](https://web.stanford.edu/~ouster/cgi-bin/papers/rifl.pdf) is an infrastructure designed to ensure exactly-once semantics for RPCs (remote procedure calls) in large-scale clusters. To align the terminology of RIFL with that of the Xline system, in this context, RPCs and Commands are synonymous. + +## Overview of RIFL + +In RIFL, each RPC is assigned a unique identifier, composed of a 64-bit client_id and a 64-bit incrementing sequence_number under this client_id. + +A system-wide structure, typically a Lease Manager module in RIFL, generates the client_id. This module assigns a client_id to each client and creates a corresponding lease, which clients must continually keep alive. Servers need to check this lease to determine if a client has crashed. + +Furthermore, RIFL requires persistent tracking and recording of completed RPCs. During system migrations, these completion records must also be transferred to ensure that RIFL maintains the non-repetition of RPCs during the migration process. RPCs that have been executed previously will directly retrieve their prior completion records. + +Finally, RPC completion records should be cleared upon client confirmation (or after a client crash) to safely remove unnecessary storage. + +## Specific Components and Functions of RIFL + +The following are key components of RIFL and their corresponding functions: + +1. Request Tracker (Client-Side): Tracks commands sent by the client. + - newSequenceNum(): Generates an incrementing sequence number for an RPC. + - firstIncomplete(): Retrieves the current smallest sequence number for which the RPC response has not been received. + - rpcComplete(sequenceNumber): Marks the given sequenceNumber as received, which is later used to update firstIncomplete. +2. Lease Manager: A unified Lease Manager module where clients renew their client_id, and servers check the expiration of client_id leases. + - getClientId(): Clients obtain their client_id, or request the lease server to create one if it doesn't exist. + - checkAlive(clientId): Servers check whether the lease for a given client_id has expired to determine if the client is alive. +3. Result Tracker (Server-Side): Tracks received commands and the progress confirmed by the client. + - checkDuplicate(clientId, sequenceNumber): Determines if an RPC is a duplicate based on completion records. + - recordCompletion(clientId, sequenceNumber, completionRecord): Marks an RPC as executed and stores the completionRecord before returning to the client. + - processAck(clientId, firstIncomplete): Recycles all completion records for RPCs preceding firstIncomplete for a client. + +![图片]() + +When a server receives an RPC (client_id, seq_num, first_incomplete), it checks the RPC's status using checkDuplicate: + +1. NEW: A new RPC, processed according to standard logic. +2. COMPLETED: An already completed RPC, returning the completion record. +3. IN_PROGRESS: An RPC that is currently being executed, returning an IN_PROGRESS error. +4. STALE: An RPC that has been acknowledged and recycled by the client, returning a STALE error. + +Additionally, the server uses the first_incomplete field from the incoming RPC to call processAck, recycling the completion records of acknowledged RPCs. Lastly, when an RPC is completed and before returning to the client, recordCompletion is called to persist the completion record and mark the RPC as COMPLETED. + +Furthermore, the server checks if the client_id's lease is still valid to determine if a client is alive. If the lease has expired, all completion records under that client_id are recycled. + +## Performance Analysis of RIFL + +In the RIFL architecture, a noticeable overhead arises from the communication between clients and servers with the Lease Manager. The RIFL paper mentions that servers can cache the expiration time of a client_id lease and query the Lease Manager only as it nears expiration, reducing network communication. + +In the aforementioned processes, either checkDuplicate or processAck involves at least one O(n) complexity operation (either checking duplicates in sequenceNumber order or filtering unordered sequenceNumbers but needing to traverse and filter those less than first_incomplete for processAck). Compared to the O(1) complexity of the previous IndexSet approach, RIFL incurs some additional overhead. Performance can be optimized by making processAck a separate RPC to notify the server to recycle completion records. + +Finally, since the first mechanism for recycling only checks first_incomplete, it may encounter a long-running RPC that blocks the recycling of subsequent RPC completion records, potentially leading to excessive memory usage on the server. The RIFL paper suggests setting a maximum number of inflight RPCs for a client, refusing excess RPCs, and considering early recycling of subsequent RPC completion records, which could make RIFL more complex. + +## Summary + +The above describes the mechanism by which RIFL maintains exactly-once semantics for unary RPCs. Section 6 of the RIFL paper, titled "Implementing Transactions with RIFL," details the mechanism for maintaining exactly-once semantics for transactions involving multiple objects. However, as transactions in the Xline system are sent to the server as a single command, they do not require separate handling. Readers interested in this aspect can refer to the paper for more details, as it will not be elaborated upon here. + +The first half of this article begins with the need for command deduplication and discusses the existing problems with the current deduplication mechanism in Xline. The latter half details the working principle of RIFL (Reusable Infrastructure for Linearizability) and provides a performance analysis. Future articles will continue to discuss how RIFL is applied in Xline, along with necessary modifications and optimizations made to RIFL. +`,K5=`--- + cover: /xline-home/blog/Analysis-of-Xline-Jepsen-Tests/cover.png + author: + name: Zhenghao Yin + url: https://github.com/bsbds + img_url: https://avatars.githubusercontent.com/u/69835502?v=4 + read_time: 10 +--- + +In this article, we will mainly introduce the application of Jepsen in the testing of a distributed KV storage Xline. This includes an introduction to the chaos engineering framework Jepsen, a explanation to consistency models, and an analysis of the testing results. + +--- + +## Abstract + +In this article, we will mainly introduce the application of Jepsen in the testing of a distributed KV storage Xline. This includes an introduction to the chaos engineering framework Jepsen, a explanation to consistency models, and an analysis of the testing results. + +## Introduction + +First, let’s get an overview of Xline and the Jepsen testing framework. + +## Xline + +[Xline](https://github.com/xline-kv/Xline) is a distributed key-value storage and it is currently a CNCF sandbox project. Similar to etcd, Xline provides a consistent key-value storage, as well as other functionalities such as watch and distributed locks. + +Xline provides an etcd-compatible API, but its main difference from etcd lies in the consensus protocol. + +Xline uses [CURP](https://www.usenix.org/system/files/nsdi19-park.pdf) as its consensus protocol, which allows it to achieve consensus within 1-RTT (Round Trip Time) in most cases, while Raft requires at least 2-RTT to achieve consensus. Therefore, Xline can achieve higher performance in high-latency environments. + +## Jepsen + +[Jepsen](https://github.com/jepsen-io/jepsen) is a framework for validating distributed systems, belonging to the field of chaos engineering. It provides consistency checks and fault injection capabilities. Specifically, Jepsen performs black-box testing, where it simulates complex real-world deployment environments and performs a series of operations on the database. After the testing is complete, it uses consistency checkers to verify whether the results comply with the consistency guarantees of the database. + +## Checkers + +Jepsen uses checkers to perform consistency checks on the execution results. Currently, Jepsen has two types of checkers: Knossos and Elle. + +Knossos is used to check if the results are linearizable, and Elle is used to check the consistency of database transactions. + +It is important to note that these checkers cannot guarantee the detection of all inconsistencies, as linearizability and serializability checkings are both NP-complete problems [1][2]. Jepsen’s checkers limit the scope of calculations to complete the testing within a shorter time frame. + +## Nemesis + +The fault injection component in Jepsen is called nemesis. Jepsen has some built-in nemesis options: + +- kill, which can kill the processes of the database on certain nodes +- pause, which can pause the processes of the database on certain nodes +- partition, which creates network partitions between arbitrary two nodes, such as majority/minority partitions +- clock, which can skew the system clocks on certain nodes + +These components can simulate common software and hardware faults in distributed system deployment environments. Additionally, Jepsen, being a highly flexible framework, allows users to customize their own nemesis. For example, for etcd, we can make membership changes in the cluster also be a nemesis, so that is can adds/deletes nodes in the testing. Therefore, nemesis can not only be used for fault injection but also to trigger some events that may occur in the system. + +## Jepsen Testing Design + +Next, I will provide a detailed analysis of the etcd Jepsen testing design and explain how we applied Jepsen testing on Xline. + +## Data Consistency + +First, let me briefly introduce three consistency models as the background for the following analysis. They are Serializability, Linearizability, and Strict Serializability. More detailed information about these consistency models can be found on the Jepsen official website [3]. + +## Serializability + +Serializability is a transaction model that applies to multiple objects (e.g., multiple keys in etcd), where each transaction’s operations are atomic. It has several characteristics: + +- Internal Consistency: A read operation in a transaction can observe the results of all previous write operations. +- External Consistency: A read in one transaction, denoted as T1, can observe a write in another transaction, denoted as T0. We call this T0 is visible to T1. +- Total Visibility: All visibility relationships form a total order. Which also means that there are some transactions that do not have this visibility relationship, applying this visibility relationship to all transactions forms a partial order. + +## Linearizability + +Linearizability applies to a single object, and each operation is also atomic. All operations appears in a real-time order, which means that the order of the operation results reflects the specific time of completion. + +## Strict Serializability + +Strict Serializability combines Serializability and Linearizability, achieving the strongest consistency guarantee. It can be viewed as Linearizability for multiple objects. At this point, we not only guarantee total visibility, but also requires that all transactions appears in a real-time order. + +## Jepsen etcd Test + +First, let me briefly introduce Jepsen’s testing design for etcd. Etcd uses the Strict Serializability Model for its consistency. Jepsen has developed the following tests for etcd: + +## Registers + +Registers are a built-in model in Knossos for checking linearizability. Since linearizability applies to a single object, a register is used to represent a single object, supporting read/write/compare-and-set operations. Knossos verifies whether all operations result on registers are linearizable. + +## Sets + +Sets test for stale reads. Etcd supports allowing stale reads to improve read performance, but it is disabled by default. The Sets test only has a compare-and-set operation, which performs multiple operations on a single key and checks if the results are serializable. In other words, it checks whether each CAS operation occurs atomically. + +## Append + +The Append test checks for strict consistency and has two operations: read and append. Append means treat the value of a key as a list. The append operation appends an element to this list. + +The way to implement append is to first read the value of a key from etcd, and then check if the value has changed within a transaction. If it has not changed, the new value after the append is written. + +In this test, not only should all transactions occur atomically, Jepsen also checks if these transactions occur in a real-time order. + +## WR + +The WR test performs read/write operations on multiple keys using transactions and it also checks for strict serializability. + +## Jepsen Xline Test + +The Jepsen testing framework consists of four main parts: DB, Client, Checkers, and Nemesis. Each part is a separate interface that users can implement. Since Xline implements an etcd-compatible API, we reused Jepsen’s tests for etcd for Xline. Based on these tests, we implemented the DB interface for Xline in Jepsen. Xline also has its own client SDK that uses CURP consensus, and we also implemented the client interface for this in Jepsen. So the tests are actually divided into compatibility tests for the etcd client and tests for the Xline native client (currently untested). + +## Test Result Analysis + +Next, I will explain in detail the Xline Jepsen test results and the issues we identified. + +## Test Results + +In the initial tests, we encountered quite a few problems, with the majority of issues related to the transactional operations in Xline. Some of these issues were minor bugs, while others were design vulnerabilities. Debugging and identifying these problems actually took a considerable amount of time. + +I will provide detailed explanations for two main categories of issues: asynchronous storage persistence and revision generation. + +## Asynchronous Storage Persistence + +In etcd, the storage persistence is synchronous. When a node receives a log, it synchronously persists the log onto the storage device and then executes the commands in the log. After the execution is completed, the results are synchronously persisted onto the storage device. This allows the cluster to tolerate the simultaneous shutdown or power failure of more than a majority of nodes without affecting consistency. + +In contrast, Xline assumes that the cluster always has a majority of nodes and does not consider the scenario where all nodes fails at the same time. This is similar to some memory-based Raft implementations. This provides us with some optimization opportunities, and the initial design of Xline was to make all storage persistence operations asynchronous. + +However, doing so introduces several issues: + +- At this point, the previously mentioned uncertainty in execution order introduces complexity and leads to bugs in the initial implementation: + - The implementation did not wait for all logs represented by indexes prior to this index to finish execution before executing the read operation. + - In fact, merely obtaining the command IDs from step 1 is not enough, as the log indexes may represent a newer system state than the command IDs. This is because our log execution is asynchronous, and the order of execution cannot be determined! +- Inconsistency between log storage and KV storage + Consider this scenario: the KV persistence is completed before log persistence on a node due to the asynchronous nature of these operations. If the node restarts for some reason at this point, it recovers the log which is not up-to-date, leading to the execution of the same log twice during the recovery process. And not all operations are idempotent, for example, executing a predicate-based transaction twice is not idempotent. This indicates that KV persistence must occur after log persistence. + +Based on the above issues, we can conclude the fact that asynchronous persistence introduces many additional states to consider, making it difficult to reasoning and analyze system states. Furthermore, it potentially impacts performance. We are currently considering using a synchronous approach instead of asynchronous storage persistence to simplify system implementation. This may sacrifice some performance, but correctness is always more important than performance. + +## Revision Generation + +In the initial design, we wanted Xline to be compatible with etcd while achieving 1-RTT consensus performance. In etcd, there is a concept called revision which represents the modifications made to the system. For every kv request, a revision needs to be returned. Therefore, we initially implemented a (which has now been proven to be wrong) method to generate revision in 1-RTT. However, it was ultimately proven that generating revision in 1-RTT is not feasible. This implementation also caused Jepsen tests involving revision (specifically, append) to fail. + +Now let me explain what our old implementation looked like, why it was wrong, and why generating revision in 1-RTT is not possible. + +## Background + +First, we need some background on CURP consensus [4]. The principle behind CURP’s 1-RTT implementation is that it has a witness co-hosted on each node. Before executing a command, the client needs to record the command on a majority of witnesses. Then the command can be executed directly on the leader without needing to be replicated to followers because the command information is stored on the witnesses, allowing the original command to be recovered even if a minority of nodes in the cluster has failed. The commands recorded on the witnesses have two characteristics: + +1. The commands commute with each other. +2. There is no order between the commands. + +This is actually very similar to the implementation of Generalized Paxos [5], both of which optimize request latency by leveraging the commutativity between commands. The commutativity property determines the two characteristics of the commands recorded on the witnesses. Commutativity means that the keys modified by two commands cannot overlap, and non-commuting commands must be executed in serial. Commuting commands can be executed concurrently, which means they have no order between them. + +## Analysis of the old implementation + +In the old implementation, each node locally assigned a revision to each command. It is necessary to ensure that the order of revision allocation was the same for all commands. Before the execution phase on each node, we assigned revisions to each node according to the order of log indices. At first glance, this doesn’t seem to have a problem. Since revisions are allocated in the order of log indices, shouldn’t the order of revision allocation on each node be the same? However, we overlooked one thing: some information of the commands may still be recorded on the witnesses! If a node crashes and recovers from the witness, it does not know the order of the recovered commands, which leads to inconsistent orders of revision allocation on different nodes. + +## Why generating revision in 1-RTT is not possible? + +The concept of revision is natural for Raft, where the entire distributed system is abstracted as a state machine, and the value of revision represents the state. This indicates that there is a global order for all modifications to the system. + +For CURP consensus protocol, since the commands recorded on the witnesses are unordered (due to the requests from clients being concurrent), if we want to figure out the order, we must introduce an additional RTT to synchronize them on each witness. This two-step process of recording and sorting requires at least two RTTs. + +Like Generalized Paxos, CURP uses commutativity, which implies that there may be no order between commands. So all commands form a partial order known as a command history [5]. In this case, the concept of revision is not applicable. + +In the Generalized Consensus and Paxos paper, the author actually proves that in Generalized Consensus, it requires at least two message delays to determine the order between any two commands (Learning is impossible in fewer than 2 message delays). Here is the proof from the original paper [5]: + +> Suppose l learns a value proposed by p in one message delay. +> Then it is possible that every message sent by p was lost except for ones +> received by l. If all messages from p and l to other processes are lost, then +> there is nothing to prevent another learner from learning a different value +> proposed by another proposer, violating consistency. + +## Fix in Xline + +1. etcd compatibility +2. According to the previous discussion, it is actually impossible for Xline to maintain its 1-RTT consensus performance while being compatible with etcd revision. So in the compatibility layer with etcd, we need to wait for each command to be committed before assigning a revision to it, which requires two RTTs. +3. Append test +4. The transaction test in the Append test uses revision to ensure atomicity of the transaction. The Append test requires strict serializability. In the previous discussions, it can be seen that for CURP consensus, there is no global order for all commands, so this actually violates the requirement of strict serializability. The partial order in CURP only guarantees serializability. Therefore, in the Xline test (non-etcd compatible), we cannot directly use the Append test. In other words, when writing Jepsen tests for Xline, the consistency model should be changed to a weaker serializability model. + +## References + +[1] +P. B. Gibbons and E. Korach, “Testing shared memories,” Siam journal on computing, vol. 26, no. 4, pp. 1208–1244, 1997. + +[2] +C. H. Papadimitriou, “The serializability of concurrent database updates,” Journal of the acm (jacm), vol. 26, no. 4, pp. 631–653, 1979. + +[3] +“Jepsen consistency.” Available: https://jepsen.io/consistency + +[4] +S. J. Park and J. Ousterhout, “Exploiting commutativity for practical fast replication,” in 16th usenix symposium on networked systems design and implementation (nsdi 19), Boston, MA: USENIX Association, Feb. 2019, pp. 47–64. Available: https://www.usenix.org/conference/nsdi19/presentation/park + +[5] +L. Lamport, “Generalized consensus and paxos,” 2005. +`,G5=`--- + cover: /xline-home/blog/Membership-Change-Source-Code-Interpretation/cover.png + author: + name: Yu Guan + url: https://github.com/themanforfree + img_url: https://avatars.githubusercontent.com/u/56149350?v=4 + read_time: 13 +--- + +In distributed system application scenarios, it is inevitable to add or delete nodes or replace nodes, the simplest solution is to temporarily shut down the cluster, then directly modify the configuration file to add new nodes, and then restart the cluster after the completion of the process. This indeed can achieve our purpose, but its problems are also very obvious. During the period of change, the cluster is not available, which is unacceptable to the system that requires high availability. The manual process can cause other errors, for example it might reduce the stability of the system. Therefore, how to change cluster members efficiently and securely has become a key issue in the development of distributed systems. For Xline, it is not only necessary to handle the regular change process, but also to integrate it with the Curp protocol to ensure that the introduction of cluster membership changes does not lead to errors in the front-end protocol. + +--- + +In distributed system application scenarios, it is inevitable to add or delete nodes or replace nodes, the simplest solution is to temporarily shut down the cluster, then directly modify the configuration file to add new nodes, and then restart the cluster after the completion of the process. This indeed can achieve our purpose, but its problems are also very obvious. During the period of change, the cluster is not available, which is unacceptable to the system that requires high availability. The manual process can cause other errors, for example it might reduce the stability of the system. Therefore, how to change cluster members efficiently and securely has become a key issue in the development of distributed systems. For Xline, it is not only necessary to handle the regular change process, but also to integrate it with the Curp protocol to ensure that the introduction of cluster membership changes does not lead to errors in the front-end protocol. + +## Problems and Solutions for Dynamic Membership Changes + +Since Xline uses Raft as a backend protocol, adding the ability to dynamically change members to Xline requires solving the problems encountered by the Raft protocol itself. A key premise for the successful operation of the Raft protocol is that there can only be one leader at any given time. Without imposing any restrictions, directly adding nodes to the cluster may potentially destroy this premise, as shown in the following figure: + +![image](/xline-home/blog/Membership-Change-Source-Code-Interpretation/image1.PNG) + +Due to network delays and other reasons, it is impossible to guarantee that each node switches from $$C_{old}$$ to $$C_{new}$$ at the same time, the possible outcome is shown in the below figure. + +Assuming that at this time, Server 1 and Server 5 start to be elected at the same time, Server 1 obtains the votes of Server 2, which meets the quorum in$$C_{old}$$ and becomes the Leader. Server 5 receives votes from Server 3 and Server 4, which satisfies the quorum requirement in $$C_{new}$$ and becomes the Leader, and then there are two Leaders at the same time, which creates consistency problems. + +In order to solve this problem, the authors of Raft provided two solutions. + +1. Joint Consensus +2. Single-step membership change + +## Joint Consensus + +Joint Consensus is essentially adding an intermediate state to the membership change process. + +![image](/xline-home/blog/Membership-Change-Source-Code-Interpretation/image2.PNG) + +When the Leader receives a membership change request, it creates a $$C_{old,new}$$ configuration and synchronizes it with the Follower via AppendEntries. The node that receives $$C_{old,new}$$ will use both configurations to make a decision, i.e., the election and other operations require the agreement of both $$C_{old}$$ and $$C_{new}$$ to be successful. After $$C_{old,new}$$ commits, the Leader creates the $$C_{new}$$ configuration and synchronizes it with the Follower. + +In this scenario, there are several possibilities for the intermediate state of cluster member changes: + +1. $$C_{old,new}$$ is created and then committed, there may be two configurations of $$C_{old}$$ $$C_{old,new}$$ in the cluster at this stage, any node that wants to be the Leader at this stage needs the $$C_{old}$$ configuration to agree to it, so there will not be two Leaders. +2. After $$C_{old,new}$$ is submitted and before $$C_{new}$$ is created, there may be two configurations of $$C_{old}$$ $$C_{old,new}$$ at the same time in this phase, but only nodes using $$C_{old,new}$$ can become the Leader because most of the nodes in the cluster have already been configured with $$C_{old}$$ at this phase and the remaining nodes that have not yet switched are not enough to elect a new Leader. +3. $$C_{new}$$ is created and then committed. In this phase, there may be three configurations of $$C_{old}$$ $$C_{old,new}$$ $$C_{new}$$ at the same time, in which the $$C_{old}$$ configuration is not able to elect the Leader, for the reasons mentioned above .$$C_{old,new}$$ and $$C_{new}$$ need $$C_{new}$$ 's consent to elect the Leader, and there will not be two Leaders in this case. +4. After $$C_{new}$$ commits, $$C_{new}$$ makes the decision independently, and there will not be two leaders. + +### Single-step node change + +In addition to Joint Consensus, there is another way to do cluster membership changes safely, and that is with single-step node changes. This method only adds or subtracts one node at a time, in this case, the majority of the old and new configurations must have overlapping nodes, and the overlapping nodes can only vote for one node, which ensures that there will not be two Leaders at the same time.Complex change behaviors need to be converted into multiple single-step node changes to complete. + +![image](/xline-home/blog/Membership-Change-Source-Code-Interpretation/image3.PNG) + +This scheme has no intermediate state, only one step operation can complete the change. The logic is more concise than Joint Consensus, there are not so many complex intermediate state, the realization will be a little simpler, of course, its function is not as powerful as Joint Consensus. + +Xline's current approach is a single-step membership change, and we will add support for Joint Consensus in the future. + +## Curp Protocol Integration + +The main process of Membership change can be accomplished through the back-end Raft, but this process may disrupt the flow of the Curp protocol on the front-end. During normal processing, the Curp client broadcasts a Propose request to all nodes in the cluster, and determines whether this propose is committed in curp based on whether the number of successful proposes is greater than the number of superquorums of the current cluster members, and whether the members are determined at the time of creation of the client, but with the introduction of membership change. Before membership change, all members were determined when the client was created, but after membership change was introduced, there needs to be a mechanism to ensure that when the client is using the old configuration, it can also detect the new configuration used by the server and retry the current request with the new configuration, or else it may cause the Curp protocol to fail to work properly. + +![image](/xline-home/blog/Membership-Change-Source-Code-Interpretation/image4.PNG) + +As shown in the figure, suppose the Client broadcasts a Propose to a three-node cluster, then the Client receives three (3 node's superquorum) successful responses and considers this Propose to have been committed in Curp. During this Propose process, the cluster membership changes and Server4 joins the cluster. However, the superquorum of node 4 is 4, which means that the request that was just committed by curp in the 3-node cluster no longer meets the commit condition of Curp after the membership change, which may result in the loss of the request that has been returned to the Client. + +To solve this problem, we introduced a new field \`cluster_version\` for requests sent by external clients, which represents the version of the configuration currently in use by the cluster and is modified every time a membership change is performed. So that the Server can use this field to determine whether the client sending the request is using the correct configuration, and directly reject the request using the wrong configuration. After the Client detects the inconsistency of the \`cluster_version\`, it will take the initiative to pull the current configuration from the Server and initiate a new round of requests with the new configuration. In the above example, when Propose and membership change happen at the same time, one of the nodes in Server1, 2, and 3 must be using the new configuration, so that node will reject Propose with another \`cluster_version\`.After the Client detects the new \`cluster_version\`, it will re-pull the current member configuration from the cluster and retries the entire request with the new configuration. + +## Source Code Interpretation + +### Leader Initiates Membership Change + +The first step in initiating a membership change is to send a \`ProposeConfChangeRequest\` to the Leader, which contains information about the nodes to be changed in this proposal and some other auxiliary fields. + +When the Server receives the request, it first checks to see if the \`cluster_version\` of the request matches the current \`cluster_version\` of the cluster, and rejects any request that doesn't match, before proceeding to the Server's processing logic: + +\`\`\`rust + /// Handle \`propose_conf_change\` request + pub(super) fn handle_propose_conf_change( + &self, + propose_id: ProposeId, + conf_changes: Vec, + ) -> Result<(), CurpError> { + // ... + self.check_new_config(&conf_changes)?; + let entry = log_w.push(st_r.term, propose_id, conf_changes.clone())?; + debug!("{} gets new log[{}]", self.id(), entry.index); + let (addrs, name, is_learner) = self.apply_conf_change(conf_changes); + self.ctx + .last_conf_change_idx + .store(entry.index, Ordering::Release); + let _ig = log_w.fallback_contexts.insert( + entry.index, + FallbackContext::new(Arc::clone(&entry), addrs, name, is_learner), + ); + // ... + } +\`\`\` + +The Leader node checks the validity of this conf change with the \`check_new_config\` method during processing, rejecting in advance changes that cannot be processed, such as inserting a node that already exists or removing a node that does not exist. Once the check passes, it goes through the same process as a regular request, synchronizing to all Follower by consensus. In addition to this part of the same process, the conf change requires some special handling, applying the new configuration as soon as it is inserted into the log and recording the context used to roll back the configuration. This is the same way as mentioned in the Raft paper, after the node owns the log, it doesn't need to wait for it to commit, it will take effect immediately. In Raft, the logs that are not committed can be overwritten, so it is necessary to record the context, and if the logs are overwritten, it is possible to rollback the change by using this context. + +### Follower handling of member changes + +For a Follower node, the main logic for member changes occurs in \`handle_append_entries\`, which is used to process logs sent by the Leader, including conf change + +\`\`\`rust + pub(super) fn handle_append_entries( + &self, + term: u64, + leader_id: ServerId, + prev_log_index: LogIndex, + prev_log_term: u64, + entries: Vec>, + leader_commit: LogIndex, + ) -> Result { + // ... + // append log entries + let mut log_w = self.log.write(); + let (cc_entries, fallback_indexes) = log_w + .try_append_entries(entries, prev_log_index, prev_log_term) + .map_err(|_ig| (term, log_w.commit_index + 1))?; + // fallback overwritten conf change entries + for idx in fallback_indexes.iter().sorted().rev() { + let info = log_w.fallback_contexts.remove(idx).unwrap_or_else(|| { + unreachable!("fall_back_infos should contain the entry need to fallback") + }); + let EntryData::ConfChange(ref conf_change) = info.origin_entry.entry_data else { + unreachable!("the entry in the fallback_info should be conf change entry"); + }; + let changes = conf_change.clone(); + self.fallback_conf_change(changes, info.addrs, info.name, info.is_learner); + } + // apply conf change entries + for e in cc_entries { + let EntryData::ConfChange(ref cc) = e.entry_data else { + unreachable!("cc_entry should be conf change entry"); + }; + let (addrs, name, is_learner) = self.apply_conf_change(cc.clone()); + let _ig = log_w.fallback_contexts.insert( + e.index, + FallbackContext::new(Arc::clone(&e), addrs, name, is_learner), + ); + } + // ... + } +\`\`\` + +The handling of regular logs will not be repeated here. When the Follower tries to append the logs from the Leader, it will determine what new conf change logs are available on the current node, and what conf changes that have not been committed will be overwritten. Then, using the pre-recorded context, it rolls back the overwritten changes in reverse order and applies the new changes. When applying a new change, the context of the new change should be recorded here as well. + +### Commit of member changelog + +\`\`\`rust +async fn worker_as, RC: RoleChange>( + entry: Arc>, + prepare: Option, + ce: &CE, + curp: &RawCurp, +) -> bool { + // ... + let success = match entry.entry_data { + EntryData::ConfChange(ref conf_change) => { + // ... + let shutdown_self = + change.change_type() == ConfChangeType::Remove && change.node_id == id; + // ... + if shutdown_self { + curp.shutdown_trigger().self_shutdown(); + } + true + } + _ => // ... + }; + ce.trigger(entry.inflight_id(), entry.index); + success +} +\`\`\` + +In the after sync phase after a conf change is committed, besides some general operations, we need to determine if the committed conf change removes the current node, and if it does, we need to shutdown the current node here. Generally, only the leader node will execute here and commit the logs of the removed node, and after it shutdowns itself, the remaining nodes will elect a leader with the latest logs. + +### New Node joins the cluster + +In order to distinguish between a node that creates a new cluster to run on, and a newly started node that needs to join an existing cluster, a new parameter \`InitialClusterState\` needs to be passed in at startup. This is an enumerated type with only two members. \`InitialClusterState::New\` indicates that the node started this time is one of the members of the newly started cluster; \`InitialClusterState::Existing\` indicates that the node started this time is a new node to be added to an existing cluster. + +\`\`\`rust +let cluster_info = match *cluster_config.initial_cluster_state() { + InitialClusterState::New => init_cluster_info, + InitialClusterState::Existing => get_cluster_info_from_remote( + &init_cluster_info, + server_addr_str, + &name, + Duration::from_secs(3), + ) + .await + .ok_or_else(|| anyhow!("Failed to get cluster info from remote"))?, + _ => unreachable!("xline only supports two initial cluster states: new, existing"), +}; +\`\`\` + +The essential difference between these two approaches is that when a new cluster is created, the initial cluster members of each node are the same, and a globally unified node ID can be computed directly from this initial information to ensure that each node has a unique ID, whereas when joining an existing cluster, the new node cannot compute the node ID on its own, and needs to retrieve the information about the existing cluster through the get_cluster_info_from_remote method to directly inherit the ID and other information that the existing cluster is using to ensure the correspondence between the ID and the node within the cluster. This ensures the correspondence between IDs and nodes in the cluster, and avoids duplicate IDs or a node with multiple IDs. + +To ensure compatibility with the etcd interface, a new node does not have a name before it starts running. etcdctl determines whether the corresponding node has started based on whether the name is empty. After a new node is up and running and joins the cluster, it sends a Publish Rpc to the Leader to publish its name in the cluster. + +### Node remove + +Suppose we don't shut down a node after removing it, then it will elect a timeout and send Vote requests to the rest of the nodes, wasting network and CPU resources of the other nodes. To solve this problem, there are two ways we can think of. + +1. Shut down the node immediately after it applies the new configuration that will remove itself. Obviously, this solution must be infeasible. Because in the application of the new configuration, this log has not been committed, there is still the possibility of being backed up, if you close itself here, then if the configuration change occurs back, the node that was removed will have been closed and can not be directly replied to, which is not the result we want to see. +2. Shut down the node immediately after the node commit removes its own logs. Because it has already been committed, this method does not have the above problem, but if you implement it accordingly, you will find that the removed node sometimes still cannot be closed automatically. Because the removed node may not commit the new configuration at all. Suppose we want to remove a Follower node, and the Leader adds this removal record to its own log, and then immediately starts to use the new log, at this point, the Leader will not send any request to the Follower, and the Follower will naturally not be able to commit the record. Naturally, the follower cannot commit this log and shut down itself. This problem does not exist for the Leader, which will temporarily manage the cluster without itself until the log is committed. + +If the most direct methods don't work, how should the removed node shut itself down? Assuming we don't add the shutdown logic here, what happens is that the Leader synchronizes the conf change log to the cluster, and all members of the new cluster will process and commit this log normally. The removed node will leave the cluster without knowing about it and will not receive a heartbeat from the Leader. This node then times out and starts an election, which is where we finally decide to make the change. + +\`\`\`rust +pub(super) fn handle_pre_vote( + &self, + term: u64, + candidate_id: ServerId, + last_log_index: LogIndex, + last_log_term: u64, +) -> Result<(u64, Vec>), Option> { + // ... + let contains_candidate = self.cluster().contains(candidate_id); + let remove_candidate_is_not_committed = + log_r + .fallback_contexts + .iter() + .any(|(_, ctx)| match ctx.origin_entry.entry_data { + EntryData::ConfChange(ref cc) => cc.iter().any(|c| { + matches!(c.change_type(), ConfChangeType::Remove) + && c.node_id == candidate_id + }), + _ => false, + }); + // extra check to shutdown removed node + if !contains_candidate && !remove_candidate_is_not_committed { + return Err(None); + } + // ... +} +\`\`\` + +We have added additional checking logic in the ProVote phase, the node that receives the pre-vote will check whether the candidate has been Removed. Assuming that the candidate is not in the current node's configuration, and that the possible fallback operation will not allow this node to rejoin the cluster, it means that this is a candidate that has been Removed. The node that handles the request will send a special \`VoteResponseto\` Follower with a \`shutdown_candidate\` field. Candidate receives the response and determines if \`shutdown_candidate\` is \`true\`, and if it is, it starts shutting itself down, and if it is not, it continues the election process. + +## Summary + +In this post, we dive into how cluster membership changes are performed in distributed systems, briefly introducing the two main solutions: Joint Consensus and Single-Step Membership Change. Joint Consensus introduces an intermediate state to ensure that there are no two leaders during a change. Single-step cluster change sacrifices some functionality and simplifies the implementation logic by changing nodes one by one. In addition, we have analyzed the source code of Xline's current single-step membership change scheme, showing how both Leader and Follower handle changes, and what new logic needs to be handled after the introduction of cluster change. + +Currently, Xline only uses a single-step cluster change to handle cluster membership changes, providing a basic change capability. In the future, we will try to support Joint Consensus to enhance the functionality of Xline. + +That's it for Xline's Membership change. If you're interested in more implementation details, please refer to our open source repository at https://github.com/xline-kv/Xline or learn more at the Xline website: \`https://xline.\` cloud. +`,Q5=`--- + cover: /xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/cover.png + author: + name: Jiawei Zhao + url: https://github.com/Phoenix500526 + img_url: https://avatars.githubusercontent.com/u/9337239?v=4 + read_time: 10 +--- + +More and more IT vendors are now embracing cross-cloud multi-clustering as cloud-native technologies and cloud markets continue to mature. Here’s Flexera’s mid-2023 survey on the cloud-native market’s acceptance of multi-cloud, multi-cluster management. (info.flexera.com) + +--- + +## Background and Motivation + +More and more IT vendors are now embracing cross-cloud multi-clustering as cloud-native technologies and cloud markets continue to mature. Here’s Flexera’s mid-2023 survey on the cloud-native market’s acceptance of multi-cloud, multi-cluster management. (info.flexera.com) + +![image1](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image1.webp) + +As you can see from Flexera’s report, more than 87 percent of organizations in the overall cloud-native market are already using services from multiple cloud vendors at the same time, with only 13 percent using a single public cloud and a single private cloud. Only 13% are using a single public cloud or single private cloud, while 15% of those using multi-cloud deployments are choosing multi-public or multi-private cloud deployments, and 72% are adopting hybrid cloud deployments. These statistics reflect the maturity of cloud-native technologies and the cloud marketplace, and the future will be the era of programmatic multi-cloud managed services. + +As you can see from Flexera’s report, more than 87 percent of organizations in the overall cloud-native market are already using services from multiple cloud vendors at the same time, with only 13 percent using a single public cloud and a single private cloud. Only 13% are using a single public cloud or single private cloud, while 15% of those using multi-cloud deployments are choosing multi-public or multi-private cloud deployments, and 72% are adopting hybrid cloud deployments. These statistics reflect the maturity of cloud-native technologies and the cloud marketplace, and the future will be the era of programmatic multi-cloud managed services. + +In addition to external trends, the limitations of single-cluster deployments have become an intrinsic motivation for users to embrace multi-cloud, multi-cluster management. Limitations of single cluster deployments include, but are not limited to: + +- A single point of failure, where cluster-level failures are difficult to tolerate, and a small cluster federation outperforms a large K8s cluster. +- Boundary constraints of a single cluster, e.g., a Node has only 110 Pods by default, and a cluster can hold up to 5000 Nodes. +- Business-level development needs, e.g., Xline itself is a cross-cluster cluster. +- …. + +Karmada, as an open source multi-cluster management tool, has been used by Shopee, DaoCloud and other companies in the production environment. However, since Karmada currently lacks support for stateful application management, it is still mainly used for stateless application management in practice. + +In order to better cope with the future trend of multi-cloud and multi-cluster management, and to better manage stateful applications in multi-cloud and multi-cluster scenarios, Xline and the Karmada community set up a working group to jointly promote Karmada’s support for stateful application management. + +## What are the challenges of managing stateful applications with Karmada? + +Before understanding how Karmada manages stateful applications across multiple clusters, we need to look back at the K8s implementation of managing stateful applications in a single cluster. + +Back in 2012, Randy Bias gave an influential talk on “Open and Scalable Cloud Architecture”. In that talk, he proposed a “Pets” versus a “Cattle”. + +![image](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image2.webp) + +These two concepts correspond to stateless and stateful applications, respectively.Cattle don’t need names, and they are not unique. This means we can easily replace one with another when one of them has some problems. Pets are different. Each pet is unique, with its own name, and should be looked after carefully when it has some problems. + +StatefulSet was introduced in Kubernetes 1.5,and stabilized in version 1.9. It provides a fixed Pod identity for managing Pods, persistent storage for each Pod, and a strict start/stop order among Pods. + +The problems are: what exactly constitutes a state, and how Kubernetes addresses it. + +![image](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image3.webp) + +In the Karmada multi-cluster scenario, stateful applications pose the following problems: + +1. How to ensure that multiple application instances across clusters can have a globally uniform start/stop order, which affects the scale in/out and rolling updates of some application instances. For a distributed KV storage based on consensus protocol, the process of scale in/out needs to go through membership change, which involves the determination of majority change in the cluster. If multiple member clusters scale out at the same time without a globally standardized ordering, it will affect the correctness of the consensus reached by the consensus protocol. +2. How to ensure that all applications across clusters have globally unique instance identifiers, a natural solution is to incorporate member cluster ids into instance identifiers. +3. How to solve the problem of cross-cluster application communication and provide a globally uniform network identity. Currently, in our attempts and practices, we use submariners to bridge the network communication between multiple member clusters. The current implementation relies on a specific network plugin. +4. How to solve the common functions such as cross-cluster stateful application update and capacity expansion and contraction, and provide more fine-grained update policies, such as realizing the function of Partition Update in member clusters. + +In order to better solve the above-mentioned problems, we need to introduce a new workload on Karmada to implement a cross-cluster version of “StatefulSet”. + +## Some early attempts at Xline + +Since the Karmada community has not yet discussed the implementation details of the new API, we have made some simple attempts to deploy, scale up and down, and update Xline under Karmada. The overall architecture of the program is as follows: + +![image](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image4.webp) + +In the overall architecture, we adopt a two-tier Operator approach, in the control plane of Karmada, we deploy a Karmada Xline Operator, which is responsible for interpreting and splitting some Xline resources defined in Karmada, and sending them to member clusters. The Xline Operator on the member cluster monitors the creation of the corresponding resource and then enters the Reconcile process to complete the operation. + +## Deployment + +Let’s take a look at a common deployment method for distributed application clusters under a single cluster (using etcd operator to deploy an etcd cluster as an example). etcd-operator can deploy an etcd cluster in two phases: + +1. Bootstrap: Create a seed node of etcd with an initial-cluster-state of new and a unique initial-clsuter-token. +2. Scale out: perform a member add on the seed cluster to update the cluster network topology, and then start a new etcd node with an updated network topology and an initial-cluster-state of existing. + +However, in the cross-cluster scenario, due to the lack of a globally standardized startup order for pods in different member clusters, Xline Operators in different member clusters will concurrently perform cluster expansion operations, which will adversely affect the membership change process of the consensus protocol. In order to bypass this problem, Xline adopts a static deployment method, as shown in the following figure: + +![image](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image5.webp) + +First of all, users need to define the corresponding resources on karmada to describe the cluster topology of a cross-cluster Xline cluster. karmada Xline Operator, after monitoring the resources being applied, will interpret and split the resources into the CR of XlineCluster on the member cluster, and then issue the CR of XlineCluster to the member cluster. The XlineCluster CR contains the number of replicas that should be created for the current member cluster, as well as the member cluster ids of the other clusters and the corresponding number of replicas. The Xline Operator on the member cluster, after monitoring the creation of the CR, will enter the Reconcile process to generate the DNS names of the other nodes in the Xline cluster using the issued cluster topology, and start the Xline Pod. + +In the early days of exploration, the static deployment approach bypassed the lack of a globally uniform startup order for application instances under Karmada’s multiple clusters because it did not involve a membership change in the deployment process. However, there is no silver bullet in the software industry, and the same is true for static deployments, which have some trade-offs as follows. The following table compares the characteristics of dynamic and static deployments in a single cluster vs. multi-cluster scenario: + +![image](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image6.webp) + +## Scaling Up and Down + +There are two specific types of scale in/out for stateful applications under Karmada: + +- Horizontal scale in/out — remove/add a member cluster and scale in/out nodes on it. +- Vertical scale in/out — scale in/out on existing member clusters. + +## Horizontal scale out + +![image](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image7.webp) + +As shown above, the overall process is as follows: + +1. Create the corresponding member cluster, configure the submariner network, and add it to Karmada for management. +2. Modify the Xline resources on Karmada, and add a new record \`member4: 4\` in the member cluster field to indicate that you want to expand 4 Xline resources on member4. +3. Karmada Xline Operator will split the resources and distribute them to member4. +4. Xline Operator on member4 receives the corresponding resources, enters the corresponding Reconcile process, calls the Xline client to execute member add, reaches a consensus, starts the new Xline Pod, and repeats the above process until the number of Xline replicas on member4 reaches the specified number. on member4 reaches the specified number + +## Vertical scale out + +![image](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image8.webp) + +For vertical scale out, the general process is also shown above: + +1. Modify the Xline resources on Karmada, e.g., specify that the Xline Pod in member1 should be expanded from 3 to 4 +2. Karmada Xline Operator will split the resource and distribute it to member1 +3. When Xline Operator on member1 receives the notification of resource modification, it enters the corresponding Reconcile process, calls the Xline client to perform member add, and then starts the new Xline Pod after consensus is reached, and repeats the above process until the number of replicas of Xline on member1 reaches the specified number. replicas of Xline on member1 reach the specified number + +Currently, because scale in/out inevitably involves a membership change process, and there is a lack of synchronization between member clusters under Karmada, there are limitations to the scale process: a horizontal scale out can only scale a cluster, and a vertical scale out can only scale a cluster on a specified member cluster. + +## Rolling updates + +![image](/xline-home/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image9.webp) + +For a rolling update, the general process is shown above: + +1. The user modifies the Xline resource on Karmada to change the Xline mirror version. +2. The Karmada Xline Operator splits the resource and distributes it to the member clusters. +3. The Xline Operator on the member cluster monitors the resource changes and enters the corresponding Reconcile process to perform a rolling update. The update process on the member cluster is no different from the update on a single cluster. + +Currently, the main supported update method is the default rolling update, but from the perspective of practical application scenarios, at least the following two issues need to be considered: + +1. The update process involves the stopping of old Xline nodes and the starting of new Xline nodes, which requires additional mechanisms to ensure that the update process is not unavailable. +2. More fine-grained update policies, such as Partition Update, should be supported; among multiple member clusters, priority should be given to updating clusters where only the follower exists, and when updating the member cluster where the leader resides, the leader should be transferred to the updated member cluster to avoid extreme situations where the leader frequently steps down due to rolling updates. + +## Conclusion + +Given the trend of multi-cloud and multi-cluster management and the nature of Xline’s business, the Karmada and Xline communities have formed a working group to promote stateful application management in Karmada multi-clusters. In order to solve the problem of managing stateful applications in Karmada multi-clusters more elegantly, we need to introduce a new Karmada workload, and since the Karmada community has not yet reached a consensus on the implementation details of the new workload, in the early stage of experimentation, Xline adopts a two-tier Operator approach, which is implemented through the Karmada Xline Operator to the Karmada Xline Operator. The Karmada Xline Operator interprets and splits the top-level resources and sends them to the member clusters, and then the Xline Operator on the member clusters tunes the resources. + +In this way, we have made some early attempts to deploy Xline on Karmada and explore rolling updates, and made some preliminary preparations for the development and design of the new Karmada StatefulSet workload in the future. + +## Xline Community Meeting + +In order to provide a more comprehensive overview of Xline’s progress and to promote the Xline community, we will be hosting an Xline community meeting at 8AM PT (USA Pacific) on \`March 29, 2024\` (11AM EST;11PM Beijing Time) + +The meeting will be held via zoom: **Meeting number:** 813 0547 8985 **Password**: 520159 **Link**: https://zoom.us/j/81305478985?pwd=PsnbMGQy1ZqxYyd67cAkaGROfnIoQa.1 +`,M1=Symbol.for("yaml.alias"),Im=Symbol.for("yaml.document"),xa=Symbol.for("yaml.map"),Z5=Symbol.for("yaml.pair"),Fi=Symbol.for("yaml.scalar"),Ps=Symbol.for("yaml.seq"),gr=Symbol.for("yaml.node.type"),wo=e=>!!e&&typeof e=="object"&&e[gr]===M1,Mc=e=>!!e&&typeof e=="object"&&e[gr]===Im,vo=e=>!!e&&typeof e=="object"&&e[gr]===xa,Nt=e=>!!e&&typeof e=="object"&&e[gr]===Z5,xt=e=>!!e&&typeof e=="object"&&e[gr]===Fi,zs=e=>!!e&&typeof e=="object"&&e[gr]===Ps;function Pt(e){if(e&&typeof e=="object")switch(e[gr]){case xa:case Ps:return!0}return!1}function Vt(e){if(e&&typeof e=="object")switch(e[gr]){case M1:case xa:case Fi:case Ps:return!0}return!1}const uF=e=>(xt(e)||Pt(e))&&!!e.anchor;class N1{constructor(t){Object.defineProperty(this,gr,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}}const Pn=Symbol("break visit"),J5=Symbol("skip children"),ti=Symbol("remove node");function Ea(e,t){const n=ek(t);Mc(e)?Zo(null,e.contents,n,Object.freeze([e]))===ti&&(e.contents=null):Zo(null,e,n,Object.freeze([]))}Ea.BREAK=Pn;Ea.SKIP=J5;Ea.REMOVE=ti;function Zo(e,t,n,r){const i=tk(e,t,n,r);if(Vt(i)||Nt(i))return nk(e,r,i),Zo(e,i,n,r);if(typeof i!="symbol"){if(Pt(t)){r=Object.freeze(r.concat(t));for(let a=0;ae.replace(/[!,[\]{}]/g,t=>dF[t]);class Sn{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Sn.defaultYaml,t),this.tags=Object.assign({},Sn.defaultTags,n)}clone(){const t=new Sn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Sn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Sn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Sn.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Sn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Sn.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[a,o]=r;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=t.match(/^(.*!)([^!]*)$/);i||n(`The ${t} tag has no suffix`);const a=this.tags[r];return a?a+decodeURIComponent(i):r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+hF(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(t&&r.length>0&&Vt(t.contents)){const a={};Ea(t.contents,(o,s)=>{Vt(s)&&s.tag&&(a[s.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(s=>s.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(` +`)}}Sn.defaultYaml={explicit:!1,version:"1.2"};Sn.defaultTags={"!!":"tag:yaml.org,2002:"};function rk(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ik(e){const t=new Set;return Ea(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function ak(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function fF(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i||(i=ik(e));const o=ak(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(xt(o.node)||Pt(o.node)))o.node.anchor=o.anchor;else{const s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:r}}class o0 extends N1{constructor(t){super(M1),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let n;return Ea(t,{Node:(r,i)=>{if(i===this)return Ea.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}const s=r.get(o);if(!s||s.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=ad(i,o,r)),s.count*s.aliasCount>a)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return s.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(rk(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function ad(e,t,n){if(wo(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Pt(t)){let r=0;for(const i of t.items){const a=ad(e,i,n);a>r&&(r=a)}return r}else if(Nt(t)){const r=ad(e,t.key,n),i=ad(e,t.value,n);return Math.max(r,i)}return 1}function ni(e,t,n){if(Array.isArray(e))return e.map((r,i)=>ni(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!uF(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}const ok=e=>!e||typeof e!="function"&&typeof e!="object";class je extends N1{constructor(t){super(Fi),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:ni(this.value,t,n)}toString(){return String(this.value)}}je.BLOCK_FOLDED="BLOCK_FOLDED";je.BLOCK_LITERAL="BLOCK_LITERAL";je.PLAIN="PLAIN";je.QUOTE_DOUBLE="QUOTE_DOUBLE";je.QUOTE_SINGLE="QUOTE_SINGLE";const pF="tag:yaml.org,2002:";function mF(e,t,n){if(t){const r=n.filter(a=>a.tag===t),i=r.find(a=>!a.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,e))&&!r.format})}function nc(e,t,n){var d,f;if(Mc(e)&&(e=e.contents),Vt(e))return e;if(Nt(e)){const p=(f=(d=n.schema[xa]).createNode)==null?void 0:f.call(d,n.schema,null,n);return p.items.push(e),p}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n;let l;if(r&&e&&typeof e=="object"){if(l=s.get(e),l)return l.anchor||(l.anchor=i(e)),new o0(l.anchor);l={anchor:null,node:null},s.set(e,l)}t!=null&&t.startsWith("!!")&&(t=pF+t.slice(2));let c=mF(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const p=new je(e);return l&&(l.node=p),p}c=e instanceof Map?o[xa]:Symbol.iterator in Object(e)?o[Ps]:o[xa]}a&&(a(c),delete n.onTagObj);const u=c!=null&&c.createNode?c.createNode(n.schema,e,n):new je(e);return t&&(u.tag=t),l&&(l.node=u),u}function Qd(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return nc(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const dl=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class s0 extends N1{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Vt(r)||Nt(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(dl(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(Pt(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,Qd(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(Pt(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&xt(a)?a.value:a:Pt(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Nt(n))return!1;const r=n.value;return r==null||t&&xt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return Pt(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(Pt(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,Qd(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}s0.maxFlowStringSingleLineLength=60;const gF=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ei(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const la=(e,t,n)=>e.endsWith(` +`)?Ei(n,t):n.includes(` +`)?` +`+Ei(n,t):(e.endsWith(" ")?"":" ")+n,sk="flow",Om="block",od="quoted";function l0(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;const l=Math.max(1+a,1+i-t.length);if(e.length<=l)return e;const c=[],u={};let d=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?c.push(0):d=i-r);let f,p,m=!1,h=-1,v=-1,y=-1;n===Om&&(h=Wv(e,h),h!==-1&&(d=h+l));for(let x;x=e[h+=1];){if(n===od&&x==="\\"){switch(v=h,e[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}y=h}if(x===` +`)n===Om&&(h=Wv(e,h)),d=h+l,f=void 0;else{if(x===" "&&p&&p!==" "&&p!==` +`&&p!==" "){const _=e[h+1];_&&_!==" "&&_!==` +`&&_!==" "&&(f=h)}if(h>=d)if(f)c.push(f),d=f+l,f=void 0;else if(n===od){for(;p===" "||p===" ";)p=x,x=e[h+=1],m=!0;const _=h>y+1?h-2:v-1;if(u[_])return e;c.push(_),u[_]=!0,d=_+l,f=void 0}else m=!0}p=x}if(m&&s&&s(),c.length===0)return e;o&&o();let w=e.slice(0,c[0]);for(let x=0;x({indentAtStart:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),u0=e=>/^(%|---|\.\.\.)/m.test(e);function yF(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,o=0;ar)return!0;if(o=a+1,i-o<=r)return!1}return!0}function Tl(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(u0(e)?" ":"");let o="",s=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(s,l)+"\\ ",l+=1,s=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(s,l);const u=n.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(l,6)}l+=5,s=l+1}break;case"n":if(r||n[l+2]==='"'||n.length +`;let d,f;for(f=n.length;f>0;--f){const E=n[f-1];if(E!==` +`&&E!==" "&&E!==" ")break}let p=n.substring(f);const m=p.indexOf(` +`);m===-1?d="-":n===p||m!==p.length-1?(d="+",a&&a()):d="",p&&(n=n.slice(0,-p.length),p[p.length-1]===` +`&&(p=p.slice(0,-1)),p=p.replace(/\n+(?!\n|$)/g,`$&${c}`));let h=!1,v,y=-1;for(v=0;v")+(h?c?"2":"1":"")+d;if(e&&(_+=" "+s(e.replace(/ ?[\r\n]+/g," ")),i&&i()),u)return n=n.replace(/\n+/g,`$&${c}`),`${_} +${c}${w}${n}${p}`;n=n.replace(/\n+/g,` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);const A=l0(`${w}${n}${p}`,c,Om,c0(r));return`${_} +${c}${A}`}function bF(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:l,indentStep:c,inFlow:u}=t;if(s&&/[\n[\]{},]/.test(a)||u&&/[[\]{},]/.test(a))return es(a,t);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(` +`)?es(a,t):sd(e,t,n,r);if(!s&&!u&&i!==je.PLAIN&&a.includes(` +`))return sd(e,t,n,r);if(u0(a)){if(l==="")return t.forceBlockIndent=!0,sd(e,t,n,r);if(s&&l===c)return es(a,t)}const d=a.replace(/\n+/g,`$& +${l}`);if(o){const f=h=>{var v;return h.default&&h.tag!=="tag:yaml.org,2002:str"&&((v=h.test)==null?void 0:v.test(d))},{compat:p,tags:m}=t.doc.schema;if(m.some(f)||p!=null&&p.some(f))return es(a,t)}return s?d:l0(d,l,sk,c0(t))}function Nc(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:s}=e;s!==je.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=je.QUOTE_DOUBLE);const l=u=>{switch(u){case je.BLOCK_FOLDED:case je.BLOCK_LITERAL:return i||a?es(o.value,t):sd(o,t,n,r);case je.QUOTE_DOUBLE:return Tl(o.value,t);case je.QUOTE_SINGLE:return Dm(o.value,t);case je.PLAIN:return bF(o,t,n,r);default:return null}};let c=l(s);if(c===null){const{defaultKeyType:u,defaultStringType:d}=t.options,f=i&&u||d;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}function lk(e,t){const n=Object.assign({blockQuote:!0,commentString:gF,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function wF(e,t){var i;if(t.tag){const a=e.filter(o=>o.tag===t.tag);if(a.length>0)return a.find(o=>o.format===t.format)??a[0]}let n,r;if(xt(t)){r=t.value;const a=e.filter(o=>{var s;return(s=o.identify)==null?void 0:s.call(o,r)});n=a.find(o=>o.format===t.format)??a.find(o=>!o.format)}else r=t,n=e.find(a=>a.nodeClass&&r instanceof a.nodeClass);if(!n){const a=((i=r==null?void 0:r.constructor)==null?void 0:i.name)??typeof r;throw new Error(`Tag not resolved for ${a} value`)}return n}function vF(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(xt(e)||Pt(e))&&e.anchor;a&&rk(a)&&(n.add(a),i.push(`&${a}`));const o=e.tag?e.tag:t.default?null:t.tag;return o&&i.push(r.directives.tagString(o)),i.join(" ")}function ho(e,t,n,r){var l;if(Nt(e))return e.toString(t,n,r);if(wo(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const a=Vt(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i||(i=wF(t.doc.schema.tags,a));const o=vF(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const s=typeof i.stringify=="function"?i.stringify(a,t,n,r):xt(a)?Nc(a,t,n,r):a.toString(t,n,r);return o?xt(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o} +${t.indent}${s}`:s}function xF({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:s,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=n;let f=Vt(e)&&e.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Pt(e)){const N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let p=!d&&(!e||f&&t==null&&!n.inFlow||Pt(e)||(xt(e)?e.type===je.BLOCK_FOLDED||e.type===je.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+l});let m=!1,h=!1,v=ho(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&v.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),v===""?"?":p?`? ${v}`:v}else if(a&&!d||t==null&&p)return v=`? ${v}`,f&&!m?v+=la(v,n.indent,c(f)):h&&i&&i(),v;m&&(f=null),p?(f&&(v+=la(v,n.indent,c(f))),v=`? ${v} +${s}:`):(v=`${v}:`,f&&(v+=la(v,n.indent,c(f))));let y,w,x;Vt(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&xt(t)&&(n.indentAtStart=v.length+1),h=!1,!u&&l.length>=2&&!n.inFlow&&!p&&zs(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const A=ho(t,n,()=>_=!0,()=>h=!0);let E=" ";if(f||y||w){if(E=y?` +`:"",w){const N=c(w);E+=` +${Ei(N,n.indent)}`}A===""&&!n.inFlow?E===` +`&&(E=` + +`):E+=` +${n.indent}`}else if(!p&&Pt(t)){const N=A[0],F=A.indexOf(` +`),q=F!==-1,K=n.inFlow??t.flow??t.items.length===0;if(q||!K){let W=!1;if(q&&(N==="&"||N==="!")){let X=A.indexOf(" ");N==="&"&&X!==-1&&Xe===Vv||xt(e)&&e.value===Vv&&(!e.type||e.type===je.PLAIN);function $f(e,t,n){const r=e&&wo(n)?n.resolve(e.doc):n;if(!vo(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,o]of i)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function SF(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Vt(e)&&n&&n.doc){const r=lk(n.doc,{});r.anchors=new Set;for(const a of n.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let a=JSON.stringify(i);a.length>40&&(a=a.substring(0,36)+'..."'),ck(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function I1(e,t,n){const r=nc(e,void 0,n),i=nc(t,void 0,n);return new yn(r,i)}class yn{constructor(t,n=null){Object.defineProperty(this,gr,{value:Z5}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Vt(n)&&(n=n.clone(t)),Vt(r)&&(r=r.clone(t)),new yn(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return uk(n,r,this)}toString(t,n,r){return t!=null&&t.doc?xF(this,t,n,r):JSON.stringify(this)}}function dk(e,t,n){return(t.inFlow??e.flow?EF:_F)(e,t,n)}function _F({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){const{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:a,type:null});let d=!1;const f=[];for(let m=0;mv=null,()=>d=!0);v&&(y+=la(y,a,c(v))),d&&v&&(d=!1),f.push(r+y)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;mx=null);yf||_.includes(` +`))&&(d=!0),p.push(_),f=p.length}let m;const{start:h,end:v}=r;if(p.length===0)m=h+v;else if(d||(d=p.reduce((w,x)=>w+x.length+2,2)>s0.maxFlowStringSingleLineLength),d){m=h;for(const y of p)m+=y?` +${s}${o}${y}`:` +`;m+=` +${o}${v}`}else m=`${h}${l}${p.join(" ")}${l}${v}`;return e&&(m+=la(m,c(e),o),a&&a()),m}function Zd({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Ei(t(r),e);n.push(a.trimStart())}}function Ga(e,t){const n=xt(t)?t.value:t;for(const r of e)if(Nt(r)&&(r.key===t||r.key===n||xt(r.key)&&r.key.value===n))return r}class cr extends s0{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(xa,t),this.items=[]}add(t,n){var o;let r;Nt(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new yn(t,t==null?void 0:t.value):r=new yn(t.key,t.value);const i=Ga(this.items,r.key),a=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);xt(i.value)&&ok(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const s=this.items.findIndex(l=>a(r,l)<0);s===-1?this.items.push(r):this.items.splice(s,0,r)}else this.items.push(r)}delete(t){const n=Ga(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Ga(this.items,t),i=r==null?void 0:r.value;return(!n&&xt(i)?i.value:i)??void 0}has(t){return!!Ga(this.items,t)}set(t,n){this.add(new yn(t,n),!0)}toJSON(t,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const a of this.items)uk(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Nt(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),dk(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}function CF(e,t,n){const{keepUndefined:r,replacer:i}=n,a=new cr(e),o=(s,l)=>{if(typeof i=="function")l=i.call(t,s,l);else if(Array.isArray(i)&&!i.includes(s))return;(l!==void 0||r)&&a.items.push(I1(s,l,n))};if(t instanceof Map)for(const[s,l]of t)o(s,l);else if(t&&typeof t=="object")for(const s of Object.keys(t))o(s,t[s]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}const Fs={collection:"map",createNode:CF,default:!0,nodeClass:cr,tag:"tag:yaml.org,2002:map",resolve(e,t){return vo(e)||t("Expected a mapping for this tag"),e}};class xo extends s0{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ps,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Au(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Au(t);if(typeof r!="number")return;const i=this.items[r];return!n&&xt(i)?i.value:i}has(t){const n=Au(t);return typeof n=="number"&&n=0?t:null}function TF(e,t,n){const{replacer:r}=n,i=new xo(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let o of t){if(typeof r=="function"){const s=t instanceof Set?o:String(a++);o=r.call(t,s,o)}i.items.push(nc(o,void 0,n))}}return i}const Bs={collection:"seq",createNode:TF,default:!0,nodeClass:xo,tag:"tag:yaml.org,2002:seq",resolve(e,t){return zs(e)||t("Expected a sequence for this tag"),e}},d0={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Nc(e,t,n,r)}},h0={identify:e=>e==null,createNode:()=>new je(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new je(null),stringify:({source:e},t)=>typeof e=="string"&&h0.test.test(e)?e:t.options.nullStr},O1={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new je(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&O1.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function Ur({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=t-(a.length-o-1);for(;s-- >0;)a+="0"}return a}const hk={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ur},fk={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Ur(e)}},pk={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new je(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ur},f0=e=>typeof e=="bigint"||Number.isInteger(e),D1=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function mk(e,t,n){const{value:r}=e;return f0(r)&&r>=0?n+r.toString(t):Ur(e)}const gk={identify:e=>f0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>D1(e,2,8,n),stringify:e=>mk(e,8,"0o")},yk={identify:f0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>D1(e,0,10,n),stringify:Ur},bk={identify:e=>f0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>D1(e,2,16,n),stringify:e=>mk(e,16,"0x")},AF=[Fs,Bs,d0,h0,O1,gk,yk,bk,hk,fk,pk];function Yv(e){return typeof e=="bigint"||Number.isInteger(e)}const Ru=({value:e})=>JSON.stringify(e),RF=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ru},{identify:e=>e==null,createNode:()=>new je(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ru},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>e==="true",stringify:Ru},{identify:Yv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Yv(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Ru}],MF={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},NF=[Fs,Bs].concat(RF,MF),L1={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Buffer=="function")return Buffer.from(e,"base64");if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new yn(new je(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} +${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment} +${a.comment}`:r.comment}r=i}e.items[n]=Nt(r)?r:new yn(r)}}else t("Expected a sequence for this tag");return e}function vk(e,t,n){const{replacer:r}=n,i=new xo(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let s,l;if(Array.isArray(o))if(o.length===2)s=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)s=c[0],l=o[s];else throw new TypeError(`Expected { key: value } tuple: ${o}`)}else s=o;i.items.push(I1(s,l,n))}return i}const P1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:wk,createNode:vk};class ds extends xo{constructor(){super(),this.add=cr.prototype.add.bind(this),this.delete=cr.prototype.delete.bind(this),this.get=cr.prototype.get.bind(this),this.has=cr.prototype.has.bind(this),this.set=cr.prototype.set.bind(this),this.tag=ds.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let a,o;if(Nt(i)?(a=ni(i.key,"",n),o=ni(i.value,a,n)):a=ni(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}}ds.tag="tag:yaml.org,2002:omap";const z1={collection:"seq",identify:e=>e instanceof Map,nodeClass:ds,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=wk(e,t),r=[];for(const{key:i}of n.items)xt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new ds,n)},createNode(e,t,n){const r=vk(e,t,n),i=new ds;return i.items=r.items,i}};function xk({value:e,source:t},n){return t&&(e?kk:Sk).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const kk={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new je(!0),stringify:xk},Sk={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new je(!1),stringify:xk},IF={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ur},OF={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Ur(e)}},DF={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new je(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Ur},Ic=e=>typeof e=="bigint"||Number.isInteger(e);function p0(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return i==="-"?-1*a:a}function F1(e,t,n){const{value:r}=e;if(Ic(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Ur(e)}const LF={identify:Ic,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>p0(e,2,2,n),stringify:e=>F1(e,2,"0b")},PF={identify:Ic,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>p0(e,1,8,n),stringify:e=>F1(e,8,"0")},zF={identify:Ic,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>p0(e,0,10,n),stringify:Ur},FF={identify:Ic,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>p0(e,2,16,n),stringify:e=>F1(e,16,"0x")};class hs extends cr{constructor(t){super(t),this.tag=hs.tag}add(t){let n;Nt(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new yn(t.key,null):n=new yn(t,null),Ga(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ga(this.items,t);return!n&&Nt(r)?xt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Ga(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new yn(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}}hs.tag="tag:yaml.org,2002:set";const B1={collection:"map",identify:e=>e instanceof Set,nodeClass:hs,default:!1,tag:"tag:yaml.org,2002:set",resolve(e,t){if(vo(e)){if(e.hasAllNullValues(!0))return Object.assign(new hs,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e},createNode(e,t,n){const{replacer:r}=n,i=new hs(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof r=="function"&&(a=r.call(t,a,a)),i.items.push(I1(a,null,n));return i}};function $1(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,s)=>o*i(60)+i(s),i(0));return n==="-"?i(-1)*a:a}function _k(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Ur(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(o=>o<10?"0"+String(o):String(o)).join(":").replace(/000000\d*$/,"")}const Ek={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>$1(e,n),stringify:_k},Ck={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>$1(e,!1),stringify:_k},m0={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(m0.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,s]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,i,a||0,o||0,s||0,l);const u=t[8];if(u&&u!=="Z"){let d=$1(u,!1);Math.abs(d)<30&&(d*=60),c-=6e4*d}return new Date(c)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Xv=[Fs,Bs,d0,h0,kk,Sk,LF,PF,zF,FF,IF,OF,DF,L1,z1,P1,B1,Ek,Ck,m0],Kv=new Map([["core",AF],["failsafe",[Fs,Bs,d0]],["json",NF],["yaml11",Xv],["yaml-1.1",Xv]]),Gv={binary:L1,bool:O1,float:pk,floatExp:fk,floatNaN:hk,floatTime:Ck,int:yk,intHex:bk,intOct:gk,intTime:Ek,map:Fs,null:h0,omap:z1,pairs:P1,seq:Bs,set:B1,timestamp:m0},BF={"tag:yaml.org,2002:binary":L1,"tag:yaml.org,2002:omap":z1,"tag:yaml.org,2002:pairs":P1,"tag:yaml.org,2002:set":B1,"tag:yaml.org,2002:timestamp":m0};function Uf(e,t){let n=Kv.get(t);if(!n)if(Array.isArray(e))n=[];else{const r=Array.from(Kv.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)n=n.concat(r);else typeof e=="function"&&(n=e(n.slice()));return n.map(r=>{if(typeof r!="string")return r;const i=Gv[r];if(i)return i;const a=Object.keys(Gv).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${r}"; use one of ${a}`)})}const $F=(e,t)=>e.keyt.key?1:0;let Tk=class Ak{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(t)?Uf(t,"compat"):t?Uf(null,t):null,this.merge=!!r,this.name=typeof a=="string"&&a||"core",this.knownTags=i?BF:{},this.tags=Uf(n,this.name),this.toStringOptions=s??null,Object.defineProperty(this,xa,{value:Fs}),Object.defineProperty(this,Fi,{value:d0}),Object.defineProperty(this,Ps,{value:Bs}),this.sortMapEntries=typeof o=="function"?o:o===!0?$F:null}clone(){const t=Object.create(Ak.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function UF(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=lk(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=a(e.commentBefore);n.unshift(Ei(c,""))}let o=!1,s=null;if(e.contents){if(Vt(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const d=a(e.contents.commentBefore);n.push(Ei(d,""))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}const c=s?void 0:()=>o=!0;let u=ho(e.contents,i,()=>s=null,c);s&&(u+=la(u,"",a(s))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(ho(e.contents,i));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const c=a(e.comment);c.includes(` +`)?(n.push("..."),n.push(Ei(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&n[n.length-1]!==""&&n.push(""),n.push(Ei(a(c),"")))}return n.join(` +`)+` +`}function hl(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;itypeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:c,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=fF(this,o||"a"),m={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},h=nc(t,u,m);return s&&Pt(h)&&(h.flow=!0),f(),h}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new yn(i,a)}delete(t){return Mo(this.contents)?this.contents.delete(t):!1}deleteIn(t){return dl(t)?this.contents==null?!1:(this.contents=null,!0):Mo(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Pt(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return dl(t)?!n&&xt(this.contents)?this.contents.value:this.contents:Pt(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Pt(this.contents)?this.contents.has(t):!1}hasIn(t){return dl(t)?this.contents!==void 0:Pt(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Qd(this.schema,[t],n):Mo(this.contents)&&this.contents.set(t,n)}setIn(t,n){dl(t)?this.contents=n:this.contents==null?this.contents=Qd(this.schema,Array.from(t),n):Mo(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Sn({version:"1.1"}),r={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Sn({version:t}),r={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Tk(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:o}={}){const s={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100,stringify:ho},l=ni(this.contents,n??"",s);if(typeof a=="function")for(const{count:c,res:u}of s.anchors.values())a(u,c);return typeof o=="function"?hl(o,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return UF(this,t)}}function Mo(e){if(Pt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class U1 extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class Qa extends U1{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Rk extends U1{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const Jd=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(s=>t.linePos(s));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const s=Math.min(a-39,o.length-79);o="…"+o.substring(s),a-=s-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let s=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);s.length>80&&(s=s.substring(0,79)+`… +`),o=s+o}if(/[^ ]/.test(o)){let s=1;const l=n.linePos[1];l&&l.line===r&&l.col>i&&(s=Math.min(l.col-i,80-a));const c=" ".repeat(a)+"^".repeat(s);n.message+=`: + +${o} +${c} +`}};function Ts(e,{flow:t,indicator:n,next:r,offset:i,onError:a,startOnNewline:o}){let s=!1,l=o,c=o,u="",d="",f=!1,p=!1,m=!1,h=null,v=null,y=null,w=null,x=null;for(const E of e)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&a(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),E.type){case"space":!t&&l&&n!=="doc-start"&&E.source[0]===" "&&a(E,"TAB_AS_INDENT","Tabs are not allowed as indentation"),c=!0;break;case"comment":{c||a(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const N=E.source.substring(1)||" ";u?u+=d+N:u=N,d="",l=!1;break}case"newline":l?u?u+=E.source:s=!0:d+=E.source,l=!0,f=!0,(h||v)&&(p=!0),c=!0;break;case"anchor":h&&a(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&a(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=E,x===null&&(x=E.offset),l=!1,c=!1,m=!0;break;case"tag":{v&&a(E,"MULTIPLE_TAGS","A node can have at most one tag"),v=E,x===null&&(x=E.offset),l=!1,c=!1,m=!0;break}case n:(h||v)&&a(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),w&&a(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),w=E,l=!1,c=!1;break;case"comma":if(t){y&&a(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),y=E,l=!1,c=!1;break}default:a(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,c=!1}const _=e[e.length-1],A=_?_.offset+_.source.length:i;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:y,found:w,spaceBefore:s,comment:u,hasNewline:f,hasNewlineAfterProp:p,anchor:h,tag:v,end:A,start:x??A}}function rc(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` +`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(rc(t.key)||rc(t.value))return!0}return!1;default:return!0}}function Lm(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&rc(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Mk(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||xt(a)&&xt(o)&&a.value===o.value&&!(a.value==="<<"&&e.schema.merge);return t.some(a=>i(a.key,n))}const Qv="All mapping items must start at the same column";function jF({composeNode:e,composeEmptyNode:t},n,r,i){var l;const a=new cr(n.schema);n.atRoot&&(n.atRoot=!1);let o=r.offset,s=null;for(const c of r.items){const{start:u,key:d,sep:f,value:p}=c,m=Ts(u,{indicator:"explicit-key-ind",next:d??(f==null?void 0:f[0]),offset:o,onError:i,startOnNewline:!0}),h=!m.found;if(h){if(d&&(d.type==="block-seq"?i(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==r.indent&&i(o,"BAD_INDENT",Qv)),!m.anchor&&!m.tag&&!f){s=m.end,m.comment&&(a.comment?a.comment+=` +`+m.comment:a.comment=m.comment);continue}(m.hasNewlineAfterProp||rc(d))&&i(d??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((l=m.found)==null?void 0:l.indent)!==r.indent&&i(o,"BAD_INDENT",Qv);const v=m.end,y=d?e(n,d,m,i):t(n,v,u,null,m,i);n.schema.compat&&Lm(r.indent,d,i),Mk(n,a.items,y)&&i(v,"DUPLICATE_KEY","Map keys must be unique");const w=Ts(f??[],{indicator:"map-value-ind",next:p,offset:y.range[2],onError:i,startOnNewline:!d||d.type==="block-scalar"});if(o=w.end,w.found){h&&((p==null?void 0:p.type)==="block-map"&&!w.hasNewline&&i(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.starte&&(e.type==="block-map"||e.type==="block-seq");function HF({composeNode:e,composeEmptyNode:t},n,r,i){const a=r.start.source==="{",o=a?"flow map":"flow sequence",s=a?new cr(n.schema):new xo(n.schema);s.flow=!0;const l=n.atRoot;l&&(n.atRoot=!1);let c=r.offset+r.start.source.length;for(let m=0;m0){const m=Oc(f,p,n.options.strict,i);m.comment&&(s.comment?s.comment+=` +`+m.comment:s.comment=m.comment),s.range=[r.offset,p,m.offset]}else s.range=[r.offset,p,p];return s}function WF(e,t,n,r,i){let a;switch(n.type){case"block-map":{a=jF(e,t,n,i);break}case"block-seq":{a=qF(e,t,n,i);break}case"flow-collection":{a=HF(e,t,n,i);break}}if(!r)return a;const o=t.directives.tagName(r.source,f=>i(r,"TAG_RESOLVE_FAILED",f));if(!o)return a;const s=a.constructor;if(o==="!"||o===s.tagName)return a.tag=s.tagName,a;const l=vo(a)?"map":"seq";let c=t.schema.tags.find(f=>f.collection===l&&f.tag===o);if(!c){const f=t.schema.knownTags[o];if(f&&f.collection===l)t.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),a.tag=o,a}const u=c.resolve(a,f=>i(r,"TAG_RESOLVE_FAILED",f),t.options),d=Vt(u)?u:new je(u);return d.range=a.range,d.tag=o,c!=null&&c.format&&(d.format=c.format),d}function Nk(e,t,n){const r=e.offset,i=VF(e,t,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?je.BLOCK_FOLDED:je.BLOCK_LITERAL,o=e.source?YF(e.source):[];let s=o.length;for(let h=o.length-1;h>=0;--h){const v=o[h][1];if(v===""||v==="\r")s=h;else break}if(s===0){const h=i.chomp==="+"&&o.length>0?` +`.repeat(Math.max(1,o.length-1)):"";let v=r+i.length;return e.source&&(v+=e.source.length),{value:h,type:a,comment:i.comment,range:[r,v,v]}}let l=e.indent+i.indent,c=e.offset+i.length,u=0;for(let h=0;hl&&(l=v.length);else{if(v.length=s;--h)o[h][0].length>l&&(s=h+1);let d="",f="",p=!1;for(let h=0;hl||y[0]===" "?(f===" "?f=` +`:!p&&f===` +`&&(f=` + +`),d+=f+v.slice(l)+y,f=` +`,p=!0):y===""?f===` +`?d+=` +`:f=` +`:(d+=f+y,f=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let h=s;hn(r+f,p,m);switch(i){case"scalar":s=je.PLAIN,l=XF(a,c);break;case"single-quoted-scalar":s=je.QUOTE_SINGLE,l=KF(a,c);break;case"double-quoted-scalar":s=je.QUOTE_DOUBLE,l=GF(a,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const u=r+a.length,d=Oc(o,u,t,n);return{value:l,type:s,comment:d.comment,range:[r,u,d.offset]}}function XF(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Ok(e)}function KF(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Ok(e.slice(1,-1)).replace(/''/g,"'")}function Ok(e){let t,n;try{t=new RegExp(`(.*?)(?a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function QF(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` +`||r==="\r")&&!(r==="\r"&&e[t+2]!==` +`);)r===` +`&&(n+=` +`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const ZF={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` +`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function JF(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const s=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}return String.fromCodePoint(o)}function Dk(e,t,n,r){const{value:i,type:a,comment:o,range:s}=t.type==="block-scalar"?Nk(t,e.options.strict,r):Ik(t,e.options.strict,r),l=n?e.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,c=n&&l?eB(e.schema,i,l,n,r):t.type==="scalar"?tB(e,i,t,r):e.schema[Fi];let u;try{const d=c.resolve(i,f=>r(n??t,"TAG_RESOLVE_FAILED",f),e.options);u=xt(d)?d:new je(d)}catch(d){const f=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",f),u=new je(i)}return u.range=s,u.source=i,a&&(u.type=a),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function eB(e,t,n,r,i){var s;if(n==="!")return e[Fi];const a=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)a.push(l);else return l;for(const l of a)if((s=l.test)!=null&&s.test(t))return l;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Fi])}function tB({directives:e,schema:t},n,r,i){const a=t.tags.find(o=>{var s;return o.default&&((s=o.test)==null?void 0:s.test(n))})||t[Fi];if(t.compat){const o=t.compat.find(s=>{var l;return s.default&&((l=s.test)==null?void 0:l.test(n))})??t[Fi];if(a.tag!==o.tag){const s=e.tagString(a.tag),l=e.tagString(o.tag),c=`Value may be parsed as either ${s} or ${l}`;i(r,"TAG_RESOLVE_FAILED",c,!0)}}return a}function nB(e,t,n){if(t){n===null&&(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];(i==null?void 0:i.type)==="space";)e+=i.source.length,i=t[++r];break}}return e}const rB={composeNode:Lk,composeEmptyNode:j1};function Lk(e,t,n,r){const{spaceBefore:i,comment:a,anchor:o,tag:s}=n;let l,c=!0;switch(t.type){case"alias":l=iB(e,t,r),(o||s)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Dk(e,t,s,r),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=WF(rB,e,t,s,r),o&&(l.anchor=o.source.substring(1));break;default:{const u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",u),l=j1(e,t.offset,void 0,null,n,r),c=!1}}return o&&l.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(l.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?l.comment=a:l.commentBefore=a),e.options.keepSourceTokens&&c&&(l.srcToken=t),l}function j1(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:l},c){const u={type:"scalar",offset:nB(t,n,r),indent:-1,source:""},d=Dk(e,u,s,c);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),a&&(d.comment=a,d.range[2]=l),d}function iB({options:e},{offset:t,source:n,end:r},i){const a=new o0(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,s=Oc(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function aB(e,t,{offset:n,start:r,value:i,end:a},o){const s=Object.assign({_directives:t},e),l=new $s(void 0,s),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Ts(r,{indicator:"doc-start",next:i??(a==null?void 0:a[0]),offset:n,onError:o,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Lk(c,i,u,o):j1(c,u.end,r,null,u,o);const d=l.contents.range[2],f=Oc(a,d,!1,o);return f.comment&&(l.comment=f.comment),l.range=[n,d,f.offset],l}function il(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Zv(e){var i;let t="",n=!1,r=!1;for(let a=0;a{const o=il(n);a?this.warnings.push(new Rk(o,r,i)):this.errors.push(new Qa(o,r,i))},this.directives=new Sn({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=Zv(this.prelude);if(r){const a=t.contents;if(n)t.comment=t.comment?`${t.comment} +${r}`:r;else if(i||t.directives.docStart||!a)t.commentBefore=r;else if(Pt(a)&&!a.flow&&a.items.length>0){let o=a.items[0];Nt(o)&&(o=o.key);const s=o.commentBefore;o.commentBefore=s?`${r} +${s}`:r}else{const o=a.commentBefore;a.commentBefore=o?`${r} +${o}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Zv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const a=il(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=aB(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Qa(il(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Qa(il(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Oc(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Qa(il(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),i=new $s(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}function oB(e,t=!0,n){if(e){const r=(i,a,o)=>{const s=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(s,a,o);else throw new Qa([s,s+1],a,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ik(e,t,r);case"block-scalar":return Nk(e,t,r)}}return null}function sB(e,t){const{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:a=-1,type:o="PLAIN"}=t,s=Nc({type:o,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:r,source:` +`}];switch(s[0]){case"|":case">":{const c=s.indexOf(` +`),u=s.substring(0,c),d=s.substring(c+1)+` +`,f=[{type:"block-scalar-header",offset:a,indent:r,source:u}];return Pk(f,l)||f.push({type:"newline",offset:-1,indent:r,source:` +`}),{type:"block-scalar",offset:a,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:a,indent:r,source:s,end:l};case"'":return{type:"single-quoted-scalar",offset:a,indent:r,source:s,end:l};default:return{type:"scalar",offset:a,indent:r,source:s,end:l}}}function lB(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:a=!1,type:o}=n,s="indent"in e?e.indent:null;if(r&&typeof s=="number"&&(s+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Nc({type:o,value:t},{implicitKey:i||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":cB(e,l);break;case'"':Hf(e,l,"double-quoted-scalar");break;case"'":Hf(e,l,"single-quoted-scalar");break;default:Hf(e,l,"scalar")}}function cB(e,t){const n=t.indexOf(` +`),r=t.substring(0,n),i=t.substring(n+1)+` +`;if(e.type==="block-scalar"){const a=e.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=r,e.source=i}else{const{offset:a}=e,o="indent"in e?e.indent:-1,s=[{type:"block-scalar-header",offset:a,indent:o,source:r}];Pk(s,"end"in e?e.end:void 0)||s.push({type:"newline",offset:-1,indent:o,source:` +`});for(const l of Object.keys(e))l!=="type"&&l!=="offset"&&delete e[l];Object.assign(e,{type:"block-scalar",indent:o,props:s,source:i})}}function Pk(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function Hf(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const r=e.props.slice(1);let i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(const a of r)a.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{const i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:` +`};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{const r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(const a of Object.keys(e))a!=="type"&&a!=="offset"&&delete e[a];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}const uB=e=>"type"in e?eh(e):ld(e);function eh(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=eh(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=ld(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=ld(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=ld(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function ld({start:e,key:t,sep:n,value:r}){let i="";for(const a of e)i+=a.source;if(t&&(i+=eh(t)),n)for(const a of n)i+=a.source;return r&&(i+=eh(r)),i}const Pm=Symbol("break visit"),dB=Symbol("skip children"),zk=Symbol("remove item");function fo(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),Fk(Object.freeze([]),e,t)}fo.BREAK=Pm;fo.SKIP=dB;fo.REMOVE=zk;fo.itemAtPath=(e,t)=>{let n=e;for(const[r,i]of t){const a=n==null?void 0:n[r];if(a&&"items"in a)n=a.items[i];else return}return n};fo.parentCollection=(e,t)=>{const n=fo.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n==null?void 0:n[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Fk(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(const i of["key","value"]){const a=t[i];if(a&&"items"in a){for(let o=0;o!!e&&"items"in e,fB=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function pB(e){switch(e){case g0:return"";case y0:return"";case b0:return"";case ic:return"";default:return JSON.stringify(e)}}function Bk(e){switch(e){case g0:return"byte-order-mark";case y0:return"doc-mode";case b0:return"flow-error-end";case ic:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`:case`\r +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const mB=Object.freeze(Object.defineProperty({__proto__:null,BOM:g0,DOCUMENT:y0,FLOW_END:b0,SCALAR:ic,createScalarToken:sB,isCollection:hB,isScalar:fB,prettyToken:pB,resolveAsScalar:oB,setScalarValue:lB,stringify:uB,tokenType:Bk,visit:fo},Symbol.toStringTag,{value:"Module"}));function rr(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const Jv="0123456789ABCDEFabcdef".split(""),gB="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""),Wf=",[]{}".split(""),yB=` ,[]{} +\r `.split(""),Vf=e=>!e||yB.includes(e);let $k=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){t&&(this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null),this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`?!0:n==="\r"?this.buffer[t+1]===` +`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i===` +`||!i&&!this.atEnd)return t+r+1}return n===` +`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&rr(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!rr(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&rr(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Vf),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>rr(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case` +`:t=i,n=0;break;case"\r":{const a=this.buffer[i+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===` +`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext+=this.blockScalarIndent;do{const i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(` +`,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}if(!this.blockScalarKeep)do{let i=t-1,a=this.buffer[i];a==="\r"&&(a=this.buffer[--i]);const o=i;for(;a===" "||a===" ";)a=this.buffer[--i];if(a===` +`&&i>=this.pos&&i+1+n>o)t=i;else break}while(!0);return yield ic,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const a=this.buffer[r+1];if(rr(a)||t&&a===",")break;n=r}else if(rr(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===` +`?(r+=1,i=` +`,a=this.buffer[r+1]):n=r),a==="#"||t&&Wf.includes(a))break;if(i===` +`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&Wf.includes(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ic,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Vf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(rr(n)||t&&Wf.includes(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!rr(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(gB.includes(n))n=this.buffer[++t];else if(n==="%"&&Jv.includes(this.buffer[t+1])&&Jv.includes(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` +`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};class Uk{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[a]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function t4(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Tr(t.start,"explicit-key-ind")&&!Tr(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,jk(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}let H1=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new $k,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=Bk(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(!t||t.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(n)if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&t4(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!Tr(i.start,"explicit-key-ind");return}break}case"block-seq":{const i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&e4(i.start)===-1&&(n.indent===0||i.start.every(a=>a.type!=="comment"||a.indent=t.indent){const i=!this.onKeyLine&&this.indent===t.indent&&n.sep;let a=[];if(i&&n.sep&&!n.value){const o=[];for(let s=0;st.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!Tr(n.start,"explicit-key-ind")?n.start.push(this.sourceToken):i||n.value?(a.push(this.sourceToken),t.items.push({start:a})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}),this.onKeyLine=!0;return;case"map-value-ind":if(Tr(n.start,"explicit-key-ind"))if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Tr(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(jk(n.key)&&!Tr(n.sep,"newline")){const o=No(n.start),s=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:l}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Tr(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=No(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Tr(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){i&&o.type!=="block-seq"&&Tr(n.start,"explicit-key-ind")&&t.items.push({start:a}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0,a=Array.isArray(i)?i[i.length-1]:void 0;(a==null?void 0:a.type)==="comment"?i==null||i.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2],a=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(a)){Array.prototype.push.apply(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Tr(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=Mu(r),a=No(i);t4(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Mu(t),r=No(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Mu(t),r=No(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function qk(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Uk||null,prettyErrors:t}}function bB(e,t={}){const{lineCounter:n,prettyErrors:r}=qk(t),i=new H1(n==null?void 0:n.addNewLine),a=new q1(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const s of o)s.errors.forEach(Jd(e,n)),s.warnings.forEach(Jd(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Hk(e,t={}){const{lineCounter:n,prettyErrors:r}=qk(t),i=new H1(n==null?void 0:n.addNewLine),a=new q1(t);let o=null;for(const s of a.compose(i.parse(e),!0,e.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new Qa(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Jd(e,n)),o.warnings.forEach(Jd(e,n))),o}function wB(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);const i=Hk(e,n);if(!i)return null;if(i.warnings.forEach(a=>ck(i.options.logLevel,a)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function vB(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){const{keepUndefined:i}=n??t??{};if(!i)return}return new $s(e,r,n).toString(n)}const zm=Object.freeze(Object.defineProperty({__proto__:null,Alias:o0,CST:mB,Composer:q1,Document:$s,Lexer:$k,LineCounter:Uk,Pair:yn,Parser:H1,Scalar:je,Schema:Tk,YAMLError:U1,YAMLMap:cr,YAMLParseError:Qa,YAMLSeq:xo,YAMLWarning:Rk,isAlias:wo,isCollection:Pt,isDocument:Mc,isMap:vo,isNode:Vt,isPair:Nt,isScalar:xt,isSeq:zs,parse:wB,parseAllDocuments:bB,parseDocument:Hk,stringify:vB,visit:Ea,visitAsync:a0},Symbol.toStringTag,{value:"Module"})),xB=L.div` + display: flex; + align-items: center; + justify-content: center; + height: calc(86px + 416px); + padding-top: 86px; + background: #0a0c28; + @media screen and (max-width: 1024px) { + padding-top: 69px; + height: calc(312px + 69px); + } + @media screen and (max-width: 1024px) { + padding-top: 53px; + height: calc(208px + 53px); + } +`,kB=L.h1` + position: relative; + display: inline-block; + padding-inline: 32px; + color: white; + font-weight: 700; + font-size: 72px; + line-height: 1.5; + text-transform: capitalize; + transform: translateY(-10%); + @media screen and (max-width: 1024px) { + padding-inline: 24px; + font-size: 54px; + } + @media screen and (max-width: 768px) { + padding-inline: 16px; + font-size: 36px; + } +`,SB=L.img` + z-index: -1; + position: absolute; + left: 50%; + bottom: -17px; + transform: translateX(-45%); + width: 295.01px; + height: 35.35px; + @media screen and (max-width: 1024px) { + bottom: -12%; + width: 221px; + height: 27px; + } + @media screen and (max-width: 768px) { + bottom: -8%; + width: 148px; + height: 18px; + } +`,_B=L.main` + display: flex; + margin-inline: auto; + padding-block: ${e=>e.theme.scale.scale06}; + padding-inline: ${e=>e.theme.scale.scale07}; + max-width: ${e=>e.theme.scale.scale12}; + // - - - + /* height: 200px; + background-color: lightcoral; */ + @media screen and (max-width: 1024px) { + padding-block: 60px; + padding-inline: 96px; + } + @media screen and (max-width: 768px) { + padding-block: 40px; + padding-inline: 64px; + } +`,EB=L.div` + flex-shrink: 0; + width: ${e=>e.theme.scale.scale08}; + margin-right: ${e=>e.theme.scale.scale06}; + padding-block: ${e=>e.theme.scale.scale07}; + // - - - + /* height: 100px; + background-color: lightblue; */ + @media screen and (max-width: 1440px) { + display: none; + } +`,CB=L.p` + margin-bottom: ${e=>e.theme.scale.scale04}; + color: #a6a6a6; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize4}; + line-height: ${e=>e.theme.font.lineHeight4}; +`,TB=L(Oa)` + display: block; + margin-bottom: ${e=>e.theme.scale.scale03}; + padding: ${e=>e.theme.scale.scale03}; + color: #454545; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize3}; + line-height: ${e=>e.theme.font.lineHeight3}; + border: 1px solid #dfdfdf; + border-radius: ${e=>e.theme.scale.scale01}; + box-shadow: 5px 5px 15px -5px ${e=>e.theme.color.neutral.gray06}; +`,AB=L.div` + display: flex; + flex-flow: wrap; + justify-content: space-between; + /* flex: 1; */ + /* padding-inline: ${e=>e.theme.scale.scale05}; */ + // - - - + /* min-height: 100px; + background-color: lightcyan; */ + @media screen and (max-width: 1024px) { + flex-direction: column; + } +`,RB=L.div` + width: 48%; + margin-bottom: ${e=>e.theme.scale.scale04}; + border: 1px solid #dfdfdf; + border-radius: ${e=>e.theme.scale.scale03}; + box-shadow: 5px 5px 15px -5px ${e=>e.theme.color.neutral.gray06}; + overflow: hidden; + // - - - + /* height: 400px; */ + /* background: lightpink; */ + @media screen and (max-width: 1024px) { + width: 100%; + } +`,MB=L.img` + width: 100%; + /* height: ${e=>e.theme.scale.scale08}; */ +`,NB=L.div` + padding: ${e=>e.theme.scale.scale03}; + // - - - + /* height: 100px; */ + @media screen and (max-width: 1024px) { + padding: 15px; + } + @media screen and (max-width: 768px) { + padding: 10px; + } +`,IB=L.h1` + margin-bottom: ${e=>e.theme.scale.scale03}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize4}; + /* line-height: ${e=>e.theme.font.lineHeight4}; */ + line-height: 1.5; + /* white-space: nowrap; */ + overflow: hidden; + text-overflow: ellipsis; + /* text-transform: capitalize; */ + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 15px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 10px; + } +`,OB=L.p` + display: -webkit-box; + margin-bottom: ${e=>e.theme.scale.scale03}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize3}; + /* line-height: ${e=>e.theme.font.lineHeight3}; */ + line-height: 1.5; + /* word-break: break-all; */ + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + overflow: hidden; + text-overflow: ellipsis; + word-wrap: nowrap; + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 12px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 8px; + } +`,DB=L(Oa)` + display: inline-block; + margin-bottom: ${e=>e.theme.scale.scale01}; + padding-block: ${e=>e.theme.scale.scale01}; + padding-inline: ${e=>e.theme.scale.scale04}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize2}; + /* line-height: ${e=>e.theme.font.lineHeight2}; */ + line-height: 1.5; + background: linear-gradient(90deg, #767ee5, #9966cc); + border-radius: 20px; + @media screen and (max-width: 1024px) { + margin-bottom: 6px; + padding-block: 6px; + padding-inline: 24px; + font-size: 10.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 4px; + padding-block: 4px; + padding-inline: 16px; + font-size: 7px; + } +`,Yf=Object.assign({"/src/blog/2023-01-07-Curp:-Revisit-the-Consensus-Protocol.md":B5,"/src/blog/2023-02-19-Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness.md":$5,"/src/blog/2023-03-10-How-to-Elegantly-Organize-Async-Rust-Code.md":U5,"/src/blog/2023-04-19-Database-Isolation-Levels-and-MVCC.md":j5,"/src/blog/2023-05-21-The-design-and-Implementation-of-the-Xline-Persistent-Storage-Layer.md":q5,"/src/blog/2023-08-18-Introduction-to-CURP-Protocol.md":H5,"/src/blog/2023-09-23-Mechanism-and-Implementation-of-Lease.md":W5,"/src/blog/2023-11-01-Implementation-of-CURP-Server.md":V5,"/src/blog/2023-12-13-CURP-State-Machine-Engine.md":Y5,"/src/blog/2024-01-04-Xline-Command-Deduplication-Mechanism-(Part-One)—Introduction-to-RIFL.md":X5,"/src/blog/2024-02-06-Analysis-of-Xline-Jepsen-Tests.md":K5,"/src/blog/2024-03-13-Membership-Change-Source-Code-Interpretation.md":G5,"/src/blog/2024-03-22-Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada.md":Q5}),LB=()=>(ce.useEffect(()=>{window.scrollTo(0,0)},[]),k.jsxs(k.Fragment,{children:[k.jsx(xB,{children:k.jsxs(kB,{children:["blog",k.jsx(SB,{src:Wi,alt:"underline"})]})}),k.jsxs(_B,{children:[k.jsxs(EB,{children:[k.jsx(CB,{children:"Blog"}),Object.keys(Yf).map(e=>{const t=e.split(/[/,.]/),[n,r,i,...a]=t[3].split("-"),o=a.join(" "),s=t[3];return k.jsx(TB,{to:s,children:o},o)})]}),k.jsx(AB,{children:Object.keys(Yf).reverse().map((e,t)=>{const n=e.split(/[/,.]/),r=n[3],[i,a,o,...s]=n[3].split("-"),l=s.join(" ");console.log(l);const[c,u,d,f]=Yf[e].split(`--- +`),p=zm.parse(u);return k.jsxs(RB,{children:[k.jsx(MB,{src:p.cover,alt:"cover"}),k.jsxs(NB,{children:[k.jsx(IB,{children:l}),k.jsx(OB,{children:d}),k.jsx(DB,{to:r,children:"Read more"})]})]},t)})})]})]}));//! moment.js +//! version : 2.29.4 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +var Wk;function pe(){return Wk.apply(null,arguments)}function PB(e){Wk=e}function Br(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function no(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function ot(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function W1(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(ot(e,t))return!1;return!0}function In(e){return e===void 0}function Bi(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Dc(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Vk(e,t){var n=[],r,i=e.length;for(r=0;r>>0,r;for(r=0;r0)for(n=0;n=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var K1=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Nu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Kf={},fs={};function Re(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(fs[e]=i),t&&(fs[t[0]]=function(){return oi(i.apply(this,arguments),t[1],t[2])}),n&&(fs[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function UB(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function jB(e){var t=e.match(K1),n,r;for(n=0,r=t.length;n=0&&Nu.test(e);)e=e.replace(Nu,r),Nu.lastIndex=0,n-=1;return e}var qB={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function HB(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(K1).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var WB="Invalid date";function VB(){return this._invalidDate}var YB="%d",XB=/\d{1,2}/;function KB(e){return this._ordinal.replace("%d",e)}var GB={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function QB(e,t,n,r){var i=this._relativeTime[n];return ui(i)?i(e,t,n,r):i.replace(/%d/i,e)}function ZB(e,t){var n=this._relativeTime[e>0?"future":"past"];return ui(n)?n(t):n.replace(/%s/i,t)}var Al={};function vn(e,t){var n=e.toLowerCase();Al[n]=Al[n+"s"]=Al[t]=e}function Sr(e){return typeof e=="string"?Al[e]||Al[e.toLowerCase()]:void 0}function G1(e){var t={},n,r;for(r in e)ot(e,r)&&(n=Sr(r),n&&(t[n]=e[r]));return t}var Gk={};function xn(e,t){Gk[e]=t}function JB(e){var t=[],n;for(n in e)ot(e,n)&&t.push({unit:n,priority:Gk[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}function v0(e){return e%4===0&&e%100!==0||e%400===0}function sr(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Ge(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=sr(t)),n}function Us(e,t){return function(n){return n!=null?(Qk(this,e,n),pe.updateOffset(this,t),this):th(this,e)}}function th(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Qk(e,t,n){e.isValid()&&!isNaN(n)&&(t==="FullYear"&&v0(e.year())&&e.month()===1&&e.date()===29?(n=Ge(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),C0(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function e$(e){return e=Sr(e),ui(this[e])?this[e]():this}function t$(e,t){if(typeof e=="object"){e=G1(e);var n=JB(e),r,i=n.length;for(r=0;r68?1900:2e3)};var s7=Us("FullYear",!0);function v$(){return v0(this.year())}function x$(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function ac(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function rh(e,t,n){var r=7+t-n,i=(7+ac(e,0,r).getUTCDay()-t)%7;return-i+r-1}function l7(e,t,n,r,i){var a=(7+n-r)%7,o=rh(e,r,i),s=1+7*(t-1)+a+o,l,c;return s<=0?(l=e-1,c=Rl(l)+s):s>Rl(e)?(l=e+1,c=s-Rl(e)):(l=e,c=s),{year:l,dayOfYear:c}}function oc(e,t,n){var r=rh(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,o;return i<1?(o=e.year()-1,a=i+Mi(o,t,n)):i>Mi(e.year(),t,n)?(a=i-Mi(e.year(),t,n),o=e.year()+1):(o=e.year(),a=i),{week:a,year:o}}function Mi(e,t,n){var r=rh(e,t,n),i=rh(e+1,t,n);return(Rl(e)-r+i)/7}Re("w",["ww",2],"wo","week");Re("W",["WW",2],"Wo","isoWeek");vn("week","w");vn("isoWeek","W");xn("week",5);xn("isoWeek",5);we("w",At);we("ww",At,tr);we("W",At);we("WW",At,tr);zc(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=Ge(e)});function k$(e){return oc(e,this._week.dow,this._week.doy).week}var S$={dow:0,doy:6};function _$(){return this._week.dow}function E$(){return this._week.doy}function C$(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function T$(e){var t=oc(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Re("d",0,"do","day");Re("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Re("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Re("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Re("e",0,0,"weekday");Re("E",0,0,"isoWeekday");vn("day","d");vn("weekday","e");vn("isoWeekday","E");xn("day",11);xn("weekday",11);xn("isoWeekday",11);we("d",At);we("e",At);we("E",At);we("dd",function(e,t){return t.weekdaysMinRegex(e)});we("ddd",function(e,t){return t.weekdaysShortRegex(e)});we("dddd",function(e,t){return t.weekdaysRegex(e)});zc(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:qe(n).invalidWeekday=e});zc(["d","e","E"],function(e,t,n,r){t[r]=Ge(e)});function A$(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function R$(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function J1(e,t){return e.slice(t,7).concat(e.slice(0,t))}var M$="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),c7="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),N$="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),I$=Pc,O$=Pc,D$=Pc;function L$(e,t){var n=Br(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?J1(n,this._week.dow):e?n[e.day()]:n}function P$(e){return e===!0?J1(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function z$(e){return e===!0?J1(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function F$(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=ci([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?t==="dddd"?(i=qt.call(this._weekdaysParse,o),i!==-1?i:null):t==="ddd"?(i=qt.call(this._shortWeekdaysParse,o),i!==-1?i:null):(i=qt.call(this._minWeekdaysParse,o),i!==-1?i:null):t==="dddd"?(i=qt.call(this._weekdaysParse,o),i!==-1||(i=qt.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=qt.call(this._minWeekdaysParse,o),i!==-1?i:null)):t==="ddd"?(i=qt.call(this._shortWeekdaysParse,o),i!==-1||(i=qt.call(this._weekdaysParse,o),i!==-1)?i:(i=qt.call(this._minWeekdaysParse,o),i!==-1?i:null)):(i=qt.call(this._minWeekdaysParse,o),i!==-1||(i=qt.call(this._weekdaysParse,o),i!==-1)?i:(i=qt.call(this._shortWeekdaysParse,o),i!==-1?i:null))}function B$(e,t,n){var r,i,a;if(this._weekdaysParseExact)return F$.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=ci([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function $$(e){if(!this.isValid())return e!=null?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e!=null?(e=A$(e,this.localeData()),this.add(e-t,"d")):t}function U$(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function j$(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=R$(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function q$(e){return this._weekdaysParseExact?(ot(this,"_weekdaysRegex")||ey.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ot(this,"_weekdaysRegex")||(this._weekdaysRegex=I$),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function H$(e){return this._weekdaysParseExact?(ot(this,"_weekdaysRegex")||ey.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ot(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=O$),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function W$(e){return this._weekdaysParseExact?(ot(this,"_weekdaysRegex")||ey.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ot(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=D$),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ey(){function e(u,d){return d.length-u.length}var t=[],n=[],r=[],i=[],a,o,s,l,c;for(a=0;a<7;a++)o=ci([2e3,1]).day(a),s=Yn(this.weekdaysMin(o,"")),l=Yn(this.weekdaysShort(o,"")),c=Yn(this.weekdays(o,"")),t.push(s),n.push(l),r.push(c),i.push(s),i.push(l),i.push(c);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ty(){return this.hours()%12||12}function V$(){return this.hours()||24}Re("H",["HH",2],0,"hour");Re("h",["hh",2],0,ty);Re("k",["kk",2],0,V$);Re("hmm",0,0,function(){return""+ty.apply(this)+oi(this.minutes(),2)});Re("hmmss",0,0,function(){return""+ty.apply(this)+oi(this.minutes(),2)+oi(this.seconds(),2)});Re("Hmm",0,0,function(){return""+this.hours()+oi(this.minutes(),2)});Re("Hmmss",0,0,function(){return""+this.hours()+oi(this.minutes(),2)+oi(this.seconds(),2)});function u7(e,t){Re(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}u7("a",!0);u7("A",!1);vn("hour","h");xn("hour",13);function d7(e,t){return t._meridiemParse}we("a",d7);we("A",d7);we("H",At);we("h",At);we("k",At);we("HH",At,tr);we("hh",At,tr);we("kk",At,tr);we("hmm",e7);we("hmmss",t7);we("Hmm",e7);we("Hmmss",t7);mt(["H","HH"],nn);mt(["k","kk"],function(e,t,n){var r=Ge(e);t[nn]=r===24?0:r});mt(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});mt(["h","hh"],function(e,t,n){t[nn]=Ge(e),qe(n).bigHour=!0});mt("hmm",function(e,t,n){var r=e.length-2;t[nn]=Ge(e.substr(0,r)),t[Dr]=Ge(e.substr(r)),qe(n).bigHour=!0});mt("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[nn]=Ge(e.substr(0,r)),t[Dr]=Ge(e.substr(r,2)),t[Ti]=Ge(e.substr(i)),qe(n).bigHour=!0});mt("Hmm",function(e,t,n){var r=e.length-2;t[nn]=Ge(e.substr(0,r)),t[Dr]=Ge(e.substr(r))});mt("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[nn]=Ge(e.substr(0,r)),t[Dr]=Ge(e.substr(r,2)),t[Ti]=Ge(e.substr(i))});function Y$(e){return(e+"").toLowerCase().charAt(0)==="p"}var X$=/[ap]\.?m?\.?/i,K$=Us("Hours",!0);function G$(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var h7={calendar:BB,longDateFormat:qB,invalidDate:WB,ordinal:YB,dayOfMonthOrdinalParse:XB,relativeTime:GB,months:u$,monthsShort:n7,week:S$,weekdays:M$,weekdaysMin:N$,weekdaysShort:c7,meridiemParse:X$},Rt={},al={},sc;function Q$(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(i=T0(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&Q$(a,r)>=n-1)break;n--}t++}return sc}function J$(e){return e.match("^[^/\\\\]*$")!=null}function T0(e){var t=null,n;if(Rt[e]===void 0&&typeof pd<"u"&&pd&&pd.exports&&J$(e))try{t=sc._abbr,n=require,n("./locale/"+e),ka(t)}catch{Rt[e]=null}return Rt[e]}function ka(e,t){var n;return e&&(In(t)?n=Yi(e):n=ny(e,t),n?sc=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sc._abbr}function ny(e,t){if(t!==null){var n,r=h7;if(t.abbr=e,Rt[e]!=null)Xk("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Rt[e]._config;else if(t.parentLocale!=null)if(Rt[t.parentLocale]!=null)r=Rt[t.parentLocale]._config;else if(n=T0(t.parentLocale),n!=null)r=n._config;else return al[t.parentLocale]||(al[t.parentLocale]=[]),al[t.parentLocale].push({name:e,config:t}),null;return Rt[e]=new X1(Bm(r,t)),al[e]&&al[e].forEach(function(i){ny(i.name,i.config)}),ka(e),Rt[e]}else return delete Rt[e],null}function eU(e,t){if(t!=null){var n,r,i=h7;Rt[e]!=null&&Rt[e].parentLocale!=null?Rt[e].set(Bm(Rt[e]._config,t)):(r=T0(e),r!=null&&(i=r._config),t=Bm(i,t),r==null&&(t.abbr=e),n=new X1(t),n.parentLocale=Rt[e],Rt[e]=n),ka(e)}else Rt[e]!=null&&(Rt[e].parentLocale!=null?(Rt[e]=Rt[e].parentLocale,e===ka()&&ka(e)):Rt[e]!=null&&delete Rt[e]);return Rt[e]}function Yi(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sc;if(!Br(e)){if(t=T0(e),t)return t;e=[e]}return Z$(e)}function tU(){return $m(Rt)}function ry(e){var t,n=e._a;return n&&qe(e).overflow===-2&&(t=n[Ci]<0||n[Ci]>11?Ci:n[Qr]<1||n[Qr]>C0(n[bn],n[Ci])?Qr:n[nn]<0||n[nn]>24||n[nn]===24&&(n[Dr]!==0||n[Ti]!==0||n[Za]!==0)?nn:n[Dr]<0||n[Dr]>59?Dr:n[Ti]<0||n[Ti]>59?Ti:n[Za]<0||n[Za]>999?Za:-1,qe(e)._overflowDayOfYear&&(tQr)&&(t=Qr),qe(e)._overflowWeeks&&t===-1&&(t=s$),qe(e)._overflowWeekday&&t===-1&&(t=l$),qe(e).overflow=t),e}var nU=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,rU=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,iU=/Z|[+-]\d\d(?::?\d\d)?/,Iu=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Gf=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aU=/^\/?Date\((-?\d+)/i,oU=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,sU={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function f7(e){var t,n,r=e._i,i=nU.exec(r)||rU.exec(r),a,o,s,l,c=Iu.length,u=Gf.length;if(i){for(qe(e).iso=!0,t=0,n=c;tRl(o)||e._dayOfYear===0)&&(qe(e)._overflowDayOfYear=!0),n=ac(o,0,e._dayOfYear),e._a[Ci]=n.getUTCMonth(),e._a[Qr]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[nn]===24&&e._a[Dr]===0&&e._a[Ti]===0&&e._a[Za]===0&&(e._nextDay=!0,e._a[nn]=0),e._d=(e._useUTC?ac:x$).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[nn]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(qe(e).weekdayMismatch=!0)}}function mU(e){var t,n,r,i,a,o,s,l,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,o=4,n=Po(t.GG,e._a[bn],oc(Tt(),1,4).year),r=Po(t.W,1),i=Po(t.E,1),(i<1||i>7)&&(l=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,c=oc(Tt(),a,o),n=Po(t.gg,e._a[bn],c.year),r=Po(t.w,c.week),t.d!=null?(i=t.d,(i<0||i>6)&&(l=!0)):t.e!=null?(i=t.e+a,(t.e<0||t.e>6)&&(l=!0)):i=a),r<1||r>Mi(n,a,o)?qe(e)._overflowWeeks=!0:l!=null?qe(e)._overflowWeekday=!0:(s=l7(n,r,i,a,o),e._a[bn]=s.year,e._dayOfYear=s.dayOfYear)}pe.ISO_8601=function(){};pe.RFC_2822=function(){};function ay(e){if(e._f===pe.ISO_8601){f7(e);return}if(e._f===pe.RFC_2822){p7(e);return}e._a=[],qe(e).empty=!0;var t=""+e._i,n,r,i,a,o,s=t.length,l=0,c,u;for(i=Kk(e._f,e._locale).match(K1)||[],u=i.length,n=0;n0&&qe(e).unusedInput.push(o),t=t.slice(t.indexOf(r)+r.length),l+=r.length),fs[a]?(r?qe(e).empty=!1:qe(e).unusedTokens.push(a),o$(a,r,e)):e._strict&&!r&&qe(e).unusedTokens.push(a);qe(e).charsLeftOver=s-l,t.length>0&&qe(e).unusedInput.push(t),e._a[nn]<=12&&qe(e).bigHour===!0&&e._a[nn]>0&&(qe(e).bigHour=void 0),qe(e).parsedDateParts=e._a.slice(0),qe(e).meridiem=e._meridiem,e._a[nn]=gU(e._locale,e._a[nn],e._meridiem),c=qe(e).era,c!==null&&(e._a[bn]=e._locale.erasConvertYear(c,e._a[bn])),iy(e),ry(e)}function gU(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function yU(e){var t,n,r,i,a,o,s=!1,l=e._f.length;if(l===0){qe(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;ithis?this:e:w0()});function y7(e,t){var n,r;if(t.length===1&&Br(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function FU(){if(!In(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Y1(e,this),e=m7(e),e._a?(t=e._isUTC?ci(e._a):Tt(e._a),this._isDSTShifted=this.isValid()&&RU(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function BU(){return this.isValid()?!this._isUTC:!1}function $U(){return this.isValid()?this._isUTC:!1}function w7(){return this.isValid()?this._isUTC&&this._offset===0:!1}var UU=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,jU=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jr(e,t){var n=e,r=null,i,a,o;return ud(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:Bi(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=UU.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:Ge(r[Qr])*i,h:Ge(r[nn])*i,m:Ge(r[Dr])*i,s:Ge(r[Ti])*i,ms:Ge(jm(r[Za]*1e3))*i}):(r=jU.exec(e))?(i=r[1]==="-"?-1:1,n={y:Ba(r[2],i),M:Ba(r[3],i),w:Ba(r[4],i),d:Ba(r[5],i),h:Ba(r[6],i),m:Ba(r[7],i),s:Ba(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(o=qU(Tt(n.from),Tt(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),a=new A0(n),ud(e)&&ot(e,"_locale")&&(a._locale=e._locale),ud(e)&&ot(e,"_isValid")&&(a._isValid=e._isValid),a}jr.fn=A0.prototype;jr.invalid=AU;function Ba(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function a4(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qU(e,t){var n;return e.isValid()&&t.isValid()?(t=sy(t,e),e.isBefore(t)?n=a4(e,t):(n=a4(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function v7(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(Xk(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=jr(n,r),x7(this,i,e),this}}function x7(e,t,n,r){var i=t._milliseconds,a=jm(t._days),o=jm(t._months);e.isValid()&&(r=r??!0,o&&i7(e,th(e,"Month")+o*n),a&&Qk(e,"Date",th(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&pe.updateOffset(e,a||o))}var HU=v7(1,"add"),WU=v7(-1,"subtract");function k7(e){return typeof e=="string"||e instanceof String}function VU(e){return $r(e)||Dc(e)||k7(e)||Bi(e)||XU(e)||YU(e)||e===null||e===void 0}function YU(e){var t=no(e)&&!W1(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,o=r.length;for(i=0;in.valueOf():n.valueOf()9999?cd(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ui(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",cd(n,"Z")):cd(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function lj(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(n+r+i+a)}function cj(e){e||(e=this.isUtc()?pe.defaultFormatUtc:pe.defaultFormat);var t=cd(this,e);return this.localeData().postformat(t)}function uj(e,t){return this.isValid()&&($r(e)&&e.isValid()||Tt(e).isValid())?jr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function dj(e){return this.from(Tt(),e)}function hj(e,t){return this.isValid()&&($r(e)&&e.isValid()||Tt(e).isValid())?jr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function fj(e){return this.to(Tt(),e)}function S7(e){var t;return e===void 0?this._locale._abbr:(t=Yi(e),t!=null&&(this._locale=t),this)}var _7=kr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function E7(){return this._locale}var ih=1e3,ps=60*ih,ah=60*ps,C7=(365*400+97)*24*ah;function ms(e,t){return(e%t+t)%t}function T7(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-C7:new Date(e,t,n).valueOf()}function A7(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-C7:Date.UTC(e,t,n)}function pj(e){var t,n;if(e=Sr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?A7:T7,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ms(t+(this._isUTC?0:this.utcOffset()*ps),ah);break;case"minute":t=this._d.valueOf(),t-=ms(t,ps);break;case"second":t=this._d.valueOf(),t-=ms(t,ih);break}return this._d.setTime(t),pe.updateOffset(this,!0),this}function mj(e){var t,n;if(e=Sr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?A7:T7,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ah-ms(t+(this._isUTC?0:this.utcOffset()*ps),ah)-1;break;case"minute":t=this._d.valueOf(),t+=ps-ms(t,ps)-1;break;case"second":t=this._d.valueOf(),t+=ih-ms(t,ih)-1;break}return this._d.setTime(t),pe.updateOffset(this,!0),this}function gj(){return this._d.valueOf()-(this._offset||0)*6e4}function yj(){return Math.floor(this.valueOf()/1e3)}function bj(){return new Date(this.valueOf())}function wj(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function vj(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function xj(){return this.isValid()?this.toISOString():null}function kj(){return V1(this)}function Sj(){return ca({},qe(this))}function _j(){return qe(this).overflow}function Ej(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Re("N",0,0,"eraAbbr");Re("NN",0,0,"eraAbbr");Re("NNN",0,0,"eraAbbr");Re("NNNN",0,0,"eraName");Re("NNNNN",0,0,"eraNarrow");Re("y",["y",1],"yo","eraYear");Re("y",["yy",2],0,"eraYear");Re("y",["yyy",3],0,"eraYear");Re("y",["yyyy",4],0,"eraYear");we("N",ly);we("NN",ly);we("NNN",ly);we("NNNN",Pj);we("NNNNN",zj);mt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?qe(n).era=i:qe(n).invalidEra=e});we("y",js);we("yy",js);we("yyy",js);we("yyyy",js);we("yo",Fj);mt(["y","yy","yyy","yyyy"],bn);mt(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[bn]=n._locale.eraYearOrdinalParse(e,i):t[bn]=parseInt(e,10)});function Cj(e,t){var n,r,i,a=this._eras||Yi("en")._eras;for(n=0,r=a.length;n=0)return a[r]}function Aj(e,t){var n=e.since<=e.until?1:-1;return t===void 0?pe(e.since).year():pe(e.since).year()+(t-e.offset)*n}function Rj(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;ea&&(t=a),Wj.call(this,e,t,n,r,i))}function Wj(e,t,n,r,i){var a=l7(e,t,n,r,i),o=ac(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Re("Q",0,"Qo","quarter");vn("quarter","Q");xn("quarter",7);we("Q",Zk);mt("Q",function(e,t){t[Ci]=(Ge(e)-1)*3});function Vj(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Re("D",["DD",2],"Do","date");vn("date","D");xn("date",9);we("D",At);we("DD",At,tr);we("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});mt(["D","DD"],Qr);mt("Do",function(e,t){t[Qr]=Ge(e.match(At)[0])});var M7=Us("Date",!0);Re("DDD",["DDDD",3],"DDDo","dayOfYear");vn("dayOfYear","DDD");xn("dayOfYear",4);we("DDD",k0);we("DDDD",Jk);mt(["DDD","DDDD"],function(e,t,n){n._dayOfYear=Ge(e)});function Yj(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Re("m",["mm",2],0,"minute");vn("minute","m");xn("minute",14);we("m",At);we("mm",At,tr);mt(["m","mm"],Dr);var Xj=Us("Minutes",!1);Re("s",["ss",2],0,"second");vn("second","s");xn("second",15);we("s",At);we("ss",At,tr);mt(["s","ss"],Ti);var Kj=Us("Seconds",!1);Re("S",0,0,function(){return~~(this.millisecond()/100)});Re(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Re(0,["SSS",3],0,"millisecond");Re(0,["SSSS",4],0,function(){return this.millisecond()*10});Re(0,["SSSSS",5],0,function(){return this.millisecond()*100});Re(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Re(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Re(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Re(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});vn("millisecond","ms");xn("millisecond",16);we("S",k0,Zk);we("SS",k0,tr);we("SSS",k0,Jk);var ua,N7;for(ua="SSSS";ua.length<=9;ua+="S")we(ua,js);function Gj(e,t){t[Za]=Ge(("0."+e)*1e3)}for(ua="S";ua.length<=9;ua+="S")mt(ua,Gj);N7=Us("Milliseconds",!1);Re("z",0,0,"zoneAbbr");Re("zz",0,0,"zoneName");function Qj(){return this._isUTC?"UTC":""}function Zj(){return this._isUTC?"Coordinated Universal Time":""}var ae=Lc.prototype;ae.add=HU;ae.calendar=QU;ae.clone=ZU;ae.diff=aj;ae.endOf=mj;ae.format=cj;ae.from=uj;ae.fromNow=dj;ae.to=hj;ae.toNow=fj;ae.get=e$;ae.invalidAt=_j;ae.isAfter=JU;ae.isBefore=ej;ae.isBetween=tj;ae.isSame=nj;ae.isSameOrAfter=rj;ae.isSameOrBefore=ij;ae.isValid=kj;ae.lang=_7;ae.locale=S7;ae.localeData=E7;ae.max=kU;ae.min=xU;ae.parsingFlags=Sj;ae.set=t$;ae.startOf=pj;ae.subtract=WU;ae.toArray=wj;ae.toObject=vj;ae.toDate=bj;ae.toISOString=sj;ae.inspect=lj;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=xj;ae.toString=oj;ae.unix=yj;ae.valueOf=gj;ae.creationData=Ej;ae.eraName=Rj;ae.eraNarrow=Mj;ae.eraAbbr=Nj;ae.eraYear=Ij;ae.year=s7;ae.isLeapYear=v$;ae.weekYear=Bj;ae.isoWeekYear=$j;ae.quarter=ae.quarters=Vj;ae.month=a7;ae.daysInMonth=y$;ae.week=ae.weeks=C$;ae.isoWeek=ae.isoWeeks=T$;ae.weeksInYear=qj;ae.weeksInWeekYear=Hj;ae.isoWeeksInYear=Uj;ae.isoWeeksInISOWeekYear=jj;ae.date=M7;ae.day=ae.days=$$;ae.weekday=U$;ae.isoWeekday=j$;ae.dayOfYear=Yj;ae.hour=ae.hours=K$;ae.minute=ae.minutes=Xj;ae.second=ae.seconds=Kj;ae.millisecond=ae.milliseconds=N7;ae.utcOffset=NU;ae.utc=OU;ae.local=DU;ae.parseZone=LU;ae.hasAlignedHourOffset=PU;ae.isDST=zU;ae.isLocal=BU;ae.isUtcOffset=$U;ae.isUtc=w7;ae.isUTC=w7;ae.zoneAbbr=Qj;ae.zoneName=Zj;ae.dates=kr("dates accessor is deprecated. Use date instead.",M7);ae.months=kr("months accessor is deprecated. Use month instead",a7);ae.years=kr("years accessor is deprecated. Use year instead",s7);ae.zone=kr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",IU);ae.isDSTShifted=kr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",FU);function Jj(e){return Tt(e*1e3)}function eq(){return Tt.apply(null,arguments).parseZone()}function I7(e){return e}var st=X1.prototype;st.calendar=$B;st.longDateFormat=HB;st.invalidDate=VB;st.ordinal=KB;st.preparse=I7;st.postformat=I7;st.relativeTime=QB;st.pastFuture=ZB;st.set=FB;st.eras=Cj;st.erasParse=Tj;st.erasConvertYear=Aj;st.erasAbbrRegex=Dj;st.erasNameRegex=Oj;st.erasNarrowRegex=Lj;st.months=f$;st.monthsShort=p$;st.monthsParse=g$;st.monthsRegex=w$;st.monthsShortRegex=b$;st.week=k$;st.firstDayOfYear=E$;st.firstDayOfWeek=_$;st.weekdays=L$;st.weekdaysMin=z$;st.weekdaysShort=P$;st.weekdaysParse=B$;st.weekdaysRegex=q$;st.weekdaysShortRegex=H$;st.weekdaysMinRegex=W$;st.isPM=Y$;st.meridiem=G$;function oh(e,t,n,r){var i=Yi(),a=ci().set(r,t);return i[n](a,e)}function O7(e,t,n){if(Bi(e)&&(t=e,e=void 0),e=e||"",t!=null)return oh(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=oh(e,r,n,"month");return i}function uy(e,t,n,r){typeof e=="boolean"?(Bi(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,Bi(t)&&(n=t,t=void 0),t=t||"");var i=Yi(),a=e?i._week.dow:0,o,s=[];if(n!=null)return oh(t,(n+a)%7,r,"day");for(o=0;o<7;o++)s[o]=oh(t,(o+a)%7,r,"day");return s}function tq(e,t){return O7(e,t,"months")}function nq(e,t){return O7(e,t,"monthsShort")}function rq(e,t,n){return uy(e,t,n,"weekdays")}function iq(e,t,n){return uy(e,t,n,"weekdaysShort")}function aq(e,t,n){return uy(e,t,n,"weekdaysMin")}ka("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=Ge(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});pe.lang=kr("moment.lang is deprecated. Use moment.locale instead.",ka);pe.langData=kr("moment.langData is deprecated. Use moment.localeData instead.",Yi);var mi=Math.abs;function oq(){var e=this._data;return this._milliseconds=mi(this._milliseconds),this._days=mi(this._days),this._months=mi(this._months),e.milliseconds=mi(e.milliseconds),e.seconds=mi(e.seconds),e.minutes=mi(e.minutes),e.hours=mi(e.hours),e.months=mi(e.months),e.years=mi(e.years),this}function D7(e,t,n,r){var i=jr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function sq(e,t){return D7(this,e,t,1)}function lq(e,t){return D7(this,e,t,-1)}function o4(e){return e<0?Math.floor(e):Math.ceil(e)}function cq(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,o,s,l;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=o4(Hm(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=sr(e/1e3),r.seconds=i%60,a=sr(i/60),r.minutes=a%60,o=sr(a/60),r.hours=o%24,t+=sr(o/24),l=sr(L7(t)),n+=l,t-=o4(Hm(l)),s=sr(n/12),n%=12,r.days=t,r.months=n,r.years=s,this}function L7(e){return e*4800/146097}function Hm(e){return e*146097/4800}function uq(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Sr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+L7(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Hm(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function dq(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Ge(this._months/12)*31536e6:NaN}function Xi(e){return function(){return this.as(e)}}var hq=Xi("ms"),fq=Xi("s"),pq=Xi("m"),mq=Xi("h"),gq=Xi("d"),yq=Xi("w"),bq=Xi("M"),wq=Xi("Q"),vq=Xi("y");function xq(){return jr(this)}function kq(e){return e=Sr(e),this.isValid()?this[e+"s"]():NaN}function ko(e){return function(){return this.isValid()?this._data[e]:NaN}}var Sq=ko("milliseconds"),_q=ko("seconds"),Eq=ko("minutes"),Cq=ko("hours"),Tq=ko("days"),Aq=ko("months"),Rq=ko("years");function Mq(){return sr(this.days()/7)}var vi=Math.round,ts={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Nq(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function Iq(e,t,n,r){var i=jr(e).abs(),a=vi(i.as("s")),o=vi(i.as("m")),s=vi(i.as("h")),l=vi(i.as("d")),c=vi(i.as("M")),u=vi(i.as("w")),d=vi(i.as("y")),f=a<=n.ss&&["s",a]||a0,f[4]=r,Nq.apply(null,f)}function Oq(e){return e===void 0?vi:typeof e=="function"?(vi=e,!0):!1}function Dq(e,t){return ts[e]===void 0?!1:t===void 0?ts[e]:(ts[e]=t,e==="s"&&(ts.ss=t-1),!0)}function Lq(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=ts,i,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},ts,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=Iq(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Qf=Math.abs;function Io(e){return(e>0)-(e<0)||+e}function M0(){if(!this.isValid())return this.localeData().invalidDate();var e=Qf(this._milliseconds)/1e3,t=Qf(this._days),n=Qf(this._months),r,i,a,o,s=this.asSeconds(),l,c,u,d;return s?(r=sr(e/60),i=sr(r/60),e%=60,r%=60,a=sr(n/12),n%=12,o=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=s<0?"-":"",c=Io(this._months)!==Io(s)?"-":"",u=Io(this._days)!==Io(s)?"-":"",d=Io(this._milliseconds)!==Io(s)?"-":"",l+"P"+(a?c+a+"Y":"")+(n?c+n+"M":"")+(t?u+t+"D":"")+(i||r||e?"T":"")+(i?d+i+"H":"")+(r?d+r+"M":"")+(e?d+o+"S":"")):"P0D"}var Je=A0.prototype;Je.isValid=TU;Je.abs=oq;Je.add=sq;Je.subtract=lq;Je.as=uq;Je.asMilliseconds=hq;Je.asSeconds=fq;Je.asMinutes=pq;Je.asHours=mq;Je.asDays=gq;Je.asWeeks=yq;Je.asMonths=bq;Je.asQuarters=wq;Je.asYears=vq;Je.valueOf=dq;Je._bubble=cq;Je.clone=xq;Je.get=kq;Je.milliseconds=Sq;Je.seconds=_q;Je.minutes=Eq;Je.hours=Cq;Je.days=Tq;Je.weeks=Mq;Je.months=Aq;Je.years=Rq;Je.humanize=Lq;Je.toISOString=M0;Je.toString=M0;Je.toJSON=M0;Je.locale=S7;Je.localeData=E7;Je.toIsoString=kr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",M0);Je.lang=_7;Re("X",0,0,"unix");Re("x",0,0,"valueOf");we("x",_0);we("X",r$);mt("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});mt("x",function(e,t,n){n._d=new Date(Ge(e))});//! moment.js +pe.version="2.29.4";PB(Tt);pe.fn=ae;pe.min=SU;pe.max=_U;pe.now=EU;pe.utc=ci;pe.unix=Jj;pe.months=tq;pe.isDate=Dc;pe.locale=ka;pe.invalid=w0;pe.duration=jr;pe.isMoment=$r;pe.weekdays=rq;pe.parseZone=eq;pe.localeData=Yi;pe.isDuration=ud;pe.monthsShort=nq;pe.weekdaysMin=aq;pe.defineLocale=ny;pe.updateLocale=eU;pe.locales=tU;pe.weekdaysShort=iq;pe.normalizeUnits=Sr;pe.relativeTimeRounding=Oq;pe.relativeTimeThreshold=Dq;pe.calendarFormat=GU;pe.prototype=ae;pe.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function Wa(e){return e!==null&&e<-2}function s4(e){return e===-2||e===-1||e===32}function Ou(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(l){return s4(l)?(e.enter(n),s(l)):t(l)}function s(l){return s4(l)&&a++15?c="…"+o.slice(i-15,i):c=o.slice(0,i);var u;s+15":">","<":"<",'"':""","'":"'"},Xq=/[&><"']/g;function Kq(e){return String(e).replace(Xq,t=>Yq[t])}var P7=function e(t){return t.type==="ordgroup"||t.type==="color"?t.body.length===1?e(t.body[0]):t:t.type==="font"?e(t.body):t},Gq=function(t){var n=P7(t);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},Qq=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},Zq=function(t){var n=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(t);return n!=null?n[1]:"_relative"},Pe={contains:qq,deflt:Hq,escape:Kq,hyphenate:Vq,getBaseElem:P7,isCharacterBox:Gq,protocolFromUrl:Zq},hd={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Jq(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class dy{constructor(t){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n in hd)if(hd.hasOwnProperty(n)){var r=hd[n];this[n]=t[n]!==void 0?r.processor?r.processor(t[n]):t[n]:Jq(r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new ie("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){t.url&&!t.protocol&&(t.protocol=Pe.protocolFromUrl(t.url));var n=typeof this.trust=="function"?this.trust(t):this.trust;return!!n}}class Ji{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Kr[eH[this.id]]}sub(){return Kr[tH[this.id]]}fracNum(){return Kr[nH[this.id]]}fracDen(){return Kr[rH[this.id]]}cramp(){return Kr[iH[this.id]]}text(){return Kr[aH[this.id]]}isTight(){return this.size>=2}}var hy=0,sh=1,gs=2,Ni=3,lc=4,hr=5,As=6,En=7,Kr=[new Ji(hy,0,!1),new Ji(sh,0,!0),new Ji(gs,1,!1),new Ji(Ni,1,!0),new Ji(lc,2,!1),new Ji(hr,2,!0),new Ji(As,3,!1),new Ji(En,3,!0)],eH=[lc,hr,lc,hr,As,En,As,En],tH=[hr,hr,hr,hr,En,En,En,En],nH=[gs,Ni,lc,hr,As,En,As,En],rH=[Ni,Ni,hr,hr,En,En,En,En],iH=[sh,sh,Ni,Ni,hr,hr,En,En],aH=[hy,sh,gs,Ni,gs,Ni,gs,Ni],De={DISPLAY:Kr[hy],TEXT:Kr[gs],SCRIPT:Kr[lc],SCRIPTSCRIPT:Kr[As]},Wm=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function oH(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var fd=[];Wm.forEach(e=>e.blocks.forEach(t=>fd.push(...t)));function z7(e){for(var t=0;t=fd[t]&&e<=fd[t+1])return!0;return!1}var Oo=80,sH=function(t,n){return"M95,"+(622+t+n)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+t/2.075+" -"+t+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+t)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},lH=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l`+t/2.084+" -"+t+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+t)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},cH=function(t,n){return"M983 "+(10+t+n)+` +l`+t/3.13+" -"+t+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` +H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},uH=function(t,n){return"M424,"+(2398+t+n)+` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+t)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+` +h400000v`+(40+t)+"h-400000z"},dH=function(t,n){return"M473,"+(2713+t+n)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 +c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},hH=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},fH=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` +H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},pH=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=sH(n,Oo);break;case"sqrtSize1":i=lH(n,Oo);break;case"sqrtSize2":i=cH(n,Oo);break;case"sqrtSize3":i=uH(n,Oo);break;case"sqrtSize4":i=dH(n,Oo);break;case"sqrtTall":i=fH(n,Oo,r)}return i},mH=function(t,n){switch(t){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},c4={doubleleftarrow:`M262 157 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z +M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},gH=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z +M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z +M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z +M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 +c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, +-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` +c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 +c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 +c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Fc{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return Pe.contains(this.classes,t)}toNode(){for(var t=document.createDocumentFragment(),n=0;nn.toText();return this.children.map(t).join("")}}var Zr={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Du={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},u4={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function yH(e,t){Zr[e]=t}function fy(e,t,n){if(!Zr[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Zr[t][r];if(!i&&e[0]in u4&&(r=u4[e[0]].charCodeAt(0),i=Zr[t][r]),!i&&n==="text"&&z7(r)&&(i=Zr[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Zf={};function bH(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Zf[t]){var n=Zf[t]={cssEmPerMu:Du.quad[t]/18};for(var r in Du)Du.hasOwnProperty(r)&&(n[r]=Du[r][t])}return Zf[t]}var wH=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],d4=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],h4=function(t,n){return n.size<2?t:wH[t-1][n.size-1]};class ki{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||ki.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=d4[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return new ki(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:h4(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:d4[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=h4(ki.BASESIZE,t);return this.size===n&&this.textSize===ki.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==ki.BASESIZE?["sizing","reset-size"+this.size,"size"+ki.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=bH(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}ki.BASESIZE=6;var Vm={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},vH={ex:!0,em:!0,mu:!0},F7=function(t){return typeof t!="string"&&(t=t.unit),t in Vm||t in vH||t==="ex"},Lt=function(t,n){var r;if(t.unit in Vm)r=Vm[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new ie("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},he=function(t){return+t.toFixed(4)+"em"},Ca=function(t){return t.filter(n=>n).join(" ")},B7=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},$7=function(t){var n=document.createElement(t);n.className=Ca(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&n.setAttribute(i,this.attributes[i]);for(var a=0;a",n};class Bc{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,B7.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return Pe.contains(this.classes,t)}toNode(){return $7.call(this,"span")}toMarkup(){return U7.call(this,"span")}}class py{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,B7.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return Pe.contains(this.classes,t)}toNode(){return $7.call(this,"a")}toMarkup(){return U7.call(this,"a")}}class xH{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.style=r}hasClass(t){return Pe.contains(this.classes,t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);return t}toMarkup(){var t=""+this.alt+"0&&(n=document.createElement("span"),n.style.marginRight=he(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Ca(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(r+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=Pe.hyphenate(i)+":"+this.style[i]+";");r&&(t=!0,n+=' style="'+Pe.escape(r)+'"');var a=Pe.escape(this.text);return t?(n+=">",n+=a,n+="",n):a}}class $i{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var i=0;i":""}}class Ym{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t=" but got "+String(e)+".")}var _H={bin:1,close:1,inner:1,open:1,punct:1,rel:1},EH={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},vt={math:{},text:{}};function g(e,t,n,r,i,a){vt[e][i]={font:t,group:n,replace:r},a&&r&&(vt[e][r]=vt[e][i])}var b="math",Z="text",S="main",I="ams",It="accent-token",be="bin",Rn="close",qs="inner",Le="mathord",Zt="op-token",nr="open",N0="punct",D="rel",Ki="spacing",P="textord";g(b,S,D,"≡","\\equiv",!0);g(b,S,D,"≺","\\prec",!0);g(b,S,D,"≻","\\succ",!0);g(b,S,D,"∼","\\sim",!0);g(b,S,D,"⊥","\\perp");g(b,S,D,"⪯","\\preceq",!0);g(b,S,D,"⪰","\\succeq",!0);g(b,S,D,"≃","\\simeq",!0);g(b,S,D,"∣","\\mid",!0);g(b,S,D,"≪","\\ll",!0);g(b,S,D,"≫","\\gg",!0);g(b,S,D,"≍","\\asymp",!0);g(b,S,D,"∥","\\parallel");g(b,S,D,"⋈","\\bowtie",!0);g(b,S,D,"⌣","\\smile",!0);g(b,S,D,"⊑","\\sqsubseteq",!0);g(b,S,D,"⊒","\\sqsupseteq",!0);g(b,S,D,"≐","\\doteq",!0);g(b,S,D,"⌢","\\frown",!0);g(b,S,D,"∋","\\ni",!0);g(b,S,D,"∝","\\propto",!0);g(b,S,D,"⊢","\\vdash",!0);g(b,S,D,"⊣","\\dashv",!0);g(b,S,D,"∋","\\owns");g(b,S,N0,".","\\ldotp");g(b,S,N0,"⋅","\\cdotp");g(b,S,P,"#","\\#");g(Z,S,P,"#","\\#");g(b,S,P,"&","\\&");g(Z,S,P,"&","\\&");g(b,S,P,"ℵ","\\aleph",!0);g(b,S,P,"∀","\\forall",!0);g(b,S,P,"ℏ","\\hbar",!0);g(b,S,P,"∃","\\exists",!0);g(b,S,P,"∇","\\nabla",!0);g(b,S,P,"♭","\\flat",!0);g(b,S,P,"ℓ","\\ell",!0);g(b,S,P,"♮","\\natural",!0);g(b,S,P,"♣","\\clubsuit",!0);g(b,S,P,"℘","\\wp",!0);g(b,S,P,"♯","\\sharp",!0);g(b,S,P,"♢","\\diamondsuit",!0);g(b,S,P,"ℜ","\\Re",!0);g(b,S,P,"♡","\\heartsuit",!0);g(b,S,P,"ℑ","\\Im",!0);g(b,S,P,"♠","\\spadesuit",!0);g(b,S,P,"§","\\S",!0);g(Z,S,P,"§","\\S");g(b,S,P,"¶","\\P",!0);g(Z,S,P,"¶","\\P");g(b,S,P,"†","\\dag");g(Z,S,P,"†","\\dag");g(Z,S,P,"†","\\textdagger");g(b,S,P,"‡","\\ddag");g(Z,S,P,"‡","\\ddag");g(Z,S,P,"‡","\\textdaggerdbl");g(b,S,Rn,"⎱","\\rmoustache",!0);g(b,S,nr,"⎰","\\lmoustache",!0);g(b,S,Rn,"⟯","\\rgroup",!0);g(b,S,nr,"⟮","\\lgroup",!0);g(b,S,be,"∓","\\mp",!0);g(b,S,be,"⊖","\\ominus",!0);g(b,S,be,"⊎","\\uplus",!0);g(b,S,be,"⊓","\\sqcap",!0);g(b,S,be,"∗","\\ast");g(b,S,be,"⊔","\\sqcup",!0);g(b,S,be,"◯","\\bigcirc",!0);g(b,S,be,"∙","\\bullet",!0);g(b,S,be,"‡","\\ddagger");g(b,S,be,"≀","\\wr",!0);g(b,S,be,"⨿","\\amalg");g(b,S,be,"&","\\And");g(b,S,D,"⟵","\\longleftarrow",!0);g(b,S,D,"⇐","\\Leftarrow",!0);g(b,S,D,"⟸","\\Longleftarrow",!0);g(b,S,D,"⟶","\\longrightarrow",!0);g(b,S,D,"⇒","\\Rightarrow",!0);g(b,S,D,"⟹","\\Longrightarrow",!0);g(b,S,D,"↔","\\leftrightarrow",!0);g(b,S,D,"⟷","\\longleftrightarrow",!0);g(b,S,D,"⇔","\\Leftrightarrow",!0);g(b,S,D,"⟺","\\Longleftrightarrow",!0);g(b,S,D,"↦","\\mapsto",!0);g(b,S,D,"⟼","\\longmapsto",!0);g(b,S,D,"↗","\\nearrow",!0);g(b,S,D,"↩","\\hookleftarrow",!0);g(b,S,D,"↪","\\hookrightarrow",!0);g(b,S,D,"↘","\\searrow",!0);g(b,S,D,"↼","\\leftharpoonup",!0);g(b,S,D,"⇀","\\rightharpoonup",!0);g(b,S,D,"↙","\\swarrow",!0);g(b,S,D,"↽","\\leftharpoondown",!0);g(b,S,D,"⇁","\\rightharpoondown",!0);g(b,S,D,"↖","\\nwarrow",!0);g(b,S,D,"⇌","\\rightleftharpoons",!0);g(b,I,D,"≮","\\nless",!0);g(b,I,D,"","\\@nleqslant");g(b,I,D,"","\\@nleqq");g(b,I,D,"⪇","\\lneq",!0);g(b,I,D,"≨","\\lneqq",!0);g(b,I,D,"","\\@lvertneqq");g(b,I,D,"⋦","\\lnsim",!0);g(b,I,D,"⪉","\\lnapprox",!0);g(b,I,D,"⊀","\\nprec",!0);g(b,I,D,"⋠","\\npreceq",!0);g(b,I,D,"⋨","\\precnsim",!0);g(b,I,D,"⪹","\\precnapprox",!0);g(b,I,D,"≁","\\nsim",!0);g(b,I,D,"","\\@nshortmid");g(b,I,D,"∤","\\nmid",!0);g(b,I,D,"⊬","\\nvdash",!0);g(b,I,D,"⊭","\\nvDash",!0);g(b,I,D,"⋪","\\ntriangleleft");g(b,I,D,"⋬","\\ntrianglelefteq",!0);g(b,I,D,"⊊","\\subsetneq",!0);g(b,I,D,"","\\@varsubsetneq");g(b,I,D,"⫋","\\subsetneqq",!0);g(b,I,D,"","\\@varsubsetneqq");g(b,I,D,"≯","\\ngtr",!0);g(b,I,D,"","\\@ngeqslant");g(b,I,D,"","\\@ngeqq");g(b,I,D,"⪈","\\gneq",!0);g(b,I,D,"≩","\\gneqq",!0);g(b,I,D,"","\\@gvertneqq");g(b,I,D,"⋧","\\gnsim",!0);g(b,I,D,"⪊","\\gnapprox",!0);g(b,I,D,"⊁","\\nsucc",!0);g(b,I,D,"⋡","\\nsucceq",!0);g(b,I,D,"⋩","\\succnsim",!0);g(b,I,D,"⪺","\\succnapprox",!0);g(b,I,D,"≆","\\ncong",!0);g(b,I,D,"","\\@nshortparallel");g(b,I,D,"∦","\\nparallel",!0);g(b,I,D,"⊯","\\nVDash",!0);g(b,I,D,"⋫","\\ntriangleright");g(b,I,D,"⋭","\\ntrianglerighteq",!0);g(b,I,D,"","\\@nsupseteqq");g(b,I,D,"⊋","\\supsetneq",!0);g(b,I,D,"","\\@varsupsetneq");g(b,I,D,"⫌","\\supsetneqq",!0);g(b,I,D,"","\\@varsupsetneqq");g(b,I,D,"⊮","\\nVdash",!0);g(b,I,D,"⪵","\\precneqq",!0);g(b,I,D,"⪶","\\succneqq",!0);g(b,I,D,"","\\@nsubseteqq");g(b,I,be,"⊴","\\unlhd");g(b,I,be,"⊵","\\unrhd");g(b,I,D,"↚","\\nleftarrow",!0);g(b,I,D,"↛","\\nrightarrow",!0);g(b,I,D,"⇍","\\nLeftarrow",!0);g(b,I,D,"⇏","\\nRightarrow",!0);g(b,I,D,"↮","\\nleftrightarrow",!0);g(b,I,D,"⇎","\\nLeftrightarrow",!0);g(b,I,D,"△","\\vartriangle");g(b,I,P,"ℏ","\\hslash");g(b,I,P,"▽","\\triangledown");g(b,I,P,"◊","\\lozenge");g(b,I,P,"Ⓢ","\\circledS");g(b,I,P,"®","\\circledR");g(Z,I,P,"®","\\circledR");g(b,I,P,"∡","\\measuredangle",!0);g(b,I,P,"∄","\\nexists");g(b,I,P,"℧","\\mho");g(b,I,P,"Ⅎ","\\Finv",!0);g(b,I,P,"⅁","\\Game",!0);g(b,I,P,"‵","\\backprime");g(b,I,P,"▲","\\blacktriangle");g(b,I,P,"▼","\\blacktriangledown");g(b,I,P,"■","\\blacksquare");g(b,I,P,"⧫","\\blacklozenge");g(b,I,P,"★","\\bigstar");g(b,I,P,"∢","\\sphericalangle",!0);g(b,I,P,"∁","\\complement",!0);g(b,I,P,"ð","\\eth",!0);g(Z,S,P,"ð","ð");g(b,I,P,"╱","\\diagup");g(b,I,P,"╲","\\diagdown");g(b,I,P,"□","\\square");g(b,I,P,"□","\\Box");g(b,I,P,"◊","\\Diamond");g(b,I,P,"¥","\\yen",!0);g(Z,I,P,"¥","\\yen",!0);g(b,I,P,"✓","\\checkmark",!0);g(Z,I,P,"✓","\\checkmark");g(b,I,P,"ℶ","\\beth",!0);g(b,I,P,"ℸ","\\daleth",!0);g(b,I,P,"ℷ","\\gimel",!0);g(b,I,P,"ϝ","\\digamma",!0);g(b,I,P,"ϰ","\\varkappa");g(b,I,nr,"┌","\\@ulcorner",!0);g(b,I,Rn,"┐","\\@urcorner",!0);g(b,I,nr,"└","\\@llcorner",!0);g(b,I,Rn,"┘","\\@lrcorner",!0);g(b,I,D,"≦","\\leqq",!0);g(b,I,D,"⩽","\\leqslant",!0);g(b,I,D,"⪕","\\eqslantless",!0);g(b,I,D,"≲","\\lesssim",!0);g(b,I,D,"⪅","\\lessapprox",!0);g(b,I,D,"≊","\\approxeq",!0);g(b,I,be,"⋖","\\lessdot");g(b,I,D,"⋘","\\lll",!0);g(b,I,D,"≶","\\lessgtr",!0);g(b,I,D,"⋚","\\lesseqgtr",!0);g(b,I,D,"⪋","\\lesseqqgtr",!0);g(b,I,D,"≑","\\doteqdot");g(b,I,D,"≓","\\risingdotseq",!0);g(b,I,D,"≒","\\fallingdotseq",!0);g(b,I,D,"∽","\\backsim",!0);g(b,I,D,"⋍","\\backsimeq",!0);g(b,I,D,"⫅","\\subseteqq",!0);g(b,I,D,"⋐","\\Subset",!0);g(b,I,D,"⊏","\\sqsubset",!0);g(b,I,D,"≼","\\preccurlyeq",!0);g(b,I,D,"⋞","\\curlyeqprec",!0);g(b,I,D,"≾","\\precsim",!0);g(b,I,D,"⪷","\\precapprox",!0);g(b,I,D,"⊲","\\vartriangleleft");g(b,I,D,"⊴","\\trianglelefteq");g(b,I,D,"⊨","\\vDash",!0);g(b,I,D,"⊪","\\Vvdash",!0);g(b,I,D,"⌣","\\smallsmile");g(b,I,D,"⌢","\\smallfrown");g(b,I,D,"≏","\\bumpeq",!0);g(b,I,D,"≎","\\Bumpeq",!0);g(b,I,D,"≧","\\geqq",!0);g(b,I,D,"⩾","\\geqslant",!0);g(b,I,D,"⪖","\\eqslantgtr",!0);g(b,I,D,"≳","\\gtrsim",!0);g(b,I,D,"⪆","\\gtrapprox",!0);g(b,I,be,"⋗","\\gtrdot");g(b,I,D,"⋙","\\ggg",!0);g(b,I,D,"≷","\\gtrless",!0);g(b,I,D,"⋛","\\gtreqless",!0);g(b,I,D,"⪌","\\gtreqqless",!0);g(b,I,D,"≖","\\eqcirc",!0);g(b,I,D,"≗","\\circeq",!0);g(b,I,D,"≜","\\triangleq",!0);g(b,I,D,"∼","\\thicksim");g(b,I,D,"≈","\\thickapprox");g(b,I,D,"⫆","\\supseteqq",!0);g(b,I,D,"⋑","\\Supset",!0);g(b,I,D,"⊐","\\sqsupset",!0);g(b,I,D,"≽","\\succcurlyeq",!0);g(b,I,D,"⋟","\\curlyeqsucc",!0);g(b,I,D,"≿","\\succsim",!0);g(b,I,D,"⪸","\\succapprox",!0);g(b,I,D,"⊳","\\vartriangleright");g(b,I,D,"⊵","\\trianglerighteq");g(b,I,D,"⊩","\\Vdash",!0);g(b,I,D,"∣","\\shortmid");g(b,I,D,"∥","\\shortparallel");g(b,I,D,"≬","\\between",!0);g(b,I,D,"⋔","\\pitchfork",!0);g(b,I,D,"∝","\\varpropto");g(b,I,D,"◀","\\blacktriangleleft");g(b,I,D,"∴","\\therefore",!0);g(b,I,D,"∍","\\backepsilon");g(b,I,D,"▶","\\blacktriangleright");g(b,I,D,"∵","\\because",!0);g(b,I,D,"⋘","\\llless");g(b,I,D,"⋙","\\gggtr");g(b,I,be,"⊲","\\lhd");g(b,I,be,"⊳","\\rhd");g(b,I,D,"≂","\\eqsim",!0);g(b,S,D,"⋈","\\Join");g(b,I,D,"≑","\\Doteq",!0);g(b,I,be,"∔","\\dotplus",!0);g(b,I,be,"∖","\\smallsetminus");g(b,I,be,"⋒","\\Cap",!0);g(b,I,be,"⋓","\\Cup",!0);g(b,I,be,"⩞","\\doublebarwedge",!0);g(b,I,be,"⊟","\\boxminus",!0);g(b,I,be,"⊞","\\boxplus",!0);g(b,I,be,"⋇","\\divideontimes",!0);g(b,I,be,"⋉","\\ltimes",!0);g(b,I,be,"⋊","\\rtimes",!0);g(b,I,be,"⋋","\\leftthreetimes",!0);g(b,I,be,"⋌","\\rightthreetimes",!0);g(b,I,be,"⋏","\\curlywedge",!0);g(b,I,be,"⋎","\\curlyvee",!0);g(b,I,be,"⊝","\\circleddash",!0);g(b,I,be,"⊛","\\circledast",!0);g(b,I,be,"⋅","\\centerdot");g(b,I,be,"⊺","\\intercal",!0);g(b,I,be,"⋒","\\doublecap");g(b,I,be,"⋓","\\doublecup");g(b,I,be,"⊠","\\boxtimes",!0);g(b,I,D,"⇢","\\dashrightarrow",!0);g(b,I,D,"⇠","\\dashleftarrow",!0);g(b,I,D,"⇇","\\leftleftarrows",!0);g(b,I,D,"⇆","\\leftrightarrows",!0);g(b,I,D,"⇚","\\Lleftarrow",!0);g(b,I,D,"↞","\\twoheadleftarrow",!0);g(b,I,D,"↢","\\leftarrowtail",!0);g(b,I,D,"↫","\\looparrowleft",!0);g(b,I,D,"⇋","\\leftrightharpoons",!0);g(b,I,D,"↶","\\curvearrowleft",!0);g(b,I,D,"↺","\\circlearrowleft",!0);g(b,I,D,"↰","\\Lsh",!0);g(b,I,D,"⇈","\\upuparrows",!0);g(b,I,D,"↿","\\upharpoonleft",!0);g(b,I,D,"⇃","\\downharpoonleft",!0);g(b,S,D,"⊶","\\origof",!0);g(b,S,D,"⊷","\\imageof",!0);g(b,I,D,"⊸","\\multimap",!0);g(b,I,D,"↭","\\leftrightsquigarrow",!0);g(b,I,D,"⇉","\\rightrightarrows",!0);g(b,I,D,"⇄","\\rightleftarrows",!0);g(b,I,D,"↠","\\twoheadrightarrow",!0);g(b,I,D,"↣","\\rightarrowtail",!0);g(b,I,D,"↬","\\looparrowright",!0);g(b,I,D,"↷","\\curvearrowright",!0);g(b,I,D,"↻","\\circlearrowright",!0);g(b,I,D,"↱","\\Rsh",!0);g(b,I,D,"⇊","\\downdownarrows",!0);g(b,I,D,"↾","\\upharpoonright",!0);g(b,I,D,"⇂","\\downharpoonright",!0);g(b,I,D,"⇝","\\rightsquigarrow",!0);g(b,I,D,"⇝","\\leadsto");g(b,I,D,"⇛","\\Rrightarrow",!0);g(b,I,D,"↾","\\restriction");g(b,S,P,"‘","`");g(b,S,P,"$","\\$");g(Z,S,P,"$","\\$");g(Z,S,P,"$","\\textdollar");g(b,S,P,"%","\\%");g(Z,S,P,"%","\\%");g(b,S,P,"_","\\_");g(Z,S,P,"_","\\_");g(Z,S,P,"_","\\textunderscore");g(b,S,P,"∠","\\angle",!0);g(b,S,P,"∞","\\infty",!0);g(b,S,P,"′","\\prime");g(b,S,P,"△","\\triangle");g(b,S,P,"Γ","\\Gamma",!0);g(b,S,P,"Δ","\\Delta",!0);g(b,S,P,"Θ","\\Theta",!0);g(b,S,P,"Λ","\\Lambda",!0);g(b,S,P,"Ξ","\\Xi",!0);g(b,S,P,"Π","\\Pi",!0);g(b,S,P,"Σ","\\Sigma",!0);g(b,S,P,"Υ","\\Upsilon",!0);g(b,S,P,"Φ","\\Phi",!0);g(b,S,P,"Ψ","\\Psi",!0);g(b,S,P,"Ω","\\Omega",!0);g(b,S,P,"A","Α");g(b,S,P,"B","Β");g(b,S,P,"E","Ε");g(b,S,P,"Z","Ζ");g(b,S,P,"H","Η");g(b,S,P,"I","Ι");g(b,S,P,"K","Κ");g(b,S,P,"M","Μ");g(b,S,P,"N","Ν");g(b,S,P,"O","Ο");g(b,S,P,"P","Ρ");g(b,S,P,"T","Τ");g(b,S,P,"X","Χ");g(b,S,P,"¬","\\neg",!0);g(b,S,P,"¬","\\lnot");g(b,S,P,"⊤","\\top");g(b,S,P,"⊥","\\bot");g(b,S,P,"∅","\\emptyset");g(b,I,P,"∅","\\varnothing");g(b,S,Le,"α","\\alpha",!0);g(b,S,Le,"β","\\beta",!0);g(b,S,Le,"γ","\\gamma",!0);g(b,S,Le,"δ","\\delta",!0);g(b,S,Le,"ϵ","\\epsilon",!0);g(b,S,Le,"ζ","\\zeta",!0);g(b,S,Le,"η","\\eta",!0);g(b,S,Le,"θ","\\theta",!0);g(b,S,Le,"ι","\\iota",!0);g(b,S,Le,"κ","\\kappa",!0);g(b,S,Le,"λ","\\lambda",!0);g(b,S,Le,"μ","\\mu",!0);g(b,S,Le,"ν","\\nu",!0);g(b,S,Le,"ξ","\\xi",!0);g(b,S,Le,"ο","\\omicron",!0);g(b,S,Le,"π","\\pi",!0);g(b,S,Le,"ρ","\\rho",!0);g(b,S,Le,"σ","\\sigma",!0);g(b,S,Le,"τ","\\tau",!0);g(b,S,Le,"υ","\\upsilon",!0);g(b,S,Le,"ϕ","\\phi",!0);g(b,S,Le,"χ","\\chi",!0);g(b,S,Le,"ψ","\\psi",!0);g(b,S,Le,"ω","\\omega",!0);g(b,S,Le,"ε","\\varepsilon",!0);g(b,S,Le,"ϑ","\\vartheta",!0);g(b,S,Le,"ϖ","\\varpi",!0);g(b,S,Le,"ϱ","\\varrho",!0);g(b,S,Le,"ς","\\varsigma",!0);g(b,S,Le,"φ","\\varphi",!0);g(b,S,be,"∗","*",!0);g(b,S,be,"+","+");g(b,S,be,"−","-",!0);g(b,S,be,"⋅","\\cdot",!0);g(b,S,be,"∘","\\circ",!0);g(b,S,be,"÷","\\div",!0);g(b,S,be,"±","\\pm",!0);g(b,S,be,"×","\\times",!0);g(b,S,be,"∩","\\cap",!0);g(b,S,be,"∪","\\cup",!0);g(b,S,be,"∖","\\setminus",!0);g(b,S,be,"∧","\\land");g(b,S,be,"∨","\\lor");g(b,S,be,"∧","\\wedge",!0);g(b,S,be,"∨","\\vee",!0);g(b,S,P,"√","\\surd");g(b,S,nr,"⟨","\\langle",!0);g(b,S,nr,"∣","\\lvert");g(b,S,nr,"∥","\\lVert");g(b,S,Rn,"?","?");g(b,S,Rn,"!","!");g(b,S,Rn,"⟩","\\rangle",!0);g(b,S,Rn,"∣","\\rvert");g(b,S,Rn,"∥","\\rVert");g(b,S,D,"=","=");g(b,S,D,":",":");g(b,S,D,"≈","\\approx",!0);g(b,S,D,"≅","\\cong",!0);g(b,S,D,"≥","\\ge");g(b,S,D,"≥","\\geq",!0);g(b,S,D,"←","\\gets");g(b,S,D,">","\\gt",!0);g(b,S,D,"∈","\\in",!0);g(b,S,D,"","\\@not");g(b,S,D,"⊂","\\subset",!0);g(b,S,D,"⊃","\\supset",!0);g(b,S,D,"⊆","\\subseteq",!0);g(b,S,D,"⊇","\\supseteq",!0);g(b,I,D,"⊈","\\nsubseteq",!0);g(b,I,D,"⊉","\\nsupseteq",!0);g(b,S,D,"⊨","\\models");g(b,S,D,"←","\\leftarrow",!0);g(b,S,D,"≤","\\le");g(b,S,D,"≤","\\leq",!0);g(b,S,D,"<","\\lt",!0);g(b,S,D,"→","\\rightarrow",!0);g(b,S,D,"→","\\to");g(b,I,D,"≱","\\ngeq",!0);g(b,I,D,"≰","\\nleq",!0);g(b,S,Ki," ","\\ ");g(b,S,Ki," ","\\space");g(b,S,Ki," ","\\nobreakspace");g(Z,S,Ki," ","\\ ");g(Z,S,Ki," "," ");g(Z,S,Ki," ","\\space");g(Z,S,Ki," ","\\nobreakspace");g(b,S,Ki,null,"\\nobreak");g(b,S,Ki,null,"\\allowbreak");g(b,S,N0,",",",");g(b,S,N0,";",";");g(b,I,be,"⊼","\\barwedge",!0);g(b,I,be,"⊻","\\veebar",!0);g(b,S,be,"⊙","\\odot",!0);g(b,S,be,"⊕","\\oplus",!0);g(b,S,be,"⊗","\\otimes",!0);g(b,S,P,"∂","\\partial",!0);g(b,S,be,"⊘","\\oslash",!0);g(b,I,be,"⊚","\\circledcirc",!0);g(b,I,be,"⊡","\\boxdot",!0);g(b,S,be,"△","\\bigtriangleup");g(b,S,be,"▽","\\bigtriangledown");g(b,S,be,"†","\\dagger");g(b,S,be,"⋄","\\diamond");g(b,S,be,"⋆","\\star");g(b,S,be,"◃","\\triangleleft");g(b,S,be,"▹","\\triangleright");g(b,S,nr,"{","\\{");g(Z,S,P,"{","\\{");g(Z,S,P,"{","\\textbraceleft");g(b,S,Rn,"}","\\}");g(Z,S,P,"}","\\}");g(Z,S,P,"}","\\textbraceright");g(b,S,nr,"{","\\lbrace");g(b,S,Rn,"}","\\rbrace");g(b,S,nr,"[","\\lbrack",!0);g(Z,S,P,"[","\\lbrack",!0);g(b,S,Rn,"]","\\rbrack",!0);g(Z,S,P,"]","\\rbrack",!0);g(b,S,nr,"(","\\lparen",!0);g(b,S,Rn,")","\\rparen",!0);g(Z,S,P,"<","\\textless",!0);g(Z,S,P,">","\\textgreater",!0);g(b,S,nr,"⌊","\\lfloor",!0);g(b,S,Rn,"⌋","\\rfloor",!0);g(b,S,nr,"⌈","\\lceil",!0);g(b,S,Rn,"⌉","\\rceil",!0);g(b,S,P,"\\","\\backslash");g(b,S,P,"∣","|");g(b,S,P,"∣","\\vert");g(Z,S,P,"|","\\textbar",!0);g(b,S,P,"∥","\\|");g(b,S,P,"∥","\\Vert");g(Z,S,P,"∥","\\textbardbl");g(Z,S,P,"~","\\textasciitilde");g(Z,S,P,"\\","\\textbackslash");g(Z,S,P,"^","\\textasciicircum");g(b,S,D,"↑","\\uparrow",!0);g(b,S,D,"⇑","\\Uparrow",!0);g(b,S,D,"↓","\\downarrow",!0);g(b,S,D,"⇓","\\Downarrow",!0);g(b,S,D,"↕","\\updownarrow",!0);g(b,S,D,"⇕","\\Updownarrow",!0);g(b,S,Zt,"∐","\\coprod");g(b,S,Zt,"⋁","\\bigvee");g(b,S,Zt,"⋀","\\bigwedge");g(b,S,Zt,"⨄","\\biguplus");g(b,S,Zt,"⋂","\\bigcap");g(b,S,Zt,"⋃","\\bigcup");g(b,S,Zt,"∫","\\int");g(b,S,Zt,"∫","\\intop");g(b,S,Zt,"∬","\\iint");g(b,S,Zt,"∭","\\iiint");g(b,S,Zt,"∏","\\prod");g(b,S,Zt,"∑","\\sum");g(b,S,Zt,"⨂","\\bigotimes");g(b,S,Zt,"⨁","\\bigoplus");g(b,S,Zt,"⨀","\\bigodot");g(b,S,Zt,"∮","\\oint");g(b,S,Zt,"∯","\\oiint");g(b,S,Zt,"∰","\\oiiint");g(b,S,Zt,"⨆","\\bigsqcup");g(b,S,Zt,"∫","\\smallint");g(Z,S,qs,"…","\\textellipsis");g(b,S,qs,"…","\\mathellipsis");g(Z,S,qs,"…","\\ldots",!0);g(b,S,qs,"…","\\ldots",!0);g(b,S,qs,"⋯","\\@cdots",!0);g(b,S,qs,"⋱","\\ddots",!0);g(b,S,P,"⋮","\\varvdots");g(b,S,It,"ˊ","\\acute");g(b,S,It,"ˋ","\\grave");g(b,S,It,"¨","\\ddot");g(b,S,It,"~","\\tilde");g(b,S,It,"ˉ","\\bar");g(b,S,It,"˘","\\breve");g(b,S,It,"ˇ","\\check");g(b,S,It,"^","\\hat");g(b,S,It,"⃗","\\vec");g(b,S,It,"˙","\\dot");g(b,S,It,"˚","\\mathring");g(b,S,Le,"","\\@imath");g(b,S,Le,"","\\@jmath");g(b,S,P,"ı","ı");g(b,S,P,"ȷ","ȷ");g(Z,S,P,"ı","\\i",!0);g(Z,S,P,"ȷ","\\j",!0);g(Z,S,P,"ß","\\ss",!0);g(Z,S,P,"æ","\\ae",!0);g(Z,S,P,"œ","\\oe",!0);g(Z,S,P,"ø","\\o",!0);g(Z,S,P,"Æ","\\AE",!0);g(Z,S,P,"Œ","\\OE",!0);g(Z,S,P,"Ø","\\O",!0);g(Z,S,It,"ˊ","\\'");g(Z,S,It,"ˋ","\\`");g(Z,S,It,"ˆ","\\^");g(Z,S,It,"˜","\\~");g(Z,S,It,"ˉ","\\=");g(Z,S,It,"˘","\\u");g(Z,S,It,"˙","\\.");g(Z,S,It,"¸","\\c");g(Z,S,It,"˚","\\r");g(Z,S,It,"ˇ","\\v");g(Z,S,It,"¨",'\\"');g(Z,S,It,"˝","\\H");g(Z,S,It,"◯","\\textcircled");var j7={"--":!0,"---":!0,"``":!0,"''":!0};g(Z,S,P,"–","--",!0);g(Z,S,P,"–","\\textendash");g(Z,S,P,"—","---",!0);g(Z,S,P,"—","\\textemdash");g(Z,S,P,"‘","`",!0);g(Z,S,P,"‘","\\textquoteleft");g(Z,S,P,"’","'",!0);g(Z,S,P,"’","\\textquoteright");g(Z,S,P,"“","``",!0);g(Z,S,P,"“","\\textquotedblleft");g(Z,S,P,"”","''",!0);g(Z,S,P,"”","\\textquotedblright");g(b,S,P,"°","\\degree",!0);g(Z,S,P,"°","\\degree");g(Z,S,P,"°","\\textdegree",!0);g(b,S,P,"£","\\pounds");g(b,S,P,"£","\\mathsterling",!0);g(Z,S,P,"£","\\pounds");g(Z,S,P,"£","\\textsterling",!0);g(b,I,P,"✠","\\maltese");g(Z,I,P,"✠","\\maltese");var p4='0123456789/@."';for(var Jf=0;Jf{if(Ca(e.classes)!==Ca(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},NH=e=>{for(var t=0;tn&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},On=function(t,n,r,i){var a=new Bc(t,n,r,i);return my(a),a},q7=(e,t,n,r)=>new Bc(e,t,n,r),IH=function(t,n,r){var i=On([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=he(i.height),i.maxFontSize=1,i},OH=function(t,n,r,i){var a=new py(t,n,r,i);return my(a),a},H7=function(t){var n=new Fc(t);return my(n),n},DH=function(t,n){return t instanceof Fc?On([],[t],n):t},LH=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,a=i,o=1;o{var n=On(["mspace"],[],t),r=Lt(e,t);return n.style.marginRight=he(r),n},Fu=function(t,n,r){var i="";switch(t){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=t}var a;return n==="textbf"&&r==="textit"?a="BoldItalic":n==="textbf"?a="Bold":n==="textit"?a="Italic":a="Regular",i+"-"+a},W7={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},V7={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},FH=function(t,n){var[r,i,a]=V7[t],o=new Ta(r),s=new $i([o],{width:he(i),height:he(a),style:"width:"+he(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=q7(["overlay"],[s],n);return l.height=a,l.style.height=he(a),l.style.width=he(i),l},j={fontMap:W7,makeSymbol:Mr,mathsym:TH,makeSpan:On,makeSvgSpan:q7,makeLineSpan:IH,makeAnchor:OH,makeFragment:H7,wrapFragment:DH,makeVList:PH,makeOrd:RH,makeGlue:zH,staticSvg:FH,svgData:V7,tryCombineChars:NH},Ot={number:3,unit:"mu"},Ua={number:4,unit:"mu"},gi={number:5,unit:"mu"},BH={mord:{mop:Ot,mbin:Ua,mrel:gi,minner:Ot},mop:{mord:Ot,mop:Ot,mrel:gi,minner:Ot},mbin:{mord:Ua,mop:Ua,mopen:Ua,minner:Ua},mrel:{mord:gi,mop:gi,mopen:gi,minner:gi},mopen:{},mclose:{mop:Ot,mbin:Ua,mrel:gi,minner:Ot},mpunct:{mord:Ot,mop:Ot,mrel:gi,mopen:Ot,mclose:Ot,mpunct:Ot,minner:Ot},minner:{mord:Ot,mop:Ot,mbin:Ua,mrel:gi,mopen:Ot,mpunct:Ot,minner:Ot}},$H={mord:{mop:Ot},mop:{mord:Ot,mop:Ot},mbin:{},mrel:{},mopen:{},mclose:{mop:Ot},mpunct:{},minner:{mop:Ot}},Y7={},ch={},uh={};function me(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l{var v=h.classes[0],y=m.classes[0];v==="mbin"&&Pe.contains(jH,y)?h.classes[0]="mord":y==="mbin"&&Pe.contains(UH,v)&&(m.classes[0]="mord")},{node:d},f,p),w4(a,(m,h)=>{var v=Km(h),y=Km(m),w=v&&y?m.hasClass("mtight")?$H[v][y]:BH[v][y]:null;if(w)return j.makeGlue(w,c)},{node:d},f,p),a},w4=function e(t,n,r,i,a){i&&t.push(i);for(var o=0;of=>{t.splice(d+1,0,f),o++})(o)}i&&t.pop()},X7=function(t){return t instanceof Fc||t instanceof py||t instanceof Bc&&t.hasClass("enclosing")?t:null},WH=function e(t,n){var r=X7(t);if(r){var i=r.children;if(i.length){if(n==="right")return e(i[i.length-1],"right");if(n==="left")return e(i[0],"left")}}return t},Km=function(t,n){return t?(n&&(t=WH(t,n)),HH[t.classes[0]]||null):null},cc=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Ui(n.concat(r))},at=function(t,n,r){if(!t)return Ui();if(ch[t.type]){var i=ch[t.type](t,n);if(r&&n.size!==r.size){i=Ui(n.sizingClasses(r),[i],n);var a=n.sizeMultiplier/r.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new ie("Got group of unknown type: '"+t.type+"'")};function Bu(e,t){var n=Ui(["base"],e,t),r=Ui(["strut"]);return r.style.height=he(n.height+n.depth),n.depth&&(r.style.verticalAlign=he(-n.depth)),n.children.unshift(r),n}function Gm(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=rn(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var a=[],o=[],s=0;s0&&(a.push(Bu(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(Bu(o,t));var c;n?(c=Bu(rn(n,t,!0)),c.classes=["tag"],a.push(c)):i&&a.push(i);var u=Ui(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),c){var d=c.children[0];d.style.height=he(u.height+u.depth),u.depth&&(d.style.verticalAlign=he(-u.depth))}return u}function K7(e){return new Fc(e)}class ur{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Ca(this.classes));for(var r=0;r0&&(t+=' class ="'+Pe.escape(Ca(this.classes))+'"'),t+=">";for(var r=0;r",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Ml{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Pe.escape(this.toText())}toText(){return this.text}}class VH{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",he(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var te={MathNode:ur,TextNode:Ml,SpaceNode:VH,newDocumentFragment:K7},br=function(t,n,r){return vt[n][t]&&vt[n][t].replace&&t.charCodeAt(0)!==55349&&!(j7.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=vt[n][t].replace),new te.TextNode(t)},gy=function(t){return t.length===1?t[0]:new te.MathNode("mrow",t)},yy=function(t,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.font;if(!r||r==="mathnormal")return null;var i=t.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var a=t.text;if(Pe.contains(["\\imath","\\jmath"],a))return null;vt[i][a]&&vt[i][a].replace&&(a=vt[i][a].replace);var o=j.fontMap[r].fontName;return fy(a,o,i)?j.fontMap[r].variant:null},jn=function(t,n,r){if(t.length===1){var i=yt(t[0],n);return r&&i instanceof ur&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],o,s=0;s0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),o=l}return a},Aa=function(t,n,r){return gy(jn(t,n,r))},yt=function(t,n){if(!t)return new te.MathNode("mrow");if(uh[t.type]){var r=uh[t.type](t,n);return r}else throw new ie("Got group of unknown type: '"+t.type+"'")};function v4(e,t,n,r,i){var a=jn(e,n),o;a.length===1&&a[0]instanceof ur&&Pe.contains(["mrow","mtable"],a[0].type)?o=a[0]:o=new te.MathNode("mrow",a);var s=new te.MathNode("annotation",[new te.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new te.MathNode("semantics",[o,s]),c=new te.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return j.makeSpan([u],[c])}var G7=function(t){return new ki({style:t.displayMode?De.DISPLAY:De.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},Q7=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=j.makeSpan(r,[t])}return t},YH=function(t,n,r){var i=G7(r),a;if(r.output==="mathml")return v4(t,n,i,r.displayMode,!0);if(r.output==="html"){var o=Gm(t,i);a=j.makeSpan(["katex"],[o])}else{var s=v4(t,n,i,r.displayMode,!1),l=Gm(t,i);a=j.makeSpan(["katex"],[s,l])}return Q7(a,r)},XH=function(t,n,r){var i=G7(r),a=Gm(t,i),o=j.makeSpan(["katex"],[a]);return Q7(o,r)},KH={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},GH=function(t){var n=new te.MathNode("mo",[new te.TextNode(KH[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},QH={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},ZH=function(t){return t.type==="ordgroup"?t.body.length:1},JH=function(t,n){function r(){var s=4e5,l=t.label.slice(1);if(Pe.contains(["widehat","widecheck","widetilde","utilde"],l)){var c=t,u=ZH(c.base),d,f,p;if(u>5)l==="widehat"||l==="widecheck"?(d=420,s=2364,p=.42,f=l+"4"):(d=312,s=2340,p=.34,f="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(s=[0,1062,2364,2364,2364][m],d=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],f=l+m):(s=[0,600,1033,2339,2340][m],d=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],f="tilde"+m)}var h=new Ta(f),v=new $i([h],{width:"100%",height:he(p),viewBox:"0 0 "+s+" "+d,preserveAspectRatio:"none"});return{span:j.makeSvgSpan([],[v],n),minWidth:0,height:p}}else{var y=[],w=QH[l],[x,_,A]=w,E=A/1e3,N=x.length,F,q;if(N===1){var K=w[3];F=["hide-tail"],q=[K]}else if(N===2)F=["halfarrow-left","halfarrow-right"],q=["xMinYMin","xMaxYMin"];else if(N===3)F=["brace-left","brace-center","brace-right"],q=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+N+" children.");for(var W=0;W0&&(i.style.minWidth=he(a)),i},eW=function(t,n,r,i,a){var o,s=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(o=j.makeSpan(["stretchy",n],[],a),n==="fbox"){var l=a.color&&a.getColor();l&&(o.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(n)&&c.push(new Ym({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&c.push(new Ym({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new $i(c,{width:"100%",height:he(s)});o=j.makeSvgSpan([],[u],a)}return o.height=s,o.style.height=he(s),o},ji={encloseSpan:eW,mathMLnode:GH,svgSpan:JH};function Ve(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function by(e){var t=O0(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function O0(e){return e&&(e.type==="atom"||EH.hasOwnProperty(e.type))?e:null}var wy=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=Ve(e.base,"accent"),n=r.base,e.base=n,i=SH(at(e,t)),e.base=r):(r=Ve(e,"accent"),n=r.base);var a=at(n,t.havingCrampedStyle()),o=r.isShifty&&Pe.isCharacterBox(n),s=0;if(o){var l=Pe.getBaseElem(n),c=at(l,t.havingCrampedStyle());s=f4(c).skew}var u=r.label==="\\c",d=u?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),f;if(r.isStretchy)f=ji.svgSpan(r,t),f=j.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+he(2*s)+")",marginLeft:he(2*s)}:void 0}]},t);else{var p,m;r.label==="\\vec"?(p=j.staticSvg("vec",t),m=j.svgData.vec[1]):(p=j.makeOrd({mode:r.mode,text:r.label},t,"textord"),p=f4(p),p.italic=0,m=p.width,u&&(d+=p.depth)),f=j.makeSpan(["accent-body"],[p]);var h=r.label==="\\textcircled";h&&(f.classes.push("accent-full"),d=a.height);var v=s;h||(v-=m/2),f.style.left=he(v),r.label==="\\textcircled"&&(f.style.top=".2em"),f=j.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]},t)}var y=j.makeSpan(["mord","accent"],[f],t);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},Z7=(e,t)=>{var n=e.isStretchy?ji.mathMLnode(e.label):new te.MathNode("mo",[br(e.label,e.mode)]),r=new te.MathNode("mover",[yt(e.base,t),n]);return r.setAttribute("accent","true"),r},tW=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));me({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=dh(t[0]),r=!tW.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:wy,mathmlBuilder:Z7});me({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:wy,mathmlBuilder:Z7});me({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=at(e.base,t),r=ji.svgSpan(e,t),i=e.label==="\\utilde"?.12:0,a=j.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return j.makeSpan(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=ji.mathMLnode(e.label),r=new te.MathNode("munder",[yt(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var $u=e=>{var t=new te.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};me({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=j.wrapFragment(at(e.body,r,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var o;e.below&&(r=t.havingStyle(n.sub()),o=j.wrapFragment(at(e.below,r,t),t),o.classes.push(a+"-arrow-pad"));var s=ji.svgSpan(e,t),l=-t.fontMetrics().axisHeight+.5*s.height,c=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(c-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=j.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:s,shift:l},{type:"elem",elem:o,shift:d}]},t)}else u=j.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:s,shift:l}]},t);return u.children[0].children[0].children[1].classes.push("svg-align"),j.makeSpan(["mrel","x-arrow"],[u],t)},mathmlBuilder(e,t){var n=ji.mathMLnode(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=$u(yt(e.body,t));if(e.below){var a=$u(yt(e.below,t));r=new te.MathNode("munderover",[n,a,i])}else r=new te.MathNode("mover",[n,i])}else if(e.below){var o=$u(yt(e.below,t));r=new te.MathNode("munder",[n,o])}else r=$u(),r=new te.MathNode("mover",[n,r]);return r}});var nW=j.makeSpan;function J7(e,t){var n=rn(e.body,t,!0);return nW([e.mclass],n,t)}function e8(e,t){var n,r=jn(e.body,t);return e.mclass==="minner"?n=new te.MathNode("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new te.MathNode("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new te.MathNode("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}me({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Wt(i),isCharacterBox:Pe.isCharacterBox(i)}},htmlBuilder:J7,mathmlBuilder:e8});var D0=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};me({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:D0(t[0]),body:Wt(t[1]),isCharacterBox:Pe.isCharacterBox(t[1])}}});me({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o;r!=="\\stackrel"?o=D0(i):o="mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Wt(i)},l={type:"supsub",mode:a.mode,base:s,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:n.mode,mclass:o,body:[l],isCharacterBox:Pe.isCharacterBox(l)}},htmlBuilder:J7,mathmlBuilder:e8});me({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:D0(t[0]),body:Wt(t[0])}},htmlBuilder(e,t){var n=rn(e.body,t,!0),r=j.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=jn(e.body,t),r=new te.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var rW={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},x4=()=>({type:"styling",body:[],mode:"math",style:"display"}),k4=e=>e.type==="textord"&&e.text==="@",iW=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function aW(e,t,n){var r=rW[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[a],[]),s=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,s]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function oW(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new ie("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],a=0;a-1))if("<>AV".indexOf(c)>-1)for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',o[l]);var m=aW(c,u,e),h={type:"styling",body:[m],mode:"math",style:"display"};r.push(h),s=x4()}a%2===0?r.push(s):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}me({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=j.wrapFragment(at(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=he(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new te.MathNode("mrow",[yt(e.label,t)]);return n=new te.MathNode("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new te.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});me({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=j.wrapFragment(at(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new te.MathNode("mrow",[yt(e.fragment,t)])}});me({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Ve(t[0],"ordgroup"),i=r.body,a="",o=0;o=1114111)throw new ie("\\@char with invalid code point "+a);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:c}}});var t8=(e,t)=>{var n=rn(e.body,t.withColor(e.color),!1);return j.makeFragment(n)},n8=(e,t)=>{var n=jn(e.body,t.withColor(e.color)),r=new te.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};me({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Ve(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:Wt(i)}},htmlBuilder:t8,mathmlBuilder:n8});me({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Ve(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:t8,mathmlBuilder:n8});me({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&Ve(i,"size").value}},htmlBuilder(e,t){var n=j.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=he(Lt(e.size,t)))),n},mathmlBuilder(e,t){var n=new te.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",he(Lt(e.size,t)))),n}});var Qm={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},r8=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new ie("Expected a control sequence",e);return t},sW=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},i8=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};me({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Qm[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Qm[r.text]),Ve(t.parseFunction(),"internal");throw new ie("Invalid token after macro prefix",r)}});me({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new ie("Expected a control sequence",r);for(var a=0,o,s=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new ie('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new ie('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if(r.text==="EOF")throw new ie("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return o&&l.unshift(o),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:s},n===Qm[n]),{type:"internal",mode:t.mode}}});me({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=r8(t.gullet.popToken());t.gullet.consumeSpaces();var i=sW(t);return i8(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});me({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=r8(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return i8(t,r,a,n==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var fl=function(t,n,r){var i=vt.math[t]&&vt.math[t].replace,a=fy(i||t,n,r);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return a},vy=function(t,n,r,i){var a=r.havingBaseStyle(n),o=j.makeSpan(i.concat(a.sizingClasses(r)),[t],r),s=a.sizeMultiplier/r.sizeMultiplier;return o.height*=s,o.depth*=s,o.maxFontSize=a.sizeMultiplier,o},a8=function(t,n,r){var i=n.havingBaseStyle(r),a=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=he(a),t.height-=a,t.depth+=a},lW=function(t,n,r,i,a,o){var s=j.makeSymbol(t,"Main-Regular",a,i),l=vy(s,n,i,o);return r&&a8(l,i,n),l},cW=function(t,n,r,i){return j.makeSymbol(t,"Size"+n+"-Regular",r,i)},o8=function(t,n,r,i,a,o){var s=cW(t,n,a,i),l=vy(j.makeSpan(["delimsizing","size"+n],[s],i),De.TEXT,i,o);return r&&a8(l,i,De.TEXT),l},rp=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=j.makeSpan(["delimsizinginner",i],[j.makeSpan([],[j.makeSymbol(t,n,r)])]);return{type:"elem",elem:a}},ip=function(t,n,r){var i=Zr["Size4-Regular"][t.charCodeAt(0)]?Zr["Size4-Regular"][t.charCodeAt(0)][4]:Zr["Size1-Regular"][t.charCodeAt(0)][4],a=new Ta("inner",mH(t,Math.round(1e3*n))),o=new $i([a],{width:he(i),height:he(n),style:"width:"+he(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),s=j.makeSvgSpan([],[o],r);return s.height=n,s.style.height=he(n),s.style.width=he(i),{type:"elem",elem:s}},Zm=.008,Uu={type:"kern",size:-1*Zm},uW=["|","\\lvert","\\rvert","\\vert"],dW=["\\|","\\lVert","\\rVert","\\Vert"],s8=function(t,n,r,i,a,o){var s,l,c,u,d="",f=0;s=c=u=t,l=null;var p="Size1-Regular";t==="\\uparrow"?c=u="⏐":t==="\\Uparrow"?c=u="‖":t==="\\downarrow"?s=c="⏐":t==="\\Downarrow"?s=c="‖":t==="\\updownarrow"?(s="\\uparrow",c="⏐",u="\\downarrow"):t==="\\Updownarrow"?(s="\\Uparrow",c="‖",u="\\Downarrow"):Pe.contains(uW,t)?(c="∣",d="vert",f=333):Pe.contains(dW,t)?(c="∥",d="doublevert",f=556):t==="["||t==="\\lbrack"?(s="⎡",c="⎢",u="⎣",p="Size4-Regular",d="lbrack",f=667):t==="]"||t==="\\rbrack"?(s="⎤",c="⎥",u="⎦",p="Size4-Regular",d="rbrack",f=667):t==="\\lfloor"||t==="⌊"?(c=s="⎢",u="⎣",p="Size4-Regular",d="lfloor",f=667):t==="\\lceil"||t==="⌈"?(s="⎡",c=u="⎢",p="Size4-Regular",d="lceil",f=667):t==="\\rfloor"||t==="⌋"?(c=s="⎥",u="⎦",p="Size4-Regular",d="rfloor",f=667):t==="\\rceil"||t==="⌉"?(s="⎤",c=u="⎥",p="Size4-Regular",d="rceil",f=667):t==="("||t==="\\lparen"?(s="⎛",c="⎜",u="⎝",p="Size4-Regular",d="lparen",f=875):t===")"||t==="\\rparen"?(s="⎞",c="⎟",u="⎠",p="Size4-Regular",d="rparen",f=875):t==="\\{"||t==="\\lbrace"?(s="⎧",l="⎨",u="⎩",c="⎪",p="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(s="⎫",l="⎬",u="⎭",c="⎪",p="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(s="⎧",u="⎩",c="⎪",p="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(s="⎫",u="⎭",c="⎪",p="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(s="⎧",u="⎭",c="⎪",p="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(s="⎫",u="⎩",c="⎪",p="Size4-Regular");var m=fl(s,p,a),h=m.height+m.depth,v=fl(c,p,a),y=v.height+v.depth,w=fl(u,p,a),x=w.height+w.depth,_=0,A=1;if(l!==null){var E=fl(l,p,a);_=E.height+E.depth,A=2}var N=h+x+_,F=Math.max(0,Math.ceil((n-N)/(A*y))),q=N+F*A*y,K=i.fontMetrics().axisHeight;r&&(K*=i.sizeMultiplier);var W=q/2-K,X=[];if(d.length>0){var ue=q-h-x,fe=Math.round(q*1e3),Ce=gH(d,Math.round(ue*1e3)),O=new Ta(d,Ce),Y=(f/1e3).toFixed(3)+"em",B=(fe/1e3).toFixed(3)+"em",V=new $i([O],{width:Y,height:B,viewBox:"0 0 "+f+" "+fe}),G=j.makeSvgSpan([],[V],i);G.height=fe/1e3,G.style.width=Y,G.style.height=B,X.push({type:"elem",elem:G})}else{if(X.push(rp(u,p,a)),X.push(Uu),l===null){var R=q-h-x+2*Zm;X.push(ip(c,R,i))}else{var T=(q-h-x-_)/2+2*Zm;X.push(ip(c,T,i)),X.push(Uu),X.push(rp(l,p,a)),X.push(Uu),X.push(ip(c,T,i))}X.push(Uu),X.push(rp(s,p,a))}var Q=i.havingBaseStyle(De.TEXT),ne=j.makeVList({positionType:"bottom",positionData:W,children:X},Q);return vy(j.makeSpan(["delimsizing","mult"],[ne],Q),De.TEXT,i,o)},ap=80,op=.08,sp=function(t,n,r,i,a){var o=pH(t,i,r),s=new Ta(t,o),l=new $i([s],{width:"400em",height:he(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return j.makeSvgSpan(["hide-tail"],[l],a)},hW=function(t,n){var r=n.havingBaseSizing(),i=d8("\\surd",t*r.sizeMultiplier,u8,r),a=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),s,l=0,c=0,u=0,d;return i.type==="small"?(u=1e3+1e3*o+ap,t<1?a=1:t<1.4&&(a=.7),l=(1+o+op)/a,c=(1+o)/a,s=sp("sqrtMain",l,u,o,n),s.style.minWidth="0.853em",d=.833/a):i.type==="large"?(u=(1e3+ap)*Nl[i.size],c=(Nl[i.size]+o)/a,l=(Nl[i.size]+o+op)/a,s=sp("sqrtSize"+i.size,l,u,o,n),s.style.minWidth="1.02em",d=1/a):(l=t+o+op,c=t+o,u=Math.floor(1e3*t+o)+ap,s=sp("sqrtTall",l,u,o,n),s.style.minWidth="0.742em",d=1.056),s.height=c,s.style.height=he(l),{span:s,advanceWidth:d,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*a}},l8=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],fW=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],c8=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Nl=[0,1.2,1.8,2.4,3],pW=function(t,n,r,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),Pe.contains(l8,t)||Pe.contains(c8,t))return o8(t,n,!1,r,i,a);if(Pe.contains(fW,t))return s8(t,Nl[n],!1,r,i,a);throw new ie("Illegal delimiter: '"+t+"'")},mW=[{type:"small",style:De.SCRIPTSCRIPT},{type:"small",style:De.SCRIPT},{type:"small",style:De.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],gW=[{type:"small",style:De.SCRIPTSCRIPT},{type:"small",style:De.SCRIPT},{type:"small",style:De.TEXT},{type:"stack"}],u8=[{type:"small",style:De.SCRIPTSCRIPT},{type:"small",style:De.SCRIPT},{type:"small",style:De.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],yW=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},d8=function(t,n,r,i){for(var a=Math.min(2,3-i.style.size),o=a;on)return r[o]}return r[r.length-1]},h8=function(t,n,r,i,a,o){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var s;Pe.contains(c8,t)?s=mW:Pe.contains(l8,t)?s=u8:s=gW;var l=d8(t,n,s,i);return l.type==="small"?lW(t,l.style,r,i,a,o):l.type==="large"?o8(t,l.size,r,i,a,o):s8(t,n,r,i,a,o)},bW=function(t,n,r,i,a,o){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,u=Math.max(n-s,r+s),d=Math.max(u/500*l,2*u-c);return h8(t,d,!0,i,a,o)},Ii={sqrtImage:hW,sizedDelim:pW,sizeToMaxHeight:Nl,customSizedDelim:h8,leftRightDelim:bW},S4={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},wW=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function L0(e,t){var n=O0(e);if(n&&Pe.contains(wW,n.text))return n;throw n?new ie("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new ie("Invalid delimiter type '"+e.type+"'",e)}me({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=L0(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:S4[e.funcName].size,mclass:S4[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?j.makeSpan([e.mclass]):Ii.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(br(e.delim,e.mode));var n=new te.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=he(Ii.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function _4(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}me({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new ie("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:L0(t[0],e).text,color:n}}});me({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=L0(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=Ve(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{_4(e);for(var n=rn(e.body,t,!0,["mopen","mclose"]),r=0,i=0,a=!1,o=0;o{_4(e);var n=jn(e.body,t);if(e.left!=="."){var r=new te.MathNode("mo",[br(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new te.MathNode("mo",[br(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return gy(n)}});me({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=L0(t[0],e);if(!e.parser.leftrightDepth)throw new ie("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===".")n=cc(t,[]);else{n=Ii.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?br("|","text"):br(e.delim,e.mode),r=new te.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var xy=(e,t)=>{var n=j.wrapFragment(at(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o=0,s=Pe.isCharacterBox(e.body);if(r==="sout")a=j.makeSpan(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=Lt({number:.6,unit:"pt"},t),c=Lt({number:.35,unit:"ex"},t),u=t.havingBaseSizing();i=i/u.sizeMultiplier;var d=n.height+n.depth+l+c;n.style.paddingLeft=he(d/2+l);var f=Math.floor(1e3*d*i),p=hH(f),m=new $i([new Ta("phase",p)],{width:"400em",height:he(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=j.makeSvgSpan(["hide-tail"],[m],t),a.style.height=he(d),o=n.depth+l+c}else{/cancel/.test(r)?s||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var h=0,v=0,y=0;/box/.test(r)?(y=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),h=t.fontMetrics().fboxsep+(r==="colorbox"?0:y),v=h):r==="angl"?(y=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),h=4*y,v=Math.max(0,.25-n.depth)):(h=s?.2:0,v=h),a=ji.encloseSpan(n,r,h,v,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=he(y)):r==="angl"&&y!==.049&&(a.style.borderTopWidth=he(y),a.style.borderRightWidth=he(y)),o=n.depth+v,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=j.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:n,shift:0}]},t);else{var x=/cancel|phase/.test(r)?["svg-align"]:[];w=j.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:x}]},t)}return/cancel/.test(r)&&(w.height=n.height,w.depth=n.depth),/cancel/.test(r)&&!s?j.makeSpan(["mord","cancel-lap"],[w],t):j.makeSpan(["mord"],[w],t)},ky=(e,t)=>{var n=0,r=new te.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[yt(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};me({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Ve(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:xy,mathmlBuilder:ky});me({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Ve(t[0],"color-token").color,o=Ve(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:xy,mathmlBuilder:ky});me({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});me({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:xy,mathmlBuilder:ky});me({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var f8={};function di(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var t=e.parser.settings;if(!t.displayMode)throw new ie("{"+e.envName+"} can be used only in display mode.")};function Sy(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function La(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new ie("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],h=[m],v=[],y=[],w=l!=null?[]:void 0;function x(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function _(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new ri("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),y.push(E4(e));;){var A=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),A={type:"ordgroup",mode:e.mode,body:A},n&&(A={type:"styling",mode:e.mode,style:n,body:[A]}),m.push(A);var E=e.fetch().text;if(E==="&"){if(d&&m.length===d){if(c||s)throw new ie("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(E==="\\end"){_(),m.length===1&&A.type==="styling"&&A.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),y.length0&&(x+=.25),c.push({pos:x,isDashed:lt[tt]})}for(_(o[0]),r=0;r0&&(W+=w,Nlt))for(r=0;r=s)){var Ee=void 0;(i>0||t.hskipBeforeAndAfter)&&(Ee=Pe.deflt(T.pregap,f),Ee!==0&&(Ce=j.makeSpan(["arraycolsep"],[]),Ce.style.width=he(Ee),fe.push(Ce)));var J=[];for(r=0;r0){for(var Ae=j.makeLineSpan("hline",n,u),pt=j.makeLineSpan("hdashline",n,u),et=[{type:"elem",elem:l,shift:0}];c.length>0;){var $e=c.pop(),ut=$e.pos-X;$e.isDashed?et.push({type:"elem",elem:pt,shift:ut}):et.push({type:"elem",elem:Ae,shift:ut})}l=j.makeVList({positionType:"individualShift",children:et},n)}if(Y.length===0)return j.makeSpan(["mord"],[l],n);var de=j.makeVList({positionType:"individualShift",children:Y},n);return de=j.makeSpan(["tag"],[de],n),j.makeFragment([l,de])},vW={c:"center ",l:"left ",r:"right "},fi=function(t,n){for(var r=[],i=new te.MathNode("mtd",[],["mtr-glue"]),a=new te.MathNode("mtd",[],["mml-eqn-num"]),o=0;o0){var m=t.cols,h="",v=!1,y=0,w=m.length;m[0].type==="separator"&&(f+="top ",y=1),m[m.length-1].type==="separator"&&(f+="bottom ",w-=1);for(var x=y;x0?"left ":"",f+=F[F.length-1].length>0?"right ":"";for(var q=1;q-1?"alignat":"align",a=t.envName==="split",o=La(t.parser,{cols:r,addJot:!0,autoTag:a?void 0:Sy(t.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:t.parser.settings.leqno},"display"),s,l=0,c={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var u="",d=0;d0&&p&&(v=1),r[m]={type:"align",align:h,pregap:v,postgap:0}}return o.colSeparationType=p?"align":"alignat",o};di({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=O0(t[0]),r=n?[t[0]]:Ve(t[0],"ordgroup").body,i=r.map(function(o){var s=by(o),l=s.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new ie("Unknown column alignment: "+l,o)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return La(e.parser,a,_y(e.envName))},htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,"lcr".indexOf(n)===-1)throw new ie("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=La(e.parser,r,_y(e.envName)),o=Math.max(0,...a.body.map(s=>s.length));return a.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=La(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=O0(t[0]),r=n?[t[0]]:Ve(t[0],"ordgroup").body,i=r.map(function(o){var s=by(o),l=s.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new ie("Unknown column alignment: "+l,o)});if(i.length>1)throw new ie("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=La(e.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new ie("{subarray} can contain only one column");return a},htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=La(e.parser,t,_y(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:m8,htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Pe.contains(["gather","gather*"],e.envName)&&P0(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Sy(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return La(e.parser,t,"display")},htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:m8,htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){P0(e);var t={autoTag:Sy(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return La(e.parser,t,"display")},htmlBuilder:hi,mathmlBuilder:fi});di({type:"array",names:["CD"],props:{numArgs:0},handler(e){return P0(e),oW(e.parser)},htmlBuilder:hi,mathmlBuilder:fi});C("\\nonumber","\\gdef\\@eqnsw{0}");C("\\notag","\\nonumber");me({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new ie(e.funcName+" valid only within array environment")}});var C4=f8;me({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new ie("Invalid environment name",i);for(var a="",o=0;o{var n=e.font,r=t.withFont(n);return at(e.body,r)},y8=(e,t)=>{var n=e.font,r=t.withFont(n);return yt(e.body,r)},T4={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};me({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=dh(t[0]),a=r;return a in T4&&(a=T4[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:g8,mathmlBuilder:y8});me({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=Pe.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:D0(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}});me({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i),s="math"+r.slice(1);return{type:"font",mode:a,font:s,body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:g8,mathmlBuilder:y8});var b8=(e,t)=>{var n=t;return e==="display"?n=n.id>=De.SCRIPT.id?n.text():De.DISPLAY:e==="text"&&n.size===De.DISPLAY.size?n=De.TEXT:e==="script"?n=De.SCRIPT:e==="scriptscript"&&(n=De.SCRIPTSCRIPT),n},Ey=(e,t)=>{var n=b8(e.size,t.style),r=n.fracNum(),i=n.fracDen(),a;a=t.havingStyle(r);var o=at(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?m=3*f:m=7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var v;if(u){var w=t.fontMetrics().axisHeight;p-o.depth-(w+.5*d){var n=new te.MathNode("mfrac",[yt(e.numer,t),yt(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=Lt(e.barSize,t);n.setAttribute("linethickness",he(r))}var i=b8(e.size,t.style);if(i.size!==t.style.size){n=new te.MathNode("mstyle",[n]);var a=i.size===De.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",a),n.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var o=[];if(e.leftDelim!=null){var s=new te.MathNode("mo",[new te.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),o.push(s)}if(o.push(n),e.rightDelim!=null){var l=new te.MathNode("mo",[new te.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return gy(o)}return n};me({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,l=null,c="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,s="(",l=")";break;case"\\\\bracefrac":o=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:i,denom:a,hasBarLine:o,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:Ey,mathmlBuilder:Cy});me({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});me({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var A4=["display","text","script","scriptscript"],R4=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};me({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=dh(t[0]),o=a.type==="atom"&&a.family==="open"?R4(a.text):null,s=dh(t[1]),l=s.type==="atom"&&s.family==="close"?R4(s.text):null,c=Ve(t[2],"size"),u,d=null;c.isBlank?u=!0:(d=c.value,u=d.number>0);var f="auto",p=t[3];if(p.type==="ordgroup"){if(p.body.length>0){var m=Ve(p.body[0],"textord");f=A4[Number(m.text)]}}else p=Ve(p,"textord"),f=A4[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:l,size:f}},htmlBuilder:Ey,mathmlBuilder:Cy});me({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Ve(t[0],"size").value,token:i}}});me({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Qq(Ve(t[1],"infix").size),o=t[2],s=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Ey,mathmlBuilder:Cy});var w8=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?at(e.sup,t.havingStyle(n.sup()),t):at(e.sub,t.havingStyle(n.sub()),t),i=Ve(e.base,"horizBrace")):i=Ve(e,"horizBrace");var a=at(i.base,t.havingBaseStyle(De.DISPLAY)),o=ji.svgSpan(i,t),s;if(i.isOver?(s=j.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o}]},t),s.children[0].children[0].children[1].classes.push("svg-align")):(s=j.makeVList({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:a}]},t),s.children[0].children[0].children[0].classes.push("svg-align")),r){var l=j.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t);i.isOver?s=j.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):s=j.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return j.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t)},xW=(e,t)=>{var n=ji.mathMLnode(e.label);return new te.MathNode(e.isOver?"mover":"munder",[yt(e.base,t),n])};me({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:w8,mathmlBuilder:xW});me({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Ve(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:Wt(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=rn(e.body,t,!1);return j.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Aa(e.body,t);return n instanceof ur||(n=new ur("mrow",[n])),n.setAttribute("href",e.href),n}});me({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Ve(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:n,funcName:r,token:i}=e,a=Ve(t[0],"raw").string,o=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,l={};switch(r){case"\\htmlClass":l.class=a,s={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,s={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,s={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var c=a.split(","),u=0;u{var n=rn(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=j.makeSpan(r,n,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>Aa(e.body,t)});me({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Wt(t[0]),mathml:Wt(t[1])}},htmlBuilder:(e,t)=>{var n=rn(e.html,t,!1);return j.makeFragment(n)},mathmlBuilder:(e,t)=>Aa(e.mathml,t)});var lp=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new ie("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!F7(r))throw new ie("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};me({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},s="";if(n[0])for(var l=Ve(n[0],"raw").string,c=l.split(","),u=0;u{var n=Lt(e.height,t),r=0;e.totalheight.number>0&&(r=Lt(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Lt(e.width,t));var a={height:he(n+r)};i>0&&(a.width=he(i)),r>0&&(a.verticalAlign=he(-r));var o=new xH(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new te.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=Lt(e.height,t),i=0;if(e.totalheight.number>0&&(i=Lt(e.totalheight,t)-r,n.setAttribute("valign",he(-i))),n.setAttribute("height",he(r+i)),e.width.number>0){var a=Lt(e.width,t);n.setAttribute("width",he(a))}return n.setAttribute("src",e.src),n}});me({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Ve(t[0],"size");if(n.settings.strict){var a=r[1]==="m",o=i.value.unit==="mu";a?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return j.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=Lt(e.dimension,t);return new te.SpaceNode(n)}});me({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=j.makeSpan([],[at(e.body,t)]),n=j.makeSpan(["inner"],[n],t)):n=j.makeSpan(["inner"],[at(e.body,t)]);var r=j.makeSpan(["fix"],[]),i=j.makeSpan([e.alignment],[n,r],t),a=j.makeSpan(["strut"]);return a.style.height=he(i.height+i.depth),i.depth&&(a.style.verticalAlign=he(-i.depth)),i.children.unshift(a),i=j.makeSpan(["thinbox"],[i],t),j.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new te.MathNode("mpadded",[yt(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});me({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a=n==="\\("?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:o}}});me({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new ie("Mismatched "+e.funcName)}});var M4=(e,t)=>{switch(t.style.size){case De.DISPLAY.size:return e.display;case De.TEXT.size:return e.text;case De.SCRIPT.size:return e.script;case De.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};me({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Wt(t[0]),text:Wt(t[1]),script:Wt(t[2]),scriptscript:Wt(t[3])}},htmlBuilder:(e,t)=>{var n=M4(e,t),r=rn(n,t,!1);return j.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=M4(e,t);return Aa(n,t)}});var v8=(e,t,n,r,i,a,o)=>{e=j.makeSpan([],[e]);var s=n&&Pe.isCharacterBox(n),l,c;if(t){var u=at(t,r.havingStyle(i.sup()),r);c={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=at(n,r.havingStyle(i.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(c&&l){var p=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+o;f=j.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:he(-a)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:he(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(l){var m=e.height-o;f=j.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:he(-a)},{type:"kern",size:l.kern},{type:"elem",elem:e}]},r)}else if(c){var h=e.depth+o;f=j.makeVList({positionType:"bottom",positionData:h,children:[{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:he(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return e;var v=[f];if(l&&a!==0&&!s){var y=j.makeSpan(["mspace"],[],r);y.style.marginRight=he(a),v.unshift(y)}return j.makeSpan(["mop","op-limits"],v,r)},x8=["\\smallint"],Hs=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Ve(e.base,"op"),i=!0):a=Ve(e,"op");var o=t.style,s=!1;o.size===De.DISPLAY.size&&a.symbol&&!Pe.contains(x8,a.name)&&(s=!0);var l;if(a.symbol){var c=s?"Size2-Regular":"Size1-Regular",u="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(u=a.name.slice(1),a.name=u==="oiint"?"\\iint":"\\iiint"),l=j.makeSymbol(a.name,c,"math",t,["mop","op-symbol",s?"large-op":"small-op"]),u.length>0){var d=l.italic,f=j.staticSvg(u+"Size"+(s?"2":"1"),t);l=j.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:s?.08:0}]},t),a.name="\\"+u,l.classes.unshift("mop"),l.italic=d}}else if(a.body){var p=rn(a.body,t,!0);p.length===1&&p[0]instanceof yr?(l=p[0],l.classes[0]="mop"):l=j.makeSpan(["mop"],p,t)}else{for(var m=[],h=1;h{var n;if(e.symbol)n=new ur("mo",[br(e.name,e.mode)]),Pe.contains(x8,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new ur("mo",jn(e.body,t));else{n=new ur("mi",[new Ml(e.name.slice(1))]);var r=new ur("mo",[br("⁡","text")]);e.parentIsSupSub?n=new ur("mrow",[n,r]):n=K7([n,r])}return n},kW={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};me({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=kW[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Hs,mathmlBuilder:$c});me({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Wt(r)}},htmlBuilder:Hs,mathmlBuilder:$c});var SW={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};me({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Hs,mathmlBuilder:$c});me({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Hs,mathmlBuilder:$c});me({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=SW[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Hs,mathmlBuilder:$c});var k8=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Ve(e.base,"operatorname"),i=!0):a=Ve(e,"operatorname");var o;if(a.body.length>0){for(var s=a.body.map(d=>{var f=d.text;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=rn(s,t.withFont("mathrm"),!0),c=0;c{for(var n=jn(e.body,t.withFont("mathrm")),r=!0,i=0;iu.toText()).join("");n=[new te.TextNode(s)]}var l=new te.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new te.MathNode("mo",[br("⁡","text")]);return e.parentIsSupSub?new te.MathNode("mrow",[l,c]):te.newDocumentFragment([l,c])};me({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:Wt(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:k8,mathmlBuilder:_W});C("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");So({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?j.makeFragment(rn(e.body,t,!1)):j.makeSpan(["mord"],rn(e.body,t,!0),t)},mathmlBuilder(e,t){return Aa(e.body,t,!0)}});me({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=at(e.body,t.havingCrampedStyle()),r=j.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=j.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return j.makeSpan(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new te.MathNode("mo",[new te.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new te.MathNode("mover",[yt(e.body,t),n]);return r.setAttribute("accent","true"),r}});me({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Wt(r)}},htmlBuilder:(e,t)=>{var n=rn(e.body,t.withPhantom(),!1);return j.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=jn(e.body,t);return new te.MathNode("mphantom",n)}});me({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=j.makeSpan([],[at(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=jn(Wt(e.body),t),r=new te.MathNode("mphantom",n),i=new te.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});me({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=j.makeSpan(["inner"],[at(e.body,t.withPhantom())]),r=j.makeSpan(["fix"],[]);return j.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=jn(Wt(e.body),t),r=new te.MathNode("mphantom",n),i=new te.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}});me({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Ve(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=at(e.body,t),r=Lt(e.dy,t);return j.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new te.MathNode("mpadded",[yt(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});me({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});me({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Ve(t[0],"size"),o=Ve(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Ve(i,"size").value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=j.makeSpan(["mord","rule"],[],t),r=Lt(e.width,t),i=Lt(e.height,t),a=e.shift?Lt(e.shift,t):0;return n.style.borderRightWidth=he(r),n.style.borderTopWidth=he(i),n.style.bottom=he(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Lt(e.width,t),r=Lt(e.height,t),i=e.shift?Lt(e.shift,t):0,a=t.color&&t.getColor()||"black",o=new te.MathNode("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",he(n)),o.setAttribute("height",he(r));var s=new te.MathNode("mpadded",[o]);return i>=0?s.setAttribute("height",he(i)):(s.setAttribute("height",he(i)),s.setAttribute("depth",he(-i))),s.setAttribute("voffset",he(i)),s}});function S8(e,t,n){for(var r=rn(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=t.havingSize(e.size);return S8(e.body,n,t)};me({type:"sizing",names:N4,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:N4.indexOf(r)+1,body:a}},htmlBuilder:EW,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=jn(e.body,n),i=new te.MathNode("mstyle",r);return i.setAttribute("mathsize",he(n.sizeMultiplier)),i}});me({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Ve(n[0],"ordgroup");if(o)for(var s="",l=0;l{var n=j.makeSpan([],[at(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new te.MathNode("mpadded",[yt(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});me({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=at(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=j.wrapFragment(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,a=i;t.style.idn.height+n.depth+o&&(o=(o+d-n.height-n.depth)/2);var f=l.height-n.height-o-c;n.style.paddingLeft=he(u);var p=j.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+f)},{type:"elem",elem:l},{type:"kern",size:c}]},t);if(e.index){var m=t.havingStyle(De.SCRIPTSCRIPT),h=at(e.index,m,t),v=.6*(p.height-p.depth),y=j.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:h}]},t),w=j.makeSpan(["root"],[y]);return j.makeSpan(["mord","sqrt"],[w,p],t)}else return j.makeSpan(["mord","sqrt"],[p],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new te.MathNode("mroot",[yt(n,t),yt(r,t)]):new te.MathNode("msqrt",[yt(n,t)])}});var I4={display:De.DISPLAY,text:De.TEXT,script:De.SCRIPT,scriptscript:De.SCRIPTSCRIPT};me({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=I4[e.style],r=t.havingStyle(n).withFont("");return S8(e.body,r,t)},mathmlBuilder(e,t){var n=I4[e.style],r=t.havingStyle(n),i=jn(e.body,r),a=new te.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=o[e.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}});var CW=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===De.DISPLAY.size||r.alwaysHandleSupSub);return i?Hs:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(n.style.size===De.DISPLAY.size||r.limits);return a?k8:null}else{if(r.type==="accent")return Pe.isCharacterBox(r.base)?wy:null;if(r.type==="horizBrace"){var o=!t.sub;return o===r.isOver?w8:null}else return null}else return null};So({type:"supsub",htmlBuilder(e,t){var n=CW(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=at(r,t),s,l,c=t.fontMetrics(),u=0,d=0,f=r&&Pe.isCharacterBox(r);if(i){var p=t.havingStyle(t.style.sup());s=at(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());l=at(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h;t.style===De.DISPLAY?h=c.sup1:t.style.cramped?h=c.sup3:h=c.sup2;var v=t.sizeMultiplier,y=he(.5/c.ptPerEm/v),w=null;if(l){var x=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(o instanceof yr||x)&&(w=he(-o.italic))}var _;if(s&&l){u=Math.max(u,h,s.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var A=c.defaultRuleThickness,E=4*A;if(u-s.depth-(l.height-d)0&&(u+=N,d-=N)}var F=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:w},{type:"elem",elem:s,shift:-u,marginRight:y}];_=j.makeVList({positionType:"individualShift",children:F},t)}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var q=[{type:"elem",elem:l,marginLeft:w,marginRight:y}];_=j.makeVList({positionType:"shift",positionData:d,children:q},t)}else if(s)u=Math.max(u,h,s.depth+.25*c.xHeight),_=j.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:s,marginRight:y}]},t);else throw new Error("supsub must have either sup or sub.");var K=Km(o,"right")||"mord";return j.makeSpan([K],[o,j.makeSpan(["msupsub"],[_])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[yt(e.base,t)];e.sub&&a.push(yt(e.sub,t)),e.sup&&a.push(yt(e.sup,t));var o;if(n)o=r?"mover":"munder";else if(e.sub)if(e.sup){var c=e.base;c&&c.type==="op"&&c.limits&&t.style===De.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(t.style===De.DISPLAY||c.limits)?o="munderover":o="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===De.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===De.DISPLAY)?o="munder":o="msub"}else{var s=e.base;s&&s.type==="op"&&s.limits&&(t.style===De.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||t.style===De.DISPLAY)?o="mover":o="msup"}return new te.MathNode(o,a)}});So({type:"atom",htmlBuilder(e,t){return j.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new te.MathNode("mo",[br(e.text,e.mode)]);if(e.family==="bin"){var r=yy(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var _8={mi:"italic",mn:"normal",mtext:"normal"};So({type:"mathord",htmlBuilder(e,t){return j.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new te.MathNode("mi",[br(e.text,e.mode,t)]),r=yy(e,t)||"italic";return r!==_8[n.type]&&n.setAttribute("mathvariant",r),n}});So({type:"textord",htmlBuilder(e,t){return j.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n=br(e.text,e.mode,t),r=yy(e,t)||"normal",i;return e.mode==="text"?i=new te.MathNode("mtext",[n]):/[0-9]/.test(e.text)?i=new te.MathNode("mn",[n]):e.text==="\\prime"?i=new te.MathNode("mo",[n]):i=new te.MathNode("mi",[n]),r!==_8[i.type]&&i.setAttribute("mathvariant",r),i}});var cp={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},up={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};So({type:"spacing",htmlBuilder(e,t){if(up.hasOwnProperty(e.text)){var n=up[e.text].className||"";if(e.mode==="text"){var r=j.makeOrd(e,t,"textord");return r.classes.push(n),r}else return j.makeSpan(["mspace",n],[j.mathsym(e.text,e.mode,t)],t)}else{if(cp.hasOwnProperty(e.text))return j.makeSpan(["mspace",cp[e.text]],[],t);throw new ie('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(up.hasOwnProperty(e.text))n=new te.MathNode("mtext",[new te.TextNode(" ")]);else{if(cp.hasOwnProperty(e.text))return new te.MathNode("mspace");throw new ie('Unknown type of space "'+e.text+'"')}return n}});var O4=()=>{var e=new te.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};So({type:"tag",mathmlBuilder(e,t){var n=new te.MathNode("mtable",[new te.MathNode("mtr",[O4(),new te.MathNode("mtd",[Aa(e.body,t)]),O4(),new te.MathNode("mtd",[Aa(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var D4={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},L4={"\\textbf":"textbf","\\textmd":"textmd"},TW={"\\textit":"textit","\\textup":"textup"},P4=(e,t)=>{var n=e.font;return n?D4[n]?t.withTextFontFamily(D4[n]):L4[n]?t.withTextFontWeight(L4[n]):t.withTextFontShape(TW[n]):t};me({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:Wt(i),font:r}},htmlBuilder(e,t){var n=P4(e,t),r=rn(e.body,n,!0);return j.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=P4(e,t);return Aa(e.body,n)}});me({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=at(e.body,t),r=j.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=j.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return j.makeSpan(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new te.MathNode("mo",[new te.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new te.MathNode("munder",[yt(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});me({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=at(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return j.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new te.MathNode("mpadded",[yt(e.body,t)],["vcenter"])}});me({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new ie("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=z4(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),da=Y7,E8=`[ \r + ]`,AW="\\\\[a-zA-Z@]+",RW="\\\\[^\uD800-\uDFFF]",MW="("+AW+")"+E8+"*",NW=`\\\\( +|[ \r ]+ +?)[ \r ]*`,Jm="[̀-ͯ]",IW=new RegExp(Jm+"+$"),OW="("+E8+"+)|"+(NW+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Jm+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Jm+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+MW)+("|"+RW+")");class F4{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(OW,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new ri("EOF",new Vn(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new ie("Unexpected character: '"+t[n]+"'",new ri(t[n],new Vn(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new ri(i,new Vn(this,n,this.tokenRegex.lastIndex))}}class DW{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new ie("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var LW=p8;C("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});C("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});C("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});C("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});C("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});C("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");C("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var B4={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};C("\\char",function(e){var t=e.popToken(),n,r="";if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new ie("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=B4[t.text],r==null||r>=n)throw new ie("Invalid base-"+n+" digit "+t.text);for(var i;(i=B4[e.future().text])!=null&&i{var r=e.consumeArg().tokens;if(r.length!==1)throw new ie("\\newcommand's first argument must be a macro name");var i=r[0].text,a=e.isDefined(i);if(a&&!t)throw new ie("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!n)throw new ie("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(r=e.consumeArg().tokens,r.length===1&&r[0].text==="["){for(var s="",l=e.expandNextToken();l.text!=="]"&&l.text!=="EOF";)s+=l.text,l=e.expandNextToken();if(!s.match(/^\s*[0-9]+\s*$/))throw new ie("Invalid number of arguments: "+s);o=parseInt(s),r=e.consumeArg().tokens}return e.macros.set(i,{tokens:r,numArgs:o}),""};C("\\newcommand",e=>Ty(e,!1,!0));C("\\renewcommand",e=>Ty(e,!0,!1));C("\\providecommand",e=>Ty(e,!0,!0));C("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});C("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});C("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),da[n],vt.math[n],vt.text[n]),""});C("\\bgroup","{");C("\\egroup","}");C("~","\\nobreakspace");C("\\lq","`");C("\\rq","'");C("\\aa","\\r a");C("\\AA","\\r A");C("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");C("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");C("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");C("ℬ","\\mathscr{B}");C("ℰ","\\mathscr{E}");C("ℱ","\\mathscr{F}");C("ℋ","\\mathscr{H}");C("ℐ","\\mathscr{I}");C("ℒ","\\mathscr{L}");C("ℳ","\\mathscr{M}");C("ℛ","\\mathscr{R}");C("ℭ","\\mathfrak{C}");C("ℌ","\\mathfrak{H}");C("ℨ","\\mathfrak{Z}");C("\\Bbbk","\\Bbb{k}");C("·","\\cdotp");C("\\llap","\\mathllap{\\textrm{#1}}");C("\\rlap","\\mathrlap{\\textrm{#1}}");C("\\clap","\\mathclap{\\textrm{#1}}");C("\\mathstrut","\\vphantom{(}");C("\\underbar","\\underline{\\text{#1}}");C("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');C("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");C("\\ne","\\neq");C("≠","\\neq");C("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");C("∉","\\notin");C("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");C("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");C("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");C("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");C("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");C("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");C("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");C("⟂","\\perp");C("‼","\\mathclose{!\\mkern-0.8mu!}");C("∌","\\notni");C("⌜","\\ulcorner");C("⌝","\\urcorner");C("⌞","\\llcorner");C("⌟","\\lrcorner");C("©","\\copyright");C("®","\\textregistered");C("️","\\textregistered");C("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');C("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');C("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');C("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');C("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");C("⋮","\\vdots");C("\\varGamma","\\mathit{\\Gamma}");C("\\varDelta","\\mathit{\\Delta}");C("\\varTheta","\\mathit{\\Theta}");C("\\varLambda","\\mathit{\\Lambda}");C("\\varXi","\\mathit{\\Xi}");C("\\varPi","\\mathit{\\Pi}");C("\\varSigma","\\mathit{\\Sigma}");C("\\varUpsilon","\\mathit{\\Upsilon}");C("\\varPhi","\\mathit{\\Phi}");C("\\varPsi","\\mathit{\\Psi}");C("\\varOmega","\\mathit{\\Omega}");C("\\substack","\\begin{subarray}{c}#1\\end{subarray}");C("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");C("\\boxed","\\fbox{$\\displaystyle{#1}$}");C("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");C("\\implies","\\DOTSB\\;\\Longrightarrow\\;");C("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var $4={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};C("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in $4?t=$4[n]:(n.slice(0,4)==="\\not"||n in vt.math&&Pe.contains(["bin","rel"],vt.math[n].group))&&(t="\\dotsb"),t});var Ay={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};C("\\dotso",function(e){var t=e.future().text;return t in Ay?"\\ldots\\,":"\\ldots"});C("\\dotsc",function(e){var t=e.future().text;return t in Ay&&t!==","?"\\ldots\\,":"\\ldots"});C("\\cdots",function(e){var t=e.future().text;return t in Ay?"\\@cdots\\,":"\\@cdots"});C("\\dotsb","\\cdots");C("\\dotsm","\\cdots");C("\\dotsi","\\!\\cdots");C("\\dotsx","\\ldots\\,");C("\\DOTSI","\\relax");C("\\DOTSB","\\relax");C("\\DOTSX","\\relax");C("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");C("\\,","\\tmspace+{3mu}{.1667em}");C("\\thinspace","\\,");C("\\>","\\mskip{4mu}");C("\\:","\\tmspace+{4mu}{.2222em}");C("\\medspace","\\:");C("\\;","\\tmspace+{5mu}{.2777em}");C("\\thickspace","\\;");C("\\!","\\tmspace-{3mu}{.1667em}");C("\\negthinspace","\\!");C("\\negmedspace","\\tmspace-{4mu}{.2222em}");C("\\negthickspace","\\tmspace-{5mu}{.277em}");C("\\enspace","\\kern.5em ");C("\\enskip","\\hskip.5em\\relax");C("\\quad","\\hskip1em\\relax");C("\\qquad","\\hskip2em\\relax");C("\\tag","\\@ifstar\\tag@literal\\tag@paren");C("\\tag@paren","\\tag@literal{({#1})}");C("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new ie("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});C("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");C("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");C("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");C("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");C("\\newline","\\\\\\relax");C("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var C8=he(Zr["Main-Regular"]["T".charCodeAt(0)][1]-.7*Zr["Main-Regular"]["A".charCodeAt(0)][1]);C("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+C8+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");C("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+C8+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");C("\\hspace","\\@ifstar\\@hspacer\\@hspace");C("\\@hspace","\\hskip #1\\relax");C("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");C("\\ordinarycolon",":");C("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");C("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');C("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');C("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');C("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');C("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');C("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');C("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');C("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');C("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');C("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');C("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');C("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');C("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');C("∷","\\dblcolon");C("∹","\\eqcolon");C("≔","\\coloneqq");C("≕","\\eqqcolon");C("⩴","\\Coloneqq");C("\\ratio","\\vcentcolon");C("\\coloncolon","\\dblcolon");C("\\colonequals","\\coloneqq");C("\\coloncolonequals","\\Coloneqq");C("\\equalscolon","\\eqqcolon");C("\\equalscoloncolon","\\Eqqcolon");C("\\colonminus","\\coloneq");C("\\coloncolonminus","\\Coloneq");C("\\minuscolon","\\eqcolon");C("\\minuscoloncolon","\\Eqcolon");C("\\coloncolonapprox","\\Colonapprox");C("\\coloncolonsim","\\Colonsim");C("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");C("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");C("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");C("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");C("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");C("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");C("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");C("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");C("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");C("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");C("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");C("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");C("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");C("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");C("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");C("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");C("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");C("\\nleqq","\\html@mathml{\\@nleqq}{≰}");C("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");C("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");C("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");C("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");C("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");C("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");C("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");C("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");C("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");C("\\imath","\\html@mathml{\\@imath}{ı}");C("\\jmath","\\html@mathml{\\@jmath}{ȷ}");C("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");C("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");C("⟦","\\llbracket");C("⟧","\\rrbracket");C("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");C("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");C("⦃","\\lBrace");C("⦄","\\rBrace");C("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");C("⦵","\\minuso");C("\\darr","\\downarrow");C("\\dArr","\\Downarrow");C("\\Darr","\\Downarrow");C("\\lang","\\langle");C("\\rang","\\rangle");C("\\uarr","\\uparrow");C("\\uArr","\\Uparrow");C("\\Uarr","\\Uparrow");C("\\N","\\mathbb{N}");C("\\R","\\mathbb{R}");C("\\Z","\\mathbb{Z}");C("\\alef","\\aleph");C("\\alefsym","\\aleph");C("\\Alpha","\\mathrm{A}");C("\\Beta","\\mathrm{B}");C("\\bull","\\bullet");C("\\Chi","\\mathrm{X}");C("\\clubs","\\clubsuit");C("\\cnums","\\mathbb{C}");C("\\Complex","\\mathbb{C}");C("\\Dagger","\\ddagger");C("\\diamonds","\\diamondsuit");C("\\empty","\\emptyset");C("\\Epsilon","\\mathrm{E}");C("\\Eta","\\mathrm{H}");C("\\exist","\\exists");C("\\harr","\\leftrightarrow");C("\\hArr","\\Leftrightarrow");C("\\Harr","\\Leftrightarrow");C("\\hearts","\\heartsuit");C("\\image","\\Im");C("\\infin","\\infty");C("\\Iota","\\mathrm{I}");C("\\isin","\\in");C("\\Kappa","\\mathrm{K}");C("\\larr","\\leftarrow");C("\\lArr","\\Leftarrow");C("\\Larr","\\Leftarrow");C("\\lrarr","\\leftrightarrow");C("\\lrArr","\\Leftrightarrow");C("\\Lrarr","\\Leftrightarrow");C("\\Mu","\\mathrm{M}");C("\\natnums","\\mathbb{N}");C("\\Nu","\\mathrm{N}");C("\\Omicron","\\mathrm{O}");C("\\plusmn","\\pm");C("\\rarr","\\rightarrow");C("\\rArr","\\Rightarrow");C("\\Rarr","\\Rightarrow");C("\\real","\\Re");C("\\reals","\\mathbb{R}");C("\\Reals","\\mathbb{R}");C("\\Rho","\\mathrm{P}");C("\\sdot","\\cdot");C("\\sect","\\S");C("\\spades","\\spadesuit");C("\\sub","\\subset");C("\\sube","\\subseteq");C("\\supe","\\supseteq");C("\\Tau","\\mathrm{T}");C("\\thetasym","\\vartheta");C("\\weierp","\\wp");C("\\Zeta","\\mathrm{Z}");C("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");C("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");C("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");C("\\bra","\\mathinner{\\langle{#1}|}");C("\\ket","\\mathinner{|{#1}\\rangle}");C("\\braket","\\mathinner{\\langle{#1}\\rangle}");C("\\Bra","\\left\\langle#1\\right|");C("\\Ket","\\left|#1\\right\\rangle");var T8=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=d=>f=>{e&&(f.macros.set("|",o),i.length&&f.macros.set("\\|",s));var p=d;if(!d&&i.length){var m=f.future();m.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...a,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};C("\\bra@ket",T8(!1));C("\\bra@set",T8(!0));C("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");C("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");C("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");C("\\angln","{\\angl n}");C("\\blue","\\textcolor{##6495ed}{#1}");C("\\orange","\\textcolor{##ffa500}{#1}");C("\\pink","\\textcolor{##ff00af}{#1}");C("\\red","\\textcolor{##df0030}{#1}");C("\\green","\\textcolor{##28ae7b}{#1}");C("\\gray","\\textcolor{gray}{#1}");C("\\purple","\\textcolor{##9d38bd}{#1}");C("\\blueA","\\textcolor{##ccfaff}{#1}");C("\\blueB","\\textcolor{##80f6ff}{#1}");C("\\blueC","\\textcolor{##63d9ea}{#1}");C("\\blueD","\\textcolor{##11accd}{#1}");C("\\blueE","\\textcolor{##0c7f99}{#1}");C("\\tealA","\\textcolor{##94fff5}{#1}");C("\\tealB","\\textcolor{##26edd5}{#1}");C("\\tealC","\\textcolor{##01d1c1}{#1}");C("\\tealD","\\textcolor{##01a995}{#1}");C("\\tealE","\\textcolor{##208170}{#1}");C("\\greenA","\\textcolor{##b6ffb0}{#1}");C("\\greenB","\\textcolor{##8af281}{#1}");C("\\greenC","\\textcolor{##74cf70}{#1}");C("\\greenD","\\textcolor{##1fab54}{#1}");C("\\greenE","\\textcolor{##0d923f}{#1}");C("\\goldA","\\textcolor{##ffd0a9}{#1}");C("\\goldB","\\textcolor{##ffbb71}{#1}");C("\\goldC","\\textcolor{##ff9c39}{#1}");C("\\goldD","\\textcolor{##e07d10}{#1}");C("\\goldE","\\textcolor{##a75a05}{#1}");C("\\redA","\\textcolor{##fca9a9}{#1}");C("\\redB","\\textcolor{##ff8482}{#1}");C("\\redC","\\textcolor{##f9685d}{#1}");C("\\redD","\\textcolor{##e84d39}{#1}");C("\\redE","\\textcolor{##bc2612}{#1}");C("\\maroonA","\\textcolor{##ffbde0}{#1}");C("\\maroonB","\\textcolor{##ff92c6}{#1}");C("\\maroonC","\\textcolor{##ed5fa6}{#1}");C("\\maroonD","\\textcolor{##ca337c}{#1}");C("\\maroonE","\\textcolor{##9e034e}{#1}");C("\\purpleA","\\textcolor{##ddd7ff}{#1}");C("\\purpleB","\\textcolor{##c6b9fc}{#1}");C("\\purpleC","\\textcolor{##aa87ff}{#1}");C("\\purpleD","\\textcolor{##7854ab}{#1}");C("\\purpleE","\\textcolor{##543b78}{#1}");C("\\mintA","\\textcolor{##f5f9e8}{#1}");C("\\mintB","\\textcolor{##edf2df}{#1}");C("\\mintC","\\textcolor{##e0e5cc}{#1}");C("\\grayA","\\textcolor{##f6f7f7}{#1}");C("\\grayB","\\textcolor{##f0f1f2}{#1}");C("\\grayC","\\textcolor{##e3e5e6}{#1}");C("\\grayD","\\textcolor{##d6d8da}{#1}");C("\\grayE","\\textcolor{##babec2}{#1}");C("\\grayF","\\textcolor{##888d93}{#1}");C("\\grayG","\\textcolor{##626569}{#1}");C("\\grayH","\\textcolor{##3b3e40}{#1}");C("\\grayI","\\textcolor{##21242c}{#1}");C("\\kaBlue","\\textcolor{##314453}{#1}");C("\\kaGreen","\\textcolor{##71B307}{#1}");var A8={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class PW{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new DW(LW,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new F4(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new ri("EOF",r.loc)),this.pushTokens(i),n.range(r,"")}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,o=0,s=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new ie("Extra }",a)}else if(a.text==="EOF")throw new ie("Unexpected end of input in a macro argument, expected '"+(t&&r?t[s]:"}")+"'",a);if(t&&r)if((o===0||o===1&&t[s]==="{")&&a.text===t[s]){if(++s,s===t.length){n.splice(-s,s);break}}else s=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new ie("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new ie("Too many expansions: infinite loop or need to increase maxExpand setting");var a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var s=a.length-1;s>=0;--s){var l=a[s];if(l.text==="#"){if(s===0)throw new ie("Incomplete placeholder at end of macro body",l);if(l=a[--s],l.text==="#")a.splice(s+1,1);else if(/^[1-9]$/.test(l.text))a.splice(s,2,...o[+l.text-1]);else throw new ie("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new ri(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(a+1))!==-1;)++a;for(var s=new F4(i,this.settings),l=[],c=s.lex();c.text!=="EOF";)l.push(c),c=s.lex();l.reverse();var u={tokens:l,numArgs:a};return u}return i}isDefined(t){return this.macros.has(t)||da.hasOwnProperty(t)||vt.math.hasOwnProperty(t)||vt.text.hasOwnProperty(t)||A8.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:da.hasOwnProperty(t)&&!da[t].primitive}}var U4=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ju=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),dp={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},j4={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class uc{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new PW(t,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new ie("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new ri("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(uc.endOfExpression.indexOf(i.text)!==-1||n&&i.text===n||t&&da[i.text]&&da[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var s=vt[this.mode][n].group,l=Vn.range(t),c;if(_H.hasOwnProperty(s)){var u=s;c={type:"atom",mode:this.mode,family:u,loc:l,text:n}}else c={type:s,mode:this.mode,loc:l,text:n};o=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(z7(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:Vn.range(t),text:n};else return null;if(this.consume(),a)for(var d=0;do&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function N8(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function UW(e,t){return H4(e,t.inConstruct,!0)&&!H4(e,t.notInConstruct,!1)}function H4(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r=c||u+1":""))+")"})}return d;function d(){let f=[],p,m,h;if((!t||i(s,l,c[c.length-1]||null))&&(f=eV(n(s,c)),f[0]===V4))return f;if(s.children&&f[0]!==ZW)for(m=(r?s.children.length:-1)+a,h=c.concat(s);m>-1&&ml&&(l=c):c&&(l!==void 0&&l>-1&&s.push(` +`.repeat(l)||" "),l=-1,s.push(c))}return s.join("")}function L8(e,t,n){return e.type==="element"?sV(e,t,n):e.type==="text"?n.whitespace==="normal"?P8(e,n):lV(e):[]}function sV(e,t,n){const r=z8(e,n),i=e.children||[];let a=-1,o=[];if(aV(e))return o;let s,l;for(eg(e)||Q4(e)&&Y4(t,e,Q4)?l=` +`:iV(e)?(s=2,l=2):D8(e)&&(s=1,l=1);++a4&&n.slice(0,4)==="data"&&gV.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(J4,vV);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!J4.test(a)){let o=a.replace(yV,wV);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Oy}return new i(r,t)}function wV(e){return"-"+e.toLowerCase()}function vV(e){return e.charAt(1).toUpperCase()}const xV=F8([U8,$8,H8,W8,pV],"html"),kV=F8([U8,$8,H8,W8,mV],"svg"),e2=/[#.]/g;function SV(e,t){const n=e||"",r={};let i=0,a,o;for(;i{tV(r,"element",a=>{const o=a.properties&&Array.isArray(a.properties.className)?a.properties.className:[],s=o.includes("math-inline"),l=o.includes("math-display");if(!s&&!l)return;const c=oV(a,{whitespace:"pre"});let u;try{u=q4.renderToString(c,a2({},t,{displayMode:l,throwOnError:!0}))}catch(f){const p=f,m=n?"fail":"message",h=[UV,p.name.toLowerCase()].join(":");if(i[m](p.message,a.position,h),p.name!=="ParseError"){a.children=[{type:"element",tagName:"span",properties:{className:["katex-error"],title:String(p),style:"color:"+(t.errorColor||"#cc0000")},children:[{type:"text",value:c}]}];return}u=q4.renderToString(c,a2({},t,{displayMode:l,throwOnError:!1,strict:"ignore"}))}const d=BV(u,{fragment:!0});a.children=d.children})}}const jV=L.div` + height: ${e=>e.theme.scale.scale10}; + background: #0a0c28; + @media screen and (max-width: 1024px) { + height: 414px; + } + @media screen and (max-width: 768px) { + height: 276px; + } +`,qV=L.main` + max-width: 1024px; + margin-top: -${e=>e.theme.scale.scale09}; + margin-bottom: ${e=>e.theme.scale.scale07}; + margin-inline: auto; + padding-inline: 64px; + // - - - + /* height: 400px; */ + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 15px; + } + @media screen and (max-width: 1024px) { + margin-top: -252px; + } + @media screen and (max-width: 768px) { + margin-top: -168px; + padding-inline: 32px; + } +`,HV=L.h1` + margin-bottom: ${e=>e.theme.scale.scale03}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize8}; + /* line-height: ${e=>e.theme.font.lineHeight9}; */ + line-height: 1.4; + text-transform: capitalize; + /* word-break: break-all; */ + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 34.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 23px; + } +`,G8=L.p` + margin-bottom: ${e=>e.theme.scale.scale04}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize5}; + /* line-height: ${e=>e.theme.font.lineHeight5}; */ + line-height: 1.3; + @media screen and (max-width: 1024px) { + margin-bottom: 24px; + font-size: 18px; + } + @media screen and (max-width: 768px) { + margin-bottom: 16px; + font-size: 12px; + } +`,WV=L.a` + display: flex; + align-items: center; + margin-bottom: ${e=>e.theme.scale.scale04}; + @media screen and (max-width: 1024px) { + margin-bottom: 24px; + } + @media screen and (max-width: 768px) { + margin-bottom: 16px; + } +`,VV=L.img` + margin-right: 24px; + height: ${e=>e.theme.scale.scale06}; + width: ${e=>e.theme.scale.scale06}; + border: 2px solid ${e=>e.theme.color.neutral.gray01}; + border-radius: 50%; + @media screen and (max-width: 1024px) { + margin-right: 18px; + height: 60px; + width: 60px; + } + @media screen and (max-width: 768px) { + margin-right: 12px; + height: 60px; + width: 60px; + } +`,YV=L(G8)` + margin-bottom: 0; +`,XV=L.img` + width: 100%; + margin-bottom: ${e=>e.theme.scale.scale04}; + border-radius: ${e=>e.theme.scale.scale02}; + /* height: 336px; */ + @media screen and (max-width: 1024px) { + margin-bottom: 24px; + border-radius: 9px; + } + @media screen and (max-width: 768px) { + margin-bottom: 16px; + border-radius: 6px; + } +`,KV=L.div` + margin-bottom: ${e=>e.theme.scale.scale08}; + @media screen and (max-width: 1024px) { + margin-bottom: 156px; + } + @media screen and (max-width: 768px) { + margin-bottom: 104px; + } +`,GV=L.div``,QV=L.div` + text-align: center; + margin-bottom: ${e=>e.theme.scale.scale06}; + @media screen and (max-width: 1024px) { + margin-bottom: 60px; + } + @media screen and (max-width: 768px) { + margin-bottom: 40px; + } +`,ZV=L.span` + padding-inline: ${e=>e.theme.scale.scale06}; + padding-bottom: ${e=>e.theme.scale.scale01}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize8}; + /* line-height: ${e=>e.theme.font.lineHeight8}; */ + line-height: 1.2; + text-transform: capitalize; + background-image: url(${Wi}); + background-clip: border-box; + background-repeat: no-repeat; + background-position: bottom 0 right 0; + background-size: 50%; + @media screen and (max-width: 768px) { + padding-inline: 60px; + padding-bottom: 6px; + font-size: 34.5px; + } +`,JV=L.ul` + display: flex; + flex-flow: wrap; + justify-content: space-between; + flex: 1; + margin-bottom: ${e=>e.theme.scale.scale04}; + @media screen and (max-width: 1024px) { + } + @media screen and (max-width: 768px) { + flex-direction: column; + + margin-bottom: 24px; + } +`,eY=L.li` + width: 48%; + margin-bottom: ${e=>e.theme.scale.scale04}; + border: 1px solid #dfdfdf; + border-radius: ${e=>e.theme.scale.scale03}; + box-shadow: 5px 5px 15px -5px ${e=>e.theme.color.neutral.gray06}; + overflow: hidden; + @media screen and (max-width: 768px) { + width: 100%; + margin-bottom: 16px; + border-radius: 15px; + } +`,tY=L.img` + width: 100%; + height: ${e=>e.theme.scale.scale08}; + flex-direction: column; + @media screen and (max-width: 1024px) { + height: 156px; + } +`,nY=L.div` + padding: ${e=>e.theme.scale.scale03}; + // - - - + /* height: 100px; */ + @media screen and (max-width: 768px) { + padding: 15px; + } +`,rY=L.h1` + margin-bottom: ${e=>e.theme.scale.scale03}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize4}; + /* line-height: ${e=>e.theme.font.lineHeight4}; */ + line-height: 1.4; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-transform: capitalize; + @media screen and (max-width: 768px) { + margin-bottom: 15px; + font-size: 15px; + } +`,iY=L.p` + display: -webkit-box; + margin-bottom: ${e=>e.theme.scale.scale03}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize3}; + /* line-height: ${e=>e.theme.font.lineHeight3}; */ + line-height: 1.5; + word-break: break-all; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + overflow: hidden; + text-overflow: ellipsis; + @media screen and (max-width: 768px) { + margin-bottom: 15px; + font-size: 12px; + } +`,aY=L(Oa)` + display: inline-block; + margin-bottom: ${e=>e.theme.scale.scale01}; + padding-block: ${e=>e.theme.scale.scale01}; + padding-inline: ${e=>e.theme.scale.scale04}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize2}; + /* line-height: ${e=>e.theme.font.lineHeight2}; */ + line-height: 1.5; + background: linear-gradient(90deg, #767ee5, #9966cc); + border-radius: 20px; + @media screen and (max-width: 768px) { + margin-bottom: 6px; + padding-block: 6px; + padding-inline: 24px; + font-size: 10.5px; + border-radius: 15px; + } +`,oY=L(Oa)` + display: block; + text-align: right; + color: #7680dd; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize4}; + /* line-height: ${e=>e.theme.font.lineHeight4}; */ + line-height: 1.4; + @media screen and (max-width: 768px) { + font-size: 15px; + } +`,pp=Object.assign({"/src/blog/2023-01-07-Curp:-Revisit-the-Consensus-Protocol.md":B5,"/src/blog/2023-02-19-Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness.md":$5,"/src/blog/2023-03-10-How-to-Elegantly-Organize-Async-Rust-Code.md":U5,"/src/blog/2023-04-19-Database-Isolation-Levels-and-MVCC.md":j5,"/src/blog/2023-05-21-The-design-and-Implementation-of-the-Xline-Persistent-Storage-Layer.md":q5,"/src/blog/2023-08-18-Introduction-to-CURP-Protocol.md":H5,"/src/blog/2023-09-23-Mechanism-and-Implementation-of-Lease.md":W5,"/src/blog/2023-11-01-Implementation-of-CURP-Server.md":V5,"/src/blog/2023-12-13-CURP-State-Machine-Engine.md":Y5,"/src/blog/2024-01-04-Xline-Command-Deduplication-Mechanism-(Part-One)—Introduction-to-RIFL.md":X5,"/src/blog/2024-02-06-Analysis-of-Xline-Jepsen-Tests.md":K5,"/src/blog/2024-03-13-Membership-Change-Source-Code-Interpretation.md":G5,"/src/blog/2024-03-22-Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada.md":Q5}),sY=()=>{const{msg:e}=n1();ce.useEffect(()=>{window.scrollTo(0,0)},[]);const[t,n,r,...i]=(e||"").split("-"),a=i.join(" "),o=pp[`/src/blog/${e}.md`],[s,l,c,u]=o.split(`--- +`),d=zm.parse(l);let f=0;return k.jsxs(k.Fragment,{children:[k.jsx(jV,{}),k.jsxs(qV,{children:[k.jsx(HV,{children:a}),k.jsxs(G8,{children:[pe(`${t}-${n}-${r}`).format("MMM Do")," ·"," ",d.read_time," min read"]}),k.jsxs(WV,{href:d.author.url,children:[k.jsx(VV,{src:d.author.img_url}),k.jsx(YV,{children:d.author.name})]}),k.jsx(XV,{src:d.cover}),k.jsx(KV,{children:k.jsx(Ds,{children:u,rehypePlugins:[_c,K8],remarkPlugins:[Sc,I8],components:{h1:({level:p,children:m})=>k.jsx(ct,{level:p,children:m}),h2:({level:p,children:m})=>k.jsx(ct,{level:p,children:m}),h3:({level:p,children:m})=>k.jsx(ct,{level:p,children:m}),h4:({level:p,children:m})=>k.jsx(ct,{level:p,children:m}),h5:({level:p,children:m})=>k.jsx(ct,{level:p,children:m}),h6:({level:p,children:m})=>k.jsx(ct,{level:p,children:m}),p:({children:p})=>k.jsx(Ec,{children:p}),em:({children:p})=>k.jsx(ii,{children:p}),strong:({children:p})=>k.jsx(ii,{type:"bold",children:p}),hr:()=>k.jsx(Cc,{}),ul:({depth:p,ordered:m,className:h,children:v})=>k.jsx(ai,{depth:p,ordered:m,className:h,children:v}),ol:({depth:p,ordered:m,className:h,children:v})=>k.jsx(ai,{depth:p,ordered:m,className:h,children:v}),li:({children:p})=>k.jsx(Tc,{children:p}),img:({src:p,alt:m})=>k.jsx(Ac,{src:p,alt:m}),blockquote:({children:p})=>k.jsx(Rc,{children:p})}})}),k.jsxs(GV,{children:[k.jsx(QV,{children:k.jsx(ZV,{children:"related resources"})}),k.jsx(JV,{children:Object.keys(pp).reverse().map((p,m)=>{f++;const h=p.split(/[/,.]/),v=h[3],[y,w,x,..._]=h[3].split("-"),A=_.join(" "),[E,N,F,q]=pp[p].split(`--- +`),K=zm.parse(N),W=`/src/blog/${e}.md`;return p===W||f>2?(f--,null):k.jsxs(eY,{children:[k.jsx(tY,{src:K.cover,alt:"cover"}),k.jsxs(nY,{children:[k.jsx(rY,{children:A}),k.jsx(iY,{children:F}),k.jsx(aY,{onClick:()=>window.scrollTo(0,0),to:`/blog/${v}`,children:"Read more"})]})]},m)})}),k.jsx(oY,{to:"/blog",children:"View All →"})]})]})]})},lY="/xline-home/assets/image1-9be52310.png",cY="/xline-home/assets/image2-baebe8ee.png",uY="/xline-home/assets/image3-a2f91129.png",dY="/xline-home/assets/image4-feb06521.png",hY="/xline-home/assets/dot-37a9b3fe.svg",fY=L.div` + display: flex; + align-items: center; + justify-content: center; + height: calc(86px + 416px); + padding-top: 86px; + background: #0a0c28; + @media screen and (max-width: 1024px) { + padding-top: 69px; + height: calc(312px + 69px); + } + @media screen and (max-width: 1024px) { + padding-top: 53px; + height: calc(208px + 53px); + } +`,pY=L.h1` + position: relative; + display: inline-block; + padding-inline: 32px; + color: white; + font-weight: 700; + font-size: 72px; + line-height: 1.5; + text-transform: capitalize; + transform: translateY(-10%); + @media screen and (max-width: 1024px) { + padding-inline: 24px; + font-size: 54px; + } + @media screen and (max-width: 768px) { + padding-inline: 16px; + font-size: 36px; + } +`,mY=L.img` + z-index: -1; + position: absolute; + left: 50%; + bottom: -17px; + transform: translateX(-45%); + width: 295.01px; + height: 35.35px; + @media screen and (max-width: 1024px) { + bottom: -12%; + width: 221px; + height: 27px; + } + @media screen and (max-width: 768px) { + bottom: -8%; + width: 148px; + height: 18px; + } +`,gY=L.main` + display: flex; + margin-inline: auto; + padding-block: ${e=>e.theme.scale.scale06}; + padding-inline: ${e=>e.theme.scale.scale07}; + max-width: ${e=>e.theme.scale.scale12}; + // - - - + /* height: 200px; + background-color: lightcoral; */ + @media screen and (max-width: 1024px) { + padding-block: 60px; + padding-inline: 96px; + } + @media screen and (max-width: 768px) { + padding-block: 40px; + padding-inline: 64px; + } +`,yY=L.div` + flex-shrink: 0; + width: ${e=>e.theme.scale.scale08}; + margin-right: ${e=>e.theme.scale.scale06}; + padding-block: ${e=>e.theme.scale.scale07}; + // - - - + /* height: 100px; + background-color: lightblue; */ + @media screen and (max-width: 1440px) { + display: none; + } +`,bY=L.p` + margin-bottom: ${e=>e.theme.scale.scale04}; + color: #a6a6a6; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize4}; + line-height: ${e=>e.theme.font.lineHeight4}; +`,wY=L(Oa)` + display: block; + margin-bottom: ${e=>e.theme.scale.scale03}; + padding: ${e=>e.theme.scale.scale03}; + color: #454545; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize3}; + line-height: ${e=>e.theme.font.lineHeight3}; + border: 1px solid #dfdfdf; + border-radius: ${e=>e.theme.scale.scale01}; + box-shadow: 5px 5px 15px -5px ${e=>e.theme.color.neutral.gray06}; +`;L.div` + display: flex; + flex-flow: wrap; + justify-content: space-between; + /* flex: 1; */ + /* padding-inline: ${e=>e.theme.scale.scale05}; */ + // - - - + /* min-height: 100px; + background-color: lightcyan; */ + @media screen and (max-width: 1024px) { + flex-direction: column; + } +`;L.div` + width: 48%; + margin-bottom: ${e=>e.theme.scale.scale04}; + border: 1px solid #dfdfdf; + border-radius: ${e=>e.theme.scale.scale03}; + box-shadow: 5px 5px 15px -5px ${e=>e.theme.color.neutral.gray06}; + overflow: hidden; + // - - - + /* height: 400px; */ + /* background: lightpink; */ + @media screen and (max-width: 1024px) { + width: 100%; + } +`;L.img` + width: 100%; + /* height: ${e=>e.theme.scale.scale08}; */ +`;L.div` + padding: ${e=>e.theme.scale.scale03}; + // - - - + /* height: 100px; */ + @media screen and (max-width: 1024px) { + padding: 15px; + } + @media screen and (max-width: 768px) { + padding: 10px; + } +`;L.h1` + margin-bottom: ${e=>e.theme.scale.scale03}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize4}; + /* line-height: ${e=>e.theme.font.lineHeight4}; */ + line-height: 1.5; + /* white-space: nowrap; */ + overflow: hidden; + text-overflow: ellipsis; + text-transform: capitalize; + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 15px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 10px; + } +`;L.p` + display: -webkit-box; + margin-bottom: ${e=>e.theme.scale.scale03}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize3}; + /* line-height: ${e=>e.theme.font.lineHeight3}; */ + line-height: 1.5; + word-break: break-all; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + overflow: hidden; + text-overflow: ellipsis; + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 12px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 8px; + } +`;L(Oa)` + display: inline-block; + margin-bottom: ${e=>e.theme.scale.scale01}; + padding-block: ${e=>e.theme.scale.scale01}; + padding-inline: ${e=>e.theme.scale.scale04}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize2}; + /* line-height: ${e=>e.theme.font.lineHeight2}; */ + line-height: 1.5; + background: linear-gradient(90deg, #767ee5, #9966cc); + border-radius: 20px; + @media screen and (max-width: 1024px) { + margin-bottom: 6px; + padding-block: 6px; + padding-inline: 24px; + font-size: 10.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 4px; + padding-block: 4px; + padding-inline: 16px; + font-size: 7px; + } +`;const vY=L.ul``,xY=L.li` + display: flex; + align-items: center; + padding-block: 24px; + padding-inline: 12px; + border-bottom: 0.5px solid #9a9a9a; + cursor: pointer; + /* :last-child { + border-bottom: none; + } */ + @media screen and (max-width: 1024px) { + flex-direction: column; + padding-block: 18px; + padding-inline: 9px; + } + @media screen and (max-width: 768px) { + padding-block: 12px; + padding-inline: 6px; + } +`,kY=L.div` + flex-grow: 1; + margin-right: 48px; + @media screen and (max-width: 1024px) { + margin-right: 0; + } +`,SY=L.img` + width: 40%; + @media screen and (max-width: 1024px) { + width: 100%; + } +`,_Y=L.div` + margin-bottom: 6px; + font-size: 15px; + line-height: 2; + font-weight: 600px; + color: #7680dd; + @media screen and (max-width: 1024px) { + margin-bottom: 4.5px; + font-size: 12px; + } + @media screen and (max-width: 768px) { + margin-bottom: 3px; + } +`,EY=L.div` + margin-bottom: 27px; + font-size: 27px; + line-height: 1.22; + font-weight: 600; + color: #1e1e1e; + @media screen and (max-width: 1024px) { + margin-bottom: 20.25px; + font-size: 20.25; + } + @media screen and (max-width: 768px) { + margin-bottom: 13.5px; + font-size: 16px; + } +`,CY=L.div` + margin-bottom: 6px; + font-size: 13.5px; + line-height: 1.77; + font-weight: 400; + color: #7d7d7d; + @media screen and (max-width: 1024px) { + margin-bottom: 4.5px; + font-size: 12px; + } + @media screen and (max-width: 768px) { + margin-bottom: 3px; + } +`,TY=L.div` + display: flex; + align-items: center; + font-size: 12px; + line-height: 1%.5; + font-weight: 600; + @media screen and (max-width: 1024px) { + font-size: 9px; + } + @media screen and (max-width: 768px) { + font-size: 6px; + } +`,AY=L.img` + width: 22px; + height: 22px; + padding-inline: 8px; + @media screen and (max-width: 1024px) { + width: 16.5px; + height: 16.5px; + padding-inline: 6px; + } + @media screen and (max-width: 768px) { + width: 11px; + height: 11px; + padding-inline: 4px; + } +`,RY=L.div` + color: #797979; +`,MY=L.div` + color: #7680dd; +`,o2=[{date:"2023-01-19",title:"Geo distributed Metadata Management System",description:"The webinar aims to briefly introduce DatenLord’s open source project Xline, a distributed metadata management system for multi-clusters. It reveals the motivation of Xline, the architecture of it and the important consensus protocol, CURP. The performance comparison shows the advantage of Xline over the current solution.",author:"By Jicheng Shi",read:"19min",img:lY,url:"https://www.cncf.io/online-programs/cncf-on-demand-webinar-geo-distributed-metadata-management-system/"},{date:"2023-05-04",title:"Proofing the Correctness of the CURP Consensus Protocol Using TLA+",description:"The CURP Replication Protocol (NSDI ’19) aims to eliminate the additional round trips between servers in replicated state machines. We extended CURP into a consensus protocol and used it in our open source project Xline. This webinar is about how we modeled the CURP consensus protocol in TLA+ and verified the correctness of it.",author:"By Ye Tian",read:"20min",img:cY,url:"https://www.cncf.io/online-programs/cncf-on-demand-webinar-proofing-the-correctness-of-the-curp-consensus-protocol-using-tla/"},{date:"2023-09-08",title:"How to Write a Distributed Key-value store in Rust",description:"In this presentation, we will explore how to use Rust to build a distributed key-value store, taking the open-source distributed KV storage Xline as an example. ",author:"By Jiawei Zhao",read:"35min",img:uY,url:"https://community.cncf.io/events/details/cncf-cncf-online-programs-presents-cncf-on-demand-webinar-how-to-write-a-distributed-key-value-store-in-rust/"},{date:"2023-12-14",title:"Application and Analysis of Jepsen Tests in Xline",description:"This presentation offers an overview of applying Jepsen tests to Xline, a distributed KV Store. It begins with a brief introduction to Jepsen, followed by an exploration of the application of Jepsen tests to Xline. The presentation then delves into the test results and system analysis. Finally, it discusses the lessons learned and outlines future work in chaos engineering for Xline. ",author:"By Zhenghao Yin",read:"13min",img:dY,url:"https://www.cncf.io/online-programs/cncf-on-demand-webinar-application-and-analysis-of-jepsen-tests-in-xline/"}],NY=e=>{const{date:t,title:n,description:r,author:i,read:a,img:o,url:s}=e.data;return k.jsxs(xY,{onClick:()=>window.location.href=`${s}`,children:[k.jsxs(kY,{children:[k.jsx(_Y,{children:pe(t,"YYYY-MM-DD").format("dddd MMMM D, YYYY")}),k.jsx(EY,{children:n}),k.jsx(CY,{children:r}),k.jsxs(TY,{children:[k.jsx(RY,{children:i}),k.jsx(AY,{src:hY}),k.jsx(MY,{children:a})]})]}),k.jsx(SY,{src:o})]})},IY=()=>k.jsxs(k.Fragment,{children:[k.jsx(fY,{children:k.jsxs(pY,{children:["video",k.jsx(mY,{src:Wi,alt:"underline"})]})}),k.jsxs(gY,{children:[k.jsxs(yY,{children:[k.jsx(bY,{children:"Video"}),o2.map(({title:e,url:t})=>k.jsx(wY,{to:t,children:e},e))]}),k.jsx(vY,{children:o2.map(e=>k.jsx(NY,{data:e},e.title))})]})]}),s2="/xline-home/assets/image1-177e3788.png",OY=L.div` + display: flex; + align-items: center; + justify-content: center; + height: calc(86px + 416px); + padding-top: 86px; + background: #0a0c28; + @media screen and (max-width: 1024px) { + padding-top: 69px; + height: calc(312px + 69px); + } + @media screen and (max-width: 1024px) { + padding-top: 53px; + height: calc(208px + 53px); + } +`,DY=L.h1` + position: relative; + display: inline-block; + padding-inline: 32px; + color: white; + font-weight: 700; + font-size: 72px; + line-height: 1.5; + text-transform: capitalize; + transform: translateY(-10%); + word-wrap: break-word; + max-width: 50vw; + text-align: center; + @media screen and (max-width: 1024px) { + padding-inline: 24px; + font-size: 54px; + } + @media screen and (max-width: 768px) { + padding-inline: 16px; + font-size: 36px; + } +`,LY=L.img` + z-index: -1; + position: absolute; + left: 50%; + bottom: -17px; + transform: translateX(-45%); + width: 295.01px; + height: 35.35px; + @media screen and (max-width: 1024px) { + bottom: -12%; + width: 221px; + height: 27px; + } + @media screen and (max-width: 768px) { + bottom: -8%; + width: 148px; + height: 18px; + } +`,PY=L.main` + display: flex; + margin-inline: auto; + padding-block: ${e=>e.theme.scale.scale06}; + padding-inline: ${e=>e.theme.scale.scale07}; + max-width: ${e=>e.theme.scale.scale12}; + // - - - + /* height: 200px; + background-color: lightcoral; */ + @media screen and (max-width: 1024px) { + padding-block: 60px; + padding-inline: 96px; + } + @media screen and (max-width: 768px) { + padding-block: 40px; + padding-inline: 64px; + } +`,zY=L.div` + flex-shrink: 0; + width: ${e=>e.theme.scale.scale08}; + margin-right: ${e=>e.theme.scale.scale06}; + padding-block: ${e=>e.theme.scale.scale07}; + // - - - + /* height: 100px; + background-color: lightblue; */ + @media screen and (max-width: 1440px) { + display: none; + } +`,FY=L.p` + margin-bottom: ${e=>e.theme.scale.scale04}; + color: #a6a6a6; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize4}; + line-height: ${e=>e.theme.font.lineHeight4}; +`,BY=L(Oa)` + display: block; + margin-bottom: ${e=>e.theme.scale.scale03}; + padding: ${e=>e.theme.scale.scale03}; + color: #454545; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize3}; + line-height: ${e=>e.theme.font.lineHeight3}; + border: 1px solid #dfdfdf; + border-radius: ${e=>e.theme.scale.scale01}; + box-shadow: 5px 5px 15px -5px ${e=>e.theme.color.neutral.gray06}; +`,l2=L.div` + display: flex; + flex-flow: wrap; + justify-content: space-between; + padding-bottom: 10vh; + &:last-child { + padding-bottom: 0; + } + /* flex: 1; */ + /* padding-inline: ${e=>e.theme.scale.scale05}; */ + // - - - + /* min-height: 100px; + background-color: lightcyan; */ + @media screen and (max-width: 1024px) { + flex-direction: column; + } +`;L.div` + width: 48%; + margin-bottom: ${e=>e.theme.scale.scale04}; + border: 1px solid #dfdfdf; + border-radius: ${e=>e.theme.scale.scale03}; + box-shadow: 5px 5px 15px -5px ${e=>e.theme.color.neutral.gray06}; + overflow: hidden; + // - - - + /* height: 400px; */ + /* background: lightpink; */ + @media screen and (max-width: 1024px) { + width: 100%; + } +`;L.img` + width: 100%; + /* height: ${e=>e.theme.scale.scale08}; */ +`;L.div` + padding: ${e=>e.theme.scale.scale03}; + // - - - + /* height: 100px; */ + @media screen and (max-width: 1024px) { + padding: 15px; + } + @media screen and (max-width: 768px) { + padding: 10px; + } +`;L.h1` + margin-bottom: ${e=>e.theme.scale.scale03}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize4}; + /* line-height: ${e=>e.theme.font.lineHeight4}; */ + line-height: 1.5; + /* white-space: nowrap; */ + overflow: hidden; + text-overflow: ellipsis; + text-transform: capitalize; + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 15px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 10px; + } +`;L.p` + display: -webkit-box; + margin-bottom: ${e=>e.theme.scale.scale03}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize3}; + /* line-height: ${e=>e.theme.font.lineHeight3}; */ + line-height: 1.5; + word-break: break-all; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + overflow: hidden; + text-overflow: ellipsis; + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 12px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 8px; + } +`;L(Oa)` + display: inline-block; + margin-bottom: ${e=>e.theme.scale.scale01}; + padding-block: ${e=>e.theme.scale.scale01}; + padding-inline: ${e=>e.theme.scale.scale04}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize2}; + /* line-height: ${e=>e.theme.font.lineHeight2}; */ + line-height: 1.5; + background: linear-gradient(90deg, #767ee5, #9966cc); + border-radius: 20px; + @media screen and (max-width: 1024px) { + margin-bottom: 6px; + padding-block: 6px; + padding-inline: 24px; + font-size: 10.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 4px; + padding-block: 4px; + padding-inline: 16px; + font-size: 7px; + } +`;const c2=L.ul``,Q8=L.li` + display: flex; + align-items: center; + padding-block: 24px; + padding-inline: 12px; + border-bottom: 0.5px solid #9a9a9a; + cursor: pointer; + /* :last-child { + border-bottom: none; + } */ + @media screen and (max-width: 1024px) { + flex-direction: column; + padding-block: 18px; + padding-inline: 9px; + } + @media screen and (max-width: 768px) { + padding-block: 12px; + padding-inline: 6px; + } +`,Z8=L.div` + flex-grow: 1; + margin-right: 48px; + @media screen and (max-width: 1024px) { + margin-right: 0; + } +`,J8=L.img` + width: 40%; + @media screen and (max-width: 1024px) { + width: 100%; + } +`,eS=L.div` + margin-bottom: 27px; + font-size: 27px; + line-height: 1.22; + font-weight: 600; + color: #1e1e1e; + @media screen and (max-width: 1024px) { + margin-bottom: 20.25px; + font-size: 20.25; + } + @media screen and (max-width: 768px) { + margin-bottom: 13.5px; + font-size: 16px; + } +`,tS=L.div` + margin-bottom: 12px; + font-size: 13.5px; + line-height: 1.77; + font-weight: 400; + color: #7d7d7d; + @media screen and (max-width: 1024px) { + margin-bottom: 4.5px; + font-size: 12px; + } + @media screen and (max-width: 768px) { + margin-bottom: 3px; + } +`,$Y=L.div` + margin-bottom: 6px; + max-width: 80%; + font-size: 13.5px; + line-height: 1.77; + font-weight: 400; + color: #7d7d7d; + @media screen and (max-width: 1024px) { + margin-bottom: 4.5px; + font-size: 12px; + } + @media screen and (max-width: 768px) { + margin-bottom: 3px; + } +`,u2=L.div` + color: #7680dd; + font-size: 1.5vw; + font-weight: 600; +`,UY=L.div``,mp=[],d2=[{title:"Xline Community Meeting March, 2024",description:"In order to provide a more comprehensive overview of Xline's progress and to promote the Xline community, we held an Xline community meeting at 8AM PT (USA Pacific) on March 29, 2024 (11AM EST;11PM Beijing Time)Subscribe us for more details~",img:s2,url:"https://www.youtube.com/watch?v=UdC_mteVeH8"},{title:"Xline Community Meeting January, 2024",description:"Xline is a distributed KV store for managing metadata based on the Curp protocol. In order to better introduce the progress of Xline and to promote the development of Xline community, we held the first Xline Community Meeting on January 27, 2024 (Saturday) at 10:00 am Beijing time.",img:s2,url:"https://www.youtube.com/watch?v=jvU44y14Ey8"}],jY=e=>{const{title:t,description:n,img:r,url:i}=e.data;return k.jsxs(Q8,{onClick:()=>window.location.href=`${i}`,children:[k.jsxs(Z8,{children:[k.jsx(eS,{children:t}),k.jsx(tS,{children:n})]}),k.jsx(J8,{src:r})]})},qY=e=>{const{title:t,description:n,img:r,url:i}=e.data;return k.jsxs(Q8,{onClick:()=>window.location.href=`${i}`,children:[k.jsxs(Z8,{children:[k.jsx(eS,{children:t}),k.jsx(tS,{children:n}),k.jsxs($Y,{children:["The meeting will be held via zoom",k.jsx("br",{}),"Meeting number: ",k.jsx("b",{children:"813 0547 8985"})," ",k.jsx("br",{}),"Password: ",k.jsx("b",{children:"520159"}),k.jsx("br",{}),"Link:"," ",k.jsx("a",{href:"https://zoom.us/j/81305478985?pwd=PsnbMGQy1ZqxYyd67cAkaGROfnIoQa.1",children:"https://zoom.us/j/81305478985?pwd=PsnbMGQy1ZqxYyd67cAkaGROfnIoQa.1"})]})]}),k.jsx(J8,{src:r})]})},HY=()=>k.jsxs(k.Fragment,{children:[k.jsx(OY,{children:k.jsxs(DY,{children:["community meeting",k.jsx(LY,{src:Wi,alt:"underline"})]})}),k.jsxs(PY,{children:[k.jsxs(zY,{children:[k.jsx(FY,{children:"Meeting"}),mp.concat(d2).map(({title:e,url:t})=>k.jsx(BY,{to:t,children:e},e))]}),k.jsxs(UY,{children:[mp.length>0&&k.jsxs(l2,{children:[k.jsx(u2,{children:"Upcoming meetings"}),k.jsx(c2,{children:mp.map(e=>k.jsx(qY,{data:e},e.title))})]}),k.jsxs(l2,{children:[k.jsx(u2,{children:"Previous meetings"}),k.jsx(c2,{children:d2.map(e=>k.jsx(jY,{data:e},e.title))})]})]})]})]}),WY=`## Introduction + +This page lists the project ideas for Google Summer of Code 2024. +The ideas comes from serveral projects: + +- DatenLord + An application-orientated, cloud-native distributed storage system. [Repo](https://github.com/datenlord/datenlord) +- Xline + A geo-distributed KV store for metadata management. [Repo](https://github.com/xline-kv/Xline) +- Xline Client + Xline client SDK, we currently provides clients written in rust/go/python/java. [Repo](https://github.com/xlinehttps://github.com/xline-kv) + + We use Rust as our main language for all our projects. The Xline client project may require the use of additional languages. + +## About GSoC + +Google Summer of Code is a global, online program focused on bringing new contributors into open source software development. GSoC Contributors work with an open source organization on a 12+ week programming project under the guidance of mentors. If you are new to GSoC, please refer to the GSoC website to learn [how it works](https://summerofcode.withgoogle.com/how-it-works). Please note that the deadline for this year’s GSoC application is April 2nd at 18:00 UTC. + +## Information for Contributors + +- You can choose an idea from this page, but if you have something else in mind, you may modify the ideas or submit your own proposals. +- Get in touch on [Github](https://github.com/xline-kv/Xline) or [Discord](https://discord.com/invite/hqDRtYkWzm), feel free to ask questions and tell us what you are passionate about. +- All projects require a good knowledge of Rust and distributed systems. +- Please read the Contribute Guide([Xline](https://github.com/xline-kv/Xline/blob/master/CONTRIBUTING.md), [datenlord](https://github.com/datenlord/datenlord#how-to-contribute)) of each project before you start working on the coding. +- If you are unable to participate in our GSoC program for any reason, you are still welcome to choose an idea from this page if there are no existing contributors. +- Contributors are selected based on their past experience and skills. Please contact us in advance to confirm your eligibility for the tasks. +- We will continue to update tasks and descriptions. Please check this page from time to time if you want to participate in our projects. + +## Ideas + +### Integrating Xline to DatenLord + +- Difficulty: Easy +- Skills required: Rust, Etcd +- Expected Project size: 90 hours +- Description: The primary objective of DatenLord is to enable high availability across multi-cloud, hybrid-cloud, and multiple data centers, which often results in high latency situations. Currently, we utilize Etcd as the metadata storage in the DatenLord project. However, we are planning to transition to Xline, which offers improved throughput in such scenarios. +- Expected Outcome: + - Replace Etcd with Xline in datenlord project + - Benchmark the performance before and after changes +- Possible mentors: Yang Fengming, Su Jinyang + +### Improve Transaction Validation + +- Difficulty: Medium +- Skills required: Rust, Etcd, knowledge to common data structures +- Expected Project size: 90 hours +- Description: We want to ensure that in Xline, individual transactions do not have overlapping puts and deletes operations. The current validation implementation has a high time complexity and can potentially impact performance for transactions with multiple operations. Additionally, we are uncertain about the correctness of this implementation and there may be potential bugs present. +- Expected Outcome: + - Implement the Interval Tree for range overlapping checks. + - Refactor txn validation and provides correctness proof. + - Write unit tests. +- Possible mentors: Yin Zhenghao, Zhao Jiawei + +### Xline C Client + +- Difficulty: Medium +- Skills required: Rust, C +- Expected Project size: 175 hours +- Description: We currently have several Xline client implementations in different languages. We want to provide a C SDK to make Xline even more accessible. The client needs to implement all the current Xline APIs. +- Expected Outcome: + - Implement Curp protocol client in C. + - Implement Xline client in C. + - Write unit tests for Xline C client. + - Performance benchmark for the client. + - Write docs for Xline C client. +- Possible mentors: Shi Jicheng, Guan Yu + +### Joint consensus correctness testing + +- Difficulty: Hard +- Skills required: Rust, Knowledge to consensus algorithms and chaos engineering +- Expected Project size: 350 hours +- Description: We have implemented joint consensus in Xline, which allows for arbitrary configuration changes. The joint consensus is more complex than single-server membership change and we want to add integration and chaos tests to verify the correctness of our implementation. +- Expected Outcome: + - Write Integration tests. + - Write Chaos testing. + - Find and fix possible bugs. +- Possible mentors: Guan Yu, Zhao Jiawei + +### Implementing Chaos testing in Madsim + +- Difficulty: Hard +- Skills required: Rust, [Jepsen](https://github.com/jepsen-io/jepsen), Knowledge of chaos engineering and deterministic simulation +- Expected Project size: 350 hours + - Description: Jepsen is a widely-used framework for verifying distributed systems. Although Jepsen is effective at finding issues within a system, it lacks determinism in its testing methodology, making the debugging process more difficult. On the other hand, [Madsim](https://github.com/madsim-rs/madsim) is a deterministic simulator designed for distributed systems, offering fault injection capabilities. Our goal is to combine the strengths of Madsim and Jepsen, creating a lightweight framework for chaos testing within a single-machine environment. With its deterministic nature, this framework allows for reproducible tests and facilitates the debugging process. +- Expected Outcome: + - Write operations/faults generators under the Madsim framework. + - Write a linearizability checker in Rust, similar to [Knossos](https://github.com/jepsen-io/knossos). + - Write a transactional safety checker in Rust, similar to [Elle](https://github.com/jepsen-io/elle). + - Setup chaos testing using these components. +- Possible mentors: Yin Zhenghao, Shi Jicheng + +## Communication + +Discord will serve as the primary communication platform during this year’s GSoC program. This includes the following: + +- Communicating with your mentor +- Participating in meetings + It’s also worth mentioning that our Discord server is not created solely for the GSoC program; it is also used as our regular project channel. This ensures all contributors are aware of the progress of the project and offer suggestions and advice. While you will be assigned a mentor, but the entire community is available to help you with any problems you may face. + Please make sure to read the server’s rules before participating. Be specific when asking questions so that everyone can understand. We will respond as soon as we are available and able to assist you with your questions. + Use English for communication is a mandatory requirement as we rely on it for effective collaboration. + Invite link to our server: https://discord.com/invite/hqDRtYkWzm + +## Expectations + +### Weekly working hours + +For the GSoC project labeled **"hard"**, you are expected to work at least 40 hours a week. For medium and easy tasks, you may choose your own working hours, but please communicate with your mentor in advance and make sure to keep on schedule. + +### Self-motivation + +Our program requires self-motivation, as it involves individual research, problem solving, and coding efforts. While mentor support is available, the majority of the project’s success hinges on your own self-motivation and dedication. + +### Frequent communication with mentor + +Regular communication with your mentor is essential. They need to be constantly updated about your progress, your plans, obstacles faced, and how you overcame them or if you’re stuck. +Before starting the project, establish a communication schedule for interactions with your mentor. + +### Design documents + +We expect you to maintain a design document for the project. It should includes your project plan, issues and technical specifications. Your design document will be reviewed by your mentor before starting the actual coding. + +## Resources + +### Learning materials + +Mentors will provide project-specific tutorials, documentation and research articles to makes sure that you understand the project’s framework. + +### Development environment + +Development in our project can be resource-intensive. If you struggle with coding and benchmarking on your local machine, you can get an account and perform your work on our shared Linux server. + +## Contributor Guidance + +### Application Process + +1. Read the links and instructions given on this site and choose one or more ideas. +2. Join our Discord server: https://discord.com/invite/hqDRtYkWzm . We provide a dedicated channel for the GSoC program. +3. Talk with your prospective mentor for the chosen project in the Discord server. +4. Submit the application/proposal including all requirements at the Google Summer of Code Site before deadline. + +## What goes in an application? + +Please provide the following information in your application: + +1. Your brief CV including contact information. +2. Answers to the following questions: + +- What do you find most attractive about our program and the reason you choose us? +- How does your current skills match with the requirements of our program? +- What do you expect to gain from this program and how can we get the best out of you? +- Have you ever participated in GSoC (or a similar program) before? + +3.Information about your **proposed project, which includes a detailed and weekly schedule with breakdowns and clear milestones** +`,VY=L.div` + height: 600px; + background: #0a0c28; + @media screen and (max-width: 1024px) { + height: 414px; + } + @media screen and (max-width: 768px) { + height: 276px; + } +`,YY=L.main` + max-width: 1024px; + margin-left: 30vw; + padding-inline: 5vw; + margin-top: -${e=>e.theme.scale.scale09}; + margin-bottom: ${e=>e.theme.scale.scale07}; + /* margin-left: auto; */ + /* padding-inline: 64px; */ + // - - - + /* height: 400px; */ + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 15px; + } + @media screen and (max-width: 1024px) { + margin-top: -252px; + } + @media screen and (max-width: 768px) { + margin-top: -168px; + /* padding-inline: 32px; */ + } +`,XY=L.div` + margin-bottom: ${e=>e.theme.scale.scale08}; + @media screen and (max-width: 1024px) { + margin-bottom: 156px; + } + @media screen and (max-width: 768px) { + margin-bottom: 104px; + } +`;L.div` + margin-bottom: ${e=>e.theme.scale.scale07}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize10}; + /* line-height: ${e=>e.theme.font.lineHeight9}; */ + line-height: 1.4; + text-transform: capitalize; + /* word-break: break-all; */ + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 34.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 23px; + } +`;const KY=L.h1` + margin-bottom: ${e=>e.theme.scale.scale03}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightBold}; + font-size: ${e=>e.theme.font.fontSize8}; + /* line-height: ${e=>e.theme.font.lineHeight9}; */ + line-height: 1.4; + text-transform: capitalize; + /* word-break: break-all; */ + @media screen and (max-width: 1024px) { + margin-bottom: 15px; + font-size: 34.5px; + } + @media screen and (max-width: 768px) { + margin-bottom: 10px; + font-size: 23px; + } +`,nS=L.p` + margin-bottom: ${e=>e.theme.scale.scale04}; + color: ${e=>e.theme.color.neutral.gray01}; + font-weight: ${e=>e.theme.font.fontWeightRegular}; + font-size: ${e=>e.theme.font.fontSize5}; + /* line-height: ${e=>e.theme.font.lineHeight5}; */ + line-height: 1.3; + @media screen and (max-width: 1024px) { + margin-bottom: 24px; + font-size: 18px; + } + @media screen and (max-width: 768px) { + margin-bottom: 16px; + font-size: 12px; + } +`,GY=L.a` + display: flex; + align-items: center; + margin-bottom: ${e=>e.theme.scale.scale08}; + @media screen and (max-width: 1024px) { + margin-bottom: 24px; + } + @media screen and (max-width: 768px) { + margin-bottom: 16px; + } +`,QY=L.img` + margin-right: 24px; + height: ${e=>e.theme.scale.scale06}; + width: ${e=>e.theme.scale.scale06}; + border: 2px solid ${e=>e.theme.color.neutral.gray01}; + border-radius: 50%; + @media screen and (max-width: 1024px) { + margin-right: 18px; + height: 60px; + width: 60px; + } + @media screen and (max-width: 768px) { + margin-right: 12px; + height: 60px; + width: 60px; + } +`;L.img` + width: 100%; + margin-bottom: ${e=>e.theme.scale.scale04}; + border-radius: ${e=>e.theme.scale.scale02}; + /* height: 336px; */ + @media screen and (max-width: 1024px) { + margin-bottom: 24px; + border-radius: 9px; + } + @media screen and (max-width: 768px) { + margin-bottom: 16px; + border-radius: 6px; + } +`;const ZY=L(nS)` + margin-bottom: 0; +`;L.div` + display: flex; + padding-inline: 4vw; +`;const JY=L.div` + position: sticky; + top: 0; + float: left; + width: 30vw; + padding-block: 5vh; + padding-inline: 5vw; + height: 100vh; + overflow-y: scroll; +`,eX=Object.assign({"/src/pages/GSoC/index.md":WY}),tX=eX["/src/pages/GSoC/index.md"],nX=()=>{const[e,t]=ce.useState();ce.useEffect(()=>{window.scrollTo(0,0)},[]),ce.useEffect(()=>{const r=document.getElementById("article"),i=r==null?void 0:r.querySelectorAll("h2, h3");i!=null&&t(Array.from(i))},[]);const n=r=>{var i;console.log(document.querySelector(`#${r}`)),(i=document.querySelector(`#${r}`))==null||i.scrollIntoView({})};return k.jsxs(k.Fragment,{children:[k.jsx(VY,{}),k.jsx(JY,{children:e&&e.map(r=>r.tagName=="H2"?k.jsx("div",{style:{fontSize:"18px",fontWeight:"600",paddingBlock:"4px",cursor:"pointer"},onClick:()=>n(r.id),children:r.textContent}):k.jsx("div",{style:{paddingLeft:"16px",fontSize:"16px",paddingBlock:"4px",cursor:"pointer"},onClick:()=>n(r.id),children:r.textContent}))}),k.jsxs(YY,{children:[k.jsx(KY,{children:"GSoC 2024 Ideas Page"}),k.jsxs(nS,{children:[pe("2024-02-04").format("MMM Do")," · 10 min read"]}),k.jsxs(GY,{href:"https://github.com/bsbds",children:[k.jsx(QY,{src:"https://avatars.githubusercontent.com/u/69835502?v=4"}),k.jsx(ZY,{children:"bsbdf"})]}),k.jsx(XY,{id:"article",children:k.jsx(Ds,{children:tX,rehypePlugins:[_c,K8],remarkPlugins:[Sc,I8],components:{h1:({level:r,children:i})=>k.jsx(ct,{level:r,children:i}),h2:({level:r,children:i})=>k.jsx(ct,{level:r,children:i}),h3:({level:r,children:i})=>k.jsx(ct,{level:r,children:i}),h4:({level:r,children:i})=>k.jsx(ct,{level:r,children:i}),h5:({level:r,children:i})=>k.jsx(ct,{level:r,children:i}),h6:({level:r,children:i})=>k.jsx(ct,{level:r,children:i}),p:({children:r})=>k.jsx(Ec,{children:r}),em:({children:r})=>k.jsx(ii,{children:r}),strong:({children:r})=>k.jsx(ii,{type:"bold",children:r}),hr:()=>k.jsx(Cc,{}),ul:({depth:r,ordered:i,className:a,children:o})=>k.jsx(ai,{depth:r,ordered:i,className:a,children:o}),ol:({depth:r,ordered:i,className:a,children:o})=>k.jsx(ai,{depth:r,ordered:i,className:a,children:o}),li:({children:r})=>k.jsx(Tc,{children:r}),img:({src:r,alt:i})=>k.jsx(Ac,{src:r,alt:i}),blockquote:({children:r})=>k.jsx(Rc,{children:r})}})})]})]})},rX=iC([{path:"/",element:k.jsx(nA,{}),children:[{path:"/",element:k.jsx(LA,{})},{path:"/contribute",element:k.jsx(oR,{})},{path:"/meeting",element:k.jsx(HY,{})},{path:"/GsoC",element:k.jsx(nX,{})},{path:"/blog",element:k.jsx(LB,{})},{path:"/blog/:msg",element:k.jsx(sY,{})},{path:"/docs/:params",element:k.jsx(Gz,{})},{path:"/deep-dive/:params",element:k.jsx(cF,{})},{path:"/video",element:k.jsx(IY,{})}]},{path:"test",element:k.jsx(Tz,{})}]),iX={color:{neutral:{gray01:"#ffffff",gray02:"#fafafa",gray03:"#f5f5f5",gray04:"#f0f0f0",gray05:"#d9d9d9",gray06:"#bfbfbf",gray07:"#8c8c8c",gray08:"#595959",gray09:"#434343",gray10:"#262626",gray11:"#1f1f1f",gray12:"#141414",gray13:"#000000"},white:"white"},scale:{scale01:"8px",scale02:"12px",scale03:"20px",scale04:"32px",scale05:"48px",scale06:"80px",scale07:"128px",scale08:"208px",scale09:"336px",scale10:"552px",scale11:"896px",scale12:"1440px",sm:"16px",md:"32px",lg:"64px",xl:"96px",xxl:"128px"},font:{fontFamily:"Arial",fontSize1:"12px",fontSize2:"14px",fontSize3:"16px",fontSize4:"20px",fontSize5:"24px",fontSize6:"30px",fontSize7:"38px",fontSize8:"46px",fontSize9:"56px",fontSize10:"68px",lineHeight1:"20px",lineHeight2:"22px",lineHeight3:"24px",lineHeight4:"28px",lineHeight5:"32px",lineHeight6:"38px",lineHeight7:"46px",lineHeight8:"54px",lineHeight9:"64px",lineHeight10:"76px",fontWeightRegular:"500",fontWeightBold:"600"}},aX=uT` + * { + box-sizing: border-box; + } + + body { + margin: 0; + font-family: Inter; + line-height: 1.5; + } + + a { + text-decoration: none; + } + + h1, h2, h3, h4, h5, h6 { + margin-block: 0; + } + + p { + margin-block: 0; + line-height: 1.2; + } + + ul, ol { + list-style-type: none; + margin-block: 0; + padding-inline-start: 0; + } + + ol + ul { + margin-left: 20px; + } + + pre { + background: ${e=>e.theme.color.neutral.gray04}; + padding: 12px; + border-radius: 4px; + overflow-x: scroll; + } + + code { + font-size: 16px; + padding: 4px; + border-radius: 4px; + background: ${e=>e.theme.color.neutral.gray04}; + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + } + + pre code { + padding: 0; + } + + .hljs { + font-size: 16px; + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + color: #333; + overflow: hidden; + } + /* .hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #333; + background: #f8f8f8; +} */ + .hljs-comment, + .hljs-quote { + color: #998; + font-style: italic; + } + .hljs-keyword, + .hljs-selector-tag, + .hljs-subst { + color: #333; + font-weight: 700; + } + .hljs-literal, + .hljs-number, + .hljs-tag .hljs-attr, + .hljs-template-variable, + .hljs-variable { + color: teal; + } + .hljs-doctag, + .hljs-string { + color: #d14; + } + .hljs-section, + .hljs-selector-id, + .hljs-title { + color: #900; + font-weight: 700; + } + .hljs-subst { + font-weight: 400; + } + .hljs-class .hljs-title, + .hljs-type { + color: #458; + font-weight: 700; + } + .hljs-attribute, + .hljs-name, + .hljs-tag { + color: navy; + font-weight: 400; + } + .hljs-link, + .hljs-regexp { + color: #009926; + } + .hljs-bullet, + .hljs-symbol { + color: #990073; + } + .hljs-built_in, + .hljs-builtin-name { + color: #0086b3; + } + .hljs-meta { + color: #999; + font-weight: 700; + } + .hljs-deletion { + background: #fdd; + } + .hljs-addition { + background: #dfd; + } + .hljs-emphasis { + font-style: italic; + } + .hljs-strong { + font-weight: 700; + } +`;yp.createRoot(document.getElementById("root")).render(k.jsx(Fn.StrictMode,{children:k.jsxs(lT,{theme:iX,children:[k.jsx(XE,{router:rX}),k.jsx(aX,{})]})}))});export default oX(); diff --git a/assets/logo-9c6940ee.svg b/assets/logo-9c6940ee.svg new file mode 100644 index 0000000..18ff884 --- /dev/null +++ b/assets/logo-9c6940ee.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/protocol-icon-f31ce54b.svg b/assets/protocol-icon-f31ce54b.svg new file mode 100644 index 0000000..46cacbe --- /dev/null +++ b/assets/protocol-icon-f31ce54b.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/sever-icon-1e1bff49.svg b/assets/sever-icon-1e1bff49.svg new file mode 100644 index 0000000..1bc6af1 --- /dev/null +++ b/assets/sever-icon-1e1bff49.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/underline-992439df.svg b/assets/underline-992439df.svg new file mode 100644 index 0000000..039bc25 --- /dev/null +++ b/assets/underline-992439df.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/blog/Analysis-of-Xline-Jepsen-Tests/cover.png b/blog/Analysis-of-Xline-Jepsen-Tests/cover.png new file mode 100644 index 0000000..073b9c7 Binary files /dev/null and b/blog/Analysis-of-Xline-Jepsen-Tests/cover.png differ diff --git a/blog/CURP-State-Machine-Engine/cover.png b/blog/CURP-State-Machine-Engine/cover.png new file mode 100644 index 0000000..aafc7d6 Binary files /dev/null and b/blog/CURP-State-Machine-Engine/cover.png differ diff --git a/blog/CURP-State-Machine-Engine/image1.PNG b/blog/CURP-State-Machine-Engine/image1.PNG new file mode 100644 index 0000000..3e4e763 Binary files /dev/null and b/blog/CURP-State-Machine-Engine/image1.PNG differ diff --git a/blog/CURP-State-Machine-Engine/image2.PNG b/blog/CURP-State-Machine-Engine/image2.PNG new file mode 100644 index 0000000..447245e Binary files /dev/null and b/blog/CURP-State-Machine-Engine/image2.PNG differ diff --git a/blog/CURP-State-Machine-Engine/image3.PNG b/blog/CURP-State-Machine-Engine/image3.PNG new file mode 100644 index 0000000..90293ac Binary files /dev/null and b/blog/CURP-State-Machine-Engine/image3.PNG differ diff --git a/blog/CURP-State-Machine-Engine/image4.PNG b/blog/CURP-State-Machine-Engine/image4.PNG new file mode 100644 index 0000000..0cb92b3 Binary files /dev/null and b/blog/CURP-State-Machine-Engine/image4.PNG differ diff --git a/blog/CURP-State-Machine-Engine/image5.png b/blog/CURP-State-Machine-Engine/image5.png new file mode 100644 index 0000000..c30625b Binary files /dev/null and b/blog/CURP-State-Machine-Engine/image5.png differ diff --git a/blog/Database-Isolation-Levels-and-MVCC/cover.png b/blog/Database-Isolation-Levels-and-MVCC/cover.png new file mode 100644 index 0000000..ef9bd6d Binary files /dev/null and b/blog/Database-Isolation-Levels-and-MVCC/cover.png differ diff --git a/blog/Database-Isolation-Levels-and-MVCC/image1.png b/blog/Database-Isolation-Levels-and-MVCC/image1.png new file mode 100644 index 0000000..6de0ffd Binary files /dev/null and b/blog/Database-Isolation-Levels-and-MVCC/image1.png differ diff --git a/blog/Database-Isolation-Levels-and-MVCC/image2.png b/blog/Database-Isolation-Levels-and-MVCC/image2.png new file mode 100644 index 0000000..aacba33 Binary files /dev/null and b/blog/Database-Isolation-Levels-and-MVCC/image2.png differ diff --git a/blog/Database-Isolation-Levels-and-MVCC/image3.png b/blog/Database-Isolation-Levels-and-MVCC/image3.png new file mode 100644 index 0000000..0eb0d9e Binary files /dev/null and b/blog/Database-Isolation-Levels-and-MVCC/image3.png differ diff --git a/blog/Database-Isolation-Levels-and-MVCC/image4.png b/blog/Database-Isolation-Levels-and-MVCC/image4.png new file mode 100644 index 0000000..6e2aaa2 Binary files /dev/null and b/blog/Database-Isolation-Levels-and-MVCC/image4.png differ diff --git a/blog/Database-Isolation-Levels-and-MVCC/image5.png b/blog/Database-Isolation-Levels-and-MVCC/image5.png new file mode 100644 index 0000000..081b4cd Binary files /dev/null and b/blog/Database-Isolation-Levels-and-MVCC/image5.png differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/cover.png b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/cover.png new file mode 100644 index 0000000..760214f Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/cover.png differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image1.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image1.webp new file mode 100644 index 0000000..fb7e85c Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image1.webp differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image2.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image2.webp new file mode 100644 index 0000000..840d8f8 Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image2.webp differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image3.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image3.webp new file mode 100644 index 0000000..71542bf Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image3.webp differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image4.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image4.webp new file mode 100644 index 0000000..5936e54 Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image4.webp differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image5.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image5.webp new file mode 100644 index 0000000..635c990 Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image5.webp differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image6.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image6.webp new file mode 100644 index 0000000..27517ab Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image6.webp differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image7.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image7.webp new file mode 100644 index 0000000..14ee63f Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image7.webp differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image8.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image8.webp new file mode 100644 index 0000000..1392d44 Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image8.webp differ diff --git a/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image9.webp b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image9.webp new file mode 100644 index 0000000..9d46074 Binary files /dev/null and b/blog/Early-Explorations-and-Practices-of-Xline-a-Stateful-Application-Managed-by-Karmada/image9.webp differ diff --git a/blog/How-to-elegantly-organize-async-Rust-code/cover.png b/blog/How-to-elegantly-organize-async-Rust-code/cover.png new file mode 100644 index 0000000..6def882 Binary files /dev/null and b/blog/How-to-elegantly-organize-async-Rust-code/cover.png differ diff --git a/blog/How-to-elegantly-organize-async-Rust-code/image1.png b/blog/How-to-elegantly-organize-async-Rust-code/image1.png new file mode 100644 index 0000000..edbe629 Binary files /dev/null and b/blog/How-to-elegantly-organize-async-Rust-code/image1.png differ diff --git a/blog/Implementation-of-CURP-Server/cover.jpg b/blog/Implementation-of-CURP-Server/cover.jpg new file mode 100644 index 0000000..beb8ee6 Binary files /dev/null and b/blog/Implementation-of-CURP-Server/cover.jpg differ diff --git a/blog/Implementation-of-CURP-Server/image1.png b/blog/Implementation-of-CURP-Server/image1.png new file mode 100644 index 0000000..467596e Binary files /dev/null and b/blog/Implementation-of-CURP-Server/image1.png differ diff --git a/blog/Implementation-of-CURP-Server/image2.png b/blog/Implementation-of-CURP-Server/image2.png new file mode 100644 index 0000000..e09b412 Binary files /dev/null and b/blog/Implementation-of-CURP-Server/image2.png differ diff --git a/blog/Implementation-of-CURP-Server/image3.png b/blog/Implementation-of-CURP-Server/image3.png new file mode 100644 index 0000000..0c06f32 Binary files /dev/null and b/blog/Implementation-of-CURP-Server/image3.png differ diff --git a/blog/Implementation-of-CURP-Server/image4.png b/blog/Implementation-of-CURP-Server/image4.png new file mode 100644 index 0000000..bc5c48f Binary files /dev/null and b/blog/Implementation-of-CURP-Server/image4.png differ diff --git a/blog/Introduction-to-CURP-Protocol/cover.png b/blog/Introduction-to-CURP-Protocol/cover.png new file mode 100644 index 0000000..affd766 Binary files /dev/null and b/blog/Introduction-to-CURP-Protocol/cover.png differ diff --git a/blog/Introduction-to-CURP-Protocol/graph1.jpg b/blog/Introduction-to-CURP-Protocol/graph1.jpg new file mode 100644 index 0000000..8101a77 Binary files /dev/null and b/blog/Introduction-to-CURP-Protocol/graph1.jpg differ diff --git a/blog/Introduction-to-CURP-Protocol/graph2.jpg b/blog/Introduction-to-CURP-Protocol/graph2.jpg new file mode 100644 index 0000000..ef7e2e9 Binary files /dev/null and b/blog/Introduction-to-CURP-Protocol/graph2.jpg differ diff --git a/blog/Introduction-to-CURP-Protocol/graph3.jpg b/blog/Introduction-to-CURP-Protocol/graph3.jpg new file mode 100644 index 0000000..bd2f355 Binary files /dev/null and b/blog/Introduction-to-CURP-Protocol/graph3.jpg differ diff --git a/blog/Introduction-to-CURP-Protocol/graph4.jpg b/blog/Introduction-to-CURP-Protocol/graph4.jpg new file mode 100644 index 0000000..d7416cc Binary files /dev/null and b/blog/Introduction-to-CURP-Protocol/graph4.jpg differ diff --git a/blog/Mechanism-and-Implementation-of-Lease/cover.png b/blog/Mechanism-and-Implementation-of-Lease/cover.png new file mode 100644 index 0000000..7c2abd8 Binary files /dev/null and b/blog/Mechanism-and-Implementation-of-Lease/cover.png differ diff --git a/blog/Mechanism-and-Implementation-of-Lease/image1.PNG b/blog/Mechanism-and-Implementation-of-Lease/image1.PNG new file mode 100644 index 0000000..bdb67ed Binary files /dev/null and b/blog/Mechanism-and-Implementation-of-Lease/image1.PNG differ diff --git a/blog/Mechanism-and-Implementation-of-Lease/image2.png b/blog/Mechanism-and-Implementation-of-Lease/image2.png new file mode 100644 index 0000000..3312d73 Binary files /dev/null and b/blog/Mechanism-and-Implementation-of-Lease/image2.png differ diff --git a/blog/Mechanism-and-Implementation-of-Lease/image3.png b/blog/Mechanism-and-Implementation-of-Lease/image3.png new file mode 100644 index 0000000..125bd60 Binary files /dev/null and b/blog/Mechanism-and-Implementation-of-Lease/image3.png differ diff --git a/blog/Membership-Change-Source-Code-Interpretation/cover.png b/blog/Membership-Change-Source-Code-Interpretation/cover.png new file mode 100644 index 0000000..495a9a1 Binary files /dev/null and b/blog/Membership-Change-Source-Code-Interpretation/cover.png differ diff --git a/blog/Membership-Change-Source-Code-Interpretation/image1.PNG b/blog/Membership-Change-Source-Code-Interpretation/image1.PNG new file mode 100644 index 0000000..01b5ed0 Binary files /dev/null and b/blog/Membership-Change-Source-Code-Interpretation/image1.PNG differ diff --git a/blog/Membership-Change-Source-Code-Interpretation/image2.PNG b/blog/Membership-Change-Source-Code-Interpretation/image2.PNG new file mode 100644 index 0000000..5f04da9 Binary files /dev/null and b/blog/Membership-Change-Source-Code-Interpretation/image2.PNG differ diff --git a/blog/Membership-Change-Source-Code-Interpretation/image3.PNG b/blog/Membership-Change-Source-Code-Interpretation/image3.PNG new file mode 100644 index 0000000..0497d08 Binary files /dev/null and b/blog/Membership-Change-Source-Code-Interpretation/image3.PNG differ diff --git a/blog/Membership-Change-Source-Code-Interpretation/image4.PNG b/blog/Membership-Change-Source-Code-Interpretation/image4.PNG new file mode 100644 index 0000000..915853e Binary files /dev/null and b/blog/Membership-Change-Source-Code-Interpretation/image4.PNG differ diff --git a/blog/Revisit-the-Consensus-Protocol/cover.png b/blog/Revisit-the-Consensus-Protocol/cover.png new file mode 100644 index 0000000..69892cf Binary files /dev/null and b/blog/Revisit-the-Consensus-Protocol/cover.png differ diff --git a/blog/Revisit-the-Consensus-Protocol/image1.jpg b/blog/Revisit-the-Consensus-Protocol/image1.jpg new file mode 100644 index 0000000..f4f1afb Binary files /dev/null and b/blog/Revisit-the-Consensus-Protocol/image1.jpg differ diff --git a/blog/Revisit-the-Consensus-Protocol/image2.webp b/blog/Revisit-the-Consensus-Protocol/image2.webp new file mode 100644 index 0000000..4d244e3 Binary files /dev/null and b/blog/Revisit-the-Consensus-Protocol/image2.webp differ diff --git a/blog/Revisit-the-Consensus-Protocol/image3.webp b/blog/Revisit-the-Consensus-Protocol/image3.webp new file mode 100644 index 0000000..11d9128 Binary files /dev/null and b/blog/Revisit-the-Consensus-Protocol/image3.webp differ diff --git a/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/cover.png b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/cover.png new file mode 100644 index 0000000..925adbd Binary files /dev/null and b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/cover.png differ diff --git a/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image1.PNG b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image1.PNG new file mode 100644 index 0000000..76f0120 Binary files /dev/null and b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image1.PNG differ diff --git a/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image2.png b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image2.png new file mode 100644 index 0000000..db420f8 Binary files /dev/null and b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image2.png differ diff --git a/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image3.png b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image3.png new file mode 100644 index 0000000..aa4dfa6 Binary files /dev/null and b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image3.png differ diff --git a/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image4.png b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image4.png new file mode 100644 index 0000000..13f893c Binary files /dev/null and b/blog/The-design-and-implementation-of-the-Xline-persistent-storage-layer/image4.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/cover.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/cover.png new file mode 100644 index 0000000..4f8bb78 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/cover.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image1.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image1.png new file mode 100644 index 0000000..544ab70 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image1.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image10.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image10.png new file mode 100644 index 0000000..7d1a095 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image10.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image11.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image11.png new file mode 100644 index 0000000..eed8123 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image11.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image2.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image2.png new file mode 100644 index 0000000..b71e109 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image2.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image3.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image3.png new file mode 100644 index 0000000..97a2399 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image3.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image4.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image4.png new file mode 100644 index 0000000..d0d37f9 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image4.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image5.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image5.png new file mode 100644 index 0000000..47db263 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image5.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image6.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image6.png new file mode 100644 index 0000000..d05e4a8 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image6.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image7.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image7.png new file mode 100644 index 0000000..c78511e Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image7.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image8.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image8.png new file mode 100644 index 0000000..b6baba4 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image8.png differ diff --git a/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image9.png b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image9.png new file mode 100644 index 0000000..1d41505 Binary files /dev/null and b/blog/Thinking-About-Programs-from-Mathematical-Perspective-to-Verify-Their-Correctness/image9.png differ diff --git "a/blog/Xline-Command-Deduplication-Mechanism-(Part-One)\342\200\224Introduction-to-RIFL/cover.png" "b/blog/Xline-Command-Deduplication-Mechanism-(Part-One)\342\200\224Introduction-to-RIFL/cover.png" new file mode 100644 index 0000000..0744db8 Binary files /dev/null and "b/blog/Xline-Command-Deduplication-Mechanism-(Part-One)\342\200\224Introduction-to-RIFL/cover.png" differ diff --git "a/blog/Xline-Command-Deduplication-Mechanism-(Part-One)\342\200\224Introduction-to-RIFL/image1.png" "b/blog/Xline-Command-Deduplication-Mechanism-(Part-One)\342\200\224Introduction-to-RIFL/image1.png" new file mode 100644 index 0000000..71cc25a Binary files /dev/null and "b/blog/Xline-Command-Deduplication-Mechanism-(Part-One)\342\200\224Introduction-to-RIFL/image1.png" differ diff --git a/docs/Deploy/image1.png b/docs/Deploy/image1.png new file mode 100644 index 0000000..dab7063 Binary files /dev/null and b/docs/Deploy/image1.png differ diff --git a/docs/Deploy/image2.png b/docs/Deploy/image2.png new file mode 100644 index 0000000..5d97891 Binary files /dev/null and b/docs/Deploy/image2.png differ diff --git a/docs/Deploy/image3.png b/docs/Deploy/image3.png new file mode 100644 index 0000000..cb48b46 Binary files /dev/null and b/docs/Deploy/image3.png differ diff --git a/docs/Deploy/xline-key-perf.png b/docs/Deploy/xline-key-perf.png new file mode 100644 index 0000000..ad555cd Binary files /dev/null and b/docs/Deploy/xline-key-perf.png differ diff --git a/docs/Get-Started/image1.png b/docs/Get-Started/image1.png new file mode 100644 index 0000000..0226073 Binary files /dev/null and b/docs/Get-Started/image1.png differ diff --git a/docs/Xline-Architecture-Details/image1.jpg b/docs/Xline-Architecture-Details/image1.jpg new file mode 100644 index 0000000..115c975 Binary files /dev/null and b/docs/Xline-Architecture-Details/image1.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..70141d1 --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + + + + + + Xline + + + +
+ + + diff --git a/xline.svg b/xline.svg new file mode 100644 index 0000000..18ff884 --- /dev/null +++ b/xline.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +