diffact 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +2 -0
- package/dist/index-node-bKTmbwGt.mjs +1 -0
- package/dist/src-CPKE75x0.mjs +11 -0
- package/dist/src-Ceryd8j5.mjs +1 -0
- package/package.json +4 -5
- package/web/dist/assets/{code-block-37QAKDTI-C97XC0lL.js → code-block-37QAKDTI-yDNOZoY4.js} +1 -1
- package/web/dist/assets/{index-DWCfDth4.js → index-BlaXWu6U.js} +30 -30
- package/web/dist/assets/index-DMEToi1s.css +1 -0
- package/web/dist/index.html +2 -2
- package/dist/agent-manager.d.ts +0 -32
- package/dist/agent-manager.js +0 -502
- package/dist/app-server-client.d.ts +0 -38
- package/dist/app-server-client.js +0 -249
- package/dist/capabilities.d.ts +0 -2
- package/dist/capabilities.js +0 -27
- package/dist/cli.d.ts +0 -6
- package/dist/cli.js +0 -13
- package/dist/command-runner.d.ts +0 -83
- package/dist/command-runner.js +0 -427
- package/dist/editors.d.ts +0 -26
- package/dist/editors.js +0 -144
- package/dist/gh.d.ts +0 -61
- package/dist/gh.js +0 -185
- package/dist/git.d.ts +0 -57
- package/dist/git.js +0 -482
- package/dist/http.d.ts +0 -7
- package/dist/http.js +0 -98
- package/dist/index-node.d.ts +0 -5
- package/dist/index-node.js +0 -51
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -1011
- package/dist/list-directories.d.ts +0 -8
- package/dist/list-directories.js +0 -32
- package/dist/log.d.ts +0 -2
- package/dist/log.js +0 -2
- package/dist/open-browser.d.ts +0 -5
- package/dist/open-browser.js +0 -23
- package/dist/project-commands.d.ts +0 -17
- package/dist/project-commands.js +0 -152
- package/dist/project-path.d.ts +0 -5
- package/dist/project-path.js +0 -33
- package/dist/runtime.d.ts +0 -65
- package/dist/runtime.js +0 -235
- package/dist/static.d.ts +0 -10
- package/dist/static.js +0 -127
- package/dist/types.d.ts +0 -17
- package/dist/types.js +0 -1
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -26
- package/dist/ws-hub.d.ts +0 -20
- package/dist/ws-hub.js +0 -123
- package/web/dist/assets/index-CRDz04kv.css +0 -1
|
@@ -9,7 +9,7 @@ Error generating stack: `+f.message+`
|
|
|
9
9
|
`+f.stack}}var co=Object.prototype.hasOwnProperty,ho=e.unstable_scheduleCallback,Xl=e.unstable_cancelCallback,pm=e.unstable_shouldYield,mm=e.unstable_requestPaint,Bn=e.unstable_now,gm=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,De=e.unstable_NormalPriority,We=e.unstable_LowPriority,ot=e.unstable_IdlePriority,or=e.log,Ri=e.unstable_setDisableYieldValue,Hn=null,Xt=null;function Gn(a){if(typeof or=="function"&&Ri(a),Xt&&typeof Xt.setStrictMode=="function")try{Xt.setStrictMode(Hn,a)}catch{}}var mt=Math.clz32?Math.clz32:DD,ds=Math.log,Gr=Math.LN2;function DD(a){return a>>>=0,a===0?32:31-(ds(a)/Gr|0)|0}var wh=256,Ch=262144,Th=4194304;function la(a){var l=a&42;if(l!==0)return l;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function kh(a,l,h){var f=a.pendingLanes;if(f===0)return 0;var b=0,y=a.suspendedLanes,k=a.pingedLanes;a=a.warmLanes;var D=f&134217727;return D!==0?(f=D&~y,f!==0?b=la(f):(k&=D,k!==0?b=la(k):h||(h=D&~a,h!==0&&(b=la(h))))):(D=f&~y,D!==0?b=la(D):k!==0?b=la(k):h||(h=f&~a,h!==0&&(b=la(h)))),b===0?0:l!==0&&l!==b&&(l&y)===0&&(y=b&-b,h=l&-l,y>=h||y===32&&(h&4194048)!==0)?l:b}function Zl(a,l){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&l)===0}function MD(a,l){switch(a){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Py(){var a=Th;return Th<<=1,(Th&62914560)===0&&(Th=4194304),a}function _m(a){for(var l=[],h=0;31>h;h++)l.push(a);return l}function Jl(a,l){a.pendingLanes|=l,l!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ID(a,l,h,f,b,y){var k=a.pendingLanes;a.pendingLanes=h,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=h,a.entangledLanes&=h,a.errorRecoveryDisabledLanes&=h,a.shellSuspendCounter=0;var D=a.entanglements,K=a.expirationTimes,ie=a.hiddenUpdates;for(h=k&~h;0<h;){var ue=31-mt(h),fe=1<<ue;D[ue]=0,K[ue]=-1;var ae=ie[ue];if(ae!==null)for(ie[ue]=null,ue=0;ue<ae.length;ue++){var oe=ae[ue];oe!==null&&(oe.lane&=-536870913)}h&=~fe}f!==0&&By(a,f,0),y!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=y&~(k&~l))}function By(a,l,h){a.pendingLanes|=l,a.suspendedLanes&=~l;var f=31-mt(l);a.entangledLanes|=l,a.entanglements[f]=a.entanglements[f]|1073741824|h&261930}function Hy(a,l){var h=a.entangledLanes|=l;for(a=a.entanglements;h;){var f=31-mt(h),b=1<<f;b&l|a[f]&l&&(a[f]|=l),h&=~b}}function Fy(a,l){var h=l&-l;return h=(h&42)!==0?1:bm(h),(h&(a.suspendedLanes|l))!==0?0:h}function bm(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function vm(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function jy(){var a=Q.p;return a!==0?a:(a=window.event,a===void 0?32:Cw(a.type))}function zy(a,l){var h=Q.p;try{return Q.p=a,l()}finally{Q.p=h}}var fs=Math.random().toString(36).slice(2),Sn="__reactFiber$"+fs,Yn="__reactProps$"+fs,fo="__reactContainer$"+fs,ym="__reactEvents$"+fs,PD="__reactListeners$"+fs,BD="__reactHandles$"+fs,Uy="__reactResources$"+fs,eu="__reactMarker$"+fs;function Sm(a){delete a[Sn],delete a[Yn],delete a[ym],delete a[PD],delete a[BD]}function po(a){var l=a[Sn];if(l)return l;for(var h=a.parentNode;h;){if(l=h[fo]||h[Sn]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(a=uw(a);a!==null;){if(h=a[Sn])return h;a=uw(a)}return l}a=h,h=a.parentNode}return null}function mo(a){if(a=a[Sn]||a[fo]){var l=a.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return a}return null}function tu(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a.stateNode;throw Error(r(33))}function go(a){var l=a[Uy];return l||(l=a[Uy]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function un(a){a[eu]=!0}var $y=new Set,Vy={};function ua(a,l){_o(a,l),_o(a+"Capture",l)}function _o(a,l){for(Vy[a]=l,a=0;a<l.length;a++)$y.add(l[a])}var HD=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),qy={},Wy={};function FD(a){return co.call(Wy,a)?!0:co.call(qy,a)?!1:HD.test(a)?Wy[a]=!0:(qy[a]=!0,!1)}function Ah(a,l,h){if(FD(l))if(h===null)a.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":a.removeAttribute(l);return;case"boolean":var f=l.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){a.removeAttribute(l);return}}a.setAttribute(l,""+h)}}function Rh(a,l,h){if(h===null)a.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttribute(l,""+h)}}function Ni(a,l,h,f){if(f===null)a.removeAttribute(h);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttributeNS(l,h,""+f)}}function wr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Gy(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function jD(a,l,h){var f=Object.getOwnPropertyDescriptor(a.constructor.prototype,l);if(!a.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,y=f.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return b.call(this)},set:function(k){h=""+k,y.call(this,k)}}),Object.defineProperty(a,l,{enumerable:f.enumerable}),{getValue:function(){return h},setValue:function(k){h=""+k},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function Em(a){if(!a._valueTracker){var l=Gy(a)?"checked":"value";a._valueTracker=jD(a,l,""+a[l])}}function Yy(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var h=l.getValue(),f="";return a&&(f=Gy(a)?a.checked?"true":"false":a.value),a=f,a!==h?(l.setValue(a),!0):!1}function Nh(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var zD=/[\n"\\]/g;function Cr(a){return a.replace(zD,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function xm(a,l,h,f,b,y,k,D){a.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.type=k:a.removeAttribute("type"),l!=null?k==="number"?(l===0&&a.value===""||a.value!=l)&&(a.value=""+wr(l)):a.value!==""+wr(l)&&(a.value=""+wr(l)):k!=="submit"&&k!=="reset"||a.removeAttribute("value"),l!=null?wm(a,k,wr(l)):h!=null?wm(a,k,wr(h)):f!=null&&a.removeAttribute("value"),b==null&&y!=null&&(a.defaultChecked=!!y),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?a.name=""+wr(D):a.removeAttribute("name")}function Ky(a,l,h,f,b,y,k,D){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),l!=null||h!=null){if(!(y!=="submit"&&y!=="reset"||l!=null)){Em(a);return}h=h!=null?""+wr(h):"",l=l!=null?""+wr(l):h,D||l===a.value||(a.value=l),a.defaultValue=l}f=f??b,f=typeof f!="function"&&typeof f!="symbol"&&!!f,a.checked=D?a.checked:!!f,a.defaultChecked=!!f,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(a.name=k),Em(a)}function wm(a,l,h){l==="number"&&Nh(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function bo(a,l,h,f){if(a=a.options,l){l={};for(var b=0;b<h.length;b++)l["$"+h[b]]=!0;for(h=0;h<a.length;h++)b=l.hasOwnProperty("$"+a[h].value),a[h].selected!==b&&(a[h].selected=b),b&&f&&(a[h].defaultSelected=!0)}else{for(h=""+wr(h),l=null,b=0;b<a.length;b++){if(a[b].value===h){a[b].selected=!0,f&&(a[b].defaultSelected=!0);return}l!==null||a[b].disabled||(l=a[b])}l!==null&&(l.selected=!0)}}function Qy(a,l,h){if(l!=null&&(l=""+wr(l),l!==a.value&&(a.value=l),h==null)){a.defaultValue!==l&&(a.defaultValue=l);return}a.defaultValue=h!=null?""+wr(h):""}function Xy(a,l,h,f){if(l==null){if(f!=null){if(h!=null)throw Error(r(92));if(X(f)){if(1<f.length)throw Error(r(93));f=f[0]}h=f}h==null&&(h=""),l=h}h=wr(l),a.defaultValue=h,f=a.textContent,f===h&&f!==""&&f!==null&&(a.value=f),Em(a)}function vo(a,l){if(l){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=l;return}}a.textContent=l}var UD=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Zy(a,l,h){var f=l.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?f?a.setProperty(l,""):l==="float"?a.cssFloat="":a[l]="":f?a.setProperty(l,h):typeof h!="number"||h===0||UD.has(l)?l==="float"?a.cssFloat=h:a[l]=(""+h).trim():a[l]=h+"px"}function Jy(a,l,h){if(l!=null&&typeof l!="object")throw Error(r(62));if(a=a.style,h!=null){for(var f in h)!h.hasOwnProperty(f)||l!=null&&l.hasOwnProperty(f)||(f.indexOf("--")===0?a.setProperty(f,""):f==="float"?a.cssFloat="":a[f]="");for(var b in l)f=l[b],l.hasOwnProperty(b)&&h[b]!==f&&Zy(a,b,f)}else for(var y in l)l.hasOwnProperty(y)&&Zy(a,y,l[y])}function Cm(a){if(a.indexOf("-")===-1)return!1;switch(a){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 $D=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),VD=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lh(a){return VD.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Li(){}var Tm=null;function km(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var yo=null,So=null;function eS(a){var l=mo(a);if(l&&(a=l.stateNode)){var h=a[Yn]||null;e:switch(a=l.stateNode,l.type){case"input":if(xm(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),l=h.name,h.type==="radio"&&l!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Cr(""+l)+'"][type="radio"]'),l=0;l<h.length;l++){var f=h[l];if(f!==a&&f.form===a.form){var b=f[Yn]||null;if(!b)throw Error(r(90));xm(f,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(l=0;l<h.length;l++)f=h[l],f.form===a.form&&Yy(f)}break e;case"textarea":Qy(a,h.value,h.defaultValue);break e;case"select":l=h.value,l!=null&&bo(a,!!h.multiple,l,!1)}}}var Am=!1;function tS(a,l,h){if(Am)return a(l,h);Am=!0;try{var f=a(l);return f}finally{if(Am=!1,(yo!==null||So!==null)&&(bd(),yo&&(l=yo,a=So,So=yo=null,eS(l),a)))for(l=0;l<a.length;l++)eS(a[l])}}function nu(a,l){var h=a.stateNode;if(h===null)return null;var f=h[Yn]||null;if(f===null)return null;h=f[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(a=a.type,f=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!f;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var Oi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rm=!1;if(Oi)try{var ru={};Object.defineProperty(ru,"passive",{get:function(){Rm=!0}}),window.addEventListener("test",ru,ru),window.removeEventListener("test",ru,ru)}catch{Rm=!1}var ps=null,Nm=null,Oh=null;function nS(){if(Oh)return Oh;var a,l=Nm,h=l.length,f,b="value"in ps?ps.value:ps.textContent,y=b.length;for(a=0;a<h&&l[a]===b[a];a++);var k=h-a;for(f=1;f<=k&&l[h-f]===b[y-f];f++);return Oh=b.slice(a,1<f?1-f:void 0)}function Dh(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Mh(){return!0}function rS(){return!1}function Kn(a){function l(h,f,b,y,k){this._reactName=h,this._targetInst=b,this.type=f,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var D in a)a.hasOwnProperty(D)&&(h=a[D],this[D]=h?h(y):y[D]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Mh:rS,this.isPropagationStopped=rS,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Mh)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Mh)},persist:function(){},isPersistent:Mh}),l}var ca={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ih=Kn(ca),iu=m({},ca,{view:0,detail:0}),qD=Kn(iu),Lm,Om,su,Ph=m({},iu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mm,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==su&&(su&&a.type==="mousemove"?(Lm=a.screenX-su.screenX,Om=a.screenY-su.screenY):Om=Lm=0,su=a),Lm)},movementY:function(a){return"movementY"in a?a.movementY:Om}}),iS=Kn(Ph),WD=m({},Ph,{dataTransfer:0}),GD=Kn(WD),YD=m({},iu,{relatedTarget:0}),Dm=Kn(YD),KD=m({},ca,{animationName:0,elapsedTime:0,pseudoElement:0}),QD=Kn(KD),XD=m({},ca,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),ZD=Kn(XD),JD=m({},ca,{data:0}),sS=Kn(JD),e5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},t5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},n5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r5(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=n5[a])?!!l[a]:!1}function Mm(){return r5}var i5=m({},iu,{key:function(a){if(a.key){var l=e5[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=Dh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?t5[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mm,charCode:function(a){return a.type==="keypress"?Dh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Dh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),s5=Kn(i5),a5=m({},Ph,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aS=Kn(a5),o5=m({},iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mm}),l5=Kn(o5),u5=m({},ca,{propertyName:0,elapsedTime:0,pseudoElement:0}),c5=Kn(u5),h5=m({},Ph,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),d5=Kn(h5),f5=m({},ca,{newState:0,oldState:0}),p5=Kn(f5),m5=[9,13,27,32],Im=Oi&&"CompositionEvent"in window,au=null;Oi&&"documentMode"in document&&(au=document.documentMode);var g5=Oi&&"TextEvent"in window&&!au,oS=Oi&&(!Im||au&&8<au&&11>=au),lS=" ",uS=!1;function cS(a,l){switch(a){case"keyup":return m5.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Eo=!1;function _5(a,l){switch(a){case"compositionend":return hS(l);case"keypress":return l.which!==32?null:(uS=!0,lS);case"textInput":return a=l.data,a===lS&&uS?null:a;default:return null}}function b5(a,l){if(Eo)return a==="compositionend"||!Im&&cS(a,l)?(a=nS(),Oh=Nm=ps=null,Eo=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return oS&&l.locale!=="ko"?null:l.data;default:return null}}var v5={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function dS(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!v5[a.type]:l==="textarea"}function fS(a,l,h,f){yo?So?So.push(f):So=[f]:yo=f,l=Cd(l,"onChange"),0<l.length&&(h=new Ih("onChange","change",null,h,f),a.push({event:h,listeners:l}))}var ou=null,lu=null;function y5(a){Kx(a,0)}function Bh(a){var l=tu(a);if(Yy(l))return a}function pS(a,l){if(a==="change")return l}var mS=!1;if(Oi){var Pm;if(Oi){var Bm="oninput"in document;if(!Bm){var gS=document.createElement("div");gS.setAttribute("oninput","return;"),Bm=typeof gS.oninput=="function"}Pm=Bm}else Pm=!1;mS=Pm&&(!document.documentMode||9<document.documentMode)}function _S(){ou&&(ou.detachEvent("onpropertychange",bS),lu=ou=null)}function bS(a){if(a.propertyName==="value"&&Bh(lu)){var l=[];fS(l,lu,a,km(a)),tS(y5,l)}}function S5(a,l,h){a==="focusin"?(_S(),ou=l,lu=h,ou.attachEvent("onpropertychange",bS)):a==="focusout"&&_S()}function E5(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Bh(lu)}function x5(a,l){if(a==="click")return Bh(l)}function w5(a,l){if(a==="input"||a==="change")return Bh(l)}function C5(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var lr=typeof Object.is=="function"?Object.is:C5;function uu(a,l){if(lr(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var h=Object.keys(a),f=Object.keys(l);if(h.length!==f.length)return!1;for(f=0;f<h.length;f++){var b=h[f];if(!co.call(l,b)||!lr(a[b],l[b]))return!1}return!0}function vS(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function yS(a,l){var h=vS(a);a=0;for(var f;h;){if(h.nodeType===3){if(f=a+h.textContent.length,a<=l&&f>=l)return{node:h,offset:l-a};a=f}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=vS(h)}}function SS(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?SS(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function ES(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var l=Nh(a.document);l instanceof a.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)a=l.contentWindow;else break;l=Nh(a.document)}return l}function Hm(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}var T5=Oi&&"documentMode"in document&&11>=document.documentMode,xo=null,Fm=null,cu=null,jm=!1;function xS(a,l,h){var f=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;jm||xo==null||xo!==Nh(f)||(f=xo,"selectionStart"in f&&Hm(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),cu&&uu(cu,f)||(cu=f,f=Cd(Fm,"onSelect"),0<f.length&&(l=new Ih("onSelect","select",null,l,h),a.push({event:l,listeners:f}),l.target=xo)))}function ha(a,l){var h={};return h[a.toLowerCase()]=l.toLowerCase(),h["Webkit"+a]="webkit"+l,h["Moz"+a]="moz"+l,h}var wo={animationend:ha("Animation","AnimationEnd"),animationiteration:ha("Animation","AnimationIteration"),animationstart:ha("Animation","AnimationStart"),transitionrun:ha("Transition","TransitionRun"),transitionstart:ha("Transition","TransitionStart"),transitioncancel:ha("Transition","TransitionCancel"),transitionend:ha("Transition","TransitionEnd")},zm={},wS={};Oi&&(wS=document.createElement("div").style,"AnimationEvent"in window||(delete wo.animationend.animation,delete wo.animationiteration.animation,delete wo.animationstart.animation),"TransitionEvent"in window||delete wo.transitionend.transition);function da(a){if(zm[a])return zm[a];if(!wo[a])return a;var l=wo[a],h;for(h in l)if(l.hasOwnProperty(h)&&h in wS)return zm[a]=l[h];return a}var CS=da("animationend"),TS=da("animationiteration"),kS=da("animationstart"),k5=da("transitionrun"),A5=da("transitionstart"),R5=da("transitioncancel"),AS=da("transitionend"),RS=new Map,Um="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Um.push("scrollEnd");function Yr(a,l){RS.set(a,l),ua(l,[a])}var Hh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Tr=[],Co=0,$m=0;function Fh(){for(var a=Co,l=$m=Co=0;l<a;){var h=Tr[l];Tr[l++]=null;var f=Tr[l];Tr[l++]=null;var b=Tr[l];Tr[l++]=null;var y=Tr[l];if(Tr[l++]=null,f!==null&&b!==null){var k=f.pending;k===null?b.next=b:(b.next=k.next,k.next=b),f.pending=b}y!==0&&NS(h,b,y)}}function jh(a,l,h,f){Tr[Co++]=a,Tr[Co++]=l,Tr[Co++]=h,Tr[Co++]=f,$m|=f,a.lanes|=f,a=a.alternate,a!==null&&(a.lanes|=f)}function Vm(a,l,h,f){return jh(a,l,h,f),zh(a)}function fa(a,l){return jh(a,null,null,l),zh(a)}function NS(a,l,h){a.lanes|=h;var f=a.alternate;f!==null&&(f.lanes|=h);for(var b=!1,y=a.return;y!==null;)y.childLanes|=h,f=y.alternate,f!==null&&(f.childLanes|=h),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(b=!0)),a=y,y=y.return;return a.tag===3?(y=a.stateNode,b&&l!==null&&(b=31-mt(h),a=y.hiddenUpdates,f=a[b],f===null?a[b]=[l]:f.push(l),l.lane=h|536870912),y):null}function zh(a){if(50<Ou)throw Ou=0,Jg=null,Error(r(185));for(var l=a.return;l!==null;)a=l,l=a.return;return a.tag===3?a.stateNode:null}var To={};function N5(a,l,h,f){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(a,l,h,f){return new N5(a,l,h,f)}function qm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Di(a,l){var h=a.alternate;return h===null?(h=ur(a.tag,l,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=l,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&65011712,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,l=a.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h.refCleanup=a.refCleanup,h}function LS(a,l){a.flags&=65011714;var h=a.alternate;return h===null?(a.childLanes=0,a.lanes=l,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=h.childLanes,a.lanes=h.lanes,a.child=h.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=h.memoizedProps,a.memoizedState=h.memoizedState,a.updateQueue=h.updateQueue,a.type=h.type,l=h.dependencies,a.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),a}function Uh(a,l,h,f,b,y){var k=0;if(f=a,typeof a=="function")qm(a)&&(k=1);else if(typeof a=="string")k=IM(a,h,ce.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case ee:return a=ur(31,h,l,b),a.elementType=ee,a.lanes=y,a;case x:return pa(h.children,b,y,l);case C:k=8,b|=24;break;case w:return a=ur(12,h,l,b|2),a.elementType=w,a.lanes=y,a;case L:return a=ur(13,h,l,b),a.elementType=L,a.lanes=y,a;case I:return a=ur(19,h,l,b),a.elementType=I,a.lanes=y,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:k=10;break e;case A:k=9;break e;case N:k=11;break e;case P:k=14;break e;case q:k=16,f=null;break e}k=29,h=Error(r(130,a===null?"null":typeof a,"")),f=null}return l=ur(k,h,l,b),l.elementType=a,l.type=f,l.lanes=y,l}function pa(a,l,h,f){return a=ur(7,a,f,l),a.lanes=h,a}function Wm(a,l,h){return a=ur(6,a,null,l),a.lanes=h,a}function OS(a){var l=ur(18,null,null,0);return l.stateNode=a,l}function Gm(a,l,h){return l=ur(4,a.children!==null?a.children:[],a.key,l),l.lanes=h,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}var DS=new WeakMap;function kr(a,l){if(typeof a=="object"&&a!==null){var h=DS.get(a);return h!==void 0?h:(l={value:a,source:l,stack:xh(l)},DS.set(a,l),l)}return{value:a,source:l,stack:xh(l)}}var ko=[],Ao=0,$h=null,hu=0,Ar=[],Rr=0,ms=null,ii=1,si="";function Mi(a,l){ko[Ao++]=hu,ko[Ao++]=$h,$h=a,hu=l}function MS(a,l,h){Ar[Rr++]=ii,Ar[Rr++]=si,Ar[Rr++]=ms,ms=a;var f=ii;a=si;var b=32-mt(f)-1;f&=~(1<<b),h+=1;var y=32-mt(l)+b;if(30<y){var k=b-b%5;y=(f&(1<<k)-1).toString(32),f>>=k,b-=k,ii=1<<32-mt(l)+b|h<<b|f,si=y+a}else ii=1<<y|h<<b|f,si=a}function Ym(a){a.return!==null&&(Mi(a,1),MS(a,1,0))}function Km(a){for(;a===$h;)$h=ko[--Ao],ko[Ao]=null,hu=ko[--Ao],ko[Ao]=null;for(;a===ms;)ms=Ar[--Rr],Ar[Rr]=null,si=Ar[--Rr],Ar[Rr]=null,ii=Ar[--Rr],Ar[Rr]=null}function IS(a,l){Ar[Rr++]=ii,Ar[Rr++]=si,Ar[Rr++]=ms,ii=l.id,si=l.overflow,ms=a}var En=null,yt=null,Je=!1,gs=null,Nr=!1,Qm=Error(r(519));function _s(a){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw du(kr(l,a)),Qm}function PS(a){var l=a.stateNode,h=a.type,f=a.memoizedProps;switch(l[Sn]=a,l[Yn]=f,h){case"dialog":Ye("cancel",l),Ye("close",l);break;case"iframe":case"object":case"embed":Ye("load",l);break;case"video":case"audio":for(h=0;h<Mu.length;h++)Ye(Mu[h],l);break;case"source":Ye("error",l);break;case"img":case"image":case"link":Ye("error",l),Ye("load",l);break;case"details":Ye("toggle",l);break;case"input":Ye("invalid",l),Ky(l,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Ye("invalid",l);break;case"textarea":Ye("invalid",l),Xy(l,f.value,f.defaultValue,f.children)}h=f.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||l.textContent===""+h||f.suppressHydrationWarning===!0||Jx(l.textContent,h)?(f.popover!=null&&(Ye("beforetoggle",l),Ye("toggle",l)),f.onScroll!=null&&Ye("scroll",l),f.onScrollEnd!=null&&Ye("scrollend",l),f.onClick!=null&&(l.onclick=Li),l=!0):l=!1,l||_s(a,!0)}function BS(a){for(En=a.return;En;)switch(En.tag){case 5:case 31:case 13:Nr=!1;return;case 27:case 3:Nr=!0;return;default:En=En.return}}function Ro(a){if(a!==En)return!1;if(!Je)return BS(a),Je=!0,!1;var l=a.tag,h;if((h=l!==3&&l!==27)&&((h=l===5)&&(h=a.type,h=!(h!=="form"&&h!=="button")||p0(a.type,a.memoizedProps)),h=!h),h&&yt&&_s(a),BS(a),l===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));yt=lw(a)}else if(l===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));yt=lw(a)}else l===27?(l=yt,Ls(a.type)?(a=v0,v0=null,yt=a):yt=l):yt=En?Or(a.stateNode.nextSibling):null;return!0}function ma(){yt=En=null,Je=!1}function Xm(){var a=gs;return a!==null&&(Jn===null?Jn=a:Jn.push.apply(Jn,a),gs=null),a}function du(a){gs===null?gs=[a]:gs.push(a)}var Zm=U(null),ga=null,Ii=null;function bs(a,l,h){O(Zm,l._currentValue),l._currentValue=h}function Pi(a){a._currentValue=Zm.current,se(Zm)}function Jm(a,l,h){for(;a!==null;){var f=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,f!==null&&(f.childLanes|=l)):f!==null&&(f.childLanes&l)!==l&&(f.childLanes|=l),a===h)break;a=a.return}}function eg(a,l,h,f){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var y=b.dependencies;if(y!==null){var k=b.child;y=y.firstContext;e:for(;y!==null;){var D=y;y=b;for(var K=0;K<l.length;K++)if(D.context===l[K]){y.lanes|=h,D=y.alternate,D!==null&&(D.lanes|=h),Jm(y.return,h,a),f||(k=null);break e}y=D.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(r(341));k.lanes|=h,y=k.alternate,y!==null&&(y.lanes|=h),Jm(k,h,a),k=null}else k=b.child;if(k!==null)k.return=b;else for(k=b;k!==null;){if(k===a){k=null;break}if(b=k.sibling,b!==null){b.return=k.return,k=b;break}k=k.return}b=k}}function No(a,l,h,f){a=null;for(var b=l,y=!1;b!==null;){if(!y){if((b.flags&524288)!==0)y=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var k=b.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var D=b.type;lr(b.pendingProps.value,k.value)||(a!==null?a.push(D):a=[D])}}else if(b===Ee.current){if(k=b.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Fu):a=[Fu])}b=b.return}a!==null&&eg(l,a,h,f),l.flags|=262144}function Vh(a){for(a=a.firstContext;a!==null;){if(!lr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function _a(a){ga=a,Ii=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function xn(a){return HS(ga,a)}function qh(a,l){return ga===null&&_a(a),HS(a,l)}function HS(a,l){var h=l._currentValue;if(l={context:l,memoizedValue:h,next:null},Ii===null){if(a===null)throw Error(r(308));Ii=l,a.dependencies={lanes:0,firstContext:l},a.flags|=524288}else Ii=Ii.next=l;return h}var L5=typeof AbortController<"u"?AbortController:function(){var a=[],l=this.signal={aborted:!1,addEventListener:function(h,f){a.push(f)}};this.abort=function(){l.aborted=!0,a.forEach(function(h){return h()})}},O5=e.unstable_scheduleCallback,D5=e.unstable_NormalPriority,$t={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tg(){return{controller:new L5,data:new Map,refCount:0}}function fu(a){a.refCount--,a.refCount===0&&O5(D5,function(){a.controller.abort()})}var pu=null,ng=0,Lo=0,Oo=null;function M5(a,l){if(pu===null){var h=pu=[];ng=0,Lo=s0(),Oo={status:"pending",value:void 0,then:function(f){h.push(f)}}}return ng++,l.then(FS,FS),l}function FS(){if(--ng===0&&pu!==null){Oo!==null&&(Oo.status="fulfilled");var a=pu;pu=null,Lo=0,Oo=null;for(var l=0;l<a.length;l++)(0,a[l])()}}function I5(a,l){var h=[],f={status:"pending",value:null,reason:null,then:function(b){h.push(b)}};return a.then(function(){f.status="fulfilled",f.value=l;for(var b=0;b<h.length;b++)(0,h[b])(l)},function(b){for(f.status="rejected",f.reason=b,b=0;b<h.length;b++)(0,h[b])(void 0)}),f}var jS=M.S;M.S=function(a,l){xx=Bn(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&M5(a,l),jS!==null&&jS(a,l)};var ba=U(null);function rg(){var a=ba.current;return a!==null?a:gt.pooledCache}function Wh(a,l){l===null?O(ba,ba.current):O(ba,l.pool)}function zS(){var a=rg();return a===null?null:{parent:$t._currentValue,pool:a}}var Do=Error(r(460)),ig=Error(r(474)),Gh=Error(r(542)),Yh={then:function(){}};function US(a){return a=a.status,a==="fulfilled"||a==="rejected"}function $S(a,l,h){switch(h=a[h],h===void 0?a.push(l):h!==l&&(l.then(Li,Li),l=h),l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,qS(a),a;default:if(typeof l.status=="string")l.then(Li,Li);else{if(a=gt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=l,a.status="pending",a.then(function(f){if(l.status==="pending"){var b=l;b.status="fulfilled",b.value=f}},function(f){if(l.status==="pending"){var b=l;b.status="rejected",b.reason=f}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,qS(a),a}throw ya=l,Do}}function va(a){try{var l=a._init;return l(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(ya=h,Do):h}}var ya=null;function VS(){if(ya===null)throw Error(r(459));var a=ya;return ya=null,a}function qS(a){if(a===Do||a===Gh)throw Error(r(483))}var Mo=null,mu=0;function Kh(a){var l=mu;return mu+=1,Mo===null&&(Mo=[]),$S(Mo,a,l)}function gu(a,l){l=l.props.ref,a.ref=l!==void 0?l:null}function Qh(a,l){throw l.$$typeof===g?Error(r(525)):(a=Object.prototype.toString.call(l),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a)))}function WS(a){function l(te,Z){if(a){var re=te.deletions;re===null?(te.deletions=[Z],te.flags|=16):re.push(Z)}}function h(te,Z){if(!a)return null;for(;Z!==null;)l(te,Z),Z=Z.sibling;return null}function f(te){for(var Z=new Map;te!==null;)te.key!==null?Z.set(te.key,te):Z.set(te.index,te),te=te.sibling;return Z}function b(te,Z){return te=Di(te,Z),te.index=0,te.sibling=null,te}function y(te,Z,re){return te.index=re,a?(re=te.alternate,re!==null?(re=re.index,re<Z?(te.flags|=67108866,Z):re):(te.flags|=67108866,Z)):(te.flags|=1048576,Z)}function k(te){return a&&te.alternate===null&&(te.flags|=67108866),te}function D(te,Z,re,de){return Z===null||Z.tag!==6?(Z=Wm(re,te.mode,de),Z.return=te,Z):(Z=b(Z,re),Z.return=te,Z)}function K(te,Z,re,de){var Ne=re.type;return Ne===x?ue(te,Z,re.props.children,de,re.key):Z!==null&&(Z.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===q&&va(Ne)===Z.type)?(Z=b(Z,re.props),gu(Z,re),Z.return=te,Z):(Z=Uh(re.type,re.key,re.props,null,te.mode,de),gu(Z,re),Z.return=te,Z)}function ie(te,Z,re,de){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=Gm(re,te.mode,de),Z.return=te,Z):(Z=b(Z,re.children||[]),Z.return=te,Z)}function ue(te,Z,re,de,Ne){return Z===null||Z.tag!==7?(Z=pa(re,te.mode,de,Ne),Z.return=te,Z):(Z=b(Z,re),Z.return=te,Z)}function fe(te,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Wm(""+Z,te.mode,re),Z.return=te,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:return re=Uh(Z.type,Z.key,Z.props,null,te.mode,re),gu(re,Z),re.return=te,re;case v:return Z=Gm(Z,te.mode,re),Z.return=te,Z;case q:return Z=va(Z),fe(te,Z,re)}if(X(Z)||B(Z))return Z=pa(Z,te.mode,re,null),Z.return=te,Z;if(typeof Z.then=="function")return fe(te,Kh(Z),re);if(Z.$$typeof===R)return fe(te,qh(te,Z),re);Qh(te,Z)}return null}function ae(te,Z,re,de){var Ne=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ne!==null?null:D(te,Z,""+re,de);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case _:return re.key===Ne?K(te,Z,re,de):null;case v:return re.key===Ne?ie(te,Z,re,de):null;case q:return re=va(re),ae(te,Z,re,de)}if(X(re)||B(re))return Ne!==null?null:ue(te,Z,re,de,null);if(typeof re.then=="function")return ae(te,Z,Kh(re),de);if(re.$$typeof===R)return ae(te,Z,qh(te,re),de);Qh(te,re)}return null}function oe(te,Z,re,de,Ne){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return te=te.get(re)||null,D(Z,te,""+de,Ne);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case _:return te=te.get(de.key===null?re:de.key)||null,K(Z,te,de,Ne);case v:return te=te.get(de.key===null?re:de.key)||null,ie(Z,te,de,Ne);case q:return de=va(de),oe(te,Z,re,de,Ne)}if(X(de)||B(de))return te=te.get(re)||null,ue(Z,te,de,Ne,null);if(typeof de.then=="function")return oe(te,Z,re,Kh(de),Ne);if(de.$$typeof===R)return oe(te,Z,re,qh(Z,de),Ne);Qh(Z,de)}return null}function Ce(te,Z,re,de){for(var Ne=null,rt=null,Re=Z,Fe=Z=0,Ze=null;Re!==null&&Fe<re.length;Fe++){Re.index>Fe?(Ze=Re,Re=null):Ze=Re.sibling;var it=ae(te,Re,re[Fe],de);if(it===null){Re===null&&(Re=Ze);break}a&&Re&&it.alternate===null&&l(te,Re),Z=y(it,Z,Fe),rt===null?Ne=it:rt.sibling=it,rt=it,Re=Ze}if(Fe===re.length)return h(te,Re),Je&&Mi(te,Fe),Ne;if(Re===null){for(;Fe<re.length;Fe++)Re=fe(te,re[Fe],de),Re!==null&&(Z=y(Re,Z,Fe),rt===null?Ne=Re:rt.sibling=Re,rt=Re);return Je&&Mi(te,Fe),Ne}for(Re=f(Re);Fe<re.length;Fe++)Ze=oe(Re,te,Fe,re[Fe],de),Ze!==null&&(a&&Ze.alternate!==null&&Re.delete(Ze.key===null?Fe:Ze.key),Z=y(Ze,Z,Fe),rt===null?Ne=Ze:rt.sibling=Ze,rt=Ze);return a&&Re.forEach(function(Ps){return l(te,Ps)}),Je&&Mi(te,Fe),Ne}function Oe(te,Z,re,de){if(re==null)throw Error(r(151));for(var Ne=null,rt=null,Re=Z,Fe=Z=0,Ze=null,it=re.next();Re!==null&&!it.done;Fe++,it=re.next()){Re.index>Fe?(Ze=Re,Re=null):Ze=Re.sibling;var Ps=ae(te,Re,it.value,de);if(Ps===null){Re===null&&(Re=Ze);break}a&&Re&&Ps.alternate===null&&l(te,Re),Z=y(Ps,Z,Fe),rt===null?Ne=Ps:rt.sibling=Ps,rt=Ps,Re=Ze}if(it.done)return h(te,Re),Je&&Mi(te,Fe),Ne;if(Re===null){for(;!it.done;Fe++,it=re.next())it=fe(te,it.value,de),it!==null&&(Z=y(it,Z,Fe),rt===null?Ne=it:rt.sibling=it,rt=it);return Je&&Mi(te,Fe),Ne}for(Re=f(Re);!it.done;Fe++,it=re.next())it=oe(Re,te,Fe,it.value,de),it!==null&&(a&&it.alternate!==null&&Re.delete(it.key===null?Fe:it.key),Z=y(it,Z,Fe),rt===null?Ne=it:rt.sibling=it,rt=it);return a&&Re.forEach(function(WM){return l(te,WM)}),Je&&Mi(te,Fe),Ne}function dt(te,Z,re,de){if(typeof re=="object"&&re!==null&&re.type===x&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case _:e:{for(var Ne=re.key;Z!==null;){if(Z.key===Ne){if(Ne=re.type,Ne===x){if(Z.tag===7){h(te,Z.sibling),de=b(Z,re.props.children),de.return=te,te=de;break e}}else if(Z.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===q&&va(Ne)===Z.type){h(te,Z.sibling),de=b(Z,re.props),gu(de,re),de.return=te,te=de;break e}h(te,Z);break}else l(te,Z);Z=Z.sibling}re.type===x?(de=pa(re.props.children,te.mode,de,re.key),de.return=te,te=de):(de=Uh(re.type,re.key,re.props,null,te.mode,de),gu(de,re),de.return=te,te=de)}return k(te);case v:e:{for(Ne=re.key;Z!==null;){if(Z.key===Ne)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){h(te,Z.sibling),de=b(Z,re.children||[]),de.return=te,te=de;break e}else{h(te,Z);break}else l(te,Z);Z=Z.sibling}de=Gm(re,te.mode,de),de.return=te,te=de}return k(te);case q:return re=va(re),dt(te,Z,re,de)}if(X(re))return Ce(te,Z,re,de);if(B(re)){if(Ne=B(re),typeof Ne!="function")throw Error(r(150));return re=Ne.call(re),Oe(te,Z,re,de)}if(typeof re.then=="function")return dt(te,Z,Kh(re),de);if(re.$$typeof===R)return dt(te,Z,qh(te,re),de);Qh(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Z!==null&&Z.tag===6?(h(te,Z.sibling),de=b(Z,re),de.return=te,te=de):(h(te,Z),de=Wm(re,te.mode,de),de.return=te,te=de),k(te)):h(te,Z)}return function(te,Z,re,de){try{mu=0;var Ne=dt(te,Z,re,de);return Mo=null,Ne}catch(Re){if(Re===Do||Re===Gh)throw Re;var rt=ur(29,Re,null,te.mode);return rt.lanes=de,rt.return=te,rt}}}var Sa=WS(!0),GS=WS(!1),vs=!1;function sg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ag(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ys(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Ss(a,l,h){var f=a.updateQueue;if(f===null)return null;if(f=f.shared,(at&2)!==0){var b=f.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),f.pending=l,l=zh(a),NS(a,null,h),l}return jh(a,f,l,h),zh(a)}function _u(a,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194048)!==0)){var f=l.lanes;f&=a.pendingLanes,h|=f,l.lanes=h,Hy(a,h)}}function og(a,l){var h=a.updateQueue,f=a.alternate;if(f!==null&&(f=f.updateQueue,h===f)){var b=null,y=null;if(h=h.firstBaseUpdate,h!==null){do{var k={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};y===null?b=y=k:y=y.next=k,h=h.next}while(h!==null);y===null?b=y=l:y=y.next=l}else b=y=l;h={baseState:f.baseState,firstBaseUpdate:b,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=l:a.next=l,h.lastBaseUpdate=l}var lg=!1;function bu(){if(lg){var a=Oo;if(a!==null)throw a}}function vu(a,l,h,f){lg=!1;var b=a.updateQueue;vs=!1;var y=b.firstBaseUpdate,k=b.lastBaseUpdate,D=b.shared.pending;if(D!==null){b.shared.pending=null;var K=D,ie=K.next;K.next=null,k===null?y=ie:k.next=ie,k=K;var ue=a.alternate;ue!==null&&(ue=ue.updateQueue,D=ue.lastBaseUpdate,D!==k&&(D===null?ue.firstBaseUpdate=ie:D.next=ie,ue.lastBaseUpdate=K))}if(y!==null){var fe=b.baseState;k=0,ue=ie=K=null,D=y;do{var ae=D.lane&-536870913,oe=ae!==D.lane;if(oe?(Xe&ae)===ae:(f&ae)===ae){ae!==0&&ae===Lo&&(lg=!0),ue!==null&&(ue=ue.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Ce=a,Oe=D;ae=l;var dt=h;switch(Oe.tag){case 1:if(Ce=Oe.payload,typeof Ce=="function"){fe=Ce.call(dt,fe,ae);break e}fe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Oe.payload,ae=typeof Ce=="function"?Ce.call(dt,fe,ae):Ce,ae==null)break e;fe=m({},fe,ae);break e;case 2:vs=!0}}ae=D.callback,ae!==null&&(a.flags|=64,oe&&(a.flags|=8192),oe=b.callbacks,oe===null?b.callbacks=[ae]:oe.push(ae))}else oe={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ue===null?(ie=ue=oe,K=fe):ue=ue.next=oe,k|=ae;if(D=D.next,D===null){if(D=b.shared.pending,D===null)break;oe=D,D=oe.next,oe.next=null,b.lastBaseUpdate=oe,b.shared.pending=null}}while(!0);ue===null&&(K=fe),b.baseState=K,b.firstBaseUpdate=ie,b.lastBaseUpdate=ue,y===null&&(b.shared.lanes=0),Ts|=k,a.lanes=k,a.memoizedState=fe}}function YS(a,l){if(typeof a!="function")throw Error(r(191,a));a.call(l)}function KS(a,l){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)YS(h[a],l)}var Io=U(null),Xh=U(0);function QS(a,l){a=qi,O(Xh,a),O(Io,l),qi=a|l.baseLanes}function ug(){O(Xh,qi),O(Io,Io.current)}function cg(){qi=Xh.current,se(Io),se(Xh)}var cr=U(null),Lr=null;function Es(a){var l=a.alternate;O(Ht,Ht.current&1),O(cr,a),Lr===null&&(l===null||Io.current!==null||l.memoizedState!==null)&&(Lr=a)}function hg(a){O(Ht,Ht.current),O(cr,a),Lr===null&&(Lr=a)}function XS(a){a.tag===22?(O(Ht,Ht.current),O(cr,a),Lr===null&&(Lr=a)):xs()}function xs(){O(Ht,Ht.current),O(cr,cr.current)}function hr(a){se(cr),Lr===a&&(Lr=null),se(Ht)}var Ht=U(0);function Zh(a){for(var l=a;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||_0(h)||b0(h)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Bi=0,He=null,ct=null,Vt=null,Jh=!1,Po=!1,Ea=!1,ed=0,yu=0,Bo=null,P5=0;function Lt(){throw Error(r(321))}function dg(a,l){if(l===null)return!1;for(var h=0;h<l.length&&h<a.length;h++)if(!lr(a[h],l[h]))return!1;return!0}function fg(a,l,h,f,b,y){return Bi=y,He=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=a===null||a.memoizedState===null?ME:Ag,Ea=!1,y=h(f,b),Ea=!1,Po&&(y=JS(l,h,f,b)),ZS(a),y}function ZS(a){M.H=xu;var l=ct!==null&&ct.next!==null;if(Bi=0,Vt=ct=He=null,Jh=!1,yu=0,Bo=null,l)throw Error(r(300));a===null||qt||(a=a.dependencies,a!==null&&Vh(a)&&(qt=!0))}function JS(a,l,h,f){He=a;var b=0;do{if(Po&&(Bo=null),yu=0,Po=!1,25<=b)throw Error(r(301));if(b+=1,Vt=ct=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}M.H=IE,y=l(h,f)}while(Po);return y}function B5(){var a=M.H,l=a.useState()[0];return l=typeof l.then=="function"?Su(l):l,a=a.useState()[0],(ct!==null?ct.memoizedState:null)!==a&&(He.flags|=1024),l}function pg(){var a=ed!==0;return ed=0,a}function mg(a,l,h){l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~h}function gg(a){if(Jh){for(a=a.memoizedState;a!==null;){var l=a.queue;l!==null&&(l.pending=null),a=a.next}Jh=!1}Bi=0,Vt=ct=He=null,Po=!1,yu=ed=0,Bo=null}function Fn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?He.memoizedState=Vt=a:Vt=Vt.next=a,Vt}function Ft(){if(ct===null){var a=He.alternate;a=a!==null?a.memoizedState:null}else a=ct.next;var l=Vt===null?He.memoizedState:Vt.next;if(l!==null)Vt=l,ct=a;else{if(a===null)throw He.alternate===null?Error(r(467)):Error(r(310));ct=a,a={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},Vt===null?He.memoizedState=Vt=a:Vt=Vt.next=a}return Vt}function td(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Su(a){var l=yu;return yu+=1,Bo===null&&(Bo=[]),a=$S(Bo,a,l),l=He,(Vt===null?l.memoizedState:Vt.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?ME:Ag),a}function nd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Su(a);if(a.$$typeof===R)return xn(a)}throw Error(r(438,String(a)))}function _g(a){var l=null,h=He.updateQueue;if(h!==null&&(l=h.memoCache),l==null){var f=He.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(l={data:f.data.map(function(b){return b.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),h===null&&(h=td(),He.updateQueue=h),h.memoCache=l,h=l.data[l.index],h===void 0)for(h=l.data[l.index]=Array(a),f=0;f<a;f++)h[f]=F;return l.index++,h}function Hi(a,l){return typeof l=="function"?l(a):l}function rd(a){var l=Ft();return bg(l,ct,a)}function bg(a,l,h){var f=a.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=h;var b=a.baseQueue,y=f.pending;if(y!==null){if(b!==null){var k=b.next;b.next=y.next,y.next=k}l.baseQueue=b=y,f.pending=null}if(y=a.baseState,b===null)a.memoizedState=y;else{l=b.next;var D=k=null,K=null,ie=l,ue=!1;do{var fe=ie.lane&-536870913;if(fe!==ie.lane?(Xe&fe)===fe:(Bi&fe)===fe){var ae=ie.revertLane;if(ae===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),fe===Lo&&(ue=!0);else if((Bi&ae)===ae){ie=ie.next,ae===Lo&&(ue=!0);continue}else fe={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(D=K=fe,k=y):K=K.next=fe,He.lanes|=ae,Ts|=ae;fe=ie.action,Ea&&h(y,fe),y=ie.hasEagerState?ie.eagerState:h(y,fe)}else ae={lane:fe,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(D=K=ae,k=y):K=K.next=ae,He.lanes|=fe,Ts|=fe;ie=ie.next}while(ie!==null&&ie!==l);if(K===null?k=y:K.next=D,!lr(y,a.memoizedState)&&(qt=!0,ue&&(h=Oo,h!==null)))throw h;a.memoizedState=y,a.baseState=k,a.baseQueue=K,f.lastRenderedState=y}return b===null&&(f.lanes=0),[a.memoizedState,f.dispatch]}function vg(a){var l=Ft(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=a;var f=h.dispatch,b=h.pending,y=l.memoizedState;if(b!==null){h.pending=null;var k=b=b.next;do y=a(y,k.action),k=k.next;while(k!==b);lr(y,l.memoizedState)||(qt=!0),l.memoizedState=y,l.baseQueue===null&&(l.baseState=y),h.lastRenderedState=y}return[y,f]}function eE(a,l,h){var f=He,b=Ft(),y=Je;if(y){if(h===void 0)throw Error(r(407));h=h()}else h=l();var k=!lr((ct||b).memoizedState,h);if(k&&(b.memoizedState=h,qt=!0),b=b.queue,Eg(rE.bind(null,f,b,a),[a]),b.getSnapshot!==l||k||Vt!==null&&Vt.memoizedState.tag&1){if(f.flags|=2048,Ho(9,{destroy:void 0},nE.bind(null,f,b,h,l),null),gt===null)throw Error(r(349));y||(Bi&127)!==0||tE(f,l,h)}return h}function tE(a,l,h){a.flags|=16384,a={getSnapshot:l,value:h},l=He.updateQueue,l===null?(l=td(),He.updateQueue=l,l.stores=[a]):(h=l.stores,h===null?l.stores=[a]:h.push(a))}function nE(a,l,h,f){l.value=h,l.getSnapshot=f,iE(l)&&sE(a)}function rE(a,l,h){return h(function(){iE(l)&&sE(a)})}function iE(a){var l=a.getSnapshot;a=a.value;try{var h=l();return!lr(a,h)}catch{return!0}}function sE(a){var l=fa(a,2);l!==null&&er(l,a,2)}function yg(a){var l=Fn();if(typeof a=="function"){var h=a;if(a=h(),Ea){Gn(!0);try{h()}finally{Gn(!1)}}}return l.memoizedState=l.baseState=a,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:a},l}function aE(a,l,h,f){return a.baseState=h,bg(a,ct,typeof f=="function"?f:Hi)}function H5(a,l,h,f,b){if(ad(a))throw Error(r(485));if(a=l.action,a!==null){var y={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};M.T!==null?h(!0):y.isTransition=!1,f(y),h=l.pending,h===null?(y.next=l.pending=y,oE(l,y)):(y.next=h.next,l.pending=h.next=y)}}function oE(a,l){var h=l.action,f=l.payload,b=a.state;if(l.isTransition){var y=M.T,k={};M.T=k;try{var D=h(b,f),K=M.S;K!==null&&K(k,D),lE(a,l,D)}catch(ie){Sg(a,l,ie)}finally{y!==null&&k.types!==null&&(y.types=k.types),M.T=y}}else try{y=h(b,f),lE(a,l,y)}catch(ie){Sg(a,l,ie)}}function lE(a,l,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(f){uE(a,l,f)},function(f){return Sg(a,l,f)}):uE(a,l,h)}function uE(a,l,h){l.status="fulfilled",l.value=h,cE(l),a.state=h,l=a.pending,l!==null&&(h=l.next,h===l?a.pending=null:(h=h.next,l.next=h,oE(a,h)))}function Sg(a,l,h){var f=a.pending;if(a.pending=null,f!==null){f=f.next;do l.status="rejected",l.reason=h,cE(l),l=l.next;while(l!==f)}a.action=null}function cE(a){a=a.listeners;for(var l=0;l<a.length;l++)(0,a[l])()}function hE(a,l){return l}function dE(a,l){if(Je){var h=gt.formState;if(h!==null){e:{var f=He;if(Je){if(yt){t:{for(var b=yt,y=Nr;b.nodeType!==8;){if(!y){b=null;break t}if(b=Or(b.nextSibling),b===null){b=null;break t}}y=b.data,b=y==="F!"||y==="F"?b:null}if(b){yt=Or(b.nextSibling),f=b.data==="F!";break e}}_s(f)}f=!1}f&&(l=h[0])}}return h=Fn(),h.memoizedState=h.baseState=l,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hE,lastRenderedState:l},h.queue=f,h=LE.bind(null,He,f),f.dispatch=h,f=yg(!1),y=kg.bind(null,He,!1,f.queue),f=Fn(),b={state:l,dispatch:null,action:a,pending:null},f.queue=b,h=H5.bind(null,He,b,y,h),b.dispatch=h,f.memoizedState=a,[l,h,!1]}function fE(a){var l=Ft();return pE(l,ct,a)}function pE(a,l,h){if(l=bg(a,l,hE)[0],a=rd(Hi)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var f=Su(l)}catch(k){throw k===Do?Gh:k}else f=l;l=Ft();var b=l.queue,y=b.dispatch;return h!==l.memoizedState&&(He.flags|=2048,Ho(9,{destroy:void 0},F5.bind(null,b,h),null)),[f,y,a]}function F5(a,l){a.action=l}function mE(a){var l=Ft(),h=ct;if(h!==null)return pE(l,h,a);Ft(),l=l.memoizedState,h=Ft();var f=h.queue.dispatch;return h.memoizedState=a,[l,f,!1]}function Ho(a,l,h,f){return a={tag:a,create:h,deps:f,inst:l,next:null},l=He.updateQueue,l===null&&(l=td(),He.updateQueue=l),h=l.lastEffect,h===null?l.lastEffect=a.next=a:(f=h.next,h.next=a,a.next=f,l.lastEffect=a),a}function gE(){return Ft().memoizedState}function id(a,l,h,f){var b=Fn();He.flags|=a,b.memoizedState=Ho(1|l,{destroy:void 0},h,f===void 0?null:f)}function sd(a,l,h,f){var b=Ft();f=f===void 0?null:f;var y=b.memoizedState.inst;ct!==null&&f!==null&&dg(f,ct.memoizedState.deps)?b.memoizedState=Ho(l,y,h,f):(He.flags|=a,b.memoizedState=Ho(1|l,y,h,f))}function _E(a,l){id(8390656,8,a,l)}function Eg(a,l){sd(2048,8,a,l)}function j5(a){He.flags|=4;var l=He.updateQueue;if(l===null)l=td(),He.updateQueue=l,l.events=[a];else{var h=l.events;h===null?l.events=[a]:h.push(a)}}function bE(a){var l=Ft().memoizedState;return j5({ref:l,nextImpl:a}),function(){if((at&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function vE(a,l){return sd(4,2,a,l)}function yE(a,l){return sd(4,4,a,l)}function SE(a,l){if(typeof l=="function"){a=a();var h=l(a);return function(){typeof h=="function"?h():l(null)}}if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function EE(a,l,h){h=h!=null?h.concat([a]):null,sd(4,4,SE.bind(null,l,a),h)}function xg(){}function xE(a,l){var h=Ft();l=l===void 0?null:l;var f=h.memoizedState;return l!==null&&dg(l,f[1])?f[0]:(h.memoizedState=[a,l],a)}function wE(a,l){var h=Ft();l=l===void 0?null:l;var f=h.memoizedState;if(l!==null&&dg(l,f[1]))return f[0];if(f=a(),Ea){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[f,l],f}function wg(a,l,h){return h===void 0||(Bi&1073741824)!==0&&(Xe&261930)===0?a.memoizedState=l:(a.memoizedState=h,a=Cx(),He.lanes|=a,Ts|=a,h)}function CE(a,l,h,f){return lr(h,l)?h:Io.current!==null?(a=wg(a,h,f),lr(a,l)||(qt=!0),a):(Bi&42)===0||(Bi&1073741824)!==0&&(Xe&261930)===0?(qt=!0,a.memoizedState=h):(a=Cx(),He.lanes|=a,Ts|=a,l)}function TE(a,l,h,f,b){var y=Q.p;Q.p=y!==0&&8>y?y:8;var k=M.T,D={};M.T=D,kg(a,!1,l,h);try{var K=b(),ie=M.S;if(ie!==null&&ie(D,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var ue=I5(K,f);Eu(a,l,ue,pr(a))}else Eu(a,l,f,pr(a))}catch(fe){Eu(a,l,{then:function(){},status:"rejected",reason:fe},pr())}finally{Q.p=y,k!==null&&D.types!==null&&(k.types=D.types),M.T=k}}function z5(){}function Cg(a,l,h,f){if(a.tag!==5)throw Error(r(476));var b=kE(a).queue;TE(a,b,l,W,h===null?z5:function(){return AE(a),h(f)})}function kE(a){var l=a.memoizedState;if(l!==null)return l;l={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:W},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:h},next:null},a.memoizedState=l,a=a.alternate,a!==null&&(a.memoizedState=l),l}function AE(a){var l=kE(a);l.next===null&&(l=a.alternate.memoizedState),Eu(a,l.next.queue,{},pr())}function Tg(){return xn(Fu)}function RE(){return Ft().memoizedState}function NE(){return Ft().memoizedState}function U5(a){for(var l=a.return;l!==null;){switch(l.tag){case 24:case 3:var h=pr();a=ys(h);var f=Ss(l,a,h);f!==null&&(er(f,l,h),_u(f,l,h)),l={cache:tg()},a.payload=l;return}l=l.return}}function $5(a,l,h){var f=pr();h={lane:f,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ad(a)?OE(l,h):(h=Vm(a,l,h,f),h!==null&&(er(h,a,f),DE(h,l,f)))}function LE(a,l,h){var f=pr();Eu(a,l,h,f)}function Eu(a,l,h,f){var b={lane:f,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ad(a))OE(l,b);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=l.lastRenderedReducer,y!==null))try{var k=l.lastRenderedState,D=y(k,h);if(b.hasEagerState=!0,b.eagerState=D,lr(D,k))return jh(a,l,b,0),gt===null&&Fh(),!1}catch{}if(h=Vm(a,l,b,f),h!==null)return er(h,a,f),DE(h,l,f),!0}return!1}function kg(a,l,h,f){if(f={lane:2,revertLane:s0(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},ad(a)){if(l)throw Error(r(479))}else l=Vm(a,h,f,2),l!==null&&er(l,a,2)}function ad(a){var l=a.alternate;return a===He||l!==null&&l===He}function OE(a,l){Po=Jh=!0;var h=a.pending;h===null?l.next=l:(l.next=h.next,h.next=l),a.pending=l}function DE(a,l,h){if((h&4194048)!==0){var f=l.lanes;f&=a.pendingLanes,h|=f,l.lanes=h,Hy(a,h)}}var xu={readContext:xn,use:nd,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};xu.useEffectEvent=Lt;var ME={readContext:xn,use:nd,useCallback:function(a,l){return Fn().memoizedState=[a,l===void 0?null:l],a},useContext:xn,useEffect:_E,useImperativeHandle:function(a,l,h){h=h!=null?h.concat([a]):null,id(4194308,4,SE.bind(null,l,a),h)},useLayoutEffect:function(a,l){return id(4194308,4,a,l)},useInsertionEffect:function(a,l){id(4,2,a,l)},useMemo:function(a,l){var h=Fn();l=l===void 0?null:l;var f=a();if(Ea){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[f,l],f},useReducer:function(a,l,h){var f=Fn();if(h!==void 0){var b=h(l);if(Ea){Gn(!0);try{h(l)}finally{Gn(!1)}}}else b=l;return f.memoizedState=f.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},f.queue=a,a=a.dispatch=$5.bind(null,He,a),[f.memoizedState,a]},useRef:function(a){var l=Fn();return a={current:a},l.memoizedState=a},useState:function(a){a=yg(a);var l=a.queue,h=LE.bind(null,He,l);return l.dispatch=h,[a.memoizedState,h]},useDebugValue:xg,useDeferredValue:function(a,l){var h=Fn();return wg(h,a,l)},useTransition:function(){var a=yg(!1);return a=TE.bind(null,He,a.queue,!0,!1),Fn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,l,h){var f=He,b=Fn();if(Je){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),gt===null)throw Error(r(349));(Xe&127)!==0||tE(f,l,h)}b.memoizedState=h;var y={value:h,getSnapshot:l};return b.queue=y,_E(rE.bind(null,f,y,a),[a]),f.flags|=2048,Ho(9,{destroy:void 0},nE.bind(null,f,y,h,l),null),h},useId:function(){var a=Fn(),l=gt.identifierPrefix;if(Je){var h=si,f=ii;h=(f&~(1<<32-mt(f)-1)).toString(32)+h,l="_"+l+"R_"+h,h=ed++,0<h&&(l+="H"+h.toString(32)),l+="_"}else h=P5++,l="_"+l+"r_"+h.toString(32)+"_";return a.memoizedState=l},useHostTransitionStatus:Tg,useFormState:dE,useActionState:dE,useOptimistic:function(a){var l=Fn();l.memoizedState=l.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=h,l=kg.bind(null,He,!0,h),h.dispatch=l,[a,l]},useMemoCache:_g,useCacheRefresh:function(){return Fn().memoizedState=U5.bind(null,He)},useEffectEvent:function(a){var l=Fn(),h={impl:a};return l.memoizedState=h,function(){if((at&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Ag={readContext:xn,use:nd,useCallback:xE,useContext:xn,useEffect:Eg,useImperativeHandle:EE,useInsertionEffect:vE,useLayoutEffect:yE,useMemo:wE,useReducer:rd,useRef:gE,useState:function(){return rd(Hi)},useDebugValue:xg,useDeferredValue:function(a,l){var h=Ft();return CE(h,ct.memoizedState,a,l)},useTransition:function(){var a=rd(Hi)[0],l=Ft().memoizedState;return[typeof a=="boolean"?a:Su(a),l]},useSyncExternalStore:eE,useId:RE,useHostTransitionStatus:Tg,useFormState:fE,useActionState:fE,useOptimistic:function(a,l){var h=Ft();return aE(h,ct,a,l)},useMemoCache:_g,useCacheRefresh:NE};Ag.useEffectEvent=bE;var IE={readContext:xn,use:nd,useCallback:xE,useContext:xn,useEffect:Eg,useImperativeHandle:EE,useInsertionEffect:vE,useLayoutEffect:yE,useMemo:wE,useReducer:vg,useRef:gE,useState:function(){return vg(Hi)},useDebugValue:xg,useDeferredValue:function(a,l){var h=Ft();return ct===null?wg(h,a,l):CE(h,ct.memoizedState,a,l)},useTransition:function(){var a=vg(Hi)[0],l=Ft().memoizedState;return[typeof a=="boolean"?a:Su(a),l]},useSyncExternalStore:eE,useId:RE,useHostTransitionStatus:Tg,useFormState:mE,useActionState:mE,useOptimistic:function(a,l){var h=Ft();return ct!==null?aE(h,ct,a,l):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:_g,useCacheRefresh:NE};IE.useEffectEvent=bE;function Rg(a,l,h,f){l=a.memoizedState,h=h(f,l),h=h==null?l:m({},l,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Ng={enqueueSetState:function(a,l,h){a=a._reactInternals;var f=pr(),b=ys(f);b.payload=l,h!=null&&(b.callback=h),l=Ss(a,b,f),l!==null&&(er(l,a,f),_u(l,a,f))},enqueueReplaceState:function(a,l,h){a=a._reactInternals;var f=pr(),b=ys(f);b.tag=1,b.payload=l,h!=null&&(b.callback=h),l=Ss(a,b,f),l!==null&&(er(l,a,f),_u(l,a,f))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var h=pr(),f=ys(h);f.tag=2,l!=null&&(f.callback=l),l=Ss(a,f,h),l!==null&&(er(l,a,h),_u(l,a,h))}};function PE(a,l,h,f,b,y,k){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(f,y,k):l.prototype&&l.prototype.isPureReactComponent?!uu(h,f)||!uu(b,y):!0}function BE(a,l,h,f){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,f),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,f),l.state!==a&&Ng.enqueueReplaceState(l,l.state,null)}function xa(a,l){var h=l;if("ref"in l){h={};for(var f in l)f!=="ref"&&(h[f]=l[f])}if(a=a.defaultProps){h===l&&(h=m({},h));for(var b in a)h[b]===void 0&&(h[b]=a[b])}return h}function HE(a){Hh(a)}function FE(a){console.error(a)}function jE(a){Hh(a)}function od(a,l){try{var h=a.onUncaughtError;h(l.value,{componentStack:l.stack})}catch(f){setTimeout(function(){throw f})}}function zE(a,l,h){try{var f=a.onCaughtError;f(h.value,{componentStack:h.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Lg(a,l,h){return h=ys(h),h.tag=3,h.payload={element:null},h.callback=function(){od(a,l)},h}function UE(a){return a=ys(a),a.tag=3,a}function $E(a,l,h,f){var b=h.type.getDerivedStateFromError;if(typeof b=="function"){var y=f.value;a.payload=function(){return b(y)},a.callback=function(){zE(l,h,f)}}var k=h.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(a.callback=function(){zE(l,h,f),typeof b!="function"&&(ks===null?ks=new Set([this]):ks.add(this));var D=f.stack;this.componentDidCatch(f.value,{componentStack:D!==null?D:""})})}function V5(a,l,h,f,b){if(h.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(l=h.alternate,l!==null&&No(l,h,b,!0),h=cr.current,h!==null){switch(h.tag){case 31:case 13:return Lr===null?vd():h.alternate===null&&Ot===0&&(Ot=3),h.flags&=-257,h.flags|=65536,h.lanes=b,f===Yh?h.flags|=16384:(l=h.updateQueue,l===null?h.updateQueue=new Set([f]):l.add(f),n0(a,f,b)),!1;case 22:return h.flags|=65536,f===Yh?h.flags|=16384:(l=h.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([f])},h.updateQueue=l):(h=l.retryQueue,h===null?l.retryQueue=new Set([f]):h.add(f)),n0(a,f,b)),!1}throw Error(r(435,h.tag))}return n0(a,f,b),vd(),!1}if(Je)return l=cr.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,f!==Qm&&(a=Error(r(422),{cause:f}),du(kr(a,h)))):(f!==Qm&&(l=Error(r(423),{cause:f}),du(kr(l,h))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,f=kr(f,h),b=Lg(a.stateNode,f,b),og(a,b),Ot!==4&&(Ot=2)),!1;var y=Error(r(520),{cause:f});if(y=kr(y,h),Lu===null?Lu=[y]:Lu.push(y),Ot!==4&&(Ot=2),l===null)return!0;f=kr(f,h),h=l;do{switch(h.tag){case 3:return h.flags|=65536,a=b&-b,h.lanes|=a,a=Lg(h.stateNode,f,a),og(h,a),!1;case 1:if(l=h.type,y=h.stateNode,(h.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ks===null||!ks.has(y))))return h.flags|=65536,b&=-b,h.lanes|=b,b=UE(b),$E(b,a,h,f),og(h,b),!1}h=h.return}while(h!==null);return!1}var Og=Error(r(461)),qt=!1;function wn(a,l,h,f){l.child=a===null?GS(l,null,h,f):Sa(l,a.child,h,f)}function VE(a,l,h,f,b){h=h.render;var y=l.ref;if("ref"in f){var k={};for(var D in f)D!=="ref"&&(k[D]=f[D])}else k=f;return _a(l),f=fg(a,l,h,k,y,b),D=pg(),a!==null&&!qt?(mg(a,l,b),Fi(a,l,b)):(Je&&D&&Ym(l),l.flags|=1,wn(a,l,f,b),l.child)}function qE(a,l,h,f,b){if(a===null){var y=h.type;return typeof y=="function"&&!qm(y)&&y.defaultProps===void 0&&h.compare===null?(l.tag=15,l.type=y,WE(a,l,y,f,b)):(a=Uh(h.type,null,f,l,l.mode,b),a.ref=l.ref,a.return=l,l.child=a)}if(y=a.child,!jg(a,b)){var k=y.memoizedProps;if(h=h.compare,h=h!==null?h:uu,h(k,f)&&a.ref===l.ref)return Fi(a,l,b)}return l.flags|=1,a=Di(y,f),a.ref=l.ref,a.return=l,l.child=a}function WE(a,l,h,f,b){if(a!==null){var y=a.memoizedProps;if(uu(y,f)&&a.ref===l.ref)if(qt=!1,l.pendingProps=f=y,jg(a,b))(a.flags&131072)!==0&&(qt=!0);else return l.lanes=a.lanes,Fi(a,l,b)}return Dg(a,l,h,f,b)}function GE(a,l,h,f){var b=f.children,y=a!==null?a.memoizedState:null;if(a===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((l.flags&128)!==0){if(y=y!==null?y.baseLanes|h:h,a!==null){for(f=l.child=a.child,b=0;f!==null;)b=b|f.lanes|f.childLanes,f=f.sibling;f=b&~y}else f=0,l.child=null;return YE(a,l,y,h,f)}if((h&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},a!==null&&Wh(l,y!==null?y.cachePool:null),y!==null?QS(l,y):ug(),XS(l);else return f=l.lanes=536870912,YE(a,l,y!==null?y.baseLanes|h:h,h,f)}else y!==null?(Wh(l,y.cachePool),QS(l,y),xs(),l.memoizedState=null):(a!==null&&Wh(l,null),ug(),xs());return wn(a,l,b,h),l.child}function wu(a,l){return a!==null&&a.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function YE(a,l,h,f,b){var y=rg();return y=y===null?null:{parent:$t._currentValue,pool:y},l.memoizedState={baseLanes:h,cachePool:y},a!==null&&Wh(l,null),ug(),XS(l),a!==null&&No(a,l,f,!0),l.childLanes=b,null}function ld(a,l){return l=cd({mode:l.mode,children:l.children},a.mode),l.ref=a.ref,a.child=l,l.return=a,l}function KE(a,l,h){return Sa(l,a.child,null,h),a=ld(l,l.pendingProps),a.flags|=2,hr(l),l.memoizedState=null,a}function q5(a,l,h){var f=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,a===null){if(Je){if(f.mode==="hidden")return a=ld(l,f),l.lanes=536870912,wu(null,a);if(hg(l),(a=yt)?(a=ow(a,Nr),a=a!==null&&a.data==="&"?a:null,a!==null&&(l.memoizedState={dehydrated:a,treeContext:ms!==null?{id:ii,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=OS(a),h.return=l,l.child=h,En=l,yt=null)):a=null,a===null)throw _s(l);return l.lanes=536870912,null}return ld(l,f)}var y=a.memoizedState;if(y!==null){var k=y.dehydrated;if(hg(l),b)if(l.flags&256)l.flags&=-257,l=KE(a,l,h);else if(l.memoizedState!==null)l.child=a.child,l.flags|=128,l=null;else throw Error(r(558));else if(qt||No(a,l,h,!1),b=(h&a.childLanes)!==0,qt||b){if(f=gt,f!==null&&(k=Fy(f,h),k!==0&&k!==y.retryLane))throw y.retryLane=k,fa(a,k),er(f,a,k),Og;vd(),l=KE(a,l,h)}else a=y.treeContext,yt=Or(k.nextSibling),En=l,Je=!0,gs=null,Nr=!1,a!==null&&IS(l,a),l=ld(l,f),l.flags|=4096;return l}return a=Di(a.child,{mode:f.mode,children:f.children}),a.ref=l.ref,l.child=a,a.return=l,a}function ud(a,l){var h=l.ref;if(h===null)a!==null&&a.ref!==null&&(l.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(a===null||a.ref!==h)&&(l.flags|=4194816)}}function Dg(a,l,h,f,b){return _a(l),h=fg(a,l,h,f,void 0,b),f=pg(),a!==null&&!qt?(mg(a,l,b),Fi(a,l,b)):(Je&&f&&Ym(l),l.flags|=1,wn(a,l,h,b),l.child)}function QE(a,l,h,f,b,y){return _a(l),l.updateQueue=null,h=JS(l,f,h,b),ZS(a),f=pg(),a!==null&&!qt?(mg(a,l,y),Fi(a,l,y)):(Je&&f&&Ym(l),l.flags|=1,wn(a,l,h,y),l.child)}function XE(a,l,h,f,b){if(_a(l),l.stateNode===null){var y=To,k=h.contextType;typeof k=="object"&&k!==null&&(y=xn(k)),y=new h(f,y),l.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Ng,l.stateNode=y,y._reactInternals=l,y=l.stateNode,y.props=f,y.state=l.memoizedState,y.refs={},sg(l),k=h.contextType,y.context=typeof k=="object"&&k!==null?xn(k):To,y.state=l.memoizedState,k=h.getDerivedStateFromProps,typeof k=="function"&&(Rg(l,h,k,f),y.state=l.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&Ng.enqueueReplaceState(y,y.state,null),vu(l,f,y,b),bu(),y.state=l.memoizedState),typeof y.componentDidMount=="function"&&(l.flags|=4194308),f=!0}else if(a===null){y=l.stateNode;var D=l.memoizedProps,K=xa(h,D);y.props=K;var ie=y.context,ue=h.contextType;k=To,typeof ue=="object"&&ue!==null&&(k=xn(ue));var fe=h.getDerivedStateFromProps;ue=typeof fe=="function"||typeof y.getSnapshotBeforeUpdate=="function",D=l.pendingProps!==D,ue||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(D||ie!==k)&&BE(l,y,f,k),vs=!1;var ae=l.memoizedState;y.state=ae,vu(l,f,y,b),bu(),ie=l.memoizedState,D||ae!==ie||vs?(typeof fe=="function"&&(Rg(l,h,fe,f),ie=l.memoizedState),(K=vs||PE(l,h,K,f,ae,ie,k))?(ue||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(l.flags|=4194308)):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=f,l.memoizedState=ie),y.props=f,y.state=ie,y.context=k,f=K):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),f=!1)}else{y=l.stateNode,ag(a,l),k=l.memoizedProps,ue=xa(h,k),y.props=ue,fe=l.pendingProps,ae=y.context,ie=h.contextType,K=To,typeof ie=="object"&&ie!==null&&(K=xn(ie)),D=h.getDerivedStateFromProps,(ie=typeof D=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==fe||ae!==K)&&BE(l,y,f,K),vs=!1,ae=l.memoizedState,y.state=ae,vu(l,f,y,b),bu();var oe=l.memoizedState;k!==fe||ae!==oe||vs||a!==null&&a.dependencies!==null&&Vh(a.dependencies)?(typeof D=="function"&&(Rg(l,h,D,f),oe=l.memoizedState),(ue=vs||PE(l,h,ue,f,ae,oe,K)||a!==null&&a.dependencies!==null&&Vh(a.dependencies))?(ie||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,oe,K),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,oe,K)),typeof y.componentDidUpdate=="function"&&(l.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===a.memoizedProps&&ae===a.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ae===a.memoizedState||(l.flags|=1024),l.memoizedProps=f,l.memoizedState=oe),y.props=f,y.state=oe,y.context=K,f=ue):(typeof y.componentDidUpdate!="function"||k===a.memoizedProps&&ae===a.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ae===a.memoizedState||(l.flags|=1024),f=!1)}return y=f,ud(a,l),f=(l.flags&128)!==0,y||f?(y=l.stateNode,h=f&&typeof h.getDerivedStateFromError!="function"?null:y.render(),l.flags|=1,a!==null&&f?(l.child=Sa(l,a.child,null,b),l.child=Sa(l,null,h,b)):wn(a,l,h,b),l.memoizedState=y.state,a=l.child):a=Fi(a,l,b),a}function ZE(a,l,h,f){return ma(),l.flags|=256,wn(a,l,h,f),l.child}var Mg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ig(a){return{baseLanes:a,cachePool:zS()}}function Pg(a,l,h){return a=a!==null?a.childLanes&~h:0,l&&(a|=fr),a}function JE(a,l,h){var f=l.pendingProps,b=!1,y=(l.flags&128)!==0,k;if((k=y)||(k=a!==null&&a.memoizedState===null?!1:(Ht.current&2)!==0),k&&(b=!0,l.flags&=-129),k=(l.flags&32)!==0,l.flags&=-33,a===null){if(Je){if(b?Es(l):xs(),(a=yt)?(a=ow(a,Nr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(l.memoizedState={dehydrated:a,treeContext:ms!==null?{id:ii,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=OS(a),h.return=l,l.child=h,En=l,yt=null)):a=null,a===null)throw _s(l);return b0(a)?l.lanes=32:l.lanes=536870912,null}var D=f.children;return f=f.fallback,b?(xs(),b=l.mode,D=cd({mode:"hidden",children:D},b),f=pa(f,b,h,null),D.return=l,f.return=l,D.sibling=f,l.child=D,f=l.child,f.memoizedState=Ig(h),f.childLanes=Pg(a,k,h),l.memoizedState=Mg,wu(null,f)):(Es(l),Bg(l,D))}var K=a.memoizedState;if(K!==null&&(D=K.dehydrated,D!==null)){if(y)l.flags&256?(Es(l),l.flags&=-257,l=Hg(a,l,h)):l.memoizedState!==null?(xs(),l.child=a.child,l.flags|=128,l=null):(xs(),D=f.fallback,b=l.mode,f=cd({mode:"visible",children:f.children},b),D=pa(D,b,h,null),D.flags|=2,f.return=l,D.return=l,f.sibling=D,l.child=f,Sa(l,a.child,null,h),f=l.child,f.memoizedState=Ig(h),f.childLanes=Pg(a,k,h),l.memoizedState=Mg,l=wu(null,f));else if(Es(l),b0(D)){if(k=D.nextSibling&&D.nextSibling.dataset,k)var ie=k.dgst;k=ie,f=Error(r(419)),f.stack="",f.digest=k,du({value:f,source:null,stack:null}),l=Hg(a,l,h)}else if(qt||No(a,l,h,!1),k=(h&a.childLanes)!==0,qt||k){if(k=gt,k!==null&&(f=Fy(k,h),f!==0&&f!==K.retryLane))throw K.retryLane=f,fa(a,f),er(k,a,f),Og;_0(D)||vd(),l=Hg(a,l,h)}else _0(D)?(l.flags|=192,l.child=a.child,l=null):(a=K.treeContext,yt=Or(D.nextSibling),En=l,Je=!0,gs=null,Nr=!1,a!==null&&IS(l,a),l=Bg(l,f.children),l.flags|=4096);return l}return b?(xs(),D=f.fallback,b=l.mode,K=a.child,ie=K.sibling,f=Di(K,{mode:"hidden",children:f.children}),f.subtreeFlags=K.subtreeFlags&65011712,ie!==null?D=Di(ie,D):(D=pa(D,b,h,null),D.flags|=2),D.return=l,f.return=l,f.sibling=D,l.child=f,wu(null,f),f=l.child,D=a.child.memoizedState,D===null?D=Ig(h):(b=D.cachePool,b!==null?(K=$t._currentValue,b=b.parent!==K?{parent:K,pool:K}:b):b=zS(),D={baseLanes:D.baseLanes|h,cachePool:b}),f.memoizedState=D,f.childLanes=Pg(a,k,h),l.memoizedState=Mg,wu(a.child,f)):(Es(l),h=a.child,a=h.sibling,h=Di(h,{mode:"visible",children:f.children}),h.return=l,h.sibling=null,a!==null&&(k=l.deletions,k===null?(l.deletions=[a],l.flags|=16):k.push(a)),l.child=h,l.memoizedState=null,h)}function Bg(a,l){return l=cd({mode:"visible",children:l},a.mode),l.return=a,a.child=l}function cd(a,l){return a=ur(22,a,null,l),a.lanes=0,a}function Hg(a,l,h){return Sa(l,a.child,null,h),a=Bg(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function ex(a,l,h){a.lanes|=l;var f=a.alternate;f!==null&&(f.lanes|=l),Jm(a.return,l,h)}function Fg(a,l,h,f,b,y){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:f,tail:h,tailMode:b,treeForkCount:y}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=f,k.tail=h,k.tailMode=b,k.treeForkCount=y)}function tx(a,l,h){var f=l.pendingProps,b=f.revealOrder,y=f.tail;f=f.children;var k=Ht.current,D=(k&2)!==0;if(D?(k=k&1|2,l.flags|=128):k&=1,O(Ht,k),wn(a,l,f,h),f=Je?hu:0,!D&&a!==null&&(a.flags&128)!==0)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&ex(a,h,l);else if(a.tag===19)ex(a,h,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(h=l.child,b=null;h!==null;)a=h.alternate,a!==null&&Zh(a)===null&&(b=h),h=h.sibling;h=b,h===null?(b=l.child,l.child=null):(b=h.sibling,h.sibling=null),Fg(l,!1,b,h,y,f);break;case"backwards":case"unstable_legacy-backwards":for(h=null,b=l.child,l.child=null;b!==null;){if(a=b.alternate,a!==null&&Zh(a)===null){l.child=b;break}a=b.sibling,b.sibling=h,h=b,b=a}Fg(l,!0,h,null,y,f);break;case"together":Fg(l,!1,null,null,void 0,f);break;default:l.memoizedState=null}return l.child}function Fi(a,l,h){if(a!==null&&(l.dependencies=a.dependencies),Ts|=l.lanes,(h&l.childLanes)===0)if(a!==null){if(No(a,l,h,!1),(h&l.childLanes)===0)return null}else return null;if(a!==null&&l.child!==a.child)throw Error(r(153));if(l.child!==null){for(a=l.child,h=Di(a,a.pendingProps),l.child=h,h.return=l;a.sibling!==null;)a=a.sibling,h=h.sibling=Di(a,a.pendingProps),h.return=l;h.sibling=null}return l.child}function jg(a,l){return(a.lanes&l)!==0?!0:(a=a.dependencies,!!(a!==null&&Vh(a)))}function W5(a,l,h){switch(l.tag){case 3:Qe(l,l.stateNode.containerInfo),bs(l,$t,a.memoizedState.cache),ma();break;case 27:case 5:xt(l);break;case 4:Qe(l,l.stateNode.containerInfo);break;case 10:bs(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,hg(l),null;break;case 13:var f=l.memoizedState;if(f!==null)return f.dehydrated!==null?(Es(l),l.flags|=128,null):(h&l.child.childLanes)!==0?JE(a,l,h):(Es(l),a=Fi(a,l,h),a!==null?a.sibling:null);Es(l);break;case 19:var b=(a.flags&128)!==0;if(f=(h&l.childLanes)!==0,f||(No(a,l,h,!1),f=(h&l.childLanes)!==0),b){if(f)return tx(a,l,h);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),O(Ht,Ht.current),f)break;return null;case 22:return l.lanes=0,GE(a,l,h,l.pendingProps);case 24:bs(l,$t,a.memoizedState.cache)}return Fi(a,l,h)}function nx(a,l,h){if(a!==null)if(a.memoizedProps!==l.pendingProps)qt=!0;else{if(!jg(a,h)&&(l.flags&128)===0)return qt=!1,W5(a,l,h);qt=(a.flags&131072)!==0}else qt=!1,Je&&(l.flags&1048576)!==0&&MS(l,hu,l.index);switch(l.lanes=0,l.tag){case 16:e:{var f=l.pendingProps;if(a=va(l.elementType),l.type=a,typeof a=="function")qm(a)?(f=xa(a,f),l.tag=1,l=XE(null,l,a,f,h)):(l.tag=0,l=Dg(null,l,a,f,h));else{if(a!=null){var b=a.$$typeof;if(b===N){l.tag=11,l=VE(null,l,a,f,h);break e}else if(b===P){l.tag=14,l=qE(null,l,a,f,h);break e}}throw l=Y(a)||a,Error(r(306,l,""))}}return l;case 0:return Dg(a,l,l.type,l.pendingProps,h);case 1:return f=l.type,b=xa(f,l.pendingProps),XE(a,l,f,b,h);case 3:e:{if(Qe(l,l.stateNode.containerInfo),a===null)throw Error(r(387));f=l.pendingProps;var y=l.memoizedState;b=y.element,ag(a,l),vu(l,f,null,h);var k=l.memoizedState;if(f=k.cache,bs(l,$t,f),f!==y.cache&&eg(l,[$t],h,!0),bu(),f=k.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:k.cache},l.updateQueue.baseState=y,l.memoizedState=y,l.flags&256){l=ZE(a,l,f,h);break e}else if(f!==b){b=kr(Error(r(424)),l),du(b),l=ZE(a,l,f,h);break e}else for(a=l.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,yt=Or(a.firstChild),En=l,Je=!0,gs=null,Nr=!0,h=GS(l,null,f,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(ma(),f===b){l=Fi(a,l,h);break e}wn(a,l,f,h)}l=l.child}return l;case 26:return ud(a,l),a===null?(h=fw(l.type,null,l.pendingProps,null))?l.memoizedState=h:Je||(h=l.type,a=l.pendingProps,f=Td(ve.current).createElement(h),f[Sn]=l,f[Yn]=a,Cn(f,h,a),un(f),l.stateNode=f):l.memoizedState=fw(l.type,a.memoizedProps,l.pendingProps,a.memoizedState),null;case 27:return xt(l),a===null&&Je&&(f=l.stateNode=cw(l.type,l.pendingProps,ve.current),En=l,Nr=!0,b=yt,Ls(l.type)?(v0=b,yt=Or(f.firstChild)):yt=b),wn(a,l,l.pendingProps.children,h),ud(a,l),a===null&&(l.flags|=4194304),l.child;case 5:return a===null&&Je&&((b=f=yt)&&(f=EM(f,l.type,l.pendingProps,Nr),f!==null?(l.stateNode=f,En=l,yt=Or(f.firstChild),Nr=!1,b=!0):b=!1),b||_s(l)),xt(l),b=l.type,y=l.pendingProps,k=a!==null?a.memoizedProps:null,f=y.children,p0(b,y)?f=null:k!==null&&p0(b,k)&&(l.flags|=32),l.memoizedState!==null&&(b=fg(a,l,B5,null,null,h),Fu._currentValue=b),ud(a,l),wn(a,l,f,h),l.child;case 6:return a===null&&Je&&((a=h=yt)&&(h=xM(h,l.pendingProps,Nr),h!==null?(l.stateNode=h,En=l,yt=null,a=!0):a=!1),a||_s(l)),null;case 13:return JE(a,l,h);case 4:return Qe(l,l.stateNode.containerInfo),f=l.pendingProps,a===null?l.child=Sa(l,null,f,h):wn(a,l,f,h),l.child;case 11:return VE(a,l,l.type,l.pendingProps,h);case 7:return wn(a,l,l.pendingProps,h),l.child;case 8:return wn(a,l,l.pendingProps.children,h),l.child;case 12:return wn(a,l,l.pendingProps.children,h),l.child;case 10:return f=l.pendingProps,bs(l,l.type,f.value),wn(a,l,f.children,h),l.child;case 9:return b=l.type._context,f=l.pendingProps.children,_a(l),b=xn(b),f=f(b),l.flags|=1,wn(a,l,f,h),l.child;case 14:return qE(a,l,l.type,l.pendingProps,h);case 15:return WE(a,l,l.type,l.pendingProps,h);case 19:return tx(a,l,h);case 31:return q5(a,l,h);case 22:return GE(a,l,h,l.pendingProps);case 24:return _a(l),f=xn($t),a===null?(b=rg(),b===null&&(b=gt,y=tg(),b.pooledCache=y,y.refCount++,y!==null&&(b.pooledCacheLanes|=h),b=y),l.memoizedState={parent:f,cache:b},sg(l),bs(l,$t,b)):((a.lanes&h)!==0&&(ag(a,l),vu(l,null,null,h),bu()),b=a.memoizedState,y=l.memoizedState,b.parent!==f?(b={parent:f,cache:f},l.memoizedState=b,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=b),bs(l,$t,f)):(f=y.cache,bs(l,$t,f),f!==b.cache&&eg(l,[$t],h,!0))),wn(a,l,l.pendingProps.children,h),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function ji(a){a.flags|=4}function zg(a,l,h,f,b){if((l=(a.mode&32)!==0)&&(l=!1),l){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(Rx())a.flags|=8192;else throw ya=Yh,ig}else a.flags&=-16777217}function rx(a,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!bw(l))if(Rx())a.flags|=8192;else throw ya=Yh,ig}function hd(a,l){l!==null&&(a.flags|=4),a.flags&16384&&(l=a.tag!==22?Py():536870912,a.lanes|=l,Uo|=l)}function Cu(a,l){if(!Je)switch(a.tailMode){case"hidden":l=a.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var f=null;h!==null;)h.alternate!==null&&(f=h),h=h.sibling;f===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:f.sibling=null}}function St(a){var l=a.alternate!==null&&a.alternate.child===a.child,h=0,f=0;if(l)for(var b=a.child;b!==null;)h|=b.lanes|b.childLanes,f|=b.subtreeFlags&65011712,f|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)h|=b.lanes|b.childLanes,f|=b.subtreeFlags,f|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=f,a.childLanes=h,l}function G5(a,l,h){var f=l.pendingProps;switch(Km(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(l),null;case 1:return St(l),null;case 3:return h=l.stateNode,f=null,a!==null&&(f=a.memoizedState.cache),l.memoizedState.cache!==f&&(l.flags|=2048),Pi($t),Ae(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(Ro(l)?ji(l):a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Xm())),St(l),null;case 26:var b=l.type,y=l.memoizedState;return a===null?(ji(l),y!==null?(St(l),rx(l,y)):(St(l),zg(l,b,null,f,h))):y?y!==a.memoizedState?(ji(l),St(l),rx(l,y)):(St(l),l.flags&=-16777217):(a=a.memoizedProps,a!==f&&ji(l),St(l),zg(l,b,a,f,h)),null;case 27:if(Pt(l),h=ve.current,b=l.type,a!==null&&l.stateNode!=null)a.memoizedProps!==f&&ji(l);else{if(!f){if(l.stateNode===null)throw Error(r(166));return St(l),null}a=ce.current,Ro(l)?PS(l):(a=cw(b,f,h),l.stateNode=a,ji(l))}return St(l),null;case 5:if(Pt(l),b=l.type,a!==null&&l.stateNode!=null)a.memoizedProps!==f&&ji(l);else{if(!f){if(l.stateNode===null)throw Error(r(166));return St(l),null}if(y=ce.current,Ro(l))PS(l);else{var k=Td(ve.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?k.createElement("select",{is:f.is}):k.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?k.createElement(b,{is:f.is}):k.createElement(b)}}y[Sn]=l,y[Yn]=f;e:for(k=l.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===l)break e;for(;k.sibling===null;){if(k.return===null||k.return===l)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}l.stateNode=y;e:switch(Cn(y,b,f),b){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ji(l)}}return St(l),zg(l,l.type,a===null?null:a.memoizedProps,l.pendingProps,h),null;case 6:if(a&&l.stateNode!=null)a.memoizedProps!==f&&ji(l);else{if(typeof f!="string"&&l.stateNode===null)throw Error(r(166));if(a=ve.current,Ro(l)){if(a=l.stateNode,h=l.memoizedProps,f=null,b=En,b!==null)switch(b.tag){case 27:case 5:f=b.memoizedProps}a[Sn]=l,a=!!(a.nodeValue===h||f!==null&&f.suppressHydrationWarning===!0||Jx(a.nodeValue,h)),a||_s(l,!0)}else a=Td(a).createTextNode(f),a[Sn]=l,l.stateNode=a}return St(l),null;case 31:if(h=l.memoizedState,a===null||a.memoizedState!==null){if(f=Ro(l),h!==null){if(a===null){if(!f)throw Error(r(318));if(a=l.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Sn]=l}else ma(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;St(l),a=!1}else h=Xm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return l.flags&256?(hr(l),l):(hr(l),null);if((l.flags&128)!==0)throw Error(r(558))}return St(l),null;case 13:if(f=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Ro(l),f!==null&&f.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Sn]=l}else ma(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;St(l),b=!1}else b=Xm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(hr(l),l):(hr(l),null)}return hr(l),(l.flags&128)!==0?(l.lanes=h,l):(h=f!==null,a=a!==null&&a.memoizedState!==null,h&&(f=l.child,b=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(b=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==b&&(f.flags|=2048)),h!==a&&h&&(l.child.flags|=8192),hd(l,l.updateQueue),St(l),null);case 4:return Ae(),a===null&&u0(l.stateNode.containerInfo),St(l),null;case 10:return Pi(l.type),St(l),null;case 19:if(se(Ht),f=l.memoizedState,f===null)return St(l),null;if(b=(l.flags&128)!==0,y=f.rendering,y===null)if(b)Cu(f,!1);else{if(Ot!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(y=Zh(a),y!==null){for(l.flags|=128,Cu(f,!1),a=y.updateQueue,l.updateQueue=a,hd(l,a),l.subtreeFlags=0,a=h,h=l.child;h!==null;)LS(h,a),h=h.sibling;return O(Ht,Ht.current&1|2),Je&&Mi(l,f.treeForkCount),l.child}a=a.sibling}f.tail!==null&&Bn()>gd&&(l.flags|=128,b=!0,Cu(f,!1),l.lanes=4194304)}else{if(!b)if(a=Zh(y),a!==null){if(l.flags|=128,b=!0,a=a.updateQueue,l.updateQueue=a,hd(l,a),Cu(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Je)return St(l),null}else 2*Bn()-f.renderingStartTime>gd&&h!==536870912&&(l.flags|=128,b=!0,Cu(f,!1),l.lanes=4194304);f.isBackwards?(y.sibling=l.child,l.child=y):(a=f.last,a!==null?a.sibling=y:l.child=y,f.last=y)}return f.tail!==null?(a=f.tail,f.rendering=a,f.tail=a.sibling,f.renderingStartTime=Bn(),a.sibling=null,h=Ht.current,O(Ht,b?h&1|2:h&1),Je&&Mi(l,f.treeForkCount),a):(St(l),null);case 22:case 23:return hr(l),cg(),f=l.memoizedState!==null,a!==null?a.memoizedState!==null!==f&&(l.flags|=8192):f&&(l.flags|=8192),f?(h&536870912)!==0&&(l.flags&128)===0&&(St(l),l.subtreeFlags&6&&(l.flags|=8192)):St(l),h=l.updateQueue,h!==null&&hd(l,h.retryQueue),h=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==h&&(l.flags|=2048),a!==null&&se(ba),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Pi($t),St(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function Y5(a,l){switch(Km(l),l.tag){case 1:return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return Pi($t),Ae(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 26:case 27:case 5:return Pt(l),null;case 31:if(l.memoizedState!==null){if(hr(l),l.alternate===null)throw Error(r(340));ma()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 13:if(hr(l),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(r(340));ma()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return se(Ht),null;case 4:return Ae(),null;case 10:return Pi(l.type),null;case 22:case 23:return hr(l),cg(),a!==null&&se(ba),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 24:return Pi($t),null;case 25:return null;default:return null}}function ix(a,l){switch(Km(l),l.tag){case 3:Pi($t),Ae();break;case 26:case 27:case 5:Pt(l);break;case 4:Ae();break;case 31:l.memoizedState!==null&&hr(l);break;case 13:hr(l);break;case 19:se(Ht);break;case 10:Pi(l.type);break;case 22:case 23:hr(l),cg(),a!==null&&se(ba);break;case 24:Pi($t)}}function Tu(a,l){try{var h=l.updateQueue,f=h!==null?h.lastEffect:null;if(f!==null){var b=f.next;h=b;do{if((h.tag&a)===a){f=void 0;var y=h.create,k=h.inst;f=y(),k.destroy=f}h=h.next}while(h!==b)}}catch(D){ut(l,l.return,D)}}function ws(a,l,h){try{var f=l.updateQueue,b=f!==null?f.lastEffect:null;if(b!==null){var y=b.next;f=y;do{if((f.tag&a)===a){var k=f.inst,D=k.destroy;if(D!==void 0){k.destroy=void 0,b=l;var K=h,ie=D;try{ie()}catch(ue){ut(b,K,ue)}}}f=f.next}while(f!==y)}}catch(ue){ut(l,l.return,ue)}}function sx(a){var l=a.updateQueue;if(l!==null){var h=a.stateNode;try{KS(l,h)}catch(f){ut(a,a.return,f)}}}function ax(a,l,h){h.props=xa(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(f){ut(a,l,f)}}function ku(a,l){try{var h=a.ref;if(h!==null){switch(a.tag){case 26:case 27:case 5:var f=a.stateNode;break;case 30:f=a.stateNode;break;default:f=a.stateNode}typeof h=="function"?a.refCleanup=h(f):h.current=f}}catch(b){ut(a,l,b)}}function ai(a,l){var h=a.ref,f=a.refCleanup;if(h!==null)if(typeof f=="function")try{f()}catch(b){ut(a,l,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(b){ut(a,l,b)}else h.current=null}function ox(a){var l=a.type,h=a.memoizedProps,f=a.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":h.autoFocus&&f.focus();break e;case"img":h.src?f.src=h.src:h.srcSet&&(f.srcset=h.srcSet)}}catch(b){ut(a,a.return,b)}}function Ug(a,l,h){try{var f=a.stateNode;gM(f,a.type,h,l),f[Yn]=l}catch(b){ut(a,a.return,b)}}function lx(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ls(a.type)||a.tag===4}function $g(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||lx(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ls(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Vg(a,l,h){var f=a.tag;if(f===5||f===6)a=a.stateNode,l?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(a,l):(l=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,l.appendChild(a),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=Li));else if(f!==4&&(f===27&&Ls(a.type)&&(h=a.stateNode,l=null),a=a.child,a!==null))for(Vg(a,l,h),a=a.sibling;a!==null;)Vg(a,l,h),a=a.sibling}function dd(a,l,h){var f=a.tag;if(f===5||f===6)a=a.stateNode,l?h.insertBefore(a,l):h.appendChild(a);else if(f!==4&&(f===27&&Ls(a.type)&&(h=a.stateNode),a=a.child,a!==null))for(dd(a,l,h),a=a.sibling;a!==null;)dd(a,l,h),a=a.sibling}function ux(a){var l=a.stateNode,h=a.memoizedProps;try{for(var f=a.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);Cn(l,f,h),l[Sn]=a,l[Yn]=h}catch(y){ut(a,a.return,y)}}var zi=!1,Wt=!1,qg=!1,cx=typeof WeakSet=="function"?WeakSet:Set,cn=null;function K5(a,l){if(a=a.containerInfo,d0=Dd,a=ES(a),Hm(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var f=h.getSelection&&h.getSelection();if(f&&f.rangeCount!==0){h=f.anchorNode;var b=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{h.nodeType,y.nodeType}catch{h=null;break e}var k=0,D=-1,K=-1,ie=0,ue=0,fe=a,ae=null;t:for(;;){for(var oe;fe!==h||b!==0&&fe.nodeType!==3||(D=k+b),fe!==y||f!==0&&fe.nodeType!==3||(K=k+f),fe.nodeType===3&&(k+=fe.nodeValue.length),(oe=fe.firstChild)!==null;)ae=fe,fe=oe;for(;;){if(fe===a)break t;if(ae===h&&++ie===b&&(D=k),ae===y&&++ue===f&&(K=k),(oe=fe.nextSibling)!==null)break;fe=ae,ae=fe.parentNode}fe=oe}h=D===-1||K===-1?null:{start:D,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(f0={focusedElem:a,selectionRange:h},Dd=!1,cn=l;cn!==null;)if(l=cn,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,cn=a;else for(;cn!==null;){switch(l=cn,y=l.alternate,a=l.flags,l.tag){case 0:if((a&4)!==0&&(a=l.updateQueue,a=a!==null?a.events:null,a!==null))for(h=0;h<a.length;h++)b=a[h],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&y!==null){a=void 0,h=l,b=y.memoizedProps,y=y.memoizedState,f=h.stateNode;try{var Ce=xa(h.type,b);a=f.getSnapshotBeforeUpdate(Ce,y),f.__reactInternalSnapshotBeforeUpdate=a}catch(Oe){ut(h,h.return,Oe)}}break;case 3:if((a&1024)!==0){if(a=l.stateNode.containerInfo,h=a.nodeType,h===9)g0(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":g0(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=l.sibling,a!==null){a.return=l.return,cn=a;break}cn=l.return}}function hx(a,l,h){var f=h.flags;switch(h.tag){case 0:case 11:case 15:$i(a,h),f&4&&Tu(5,h);break;case 1:if($i(a,h),f&4)if(a=h.stateNode,l===null)try{a.componentDidMount()}catch(k){ut(h,h.return,k)}else{var b=xa(h.type,l.memoizedProps);l=l.memoizedState;try{a.componentDidUpdate(b,l,a.__reactInternalSnapshotBeforeUpdate)}catch(k){ut(h,h.return,k)}}f&64&&sx(h),f&512&&ku(h,h.return);break;case 3:if($i(a,h),f&64&&(a=h.updateQueue,a!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=h.child.stateNode;break;case 1:l=h.child.stateNode}try{KS(a,l)}catch(k){ut(h,h.return,k)}}break;case 27:l===null&&f&4&&ux(h);case 26:case 5:$i(a,h),l===null&&f&4&&ox(h),f&512&&ku(h,h.return);break;case 12:$i(a,h);break;case 31:$i(a,h),f&4&&px(a,h);break;case 13:$i(a,h),f&4&&mx(a,h),f&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=iM.bind(null,h),wM(a,h))));break;case 22:if(f=h.memoizedState!==null||zi,!f){l=l!==null&&l.memoizedState!==null||Wt,b=zi;var y=Wt;zi=f,(Wt=l)&&!y?Vi(a,h,(h.subtreeFlags&8772)!==0):$i(a,h),zi=b,Wt=y}break;case 30:break;default:$i(a,h)}}function dx(a){var l=a.alternate;l!==null&&(a.alternate=null,dx(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&Sm(l)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var wt=null,Qn=!1;function Ui(a,l,h){for(h=h.child;h!==null;)fx(a,l,h),h=h.sibling}function fx(a,l,h){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(Hn,h)}catch{}switch(h.tag){case 26:Wt||ai(h,l),Ui(a,l,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Wt||ai(h,l);var f=wt,b=Qn;Ls(h.type)&&(wt=h.stateNode,Qn=!1),Ui(a,l,h),Pu(h.stateNode),wt=f,Qn=b;break;case 5:Wt||ai(h,l);case 6:if(f=wt,b=Qn,wt=null,Ui(a,l,h),wt=f,Qn=b,wt!==null)if(Qn)try{(wt.nodeType===9?wt.body:wt.nodeName==="HTML"?wt.ownerDocument.body:wt).removeChild(h.stateNode)}catch(y){ut(h,l,y)}else try{wt.removeChild(h.stateNode)}catch(y){ut(h,l,y)}break;case 18:wt!==null&&(Qn?(a=wt,sw(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),Qo(a)):sw(wt,h.stateNode));break;case 4:f=wt,b=Qn,wt=h.stateNode.containerInfo,Qn=!0,Ui(a,l,h),wt=f,Qn=b;break;case 0:case 11:case 14:case 15:ws(2,h,l),Wt||ws(4,h,l),Ui(a,l,h);break;case 1:Wt||(ai(h,l),f=h.stateNode,typeof f.componentWillUnmount=="function"&&ax(h,l,f)),Ui(a,l,h);break;case 21:Ui(a,l,h);break;case 22:Wt=(f=Wt)||h.memoizedState!==null,Ui(a,l,h),Wt=f;break;default:Ui(a,l,h)}}function px(a,l){if(l.memoizedState===null&&(a=l.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Qo(a)}catch(h){ut(l,l.return,h)}}}function mx(a,l){if(l.memoizedState===null&&(a=l.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Qo(a)}catch(h){ut(l,l.return,h)}}function Q5(a){switch(a.tag){case 31:case 13:case 19:var l=a.stateNode;return l===null&&(l=a.stateNode=new cx),l;case 22:return a=a.stateNode,l=a._retryCache,l===null&&(l=a._retryCache=new cx),l;default:throw Error(r(435,a.tag))}}function fd(a,l){var h=Q5(a);l.forEach(function(f){if(!h.has(f)){h.add(f);var b=sM.bind(null,a,f);f.then(b,b)}})}function Xn(a,l){var h=l.deletions;if(h!==null)for(var f=0;f<h.length;f++){var b=h[f],y=a,k=l,D=k;e:for(;D!==null;){switch(D.tag){case 27:if(Ls(D.type)){wt=D.stateNode,Qn=!1;break e}break;case 5:wt=D.stateNode,Qn=!1;break e;case 3:case 4:wt=D.stateNode.containerInfo,Qn=!0;break e}D=D.return}if(wt===null)throw Error(r(160));fx(y,k,b),wt=null,Qn=!1,y=b.alternate,y!==null&&(y.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)gx(l,a),l=l.sibling}var Kr=null;function gx(a,l){var h=a.alternate,f=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Xn(l,a),Zn(a),f&4&&(ws(3,a,a.return),Tu(3,a),ws(5,a,a.return));break;case 1:Xn(l,a),Zn(a),f&512&&(Wt||h===null||ai(h,h.return)),f&64&&zi&&(a=a.updateQueue,a!==null&&(f=a.callbacks,f!==null&&(h=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=h===null?f:h.concat(f))));break;case 26:var b=Kr;if(Xn(l,a),Zn(a),f&512&&(Wt||h===null||ai(h,h.return)),f&4){var y=h!==null?h.memoizedState:null;if(f=a.memoizedState,h===null)if(f===null)if(a.stateNode===null){e:{f=a.type,h=a.memoizedProps,b=b.ownerDocument||b;t:switch(f){case"title":y=b.getElementsByTagName("title")[0],(!y||y[eu]||y[Sn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=b.createElement(f),b.head.insertBefore(y,b.querySelector("head > title"))),Cn(y,f,h),y[Sn]=a,un(y),f=y;break e;case"link":var k=gw("link","href",b).get(f+(h.href||""));if(k){for(var D=0;D<k.length;D++)if(y=k[D],y.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&y.getAttribute("rel")===(h.rel==null?null:h.rel)&&y.getAttribute("title")===(h.title==null?null:h.title)&&y.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){k.splice(D,1);break t}}y=b.createElement(f),Cn(y,f,h),b.head.appendChild(y);break;case"meta":if(k=gw("meta","content",b).get(f+(h.content||""))){for(D=0;D<k.length;D++)if(y=k[D],y.getAttribute("content")===(h.content==null?null:""+h.content)&&y.getAttribute("name")===(h.name==null?null:h.name)&&y.getAttribute("property")===(h.property==null?null:h.property)&&y.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&y.getAttribute("charset")===(h.charSet==null?null:h.charSet)){k.splice(D,1);break t}}y=b.createElement(f),Cn(y,f,h),b.head.appendChild(y);break;default:throw Error(r(468,f))}y[Sn]=a,un(y),f=y}a.stateNode=f}else _w(b,a.type,a.stateNode);else a.stateNode=mw(b,f,a.memoizedProps);else y!==f?(y===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):y.count--,f===null?_w(b,a.type,a.stateNode):mw(b,f,a.memoizedProps)):f===null&&a.stateNode!==null&&Ug(a,a.memoizedProps,h.memoizedProps)}break;case 27:Xn(l,a),Zn(a),f&512&&(Wt||h===null||ai(h,h.return)),h!==null&&f&4&&Ug(a,a.memoizedProps,h.memoizedProps);break;case 5:if(Xn(l,a),Zn(a),f&512&&(Wt||h===null||ai(h,h.return)),a.flags&32){b=a.stateNode;try{vo(b,"")}catch(Ce){ut(a,a.return,Ce)}}f&4&&a.stateNode!=null&&(b=a.memoizedProps,Ug(a,b,h!==null?h.memoizedProps:b)),f&1024&&(qg=!0);break;case 6:if(Xn(l,a),Zn(a),f&4){if(a.stateNode===null)throw Error(r(162));f=a.memoizedProps,h=a.stateNode;try{h.nodeValue=f}catch(Ce){ut(a,a.return,Ce)}}break;case 3:if(Rd=null,b=Kr,Kr=kd(l.containerInfo),Xn(l,a),Kr=b,Zn(a),f&4&&h!==null&&h.memoizedState.isDehydrated)try{Qo(l.containerInfo)}catch(Ce){ut(a,a.return,Ce)}qg&&(qg=!1,_x(a));break;case 4:f=Kr,Kr=kd(a.stateNode.containerInfo),Xn(l,a),Zn(a),Kr=f;break;case 12:Xn(l,a),Zn(a);break;case 31:Xn(l,a),Zn(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,fd(a,f)));break;case 13:Xn(l,a),Zn(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(md=Bn()),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,fd(a,f)));break;case 22:b=a.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,ie=zi,ue=Wt;if(zi=ie||b,Wt=ue||K,Xn(l,a),Wt=ue,zi=ie,Zn(a),f&8192)e:for(l=a.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(h===null||K||zi||Wt||wa(a)),h=null,l=a;;){if(l.tag===5||l.tag===26){if(h===null){K=h=l;try{if(y=K.stateNode,b)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{D=K.stateNode;var fe=K.memoizedProps.style,ae=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ce){ut(K,K.return,Ce)}}}else if(l.tag===6){if(h===null){K=l;try{K.stateNode.nodeValue=b?"":K.memoizedProps}catch(Ce){ut(K,K.return,Ce)}}}else if(l.tag===18){if(h===null){K=l;try{var oe=K.stateNode;b?aw(oe,!0):aw(K.stateNode,!1)}catch(Ce){ut(K,K.return,Ce)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===a)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;h===l&&(h=null),l=l.return}h===l&&(h=null),l.sibling.return=l.return,l=l.sibling}f&4&&(f=a.updateQueue,f!==null&&(h=f.retryQueue,h!==null&&(f.retryQueue=null,fd(a,h))));break;case 19:Xn(l,a),Zn(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,fd(a,f)));break;case 30:break;case 21:break;default:Xn(l,a),Zn(a)}}function Zn(a){var l=a.flags;if(l&2){try{for(var h,f=a.return;f!==null;){if(lx(f)){h=f;break}f=f.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,y=$g(a);dd(a,y,b);break;case 5:var k=h.stateNode;h.flags&32&&(vo(k,""),h.flags&=-33);var D=$g(a);dd(a,D,k);break;case 3:case 4:var K=h.stateNode.containerInfo,ie=$g(a);Vg(a,ie,K);break;default:throw Error(r(161))}}catch(ue){ut(a,a.return,ue)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function _x(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var l=a;_x(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),a=a.sibling}}function $i(a,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)hx(a,l.alternate,l),l=l.sibling}function wa(a){for(a=a.child;a!==null;){var l=a;switch(l.tag){case 0:case 11:case 14:case 15:ws(4,l,l.return),wa(l);break;case 1:ai(l,l.return);var h=l.stateNode;typeof h.componentWillUnmount=="function"&&ax(l,l.return,h),wa(l);break;case 27:Pu(l.stateNode);case 26:case 5:ai(l,l.return),wa(l);break;case 22:l.memoizedState===null&&wa(l);break;case 30:wa(l);break;default:wa(l)}a=a.sibling}}function Vi(a,l,h){for(h=h&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var f=l.alternate,b=a,y=l,k=y.flags;switch(y.tag){case 0:case 11:case 15:Vi(b,y,h),Tu(4,y);break;case 1:if(Vi(b,y,h),f=y,b=f.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ie){ut(f,f.return,ie)}if(f=y,b=f.updateQueue,b!==null){var D=f.stateNode;try{var K=b.shared.hiddenCallbacks;if(K!==null)for(b.shared.hiddenCallbacks=null,b=0;b<K.length;b++)YS(K[b],D)}catch(ie){ut(f,f.return,ie)}}h&&k&64&&sx(y),ku(y,y.return);break;case 27:ux(y);case 26:case 5:Vi(b,y,h),h&&f===null&&k&4&&ox(y),ku(y,y.return);break;case 12:Vi(b,y,h);break;case 31:Vi(b,y,h),h&&k&4&&px(b,y);break;case 13:Vi(b,y,h),h&&k&4&&mx(b,y);break;case 22:y.memoizedState===null&&Vi(b,y,h),ku(y,y.return);break;case 30:break;default:Vi(b,y,h)}l=l.sibling}}function Wg(a,l){var h=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==h&&(a!=null&&a.refCount++,h!=null&&fu(h))}function Gg(a,l){a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&fu(a))}function Qr(a,l,h,f){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)bx(a,l,h,f),l=l.sibling}function bx(a,l,h,f){var b=l.flags;switch(l.tag){case 0:case 11:case 15:Qr(a,l,h,f),b&2048&&Tu(9,l);break;case 1:Qr(a,l,h,f);break;case 3:Qr(a,l,h,f),b&2048&&(a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&fu(a)));break;case 12:if(b&2048){Qr(a,l,h,f),a=l.stateNode;try{var y=l.memoizedProps,k=y.id,D=y.onPostCommit;typeof D=="function"&&D(k,l.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(K){ut(l,l.return,K)}}else Qr(a,l,h,f);break;case 31:Qr(a,l,h,f);break;case 13:Qr(a,l,h,f);break;case 23:break;case 22:y=l.stateNode,k=l.alternate,l.memoizedState!==null?y._visibility&2?Qr(a,l,h,f):Au(a,l):y._visibility&2?Qr(a,l,h,f):(y._visibility|=2,Fo(a,l,h,f,(l.subtreeFlags&10256)!==0||!1)),b&2048&&Wg(k,l);break;case 24:Qr(a,l,h,f),b&2048&&Gg(l.alternate,l);break;default:Qr(a,l,h,f)}}function Fo(a,l,h,f,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var y=a,k=l,D=h,K=f,ie=k.flags;switch(k.tag){case 0:case 11:case 15:Fo(y,k,D,K,b),Tu(8,k);break;case 23:break;case 22:var ue=k.stateNode;k.memoizedState!==null?ue._visibility&2?Fo(y,k,D,K,b):Au(y,k):(ue._visibility|=2,Fo(y,k,D,K,b)),b&&ie&2048&&Wg(k.alternate,k);break;case 24:Fo(y,k,D,K,b),b&&ie&2048&&Gg(k.alternate,k);break;default:Fo(y,k,D,K,b)}l=l.sibling}}function Au(a,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var h=a,f=l,b=f.flags;switch(f.tag){case 22:Au(h,f),b&2048&&Wg(f.alternate,f);break;case 24:Au(h,f),b&2048&&Gg(f.alternate,f);break;default:Au(h,f)}l=l.sibling}}var Ru=8192;function jo(a,l,h){if(a.subtreeFlags&Ru)for(a=a.child;a!==null;)vx(a,l,h),a=a.sibling}function vx(a,l,h){switch(a.tag){case 26:jo(a,l,h),a.flags&Ru&&a.memoizedState!==null&&PM(h,Kr,a.memoizedState,a.memoizedProps);break;case 5:jo(a,l,h);break;case 3:case 4:var f=Kr;Kr=kd(a.stateNode.containerInfo),jo(a,l,h),Kr=f;break;case 22:a.memoizedState===null&&(f=a.alternate,f!==null&&f.memoizedState!==null?(f=Ru,Ru=16777216,jo(a,l,h),Ru=f):jo(a,l,h));break;default:jo(a,l,h)}}function yx(a){var l=a.alternate;if(l!==null&&(a=l.child,a!==null)){l.child=null;do l=a.sibling,a.sibling=null,a=l;while(a!==null)}}function Nu(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var f=l[h];cn=f,Ex(f,a)}yx(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Sx(a),a=a.sibling}function Sx(a){switch(a.tag){case 0:case 11:case 15:Nu(a),a.flags&2048&&ws(9,a,a.return);break;case 3:Nu(a);break;case 12:Nu(a);break;case 22:var l=a.stateNode;a.memoizedState!==null&&l._visibility&2&&(a.return===null||a.return.tag!==13)?(l._visibility&=-3,pd(a)):Nu(a);break;default:Nu(a)}}function pd(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var f=l[h];cn=f,Ex(f,a)}yx(a)}for(a=a.child;a!==null;){switch(l=a,l.tag){case 0:case 11:case 15:ws(8,l,l.return),pd(l);break;case 22:h=l.stateNode,h._visibility&2&&(h._visibility&=-3,pd(l));break;default:pd(l)}a=a.sibling}}function Ex(a,l){for(;cn!==null;){var h=cn;switch(h.tag){case 0:case 11:case 15:ws(8,h,l);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var f=h.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:fu(h.memoizedState.cache)}if(f=h.child,f!==null)f.return=h,cn=f;else e:for(h=a;cn!==null;){f=cn;var b=f.sibling,y=f.return;if(dx(f),f===h){cn=null;break e}if(b!==null){b.return=y,cn=b;break e}cn=y}}}var X5={getCacheForType:function(a){var l=xn($t),h=l.data.get(a);return h===void 0&&(h=a(),l.data.set(a,h)),h},cacheSignal:function(){return xn($t).controller.signal}},Z5=typeof WeakMap=="function"?WeakMap:Map,at=0,gt=null,Ge=null,Xe=0,lt=0,dr=null,Cs=!1,zo=!1,Yg=!1,qi=0,Ot=0,Ts=0,Ca=0,Kg=0,fr=0,Uo=0,Lu=null,Jn=null,Qg=!1,md=0,xx=0,gd=1/0,_d=null,ks=null,Zt=0,As=null,$o=null,Wi=0,Xg=0,Zg=null,wx=null,Ou=0,Jg=null;function pr(){return(at&2)!==0&&Xe!==0?Xe&-Xe:M.T!==null?s0():jy()}function Cx(){if(fr===0)if((Xe&536870912)===0||Je){var a=Ch;Ch<<=1,(Ch&3932160)===0&&(Ch=262144),fr=a}else fr=536870912;return a=cr.current,a!==null&&(a.flags|=32),fr}function er(a,l,h){(a===gt&&(lt===2||lt===9)||a.cancelPendingCommit!==null)&&(Vo(a,0),Rs(a,Xe,fr,!1)),Jl(a,h),((at&2)===0||a!==gt)&&(a===gt&&((at&2)===0&&(Ca|=h),Ot===4&&Rs(a,Xe,fr,!1)),oi(a))}function Tx(a,l,h){if((at&6)!==0)throw Error(r(327));var f=!h&&(l&127)===0&&(l&a.expiredLanes)===0||Zl(a,l),b=f?tM(a,l):t0(a,l,!0),y=f;do{if(b===0){zo&&!f&&Rs(a,l,0,!1);break}else{if(h=a.current.alternate,y&&!J5(h)){b=t0(a,l,!1),y=!1;continue}if(b===2){if(y=l,a.errorRecoveryDisabledLanes&y)var k=0;else k=a.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){l=k;e:{var D=a;b=Lu;var K=D.current.memoizedState.isDehydrated;if(K&&(Vo(D,k).flags|=256),k=t0(D,k,!1),k!==2){if(Yg&&!K){D.errorRecoveryDisabledLanes|=y,Ca|=y,b=4;break e}y=Jn,Jn=b,y!==null&&(Jn===null?Jn=y:Jn.push.apply(Jn,y))}b=k}if(y=!1,b!==2)continue}}if(b===1){Vo(a,0),Rs(a,l,0,!0);break}e:{switch(f=a,y=b,y){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Rs(f,l,fr,!Cs);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=md+300-Bn(),10<b)){if(Rs(f,l,fr,!Cs),kh(f,0,!0)!==0)break e;Wi=l,f.timeoutHandle=rw(kx.bind(null,f,h,Jn,_d,Qg,l,fr,Ca,Uo,Cs,y,"Throttled",-0,0),b);break e}kx(f,h,Jn,_d,Qg,l,fr,Ca,Uo,Cs,y,null,-0,0)}}break}while(!0);oi(a)}function kx(a,l,h,f,b,y,k,D,K,ie,ue,fe,ae,oe){if(a.timeoutHandle=-1,fe=l.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Li},vx(l,y,fe);var Ce=(y&62914560)===y?md-Bn():(y&4194048)===y?xx-Bn():0;if(Ce=BM(fe,Ce),Ce!==null){Wi=y,a.cancelPendingCommit=Ce(Ix.bind(null,a,l,y,h,f,b,k,D,K,ue,fe,null,ae,oe)),Rs(a,y,k,!ie);return}}Ix(a,l,y,h,f,b,k,D,K)}function J5(a){for(var l=a;;){var h=l.tag;if((h===0||h===11||h===15)&&l.flags&16384&&(h=l.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var f=0;f<h.length;f++){var b=h[f],y=b.getSnapshot;b=b.value;try{if(!lr(y(),b))return!1}catch{return!1}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Rs(a,l,h,f){l&=~Kg,l&=~Ca,a.suspendedLanes|=l,a.pingedLanes&=~l,f&&(a.warmLanes|=l),f=a.expirationTimes;for(var b=l;0<b;){var y=31-mt(b),k=1<<y;f[y]=-1,b&=~k}h!==0&&By(a,h,l)}function bd(){return(at&6)===0?(Du(0),!1):!0}function e0(){if(Ge!==null){if(lt===0)var a=Ge.return;else a=Ge,Ii=ga=null,gg(a),Mo=null,mu=0,a=Ge;for(;a!==null;)ix(a.alternate,a),a=a.return;Ge=null}}function Vo(a,l){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,vM(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),Wi=0,e0(),gt=a,Ge=h=Di(a.current,null),Xe=l,lt=0,dr=null,Cs=!1,zo=Zl(a,l),Yg=!1,Uo=fr=Kg=Ca=Ts=Ot=0,Jn=Lu=null,Qg=!1,(l&8)!==0&&(l|=l&32);var f=a.entangledLanes;if(f!==0)for(a=a.entanglements,f&=l;0<f;){var b=31-mt(f),y=1<<b;l|=a[b],f&=~y}return qi=l,Fh(),h}function Ax(a,l){He=null,M.H=xu,l===Do||l===Gh?(l=VS(),lt=3):l===ig?(l=VS(),lt=4):lt=l===Og?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,dr=l,Ge===null&&(Ot=1,od(a,kr(l,a.current)))}function Rx(){var a=cr.current;return a===null?!0:(Xe&4194048)===Xe?Lr===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?a===Lr:!1}function Nx(){var a=M.H;return M.H=xu,a===null?xu:a}function Lx(){var a=M.A;return M.A=X5,a}function vd(){Ot=4,Cs||(Xe&4194048)!==Xe&&cr.current!==null||(zo=!0),(Ts&134217727)===0&&(Ca&134217727)===0||gt===null||Rs(gt,Xe,fr,!1)}function t0(a,l,h){var f=at;at|=2;var b=Nx(),y=Lx();(gt!==a||Xe!==l)&&(_d=null,Vo(a,l)),l=!1;var k=Ot;e:do try{if(lt!==0&&Ge!==null){var D=Ge,K=dr;switch(lt){case 8:e0(),k=6;break e;case 3:case 2:case 9:case 6:cr.current===null&&(l=!0);var ie=lt;if(lt=0,dr=null,qo(a,D,K,ie),h&&zo){k=0;break e}break;default:ie=lt,lt=0,dr=null,qo(a,D,K,ie)}}eM(),k=Ot;break}catch(ue){Ax(a,ue)}while(!0);return l&&a.shellSuspendCounter++,Ii=ga=null,at=f,M.H=b,M.A=y,Ge===null&&(gt=null,Xe=0,Fh()),k}function eM(){for(;Ge!==null;)Ox(Ge)}function tM(a,l){var h=at;at|=2;var f=Nx(),b=Lx();gt!==a||Xe!==l?(_d=null,gd=Bn()+500,Vo(a,l)):zo=Zl(a,l);e:do try{if(lt!==0&&Ge!==null){l=Ge;var y=dr;t:switch(lt){case 1:lt=0,dr=null,qo(a,l,y,1);break;case 2:case 9:if(US(y)){lt=0,dr=null,Dx(l);break}l=function(){lt!==2&<!==9||gt!==a||(lt=7),oi(a)},y.then(l,l);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:US(y)?(lt=0,dr=null,Dx(l)):(lt=0,dr=null,qo(a,l,y,7));break;case 5:var k=null;switch(Ge.tag){case 26:k=Ge.memoizedState;case 5:case 27:var D=Ge;if(k?bw(k):D.stateNode.complete){lt=0,dr=null;var K=D.sibling;if(K!==null)Ge=K;else{var ie=D.return;ie!==null?(Ge=ie,yd(ie)):Ge=null}break t}}lt=0,dr=null,qo(a,l,y,5);break;case 6:lt=0,dr=null,qo(a,l,y,6);break;case 8:e0(),Ot=6;break e;default:throw Error(r(462))}}nM();break}catch(ue){Ax(a,ue)}while(!0);return Ii=ga=null,M.H=f,M.A=b,at=h,Ge!==null?0:(gt=null,Xe=0,Fh(),Ot)}function nM(){for(;Ge!==null&&!pm();)Ox(Ge)}function Ox(a){var l=nx(a.alternate,a,qi);a.memoizedProps=a.pendingProps,l===null?yd(a):Ge=l}function Dx(a){var l=a,h=l.alternate;switch(l.tag){case 15:case 0:l=QE(h,l,l.pendingProps,l.type,void 0,Xe);break;case 11:l=QE(h,l,l.pendingProps,l.type.render,l.ref,Xe);break;case 5:gg(l);default:ix(h,l),l=Ge=LS(l,qi),l=nx(h,l,qi)}a.memoizedProps=a.pendingProps,l===null?yd(a):Ge=l}function qo(a,l,h,f){Ii=ga=null,gg(l),Mo=null,mu=0;var b=l.return;try{if(V5(a,b,l,h,Xe)){Ot=1,od(a,kr(h,a.current)),Ge=null;return}}catch(y){if(b!==null)throw Ge=b,y;Ot=1,od(a,kr(h,a.current)),Ge=null;return}l.flags&32768?(Je||f===1?a=!0:zo||(Xe&536870912)!==0?a=!1:(Cs=a=!0,(f===2||f===9||f===3||f===6)&&(f=cr.current,f!==null&&f.tag===13&&(f.flags|=16384))),Mx(l,a)):yd(l)}function yd(a){var l=a;do{if((l.flags&32768)!==0){Mx(l,Cs);return}a=l.return;var h=G5(l.alternate,l,qi);if(h!==null){Ge=h;return}if(l=l.sibling,l!==null){Ge=l;return}Ge=l=a}while(l!==null);Ot===0&&(Ot=5)}function Mx(a,l){do{var h=Y5(a.alternate,a);if(h!==null){h.flags&=32767,Ge=h;return}if(h=a.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!l&&(a=a.sibling,a!==null)){Ge=a;return}Ge=a=h}while(a!==null);Ot=6,Ge=null}function Ix(a,l,h,f,b,y,k,D,K){a.cancelPendingCommit=null;do Sd();while(Zt!==0);if((at&6)!==0)throw Error(r(327));if(l!==null){if(l===a.current)throw Error(r(177));if(y=l.lanes|l.childLanes,y|=$m,ID(a,h,y,k,D,K),a===gt&&(Ge=gt=null,Xe=0),$o=l,As=a,Wi=h,Xg=y,Zg=b,wx=f,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,aM(De,function(){return jx(),null})):(a.callbackNode=null,a.callbackPriority=0),f=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||f){f=M.T,M.T=null,b=Q.p,Q.p=2,k=at,at|=4;try{K5(a,l,h)}finally{at=k,Q.p=b,M.T=f}}Zt=1,Px(),Bx(),Hx()}}function Px(){if(Zt===1){Zt=0;var a=As,l=$o,h=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||h){h=M.T,M.T=null;var f=Q.p;Q.p=2;var b=at;at|=4;try{gx(l,a);var y=f0,k=ES(a.containerInfo),D=y.focusedElem,K=y.selectionRange;if(k!==D&&D&&D.ownerDocument&&SS(D.ownerDocument.documentElement,D)){if(K!==null&&Hm(D)){var ie=K.start,ue=K.end;if(ue===void 0&&(ue=ie),"selectionStart"in D)D.selectionStart=ie,D.selectionEnd=Math.min(ue,D.value.length);else{var fe=D.ownerDocument||document,ae=fe&&fe.defaultView||window;if(ae.getSelection){var oe=ae.getSelection(),Ce=D.textContent.length,Oe=Math.min(K.start,Ce),dt=K.end===void 0?Oe:Math.min(K.end,Ce);!oe.extend&&Oe>dt&&(k=dt,dt=Oe,Oe=k);var te=yS(D,Oe),Z=yS(D,dt);if(te&&Z&&(oe.rangeCount!==1||oe.anchorNode!==te.node||oe.anchorOffset!==te.offset||oe.focusNode!==Z.node||oe.focusOffset!==Z.offset)){var re=fe.createRange();re.setStart(te.node,te.offset),oe.removeAllRanges(),Oe>dt?(oe.addRange(re),oe.extend(Z.node,Z.offset)):(re.setEnd(Z.node,Z.offset),oe.addRange(re))}}}}for(fe=[],oe=D;oe=oe.parentNode;)oe.nodeType===1&&fe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<fe.length;D++){var de=fe[D];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}Dd=!!d0,f0=d0=null}finally{at=b,Q.p=f,M.T=h}}a.current=l,Zt=2}}function Bx(){if(Zt===2){Zt=0;var a=As,l=$o,h=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||h){h=M.T,M.T=null;var f=Q.p;Q.p=2;var b=at;at|=4;try{hx(a,l.alternate,l)}finally{at=b,Q.p=f,M.T=h}}Zt=3}}function Hx(){if(Zt===4||Zt===3){Zt=0,mm();var a=As,l=$o,h=Wi,f=wx;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Zt=5:(Zt=0,$o=As=null,Fx(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(ks=null),vm(h),l=l.stateNode,Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(Hn,l,void 0,(l.current.flags&128)===128)}catch{}if(f!==null){l=M.T,b=Q.p,Q.p=2,M.T=null;try{for(var y=a.onRecoverableError,k=0;k<f.length;k++){var D=f[k];y(D.value,{componentStack:D.stack})}}finally{M.T=l,Q.p=b}}(Wi&3)!==0&&Sd(),oi(a),b=a.pendingLanes,(h&261930)!==0&&(b&42)!==0?a===Jg?Ou++:(Ou=0,Jg=a):Ou=0,Du(0)}}function Fx(a,l){(a.pooledCacheLanes&=l)===0&&(l=a.pooledCache,l!=null&&(a.pooledCache=null,fu(l)))}function Sd(){return Px(),Bx(),Hx(),jx()}function jx(){if(Zt!==5)return!1;var a=As,l=Xg;Xg=0;var h=vm(Wi),f=M.T,b=Q.p;try{Q.p=32>h?32:h,M.T=null,h=Zg,Zg=null;var y=As,k=Wi;if(Zt=0,$o=As=null,Wi=0,(at&6)!==0)throw Error(r(331));var D=at;if(at|=4,Sx(y.current),bx(y,y.current,k,h),at=D,Du(0,!1),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(Hn,y)}catch{}return!0}finally{Q.p=b,M.T=f,Fx(a,l)}}function zx(a,l,h){l=kr(h,l),l=Lg(a.stateNode,l,2),a=Ss(a,l,2),a!==null&&(Jl(a,2),oi(a))}function ut(a,l,h){if(a.tag===3)zx(a,a,h);else for(;l!==null;){if(l.tag===3){zx(l,a,h);break}else if(l.tag===1){var f=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(ks===null||!ks.has(f))){a=kr(h,a),h=UE(2),f=Ss(l,h,2),f!==null&&($E(h,f,l,a),Jl(f,2),oi(f));break}}l=l.return}}function n0(a,l,h){var f=a.pingCache;if(f===null){f=a.pingCache=new Z5;var b=new Set;f.set(l,b)}else b=f.get(l),b===void 0&&(b=new Set,f.set(l,b));b.has(h)||(Yg=!0,b.add(h),a=rM.bind(null,a,l,h),l.then(a,a))}function rM(a,l,h){var f=a.pingCache;f!==null&&f.delete(l),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,gt===a&&(Xe&h)===h&&(Ot===4||Ot===3&&(Xe&62914560)===Xe&&300>Bn()-md?(at&2)===0&&Vo(a,0):Kg|=h,Uo===Xe&&(Uo=0)),oi(a)}function Ux(a,l){l===0&&(l=Py()),a=fa(a,l),a!==null&&(Jl(a,l),oi(a))}function iM(a){var l=a.memoizedState,h=0;l!==null&&(h=l.retryLane),Ux(a,h)}function sM(a,l){var h=0;switch(a.tag){case 31:case 13:var f=a.stateNode,b=a.memoizedState;b!==null&&(h=b.retryLane);break;case 19:f=a.stateNode;break;case 22:f=a.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(l),Ux(a,h)}function aM(a,l){return ho(a,l)}var Ed=null,Wo=null,r0=!1,xd=!1,i0=!1,Ns=0;function oi(a){a!==Wo&&a.next===null&&(Wo===null?Ed=Wo=a:Wo=Wo.next=a),xd=!0,r0||(r0=!0,lM())}function Du(a,l){if(!i0&&xd){i0=!0;do for(var h=!1,f=Ed;f!==null;){if(a!==0){var b=f.pendingLanes;if(b===0)var y=0;else{var k=f.suspendedLanes,D=f.pingedLanes;y=(1<<31-mt(42|a)+1)-1,y&=b&~(k&~D),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(h=!0,Wx(f,y))}else y=Xe,y=kh(f,f===gt?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||Zl(f,y)||(h=!0,Wx(f,y));f=f.next}while(h);i0=!1}}function oM(){$x()}function $x(){xd=r0=!1;var a=0;Ns!==0&&bM()&&(a=Ns);for(var l=Bn(),h=null,f=Ed;f!==null;){var b=f.next,y=Vx(f,l);y===0?(f.next=null,h===null?Ed=b:h.next=b,b===null&&(Wo=h)):(h=f,(a!==0||(y&3)!==0)&&(xd=!0)),f=b}Zt!==0&&Zt!==5||Du(a),Ns!==0&&(Ns=0)}function Vx(a,l){for(var h=a.suspendedLanes,f=a.pingedLanes,b=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var k=31-mt(y),D=1<<k,K=b[k];K===-1?((D&h)===0||(D&f)!==0)&&(b[k]=MD(D,l)):K<=l&&(a.expiredLanes|=D),y&=~D}if(l=gt,h=Xe,h=kh(a,a===l?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f=a.callbackNode,h===0||a===l&&(lt===2||lt===9)||a.cancelPendingCommit!==null)return f!==null&&f!==null&&Xl(f),a.callbackNode=null,a.callbackPriority=0;if((h&3)===0||Zl(a,h)){if(l=h&-h,l===a.callbackPriority)return l;switch(f!==null&&Xl(f),vm(h)){case 2:case 8:h=Se;break;case 32:h=De;break;case 268435456:h=ot;break;default:h=De}return f=qx.bind(null,a),h=ho(h,f),a.callbackPriority=l,a.callbackNode=h,l}return f!==null&&f!==null&&Xl(f),a.callbackPriority=2,a.callbackNode=null,2}function qx(a,l){if(Zt!==0&&Zt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(Sd()&&a.callbackNode!==h)return null;var f=Xe;return f=kh(a,a===gt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f===0?null:(Tx(a,f,l),Vx(a,Bn()),a.callbackNode!=null&&a.callbackNode===h?qx.bind(null,a):null)}function Wx(a,l){if(Sd())return null;Tx(a,l,!0)}function lM(){yM(function(){(at&6)!==0?ho(he,oM):$x()})}function s0(){if(Ns===0){var a=Lo;a===0&&(a=wh,wh<<=1,(wh&261888)===0&&(wh=256)),Ns=a}return Ns}function Gx(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Lh(""+a)}function Yx(a,l){var h=l.ownerDocument.createElement("input");return h.name=l.name,h.value=l.value,a.id&&h.setAttribute("form",a.id),l.parentNode.insertBefore(h,l),a=new FormData(a),h.parentNode.removeChild(h),a}function uM(a,l,h,f,b){if(l==="submit"&&h&&h.stateNode===b){var y=Gx((b[Yn]||null).action),k=f.submitter;k&&(l=(l=k[Yn]||null)?Gx(l.formAction):k.getAttribute("formAction"),l!==null&&(y=l,k=null));var D=new Ih("action","action",null,f,b);a.push({event:D,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Ns!==0){var K=k?Yx(b,k):new FormData(b);Cg(h,{pending:!0,data:K,method:b.method,action:y},null,K)}}else typeof y=="function"&&(D.preventDefault(),K=k?Yx(b,k):new FormData(b),Cg(h,{pending:!0,data:K,method:b.method,action:y},y,K))},currentTarget:b}]})}}for(var a0=0;a0<Um.length;a0++){var o0=Um[a0],cM=o0.toLowerCase(),hM=o0[0].toUpperCase()+o0.slice(1);Yr(cM,"on"+hM)}Yr(CS,"onAnimationEnd"),Yr(TS,"onAnimationIteration"),Yr(kS,"onAnimationStart"),Yr("dblclick","onDoubleClick"),Yr("focusin","onFocus"),Yr("focusout","onBlur"),Yr(k5,"onTransitionRun"),Yr(A5,"onTransitionStart"),Yr(R5,"onTransitionCancel"),Yr(AS,"onTransitionEnd"),_o("onMouseEnter",["mouseout","mouseover"]),_o("onMouseLeave",["mouseout","mouseover"]),_o("onPointerEnter",["pointerout","pointerover"]),_o("onPointerLeave",["pointerout","pointerover"]),ua("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ua("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ua("onBeforeInput",["compositionend","keypress","textInput","paste"]),ua("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ua("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ua("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mu));function Kx(a,l){l=(l&4)!==0;for(var h=0;h<a.length;h++){var f=a[h],b=f.event;f=f.listeners;e:{var y=void 0;if(l)for(var k=f.length-1;0<=k;k--){var D=f[k],K=D.instance,ie=D.currentTarget;if(D=D.listener,K!==y&&b.isPropagationStopped())break e;y=D,b.currentTarget=ie;try{y(b)}catch(ue){Hh(ue)}b.currentTarget=null,y=K}else for(k=0;k<f.length;k++){if(D=f[k],K=D.instance,ie=D.currentTarget,D=D.listener,K!==y&&b.isPropagationStopped())break e;y=D,b.currentTarget=ie;try{y(b)}catch(ue){Hh(ue)}b.currentTarget=null,y=K}}}}function Ye(a,l){var h=l[ym];h===void 0&&(h=l[ym]=new Set);var f=a+"__bubble";h.has(f)||(Qx(l,a,2,!1),h.add(f))}function l0(a,l,h){var f=0;l&&(f|=4),Qx(h,a,f,l)}var wd="_reactListening"+Math.random().toString(36).slice(2);function u0(a){if(!a[wd]){a[wd]=!0,$y.forEach(function(h){h!=="selectionchange"&&(dM.has(h)||l0(h,!1,a),l0(h,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[wd]||(l[wd]=!0,l0("selectionchange",!1,l))}}function Qx(a,l,h,f){switch(Cw(l)){case 2:var b=jM;break;case 8:b=zM;break;default:b=w0}h=b.bind(null,l,h,a),b=void 0,!Rm||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),f?b!==void 0?a.addEventListener(l,h,{capture:!0,passive:b}):a.addEventListener(l,h,!0):b!==void 0?a.addEventListener(l,h,{passive:b}):a.addEventListener(l,h,!1)}function c0(a,l,h,f,b){var y=f;if((l&1)===0&&(l&2)===0&&f!==null)e:for(;;){if(f===null)return;var k=f.tag;if(k===3||k===4){var D=f.stateNode.containerInfo;if(D===b)break;if(k===4)for(k=f.return;k!==null;){var K=k.tag;if((K===3||K===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;D!==null;){if(k=po(D),k===null)return;if(K=k.tag,K===5||K===6||K===26||K===27){f=y=k;continue e}D=D.parentNode}}f=f.return}tS(function(){var ie=y,ue=km(h),fe=[];e:{var ae=RS.get(a);if(ae!==void 0){var oe=Ih,Ce=a;switch(a){case"keypress":if(Dh(h)===0)break e;case"keydown":case"keyup":oe=s5;break;case"focusin":Ce="focus",oe=Dm;break;case"focusout":Ce="blur",oe=Dm;break;case"beforeblur":case"afterblur":oe=Dm;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=iS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=GD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=l5;break;case CS:case TS:case kS:oe=QD;break;case AS:oe=c5;break;case"scroll":case"scrollend":oe=qD;break;case"wheel":oe=d5;break;case"copy":case"cut":case"paste":oe=ZD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=aS;break;case"toggle":case"beforetoggle":oe=p5}var Oe=(l&4)!==0,dt=!Oe&&(a==="scroll"||a==="scrollend"),te=Oe?ae!==null?ae+"Capture":null:ae;Oe=[];for(var Z=ie,re;Z!==null;){var de=Z;if(re=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||re===null||te===null||(de=nu(Z,te),de!=null&&Oe.push(Iu(Z,de,re))),dt)break;Z=Z.return}0<Oe.length&&(ae=new oe(ae,Ce,null,h,ue),fe.push({event:ae,listeners:Oe}))}}if((l&7)===0){e:{if(ae=a==="mouseover"||a==="pointerover",oe=a==="mouseout"||a==="pointerout",ae&&h!==Tm&&(Ce=h.relatedTarget||h.fromElement)&&(po(Ce)||Ce[fo]))break e;if((oe||ae)&&(ae=ue.window===ue?ue:(ae=ue.ownerDocument)?ae.defaultView||ae.parentWindow:window,oe?(Ce=h.relatedTarget||h.toElement,oe=ie,Ce=Ce?po(Ce):null,Ce!==null&&(dt=s(Ce),Oe=Ce.tag,Ce!==dt||Oe!==5&&Oe!==27&&Oe!==6)&&(Ce=null)):(oe=null,Ce=ie),oe!==Ce)){if(Oe=iS,de="onMouseLeave",te="onMouseEnter",Z="mouse",(a==="pointerout"||a==="pointerover")&&(Oe=aS,de="onPointerLeave",te="onPointerEnter",Z="pointer"),dt=oe==null?ae:tu(oe),re=Ce==null?ae:tu(Ce),ae=new Oe(de,Z+"leave",oe,h,ue),ae.target=dt,ae.relatedTarget=re,de=null,po(ue)===ie&&(Oe=new Oe(te,Z+"enter",Ce,h,ue),Oe.target=re,Oe.relatedTarget=dt,de=Oe),dt=de,oe&&Ce)t:{for(Oe=fM,te=oe,Z=Ce,re=0,de=te;de;de=Oe(de))re++;de=0;for(var Ne=Z;Ne;Ne=Oe(Ne))de++;for(;0<re-de;)te=Oe(te),re--;for(;0<de-re;)Z=Oe(Z),de--;for(;re--;){if(te===Z||Z!==null&&te===Z.alternate){Oe=te;break t}te=Oe(te),Z=Oe(Z)}Oe=null}else Oe=null;oe!==null&&Xx(fe,ae,oe,Oe,!1),Ce!==null&&dt!==null&&Xx(fe,dt,Ce,Oe,!0)}}e:{if(ae=ie?tu(ie):window,oe=ae.nodeName&&ae.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ae.type==="file")var rt=pS;else if(dS(ae))if(mS)rt=w5;else{rt=E5;var Re=S5}else oe=ae.nodeName,!oe||oe.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ie&&Cm(ie.elementType)&&(rt=pS):rt=x5;if(rt&&(rt=rt(a,ie))){fS(fe,rt,h,ue);break e}Re&&Re(a,ae,ie),a==="focusout"&&ie&&ae.type==="number"&&ie.memoizedProps.value!=null&&wm(ae,"number",ae.value)}switch(Re=ie?tu(ie):window,a){case"focusin":(dS(Re)||Re.contentEditable==="true")&&(xo=Re,Fm=ie,cu=null);break;case"focusout":cu=Fm=xo=null;break;case"mousedown":jm=!0;break;case"contextmenu":case"mouseup":case"dragend":jm=!1,xS(fe,h,ue);break;case"selectionchange":if(T5)break;case"keydown":case"keyup":xS(fe,h,ue)}var Fe;if(Im)e:{switch(a){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Eo?cS(a,h)&&(Ze="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(Ze="onCompositionStart");Ze&&(oS&&h.locale!=="ko"&&(Eo||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Eo&&(Fe=nS()):(ps=ue,Nm="value"in ps?ps.value:ps.textContent,Eo=!0)),Re=Cd(ie,Ze),0<Re.length&&(Ze=new sS(Ze,a,null,h,ue),fe.push({event:Ze,listeners:Re}),Fe?Ze.data=Fe:(Fe=hS(h),Fe!==null&&(Ze.data=Fe)))),(Fe=g5?_5(a,h):b5(a,h))&&(Ze=Cd(ie,"onBeforeInput"),0<Ze.length&&(Re=new sS("onBeforeInput","beforeinput",null,h,ue),fe.push({event:Re,listeners:Ze}),Re.data=Fe)),uM(fe,a,ie,h,ue)}Kx(fe,l)})}function Iu(a,l,h){return{instance:a,listener:l,currentTarget:h}}function Cd(a,l){for(var h=l+"Capture",f=[];a!==null;){var b=a,y=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||y===null||(b=nu(a,h),b!=null&&f.unshift(Iu(a,b,y)),b=nu(a,l),b!=null&&f.push(Iu(a,b,y))),a.tag===3)return f;a=a.return}return[]}function fM(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Xx(a,l,h,f,b){for(var y=l._reactName,k=[];h!==null&&h!==f;){var D=h,K=D.alternate,ie=D.stateNode;if(D=D.tag,K!==null&&K===f)break;D!==5&&D!==26&&D!==27||ie===null||(K=ie,b?(ie=nu(h,y),ie!=null&&k.unshift(Iu(h,ie,K))):b||(ie=nu(h,y),ie!=null&&k.push(Iu(h,ie,K)))),h=h.return}k.length!==0&&a.push({event:l,listeners:k})}var pM=/\r\n?/g,mM=/\u0000|\uFFFD/g;function Zx(a){return(typeof a=="string"?a:""+a).replace(pM,`
|
|
10
10
|
`).replace(mM,"")}function Jx(a,l){return l=Zx(l),Zx(a)===l}function ht(a,l,h,f,b,y){switch(h){case"children":typeof f=="string"?l==="body"||l==="textarea"&&f===""||vo(a,f):(typeof f=="number"||typeof f=="bigint")&&l!=="body"&&vo(a,""+f);break;case"className":Rh(a,"class",f);break;case"tabIndex":Rh(a,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Rh(a,h,f);break;case"style":Jy(a,f,y);break;case"data":if(l!=="object"){Rh(a,"data",f);break}case"src":case"href":if(f===""&&(l!=="a"||h!=="href")){a.removeAttribute(h);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(h);break}f=Lh(""+f),a.setAttribute(h,f);break;case"action":case"formAction":if(typeof f=="function"){a.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(h==="formAction"?(l!=="input"&&ht(a,l,"name",b.name,b,null),ht(a,l,"formEncType",b.formEncType,b,null),ht(a,l,"formMethod",b.formMethod,b,null),ht(a,l,"formTarget",b.formTarget,b,null)):(ht(a,l,"encType",b.encType,b,null),ht(a,l,"method",b.method,b,null),ht(a,l,"target",b.target,b,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(h);break}f=Lh(""+f),a.setAttribute(h,f);break;case"onClick":f!=null&&(a.onclick=Li);break;case"onScroll":f!=null&&Ye("scroll",a);break;case"onScrollEnd":f!=null&&Ye("scrollend",a);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(h=f.__html,h!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=h}}break;case"multiple":a.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":a.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){a.removeAttribute("xlink:href");break}h=Lh(""+f),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(h,""+f):a.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(h,""):a.removeAttribute(h);break;case"capture":case"download":f===!0?a.setAttribute(h,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(h,f):a.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?a.setAttribute(h,f):a.removeAttribute(h);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?a.removeAttribute(h):a.setAttribute(h,f);break;case"popover":Ye("beforetoggle",a),Ye("toggle",a),Ah(a,"popover",f);break;case"xlinkActuate":Ni(a,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Ni(a,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Ni(a,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Ni(a,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Ni(a,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Ni(a,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Ni(a,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Ni(a,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Ni(a,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Ah(a,"is",f);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=$D.get(h)||h,Ah(a,h,f))}}function h0(a,l,h,f,b,y){switch(h){case"style":Jy(a,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(h=f.__html,h!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=h}}break;case"children":typeof f=="string"?vo(a,f):(typeof f=="number"||typeof f=="bigint")&&vo(a,""+f);break;case"onScroll":f!=null&&Ye("scroll",a);break;case"onScrollEnd":f!=null&&Ye("scrollend",a);break;case"onClick":f!=null&&(a.onclick=Li);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vy.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(b=h.endsWith("Capture"),l=h.slice(2,b?h.length-7:void 0),y=a[Yn]||null,y=y!=null?y[h]:null,typeof y=="function"&&a.removeEventListener(l,y,b),typeof f=="function")){typeof y!="function"&&y!==null&&(h in a?a[h]=null:a.hasAttribute(h)&&a.removeAttribute(h)),a.addEventListener(l,f,b);break e}h in a?a[h]=f:f===!0?a.setAttribute(h,""):Ah(a,h,f)}}}function Cn(a,l,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",a),Ye("load",a);var f=!1,b=!1,y;for(y in h)if(h.hasOwnProperty(y)){var k=h[y];if(k!=null)switch(y){case"src":f=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:ht(a,l,y,k,h,null)}}b&&ht(a,l,"srcSet",h.srcSet,h,null),f&&ht(a,l,"src",h.src,h,null);return;case"input":Ye("invalid",a);var D=y=k=b=null,K=null,ie=null;for(f in h)if(h.hasOwnProperty(f)){var ue=h[f];if(ue!=null)switch(f){case"name":b=ue;break;case"type":k=ue;break;case"checked":K=ue;break;case"defaultChecked":ie=ue;break;case"value":y=ue;break;case"defaultValue":D=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,l));break;default:ht(a,l,f,ue,h,null)}}Ky(a,y,D,K,ie,k,b,!1);return;case"select":Ye("invalid",a),f=k=y=null;for(b in h)if(h.hasOwnProperty(b)&&(D=h[b],D!=null))switch(b){case"value":y=D;break;case"defaultValue":k=D;break;case"multiple":f=D;default:ht(a,l,b,D,h,null)}l=y,h=k,a.multiple=!!f,l!=null?bo(a,!!f,l,!1):h!=null&&bo(a,!!f,h,!0);return;case"textarea":Ye("invalid",a),y=b=f=null;for(k in h)if(h.hasOwnProperty(k)&&(D=h[k],D!=null))switch(k){case"value":f=D;break;case"defaultValue":b=D;break;case"children":y=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:ht(a,l,k,D,h,null)}Xy(a,f,b,y);return;case"option":for(K in h)h.hasOwnProperty(K)&&(f=h[K],f!=null)&&(K==="selected"?a.selected=f&&typeof f!="function"&&typeof f!="symbol":ht(a,l,K,f,h,null));return;case"dialog":Ye("beforetoggle",a),Ye("toggle",a),Ye("cancel",a),Ye("close",a);break;case"iframe":case"object":Ye("load",a);break;case"video":case"audio":for(f=0;f<Mu.length;f++)Ye(Mu[f],a);break;case"image":Ye("error",a),Ye("load",a);break;case"details":Ye("toggle",a);break;case"embed":case"source":case"link":Ye("error",a),Ye("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in h)if(h.hasOwnProperty(ie)&&(f=h[ie],f!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:ht(a,l,ie,f,h,null)}return;default:if(Cm(l)){for(ue in h)h.hasOwnProperty(ue)&&(f=h[ue],f!==void 0&&h0(a,l,ue,f,h,void 0));return}}for(D in h)h.hasOwnProperty(D)&&(f=h[D],f!=null&&ht(a,l,D,f,h,null))}function gM(a,l,h,f){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,y=null,k=null,D=null,K=null,ie=null,ue=null;for(oe in h){var fe=h[oe];if(h.hasOwnProperty(oe)&&fe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":K=fe;default:f.hasOwnProperty(oe)||ht(a,l,oe,null,f,fe)}}for(var ae in f){var oe=f[ae];if(fe=h[ae],f.hasOwnProperty(ae)&&(oe!=null||fe!=null))switch(ae){case"type":y=oe;break;case"name":b=oe;break;case"checked":ie=oe;break;case"defaultChecked":ue=oe;break;case"value":k=oe;break;case"defaultValue":D=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,l));break;default:oe!==fe&&ht(a,l,ae,oe,f,fe)}}xm(a,k,D,K,ie,ue,y,b);return;case"select":oe=k=D=ae=null;for(y in h)if(K=h[y],h.hasOwnProperty(y)&&K!=null)switch(y){case"value":break;case"multiple":oe=K;default:f.hasOwnProperty(y)||ht(a,l,y,null,f,K)}for(b in f)if(y=f[b],K=h[b],f.hasOwnProperty(b)&&(y!=null||K!=null))switch(b){case"value":ae=y;break;case"defaultValue":D=y;break;case"multiple":k=y;default:y!==K&&ht(a,l,b,y,f,K)}l=D,h=k,f=oe,ae!=null?bo(a,!!h,ae,!1):!!f!=!!h&&(l!=null?bo(a,!!h,l,!0):bo(a,!!h,h?[]:"",!1));return;case"textarea":oe=ae=null;for(D in h)if(b=h[D],h.hasOwnProperty(D)&&b!=null&&!f.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:ht(a,l,D,null,f,b)}for(k in f)if(b=f[k],y=h[k],f.hasOwnProperty(k)&&(b!=null||y!=null))switch(k){case"value":ae=b;break;case"defaultValue":oe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==y&&ht(a,l,k,b,f,y)}Qy(a,ae,oe);return;case"option":for(var Ce in h)ae=h[Ce],h.hasOwnProperty(Ce)&&ae!=null&&!f.hasOwnProperty(Ce)&&(Ce==="selected"?a.selected=!1:ht(a,l,Ce,null,f,ae));for(K in f)ae=f[K],oe=h[K],f.hasOwnProperty(K)&&ae!==oe&&(ae!=null||oe!=null)&&(K==="selected"?a.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":ht(a,l,K,ae,f,oe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in h)ae=h[Oe],h.hasOwnProperty(Oe)&&ae!=null&&!f.hasOwnProperty(Oe)&&ht(a,l,Oe,null,f,ae);for(ie in f)if(ae=f[ie],oe=h[ie],f.hasOwnProperty(ie)&&ae!==oe&&(ae!=null||oe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:ht(a,l,ie,ae,f,oe)}return;default:if(Cm(l)){for(var dt in h)ae=h[dt],h.hasOwnProperty(dt)&&ae!==void 0&&!f.hasOwnProperty(dt)&&h0(a,l,dt,void 0,f,ae);for(ue in f)ae=f[ue],oe=h[ue],!f.hasOwnProperty(ue)||ae===oe||ae===void 0&&oe===void 0||h0(a,l,ue,ae,f,oe);return}}for(var te in h)ae=h[te],h.hasOwnProperty(te)&&ae!=null&&!f.hasOwnProperty(te)&&ht(a,l,te,null,f,ae);for(fe in f)ae=f[fe],oe=h[fe],!f.hasOwnProperty(fe)||ae===oe||ae==null&&oe==null||ht(a,l,fe,ae,f,oe)}function ew(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _M(){if(typeof performance.getEntriesByType=="function"){for(var a=0,l=0,h=performance.getEntriesByType("resource"),f=0;f<h.length;f++){var b=h[f],y=b.transferSize,k=b.initiatorType,D=b.duration;if(y&&D&&ew(k)){for(k=0,D=b.responseEnd,f+=1;f<h.length;f++){var K=h[f],ie=K.startTime;if(ie>D)break;var ue=K.transferSize,fe=K.initiatorType;ue&&ew(fe)&&(K=K.responseEnd,k+=ue*(K<D?1:(D-ie)/(K-ie)))}if(--f,l+=8*(y+k)/(b.duration/1e3),a++,10<a)break}}if(0<a)return l/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var d0=null,f0=null;function Td(a){return a.nodeType===9?a:a.ownerDocument}function tw(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nw(a,l){if(a===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&l==="foreignObject"?0:a}function p0(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var m0=null;function bM(){var a=window.event;return a&&a.type==="popstate"?a===m0?!1:(m0=a,!0):(m0=null,!1)}var rw=typeof setTimeout=="function"?setTimeout:void 0,vM=typeof clearTimeout=="function"?clearTimeout:void 0,iw=typeof Promise=="function"?Promise:void 0,yM=typeof queueMicrotask=="function"?queueMicrotask:typeof iw<"u"?function(a){return iw.resolve(null).then(a).catch(SM)}:rw;function SM(a){setTimeout(function(){throw a})}function Ls(a){return a==="head"}function sw(a,l){var h=l,f=0;do{var b=h.nextSibling;if(a.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"||h==="/&"){if(f===0){a.removeChild(b),Qo(l);return}f--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")f++;else if(h==="html")Pu(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,Pu(h);for(var y=h.firstChild;y;){var k=y.nextSibling,D=y.nodeName;y[eu]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&y.rel.toLowerCase()==="stylesheet"||h.removeChild(y),y=k}}else h==="body"&&Pu(a.ownerDocument.body);h=b}while(h);Qo(l)}function aw(a,l){var h=a;a=0;do{var f=h.nextSibling;if(h.nodeType===1?l?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(l?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),f&&f.nodeType===8)if(h=f.data,h==="/$"){if(a===0)break;a--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||a++;h=f}while(h)}function g0(a){var l=a.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var h=l;switch(l=l.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":g0(h),Sm(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function EM(a,l,h,f){for(;a.nodeType===1;){var b=h;if(a.nodeName.toLowerCase()!==l.toLowerCase()){if(!f&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(f){if(!a[eu])switch(l){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(l==="input"&&a.type==="hidden"){var y=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=Or(a.nextSibling),a===null)break}return null}function xM(a,l,h){if(l==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=Or(a.nextSibling),a===null))return null;return a}function ow(a,l){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!l||(a=Or(a.nextSibling),a===null))return null;return a}function _0(a){return a.data==="$?"||a.data==="$~"}function b0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function wM(a,l){var h=a.ownerDocument;if(a.data==="$~")a._reactRetry=l;else if(a.data!=="$?"||h.readyState!=="loading")l();else{var f=function(){l(),h.removeEventListener("DOMContentLoaded",f)};h.addEventListener("DOMContentLoaded",f),a._reactRetry=f}}function Or(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return a}var v0=null;function lw(a){a=a.nextSibling;for(var l=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(l===0)return Or(a.nextSibling);l--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||l++}a=a.nextSibling}return null}function uw(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(l===0)return a;l--}else h!=="/$"&&h!=="/&"||l++}a=a.previousSibling}return null}function cw(a,l,h){switch(l=Td(h),a){case"html":if(a=l.documentElement,!a)throw Error(r(452));return a;case"head":if(a=l.head,!a)throw Error(r(453));return a;case"body":if(a=l.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Pu(a){for(var l=a.attributes;l.length;)a.removeAttributeNode(l[0]);Sm(a)}var Dr=new Map,hw=new Set;function kd(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Gi=Q.d;Q.d={f:CM,r:TM,D:kM,C:AM,L:RM,m:NM,X:OM,S:LM,M:DM};function CM(){var a=Gi.f(),l=bd();return a||l}function TM(a){var l=mo(a);l!==null&&l.tag===5&&l.type==="form"?AE(l):Gi.r(a)}var Go=typeof document>"u"?null:document;function dw(a,l,h){var f=Go;if(f&&typeof l=="string"&&l){var b=Cr(l);b='link[rel="'+a+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),hw.has(b)||(hw.add(b),a={rel:a,crossOrigin:h,href:l},f.querySelector(b)===null&&(l=f.createElement("link"),Cn(l,"link",a),un(l),f.head.appendChild(l)))}}function kM(a){Gi.D(a),dw("dns-prefetch",a,null)}function AM(a,l){Gi.C(a,l),dw("preconnect",a,l)}function RM(a,l,h){Gi.L(a,l,h);var f=Go;if(f&&a&&l){var b='link[rel="preload"][as="'+Cr(l)+'"]';l==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+Cr(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+Cr(h.imageSizes)+'"]')):b+='[href="'+Cr(a)+'"]';var y=b;switch(l){case"style":y=Yo(a);break;case"script":y=Ko(a)}Dr.has(y)||(a=m({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:a,as:l},h),Dr.set(y,a),f.querySelector(b)!==null||l==="style"&&f.querySelector(Bu(y))||l==="script"&&f.querySelector(Hu(y))||(l=f.createElement("link"),Cn(l,"link",a),un(l),f.head.appendChild(l)))}}function NM(a,l){Gi.m(a,l);var h=Go;if(h&&a){var f=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+Cr(f)+'"][href="'+Cr(a)+'"]',y=b;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ko(a)}if(!Dr.has(y)&&(a=m({rel:"modulepreload",href:a},l),Dr.set(y,a),h.querySelector(b)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Hu(y)))return}f=h.createElement("link"),Cn(f,"link",a),un(f),h.head.appendChild(f)}}}function LM(a,l,h){Gi.S(a,l,h);var f=Go;if(f&&a){var b=go(f).hoistableStyles,y=Yo(a);l=l||"default";var k=b.get(y);if(!k){var D={loading:0,preload:null};if(k=f.querySelector(Bu(y)))D.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":l},h),(h=Dr.get(y))&&y0(a,h);var K=k=f.createElement("link");un(K),Cn(K,"link",a),K._p=new Promise(function(ie,ue){K.onload=ie,K.onerror=ue}),K.addEventListener("load",function(){D.loading|=1}),K.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Ad(k,l,f)}k={type:"stylesheet",instance:k,count:1,state:D},b.set(y,k)}}}function OM(a,l){Gi.X(a,l);var h=Go;if(h&&a){var f=go(h).hoistableScripts,b=Ko(a),y=f.get(b);y||(y=h.querySelector(Hu(b)),y||(a=m({src:a,async:!0},l),(l=Dr.get(b))&&S0(a,l),y=h.createElement("script"),un(y),Cn(y,"link",a),h.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(b,y))}}function DM(a,l){Gi.M(a,l);var h=Go;if(h&&a){var f=go(h).hoistableScripts,b=Ko(a),y=f.get(b);y||(y=h.querySelector(Hu(b)),y||(a=m({src:a,async:!0,type:"module"},l),(l=Dr.get(b))&&S0(a,l),y=h.createElement("script"),un(y),Cn(y,"link",a),h.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(b,y))}}function fw(a,l,h,f){var b=(b=ve.current)?kd(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(l=Yo(h.href),h=go(b).hoistableStyles,f=h.get(l),f||(f={type:"style",instance:null,count:0,state:null},h.set(l,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){a=Yo(h.href);var y=go(b).hoistableStyles,k=y.get(a);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,k),(y=b.querySelector(Bu(a)))&&!y._p&&(k.instance=y,k.state.loading=5),Dr.has(a)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Dr.set(a,h),y||MM(b,a,h,k.state))),l&&f===null)throw Error(r(528,""));return k}if(l&&f!==null)throw Error(r(529,""));return null;case"script":return l=h.async,h=h.src,typeof h=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ko(h),h=go(b).hoistableScripts,f=h.get(l),f||(f={type:"script",instance:null,count:0,state:null},h.set(l,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Yo(a){return'href="'+Cr(a)+'"'}function Bu(a){return'link[rel="stylesheet"]['+a+"]"}function pw(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function MM(a,l,h,f){a.querySelector('link[rel="preload"][as="style"]['+l+"]")?f.loading=1:(l=a.createElement("link"),f.preload=l,l.addEventListener("load",function(){return f.loading|=1}),l.addEventListener("error",function(){return f.loading|=2}),Cn(l,"link",h),un(l),a.head.appendChild(l))}function Ko(a){return'[src="'+Cr(a)+'"]'}function Hu(a){return"script[async]"+a}function mw(a,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var f=a.querySelector('style[data-href~="'+Cr(h.href)+'"]');if(f)return l.instance=f,un(f),f;var b=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return f=(a.ownerDocument||a).createElement("style"),un(f),Cn(f,"style",b),Ad(f,h.precedence,a),l.instance=f;case"stylesheet":b=Yo(h.href);var y=a.querySelector(Bu(b));if(y)return l.state.loading|=4,l.instance=y,un(y),y;f=pw(h),(b=Dr.get(b))&&y0(f,b),y=(a.ownerDocument||a).createElement("link"),un(y);var k=y;return k._p=new Promise(function(D,K){k.onload=D,k.onerror=K}),Cn(y,"link",f),l.state.loading|=4,Ad(y,h.precedence,a),l.instance=y;case"script":return y=Ko(h.src),(b=a.querySelector(Hu(y)))?(l.instance=b,un(b),b):(f=h,(b=Dr.get(y))&&(f=m({},h),S0(f,b)),a=a.ownerDocument||a,b=a.createElement("script"),un(b),Cn(b,"link",f),a.head.appendChild(b),l.instance=b);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(f=l.instance,l.state.loading|=4,Ad(f,h.precedence,a));return l.instance}function Ad(a,l,h){for(var f=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=f.length?f[f.length-1]:null,y=b,k=0;k<f.length;k++){var D=f[k];if(D.dataset.precedence===l)y=D;else if(y!==b)break}y?y.parentNode.insertBefore(a,y.nextSibling):(l=h.nodeType===9?h.head:h,l.insertBefore(a,l.firstChild))}function y0(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.title==null&&(a.title=l.title)}function S0(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.integrity==null&&(a.integrity=l.integrity)}var Rd=null;function gw(a,l,h){if(Rd===null){var f=new Map,b=Rd=new Map;b.set(h,f)}else b=Rd,f=b.get(h),f||(f=new Map,b.set(h,f));if(f.has(a))return f;for(f.set(a,null),h=h.getElementsByTagName(a),b=0;b<h.length;b++){var y=h[b];if(!(y[eu]||y[Sn]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(l)||"";k=a+k;var D=f.get(k);D?D.push(y):f.set(k,[y])}}return f}function _w(a,l,h){a=a.ownerDocument||a,a.head.insertBefore(h,l==="title"?a.querySelector("head > title"):null)}function IM(a,l,h){if(h===1||l.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(a=l.disabled,typeof l.precedence=="string"&&a==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function bw(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function PM(a,l,h,f){if(h.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var b=Yo(f.href),y=l.querySelector(Bu(b));if(y){l=y._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(a.count++,a=Nd.bind(a),l.then(a,a)),h.state.loading|=4,h.instance=y,un(y);return}y=l.ownerDocument||l,f=pw(f),(b=Dr.get(b))&&y0(f,b),y=y.createElement("link"),un(y);var k=y;k._p=new Promise(function(D,K){k.onload=D,k.onerror=K}),Cn(y,"link",f),h.instance=y}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(h,l),(l=h.state.preload)&&(h.state.loading&3)===0&&(a.count++,h=Nd.bind(a),l.addEventListener("load",h),l.addEventListener("error",h))}}var E0=0;function BM(a,l){return a.stylesheets&&a.count===0&&Od(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var f=setTimeout(function(){if(a.stylesheets&&Od(a,a.stylesheets),a.unsuspend){var y=a.unsuspend;a.unsuspend=null,y()}},6e4+l);0<a.imgBytes&&E0===0&&(E0=62500*_M());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Od(a,a.stylesheets),a.unsuspend)){var y=a.unsuspend;a.unsuspend=null,y()}},(a.imgBytes>E0?50:800)+l);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(f),clearTimeout(b)}}:null}function Nd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Od(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ld=null;function Od(a,l){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ld=new Map,l.forEach(HM,a),Ld=null,Nd.call(a))}function HM(a,l){if(!(l.state.loading&4)){var h=Ld.get(a);if(h)var f=h.get(null);else{h=new Map,Ld.set(a,h);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<b.length;y++){var k=b[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(h.set(k.dataset.precedence,k),f=k)}f&&h.set(null,f)}b=l.instance,k=b.getAttribute("data-precedence"),y=h.get(k)||f,y===f&&h.set(null,b),h.set(k,b),this.count++,f=Nd.bind(this),b.addEventListener("load",f),b.addEventListener("error",f),y?y.parentNode.insertBefore(b,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),l.state.loading|=4}}var Fu={$$typeof:R,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function FM(a,l,h,f,b,y,k,D,K){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_m(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_m(0),this.hiddenUpdates=_m(null),this.identifierPrefix=f,this.onUncaughtError=b,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function vw(a,l,h,f,b,y,k,D,K,ie,ue,fe){return a=new FM(a,l,h,k,K,ie,ue,fe,D),l=1,y===!0&&(l|=24),y=ur(3,null,null,l),a.current=y,y.stateNode=a,l=tg(),l.refCount++,a.pooledCache=l,l.refCount++,y.memoizedState={element:f,isDehydrated:h,cache:l},sg(y),a}function yw(a){return a?(a=To,a):To}function Sw(a,l,h,f,b,y){b=yw(b),f.context===null?f.context=b:f.pendingContext=b,f=ys(l),f.payload={element:h},y=y===void 0?null:y,y!==null&&(f.callback=y),h=Ss(a,f,l),h!==null&&(er(h,a,l),_u(h,a,l))}function Ew(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<l?h:l}}function x0(a,l){Ew(a,l),(a=a.alternate)&&Ew(a,l)}function xw(a){if(a.tag===13||a.tag===31){var l=fa(a,67108864);l!==null&&er(l,a,67108864),x0(a,67108864)}}function ww(a){if(a.tag===13||a.tag===31){var l=pr();l=bm(l);var h=fa(a,l);h!==null&&er(h,a,l),x0(a,l)}}var Dd=!0;function jM(a,l,h,f){var b=M.T;M.T=null;var y=Q.p;try{Q.p=2,w0(a,l,h,f)}finally{Q.p=y,M.T=b}}function zM(a,l,h,f){var b=M.T;M.T=null;var y=Q.p;try{Q.p=8,w0(a,l,h,f)}finally{Q.p=y,M.T=b}}function w0(a,l,h,f){if(Dd){var b=C0(f);if(b===null)c0(a,l,f,Md,h),Tw(a,f);else if($M(b,a,l,h,f))f.stopPropagation();else if(Tw(a,f),l&4&&-1<UM.indexOf(a)){for(;b!==null;){var y=mo(b);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=la(y.pendingLanes);if(k!==0){var D=y;for(D.pendingLanes|=2,D.entangledLanes|=2;k;){var K=1<<31-mt(k);D.entanglements[1]|=K,k&=~K}oi(y),(at&6)===0&&(gd=Bn()+500,Du(0))}}break;case 31:case 13:D=fa(y,2),D!==null&&er(D,y,2),bd(),x0(y,2)}if(y=C0(f),y===null&&c0(a,l,f,Md,h),y===b)break;b=y}b!==null&&f.stopPropagation()}else c0(a,l,f,null,h)}}function C0(a){return a=km(a),T0(a)}var Md=null;function T0(a){if(Md=null,a=po(a),a!==null){var l=s(a);if(l===null)a=null;else{var h=l.tag;if(h===13){if(a=o(l),a!==null)return a;a=null}else if(h===31){if(a=u(l),a!==null)return a;a=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null)}}return Md=a,null}function Cw(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(gm()){case he:return 2;case Se:return 8;case De:case We:return 32;case ot:return 268435456;default:return 32}default:return 32}}var k0=!1,Os=null,Ds=null,Ms=null,ju=new Map,zu=new Map,Is=[],UM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Tw(a,l){switch(a){case"focusin":case"focusout":Os=null;break;case"dragenter":case"dragleave":Ds=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":ju.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":zu.delete(l.pointerId)}}function Uu(a,l,h,f,b,y){return a===null||a.nativeEvent!==y?(a={blockedOn:l,domEventName:h,eventSystemFlags:f,nativeEvent:y,targetContainers:[b]},l!==null&&(l=mo(l),l!==null&&xw(l)),a):(a.eventSystemFlags|=f,l=a.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),a)}function $M(a,l,h,f,b){switch(l){case"focusin":return Os=Uu(Os,a,l,h,f,b),!0;case"dragenter":return Ds=Uu(Ds,a,l,h,f,b),!0;case"mouseover":return Ms=Uu(Ms,a,l,h,f,b),!0;case"pointerover":var y=b.pointerId;return ju.set(y,Uu(ju.get(y)||null,a,l,h,f,b)),!0;case"gotpointercapture":return y=b.pointerId,zu.set(y,Uu(zu.get(y)||null,a,l,h,f,b)),!0}return!1}function kw(a){var l=po(a.target);if(l!==null){var h=s(l);if(h!==null){if(l=h.tag,l===13){if(l=o(h),l!==null){a.blockedOn=l,zy(a.priority,function(){ww(h)});return}}else if(l===31){if(l=u(h),l!==null){a.blockedOn=l,zy(a.priority,function(){ww(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Id(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var h=C0(a.nativeEvent);if(h===null){h=a.nativeEvent;var f=new h.constructor(h.type,h);Tm=f,h.target.dispatchEvent(f),Tm=null}else return l=mo(h),l!==null&&xw(l),a.blockedOn=h,!1;l.shift()}return!0}function Aw(a,l,h){Id(a)&&h.delete(l)}function VM(){k0=!1,Os!==null&&Id(Os)&&(Os=null),Ds!==null&&Id(Ds)&&(Ds=null),Ms!==null&&Id(Ms)&&(Ms=null),ju.forEach(Aw),zu.forEach(Aw)}function Pd(a,l){a.blockedOn===l&&(a.blockedOn=null,k0||(k0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,VM)))}var Bd=null;function Rw(a){Bd!==a&&(Bd=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Bd===a&&(Bd=null);for(var l=0;l<a.length;l+=3){var h=a[l],f=a[l+1],b=a[l+2];if(typeof f!="function"){if(T0(f||h)===null)continue;break}var y=mo(h);y!==null&&(a.splice(l,3),l-=3,Cg(y,{pending:!0,data:b,method:h.method,action:f},f,b))}}))}function Qo(a){function l(K){return Pd(K,a)}Os!==null&&Pd(Os,a),Ds!==null&&Pd(Ds,a),Ms!==null&&Pd(Ms,a),ju.forEach(l),zu.forEach(l);for(var h=0;h<Is.length;h++){var f=Is[h];f.blockedOn===a&&(f.blockedOn=null)}for(;0<Is.length&&(h=Is[0],h.blockedOn===null);)kw(h),h.blockedOn===null&&Is.shift();if(h=(a.ownerDocument||a).$$reactFormReplay,h!=null)for(f=0;f<h.length;f+=3){var b=h[f],y=h[f+1],k=b[Yn]||null;if(typeof y=="function")k||Rw(h);else if(k){var D=null;if(y&&y.hasAttribute("formAction")){if(b=y,k=y[Yn]||null)D=k.formAction;else if(T0(b)!==null)continue}else D=k.action;typeof D=="function"?h[f+1]=D:(h.splice(f,3),f-=3),Rw(h)}}}function Nw(){function a(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function l(){b!==null&&(b(),b=null),f||setTimeout(h,20)}function h(){if(!f&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(h,100),function(){f=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),b!==null&&(b(),b=null)}}}function A0(a){this._internalRoot=a}Hd.prototype.render=A0.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(r(409));var h=l.current,f=pr();Sw(h,f,a,l,null,null)},Hd.prototype.unmount=A0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Sw(a.current,2,null,a,null,null),bd(),l[fo]=null}};function Hd(a){this._internalRoot=a}Hd.prototype.unstable_scheduleHydration=function(a){if(a){var l=jy();a={blockedOn:null,target:a,priority:l};for(var h=0;h<Is.length&&l!==0&&l<Is[h].priority;h++);Is.splice(h,0,a),h===0&&kw(a)}};var Lw=t.version;if(Lw!=="19.2.4")throw Error(r(527,Lw,"19.2.4"));Q.findDOMNode=function(a){var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=d(l),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var qM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fd.isDisabled&&Fd.supportsFiber)try{Hn=Fd.inject(qM),Xt=Fd}catch{}}return Vu.createRoot=function(a,l){if(!i(a))throw Error(r(299));var h=!1,f="",b=HE,y=FE,k=jE;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(k=l.onRecoverableError)),l=vw(a,1,!1,null,null,h,f,null,b,y,k,Nw),a[fo]=l.current,u0(a),new A0(l)},Vu.hydrateRoot=function(a,l,h){if(!i(a))throw Error(r(299));var f=!1,b="",y=HE,k=FE,D=jE,K=null;return h!=null&&(h.unstable_strictMode===!0&&(f=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onUncaughtError!==void 0&&(y=h.onUncaughtError),h.onCaughtError!==void 0&&(k=h.onCaughtError),h.onRecoverableError!==void 0&&(D=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),l=vw(a,1,!0,l,h??null,f,b,K,y,k,D,Nw),l.context=yw(null),h=l.current,f=pr(),f=bm(f),b=ys(f),b.callback=null,Ss(h,b,f),h=f,l.current.lanes=h,Jl(l,h),oi(l),a[fo]=l.current,u0(a),new Hd(l)},Vu.version="19.2.4",Vu}var Qw;function BI(){if(Qw)return L0.exports;Qw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),L0.exports=PI(),L0.exports}var HI=BI();const Xw=e=>Symbol.iterator in e,Zw=e=>"entries"in e,Jw=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[i,s]of n)if(!r.has(i)||!Object.is(s,r.get(i)))return!1;return!0},FI=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let i=n.next(),s=r.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=r.next()}return!!i.done&&!!s.done};function jI(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Xw(e)&&Xw(t)?Zw(e)&&Zw(t)?Jw(e,t):FI(e,t):Jw({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function an(e){const t=dl.useRef(void 0);return n=>{const r=e(n);return jI(t.current,r)?t.current:t.current=r}}const xl="diffs-container",zI=/(?=^From [a-f0-9]+ .+$)/m,I0=/(?=^diff --git)/gm,eC=/(?=^---\s+\S)/gm,UI=/(?=^@@ )/gm,$I=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,mb=new RegExp("(?<=\\n)"),VI=/^(---|\+\+\+)\s+([^\t\r\n]+)/,qI=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,WI=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,GI=/^index (?:[0-9a-f]+)\.\.(?:[0-9a-f]+)(?: (\d+))?/,eh="header-metadata",vn={dark:"pierre-dark",light:"pierre-light"},lv="data-unsafe-css";function YI(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}var DA=class{pre;selectedRange=null;renderedSelectionRange;anchor;_queuedRender;constructor(e={}){this.options=e}setOptions(e){this.options={...this.options,...e},this.removeEventListeners(),this.options.enableLineSelection===!0&&this.attachEventListeners()}cleanUp(){this.removeEventListeners(),this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre!=null&&delete this.pre.dataset.interactiveLineNumbers,this.pre=void 0}setup(e){this.setDirty(),this.pre!==e&&this.cleanUp(),this.pre=e;const{enableLineSelection:t=!1}=this.options;t?(this.pre.dataset.interactiveLineNumbers="",this.attachEventListeners()):(this.removeEventListeners(),delete this.pre.dataset.interactiveLineNumbers),this.setSelection(this.selectedRange)}setDirty(){this.renderedSelectionRange=void 0}isDirty(){return this.renderedSelectionRange===void 0}setSelection(e){const t=!(e===this.selectedRange||YI(e??void 0,this.selectedRange??void 0));!this.isDirty()&&!t||(this.selectedRange=e,this.renderSelection(),t&&this.notifySelectionChange())}getSelection(){return this.selectedRange}attachEventListeners(){this.pre!=null&&(this.removeEventListeners(),this.pre.addEventListener("pointerdown",this.handleMouseDown))}removeEventListeners(){this.pre!=null&&(this.pre.removeEventListener("pointerdown",this.handleMouseDown),document.removeEventListener("pointermove",this.handleMouseMove),document.removeEventListener("pointerup",this.handleMouseUp))}handleMouseDown=e=>{const t=e.button===0?this.getMouseEventDataForPath(e.composedPath(),"click"):void 0;if(t==null)return;e.preventDefault();const{lineNumber:n,eventSide:r,lineIndex:i}=t;if(e.shiftKey&&this.selectedRange!=null){const s=this.deriveRowRangeFromDOM(this.selectedRange,this.pre?.dataset.type==="split");if(s==null)return;const o=s.start<=s.end?i>=s.start:i<=s.end;this.anchor={line:o?this.selectedRange.start:this.selectedRange.end,side:(o?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side)??"additions"},this.updateSelection(n,r),this.notifySelectionStart(this.selectedRange)}else{if(this.selectedRange?.start===n&&this.selectedRange?.end===n){this.updateSelection(null),this.notifySelectionEnd(null),this.notifySelectionChange();return}this.selectedRange=null,this.anchor={line:n,side:r},this.updateSelection(n,r),this.notifySelectionStart(this.selectedRange)}document.addEventListener("pointermove",this.handleMouseMove),document.addEventListener("pointerup",this.handleMouseUp)};handleMouseMove=e=>{const t=this.getMouseEventDataForPath(e.composedPath(),"move");if(t==null||this.anchor==null)return;const{lineNumber:n,eventSide:r}=t;this.updateSelection(n,r)};handleMouseUp=()=>{this.anchor=void 0,document.removeEventListener("pointermove",this.handleMouseMove),document.removeEventListener("pointerup",this.handleMouseUp),this.notifySelectionEnd(this.selectedRange),this.notifySelectionChange()};updateSelection(e,t){if(e==null)this.selectedRange=null;else{const n=this.anchor?.side??t;this.selectedRange={start:this.anchor?.line??e,end:e,side:n,endSide:n!==t?t:void 0}}this._queuedRender??=requestAnimationFrame(this.renderSelection)}renderSelection=()=>{if(this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const u of e)u.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const t=this.pre.querySelectorAll("[data-code]");if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("LineSelectionManager.applySelectionToDOM: Somehow there are more than 2 code elements...");const n=this.pre.dataset.type==="split",r=this.deriveRowRangeFromDOM(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),new Error("LineSelectionManager.renderSelection: No valid rowRange");const i=r.start===r.end,s=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(const u of t)for(const c of u.children){if(!(c instanceof HTMLElement))continue;const d=this.getLineIndex(c,n);if((d??0)>o)break;if(d==null||d<s)continue;let p=i?"single":d===s?"first":d===o?"last":"";c.setAttribute("data-selected-line",p),c.nextSibling instanceof HTMLElement&&c.nextSibling.hasAttribute("data-line-annotation")&&(i?(p="last",c.setAttribute("data-selected-line","first")):d===s?p="":d===o&&c.setAttribute("data-selected-line",""),c.nextSibling.setAttribute("data-selected-line",p))}};deriveRowRangeFromDOM(e,t){if(e==null)return;const n=this.findRowIndexForLineNumber(e.start,e.side,t),r=e.end===e.start&&(e.endSide==null||e.endSide===e.side)?n:this.findRowIndexForLineNumber(e.end,e.endSide??e.side,t);return n!=null&&r!=null?{start:n,end:r}:void 0}findRowIndexForLineNumber(e,t="additions",n){if(this.pre==null)return;const r=Array.from(this.pre.querySelectorAll(`[data-line="${e}"]`));if(r.push(...Array.from(this.pre.querySelectorAll(`[data-alt-line="${e}"]`))),r.length!==0){for(const i of r)if(i instanceof HTMLElement){if(this.getLineSideFromElement(i)===t)return this.getLineIndex(i,n);if(parseInt(i.dataset.altLine??"")===e)return this.getLineIndex(i,n)}console.error("LineSelectionManager.findRowIndexForLineNumber: Invalid selection",e,t)}}notifySelectionChange(){const{onLineSelected:e}=this.options;e?.(this.selectedRange??null)}notifySelectionStart(e){const{onLineSelectionStart:t}=this.options;t?.(e)}notifySelectionEnd(e){const{onLineSelectionEnd:t}=this.options;t?.(e)}getMouseEventDataForPath(e,t){let n,r,i=!1,s;for(const o of e)if(o instanceof HTMLElement){if(o.hasAttribute("data-column-number")){i=!0;continue}if(o.hasAttribute("data-line")){if(n=this.getLineNumber(o),r=this.getLineIndex(o,this.pre?.dataset.type==="split"),o.dataset.lineType==="change-deletion"?s="deletions":o.dataset.lineType==="change-additions"&&(s="additions"),r==null||n==null){r=void 0,n=void 0;break}if(s!=null)break;continue}if(o.hasAttribute("data-code")){s??=o.hasAttribute("data-deletions")?"deletions":"additions";break}}if(!(t==="click"&&!i||r==null||n==null))return{lineIndex:r,lineNumber:n,eventSide:s??"additions"}}getLineNumber(e){const t=parseInt(e.dataset.line??"",10);return Number.isNaN(t)?void 0:t}getLineIndex(e,t){const n=(e.dataset.lineIndex??"").split(",").map(r=>parseInt(r)).filter(r=>!Number.isNaN(r));if(t&&n.length===2)return n[1];if(!t)return n[0]}getLineSideFromElement(e){if(e.dataset.lineType==="change-deletion")return"deletions";if(e.dataset.lineType==="change-addition")return"additions";const t=e.closest("[data-code]");return t instanceof HTMLElement&&t.hasAttribute("data-deletions")?"deletions":"additions"}};function Ff({enableLineSelection:e,onLineSelected:t,onLineSelectionStart:n,onLineSelectionEnd:r}){return{enableLineSelection:e,onLineSelected:t,onLineSelectionStart:n,onLineSelectionEnd:r}}function P0(e,t){return e==null?!1:t==="file"?e.type==="line":e.type==="diff-line"}function KI(e){return e?.type==="line-info"}var MA=class{hoveredLine;pre;hoverSlot;constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handleMouseClick),this.pre?.removeEventListener("pointermove",this.handleMouseMove),this.pre?.removeEventListener("pointerout",this.handleMouseLeave),delete this.pre?.dataset.interactiveLines,delete this.pre?.dataset.interactiveLineNumbers,this.pre=void 0}setup(e){const{__debugMouseEvents:t,onLineClick:n,onLineNumberClick:r,onLineEnter:i,onLineLeave:s,onHunkExpand:o,enableHoverUtility:u=!1}=this.options;if(this.cleanUp(),this.pre=e,u&&this.hoverSlot==null){this.hoverSlot=document.createElement("div"),this.hoverSlot.dataset.hoverSlot="";const c=document.createElement("slot");c.name="hover-slot",this.hoverSlot.appendChild(c)}else!u&&this.hoverSlot!=null&&(this.hoverSlot.parentNode?.removeChild(this.hoverSlot),this.hoverSlot=void 0);(n!=null||r!=null||o!=null)&&(e.addEventListener("click",this.handleMouseClick),n!=null?e.dataset.interactiveLines="":r!=null&&(e.dataset.interactiveLineNumbers=""),Tn(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const c=[];return(t==="both"||t==="click")&&(n!=null&&c.push("onLineClick"),r!=null&&c.push("onLineNumberClick"),o!=null&&c.push("expandable hunk separators")),c})())),(i!=null||s!=null||u)&&(e.addEventListener("pointermove",this.handleMouseMove),Tn(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),e.addEventListener("pointerleave",this.handleMouseLeave),Tn(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event"))}getHoveredLine=()=>{if(this.hoveredLine!=null){if(this.mode==="diff"&&this.hoveredLine.type==="diff-line")return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if(this.mode==="file"&&this.hoveredLine.type==="line")return{lineNumber:this.hoveredLine.lineNumber}}};handleMouseClick=e=>{Tn(this.options.__debugMouseEvents,"click","FileDiff.DEBUG.handleMouseClick:",e),this.handleMouseEvent({eventType:"click",event:e})};handleMouseMove=e=>{Tn(this.options.__debugMouseEvents,"move","FileDiff.DEBUG.handleMouseMove:",e),this.handleMouseEvent({eventType:"move",event:e})};handleMouseLeave=e=>{const{__debugMouseEvents:t}=this.options;if(Tn(t,"move","FileDiff.DEBUG.handleMouseLeave: no event"),this.hoveredLine==null){Tn(t,"move","FileDiff.DEBUG.handleMouseLeave: returned early, no .hoveredLine");return}this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.hoveredLine=void 0};handleMouseEvent({eventType:e,event:t}){const{__debugMouseEvents:n}=this.options,r=t.composedPath();Tn(n,e,"FileDiff.DEBUG.handleMouseEvent:",{eventType:e,composedPath:r});const i=this.getLineData(r);Tn(n,e,"FileDiff.DEBUG.handleMouseEvent: getLineData result:",i);const{onLineClick:s,onLineNumberClick:o,onLineEnter:u,onLineLeave:c,onHunkExpand:d}=this.options;switch(e){case"move":if(P0(i,this.mode)&&this.hoveredLine?.lineElement===i.lineElement){Tn(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', returned early because same line");break}this.hoveredLine!=null&&(Tn(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', clearing an existing hovered line and firing onLineLeave"),this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),c?.({...this.hoveredLine,event:t}),this.hoveredLine=void 0),P0(i,this.mode)&&(Tn(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', setting up a new hoveredLine and firing onLineEnter"),this.hoveredLine=i,this.hoverSlot!=null&&i.numberElement?.appendChild(this.hoverSlot),u?.({...this.hoveredLine,event:t}));break;case"click":if(Tn(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', with data:",i),i==null)break;if(KI(i)&&d!=null){Tn(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', expanding a hunk"),d(i.hunkIndex,i.direction);break}P0(i,this.mode)&&(o!=null&&i.numberColumn?(Tn(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineNumberClick'"),o({...i,event:t})):s!=null?(Tn(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineClick'"),s({...i,event:t})):Tn(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', fell through, no event to fire"));break}}getLineData(e){let t=!1;const n=e.find(o=>o instanceof HTMLElement?(t=t||"columnNumber"in o.dataset,"line"in o.dataset||"expandIndex"in o.dataset):!1);if(!(n instanceof HTMLElement))return;if(n.dataset.expandIndex!=null){const o=parseInt(n.dataset.expandIndex);if(isNaN(o))return;let u;for(const c of e)if(c===n||c instanceof HTMLElement&&(u=u??("expandUp"in c.dataset?"up":void 0)??("expandDown"in c.dataset?"down":void 0)??("expandBoth"in c.dataset?"both":void 0),u!=null))break;return u!=null?{type:"line-info",hunkIndex:o,direction:u}:void 0}const r=parseInt(n.dataset.line??"");if(isNaN(r))return;const i=n.dataset.lineType;if(i!=="context"&&i!=="context-expanded"&&i!=="change-deletion"&&i!=="change-addition")return;const s=(()=>{const o=n.children[0];return o instanceof HTMLElement&&o.dataset.columnNumber!=null?o:void 0})();return this.mode==="file"?{type:"line",lineElement:n,lineNumber:r,numberElement:s,numberColumn:t}:{type:"diff-line",annotationSide:(()=>{if(i==="change-deletion")return"deletions";if(i==="change-addition")return"additions";const o=n.closest("[data-code]");return o instanceof HTMLElement&&"deletions"in o.dataset?"deletions":"additions"})(),lineType:i,lineElement:n,numberElement:s,lineNumber:r,numberColumn:t}}};function Tn(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}function jf({onLineClick:e,onLineNumberClick:t,onLineEnter:n,onLineLeave:r,enableHoverUtility:i,__debugMouseEvents:s},o){return{onLineClick:e,onLineNumberClick:t,onLineEnter:n,onLineLeave:r,enableHoverUtility:i,__debugMouseEvents:s,onHunkExpand:o}}var IA=class{observedNodes=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear()}resizeObserver;setup(e){this.cleanUp();const t=e.querySelectorAll('[data-line-annotation*=","]');this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);const n=e.querySelectorAll("code");for(const i of n){let s=i.querySelector("[data-column-number]");s instanceof HTMLElement||(s=null);const o={type:"code",codeElement:i,numberElement:s,codeWidth:"auto",numberWidth:0};this.observedNodes.set(i,o),this.resizeObserver.observe(i),s!=null&&(this.observedNodes.set(s,o),this.resizeObserver.observe(s))}if(n.length<=1)return;const r=new Map;for(const i of t){if(!(i instanceof HTMLElement))continue;const{lineAnnotation:s=""}=i.dataset;if(!/^\d+,\d+$/.test(s)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:s,element:i});continue}let o=r.get(s);o==null&&(o=[],r.set(s,o)),o.push(i)}for(const[i,s]of r){if(s.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",i,s);continue}const[o,u]=s,c=o.firstElementChild,d=u.firstElementChild;if(!(o instanceof HTMLElement)||!(u instanceof HTMLElement)||!(c instanceof HTMLElement)||!(d instanceof HTMLElement))continue;const p={type:"annotations",column1:{container:o,child:c,childHeight:0},column2:{container:u,child:d,childHeight:0},currentHeight:"auto"};this.observedNodes.set(c,p),this.observedNodes.set(d,p),this.resizeObserver.observe(c),this.resizeObserver.observe(d)}}handleResizeObserver=e=>{for(const t of e){const{target:n,borderBoxSize:r}=t;if(!(n instanceof HTMLElement)){console.error("FileDiff.handleResizeObserver: Invalid element for ResizeObserver",t);continue}const i=this.observedNodes.get(n);if(i==null){console.error("FileDiff.handleResizeObserver: Not a valid observed node",t);continue}const s=r[0];if(i.type==="annotations"){const o=(()=>{if(n===i.column1.child)return i.column1;if(n===i.column2.child)return i.column2})();if(o==null){console.error("FileDiff.handleResizeObserver: Couldn't find a column for",{item:i,target:n});continue}o.childHeight=s.blockSize;const u=Math.max(i.column1.childHeight,i.column2.childHeight);u!==i.currentHeight&&(i.currentHeight=Math.max(u,0),i.column1.container.style.setProperty("--diffs-annotation-min-height",`${i.currentHeight}px`),i.column2.container.style.setProperty("--diffs-annotation-min-height",`${i.currentHeight}px`))}else i.type==="code"&&(n===i.codeElement?s.inlineSize!==i.codeWidth&&(i.codeWidth=s.inlineSize,i.codeElement.style.setProperty("--diffs-column-content-width",`${Math.max(i.codeWidth-i.numberWidth,0)}px`),i.codeElement.style.setProperty("--diffs-column-width",`${i.codeWidth}px`)):n===i.numberElement&&s.inlineSize!==i.numberWidth&&(i.numberWidth=s.inlineSize,i.codeElement.style.setProperty("--diffs-column-number-width",`${i.numberWidth}px`),i.codeWidth!=="auto"&&i.codeElement.style.setProperty("--diffs-column-content-width",`${Math.max(i.codeWidth-i.numberWidth,0)}px`)))}}};const Wa=new Map,B0=new Map,gb=new Set;function zf(e){for(const t of Array.isArray(e)?e:[e])if(!gb.has(t))return!1;return!0}function tC(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gb.has(n.name))continue;let r=Wa.get(n.name);r==null&&(r=n,Wa.set(n.name,r)),gb.add(r.name),t.loadLanguageSync(r.data)}}function PA(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const QI="modulepreload",XI=function(e){return"/"+e},nC={},j=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let c=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=o?.nonce||o?.getAttribute("nonce");i=c(n.map(d=>{if(d=XI(d),d in nC)return;nC[d]=!0;const p=d.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":QI,p||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),p)return new Promise((_,v)=>{g.addEventListener("load",_),g.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return i.then(o=>{for(const u of o||[])u.status==="rejected"&&s(u.reason);return t().catch(s)})};let Kt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function ZI(e){return uv(e)}function uv(e){return Array.isArray(e)?JI(e):e instanceof RegExp?e:typeof e=="object"?e4(e):e}function JI(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=uv(e[n]);return t}function e4(e){let t={};for(let n in e)t[n]=uv(e[n]);return t}function BA(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function HA(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?HA(e.substring(0,e.length-1)):e.substr(~t+1)}var H0=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,zd=class{static hasCaptures(e){return e===null?!1:(H0.lastIndex=0,H0.test(e))}static replaceCaptures(e,t,n){return e.replace(H0,(r,i,s,o)=>{let u=n[parseInt(i||s,10)];if(u){let c=t.substring(u.start,u.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function FA(e,t){return e<t?-1:e>t?1:0}function jA(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let s=FA(e[i],t[i]);if(s!==0)return s}return 0}return n-r}function rC(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function zA(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var UA=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Uf=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(r4(e),t)}static createFromParsedTheme(e,t){return s4(e,t)}_cachedMatchRoot=new UA(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>t4(e.parent,i.parentScopes));return r?new $A(r.fontStyle,r.foreground,r.background):null}},F0=class vf{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new vf(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new vf(n,t[r]);return n}push(t){return new vf(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function t4(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!n4(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function n4(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var $A=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function r4(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,s=t.length;i<s;i++){let o=t[i];if(!o.settings)continue;let u;if(typeof o.scope=="string"){let m=o.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),u=m.split(",")}else Array.isArray(o.scope)?u=o.scope:u=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let m=o.settings.fontStyle.split(" ");for(let g=0,_=m.length;g<_;g++)switch(m[g]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let d=null;typeof o.settings.foreground=="string"&&rC(o.settings.foreground)&&(d=o.settings.foreground);let p=null;typeof o.settings.background=="string"&&rC(o.settings.background)&&(p=o.settings.background);for(let m=0,g=u.length;m<g;m++){let v=u[m].trim().split(" "),x=v[v.length-1],C=null;v.length>1&&(C=v.slice(0,v.length-1),C.reverse()),n[r++]=new i4(x,C,i,c,d,p)}}return n}var i4=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Dn=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Dn||{});function s4(e,t){e.sort((c,d)=>{let p=FA(c.scope,d.scope);return p!==0||(p=jA(c.parentScopes,d.parentScopes),p!==0)?p:c.index-d.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(i=c.background)}let s=new a4(t),o=new $A(n,s.getId(r),s.getId(i)),u=new l4(new _b(0,null,-1,0,0),[]);for(let c=0,d=e.length;c<d;c++){let p=e[c];u.insert(0,p.scope,p.parentScopes,p.fontStyle,s.getId(p.foreground),s.getId(p.background))}return new Uf(s,o,u)}var a4=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},o4=Object.freeze([]),_b=class VA{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,i,s){this.scopeDepth=t,this.parentScopes=n||o4,this.fontStyle=r,this.foreground=i,this.background=s}clone(){return new VA(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},l4=class bb{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const s=n.parentScopes[i].length-t.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,s;if(r===-1?(i=t,s=""):(i=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(bb._cmpBySpecificity),n}insert(t,n,r,i,s,o){if(n===""){this._doInsertHere(t,r,i,s,o);return}let u=n.indexOf("."),c,d;u===-1?(c=n,d=""):(c=n.substring(0,u),d=n.substring(u+1));let p;this._children.hasOwnProperty(c)?p=this._children[c]:(p=new bb(this._mainRule.clone(),_b.cloneArr(this._rulesWithParentScopes)),this._children[c]=p),p.insert(t+1,d,r,i,s,o)}_doInsertHere(t,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(t,r,i,s);return}for(let o=0,u=this._rulesWithParentScopes.length;o<u;o++){let c=this._rulesWithParentScopes[o];if(jA(c.parentScopes,n)===0){c.acceptOverwrite(t,r,i,s);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new _b(t,n,r,i,s))}},wl=class Pr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Pr.getLanguageId(t),r=Pr.getTokenType(t),i=Pr.getFontStyle(t),s=Pr.getForeground(t),o=Pr.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,s,o,u){let c=Pr.getLanguageId(t),d=Pr.getTokenType(t),p=Pr.containsBalancedBrackets(t)?1:0,m=Pr.getFontStyle(t),g=Pr.getForeground(t),_=Pr.getBackground(t);return n!==0&&(c=n),r!==8&&(d=r),i!==null&&(p=i?1:0),s!==-1&&(m=s),o!==0&&(g=o),u!==0&&(_=u),(c<<0|d<<8|p<<10|m<<11|g<<15|_<<24)>>>0}};function $f(e,t){const n=[],r=u4(e);let i=r.next();for(;i!==null;){let c=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let d=o();if(n.push({matcher:d,priority:c}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const c=s();return d=>!!c&&!c(d)}if(i==="("){i=r.next();const c=u();return i===")"&&(i=r.next()),c}if(iC(i)){const c=[];do c.push(i),i=r.next();while(iC(i));return d=>t(c,d)}return null}function o(){const c=[];let d=s();for(;d;)c.push(d),d=s();return p=>c.every(m=>m(p))}function u(){const c=[];let d=o();for(;d&&(c.push(d),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");d=o()}return p=>c.some(m=>m(p))}}function iC(e){return!!e&&!!e.match(/[\w\.:]+/)}function u4(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function qA(e){typeof e.dispose=="function"&&e.dispose()}var Ic=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},c4=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},h4=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},d4=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ic(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new h4;for(const n of e)f4(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Ic){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function f4(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof Ic?yf({baseGrammar:s,selfGrammar:i},r):vb(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const u of o)r.add(new Ic(u))}function vb(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Vf([r],t,n)}}function yf(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Vf(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Vf(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Vf(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?BA({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Vf(r.patterns,{...t,repository:i},n);const s=r.include;if(!s)continue;const o=WA(s);switch(o.kind){case 0:yf({...t,selfGrammar:t.baseGrammar},n);break;case 1:yf(t,n);break;case 2:vb(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const u=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(u){const c={baseGrammar:t.baseGrammar,selfGrammar:u,repository:i};o.kind===4?vb(o.ruleName,c,n):yf(c,n)}else o.kind===4?n.add(new c4(o.scopeName,o.ruleName)):n.add(new Ic(o.scopeName));break}}}var p4=class{kind=0},m4=class{kind=1},g4=class{constructor(e){this.ruleName=e}kind=2},_4=class{constructor(e){this.scopeName=e}kind=3},b4=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function WA(e){if(e==="$base")return new p4;if(e==="$self")return new m4;const t=e.indexOf("#");if(t===-1)return new _4(e);if(t===0)return new g4(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new b4(n,r)}}var v4=/\\(\d+)/,sC=/\\(\d+)/g,y4=-1,GA=-2;var th=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=zd.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=zd.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${HA(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:zd.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:zd.replaceCaptures(this._contentName,e,t)}},S4=class extends th{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},E4=class extends th{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Pc(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Bc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},aC=class extends th{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Bc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yb=class extends th{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,s,o,u,c,d){super(e,t,n,r),this._begin=new Pc(i,this.id),this.beginCaptures=s,this._end=new Pc(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=u,this.applyEndPatternLast=c||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Bc;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},qf=class extends th{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,s,o,u,c){super(e,t,n,r),this._begin=new Pc(i,this.id),this.beginCaptures=s,this.whileCaptures=u,this._while=new Pc(o,GA),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Bc;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Bc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},YA=class Ln{static createCaptureRule(t,n,r,i,s){return t.registerRule(o=>new S4(n,o,r,i,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new E4(t.$vscodeTextmateLocation,t.id,t.name,t.match,Ln._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=BA({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new aC(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Ln._compilePatterns(s,n,r))}return t.while?new qf(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Ln._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Ln._compileCaptures(t.whileCaptures||t.captures,n,r),Ln._compilePatterns(t.patterns,n,r)):new yb(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Ln._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Ln._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Ln._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let s=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const u=parseInt(o,10);u>s&&(s=u)}for(let o=0;o<=s;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const u=parseInt(o,10);let c=0;t[o].patterns&&(c=Ln.getCompiledRuleId(t[o],n,r)),i[u]=Ln.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,c)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const u=t[s];let c=-1;if(u.include){const d=WA(u.include);switch(d.kind){case 0:case 1:c=Ln.getCompiledRuleId(r[u.include],n,r);break;case 2:let p=r[d.ruleName];p&&(c=Ln.getCompiledRuleId(p,n,r));break;case 3:case 4:const m=d.scopeName,g=d.kind===4?d.ruleName:null,_=n.getExternalGrammar(m,r);if(_)if(g){let v=_.repository[g];v&&(c=Ln.getCompiledRuleId(v,n,_.repository))}else c=Ln.getCompiledRuleId(_.repository.$self,n,_.repository);break}}else c=Ln.getCompiledRuleId(u,n,r);if(c!==-1){const d=n.getRule(c);let p=!1;if((d instanceof aC||d instanceof yb||d instanceof qf)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;i.push(c)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Pc=class KA{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let i=0,s=[],o=!1;for(let u=0;u<r;u++)if(t.charAt(u)==="\\"&&u+1<r){const d=t.charAt(u+1);d==="z"?(s.push(t.substring(i,u)),s.push("$(?!\\n)(?<!\\n)"),i=u+2):(d==="A"||d==="G")&&(o=!0),u++}this.hasAnchor=o,i===0?this.source=t:(s.push(t.substring(i,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=v4.test(this.source):this.hasBackReferences=!1}clone(){return new KA(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return sC.lastIndex=0,this.source.replace(sC,(i,s)=>zA(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],s,o,u,c;for(s=0,o=this.source.length;s<o;s++)u=this.source.charAt(s),t[s]=u,n[s]=u,r[s]=u,i[s]=u,u==="\\"&&s+1<o&&(c=this.source.charAt(s+1),c==="A"?(t[s+1]="",n[s+1]="",r[s+1]="A",i[s+1]="A"):c==="G"?(t[s+1]="",n[s+1]="G",r[s+1]="",i[s+1]="G"):(t[s+1]=c,n[s+1]=c,r[s+1]=c,i[s+1]=c),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Bc=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new oC(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new oC(e,r,this._items.map(i=>i.ruleId))}},oC=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
11
11
|
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},j0=class{constructor(e,t){this.languageId=e,this.tokenType=t}},x4=class Sb{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new j0(t,8),this._embeddedLanguagesMatcher=new w4(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Sb._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new j0(0,0);_getBasicScopeAttributes=new UA(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new j0(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Sb.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},w4=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>zA(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},lC=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function QA(e,t,n,r,i,s,o,u){const c=t.content.length;let d=!1,p=-1;if(o){const _=C4(e,t,n,r,i,s);i=_.stack,r=_.linePos,n=_.isFirstLine,p=_.anchorPosition}const m=Date.now();for(;!d;){if(u!==0&&Date.now()-m>u)return new lC(i,!0);g()}return new lC(i,!1);function g(){const _=T4(e,t,n,r,i,p);if(!_){s.produce(i,c),d=!0;return}const v=_.captureIndices,x=_.matchedRuleId,C=v&&v.length>0?v[0].end>r:!1;if(x===y4){const w=i.getRule(e);s.produce(i,v[0].start),i=i.withContentNameScopesList(i.nameScopesList),uc(e,t,n,i,s,w.endCaptures,v),s.produce(i,v[0].end);const A=i;if(i=i.parent,p=A.getAnchorPos(),!C&&A.getEnterPos()===r){i=A,s.produce(i,c),d=!0;return}}else{const w=e.getRule(x);s.produce(i,v[0].start);const A=i,R=w.getName(t.content,v),N=i.contentNameScopesList.pushAttributed(R,e);if(i=i.push(x,r,p,v[0].end===c,null,N,N),w instanceof yb){const L=w;uc(e,t,n,i,s,L.beginCaptures,v),s.produce(i,v[0].end),p=v[0].end;const I=L.getContentName(t.content,v),P=N.pushAttributed(I,e);if(i=i.withContentNameScopesList(P),L.endHasBackReferences&&(i=i.withEndRule(L.getEndWithResolvedBackReferences(t.content,v))),!C&&A.hasSameRuleAs(i)){i=i.pop(),s.produce(i,c),d=!0;return}}else if(w instanceof qf){const L=w;uc(e,t,n,i,s,L.beginCaptures,v),s.produce(i,v[0].end),p=v[0].end;const I=L.getContentName(t.content,v),P=N.pushAttributed(I,e);if(i=i.withContentNameScopesList(P),L.whileHasBackReferences&&(i=i.withEndRule(L.getWhileWithResolvedBackReferences(t.content,v))),!C&&A.hasSameRuleAs(i)){i=i.pop(),s.produce(i,c),d=!0;return}}else if(uc(e,t,n,i,s,w.captures,v),s.produce(i,v[0].end),i=i.pop(),!C){i=i.safePop(),s.produce(i,c),d=!0;return}}v[0].end>r&&(r=v[0].end,n=!1)}}function C4(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const u=[];for(let c=i;c;c=c.pop()){const d=c.getRule(e);d instanceof qf&&u.push({rule:d,stack:c})}for(let c=u.pop();c;c=u.pop()){const{ruleScanner:d,findOptions:p}=R4(c.rule,e,c.stack.endRule,n,r===o),m=d.findNextMatchSync(t,r,p);if(m){if(m.ruleId!==GA){i=c.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(s.produce(c.stack,m.captureIndices[0].start),uc(e,t,n,c.stack,s,c.rule.whileCaptures,m.captureIndices),s.produce(c.stack,m.captureIndices[0].end),o=m.captureIndices[0].end,m.captureIndices[0].end>r&&(r=m.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function T4(e,t,n,r,i,s){const o=k4(e,t,n,r,i,s),u=e.getInjections();if(u.length===0)return o;const c=A4(u,e,t,n,r,i,s);if(!c)return o;if(!o)return c;const d=o.captureIndices[0].start,p=c.captureIndices[0].start;return p<d||c.priorityMatch&&p===d?c:o}function k4(e,t,n,r,i,s){const o=i.getRule(e),{ruleScanner:u,findOptions:c}=XA(o,e,i.endRule,n,r===s),d=u.findNextMatchSync(t,r,c);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function A4(e,t,n,r,i,s,o){let u=Number.MAX_VALUE,c=null,d,p=0;const m=s.contentNameScopesList.getScopeNames();for(let g=0,_=e.length;g<_;g++){const v=e[g];if(!v.matcher(m))continue;const x=t.getRule(v.ruleId),{ruleScanner:C,findOptions:w}=XA(x,t,null,r,i===o),A=C.findNextMatchSync(n,i,w);if(!A)continue;const R=A.captureIndices[0].start;if(!(R>=u)&&(u=R,c=A.captureIndices,d=A.ruleId,p=v.priority,u===i))break}return c?{priorityMatch:p===-1,captureIndices:c,matchedRuleId:d}:null}function XA(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function R4(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function uc(e,t,n,r,i,s,o){if(s.length===0)return;const u=t.content,c=Math.min(s.length,o.length),d=[],p=o[0].end;for(let m=0;m<c;m++){const g=s[m];if(g===null)continue;const _=o[m];if(_.length===0)continue;if(_.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=_.start;)i.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?i.produceFromScopes(d[d.length-1].scopes,_.start):i.produce(r,_.start),g.retokenizeCapturedWithRuleId){const x=g.getName(u,o),C=r.contentNameScopesList.pushAttributed(x,e),w=g.getContentName(u,o),A=C.pushAttributed(w,e),R=r.push(g.retokenizeCapturedWithRuleId,_.start,-1,!1,null,C,A),N=e.createOnigString(u.substring(0,_.end));QA(e,N,n&&_.start===0,_.start,R,i,!1,0),qA(N);continue}const v=g.getName(u,o);if(v!==null){const C=(d.length>0?d[d.length-1].scopes:r.contentNameScopesList).pushAttributed(v,e);d.push(new N4(C,_.end))}}for(;d.length>0;)i.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var N4=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function L4(e,t,n,r,i,s,o,u){return new D4(e,t,n,r,i,s,o,u)}function uC(e,t,n,r,i){const s=$f(t,Wf),o=YA.getCompiledRuleId(n,r,i.repository);for(const u of s)e.push({debugSelector:t,matcher:u.matcher,ruleId:o,grammar:i,priority:u.priority})}function Wf(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(O4(t[i],r))return n=i+1,!0;return!1})}function O4(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var D4=class{constructor(e,t,n,r,i,s,o,u){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=u,this._basicScopeAttributesProvider=new x4(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=cC(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const c of Object.keys(i)){const d=$f(c,Wf);for(const p of d)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)uC(t,o,i[o],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const u=this.getExternalGrammar(o);if(u){const c=u.injectionSelector;c&&uC(t,c,u,this,u)}})}return t.sort((i,s)=>i.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=cC(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=YA.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Eb.NULL){i=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=wl.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),g=this.getRule(this._rootId).getName(null,null);let _;g?_=vc.createRootAndLookUpScopeName(g,m,this):_=vc.createRoot("unknown",m),t=new Eb(null,this._rootId,-1,-1,!1,null,_,_)}else i=!1,t.reset();e=e+`
|
|
12
|
-
`;const s=this.createOnigString(e),o=s.content.length,u=new I4(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=QA(this,s,i,0,t,u,!0,r);return qA(s),{lineLength:o,lineTokens:u,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function cC(e,t){return e=ZI(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var vc=class ci{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const s of n)i=F0.push(i,s.scopeNames),r=new ci(r,i,s.encodedTokenAttributes);return r}static createRoot(t,n){return new ci(null,new F0(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new F0(null,t),o=r.themeProvider.themeMatch(s),u=ci.mergeAttributes(n,i,o);return new ci(null,s,u)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ci.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),wl.set(t,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ci._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const s of r)i=ci._pushAttributed(i,s,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),u=ci.mergeAttributes(t.tokenAttributes,i,o);return new ci(t,s,u)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Eb=class La{constructor(t,n,r,i,s,o,u,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=u,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new La(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:La._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?vc.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){La._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,o,u){return new La(this,t,n,r,i,s,o,u)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new La(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=vc.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new La(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,vc.fromExtension(r,n.contentNameScopesList))}},M4=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):$f(n,Wf).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>$f(n,Wf).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},I4=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(r=wl.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(r=wl.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},P4=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,L4(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},B4=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new P4(Uf.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Uf.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new M4(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,s){const o=new d4(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(u=>this._loadSingleGrammar(u.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,s)}},xb=Eb.NULL;const ZA=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class nh{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}nh.prototype.normal={};nh.prototype.property={};nh.prototype.space=void 0;function JA(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new nh(n,r,t)}function Hc(e){return e.toLowerCase()}class sr{constructor(t,n){this.attribute=n,this.property=t}}sr.prototype.attribute="";sr.prototype.booleanish=!1;sr.prototype.boolean=!1;sr.prototype.commaOrSpaceSeparated=!1;sr.prototype.commaSeparated=!1;sr.prototype.defined=!1;sr.prototype.mustUseProperty=!1;sr.prototype.number=!1;sr.prototype.overloadedBoolean=!1;sr.prototype.property="";sr.prototype.spaceSeparated=!1;sr.prototype.space=void 0;let H4=0;const je=no(),Gt=no(),wb=no(),be=no(),vt=no(),gl=no(),_r=no();function no(){return 2**++H4}const Cb=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:Gt,commaOrSpaceSeparated:_r,commaSeparated:gl,number:be,overloadedBoolean:wb,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),z0=Object.keys(Cb);class cv extends sr{constructor(t,n,r,i){let s=-1;if(super(t,n),hC(this,"space",i),typeof r=="number")for(;++s<z0.length;){const o=z0[s];hC(this,z0[s],(r&Cb[o])===Cb[o])}}}cv.prototype.defined=!0;function hC(e,t,n){n&&(e[t]=n)}function Pl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new cv(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Hc(r)]=r,n[Hc(s.attribute)]=r}return new nh(t,n,e.space)}const e3=Pl({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:vt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:be,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:vt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Gt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function t3(e,t){return t in e?e[t]:t}function n3(e,t){return t3(e,t.toLowerCase())}const F4=Pl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gl,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:vt,autoFocus:je,autoPlay:je,blocking:vt,capture:null,charSet:null,checked:je,cite:null,className:vt,cols:be,colSpan:null,content:null,contentEditable:Gt,controls:je,controlsList:vt,coords:be|gl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:wb,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:vt,height:be,hidden:wb,high:be,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:vt,itemRef:vt,itemScope:je,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:je,optimum:be,pattern:null,ping:vt,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:vt,required:je,reversed:je,rows:be,rowSpan:be,sandbox:vt,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:Gt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:n3}),j4=Pl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:_r,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gl,g2:gl,glyphName:gl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:_r,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_r,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_r,rev:_r,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_r,requiredFeatures:_r,requiredFonts:_r,requiredFormats:_r,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:_r,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_r,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_r,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:t3}),r3=Pl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),i3=Pl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:n3}),s3=Pl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),z4={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"},U4=/[A-Z]/g,dC=/-[a-z]/g,$4=/^data[-\w.:]+$/i;function rh(e,t){const n=Hc(t);let r=t,i=sr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$4.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(dC,q4);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!dC.test(s)){let o=s.replace(U4,V4);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=cv}return new i(r,t)}function V4(e){return"-"+e.toLowerCase()}function q4(e){return e.charAt(1).toUpperCase()}const Bl=JA([e3,F4,r3,i3,s3],"html"),wi=JA([e3,j4,r3,i3,s3],"svg"),fC={}.hasOwnProperty;function hv(e,t){const n=t||{};function r(i,...s){let o=r.invalid;const u=r.handlers;if(i&&fC.call(i,e)){const c=String(i[e]);o=fC.call(u,c)?u[c]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const W4=/["&'<>`]/g,G4=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Y4=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,K4=/[|\\{}()[\]^$+*?.]/g,pC=new WeakMap;function Q4(e,t){if(e=e.replace(t.subset?X4(t.subset):W4,r),t.subset||t.escapeOnly)return e;return e.replace(G4,n).replace(Y4,r);function n(i,s,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),t)}function r(i,s,o){return t.format(i.charCodeAt(0),o.charCodeAt(s+1),t)}}function X4(e){let t=pC.get(e);return t||(t=Z4(e),pC.set(e,t)),t}function Z4(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(K4,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const J4=/[\dA-Fa-f]/;function e8(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!J4.test(String.fromCharCode(t))?r:r+";"}const t8=/\d/;function n8(e,t,n){const r="&#"+String(e);return n&&t&&!t8.test(String.fromCharCode(t))?r:r+";"}const r8=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],U0={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},i8=["cent","copy","divide","gt","lt","not","para","times"],a3={}.hasOwnProperty,Tb={};let Ud;for(Ud in U0)a3.call(U0,Ud)&&(Tb[U0[Ud]]=Ud);const s8=/[^\dA-Za-z]/;function a8(e,t,n,r){const i=String.fromCharCode(e);if(a3.call(Tb,i)){const s=Tb[i],o="&"+s;return n&&r8.includes(s)&&!i8.includes(s)&&(!r||t&&t!==61&&s8.test(String.fromCharCode(t)))?o:o+";"}return""}function o8(e,t,n){let r=e8(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=a8(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=n8(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function _l(e,t){return Q4(e,Object.assign({format:o8},t))}const l8=/^>|^->|<!--|-->|--!>|<!-$/g,u8=[">"],c8=["<",">"];function h8(e,t,n,r){return r.settings.bogusComments?"<?"+_l(e.value,Object.assign({},r.settings.characterReferences,{subset:u8}))+">":"<!--"+e.value.replace(l8,i)+"-->";function i(s){return _l(s,Object.assign({},r.settings.characterReferences,{subset:c8}))}}function d8(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Gf(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 mC(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const o=n.slice(i,r).trim();(o||!s)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function dv(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function gC(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function fv(e){return e.join(" ").trim()}const f8=/[ \t\n\f\r]/g;function wp(e){return typeof e=="object"?e.type==="text"?_C(e.value):!1:_C(e)}function _C(e){return e.replace(f8,"")===""}const ln=l3(1),o3=l3(-1),p8=[];function l3(e){return t;function t(n,r,i){const s=n?n.children:p8;let o=(r||0)+e,u=s[o];if(!i)for(;u&&wp(u);)o+=e,u=s[o];return u}}const m8={}.hasOwnProperty;function u3(e){return t;function t(n,r,i){return m8.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const pv=u3({body:_8,caption:$0,colgroup:$0,dd:S8,dt:y8,head:$0,html:g8,li:v8,optgroup:E8,option:x8,p:b8,rp:bC,rt:bC,tbody:C8,td:vC,tfoot:T8,th:vC,thead:w8,tr:k8});function $0(e,t,n){const r=ln(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&wp(r.value.charAt(0)))}function g8(e,t,n){const r=ln(n,t);return!r||r.type!=="comment"}function _8(e,t,n){const r=ln(n,t);return!r||r.type!=="comment"}function b8(e,t,n){const r=ln(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function v8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&r.tagName==="li"}function y8(e,t,n){const r=ln(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function S8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function bC(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function E8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function x8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function w8(e,t,n){const r=ln(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function C8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function T8(e,t,n){return!ln(n,t)}function k8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function vC(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const A8=u3({body:L8,colgroup:O8,head:N8,html:R8,tbody:D8});function R8(e){const t=ln(e,-1);return!t||t.type!=="comment"}function N8(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function L8(e){const t=ln(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&wp(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function O8(e,t,n){const r=o3(n,t),i=ln(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&pv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function D8(e,t,n){const r=o3(n,t),i=ln(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&pv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const $d={name:[[`
|
|
12
|
+
`;const s=this.createOnigString(e),o=s.content.length,u=new I4(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=QA(this,s,i,0,t,u,!0,r);return qA(s),{lineLength:o,lineTokens:u,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function cC(e,t){return e=ZI(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var vc=class ci{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const s of n)i=F0.push(i,s.scopeNames),r=new ci(r,i,s.encodedTokenAttributes);return r}static createRoot(t,n){return new ci(null,new F0(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new F0(null,t),o=r.themeProvider.themeMatch(s),u=ci.mergeAttributes(n,i,o);return new ci(null,s,u)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ci.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),wl.set(t,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ci._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const s of r)i=ci._pushAttributed(i,s,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),u=ci.mergeAttributes(t.tokenAttributes,i,o);return new ci(t,s,u)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Eb=class La{constructor(t,n,r,i,s,o,u,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=u,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new La(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:La._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?vc.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){La._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,o,u){return new La(this,t,n,r,i,s,o,u)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new La(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=vc.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new La(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,vc.fromExtension(r,n.contentNameScopesList))}},M4=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):$f(n,Wf).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>$f(n,Wf).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},I4=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(r=wl.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(r=wl.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},P4=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,L4(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},B4=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new P4(Uf.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Uf.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new M4(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,s){const o=new d4(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(u=>this._loadSingleGrammar(u.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,s)}},xb=Eb.NULL;const ZA=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class nh{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}nh.prototype.normal={};nh.prototype.property={};nh.prototype.space=void 0;function JA(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new nh(n,r,t)}function Hc(e){return e.toLowerCase()}class sr{constructor(t,n){this.attribute=n,this.property=t}}sr.prototype.attribute="";sr.prototype.booleanish=!1;sr.prototype.boolean=!1;sr.prototype.commaOrSpaceSeparated=!1;sr.prototype.commaSeparated=!1;sr.prototype.defined=!1;sr.prototype.mustUseProperty=!1;sr.prototype.number=!1;sr.prototype.overloadedBoolean=!1;sr.prototype.property="";sr.prototype.spaceSeparated=!1;sr.prototype.space=void 0;let H4=0;const je=no(),Gt=no(),wb=no(),be=no(),vt=no(),gl=no(),_r=no();function no(){return 2**++H4}const Cb=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:Gt,commaOrSpaceSeparated:_r,commaSeparated:gl,number:be,overloadedBoolean:wb,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),z0=Object.keys(Cb);class cv extends sr{constructor(t,n,r,i){let s=-1;if(super(t,n),hC(this,"space",i),typeof r=="number")for(;++s<z0.length;){const o=z0[s];hC(this,z0[s],(r&Cb[o])===Cb[o])}}}cv.prototype.defined=!0;function hC(e,t,n){n&&(e[t]=n)}function Pl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new cv(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Hc(r)]=r,n[Hc(s.attribute)]=r}return new nh(t,n,e.space)}const eR=Pl({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:vt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:be,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:vt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Gt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tR(e,t){return t in e?e[t]:t}function nR(e,t){return tR(e,t.toLowerCase())}const F4=Pl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gl,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:vt,autoFocus:je,autoPlay:je,blocking:vt,capture:null,charSet:null,checked:je,cite:null,className:vt,cols:be,colSpan:null,content:null,contentEditable:Gt,controls:je,controlsList:vt,coords:be|gl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:wb,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:vt,height:be,hidden:wb,high:be,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:vt,itemRef:vt,itemScope:je,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:je,optimum:be,pattern:null,ping:vt,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:vt,required:je,reversed:je,rows:be,rowSpan:be,sandbox:vt,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:Gt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:nR}),j4=Pl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:_r,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gl,g2:gl,glyphName:gl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:_r,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_r,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_r,rev:_r,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_r,requiredFeatures:_r,requiredFonts:_r,requiredFormats:_r,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:_r,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_r,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_r,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tR}),rR=Pl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),iR=Pl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nR}),sR=Pl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),z4={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"},U4=/[A-Z]/g,dC=/-[a-z]/g,$4=/^data[-\w.:]+$/i;function rh(e,t){const n=Hc(t);let r=t,i=sr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$4.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(dC,q4);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!dC.test(s)){let o=s.replace(U4,V4);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=cv}return new i(r,t)}function V4(e){return"-"+e.toLowerCase()}function q4(e){return e.charAt(1).toUpperCase()}const Bl=JA([eR,F4,rR,iR,sR],"html"),wi=JA([eR,j4,rR,iR,sR],"svg"),fC={}.hasOwnProperty;function hv(e,t){const n=t||{};function r(i,...s){let o=r.invalid;const u=r.handlers;if(i&&fC.call(i,e)){const c=String(i[e]);o=fC.call(u,c)?u[c]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const W4=/["&'<>`]/g,G4=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Y4=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,K4=/[|\\{}()[\]^$+*?.]/g,pC=new WeakMap;function Q4(e,t){if(e=e.replace(t.subset?X4(t.subset):W4,r),t.subset||t.escapeOnly)return e;return e.replace(G4,n).replace(Y4,r);function n(i,s,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),t)}function r(i,s,o){return t.format(i.charCodeAt(0),o.charCodeAt(s+1),t)}}function X4(e){let t=pC.get(e);return t||(t=Z4(e),pC.set(e,t)),t}function Z4(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(K4,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const J4=/[\dA-Fa-f]/;function e8(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!J4.test(String.fromCharCode(t))?r:r+";"}const t8=/\d/;function n8(e,t,n){const r="&#"+String(e);return n&&t&&!t8.test(String.fromCharCode(t))?r:r+";"}const r8=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],U0={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},i8=["cent","copy","divide","gt","lt","not","para","times"],aR={}.hasOwnProperty,Tb={};let Ud;for(Ud in U0)aR.call(U0,Ud)&&(Tb[U0[Ud]]=Ud);const s8=/[^\dA-Za-z]/;function a8(e,t,n,r){const i=String.fromCharCode(e);if(aR.call(Tb,i)){const s=Tb[i],o="&"+s;return n&&r8.includes(s)&&!i8.includes(s)&&(!r||t&&t!==61&&s8.test(String.fromCharCode(t)))?o:o+";"}return""}function o8(e,t,n){let r=e8(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=a8(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=n8(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function _l(e,t){return Q4(e,Object.assign({format:o8},t))}const l8=/^>|^->|<!--|-->|--!>|<!-$/g,u8=[">"],c8=["<",">"];function h8(e,t,n,r){return r.settings.bogusComments?"<?"+_l(e.value,Object.assign({},r.settings.characterReferences,{subset:u8}))+">":"<!--"+e.value.replace(l8,i)+"-->";function i(s){return _l(s,Object.assign({},r.settings.characterReferences,{subset:c8}))}}function d8(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Gf(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 mC(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const o=n.slice(i,r).trim();(o||!s)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function dv(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function gC(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function fv(e){return e.join(" ").trim()}const f8=/[ \t\n\f\r]/g;function wp(e){return typeof e=="object"?e.type==="text"?_C(e.value):!1:_C(e)}function _C(e){return e.replace(f8,"")===""}const ln=lR(1),oR=lR(-1),p8=[];function lR(e){return t;function t(n,r,i){const s=n?n.children:p8;let o=(r||0)+e,u=s[o];if(!i)for(;u&&wp(u);)o+=e,u=s[o];return u}}const m8={}.hasOwnProperty;function uR(e){return t;function t(n,r,i){return m8.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const pv=uR({body:_8,caption:$0,colgroup:$0,dd:S8,dt:y8,head:$0,html:g8,li:v8,optgroup:E8,option:x8,p:b8,rp:bC,rt:bC,tbody:C8,td:vC,tfoot:T8,th:vC,thead:w8,tr:k8});function $0(e,t,n){const r=ln(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&wp(r.value.charAt(0)))}function g8(e,t,n){const r=ln(n,t);return!r||r.type!=="comment"}function _8(e,t,n){const r=ln(n,t);return!r||r.type!=="comment"}function b8(e,t,n){const r=ln(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function v8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&r.tagName==="li"}function y8(e,t,n){const r=ln(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function S8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function bC(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function E8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function x8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function w8(e,t,n){const r=ln(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function C8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function T8(e,t,n){return!ln(n,t)}function k8(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function vC(e,t,n){const r=ln(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const A8=uR({body:L8,colgroup:O8,head:N8,html:R8,tbody:D8});function R8(e){const t=ln(e,-1);return!t||t.type!=="comment"}function N8(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function L8(e){const t=ln(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&wp(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function O8(e,t,n){const r=oR(n,t),i=ln(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&pv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function D8(e,t,n){const r=oR(n,t),i=ln(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&pv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const $d={name:[[`
|
|
13
13
|
\f\r &/=>`.split(""),`
|
|
14
14
|
\f\r "&'/=>\``.split("")],[`\0
|
|
15
15
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -17,10 +17,10 @@ Error generating stack: `+f.message+`
|
|
|
17
17
|
\f\r &>`.split(""),`\0
|
|
18
18
|
\f\r "&'<=>\``.split("")],[`\0
|
|
19
19
|
\f\r "&'<=>\``.split(""),`\0
|
|
20
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function M8(e,t,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const u=[];let c;i.space==="html"&&e.tagName==="svg"&&(r.schema=wi);const d=I8(r,e.properties),p=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,p&&(o=!1),(d||!s||!A8(e,t,n))&&(u.push("<",e.tagName,d?" "+d:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(c=d.charAt(d.length-1),(!r.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&u.push(" "),u.push("/")),u.push(">")),u.push(p),!o&&(!s||!pv(e,t,n))&&u.push("</"+e.tagName+">"),u.join("")}function I8(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=P8(e,i,t[i]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function P8(e,t,n){const r=rh(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let o=e.quote,u;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=_l(r.attribute,Object.assign({},e.settings.characterReferences,{subset:$d.name[i][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?dv:fv)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(u=_l(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:$d.unquoted[i][s]}))),u!==n&&(e.settings.quoteSmart&&Gf(n,o)>Gf(n,e.alternative)&&(o=e.alternative),u=o+_l(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?$d.single:$d.double)[i][s],attribute:!0}))+o),c+(u&&"="+u))}const B8=["<","&"];function c3(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:_l(e.value,Object.assign({},r.settings.characterReferences,{subset:B8}))}function H8(e,t,n,r){return r.settings.allowDangerousHtml?e.value:c3(e,t,n,r)}function F8(e,t,n,r){return r.all(e)}const j8=hv("type",{invalid:z8,unknown:U8,handlers:{comment:h8,doctype:d8,element:M8,raw:H8,root:F8,text:c3}});function z8(e){throw new Error("Expected node, not `"+e+"`")}function U8(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const $8={},V8={},q8=[];function rs(e,t){const n=t||$8,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:W8,all:G8,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ZA,characterReferences:n.characterReferences||V8,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?wi:Bl,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function W8(e,t,n){return j8(e,t,n,this)}function G8(e){const t=[],n=e&&e.children||q8;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function Yf(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function Js(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Y8(e){return Array.isArray(e)?e:[e]}async function h3(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function mv(e){return!e||["plaintext","txt","text","plain"].includes(e)}function d3(e){return e==="ansi"||mv(e)}function gv(e){return e==="none"}function f3(e){return gv(e)}function p3(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function Cp(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let s=0;s<n.length;s+=2){const o=t?n[s]+(n[s+1]||""):n[s];i.push([o,r]),r+=n[s].length,r+=n[s+1]?.length||0}return i}function K8(e){const t=Cp(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let s=i,o=0;for(const u of t){if(s<u.length)break;s-=u.length,o++}return{line:o,character:s}}function r(i,s){let o=0;for(let u=0;u<i;u++)o+=t[u].length;return o+=s,o}return{lines:t,indexToPos:n,posToIndex:r}}const _v="light-dark()",Q8=["color","background-color"];function X8(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Z8(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,u)=>o-u);return s.length?X8(i,s):i})):e}function J8(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(p=>Kf(e.variants[p])),u=new Set(o.flatMap(p=>Object.keys(p))),c={},d=(p,m)=>{const g=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":g)};return o.forEach((p,m)=>{for(const g of u){const _=p[g]||"inherit";if(m===0&&r&&Q8.includes(g))if(r===_v&&o.length>1){const v=t.findIndex(A=>A==="light"),x=t.findIndex(A=>A==="dark");if(v===-1||x===-1)throw new Kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=o[v][g]||"inherit",w=o[x][g]||"inherit";c[g]=`light-dark(${C}, ${w})`,i==="css-vars"&&(c[d(m,g)]=_)}else c[g]=_;else i==="css-vars"&&(c[d(m,g)]=_)}}),s.htmlStyle=c,s}function Kf(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Dn.Italic&&(t["font-style"]="italic"),e.fontStyle&Dn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Dn.Underline&&n.push("underline"),e.fontStyle&Dn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function kb(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const m3=new WeakMap;function Tp(e,t){m3.set(e,t)}function Fc(e){return m3.get(e)}class Hl{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Hl(Object.fromEntries(Y8(n).map(r=>[r,xb])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return eP(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function eP(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const s=i?.nameScopesList?.scopeName;s&&t.push(s),i.parent&&r(i.parent)}return r(e),t}function tP(e,t){if(!(e instanceof Hl))throw new Kt("Invalid grammar state");return e.getInternalStack(t)}function nP(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Kt(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const u=i.lines[o.line];if(u===void 0)throw new Kt(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let c=o.character;if(c<0&&(c=u.length+c),c<0||c>u.length)throw new Kt(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${u.length}`);return{...o,character:c,offset:i.posToIndex(o.line,c)}}};const i=K8(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));rP(s),e.set(n.meta,{decorations:s,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const i=t(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return Z8(n,i)},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(i.length!==r.converter.lines.length)throw new Kt(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(p,m,g,_){const v=i[p];let x="",C=-1,w=-1;if(m===0&&(C=0),g===0&&(w=0),g===Number.POSITIVE_INFINITY&&(w=v.children.length),C===-1||w===-1)for(let R=0;R<v.children.length;R++)x+=g3(v.children[R]),C===-1&&x.length===m&&(C=R+1),w===-1&&x.length===g&&(w=R+1);if(C===-1)throw new Kt(`Failed to find start index for decoration ${JSON.stringify(_.start)}`);if(w===-1)throw new Kt(`Failed to find end index for decoration ${JSON.stringify(_.end)}`);const A=v.children.slice(C,w);if(!_.alwaysWrap&&A.length===v.children.length)u(v,_,"line");else if(!_.alwaysWrap&&A.length===1&&A[0].type==="element")u(A[0],_,"token");else{const R={type:"element",tagName:"span",properties:{},children:A};u(R,_,"wrapper"),v.children.splice(C,A.length,R)}}function o(p,m){i[p]=u(i[p],m,"line")}function u(p,m,g){const _=m.properties||{},v=m.transform||(x=>x);return p.tagName=m.tagName||"span",p.properties={...p.properties,..._,class:p.properties.class},m.properties?.class&&p3(p,m.properties.class),p=v(p,g)||p,p}const c=[],d=r.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of d){const{start:m,end:g}=p;if(m.line===g.line)s(m.line,m.character,g.character,p);else if(m.line<g.line){s(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let _=m.line+1;_<g.line;_++)c.unshift(()=>o(_,p));s(g.line,0,g.character,p)}}c.forEach(p=>p())}}}function rP(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Kt(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],s=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,u=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,c=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(s||o||u||c){if(s&&o||u&&c||u&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new Kt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function g3(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(g3).join(""):""}const iP=[nP()];function Qf(e){const t=sP(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...iP]}function sP(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Pa=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],V0={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function aP(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function yC(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function oP(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)V0[r]&&t.push({type:"setDecoration",value:V0[r]});else if(r<=29){const i=V0[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Pa[r-30]}});else if(r===38){const i=yC(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Pa[r-40]}});else if(r===48){const i=yC(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Pa[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Pa[r-100+8]}})}return t}function lP(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=aP(r,s),u=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(u.length>0&&i.push({value:u,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const c=oP(o.sequence);for(const d of c)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of c)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}s=o.position}while(s<r.length);return i}}}var uP={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function cP(e=uP){function t(u){return e[u]}function n(u){return`#${u.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let d=0;d<Pa.length;d++)r.push(t(Pa[d]));let u=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)r.push(n([u[d],u[p],u[m]]));let c=8;for(let d=0;d<24;d++,c+=10)r.push(n([c,c,c]));return r}function s(u){return i()[u]}function o(u){switch(u.type){case"named":return t(u.name);case"rgb":return n(u.rgb);case"table":return s(u.index)}}return{value:o}}const hP={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function dP(e,t,n){const r=Yf(e,n),i=Cp(t),s=Object.fromEntries(Pa.map(c=>{const d=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`,p=e.colors?.[d];return[c,p||hP[c]]})),o=cP(s),u=lP();return i.map(c=>u.parse(c[0]).map(d=>{let p,m;d.decorations.has("reverse")?(p=d.background?o.value(d.background):e.bg,m=d.foreground?o.value(d.foreground):e.fg):(p=d.foreground?o.value(d.foreground):e.fg,m=d.background?o.value(d.background):void 0),p=Js(p,r),m=Js(m,r),d.decorations.has("dim")&&(p=fP(p));let g=Dn.None;return d.decorations.has("bold")&&(g|=Dn.Bold),d.decorations.has("italic")&&(g|=Dn.Italic),d.decorations.has("underline")&&(g|=Dn.Underline),d.decorations.has("strikethrough")&&(g|=Dn.Strikethrough),{content:d.value,offset:c[1],color:p,bgColor:m,fontStyle:g}}))}function fP(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],s=r[1],o=r[2],u=r[3],c=Math.round(Number.parseInt(`${u}${u}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${s}${s}${o}${o}${c}`}else if(r.length===3){const i=r[0],s=r[1],o=r[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function bv(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(mv(i)||gv(r))return Cp(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:s,colorMap:o}=e.setTheme(r);if(i==="ansi")return dP(s,t,n);const u=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==u.name)throw new Kt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${u.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Kt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return mP(t,u,s,o,n)}function pP(...e){if(e.length===2)return Fc(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(mv(i)||gv(s))throw new Kt("Plain language does not have grammar state");if(i==="ansi")throw new Kt("ANSI language does not have grammar state");const{theme:o,colorMap:u}=t.setTheme(s),c=t.getLanguage(i);return new Hl(Xf(n,c,o,u,r).stateStack,c.name,o.name)}function mP(e,t,n,r,i){const s=Xf(e,t,n,r,i),o=new Hl(Xf(e,t,n,r,i).stateStack,t.name,n.name);return Tp(s.tokens,o),s.tokens}function Xf(e,t,n,r,i){const s=Yf(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:u=500}=i,c=Cp(e);let d=i.grammarState?tP(i.grammarState,n.name)??xb:i.grammarContextCode!=null?Xf(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:xb,p=[];const m=[];for(let g=0,_=c.length;g<_;g++){const[v,x]=c[g];if(v===""){p=[],m.push([]);continue}if(o>0&&v.length>=o){p=[],m.push([{content:v,offset:x,color:"",fontStyle:0}]);continue}let C,w,A;i.includeExplanation&&(C=t.tokenizeLine(v,d,u),w=C.tokens,A=0);const R=t.tokenizeLine2(v,d,u),N=R.tokens.length/2;for(let L=0;L<N;L++){const I=R.tokens[2*L],P=L+1<N?R.tokens[2*L+2]:v.length;if(I===P)continue;const q=R.tokens[2*L+1],ee=Js(r[wl.getForeground(q)],s),F=wl.getFontStyle(q),J={content:v.substring(I,P),offset:x+I,color:ee,fontStyle:F};if(i.includeExplanation){const B=[];if(i.includeExplanation!=="scopeName")for(const Y of n.settings){let X;switch(typeof Y.scope){case"string":X=Y.scope.split(/,/).map(M=>M.trim());break;case"object":X=Y.scope;break;default:continue}B.push({settings:Y,selectors:X.map(M=>M.split(/ /))})}J.explanation=[];let V=0;for(;I+V<P;){const Y=w[A],X=v.substring(Y.startIndex,Y.endIndex);V+=X.length,J.explanation.push({content:X,scopes:i.includeExplanation==="scopeName"?gP(Y.scopes):_P(B,Y.scopes)}),A+=1}}p.push(J)}m.push(p),p=[],d=R.ruleStack}return{tokens:m,stateStack:d}}function gP(e){return e.map(t=>({scopeName:t}))}function _P(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];n[r]={scopeName:s,themeMatches:vP(e,s,t.slice(0,r))}}return n}function SC(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function bP(e,t,n){if(!SC(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)SC(e[r],n[i])&&(r-=1),i-=1;return r===-1}function vP(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const o of i)if(bP(o,t,n)){r.push(s);break}return r}function _3(e,t,n){const r=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),i=r.map(c=>{const d=bv(e,t,{...n,theme:c.theme}),p=Fc(d),m=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:d,state:p,theme:m}}),s=yP(...i.map(c=>c.tokens)),o=s[0].map((c,d)=>c.map((p,m)=>{const g={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=p.explanation),s.forEach((_,v)=>{const{content:x,explanation:C,offset:w,...A}=_[d][m];g.variants[r[v].color]=A}),g})),u=i[0].state?new Hl(Object.fromEntries(i.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),i[0].state.lang):void 0;return u&&Tp(o,u),o}function yP(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(c=>c[r]),s=t.map(()=>[]);t.forEach((c,d)=>c.push(s[d]));const o=i.map(()=>0),u=i.map(c=>c[0]);for(;u.every(c=>c);){const c=Math.min(...u.map(d=>d.content.length));for(let d=0;d<n;d++){const p=u[d];p.content.length===c?(s[d].push(p),o[d]+=1,u[d]=i[d][o[d]]):(s[d].push({...p,content:p.content.slice(0,c)}),u[d]={...p,content:p.content.slice(c),offset:p.offset+c})}}}return t}function Zf(e,t,n){let r,i,s,o,u,c;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,g=Object.entries(n.themes).filter(w=>w[1]).map(w=>({color:w[0],theme:w[1]})).sort((w,A)=>w.color===d?-1:A.color===d?1:0);if(g.length===0)throw new Kt("`themes` option must not be empty");const _=_3(e,t,n);if(c=Fc(_),d&&_v!==d&&!g.find(w=>w.color===d))throw new Kt(`\`themes\` option must contain the defaultColor key \`${d}\``);const v=g.map(w=>e.getTheme(w.theme)),x=g.map(w=>w.color);s=_.map(w=>w.map(A=>J8(A,x,p,d,m))),c&&Tp(s,c);const C=g.map(w=>Yf(w.theme,n));i=EC(g,v,C,p,d,"fg",m),r=EC(g,v,C,p,d,"bg",m),o=`shiki-themes ${v.map(w=>w.name).join(" ")}`,u=d?void 0:[i,r].join(";")}else if("theme"in n){const d=Yf(n.theme,n);s=bv(e,t,n);const p=e.getTheme(n.theme);r=Js(p.bg,d),i=Js(p.fg,d),o=p.name,c=Fc(s)}else throw new Kt("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:u,grammarState:c}}function EC(e,t,n,r,i,s,o){return e.map((u,c)=>{const d=Js(t[c][s],n[c])||"inherit",p=`${r+u.color}${s==="bg"?"-bg":""}:${d}`;if(c===0&&i){if(i===_v&&e.length>1){const m=e.findIndex(x=>x.color==="light"),g=e.findIndex(x=>x.color==="dark");if(m===-1||g===-1)throw new Kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const _=Js(t[m][s],n[m])||"inherit",v=Js(t[g][s],n[g])||"inherit";return`light-dark(${_}, ${v});${p}`}return d}return o==="css-vars"?p:null}).filter(u=>!!u).join(";")}function Jf(e,t,n,r={meta:{},options:n,codeToHast:(i,s)=>Jf(e,i,s),codeToTokens:(i,s)=>Zf(e,i,s)}){let i=t;for(const v of Qf(n))i=v.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:u,themeName:c,rootStyle:d,grammarState:p}=Zf(e,i,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:g=!1}=n;m===!0?s=EP(s):m==="never"&&(s=xP(s)),g&&(s=wP(s));const _={...r,get source(){return i}};for(const v of Qf(n))s=v.tokens?.call(_,s)||s;return SP(s,{...n,fg:o,bg:u,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},_,p)}function SP(e,t,n,r=Fc(e)){const i=Qf(t),s=[],o={type:"root",children:[]},{structure:u="classic",tabindex:c="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),c!==!1&&c!=null&&(d.tabindex=c.toString());for(const[x,C]of Object.entries(t.meta||{}))x.startsWith("_")||(d[x]=C);let p={type:"element",tagName:"pre",properties:d,children:[]},m={type:"element",tagName:"code",properties:{},children:s};const g=[],_={...n,structure:u,addClassToHast:p3,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return p},get code(){return m},get lines(){return g}};if(e.forEach((x,C)=>{C&&(u==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):u==="classic"&&s.push({type:"text",value:`
|
|
21
|
-
`}));let w={type:"element",tagName:"span",properties:{class:"line"},children:[]},A=0;for(const R of x){let N={type:"element",tagName:"span",properties:{...R.htmlAttrs},children:[{type:"text",value:R.content}]};const L=kb(R.htmlStyle||Kf(R));L&&(N.properties.style=L);for(const I of i)N=I?.span?.call(_,N,C+1,A,w,R)||N;u==="inline"?o.children.push(N):u==="classic"&&w.children.push(N),A+=R.content.length}if(u==="classic"){for(const R of i)w=R?.line?.call(_,w,C+1)||w;g.push(w),s.push(w)}else u==="inline"&&g.push(w)}),u==="classic"){for(const x of i)m=x?.code?.call(_,m)||m;p.children.push(m);for(const x of i)p=x?.pre?.call(_,p)||p;o.children.push(p)}else if(u==="inline"){const x=[];let C={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const R of o.children)R.type==="element"&&R.tagName==="br"?(x.push(C),C={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(R.type==="element"||R.type==="text")&&C.children.push(R);x.push(C);let A={type:"element",tagName:"code",properties:{},children:x};for(const R of i)A=R?.code?.call(_,A)||A;o.children=[];for(let R=0;R<A.children.length;R++){R>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const N=A.children[R];N.type==="element"&&o.children.push(...N.children)}}let v=o;for(const x of i)v=x?.root?.call(_,v)||v;return r&&Tp(v,r),v}function EP(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((s,o)=>{const c=!(s.fontStyle&&(s.fontStyle&Dn.Underline||s.fontStyle&Dn.Strikethrough));c&&s.content.match(/^\s+$/)&&t[o+1]?(i===void 0&&(i=s.offset),r+=s.content):r?(c?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=void 0,r=""):n.push(s)}),n})}function xP(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const u=[{...n,offset:n.offset+i.length,content:s}];return i&&u.unshift({content:i,offset:n.offset}),o&&u.push({content:o,offset:n.offset+i.length+s.length}),u}))}function wP(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],s=kb(i.htmlStyle||Kf(i)),o=kb(r.htmlStyle||Kf(r)),u=i.fontStyle&&(i.fontStyle&Dn.Underline||i.fontStyle&Dn.Strikethrough),c=r.fontStyle&&(r.fontStyle&Dn.Underline||r.fontStyle&Dn.Strikethrough);!u&&!c&&s===o?i.content+=r.content:n.push({...r})}return n})}const CP=rs;function TP(e,t,n){const r={meta:{},options:n,codeToHast:(s,o)=>Jf(e,s,o),codeToTokens:(s,o)=>Zf(e,s,o)};let i=CP(Jf(e,t,n,r));for(const s of Qf(n))i=s.postprocess?.call(r,i,n)||i;return i}const xC={light:"#333333",dark:"#bbbbbb"},wC={light:"#fffffe",dark:"#1e1e1e"},CC="__shiki_resolved";function kp(e){if(e?.[CC])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const u=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;u?.settings?.foreground&&(r=u.settings.foreground),u?.settings?.background&&(n=u.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?xC.light:xC.dark),n||(n=t.type==="light"?wC.light:wC.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(u){if(s.has(u))return s.get(u);i+=1;const c=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?o(u):(s.set(u,c),c)}t.settings=t.settings.map(u=>{const c=u.settings?.foreground&&!u.settings.foreground.startsWith("#"),d=u.settings?.background&&!u.settings.background.startsWith("#");if(!c&&!d)return u;const p={...u,settings:{...u.settings}};if(c){const m=o(u.settings.foreground);t.colorReplacements[m]=u.settings.foreground,p.settings.foreground=m}if(d){const m=o(u.settings.background);t.colorReplacements[m]=u.settings.background,p.settings.background=m}return p});for(const u of Object.keys(t.colors||{}))if((u==="editor.foreground"||u==="editor.background"||u.startsWith("terminal.ansi"))&&!t.colors[u]?.startsWith("#")){const c=o(t.colors[u]);t.colorReplacements[c]=t.colors[u],t.colors[u]=c}return Object.defineProperty(t,CC,{enumerable:!1,writable:!1,value:!0}),t}async function b3(e){return Array.from(new Set((await Promise.all(e.filter(t=>!d3(t)).map(async t=>await h3(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function v3(e){return(await Promise.all(e.map(async n=>f3(n)?null:kp(await h3(n))))).filter(n=>!!n)}let kP=3;function AP(e,t=3){t>kP||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let fl=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function y3(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new fl(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class RP extends B4{constructor(t,n,r,i={}){super(t),this._resolver=t,this._themes=n,this._langs=r,this._alias=i,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=kp(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=Uf.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=y3(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const r={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const i=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(i.name=t.name,this._resolvedGrammars.set(t.name,i),t.aliases&&t.aliases.forEach(s=>{this._alias[s]=t.name}),this._loadedLanguagesCache=null,n.size)for(const s of n)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const i of t)this.resolveEmbeddedLanguages(i);const n=Array.from(this._langGraph.entries()),r=n.filter(([i,s])=>!s);if(r.length){const i=n.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(c=>r.map(([d])=>d).includes(c)):!1).filter(s=>!r.includes(s));throw new fl(`Missing languages ${r.map(([s])=>`\`${s}\``).join(", ")}, required by ${i.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[i,s]of n)this._resolver.addLanguage(s);for(const[i,s]of n)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class NP{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let i=1;i<=n.length;i++){const s=n.slice(0,i).join(".");r=[...r,...this._injections.get(s)||[]]}return r}}let qu=0;function LP(e){qu+=1,e.warnings!==!1&&qu>=10&&qu%10===0&&console.warn(`[Shiki] ${qu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new fl("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(kp),i=new NP(e.engine,n),s=new RP(i,r,n,e.langAlias);let o;function u(R){return y3(R,e.langAlias)}function c(R){w();const N=s.getGrammar(typeof R=="string"?R:R.name);if(!N)throw new fl(`Language \`${R}\` not found, you may need to load it first`);return N}function d(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const N=s.getTheme(R);if(!N)throw new fl(`Theme \`${R}\` not found, you may need to load it first`);return N}function p(R){w();const N=d(R);o!==R&&(s.setTheme(N),o=R);const L=s.getColorMap();return{theme:N,colorMap:L}}function m(){return w(),s.getLoadedThemes()}function g(){return w(),s.getLoadedLanguages()}function _(...R){w(),s.loadLanguages(R.flat(1))}async function v(...R){return _(await b3(R))}function x(...R){w();for(const N of R.flat(1))s.loadTheme(N)}async function C(...R){return w(),x(await v3(R))}function w(){if(t)throw new fl("Shiki instance has been disposed")}function A(){t||(t=!0,s.dispose(),qu-=1)}return{setTheme:p,getTheme:d,getLanguage:c,getLoadedThemes:m,getLoadedLanguages:g,resolveLangAlias:u,loadLanguage:v,loadLanguageSync:_,loadTheme:C,loadThemeSync:x,dispose:A,[Symbol.dispose]:A}}async function OP(e){e.engine||AP("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([v3(e.themes||[]),b3(e.langs||[]),e.engine]);return LP({...e,themes:t,langs:n,engine:r})}async function DP(e){const t=await OP(e);return{getLastGrammarState:(...n)=>pP(t,...n),codeToTokensBase:(n,r)=>bv(t,n,r),codeToTokensWithThemes:(n,r)=>_3(t,n,r),codeToTokens:(n,r)=>Zf(t,n,r),codeToHast:(n,r)=>Jf(t,n,r),codeToHtml:(n,r)=>TP(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function MP(e){const t=e.langs,n=e.themes,r=e.engine;async function i(s){function o(m){if(typeof m=="string"){if(m=s.langAlias?.[m]||m,d3(m))return[];const g=t[m];if(!g)throw new Kt(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return g}return m}function u(m){if(f3(m))return"none";if(typeof m=="string"){const g=n[m];if(!g)throw new Kt(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return g}return m}const c=(s.themes??[]).map(m=>u(m)),d=(s.langs??[]).map(m=>o(m)),p=await DP({engine:s.engine??r(),...s,themes:c,langs:d});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(o))},loadTheme(...m){return p.loadTheme(...m.map(u))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const S3=[{id:"abap",name:"ABAP",import:(()=>j(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>j(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>j(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>j(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>j(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>j(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>j(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>j(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>j(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>j(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>j(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>j(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>j(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>j(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>j(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>j(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>j(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>j(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>j(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>j(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>j(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>j(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>j(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>j(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>j(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>j(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>j(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>j(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>j(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>j(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>j(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>j(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>j(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>j(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>j(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>j(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>j(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>j(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>j(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>j(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>j(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>j(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>j(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>j(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>j(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>j(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>j(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>j(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>j(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>j(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>j(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>j(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>j(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>j(()=>import("./erb-BOJIQeun.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>j(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>j(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>j(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>j(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>j(()=>import("./fortran-fixed-form-BZjJHVRy.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>j(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>j(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>j(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>j(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>j(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>j(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>j(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>j(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>j(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>j(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>j(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>j(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>j(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>j(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>j(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>j(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>j(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>j(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>j(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>j(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>j(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>j(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>j(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>j(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>j(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>j(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>j(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>j(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>j(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>j(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>j(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>j(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>j(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>j(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>j(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>j(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>j(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>j(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>j(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>j(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>j(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>j(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>j(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>j(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>j(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>j(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>j(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>j(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>j(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>j(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>j(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>j(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>j(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>j(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>j(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>j(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>j(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>j(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>j(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>j(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>j(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>j(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>j(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>j(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>j(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>j(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>j(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>j(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>j(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>j(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>j(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>j(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>j(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>j(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>j(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>j(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>j(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>j(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>j(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>j(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>j(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>j(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>j(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>j(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>j(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>j(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>j(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>j(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>j(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>j(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>j(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>j(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>j(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>j(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>j(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>j(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>j(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>j(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>j(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>j(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>j(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>j(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>j(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>j(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>j(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>j(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>j(()=>import("./rst-B0xPkSld.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>j(()=>import("./ruby-BvKwtOVI.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>j(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>j(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>j(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>j(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>j(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>j(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>j(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>j(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>j(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>j(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>j(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>j(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>j(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>j(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>j(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>j(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>j(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>j(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>j(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>j(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>j(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>j(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>j(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>j(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>j(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>j(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>j(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>j(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>j(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>j(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>j(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>j(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>j(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>j(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>j(()=>import("./twig-CO9l9SDP.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>j(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>j(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>j(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>j(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>j(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>j(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>j(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>j(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>j(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>j(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>j(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>j(()=>import("./vue-vine-8moa0y9V.js"),__vite__mapDeps([94,3,5,67,95,12,92,2,11,9,15,1])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>j(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>j(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>j(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>j(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>j(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>j(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>j(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>j(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>j(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>j(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>j(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>j(()=>import("./zig-VOosw3JB.js"),[]))}],IP=Object.fromEntries(S3.map(e=>[e.id,e.import])),PP=Object.fromEntries(S3.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),E3={...IP,...PP},BP=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>j(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>j(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>j(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>j(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>j(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>j(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>j(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>j(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>j(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>j(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>j(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>j(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>j(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>j(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>j(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>j(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>j(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>j(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>j(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>j(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>j(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>j(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>j(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>j(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>j(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>j(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>j(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>j(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>j(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>j(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>j(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>j(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>j(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>j(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>j(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>j(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>j(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>j(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>j(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>j(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>j(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>j(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>j(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>j(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>j(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>j(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>j(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>j(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>j(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>j(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>j(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>j(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>j(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>j(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>j(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>j(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>j(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],x3=Object.fromEntries(BP.map(e=>[e.id,e.import]));class vv extends Error{constructor(t){super(t),this.name="ShikiError"}}function HP(){return 2147483648}function FP(){return typeof performance<"u"?performance.now():Date.now()}const jP=(e,t)=>e+(t-e%t)%t;async function zP(e){let t,n;const r={};function i(_){n=_,r.HEAPU8=new Uint8Array(_),r.HEAPU32=new Uint32Array(_)}function s(_,v,x){r.HEAPU8.copyWithin(_,v,v+x)}function o(_){try{return t.grow(_-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function u(_){const v=r.HEAPU8.length;_=_>>>0;const x=HP();if(_>x)return!1;for(let C=1;C<=4;C*=2){let w=v*(1+.2/C);w=Math.min(w,_+100663296);const A=Math.min(x,jP(Math.max(_,w),65536));if(o(A))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(_,v,x=1024){const C=v+x;let w=v;for(;_[w]&&!(w>=C);)++w;if(w-v>16&&_.buffer&&c)return c.decode(_.subarray(v,w));let A="";for(;v<w;){let R=_[v++];if(!(R&128)){A+=String.fromCharCode(R);continue}const N=_[v++]&63;if((R&224)===192){A+=String.fromCharCode((R&31)<<6|N);continue}const L=_[v++]&63;if((R&240)===224?R=(R&15)<<12|N<<6|L:R=(R&7)<<18|N<<12|L<<6|_[v++]&63,R<65536)A+=String.fromCharCode(R);else{const I=R-65536;A+=String.fromCharCode(55296|I>>10,56320|I&1023)}}return A}function p(_,v){return _?d(r.HEAPU8,_,v):""}const m={emscripten_get_now:FP,emscripten_memcpy_big:s,emscripten_resize_heap:u,fd_write:()=>0};async function g(){const v=await e({env:m,wasi_snapshot_preview1:m});t=v.memory,i(t.buffer),Object.assign(r,v),r.UTF8ToString=p}return await g(),r}var UP=Object.defineProperty,$P=(e,t,n)=>t in e?UP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nn=(e,t,n)=>$P(e,typeof t!="symbol"?t+"":t,n);let dn=null;function VP(e){throw new vv(e.UTF8ToString(e.getLastOnigError()))}class Ap{constructor(t){nn(this,"utf16Length"),nn(this,"utf8Length"),nn(this,"utf16Value"),nn(this,"utf8Value"),nn(this,"utf16OffsetToUtf8"),nn(this,"utf8OffsetToUtf16");const n=t.length,r=Ap._utf8ByteLength(t),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const u=new Uint8Array(r);let c=0;for(let d=0;d<n;d++){const p=t.charCodeAt(d);let m=p,g=!1;if(p>=55296&&p<=56319&&d+1<n){const _=t.charCodeAt(d+1);_>=56320&&_<=57343&&(m=(p-55296<<10)+65536|_-56320,g=!0)}i&&(s[d]=c,g&&(s[d+1]=c),m<=127?o[c+0]=d:m<=2047?(o[c+0]=d,o[c+1]=d):m<=65535?(o[c+0]=d,o[c+1]=d,o[c+2]=d):(o[c+0]=d,o[c+1]=d,o[c+2]=d,o[c+3]=d)),m<=127?u[c++]=m:m<=2047?(u[c++]=192|(m&1984)>>>6,u[c++]=128|(m&63)>>>0):m<=65535?(u[c++]=224|(m&61440)>>>12,u[c++]=128|(m&4032)>>>6,u[c++]=128|(m&63)>>>0):(u[c++]=240|(m&1835008)>>>18,u[c++]=128|(m&258048)>>>12,u[c++]=128|(m&4032)>>>6,u[c++]=128|(m&63)>>>0),g&&d++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=u,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const s=t.charCodeAt(r);let o=s,u=!1;if(s>=55296&&s<=56319&&r+1<i){const c=t.charCodeAt(r+1);c>=56320&&c<=57343&&(o=(s-55296<<10)+65536|c-56320,u=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,u&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Rp=class hi{constructor(t){if(nn(this,"id",++hi.LAST_ID),nn(this,"_onigBinding"),nn(this,"content"),nn(this,"utf16Length"),nn(this,"utf8Length"),nn(this,"utf16OffsetToUtf8"),nn(this,"utf8OffsetToUtf16"),nn(this,"ptr"),!dn)throw new vv("Must invoke loadWasm first.");this._onigBinding=dn,this.content=t;const n=new Ap(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!hi._sharedPtrInUse?(hi._sharedPtr||(hi._sharedPtr=dn.omalloc(1e4)),hi._sharedPtrInUse=!0,dn.HEAPU8.set(n.utf8Value,hi._sharedPtr),this.ptr=hi._sharedPtr):this.ptr=n.createString(dn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===hi._sharedPtr?hi._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};nn(Rp,"LAST_ID",0);nn(Rp,"_sharedPtr",0);nn(Rp,"_sharedPtrInUse",!1);let w3=Rp;class qP{constructor(t){if(nn(this,"_onigBinding"),nn(this,"_ptr"),!dn)throw new vv("Must invoke loadWasm first.");const n=[],r=[];for(let u=0,c=t.length;u<c;u++){const d=new Ap(t[u]);n[u]=d.createString(dn),r[u]=d.utf8Length}const i=dn.omalloc(4*t.length);dn.HEAPU32.set(n,i/4);const s=dn.omalloc(4*t.length);dn.HEAPU32.set(r,s/4);const o=dn.createOnigScanner(i,s,t.length);for(let u=0,c=t.length;u<c;u++)dn.ofree(n[u]);dn.ofree(s),dn.ofree(i),o===0&&VP(dn),this._onigBinding=dn,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new w3(t);const s=this._findNextMatchSync(t,n,!1,i);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const s=this._onigBinding,o=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(o===0)return null;const u=s.HEAPU32;let c=o/4;const d=u[c++],p=u[c++],m=[];for(let g=0;g<p;g++){const _=t.convertUtf8OffsetToUtf16(u[c++]),v=t.convertUtf8OffsetToUtf16(u[c++]);m[g]={start:_,end:v,length:v-_}}return{index:d,captureIndices:m}}}function WP(e){return typeof e.instantiator=="function"}function GP(e){return typeof e.default=="function"}function YP(e){return typeof e.data<"u"}function KP(e){return typeof Response<"u"&&e instanceof Response}function QP(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Vd;function XP(e){if(Vd)return Vd;async function t(){dn=await zP(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),WP(r)?r=await r.instantiator(n):GP(r)?r=await r.default(n):(YP(r)&&(r=r.data),KP(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await ZP(r)(n):r=await JP(r)(n):QP(r)?r=await q0(r)(n):r instanceof WebAssembly.Module?r=await q0(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await q0(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Vd=t(),Vd}function q0(e){return t=>WebAssembly.instantiate(e,t)}function ZP(e){return t=>WebAssembly.instantiateStreaming(e,t)}function JP(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function eB(e){return e&&await XP(e),{createScanner(t){return new qP(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new w3(t)}}}const tB=MP({langs:E3,themes:x3,engine:()=>eB(j(()=>import("./wasm-CG6Dc4jp.js"),[]))});function Fl(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function nB(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const yv=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),_n=String.raw;function jl(e,t){if(e==null)throw new Error(t??"Value expected");return e}const C3=_n`\[\^?`,T3=`c.? | C(?:-.?)?|${_n`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${_n`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${_n`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${_n`o\{[^\}]*\}?`}|${_n`\d{1,3}`}`,Sv=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,qd=new RegExp(_n`
|
|
20
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function M8(e,t,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const u=[];let c;i.space==="html"&&e.tagName==="svg"&&(r.schema=wi);const d=I8(r,e.properties),p=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,p&&(o=!1),(d||!s||!A8(e,t,n))&&(u.push("<",e.tagName,d?" "+d:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(c=d.charAt(d.length-1),(!r.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&u.push(" "),u.push("/")),u.push(">")),u.push(p),!o&&(!s||!pv(e,t,n))&&u.push("</"+e.tagName+">"),u.join("")}function I8(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=P8(e,i,t[i]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function P8(e,t,n){const r=rh(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let o=e.quote,u;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=_l(r.attribute,Object.assign({},e.settings.characterReferences,{subset:$d.name[i][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?dv:fv)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(u=_l(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:$d.unquoted[i][s]}))),u!==n&&(e.settings.quoteSmart&&Gf(n,o)>Gf(n,e.alternative)&&(o=e.alternative),u=o+_l(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?$d.single:$d.double)[i][s],attribute:!0}))+o),c+(u&&"="+u))}const B8=["<","&"];function cR(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:_l(e.value,Object.assign({},r.settings.characterReferences,{subset:B8}))}function H8(e,t,n,r){return r.settings.allowDangerousHtml?e.value:cR(e,t,n,r)}function F8(e,t,n,r){return r.all(e)}const j8=hv("type",{invalid:z8,unknown:U8,handlers:{comment:h8,doctype:d8,element:M8,raw:H8,root:F8,text:cR}});function z8(e){throw new Error("Expected node, not `"+e+"`")}function U8(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const $8={},V8={},q8=[];function rs(e,t){const n=t||$8,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:W8,all:G8,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ZA,characterReferences:n.characterReferences||V8,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?wi:Bl,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function W8(e,t,n){return j8(e,t,n,this)}function G8(e){const t=[],n=e&&e.children||q8;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function Yf(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function Js(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Y8(e){return Array.isArray(e)?e:[e]}async function hR(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function mv(e){return!e||["plaintext","txt","text","plain"].includes(e)}function dR(e){return e==="ansi"||mv(e)}function gv(e){return e==="none"}function fR(e){return gv(e)}function pR(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function Cp(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let s=0;s<n.length;s+=2){const o=t?n[s]+(n[s+1]||""):n[s];i.push([o,r]),r+=n[s].length,r+=n[s+1]?.length||0}return i}function K8(e){const t=Cp(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let s=i,o=0;for(const u of t){if(s<u.length)break;s-=u.length,o++}return{line:o,character:s}}function r(i,s){let o=0;for(let u=0;u<i;u++)o+=t[u].length;return o+=s,o}return{lines:t,indexToPos:n,posToIndex:r}}const _v="light-dark()",Q8=["color","background-color"];function X8(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Z8(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,u)=>o-u);return s.length?X8(i,s):i})):e}function J8(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(p=>Kf(e.variants[p])),u=new Set(o.flatMap(p=>Object.keys(p))),c={},d=(p,m)=>{const g=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":g)};return o.forEach((p,m)=>{for(const g of u){const _=p[g]||"inherit";if(m===0&&r&&Q8.includes(g))if(r===_v&&o.length>1){const v=t.findIndex(A=>A==="light"),x=t.findIndex(A=>A==="dark");if(v===-1||x===-1)throw new Kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=o[v][g]||"inherit",w=o[x][g]||"inherit";c[g]=`light-dark(${C}, ${w})`,i==="css-vars"&&(c[d(m,g)]=_)}else c[g]=_;else i==="css-vars"&&(c[d(m,g)]=_)}}),s.htmlStyle=c,s}function Kf(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Dn.Italic&&(t["font-style"]="italic"),e.fontStyle&Dn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Dn.Underline&&n.push("underline"),e.fontStyle&Dn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function kb(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const mR=new WeakMap;function Tp(e,t){mR.set(e,t)}function Fc(e){return mR.get(e)}class Hl{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Hl(Object.fromEntries(Y8(n).map(r=>[r,xb])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return eP(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function eP(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const s=i?.nameScopesList?.scopeName;s&&t.push(s),i.parent&&r(i.parent)}return r(e),t}function tP(e,t){if(!(e instanceof Hl))throw new Kt("Invalid grammar state");return e.getInternalStack(t)}function nP(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Kt(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const u=i.lines[o.line];if(u===void 0)throw new Kt(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let c=o.character;if(c<0&&(c=u.length+c),c<0||c>u.length)throw new Kt(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${u.length}`);return{...o,character:c,offset:i.posToIndex(o.line,c)}}};const i=K8(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));rP(s),e.set(n.meta,{decorations:s,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const i=t(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return Z8(n,i)},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(i.length!==r.converter.lines.length)throw new Kt(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(p,m,g,_){const v=i[p];let x="",C=-1,w=-1;if(m===0&&(C=0),g===0&&(w=0),g===Number.POSITIVE_INFINITY&&(w=v.children.length),C===-1||w===-1)for(let R=0;R<v.children.length;R++)x+=gR(v.children[R]),C===-1&&x.length===m&&(C=R+1),w===-1&&x.length===g&&(w=R+1);if(C===-1)throw new Kt(`Failed to find start index for decoration ${JSON.stringify(_.start)}`);if(w===-1)throw new Kt(`Failed to find end index for decoration ${JSON.stringify(_.end)}`);const A=v.children.slice(C,w);if(!_.alwaysWrap&&A.length===v.children.length)u(v,_,"line");else if(!_.alwaysWrap&&A.length===1&&A[0].type==="element")u(A[0],_,"token");else{const R={type:"element",tagName:"span",properties:{},children:A};u(R,_,"wrapper"),v.children.splice(C,A.length,R)}}function o(p,m){i[p]=u(i[p],m,"line")}function u(p,m,g){const _=m.properties||{},v=m.transform||(x=>x);return p.tagName=m.tagName||"span",p.properties={...p.properties,..._,class:p.properties.class},m.properties?.class&&pR(p,m.properties.class),p=v(p,g)||p,p}const c=[],d=r.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of d){const{start:m,end:g}=p;if(m.line===g.line)s(m.line,m.character,g.character,p);else if(m.line<g.line){s(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let _=m.line+1;_<g.line;_++)c.unshift(()=>o(_,p));s(g.line,0,g.character,p)}}c.forEach(p=>p())}}}function rP(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Kt(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],s=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,u=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,c=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(s||o||u||c){if(s&&o||u&&c||u&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new Kt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function gR(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(gR).join(""):""}const iP=[nP()];function Qf(e){const t=sP(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...iP]}function sP(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Pa=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],V0={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function aP(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function yC(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function oP(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)V0[r]&&t.push({type:"setDecoration",value:V0[r]});else if(r<=29){const i=V0[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Pa[r-30]}});else if(r===38){const i=yC(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Pa[r-40]}});else if(r===48){const i=yC(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Pa[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Pa[r-100+8]}})}return t}function lP(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=aP(r,s),u=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(u.length>0&&i.push({value:u,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const c=oP(o.sequence);for(const d of c)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of c)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}s=o.position}while(s<r.length);return i}}}var uP={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function cP(e=uP){function t(u){return e[u]}function n(u){return`#${u.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let d=0;d<Pa.length;d++)r.push(t(Pa[d]));let u=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)r.push(n([u[d],u[p],u[m]]));let c=8;for(let d=0;d<24;d++,c+=10)r.push(n([c,c,c]));return r}function s(u){return i()[u]}function o(u){switch(u.type){case"named":return t(u.name);case"rgb":return n(u.rgb);case"table":return s(u.index)}}return{value:o}}const hP={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function dP(e,t,n){const r=Yf(e,n),i=Cp(t),s=Object.fromEntries(Pa.map(c=>{const d=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`,p=e.colors?.[d];return[c,p||hP[c]]})),o=cP(s),u=lP();return i.map(c=>u.parse(c[0]).map(d=>{let p,m;d.decorations.has("reverse")?(p=d.background?o.value(d.background):e.bg,m=d.foreground?o.value(d.foreground):e.fg):(p=d.foreground?o.value(d.foreground):e.fg,m=d.background?o.value(d.background):void 0),p=Js(p,r),m=Js(m,r),d.decorations.has("dim")&&(p=fP(p));let g=Dn.None;return d.decorations.has("bold")&&(g|=Dn.Bold),d.decorations.has("italic")&&(g|=Dn.Italic),d.decorations.has("underline")&&(g|=Dn.Underline),d.decorations.has("strikethrough")&&(g|=Dn.Strikethrough),{content:d.value,offset:c[1],color:p,bgColor:m,fontStyle:g}}))}function fP(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],s=r[1],o=r[2],u=r[3],c=Math.round(Number.parseInt(`${u}${u}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${s}${s}${o}${o}${c}`}else if(r.length===3){const i=r[0],s=r[1],o=r[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function bv(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(mv(i)||gv(r))return Cp(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:s,colorMap:o}=e.setTheme(r);if(i==="ansi")return dP(s,t,n);const u=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==u.name)throw new Kt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${u.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Kt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return mP(t,u,s,o,n)}function pP(...e){if(e.length===2)return Fc(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(mv(i)||gv(s))throw new Kt("Plain language does not have grammar state");if(i==="ansi")throw new Kt("ANSI language does not have grammar state");const{theme:o,colorMap:u}=t.setTheme(s),c=t.getLanguage(i);return new Hl(Xf(n,c,o,u,r).stateStack,c.name,o.name)}function mP(e,t,n,r,i){const s=Xf(e,t,n,r,i),o=new Hl(Xf(e,t,n,r,i).stateStack,t.name,n.name);return Tp(s.tokens,o),s.tokens}function Xf(e,t,n,r,i){const s=Yf(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:u=500}=i,c=Cp(e);let d=i.grammarState?tP(i.grammarState,n.name)??xb:i.grammarContextCode!=null?Xf(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:xb,p=[];const m=[];for(let g=0,_=c.length;g<_;g++){const[v,x]=c[g];if(v===""){p=[],m.push([]);continue}if(o>0&&v.length>=o){p=[],m.push([{content:v,offset:x,color:"",fontStyle:0}]);continue}let C,w,A;i.includeExplanation&&(C=t.tokenizeLine(v,d,u),w=C.tokens,A=0);const R=t.tokenizeLine2(v,d,u),N=R.tokens.length/2;for(let L=0;L<N;L++){const I=R.tokens[2*L],P=L+1<N?R.tokens[2*L+2]:v.length;if(I===P)continue;const q=R.tokens[2*L+1],ee=Js(r[wl.getForeground(q)],s),F=wl.getFontStyle(q),J={content:v.substring(I,P),offset:x+I,color:ee,fontStyle:F};if(i.includeExplanation){const B=[];if(i.includeExplanation!=="scopeName")for(const Y of n.settings){let X;switch(typeof Y.scope){case"string":X=Y.scope.split(/,/).map(M=>M.trim());break;case"object":X=Y.scope;break;default:continue}B.push({settings:Y,selectors:X.map(M=>M.split(/ /))})}J.explanation=[];let V=0;for(;I+V<P;){const Y=w[A],X=v.substring(Y.startIndex,Y.endIndex);V+=X.length,J.explanation.push({content:X,scopes:i.includeExplanation==="scopeName"?gP(Y.scopes):_P(B,Y.scopes)}),A+=1}}p.push(J)}m.push(p),p=[],d=R.ruleStack}return{tokens:m,stateStack:d}}function gP(e){return e.map(t=>({scopeName:t}))}function _P(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];n[r]={scopeName:s,themeMatches:vP(e,s,t.slice(0,r))}}return n}function SC(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function bP(e,t,n){if(!SC(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)SC(e[r],n[i])&&(r-=1),i-=1;return r===-1}function vP(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const o of i)if(bP(o,t,n)){r.push(s);break}return r}function _R(e,t,n){const r=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),i=r.map(c=>{const d=bv(e,t,{...n,theme:c.theme}),p=Fc(d),m=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:d,state:p,theme:m}}),s=yP(...i.map(c=>c.tokens)),o=s[0].map((c,d)=>c.map((p,m)=>{const g={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=p.explanation),s.forEach((_,v)=>{const{content:x,explanation:C,offset:w,...A}=_[d][m];g.variants[r[v].color]=A}),g})),u=i[0].state?new Hl(Object.fromEntries(i.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),i[0].state.lang):void 0;return u&&Tp(o,u),o}function yP(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(c=>c[r]),s=t.map(()=>[]);t.forEach((c,d)=>c.push(s[d]));const o=i.map(()=>0),u=i.map(c=>c[0]);for(;u.every(c=>c);){const c=Math.min(...u.map(d=>d.content.length));for(let d=0;d<n;d++){const p=u[d];p.content.length===c?(s[d].push(p),o[d]+=1,u[d]=i[d][o[d]]):(s[d].push({...p,content:p.content.slice(0,c)}),u[d]={...p,content:p.content.slice(c),offset:p.offset+c})}}}return t}function Zf(e,t,n){let r,i,s,o,u,c;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,g=Object.entries(n.themes).filter(w=>w[1]).map(w=>({color:w[0],theme:w[1]})).sort((w,A)=>w.color===d?-1:A.color===d?1:0);if(g.length===0)throw new Kt("`themes` option must not be empty");const _=_R(e,t,n);if(c=Fc(_),d&&_v!==d&&!g.find(w=>w.color===d))throw new Kt(`\`themes\` option must contain the defaultColor key \`${d}\``);const v=g.map(w=>e.getTheme(w.theme)),x=g.map(w=>w.color);s=_.map(w=>w.map(A=>J8(A,x,p,d,m))),c&&Tp(s,c);const C=g.map(w=>Yf(w.theme,n));i=EC(g,v,C,p,d,"fg",m),r=EC(g,v,C,p,d,"bg",m),o=`shiki-themes ${v.map(w=>w.name).join(" ")}`,u=d?void 0:[i,r].join(";")}else if("theme"in n){const d=Yf(n.theme,n);s=bv(e,t,n);const p=e.getTheme(n.theme);r=Js(p.bg,d),i=Js(p.fg,d),o=p.name,c=Fc(s)}else throw new Kt("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:u,grammarState:c}}function EC(e,t,n,r,i,s,o){return e.map((u,c)=>{const d=Js(t[c][s],n[c])||"inherit",p=`${r+u.color}${s==="bg"?"-bg":""}:${d}`;if(c===0&&i){if(i===_v&&e.length>1){const m=e.findIndex(x=>x.color==="light"),g=e.findIndex(x=>x.color==="dark");if(m===-1||g===-1)throw new Kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const _=Js(t[m][s],n[m])||"inherit",v=Js(t[g][s],n[g])||"inherit";return`light-dark(${_}, ${v});${p}`}return d}return o==="css-vars"?p:null}).filter(u=>!!u).join(";")}function Jf(e,t,n,r={meta:{},options:n,codeToHast:(i,s)=>Jf(e,i,s),codeToTokens:(i,s)=>Zf(e,i,s)}){let i=t;for(const v of Qf(n))i=v.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:u,themeName:c,rootStyle:d,grammarState:p}=Zf(e,i,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:g=!1}=n;m===!0?s=EP(s):m==="never"&&(s=xP(s)),g&&(s=wP(s));const _={...r,get source(){return i}};for(const v of Qf(n))s=v.tokens?.call(_,s)||s;return SP(s,{...n,fg:o,bg:u,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},_,p)}function SP(e,t,n,r=Fc(e)){const i=Qf(t),s=[],o={type:"root",children:[]},{structure:u="classic",tabindex:c="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),c!==!1&&c!=null&&(d.tabindex=c.toString());for(const[x,C]of Object.entries(t.meta||{}))x.startsWith("_")||(d[x]=C);let p={type:"element",tagName:"pre",properties:d,children:[]},m={type:"element",tagName:"code",properties:{},children:s};const g=[],_={...n,structure:u,addClassToHast:pR,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return p},get code(){return m},get lines(){return g}};if(e.forEach((x,C)=>{C&&(u==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):u==="classic"&&s.push({type:"text",value:`
|
|
21
|
+
`}));let w={type:"element",tagName:"span",properties:{class:"line"},children:[]},A=0;for(const R of x){let N={type:"element",tagName:"span",properties:{...R.htmlAttrs},children:[{type:"text",value:R.content}]};const L=kb(R.htmlStyle||Kf(R));L&&(N.properties.style=L);for(const I of i)N=I?.span?.call(_,N,C+1,A,w,R)||N;u==="inline"?o.children.push(N):u==="classic"&&w.children.push(N),A+=R.content.length}if(u==="classic"){for(const R of i)w=R?.line?.call(_,w,C+1)||w;g.push(w),s.push(w)}else u==="inline"&&g.push(w)}),u==="classic"){for(const x of i)m=x?.code?.call(_,m)||m;p.children.push(m);for(const x of i)p=x?.pre?.call(_,p)||p;o.children.push(p)}else if(u==="inline"){const x=[];let C={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const R of o.children)R.type==="element"&&R.tagName==="br"?(x.push(C),C={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(R.type==="element"||R.type==="text")&&C.children.push(R);x.push(C);let A={type:"element",tagName:"code",properties:{},children:x};for(const R of i)A=R?.code?.call(_,A)||A;o.children=[];for(let R=0;R<A.children.length;R++){R>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const N=A.children[R];N.type==="element"&&o.children.push(...N.children)}}let v=o;for(const x of i)v=x?.root?.call(_,v)||v;return r&&Tp(v,r),v}function EP(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((s,o)=>{const c=!(s.fontStyle&&(s.fontStyle&Dn.Underline||s.fontStyle&Dn.Strikethrough));c&&s.content.match(/^\s+$/)&&t[o+1]?(i===void 0&&(i=s.offset),r+=s.content):r?(c?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=void 0,r=""):n.push(s)}),n})}function xP(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const u=[{...n,offset:n.offset+i.length,content:s}];return i&&u.unshift({content:i,offset:n.offset}),o&&u.push({content:o,offset:n.offset+i.length+s.length}),u}))}function wP(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],s=kb(i.htmlStyle||Kf(i)),o=kb(r.htmlStyle||Kf(r)),u=i.fontStyle&&(i.fontStyle&Dn.Underline||i.fontStyle&Dn.Strikethrough),c=r.fontStyle&&(r.fontStyle&Dn.Underline||r.fontStyle&Dn.Strikethrough);!u&&!c&&s===o?i.content+=r.content:n.push({...r})}return n})}const CP=rs;function TP(e,t,n){const r={meta:{},options:n,codeToHast:(s,o)=>Jf(e,s,o),codeToTokens:(s,o)=>Zf(e,s,o)};let i=CP(Jf(e,t,n,r));for(const s of Qf(n))i=s.postprocess?.call(r,i,n)||i;return i}const xC={light:"#333333",dark:"#bbbbbb"},wC={light:"#fffffe",dark:"#1e1e1e"},CC="__shiki_resolved";function kp(e){if(e?.[CC])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const u=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;u?.settings?.foreground&&(r=u.settings.foreground),u?.settings?.background&&(n=u.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?xC.light:xC.dark),n||(n=t.type==="light"?wC.light:wC.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(u){if(s.has(u))return s.get(u);i+=1;const c=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?o(u):(s.set(u,c),c)}t.settings=t.settings.map(u=>{const c=u.settings?.foreground&&!u.settings.foreground.startsWith("#"),d=u.settings?.background&&!u.settings.background.startsWith("#");if(!c&&!d)return u;const p={...u,settings:{...u.settings}};if(c){const m=o(u.settings.foreground);t.colorReplacements[m]=u.settings.foreground,p.settings.foreground=m}if(d){const m=o(u.settings.background);t.colorReplacements[m]=u.settings.background,p.settings.background=m}return p});for(const u of Object.keys(t.colors||{}))if((u==="editor.foreground"||u==="editor.background"||u.startsWith("terminal.ansi"))&&!t.colors[u]?.startsWith("#")){const c=o(t.colors[u]);t.colorReplacements[c]=t.colors[u],t.colors[u]=c}return Object.defineProperty(t,CC,{enumerable:!1,writable:!1,value:!0}),t}async function bR(e){return Array.from(new Set((await Promise.all(e.filter(t=>!dR(t)).map(async t=>await hR(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function vR(e){return(await Promise.all(e.map(async n=>fR(n)?null:kp(await hR(n))))).filter(n=>!!n)}let kP=3;function AP(e,t=3){t>kP||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let fl=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function yR(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new fl(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class RP extends B4{constructor(t,n,r,i={}){super(t),this._resolver=t,this._themes=n,this._langs=r,this._alias=i,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=kp(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=Uf.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=yR(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const r={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const i=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(i.name=t.name,this._resolvedGrammars.set(t.name,i),t.aliases&&t.aliases.forEach(s=>{this._alias[s]=t.name}),this._loadedLanguagesCache=null,n.size)for(const s of n)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const i of t)this.resolveEmbeddedLanguages(i);const n=Array.from(this._langGraph.entries()),r=n.filter(([i,s])=>!s);if(r.length){const i=n.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(c=>r.map(([d])=>d).includes(c)):!1).filter(s=>!r.includes(s));throw new fl(`Missing languages ${r.map(([s])=>`\`${s}\``).join(", ")}, required by ${i.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[i,s]of n)this._resolver.addLanguage(s);for(const[i,s]of n)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class NP{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let i=1;i<=n.length;i++){const s=n.slice(0,i).join(".");r=[...r,...this._injections.get(s)||[]]}return r}}let qu=0;function LP(e){qu+=1,e.warnings!==!1&&qu>=10&&qu%10===0&&console.warn(`[Shiki] ${qu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new fl("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(kp),i=new NP(e.engine,n),s=new RP(i,r,n,e.langAlias);let o;function u(R){return yR(R,e.langAlias)}function c(R){w();const N=s.getGrammar(typeof R=="string"?R:R.name);if(!N)throw new fl(`Language \`${R}\` not found, you may need to load it first`);return N}function d(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const N=s.getTheme(R);if(!N)throw new fl(`Theme \`${R}\` not found, you may need to load it first`);return N}function p(R){w();const N=d(R);o!==R&&(s.setTheme(N),o=R);const L=s.getColorMap();return{theme:N,colorMap:L}}function m(){return w(),s.getLoadedThemes()}function g(){return w(),s.getLoadedLanguages()}function _(...R){w(),s.loadLanguages(R.flat(1))}async function v(...R){return _(await bR(R))}function x(...R){w();for(const N of R.flat(1))s.loadTheme(N)}async function C(...R){return w(),x(await vR(R))}function w(){if(t)throw new fl("Shiki instance has been disposed")}function A(){t||(t=!0,s.dispose(),qu-=1)}return{setTheme:p,getTheme:d,getLanguage:c,getLoadedThemes:m,getLoadedLanguages:g,resolveLangAlias:u,loadLanguage:v,loadLanguageSync:_,loadTheme:C,loadThemeSync:x,dispose:A,[Symbol.dispose]:A}}async function OP(e){e.engine||AP("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([vR(e.themes||[]),bR(e.langs||[]),e.engine]);return LP({...e,themes:t,langs:n,engine:r})}async function DP(e){const t=await OP(e);return{getLastGrammarState:(...n)=>pP(t,...n),codeToTokensBase:(n,r)=>bv(t,n,r),codeToTokensWithThemes:(n,r)=>_R(t,n,r),codeToTokens:(n,r)=>Zf(t,n,r),codeToHast:(n,r)=>Jf(t,n,r),codeToHtml:(n,r)=>TP(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function MP(e){const t=e.langs,n=e.themes,r=e.engine;async function i(s){function o(m){if(typeof m=="string"){if(m=s.langAlias?.[m]||m,dR(m))return[];const g=t[m];if(!g)throw new Kt(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return g}return m}function u(m){if(fR(m))return"none";if(typeof m=="string"){const g=n[m];if(!g)throw new Kt(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return g}return m}const c=(s.themes??[]).map(m=>u(m)),d=(s.langs??[]).map(m=>o(m)),p=await DP({engine:s.engine??r(),...s,themes:c,langs:d});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(o))},loadTheme(...m){return p.loadTheme(...m.map(u))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const SR=[{id:"abap",name:"ABAP",import:(()=>j(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>j(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>j(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>j(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>j(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>j(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>j(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>j(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>j(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>j(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>j(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>j(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>j(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>j(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>j(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>j(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>j(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>j(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>j(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>j(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>j(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>j(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>j(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>j(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>j(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>j(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>j(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>j(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>j(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>j(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>j(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>j(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>j(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>j(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>j(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>j(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>j(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>j(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>j(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>j(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>j(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>j(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>j(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>j(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>j(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>j(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>j(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>j(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>j(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>j(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>j(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>j(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>j(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>j(()=>import("./erb-BOJIQeun.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>j(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>j(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>j(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>j(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>j(()=>import("./fortran-fixed-form-BZjJHVRy.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>j(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>j(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>j(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>j(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>j(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>j(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>j(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>j(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>j(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>j(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>j(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>j(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>j(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>j(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>j(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>j(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>j(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>j(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>j(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>j(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>j(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>j(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>j(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>j(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>j(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>j(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>j(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>j(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>j(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>j(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>j(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>j(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>j(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>j(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>j(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>j(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>j(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>j(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>j(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>j(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>j(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>j(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>j(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>j(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>j(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>j(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>j(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>j(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>j(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>j(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>j(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>j(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>j(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>j(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>j(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>j(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>j(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>j(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>j(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>j(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>j(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>j(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>j(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>j(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>j(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>j(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>j(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>j(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>j(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>j(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>j(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>j(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>j(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>j(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>j(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>j(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>j(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>j(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>j(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>j(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>j(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>j(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>j(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>j(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>j(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>j(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>j(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>j(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>j(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>j(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>j(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>j(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>j(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>j(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>j(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>j(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>j(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>j(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>j(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>j(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>j(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>j(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>j(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>j(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>j(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>j(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>j(()=>import("./rst-B0xPkSld.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>j(()=>import("./ruby-BvKwtOVI.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>j(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>j(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>j(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>j(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>j(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>j(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>j(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>j(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>j(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>j(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>j(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>j(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>j(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>j(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>j(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>j(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>j(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>j(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>j(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>j(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>j(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>j(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>j(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>j(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>j(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>j(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>j(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>j(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>j(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>j(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>j(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>j(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>j(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>j(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>j(()=>import("./twig-CO9l9SDP.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>j(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>j(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>j(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>j(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>j(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>j(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>j(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>j(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>j(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>j(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>j(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>j(()=>import("./vue-vine-8moa0y9V.js"),__vite__mapDeps([94,3,5,67,95,12,92,2,11,9,15,1])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>j(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>j(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>j(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>j(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>j(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>j(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>j(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>j(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>j(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>j(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>j(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>j(()=>import("./zig-VOosw3JB.js"),[]))}],IP=Object.fromEntries(SR.map(e=>[e.id,e.import])),PP=Object.fromEntries(SR.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ER={...IP,...PP},BP=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>j(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>j(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>j(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>j(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>j(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>j(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>j(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>j(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>j(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>j(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>j(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>j(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>j(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>j(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>j(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>j(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>j(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>j(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>j(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>j(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>j(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>j(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>j(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>j(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>j(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>j(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>j(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>j(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>j(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>j(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>j(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>j(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>j(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>j(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>j(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>j(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>j(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>j(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>j(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>j(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>j(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>j(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>j(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>j(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>j(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>j(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>j(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>j(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>j(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>j(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>j(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>j(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>j(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>j(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>j(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>j(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>j(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],xR=Object.fromEntries(BP.map(e=>[e.id,e.import]));class vv extends Error{constructor(t){super(t),this.name="ShikiError"}}function HP(){return 2147483648}function FP(){return typeof performance<"u"?performance.now():Date.now()}const jP=(e,t)=>e+(t-e%t)%t;async function zP(e){let t,n;const r={};function i(_){n=_,r.HEAPU8=new Uint8Array(_),r.HEAPU32=new Uint32Array(_)}function s(_,v,x){r.HEAPU8.copyWithin(_,v,v+x)}function o(_){try{return t.grow(_-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function u(_){const v=r.HEAPU8.length;_=_>>>0;const x=HP();if(_>x)return!1;for(let C=1;C<=4;C*=2){let w=v*(1+.2/C);w=Math.min(w,_+100663296);const A=Math.min(x,jP(Math.max(_,w),65536));if(o(A))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(_,v,x=1024){const C=v+x;let w=v;for(;_[w]&&!(w>=C);)++w;if(w-v>16&&_.buffer&&c)return c.decode(_.subarray(v,w));let A="";for(;v<w;){let R=_[v++];if(!(R&128)){A+=String.fromCharCode(R);continue}const N=_[v++]&63;if((R&224)===192){A+=String.fromCharCode((R&31)<<6|N);continue}const L=_[v++]&63;if((R&240)===224?R=(R&15)<<12|N<<6|L:R=(R&7)<<18|N<<12|L<<6|_[v++]&63,R<65536)A+=String.fromCharCode(R);else{const I=R-65536;A+=String.fromCharCode(55296|I>>10,56320|I&1023)}}return A}function p(_,v){return _?d(r.HEAPU8,_,v):""}const m={emscripten_get_now:FP,emscripten_memcpy_big:s,emscripten_resize_heap:u,fd_write:()=>0};async function g(){const v=await e({env:m,wasi_snapshot_preview1:m});t=v.memory,i(t.buffer),Object.assign(r,v),r.UTF8ToString=p}return await g(),r}var UP=Object.defineProperty,$P=(e,t,n)=>t in e?UP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nn=(e,t,n)=>$P(e,typeof t!="symbol"?t+"":t,n);let dn=null;function VP(e){throw new vv(e.UTF8ToString(e.getLastOnigError()))}class Ap{constructor(t){nn(this,"utf16Length"),nn(this,"utf8Length"),nn(this,"utf16Value"),nn(this,"utf8Value"),nn(this,"utf16OffsetToUtf8"),nn(this,"utf8OffsetToUtf16");const n=t.length,r=Ap._utf8ByteLength(t),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const u=new Uint8Array(r);let c=0;for(let d=0;d<n;d++){const p=t.charCodeAt(d);let m=p,g=!1;if(p>=55296&&p<=56319&&d+1<n){const _=t.charCodeAt(d+1);_>=56320&&_<=57343&&(m=(p-55296<<10)+65536|_-56320,g=!0)}i&&(s[d]=c,g&&(s[d+1]=c),m<=127?o[c+0]=d:m<=2047?(o[c+0]=d,o[c+1]=d):m<=65535?(o[c+0]=d,o[c+1]=d,o[c+2]=d):(o[c+0]=d,o[c+1]=d,o[c+2]=d,o[c+3]=d)),m<=127?u[c++]=m:m<=2047?(u[c++]=192|(m&1984)>>>6,u[c++]=128|(m&63)>>>0):m<=65535?(u[c++]=224|(m&61440)>>>12,u[c++]=128|(m&4032)>>>6,u[c++]=128|(m&63)>>>0):(u[c++]=240|(m&1835008)>>>18,u[c++]=128|(m&258048)>>>12,u[c++]=128|(m&4032)>>>6,u[c++]=128|(m&63)>>>0),g&&d++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=u,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const s=t.charCodeAt(r);let o=s,u=!1;if(s>=55296&&s<=56319&&r+1<i){const c=t.charCodeAt(r+1);c>=56320&&c<=57343&&(o=(s-55296<<10)+65536|c-56320,u=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,u&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Rp=class hi{constructor(t){if(nn(this,"id",++hi.LAST_ID),nn(this,"_onigBinding"),nn(this,"content"),nn(this,"utf16Length"),nn(this,"utf8Length"),nn(this,"utf16OffsetToUtf8"),nn(this,"utf8OffsetToUtf16"),nn(this,"ptr"),!dn)throw new vv("Must invoke loadWasm first.");this._onigBinding=dn,this.content=t;const n=new Ap(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!hi._sharedPtrInUse?(hi._sharedPtr||(hi._sharedPtr=dn.omalloc(1e4)),hi._sharedPtrInUse=!0,dn.HEAPU8.set(n.utf8Value,hi._sharedPtr),this.ptr=hi._sharedPtr):this.ptr=n.createString(dn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===hi._sharedPtr?hi._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};nn(Rp,"LAST_ID",0);nn(Rp,"_sharedPtr",0);nn(Rp,"_sharedPtrInUse",!1);let wR=Rp;class qP{constructor(t){if(nn(this,"_onigBinding"),nn(this,"_ptr"),!dn)throw new vv("Must invoke loadWasm first.");const n=[],r=[];for(let u=0,c=t.length;u<c;u++){const d=new Ap(t[u]);n[u]=d.createString(dn),r[u]=d.utf8Length}const i=dn.omalloc(4*t.length);dn.HEAPU32.set(n,i/4);const s=dn.omalloc(4*t.length);dn.HEAPU32.set(r,s/4);const o=dn.createOnigScanner(i,s,t.length);for(let u=0,c=t.length;u<c;u++)dn.ofree(n[u]);dn.ofree(s),dn.ofree(i),o===0&&VP(dn),this._onigBinding=dn,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new wR(t);const s=this._findNextMatchSync(t,n,!1,i);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const s=this._onigBinding,o=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(o===0)return null;const u=s.HEAPU32;let c=o/4;const d=u[c++],p=u[c++],m=[];for(let g=0;g<p;g++){const _=t.convertUtf8OffsetToUtf16(u[c++]),v=t.convertUtf8OffsetToUtf16(u[c++]);m[g]={start:_,end:v,length:v-_}}return{index:d,captureIndices:m}}}function WP(e){return typeof e.instantiator=="function"}function GP(e){return typeof e.default=="function"}function YP(e){return typeof e.data<"u"}function KP(e){return typeof Response<"u"&&e instanceof Response}function QP(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Vd;function XP(e){if(Vd)return Vd;async function t(){dn=await zP(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),WP(r)?r=await r.instantiator(n):GP(r)?r=await r.default(n):(YP(r)&&(r=r.data),KP(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await ZP(r)(n):r=await JP(r)(n):QP(r)?r=await q0(r)(n):r instanceof WebAssembly.Module?r=await q0(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await q0(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Vd=t(),Vd}function q0(e){return t=>WebAssembly.instantiate(e,t)}function ZP(e){return t=>WebAssembly.instantiateStreaming(e,t)}function JP(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function eB(e){return e&&await XP(e),{createScanner(t){return new qP(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new wR(t)}}}const tB=MP({langs:ER,themes:xR,engine:()=>eB(j(()=>import("./wasm-CG6Dc4jp.js"),[]))});function Fl(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function nB(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const yv=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),_n=String.raw;function jl(e,t){if(e==null)throw new Error(t??"Value expected");return e}const CR=_n`\[\^?`,TR=`c.? | C(?:-.?)?|${_n`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${_n`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${_n`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${_n`o\{[^\}]*\}?`}|${_n`\d{1,3}`}`,Sv=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,qd=new RegExp(_n`
|
|
22
22
|
\\ (?:
|
|
23
|
-
${
|
|
23
|
+
${TR}
|
|
24
24
|
| [gk]<[^>]*>?
|
|
25
25
|
| [gk]'[^']*'?
|
|
26
26
|
| .
|
|
@@ -38,19 +38,19 @@ Error generating stack: `+f.message+`
|
|
|
38
38
|
| \*[^\)]*\)?
|
|
39
39
|
)?
|
|
40
40
|
| (?:${Sv.source})+
|
|
41
|
-
| ${
|
|
41
|
+
| ${CR}
|
|
42
42
|
| .
|
|
43
43
|
`.replace(/\s+/g,""),"gsu"),W0=new RegExp(_n`
|
|
44
44
|
\\ (?:
|
|
45
|
-
${
|
|
45
|
+
${TR}
|
|
46
46
|
| .
|
|
47
47
|
)
|
|
48
48
|
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
49
|
-
| ${
|
|
49
|
+
| ${CR}
|
|
50
50
|
| &&
|
|
51
51
|
| .
|
|
52
|
-
`.replace(/\s+/g,""),"gsu");function rB(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=EB(n.flags),i=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(m){i.push(m)},replaceCurrentModX(m){i[i.length-1]=m},singleline:n.rules.singleline};let o=[],u;for(qd.lastIndex=0;u=qd.exec(e);){const m=iB(s,e,u[0],qd.lastIndex);m.tokens?o.push(...m.tokens):m.token&&o.push(m.token),m.lastIndex!==void 0&&(qd.lastIndex=m.lastIndex)}const c=[];let d=0;o.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++d:m.raw==="("&&c.push(m)}),d||c.forEach((m,g)=>{m.kind="capturing",m.number=g+1});const p=d||c.length;return{tokens:o.map(m=>m.type==="EscapedNumber"?wB(m,p):m).flat(),flags:r}}function iB(e,t,n,r){const[i,s]=n;if(n==="["||n==="[^"){const o=sB(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:TC(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:mB(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:
|
|
53
|
-
`,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:Ba("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":_n`\A`,$:_n`\Z`}[n]:n;return{token:TC(o,n)}}return n==="|"?{token:oB(n)}:Sv.test(n)?{tokens:CB(n)}:{token:ts(Fl(n),n)}}function sB(e,t,n){const r=[kC(t[1]==="^",t)];let i=1,s;for(W0.lastIndex=n;s=W0.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,r.push(kC(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(ts(93,o));else if(i--,r.push(lB(o)),!i)break}else{const u=aB(o);Array.isArray(u)?r.push(...u):r.push(u)}}return{tokens:r,lastIndex:W0.lastIndex||e.length}}function aB(e){if(e[0]==="\\")return k3(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!yv.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Ba("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?uB(e):e==="&&"?cB(e):ts(Fl(e),e)}function k3(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return _B(e);if("dDhHsSwW".includes(n))return yB(e);if(e.startsWith(_n`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return SB(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...i].map(o=>{const u=[...s.encode(o)].map(c=>`\\x${c.toString(16)}`).join("");return ts(Fl(o),u)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return ts(xB(e),e);if(AC.has(n))return ts(AC.get(n),e);if(/\d/.test(n))return hB(t,e);if(e==="\\")throw new Error(_n`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return ts(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function oB(e){return{type:"Alternator",raw:e}}function TC(e,t){return{type:"Assertion",kind:e,raw:t}}function A3(e){return{type:"Backreference",raw:e}}function ts(e,t){return{type:"Character",value:e,raw:t}}function lB(e){return{type:"CharacterClassClose",raw:e}}function uB(e){return{type:"CharacterClassHyphen",raw:e}}function cB(e){return{type:"CharacterClassIntersector",raw:e}}function kC(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Ba(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function R3(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:jl(n.flags),raw:t}}function hB(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function dB(e){return{type:"GroupClose",raw:e}}function ul(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function fB(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function pB(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function mB(e){return{type:"Subroutine",raw:e}}const gB=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),AC=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function _B(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return ts(Fl(t.toUpperCase())-64,e)}function bB(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=NC(n),o=NC(r),u={};if(s&&(u.enable=s),o&&(u.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),R3("flags",e,{flags:u});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,ul("group",e,{...(s||o)&&{flags:u}});throw new Error(`Unexpected flag modifier "${e}"`)}function vB(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[o,u,c]=s,d=gB.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof u=="number"||!/^[<>X]$/.test(u)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${u}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof u=="number"||!/^(?:[<>!=]=|[<>])$/.test(u))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${u}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument three must be a tag or number "${c}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${d}"`)}return fB(d,r??null,i?.split(",")??null,e)}function RC(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=s===void 0?+i:s===""?1/0:+s,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return pB(t,n,r,e)}function yB(e){const t=e[1].toLowerCase();return Ba({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function SB(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Ba("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function NC(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function EB(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function xB(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function wB(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[A3(n)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let u=0;u<o.length;u++){const c=o[u];let d;if(u===0&&c!=="8"&&c!=="9"){if(d=parseInt(c,8),d>127)throw new Error(_n`Octal encoded byte above 177 unsupported "${n}"`)}else d=Fl(c);s.push(ts(d,(u===0?"\\":"")+c))}return s}function CB(e){const t=[],n=new RegExp(Sv,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:u}=s.groups;if(+o>+u&&i.endsWith("?")){n.lastIndex--,t.push(RC(i.slice(0,-1)));continue}}}t.push(RC(i))}return t}function N3(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function TB(e){return kB.has(e.type)}const kB=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function L3(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=rB(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(g,_)=>{const v=r.tokens[s.nextIndex];switch(s.parent=g,s.nextIndex++,v.type){case"Alternator":return Ga();case"Assertion":return AB(v);case"Backreference":return RB(v,s);case"Character":return Np(v.value,{useLastValid:!!_.isCheckingRangeEnd});case"CharacterClassHyphen":return NB(v,s,_);case"CharacterClassOpen":return LB(v,s,_);case"CharacterSet":return OB(v,s);case"Directive":return HB(v.kind,{flags:v.flags});case"GroupOpen":return DB(v,s,_);case"NamedCallout":return jB(v.kind,v.tag,v.arguments);case"Quantifier":return MB(v,s);case"Subroutine":return IB(v,s);default:throw new Error(`Unexpected token type "${v.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=UB(FB(r.flags));let u=o.body[0];for(;s.nextIndex<r.tokens.length;){const g=i(u,{});g.type==="Alternative"?(o.body.push(g),u=g):u.body.push(g)}const{capturingGroups:c,hasNumberedRef:d,namedGroupsByName:p,subroutines:m}=s;if(d&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:g}of m)if(typeof g=="number"){if(g>c.length)throw new Error("Subroutine uses a group number that's not defined");g&&(c[g-1].isSubroutined=!0)}else if(p.has(g)){if(p.get(g).length>1)throw new Error(_n`Subroutine uses a duplicate group name "\g<${g}>"`);p.get(g)[0].isSubroutined=!0}else throw new Error(_n`Subroutine uses a group name that's not defined "\g<${g}>"`);return o}function AB({kind:e}){return Ab(jl({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===_n`\B`||e===_n`\Y`})}function RB({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(s,o=!1)=>{const u=t.capturingGroups.length;let c=!1;if(s>u)if(t.skipBackrefValidation)c=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Rb(o?u+1-s:s,{orphan:c})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Rb(r)}return i(+r)}function NB(e,t,n){const{tokens:r,walk:i}=t,s=t.parent,o=s.body.at(-1),u=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&u&&u.type!=="CharacterClassOpen"&&u.type!=="CharacterClassClose"&&u.type!=="CharacterClassIntersector"){const c=i(s,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&c.type==="Character")return s.body.pop(),BB(o,c);throw new Error("Invalid character class range")}return Np(Fl("-"))}function LB({negate:e},t,n){const{tokens:r,walk:i}=t,s=r[t.nextIndex],o=[Sf()];let u=DC(s);for(;u.type!=="CharacterClassClose";){if(u.type==="CharacterClassIntersector")o.push(Sf()),t.nextIndex++;else{const d=o.at(-1);d.body.push(i(d,n))}u=DC(r[t.nextIndex],s)}const c=Sf({negate:e});return o.length===1?c.body=o[0].body:(c.kind="intersection",c.body=o.map(d=>d.body.length===1?d.body[0]:d)),t.nextIndex++,c}function OB({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=r;if(e==="property"){const u=Lp(n);if(yv.has(u)&&!o?.has(u))e="posix",n=u;else return cl(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?zB(n,{negate:t}):Nb(e,{negate:t})}function DB(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:u}=t,c=$B(e),d=c.type==="AbsenceFunction",p=OC(c),m=p&&c.negate;if(c.type==="CapturingGroup"&&(i.push(c),c.name&&nB(s,c.name,[]).push(c)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let g=MC(r[t.nextIndex]);for(;g.type!=="GroupClose";){if(g.type==="Alternator")c.body.push(Ga()),t.nextIndex++;else{const _=c.body.at(-1),v=u(_,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(_.body.push(v),(p||n.isInLookbehind)&&!o){const x="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(LC(v)||v.type==="CapturingGroup")throw new Error(x)}else if(LC(v)||OC(v)&&v.negate)throw new Error(x)}}g=MC(r[t.nextIndex])}return t.nextIndex++,c}function MB({kind:e,min:t,max:n},r){const i=r.parent,s=i.body.at(-1);if(!s||!TB(s))throw new Error("Quantifier requires a repeatable token");const o=D3(e,t,n,s);return i.body.pop(),o}function IB({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const u=+s.groups.num,c=n.length;if(t.hasNumberedRef=!0,i={"":u,"+":c+u,"-":c+1-u}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=M3(i);return r.push(o),o}function PB(e,t){return{type:"AbsenceFunction",kind:e,body:ih(t?.body)}}function Ga(e){return{type:"Alternative",body:I3(e?.body)}}function Ab(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Rb(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function O3(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!VB(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:ih(t?.body)}}function Np(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function Sf(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:I3(e?.body)}}function BB(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Nb(e,t){const n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function HB(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:jl(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function FB(e){return{type:"Flags",...e}}function Zr(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:ih(e?.body)}}function Ma(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:ih(e?.body)}}function jB(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function zB(e,t){const n=!!t?.negate;if(!yv.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function D3(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function UB(e,t){return{type:"Regex",body:ih(t?.body),flags:e}}function M3(e){return{type:"Subroutine",ref:e}}function cl(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(Lp(e));if(!r){if(n.normalizeUnknownPropertyNames)r=qB(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(_n`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function $B({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return PB("repeater");case"atomic":return Zr({atomic:!0});case"capturing":return O3(i,{name:n});case"group":return Zr({flags:e});case"lookahead":case"lookbehind":return Ma({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function ih(e){if(e===void 0)e=[Ga()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function I3(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function LC(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function OC(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function VB(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function qB(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Lp(e){return e.replace(/[- _]+/g,"").toLowerCase()}function DC(e,t){return jl(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function MC(e){return jl(e,"Unclosed group")}function yc(e,t,n=null){function r(s,o){for(let u=0;u<s.length;u++){const c=i(s[u],o,u,s);u=Math.max(-1,u+c)}}function i(s,o=null,u=null,c=null){let d=0,p=!1;const m={node:s,parent:o,key:u,container:c,root:e,remove(){Wd(c).splice(Math.max(0,Xo(u)+d),1),d--,p=!0},removeAllNextSiblings(){return Wd(c).splice(Xo(u)+1)},removeAllPrevSiblings(){const w=Xo(u)+d;return d-=w,Wd(c).splice(0,Math.max(0,w))},replaceWith(w,A={}){const R=!!A.traverse;c?c[Math.max(0,Xo(u)+d)]=w:jl(o,"Can't replace root node")[u]=w,R&&i(w,o,u,c),p=!0},replaceWithMultiple(w,A={}){const R=!!A.traverse;if(Wd(c).splice(Math.max(0,Xo(u)+d),1,...w),d+=w.length-1,R){let N=0;for(let L=0;L<w.length;L++)N+=i(w[L],o,Xo(u)+L+N,c)}p=!0},skip(){p=!0}},{type:g}=s,_=t["*"],v=t[g],x=typeof _=="function"?_:_?.enter,C=typeof v=="function"?v:v?.enter;if(x?.(m,n),C?.(m,n),!p)switch(g){case"AbsenceFunction":case"CapturingGroup":case"Group":r(s.body,s);break;case"Alternative":case"CharacterClass":r(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"LookaroundAssertion":r(s.body,s);break;case"Quantifier":i(s.body,s,"body");break;case"Regex":r(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${g}"`)}return v?.exit?.(m,n),_?.exit?.(m,n),d}return i(e),e}function Wd(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Xo(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const WB=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function GB(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function YB(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Vr=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Ev(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,u="";for(const c of e.matchAll(i)){const{0:d,groups:{$skip:p}}=c;if(!p&&(!r||r===Vr.DEFAULT==!o)){n instanceof Function?u+=n(c,{context:o?Vr.CHAR_CLASS:Vr.DEFAULT,negated:s[s.length-1]}):u+=n;continue}d[0]==="["?(o++,s.push(d[1]==="^")):d==="]"&&o&&(o--,s.pop()),u+=d}return u}function P3(e,t,n,r){Ev(e,t,n,r)}function KB(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let s=0,o;for(;o=i.exec(e);){const{0:u,groups:{$skip:c}}=o;if(!c&&(!r||r===Vr.DEFAULT==!s))return o;u==="["?s++:u==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function Gd(e,t,n){return!!KB(e,t,0,n)}function QB(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,s=1,o;for(;o=n.exec(e);){const[u]=o;if(u==="[")i++;else if(i)u==="]"&&i--;else if(u==="(")s++;else if(u===")"&&(s--,!s)){r=o.index;break}}return e.slice(t,r)}const IC=new RegExp(String.raw`(?<noncapturingStart>${WB})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function XB(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",s="(?:(?=(",o=[0],u=[];let c=0,d=0,p=NaN,m;do{m=!1;let g=0,_=0,v=!1,x;for(IC.lastIndex=Number.isNaN(p)?0:p+s.length;x=IC.exec(e);){const{0:C,index:w,groups:{capturingStart:A,noncapturingStart:R}}=x;if(C==="[")g++;else if(g)C==="]"&&g--;else if(C===i&&!v)p=w,v=!0;else if(v&&R)_++;else if(A)v?_++:(c++,o.push(c+d));else if(C===")"&&v){if(!_){d++;const N=c+d;if(e=`${e.slice(0,p)}${s}${e.slice(p+i.length,w)}))<$$${N}>)${e.slice(w+1)}`,m=!0,u.push(N),GB(n,N),r.size){const L=new Map;r.forEach((I,P)=>{L.set(P>=N?P+1:P,I.map(q=>q>=N?q+1:q))}),r=L}break}_--}}}while(m);return n.push(...u),e=Ev(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:g,groups:{backrefNum:_,wrappedBackrefNum:v}})=>{if(_){const x=+_;if(x>o.length-1)throw new Error(`Backref "${g}" greater than number of captures`);return`\\${o[x]}`}return`\\${v}`},Vr.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const B3=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,G0=new RegExp(String.raw`
|
|
52
|
+
`.replace(/\s+/g,""),"gsu");function rB(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=EB(n.flags),i=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(m){i.push(m)},replaceCurrentModX(m){i[i.length-1]=m},singleline:n.rules.singleline};let o=[],u;for(qd.lastIndex=0;u=qd.exec(e);){const m=iB(s,e,u[0],qd.lastIndex);m.tokens?o.push(...m.tokens):m.token&&o.push(m.token),m.lastIndex!==void 0&&(qd.lastIndex=m.lastIndex)}const c=[];let d=0;o.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++d:m.raw==="("&&c.push(m)}),d||c.forEach((m,g)=>{m.kind="capturing",m.number=g+1});const p=d||c.length;return{tokens:o.map(m=>m.type==="EscapedNumber"?wB(m,p):m).flat(),flags:r}}function iB(e,t,n,r){const[i,s]=n;if(n==="["||n==="[^"){const o=sB(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:TC(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:mB(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:AR(n)}}if(s==="K")return{token:RR("keep",n)};if(s==="N"||s==="R")return{token:Ba("newline",n,{negate:s==="N"})};if(s==="O")return{token:Ba("any",n)};if(s==="X")return{token:Ba("text_segment",n)};const o=kR(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:vB(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:bB(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:ul("group",n)};if(n==="(?>")return{token:ul("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:ul(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:ul("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:ul("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:dB(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
|
|
53
|
+
`,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:Ba("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":_n`\A`,$:_n`\Z`}[n]:n;return{token:TC(o,n)}}return n==="|"?{token:oB(n)}:Sv.test(n)?{tokens:CB(n)}:{token:ts(Fl(n),n)}}function sB(e,t,n){const r=[kC(t[1]==="^",t)];let i=1,s;for(W0.lastIndex=n;s=W0.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,r.push(kC(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(ts(93,o));else if(i--,r.push(lB(o)),!i)break}else{const u=aB(o);Array.isArray(u)?r.push(...u):r.push(u)}}return{tokens:r,lastIndex:W0.lastIndex||e.length}}function aB(e){if(e[0]==="\\")return kR(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!yv.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Ba("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?uB(e):e==="&&"?cB(e):ts(Fl(e),e)}function kR(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return _B(e);if("dDhHsSwW".includes(n))return yB(e);if(e.startsWith(_n`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return SB(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...i].map(o=>{const u=[...s.encode(o)].map(c=>`\\x${c.toString(16)}`).join("");return ts(Fl(o),u)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return ts(xB(e),e);if(AC.has(n))return ts(AC.get(n),e);if(/\d/.test(n))return hB(t,e);if(e==="\\")throw new Error(_n`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return ts(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function oB(e){return{type:"Alternator",raw:e}}function TC(e,t){return{type:"Assertion",kind:e,raw:t}}function AR(e){return{type:"Backreference",raw:e}}function ts(e,t){return{type:"Character",value:e,raw:t}}function lB(e){return{type:"CharacterClassClose",raw:e}}function uB(e){return{type:"CharacterClassHyphen",raw:e}}function cB(e){return{type:"CharacterClassIntersector",raw:e}}function kC(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Ba(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function RR(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:jl(n.flags),raw:t}}function hB(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function dB(e){return{type:"GroupClose",raw:e}}function ul(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function fB(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function pB(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function mB(e){return{type:"Subroutine",raw:e}}const gB=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),AC=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function _B(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return ts(Fl(t.toUpperCase())-64,e)}function bB(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=NC(n),o=NC(r),u={};if(s&&(u.enable=s),o&&(u.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),RR("flags",e,{flags:u});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,ul("group",e,{...(s||o)&&{flags:u}});throw new Error(`Unexpected flag modifier "${e}"`)}function vB(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[o,u,c]=s,d=gB.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof u=="number"||!/^[<>X]$/.test(u)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${u}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof u=="number"||!/^(?:[<>!=]=|[<>])$/.test(u))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${u}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument three must be a tag or number "${c}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${d}"`)}return fB(d,r??null,i?.split(",")??null,e)}function RC(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=s===void 0?+i:s===""?1/0:+s,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return pB(t,n,r,e)}function yB(e){const t=e[1].toLowerCase();return Ba({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function SB(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Ba("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function NC(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function EB(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function xB(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function wB(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[AR(n)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let u=0;u<o.length;u++){const c=o[u];let d;if(u===0&&c!=="8"&&c!=="9"){if(d=parseInt(c,8),d>127)throw new Error(_n`Octal encoded byte above 177 unsupported "${n}"`)}else d=Fl(c);s.push(ts(d,(u===0?"\\":"")+c))}return s}function CB(e){const t=[],n=new RegExp(Sv,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:u}=s.groups;if(+o>+u&&i.endsWith("?")){n.lastIndex--,t.push(RC(i.slice(0,-1)));continue}}}t.push(RC(i))}return t}function NR(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function TB(e){return kB.has(e.type)}const kB=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function LR(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=rB(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(g,_)=>{const v=r.tokens[s.nextIndex];switch(s.parent=g,s.nextIndex++,v.type){case"Alternator":return Ga();case"Assertion":return AB(v);case"Backreference":return RB(v,s);case"Character":return Np(v.value,{useLastValid:!!_.isCheckingRangeEnd});case"CharacterClassHyphen":return NB(v,s,_);case"CharacterClassOpen":return LB(v,s,_);case"CharacterSet":return OB(v,s);case"Directive":return HB(v.kind,{flags:v.flags});case"GroupOpen":return DB(v,s,_);case"NamedCallout":return jB(v.kind,v.tag,v.arguments);case"Quantifier":return MB(v,s);case"Subroutine":return IB(v,s);default:throw new Error(`Unexpected token type "${v.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=UB(FB(r.flags));let u=o.body[0];for(;s.nextIndex<r.tokens.length;){const g=i(u,{});g.type==="Alternative"?(o.body.push(g),u=g):u.body.push(g)}const{capturingGroups:c,hasNumberedRef:d,namedGroupsByName:p,subroutines:m}=s;if(d&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:g}of m)if(typeof g=="number"){if(g>c.length)throw new Error("Subroutine uses a group number that's not defined");g&&(c[g-1].isSubroutined=!0)}else if(p.has(g)){if(p.get(g).length>1)throw new Error(_n`Subroutine uses a duplicate group name "\g<${g}>"`);p.get(g)[0].isSubroutined=!0}else throw new Error(_n`Subroutine uses a group name that's not defined "\g<${g}>"`);return o}function AB({kind:e}){return Ab(jl({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===_n`\B`||e===_n`\Y`})}function RB({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(s,o=!1)=>{const u=t.capturingGroups.length;let c=!1;if(s>u)if(t.skipBackrefValidation)c=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Rb(o?u+1-s:s,{orphan:c})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Rb(r)}return i(+r)}function NB(e,t,n){const{tokens:r,walk:i}=t,s=t.parent,o=s.body.at(-1),u=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&u&&u.type!=="CharacterClassOpen"&&u.type!=="CharacterClassClose"&&u.type!=="CharacterClassIntersector"){const c=i(s,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&c.type==="Character")return s.body.pop(),BB(o,c);throw new Error("Invalid character class range")}return Np(Fl("-"))}function LB({negate:e},t,n){const{tokens:r,walk:i}=t,s=r[t.nextIndex],o=[Sf()];let u=DC(s);for(;u.type!=="CharacterClassClose";){if(u.type==="CharacterClassIntersector")o.push(Sf()),t.nextIndex++;else{const d=o.at(-1);d.body.push(i(d,n))}u=DC(r[t.nextIndex],s)}const c=Sf({negate:e});return o.length===1?c.body=o[0].body:(c.kind="intersection",c.body=o.map(d=>d.body.length===1?d.body[0]:d)),t.nextIndex++,c}function OB({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=r;if(e==="property"){const u=Lp(n);if(yv.has(u)&&!o?.has(u))e="posix",n=u;else return cl(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?zB(n,{negate:t}):Nb(e,{negate:t})}function DB(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:u}=t,c=$B(e),d=c.type==="AbsenceFunction",p=OC(c),m=p&&c.negate;if(c.type==="CapturingGroup"&&(i.push(c),c.name&&nB(s,c.name,[]).push(c)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let g=MC(r[t.nextIndex]);for(;g.type!=="GroupClose";){if(g.type==="Alternator")c.body.push(Ga()),t.nextIndex++;else{const _=c.body.at(-1),v=u(_,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(_.body.push(v),(p||n.isInLookbehind)&&!o){const x="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(LC(v)||v.type==="CapturingGroup")throw new Error(x)}else if(LC(v)||OC(v)&&v.negate)throw new Error(x)}}g=MC(r[t.nextIndex])}return t.nextIndex++,c}function MB({kind:e,min:t,max:n},r){const i=r.parent,s=i.body.at(-1);if(!s||!TB(s))throw new Error("Quantifier requires a repeatable token");const o=DR(e,t,n,s);return i.body.pop(),o}function IB({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const u=+s.groups.num,c=n.length;if(t.hasNumberedRef=!0,i={"":u,"+":c+u,"-":c+1-u}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=MR(i);return r.push(o),o}function PB(e,t){return{type:"AbsenceFunction",kind:e,body:ih(t?.body)}}function Ga(e){return{type:"Alternative",body:IR(e?.body)}}function Ab(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Rb(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function OR(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!VB(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:ih(t?.body)}}function Np(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function Sf(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:IR(e?.body)}}function BB(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Nb(e,t){const n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function HB(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:jl(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function FB(e){return{type:"Flags",...e}}function Zr(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:ih(e?.body)}}function Ma(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:ih(e?.body)}}function jB(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function zB(e,t){const n=!!t?.negate;if(!yv.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function DR(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function UB(e,t){return{type:"Regex",body:ih(t?.body),flags:e}}function MR(e){return{type:"Subroutine",ref:e}}function cl(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(Lp(e));if(!r){if(n.normalizeUnknownPropertyNames)r=qB(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(_n`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function $B({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return PB("repeater");case"atomic":return Zr({atomic:!0});case"capturing":return OR(i,{name:n});case"group":return Zr({flags:e});case"lookahead":case"lookbehind":return Ma({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function ih(e){if(e===void 0)e=[Ga()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function IR(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function LC(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function OC(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function VB(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function qB(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Lp(e){return e.replace(/[- _]+/g,"").toLowerCase()}function DC(e,t){return jl(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function MC(e){return jl(e,"Unclosed group")}function yc(e,t,n=null){function r(s,o){for(let u=0;u<s.length;u++){const c=i(s[u],o,u,s);u=Math.max(-1,u+c)}}function i(s,o=null,u=null,c=null){let d=0,p=!1;const m={node:s,parent:o,key:u,container:c,root:e,remove(){Wd(c).splice(Math.max(0,Xo(u)+d),1),d--,p=!0},removeAllNextSiblings(){return Wd(c).splice(Xo(u)+1)},removeAllPrevSiblings(){const w=Xo(u)+d;return d-=w,Wd(c).splice(0,Math.max(0,w))},replaceWith(w,A={}){const R=!!A.traverse;c?c[Math.max(0,Xo(u)+d)]=w:jl(o,"Can't replace root node")[u]=w,R&&i(w,o,u,c),p=!0},replaceWithMultiple(w,A={}){const R=!!A.traverse;if(Wd(c).splice(Math.max(0,Xo(u)+d),1,...w),d+=w.length-1,R){let N=0;for(let L=0;L<w.length;L++)N+=i(w[L],o,Xo(u)+L+N,c)}p=!0},skip(){p=!0}},{type:g}=s,_=t["*"],v=t[g],x=typeof _=="function"?_:_?.enter,C=typeof v=="function"?v:v?.enter;if(x?.(m,n),C?.(m,n),!p)switch(g){case"AbsenceFunction":case"CapturingGroup":case"Group":r(s.body,s);break;case"Alternative":case"CharacterClass":r(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"LookaroundAssertion":r(s.body,s);break;case"Quantifier":i(s.body,s,"body");break;case"Regex":r(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${g}"`)}return v?.exit?.(m,n),_?.exit?.(m,n),d}return i(e),e}function Wd(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Xo(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const WB=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function GB(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function YB(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Vr=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Ev(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,u="";for(const c of e.matchAll(i)){const{0:d,groups:{$skip:p}}=c;if(!p&&(!r||r===Vr.DEFAULT==!o)){n instanceof Function?u+=n(c,{context:o?Vr.CHAR_CLASS:Vr.DEFAULT,negated:s[s.length-1]}):u+=n;continue}d[0]==="["?(o++,s.push(d[1]==="^")):d==="]"&&o&&(o--,s.pop()),u+=d}return u}function PR(e,t,n,r){Ev(e,t,n,r)}function KB(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let s=0,o;for(;o=i.exec(e);){const{0:u,groups:{$skip:c}}=o;if(!c&&(!r||r===Vr.DEFAULT==!s))return o;u==="["?s++:u==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function Gd(e,t,n){return!!KB(e,t,0,n)}function QB(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,s=1,o;for(;o=n.exec(e);){const[u]=o;if(u==="[")i++;else if(i)u==="]"&&i--;else if(u==="(")s++;else if(u===")"&&(s--,!s)){r=o.index;break}}return e.slice(t,r)}const IC=new RegExp(String.raw`(?<noncapturingStart>${WB})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function XB(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",s="(?:(?=(",o=[0],u=[];let c=0,d=0,p=NaN,m;do{m=!1;let g=0,_=0,v=!1,x;for(IC.lastIndex=Number.isNaN(p)?0:p+s.length;x=IC.exec(e);){const{0:C,index:w,groups:{capturingStart:A,noncapturingStart:R}}=x;if(C==="[")g++;else if(g)C==="]"&&g--;else if(C===i&&!v)p=w,v=!0;else if(v&&R)_++;else if(A)v?_++:(c++,o.push(c+d));else if(C===")"&&v){if(!_){d++;const N=c+d;if(e=`${e.slice(0,p)}${s}${e.slice(p+i.length,w)}))<$$${N}>)${e.slice(w+1)}`,m=!0,u.push(N),GB(n,N),r.size){const L=new Map;r.forEach((I,P)=>{L.set(P>=N?P+1:P,I.map(q=>q>=N?q+1:q))}),r=L}break}_--}}}while(m);return n.push(...u),e=Ev(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:g,groups:{backrefNum:_,wrappedBackrefNum:v}})=>{if(_){const x=+_;if(x>o.length-1)throw new Error(`Backref "${g}" greater than number of captures`);return`\\${o[x]}`}return`\\${v}`},Vr.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const BR=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,G0=new RegExp(String.raw`
|
|
54
54
|
\\(?: \d+
|
|
55
55
|
| c[A-Za-z]
|
|
56
56
|
| [gk]<[^>]+>
|
|
@@ -63,9 +63,9 @@ Error generating stack: `+f.message+`
|
|
|
63
63
|
| [A-Za-z\-]+:
|
|
64
64
|
| \(DEFINE\)
|
|
65
65
|
))?
|
|
66
|
-
| (?<qBase>${
|
|
66
|
+
| (?<qBase>${BR})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
67
67
|
| \\?.
|
|
68
|
-
`.replace(/\s+/g,""),"gsu");function ZB(e){if(!new RegExp(`${
|
|
68
|
+
`.replace(/\s+/g,""),"gsu");function ZB(e){if(!new RegExp(`${BR}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",s=0,o;for(G0.lastIndex=0;o=G0.exec(e);){const{0:u,index:c,groups:{qBase:d,qMod:p,invalidQ:m}}=o;if(u==="[")s||(r=c),s++;else if(u==="]")s?s--:r=null;else if(!s)if(p==="+"&&i&&!i.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${u}"`);let g=-1;if(/^\{\d+\}$/.test(d))e=YB(e,c+d.length,p,"");else{if(i===")"||i==="]"){const _=i===")"?n:r;if(_===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,_)}(?>${e.slice(_,c)}${d})${e.slice(c+u.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${d})${e.slice(c+u.length)}`;g+=4}G0.lastIndex+=g}else u[0]==="("?t.push(c):u===")"&&(n=t.length?t.pop():null);i=u}return{pattern:e}}const $r=String.raw,JB=$r`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Lb=$r`\(\?R=(?<rDepth>[^\)]+)\)|${JB}`,Op=$r`\(\?<(?![=!])(?<captureName>[^>]+)>`,HR=$r`${Op}|(?<unnamed>\()(?!\?)`,Ta=new RegExp($r`${Op}|${Lb}|\(\?|\\?.`,"gsu"),Y0="Cannot use multiple overlapping recursions";function e9(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=t?.captureTransfers??new Map;if(!new RegExp(Lb,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Gd(e,$r`\(\?\(DEFINE\)`,Vr.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],o=Gd(e,$r`\\[1-9]`,Vr.DEFAULT),u=new Map,c=[];let d=!1,p=0,m=0,g;for(Ta.lastIndex=0;g=Ta.exec(e);){const{0:_,groups:{captureName:v,rDepth:x,gRNameOrNum:C,gRDepth:w}}=g;if(_==="[")p++;else if(p)_==="]"&&p--;else if(x){if(PC(x),d)throw new Error(Y0);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const A=e.slice(0,g.index),R=e.slice(Ta.lastIndex);if(Gd(R,Lb,Vr.DEFAULT))throw new Error(Y0);const N=+x-1;e=BC(A,R,N,!1,n,s,m),i=FC(i,A,N,s.length,0,m);break}else if(C){PC(w);let A=!1;for(const B of c)if(B.name===C||B.num===+C){if(A=!0,B.hasRecursedWithin)throw new Error(Y0);break}if(!A)throw new Error($r`Recursive \g cannot be used outside the referenced group "${r==="external"?C:$r`\g<${C}&R=${w}>`}"`);const R=u.get(C),N=QB(e,R);if(o&&Gd(N,$r`${Op}|\((?!\?)`,Vr.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const L=e.slice(R,g.index),I=N.slice(L.length+_.length),P=s.length,q=+w-1,ee=BC(L,I,q,!0,n,s,m);i=FC(i,L,q,s.length-P,P,m);const F=e.slice(0,R),J=e.slice(R+N.length);e=`${F}${ee}${J}`,Ta.lastIndex+=ee.length-_.length-L.length-I.length,c.forEach(B=>B.hasRecursedWithin=!0),d=!0}else if(v)m++,u.set(String(m),Ta.lastIndex),u.set(v,Ta.lastIndex),c.push({num:m,name:v});else if(_[0]==="("){const A=_==="(";A&&(m++,u.set(String(m),Ta.lastIndex)),c.push(A?{num:m}:{})}else _===")"&&c.pop()}return n.push(...s),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function PC(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function BC(e,t,n,r,i,s,o){const u=new Set;r&&PR(e+t,Op,({groups:{captureName:d}})=>{u.add(d)},Vr.DEFAULT);const c=[n,r?u:null,i,s,o];return`${e}${HC(`(?:${e}`,"forward",...c)}(?:)${HC(`${t})`,"backward",...c)}${t}`}function HC(e,t,n,r,i,s,o){const c=p=>t==="forward"?p+2:n-p+2-1;let d="";for(let p=0;p<n;p++){const m=c(p);d+=Ev(e,$r`${HR}|\\k<(?<backref>[^>]+)>`,({0:g,groups:{captureName:_,unnamed:v,backref:x}})=>{if(x&&r&&!r.has(x))return g;const C=`_$${m}`;if(v||_){const w=o+s.length+1;return s.push(w),t9(i,w),v?g:`(?<${_}${C}>`}return $r`\k<${x}${C}>`},Vr.DEFAULT)}return d}function t9(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function FC(e,t,n,r,i,s){if(e.size&&r){let o=0;PR(t,HR,()=>o++,Vr.DEFAULT);const u=s-o+i,c=new Map;return e.forEach((d,p)=>{const m=(r-o*n)/n,g=o*n,_=p>u+o?p+r:p,v=[];for(const x of d)if(x<=u)v.push(x);else if(x>u+o+m)v.push(x+r);else if(x<=u+o)for(let C=0;C<=n;C++)v.push(x+o*C);else for(let C=0;C<=n;C++)v.push(x+g+m*C);c.set(_,v)}),c}return e}var rn=String.fromCodePoint,Be=String.raw,is={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};is.bugFlagVLiteralHyphenIsRange=is.unicodeSets?(()=>{try{new RegExp(Be`[\d\-a]`,"v")}catch{return!0}return!1})():!1;is.bugNestedClassIgnoresNegation=is.unicodeSets&&new RegExp("[[^a]]","v").test("a");function ep(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function jc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Ob(e,t){return jC[e]>=jC[t]}function n9(e,t){if(e==null)throw new Error(t??"Value expected");return e}var jC={ES2025:2025,ES2024:2024,ES2018:2018},r9={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function FR(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!r9[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=is.flagGroups?"ES2025":is.unicodeSets?"ES2024":"ES2018"),t}var i9="[ -\r ]",s9=new Set([rn(304),rn(305)]),Yi=Be`[\p{L}\p{M}\p{N}\p{Pc}]`;function jR(e){if(s9.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=l9.get(n),s=a9.get(n),o=o9.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),s&&t.add(s),[...t]}var xv=new Map(`C Other
|
|
69
69
|
Cc Control cntrl
|
|
70
70
|
Cf Format
|
|
71
71
|
Cn Unassigned
|
|
@@ -155,11 +155,11 @@ Uppercase Upper
|
|
|
155
155
|
Variation_Selector VS
|
|
156
156
|
White_Space space
|
|
157
157
|
XID_Continue XIDC
|
|
158
|
-
XID_Start XIDS`.split(/\s/).map(e=>[Lp(e),e])),a9=new Map([["s",rn(383)],[rn(383),"s"]]),o9=new Map([[rn(223),rn(7838)],[rn(107),rn(8490)],[rn(229),rn(8491)],[rn(969),rn(8486)]]),l9=new Map([Us(453),Us(456),Us(459),Us(498),...K0(8072,8079),...K0(8088,8095),...K0(8104,8111),Us(8124),Us(8140),Us(8188)]),u9=new Map([["alnum",Be`[\p{Alpha}\p{Nd}]`],["alpha",Be`\p{Alpha}`],["ascii",Be`\p{ASCII}`],["blank",Be`[\p{Zs}\t]`],["cntrl",Be`\p{Cc}`],["digit",Be`\p{Nd}`],["graph",Be`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Be`\p{Lower}`],["print",Be`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Be`[\p{P}\p{S}]`],["space",Be`\p{space}`],["upper",Be`\p{Upper}`],["word",Be`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Be`\p{AHex}`]]);function c9(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Us(e){const t=rn(e);return[t.toLowerCase(),t]}function K0(e,t){return c9(e,t).map(n=>Us(n))}var
|
|
158
|
+
XID_Start XIDS`.split(/\s/).map(e=>[Lp(e),e])),a9=new Map([["s",rn(383)],[rn(383),"s"]]),o9=new Map([[rn(223),rn(7838)],[rn(107),rn(8490)],[rn(229),rn(8491)],[rn(969),rn(8486)]]),l9=new Map([Us(453),Us(456),Us(459),Us(498),...K0(8072,8079),...K0(8088,8095),...K0(8104,8111),Us(8124),Us(8140),Us(8188)]),u9=new Map([["alnum",Be`[\p{Alpha}\p{Nd}]`],["alpha",Be`\p{Alpha}`],["ascii",Be`\p{ASCII}`],["blank",Be`[\p{Zs}\t]`],["cntrl",Be`\p{Cc}`],["digit",Be`\p{Nd}`],["graph",Be`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Be`\p{Lower}`],["print",Be`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Be`[\p{P}\p{S}]`],["space",Be`\p{space}`],["upper",Be`\p{Upper}`],["word",Be`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Be`\p{AHex}`]]);function c9(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Us(e){const t=rn(e);return[t.toLowerCase(),t]}function K0(e,t){return c9(e,t).map(n=>Us(n))}var zR=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function h9(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};UR(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Ob(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};yc(e,d9,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};yc(e,f9,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return yc(e,p9,o),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var d9={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const s=Zr();s.body[0].body.push(Ma({negate:!0,body:r}),cl("Any"));const o=Zr();o.body[0].body.push(DR("greedy",0,1/0,s)),n(zt(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){const o=t.body[s];jc(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=VR(t.get(e));if(n){const r=Zr({flags:n});r.body[0].body=e.body,e.body=[zt(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:s,replaceWith:o},u){const{kind:c,negate:d}=e,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:g,wordIsAscii:_}=u;if(c==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(c==="line_end")o(zt(Ma({body:[Ga({body:[Ab("string_end")]}),Ga({body:[Np(10)]})]}),t));else if(c==="line_start")o(zt(Ki(Be`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c==="search_start")if(g.has(e))i.flags.sticky=!0,s();else{const v=r[n-1];if(v&&y9(v))o(zt(Ma({negate:!0}),t));else{if(m)throw new Error(Be`Uses "\G" in a way that requires a subclass`);o($s(Ab("string_start"),t)),u.strategy="clip_search"}}else if(!(c==="string_end"||c==="string_start"))if(c==="string_end_newline")o(zt(Ki(Be`(?=\n?\z)`),t));else if(c==="word_boundary"){if(!_&&!p){const v=`(?:(?<=${Yi})(?!${Yi})|(?<!${Yi})(?=${Yi}))`,x=`(?:(?<=${Yi})(?=${Yi})|(?<!${Yi})(?!${Yi}))`;o(zt(Ki(d?x:v),t))}}else throw new Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!X0(n)&&(n=Q0(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!X0(r)&&(r=Q0(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=Sf({body:[e]});n(zt(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:s,spaceIsAscii:o,wordIsAscii:u}){const{kind:c,negate:d,value:p}=e;if(s&&(c==="digit"||p==="digit")){n($s(Nb("digit",{negate:d}),t));return}if(o&&(c==="space"||p==="space")){n(zt(Z0(Ki(i9),d),t));return}if(u&&(c==="word"||p==="word")){n($s(Nb("word",{negate:d}),t));return}if(c==="any")n($s(cl("Any"),t));else if(c==="digit")n($s(cl("Nd",{negate:d}),t));else if(c!=="dot")if(c==="text_segment"){if(r==="strict")throw new Error(Be`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",g=Be`\p{RI}{2}|${m}(?:\u200D${m})*`;n(zt(Ki(Be`(?>\r\n|${i?Be`\p{RGI_Emoji}`:g}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c==="hex")n($s(cl("AHex",{negate:d}),t));else if(c==="newline")n(zt(Ki(d?`[^
|
|
159
159
|
]`:`(?>\r
|
|
160
160
|
?|[
|
|
161
|
-
\v\f
\u2028\u2029])`),t));else if(c==="posix")if(!i&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];d&&(m=`\0-${rn(m.codePointAt(0)-1)}${rn(m.codePointAt(2)+1)}-`),n(zt(Ki(`[${m}]`),t))}else n(zt(Z0(Ki(u9.get(p)),d),t));else if(c==="property")xv.has(Lp(p))||(e.key="sc");else if(c==="space")n($s(cl("space",{negate:d}),t));else if(c==="word")n(zt(Z0(Ki(Yi),d),t));else throw new Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:u,flags:c}=e;if(u==="flags")if(!c.enable&&!c.disable)r();else{const d=Zr({flags:c});d.body[0].body=o(),i(zt(d,t),{traverse:!0})}else if(u==="keep"){const d=n.body[0],m=n.body.length===1&&N3(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(Be`Uses "\K" in a way that's unsupported`);const g=Ma({behind:!0});g.body[0].body=s(),i(zt(g,t))}else throw new Error(`Unexpected directive kind "${u}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(zt(Ma({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Zr();t.body[0].body.push(e.body),e.body=zt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=W3(s.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Be`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!X0(n)&&(n=Q0(n,t),e.ref=n)}},f9={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:u,reffedNodesByReferencer:c}){const d=i.get(e);if(d&&u.has(e.number)){const m=$s(zC(e.number),t);c.set(m,u.get(e.number)),n(m);return}u.set(e.number,e),o.set(e.number,[]),e.name&&jc(o,e.name,[]);const p=o.get(e.name??e.number);for(let m=0;m<p.length;m++){const g=p[m];if(d===g.node||d&&d===g.origin||e===g.origin){p.splice(m,1);break}}if(o.get(e.number).push({node:e,origin:d}),e.name&&o.get(e.name).push({node:e,origin:d}),e.name){const m=jc(s,e.name,new Map);let g=!1;if(d)g=!0;else for(const _ of m.values())if(!_.hasDuplicateNameToRemove){g=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:g})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=ep(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:i,ref:s}=e;if(i){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===s||p.number===s)););r.reffedNodesByReferencer.set(e,p);return}const o=r.subroutineRefMap.get(s),u=s===0,c=u?zC(0):$3(o,r.groupOriginByCopy,null);let d=c;if(!u){const p=V3(_9(o,g=>g.type==="Group"&&!!g.flags)),m=p?ep(r.globalFlags,p):r.globalFlags;m9(m,r.currentFlags)||(d=Zr({flags:b9(m)}),d.body[0].body.push(c))}n(zt(d,t),{traverse:!u})}},p9={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const s=r.reffedNodesByReferencer.get(e).filter(o=>g9(o,e));if(!s.length)n(zt(Ma({negate:!0}),t));else if(s.length>1){const o=Zr({atomic:!0,body:s.reverse().map(u=>Ga({body:[Rb(u.number)]}))});n(zt(o,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const i=O3();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function U3(e){yc(e,{"*"({node:t,parent:n}){t.parent=n}})}function m9(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function g9(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=q3(n.parent);for(const i of r){if(i===n)break;if(i===e||G3(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function $3(e,t,n,r){const i=Array.isArray(e)?[]:{};for(const[s,o]of Object.entries(e))s==="parent"?i.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?i[s]=$3(o,t,i,n):(s==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=o);return i}function zC(e){const t=M3(e);return t.isRecursive=!0,t}function _9(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Q0(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function V3(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function b9({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function q3(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function W3(e){const t=e.find(n=>n.kind==="search_start"||S9(n,{negate:!1})||!v9(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=W3(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function G3(e,t){const n=q3(e)??[];for(const r of n)if(r===t||G3(r,t))return!0;return!1}function v9({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function y9(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function S9(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&N3(e.body[0],{type:"Assertion",kind:"search_start"})}function X0(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Ki(e,t){const r=L3(e,{...t,unicodePropertyMap:xv}).body;return r.length>1||r[0].body.length>1?Zr({body:r}):r[0].body[0]}function Z0(e,t){return e.negate=t,e}function $s(e,t){return e.parent=t,e}function zt(e,t){return U3(e),e.parent=t,e}function E9(e,t){const n=F3(t),r=Ob(n.target,"ES2024"),i=Ob(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,u=null;if(!i){const _=[e.flags.ignoreCase];yc(e,x9,{getCurrentModI:()=>_.at(-1),popModI(){_.pop()},pushModI(v){_.push(v)},setHasCasedChar(){_.at(-1)?o=!0:u=!0}})}const c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!u)};let d=e;const p={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&u),useFlagMods:i,useFlagV:r,verbose:n.verbose};function m(_){return p.lastNode=d,d=_,n9(w9[_.type],`Unexpected node type "${_.type}"`)(_,p,m)}const g={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return r||(delete g.options.force.v,g.options.disable.v=!0,g.options.unicodeSetsPlugin=null),g._captureTransfers=new Map,g._hiddenCaptures=[],p.captureMap.forEach((_,v)=>{_.hidden&&g._hiddenCaptures.push(v),_.transferTo&&jc(g._captureTransfers,_.transferTo,[]).push(v)}),g}var x9={"*":{enter({node:e},t){if($C(e)){const n=t.getCurrentModI();t.pushModI(e.flags?ep({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){$C(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){wv(rn(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Y3(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&z3.has(e.value)&&t.setHasCasedChar()}},w9={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Be`\B`:Be`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:s}=e,o={ignoreCase:t.currentFlags.ignoreCase},u=t.originMap.get(e);return u&&(o.hidden=!0,s>u.number&&(o.transferTo=u.number)),t.captureMap.set(s,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=rn(e),r=Zo(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&wv(n)){const i=j3(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:s}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");is.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(VC)&&(o=[Np(45),...o.filter(d=>!VC(d))]);const u=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||is.bugNestedClassIgnoresNegation)&&!i){const p=o.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=Zr(),g=m.body[0];return m.parent=s,g.parent=m,o=o.filter(_=>!p.includes(_)),e.body=o,o.length?(e.parent=g,g.body.push(e)):m.body.pop(),p.forEach(_=>{const v=Ga({body:[_]});_.parent=v,v.parent=m,m.body.push(v)}),n(m)}}t.inCharClass=!0;const d=u();return t.inCharClass=!1,d}const c=o[0];if(r==="union"&&!i&&c&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(is.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&o.length===1&&c.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return u()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Zo(n,i),o=Zo(r,i),u=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const c=Y3(e);R9(c).forEach(p=>{u.add(Array.isArray(p)?`${Zo(p[0],i)}-${Zo(p[1],i)}`:Zo(p,i))})}return`${s}-${o}${[...u].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":Be`[^\n]`;if(e==="digit")return t?Be`\D`:Be`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&z3.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Be`\P`:Be`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Be`\W`:Be`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,s){const o=i.currentFlags;n&&(i.currentFlags=ep(o,n));const u=t.map(s).join("|"),c=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?u:`(?${N9(e,n,i.useFlagMods)}${u})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+L9(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Be`\g<${t}&R=${r}>`}},C9=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),T9=new Set(["-","\\","]","^","["]),k9=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),UC=new Map([[9,Be`\t`],[10,Be`\n`],[11,Be`\v`],[12,Be`\f`],[13,Be`\r`],[8232,Be`\u2028`],[8233,Be`\u2029`],[65279,Be`\uFEFF`]]),A9=new RegExp("^\\p{Cased}$","u");function wv(e){return A9.test(e)}function Y3(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,s=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return s;for(let o=r;o<=i;o++){const u=rn(o);if(!wv(u))continue;const c=j3(u).filter(d=>{const p=d.codePointAt(0);return p<r||p>i});if(c.length&&(s.push(...c),n))break}return s}function Zo(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(UC.has(e))return UC.get(e);if(e<32||e>126&&e<160||e>262143||t&&O9(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?k9:T9:C9,s=rn(e);return(i.has(s)?"\\":"")+s}function R9(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),n=[];let r=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?r??=t[i]:r===null?n.push(t[i]):(n.push([r,t[i]]),r=null);return n}function N9(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:i,disable:s}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function L9({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function $C({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function O9(e){return e>47&&e<58}function VC({type:e,value:t}){return e==="Character"&&t===45}var D9=class Db extends RegExp{#e=new Map;#t=null;#n;#i=null;#r=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,n,r){const i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const s=t;super(s,n),this.#n=s.source,s instanceof Db&&(this.#e=s.#e,this.#i=s.#i,this.#r=s.#r,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#n=t,this.#e=I9(s.hiddenCaptures,s.transfers),this.#r=s.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){const{lazyCompile:i,...s}=this.rawOptions;this.#t=new Db(this.#n,this.flags,s)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#r==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#s(t.slice(r));return i&&(M9(i,r,t,this.hasIndices),this.lastIndex+=r),i}return this.#s(t)}#s(t){this.#t.lastIndex=this.lastIndex;const n=super.exec.call(this.#t,t);if(this.lastIndex=this.#t.lastIndex,!n||!this.#e.size)return n;const r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const s=[0];for(let o=1;o<r.length;o++){const{hidden:u,transferTo:c}=this.#e.get(o)??{};if(u?s.push(null):(s.push(n.length),n.push(r[o]),this.hasIndices&&n.indices.push(i[o])),c&&r[o]!==void 0){const d=s[c];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(n[d]=r[o],this.hasIndices&&(n.indices[d]=i[o]),n.groups){this.#i||(this.#i=P9(this.source));const p=this.#i.get(c);p&&(n.groups[p]=r[o],this.hasIndices&&(n.indices.groups[p]=i[o]))}}}return n}};function M9(e,t,n,r){if(e.index+=t,e.input=n,r){const i=e.indices;for(let o=0;o<i.length;o++){const u=i[o];u&&(i[o]=[u[0]+t,u[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const u=s[o];u&&(s[o]=[u[0]+t,u[1]+t])})}}function I9(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const s of i)jc(n,s,{}).transferTo=r;return n}function P9(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,s;for(;s=t.exec(e);){const{0:o,groups:{capture:u,name:c}}=s;o==="["?r++:r?o==="]"&&r--:u&&(i++,c&&n.set(i,c))}return n}function B9(e,t){const n=H9(e,t);return n.options?new D9(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function H9(e,t){const n=F3(t),r=L3(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:xv}),i=h9(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=E9(i,n),o=e9(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),u=ZB(o.pattern),c=XB(u.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),d={pattern:c.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=c.hiddenCaptures.sort((v,x)=>v-x),m=Array.from(c.captureTransfers),g=i._strategy,_=d.pattern.length>=n.lazyCompileLength;(p.length||m.length||g||_)&&(d.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...g&&{strategy:g},..._&&{lazyCompile:_}})}return d}const qC=4294967295;class F9{constructor(t,n={}){this.patterns=t,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:s}=n;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;const u=i?.get(o);if(u){if(u instanceof RegExp)return u;if(r)return null;throw u}try{const c=s(o);return i?.set(o,c),c}catch(c){if(i?.set(o,c),r)return null;throw c}})}regexps;findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,s=[];function o(u,c,d=0){return{index:u,captureIndices:c.indices.map(p=>p==null?{start:qC,end:qC,length:0}:{start:p[0]+d,end:p[1]+d,length:p[1]-p[0]})}}for(let u=0;u<this.regexps.length;u++){const c=this.regexps[u];if(c)try{c.lastIndex=n;const d=c.exec(i);if(!d)continue;if(d.index===n)return o(u,d,0);s.push([u,d,0])}catch(d){if(this.options.forgiving)continue;throw d}}if(s.length){const u=Math.min(...s.map(c=>c[1].index));for(const[c,d,p]of s)if(d.index===u)return o(c,d,p)}return null}}function j9(e,t){return B9(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function z9(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>j9(n,{target:t.target}),{createScanner(n){return new F9(n,t)},createString(n){return{content:n}}}}async function K3(e){if(PA())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=B0.get(e);if(t!=null)return t;try{const n=E3[e];if(n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled languages`);const r=n().then(({default:i})=>{const s={name:e,data:i};return Wa.has(e)||Wa.set(e,s),s});return B0.set(e,r),await r}finally{B0.delete(e)}}function Q3(e){return Wa.get(e)??K3(e)}const ss=new Map,J0=new Map,Mb=new Map,Ib=new Set;function Pb(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let r;if(typeof n=="string"){if(r=ss.get(n),r==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else r=n,n=n.name,ss.has(n)||ss.set(n,r);Ib.has(n)||(Ib.add(n),t.loadThemeSync(r))}}async function X3(e){if(PA())throw new Error(`resolveTheme("${e}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=J0.get(e);if(t!=null)return t;try{const n=Mb.get(e)??x3[e];if(n==null)throw new Error(`resolveTheme: No valid loader for ${e}`);const r=n().then(s=>U9(e,"default"in s?s.default:s));J0.set(e,r);const i=await r;if(i.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${i.name}`);return ss.set(i.name,i),i}finally{J0.delete(e)}}function U9(e,t){const n=ss.get(e);return n??(t=kp(t),ss.set(e,t),t)}function Z3(e){return ss.get(e)??X3(e)}function J3(e,t){if(Mb.has(e)){console.error("SharedHighlight.registerCustomTheme: theme name already registered",e);return}Mb.set(e,t)}let pi;async function tp({themes:e,langs:t}){pi??=tB({themes:[],langs:["text"],engine:z9()});const n=$9(pi)?await pi:pi;pi=n;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const o=Q3(s);"then"in o?r.push(o):tC(o,n)}const i=[];for(const s of e){const o=Z3(s);"then"in o?i.push(o):Pb(o,pi)}return(r.length>0||i.length>0)&&await Promise.all([Promise.all(r).then(s=>{tC(s,n)}),Promise.all(i).then(s=>{Pb(s,n)})]),n}function eR(){if(pi!=null&&!("then"in pi))return pi}function $9(e=pi){return e!=null&&"then"in e}J3("pierre-dark",()=>j(()=>import("./pierre-dark-BXuwtOqb.js"),[]));J3("pierre-light",()=>j(()=>import("./pierre-light-dckrK0oj.js"),[]));function zc(e=vn){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Sc(e){for(const t of zc(e))if(!Ib.has(t))return!1;return!0}function Bb(e){for(const t of e)if(!ss.has(t))return!1;return!0}function Dp(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ta(e){return{type:"text",value:e}}function tt({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function Hb({name:e,width:t=16,height:n=16,properties:r}){return tt({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...r},children:[tt({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function V9(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ef(e){return tt({tagName:"div",children:[tt({tagName:"div",children:e.annotations?.map(t=>tt({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function q9(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function tR({fileOrDiff:e,themeStyles:t,themeType:n}){const r="type"in e?e:void 0,i={"data-diffs-header":"","data-change-type":r?.type,"data-theme-type":n!=="system"?n:void 0,style:t};return tt({tagName:"div",children:[W9({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:r?.type??"file"}),G9(r)],properties:i})}function W9({name:e,prevName:t,iconType:n}){const r=[Hb({name:q9(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(tt({tagName:"div",children:[ta(t)],properties:{"data-prev-name":""}})),r.push(Hb({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(tt({tagName:"div",children:[ta(e)],properties:{"data-title":""}})),tt({tagName:"div",children:r,properties:{"data-header-content":""}})}function G9(e){const t=[];if(e!=null){let n=0,r=0;for(const i of e.hunks)n+=i.additionLines,r+=i.deletionLines;(r>0||n===0)&&t.push(tt({tagName:"span",children:[ta(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&t.push(tt({tagName:"span",children:[ta(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(tt({tagName:"slot",properties:{name:eh}})),tt({tagName:"div",children:t,properties:{"data-metadata":""}})}function nR(e){return tt({tagName:"pre",properties:Y9(e)})}function Y9({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,themeType:s,themeStyles:o,totalLines:u}){const c={"data-diffs":"","data-type":i?"split":"file","data-overflow":r,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,"data-theme-type":s!=="system"?s:void 0,style:o,tabIndex:0};return c.style+=`--diffs-min-number-column-width-default:${`${u}`.length}ch;`,c}const Wu={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function vi(e){if(Wu[e]!=null)return Wu[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);return t!=null&&Wu[t[1]]!=null?Wu[t[1]]??"text":Wu[e.match(/\.([^.]+)$/)?.[1]??""]??"text"}function rR(e,t){return{langs:[e??"text"],themes:zc(t.theme)}}function Ya(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function Ka(e){return e.replace(/\n$|\r\n$/,"")}function K9(e,t,n){const r=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t];if(r==null)throw console.error({node:e,line:t,state:n}),new Error(`processLine: line ${t}, contains no state.lineInfo`);return e.tagName="span",e.properties["data-column-content"]="",e.children.length===0&&e.children.push(ta(`
|
|
162
|
-
`)),tt({tagName:"div",children:[tt({tagName:"span",children:[tt({tagName:"span",children:[{type:"text",value:`${r.lineNumber}`}],properties:{"data-line-number-content":""}})],properties:{"data-column-number":""}}),e],properties:{"data-line":r.lineNumber,"data-alt-line":r.altLineNumber,"data-line-type":r.type,"data-line-index":r.lineIndex}})}function Q9(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=u=>u}=e,i=new Map;function s(u){return Object.entries(u).map(([c,d])=>`${c}:${d}`).join(";")}function o(u){const c=typeof u=="string"?u:s(u);let d=t+X9(c)+n;return d=r(d),i.has(d)||i.set(d,typeof u=="string"?u:{...u}),d}return{name:"@shikijs/transformers:style-to-class",pre(u){if(!u.properties.style)return;const c=o(u.properties.style);delete u.properties.style,this.addClassToHast(u,c)},tokens(u){for(const c of u)for(const d of c){if(!d.htmlStyle)continue;const p=o(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${p}`:d.htmlAttrs.class=p}},getClassRegistry(){return i},getCSS(){let u="";for(const[c,d]of i.entries())u+=`.${c}{${typeof d=="string"?d:s(d)}}`;return u},clearRegistry(){i.clear()}}}function X9(e,t=0){let n=3735928559^t,r=1103547991^t;for(let i=0,s;i<e.length;i++)s=e.charCodeAt(i),n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function
|
|
161
|
+
\v\f
\u2028\u2029])`),t));else if(c==="posix")if(!i&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];d&&(m=`\0-${rn(m.codePointAt(0)-1)}${rn(m.codePointAt(2)+1)}-`),n(zt(Ki(`[${m}]`),t))}else n(zt(Z0(Ki(u9.get(p)),d),t));else if(c==="property")xv.has(Lp(p))||(e.key="sc");else if(c==="space")n($s(cl("space",{negate:d}),t));else if(c==="word")n(zt(Z0(Ki(Yi),d),t));else throw new Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:u,flags:c}=e;if(u==="flags")if(!c.enable&&!c.disable)r();else{const d=Zr({flags:c});d.body[0].body=o(),i(zt(d,t),{traverse:!0})}else if(u==="keep"){const d=n.body[0],m=n.body.length===1&&NR(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(Be`Uses "\K" in a way that's unsupported`);const g=Ma({behind:!0});g.body[0].body=s(),i(zt(g,t))}else throw new Error(`Unexpected directive kind "${u}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(zt(Ma({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Zr();t.body[0].body.push(e.body),e.body=zt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=WR(s.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Be`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!X0(n)&&(n=Q0(n,t),e.ref=n)}},f9={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:u,reffedNodesByReferencer:c}){const d=i.get(e);if(d&&u.has(e.number)){const m=$s(zC(e.number),t);c.set(m,u.get(e.number)),n(m);return}u.set(e.number,e),o.set(e.number,[]),e.name&&jc(o,e.name,[]);const p=o.get(e.name??e.number);for(let m=0;m<p.length;m++){const g=p[m];if(d===g.node||d&&d===g.origin||e===g.origin){p.splice(m,1);break}}if(o.get(e.number).push({node:e,origin:d}),e.name&&o.get(e.name).push({node:e,origin:d}),e.name){const m=jc(s,e.name,new Map);let g=!1;if(d)g=!0;else for(const _ of m.values())if(!_.hasDuplicateNameToRemove){g=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:g})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=ep(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:i,ref:s}=e;if(i){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===s||p.number===s)););r.reffedNodesByReferencer.set(e,p);return}const o=r.subroutineRefMap.get(s),u=s===0,c=u?zC(0):$R(o,r.groupOriginByCopy,null);let d=c;if(!u){const p=VR(_9(o,g=>g.type==="Group"&&!!g.flags)),m=p?ep(r.globalFlags,p):r.globalFlags;m9(m,r.currentFlags)||(d=Zr({flags:b9(m)}),d.body[0].body.push(c))}n(zt(d,t),{traverse:!u})}},p9={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const s=r.reffedNodesByReferencer.get(e).filter(o=>g9(o,e));if(!s.length)n(zt(Ma({negate:!0}),t));else if(s.length>1){const o=Zr({atomic:!0,body:s.reverse().map(u=>Ga({body:[Rb(u.number)]}))});n(zt(o,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const i=OR();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function UR(e){yc(e,{"*"({node:t,parent:n}){t.parent=n}})}function m9(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function g9(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=qR(n.parent);for(const i of r){if(i===n)break;if(i===e||GR(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function $R(e,t,n,r){const i=Array.isArray(e)?[]:{};for(const[s,o]of Object.entries(e))s==="parent"?i.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?i[s]=$R(o,t,i,n):(s==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=o);return i}function zC(e){const t=MR(e);return t.isRecursive=!0,t}function _9(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Q0(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function VR(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function b9({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function qR(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function WR(e){const t=e.find(n=>n.kind==="search_start"||S9(n,{negate:!1})||!v9(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=WR(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function GR(e,t){const n=qR(e)??[];for(const r of n)if(r===t||GR(r,t))return!0;return!1}function v9({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function y9(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function S9(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&NR(e.body[0],{type:"Assertion",kind:"search_start"})}function X0(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Ki(e,t){const r=LR(e,{...t,unicodePropertyMap:xv}).body;return r.length>1||r[0].body.length>1?Zr({body:r}):r[0].body[0]}function Z0(e,t){return e.negate=t,e}function $s(e,t){return e.parent=t,e}function zt(e,t){return UR(e),e.parent=t,e}function E9(e,t){const n=FR(t),r=Ob(n.target,"ES2024"),i=Ob(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,u=null;if(!i){const _=[e.flags.ignoreCase];yc(e,x9,{getCurrentModI:()=>_.at(-1),popModI(){_.pop()},pushModI(v){_.push(v)},setHasCasedChar(){_.at(-1)?o=!0:u=!0}})}const c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!u)};let d=e;const p={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&u),useFlagMods:i,useFlagV:r,verbose:n.verbose};function m(_){return p.lastNode=d,d=_,n9(w9[_.type],`Unexpected node type "${_.type}"`)(_,p,m)}const g={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return r||(delete g.options.force.v,g.options.disable.v=!0,g.options.unicodeSetsPlugin=null),g._captureTransfers=new Map,g._hiddenCaptures=[],p.captureMap.forEach((_,v)=>{_.hidden&&g._hiddenCaptures.push(v),_.transferTo&&jc(g._captureTransfers,_.transferTo,[]).push(v)}),g}var x9={"*":{enter({node:e},t){if($C(e)){const n=t.getCurrentModI();t.pushModI(e.flags?ep({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){$C(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){wv(rn(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),YR(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&zR.has(e.value)&&t.setHasCasedChar()}},w9={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Be`\B`:Be`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:s}=e,o={ignoreCase:t.currentFlags.ignoreCase},u=t.originMap.get(e);return u&&(o.hidden=!0,s>u.number&&(o.transferTo=u.number)),t.captureMap.set(s,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=rn(e),r=Zo(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&wv(n)){const i=jR(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:s}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");is.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(VC)&&(o=[Np(45),...o.filter(d=>!VC(d))]);const u=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||is.bugNestedClassIgnoresNegation)&&!i){const p=o.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=Zr(),g=m.body[0];return m.parent=s,g.parent=m,o=o.filter(_=>!p.includes(_)),e.body=o,o.length?(e.parent=g,g.body.push(e)):m.body.pop(),p.forEach(_=>{const v=Ga({body:[_]});_.parent=v,v.parent=m,m.body.push(v)}),n(m)}}t.inCharClass=!0;const d=u();return t.inCharClass=!1,d}const c=o[0];if(r==="union"&&!i&&c&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(is.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&o.length===1&&c.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return u()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Zo(n,i),o=Zo(r,i),u=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const c=YR(e);R9(c).forEach(p=>{u.add(Array.isArray(p)?`${Zo(p[0],i)}-${Zo(p[1],i)}`:Zo(p,i))})}return`${s}-${o}${[...u].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":Be`[^\n]`;if(e==="digit")return t?Be`\D`:Be`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&zR.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Be`\P`:Be`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Be`\W`:Be`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,s){const o=i.currentFlags;n&&(i.currentFlags=ep(o,n));const u=t.map(s).join("|"),c=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?u:`(?${N9(e,n,i.useFlagMods)}${u})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+L9(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Be`\g<${t}&R=${r}>`}},C9=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),T9=new Set(["-","\\","]","^","["]),k9=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),UC=new Map([[9,Be`\t`],[10,Be`\n`],[11,Be`\v`],[12,Be`\f`],[13,Be`\r`],[8232,Be`\u2028`],[8233,Be`\u2029`],[65279,Be`\uFEFF`]]),A9=new RegExp("^\\p{Cased}$","u");function wv(e){return A9.test(e)}function YR(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,s=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return s;for(let o=r;o<=i;o++){const u=rn(o);if(!wv(u))continue;const c=jR(u).filter(d=>{const p=d.codePointAt(0);return p<r||p>i});if(c.length&&(s.push(...c),n))break}return s}function Zo(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(UC.has(e))return UC.get(e);if(e<32||e>126&&e<160||e>262143||t&&O9(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?k9:T9:C9,s=rn(e);return(i.has(s)?"\\":"")+s}function R9(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),n=[];let r=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?r??=t[i]:r===null?n.push(t[i]):(n.push([r,t[i]]),r=null);return n}function N9(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:i,disable:s}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function L9({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function $C({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function O9(e){return e>47&&e<58}function VC({type:e,value:t}){return e==="Character"&&t===45}var D9=class Db extends RegExp{#e=new Map;#t=null;#n;#i=null;#r=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,n,r){const i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const s=t;super(s,n),this.#n=s.source,s instanceof Db&&(this.#e=s.#e,this.#i=s.#i,this.#r=s.#r,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#n=t,this.#e=I9(s.hiddenCaptures,s.transfers),this.#r=s.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){const{lazyCompile:i,...s}=this.rawOptions;this.#t=new Db(this.#n,this.flags,s)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#r==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#s(t.slice(r));return i&&(M9(i,r,t,this.hasIndices),this.lastIndex+=r),i}return this.#s(t)}#s(t){this.#t.lastIndex=this.lastIndex;const n=super.exec.call(this.#t,t);if(this.lastIndex=this.#t.lastIndex,!n||!this.#e.size)return n;const r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const s=[0];for(let o=1;o<r.length;o++){const{hidden:u,transferTo:c}=this.#e.get(o)??{};if(u?s.push(null):(s.push(n.length),n.push(r[o]),this.hasIndices&&n.indices.push(i[o])),c&&r[o]!==void 0){const d=s[c];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(n[d]=r[o],this.hasIndices&&(n.indices[d]=i[o]),n.groups){this.#i||(this.#i=P9(this.source));const p=this.#i.get(c);p&&(n.groups[p]=r[o],this.hasIndices&&(n.indices.groups[p]=i[o]))}}}return n}};function M9(e,t,n,r){if(e.index+=t,e.input=n,r){const i=e.indices;for(let o=0;o<i.length;o++){const u=i[o];u&&(i[o]=[u[0]+t,u[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const u=s[o];u&&(s[o]=[u[0]+t,u[1]+t])})}}function I9(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const s of i)jc(n,s,{}).transferTo=r;return n}function P9(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,s;for(;s=t.exec(e);){const{0:o,groups:{capture:u,name:c}}=s;o==="["?r++:r?o==="]"&&r--:u&&(i++,c&&n.set(i,c))}return n}function B9(e,t){const n=H9(e,t);return n.options?new D9(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function H9(e,t){const n=FR(t),r=LR(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:xv}),i=h9(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=E9(i,n),o=e9(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),u=ZB(o.pattern),c=XB(u.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),d={pattern:c.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=c.hiddenCaptures.sort((v,x)=>v-x),m=Array.from(c.captureTransfers),g=i._strategy,_=d.pattern.length>=n.lazyCompileLength;(p.length||m.length||g||_)&&(d.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...g&&{strategy:g},..._&&{lazyCompile:_}})}return d}const qC=4294967295;class F9{constructor(t,n={}){this.patterns=t,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:s}=n;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;const u=i?.get(o);if(u){if(u instanceof RegExp)return u;if(r)return null;throw u}try{const c=s(o);return i?.set(o,c),c}catch(c){if(i?.set(o,c),r)return null;throw c}})}regexps;findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,s=[];function o(u,c,d=0){return{index:u,captureIndices:c.indices.map(p=>p==null?{start:qC,end:qC,length:0}:{start:p[0]+d,end:p[1]+d,length:p[1]-p[0]})}}for(let u=0;u<this.regexps.length;u++){const c=this.regexps[u];if(c)try{c.lastIndex=n;const d=c.exec(i);if(!d)continue;if(d.index===n)return o(u,d,0);s.push([u,d,0])}catch(d){if(this.options.forgiving)continue;throw d}}if(s.length){const u=Math.min(...s.map(c=>c[1].index));for(const[c,d,p]of s)if(d.index===u)return o(c,d,p)}return null}}function j9(e,t){return B9(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function z9(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>j9(n,{target:t.target}),{createScanner(n){return new F9(n,t)},createString(n){return{content:n}}}}async function KR(e){if(PA())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=B0.get(e);if(t!=null)return t;try{const n=ER[e];if(n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled languages`);const r=n().then(({default:i})=>{const s={name:e,data:i};return Wa.has(e)||Wa.set(e,s),s});return B0.set(e,r),await r}finally{B0.delete(e)}}function QR(e){return Wa.get(e)??KR(e)}const ss=new Map,J0=new Map,Mb=new Map,Ib=new Set;function Pb(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let r;if(typeof n=="string"){if(r=ss.get(n),r==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else r=n,n=n.name,ss.has(n)||ss.set(n,r);Ib.has(n)||(Ib.add(n),t.loadThemeSync(r))}}async function XR(e){if(PA())throw new Error(`resolveTheme("${e}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=J0.get(e);if(t!=null)return t;try{const n=Mb.get(e)??xR[e];if(n==null)throw new Error(`resolveTheme: No valid loader for ${e}`);const r=n().then(s=>U9(e,"default"in s?s.default:s));J0.set(e,r);const i=await r;if(i.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${i.name}`);return ss.set(i.name,i),i}finally{J0.delete(e)}}function U9(e,t){const n=ss.get(e);return n??(t=kp(t),ss.set(e,t),t)}function ZR(e){return ss.get(e)??XR(e)}function JR(e,t){if(Mb.has(e)){console.error("SharedHighlight.registerCustomTheme: theme name already registered",e);return}Mb.set(e,t)}let pi;async function tp({themes:e,langs:t}){pi??=tB({themes:[],langs:["text"],engine:z9()});const n=$9(pi)?await pi:pi;pi=n;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const o=QR(s);"then"in o?r.push(o):tC(o,n)}const i=[];for(const s of e){const o=ZR(s);"then"in o?i.push(o):Pb(o,pi)}return(r.length>0||i.length>0)&&await Promise.all([Promise.all(r).then(s=>{tC(s,n)}),Promise.all(i).then(s=>{Pb(s,n)})]),n}function e3(){if(pi!=null&&!("then"in pi))return pi}function $9(e=pi){return e!=null&&"then"in e}JR("pierre-dark",()=>j(()=>import("./pierre-dark-BXuwtOqb.js"),[]));JR("pierre-light",()=>j(()=>import("./pierre-light-dckrK0oj.js"),[]));function zc(e=vn){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Sc(e){for(const t of zc(e))if(!Ib.has(t))return!1;return!0}function Bb(e){for(const t of e)if(!ss.has(t))return!1;return!0}function Dp(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ta(e){return{type:"text",value:e}}function tt({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function Hb({name:e,width:t=16,height:n=16,properties:r}){return tt({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...r},children:[tt({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function V9(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ef(e){return tt({tagName:"div",children:[tt({tagName:"div",children:e.annotations?.map(t=>tt({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function q9(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function t3({fileOrDiff:e,themeStyles:t,themeType:n}){const r="type"in e?e:void 0,i={"data-diffs-header":"","data-change-type":r?.type,"data-theme-type":n!=="system"?n:void 0,style:t};return tt({tagName:"div",children:[W9({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:r?.type??"file"}),G9(r)],properties:i})}function W9({name:e,prevName:t,iconType:n}){const r=[Hb({name:q9(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(tt({tagName:"div",children:[ta(t)],properties:{"data-prev-name":""}})),r.push(Hb({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(tt({tagName:"div",children:[ta(e)],properties:{"data-title":""}})),tt({tagName:"div",children:r,properties:{"data-header-content":""}})}function G9(e){const t=[];if(e!=null){let n=0,r=0;for(const i of e.hunks)n+=i.additionLines,r+=i.deletionLines;(r>0||n===0)&&t.push(tt({tagName:"span",children:[ta(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&t.push(tt({tagName:"span",children:[ta(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(tt({tagName:"slot",properties:{name:eh}})),tt({tagName:"div",children:t,properties:{"data-metadata":""}})}function n3(e){return tt({tagName:"pre",properties:Y9(e)})}function Y9({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,themeType:s,themeStyles:o,totalLines:u}){const c={"data-diffs":"","data-type":i?"split":"file","data-overflow":r,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,"data-theme-type":s!=="system"?s:void 0,style:o,tabIndex:0};return c.style+=`--diffs-min-number-column-width-default:${`${u}`.length}ch;`,c}const Wu={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function vi(e){if(Wu[e]!=null)return Wu[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);return t!=null&&Wu[t[1]]!=null?Wu[t[1]]??"text":Wu[e.match(/\.([^.]+)$/)?.[1]??""]??"text"}function r3(e,t){return{langs:[e??"text"],themes:zc(t.theme)}}function Ya(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function Ka(e){return e.replace(/\n$|\r\n$/,"")}function K9(e,t,n){const r=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t];if(r==null)throw console.error({node:e,line:t,state:n}),new Error(`processLine: line ${t}, contains no state.lineInfo`);return e.tagName="span",e.properties["data-column-content"]="",e.children.length===0&&e.children.push(ta(`
|
|
162
|
+
`)),tt({tagName:"div",children:[tt({tagName:"span",children:[tt({tagName:"span",children:[{type:"text",value:`${r.lineNumber}`}],properties:{"data-line-number-content":""}})],properties:{"data-column-number":""}}),e],properties:{"data-line":r.lineNumber,"data-alt-line":r.altLineNumber,"data-line-type":r.type,"data-line-index":r.lineIndex}})}function Q9(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=u=>u}=e,i=new Map;function s(u){return Object.entries(u).map(([c,d])=>`${c}:${d}`).join(";")}function o(u){const c=typeof u=="string"?u:s(u);let d=t+X9(c)+n;return d=r(d),i.has(d)||i.set(d,typeof u=="string"?u:{...u}),d}return{name:"@shikijs/transformers:style-to-class",pre(u){if(!u.properties.style)return;const c=o(u.properties.style);delete u.properties.style,this.addClassToHast(u,c)},tokens(u){for(const c of u)for(const d of c){if(!d.htmlStyle)continue;const p=o(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${p}`:d.htmlAttrs.class=p}},getClassRegistry(){return i},getCSS(){let u="";for(const[c,d]of i.entries())u+=`.${c}{${typeof d=="string"?d:s(d)}}`;return u},clearRegistry(){i.clear()}}}function X9(e,t=0){let n=3735928559^t,r=1103547991^t;for(let i=0,s;i<e.length;i++)s=e.charCodeAt(i),n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function i3(e=!1){const t={lineInfo:{}},n=[{line(r){return delete r.properties.class,r},pre(r){const i=V9(r),s=[];if(i!=null){let o=1;for(const u of i.children)u.type==="element"&&(s.push(K9(u,o,t)),o++);i.children=s}return r}}];return e&&n.push(Z9,WC),{state:t,transformers:n,toClass:WC}}const WC=Q9({classPrefix:"hl-"}),Z9={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const r={};n.color!=null&&(r.color=n.color),n.bgColor!=null&&(r["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(r["font-style"]="italic"),(n.fontStyle&2)!==0&&(r["font-weight"]="bold"),(n.fontStyle&4)!==0&&(r["text-decoration"]="underline")),Object.keys(r).length>0&&(n.htmlStyle=r)}}};function yr(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function s3({theme:e=vn,highlighter:t,prefix:n}){let r="";if(typeof e=="string"){const i=t.getTheme(e);r+=`color:${i.fg};`,r+=`background-color:${i.bg};`,r+=`${yr("global")}fg:${i.fg};`,r+=`${yr("global")}bg:${i.bg};`,r+=e_(i,n)}else{let i=t.getTheme(e.dark);r+=`${yr("global")}dark:${i.fg};`,r+=`${yr("global")}dark-bg:${i.bg};`,r+=e_(i,"dark"),i=t.getTheme(e.light),r+=`${yr("global")}light:${i.fg};`,r+=`${yr("global")}light-bg:${i.bg};`,r+=e_(i,"light")}return r}function e_(e,t){t=t!=null?`${t}-`:"";let n="";const r=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];r!=null&&(n+=`${yr("global")}${t}addition-color:${r};`);const i=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];i!=null&&(n+=`${yr("global")}${t}deletion-color:${i};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(n+=`${yr("global")}${t}modified-color:${s};`),n}function Fb(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function a3(e,t,{theme:n=vn,tokenizeMaxLineLength:r},i=!1){const{state:s,transformers:o}=i3(),u=i?"text":e.lang??vi(e.name),c=(()=>{if(typeof n=="string")return t.getTheme(n).type})(),d=s3({theme:n,highlighter:t});s.lineInfo=m=>({type:"context",lineIndex:m-1,lineNumber:m});const p=typeof n=="string"?{lang:u,theme:n,transformers:o,defaultColor:!1,cssVariablePrefix:yr("token"),tokenizeMaxLineLength:r}:{lang:u,themes:n,transformers:o,defaultColor:!1,cssVariablePrefix:yr("token"),tokenizeMaxLineLength:r};return{code:Fb(t.codeToHast(Ka(e.contents),p)),themeStyles:d,baseThemeType:c}}var J9=class{highlighter;renderCache;computedLang="text";lineAnnotations={};constructor(e={theme:vn},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Sc(e.theme??vn)?e3():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&this.mergeOptions({themeType:e})}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.renderCache=void 0,this.highlighter=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e);let n=this.workerManager?.getFileResultCache(e);n!=null&&!t_(t,n.options)&&(n=void 0),this.renderCache??={file:e,options:t,highlighted:!0,result:n?.result},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightFileAST(this,e):this.asyncHighlight(e).then(({result:r,options:i})=>{this.onHighlightSuccess(e,r,i)})}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:r=vn,tokenizeMaxLineLength:i=1e3}=this.options;return{theme:r,tokenizeMaxLineLength:i}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceRender:!0}:e!==n.file||!t_(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderFile(e=this.renderCache?.file){if(e==null)return;const t=this.workerManager?.getFileResultCache(e);t!=null&&this.renderCache==null&&(this.renderCache={file:e,highlighted:!0,...t});const{options:n,forceRender:r}=this.getRenderOptions(e);if(this.renderCache??={file:e,highlighted:!1,options:n,result:void 0},this.workerManager?.isWorkingPool()===!0)this.renderCache.result??=this.workerManager.getPlainFileAST(e),(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??vi(e.name);const i=this.highlighter!=null&&Sc(n.theme),s=this.highlighter!=null&&zf(this.computedLang);if(this.highlighter!=null&&i&&(r||!this.renderCache.highlighted&&s||this.renderCache.result==null)){const{result:o,options:u}=this.renderFileWithHighlighter(e,this.highlighter,!s);this.renderCache={file:e,options:u,highlighted:s,result:o}}(!i||!s)&&this.asyncHighlight(e).then(({result:o,options:u})=>{this.onHighlightSuccess(e,o,u)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,this.renderCache.result):void 0}async asyncRender(e){const{result:t}=await this.asyncHighlight(e);return this.processFileResult(e,t)}async asyncHighlight(e){this.computedLang=e.lang??vi(e.name);const t=this.highlighter!=null&&Bb(zc(this.options.theme)),n=this.highlighter!=null&&zf(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter)}renderFileWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e);return{result:a3(e,t,r,n),options:r}}processFileResult(e,t){const{disableFileHeader:n=!1}=this.options,r=[];let i=1;for(const s of t.code){r.push(s);const o=this.lineAnnotations[i];o!=null&&r.push(Ef({hunkIndex:0,lineIndex:i,annotations:o.map(u=>Ya(u))})),i++}return{codeAST:r,preAST:this.createPreElement(t.code.length,t.themeStyles,t.baseThemeType),headerAST:n?void 0:this.renderHeader(e,t.themeStyles,t.baseThemeType),totalLines:t.code.length,themeStyles:t.themeStyles,baseThemeType:t.baseThemeType,css:""}}renderHeader(e,t,n){const{themeType:r="system"}=this.options;return t3({fileOrDiff:e,themeStyles:t,themeType:n??r})}renderFullHTML(e){return rs(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(tt({tagName:"code",children:e.codeAST,properties:{"data-code":""}})),{...e.preAST,children:t}}renderPartialHTML(e,t=!1){return rs(t?tt({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await tp(r3(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;const r=this.renderCache.file!==e||!this.renderCache.highlighted||!t_(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:!0,result:t},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}createPreElement(e,t,n){const{disableLineNumbers:r=!1,overflow:i="scroll",themeType:s="system"}=this.options;return n3({diffIndicators:"none",disableBackground:!0,disableLineNumbers:r,overflow:i,themeStyles:t,themeType:n??s,split:!1,totalLines:e})}};function t_(e,t){return Dp(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}const o3=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
163
163
|
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
164
164
|
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
165
165
|
</symbol>
|
|
@@ -208,7 +208,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[Lp(e),e])),a9=new Map([["s",rn(383)],[rn(383
|
|
|
208
208
|
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
209
209
|
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
|
|
210
210
|
</symbol>
|
|
211
|
-
</svg>`;function jb(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function
|
|
211
|
+
</svg>`;function jb(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function l3(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function xf({pre:e,columnType:t}={}){const n=document.createElement("code");return n.dataset.code="",t!=null&&(n.dataset[t]=""),e?.appendChild(n),n}function u3(){const e=document.createElement("div");return e.slot="hover-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e}function c3(){const e=document.createElement("style");return e.setAttribute(lv,""),e}var e7=`@layer base, theme, unsafe;
|
|
212
212
|
|
|
213
213
|
@layer base {
|
|
214
214
|
:host {
|
|
@@ -1271,25 +1271,25 @@ XID_Start XIDS`.split(/\s/).map(e=>[Lp(e),e])),a9=new Map([["s",rn(383)],[rn(383
|
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
|
-
`;const t7="@layer base, theme, unsafe;";function
|
|
1274
|
+
`;const t7="@layer base, theme, unsafe;";function h3(e){return`${t7}
|
|
1275
1275
|
@layer unsafe {
|
|
1276
1276
|
${e}
|
|
1277
|
-
}`}function dR(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function fR({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,pre:i,split:s,themeStyles:o,themeType:u,totalLines:c}){switch(u==="system"?delete i.dataset.themeType:i.dataset.themeType=u,e){case"bars":case"classic":i.dataset.indicators=e;break;case"none":delete i.dataset.indicators;break}return n?i.dataset.disableLineNumbers="":delete i.dataset.disableLineNumbers,t?delete i.dataset.background:i.dataset.background="",i.dataset.type=s?"split":"file",i.dataset.overflow=r,i.dataset.diffs="",i.tabIndex=0,i.style=o,i.style.setProperty("--diffs-min-number-column-width-default",`${`${c}`.length}ch`),i}if(typeof HTMLElement<"u"&&customElements.get(xl)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const r=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(e7)),r.adoptedStyleSheets=[e]}}customElements.define(xl,t)}const pR=!0;let n7=-1;var r7=class{static LoadedCustomComponent=pR;__id=++n7;fileContainer;spriteSVG;pre;code;unsafeCSSStyle;hoverContent;errorWrapper;headerElement;headerMetadata;fileRenderer;resizeManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];file;constructor(t={theme:vn},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.fileRenderer=new J9(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new IA,this.mouseEventManager=new MA("file",jf(t)),this.lineSelectionManager=new DA(Ff(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){this.file!=null&&this.render({file:this.file,forceRender:!0})}setOptions(t){t!=null&&(this.options=t,this.mouseEventManager.setOptions(jf(t)),this.lineSelectionManager.setOptions(Ff(t)))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){if((this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.fileRenderer.setThemeType(t),this.headerElement!=null&&(t==="system"?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=t),this.pre!=null))switch(t){case"system":delete this.pre.dataset.themeType;break;case"light":case"dark":this.pre.dataset.themeType=t;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t){this.lineSelectionManager.setSelection(t)}cleanUp(){this.fileRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.file=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.headerElement=void 0,this.errorWrapper=void 0,this.unsafeCSSStyle=void 0}hydrate(t){const{fileContainer:n,prerenderedHTML:r}=t;dR(n,r);for(const i of Array.from(n.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(lv)){this.unsafeCSSStyle=i;continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}}}if(this.pre==null)this.render(t);else{const{file:i,lineAnnotations:s}=t;this.fileContainer=n,delete this.pre.dataset.dehydrated,this.lineAnnotations=s??this.lineAnnotations,this.file=i,this.fileRenderer.hydrate(i),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??"scroll")==="scroll"&&this.resizeManager.setup(this.pre)}}render({file:t,fileContainer:n,forceRender:r=!1,containerWrapper:i,lineAnnotations:s}){const o=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!r&&jb(this.file,t)&&!o)return;this.file=t,this.fileRenderer.setOptions(this.options),s!=null&&this.setLineAnnotations(s),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableFileHeader:u=!1}=this.options;u&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),n=this.getOrCreateFileContainerNode(n,i);try{const c=this.fileRenderer.renderFile(t);if(c==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}c.headerAST!=null&&this.applyHeaderToDOM(c.headerAST,n);const d=this.getOrCreatePreNode(n);this.applyHunksToDOM(c,d),this.renderAnnotations(),this.renderHoverUtility()}catch(c){c instanceof Error&&this.applyErrorToDOM(c,n)}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(const n of this.annotationElements)n.parentNode?.removeChild(n);this.annotationElements.length=0;const{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const n of this.lineAnnotations){const r=t(n);if(r==null)continue;const i=lR(Ya(n));i.appendChild(r),this.annotationElements.push(i),this.fileContainer.appendChild(i)}}renderHoverUtility(){const{renderHoverUtility:t}=this.options;if(this.fileContainer==null||t==null)return;this.hoverContent==null&&(this.hoverContent=uR(),this.fileContainer.appendChild(this.hoverContent));const n=t(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML="",n!=null&&this.hoverContent.appendChild(n)}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:t}=this.options;if(t==null||t===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.parentNode?.removeChild(this.unsafeCSSStyle),this.unsafeCSSStyle=void 0);return}this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=cR(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=hR(t)}applyHunksToDOM(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t),n.innerHTML="",this.code=xf(),this.code.innerHTML=this.fileRenderer.renderPartialHTML(t.codeAST),n.appendChild(this.code),this.injectUnsafeCSS(),this.mouseEventManager.setup(n),this.lineSelectionManager.setup(n),this.lineSelectionManager.setDirty(),(this.options.overflow??"scroll")==="scroll"?this.resizeManager.setup(n):this.resizeManager.cleanUp()}applyHeaderToDOM(t,n){const{file:r}=this;if(r==null)return;this.cleanupErrorWrapper();const i=document.createElement("div");i.innerHTML=rs(t);const s=i.firstElementChild;if(!(s instanceof HTMLElement)||(this.headerElement!=null?n.shadowRoot?.replaceChild(s,this.headerElement):n.shadowRoot?.prepend(s),this.headerElement=s,this.isContainerManaged))return;const{renderCustomMetadata:o}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const u=o?.(r)??void 0;u!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=eh,u instanceof Element?this.headerMetadata.appendChild(u):this.headerMetadata.innerText=`${u}`,n.appendChild(this.headerMetadata))}getOrCreateFileContainerNode(t,n){if(this.fileContainer=t??this.fileContainer??document.createElement(xl),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=oR;const i=r.firstChild;i instanceof SVGElement&&(this.spriteSVG=i,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getOrCreatePreNode(t){return this.pre==null?(this.pre=document.createElement("pre"),t.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==t&&t.shadowRoot?.appendChild(this.pre),this.pre}applyPreNodeAttributes(t,{totalLines:n,themeStyles:r,baseThemeType:i}){const{overflow:s="scroll",themeType:o="system",disableLineNumbers:u=!1}=this.options;fR({pre:t,split:!1,themeStyles:r,overflow:s,disableLineNumbers:u,themeType:i??o,diffIndicators:"none",disableBackground:!0,totalLines:n})}applyErrorToDOM(t,n){this.cleanupErrorWrapper();const r=this.getOrCreatePreNode(n);r.innerHTML="",r.parentNode?.removeChild(r),this.pre=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);const s=document.createElement("div");s.dataset.errorMessage="",s.innerText=t.message,this.errorWrapper.appendChild(s);const o=document.createElement("pre");o.dataset.errorStack="",o.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}},i7=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const r of e.children??[])r instanceof HTMLElement&&("deletions"in r.dataset?t=r:"additions"in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Jo(e){return tt({tagName:"div",properties:{"data-buffer":"",style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function n_(e){return tt({tagName:"div",children:[tt({tagName:"span",properties:{"data-column-number":""}}),tt({tagName:"span",children:[ta("No newline at end of file")],properties:{"data-column-content":""}})],properties:{"data-no-newline":"","data-line-type":e}})}function r_(e){return tt({tagName:"div",children:[Hb({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{"data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function i_({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:s,isLastHunk:o}){const u=[];if(e==="metadata"&&t!=null&&u.push(tt({tagName:"div",children:[ta(t)],properties:{"data-separator-wrapper":""}})),e==="line-info"&&t!=null){const c=[];n!=null&&(r?(s||c.push(r_("up")),o||c.push(r_("down"))):c.push(r_(!s&&!o?"both":s?"down":"up"))),c.push(tt({tagName:"div",children:[tt({tagName:"span",children:[ta(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),u.push(tt({tagName:"div",children:c,properties:{"data-separator-wrapper":"","data-separator-multi-button":c.length>2?"":void 0}}))}return e==="custom"&&i!=null&&u.push(tt({tagName:"slot",properties:{name:i}})),tt({tagName:"div",children:u,properties:{"data-separator":u.length===0?"":e,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":o?"":void 0}})}function s7(e,t){return`hunk-separator-${e}-${t}`}function a7(e){const t=e[e.length-1];return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}class Cv{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const s=this.castInput(t,r),o=this.castInput(n,r),u=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(u,c,r,i)}diffWithOptionsObj(t,n,r,i){var s;const o=A=>{if(A=this.postProcess(A,r),i){setTimeout(function(){i(A)},0);return}else return A},u=n.length,c=t.length;let d=1,p=u+c;r.maxEditLength!=null&&(p=Math.min(p,r.maxEditLength));const m=(s=r.timeout)!==null&&s!==void 0?s:1/0,g=Date.now()+m,_=[{oldPos:-1,lastComponent:void 0}];let v=this.extractCommon(_[0],n,t,0,r);if(_[0].oldPos+1>=c&&v+1>=u)return o(this.buildValues(_[0].lastComponent,n,t));let x=-1/0,C=1/0;const w=()=>{for(let A=Math.max(x,-d);A<=Math.min(C,d);A+=2){let R;const N=_[A-1],L=_[A+1];N&&(_[A-1]=void 0);let I=!1;if(L){const q=L.oldPos-A;I=L&&0<=q&&q<u}const P=N&&N.oldPos+1<c;if(!I&&!P){_[A]=void 0;continue}if(!P||I&&N.oldPos<L.oldPos?R=this.addToPath(L,!0,!1,0,r):R=this.addToPath(N,!1,!0,1,r),v=this.extractCommon(R,n,t,A,r),R.oldPos+1>=c&&v+1>=u)return o(this.buildValues(R.lastComponent,n,t))||!0;_[A]=R,R.oldPos+1>=c&&(C=Math.min(C,A-1)),v+1>=u&&(x=Math.max(x,A+1))}d++};if(i)(function A(){setTimeout(function(){if(d>p||Date.now()>g)return i(void 0);w()||A()},0)})();else for(;d<=p&&Date.now()<=g;){const A=w();if(A)return A}}addToPath(t,n,r,i,s){const o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(t,n,r,i,s){const o=n.length,u=r.length;let c=t.oldPos,d=c-i,p=0;for(;d+1<o&&c+1<u&&this.equals(r[c+1],n[d+1],s);)d++,c++,p++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return p&&!s.oneChangePerToken&&(t.lastComponent={count:p,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,d}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const i=[];let s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();const o=i.length;let u=0,c=0,d=0;for(;u<o;u++){const p=i[u];if(p.removed)p.value=this.join(r.slice(d,d+p.count)),d+=p.count;else{if(!p.added&&this.useLongestToken){let m=n.slice(c,c+p.count);m=m.map(function(g,_){const v=r[d+_];return v.length>g.length?v:g}),p.value=this.join(m)}else p.value=this.join(n.slice(c,c+p.count));c+=p.count,p.added||(d+=p.count)}}return i}}class o7 extends Cv{}const l7=new o7;function u7(e,t,n){return l7.diff(e,t,n)}const GC="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class c7 extends Cv{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${GC}]+|[^\\S\\n\\r]+|[^${GC}]`,"ug");return t.match(n)||[]}}const h7=new c7;function d7(e,t,n){return h7.diff(e,t,n)}class f7 extends Cv{constructor(){super(...arguments),this.tokenize=m7}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
1277
|
+
}`}function d3(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function f3({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,pre:i,split:s,themeStyles:o,themeType:u,totalLines:c}){switch(u==="system"?delete i.dataset.themeType:i.dataset.themeType=u,e){case"bars":case"classic":i.dataset.indicators=e;break;case"none":delete i.dataset.indicators;break}return n?i.dataset.disableLineNumbers="":delete i.dataset.disableLineNumbers,t?delete i.dataset.background:i.dataset.background="",i.dataset.type=s?"split":"file",i.dataset.overflow=r,i.dataset.diffs="",i.tabIndex=0,i.style=o,i.style.setProperty("--diffs-min-number-column-width-default",`${`${c}`.length}ch`),i}if(typeof HTMLElement<"u"&&customElements.get(xl)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const r=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(e7)),r.adoptedStyleSheets=[e]}}customElements.define(xl,t)}const p3=!0;let n7=-1;var r7=class{static LoadedCustomComponent=p3;__id=++n7;fileContainer;spriteSVG;pre;code;unsafeCSSStyle;hoverContent;errorWrapper;headerElement;headerMetadata;fileRenderer;resizeManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];file;constructor(t={theme:vn},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.fileRenderer=new J9(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new IA,this.mouseEventManager=new MA("file",jf(t)),this.lineSelectionManager=new DA(Ff(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){this.file!=null&&this.render({file:this.file,forceRender:!0})}setOptions(t){t!=null&&(this.options=t,this.mouseEventManager.setOptions(jf(t)),this.lineSelectionManager.setOptions(Ff(t)))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){if((this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.fileRenderer.setThemeType(t),this.headerElement!=null&&(t==="system"?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=t),this.pre!=null))switch(t){case"system":delete this.pre.dataset.themeType;break;case"light":case"dark":this.pre.dataset.themeType=t;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t){this.lineSelectionManager.setSelection(t)}cleanUp(){this.fileRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.file=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.headerElement=void 0,this.errorWrapper=void 0,this.unsafeCSSStyle=void 0}hydrate(t){const{fileContainer:n,prerenderedHTML:r}=t;d3(n,r);for(const i of Array.from(n.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(lv)){this.unsafeCSSStyle=i;continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}}}if(this.pre==null)this.render(t);else{const{file:i,lineAnnotations:s}=t;this.fileContainer=n,delete this.pre.dataset.dehydrated,this.lineAnnotations=s??this.lineAnnotations,this.file=i,this.fileRenderer.hydrate(i),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??"scroll")==="scroll"&&this.resizeManager.setup(this.pre)}}render({file:t,fileContainer:n,forceRender:r=!1,containerWrapper:i,lineAnnotations:s}){const o=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!r&&jb(this.file,t)&&!o)return;this.file=t,this.fileRenderer.setOptions(this.options),s!=null&&this.setLineAnnotations(s),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableFileHeader:u=!1}=this.options;u&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),n=this.getOrCreateFileContainerNode(n,i);try{const c=this.fileRenderer.renderFile(t);if(c==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}c.headerAST!=null&&this.applyHeaderToDOM(c.headerAST,n);const d=this.getOrCreatePreNode(n);this.applyHunksToDOM(c,d),this.renderAnnotations(),this.renderHoverUtility()}catch(c){c instanceof Error&&this.applyErrorToDOM(c,n)}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(const n of this.annotationElements)n.parentNode?.removeChild(n);this.annotationElements.length=0;const{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const n of this.lineAnnotations){const r=t(n);if(r==null)continue;const i=l3(Ya(n));i.appendChild(r),this.annotationElements.push(i),this.fileContainer.appendChild(i)}}renderHoverUtility(){const{renderHoverUtility:t}=this.options;if(this.fileContainer==null||t==null)return;this.hoverContent==null&&(this.hoverContent=u3(),this.fileContainer.appendChild(this.hoverContent));const n=t(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML="",n!=null&&this.hoverContent.appendChild(n)}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:t}=this.options;if(t==null||t===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.parentNode?.removeChild(this.unsafeCSSStyle),this.unsafeCSSStyle=void 0);return}this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=c3(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=h3(t)}applyHunksToDOM(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t),n.innerHTML="",this.code=xf(),this.code.innerHTML=this.fileRenderer.renderPartialHTML(t.codeAST),n.appendChild(this.code),this.injectUnsafeCSS(),this.mouseEventManager.setup(n),this.lineSelectionManager.setup(n),this.lineSelectionManager.setDirty(),(this.options.overflow??"scroll")==="scroll"?this.resizeManager.setup(n):this.resizeManager.cleanUp()}applyHeaderToDOM(t,n){const{file:r}=this;if(r==null)return;this.cleanupErrorWrapper();const i=document.createElement("div");i.innerHTML=rs(t);const s=i.firstElementChild;if(!(s instanceof HTMLElement)||(this.headerElement!=null?n.shadowRoot?.replaceChild(s,this.headerElement):n.shadowRoot?.prepend(s),this.headerElement=s,this.isContainerManaged))return;const{renderCustomMetadata:o}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const u=o?.(r)??void 0;u!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=eh,u instanceof Element?this.headerMetadata.appendChild(u):this.headerMetadata.innerText=`${u}`,n.appendChild(this.headerMetadata))}getOrCreateFileContainerNode(t,n){if(this.fileContainer=t??this.fileContainer??document.createElement(xl),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=o3;const i=r.firstChild;i instanceof SVGElement&&(this.spriteSVG=i,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getOrCreatePreNode(t){return this.pre==null?(this.pre=document.createElement("pre"),t.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==t&&t.shadowRoot?.appendChild(this.pre),this.pre}applyPreNodeAttributes(t,{totalLines:n,themeStyles:r,baseThemeType:i}){const{overflow:s="scroll",themeType:o="system",disableLineNumbers:u=!1}=this.options;f3({pre:t,split:!1,themeStyles:r,overflow:s,disableLineNumbers:u,themeType:i??o,diffIndicators:"none",disableBackground:!0,totalLines:n})}applyErrorToDOM(t,n){this.cleanupErrorWrapper();const r=this.getOrCreatePreNode(n);r.innerHTML="",r.parentNode?.removeChild(r),this.pre=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);const s=document.createElement("div");s.dataset.errorMessage="",s.innerText=t.message,this.errorWrapper.appendChild(s);const o=document.createElement("pre");o.dataset.errorStack="",o.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}},i7=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const r of e.children??[])r instanceof HTMLElement&&("deletions"in r.dataset?t=r:"additions"in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Jo(e){return tt({tagName:"div",properties:{"data-buffer":"",style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function n_(e){return tt({tagName:"div",children:[tt({tagName:"span",properties:{"data-column-number":""}}),tt({tagName:"span",children:[ta("No newline at end of file")],properties:{"data-column-content":""}})],properties:{"data-no-newline":"","data-line-type":e}})}function r_(e){return tt({tagName:"div",children:[Hb({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{"data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function i_({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:s,isLastHunk:o}){const u=[];if(e==="metadata"&&t!=null&&u.push(tt({tagName:"div",children:[ta(t)],properties:{"data-separator-wrapper":""}})),e==="line-info"&&t!=null){const c=[];n!=null&&(r?(s||c.push(r_("up")),o||c.push(r_("down"))):c.push(r_(!s&&!o?"both":s?"down":"up"))),c.push(tt({tagName:"div",children:[tt({tagName:"span",children:[ta(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),u.push(tt({tagName:"div",children:c,properties:{"data-separator-wrapper":"","data-separator-multi-button":c.length>2?"":void 0}}))}return e==="custom"&&i!=null&&u.push(tt({tagName:"slot",properties:{name:i}})),tt({tagName:"div",children:u,properties:{"data-separator":u.length===0?"":e,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":o?"":void 0}})}function s7(e,t){return`hunk-separator-${e}-${t}`}function a7(e){const t=e[e.length-1];return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}class Cv{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const s=this.castInput(t,r),o=this.castInput(n,r),u=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(u,c,r,i)}diffWithOptionsObj(t,n,r,i){var s;const o=A=>{if(A=this.postProcess(A,r),i){setTimeout(function(){i(A)},0);return}else return A},u=n.length,c=t.length;let d=1,p=u+c;r.maxEditLength!=null&&(p=Math.min(p,r.maxEditLength));const m=(s=r.timeout)!==null&&s!==void 0?s:1/0,g=Date.now()+m,_=[{oldPos:-1,lastComponent:void 0}];let v=this.extractCommon(_[0],n,t,0,r);if(_[0].oldPos+1>=c&&v+1>=u)return o(this.buildValues(_[0].lastComponent,n,t));let x=-1/0,C=1/0;const w=()=>{for(let A=Math.max(x,-d);A<=Math.min(C,d);A+=2){let R;const N=_[A-1],L=_[A+1];N&&(_[A-1]=void 0);let I=!1;if(L){const q=L.oldPos-A;I=L&&0<=q&&q<u}const P=N&&N.oldPos+1<c;if(!I&&!P){_[A]=void 0;continue}if(!P||I&&N.oldPos<L.oldPos?R=this.addToPath(L,!0,!1,0,r):R=this.addToPath(N,!1,!0,1,r),v=this.extractCommon(R,n,t,A,r),R.oldPos+1>=c&&v+1>=u)return o(this.buildValues(R.lastComponent,n,t))||!0;_[A]=R,R.oldPos+1>=c&&(C=Math.min(C,A-1)),v+1>=u&&(x=Math.max(x,A+1))}d++};if(i)(function A(){setTimeout(function(){if(d>p||Date.now()>g)return i(void 0);w()||A()},0)})();else for(;d<=p&&Date.now()<=g;){const A=w();if(A)return A}}addToPath(t,n,r,i,s){const o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(t,n,r,i,s){const o=n.length,u=r.length;let c=t.oldPos,d=c-i,p=0;for(;d+1<o&&c+1<u&&this.equals(r[c+1],n[d+1],s);)d++,c++,p++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return p&&!s.oneChangePerToken&&(t.lastComponent={count:p,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,d}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const i=[];let s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();const o=i.length;let u=0,c=0,d=0;for(;u<o;u++){const p=i[u];if(p.removed)p.value=this.join(r.slice(d,d+p.count)),d+=p.count;else{if(!p.added&&this.useLongestToken){let m=n.slice(c,c+p.count);m=m.map(function(g,_){const v=r[d+_];return v.length>g.length?v:g}),p.value=this.join(m)}else p.value=this.join(n.slice(c,c+p.count));c+=p.count,p.added||(d+=p.count)}}return i}}class o7 extends Cv{}const l7=new o7;function u7(e,t,n){return l7.diff(e,t,n)}const GC="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class c7 extends Cv{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${GC}]+|[^\\S\\n\\r]+|[^${GC}]`,"ug");return t.match(n)||[]}}const h7=new c7;function d7(e,t,n){return h7.diff(e,t,n)}class f7 extends Cv{constructor(){super(...arguments),this.tokenize=m7}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
1278
1278
|
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
1279
1279
|
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
1280
1280
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
1281
1281
|
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const p7=new f7;function YC(e,t,n){return p7.diff(e,t,n)}function m7(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
1282
1282
|
`));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){const s=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function g7(e,t,n,r,i,s,o){let u;u={},typeof u.context>"u"&&(u.context=4);const c=u.context;if(u.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(u.callback){const{callback:p}=u;YC(n,r,Object.assign(Object.assign({},u),{callback:m=>{const g=d(m);p(g)}}))}else return d(YC(n,r,u));function d(p){if(!p)return;p.push({value:"",lines:[]});function m(A){return A.map(function(R){return" "+R})}const g=[];let _=0,v=0,x=[],C=1,w=1;for(let A=0;A<p.length;A++){const R=p[A],N=R.lines||b7(R.value);if(R.lines=N,R.added||R.removed){if(!_){const L=p[A-1];_=C,v=w,L&&(x=c>0?m(L.lines.slice(-c)):[],_-=x.length,v-=x.length)}for(const L of N)x.push((R.added?"+":"-")+L);R.added?w+=N.length:C+=N.length}else{if(_)if(N.length<=c*2&&A<p.length-2)for(const L of m(N))x.push(L);else{const L=Math.min(N.length,c);for(const P of m(N.slice(0,L)))x.push(P);const I={oldStart:_,oldLines:C-_+L,newStart:v,newLines:w-v+L,lines:x};g.push(I),_=0,v=0,x=[]}C+=N.length,w+=N.length}}for(const A of g)for(let R=0;R<A.lines.length;R++)A.lines[R].endsWith(`
|
|
1283
|
-
`)?A.lines[R]=A.lines[R].slice(0,-1):(A.lines.splice(R+1,0,"\"),R++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:s,hunks:g}}}function
|
|
1283
|
+
`)?A.lines[R]=A.lines[R].slice(0,-1):(A.lines.splice(R+1,0,"\"),R++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:s,hunks:g}}}function m3(e){if(Array.isArray(e))return e.map(m3).join(`
|
|
1284
1284
|
`);const t=[];e.oldFileName==e.newFileName&&t.push("Index: "+e.oldFileName),t.push("==================================================================="),t.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),t.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader));for(let n=0;n<e.hunks.length;n++){const r=e.hunks[n];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),t.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@");for(const i of r.lines)t.push(i)}return t.join(`
|
|
1285
1285
|
`)+`
|
|
1286
|
-
`}function _7(e,t,n,r,i,s,o){{const u=g7(e,t,n,r,i,s);return u?
|
|
1286
|
+
`}function _7(e,t,n,r,i,s,o){{const u=g7(e,t,n,r,i,s);return u?m3(u):void 0}}function b7(e){const t=e.endsWith(`
|
|
1287
1287
|
`),n=e.split(`
|
|
1288
1288
|
`).map(r=>r+`
|
|
1289
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function KC({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function Yd({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){const s=t[t.length-1];if(s==null||i||!n){t.push([r?0:1,e.value]);return}const o=s[0]===0;if(r===o||r&&e.value.length===1&&!o){s[1]+=e.value;return}t.push([r?0:1,e.value])}function gR(e,t,n,r=!1){const i=(()=>{const d=n.theme??vn;if(typeof d=="string")return t.getTheme(d).type})(),s=sR({theme:n.theme,highlighter:t});if(e.newLines!=null&&e.oldLines!=null){const{oldContent:d,newContent:p,oldInfo:m,newInfo:g,oldDecorations:_,newDecorations:v}=QC({hunks:e.hunks,oldLines:e.oldLines,newLines:e.newLines,lineDiffType:n.lineDiffType});return{code:XC({oldFile:{name:e.prevName??e.name,contents:d},oldInfo:m,oldDecorations:_,newFile:{name:e.name,contents:p},newInfo:g,newDecorations:v,highlighter:t,options:n,languageOverride:r?"text":e.lang}),themeStyles:s,baseThemeType:i}}const o=[];let u=0,c=0;for(const d of e.hunks){const{oldContent:p,newContent:m,oldInfo:g,newInfo:_,oldDecorations:v,newDecorations:x,splitLineIndex:C,unifiedLineIndex:w}=QC({hunks:[d],splitLineIndex:u,unifiedLineIndex:c,lineDiffType:n.lineDiffType}),A={name:e.prevName??e.name,contents:p},R={name:e.name,contents:m};o.push(XC({oldFile:A,oldInfo:g,oldDecorations:v,newFile:R,newInfo:_,newDecorations:x,highlighter:t,options:n,languageOverride:r?"text":e.lang})),u=C,c=w}return{code:(()=>{if(o.length<=1){const d=o[0]??{oldLines:[],newLines:[]};if(d.newLines.length===0||d.oldLines.length===0)return d}return{hunks:o}})(),themeStyles:s,baseThemeType:i}}function v7({oldLine:e,newLine:t,oldLineIndex:n,newLineIndex:r,oldDecorations:i,newDecorations:s,lineDiffType:o}){if(e==null||t==null||o==="none")return;e=Ka(e),t=Ka(t);const u=o==="char"?u7(e,t):d7(e,t),c=[],d=[],p=o==="word-alt";for(const g of u){const _=g===u[u.length-1];!g.added&&!g.removed?(Yd({item:g,arr:c,enableJoin:p,isNeutral:!0,isLastItem:_}),Yd({item:g,arr:d,enableJoin:p,isNeutral:!0,isLastItem:_})):g.removed?Yd({item:g,arr:c,enableJoin:p,isLastItem:_}):Yd({item:g,arr:d,enableJoin:p,isLastItem:_})}let m=0;for(const g of c)g[0]===1&&i.push(KC({line:n-1,spanStart:m,spanLength:g[1].length})),m+=g[1].length;m=0;for(const g of d)g[0]===1&&s.push(KC({line:r-1,spanStart:m,spanLength:g[1].length})),m+=g[1].length}function QC({hunks:e,oldLines:t,newLines:n,splitLineIndex:r=0,unifiedLineIndex:i=0,lineDiffType:s}){const o={},u={},c=[],d=[];let p=1,m=1,g=1,_=1,v="",x="";for(const C of e){for(;t!=null&&n!=null&&p<C.additionStart&&m<C.deletionStart;)o[m]={type:"context-expanded",lineNumber:_,altLineNumber:g,lineIndex:`${i},${r}`},u[p]={type:"context-expanded",lineNumber:g,altLineNumber:_,lineIndex:`${i},${r}`},v+=t[m-1],x+=n[p-1],m++,p++,_++,g++,r++,i++;_=C.deletionStart,g=C.additionStart;for(const w of C.hunkContent)if(w.type==="context")for(const A of w.lines)o[m]={type:"context",lineNumber:_,altLineNumber:g,lineIndex:`${i},${r}`},u[p]={type:"context",lineNumber:g,altLineNumber:_,lineIndex:`${i},${r}`},v+=A,x+=A,m++,p++,g++,_++,r++,i++;else{const A=Math.max(w.additions.length,w.deletions.length);let R=0,N=i;for(;R<A;){const L=w.deletions[R],I=w.additions[R];v7({newLine:I,oldLine:L,oldLineIndex:m,newLineIndex:p,oldDecorations:c,newDecorations:d,lineDiffType:s}),L!=null&&(o[m]={type:"change-deletion",lineNumber:_,lineIndex:`${N},${r}`},v+=L,m++,_++),I!=null&&(u[p]={type:"change-addition",lineNumber:g,lineIndex:`${N+w.deletions.length},${r}`},x+=I,p++,g++),r++,N++,R++}i+=w.additions.length+w.deletions.length}if(!(t==null||n==null||C!==e[e.length-1]))for(;m<=t.length||p<=t.length;){const w=t[m-1],A=n[p-1];if(w==null&&A==null)break;w!=null&&(o[m]={type:"context-expanded",lineNumber:_,altLineNumber:g,lineIndex:`${i},${r}`},v+=w,m++,_++),A!=null&&(u[p]={type:"context-expanded",lineNumber:g,altLineNumber:_,lineIndex:`${i},${r}`},x+=A,p++,g++),r++,i++}}return{oldContent:v,newContent:x,oldInfo:o,newInfo:u,oldDecorations:c,newDecorations:d,splitLineIndex:r,unifiedLineIndex:i}}function XC({oldFile:e,newFile:t,oldInfo:n,newInfo:r,highlighter:i,oldDecorations:s,newDecorations:o,languageOverride:u,options:{theme:c=vn,...d}}){const p=u??vi(e.name),m=u??vi(t.name),{state:g,transformers:_}=iR(),v=typeof c=="string"?{...d,lang:"text",theme:c,transformers:_,decorations:void 0,defaultColor:!1,cssVariablePrefix:yr("token")}:{...d,lang:"text",themes:c,transformers:_,decorations:void 0,defaultColor:!1,cssVariablePrefix:yr("token")};return{oldLines:e.contents===""?[]:(v.lang=p,g.lineInfo=n,v.decorations=s,Fb(i.codeToHast(Ka(e.contents),v))),newLines:t.contents===""?[]:(v.lang=m,v.decorations=o,g.lineInfo=r,Fb(i.codeToHast(Ka(t.contents),v)))}}const y7={fromStart:0,fromEnd:0};var S7=class{highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:vn},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Sc(e.theme??vn)?eR():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){this.getOptionsWithDefaults().themeType!==e&&this.mergeOptions({themeType:e})}expandHunk(e,t){const{expansionLineCount:n}=this.getOptionsWithDefaults(),r=this.expandedHunks.get(e)??{fromStart:0,fromEnd:0};(t==="up"||t==="both")&&(r.fromStart+=n),(t==="down"||t==="both")&&(r.fromEnd+=n),this.expandedHunks.set(e,r)}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),r=n[t.lineNumber]??[];n[t.lineNumber]=r,r.push(t)}}getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,expandUnchanged:s=!1,expansionLineCount:o=100,hunkSeparators:u="line-info",lineDiffType:c="word-alt",maxLineDiffLength:d=1e3,overflow:p="scroll",theme:m=vn,themeType:g="system",tokenizeMaxLineLength:_=1e3,useCSSClasses:v=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,expandUnchanged:s,expansionLineCount:o,hunkSeparators:u,lineDiffType:c,maxLineDiffLength:d,overflow:p,theme:this.workerManager?.getDiffRenderOptions().theme??m,themeType:g,tokenizeMaxLineLength:_,useCSSClasses:v}}async initializeHighlighter(){return this.highlighter=await tp(rR(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e);let n=this.workerManager?.getDiffResultCache(e);n!=null&&!s_(t,n.options)&&(n=void 0),this.renderCache??={diff:e,highlighted:!0,options:t,result:n?.result},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(e).then(({result:r,options:i})=>{this.onHighlightSuccess(e,r,i)})}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:r,tokenizeMaxLineLength:i,lineDiffType:s}=this.getOptionsWithDefaults();return{theme:r,tokenizeMaxLineLength:i,lineDiffType:s}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceRender:!0}:e!==n.diff||!s_(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderDiff(e=this.renderCache?.diff){if(e==null)return;const t=this.workerManager?.getDiffResultCache(e);t!=null&&this.renderCache==null&&(this.renderCache={diff:e,highlighted:!0,...t});const{options:n,forceRender:r}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:n,result:void 0},this.workerManager?.isWorkingPool()===!0)this.renderCache.result??=this.workerManager.getPlainDiffAST(e),(!this.renderCache.highlighted||r)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??vi(e.name);const i=this.highlighter!=null&&Sc(n.theme),s=this.highlighter!=null&&zf(this.computedLang);if(this.highlighter!=null&&i&&(r||!this.renderCache.highlighted&&s||this.renderCache.result==null)){const{result:o,options:u}=this.renderDiffWithHighlighter(e,this.highlighter,!s);this.renderCache={diff:e,options:u,highlighted:s,result:o}}(!i||!s)&&this.asyncHighlight(e).then(({result:o,options:u})=>{this.onHighlightSuccess(e,o,u)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,this.renderCache.result):void 0}async asyncRender(e){const{result:t}=await this.asyncHighlight(e);return this.processDiffResult(e,t)}createPreElement(e,t,n,r){const{diffIndicators:i,disableBackground:s,disableLineNumbers:o,overflow:u,themeType:c}=this.getOptionsWithDefaults();return nR({diffIndicators:i,disableBackground:s,disableLineNumbers:o,overflow:u,themeStyles:n,split:e,themeType:r??c,totalLines:t})}async asyncHighlight(e){this.computedLang=e.lang??vi(e.name);const t=this.highlighter!=null&&Sc(this.options.theme??vn),n=this.highlighter!=null&&zf(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e);return{result:gR(e,t,r,n),options:r}}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;const r=this.renderCache.diff!==e||!this.renderCache.highlighted||!s_(this.renderCache.options,n);this.renderCache={diff:e,options:n,highlighted:!0,result:t},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,{code:t,themeStyles:n,baseThemeType:r}){const{diffStyle:i,disableFileHeader:s}=this.getOptionsWithDefaults();this.diff=e;const o=i==="unified";let u=[],c=[],d=[],p=0;const m=[];let g,_=0;for(const C of e.hunks)_+=C.collapsedBefore,_=this.renderHunks({ast:t,hunk:C,prevHunk:g,hunkIndex:p,isLastHunk:p===e.hunks.length-1,additionsAST:u,deletionsAST:c,unifiedAST:d,hunkData:m,lineIndex:_}),p++,g=C;const v=Math.max(a7(e.hunks),e.newLines?.length??0,e.oldLines?.length??0);u=!o&&(t.hunks!=null||t.newLines.length>0)?u:void 0,c=!o&&(t.hunks!=null||t.oldLines.length>0)?c:void 0,d=d.length>0?d:void 0;const x=this.createPreElement(c!=null&&u!=null,v,n,r);return{additionsAST:u,deletionsAST:c,unifiedAST:d,hunkData:m,preNode:x,themeStyles:n,baseThemeType:r,headerElement:s?void 0:this.renderHeader(this.diff,n,r),totalLines:v,css:""}}renderFullAST(e,t=[]){return e.unifiedAST!=null&&t.push(tt({tagName:"code",children:e.unifiedAST,properties:{"data-code":"","data-unified":""}})),e.deletionsAST!=null&&t.push(tt({tagName:"code",children:e.deletionsAST,properties:{"data-code":"","data-deletions":""}})),e.additionsAST!=null&&t.push(tt({tagName:"code",children:e.additionsAST,properties:{"data-code":"","data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return rs(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?rs(e):rs(tt({tagName:"code",children:e,properties:{"data-code":"",[`data-${t}`]:""}}))}renderCollapsedHunks({ast:e,hunkData:t,hunkIndex:n,hunkSpecs:r,isFirstHunk:i,isLastHunk:s,rangeSize:o,lineIndex:u,additionLineNumber:c,deletionLineNumber:d,unifiedAST:p,deletionsAST:m,additionsAST:g}){if(o<=0)return;const{hunkSeparators:_,expandUnchanged:v,diffStyle:x,expansionLineCount:C}=this.getOptionsWithDefaults(),w=e.hunks==null&&e.newLines.length>0&&e.oldLines.length>0,A=this.expandedHunks.get(n)??y7,R=o>C,N=Math.max(v?0:o-(A.fromEnd+A.fromStart),0),L=({type:P,linesAST:q})=>{if(_==="line-info"||_==="custom"){const ee=s7(P,n);q.push(i_({type:_,content:E7(N),expandIndex:w?n:void 0,chunked:R,slotName:ee,isFirstHunk:i,isLastHunk:s})),t.push({slotName:ee,hunkIndex:n,lines:N,type:P,expandable:w?{up:w&&!i,down:w,chunked:R}:void 0})}else _==="metadata"&&r!=null?q.push(i_({type:"metadata",content:r,isFirstHunk:i,isLastHunk:s})):_==="simple"&&n>0&&q.push(i_({type:"simple",isFirstHunk:i,isLastHunk:!1}))},I=({rangeLen:P,fromStart:q})=>{if(e.newLines==null||e.oldLines==null)return;const ee=s?0:q?o:P;let F=d-ee,J=c-ee,B=u-ee;for(let V=0;V<P;V++){const Y=e.oldLines[F],X=e.newLines[J];if(Y==null||X==null)throw console.error({aLineNumber:J,dLineNumber:F,ast:e}),new Error("DiffHunksRenderer.renderHunks prefill context invalid. Must include data for old and new lines");F++,J++,x==="unified"?this.pushLineWithAnnotation({newLine:X,unifiedAST:p,unifiedSpan:this.getAnnotations("unified",F,J,n,B)}):this.pushLineWithAnnotation({newLine:X,oldLine:Y,additionsAST:g,deletionsAST:m,...this.getAnnotations("split",F,J,n,B)}),B++}};w&&I({rangeLen:Math.min(N===0||v?o:A.fromStart,o),fromStart:!0}),N>0&&(x==="unified"?L({type:"unified",linesAST:p}):(L({type:"deletions",linesAST:m}),L({type:"additions",linesAST:g}))),N>0&&A.fromEnd>0&&!s&&I({rangeLen:Math.min(A.fromEnd,o),fromStart:!1})}renderHunks({hunk:e,hunkData:t,hunkIndex:n,lineIndex:r,isLastHunk:i,prevHunk:s,ast:o,deletionsAST:u,additionsAST:c,unifiedAST:d}){const{diffStyle:p}=this.getOptionsWithDefaults(),m=p==="unified";let g=e.additionStart-1,_=e.deletionStart-1;this.renderCollapsedHunks({additionLineNumber:g,additionsAST:c,ast:o,deletionLineNumber:_,deletionsAST:u,hunkData:t,hunkIndex:n,hunkSpecs:e.hunkSpecs,isFirstHunk:s==null,isLastHunk:!1,lineIndex:r,rangeSize:Math.max(e.collapsedBefore,0),unifiedAST:d});let{oldLines:v,newLines:x,oldIndex:C,newIndex:w}=(()=>{if(o.hunks!=null){const A=o.hunks[n];if(A==null)throw console.error({ast:o,hunkIndex:n}),new Error("DiffHunksRenderer.renderHunks: lineHunk doesn't exist");return{oldLines:A.oldLines,newLines:A.newLines,oldIndex:0,newIndex:0}}return{oldLines:o.oldLines,newLines:o.newLines,oldIndex:_,newIndex:g}})();for(const A of e.hunkContent)if(A.type==="context"){const{length:R}=A.lines;for(let N=0;N<R;N++){const L=v[C],I=x[w];if(C++,w++,g++,_++,m){if(I==null)throw new Error("DiffHunksRenderer.renderHunks: newLine doesnt exist for context...");this.pushLineWithAnnotation({newLine:I,unifiedAST:d,unifiedSpan:this.getAnnotations("unified",_,g,n,r)})}else{if(I==null||L==null)throw new Error("DiffHunksRenderer.renderHunks: newLine or oldLine doesnt exist for context...");this.pushLineWithAnnotation({oldLine:L,newLine:I,deletionsAST:u,additionsAST:c,...this.getAnnotations("split",_,g,n,r)})}r++}if(A.noEOFCR){const N=n_("context");m?d.push(N):(u.push(N),c.push(N))}}else{const{length:R}=A.deletions,{length:N}=A.additions,L=m?R+N:Math.max(R,N);let I=0;for(let P=0;P<L;P++){const{oldLine:q,newLine:ee}=(()=>{let F=v[C],J=x[w];if(m?P<R?J=void 0:F=void 0:(P>=R&&(F=void 0),P>=N&&(J=void 0)),F==null&&J==null)throw console.error({i:P,len:L,ast:o,hunkContent:A}),new Error("renderHunks: oldLine and newLine are null, something is wrong");return{oldLine:F,newLine:J}})();if(q!=null&&(C++,_++),ee!=null&&(w++,g++),m)this.pushLineWithAnnotation({oldLine:q,newLine:ee,unifiedAST:d,unifiedSpan:this.getAnnotations("unified",q!=null?_:void 0,ee!=null?g:void 0,n,r)}),r++;else{(q==null||ee==null)&&I++;const F=this.getAnnotations("split",q!=null?_:void 0,ee!=null?g:void 0,n,r);F!=null&&I>0&&(N>R?u.push(Jo(I)):c.push(Jo(I)),I=0),this.pushLineWithAnnotation({newLine:ee,oldLine:q,deletionsAST:u,additionsAST:c,...F}),r++}}m||(I>0&&(N>R?u.push(Jo(I)):c.push(Jo(I)),I=0),A.noEOFCRDeletions&&(u.push(n_("change-deletion")),A.noEOFCRAdditions||c.push(Jo(1))),A.noEOFCRAdditions&&(c.push(n_("change-addition")),A.noEOFCRDeletions||u.push(Jo(1))))}return i&&o.newLines!=null&&o.newLines.length>0&&this.renderCollapsedHunks({additionLineNumber:g,additionsAST:c,ast:o,deletionLineNumber:_,deletionsAST:u,hunkData:t,hunkIndex:n+1,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,lineIndex:r,rangeSize:Math.max(o.newLines.length-Math.max(e.additionStart+e.additionCount-1,0),0),unifiedAST:d}),r}pushLineWithAnnotation({newLine:e,oldLine:t,unifiedAST:n,additionsAST:r,deletionsAST:i,unifiedSpan:s,deletionSpan:o,additionSpan:u}){n!=null?(t!=null?n.push(t):e!=null&&n.push(e),s!=null&&n.push(Ef(s))):i!=null&&r!=null&&(t!=null&&i.push(t),e!=null&&r.push(e),o!=null&&i.push(Ef(o)),u!=null&&r.push(Ef(u)))}getAnnotations(e,t,n,r,i){const s={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(const u of this.deletionAnnotations[t]??[])s.annotations.push(Ya(u));const o={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(const u of this.additionAnnotations[n]??[])(e==="unified"?s:o).annotations.push(Ya(u));if(e==="unified")return s.annotations.length>0?s:void 0;if(!(o.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:o}}renderHeader(e,t,n){const{themeType:r}=this.getOptionsWithDefaults();return tR({fileOrDiff:e,themeStyles:t,themeType:n??r})}};function s_(e,t){return Dp(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType}function E7(e){return`${e} unmodified line${e>1?"s":""}`}function x7(e){const t=e[0];if(t!=="+"&&t!=="-"&&t!==" "&&t!=="\\"){console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);return}const n=e.substring(1);return{line:n===""?`
|
|
1289
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function KC({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function Yd({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){const s=t[t.length-1];if(s==null||i||!n){t.push([r?0:1,e.value]);return}const o=s[0]===0;if(r===o||r&&e.value.length===1&&!o){s[1]+=e.value;return}t.push([r?0:1,e.value])}function g3(e,t,n,r=!1){const i=(()=>{const d=n.theme??vn;if(typeof d=="string")return t.getTheme(d).type})(),s=s3({theme:n.theme,highlighter:t});if(e.newLines!=null&&e.oldLines!=null){const{oldContent:d,newContent:p,oldInfo:m,newInfo:g,oldDecorations:_,newDecorations:v}=QC({hunks:e.hunks,oldLines:e.oldLines,newLines:e.newLines,lineDiffType:n.lineDiffType});return{code:XC({oldFile:{name:e.prevName??e.name,contents:d},oldInfo:m,oldDecorations:_,newFile:{name:e.name,contents:p},newInfo:g,newDecorations:v,highlighter:t,options:n,languageOverride:r?"text":e.lang}),themeStyles:s,baseThemeType:i}}const o=[];let u=0,c=0;for(const d of e.hunks){const{oldContent:p,newContent:m,oldInfo:g,newInfo:_,oldDecorations:v,newDecorations:x,splitLineIndex:C,unifiedLineIndex:w}=QC({hunks:[d],splitLineIndex:u,unifiedLineIndex:c,lineDiffType:n.lineDiffType}),A={name:e.prevName??e.name,contents:p},R={name:e.name,contents:m};o.push(XC({oldFile:A,oldInfo:g,oldDecorations:v,newFile:R,newInfo:_,newDecorations:x,highlighter:t,options:n,languageOverride:r?"text":e.lang})),u=C,c=w}return{code:(()=>{if(o.length<=1){const d=o[0]??{oldLines:[],newLines:[]};if(d.newLines.length===0||d.oldLines.length===0)return d}return{hunks:o}})(),themeStyles:s,baseThemeType:i}}function v7({oldLine:e,newLine:t,oldLineIndex:n,newLineIndex:r,oldDecorations:i,newDecorations:s,lineDiffType:o}){if(e==null||t==null||o==="none")return;e=Ka(e),t=Ka(t);const u=o==="char"?u7(e,t):d7(e,t),c=[],d=[],p=o==="word-alt";for(const g of u){const _=g===u[u.length-1];!g.added&&!g.removed?(Yd({item:g,arr:c,enableJoin:p,isNeutral:!0,isLastItem:_}),Yd({item:g,arr:d,enableJoin:p,isNeutral:!0,isLastItem:_})):g.removed?Yd({item:g,arr:c,enableJoin:p,isLastItem:_}):Yd({item:g,arr:d,enableJoin:p,isLastItem:_})}let m=0;for(const g of c)g[0]===1&&i.push(KC({line:n-1,spanStart:m,spanLength:g[1].length})),m+=g[1].length;m=0;for(const g of d)g[0]===1&&s.push(KC({line:r-1,spanStart:m,spanLength:g[1].length})),m+=g[1].length}function QC({hunks:e,oldLines:t,newLines:n,splitLineIndex:r=0,unifiedLineIndex:i=0,lineDiffType:s}){const o={},u={},c=[],d=[];let p=1,m=1,g=1,_=1,v="",x="";for(const C of e){for(;t!=null&&n!=null&&p<C.additionStart&&m<C.deletionStart;)o[m]={type:"context-expanded",lineNumber:_,altLineNumber:g,lineIndex:`${i},${r}`},u[p]={type:"context-expanded",lineNumber:g,altLineNumber:_,lineIndex:`${i},${r}`},v+=t[m-1],x+=n[p-1],m++,p++,_++,g++,r++,i++;_=C.deletionStart,g=C.additionStart;for(const w of C.hunkContent)if(w.type==="context")for(const A of w.lines)o[m]={type:"context",lineNumber:_,altLineNumber:g,lineIndex:`${i},${r}`},u[p]={type:"context",lineNumber:g,altLineNumber:_,lineIndex:`${i},${r}`},v+=A,x+=A,m++,p++,g++,_++,r++,i++;else{const A=Math.max(w.additions.length,w.deletions.length);let R=0,N=i;for(;R<A;){const L=w.deletions[R],I=w.additions[R];v7({newLine:I,oldLine:L,oldLineIndex:m,newLineIndex:p,oldDecorations:c,newDecorations:d,lineDiffType:s}),L!=null&&(o[m]={type:"change-deletion",lineNumber:_,lineIndex:`${N},${r}`},v+=L,m++,_++),I!=null&&(u[p]={type:"change-addition",lineNumber:g,lineIndex:`${N+w.deletions.length},${r}`},x+=I,p++,g++),r++,N++,R++}i+=w.additions.length+w.deletions.length}if(!(t==null||n==null||C!==e[e.length-1]))for(;m<=t.length||p<=t.length;){const w=t[m-1],A=n[p-1];if(w==null&&A==null)break;w!=null&&(o[m]={type:"context-expanded",lineNumber:_,altLineNumber:g,lineIndex:`${i},${r}`},v+=w,m++,_++),A!=null&&(u[p]={type:"context-expanded",lineNumber:g,altLineNumber:_,lineIndex:`${i},${r}`},x+=A,p++,g++),r++,i++}}return{oldContent:v,newContent:x,oldInfo:o,newInfo:u,oldDecorations:c,newDecorations:d,splitLineIndex:r,unifiedLineIndex:i}}function XC({oldFile:e,newFile:t,oldInfo:n,newInfo:r,highlighter:i,oldDecorations:s,newDecorations:o,languageOverride:u,options:{theme:c=vn,...d}}){const p=u??vi(e.name),m=u??vi(t.name),{state:g,transformers:_}=i3(),v=typeof c=="string"?{...d,lang:"text",theme:c,transformers:_,decorations:void 0,defaultColor:!1,cssVariablePrefix:yr("token")}:{...d,lang:"text",themes:c,transformers:_,decorations:void 0,defaultColor:!1,cssVariablePrefix:yr("token")};return{oldLines:e.contents===""?[]:(v.lang=p,g.lineInfo=n,v.decorations=s,Fb(i.codeToHast(Ka(e.contents),v))),newLines:t.contents===""?[]:(v.lang=m,v.decorations=o,g.lineInfo=r,Fb(i.codeToHast(Ka(t.contents),v)))}}const y7={fromStart:0,fromEnd:0};var S7=class{highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:vn},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Sc(e.theme??vn)?e3():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){this.getOptionsWithDefaults().themeType!==e&&this.mergeOptions({themeType:e})}expandHunk(e,t){const{expansionLineCount:n}=this.getOptionsWithDefaults(),r=this.expandedHunks.get(e)??{fromStart:0,fromEnd:0};(t==="up"||t==="both")&&(r.fromStart+=n),(t==="down"||t==="both")&&(r.fromEnd+=n),this.expandedHunks.set(e,r)}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),r=n[t.lineNumber]??[];n[t.lineNumber]=r,r.push(t)}}getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,expandUnchanged:s=!1,expansionLineCount:o=100,hunkSeparators:u="line-info",lineDiffType:c="word-alt",maxLineDiffLength:d=1e3,overflow:p="scroll",theme:m=vn,themeType:g="system",tokenizeMaxLineLength:_=1e3,useCSSClasses:v=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,expandUnchanged:s,expansionLineCount:o,hunkSeparators:u,lineDiffType:c,maxLineDiffLength:d,overflow:p,theme:this.workerManager?.getDiffRenderOptions().theme??m,themeType:g,tokenizeMaxLineLength:_,useCSSClasses:v}}async initializeHighlighter(){return this.highlighter=await tp(r3(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e);let n=this.workerManager?.getDiffResultCache(e);n!=null&&!s_(t,n.options)&&(n=void 0),this.renderCache??={diff:e,highlighted:!0,options:t,result:n?.result},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(e).then(({result:r,options:i})=>{this.onHighlightSuccess(e,r,i)})}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:r,tokenizeMaxLineLength:i,lineDiffType:s}=this.getOptionsWithDefaults();return{theme:r,tokenizeMaxLineLength:i,lineDiffType:s}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceRender:!0}:e!==n.diff||!s_(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderDiff(e=this.renderCache?.diff){if(e==null)return;const t=this.workerManager?.getDiffResultCache(e);t!=null&&this.renderCache==null&&(this.renderCache={diff:e,highlighted:!0,...t});const{options:n,forceRender:r}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:n,result:void 0},this.workerManager?.isWorkingPool()===!0)this.renderCache.result??=this.workerManager.getPlainDiffAST(e),(!this.renderCache.highlighted||r)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??vi(e.name);const i=this.highlighter!=null&&Sc(n.theme),s=this.highlighter!=null&&zf(this.computedLang);if(this.highlighter!=null&&i&&(r||!this.renderCache.highlighted&&s||this.renderCache.result==null)){const{result:o,options:u}=this.renderDiffWithHighlighter(e,this.highlighter,!s);this.renderCache={diff:e,options:u,highlighted:s,result:o}}(!i||!s)&&this.asyncHighlight(e).then(({result:o,options:u})=>{this.onHighlightSuccess(e,o,u)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,this.renderCache.result):void 0}async asyncRender(e){const{result:t}=await this.asyncHighlight(e);return this.processDiffResult(e,t)}createPreElement(e,t,n,r){const{diffIndicators:i,disableBackground:s,disableLineNumbers:o,overflow:u,themeType:c}=this.getOptionsWithDefaults();return n3({diffIndicators:i,disableBackground:s,disableLineNumbers:o,overflow:u,themeStyles:n,split:e,themeType:r??c,totalLines:t})}async asyncHighlight(e){this.computedLang=e.lang??vi(e.name);const t=this.highlighter!=null&&Sc(this.options.theme??vn),n=this.highlighter!=null&&zf(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e);return{result:g3(e,t,r,n),options:r}}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;const r=this.renderCache.diff!==e||!this.renderCache.highlighted||!s_(this.renderCache.options,n);this.renderCache={diff:e,options:n,highlighted:!0,result:t},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,{code:t,themeStyles:n,baseThemeType:r}){const{diffStyle:i,disableFileHeader:s}=this.getOptionsWithDefaults();this.diff=e;const o=i==="unified";let u=[],c=[],d=[],p=0;const m=[];let g,_=0;for(const C of e.hunks)_+=C.collapsedBefore,_=this.renderHunks({ast:t,hunk:C,prevHunk:g,hunkIndex:p,isLastHunk:p===e.hunks.length-1,additionsAST:u,deletionsAST:c,unifiedAST:d,hunkData:m,lineIndex:_}),p++,g=C;const v=Math.max(a7(e.hunks),e.newLines?.length??0,e.oldLines?.length??0);u=!o&&(t.hunks!=null||t.newLines.length>0)?u:void 0,c=!o&&(t.hunks!=null||t.oldLines.length>0)?c:void 0,d=d.length>0?d:void 0;const x=this.createPreElement(c!=null&&u!=null,v,n,r);return{additionsAST:u,deletionsAST:c,unifiedAST:d,hunkData:m,preNode:x,themeStyles:n,baseThemeType:r,headerElement:s?void 0:this.renderHeader(this.diff,n,r),totalLines:v,css:""}}renderFullAST(e,t=[]){return e.unifiedAST!=null&&t.push(tt({tagName:"code",children:e.unifiedAST,properties:{"data-code":"","data-unified":""}})),e.deletionsAST!=null&&t.push(tt({tagName:"code",children:e.deletionsAST,properties:{"data-code":"","data-deletions":""}})),e.additionsAST!=null&&t.push(tt({tagName:"code",children:e.additionsAST,properties:{"data-code":"","data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return rs(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?rs(e):rs(tt({tagName:"code",children:e,properties:{"data-code":"",[`data-${t}`]:""}}))}renderCollapsedHunks({ast:e,hunkData:t,hunkIndex:n,hunkSpecs:r,isFirstHunk:i,isLastHunk:s,rangeSize:o,lineIndex:u,additionLineNumber:c,deletionLineNumber:d,unifiedAST:p,deletionsAST:m,additionsAST:g}){if(o<=0)return;const{hunkSeparators:_,expandUnchanged:v,diffStyle:x,expansionLineCount:C}=this.getOptionsWithDefaults(),w=e.hunks==null&&e.newLines.length>0&&e.oldLines.length>0,A=this.expandedHunks.get(n)??y7,R=o>C,N=Math.max(v?0:o-(A.fromEnd+A.fromStart),0),L=({type:P,linesAST:q})=>{if(_==="line-info"||_==="custom"){const ee=s7(P,n);q.push(i_({type:_,content:E7(N),expandIndex:w?n:void 0,chunked:R,slotName:ee,isFirstHunk:i,isLastHunk:s})),t.push({slotName:ee,hunkIndex:n,lines:N,type:P,expandable:w?{up:w&&!i,down:w,chunked:R}:void 0})}else _==="metadata"&&r!=null?q.push(i_({type:"metadata",content:r,isFirstHunk:i,isLastHunk:s})):_==="simple"&&n>0&&q.push(i_({type:"simple",isFirstHunk:i,isLastHunk:!1}))},I=({rangeLen:P,fromStart:q})=>{if(e.newLines==null||e.oldLines==null)return;const ee=s?0:q?o:P;let F=d-ee,J=c-ee,B=u-ee;for(let V=0;V<P;V++){const Y=e.oldLines[F],X=e.newLines[J];if(Y==null||X==null)throw console.error({aLineNumber:J,dLineNumber:F,ast:e}),new Error("DiffHunksRenderer.renderHunks prefill context invalid. Must include data for old and new lines");F++,J++,x==="unified"?this.pushLineWithAnnotation({newLine:X,unifiedAST:p,unifiedSpan:this.getAnnotations("unified",F,J,n,B)}):this.pushLineWithAnnotation({newLine:X,oldLine:Y,additionsAST:g,deletionsAST:m,...this.getAnnotations("split",F,J,n,B)}),B++}};w&&I({rangeLen:Math.min(N===0||v?o:A.fromStart,o),fromStart:!0}),N>0&&(x==="unified"?L({type:"unified",linesAST:p}):(L({type:"deletions",linesAST:m}),L({type:"additions",linesAST:g}))),N>0&&A.fromEnd>0&&!s&&I({rangeLen:Math.min(A.fromEnd,o),fromStart:!1})}renderHunks({hunk:e,hunkData:t,hunkIndex:n,lineIndex:r,isLastHunk:i,prevHunk:s,ast:o,deletionsAST:u,additionsAST:c,unifiedAST:d}){const{diffStyle:p}=this.getOptionsWithDefaults(),m=p==="unified";let g=e.additionStart-1,_=e.deletionStart-1;this.renderCollapsedHunks({additionLineNumber:g,additionsAST:c,ast:o,deletionLineNumber:_,deletionsAST:u,hunkData:t,hunkIndex:n,hunkSpecs:e.hunkSpecs,isFirstHunk:s==null,isLastHunk:!1,lineIndex:r,rangeSize:Math.max(e.collapsedBefore,0),unifiedAST:d});let{oldLines:v,newLines:x,oldIndex:C,newIndex:w}=(()=>{if(o.hunks!=null){const A=o.hunks[n];if(A==null)throw console.error({ast:o,hunkIndex:n}),new Error("DiffHunksRenderer.renderHunks: lineHunk doesn't exist");return{oldLines:A.oldLines,newLines:A.newLines,oldIndex:0,newIndex:0}}return{oldLines:o.oldLines,newLines:o.newLines,oldIndex:_,newIndex:g}})();for(const A of e.hunkContent)if(A.type==="context"){const{length:R}=A.lines;for(let N=0;N<R;N++){const L=v[C],I=x[w];if(C++,w++,g++,_++,m){if(I==null)throw new Error("DiffHunksRenderer.renderHunks: newLine doesnt exist for context...");this.pushLineWithAnnotation({newLine:I,unifiedAST:d,unifiedSpan:this.getAnnotations("unified",_,g,n,r)})}else{if(I==null||L==null)throw new Error("DiffHunksRenderer.renderHunks: newLine or oldLine doesnt exist for context...");this.pushLineWithAnnotation({oldLine:L,newLine:I,deletionsAST:u,additionsAST:c,...this.getAnnotations("split",_,g,n,r)})}r++}if(A.noEOFCR){const N=n_("context");m?d.push(N):(u.push(N),c.push(N))}}else{const{length:R}=A.deletions,{length:N}=A.additions,L=m?R+N:Math.max(R,N);let I=0;for(let P=0;P<L;P++){const{oldLine:q,newLine:ee}=(()=>{let F=v[C],J=x[w];if(m?P<R?J=void 0:F=void 0:(P>=R&&(F=void 0),P>=N&&(J=void 0)),F==null&&J==null)throw console.error({i:P,len:L,ast:o,hunkContent:A}),new Error("renderHunks: oldLine and newLine are null, something is wrong");return{oldLine:F,newLine:J}})();if(q!=null&&(C++,_++),ee!=null&&(w++,g++),m)this.pushLineWithAnnotation({oldLine:q,newLine:ee,unifiedAST:d,unifiedSpan:this.getAnnotations("unified",q!=null?_:void 0,ee!=null?g:void 0,n,r)}),r++;else{(q==null||ee==null)&&I++;const F=this.getAnnotations("split",q!=null?_:void 0,ee!=null?g:void 0,n,r);F!=null&&I>0&&(N>R?u.push(Jo(I)):c.push(Jo(I)),I=0),this.pushLineWithAnnotation({newLine:ee,oldLine:q,deletionsAST:u,additionsAST:c,...F}),r++}}m||(I>0&&(N>R?u.push(Jo(I)):c.push(Jo(I)),I=0),A.noEOFCRDeletions&&(u.push(n_("change-deletion")),A.noEOFCRAdditions||c.push(Jo(1))),A.noEOFCRAdditions&&(c.push(n_("change-addition")),A.noEOFCRDeletions||u.push(Jo(1))))}return i&&o.newLines!=null&&o.newLines.length>0&&this.renderCollapsedHunks({additionLineNumber:g,additionsAST:c,ast:o,deletionLineNumber:_,deletionsAST:u,hunkData:t,hunkIndex:n+1,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,lineIndex:r,rangeSize:Math.max(o.newLines.length-Math.max(e.additionStart+e.additionCount-1,0),0),unifiedAST:d}),r}pushLineWithAnnotation({newLine:e,oldLine:t,unifiedAST:n,additionsAST:r,deletionsAST:i,unifiedSpan:s,deletionSpan:o,additionSpan:u}){n!=null?(t!=null?n.push(t):e!=null&&n.push(e),s!=null&&n.push(Ef(s))):i!=null&&r!=null&&(t!=null&&i.push(t),e!=null&&r.push(e),o!=null&&i.push(Ef(o)),u!=null&&r.push(Ef(u)))}getAnnotations(e,t,n,r,i){const s={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(const u of this.deletionAnnotations[t]??[])s.annotations.push(Ya(u));const o={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(const u of this.additionAnnotations[n]??[])(e==="unified"?s:o).annotations.push(Ya(u));if(e==="unified")return s.annotations.length>0?s:void 0;if(!(o.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:o}}renderHeader(e,t,n){const{themeType:r}=this.getOptionsWithDefaults();return t3({fileOrDiff:e,themeStyles:t,themeType:n??r})}};function s_(e,t){return Dp(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType}function E7(e){return`${e} unmodified line${e>1?"s":""}`}function x7(e){const t=e[0];if(t!=="+"&&t!=="-"&&t!==" "&&t!=="\\"){console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);return}const n=e.substring(1);return{line:n===""?`
|
|
1290
1290
|
`:n,type:t===" "?"context":t==="\\"?"metadata":t==="+"?"addition":"deletion"}}function w7(e,t){const n=I0.test(e),r=e.split(n?I0:eC);let i;const s=[];let o;for(const u of r){if(n&&!I0.test(u)){i==null?i=u:console.error("parsePatchContent: unknown file blob:",u);continue}else if(!n&&!eC.test(u)){i==null?i=u:console.error("parsePatchContent: unknown file blob:",u);continue}let c=0;const d=u.split(UI);o=void 0;for(const p of d){const m=p.split(mb),g=m.shift();if(g==null){console.error("parsePatchContent: invalid hunk",p);continue}const _=g.match($I),v=[];let x=0,C=0;if(_==null||o==null){if(o!=null){console.error("parsePatchContent: Invalid hunk",p);continue}o={name:"",prevName:void 0,type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,cacheKey:void 0},m.unshift(g);for(const A of m){const R=A.match(n?qI:VI);if(A.startsWith("diff --git")){const[,,N,,L]=A.trim().match(WI)??[];o.name=L.trim(),N!==L&&(o.prevName=N.trim())}else if(R!=null){const[,N,L]=R;N==="---"&&L!=="/dev/null"?(o.prevName=L.trim(),o.name=L.trim()):N==="+++"&&L!=="/dev/null"&&(o.name=L.trim())}else if(n){if(A.startsWith("new mode ")&&(o.mode=A.replace("new mode","").trim()),A.startsWith("old mode ")&&(o.oldMode=A.replace("old mode","").trim()),A.startsWith("new file mode")&&(o.type="new",o.mode=A.replace("new file mode","").trim()),A.startsWith("deleted file mode")&&(o.type="deleted",o.mode=A.replace("deleted file mode","").trim()),A.startsWith("similarity index")&&(A.startsWith("similarity index 100%")?o.type="rename-pure":o.type="rename-changed"),A.startsWith("index ")){const[,N]=A.trim().match(GI)??[];N!=null&&(o.mode=N)}A.startsWith("rename from ")&&(o.prevName=A.replace("rename from ","")),A.startsWith("rename to ")&&(o.name=A.replace("rename to ","").trim())}}continue}else{let A,R;for(;m.length>0&&(m[m.length-1]===`
|
|
1291
|
-
`||m[m.length-1]==="");)m.pop();for(const N of m){const L=x7(N);if(L==null)continue;const{type:I,line:P}=L;if(I==="addition")(A==null||A.type!=="change")&&(A=a_("change"),v.push(A)),A.additions.push(P),x++,R="addition";else if(I==="deletion")(A==null||A.type!=="change")&&(A=a_("change"),v.push(A)),A.deletions.push(P),C++,R="deletion";else if(I==="context")(A==null||A.type!=="context")&&(A=a_("context"),v.push(A)),A.lines.push(P),R="context";else if(I==="metadata"&&A!=null){if(A.type==="context")A.noEOFCR=!0;else if(R==="deletion"){A.noEOFCRDeletions=!0;const q=A.deletions.length-1;q>=0&&(A.deletions[q]=Ka(A.deletions[q]))}else if(R==="addition"){A.noEOFCRAdditions=!0;const q=A.additions.length-1;q>=0&&(A.additions[q]=Ka(A.additions[q]))}}}}const w={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(_[4]??"1"),additionStart:parseInt(_[3]),additionLines:x,deletionCount:parseInt(_[2]??"1"),deletionStart:parseInt(_[1]),deletionLines:C,hunkContent:v,hunkContext:_[5],hunkSpecs:g};if(isNaN(w.additionCount)||isNaN(w.deletionCount)||isNaN(w.additionStart)||isNaN(w.deletionStart)){console.error("parsePatchContent: invalid hunk metadata",w);continue}w.collapsedBefore=Math.max(w.additionStart-1-c,0),o.hunks.push(w),c=w.additionStart+w.additionCount-1;for(const A of v)A.type==="context"?(w.splitLineCount+=A.lines.length,w.unifiedLineCount+=A.lines.length):(w.splitLineCount+=Math.max(A.additions.length,A.deletions.length),w.unifiedLineCount+=A.deletions.length+A.additions.length);w.splitLineStart=o.splitLineCount,w.unifiedLineStart=o.unifiedLineCount,o.splitLineCount+=w.splitLineCount,o.unifiedLineCount+=w.unifiedLineCount}o!=null&&(!n&&o.prevName!=null&&o.name!==o.prevName&&(o.hunks.length>0?o.type="rename-changed":o.type="rename-pure"),o.type!=="rename-pure"&&o.type!=="rename-changed"&&(o.prevName=void 0),s.push(o))}return{patchMetadata:i,files:s}}function Tv(e,t){const n=[];for(const r of e.split(zI))try{n.push(w7(r,t!=null?`${t}-${n.length}`:void 0))}catch(i){console.error(i)}return n}function a_(e){return e==="change"?{type:"change",additions:[],deletions:[],noEOFCRAdditions:!1,noEOFCRDeletions:!1}:{type:"context",lines:[],noEOFCR:!1}}function ZC(e,t,n){const r=Tv(_7(e.name,t.name,e.contents,t.contents,e.header,t.header))[0]?.files[0];if(r==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return r.oldLines=e.contents.split(mb),r.newLines=t.contents.split(mb),e.cacheKey!=null&&t.cacheKey!=null&&(r.cacheKey=`${e.cacheKey}:${t.cacheKey}`),r}let C7=-1;var T7=class{static LoadedCustomComponent=pR;__id=++C7;fileContainer;spriteSVG;pre;unsafeCSSStyle;hoverContent;headerElement;headerMetadata;customHunkElements=[];errorWrapper;hunksRenderer;resizeManager;scrollSyncManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];oldFile;newFile;fileDiff;constructor(t={theme:vn},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.hunksRenderer=new S7({...t,hunkSeparators:typeof t.hunkSeparators=="function"?"custom":t.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new IA,this.scrollSyncManager=new i7,this.mouseEventManager=new MA("diff",jf(t,typeof t.hunkSeparators=="function"||(t.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager=new DA(Ff(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};setOptions(t){t!=null&&(this.options=t,this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof t.hunkSeparators=="function"?"custom":t.hunkSeparators}),this.mouseEventManager.setOptions(jf(t,typeof t.hunkSeparators=="function"||(t.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager.setOptions(Ff(t)))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){if((this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.hunksRenderer.setThemeType(t),this.headerElement!=null&&(t==="system"?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=t),this.pre!=null))switch(t){case"system":delete this.pre.dataset.themeType;break;case"light":case"dark":this.pre.dataset.themeType=t;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t){this.lineSelectionManager.setSelection(t)}cleanUp(){this.hunksRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.fileDiff=void 0,this.oldFile=void 0,this.newFile=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.headerElement=void 0,this.errorWrapper=void 0}hydrate(t){const{fileContainer:n,prerenderedHTML:r}=t;dR(n,r);for(const i of Array.from(n.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i;continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(lv)){this.unsafeCSSStyle=i;continue}}}if(this.pre==null)this.render(t);else{const{lineAnnotations:i,oldFile:s,newFile:o,fileDiff:u}=t;this.fileContainer=n,delete this.pre.dataset.dehydrated,this.lineAnnotations=i??this.lineAnnotations,this.newFile=o,this.oldFile=s,this.fileDiff=u??(s!=null&&o!=null?ZC(s,o):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??"scroll")==="scroll"&&(this.resizeManager.setup(this.pre),(this.options.diffStyle??"split")==="split"&&this.scrollSyncManager.setup(this.pre))}}rerender(){this.fileDiff==null&&this.newFile==null&&this.oldFile==null||this.render({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff,forceRender:!0})}handleExpandHunk=(t,n)=>{this.expandHunk(t,n)};expandHunk(t,n){this.hunksRenderer.expandHunk(t,n),this.rerender()}render({oldFile:t,newFile:n,fileDiff:r,forceRender:i=!1,lineAnnotations:s,fileContainer:o,containerWrapper:u}){const c=t!=null&&n!=null&&(!jb(t,this.oldFile)||!jb(n,this.newFile)),d=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!i&&!d&&(r!=null&&r===this.fileDiff||r==null&&!c)||(this.oldFile=t,this.newFile=n,r!=null?this.fileDiff=r:t!=null&&n!=null&&c&&(this.fileDiff=ZC(t,n)),s!=null&&this.setLineAnnotations(s),this.fileDiff==null))return;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators=="function"?"custom":this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableFileHeader:p=!1}=this.options;p&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),o=this.getOrCreateFileContainer(o,u);try{const m=this.hunksRenderer.renderDiff(this.fileDiff);if(m==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}m.headerElement!=null&&this.applyHeaderToDOM(m.headerElement,o);const g=this.getOrCreatePreNode(o);this.applyHunksToDOM(g,m),this.renderSeparators(m.hunkData),this.renderAnnotations(),this.renderHoverUtility()}catch(m){m instanceof Error&&this.applyErrorToDOM(m,o)}}renderSeparators(t){const{hunkSeparators:n}=this.options;if(!(this.isContainerManaged||this.fileContainer==null||typeof n!="function")){for(const r of this.customHunkElements)r.parentNode?.removeChild(r);this.customHunkElements.length=0;for(const r of t){const i=document.createElement("div");i.style.display="contents",i.slot=r.slotName,i.appendChild(n(r,this)),this.fileContainer.appendChild(i),this.customHunkElements.push(i)}}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(const n of this.annotationElements)n.parentNode?.removeChild(n);this.annotationElements.length=0;const{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const n of this.lineAnnotations){const r=t(n);if(r==null)continue;const i=lR(Ya(n));i.appendChild(r),this.annotationElements.push(i),this.fileContainer.appendChild(i)}}renderHoverUtility(){const{renderHoverUtility:t}=this.options;if(this.fileContainer==null||t==null)return;this.hoverContent==null&&(this.hoverContent=uR(),this.fileContainer.appendChild(this.hoverContent));const n=t(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML="",n!=null&&this.hoverContent.appendChild(n)}getOrCreateFileContainer(t,n){if(this.fileContainer=t??this.fileContainer??document.createElement(xl),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=oR;const i=r.firstChild;i instanceof SVGElement&&(this.spriteSVG=i,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(t){return this.pre==null?(this.pre=document.createElement("pre"),t.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==t&&t.shadowRoot?.appendChild(this.pre),this.pre}applyHeaderToDOM(t,n){this.cleanupErrorWrapper();const r=document.createElement("div");r.innerHTML=rs(t);const i=r.firstElementChild;if(!(i instanceof HTMLElement)||(this.headerElement!=null?n.shadowRoot?.replaceChild(i,this.headerElement):n.shadowRoot?.prepend(i),this.headerElement=i,this.isContainerManaged))return;const{renderHeaderMetadata:s}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const o=s?.({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff})??void 0;o!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=eh,o instanceof Element?this.headerMetadata.appendChild(o):this.headerMetadata.innerText=`${o}`,n.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:t}=this.options;t==null||t===""||(this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=cR(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=hR(t))}applyHunksToDOM(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,n),t.innerHTML="";let r,i;if(n.unifiedAST!=null){const s=xf({columnType:"unified"});s.innerHTML=this.hunksRenderer.renderPartialHTML(n.unifiedAST),t.appendChild(s)}else n.deletionsAST!=null&&(r=xf({columnType:"deletions"}),r.innerHTML=this.hunksRenderer.renderPartialHTML(n.deletionsAST),t.appendChild(r)),n.additionsAST!=null&&(i=xf({columnType:"additions"}),i.innerHTML=this.hunksRenderer.renderPartialHTML(n.additionsAST),t.appendChild(i));this.injectUnsafeCSS(),this.mouseEventManager.setup(t),this.lineSelectionManager.setup(t),(this.options.overflow??"scroll")==="scroll"?(this.resizeManager.setup(t),(this.options.diffStyle??"split")==="split"?this.scrollSyncManager.setup(t,r,i):this.scrollSyncManager.cleanUp()):(this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp())}applyPreNodeAttributes(t,{themeStyles:n,baseThemeType:r,additionsAST:i,deletionsAST:s,totalLines:o}){const{diffIndicators:u="bars",disableBackground:c=!1,disableLineNumbers:d=!1,overflow:p="scroll",themeType:m="system",diffStyle:g="split"}=this.options;fR({pre:t,diffIndicators:u,disableBackground:c,disableLineNumbers:d,overflow:p,split:g==="unified"?!1:i!=null&&s!=null,themeStyles:n,themeType:r??m,totalLines:o})}applyErrorToDOM(t,n){this.cleanupErrorWrapper();const r=this.getOrCreatePreNode(n);r.innerHTML="",r.parentNode?.removeChild(r),this.pre=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);const s=document.createElement("div");s.dataset.errorMessage="",s.innerText=t.message,this.errorWrapper.appendChild(s);const o=document.createElement("pre");o.dataset.errorStack="",o.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}};function JC(e){const t=[];for(const n of e){const r=Wa.get(n);if(r==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(r)}return t}function e2(e){for(const t of Array.isArray(e)?e:[e])if(!Wa.has(t))return!1;return!0}async function t2(e){const t=[],n=[];for(const r of e){if(r==="text"||r==="ansi")continue;const i=Q3(r)??K3(r);"then"in i?n.push(i):t.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r){if(i==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(i)}}),t}function n2(e){const t=[];for(const n of e){const r=ss.get(n);if(r==null)throw new Error(`getAllResolvedThemes: ${n} is unresolved, you must resolve all necessary themes before calling this function`);t.push(r)}return t}async function r2(e){const t=[],n=[];for(const r of e){const i=Z3(r)??X3(r);"then"in i?n.push(i):t.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r)i!=null&&t.push(i)}),t}function k7(e,t,n){if(e===t||e==null||t==null)return e===t;const r=new Set(n),i=Object.keys(e),s=new Set(Object.keys(t));for(const o of i)if(s.delete(o),!r.has(o)&&(!(o in t)||e[o]!==t[o]))return!1;for(const o of Array.from(s))if(!r.has(o))return!1;return!0}function _R(e,t){return Dp(e?.theme??vn,t?.theme??vn)&&k7(e,t,["theme"])}const An=[],Tt=async(e,t={})=>{const n=await fetch(e,{headers:{"Content-Type":"application/json",...t.headers||{}},...t});if(!n.ok){const r=await n.text();throw new Error(r||n.statusText)}return n.status===204?null:await n.json()},zb=async(e,t={})=>{const n=await fetch(e,{headers:{...t.headers||{}},...t});if(!n.ok){const r=await n.text();throw new Error(r||n.statusText)}return n.status===204?"":await n.text()},sh=e=>{if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=Math.round((t.getTime()-Date.now())/1e3),r=Math.abs(n);let i="second",s=n;return r>=60&&(s=Math.round(n/60),i="minute"),r>=3600&&(s=Math.round(n/3600),i="hour"),r>=3600*24&&(s=Math.round(n/86400),i="day"),r>=3600*24*7&&(s=Math.round(n/(86400*7)),i="week"),r>=3600*24*30&&(s=Math.round(n/(86400*30)),i="month"),r>=3600*24*365&&(s=Math.round(n/(86400*365)),i="year"),new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(s,i)},o_=(e,t)=>e.length<=t?e:`${e.slice(0,Math.max(0,t-3))}...`,bR=e=>{if(!e||typeof e!="object")return"event";const t=e;if(typeof t.method=="string"){const r=t.method;return r==="thread/started"?"thread started":r==="turn/started"?"turn started":r==="turn/completed"?"turn completed":r==="item/agentMessage/delta"?"agent typing":r==="item/started"?"item started":r==="item/completed"?"item completed":r==="error"?"error":r.replace(/\//g," ")}const n=typeof t.type=="string"?t.type:"event";if(n==="thread.started")return typeof t.thread_id=="string"?`thread started: ${t.thread_id}`:"thread started";if(n==="turn.started")return"turn started";if(n==="turn.completed")return"turn completed";if(n==="turn.failed"){const r=t.error;if(r&&typeof r=="object"&&"message"in r){const i=r.message;if(typeof i=="string")return`turn failed: ${i}`}return"turn failed"}if(n==="error")return typeof t.message=="string"?`error: ${t.message}`:"error";if(n==="item.started"||n==="item.updated"||n==="item.completed"){const r=t.item;if(r&&typeof r=="object"){const i=r,s=typeof i.type=="string"?i.type:"item";if(s==="agent_message"&&typeof i.text=="string")return`agent: ${o_(i.text,140)}`;if(s==="reasoning"&&typeof i.text=="string")return`reasoning: ${o_(i.text,140)}`;if(s==="command_execution"&&typeof i.command=="string")return`command: ${o_(i.command,140)}`;if(s==="file_change"){const o=i.changes;if(Array.isArray(o)&&o.length>0){const u=o.map(c=>{if(c&&typeof c=="object"){const d=c;if(typeof d.path=="string")return d.path}return null}).filter(Boolean).slice(0,3);if(u.length)return`files: ${u.join(", ")}`}return"files changed"}return`${s.replace(/_/g," ")} (${n.replace(/_/g," ")})`}}return n.replace(/_/g," ")},ah=e=>{if(!e)return"";if(typeof e=="string")return e;if(!(e instanceof Error))return"";try{const t=JSON.parse(e.message);if(t&&typeof t.error=="string")return t.error}catch{return e.message}return e.message},vR=e=>{const t=ah(e);return t==="not_a_directory"?"The selected path is not a directory.":t==="invalid_path"?"The selected path could not be opened.":t?`Failed to open project: ${t}`:"Failed to open project."},A7=e=>{const t=e.replace(/\\/g,"/"),n=t.split("/"),r=n.pop()||t,i=n.join("/");return{prefix:i?`${i}/`:"",name:r}},R7={avif:"image",bmp:"image",gif:"image",ico:"image",jpeg:"image",jpg:"image",png:"image",svg:"image",webp:"image",mp4:"video",mov:"video",ogv:"video",webm:"video",mp3:"audio",m4a:"audio",ogg:"audio",wav:"audio",flac:"audio",pdf:"pdf"},N7=e=>{const t=e.split(".").pop()?.toLowerCase()||"";return R7[t]||""},Ub=(e,t)=>{if(!t||t.length===0)return e;const n=new Map;for(const r of e||An)n.set(r.path,r);for(const r of t){const i=n.get(r.path)||{};n.set(r.path,{...i,...r})}return Array.from(n.values()).sort((r,i)=>r.path.localeCompare(i.path))},L7=e=>{switch(e){case"new":return"added";case"deleted":return"deleted";case"rename-pure":case"rename-changed":return"renamed";default:return"modified"}},O7=(e,t)=>{if(!t)return"";const n=t.trim();if(!n)return"";if(/^diff --git/m.test(n)||/^---\s+/m.test(n))return n;const r=e||"unknown";return[`diff --git a/${r} b/${r}`,`--- a/${r}`,`+++ b/${r}`,n,""].join(`
|
|
1292
|
-
`)},yR=(e,t)=>{const n=O7(e,t);if(!n)return null;try{const i=Tv(n).flatMap(s=>s.files);return i.length===0?null:e&&i.find(s=>s.name===e||s.prevName===e)||i[0]}catch(r){return console.error("Failed to parse patch file",r),null}},$b=e=>{if(!e)return[];try{const t=Tv(e),n=new Map;for(const r of t)for(const i of r.files){if(!i.name)continue;const s=i.prevName&&i.prevName!==i.name?i.prevName:null,o={path:i.name,status:L7(i.type),fileDiff:i};s&&(o.previousPath=s),n.set(i.name,{...o})}return Array.from(n.values()).sort((r,i)=>r.path.localeCompare(i.path))}catch(t){return console.error("Failed to parse git diff",t),[]}},D7=e=>{if(!e)return null;const t=e.fileDiff;if(t?.hunks){let n=0,r=0;for(const i of t.hunks)n+=i.additionLines,r+=i.deletionLines;return{additions:n,deletions:r}}return null},oh=(...e)=>e.filter(Boolean).join(" ");function SR(e){const t=Number.parseInt(e.slice(0,2),16),n=Number.parseInt(e.slice(2,4),16),r=Number.parseInt(e.slice(4,6),16);return(.299*t+.587*n+.114*r)/255>.5?"#000000":"#ffffff"}const ER=(e,t)=>{const n=Vn({queryKey:["branches-info",e],queryFn:()=>Tt(`/api/projects/branches?project=${encodeURIComponent(e)}`),enabled:!!(e&&t)});return{branchList:n.data?.branches||An,currentBranch:n.data?.current||"",defaultBranchName:n.data?.defaultBranch||"main",branchesLoading:n.isLoading}},i2=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const g=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(_=>_(t,g))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d))},c=t=e(r,i,u);return u},M7=(e=>e?i2(e):i2),I7=e=>e;function P7(e,t=I7){const n=dl.useSyncExternalStore(e.subscribe,dl.useCallback(()=>t(e.getState()),[e,t]),dl.useCallback(()=>t(e.getInitialState()),[e,t]));return dl.useDebugValue(n),n}const s2=e=>{const t=M7(e),n=r=>P7(t,r);return Object.assign(n,t),n},kv=(e=>e?s2(e):s2),_t={projectPath:"diffact:projectPath",projectRoots:"diffact:projectRoots",recentProjects:"diffact:recentProjects",preferredEditor:"diffact:preferred-editor",preferredCommand:"diffact:preferred-command",fontFamily:"diffact:fontFamily",fontSize:"diffact:fontSize",theme:"diffact:theme",darkMode:"diffact:darkMode",commitCommand:"diffact:commitCommand"},ro=kv(e=>({selectedFilePath:"",selectedTreeFilePath:"",selectedCommitSha:"",selectedHistoryFilePath:"",selectedThreadId:"",attachedIssues:[],setSelectedFilePath:t=>e({selectedFilePath:t}),setSelectedTreeFilePath:t=>e({selectedTreeFilePath:t}),setSelectedCommitSha:t=>e({selectedCommitSha:t}),setSelectedHistoryFilePath:t=>e({selectedHistoryFilePath:t}),setSelectedThreadId:t=>e({selectedThreadId:t}),addAttachedIssue:t=>e(n=>n.attachedIssues.some(r=>r.number===t.number)?n:{attachedIssues:[...n.attachedIssues,t]}),removeAttachedIssue:t=>e(n=>({attachedIssues:n.attachedIssues.filter(r=>r.number!==t)})),clearAttachedIssues:()=>e({attachedIssues:[]}),clearAllSelections:()=>e({selectedFilePath:"",selectedTreeFilePath:"",selectedCommitSha:"",selectedHistoryFilePath:"",selectedThreadId:"",attachedIssues:[]}),clearAgentState:()=>e({selectedThreadId:"",attachedIssues:[]})})),B7=()=>typeof window>"u"?"":localStorage.getItem(_t.projectPath)||"",Rn=kv(e=>({projectPath:B7(),projectOpenError:"",branchTab:"branches",branchFilter:"",sidebarTab:"changes",isToolPanelVisible:!1,toolPanelTab:"agent",toolPanelLayout:"rows",terminalCols:0,terminalRows:0,isTerminalReady:!1,setProjectPath:t=>{const n=Rn.getState().projectPath;t!==n&&(ro.getState().clearAllSelections(),typeof window<"u"&&(t?localStorage.setItem(_t.projectPath,t):localStorage.removeItem(_t.projectPath)),e({projectPath:t,branchFilter:"",branchTab:"branches"}))},setProjectOpenError:t=>e({projectOpenError:t}),setBranchTab:t=>e({branchTab:t}),setBranchFilter:t=>e({branchFilter:t}),setSidebarTab:t=>e({sidebarTab:t}),setToolPanelVisible:t=>e({isToolPanelVisible:t}),toggleToolPanelVisible:()=>e(t=>({isToolPanelVisible:!t.isToolPanelVisible})),setToolPanelTab:t=>e({toolPanelTab:t}),setToolPanelLayout:t=>e({toolPanelLayout:t}),setTerminalSize:(t,n)=>e({terminalCols:t,terminalRows:n}),setTerminalReady:t=>e({isTerminalReady:t})})),l_=(e,t)=>{const n=t.stdout??e?.stdout??"",r=t.stderr??e?.stderr??"",i=e?.hasStreamedOutput??!1,s=n||r?`${n}${r}`:"";let o=e?.output||"",u=e?.lastOutputRunId;return!i&&s&&t.runId!==u&&(o=`${o}${s}`,u=t.runId),{...e,...t,stdout:n,stderr:r,output:o,hasStreamedOutput:i,lastOutputRunId:u}},Mp=kv(e=>({runs:{},runOrder:[],selectedRunId:"",runToTerminal:{},lastError:"",setSelectedRunId:t=>e({selectedRunId:t}),setError:t=>e({lastError:t}),clearError:()=>e({lastError:""}),setRuns:t=>e(n=>{const r={},i=new Map,s={};for(const c of t){const d=c.terminalId||c.runId;s[c.runId]=d,r[d]=l_(r[d]??n.runs[d],c);const p=Date.parse(c.startedAt);if(!Number.isNaN(p)){const m=i.get(d);(!m||p>m)&&i.set(d,p)}}const o=Object.keys(r).sort((c,d)=>{const p=i.get(c)??0;return(i.get(d)??0)-p}),u=n.selectedRunId&&r[n.selectedRunId]?n.selectedRunId:o[0]||"";return{runs:r,runOrder:o,selectedRunId:u,runToTerminal:s}}),upsertRun:t=>e(n=>{const r=t.terminalId||t.runId,i=!!n.runs[r],s={...n.runs,[r]:l_(n.runs[r],t)},o=i?n.runOrder:[r,...n.runOrder.filter(c=>c!==r)],u=n.selectedRunId||(t.status==="running"?r:"");return{runs:s,runOrder:o,selectedRunId:u,runToTerminal:{...n.runToTerminal,[t.runId]:r}}}),appendOutput:(t,n,r,i)=>e(s=>{const o=i||s.runToTerminal[t]||t,u=s.runs[o];if(!u)return s;const c=l_(u,{runId:t,terminalId:u.terminalId,projectPath:u.projectPath,commandId:u.commandId,commandName:u.commandName,commandLabel:u.commandLabel,commandSource:u.commandSource,status:u.status,exitCode:u.exitCode??null,signal:u.signal??null,startedAt:u.startedAt,completedAt:u.completedAt??null});return n==="stderr"?c.stderr=`${c.stderr}${r}`:c.stdout=`${c.stdout}${r}`,c.output=`${c.output}${r}`,c.hasStreamedOutput=!0,{runs:{...s.runs,[o]:c},runToTerminal:t&&t!==o?{...s.runToTerminal,[t]:o}:s.runToTerminal}}),removeRun:t=>e(n=>{if(!n.runs[t])return n;const r={...n.runs};delete r[t];const i=n.runOrder.filter(u=>u!==t),s=n.selectedRunId===t?i[0]||"":n.selectedRunId,o={...n.runToTerminal};for(const[u,c]of Object.entries(o))c===t&&delete o[u];return{runs:r,runOrder:i,selectedRunId:s,runToTerminal:o}}),clearRuns:()=>e(()=>({runs:{},runOrder:[],selectedRunId:"",runToTerminal:{},lastError:""}))}));function ir(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function a2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xR(...e){return t=>{let n=!1;const r=e.map(i=>{const s=a2(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():a2(e[i],null)}}}}function Ci(...e){return T.useCallback(xR(...e),e)}function Av(e,t=[]){let n=[];function r(s,o){const u=T.createContext(o),c=n.length;n=[...n,o];const d=m=>{const{scope:g,children:_,...v}=m,x=g?.[e]?.[c]||u,C=T.useMemo(()=>v,Object.values(v));return S.jsx(x.Provider,{value:C,children:_})};d.displayName=s+"Provider";function p(m,g){const _=g?.[e]?.[c]||u,v=T.useContext(_);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[d,p]}const i=()=>{const s=n.map(o=>T.createContext(o));return function(u){const c=u?.[e]||s;return T.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return i.scopeName=e,[r,H7(i,...t)]}function H7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((u,{useScope:c,scopeName:d})=>{const m=c(s)[`__scope${d}`];return{...u,...m}},{});return T.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Ip=OA();const F7=Zc(Ip);function wR(e){const t=j7(e),n=T.forwardRef((r,i)=>{const{children:s,...o}=r,u=T.Children.toArray(s),c=u.find(U7);if(c){const d=c.props.children,p=u.map(m=>m===c?T.Children.count(d)>1?T.Children.only(null):T.isValidElement(d)?d.props.children:null:m);return S.jsx(t,{...o,ref:i,children:T.isValidElement(d)?T.cloneElement(d,void 0,p):null})}return S.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function j7(e){const t=T.forwardRef((n,r)=>{const{children:i,...s}=n;if(T.isValidElement(i)){const o=V7(i),u=$7(s,i.props);return i.type!==T.Fragment&&(u.ref=r?xR(r,o):o),T.cloneElement(i,u)}return T.Children.count(i)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CR=Symbol("radix.slottable");function z7(e){const t=({children:n})=>S.jsx(S.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=CR,t}function U7(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CR}function $7(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...u)=>{const c=s(...u);return i(...u),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function V7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var q7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ni=q7.reduce((e,t)=>{const n=wR(`Primitive.${t}`),r=T.forwardRef((i,s)=>{const{asChild:o,...u}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...u,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function W7(e,t){e&&Ip.flushSync(()=>e.dispatchEvent(t))}function Cl(e){const t=T.useRef(e);return T.useEffect(()=>{t.current=e}),T.useMemo(()=>(...n)=>t.current?.(...n),[])}function G7(e,t=globalThis?.document){const n=Cl(e);T.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Y7="DismissableLayer",Vb="dismissableLayer.update",K7="dismissableLayer.pointerDownOutside",Q7="dismissableLayer.focusOutside",o2,TR=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rv=T.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:u,...c}=e,d=T.useContext(TR),[p,m]=T.useState(null),g=p?.ownerDocument??globalThis?.document,[,_]=T.useState({}),v=Ci(t,P=>m(P)),x=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(C),A=p?x.indexOf(p):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,N=A>=w,L=J7(P=>{const q=P.target,ee=[...d.branches].some(F=>F.contains(q));!N||ee||(i?.(P),o?.(P),P.defaultPrevented||u?.())},g),I=eH(P=>{const q=P.target;[...d.branches].some(F=>F.contains(q))||(s?.(P),o?.(P),P.defaultPrevented||u?.())},g);return G7(P=>{A===d.layers.size-1&&(r?.(P),!P.defaultPrevented&&u&&(P.preventDefault(),u()))},g),T.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(o2=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),l2(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=o2)}},[p,g,n,d]),T.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),l2())},[p,d]),T.useEffect(()=>{const P=()=>_({});return document.addEventListener(Vb,P),()=>document.removeEventListener(Vb,P)},[]),S.jsx(ni.div,{...c,ref:v,style:{pointerEvents:R?N?"auto":"none":void 0,...e.style},onFocusCapture:ir(e.onFocusCapture,I.onFocusCapture),onBlurCapture:ir(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:ir(e.onPointerDownCapture,L.onPointerDownCapture)})});Rv.displayName=Y7;var X7="DismissableLayerBranch",Z7=T.forwardRef((e,t)=>{const n=T.useContext(TR),r=T.useRef(null),i=Ci(t,r);return T.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),S.jsx(ni.div,{...e,ref:i})});Z7.displayName=X7;function J7(e,t=globalThis?.document){const n=Cl(e),r=T.useRef(!1),i=T.useRef(()=>{});return T.useEffect(()=>{const s=u=>{if(u.target&&!r.current){let c=function(){kR(K7,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function eH(e,t=globalThis?.document){const n=Cl(e),r=T.useRef(!1);return T.useEffect(()=>{const i=s=>{s.target&&!r.current&&kR(Q7,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function l2(){const e=new CustomEvent(Vb);document.dispatchEvent(e)}function kR(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?W7(i,s):i.dispatchEvent(s)}var u_=0;function tH(){T.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??u2()),document.body.insertAdjacentElement("beforeend",e[1]??u2()),u_++,()=>{u_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),u_--}},[])}function u2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var c_="focusScope.autoFocusOnMount",h_="focusScope.autoFocusOnUnmount",c2={bubbles:!1,cancelable:!0},nH="FocusScope",AR=T.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[u,c]=T.useState(null),d=Cl(i),p=Cl(s),m=T.useRef(null),g=Ci(t,x=>c(x)),_=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(r){let x=function(R){if(_.paused||!u)return;const N=R.target;u.contains(N)?m.current=N:Vs(m.current,{select:!0})},C=function(R){if(_.paused||!u)return;const N=R.relatedTarget;N!==null&&(u.contains(N)||Vs(m.current,{select:!0}))},w=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&Vs(u)};document.addEventListener("focusin",x),document.addEventListener("focusout",C);const A=new MutationObserver(w);return u&&A.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",C),A.disconnect()}}},[r,u,_.paused]),T.useEffect(()=>{if(u){d2.add(_);const x=document.activeElement;if(!u.contains(x)){const w=new CustomEvent(c_,c2);u.addEventListener(c_,d),u.dispatchEvent(w),w.defaultPrevented||(rH(lH(RR(u)),{select:!0}),document.activeElement===x&&Vs(u))}return()=>{u.removeEventListener(c_,d),setTimeout(()=>{const w=new CustomEvent(h_,c2);u.addEventListener(h_,p),u.dispatchEvent(w),w.defaultPrevented||Vs(x??document.body,{select:!0}),u.removeEventListener(h_,p),d2.remove(_)},0)}}},[u,d,p,_]);const v=T.useCallback(x=>{if(!n&&!r||_.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,w=document.activeElement;if(C&&w){const A=x.currentTarget,[R,N]=iH(A);R&&N?!x.shiftKey&&w===N?(x.preventDefault(),n&&Vs(R,{select:!0})):x.shiftKey&&w===R&&(x.preventDefault(),n&&Vs(N,{select:!0})):w===A&&x.preventDefault()}},[n,r,_.paused]);return S.jsx(ni.div,{tabIndex:-1,...o,ref:g,onKeyDown:v})});AR.displayName=nH;function rH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vs(r,{select:t}),document.activeElement!==n)return}function iH(e){const t=RR(e),n=h2(t,e),r=h2(t.reverse(),e);return[n,r]}function RR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function h2(e,t){for(const n of e)if(!sH(n,{upTo:t}))return n}function sH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function aH(e){return e instanceof HTMLInputElement&&"select"in e}function Vs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aH(e)&&t&&e.select()}}var d2=oH();function oH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=f2(e,t),e.unshift(t)},remove(t){e=f2(e,t),e[0]?.resume()}}}function f2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lH(e){return e.filter(t=>t.tagName!=="A")}var na=globalThis?.document?T.useLayoutEffect:()=>{},uH=AA[" useId ".trim().toString()]||(()=>{}),cH=0;function NR(e){const[t,n]=T.useState(uH());return na(()=>{n(r=>r??String(cH++))},[e]),e||(t?`radix-${t}`:"")}const hH=["top","right","bottom","left"],ra=Math.min,Sr=Math.max,np=Math.round,Kd=Math.floor,yi=e=>({x:e,y:e}),dH={left:"right",right:"left",bottom:"top",top:"bottom"},fH={start:"end",end:"start"};function qb(e,t,n){return Sr(e,ra(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function os(e){return e.split("-")[0]}function zl(e){return e.split("-")[1]}function Nv(e){return e==="x"?"y":"x"}function Lv(e){return e==="y"?"height":"width"}const pH=new Set(["top","bottom"]);function _i(e){return pH.has(os(e))?"y":"x"}function Ov(e){return Nv(_i(e))}function mH(e,t,n){n===void 0&&(n=!1);const r=zl(e),i=Ov(e),s=Lv(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=rp(o)),[o,rp(o)]}function gH(e){const t=rp(e);return[Wb(e),t,Wb(t)]}function Wb(e){return e.replace(/start|end/g,t=>fH[t])}const p2=["left","right"],m2=["right","left"],_H=["top","bottom"],bH=["bottom","top"];function vH(e,t,n){switch(e){case"top":case"bottom":return n?t?m2:p2:t?p2:m2;case"left":case"right":return t?_H:bH;default:return[]}}function yH(e,t,n,r){const i=zl(e);let s=vH(os(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Wb)))),s}function rp(e){return e.replace(/left|right|bottom|top/g,t=>dH[t])}function SH(e){return{top:0,right:0,bottom:0,left:0,...e}}function LR(e){return typeof e!="number"?SH(e):{top:e,right:e,bottom:e,left:e}}function ip(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function g2(e,t,n){let{reference:r,floating:i}=e;const s=_i(t),o=Ov(t),u=Lv(o),c=os(t),d=s==="y",p=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,g=r[u]/2-i[u]/2;let _;switch(c){case"top":_={x:p,y:r.y-i.height};break;case"bottom":_={x:p,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:m};break;case"left":_={x:r.x-i.width,y:m};break;default:_={x:r.x,y:r.y}}switch(zl(t)){case"start":_[o]-=g*(n&&d?-1:1);break;case"end":_[o]+=g*(n&&d?-1:1);break}return _}const EH=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,u=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:m}=g2(d,r,c),g=r,_={},v=0;for(let x=0;x<u.length;x++){const{name:C,fn:w}=u[x],{x:A,y:R,data:N,reset:L}=await w({x:p,y:m,initialPlacement:r,placement:g,strategy:i,middlewareData:_,rects:d,platform:o,elements:{reference:e,floating:t}});p=A??p,m=R??m,_={..._,[C]:{..._[C],...N}},L&&v<=50&&(v++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(d=L.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:p,y:m}=g2(d,g,c)),x=-1)}return{x:p,y:m,placement:g,strategy:i,middlewareData:_}};async function Uc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:u,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:g=!1,padding:_=0}=as(t,e),v=LR(_),C=u[g?m==="floating"?"reference":"floating":m],w=ip(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(C)))==null||n?C:C.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:d,rootBoundary:p,strategy:c})),A=m==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),N=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},L=ip(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:A,offsetParent:R,strategy:c}):A);return{top:(w.top-L.top+v.top)/N.y,bottom:(L.bottom-w.bottom+v.bottom)/N.y,left:(w.left-L.left+v.left)/N.x,right:(L.right-w.right+v.right)/N.x}}const xH=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:u,middlewareData:c}=t,{element:d,padding:p=0}=as(e,t)||{};if(d==null)return{};const m=LR(p),g={x:n,y:r},_=Ov(i),v=Lv(_),x=await o.getDimensions(d),C=_==="y",w=C?"top":"left",A=C?"bottom":"right",R=C?"clientHeight":"clientWidth",N=s.reference[v]+s.reference[_]-g[_]-s.floating[v],L=g[_]-s.reference[_],I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let P=I?I[R]:0;(!P||!await(o.isElement==null?void 0:o.isElement(I)))&&(P=u.floating[R]||s.floating[v]);const q=N/2-L/2,ee=P/2-x[v]/2-1,F=ra(m[w],ee),J=ra(m[A],ee),B=F,V=P-x[v]-J,Y=P/2-x[v]/2+q,X=qb(B,Y,V),M=!c.arrow&&zl(i)!=null&&Y!==X&&s.reference[v]/2-(Y<B?F:J)-x[v]/2<0,Q=M?Y<B?Y-B:Y-V:0;return{[_]:g[_]+Q,data:{[_]:X,centerOffset:Y-X-Q,...M&&{alignmentOffset:Q}},reset:M}}}),wH=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:u,platform:c,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:x=!0,...C}=as(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=os(i),A=_i(u),R=os(u)===u,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),L=g||(R||!x?[rp(u)]:gH(u)),I=v!=="none";!g&&I&&L.push(...yH(u,x,v,N));const P=[u,...L],q=await Uc(t,C),ee=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&ee.push(q[w]),m){const Y=mH(i,o,N);ee.push(q[Y[0]],q[Y[1]])}if(F=[...F,{placement:i,overflows:ee}],!ee.every(Y=>Y<=0)){var J,B;const Y=(((J=s.flip)==null?void 0:J.index)||0)+1,X=P[Y];if(X&&(!(m==="alignment"?A!==_i(X):!1)||F.every(W=>_i(W.placement)===A?W.overflows[0]>0:!0)))return{data:{index:Y,overflows:F},reset:{placement:X}};let M=(B=F.filter(Q=>Q.overflows[0]<=0).sort((Q,W)=>Q.overflows[1]-W.overflows[1])[0])==null?void 0:B.placement;if(!M)switch(_){case"bestFit":{var V;const Q=(V=F.filter(W=>{if(I){const me=_i(W.placement);return me===A||me==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(me=>me>0).reduce((me,z)=>me+z,0)]).sort((W,me)=>W[1]-me[1])[0])==null?void 0:V[0];Q&&(M=Q);break}case"initialPlacement":M=u;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function _2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function b2(e){return hH.some(t=>e[t]>=0)}const CH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=as(e,t);switch(r){case"referenceHidden":{const s=await Uc(t,{...i,elementContext:"reference"}),o=_2(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:b2(o)}}}case"escaped":{const s=await Uc(t,{...i,altBoundary:!0}),o=_2(s,n.floating);return{data:{escapedOffsets:o,escaped:b2(o)}}}default:return{}}}}},OR=new Set(["left","top"]);async function TH(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=os(n),u=zl(n),c=_i(n)==="y",d=OR.has(o)?-1:1,p=s&&c?-1:1,m=as(t,e);let{mainAxis:g,crossAxis:_,alignmentAxis:v}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof v=="number"&&(_=u==="end"?v*-1:v),c?{x:_*p,y:g*d}:{x:g*d,y:_*p}}const kH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:u}=t,c=await TH(t,e);return o===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},AH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:u={fn:C=>{let{x:w,y:A}=C;return{x:w,y:A}}},...c}=as(e,t),d={x:n,y:r},p=await Uc(t,c),m=_i(os(i)),g=Nv(m);let _=d[g],v=d[m];if(s){const C=g==="y"?"top":"left",w=g==="y"?"bottom":"right",A=_+p[C],R=_-p[w];_=qb(A,_,R)}if(o){const C=m==="y"?"top":"left",w=m==="y"?"bottom":"right",A=v+p[C],R=v-p[w];v=qb(A,v,R)}const x=u.fn({...t,[g]:_,[m]:v});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:s,[m]:o}}}}}},RH=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:u=0,mainAxis:c=!0,crossAxis:d=!0}=as(e,t),p={x:n,y:r},m=_i(i),g=Nv(m);let _=p[g],v=p[m];const x=as(u,t),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const R=g==="y"?"height":"width",N=s.reference[g]-s.floating[R]+C.mainAxis,L=s.reference[g]+s.reference[R]-C.mainAxis;_<N?_=N:_>L&&(_=L)}if(d){var w,A;const R=g==="y"?"width":"height",N=OR.has(os(i)),L=s.reference[m]-s.floating[R]+(N&&((w=o.offset)==null?void 0:w[m])||0)+(N?0:C.crossAxis),I=s.reference[m]+s.reference[R]+(N?0:((A=o.offset)==null?void 0:A[m])||0)-(N?C.crossAxis:0);v<L?v=L:v>I&&(v=I)}return{[g]:_,[m]:v}}}},NH=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:u}=t,{apply:c=()=>{},...d}=as(e,t),p=await Uc(t,d),m=os(i),g=zl(i),_=_i(i)==="y",{width:v,height:x}=s.floating;let C,w;m==="top"||m==="bottom"?(C=m,w=g===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(w=m,C=g==="end"?"top":"bottom");const A=x-p.top-p.bottom,R=v-p.left-p.right,N=ra(x-p[C],A),L=ra(v-p[w],R),I=!t.middlewareData.shift;let P=N,q=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(q=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=A),I&&!g){const F=Sr(p.left,0),J=Sr(p.right,0),B=Sr(p.top,0),V=Sr(p.bottom,0);_?q=v-2*(F!==0||J!==0?F+J:Sr(p.left,p.right)):P=x-2*(B!==0||V!==0?B+V:Sr(p.top,p.bottom))}await c({...t,availableWidth:q,availableHeight:P});const ee=await o.getDimensions(u.floating);return v!==ee.width||x!==ee.height?{reset:{rects:!0}}:{}}}};function Pp(){return typeof window<"u"}function Ul(e){return DR(e)?(e.nodeName||"").toLowerCase():"#document"}function Er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ti(e){var t;return(t=(DR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function DR(e){return Pp()?e instanceof Node||e instanceof Er(e).Node:!1}function ei(e){return Pp()?e instanceof Element||e instanceof Er(e).Element:!1}function Ei(e){return Pp()?e instanceof HTMLElement||e instanceof Er(e).HTMLElement:!1}function v2(e){return!Pp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Er(e).ShadowRoot}const LH=new Set(["inline","contents"]);function lh(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ti(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!LH.has(i)}const OH=new Set(["table","td","th"]);function DH(e){return OH.has(Ul(e))}const MH=[":popover-open",":modal"];function Bp(e){return MH.some(t=>{try{return e.matches(t)}catch{return!1}})}const IH=["transform","translate","scale","rotate","perspective"],PH=["transform","translate","scale","rotate","perspective","filter"],BH=["paint","layout","strict","content"];function Dv(e){const t=Mv(),n=ei(e)?ti(e):e;return IH.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||PH.some(r=>(n.willChange||"").includes(r))||BH.some(r=>(n.contain||"").includes(r))}function HH(e){let t=ia(e);for(;Ei(t)&&!Tl(t);){if(Dv(t))return t;if(Bp(t))return null;t=ia(t)}return null}function Mv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const FH=new Set(["html","body","#document"]);function Tl(e){return FH.has(Ul(e))}function ti(e){return Er(e).getComputedStyle(e)}function Hp(e){return ei(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ia(e){if(Ul(e)==="html")return e;const t=e.assignedSlot||e.parentNode||v2(e)&&e.host||Ti(e);return v2(t)?t.host:t}function MR(e){const t=ia(e);return Tl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ei(t)&&lh(t)?t:MR(t)}function $c(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=MR(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Er(i);if(s){const u=Gb(o);return t.concat(o,o.visualViewport||[],lh(i)?i:[],u&&n?$c(u):[])}return t.concat(i,$c(i,[],n))}function Gb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function IR(e){const t=ti(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ei(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,u=np(n)!==s||np(r)!==o;return u&&(n=s,r=o),{width:n,height:r,$:u}}function Iv(e){return ei(e)?e:e.contextElement}function bl(e){const t=Iv(e);if(!Ei(t))return yi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=IR(t);let o=(s?np(n.width):n.width)/r,u=(s?np(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const jH=yi(0);function PR(e){const t=Er(e);return!Mv()||!t.visualViewport?jH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zH(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Er(e)?!1:t}function Qa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Iv(e);let o=yi(1);t&&(r?ei(r)&&(o=bl(r)):o=bl(e));const u=zH(s,n,r)?PR(s):yi(0);let c=(i.left+u.x)/o.x,d=(i.top+u.y)/o.y,p=i.width/o.x,m=i.height/o.y;if(s){const g=Er(s),_=r&&ei(r)?Er(r):r;let v=g,x=Gb(v);for(;x&&r&&_!==v;){const C=bl(x),w=x.getBoundingClientRect(),A=ti(x),R=w.left+(x.clientLeft+parseFloat(A.paddingLeft))*C.x,N=w.top+(x.clientTop+parseFloat(A.paddingTop))*C.y;c*=C.x,d*=C.y,p*=C.x,m*=C.y,c+=R,d+=N,v=Er(x),x=Gb(v)}}return ip({width:p,height:m,x:c,y:d})}function Fp(e,t){const n=Hp(e).scrollLeft;return t?t.left+n:Qa(Ti(e)).left+n}function BR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Fp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function UH(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Ti(r),u=t?Bp(t.floating):!1;if(r===o||u&&s)return n;let c={scrollLeft:0,scrollTop:0},d=yi(1);const p=yi(0),m=Ei(r);if((m||!m&&!s)&&((Ul(r)!=="body"||lh(o))&&(c=Hp(r)),Ei(r))){const _=Qa(r);d=bl(r),p.x=_.x+r.clientLeft,p.y=_.y+r.clientTop}const g=o&&!m&&!s?BR(o,c):yi(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-c.scrollTop*d.y+p.y+g.y}}function $H(e){return Array.from(e.getClientRects())}function VH(e){const t=Ti(e),n=Hp(e),r=e.ownerDocument.body,i=Sr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Sr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Fp(e);const u=-n.scrollTop;return ti(r).direction==="rtl"&&(o+=Sr(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:u}}const y2=25;function qH(e,t){const n=Er(e),r=Ti(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,u=0,c=0;if(i){s=i.width,o=i.height;const p=Mv();(!p||p&&t==="fixed")&&(u=i.offsetLeft,c=i.offsetTop)}const d=Fp(r);if(d<=0){const p=r.ownerDocument,m=p.body,g=getComputedStyle(m),_=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(r.clientWidth-m.clientWidth-_);v<=y2&&(s-=v)}else d<=y2&&(s+=d);return{width:s,height:o,x:u,y:c}}const WH=new Set(["absolute","fixed"]);function GH(e,t){const n=Qa(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Ei(e)?bl(e):yi(1),o=e.clientWidth*s.x,u=e.clientHeight*s.y,c=i*s.x,d=r*s.y;return{width:o,height:u,x:c,y:d}}function S2(e,t,n){let r;if(t==="viewport")r=qH(e,n);else if(t==="document")r=VH(Ti(e));else if(ei(t))r=GH(t,n);else{const i=PR(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ip(r)}function HR(e,t){const n=ia(e);return n===t||!ei(n)||Tl(n)?!1:ti(n).position==="fixed"||HR(n,t)}function YH(e,t){const n=t.get(e);if(n)return n;let r=$c(e,[],!1).filter(u=>ei(u)&&Ul(u)!=="body"),i=null;const s=ti(e).position==="fixed";let o=s?ia(e):e;for(;ei(o)&&!Tl(o);){const u=ti(o),c=Dv(o);!c&&u.position==="fixed"&&(i=null),(s?!c&&!i:!c&&u.position==="static"&&!!i&&WH.has(i.position)||lh(o)&&!c&&HR(e,o))?r=r.filter(p=>p!==o):i=u,o=ia(o)}return t.set(e,r),r}function KH(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Bp(t)?[]:YH(t,this._c):[].concat(n),r],u=o[0],c=o.reduce((d,p)=>{const m=S2(t,p,i);return d.top=Sr(m.top,d.top),d.right=ra(m.right,d.right),d.bottom=ra(m.bottom,d.bottom),d.left=Sr(m.left,d.left),d},S2(t,u,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function QH(e){const{width:t,height:n}=IR(e);return{width:t,height:n}}function XH(e,t,n){const r=Ei(t),i=Ti(t),s=n==="fixed",o=Qa(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const c=yi(0);function d(){c.x=Fp(i)}if(r||!r&&!s)if((Ul(t)!=="body"||lh(i))&&(u=Hp(t)),r){const _=Qa(t,!0,s,t);c.x=_.x+t.clientLeft,c.y=_.y+t.clientTop}else i&&d();s&&!r&&i&&d();const p=i&&!r&&!s?BR(i,u):yi(0),m=o.left+u.scrollLeft-c.x-p.x,g=o.top+u.scrollTop-c.y-p.y;return{x:m,y:g,width:o.width,height:o.height}}function d_(e){return ti(e).position==="static"}function E2(e,t){if(!Ei(e)||ti(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ti(e)===n&&(n=n.ownerDocument.body),n}function FR(e,t){const n=Er(e);if(Bp(e))return n;if(!Ei(e)){let i=ia(e);for(;i&&!Tl(i);){if(ei(i)&&!d_(i))return i;i=ia(i)}return n}let r=E2(e,t);for(;r&&DH(r)&&d_(r);)r=E2(r,t);return r&&Tl(r)&&d_(r)&&!Dv(r)?n:r||HH(e)||n}const ZH=async function(e){const t=this.getOffsetParent||FR,n=this.getDimensions,r=await n(e.floating);return{reference:XH(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function JH(e){return ti(e).direction==="rtl"}const eF={convertOffsetParentRelativeRectToViewportRelativeRect:UH,getDocumentElement:Ti,getClippingRect:KH,getOffsetParent:FR,getElementRects:ZH,getClientRects:$H,getDimensions:QH,getScale:bl,isElement:ei,isRTL:JH};function jR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tF(e,t){let n=null,r;const i=Ti(e);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function o(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:p,top:m,width:g,height:_}=d;if(u||t(),!g||!_)return;const v=Kd(m),x=Kd(i.clientWidth-(p+g)),C=Kd(i.clientHeight-(m+_)),w=Kd(p),R={rootMargin:-v+"px "+-x+"px "+-C+"px "+-w+"px",threshold:Sr(0,ra(1,c))||1};let N=!0;function L(I){const P=I[0].intersectionRatio;if(P!==c){if(!N)return o();P?o(!1,P):r=setTimeout(()=>{o(!1,1e-7)},1e3)}P===1&&!jR(d,e.getBoundingClientRect())&&o(),N=!1}try{n=new IntersectionObserver(L,{...R,root:i.ownerDocument})}catch{n=new IntersectionObserver(L,R)}n.observe(e)}return o(!0),s}function nF(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Iv(e),p=i||s?[...d?$c(d):[],...$c(t)]:[];p.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const m=d&&u?tF(d,n):null;let g=-1,_=null;o&&(_=new ResizeObserver(w=>{let[A]=w;A&&A.target===d&&_&&(_.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=_)==null||R.observe(t)})),n()}),d&&!c&&_.observe(d),_.observe(t));let v,x=c?Qa(e):null;c&&C();function C(){const w=Qa(e);x&&!jR(x,w)&&n(),x=w,v=requestAnimationFrame(C)}return n(),()=>{var w;p.forEach(A=>{i&&A.removeEventListener("scroll",n),s&&A.removeEventListener("resize",n)}),m?.(),(w=_)==null||w.disconnect(),_=null,c&&cancelAnimationFrame(v)}}const rF=kH,iF=AH,sF=wH,aF=NH,oF=CH,x2=xH,lF=RH,uF=(e,t,n)=>{const r=new Map,i={platform:eF,...n},s={...i.platform,_c:r};return EH(e,t,{...i,platform:s})};var cF=typeof document<"u",hF=function(){},wf=cF?T.useLayoutEffect:hF;function sp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!sp(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function zR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function w2(e,t){const n=zR(e);return Math.round(t*n)/n}function f_(e){const t=T.useRef(e);return wf(()=>{t.current=e}),t}function dF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:u=!0,whileElementsMounted:c,open:d}=e,[p,m]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,_]=T.useState(r);sp(g,r)||_(r);const[v,x]=T.useState(null),[C,w]=T.useState(null),A=T.useCallback(W=>{W!==I.current&&(I.current=W,x(W))},[]),R=T.useCallback(W=>{W!==P.current&&(P.current=W,w(W))},[]),N=s||v,L=o||C,I=T.useRef(null),P=T.useRef(null),q=T.useRef(p),ee=c!=null,F=f_(c),J=f_(i),B=f_(d),V=T.useCallback(()=>{if(!I.current||!P.current)return;const W={placement:t,strategy:n,middleware:g};J.current&&(W.platform=J.current),uF(I.current,P.current,W).then(me=>{const z={...me,isPositioned:B.current!==!1};Y.current&&!sp(q.current,z)&&(q.current=z,Ip.flushSync(()=>{m(z)}))})},[g,t,n,J,B]);wf(()=>{d===!1&&q.current.isPositioned&&(q.current.isPositioned=!1,m(W=>({...W,isPositioned:!1})))},[d]);const Y=T.useRef(!1);wf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),wf(()=>{if(N&&(I.current=N),L&&(P.current=L),N&&L){if(F.current)return F.current(N,L,V);V()}},[N,L,V,F,ee]);const X=T.useMemo(()=>({reference:I,floating:P,setReference:A,setFloating:R}),[A,R]),M=T.useMemo(()=>({reference:N,floating:L}),[N,L]),Q=T.useMemo(()=>{const W={position:n,left:0,top:0};if(!M.floating)return W;const me=w2(M.floating,p.x),z=w2(M.floating,p.y);return u?{...W,transform:"translate("+me+"px, "+z+"px)",...zR(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:me,top:z}},[n,u,M.floating,p.x,p.y]);return T.useMemo(()=>({...p,update:V,refs:X,elements:M,floatingStyles:Q}),[p,V,X,M,Q])}const fF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?x2({element:r.current,padding:i}).fn(n):{}:r?x2({element:r,padding:i}).fn(n):{}}}},pF=(e,t)=>({...rF(e),options:[e,t]}),mF=(e,t)=>({...iF(e),options:[e,t]}),gF=(e,t)=>({...lF(e),options:[e,t]}),_F=(e,t)=>({...sF(e),options:[e,t]}),bF=(e,t)=>({...aF(e),options:[e,t]}),vF=(e,t)=>({...oF(e),options:[e,t]}),yF=(e,t)=>({...fF(e),options:[e,t]});var SF="Arrow",UR=T.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return S.jsx(ni.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});UR.displayName=SF;var EF=UR;function xF(e){const[t,n]=T.useState(void 0);return na(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,u;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,u=d.blockSize}else o=e.offsetWidth,u=e.offsetHeight;n({width:o,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Pv="Popper",[$R,jp]=Av(Pv),[wF,VR]=$R(Pv),qR=e=>{const{__scopePopper:t,children:n}=e,[r,i]=T.useState(null);return S.jsx(wF,{scope:t,anchor:r,onAnchorChange:i,children:n})};qR.displayName=Pv;var WR="PopperAnchor",GR=T.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=VR(WR,n),o=T.useRef(null),u=Ci(t,o),c=T.useRef(null);return T.useEffect(()=>{const d=c.current;c.current=r?.current||o.current,d!==c.current&&s.onAnchorChange(c.current)}),r?null:S.jsx(ni.div,{...i,ref:u})});GR.displayName=WR;var Bv="PopperContent",[CF,TF]=$R(Bv),YR=T.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:_="optimized",onPlaced:v,...x}=e,C=VR(Bv,n),[w,A]=T.useState(null),R=Ci(t,Ee=>A(Ee)),[N,L]=T.useState(null),I=xF(N),P=I?.width??0,q=I?.height??0,ee=r+(s!=="center"?"-"+s:""),F=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},J=Array.isArray(d)?d:[d],B=J.length>0,V={padding:F,boundary:J.filter(AF),altBoundary:B},{refs:Y,floatingStyles:X,placement:M,isPositioned:Q,middlewareData:W}=dF({strategy:"fixed",placement:ee,whileElementsMounted:(...Ee)=>nF(...Ee,{animationFrame:_==="always"}),elements:{reference:C.anchor},middleware:[pF({mainAxis:i+q,alignmentAxis:o}),c&&mF({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?gF():void 0,...V}),c&&_F({...V}),bF({...V,apply:({elements:Ee,rects:Qe,availableWidth:Ae,availableHeight:xt})=>{const{width:Pt,height:Bt}=Qe.reference,ze=Ee.floating.style;ze.setProperty("--radix-popper-available-width",`${Ae}px`),ze.setProperty("--radix-popper-available-height",`${xt}px`),ze.setProperty("--radix-popper-anchor-width",`${Pt}px`),ze.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),N&&yF({element:N,padding:u}),RF({arrowWidth:P,arrowHeight:q}),g&&vF({strategy:"referenceHidden",...V})]}),[me,z]=XR(M),U=Cl(v);na(()=>{Q&&U?.()},[Q,U]);const se=W.arrow?.x,O=W.arrow?.y,ce=W.arrow?.centerOffset!==0,[xe,ve]=T.useState();return na(()=>{w&&ve(window.getComputedStyle(w).zIndex)},[w]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:Q?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(CF,{scope:n,placedSide:me,onArrowChange:L,arrowX:se,arrowY:O,shouldHideArrow:ce,children:S.jsx(ni.div,{"data-side":me,"data-align":z,...x,ref:R,style:{...x.style,animation:Q?void 0:"none"}})})})});YR.displayName=Bv;var KR="PopperArrow",kF={top:"bottom",right:"left",bottom:"top",left:"right"},QR=T.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=TF(KR,r),o=kF[s.placedSide];return S.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:S.jsx(EF,{...i,ref:n,style:{...i.style,display:"block"}})})});QR.displayName=KR;function AF(e){return e!==null}var RF=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,u=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,p]=XR(n),m={start:"0%",center:"50%",end:"100%"}[p],g=(i.arrow?.x??0)+u/2,_=(i.arrow?.y??0)+c/2;let v="",x="";return d==="bottom"?(v=o?m:`${g}px`,x=`${-c}px`):d==="top"?(v=o?m:`${g}px`,x=`${r.floating.height+c}px`):d==="right"?(v=`${-c}px`,x=o?m:`${_}px`):d==="left"&&(v=`${r.floating.width+c}px`,x=o?m:`${_}px`),{data:{x:v,y:x}}}});function XR(e){const[t,n="center"]=e.split("-");return[t,n]}var ZR=qR,Hv=GR,JR=YR,eN=QR,NF="Portal",Fv=T.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=T.useState(!1);na(()=>s(!0),[]);const o=n||i&&globalThis?.document?.body;return o?F7.createPortal(S.jsx(ni.div,{...r,ref:t}),o):null});Fv.displayName=NF;function LF(e,t){return T.useReducer((n,r)=>t[n][r]??n,e)}var uh=e=>{const{present:t,children:n}=e,r=OF(t),i=typeof n=="function"?n({present:r.isPresent}):T.Children.only(n),s=Ci(r.ref,DF(i));return typeof n=="function"||r.isPresent?T.cloneElement(i,{ref:s}):null};uh.displayName="Presence";function OF(e){const[t,n]=T.useState(),r=T.useRef(null),i=T.useRef(e),s=T.useRef("none"),o=e?"mounted":"unmounted",[u,c]=LF(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const d=Qd(r.current);s.current=u==="mounted"?d:"none"},[u]),na(()=>{const d=r.current,p=i.current;if(p!==e){const g=s.current,_=Qd(d);e?c("MOUNT"):_==="none"||d?.display==="none"?c("UNMOUNT"):c(p&&g!==_?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),na(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=_=>{const x=Qd(r.current).includes(CSS.escape(_.animationName));if(_.target===t&&x&&(c("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},g=_=>{_.target===t&&(s.current=Qd(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:T.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Qd(e){return e?.animationName||"none"}function DF(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var MF=AA[" useInsertionEffect ".trim().toString()]||na;function tN({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,o]=IF({defaultProp:t,onChange:n}),u=e!==void 0,c=u?e:i;{const p=T.useRef(e!==void 0);T.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const d=T.useCallback(p=>{if(u){const m=PF(p)?p(e):p;m!==e&&o.current?.(m)}else s(p)},[u,e,s,o]);return[c,d]}function IF({defaultProp:e,onChange:t}){const[n,r]=T.useState(e),i=T.useRef(n),s=T.useRef(t);return MF(()=>{s.current=t},[t]),T.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function PF(e){return typeof e=="function"}var BF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},el=new WeakMap,Xd=new WeakMap,Zd={},p_=0,nN=function(e){return e&&(e.host||nN(e.parentNode))},HF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=nN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},FF=function(e,t,n,r){var i=HF(t,Array.isArray(e)?e:[e]);Zd[n]||(Zd[n]=new WeakMap);var s=Zd[n],o=[],u=new Set,c=new Set(i),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};i.forEach(d);var p=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))p(g);else try{var _=g.getAttribute(r),v=_!==null&&_!=="false",x=(el.get(g)||0)+1,C=(s.get(g)||0)+1;el.set(g,x),s.set(g,C),o.push(g),x===1&&v&&Xd.set(g,!0),C===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",g,w)}})};return p(t),u.clear(),p_++,function(){o.forEach(function(m){var g=el.get(m)-1,_=s.get(m)-1;el.set(m,g),s.set(m,_),g||(Xd.has(m)||m.removeAttribute(r),Xd.delete(m)),_||m.removeAttribute(n)}),p_--,p_||(el=new WeakMap,el=new WeakMap,Xd=new WeakMap,Zd={})}},jF=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=BF(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),FF(r,i,n,"aria-hidden")):function(){return null}},gi=function(){return gi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},gi.apply(this,arguments)};function rN(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function zF(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Cf="right-scroll-bar-position",Tf="width-before-scroll-bar",UF="with-scroll-bars-hidden",$F="--removed-body-scroll-bar-size";function m_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function VF(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var qF=typeof window<"u"?T.useLayoutEffect:T.useEffect,C2=new WeakMap;function WF(e,t){var n=VF(null,function(r){return e.forEach(function(i){return m_(i,r)})});return qF(function(){var r=C2.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(u){s.has(u)||m_(u,null)}),s.forEach(function(u){i.has(u)||m_(u,o)})}C2.set(n,e)},[e]),n}function GF(e){return e}function YF(e,t){t===void 0&&(t=GF);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(u){return u!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var u=n;n=[],u.forEach(s),o=n}var c=function(){var p=o;o=[],p.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(p){o.push(p),d()},filter:function(p){return o=o.filter(p),n}}}};return i}function KF(e){e===void 0&&(e={});var t=YF(null);return t.options=gi({async:!0,ssr:!1},e),t}var iN=function(e){var t=e.sideCar,n=rN(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return T.createElement(r,gi({},n))};iN.isSideCarExport=!0;function QF(e,t){return e.useMedium(t),iN}var sN=KF(),g_=function(){},zp=T.forwardRef(function(e,t){var n=T.useRef(null),r=T.useState({onScrollCapture:g_,onWheelCapture:g_,onTouchMoveCapture:g_}),i=r[0],s=r[1],o=e.forwardProps,u=e.children,c=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,_=e.noRelative,v=e.noIsolation,x=e.inert,C=e.allowPinchZoom,w=e.as,A=w===void 0?"div":w,R=e.gapMode,N=rN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=g,I=WF([n,t]),P=gi(gi({},N),i);return T.createElement(T.Fragment,null,p&&T.createElement(L,{sideCar:sN,removeScrollBar:d,shards:m,noRelative:_,noIsolation:v,inert:x,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:R}),o?T.cloneElement(T.Children.only(u),gi(gi({},P),{ref:I})):T.createElement(A,gi({},P,{className:c,ref:I}),u))});zp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zp.classNames={fullWidth:Tf,zeroRight:Cf};var XF=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ZF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=XF();return t&&e.setAttribute("nonce",t),e}function JF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ej(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ZF())&&(JF(t,n),ej(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nj=function(){var e=tj();return function(t,n){T.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},aN=function(){var e=nj(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},rj={left:0,top:0,right:0,gap:0},__=function(e){return parseInt(e||"",10)||0},ij=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[__(n),__(r),__(i)]},sj=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rj;var t=ij(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},aj=aN(),vl="data-scroll-locked",oj=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
1291
|
+
`||m[m.length-1]==="");)m.pop();for(const N of m){const L=x7(N);if(L==null)continue;const{type:I,line:P}=L;if(I==="addition")(A==null||A.type!=="change")&&(A=a_("change"),v.push(A)),A.additions.push(P),x++,R="addition";else if(I==="deletion")(A==null||A.type!=="change")&&(A=a_("change"),v.push(A)),A.deletions.push(P),C++,R="deletion";else if(I==="context")(A==null||A.type!=="context")&&(A=a_("context"),v.push(A)),A.lines.push(P),R="context";else if(I==="metadata"&&A!=null){if(A.type==="context")A.noEOFCR=!0;else if(R==="deletion"){A.noEOFCRDeletions=!0;const q=A.deletions.length-1;q>=0&&(A.deletions[q]=Ka(A.deletions[q]))}else if(R==="addition"){A.noEOFCRAdditions=!0;const q=A.additions.length-1;q>=0&&(A.additions[q]=Ka(A.additions[q]))}}}}const w={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(_[4]??"1"),additionStart:parseInt(_[3]),additionLines:x,deletionCount:parseInt(_[2]??"1"),deletionStart:parseInt(_[1]),deletionLines:C,hunkContent:v,hunkContext:_[5],hunkSpecs:g};if(isNaN(w.additionCount)||isNaN(w.deletionCount)||isNaN(w.additionStart)||isNaN(w.deletionStart)){console.error("parsePatchContent: invalid hunk metadata",w);continue}w.collapsedBefore=Math.max(w.additionStart-1-c,0),o.hunks.push(w),c=w.additionStart+w.additionCount-1;for(const A of v)A.type==="context"?(w.splitLineCount+=A.lines.length,w.unifiedLineCount+=A.lines.length):(w.splitLineCount+=Math.max(A.additions.length,A.deletions.length),w.unifiedLineCount+=A.deletions.length+A.additions.length);w.splitLineStart=o.splitLineCount,w.unifiedLineStart=o.unifiedLineCount,o.splitLineCount+=w.splitLineCount,o.unifiedLineCount+=w.unifiedLineCount}o!=null&&(!n&&o.prevName!=null&&o.name!==o.prevName&&(o.hunks.length>0?o.type="rename-changed":o.type="rename-pure"),o.type!=="rename-pure"&&o.type!=="rename-changed"&&(o.prevName=void 0),s.push(o))}return{patchMetadata:i,files:s}}function Tv(e,t){const n=[];for(const r of e.split(zI))try{n.push(w7(r,t!=null?`${t}-${n.length}`:void 0))}catch(i){console.error(i)}return n}function a_(e){return e==="change"?{type:"change",additions:[],deletions:[],noEOFCRAdditions:!1,noEOFCRDeletions:!1}:{type:"context",lines:[],noEOFCR:!1}}function ZC(e,t,n){const r=Tv(_7(e.name,t.name,e.contents,t.contents,e.header,t.header))[0]?.files[0];if(r==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return r.oldLines=e.contents.split(mb),r.newLines=t.contents.split(mb),e.cacheKey!=null&&t.cacheKey!=null&&(r.cacheKey=`${e.cacheKey}:${t.cacheKey}`),r}let C7=-1;var T7=class{static LoadedCustomComponent=p3;__id=++C7;fileContainer;spriteSVG;pre;unsafeCSSStyle;hoverContent;headerElement;headerMetadata;customHunkElements=[];errorWrapper;hunksRenderer;resizeManager;scrollSyncManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];oldFile;newFile;fileDiff;constructor(t={theme:vn},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.hunksRenderer=new S7({...t,hunkSeparators:typeof t.hunkSeparators=="function"?"custom":t.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new IA,this.scrollSyncManager=new i7,this.mouseEventManager=new MA("diff",jf(t,typeof t.hunkSeparators=="function"||(t.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager=new DA(Ff(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};setOptions(t){t!=null&&(this.options=t,this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof t.hunkSeparators=="function"?"custom":t.hunkSeparators}),this.mouseEventManager.setOptions(jf(t,typeof t.hunkSeparators=="function"||(t.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager.setOptions(Ff(t)))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){if((this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.hunksRenderer.setThemeType(t),this.headerElement!=null&&(t==="system"?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=t),this.pre!=null))switch(t){case"system":delete this.pre.dataset.themeType;break;case"light":case"dark":this.pre.dataset.themeType=t;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t){this.lineSelectionManager.setSelection(t)}cleanUp(){this.hunksRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.fileDiff=void 0,this.oldFile=void 0,this.newFile=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.headerElement=void 0,this.errorWrapper=void 0}hydrate(t){const{fileContainer:n,prerenderedHTML:r}=t;d3(n,r);for(const i of Array.from(n.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i;continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(lv)){this.unsafeCSSStyle=i;continue}}}if(this.pre==null)this.render(t);else{const{lineAnnotations:i,oldFile:s,newFile:o,fileDiff:u}=t;this.fileContainer=n,delete this.pre.dataset.dehydrated,this.lineAnnotations=i??this.lineAnnotations,this.newFile=o,this.oldFile=s,this.fileDiff=u??(s!=null&&o!=null?ZC(s,o):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??"scroll")==="scroll"&&(this.resizeManager.setup(this.pre),(this.options.diffStyle??"split")==="split"&&this.scrollSyncManager.setup(this.pre))}}rerender(){this.fileDiff==null&&this.newFile==null&&this.oldFile==null||this.render({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff,forceRender:!0})}handleExpandHunk=(t,n)=>{this.expandHunk(t,n)};expandHunk(t,n){this.hunksRenderer.expandHunk(t,n),this.rerender()}render({oldFile:t,newFile:n,fileDiff:r,forceRender:i=!1,lineAnnotations:s,fileContainer:o,containerWrapper:u}){const c=t!=null&&n!=null&&(!jb(t,this.oldFile)||!jb(n,this.newFile)),d=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!i&&!d&&(r!=null&&r===this.fileDiff||r==null&&!c)||(this.oldFile=t,this.newFile=n,r!=null?this.fileDiff=r:t!=null&&n!=null&&c&&(this.fileDiff=ZC(t,n)),s!=null&&this.setLineAnnotations(s),this.fileDiff==null))return;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators=="function"?"custom":this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableFileHeader:p=!1}=this.options;p&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),o=this.getOrCreateFileContainer(o,u);try{const m=this.hunksRenderer.renderDiff(this.fileDiff);if(m==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}m.headerElement!=null&&this.applyHeaderToDOM(m.headerElement,o);const g=this.getOrCreatePreNode(o);this.applyHunksToDOM(g,m),this.renderSeparators(m.hunkData),this.renderAnnotations(),this.renderHoverUtility()}catch(m){m instanceof Error&&this.applyErrorToDOM(m,o)}}renderSeparators(t){const{hunkSeparators:n}=this.options;if(!(this.isContainerManaged||this.fileContainer==null||typeof n!="function")){for(const r of this.customHunkElements)r.parentNode?.removeChild(r);this.customHunkElements.length=0;for(const r of t){const i=document.createElement("div");i.style.display="contents",i.slot=r.slotName,i.appendChild(n(r,this)),this.fileContainer.appendChild(i),this.customHunkElements.push(i)}}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(const n of this.annotationElements)n.parentNode?.removeChild(n);this.annotationElements.length=0;const{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const n of this.lineAnnotations){const r=t(n);if(r==null)continue;const i=l3(Ya(n));i.appendChild(r),this.annotationElements.push(i),this.fileContainer.appendChild(i)}}renderHoverUtility(){const{renderHoverUtility:t}=this.options;if(this.fileContainer==null||t==null)return;this.hoverContent==null&&(this.hoverContent=u3(),this.fileContainer.appendChild(this.hoverContent));const n=t(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML="",n!=null&&this.hoverContent.appendChild(n)}getOrCreateFileContainer(t,n){if(this.fileContainer=t??this.fileContainer??document.createElement(xl),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=o3;const i=r.firstChild;i instanceof SVGElement&&(this.spriteSVG=i,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(t){return this.pre==null?(this.pre=document.createElement("pre"),t.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==t&&t.shadowRoot?.appendChild(this.pre),this.pre}applyHeaderToDOM(t,n){this.cleanupErrorWrapper();const r=document.createElement("div");r.innerHTML=rs(t);const i=r.firstElementChild;if(!(i instanceof HTMLElement)||(this.headerElement!=null?n.shadowRoot?.replaceChild(i,this.headerElement):n.shadowRoot?.prepend(i),this.headerElement=i,this.isContainerManaged))return;const{renderHeaderMetadata:s}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const o=s?.({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff})??void 0;o!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=eh,o instanceof Element?this.headerMetadata.appendChild(o):this.headerMetadata.innerText=`${o}`,n.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:t}=this.options;t==null||t===""||(this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=c3(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=h3(t))}applyHunksToDOM(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,n),t.innerHTML="";let r,i;if(n.unifiedAST!=null){const s=xf({columnType:"unified"});s.innerHTML=this.hunksRenderer.renderPartialHTML(n.unifiedAST),t.appendChild(s)}else n.deletionsAST!=null&&(r=xf({columnType:"deletions"}),r.innerHTML=this.hunksRenderer.renderPartialHTML(n.deletionsAST),t.appendChild(r)),n.additionsAST!=null&&(i=xf({columnType:"additions"}),i.innerHTML=this.hunksRenderer.renderPartialHTML(n.additionsAST),t.appendChild(i));this.injectUnsafeCSS(),this.mouseEventManager.setup(t),this.lineSelectionManager.setup(t),(this.options.overflow??"scroll")==="scroll"?(this.resizeManager.setup(t),(this.options.diffStyle??"split")==="split"?this.scrollSyncManager.setup(t,r,i):this.scrollSyncManager.cleanUp()):(this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp())}applyPreNodeAttributes(t,{themeStyles:n,baseThemeType:r,additionsAST:i,deletionsAST:s,totalLines:o}){const{diffIndicators:u="bars",disableBackground:c=!1,disableLineNumbers:d=!1,overflow:p="scroll",themeType:m="system",diffStyle:g="split"}=this.options;f3({pre:t,diffIndicators:u,disableBackground:c,disableLineNumbers:d,overflow:p,split:g==="unified"?!1:i!=null&&s!=null,themeStyles:n,themeType:r??m,totalLines:o})}applyErrorToDOM(t,n){this.cleanupErrorWrapper();const r=this.getOrCreatePreNode(n);r.innerHTML="",r.parentNode?.removeChild(r),this.pre=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);const s=document.createElement("div");s.dataset.errorMessage="",s.innerText=t.message,this.errorWrapper.appendChild(s);const o=document.createElement("pre");o.dataset.errorStack="",o.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}};function JC(e){const t=[];for(const n of e){const r=Wa.get(n);if(r==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(r)}return t}function e2(e){for(const t of Array.isArray(e)?e:[e])if(!Wa.has(t))return!1;return!0}async function t2(e){const t=[],n=[];for(const r of e){if(r==="text"||r==="ansi")continue;const i=QR(r)??KR(r);"then"in i?n.push(i):t.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r){if(i==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(i)}}),t}function n2(e){const t=[];for(const n of e){const r=ss.get(n);if(r==null)throw new Error(`getAllResolvedThemes: ${n} is unresolved, you must resolve all necessary themes before calling this function`);t.push(r)}return t}async function r2(e){const t=[],n=[];for(const r of e){const i=ZR(r)??XR(r);"then"in i?n.push(i):t.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r)i!=null&&t.push(i)}),t}function k7(e,t,n){if(e===t||e==null||t==null)return e===t;const r=new Set(n),i=Object.keys(e),s=new Set(Object.keys(t));for(const o of i)if(s.delete(o),!r.has(o)&&(!(o in t)||e[o]!==t[o]))return!1;for(const o of Array.from(s))if(!r.has(o))return!1;return!0}function _3(e,t){return Dp(e?.theme??vn,t?.theme??vn)&&k7(e,t,["theme"])}const An=[],Tt=async(e,t={})=>{const n=await fetch(e,{headers:{"Content-Type":"application/json",...t.headers||{}},...t});if(!n.ok){const r=await n.text();throw new Error(r||n.statusText)}return n.status===204?null:await n.json()},zb=async(e,t={})=>{const n=await fetch(e,{headers:{...t.headers||{}},...t});if(!n.ok){const r=await n.text();throw new Error(r||n.statusText)}return n.status===204?"":await n.text()},sh=e=>{if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=Math.round((t.getTime()-Date.now())/1e3),r=Math.abs(n);let i="second",s=n;return r>=60&&(s=Math.round(n/60),i="minute"),r>=3600&&(s=Math.round(n/3600),i="hour"),r>=3600*24&&(s=Math.round(n/86400),i="day"),r>=3600*24*7&&(s=Math.round(n/(86400*7)),i="week"),r>=3600*24*30&&(s=Math.round(n/(86400*30)),i="month"),r>=3600*24*365&&(s=Math.round(n/(86400*365)),i="year"),new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(s,i)},o_=(e,t)=>e.length<=t?e:`${e.slice(0,Math.max(0,t-3))}...`,b3=e=>{if(!e||typeof e!="object")return"event";const t=e;if(typeof t.method=="string"){const r=t.method;return r==="thread/started"?"thread started":r==="turn/started"?"turn started":r==="turn/completed"?"turn completed":r==="item/agentMessage/delta"?"agent typing":r==="item/started"?"item started":r==="item/completed"?"item completed":r==="error"?"error":r.replace(/\//g," ")}const n=typeof t.type=="string"?t.type:"event";if(n==="thread.started")return typeof t.thread_id=="string"?`thread started: ${t.thread_id}`:"thread started";if(n==="turn.started")return"turn started";if(n==="turn.completed")return"turn completed";if(n==="turn.failed"){const r=t.error;if(r&&typeof r=="object"&&"message"in r){const i=r.message;if(typeof i=="string")return`turn failed: ${i}`}return"turn failed"}if(n==="error")return typeof t.message=="string"?`error: ${t.message}`:"error";if(n==="item.started"||n==="item.updated"||n==="item.completed"){const r=t.item;if(r&&typeof r=="object"){const i=r,s=typeof i.type=="string"?i.type:"item";if(s==="agent_message"&&typeof i.text=="string")return`agent: ${o_(i.text,140)}`;if(s==="reasoning"&&typeof i.text=="string")return`reasoning: ${o_(i.text,140)}`;if(s==="command_execution"&&typeof i.command=="string")return`command: ${o_(i.command,140)}`;if(s==="file_change"){const o=i.changes;if(Array.isArray(o)&&o.length>0){const u=o.map(c=>{if(c&&typeof c=="object"){const d=c;if(typeof d.path=="string")return d.path}return null}).filter(Boolean).slice(0,3);if(u.length)return`files: ${u.join(", ")}`}return"files changed"}return`${s.replace(/_/g," ")} (${n.replace(/_/g," ")})`}}return n.replace(/_/g," ")},ah=e=>{if(!e)return"";if(typeof e=="string")return e;if(!(e instanceof Error))return"";try{const t=JSON.parse(e.message);if(t&&typeof t.error=="string")return t.error}catch{return e.message}return e.message},v3=e=>{const t=ah(e);return t==="not_a_directory"?"The selected path is not a directory.":t==="invalid_path"?"The selected path could not be opened.":t?`Failed to open project: ${t}`:"Failed to open project."},A7=e=>{const t=e.replace(/\\/g,"/"),n=t.split("/"),r=n.pop()||t,i=n.join("/");return{prefix:i?`${i}/`:"",name:r}},R7={avif:"image",bmp:"image",gif:"image",ico:"image",jpeg:"image",jpg:"image",png:"image",svg:"image",webp:"image",mp4:"video",mov:"video",ogv:"video",webm:"video",mp3:"audio",m4a:"audio",ogg:"audio",wav:"audio",flac:"audio",pdf:"pdf"},N7=e=>{const t=e.split(".").pop()?.toLowerCase()||"";return R7[t]||""},Ub=(e,t)=>{if(!t||t.length===0)return e;const n=new Map;for(const r of e||An)n.set(r.path,r);for(const r of t){const i=n.get(r.path)||{};n.set(r.path,{...i,...r})}return Array.from(n.values()).sort((r,i)=>r.path.localeCompare(i.path))},L7=e=>{switch(e){case"new":return"added";case"deleted":return"deleted";case"rename-pure":case"rename-changed":return"renamed";default:return"modified"}},O7=(e,t)=>{if(!t)return"";const n=t.trim();if(!n)return"";if(/^diff --git/m.test(n)||/^---\s+/m.test(n))return n;const r=e||"unknown";return[`diff --git a/${r} b/${r}`,`--- a/${r}`,`+++ b/${r}`,n,""].join(`
|
|
1292
|
+
`)},y3=(e,t)=>{const n=O7(e,t);if(!n)return null;try{const i=Tv(n).flatMap(s=>s.files);return i.length===0?null:e&&i.find(s=>s.name===e||s.prevName===e)||i[0]}catch(r){return console.error("Failed to parse patch file",r),null}},$b=e=>{if(!e)return[];try{const t=Tv(e),n=new Map;for(const r of t)for(const i of r.files){if(!i.name)continue;const s=i.prevName&&i.prevName!==i.name?i.prevName:null,o={path:i.name,status:L7(i.type),fileDiff:i};s&&(o.previousPath=s),n.set(i.name,{...o})}return Array.from(n.values()).sort((r,i)=>r.path.localeCompare(i.path))}catch(t){return console.error("Failed to parse git diff",t),[]}},D7=e=>{if(!e)return null;const t=e.fileDiff;if(t?.hunks){let n=0,r=0;for(const i of t.hunks)n+=i.additionLines,r+=i.deletionLines;return{additions:n,deletions:r}}return null},oh=(...e)=>e.filter(Boolean).join(" ");function S3(e){const t=Number.parseInt(e.slice(0,2),16),n=Number.parseInt(e.slice(2,4),16),r=Number.parseInt(e.slice(4,6),16);return(.299*t+.587*n+.114*r)/255>.5?"#000000":"#ffffff"}const E3=(e,t)=>{const n=Vn({queryKey:["branches-info",e],queryFn:()=>Tt(`/api/projects/branches?project=${encodeURIComponent(e)}`),enabled:!!(e&&t)});return{branchList:n.data?.branches||An,currentBranch:n.data?.current||"",defaultBranchName:n.data?.defaultBranch||"main",branchesLoading:n.isLoading}},i2=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const g=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(_=>_(t,g))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d))},c=t=e(r,i,u);return u},M7=(e=>e?i2(e):i2),I7=e=>e;function P7(e,t=I7){const n=dl.useSyncExternalStore(e.subscribe,dl.useCallback(()=>t(e.getState()),[e,t]),dl.useCallback(()=>t(e.getInitialState()),[e,t]));return dl.useDebugValue(n),n}const s2=e=>{const t=M7(e),n=r=>P7(t,r);return Object.assign(n,t),n},kv=(e=>e?s2(e):s2),_t={projectPath:"diffact:projectPath",projectRoots:"diffact:projectRoots",recentProjects:"diffact:recentProjects",preferredEditor:"diffact:preferred-editor",preferredCommand:"diffact:preferred-command",fontFamily:"diffact:fontFamily",fontSize:"diffact:fontSize",theme:"diffact:theme",darkMode:"diffact:darkMode",commitCommand:"diffact:commitCommand"},ro=kv(e=>({selectedFilePath:"",selectedTreeFilePath:"",selectedCommitSha:"",selectedHistoryFilePath:"",selectedThreadId:"",attachedIssues:[],setSelectedFilePath:t=>e({selectedFilePath:t}),setSelectedTreeFilePath:t=>e({selectedTreeFilePath:t}),setSelectedCommitSha:t=>e({selectedCommitSha:t}),setSelectedHistoryFilePath:t=>e({selectedHistoryFilePath:t}),setSelectedThreadId:t=>e({selectedThreadId:t}),addAttachedIssue:t=>e(n=>n.attachedIssues.some(r=>r.number===t.number)?n:{attachedIssues:[...n.attachedIssues,t]}),removeAttachedIssue:t=>e(n=>({attachedIssues:n.attachedIssues.filter(r=>r.number!==t)})),clearAttachedIssues:()=>e({attachedIssues:[]}),clearAllSelections:()=>e({selectedFilePath:"",selectedTreeFilePath:"",selectedCommitSha:"",selectedHistoryFilePath:"",selectedThreadId:"",attachedIssues:[]}),clearAgentState:()=>e({selectedThreadId:"",attachedIssues:[]})})),B7=()=>typeof window>"u"?"":localStorage.getItem(_t.projectPath)||"",Rn=kv(e=>({projectPath:B7(),projectOpenError:"",branchTab:"branches",branchFilter:"",sidebarTab:"changes",isToolPanelVisible:!1,toolPanelTab:"agent",toolPanelLayout:"rows",terminalCols:0,terminalRows:0,isTerminalReady:!1,setProjectPath:t=>{const n=Rn.getState().projectPath;t!==n&&(ro.getState().clearAllSelections(),typeof window<"u"&&(t?localStorage.setItem(_t.projectPath,t):localStorage.removeItem(_t.projectPath)),e({projectPath:t,branchFilter:"",branchTab:"branches"}))},setProjectOpenError:t=>e({projectOpenError:t}),setBranchTab:t=>e({branchTab:t}),setBranchFilter:t=>e({branchFilter:t}),setSidebarTab:t=>e({sidebarTab:t}),setToolPanelVisible:t=>e({isToolPanelVisible:t}),toggleToolPanelVisible:()=>e(t=>({isToolPanelVisible:!t.isToolPanelVisible})),setToolPanelTab:t=>e({toolPanelTab:t}),setToolPanelLayout:t=>e({toolPanelLayout:t}),setTerminalSize:(t,n)=>e({terminalCols:t,terminalRows:n}),setTerminalReady:t=>e({isTerminalReady:t})})),l_=(e,t)=>{const n=t.stdout??e?.stdout??"",r=t.stderr??e?.stderr??"",i=e?.hasStreamedOutput??!1,s=n||r?`${n}${r}`:"";let o=e?.output||"",u=e?.lastOutputRunId;return!i&&s&&t.runId!==u&&(o=`${o}${s}`,u=t.runId),{...e,...t,stdout:n,stderr:r,output:o,hasStreamedOutput:i,lastOutputRunId:u}},Mp=kv(e=>({runs:{},runOrder:[],selectedRunId:"",runToTerminal:{},lastError:"",setSelectedRunId:t=>e({selectedRunId:t}),setError:t=>e({lastError:t}),clearError:()=>e({lastError:""}),setRuns:t=>e(n=>{const r={},i=new Map,s={};for(const c of t){const d=c.terminalId||c.runId;s[c.runId]=d,r[d]=l_(r[d]??n.runs[d],c);const p=Date.parse(c.startedAt);if(!Number.isNaN(p)){const m=i.get(d);(!m||p>m)&&i.set(d,p)}}const o=Object.keys(r).sort((c,d)=>{const p=i.get(c)??0;return(i.get(d)??0)-p}),u=n.selectedRunId&&r[n.selectedRunId]?n.selectedRunId:o[0]||"";return{runs:r,runOrder:o,selectedRunId:u,runToTerminal:s}}),upsertRun:t=>e(n=>{const r=t.terminalId||t.runId,i=!!n.runs[r],s={...n.runs,[r]:l_(n.runs[r],t)},o=i?n.runOrder:[r,...n.runOrder.filter(c=>c!==r)],u=n.selectedRunId||(t.status==="running"?r:"");return{runs:s,runOrder:o,selectedRunId:u,runToTerminal:{...n.runToTerminal,[t.runId]:r}}}),appendOutput:(t,n,r,i)=>e(s=>{const o=i||s.runToTerminal[t]||t,u=s.runs[o];if(!u)return s;const c=l_(u,{runId:t,terminalId:u.terminalId,projectPath:u.projectPath,commandId:u.commandId,commandName:u.commandName,commandLabel:u.commandLabel,commandSource:u.commandSource,status:u.status,exitCode:u.exitCode??null,signal:u.signal??null,startedAt:u.startedAt,completedAt:u.completedAt??null});return n==="stderr"?c.stderr=`${c.stderr}${r}`:c.stdout=`${c.stdout}${r}`,c.output=`${c.output}${r}`,c.hasStreamedOutput=!0,{runs:{...s.runs,[o]:c},runToTerminal:t&&t!==o?{...s.runToTerminal,[t]:o}:s.runToTerminal}}),removeRun:t=>e(n=>{if(!n.runs[t])return n;const r={...n.runs};delete r[t];const i=n.runOrder.filter(u=>u!==t),s=n.selectedRunId===t?i[0]||"":n.selectedRunId,o={...n.runToTerminal};for(const[u,c]of Object.entries(o))c===t&&delete o[u];return{runs:r,runOrder:i,selectedRunId:s,runToTerminal:o}}),clearRuns:()=>e(()=>({runs:{},runOrder:[],selectedRunId:"",runToTerminal:{},lastError:""}))}));function ir(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function a2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function x3(...e){return t=>{let n=!1;const r=e.map(i=>{const s=a2(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():a2(e[i],null)}}}}function Ci(...e){return T.useCallback(x3(...e),e)}function Av(e,t=[]){let n=[];function r(s,o){const u=T.createContext(o),c=n.length;n=[...n,o];const d=m=>{const{scope:g,children:_,...v}=m,x=g?.[e]?.[c]||u,C=T.useMemo(()=>v,Object.values(v));return S.jsx(x.Provider,{value:C,children:_})};d.displayName=s+"Provider";function p(m,g){const _=g?.[e]?.[c]||u,v=T.useContext(_);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[d,p]}const i=()=>{const s=n.map(o=>T.createContext(o));return function(u){const c=u?.[e]||s;return T.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return i.scopeName=e,[r,H7(i,...t)]}function H7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((u,{useScope:c,scopeName:d})=>{const m=c(s)[`__scope${d}`];return{...u,...m}},{});return T.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Ip=OA();const F7=Zc(Ip);function w3(e){const t=j7(e),n=T.forwardRef((r,i)=>{const{children:s,...o}=r,u=T.Children.toArray(s),c=u.find(U7);if(c){const d=c.props.children,p=u.map(m=>m===c?T.Children.count(d)>1?T.Children.only(null):T.isValidElement(d)?d.props.children:null:m);return S.jsx(t,{...o,ref:i,children:T.isValidElement(d)?T.cloneElement(d,void 0,p):null})}return S.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function j7(e){const t=T.forwardRef((n,r)=>{const{children:i,...s}=n;if(T.isValidElement(i)){const o=V7(i),u=$7(s,i.props);return i.type!==T.Fragment&&(u.ref=r?x3(r,o):o),T.cloneElement(i,u)}return T.Children.count(i)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var C3=Symbol("radix.slottable");function z7(e){const t=({children:n})=>S.jsx(S.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=C3,t}function U7(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===C3}function $7(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...u)=>{const c=s(...u);return i(...u),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function V7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var q7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ni=q7.reduce((e,t)=>{const n=w3(`Primitive.${t}`),r=T.forwardRef((i,s)=>{const{asChild:o,...u}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...u,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function W7(e,t){e&&Ip.flushSync(()=>e.dispatchEvent(t))}function Cl(e){const t=T.useRef(e);return T.useEffect(()=>{t.current=e}),T.useMemo(()=>(...n)=>t.current?.(...n),[])}function G7(e,t=globalThis?.document){const n=Cl(e);T.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Y7="DismissableLayer",Vb="dismissableLayer.update",K7="dismissableLayer.pointerDownOutside",Q7="dismissableLayer.focusOutside",o2,T3=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rv=T.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:u,...c}=e,d=T.useContext(T3),[p,m]=T.useState(null),g=p?.ownerDocument??globalThis?.document,[,_]=T.useState({}),v=Ci(t,P=>m(P)),x=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(C),A=p?x.indexOf(p):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,N=A>=w,L=J7(P=>{const q=P.target,ee=[...d.branches].some(F=>F.contains(q));!N||ee||(i?.(P),o?.(P),P.defaultPrevented||u?.())},g),I=eH(P=>{const q=P.target;[...d.branches].some(F=>F.contains(q))||(s?.(P),o?.(P),P.defaultPrevented||u?.())},g);return G7(P=>{A===d.layers.size-1&&(r?.(P),!P.defaultPrevented&&u&&(P.preventDefault(),u()))},g),T.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(o2=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),l2(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=o2)}},[p,g,n,d]),T.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),l2())},[p,d]),T.useEffect(()=>{const P=()=>_({});return document.addEventListener(Vb,P),()=>document.removeEventListener(Vb,P)},[]),S.jsx(ni.div,{...c,ref:v,style:{pointerEvents:R?N?"auto":"none":void 0,...e.style},onFocusCapture:ir(e.onFocusCapture,I.onFocusCapture),onBlurCapture:ir(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:ir(e.onPointerDownCapture,L.onPointerDownCapture)})});Rv.displayName=Y7;var X7="DismissableLayerBranch",Z7=T.forwardRef((e,t)=>{const n=T.useContext(T3),r=T.useRef(null),i=Ci(t,r);return T.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),S.jsx(ni.div,{...e,ref:i})});Z7.displayName=X7;function J7(e,t=globalThis?.document){const n=Cl(e),r=T.useRef(!1),i=T.useRef(()=>{});return T.useEffect(()=>{const s=u=>{if(u.target&&!r.current){let c=function(){k3(K7,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function eH(e,t=globalThis?.document){const n=Cl(e),r=T.useRef(!1);return T.useEffect(()=>{const i=s=>{s.target&&!r.current&&k3(Q7,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function l2(){const e=new CustomEvent(Vb);document.dispatchEvent(e)}function k3(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?W7(i,s):i.dispatchEvent(s)}var u_=0;function tH(){T.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??u2()),document.body.insertAdjacentElement("beforeend",e[1]??u2()),u_++,()=>{u_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),u_--}},[])}function u2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var c_="focusScope.autoFocusOnMount",h_="focusScope.autoFocusOnUnmount",c2={bubbles:!1,cancelable:!0},nH="FocusScope",A3=T.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[u,c]=T.useState(null),d=Cl(i),p=Cl(s),m=T.useRef(null),g=Ci(t,x=>c(x)),_=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(r){let x=function(R){if(_.paused||!u)return;const N=R.target;u.contains(N)?m.current=N:Vs(m.current,{select:!0})},C=function(R){if(_.paused||!u)return;const N=R.relatedTarget;N!==null&&(u.contains(N)||Vs(m.current,{select:!0}))},w=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&Vs(u)};document.addEventListener("focusin",x),document.addEventListener("focusout",C);const A=new MutationObserver(w);return u&&A.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",C),A.disconnect()}}},[r,u,_.paused]),T.useEffect(()=>{if(u){d2.add(_);const x=document.activeElement;if(!u.contains(x)){const w=new CustomEvent(c_,c2);u.addEventListener(c_,d),u.dispatchEvent(w),w.defaultPrevented||(rH(lH(R3(u)),{select:!0}),document.activeElement===x&&Vs(u))}return()=>{u.removeEventListener(c_,d),setTimeout(()=>{const w=new CustomEvent(h_,c2);u.addEventListener(h_,p),u.dispatchEvent(w),w.defaultPrevented||Vs(x??document.body,{select:!0}),u.removeEventListener(h_,p),d2.remove(_)},0)}}},[u,d,p,_]);const v=T.useCallback(x=>{if(!n&&!r||_.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,w=document.activeElement;if(C&&w){const A=x.currentTarget,[R,N]=iH(A);R&&N?!x.shiftKey&&w===N?(x.preventDefault(),n&&Vs(R,{select:!0})):x.shiftKey&&w===R&&(x.preventDefault(),n&&Vs(N,{select:!0})):w===A&&x.preventDefault()}},[n,r,_.paused]);return S.jsx(ni.div,{tabIndex:-1,...o,ref:g,onKeyDown:v})});A3.displayName=nH;function rH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vs(r,{select:t}),document.activeElement!==n)return}function iH(e){const t=R3(e),n=h2(t,e),r=h2(t.reverse(),e);return[n,r]}function R3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function h2(e,t){for(const n of e)if(!sH(n,{upTo:t}))return n}function sH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function aH(e){return e instanceof HTMLInputElement&&"select"in e}function Vs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aH(e)&&t&&e.select()}}var d2=oH();function oH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=f2(e,t),e.unshift(t)},remove(t){e=f2(e,t),e[0]?.resume()}}}function f2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lH(e){return e.filter(t=>t.tagName!=="A")}var na=globalThis?.document?T.useLayoutEffect:()=>{},uH=AA[" useId ".trim().toString()]||(()=>{}),cH=0;function N3(e){const[t,n]=T.useState(uH());return na(()=>{n(r=>r??String(cH++))},[e]),e||(t?`radix-${t}`:"")}const hH=["top","right","bottom","left"],ra=Math.min,Sr=Math.max,np=Math.round,Kd=Math.floor,yi=e=>({x:e,y:e}),dH={left:"right",right:"left",bottom:"top",top:"bottom"},fH={start:"end",end:"start"};function qb(e,t,n){return Sr(e,ra(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function os(e){return e.split("-")[0]}function zl(e){return e.split("-")[1]}function Nv(e){return e==="x"?"y":"x"}function Lv(e){return e==="y"?"height":"width"}const pH=new Set(["top","bottom"]);function _i(e){return pH.has(os(e))?"y":"x"}function Ov(e){return Nv(_i(e))}function mH(e,t,n){n===void 0&&(n=!1);const r=zl(e),i=Ov(e),s=Lv(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=rp(o)),[o,rp(o)]}function gH(e){const t=rp(e);return[Wb(e),t,Wb(t)]}function Wb(e){return e.replace(/start|end/g,t=>fH[t])}const p2=["left","right"],m2=["right","left"],_H=["top","bottom"],bH=["bottom","top"];function vH(e,t,n){switch(e){case"top":case"bottom":return n?t?m2:p2:t?p2:m2;case"left":case"right":return t?_H:bH;default:return[]}}function yH(e,t,n,r){const i=zl(e);let s=vH(os(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Wb)))),s}function rp(e){return e.replace(/left|right|bottom|top/g,t=>dH[t])}function SH(e){return{top:0,right:0,bottom:0,left:0,...e}}function L3(e){return typeof e!="number"?SH(e):{top:e,right:e,bottom:e,left:e}}function ip(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function g2(e,t,n){let{reference:r,floating:i}=e;const s=_i(t),o=Ov(t),u=Lv(o),c=os(t),d=s==="y",p=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,g=r[u]/2-i[u]/2;let _;switch(c){case"top":_={x:p,y:r.y-i.height};break;case"bottom":_={x:p,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:m};break;case"left":_={x:r.x-i.width,y:m};break;default:_={x:r.x,y:r.y}}switch(zl(t)){case"start":_[o]-=g*(n&&d?-1:1);break;case"end":_[o]+=g*(n&&d?-1:1);break}return _}const EH=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,u=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:m}=g2(d,r,c),g=r,_={},v=0;for(let x=0;x<u.length;x++){const{name:C,fn:w}=u[x],{x:A,y:R,data:N,reset:L}=await w({x:p,y:m,initialPlacement:r,placement:g,strategy:i,middlewareData:_,rects:d,platform:o,elements:{reference:e,floating:t}});p=A??p,m=R??m,_={..._,[C]:{..._[C],...N}},L&&v<=50&&(v++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(d=L.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:p,y:m}=g2(d,g,c)),x=-1)}return{x:p,y:m,placement:g,strategy:i,middlewareData:_}};async function Uc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:u,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:g=!1,padding:_=0}=as(t,e),v=L3(_),C=u[g?m==="floating"?"reference":"floating":m],w=ip(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(C)))==null||n?C:C.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:d,rootBoundary:p,strategy:c})),A=m==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),N=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},L=ip(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:A,offsetParent:R,strategy:c}):A);return{top:(w.top-L.top+v.top)/N.y,bottom:(L.bottom-w.bottom+v.bottom)/N.y,left:(w.left-L.left+v.left)/N.x,right:(L.right-w.right+v.right)/N.x}}const xH=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:u,middlewareData:c}=t,{element:d,padding:p=0}=as(e,t)||{};if(d==null)return{};const m=L3(p),g={x:n,y:r},_=Ov(i),v=Lv(_),x=await o.getDimensions(d),C=_==="y",w=C?"top":"left",A=C?"bottom":"right",R=C?"clientHeight":"clientWidth",N=s.reference[v]+s.reference[_]-g[_]-s.floating[v],L=g[_]-s.reference[_],I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let P=I?I[R]:0;(!P||!await(o.isElement==null?void 0:o.isElement(I)))&&(P=u.floating[R]||s.floating[v]);const q=N/2-L/2,ee=P/2-x[v]/2-1,F=ra(m[w],ee),J=ra(m[A],ee),B=F,V=P-x[v]-J,Y=P/2-x[v]/2+q,X=qb(B,Y,V),M=!c.arrow&&zl(i)!=null&&Y!==X&&s.reference[v]/2-(Y<B?F:J)-x[v]/2<0,Q=M?Y<B?Y-B:Y-V:0;return{[_]:g[_]+Q,data:{[_]:X,centerOffset:Y-X-Q,...M&&{alignmentOffset:Q}},reset:M}}}),wH=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:u,platform:c,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:x=!0,...C}=as(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=os(i),A=_i(u),R=os(u)===u,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),L=g||(R||!x?[rp(u)]:gH(u)),I=v!=="none";!g&&I&&L.push(...yH(u,x,v,N));const P=[u,...L],q=await Uc(t,C),ee=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&ee.push(q[w]),m){const Y=mH(i,o,N);ee.push(q[Y[0]],q[Y[1]])}if(F=[...F,{placement:i,overflows:ee}],!ee.every(Y=>Y<=0)){var J,B;const Y=(((J=s.flip)==null?void 0:J.index)||0)+1,X=P[Y];if(X&&(!(m==="alignment"?A!==_i(X):!1)||F.every(W=>_i(W.placement)===A?W.overflows[0]>0:!0)))return{data:{index:Y,overflows:F},reset:{placement:X}};let M=(B=F.filter(Q=>Q.overflows[0]<=0).sort((Q,W)=>Q.overflows[1]-W.overflows[1])[0])==null?void 0:B.placement;if(!M)switch(_){case"bestFit":{var V;const Q=(V=F.filter(W=>{if(I){const me=_i(W.placement);return me===A||me==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(me=>me>0).reduce((me,z)=>me+z,0)]).sort((W,me)=>W[1]-me[1])[0])==null?void 0:V[0];Q&&(M=Q);break}case"initialPlacement":M=u;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function _2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function b2(e){return hH.some(t=>e[t]>=0)}const CH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=as(e,t);switch(r){case"referenceHidden":{const s=await Uc(t,{...i,elementContext:"reference"}),o=_2(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:b2(o)}}}case"escaped":{const s=await Uc(t,{...i,altBoundary:!0}),o=_2(s,n.floating);return{data:{escapedOffsets:o,escaped:b2(o)}}}default:return{}}}}},O3=new Set(["left","top"]);async function TH(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=os(n),u=zl(n),c=_i(n)==="y",d=O3.has(o)?-1:1,p=s&&c?-1:1,m=as(t,e);let{mainAxis:g,crossAxis:_,alignmentAxis:v}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof v=="number"&&(_=u==="end"?v*-1:v),c?{x:_*p,y:g*d}:{x:g*d,y:_*p}}const kH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:u}=t,c=await TH(t,e);return o===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},AH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:u={fn:C=>{let{x:w,y:A}=C;return{x:w,y:A}}},...c}=as(e,t),d={x:n,y:r},p=await Uc(t,c),m=_i(os(i)),g=Nv(m);let _=d[g],v=d[m];if(s){const C=g==="y"?"top":"left",w=g==="y"?"bottom":"right",A=_+p[C],R=_-p[w];_=qb(A,_,R)}if(o){const C=m==="y"?"top":"left",w=m==="y"?"bottom":"right",A=v+p[C],R=v-p[w];v=qb(A,v,R)}const x=u.fn({...t,[g]:_,[m]:v});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:s,[m]:o}}}}}},RH=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:u=0,mainAxis:c=!0,crossAxis:d=!0}=as(e,t),p={x:n,y:r},m=_i(i),g=Nv(m);let _=p[g],v=p[m];const x=as(u,t),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const R=g==="y"?"height":"width",N=s.reference[g]-s.floating[R]+C.mainAxis,L=s.reference[g]+s.reference[R]-C.mainAxis;_<N?_=N:_>L&&(_=L)}if(d){var w,A;const R=g==="y"?"width":"height",N=O3.has(os(i)),L=s.reference[m]-s.floating[R]+(N&&((w=o.offset)==null?void 0:w[m])||0)+(N?0:C.crossAxis),I=s.reference[m]+s.reference[R]+(N?0:((A=o.offset)==null?void 0:A[m])||0)-(N?C.crossAxis:0);v<L?v=L:v>I&&(v=I)}return{[g]:_,[m]:v}}}},NH=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:u}=t,{apply:c=()=>{},...d}=as(e,t),p=await Uc(t,d),m=os(i),g=zl(i),_=_i(i)==="y",{width:v,height:x}=s.floating;let C,w;m==="top"||m==="bottom"?(C=m,w=g===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(w=m,C=g==="end"?"top":"bottom");const A=x-p.top-p.bottom,R=v-p.left-p.right,N=ra(x-p[C],A),L=ra(v-p[w],R),I=!t.middlewareData.shift;let P=N,q=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(q=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=A),I&&!g){const F=Sr(p.left,0),J=Sr(p.right,0),B=Sr(p.top,0),V=Sr(p.bottom,0);_?q=v-2*(F!==0||J!==0?F+J:Sr(p.left,p.right)):P=x-2*(B!==0||V!==0?B+V:Sr(p.top,p.bottom))}await c({...t,availableWidth:q,availableHeight:P});const ee=await o.getDimensions(u.floating);return v!==ee.width||x!==ee.height?{reset:{rects:!0}}:{}}}};function Pp(){return typeof window<"u"}function Ul(e){return D3(e)?(e.nodeName||"").toLowerCase():"#document"}function Er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ti(e){var t;return(t=(D3(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function D3(e){return Pp()?e instanceof Node||e instanceof Er(e).Node:!1}function ei(e){return Pp()?e instanceof Element||e instanceof Er(e).Element:!1}function Ei(e){return Pp()?e instanceof HTMLElement||e instanceof Er(e).HTMLElement:!1}function v2(e){return!Pp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Er(e).ShadowRoot}const LH=new Set(["inline","contents"]);function lh(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ti(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!LH.has(i)}const OH=new Set(["table","td","th"]);function DH(e){return OH.has(Ul(e))}const MH=[":popover-open",":modal"];function Bp(e){return MH.some(t=>{try{return e.matches(t)}catch{return!1}})}const IH=["transform","translate","scale","rotate","perspective"],PH=["transform","translate","scale","rotate","perspective","filter"],BH=["paint","layout","strict","content"];function Dv(e){const t=Mv(),n=ei(e)?ti(e):e;return IH.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||PH.some(r=>(n.willChange||"").includes(r))||BH.some(r=>(n.contain||"").includes(r))}function HH(e){let t=ia(e);for(;Ei(t)&&!Tl(t);){if(Dv(t))return t;if(Bp(t))return null;t=ia(t)}return null}function Mv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const FH=new Set(["html","body","#document"]);function Tl(e){return FH.has(Ul(e))}function ti(e){return Er(e).getComputedStyle(e)}function Hp(e){return ei(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ia(e){if(Ul(e)==="html")return e;const t=e.assignedSlot||e.parentNode||v2(e)&&e.host||Ti(e);return v2(t)?t.host:t}function M3(e){const t=ia(e);return Tl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ei(t)&&lh(t)?t:M3(t)}function $c(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=M3(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Er(i);if(s){const u=Gb(o);return t.concat(o,o.visualViewport||[],lh(i)?i:[],u&&n?$c(u):[])}return t.concat(i,$c(i,[],n))}function Gb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I3(e){const t=ti(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ei(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,u=np(n)!==s||np(r)!==o;return u&&(n=s,r=o),{width:n,height:r,$:u}}function Iv(e){return ei(e)?e:e.contextElement}function bl(e){const t=Iv(e);if(!Ei(t))return yi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=I3(t);let o=(s?np(n.width):n.width)/r,u=(s?np(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const jH=yi(0);function P3(e){const t=Er(e);return!Mv()||!t.visualViewport?jH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zH(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Er(e)?!1:t}function Qa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Iv(e);let o=yi(1);t&&(r?ei(r)&&(o=bl(r)):o=bl(e));const u=zH(s,n,r)?P3(s):yi(0);let c=(i.left+u.x)/o.x,d=(i.top+u.y)/o.y,p=i.width/o.x,m=i.height/o.y;if(s){const g=Er(s),_=r&&ei(r)?Er(r):r;let v=g,x=Gb(v);for(;x&&r&&_!==v;){const C=bl(x),w=x.getBoundingClientRect(),A=ti(x),R=w.left+(x.clientLeft+parseFloat(A.paddingLeft))*C.x,N=w.top+(x.clientTop+parseFloat(A.paddingTop))*C.y;c*=C.x,d*=C.y,p*=C.x,m*=C.y,c+=R,d+=N,v=Er(x),x=Gb(v)}}return ip({width:p,height:m,x:c,y:d})}function Fp(e,t){const n=Hp(e).scrollLeft;return t?t.left+n:Qa(Ti(e)).left+n}function B3(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Fp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function UH(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Ti(r),u=t?Bp(t.floating):!1;if(r===o||u&&s)return n;let c={scrollLeft:0,scrollTop:0},d=yi(1);const p=yi(0),m=Ei(r);if((m||!m&&!s)&&((Ul(r)!=="body"||lh(o))&&(c=Hp(r)),Ei(r))){const _=Qa(r);d=bl(r),p.x=_.x+r.clientLeft,p.y=_.y+r.clientTop}const g=o&&!m&&!s?B3(o,c):yi(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-c.scrollTop*d.y+p.y+g.y}}function $H(e){return Array.from(e.getClientRects())}function VH(e){const t=Ti(e),n=Hp(e),r=e.ownerDocument.body,i=Sr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Sr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Fp(e);const u=-n.scrollTop;return ti(r).direction==="rtl"&&(o+=Sr(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:u}}const y2=25;function qH(e,t){const n=Er(e),r=Ti(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,u=0,c=0;if(i){s=i.width,o=i.height;const p=Mv();(!p||p&&t==="fixed")&&(u=i.offsetLeft,c=i.offsetTop)}const d=Fp(r);if(d<=0){const p=r.ownerDocument,m=p.body,g=getComputedStyle(m),_=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(r.clientWidth-m.clientWidth-_);v<=y2&&(s-=v)}else d<=y2&&(s+=d);return{width:s,height:o,x:u,y:c}}const WH=new Set(["absolute","fixed"]);function GH(e,t){const n=Qa(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Ei(e)?bl(e):yi(1),o=e.clientWidth*s.x,u=e.clientHeight*s.y,c=i*s.x,d=r*s.y;return{width:o,height:u,x:c,y:d}}function S2(e,t,n){let r;if(t==="viewport")r=qH(e,n);else if(t==="document")r=VH(Ti(e));else if(ei(t))r=GH(t,n);else{const i=P3(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ip(r)}function H3(e,t){const n=ia(e);return n===t||!ei(n)||Tl(n)?!1:ti(n).position==="fixed"||H3(n,t)}function YH(e,t){const n=t.get(e);if(n)return n;let r=$c(e,[],!1).filter(u=>ei(u)&&Ul(u)!=="body"),i=null;const s=ti(e).position==="fixed";let o=s?ia(e):e;for(;ei(o)&&!Tl(o);){const u=ti(o),c=Dv(o);!c&&u.position==="fixed"&&(i=null),(s?!c&&!i:!c&&u.position==="static"&&!!i&&WH.has(i.position)||lh(o)&&!c&&H3(e,o))?r=r.filter(p=>p!==o):i=u,o=ia(o)}return t.set(e,r),r}function KH(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Bp(t)?[]:YH(t,this._c):[].concat(n),r],u=o[0],c=o.reduce((d,p)=>{const m=S2(t,p,i);return d.top=Sr(m.top,d.top),d.right=ra(m.right,d.right),d.bottom=ra(m.bottom,d.bottom),d.left=Sr(m.left,d.left),d},S2(t,u,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function QH(e){const{width:t,height:n}=I3(e);return{width:t,height:n}}function XH(e,t,n){const r=Ei(t),i=Ti(t),s=n==="fixed",o=Qa(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const c=yi(0);function d(){c.x=Fp(i)}if(r||!r&&!s)if((Ul(t)!=="body"||lh(i))&&(u=Hp(t)),r){const _=Qa(t,!0,s,t);c.x=_.x+t.clientLeft,c.y=_.y+t.clientTop}else i&&d();s&&!r&&i&&d();const p=i&&!r&&!s?B3(i,u):yi(0),m=o.left+u.scrollLeft-c.x-p.x,g=o.top+u.scrollTop-c.y-p.y;return{x:m,y:g,width:o.width,height:o.height}}function d_(e){return ti(e).position==="static"}function E2(e,t){if(!Ei(e)||ti(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ti(e)===n&&(n=n.ownerDocument.body),n}function F3(e,t){const n=Er(e);if(Bp(e))return n;if(!Ei(e)){let i=ia(e);for(;i&&!Tl(i);){if(ei(i)&&!d_(i))return i;i=ia(i)}return n}let r=E2(e,t);for(;r&&DH(r)&&d_(r);)r=E2(r,t);return r&&Tl(r)&&d_(r)&&!Dv(r)?n:r||HH(e)||n}const ZH=async function(e){const t=this.getOffsetParent||F3,n=this.getDimensions,r=await n(e.floating);return{reference:XH(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function JH(e){return ti(e).direction==="rtl"}const eF={convertOffsetParentRelativeRectToViewportRelativeRect:UH,getDocumentElement:Ti,getClippingRect:KH,getOffsetParent:F3,getElementRects:ZH,getClientRects:$H,getDimensions:QH,getScale:bl,isElement:ei,isRTL:JH};function j3(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tF(e,t){let n=null,r;const i=Ti(e);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function o(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:p,top:m,width:g,height:_}=d;if(u||t(),!g||!_)return;const v=Kd(m),x=Kd(i.clientWidth-(p+g)),C=Kd(i.clientHeight-(m+_)),w=Kd(p),R={rootMargin:-v+"px "+-x+"px "+-C+"px "+-w+"px",threshold:Sr(0,ra(1,c))||1};let N=!0;function L(I){const P=I[0].intersectionRatio;if(P!==c){if(!N)return o();P?o(!1,P):r=setTimeout(()=>{o(!1,1e-7)},1e3)}P===1&&!j3(d,e.getBoundingClientRect())&&o(),N=!1}try{n=new IntersectionObserver(L,{...R,root:i.ownerDocument})}catch{n=new IntersectionObserver(L,R)}n.observe(e)}return o(!0),s}function nF(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Iv(e),p=i||s?[...d?$c(d):[],...$c(t)]:[];p.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const m=d&&u?tF(d,n):null;let g=-1,_=null;o&&(_=new ResizeObserver(w=>{let[A]=w;A&&A.target===d&&_&&(_.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=_)==null||R.observe(t)})),n()}),d&&!c&&_.observe(d),_.observe(t));let v,x=c?Qa(e):null;c&&C();function C(){const w=Qa(e);x&&!j3(x,w)&&n(),x=w,v=requestAnimationFrame(C)}return n(),()=>{var w;p.forEach(A=>{i&&A.removeEventListener("scroll",n),s&&A.removeEventListener("resize",n)}),m?.(),(w=_)==null||w.disconnect(),_=null,c&&cancelAnimationFrame(v)}}const rF=kH,iF=AH,sF=wH,aF=NH,oF=CH,x2=xH,lF=RH,uF=(e,t,n)=>{const r=new Map,i={platform:eF,...n},s={...i.platform,_c:r};return EH(e,t,{...i,platform:s})};var cF=typeof document<"u",hF=function(){},wf=cF?T.useLayoutEffect:hF;function sp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!sp(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function z3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function w2(e,t){const n=z3(e);return Math.round(t*n)/n}function f_(e){const t=T.useRef(e);return wf(()=>{t.current=e}),t}function dF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:u=!0,whileElementsMounted:c,open:d}=e,[p,m]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,_]=T.useState(r);sp(g,r)||_(r);const[v,x]=T.useState(null),[C,w]=T.useState(null),A=T.useCallback(W=>{W!==I.current&&(I.current=W,x(W))},[]),R=T.useCallback(W=>{W!==P.current&&(P.current=W,w(W))},[]),N=s||v,L=o||C,I=T.useRef(null),P=T.useRef(null),q=T.useRef(p),ee=c!=null,F=f_(c),J=f_(i),B=f_(d),V=T.useCallback(()=>{if(!I.current||!P.current)return;const W={placement:t,strategy:n,middleware:g};J.current&&(W.platform=J.current),uF(I.current,P.current,W).then(me=>{const z={...me,isPositioned:B.current!==!1};Y.current&&!sp(q.current,z)&&(q.current=z,Ip.flushSync(()=>{m(z)}))})},[g,t,n,J,B]);wf(()=>{d===!1&&q.current.isPositioned&&(q.current.isPositioned=!1,m(W=>({...W,isPositioned:!1})))},[d]);const Y=T.useRef(!1);wf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),wf(()=>{if(N&&(I.current=N),L&&(P.current=L),N&&L){if(F.current)return F.current(N,L,V);V()}},[N,L,V,F,ee]);const X=T.useMemo(()=>({reference:I,floating:P,setReference:A,setFloating:R}),[A,R]),M=T.useMemo(()=>({reference:N,floating:L}),[N,L]),Q=T.useMemo(()=>{const W={position:n,left:0,top:0};if(!M.floating)return W;const me=w2(M.floating,p.x),z=w2(M.floating,p.y);return u?{...W,transform:"translate("+me+"px, "+z+"px)",...z3(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:me,top:z}},[n,u,M.floating,p.x,p.y]);return T.useMemo(()=>({...p,update:V,refs:X,elements:M,floatingStyles:Q}),[p,V,X,M,Q])}const fF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?x2({element:r.current,padding:i}).fn(n):{}:r?x2({element:r,padding:i}).fn(n):{}}}},pF=(e,t)=>({...rF(e),options:[e,t]}),mF=(e,t)=>({...iF(e),options:[e,t]}),gF=(e,t)=>({...lF(e),options:[e,t]}),_F=(e,t)=>({...sF(e),options:[e,t]}),bF=(e,t)=>({...aF(e),options:[e,t]}),vF=(e,t)=>({...oF(e),options:[e,t]}),yF=(e,t)=>({...fF(e),options:[e,t]});var SF="Arrow",U3=T.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return S.jsx(ni.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});U3.displayName=SF;var EF=U3;function xF(e){const[t,n]=T.useState(void 0);return na(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,u;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,u=d.blockSize}else o=e.offsetWidth,u=e.offsetHeight;n({width:o,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Pv="Popper",[$3,jp]=Av(Pv),[wF,V3]=$3(Pv),q3=e=>{const{__scopePopper:t,children:n}=e,[r,i]=T.useState(null);return S.jsx(wF,{scope:t,anchor:r,onAnchorChange:i,children:n})};q3.displayName=Pv;var W3="PopperAnchor",G3=T.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=V3(W3,n),o=T.useRef(null),u=Ci(t,o),c=T.useRef(null);return T.useEffect(()=>{const d=c.current;c.current=r?.current||o.current,d!==c.current&&s.onAnchorChange(c.current)}),r?null:S.jsx(ni.div,{...i,ref:u})});G3.displayName=W3;var Bv="PopperContent",[CF,TF]=$3(Bv),Y3=T.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:_="optimized",onPlaced:v,...x}=e,C=V3(Bv,n),[w,A]=T.useState(null),R=Ci(t,Ee=>A(Ee)),[N,L]=T.useState(null),I=xF(N),P=I?.width??0,q=I?.height??0,ee=r+(s!=="center"?"-"+s:""),F=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},J=Array.isArray(d)?d:[d],B=J.length>0,V={padding:F,boundary:J.filter(AF),altBoundary:B},{refs:Y,floatingStyles:X,placement:M,isPositioned:Q,middlewareData:W}=dF({strategy:"fixed",placement:ee,whileElementsMounted:(...Ee)=>nF(...Ee,{animationFrame:_==="always"}),elements:{reference:C.anchor},middleware:[pF({mainAxis:i+q,alignmentAxis:o}),c&&mF({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?gF():void 0,...V}),c&&_F({...V}),bF({...V,apply:({elements:Ee,rects:Qe,availableWidth:Ae,availableHeight:xt})=>{const{width:Pt,height:Bt}=Qe.reference,ze=Ee.floating.style;ze.setProperty("--radix-popper-available-width",`${Ae}px`),ze.setProperty("--radix-popper-available-height",`${xt}px`),ze.setProperty("--radix-popper-anchor-width",`${Pt}px`),ze.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),N&&yF({element:N,padding:u}),RF({arrowWidth:P,arrowHeight:q}),g&&vF({strategy:"referenceHidden",...V})]}),[me,z]=X3(M),U=Cl(v);na(()=>{Q&&U?.()},[Q,U]);const se=W.arrow?.x,O=W.arrow?.y,ce=W.arrow?.centerOffset!==0,[xe,ve]=T.useState();return na(()=>{w&&ve(window.getComputedStyle(w).zIndex)},[w]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:Q?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(CF,{scope:n,placedSide:me,onArrowChange:L,arrowX:se,arrowY:O,shouldHideArrow:ce,children:S.jsx(ni.div,{"data-side":me,"data-align":z,...x,ref:R,style:{...x.style,animation:Q?void 0:"none"}})})})});Y3.displayName=Bv;var K3="PopperArrow",kF={top:"bottom",right:"left",bottom:"top",left:"right"},Q3=T.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=TF(K3,r),o=kF[s.placedSide];return S.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:S.jsx(EF,{...i,ref:n,style:{...i.style,display:"block"}})})});Q3.displayName=K3;function AF(e){return e!==null}var RF=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,u=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,p]=X3(n),m={start:"0%",center:"50%",end:"100%"}[p],g=(i.arrow?.x??0)+u/2,_=(i.arrow?.y??0)+c/2;let v="",x="";return d==="bottom"?(v=o?m:`${g}px`,x=`${-c}px`):d==="top"?(v=o?m:`${g}px`,x=`${r.floating.height+c}px`):d==="right"?(v=`${-c}px`,x=o?m:`${_}px`):d==="left"&&(v=`${r.floating.width+c}px`,x=o?m:`${_}px`),{data:{x:v,y:x}}}});function X3(e){const[t,n="center"]=e.split("-");return[t,n]}var Z3=q3,Hv=G3,J3=Y3,eN=Q3,NF="Portal",Fv=T.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=T.useState(!1);na(()=>s(!0),[]);const o=n||i&&globalThis?.document?.body;return o?F7.createPortal(S.jsx(ni.div,{...r,ref:t}),o):null});Fv.displayName=NF;function LF(e,t){return T.useReducer((n,r)=>t[n][r]??n,e)}var uh=e=>{const{present:t,children:n}=e,r=OF(t),i=typeof n=="function"?n({present:r.isPresent}):T.Children.only(n),s=Ci(r.ref,DF(i));return typeof n=="function"||r.isPresent?T.cloneElement(i,{ref:s}):null};uh.displayName="Presence";function OF(e){const[t,n]=T.useState(),r=T.useRef(null),i=T.useRef(e),s=T.useRef("none"),o=e?"mounted":"unmounted",[u,c]=LF(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const d=Qd(r.current);s.current=u==="mounted"?d:"none"},[u]),na(()=>{const d=r.current,p=i.current;if(p!==e){const g=s.current,_=Qd(d);e?c("MOUNT"):_==="none"||d?.display==="none"?c("UNMOUNT"):c(p&&g!==_?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),na(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=_=>{const x=Qd(r.current).includes(CSS.escape(_.animationName));if(_.target===t&&x&&(c("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},g=_=>{_.target===t&&(s.current=Qd(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:T.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Qd(e){return e?.animationName||"none"}function DF(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var MF=AA[" useInsertionEffect ".trim().toString()]||na;function tN({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,o]=IF({defaultProp:t,onChange:n}),u=e!==void 0,c=u?e:i;{const p=T.useRef(e!==void 0);T.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const d=T.useCallback(p=>{if(u){const m=PF(p)?p(e):p;m!==e&&o.current?.(m)}else s(p)},[u,e,s,o]);return[c,d]}function IF({defaultProp:e,onChange:t}){const[n,r]=T.useState(e),i=T.useRef(n),s=T.useRef(t);return MF(()=>{s.current=t},[t]),T.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function PF(e){return typeof e=="function"}var BF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},el=new WeakMap,Xd=new WeakMap,Zd={},p_=0,nN=function(e){return e&&(e.host||nN(e.parentNode))},HF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=nN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},FF=function(e,t,n,r){var i=HF(t,Array.isArray(e)?e:[e]);Zd[n]||(Zd[n]=new WeakMap);var s=Zd[n],o=[],u=new Set,c=new Set(i),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};i.forEach(d);var p=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))p(g);else try{var _=g.getAttribute(r),v=_!==null&&_!=="false",x=(el.get(g)||0)+1,C=(s.get(g)||0)+1;el.set(g,x),s.set(g,C),o.push(g),x===1&&v&&Xd.set(g,!0),C===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",g,w)}})};return p(t),u.clear(),p_++,function(){o.forEach(function(m){var g=el.get(m)-1,_=s.get(m)-1;el.set(m,g),s.set(m,_),g||(Xd.has(m)||m.removeAttribute(r),Xd.delete(m)),_||m.removeAttribute(n)}),p_--,p_||(el=new WeakMap,el=new WeakMap,Xd=new WeakMap,Zd={})}},jF=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=BF(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),FF(r,i,n,"aria-hidden")):function(){return null}},gi=function(){return gi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},gi.apply(this,arguments)};function rN(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function zF(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Cf="right-scroll-bar-position",Tf="width-before-scroll-bar",UF="with-scroll-bars-hidden",$F="--removed-body-scroll-bar-size";function m_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function VF(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var qF=typeof window<"u"?T.useLayoutEffect:T.useEffect,C2=new WeakMap;function WF(e,t){var n=VF(null,function(r){return e.forEach(function(i){return m_(i,r)})});return qF(function(){var r=C2.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(u){s.has(u)||m_(u,null)}),s.forEach(function(u){i.has(u)||m_(u,o)})}C2.set(n,e)},[e]),n}function GF(e){return e}function YF(e,t){t===void 0&&(t=GF);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(u){return u!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var u=n;n=[],u.forEach(s),o=n}var c=function(){var p=o;o=[],p.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(p){o.push(p),d()},filter:function(p){return o=o.filter(p),n}}}};return i}function KF(e){e===void 0&&(e={});var t=YF(null);return t.options=gi({async:!0,ssr:!1},e),t}var iN=function(e){var t=e.sideCar,n=rN(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return T.createElement(r,gi({},n))};iN.isSideCarExport=!0;function QF(e,t){return e.useMedium(t),iN}var sN=KF(),g_=function(){},zp=T.forwardRef(function(e,t){var n=T.useRef(null),r=T.useState({onScrollCapture:g_,onWheelCapture:g_,onTouchMoveCapture:g_}),i=r[0],s=r[1],o=e.forwardProps,u=e.children,c=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,_=e.noRelative,v=e.noIsolation,x=e.inert,C=e.allowPinchZoom,w=e.as,A=w===void 0?"div":w,R=e.gapMode,N=rN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=g,I=WF([n,t]),P=gi(gi({},N),i);return T.createElement(T.Fragment,null,p&&T.createElement(L,{sideCar:sN,removeScrollBar:d,shards:m,noRelative:_,noIsolation:v,inert:x,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:R}),o?T.cloneElement(T.Children.only(u),gi(gi({},P),{ref:I})):T.createElement(A,gi({},P,{className:c,ref:I}),u))});zp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zp.classNames={fullWidth:Tf,zeroRight:Cf};var XF=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ZF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=XF();return t&&e.setAttribute("nonce",t),e}function JF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ej(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ZF())&&(JF(t,n),ej(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nj=function(){var e=tj();return function(t,n){T.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},aN=function(){var e=nj(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},rj={left:0,top:0,right:0,gap:0},__=function(e){return parseInt(e||"",10)||0},ij=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[__(n),__(r),__(i)]},sj=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rj;var t=ij(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},aj=aN(),vl="data-scroll-locked",oj=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
1293
1293
|
.`.concat(UF,` {
|
|
1294
1294
|
overflow: hidden `).concat(r,`;
|
|
1295
1295
|
padding-right: `).concat(u,"px ").concat(r,`;
|
|
@@ -1329,7 +1329,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[Lp(e),e])),a9=new Map([["s",rn(383)],[rn(383
|
|
|
1329
1329
|
`)},T2=function(){var e=parseInt(document.body.getAttribute(vl)||"0",10);return isFinite(e)?e:0},lj=function(){T.useEffect(function(){return document.body.setAttribute(vl,(T2()+1).toString()),function(){var e=T2()-1;e<=0?document.body.removeAttribute(vl):document.body.setAttribute(vl,e.toString())}},[])},uj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;lj();var s=T.useMemo(function(){return sj(i)},[i]);return T.createElement(aj,{styles:oj(s,!t,i,n?"":"!important")})},Yb=!1;if(typeof window<"u")try{var Jd=Object.defineProperty({},"passive",{get:function(){return Yb=!0,!0}});window.addEventListener("test",Jd,Jd),window.removeEventListener("test",Jd,Jd)}catch{Yb=!1}var tl=Yb?{passive:!1}:!1,cj=function(e){return e.tagName==="TEXTAREA"},oN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!cj(e)&&n[t]==="visible")},hj=function(e){return oN(e,"overflowY")},dj=function(e){return oN(e,"overflowX")},k2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=lN(e,r);if(i){var s=uN(e,r),o=s[1],u=s[2];if(o>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fj=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pj=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},lN=function(e,t){return e==="v"?hj(t):dj(t)},uN=function(e,t){return e==="v"?fj(t):pj(t)},mj=function(e,t){return e==="h"&&t==="rtl"?-1:1},gj=function(e,t,n,r,i){var s=mj(e,window.getComputedStyle(t).direction),o=s*r,u=n.target,c=t.contains(u),d=!1,p=o>0,m=0,g=0;do{if(!u)break;var _=uN(e,u),v=_[0],x=_[1],C=_[2],w=x-C-s*v;(v||w)&&lN(e,u)&&(m+=w,g+=v);var A=u.parentNode;u=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(g)<1)&&(d=!0),d},ef=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A2=function(e){return[e.deltaX,e.deltaY]},R2=function(e){return e&&"current"in e?e.current:e},_j=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bj=function(e){return`
|
|
1330
1330
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
1331
1331
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
1332
|
-
`)},vj=0,nl=[];function yj(e){var t=T.useRef([]),n=T.useRef([0,0]),r=T.useRef(),i=T.useState(vj++)[0],s=T.useState(aN)[0],o=T.useRef(e);T.useEffect(function(){o.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=zF([e.lockRef.current],(e.shards||[]).map(R2),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=T.useCallback(function(x,C){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var w=ef(x),A=n.current,R="deltaX"in x?x.deltaX:A[0]-w[0],N="deltaY"in x?x.deltaY:A[1]-w[1],L,I=x.target,P=Math.abs(R)>Math.abs(N)?"h":"v";if("touches"in x&&P==="h"&&I.type==="range")return!1;var q=window.getSelection(),ee=q&&q.anchorNode,F=ee?ee===I||ee.contains(I):!1;if(F)return!1;var J=k2(P,I);if(!J)return!0;if(J?L=P:(L=P==="v"?"h":"v",J=k2(P,I)),!J)return!1;if(!r.current&&"changedTouches"in x&&(R||N)&&(r.current=L),!L)return!0;var B=r.current||L;return gj(B,C,x,B==="h"?R:N)},[]),c=T.useCallback(function(x){var C=x;if(!(!nl.length||nl[nl.length-1]!==s)){var w="deltaY"in C?A2(C):ef(C),A=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&_j(L.delta,w)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var R=(o.current.shards||[]).map(R2).filter(Boolean).filter(function(L){return L.contains(C.target)}),N=R.length>0?u(C,R[0]):!o.current.noIsolation;N&&C.cancelable&&C.preventDefault()}}},[]),d=T.useCallback(function(x,C,w,A){var R={name:x,delta:C,target:w,should:A,shadowParent:Sj(w)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(N){return N!==R})},1)},[]),p=T.useCallback(function(x){n.current=ef(x),r.current=void 0},[]),m=T.useCallback(function(x){d(x.type,A2(x),x.target,u(x,e.lockRef.current))},[]),g=T.useCallback(function(x){d(x.type,ef(x),x.target,u(x,e.lockRef.current))},[]);T.useEffect(function(){return nl.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",c,tl),document.addEventListener("touchmove",c,tl),document.addEventListener("touchstart",p,tl),function(){nl=nl.filter(function(x){return x!==s}),document.removeEventListener("wheel",c,tl),document.removeEventListener("touchmove",c,tl),document.removeEventListener("touchstart",p,tl)}},[]);var _=e.removeScrollBar,v=e.inert;return T.createElement(T.Fragment,null,v?T.createElement(s,{styles:bj(i)}):null,_?T.createElement(uj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ej=QF(sN,yj);var cN=T.forwardRef(function(e,t){return T.createElement(zp,gi({},e,{ref:t,sideCar:Ej}))});cN.classNames=zp.classNames;var Up="Popover",[hN]=Av(Up,[jp]),ch=jp(),[xj,aa]=hN(Up),dN=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,u=ch(t),c=T.useRef(null),[d,p]=T.useState(!1),[m,g]=tN({prop:r,defaultProp:i??!1,onChange:s,caller:Up});return S.jsx(ZR,{...u,children:S.jsx(xj,{scope:t,contentId:NR(),triggerRef:c,open:m,onOpenChange:g,onOpenToggle:T.useCallback(()=>g(_=>!_),[g]),hasCustomAnchor:d,onCustomAnchorAdd:T.useCallback(()=>p(!0),[]),onCustomAnchorRemove:T.useCallback(()=>p(!1),[]),modal:o,children:n})})};dN.displayName=Up;var fN="PopoverAnchor",wj=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=aa(fN,n),s=ch(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:u}=i;return T.useEffect(()=>(o(),()=>u()),[o,u]),S.jsx(Hv,{...s,...r,ref:t})});wj.displayName=fN;var pN="PopoverTrigger",mN=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=aa(pN,n),s=ch(n),o=Ci(t,i.triggerRef),u=S.jsx(ni.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":yN(i.open),...r,ref:o,onClick:ir(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(Hv,{asChild:!0,...s,children:u})});mN.displayName=pN;var jv="PopoverPortal",[Cj,Tj]=hN(jv,{forceMount:void 0}),gN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=aa(jv,t);return S.jsx(Cj,{scope:t,forceMount:n,children:S.jsx(uh,{present:n||s.open,children:S.jsx(Fv,{asChild:!0,container:i,children:r})})})};gN.displayName=jv;var kl="PopoverContent",_N=T.forwardRef((e,t)=>{const n=Tj(kl,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=aa(kl,e.__scopePopover);return S.jsx(uh,{present:r||s.open,children:s.modal?S.jsx(Aj,{...i,ref:t}):S.jsx(Rj,{...i,ref:t})})});_N.displayName=kl;var kj=wR("PopoverContent.RemoveScroll"),Aj=T.forwardRef((e,t)=>{const n=aa(kl,e.__scopePopover),r=T.useRef(null),i=Ci(t,r),s=T.useRef(!1);return T.useEffect(()=>{const o=r.current;if(o)return jF(o)},[]),S.jsx(cN,{as:kj,allowPinchZoom:!0,children:S.jsx(bN,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ir(e.onCloseAutoFocus,o=>{o.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ir(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,d=u.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ir(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Rj=T.forwardRef((e,t)=>{const n=aa(kl,e.__scopePopover),r=T.useRef(!1),i=T.useRef(!1);return S.jsx(bN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;n.triggerRef.current?.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),bN=T.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,...m}=e,g=aa(kl,n),_=ch(n);return tH(),S.jsx(AR,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:S.jsx(Rv,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:S.jsx(JR,{"data-state":yN(g.open),role:"dialog",id:g.contentId,..._,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),vN="PopoverClose",Nj=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=aa(vN,n);return S.jsx(ni.button,{type:"button",...r,ref:t,onClick:ir(e.onClick,()=>i.onOpenChange(!1))})});Nj.displayName=vN;var Lj="PopoverArrow",Oj=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ch(n);return S.jsx(eN,{...i,...r,ref:t})});Oj.displayName=Lj;function yN(e){return e?"open":"closed"}var Dj=dN,Mj=mN,Ij=gN,Pj=_N;function $p({...e}){return S.jsx(Dj,{"data-slot":"popover",...e})}function Vp({...e}){return S.jsx(Mj,{"data-slot":"popover-trigger","data-testid":"popover-trigger",...e})}function qp({className:e,align:t="center",sideOffset:n=4,...r}){return S.jsx(Ij,{children:S.jsx(Pj,{"data-slot":"popover-content","data-testid":"popover-content",align:t,sideOffset:n,className:oh("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md p-4 shadow-md outline-hidden border border-base-300",e),...r})})}const Bj=T.memo(({projectPath:e,hasGit:t,onClose:n})=>{const r=Il(),[i,s]=T.useState(""),o=Jc({queryKey:["branches",e,i],queryFn:async({pageParam:L})=>{const I=new URLSearchParams({project:e});return L&&I.set("cursor",L),i.trim()&&I.set("filter",i.trim()),Tt(`/api/projects/branches?${I.toString()}`)},initialPageParam:null,getNextPageParam:L=>{if(!(!L||!L.hasMore))return L.nextCursor??void 0},enabled:!!(e&&t)}),u=o.data?.pages[0]?.current||"",c=o.data?.pages[0]?.defaultBranch||"main",d=T.useMemo(()=>o.data?o.data.pages.flatMap(L=>L.branches):[],[o.data]),p=d.find(L=>L.name===c),m=d.filter(L=>L.name!==c),g=o.hasNextPage,_=o.isLoading,v=o.isFetchingNextPage,x=za({mutationFn:L=>Tt(`/api/projects/branches/checkout?project=${encodeURIComponent(L.projectPath)}`,{method:"POST",body:JSON.stringify({name:L.name})}),onSuccess:(L,I)=>{r.invalidateQueries({queryKey:["branches",I.projectPath]}),r.invalidateQueries({queryKey:["branches-info",I.projectPath]}),e&&r.invalidateQueries({queryKey:["git-diff",e]})}}),C=za({mutationFn:L=>Tt(`/api/projects/branches?project=${encodeURIComponent(L.projectPath)}`,{method:"POST",body:JSON.stringify({name:L.name})}),onSuccess:(L,I)=>{r.invalidateQueries({queryKey:["branches",I.projectPath]}),r.invalidateQueries({queryKey:["branches-info",I.projectPath]}),e&&r.invalidateQueries({queryKey:["git-diff",e]})}}),w=T.useCallback(L=>{!e||L===u||(x.mutate({projectPath:e,name:L}),n())},[e,u,x,n]),A=T.useCallback(()=>{if(!e)return;const L=window.prompt("New branch name");if(!L)return;const I=L.trim();I&&(C.mutate({projectPath:e,name:I}),n())},[e,C,n]),R=T.useCallback(()=>{g&&!v&&o.fetchNextPage()},[g,v,o]),N=L=>S.jsx("li",{children:S.jsxs("button",{type:"button",className:"flex items-center justify-between",onClick:()=>w(L.name),"data-testid":"branch-dropdown-branch","data-branch":L.name,children:[S.jsx("span",{className:"truncate",children:L.name}),S.jsxs("span",{className:"flex items-center gap-2 text-xs text-base-content/60",children:[L.name===u?S.jsx("span",{className:"badge badge-outline badge-sm",children:"Current"}):null,sh(L.updatedAt)]})]})},L.name);return S.jsxs("div",{className:"mt-3",children:[S.jsxs("div",{className:"flex items-center gap-2","data-testid":"branch-dropdown-filter-row",children:[S.jsx("input",{className:"input input-bordered input-sm w-full",placeholder:"Filter branches",value:i,onChange:L=>s(L.target.value),"data-testid":"branch-dropdown-filter"}),S.jsx("button",{type:"button",className:"btn btn-outline btn-sm whitespace-nowrap",disabled:!e||C.isPending,onClick:A,"data-testid":"branch-dropdown-new-branch",children:"New Branch"})]}),S.jsxs("div",{className:"mt-3 space-y-4 max-h-[50vh] overflow-auto","data-testid":"branch-dropdown-branches",children:[p?S.jsxs("div",{children:[S.jsx("div",{className:"text-xs font-semibold uppercase text-base-content/60",children:"Default Branch"}),S.jsx("ul",{className:"menu mt-2 w-full rounded-box bg-base-200/40 p-1","data-testid":"branch-dropdown-default-branch",children:N(p)})]}):null,S.jsxs("div",{children:[S.jsx("div",{className:"text-xs font-semibold uppercase text-base-content/60",children:"Other Branches"}),S.jsx("ul",{className:"menu w-full mt-2 rounded-box bg-base-200/40 p-1","data-testid":"branch-dropdown-other-branches",children:_?S.jsx("li",{className:"disabled",children:S.jsx("span",{children:"Loading branches..."})}):m.length?m.map(N):S.jsx("li",{className:"disabled",children:S.jsx("span",{children:"No branches"})})})]}),g&&S.jsx("button",{type:"button",className:"btn btn-ghost btn-sm w-full",onClick:R,disabled:v,"data-testid":"branch-dropdown-load-more",children:v?"Loading...":"Load More"})]})]})}),Wp=(function(e){if(e==null)return zj;if(typeof e=="function")return Gp(e);if(typeof e=="object")return Array.isArray(e)?Hj(e):Fj(e);if(typeof e=="string")return jj(e);throw new Error("Expected function, string, or object as test")});function Hj(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Wp(e[n]);return Gp(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Fj(e){const t=e;return Gp(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function jj(e){return Gp(t);function t(n){return n&&n.type===e}}function Gp(e){return t;function t(n,r,i){return!!(Uj(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function zj(){return!0}function Uj(e){return e!==null&&typeof e=="object"&&"type"in e}const SN=[],cc=!0,Kb=!1,Qb="skip";function EN(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Wp(i),o=r?-1:1;u(e,void 0,[])();function u(c,d,p){const m=c&&typeof c=="object"?c:{};if(typeof m.type=="string"){const _=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(_?"<"+_+">":""))+")"})}return g;function g(){let _=SN,v,x,C;if((!t||s(c,d,p[p.length-1]||void 0))&&(_=$j(n(c,p)),_[0]===Kb))return _;if("children"in c&&c.children){const w=c;if(w.children&&_[0]!==Qb)for(x=(r?w.children.length:-1)+o,C=p.concat(w);x>-1&&x<w.children.length;){const A=w.children[x];if(v=u(A,x,C)(),v[0]===Kb)return v;x=typeof v[1]=="number"?v[1]:x+o}}return _}}}function $j(e){return Array.isArray(e)?e:typeof e=="number"?[cc,e]:e==null?SN:[e]}function Al(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),EN(e,s,u,i);function u(c,d){const p=d[d.length-1],m=p?p.children.indexOf(c):void 0;return o(c,m,p)}}function Vj({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:s="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:o="text-gray-500"}){const u=t.length&&!t.every(d=>d==="*"),c=n.length&&!n.every(d=>d==="*");if(!e&&(u||c))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return d=>{const p=Yj(e,t,n,r,i,s,o);Al(d,p)}}function N2(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function qj(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const Wj=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),Gj=new Set(["javascript:","data:","file:","vbscript:"]);function L2(e,t,n,r=!1,i=!1,s=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const o=N2(e,n);if(!o||Gj.has(o.protocol)||!(Wj.has(o.protocol)||s.includes(o.protocol)||s.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const c=qj(e);return o&&t.some(d=>{const p=N2(d,n);return!p||p.origin!==o.origin?!1:o.href.startsWith(p.href)})?c?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:c?o.pathname+o.search+o.hash:o.href:null}const b_=Symbol("node-seen"),Yj=(e,t,n,r,i,s,o)=>{const u=(c,d,p)=>{if(c.type!=="element"||c[b_])return cc;if(c.tagName==="a"){const m=L2(c.properties.href,t,e,!1,!1,i);return m===null?(c[b_]=!0,Al(c,u),p&&typeof d=="number"&&(p.children[d]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(c.properties.href),class:o},children:[...c.children,{type:"text",value:" [blocked]"}]}),Qb):(c.properties.href=m,c.properties.target="_blank",c.properties.rel="noopener noreferrer",cc)}if(c.tagName==="img"){const m=L2(c.properties.src,n,e,r,!0,i);return m===null?(c[b_]=!0,Al(c,u),p&&typeof d=="number"&&(p.children[d]={type:"element",tagName:"span",properties:{class:s},children:[{type:"text",value:"[Image blocked: "+String(c.properties.alt||"No description")+"]"}]}),Qb):(c.properties.src=m,cc)}return cc};return u},xN=-1,Yp=0,Ec=1,ap=2,zv=3,Uv=4,$v=5,Vv=6,wN=7,CN=8,O2=typeof self=="object"?self:globalThis,Kj=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Yp:case xN:return n(o,i);case Ec:{const u=n([],i);for(const c of o)u.push(r(c));return u}case ap:{const u=n({},i);for(const[c,d]of o)u[r(c)]=r(d);return u}case zv:return n(new Date(o),i);case Uv:{const{source:u,flags:c}=o;return n(new RegExp(u,c),i)}case $v:{const u=n(new Map,i);for(const[c,d]of o)u.set(r(c),r(d));return u}case Vv:{const u=n(new Set,i);for(const c of o)u.add(r(c));return u}case wN:{const{name:u,message:c}=o;return n(new O2[u](c),i)}case CN:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return n(new DataView(u),o)}}return n(new O2[s](o),i)};return r},D2=e=>Kj(new Map,e)(0),rl="",{toString:Qj}={},{keys:Xj}=Object,Gu=e=>{const t=typeof e;if(t!=="object"||!e)return[Yp,t];const n=Qj.call(e).slice(8,-1);switch(n){case"Array":return[Ec,rl];case"Object":return[ap,rl];case"Date":return[zv,rl];case"RegExp":return[Uv,rl];case"Map":return[$v,rl];case"Set":return[Vv,rl];case"DataView":return[Ec,n]}return n.includes("Array")?[Ec,n]:n.includes("Error")?[wN,n]:[ap,n]},tf=([e,t])=>e===Yp&&(t==="function"||t==="symbol"),Zj=(e,t,n,r)=>{const i=(o,u)=>{const c=r.push(o)-1;return n.set(u,c),c},s=o=>{if(n.has(o))return n.get(o);let[u,c]=Gu(o);switch(u){case Yp:{let p=o;switch(c){case"bigint":u=CN,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return i([xN],o)}return i([u,p],o)}case Ec:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),i([c,[...g]],o)}const p=[],m=i([u,p],o);for(const g of o)p.push(s(g));return m}case ap:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const p=[],m=i([u,p],o);for(const g of Xj(o))(e||!tf(Gu(o[g])))&&p.push([s(g),s(o[g])]);return m}case zv:return i([u,o.toISOString()],o);case Uv:{const{source:p,flags:m}=o;return i([u,{source:p,flags:m}],o)}case $v:{const p=[],m=i([u,p],o);for(const[g,_]of o)(e||!(tf(Gu(g))||tf(Gu(_))))&&p.push([s(g),s(_)]);return m}case Vv:{const p=[],m=i([u,p],o);for(const g of o)(e||!tf(Gu(g)))&&p.push(s(g));return m}}const{message:d}=o;return i([u,{name:c,message:d}],o)};return s},M2=(e,{json:t,lossy:n}={})=>{const r=[];return Zj(!(t||n),!!t,new Map,r)(e),r},Xa=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?D2(M2(e,t)):structuredClone(e):(e,t)=>D2(M2(e,t));const I2=/[#.]/g;function Jj(e,t){const n=e||"",r={};let i=0,s,o;for(;i<n.length;){I2.lastIndex=i;const u=I2.exec(n),c=n.slice(i,u?u.index:n.length);c&&(s?s==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:o=c,i+=c.length),u&&(s=u[0],i++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function TN(e,t,n){const r=n?rz(n):void 0;function i(s,o,...u){let c;if(s==null){c={type:"root",children:[]};const d=o;u.unshift(d)}else{c=Jj(s,t);const d=c.tagName.toLowerCase(),p=r?r.get(d):void 0;if(c.tagName=p||d,ez(o))u.unshift(o);else for(const[m,g]of Object.entries(o))tz(e,c.properties,m,g)}for(const d of u)Xb(c.children,d);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return i}function ez(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const o of s)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function tz(e,t,n,r){const i=rh(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=gC(r):i.commaSeparated?s=mC(r):i.commaOrSpaceSeparated?s=gC(mC(r).join(" ")):s=P2(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?nz(r):String(r);if(Array.isArray(s)){const o=[];for(const u of s)o.push(P2(i,i.property,u));s=o}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function Xb(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Xb(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Xb(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function P2(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Hc(n)===Hc(t)))return!0}return n}function nz(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function rz(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const iz=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],sz=TN(Bl,"div"),az=TN(wi,"g",iz);function oz(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=t.length){let o=0;for(;;){let u=n[o];if(u===void 0){const c=B2(t,n[o-1]);u=c===-1?t.length+1:c+1,n[o]=u}if(u>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const u=n[n.length-1],c=B2(t,u),d=c===-1?t.length+1:c+1;if(u===d)break;n.push(d)}const o=(s.line>1?n[s.line-2]:0)+s.column-1;if(o<n[s.line-1])return o}}}function B2(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
1332
|
+
`)},vj=0,nl=[];function yj(e){var t=T.useRef([]),n=T.useRef([0,0]),r=T.useRef(),i=T.useState(vj++)[0],s=T.useState(aN)[0],o=T.useRef(e);T.useEffect(function(){o.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=zF([e.lockRef.current],(e.shards||[]).map(R2),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=T.useCallback(function(x,C){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var w=ef(x),A=n.current,R="deltaX"in x?x.deltaX:A[0]-w[0],N="deltaY"in x?x.deltaY:A[1]-w[1],L,I=x.target,P=Math.abs(R)>Math.abs(N)?"h":"v";if("touches"in x&&P==="h"&&I.type==="range")return!1;var q=window.getSelection(),ee=q&&q.anchorNode,F=ee?ee===I||ee.contains(I):!1;if(F)return!1;var J=k2(P,I);if(!J)return!0;if(J?L=P:(L=P==="v"?"h":"v",J=k2(P,I)),!J)return!1;if(!r.current&&"changedTouches"in x&&(R||N)&&(r.current=L),!L)return!0;var B=r.current||L;return gj(B,C,x,B==="h"?R:N)},[]),c=T.useCallback(function(x){var C=x;if(!(!nl.length||nl[nl.length-1]!==s)){var w="deltaY"in C?A2(C):ef(C),A=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&_j(L.delta,w)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var R=(o.current.shards||[]).map(R2).filter(Boolean).filter(function(L){return L.contains(C.target)}),N=R.length>0?u(C,R[0]):!o.current.noIsolation;N&&C.cancelable&&C.preventDefault()}}},[]),d=T.useCallback(function(x,C,w,A){var R={name:x,delta:C,target:w,should:A,shadowParent:Sj(w)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(N){return N!==R})},1)},[]),p=T.useCallback(function(x){n.current=ef(x),r.current=void 0},[]),m=T.useCallback(function(x){d(x.type,A2(x),x.target,u(x,e.lockRef.current))},[]),g=T.useCallback(function(x){d(x.type,ef(x),x.target,u(x,e.lockRef.current))},[]);T.useEffect(function(){return nl.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",c,tl),document.addEventListener("touchmove",c,tl),document.addEventListener("touchstart",p,tl),function(){nl=nl.filter(function(x){return x!==s}),document.removeEventListener("wheel",c,tl),document.removeEventListener("touchmove",c,tl),document.removeEventListener("touchstart",p,tl)}},[]);var _=e.removeScrollBar,v=e.inert;return T.createElement(T.Fragment,null,v?T.createElement(s,{styles:bj(i)}):null,_?T.createElement(uj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ej=QF(sN,yj);var cN=T.forwardRef(function(e,t){return T.createElement(zp,gi({},e,{ref:t,sideCar:Ej}))});cN.classNames=zp.classNames;var Up="Popover",[hN]=Av(Up,[jp]),ch=jp(),[xj,aa]=hN(Up),dN=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,u=ch(t),c=T.useRef(null),[d,p]=T.useState(!1),[m,g]=tN({prop:r,defaultProp:i??!1,onChange:s,caller:Up});return S.jsx(Z3,{...u,children:S.jsx(xj,{scope:t,contentId:N3(),triggerRef:c,open:m,onOpenChange:g,onOpenToggle:T.useCallback(()=>g(_=>!_),[g]),hasCustomAnchor:d,onCustomAnchorAdd:T.useCallback(()=>p(!0),[]),onCustomAnchorRemove:T.useCallback(()=>p(!1),[]),modal:o,children:n})})};dN.displayName=Up;var fN="PopoverAnchor",wj=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=aa(fN,n),s=ch(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:u}=i;return T.useEffect(()=>(o(),()=>u()),[o,u]),S.jsx(Hv,{...s,...r,ref:t})});wj.displayName=fN;var pN="PopoverTrigger",mN=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=aa(pN,n),s=ch(n),o=Ci(t,i.triggerRef),u=S.jsx(ni.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":yN(i.open),...r,ref:o,onClick:ir(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(Hv,{asChild:!0,...s,children:u})});mN.displayName=pN;var jv="PopoverPortal",[Cj,Tj]=hN(jv,{forceMount:void 0}),gN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=aa(jv,t);return S.jsx(Cj,{scope:t,forceMount:n,children:S.jsx(uh,{present:n||s.open,children:S.jsx(Fv,{asChild:!0,container:i,children:r})})})};gN.displayName=jv;var kl="PopoverContent",_N=T.forwardRef((e,t)=>{const n=Tj(kl,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=aa(kl,e.__scopePopover);return S.jsx(uh,{present:r||s.open,children:s.modal?S.jsx(Aj,{...i,ref:t}):S.jsx(Rj,{...i,ref:t})})});_N.displayName=kl;var kj=w3("PopoverContent.RemoveScroll"),Aj=T.forwardRef((e,t)=>{const n=aa(kl,e.__scopePopover),r=T.useRef(null),i=Ci(t,r),s=T.useRef(!1);return T.useEffect(()=>{const o=r.current;if(o)return jF(o)},[]),S.jsx(cN,{as:kj,allowPinchZoom:!0,children:S.jsx(bN,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ir(e.onCloseAutoFocus,o=>{o.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ir(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,d=u.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ir(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Rj=T.forwardRef((e,t)=>{const n=aa(kl,e.__scopePopover),r=T.useRef(!1),i=T.useRef(!1);return S.jsx(bN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;n.triggerRef.current?.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),bN=T.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,...m}=e,g=aa(kl,n),_=ch(n);return tH(),S.jsx(A3,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:S.jsx(Rv,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:S.jsx(J3,{"data-state":yN(g.open),role:"dialog",id:g.contentId,..._,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),vN="PopoverClose",Nj=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=aa(vN,n);return S.jsx(ni.button,{type:"button",...r,ref:t,onClick:ir(e.onClick,()=>i.onOpenChange(!1))})});Nj.displayName=vN;var Lj="PopoverArrow",Oj=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ch(n);return S.jsx(eN,{...i,...r,ref:t})});Oj.displayName=Lj;function yN(e){return e?"open":"closed"}var Dj=dN,Mj=mN,Ij=gN,Pj=_N;function $p({...e}){return S.jsx(Dj,{"data-slot":"popover",...e})}function Vp({...e}){return S.jsx(Mj,{"data-slot":"popover-trigger","data-testid":"popover-trigger",...e})}function qp({className:e,align:t="center",sideOffset:n=4,...r}){return S.jsx(Ij,{children:S.jsx(Pj,{"data-slot":"popover-content","data-testid":"popover-content",align:t,sideOffset:n,className:oh("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md p-4 shadow-md outline-hidden border border-base-300",e),...r})})}const Bj=T.memo(({projectPath:e,hasGit:t,onClose:n})=>{const r=Il(),[i,s]=T.useState(""),o=Jc({queryKey:["branches",e,i],queryFn:async({pageParam:L})=>{const I=new URLSearchParams({project:e});return L&&I.set("cursor",L),i.trim()&&I.set("filter",i.trim()),Tt(`/api/projects/branches?${I.toString()}`)},initialPageParam:null,getNextPageParam:L=>{if(!(!L||!L.hasMore))return L.nextCursor??void 0},enabled:!!(e&&t)}),u=o.data?.pages[0]?.current||"",c=o.data?.pages[0]?.defaultBranch||"main",d=T.useMemo(()=>o.data?o.data.pages.flatMap(L=>L.branches):[],[o.data]),p=d.find(L=>L.name===c),m=d.filter(L=>L.name!==c),g=o.hasNextPage,_=o.isLoading,v=o.isFetchingNextPage,x=za({mutationFn:L=>Tt(`/api/projects/branches/checkout?project=${encodeURIComponent(L.projectPath)}`,{method:"POST",body:JSON.stringify({name:L.name})}),onSuccess:(L,I)=>{r.invalidateQueries({queryKey:["branches",I.projectPath]}),r.invalidateQueries({queryKey:["branches-info",I.projectPath]}),e&&r.invalidateQueries({queryKey:["git-diff",e]})}}),C=za({mutationFn:L=>Tt(`/api/projects/branches?project=${encodeURIComponent(L.projectPath)}`,{method:"POST",body:JSON.stringify({name:L.name})}),onSuccess:(L,I)=>{r.invalidateQueries({queryKey:["branches",I.projectPath]}),r.invalidateQueries({queryKey:["branches-info",I.projectPath]}),e&&r.invalidateQueries({queryKey:["git-diff",e]})}}),w=T.useCallback(L=>{!e||L===u||(x.mutate({projectPath:e,name:L}),n())},[e,u,x,n]),A=T.useCallback(()=>{if(!e)return;const L=window.prompt("New branch name");if(!L)return;const I=L.trim();I&&(C.mutate({projectPath:e,name:I}),n())},[e,C,n]),R=T.useCallback(()=>{g&&!v&&o.fetchNextPage()},[g,v,o]),N=L=>S.jsx("li",{children:S.jsxs("button",{type:"button",className:"flex items-center justify-between",onClick:()=>w(L.name),"data-testid":"branch-dropdown-branch","data-branch":L.name,children:[S.jsx("span",{className:"truncate",children:L.name}),S.jsxs("span",{className:"flex items-center gap-2 text-xs text-base-content/60",children:[L.name===u?S.jsx("span",{className:"badge badge-outline badge-sm",children:"Current"}):null,sh(L.updatedAt)]})]})},L.name);return S.jsxs("div",{className:"mt-3",children:[S.jsxs("div",{className:"flex items-center gap-2","data-testid":"branch-dropdown-filter-row",children:[S.jsx("input",{className:"input input-bordered input-sm w-full",placeholder:"Filter branches",value:i,onChange:L=>s(L.target.value),"data-testid":"branch-dropdown-filter"}),S.jsx("button",{type:"button",className:"btn btn-outline btn-sm whitespace-nowrap",disabled:!e||C.isPending,onClick:A,"data-testid":"branch-dropdown-new-branch",children:"New Branch"})]}),S.jsxs("div",{className:"mt-3 space-y-4 max-h-[50vh] overflow-auto","data-testid":"branch-dropdown-branches",children:[p?S.jsxs("div",{children:[S.jsx("div",{className:"text-xs font-semibold uppercase text-base-content/60",children:"Default Branch"}),S.jsx("ul",{className:"menu mt-2 w-full rounded-box bg-base-200/40 p-1","data-testid":"branch-dropdown-default-branch",children:N(p)})]}):null,S.jsxs("div",{children:[S.jsx("div",{className:"text-xs font-semibold uppercase text-base-content/60",children:"Other Branches"}),S.jsx("ul",{className:"menu w-full mt-2 rounded-box bg-base-200/40 p-1","data-testid":"branch-dropdown-other-branches",children:_?S.jsx("li",{className:"disabled",children:S.jsx("span",{children:"Loading branches..."})}):m.length?m.map(N):S.jsx("li",{className:"disabled",children:S.jsx("span",{children:"No branches"})})})]}),g&&S.jsx("button",{type:"button",className:"btn btn-ghost btn-sm w-full",onClick:R,disabled:v,"data-testid":"branch-dropdown-load-more",children:v?"Loading...":"Load More"})]})]})}),Wp=(function(e){if(e==null)return zj;if(typeof e=="function")return Gp(e);if(typeof e=="object")return Array.isArray(e)?Hj(e):Fj(e);if(typeof e=="string")return jj(e);throw new Error("Expected function, string, or object as test")});function Hj(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Wp(e[n]);return Gp(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Fj(e){const t=e;return Gp(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function jj(e){return Gp(t);function t(n){return n&&n.type===e}}function Gp(e){return t;function t(n,r,i){return!!(Uj(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function zj(){return!0}function Uj(e){return e!==null&&typeof e=="object"&&"type"in e}const SN=[],cc=!0,Kb=!1,Qb="skip";function EN(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Wp(i),o=r?-1:1;u(e,void 0,[])();function u(c,d,p){const m=c&&typeof c=="object"?c:{};if(typeof m.type=="string"){const _=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(_?"<"+_+">":""))+")"})}return g;function g(){let _=SN,v,x,C;if((!t||s(c,d,p[p.length-1]||void 0))&&(_=$j(n(c,p)),_[0]===Kb))return _;if("children"in c&&c.children){const w=c;if(w.children&&_[0]!==Qb)for(x=(r?w.children.length:-1)+o,C=p.concat(w);x>-1&&x<w.children.length;){const A=w.children[x];if(v=u(A,x,C)(),v[0]===Kb)return v;x=typeof v[1]=="number"?v[1]:x+o}}return _}}}function $j(e){return Array.isArray(e)?e:typeof e=="number"?[cc,e]:e==null?SN:[e]}function Al(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),EN(e,s,u,i);function u(c,d){const p=d[d.length-1],m=p?p.children.indexOf(c):void 0;return o(c,m,p)}}function Vj({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:s="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:o="text-gray-500"}){const u=t.length&&!t.every(d=>d==="*"),c=n.length&&!n.every(d=>d==="*");if(!e&&(u||c))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return d=>{const p=Yj(e,t,n,r,i,s,o);Al(d,p)}}function N2(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function qj(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const Wj=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),Gj=new Set(["javascript:","data:","file:","vbscript:"]);function L2(e,t,n,r=!1,i=!1,s=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const o=N2(e,n);if(!o||Gj.has(o.protocol)||!(Wj.has(o.protocol)||s.includes(o.protocol)||s.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const c=qj(e);return o&&t.some(d=>{const p=N2(d,n);return!p||p.origin!==o.origin?!1:o.href.startsWith(p.href)})?c?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:c?o.pathname+o.search+o.hash:o.href:null}const b_=Symbol("node-seen"),Yj=(e,t,n,r,i,s,o)=>{const u=(c,d,p)=>{if(c.type!=="element"||c[b_])return cc;if(c.tagName==="a"){const m=L2(c.properties.href,t,e,!1,!1,i);return m===null?(c[b_]=!0,Al(c,u),p&&typeof d=="number"&&(p.children[d]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(c.properties.href),class:o},children:[...c.children,{type:"text",value:" [blocked]"}]}),Qb):(c.properties.href=m,c.properties.target="_blank",c.properties.rel="noopener noreferrer",cc)}if(c.tagName==="img"){const m=L2(c.properties.src,n,e,r,!0,i);return m===null?(c[b_]=!0,Al(c,u),p&&typeof d=="number"&&(p.children[d]={type:"element",tagName:"span",properties:{class:s},children:[{type:"text",value:"[Image blocked: "+String(c.properties.alt||"No description")+"]"}]}),Qb):(c.properties.src=m,cc)}return cc};return u},xN=-1,Yp=0,Ec=1,ap=2,zv=3,Uv=4,$v=5,Vv=6,wN=7,CN=8,O2=typeof self=="object"?self:globalThis,Kj=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Yp:case xN:return n(o,i);case Ec:{const u=n([],i);for(const c of o)u.push(r(c));return u}case ap:{const u=n({},i);for(const[c,d]of o)u[r(c)]=r(d);return u}case zv:return n(new Date(o),i);case Uv:{const{source:u,flags:c}=o;return n(new RegExp(u,c),i)}case $v:{const u=n(new Map,i);for(const[c,d]of o)u.set(r(c),r(d));return u}case Vv:{const u=n(new Set,i);for(const c of o)u.add(r(c));return u}case wN:{const{name:u,message:c}=o;return n(new O2[u](c),i)}case CN:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return n(new DataView(u),o)}}return n(new O2[s](o),i)};return r},D2=e=>Kj(new Map,e)(0),rl="",{toString:Qj}={},{keys:Xj}=Object,Gu=e=>{const t=typeof e;if(t!=="object"||!e)return[Yp,t];const n=Qj.call(e).slice(8,-1);switch(n){case"Array":return[Ec,rl];case"Object":return[ap,rl];case"Date":return[zv,rl];case"RegExp":return[Uv,rl];case"Map":return[$v,rl];case"Set":return[Vv,rl];case"DataView":return[Ec,n]}return n.includes("Array")?[Ec,n]:n.includes("Error")?[wN,n]:[ap,n]},tf=([e,t])=>e===Yp&&(t==="function"||t==="symbol"),Zj=(e,t,n,r)=>{const i=(o,u)=>{const c=r.push(o)-1;return n.set(u,c),c},s=o=>{if(n.has(o))return n.get(o);let[u,c]=Gu(o);switch(u){case Yp:{let p=o;switch(c){case"bigint":u=CN,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return i([xN],o)}return i([u,p],o)}case Ec:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),i([c,[...g]],o)}const p=[],m=i([u,p],o);for(const g of o)p.push(s(g));return m}case ap:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const p=[],m=i([u,p],o);for(const g of Xj(o))(e||!tf(Gu(o[g])))&&p.push([s(g),s(o[g])]);return m}case zv:return i([u,o.toISOString()],o);case Uv:{const{source:p,flags:m}=o;return i([u,{source:p,flags:m}],o)}case $v:{const p=[],m=i([u,p],o);for(const[g,_]of o)(e||!(tf(Gu(g))||tf(Gu(_))))&&p.push([s(g),s(_)]);return m}case Vv:{const p=[],m=i([u,p],o);for(const g of o)(e||!tf(Gu(g)))&&p.push(s(g));return m}}const{message:d}=o;return i([u,{name:c,message:d}],o)};return s},M2=(e,{json:t,lossy:n}={})=>{const r=[];return Zj(!(t||n),!!t,new Map,r)(e),r},Xa=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?D2(M2(e,t)):structuredClone(e):(e,t)=>D2(M2(e,t));const I2=/[#.]/g;function Jj(e,t){const n=e||"",r={};let i=0,s,o;for(;i<n.length;){I2.lastIndex=i;const u=I2.exec(n),c=n.slice(i,u?u.index:n.length);c&&(s?s==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:o=c,i+=c.length),u&&(s=u[0],i++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function TN(e,t,n){const r=n?rz(n):void 0;function i(s,o,...u){let c;if(s==null){c={type:"root",children:[]};const d=o;u.unshift(d)}else{c=Jj(s,t);const d=c.tagName.toLowerCase(),p=r?r.get(d):void 0;if(c.tagName=p||d,ez(o))u.unshift(o);else for(const[m,g]of Object.entries(o))tz(e,c.properties,m,g)}for(const d of u)Xb(c.children,d);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return i}function ez(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const o of s)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function tz(e,t,n,r){const i=rh(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=gC(r):i.commaSeparated?s=mC(r):i.commaOrSpaceSeparated?s=gC(mC(r).join(" ")):s=P2(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?nz(r):String(r);if(Array.isArray(s)){const o=[];for(const u of s)o.push(P2(i,i.property,u));s=o}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function Xb(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Xb(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Xb(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function P2(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Hc(n)===Hc(t)))return!0}return n}function nz(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function rz(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const iz=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],sz=TN(Bl,"div"),az=TN(wi,"g",iz);function oz(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=t.length){let o=0;for(;;){let u=n[o];if(u===void 0){const c=B2(t,n[o-1]);u=c===-1?t.length+1:c+1,n[o]=u}if(u>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const u=n[n.length-1],c=B2(t,u),d=c===-1?t.length+1:c+1;if(u===d)break;n.push(d)}const o=(s.line>1?n[s.line-2]:0)+s.column-1;if(o<n[s.line-1])return o}}}function B2(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
1333
1333
|
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Ha={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kN={}.hasOwnProperty,lz=Object.prototype;function uz(e,t){const n=t||{};return qv({file:n.file||void 0,location:!1,schema:n.space==="svg"?wi:Bl,verbose:n.verbose||!1},e)}function qv(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},kf(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:AN(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const s=String(e.file),o=oz(s),u=o.toPoint(0),c=o.toPoint(s.length);n.position={start:u,end:c}}return n}case"#documentType":{const r=t;return n={type:"doctype"},kf(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},kf(e,r,n),n}default:return n=cz(e,t),n}}function AN(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=qv(e,t[n]);r.push(i)}return r}function cz(e,t){const n=e.schema;e.schema=t.namespaceURI===Ha.svg?wi:Bl;let r=-1;const i={};for(;++r<t.attrs.length;){const u=t.attrs[r],c=(u.prefix?u.prefix+":":"")+u.name;kN.call(lz,c)||(i[c]=u.value)}const o=(e.schema.space==="svg"?az:sz)(t.tagName,i,AN(e,t.childNodes));if(kf(e,t,o),o.tagName==="template"){const u=t,c=u.sourceCodeLocation,d=c&&c.startTag&&pl(c.startTag),p=c&&c.endTag&&pl(c.endTag),m=qv(e,u.content);d&&p&&e.file&&(m.position={start:d.end,end:p.start}),o.content=m}return e.schema=n,o}function kf(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=hz(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function hz(e,t,n){const r=pl(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const s={};let o;if(n.attrs)for(o in n.attrs)kN.call(n.attrs,o)&&(s[rh(e.schema,o).property]=pl(n.attrs[o]));n.startTag;const u=pl(n.startTag),c=n.endTag?pl(n.endTag):void 0,d={opening:u};c&&(d.closing=c),d.properties=s,t.data={position:d}}}return r}function pl(e){const t=H2({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=H2({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function H2(e){return e.line&&e.column?e:void 0}const dz={},fz={}.hasOwnProperty,RN=hv("type",{handlers:{root:mz,element:yz,text:bz,comment:vz,doctype:_z}});function pz(e,t){const r=(t||dz).space;return RN(e,r==="svg"?wi:Bl)}function mz(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Wv(e.children,n,t),$l(e,n),n}function gz(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Wv(e.children,n,t),$l(e,n),n}function _z(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return $l(e,t),t}function bz(e){const t={nodeName:"#text",value:e.value,parentNode:null};return $l(e,t),t}function vz(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return $l(e,t),t}function yz(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=wi);const i=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&fz.call(e.properties,s)){const c=Sz(r,s,e.properties[s]);c&&i.push(c)}}const o=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Ha[o],childNodes:[],parentNode:null};return u.childNodes=Wv(e.children,u,r),$l(e,u),e.tagName==="template"&&e.content&&(u.content=gz(e.content,r)),u}function Sz(e,t,n){const r=rh(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?dv(n):fv(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=Ha[r.space]}return i}function Wv(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const s=RN(e[r],n);s.parentNode=t,i.push(s)}return i}function $l(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const Ez=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ct="�";var H;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(H||(H={}));const tr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function NN(e){return e>=55296&&e<=57343}function xz(e){return e>=56320&&e<=57343}function wz(e,t){return(e-55296)*1024+9216+t}function LN(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function ON(e){return e>=64976&&e<=65007||Ez.has(e)}var le;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(le||(le={}));const Cz=65536;class Tz{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Cz,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:s}=this,o=i+n,u=s+n;return{code:t,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:u,endOffset:u}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(xz(n))return this.pos++,this._addGap(),wz(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,H.EOF;return this._err(le.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,H.EOF;const r=this.html.charCodeAt(n);return r===H.CARRIAGE_RETURN?H.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,H.EOF;let t=this.html.charCodeAt(this.pos);return t===H.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,H.LINE_FEED):t===H.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,NN(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===H.LINE_FEED||t===H.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){LN(t)?this._err(le.controlCharacterInInputStream):ON(t)&&this._err(le.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var qe;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(qe||(qe={}));function DN(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const kz=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Az=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Rz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Az.get(e))!==null&&t!==void 0?t:e}var bn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(bn||(bn={}));const Nz=32;var Ks;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ks||(Ks={}));function Zb(e){return e>=bn.ZERO&&e<=bn.NINE}function Lz(e){return e>=bn.UPPER_A&&e<=bn.UPPER_F||e>=bn.LOWER_A&&e<=bn.LOWER_F}function Oz(e){return e>=bn.UPPER_A&&e<=bn.UPPER_Z||e>=bn.LOWER_A&&e<=bn.LOWER_Z||Zb(e)}function Dz(e){return e===bn.EQUALS||Oz(e)}var hn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(hn||(hn={}));var es;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(es||(es={}));class Mz{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=hn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=es.Strict}startEntity(t){this.decodeMode=t,this.state=hn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case hn.EntityStart:return t.charCodeAt(n)===bn.NUM?(this.state=hn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=hn.NamedEntity,this.stateNamedEntity(t,n));case hn.NumericStart:return this.stateNumericStart(t,n);case hn.NumericDecimal:return this.stateNumericDecimal(t,n);case hn.NumericHex:return this.stateNumericHex(t,n);case hn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Nz)===bn.LOWER_X?(this.state=hn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=hn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Zb(i)||Lz(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Zb(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===bn.SEMI)this.consumed+=1;else if(this.decodeMode===es.Strict)return 0;return this.emitCodePoint(Rz(this.result),this.consumed),this.errors&&(t!==bn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Ks.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=Iz(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===es.Attribute&&(s===0||Dz(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Ks.VALUE_LENGTH)>>14,s!==0){if(o===bn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==es.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Ks.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Ks.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case hn.NamedEntity:return this.result!==0&&(this.decodeMode!==es.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case hn.NumericDecimal:return this.emitNumericEntity(0,2);case hn.NumericHex:return this.emitNumericEntity(0,3);case hn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case hn.EntityStart:return 0}}}function Iz(e,t,n,r){const i=(t&Ks.BRANCH_LENGTH)>>7,s=t&Ks.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const c=r-s;return c<0||c>=i?-1:e[n+c]-1}let o=n,u=o+i-1;for(;o<=u;){const c=o+u>>>1,d=e[c];if(d<r)o=c+1;else if(d>r)u=c-1;else return e[c+i]}return-1}var ge;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(ge||(ge={}));var Ua;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ua||(Ua={}));var jr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(jr||(jr={}));var ne;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(ne||(ne={}));var E;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(E||(E={}));const Pz=new Map([[ne.A,E.A],[ne.ADDRESS,E.ADDRESS],[ne.ANNOTATION_XML,E.ANNOTATION_XML],[ne.APPLET,E.APPLET],[ne.AREA,E.AREA],[ne.ARTICLE,E.ARTICLE],[ne.ASIDE,E.ASIDE],[ne.B,E.B],[ne.BASE,E.BASE],[ne.BASEFONT,E.BASEFONT],[ne.BGSOUND,E.BGSOUND],[ne.BIG,E.BIG],[ne.BLOCKQUOTE,E.BLOCKQUOTE],[ne.BODY,E.BODY],[ne.BR,E.BR],[ne.BUTTON,E.BUTTON],[ne.CAPTION,E.CAPTION],[ne.CENTER,E.CENTER],[ne.CODE,E.CODE],[ne.COL,E.COL],[ne.COLGROUP,E.COLGROUP],[ne.DD,E.DD],[ne.DESC,E.DESC],[ne.DETAILS,E.DETAILS],[ne.DIALOG,E.DIALOG],[ne.DIR,E.DIR],[ne.DIV,E.DIV],[ne.DL,E.DL],[ne.DT,E.DT],[ne.EM,E.EM],[ne.EMBED,E.EMBED],[ne.FIELDSET,E.FIELDSET],[ne.FIGCAPTION,E.FIGCAPTION],[ne.FIGURE,E.FIGURE],[ne.FONT,E.FONT],[ne.FOOTER,E.FOOTER],[ne.FOREIGN_OBJECT,E.FOREIGN_OBJECT],[ne.FORM,E.FORM],[ne.FRAME,E.FRAME],[ne.FRAMESET,E.FRAMESET],[ne.H1,E.H1],[ne.H2,E.H2],[ne.H3,E.H3],[ne.H4,E.H4],[ne.H5,E.H5],[ne.H6,E.H6],[ne.HEAD,E.HEAD],[ne.HEADER,E.HEADER],[ne.HGROUP,E.HGROUP],[ne.HR,E.HR],[ne.HTML,E.HTML],[ne.I,E.I],[ne.IMG,E.IMG],[ne.IMAGE,E.IMAGE],[ne.INPUT,E.INPUT],[ne.IFRAME,E.IFRAME],[ne.KEYGEN,E.KEYGEN],[ne.LABEL,E.LABEL],[ne.LI,E.LI],[ne.LINK,E.LINK],[ne.LISTING,E.LISTING],[ne.MAIN,E.MAIN],[ne.MALIGNMARK,E.MALIGNMARK],[ne.MARQUEE,E.MARQUEE],[ne.MATH,E.MATH],[ne.MENU,E.MENU],[ne.META,E.META],[ne.MGLYPH,E.MGLYPH],[ne.MI,E.MI],[ne.MO,E.MO],[ne.MN,E.MN],[ne.MS,E.MS],[ne.MTEXT,E.MTEXT],[ne.NAV,E.NAV],[ne.NOBR,E.NOBR],[ne.NOFRAMES,E.NOFRAMES],[ne.NOEMBED,E.NOEMBED],[ne.NOSCRIPT,E.NOSCRIPT],[ne.OBJECT,E.OBJECT],[ne.OL,E.OL],[ne.OPTGROUP,E.OPTGROUP],[ne.OPTION,E.OPTION],[ne.P,E.P],[ne.PARAM,E.PARAM],[ne.PLAINTEXT,E.PLAINTEXT],[ne.PRE,E.PRE],[ne.RB,E.RB],[ne.RP,E.RP],[ne.RT,E.RT],[ne.RTC,E.RTC],[ne.RUBY,E.RUBY],[ne.S,E.S],[ne.SCRIPT,E.SCRIPT],[ne.SEARCH,E.SEARCH],[ne.SECTION,E.SECTION],[ne.SELECT,E.SELECT],[ne.SOURCE,E.SOURCE],[ne.SMALL,E.SMALL],[ne.SPAN,E.SPAN],[ne.STRIKE,E.STRIKE],[ne.STRONG,E.STRONG],[ne.STYLE,E.STYLE],[ne.SUB,E.SUB],[ne.SUMMARY,E.SUMMARY],[ne.SUP,E.SUP],[ne.TABLE,E.TABLE],[ne.TBODY,E.TBODY],[ne.TEMPLATE,E.TEMPLATE],[ne.TEXTAREA,E.TEXTAREA],[ne.TFOOT,E.TFOOT],[ne.TD,E.TD],[ne.TH,E.TH],[ne.THEAD,E.THEAD],[ne.TITLE,E.TITLE],[ne.TR,E.TR],[ne.TRACK,E.TRACK],[ne.TT,E.TT],[ne.U,E.U],[ne.UL,E.UL],[ne.SVG,E.SVG],[ne.VAR,E.VAR],[ne.WBR,E.WBR],[ne.XMP,E.XMP]]);function Vl(e){var t;return(t=Pz.get(e))!==null&&t!==void 0?t:E.UNKNOWN}const _e=E,Bz={[ge.HTML]:new Set([_e.ADDRESS,_e.APPLET,_e.AREA,_e.ARTICLE,_e.ASIDE,_e.BASE,_e.BASEFONT,_e.BGSOUND,_e.BLOCKQUOTE,_e.BODY,_e.BR,_e.BUTTON,_e.CAPTION,_e.CENTER,_e.COL,_e.COLGROUP,_e.DD,_e.DETAILS,_e.DIR,_e.DIV,_e.DL,_e.DT,_e.EMBED,_e.FIELDSET,_e.FIGCAPTION,_e.FIGURE,_e.FOOTER,_e.FORM,_e.FRAME,_e.FRAMESET,_e.H1,_e.H2,_e.H3,_e.H4,_e.H5,_e.H6,_e.HEAD,_e.HEADER,_e.HGROUP,_e.HR,_e.HTML,_e.IFRAME,_e.IMG,_e.INPUT,_e.LI,_e.LINK,_e.LISTING,_e.MAIN,_e.MARQUEE,_e.MENU,_e.META,_e.NAV,_e.NOEMBED,_e.NOFRAMES,_e.NOSCRIPT,_e.OBJECT,_e.OL,_e.P,_e.PARAM,_e.PLAINTEXT,_e.PRE,_e.SCRIPT,_e.SECTION,_e.SELECT,_e.SOURCE,_e.STYLE,_e.SUMMARY,_e.TABLE,_e.TBODY,_e.TD,_e.TEMPLATE,_e.TEXTAREA,_e.TFOOT,_e.TH,_e.THEAD,_e.TITLE,_e.TR,_e.TRACK,_e.UL,_e.WBR,_e.XMP]),[ge.MATHML]:new Set([_e.MI,_e.MO,_e.MN,_e.MS,_e.MTEXT,_e.ANNOTATION_XML]),[ge.SVG]:new Set([_e.TITLE,_e.FOREIGN_OBJECT,_e.DESC]),[ge.XLINK]:new Set,[ge.XML]:new Set,[ge.XMLNS]:new Set},Jb=new Set([_e.H1,_e.H2,_e.H3,_e.H4,_e.H5,_e.H6]);ne.STYLE,ne.SCRIPT,ne.XMP,ne.IFRAME,ne.NOEMBED,ne.NOFRAMES,ne.PLAINTEXT;var $;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})($||($={}));const Ut={DATA:$.DATA,RCDATA:$.RCDATA,RAWTEXT:$.RAWTEXT,SCRIPT_DATA:$.SCRIPT_DATA,PLAINTEXT:$.PLAINTEXT,CDATA_SECTION:$.CDATA_SECTION};function Hz(e){return e>=H.DIGIT_0&&e<=H.DIGIT_9}function hc(e){return e>=H.LATIN_CAPITAL_A&&e<=H.LATIN_CAPITAL_Z}function Fz(e){return e>=H.LATIN_SMALL_A&&e<=H.LATIN_SMALL_Z}function qs(e){return Fz(e)||hc(e)}function F2(e){return qs(e)||Hz(e)}function nf(e){return e+32}function MN(e){return e===H.SPACE||e===H.LINE_FEED||e===H.TABULATION||e===H.FORM_FEED}function j2(e){return MN(e)||e===H.SOLIDUS||e===H.GREATER_THAN_SIGN}function jz(e){return e===H.NULL?le.nullCharacterReference:e>1114111?le.characterReferenceOutsideUnicodeRange:NN(e)?le.surrogateCharacterReference:ON(e)?le.noncharacterCharacterReference:LN(e)||e===H.CARRIAGE_RETURN?le.controlCharacterReference:null}class zz{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=$.DATA,this.returnState=$.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Tz(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Mz(kz,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(le.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(le.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=jz(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:qe.START_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:qe.END_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:qe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:qe.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(DN(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(le.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Vl(t.tagName),t.type===qe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(le.endTagWithAttributes),t.selfClosing&&this._err(le.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case qe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case qe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case qe.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:qe.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=MN(t)?qe.WHITESPACE_CHARACTER:t===H.NULL?qe.NULL_CHARACTER:qe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(qe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=$.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?es.Attribute:es.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case $.DATA:{this._stateData(t);break}case $.RCDATA:{this._stateRcdata(t);break}case $.RAWTEXT:{this._stateRawtext(t);break}case $.SCRIPT_DATA:{this._stateScriptData(t);break}case $.PLAINTEXT:{this._statePlaintext(t);break}case $.TAG_OPEN:{this._stateTagOpen(t);break}case $.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case $.TAG_NAME:{this._stateTagName(t);break}case $.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case $.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case $.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case $.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case $.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case $.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case $.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case $.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case $.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case $.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case $.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case $.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case $.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case $.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case $.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case $.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case $.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case $.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case $.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case $.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case $.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case $.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case $.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case $.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case $.BOGUS_COMMENT:{this._stateBogusComment(t);break}case $.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case $.COMMENT_START:{this._stateCommentStart(t);break}case $.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case $.COMMENT:{this._stateComment(t);break}case $.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case $.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case $.COMMENT_END:{this._stateCommentEnd(t);break}case $.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case $.DOCTYPE:{this._stateDoctype(t);break}case $.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case $.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case $.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case $.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case $.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case $.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case $.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case $.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case $.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case $.CDATA_SECTION:{this._stateCdataSection(t);break}case $.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case $.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case $.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=$.TAG_OPEN;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(le.unexpectedNullCharacter),this._emitCodePoint(t);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case H.AMPERSAND:{this._startCharacterReference();break}case H.LESS_THAN_SIGN:{this.state=$.RCDATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Ct);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case H.LESS_THAN_SIGN:{this.state=$.RAWTEXT_LESS_THAN_SIGN;break}case H.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Ct);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Ct);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case H.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Ct);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(qs(t))this._createStartTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case H.EXCLAMATION_MARK:{this.state=$.MARKUP_DECLARATION_OPEN;break}case H.SOLIDUS:{this.state=$.END_TAG_OPEN;break}case H.QUESTION_MARK:{this._err(le.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t);break}case H.EOF:{this._err(le.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(le.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(qs(t))this._createEndTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case H.GREATER_THAN_SIGN:{this._err(le.missingEndTagName),this.state=$.DATA;break}case H.EOF:{this._err(le.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(le.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=$.BEFORE_ATTRIBUTE_NAME;break}case H.SOLIDUS:{this.state=$.SELF_CLOSING_START_TAG;break}case H.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentTagToken();break}case H.NULL:{this._err(le.unexpectedNullCharacter),n.tagName+=Ct;break}case H.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(hc(t)?nf(t):t)}}_stateRcdataLessThanSign(t){t===H.SOLIDUS?this.state=$.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=$.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){qs(t)?(this.state=$.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=$.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=$.BEFORE_ATTRIBUTE_NAME,!1;case H.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=$.SELF_CLOSING_START_TAG,!1;case H.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=$.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=$.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===H.SOLIDUS?this.state=$.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=$.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){qs(t)?(this.state=$.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=$.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=$.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case H.SOLIDUS:{this.state=$.SCRIPT_DATA_END_TAG_OPEN;break}case H.EXCLAMATION_MARK:{this.state=$.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=$.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){qs(t)?(this.state=$.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===H.HYPHEN_MINUS?(this.state=$.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===H.HYPHEN_MINUS?(this.state=$.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case H.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Ct);break}case H.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case H.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.NULL:{this._err(le.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(Ct);break}case H.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case H.HYPHEN_MINUS:{this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.GREATER_THAN_SIGN:{this.state=$.SCRIPT_DATA,this._emitChars(">");break}case H.NULL:{this._err(le.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(Ct);break}case H.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===H.SOLIDUS?this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:qs(t)?(this._emitChars("<"),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){qs(t)?(this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(tr.SCRIPT,!1)&&j2(this.preprocessor.peek(tr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<tr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case H.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Ct);break}case H.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case H.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.NULL:{this._err(le.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ct);break}case H.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case H.HYPHEN_MINUS:{this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.GREATER_THAN_SIGN:{this.state=$.SCRIPT_DATA,this._emitChars(">");break}case H.NULL:{this._err(le.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ct);break}case H.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===H.SOLIDUS?(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(tr.SCRIPT,!1)&&j2(this.preprocessor.peek(tr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<tr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=$.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:{this.state=$.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case H.EQUALS_SIGN:{this._err(le.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=$.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=$.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:{this._leaveAttrName(),this.state=$.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case H.EQUALS_SIGN:{this._leaveAttrName(),this.state=$.BEFORE_ATTRIBUTE_VALUE;break}case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:{this._err(le.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case H.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.name+=Ct;break}default:this.currentAttr.name+=String.fromCodePoint(hc(t)?nf(t):t)}}_stateAfterAttributeName(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:{this.state=$.SELF_CLOSING_START_TAG;break}case H.EQUALS_SIGN:{this.state=$.BEFORE_ATTRIBUTE_VALUE;break}case H.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=$.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{this.state=$.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this.state=$.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(le.missingAttributeValue),this.state=$.DATA,this.emitCurrentTagToken();break}default:this.state=$.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case H.QUOTATION_MARK:{this.state=$.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Ct;break}case H.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case H.APOSTROPHE:{this.state=$.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Ct;break}case H.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this._leaveAttrValue(),this.state=$.BEFORE_ATTRIBUTE_NAME;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$.DATA,this.emitCurrentTagToken();break}case H.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Ct;break}case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:case H.EQUALS_SIGN:case H.GRAVE_ACCENT:{this._err(le.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case H.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this._leaveAttrValue(),this.state=$.BEFORE_ATTRIBUTE_NAME;break}case H.SOLIDUS:{this._leaveAttrValue(),this.state=$.SELF_CLOSING_START_TAG;break}case H.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._err(le.missingWhitespaceBetweenAttributes),this.state=$.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case H.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=$.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._err(le.unexpectedSolidusInTag),this.state=$.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case H.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentComment(n);break}case H.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case H.NULL:{this._err(le.unexpectedNullCharacter),n.data+=Ct;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(tr.DASH_DASH,!0)?(this._createCommentToken(tr.DASH_DASH.length+1),this.state=$.COMMENT_START):this._consumeSequenceIfMatch(tr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(tr.DOCTYPE.length+1),this.state=$.DOCTYPE):this._consumeSequenceIfMatch(tr.CDATA_START,!0)?this.inForeignNode?this.state=$.CDATA_SECTION:(this._err(le.cdataInHtmlContent),this._createCommentToken(tr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=$.BOGUS_COMMENT):this._ensureHibernation()||(this._err(le.incorrectlyOpenedComment),this._createCommentToken(2),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case H.HYPHEN_MINUS:{this.state=$.COMMENT_START_DASH;break}case H.GREATER_THAN_SIGN:{this._err(le.abruptClosingOfEmptyComment),this.state=$.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=$.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{this.state=$.COMMENT_END;break}case H.GREATER_THAN_SIGN:{this._err(le.abruptClosingOfEmptyComment),this.state=$.DATA,this.emitCurrentComment(n);break}case H.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=$.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{this.state=$.COMMENT_END_DASH;break}case H.LESS_THAN_SIGN:{n.data+="<",this.state=$.COMMENT_LESS_THAN_SIGN;break}case H.NULL:{this._err(le.unexpectedNullCharacter),n.data+=Ct;break}case H.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case H.EXCLAMATION_MARK:{n.data+="!",this.state=$.COMMENT_LESS_THAN_SIGN_BANG;break}case H.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=$.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===H.HYPHEN_MINUS?this.state=$.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=$.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===H.HYPHEN_MINUS?this.state=$.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=$.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==H.GREATER_THAN_SIGN&&t!==H.EOF&&this._err(le.nestedComment),this.state=$.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{this.state=$.COMMENT_END;break}case H.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=$.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case H.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentComment(n);break}case H.EXCLAMATION_MARK:{this.state=$.COMMENT_END_BANG;break}case H.HYPHEN_MINUS:{n.data+="-";break}case H.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=$.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{n.data+="--!",this.state=$.COMMENT_END_DASH;break}case H.GREATER_THAN_SIGN:{this._err(le.incorrectlyClosedComment),this.state=$.DATA,this.emitCurrentComment(n);break}case H.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=$.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this.state=$.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case H.EOF:{this._err(le.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingWhitespaceBeforeDoctypeName),this.state=$.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(hc(t))this._createDoctypeToken(String.fromCharCode(nf(t))),this.state=$.DOCTYPE_NAME;else switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.NULL:{this._err(le.unexpectedNullCharacter),this._createDoctypeToken(Ct),this.state=$.DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this._err(le.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case H.EOF:{this._err(le.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=$.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=$.AFTER_DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case H.NULL:{this._err(le.unexpectedNullCharacter),n.name+=Ct;break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(hc(t)?nf(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(tr.PUBLIC,!1)?this.state=$.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(tr.SYSTEM,!1)?this.state=$.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(le.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.QUOTATION_MARK:{this._err(le.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(le.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(le.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(le.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case H.QUOTATION_MARK:{this.state=$.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.NULL:{this._err(le.unexpectedNullCharacter),n.publicId+=Ct;break}case H.GREATER_THAN_SIGN:{this._err(le.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case H.APOSTROPHE:{this.state=$.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.NULL:{this._err(le.unexpectedNullCharacter),n.publicId+=Ct;break}case H.GREATER_THAN_SIGN:{this._err(le.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=$.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case H.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case H.QUOTATION_MARK:{this._err(le.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(le.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case H.QUOTATION_MARK:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.QUOTATION_MARK:{this._err(le.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(le.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(le.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(le.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case H.QUOTATION_MARK:{this.state=$.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.NULL:{this._err(le.unexpectedNullCharacter),n.systemId+=Ct;break}case H.GREATER_THAN_SIGN:{this._err(le.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case H.APOSTROPHE:{this.state=$.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.NULL:{this._err(le.unexpectedNullCharacter),n.systemId+=Ct;break}case H.GREATER_THAN_SIGN:{this._err(le.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case H.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case H.NULL:{this._err(le.unexpectedNullCharacter);break}case H.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case H.RIGHT_SQUARE_BRACKET:{this.state=$.CDATA_SECTION_BRACKET;break}case H.EOF:{this._err(le.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===H.RIGHT_SQUARE_BRACKET?this.state=$.CDATA_SECTION_END:(this._emitChars("]"),this.state=$.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case H.GREATER_THAN_SIGN:{this.state=$.DATA;break}case H.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=$.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(H.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&F2(this.preprocessor.peek(1))?$.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){F2(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===H.SEMICOLON&&this._err(le.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const IN=new Set([E.DD,E.DT,E.LI,E.OPTGROUP,E.OPTION,E.P,E.RB,E.RP,E.RT,E.RTC]),z2=new Set([...IN,E.CAPTION,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]),op=new Set([E.APPLET,E.CAPTION,E.HTML,E.MARQUEE,E.OBJECT,E.TABLE,E.TD,E.TEMPLATE,E.TH]),Uz=new Set([...op,E.OL,E.UL]),$z=new Set([...op,E.BUTTON]),U2=new Set([E.ANNOTATION_XML,E.MI,E.MN,E.MO,E.MS,E.MTEXT]),$2=new Set([E.DESC,E.FOREIGN_OBJECT,E.TITLE]),Vz=new Set([E.TR,E.TEMPLATE,E.HTML]),qz=new Set([E.TBODY,E.TFOOT,E.THEAD,E.TEMPLATE,E.HTML]),Wz=new Set([E.TABLE,E.TEMPLATE,E.HTML]),Gz=new Set([E.TD,E.TH]);class Yz{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=E.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===E.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ge.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ge.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Jb,ge.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Gz,ge.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(Wz,ge.HTML)}clearBackToTableBodyContext(){this.clearBackTo(qz,ge.HTML)}clearBackToTableRowContext(){this.clearBackTo(Vz,ge.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===E.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===E.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ge.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case ge.SVG:{if($2.has(i))return!1;break}case ge.MATHML:{if(U2.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,op)}hasInListItemScope(t){return this.hasInDynamicScope(t,Uz)}hasInButtonScope(t){return this.hasInDynamicScope(t,$z)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ge.HTML:{if(Jb.has(n))return!0;if(op.has(n))return!1;break}case ge.SVG:{if($2.has(n))return!1;break}case ge.MATHML:{if(U2.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ge.HTML)switch(this.tagIDs[n]){case t:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ge.HTML)switch(this.tagIDs[t]){case E.TBODY:case E.THEAD:case E.TFOOT:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ge.HTML)switch(this.tagIDs[n]){case t:return!0;case E.OPTION:case E.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&IN.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&z2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&z2.has(this.currentTagId);)this.pop()}}const v_=3;var mi;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(mi||(mi={}));const V2={type:mi.Marker};class Kz{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const c=this.entries[u];if(c.type===mi.Marker)break;const{element:d}=c;if(this.treeAdapter.getTagName(d)===s&&this.treeAdapter.getNamespaceURI(d)===o){const p=this.treeAdapter.getAttrList(d);p.length===i&&r.push({idx:u,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<v_)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<v_)return;const i=new Map(n.map(o=>[o.name,o.value]));let s=0;for(let o=0;o<r.length;o++){const u=r[o];u.attrs.every(c=>i.get(c.name)===c.value)&&(s+=1,s>=v_&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(V2)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:mi.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:mi.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(V2);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===mi.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===mi.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===mi.Element&&n.element===t)}}const Ws={createDocument(){return{nodeName:"#document",mode:jr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ws.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ws.isTextNode(n)){n.value+=t;return}}Ws.appendChild(e,Ws.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ws.isTextNode(r)?r.value+=t:Ws.insertBefore(e,Ws.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},PN="html",Qz="about:legacy-compat",Xz="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",BN=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Zz=[...BN,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Jz=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),HN=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],eU=[...HN,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function q2(e,t){return t.some(n=>e.startsWith(n))}function tU(e){return e.name===PN&&e.publicId===null&&(e.systemId===null||e.systemId===Qz)}function nU(e){if(e.name!==PN)return jr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Xz)return jr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Jz.has(n))return jr.QUIRKS;let r=t===null?Zz:BN;if(q2(n,r))return jr.QUIRKS;if(r=t===null?HN:eU,q2(n,r))return jr.LIMITED_QUIRKS}return jr.NO_QUIRKS}const W2={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},rU="definitionurl",iU="definitionURL",sU=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),aU=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ge.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ge.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ge.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ge.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ge.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ge.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ge.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ge.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ge.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ge.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ge.XMLNS}]]),oU=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),lU=new Set([E.B,E.BIG,E.BLOCKQUOTE,E.BODY,E.BR,E.CENTER,E.CODE,E.DD,E.DIV,E.DL,E.DT,E.EM,E.EMBED,E.H1,E.H2,E.H3,E.H4,E.H5,E.H6,E.HEAD,E.HR,E.I,E.IMG,E.LI,E.LISTING,E.MENU,E.META,E.NOBR,E.OL,E.P,E.PRE,E.RUBY,E.S,E.SMALL,E.SPAN,E.STRONG,E.STRIKE,E.SUB,E.SUP,E.TABLE,E.TT,E.U,E.UL,E.VAR]);function uU(e){const t=e.tagID;return t===E.FONT&&e.attrs.some(({name:r})=>r===Ua.COLOR||r===Ua.SIZE||r===Ua.FACE)||lU.has(t)}function FN(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===rU){e.attrs[t].name=iU;break}}function jN(e){for(let t=0;t<e.attrs.length;t++){const n=sU.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Gv(e){for(let t=0;t<e.attrs.length;t++){const n=aU.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function cU(e){const t=oU.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Vl(e.tagName))}function hU(e,t){return t===ge.MATHML&&(e===E.MI||e===E.MO||e===E.MN||e===E.MS||e===E.MTEXT)}function dU(e,t,n){if(t===ge.MATHML&&e===E.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ua.ENCODING){const i=n[r].value.toLowerCase();return i===W2.TEXT_HTML||i===W2.APPLICATION_XML}}return t===ge.SVG&&(e===E.FOREIGN_OBJECT||e===E.DESC||e===E.TITLE)}function fU(e,t,n,r){return(!r||r===ge.HTML)&&dU(e,t,n)||(!r||r===ge.MATHML)&&hU(e,t)}const pU="hidden",mU=8,gU=3;var G;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(G||(G={}));const _U={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},zN=new Set([E.TABLE,E.TBODY,E.TFOOT,E.THEAD,E.TR]),G2={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ws,onParseError:null};class Y2{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=G.INITIAL,this.originalInsertionMode=G.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...G2,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new zz(this.options,this),this.activeFormattingElements=new Kz(this.treeAdapter),this.fragmentContextID=r?Vl(this.treeAdapter.getTagName(r)):E.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Yz(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...G2,...n};t??(t=r.treeAdapter.createElement(ne.TEMPLATE,ge.HTML,[]));const i=r.treeAdapter.createElement("documentmock",ge.HTML,[]),s=new this(r,i,t);return s.fragmentContextID===E.TEMPLATE&&s.tmplInsertionModeStack.unshift(G.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const s=(i=t.location)!==null&&i!==void 0?i:_U,o={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(o)}onItemPush(t,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ge.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ge.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=G.TEXT}switchToPlaintextParsing(){this.insertionMode=G.TEXT,this.originalInsertionMode=G.IN_BODY,this.tokenizer.state=Ut.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===ne.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ge.HTML))switch(this.fragmentContextID){case E.TITLE:case E.TEXTAREA:{this.tokenizer.state=Ut.RCDATA;break}case E.STYLE:case E.XMP:case E.IFRAME:case E.NOEMBED:case E.NOFRAMES:case E.NOSCRIPT:{this.tokenizer.state=Ut.RAWTEXT;break}case E.SCRIPT:{this.tokenizer.state=Ut.SCRIPT_DATA;break}case E.PLAINTEXT:{this.tokenizer.state=Ut.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ge.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ge.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ne.HTML,ge.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,E.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,o=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:d,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:d,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===qe.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===E.SVG&&this.treeAdapter.getTagName(n)===ne.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ge.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===E.MGLYPH||t.tagID===E.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ge.HTML)}_processToken(t){switch(t.type){case qe.CHARACTER:{this.onCharacter(t);break}case qe.NULL_CHARACTER:{this.onNullCharacter(t);break}case qe.COMMENT:{this.onComment(t);break}case qe.DOCTYPE:{this.onDoctype(t);break}case qe.START_TAG:{this._processStartTag(t);break}case qe.END_TAG:{this.onEndTag(t);break}case qe.EOF:{this.onEof(t);break}case qe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return fU(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===mi.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=G.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(E.P),this.openElements.popUntilTagNamePopped(E.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case E.TR:{this.insertionMode=G.IN_ROW;return}case E.TBODY:case E.THEAD:case E.TFOOT:{this.insertionMode=G.IN_TABLE_BODY;return}case E.CAPTION:{this.insertionMode=G.IN_CAPTION;return}case E.COLGROUP:{this.insertionMode=G.IN_COLUMN_GROUP;return}case E.TABLE:{this.insertionMode=G.IN_TABLE;return}case E.BODY:{this.insertionMode=G.IN_BODY;return}case E.FRAMESET:{this.insertionMode=G.IN_FRAMESET;return}case E.SELECT:{this._resetInsertionModeForSelect(t);return}case E.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case E.HTML:{this.insertionMode=this.headElement?G.AFTER_HEAD:G.BEFORE_HEAD;return}case E.TD:case E.TH:{if(t>0){this.insertionMode=G.IN_CELL;return}break}case E.HEAD:{if(t>0){this.insertionMode=G.IN_HEAD;return}break}}this.insertionMode=G.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===E.TEMPLATE)break;if(r===E.TABLE){this.insertionMode=G.IN_SELECT_IN_TABLE;return}}this.insertionMode=G.IN_SELECT}_isElementCausesFosterParenting(t){return zN.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case E.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ge.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case E.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return Bz[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){G$(this,t);return}switch(this.insertionMode){case G.INITIAL:{Yu(this,t);break}case G.BEFORE_HTML:{xc(this,t);break}case G.BEFORE_HEAD:{wc(this,t);break}case G.IN_HEAD:{Cc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Tc(this,t);break}case G.AFTER_HEAD:{kc(this,t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:{$N(this,t);break}case G.TEXT:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{y_(this,t);break}case G.IN_TABLE_TEXT:{KN(this,t);break}case G.IN_COLUMN_GROUP:{lp(this,t);break}case G.AFTER_BODY:{up(this,t);break}case G.AFTER_AFTER_BODY:{Af(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){W$(this,t);return}switch(this.insertionMode){case G.INITIAL:{Yu(this,t);break}case G.BEFORE_HTML:{xc(this,t);break}case G.BEFORE_HEAD:{wc(this,t);break}case G.IN_HEAD:{Cc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Tc(this,t);break}case G.AFTER_HEAD:{kc(this,t);break}case G.TEXT:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{y_(this,t);break}case G.IN_COLUMN_GROUP:{lp(this,t);break}case G.AFTER_BODY:{up(this,t);break}case G.AFTER_AFTER_BODY:{Af(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){e1(this,t);return}switch(this.insertionMode){case G.INITIAL:case G.BEFORE_HTML:case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_TEMPLATE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{e1(this,t);break}case G.IN_TABLE_TEXT:{Ku(this,t);break}case G.AFTER_BODY:{wU(this,t);break}case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{CU(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case G.INITIAL:{TU(this,t);break}case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:{this._err(t,le.misplacedDoctype);break}case G.IN_TABLE_TEXT:{Ku(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,le.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Y$(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{Yu(this,t);break}case G.BEFORE_HTML:{kU(this,t);break}case G.BEFORE_HEAD:{RU(this,t);break}case G.IN_HEAD:{ri(this,t);break}case G.IN_HEAD_NO_SCRIPT:{OU(this,t);break}case G.AFTER_HEAD:{MU(this,t);break}case G.IN_BODY:{In(this,t);break}case G.IN_TABLE:{Rl(this,t);break}case G.IN_TABLE_TEXT:{Ku(this,t);break}case G.IN_CAPTION:{N$(this,t);break}case G.IN_COLUMN_GROUP:{Qv(this,t);break}case G.IN_TABLE_BODY:{Xp(this,t);break}case G.IN_ROW:{Zp(this,t);break}case G.IN_CELL:{D$(this,t);break}case G.IN_SELECT:{ZN(this,t);break}case G.IN_SELECT_IN_TABLE:{I$(this,t);break}case G.IN_TEMPLATE:{B$(this,t);break}case G.AFTER_BODY:{F$(this,t);break}case G.IN_FRAMESET:{j$(this,t);break}case G.AFTER_FRAMESET:{U$(this,t);break}case G.AFTER_AFTER_BODY:{V$(this,t);break}case G.AFTER_AFTER_FRAMESET:{q$(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?K$(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{Yu(this,t);break}case G.BEFORE_HTML:{AU(this,t);break}case G.BEFORE_HEAD:{NU(this,t);break}case G.IN_HEAD:{LU(this,t);break}case G.IN_HEAD_NO_SCRIPT:{DU(this,t);break}case G.AFTER_HEAD:{IU(this,t);break}case G.IN_BODY:{Qp(this,t);break}case G.TEXT:{y$(this,t);break}case G.IN_TABLE:{Vc(this,t);break}case G.IN_TABLE_TEXT:{Ku(this,t);break}case G.IN_CAPTION:{L$(this,t);break}case G.IN_COLUMN_GROUP:{O$(this,t);break}case G.IN_TABLE_BODY:{t1(this,t);break}case G.IN_ROW:{XN(this,t);break}case G.IN_CELL:{M$(this,t);break}case G.IN_SELECT:{JN(this,t);break}case G.IN_SELECT_IN_TABLE:{P$(this,t);break}case G.IN_TEMPLATE:{H$(this,t);break}case G.AFTER_BODY:{tL(this,t);break}case G.IN_FRAMESET:{z$(this,t);break}case G.AFTER_FRAMESET:{$$(this,t);break}case G.AFTER_AFTER_BODY:{Af(this,t);break}}}onEof(t){switch(this.insertionMode){case G.INITIAL:{Yu(this,t);break}case G.BEFORE_HTML:{xc(this,t);break}case G.BEFORE_HEAD:{wc(this,t);break}case G.IN_HEAD:{Cc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Tc(this,t);break}case G.AFTER_HEAD:{kc(this,t);break}case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{GN(this,t);break}case G.TEXT:{S$(this,t);break}case G.IN_TABLE_TEXT:{Ku(this,t);break}case G.IN_TEMPLATE:{eL(this,t);break}case G.AFTER_BODY:case G.IN_FRAMESET:case G.AFTER_FRAMESET:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{Kv(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===H.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.TEXT:case G.IN_COLUMN_GROUP:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{this._insertCharacters(t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:case G.AFTER_BODY:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{UN(this,t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{y_(this,t);break}case G.IN_TABLE_TEXT:{YN(this,t);break}}}}function bU(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):WN(e,t),n}function vU(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function yU(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,o=i;o!==n;s++,o=i){i=e.openElements.getCommonAncestor(o);const u=e.activeFormattingElements.getElementEntry(o),c=u&&s>=gU;!u||c?(c&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(o)):(o=SU(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function SU(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function EU(e,t,n){const r=e.treeAdapter.getTagName(t),i=Vl(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===E.TEMPLATE&&s===ge.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function xU(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function Yv(e,t){for(let n=0;n<mU;n++){const r=bU(e,t);if(!r)break;const i=vU(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const s=yU(e,i,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(s),o&&EU(e,o,s),xU(e,i,r)}}function e1(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function wU(e,t){e._appendCommentNode(t,e.openElements.items[0])}function CU(e,t){e._appendCommentNode(t,e.document)}function Kv(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function TU(e,t){e._setDocumentType(t);const n=t.forceQuirks?jr.QUIRKS:nU(t);tU(t)||e._err(t,le.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=G.BEFORE_HTML}function Yu(e,t){e._err(t,le.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,jr.QUIRKS),e.insertionMode=G.BEFORE_HTML,e._processToken(t)}function kU(e,t){t.tagID===E.HTML?(e._insertElement(t,ge.HTML),e.insertionMode=G.BEFORE_HEAD):xc(e,t)}function AU(e,t){const n=t.tagID;(n===E.HTML||n===E.HEAD||n===E.BODY||n===E.BR)&&xc(e,t)}function xc(e,t){e._insertFakeRootElement(),e.insertionMode=G.BEFORE_HEAD,e._processToken(t)}function RU(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.HEAD:{e._insertElement(t,ge.HTML),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD;break}default:wc(e,t)}}function NU(e,t){const n=t.tagID;n===E.HEAD||n===E.BODY||n===E.HTML||n===E.BR?wc(e,t):e._err(t,le.endTagWithoutMatchingOpenElement)}function wc(e,t){e._insertFakeElement(ne.HEAD,E.HEAD),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD,e._processToken(t)}function ri(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:{e._appendElement(t,ge.HTML),t.ackSelfClosing=!0;break}case E.TITLE:{e._switchToTextParsing(t,Ut.RCDATA);break}case E.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ut.RAWTEXT):(e._insertElement(t,ge.HTML),e.insertionMode=G.IN_HEAD_NO_SCRIPT);break}case E.NOFRAMES:case E.STYLE:{e._switchToTextParsing(t,Ut.RAWTEXT);break}case E.SCRIPT:{e._switchToTextParsing(t,Ut.SCRIPT_DATA);break}case E.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=G.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(G.IN_TEMPLATE);break}case E.HEAD:{e._err(t,le.misplacedStartTagForHeadElement);break}default:Cc(e,t)}}function LU(e,t){switch(t.tagID){case E.HEAD:{e.openElements.pop(),e.insertionMode=G.AFTER_HEAD;break}case E.BODY:case E.BR:case E.HTML:{Cc(e,t);break}case E.TEMPLATE:{io(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function io(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==E.TEMPLATE&&e._err(t,le.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,le.endTagWithoutMatchingOpenElement)}function Cc(e,t){e.openElements.pop(),e.insertionMode=G.AFTER_HEAD,e._processToken(t)}function OU(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.BASEFONT:case E.BGSOUND:case E.HEAD:case E.LINK:case E.META:case E.NOFRAMES:case E.STYLE:{ri(e,t);break}case E.NOSCRIPT:{e._err(t,le.nestedNoscriptInHead);break}default:Tc(e,t)}}function DU(e,t){switch(t.tagID){case E.NOSCRIPT:{e.openElements.pop(),e.insertionMode=G.IN_HEAD;break}case E.BR:{Tc(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function Tc(e,t){const n=t.type===qe.EOF?le.openElementsLeftAfterEof:le.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=G.IN_HEAD,e._processToken(t)}function MU(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.BODY:{e._insertElement(t,ge.HTML),e.framesetOk=!1,e.insertionMode=G.IN_BODY;break}case E.FRAMESET:{e._insertElement(t,ge.HTML),e.insertionMode=G.IN_FRAMESET;break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{e._err(t,le.abandonedHeadElementChild),e.openElements.push(e.headElement,E.HEAD),ri(e,t),e.openElements.remove(e.headElement);break}case E.HEAD:{e._err(t,le.misplacedStartTagForHeadElement);break}default:kc(e,t)}}function IU(e,t){switch(t.tagID){case E.BODY:case E.HTML:case E.BR:{kc(e,t);break}case E.TEMPLATE:{io(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function kc(e,t){e._insertFakeElement(ne.BODY,E.BODY),e.insertionMode=G.IN_BODY,Kp(e,t)}function Kp(e,t){switch(t.type){case qe.CHARACTER:{$N(e,t);break}case qe.WHITESPACE_CHARACTER:{UN(e,t);break}case qe.COMMENT:{e1(e,t);break}case qe.START_TAG:{In(e,t);break}case qe.END_TAG:{Qp(e,t);break}case qe.EOF:{GN(e,t);break}}}function UN(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function $N(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function PU(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function BU(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function HU(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ge.HTML),e.insertionMode=G.IN_FRAMESET)}function FU(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,ge.HTML)}function jU(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Jb.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ge.HTML)}function zU(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,ge.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function UU(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,ge.HTML),n||(e.formElement=e.openElements.current))}function $U(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===E.LI&&i===E.LI||(n===E.DD||n===E.DT)&&(i===E.DD||i===E.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==E.ADDRESS&&i!==E.DIV&&i!==E.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,ge.HTML)}function VU(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,ge.HTML),e.tokenizer.state=Ut.PLAINTEXT}function qU(e,t){e.openElements.hasInScope(E.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ge.HTML),e.framesetOk=!1}function WU(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ne.A);n&&(Yv(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ge.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function GU(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ge.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function YU(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(E.NOBR)&&(Yv(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ge.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function KU(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ge.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function QU(e,t){e.treeAdapter.getDocumentMode(e.document)!==jr.QUIRKS&&e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,ge.HTML),e.framesetOk=!1,e.insertionMode=G.IN_TABLE}function VN(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ge.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function qN(e){const t=DN(e,Ua.TYPE);return t!=null&&t.toLowerCase()===pU}function XU(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ge.HTML),qN(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function ZU(e,t){e._appendElement(t,ge.HTML),t.ackSelfClosing=!0}function JU(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._appendElement(t,ge.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function e$(e,t){t.tagName=ne.IMG,t.tagID=E.IMG,VN(e,t)}function t$(e,t){e._insertElement(t,ge.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ut.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=G.TEXT}function n$(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ut.RAWTEXT)}function r$(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ut.RAWTEXT)}function K2(e,t){e._switchToTextParsing(t,Ut.RAWTEXT)}function i$(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ge.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===G.IN_TABLE||e.insertionMode===G.IN_CAPTION||e.insertionMode===G.IN_TABLE_BODY||e.insertionMode===G.IN_ROW||e.insertionMode===G.IN_CELL?G.IN_SELECT_IN_TABLE:G.IN_SELECT}function s$(e,t){e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ge.HTML)}function a$(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ge.HTML)}function o$(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(E.RTC),e._insertElement(t,ge.HTML)}function l$(e,t){e._reconstructActiveFormattingElements(),FN(t),Gv(t),t.selfClosing?e._appendElement(t,ge.MATHML):e._insertElement(t,ge.MATHML),t.ackSelfClosing=!0}function u$(e,t){e._reconstructActiveFormattingElements(),jN(t),Gv(t),t.selfClosing?e._appendElement(t,ge.SVG):e._insertElement(t,ge.SVG),t.ackSelfClosing=!0}function Q2(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ge.HTML)}function In(e,t){switch(t.tagID){case E.I:case E.S:case E.B:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.SMALL:case E.STRIKE:case E.STRONG:{GU(e,t);break}case E.A:{WU(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{jU(e,t);break}case E.P:case E.DL:case E.OL:case E.UL:case E.DIV:case E.DIR:case E.NAV:case E.MAIN:case E.MENU:case E.ASIDE:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.DETAILS:case E.ADDRESS:case E.ARTICLE:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{FU(e,t);break}case E.LI:case E.DD:case E.DT:{$U(e,t);break}case E.BR:case E.IMG:case E.WBR:case E.AREA:case E.EMBED:case E.KEYGEN:{VN(e,t);break}case E.HR:{JU(e,t);break}case E.RB:case E.RTC:{a$(e,t);break}case E.RT:case E.RP:{o$(e,t);break}case E.PRE:case E.LISTING:{zU(e,t);break}case E.XMP:{n$(e,t);break}case E.SVG:{u$(e,t);break}case E.HTML:{PU(e,t);break}case E.BASE:case E.LINK:case E.META:case E.STYLE:case E.TITLE:case E.SCRIPT:case E.BGSOUND:case E.BASEFONT:case E.TEMPLATE:{ri(e,t);break}case E.BODY:{BU(e,t);break}case E.FORM:{UU(e,t);break}case E.NOBR:{YU(e,t);break}case E.MATH:{l$(e,t);break}case E.TABLE:{QU(e,t);break}case E.INPUT:{XU(e,t);break}case E.PARAM:case E.TRACK:case E.SOURCE:{ZU(e,t);break}case E.IMAGE:{e$(e,t);break}case E.BUTTON:{qU(e,t);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{KU(e,t);break}case E.IFRAME:{r$(e,t);break}case E.SELECT:{i$(e,t);break}case E.OPTION:case E.OPTGROUP:{s$(e,t);break}case E.NOEMBED:case E.NOFRAMES:{K2(e,t);break}case E.FRAMESET:{HU(e,t);break}case E.TEXTAREA:{t$(e,t);break}case E.NOSCRIPT:{e.options.scriptingEnabled?K2(e,t):Q2(e,t);break}case E.PLAINTEXT:{VU(e,t);break}case E.COL:case E.TH:case E.TD:case E.TR:case E.HEAD:case E.FRAME:case E.TBODY:case E.TFOOT:case E.THEAD:case E.CAPTION:case E.COLGROUP:break;default:Q2(e,t)}}function c$(e,t){if(e.openElements.hasInScope(E.BODY)&&(e.insertionMode=G.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function h$(e,t){e.openElements.hasInScope(E.BODY)&&(e.insertionMode=G.AFTER_BODY,tL(e,t))}function d$(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function f$(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(E.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(E.FORM):n&&e.openElements.remove(n))}function p$(e){e.openElements.hasInButtonScope(E.P)||e._insertFakeElement(ne.P,E.P),e._closePElement()}function m$(e){e.openElements.hasInListItemScope(E.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(E.LI),e.openElements.popUntilTagNamePopped(E.LI))}function g$(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function _$(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function b$(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function v$(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ne.BR,E.BR),e.openElements.pop(),e.framesetOk=!1}function WN(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],o=e.openElements.tagIDs[i];if(r===o&&(r!==E.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,o))break}}function Qp(e,t){switch(t.tagID){case E.A:case E.B:case E.I:case E.S:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.NOBR:case E.SMALL:case E.STRIKE:case E.STRONG:{Yv(e,t);break}case E.P:{p$(e);break}case E.DL:case E.UL:case E.OL:case E.DIR:case E.DIV:case E.NAV:case E.PRE:case E.MAIN:case E.MENU:case E.ASIDE:case E.BUTTON:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.ADDRESS:case E.ARTICLE:case E.DETAILS:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.LISTING:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{d$(e,t);break}case E.LI:{m$(e);break}case E.DD:case E.DT:{g$(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{_$(e);break}case E.BR:{v$(e);break}case E.BODY:{c$(e,t);break}case E.HTML:{h$(e,t);break}case E.FORM:{f$(e);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{b$(e,t);break}case E.TEMPLATE:{io(e,t);break}default:WN(e,t)}}function GN(e,t){e.tmplInsertionModeStack.length>0?eL(e,t):Kv(e,t)}function y$(e,t){var n;t.tagID===E.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function S$(e,t){e._err(t,le.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function y_(e,t){if(e.openElements.currentTagId!==void 0&&zN.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=G.IN_TABLE_TEXT,t.type){case qe.CHARACTER:{KN(e,t);break}case qe.WHITESPACE_CHARACTER:{YN(e,t);break}}else hh(e,t)}function E$(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ge.HTML),e.insertionMode=G.IN_CAPTION}function x$(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ge.HTML),e.insertionMode=G.IN_COLUMN_GROUP}function w$(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.COLGROUP,E.COLGROUP),e.insertionMode=G.IN_COLUMN_GROUP,Qv(e,t)}function C$(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ge.HTML),e.insertionMode=G.IN_TABLE_BODY}function T$(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.TBODY,E.TBODY),e.insertionMode=G.IN_TABLE_BODY,Xp(e,t)}function k$(e,t){e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function A$(e,t){qN(t)?e._appendElement(t,ge.HTML):hh(e,t),t.ackSelfClosing=!0}function R$(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ge.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Rl(e,t){switch(t.tagID){case E.TD:case E.TH:case E.TR:{T$(e,t);break}case E.STYLE:case E.SCRIPT:case E.TEMPLATE:{ri(e,t);break}case E.COL:{w$(e,t);break}case E.FORM:{R$(e,t);break}case E.TABLE:{k$(e,t);break}case E.TBODY:case E.TFOOT:case E.THEAD:{C$(e,t);break}case E.INPUT:{A$(e,t);break}case E.CAPTION:{E$(e,t);break}case E.COLGROUP:{x$(e,t);break}default:hh(e,t)}}function Vc(e,t){switch(t.tagID){case E.TABLE:{e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode());break}case E.TEMPLATE:{io(e,t);break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:hh(e,t)}}function hh(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Kp(e,t),e.fosterParentingEnabled=n}function YN(e,t){e.pendingCharacterTokens.push(t)}function KN(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Ku(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)hh(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const QN=new Set([E.CAPTION,E.COL,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]);function N$(e,t){const n=t.tagID;QN.has(n)?e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,Rl(e,t)):In(e,t)}function L$(e,t){const n=t.tagID;switch(n){case E.CAPTION:case E.TABLE:{e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,n===E.TABLE&&Vc(e,t));break}case E.BODY:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:Qp(e,t)}}function Qv(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.COL:{e._appendElement(t,ge.HTML),t.ackSelfClosing=!0;break}case E.TEMPLATE:{ri(e,t);break}default:lp(e,t)}}function O$(e,t){switch(t.tagID){case E.COLGROUP:{e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case E.TEMPLATE:{io(e,t);break}case E.COL:break;default:lp(e,t)}}function lp(e,t){e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE,e._processToken(t))}function Xp(e,t){switch(t.tagID){case E.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ge.HTML),e.insertionMode=G.IN_ROW;break}case E.TH:case E.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ne.TR,E.TR),e.insertionMode=G.IN_ROW,Zp(e,t);break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,Rl(e,t));break}default:Rl(e,t)}}function t1(e,t){const n=t.tagID;switch(t.tagID){case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case E.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,Vc(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:case E.TR:break;default:Vc(e,t)}}function Zp(e,t){switch(t.tagID){case E.TH:case E.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ge.HTML),e.insertionMode=G.IN_CELL,e.activeFormattingElements.insertMarker();break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Xp(e,t));break}default:Rl(e,t)}}function XN(e,t){switch(t.tagID){case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY);break}case E.TABLE:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,t1(e,t));break}case E.TBODY:case E.TFOOT:case E.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(E.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,t1(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:break;default:Vc(e,t)}}function D$(e,t){const n=t.tagID;QN.has(n)?(e.openElements.hasInTableScope(E.TD)||e.openElements.hasInTableScope(E.TH))&&(e._closeTableCell(),Zp(e,t)):In(e,t)}function M$(e,t){const n=t.tagID;switch(n){case E.TD:case E.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_ROW);break}case E.TABLE:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),XN(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:break;default:Qp(e,t)}}function ZN(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._insertElement(t,ge.HTML);break}case E.OPTGROUP:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ge.HTML);break}case E.HR:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ge.HTML),t.ackSelfClosing=!0;break}case E.INPUT:case E.KEYGEN:case E.TEXTAREA:case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),t.tagID!==E.SELECT&&e._processStartTag(t));break}case E.SCRIPT:case E.TEMPLATE:{ri(e,t);break}}}function JN(e,t){switch(t.tagID){case E.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===E.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===E.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop();break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop();break}case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode());break}case E.TEMPLATE:{io(e,t);break}}}function I$(e,t){const n=t.tagID;n===E.CAPTION||n===E.TABLE||n===E.TBODY||n===E.TFOOT||n===E.THEAD||n===E.TR||n===E.TD||n===E.TH?(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e._processStartTag(t)):ZN(e,t)}function P$(e,t){const n=t.tagID;n===E.CAPTION||n===E.TABLE||n===E.TBODY||n===E.TFOOT||n===E.THEAD||n===E.TR||n===E.TD||n===E.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e.onEndTag(t)):JN(e,t)}function B$(e,t){switch(t.tagID){case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{ri(e,t);break}case E.CAPTION:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.tmplInsertionModeStack[0]=G.IN_TABLE,e.insertionMode=G.IN_TABLE,Rl(e,t);break}case E.COL:{e.tmplInsertionModeStack[0]=G.IN_COLUMN_GROUP,e.insertionMode=G.IN_COLUMN_GROUP,Qv(e,t);break}case E.TR:{e.tmplInsertionModeStack[0]=G.IN_TABLE_BODY,e.insertionMode=G.IN_TABLE_BODY,Xp(e,t);break}case E.TD:case E.TH:{e.tmplInsertionModeStack[0]=G.IN_ROW,e.insertionMode=G.IN_ROW,Zp(e,t);break}default:e.tmplInsertionModeStack[0]=G.IN_BODY,e.insertionMode=G.IN_BODY,In(e,t)}}function H$(e,t){t.tagID===E.TEMPLATE&&io(e,t)}function eL(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Kv(e,t)}function F$(e,t){t.tagID===E.HTML?In(e,t):up(e,t)}function tL(e,t){var n;if(t.tagID===E.HTML){if(e.fragmentContext||(e.insertionMode=G.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===E.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else up(e,t)}function up(e,t){e.insertionMode=G.IN_BODY,Kp(e,t)}function j$(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.FRAMESET:{e._insertElement(t,ge.HTML);break}case E.FRAME:{e._appendElement(t,ge.HTML),t.ackSelfClosing=!0;break}case E.NOFRAMES:{ri(e,t);break}}}function z$(e,t){t.tagID===E.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==E.FRAMESET&&(e.insertionMode=G.AFTER_FRAMESET))}function U$(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.NOFRAMES:{ri(e,t);break}}}function $$(e,t){t.tagID===E.HTML&&(e.insertionMode=G.AFTER_AFTER_FRAMESET)}function V$(e,t){t.tagID===E.HTML?In(e,t):Af(e,t)}function Af(e,t){e.insertionMode=G.IN_BODY,Kp(e,t)}function q$(e,t){switch(t.tagID){case E.HTML:{In(e,t);break}case E.NOFRAMES:{ri(e,t);break}}}function W$(e,t){t.chars=Ct,e._insertCharacters(t)}function G$(e,t){e._insertCharacters(t),e.framesetOk=!1}function nL(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ge.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Y$(e,t){if(uU(t))nL(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ge.MATHML?FN(t):r===ge.SVG&&(cU(t),jN(t)),Gv(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function K$(e,t){if(t.tagID===E.P||t.tagID===E.BR){nL(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ge.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}ne.AREA,ne.BASE,ne.BASEFONT,ne.BGSOUND,ne.BR,ne.COL,ne.EMBED,ne.FRAME,ne.HR,ne.IMG,ne.INPUT,ne.KEYGEN,ne.LINK,ne.META,ne.PARAM,ne.SOURCE,ne.TRACK,ne.WBR;const Jp=rL("end"),ki=rL("start");function rL(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function iL(e){const t=ki(e),n=Jp(e);if(t&&n)return{start:t,end:n}}const Q$=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,X$=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),X2={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function sL(e,t){const n=oV(e),r=hv("type",{handlers:{root:Z$,element:J$,text:eV,comment:oL,doctype:tV,raw:rV},unknown:iV}),i={parser:n?new Y2(X2):Y2.getFragmentParser(void 0,X2),handle(u){r(u,i)},stitches:!1,options:t||{}};r(e,i),ql(i,ki());const s=n?i.parser.document:i.parser.getFragment(),o=uz(s,{file:i.options.file});return i.stitches&&Al(o,"comment",function(u,c,d){const p=u;if(p.value.stitch&&d&&c!==void 0){const m=d.children;return m[c]=p.value.stitch,c}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function aL(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Z$(e,t){aL(e.children,t)}function J$(e,t){sV(e,t),aL(e.children,t),aV(e,t)}function eV(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:qe.CHARACTER,chars:e.value,location:dh(e)};ql(t,ki(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function tV(e,t){const n={type:qe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:dh(e)};ql(t,ki(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function nV(e,t){t.stitches=!0;const n=lV(e);if("children"in e&&"children"in n){const r=sL({type:"root",children:e.children},t.options);n.children=r.children}oL({type:"comment",value:{stitch:n}},t)}function oL(e,t){const n=e.value,r={type:qe.COMMENT,data:n,location:dh(e)};ql(t,ki(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function rV(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,lL(t,ki(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Q$,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function iV(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))nV(n,t);else{let r="";throw X$.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function ql(e,t){lL(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ut.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function lL(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function sV(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ut.PLAINTEXT)return;ql(t,ki(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Ha.html;i===Ha.html&&n==="svg"&&(i=Ha.svg);const s=pz({...e,children:[]},{space:i===Ha.svg?"svg":"html"}),o={type:qe.START_TAG,tagName:n,tagID:Vl(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:dh(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function aV(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&ZA.includes(n)||t.parser.tokenizer.state===Ut.PLAINTEXT)return;ql(t,Jp(e));const r={type:qe.END_TAG,tagName:n,tagID:Vl(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:dh(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ut.RCDATA||t.parser.tokenizer.state===Ut.RAWTEXT||t.parser.tokenizer.state===Ut.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ut.DATA)}function oV(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function dh(e){const t=ki(e)||{line:void 0,column:void 0,offset:void 0},n=Jp(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function lV(e){return"children"in e?Xa({...e,children:[]}):Xa(e)}function uV(e){return function(t,n){return sL(t,{...e,file:n})}}const ka=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Z2={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...ka,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...ka],h2:[["className","sr-only"]],img:[...ka,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...ka,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...ka],table:[...ka],ul:[...ka,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Gs={}.hasOwnProperty;function cV(e,t){let n={type:"root",children:[]};const r={schema:t?{...Z2,...t}:Z2,stack:[]},i=uL(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function uL(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return hV(e,n);case"doctype":return dV(e,n);case"element":return fV(e,n);case"root":return pV(e,n);case"text":return mV(e,n)}}}function hV(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),s={type:"comment",value:r<0?n:n.slice(0,r)};return fh(s,t),s}}function dV(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return fh(n,t),n}}function fV(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=cL(e,t.children),i=gV(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&Gs.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let c=-1;for(s=!1;++c<u.length;)e.stack.includes(u[c])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:i,children:r};return fh(o,t),o}function pV(e,t){const r={type:"root",children:cL(e,t.children)};return fh(r,t),r}function mV(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return fh(r,t),r}function cL(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const s=uL(e,r[i]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function gV(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,s=r&&Gs.call(r,n)?r[n]:void 0,o=r&&Gs.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},c={};let d;for(d in u)if(Gs.call(u,d)){const p=u[d];let m=J2(e,eT(s,d),d,p);m==null&&(m=J2(e,eT(o,d),d,p)),m!=null&&(c[d]=m)}if(i&&Gs.call(i,n)){const p=i[n];for(d in p)Gs.call(p,d)&&!Gs.call(c,d)&&(c[d]=p[d])}return c}function J2(e,t,n,r){return t?Array.isArray(r)?_V(e,t,n,r):hL(e,t,n,r):void 0}function _V(e,t,n,r){let i=-1;const s=[];for(;++i<r.length;){const o=hL(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&s.push(o)}return s}function hL(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&bV(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,s=0;for(;++s<t.length;){const o=t[s];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){i=!0;break}}else if(o===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function bV(e,t,n){const r=e.schema.protocols&&Gs.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),s=i.indexOf(":"),o=i.indexOf("?"),u=i.indexOf("#"),c=i.indexOf("/");if(s<0||c>-1&&s>c||o>-1&&s>o||u>-1&&s>u)return!0;let d=-1;for(;++d<r.length;){const p=r[d];if(s===p.length&&i.slice(0,p.length)===p)return!0}return!1}function fh(e,t){const n=iL(t);t.data&&(e.data=Xa(t.data)),n&&(e.position=n)}function eT(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],s=typeof i=="string"?i:i[0];if(s===t)return i;s==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function vV(e){return function(t){return cV(t,e)}}const Un=oa(/[A-Za-z]/),Mn=oa(/[\dA-Za-z]/),yV=oa(/[#-'*+\--9=?A-Z^-~]/);function cp(e){return e!==null&&(e<32||e===127)}const n1=oa(/\d/),SV=oa(/[\dA-Fa-f]/),EV=oa(/[!-/:-@[-`{-~]/);function Le(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const em=oa(new RegExp("\\p{P}|\\p{S}","u")),Za=oa(/\s/);function oa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function xV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wV(e,t,n){const i=Wp((n||{}).ignore||[]),s=CV(t);let o=-1;for(;++o<s.length;)EN(e,"text",u);function u(d,p){let m=-1,g;for(;++m<p.length;){const _=p[m],v=g?g.children:void 0;if(i(_,v?v.indexOf(_):void 0,g))return;g=_}if(g)return c(d,p)}function c(d,p){const m=p[p.length-1],g=s[o][0],_=s[o][1];let v=0;const C=m.children.indexOf(d);let w=!1,A=[];g.lastIndex=0;let R=g.exec(d.value);for(;R;){const N=R.index,L={index:R.index,input:R.input,stack:[...p,d]};let I=_(...R,L);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?g.lastIndex=N+1:(v!==N&&A.push({type:"text",value:d.value.slice(v,N)}),Array.isArray(I)?A.push(...I):I&&A.push(I),v=N+R[0].length,w=!0),!g.global)break;R=g.exec(d.value)}return w?(v<d.value.length&&A.push({type:"text",value:d.value.slice(v)}),m.children.splice(C,1,...A)):A=[d],C+A.length}}function CV(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([TV(i[0]),kV(i[1])])}return t}function TV(e){return typeof e=="string"?new RegExp(xV(e),"g"):e}function kV(e){return typeof e=="function"?e:function(){return e}}const S_="phrasing",E_=["autolink","link","image","label"];function AV(){return{transforms:[IV],enter:{literalAutolink:NV,literalAutolinkEmail:x_,literalAutolinkHttp:x_,literalAutolinkWww:x_},exit:{literalAutolink:MV,literalAutolinkEmail:DV,literalAutolinkHttp:LV,literalAutolinkWww:OV}}}function RV(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:S_,notInConstruct:E_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:S_,notInConstruct:E_},{character:":",before:"[ps]",after:"\\/",inConstruct:S_,notInConstruct:E_}]}}function NV(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function x_(e){this.config.enter.autolinkProtocol.call(this,e)}function LV(e){this.config.exit.autolinkProtocol.call(this,e)}function OV(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function DV(e){this.config.exit.autolinkEmail.call(this,e)}function MV(e){this.exit(e)}function IV(e){wV(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,PV],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),BV]],{ignore:["link","linkReference"]})}function PV(e,t,n,r,i){let s="";if(!dL(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!HV(n)))return!1;const o=FV(n+r);if(!o[0])return!1;const u={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[u,{type:"text",value:o[1]}]:u}function BV(e,t,n,r){return!dL(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function HV(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 FV(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=Gf(e,"(");let s=Gf(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function dL(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Za(n)||em(n))&&(!t||n!==47)}function Jr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}fL.peek=YV;function jV(){this.buffer()}function zV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function UV(){this.buffer()}function $V(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function VV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qV(e){this.exit(e)}function WV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function GV(e){this.exit(e)}function YV(){return"["}function fL(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),u=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),u(),o(),s+=i.move("]"),s}function KV(){return{enter:{gfmFootnoteCallString:jV,gfmFootnoteCall:zV,gfmFootnoteDefinitionLabelString:UV,gfmFootnoteDefinition:$V},exit:{gfmFootnoteCallString:VV,gfmFootnoteCall:qV,gfmFootnoteDefinitionLabelString:WV,gfmFootnoteDefinition:GV}}}function QV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fL},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const u=s.createTracker(o);let c=u.move("[^");const d=s.enter("footnoteDefinition"),p=s.enter("label");return c+=u.move(s.safe(s.associationId(r),{before:c,after:"]"})),p(),c+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),c+=u.move((t?`
|
|
1334
1334
|
`:" ")+s.indentLines(s.containerFlow(r,u.current()),t?pL:XV))),d(),c}}function XV(e,t,n){return t===0?e:pL(e,t,n)}function pL(e,t,n){return(n?"":" ")+e}const ZV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mL.peek=rq;function JV(){return{canContainEols:["delete"],enter:{strikethrough:tq},exit:{strikethrough:nq}}}function eq(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ZV}],handlers:{delete:mL}}}function tq(e){this.enter({type:"delete",children:[]},e)}function nq(e){this.exit(e)}function mL(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function rq(){return"~"}function iq(e){return e.length}function sq(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||iq,s=[],o=[],u=[],c=[];let d=0,p=-1;for(;++p<e.length;){const x=[],C=[];let w=-1;for(e[p].length>d&&(d=e[p].length);++w<e[p].length;){const A=aq(e[p][w]);if(n.alignDelimiters!==!1){const R=i(A);C[w]=R,(c[w]===void 0||R>c[w])&&(c[w]=R)}x.push(A)}o[p]=x,u[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)s[m]=tT(r[m]);else{const x=tT(r);for(;++m<d;)s[m]=x}m=-1;const g=[],_=[];for(;++m<d;){const x=s[m];let C="",w="";x===99?(C=":",w=":"):x===108?C=":":x===114&&(w=":");let A=n.alignDelimiters===!1?1:Math.max(1,c[m]-C.length-w.length);const R=C+"-".repeat(A)+w;n.alignDelimiters!==!1&&(A=C.length+A+w.length,A>c[m]&&(c[m]=A),_[m]=A),g[m]=R}o.splice(1,0,g),u.splice(1,0,_),p=-1;const v=[];for(;++p<o.length;){const x=o[p],C=u[p];m=-1;const w=[];for(;++m<d;){const A=x[m]||"";let R="",N="";if(n.alignDelimiters!==!1){const L=c[m]-(C[m]||0),I=s[m];I===114?R=" ".repeat(L):I===99?L%2?(R=" ".repeat(L/2+.5),N=" ".repeat(L/2-.5)):(R=" ".repeat(L/2),N=R):N=" ".repeat(L)}n.delimiterStart!==!1&&!m&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||m)&&w.push(" "),n.alignDelimiters!==!1&&w.push(R),w.push(A),n.alignDelimiters!==!1&&w.push(N),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&w.push("|")}v.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return v.join(`
|
|
1335
1335
|
`)}function aq(e){return e==null?"":String(e)}function tT(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function oq(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),lq);return i(),o}function lq(e,t,n){return">"+(n?"":" ")+e}function uq(e,t){return nT(e,t.inConstruct,!0)&&!nT(e,t.notInConstruct,!1)}function nT(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function rT(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
@@ -1439,16 +1439,16 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
|
|
|
1439
1439
|
`||p==="\r"){c=!0;break}if(!c)return u;let d=[];for(let p of u)p===" "?d.push("\\t"):p===`
|
|
1440
1440
|
`?d.push("\\n"):p==="\r"?d.push("\\r"):d.push(p);return d.join("")},i=t.length>0?n.length+1:n.length,s=new Array(i),o=0;t.length>0&&(s[o]=t.map(r).join(" "),o+=1);for(let u of n)s[o]=u.map(r).join(" "),o+=1;return s.join(`
|
|
1441
1441
|
`)},F_=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},lJ=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,s=t.map(u=>F_(u));r[i]=`| ${s.join(" | ")} |`,i+=1;let o=new Array(t.length);for(let u=0;u<t.length;u+=1)o[u]="---";r[i]=`| ${o.join(" | ")} |`,i+=1;for(let u of n)if(u.length<t.length){let c=new Array(t.length);for(let d=0;d<t.length;d+=1)c[d]=d<u.length?F_(u[d]):"";r[i]=`| ${c.join(" | ")} |`,i+=1}else{let c=u.map(d=>F_(d));r[i]=`| ${c.join(" | ")} |`,i+=1}return r.join(`
|
|
1442
|
-
`)},uJ=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[s,o]=T.useState(!1),[u,c]=T.useState(!1),d=T.useRef(null),p=T.useRef(0),{isAnimating:m}=T.useContext(Wr),g=async v=>{var x,C;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){r?.(new Error("Clipboard API not available"));return}try{let w=(C=d.current)==null?void 0:C.closest('[data-streamdown="table-wrapper"]'),A=w?.querySelector("table");if(!A){r?.(new Error("Table not found"));return}let R=PO(A),N=v==="csv"?BO(R):oJ(R),L=new ClipboardItem({"text/plain":new Blob([N],{type:"text/plain"}),"text/html":new Blob([A.outerHTML],{type:"text/html"})});await navigator.clipboard.write([L]),c(!0),o(!1),n?.(v),p.current=window.setTimeout(()=>c(!1),i)}catch(w){r?.(w)}};T.useEffect(()=>{let v=x=>{let C=x.composedPath();d.current&&!C.includes(d.current)&&o(!1)};return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v),window.clearTimeout(p.current)}},[]);let _=u?by:vy;return S.jsxs("div",{className:"relative",ref:d,children:[S.jsx("button",{className:Ie("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:m,onClick:()=>o(!s),title:"Copy table",type:"button",children:e??S.jsx(_,{size:14})}),s?S.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[S.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>g("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),S.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>g("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},cJ=({children:e,className:t,onDownload:n,onError:r})=>{let[i,s]=T.useState(!1),o=T.useRef(null),{isAnimating:u}=T.useContext(Wr),c=d=>{var p;try{let m=(p=o.current)==null?void 0:p.closest('[data-streamdown="table-wrapper"]'),g=m?.querySelector("table");if(!g){r?.(new Error("Table not found"));return}let _=PO(g),v=d==="csv"?BO(_):lJ(_);yl(`table.${d==="csv"?"csv":"md"}`,v,d==="csv"?"text/csv":"text/markdown"),s(!1),n?.(d)}catch(m){r?.(m)}};return T.useEffect(()=>{let d=p=>{let m=p.composedPath();o.current&&!m.includes(o.current)&&s(!1)};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[]),S.jsxs("div",{className:"relative",ref:o,children:[S.jsx("button",{className:Ie("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>s(!i),title:"Download table",type:"button",children:e??S.jsx(sm,{size:14})}),i?S.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[S.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>c("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),S.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>c("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},hJ=({children:e,className:t,showControls:n,...r})=>S.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?S.jsxs("div",{className:"flex items-center justify-end gap-1",children:[S.jsx(uJ,{}),S.jsx(cJ,{})]}):null,S.jsx("div",{className:"overflow-x-auto",children:S.jsx("table",{className:Ie("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),dJ=T.lazy(()=>j(()=>import("./code-block-37QAKDTI-C97XC0lL.js"),[]).then(e=>({default:e.CodeBlock}))),fJ=T.lazy(()=>j(()=>Promise.resolve().then(()=>Dse),void 0).then(e=>({default:e.Mermaid}))),pJ=/language-([^\s]+)/;function am(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,s=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===s?.line&&i?.column===s?.column}function Mt(e,t){return e.className===t.className&&am(e.node,t.node)}var p1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,cf=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Sy=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("ol",{className:Ie("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>Mt(e,t));Sy.displayName="MarkdownOl";var HO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("li",{className:Ie("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&am(e.node,t.node));HO.displayName="MarkdownLi";var FO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("ul",{className:Ie("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>Mt(e,t));FO.displayName="MarkdownUl";var jO=T.memo(({className:e,node:t,...n})=>S.jsx("hr",{className:Ie("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>Mt(e,t));jO.displayName="MarkdownHr";var zO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("span",{className:Ie("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>Mt(e,t));zO.displayName="MarkdownStrong";var mJ=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:s}=T.useContext(Wr),[o,u]=T.useState(!1),c=n==="streamdown:incomplete-link",d=T.useCallback(async _=>{if(!(!(s!=null&&s.enabled&&n)||c)){if(_.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[s,n,c]),p=T.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),m=T.useCallback(()=>{u(!1)},[]),g={url:n??"",isOpen:o,onClose:m,onConfirm:p};return s!=null&&s.enabled&&n?S.jsxs(S.Fragment,{children:[S.jsx("button",{className:Ie("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":c,"data-streamdown":"link",onClick:d,type:"button",children:e}),s.renderModal?s.renderModal(g):S.jsx(tJ,{...g})]}):S.jsx("a",{className:Ie("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":c,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},UO=T.memo(mJ,(e,t)=>Mt(e,t)&&e.href===t.href);UO.displayName="MarkdownA";var $O=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h1",{className:Ie("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>Mt(e,t));$O.displayName="MarkdownH1";var VO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h2",{className:Ie("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>Mt(e,t));VO.displayName="MarkdownH2";var qO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h3",{className:Ie("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>Mt(e,t));qO.displayName="MarkdownH3";var WO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h4",{className:Ie("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>Mt(e,t));WO.displayName="MarkdownH4";var GO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h5",{className:Ie("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>Mt(e,t));GO.displayName="MarkdownH5";var YO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h6",{className:Ie("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>Mt(e,t));YO.displayName="MarkdownH6";var KO=T.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=T.useContext(Wr),s=p1(i,"table");return S.jsx(hJ,{className:t,showControls:s,...r,children:e})},(e,t)=>Mt(e,t));KO.displayName="MarkdownTable";var QO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("thead",{className:Ie("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>Mt(e,t));QO.displayName="MarkdownThead";var XO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("tbody",{className:Ie("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>Mt(e,t));XO.displayName="MarkdownTbody";var ZO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("tr",{className:Ie("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>Mt(e,t));ZO.displayName="MarkdownTr";var JO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("th",{className:Ie("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>Mt(e,t));JO.displayName="MarkdownTh";var e6=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("td",{className:Ie("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>Mt(e,t));e6.displayName="MarkdownTd";var t6=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("blockquote",{className:Ie("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>Mt(e,t));t6.displayName="MarkdownBlockquote";var n6=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("sup",{className:Ie("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>Mt(e,t));n6.displayName="MarkdownSup";var r6=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("sub",{className:Ie("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>Mt(e,t));r6.displayName="MarkdownSub";var i6=T.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=o=>{var u,c;if(!T.isValidElement(o))return!1;let d=Array.isArray(o.props.children)?o.props.children:[o.props.children],p=!1,m=!1;for(let g of d)if(g){if(typeof g=="string")g.trim()!==""&&(p=!0);else if(T.isValidElement(g))if(((u=g.props)==null?void 0:u["data-footnote-backref"])!==void 0)m=!0;else{let _=Array.isArray(g.props.children)?g.props.children:[g.props.children];for(let v of _){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(T.isValidElement(v)&&((c=v.props)==null?void 0:c["data-footnote-backref"])===void 0){p=!0;break}}}}return m&&!p},s=Array.isArray(e)?e.map(o=>{if(!T.isValidElement(o))return o;if(o.type===Sy){let u=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(c=>!i(c));return u.length===0?null:{...o,props:{...o.props,children:u}}}return o}):e;return(Array.isArray(s)?s.some(o=>o!==null):s!==null)?S.jsx("section",{className:t,...r,children:s}):null}return S.jsx("section",{className:t,...r,children:e})},(e,t)=>Mt(e,t));i6.displayName="MarkdownSection";var gJ=({node:e,className:t,children:n,...r})=>{var i,s,o;let u=((i=e?.position)==null?void 0:i.start.line)===((s=e?.position)==null?void 0:s.end.line),{mermaid:c,controls:d}=T.useContext(Wr),p=yy();if(u)return S.jsx("code",{className:Ie("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let m=t?.match(pJ),g=(o=m?.at(1))!=null?o:"",_="";if(T.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?_=n.props.children:typeof n=="string"&&(_=n),g==="mermaid"&&p){let x=p1(d,"mermaid"),C=cf(d,"download"),w=cf(d,"copy"),A=cf(d,"fullscreen"),R=cf(d,"panZoom"),N=x&&(C||w||A);return S.jsx(T.Suspense,{fallback:S.jsx(JT,{}),children:S.jsxs("div",{className:Ie("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[N?S.jsxs("div",{className:"flex items-center justify-end gap-2",children:[C?S.jsx(rJ,{chart:_,config:c?.config}):null,w?S.jsx(XT,{code:_}):null,A?S.jsx(aJ,{chart:_,config:c?.config}):null]}):null,S.jsx(fJ,{chart:_,config:c?.config,showControls:R})]})})}let v=p1(d,"code");return S.jsx(T.Suspense,{fallback:S.jsx(JT,{}),children:S.jsx(dJ,{className:Ie("overflow-x-auto border-border border-t",t),code:_,language:g,children:v?S.jsxs(S.Fragment,{children:[S.jsx(QZ,{code:_,language:g}),S.jsx(XT,{})]}):null})})},s6=T.memo(gJ,(e,t)=>e.className===t.className&&am(e.node,t.node));s6.displayName="MarkdownCode";var a6=T.memo(ZZ,(e,t)=>e.className===t.className&&am(e.node,t.node));a6.displayName="MarkdownImg";var o6=T.memo(({children:e,className:t,node:n,...r})=>{var i,s;let o=(Array.isArray(e)?e:[e]).filter(u=>u!=null&&u!=="");if(o.length===1&&T.isValidElement(o[0])){let u=o[0].props.node,c=u?.tagName;if(c==="img")return S.jsx(S.Fragment,{children:e});if(c==="code"&&((i=u?.position)==null?void 0:i.start.line)!==((s=u?.position)==null?void 0:s.end.line))return S.jsx(S.Fragment,{children:e})}return S.jsx("p",{className:t,...r,children:e})},(e,t)=>Mt(e,t));o6.displayName="MarkdownParagraph";var _J={ol:Sy,li:HO,ul:FO,hr:jO,strong:zO,a:UO,h1:$O,h2:VO,h3:qO,h4:WO,h5:GO,h6:YO,table:KO,thead:QO,tbody:XO,tr:ZO,th:JO,td:e6,blockquote:t6,code:s6,img:a6,pre:({children:e})=>e,sup:n6,sub:r6,p:o6,section:i6},ek=[],tk={allowDangerousHtml:!0},hf=new WeakMap,bJ=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(t){let n=this.keyCache.get(t);if(n)return n;let r=t.rehypePlugins,i=t.remarkPlugins,s=t.remarkRehypeOptions;if(!(r||i||s)){let m="default";return this.keyCache.set(t,m),m}let o=m=>{if(!m||m.length===0)return"";let g="";for(let _=0;_<m.length;_+=1){let v=m[_];if(_>0&&(g+=","),Array.isArray(v)){let[x,C]=v;if(typeof x=="function"){let w=hf.get(x);w||(w=x.name,hf.set(x,w)),g+=w}else g+=String(x);g+=":",g+=JSON.stringify(C)}else if(typeof v=="function"){let x=hf.get(v);x||(x=v.name,hf.set(v,x)),g+=x}else g+=String(v)}return g},u=o(r),c=o(i),d=s?JSON.stringify(s):"",p=`${c}::${u}::${d}`;return this.keyCache.set(t,p),p}get(t){let n=this.generateCacheKey(t),r=this.cache.get(n);return r&&(this.cache.delete(n),this.cache.set(n,r)),r}set(t,n){let r=this.generateCacheKey(t);if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;i&&this.cache.delete(i)}this.cache.set(r,n)}clear(){this.cache.clear()}},nk=new bJ,l6=e=>{let t=vJ(e),n=e.children||"";return SJ(t.runSync(t.parse(n),n),e)},vJ=e=>{let t=nk.get(e);if(t)return t;let n=yJ(e);return nk.set(e,n),n},yJ=e=>{let t=e.rehypePlugins||ek,n=e.remarkPlugins||ek,r=e.remarkRehypeOptions?{...tk,...e.remarkRehypeOptions}:tk;return JX().use(ZQ).use(n).use(MX,r).use(t)},SJ=(e,t)=>aQ(e,{Fragment:S.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0}),EJ=/\[\^[^\]\s]{1,200}\](?!:)/,xJ=/\[\^[^\]\s]{1,200}\]:/,wJ=/<\/(\w+)>/,CJ=/<(\w+)[\s>]/,j_=e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
1442
|
+
`)},uJ=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[s,o]=T.useState(!1),[u,c]=T.useState(!1),d=T.useRef(null),p=T.useRef(0),{isAnimating:m}=T.useContext(Wr),g=async v=>{var x,C;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){r?.(new Error("Clipboard API not available"));return}try{let w=(C=d.current)==null?void 0:C.closest('[data-streamdown="table-wrapper"]'),A=w?.querySelector("table");if(!A){r?.(new Error("Table not found"));return}let R=PO(A),N=v==="csv"?BO(R):oJ(R),L=new ClipboardItem({"text/plain":new Blob([N],{type:"text/plain"}),"text/html":new Blob([A.outerHTML],{type:"text/html"})});await navigator.clipboard.write([L]),c(!0),o(!1),n?.(v),p.current=window.setTimeout(()=>c(!1),i)}catch(w){r?.(w)}};T.useEffect(()=>{let v=x=>{let C=x.composedPath();d.current&&!C.includes(d.current)&&o(!1)};return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v),window.clearTimeout(p.current)}},[]);let _=u?by:vy;return S.jsxs("div",{className:"relative",ref:d,children:[S.jsx("button",{className:Ie("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:m,onClick:()=>o(!s),title:"Copy table",type:"button",children:e??S.jsx(_,{size:14})}),s?S.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[S.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>g("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),S.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>g("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},cJ=({children:e,className:t,onDownload:n,onError:r})=>{let[i,s]=T.useState(!1),o=T.useRef(null),{isAnimating:u}=T.useContext(Wr),c=d=>{var p;try{let m=(p=o.current)==null?void 0:p.closest('[data-streamdown="table-wrapper"]'),g=m?.querySelector("table");if(!g){r?.(new Error("Table not found"));return}let _=PO(g),v=d==="csv"?BO(_):lJ(_);yl(`table.${d==="csv"?"csv":"md"}`,v,d==="csv"?"text/csv":"text/markdown"),s(!1),n?.(d)}catch(m){r?.(m)}};return T.useEffect(()=>{let d=p=>{let m=p.composedPath();o.current&&!m.includes(o.current)&&s(!1)};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[]),S.jsxs("div",{className:"relative",ref:o,children:[S.jsx("button",{className:Ie("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>s(!i),title:"Download table",type:"button",children:e??S.jsx(sm,{size:14})}),i?S.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[S.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>c("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),S.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>c("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},hJ=({children:e,className:t,showControls:n,...r})=>S.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?S.jsxs("div",{className:"flex items-center justify-end gap-1",children:[S.jsx(uJ,{}),S.jsx(cJ,{})]}):null,S.jsx("div",{className:"overflow-x-auto",children:S.jsx("table",{className:Ie("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),dJ=T.lazy(()=>j(()=>import("./code-block-37QAKDTI-yDNOZoY4.js"),[]).then(e=>({default:e.CodeBlock}))),fJ=T.lazy(()=>j(()=>Promise.resolve().then(()=>Dse),void 0).then(e=>({default:e.Mermaid}))),pJ=/language-([^\s]+)/;function am(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,s=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===s?.line&&i?.column===s?.column}function Mt(e,t){return e.className===t.className&&am(e.node,t.node)}var p1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,cf=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Sy=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("ol",{className:Ie("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>Mt(e,t));Sy.displayName="MarkdownOl";var HO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("li",{className:Ie("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&am(e.node,t.node));HO.displayName="MarkdownLi";var FO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("ul",{className:Ie("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>Mt(e,t));FO.displayName="MarkdownUl";var jO=T.memo(({className:e,node:t,...n})=>S.jsx("hr",{className:Ie("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>Mt(e,t));jO.displayName="MarkdownHr";var zO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("span",{className:Ie("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>Mt(e,t));zO.displayName="MarkdownStrong";var mJ=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:s}=T.useContext(Wr),[o,u]=T.useState(!1),c=n==="streamdown:incomplete-link",d=T.useCallback(async _=>{if(!(!(s!=null&&s.enabled&&n)||c)){if(_.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[s,n,c]),p=T.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),m=T.useCallback(()=>{u(!1)},[]),g={url:n??"",isOpen:o,onClose:m,onConfirm:p};return s!=null&&s.enabled&&n?S.jsxs(S.Fragment,{children:[S.jsx("button",{className:Ie("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":c,"data-streamdown":"link",onClick:d,type:"button",children:e}),s.renderModal?s.renderModal(g):S.jsx(tJ,{...g})]}):S.jsx("a",{className:Ie("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":c,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},UO=T.memo(mJ,(e,t)=>Mt(e,t)&&e.href===t.href);UO.displayName="MarkdownA";var $O=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h1",{className:Ie("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>Mt(e,t));$O.displayName="MarkdownH1";var VO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h2",{className:Ie("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>Mt(e,t));VO.displayName="MarkdownH2";var qO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h3",{className:Ie("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>Mt(e,t));qO.displayName="MarkdownH3";var WO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h4",{className:Ie("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>Mt(e,t));WO.displayName="MarkdownH4";var GO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h5",{className:Ie("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>Mt(e,t));GO.displayName="MarkdownH5";var YO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("h6",{className:Ie("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>Mt(e,t));YO.displayName="MarkdownH6";var KO=T.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=T.useContext(Wr),s=p1(i,"table");return S.jsx(hJ,{className:t,showControls:s,...r,children:e})},(e,t)=>Mt(e,t));KO.displayName="MarkdownTable";var QO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("thead",{className:Ie("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>Mt(e,t));QO.displayName="MarkdownThead";var XO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("tbody",{className:Ie("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>Mt(e,t));XO.displayName="MarkdownTbody";var ZO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("tr",{className:Ie("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>Mt(e,t));ZO.displayName="MarkdownTr";var JO=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("th",{className:Ie("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>Mt(e,t));JO.displayName="MarkdownTh";var e6=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("td",{className:Ie("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>Mt(e,t));e6.displayName="MarkdownTd";var t6=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("blockquote",{className:Ie("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>Mt(e,t));t6.displayName="MarkdownBlockquote";var n6=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("sup",{className:Ie("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>Mt(e,t));n6.displayName="MarkdownSup";var r6=T.memo(({children:e,className:t,node:n,...r})=>S.jsx("sub",{className:Ie("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>Mt(e,t));r6.displayName="MarkdownSub";var i6=T.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=o=>{var u,c;if(!T.isValidElement(o))return!1;let d=Array.isArray(o.props.children)?o.props.children:[o.props.children],p=!1,m=!1;for(let g of d)if(g){if(typeof g=="string")g.trim()!==""&&(p=!0);else if(T.isValidElement(g))if(((u=g.props)==null?void 0:u["data-footnote-backref"])!==void 0)m=!0;else{let _=Array.isArray(g.props.children)?g.props.children:[g.props.children];for(let v of _){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(T.isValidElement(v)&&((c=v.props)==null?void 0:c["data-footnote-backref"])===void 0){p=!0;break}}}}return m&&!p},s=Array.isArray(e)?e.map(o=>{if(!T.isValidElement(o))return o;if(o.type===Sy){let u=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(c=>!i(c));return u.length===0?null:{...o,props:{...o.props,children:u}}}return o}):e;return(Array.isArray(s)?s.some(o=>o!==null):s!==null)?S.jsx("section",{className:t,...r,children:s}):null}return S.jsx("section",{className:t,...r,children:e})},(e,t)=>Mt(e,t));i6.displayName="MarkdownSection";var gJ=({node:e,className:t,children:n,...r})=>{var i,s,o;let u=((i=e?.position)==null?void 0:i.start.line)===((s=e?.position)==null?void 0:s.end.line),{mermaid:c,controls:d}=T.useContext(Wr),p=yy();if(u)return S.jsx("code",{className:Ie("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let m=t?.match(pJ),g=(o=m?.at(1))!=null?o:"",_="";if(T.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?_=n.props.children:typeof n=="string"&&(_=n),g==="mermaid"&&p){let x=p1(d,"mermaid"),C=cf(d,"download"),w=cf(d,"copy"),A=cf(d,"fullscreen"),R=cf(d,"panZoom"),N=x&&(C||w||A);return S.jsx(T.Suspense,{fallback:S.jsx(JT,{}),children:S.jsxs("div",{className:Ie("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[N?S.jsxs("div",{className:"flex items-center justify-end gap-2",children:[C?S.jsx(rJ,{chart:_,config:c?.config}):null,w?S.jsx(XT,{code:_}):null,A?S.jsx(aJ,{chart:_,config:c?.config}):null]}):null,S.jsx(fJ,{chart:_,config:c?.config,showControls:R})]})})}let v=p1(d,"code");return S.jsx(T.Suspense,{fallback:S.jsx(JT,{}),children:S.jsx(dJ,{className:Ie("overflow-x-auto border-border border-t",t),code:_,language:g,children:v?S.jsxs(S.Fragment,{children:[S.jsx(QZ,{code:_,language:g}),S.jsx(XT,{})]}):null})})},s6=T.memo(gJ,(e,t)=>e.className===t.className&&am(e.node,t.node));s6.displayName="MarkdownCode";var a6=T.memo(ZZ,(e,t)=>e.className===t.className&&am(e.node,t.node));a6.displayName="MarkdownImg";var o6=T.memo(({children:e,className:t,node:n,...r})=>{var i,s;let o=(Array.isArray(e)?e:[e]).filter(u=>u!=null&&u!=="");if(o.length===1&&T.isValidElement(o[0])){let u=o[0].props.node,c=u?.tagName;if(c==="img")return S.jsx(S.Fragment,{children:e});if(c==="code"&&((i=u?.position)==null?void 0:i.start.line)!==((s=u?.position)==null?void 0:s.end.line))return S.jsx(S.Fragment,{children:e})}return S.jsx("p",{className:t,...r,children:e})},(e,t)=>Mt(e,t));o6.displayName="MarkdownParagraph";var _J={ol:Sy,li:HO,ul:FO,hr:jO,strong:zO,a:UO,h1:$O,h2:VO,h3:qO,h4:WO,h5:GO,h6:YO,table:KO,thead:QO,tbody:XO,tr:ZO,th:JO,td:e6,blockquote:t6,code:s6,img:a6,pre:({children:e})=>e,sup:n6,sub:r6,p:o6,section:i6},ek=[],tk={allowDangerousHtml:!0},hf=new WeakMap,bJ=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(t){let n=this.keyCache.get(t);if(n)return n;let r=t.rehypePlugins,i=t.remarkPlugins,s=t.remarkRehypeOptions;if(!(r||i||s)){let m="default";return this.keyCache.set(t,m),m}let o=m=>{if(!m||m.length===0)return"";let g="";for(let _=0;_<m.length;_+=1){let v=m[_];if(_>0&&(g+=","),Array.isArray(v)){let[x,C]=v;if(typeof x=="function"){let w=hf.get(x);w||(w=x.name,hf.set(x,w)),g+=w}else g+=String(x);g+=":",g+=JSON.stringify(C)}else if(typeof v=="function"){let x=hf.get(v);x||(x=v.name,hf.set(v,x)),g+=x}else g+=String(v)}return g},u=o(r),c=o(i),d=s?JSON.stringify(s):"",p=`${c}::${u}::${d}`;return this.keyCache.set(t,p),p}get(t){let n=this.generateCacheKey(t),r=this.cache.get(n);return r&&(this.cache.delete(n),this.cache.set(n,r)),r}set(t,n){let r=this.generateCacheKey(t);if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;i&&this.cache.delete(i)}this.cache.set(r,n)}clear(){this.cache.clear()}},nk=new bJ,l6=e=>{let t=vJ(e),n=e.children||"";return SJ(t.runSync(t.parse(n),n),e)},vJ=e=>{let t=nk.get(e);if(t)return t;let n=yJ(e);return nk.set(e,n),n},yJ=e=>{let t=e.rehypePlugins||ek,n=e.remarkPlugins||ek,r=e.remarkRehypeOptions?{...tk,...e.remarkRehypeOptions}:tk;return JX().use(ZQ).use(n).use(MX,r).use(t)},SJ=(e,t)=>aQ(e,{Fragment:S.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0}),EJ=/\[\^[^\]\s]{1,200}\](?!:)/,xJ=/\[\^[^\]\s]{1,200}\]:/,wJ=/<\/(\w+)>/,CJ=/<(\w+)[\s>]/,j_=e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
1443
1443
|
`||e[t]==="\r");)t+=1;return t+1<e.length&&e[t]==="$"&&e[t+1]==="$"},TJ=e=>{let t=e.length-1;for(;t>=0&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
1444
|
-
`||e[t]==="\r");)t-=1;return t>=1&&e[t]==="$"&&e[t-1]==="$"},z_=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},kJ=e=>{let t=EJ.test(e),n=xJ.test(e);if(t||n)return[e];let r=Ur.lex(e,{gfm:!0}),i=[],s=[];for(let o of r){let u=o.raw,c=i.length;if(s.length>0){if(i[c-1]+=u,o.type==="html"){let d=u.match(wJ);if(d){let p=d[1];s.at(-1)===p&&s.pop()}}continue}if(o.type==="html"&&o.block){let d=u.match(CJ);if(d){let p=d[1];u.includes(`</${p}>`)||s.push(p)}}if(u.trim()==="$$"&&c>0){let d=i[c-1],p=j_(d),m=z_(d);if(p&&m%2===1){i[c-1]=d+u;continue}}if(c>0&&TJ(u)){let d=i[c-1],p=j_(d),m=z_(d),g=z_(u);if(p&&m%2===1&&!j_(u)&&g===1){i[c-1]=d+u;continue}}i.push(u)}return i},AJ={raw:uV,sanitize:[vV,{}],harden:[Vj,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},RJ={gfm:[JG,{}]},NJ=Object.values(AJ),LJ=Object.values(RJ),OJ={block:" ▋",circle:" ●"},DJ={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Wr=T.createContext(DJ),u6=T.memo(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>S.jsx(l6,{...r,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var s,o;return((s=e.components)==null?void 0:s[i])!==((o=t.components)==null?void 0:o[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});u6.displayName="Block";var MJ=["github-light","github-dark"],c6=T.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=NJ,remarkPlugins:s=LJ,className:o,shikiTheme:u=MJ,mermaid:c,controls:d=!0,isAnimating:p=!1,BlockComponent:m=u6,parseMarkdownIntoBlocksFn:g=kJ,caret:_,plugins:v,remend:x,linkSafety:C={enabled:!0},...w})=>{let A=T.useId(),[R,N]=T.useTransition(),L=T.useMemo(()=>typeof e!="string"?"":t==="streaming"&&n?rK(e,x):e,[e,t,n,x]),I=T.useMemo(()=>g(L),[L,g]),[P,q]=T.useState(I);T.useEffect(()=>{t==="streaming"?N(()=>{q(I)}):q(I)},[I,t]);let ee=t==="streaming"?P:I,F=T.useMemo(()=>ee.map((M,Q)=>`${A}-${Q}`),[ee.length,A]),J=T.useMemo(()=>{var M,Q;return{shikiTheme:(Q=(M=v?.code)==null?void 0:M.getThemes())!=null?Q:u,controls:d,isAnimating:p,mode:t,mermaid:c,linkSafety:C}},[u,d,p,t,c,C,v?.code]),B=T.useMemo(()=>({..._J,...r}),[r]),V=T.useMemo(()=>{let M=[];return v!=null&&v.cjk&&(M=[...M,...v.cjk.remarkPluginsBefore]),M=[...M,...s],v!=null&&v.cjk&&(M=[...M,...v.cjk.remarkPluginsAfter]),v!=null&&v.math&&(M=[...M,v.math.remarkPlugin]),M},[s,v?.math,v?.cjk]),Y=T.useMemo(()=>v!=null&&v.math?[...i,v.math.rehypePlugin]:i,[i,v?.math]),X=T.useMemo(()=>_&&p?{"--streamdown-caret":`"${OJ[_]}"`}:void 0,[_,p]);return t==="static"?S.jsx(f1.Provider,{value:v??null,children:S.jsx(Wr.Provider,{value:J,children:S.jsx("div",{className:Ie("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",o),children:S.jsx(l6,{components:B,rehypePlugins:Y,remarkPlugins:V,...w,children:e})})})}):S.jsx(f1.Provider,{value:v??null,children:S.jsx(Wr.Provider,{value:J,children:S.jsxs("div",{className:Ie("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",_?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,o),style:X,children:[ee.length===0&&_&&p&&S.jsx("span",{}),ee.map((M,Q)=>S.jsx(m,{components:B,content:M,index:Q,rehypePlugins:Y,remarkPlugins:V,shouldParseIncompleteMarkdown:n,...w},F[Q]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);c6.displayName="Streamdown";var IJ=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:s=!0,initialZoom:o=1,fullscreen:u=!1})=>{let c=T.useRef(null),d=T.useRef(null),[p,m]=T.useState(o),[g,_]=T.useState({x:0,y:0}),[v,x]=T.useState(!1),[C,w]=T.useState({x:0,y:0}),[A,R]=T.useState({x:0,y:0}),N=T.useCallback(B=>{m(V=>Math.max(n,Math.min(r,V+B)))},[n,r]),L=T.useCallback(()=>{N(i)},[N,i]),I=T.useCallback(()=>{N(-i)},[N,i]),P=T.useCallback(()=>{m(o),_({x:0,y:0})},[o]),q=T.useCallback(B=>{B.preventDefault();let V=B.deltaY>0?-i:i;N(V)},[N,i]),ee=T.useCallback(B=>{if(B.button!==0||B.isPrimary===!1)return;x(!0),w({x:B.clientX,y:B.clientY}),R(g);let V=B.currentTarget;V instanceof HTMLElement&&V.setPointerCapture(B.pointerId)},[g]),F=T.useCallback(B=>{if(!v)return;B.preventDefault();let V=B.clientX-C.x,Y=B.clientY-C.y;_({x:A.x+V,y:A.y+Y})},[v,C,A]),J=T.useCallback(B=>{x(!1);let V=B.currentTarget;V instanceof HTMLElement&&V.releasePointerCapture(B.pointerId)},[]);return T.useEffect(()=>{let B=c.current;if(B)return B.addEventListener("wheel",q,{passive:!1}),()=>{B.removeEventListener("wheel",q)}},[q]),T.useEffect(()=>{let B=d.current;if(B&&v)return document.body.style.userSelect="none",B.addEventListener("pointermove",F,{passive:!1}),B.addEventListener("pointerup",J),B.addEventListener("pointercancel",J),()=>{document.body.style.userSelect="",B.removeEventListener("pointermove",F),B.removeEventListener("pointerup",J),B.removeEventListener("pointercancel",J)}},[v,F,J]),S.jsxs("div",{className:Ie("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:c,style:{cursor:v?"grabbing":"grab"},children:[s?S.jsxs("div",{className:Ie("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",u?"bottom-4 left-4":"bottom-2 left-2"),children:[S.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:p>=r,onClick:L,title:"Zoom in",type:"button",children:S.jsx(GZ,{size:16})}),S.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:p<=n,onClick:I,title:"Zoom out",type:"button",children:S.jsx(YZ,{size:16})}),S.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:P,title:"Reset zoom and pan",type:"button",children:S.jsx(WZ,{size:16})})]}):null,S.jsx("div",{className:Ie("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:ee,ref:d,role:"application",style:{transform:`translate(${g.x}px, ${g.y}px) scale(${p})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},h6=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[s,o]=T.useState(null),[u,c]=T.useState(!1),[d,p]=T.useState(""),[m,g]=T.useState(""),[_,v]=T.useState(0),{mermaid:x}=T.useContext(Wr),C=yy(),w=x?.errorComponent,{shouldRender:A,containerRef:R}=$Z({immediate:r});if(T.useEffect(()=>{if(A){if(!C){o("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{o(null),c(!0);let L=C.getMermaid(n),I=e.split("").reduce((ee,F)=>(ee<<5)-ee+F.charCodeAt(0)|0,0),P=`mermaid-${Math.abs(I)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:q}=await L.render(P,e);p(q),g(q)}catch(L){if(!(m||d)){let I=L instanceof Error?L.message:"Failed to render Mermaid chart";o(I)}}finally{c(!1)}})()}},[e,n,_,A,C]),!(A||d||m))return S.jsx("div",{className:Ie("my-4 min-h-[200px]",t),ref:R});if(u&&!d&&!m)return S.jsx("div",{className:Ie("my-4 flex justify-center p-4",t),ref:R,children:S.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[S.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),S.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(s&&!d&&!m){let L=()=>v(I=>I+1);return w?S.jsx("div",{ref:R,children:S.jsx(w,{chart:e,error:s,retry:L})}):S.jsxs("div",{className:Ie("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:R,children:[S.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",s]}),S.jsxs("details",{className:"mt-2",children:[S.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),S.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let N=d||m;return S.jsx("div",{className:Ie("size-full",t),"data-streamdown":"mermaid",ref:R,children:S.jsx(IJ,{className:Ie(r?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:S.jsx("div",{"aria-label":"Mermaid chart",className:Ie("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:N},role:"img"})})})};const PJ=T.memo(({projectPath:e,issueNumber:t})=>{const n=ro(c=>c.addAttachedIssue),r=Rn(c=>c.setToolPanelVisible),i=Rn(c=>c.setToolPanelTab),s=Vn({queryKey:["issue-detail",e,t],queryFn:()=>Tt(`/api/projects/issues/${t}?project=${encodeURIComponent(e)}`),enabled:!!(e&&t)}),o=s.data,u=T.useCallback(()=>{o&&(n({number:o.number,title:o.title,body:o.body,url:o.url}),r(!0),i("agent"))},[o,n,r,i]);return s.isLoading?S.jsx("div",{className:"text-sm text-base-content/70 p-4",children:"Loading..."}):o?S.jsxs("div",{className:"p-4 space-y-3",children:[S.jsxs("div",{className:"flex items-start justify-between gap-2",children:[S.jsxs("h3",{className:"font-semibold text-sm leading-tight",children:["#",o.number," ",o.title]}),S.jsxs("div",{className:"flex gap-1 shrink-0",children:[S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",title:"Attach to Agent",onClick:u,"data-testid":"issue-preview-attach",children:S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5",children:S.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),S.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"btn btn-ghost btn-xs",title:"Open in GitHub",children:"↗"})]})]}),S.jsxs("div",{className:"flex items-center gap-2 text-xs text-base-content/60 flex-wrap",children:[S.jsx("span",{className:`badge badge-sm ${o.state==="open"?"badge-success":"badge-neutral"}`,children:o.state}),o.author&&S.jsxs("span",{children:["@",o.author]}),S.jsx("span",{children:sh(o.createdAt)})]}),o.labels.length>0&&S.jsx("div",{className:"flex flex-wrap gap-1",children:o.labels.map(c=>S.jsx("span",{className:"badge badge-sm",style:{backgroundColor:`#${c.color}`,color:SR(c.color)},children:c.name},c.name))}),o.body&&S.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:S.jsx(c6,{children:o.body})}),o.commentsCount>0&&S.jsxs("div",{className:"text-xs text-base-content/60",children:[o.commentsCount," comment",o.commentsCount>1?"s":""]})]}):S.jsx("div",{className:"text-sm text-base-content/70 p-4",children:"Issue not found"})}),BJ=T.memo(({projectPath:e,hasGit:t,hasGithub:n})=>{const[r,i]=T.useState(""),[s,o]=T.useState(null),u=Jc({queryKey:["issues",e,r],queryFn:async({pageParam:C})=>{const w=new URLSearchParams({project:e});return C&&w.set("cursor",C),r.trim()&&w.set("search",r.trim()),Tt(`/api/projects/issues?${w.toString()}`)},initialPageParam:null,getNextPageParam:C=>{if(!(!C||!C.hasMore))return C.nextCursor??void 0},enabled:!!(e&&t&&n)}),c=T.useMemo(()=>u.data?u.data.pages.flatMap(C=>C.items):[],[u.data]),d=u.hasNextPage,p=u.isLoading,m=u.isFetchingNextPage,g=u.data?.pages[0]?.available??!0,_=u.data?.pages[0]?.error,v=T.useCallback(()=>{d&&!m&&u.fetchNextPage()},[d,m,u]),x=C=>S.jsx("li",{className:"w-full",children:S.jsx("button",{type:"button",className:`w-full px-2 text-left ${s===C.number?"active":""}`,title:C.title,onClick:()=>o(s===C.number?null:C.number),"data-testid":"branch-dropdown-issue","data-issue-number":C.number,children:S.jsxs("div",{className:"flex flex-col gap-1 w-full min-w-0",children:[S.jsx("span",{className:"block truncate font-medium",children:`#${C.number} ${C.title}`}),S.jsxs("div",{className:"flex items-center gap-2 text-xs text-base-content/60 flex-wrap",children:[C.author&&S.jsxs("span",{children:["@",C.author]}),S.jsx("span",{children:sh(C.updatedAt)}),C.labels.slice(0,3).map(w=>S.jsx("span",{className:"badge badge-xs",style:{backgroundColor:`#${w.color}`,color:SR(w.color)},children:w.name},w.name))]})]})})},C.number);return S.jsxs("div",{className:"mt-3 relative","data-testid":"branch-dropdown-issues-panel",children:[S.jsx("div",{className:"flex items-center gap-2","data-testid":"branch-dropdown-issue-filter-row",children:S.jsx("input",{className:"input input-bordered input-sm w-full",placeholder:"Search issues",value:r,onChange:C=>i(C.target.value),"data-testid":"branch-dropdown-issue-filter"})}),S.jsx("div",{className:"mt-3 overflow-auto max-h-[50vh]","data-testid":"branch-dropdown-issues",children:p?S.jsx("div",{className:"rounded-box text-sm text-base-content/70",children:"Loading issues..."}):g?S.jsxs(S.Fragment,{children:[S.jsx("ul",{className:"menu p-0 rounded-box w-full","data-testid":"branch-dropdown-issue-list",children:c.length?c.map(x):S.jsx("li",{className:"disabled",children:S.jsx("span",{children:"No issues"})})}),d&&S.jsx("button",{type:"button",className:"btn btn-ghost btn-sm w-full mt-2",onClick:v,disabled:m,"data-testid":"branch-dropdown-issue-load-more",children:m?"Loading...":"Load More"})]}):S.jsx("div",{className:"rounded-box text-sm text-error/80",children:_||"Failed to load issues"})}),s&&S.jsx("div",{className:"absolute left-full top-0 ml-6 w-120 h-full min-h-80 max-h-[50vh] overflow-auto rounded-box bg-base-100 shadow-lg border border-base-300","data-testid":"branch-dropdown-issue-preview",children:S.jsx(PJ,{projectPath:e,issueNumber:s})})]})}),HJ=T.memo(({projectPath:e,hasGit:t,hasGithub:n})=>{const[r,i]=T.useState(""),s=Jc({queryKey:["pull-requests",e,r],queryFn:async({pageParam:v})=>{const x=new URLSearchParams({project:e});return v&&x.set("cursor",v),r.trim()&&x.set("search",r.trim()),Tt(`/api/projects/pull-requests?${x.toString()}`)},initialPageParam:null,getNextPageParam:v=>{if(!(!v||!v.hasMore))return v.nextCursor??void 0},enabled:!!(e&&t&&n)}),o=T.useMemo(()=>s.data?s.data.pages.flatMap(v=>v.items):[],[s.data]),u=s.hasNextPage,c=s.isLoading,d=s.isFetchingNextPage,p=s.data?.pages[0]?.available??!0,m=s.data?.pages[0]?.error,g=T.useCallback(()=>{u&&!d&&s.fetchNextPage()},[u,d,s]),_=v=>S.jsx("li",{className:"w-full",children:S.jsx("a",{href:v.url,target:"_blank",rel:"noopener noreferrer",className:"w-full px-2",title:v.title,"data-testid":"branch-dropdown-pr","data-pr-number":v.number,children:S.jsxs("div",{className:"flex flex-col gap-1 w-full min-w-0",children:[S.jsx("span",{className:"block truncate font-medium",children:`#${v.number} ${v.title}`}),S.jsxs("span",{className:"text-xs text-base-content/60",children:[v.author&&S.jsxs("span",{className:"mr-2",children:["@",v.author]}),sh(v.updatedAt)]})]})})},v.number);return S.jsxs("div",{className:"mt-3",children:[S.jsx("div",{className:"flex items-center gap-2","data-testid":"branch-dropdown-pr-filter-row",children:S.jsx("input",{className:"input input-bordered input-sm w-full",placeholder:"Search pull requests",value:r,onChange:v=>i(v.target.value),"data-testid":"branch-dropdown-pr-filter"})}),S.jsx("div",{className:"mt-3 overflow-auto max-h-[50vh]","data-testid":"branch-dropdown-prs",children:c?S.jsx("div",{className:"rounded-box text-sm text-base-content/70",children:"Loading pull requests..."}):p?S.jsxs(S.Fragment,{children:[S.jsx("ul",{className:"menu p-0 rounded-box w-full","data-testid":"branch-dropdown-pr-list",children:o.length?o.map(_):S.jsx("li",{className:"disabled",children:S.jsx("span",{children:"No pull requests"})})}),u&&S.jsx("button",{type:"button",className:"btn btn-ghost btn-sm w-full mt-2",onClick:g,disabled:d,"data-testid":"branch-dropdown-pr-load-more",children:d?"Loading...":"Load More"})]}):S.jsx("div",{className:"rounded-box text-sm text-error/80",children:m||"Failed to load pull requests"})})]})}),FJ=T.memo(({hasGit:e,hasGithub:t,capabilitiesLoading:n,onDropdownToggle:r})=>{const[i,s]=T.useState(!1),{projectPath:o,branchTab:u,setBranchTab:c}=Rn(an(v=>({projectPath:v.projectPath,branchTab:v.branchTab,setBranchTab:v.setBranchTab}))),{currentBranch:d,branchesLoading:p}=ER(o,e),m=v=>{v&&(!o||!e)||(s(v),r?.(v))},g=v=>{c(v)},_=()=>{s(!1)};return S.jsxs($p,{open:i,onOpenChange:m,children:[S.jsx(Vp,{asChild:!0,children:S.jsx("button",{type:"button",tabIndex:0,className:"btn btn-ghost justify-between",disabled:!o||n||!e,"data-testid":"branch-dropdown-trigger",children:S.jsxs("div",{className:"flex flex-col items-start",children:[S.jsx("span",{className:"text-xs text-gray-400",children:"Current branch"}),S.jsx("span",{className:"truncate",children:o?n||p?"Loading...":e?d||"—":"No git repository":"No project"})]})})}),S.jsx(qp,{align:"start",className:"w-fit rounded-box bg-base-100 p-3 shadow","data-testid":"branch-dropdown-content",children:S.jsx("div",{className:"flex gap-3",children:S.jsxs("div",{className:"w-96",children:[S.jsxs("div",{className:"tabs","data-testid":"branch-dropdown-tabs",children:[S.jsx("button",{type:"button",className:`tab ${u==="branches"?"tab-active font-semibold":""}`,onClick:()=>g("branches"),"data-testid":"branch-dropdown-tab-branches",children:"Branches"}),S.jsx("button",{type:"button",className:`tab ${u==="prs"?"tab-active font-semibold":""}`,onClick:()=>g("prs"),disabled:!t,"data-testid":"branch-dropdown-tab-prs",children:"Pull Requests"}),S.jsx("button",{type:"button",className:`tab ${u==="issues"?"tab-active font-semibold":""}`,onClick:()=>g("issues"),disabled:!t,"data-testid":"branch-dropdown-tab-issues",children:"Issues"})]}),u==="branches"&&S.jsx(Bj,{projectPath:o,hasGit:e,onClose:_}),u==="prs"&&S.jsx(HJ,{projectPath:o,hasGit:e,hasGithub:t}),u==="issues"&&S.jsx(BJ,{projectPath:o,hasGit:e,hasGithub:t})]})})})]})}),jJ=()=>typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(16).slice(2)}`;class zJ{#e=null;#t="connecting";#n=new Set;#i=new Set;#r=new Map;#s=null;#o=0;connect(){if(this.#e)return;const t=window.location.origin,n=new URL("/api/events",t);n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:");const r=n.toString();this.#a("connecting");const i=new WebSocket(r);this.#e=i,i.onopen=()=>{this.#o=0,this.#a("connected")},i.onmessage=s=>{if(typeof s.data=="string")try{const o=JSON.parse(s.data);if(typeof o.event!="string")return;this.#d(o.event,o.payload)}catch(o){console.error("Failed to parse WebSocket payload",o)}},i.onerror=()=>{i.readyState===WebSocket.OPEN&&i.close()},i.onclose=()=>{this.#e===i&&(this.#e=null),this.#c("connection_closed"),this.#a("disconnected"),this.#u()}}subscribe(t){return this.#n.add(t),()=>{this.#n.delete(t)}}subscribeState(t){return this.#i.add(t),t(this.#t),()=>{this.#i.delete(t)}}getConnectionState(){return this.#t}sendCommand(t,n){return new Promise((r,i)=>{const s=this.#e;if(!s||s.readyState!==WebSocket.OPEN){i(new Error("ws_not_connected"));return}const o=jJ(),u=setTimeout(()=>{this.#r.delete(o),i(new Error("command_timeout"))},3e4);this.#r.set(o,{resolve:c=>r(c),reject:c=>i(c),timeout:u}),s.send(JSON.stringify({type:t,payload:n,requestId:o}))})}#a(t){if(this.#t!==t){this.#t=t;for(const n of this.#i)n(t)}}#d(t,n){if(t==="ping"){this.#e?.readyState===WebSocket.OPEN&&this.#e.send(JSON.stringify({type:"pong"}));return}if(t==="command_ack"){const r=n;r&&typeof r.requestId=="string"&&this.#l(r.requestId,r.result??null,!1);return}if(t==="command_error"){const r=n;if(r&&typeof r.requestId=="string"){const i=typeof r.error=="string"?r.error:"command_failed";this.#l(r.requestId,new Error(i),!0)}return}for(const r of this.#n)r(t,n)}#l(t,n,r){const i=this.#r.get(t);i&&(this.#r.delete(t),clearTimeout(i.timeout),r?i.reject(n):i.resolve(n))}#c(t){if(!this.#r.size)return;const n=new Error(t);for(const r of this.#r.values())clearTimeout(r.timeout),r.reject(n);this.#r.clear()}#u(){this.#s&&clearTimeout(this.#s);const n=Math.min(1e4,500*2**this.#o)+Math.floor(Math.random()*300);this.#o+=1,this.#s=setTimeout(()=>{this.connect()},n)}}const nc=new zJ,Ey=()=>{const[e,t]=T.useState(nc.getConnectionState());T.useEffect(()=>(nc.connect(),nc.subscribeState(t)),[]);const n=T.useCallback(i=>nc.subscribe(i),[]),r=T.useCallback((i,s)=>nc.sendCommand(i,s),[]);return{connectionState:e,subscribe:n,sendCommand:r}},UJ=()=>{const e=Il(),{projectPath:t}=Rn(an(g=>({projectPath:g.projectPath}))),{setRuns:n,upsertRun:r,appendOutput:i,clearRuns:s,setError:o}=Mp(an(g=>({setRuns:g.setRuns,upsertRun:g.upsertRun,appendOutput:g.appendOutput,clearRuns:g.clearRuns,setError:g.setError}))),u=T.useRef(t),{connectionState:c,sendCommand:d,subscribe:p}=Ey();T.useEffect(()=>{u.current=t},[t]);const m=d;return T.useEffect(()=>p((g,_)=>{if(g==="terminal_status"){const v=_;if(!v||typeof v.projectPath!="string")return;const x=u.current;if(!x||v.projectPath!==x)return;const C=v.run;if(!C||typeof C.runId!="string")return;r(C),C.commandName==="commit"&&C.status!=="running"&&x&&(e.invalidateQueries({queryKey:["git-diff",x]}),e.invalidateQueries({queryKey:["git-diff-staged",x]}));return}if(g==="terminal_output"){const v=_;if(!v||typeof v.projectPath!="string")return;const x=u.current;if(!x||v.projectPath!==x||typeof v.runId!="string"||typeof v.data!="string"||v.stream!=="stdout"&&v.stream!=="stderr")return;i(v.runId,v.stream,v.data,typeof v.terminalId=="string"?v.terminalId:void 0)}}),[i,e,p,r]),T.useEffect(()=>{s(),!(!t||c!=="connected")&&m("terminal_list",{projectPath:t}).then(g=>{n(g.runs||[])}).catch(g=>{o(g instanceof Error?g.message:"command_failed")})},[s,c,t,m,o,n]),{connectionState:c,sendCommand:m}},rk='"Space Mono", monospace',ik=14,_p="diffact",sk=!1,ak=`codex exec "Analyze staged changes and run: git commit -m 'your message'."`,d6=()=>{try{return localStorage.getItem(_t.fontFamily)||rk}catch{return rk}},f6=()=>{try{const e=localStorage.getItem(_t.fontSize);return e?parseInt(e,10):ik}catch{return ik}},p6=(e,t)=>{document.documentElement.style.setProperty("--font-mono",e),document.documentElement.style.setProperty("--font-mono-size",`${t}px`)},m6=()=>{try{return localStorage.getItem(_t.theme)||_p}catch{return _p}},g6=()=>{try{const e=localStorage.getItem(_t.darkMode);return e?e==="true":sk}catch{return sk}},_6=(e,t)=>{const n=e.trim()||_p,r=t?`${n}-dark`:n;document.documentElement.dataset.theme=r},b6=()=>{try{return localStorage.getItem(_t.commitCommand)||ak}catch{return ak}},$J=e=>{const t=e.trim();if(!t){localStorage.removeItem(_t.commitCommand);return}localStorage.setItem(_t.commitCommand,t)},VJ=e=>{const t=e.trim()||_p;localStorage.setItem(_t.theme,t)},qJ=e=>{localStorage.setItem(_t.darkMode,e?"true":"false")};typeof document<"u"&&(p6(d6(),f6()),_6(m6(),g6()));const WJ=[{label:"Space Mono",value:'"Space Mono", monospace'},{label:"JetBrains Mono",value:'"JetBrains Mono", monospace'},{label:"Fira Code",value:'"Fira Code", monospace'},{label:"SF Mono",value:'"SF Mono", monospace'},{label:"Menlo",value:"Menlo, monospace"},{label:"Monaco",value:"Monaco, monospace"},{label:"Consolas",value:"Consolas, monospace"},{label:"System",value:"ui-monospace, monospace"}],GJ=[12,13,14,15,16,18],YJ=[{label:"Diffact",value:"diffact"}],KJ=({open:e,onOpenChange:t})=>{const n=T.useRef(null),[r,i]=T.useState(d6),[s,o]=T.useState(f6),[u,c]=T.useState("general"),[d,p]=T.useState(m6),[m,g]=T.useState(g6),[_,v]=T.useState(b6),x=Vn({queryKey:["project-root-default"],queryFn:()=>Tt("/api/projects/browse")}),[C,w]=T.useState(()=>{try{const P=localStorage.getItem(_t.projectRoots);if(!P)return[];const q=JSON.parse(P);if(Array.isArray(q))return q.filter(ee=>typeof ee=="string")}catch{return[]}return[]}),A=T.useMemo(()=>{const P=C.map(q=>q.trim()).filter(Boolean);return Array.from(new Set(P))},[C]),R=T.useMemo(()=>A.length?A:x.data?.path?[x.data.path]:An,[x.data?.path,A]),L=Vn({queryKey:["project-root-listings",R],queryFn:async()=>await Promise.all(R.map(async q=>{try{const ee=await Tt(`/api/projects/browse?path=${encodeURIComponent(q)}`);return{inputPath:q,rootPath:ee.path,entries:ee.entries}}catch(ee){const F=ah(ee);return{inputPath:q,rootPath:q,entries:An,error:F||"invalid_path"}}})),enabled:R.length>0}).data??(A.length===0&&x.data?[{inputPath:x.data.path,rootPath:x.data.path,entries:x.data.entries}]:An),I=T.useMemo(()=>{const P=new Map;for(const q of L)q.error&&P.set(q.inputPath,q.error);return P},[L]);return T.useEffect(()=>{!x.data?.path||C.some(q=>q.trim())||w([x.data.path])},[x.data?.path,C]),T.useEffect(()=>{if(A.length){localStorage.setItem(_t.projectRoots,JSON.stringify(A));return}localStorage.removeItem(_t.projectRoots)},[A]),T.useEffect(()=>{localStorage.setItem(_t.fontFamily,r),localStorage.setItem(_t.fontSize,String(s)),p6(r,s)},[r,s]),T.useEffect(()=>{VJ(d),qJ(m),_6(d,m)},[m,d]),T.useEffect(()=>{$J(_)},[_]),T.useEffect(()=>{const P=n.current;if(P){if(e&&!P.open){P.showModal();return}!e&&P.open&&P.close()}},[e]),S.jsxs("dialog",{ref:n,className:"modal",onClose:()=>t(!1),"data-testid":"settings-modal",children:[S.jsxs("div",{className:"modal-box","data-testid":"settings-dropdown-content",children:[S.jsxs("div",{className:"flex items-center justify-between","data-testid":"settings-modal-header",children:[S.jsx("h2",{className:"text-sm font-semibold",children:"Configure"}),S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",onClick:()=>n.current?.close(),"data-testid":"settings-modal-close",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("path",{d:"M18 6 6 18"}),S.jsx("path",{d:"m6 6 12 12"})]})})]}),S.jsxs("div",{className:"mt-4 flex gap-4","data-testid":"settings-modal-body",children:[S.jsx("div",{className:"flex w-28 shrink-0 flex-col gap-1","data-testid":"settings-modal-nav",children:[{id:"general",label:"General"},{id:"appearance",label:"Appearance"},{id:"git",label:"Git"}].map(P=>S.jsx("button",{type:"button",className:`btn btn-ghost btn-sm justify-start ${u===P.id?"btn-active":""}`,onClick:()=>c(P.id),"data-testid":`settings-modal-nav-${P.id}`,children:P.label},P.id))}),S.jsxs("div",{className:"min-w-0 flex-1 space-y-5","data-testid":"settings-modal-content",children:[u==="general"&&S.jsx("div",{className:"space-y-3","data-testid":"settings-section-general",children:S.jsxs("div",{className:"space-y-3","data-testid":"settings-dropdown-project-roots",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h3",{className:"text-sm font-semibold",children:"Project Roots"}),S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",onClick:()=>w(P=>[...P,""]),"data-testid":"settings-dropdown-add-root",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("path",{d:"M5 12h14"}),S.jsx("path",{d:"M12 5v14"})]})})]}),S.jsx("div",{className:"space-y-2",children:C.length?C.map((P,q)=>{const ee=P.trim(),F=ee?I.get(ee):"";return S.jsxs("div",{className:"flex items-start gap-1",children:[S.jsxs("div",{className:"flex-1",children:[S.jsx("input",{className:"input input-bordered input-sm w-full font-mono text-xs",placeholder:"/path/to/projects",value:P,onChange:J=>{const B=[...C];B[q]=J.target.value,w(B)},"data-testid":"settings-dropdown-root-input","data-index":q}),F?S.jsx("div",{className:"mt-1 text-xs text-error",children:F==="invalid_path"?"Invalid path":F}):null]}),C.length>1?S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs text-base-content/50 hover:text-error",onClick:()=>{w(J=>J.filter((B,V)=>V!==q))},"data-testid":"settings-dropdown-remove-root","data-index":q,children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("path",{d:"M18 6 6 18"}),S.jsx("path",{d:"m6 6 12 12"})]})}):null]},q)}):S.jsx("input",{className:"input input-bordered input-sm w-full font-mono text-xs",placeholder:"/path/to/projects",value:"",onChange:P=>w([P.target.value]),"data-testid":"settings-dropdown-root-input","data-index":0})})]})}),u==="appearance"&&S.jsxs("div",{className:"space-y-4","data-testid":"settings-section-appearance",children:[S.jsxs("div",{className:"space-y-2","data-testid":"settings-appearance-font",children:[S.jsx("h3",{className:"text-sm font-semibold",children:"Font"}),S.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[S.jsxs("label",{className:"form-control w-full",children:[S.jsx("div",{className:"label py-0 pb-1",children:S.jsx("span",{className:"label-text text-xs",children:"Family"})}),S.jsx("select",{className:"select select-bordered select-sm",value:r,onChange:P=>i(P.currentTarget.value),"data-testid":"settings-appearance-font-family",children:WJ.map(P=>S.jsx("option",{value:P.value,children:P.label},P.value))})]}),S.jsxs("label",{className:"form-control w-full",children:[S.jsx("div",{className:"label py-0 pb-1",children:S.jsx("span",{className:"label-text text-xs",children:"Size"})}),S.jsx("select",{className:"select select-bordered select-sm",value:s,onChange:P=>o(Number(P.currentTarget.value)),"data-testid":"settings-appearance-font-size",children:GJ.map(P=>S.jsxs("option",{value:P,children:[P,"px"]},P))})]})]})]}),S.jsxs("div",{className:"space-y-2","data-testid":"settings-appearance-theme",children:[S.jsx("h3",{className:"text-sm font-semibold",children:"Theme"}),S.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[S.jsxs("label",{className:"form-control w-full",children:[S.jsx("div",{className:"label py-0 pb-1",children:S.jsx("span",{className:"label-text text-xs",children:"Base"})}),S.jsx("select",{className:"select select-bordered select-sm",value:d,onChange:P=>p(P.currentTarget.value),"data-testid":"settings-appearance-theme-select",children:YJ.map(P=>S.jsx("option",{value:P.value,children:P.label},P.value))})]}),S.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-md border border-base-300 px-3 py-2 text-xs","data-testid":"settings-appearance-dark-mode",children:[S.jsx("span",{children:"Dark mode"}),S.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:m,onChange:P=>g(P.currentTarget.checked),"aria-label":"Dark mode"})]})]})]})]}),u==="git"&&S.jsx("div",{className:"space-y-3","data-testid":"settings-section-git",children:S.jsxs("div",{className:"space-y-2","data-testid":"settings-git-commit",children:[S.jsx("h3",{className:"text-sm font-semibold",children:"Commit Command"}),S.jsx("input",{className:"input input-bordered input-sm w-full font-mono text-xs",value:_,onChange:P=>v(P.currentTarget.value),"data-testid":"settings-git-commit-command"}),S.jsx("div",{className:"text-xs text-base-content/60",children:"Runs in the project root when you press Commit."})]})})]})]})]}),S.jsx("form",{method:"dialog",className:"modal-backdrop",children:S.jsx("button",{type:"submit",children:"close"})})]})},QJ=["dev","start"],XJ=e=>{try{const t=localStorage.getItem(_t.preferredCommand);return t?JSON.parse(t)[e]??null:null}catch{return null}},ZJ=(e,t)=>{try{const n=localStorage.getItem(_t.preferredCommand),r=n?JSON.parse(n):{};r[e]=t,localStorage.setItem(_t.preferredCommand,JSON.stringify(r))}catch{}},JJ=(e,t)=>{if(!e.length)return null;const n=XJ(t);if(n){const r=e.find(i=>i.id===n);if(r)return r}for(const r of QJ){const i=e.find(s=>s.name.toLowerCase()===r);if(i)return i}return e[0]??null},ok=e=>e?.status==="pending"?S.jsx("span",{className:"loading loading-spinner loading-xs"}):e?.status==="running"?S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:[S.jsx("rect",{x:"7",y:"4",width:"4",height:"16",rx:"1"}),S.jsx("rect",{x:"13",y:"4",width:"4",height:"16",rx:"1"})]}):S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:S.jsx("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),eee=()=>{const{projectPath:e,setToolPanelVisible:t,setToolPanelTab:n}=Rn(an(F=>({projectPath:F.projectPath,setToolPanelVisible:F.setToolPanelVisible,setToolPanelTab:F.setToolPanelTab}))),{sendCommand:r}=UJ(),{runs:i,upsertRun:s,setError:o}=Mp(an(F=>({runs:F.runs,upsertRun:F.upsertRun,setError:F.setError}))),[u,c]=T.useState(!1),[d,p]=T.useState(!1),[m,g]=T.useState({}),_=Vn({queryKey:["project-commands",e],queryFn:()=>Tt(`/api/projects/commands?project=${encodeURIComponent(e)}`),enabled:!!e}),v=e?_.data?.commands??[]:[],x=T.useMemo(()=>JJ(v,e),[v,e]),C=T.useMemo(()=>x?v.filter(F=>F.id!==x.id):v,[v,x]),w=T.useMemo(()=>{const F={};for(const J of Object.values(i))!e||J.projectPath!==e||J.status==="running"&&(F[J.commandId]=J.runId);return F},[e,i]),A=T.useMemo(()=>{const F={};for(const[J,B]of Object.entries(w))F[J]={status:"running",runId:B};for(const[J,B]of Object.entries(m))F[J]={status:"pending",runId:B??w[J]??null};return F},[m,w]),R=T.useCallback((F=600)=>new Promise(J=>{if((()=>{const Y=Rn.getState();return Y.isToolPanelVisible&&Y.toolPanelTab==="output"&&Y.isTerminalReady&&Y.terminalCols>0&&Y.terminalRows>0})()){J();return}const V=Rn.subscribe(Y=>{Y.isToolPanelVisible&&Y.toolPanelTab==="output"&&Y.isTerminalReady&&(V(),J())});setTimeout(()=>{V(),J()},F)}),[]),N=T.useCallback(async F=>{if(!e)return;t(!0),n("output"),g(B=>({...B,[F.id]:w[F.id]??null})),await R();const J=Rn.getState();try{const B=await r("terminal_start",{projectPath:e,source:F.source,name:F.name,cols:J.terminalCols||void 0,rows:J.terminalRows||void 0});s(B.run),g(V=>{const Y={...V};return delete Y[F.id],Y})}catch(B){o(B instanceof Error?B.message:"command_failed"),g(V=>{const Y={...V};return delete Y[F.id],Y})}},[e,w,r,o,n,t,s,R]),L=T.useCallback(F=>{if(!e)return;const J=w[F.id];J&&(g(B=>({...B,[F.id]:J})),r("terminal_stop",{projectPath:e,runId:J}).then(B=>{s(B.run),g(V=>{const Y={...V};return delete Y[F.id],Y})}).catch(B=>{o(B instanceof Error?B.message:"command_failed"),g(V=>{const Y={...V};return delete Y[F.id],Y})}))},[e,w,r,s]),I=F=>{const J=A[F.id];if(J?.status==="running"){L(F);return}J?.status!=="pending"&&(e&&ZJ(e,F.id),N(F))},P=x?A[x.id]:void 0,q=P?.status==="pending",ee=!x||q;return T.useEffect(()=>{g({})},[e]),S.jsxs("div",{className:"join","data-testid":"command-launcher",children:[S.jsxs("button",{type:"button",className:"btn btn-sm join-item",onClick:()=>{x&&I(x)},disabled:ee,"data-testid":"command-launcher-primary",children:[ok(P),x?.label||"No commands"]}),S.jsxs($p,{open:u,onOpenChange:c,children:[S.jsx(Vp,{asChild:!0,children:S.jsx("button",{type:"button",className:"btn btn-sm join-item","data-testid":"command-launcher-more",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:[S.jsx("circle",{cx:"12",cy:"12",r:"1"}),S.jsx("circle",{cx:"19",cy:"12",r:"1"}),S.jsx("circle",{cx:"5",cy:"12",r:"1"})]})})}),S.jsx(qp,{align:"end",className:"w-full rounded-box bg-base-100 p-0! shadow-lg","data-testid":"command-launcher-menu",children:S.jsxs("ul",{className:"menu","data-testid":"command-launcher-commands",children:[C.length?C.map(F=>{const J=A[F.id],B=J?.status==="pending";return S.jsx("li",{onClick:()=>{I(F),c(!1)},className:B?"menu-disabled":"","data-testid":"command-launcher-item","data-command-id":F.id,"data-command-source":F.source,children:S.jsxs("a",{children:[ok(J),S.jsx("span",{className:"flex-1 truncate text-left",children:F.label})]})},F.id)}):null,S.jsx("li",{onClick:()=>{c(!1),p(!0)},"data-testid":"command-launcher-configure",children:S.jsxs("a",{children:[S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:[S.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),S.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),"Configure"]})})]})})]}),S.jsx(KJ,{open:d,onOpenChange:p})]})},v6=5,tee=()=>{try{const e=localStorage.getItem(_t.recentProjects);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)){const n=t.filter(r=>typeof r=="string");return Array.from(new Set(n)).slice(0,v6)}}catch{return[]}return[]},nee=e=>{const n=e.replace(/[/\\]+$/,"").split(/[/\\]/);return n[n.length-1]||e},ree=({onDropdownToggle:e})=>{const[t,n]=T.useState(!1),[r,i]=T.useState(""),s=r.trim().toLowerCase(),[o,u]=T.useState(()=>tee()),{projectPath:c,projectOpenError:d,setProjectPath:p,setProjectOpenError:m}=Rn(an(M=>({projectPath:M.projectPath,projectOpenError:M.projectOpenError,setProjectPath:M.setProjectPath,setProjectOpenError:M.setProjectOpenError}))),g=za({mutationFn:M=>Tt("/api/projects/open",{method:"POST",body:JSON.stringify({path:M})}),onSuccess:M=>{p(M.rootPath),m("")},onError:M=>{m(vR(M))}}),_=Vn({queryKey:["project-root-default"],queryFn:()=>Tt("/api/projects/browse")}),[v,x]=T.useState(()=>{try{const M=localStorage.getItem(_t.projectRoots);if(!M)return[];const Q=JSON.parse(M);if(Array.isArray(Q))return Q.filter(W=>typeof W=="string")}catch{return[]}return[]}),C=T.useMemo(()=>{const M=v.map(Q=>Q.trim()).filter(Boolean);return Array.from(new Set(M))},[v]),w=T.useMemo(()=>C.length?C:_.data?.path?[_.data.path]:An,[_.data?.path,C]),R=Vn({queryKey:["project-root-listings",w],queryFn:async()=>await Promise.all(w.map(async Q=>{try{const W=await Tt(`/api/projects/browse?path=${encodeURIComponent(Q)}`);return{inputPath:Q,rootPath:W.path,entries:W.entries}}catch(W){const me=ah(W);return{inputPath:Q,rootPath:Q,entries:An,error:me||"invalid_path"}}})),enabled:w.length>0}).data??(C.length===0&&_.data?[{inputPath:_.data.path,rootPath:_.data.path,entries:_.data.entries}]:An),N=T.useMemo(()=>R.flatMap(M=>M.entries),[R]),L=T.useMemo(()=>R.map(M=>s?{...M,filteredEntries:M.entries.filter(Q=>`${Q.name} ${Q.path}`.toLowerCase().includes(s))}:{...M,filteredEntries:M.entries}),[s,R]),I=T.useMemo(()=>s?L.filter(M=>M.error||M.filteredEntries.length>0):L,[L,s]),P=T.useMemo(()=>R.length?R.length===1?R[0]?.rootPath:`${R.length} roots`:"",[R]),q=!!c&&!N.some(M=>M.path===c),ee=T.useMemo(()=>!q||!c?An:[{name:c,path:c}],[c,q]),F=T.useMemo(()=>{const M=o.filter(Q=>!q||Q!==c).map(Q=>({name:nee(Q),path:Q}));return s?M.filter(Q=>`${Q.name} ${Q.path}`.toLowerCase().includes(s)):M},[s,c,q,o]);T.useEffect(()=>{!_.data?.path||v.some(Q=>Q.trim())||x([_.data.path])},[_.data?.path,v]),T.useEffect(()=>{if(C.length){localStorage.setItem(_t.projectRoots,JSON.stringify(C));return}localStorage.removeItem(_t.projectRoots)},[C]),T.useEffect(()=>{c&&u(M=>{const W=[c,...M.filter(me=>me!==c)].slice(0,v6);return localStorage.setItem(_t.recentProjects,JSON.stringify(W)),W})},[c]);const J=M=>{n(M),e?.(M)},B=M=>{M&&(d&&m(""),g.mutate(M))},V=M=>{M!==c&&(B(M),n(!1))},Y=M=>S.jsx("li",{className:"menu-title text-xs px-1","data-testid":"project-dropdown-group",children:S.jsx("span",{children:M})}),X=(M,Q="")=>M.map(W=>S.jsx("li",{children:S.jsx("button",{type:"button",className:"px-1",onClick:()=>V(W.path),"data-testid":"project-dropdown-item","data-path":W.path,children:W.name})},`${Q}${W.path}`));return S.jsxs($p,{open:t,onOpenChange:J,children:[S.jsx(Vp,{asChild:!0,children:S.jsx("button",{tabIndex:0,className:"btn btn-ghost justify-between","data-testid":"project-dropdown-trigger",children:S.jsxs("div",{className:"flex flex-col items-start",children:[S.jsx("span",{className:"text-xs text-gray-400",children:"Current project"}),S.jsx("span",{className:"truncate",children:c||(P?`Select a project (${P})`:"Select a project")})]})})}),S.jsxs(qp,{align:"start",className:"rounded-box bg-base-100 p-2 shadow w-full","data-testid":"project-dropdown-content",children:[S.jsx("input",{className:"input input-ghost input-xs px-1",placeholder:"Search projects",value:r,onChange:M=>i(M.target.value),"data-testid":"project-dropdown-filter"}),S.jsxs("ul",{className:"menu mt-2 p-0 max-h-96 flex-nowrap overflow-auto w-full","data-testid":"project-dropdown-list",children:[ee.length?X(ee,"missing-"):null,F.length?S.jsxs(T.Fragment,{children:[Y("Recent"),X(F,"recent-")]}):null,I.length?I.map(M=>S.jsxs(T.Fragment,{children:[Y(M.rootPath),M.filteredEntries.length?X(M.filteredEntries):S.jsx("li",{className:"disabled",children:S.jsx("span",{children:M.error?M.error==="invalid_path"?"Invalid path":M.error:s?"No matches":"No projects found"})})]},M.inputPath)):F.length?null:S.jsx("li",{className:"disabled",children:S.jsx("span",{children:N.length?"No matches":"No projects found"})})]})]})]})},iee=T.memo(({hasGit:e,hasGithub:t,capabilitiesLoading:n})=>S.jsx("header",{className:"border-b border-base-300 bg-base-100","data-testid":"app-header",children:S.jsx("div",{className:"flex flex-col gap-3 px-4 py-3",children:S.jsxs("div",{className:"flex flex-wrap items-center gap-3","data-testid":"app-header-content",children:[S.jsxs("div",{className:"text-3xl font-semibold","data-testid":"app-logo",children:["Diff",S.jsx("span",{className:"text-primary",children:"act"})]}),S.jsxs("div",{className:"flex flex-1 flex-nowrap gap-2","data-testid":"app-header-controls",children:[S.jsx(ree,{}),S.jsx(FJ,{hasGit:e,hasGithub:t,capabilitiesLoading:n})]}),S.jsx(eee,{})]})})})),see=({projectPath:e,isActive:t,selectedFilePath:n,onSelectedFilePathChange:r})=>{const[i,s]=T.useState({}),o=Vn({queryKey:["git-diff",e],queryFn:()=>zb(`/api/projects/diff?project=${encodeURIComponent(e)}`),enabled:!!(e&&t)}),u=Vn({queryKey:["git-diff-staged",e],queryFn:()=>zb(`/api/projects/diff?project=${encodeURIComponent(e)}&arg=--cached`),enabled:!!(e&&t)}),c=T.useMemo(()=>$b(o.data),[o.data]),d=T.useMemo(()=>$b(u.data),[u.data]),p=T.useMemo(()=>new Set(d.map(A=>A.path)),[d]),m=T.useMemo(()=>{const A=new Set;for(const R of d)A.add(R.path);for(const R of c)A.add(R.path);return A},[d,c]),g=T.useMemo(()=>Ub(d,c).map(R=>({...R,staged:R.path in i?i[R.path]:p.has(R.path)})),[d,i,p,c]),_=T.useMemo(()=>n?g.find(A=>A.path===n)||null:g[0]||null,[g,n]),x=T.useMemo(()=>_?_.fileDiff?_.fileDiff:yR(_.path,_.patch):null,[_])||null,C=T.useCallback(async(A,R)=>{if(!e||!A)return;const N=i[A];s(L=>({...L,[A]:R}));try{await Tt(`/api/projects/stage?project=${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify({path:A,staged:R})})}catch(L){console.error("Failed to update staged state",L),s(I=>{if(!(A in I)||I[A]!==R)return I;if(N===void 0){const P={...I};return delete P[A],P}return{...I,[A]:N}})}},[e,i]),w=T.useCallback(async A=>{if(!e||g.length===0)return;const R=Array.from(new Set(g.map(L=>L.path))).filter(Boolean);if(R.length===0)return;const N=new Map(R.map(L=>[L,i[L]]));s(L=>{const I={...L};for(const P of R)I[P]=A;return I});try{await Tt(`/api/projects/stage?project=${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify({paths:R,staged:A})})}catch(L){console.error("Failed to update staged state",L),s(I=>{let P=!1;const q={...I};for(const ee of R){if(!(ee in I)||I[ee]!==A)continue;const F=N.get(ee);if(F===void 0){delete q[ee],P=!0;continue}q[ee]=F,P=!0}return P?q:I})}},[g,e,i]);return T.useEffect(()=>{s(A=>{let R=!1;const N={...A};for(const[L,I]of Object.entries(A))(!m.has(L)||p.has(L)===I)&&(delete N[L],R=!0);return R?N:A})},[m,p]),T.useEffect(()=>{if(!g.length){r("");return}if(!n){r(g[0]?.path||"");return}g.find(R=>R.path===n)||r(g[0]?.path||"")},[g,r,n]),{changes:g,selectedChange:_,selectedFileDiff:x,changesLoading:o.isLoading||u.isLoading,diffError:o.error||u.error,toggleStage:C,toggleStageAll:w}},aee=({projectPath:e,filePath:t,isActive:n})=>{const r=Vn({queryKey:["file-content",e,t],queryFn:()=>Tt(`/api/projects/file?project=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`),enabled:!!(e&&t&&n)});return{file:r.data??null,isLoading:r.isLoading,error:r.error}},oee=e=>{const t=[],n=r=>{for(const i of r){if(i.type==="file"){t.push({name:i.name,path:i.path});continue}i.children?.length&&n(i.children)}};return n(e),t},lee=({projectPath:e,isActive:t,selectedFilePath:n,onSelectedFilePathChange:r})=>{const i=Vn({queryKey:["file-tree",e],queryFn:()=>Tt(`/api/projects/tree?project=${encodeURIComponent(e)}`),enabled:!!(e&&t)}),s=i.data?.entries??An,o=T.useMemo(()=>oee(s),[s]),u=i.data?.available??!0;return T.useEffect(()=>{if(!t)return;if(!o.length){r("");return}if(!n){r(o[0]?.path||"");return}o.some(d=>d.path===n)||r(o[0]?.path||"")},[o,t,r,n]),{entries:s,flatFiles:o,isAvailable:u,isLoading:i.isLoading}},uee=({projectPath:e,selectedCommitSha:t,onSelectedCommitShaChange:n,selectedHistoryFilePath:r,onSelectedHistoryFilePathChange:i,hasGit:s,isActive:o,pageSize:u})=>{const{currentBranch:c}=ER(e,s),[d,p]=T.useState([]),[m,g]=T.useState(!1),_=Jc({queryKey:["git-history",e,c||""],queryFn:({pageParam:N=0})=>Tt(`/api/projects/history?project=${encodeURIComponent(e)}&skip=${N}&limit=${u}`),getNextPageParam:N=>{if(!(!N||!N.hasMore))return N.nextSkip},initialPageParam:0,enabled:!!(e&&s&&o)}),v=T.useMemo(()=>_.data?.pages.flatMap(N=>N.items)??[],[_.data]),x=T.useMemo(()=>v.find(N=>N.sha===t)||null,[v,t]);T.useEffect(()=>{if(!e||!s||!t){p([]);return}if(!o)return;let N=!1;const L=new AbortController;return p([]),(async()=>{try{const P=await Tt(`/api/projects/commits/${encodeURIComponent(t)}/files?project=${encodeURIComponent(e)}`,{signal:L.signal});if(N)return;P&&P.length&&p(q=>Ub(q,P))}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;console.error("Failed to load commit files",P)}})(),()=>{N=!0,L.abort()}},[s,o,e,t]),T.useEffect(()=>{if(!e||!s||!t){g(!1);return}if(!o){g(!1);return}let N=!1;const L=new AbortController;g(!0);const I=ee=>{if(!ee.trim())return;const F=$b(ee);F.length&&p(J=>Ub(J,F))},P=ee=>{ee.trim()&&I(ee.endsWith(`
|
|
1444
|
+
`||e[t]==="\r");)t-=1;return t>=1&&e[t]==="$"&&e[t-1]==="$"},z_=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},kJ=e=>{let t=EJ.test(e),n=xJ.test(e);if(t||n)return[e];let r=Ur.lex(e,{gfm:!0}),i=[],s=[];for(let o of r){let u=o.raw,c=i.length;if(s.length>0){if(i[c-1]+=u,o.type==="html"){let d=u.match(wJ);if(d){let p=d[1];s.at(-1)===p&&s.pop()}}continue}if(o.type==="html"&&o.block){let d=u.match(CJ);if(d){let p=d[1];u.includes(`</${p}>`)||s.push(p)}}if(u.trim()==="$$"&&c>0){let d=i[c-1],p=j_(d),m=z_(d);if(p&&m%2===1){i[c-1]=d+u;continue}}if(c>0&&TJ(u)){let d=i[c-1],p=j_(d),m=z_(d),g=z_(u);if(p&&m%2===1&&!j_(u)&&g===1){i[c-1]=d+u;continue}}i.push(u)}return i},AJ={raw:uV,sanitize:[vV,{}],harden:[Vj,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},RJ={gfm:[JG,{}]},NJ=Object.values(AJ),LJ=Object.values(RJ),OJ={block:" ▋",circle:" ●"},DJ={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Wr=T.createContext(DJ),u6=T.memo(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>S.jsx(l6,{...r,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var s,o;return((s=e.components)==null?void 0:s[i])!==((o=t.components)==null?void 0:o[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});u6.displayName="Block";var MJ=["github-light","github-dark"],c6=T.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=NJ,remarkPlugins:s=LJ,className:o,shikiTheme:u=MJ,mermaid:c,controls:d=!0,isAnimating:p=!1,BlockComponent:m=u6,parseMarkdownIntoBlocksFn:g=kJ,caret:_,plugins:v,remend:x,linkSafety:C={enabled:!0},...w})=>{let A=T.useId(),[R,N]=T.useTransition(),L=T.useMemo(()=>typeof e!="string"?"":t==="streaming"&&n?rK(e,x):e,[e,t,n,x]),I=T.useMemo(()=>g(L),[L,g]),[P,q]=T.useState(I);T.useEffect(()=>{t==="streaming"?N(()=>{q(I)}):q(I)},[I,t]);let ee=t==="streaming"?P:I,F=T.useMemo(()=>ee.map((M,Q)=>`${A}-${Q}`),[ee.length,A]),J=T.useMemo(()=>{var M,Q;return{shikiTheme:(Q=(M=v?.code)==null?void 0:M.getThemes())!=null?Q:u,controls:d,isAnimating:p,mode:t,mermaid:c,linkSafety:C}},[u,d,p,t,c,C,v?.code]),B=T.useMemo(()=>({..._J,...r}),[r]),V=T.useMemo(()=>{let M=[];return v!=null&&v.cjk&&(M=[...M,...v.cjk.remarkPluginsBefore]),M=[...M,...s],v!=null&&v.cjk&&(M=[...M,...v.cjk.remarkPluginsAfter]),v!=null&&v.math&&(M=[...M,v.math.remarkPlugin]),M},[s,v?.math,v?.cjk]),Y=T.useMemo(()=>v!=null&&v.math?[...i,v.math.rehypePlugin]:i,[i,v?.math]),X=T.useMemo(()=>_&&p?{"--streamdown-caret":`"${OJ[_]}"`}:void 0,[_,p]);return t==="static"?S.jsx(f1.Provider,{value:v??null,children:S.jsx(Wr.Provider,{value:J,children:S.jsx("div",{className:Ie("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",o),children:S.jsx(l6,{components:B,rehypePlugins:Y,remarkPlugins:V,...w,children:e})})})}):S.jsx(f1.Provider,{value:v??null,children:S.jsx(Wr.Provider,{value:J,children:S.jsxs("div",{className:Ie("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",_?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,o),style:X,children:[ee.length===0&&_&&p&&S.jsx("span",{}),ee.map((M,Q)=>S.jsx(m,{components:B,content:M,index:Q,rehypePlugins:Y,remarkPlugins:V,shouldParseIncompleteMarkdown:n,...w},F[Q]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);c6.displayName="Streamdown";var IJ=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:s=!0,initialZoom:o=1,fullscreen:u=!1})=>{let c=T.useRef(null),d=T.useRef(null),[p,m]=T.useState(o),[g,_]=T.useState({x:0,y:0}),[v,x]=T.useState(!1),[C,w]=T.useState({x:0,y:0}),[A,R]=T.useState({x:0,y:0}),N=T.useCallback(B=>{m(V=>Math.max(n,Math.min(r,V+B)))},[n,r]),L=T.useCallback(()=>{N(i)},[N,i]),I=T.useCallback(()=>{N(-i)},[N,i]),P=T.useCallback(()=>{m(o),_({x:0,y:0})},[o]),q=T.useCallback(B=>{B.preventDefault();let V=B.deltaY>0?-i:i;N(V)},[N,i]),ee=T.useCallback(B=>{if(B.button!==0||B.isPrimary===!1)return;x(!0),w({x:B.clientX,y:B.clientY}),R(g);let V=B.currentTarget;V instanceof HTMLElement&&V.setPointerCapture(B.pointerId)},[g]),F=T.useCallback(B=>{if(!v)return;B.preventDefault();let V=B.clientX-C.x,Y=B.clientY-C.y;_({x:A.x+V,y:A.y+Y})},[v,C,A]),J=T.useCallback(B=>{x(!1);let V=B.currentTarget;V instanceof HTMLElement&&V.releasePointerCapture(B.pointerId)},[]);return T.useEffect(()=>{let B=c.current;if(B)return B.addEventListener("wheel",q,{passive:!1}),()=>{B.removeEventListener("wheel",q)}},[q]),T.useEffect(()=>{let B=d.current;if(B&&v)return document.body.style.userSelect="none",B.addEventListener("pointermove",F,{passive:!1}),B.addEventListener("pointerup",J),B.addEventListener("pointercancel",J),()=>{document.body.style.userSelect="",B.removeEventListener("pointermove",F),B.removeEventListener("pointerup",J),B.removeEventListener("pointercancel",J)}},[v,F,J]),S.jsxs("div",{className:Ie("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:c,style:{cursor:v?"grabbing":"grab"},children:[s?S.jsxs("div",{className:Ie("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",u?"bottom-4 left-4":"bottom-2 left-2"),children:[S.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:p>=r,onClick:L,title:"Zoom in",type:"button",children:S.jsx(GZ,{size:16})}),S.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:p<=n,onClick:I,title:"Zoom out",type:"button",children:S.jsx(YZ,{size:16})}),S.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:P,title:"Reset zoom and pan",type:"button",children:S.jsx(WZ,{size:16})})]}):null,S.jsx("div",{className:Ie("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:ee,ref:d,role:"application",style:{transform:`translate(${g.x}px, ${g.y}px) scale(${p})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},h6=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[s,o]=T.useState(null),[u,c]=T.useState(!1),[d,p]=T.useState(""),[m,g]=T.useState(""),[_,v]=T.useState(0),{mermaid:x}=T.useContext(Wr),C=yy(),w=x?.errorComponent,{shouldRender:A,containerRef:R}=$Z({immediate:r});if(T.useEffect(()=>{if(A){if(!C){o("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{o(null),c(!0);let L=C.getMermaid(n),I=e.split("").reduce((ee,F)=>(ee<<5)-ee+F.charCodeAt(0)|0,0),P=`mermaid-${Math.abs(I)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:q}=await L.render(P,e);p(q),g(q)}catch(L){if(!(m||d)){let I=L instanceof Error?L.message:"Failed to render Mermaid chart";o(I)}}finally{c(!1)}})()}},[e,n,_,A,C]),!(A||d||m))return S.jsx("div",{className:Ie("my-4 min-h-[200px]",t),ref:R});if(u&&!d&&!m)return S.jsx("div",{className:Ie("my-4 flex justify-center p-4",t),ref:R,children:S.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[S.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),S.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(s&&!d&&!m){let L=()=>v(I=>I+1);return w?S.jsx("div",{ref:R,children:S.jsx(w,{chart:e,error:s,retry:L})}):S.jsxs("div",{className:Ie("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:R,children:[S.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",s]}),S.jsxs("details",{className:"mt-2",children:[S.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),S.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let N=d||m;return S.jsx("div",{className:Ie("size-full",t),"data-streamdown":"mermaid",ref:R,children:S.jsx(IJ,{className:Ie(r?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:S.jsx("div",{"aria-label":"Mermaid chart",className:Ie("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:N},role:"img"})})})};const PJ=T.memo(({projectPath:e,issueNumber:t})=>{const n=ro(c=>c.addAttachedIssue),r=Rn(c=>c.setToolPanelVisible),i=Rn(c=>c.setToolPanelTab),s=Vn({queryKey:["issue-detail",e,t],queryFn:()=>Tt(`/api/projects/issues/${t}?project=${encodeURIComponent(e)}`),enabled:!!(e&&t)}),o=s.data,u=T.useCallback(()=>{o&&(n({number:o.number,title:o.title,body:o.body,url:o.url}),r(!0),i("agent"))},[o,n,r,i]);return s.isLoading?S.jsx("div",{className:"text-sm text-base-content/70 p-4",children:"Loading..."}):o?S.jsxs("div",{className:"p-4 space-y-3",children:[S.jsxs("div",{className:"flex items-start justify-between gap-2",children:[S.jsxs("h3",{className:"font-semibold text-sm leading-tight",children:["#",o.number," ",o.title]}),S.jsxs("div",{className:"flex gap-1 shrink-0",children:[S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",title:"Attach to Agent",onClick:u,"data-testid":"issue-preview-attach",children:S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5",children:S.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),S.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"btn btn-ghost btn-xs",title:"Open in GitHub",children:"↗"})]})]}),S.jsxs("div",{className:"flex items-center gap-2 text-xs text-base-content/60 flex-wrap",children:[S.jsx("span",{className:`badge badge-sm ${o.state==="open"?"badge-success":"badge-neutral"}`,children:o.state}),o.author&&S.jsxs("span",{children:["@",o.author]}),S.jsx("span",{children:sh(o.createdAt)})]}),o.labels.length>0&&S.jsx("div",{className:"flex flex-wrap gap-1",children:o.labels.map(c=>S.jsx("span",{className:"badge badge-sm",style:{backgroundColor:`#${c.color}`,color:S3(c.color)},children:c.name},c.name))}),o.body&&S.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:S.jsx(c6,{children:o.body})}),o.commentsCount>0&&S.jsxs("div",{className:"text-xs text-base-content/60",children:[o.commentsCount," comment",o.commentsCount>1?"s":""]})]}):S.jsx("div",{className:"text-sm text-base-content/70 p-4",children:"Issue not found"})}),BJ=T.memo(({projectPath:e,hasGit:t,hasGithub:n})=>{const[r,i]=T.useState(""),[s,o]=T.useState(null),u=Jc({queryKey:["issues",e,r],queryFn:async({pageParam:C})=>{const w=new URLSearchParams({project:e});return C&&w.set("cursor",C),r.trim()&&w.set("search",r.trim()),Tt(`/api/projects/issues?${w.toString()}`)},initialPageParam:null,getNextPageParam:C=>{if(!(!C||!C.hasMore))return C.nextCursor??void 0},enabled:!!(e&&t&&n)}),c=T.useMemo(()=>u.data?u.data.pages.flatMap(C=>C.items):[],[u.data]),d=u.hasNextPage,p=u.isLoading,m=u.isFetchingNextPage,g=u.data?.pages[0]?.available??!0,_=u.data?.pages[0]?.error,v=T.useCallback(()=>{d&&!m&&u.fetchNextPage()},[d,m,u]),x=C=>S.jsx("li",{className:"w-full",children:S.jsx("button",{type:"button",className:`w-full px-2 text-left ${s===C.number?"active":""}`,title:C.title,onClick:()=>o(s===C.number?null:C.number),"data-testid":"branch-dropdown-issue","data-issue-number":C.number,children:S.jsxs("div",{className:"flex flex-col gap-1 w-full min-w-0",children:[S.jsx("span",{className:"block truncate font-medium",children:`#${C.number} ${C.title}`}),S.jsxs("div",{className:"flex items-center gap-2 text-xs text-base-content/60 flex-wrap",children:[C.author&&S.jsxs("span",{children:["@",C.author]}),S.jsx("span",{children:sh(C.updatedAt)}),C.labels.slice(0,3).map(w=>S.jsx("span",{className:"badge badge-xs",style:{backgroundColor:`#${w.color}`,color:S3(w.color)},children:w.name},w.name))]})]})})},C.number);return S.jsxs("div",{className:"mt-3 relative","data-testid":"branch-dropdown-issues-panel",children:[S.jsx("div",{className:"flex items-center gap-2","data-testid":"branch-dropdown-issue-filter-row",children:S.jsx("input",{className:"input input-bordered input-sm w-full",placeholder:"Search issues",value:r,onChange:C=>i(C.target.value),"data-testid":"branch-dropdown-issue-filter"})}),S.jsx("div",{className:"mt-3 overflow-auto max-h-[50vh]","data-testid":"branch-dropdown-issues",children:p?S.jsx("div",{className:"rounded-box text-sm text-base-content/70",children:"Loading issues..."}):g?S.jsxs(S.Fragment,{children:[S.jsx("ul",{className:"menu p-0 rounded-box w-full","data-testid":"branch-dropdown-issue-list",children:c.length?c.map(x):S.jsx("li",{className:"disabled",children:S.jsx("span",{children:"No issues"})})}),d&&S.jsx("button",{type:"button",className:"btn btn-ghost btn-sm w-full mt-2",onClick:v,disabled:m,"data-testid":"branch-dropdown-issue-load-more",children:m?"Loading...":"Load More"})]}):S.jsx("div",{className:"rounded-box text-sm text-error/80",children:_||"Failed to load issues"})}),s&&S.jsx("div",{className:"absolute left-full top-0 ml-6 w-120 h-full min-h-80 max-h-[50vh] overflow-auto rounded-box bg-base-100 shadow-lg border border-base-300","data-testid":"branch-dropdown-issue-preview",children:S.jsx(PJ,{projectPath:e,issueNumber:s})})]})}),HJ=T.memo(({projectPath:e,hasGit:t,hasGithub:n})=>{const[r,i]=T.useState(""),s=Jc({queryKey:["pull-requests",e,r],queryFn:async({pageParam:v})=>{const x=new URLSearchParams({project:e});return v&&x.set("cursor",v),r.trim()&&x.set("search",r.trim()),Tt(`/api/projects/pull-requests?${x.toString()}`)},initialPageParam:null,getNextPageParam:v=>{if(!(!v||!v.hasMore))return v.nextCursor??void 0},enabled:!!(e&&t&&n)}),o=T.useMemo(()=>s.data?s.data.pages.flatMap(v=>v.items):[],[s.data]),u=s.hasNextPage,c=s.isLoading,d=s.isFetchingNextPage,p=s.data?.pages[0]?.available??!0,m=s.data?.pages[0]?.error,g=T.useCallback(()=>{u&&!d&&s.fetchNextPage()},[u,d,s]),_=v=>S.jsx("li",{className:"w-full",children:S.jsx("a",{href:v.url,target:"_blank",rel:"noopener noreferrer",className:"w-full px-2",title:v.title,"data-testid":"branch-dropdown-pr","data-pr-number":v.number,children:S.jsxs("div",{className:"flex flex-col gap-1 w-full min-w-0",children:[S.jsx("span",{className:"block truncate font-medium",children:`#${v.number} ${v.title}`}),S.jsxs("span",{className:"text-xs text-base-content/60",children:[v.author&&S.jsxs("span",{className:"mr-2",children:["@",v.author]}),sh(v.updatedAt)]})]})})},v.number);return S.jsxs("div",{className:"mt-3",children:[S.jsx("div",{className:"flex items-center gap-2","data-testid":"branch-dropdown-pr-filter-row",children:S.jsx("input",{className:"input input-bordered input-sm w-full",placeholder:"Search pull requests",value:r,onChange:v=>i(v.target.value),"data-testid":"branch-dropdown-pr-filter"})}),S.jsx("div",{className:"mt-3 overflow-auto max-h-[50vh]","data-testid":"branch-dropdown-prs",children:c?S.jsx("div",{className:"rounded-box text-sm text-base-content/70",children:"Loading pull requests..."}):p?S.jsxs(S.Fragment,{children:[S.jsx("ul",{className:"menu p-0 rounded-box w-full","data-testid":"branch-dropdown-pr-list",children:o.length?o.map(_):S.jsx("li",{className:"disabled",children:S.jsx("span",{children:"No pull requests"})})}),u&&S.jsx("button",{type:"button",className:"btn btn-ghost btn-sm w-full mt-2",onClick:g,disabled:d,"data-testid":"branch-dropdown-pr-load-more",children:d?"Loading...":"Load More"})]}):S.jsx("div",{className:"rounded-box text-sm text-error/80",children:m||"Failed to load pull requests"})})]})}),FJ=T.memo(({hasGit:e,hasGithub:t,capabilitiesLoading:n,onDropdownToggle:r})=>{const[i,s]=T.useState(!1),{projectPath:o,branchTab:u,setBranchTab:c}=Rn(an(v=>({projectPath:v.projectPath,branchTab:v.branchTab,setBranchTab:v.setBranchTab}))),{currentBranch:d,branchesLoading:p}=E3(o,e),m=v=>{v&&(!o||!e)||(s(v),r?.(v))},g=v=>{c(v)},_=()=>{s(!1)};return S.jsxs($p,{open:i,onOpenChange:m,children:[S.jsx(Vp,{asChild:!0,children:S.jsx("button",{type:"button",tabIndex:0,className:"btn btn-ghost justify-between",disabled:!o||n||!e,"data-testid":"branch-dropdown-trigger",children:S.jsxs("div",{className:"flex flex-col items-start",children:[S.jsx("span",{className:"text-xs text-gray-400",children:"Current branch"}),S.jsx("span",{className:"truncate",children:o?n||p?"Loading...":e?d||"—":"No git repository":"No project"})]})})}),S.jsx(qp,{align:"start",className:"w-fit rounded-box bg-base-100 p-3 shadow","data-testid":"branch-dropdown-content",children:S.jsx("div",{className:"flex gap-3",children:S.jsxs("div",{className:"w-96",children:[S.jsxs("div",{className:"tabs","data-testid":"branch-dropdown-tabs",children:[S.jsx("button",{type:"button",className:`tab ${u==="branches"?"tab-active font-semibold":""}`,onClick:()=>g("branches"),"data-testid":"branch-dropdown-tab-branches",children:"Branches"}),S.jsx("button",{type:"button",className:`tab ${u==="prs"?"tab-active font-semibold":""}`,onClick:()=>g("prs"),disabled:!t,"data-testid":"branch-dropdown-tab-prs",children:"Pull Requests"}),S.jsx("button",{type:"button",className:`tab ${u==="issues"?"tab-active font-semibold":""}`,onClick:()=>g("issues"),disabled:!t,"data-testid":"branch-dropdown-tab-issues",children:"Issues"})]}),u==="branches"&&S.jsx(Bj,{projectPath:o,hasGit:e,onClose:_}),u==="prs"&&S.jsx(HJ,{projectPath:o,hasGit:e,hasGithub:t}),u==="issues"&&S.jsx(BJ,{projectPath:o,hasGit:e,hasGithub:t})]})})})]})}),jJ=()=>typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(16).slice(2)}`;class zJ{#e=null;#t="connecting";#n=new Set;#i=new Set;#r=new Map;#s=null;#o=0;connect(){if(this.#e)return;const t=window.location.origin,n=new URL("/api/events",t);n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:");const r=n.toString();this.#a("connecting");const i=new WebSocket(r);this.#e=i,i.onopen=()=>{this.#o=0,this.#a("connected")},i.onmessage=s=>{if(typeof s.data=="string")try{const o=JSON.parse(s.data);if(typeof o.event!="string")return;this.#d(o.event,o.payload)}catch(o){console.error("Failed to parse WebSocket payload",o)}},i.onerror=()=>{i.readyState===WebSocket.OPEN&&i.close()},i.onclose=()=>{this.#e===i&&(this.#e=null),this.#c("connection_closed"),this.#a("disconnected"),this.#u()}}subscribe(t){return this.#n.add(t),()=>{this.#n.delete(t)}}subscribeState(t){return this.#i.add(t),t(this.#t),()=>{this.#i.delete(t)}}getConnectionState(){return this.#t}sendCommand(t,n){return new Promise((r,i)=>{const s=this.#e;if(!s||s.readyState!==WebSocket.OPEN){i(new Error("ws_not_connected"));return}const o=jJ(),u=setTimeout(()=>{this.#r.delete(o),i(new Error("command_timeout"))},3e4);this.#r.set(o,{resolve:c=>r(c),reject:c=>i(c),timeout:u}),s.send(JSON.stringify({type:t,payload:n,requestId:o}))})}#a(t){if(this.#t!==t){this.#t=t;for(const n of this.#i)n(t)}}#d(t,n){if(t==="ping"){this.#e?.readyState===WebSocket.OPEN&&this.#e.send(JSON.stringify({type:"pong"}));return}if(t==="command_ack"){const r=n;r&&typeof r.requestId=="string"&&this.#l(r.requestId,r.result??null,!1);return}if(t==="command_error"){const r=n;if(r&&typeof r.requestId=="string"){const i=typeof r.error=="string"?r.error:"command_failed";this.#l(r.requestId,new Error(i),!0)}return}for(const r of this.#n)r(t,n)}#l(t,n,r){const i=this.#r.get(t);i&&(this.#r.delete(t),clearTimeout(i.timeout),r?i.reject(n):i.resolve(n))}#c(t){if(!this.#r.size)return;const n=new Error(t);for(const r of this.#r.values())clearTimeout(r.timeout),r.reject(n);this.#r.clear()}#u(){this.#s&&clearTimeout(this.#s);const n=Math.min(1e4,500*2**this.#o)+Math.floor(Math.random()*300);this.#o+=1,this.#s=setTimeout(()=>{this.connect()},n)}}const nc=new zJ,Ey=()=>{const[e,t]=T.useState(nc.getConnectionState());T.useEffect(()=>(nc.connect(),nc.subscribeState(t)),[]);const n=T.useCallback(i=>nc.subscribe(i),[]),r=T.useCallback((i,s)=>nc.sendCommand(i,s),[]);return{connectionState:e,subscribe:n,sendCommand:r}},UJ=()=>{const e=Il(),{projectPath:t}=Rn(an(g=>({projectPath:g.projectPath}))),{setRuns:n,upsertRun:r,appendOutput:i,clearRuns:s,setError:o}=Mp(an(g=>({setRuns:g.setRuns,upsertRun:g.upsertRun,appendOutput:g.appendOutput,clearRuns:g.clearRuns,setError:g.setError}))),u=T.useRef(t),{connectionState:c,sendCommand:d,subscribe:p}=Ey();T.useEffect(()=>{u.current=t},[t]);const m=d;return T.useEffect(()=>p((g,_)=>{if(g==="terminal_status"){const v=_;if(!v||typeof v.projectPath!="string")return;const x=u.current;if(!x||v.projectPath!==x)return;const C=v.run;if(!C||typeof C.runId!="string")return;r(C),C.commandName==="commit"&&C.status!=="running"&&x&&(e.invalidateQueries({queryKey:["git-diff",x]}),e.invalidateQueries({queryKey:["git-diff-staged",x]}));return}if(g==="terminal_output"){const v=_;if(!v||typeof v.projectPath!="string")return;const x=u.current;if(!x||v.projectPath!==x||typeof v.runId!="string"||typeof v.data!="string"||v.stream!=="stdout"&&v.stream!=="stderr")return;i(v.runId,v.stream,v.data,typeof v.terminalId=="string"?v.terminalId:void 0)}}),[i,e,p,r]),T.useEffect(()=>{s(),!(!t||c!=="connected")&&m("terminal_list",{projectPath:t}).then(g=>{n(g.runs||[])}).catch(g=>{o(g instanceof Error?g.message:"command_failed")})},[s,c,t,m,o,n]),{connectionState:c,sendCommand:m}},rk='"Space Mono", monospace',ik=14,_p="diffact",sk=!1,ak=`codex exec "Analyze staged changes and run: git commit -m 'your message'."`,d6=()=>{try{return localStorage.getItem(_t.fontFamily)||rk}catch{return rk}},f6=()=>{try{const e=localStorage.getItem(_t.fontSize);return e?parseInt(e,10):ik}catch{return ik}},p6=(e,t)=>{document.documentElement.style.setProperty("--font-mono",e),document.documentElement.style.setProperty("--font-mono-size",`${t}px`)},m6=()=>{try{return localStorage.getItem(_t.theme)||_p}catch{return _p}},g6=()=>{try{const e=localStorage.getItem(_t.darkMode);return e?e==="true":sk}catch{return sk}},_6=(e,t)=>{const n=e.trim()||_p,r=t?`${n}-dark`:n;document.documentElement.dataset.theme=r},b6=()=>{try{return localStorage.getItem(_t.commitCommand)||ak}catch{return ak}},$J=e=>{const t=e.trim();if(!t){localStorage.removeItem(_t.commitCommand);return}localStorage.setItem(_t.commitCommand,t)},VJ=e=>{const t=e.trim()||_p;localStorage.setItem(_t.theme,t)},qJ=e=>{localStorage.setItem(_t.darkMode,e?"true":"false")};typeof document<"u"&&(p6(d6(),f6()),_6(m6(),g6()));const WJ=[{label:"Space Mono",value:'"Space Mono", monospace'},{label:"JetBrains Mono",value:'"JetBrains Mono", monospace'},{label:"Fira Code",value:'"Fira Code", monospace'},{label:"SF Mono",value:'"SF Mono", monospace'},{label:"Menlo",value:"Menlo, monospace"},{label:"Monaco",value:"Monaco, monospace"},{label:"Consolas",value:"Consolas, monospace"},{label:"System",value:"ui-monospace, monospace"}],GJ=[12,13,14,15,16,18],YJ=[{label:"Diffact",value:"diffact"}],KJ=({open:e,onOpenChange:t})=>{const n=T.useRef(null),[r,i]=T.useState(d6),[s,o]=T.useState(f6),[u,c]=T.useState("general"),[d,p]=T.useState(m6),[m,g]=T.useState(g6),[_,v]=T.useState(b6),x=Vn({queryKey:["project-root-default"],queryFn:()=>Tt("/api/projects/browse")}),[C,w]=T.useState(()=>{try{const P=localStorage.getItem(_t.projectRoots);if(!P)return[];const q=JSON.parse(P);if(Array.isArray(q))return q.filter(ee=>typeof ee=="string")}catch{return[]}return[]}),A=T.useMemo(()=>{const P=C.map(q=>q.trim()).filter(Boolean);return Array.from(new Set(P))},[C]),R=T.useMemo(()=>A.length?A:x.data?.path?[x.data.path]:An,[x.data?.path,A]),L=Vn({queryKey:["project-root-listings",R],queryFn:async()=>await Promise.all(R.map(async q=>{try{const ee=await Tt(`/api/projects/browse?path=${encodeURIComponent(q)}`);return{inputPath:q,rootPath:ee.path,entries:ee.entries}}catch(ee){const F=ah(ee);return{inputPath:q,rootPath:q,entries:An,error:F||"invalid_path"}}})),enabled:R.length>0}).data??(A.length===0&&x.data?[{inputPath:x.data.path,rootPath:x.data.path,entries:x.data.entries}]:An),I=T.useMemo(()=>{const P=new Map;for(const q of L)q.error&&P.set(q.inputPath,q.error);return P},[L]);return T.useEffect(()=>{!x.data?.path||C.some(q=>q.trim())||w([x.data.path])},[x.data?.path,C]),T.useEffect(()=>{if(A.length){localStorage.setItem(_t.projectRoots,JSON.stringify(A));return}localStorage.removeItem(_t.projectRoots)},[A]),T.useEffect(()=>{localStorage.setItem(_t.fontFamily,r),localStorage.setItem(_t.fontSize,String(s)),p6(r,s)},[r,s]),T.useEffect(()=>{VJ(d),qJ(m),_6(d,m)},[m,d]),T.useEffect(()=>{$J(_)},[_]),T.useEffect(()=>{const P=n.current;if(P){if(e&&!P.open){P.showModal();return}!e&&P.open&&P.close()}},[e]),S.jsxs("dialog",{ref:n,className:"modal",onClose:()=>t(!1),"data-testid":"settings-modal",children:[S.jsxs("div",{className:"modal-box w-150 max-w-[90vw] h-120 max-h-[80vh] flex flex-col","data-testid":"settings-dropdown-content",children:[S.jsxs("div",{className:"flex items-center justify-between","data-testid":"settings-modal-header",children:[S.jsx("h2",{className:"text-sm font-semibold",children:"Configure"}),S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",onClick:()=>n.current?.close(),"data-testid":"settings-modal-close",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("path",{d:"M18 6 6 18"}),S.jsx("path",{d:"m6 6 12 12"})]})})]}),S.jsxs("div",{className:"mt-4 flex gap-4 flex-1 min-h-0","data-testid":"settings-modal-body",children:[S.jsx("div",{className:"flex w-28 shrink-0 flex-col gap-1","data-testid":"settings-modal-nav",children:[{id:"general",label:"General"},{id:"appearance",label:"Appearance"},{id:"git",label:"Git"}].map(P=>S.jsx("button",{type:"button",className:`btn btn-ghost btn-sm justify-start ${u===P.id?"btn-active":""}`,onClick:()=>c(P.id),"data-testid":`settings-modal-nav-${P.id}`,children:P.label},P.id))}),S.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto","data-testid":"settings-modal-content",children:[u==="general"&&S.jsxs("fieldset",{className:"fieldset bg-base-200/50 rounded-lg p-4","data-testid":"settings-section-general",children:[S.jsx("legend",{className:"fieldset-legend text-xs font-medium px-1",children:"Project Roots"}),S.jsxs("div",{className:"space-y-2","data-testid":"settings-dropdown-project-roots",children:[C.length?C.map((P,q)=>{const ee=P.trim(),F=ee?I.get(ee):"";return S.jsxs("div",{className:"flex items-start gap-2",children:[S.jsxs("div",{className:"flex-1",children:[S.jsx("input",{className:"input input-sm w-full font-mono text-xs bg-base-100",placeholder:"/path/to/projects",value:P,onChange:J=>{const B=[...C];B[q]=J.target.value,w(B)},"data-testid":"settings-dropdown-root-input","data-index":q}),F?S.jsx("div",{className:"mt-1 text-xs text-error",children:F==="invalid_path"?"Invalid path":F}):null]}),C.length>1?S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs text-base-content/40 hover:text-error",onClick:()=>{w(J=>J.filter((B,V)=>V!==q))},"data-testid":"settings-dropdown-remove-root","data-index":q,children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("path",{d:"M18 6 6 18"}),S.jsx("path",{d:"m6 6 12 12"})]})}):null]},q)}):S.jsx("input",{className:"input input-sm w-full font-mono text-xs bg-base-100",placeholder:"/path/to/projects",value:"",onChange:P=>w([P.target.value]),"data-testid":"settings-dropdown-root-input","data-index":0}),S.jsxs("button",{type:"button",className:"btn btn-ghost btn-xs text-base-content/60 gap-1",onClick:()=>w(P=>[...P,""]),"data-testid":"settings-dropdown-add-root",children:[S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("path",{d:"M5 12h14"}),S.jsx("path",{d:"M12 5v14"})]}),"Add path"]})]})]}),u==="appearance"&&S.jsxs("div",{className:"space-y-4","data-testid":"settings-section-appearance",children:[S.jsxs("fieldset",{className:"fieldset bg-base-200/50 rounded-lg p-4","data-testid":"settings-appearance-font",children:[S.jsx("legend",{className:"fieldset-legend text-xs font-medium px-1",children:"Font"}),S.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[S.jsxs("label",{className:"form-control w-full",children:[S.jsx("div",{className:"label py-0 pb-1",children:S.jsx("span",{className:"label-text text-xs text-base-content/60",children:"Family"})}),S.jsx("select",{className:"select select-sm bg-base-100",value:r,onChange:P=>i(P.currentTarget.value),"data-testid":"settings-appearance-font-family",children:WJ.map(P=>S.jsx("option",{value:P.value,children:P.label},P.value))})]}),S.jsxs("label",{className:"form-control w-full",children:[S.jsx("div",{className:"label py-0 pb-1",children:S.jsx("span",{className:"label-text text-xs text-base-content/60",children:"Size"})}),S.jsx("select",{className:"select select-sm bg-base-100",value:s,onChange:P=>o(Number(P.currentTarget.value)),"data-testid":"settings-appearance-font-size",children:GJ.map(P=>S.jsxs("option",{value:P,children:[P,"px"]},P))})]})]})]}),S.jsxs("fieldset",{className:"fieldset bg-base-200/50 rounded-lg p-4","data-testid":"settings-appearance-theme",children:[S.jsx("legend",{className:"fieldset-legend text-xs font-medium px-1",children:"Theme"}),S.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[S.jsxs("label",{className:"form-control w-full",children:[S.jsx("div",{className:"label py-0 pb-1",children:S.jsx("span",{className:"label-text text-xs text-base-content/60",children:"Base"})}),S.jsx("select",{className:"select select-sm bg-base-100",value:d,onChange:P=>p(P.currentTarget.value),"data-testid":"settings-appearance-theme-select",children:YJ.map(P=>S.jsx("option",{value:P.value,children:P.label},P.value))})]}),S.jsxs("label",{className:"form-control w-full",children:[S.jsx("div",{className:"label py-0 pb-1",children:S.jsx("span",{className:"label-text text-xs text-base-content/60",children:"Mode"})}),S.jsxs("div",{className:"flex h-8 items-center justify-between rounded-lg bg-base-100 px-3 text-sm","data-testid":"settings-appearance-dark-mode",children:[S.jsx("span",{children:"Dark"}),S.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:m,onChange:P=>g(P.currentTarget.checked),"aria-label":"Dark mode"})]})]})]})]})]}),u==="git"&&S.jsxs("fieldset",{className:"fieldset bg-base-200/50 rounded-lg p-4","data-testid":"settings-section-git",children:[S.jsx("legend",{className:"fieldset-legend text-xs font-medium px-1",children:"Commit Command"}),S.jsxs("div",{"data-testid":"settings-git-commit",children:[S.jsx("input",{className:"input input-sm w-full font-mono text-xs bg-base-100",value:_,onChange:P=>v(P.currentTarget.value),"data-testid":"settings-git-commit-command"}),S.jsx("div",{className:"mt-2 text-xs text-base-content/50",children:"Runs in the project root when you press Commit."})]})]})]})]})]}),S.jsx("form",{method:"dialog",className:"modal-backdrop",children:S.jsx("button",{type:"submit",children:"close"})})]})},QJ=["dev","start"],XJ=e=>{try{const t=localStorage.getItem(_t.preferredCommand);return t?JSON.parse(t)[e]??null:null}catch{return null}},ZJ=(e,t)=>{try{const n=localStorage.getItem(_t.preferredCommand),r=n?JSON.parse(n):{};r[e]=t,localStorage.setItem(_t.preferredCommand,JSON.stringify(r))}catch{}},JJ=(e,t)=>{if(!e.length)return null;const n=XJ(t);if(n){const r=e.find(i=>i.id===n);if(r)return r}for(const r of QJ){const i=e.find(s=>s.name.toLowerCase()===r);if(i)return i}return e[0]??null},ok=e=>e?.status==="pending"?S.jsx("span",{className:"loading loading-spinner loading-xs"}):e?.status==="running"?S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:[S.jsx("rect",{x:"7",y:"4",width:"4",height:"16",rx:"1"}),S.jsx("rect",{x:"13",y:"4",width:"4",height:"16",rx:"1"})]}):S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:S.jsx("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),eee=()=>{const{projectPath:e,setToolPanelVisible:t,setToolPanelTab:n}=Rn(an(F=>({projectPath:F.projectPath,setToolPanelVisible:F.setToolPanelVisible,setToolPanelTab:F.setToolPanelTab}))),{sendCommand:r}=UJ(),{runs:i,upsertRun:s,setError:o}=Mp(an(F=>({runs:F.runs,upsertRun:F.upsertRun,setError:F.setError}))),[u,c]=T.useState(!1),[d,p]=T.useState(!1),[m,g]=T.useState({}),_=Vn({queryKey:["project-commands",e],queryFn:()=>Tt(`/api/projects/commands?project=${encodeURIComponent(e)}`),enabled:!!e}),v=e?_.data?.commands??[]:[],x=T.useMemo(()=>JJ(v,e),[v,e]),C=T.useMemo(()=>x?v.filter(F=>F.id!==x.id):v,[v,x]),w=T.useMemo(()=>{const F={};for(const J of Object.values(i))!e||J.projectPath!==e||J.status==="running"&&(F[J.commandId]=J.runId);return F},[e,i]),A=T.useMemo(()=>{const F={};for(const[J,B]of Object.entries(w))F[J]={status:"running",runId:B};for(const[J,B]of Object.entries(m))F[J]={status:"pending",runId:B??w[J]??null};return F},[m,w]),R=T.useCallback((F=600)=>new Promise(J=>{if((()=>{const Y=Rn.getState();return Y.isToolPanelVisible&&Y.toolPanelTab==="output"&&Y.isTerminalReady&&Y.terminalCols>0&&Y.terminalRows>0})()){J();return}const V=Rn.subscribe(Y=>{Y.isToolPanelVisible&&Y.toolPanelTab==="output"&&Y.isTerminalReady&&(V(),J())});setTimeout(()=>{V(),J()},F)}),[]),N=T.useCallback(async F=>{if(!e)return;t(!0),n("output"),g(B=>({...B,[F.id]:w[F.id]??null})),await R();const J=Rn.getState();try{const B=await r("terminal_start",{projectPath:e,source:F.source,name:F.name,cols:J.terminalCols||void 0,rows:J.terminalRows||void 0});s(B.run),g(V=>{const Y={...V};return delete Y[F.id],Y})}catch(B){o(B instanceof Error?B.message:"command_failed"),g(V=>{const Y={...V};return delete Y[F.id],Y})}},[e,w,r,o,n,t,s,R]),L=T.useCallback(F=>{if(!e)return;const J=w[F.id];J&&(g(B=>({...B,[F.id]:J})),r("terminal_stop",{projectPath:e,runId:J}).then(B=>{s(B.run),g(V=>{const Y={...V};return delete Y[F.id],Y})}).catch(B=>{o(B instanceof Error?B.message:"command_failed"),g(V=>{const Y={...V};return delete Y[F.id],Y})}))},[e,w,r,s]),I=F=>{const J=A[F.id];if(J?.status==="running"){L(F);return}J?.status!=="pending"&&(e&&ZJ(e,F.id),N(F))},P=x?A[x.id]:void 0,q=P?.status==="pending",ee=!x||q;return T.useEffect(()=>{g({})},[e]),S.jsxs("div",{className:"join","data-testid":"command-launcher",children:[S.jsxs("button",{type:"button",className:"btn btn-sm join-item",onClick:()=>{x&&I(x)},disabled:ee,"data-testid":"command-launcher-primary",children:[ok(P),x?.label||"No commands"]}),S.jsxs($p,{open:u,onOpenChange:c,children:[S.jsx(Vp,{asChild:!0,children:S.jsx("button",{type:"button",className:"btn btn-sm join-item","data-testid":"command-launcher-more",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:[S.jsx("circle",{cx:"12",cy:"12",r:"1"}),S.jsx("circle",{cx:"19",cy:"12",r:"1"}),S.jsx("circle",{cx:"5",cy:"12",r:"1"})]})})}),S.jsx(qp,{align:"end",className:"w-full rounded-box bg-base-100 p-0! shadow-lg","data-testid":"command-launcher-menu",children:S.jsxs("ul",{className:"menu","data-testid":"command-launcher-commands",children:[C.length?C.map(F=>{const J=A[F.id],B=J?.status==="pending";return S.jsx("li",{onClick:()=>{I(F),c(!1)},className:B?"menu-disabled":"","data-testid":"command-launcher-item","data-command-id":F.id,"data-command-source":F.source,children:S.jsxs("a",{children:[ok(J),S.jsx("span",{className:"flex-1 truncate text-left",children:F.label})]})},F.id)}):null,S.jsx("li",{onClick:()=>{c(!1),p(!0)},"data-testid":"command-launcher-configure",children:S.jsxs("a",{children:[S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:[S.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),S.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),"Configure"]})})]})})]}),S.jsx(KJ,{open:d,onOpenChange:p})]})},v6=5,tee=()=>{try{const e=localStorage.getItem(_t.recentProjects);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)){const n=t.filter(r=>typeof r=="string");return Array.from(new Set(n)).slice(0,v6)}}catch{return[]}return[]},nee=e=>{const n=e.replace(/[/\\]+$/,"").split(/[/\\]/);return n[n.length-1]||e},ree=({onDropdownToggle:e})=>{const[t,n]=T.useState(!1),[r,i]=T.useState(""),s=r.trim().toLowerCase(),[o,u]=T.useState(()=>tee()),{projectPath:c,projectOpenError:d,setProjectPath:p,setProjectOpenError:m}=Rn(an(M=>({projectPath:M.projectPath,projectOpenError:M.projectOpenError,setProjectPath:M.setProjectPath,setProjectOpenError:M.setProjectOpenError}))),g=za({mutationFn:M=>Tt("/api/projects/open",{method:"POST",body:JSON.stringify({path:M})}),onSuccess:M=>{p(M.rootPath),m("")},onError:M=>{m(v3(M))}}),_=Vn({queryKey:["project-root-default"],queryFn:()=>Tt("/api/projects/browse")}),[v,x]=T.useState(()=>{try{const M=localStorage.getItem(_t.projectRoots);if(!M)return[];const Q=JSON.parse(M);if(Array.isArray(Q))return Q.filter(W=>typeof W=="string")}catch{return[]}return[]}),C=T.useMemo(()=>{const M=v.map(Q=>Q.trim()).filter(Boolean);return Array.from(new Set(M))},[v]),w=T.useMemo(()=>C.length?C:_.data?.path?[_.data.path]:An,[_.data?.path,C]),R=Vn({queryKey:["project-root-listings",w],queryFn:async()=>await Promise.all(w.map(async Q=>{try{const W=await Tt(`/api/projects/browse?path=${encodeURIComponent(Q)}`);return{inputPath:Q,rootPath:W.path,entries:W.entries}}catch(W){const me=ah(W);return{inputPath:Q,rootPath:Q,entries:An,error:me||"invalid_path"}}})),enabled:w.length>0}).data??(C.length===0&&_.data?[{inputPath:_.data.path,rootPath:_.data.path,entries:_.data.entries}]:An),N=T.useMemo(()=>R.flatMap(M=>M.entries),[R]),L=T.useMemo(()=>R.map(M=>s?{...M,filteredEntries:M.entries.filter(Q=>`${Q.name} ${Q.path}`.toLowerCase().includes(s))}:{...M,filteredEntries:M.entries}),[s,R]),I=T.useMemo(()=>s?L.filter(M=>M.error||M.filteredEntries.length>0):L,[L,s]),P=T.useMemo(()=>R.length?R.length===1?R[0]?.rootPath:`${R.length} roots`:"",[R]),q=!!c&&!N.some(M=>M.path===c),ee=T.useMemo(()=>!q||!c?An:[{name:c,path:c}],[c,q]),F=T.useMemo(()=>{const M=o.filter(Q=>!q||Q!==c).map(Q=>({name:nee(Q),path:Q}));return s?M.filter(Q=>`${Q.name} ${Q.path}`.toLowerCase().includes(s)):M},[s,c,q,o]);T.useEffect(()=>{!_.data?.path||v.some(Q=>Q.trim())||x([_.data.path])},[_.data?.path,v]),T.useEffect(()=>{if(C.length){localStorage.setItem(_t.projectRoots,JSON.stringify(C));return}localStorage.removeItem(_t.projectRoots)},[C]),T.useEffect(()=>{c&&u(M=>{const W=[c,...M.filter(me=>me!==c)].slice(0,v6);return localStorage.setItem(_t.recentProjects,JSON.stringify(W)),W})},[c]);const J=M=>{n(M),e?.(M)},B=M=>{M&&(d&&m(""),g.mutate(M))},V=M=>{M!==c&&(B(M),n(!1))},Y=M=>S.jsx("li",{className:"menu-title text-xs px-1","data-testid":"project-dropdown-group",children:S.jsx("span",{children:M})}),X=(M,Q="")=>M.map(W=>S.jsx("li",{children:S.jsx("button",{type:"button",className:"px-1",onClick:()=>V(W.path),"data-testid":"project-dropdown-item","data-path":W.path,children:W.name})},`${Q}${W.path}`));return S.jsxs($p,{open:t,onOpenChange:J,children:[S.jsx(Vp,{asChild:!0,children:S.jsx("button",{tabIndex:0,className:"btn btn-ghost justify-between","data-testid":"project-dropdown-trigger",children:S.jsxs("div",{className:"flex flex-col items-start",children:[S.jsx("span",{className:"text-xs text-gray-400",children:"Current project"}),S.jsx("span",{className:"truncate",children:c||(P?`Select a project (${P})`:"Select a project")})]})})}),S.jsxs(qp,{align:"start",className:"rounded-box bg-base-100 p-2 shadow w-full","data-testid":"project-dropdown-content",children:[S.jsx("input",{className:"input input-ghost input-xs px-1",placeholder:"Search projects",value:r,onChange:M=>i(M.target.value),"data-testid":"project-dropdown-filter"}),S.jsxs("ul",{className:"menu mt-2 p-0 max-h-96 flex-nowrap overflow-auto w-full","data-testid":"project-dropdown-list",children:[ee.length?X(ee,"missing-"):null,F.length?S.jsxs(T.Fragment,{children:[Y("Recent"),X(F,"recent-")]}):null,I.length?I.map(M=>S.jsxs(T.Fragment,{children:[Y(M.rootPath),M.filteredEntries.length?X(M.filteredEntries):S.jsx("li",{className:"disabled",children:S.jsx("span",{children:M.error?M.error==="invalid_path"?"Invalid path":M.error:s?"No matches":"No projects found"})})]},M.inputPath)):F.length?null:S.jsx("li",{className:"disabled",children:S.jsx("span",{children:N.length?"No matches":"No projects found"})})]})]})]})},iee=T.memo(({hasGit:e,hasGithub:t,capabilitiesLoading:n})=>S.jsx("header",{className:"border-b border-base-300 bg-base-100","data-testid":"app-header",children:S.jsx("div",{className:"flex flex-col gap-3 px-4 py-3",children:S.jsxs("div",{className:"flex flex-wrap items-center gap-3","data-testid":"app-header-content",children:[S.jsxs("div",{className:"text-3xl font-semibold","data-testid":"app-logo",children:["Diff",S.jsx("span",{className:"text-primary",children:"act"})]}),S.jsxs("div",{className:"flex flex-1 flex-nowrap gap-2","data-testid":"app-header-controls",children:[S.jsx(ree,{}),S.jsx(FJ,{hasGit:e,hasGithub:t,capabilitiesLoading:n})]}),S.jsx(eee,{})]})})})),see=({projectPath:e,isActive:t,selectedFilePath:n,onSelectedFilePathChange:r})=>{const[i,s]=T.useState({}),o=Vn({queryKey:["git-diff",e],queryFn:()=>zb(`/api/projects/diff?project=${encodeURIComponent(e)}`),enabled:!!(e&&t)}),u=Vn({queryKey:["git-diff-staged",e],queryFn:()=>zb(`/api/projects/diff?project=${encodeURIComponent(e)}&arg=--cached`),enabled:!!(e&&t)}),c=T.useMemo(()=>$b(o.data),[o.data]),d=T.useMemo(()=>$b(u.data),[u.data]),p=T.useMemo(()=>new Set(d.map(A=>A.path)),[d]),m=T.useMemo(()=>{const A=new Set;for(const R of d)A.add(R.path);for(const R of c)A.add(R.path);return A},[d,c]),g=T.useMemo(()=>Ub(d,c).map(R=>({...R,staged:R.path in i?i[R.path]:p.has(R.path)})),[d,i,p,c]),_=T.useMemo(()=>n?g.find(A=>A.path===n)||null:g[0]||null,[g,n]),x=T.useMemo(()=>_?_.fileDiff?_.fileDiff:y3(_.path,_.patch):null,[_])||null,C=T.useCallback(async(A,R)=>{if(!e||!A)return;const N=i[A];s(L=>({...L,[A]:R}));try{await Tt(`/api/projects/stage?project=${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify({path:A,staged:R})})}catch(L){console.error("Failed to update staged state",L),s(I=>{if(!(A in I)||I[A]!==R)return I;if(N===void 0){const P={...I};return delete P[A],P}return{...I,[A]:N}})}},[e,i]),w=T.useCallback(async A=>{if(!e||g.length===0)return;const R=Array.from(new Set(g.map(L=>L.path))).filter(Boolean);if(R.length===0)return;const N=new Map(R.map(L=>[L,i[L]]));s(L=>{const I={...L};for(const P of R)I[P]=A;return I});try{await Tt(`/api/projects/stage?project=${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify({paths:R,staged:A})})}catch(L){console.error("Failed to update staged state",L),s(I=>{let P=!1;const q={...I};for(const ee of R){if(!(ee in I)||I[ee]!==A)continue;const F=N.get(ee);if(F===void 0){delete q[ee],P=!0;continue}q[ee]=F,P=!0}return P?q:I})}},[g,e,i]);return T.useEffect(()=>{s(A=>{let R=!1;const N={...A};for(const[L,I]of Object.entries(A))(!m.has(L)||p.has(L)===I)&&(delete N[L],R=!0);return R?N:A})},[m,p]),T.useEffect(()=>{if(!g.length){r("");return}if(!n){r(g[0]?.path||"");return}g.find(R=>R.path===n)||r(g[0]?.path||"")},[g,r,n]),{changes:g,selectedChange:_,selectedFileDiff:x,changesLoading:o.isLoading||u.isLoading,diffError:o.error||u.error,toggleStage:C,toggleStageAll:w}},aee=({projectPath:e,filePath:t,isActive:n})=>{const r=Vn({queryKey:["file-content",e,t],queryFn:()=>Tt(`/api/projects/file?project=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`),enabled:!!(e&&t&&n)});return{file:r.data??null,isLoading:r.isLoading,error:r.error}},oee=e=>{const t=[],n=r=>{for(const i of r){if(i.type==="file"){t.push({name:i.name,path:i.path});continue}i.children?.length&&n(i.children)}};return n(e),t},lee=({projectPath:e,isActive:t,selectedFilePath:n,onSelectedFilePathChange:r})=>{const i=Vn({queryKey:["file-tree",e],queryFn:()=>Tt(`/api/projects/tree?project=${encodeURIComponent(e)}`),enabled:!!(e&&t)}),s=i.data?.entries??An,o=T.useMemo(()=>oee(s),[s]),u=i.data?.available??!0;return T.useEffect(()=>{if(!t)return;if(!o.length){r("");return}if(!n){r(o[0]?.path||"");return}o.some(d=>d.path===n)||r(o[0]?.path||"")},[o,t,r,n]),{entries:s,flatFiles:o,isAvailable:u,isLoading:i.isLoading}},uee=({projectPath:e,selectedCommitSha:t,onSelectedCommitShaChange:n,selectedHistoryFilePath:r,onSelectedHistoryFilePathChange:i,hasGit:s,isActive:o,pageSize:u})=>{const{currentBranch:c}=E3(e,s),[d,p]=T.useState([]),[m,g]=T.useState(!1),_=Jc({queryKey:["git-history",e,c||""],queryFn:({pageParam:N=0})=>Tt(`/api/projects/history?project=${encodeURIComponent(e)}&skip=${N}&limit=${u}`),getNextPageParam:N=>{if(!(!N||!N.hasMore))return N.nextSkip},initialPageParam:0,enabled:!!(e&&s&&o)}),v=T.useMemo(()=>_.data?.pages.flatMap(N=>N.items)??[],[_.data]),x=T.useMemo(()=>v.find(N=>N.sha===t)||null,[v,t]);T.useEffect(()=>{if(!e||!s||!t){p([]);return}if(!o)return;let N=!1;const L=new AbortController;return p([]),(async()=>{try{const P=await Tt(`/api/projects/commits/${encodeURIComponent(t)}/files?project=${encodeURIComponent(e)}`,{signal:L.signal});if(N)return;P&&P.length&&p(q=>Ub(q,P))}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;console.error("Failed to load commit files",P)}})(),()=>{N=!0,L.abort()}},[s,o,e,t]),T.useEffect(()=>{if(!e||!s||!t){g(!1);return}if(!o){g(!1);return}let N=!1;const L=new AbortController;g(!0);const I=ee=>{if(!ee.trim())return;const F=$b(ee);F.length&&p(J=>Ub(J,F))},P=ee=>{ee.trim()&&I(ee.endsWith(`
|
|
1445
1445
|
`)?ee:`${ee}
|
|
1446
1446
|
`)};return(async()=>{try{const ee=await fetch(`/api/projects/commits/${encodeURIComponent(t)}/diff?project=${encodeURIComponent(e)}`,{signal:L.signal});if(!ee.ok){const Y=await ee.text();throw new Error(Y||ee.statusText)}const F=ee.body?.getReader();if(!F){const Y=await ee.text();I(Y);return}const J=new TextDecoder;let B="",V="";for(;;){const{value:Y,done:X}=await F.read();if(X)break;B+=J.decode(Y,{stream:!0});let M=B.indexOf(`
|
|
1447
1447
|
`);for(;M!==-1;){const Q=B.slice(0,M);B=B.slice(M+1),Q.startsWith("diff --")?(V&&P(V),V=`${Q}
|
|
1448
1448
|
`):V&&(V+=`${Q}
|
|
1449
1449
|
`),M=B.indexOf(`
|
|
1450
|
-
`)}}B+=J.decode(),B&&(V?V+=B:V=B),V&&P(V)}catch(ee){if(ee instanceof DOMException&&ee.name==="AbortError")return;console.error("Failed to load commit diff",ee)}finally{N||g(!1)}})(),()=>{N=!0,L.abort()}},[s,o,e,t]);const C=T.useMemo(()=>r?d.find(N=>N.path===r)||null:d[0]||null,[d,r]),A=T.useMemo(()=>C?C.fileDiff?C.fileDiff:
|
|
1451
|
-
`).filter(Boolean);let r=0;for(const i of n){let s;try{s=JSON.parse(i)}catch{continue}const o=ls(s);if(!o||et(o.type)!=="response_item")continue;const u=ls(o.payload);if(!u)continue;r+=1;const c=`history-${r}`,d=yee(o,u,c);d&&t.push(d)}return t},Eee=e=>{const t=ls(e);if(!t)return null;const n=et(t.method);if(!n)return null;const r=ls(t.params)||{},i=Mr(r,"turnId","turn_id"),s=o=>i?`${i}:${o}`:o;if(n==="item/started"||n==="item/completed"){const o=vee(r.item);if(!o)return null;const u=s(o.id);return{mode:"replace",item:u===o.id?o:{...o,id:u}}}if(n==="item/agentMessage/delta"||n==="agentMessage/delta"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"delta");return!o||!u?null:{mode:"appendAgentText",id:s(o),text:u}}if(n==="item/reasoning/summaryTextDelta"||n==="reasoning/summaryText/delta"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"delta"),c=$_(r,"summaryIndex","summary_index");return!o||!u?null:{mode:"appendReasoningSummary",id:s(o),text:u,index:c??0}}if(n==="item/reasoning/textDelta"||n==="reasoning/text/delta"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"delta"),c=$_(r,"contentIndex","content_index");return!o||!u?null:{mode:"appendReasoningContent",id:s(o),text:u,index:c??0}}if(n==="item/reasoning/summaryPartAdded"||n==="reasoning/summaryPart/added"){const o=Mr(r,"itemId","item_id"),u=$_(r,"summaryIndex","summary_index");return o?{mode:"addReasoningSummaryPart",id:s(o),index:u??0}:null}if(n==="item/commandExecution/outputDelta"||n==="commandExecution/output/delta"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"delta");return!o||!u?null:{mode:"appendCommandOutput",id:s(o),text:u}}if(n==="item/commandExecution/terminalInteraction"||n==="terminalInteraction"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"stdin","text");return!o||!u?null:{mode:"appendTerminalInteraction",id:s(o),text:u}}return null},xee=(e,t)=>{if(t.mode==="replace"){const r=e.findIndex(s=>s.id===t.item.id);if(r<0)return[...e,t.item];const i=[...e];return i[r]=t.item,i}const n=e.findIndex(r=>r.id===t.id);if(t.mode==="appendAgentText"){if(n<0)return[...e,{type:"agentMessage",id:t.id,text:t.text}];const r=e[n];if(!r||r.type!=="agentMessage")return e;const i=[...e];return i[n]={...r,text:r.text+t.text},i}if(t.mode==="appendReasoningSummary"){const r=n>=0&&e[n]?.type==="reasoning"?e[n]:{type:"reasoning",id:t.id,summary:[],content:[]},i=[...r.summary];for(;i.length<=t.index;)i.push("");i[t.index]=`${i[t.index]||""}${t.text}`;const s={...r,summary:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}if(t.mode==="appendReasoningContent"){const r=n>=0&&e[n]?.type==="reasoning"?e[n]:{type:"reasoning",id:t.id,summary:[],content:[]},i=[...r.content];for(;i.length<=t.index;)i.push("");i[t.index]=`${i[t.index]||""}${t.text}`;const s={...r,content:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}if(t.mode==="addReasoningSummaryPart"){const r=n>=0&&e[n]?.type==="reasoning"?e[n]:{type:"reasoning",id:t.id,summary:[],content:[]},i=[...r.summary];for(;i.length<=t.index;)i.push("");const s={...r,summary:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}if(t.mode==="appendCommandOutput"){const r=n>=0&&e[n]?.type==="commandExecution"?e[n]:{type:"commandExecution",id:t.id,command:"",cwd:"",status:"inProgress",processId:null,commandActions:[],aggregatedOutput:"",exitCode:null,durationMs:null},i=`${r.aggregatedOutput||""}${t.text}`,s={...r,aggregatedOutput:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}if(t.mode==="appendTerminalInteraction"){const r=n>=0&&e[n]?.type==="commandExecution"?e[n]:{type:"commandExecution",id:t.id,command:"",cwd:"",status:"inProgress",processId:null,commandActions:[],aggregatedOutput:"",exitCode:null,durationMs:null},i=`${r.aggregatedOutput||""}${t.text}`,s={...r,aggregatedOutput:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}return e},wee={threads:{},eventsByThread:{},itemsByThread:{}},lk=(e,t)=>{const n={...e};for(const r of t||An)r?.threadId&&(n[r.threadId]={...n[r.threadId],...r});return n},Cee=e=>{if(!e||typeof e!="object")return!1;const t=e,n=r=>{if(!r||typeof r!="object")return null;const i=r.type;return typeof i=="string"?i:null};if(typeof t.method=="string"){const r=t.method;if(r==="item/started"||r==="item/updated"||r==="item/completed"){const i=t.params,s=n(i&&typeof i=="object"?i.item:null);return s==="fileChange"||s==="file_change"}}if(typeof t.type=="string"){const r=t.type;if(r==="item.started"||r==="item.updated"||r==="item.completed"){const i=n(t.item);return i==="fileChange"||i==="file_change"}}return!1},Tee=(e,t)=>{if(t.type==="threads_loaded")return{...e,threads:lk(e.threads,t.agents)};if(t.type==="thread_status")return{...e,threads:lk(e.threads,[t.agent])};if(t.type==="thread_event"){const n=t.event,r=n&&typeof n.method=="string"?n.method:n&&typeof n.type=="string"?n.type:"event",i={id:`${t.threadId}-${Date.now()}-${Math.random().toString(16).slice(2)}`,type:r,label:
|
|
1450
|
+
`)}}B+=J.decode(),B&&(V?V+=B:V=B),V&&P(V)}catch(ee){if(ee instanceof DOMException&&ee.name==="AbortError")return;console.error("Failed to load commit diff",ee)}finally{N||g(!1)}})(),()=>{N=!0,L.abort()}},[s,o,e,t]);const C=T.useMemo(()=>r?d.find(N=>N.path===r)||null:d[0]||null,[d,r]),A=T.useMemo(()=>C?C.fileDiff?C.fileDiff:y3(C.path,C.patch):null,[C])||null;T.useEffect(()=>{if(!o)return;if(!v.length){n("");return}v.some(L=>L.sha===t)||n(v[0]?.sha||"")},[v,o,n,t]),T.useEffect(()=>{if(!o)return;if(!d.length){i("");return}if(!r){i(d[0]?.path||"");return}d.some(L=>L.path===r)||i(d[0]?.path||"")},[d,o,i,r]);const R=T.useCallback(()=>{!_.hasNextPage||_.isFetchingNextPage||_.fetchNextPage()},[_.fetchNextPage,_.hasNextPage,_.isFetchingNextPage]);return{historyCommits:v,selectedCommit:x,historyChanges:d,selectedHistoryChange:C,selectedHistoryFileDiff:A,commitDiffLoading:m,historyLoading:_.isLoading,historyLoadingMore:_.isFetchingNextPage,hasMoreHistory:!!_.hasNextPage,loadMoreHistory:R}},cee=["<environment_context>","<user_instructions>","# AGENTS.md instructions for","<skill>","<user_shell_command>"],hee=new Set(["inProgress","completed","failed","declined"]),dee=new Set(["inProgress","completed","failed","declined"]),fee=new Set(["inProgress","completed","failed"]),pee=e=>{const t=e.trimStart();return cee.some(n=>t.startsWith(n))},ls=e=>e&&typeof e=="object"?e:null,et=e=>typeof e=="string"?e:"",Sl=e=>typeof e=="string"?e:null,U_=e=>typeof e=="number"?e:null,Mr=(e,...t)=>{for(const n of t){const r=e[n];if(typeof r=="string")return r}return""},$_=(e,...t)=>{for(const n of t){const r=e[n];if(typeof r=="number")return r}return null},V_=(e,t)=>typeof e=="string"&&t.has(e)?e:null,Gc=e=>typeof e=="string"?e?[e]:[]:Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"){const n=t;if(typeof n.text=="string")return n.text}return""}).filter(Boolean):[],y6=e=>Array.isArray(e)?e.map(t=>{if(!t||typeof t!="object")return null;const n=t,r=typeof n.type=="string"?n.type:"";if(r==="text"||r==="input_text"||r==="output_text"){const i=et(n.text);return i?{type:"text",text:i}:null}if(r==="image"){const i=et(n.url);return i?{type:"image",url:i}:null}if(r==="image_url"||r==="input_image"){const i=et(n.image_url);return i?{type:"image",url:i}:null}if(r==="localImage"||r==="local_image"){const i=et(n.path);return i?{type:"localImage",path:i}:null}if(r==="skill"){const i=et(n.name),s=et(n.path);return!i&&!s?null:{type:"skill",name:i,path:s}}return null}).filter(Boolean):[],mee=e=>e.map(t=>t.type==="text"?t.text:"").filter(Boolean).join(""),q_=e=>{const t=e.content,n=Gc(t).join("");if(n)return n;const r=et(e.text);if(r)return r;const i=et(e.message);return i||""},gee=e=>{const t=ls(e);if(!t)return null;const n=et(t.type),r=et(t.command);if(!n||!r)return null;if(n==="read"){const i=et(t.name),s=et(t.path);return!i||!s?null:{type:n,command:r,name:i,path:s}}if(n==="listFiles"){const i=Sl(t.path);return{type:n,command:r,path:i}}if(n==="search"){const i=Sl(t.query),s=Sl(t.path);return{type:n,command:r,query:i,path:s}}return n==="unknown"?{type:n,command:r}:null},_ee=e=>{const t=ls(e);if(!t)return null;const n=et(t.type);if(n==="add"||n==="delete")return{type:n};if(n==="update"){const r=Sl(t.move_path);return{type:n,move_path:r}}return null},bee=e=>{const t=ls(e);if(!t)return null;const n=et(t.path),r=_ee(t.kind),i=et(t.diff);return!n||!r?null:{path:n,kind:r,diff:i}},vee=e=>{const t=ls(e);if(!t)return null;const n=et(t.type),r=et(t.id);if(!n||!r)return null;if(n==="userMessage"){const i=y6(t.content);return i.length?{type:n,id:r,content:i}:null}if(n==="agentMessage"){const i=et(t.text);return{type:n,id:r,text:i}}if(n==="reasoning"){const i=Gc(t.summary),s=Gc(t.content);return{type:n,id:r,summary:i,content:s}}if(n==="commandExecution"){const i=et(t.command),s=et(t.cwd),o=V_(t.status,hee)||"inProgress",u=Sl(t.processId),c=Array.isArray(t.commandActions)?t.commandActions.map(g=>gee(g)).filter(g=>!!g):[],d=Sl(t.aggregatedOutput),p=U_(t.exitCode),m=U_(t.durationMs);return{type:n,id:r,command:i,cwd:s,status:o,processId:u,commandActions:c,aggregatedOutput:d,exitCode:p,durationMs:m}}if(n==="fileChange"){const i=V_(t.status,dee);if(!i)return null;const s=Array.isArray(t.changes)?t.changes.map(o=>bee(o)).filter(o=>!!o):[];return{type:n,id:r,changes:s,status:i}}if(n==="mcpToolCall"){const i=et(t.server),s=et(t.tool),o=V_(t.status,fee);if(!i||!s||!o)return null;const u=U_(t.durationMs),c=t.result??null,d=t.error??null;return{type:n,id:r,server:i,tool:s,status:o,arguments:t.arguments??null,result:c,error:d,durationMs:u}}if(n==="webSearch"){const i=et(t.query);return i?{type:n,id:r,query:i}:null}if(n==="imageView"){const i=et(t.path);return i?{type:n,id:r,path:i}:null}if(n==="enteredReviewMode"){const i=et(t.review);return i?{type:n,id:r,review:i}:null}if(n==="exitedReviewMode"){const i=et(t.review);return i?{type:n,id:r,review:i}:null}return null},yee=(e,t,n)=>{const r=et(t.type),i=et(t.id)||et(e.id)||n;if(r==="message"){const s=et(t.role);if(s==="user"){let o=y6(t.content);const c=mee(o)||q_(t);if(c&&pee(c))return null;if(!o.length){const d=q_(t);d&&(o=[{type:"text",text:d}])}return o.length?{type:"userMessage",id:i,content:o}:null}if(s==="assistant"){const o=q_(t);return o?{type:"agentMessage",id:i,text:o}:null}return null}if(r==="reasoning"){const s=Gc(t.summary??t.summary_text),o=Gc(t.content??t.raw_content??t.text);return!s.length&&!o.length?null:{type:"reasoning",id:i,summary:s,content:o}}if(r==="web_search_call"){const s=ls(t.action),o=et(s?.query)||et(t.query);return o?{type:"webSearch",id:i,query:o}:null}return null},See=e=>{const t=[],n=e.split(`
|
|
1451
|
+
`).filter(Boolean);let r=0;for(const i of n){let s;try{s=JSON.parse(i)}catch{continue}const o=ls(s);if(!o||et(o.type)!=="response_item")continue;const u=ls(o.payload);if(!u)continue;r+=1;const c=`history-${r}`,d=yee(o,u,c);d&&t.push(d)}return t},Eee=e=>{const t=ls(e);if(!t)return null;const n=et(t.method);if(!n)return null;const r=ls(t.params)||{},i=Mr(r,"turnId","turn_id"),s=o=>i?`${i}:${o}`:o;if(n==="item/started"||n==="item/completed"){const o=vee(r.item);if(!o)return null;const u=s(o.id);return{mode:"replace",item:u===o.id?o:{...o,id:u}}}if(n==="item/agentMessage/delta"||n==="agentMessage/delta"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"delta");return!o||!u?null:{mode:"appendAgentText",id:s(o),text:u}}if(n==="item/reasoning/summaryTextDelta"||n==="reasoning/summaryText/delta"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"delta"),c=$_(r,"summaryIndex","summary_index");return!o||!u?null:{mode:"appendReasoningSummary",id:s(o),text:u,index:c??0}}if(n==="item/reasoning/textDelta"||n==="reasoning/text/delta"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"delta"),c=$_(r,"contentIndex","content_index");return!o||!u?null:{mode:"appendReasoningContent",id:s(o),text:u,index:c??0}}if(n==="item/reasoning/summaryPartAdded"||n==="reasoning/summaryPart/added"){const o=Mr(r,"itemId","item_id"),u=$_(r,"summaryIndex","summary_index");return o?{mode:"addReasoningSummaryPart",id:s(o),index:u??0}:null}if(n==="item/commandExecution/outputDelta"||n==="commandExecution/output/delta"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"delta");return!o||!u?null:{mode:"appendCommandOutput",id:s(o),text:u}}if(n==="item/commandExecution/terminalInteraction"||n==="terminalInteraction"){const o=Mr(r,"itemId","item_id"),u=Mr(r,"stdin","text");return!o||!u?null:{mode:"appendTerminalInteraction",id:s(o),text:u}}return null},xee=(e,t)=>{if(t.mode==="replace"){const r=e.findIndex(s=>s.id===t.item.id);if(r<0)return[...e,t.item];const i=[...e];return i[r]=t.item,i}const n=e.findIndex(r=>r.id===t.id);if(t.mode==="appendAgentText"){if(n<0)return[...e,{type:"agentMessage",id:t.id,text:t.text}];const r=e[n];if(!r||r.type!=="agentMessage")return e;const i=[...e];return i[n]={...r,text:r.text+t.text},i}if(t.mode==="appendReasoningSummary"){const r=n>=0&&e[n]?.type==="reasoning"?e[n]:{type:"reasoning",id:t.id,summary:[],content:[]},i=[...r.summary];for(;i.length<=t.index;)i.push("");i[t.index]=`${i[t.index]||""}${t.text}`;const s={...r,summary:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}if(t.mode==="appendReasoningContent"){const r=n>=0&&e[n]?.type==="reasoning"?e[n]:{type:"reasoning",id:t.id,summary:[],content:[]},i=[...r.content];for(;i.length<=t.index;)i.push("");i[t.index]=`${i[t.index]||""}${t.text}`;const s={...r,content:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}if(t.mode==="addReasoningSummaryPart"){const r=n>=0&&e[n]?.type==="reasoning"?e[n]:{type:"reasoning",id:t.id,summary:[],content:[]},i=[...r.summary];for(;i.length<=t.index;)i.push("");const s={...r,summary:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}if(t.mode==="appendCommandOutput"){const r=n>=0&&e[n]?.type==="commandExecution"?e[n]:{type:"commandExecution",id:t.id,command:"",cwd:"",status:"inProgress",processId:null,commandActions:[],aggregatedOutput:"",exitCode:null,durationMs:null},i=`${r.aggregatedOutput||""}${t.text}`,s={...r,aggregatedOutput:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}if(t.mode==="appendTerminalInteraction"){const r=n>=0&&e[n]?.type==="commandExecution"?e[n]:{type:"commandExecution",id:t.id,command:"",cwd:"",status:"inProgress",processId:null,commandActions:[],aggregatedOutput:"",exitCode:null,durationMs:null},i=`${r.aggregatedOutput||""}${t.text}`,s={...r,aggregatedOutput:i};if(n<0)return[...e,s];const o=[...e];return o[n]=s,o}return e},wee={threads:{},eventsByThread:{},itemsByThread:{}},lk=(e,t)=>{const n={...e};for(const r of t||An)r?.threadId&&(n[r.threadId]={...n[r.threadId],...r});return n},Cee=e=>{if(!e||typeof e!="object")return!1;const t=e,n=r=>{if(!r||typeof r!="object")return null;const i=r.type;return typeof i=="string"?i:null};if(typeof t.method=="string"){const r=t.method;if(r==="item/started"||r==="item/updated"||r==="item/completed"){const i=t.params,s=n(i&&typeof i=="object"?i.item:null);return s==="fileChange"||s==="file_change"}}if(typeof t.type=="string"){const r=t.type;if(r==="item.started"||r==="item.updated"||r==="item.completed"){const i=n(t.item);return i==="fileChange"||i==="file_change"}}return!1},Tee=(e,t)=>{if(t.type==="threads_loaded")return{...e,threads:lk(e.threads,t.agents)};if(t.type==="thread_status")return{...e,threads:lk(e.threads,[t.agent])};if(t.type==="thread_event"){const n=t.event,r=n&&typeof n.method=="string"?n.method:n&&typeof n.type=="string"?n.type:"event",i={id:`${t.threadId}-${Date.now()}-${Math.random().toString(16).slice(2)}`,type:r,label:b3(t.event),time:new Date().toISOString(),payload:t.event},o=[...e.eventsByThread[t.threadId]||An,i].slice(-200),u=Eee(t.event),c=e.itemsByThread[t.threadId]||An,d=u?xee(c,u).slice(-200):c;return{...e,eventsByThread:{...e.eventsByThread,[t.threadId]:o},itemsByThread:{...e.itemsByThread,[t.threadId]:d}}}return e},kee=e=>{const t=Il(),{connectionState:n,sendCommand:r,subscribe:i}=Ey(),s=T.useRef(e),o=Vn({queryKey:["agents"],queryFn:()=>Tt("/api/agents"),enabled:!!e}),[u,c]=T.useReducer(Tee,wee),d=o.data||An;T.useEffect(()=>{d&&d.length&&c({type:"threads_loaded",agents:d})},[d]),T.useEffect(()=>{s.current=e},[e]);const p=r;return T.useEffect(()=>i((m,g)=>{if(m==="agent_status"){const _=g;if(!_||typeof _.projectPath!="string"||!_.threadId)return;const v=s.current;if(!v||_.projectPath!==v){console.info(`[agent] status from ${_.projectPath}`,_.label,_.status);return}c({type:"thread_status",threadId:_.threadId,agent:_});return}if(m==="agent_event"){const _=g;if(!_||typeof _.threadId!="string")return;const v=s.current,x=typeof _.projectPath=="string"?_.projectPath:void 0;if(x&&v&&x!==v){console.info(`[agent] event from ${x}`,b3(_.event));return}c({type:"thread_event",threadId:_.threadId,event:_.event}),x&&v&&x===v&&Cee(_.event)&&t.invalidateQueries({queryKey:["git-diff",v]})}}),[t,i]),{state:u,agentsQuery:o,connectionState:n,sendCommand:p}},Aee=10,uk=e=>`${e.type}:${e.id}`,ck=e=>e.type!=="userMessage"?null:e.content.map(t=>t.type==="text"?t.text:t.type==="image"?t.url:t.type==="localImage"?t.path:t.type==="skill"?`${t.name}:${t.path}`:"").join(`
|
|
1452
1452
|
`),Ree=(e,t)=>{if(!e.length)return t;if(!t.length)return e;const n=new Set(e.map(i=>uk(i))),r=new Set(e.map(i=>ck(i)).filter(i=>i!==null));return[...e,...t.filter(i=>{if(n.has(uk(i)))return!1;const s=ck(i);return!(s!==null&&r.has(s))})]},Nee=()=>{const e=Il(),[t,n]=T.useState(""),[r,i]=T.useState(!1),{projectPath:s}=Rn(an(O=>({projectPath:O.projectPath}))),{selectedThreadId:o,setSelectedThreadId:u,attachedIssues:c,removeAttachedIssue:d,clearAttachedIssues:p}=ro(an(O=>({selectedThreadId:O.selectedThreadId,setSelectedThreadId:O.setSelectedThreadId,attachedIssues:O.attachedIssues,removeAttachedIssue:O.removeAttachedIssue,clearAttachedIssues:O.clearAttachedIssues}))),{state:m,sendCommand:g}=kee(s),_=o?m.threads[o]:null,v=_?.status||null,x=_?.lastError||null,C=Jc({queryKey:["threads",s],queryFn:({pageParam:O})=>{const ce=new URLSearchParams;return O&&ce.set("cursor",String(O)),s&&ce.set("project",s),ce.set("limit",String(Aee)),Tt(`/api/threads?${ce.toString()}`)},initialPageParam:"",getNextPageParam:O=>{if(O)return O.nextCursor||void 0},enabled:!!s}),w=za({mutationFn:O=>g("agent_start",O),onSuccess:O=>{n(""),O.agent.threadId&&u(O.agent.threadId),e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["threads",s]})},onError:()=>{i(!1)}}),A=za({mutationFn:O=>g("thread_message",O),onSuccess:O=>{n(""),O.threadId&&O.threadId!==o&&u(O.threadId)},onError:()=>{i(!1)}}),R=za({mutationFn:O=>g("agent_stop",O)}),N=w.isPending||A.isPending,L=w.error||A.error||R.error,I=x||L,P=T.useMemo(()=>C.data?.pages.flatMap(O=>O.data)??An,[C.data]),q=T.useMemo(()=>s?[...P].filter(O=>O.cwd===s).sort((O,ce)=>ce.createdAt-O.createdAt):An,[P,s]),ee=q.find(O=>O.id===o)||null,F=Vn({queryKey:["thread-history",ee?.path||""],queryFn:()=>zb(`/api/threads/history?path=${encodeURIComponent(ee?.path||"")}`),enabled:!!ee?.path}),J=T.useMemo(()=>See(F.data||""),[F.data]),B=T.useMemo(()=>(o?m.itemsByThread[o]:null)||An,[m.itemsByThread,o]),V=T.useMemo(()=>Ree(J,B),[J,B]),Y=C.isLoading,X=C.isFetchingNextPage,M=!!C.hasNextPage,Q=F.isLoading;T.useEffect(()=>{if(v){if(v==="running"||v==="starting"){r||i(!0);return}r&&i(!1)}},[v,r]);const W=T.useCallback(()=>{if(!s)return;const O=t.trim();if(!O)return;let ce=O;if(c.length>0&&(ce=`${c.map(ve=>[`[Issue #${ve.number}] ${ve.title}`,ve.url?`URL: ${ve.url}`:null,"",ve.body||"(No description)"].filter(Ee=>Ee!==null).join(`
|
|
1453
1453
|
`)).join(`
|
|
1454
1454
|
|
|
@@ -1458,12 +1458,12 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
|
|
|
1458
1458
|
|
|
1459
1459
|
---
|
|
1460
1460
|
|
|
1461
|
-
${O}`,p()),i(!0),o){A.mutate({threadId:o,projectPath:s,text:ce});return}w.mutate({projectPath:s,prompt:ce})},[t,c,p,s,o,i,w,A]),me=T.useCallback(()=>{if(!o)return;const O=m.threads[o]?.id;R.mutate({threadId:o,agentId:O})},[m.threads,o,R]),z=T.useCallback(()=>{u(""),n(""),i(!1),p()},[u,i,p]),U=T.useCallback(O=>{u(O),i(!1),p()},[u,p]),se=T.useCallback(()=>{!C.hasNextPage||C.isFetchingNextPage||C.fetchNextPage()},[C.fetchNextPage,C.hasNextPage,C.isFetchingNextPage]);return{projectPath:s,agentPrompt:t,setAgentPrompt:n,onSend:W,onStop:me,isRunning:N,showStop:r,canStop:!!o,error:I,items:V,sessions:q,selectedSessionId:o,onSelectSession:U,onNewSession:z,onLoadMoreSessions:se,hasMoreSessions:M,sessionsLoading:Y,sessionsLoadingMore:X,historyLoading:Q,attachedIssues:c,removeAttachedIssue:d}};function El(e,t){const n=t.direction??1,r=e==="x"?t.initialWidth:t.initialHeight,i=e==="x"?t.minWidth:t.minHeight,s=e==="x"?t.maxWidth:t.maxHeight,[o,u]=T.useState(r),c=T.useRef(null),d=T.useRef(!1),p=T.useCallback(m=>{m.button===0&&(c.current={startCoord:e==="x"?m.clientX:m.clientY,startSize:o},m.preventDefault())},[e,o]);return T.useEffect(()=>{const m=_=>{const v=c.current;if(!v)return;const x=e==="x"?_.clientX:_.clientY,C=v.startSize+(x-v.startCoord)*n,w=Math.min(s,Math.max(i,C));u(w),d.current=!0},g=()=>{c.current&&(c.current=null)};return window.addEventListener("pointermove",m),window.addEventListener("pointerup",g),()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",g)}},[e,n,s,i]),T.useEffect(()=>{if(d.current)return;const m=Math.min(s,Math.max(i,r));u(m)},[r,s,i]),e==="x"?{width:o,handleResizeStart:p}:{height:o,handleResizeStart:p}}var Lee=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Oee="VisuallyHidden",S6=T.forwardRef((e,t)=>S.jsx(ni.span,{...e,ref:t,style:{...Lee,...e.style}}));S6.displayName=Oee;var Dee=S6,[om]=Av("Tooltip",[jp]),lm=jp(),E6="TooltipProvider",Mee=700,m1="tooltip.open",[Iee,xy]=om(E6),x6=e=>{const{__scopeTooltip:t,delayDuration:n=Mee,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,o=T.useRef(!0),u=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),S.jsx(Iee,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:T.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:T.useCallback(d=>{u.current=d},[]),disableHoverableContent:i,children:s})};x6.displayName=E6;var Yc="Tooltip",[Pee,_h]=om(Yc),w6=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:u}=e,c=xy(Yc,e.__scopeTooltip),d=lm(t),[p,m]=T.useState(null),g=NR(),_=T.useRef(0),v=o??c.disableHoverableContent,x=u??c.delayDuration,C=T.useRef(!1),[w,A]=tN({prop:r,defaultProp:i??!1,onChange:P=>{P?(c.onOpen(),document.dispatchEvent(new CustomEvent(m1))):c.onClose(),s?.(P)},caller:Yc}),R=T.useMemo(()=>w?C.current?"delayed-open":"instant-open":"closed",[w]),N=T.useCallback(()=>{window.clearTimeout(_.current),_.current=0,C.current=!1,A(!0)},[A]),L=T.useCallback(()=>{window.clearTimeout(_.current),_.current=0,A(!1)},[A]),I=T.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{C.current=!0,A(!0),_.current=0},x)},[x,A]);return T.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]),S.jsx(ZR,{...d,children:S.jsx(Pee,{scope:t,contentId:g,open:w,stateAttribute:R,trigger:p,onTriggerChange:m,onTriggerEnter:T.useCallback(()=>{c.isOpenDelayedRef.current?I():N()},[c.isOpenDelayedRef,I,N]),onTriggerLeave:T.useCallback(()=>{v?L():(window.clearTimeout(_.current),_.current=0)},[L,v]),onOpen:N,onClose:L,disableHoverableContent:v,children:n})})};w6.displayName=Yc;var g1="TooltipTrigger",C6=T.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=_h(g1,n),s=xy(g1,n),o=lm(n),u=T.useRef(null),c=Ci(t,u,i.onTriggerChange),d=T.useRef(!1),p=T.useRef(!1),m=T.useCallback(()=>d.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(Hv,{asChild:!0,...o,children:S.jsx(ni.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:ir(e.onPointerMove,g=>{g.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:ir(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:ir(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ir(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:ir(e.onBlur,i.onClose),onClick:ir(e.onClick,i.onClose)})})});C6.displayName=g1;var wy="TooltipPortal",[Bee,Hee]=om(wy,{forceMount:void 0}),T6=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,s=_h(wy,t);return S.jsx(Bee,{scope:t,forceMount:n,children:S.jsx(uh,{present:n||s.open,children:S.jsx(Fv,{asChild:!0,container:i,children:r})})})};T6.displayName=wy;var Ol="TooltipContent",k6=T.forwardRef((e,t)=>{const n=Hee(Ol,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,o=_h(Ol,e.__scopeTooltip);return S.jsx(uh,{present:r||o.open,children:o.disableHoverableContent?S.jsx(A6,{side:i,...s,ref:t}):S.jsx(Fee,{side:i,...s,ref:t})})}),Fee=T.forwardRef((e,t)=>{const n=_h(Ol,e.__scopeTooltip),r=xy(Ol,e.__scopeTooltip),i=T.useRef(null),s=Ci(t,i),[o,u]=T.useState(null),{trigger:c,onClose:d}=n,p=i.current,{onPointerInTransitChange:m}=r,g=T.useCallback(()=>{u(null),m(!1)},[m]),_=T.useCallback((v,x)=>{const C=v.currentTarget,w={x:v.clientX,y:v.clientY},A=$ee(w,C.getBoundingClientRect()),R=Vee(w,A),N=qee(x.getBoundingClientRect()),L=Gee([...R,...N]);u(L),m(!0)},[m]);return T.useEffect(()=>()=>g(),[g]),T.useEffect(()=>{if(c&&p){const v=C=>_(C,p),x=C=>_(C,c);return c.addEventListener("pointerleave",v),p.addEventListener("pointerleave",x),()=>{c.removeEventListener("pointerleave",v),p.removeEventListener("pointerleave",x)}}},[c,p,_,g]),T.useEffect(()=>{if(o){const v=x=>{const C=x.target,w={x:x.clientX,y:x.clientY},A=c?.contains(C)||p?.contains(C),R=!Wee(w,o);A?g():R&&(g(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,p,o,d,g]),S.jsx(A6,{...e,ref:s})}),[jee,zee]=om(Yc,{isInside:!1}),Uee=z7("TooltipContent"),A6=T.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...u}=e,c=_h(Ol,n),d=lm(n),{onClose:p}=c;return T.useEffect(()=>(document.addEventListener(m1,p),()=>document.removeEventListener(m1,p)),[p]),T.useEffect(()=>{if(c.trigger){const m=g=>{g.target?.contains(c.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,p]),S.jsx(Rv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:S.jsxs(JR,{"data-state":c.stateAttribute,...d,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(Uee,{children:r}),S.jsx(jee,{scope:n,isInside:!0,children:S.jsx(Dee,{id:c.contentId,role:"tooltip",children:i||r})})]})})});k6.displayName=Ol;var R6="TooltipArrow",N6=T.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=lm(n);return zee(R6,n).isInside?null:S.jsx(eN,{...i,...r,ref:t})});N6.displayName=R6;function $ee(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Vee(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function qee(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Wee(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const u=t[s],c=t[o],d=u.x,p=u.y,m=c.x,g=c.y;p>r!=g>r&&n<(m-d)*(r-p)/(g-p)+d&&(i=!i)}return i}function Gee(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Yee(t)}function Yee(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Kee=x6,Qee=w6,Xee=C6,Zee=T6,Jee=k6,ete=N6;function tte({delayDuration:e=0,...t}){return S.jsx(Kee,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function nte({...e}){return S.jsx(tte,{children:S.jsx(Qee,{"data-slot":"tooltip",...e})})}function rte({...e}){return S.jsx(Xee,{"data-slot":"tooltip-trigger",...e})}function ite({className:e,sideOffset:t=0,children:n,...r}){return S.jsx(Zee,{children:S.jsxs(Jee,{"data-slot":"tooltip-content",sideOffset:t,className:oh("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs bg-foreground text-background z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)",e),...r,children:[n,S.jsx(ete,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs bg-foreground fill-foreground z-50"})]})})}const ste=120,ate=e=>{const[t,n]=T.useState(!1),[r,i]=T.useState(!1),s=T.useRef(null);return T.useLayoutEffect(()=>{const o=s.current;if(!o){i(!1);return}i(o.scrollHeight>o.clientHeight)},[t,e.content]),S.jsx("div",{className:"chat chat-start self-end gap-0 text-sm max-w-[80%] min-w-0","data-testid":"agent-panel-user-message",children:S.jsx("div",{className:"px-3 py-1 rounded-xl bg-base-300 max-w-full break-all","data-testid":"agent-panel-user-message-bubble",children:S.jsxs("div",{className:"relative",children:[S.jsx("div",{ref:s,className:oh(!t&&r?"pb-8":""),style:r&&!t?{maxHeight:ste,overflow:"hidden",maskImage:"linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%)",WebkitMaskImage:"linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%)"}:void 0,children:S.jsx(ote,{content:e.content})}),r&&!t?S.jsx("div",{className:"absolute inset-x-0 bottom-0 flex h-8 items-end justify-center pb-1",children:S.jsx("button",{className:"btn btn-neutral btn-link btn-xs h-6 min-h-6 px-2 bg-base-300/80 backdrop-blur-sm",onClick:()=>n(!0),type:"button","data-testid":"agent-panel-user-message-expand",children:"Expand"})}):null]})})})},ote=({content:e})=>S.jsx("div",{className:"space-y-1 break-all","data-testid":"agent-panel-user-message-content",children:e.map((t,n)=>{if(t.type==="text")return S.jsx("div",{className:"whitespace-pre-wrap break-all","data-testid":"agent-panel-user-message-text",children:t.text},`text-${n}`);if(t.type==="image")return S.jsx("img",{src:t.url,alt:"User input",className:"max-w-full rounded","data-testid":"agent-panel-user-message-image"},`image-${n}`);if(t.type==="localImage")return S.jsxs("div",{className:"text-xs text-base-content/60","data-testid":"agent-panel-user-message-local-image",children:["Local image: ",t.path]},`local-${n}`);if(t.type==="skill"){const r=[t.name,t.path].filter(Boolean).join(" ");return S.jsxs("div",{className:"text-xs text-base-content/60","data-testid":"agent-panel-user-message-skill",children:["Skill: ",r]},`skill-${n}`)}return null})}),lte=e=>S.jsx("div",{className:"chat chat-start gap-0 text-sm","data-testid":"agent-panel-agent-message",children:S.jsx("div",{className:oh("whitespace-pre-wrap"),children:e.text})}),ute=e=>{const t=e.summary.join(`
|
|
1461
|
+
${O}`,p()),i(!0),o){A.mutate({threadId:o,projectPath:s,text:ce});return}w.mutate({projectPath:s,prompt:ce})},[t,c,p,s,o,i,w,A]),me=T.useCallback(()=>{if(!o)return;const O=m.threads[o]?.id;R.mutate({threadId:o,agentId:O})},[m.threads,o,R]),z=T.useCallback(()=>{u(""),n(""),i(!1),p()},[u,i,p]),U=T.useCallback(O=>{u(O),i(!1),p()},[u,p]),se=T.useCallback(()=>{!C.hasNextPage||C.isFetchingNextPage||C.fetchNextPage()},[C.fetchNextPage,C.hasNextPage,C.isFetchingNextPage]);return{projectPath:s,agentPrompt:t,setAgentPrompt:n,onSend:W,onStop:me,isRunning:N,showStop:r,canStop:!!o,error:I,items:V,sessions:q,selectedSessionId:o,onSelectSession:U,onNewSession:z,onLoadMoreSessions:se,hasMoreSessions:M,sessionsLoading:Y,sessionsLoadingMore:X,historyLoading:Q,attachedIssues:c,removeAttachedIssue:d}};function El(e,t){const n=t.direction??1,r=e==="x"?t.initialWidth:t.initialHeight,i=e==="x"?t.minWidth:t.minHeight,s=e==="x"?t.maxWidth:t.maxHeight,[o,u]=T.useState(r),c=T.useRef(null),d=T.useRef(!1),p=T.useCallback(m=>{m.button===0&&(c.current={startCoord:e==="x"?m.clientX:m.clientY,startSize:o},m.preventDefault())},[e,o]);return T.useEffect(()=>{const m=_=>{const v=c.current;if(!v)return;const x=e==="x"?_.clientX:_.clientY,C=v.startSize+(x-v.startCoord)*n,w=Math.min(s,Math.max(i,C));u(w),d.current=!0},g=()=>{c.current&&(c.current=null)};return window.addEventListener("pointermove",m),window.addEventListener("pointerup",g),()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",g)}},[e,n,s,i]),T.useEffect(()=>{if(d.current)return;const m=Math.min(s,Math.max(i,r));u(m)},[r,s,i]),e==="x"?{width:o,handleResizeStart:p}:{height:o,handleResizeStart:p}}var Lee=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Oee="VisuallyHidden",S6=T.forwardRef((e,t)=>S.jsx(ni.span,{...e,ref:t,style:{...Lee,...e.style}}));S6.displayName=Oee;var Dee=S6,[om]=Av("Tooltip",[jp]),lm=jp(),E6="TooltipProvider",Mee=700,m1="tooltip.open",[Iee,xy]=om(E6),x6=e=>{const{__scopeTooltip:t,delayDuration:n=Mee,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,o=T.useRef(!0),u=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),S.jsx(Iee,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:T.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:T.useCallback(d=>{u.current=d},[]),disableHoverableContent:i,children:s})};x6.displayName=E6;var Yc="Tooltip",[Pee,_h]=om(Yc),w6=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:u}=e,c=xy(Yc,e.__scopeTooltip),d=lm(t),[p,m]=T.useState(null),g=N3(),_=T.useRef(0),v=o??c.disableHoverableContent,x=u??c.delayDuration,C=T.useRef(!1),[w,A]=tN({prop:r,defaultProp:i??!1,onChange:P=>{P?(c.onOpen(),document.dispatchEvent(new CustomEvent(m1))):c.onClose(),s?.(P)},caller:Yc}),R=T.useMemo(()=>w?C.current?"delayed-open":"instant-open":"closed",[w]),N=T.useCallback(()=>{window.clearTimeout(_.current),_.current=0,C.current=!1,A(!0)},[A]),L=T.useCallback(()=>{window.clearTimeout(_.current),_.current=0,A(!1)},[A]),I=T.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{C.current=!0,A(!0),_.current=0},x)},[x,A]);return T.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]),S.jsx(Z3,{...d,children:S.jsx(Pee,{scope:t,contentId:g,open:w,stateAttribute:R,trigger:p,onTriggerChange:m,onTriggerEnter:T.useCallback(()=>{c.isOpenDelayedRef.current?I():N()},[c.isOpenDelayedRef,I,N]),onTriggerLeave:T.useCallback(()=>{v?L():(window.clearTimeout(_.current),_.current=0)},[L,v]),onOpen:N,onClose:L,disableHoverableContent:v,children:n})})};w6.displayName=Yc;var g1="TooltipTrigger",C6=T.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=_h(g1,n),s=xy(g1,n),o=lm(n),u=T.useRef(null),c=Ci(t,u,i.onTriggerChange),d=T.useRef(!1),p=T.useRef(!1),m=T.useCallback(()=>d.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(Hv,{asChild:!0,...o,children:S.jsx(ni.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:ir(e.onPointerMove,g=>{g.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:ir(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:ir(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ir(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:ir(e.onBlur,i.onClose),onClick:ir(e.onClick,i.onClose)})})});C6.displayName=g1;var wy="TooltipPortal",[Bee,Hee]=om(wy,{forceMount:void 0}),T6=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,s=_h(wy,t);return S.jsx(Bee,{scope:t,forceMount:n,children:S.jsx(uh,{present:n||s.open,children:S.jsx(Fv,{asChild:!0,container:i,children:r})})})};T6.displayName=wy;var Ol="TooltipContent",k6=T.forwardRef((e,t)=>{const n=Hee(Ol,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,o=_h(Ol,e.__scopeTooltip);return S.jsx(uh,{present:r||o.open,children:o.disableHoverableContent?S.jsx(A6,{side:i,...s,ref:t}):S.jsx(Fee,{side:i,...s,ref:t})})}),Fee=T.forwardRef((e,t)=>{const n=_h(Ol,e.__scopeTooltip),r=xy(Ol,e.__scopeTooltip),i=T.useRef(null),s=Ci(t,i),[o,u]=T.useState(null),{trigger:c,onClose:d}=n,p=i.current,{onPointerInTransitChange:m}=r,g=T.useCallback(()=>{u(null),m(!1)},[m]),_=T.useCallback((v,x)=>{const C=v.currentTarget,w={x:v.clientX,y:v.clientY},A=$ee(w,C.getBoundingClientRect()),R=Vee(w,A),N=qee(x.getBoundingClientRect()),L=Gee([...R,...N]);u(L),m(!0)},[m]);return T.useEffect(()=>()=>g(),[g]),T.useEffect(()=>{if(c&&p){const v=C=>_(C,p),x=C=>_(C,c);return c.addEventListener("pointerleave",v),p.addEventListener("pointerleave",x),()=>{c.removeEventListener("pointerleave",v),p.removeEventListener("pointerleave",x)}}},[c,p,_,g]),T.useEffect(()=>{if(o){const v=x=>{const C=x.target,w={x:x.clientX,y:x.clientY},A=c?.contains(C)||p?.contains(C),R=!Wee(w,o);A?g():R&&(g(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,p,o,d,g]),S.jsx(A6,{...e,ref:s})}),[jee,zee]=om(Yc,{isInside:!1}),Uee=z7("TooltipContent"),A6=T.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...u}=e,c=_h(Ol,n),d=lm(n),{onClose:p}=c;return T.useEffect(()=>(document.addEventListener(m1,p),()=>document.removeEventListener(m1,p)),[p]),T.useEffect(()=>{if(c.trigger){const m=g=>{g.target?.contains(c.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,p]),S.jsx(Rv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:S.jsxs(J3,{"data-state":c.stateAttribute,...d,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(Uee,{children:r}),S.jsx(jee,{scope:n,isInside:!0,children:S.jsx(Dee,{id:c.contentId,role:"tooltip",children:i||r})})]})})});k6.displayName=Ol;var R6="TooltipArrow",N6=T.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=lm(n);return zee(R6,n).isInside?null:S.jsx(eN,{...i,...r,ref:t})});N6.displayName=R6;function $ee(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Vee(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function qee(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Wee(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const u=t[s],c=t[o],d=u.x,p=u.y,m=c.x,g=c.y;p>r!=g>r&&n<(m-d)*(r-p)/(g-p)+d&&(i=!i)}return i}function Gee(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Yee(t)}function Yee(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Kee=x6,Qee=w6,Xee=C6,Zee=T6,Jee=k6,ete=N6;function tte({delayDuration:e=0,...t}){return S.jsx(Kee,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function nte({...e}){return S.jsx(tte,{children:S.jsx(Qee,{"data-slot":"tooltip",...e})})}function rte({...e}){return S.jsx(Xee,{"data-slot":"tooltip-trigger",...e})}function ite({className:e,sideOffset:t=0,children:n,...r}){return S.jsx(Zee,{children:S.jsxs(Jee,{"data-slot":"tooltip-content",sideOffset:t,className:oh("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs bg-foreground text-background z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)",e),...r,children:[n,S.jsx(ete,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs bg-foreground fill-foreground z-50"})]})})}const ste=120,ate=e=>{const[t,n]=T.useState(!1),[r,i]=T.useState(!1),s=T.useRef(null);return T.useLayoutEffect(()=>{const o=s.current;if(!o){i(!1);return}i(o.scrollHeight>o.clientHeight)},[t,e.content]),S.jsx("div",{className:"chat chat-start self-end gap-0 text-sm max-w-[80%] min-w-0","data-testid":"agent-panel-user-message",children:S.jsx("div",{className:"px-3 py-1 rounded-xl bg-base-300 max-w-full break-all","data-testid":"agent-panel-user-message-bubble",children:S.jsxs("div",{className:"relative",children:[S.jsx("div",{ref:s,className:oh(!t&&r?"pb-8":""),style:r&&!t?{maxHeight:ste,overflow:"hidden",maskImage:"linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%)",WebkitMaskImage:"linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%)"}:void 0,children:S.jsx(ote,{content:e.content})}),r&&!t?S.jsx("div",{className:"absolute inset-x-0 bottom-0 flex h-8 items-end justify-center pb-1",children:S.jsx("button",{className:"btn btn-neutral btn-link btn-xs h-6 min-h-6 px-2 bg-base-300/80 backdrop-blur-sm",onClick:()=>n(!0),type:"button","data-testid":"agent-panel-user-message-expand",children:"Expand"})}):null]})})})},ote=({content:e})=>S.jsx("div",{className:"space-y-1 break-all","data-testid":"agent-panel-user-message-content",children:e.map((t,n)=>{if(t.type==="text")return S.jsx("div",{className:"whitespace-pre-wrap break-all","data-testid":"agent-panel-user-message-text",children:t.text},`text-${n}`);if(t.type==="image")return S.jsx("img",{src:t.url,alt:"User input",className:"max-w-full rounded","data-testid":"agent-panel-user-message-image"},`image-${n}`);if(t.type==="localImage")return S.jsxs("div",{className:"text-xs text-base-content/60","data-testid":"agent-panel-user-message-local-image",children:["Local image: ",t.path]},`local-${n}`);if(t.type==="skill"){const r=[t.name,t.path].filter(Boolean).join(" ");return S.jsxs("div",{className:"text-xs text-base-content/60","data-testid":"agent-panel-user-message-skill",children:["Skill: ",r]},`skill-${n}`)}return null})}),lte=e=>S.jsx("div",{className:"chat chat-start gap-0 text-sm","data-testid":"agent-panel-agent-message",children:S.jsx("div",{className:oh("whitespace-pre-wrap"),children:e.text})}),ute=e=>{const t=e.summary.join(`
|
|
1462
1462
|
`),n=e.content.join(`
|
|
1463
1463
|
`);return S.jsxs("details",{className:"collapse bg-base-100 flex-none","data-testid":"agent-panel-reasoning",children:[S.jsx("summary",{className:"collapse-title text-xs text-base-content/60 p-0",children:"Thinking"}),S.jsxs("div",{className:"collapse-content text-xs p-0 text-base-content/60",children:[t?S.jsx("div",{className:"whitespace-pre-wrap","data-testid":"agent-panel-reasoning-summary",children:t}):null,t&&n?S.jsx("div",{className:"h-2"}):null,n?S.jsx("div",{className:"whitespace-pre-wrap","data-testid":"agent-panel-reasoning-content",children:n}):null]})]})},cte=e=>S.jsxs("div",{className:"text-xs text-base-content/60","data-testid":"agent-panel-web-search",children:["Web search: ",e.query]}),hte=e=>{const t={completed:"status-success",inProgress:"status-warning",failed:"status-error",declined:"status-error"}[e.status];return S.jsxs("details",{className:"collapse bg-base-100 flex-none",children:[S.jsx("summary",{className:"collapse-title text-xs text-base-content/60 p-0",children:S.jsxs("div",{className:"flex gap-2 items-center",children:[S.jsx("div",{className:`status ${t}`}),S.jsx("div",{children:e.command})]})}),S.jsx("div",{className:"collapse-content p-0",children:S.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-xs text-base-content/60",children:e.aggregatedOutput||"(no output)"})})]})},dte=e=>e.type==="update"?e.move_path?`update -> ${e.move_path}`:"update":e.type,fte=e=>S.jsxs("div",{className:"rounded border border-base-300 bg-base-100 p-2 text-xs","data-testid":"agent-panel-file-change",children:[S.jsxs("div",{className:"text-base-content/60",children:["status: ",e.status]}),S.jsx("div",{className:"space-y-2 mt-2",children:e.changes.map((t,n)=>S.jsxs("div",{children:[S.jsxs("div",{className:"text-base-content/70",children:[t.path," (",dte(t.kind),")"]}),t.diff?S.jsx("pre",{className:"mt-1 whitespace-pre-wrap text-xs text-base-content/60",children:t.diff}):null]},`${t.path}-${n}`))})]}),pte=e=>{const t=e.arguments?JSON.stringify(e.arguments,null,2):"",n=e.result?JSON.stringify(e.result,null,2):"",r=e.error?JSON.stringify(e.error,null,2):"";return S.jsxs("div",{className:"rounded border border-base-300 bg-base-100 p-2 text-xs","data-testid":"agent-panel-mcp-tool-call",children:[S.jsxs("div",{className:"text-base-content/70",children:["MCP: ",e.server,"/",e.tool]}),S.jsxs("div",{className:"text-base-content/60",children:["status: ",e.status]}),t?S.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-xs text-base-content/60",children:t}):null,n?S.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-xs text-base-content/60",children:n}):null,r?S.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-xs text-error",children:r}):null]})},mte=e=>S.jsxs("div",{className:"text-xs text-base-content/60","data-testid":"agent-panel-image-view",children:["Image: ",e.path]}),gte=e=>S.jsxs("div",{className:"text-xs text-base-content/60","data-testid":"agent-panel-entered-review",children:["Entered review mode: ",e.review]}),_te=e=>S.jsxs("div",{className:"text-xs text-base-content/60","data-testid":"agent-panel-exited-review",children:["Exited review mode: ",e.review]}),bte=({item:e})=>e.type==="userMessage"?S.jsx(ate,{...e}):e.type==="agentMessage"?S.jsx(lte,{...e}):e.type==="reasoning"?S.jsx(ute,{...e}):e.type==="webSearch"?S.jsx(cte,{...e}):e.type==="commandExecution"?S.jsx(hte,{...e}):e.type==="fileChange"?S.jsx(fte,{...e}):e.type==="mcpToolCall"?S.jsx(pte,{...e}):e.type==="imageView"?S.jsx(mte,{...e}):e.type==="enteredReviewMode"?S.jsx(gte,{...e}):e.type==="exitedReviewMode"?S.jsx(_te,{...e}):null,vte=T.memo(()=>{const{projectPath:e,agentPrompt:t,setAgentPrompt:n,onSend:r,onStop:i,isRunning:s,showStop:o,canStop:u,error:c,items:d,sessions:p,selectedSessionId:m,onSelectSession:g,onNewSession:_,onLoadMoreSessions:v,hasMoreSessions:x,sessionsLoading:C,sessionsLoadingMore:w,historyLoading:A,attachedIssues:R,removeAttachedIssue:N}=Nee(),{width:L,handleResizeStart:I}=El("x",{initialWidth:224,minWidth:180,maxWidth:420,direction:-1}),P=T.useMemo(()=>d.reduce((B,V)=>{const Y=B[B.length-1];return Y?.type==="reasoning"&&V.type==="reasoning"?(B[B.length-1]={...Y,summary:[...Y.summary,...V.summary],content:[...Y.content,...V.content]},B):(B.push(V),B)},[]),[d]),q=T.useRef(null),ee=T.useCallback(()=>{const B=q.current;B&&(B.scrollTop=B.scrollHeight)},[]);T.useLayoutEffect(()=>{ee()},[P,ee]);const F=T.useCallback(()=>{r(),requestAnimationFrame(ee)},[r,ee]),J=o?!u:s||!t.trim();return S.jsx("div",{className:"flex min-h-0 flex-col h-full","data-testid":"agent-panel",children:e?S.jsxs("div",{className:"flex min-h-0 flex-1","data-testid":"agent-panel-body",children:[S.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[S.jsxs("div",{className:"flex flex-col min-h-0 flex-1 space-y-1 overflow-auto p-3",ref:q,"data-testid":"agent-panel-thread-scroll",children:[P.length?P.map(B=>S.jsx(bte,{item:B},`${B.type}-${B.id}`)):S.jsx("div",{className:"text-sm text-base-content/60","data-testid":"agent-panel-thread-empty",children:A?"Loading session history...":"Start a conversation below."}),c?S.jsx("div",{className:"mt-2 text-xs text-error","data-testid":"agent-panel-error",children:ah(c)}):null]}),S.jsxs("div",{className:"p-3","data-testid":"agent-panel-input-area",children:[R.length>0&&S.jsx("div",{className:"mb-2 flex flex-wrap items-center gap-1","data-testid":"agent-panel-attached-issues",children:R.map(B=>S.jsxs(nte,{children:[S.jsx(rte,{asChild:!0,children:S.jsxs("span",{className:"badge badge-md badge-neutral badge-outline gap-1 cursor-default","data-testid":"agent-panel-attached-issue","data-issue-number":B.number,children:["#",B.number,S.jsx("button",{type:"button",className:"text-base-content/50 hover:text-base-content",onClick:()=>N(B.number),title:"Remove","data-testid":"agent-panel-attached-issue-remove",children:"✕"})]})}),S.jsx(ite,{sideOffset:4,"data-testid":"agent-panel-attached-issue-tooltip",children:B.title})]},B.number))}),S.jsxs("div",{className:"relative",children:[S.jsx("textarea",{className:"textarea textarea-bordered w-full min-h-24 pr-12 pb-10",placeholder:"Message",value:t,onChange:B=>n(B.target.value),onKeyDown:B=>{o||s||B.nativeEvent&&"isComposing"in B.nativeEvent&&B.nativeEvent.isComposing||B.key!=="Enter"||B.shiftKey||(B.preventDefault(),F())},"data-testid":"agent-panel-input"}),S.jsx("button",{className:"btn btn-circle btn-neutral btn-sm absolute bottom-2 right-2 ",onClick:o?i:F,disabled:J,"aria-label":o?"Stop":"Send",type:"button","data-testid":"agent-panel-action",children:o?S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:[S.jsx("rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}),S.jsx("rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"})]}):S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:[S.jsx("path",{d:"m5 12 7-7 7 7"}),S.jsx("path",{d:"M12 19V5"})]})})]})]})]})}),S.jsxs("div",{className:"relative flex w-full flex-col gap-2 border-l border-base-300 p-2 border-t-0 overflow-auto lg:w-(--session-list-width) lg:flex-none",style:{"--session-list-width":`${L}px`},"data-testid":"agent-panel-sessions",children:[S.jsx("div",{className:"absolute left-0 top-0 hidden h-full w-1 cursor-col-resize lg:block",onPointerDown:I,"data-testid":"agent-panel-sessions-resize-handle"}),S.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs font-semibold tracking-wide text-base-content/60","data-testid":"agent-panel-sessions-header",children:[S.jsx("span",{children:"Sessions"}),S.jsx("button",{className:"btn btn-ghost btn-xs",onClick:_,"data-testid":"agent-panel-new-session",children:"New"})]}),p.length?S.jsx("div",{className:"tabs space-y-2 flex-col","data-testid":"agent-panel-sessions-list",children:p.map(B=>S.jsx("button",{"data-id":B.id,className:`tab h-4 justify-between p-0 gap-0 min-w-0 w-full ${B.id===m?"tab-active":""}`,onClick:()=>g(B.id),"data-testid":"agent-panel-session",children:S.jsx("span",{className:"text-xs font-medium truncate",children:B.preview||B.id})},B.id))}):S.jsx("div",{className:"text-sm text-base-content/60","data-testid":"agent-panel-sessions-empty",children:C?"Loading sessions...":"No sessions yet."}),x?S.jsx("button",{className:"btn btn-ghost btn-xs w-full",onClick:v,disabled:w,"data-testid":"agent-panel-load-more",children:w?"Loading...":"Load more"}):null]})]}):S.jsx("div",{className:"text-sm text-base-content/60","data-testid":"agent-panel-empty",children:"Open a project to start a Codex session."})})});function al(e,t,n){let r=n.initialDeps??[],i,s=!0;function o(){var u,c,d;let p;n.key&&((u=n.debug)!=null&&u.call(n))&&(p=Date.now());const m=e();if(!(m.length!==r.length||m.some((v,x)=>r[x]!==v)))return i;r=m;let _;if(n.key&&((c=n.debug)!=null&&c.call(n))&&(_=Date.now()),i=t(...m),n.key&&((d=n.debug)!=null&&d.call(n))){const v=Math.round((Date.now()-p)*100)/100,x=Math.round((Date.now()-_)*100)/100,C=x/16,w=(A,R)=>{for(A=String(A);A.length<R;)A=" "+A;return A};console.info(`%c⏱ ${w(x,5)} /${w(v,5)} ms`,`
|
|
1464
1464
|
font-size: .6rem;
|
|
1465
1465
|
font-weight: bold;
|
|
1466
|
-
color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1,i}return o.updateDeps=u=>{r=u},o}function hk(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const yte=(e,t)=>Math.abs(e-t)<1.01,Ste=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},dk=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ete=e=>e,xte=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},wte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=o=>{const{width:u,height:c}=o;t({width:Math.round(u),height:Math.round(c)})};if(i(dk(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(o=>{const u=()=>{const c=o[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){i({width:d.inlineSize,height:d.blockSize});return}}i(dk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},fk={passive:!0},pk=typeof window>"u"?!0:"onscrollend"in window,Cte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const s=e.options.useScrollendEvent&&pk?()=>{}:Ste(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=p=>()=>{const{horizontal:m,isRtl:g}=e.options;i=m?n.scrollLeft*(g&&-1||1):n.scrollTop,s(),t(i,p)},u=o(!0),c=o(!1);n.addEventListener("scroll",u,fk);const d=e.options.useScrollendEvent&&pk;return d&&n.addEventListener("scrollend",c,fk),()=>{n.removeEventListener("scroll",u),d&&n.removeEventListener("scrollend",c)}},Tte=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},kte=(e,{adjustments:t=0,behavior:n},r)=>{var i,s;const o=e+t;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:o,behavior:n})};class Ate{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const o=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ete,rangeExtractor:xte,onChange:()=>{},measureElement:Tte,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=al(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let o=r-1;o>=0;o--){const u=n[o];if(i.has(u.lane))continue;const c=s.get(u.lane);if(c==null||u.end>c.end?s.set(u.lane,u):u.end<c.end&&i.set(u.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((o,u)=>o.end===u.end?o.index-u.index:o.end-u.end)[0]:void 0},this.getMeasurementOptions=al(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,i,s,o,u)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:o,lanes:u}),{key:!1}),this.getMeasurements=al(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:o,lanes:u},c)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const g of this.laneAssignments.keys())g>=n&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,d),m=new Array(u).fill(void 0);for(let g=0;g<d;g++){const _=p[g];_&&(m[_.lane]=g)}for(let g=d;g<n;g++){const _=s(g),v=this.laneAssignments.get(g);let x,C;if(v!==void 0&&this.options.lanes>1){x=v;const N=m[x],L=N!==void 0?p[N]:void 0;C=L?L.end+this.options.gap:r+i}else{const N=this.options.lanes===1?p[g-1]:this.getFurthestMeasurement(p,g);C=N?N.end+this.options.gap:r+i,x=N?N.lane:g%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(g,x)}const w=c.get(_),A=typeof w=="number"?w:this.options.estimateSize(g),R=C+A;p[g]={index:g,start:C,size:A,end:R,key:_,lane:x},m[x]=g}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=al(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,s)=>this.range=n.length>0&&r>0?Rte({measurements:n,outerSize:r,scrollOffset:i,lanes:s}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=al(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,s,o)=>s===null||o===null?[]:n({startIndex:s,endIndex:o,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),s=this.measurementsCache[i];if(!s)return;const o=s.key,u=this.elementsCache.get(o);u!==n&&(u&&this.observer.unobserve(u),this.observer.observe(n),this.elementsCache.set(o,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const s=this.itemSizeCache.get(i.key)??i.size,o=r-s;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,o,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=al(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,o=n.length;s<o;s++){const u=n[s],c=r[u];i.push(c)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return hk(r[L6(0,r.length-1,i=>hk(r[i]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=n>=o+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const s=this.getSize(),o=this.getScrollOffset();if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const u=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,r,i.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let s=0;const o=10,u=d=>{if(!this.targetWindow)return;const p=this.getOffsetForIndex(n,d);if(!p){console.warn("Failed to get offset for index:",n);return}const[m,g]=p;this._scrollToOffset(m,{adjustments:void 0,behavior:i}),this.targetWindow.requestAnimationFrame(()=>{const _=()=>{if(this.currentScrollToIndex!==n)return;const v=this.getScrollOffset(),x=this.getOffsetForIndex(n,g);if(!x){console.warn("Failed to get offset for index:",n);return}yte(x[0],v)||c(g)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(_):_()})},c=d=>{this.targetWindow&&this.currentScrollToIndex===n&&(s++,s<o?this.targetWindow.requestAnimationFrame(()=>u(d)):console.warn(`Failed to scroll to index ${n} after ${o} attempts.`))};u(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((n=r[r.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let o=r.length-1;for(;o>=0&&s.some(u=>u===null);){const u=r[o];s[u.lane]===null&&(s[u.lane]=u.end),o--}i=Math.max(...s.filter(u=>u!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const L6=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function Rte({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const i=e.length-1,s=c=>e[c].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=L6(0,i,s,n),u=o;if(r===1)for(;u<i&&e[u].end<n+t;)u++;else if(r>1){const c=Array(r).fill(0);for(;u<i&&c.some(p=>p<n+t);){const p=e[u];c[p.lane]=p.end,u++}const d=Array(r).fill(n+t);for(;o>=0&&d.some(p=>p>=n);){const p=e[o];d[p.lane]=p.start,o--}o=Math.max(0,o-o%r),u=Math.min(i,u+(r-1-u%r))}return{startIndex:o,endIndex:u}}const mk=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Nte({useFlushSync:e=!0,...t}){const n=T.useReducer(()=>({}),{})[1],r={...t,onChange:(s,o)=>{var u;e&&o?Ip.flushSync(n):n(),(u=t.onChange)==null||u.call(t,s,o)}},[i]=T.useState(()=>new Ate(r));return i.setOptions(r),mk(()=>i._didMount(),[]),mk(()=>i._willUpdate()),i}function O6(e){return Nte({observeElementRect:wte,observeElementOffset:Cte,scrollToFn:kte,...e})}const D6=(e,t=200)=>{const[n,r]=T.useState(!1);return T.useEffect(()=>{if(!e){r(!1);return}const i=window.setTimeout(()=>{r(!0)},t);return()=>{window.clearTimeout(i)}},[t,e]),n},W_=({path:e})=>{const{prefix:t,name:n}=A7(e);return S.jsxs("span",{className:"flex min-w-0 flex-1 items-center overflow-hidden","data-testid":"path-label",children:[S.jsx("span",{className:"min-w-0 shrink truncate text-sm text-base-content/50","data-testid":"path-label-prefix",children:t}),S.jsx("span",{className:"shrink-0 text-sm font-medium text-base-content","data-testid":"path-label-name",children:n})]})},um=({path:e,previousPath:t})=>t&&t!==e?S.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden","data-testid":"path-label",children:[S.jsx(W_,{path:t}),S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4 lucide lucide-move-right-icon lucide-move-right",children:[S.jsx("path",{d:"M18 8L22 12L18 16"}),S.jsx("path",{d:"M2 12H22"})]}),S.jsx(W_,{path:e})]}):S.jsx(W_,{path:e}),Lte=e=>{const t=(e||"modified").toLowerCase();return t==="added"||t==="new"?S.jsx("span",{className:"badge badge-success badge-sm h-2 w-2 rounded-full p-0"}):t==="deleted"||t==="removed"?S.jsx("span",{className:"badge badge-error badge-sm h-2 w-2 rounded-full p-0"}):t==="renamed"?S.jsx("span",{className:"badge badge-info badge-sm h-2 w-2 rounded-full p-0"}):S.jsx("span",{className:"badge badge-warning badge-sm h-2 w-2 rounded-full p-0"})},M6=({changes:e,selectedFilePath:t,onFileSelect:n,onToggleStage:r,onToggleAll:i,isLoading:s=!1,scrollRef:o})=>{const u=!!i,c=T.useMemo(()=>e.filter(v=>v.staged).length,[e]),d=c>0&&c===e.length,p=c>0&&c<e.length,m=T.useRef(null),g=O6({count:e.length+(u?1:0),getScrollElement:()=>o?.current??null,estimateSize:()=>40,overscan:8}),_=D6(s,200);return T.useEffect(()=>{m.current&&(m.current.indeterminate=p)},[p]),s&&e.length===0?_?S.jsx("div",{className:"min-h-0 flex-1","data-testid":"changes-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"changes-list-loading",children:"Loading changed files..."})}):S.jsx("div",{className:"min-h-0 flex-1","data-testid":"changes-list"}):e.length===0?S.jsx("div",{className:"min-h-0 flex-1","data-testid":"changes-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"changes-list-empty",children:"Waiting for changed files."})}):S.jsx("div",{className:"min-h-0 flex-1","data-testid":"changes-list",children:S.jsx("div",{className:"w-full relative",style:{height:`${g.getTotalSize()}px`},"data-testid":"changes-list-virtualizer",children:g.getVirtualItems().map(v=>{if(u&&v.index===0)return S.jsx("div",{className:"absolute left-0 top-0 w-full",style:{height:`${v.size}px`,transform:`translateY(${v.start}px)`},children:S.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 h-full w-full text-left px-2 hover:bg-base-200",onClick:()=>i?.(!d),"data-testid":"changes-list-select-all",children:[S.jsx("input",{ref:m,type:"checkbox",className:"checkbox checkbox-xs",checked:d,onClick:w=>w.stopPropagation(),onChange:w=>i?.(w.currentTarget.checked),"aria-label":"Toggle all changes","data-testid":"changes-list-select-all-checkbox"}),S.jsx("span",{className:"truncate text-sm",children:`${e.length} changed files`})]})},"changes-select-all");const x=u?v.index-1:v.index,C=e[x];return C?S.jsx("div",{className:"absolute left-0 top-0 w-full",style:{height:`${v.size}px`,transform:`translateY(${v.start}px)`},children:S.jsxs("div",{className:`flex min-w-0 items-center gap-3 cursor-pointer px-2 py-2 h-full ${t===C.path?"bg-base-300":"hover:bg-base-200"}`,onClick:()=>n(C.path),title:C.path,"data-testid":"changes-list-item","data-path":C.path,children:[S.jsx("input",{type:"checkbox",className:"checkbox checkbox-xs",checked:!!C.staged,disabled:!r,onClick:w=>w.stopPropagation(),onChange:w=>r?.(C.path,w.currentTarget.checked),"aria-label":"Staged change","data-testid":"changes-list-item-checkbox","data-path":C.path}),S.jsx(um,{path:C.path,previousPath:C.previousPath}),S.jsx("span",{className:"ml-auto flex flex-none items-center",children:Lte(C.status)})]})},C.path):null})})})},Ote=({children:e,className:t,style:n,dataTestId:r})=>{const i=["menu rounded-box w-full"];return t&&i.push(t),S.jsx("ul",{className:i.join(" "),style:n,"data-testid":r||"file-tree",children:e})},Dte=({className:e})=>S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:`${e} h-4 w-4`,children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),Mte=({className:e,open:t})=>t?S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:`${e} h-4 w-4`,children:S.jsx("path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"})}):S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:`${e} h-4 w-4`,children:S.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}),Ite=({entries:e,selectedFilePath:t,onFileSelect:n,isLoading:r,isAvailable:i,scrollRef:s})=>{const[o,u]=T.useState({}),c=T.useMemo(()=>{const m=[],g=(_,v)=>{for(const x of _){const C=x.type==="folder",w=!!x.children?.length;m.push({path:x.path,name:x.name,depth:v,type:x.type,hasChildren:w}),C&&w&&o[x.path]&&g(x.children||[],v+1)}};return g(e,0),m},[e,o]),d=O6({count:c.length,getScrollElement:()=>s?.current??null,estimateSize:()=>40,overscan:8}),p=m=>{u(g=>({...g,[m]:!g[m]}))};return r&&e.length===0?S.jsx("div",{className:"min-h-0 flex-1",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60",children:"Loading files..."})}):i?e.length?S.jsx(Ote,{className:"bg-base-100 max-w-none rounded-none relative",style:{height:`${d.getTotalSize()}px`},dataTestId:"file-tree-panel",children:d.getVirtualItems().map(m=>{const g=c[m.index];if(!g)return null;const _=g.type==="file"&&g.path===t,v=g.type==="folder"&&o[g.path],x=["flex min-w-0 items-center gap-2 h-full w-full text-left",_?"active":""].filter(Boolean).join(" ");return S.jsx("li",{className:"absolute left-0 top-0 w-full",style:{height:`${m.size}px`,transform:`translateY(${m.start}px)`},"data-testid":"file-tree-panel-row","data-path":g.path,children:S.jsx("button",{type:"button",className:x,onClick:()=>g.type==="folder"?g.hasChildren?p(g.path):void 0:n(g.path),title:g.path,"aria-expanded":g.type==="folder"?v:void 0,"data-testid":g.type==="folder"?"file-tree-panel-folder":"file-tree-panel-file","data-path":g.path,children:S.jsxs("span",{className:"flex min-w-0 items-center gap-2",style:{paddingLeft:`${g.depth*16}px`},children:[g.type==="folder"?S.jsx(Mte,{className:"shrink-0",open:v}):S.jsx(Dte,{className:"shrink-0"}),S.jsx("span",{className:"truncate",children:g.name})]})})},g.path)})}):S.jsx("div",{className:"min-h-0 flex-1",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60",children:"No files found."})}):S.jsx("div",{className:"min-h-0 flex-1",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60",children:"File tree requires a git repository."})})},Pte=({commits:e,selectedCommit:t,onCommitSelect:n,onLoadMore:r,hasMore:i,isLoading:s,isLoadingMore:o,hasGit:u})=>{const c=D6(s,200);return u?s&&e.length===0?c?S.jsx("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"history-list-loading",children:"Loading commit history..."})}):S.jsx("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list"}):e.length===0?S.jsx("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"history-list-empty",children:"No commit history found."})}):S.jsxs("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list",children:[S.jsx("ul",{className:"w-full","data-testid":"history-list-items",children:e.map(d=>S.jsx("li",{children:S.jsxs("button",{type:"button",className:`flex w-full flex-col items-start gap-1 p-2 cursor-pointer ${t===d.sha?"bg-base-300":"hover:bg-base-200"}`,onClick:()=>n(d.sha),"data-testid":"history-list-item","data-sha":d.sha,children:[S.jsx("div",{className:"flex w-full items-center justify-between gap-2",children:S.jsx("span",{className:"truncate font-medium text-sm",children:d.subject||"(no message)"})}),S.jsxs("span",{className:"text-xs text-base-content/60",children:[d.authorName||"Unknown"," -"," ",sh(d.authoredAt)]})]})},d.sha))}),o?S.jsx("div",{className:"px-4 py-2 text-xs text-base-content/60","data-testid":"history-list-loading-more",children:"Loading more..."}):null]}):S.jsx("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"history-list-unavailable",children:"Git history requires a repository."})})},Bte=T.memo(({fileTreeEntries:e,fileTreeLoading:t,fileTreeAvailable:n,changes:r,changesLoading:i,onToggleStage:s,onToggleStageAll:o,historyCommits:u,onLoadMoreHistory:c,hasMoreHistory:d,historyLoading:p,historyLoadingMore:m,hasGit:g,onResizeStart:_})=>{const v=T.useRef(null),{sidebarTab:x,setSidebarTab:C,projectPath:w,setToolPanelVisible:A,setToolPanelTab:R,terminalCols:N,terminalRows:L}=Rn(an(U=>({sidebarTab:U.sidebarTab,setSidebarTab:U.setSidebarTab,projectPath:U.projectPath,setToolPanelVisible:U.setToolPanelVisible,setToolPanelTab:U.setToolPanelTab,terminalCols:U.terminalCols,terminalRows:U.terminalRows}))),{upsertRun:I,setError:P,runs:q}=Mp(an(U=>({upsertRun:U.upsertRun,setError:U.setError,runs:U.runs}))),{sendCommand:ee}=Ey(),{selectedTreeFilePath:F,selectedFilePath:J,selectedCommitSha:B,setSelectedTreeFilePath:V,setSelectedFilePath:Y,setSelectedCommitSha:X}=ro(an(U=>({selectedTreeFilePath:U.selectedTreeFilePath,selectedFilePath:U.selectedFilePath,selectedCommitSha:U.selectedCommitSha,setSelectedTreeFilePath:U.setSelectedTreeFilePath,setSelectedFilePath:U.setSelectedFilePath,setSelectedCommitSha:U.setSelectedCommitSha}))),M=r.filter(U=>U.staged).length,Q=Object.values(q).some(U=>U.commandName==="commit"&&U.projectPath===w&&U.status==="running"),W=24,me=U=>{if(x!=="history"||!d||p||m)return;const se=U.currentTarget;se.scrollTop+se.clientHeight<se.scrollHeight-W||c()},z=async()=>{if(!w||M===0)return;const U=b6();if(!U){P("commit_command_missing");return}A(!0),R("output");try{const se=await ee("terminal_exec",{projectPath:w,command:U,label:"Commit",name:"commit",cols:N>0?N:void 0,rows:L>0?L:void 0});I(se.run)}catch(se){P(se instanceof Error?se.message:"command_failed")}};return S.jsxs("aside",{className:"relative flex min-h-0 flex-col overflow-hidden border-r border-base-300 bg-base-100","data-testid":"app-sidebar",children:[S.jsx("div",{className:"border-b border-base-300 px-3 py-2",children:S.jsx("div",{className:"tabs tabs-sm","data-testid":"app-sidebar-tabs",children:["files","changes","history"].map(U=>S.jsx("button",{className:`tab flex-1 ${x===U?"tab-active font-semibold":""}`,onClick:()=>C(U),"data-testid":`app-sidebar-tab-${U}`,children:U.charAt(0).toUpperCase()+U.slice(1)},U))})}),S.jsx("div",{className:"min-h-0 flex-1 overflow-x-hidden overflow-y-auto",onScroll:me,ref:v,"data-testid":"app-sidebar-scroll",children:x==="files"?S.jsx(Ite,{entries:e,selectedFilePath:F,onFileSelect:V,isLoading:t,isAvailable:n,scrollRef:v}):x==="changes"?S.jsx(M6,{changes:r,selectedFilePath:J,onFileSelect:Y,onToggleStage:s,onToggleAll:o,isLoading:i,scrollRef:v}):S.jsx(Pte,{commits:u,selectedCommit:B,onCommitSelect:X,onLoadMore:c,hasMore:d,isLoading:p,isLoadingMore:m,hasGit:g})}),x==="changes"&&g&&S.jsx("div",{className:"border-t border-base-300 px-3 py-3","data-testid":"app-sidebar-commit",children:S.jsx("button",{type:"button",className:oh("btn btn-neutral w-full",Q&&"btn-disabled"),disabled:M===0,onClick:z,"data-testid":"app-sidebar-commit-button",children:Q?S.jsx("span",{className:"loading loading-dots loading-xs"}):M===0?"Commit":`Commit ${M} ${M===1?"file":"files"}`})}),S.jsx("div",{className:"absolute right-0 top-0 h-full w-2 cursor-col-resize bg-transparent hover:bg-base-300/40",onPointerDown:_,"data-testid":"app-sidebar-resize-handle"})]})}),I6={position:"absolute",top:0,bottom:0,textAlign:"center"};function Hte({file:e,renderHeaderMetadata:t,renderAnnotation:n,lineAnnotations:r,renderHoverUtility:i,getHoveredLine:s}){const o=t?.(e);return S.jsxs(S.Fragment,{children:[o!=null&&S.jsx("div",{slot:eh,children:o}),n!=null&&r?.map((u,c)=>S.jsx("div",{slot:Ya(u),children:n(u)},c)),i!=null&&S.jsx("div",{slot:"hover-slot",style:I6,children:i(s)})]})}function P6(e,t){return typeof window>"u"&&t!=null?S.jsxs(S.Fragment,{children:[S.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):S.jsx(S.Fragment,{children:e})}var fc={exports:{}},Fte=fc.exports,gk;function jte(){return gk||(gk=1,(function(e,t){(function(n,r){r(t)})(Fte,function(n){const r=Symbol("newer"),i=Symbol("older");class s{constructor(m,g){typeof m!="number"&&(g=m,m=0),this.size=0,this.limit=m,this.oldest=this.newest=void 0,this._keymap=new Map,g&&(this.assign(g),m<1&&(this.limit=this.size))}_markEntryAsUsed(m){m!==this.newest&&(m[r]&&(m===this.oldest&&(this.oldest=m[r]),m[r][i]=m[i]),m[i]&&(m[i][r]=m[r]),m[r]=void 0,m[i]=this.newest,this.newest&&(this.newest[r]=m),this.newest=m)}assign(m){let g,_=this.limit||Number.MAX_VALUE;this._keymap.clear();let v=m[Symbol.iterator]();for(let x=v.next();!x.done;x=v.next()){let C=new o(x.value[0],x.value[1]);if(this._keymap.set(C.key,C),g?(g[r]=C,C[i]=g):this.oldest=C,g=C,_--==0)throw new Error("overflow")}this.newest=g,this.size=this._keymap.size}get(m){var g=this._keymap.get(m);return g?(this._markEntryAsUsed(g),g.value):void 0}set(m,g){var _=this._keymap.get(m);return _?(_.value=g,this._markEntryAsUsed(_),this):(this._keymap.set(m,_=new o(m,g)),this.newest?(this.newest[r]=_,_[i]=this.newest):this.oldest=_,this.newest=_,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var m=this.oldest;if(m)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),m[r]=m[i]=void 0,this._keymap.delete(m.key),--this.size,[m.key,m.value]}find(m){let g=this._keymap.get(m);return g?g.value:void 0}has(m){return this._keymap.has(m)}delete(m){var g=this._keymap.get(m);return g?(this._keymap.delete(g.key),g[r]&&g[i]?(g[i][r]=g[r],g[r][i]=g[i]):g[r]?(g[r][i]=void 0,this.oldest=g[r]):g[i]?(g[i][r]=void 0,this.newest=g[i]):this.oldest=this.newest=void 0,this.size--,g.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new c(this.oldest)}values(){return new d(this.oldest)}entries(){return this}[Symbol.iterator](){return new u(this.oldest)}forEach(m,g){typeof g!="object"&&(g=this);let _=this.oldest;for(;_;)m.call(g,_.value,_.key,this),_=_[r]}toJSON(){for(var m=new Array(this.size),g=0,_=this.oldest;_;)m[g++]={key:_.key,value:_.value},_=_[r];return m}toString(){for(var m="",g=this.oldest;g;)m+=String(g.key)+":"+g.value,g=g[r],g&&(m+=" < ");return m}}n.LRUMap=s;function o(p,m){this.key=p,this.value=m,this[r]=void 0,this[i]=void 0}function u(p){this.entry=p}u.prototype[Symbol.iterator]=function(){return this},u.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:[p.key,p.value]}):{done:!0,value:void 0}};function c(p){this.entry=p}c.prototype[Symbol.iterator]=function(){return this},c.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:p.key}):{done:!0,value:void 0}};function d(p){this.entry=p}d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:p.value}):{done:!0,value:void 0}}})})(fc,fc.exports)),fc.exports}var zte=jte();const _k=Zc(zte),bk=Symbol("IGNORE_RESPONSE");var Ute=class{highlighter;renderOptions;initialized=!1;workers=[];taskQueue=[];pendingTasks=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;instanceRequestMap=new Map;fileCache;diffCache;constructor(e,{langs:t,theme:n=vn,lineDiffType:r="word-alt",tokenizeMaxLineLength:i=1e3}){this.options=e,this.renderOptions={theme:n,lineDiffType:r,tokenizeMaxLineLength:i},this.fileCache=new _k.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new _k.LRUMap(e.totalASTLRUCacheSize??100),this.initialize(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){return this.fileCache.delete(e)!==void 0}evictDiffFromCache(e){return this.diffCache.delete(e)!==void 0}async setRenderOptions({theme:e=vn,lineDiffType:t="word-alt",tokenizeMaxLineLength:n=1e3}){const r={theme:e,lineDiffType:t,tokenizeMaxLineLength:n};this.isInitialized()||await this.initialize();const i=Dp(r.theme,this.renderOptions.theme);if(i&&r.lineDiffType===this.renderOptions.lineDiffType&&r.tokenizeMaxLineLength===this.renderOptions.tokenizeMaxLineLength)return;const s=zc(e);let o=[];if(i||(Bb(s)?o=n2(s):o=await r2(s)),this.highlighter!=null)Pb(o,this.highlighter),await this.setRenderOptionsOnWorkers(r,o);else{const[u]=await Promise.all([tp({themes:s,langs:["text"]}),this.setRenderOptionsOnWorkers(r,o)]);this.highlighter=u}this.renderOptions=r,this.diffCache.clear(),this.fileCache.clear();for(const u of this.themeSubscribers)u.rerender()}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t}=this.renderOptions;return{theme:t,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((i,s)=>{const o=this.generateRequestId(),u={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:i,reject:s,requestStart:Date.now()};this.pendingTasks.set(o,u),r.worker.postMessage(u.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),()=>{this.unsubscribeToThemeChanges(e)}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e)}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1)this.initialized=new Promise((t,n)=>{(async()=>{try{const r=zc(this.renderOptions.theme);let i=[];Bb(r)?i=n2(r):i=await r2(r);let s=[];e2(e)?s=JC(e):s=await t2(e);const[o]=await Promise.all([tp({themes:r,langs:["text",...e]}),this.initializeWorkers(i,s)]);if(this.initialized===!1){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),t()}catch(r){this.initialized=!1,this.workersFailed=!0,n(r)}})()});else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[];this.workers.length>0&&this.terminateWorkers();for(let r=0;r<(this.options.poolSize??8);r++){const i=this.options.workerFactory(),s={worker:i,busy:!1,initialized:!1,langs:new Set(["text",...t.map(({name:o})=>o)])};i.addEventListener("message",o=>{this.handleWorkerMessage(s,o.data)}),i.addEventListener("error",o=>console.error("Worker error:",o,s)),this.workers.push(s),n.push(new Promise((o,u)=>{const c=this.generateRequestId(),d={type:"initialize",id:c,request:{type:"initialize",id:c,renderOptions:this.renderOptions,resolvedThemes:e,resolvedLanguages:t},resolve(){s.initialized=!0,o()},reject:u,requestStart:Date.now()};this.pendingTasks.set(c,d),this.executeTask(s,d)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.taskQueue.length===0))for(;this.taskQueue.length>0;){const e=this.taskQueue[0],t=vk(e),n=this.getAvailableWorker(t);if(n==null)break;this.taskQueue.shift(),this.resolveLanguagesAndExecuteTask(n,e,t)}};highlightFileAST(e,t){this.submitTask(e,{type:"file",file:t})}getPlainFileAST(e){if(this.highlighter==null){this.initialize();return}return aR(e,this.highlighter,this.renderOptions,!0)}highlightDiffAST(e,t){this.submitTask(e,{type:"diff",diff:t})}getPlainDiffAST(e){return this.highlighter!=null?gR(e,this.highlighter,this.renderOptions,!0):void 0}terminate(){this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.instanceRequestMap.clear(),this.taskQueue.length=0,this.pendingTasks.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{totalWorkers:this.workers.length,busyWorkers:this.workers.filter(e=>e.busy).length,queuedTasks:this.taskQueue.length,pendingTasks:this.pendingTasks.size}}submitTask(e,t){this.initialized===!1&&this.initialize();const n=this.generateRequestId(),r=Date.now(),i=(()=>{switch(t.type){case"file":return{type:"file",id:n,request:{...t,id:n},instance:e,requestStart:r};case"diff":return{type:"diff",id:n,request:{...t,id:n},instance:e,requestStart:r}}})();this.instanceRequestMap.set(e,n),this.taskQueue.push(i),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){if(t.type==="file"||t.type==="diff"){const r=n.filter(i=>!e.langs.has(i));r.length>0&&(e2(r)?t.request.resolvedLanguages=JC(r):t.request.resolvedLanguages=await t2(r))}this.executeTask(e,t)}handleWorkerMessage(e,t){const n=this.pendingTasks.get(t.id);try{if(n==null)throw new Error("handleWorkerMessage: Received response for unknown task");if(t.type==="error"){const r=new Error(t.error);throw t.stack&&(r.stack=t.stack),"reject"in n?n.reject(r):n.instance.onHighlightError(r),r}else{if("instance"in n&&this.instanceRequestMap.get(n.instance)!==t.id)throw bk;switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:s,request:o}=n;o.file.cacheKey!=null&&this.fileCache.set(o.file.cacheKey,{result:r,options:i}),s.onHighlightSuccess(o.file,r,i);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:s,request:o}=n;o.diff.cacheKey!=null&&this.diffCache.set(o.diff.cacheKey,{result:r,options:i}),s.onHighlightSuccess(o.diff,r,i);break}}}}catch(r){r!==bk&&console.error(r,n,t)}n!=null&&"instance"in n&&this.instanceRequestMap.get(n.instance)===t.id&&this.instanceRequestMap.delete(n.instance),this.pendingTasks.delete(t.id),e.busy=!1,this.taskQueue.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue))}executeTask(e,t){e.busy=!0,this.pendingTasks.set(t.id,t);for(const n of vk(t))e.langs.add(n);e.worker.postMessage(t.request)}getAvailableWorker(e){let t;for(const n of this.workers){if(n.busy||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(const i of e)if(!n.langs.has(i)){r=!1;break}if(r)break}return t}generateRequestId(){return`req_${++this.nextRequestId}`}};function vk(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??vi(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??vi(e.request.diff.name)),t.add(e.request.diff.lang??vi(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}let Fa;function $te({poolOptions:e,highlighterOptions:t}){return Fa==null&&(Fa=new Ute(e,t),Fa.initialize()),Fa}function Vte(){Fa!=null&&(Fa.terminate(),Fa=void 0)}const Cy=T.createContext(void 0);let G_=0;function qte({children:e,poolOptions:t,highlighterOptions:n}){const[r]=T.useState(()=>{if(!(typeof window>"u"))return $te({poolOptions:t,highlighterOptions:n})});return T.useInsertionEffect(()=>(G_++,()=>{G_--}),[]),T.useEffect(()=>()=>{G_===0&&Vte()},[]),S.jsx(Cy.Provider,{value:r,children:e})}function B6(e){const t=T.useRef(e);return T.useInsertionEffect(()=>{t.current=e}),T.useCallback((...n)=>t.current(...n),[])}const Wte=typeof window>"u"?T.useEffect:T.useLayoutEffect;function Gte({file:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i}){const s=T.useContext(Cy),o=T.useRef(null),u=B6(c=>{if(c!=null){if(o.current!=null)throw new Error("File: An instance should not already exist when a node is created");o.current=new r7(t,s,!0),o.current.hydrate({file:e,fileContainer:c,lineAnnotations:n,prerenderedHTML:i})}else{if(o.current==null)throw new Error("File: A File instance should exist when unmounting");o.current.cleanUp(),o.current=null}});return Wte(()=>{if(o.current==null)return;const c=!_R(o.current.options,t);o.current.setOptions(t),o.current.render({file:e,lineAnnotations:n,forceRender:c}),r!==void 0&&o.current.setSelectedLines(r)}),{ref:u,getHoveredLine:T.useCallback(()=>o.current?.getHoveredLine(),[])}}function Yte({file:e,lineAnnotations:t,selectedLines:n,options:r,className:i,style:s,renderAnnotation:o,renderHeaderMetadata:u,prerenderedHTML:c,renderHoverUtility:d}){const{ref:p,getHoveredLine:m}=Gte({file:e,options:r,lineAnnotations:t,selectedLines:n,prerenderedHTML:c});return S.jsx(xl,{ref:p,className:i,style:s,children:P6(Hte({file:e,renderAnnotation:o,renderHeaderMetadata:u,renderHoverUtility:d,lineAnnotations:t,getHoveredLine:m}),c)})}function Kte({fileDiff:e,oldFile:t,newFile:n,renderHeaderMetadata:r,renderAnnotation:i,renderHoverUtility:s,lineAnnotations:o,getHoveredLine:u}){const c=r?.({fileDiff:e,oldFile:t,newFile:n});return S.jsxs(S.Fragment,{children:[c!=null&&S.jsx("div",{slot:eh,children:c}),i!=null&&o?.map((d,p)=>S.jsx("div",{slot:Ya(d),children:i(d)},p)),s!=null&&S.jsx("div",{slot:"hover-slot",style:I6,children:s(u)})]})}const Qte=typeof window>"u"?T.useEffect:T.useLayoutEffect;function Xte({oldFile:e,newFile:t,fileDiff:n,options:r,lineAnnotations:i,selectedLines:s,prerenderedHTML:o}){const u=T.useContext(Cy),c=T.useRef(null),d=B6(p=>{if(p!=null){if(c.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");c.current=new T7(r,u,!0),c.current.hydrate({fileDiff:n,oldFile:e,newFile:t,fileContainer:p,lineAnnotations:i,prerenderedHTML:o})}else{if(c.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");c.current.cleanUp(),c.current=null}});return Qte(()=>{if(c.current==null)return;const p=c.current,m=!_R(p.options,r);p.setOptions(r),p.render({forceRender:m,fileDiff:n,oldFile:e,newFile:t,lineAnnotations:i}),s!==void 0&&p.setSelectedLines(s)}),{ref:d,getHoveredLine:T.useCallback(()=>c.current?.getHoveredLine(),[])}}function Zte({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,className:i,style:s,prerenderedHTML:o,renderAnnotation:u,renderHeaderMetadata:c,renderHoverUtility:d}){const{ref:p,getHoveredLine:m}=Xte({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:o});return S.jsx(xl,{ref:p,className:i,style:s,children:P6(Kte({fileDiff:e,renderHeaderMetadata:c,renderAnnotation:u,lineAnnotations:n,renderHoverUtility:d,getHoveredLine:m}),o)})}function Jte(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const[r,i]=T.useState(()=>n?window.matchMedia(e).matches:t);return T.useLayoutEffect(()=>{const s=window.matchMedia(e),o=u=>{i(u?.matches??s.matches)};return o(),s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[e]),r}const ene=()=>typeof document>"u"?"light":(document.documentElement.dataset.theme||"").toLowerCase().includes("dark")?"dark":"light",tne=e=>{if(typeof document>"u")return()=>{};const t=new MutationObserver(()=>e());return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>t.disconnect()},nne=e=>{if(typeof document>"u")return()=>{};const t=new MutationObserver(()=>e());return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","style"]}),()=>t.disconnect()},H6=()=>T.useSyncExternalStore(tne,ene,()=>"light"),Rt=(e,t)=>typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t,_1=()=>Rt("--font-mono",'"Space Mono", monospace'),b1=()=>{const e=Rt("--font-mono-size","14px"),t=Number.parseFloat(e);return Number.isFinite(t)?t:14},yk=()=>({background:Rt("--terminal-bg","#ffffff"),foreground:Rt("--terminal-fg","#000000"),cursor:Rt("--terminal-cursor","#000000"),cursorAccent:Rt("--terminal-cursor-accent","#ffffff"),selectionBackground:Rt("--terminal-selection","rgba(0, 0, 0, 0.2)"),black:Rt("--terminal-black","#1f1f21"),red:Rt("--terminal-red","#ff2e3f"),green:Rt("--terminal-green","#0dbe4e"),yellow:Rt("--terminal-yellow","#ffca00"),blue:Rt("--terminal-blue","#009fff"),magenta:Rt("--terminal-magenta","#c635e4"),cyan:Rt("--terminal-cyan","#08c0ef"),white:Rt("--terminal-white","#c6c6c8"),brightBlack:Rt("--terminal-bright-black","#1f1f21"),brightRed:Rt("--terminal-bright-red","#ff2e3f"),brightGreen:Rt("--terminal-bright-green","#0dbe4e"),brightYellow:Rt("--terminal-bright-yellow","#ffca00"),brightBlue:Rt("--terminal-bright-blue","#009fff"),brightMagenta:Rt("--terminal-bright-magenta","#c635e4"),brightCyan:Rt("--terminal-bright-cyan","#08c0ef"),brightWhite:Rt("--terminal-bright-white","#c6c6c8")}),rne=`
|
|
1466
|
+
color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1,i}return o.updateDeps=u=>{r=u},o}function hk(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const yte=(e,t)=>Math.abs(e-t)<1.01,Ste=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},dk=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ete=e=>e,xte=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},wte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=o=>{const{width:u,height:c}=o;t({width:Math.round(u),height:Math.round(c)})};if(i(dk(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(o=>{const u=()=>{const c=o[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){i({width:d.inlineSize,height:d.blockSize});return}}i(dk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},fk={passive:!0},pk=typeof window>"u"?!0:"onscrollend"in window,Cte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const s=e.options.useScrollendEvent&&pk?()=>{}:Ste(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=p=>()=>{const{horizontal:m,isRtl:g}=e.options;i=m?n.scrollLeft*(g&&-1||1):n.scrollTop,s(),t(i,p)},u=o(!0),c=o(!1);n.addEventListener("scroll",u,fk);const d=e.options.useScrollendEvent&&pk;return d&&n.addEventListener("scrollend",c,fk),()=>{n.removeEventListener("scroll",u),d&&n.removeEventListener("scrollend",c)}},Tte=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},kte=(e,{adjustments:t=0,behavior:n},r)=>{var i,s;const o=e+t;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:o,behavior:n})};class Ate{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const o=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ete,rangeExtractor:xte,onChange:()=>{},measureElement:Tte,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=al(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let o=r-1;o>=0;o--){const u=n[o];if(i.has(u.lane))continue;const c=s.get(u.lane);if(c==null||u.end>c.end?s.set(u.lane,u):u.end<c.end&&i.set(u.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((o,u)=>o.end===u.end?o.index-u.index:o.end-u.end)[0]:void 0},this.getMeasurementOptions=al(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,i,s,o,u)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:o,lanes:u}),{key:!1}),this.getMeasurements=al(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:o,lanes:u},c)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const g of this.laneAssignments.keys())g>=n&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,d),m=new Array(u).fill(void 0);for(let g=0;g<d;g++){const _=p[g];_&&(m[_.lane]=g)}for(let g=d;g<n;g++){const _=s(g),v=this.laneAssignments.get(g);let x,C;if(v!==void 0&&this.options.lanes>1){x=v;const N=m[x],L=N!==void 0?p[N]:void 0;C=L?L.end+this.options.gap:r+i}else{const N=this.options.lanes===1?p[g-1]:this.getFurthestMeasurement(p,g);C=N?N.end+this.options.gap:r+i,x=N?N.lane:g%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(g,x)}const w=c.get(_),A=typeof w=="number"?w:this.options.estimateSize(g),R=C+A;p[g]={index:g,start:C,size:A,end:R,key:_,lane:x},m[x]=g}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=al(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,s)=>this.range=n.length>0&&r>0?Rte({measurements:n,outerSize:r,scrollOffset:i,lanes:s}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=al(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,s,o)=>s===null||o===null?[]:n({startIndex:s,endIndex:o,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),s=this.measurementsCache[i];if(!s)return;const o=s.key,u=this.elementsCache.get(o);u!==n&&(u&&this.observer.unobserve(u),this.observer.observe(n),this.elementsCache.set(o,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const s=this.itemSizeCache.get(i.key)??i.size,o=r-s;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,o,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=al(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,o=n.length;s<o;s++){const u=n[s],c=r[u];i.push(c)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return hk(r[L6(0,r.length-1,i=>hk(r[i]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=n>=o+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const s=this.getSize(),o=this.getScrollOffset();if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const u=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,r,i.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let s=0;const o=10,u=d=>{if(!this.targetWindow)return;const p=this.getOffsetForIndex(n,d);if(!p){console.warn("Failed to get offset for index:",n);return}const[m,g]=p;this._scrollToOffset(m,{adjustments:void 0,behavior:i}),this.targetWindow.requestAnimationFrame(()=>{const _=()=>{if(this.currentScrollToIndex!==n)return;const v=this.getScrollOffset(),x=this.getOffsetForIndex(n,g);if(!x){console.warn("Failed to get offset for index:",n);return}yte(x[0],v)||c(g)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(_):_()})},c=d=>{this.targetWindow&&this.currentScrollToIndex===n&&(s++,s<o?this.targetWindow.requestAnimationFrame(()=>u(d)):console.warn(`Failed to scroll to index ${n} after ${o} attempts.`))};u(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((n=r[r.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let o=r.length-1;for(;o>=0&&s.some(u=>u===null);){const u=r[o];s[u.lane]===null&&(s[u.lane]=u.end),o--}i=Math.max(...s.filter(u=>u!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const L6=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function Rte({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const i=e.length-1,s=c=>e[c].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=L6(0,i,s,n),u=o;if(r===1)for(;u<i&&e[u].end<n+t;)u++;else if(r>1){const c=Array(r).fill(0);for(;u<i&&c.some(p=>p<n+t);){const p=e[u];c[p.lane]=p.end,u++}const d=Array(r).fill(n+t);for(;o>=0&&d.some(p=>p>=n);){const p=e[o];d[p.lane]=p.start,o--}o=Math.max(0,o-o%r),u=Math.min(i,u+(r-1-u%r))}return{startIndex:o,endIndex:u}}const mk=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Nte({useFlushSync:e=!0,...t}){const n=T.useReducer(()=>({}),{})[1],r={...t,onChange:(s,o)=>{var u;e&&o?Ip.flushSync(n):n(),(u=t.onChange)==null||u.call(t,s,o)}},[i]=T.useState(()=>new Ate(r));return i.setOptions(r),mk(()=>i._didMount(),[]),mk(()=>i._willUpdate()),i}function O6(e){return Nte({observeElementRect:wte,observeElementOffset:Cte,scrollToFn:kte,...e})}const D6=(e,t=200)=>{const[n,r]=T.useState(!1);return T.useEffect(()=>{if(!e){r(!1);return}const i=window.setTimeout(()=>{r(!0)},t);return()=>{window.clearTimeout(i)}},[t,e]),n},W_=({path:e})=>{const{prefix:t,name:n}=A7(e);return S.jsxs("span",{className:"flex min-w-0 flex-1 items-center overflow-hidden","data-testid":"path-label",children:[S.jsx("span",{className:"min-w-0 shrink truncate text-sm text-base-content/50","data-testid":"path-label-prefix",children:t}),S.jsx("span",{className:"shrink-0 text-sm font-medium text-base-content","data-testid":"path-label-name",children:n})]})},um=({path:e,previousPath:t})=>t&&t!==e?S.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden","data-testid":"path-label",children:[S.jsx(W_,{path:t}),S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4 lucide lucide-move-right-icon lucide-move-right",children:[S.jsx("path",{d:"M18 8L22 12L18 16"}),S.jsx("path",{d:"M2 12H22"})]}),S.jsx(W_,{path:e})]}):S.jsx(W_,{path:e}),Lte=e=>{const t=(e||"modified").toLowerCase();return t==="added"||t==="new"?S.jsx("span",{className:"badge badge-success badge-sm h-2 w-2 rounded-full p-0"}):t==="deleted"||t==="removed"?S.jsx("span",{className:"badge badge-error badge-sm h-2 w-2 rounded-full p-0"}):t==="renamed"?S.jsx("span",{className:"badge badge-info badge-sm h-2 w-2 rounded-full p-0"}):S.jsx("span",{className:"badge badge-warning badge-sm h-2 w-2 rounded-full p-0"})},M6=({changes:e,selectedFilePath:t,onFileSelect:n,onToggleStage:r,onToggleAll:i,isLoading:s=!1,scrollRef:o})=>{const u=!!i,c=T.useMemo(()=>e.filter(v=>v.staged).length,[e]),d=c>0&&c===e.length,p=c>0&&c<e.length,m=T.useRef(null),g=O6({count:e.length+(u?1:0),getScrollElement:()=>o?.current??null,estimateSize:()=>40,overscan:8}),_=D6(s,200);return T.useEffect(()=>{m.current&&(m.current.indeterminate=p)},[p]),s&&e.length===0?_?S.jsx("div",{className:"min-h-0 flex-1","data-testid":"changes-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"changes-list-loading",children:"Loading changed files..."})}):S.jsx("div",{className:"min-h-0 flex-1","data-testid":"changes-list"}):e.length===0?S.jsx("div",{className:"min-h-0 flex-1","data-testid":"changes-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"changes-list-empty",children:"Waiting for changed files."})}):S.jsx("div",{className:"min-h-0 flex-1","data-testid":"changes-list",children:S.jsx("div",{className:"w-full relative",style:{height:`${g.getTotalSize()}px`},"data-testid":"changes-list-virtualizer",children:g.getVirtualItems().map(v=>{if(u&&v.index===0)return S.jsx("div",{className:"absolute left-0 top-0 w-full",style:{height:`${v.size}px`,transform:`translateY(${v.start}px)`},children:S.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 h-full w-full text-left px-2 hover:bg-base-200",onClick:()=>i?.(!d),"data-testid":"changes-list-select-all",children:[S.jsx("input",{ref:m,type:"checkbox",className:"checkbox checkbox-xs",checked:d,onClick:w=>w.stopPropagation(),onChange:w=>i?.(w.currentTarget.checked),"aria-label":"Toggle all changes","data-testid":"changes-list-select-all-checkbox"}),S.jsx("span",{className:"truncate text-sm",children:`${e.length} changed files`})]})},"changes-select-all");const x=u?v.index-1:v.index,C=e[x];return C?S.jsx("div",{className:"absolute left-0 top-0 w-full",style:{height:`${v.size}px`,transform:`translateY(${v.start}px)`},children:S.jsxs("div",{className:`flex min-w-0 items-center gap-3 cursor-pointer px-2 py-2 h-full ${t===C.path?"bg-base-300":"hover:bg-base-200"}`,onClick:()=>n(C.path),title:C.path,"data-testid":"changes-list-item","data-path":C.path,children:[S.jsx("input",{type:"checkbox",className:"checkbox checkbox-xs",checked:!!C.staged,disabled:!r,onClick:w=>w.stopPropagation(),onChange:w=>r?.(C.path,w.currentTarget.checked),"aria-label":"Staged change","data-testid":"changes-list-item-checkbox","data-path":C.path}),S.jsx(um,{path:C.path,previousPath:C.previousPath}),S.jsx("span",{className:"ml-auto flex flex-none items-center",children:Lte(C.status)})]})},C.path):null})})})},Ote=({children:e,className:t,style:n,dataTestId:r})=>{const i=["menu rounded-box w-full"];return t&&i.push(t),S.jsx("ul",{className:i.join(" "),style:n,"data-testid":r||"file-tree",children:e})},Dte=({className:e})=>S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:`${e} h-4 w-4`,children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),Mte=({className:e,open:t})=>t?S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:`${e} h-4 w-4`,children:S.jsx("path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"})}):S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:`${e} h-4 w-4`,children:S.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}),Ite=({entries:e,selectedFilePath:t,onFileSelect:n,isLoading:r,isAvailable:i,scrollRef:s})=>{const[o,u]=T.useState({}),c=T.useMemo(()=>{const m=[],g=(_,v)=>{for(const x of _){const C=x.type==="folder",w=!!x.children?.length;m.push({path:x.path,name:x.name,depth:v,type:x.type,hasChildren:w}),C&&w&&o[x.path]&&g(x.children||[],v+1)}};return g(e,0),m},[e,o]),d=O6({count:c.length,getScrollElement:()=>s?.current??null,estimateSize:()=>40,overscan:8}),p=m=>{u(g=>({...g,[m]:!g[m]}))};return r&&e.length===0?S.jsx("div",{className:"min-h-0 flex-1",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60",children:"Loading files..."})}):i?e.length?S.jsx(Ote,{className:"bg-base-100 max-w-none rounded-none relative",style:{height:`${d.getTotalSize()}px`},dataTestId:"file-tree-panel",children:d.getVirtualItems().map(m=>{const g=c[m.index];if(!g)return null;const _=g.type==="file"&&g.path===t,v=g.type==="folder"&&o[g.path],x=["flex min-w-0 items-center gap-2 h-full w-full text-left",_?"active":""].filter(Boolean).join(" ");return S.jsx("li",{className:"absolute left-0 top-0 w-full",style:{height:`${m.size}px`,transform:`translateY(${m.start}px)`},"data-testid":"file-tree-panel-row","data-path":g.path,children:S.jsx("button",{type:"button",className:x,onClick:()=>g.type==="folder"?g.hasChildren?p(g.path):void 0:n(g.path),title:g.path,"aria-expanded":g.type==="folder"?v:void 0,"data-testid":g.type==="folder"?"file-tree-panel-folder":"file-tree-panel-file","data-path":g.path,children:S.jsxs("span",{className:"flex min-w-0 items-center gap-2",style:{paddingLeft:`${g.depth*16}px`},children:[g.type==="folder"?S.jsx(Mte,{className:"shrink-0",open:v}):S.jsx(Dte,{className:"shrink-0"}),S.jsx("span",{className:"truncate",children:g.name})]})})},g.path)})}):S.jsx("div",{className:"min-h-0 flex-1",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60",children:"No files found."})}):S.jsx("div",{className:"min-h-0 flex-1",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60",children:"File tree requires a git repository."})})},Pte=({commits:e,selectedCommit:t,onCommitSelect:n,onLoadMore:r,hasMore:i,isLoading:s,isLoadingMore:o,hasGit:u})=>{const c=D6(s,200);return u?s&&e.length===0?c?S.jsx("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"history-list-loading",children:"Loading commit history..."})}):S.jsx("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list"}):e.length===0?S.jsx("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"history-list-empty",children:"No commit history found."})}):S.jsxs("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list",children:[S.jsx("ul",{className:"w-full","data-testid":"history-list-items",children:e.map(d=>S.jsx("li",{children:S.jsxs("button",{type:"button",className:`flex w-full flex-col items-start gap-1 p-2 cursor-pointer ${t===d.sha?"bg-base-300":"hover:bg-base-200"}`,onClick:()=>n(d.sha),"data-testid":"history-list-item","data-sha":d.sha,children:[S.jsx("div",{className:"flex w-full items-center justify-between gap-2",children:S.jsx("span",{className:"truncate font-medium text-sm",children:d.subject||"(no message)"})}),S.jsxs("span",{className:"text-xs text-base-content/60",children:[d.authorName||"Unknown"," -"," ",sh(d.authoredAt)]})]})},d.sha))}),o?S.jsx("div",{className:"px-4 py-2 text-xs text-base-content/60","data-testid":"history-list-loading-more",children:"Loading more..."}):null]}):S.jsx("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"history-list",children:S.jsx("div",{className:"text-sm text-center mt-8 text-base-content/60","data-testid":"history-list-unavailable",children:"Git history requires a repository."})})},Bte=T.memo(({fileTreeEntries:e,fileTreeLoading:t,fileTreeAvailable:n,changes:r,changesLoading:i,onToggleStage:s,onToggleStageAll:o,historyCommits:u,onLoadMoreHistory:c,hasMoreHistory:d,historyLoading:p,historyLoadingMore:m,hasGit:g,onResizeStart:_})=>{const v=T.useRef(null),{sidebarTab:x,setSidebarTab:C,projectPath:w,setToolPanelVisible:A,setToolPanelTab:R,terminalCols:N,terminalRows:L}=Rn(an(U=>({sidebarTab:U.sidebarTab,setSidebarTab:U.setSidebarTab,projectPath:U.projectPath,setToolPanelVisible:U.setToolPanelVisible,setToolPanelTab:U.setToolPanelTab,terminalCols:U.terminalCols,terminalRows:U.terminalRows}))),{upsertRun:I,setError:P,runs:q}=Mp(an(U=>({upsertRun:U.upsertRun,setError:U.setError,runs:U.runs}))),{sendCommand:ee}=Ey(),{selectedTreeFilePath:F,selectedFilePath:J,selectedCommitSha:B,setSelectedTreeFilePath:V,setSelectedFilePath:Y,setSelectedCommitSha:X}=ro(an(U=>({selectedTreeFilePath:U.selectedTreeFilePath,selectedFilePath:U.selectedFilePath,selectedCommitSha:U.selectedCommitSha,setSelectedTreeFilePath:U.setSelectedTreeFilePath,setSelectedFilePath:U.setSelectedFilePath,setSelectedCommitSha:U.setSelectedCommitSha}))),M=r.filter(U=>U.staged).length,Q=Object.values(q).some(U=>U.commandName==="commit"&&U.projectPath===w&&U.status==="running"),W=24,me=U=>{if(x!=="history"||!d||p||m)return;const se=U.currentTarget;se.scrollTop+se.clientHeight<se.scrollHeight-W||c()},z=async()=>{if(!w||M===0)return;const U=b6();if(!U){P("commit_command_missing");return}A(!0),R("output");try{const se=await ee("terminal_exec",{projectPath:w,command:U,label:"Commit",name:"commit",cols:N>0?N:void 0,rows:L>0?L:void 0});I(se.run)}catch(se){P(se instanceof Error?se.message:"command_failed")}};return S.jsxs("aside",{className:"relative flex min-h-0 flex-col overflow-hidden border-r border-base-300 bg-base-100","data-testid":"app-sidebar",children:[S.jsx("div",{className:"border-b border-base-300 px-3 py-2",children:S.jsx("div",{className:"tabs tabs-sm","data-testid":"app-sidebar-tabs",children:["files","changes","history"].map(U=>S.jsx("button",{className:`tab flex-1 ${x===U?"tab-active font-semibold":""}`,onClick:()=>C(U),"data-testid":`app-sidebar-tab-${U}`,children:U.charAt(0).toUpperCase()+U.slice(1)},U))})}),S.jsx("div",{className:"min-h-0 flex-1 overflow-x-hidden overflow-y-auto",onScroll:me,ref:v,"data-testid":"app-sidebar-scroll",children:x==="files"?S.jsx(Ite,{entries:e,selectedFilePath:F,onFileSelect:V,isLoading:t,isAvailable:n,scrollRef:v}):x==="changes"?S.jsx(M6,{changes:r,selectedFilePath:J,onFileSelect:Y,onToggleStage:s,onToggleAll:o,isLoading:i,scrollRef:v}):S.jsx(Pte,{commits:u,selectedCommit:B,onCommitSelect:X,onLoadMore:c,hasMore:d,isLoading:p,isLoadingMore:m,hasGit:g})}),x==="changes"&&g&&S.jsx("div",{className:"border-t border-base-300 px-3 py-3","data-testid":"app-sidebar-commit",children:S.jsx("button",{type:"button",className:oh("btn btn-neutral w-full",Q&&"btn-disabled"),disabled:M===0,onClick:z,"data-testid":"app-sidebar-commit-button",children:Q?S.jsx("span",{className:"loading loading-dots loading-xs"}):M===0?"Commit":`Commit ${M} ${M===1?"file":"files"}`})}),S.jsx("div",{className:"absolute right-0 top-0 h-full w-2 cursor-col-resize bg-transparent hover:bg-base-300/40",onPointerDown:_,"data-testid":"app-sidebar-resize-handle"})]})}),I6={position:"absolute",top:0,bottom:0,textAlign:"center"};function Hte({file:e,renderHeaderMetadata:t,renderAnnotation:n,lineAnnotations:r,renderHoverUtility:i,getHoveredLine:s}){const o=t?.(e);return S.jsxs(S.Fragment,{children:[o!=null&&S.jsx("div",{slot:eh,children:o}),n!=null&&r?.map((u,c)=>S.jsx("div",{slot:Ya(u),children:n(u)},c)),i!=null&&S.jsx("div",{slot:"hover-slot",style:I6,children:i(s)})]})}function P6(e,t){return typeof window>"u"&&t!=null?S.jsxs(S.Fragment,{children:[S.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):S.jsx(S.Fragment,{children:e})}var fc={exports:{}},Fte=fc.exports,gk;function jte(){return gk||(gk=1,(function(e,t){(function(n,r){r(t)})(Fte,function(n){const r=Symbol("newer"),i=Symbol("older");class s{constructor(m,g){typeof m!="number"&&(g=m,m=0),this.size=0,this.limit=m,this.oldest=this.newest=void 0,this._keymap=new Map,g&&(this.assign(g),m<1&&(this.limit=this.size))}_markEntryAsUsed(m){m!==this.newest&&(m[r]&&(m===this.oldest&&(this.oldest=m[r]),m[r][i]=m[i]),m[i]&&(m[i][r]=m[r]),m[r]=void 0,m[i]=this.newest,this.newest&&(this.newest[r]=m),this.newest=m)}assign(m){let g,_=this.limit||Number.MAX_VALUE;this._keymap.clear();let v=m[Symbol.iterator]();for(let x=v.next();!x.done;x=v.next()){let C=new o(x.value[0],x.value[1]);if(this._keymap.set(C.key,C),g?(g[r]=C,C[i]=g):this.oldest=C,g=C,_--==0)throw new Error("overflow")}this.newest=g,this.size=this._keymap.size}get(m){var g=this._keymap.get(m);return g?(this._markEntryAsUsed(g),g.value):void 0}set(m,g){var _=this._keymap.get(m);return _?(_.value=g,this._markEntryAsUsed(_),this):(this._keymap.set(m,_=new o(m,g)),this.newest?(this.newest[r]=_,_[i]=this.newest):this.oldest=_,this.newest=_,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var m=this.oldest;if(m)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),m[r]=m[i]=void 0,this._keymap.delete(m.key),--this.size,[m.key,m.value]}find(m){let g=this._keymap.get(m);return g?g.value:void 0}has(m){return this._keymap.has(m)}delete(m){var g=this._keymap.get(m);return g?(this._keymap.delete(g.key),g[r]&&g[i]?(g[i][r]=g[r],g[r][i]=g[i]):g[r]?(g[r][i]=void 0,this.oldest=g[r]):g[i]?(g[i][r]=void 0,this.newest=g[i]):this.oldest=this.newest=void 0,this.size--,g.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new c(this.oldest)}values(){return new d(this.oldest)}entries(){return this}[Symbol.iterator](){return new u(this.oldest)}forEach(m,g){typeof g!="object"&&(g=this);let _=this.oldest;for(;_;)m.call(g,_.value,_.key,this),_=_[r]}toJSON(){for(var m=new Array(this.size),g=0,_=this.oldest;_;)m[g++]={key:_.key,value:_.value},_=_[r];return m}toString(){for(var m="",g=this.oldest;g;)m+=String(g.key)+":"+g.value,g=g[r],g&&(m+=" < ");return m}}n.LRUMap=s;function o(p,m){this.key=p,this.value=m,this[r]=void 0,this[i]=void 0}function u(p){this.entry=p}u.prototype[Symbol.iterator]=function(){return this},u.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:[p.key,p.value]}):{done:!0,value:void 0}};function c(p){this.entry=p}c.prototype[Symbol.iterator]=function(){return this},c.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:p.key}):{done:!0,value:void 0}};function d(p){this.entry=p}d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:p.value}):{done:!0,value:void 0}}})})(fc,fc.exports)),fc.exports}var zte=jte();const _k=Zc(zte),bk=Symbol("IGNORE_RESPONSE");var Ute=class{highlighter;renderOptions;initialized=!1;workers=[];taskQueue=[];pendingTasks=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;instanceRequestMap=new Map;fileCache;diffCache;constructor(e,{langs:t,theme:n=vn,lineDiffType:r="word-alt",tokenizeMaxLineLength:i=1e3}){this.options=e,this.renderOptions={theme:n,lineDiffType:r,tokenizeMaxLineLength:i},this.fileCache=new _k.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new _k.LRUMap(e.totalASTLRUCacheSize??100),this.initialize(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){return this.fileCache.delete(e)!==void 0}evictDiffFromCache(e){return this.diffCache.delete(e)!==void 0}async setRenderOptions({theme:e=vn,lineDiffType:t="word-alt",tokenizeMaxLineLength:n=1e3}){const r={theme:e,lineDiffType:t,tokenizeMaxLineLength:n};this.isInitialized()||await this.initialize();const i=Dp(r.theme,this.renderOptions.theme);if(i&&r.lineDiffType===this.renderOptions.lineDiffType&&r.tokenizeMaxLineLength===this.renderOptions.tokenizeMaxLineLength)return;const s=zc(e);let o=[];if(i||(Bb(s)?o=n2(s):o=await r2(s)),this.highlighter!=null)Pb(o,this.highlighter),await this.setRenderOptionsOnWorkers(r,o);else{const[u]=await Promise.all([tp({themes:s,langs:["text"]}),this.setRenderOptionsOnWorkers(r,o)]);this.highlighter=u}this.renderOptions=r,this.diffCache.clear(),this.fileCache.clear();for(const u of this.themeSubscribers)u.rerender()}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t}=this.renderOptions;return{theme:t,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((i,s)=>{const o=this.generateRequestId(),u={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:i,reject:s,requestStart:Date.now()};this.pendingTasks.set(o,u),r.worker.postMessage(u.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),()=>{this.unsubscribeToThemeChanges(e)}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e)}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1)this.initialized=new Promise((t,n)=>{(async()=>{try{const r=zc(this.renderOptions.theme);let i=[];Bb(r)?i=n2(r):i=await r2(r);let s=[];e2(e)?s=JC(e):s=await t2(e);const[o]=await Promise.all([tp({themes:r,langs:["text",...e]}),this.initializeWorkers(i,s)]);if(this.initialized===!1){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),t()}catch(r){this.initialized=!1,this.workersFailed=!0,n(r)}})()});else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[];this.workers.length>0&&this.terminateWorkers();for(let r=0;r<(this.options.poolSize??8);r++){const i=this.options.workerFactory(),s={worker:i,busy:!1,initialized:!1,langs:new Set(["text",...t.map(({name:o})=>o)])};i.addEventListener("message",o=>{this.handleWorkerMessage(s,o.data)}),i.addEventListener("error",o=>console.error("Worker error:",o,s)),this.workers.push(s),n.push(new Promise((o,u)=>{const c=this.generateRequestId(),d={type:"initialize",id:c,request:{type:"initialize",id:c,renderOptions:this.renderOptions,resolvedThemes:e,resolvedLanguages:t},resolve(){s.initialized=!0,o()},reject:u,requestStart:Date.now()};this.pendingTasks.set(c,d),this.executeTask(s,d)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.taskQueue.length===0))for(;this.taskQueue.length>0;){const e=this.taskQueue[0],t=vk(e),n=this.getAvailableWorker(t);if(n==null)break;this.taskQueue.shift(),this.resolveLanguagesAndExecuteTask(n,e,t)}};highlightFileAST(e,t){this.submitTask(e,{type:"file",file:t})}getPlainFileAST(e){if(this.highlighter==null){this.initialize();return}return a3(e,this.highlighter,this.renderOptions,!0)}highlightDiffAST(e,t){this.submitTask(e,{type:"diff",diff:t})}getPlainDiffAST(e){return this.highlighter!=null?g3(e,this.highlighter,this.renderOptions,!0):void 0}terminate(){this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.instanceRequestMap.clear(),this.taskQueue.length=0,this.pendingTasks.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{totalWorkers:this.workers.length,busyWorkers:this.workers.filter(e=>e.busy).length,queuedTasks:this.taskQueue.length,pendingTasks:this.pendingTasks.size}}submitTask(e,t){this.initialized===!1&&this.initialize();const n=this.generateRequestId(),r=Date.now(),i=(()=>{switch(t.type){case"file":return{type:"file",id:n,request:{...t,id:n},instance:e,requestStart:r};case"diff":return{type:"diff",id:n,request:{...t,id:n},instance:e,requestStart:r}}})();this.instanceRequestMap.set(e,n),this.taskQueue.push(i),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){if(t.type==="file"||t.type==="diff"){const r=n.filter(i=>!e.langs.has(i));r.length>0&&(e2(r)?t.request.resolvedLanguages=JC(r):t.request.resolvedLanguages=await t2(r))}this.executeTask(e,t)}handleWorkerMessage(e,t){const n=this.pendingTasks.get(t.id);try{if(n==null)throw new Error("handleWorkerMessage: Received response for unknown task");if(t.type==="error"){const r=new Error(t.error);throw t.stack&&(r.stack=t.stack),"reject"in n?n.reject(r):n.instance.onHighlightError(r),r}else{if("instance"in n&&this.instanceRequestMap.get(n.instance)!==t.id)throw bk;switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:s,request:o}=n;o.file.cacheKey!=null&&this.fileCache.set(o.file.cacheKey,{result:r,options:i}),s.onHighlightSuccess(o.file,r,i);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:s,request:o}=n;o.diff.cacheKey!=null&&this.diffCache.set(o.diff.cacheKey,{result:r,options:i}),s.onHighlightSuccess(o.diff,r,i);break}}}}catch(r){r!==bk&&console.error(r,n,t)}n!=null&&"instance"in n&&this.instanceRequestMap.get(n.instance)===t.id&&this.instanceRequestMap.delete(n.instance),this.pendingTasks.delete(t.id),e.busy=!1,this.taskQueue.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue))}executeTask(e,t){e.busy=!0,this.pendingTasks.set(t.id,t);for(const n of vk(t))e.langs.add(n);e.worker.postMessage(t.request)}getAvailableWorker(e){let t;for(const n of this.workers){if(n.busy||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(const i of e)if(!n.langs.has(i)){r=!1;break}if(r)break}return t}generateRequestId(){return`req_${++this.nextRequestId}`}};function vk(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??vi(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??vi(e.request.diff.name)),t.add(e.request.diff.lang??vi(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}let Fa;function $te({poolOptions:e,highlighterOptions:t}){return Fa==null&&(Fa=new Ute(e,t),Fa.initialize()),Fa}function Vte(){Fa!=null&&(Fa.terminate(),Fa=void 0)}const Cy=T.createContext(void 0);let G_=0;function qte({children:e,poolOptions:t,highlighterOptions:n}){const[r]=T.useState(()=>{if(!(typeof window>"u"))return $te({poolOptions:t,highlighterOptions:n})});return T.useInsertionEffect(()=>(G_++,()=>{G_--}),[]),T.useEffect(()=>()=>{G_===0&&Vte()},[]),S.jsx(Cy.Provider,{value:r,children:e})}function B6(e){const t=T.useRef(e);return T.useInsertionEffect(()=>{t.current=e}),T.useCallback((...n)=>t.current(...n),[])}const Wte=typeof window>"u"?T.useEffect:T.useLayoutEffect;function Gte({file:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i}){const s=T.useContext(Cy),o=T.useRef(null),u=B6(c=>{if(c!=null){if(o.current!=null)throw new Error("File: An instance should not already exist when a node is created");o.current=new r7(t,s,!0),o.current.hydrate({file:e,fileContainer:c,lineAnnotations:n,prerenderedHTML:i})}else{if(o.current==null)throw new Error("File: A File instance should exist when unmounting");o.current.cleanUp(),o.current=null}});return Wte(()=>{if(o.current==null)return;const c=!_3(o.current.options,t);o.current.setOptions(t),o.current.render({file:e,lineAnnotations:n,forceRender:c}),r!==void 0&&o.current.setSelectedLines(r)}),{ref:u,getHoveredLine:T.useCallback(()=>o.current?.getHoveredLine(),[])}}function Yte({file:e,lineAnnotations:t,selectedLines:n,options:r,className:i,style:s,renderAnnotation:o,renderHeaderMetadata:u,prerenderedHTML:c,renderHoverUtility:d}){const{ref:p,getHoveredLine:m}=Gte({file:e,options:r,lineAnnotations:t,selectedLines:n,prerenderedHTML:c});return S.jsx(xl,{ref:p,className:i,style:s,children:P6(Hte({file:e,renderAnnotation:o,renderHeaderMetadata:u,renderHoverUtility:d,lineAnnotations:t,getHoveredLine:m}),c)})}function Kte({fileDiff:e,oldFile:t,newFile:n,renderHeaderMetadata:r,renderAnnotation:i,renderHoverUtility:s,lineAnnotations:o,getHoveredLine:u}){const c=r?.({fileDiff:e,oldFile:t,newFile:n});return S.jsxs(S.Fragment,{children:[c!=null&&S.jsx("div",{slot:eh,children:c}),i!=null&&o?.map((d,p)=>S.jsx("div",{slot:Ya(d),children:i(d)},p)),s!=null&&S.jsx("div",{slot:"hover-slot",style:I6,children:s(u)})]})}const Qte=typeof window>"u"?T.useEffect:T.useLayoutEffect;function Xte({oldFile:e,newFile:t,fileDiff:n,options:r,lineAnnotations:i,selectedLines:s,prerenderedHTML:o}){const u=T.useContext(Cy),c=T.useRef(null),d=B6(p=>{if(p!=null){if(c.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");c.current=new T7(r,u,!0),c.current.hydrate({fileDiff:n,oldFile:e,newFile:t,fileContainer:p,lineAnnotations:i,prerenderedHTML:o})}else{if(c.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");c.current.cleanUp(),c.current=null}});return Qte(()=>{if(c.current==null)return;const p=c.current,m=!_3(p.options,r);p.setOptions(r),p.render({forceRender:m,fileDiff:n,oldFile:e,newFile:t,lineAnnotations:i}),s!==void 0&&p.setSelectedLines(s)}),{ref:d,getHoveredLine:T.useCallback(()=>c.current?.getHoveredLine(),[])}}function Zte({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,className:i,style:s,prerenderedHTML:o,renderAnnotation:u,renderHeaderMetadata:c,renderHoverUtility:d}){const{ref:p,getHoveredLine:m}=Xte({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:o});return S.jsx(xl,{ref:p,className:i,style:s,children:P6(Kte({fileDiff:e,renderHeaderMetadata:c,renderAnnotation:u,lineAnnotations:n,renderHoverUtility:d,getHoveredLine:m}),o)})}function Jte(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const[r,i]=T.useState(()=>n?window.matchMedia(e).matches:t);return T.useLayoutEffect(()=>{const s=window.matchMedia(e),o=u=>{i(u?.matches??s.matches)};return o(),s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[e]),r}const ene=()=>typeof document>"u"?"light":(document.documentElement.dataset.theme||"").toLowerCase().includes("dark")?"dark":"light",tne=e=>{if(typeof document>"u")return()=>{};const t=new MutationObserver(()=>e());return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>t.disconnect()},nne=e=>{if(typeof document>"u")return()=>{};const t=new MutationObserver(()=>e());return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","style"]}),()=>t.disconnect()},H6=()=>T.useSyncExternalStore(tne,ene,()=>"light"),Rt=(e,t)=>typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t,_1=()=>Rt("--font-mono",'"Space Mono", monospace'),b1=()=>{const e=Rt("--font-mono-size","14px"),t=Number.parseFloat(e);return Number.isFinite(t)?t:14},yk=()=>({background:Rt("--terminal-bg","#ffffff"),foreground:Rt("--terminal-fg","#000000"),cursor:Rt("--terminal-cursor","#000000"),cursorAccent:Rt("--terminal-cursor-accent","#ffffff"),selectionBackground:Rt("--terminal-selection","rgba(0, 0, 0, 0.2)"),black:Rt("--terminal-black","#1f1f21"),red:Rt("--terminal-red","#ff2e3f"),green:Rt("--terminal-green","#0dbe4e"),yellow:Rt("--terminal-yellow","#ffca00"),blue:Rt("--terminal-blue","#009fff"),magenta:Rt("--terminal-magenta","#c635e4"),cyan:Rt("--terminal-cyan","#08c0ef"),white:Rt("--terminal-white","#c6c6c8"),brightBlack:Rt("--terminal-bright-black","#1f1f21"),brightRed:Rt("--terminal-bright-red","#ff2e3f"),brightGreen:Rt("--terminal-bright-green","#0dbe4e"),brightYellow:Rt("--terminal-bright-yellow","#ffca00"),brightBlue:Rt("--terminal-bright-blue","#009fff"),brightMagenta:Rt("--terminal-bright-magenta","#c635e4"),brightCyan:Rt("--terminal-bright-cyan","#08c0ef"),brightWhite:Rt("--terminal-bright-white","#c6c6c8")}),rne=`
|
|
1467
1467
|
:host {
|
|
1468
1468
|
--diffs-gap-fallback: 0px;
|
|
1469
1469
|
}
|
|
@@ -1494,4 +1494,4 @@ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){t
|
|
|
1494
1494
|
`)&&!Q.endsWith("\r")&&z.push(`\r
|
|
1495
1495
|
`),z.push(vse(me)),R.current=!0);const U=A.current;if(Q.length>U&&(z.push(Q.slice(U)),A.current=Q.length),J&&!N.current&&(Q&&!Q.endsWith(`
|
|
1496
1496
|
`)&&!Q.endsWith("\r")&&z.push(`\r
|
|
1497
|
-
`),z.push(yse()),N.current=!0),z.length){const se=M||V.buffer.active.viewportY===V.buffer.active.baseY;V.write(z.join(""),()=>{se&&V.scrollToBottom()})}},[J,F]),T.useEffect(()=>{if(!B||!J)return;const V=Y=>{const X=v.current,M=document.activeElement;!X||!M||!X.contains(M)||(Y.preventDefault(),u(B))};return window.addEventListener("keydown",V),()=>{window.removeEventListener("keydown",V)}},[J,B,u]),S.jsxs("div",{ref:v,className:"flex min-h-0 flex-1 h-full","data-testid":"terminal-panel",children:[S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"terminal-panel-output",children:[c?S.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-base-300 bg-error/10 px-3 py-2 text-xs text-error","data-testid":"terminal-panel-error",children:[S.jsx("span",{className:"truncate",children:c}),S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",onClick:d,"data-testid":"terminal-panel-error-dismiss",children:"Dismiss"})]}):null,S.jsxs("div",{ref:_,className:"relative min-h-0 flex-1 overflow-hidden","data-testid":"terminal-panel-output-body",onClick:()=>_.current?.focus(),tabIndex:0,children:[S.jsx("div",{ref:g,className:"h-full w-full p-2","data-testid":"terminal-panel-xterm"}),F?null:S.jsx("div",{className:"absolute inset-0 p-4 text-sm text-base-content/60","data-testid":"terminal-panel-empty",children:"Run a command to see output."})]})]}),S.jsxs("div",{className:"relative flex w-full min-h-0 flex-col gap-2 border-l border-base-300 p-2 border-t-0 overflow-auto lg:w-(--terminal-list-width) lg:flex-none",style:{"--terminal-list-width":`${p}px`},"data-testid":"terminal-panel-list",children:[S.jsx("div",{className:"absolute left-0 top-0 hidden h-full w-1 cursor-col-resize lg:block",onPointerDown:m,"data-testid":"terminal-panel-list-resize-handle"}),ee.length?S.jsx("div",{className:"tabs space-y-2 flex-col","data-testid":"terminal-panel-list-scroll",children:ee.map(V=>{const Y=r[V];return Y?S.jsx("button",{className:`tab h-4 justify-between p-0 gap-0 min-w-0 w-full ${V===s?"tab-active":""}`,onClick:()=>o(V),"data-testid":"terminal-panel-item","data-terminal-id":V,"data-run-id":Y.runId,"data-command-id":Y.commandId,children:S.jsx("span",{className:"text-xs font-medium truncate",children:Y.commandLabel||Y.commandName})},V):null})}):S.jsx("div",{className:"text-sm text-base-content/60","data-testid":"terminal-panel-list-empty",children:"No terminals yet."})]})]})}),wse=T.memo(({tabs:e,children:t,onResizeRowsStart:n,onResizeColsStart:r})=>{const{toolPanelLayout:i,toolPanelTab:s,setToolPanelTab:o,setToolPanelLayout:u}=Rn(an(m=>({toolPanelLayout:m.toolPanelLayout,toolPanelTab:m.toolPanelTab,setToolPanelTab:m.setToolPanelTab,setToolPanelLayout:m.setToolPanelLayout}))),c=i==="rows"?n:r,d=i==="rows"?"absolute left-0 top-0 h-2 w-full cursor-row-resize bg-transparent hover:bg-base-300/40":"absolute left-0 top-0 h-full w-2 cursor-col-resize bg-transparent hover:bg-base-300/40",p=i==="rows"?"border-t border-base-300":"border-l border-base-300";return S.jsxs("section",{className:`relative flex min-h-0 flex-col overflow-hidden bg-base-100 ${p}`,"data-testid":"tool-panel",children:[c?S.jsx("div",{className:d,onPointerDown:c,"data-testid":"tool-panel-resize-handle"}):null,S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-base-300 px-3 py-2","data-testid":"tool-panel-header",children:[S.jsx("div",{className:"tabs tabs-sm","data-testid":"tool-panel-tabs",children:e.map(m=>S.jsx("button",{className:`tab ${s===m.id?"tab-active font-semibold":""}`,onClick:()=>o(m.id),"data-testid":"tool-panel-tab","data-tab":m.id,children:m.label},m.id))}),S.jsx("div",{className:"flex items-center gap-2","data-testid":"tool-panel-layout",children:S.jsxs("div",{className:"join",children:[S.jsx("button",{className:`btn btn-xs join-item ${i==="rows"?"btn-active":""}`,onClick:()=>u("rows"),"data-testid":"tool-panel-layout-rows",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5",children:[S.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),S.jsx("path",{d:"M3 15h18"})]})}),S.jsx("button",{className:`btn btn-xs join-item ${i==="cols"?"btn-active":""}`,onClick:()=>u("cols"),"data-testid":"tool-panel-layout-cols",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5",children:[S.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),S.jsx("path",{d:"M15 3v18"})]})})]})})]}),S.jsx("div",{className:"min-h-0 flex-1","data-testid":"tool-panel-content",children:t})]})}),Cse=[{id:"agent",label:"Agent"},{id:"output",label:"Output"}],Tse=T.memo(({hasGit:e,onResizeStart:t,rightPanelRef:n,rightPanelClassName:r,rightPanelStyle:i,toolPanelVisible:s,onResizeRowsStart:o,onResizeColsStart:u})=>{const{projectPath:d,sidebarTab:p,toolPanelTab:m,setProjectPath:g,setProjectOpenError:_}=Rn(an(Ae=>({projectPath:Ae.projectPath,sidebarTab:Ae.sidebarTab,toolPanelTab:Ae.toolPanelTab,setProjectPath:Ae.setProjectPath,setProjectOpenError:Ae.setProjectOpenError}))),{selectedFilePath:v,selectedTreeFilePath:x,selectedCommitSha:C,selectedHistoryFilePath:w,setSelectedFilePath:A,setSelectedTreeFilePath:R,setSelectedCommitSha:N,setSelectedHistoryFilePath:L}=ro(an(Ae=>({selectedFilePath:Ae.selectedFilePath,selectedTreeFilePath:Ae.selectedTreeFilePath,selectedCommitSha:Ae.selectedCommitSha,selectedHistoryFilePath:Ae.selectedHistoryFilePath,setSelectedFilePath:Ae.setSelectedFilePath,setSelectedTreeFilePath:Ae.setSelectedTreeFilePath,setSelectedCommitSha:Ae.setSelectedCommitSha,setSelectedHistoryFilePath:Ae.setSelectedHistoryFilePath}))),{changes:I,selectedChange:P,selectedFileDiff:q,changesLoading:ee,toggleStage:F,toggleStageAll:J,diffError:B}=see({projectPath:d,isActive:p==="changes",selectedFilePath:v,onSelectedFilePathChange:A}),{entries:V,isAvailable:Y,isLoading:X}=lee({projectPath:d,isActive:p==="files",selectedFilePath:x,onSelectedFilePathChange:R}),M=N7(x),{file:Q,isLoading:W}=aee({projectPath:d,filePath:x,isActive:p==="files"&&!M}),{historyCommits:me,selectedCommit:z,historyChanges:U,selectedHistoryChange:se,selectedHistoryFileDiff:O,commitDiffLoading:ce,historyLoading:xe,historyLoadingMore:ve,hasMoreHistory:Ee,loadMoreHistory:Qe}=uee({projectPath:d,selectedCommitSha:C,onSelectedCommitShaChange:N,selectedHistoryFilePath:w,onSelectedHistoryFilePathChange:L,hasGit:e,isActive:p==="history",pageSize:30});return T.useEffect(()=>{const Ae=ah(B);Ae!=="invalid_path"&&Ae!=="not_a_directory"||(g(""),_(vR(B)))},[B,_,g]),S.jsxs(S.Fragment,{children:[S.jsx(Bte,{fileTreeEntries:V,fileTreeLoading:X,fileTreeAvailable:Y,changes:I,changesLoading:ee,onToggleStage:F,onToggleStageAll:J,historyCommits:me,onLoadMoreHistory:Qe,hasMoreHistory:Ee,historyLoading:xe,historyLoadingMore:ve,hasGit:e,onResizeStart:t}),S.jsxs("section",{ref:n,className:r,style:i,"data-testid":"review-panels-right",children:[p==="history"&&S.jsx(une,{selectedCommit:z,selectedCommitSha:C,historyChanges:U,selectedHistoryChange:se,selectedHistoryFileDiff:O,isLoadingDiff:ce}),p==="files"&&S.jsx(lne,{projectPath:d,file:Q,isLoading:W,isAvailable:Y,previewType:M}),p==="changes"&&S.jsx(one,{selectedChange:P,selectedFileDiff:q}),s&&S.jsxs(wse,{tabs:Cse,onResizeRowsStart:o,onResizeColsStart:u,children:[m==="agent"&&S.jsx(vte,{}),m==="output"&&S.jsx(xse,{})]})]})]})}),_A=(e,t)=>e?Math.round(e/2):t,bf=(e,t,n)=>e?Math.max(1,Math.round(e*t)):n,kse=()=>{const e=T.useRef(null),[t,n]=T.useState({width:0,height:0});T.useEffect(()=>{const i=e.current;if(!i)return;const s=()=>{const{width:u,height:c}=i.getBoundingClientRect();n({width:u,height:c})};if(s(),typeof ResizeObserver>"u")return;const o=new ResizeObserver(()=>{s()});return o.observe(i),()=>{o.disconnect()}},[]);const r=T.useMemo(()=>{const i=t.width,s=t.height;return{toolPanelInitialWidth:_A(i,360),toolPanelMinWidth:bf(i,.1,260),toolPanelMaxWidth:bf(i,.9,560),toolPanelInitialHeight:_A(s,320),toolPanelMinHeight:bf(s,.1,200),toolPanelMaxHeight:bf(s,.9,520)}},[t.height,t.width]);return{rightPanelRef:e,...r}},Ase=()=>{const{projectPath:e,isToolPanelVisible:t,toolPanelLayout:n,toggleToolPanelVisible:r}=Rn(an(q=>({projectPath:q.projectPath,isToolPanelVisible:q.isToolPanelVisible,toolPanelLayout:q.toolPanelLayout,toggleToolPanelVisible:q.toggleToolPanelVisible}))),{rightPanelRef:i,toolPanelInitialWidth:s,toolPanelMinWidth:o,toolPanelMaxWidth:u,toolPanelInitialHeight:c,toolPanelMinHeight:d,toolPanelMaxHeight:p}=kse(),{width:m,handleResizeStart:g}=El("x",{initialWidth:280,minWidth:200,maxWidth:520}),{width:_,handleResizeStart:v}=El("x",{initialWidth:s,minWidth:o,maxWidth:u,direction:-1}),{height:x,handleResizeStart:C}=El("y",{initialHeight:c,minHeight:d,maxHeight:p,direction:-1}),w=Vn({queryKey:["capabilities",e],queryFn:()=>Tt(`/api/capabilities?project=${encodeURIComponent(e)}`),enabled:!!e}),A=w.isLoading,R=!!w.data?.git,N=!!w.data?.github;T.useEffect(()=>{const q=ee=>{if(!ee.metaKey||ee.key.toLowerCase()!=="j")return;const F=ee.target;F&&(F.tagName==="INPUT"||F.tagName==="TEXTAREA"||F.isContentEditable)||(ee.preventDefault(),r())};return window.addEventListener("keydown",q),()=>{window.removeEventListener("keydown",q)}},[r]);const L=t,I=L?"grid min-h-0 min-w-0 overflow-hidden":"grid min-h-0 min-w-0 overflow-hidden grid-cols-1 grid-rows-1",P=L?n==="rows"?{gridTemplateRows:`minmax(0, 1fr) ${x}px`}:{gridTemplateColumns:`minmax(0, 1fr) ${_}px`}:void 0;return S.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-base-200","data-testid":"app-root",children:[S.jsx(iee,{hasGit:R,hasGithub:N,capabilitiesLoading:A}),S.jsx("main",{className:"grid min-h-0 flex-1 overflow-hidden gap-0 grid-cols-[var(--sidebar-width)_1fr]","data-testid":"app-main",style:{"--sidebar-width":`${m}px`},children:S.jsx(Tse,{hasGit:R,onResizeStart:g,rightPanelRef:i,rightPanelClassName:I,rightPanelStyle:P,toolPanelVisible:L,onResizeRowsStart:C,onResizeColsStart:v})})]})},Rse="/assets/worker-C3lkbYoB.js";function Nse(){return new Worker(Rse,{type:"module"})}function Lse({children:e}){return S.jsx(qte,{poolOptions:{workerFactory:Nse},highlighterOptions:{theme:{dark:"pierre-dark",light:"pierre-light"},langs:["typescript","javascript","css","html","go","rust","python"]},children:e})}const Ose=new yI({defaultOptions:{queries:{staleTime:5e3,retry:1}}}),OD=document.getElementById("root");if(!OD)throw new Error("Missing root element");HI.createRoot(OD).render(S.jsx(EI,{client:Ose,children:S.jsx(Lse,{children:S.jsx(Ase,{})})}));const Dse=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:h6},Symbol.toStringTag,{value:"Module"}));export{Wr as N,KZ as a,Ie as b,$se as c,S as j,T as r};
|
|
1497
|
+
`),z.push(yse()),N.current=!0),z.length){const se=M||V.buffer.active.viewportY===V.buffer.active.baseY;V.write(z.join(""),()=>{se&&V.scrollToBottom()})}},[J,F]),T.useEffect(()=>{if(!B||!J)return;const V=Y=>{const X=v.current,M=document.activeElement;!X||!M||!X.contains(M)||(Y.preventDefault(),u(B))};return window.addEventListener("keydown",V),()=>{window.removeEventListener("keydown",V)}},[J,B,u]),S.jsxs("div",{ref:v,className:"flex min-h-0 flex-1 h-full","data-testid":"terminal-panel",children:[S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"terminal-panel-output",children:[c?S.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-base-300 bg-error/10 px-3 py-2 text-xs text-error","data-testid":"terminal-panel-error",children:[S.jsx("span",{className:"truncate",children:c}),S.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",onClick:d,"data-testid":"terminal-panel-error-dismiss",children:"Dismiss"})]}):null,S.jsxs("div",{ref:_,className:"relative min-h-0 flex-1 overflow-hidden","data-testid":"terminal-panel-output-body",onClick:()=>_.current?.focus(),tabIndex:0,children:[S.jsx("div",{ref:g,className:"h-full w-full p-2","data-testid":"terminal-panel-xterm"}),F?null:S.jsx("div",{className:"absolute inset-0 p-4 text-sm text-base-content/60","data-testid":"terminal-panel-empty",children:"Run a command to see output."})]})]}),S.jsxs("div",{className:"relative flex w-full min-h-0 flex-col gap-2 border-l border-base-300 p-2 border-t-0 overflow-auto lg:w-(--terminal-list-width) lg:flex-none",style:{"--terminal-list-width":`${p}px`},"data-testid":"terminal-panel-list",children:[S.jsx("div",{className:"absolute left-0 top-0 hidden h-full w-1 cursor-col-resize lg:block",onPointerDown:m,"data-testid":"terminal-panel-list-resize-handle"}),ee.length?S.jsx("div",{className:"tabs space-y-2 flex-col","data-testid":"terminal-panel-list-scroll",children:ee.map(V=>{const Y=r[V];return Y?S.jsx("button",{className:`tab h-4 justify-between p-0 gap-0 min-w-0 w-full ${V===s?"tab-active":""}`,onClick:()=>o(V),"data-testid":"terminal-panel-item","data-terminal-id":V,"data-run-id":Y.runId,"data-command-id":Y.commandId,children:S.jsx("span",{className:"text-xs font-medium truncate",children:Y.commandLabel||Y.commandName})},V):null})}):S.jsx("div",{className:"text-sm text-base-content/60","data-testid":"terminal-panel-list-empty",children:"No terminals yet."})]})]})}),wse=T.memo(({tabs:e,children:t,onResizeRowsStart:n,onResizeColsStart:r})=>{const{toolPanelLayout:i,toolPanelTab:s,setToolPanelTab:o,setToolPanelLayout:u}=Rn(an(m=>({toolPanelLayout:m.toolPanelLayout,toolPanelTab:m.toolPanelTab,setToolPanelTab:m.setToolPanelTab,setToolPanelLayout:m.setToolPanelLayout}))),c=i==="rows"?n:r,d=i==="rows"?"absolute left-0 top-0 h-2 w-full cursor-row-resize bg-transparent hover:bg-base-300/40":"absolute left-0 top-0 h-full w-2 cursor-col-resize bg-transparent hover:bg-base-300/40",p=i==="rows"?"border-t border-base-300":"border-l border-base-300";return S.jsxs("section",{className:`relative flex min-h-0 flex-col overflow-hidden bg-base-100 ${p}`,"data-testid":"tool-panel",children:[c?S.jsx("div",{className:d,onPointerDown:c,"data-testid":"tool-panel-resize-handle"}):null,S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-base-300 px-3 py-2","data-testid":"tool-panel-header",children:[S.jsx("div",{className:"tabs tabs-sm","data-testid":"tool-panel-tabs",children:e.map(m=>S.jsx("button",{className:`tab ${s===m.id?"tab-active font-semibold":""}`,onClick:()=>o(m.id),"data-testid":"tool-panel-tab","data-tab":m.id,children:m.label},m.id))}),S.jsx("div",{className:"flex items-center gap-2","data-testid":"tool-panel-layout",children:S.jsxs("div",{className:"join",children:[S.jsx("button",{className:`btn btn-xs join-item ${i==="rows"?"btn-active":""}`,onClick:()=>u("rows"),"data-testid":"tool-panel-layout-rows",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5",children:[S.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),S.jsx("path",{d:"M3 15h18"})]})}),S.jsx("button",{className:`btn btn-xs join-item ${i==="cols"?"btn-active":""}`,onClick:()=>u("cols"),"data-testid":"tool-panel-layout-cols",children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5",children:[S.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),S.jsx("path",{d:"M15 3v18"})]})})]})})]}),S.jsx("div",{className:"min-h-0 flex-1","data-testid":"tool-panel-content",children:t})]})}),Cse=[{id:"agent",label:"Agent"},{id:"output",label:"Output"}],Tse=T.memo(({hasGit:e,onResizeStart:t,rightPanelRef:n,rightPanelClassName:r,rightPanelStyle:i,toolPanelVisible:s,onResizeRowsStart:o,onResizeColsStart:u})=>{const{projectPath:d,sidebarTab:p,toolPanelTab:m,setProjectPath:g,setProjectOpenError:_}=Rn(an(Ae=>({projectPath:Ae.projectPath,sidebarTab:Ae.sidebarTab,toolPanelTab:Ae.toolPanelTab,setProjectPath:Ae.setProjectPath,setProjectOpenError:Ae.setProjectOpenError}))),{selectedFilePath:v,selectedTreeFilePath:x,selectedCommitSha:C,selectedHistoryFilePath:w,setSelectedFilePath:A,setSelectedTreeFilePath:R,setSelectedCommitSha:N,setSelectedHistoryFilePath:L}=ro(an(Ae=>({selectedFilePath:Ae.selectedFilePath,selectedTreeFilePath:Ae.selectedTreeFilePath,selectedCommitSha:Ae.selectedCommitSha,selectedHistoryFilePath:Ae.selectedHistoryFilePath,setSelectedFilePath:Ae.setSelectedFilePath,setSelectedTreeFilePath:Ae.setSelectedTreeFilePath,setSelectedCommitSha:Ae.setSelectedCommitSha,setSelectedHistoryFilePath:Ae.setSelectedHistoryFilePath}))),{changes:I,selectedChange:P,selectedFileDiff:q,changesLoading:ee,toggleStage:F,toggleStageAll:J,diffError:B}=see({projectPath:d,isActive:p==="changes",selectedFilePath:v,onSelectedFilePathChange:A}),{entries:V,isAvailable:Y,isLoading:X}=lee({projectPath:d,isActive:p==="files",selectedFilePath:x,onSelectedFilePathChange:R}),M=N7(x),{file:Q,isLoading:W}=aee({projectPath:d,filePath:x,isActive:p==="files"&&!M}),{historyCommits:me,selectedCommit:z,historyChanges:U,selectedHistoryChange:se,selectedHistoryFileDiff:O,commitDiffLoading:ce,historyLoading:xe,historyLoadingMore:ve,hasMoreHistory:Ee,loadMoreHistory:Qe}=uee({projectPath:d,selectedCommitSha:C,onSelectedCommitShaChange:N,selectedHistoryFilePath:w,onSelectedHistoryFilePathChange:L,hasGit:e,isActive:p==="history",pageSize:30});return T.useEffect(()=>{const Ae=ah(B);Ae!=="invalid_path"&&Ae!=="not_a_directory"||(g(""),_(v3(B)))},[B,_,g]),S.jsxs(S.Fragment,{children:[S.jsx(Bte,{fileTreeEntries:V,fileTreeLoading:X,fileTreeAvailable:Y,changes:I,changesLoading:ee,onToggleStage:F,onToggleStageAll:J,historyCommits:me,onLoadMoreHistory:Qe,hasMoreHistory:Ee,historyLoading:xe,historyLoadingMore:ve,hasGit:e,onResizeStart:t}),S.jsxs("section",{ref:n,className:r,style:i,"data-testid":"review-panels-right",children:[p==="history"&&S.jsx(une,{selectedCommit:z,selectedCommitSha:C,historyChanges:U,selectedHistoryChange:se,selectedHistoryFileDiff:O,isLoadingDiff:ce}),p==="files"&&S.jsx(lne,{projectPath:d,file:Q,isLoading:W,isAvailable:Y,previewType:M}),p==="changes"&&S.jsx(one,{selectedChange:P,selectedFileDiff:q}),s&&S.jsxs(wse,{tabs:Cse,onResizeRowsStart:o,onResizeColsStart:u,children:[m==="agent"&&S.jsx(vte,{}),m==="output"&&S.jsx(xse,{})]})]})]})}),_A=(e,t)=>e?Math.round(e/2):t,bf=(e,t,n)=>e?Math.max(1,Math.round(e*t)):n,kse=()=>{const e=T.useRef(null),[t,n]=T.useState({width:0,height:0});T.useEffect(()=>{const i=e.current;if(!i)return;const s=()=>{const{width:u,height:c}=i.getBoundingClientRect();n({width:u,height:c})};if(s(),typeof ResizeObserver>"u")return;const o=new ResizeObserver(()=>{s()});return o.observe(i),()=>{o.disconnect()}},[]);const r=T.useMemo(()=>{const i=t.width,s=t.height;return{toolPanelInitialWidth:_A(i,360),toolPanelMinWidth:bf(i,.1,260),toolPanelMaxWidth:bf(i,.9,560),toolPanelInitialHeight:_A(s,320),toolPanelMinHeight:bf(s,.1,200),toolPanelMaxHeight:bf(s,.9,520)}},[t.height,t.width]);return{rightPanelRef:e,...r}},Ase=()=>{const{projectPath:e,isToolPanelVisible:t,toolPanelLayout:n,toggleToolPanelVisible:r}=Rn(an(q=>({projectPath:q.projectPath,isToolPanelVisible:q.isToolPanelVisible,toolPanelLayout:q.toolPanelLayout,toggleToolPanelVisible:q.toggleToolPanelVisible}))),{rightPanelRef:i,toolPanelInitialWidth:s,toolPanelMinWidth:o,toolPanelMaxWidth:u,toolPanelInitialHeight:c,toolPanelMinHeight:d,toolPanelMaxHeight:p}=kse(),{width:m,handleResizeStart:g}=El("x",{initialWidth:280,minWidth:200,maxWidth:520}),{width:_,handleResizeStart:v}=El("x",{initialWidth:s,minWidth:o,maxWidth:u,direction:-1}),{height:x,handleResizeStart:C}=El("y",{initialHeight:c,minHeight:d,maxHeight:p,direction:-1}),w=Vn({queryKey:["capabilities",e],queryFn:()=>Tt(`/api/capabilities?project=${encodeURIComponent(e)}`),enabled:!!e}),A=w.isLoading,R=!!w.data?.git,N=!!w.data?.github;T.useEffect(()=>{const q=ee=>{if(!ee.metaKey||ee.key.toLowerCase()!=="j")return;const F=ee.target;F&&(F.tagName==="INPUT"||F.tagName==="TEXTAREA"||F.isContentEditable)||(ee.preventDefault(),r())};return window.addEventListener("keydown",q),()=>{window.removeEventListener("keydown",q)}},[r]);const L=t,I=L?"grid min-h-0 min-w-0 overflow-hidden":"grid min-h-0 min-w-0 overflow-hidden grid-cols-1 grid-rows-1",P=L?n==="rows"?{gridTemplateRows:`minmax(0, 1fr) ${x}px`}:{gridTemplateColumns:`minmax(0, 1fr) ${_}px`}:void 0;return S.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-base-200","data-testid":"app-root",children:[S.jsx(iee,{hasGit:R,hasGithub:N,capabilitiesLoading:A}),S.jsx("main",{className:"grid min-h-0 flex-1 overflow-hidden gap-0 grid-cols-[var(--sidebar-width)_1fr]","data-testid":"app-main",style:{"--sidebar-width":`${m}px`},children:S.jsx(Tse,{hasGit:R,onResizeStart:g,rightPanelRef:i,rightPanelClassName:I,rightPanelStyle:P,toolPanelVisible:L,onResizeRowsStart:C,onResizeColsStart:v})})]})},Rse="/assets/worker-C3lkbYoB.js";function Nse(){return new Worker(Rse,{type:"module"})}function Lse({children:e}){return S.jsx(qte,{poolOptions:{workerFactory:Nse},highlighterOptions:{theme:{dark:"pierre-dark",light:"pierre-light"},langs:["typescript","javascript","css","html","go","rust","python"]},children:e})}const Ose=new yI({defaultOptions:{queries:{staleTime:5e3,retry:1}}}),OD=document.getElementById("root");if(!OD)throw new Error("Missing root element");HI.createRoot(OD).render(S.jsx(EI,{client:Ose,children:S.jsx(Lse,{children:S.jsx(Ase,{})})}));const Dse=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:h6},Symbol.toStringTag,{value:"Module"}));export{Wr as N,KZ as a,Ie as b,$se as c,S as j,T as r};
|