convex-cms 0.0.17-alpha.0 → 0.0.17

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.
@@ -7,7 +7,7 @@ function CO(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
7
7
  Error generating stack: `+f.message+`
8
8
  `+f.stack}}var pe=Object.prototype.hasOwnProperty,Le=e.unstable_scheduleCallback,We=e.unstable_cancelCallback,Oe=e.unstable_shouldYield,ft=e.unstable_requestPaint,ut=e.unstable_now,Mn=e.unstable_getCurrentPriorityLevel,Xe=e.unstable_ImmediatePriority,wt=e.unstable_UserBlockingPriority,gt=e.unstable_NormalPriority,qn=e.unstable_LowPriority,ir=e.unstable_IdlePriority,Yr=e.log,zn=e.unstable_setDisableYieldValue,Pn=null,Vt=null;function en(r){if(typeof Yr=="function"&&zn(r),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(Pn,r)}catch{}}var $t=Math.clz32?Math.clz32:xe,ds=Math.log,Wr=Math.LN2;function xe(r){return r>>>=0,r===0?32:31-(ds(r)/Wr|0)|0}var ke=256,we=262144,Ne=4194304;function He(r){var a=r&42;if(a!==0)return a;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function De(r,a,c){var f=r.pendingLanes;if(f===0)return 0;var x=0,b=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var P=f&134217727;return P!==0?(f=P&~b,f!==0?x=He(f):(k&=P,k!==0?x=He(k):c||(c=P&~r,c!==0&&(x=He(c))))):(P=f&~b,P!==0?x=He(P):k!==0?x=He(k):c||(c=f&~r,c!==0&&(x=He(c)))),x===0?0:a!==0&&a!==x&&(a&b)===0&&(b=x&-x,c=a&-a,b>=c||b===32&&(c&4194048)!==0)?a:x}function St(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function bn(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 tn(){var r=Ne;return Ne<<=1,(Ne&62914560)===0&&(Ne=4194304),r}function Gt(r){for(var a=[],c=0;31>c;c++)a.push(r);return a}function Ot(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Rn(r,a,c,f,x,b){var k=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var P=r.entanglements,V=r.expirationTimes,se=r.hiddenUpdates;for(c=k&~c;0<c;){var ce=31-$t(c),he=1<<ce;P[ce]=0,V[ce]=-1;var oe=se[ce];if(oe!==null)for(se[ce]=null,ce=0;ce<oe.length;ce++){var ie=oe[ce];ie!==null&&(ie.lane&=-536870913)}c&=~he}f!==0&&Hn(r,f,0),b!==0&&x===0&&r.tag!==0&&(r.suspendedLanes|=b&~(k&~a))}function Hn(r,a,c){r.pendingLanes|=a,r.suspendedLanes&=~a;var f=31-$t(a);r.entangledLanes|=a,r.entanglements[f]=r.entanglements[f]|1073741824|c&261930}function wn(r,a){var c=r.entangledLanes|=a;for(r=r.entanglements;c;){var f=31-$t(c),x=1<<f;x&a|r[f]&a&&(r[f]|=a),c&=~x}}function Q(r,a){var c=a&-a;return c=(c&42)!==0?1:je(c),(c&(r.suspendedLanes|a))!==0?0:c}function je(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ve(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function vt(){var r=$.p;return r!==0?r:(r=window.event,r===void 0?32:t1(r.type))}function Je(r,a){var c=$.p;try{return $.p=r,a()}finally{$.p=c}}var Yn=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Yn,Wn="__reactProps$"+Yn,ei="__reactContainer$"+Yn,bm="__reactEvents$"+Yn,hR="__reactListeners$"+Yn,mR="__reactHandles$"+Yn,xb="__reactResources$"+Yn,Yl="__reactMarker$"+Yn;function wm(r){delete r[Zt],delete r[Wn],delete r[bm],delete r[hR],delete r[mR]}function ti(r){var a=r[Zt];if(a)return a;for(var c=r.parentNode;c;){if(a=c[ei]||c[Zt]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(r=$S(r);r!==null;){if(c=r[Zt])return c;r=$S(r)}return a}r=c,c=r.parentNode}return null}function ni(r){if(r=r[Zt]||r[ei]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function Wl(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(s(33))}function ri(r){var a=r[xb];return a||(a=r[xb]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Sn(r){r[Yl]=!0}var yb=new Set,bb={};function ao(r,a){si(r,a),si(r+"Capture",a)}function si(r,a){for(bb[r]=a,r=0;r<a.length;r++)yb.add(a[r])}var pR=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]*$"),wb={},Sb={};function gR(r){return pe.call(Sb,r)?!0:pe.call(wb,r)?!1:pR.test(r)?Sb[r]=!0:(wb[r]=!0,!1)}function rd(r,a,c){if(gR(a))if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var f=a.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+c)}}function sd(r,a,c){if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+c)}}function Os(r,a,c,f){if(f===null)r.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(a,c,""+f)}}function kr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function jb(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function vR(r,a,c){var f=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var x=f.get,b=f.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return x.call(this)},set:function(k){c=""+k,b.call(this,k)}}),Object.defineProperty(r,a,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(k){c=""+k},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function Sm(r){if(!r._valueTracker){var a=jb(r)?"checked":"value";r._valueTracker=vR(r,a,""+r[a])}}function Cb(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var c=a.getValue(),f="";return r&&(f=jb(r)?r.checked?"true":"false":r.value),r=f,r!==c?(a.setValue(r),!0):!1}function ad(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var xR=/[\n"\\]/g;function _r(r){return r.replace(xR,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function jm(r,a,c,f,x,b,k,P){r.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.type=k:r.removeAttribute("type"),a!=null?k==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+kr(a)):r.value!==""+kr(a)&&(r.value=""+kr(a)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),a!=null?Cm(r,k,kr(a)):c!=null?Cm(r,k,kr(c)):f!=null&&r.removeAttribute("value"),x==null&&b!=null&&(r.defaultChecked=!!b),x!=null&&(r.checked=x&&typeof x!="function"&&typeof x!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?r.name=""+kr(P):r.removeAttribute("name")}function Nb(r,a,c,f,x,b,k,P){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(r.type=b),a!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||a!=null)){Sm(r);return}c=c!=null?""+kr(c):"",a=a!=null?""+kr(a):c,P||a===r.value||(r.value=a),r.defaultValue=a}f=f??x,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=P?r.checked:!!f,r.defaultChecked=!!f,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),Sm(r)}function Cm(r,a,c){a==="number"&&ad(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function ai(r,a,c,f){if(r=r.options,a){a={};for(var x=0;x<c.length;x++)a["$"+c[x]]=!0;for(c=0;c<r.length;c++)x=a.hasOwnProperty("$"+r[c].value),r[c].selected!==x&&(r[c].selected=x),x&&f&&(r[c].defaultSelected=!0)}else{for(c=""+kr(c),a=null,x=0;x<r.length;x++){if(r[x].value===c){r[x].selected=!0,f&&(r[x].defaultSelected=!0);return}a!==null||r[x].disabled||(a=r[x])}a!==null&&(a.selected=!0)}}function kb(r,a,c){if(a!=null&&(a=""+kr(a),a!==r.value&&(r.value=a),c==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=c!=null?""+kr(c):""}function _b(r,a,c,f){if(a==null){if(f!=null){if(c!=null)throw Error(s(92));if(ae(f)){if(1<f.length)throw Error(s(93));f=f[0]}c=f}c==null&&(c=""),a=c}c=kr(a),r.defaultValue=c,f=r.textContent,f===c&&f!==""&&f!==null&&(r.value=f),Sm(r)}function oi(r,a){if(a){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=a;return}}r.textContent=a}var yR=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 Eb(r,a,c){var f=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":f?r.setProperty(a,c):typeof c!="number"||c===0||yR.has(a)?a==="float"?r.cssFloat=c:r[a]=(""+c).trim():r[a]=c+"px"}function Tb(r,a,c){if(a!=null&&typeof a!="object")throw Error(s(62));if(r=r.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||a!=null&&a.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var x in a)f=a[x],a.hasOwnProperty(x)&&c[x]!==f&&Eb(r,x,f)}else for(var b in a)a.hasOwnProperty(b)&&Eb(r,b,a[b])}function Nm(r){if(r.indexOf("-")===-1)return!1;switch(r){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 bR=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"]]),wR=/^[\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 od(r){return wR.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ds(){}var km=null;function _m(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ii=null,li=null;function Mb(r){var a=ni(r);if(a&&(r=a.stateNode)){var c=r[Wn]||null;e:switch(r=a.stateNode,a.type){case"input":if(jm(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+_r(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var f=c[a];if(f!==r&&f.form===r.form){var x=f[Wn]||null;if(!x)throw Error(s(90));jm(f,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(a=0;a<c.length;a++)f=c[a],f.form===r.form&&Cb(f)}break e;case"textarea":kb(r,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&ai(r,!!c.multiple,a,!1)}}}var Em=!1;function Rb(r,a,c){if(Em)return r(a,c);Em=!0;try{var f=r(a);return f}finally{if(Em=!1,(ii!==null||li!==null)&&(Wd(),ii&&(a=ii,r=li,li=ii=null,Mb(a),r)))for(a=0;a<r.length;a++)Mb(r[a])}}function Gl(r,a){var c=r.stateNode;if(c===null)return null;var f=c[Wn]||null;if(f===null)return null;c=f[a];e:switch(a){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)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(s(231,a,typeof c));return c}var zs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tm=!1;if(zs)try{var Zl={};Object.defineProperty(Zl,"passive",{get:function(){Tm=!0}}),window.addEventListener("test",Zl,Zl),window.removeEventListener("test",Zl,Zl)}catch{Tm=!1}var ma=null,Mm=null,id=null;function Ab(){if(id)return id;var r,a=Mm,c=a.length,f,x="value"in ma?ma.value:ma.textContent,b=x.length;for(r=0;r<c&&a[r]===x[r];r++);var k=c-r;for(f=1;f<=k&&a[c-f]===x[b-f];f++);return id=x.slice(r,1<f?1-f:void 0)}function ld(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function cd(){return!0}function Ob(){return!1}function Gn(r){function a(c,f,x,b,k){this._reactName=c,this._targetInst=x,this.type=f,this.nativeEvent=b,this.target=k,this.currentTarget=null;for(var P in r)r.hasOwnProperty(P)&&(c=r[P],this[P]=c?c(b):b[P]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?cd:Ob,this.isPropagationStopped=Ob,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=cd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=cd)},persist:function(){},isPersistent:cd}),a}var oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ud=Gn(oo),Ql=g({},oo,{view:0,detail:0}),SR=Gn(Ql),Rm,Am,Kl,dd=g({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Kl&&(Kl&&r.type==="mousemove"?(Rm=r.screenX-Kl.screenX,Am=r.screenY-Kl.screenY):Am=Rm=0,Kl=r),Rm)},movementY:function(r){return"movementY"in r?r.movementY:Am}}),Db=Gn(dd),jR=g({},dd,{dataTransfer:0}),CR=Gn(jR),NR=g({},Ql,{relatedTarget:0}),Om=Gn(NR),kR=g({},oo,{animationName:0,elapsedTime:0,pseudoElement:0}),_R=Gn(kR),ER=g({},oo,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),TR=Gn(ER),MR=g({},oo,{data:0}),zb=Gn(MR),RR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AR={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"},OR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DR(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=OR[r])?!!a[r]:!1}function Dm(){return DR}var zR=g({},Ql,{key:function(r){if(r.key){var a=RR[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=ld(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?AR[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(r){return r.type==="keypress"?ld(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ld(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),PR=Gn(zR),LR=g({},dd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pb=Gn(LR),IR=g({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),$R=Gn(IR),FR=g({},oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),BR=Gn(FR),UR=g({},dd,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),VR=Gn(UR),qR=g({},oo,{newState:0,oldState:0}),HR=Gn(qR),YR=[9,13,27,32],zm=zs&&"CompositionEvent"in window,Xl=null;zs&&"documentMode"in document&&(Xl=document.documentMode);var WR=zs&&"TextEvent"in window&&!Xl,Lb=zs&&(!zm||Xl&&8<Xl&&11>=Xl),Ib=" ",$b=!1;function Fb(r,a){switch(r){case"keyup":return YR.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bb(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ci=!1;function GR(r,a){switch(r){case"compositionend":return Bb(a);case"keypress":return a.which!==32?null:($b=!0,Ib);case"textInput":return r=a.data,r===Ib&&$b?null:r;default:return null}}function ZR(r,a){if(ci)return r==="compositionend"||!zm&&Fb(r,a)?(r=Ab(),id=Mm=ma=null,ci=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Lb&&a.locale!=="ko"?null:a.data;default:return null}}var QR={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 Ub(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!QR[r.type]:a==="textarea"}function Vb(r,a,c,f){ii?li?li.push(f):li=[f]:ii=f,a=ef(a,"onChange"),0<a.length&&(c=new ud("onChange","change",null,c,f),r.push({event:c,listeners:a}))}var Jl=null,ec=null;function KR(r){NS(r,0)}function fd(r){var a=Wl(r);if(Cb(a))return r}function qb(r,a){if(r==="change")return a}var Hb=!1;if(zs){var Pm;if(zs){var Lm="oninput"in document;if(!Lm){var Yb=document.createElement("div");Yb.setAttribute("oninput","return;"),Lm=typeof Yb.oninput=="function"}Pm=Lm}else Pm=!1;Hb=Pm&&(!document.documentMode||9<document.documentMode)}function Wb(){Jl&&(Jl.detachEvent("onpropertychange",Gb),ec=Jl=null)}function Gb(r){if(r.propertyName==="value"&&fd(ec)){var a=[];Vb(a,ec,r,_m(r)),Rb(KR,a)}}function XR(r,a,c){r==="focusin"?(Wb(),Jl=a,ec=c,Jl.attachEvent("onpropertychange",Gb)):r==="focusout"&&Wb()}function JR(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return fd(ec)}function eA(r,a){if(r==="click")return fd(a)}function tA(r,a){if(r==="input"||r==="change")return fd(a)}function nA(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var lr=typeof Object.is=="function"?Object.is:nA;function tc(r,a){if(lr(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var c=Object.keys(r),f=Object.keys(a);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var x=c[f];if(!pe.call(a,x)||!lr(r[x],a[x]))return!1}return!0}function Zb(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Qb(r,a){var c=Zb(r);r=0;for(var f;c;){if(c.nodeType===3){if(f=r+c.textContent.length,r<=a&&f>=a)return{node:c,offset:a-r};r=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Zb(c)}}function Kb(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?Kb(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function Xb(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=ad(r.document);a instanceof r.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)r=a.contentWindow;else break;a=ad(r.document)}return a}function Im(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var rA=zs&&"documentMode"in document&&11>=document.documentMode,ui=null,$m=null,nc=null,Fm=!1;function Jb(r,a,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Fm||ui==null||ui!==ad(f)||(f=ui,"selectionStart"in f&&Im(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}),nc&&tc(nc,f)||(nc=f,f=ef($m,"onSelect"),0<f.length&&(a=new ud("onSelect","select",null,a,c),r.push({event:a,listeners:f}),a.target=ui)))}function io(r,a){var c={};return c[r.toLowerCase()]=a.toLowerCase(),c["Webkit"+r]="webkit"+a,c["Moz"+r]="moz"+a,c}var di={animationend:io("Animation","AnimationEnd"),animationiteration:io("Animation","AnimationIteration"),animationstart:io("Animation","AnimationStart"),transitionrun:io("Transition","TransitionRun"),transitionstart:io("Transition","TransitionStart"),transitioncancel:io("Transition","TransitionCancel"),transitionend:io("Transition","TransitionEnd")},Bm={},e0={};zs&&(e0=document.createElement("div").style,"AnimationEvent"in window||(delete di.animationend.animation,delete di.animationiteration.animation,delete di.animationstart.animation),"TransitionEvent"in window||delete di.transitionend.transition);function lo(r){if(Bm[r])return Bm[r];if(!di[r])return r;var a=di[r],c;for(c in a)if(a.hasOwnProperty(c)&&c in e0)return Bm[r]=a[c];return r}var t0=lo("animationend"),n0=lo("animationiteration"),r0=lo("animationstart"),sA=lo("transitionrun"),aA=lo("transitionstart"),oA=lo("transitioncancel"),s0=lo("transitionend"),a0=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 Gr(r,a){a0.set(r,a),ao(a,[r])}var hd=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Er=[],fi=0,Vm=0;function md(){for(var r=fi,a=Vm=fi=0;a<r;){var c=Er[a];Er[a++]=null;var f=Er[a];Er[a++]=null;var x=Er[a];Er[a++]=null;var b=Er[a];if(Er[a++]=null,f!==null&&x!==null){var k=f.pending;k===null?x.next=x:(x.next=k.next,k.next=x),f.pending=x}b!==0&&o0(c,x,b)}}function pd(r,a,c,f){Er[fi++]=r,Er[fi++]=a,Er[fi++]=c,Er[fi++]=f,Vm|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function qm(r,a,c,f){return pd(r,a,c,f),gd(r)}function co(r,a){return pd(r,null,null,a),gd(r)}function o0(r,a,c){r.lanes|=c;var f=r.alternate;f!==null&&(f.lanes|=c);for(var x=!1,b=r.return;b!==null;)b.childLanes|=c,f=b.alternate,f!==null&&(f.childLanes|=c),b.tag===22&&(r=b.stateNode,r===null||r._visibility&1||(x=!0)),r=b,b=b.return;return r.tag===3?(b=r.stateNode,x&&a!==null&&(x=31-$t(c),r=b.hiddenUpdates,f=r[x],f===null?r[x]=[a]:f.push(a),a.lane=c|536870912),b):null}function gd(r){if(50<Cc)throw Cc=0,Jp=null,Error(s(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var hi={};function iA(r,a,c,f){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,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 cr(r,a,c,f){return new iA(r,a,c,f)}function Hm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ps(r,a){var c=r.alternate;return c===null?(c=cr(r.tag,a,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=a,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,a=r.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function i0(r,a){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,a=c.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function vd(r,a,c,f,x,b){var k=0;if(f=r,typeof r=="function")Hm(r)&&(k=1);else if(typeof r=="string")k=fO(r,c,ne.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case D:return r=cr(31,c,a,x),r.elementType=D,r.lanes=b,r;case j:return uo(c.children,x,b,a);case N:k=8,x|=24;break;case C:return r=cr(12,c,a,x|2),r.elementType=C,r.lanes=b,r;case A:return r=cr(13,c,a,x),r.elementType=A,r.lanes=b,r;case R:return r=cr(19,c,a,x),r.elementType=R,r.lanes=b,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case E:k=10;break e;case _:k=9;break e;case M:k=11;break e;case T:k=14;break e;case O:k=16,f=null;break e}k=29,c=Error(s(130,r===null?"null":typeof r,"")),f=null}return a=cr(k,c,a,x),a.elementType=r,a.type=f,a.lanes=b,a}function uo(r,a,c,f){return r=cr(7,r,f,a),r.lanes=c,r}function Ym(r,a,c){return r=cr(6,r,null,a),r.lanes=c,r}function l0(r){var a=cr(18,null,null,0);return a.stateNode=r,a}function Wm(r,a,c){return a=cr(4,r.children!==null?r.children:[],r.key,a),a.lanes=c,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var c0=new WeakMap;function Tr(r,a){if(typeof r=="object"&&r!==null){var c=c0.get(r);return c!==void 0?c:(a={value:r,source:a,stack:bt(a)},c0.set(r,a),a)}return{value:r,source:a,stack:bt(a)}}var mi=[],pi=0,xd=null,rc=0,Mr=[],Rr=0,pa=null,fs=1,hs="";function Ls(r,a){mi[pi++]=rc,mi[pi++]=xd,xd=r,rc=a}function u0(r,a,c){Mr[Rr++]=fs,Mr[Rr++]=hs,Mr[Rr++]=pa,pa=r;var f=fs;r=hs;var x=32-$t(f)-1;f&=~(1<<x),c+=1;var b=32-$t(a)+x;if(30<b){var k=x-x%5;b=(f&(1<<k)-1).toString(32),f>>=k,x-=k,fs=1<<32-$t(a)+x|c<<x|f,hs=b+r}else fs=1<<b|c<<x|f,hs=r}function Gm(r){r.return!==null&&(Ls(r,1),u0(r,1,0))}function Zm(r){for(;r===xd;)xd=mi[--pi],mi[pi]=null,rc=mi[--pi],mi[pi]=null;for(;r===pa;)pa=Mr[--Rr],Mr[Rr]=null,hs=Mr[--Rr],Mr[Rr]=null,fs=Mr[--Rr],Mr[Rr]=null}function d0(r,a){Mr[Rr++]=fs,Mr[Rr++]=hs,Mr[Rr++]=pa,fs=a.id,hs=a.overflow,pa=r}var kn=null,Dt=null,dt=!1,ga=null,Ar=!1,Qm=Error(s(519));function va(r){var a=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sc(Tr(a,r)),Qm}function f0(r){var a=r.stateNode,c=r.type,f=r.memoizedProps;switch(a[Zt]=r,a[Wn]=f,c){case"dialog":ot("cancel",a),ot("close",a);break;case"iframe":case"object":case"embed":ot("load",a);break;case"video":case"audio":for(c=0;c<kc.length;c++)ot(kc[c],a);break;case"source":ot("error",a);break;case"img":case"image":case"link":ot("error",a),ot("load",a);break;case"details":ot("toggle",a);break;case"input":ot("invalid",a),Nb(a,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":ot("invalid",a);break;case"textarea":ot("invalid",a),_b(a,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||f.suppressHydrationWarning===!0||TS(a.textContent,c)?(f.popover!=null&&(ot("beforetoggle",a),ot("toggle",a)),f.onScroll!=null&&ot("scroll",a),f.onScrollEnd!=null&&ot("scrollend",a),f.onClick!=null&&(a.onclick=Ds),a=!0):a=!1,a||va(r,!0)}function h0(r){for(kn=r.return;kn;)switch(kn.tag){case 5:case 31:case 13:Ar=!1;return;case 27:case 3:Ar=!0;return;default:kn=kn.return}}function gi(r){if(r!==kn)return!1;if(!dt)return h0(r),dt=!0,!1;var a=r.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||mg(r.type,r.memoizedProps)),c=!c),c&&Dt&&va(r),h0(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Dt=IS(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Dt=IS(r)}else a===27?(a=Dt,Ra(r.type)?(r=yg,yg=null,Dt=r):Dt=a):Dt=kn?Dr(r.stateNode.nextSibling):null;return!0}function fo(){Dt=kn=null,dt=!1}function Km(){var r=ga;return r!==null&&(Xn===null?Xn=r:Xn.push.apply(Xn,r),ga=null),r}function sc(r){ga===null?ga=[r]:ga.push(r)}var Xm=I(null),ho=null,Is=null;function xa(r,a,c){K(Xm,a._currentValue),a._currentValue=c}function $s(r){r._currentValue=Xm.current,F(Xm)}function Jm(r,a,c){for(;r!==null;){var f=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,f!==null&&(f.childLanes|=a)):f!==null&&(f.childLanes&a)!==a&&(f.childLanes|=a),r===c)break;r=r.return}}function ep(r,a,c,f){var x=r.child;for(x!==null&&(x.return=r);x!==null;){var b=x.dependencies;if(b!==null){var k=x.child;b=b.firstContext;e:for(;b!==null;){var P=b;b=x;for(var V=0;V<a.length;V++)if(P.context===a[V]){b.lanes|=c,P=b.alternate,P!==null&&(P.lanes|=c),Jm(b.return,c,r),f||(k=null);break e}b=P.next}}else if(x.tag===18){if(k=x.return,k===null)throw Error(s(341));k.lanes|=c,b=k.alternate,b!==null&&(b.lanes|=c),Jm(k,c,r),k=null}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===r){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}}function vi(r,a,c,f){r=null;for(var x=a,b=!1;x!==null;){if(!b){if((x.flags&524288)!==0)b=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var k=x.alternate;if(k===null)throw Error(s(387));if(k=k.memoizedProps,k!==null){var P=x.type;lr(x.pendingProps.value,k.value)||(r!==null?r.push(P):r=[P])}}else if(x===te.current){if(k=x.alternate,k===null)throw Error(s(387));k.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(r!==null?r.push(Rc):r=[Rc])}x=x.return}r!==null&&ep(a,r,c,f),a.flags|=262144}function yd(r){for(r=r.firstContext;r!==null;){if(!lr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function mo(r){ho=r,Is=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function _n(r){return m0(ho,r)}function bd(r,a){return ho===null&&mo(r),m0(r,a)}function m0(r,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},Is===null){if(r===null)throw Error(s(308));Is=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else Is=Is.next=a;return c}var lA=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(c,f){r.push(f)}};this.abort=function(){a.aborted=!0,r.forEach(function(c){return c()})}},cA=e.unstable_scheduleCallback,uA=e.unstable_NormalPriority,nn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tp(){return{controller:new lA,data:new Map,refCount:0}}function ac(r){r.refCount--,r.refCount===0&&cA(uA,function(){r.controller.abort()})}var oc=null,np=0,xi=0,yi=null;function dA(r,a){if(oc===null){var c=oc=[];np=0,xi=ag(),yi={status:"pending",value:void 0,then:function(f){c.push(f)}}}return np++,a.then(p0,p0),a}function p0(){if(--np===0&&oc!==null){yi!==null&&(yi.status="fulfilled");var r=oc;oc=null,xi=0,yi=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function fA(r,a){var c=[],f={status:"pending",value:null,reason:null,then:function(x){c.push(x)}};return r.then(function(){f.status="fulfilled",f.value=a;for(var x=0;x<c.length;x++)(0,c[x])(a)},function(x){for(f.status="rejected",f.reason=x,x=0;x<c.length;x++)(0,c[x])(void 0)}),f}var g0=L.S;L.S=function(r,a){Jw=ut(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&dA(r,a),g0!==null&&g0(r,a)};var po=I(null);function rp(){var r=po.current;return r!==null?r:Rt.pooledCache}function wd(r,a){a===null?K(po,po.current):K(po,a.pool)}function v0(){var r=rp();return r===null?null:{parent:nn._currentValue,pool:r}}var bi=Error(s(460)),sp=Error(s(474)),Sd=Error(s(542)),jd={then:function(){}};function x0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function y0(r,a,c){switch(c=r[c],c===void 0?r.push(a):c!==a&&(a.then(Ds,Ds),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,w0(r),r;default:if(typeof a.status=="string")a.then(Ds,Ds);else{if(r=Rt,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=a,r.status="pending",r.then(function(f){if(a.status==="pending"){var x=a;x.status="fulfilled",x.value=f}},function(f){if(a.status==="pending"){var x=a;x.status="rejected",x.reason=f}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,w0(r),r}throw vo=a,bi}}function go(r){try{var a=r._init;return a(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(vo=c,bi):c}}var vo=null;function b0(){if(vo===null)throw Error(s(459));var r=vo;return vo=null,r}function w0(r){if(r===bi||r===Sd)throw Error(s(483))}var wi=null,ic=0;function Cd(r){var a=ic;return ic+=1,wi===null&&(wi=[]),y0(wi,r,a)}function lc(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function Nd(r,a){throw a.$$typeof===y?Error(s(525)):(r=Object.prototype.toString.call(a),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function S0(r){function a(J,Z){if(r){var re=J.deletions;re===null?(J.deletions=[Z],J.flags|=16):re.push(Z)}}function c(J,Z){if(!r)return null;for(;Z!==null;)a(J,Z),Z=Z.sibling;return null}function f(J){for(var Z=new Map;J!==null;)J.key!==null?Z.set(J.key,J):Z.set(J.index,J),J=J.sibling;return Z}function x(J,Z){return J=Ps(J,Z),J.index=0,J.sibling=null,J}function b(J,Z,re){return J.index=re,r?(re=J.alternate,re!==null?(re=re.index,re<Z?(J.flags|=67108866,Z):re):(J.flags|=67108866,Z)):(J.flags|=1048576,Z)}function k(J){return r&&J.alternate===null&&(J.flags|=67108866),J}function P(J,Z,re,de){return Z===null||Z.tag!==6?(Z=Ym(re,J.mode,de),Z.return=J,Z):(Z=x(Z,re),Z.return=J,Z)}function V(J,Z,re,de){var Ie=re.type;return Ie===j?ce(J,Z,re.props.children,de,re.key):Z!==null&&(Z.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===O&&go(Ie)===Z.type)?(Z=x(Z,re.props),lc(Z,re),Z.return=J,Z):(Z=vd(re.type,re.key,re.props,null,J.mode,de),lc(Z,re),Z.return=J,Z)}function se(J,Z,re,de){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=Wm(re,J.mode,de),Z.return=J,Z):(Z=x(Z,re.children||[]),Z.return=J,Z)}function ce(J,Z,re,de,Ie){return Z===null||Z.tag!==7?(Z=uo(re,J.mode,de,Ie),Z.return=J,Z):(Z=x(Z,re),Z.return=J,Z)}function he(J,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Ym(""+Z,J.mode,re),Z.return=J,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return re=vd(Z.type,Z.key,Z.props,null,J.mode,re),lc(re,Z),re.return=J,re;case S:return Z=Wm(Z,J.mode,re),Z.return=J,Z;case O:return Z=go(Z),he(J,Z,re)}if(ae(Z)||q(Z))return Z=uo(Z,J.mode,re,null),Z.return=J,Z;if(typeof Z.then=="function")return he(J,Cd(Z),re);if(Z.$$typeof===E)return he(J,bd(J,Z),re);Nd(J,Z)}return null}function oe(J,Z,re,de){var Ie=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ie!==null?null:P(J,Z,""+re,de);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return re.key===Ie?V(J,Z,re,de):null;case S:return re.key===Ie?se(J,Z,re,de):null;case O:return re=go(re),oe(J,Z,re,de)}if(ae(re)||q(re))return Ie!==null?null:ce(J,Z,re,de,null);if(typeof re.then=="function")return oe(J,Z,Cd(re),de);if(re.$$typeof===E)return oe(J,Z,bd(J,re),de);Nd(J,re)}return null}function ie(J,Z,re,de,Ie){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return J=J.get(re)||null,P(Z,J,""+de,Ie);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case w:return J=J.get(de.key===null?re:de.key)||null,V(Z,J,de,Ie);case S:return J=J.get(de.key===null?re:de.key)||null,se(Z,J,de,Ie);case O:return de=go(de),ie(J,Z,re,de,Ie)}if(ae(de)||q(de))return J=J.get(re)||null,ce(Z,J,de,Ie,null);if(typeof de.then=="function")return ie(J,Z,re,Cd(de),Ie);if(de.$$typeof===E)return ie(J,Z,re,bd(Z,de),Ie);Nd(Z,de)}return null}function Ee(J,Z,re,de){for(var Ie=null,ht=null,Ae=Z,et=Z=0,ct=null;Ae!==null&&et<re.length;et++){Ae.index>et?(ct=Ae,Ae=null):ct=Ae.sibling;var mt=oe(J,Ae,re[et],de);if(mt===null){Ae===null&&(Ae=ct);break}r&&Ae&&mt.alternate===null&&a(J,Ae),Z=b(mt,Z,et),ht===null?Ie=mt:ht.sibling=mt,ht=mt,Ae=ct}if(et===re.length)return c(J,Ae),dt&&Ls(J,et),Ie;if(Ae===null){for(;et<re.length;et++)Ae=he(J,re[et],de),Ae!==null&&(Z=b(Ae,Z,et),ht===null?Ie=Ae:ht.sibling=Ae,ht=Ae);return dt&&Ls(J,et),Ie}for(Ae=f(Ae);et<re.length;et++)ct=ie(Ae,J,et,re[et],de),ct!==null&&(r&&ct.alternate!==null&&Ae.delete(ct.key===null?et:ct.key),Z=b(ct,Z,et),ht===null?Ie=ct:ht.sibling=ct,ht=ct);return r&&Ae.forEach(function(Pa){return a(J,Pa)}),dt&&Ls(J,et),Ie}function qe(J,Z,re,de){if(re==null)throw Error(s(151));for(var Ie=null,ht=null,Ae=Z,et=Z=0,ct=null,mt=re.next();Ae!==null&&!mt.done;et++,mt=re.next()){Ae.index>et?(ct=Ae,Ae=null):ct=Ae.sibling;var Pa=oe(J,Ae,mt.value,de);if(Pa===null){Ae===null&&(Ae=ct);break}r&&Ae&&Pa.alternate===null&&a(J,Ae),Z=b(Pa,Z,et),ht===null?Ie=Pa:ht.sibling=Pa,ht=Pa,Ae=ct}if(mt.done)return c(J,Ae),dt&&Ls(J,et),Ie;if(Ae===null){for(;!mt.done;et++,mt=re.next())mt=he(J,mt.value,de),mt!==null&&(Z=b(mt,Z,et),ht===null?Ie=mt:ht.sibling=mt,ht=mt);return dt&&Ls(J,et),Ie}for(Ae=f(Ae);!mt.done;et++,mt=re.next())mt=ie(Ae,J,et,mt.value,de),mt!==null&&(r&&mt.alternate!==null&&Ae.delete(mt.key===null?et:mt.key),Z=b(mt,Z,et),ht===null?Ie=mt:ht.sibling=mt,ht=mt);return r&&Ae.forEach(function(jO){return a(J,jO)}),dt&&Ls(J,et),Ie}function Tt(J,Z,re,de){if(typeof re=="object"&&re!==null&&re.type===j&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case w:e:{for(var Ie=re.key;Z!==null;){if(Z.key===Ie){if(Ie=re.type,Ie===j){if(Z.tag===7){c(J,Z.sibling),de=x(Z,re.props.children),de.return=J,J=de;break e}}else if(Z.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===O&&go(Ie)===Z.type){c(J,Z.sibling),de=x(Z,re.props),lc(de,re),de.return=J,J=de;break e}c(J,Z);break}else a(J,Z);Z=Z.sibling}re.type===j?(de=uo(re.props.children,J.mode,de,re.key),de.return=J,J=de):(de=vd(re.type,re.key,re.props,null,J.mode,de),lc(de,re),de.return=J,J=de)}return k(J);case S:e:{for(Ie=re.key;Z!==null;){if(Z.key===Ie)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){c(J,Z.sibling),de=x(Z,re.children||[]),de.return=J,J=de;break e}else{c(J,Z);break}else a(J,Z);Z=Z.sibling}de=Wm(re,J.mode,de),de.return=J,J=de}return k(J);case O:return re=go(re),Tt(J,Z,re,de)}if(ae(re))return Ee(J,Z,re,de);if(q(re)){if(Ie=q(re),typeof Ie!="function")throw Error(s(150));return re=Ie.call(re),qe(J,Z,re,de)}if(typeof re.then=="function")return Tt(J,Z,Cd(re),de);if(re.$$typeof===E)return Tt(J,Z,bd(J,re),de);Nd(J,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Z!==null&&Z.tag===6?(c(J,Z.sibling),de=x(Z,re),de.return=J,J=de):(c(J,Z),de=Ym(re,J.mode,de),de.return=J,J=de),k(J)):c(J,Z)}return function(J,Z,re,de){try{ic=0;var Ie=Tt(J,Z,re,de);return wi=null,Ie}catch(Ae){if(Ae===bi||Ae===Sd)throw Ae;var ht=cr(29,Ae,null,J.mode);return ht.lanes=de,ht.return=J,ht}}}var xo=S0(!0),j0=S0(!1),ya=!1;function ap(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function op(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ba(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function wa(r,a,c){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(xt&2)!==0){var x=f.pending;return x===null?a.next=a:(a.next=x.next,x.next=a),f.pending=a,a=gd(r),o0(r,null,c),a}return pd(r,f,a,c),gd(r)}function cc(r,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var f=a.lanes;f&=r.pendingLanes,c|=f,a.lanes=c,wn(r,c)}}function ip(r,a){var c=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var x=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var k={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?x=b=k:b=b.next=k,c=c.next}while(c!==null);b===null?x=b=a:b=b.next=a}else x=b=a;c={baseState:f.baseState,firstBaseUpdate:x,lastBaseUpdate:b,shared:f.shared,callbacks:f.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=a:r.next=a,c.lastBaseUpdate=a}var lp=!1;function uc(){if(lp){var r=yi;if(r!==null)throw r}}function dc(r,a,c,f){lp=!1;var x=r.updateQueue;ya=!1;var b=x.firstBaseUpdate,k=x.lastBaseUpdate,P=x.shared.pending;if(P!==null){x.shared.pending=null;var V=P,se=V.next;V.next=null,k===null?b=se:k.next=se,k=V;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,P=ce.lastBaseUpdate,P!==k&&(P===null?ce.firstBaseUpdate=se:P.next=se,ce.lastBaseUpdate=V))}if(b!==null){var he=x.baseState;k=0,ce=se=V=null,P=b;do{var oe=P.lane&-536870913,ie=oe!==P.lane;if(ie?(lt&oe)===oe:(f&oe)===oe){oe!==0&&oe===xi&&(lp=!0),ce!==null&&(ce=ce.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ee=r,qe=P;oe=a;var Tt=c;switch(qe.tag){case 1:if(Ee=qe.payload,typeof Ee=="function"){he=Ee.call(Tt,he,oe);break e}he=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=qe.payload,oe=typeof Ee=="function"?Ee.call(Tt,he,oe):Ee,oe==null)break e;he=g({},he,oe);break e;case 2:ya=!0}}oe=P.callback,oe!==null&&(r.flags|=64,ie&&(r.flags|=8192),ie=x.callbacks,ie===null?x.callbacks=[oe]:ie.push(oe))}else ie={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ce===null?(se=ce=ie,V=he):ce=ce.next=ie,k|=oe;if(P=P.next,P===null){if(P=x.shared.pending,P===null)break;ie=P,P=ie.next,ie.next=null,x.lastBaseUpdate=ie,x.shared.pending=null}}while(!0);ce===null&&(V=he),x.baseState=V,x.firstBaseUpdate=se,x.lastBaseUpdate=ce,b===null&&(x.shared.lanes=0),ka|=k,r.lanes=k,r.memoizedState=he}}function C0(r,a){if(typeof r!="function")throw Error(s(191,r));r.call(a)}function N0(r,a){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)C0(c[r],a)}var Si=I(null),kd=I(0);function k0(r,a){r=Gs,K(kd,r),K(Si,a),Gs=r|a.baseLanes}function cp(){K(kd,Gs),K(Si,Si.current)}function up(){Gs=kd.current,F(Si),F(kd)}var ur=I(null),Or=null;function Sa(r){var a=r.alternate;K(Qt,Qt.current&1),K(ur,r),Or===null&&(a===null||Si.current!==null||a.memoizedState!==null)&&(Or=r)}function dp(r){K(Qt,Qt.current),K(ur,r),Or===null&&(Or=r)}function _0(r){r.tag===22?(K(Qt,Qt.current),K(ur,r),Or===null&&(Or=r)):ja()}function ja(){K(Qt,Qt.current),K(ur,ur.current)}function dr(r){F(ur),Or===r&&(Or=null),F(Qt)}var Qt=I(0);function _d(r){for(var a=r;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||vg(c)||xg(c)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Fs=0,Qe=null,_t=null,rn=null,Ed=!1,ji=!1,yo=!1,Td=0,fc=0,Ci=null,hA=0;function qt(){throw Error(s(321))}function fp(r,a){if(a===null)return!1;for(var c=0;c<a.length&&c<r.length;c++)if(!lr(r[c],a[c]))return!1;return!0}function hp(r,a,c,f,x,b){return Fs=b,Qe=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,L.H=r===null||r.memoizedState===null?uw:Ep,yo=!1,b=c(f,x),yo=!1,ji&&(b=T0(a,c,f,x)),E0(r),b}function E0(r){L.H=pc;var a=_t!==null&&_t.next!==null;if(Fs=0,rn=_t=Qe=null,Ed=!1,fc=0,Ci=null,a)throw Error(s(300));r===null||sn||(r=r.dependencies,r!==null&&yd(r)&&(sn=!0))}function T0(r,a,c,f){Qe=r;var x=0;do{if(ji&&(Ci=null),fc=0,ji=!1,25<=x)throw Error(s(301));if(x+=1,rn=_t=null,r.updateQueue!=null){var b=r.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}L.H=dw,b=a(c,f)}while(ji);return b}function mA(){var r=L.H,a=r.useState()[0];return a=typeof a.then=="function"?hc(a):a,r=r.useState()[0],(_t!==null?_t.memoizedState:null)!==r&&(Qe.flags|=1024),a}function mp(){var r=Td!==0;return Td=0,r}function pp(r,a,c){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~c}function gp(r){if(Ed){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Ed=!1}Fs=0,rn=_t=Qe=null,ji=!1,fc=Td=0,Ci=null}function Ln(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Qe.memoizedState=rn=r:rn=rn.next=r,rn}function Kt(){if(_t===null){var r=Qe.alternate;r=r!==null?r.memoizedState:null}else r=_t.next;var a=rn===null?Qe.memoizedState:rn.next;if(a!==null)rn=a,_t=r;else{if(r===null)throw Qe.alternate===null?Error(s(467)):Error(s(310));_t=r,r={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},rn===null?Qe.memoizedState=rn=r:rn=rn.next=r}return rn}function Md(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hc(r){var a=fc;return fc+=1,Ci===null&&(Ci=[]),r=y0(Ci,r,a),a=Qe,(rn===null?a.memoizedState:rn.next)===null&&(a=a.alternate,L.H=a===null||a.memoizedState===null?uw:Ep),r}function Rd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return hc(r);if(r.$$typeof===E)return _n(r)}throw Error(s(438,String(r)))}function vp(r){var a=null,c=Qe.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var f=Qe.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(a={data:f.data.map(function(x){return x.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=Md(),Qe.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(r),f=0;f<r;f++)c[f]=z;return a.index++,c}function Bs(r,a){return typeof a=="function"?a(r):a}function Ad(r){var a=Kt();return xp(a,_t,r)}function xp(r,a,c){var f=r.queue;if(f===null)throw Error(s(311));f.lastRenderedReducer=c;var x=r.baseQueue,b=f.pending;if(b!==null){if(x!==null){var k=x.next;x.next=b.next,b.next=k}a.baseQueue=x=b,f.pending=null}if(b=r.baseState,x===null)r.memoizedState=b;else{a=x.next;var P=k=null,V=null,se=a,ce=!1;do{var he=se.lane&-536870913;if(he!==se.lane?(lt&he)===he:(Fs&he)===he){var oe=se.revertLane;if(oe===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),he===xi&&(ce=!0);else if((Fs&oe)===oe){se=se.next,oe===xi&&(ce=!0);continue}else he={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},V===null?(P=V=he,k=b):V=V.next=he,Qe.lanes|=oe,ka|=oe;he=se.action,yo&&c(b,he),b=se.hasEagerState?se.eagerState:c(b,he)}else oe={lane:he,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},V===null?(P=V=oe,k=b):V=V.next=oe,Qe.lanes|=he,ka|=he;se=se.next}while(se!==null&&se!==a);if(V===null?k=b:V.next=P,!lr(b,r.memoizedState)&&(sn=!0,ce&&(c=yi,c!==null)))throw c;r.memoizedState=b,r.baseState=k,r.baseQueue=V,f.lastRenderedState=b}return x===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function yp(r){var a=Kt(),c=a.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var f=c.dispatch,x=c.pending,b=a.memoizedState;if(x!==null){c.pending=null;var k=x=x.next;do b=r(b,k.action),k=k.next;while(k!==x);lr(b,a.memoizedState)||(sn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),c.lastRenderedState=b}return[b,f]}function M0(r,a,c){var f=Qe,x=Kt(),b=dt;if(b){if(c===void 0)throw Error(s(407));c=c()}else c=a();var k=!lr((_t||x).memoizedState,c);if(k&&(x.memoizedState=c,sn=!0),x=x.queue,Sp(O0.bind(null,f,x,r),[r]),x.getSnapshot!==a||k||rn!==null&&rn.memoizedState.tag&1){if(f.flags|=2048,Ni(9,{destroy:void 0},A0.bind(null,f,x,c,a),null),Rt===null)throw Error(s(349));b||(Fs&127)!==0||R0(f,a,c)}return c}function R0(r,a,c){r.flags|=16384,r={getSnapshot:a,value:c},a=Qe.updateQueue,a===null?(a=Md(),Qe.updateQueue=a,a.stores=[r]):(c=a.stores,c===null?a.stores=[r]:c.push(r))}function A0(r,a,c,f){a.value=c,a.getSnapshot=f,D0(a)&&z0(r)}function O0(r,a,c){return c(function(){D0(a)&&z0(r)})}function D0(r){var a=r.getSnapshot;r=r.value;try{var c=a();return!lr(r,c)}catch{return!0}}function z0(r){var a=co(r,2);a!==null&&Jn(a,r,2)}function bp(r){var a=Ln();if(typeof r=="function"){var c=r;if(r=c(),yo){en(!0);try{c()}finally{en(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:r},a}function P0(r,a,c,f){return r.baseState=c,xp(r,_t,typeof f=="function"?f:Bs)}function pA(r,a,c,f,x){if(zd(r))throw Error(s(485));if(r=a.action,r!==null){var b={payload:x,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){b.listeners.push(k)}};L.T!==null?c(!0):b.isTransition=!1,f(b),c=a.pending,c===null?(b.next=a.pending=b,L0(a,b)):(b.next=c.next,a.pending=c.next=b)}}function L0(r,a){var c=a.action,f=a.payload,x=r.state;if(a.isTransition){var b=L.T,k={};L.T=k;try{var P=c(x,f),V=L.S;V!==null&&V(k,P),I0(r,a,P)}catch(se){wp(r,a,se)}finally{b!==null&&k.types!==null&&(b.types=k.types),L.T=b}}else try{b=c(x,f),I0(r,a,b)}catch(se){wp(r,a,se)}}function I0(r,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){$0(r,a,f)},function(f){return wp(r,a,f)}):$0(r,a,c)}function $0(r,a,c){a.status="fulfilled",a.value=c,F0(a),r.state=c,a=r.pending,a!==null&&(c=a.next,c===a?r.pending=null:(c=c.next,a.next=c,L0(r,c)))}function wp(r,a,c){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do a.status="rejected",a.reason=c,F0(a),a=a.next;while(a!==f)}r.action=null}function F0(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function B0(r,a){return a}function U0(r,a){if(dt){var c=Rt.formState;if(c!==null){e:{var f=Qe;if(dt){if(Dt){t:{for(var x=Dt,b=Ar;x.nodeType!==8;){if(!b){x=null;break t}if(x=Dr(x.nextSibling),x===null){x=null;break t}}b=x.data,x=b==="F!"||b==="F"?x:null}if(x){Dt=Dr(x.nextSibling),f=x.data==="F!";break e}}va(f)}f=!1}f&&(a=c[0])}}return c=Ln(),c.memoizedState=c.baseState=a,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:B0,lastRenderedState:a},c.queue=f,c=iw.bind(null,Qe,f),f.dispatch=c,f=bp(!1),b=_p.bind(null,Qe,!1,f.queue),f=Ln(),x={state:a,dispatch:null,action:r,pending:null},f.queue=x,c=pA.bind(null,Qe,x,b,c),x.dispatch=c,f.memoizedState=r,[a,c,!1]}function V0(r){var a=Kt();return q0(a,_t,r)}function q0(r,a,c){if(a=xp(r,a,B0)[0],r=Ad(Bs)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var f=hc(a)}catch(k){throw k===bi?Sd:k}else f=a;a=Kt();var x=a.queue,b=x.dispatch;return c!==a.memoizedState&&(Qe.flags|=2048,Ni(9,{destroy:void 0},gA.bind(null,x,c),null)),[f,b,r]}function gA(r,a){r.action=a}function H0(r){var a=Kt(),c=_t;if(c!==null)return q0(a,c,r);Kt(),a=a.memoizedState,c=Kt();var f=c.queue.dispatch;return c.memoizedState=r,[a,f,!1]}function Ni(r,a,c,f){return r={tag:r,create:c,deps:f,inst:a,next:null},a=Qe.updateQueue,a===null&&(a=Md(),Qe.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=r.next=r:(f=c.next,c.next=r,r.next=f,a.lastEffect=r),r}function Y0(){return Kt().memoizedState}function Od(r,a,c,f){var x=Ln();Qe.flags|=r,x.memoizedState=Ni(1|a,{destroy:void 0},c,f===void 0?null:f)}function Dd(r,a,c,f){var x=Kt();f=f===void 0?null:f;var b=x.memoizedState.inst;_t!==null&&f!==null&&fp(f,_t.memoizedState.deps)?x.memoizedState=Ni(a,b,c,f):(Qe.flags|=r,x.memoizedState=Ni(1|a,b,c,f))}function W0(r,a){Od(8390656,8,r,a)}function Sp(r,a){Dd(2048,8,r,a)}function vA(r){Qe.flags|=4;var a=Qe.updateQueue;if(a===null)a=Md(),Qe.updateQueue=a,a.events=[r];else{var c=a.events;c===null?a.events=[r]:c.push(r)}}function G0(r){var a=Kt().memoizedState;return vA({ref:a,nextImpl:r}),function(){if((xt&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}function Z0(r,a){return Dd(4,2,r,a)}function Q0(r,a){return Dd(4,4,r,a)}function K0(r,a){if(typeof a=="function"){r=r();var c=a(r);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function X0(r,a,c){c=c!=null?c.concat([r]):null,Dd(4,4,K0.bind(null,a,r),c)}function jp(){}function J0(r,a){var c=Kt();a=a===void 0?null:a;var f=c.memoizedState;return a!==null&&fp(a,f[1])?f[0]:(c.memoizedState=[r,a],r)}function ew(r,a){var c=Kt();a=a===void 0?null:a;var f=c.memoizedState;if(a!==null&&fp(a,f[1]))return f[0];if(f=r(),yo){en(!0);try{r()}finally{en(!1)}}return c.memoizedState=[f,a],f}function Cp(r,a,c){return c===void 0||(Fs&1073741824)!==0&&(lt&261930)===0?r.memoizedState=a:(r.memoizedState=c,r=tS(),Qe.lanes|=r,ka|=r,c)}function tw(r,a,c,f){return lr(c,a)?c:Si.current!==null?(r=Cp(r,c,f),lr(r,a)||(sn=!0),r):(Fs&42)===0||(Fs&1073741824)!==0&&(lt&261930)===0?(sn=!0,r.memoizedState=c):(r=tS(),Qe.lanes|=r,ka|=r,a)}function nw(r,a,c,f,x){var b=$.p;$.p=b!==0&&8>b?b:8;var k=L.T,P={};L.T=P,_p(r,!1,a,c);try{var V=x(),se=L.S;if(se!==null&&se(P,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ce=fA(V,f);mc(r,a,ce,mr(r))}else mc(r,a,f,mr(r))}catch(he){mc(r,a,{then:function(){},status:"rejected",reason:he},mr())}finally{$.p=b,k!==null&&P.types!==null&&(k.types=P.types),L.T=k}}function xA(){}function Np(r,a,c,f){if(r.tag!==5)throw Error(s(476));var x=rw(r).queue;nw(r,x,a,U,c===null?xA:function(){return sw(r),c(f)})}function rw(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:U},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:c},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function sw(r){var a=rw(r);a.next===null&&(a=r.alternate.memoizedState),mc(r,a.next.queue,{},mr())}function kp(){return _n(Rc)}function aw(){return Kt().memoizedState}function ow(){return Kt().memoizedState}function yA(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var c=mr();r=ba(c);var f=wa(a,r,c);f!==null&&(Jn(f,a,c),cc(f,a,c)),a={cache:tp()},r.payload=a;return}a=a.return}}function bA(r,a,c){var f=mr();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},zd(r)?lw(a,c):(c=qm(r,a,c,f),c!==null&&(Jn(c,r,f),cw(c,a,f)))}function iw(r,a,c){var f=mr();mc(r,a,c,f)}function mc(r,a,c,f){var x={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(zd(r))lw(a,x);else{var b=r.alternate;if(r.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var k=a.lastRenderedState,P=b(k,c);if(x.hasEagerState=!0,x.eagerState=P,lr(P,k))return pd(r,a,x,0),Rt===null&&md(),!1}catch{}if(c=qm(r,a,x,f),c!==null)return Jn(c,r,f),cw(c,a,f),!0}return!1}function _p(r,a,c,f){if(f={lane:2,revertLane:ag(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},zd(r)){if(a)throw Error(s(479))}else a=qm(r,c,f,2),a!==null&&Jn(a,r,2)}function zd(r){var a=r.alternate;return r===Qe||a!==null&&a===Qe}function lw(r,a){ji=Ed=!0;var c=r.pending;c===null?a.next=a:(a.next=c.next,c.next=a),r.pending=a}function cw(r,a,c){if((c&4194048)!==0){var f=a.lanes;f&=r.pendingLanes,c|=f,a.lanes=c,wn(r,c)}}var pc={readContext:_n,use:Rd,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt};pc.useEffectEvent=qt;var uw={readContext:_n,use:Rd,useCallback:function(r,a){return Ln().memoizedState=[r,a===void 0?null:a],r},useContext:_n,useEffect:W0,useImperativeHandle:function(r,a,c){c=c!=null?c.concat([r]):null,Od(4194308,4,K0.bind(null,a,r),c)},useLayoutEffect:function(r,a){return Od(4194308,4,r,a)},useInsertionEffect:function(r,a){Od(4,2,r,a)},useMemo:function(r,a){var c=Ln();a=a===void 0?null:a;var f=r();if(yo){en(!0);try{r()}finally{en(!1)}}return c.memoizedState=[f,a],f},useReducer:function(r,a,c){var f=Ln();if(c!==void 0){var x=c(a);if(yo){en(!0);try{c(a)}finally{en(!1)}}}else x=a;return f.memoizedState=f.baseState=x,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:x},f.queue=r,r=r.dispatch=bA.bind(null,Qe,r),[f.memoizedState,r]},useRef:function(r){var a=Ln();return r={current:r},a.memoizedState=r},useState:function(r){r=bp(r);var a=r.queue,c=iw.bind(null,Qe,a);return a.dispatch=c,[r.memoizedState,c]},useDebugValue:jp,useDeferredValue:function(r,a){var c=Ln();return Cp(c,r,a)},useTransition:function(){var r=bp(!1);return r=nw.bind(null,Qe,r.queue,!0,!1),Ln().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,c){var f=Qe,x=Ln();if(dt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=a(),Rt===null)throw Error(s(349));(lt&127)!==0||R0(f,a,c)}x.memoizedState=c;var b={value:c,getSnapshot:a};return x.queue=b,W0(O0.bind(null,f,b,r),[r]),f.flags|=2048,Ni(9,{destroy:void 0},A0.bind(null,f,b,c,a),null),c},useId:function(){var r=Ln(),a=Rt.identifierPrefix;if(dt){var c=hs,f=fs;c=(f&~(1<<32-$t(f)-1)).toString(32)+c,a="_"+a+"R_"+c,c=Td++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=hA++,a="_"+a+"r_"+c.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:kp,useFormState:U0,useActionState:U0,useOptimistic:function(r){var a=Ln();a.memoizedState=a.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=_p.bind(null,Qe,!0,c),c.dispatch=a,[r,a]},useMemoCache:vp,useCacheRefresh:function(){return Ln().memoizedState=yA.bind(null,Qe)},useEffectEvent:function(r){var a=Ln(),c={impl:r};return a.memoizedState=c,function(){if((xt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Ep={readContext:_n,use:Rd,useCallback:J0,useContext:_n,useEffect:Sp,useImperativeHandle:X0,useInsertionEffect:Z0,useLayoutEffect:Q0,useMemo:ew,useReducer:Ad,useRef:Y0,useState:function(){return Ad(Bs)},useDebugValue:jp,useDeferredValue:function(r,a){var c=Kt();return tw(c,_t.memoizedState,r,a)},useTransition:function(){var r=Ad(Bs)[0],a=Kt().memoizedState;return[typeof r=="boolean"?r:hc(r),a]},useSyncExternalStore:M0,useId:aw,useHostTransitionStatus:kp,useFormState:V0,useActionState:V0,useOptimistic:function(r,a){var c=Kt();return P0(c,_t,r,a)},useMemoCache:vp,useCacheRefresh:ow};Ep.useEffectEvent=G0;var dw={readContext:_n,use:Rd,useCallback:J0,useContext:_n,useEffect:Sp,useImperativeHandle:X0,useInsertionEffect:Z0,useLayoutEffect:Q0,useMemo:ew,useReducer:yp,useRef:Y0,useState:function(){return yp(Bs)},useDebugValue:jp,useDeferredValue:function(r,a){var c=Kt();return _t===null?Cp(c,r,a):tw(c,_t.memoizedState,r,a)},useTransition:function(){var r=yp(Bs)[0],a=Kt().memoizedState;return[typeof r=="boolean"?r:hc(r),a]},useSyncExternalStore:M0,useId:aw,useHostTransitionStatus:kp,useFormState:H0,useActionState:H0,useOptimistic:function(r,a){var c=Kt();return _t!==null?P0(c,_t,r,a):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:vp,useCacheRefresh:ow};dw.useEffectEvent=G0;function Tp(r,a,c,f){a=r.memoizedState,c=c(f,a),c=c==null?a:g({},a,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Mp={enqueueSetState:function(r,a,c){r=r._reactInternals;var f=mr(),x=ba(f);x.payload=a,c!=null&&(x.callback=c),a=wa(r,x,f),a!==null&&(Jn(a,r,f),cc(a,r,f))},enqueueReplaceState:function(r,a,c){r=r._reactInternals;var f=mr(),x=ba(f);x.tag=1,x.payload=a,c!=null&&(x.callback=c),a=wa(r,x,f),a!==null&&(Jn(a,r,f),cc(a,r,f))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var c=mr(),f=ba(c);f.tag=2,a!=null&&(f.callback=a),a=wa(r,f,c),a!==null&&(Jn(a,r,c),cc(a,r,c))}};function fw(r,a,c,f,x,b,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,b,k):a.prototype&&a.prototype.isPureReactComponent?!tc(c,f)||!tc(x,b):!0}function hw(r,a,c,f){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,f),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,f),a.state!==r&&Mp.enqueueReplaceState(a,a.state,null)}function bo(r,a){var c=a;if("ref"in a){c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}if(r=r.defaultProps){c===a&&(c=g({},c));for(var x in r)c[x]===void 0&&(c[x]=r[x])}return c}function mw(r){hd(r)}function pw(r){console.error(r)}function gw(r){hd(r)}function Pd(r,a){try{var c=r.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(f){setTimeout(function(){throw f})}}function vw(r,a,c){try{var f=r.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Rp(r,a,c){return c=ba(c),c.tag=3,c.payload={element:null},c.callback=function(){Pd(r,a)},c}function xw(r){return r=ba(r),r.tag=3,r}function yw(r,a,c,f){var x=c.type.getDerivedStateFromError;if(typeof x=="function"){var b=f.value;r.payload=function(){return x(b)},r.callback=function(){vw(a,c,f)}}var k=c.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){vw(a,c,f),typeof x!="function"&&(_a===null?_a=new Set([this]):_a.add(this));var P=f.stack;this.componentDidCatch(f.value,{componentStack:P!==null?P:""})})}function wA(r,a,c,f,x){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(a=c.alternate,a!==null&&vi(a,c,x,!0),c=ur.current,c!==null){switch(c.tag){case 31:case 13:return Or===null?Gd():c.alternate===null&&Ht===0&&(Ht=3),c.flags&=-257,c.flags|=65536,c.lanes=x,f===jd?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([f]):a.add(f),ng(r,f,x)),!1;case 22:return c.flags|=65536,f===jd?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([f]):c.add(f)),ng(r,f,x)),!1}throw Error(s(435,c.tag))}return ng(r,f,x),Gd(),!1}if(dt)return a=ur.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=x,f!==Qm&&(r=Error(s(422),{cause:f}),sc(Tr(r,c)))):(f!==Qm&&(a=Error(s(423),{cause:f}),sc(Tr(a,c))),r=r.current.alternate,r.flags|=65536,x&=-x,r.lanes|=x,f=Tr(f,c),x=Rp(r.stateNode,f,x),ip(r,x),Ht!==4&&(Ht=2)),!1;var b=Error(s(520),{cause:f});if(b=Tr(b,c),jc===null?jc=[b]:jc.push(b),Ht!==4&&(Ht=2),a===null)return!0;f=Tr(f,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,r=x&-x,c.lanes|=r,r=Rp(c.stateNode,f,r),ip(c,r),!1;case 1:if(a=c.type,b=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(_a===null||!_a.has(b))))return c.flags|=65536,x&=-x,c.lanes|=x,x=xw(x),yw(x,r,c,f),ip(c,x),!1}c=c.return}while(c!==null);return!1}var Ap=Error(s(461)),sn=!1;function En(r,a,c,f){a.child=r===null?j0(a,null,c,f):xo(a,r.child,c,f)}function bw(r,a,c,f,x){c=c.render;var b=a.ref;if("ref"in f){var k={};for(var P in f)P!=="ref"&&(k[P]=f[P])}else k=f;return mo(a),f=hp(r,a,c,k,b,x),P=mp(),r!==null&&!sn?(pp(r,a,x),Us(r,a,x)):(dt&&P&&Gm(a),a.flags|=1,En(r,a,f,x),a.child)}function ww(r,a,c,f,x){if(r===null){var b=c.type;return typeof b=="function"&&!Hm(b)&&b.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=b,Sw(r,a,b,f,x)):(r=vd(c.type,null,f,a,a.mode,x),r.ref=a.ref,r.return=a,a.child=r)}if(b=r.child,!Fp(r,x)){var k=b.memoizedProps;if(c=c.compare,c=c!==null?c:tc,c(k,f)&&r.ref===a.ref)return Us(r,a,x)}return a.flags|=1,r=Ps(b,f),r.ref=a.ref,r.return=a,a.child=r}function Sw(r,a,c,f,x){if(r!==null){var b=r.memoizedProps;if(tc(b,f)&&r.ref===a.ref)if(sn=!1,a.pendingProps=f=b,Fp(r,x))(r.flags&131072)!==0&&(sn=!0);else return a.lanes=r.lanes,Us(r,a,x)}return Op(r,a,c,f,x)}function jw(r,a,c,f){var x=f.children,b=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((a.flags&128)!==0){if(b=b!==null?b.baseLanes|c:c,r!==null){for(f=a.child=r.child,x=0;f!==null;)x=x|f.lanes|f.childLanes,f=f.sibling;f=x&~b}else f=0,a.child=null;return Cw(r,a,b,c,f)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&wd(a,b!==null?b.cachePool:null),b!==null?k0(a,b):cp(),_0(a);else return f=a.lanes=536870912,Cw(r,a,b!==null?b.baseLanes|c:c,c,f)}else b!==null?(wd(a,b.cachePool),k0(a,b),ja(),a.memoizedState=null):(r!==null&&wd(a,null),cp(),ja());return En(r,a,x,c),a.child}function gc(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Cw(r,a,c,f,x){var b=rp();return b=b===null?null:{parent:nn._currentValue,pool:b},a.memoizedState={baseLanes:c,cachePool:b},r!==null&&wd(a,null),cp(),_0(a),r!==null&&vi(r,a,f,!0),a.childLanes=x,null}function Ld(r,a){return a=$d({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function Nw(r,a,c){return xo(a,r.child,null,c),r=Ld(a,a.pendingProps),r.flags|=2,dr(a),a.memoizedState=null,r}function SA(r,a,c){var f=a.pendingProps,x=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(dt){if(f.mode==="hidden")return r=Ld(a,f),a.lanes=536870912,gc(null,r);if(dp(a),(r=Dt)?(r=LS(r,Ar),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:pa!==null?{id:fs,overflow:hs}:null,retryLane:536870912,hydrationErrors:null},c=l0(r),c.return=a,a.child=c,kn=a,Dt=null)):r=null,r===null)throw va(a);return a.lanes=536870912,null}return Ld(a,f)}var b=r.memoizedState;if(b!==null){var k=b.dehydrated;if(dp(a),x)if(a.flags&256)a.flags&=-257,a=Nw(r,a,c);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(s(558));else if(sn||vi(r,a,c,!1),x=(c&r.childLanes)!==0,sn||x){if(f=Rt,f!==null&&(k=Q(f,c),k!==0&&k!==b.retryLane))throw b.retryLane=k,co(r,k),Jn(f,r,k),Ap;Gd(),a=Nw(r,a,c)}else r=b.treeContext,Dt=Dr(k.nextSibling),kn=a,dt=!0,ga=null,Ar=!1,r!==null&&d0(a,r),a=Ld(a,f),a.flags|=4096;return a}return r=Ps(r.child,{mode:f.mode,children:f.children}),r.ref=a.ref,a.child=r,r.return=a,r}function Id(r,a){var c=a.ref;if(c===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(a.flags|=4194816)}}function Op(r,a,c,f,x){return mo(a),c=hp(r,a,c,f,void 0,x),f=mp(),r!==null&&!sn?(pp(r,a,x),Us(r,a,x)):(dt&&f&&Gm(a),a.flags|=1,En(r,a,c,x),a.child)}function kw(r,a,c,f,x,b){return mo(a),a.updateQueue=null,c=T0(a,f,c,x),E0(r),f=mp(),r!==null&&!sn?(pp(r,a,b),Us(r,a,b)):(dt&&f&&Gm(a),a.flags|=1,En(r,a,c,b),a.child)}function _w(r,a,c,f,x){if(mo(a),a.stateNode===null){var b=hi,k=c.contextType;typeof k=="object"&&k!==null&&(b=_n(k)),b=new c(f,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Mp,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=f,b.state=a.memoizedState,b.refs={},ap(a),k=c.contextType,b.context=typeof k=="object"&&k!==null?_n(k):hi,b.state=a.memoizedState,k=c.getDerivedStateFromProps,typeof k=="function"&&(Tp(a,c,k,f),b.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(k=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),k!==b.state&&Mp.enqueueReplaceState(b,b.state,null),dc(a,f,b,x),uc(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),f=!0}else if(r===null){b=a.stateNode;var P=a.memoizedProps,V=bo(c,P);b.props=V;var se=b.context,ce=c.contextType;k=hi,typeof ce=="object"&&ce!==null&&(k=_n(ce));var he=c.getDerivedStateFromProps;ce=typeof he=="function"||typeof b.getSnapshotBeforeUpdate=="function",P=a.pendingProps!==P,ce||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(P||se!==k)&&hw(a,b,f,k),ya=!1;var oe=a.memoizedState;b.state=oe,dc(a,f,b,x),uc(),se=a.memoizedState,P||oe!==se||ya?(typeof he=="function"&&(Tp(a,c,he,f),se=a.memoizedState),(V=ya||fw(a,c,V,f,oe,se,k))?(ce||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=f,a.memoizedState=se),b.props=f,b.state=se,b.context=k,f=V):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),f=!1)}else{b=a.stateNode,op(r,a),k=a.memoizedProps,ce=bo(c,k),b.props=ce,he=a.pendingProps,oe=b.context,se=c.contextType,V=hi,typeof se=="object"&&se!==null&&(V=_n(se)),P=c.getDerivedStateFromProps,(se=typeof P=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(k!==he||oe!==V)&&hw(a,b,f,V),ya=!1,oe=a.memoizedState,b.state=oe,dc(a,f,b,x),uc();var ie=a.memoizedState;k!==he||oe!==ie||ya||r!==null&&r.dependencies!==null&&yd(r.dependencies)?(typeof P=="function"&&(Tp(a,c,P,f),ie=a.memoizedState),(ce=ya||fw(a,c,ce,f,oe,ie,V)||r!==null&&r.dependencies!==null&&yd(r.dependencies))?(se||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(f,ie,V),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(f,ie,V)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||k===r.memoizedProps&&oe===r.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&oe===r.memoizedState||(a.flags|=1024),a.memoizedProps=f,a.memoizedState=ie),b.props=f,b.state=ie,b.context=V,f=ce):(typeof b.componentDidUpdate!="function"||k===r.memoizedProps&&oe===r.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&oe===r.memoizedState||(a.flags|=1024),f=!1)}return b=f,Id(r,a),f=(a.flags&128)!==0,b||f?(b=a.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,r!==null&&f?(a.child=xo(a,r.child,null,x),a.child=xo(a,null,c,x)):En(r,a,c,x),a.memoizedState=b.state,r=a.child):r=Us(r,a,x),r}function Ew(r,a,c,f){return fo(),a.flags|=256,En(r,a,c,f),a.child}var Dp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zp(r){return{baseLanes:r,cachePool:v0()}}function Pp(r,a,c){return r=r!==null?r.childLanes&~c:0,a&&(r|=hr),r}function Tw(r,a,c){var f=a.pendingProps,x=!1,b=(a.flags&128)!==0,k;if((k=b)||(k=r!==null&&r.memoizedState===null?!1:(Qt.current&2)!==0),k&&(x=!0,a.flags&=-129),k=(a.flags&32)!==0,a.flags&=-33,r===null){if(dt){if(x?Sa(a):ja(),(r=Dt)?(r=LS(r,Ar),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:pa!==null?{id:fs,overflow:hs}:null,retryLane:536870912,hydrationErrors:null},c=l0(r),c.return=a,a.child=c,kn=a,Dt=null)):r=null,r===null)throw va(a);return xg(r)?a.lanes=32:a.lanes=536870912,null}var P=f.children;return f=f.fallback,x?(ja(),x=a.mode,P=$d({mode:"hidden",children:P},x),f=uo(f,x,c,null),P.return=a,f.return=a,P.sibling=f,a.child=P,f=a.child,f.memoizedState=zp(c),f.childLanes=Pp(r,k,c),a.memoizedState=Dp,gc(null,f)):(Sa(a),Lp(a,P))}var V=r.memoizedState;if(V!==null&&(P=V.dehydrated,P!==null)){if(b)a.flags&256?(Sa(a),a.flags&=-257,a=Ip(r,a,c)):a.memoizedState!==null?(ja(),a.child=r.child,a.flags|=128,a=null):(ja(),P=f.fallback,x=a.mode,f=$d({mode:"visible",children:f.children},x),P=uo(P,x,c,null),P.flags|=2,f.return=a,P.return=a,f.sibling=P,a.child=f,xo(a,r.child,null,c),f=a.child,f.memoizedState=zp(c),f.childLanes=Pp(r,k,c),a.memoizedState=Dp,a=gc(null,f));else if(Sa(a),xg(P)){if(k=P.nextSibling&&P.nextSibling.dataset,k)var se=k.dgst;k=se,f=Error(s(419)),f.stack="",f.digest=k,sc({value:f,source:null,stack:null}),a=Ip(r,a,c)}else if(sn||vi(r,a,c,!1),k=(c&r.childLanes)!==0,sn||k){if(k=Rt,k!==null&&(f=Q(k,c),f!==0&&f!==V.retryLane))throw V.retryLane=f,co(r,f),Jn(k,r,f),Ap;vg(P)||Gd(),a=Ip(r,a,c)}else vg(P)?(a.flags|=192,a.child=r.child,a=null):(r=V.treeContext,Dt=Dr(P.nextSibling),kn=a,dt=!0,ga=null,Ar=!1,r!==null&&d0(a,r),a=Lp(a,f.children),a.flags|=4096);return a}return x?(ja(),P=f.fallback,x=a.mode,V=r.child,se=V.sibling,f=Ps(V,{mode:"hidden",children:f.children}),f.subtreeFlags=V.subtreeFlags&65011712,se!==null?P=Ps(se,P):(P=uo(P,x,c,null),P.flags|=2),P.return=a,f.return=a,f.sibling=P,a.child=f,gc(null,f),f=a.child,P=r.child.memoizedState,P===null?P=zp(c):(x=P.cachePool,x!==null?(V=nn._currentValue,x=x.parent!==V?{parent:V,pool:V}:x):x=v0(),P={baseLanes:P.baseLanes|c,cachePool:x}),f.memoizedState=P,f.childLanes=Pp(r,k,c),a.memoizedState=Dp,gc(r.child,f)):(Sa(a),c=r.child,r=c.sibling,c=Ps(c,{mode:"visible",children:f.children}),c.return=a,c.sibling=null,r!==null&&(k=a.deletions,k===null?(a.deletions=[r],a.flags|=16):k.push(r)),a.child=c,a.memoizedState=null,c)}function Lp(r,a){return a=$d({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function $d(r,a){return r=cr(22,r,null,a),r.lanes=0,r}function Ip(r,a,c){return xo(a,r.child,null,c),r=Lp(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function Mw(r,a,c){r.lanes|=a;var f=r.alternate;f!==null&&(f.lanes|=a),Jm(r.return,a,c)}function $p(r,a,c,f,x,b){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:x,treeForkCount:b}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=f,k.tail=c,k.tailMode=x,k.treeForkCount=b)}function Rw(r,a,c){var f=a.pendingProps,x=f.revealOrder,b=f.tail;f=f.children;var k=Qt.current,P=(k&2)!==0;if(P?(k=k&1|2,a.flags|=128):k&=1,K(Qt,k),En(r,a,f,c),f=dt?rc:0,!P&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Mw(r,c,a);else if(r.tag===19)Mw(r,c,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(x){case"forwards":for(c=a.child,x=null;c!==null;)r=c.alternate,r!==null&&_d(r)===null&&(x=c),c=c.sibling;c=x,c===null?(x=a.child,a.child=null):(x=c.sibling,c.sibling=null),$p(a,!1,x,c,b,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,x=a.child,a.child=null;x!==null;){if(r=x.alternate,r!==null&&_d(r)===null){a.child=x;break}r=x.sibling,x.sibling=c,c=x,x=r}$p(a,!0,c,null,b,f);break;case"together":$p(a,!1,null,null,void 0,f);break;default:a.memoizedState=null}return a.child}function Us(r,a,c){if(r!==null&&(a.dependencies=r.dependencies),ka|=a.lanes,(c&a.childLanes)===0)if(r!==null){if(vi(r,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(s(153));if(a.child!==null){for(r=a.child,c=Ps(r,r.pendingProps),a.child=c,c.return=a;r.sibling!==null;)r=r.sibling,c=c.sibling=Ps(r,r.pendingProps),c.return=a;c.sibling=null}return a.child}function Fp(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&yd(r)))}function jA(r,a,c){switch(a.tag){case 3:ye(a,a.stateNode.containerInfo),xa(a,nn,r.memoizedState.cache),fo();break;case 27:case 5:_e(a);break;case 4:ye(a,a.stateNode.containerInfo);break;case 10:xa(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,dp(a),null;break;case 13:var f=a.memoizedState;if(f!==null)return f.dehydrated!==null?(Sa(a),a.flags|=128,null):(c&a.child.childLanes)!==0?Tw(r,a,c):(Sa(a),r=Us(r,a,c),r!==null?r.sibling:null);Sa(a);break;case 19:var x=(r.flags&128)!==0;if(f=(c&a.childLanes)!==0,f||(vi(r,a,c,!1),f=(c&a.childLanes)!==0),x){if(f)return Rw(r,a,c);a.flags|=128}if(x=a.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),K(Qt,Qt.current),f)break;return null;case 22:return a.lanes=0,jw(r,a,c,a.pendingProps);case 24:xa(a,nn,r.memoizedState.cache)}return Us(r,a,c)}function Aw(r,a,c){if(r!==null)if(r.memoizedProps!==a.pendingProps)sn=!0;else{if(!Fp(r,c)&&(a.flags&128)===0)return sn=!1,jA(r,a,c);sn=(r.flags&131072)!==0}else sn=!1,dt&&(a.flags&1048576)!==0&&u0(a,rc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var f=a.pendingProps;if(r=go(a.elementType),a.type=r,typeof r=="function")Hm(r)?(f=bo(r,f),a.tag=1,a=_w(null,a,r,f,c)):(a.tag=0,a=Op(null,a,r,f,c));else{if(r!=null){var x=r.$$typeof;if(x===M){a.tag=11,a=bw(null,a,r,f,c);break e}else if(x===T){a.tag=14,a=ww(null,a,r,f,c);break e}}throw a=G(r)||r,Error(s(306,a,""))}}return a;case 0:return Op(r,a,a.type,a.pendingProps,c);case 1:return f=a.type,x=bo(f,a.pendingProps),_w(r,a,f,x,c);case 3:e:{if(ye(a,a.stateNode.containerInfo),r===null)throw Error(s(387));f=a.pendingProps;var b=a.memoizedState;x=b.element,op(r,a),dc(a,f,null,c);var k=a.memoizedState;if(f=k.cache,xa(a,nn,f),f!==b.cache&&ep(a,[nn],c,!0),uc(),f=k.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:k.cache},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){a=Ew(r,a,f,c);break e}else if(f!==x){x=Tr(Error(s(424)),a),sc(x),a=Ew(r,a,f,c);break e}else for(r=a.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Dt=Dr(r.firstChild),kn=a,dt=!0,ga=null,Ar=!0,c=j0(a,null,f,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(fo(),f===x){a=Us(r,a,c);break e}En(r,a,f,c)}a=a.child}return a;case 26:return Id(r,a),r===null?(c=VS(a.type,null,a.pendingProps,null))?a.memoizedState=c:dt||(c=a.type,r=a.pendingProps,f=tf(ue.current).createElement(c),f[Zt]=a,f[Wn]=r,Tn(f,c,r),Sn(f),a.stateNode=f):a.memoizedState=VS(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return _e(a),r===null&&dt&&(f=a.stateNode=FS(a.type,a.pendingProps,ue.current),kn=a,Ar=!0,x=Dt,Ra(a.type)?(yg=x,Dt=Dr(f.firstChild)):Dt=x),En(r,a,a.pendingProps.children,c),Id(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&dt&&((x=f=Dt)&&(f=JA(f,a.type,a.pendingProps,Ar),f!==null?(a.stateNode=f,kn=a,Dt=Dr(f.firstChild),Ar=!1,x=!0):x=!1),x||va(a)),_e(a),x=a.type,b=a.pendingProps,k=r!==null?r.memoizedProps:null,f=b.children,mg(x,b)?f=null:k!==null&&mg(x,k)&&(a.flags|=32),a.memoizedState!==null&&(x=hp(r,a,mA,null,null,c),Rc._currentValue=x),Id(r,a),En(r,a,f,c),a.child;case 6:return r===null&&dt&&((r=c=Dt)&&(c=eO(c,a.pendingProps,Ar),c!==null?(a.stateNode=c,kn=a,Dt=null,r=!0):r=!1),r||va(a)),null;case 13:return Tw(r,a,c);case 4:return ye(a,a.stateNode.containerInfo),f=a.pendingProps,r===null?a.child=xo(a,null,f,c):En(r,a,f,c),a.child;case 11:return bw(r,a,a.type,a.pendingProps,c);case 7:return En(r,a,a.pendingProps,c),a.child;case 8:return En(r,a,a.pendingProps.children,c),a.child;case 12:return En(r,a,a.pendingProps.children,c),a.child;case 10:return f=a.pendingProps,xa(a,a.type,f.value),En(r,a,f.children,c),a.child;case 9:return x=a.type._context,f=a.pendingProps.children,mo(a),x=_n(x),f=f(x),a.flags|=1,En(r,a,f,c),a.child;case 14:return ww(r,a,a.type,a.pendingProps,c);case 15:return Sw(r,a,a.type,a.pendingProps,c);case 19:return Rw(r,a,c);case 31:return SA(r,a,c);case 22:return jw(r,a,c,a.pendingProps);case 24:return mo(a),f=_n(nn),r===null?(x=rp(),x===null&&(x=Rt,b=tp(),x.pooledCache=b,b.refCount++,b!==null&&(x.pooledCacheLanes|=c),x=b),a.memoizedState={parent:f,cache:x},ap(a),xa(a,nn,x)):((r.lanes&c)!==0&&(op(r,a),dc(a,null,null,c),uc()),x=r.memoizedState,b=a.memoizedState,x.parent!==f?(x={parent:f,cache:f},a.memoizedState=x,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=x),xa(a,nn,f)):(f=b.cache,xa(a,nn,f),f!==x.cache&&ep(a,[nn],c,!0))),En(r,a,a.pendingProps.children,c),a.child;case 29:throw a.pendingProps}throw Error(s(156,a.tag))}function Vs(r){r.flags|=4}function Bp(r,a,c,f,x){if((a=(r.mode&32)!==0)&&(a=!1),a){if(r.flags|=16777216,(x&335544128)===x)if(r.stateNode.complete)r.flags|=8192;else if(aS())r.flags|=8192;else throw vo=jd,sp}else r.flags&=-16777217}function Ow(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!GS(a))if(aS())r.flags|=8192;else throw vo=jd,sp}function Fd(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?tn():536870912,r.lanes|=a,Ti|=a)}function vc(r,a){if(!dt)switch(r.tailMode){case"hidden":a=r.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function zt(r){var a=r.alternate!==null&&r.alternate.child===r.child,c=0,f=0;if(a)for(var x=r.child;x!==null;)c|=x.lanes|x.childLanes,f|=x.subtreeFlags&65011712,f|=x.flags&65011712,x.return=r,x=x.sibling;else for(x=r.child;x!==null;)c|=x.lanes|x.childLanes,f|=x.subtreeFlags,f|=x.flags,x.return=r,x=x.sibling;return r.subtreeFlags|=f,r.childLanes=c,a}function CA(r,a,c){var f=a.pendingProps;switch(Zm(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(a),null;case 1:return zt(a),null;case 3:return c=a.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),a.memoizedState.cache!==f&&(a.flags|=2048),$s(nn),Ce(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(gi(a)?Vs(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Km())),zt(a),null;case 26:var x=a.type,b=a.memoizedState;return r===null?(Vs(a),b!==null?(zt(a),Ow(a,b)):(zt(a),Bp(a,x,null,f,c))):b?b!==r.memoizedState?(Vs(a),zt(a),Ow(a,b)):(zt(a),a.flags&=-16777217):(r=r.memoizedProps,r!==f&&Vs(a),zt(a),Bp(a,x,r,f,c)),null;case 27:if(Re(a),c=ue.current,x=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==f&&Vs(a);else{if(!f){if(a.stateNode===null)throw Error(s(166));return zt(a),null}r=ne.current,gi(a)?f0(a):(r=FS(x,f,c),a.stateNode=r,Vs(a))}return zt(a),null;case 5:if(Re(a),x=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==f&&Vs(a);else{if(!f){if(a.stateNode===null)throw Error(s(166));return zt(a),null}if(b=ne.current,gi(a))f0(a);else{var k=tf(ue.current);switch(b){case 1:b=k.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:b=k.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":b=k.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":b=k.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":b=k.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof f.is=="string"?k.createElement("select",{is:f.is}):k.createElement("select"),f.multiple?b.multiple=!0:f.size&&(b.size=f.size);break;default:b=typeof f.is=="string"?k.createElement(x,{is:f.is}):k.createElement(x)}}b[Zt]=a,b[Wn]=f;e:for(k=a.child;k!==null;){if(k.tag===5||k.tag===6)b.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===a)break e;for(;k.sibling===null;){if(k.return===null||k.return===a)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}a.stateNode=b;e:switch(Tn(b,x,f),x){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Vs(a)}}return zt(a),Bp(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,c),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==f&&Vs(a);else{if(typeof f!="string"&&a.stateNode===null)throw Error(s(166));if(r=ue.current,gi(a)){if(r=a.stateNode,c=a.memoizedProps,f=null,x=kn,x!==null)switch(x.tag){case 27:case 5:f=x.memoizedProps}r[Zt]=a,r=!!(r.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||TS(r.nodeValue,c)),r||va(a,!0)}else r=tf(r).createTextNode(f),r[Zt]=a,a.stateNode=r}return zt(a),null;case 31:if(c=a.memoizedState,r===null||r.memoizedState!==null){if(f=gi(a),c!==null){if(r===null){if(!f)throw Error(s(318));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[Zt]=a}else fo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;zt(a),r=!1}else c=Km(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return a.flags&256?(dr(a),a):(dr(a),null);if((a.flags&128)!==0)throw Error(s(558))}return zt(a),null;case 13:if(f=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(x=gi(a),f!==null&&f.dehydrated!==null){if(r===null){if(!x)throw Error(s(318));if(x=a.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(s(317));x[Zt]=a}else fo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;zt(a),x=!1}else x=Km(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=x),x=!0;if(!x)return a.flags&256?(dr(a),a):(dr(a),null)}return dr(a),(a.flags&128)!==0?(a.lanes=c,a):(c=f!==null,r=r!==null&&r.memoizedState!==null,c&&(f=a.child,x=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(x=f.alternate.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==x&&(f.flags|=2048)),c!==r&&c&&(a.child.flags|=8192),Fd(a,a.updateQueue),zt(a),null);case 4:return Ce(),r===null&&cg(a.stateNode.containerInfo),zt(a),null;case 10:return $s(a.type),zt(a),null;case 19:if(F(Qt),f=a.memoizedState,f===null)return zt(a),null;if(x=(a.flags&128)!==0,b=f.rendering,b===null)if(x)vc(f,!1);else{if(Ht!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(b=_d(r),b!==null){for(a.flags|=128,vc(f,!1),r=b.updateQueue,a.updateQueue=r,Fd(a,r),a.subtreeFlags=0,r=c,c=a.child;c!==null;)i0(c,r),c=c.sibling;return K(Qt,Qt.current&1|2),dt&&Ls(a,f.treeForkCount),a.child}r=r.sibling}f.tail!==null&&ut()>Hd&&(a.flags|=128,x=!0,vc(f,!1),a.lanes=4194304)}else{if(!x)if(r=_d(b),r!==null){if(a.flags|=128,x=!0,r=r.updateQueue,a.updateQueue=r,Fd(a,r),vc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!b.alternate&&!dt)return zt(a),null}else 2*ut()-f.renderingStartTime>Hd&&c!==536870912&&(a.flags|=128,x=!0,vc(f,!1),a.lanes=4194304);f.isBackwards?(b.sibling=a.child,a.child=b):(r=f.last,r!==null?r.sibling=b:a.child=b,f.last=b)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=ut(),r.sibling=null,c=Qt.current,K(Qt,x?c&1|2:c&1),dt&&Ls(a,f.treeForkCount),r):(zt(a),null);case 22:case 23:return dr(a),up(),f=a.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(a.flags|=8192):f&&(a.flags|=8192),f?(c&536870912)!==0&&(a.flags&128)===0&&(zt(a),a.subtreeFlags&6&&(a.flags|=8192)):zt(a),c=a.updateQueue,c!==null&&Fd(a,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==c&&(a.flags|=2048),r!==null&&F(po),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),$s(nn),zt(a),null;case 25:return null;case 30:return null}throw Error(s(156,a.tag))}function NA(r,a){switch(Zm(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return $s(nn),Ce(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return Re(a),null;case 31:if(a.memoizedState!==null){if(dr(a),a.alternate===null)throw Error(s(340));fo()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(dr(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(s(340));fo()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return F(Qt),null;case 4:return Ce(),null;case 10:return $s(a.type),null;case 22:case 23:return dr(a),up(),r!==null&&F(po),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return $s(nn),null;case 25:return null;default:return null}}function Dw(r,a){switch(Zm(a),a.tag){case 3:$s(nn),Ce();break;case 26:case 27:case 5:Re(a);break;case 4:Ce();break;case 31:a.memoizedState!==null&&dr(a);break;case 13:dr(a);break;case 19:F(Qt);break;case 10:$s(a.type);break;case 22:case 23:dr(a),up(),r!==null&&F(po);break;case 24:$s(nn)}}function xc(r,a){try{var c=a.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var x=f.next;c=x;do{if((c.tag&r)===r){f=void 0;var b=c.create,k=c.inst;f=b(),k.destroy=f}c=c.next}while(c!==x)}}catch(P){Ct(a,a.return,P)}}function Ca(r,a,c){try{var f=a.updateQueue,x=f!==null?f.lastEffect:null;if(x!==null){var b=x.next;f=b;do{if((f.tag&r)===r){var k=f.inst,P=k.destroy;if(P!==void 0){k.destroy=void 0,x=a;var V=c,se=P;try{se()}catch(ce){Ct(x,V,ce)}}}f=f.next}while(f!==b)}}catch(ce){Ct(a,a.return,ce)}}function zw(r){var a=r.updateQueue;if(a!==null){var c=r.stateNode;try{N0(a,c)}catch(f){Ct(r,r.return,f)}}}function Pw(r,a,c){c.props=bo(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(f){Ct(r,a,f)}}function yc(r,a){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof c=="function"?r.refCleanup=c(f):c.current=f}}catch(x){Ct(r,a,x)}}function ms(r,a){var c=r.ref,f=r.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(x){Ct(r,a,x)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(x){Ct(r,a,x)}else c.current=null}function Lw(r){var a=r.type,c=r.memoizedProps,f=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(x){Ct(r,r.return,x)}}function Up(r,a,c){try{var f=r.stateNode;WA(f,r.type,c,a),f[Wn]=a}catch(x){Ct(r,r.return,x)}}function Iw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ra(r.type)||r.tag===4}function Vp(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Iw(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ra(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function qp(r,a,c){var f=r.tag;if(f===5||f===6)r=r.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(r),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=Ds));else if(f!==4&&(f===27&&Ra(r.type)&&(c=r.stateNode,a=null),r=r.child,r!==null))for(qp(r,a,c),r=r.sibling;r!==null;)qp(r,a,c),r=r.sibling}function Bd(r,a,c){var f=r.tag;if(f===5||f===6)r=r.stateNode,a?c.insertBefore(r,a):c.appendChild(r);else if(f!==4&&(f===27&&Ra(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Bd(r,a,c),r=r.sibling;r!==null;)Bd(r,a,c),r=r.sibling}function $w(r){var a=r.stateNode,c=r.memoizedProps;try{for(var f=r.type,x=a.attributes;x.length;)a.removeAttributeNode(x[0]);Tn(a,f,c),a[Zt]=r,a[Wn]=c}catch(b){Ct(r,r.return,b)}}var qs=!1,an=!1,Hp=!1,Fw=typeof WeakSet=="function"?WeakSet:Set,jn=null;function kA(r,a){if(r=r.containerInfo,fg=cf,r=Xb(r),Im(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var x=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var k=0,P=-1,V=-1,se=0,ce=0,he=r,oe=null;t:for(;;){for(var ie;he!==c||x!==0&&he.nodeType!==3||(P=k+x),he!==b||f!==0&&he.nodeType!==3||(V=k+f),he.nodeType===3&&(k+=he.nodeValue.length),(ie=he.firstChild)!==null;)oe=he,he=ie;for(;;){if(he===r)break t;if(oe===c&&++se===x&&(P=k),oe===b&&++ce===f&&(V=k),(ie=he.nextSibling)!==null)break;he=oe,oe=he.parentNode}he=ie}c=P===-1||V===-1?null:{start:P,end:V}}else c=null}c=c||{start:0,end:0}}else c=null;for(hg={focusedElem:r,selectionRange:c},cf=!1,jn=a;jn!==null;)if(a=jn,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,jn=r;else for(;jn!==null;){switch(a=jn,b=a.alternate,r=a.flags,a.tag){case 0:if((r&4)!==0&&(r=a.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)x=r[c],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&b!==null){r=void 0,c=a,x=b.memoizedProps,b=b.memoizedState,f=c.stateNode;try{var Ee=bo(c.type,x);r=f.getSnapshotBeforeUpdate(Ee,b),f.__reactInternalSnapshotBeforeUpdate=r}catch(qe){Ct(c,c.return,qe)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,c=r.nodeType,c===9)gg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":gg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=a.sibling,r!==null){r.return=a.return,jn=r;break}jn=a.return}}function Bw(r,a,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:Ys(r,c),f&4&&xc(5,c);break;case 1:if(Ys(r,c),f&4)if(r=c.stateNode,a===null)try{r.componentDidMount()}catch(k){Ct(c,c.return,k)}else{var x=bo(c.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(x,a,r.__reactInternalSnapshotBeforeUpdate)}catch(k){Ct(c,c.return,k)}}f&64&&zw(c),f&512&&yc(c,c.return);break;case 3:if(Ys(r,c),f&64&&(r=c.updateQueue,r!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{N0(r,a)}catch(k){Ct(c,c.return,k)}}break;case 27:a===null&&f&4&&$w(c);case 26:case 5:Ys(r,c),a===null&&f&4&&Lw(c),f&512&&yc(c,c.return);break;case 12:Ys(r,c);break;case 31:Ys(r,c),f&4&&qw(r,c);break;case 13:Ys(r,c),f&4&&Hw(r,c),f&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=zA.bind(null,c),tO(r,c))));break;case 22:if(f=c.memoizedState!==null||qs,!f){a=a!==null&&a.memoizedState!==null||an,x=qs;var b=an;qs=f,(an=a)&&!b?Ws(r,c,(c.subtreeFlags&8772)!==0):Ys(r,c),qs=x,an=b}break;case 30:break;default:Ys(r,c)}}function Uw(r){var a=r.alternate;a!==null&&(r.alternate=null,Uw(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&wm(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Pt=null,Zn=!1;function Hs(r,a,c){for(c=c.child;c!==null;)Vw(r,a,c),c=c.sibling}function Vw(r,a,c){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Pn,c)}catch{}switch(c.tag){case 26:an||ms(c,a),Hs(r,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:an||ms(c,a);var f=Pt,x=Zn;Ra(c.type)&&(Pt=c.stateNode,Zn=!1),Hs(r,a,c),Ec(c.stateNode),Pt=f,Zn=x;break;case 5:an||ms(c,a);case 6:if(f=Pt,x=Zn,Pt=null,Hs(r,a,c),Pt=f,Zn=x,Pt!==null)if(Zn)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(c.stateNode)}catch(b){Ct(c,a,b)}else try{Pt.removeChild(c.stateNode)}catch(b){Ct(c,a,b)}break;case 18:Pt!==null&&(Zn?(r=Pt,zS(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),Li(r)):zS(Pt,c.stateNode));break;case 4:f=Pt,x=Zn,Pt=c.stateNode.containerInfo,Zn=!0,Hs(r,a,c),Pt=f,Zn=x;break;case 0:case 11:case 14:case 15:Ca(2,c,a),an||Ca(4,c,a),Hs(r,a,c);break;case 1:an||(ms(c,a),f=c.stateNode,typeof f.componentWillUnmount=="function"&&Pw(c,a,f)),Hs(r,a,c);break;case 21:Hs(r,a,c);break;case 22:an=(f=an)||c.memoizedState!==null,Hs(r,a,c),an=f;break;default:Hs(r,a,c)}}function qw(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Li(r)}catch(c){Ct(a,a.return,c)}}}function Hw(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Li(r)}catch(c){Ct(a,a.return,c)}}function _A(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new Fw),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new Fw),a;default:throw Error(s(435,r.tag))}}function Ud(r,a){var c=_A(r);a.forEach(function(f){if(!c.has(f)){c.add(f);var x=PA.bind(null,r,f);f.then(x,x)}})}function Qn(r,a){var c=a.deletions;if(c!==null)for(var f=0;f<c.length;f++){var x=c[f],b=r,k=a,P=k;e:for(;P!==null;){switch(P.tag){case 27:if(Ra(P.type)){Pt=P.stateNode,Zn=!1;break e}break;case 5:Pt=P.stateNode,Zn=!1;break e;case 3:case 4:Pt=P.stateNode.containerInfo,Zn=!0;break e}P=P.return}if(Pt===null)throw Error(s(160));Vw(b,k,x),Pt=null,Zn=!1,b=x.alternate,b!==null&&(b.return=null),x.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Yw(a,r),a=a.sibling}var Zr=null;function Yw(r,a){var c=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Qn(a,r),Kn(r),f&4&&(Ca(3,r,r.return),xc(3,r),Ca(5,r,r.return));break;case 1:Qn(a,r),Kn(r),f&512&&(an||c===null||ms(c,c.return)),f&64&&qs&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var x=Zr;if(Qn(a,r),Kn(r),f&512&&(an||c===null||ms(c,c.return)),f&4){var b=c!==null?c.memoizedState:null;if(f=r.memoizedState,c===null)if(f===null)if(r.stateNode===null){e:{f=r.type,c=r.memoizedProps,x=x.ownerDocument||x;t:switch(f){case"title":b=x.getElementsByTagName("title")[0],(!b||b[Yl]||b[Zt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=x.createElement(f),x.head.insertBefore(b,x.querySelector("head > title"))),Tn(b,f,c),b[Zt]=r,Sn(b),f=b;break e;case"link":var k=YS("link","href",x).get(f+(c.href||""));if(k){for(var P=0;P<k.length;P++)if(b=k[P],b.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&b.getAttribute("rel")===(c.rel==null?null:c.rel)&&b.getAttribute("title")===(c.title==null?null:c.title)&&b.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){k.splice(P,1);break t}}b=x.createElement(f),Tn(b,f,c),x.head.appendChild(b);break;case"meta":if(k=YS("meta","content",x).get(f+(c.content||""))){for(P=0;P<k.length;P++)if(b=k[P],b.getAttribute("content")===(c.content==null?null:""+c.content)&&b.getAttribute("name")===(c.name==null?null:c.name)&&b.getAttribute("property")===(c.property==null?null:c.property)&&b.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&b.getAttribute("charset")===(c.charSet==null?null:c.charSet)){k.splice(P,1);break t}}b=x.createElement(f),Tn(b,f,c),x.head.appendChild(b);break;default:throw Error(s(468,f))}b[Zt]=r,Sn(b),f=b}r.stateNode=f}else WS(x,r.type,r.stateNode);else r.stateNode=HS(x,f,r.memoizedProps);else b!==f?(b===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):b.count--,f===null?WS(x,r.type,r.stateNode):HS(x,f,r.memoizedProps)):f===null&&r.stateNode!==null&&Up(r,r.memoizedProps,c.memoizedProps)}break;case 27:Qn(a,r),Kn(r),f&512&&(an||c===null||ms(c,c.return)),c!==null&&f&4&&Up(r,r.memoizedProps,c.memoizedProps);break;case 5:if(Qn(a,r),Kn(r),f&512&&(an||c===null||ms(c,c.return)),r.flags&32){x=r.stateNode;try{oi(x,"")}catch(Ee){Ct(r,r.return,Ee)}}f&4&&r.stateNode!=null&&(x=r.memoizedProps,Up(r,x,c!==null?c.memoizedProps:x)),f&1024&&(Hp=!0);break;case 6:if(Qn(a,r),Kn(r),f&4){if(r.stateNode===null)throw Error(s(162));f=r.memoizedProps,c=r.stateNode;try{c.nodeValue=f}catch(Ee){Ct(r,r.return,Ee)}}break;case 3:if(sf=null,x=Zr,Zr=nf(a.containerInfo),Qn(a,r),Zr=x,Kn(r),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Li(a.containerInfo)}catch(Ee){Ct(r,r.return,Ee)}Hp&&(Hp=!1,Ww(r));break;case 4:f=Zr,Zr=nf(r.stateNode.containerInfo),Qn(a,r),Kn(r),Zr=f;break;case 12:Qn(a,r),Kn(r);break;case 31:Qn(a,r),Kn(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Ud(r,f)));break;case 13:Qn(a,r),Kn(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(qd=ut()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Ud(r,f)));break;case 22:x=r.memoizedState!==null;var V=c!==null&&c.memoizedState!==null,se=qs,ce=an;if(qs=se||x,an=ce||V,Qn(a,r),an=ce,qs=se,Kn(r),f&8192)e:for(a=r.stateNode,a._visibility=x?a._visibility&-2:a._visibility|1,x&&(c===null||V||qs||an||wo(r)),c=null,a=r;;){if(a.tag===5||a.tag===26){if(c===null){V=c=a;try{if(b=V.stateNode,x)k=b.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{P=V.stateNode;var he=V.memoizedProps.style,oe=he!=null&&he.hasOwnProperty("display")?he.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ee){Ct(V,V.return,Ee)}}}else if(a.tag===6){if(c===null){V=a;try{V.stateNode.nodeValue=x?"":V.memoizedProps}catch(Ee){Ct(V,V.return,Ee)}}}else if(a.tag===18){if(c===null){V=a;try{var ie=V.stateNode;x?PS(ie,!0):PS(V.stateNode,!1)}catch(Ee){Ct(V,V.return,Ee)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;c===a&&(c=null),a=a.return}c===a&&(c=null),a.sibling.return=a.return,a=a.sibling}f&4&&(f=r.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,Ud(r,c))));break;case 19:Qn(a,r),Kn(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Ud(r,f)));break;case 30:break;case 21:break;default:Qn(a,r),Kn(r)}}function Kn(r){var a=r.flags;if(a&2){try{for(var c,f=r.return;f!==null;){if(Iw(f)){c=f;break}f=f.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var x=c.stateNode,b=Vp(r);Bd(r,b,x);break;case 5:var k=c.stateNode;c.flags&32&&(oi(k,""),c.flags&=-33);var P=Vp(r);Bd(r,P,k);break;case 3:case 4:var V=c.stateNode.containerInfo,se=Vp(r);qp(r,se,V);break;default:throw Error(s(161))}}catch(ce){Ct(r,r.return,ce)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function Ww(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;Ww(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function Ys(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Bw(r,a.alternate,a),a=a.sibling}function wo(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:Ca(4,a,a.return),wo(a);break;case 1:ms(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&Pw(a,a.return,c),wo(a);break;case 27:Ec(a.stateNode);case 26:case 5:ms(a,a.return),wo(a);break;case 22:a.memoizedState===null&&wo(a);break;case 30:wo(a);break;default:wo(a)}r=r.sibling}}function Ws(r,a,c){for(c=c&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var f=a.alternate,x=r,b=a,k=b.flags;switch(b.tag){case 0:case 11:case 15:Ws(x,b,c),xc(4,b);break;case 1:if(Ws(x,b,c),f=b,x=f.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(se){Ct(f,f.return,se)}if(f=b,x=f.updateQueue,x!==null){var P=f.stateNode;try{var V=x.shared.hiddenCallbacks;if(V!==null)for(x.shared.hiddenCallbacks=null,x=0;x<V.length;x++)C0(V[x],P)}catch(se){Ct(f,f.return,se)}}c&&k&64&&zw(b),yc(b,b.return);break;case 27:$w(b);case 26:case 5:Ws(x,b,c),c&&f===null&&k&4&&Lw(b),yc(b,b.return);break;case 12:Ws(x,b,c);break;case 31:Ws(x,b,c),c&&k&4&&qw(x,b);break;case 13:Ws(x,b,c),c&&k&4&&Hw(x,b);break;case 22:b.memoizedState===null&&Ws(x,b,c),yc(b,b.return);break;case 30:break;default:Ws(x,b,c)}a=a.sibling}}function Yp(r,a){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&ac(c))}function Wp(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&ac(r))}function Qr(r,a,c,f){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Gw(r,a,c,f),a=a.sibling}function Gw(r,a,c,f){var x=a.flags;switch(a.tag){case 0:case 11:case 15:Qr(r,a,c,f),x&2048&&xc(9,a);break;case 1:Qr(r,a,c,f);break;case 3:Qr(r,a,c,f),x&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&ac(r)));break;case 12:if(x&2048){Qr(r,a,c,f),r=a.stateNode;try{var b=a.memoizedProps,k=b.id,P=b.onPostCommit;typeof P=="function"&&P(k,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(V){Ct(a,a.return,V)}}else Qr(r,a,c,f);break;case 31:Qr(r,a,c,f);break;case 13:Qr(r,a,c,f);break;case 23:break;case 22:b=a.stateNode,k=a.alternate,a.memoizedState!==null?b._visibility&2?Qr(r,a,c,f):bc(r,a):b._visibility&2?Qr(r,a,c,f):(b._visibility|=2,ki(r,a,c,f,(a.subtreeFlags&10256)!==0||!1)),x&2048&&Yp(k,a);break;case 24:Qr(r,a,c,f),x&2048&&Wp(a.alternate,a);break;default:Qr(r,a,c,f)}}function ki(r,a,c,f,x){for(x=x&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var b=r,k=a,P=c,V=f,se=k.flags;switch(k.tag){case 0:case 11:case 15:ki(b,k,P,V,x),xc(8,k);break;case 23:break;case 22:var ce=k.stateNode;k.memoizedState!==null?ce._visibility&2?ki(b,k,P,V,x):bc(b,k):(ce._visibility|=2,ki(b,k,P,V,x)),x&&se&2048&&Yp(k.alternate,k);break;case 24:ki(b,k,P,V,x),x&&se&2048&&Wp(k.alternate,k);break;default:ki(b,k,P,V,x)}a=a.sibling}}function bc(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=r,f=a,x=f.flags;switch(f.tag){case 22:bc(c,f),x&2048&&Yp(f.alternate,f);break;case 24:bc(c,f),x&2048&&Wp(f.alternate,f);break;default:bc(c,f)}a=a.sibling}}var wc=8192;function _i(r,a,c){if(r.subtreeFlags&wc)for(r=r.child;r!==null;)Zw(r,a,c),r=r.sibling}function Zw(r,a,c){switch(r.tag){case 26:_i(r,a,c),r.flags&wc&&r.memoizedState!==null&&hO(c,Zr,r.memoizedState,r.memoizedProps);break;case 5:_i(r,a,c);break;case 3:case 4:var f=Zr;Zr=nf(r.stateNode.containerInfo),_i(r,a,c),Zr=f;break;case 22:r.memoizedState===null&&(f=r.alternate,f!==null&&f.memoizedState!==null?(f=wc,wc=16777216,_i(r,a,c),wc=f):_i(r,a,c));break;default:_i(r,a,c)}}function Qw(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function Sc(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];jn=f,Xw(f,r)}Qw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Kw(r),r=r.sibling}function Kw(r){switch(r.tag){case 0:case 11:case 15:Sc(r),r.flags&2048&&Ca(9,r,r.return);break;case 3:Sc(r);break;case 12:Sc(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,Vd(r)):Sc(r);break;default:Sc(r)}}function Vd(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];jn=f,Xw(f,r)}Qw(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:Ca(8,a,a.return),Vd(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,Vd(a));break;default:Vd(a)}r=r.sibling}}function Xw(r,a){for(;jn!==null;){var c=jn;switch(c.tag){case 0:case 11:case 15:Ca(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:ac(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,jn=f;else e:for(c=r;jn!==null;){f=jn;var x=f.sibling,b=f.return;if(Uw(f),f===c){jn=null;break e}if(x!==null){x.return=b,jn=x;break e}jn=b}}}var EA={getCacheForType:function(r){var a=_n(nn),c=a.data.get(r);return c===void 0&&(c=r(),a.data.set(r,c)),c},cacheSignal:function(){return _n(nn).controller.signal}},TA=typeof WeakMap=="function"?WeakMap:Map,xt=0,Rt=null,at=null,lt=0,jt=0,fr=null,Na=!1,Ei=!1,Gp=!1,Gs=0,Ht=0,ka=0,So=0,Zp=0,hr=0,Ti=0,jc=null,Xn=null,Qp=!1,qd=0,Jw=0,Hd=1/0,Yd=null,_a=null,fn=0,Ea=null,Mi=null,Zs=0,Kp=0,Xp=null,eS=null,Cc=0,Jp=null;function mr(){return(xt&2)!==0&&lt!==0?lt&-lt:L.T!==null?ag():vt()}function tS(){if(hr===0)if((lt&536870912)===0||dt){var r=we;we<<=1,(we&3932160)===0&&(we=262144),hr=r}else hr=536870912;return r=ur.current,r!==null&&(r.flags|=32),hr}function Jn(r,a,c){(r===Rt&&(jt===2||jt===9)||r.cancelPendingCommit!==null)&&(Ri(r,0),Ta(r,lt,hr,!1)),Ot(r,c),((xt&2)===0||r!==Rt)&&(r===Rt&&((xt&2)===0&&(So|=c),Ht===4&&Ta(r,lt,hr,!1)),ps(r))}function nS(r,a,c){if((xt&6)!==0)throw Error(s(327));var f=!c&&(a&127)===0&&(a&r.expiredLanes)===0||St(r,a),x=f?AA(r,a):tg(r,a,!0),b=f;do{if(x===0){Ei&&!f&&Ta(r,a,0,!1);break}else{if(c=r.current.alternate,b&&!MA(c)){x=tg(r,a,!1),b=!1;continue}if(x===2){if(b=a,r.errorRecoveryDisabledLanes&b)var k=0;else k=r.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){a=k;e:{var P=r;x=jc;var V=P.current.memoizedState.isDehydrated;if(V&&(Ri(P,k).flags|=256),k=tg(P,k,!1),k!==2){if(Gp&&!V){P.errorRecoveryDisabledLanes|=b,So|=b,x=4;break e}b=Xn,Xn=x,b!==null&&(Xn===null?Xn=b:Xn.push.apply(Xn,b))}x=k}if(b=!1,x!==2)continue}}if(x===1){Ri(r,0),Ta(r,a,0,!0);break}e:{switch(f=r,b=x,b){case 0:case 1:throw Error(s(345));case 4:if((a&4194048)!==a)break;case 6:Ta(f,a,hr,!Na);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((a&62914560)===a&&(x=qd+300-ut(),10<x)){if(Ta(f,a,hr,!Na),De(f,0,!0)!==0)break e;Zs=a,f.timeoutHandle=OS(rS.bind(null,f,c,Xn,Yd,Qp,a,hr,So,Ti,Na,b,"Throttled",-0,0),x);break e}rS(f,c,Xn,Yd,Qp,a,hr,So,Ti,Na,b,null,-0,0)}}break}while(!0);ps(r)}function rS(r,a,c,f,x,b,k,P,V,se,ce,he,oe,ie){if(r.timeoutHandle=-1,he=a.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ds},Zw(a,b,he);var Ee=(b&62914560)===b?qd-ut():(b&4194048)===b?Jw-ut():0;if(Ee=mO(he,Ee),Ee!==null){Zs=b,r.cancelPendingCommit=Ee(dS.bind(null,r,a,b,c,f,x,k,P,V,ce,he,null,oe,ie)),Ta(r,b,k,!se);return}}dS(r,a,b,c,f,x,k,P,V)}function MA(r){for(var a=r;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var x=c[f],b=x.getSnapshot;x=x.value;try{if(!lr(b(),x))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ta(r,a,c,f){a&=~Zp,a&=~So,r.suspendedLanes|=a,r.pingedLanes&=~a,f&&(r.warmLanes|=a),f=r.expirationTimes;for(var x=a;0<x;){var b=31-$t(x),k=1<<b;f[b]=-1,x&=~k}c!==0&&Hn(r,c,a)}function Wd(){return(xt&6)===0?(Nc(0),!1):!0}function eg(){if(at!==null){if(jt===0)var r=at.return;else r=at,Is=ho=null,gp(r),wi=null,ic=0,r=at;for(;r!==null;)Dw(r.alternate,r),r=r.return;at=null}}function Ri(r,a){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,QA(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Zs=0,eg(),Rt=r,at=c=Ps(r.current,null),lt=a,jt=0,fr=null,Na=!1,Ei=St(r,a),Gp=!1,Ti=hr=Zp=So=ka=Ht=0,Xn=jc=null,Qp=!1,(a&8)!==0&&(a|=a&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=a;0<f;){var x=31-$t(f),b=1<<x;a|=r[x],f&=~b}return Gs=a,md(),c}function sS(r,a){Qe=null,L.H=pc,a===bi||a===Sd?(a=b0(),jt=3):a===sp?(a=b0(),jt=4):jt=a===Ap?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,fr=a,at===null&&(Ht=1,Pd(r,Tr(a,r.current)))}function aS(){var r=ur.current;return r===null?!0:(lt&4194048)===lt?Or===null:(lt&62914560)===lt||(lt&536870912)!==0?r===Or:!1}function oS(){var r=L.H;return L.H=pc,r===null?pc:r}function iS(){var r=L.A;return L.A=EA,r}function Gd(){Ht=4,Na||(lt&4194048)!==lt&&ur.current!==null||(Ei=!0),(ka&134217727)===0&&(So&134217727)===0||Rt===null||Ta(Rt,lt,hr,!1)}function tg(r,a,c){var f=xt;xt|=2;var x=oS(),b=iS();(Rt!==r||lt!==a)&&(Yd=null,Ri(r,a)),a=!1;var k=Ht;e:do try{if(jt!==0&&at!==null){var P=at,V=fr;switch(jt){case 8:eg(),k=6;break e;case 3:case 2:case 9:case 6:ur.current===null&&(a=!0);var se=jt;if(jt=0,fr=null,Ai(r,P,V,se),c&&Ei){k=0;break e}break;default:se=jt,jt=0,fr=null,Ai(r,P,V,se)}}RA(),k=Ht;break}catch(ce){sS(r,ce)}while(!0);return a&&r.shellSuspendCounter++,Is=ho=null,xt=f,L.H=x,L.A=b,at===null&&(Rt=null,lt=0,md()),k}function RA(){for(;at!==null;)lS(at)}function AA(r,a){var c=xt;xt|=2;var f=oS(),x=iS();Rt!==r||lt!==a?(Yd=null,Hd=ut()+500,Ri(r,a)):Ei=St(r,a);e:do try{if(jt!==0&&at!==null){a=at;var b=fr;t:switch(jt){case 1:jt=0,fr=null,Ai(r,a,b,1);break;case 2:case 9:if(x0(b)){jt=0,fr=null,cS(a);break}a=function(){jt!==2&&jt!==9||Rt!==r||(jt=7),ps(r)},b.then(a,a);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:x0(b)?(jt=0,fr=null,cS(a)):(jt=0,fr=null,Ai(r,a,b,7));break;case 5:var k=null;switch(at.tag){case 26:k=at.memoizedState;case 5:case 27:var P=at;if(k?GS(k):P.stateNode.complete){jt=0,fr=null;var V=P.sibling;if(V!==null)at=V;else{var se=P.return;se!==null?(at=se,Zd(se)):at=null}break t}}jt=0,fr=null,Ai(r,a,b,5);break;case 6:jt=0,fr=null,Ai(r,a,b,6);break;case 8:eg(),Ht=6;break e;default:throw Error(s(462))}}OA();break}catch(ce){sS(r,ce)}while(!0);return Is=ho=null,L.H=f,L.A=x,xt=c,at!==null?0:(Rt=null,lt=0,md(),Ht)}function OA(){for(;at!==null&&!Oe();)lS(at)}function lS(r){var a=Aw(r.alternate,r,Gs);r.memoizedProps=r.pendingProps,a===null?Zd(r):at=a}function cS(r){var a=r,c=a.alternate;switch(a.tag){case 15:case 0:a=kw(c,a,a.pendingProps,a.type,void 0,lt);break;case 11:a=kw(c,a,a.pendingProps,a.type.render,a.ref,lt);break;case 5:gp(a);default:Dw(c,a),a=at=i0(a,Gs),a=Aw(c,a,Gs)}r.memoizedProps=r.pendingProps,a===null?Zd(r):at=a}function Ai(r,a,c,f){Is=ho=null,gp(a),wi=null,ic=0;var x=a.return;try{if(wA(r,x,a,c,lt)){Ht=1,Pd(r,Tr(c,r.current)),at=null;return}}catch(b){if(x!==null)throw at=x,b;Ht=1,Pd(r,Tr(c,r.current)),at=null;return}a.flags&32768?(dt||f===1?r=!0:Ei||(lt&536870912)!==0?r=!1:(Na=r=!0,(f===2||f===9||f===3||f===6)&&(f=ur.current,f!==null&&f.tag===13&&(f.flags|=16384))),uS(a,r)):Zd(a)}function Zd(r){var a=r;do{if((a.flags&32768)!==0){uS(a,Na);return}r=a.return;var c=CA(a.alternate,a,Gs);if(c!==null){at=c;return}if(a=a.sibling,a!==null){at=a;return}at=a=r}while(a!==null);Ht===0&&(Ht=5)}function uS(r,a){do{var c=NA(r.alternate,r);if(c!==null){c.flags&=32767,at=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!a&&(r=r.sibling,r!==null)){at=r;return}at=r=c}while(r!==null);Ht=6,at=null}function dS(r,a,c,f,x,b,k,P,V){r.cancelPendingCommit=null;do Qd();while(fn!==0);if((xt&6)!==0)throw Error(s(327));if(a!==null){if(a===r.current)throw Error(s(177));if(b=a.lanes|a.childLanes,b|=Vm,Rn(r,c,b,k,P,V),r===Rt&&(at=Rt=null,lt=0),Mi=a,Ea=r,Zs=c,Kp=b,Xp=x,eS=f,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,LA(gt,function(){return gS(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||f){f=L.T,L.T=null,x=$.p,$.p=2,k=xt,xt|=4;try{kA(r,a,c)}finally{xt=k,$.p=x,L.T=f}}fn=1,fS(),hS(),mS()}}function fS(){if(fn===1){fn=0;var r=Ea,a=Mi,c=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||c){c=L.T,L.T=null;var f=$.p;$.p=2;var x=xt;xt|=4;try{Yw(a,r);var b=hg,k=Xb(r.containerInfo),P=b.focusedElem,V=b.selectionRange;if(k!==P&&P&&P.ownerDocument&&Kb(P.ownerDocument.documentElement,P)){if(V!==null&&Im(P)){var se=V.start,ce=V.end;if(ce===void 0&&(ce=se),"selectionStart"in P)P.selectionStart=se,P.selectionEnd=Math.min(ce,P.value.length);else{var he=P.ownerDocument||document,oe=he&&he.defaultView||window;if(oe.getSelection){var ie=oe.getSelection(),Ee=P.textContent.length,qe=Math.min(V.start,Ee),Tt=V.end===void 0?qe:Math.min(V.end,Ee);!ie.extend&&qe>Tt&&(k=Tt,Tt=qe,qe=k);var J=Qb(P,qe),Z=Qb(P,Tt);if(J&&Z&&(ie.rangeCount!==1||ie.anchorNode!==J.node||ie.anchorOffset!==J.offset||ie.focusNode!==Z.node||ie.focusOffset!==Z.offset)){var re=he.createRange();re.setStart(J.node,J.offset),ie.removeAllRanges(),qe>Tt?(ie.addRange(re),ie.extend(Z.node,Z.offset)):(re.setEnd(Z.node,Z.offset),ie.addRange(re))}}}}for(he=[],ie=P;ie=ie.parentNode;)ie.nodeType===1&&he.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<he.length;P++){var de=he[P];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}cf=!!fg,hg=fg=null}finally{xt=x,$.p=f,L.T=c}}r.current=a,fn=2}}function hS(){if(fn===2){fn=0;var r=Ea,a=Mi,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=L.T,L.T=null;var f=$.p;$.p=2;var x=xt;xt|=4;try{Bw(r,a.alternate,a)}finally{xt=x,$.p=f,L.T=c}}fn=3}}function mS(){if(fn===4||fn===3){fn=0,ft();var r=Ea,a=Mi,c=Zs,f=eS;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?fn=5:(fn=0,Mi=Ea=null,pS(r,r.pendingLanes));var x=r.pendingLanes;if(x===0&&(_a=null),Ve(c),a=a.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Pn,a,void 0,(a.current.flags&128)===128)}catch{}if(f!==null){a=L.T,x=$.p,$.p=2,L.T=null;try{for(var b=r.onRecoverableError,k=0;k<f.length;k++){var P=f[k];b(P.value,{componentStack:P.stack})}}finally{L.T=a,$.p=x}}(Zs&3)!==0&&Qd(),ps(r),x=r.pendingLanes,(c&261930)!==0&&(x&42)!==0?r===Jp?Cc++:(Cc=0,Jp=r):Cc=0,Nc(0)}}function pS(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,ac(a)))}function Qd(){return fS(),hS(),mS(),gS()}function gS(){if(fn!==5)return!1;var r=Ea,a=Kp;Kp=0;var c=Ve(Zs),f=L.T,x=$.p;try{$.p=32>c?32:c,L.T=null,c=Xp,Xp=null;var b=Ea,k=Zs;if(fn=0,Mi=Ea=null,Zs=0,(xt&6)!==0)throw Error(s(331));var P=xt;if(xt|=4,Kw(b.current),Gw(b,b.current,k,c),xt=P,Nc(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Pn,b)}catch{}return!0}finally{$.p=x,L.T=f,pS(r,a)}}function vS(r,a,c){a=Tr(c,a),a=Rp(r.stateNode,a,2),r=wa(r,a,2),r!==null&&(Ot(r,2),ps(r))}function Ct(r,a,c){if(r.tag===3)vS(r,r,c);else for(;a!==null;){if(a.tag===3){vS(a,r,c);break}else if(a.tag===1){var f=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(_a===null||!_a.has(f))){r=Tr(c,r),c=xw(2),f=wa(a,c,2),f!==null&&(yw(c,f,a,r),Ot(f,2),ps(f));break}}a=a.return}}function ng(r,a,c){var f=r.pingCache;if(f===null){f=r.pingCache=new TA;var x=new Set;f.set(a,x)}else x=f.get(a),x===void 0&&(x=new Set,f.set(a,x));x.has(c)||(Gp=!0,x.add(c),r=DA.bind(null,r,a,c),a.then(r,r))}function DA(r,a,c){var f=r.pingCache;f!==null&&f.delete(a),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Rt===r&&(lt&c)===c&&(Ht===4||Ht===3&&(lt&62914560)===lt&&300>ut()-qd?(xt&2)===0&&Ri(r,0):Zp|=c,Ti===lt&&(Ti=0)),ps(r)}function xS(r,a){a===0&&(a=tn()),r=co(r,a),r!==null&&(Ot(r,a),ps(r))}function zA(r){var a=r.memoizedState,c=0;a!==null&&(c=a.retryLane),xS(r,c)}function PA(r,a){var c=0;switch(r.tag){case 31:case 13:var f=r.stateNode,x=r.memoizedState;x!==null&&(c=x.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(s(314))}f!==null&&f.delete(a),xS(r,c)}function LA(r,a){return Le(r,a)}var Kd=null,Oi=null,rg=!1,Xd=!1,sg=!1,Ma=0;function ps(r){r!==Oi&&r.next===null&&(Oi===null?Kd=Oi=r:Oi=Oi.next=r),Xd=!0,rg||(rg=!0,$A())}function Nc(r,a){if(!sg&&Xd){sg=!0;do for(var c=!1,f=Kd;f!==null;){if(r!==0){var x=f.pendingLanes;if(x===0)var b=0;else{var k=f.suspendedLanes,P=f.pingedLanes;b=(1<<31-$t(42|r)+1)-1,b&=x&~(k&~P),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(c=!0,SS(f,b))}else b=lt,b=De(f,f===Rt?b:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(b&3)===0||St(f,b)||(c=!0,SS(f,b));f=f.next}while(c);sg=!1}}function IA(){yS()}function yS(){Xd=rg=!1;var r=0;Ma!==0&&ZA()&&(r=Ma);for(var a=ut(),c=null,f=Kd;f!==null;){var x=f.next,b=bS(f,a);b===0?(f.next=null,c===null?Kd=x:c.next=x,x===null&&(Oi=c)):(c=f,(r!==0||(b&3)!==0)&&(Xd=!0)),f=x}fn!==0&&fn!==5||Nc(r),Ma!==0&&(Ma=0)}function bS(r,a){for(var c=r.suspendedLanes,f=r.pingedLanes,x=r.expirationTimes,b=r.pendingLanes&-62914561;0<b;){var k=31-$t(b),P=1<<k,V=x[k];V===-1?((P&c)===0||(P&f)!==0)&&(x[k]=bn(P,a)):V<=a&&(r.expiredLanes|=P),b&=~P}if(a=Rt,c=lt,c=De(r,r===a?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,c===0||r===a&&(jt===2||jt===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&We(f),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||St(r,c)){if(a=c&-c,a===r.callbackPriority)return a;switch(f!==null&&We(f),Ve(c)){case 2:case 8:c=wt;break;case 32:c=gt;break;case 268435456:c=ir;break;default:c=gt}return f=wS.bind(null,r),c=Le(c,f),r.callbackPriority=a,r.callbackNode=c,a}return f!==null&&f!==null&&We(f),r.callbackPriority=2,r.callbackNode=null,2}function wS(r,a){if(fn!==0&&fn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(Qd()&&r.callbackNode!==c)return null;var f=lt;return f=De(r,r===Rt?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(nS(r,f,a),bS(r,ut()),r.callbackNode!=null&&r.callbackNode===c?wS.bind(null,r):null)}function SS(r,a){if(Qd())return null;nS(r,a,!0)}function $A(){KA(function(){(xt&6)!==0?Le(Xe,IA):yS()})}function ag(){if(Ma===0){var r=xi;r===0&&(r=ke,ke<<=1,(ke&261888)===0&&(ke=256)),Ma=r}return Ma}function jS(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:od(""+r)}function CS(r,a){var c=a.ownerDocument.createElement("input");return c.name=a.name,c.value=a.value,r.id&&c.setAttribute("form",r.id),a.parentNode.insertBefore(c,a),r=new FormData(r),c.parentNode.removeChild(c),r}function FA(r,a,c,f,x){if(a==="submit"&&c&&c.stateNode===x){var b=jS((x[Wn]||null).action),k=f.submitter;k&&(a=(a=k[Wn]||null)?jS(a.formAction):k.getAttribute("formAction"),a!==null&&(b=a,k=null));var P=new ud("action","action",null,f,x);r.push({event:P,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Ma!==0){var V=k?CS(x,k):new FormData(x);Np(c,{pending:!0,data:V,method:x.method,action:b},null,V)}}else typeof b=="function"&&(P.preventDefault(),V=k?CS(x,k):new FormData(x),Np(c,{pending:!0,data:V,method:x.method,action:b},b,V))},currentTarget:x}]})}}for(var og=0;og<Um.length;og++){var ig=Um[og],BA=ig.toLowerCase(),UA=ig[0].toUpperCase()+ig.slice(1);Gr(BA,"on"+UA)}Gr(t0,"onAnimationEnd"),Gr(n0,"onAnimationIteration"),Gr(r0,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(sA,"onTransitionRun"),Gr(aA,"onTransitionStart"),Gr(oA,"onTransitionCancel"),Gr(s0,"onTransitionEnd"),si("onMouseEnter",["mouseout","mouseover"]),si("onMouseLeave",["mouseout","mouseover"]),si("onPointerEnter",["pointerout","pointerover"]),si("onPointerLeave",["pointerout","pointerover"]),ao("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ao("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ao("onBeforeInput",["compositionend","keypress","textInput","paste"]),ao("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ao("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ao("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kc="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(" "),VA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kc));function NS(r,a){a=(a&4)!==0;for(var c=0;c<r.length;c++){var f=r[c],x=f.event;f=f.listeners;e:{var b=void 0;if(a)for(var k=f.length-1;0<=k;k--){var P=f[k],V=P.instance,se=P.currentTarget;if(P=P.listener,V!==b&&x.isPropagationStopped())break e;b=P,x.currentTarget=se;try{b(x)}catch(ce){hd(ce)}x.currentTarget=null,b=V}else for(k=0;k<f.length;k++){if(P=f[k],V=P.instance,se=P.currentTarget,P=P.listener,V!==b&&x.isPropagationStopped())break e;b=P,x.currentTarget=se;try{b(x)}catch(ce){hd(ce)}x.currentTarget=null,b=V}}}}function ot(r,a){var c=a[bm];c===void 0&&(c=a[bm]=new Set);var f=r+"__bubble";c.has(f)||(kS(a,r,2,!1),c.add(f))}function lg(r,a,c){var f=0;a&&(f|=4),kS(c,r,f,a)}var Jd="_reactListening"+Math.random().toString(36).slice(2);function cg(r){if(!r[Jd]){r[Jd]=!0,yb.forEach(function(c){c!=="selectionchange"&&(VA.has(c)||lg(c,!1,r),lg(c,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[Jd]||(a[Jd]=!0,lg("selectionchange",!1,a))}}function kS(r,a,c,f){switch(t1(a)){case 2:var x=vO;break;case 8:x=xO;break;default:x=Cg}c=x.bind(null,a,c,r),x=void 0,!Tm||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(x=!0),f?x!==void 0?r.addEventListener(a,c,{capture:!0,passive:x}):r.addEventListener(a,c,!0):x!==void 0?r.addEventListener(a,c,{passive:x}):r.addEventListener(a,c,!1)}function ug(r,a,c,f,x){var b=f;if((a&1)===0&&(a&2)===0&&f!==null)e:for(;;){if(f===null)return;var k=f.tag;if(k===3||k===4){var P=f.stateNode.containerInfo;if(P===x)break;if(k===4)for(k=f.return;k!==null;){var V=k.tag;if((V===3||V===4)&&k.stateNode.containerInfo===x)return;k=k.return}for(;P!==null;){if(k=ti(P),k===null)return;if(V=k.tag,V===5||V===6||V===26||V===27){f=b=k;continue e}P=P.parentNode}}f=f.return}Rb(function(){var se=b,ce=_m(c),he=[];e:{var oe=a0.get(r);if(oe!==void 0){var ie=ud,Ee=r;switch(r){case"keypress":if(ld(c)===0)break e;case"keydown":case"keyup":ie=PR;break;case"focusin":Ee="focus",ie=Om;break;case"focusout":Ee="blur",ie=Om;break;case"beforeblur":case"afterblur":ie=Om;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Db;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=CR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=$R;break;case t0:case n0:case r0:ie=_R;break;case s0:ie=BR;break;case"scroll":case"scrollend":ie=SR;break;case"wheel":ie=VR;break;case"copy":case"cut":case"paste":ie=TR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Pb;break;case"toggle":case"beforetoggle":ie=HR}var qe=(a&4)!==0,Tt=!qe&&(r==="scroll"||r==="scrollend"),J=qe?oe!==null?oe+"Capture":null:oe;qe=[];for(var Z=se,re;Z!==null;){var de=Z;if(re=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||re===null||J===null||(de=Gl(Z,J),de!=null&&qe.push(_c(Z,de,re))),Tt)break;Z=Z.return}0<qe.length&&(oe=new ie(oe,Ee,null,c,ce),he.push({event:oe,listeners:qe}))}}if((a&7)===0){e:{if(oe=r==="mouseover"||r==="pointerover",ie=r==="mouseout"||r==="pointerout",oe&&c!==km&&(Ee=c.relatedTarget||c.fromElement)&&(ti(Ee)||Ee[ei]))break e;if((ie||oe)&&(oe=ce.window===ce?ce:(oe=ce.ownerDocument)?oe.defaultView||oe.parentWindow:window,ie?(Ee=c.relatedTarget||c.toElement,ie=se,Ee=Ee?ti(Ee):null,Ee!==null&&(Tt=l(Ee),qe=Ee.tag,Ee!==Tt||qe!==5&&qe!==27&&qe!==6)&&(Ee=null)):(ie=null,Ee=se),ie!==Ee)){if(qe=Db,de="onMouseLeave",J="onMouseEnter",Z="mouse",(r==="pointerout"||r==="pointerover")&&(qe=Pb,de="onPointerLeave",J="onPointerEnter",Z="pointer"),Tt=ie==null?oe:Wl(ie),re=Ee==null?oe:Wl(Ee),oe=new qe(de,Z+"leave",ie,c,ce),oe.target=Tt,oe.relatedTarget=re,de=null,ti(ce)===se&&(qe=new qe(J,Z+"enter",Ee,c,ce),qe.target=re,qe.relatedTarget=Tt,de=qe),Tt=de,ie&&Ee)t:{for(qe=qA,J=ie,Z=Ee,re=0,de=J;de;de=qe(de))re++;de=0;for(var Ie=Z;Ie;Ie=qe(Ie))de++;for(;0<re-de;)J=qe(J),re--;for(;0<de-re;)Z=qe(Z),de--;for(;re--;){if(J===Z||Z!==null&&J===Z.alternate){qe=J;break t}J=qe(J),Z=qe(Z)}qe=null}else qe=null;ie!==null&&_S(he,oe,ie,qe,!1),Ee!==null&&Tt!==null&&_S(he,Tt,Ee,qe,!0)}}e:{if(oe=se?Wl(se):window,ie=oe.nodeName&&oe.nodeName.toLowerCase(),ie==="select"||ie==="input"&&oe.type==="file")var ht=qb;else if(Ub(oe))if(Hb)ht=tA;else{ht=JR;var Ae=XR}else ie=oe.nodeName,!ie||ie.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?se&&Nm(se.elementType)&&(ht=qb):ht=eA;if(ht&&(ht=ht(r,se))){Vb(he,ht,c,ce);break e}Ae&&Ae(r,oe,se),r==="focusout"&&se&&oe.type==="number"&&se.memoizedProps.value!=null&&Cm(oe,"number",oe.value)}switch(Ae=se?Wl(se):window,r){case"focusin":(Ub(Ae)||Ae.contentEditable==="true")&&(ui=Ae,$m=se,nc=null);break;case"focusout":nc=$m=ui=null;break;case"mousedown":Fm=!0;break;case"contextmenu":case"mouseup":case"dragend":Fm=!1,Jb(he,c,ce);break;case"selectionchange":if(rA)break;case"keydown":case"keyup":Jb(he,c,ce)}var et;if(zm)e:{switch(r){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else ci?Fb(r,c)&&(ct="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(ct="onCompositionStart");ct&&(Lb&&c.locale!=="ko"&&(ci||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&ci&&(et=Ab()):(ma=ce,Mm="value"in ma?ma.value:ma.textContent,ci=!0)),Ae=ef(se,ct),0<Ae.length&&(ct=new zb(ct,r,null,c,ce),he.push({event:ct,listeners:Ae}),et?ct.data=et:(et=Bb(c),et!==null&&(ct.data=et)))),(et=WR?GR(r,c):ZR(r,c))&&(ct=ef(se,"onBeforeInput"),0<ct.length&&(Ae=new zb("onBeforeInput","beforeinput",null,c,ce),he.push({event:Ae,listeners:ct}),Ae.data=et)),FA(he,r,se,c,ce)}NS(he,a)})}function _c(r,a,c){return{instance:r,listener:a,currentTarget:c}}function ef(r,a){for(var c=a+"Capture",f=[];r!==null;){var x=r,b=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||b===null||(x=Gl(r,c),x!=null&&f.unshift(_c(r,x,b)),x=Gl(r,a),x!=null&&f.push(_c(r,x,b))),r.tag===3)return f;r=r.return}return[]}function qA(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function _S(r,a,c,f,x){for(var b=a._reactName,k=[];c!==null&&c!==f;){var P=c,V=P.alternate,se=P.stateNode;if(P=P.tag,V!==null&&V===f)break;P!==5&&P!==26&&P!==27||se===null||(V=se,x?(se=Gl(c,b),se!=null&&k.unshift(_c(c,se,V))):x||(se=Gl(c,b),se!=null&&k.push(_c(c,se,V)))),c=c.return}k.length!==0&&r.push({event:a,listeners:k})}var HA=/\r\n?/g,YA=/\u0000|\uFFFD/g;function ES(r){return(typeof r=="string"?r:""+r).replace(HA,`
9
9
  `).replace(YA,"")}function TS(r,a){return a=ES(a),ES(r)===a}function Et(r,a,c,f,x,b){switch(c){case"children":typeof f=="string"?a==="body"||a==="textarea"&&f===""||oi(r,f):(typeof f=="number"||typeof f=="bigint")&&a!=="body"&&oi(r,""+f);break;case"className":sd(r,"class",f);break;case"tabIndex":sd(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":sd(r,c,f);break;case"style":Tb(r,f,b);break;case"data":if(a!=="object"){sd(r,"data",f);break}case"src":case"href":if(f===""&&(a!=="a"||c!=="href")){r.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(c);break}f=od(""+f),r.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(c,"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 b=="function"&&(c==="formAction"?(a!=="input"&&Et(r,a,"name",x.name,x,null),Et(r,a,"formEncType",x.formEncType,x,null),Et(r,a,"formMethod",x.formMethod,x,null),Et(r,a,"formTarget",x.formTarget,x,null)):(Et(r,a,"encType",x.encType,x,null),Et(r,a,"method",x.method,x,null),Et(r,a,"target",x.target,x,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(c);break}f=od(""+f),r.setAttribute(c,f);break;case"onClick":f!=null&&(r.onclick=Ds);break;case"onScroll":f!=null&&ot("scroll",r);break;case"onScrollEnd":f!=null&&ot("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(s(61));if(c=f.__html,c!=null){if(x.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.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"){r.removeAttribute("xlink:href");break}c=od(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);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"?r.setAttribute(c,""+f):r.removeAttribute(c);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"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":f===!0?r.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(c,f):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(c,f):r.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(c):r.setAttribute(c,f);break;case"popover":ot("beforetoggle",r),ot("toggle",r),rd(r,"popover",f);break;case"xlinkActuate":Os(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Os(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Os(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Os(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Os(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Os(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Os(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Os(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Os(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":rd(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=bR.get(c)||c,rd(r,c,f))}}function dg(r,a,c,f,x,b){switch(c){case"style":Tb(r,f,b);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(s(61));if(c=f.__html,c!=null){if(x.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof f=="string"?oi(r,f):(typeof f=="number"||typeof f=="bigint")&&oi(r,""+f);break;case"onScroll":f!=null&&ot("scroll",r);break;case"onScrollEnd":f!=null&&ot("scrollend",r);break;case"onClick":f!=null&&(r.onclick=Ds);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bb.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(x=c.endsWith("Capture"),a=c.slice(2,x?c.length-7:void 0),b=r[Wn]||null,b=b!=null?b[c]:null,typeof b=="function"&&r.removeEventListener(a,b,x),typeof f=="function")){typeof b!="function"&&b!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(a,f,x);break e}c in r?r[c]=f:f===!0?r.setAttribute(c,""):rd(r,c,f)}}}function Tn(r,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",r),ot("load",r);var f=!1,x=!1,b;for(b in c)if(c.hasOwnProperty(b)){var k=c[b];if(k!=null)switch(b){case"src":f=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Et(r,a,b,k,c,null)}}x&&Et(r,a,"srcSet",c.srcSet,c,null),f&&Et(r,a,"src",c.src,c,null);return;case"input":ot("invalid",r);var P=b=k=x=null,V=null,se=null;for(f in c)if(c.hasOwnProperty(f)){var ce=c[f];if(ce!=null)switch(f){case"name":x=ce;break;case"type":k=ce;break;case"checked":V=ce;break;case"defaultChecked":se=ce;break;case"value":b=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,a));break;default:Et(r,a,f,ce,c,null)}}Nb(r,b,P,V,se,k,x,!1);return;case"select":ot("invalid",r),f=k=b=null;for(x in c)if(c.hasOwnProperty(x)&&(P=c[x],P!=null))switch(x){case"value":b=P;break;case"defaultValue":k=P;break;case"multiple":f=P;default:Et(r,a,x,P,c,null)}a=b,c=k,r.multiple=!!f,a!=null?ai(r,!!f,a,!1):c!=null&&ai(r,!!f,c,!0);return;case"textarea":ot("invalid",r),b=x=f=null;for(k in c)if(c.hasOwnProperty(k)&&(P=c[k],P!=null))switch(k){case"value":f=P;break;case"defaultValue":x=P;break;case"children":b=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(s(91));break;default:Et(r,a,k,P,c,null)}_b(r,f,x,b);return;case"option":for(V in c)c.hasOwnProperty(V)&&(f=c[V],f!=null)&&(V==="selected"?r.selected=f&&typeof f!="function"&&typeof f!="symbol":Et(r,a,V,f,c,null));return;case"dialog":ot("beforetoggle",r),ot("toggle",r),ot("cancel",r),ot("close",r);break;case"iframe":case"object":ot("load",r);break;case"video":case"audio":for(f=0;f<kc.length;f++)ot(kc[f],r);break;case"image":ot("error",r),ot("load",r);break;case"details":ot("toggle",r);break;case"embed":case"source":case"link":ot("error",r),ot("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in c)if(c.hasOwnProperty(se)&&(f=c[se],f!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Et(r,a,se,f,c,null)}return;default:if(Nm(a)){for(ce in c)c.hasOwnProperty(ce)&&(f=c[ce],f!==void 0&&dg(r,a,ce,f,c,void 0));return}}for(P in c)c.hasOwnProperty(P)&&(f=c[P],f!=null&&Et(r,a,P,f,c,null))}function WA(r,a,c,f){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,b=null,k=null,P=null,V=null,se=null,ce=null;for(ie in c){var he=c[ie];if(c.hasOwnProperty(ie)&&he!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":V=he;default:f.hasOwnProperty(ie)||Et(r,a,ie,null,f,he)}}for(var oe in f){var ie=f[oe];if(he=c[oe],f.hasOwnProperty(oe)&&(ie!=null||he!=null))switch(oe){case"type":b=ie;break;case"name":x=ie;break;case"checked":se=ie;break;case"defaultChecked":ce=ie;break;case"value":k=ie;break;case"defaultValue":P=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,a));break;default:ie!==he&&Et(r,a,oe,ie,f,he)}}jm(r,k,P,V,se,ce,b,x);return;case"select":ie=k=P=oe=null;for(b in c)if(V=c[b],c.hasOwnProperty(b)&&V!=null)switch(b){case"value":break;case"multiple":ie=V;default:f.hasOwnProperty(b)||Et(r,a,b,null,f,V)}for(x in f)if(b=f[x],V=c[x],f.hasOwnProperty(x)&&(b!=null||V!=null))switch(x){case"value":oe=b;break;case"defaultValue":P=b;break;case"multiple":k=b;default:b!==V&&Et(r,a,x,b,f,V)}a=P,c=k,f=ie,oe!=null?ai(r,!!c,oe,!1):!!f!=!!c&&(a!=null?ai(r,!!c,a,!0):ai(r,!!c,c?[]:"",!1));return;case"textarea":ie=oe=null;for(P in c)if(x=c[P],c.hasOwnProperty(P)&&x!=null&&!f.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Et(r,a,P,null,f,x)}for(k in f)if(x=f[k],b=c[k],f.hasOwnProperty(k)&&(x!=null||b!=null))switch(k){case"value":oe=x;break;case"defaultValue":ie=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(s(91));break;default:x!==b&&Et(r,a,k,x,f,b)}kb(r,oe,ie);return;case"option":for(var Ee in c)oe=c[Ee],c.hasOwnProperty(Ee)&&oe!=null&&!f.hasOwnProperty(Ee)&&(Ee==="selected"?r.selected=!1:Et(r,a,Ee,null,f,oe));for(V in f)oe=f[V],ie=c[V],f.hasOwnProperty(V)&&oe!==ie&&(oe!=null||ie!=null)&&(V==="selected"?r.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":Et(r,a,V,oe,f,ie));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 qe in c)oe=c[qe],c.hasOwnProperty(qe)&&oe!=null&&!f.hasOwnProperty(qe)&&Et(r,a,qe,null,f,oe);for(se in f)if(oe=f[se],ie=c[se],f.hasOwnProperty(se)&&oe!==ie&&(oe!=null||ie!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,a));break;default:Et(r,a,se,oe,f,ie)}return;default:if(Nm(a)){for(var Tt in c)oe=c[Tt],c.hasOwnProperty(Tt)&&oe!==void 0&&!f.hasOwnProperty(Tt)&&dg(r,a,Tt,void 0,f,oe);for(ce in f)oe=f[ce],ie=c[ce],!f.hasOwnProperty(ce)||oe===ie||oe===void 0&&ie===void 0||dg(r,a,ce,oe,f,ie);return}}for(var J in c)oe=c[J],c.hasOwnProperty(J)&&oe!=null&&!f.hasOwnProperty(J)&&Et(r,a,J,null,f,oe);for(he in f)oe=f[he],ie=c[he],!f.hasOwnProperty(he)||oe===ie||oe==null&&ie==null||Et(r,a,he,oe,f,ie)}function MS(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function GA(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var x=c[f],b=x.transferSize,k=x.initiatorType,P=x.duration;if(b&&P&&MS(k)){for(k=0,P=x.responseEnd,f+=1;f<c.length;f++){var V=c[f],se=V.startTime;if(se>P)break;var ce=V.transferSize,he=V.initiatorType;ce&&MS(he)&&(V=V.responseEnd,k+=ce*(V<P?1:(P-se)/(V-se)))}if(--f,a+=8*(b+k)/(x.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var fg=null,hg=null;function tf(r){return r.nodeType===9?r:r.ownerDocument}function RS(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function AS(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function mg(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var pg=null;function ZA(){var r=window.event;return r&&r.type==="popstate"?r===pg?!1:(pg=r,!0):(pg=null,!1)}var OS=typeof setTimeout=="function"?setTimeout:void 0,QA=typeof clearTimeout=="function"?clearTimeout:void 0,DS=typeof Promise=="function"?Promise:void 0,KA=typeof queueMicrotask=="function"?queueMicrotask:typeof DS<"u"?function(r){return DS.resolve(null).then(r).catch(XA)}:OS;function XA(r){setTimeout(function(){throw r})}function Ra(r){return r==="head"}function zS(r,a){var c=a,f=0;do{var x=c.nextSibling;if(r.removeChild(c),x&&x.nodeType===8)if(c=x.data,c==="/$"||c==="/&"){if(f===0){r.removeChild(x),Li(a);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")Ec(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Ec(c);for(var b=c.firstChild;b;){var k=b.nextSibling,P=b.nodeName;b[Yl]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&b.rel.toLowerCase()==="stylesheet"||c.removeChild(b),b=k}}else c==="body"&&Ec(r.ownerDocument.body);c=x}while(c);Li(a)}function PS(r,a){var c=r;r=0;do{var f=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=f}while(c)}function gg(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":gg(c),wm(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function JA(r,a,c,f){for(;r.nodeType===1;){var x=c;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[Yl])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(b=r.getAttribute("rel"),b==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(b!==x.rel||r.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||r.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||r.getAttribute("title")!==(x.title==null?null:x.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(b=r.getAttribute("src"),(b!==(x.src==null?null:x.src)||r.getAttribute("type")!==(x.type==null?null:x.type)||r.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&b&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var b=x.name==null?null:""+x.name;if(x.type==="hidden"&&r.getAttribute("name")===b)return r}else return r;if(r=Dr(r.nextSibling),r===null)break}return null}function eO(r,a,c){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Dr(r.nextSibling),r===null))return null;return r}function LS(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=Dr(r.nextSibling),r===null))return null;return r}function vg(r){return r.data==="$?"||r.data==="$~"}function xg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function tO(r,a){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||c.readyState!=="loading")a();else{var f=function(){a(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function Dr(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var yg=null;function IS(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(a===0)return Dr(r.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}r=r.nextSibling}return null}function $S(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return r;a--}else c!=="/$"&&c!=="/&"||a++}r=r.previousSibling}return null}function FS(r,a,c){switch(a=tf(c),r){case"html":if(r=a.documentElement,!r)throw Error(s(452));return r;case"head":if(r=a.head,!r)throw Error(s(453));return r;case"body":if(r=a.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function Ec(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);wm(r)}var zr=new Map,BS=new Set;function nf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Qs=$.d;$.d={f:nO,r:rO,D:sO,C:aO,L:oO,m:iO,X:cO,S:lO,M:uO};function nO(){var r=Qs.f(),a=Wd();return r||a}function rO(r){var a=ni(r);a!==null&&a.tag===5&&a.type==="form"?sw(a):Qs.r(r)}var Di=typeof document>"u"?null:document;function US(r,a,c){var f=Di;if(f&&typeof a=="string"&&a){var x=_r(a);x='link[rel="'+r+'"][href="'+x+'"]',typeof c=="string"&&(x+='[crossorigin="'+c+'"]'),BS.has(x)||(BS.add(x),r={rel:r,crossOrigin:c,href:a},f.querySelector(x)===null&&(a=f.createElement("link"),Tn(a,"link",r),Sn(a),f.head.appendChild(a)))}}function sO(r){Qs.D(r),US("dns-prefetch",r,null)}function aO(r,a){Qs.C(r,a),US("preconnect",r,a)}function oO(r,a,c){Qs.L(r,a,c);var f=Di;if(f&&r&&a){var x='link[rel="preload"][as="'+_r(a)+'"]';a==="image"&&c&&c.imageSrcSet?(x+='[imagesrcset="'+_r(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(x+='[imagesizes="'+_r(c.imageSizes)+'"]')):x+='[href="'+_r(r)+'"]';var b=x;switch(a){case"style":b=zi(r);break;case"script":b=Pi(r)}zr.has(b)||(r=g({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:r,as:a},c),zr.set(b,r),f.querySelector(x)!==null||a==="style"&&f.querySelector(Tc(b))||a==="script"&&f.querySelector(Mc(b))||(a=f.createElement("link"),Tn(a,"link",r),Sn(a),f.head.appendChild(a)))}}function iO(r,a){Qs.m(r,a);var c=Di;if(c&&r){var f=a&&typeof a.as=="string"?a.as:"script",x='link[rel="modulepreload"][as="'+_r(f)+'"][href="'+_r(r)+'"]',b=x;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Pi(r)}if(!zr.has(b)&&(r=g({rel:"modulepreload",href:r},a),zr.set(b,r),c.querySelector(x)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Mc(b)))return}f=c.createElement("link"),Tn(f,"link",r),Sn(f),c.head.appendChild(f)}}}function lO(r,a,c){Qs.S(r,a,c);var f=Di;if(f&&r){var x=ri(f).hoistableStyles,b=zi(r);a=a||"default";var k=x.get(b);if(!k){var P={loading:0,preload:null};if(k=f.querySelector(Tc(b)))P.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":a},c),(c=zr.get(b))&&bg(r,c);var V=k=f.createElement("link");Sn(V),Tn(V,"link",r),V._p=new Promise(function(se,ce){V.onload=se,V.onerror=ce}),V.addEventListener("load",function(){P.loading|=1}),V.addEventListener("error",function(){P.loading|=2}),P.loading|=4,rf(k,a,f)}k={type:"stylesheet",instance:k,count:1,state:P},x.set(b,k)}}}function cO(r,a){Qs.X(r,a);var c=Di;if(c&&r){var f=ri(c).hoistableScripts,x=Pi(r),b=f.get(x);b||(b=c.querySelector(Mc(x)),b||(r=g({src:r,async:!0},a),(a=zr.get(x))&&wg(r,a),b=c.createElement("script"),Sn(b),Tn(b,"link",r),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(x,b))}}function uO(r,a){Qs.M(r,a);var c=Di;if(c&&r){var f=ri(c).hoistableScripts,x=Pi(r),b=f.get(x);b||(b=c.querySelector(Mc(x)),b||(r=g({src:r,async:!0,type:"module"},a),(a=zr.get(x))&&wg(r,a),b=c.createElement("script"),Sn(b),Tn(b,"link",r),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(x,b))}}function VS(r,a,c,f){var x=(x=ue.current)?nf(x):null;if(!x)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(a=zi(c.href),c=ri(x).hoistableStyles,f=c.get(a),f||(f={type:"style",instance:null,count:0,state:null},c.set(a,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=zi(c.href);var b=ri(x).hoistableStyles,k=b.get(r);if(k||(x=x.ownerDocument||x,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(r,k),(b=x.querySelector(Tc(r)))&&!b._p&&(k.instance=b,k.state.loading=5),zr.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},zr.set(r,c),b||dO(x,r,c,k.state))),a&&f===null)throw Error(s(528,""));return k}if(a&&f!==null)throw Error(s(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Pi(c),c=ri(x).hoistableScripts,f=c.get(a),f||(f={type:"script",instance:null,count:0,state:null},c.set(a,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function zi(r){return'href="'+_r(r)+'"'}function Tc(r){return'link[rel="stylesheet"]['+r+"]"}function qS(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function dO(r,a,c,f){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?f.loading=1:(a=r.createElement("link"),f.preload=a,a.addEventListener("load",function(){return f.loading|=1}),a.addEventListener("error",function(){return f.loading|=2}),Tn(a,"link",c),Sn(a),r.head.appendChild(a))}function Pi(r){return'[src="'+_r(r)+'"]'}function Mc(r){return"script[async]"+r}function HS(r,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var f=r.querySelector('style[data-href~="'+_r(c.href)+'"]');if(f)return a.instance=f,Sn(f),f;var x=g({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),Sn(f),Tn(f,"style",x),rf(f,c.precedence,r),a.instance=f;case"stylesheet":x=zi(c.href);var b=r.querySelector(Tc(x));if(b)return a.state.loading|=4,a.instance=b,Sn(b),b;f=qS(c),(x=zr.get(x))&&bg(f,x),b=(r.ownerDocument||r).createElement("link"),Sn(b);var k=b;return k._p=new Promise(function(P,V){k.onload=P,k.onerror=V}),Tn(b,"link",f),a.state.loading|=4,rf(b,c.precedence,r),a.instance=b;case"script":return b=Pi(c.src),(x=r.querySelector(Mc(b)))?(a.instance=x,Sn(x),x):(f=c,(x=zr.get(b))&&(f=g({},c),wg(f,x)),r=r.ownerDocument||r,x=r.createElement("script"),Sn(x),Tn(x,"link",f),r.head.appendChild(x),a.instance=x);case"void":return null;default:throw Error(s(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(f=a.instance,a.state.loading|=4,rf(f,c.precedence,r));return a.instance}function rf(r,a,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=f.length?f[f.length-1]:null,b=x,k=0;k<f.length;k++){var P=f[k];if(P.dataset.precedence===a)b=P;else if(b!==x)break}b?b.parentNode.insertBefore(r,b.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(r,a.firstChild))}function bg(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function wg(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var sf=null;function YS(r,a,c){if(sf===null){var f=new Map,x=sf=new Map;x.set(c,f)}else x=sf,f=x.get(c),f||(f=new Map,x.set(c,f));if(f.has(r))return f;for(f.set(r,null),c=c.getElementsByTagName(r),x=0;x<c.length;x++){var b=c[x];if(!(b[Yl]||b[Zt]||r==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var k=b.getAttribute(a)||"";k=r+k;var P=f.get(k);P?P.push(b):f.set(k,[b])}}return f}function WS(r,a,c){r=r.ownerDocument||r,r.head.insertBefore(c,a==="title"?r.querySelector("head > title"):null)}function fO(r,a,c){if(c===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(r=a.disabled,typeof a.precedence=="string"&&r==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function GS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function hO(r,a,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var x=zi(f.href),b=a.querySelector(Tc(x));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=af.bind(r),a.then(r,r)),c.state.loading|=4,c.instance=b,Sn(b);return}b=a.ownerDocument||a,f=qS(f),(x=zr.get(x))&&bg(f,x),b=b.createElement("link"),Sn(b);var k=b;k._p=new Promise(function(P,V){k.onload=P,k.onerror=V}),Tn(b,"link",f),c.instance=b}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=af.bind(r),a.addEventListener("load",c),a.addEventListener("error",c))}}var Sg=0;function mO(r,a){return r.stylesheets&&r.count===0&&lf(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var f=setTimeout(function(){if(r.stylesheets&&lf(r,r.stylesheets),r.unsuspend){var b=r.unsuspend;r.unsuspend=null,b()}},6e4+a);0<r.imgBytes&&Sg===0&&(Sg=62500*GA());var x=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&lf(r,r.stylesheets),r.unsuspend)){var b=r.unsuspend;r.unsuspend=null,b()}},(r.imgBytes>Sg?50:800)+a);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(f),clearTimeout(x)}}:null}function af(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var of=null;function lf(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,of=new Map,a.forEach(pO,r),of=null,af.call(r))}function pO(r,a){if(!(a.state.loading&4)){var c=of.get(r);if(c)var f=c.get(null);else{c=new Map,of.set(r,c);for(var x=r.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<x.length;b++){var k=x[b];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(c.set(k.dataset.precedence,k),f=k)}f&&c.set(null,f)}x=a.instance,k=x.getAttribute("data-precedence"),b=c.get(k)||f,b===f&&c.set(null,x),c.set(k,x),this.count++,f=af.bind(this),x.addEventListener("load",f),x.addEventListener("error",f),b?b.parentNode.insertBefore(x,b.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(x,r.firstChild)),a.state.loading|=4}}var Rc={$$typeof:E,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function gO(r,a,c,f,x,b,k,P,V){this.tag=1,this.containerInfo=r,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=Gt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gt(0),this.hiddenUpdates=Gt(null),this.identifierPrefix=f,this.onUncaughtError=x,this.onCaughtError=b,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function ZS(r,a,c,f,x,b,k,P,V,se,ce,he){return r=new gO(r,a,c,k,V,se,ce,he,P),a=1,b===!0&&(a|=24),b=cr(3,null,null,a),r.current=b,b.stateNode=r,a=tp(),a.refCount++,r.pooledCache=a,a.refCount++,b.memoizedState={element:f,isDehydrated:c,cache:a},ap(b),r}function QS(r){return r?(r=hi,r):hi}function KS(r,a,c,f,x,b){x=QS(x),f.context===null?f.context=x:f.pendingContext=x,f=ba(a),f.payload={element:c},b=b===void 0?null:b,b!==null&&(f.callback=b),c=wa(r,f,a),c!==null&&(Jn(c,r,a),cc(c,r,a))}function XS(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<a?c:a}}function jg(r,a){XS(r,a),(r=r.alternate)&&XS(r,a)}function JS(r){if(r.tag===13||r.tag===31){var a=co(r,67108864);a!==null&&Jn(a,r,67108864),jg(r,67108864)}}function e1(r){if(r.tag===13||r.tag===31){var a=mr();a=je(a);var c=co(r,a);c!==null&&Jn(c,r,a),jg(r,a)}}var cf=!0;function vO(r,a,c,f){var x=L.T;L.T=null;var b=$.p;try{$.p=2,Cg(r,a,c,f)}finally{$.p=b,L.T=x}}function xO(r,a,c,f){var x=L.T;L.T=null;var b=$.p;try{$.p=8,Cg(r,a,c,f)}finally{$.p=b,L.T=x}}function Cg(r,a,c,f){if(cf){var x=Ng(f);if(x===null)ug(r,a,f,uf,c),n1(r,f);else if(bO(x,r,a,c,f))f.stopPropagation();else if(n1(r,f),a&4&&-1<yO.indexOf(r)){for(;x!==null;){var b=ni(x);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var k=He(b.pendingLanes);if(k!==0){var P=b;for(P.pendingLanes|=2,P.entangledLanes|=2;k;){var V=1<<31-$t(k);P.entanglements[1]|=V,k&=~V}ps(b),(xt&6)===0&&(Hd=ut()+500,Nc(0))}}break;case 31:case 13:P=co(b,2),P!==null&&Jn(P,b,2),Wd(),jg(b,2)}if(b=Ng(f),b===null&&ug(r,a,f,uf,c),b===x)break;x=b}x!==null&&f.stopPropagation()}else ug(r,a,f,null,c)}}function Ng(r){return r=_m(r),kg(r)}var uf=null;function kg(r){if(uf=null,r=ti(r),r!==null){var a=l(r);if(a===null)r=null;else{var c=a.tag;if(c===13){if(r=u(a),r!==null)return r;r=null}else if(c===31){if(r=d(a),r!==null)return r;r=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return uf=r,null}function t1(r){switch(r){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(Mn()){case Xe:return 2;case wt:return 8;case gt:case qn:return 32;case ir:return 268435456;default:return 32}default:return 32}}var _g=!1,Aa=null,Oa=null,Da=null,Ac=new Map,Oc=new Map,za=[],yO="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 n1(r,a){switch(r){case"focusin":case"focusout":Aa=null;break;case"dragenter":case"dragleave":Oa=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":Ac.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oc.delete(a.pointerId)}}function Dc(r,a,c,f,x,b){return r===null||r.nativeEvent!==b?(r={blockedOn:a,domEventName:c,eventSystemFlags:f,nativeEvent:b,targetContainers:[x]},a!==null&&(a=ni(a),a!==null&&JS(a)),r):(r.eventSystemFlags|=f,a=r.targetContainers,x!==null&&a.indexOf(x)===-1&&a.push(x),r)}function bO(r,a,c,f,x){switch(a){case"focusin":return Aa=Dc(Aa,r,a,c,f,x),!0;case"dragenter":return Oa=Dc(Oa,r,a,c,f,x),!0;case"mouseover":return Da=Dc(Da,r,a,c,f,x),!0;case"pointerover":var b=x.pointerId;return Ac.set(b,Dc(Ac.get(b)||null,r,a,c,f,x)),!0;case"gotpointercapture":return b=x.pointerId,Oc.set(b,Dc(Oc.get(b)||null,r,a,c,f,x)),!0}return!1}function r1(r){var a=ti(r.target);if(a!==null){var c=l(a);if(c!==null){if(a=c.tag,a===13){if(a=u(c),a!==null){r.blockedOn=a,Je(r.priority,function(){e1(c)});return}}else if(a===31){if(a=d(c),a!==null){r.blockedOn=a,Je(r.priority,function(){e1(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function df(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var c=Ng(r.nativeEvent);if(c===null){c=r.nativeEvent;var f=new c.constructor(c.type,c);km=f,c.target.dispatchEvent(f),km=null}else return a=ni(c),a!==null&&JS(a),r.blockedOn=c,!1;a.shift()}return!0}function s1(r,a,c){df(r)&&c.delete(a)}function wO(){_g=!1,Aa!==null&&df(Aa)&&(Aa=null),Oa!==null&&df(Oa)&&(Oa=null),Da!==null&&df(Da)&&(Da=null),Ac.forEach(s1),Oc.forEach(s1)}function ff(r,a){r.blockedOn===a&&(r.blockedOn=null,_g||(_g=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,wO)))}var hf=null;function a1(r){hf!==r&&(hf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){hf===r&&(hf=null);for(var a=0;a<r.length;a+=3){var c=r[a],f=r[a+1],x=r[a+2];if(typeof f!="function"){if(kg(f||c)===null)continue;break}var b=ni(c);b!==null&&(r.splice(a,3),a-=3,Np(b,{pending:!0,data:x,method:c.method,action:f},f,x))}}))}function Li(r){function a(V){return ff(V,r)}Aa!==null&&ff(Aa,r),Oa!==null&&ff(Oa,r),Da!==null&&ff(Da,r),Ac.forEach(a),Oc.forEach(a);for(var c=0;c<za.length;c++){var f=za[c];f.blockedOn===r&&(f.blockedOn=null)}for(;0<za.length&&(c=za[0],c.blockedOn===null);)r1(c),c.blockedOn===null&&za.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var x=c[f],b=c[f+1],k=x[Wn]||null;if(typeof b=="function")k||a1(c);else if(k){var P=null;if(b&&b.hasAttribute("formAction")){if(x=b,k=b[Wn]||null)P=k.formAction;else if(kg(x)!==null)continue}else P=k.action;typeof P=="function"?c[f+1]=P:(c.splice(f,3),f-=3),a1(c)}}}function o1(){function r(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(k){return x=k})},focusReset:"manual",scroll:"manual"})}function a(){x!==null&&(x(),x=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,x=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),x!==null&&(x(),x=null)}}}function Eg(r){this._internalRoot=r}mf.prototype.render=Eg.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(s(409));var c=a.current,f=mr();KS(c,f,r,a,null,null)},mf.prototype.unmount=Eg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;KS(r.current,2,null,r,null,null),Wd(),a[ei]=null}};function mf(r){this._internalRoot=r}mf.prototype.unstable_scheduleHydration=function(r){if(r){var a=vt();r={blockedOn:null,target:r,priority:a};for(var c=0;c<za.length&&a!==0&&a<za[c].priority;c++);za.splice(c,0,r),c===0&&r1(r)}};var i1=t.version;if(i1!=="19.2.4")throw Error(s(527,i1,"19.2.4"));$.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=m(a),r=r!==null?v(r):null,r=r===null?null:r.stateNode,r};var SO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pf.isDisabled&&pf.supportsFiber)try{Pn=pf.inject(SO),Vt=pf}catch{}}return Pc.createRoot=function(r,a){if(!o(r))throw Error(s(299));var c=!1,f="",x=mw,b=pw,k=gw;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(x=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(k=a.onRecoverableError)),a=ZS(r,1,!1,null,null,c,f,null,x,b,k,o1),r[ei]=a.current,cg(r),new Eg(a)},Pc.hydrateRoot=function(r,a,c){if(!o(r))throw Error(s(299));var f=!1,x="",b=mw,k=pw,P=gw,V=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(x=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(k=c.onCaughtError),c.onRecoverableError!==void 0&&(P=c.onRecoverableError),c.formState!==void 0&&(V=c.formState)),a=ZS(r,1,!0,a,c??null,f,x,V,b,k,P,o1),a.context=QS(null),c=a.current,f=mr(),f=je(f),x=ba(f),x.callback=null,wa(c,x,f),c=f,a.current.lanes=c,Ot(a,c),ps(a),r[ei]=a.current,cg(r),new mf(a)},Pc.version="19.2.4",Pc}var v1;function AO(){if(v1)return Rg.exports;v1=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(),Rg.exports=RO(),Rg.exports}var OO=AO(),xs=[],Lr=[],DO=Uint8Array,zg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ii=0,zO=zg.length;Ii<zO;++Ii)xs[Ii]=zg[Ii],Lr[zg.charCodeAt(Ii)]=Ii;Lr[45]=62;Lr[95]=63;function PO(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var s=n===t?0:4-n%4;return[n,s]}function LO(e,t,n){return(t+n)*3/4-n}function lu(e){var t,n=PO(e),s=n[0],o=n[1],l=new DO(LO(e,s,o)),u=0,d=o>0?s-4:s,h;for(h=0;h<d;h+=4)t=Lr[e.charCodeAt(h)]<<18|Lr[e.charCodeAt(h+1)]<<12|Lr[e.charCodeAt(h+2)]<<6|Lr[e.charCodeAt(h+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=t&255;return o===2&&(t=Lr[e.charCodeAt(h)]<<2|Lr[e.charCodeAt(h+1)]>>4,l[u++]=t&255),o===1&&(t=Lr[e.charCodeAt(h)]<<10|Lr[e.charCodeAt(h+1)]<<4|Lr[e.charCodeAt(h+2)]>>2,l[u++]=t>>8&255,l[u++]=t&255),l}function IO(e){return xs[e>>18&63]+xs[e>>12&63]+xs[e>>6&63]+xs[e&63]}function $O(e,t,n){for(var s,o=[],l=t;l<n;l+=3)s=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),o.push(IO(s));return o.join("")}function cu(e){for(var t,n=e.length,s=n%3,o=[],l=16383,u=0,d=n-s;u<d;u+=l)o.push($O(e,u,u+l>d?d:u+l));return s===1?(t=e[n-1],o.push(xs[t>>2]+xs[t<<4&63]+"==")):s===2&&(t=(e[n-2]<<8)+e[n-1],o.push(xs[t>>10]+xs[t>>4&63]+xs[t<<2&63]+"=")),o.join("")}function ea(e){if(e===void 0)return{};if(!nN(e))throw new Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function FO(e){if(typeof e>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof e!="string")throw new Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith("http:")||e.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw new Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function nN(e){const t=typeof e=="object",n=Object.getPrototypeOf(e),s=n===null||n===Object.prototype||n?.constructor?.name==="Object";return t&&s}const rN=!0,dl=BigInt("-9223372036854775808"),jx=BigInt("9223372036854775807"),Fv=BigInt("0"),BO=BigInt("8"),UO=BigInt("256");function sN(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function VO(e){e<Fv&&(e-=dl+dl);let t=e.toString(16);t.length%2===1&&(t="0"+t);const n=new Uint8Array(new ArrayBuffer(8));let s=0;for(const o of t.match(/.{2}/g).reverse())n.set([parseInt(o,16)],s++),e>>=BO;return cu(n)}function qO(e){const t=lu(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=Fv,s=Fv;for(const o of t)n+=BigInt(o)*UO**s,s++;return n>jx&&(n+=dl+dl),n}function HO(e){if(e<dl||jx<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);const t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),cu(new Uint8Array(t))}function YO(e){const t=lu(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}const WO=DataView.prototype.setBigInt64?HO:VO,GO=DataView.prototype.getBigInt64?YO:qO,x1=1024;function aN(e){if(e.length>x1)throw new Error(`Field name ${e} exceeds maximum field name length ${x1}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){const n=e.charCodeAt(t);if(n<32||n>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function fl(e){if(e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(Array.isArray(e))return e.map(s=>fl(s));if(typeof e!="object")throw new Error(`Unexpected type of ${e}`);const t=Object.entries(e);if(t.length===1){const s=t[0][0];if(s==="$bytes"){if(typeof e.$bytes!="string")throw new Error(`Malformed $bytes field on ${e}`);return lu(e.$bytes).buffer}if(s==="$integer"){if(typeof e.$integer!="string")throw new Error(`Malformed $integer field on ${e}`);return GO(e.$integer)}if(s==="$float"){if(typeof e.$float!="string")throw new Error(`Malformed $float field on ${e}`);const o=lu(e.$float);if(o.byteLength!==8)throw new Error(`Received ${o.byteLength} bytes, expected 8 for $float`);const u=new DataView(o.buffer).getFloat64(0,rN);if(!sN(u))throw new Error(`Float ${u} should be encoded as a number`);return u}if(s==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(s==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const n={};for(const[s,o]of Object.entries(e))aN(s),n[s]=fl(o);return n}const y1=16384;function ru(e){const t=JSON.stringify(e,(n,s)=>s===void 0?"undefined":typeof s=="bigint"?`${s.toString()}n`:s);if(t.length>y1){const n="[...truncated]";let s=y1-n.length;const o=t.codePointAt(s-1);return o!==void 0&&o>65535&&(s-=1),t.substring(0,s)+n}return t}function Bv(e,t,n,s){if(e===void 0){const u=n&&` (present at path ${n} in original object ${ru(t)})`;throw new Error(`undefined is not a valid Convex value${u}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<dl||jx<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:WO(e)}}if(typeof e=="number")if(sN(e)){const u=new ArrayBuffer(8);return new DataView(u).setFloat64(0,e,rN),{$float:cu(new Uint8Array(u))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:cu(new Uint8Array(e))};if(Array.isArray(e))return e.map((u,d)=>Bv(u,t,n+`[${d}]`));if(e instanceof Set)throw new Error(Pg(n,"Set",[...e],t));if(e instanceof Map)throw new Error(Pg(n,"Map",[...e],t));if(!nN(e)){const u=e?.constructor?.name,d=u?`${u} `:"";throw new Error(Pg(n,d,e,t))}const o={},l=Object.entries(e);l.sort(([u,d],[h,m])=>u===h?0:u<h?-1:1);for(const[u,d]of l)d!==void 0&&(aN(u),o[u]=Bv(d,t,n+`.${u}`));return o}function Pg(e,t,n,s){return e?`${t}${ru(n)} is not a supported Convex type (present at path ${e} in original object ${ru(s)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${ru(n)} is not a supported Convex type.`}function ns(e){return Bv(e,e,"")}var ZO=Object.defineProperty,QO=(e,t,n)=>t in e?ZO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lt=(e,t,n)=>QO(e,typeof t!="symbol"?t+"":t,n);const KO="https://docs.convex.dev/error#undefined-validator";function uu(e,t){const n=t!==void 0?` for field "${t}"`:"";throw new Error(`A validator is undefined${n} in ${e}. This is often caused by circular imports. See ${KO} for details.`)}class Nr{constructor({isOptional:t}){Lt(this,"type"),Lt(this,"fieldPaths"),Lt(this,"isOptional"),Lt(this,"isConvexValidator"),this.isOptional=t,this.isConvexValidator=!0}}class Cx extends Nr{constructor({isOptional:t,tableName:n}){if(super({isOptional:t}),Lt(this,"tableName"),Lt(this,"kind","id"),typeof n!="string")throw new Error("v.id(tableName) requires a string");this.tableName=n}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new Cx({isOptional:"optional",tableName:this.tableName})}}class Yf extends Nr{constructor(){super(...arguments),Lt(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new Yf({isOptional:"optional"})}}class Wf extends Nr{constructor(){super(...arguments),Lt(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new Wf({isOptional:"optional"})}}class Nx extends Nr{constructor(){super(...arguments),Lt(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new Nx({isOptional:"optional"})}}class kx extends Nr{constructor(){super(...arguments),Lt(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new kx({isOptional:"optional"})}}class _x extends Nr{constructor(){super(...arguments),Lt(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new _x({isOptional:"optional"})}}class Ex extends Nr{constructor(){super(...arguments),Lt(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new Ex({isOptional:"optional"})}}class Tx extends Nr{constructor(){super(...arguments),Lt(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new Tx({isOptional:"optional"})}}class ko extends Nr{constructor({isOptional:t,fields:n}){super({isOptional:t}),Lt(this,"fields"),Lt(this,"kind","object"),globalThis.Object.entries(n).forEach(([s,o])=>{if(o===void 0&&uu("v.object()",s),!o.isConvexValidator)throw new Error("v.object() entries must be validators")}),this.fields=n}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([t,n])=>[t,{fieldType:n.json,optional:n.isOptional==="optional"}]))}}asOptional(){return new ko({isOptional:"optional",fields:this.fields})}omit(...t){const n={...this.fields};for(const s of t)delete n[s];return new ko({isOptional:this.isOptional,fields:n})}pick(...t){const n={};for(const s of t)n[s]=this.fields[s];return new ko({isOptional:this.isOptional,fields:n})}partial(){const t={};for(const[n,s]of globalThis.Object.entries(this.fields))t[n]=s.asOptional();return new ko({isOptional:this.isOptional,fields:t})}extend(t){return new ko({isOptional:this.isOptional,fields:{...this.fields,...t}})}}class Mx extends Nr{constructor({isOptional:t,value:n}){if(super({isOptional:t}),Lt(this,"value"),Lt(this,"kind","literal"),typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&typeof n!="bigint")throw new Error("v.literal(value) must be a string, number, or boolean");this.value=n}get json(){return{type:this.kind,value:ns(this.value)}}asOptional(){return new Mx({isOptional:"optional",value:this.value})}}class Rx extends Nr{constructor({isOptional:t,element:n}){super({isOptional:t}),Lt(this,"element"),Lt(this,"kind","array"),n===void 0&&uu("v.array()"),this.element=n}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new Rx({isOptional:"optional",element:this.element})}}class Ax extends Nr{constructor({isOptional:t,key:n,value:s}){if(super({isOptional:t}),Lt(this,"key"),Lt(this,"value"),Lt(this,"kind","record"),n===void 0&&uu("v.record()","key"),s===void 0&&uu("v.record()","value"),n.isOptional==="optional")throw new Error("Record validator cannot have optional keys");if(s.isOptional==="optional")throw new Error("Record validator cannot have optional values");if(!n.isConvexValidator||!s.isConvexValidator)throw new Error("Key and value of v.record() but be validators");this.key=n,this.value=s}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new Ax({isOptional:"optional",key:this.key,value:this.value})}}class Ox extends Nr{constructor({isOptional:t,members:n}){super({isOptional:t}),Lt(this,"members"),Lt(this,"kind","union"),n.forEach((s,o)=>{if(s===void 0&&uu("v.union()",`member at index ${o}`),!s.isConvexValidator)throw new Error("All members of v.union() must be validators")}),this.members=n}get json(){return{type:this.kind,value:this.members.map(t=>t.json)}}asOptional(){return new Ox({isOptional:"optional",members:this.members})}}const Fe={id:e=>new Cx({isOptional:"required",tableName:e}),null:()=>new Ex({isOptional:"required"}),number:()=>new Yf({isOptional:"required"}),float64:()=>new Yf({isOptional:"required"}),bigint:()=>new Wf({isOptional:"required"}),int64:()=>new Wf({isOptional:"required"}),boolean:()=>new Nx({isOptional:"required"}),string:()=>new _x({isOptional:"required"}),bytes:()=>new kx({isOptional:"required"}),literal:e=>new Mx({isOptional:"required",value:e}),array:e=>new Rx({isOptional:"required",element:e}),object:e=>new ko({isOptional:"required",fields:e}),record:(e,t)=>new Ax({isOptional:"required",key:e,value:t}),union:(...e)=>new Ox({isOptional:"required",members:e}),any:()=>new Tx({isOptional:"required"}),optional:e=>e.asOptional(),nullable:e=>Fe.union(e,Fe.null())};var XO=Object.defineProperty,JO=(e,t,n)=>t in e?XO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lg=(e,t,n)=>JO(e,typeof t!="symbol"?t+"":t,n),b1,w1;const eD=Symbol.for("ConvexError");class Uv extends(w1=Error,b1=eD,w1){constructor(t){super(typeof t=="string"?t:ru(t)),Lg(this,"name","ConvexError"),Lg(this,"data"),Lg(this,b1,!0),this.data=t}}const oN=()=>Array.from({length:4},()=>0);oN();oN();const S1="1.34.1";var tD=Object.defineProperty,nD=(e,t,n)=>t in e?tD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j1=(e,t,n)=>nD(e,typeof t!="symbol"?t+"":t,n);const rD="color:rgb(0, 145, 255)";function iN(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class lN{constructor(t){j1(this,"_onLogLineFuncs"),j1(this,"_verbose"),this._onLogLineFuncs={},this._verbose=t.verbose}addLogLineListener(t){let n=Math.random().toString(36).substring(2,15);for(let s=0;s<10&&this._onLogLineFuncs[n]!==void 0;s++)n=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[n]=t,()=>{delete this._onLogLineFuncs[n]}}logVerbose(...t){if(this._verbose)for(const n of Object.values(this._onLogLineFuncs))n("debug",`${new Date().toISOString()}`,...t)}log(...t){for(const n of Object.values(this._onLogLineFuncs))n("info",...t)}warn(...t){for(const n of Object.values(this._onLogLineFuncs))n("warn",...t)}error(...t){for(const n of Object.values(this._onLogLineFuncs))n("error",...t)}}function cN(e){const t=new lN(e);return t.addLogLineListener((n,...s)=>{switch(n){case"debug":console.debug(...s);break;case"info":console.log(...s);break;case"warn":console.warn(...s);break;case"error":console.error(...s);break;default:console.log(...s)}}),t}function uN(e){return new lN(e)}function Gf(e,t,n,s,o){const l=iN(n);if(typeof o=="object"&&(o=`ConvexError ${JSON.stringify(o.errorData,null,2)}`),t==="info"){const u=o.match(/^\[.*?\] /);if(u===null){e.error(`[CONVEX ${l}(${s})] Could not parse console.log`);return}const d=o.slice(1,u[0].length-2),h=o.slice(u[0].length);e.log(`%c[CONVEX ${l}(${s})] [${d}]`,rD,h)}else e.error(`[CONVEX ${l}(${s})] ${o}`)}function sD(e,t){const n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),new Error(n)}function Ki(e,t,n){return`[CONVEX ${iN(e)}(${t})] ${n.errorMessage}
10
- Called by client`}function Vv(e,t){return t.data=e.errorData,t}function zo(e){const t=e.split(":");let n,s;return t.length===1?(n=t[0],s="default"):(n=t.slice(0,t.length-1).join(":"),s=t[t.length-1]),n.endsWith(".js")&&(n=n.slice(0,-3)),`${n}:${s}`}function Ro(e,t){return JSON.stringify({udfPath:zo(e),args:ns(t)})}function C1(e,t,n){const{initialNumItems:s,id:o}=n;return JSON.stringify({type:"paginated",udfPath:zo(e),args:ns(t),options:ns({initialNumItems:s,id:o})})}var aD=Object.defineProperty,oD=(e,t,n)=>t in e?aD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gs=(e,t,n)=>oD(e,typeof t!="symbol"?t+"":t,n);class iD{constructor(){gs(this,"nextQueryId"),gs(this,"querySetVersion"),gs(this,"querySet"),gs(this,"queryIdToToken"),gs(this,"identityVersion"),gs(this,"auth"),gs(this,"outstandingQueriesOlderThanRestart"),gs(this,"outstandingAuthOlderThanRestart"),gs(this,"paused"),gs(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(t,n,s,o){const l=zo(t),u=Ro(l,n),d=this.querySet.get(u);if(d!==void 0)return d.numSubscribers+=1,{queryToken:u,modification:null,unsubscribe:()=>this.removeSubscriber(u)};{const h=this.nextQueryId++,m={id:h,canonicalizedUdfPath:l,args:n,numSubscribers:1,journal:s,componentPath:o};this.querySet.set(u,m),this.queryIdToToken.set(h,u);const v=this.querySetVersion,g=this.querySetVersion+1,y={type:"Add",queryId:h,udfPath:l,args:[ns(n)],journal:s,componentPath:o};return this.paused?this.pendingQuerySetModifications.set(h,y):this.querySetVersion=g,{queryToken:u,modification:{type:"ModifyQuerySet",baseVersion:v,newVersion:g,modifications:[y]},unsubscribe:()=>this.removeSubscriber(u)}}}transition(t){for(const n of t.modifications)switch(n.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);const s=n.journal;if(s!==void 0){const o=this.queryIdToToken.get(n.queryId);o!==void 0&&(this.querySet.get(o).journal=s)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);break}default:throw new Error(`Invalid modification ${n.type}`)}}queryId(t,n){const s=zo(t),o=Ro(s,n),l=this.querySet.get(o);return l!==void 0?l.id:null}isCurrentOrNewerAuthVersion(t){return t>=this.identityVersion}getAuth(){return this.auth}setAuth(t){this.auth={tokenType:"User",value:t};const n=this.identityVersion;return this.paused||(this.identityVersion=n+1),{type:"Authenticate",baseVersion:n,...this.auth}}setAdminAuth(t,n){const s={tokenType:"Admin",value:t,impersonating:n};this.auth=s;const o=this.identityVersion;return this.paused||(this.identityVersion=o+1),{type:"Authenticate",baseVersion:o,...s}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",tokenType:"None",baseVersion:t}}hasAuth(){return!!this.auth}isNewAuth(t){return this.auth?.value!==t}queryPath(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).canonicalizedUdfPath:null}queryArgs(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).args:null}queryToken(t){return this.queryIdToToken.get(t)??null}queryJournal(t){return this.querySet.get(t)?.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const t=[];for(const o of this.querySet.values()){const l={type:"Add",queryId:o.id,udfPath:o.canonicalizedUdfPath,args:[ns(o.args)],journal:o.journal,componentPath:o.componentPath};t.push(l),this.outstandingQueriesOlderThanRestart.add(o.id)}this.querySetVersion=1;const n={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:t};if(!this.auth)return this.identityVersion=0,[n,void 0];this.outstandingAuthOlderThanRestart=!0;const s={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[n,s]}pause(){this.paused=!0}resume(){const t=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,n=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[t,n]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(t){const n=this.querySet.get(t);if(n.numSubscribers>1)return n.numSubscribers-=1,null;{this.querySet.delete(t),this.queryIdToToken.delete(n.id),this.outstandingQueriesOlderThanRestart.delete(n.id);const s=this.querySetVersion,o=this.querySetVersion+1,l={type:"Remove",queryId:n.id};return this.paused?this.pendingQuerySetModifications.has(n.id)?this.pendingQuerySetModifications.delete(n.id):this.pendingQuerySetModifications.set(n.id,l):this.querySetVersion=o,{type:"ModifyQuerySet",baseVersion:s,newVersion:o,modifications:[l]}}}}var lD=Object.defineProperty,cD=(e,t,n)=>t in e?lD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gf=(e,t,n)=>cD(e,typeof t!="symbol"?t+"":t,n);class uD{constructor(t,n){this.logger=t,this.markConnectionStateDirty=n,gf(this,"inflightRequests"),gf(this,"requestsOlderThanRestart"),gf(this,"inflightMutationsCount",0),gf(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(t,n){const s=new Promise(o=>{const l=n?"Requested":"NotSent";this.inflightRequests.set(t.requestId,{message:t,status:{status:l,requestedAt:new Date,onResult:o}}),t.type==="Mutation"?this.inflightMutationsCount++:t.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),s}onResponse(t){const n=this.inflightRequests.get(t.requestId);if(n===void 0||n.status.status==="Completed")return null;const s=n.message.type==="Mutation"?"mutation":"action",o=n.message.udfPath;for(const h of t.logLines)Gf(this.logger,"info",s,o,h);const l=n.status;let u,d;if(t.success)u={success:!0,logLines:t.logLines,value:fl(t.result)},d=()=>l.onResult(u);else{const h=t.result,{errorData:m}=t;Gf(this.logger,"error",s,o,h),u={success:!1,errorMessage:h,errorData:m!==void 0?fl(m):void 0,logLines:t.logLines},d=()=>l.onResult(u)}return t.type==="ActionResponse"||!t.success?(d(),this.inflightRequests.delete(t.requestId),this.requestsOlderThanRestart.delete(t.requestId),n.message.type==="Action"?this.inflightActionsCount--:n.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:t.requestId,result:u}):(n.status={status:"Completed",result:u,ts:t.ts,onResolve:d},null)}removeCompleted(t){const n=new Map;for(const[s,o]of this.inflightRequests.entries()){const l=o.status;l.status==="Completed"&&l.ts.lessThanOrEqual(t)&&(l.onResolve(),n.set(s,l.result),o.message.type==="Mutation"?this.inflightMutationsCount--:o.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(s),this.requestsOlderThanRestart.delete(s))}return n.size>0&&this.markConnectionStateDirty(),n}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const t=[];for(const[n,s]of this.inflightRequests){if(s.status.status==="NotSent"){s.status.status="Requested",t.push(s.message);continue}if(s.message.type==="Mutation")t.push(s.message);else if(s.message.type==="Action"){if(this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n),this.inflightActionsCount--,s.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");s.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),t}resume(){const t=[];for(const[,n]of this.inflightRequests)if(n.status.status==="NotSent"){n.status.status="Requested",t.push(n.message);continue}return t}hasIncompleteRequests(){for(const t of this.inflightRequests.values())if(t.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let t=Date.now();for(const n of this.inflightRequests.values())n.status.status!=="Completed"&&n.status.requestedAt.getTime()<t&&(t=n.status.requestedAt.getTime());return new Date(t)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const du=Symbol.for("functionName"),dD=Symbol.for("toReferencePath");function fD(e){return e[dD]??null}function hD(e){return e.startsWith("function://")}function mD(e){let t;if(typeof e=="string")hD(e)?t={functionHandle:e}:t={name:e};else if(e[du])t={name:e[du]};else{const n=fD(e);if(!n)throw new Error(`${e} is not a functionReference`);t={reference:n}}return t}function nr(e){const t=mD(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;const n=e[du];if(!n)throw new Error(`${e} is not a functionReference`);return n}function dN(e){return{[du]:e}}function fN(e=[]){const t={get(n,s){if(typeof s=="string"){const o=[...e,s];return fN(o)}else if(s===du){if(e.length<2){const u=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${u}\``)}const o=e.slice(0,-1).join("/"),l=e[e.length-1];return l==="default"?o:o+":"+l}else return s===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}fN();var pD=Object.defineProperty,gD=(e,t,n)=>t in e?pD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zf=(e,t,n)=>gD(e,typeof t!="symbol"?t+"":t,n);class fu{constructor(t){Zf(this,"queryResults"),Zf(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...n){const s=ea(n[0]),o=nr(t),l=this.queryResults.get(Ro(o,s));if(l!==void 0)return fu.queryValue(l.result)}getAllQueries(t){const n=[],s=nr(t);for(const o of this.queryResults.values())o.udfPath===zo(s)&&n.push({args:o.args,value:fu.queryValue(o.result)});return n}setQuery(t,n,s){const o=ea(n),l=nr(t),u=Ro(l,o);let d;s===void 0?d=void 0:d={success:!0,value:s,logLines:[]};const h={udfPath:l,args:o,result:d};this.queryResults.set(u,h),this.modifiedQueries.push(u)}static queryValue(t){if(t!==void 0)return t.success?t.value:void 0}}class vD{constructor(){Zf(this,"queryResults"),Zf(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(t,n){this.optimisticUpdates=this.optimisticUpdates.filter(u=>!n.has(u.mutationId));const s=this.queryResults;this.queryResults=new Map(t);const o=new fu(this.queryResults);for(const u of this.optimisticUpdates)u.update(o);const l=[];for(const[u,d]of this.queryResults){const h=s.get(u);(h===void 0||h.result!==d.result)&&l.push(u)}return l}applyOptimisticUpdate(t,n){this.optimisticUpdates.push({update:t,mutationId:n});const s=new fu(this.queryResults);return t(s),s.modifiedQueries}rawQueryResult(t){const n=this.queryResults.get(t);if(n!==void 0)return n.result}queryResult(t){const n=this.queryResults.get(t);if(n===void 0)return;const s=n.result;if(s!==void 0){if(s.success)return s.value;throw s.errorData!==void 0?Vv(s,new Uv(Ki("query",n.udfPath,s))):new Error(Ki("query",n.udfPath,s))}}hasQueryResult(t){return this.queryResults.get(t)!==void 0}queryLogs(t){return this.queryResults.get(t)?.result?.logLines}}var xD=Object.defineProperty,yD=(e,t,n)=>t in e?xD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ig=(e,t,n)=>yD(e,typeof t!="symbol"?t+"":t,n);class tr{constructor(t,n){Ig(this,"low"),Ig(this,"high"),Ig(this,"__isUnsignedLong__"),this.low=t|0,this.high=n|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new tr(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){const t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?N1:t>=bD?wD:new tr(t%su|0,t/su|0)}toString(){return(BigInt(this.high)*BigInt(su)+BigInt(this.low)).toString()}equals(t){return tr.isLong(t)||(t=tr.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return tr.isLong(t)||(t=tr.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?tr.fromNumber(t):new tr(t.low,t.high)}}const N1=new tr(0,0),k1=65536,su=k1*k1,bD=su*su,wD=new tr(-1,-1);var SD=Object.defineProperty,jD=(e,t,n)=>t in e?SD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vf=(e,t,n)=>jD(e,typeof t!="symbol"?t+"":t,n);class _1{constructor(t,n){vf(this,"version"),vf(this,"remoteQuerySet"),vf(this,"queryPath"),vf(this,"logger"),this.version={querySet:0,ts:tr.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=t,this.logger=n}transition(t){const n=t.startVersion;if(this.version.querySet!==n.querySet||this.version.ts.notEquals(n.ts)||this.version.identity!==n.identity)throw new Error(`Invalid start version: ${n.ts.toString()}:${n.querySet}:${n.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const s of t.modifications)switch(s.type){case"QueryUpdated":{const o=this.queryPath(s.queryId);if(o)for(const u of s.logLines)Gf(this.logger,"info","query",o,u);const l=fl(s.value??null);this.remoteQuerySet.set(s.queryId,{success:!0,value:l,logLines:s.logLines});break}case"QueryFailed":{const o=this.queryPath(s.queryId);if(o)for(const u of s.logLines)Gf(this.logger,"info","query",o,u);const{errorData:l}=s;this.remoteQuerySet.set(s.queryId,{success:!1,errorMessage:s.errorMessage,errorData:l!==void 0?fl(l):void 0,logLines:s.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(s.queryId);break}default:throw new Error(`Invalid modification ${s.type}`)}this.version=t.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function $g(e){const t=lu(e);return tr.fromBytesLE(Array.from(t))}function CD(e){const t=new Uint8Array(e.toBytesLE());return cu(t)}function E1(e){switch(e.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...e};case"MutationResponse":return e.success?{...e,ts:$g(e.ts)}:{...e};case"Transition":return{...e,startVersion:{...e.startVersion,ts:$g(e.startVersion.ts)},endVersion:{...e.endVersion,ts:$g(e.endVersion.ts)}}}}function ND(e){switch(e.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...e};case"Connect":return e.maxObservedTimestamp!==void 0?{...e,maxObservedTimestamp:CD(e.maxObservedTimestamp)}:{...e,maxObservedTimestamp:void 0}}}var kD=Object.defineProperty,_D=(e,t,n)=>t in e?kD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,on=(e,t,n)=>_D(e,typeof t!="symbol"?t+"":t,n);const ED=1e3,TD=1001,MD=1005,RD=4040;let Lf;function Yi(){return Lf===void 0&&(Lf=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(Lf+performance.now())}function T1(){return`t=${Math.round((Yi()-Lf)/100)/10}s`}const hN={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function AD(e){if(e===void 0)return"Unknown";for(const t of Object.keys(hN))if(e.startsWith(t))return t;return"Unknown"}class OD{constructor(t,n,s,o,l,u){this.markConnectionStateDirty=l,this.debug=u,on(this,"socket"),on(this,"connectionCount"),on(this,"_hasEverConnected",!1),on(this,"lastCloseReason"),on(this,"transitionChunkBuffer",null),on(this,"defaultInitialBackoff"),on(this,"maxBackoff"),on(this,"retries"),on(this,"serverInactivityThreshold"),on(this,"reconnectDueToServerInactivityTimeout"),on(this,"scheduledReconnect",null),on(this,"networkOnlineHandler",null),on(this,"pendingNetworkRecoveryInfo",null),on(this,"uri"),on(this,"onOpen"),on(this,"onResume"),on(this,"onMessage"),on(this,"webSocketConstructor"),on(this,"logger"),on(this,"onServerDisconnectError"),this.webSocketConstructor=s,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=t,this.onOpen=n.onOpen,this.onResume=n.onResume,this.onMessage=n.onMessage,this.onServerDisconnectError=n.onServerDisconnectError,this.logger=o,this.setupNetworkListener(),this.connect()}setSocketState(t){this.socket=t,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(t){if(t.partNumber<0||t.partNumber>=t.totalParts||t.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==t.totalParts||this.transitionChunkBuffer.transitionId!==t.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:t.totalParts,transitionId:t.transitionId}),t.partNumber!==this.transitionChunkBuffer.chunks.length){const n=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${n}, got ${t.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(t.chunk),this.transitionChunkBuffer.chunks.length===t.totalParts){const n=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const s=E1(JSON.parse(n));if(s.type!=="Transition")throw new Error(`Expected Transition, got ${s.type} after assembling chunks`);return s}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const t=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:t,paused:"no"}),this.resetServerInactivityTimeout(),t.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:t,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Yi()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",T1(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",T1())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:n}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:n}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(n/1e3)}s of waiting`)}},t.onerror=n=>{this.transitionChunkBuffer=null;const s=n.message;s&&this.logger.log(`WebSocket error message: ${s}`)},t.onmessage=n=>{this.resetServerInactivityTimeout();const s=n.data.length;let o=E1(JSON.parse(n.data));if(this._logVerbose(`received ws message with type ${o.type}`),o.type==="Ping")return;if(o.type==="TransitionChunk"){const u=this.assembleTransition(o);if(!u)return;o=u,this._logVerbose(`assembled full ws message of type ${o.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${o.type} while buffering TransitionChunks`)),o.type==="Transition"&&this.reportLargeTransition({messageLength:s,transition:o}),this.onMessage(o).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},t.onclose=n=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=n.reason||`closed with code ${n.code}`),n.code!==ED&&n.code!==TD&&n.code!==MD&&n.code!==RD){let o=`WebSocket closed with code ${n.code}`;n.reason&&(o+=`: ${n.reason}`),this.logger.log(o),this.onServerDisconnectError&&n.reason&&this.onServerDisconnectError(o)}const s=AD(n.reason);this.scheduleReconnect(s)}}socketState(){return this.socket.state}sendMessage(t){const n={type:t.type,...t.type==="Authenticate"&&t.tokenType==="User"?{value:`...${t.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const s=ND(t),o=JSON.stringify(s);let l=!1;try{this.socket.ws.send(o),l=!0}catch(u){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${u}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${l?"sent":"failed to send"} message with type ${t.type}: ${JSON.stringify(n)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(n)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(t){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const n=this.nextBackoff(t);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(n)}ms`);const s=Yi(),o=setTimeout(()=>{this.scheduledReconnect?.timeout===o&&(this.scheduledReconnect=null,this.connect())},n);this.scheduledReconnect={timeout:o,scheduledAt:s,backoffMs:n}}closeAndReconnect(t){switch(this._logVerbose(`begin closeAndReconnect with reason ${t}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=t,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const t=this.socket.ws;return t.onmessage=n=>{this._logVerbose("Ignoring message received after close")},new Promise(n=>{t.onclose=()=>{this._logVerbose("Closed after connecting"),n()},t.onopen=()=>{this._logVerbose("Opened after connecting"),t.close()}})}case"ready":{this._logVerbose("ws.close called");const t=this.socket.ws;t.onmessage=s=>{this._logVerbose("Ignoring message received after close")};const n=new Promise(s=>{t.onclose=()=>{s()}});return t.close(),n}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const t=this.close();return this.setSocketState({state:"terminated"}),t}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const t=this.close();return this.socket={state:"stopped"},t}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let t=null;if(this.scheduledReconnect){const n=Yi()-this.scheduledReconnect.scheduledAt;t=Math.max(0,this.scheduledReconnect.backoffMs-n),this._logVerbose(`would have waited ${Math.round(t)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(n)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=t!==null?{timeSavedMs:t}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Yi()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(t){this.logger.logVerbose(t)}nextBackoff(t){const s=(t==="client"?100:t==="Unknown"?this.defaultInitialBackoff:hN[t].timeout)*Math.pow(2,this.retries);this.retries+=1;const o=Math.min(s,this.maxBackoff),l=o*(Math.random()-.5);return o+l}reportLargeTransition({transition:t,messageLength:n}){if(t.clientClockSkew===void 0||t.serverTs===void 0)return;const s=Yi()-t.clientClockSkew-t.serverTs/1e6,o=`${Math.round(s)}ms`,l=`${Math.round(n/1e4)/100}MB`,u=n/(s/1e3),d=`${Math.round(u/1e4)/100}MB per second`;this._logVerbose(`received ${l} transition in ${o} at ${d}`),n>2e7?this.logger.log(`received query results totaling more that 20MB (${l}) which will take a long time to download on slower connections`):s>2e4&&this.logger.log(`received query results totaling ${l} which took more than 20s to arrive (${o})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:s,messageLength:n}})}}function DD(){return zD()}function zD(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}class Gc extends Error{}Gc.prototype.name="InvalidTokenError";function PD(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let s=n.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function LD(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return PD(t)}catch{return atob(t)}}function mN(e,t){if(typeof e!="string")throw new Gc("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,s=e.split(".")[n];if(typeof s!="string")throw new Gc(`Invalid token specified: missing part #${n+1}`);let o;try{o=LD(s)}catch(l){throw new Gc(`Invalid token specified: invalid base64 for part #${n+1} (${l.message})`)}try{return JSON.parse(o)}catch(l){throw new Gc(`Invalid token specified: invalid json for part #${n+1} (${l.message})`)}}var ID=Object.defineProperty,$D=(e,t,n)=>t in e?ID(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pr=(e,t,n)=>$D(e,typeof t!="symbol"?t+"":t,n);const FD=480*60*60*1e3,M1=2;class BD{constructor(t,n,s){Pr(this,"authState",{state:"noAuth"}),Pr(this,"configVersion",0),Pr(this,"syncState"),Pr(this,"authenticate"),Pr(this,"stopSocket"),Pr(this,"tryRestartSocket"),Pr(this,"pauseSocket"),Pr(this,"resumeSocket"),Pr(this,"clearAuth"),Pr(this,"logger"),Pr(this,"refreshTokenLeewaySeconds"),Pr(this,"tokenConfirmationAttempts",0),this.syncState=t,this.authenticate=n.authenticate,this.stopSocket=n.stopSocket,this.tryRestartSocket=n.tryRestartSocket,this.pauseSocket=n.pauseSocket,this.resumeSocket=n.resumeSocket,this.clearAuth=n.clearAuth,this.logger=s.logger,this.refreshTokenLeewaySeconds=s.refreshTokenLeewaySeconds}async setConfig(t,n){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const s=await this.fetchTokenAndGuardAgainstRace(t,{forceRefreshToken:!1});s.isFromOutdatedConfig||(s.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:t,onAuthChange:n},hasRetried:!1}),this.authenticate(s.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:t,onAuthChange:n}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(t){if(this.syncState.isCurrentOrNewerAuthVersion(t.endVersion.identity)&&!(t.endVersion.identity<=t.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(t){if(t.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:n}=t;if(!this.syncState.isCurrentOrNewerAuthVersion(n+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(t)}async tryToReauthenticate(t){if(this._logVerbose(`attempting to reauthenticate: ${t.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=M1){this.logger.error(`Failed to authenticate: "${t.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${M1-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const n=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});n.isFromOutdatedConfig||(n.value&&this.syncState.isNewAuth(n.value)?(this.authenticate(n.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:n.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value?this.syncState.isNewAuth(t.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:t.value,config:this.authState.config}),this.authenticate(t.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(t){if(this.authState.state==="noAuth")return;const n=this.decodeToken(t);if(!n){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:s,exp:o}=n;if(!s||!o){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const l=o-s;if(l<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let u=Math.min(FD,(l-this.refreshTokenLeewaySeconds)*1e3);u<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${l}s`),u=0);const d=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},u);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:d,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${u}ms`)}async fetchTokenAndGuardAgainstRace(t,n){const s=++this.configVersion;this._logVerbose(`fetching token with config version ${s}`);const o=await t(n);return this.configVersion!==s?(this._logVerbose(`stale config version, expected ${s}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:o}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(t){t(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(t){const n=t.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:t.hadAuth,state:t.state,token:`...${t.token.slice(-7)}`}:{state:t.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(n)}`),t.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=t}decodeToken(t){try{return mN(t)}catch(n){return this._logVerbose(`Error decoding token: ${n instanceof Error?n.message:"Unknown error"}`),null}}_logVerbose(t){this.logger.logVerbose(`${t} [v${this.configVersion}]`)}}const UD=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function VD(e,t){const n={sessionId:t};typeof performance>"u"||!performance.mark||performance.mark(e,{detail:n})}function qD(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function HD(e){if(typeof performance>"u"||!performance.getEntriesByName)return[];const t=[];for(const n of UD){const s=performance.getEntriesByName(n).filter(o=>o.entryType==="mark").filter(o=>o.detail.sessionId===e);t.push(...s)}return t.map(qD)}var YD=Object.defineProperty,WD=(e,t,n)=>t in e?YD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ln=(e,t,n)=>WD(e,typeof t!="symbol"?t+"":t,n);class GD{constructor(t,n,s){if(ln(this,"address"),ln(this,"state"),ln(this,"requestManager"),ln(this,"webSocketManager"),ln(this,"authenticationManager"),ln(this,"remoteQuerySet"),ln(this,"optimisticQueryResults"),ln(this,"_transitionHandlerCounter",0),ln(this,"_nextRequestId"),ln(this,"_onTransitionFns",new Map),ln(this,"_sessionId"),ln(this,"firstMessageReceived",!1),ln(this,"debug"),ln(this,"logger"),ln(this,"maxObservedTimestamp"),ln(this,"connectionStateSubscribers",new Map),ln(this,"nextConnectionStateSubscriberId",0),ln(this,"_lastPublishedConnectionState"),ln(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const w=this.connectionState();if(JSON.stringify(w)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=w;for(const S of this.connectionStateSubscribers.values())S(w)}})}),ln(this,"mark",w=>{this.debug&&VD(w,this.sessionId)}),typeof t=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");s?.skipConvexDeploymentUrlCheck!==!0&&FO(t),s={...s};const o=s.authRefreshTokenLeewaySeconds??10;let l=s.webSocketConstructor;if(!l&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");l=l||WebSocket,this.debug=s.reportDebugInfoToConvex??!1,this.address=t,this.logger=s.logger===!1?uN({verbose:s.verbose??!1}):s.logger!==!0&&s.logger?s.logger:cN({verbose:s.verbose??!1});const u=t.search("://");if(u===-1)throw new Error("Provided address was not an absolute URL.");const d=t.substring(u+3),h=t.substring(0,u);let m;if(h==="http")m="ws";else if(h==="https")m="wss";else throw new Error(`Unknown parent protocol ${h}`);const v=`${m}://${d}/api/${S1}/sync`;this.state=new iD,this.remoteQuerySet=new _1(w=>this.state.queryPath(w),this.logger),this.requestManager=new uD(this.logger,this.markConnectionStateDirty);const g=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new BD(this.state,{authenticate:w=>{const S=this.state.setAuth(w);return this.webSocketManager.sendMessage(S),S.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:g,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:o}),this.optimisticQueryResults=new vD,this.addOnTransitionHandler(w=>{n(w.queries.map(S=>S.token))}),this._nextRequestId=0,this._sessionId=DD();const{unsavedChangesWarning:y}=s;if(typeof window>"u"||typeof window.addEventListener>"u"){if(y===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else y!==!1&&window.addEventListener("beforeunload",w=>{if(this.requestManager.hasIncompleteRequests()){w.preventDefault();const S="Are you sure you want to leave? Your changes may not be saved.";return(w||window.event).returnValue=S,S}});this.webSocketManager=new OD(v,{onOpen:w=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...w,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new _1(N=>this.state.queryPath(N),this.logger);const[S,j]=this.state.restart();j&&this.webSocketManager.sendMessage(j),this.webSocketManager.sendMessage(S);for(const N of this.requestManager.restart())this.webSocketManager.sendMessage(N)},onResume:()=>{const[w,S]=this.state.resume();S&&this.webSocketManager.sendMessage(S),w&&this.webSocketManager.sendMessage(w);for(const j of this.requestManager.resume())this.webSocketManager.sendMessage(j)},onMessage:w=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),w.type){case"Transition":{this.observedTimestamp(w.endVersion.ts),this.authenticationManager.onTransition(w),this.remoteQuerySet.transition(w),this.state.transition(w);const S=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(S);break}case"MutationResponse":{w.success&&this.observedTimestamp(w.ts);const S=this.requestManager.onResponse(w);S!==null&&this.notifyOnQueryResultChanges(new Map([[S.requestId,S.result]]));break}case"ActionResponse":{this.requestManager.onResponse(w);break}case"AuthError":{this.authenticationManager.onAuthError(w);break}case"FatalError":{const S=sD(this.logger,w.error);throw this.webSocketManager.terminate(),S}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:s.onServerDisconnectError},l,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),s.expectAuth&&g()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(t){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(t))&&(this.maxObservedTimestamp=t)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(t){const n=this.remoteQuerySet.remoteQueryResults(),s=new Map;for(const[l,u]of n){const d=this.state.queryToken(l);if(d!==null){const h={result:u,udfPath:this.state.queryPath(l),args:this.state.queryArgs(l)};s.set(d,h)}}const o=this.optimisticQueryResults.ingestQueryResultsFromServer(s,new Set(t.keys()));this.handleTransition({queries:o.map(l=>{const u=this.optimisticQueryResults.rawQueryResult(l);return{token:l,modification:{kind:"Updated",result:u}}}),reflectedMutations:Array.from(t).map(([l,u])=>({requestId:l,result:u})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(t){for(const n of this._onTransitionFns.values())n(t)}addOnTransitionHandler(t){const n=this._transitionHandlerCounter++;return this._onTransitionFns.set(n,t),()=>this._onTransitionFns.delete(n)}getCurrentAuthClaims(){const t=this.state.getAuth();let n={};if(t&&t.tokenType==="User")try{n=t?mN(t.value):{}}catch{n={}}else return;return{token:t.value,decoded:n}}setAuth(t,n){this.authenticationManager.setConfig(t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(t,n){const s=this.state.setAdminAuth(t,n);this.webSocketManager.sendMessage(s)}clearAuth(){const t=this.state.clearAuth();this.webSocketManager.sendMessage(t)}subscribe(t,n,s){const o=ea(n),{modification:l,queryToken:u,unsubscribe:d}=this.state.subscribe(t,o,s?.journal,s?.componentPath);return l!==null&&this.webSocketManager.sendMessage(l),{queryToken:u,unsubscribe:()=>{const h=d();h&&this.webSocketManager.sendMessage(h)}}}localQueryResult(t,n){const s=ea(n),o=Ro(t,s);return this.optimisticQueryResults.queryResult(o)}localQueryResultByToken(t){return this.optimisticQueryResults.queryResult(t)}hasLocalQueryResultByToken(t){return this.optimisticQueryResults.hasQueryResult(t)}localQueryLogs(t,n){const s=ea(n),o=Ro(t,s);return this.optimisticQueryResults.queryLogs(o)}queryJournal(t,n){const s=ea(n),o=Ro(t,s);return this.state.queryJournal(o)}connectionState(){const t=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:t.isConnected,hasEverConnected:t.hasEverConnected,connectionCount:t.connectionCount,connectionRetries:t.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(t){const n=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(n,t),()=>{this.connectionStateSubscribers.delete(n)}}async mutation(t,n,s){const o=await this.mutationInternal(t,n,s);if(!o.success)throw o.errorData!==void 0?Vv(o,new Uv(Ki("mutation",t,o))):new Error(Ki("mutation",t,o));return o.value}async mutationInternal(t,n,s,o){const{mutationPromise:l}=this.enqueueMutation(t,n,s,o);return l}enqueueMutation(t,n,s,o){const l=ea(n);this.tryReportLongDisconnect();const u=this.nextRequestId;if(this._nextRequestId++,s!==void 0){const v=s.optimisticUpdate;if(v!==void 0){const g=S=>{v(S,l)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},w=this.optimisticQueryResults.applyOptimisticUpdate(g,u).map(S=>{const j=this.localQueryResultByToken(S);return{token:S,modification:{kind:"Updated",result:j===void 0?void 0:{success:!0,value:j,logLines:[]}}}});this.handleTransition({queries:w,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const d={type:"Mutation",requestId:u,udfPath:t,componentPath:o,args:[ns(l)]},h=this.webSocketManager.sendMessage(d),m=this.requestManager.request(d,h);return{requestId:u,mutationPromise:m}}async action(t,n){const s=await this.actionInternal(t,n);if(!s.success)throw s.errorData!==void 0?Vv(s,new Uv(Ki("action",t,s))):new Error(Ki("action",t,s));return s.value}async actionInternal(t,n,s){const o=ea(n),l=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const u={type:"Action",requestId:l,udfPath:t,componentPath:s,args:[ns(o)]},d=this.webSocketManager.sendMessage(u);return this.requestManager.request(u,d)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const t=HD(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:t})}}tryReportLongDisconnect(){if(!this.debug)return;const t=this.connectionState().timeOfOldestInflightRequest;if(t===null||Date.now()-t.getTime()<=60*1e3)return;const n=`${this.address}/api/debug_event`;fetch(n,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${S1}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(s=>{s.ok||this.logger.warn("Analytics request failed with response:",s.body)}).catch(s=>{this.logger.warn("Analytics response failed with error:",s)})}}function Fg(e){if(typeof e!="object"||e===null||!Array.isArray(e.page)||typeof e.isDone!="boolean"||typeof e.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var ZD=Object.defineProperty,QD=(e,t,n)=>t in e?ZD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R1=(e,t,n)=>QD(e,typeof t!="symbol"?t+"":t,n);class KD{constructor(t,n){this.client=t,this.onTransition=n,R1(this,"paginatedQuerySet",new Map),R1(this,"lastTransitionTs"),this.lastTransitionTs=tr.fromNumber(0),this.client.addOnTransitionHandler(s=>this.onBaseTransition(s))}subscribe(t,n,s){const o=zo(t),l=C1(o,n,s),u=()=>this.removePaginatedQuerySubscriber(l),d=this.paginatedQuerySet.get(l);return d?(d.numSubscribers+=1,{paginatedQueryToken:l,unsubscribe:u}):(this.paginatedQuerySet.set(l,{token:l,canonicalizedUdfPath:o,args:n,numSubscribers:1,options:{initialNumItems:s.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:s.id}),this.addPageToPaginatedQuery(l,null,s.initialNumItems),{paginatedQueryToken:l,unsubscribe:u})}localQueryResult(t,n,s){const o=zo(t),l=C1(o,n,s);return this.localQueryResultByToken(l)}localQueryResultByToken(t){const n=this.paginatedQuerySet.get(t);if(!n)return;const s=this.activePageQueryTokens(n);if(s.length===0)return{results:[],status:"LoadingFirstPage",loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)};let o=[],l=!1,u=!1;for(const h of s){const m=this.client.localQueryResultByToken(h);if(m===void 0){l=!0,u=!1;continue}const v=Fg(m);o=o.concat(v.page),u=!!v.isDone}let d;return l?d=o.length===0?"LoadingFirstPage":"LoadingMore":u?d="Exhausted":d="CanLoadMore",{results:o,status:d,loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)}}onBaseTransition(t){const n=t.queries.map(u=>u.token),s=this.queriesContainingTokens(n);let o=[];s.length>0&&(this.processPaginatedQuerySplits(s,u=>this.client.localQueryResultByToken(u)),o=s.map(u=>({token:u,modification:{kind:"Updated",result:this.localQueryResultByToken(u)}})));const l={...t,paginatedQueries:o};this.onTransition(l)}loadMoreOfPaginatedQuery(t,n){this.mustGetPaginatedQuery(t);const s=this.queryTokenForLastPageOfPaginatedQuery(t),o=this.client.localQueryResultByToken(s);if(!o)return!1;const l=Fg(o);if(l.isDone)return!1;this.addPageToPaginatedQuery(t,l.continueCursor,n);const u={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:t,modification:{kind:"Updated",result:this.localQueryResultByToken(t)}}]};return this.onTransition(u),!0}queriesContainingTokens(t){if(t.length===0)return[];const n=[],s=new Set(t);for(const[o,l]of this.paginatedQuerySet)for(const u of this.allQueryTokens(l))if(s.has(u)){n.push(o);break}return n}processPaginatedQuerySplits(t,n){for(const s of t){const o=this.mustGetPaginatedQuery(s),{ongoingSplits:l,pageKeyToQuery:u,pageKeys:d}=o;for(const[h,[m,v]]of l)n(u.get(m).queryToken)!==void 0&&n(u.get(v).queryToken)!==void 0&&this.completePaginatedQuerySplit(o,h,m,v);for(const h of d){if(l.has(h))continue;const m=u.get(h).queryToken,v=n(m);if(!v)continue;const g=Fg(v);g.splitCursor&&(g.pageStatus==="SplitRecommended"||g.pageStatus==="SplitRequired"||g.page.length>o.options.initialNumItems*2)&&this.splitPaginatedQueryPage(o,h,g.splitCursor,g.continueCursor)}}}splitPaginatedQueryPage(t,n,s,o){const l=t.nextPageKey++,u=t.nextPageKey++,d={cursor:o,numItems:t.options.initialNumItems,id:t.id},h=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...d,cursor:null,endCursor:s}});t.pageKeyToQuery.set(l,h);const m=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...d,cursor:s,endCursor:o}});t.pageKeyToQuery.set(u,m),t.ongoingSplits.set(n,[l,u])}addPageToPaginatedQuery(t,n,s){const o=this.mustGetPaginatedQuery(t),l=o.nextPageKey++,u={cursor:n,numItems:s,id:o.id},d={...o.args,paginationOpts:u},h=this.client.subscribe(o.canonicalizedUdfPath,d);return o.pageKeys.push(l),o.pageKeyToQuery.set(l,h),h}removePaginatedQuerySubscriber(t){const n=this.paginatedQuerySet.get(t);if(n&&(n.numSubscribers-=1,!(n.numSubscribers>0))){for(const s of n.pageKeyToQuery.values())s.unsubscribe();this.paginatedQuerySet.delete(t)}}completePaginatedQuerySplit(t,n,s,o){const l=t.pageKeyToQuery.get(n);t.pageKeyToQuery.delete(n);const u=t.pageKeys.indexOf(n);t.pageKeys.splice(u,1,s,o),t.ongoingSplits.delete(n),l.unsubscribe()}activePageQueryTokens(t){return t.pageKeys.map(n=>t.pageKeyToQuery.get(n).queryToken)}allQueryTokens(t){return Array.from(t.pageKeyToQuery.values()).map(n=>n.queryToken)}queryTokenForLastPageOfPaginatedQuery(t){const n=this.mustGetPaginatedQuery(t),s=n.pageKeys[n.pageKeys.length-1];if(s===void 0)throw new Error(`No pages for paginated query ${t}`);return n.pageKeyToQuery.get(s).queryToken}mustGetPaginatedQuery(t){const n=this.paginatedQuerySet.get(t);if(!n)throw new Error("paginated query no longer exists for token "+t);return n}}function XD({getCurrentValue:e,subscribe:t}){const[n,s]=p.useState(()=>({getCurrentValue:e,subscribe:t,value:e()}));let o=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(o=e(),s({getCurrentValue:e,subscribe:t,value:o})),p.useEffect(()=>{let l=!1;const u=()=>{l||s(h=>{if(h.getCurrentValue!==e||h.subscribe!==t)return h;const m=e();return h.value===m?h:{...h,value:m}})},d=t(u);return u(),()=>{l=!0,d()}},[e,t]),o}var JD=Object.defineProperty,ez=(e,t,n)=>t in e?JD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ks=(e,t,n)=>ez(e,typeof t!="symbol"?t+"":t,n);const tz=5e3;if(typeof ee>"u")throw new Error("Required dependency 'react' not found");function pN(e,t,n){function s(o){return az(o),t.mutation(e,o,{optimisticUpdate:n})}return s.withOptimisticUpdate=function(l){if(n!==void 0)throw new Error(`Already specified optimistic update for mutation ${nr(e)}`);return pN(e,t,l)},s}class nz{constructor(t,n){if(Ks(this,"address"),Ks(this,"cachedSync"),Ks(this,"cachedPaginatedQueryClient"),Ks(this,"listeners"),Ks(this,"options"),Ks(this,"closed",!1),Ks(this,"_logger"),Ks(this,"adminAuth"),Ks(this,"fakeUserIdentity"),t===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof t!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof t} instead.`);if(!t.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=t,this.listeners=new Map,this._logger=n?.logger===!1?uN({verbose:n?.verbose??!1}):n?.logger!==!0&&n?.logger?n.logger:cN({verbose:n?.verbose??!1}),this.options={...n,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new GD(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new KD(this.cachedSync,t=>this.handleTransition(t)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(t,n){if(typeof t=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(t,n??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(t,n){if(this.adminAuth=t,this.fakeUserIdentity=n,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(t,n)}watchQuery(t,...n){const[s,o]=n,l=nr(t);return{onUpdate:u=>{const{queryToken:d,unsubscribe:h}=this.sync.subscribe(l,s,o),m=this.listeners.get(d);return m!==void 0?m.add(u):this.listeners.set(d,new Set([u])),()=>{if(this.closed)return;const v=this.listeners.get(d);v.delete(u),v.size===0&&this.listeners.delete(d),h()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(l,s)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(l,s)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(l,s)}}}prewarmQuery(t){const n=t.extendSubscriptionFor??tz,o=this.watchQuery(t.query,t.args||{}).onUpdate(()=>{});setTimeout(o,n)}watchPaginatedQuery(t,n,s){const o=nr(t);return{onUpdate:l=>{const{paginatedQueryToken:u,unsubscribe:d}=this.paginatedQueryClient.subscribe(o,n||{},s),h=this.listeners.get(u);return h!==void 0?h.add(l):this.listeners.set(u,new Set([l])),()=>{if(this.closed)return;const m=this.listeners.get(u);m.delete(l),m.size===0&&this.listeners.delete(u),d()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(o,n,s)}}mutation(t,...n){const[s,o]=n,l=nr(t);return this.sync.mutation(l,s,o)}action(t,...n){const s=nr(t);return this.sync.action(s,...n)}query(t,...n){const s=this.watchQuery(t,...n),o=s.localQueryResult();return o!==void 0?Promise.resolve(o):new Promise((l,u)=>{const d=s.onUpdate(()=>{d();try{l(s.localQueryResult())}catch(h){u(h)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(t){return this.sync.subscribeToConnectionState(t)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const t=this.cachedSync;this.cachedSync=void 0,await t.close()}}handleTransition(t){const n=t.queries.map(o=>o.token),s=t.paginatedQueries.map(o=>o.token);this.transition([...n,...s])}transition(t){for(const n of t){const s=this.listeners.get(n);if(s)for(const o of s)o()}}}const Dx=ee.createContext(void 0);function rz(){return p.useContext(Dx)}const sz=({client:e,children:t})=>ee.createElement(Dx.Provider,{value:e},t);function Ye(e,...t){const n=t[0]==="skip",s=t[0]==="skip"?{}:ea(t[0]),o=typeof e=="string"?dN(e):e,l=nr(o),u=p.useMemo(()=>n?{}:{query:{query:o,args:s}},[JSON.stringify(ns(s)),l,n]),h=cz(u).query;if(h instanceof Error)throw h;return h}function Ke(e){const t=typeof e=="string"?dN(e):e,n=p.useContext(Dx);if(n===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return p.useMemo(()=>pN(t,n),[n,nr(t)])}function az(e){if(typeof e=="object"&&e!==null&&"bubbles"in e&&"persist"in e&&"isDefaultPrevented"in e)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var oz=Object.defineProperty,iz=(e,t,n)=>t in e?oz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bg=(e,t,n)=>iz(e,typeof t!="symbol"?t+"":t,n);class lz{constructor(t){Bg(this,"createWatch"),Bg(this,"queries"),Bg(this,"listeners"),this.createWatch=t,this.queries={},this.listeners=new Set}setQueries(t){for(const n of Object.keys(t)){const{query:s,args:o,paginationOptions:l}=t[n];if(nr(s),this.queries[n]===void 0)this.addQuery(n,s,o,l?{paginationOptions:l}:{});else{const u=this.queries[n];(nr(s)!==nr(u.query)||JSON.stringify(ns(o))!==JSON.stringify(ns(u.args))||JSON.stringify(l)!==JSON.stringify(u.paginationOptions))&&(this.removeQuery(n),this.addQuery(n,s,o,l?{paginationOptions:l}:{}))}}for(const n of Object.keys(this.queries))t[n]===void 0&&this.removeQuery(n)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getLocalResults(t){const n={};for(const s of Object.keys(t)){const{query:o,args:l}=t[s],u=t[s].paginationOptions;nr(o);const d=this.createWatch(o,l,u?{paginationOptions:u}:{});let h;try{h=d.localQueryResult()}catch(m){if(m instanceof Error)h=m;else throw m}n[s]=h}return n}setCreateWatch(t){this.createWatch=t;for(const n of Object.keys(this.queries)){const{query:s,args:o,watch:l,paginationOptions:u}=this.queries[n],d="journal"in l?l.journal():void 0;this.removeQuery(n),this.addQuery(n,s,o,{...d?{journal:d}:[],...u?{paginationOptions:u}:{}})}}destroy(){for(const t of Object.keys(this.queries))this.removeQuery(t);this.listeners=new Set}addQuery(t,n,s,{paginationOptions:o,journal:l}){if(this.queries[t]!==void 0)throw new Error(`Tried to add a new query with identifier ${t} when it already exists.`);const u=this.createWatch(n,s,{...l?{journal:l}:[],...o?{paginationOptions:o}:{}}),d=u.onUpdate(()=>this.notifyListeners());this.queries[t]={query:n,args:s,watch:u,unsubscribe:d,...o?{paginationOptions:o}:{}}}removeQuery(t){const n=this.queries[t];if(n===void 0)throw new Error(`No query found with identifier ${t}.`);n.unsubscribe(),delete this.queries[t]}notifyListeners(){for(const t of this.listeners)t()}}function cz(e){const t=rz();if(t===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const n=p.useMemo(()=>(s,o,{journal:l,paginationOptions:u})=>u?t.watchPaginatedQuery(s,o,u):t.watchQuery(s,o,l?{journal:l}:{}),[t]);return uz(e,n)}function uz(e,t){const[n]=p.useState(()=>new lz(t));n.createWatch!==t&&n.setCreateWatch(t),p.useEffect(()=>()=>n.destroy(),[n]);const s=p.useMemo(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:o=>(n.setQueries(e),n.subscribe(o))}),[n,e]);return XD(s)}const qv=new WeakMap,dz=new WeakMap,Qf={current:[]};let Ug=!1,au=0;const Zc=new Set,xf=new Map;function gN(e){for(const t of e){if(Qf.current.includes(t))continue;Qf.current.push(t),t.recompute();const n=dz.get(t);if(n)for(const s of n){const o=qv.get(s);o?.length&&gN(o)}}}function fz(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function hz(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function vN(e){if(au>0&&!xf.has(e)&&xf.set(e,e.prevState),Zc.add(e),!(au>0)&&!Ug)try{for(Ug=!0;Zc.size>0;){const t=Array.from(Zc);Zc.clear();for(const n of t){const s=xf.get(n)??n.prevState;n.prevState=s,fz(n)}for(const n of t){const s=qv.get(n);s&&(Qf.current.push(n),gN(s))}for(const n of t){const s=qv.get(n);if(s)for(const o of s)hz(o)}}}finally{Ug=!1,Qf.current=[],xf.clear()}}function mz(e){au++;try{e()}finally{if(au--,au===0){const t=Zc.values().next().value;t&&vN(t)}}}function pz(e){return typeof e=="function"}class gz{constructor(t,n){this.listeners=new Set,this.subscribe=s=>{var o,l;this.listeners.add(s);const u=(l=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:l.call(o,s,this);return()=>{this.listeners.delete(s),u?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,s,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):pz(t)?this.state=t(this.prevState):this.state=t,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),vN(this)}}const Va="__TSR_index",A1="popstate",O1="beforeunload";function vz(e){let t=e.getLocation();const n=new Set,s=u=>{t=e.getLocation(),n.forEach(d=>d({location:t,action:u}))},o=u=>{e.notifyOnIndexChange??!0?s(u):t=e.getLocation()},l=async({task:u,navigateOpts:d,...h})=>{if(d?.ignoreBlocker??!1){u();return}const v=e.getBlockers?.()??[],g=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&v.length&&g)for(const y of v){const w=Kf(h.path,h.state);if(await y.blockerFn({currentLocation:t,nextLocation:w,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,d,h)=>{const m=t.state[Va];d=D1(m+1,d),l({task:()=>{e.pushState(u,d),s({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:d})},replace:(u,d,h)=>{const m=t.state[Va];d=D1(m,d),l({task:()=>{e.replaceState(u,d),s({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:d})},go:(u,d)=>{l({task:()=>{e.go(u),o({type:"GO",index:u})},navigateOpts:d,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Va]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const d=e.getBlockers?.()??[];return e.setBlockers([...d,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(m=>m!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function D1(e,t){t||(t={});const n=zx();return{...t,key:n,__TSR_key:n,[Va]:e}}function xz(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let o=[];const l=()=>o,u=O=>o=O,d=(O=>O),h=(()=>Kf(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const O=zx();t.history.replaceState({[Va]:0,key:O,__TSR_key:O},"")}let m=h(),v,g=!1,y=!1,w=!1,S=!1;const j=()=>m;let N,C;const _=()=>{N&&(T._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),T._ignoreSubscribers=!1,N=void 0,C=void 0,v=void 0)},E=(O,D,z)=>{const B=d(D);C||(v=m),m=Kf(D,z),N={href:B,state:z,isPush:N?.isPush||O==="push"},C||(C=Promise.resolve().then(()=>_()))},M=O=>{m=h(),T.notify({type:O})},A=async()=>{if(y){y=!1;return}const O=h(),D=O.state[Va]-m.state[Va],z=D===1,B=D===-1,q=!z&&!B||g;g=!1;const Y=q?"GO":B?"BACK":"FORWARD",G=q?{type:"GO",index:D}:{type:B?"BACK":"FORWARD"};if(w)w=!1;else{const ae=l();if(typeof document<"u"&&ae.length){for(const L of ae)if(await L.blockerFn({currentLocation:m,nextLocation:O,action:Y})){y=!0,t.history.go(1),T.notify(G);return}}}m=h(),T.notify(G)},R=O=>{if(S){S=!1;return}let D=!1;const z=l();if(typeof document<"u"&&z.length)for(const B of z){const q=B.enableBeforeUnload??!0;if(q===!0){D=!0;break}if(typeof q=="function"&&q()===!0){D=!0;break}}if(D)return O.preventDefault(),O.returnValue=""},T=vz({getLocation:j,getLength:()=>t.history.length,pushState:(O,D)=>E("push",O,D),replaceState:(O,D)=>E("replace",O,D),back:O=>(O&&(w=!0),S=!0,t.history.back()),forward:O=>{O&&(w=!0),S=!0,t.history.forward()},go:O=>{g=!0,t.history.go(O)},createHref:O=>d(O),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(O1,R,{capture:!0}),t.removeEventListener(A1,A)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(O1,R,{capture:!0}),t.addEventListener(A1,A),t.history.pushState=function(...O){const D=n.apply(t.history,O);return T._ignoreSubscribers||M("PUSH"),D},t.history.replaceState=function(...O){const D=s.apply(t.history,O);return T._ignoreSubscribers||M("REPLACE"),D},T}function yz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Kf(e,t){const n=yz(e),s=n.indexOf("#"),o=n.indexOf("?"),l=zx();return{href:n,pathname:n.substring(0,s>0?o>0?Math.min(s,o):s:o>0?o:n.length),hash:s>-1?n.substring(s):"",search:o>-1?n.slice(o,s===-1?void 0:s):"",state:t||{[Va]:0,key:l,__TSR_key:l}}}function zx(){return(Math.random()+1).toString(36).substring(7)}const bz=!1;function ou(e){let t;return mz(()=>{t=e()}),t}function hu(e){return e[e.length-1]}function wz(e){return typeof e=="function"}function Ba(e,t){return wz(e)?e(t):e}const Sz=Object.prototype.hasOwnProperty,z1=Object.prototype.propertyIsEnumerable;function er(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,o=I1(e)&&I1(s);if(!o&&!(Xf(e)&&Xf(s)))return s;const l=o?e:P1(e);if(!l)return s;const u=o?s:P1(s);if(!u)return s;const d=l.length,h=u.length,m=o?new Array(h):{};let v=0;for(let g=0;g<h;g++){const y=o?g:u[g],w=e[y],S=s[y];if(w===S){m[y]=w,(o?g<d:Sz.call(e,y))&&v++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){m[y]=S;continue}const j=er(w,S,n+1);m[y]=j,j===w&&v++}return d===h&&v===d?e:m}function P1(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!z1.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const s=t;for(const o of n){if(!z1.call(e,o))return!1;s.push(o)}return s}function Xf(e){if(!L1(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!L1(n)||!n.hasOwnProperty("isPrototypeOf"))}function L1(e){return Object.prototype.toString.call(e)==="[object Object]"}function I1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ao(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,o=e.length;s<o;s++)if(!Ao(e[s],t[s],n))return!1;return!0}if(Xf(e)&&Xf(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!s||t[u]!==void 0)&&!Ao(e[u],t[u],n))return!1;return!0}let o=0;if(!s)o=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&o++;let l=0;for(const u in t)if((!s||t[u]!==void 0)&&(l++,l>o||!Ao(e[u],t[u],n)))return!1;return o===l}return!1}function hl(e){let t,n;const s=new Promise((o,l)=>{t=o,n=l});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,t(o),e?.(o)},s.reject=o=>{s.status="rejected",n(o)},s}function rl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function jz(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function $1(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return jz(t)}const xN=["http:","https:","mailto:","tel:"];function Jf(e){if(!e)return!1;try{const t=new URL(e);return!xN.includes(t.protocol)}catch{return!1}}function Lc(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let s=0,o="",l;for(;(l=n.exec(e))!==null;)o+=$1(e.slice(s,l.index))+l[0],s=n.lastIndex;return o=o+$1(s?e.slice(s):e),o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}function Cz(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var Nz="Invariant failed";function ca(e,t){if(!e)throw new Error(Nz)}function eh(e){const t=new Map;let n,s;const o=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,s&&(s.next=l,l.prev=s)):(l.next.prev=void 0,n=l.next,l.next=void 0,s&&(l.prev=s,s.next=l)),s=l)};return{get(l){const u=t.get(l);if(u)return o(u),u.value},set(l,u){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===s&&(s=void 0)}const d=t.get(l);if(d)d.value=u,o(d);else{const h={key:l,value:u,prev:s};s&&(s.next=h),s=h,n||(n=h),t.set(l,h)}},clear(){t.clear(),n=void 0,s=void 0}}}const ml=0,Po=1,Lo=2,mu=3,_o=4,yN=5;function kz(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Px(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),o=s===-1?e.length:s,l=e.substring(t,o);if(!l||!l.includes("$"))return n[0]=ml,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(l==="$"){const d=e.length;return n[0]=Lo,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(l.charCodeAt(0)===36)return n[0]=Po,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const u=kz(l);if(u){const[d,h]=u,m=l.charCodeAt(d+1);if(m===45){if(d+2<l.length&&l.charCodeAt(d+2)===36){const v=d+3,g=h;if(v<g)return n[0]=mu,n[1]=t+d,n[2]=t+v,n[3]=t+g,n[4]=t+h+1,n[5]=o,n}}else if(m===36){const v=d+1,g=d+2;return g===h?(n[0]=Lo,n[1]=t+d,n[2]=t+v,n[3]=t+g,n[4]=t+h+1,n[5]=e.length,n):(n[0]=Po,n[1]=t+d,n[2]=t+g,n[3]=t+h,n[4]=t+h+1,n[5]=o,n)}}return n[0]=ml,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function Th(e,t,n,s,o,l,u){u?.(n);let d=s;{const h=n.fullPath??n.from,m=h.length,v=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;d<m;){const w=Px(h,d,t);let S;const j=d,N=w[5];switch(d=N+1,l++,w[0]){case ml:{const _=h.substring(w[2],w[3]);if(v){const E=o.static?.get(_);if(E)S=E;else{o.static??=new Map;const M=Eo(n.fullPath??n.from);M.parent=o,M.depth=l,S=M,o.static.set(_,M)}}else{const E=_.toLowerCase(),M=o.staticInsensitive?.get(E);if(M)S=M;else{o.staticInsensitive??=new Map;const A=Eo(n.fullPath??n.from);A.parent=o,A.depth=l,S=A,o.staticInsensitive.set(E,A)}}break}case Po:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=!g&&o.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===M&&O.prefix===A&&O.suffix===R);if(T)S=T;else{const O=qg(Po,n.fullPath??n.from,M,A,R);S=O,O.depth=l,O.parent=o,o.dynamic??=[],o.dynamic.push(O)}break}case mu:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=!g&&o.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===M&&O.prefix===A&&O.suffix===R);if(T)S=T;else{const O=qg(mu,n.fullPath??n.from,M,A,R);S=O,O.parent=o,O.depth=l,o.optional??=[],o.optional.push(O)}break}case Lo:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=qg(Lo,n.fullPath??n.from,M,A,R);S=T,T.parent=o,T.depth=l,o.wildcard??=[],o.wildcard.push(T)}}o=S}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const w=Eo(n.fullPath??n.from);w.kind=yN,w.parent=o,l++,w.depth=l,o.pathless??=[],o.pathless.push(w),o=w}const y=(n.path||!n.children)&&!n.isRoot;if(y&&h.endsWith("/")){const w=Eo(n.fullPath??n.from);w.kind=_o,w.parent=o,l++,w.depth=l,o.index=w,o=w}o.parse=n.options?.params?.parse??null,o.skipOnParamError=g,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const h of n.children)Th(e,t,h,d,o,l,u)}function Vg(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Fa(e){if(e.pathless)for(const t of e.pathless)Fa(t);if(e.static)for(const t of e.static.values())Fa(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Fa(t);if(e.dynamic?.length){e.dynamic.sort(Vg);for(const t of e.dynamic)Fa(t)}if(e.optional?.length){e.optional.sort(Vg);for(const t of e.optional)Fa(t)}if(e.wildcard?.length){e.wildcard.sort(Vg);for(const t of e.wildcard)Fa(t)}}function Eo(e){return{kind:ml,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function qg(e,t,n,s,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:s,suffix:o}}function _z(e,t){const n=Eo("/"),s=new Uint16Array(6);for(const o of e)Th(!1,s,o,1,n,0);Fa(n),t.masksTree=n,t.flatCache=eh(1e3)}function Ez(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=Lx(e,t.masksTree);return t.flatCache.set(e,s),s}function Tz(e,t,n,s,o){e||="/",s||="/";const l=t?`case\0${e}`:e;let u=o.singleCache.get(l);if(!u){u=Eo("/");const d=new Uint16Array(6);Th(t,d,{from:e},1,u,0),o.singleCache.set(l,u)}return Lx(s,u,n)}function Mz(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,o=t.matchCache.get(s);if(o!==void 0)return o;e||="/";let l;try{l=Lx(e,t.segmentTree,n)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=Oz(l.route)),t.matchCache.set(s,l),l}function Rz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Az(e,t=!1,n){const s=Eo(e.fullPath),o=new Uint16Array(6),l={},u={};let d=0;return Th(t,o,e,1,s,0,m=>{if(n?.(m,d),ca(!(m.id in l),`Duplicate routes found with id: ${String(m.id)}`),l[m.id]=m,d!==0&&m.path){const v=Rz(m.fullPath);(!u[v]||m.fullPath.endsWith("/"))&&(u[v]=m)}d++}),Fa(s),{processedTree:{segmentTree:s,singleCache:eh(1e3),matchCache:eh(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Lx(e,t,n=!1){const s=e.split("/"),o=zz(e,s,t,n);if(!o)return null;const[l]=bN(e,s,o);return{route:o.node.route,rawParams:l,parsedParams:o.parsedParams}}function bN(e,t,n){const s=Dz(n.node);let o=null;const l={};let u=n.extract?.part??0,d=n.extract?.node??0,h=n.extract?.path??0,m=n.extract?.segment??0;for(;d<s.length;u++,d++,h++,m++){const v=s[d];if(v.kind===_o)break;if(v.kind===yN){m--,u--,h--;continue}const g=t[u],y=h;if(g&&(h+=g.length),v.kind===Po){o??=n.node.fullPath.split("/");const w=o[m],S=v.prefix?.length??0;if(w.charCodeAt(S)===123){const N=v.suffix?.length??0,C=w.substring(S+2,w.length-N-1),_=g.substring(S,g.length-N);l[C]=decodeURIComponent(_)}else{const N=w.substring(1);l[N]=decodeURIComponent(g)}}else if(v.kind===mu){if(n.skipped&1<<d){u--,h=y-1;continue}o??=n.node.fullPath.split("/");const w=o[m],S=v.prefix?.length??0,j=v.suffix?.length??0,N=w.substring(S+3,w.length-j-1),C=v.suffix||v.prefix?g.substring(S,g.length-j):g;C&&(l[N]=decodeURIComponent(C))}else if(v.kind===Lo){const w=v,S=e.substring(y+(w.prefix?.length??0),e.length-(w.suffix?.length??0)),j=decodeURIComponent(S);l["*"]=j,l._splat=j;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:u,node:d,path:h,segment:m}]}function Oz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Dz(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function zz(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!hu(t),l=o&&e!=="/",u=t.length-(o?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,m=null,v=null;for(;d.length;){const g=d.pop(),{node:y,index:w,skipped:S,depth:j,statics:N,dynamics:C,optionals:_}=g;let{extract:E,rawParams:M,parsedParams:A}=g;if(y.skipOnParamError){if(!Hg(e,t,g))continue;M=g.rawParams,E=g.extract,A=g.parsedParams}s&&y.route&&y.kind!==_o&&Ic(m,g)&&(m=g);const R=w===u;if(R&&(y.route&&!l&&Ic(v,g)&&(v=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const T=R?void 0:t[w];let O;if(R&&y.index){const D={node:y.index,index:w,skipped:S,depth:j+1,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A};let z=!0;if(y.index.skipOnParamError&&(Hg(e,t,D)||(z=!1)),z){if(N===u&&!C&&!_&&!S)return D;Ic(v,D)&&(v=D)}}if(y.wildcard&&Ic(h,g))for(const D of y.wildcard){const{prefix:z,suffix:B}=D;if(z&&(R||!(D.caseSensitive?T:O??=T.toLowerCase()).startsWith(z)))continue;if(B){if(R)continue;const Y=t.slice(w).join("/").slice(-B.length);if((D.caseSensitive?Y:Y.toLowerCase())!==B)continue}const q={node:D,index:u,skipped:S,depth:j,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A};if(!(D.skipOnParamError&&!Hg(e,t,q))){h=q;break}}if(y.optional){const D=S|1<<j,z=j+1;for(let B=y.optional.length-1;B>=0;B--){const q=y.optional[B];d.push({node:q,index:w,skipped:D,depth:z,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R)for(let B=y.optional.length-1;B>=0;B--){const q=y.optional[B],{prefix:Y,suffix:G}=q;if(Y||G){const ae=q.caseSensitive?T:O??=T.toLowerCase();if(Y&&!ae.startsWith(Y)||G&&!ae.endsWith(G))continue}d.push({node:q,index:w+1,skipped:S,depth:z,statics:N,dynamics:C,optionals:_+1,extract:E,rawParams:M,parsedParams:A})}}if(!R&&y.dynamic&&T)for(let D=y.dynamic.length-1;D>=0;D--){const z=y.dynamic[D],{prefix:B,suffix:q}=z;if(B||q){const Y=z.caseSensitive?T:O??=T.toLowerCase();if(B&&!Y.startsWith(B)||q&&!Y.endsWith(q))continue}d.push({node:z,index:w+1,skipped:S,depth:j+1,statics:N,dynamics:C+1,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R&&y.staticInsensitive){const D=y.staticInsensitive.get(O??=T.toLowerCase());D&&d.push({node:D,index:w+1,skipped:S,depth:j+1,statics:N+1,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R&&y.static){const D=y.static.get(T);D&&d.push({node:D,index:w+1,skipped:S,depth:j+1,statics:N+1,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(y.pathless){const D=j+1;for(let z=y.pathless.length-1;z>=0;z--){const B=y.pathless[z];d.push({node:B,index:w,skipped:S,depth:D,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}}}if(v&&h)return Ic(h,v)?v:h;if(v)return v;if(h)return h;if(s&&m){let g=m.index;for(let w=0;w<m.index;w++)g+=t[w].length;const y=g===e.length?"/":e.slice(g);return m.rawParams??={},m.rawParams["**"]=decodeURIComponent(y),m}return null}function Hg(e,t,n){try{const[s,o]=bN(e,t,n);n.rawParams=s,n.extract=o;const l=n.node.parse(s);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch{return null}}function Ic(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===_o)>(e.node.kind===_o)||t.node.kind===_o==(e.node.kind===_o)&&t.depth>e.depth))):!0}function If(e){return Ix(e.filter(t=>t!==void 0).join("/"))}function Ix(e){return e.replace(/\/{2,}/g,"/")}function wN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ta(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function SN(e){return ta(wN(e))}function th(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Pz(e,t,n){return th(e,n)===th(t,n)}function Lz({base:e,to:t,trailingSlash:n="never",cache:s}){const o=t.startsWith("/"),l=!o&&t===".";let u;if(s){u=o?t:l?e:e+"\0"+t;const g=s.get(u);if(g)return g}let d;if(l)d=e.split("/");else if(o)d=t.split("/");else{for(d=e.split("/");d.length>1&&hu(d)==="";)d.pop();const g=t.split("/");for(let y=0,w=g.length;y<w;y++){const S=g[y];S===""?y?y===w-1&&d.push(S):d=[S]:S===".."?d.pop():S==="."||d.push(S)}}d.length>1&&(hu(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));let h,m="";for(let g=0;g<d.length;g++){g>0&&(m+="/");const y=d[g];if(!y)continue;h=Px(y,0,h);const w=h[0];if(w===ml){m+=y;continue}const S=h[5],j=y.substring(0,h[1]),N=y.substring(h[4],S),C=y.substring(h[2],h[3]);w===Po?m+=j||N?`${j}{$${C}}${N}`:`$${C}`:w===Lo?m+=j||N?`${j}{$}${N}`:"$":m+=`${j}{-$${C}}${N}`}m=Ix(m);const v=m||"/";return u&&s&&s.set(u,v),v}function Iz(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(n,"g");return o=>o.replace(s,l=>t.get(l)??l)}function Yg(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(o=>F1(o,n)).join("/"):F1(s,n)}function Wg({path:e,params:t,decoder:n,server:s}){let o=!1;const l={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:o};const u=e.length;let d=0,h,m="";for(;d<u;){const g=d;h=Px(e,g,h);const y=h[5];if(d=y+1,g===y)continue;const w=h[0];if(w===ml){m+="/"+e.substring(g,y);continue}if(w===Lo){const S=t._splat;l._splat=S,l["*"]=S;const j=e.substring(g,h[1]),N=e.substring(h[4],y);if(!S){o=!0,(j||N)&&(m+="/"+j+N);continue}const C=Yg("_splat",t,n);m+="/"+j+C+N;continue}if(w===Po){const S=e.substring(h[2],h[3]);!o&&!(S in t)&&(o=!0),l[S]=t[S];const j=e.substring(g,h[1]),N=e.substring(h[4],y),C=Yg(S,t,n)??"undefined";m+="/"+j+C+N;continue}if(w===mu){const S=e.substring(h[2],h[3]),j=t[S];if(j==null)continue;l[S]=j;const N=e.substring(g,h[1]),C=e.substring(h[4],y),_=Yg(S,t,n)??"";m+="/"+N+_+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:l,interpolatedPath:m||"/",isMissingParams:o}}function F1(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function br(e){return!!e?.isNotFound}function $z(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Hv="tsr-scroll-restoration-v1_3",Fz=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function Bz(){const e=$z();if(!e)return null;const t=e.getItem(Hv);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Ba(s,n)||n;try{e.setItem(Hv,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const yf=Bz(),Uz=e=>e.state.__TSR_key||e.href;function Vz(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let nh=!1;function qz({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:o,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const d=t||window.history.state?.__TSR_key,h=u[d];nh=!0;e:{if(s&&h&&Object.keys(h).length>0){for(const g in h){const y=h[g];if(g==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(g){const w=document.querySelector(g);w&&(w.scrollLeft=y.scrollX,w.scrollTop=y.scrollY)}}break e}const m=(l??window.location).hash.split("#",2)[1];if(m){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const y=document.getElementById(m);y&&y.scrollIntoView(g)}break e}const v={top:0,left:0,behavior:n};if(window.scrollTo(v),o)for(const g of o){if(g==="window")continue;const y=typeof g=="function"?g():document.querySelector(g);y&&y.scrollTo(v)}}nh=!1}function Hz(e,t){if(!yf||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!yf))return;e.isScrollRestorationSetup=!0,nh=!1;const s=e.options.getScrollRestorationKey||Uz;window.history.scrollRestoration="manual";const o=l=>{if(nh||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const h=l.target.getAttribute("data-scroll-restoration-id");h?u=`[data-scroll-restoration-id="${h}"]`:u=Vz(l.target)}const d=s(e.state.location);yf.set(h=>{const m=h[d]||={},v=m[u]||={};if(u==="window")v.scrollX=window.scrollX||0,v.scrollY=window.scrollY||0;else if(u){const g=document.querySelector(u);g&&(v.scrollX=g.scrollLeft||0,v.scrollY=g.scrollTop||0)}return h})};typeof document<"u"&&document.addEventListener("scroll",Fz(o,100),!0),e.subscribe("onRendered",l=>{const u=s(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(qz({storageKey:Hv,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&yf.set(d=>(d[u]||={},d)))})}function Yz(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function Wz(e,t=String){const n=new URLSearchParams;for(const s in e){const o=e[s];o!==void 0&&n.set(s,t(o))}return n.toString()}function Gg(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Gz(e){const t=new URLSearchParams(e),n={};for(const[s,o]of t.entries()){const l=n[s];l==null?n[s]=Gg(o):Array.isArray(l)?l.push(Gg(o)):n[s]=[l,Gg(o)]}return n}const Zz=Kz(JSON.parse),Qz=Xz(JSON.stringify,JSON.parse);function Kz(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Gz(t);for(const s in n){const o=n[s];if(typeof o=="string")try{n[s]=e(o)}catch{}}return n}}function Xz(e,t){const n=typeof t=="function";function s(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const l=Wz(o,s);return l?`?${l}`:""}}const Fr="__root__";function Jz(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&Jf(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${xN.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Br(e){return e instanceof Response&&!!e.options}const $f=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Mh=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),sl=(e,t,n=!0)=>{const s={...e.router.options.context??{}},o=n?t:t-1;for(let l=0;l<=o;l++){const u=e.matches[l];if(!u)continue;const d=e.router.getMatch(u.id);d&&Object.assign(s,d.__routeContext,d.__beforeLoadContext)}return s},jN=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ca(n.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===n.id);ca(s,"Could not find match for route: "+n.id),e.updateMatch(s.id,o=>({...o,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,jN(e,t))},Ua=(e,t,n)=>{if(!(!Br(n)&&!br(n))){if(Br(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const s=Br(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:s,context:sl(e,t.index),isFetching:!1,error:n})),br(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Br(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(jN(e,n),n)}},CN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,$c=(e,t,n,s)=>{const{id:o,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,Ua(e,e.router.getMatch(o),n);try{u.options.onError?.(n)}catch(d){n=d,Ua(e,e.router.getMatch(o),n)}e.updateMatch(o,d=>(d._nonReactive.beforeLoadPromise?.resolve(),d._nonReactive.beforeLoadPromise=void 0,d._nonReactive.loadPromise?.resolve(),{...d,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},NN=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Mh(e,t)&&(n.options.loader||n.options.beforeLoad||EN(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{$f(e)},o);s._nonReactive.pendingTimeout=u}},e4=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;NN(e,t,n,s);const o=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&Ua(e,l,l.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},t4=(e,t,n,s)=>{const o=e.router.getMatch(t),l=o._nonReactive.loadPromise;o._nonReactive.loadPromise=hl(()=>{l?.resolve()});const{paramsError:u,searchError:d}=o;u&&$c(e,n,u,"PARSE_PARAMS"),d&&$c(e,n,d,"VALIDATE_SEARCH"),NN(e,t,s,o);const h=new AbortController;let m=!1;const v=()=>{m||(m=!0,e.updateMatch(t,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:h})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,M=>({...M,isFetching:!1}))};if(!s.options.beforeLoad){ou(()=>{v(),g()});return}o._nonReactive.beforeLoadPromise=hl();const y={...sl(e,n,!1),...o.__routeContext},{search:w,params:S,cause:j}=o,N=Mh(e,t),C={search:w,abortController:h,params:S,preload:N,context:y,location:e.location,navigate:M=>e.router.navigate({...M,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":j,matches:e.matches,...e.router.options.additionalContext},_=M=>{if(M===void 0){ou(()=>{v(),g()});return}(Br(M)||br(M))&&(v(),$c(e,n,M,"BEFORE_LOAD")),ou(()=>{v(),e.updateMatch(t,A=>({...A,__beforeLoadContext:M})),g()})};let E;try{if(E=s.options.beforeLoad(C),rl(E))return v(),E.catch(M=>{$c(e,n,M,"BEFORE_LOAD")}).then(_)}catch(M){v(),$c(e,n,M,"BEFORE_LOAD")}_(E)},n4=(e,t)=>{const{id:n,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],l=()=>d(),u=()=>t4(e,n,t,o),d=()=>{if(CN(e,n))return;const h=e4(e,n,o);return rl(h)?h.then(u):u()};return l()},r4=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([l,u,d])=>{const h=l?.meta,m=l?.links,v=l?.scripts,g=l?.styles;return{meta:h,links:m,headScripts:v,headers:d,scripts:u,styles:g}})},kN=(e,t,n,s)=>{const o=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:d,cause:h}=e.router.getMatch(t),m=sl(e,n),v=Mh(e,t);return{params:l,deps:u,preload:!!v,parentMatchPromise:o,abortController:d,context:m,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:v?"preload":h,route:s,...e.router.options.additionalContext}},B1=async(e,t,n,s)=>{try{const o=e.router.getMatch(t);try{(!(bz??e.router.isServer)||o.ssr===!0)&&_N(s);const l=s.options.loader?.(kN(e,t,n,s)),u=s.options.loader&&rl(l);if((u||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,m=>({...m,isFetching:"loader"})),s.options.loader){const m=u?await l:l;Ua(e,e.router.getMatch(t),m),m!==void 0&&e.updateMatch(t,v=>({...v,loaderData:m}))}s._lazyPromise&&await s._lazyPromise;const h=o._nonReactive.minPendingPromise;h&&await h,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,m=>({...m,error:void 0,context:sl(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){e.updateMatch(t,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:sl(e,n)}));return}const d=o._nonReactive.minPendingPromise;d&&await d,br(l)&&await s.options.notFoundComponent?.preload?.(),Ua(e,e.router.getMatch(t),l);try{s.options.onError?.(l)}catch(h){u=h,Ua(e,e.router.getMatch(t),h)}e.updateMatch(t,h=>({...h,error:u,context:sl(e,n),status:"error",isFetching:!1}))}}catch(o){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),Ua(e,l,o)}},s4=async(e,t)=>{const{id:n,routeId:s}=e.matches[t];let o=!1,l=!1;const u=e.router.looseRoutesById[s];if(!CN(e,n)){const m=e.router.getMatch(n);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!e.sync&&!m.preload)return m;await m._nonReactive.loaderPromise;const v=e.router.getMatch(n),g=v._nonReactive.error||v.error;g&&Ua(e,v,g)}else{const v=Date.now()-m.updatedAt,g=Mh(e,n),y=g?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,w=u.options.shouldReload,S=typeof w=="function"?w(kN(e,n,t,u)):w,j=!!g&&!e.router.state.matches.some(E=>E.id===n),N=e.router.getMatch(n);N._nonReactive.loaderPromise=hl(),j!==N.preload&&e.updateMatch(n,E=>({...E,preload:j}));const{status:C,invalid:_}=N;o=C==="success"&&(_||(S??v>y)),g&&u.options.preload===!1||(o&&!e.sync?(l=!0,(async()=>{try{await B1(e,n,t,u);const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){Br(E)&&await e.router.navigate(E.options)}})()):(C!=="success"||o&&e.sync)&&await B1(e,n,t,u))}}const d=e.router.getMatch(n);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(n,m=>({...m,isFetching:h,invalid:!1})),e.router.getMatch(n)):d};async function U1(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&$f(t);try{for(let d=0;d<t.matches.length;d++){const h=n4(t,d);rl(h)&&await h}const n=t.firstBadMatchIndex??t.matches.length;for(let d=0;d<n;d++)t.matchPromises.push(s4(t,d));const o=(await Promise.allSettled(t.matchPromises)).filter(d=>d.status==="rejected").map(d=>d.reason);let l;for(const d of o){if(Br(d))throw d;!l&&br(d)&&(l=d)}for(const d of t.matches){const{id:h,routeId:m}=d,v=t.router.looseRoutesById[m];try{const g=r4(t,h,v);if(g){const y=await g;t.updateMatch(h,w=>({...w,...y}))}}catch(g){console.error(`Error executing head for route ${m}:`,g)}}if(l)throw l;const u=$f(t);rl(u)&&await u}catch(n){if(br(n)&&!t.preload){const s=$f(t);throw rl(s)&&await s,n}if(Br(n))throw n}return t.matches}async function _N(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of TN){const o=e.options[s]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function EN(e){for(const t of TN)if(e.options[t]?.preload)return!0;return!1}const TN=["component","errorComponent","pendingComponent","notFoundComponent"];function a4(e){return{input:({url:t})=>{for(const n of e)t=Yv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=MN(e[n],t);return t}}}function o4(e){const t=SN(e.basepath),n=`/${t}`,s=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?s:s.toLowerCase();return{input:({url:u})=>{const d=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return d===o?u.pathname="/":d.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=If(["/",t,u.pathname]),u)}}function Yv(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function MN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Oo(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,o=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:o,hashChanged:l}}class i4{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,o=this.basepath??s?.basepath??"/",l=this.basepath===void 0,u=s?.rewrite;if(this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Iz(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=xz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let y;this.resolvePathCache=eh(1e3),y=this.buildRouteTree(),this.setRoutes(y)}!this.__store&&this.latestLocation&&(this.__store=new gz(c4(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(y=>!["redirected"].includes(y.status))}}}),Hz(this));let d=!1;const h=this.options.basepath??"/",m=this.options.rewrite;if(l||o!==h||u!==m){this.basepath=h;const y=[],w=SN(h);w&&w!=="/"&&y.push(o4({basepath:h})),m&&y.push(m),this.rewrite=y.length===0?void 0:y.length===1?y[0]:a4(y),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Az(this.routeTree,this.options.caseSensitive,(s,o)=>{s.init({originalIndex:o})});return this.options.routeMasks&&_z(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,s)=>{const o={eventType:n,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const o=({pathname:h,search:m,hash:v,href:g,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const _=this.options.parseSearch(m),E=this.options.stringifySearch(_);return{href:h+E+v,publicHref:g,pathname:Lc(h),external:!1,searchStr:E,search:er(s?.search,_),hash:Lc(v.slice(1)),state:er(s?.state,y)}}const w=new URL(g,this.origin),S=Yv(this.rewrite,w),j=this.options.parseSearch(S.search),N=this.options.stringifySearch(j);return S.search=N,{href:S.href.replace(S.origin,""),publicHref:g,pathname:Lc(S.pathname),external:!!this.rewrite&&S.origin!==this.origin,searchStr:N,search:er(s?.search,j),hash:Lc(S.hash.slice(1)),state:er(s?.state,y)}},l=o(n),{__tempLocation:u,__tempKey:d}=l.state;if(u&&(!d||d===this.tempLocationKey)){const h=o(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(n,s)=>Lz({base:n,to:Ix(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},o):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>u4({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),s=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const s=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??d.fullPath,m=this.resolvePathWithBase(h,"."),v=d.search,g={...d.params},y=l.to?this.resolvePathWithBase(m,`${l.to}`):this.resolvePathWithBase(m,"."),w=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,Ba(l.params,g)),S=Wg({path:y,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,j=this.getMatchedRoutes(S);let N=j.matchedRoutes;(j.foundRoute?j.foundRoute.path!=="/"&&j.routeParams["**"]:ta(S))&&this.options.notFoundRoute&&(N=[...N,this.options.notFoundRoute]);let _=!1;if(Object.keys(w).length>0)for(const Y of N){const G=Y.options.params?.stringify??Y.options.stringifyParams;G&&(_=!0,Object.assign(w,G(w)))}const E=n.leaveParams?y:Lc(_?Wg({path:y,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:S);let M=v;if(n._includeValidateSearch&&this.options.search?.strict){const Y={};N.forEach(G=>{if(G.options.validateSearch)try{Object.assign(Y,Ff(G.options.validateSearch,{...Y,...M}))}catch{}}),M=Y}M=d4({search:M,dest:l,destRoutes:N,_includeValidateSearch:n._includeValidateSearch}),M=er(v,M);const A=this.options.stringifySearch(M),R=l.hash===!0?u.hash:l.hash?Ba(l.hash,u.hash):void 0,T=R?`#${R}`:"";let O=l.state===!0?u.state:l.state?Ba(l.state,u.state):{};O=er(u.state,O);const D=`${E}${A}${T}`;let z,B,q=!1;if(this.rewrite){const Y=new URL(D,this.origin),G=MN(this.rewrite,Y);z=Y.href.replace(Y.origin,""),G.origin!==this.origin?(B=G.href,q=!0):B=G.pathname+G.search+G.hash}else z=Cz(D),B=z;return{publicHref:B,href:z,pathname:E,search:M,searchStr:A,state:O,hash:R??"",external:q,unmaskOnReload:l.unmaskOnReload}},o=(l={},u)=>{const d=s(l);let h=u?s(u):void 0;if(!h){const m={};if(this.options.routeMasks){const v=Ez(d.pathname,this.processedTree);if(v){Object.assign(m,v.rawParams);const{from:g,params:y,...w}=v.route,S=y===!1||y===null?{}:(y??!0)===!0?m:Object.assign(m,Ba(y,m));u={from:n.from,...w,params:S},h=s(u)}}}return h&&(d.maskedLocation=h),d};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:s,...o})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(v=>{o.state[v]=this.latestLocation.state[v]});const m=Ao(o.state,this.latestLocation.state);return h.forEach(v=>{delete o.state[v]}),m},u=ta(this.latestLocation.href)===ta(o.href),d=this.commitLocationPromise;if(this.commitLocationPromise=hl(()=>{d?.resolve()}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:m,...v}=o;h&&(v={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...v,search:v.searchStr,state:{...v.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(v.unmaskOnReload??this.options.unmaskOnReload??!1)&&(v.state.__tempKey=this.tempLocationKey)),v.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](v.publicHref,v.state,{ignoreBlocker:s})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:o,viewTransition:l,ignoreBlocker:u,href:d,...h}={})=>{if(d){const g=this.history.location.state.__TSR_index,y=Kf(d,{__TSR_index:n?g:g+1}),w=new URL(y.pathname,this.origin),S=Yv(this.rewrite,w);h.to=S.pathname,h.search=this.options.parseSearch(y.search),h.hash=y.hash.slice(1)}const m=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const v=this.commitLocation({...m,viewTransition:l,replace:n,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),v},this.navigate=async({to:n,reloadDocument:s,href:o,publicHref:l,...u})=>{let d=!1;if(o)try{new URL(`${o}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(n!==void 0||!o){const m=this.buildLocation({to:n,...u});o=o??m.publicHref,l=l??m.publicHref}const h=!d&&l?l:o;if(Jf(h))return Promise.resolve();if(!u.ignoreBlocker){const v=this.history.getBlockers?.()??[];for(const g of v)if(g?.blockerFn&&await g.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(o=>!n.some(l=>l.id===o.id))}))},this.load=async n=>{let s,o,l;for(l=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad();const h=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Oo({resolvedLocation:m,location:h})}),this.emit({type:"onBeforeLoad",...Oo({resolvedLocation:m,location:h})}),await U1({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],g=[],y=[];ou(()=>{this.__store.setState(w=>{const S=w.matches,j=w.pendingMatches||w.matches;return v=S.filter(N=>!j.some(C=>C.id===N.id)),g=j.filter(N=>!S.some(C=>C.id===N.id)),y=j.filter(N=>S.some(C=>C.id===N.id)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(N=>N.status!=="error"&&N.status!=="notFound")]}}),this.clearExpiredCache()}),[[v,"onLeave"],[g,"onEnter"],[y,"onStay"]].forEach(([w,S])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[S]?.(j)})})})})}})}catch(h){Br(h)?(s=h,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):br(h)&&(o=h),this.__store.setState(m=>({...m,statusCode:s?s.status:o?404:m.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(d=>d.status==="error")&&(u=500),u!==void 0&&this.__store.setState(d=>({...d,statusCode:u}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(Oo({resolvedLocation:u,location:l})):s.types;if(d===!1){n();return}o={update:n,types:d}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";o&&this.__store.setState(l=>({...l,[o]:l[o]?.map(u=>u.id===n?s(u):u)}))})},this.getMatch=n=>{const s=o=>o.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(s),cachedMatches:o.cachedMatches.map(s),pendingMatches:o.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const s=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),l=this.getParsedLocationHref(o);n.options.href=l,n.headers.set("Location",l)}else if(s)try{const o=new URL(s);if(this.origin&&o.origin===this.origin){const l=o.pathname+o.search+o.hash;n.options.href=l,n.headers.set("Location",l)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const s=n?.filter;s!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(l=>!s(l))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const l=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=_N,this.preloadRoute=async n=>{const s=this.buildLocation(n);let o=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),u=new Set([...l,...this.state.cachedMatches.map(d=>d.id)]);ou(()=>{o.forEach(d=>{u.has(d.id)||this.__store.setState(h=>({...h,cachedMatches:[...h.cachedMatches,d]}))})});try{return o=await U1({router:this,matches:o,location:s,preload:!0,updateMatch:(d,h)=>{l.has(d)?o=o.map(m=>m.id===d?h(m):m):this.updateMatch(d,h)}}),o}catch(d){if(Br(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});br(d)||console.error(d);return}},this.matchRoute=(n,s)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(o);if(s?.pending&&this.state.status!=="pending")return!1;const d=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,h=Tz(l.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,d.pathname,this.processedTree);return!h||n.params&&!Ao(h.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?Ao(d.search,l.search,{partial:!0})?h.rawParams:!1:h.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Qz,parseSearch:t.parseSearch??Zz}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:s}){this.routesById=t,this.routesByPath=n,this.processedTree=s;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const s=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:l,parsedParams:u}=s;let{matchedRoutes:d}=s,h=!1;(o?o.path!=="/"&&l["**"]:ta(t.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:h=!0);const m=h?h4(this.options.notFoundMode,d):void 0,v=[],g=y=>y?.id?y.context??this.options.context??void 0:this.options.context??void 0;return d.forEach((y,w)=>{const S=v[w-1],[j,N,C]=(()=>{const G=S?.search??t.search,ae=S?._strictSearch??void 0;try{const L=Ff(y.options.validateSearch,{...G})??void 0;return[{...G,...L},{...ae,...L},void 0]}catch(L){let $=L;if(L instanceof rh||($=new rh(L.message,{cause:L})),n?.throwOnError)throw $;return[G,{},$]}})(),_=y.options.loaderDeps?.({search:j})??"",E=_?JSON.stringify(_):"",{interpolatedPath:M,usedParams:A}=Wg({path:y.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),R=y.id+M+E,T=this.getMatch(R),O=this.state.matches.find(G=>G.routeId===y.id),D=T?._strictParams??A;let z;if(!T)try{V1(y,A,u,D)}catch(G){if(br(G)||Br(G)?z=G:z=new l4(G.message,{cause:G}),n?.throwOnError)throw z}Object.assign(l,D);const B=O?"stay":"enter";let q;if(T)q={...T,cause:B,params:O?er(O.params,l):l,_strictParams:D,search:er(O?O.search:T.search,j),_strictSearch:N};else{const G=y.options.loader||y.options.beforeLoad||y.lazyFn||EN(y)?"pending":"success";q={id:R,ssr:y.options.ssr,index:w,routeId:y.id,params:O?er(O.params,l):l,_strictParams:D,pathname:M,updatedAt:Date.now(),search:O?er(O.search,j):j,_strictSearch:N,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:z,__routeContext:void 0,_nonReactive:{loadPromise:hl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:O?er(O.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}n?.preload||(q.globalNotFound=m===y.id),q.searchError=C;const Y=g(S);q.context={...Y,...q.__routeContext,...q.__beforeLoadContext},v.push(q)}),v.forEach((y,w)=>{const S=this.looseRoutesById[y.routeId];if(!this.getMatch(y.id)){const N=v[w-1],C=g(N);if(S.options.context){const _={deps:y.loaderDeps,params:y.params,context:C??{},location:t,navigate:E=>this.navigate({...E,_fromLocation:t}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:v};y.__routeContext=S.options.context(_)??void 0}y.context={...C,...y.__routeContext,...y.__beforeLoadContext}}}),v}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:s,parsedParams:o}=this.getMatchedRoutes(t.pathname),l=hu(n),u={...t.search};for(const v of n)try{Object.assign(u,Ff(v.options.validateSearch,u))}catch{}const d=hu(this.state.matches),h=d&&d.routeId===l.id&&t.pathname===this.state.location.pathname;let m;if(h)m=d.params;else{const v={...s};for(const g of n)try{V1(g,s,o??{},v)}catch{}m=v}return{matchedRoutes:n,fullPath:l.fullPath,search:u,params:m}}}class rh extends Error{}class l4 extends Error{}function c4(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ff(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new rh("Async validation not supported");if(n.issues)throw new rh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function u4({pathname:e,routesById:t,processedTree:n}){const s={},o=ta(e);let l,u;const d=Mz(o,n,!0);return d&&(l=d.route,Object.assign(s,d.rawParams),u=Object.assign({},d.parsedParams)),{matchedRoutes:d?.branch||[t[Fr]],routeParams:s,foundRoute:l,parsedParams:u}}function d4({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return f4(n)(e,t,s??!1)}function f4(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const l=({search:u,next:d})=>{let h=u;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(h=o.options.preSearchFilters.reduce((v,g)=>g(v),u));const m=d(h);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((v,g)=>g(v),m):m};t.middlewares.push(l)}if(o.options.validateSearch){const l=({search:u,next:d})=>{const h=d(u);if(!t._includeValidateSearch)return h;try{return{...h,...Ff(o.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const n=({search:o})=>{const l=t.dest;return l.search?l.search===!0?o:Ba(l.search,o):{}};t.middlewares.push(n);const s=(o,l,u)=>{if(o>=u.length)return l;const d=u[o];return d({search:l,next:m=>s(o+1,m,u)})};return function(l,u,d){return t.dest=u,t._includeValidateSearch=d,s(0,l,t.middlewares)}}function h4(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const s=t[n];if(s.children)return s.id}return Fr}function V1(e,t,n,s){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const l in t)l in n&&(s[l]=n[l]);else{const l=o(s);Object.assign(s,l)}}const m4="Error preloading route! ☝️";class RN{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,o=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=Fr:this.parentRoute||ca(!1);let l=o?Fr:s?.path;l&&l!=="/"&&(l=wN(l));const u=s?.id||l;let d=o?Fr:If([this.parentRoute.id===Fr?"":this.parentRoute.id,u]);l===Fr&&(l="/"),d!==Fr&&(d=If(["/",d]));const h=d===Fr?"/":If([this.parentRoute.fullPath,l]);this._path=l,this._id=d,this._fullPath=h,this._to=ta(h)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Jz({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class p4 extends RN{constructor(t){super(t)}}const bf=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Zg(e){const t=p.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function g4(e,t,n={},s={}){p.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([l])=>{t(l)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,s.disabled,e])}function v4(e){const t=p.useRef(null);return p.useImperativeHandle(e,()=>t.current,[]),t}function $x(e){const t=e.errorComponent??Fx;return i.jsx(x4,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?p.createElement(t,{error:n,reset:s}):e.children})}class x4 extends p.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Fx({error:e}){const[t,n]=p.useState(!1);return i.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[i.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),i.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),i.jsx("div",{style:{height:".25rem"}}),t?i.jsx("div",{children:i.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?i.jsx("code",{children:e.message}):null})}):null]})}function y4({children:e,fallback:t=null}){return AN()?i.jsx(ee.Fragment,{children:e}):i.jsx(ee.Fragment,{children:t})}function AN(){return ee.useSyncExternalStore(b4,()=>!0,()=>!1)}function b4(){return()=>{}}var Qg={exports:{}},Kg={},Xg={exports:{}},Jg={};var q1;function w4(){if(q1)return Jg;q1=1;var e=Du();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(g,y){var w=y(),S=s({inst:{value:w,getSnapshot:y}}),j=S[0].inst,N=S[1];return l(function(){j.value=w,j.getSnapshot=y,h(j)&&N({inst:j})},[g,w,y]),o(function(){return h(j)&&N({inst:j}),g(function(){h(j)&&N({inst:j})})},[g]),u(w),w}function h(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!n(g,w)}catch{return!0}}function m(g,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Jg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Jg}var H1;function ON(){return H1||(H1=1,Xg.exports=w4()),Xg.exports}var Y1;function S4(){if(Y1)return Kg;Y1=1;var e=Du(),t=ON();function n(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,d=e.useMemo,h=e.useDebugValue;return Kg.useSyncExternalStoreWithSelector=function(m,v,g,y,w){var S=l(null);if(S.current===null){var j={hasValue:!1,value:null};S.current=j}else j=S.current;S=d(function(){function C(R){if(!_){if(_=!0,E=R,R=y(R),w!==void 0&&j.hasValue){var T=j.value;if(w(T,R))return M=T}return M=R}if(T=M,s(E,R))return T;var O=y(R);return w!==void 0&&w(T,O)?(E=R,T):(E=R,M=O)}var _=!1,E,M,A=g===void 0?null:g;return[function(){return C(v())},A===null?void 0:function(){return C(A())}]},[v,g,y,w]);var N=o(m,S[0],S[1]);return u(function(){j.hasValue=!0,j.value=N},[N]),h(N),N},Kg}var W1;function j4(){return W1||(W1=1,Qg.exports=S4()),Qg.exports}var C4=j4();function N4(e,t=s=>s,n={}){const s=n.equal??k4;return C4.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function k4(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!t.has(s)||!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=G1(e);if(n.length!==G1(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}function G1(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const ev=p.createContext(null);function DN(){return typeof document>"u"?ev:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ev,ev)}function Vr(e){const t=p.useContext(DN());return e?.warn,t}function $n(e){const t=Vr({warn:e?.router===void 0}),n=e?.router||t,s=p.useRef(void 0);return N4(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=er(s.current,e.select(o));return s.current=l,l}return e.select(o)}return o})}const Rh=p.createContext(void 0),_4=p.createContext(void 0);function ks(e){const t=p.useContext(e.from?_4:Rh);return $n({select:s=>{const o=s.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(ca(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Bx(e){return ks({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ux(e){const{select:t,...n}=e;return ks({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Yo(e){return ks({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Vx(e){return ks({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Qa(e){const t=Vr();return p.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Ml=tN();const E4=eN(Ml);function T4(e,t){const n=Vr(),s=v4(t),{activeProps:o,inactiveProps:l,activeOptions:u,to:d,preload:h,preloadDelay:m,hashScrollIntoView:v,replace:g,startTransition:y,resetScroll:w,viewTransition:S,children:j,target:N,disabled:C,style:_,className:E,onClick:M,onFocus:A,onMouseEnter:R,onMouseLeave:T,onTouchStart:O,ignoreBlocker:D,params:z,search:B,hash:q,state:Y,mask:G,reloadDocument:ae,unsafeRelative:L,from:$,_fromLocation:U,...H}=e,le=AN(),I=$n({select:Xe=>Xe.location.search,structuralSharing:!0}),F=e.from,K=p.useMemo(()=>({...e,from:F}),[n,I,F,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ne=p.useMemo(()=>n.buildLocation({...K}),[n,K]),X=ne.maskedLocation?ne.maskedLocation.publicHref:ne.publicHref,ue=ne.maskedLocation?ne.maskedLocation.external:ne.external,te=p.useMemo(()=>z4(X,ue,n.history,C),[C,ue,X,n.history]),ye=p.useMemo(()=>{if(te?.external)return Jf(te.href)?void 0:te.href;if(!P4(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),Jf(d)?void 0:d}catch{}},[d,te]),Ce=$n({select:Xe=>{if(ye)return!1;if(u?.exact){if(!Pz(Xe.location.pathname,ne.pathname,n.basepath))return!1}else{const wt=th(Xe.location.pathname,n.basepath),gt=th(ne.pathname,n.basepath);if(!(wt.startsWith(gt)&&(wt.length===gt.length||wt[gt.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Ao(Xe.location.search,ne.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?le&&Xe.location.hash===ne.hash:!0}}),_e=Ce?Ba(o,{})??M4:tv,Re=Ce?tv:Ba(l,{})??tv,ge=[E,_e.className,Re.className].filter(Boolean).join(" "),Be=(_||_e.style||Re.style)&&{..._,..._e.style,...Re.style},[be,Ue]=p.useState(!1),rt=p.useRef(!1),it=e.reloadDocument||ye?!1:h??n.options.defaultPreload,bt=m??n.options.defaultPreloadDelay??0,pe=p.useCallback(()=>{n.preloadRoute({...K}).catch(Xe=>{console.warn(Xe),console.warn(m4)})},[n,K]),Le=p.useCallback(Xe=>{Xe?.isIntersecting&&pe()},[pe]);g4(s,Le,D4,{disabled:!!C||it!=="viewport"}),p.useEffect(()=>{rt.current||!C&&it==="render"&&(pe(),rt.current=!0)},[C,pe,it]);const We=Xe=>{const wt=Xe.currentTarget.getAttribute("target"),gt=N!==void 0?N:wt;if(!C&&!L4(Xe)&&!Xe.defaultPrevented&&(!gt||gt==="_self")&&Xe.button===0){Xe.preventDefault(),Ml.flushSync(()=>{Ue(!0)});const qn=n.subscribe("onResolved",()=>{qn(),Ue(!1)});n.navigate({...K,replace:g,resetScroll:w,hashScrollIntoView:v,startTransition:y,viewTransition:S,ignoreBlocker:D})}};if(ye)return{...H,ref:s,href:ye,...j&&{children:j},...N&&{target:N},...C&&{disabled:C},..._&&{style:_},...E&&{className:E},...M&&{onClick:M},...A&&{onFocus:A},...R&&{onMouseEnter:R},...T&&{onMouseLeave:T},...O&&{onTouchStart:O}};const Oe=Xe=>{C||it&&pe()},ft=Oe,ut=Xe=>{if(!(C||!it))if(!bt)pe();else{const wt=Xe.target;if(Fc.has(wt))return;const gt=setTimeout(()=>{Fc.delete(wt),pe()},bt);Fc.set(wt,gt)}},Mn=Xe=>{if(C||!it||!bt)return;const wt=Xe.target,gt=Fc.get(wt);gt&&(clearTimeout(gt),Fc.delete(wt))};return{...H,..._e,...Re,href:te?.href,ref:s,onClick:Bc([M,We]),onFocus:Bc([A,Oe]),onMouseEnter:Bc([R,ut]),onMouseLeave:Bc([T,Mn]),onTouchStart:Bc([O,ft]),disabled:!!C,target:N,...Be&&{style:Be},...ge&&{className:ge},...C&&R4,...Ce&&A4,...le&&be&&O4}}const tv={},M4={className:"active"},R4={role:"link","aria-disabled":!0},A4={"data-status":"active","aria-current":"page"},O4={"data-transitioning":"transitioning"},Fc=new WeakMap,D4={rootMargin:"100px"},Bc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function z4(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function P4(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Ss=p.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:o,...l}=T4(s,t),u=typeof s.children=="function"?s.children({isActive:l["data-status"]==="active"}):s.children;if(!n){const{disabled:d,...h}=l;return p.createElement("a",h,u)}return p.createElement(n,l,u)});function L4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class I4 extends RN{constructor(t){super(t),this.useMatch=n=>ks({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ks({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Vx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Yo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ux({...n,from:this.id}),this.useLoaderData=n=>Bx({...n,from:this.id}),this.useNavigate=()=>Qa({from:this.fullPath}),this.Link=ee.forwardRef((n,s)=>i.jsx(Ss,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function is(e){return new I4(e)}class $4 extends p4{constructor(t){super(t),this.useMatch=n=>ks({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ks({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Vx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Yo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ux({...n,from:this.id}),this.useLoaderData=n=>Bx({...n,from:this.id}),this.useNavigate=()=>Qa({from:this.fullPath}),this.Link=ee.forwardRef((n,s)=>i.jsx(Ss,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function F4(e){return new $4(e)}function Z1(e){return typeof e=="object"?new Q1(e,{silent:!0}).createRoute(e):new Q1(e,{silent:!0}).createRoute}class Q1{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const o=is(s);return o.isRoot=!1,o},this.silent=n?.silent}}class K1{constructor(t){this.useMatch=n=>ks({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ks({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Vx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Yo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Ux({...n,from:this.options.id}),this.useLoaderData=n=>Bx({...n,from:this.options.id}),this.useNavigate=()=>{const n=Vr();return Qa({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function X1(e){return typeof e=="object"?new K1(e):t=>new K1({id:e,...t})}function B4(){const e=Vr(),t=p.useRef({router:e,mounted:!1}),[n,s]=p.useState(!1),{hasPendingMatches:o,isLoading:l}=$n({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),u=Zg(l),d=l||n||o,h=Zg(d),m=l||o,v=Zg(m);return e.startTransition=g=>{s(!0),p.startTransition(()=>{g(),s(!1)})},p.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ta(e.latestLocation.publicHref)!==ta(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),bf(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),bf(()=>{u&&!l&&e.emit({type:"onLoad",...Oo(e.state)})},[u,e,l]),bf(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...Oo(e.state)})},[m,v,e]),bf(()=>{if(h&&!d){const g=Oo(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),g.hrefChanged&&Yz(e)}},[d,h,e]),null}function U4(e){const t=$n({select:n=>`not-found-${n.location.pathname}-${n.status}`});return i.jsx($x,{getResetKey:()=>t,onCatch:(n,s)=>{if(br(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(br(n))return e.fallback?.(n);throw n},children:e.children})}function V4(){return i.jsx("p",{children:"Not Found"})}function Wi(e){return i.jsx(i.Fragment,{children:e.children})}function zN(e,t,n){return t.options.notFoundComponent?i.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?i.jsx(e.options.defaultNotFoundComponent,{...n}):i.jsx(V4,{})}function q4(){return Vr().isScrollRestoring,null}const PN=p.memo(function({matchId:t}){const n=Vr(),s=$n({select:j=>{const N=j.matches.findIndex(_=>_.id===t),C=j.matches[N];return ca(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[N-1]?.routeId}},structuralSharing:!0}),o=n.routesById[s.routeId],l=o.options.pendingComponent??n.options.defaultPendingComponent,u=l?i.jsx(l,{}):null,d=o.options.errorComponent??n.options.defaultErrorComponent,h=o.options.onCatch??n.options.defaultOnCatch,m=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,v=s.ssr===!1||s.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||v)&&(o.options.wrapInSuspense??l??(o.options.errorComponent?.preload||v))?p.Suspense:Wi,y=d?$x:Wi,w=m?U4:Wi,S=o.isRoot?o.options.shellComponent??Wi:Wi;return i.jsxs(S,{children:[i.jsx(Rh.Provider,{value:t,children:i.jsx(g,{fallback:u,children:i.jsx(y,{getResetKey:()=>s.resetKey,errorComponent:d||Fx,onCatch:(j,N)=>{if(br(j))throw j;h?.(j,N)},children:i.jsx(w,{fallback:j=>{if(!m||j.routeId&&j.routeId!==s.routeId||!j.routeId&&!o.isRoot)throw j;return p.createElement(m,j)},children:v||s._displayPending?i.jsx(y4,{fallback:u,children:i.jsx(J1,{matchId:t})}):i.jsx(J1,{matchId:t})})})})}),s.parentRouteId===Fr&&n.options.scrollRestoration?i.jsxs(i.Fragment,{children:[i.jsx(H4,{}),i.jsx(q4,{})]}):null]})});function H4(){const e=Vr(),t=p.useRef(void 0);return i.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Oo(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const J1=p.memo(function({matchId:t}){const n=Vr(),{match:s,key:o,routeId:l}=$n({select:h=>{const m=h.matches.find(S=>S.id===t),v=m.routeId,y=(n.routesById[v].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:m.id,status:m.status,error:m.error,invalid:m.invalid,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),u=n.routesById[l],d=p.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?i.jsx(h,{},o):i.jsx(LN,{})},[o,u.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const m=n.getMatch(s.id);if(m&&!m._nonReactive.minPendingPromise){const v=hl();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},h)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return ca(br(s.error)),zN(n,u,s.error);if(s.status==="redirected")throw ca(Br(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return d}),LN=p.memo(function(){const t=Vr(),n=p.useContext(Rh),s=$n({select:m=>m.matches.find(v=>v.id===n)?.routeId}),o=t.routesById[s],l=$n({select:m=>{const g=m.matches.find(y=>y.id===n);return ca(g),g.globalNotFound}}),u=$n({select:m=>{const v=m.matches,g=v.findIndex(y=>y.id===n);return v[g+1]?.id}}),d=t.options.defaultPendingComponent?i.jsx(t.options.defaultPendingComponent,{}):null;if(l)return zN(t,o,void 0);if(!u)return null;const h=i.jsx(PN,{matchId:u});return s===Fr?i.jsx(p.Suspense,{fallback:d,children:h}):h});function Y4(){const e=Vr(),n=e.routesById[Fr].options.pendingComponent??e.options.defaultPendingComponent,s=n?i.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?Wi:p.Suspense,l=i.jsxs(o,{fallback:s,children:[i.jsx(B4,{}),i.jsx(W4,{})]});return e.options.InnerWrap?i.jsx(e.options.InnerWrap,{children:l}):l}function W4(){const e=Vr(),t=$n({select:o=>o.matches[0]?.id}),n=$n({select:o=>o.loadedAt}),s=t?i.jsx(PN,{matchId:t}):null;return i.jsx(Rh.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:i.jsx($x,{getResetKey:()=>n,errorComponent:Fx,onCatch:o=>{o.message||o.toString()},children:s})})}const G4=e=>new Z4(e);class Z4 extends i4{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Z1,globalThis.createLazyFileRoute=X1):typeof window<"u"&&(window.createFileRoute=Z1,window.createLazyFileRoute=X1);function Q4({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=DN(),o=i.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?i.jsx(e.options.Wrap,{children:o}):o}function K4({router:e,...t}){return i.jsx(Q4,{router:e,...t,children:i.jsx(Y4,{})})}function X4(e){return $n({select:t=>t.location})}const J4="0.0.17-alpha.0";const IN=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const e3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const t3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const ej=e=>{const t=t3(e);return t.charAt(0).toUpperCase()+t.slice(1)};var n3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const s3=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:u,...d},h)=>p.createElement("svg",{ref:h,...n3,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:IN("lucide",o),...!l&&!r3(d)&&{"aria-hidden":"true"},...d},[...u.map(([m,v])=>p.createElement(m,v)),...Array.isArray(l)?l:[l]]));const ve=(e,t)=>{const n=p.forwardRef(({className:s,...o},l)=>p.createElement(s3,{ref:l,iconNode:t,className:IN(`lucide-${e3(ej(e))}`,`lucide-${e}`,s),...o}));return n.displayName=ej(e),n};const a3=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],$N=ve("archive",a3);const o3=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],i3=ve("arrow-down",o3);const l3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],FN=ve("arrow-left",l3);const c3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],u3=ve("arrow-right",c3);const d3=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],f3=ve("arrow-up-down",d3);const h3=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],m3=ve("arrow-up",h3);const p3=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Wv=ve("bell",p3);const g3=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],v3=ve("bold",g3);const x3=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],y3=ve("book",x3);const b3=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],w3=ve("bookmark",b3);const S3=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],qx=ve("braces",S3);const j3=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],pl=ve("calendar",j3);const C3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ts=ve("check",C3);const N3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vn=ve("chevron-down",N3);const k3=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hx=ve("chevron-left",k3);const _3=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Rl=ve("chevron-right",_3);const E3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zu=ve("chevron-up",E3);const T3=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],M3=ve("chevrons-up-down",T3);const R3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Pu=ve("circle-alert",R3);const A3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Yx=ve("circle-check-big",A3);const O3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],BN=ve("circle-question-mark",O3);const D3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],z3=ve("circle-x",D3);const P3=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],sh=ve("clock",P3);const L3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Gv=ve("code-xml",L3);const I3=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],UN=ve("code",I3);const $3=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],VN=ve("copy",$3);const F3=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],qN=ve("dollar-sign",F3);const B3=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Zv=ve("download",B3);const U3=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],V3=ve("ellipsis-vertical",U3);const q3=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],HN=ve("ellipsis",q3);const H3=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Y3=ve("expand",H3);const W3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],G3=ve("external-link",W3);const Z3=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ah=ve("eye",Z3);const Q3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],K3=ve("file-code",Q3);const X3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],jr=ve("file-text",X3);const J3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],oh=ve("file-type",J3);const eP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Wx=ve("file",eP);const tP=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],nP=ve("flag",tP);const rP=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Gx=ve("folder-input",rP);const sP=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Zx=ve("folder-open",sP);const aP=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],oP=ve("folder-plus",aP);const iP=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],lP=ve("folder-tree",iP);const cP=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ih=ve("folder",cP);const uP=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],dP=ve("git-compare",uP);const fP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],hP=ve("globe",fP);const mP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],pP=ve("grid-3x3",mP);const gP=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Qx=ve("hash",gP);const vP=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],xP=ve("heading-2",vP);const yP=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],bP=ve("heart",yP);const wP=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],YN=ve("history",wP);const SP=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Ah=ve("house",SP);const jP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],rs=ve("image",jP);const CP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],NP=ve("info",CP);const kP=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],_P=ve("italic",kP);const EP=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Kx=ve("layers",EP);const TP=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],MP=ve("layout-dashboard",TP);const RP=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],pu=ve("link-2",RP);const AP=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],WN=ve("link",AP);const OP=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],gu=ve("list",OP);const DP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],vu=ve("loader-circle",DP);const zP=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Xx=ve("lock",zP);const PP=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],LP=ve("log-out",PP);const IP=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],$P=ve("mail",IP);const FP=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],BP=ve("map-pin",FP);const UP=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],VP=ve("message-square",UP);const qP=[["path",{d:"M5 12h14",key:"1ays0h"}]],HP=ve("minus",qP);const YP=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],WP=ve("monitor",YP);const GP=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ZP=ve("moon",GP);const QP=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Jx=ve("music",QP);const KP=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],XP=ve("package",KP);const JP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],e5=ve("panel-left",JP);const t5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ua=ve("pencil",t5);const n5=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],r5=ve("phone",n5);const s5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Un=ve("plus",s5);const a5=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],o5=ve("quote",a5);const i5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ey=ve("refresh-cw",i5);const l5=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],xu=ve("rotate-ccw",l5);const c5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Al=ve("search",c5);const u5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],d5=ve("settings-2",u5);const f5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],GN=ve("settings",f5);const h5=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],m5=ve("square-check-big",h5);const p5=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],g5=ve("square-pen",p5);const v5=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],x5=ve("star",v5);const y5=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],b5=ve("sun",y5);const w5=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Do=ve("tag",w5);const S5=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],ty=ve("tags",S5);const j5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],ny=ve("text-align-start",j5);const C5=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],ry=ve("toggle-left",C5);const N5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Fn=ve("trash-2",N5);const k5=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],_5=ve("trending-up",k5);const E5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Io=ve("triangle-alert",E5);const T5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],sy=ve("upload",T5);const M5=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ZN=ve("user",M5);const R5=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],A5=ve("users",R5);const O5=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ay=ve("video",O5);const D5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],At=ve("x",D5);Fe.union(Fe.literal("admin"),Fe.literal("editor"),Fe.literal("author"),Fe.literal("viewer"));const z5=Fe.union(Fe.literal("contentTypes"),Fe.literal("contentEntries"),Fe.literal("mediaItems"),Fe.literal("settings"),Fe.literal("users")),P5=Fe.union(Fe.literal("create"),Fe.literal("read"),Fe.literal("update"),Fe.literal("delete"),Fe.literal("publish"),Fe.literal("unpublish"),Fe.literal("restore"),Fe.literal("manage"),Fe.literal("move"));Fe.object({resource:z5,action:P5,scope:Fe.optional(Fe.union(Fe.literal("all"),Fe.literal("own")))});function Xi(e,t="all"){return[{resource:e,action:"create",scope:t},{resource:e,action:"read",scope:t},{resource:e,action:"update",scope:t},{resource:e,action:"delete",scope:t}]}function al(e,t="all"){return[{resource:e,action:"read",scope:t}]}function QN(e="all"){return[{resource:"contentEntries",action:"publish",scope:e},{resource:"contentEntries",action:"unpublish",scope:e}]}const L5={name:"admin",displayName:"Administrator",description:"Full access to all CMS features including settings and content type management",isSystem:!0,permissions:[...Xi("contentTypes"),...Xi("contentEntries"),...QN(),{resource:"contentEntries",action:"restore"},...Xi("mediaItems"),{resource:"settings",action:"manage"},...al("settings"),...Xi("users"),{resource:"users",action:"manage"}]},I5={name:"editor",displayName:"Editor",description:"Can manage all content and media, but cannot modify settings or content types",isSystem:!0,permissions:[...al("contentTypes"),...Xi("contentEntries"),...QN(),{resource:"contentEntries",action:"restore"},...Xi("mediaItems")]},$5={name:"author",displayName:"Author",description:"Can create and manage own content and media",isSystem:!0,permissions:[...al("contentTypes"),{resource:"contentEntries",action:"create"},{resource:"contentEntries",action:"read",scope:"own"},{resource:"contentEntries",action:"update",scope:"own"},{resource:"contentEntries",action:"delete",scope:"own"},{resource:"contentEntries",action:"publish",scope:"own"},{resource:"contentEntries",action:"unpublish",scope:"own"},{resource:"mediaItems",action:"create"},{resource:"mediaItems",action:"read",scope:"all"},{resource:"mediaItems",action:"update",scope:"own"},{resource:"mediaItems",action:"delete",scope:"own"}]},F5={name:"viewer",displayName:"Viewer",description:"Read-only access to published content and media",isSystem:!0,permissions:[...al("contentTypes"),...al("contentEntries"),...al("mediaItems")]},KN={admin:L5,editor:I5,author:$5,viewer:F5};function B5(e,t){if(e.resource!==t.resource||e.action!==t.action)return!1;const n=e.scope??"all",s=t.scope??"all";return n==="all"?!0:s==="own"}function XN(e,t,n){const s=KN[e]??n?.[e];return s?s.permissions.some(o=>B5(o,t)):!1}function U5(e,t){return(KN[e]??t?.[e])?.permissions??[]}function JN(e,t,n){return U5(e,n).filter(s=>s.resource===t)}function V5(e,t,n){return JN(e,t,n).length>0}const ek=p.createContext(null);function q5({children:e,getUser:t,getUserRole:n,onLogout:s,autoRedirectToLogin:o=!1,loginUrl:l="/login"}){const[u,d]=p.useState(null),[h,m]=p.useState(null),[v,g]=p.useState("loading"),[y,w]=p.useState(null),S=p.useCallback(async()=>{g("loading"),w(null);try{const E=await t();if(!E){d(null),m(null),g("unauthenticated"),o&&typeof window<"u"&&(window.location.href=l);return}const M=await n({userId:E.id});d(E),m(M),g("authenticated")}catch(E){console.error("Authentication error:",E),d(null),m(null),w(E instanceof Error?E.message:"Authentication failed"),g("error")}},[t,n,o,l]);p.useEffect(()=>{S()},[S]);const j=p.useCallback(E=>h?XN(h,E):!1,[h]),N=p.useCallback(async()=>{try{s&&await s(),d(null),m(null),g("unauthenticated"),o&&typeof window<"u"&&(window.location.href=l)}catch(E){console.error("Logout error:",E),w(E instanceof Error?E.message:"Logout failed")}},[s,o,l]),C=p.useCallback(async()=>{await S()},[S]),_={user:u,role:h,authState:v,isLoading:v==="loading",isAuthenticated:v==="authenticated",error:y,checkPermission:j,logout:N,refresh:C};return i.jsx(ek.Provider,{value:_,children:e})}function oy(){const e=p.useContext(ek);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const tk=p.createContext(null),nk="convex-cms-theme";function tj(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function nj(){if(typeof window>"u")return"system";const e=localStorage.getItem(nk);return e==="light"||e==="dark"||e==="system"?e:"system"}function nv(){return typeof window>"u"?!1:document.documentElement.classList.contains("dark")}function H5({children:e,themeMode:t="isolated",darkModeControl:n="independent"}){const s=t==="isolated"||n==="independent",o=t==="inherit"&&n==="follow-parent",[l,u]=p.useState(()=>o?nv()?"dark":"light":nj()),[d,h]=p.useState(()=>{if(o)return nv()?"dark":"light";const g=nj();return g==="system"?tj():g}),m=p.useCallback(g=>{const y=g==="system"?tj():g;if(h(y),s){const w=document.documentElement;w.classList.remove("light","dark"),w.classList.add(y)}},[s]),v=p.useCallback(g=>{s&&(u(g),localStorage.setItem(nk,g),m(g))},[m,s]);return p.useEffect(()=>{o||m(l)},[l,m,o]),p.useEffect(()=>{if(!o){const g=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{l==="system"&&m("system")};return g.addEventListener("change",y),()=>g.removeEventListener("change",y)}},[l,m,o]),p.useEffect(()=>{if(!o)return;const g=()=>{const S=nv()?"dark":"light";u(S),h(S)};g();const y=new MutationObserver(w=>{for(const S of w)if(S.type==="attributes"&&S.attributeName==="class"){g();break}});return y.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>y.disconnect()},[o]),i.jsx(tk.Provider,{value:{theme:l,resolvedTheme:d,setTheme:v,canToggleDarkMode:s},children:e})}function Y5(){const e=p.useContext(tk);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function fe(e,t,n){function s(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=u.prototype,v=Object.keys(m);for(let g=0;g<v.length;g++){const y=v[g];y in d||(d[y]=m[y].bind(d))}}const o=n?.Parent??Object;class l extends o{}Object.defineProperty(l,"name",{value:e});function u(d){var h;const m=n?.Parent?new l:this;s(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(u,"init",{value:s}),Object.defineProperty(u,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class ol extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rk extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const sk={};function Ha(e){return sk}function ak(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,o])=>t.indexOf(+s)===-1).map(([s,o])=>o)}function Qv(e,t){return typeof t=="bigint"?t.toString():t}function iy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ly(e){return e==null}function cy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function W5(e,t){const n=(e.toString().split(".")[1]||"").length,s=t.toString();let o=(s.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(s)){const h=s.match(/\d?e-(\d?)/);h?.[1]&&(o=Number.parseInt(h[1]))}const l=n>o?n:o,u=Number.parseInt(e.toFixed(l).replace(".","")),d=Number.parseInt(t.toFixed(l).replace(".",""));return u%d/10**l}const rj=Symbol("evaluating");function kt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==rj)return s===void 0&&(s=rj,s=n()),s},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Wo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ka(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function sj(e){return JSON.stringify(e)}function G5(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ok="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function lh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Z5=iy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function gl(e){if(lh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(lh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ik(e){return gl(e)?{...e}:Array.isArray(e)?[...e]:e}const Q5=new Set(["string","number","symbol"]);function Oh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xa(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(s._zod.parent=e),s}function $e(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function K5(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const X5={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function J5(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Ka(e._zod.def,{get shape(){const u={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(u[d]=n.shape[d])}return Wo(this,"shape",u),u},checks:[]});return Xa(e,l)}function eL(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Ka(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete u[d]}return Wo(this,"shape",u),u},checks:[]});return Xa(e,l)}function tL(e,t){if(!gl(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const l=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ka(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return Wo(this,"shape",l),l}});return Xa(e,o)}function nL(e,t){if(!gl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ka(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Wo(this,"shape",s),s}});return Xa(e,n)}function rL(e,t){const n=Ka(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return Wo(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return Xa(e,n)}function sL(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ka(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Wo(this,"shape",h),h},checks:[]});return Xa(t,u)}function aL(e,t,n){const s=Ka(t._zod.def,{get shape(){const o=t._zod.def.shape,l={...o};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)l[u]=new e({type:"nonoptional",innerType:o[u]});return Wo(this,"shape",l),l}});return Xa(t,s)}function Ji(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function el(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function wf(e){return typeof e=="string"?e:e?.message}function Ya(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const o=wf(e.inst?._zod.def?.error?.(e))??wf(t?.error?.(e))??wf(n.customError?.(e))??wf(n.localeError?.(e))??"Invalid input";s.message=o}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function uy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function yu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const lk=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ck=fe("$ZodError",lk),uk=fe("$ZodError",lk,{Parent:Error});function oL(e,t=n=>n.message){const n={},s=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):s.push(t(o));return{formErrors:s,fieldErrors:n}}function iL(e,t=n=>n.message){const n={_errors:[]},s=o=>{for(const l of o.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>s({issues:u}));else if(l.code==="invalid_key")s({issues:l.issues});else if(l.code==="invalid_element")s({issues:l.issues});else if(l.path.length===0)n._errors.push(t(l));else{let u=n,d=0;for(;d<l.path.length;){const h=l.path[d];d===l.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(l))):u[h]=u[h]||{_errors:[]},u=u[h],d++}}};return s(e),n}const dy=e=>(t,n,s,o)=>{const l=s?Object.assign(s,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise)throw new ol;if(u.issues.length){const d=new(o?.Err??e)(u.issues.map(h=>Ya(h,l,Ha())));throw ok(d,o?.callee),d}return u.value},fy=e=>async(t,n,s,o)=>{const l=s?Object.assign(s,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(o?.Err??e)(u.issues.map(h=>Ya(h,l,Ha())));throw ok(d,o?.callee),d}return u.value},Dh=e=>(t,n,s)=>{const o=s?{...s,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new ol;return l.issues.length?{success:!1,error:new(e??ck)(l.issues.map(u=>Ya(u,o,Ha())))}:{success:!0,data:l.value}},lL=Dh(uk),zh=e=>async(t,n,s)=>{const o=s?Object.assign(s,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},o);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>Ya(u,o,Ha())))}:{success:!0,data:l.value}},cL=zh(uk),uL=e=>(t,n,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return dy(e)(t,n,o)},dL=e=>(t,n,s)=>dy(e)(t,n,s),fL=e=>async(t,n,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return fy(e)(t,n,o)},hL=e=>async(t,n,s)=>fy(e)(t,n,s),mL=e=>(t,n,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Dh(e)(t,n,o)},pL=e=>(t,n,s)=>Dh(e)(t,n,s),gL=e=>async(t,n,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return zh(e)(t,n,o)},vL=e=>async(t,n,s)=>zh(e)(t,n,s),xL=/^[cC][^\s-]{8,}$/,yL=/^[0-9a-z]+$/,bL=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wL=/^[0-9a-vA-V]{20}$/,SL=/^[A-Za-z0-9]{27}$/,jL=/^[a-zA-Z0-9_-]{21}$/,CL=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,NL=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,aj=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,kL=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_L="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function EL(){return new RegExp(_L,"u")}const TL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ML=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,RL=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,AL=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OL=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dk=/^[A-Za-z0-9_-]*$/,DL=/^\+[1-9]\d{6,14}$/,fk="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",zL=new RegExp(`^${fk}$`);function hk(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function PL(e){return new RegExp(`^${hk(e)}$`)}function LL(e){const t=hk({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${n.join("|")})`;return new RegExp(`^${fk}T(?:${s})$`)}const IL=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$L=/^-?\d+$/,mk=/^-?\d+(?:\.\d+)?$/,FL=/^(?:true|false)$/i,BL=/^[^A-Z]*$/,UL=/^[^a-z]*$/,sr=fe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),pk={number:"number",bigint:"bigint",object:"date"},gk=fe("$ZodCheckLessThan",(e,t)=>{sr.init(e,t);const n=pk[typeof t.value];e._zod.onattach.push(s=>{const o=s._zod.bag,l=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<l&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vk=fe("$ZodCheckGreaterThan",(e,t)=>{sr.init(e,t);const n=pk[typeof t.value];e._zod.onattach.push(s=>{const o=s._zod.bag,l=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>l&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),VL=fe("$ZodCheckMultipleOf",(e,t)=>{sr.init(e,t),e._zod.onattach.push(n=>{var s;(s=n._zod.bag).multipleOf??(s.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):W5(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),qL=fe("$ZodCheckNumberFormat",(e,t)=>{sr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[o,l]=X5[t.format];e._zod.onattach.push(u=>{const d=u._zod.bag;d.format=t.format,d.minimum=o,d.maximum=l,n&&(d.pattern=$L)}),e._zod.check=u=>{const d=u.value;if(n){if(!Number.isInteger(d)){u.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?u.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):u.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort});return}}d<o&&u.issues.push({origin:"number",input:d,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),d>l&&u.issues.push({origin:"number",input:d,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}}),HL=fe("$ZodCheckMaxLength",(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=s=>{const o=s.value;return!ly(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const o=s.value;if(o.length<=t.maximum)return;const u=uy(o);s.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),YL=fe("$ZodCheckMinLength",(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=s=>{const o=s.value;return!ly(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const o=s.value;if(o.length>=t.minimum)return;const u=uy(o);s.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),WL=fe("$ZodCheckLengthEquals",(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=s=>{const o=s.value;return!ly(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=s=>{const o=s.value,l=o.length;if(l===t.length)return;const u=uy(o),d=l>t.length;s.issues.push({origin:u,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),Ph=fe("$ZodCheckStringFormat",(e,t)=>{var n,s;sr.init(e,t),e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),GL=fe("$ZodCheckRegex",(e,t)=>{Ph.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ZL=fe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=BL),Ph.init(e,t)}),QL=fe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=UL),Ph.init(e,t)}),KL=fe("$ZodCheckIncludes",(e,t)=>{sr.init(e,t);const n=Oh(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(o=>{const l=o._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(s)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),XL=fe("$ZodCheckStartsWith",(e,t)=>{sr.init(e,t);const n=new RegExp(`^${Oh(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),JL=fe("$ZodCheckEndsWith",(e,t)=>{sr.init(e,t);const n=new RegExp(`.*${Oh(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),eI=fe("$ZodCheckOverwrite",(e,t)=>{sr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tI{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
10
+ Called by client`}function Vv(e,t){return t.data=e.errorData,t}function zo(e){const t=e.split(":");let n,s;return t.length===1?(n=t[0],s="default"):(n=t.slice(0,t.length-1).join(":"),s=t[t.length-1]),n.endsWith(".js")&&(n=n.slice(0,-3)),`${n}:${s}`}function Ro(e,t){return JSON.stringify({udfPath:zo(e),args:ns(t)})}function C1(e,t,n){const{initialNumItems:s,id:o}=n;return JSON.stringify({type:"paginated",udfPath:zo(e),args:ns(t),options:ns({initialNumItems:s,id:o})})}var aD=Object.defineProperty,oD=(e,t,n)=>t in e?aD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gs=(e,t,n)=>oD(e,typeof t!="symbol"?t+"":t,n);class iD{constructor(){gs(this,"nextQueryId"),gs(this,"querySetVersion"),gs(this,"querySet"),gs(this,"queryIdToToken"),gs(this,"identityVersion"),gs(this,"auth"),gs(this,"outstandingQueriesOlderThanRestart"),gs(this,"outstandingAuthOlderThanRestart"),gs(this,"paused"),gs(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(t,n,s,o){const l=zo(t),u=Ro(l,n),d=this.querySet.get(u);if(d!==void 0)return d.numSubscribers+=1,{queryToken:u,modification:null,unsubscribe:()=>this.removeSubscriber(u)};{const h=this.nextQueryId++,m={id:h,canonicalizedUdfPath:l,args:n,numSubscribers:1,journal:s,componentPath:o};this.querySet.set(u,m),this.queryIdToToken.set(h,u);const v=this.querySetVersion,g=this.querySetVersion+1,y={type:"Add",queryId:h,udfPath:l,args:[ns(n)],journal:s,componentPath:o};return this.paused?this.pendingQuerySetModifications.set(h,y):this.querySetVersion=g,{queryToken:u,modification:{type:"ModifyQuerySet",baseVersion:v,newVersion:g,modifications:[y]},unsubscribe:()=>this.removeSubscriber(u)}}}transition(t){for(const n of t.modifications)switch(n.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);const s=n.journal;if(s!==void 0){const o=this.queryIdToToken.get(n.queryId);o!==void 0&&(this.querySet.get(o).journal=s)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);break}default:throw new Error(`Invalid modification ${n.type}`)}}queryId(t,n){const s=zo(t),o=Ro(s,n),l=this.querySet.get(o);return l!==void 0?l.id:null}isCurrentOrNewerAuthVersion(t){return t>=this.identityVersion}getAuth(){return this.auth}setAuth(t){this.auth={tokenType:"User",value:t};const n=this.identityVersion;return this.paused||(this.identityVersion=n+1),{type:"Authenticate",baseVersion:n,...this.auth}}setAdminAuth(t,n){const s={tokenType:"Admin",value:t,impersonating:n};this.auth=s;const o=this.identityVersion;return this.paused||(this.identityVersion=o+1),{type:"Authenticate",baseVersion:o,...s}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",tokenType:"None",baseVersion:t}}hasAuth(){return!!this.auth}isNewAuth(t){return this.auth?.value!==t}queryPath(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).canonicalizedUdfPath:null}queryArgs(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).args:null}queryToken(t){return this.queryIdToToken.get(t)??null}queryJournal(t){return this.querySet.get(t)?.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const t=[];for(const o of this.querySet.values()){const l={type:"Add",queryId:o.id,udfPath:o.canonicalizedUdfPath,args:[ns(o.args)],journal:o.journal,componentPath:o.componentPath};t.push(l),this.outstandingQueriesOlderThanRestart.add(o.id)}this.querySetVersion=1;const n={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:t};if(!this.auth)return this.identityVersion=0,[n,void 0];this.outstandingAuthOlderThanRestart=!0;const s={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[n,s]}pause(){this.paused=!0}resume(){const t=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,n=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[t,n]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(t){const n=this.querySet.get(t);if(n.numSubscribers>1)return n.numSubscribers-=1,null;{this.querySet.delete(t),this.queryIdToToken.delete(n.id),this.outstandingQueriesOlderThanRestart.delete(n.id);const s=this.querySetVersion,o=this.querySetVersion+1,l={type:"Remove",queryId:n.id};return this.paused?this.pendingQuerySetModifications.has(n.id)?this.pendingQuerySetModifications.delete(n.id):this.pendingQuerySetModifications.set(n.id,l):this.querySetVersion=o,{type:"ModifyQuerySet",baseVersion:s,newVersion:o,modifications:[l]}}}}var lD=Object.defineProperty,cD=(e,t,n)=>t in e?lD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gf=(e,t,n)=>cD(e,typeof t!="symbol"?t+"":t,n);class uD{constructor(t,n){this.logger=t,this.markConnectionStateDirty=n,gf(this,"inflightRequests"),gf(this,"requestsOlderThanRestart"),gf(this,"inflightMutationsCount",0),gf(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(t,n){const s=new Promise(o=>{const l=n?"Requested":"NotSent";this.inflightRequests.set(t.requestId,{message:t,status:{status:l,requestedAt:new Date,onResult:o}}),t.type==="Mutation"?this.inflightMutationsCount++:t.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),s}onResponse(t){const n=this.inflightRequests.get(t.requestId);if(n===void 0||n.status.status==="Completed")return null;const s=n.message.type==="Mutation"?"mutation":"action",o=n.message.udfPath;for(const h of t.logLines)Gf(this.logger,"info",s,o,h);const l=n.status;let u,d;if(t.success)u={success:!0,logLines:t.logLines,value:fl(t.result)},d=()=>l.onResult(u);else{const h=t.result,{errorData:m}=t;Gf(this.logger,"error",s,o,h),u={success:!1,errorMessage:h,errorData:m!==void 0?fl(m):void 0,logLines:t.logLines},d=()=>l.onResult(u)}return t.type==="ActionResponse"||!t.success?(d(),this.inflightRequests.delete(t.requestId),this.requestsOlderThanRestart.delete(t.requestId),n.message.type==="Action"?this.inflightActionsCount--:n.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:t.requestId,result:u}):(n.status={status:"Completed",result:u,ts:t.ts,onResolve:d},null)}removeCompleted(t){const n=new Map;for(const[s,o]of this.inflightRequests.entries()){const l=o.status;l.status==="Completed"&&l.ts.lessThanOrEqual(t)&&(l.onResolve(),n.set(s,l.result),o.message.type==="Mutation"?this.inflightMutationsCount--:o.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(s),this.requestsOlderThanRestart.delete(s))}return n.size>0&&this.markConnectionStateDirty(),n}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const t=[];for(const[n,s]of this.inflightRequests){if(s.status.status==="NotSent"){s.status.status="Requested",t.push(s.message);continue}if(s.message.type==="Mutation")t.push(s.message);else if(s.message.type==="Action"){if(this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n),this.inflightActionsCount--,s.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");s.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),t}resume(){const t=[];for(const[,n]of this.inflightRequests)if(n.status.status==="NotSent"){n.status.status="Requested",t.push(n.message);continue}return t}hasIncompleteRequests(){for(const t of this.inflightRequests.values())if(t.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let t=Date.now();for(const n of this.inflightRequests.values())n.status.status!=="Completed"&&n.status.requestedAt.getTime()<t&&(t=n.status.requestedAt.getTime());return new Date(t)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const du=Symbol.for("functionName"),dD=Symbol.for("toReferencePath");function fD(e){return e[dD]??null}function hD(e){return e.startsWith("function://")}function mD(e){let t;if(typeof e=="string")hD(e)?t={functionHandle:e}:t={name:e};else if(e[du])t={name:e[du]};else{const n=fD(e);if(!n)throw new Error(`${e} is not a functionReference`);t={reference:n}}return t}function nr(e){const t=mD(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;const n=e[du];if(!n)throw new Error(`${e} is not a functionReference`);return n}function dN(e){return{[du]:e}}function fN(e=[]){const t={get(n,s){if(typeof s=="string"){const o=[...e,s];return fN(o)}else if(s===du){if(e.length<2){const u=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${u}\``)}const o=e.slice(0,-1).join("/"),l=e[e.length-1];return l==="default"?o:o+":"+l}else return s===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}fN();var pD=Object.defineProperty,gD=(e,t,n)=>t in e?pD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zf=(e,t,n)=>gD(e,typeof t!="symbol"?t+"":t,n);class fu{constructor(t){Zf(this,"queryResults"),Zf(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...n){const s=ea(n[0]),o=nr(t),l=this.queryResults.get(Ro(o,s));if(l!==void 0)return fu.queryValue(l.result)}getAllQueries(t){const n=[],s=nr(t);for(const o of this.queryResults.values())o.udfPath===zo(s)&&n.push({args:o.args,value:fu.queryValue(o.result)});return n}setQuery(t,n,s){const o=ea(n),l=nr(t),u=Ro(l,o);let d;s===void 0?d=void 0:d={success:!0,value:s,logLines:[]};const h={udfPath:l,args:o,result:d};this.queryResults.set(u,h),this.modifiedQueries.push(u)}static queryValue(t){if(t!==void 0)return t.success?t.value:void 0}}class vD{constructor(){Zf(this,"queryResults"),Zf(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(t,n){this.optimisticUpdates=this.optimisticUpdates.filter(u=>!n.has(u.mutationId));const s=this.queryResults;this.queryResults=new Map(t);const o=new fu(this.queryResults);for(const u of this.optimisticUpdates)u.update(o);const l=[];for(const[u,d]of this.queryResults){const h=s.get(u);(h===void 0||h.result!==d.result)&&l.push(u)}return l}applyOptimisticUpdate(t,n){this.optimisticUpdates.push({update:t,mutationId:n});const s=new fu(this.queryResults);return t(s),s.modifiedQueries}rawQueryResult(t){const n=this.queryResults.get(t);if(n!==void 0)return n.result}queryResult(t){const n=this.queryResults.get(t);if(n===void 0)return;const s=n.result;if(s!==void 0){if(s.success)return s.value;throw s.errorData!==void 0?Vv(s,new Uv(Ki("query",n.udfPath,s))):new Error(Ki("query",n.udfPath,s))}}hasQueryResult(t){return this.queryResults.get(t)!==void 0}queryLogs(t){return this.queryResults.get(t)?.result?.logLines}}var xD=Object.defineProperty,yD=(e,t,n)=>t in e?xD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ig=(e,t,n)=>yD(e,typeof t!="symbol"?t+"":t,n);class tr{constructor(t,n){Ig(this,"low"),Ig(this,"high"),Ig(this,"__isUnsignedLong__"),this.low=t|0,this.high=n|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new tr(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){const t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?N1:t>=bD?wD:new tr(t%su|0,t/su|0)}toString(){return(BigInt(this.high)*BigInt(su)+BigInt(this.low)).toString()}equals(t){return tr.isLong(t)||(t=tr.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return tr.isLong(t)||(t=tr.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?tr.fromNumber(t):new tr(t.low,t.high)}}const N1=new tr(0,0),k1=65536,su=k1*k1,bD=su*su,wD=new tr(-1,-1);var SD=Object.defineProperty,jD=(e,t,n)=>t in e?SD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vf=(e,t,n)=>jD(e,typeof t!="symbol"?t+"":t,n);class _1{constructor(t,n){vf(this,"version"),vf(this,"remoteQuerySet"),vf(this,"queryPath"),vf(this,"logger"),this.version={querySet:0,ts:tr.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=t,this.logger=n}transition(t){const n=t.startVersion;if(this.version.querySet!==n.querySet||this.version.ts.notEquals(n.ts)||this.version.identity!==n.identity)throw new Error(`Invalid start version: ${n.ts.toString()}:${n.querySet}:${n.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const s of t.modifications)switch(s.type){case"QueryUpdated":{const o=this.queryPath(s.queryId);if(o)for(const u of s.logLines)Gf(this.logger,"info","query",o,u);const l=fl(s.value??null);this.remoteQuerySet.set(s.queryId,{success:!0,value:l,logLines:s.logLines});break}case"QueryFailed":{const o=this.queryPath(s.queryId);if(o)for(const u of s.logLines)Gf(this.logger,"info","query",o,u);const{errorData:l}=s;this.remoteQuerySet.set(s.queryId,{success:!1,errorMessage:s.errorMessage,errorData:l!==void 0?fl(l):void 0,logLines:s.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(s.queryId);break}default:throw new Error(`Invalid modification ${s.type}`)}this.version=t.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function $g(e){const t=lu(e);return tr.fromBytesLE(Array.from(t))}function CD(e){const t=new Uint8Array(e.toBytesLE());return cu(t)}function E1(e){switch(e.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...e};case"MutationResponse":return e.success?{...e,ts:$g(e.ts)}:{...e};case"Transition":return{...e,startVersion:{...e.startVersion,ts:$g(e.startVersion.ts)},endVersion:{...e.endVersion,ts:$g(e.endVersion.ts)}}}}function ND(e){switch(e.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...e};case"Connect":return e.maxObservedTimestamp!==void 0?{...e,maxObservedTimestamp:CD(e.maxObservedTimestamp)}:{...e,maxObservedTimestamp:void 0}}}var kD=Object.defineProperty,_D=(e,t,n)=>t in e?kD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,on=(e,t,n)=>_D(e,typeof t!="symbol"?t+"":t,n);const ED=1e3,TD=1001,MD=1005,RD=4040;let Lf;function Yi(){return Lf===void 0&&(Lf=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(Lf+performance.now())}function T1(){return`t=${Math.round((Yi()-Lf)/100)/10}s`}const hN={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function AD(e){if(e===void 0)return"Unknown";for(const t of Object.keys(hN))if(e.startsWith(t))return t;return"Unknown"}class OD{constructor(t,n,s,o,l,u){this.markConnectionStateDirty=l,this.debug=u,on(this,"socket"),on(this,"connectionCount"),on(this,"_hasEverConnected",!1),on(this,"lastCloseReason"),on(this,"transitionChunkBuffer",null),on(this,"defaultInitialBackoff"),on(this,"maxBackoff"),on(this,"retries"),on(this,"serverInactivityThreshold"),on(this,"reconnectDueToServerInactivityTimeout"),on(this,"scheduledReconnect",null),on(this,"networkOnlineHandler",null),on(this,"pendingNetworkRecoveryInfo",null),on(this,"uri"),on(this,"onOpen"),on(this,"onResume"),on(this,"onMessage"),on(this,"webSocketConstructor"),on(this,"logger"),on(this,"onServerDisconnectError"),this.webSocketConstructor=s,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=t,this.onOpen=n.onOpen,this.onResume=n.onResume,this.onMessage=n.onMessage,this.onServerDisconnectError=n.onServerDisconnectError,this.logger=o,this.setupNetworkListener(),this.connect()}setSocketState(t){this.socket=t,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(t){if(t.partNumber<0||t.partNumber>=t.totalParts||t.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==t.totalParts||this.transitionChunkBuffer.transitionId!==t.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:t.totalParts,transitionId:t.transitionId}),t.partNumber!==this.transitionChunkBuffer.chunks.length){const n=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${n}, got ${t.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(t.chunk),this.transitionChunkBuffer.chunks.length===t.totalParts){const n=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const s=E1(JSON.parse(n));if(s.type!=="Transition")throw new Error(`Expected Transition, got ${s.type} after assembling chunks`);return s}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const t=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:t,paused:"no"}),this.resetServerInactivityTimeout(),t.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:t,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Yi()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",T1(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",T1())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:n}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:n}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(n/1e3)}s of waiting`)}},t.onerror=n=>{this.transitionChunkBuffer=null;const s=n.message;s&&this.logger.log(`WebSocket error message: ${s}`)},t.onmessage=n=>{this.resetServerInactivityTimeout();const s=n.data.length;let o=E1(JSON.parse(n.data));if(this._logVerbose(`received ws message with type ${o.type}`),o.type==="Ping")return;if(o.type==="TransitionChunk"){const u=this.assembleTransition(o);if(!u)return;o=u,this._logVerbose(`assembled full ws message of type ${o.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${o.type} while buffering TransitionChunks`)),o.type==="Transition"&&this.reportLargeTransition({messageLength:s,transition:o}),this.onMessage(o).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},t.onclose=n=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=n.reason||`closed with code ${n.code}`),n.code!==ED&&n.code!==TD&&n.code!==MD&&n.code!==RD){let o=`WebSocket closed with code ${n.code}`;n.reason&&(o+=`: ${n.reason}`),this.logger.log(o),this.onServerDisconnectError&&n.reason&&this.onServerDisconnectError(o)}const s=AD(n.reason);this.scheduleReconnect(s)}}socketState(){return this.socket.state}sendMessage(t){const n={type:t.type,...t.type==="Authenticate"&&t.tokenType==="User"?{value:`...${t.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const s=ND(t),o=JSON.stringify(s);let l=!1;try{this.socket.ws.send(o),l=!0}catch(u){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${u}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${l?"sent":"failed to send"} message with type ${t.type}: ${JSON.stringify(n)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(n)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(t){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const n=this.nextBackoff(t);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(n)}ms`);const s=Yi(),o=setTimeout(()=>{this.scheduledReconnect?.timeout===o&&(this.scheduledReconnect=null,this.connect())},n);this.scheduledReconnect={timeout:o,scheduledAt:s,backoffMs:n}}closeAndReconnect(t){switch(this._logVerbose(`begin closeAndReconnect with reason ${t}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=t,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const t=this.socket.ws;return t.onmessage=n=>{this._logVerbose("Ignoring message received after close")},new Promise(n=>{t.onclose=()=>{this._logVerbose("Closed after connecting"),n()},t.onopen=()=>{this._logVerbose("Opened after connecting"),t.close()}})}case"ready":{this._logVerbose("ws.close called");const t=this.socket.ws;t.onmessage=s=>{this._logVerbose("Ignoring message received after close")};const n=new Promise(s=>{t.onclose=()=>{s()}});return t.close(),n}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const t=this.close();return this.setSocketState({state:"terminated"}),t}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const t=this.close();return this.socket={state:"stopped"},t}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let t=null;if(this.scheduledReconnect){const n=Yi()-this.scheduledReconnect.scheduledAt;t=Math.max(0,this.scheduledReconnect.backoffMs-n),this._logVerbose(`would have waited ${Math.round(t)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(n)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=t!==null?{timeSavedMs:t}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Yi()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(t){this.logger.logVerbose(t)}nextBackoff(t){const s=(t==="client"?100:t==="Unknown"?this.defaultInitialBackoff:hN[t].timeout)*Math.pow(2,this.retries);this.retries+=1;const o=Math.min(s,this.maxBackoff),l=o*(Math.random()-.5);return o+l}reportLargeTransition({transition:t,messageLength:n}){if(t.clientClockSkew===void 0||t.serverTs===void 0)return;const s=Yi()-t.clientClockSkew-t.serverTs/1e6,o=`${Math.round(s)}ms`,l=`${Math.round(n/1e4)/100}MB`,u=n/(s/1e3),d=`${Math.round(u/1e4)/100}MB per second`;this._logVerbose(`received ${l} transition in ${o} at ${d}`),n>2e7?this.logger.log(`received query results totaling more that 20MB (${l}) which will take a long time to download on slower connections`):s>2e4&&this.logger.log(`received query results totaling ${l} which took more than 20s to arrive (${o})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:s,messageLength:n}})}}function DD(){return zD()}function zD(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}class Gc extends Error{}Gc.prototype.name="InvalidTokenError";function PD(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let s=n.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function LD(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return PD(t)}catch{return atob(t)}}function mN(e,t){if(typeof e!="string")throw new Gc("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,s=e.split(".")[n];if(typeof s!="string")throw new Gc(`Invalid token specified: missing part #${n+1}`);let o;try{o=LD(s)}catch(l){throw new Gc(`Invalid token specified: invalid base64 for part #${n+1} (${l.message})`)}try{return JSON.parse(o)}catch(l){throw new Gc(`Invalid token specified: invalid json for part #${n+1} (${l.message})`)}}var ID=Object.defineProperty,$D=(e,t,n)=>t in e?ID(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pr=(e,t,n)=>$D(e,typeof t!="symbol"?t+"":t,n);const FD=480*60*60*1e3,M1=2;class BD{constructor(t,n,s){Pr(this,"authState",{state:"noAuth"}),Pr(this,"configVersion",0),Pr(this,"syncState"),Pr(this,"authenticate"),Pr(this,"stopSocket"),Pr(this,"tryRestartSocket"),Pr(this,"pauseSocket"),Pr(this,"resumeSocket"),Pr(this,"clearAuth"),Pr(this,"logger"),Pr(this,"refreshTokenLeewaySeconds"),Pr(this,"tokenConfirmationAttempts",0),this.syncState=t,this.authenticate=n.authenticate,this.stopSocket=n.stopSocket,this.tryRestartSocket=n.tryRestartSocket,this.pauseSocket=n.pauseSocket,this.resumeSocket=n.resumeSocket,this.clearAuth=n.clearAuth,this.logger=s.logger,this.refreshTokenLeewaySeconds=s.refreshTokenLeewaySeconds}async setConfig(t,n){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const s=await this.fetchTokenAndGuardAgainstRace(t,{forceRefreshToken:!1});s.isFromOutdatedConfig||(s.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:t,onAuthChange:n},hasRetried:!1}),this.authenticate(s.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:t,onAuthChange:n}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(t){if(this.syncState.isCurrentOrNewerAuthVersion(t.endVersion.identity)&&!(t.endVersion.identity<=t.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(t){if(t.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:n}=t;if(!this.syncState.isCurrentOrNewerAuthVersion(n+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(t)}async tryToReauthenticate(t){if(this._logVerbose(`attempting to reauthenticate: ${t.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=M1){this.logger.error(`Failed to authenticate: "${t.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${M1-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const n=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});n.isFromOutdatedConfig||(n.value&&this.syncState.isNewAuth(n.value)?(this.authenticate(n.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:n.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value?this.syncState.isNewAuth(t.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:t.value,config:this.authState.config}),this.authenticate(t.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(t){if(this.authState.state==="noAuth")return;const n=this.decodeToken(t);if(!n){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:s,exp:o}=n;if(!s||!o){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const l=o-s;if(l<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let u=Math.min(FD,(l-this.refreshTokenLeewaySeconds)*1e3);u<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${l}s`),u=0);const d=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},u);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:d,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${u}ms`)}async fetchTokenAndGuardAgainstRace(t,n){const s=++this.configVersion;this._logVerbose(`fetching token with config version ${s}`);const o=await t(n);return this.configVersion!==s?(this._logVerbose(`stale config version, expected ${s}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:o}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(t){t(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(t){const n=t.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:t.hadAuth,state:t.state,token:`...${t.token.slice(-7)}`}:{state:t.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(n)}`),t.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=t}decodeToken(t){try{return mN(t)}catch(n){return this._logVerbose(`Error decoding token: ${n instanceof Error?n.message:"Unknown error"}`),null}}_logVerbose(t){this.logger.logVerbose(`${t} [v${this.configVersion}]`)}}const UD=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function VD(e,t){const n={sessionId:t};typeof performance>"u"||!performance.mark||performance.mark(e,{detail:n})}function qD(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function HD(e){if(typeof performance>"u"||!performance.getEntriesByName)return[];const t=[];for(const n of UD){const s=performance.getEntriesByName(n).filter(o=>o.entryType==="mark").filter(o=>o.detail.sessionId===e);t.push(...s)}return t.map(qD)}var YD=Object.defineProperty,WD=(e,t,n)=>t in e?YD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ln=(e,t,n)=>WD(e,typeof t!="symbol"?t+"":t,n);class GD{constructor(t,n,s){if(ln(this,"address"),ln(this,"state"),ln(this,"requestManager"),ln(this,"webSocketManager"),ln(this,"authenticationManager"),ln(this,"remoteQuerySet"),ln(this,"optimisticQueryResults"),ln(this,"_transitionHandlerCounter",0),ln(this,"_nextRequestId"),ln(this,"_onTransitionFns",new Map),ln(this,"_sessionId"),ln(this,"firstMessageReceived",!1),ln(this,"debug"),ln(this,"logger"),ln(this,"maxObservedTimestamp"),ln(this,"connectionStateSubscribers",new Map),ln(this,"nextConnectionStateSubscriberId",0),ln(this,"_lastPublishedConnectionState"),ln(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const w=this.connectionState();if(JSON.stringify(w)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=w;for(const S of this.connectionStateSubscribers.values())S(w)}})}),ln(this,"mark",w=>{this.debug&&VD(w,this.sessionId)}),typeof t=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");s?.skipConvexDeploymentUrlCheck!==!0&&FO(t),s={...s};const o=s.authRefreshTokenLeewaySeconds??10;let l=s.webSocketConstructor;if(!l&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");l=l||WebSocket,this.debug=s.reportDebugInfoToConvex??!1,this.address=t,this.logger=s.logger===!1?uN({verbose:s.verbose??!1}):s.logger!==!0&&s.logger?s.logger:cN({verbose:s.verbose??!1});const u=t.search("://");if(u===-1)throw new Error("Provided address was not an absolute URL.");const d=t.substring(u+3),h=t.substring(0,u);let m;if(h==="http")m="ws";else if(h==="https")m="wss";else throw new Error(`Unknown parent protocol ${h}`);const v=`${m}://${d}/api/${S1}/sync`;this.state=new iD,this.remoteQuerySet=new _1(w=>this.state.queryPath(w),this.logger),this.requestManager=new uD(this.logger,this.markConnectionStateDirty);const g=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new BD(this.state,{authenticate:w=>{const S=this.state.setAuth(w);return this.webSocketManager.sendMessage(S),S.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:g,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:o}),this.optimisticQueryResults=new vD,this.addOnTransitionHandler(w=>{n(w.queries.map(S=>S.token))}),this._nextRequestId=0,this._sessionId=DD();const{unsavedChangesWarning:y}=s;if(typeof window>"u"||typeof window.addEventListener>"u"){if(y===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else y!==!1&&window.addEventListener("beforeunload",w=>{if(this.requestManager.hasIncompleteRequests()){w.preventDefault();const S="Are you sure you want to leave? Your changes may not be saved.";return(w||window.event).returnValue=S,S}});this.webSocketManager=new OD(v,{onOpen:w=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...w,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new _1(N=>this.state.queryPath(N),this.logger);const[S,j]=this.state.restart();j&&this.webSocketManager.sendMessage(j),this.webSocketManager.sendMessage(S);for(const N of this.requestManager.restart())this.webSocketManager.sendMessage(N)},onResume:()=>{const[w,S]=this.state.resume();S&&this.webSocketManager.sendMessage(S),w&&this.webSocketManager.sendMessage(w);for(const j of this.requestManager.resume())this.webSocketManager.sendMessage(j)},onMessage:w=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),w.type){case"Transition":{this.observedTimestamp(w.endVersion.ts),this.authenticationManager.onTransition(w),this.remoteQuerySet.transition(w),this.state.transition(w);const S=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(S);break}case"MutationResponse":{w.success&&this.observedTimestamp(w.ts);const S=this.requestManager.onResponse(w);S!==null&&this.notifyOnQueryResultChanges(new Map([[S.requestId,S.result]]));break}case"ActionResponse":{this.requestManager.onResponse(w);break}case"AuthError":{this.authenticationManager.onAuthError(w);break}case"FatalError":{const S=sD(this.logger,w.error);throw this.webSocketManager.terminate(),S}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:s.onServerDisconnectError},l,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),s.expectAuth&&g()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(t){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(t))&&(this.maxObservedTimestamp=t)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(t){const n=this.remoteQuerySet.remoteQueryResults(),s=new Map;for(const[l,u]of n){const d=this.state.queryToken(l);if(d!==null){const h={result:u,udfPath:this.state.queryPath(l),args:this.state.queryArgs(l)};s.set(d,h)}}const o=this.optimisticQueryResults.ingestQueryResultsFromServer(s,new Set(t.keys()));this.handleTransition({queries:o.map(l=>{const u=this.optimisticQueryResults.rawQueryResult(l);return{token:l,modification:{kind:"Updated",result:u}}}),reflectedMutations:Array.from(t).map(([l,u])=>({requestId:l,result:u})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(t){for(const n of this._onTransitionFns.values())n(t)}addOnTransitionHandler(t){const n=this._transitionHandlerCounter++;return this._onTransitionFns.set(n,t),()=>this._onTransitionFns.delete(n)}getCurrentAuthClaims(){const t=this.state.getAuth();let n={};if(t&&t.tokenType==="User")try{n=t?mN(t.value):{}}catch{n={}}else return;return{token:t.value,decoded:n}}setAuth(t,n){this.authenticationManager.setConfig(t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(t,n){const s=this.state.setAdminAuth(t,n);this.webSocketManager.sendMessage(s)}clearAuth(){const t=this.state.clearAuth();this.webSocketManager.sendMessage(t)}subscribe(t,n,s){const o=ea(n),{modification:l,queryToken:u,unsubscribe:d}=this.state.subscribe(t,o,s?.journal,s?.componentPath);return l!==null&&this.webSocketManager.sendMessage(l),{queryToken:u,unsubscribe:()=>{const h=d();h&&this.webSocketManager.sendMessage(h)}}}localQueryResult(t,n){const s=ea(n),o=Ro(t,s);return this.optimisticQueryResults.queryResult(o)}localQueryResultByToken(t){return this.optimisticQueryResults.queryResult(t)}hasLocalQueryResultByToken(t){return this.optimisticQueryResults.hasQueryResult(t)}localQueryLogs(t,n){const s=ea(n),o=Ro(t,s);return this.optimisticQueryResults.queryLogs(o)}queryJournal(t,n){const s=ea(n),o=Ro(t,s);return this.state.queryJournal(o)}connectionState(){const t=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:t.isConnected,hasEverConnected:t.hasEverConnected,connectionCount:t.connectionCount,connectionRetries:t.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(t){const n=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(n,t),()=>{this.connectionStateSubscribers.delete(n)}}async mutation(t,n,s){const o=await this.mutationInternal(t,n,s);if(!o.success)throw o.errorData!==void 0?Vv(o,new Uv(Ki("mutation",t,o))):new Error(Ki("mutation",t,o));return o.value}async mutationInternal(t,n,s,o){const{mutationPromise:l}=this.enqueueMutation(t,n,s,o);return l}enqueueMutation(t,n,s,o){const l=ea(n);this.tryReportLongDisconnect();const u=this.nextRequestId;if(this._nextRequestId++,s!==void 0){const v=s.optimisticUpdate;if(v!==void 0){const g=S=>{v(S,l)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},w=this.optimisticQueryResults.applyOptimisticUpdate(g,u).map(S=>{const j=this.localQueryResultByToken(S);return{token:S,modification:{kind:"Updated",result:j===void 0?void 0:{success:!0,value:j,logLines:[]}}}});this.handleTransition({queries:w,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const d={type:"Mutation",requestId:u,udfPath:t,componentPath:o,args:[ns(l)]},h=this.webSocketManager.sendMessage(d),m=this.requestManager.request(d,h);return{requestId:u,mutationPromise:m}}async action(t,n){const s=await this.actionInternal(t,n);if(!s.success)throw s.errorData!==void 0?Vv(s,new Uv(Ki("action",t,s))):new Error(Ki("action",t,s));return s.value}async actionInternal(t,n,s){const o=ea(n),l=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const u={type:"Action",requestId:l,udfPath:t,componentPath:s,args:[ns(o)]},d=this.webSocketManager.sendMessage(u);return this.requestManager.request(u,d)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const t=HD(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:t})}}tryReportLongDisconnect(){if(!this.debug)return;const t=this.connectionState().timeOfOldestInflightRequest;if(t===null||Date.now()-t.getTime()<=60*1e3)return;const n=`${this.address}/api/debug_event`;fetch(n,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${S1}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(s=>{s.ok||this.logger.warn("Analytics request failed with response:",s.body)}).catch(s=>{this.logger.warn("Analytics response failed with error:",s)})}}function Fg(e){if(typeof e!="object"||e===null||!Array.isArray(e.page)||typeof e.isDone!="boolean"||typeof e.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var ZD=Object.defineProperty,QD=(e,t,n)=>t in e?ZD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R1=(e,t,n)=>QD(e,typeof t!="symbol"?t+"":t,n);class KD{constructor(t,n){this.client=t,this.onTransition=n,R1(this,"paginatedQuerySet",new Map),R1(this,"lastTransitionTs"),this.lastTransitionTs=tr.fromNumber(0),this.client.addOnTransitionHandler(s=>this.onBaseTransition(s))}subscribe(t,n,s){const o=zo(t),l=C1(o,n,s),u=()=>this.removePaginatedQuerySubscriber(l),d=this.paginatedQuerySet.get(l);return d?(d.numSubscribers+=1,{paginatedQueryToken:l,unsubscribe:u}):(this.paginatedQuerySet.set(l,{token:l,canonicalizedUdfPath:o,args:n,numSubscribers:1,options:{initialNumItems:s.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:s.id}),this.addPageToPaginatedQuery(l,null,s.initialNumItems),{paginatedQueryToken:l,unsubscribe:u})}localQueryResult(t,n,s){const o=zo(t),l=C1(o,n,s);return this.localQueryResultByToken(l)}localQueryResultByToken(t){const n=this.paginatedQuerySet.get(t);if(!n)return;const s=this.activePageQueryTokens(n);if(s.length===0)return{results:[],status:"LoadingFirstPage",loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)};let o=[],l=!1,u=!1;for(const h of s){const m=this.client.localQueryResultByToken(h);if(m===void 0){l=!0,u=!1;continue}const v=Fg(m);o=o.concat(v.page),u=!!v.isDone}let d;return l?d=o.length===0?"LoadingFirstPage":"LoadingMore":u?d="Exhausted":d="CanLoadMore",{results:o,status:d,loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)}}onBaseTransition(t){const n=t.queries.map(u=>u.token),s=this.queriesContainingTokens(n);let o=[];s.length>0&&(this.processPaginatedQuerySplits(s,u=>this.client.localQueryResultByToken(u)),o=s.map(u=>({token:u,modification:{kind:"Updated",result:this.localQueryResultByToken(u)}})));const l={...t,paginatedQueries:o};this.onTransition(l)}loadMoreOfPaginatedQuery(t,n){this.mustGetPaginatedQuery(t);const s=this.queryTokenForLastPageOfPaginatedQuery(t),o=this.client.localQueryResultByToken(s);if(!o)return!1;const l=Fg(o);if(l.isDone)return!1;this.addPageToPaginatedQuery(t,l.continueCursor,n);const u={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:t,modification:{kind:"Updated",result:this.localQueryResultByToken(t)}}]};return this.onTransition(u),!0}queriesContainingTokens(t){if(t.length===0)return[];const n=[],s=new Set(t);for(const[o,l]of this.paginatedQuerySet)for(const u of this.allQueryTokens(l))if(s.has(u)){n.push(o);break}return n}processPaginatedQuerySplits(t,n){for(const s of t){const o=this.mustGetPaginatedQuery(s),{ongoingSplits:l,pageKeyToQuery:u,pageKeys:d}=o;for(const[h,[m,v]]of l)n(u.get(m).queryToken)!==void 0&&n(u.get(v).queryToken)!==void 0&&this.completePaginatedQuerySplit(o,h,m,v);for(const h of d){if(l.has(h))continue;const m=u.get(h).queryToken,v=n(m);if(!v)continue;const g=Fg(v);g.splitCursor&&(g.pageStatus==="SplitRecommended"||g.pageStatus==="SplitRequired"||g.page.length>o.options.initialNumItems*2)&&this.splitPaginatedQueryPage(o,h,g.splitCursor,g.continueCursor)}}}splitPaginatedQueryPage(t,n,s,o){const l=t.nextPageKey++,u=t.nextPageKey++,d={cursor:o,numItems:t.options.initialNumItems,id:t.id},h=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...d,cursor:null,endCursor:s}});t.pageKeyToQuery.set(l,h);const m=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...d,cursor:s,endCursor:o}});t.pageKeyToQuery.set(u,m),t.ongoingSplits.set(n,[l,u])}addPageToPaginatedQuery(t,n,s){const o=this.mustGetPaginatedQuery(t),l=o.nextPageKey++,u={cursor:n,numItems:s,id:o.id},d={...o.args,paginationOpts:u},h=this.client.subscribe(o.canonicalizedUdfPath,d);return o.pageKeys.push(l),o.pageKeyToQuery.set(l,h),h}removePaginatedQuerySubscriber(t){const n=this.paginatedQuerySet.get(t);if(n&&(n.numSubscribers-=1,!(n.numSubscribers>0))){for(const s of n.pageKeyToQuery.values())s.unsubscribe();this.paginatedQuerySet.delete(t)}}completePaginatedQuerySplit(t,n,s,o){const l=t.pageKeyToQuery.get(n);t.pageKeyToQuery.delete(n);const u=t.pageKeys.indexOf(n);t.pageKeys.splice(u,1,s,o),t.ongoingSplits.delete(n),l.unsubscribe()}activePageQueryTokens(t){return t.pageKeys.map(n=>t.pageKeyToQuery.get(n).queryToken)}allQueryTokens(t){return Array.from(t.pageKeyToQuery.values()).map(n=>n.queryToken)}queryTokenForLastPageOfPaginatedQuery(t){const n=this.mustGetPaginatedQuery(t),s=n.pageKeys[n.pageKeys.length-1];if(s===void 0)throw new Error(`No pages for paginated query ${t}`);return n.pageKeyToQuery.get(s).queryToken}mustGetPaginatedQuery(t){const n=this.paginatedQuerySet.get(t);if(!n)throw new Error("paginated query no longer exists for token "+t);return n}}function XD({getCurrentValue:e,subscribe:t}){const[n,s]=p.useState(()=>({getCurrentValue:e,subscribe:t,value:e()}));let o=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(o=e(),s({getCurrentValue:e,subscribe:t,value:o})),p.useEffect(()=>{let l=!1;const u=()=>{l||s(h=>{if(h.getCurrentValue!==e||h.subscribe!==t)return h;const m=e();return h.value===m?h:{...h,value:m}})},d=t(u);return u(),()=>{l=!0,d()}},[e,t]),o}var JD=Object.defineProperty,ez=(e,t,n)=>t in e?JD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ks=(e,t,n)=>ez(e,typeof t!="symbol"?t+"":t,n);const tz=5e3;if(typeof ee>"u")throw new Error("Required dependency 'react' not found");function pN(e,t,n){function s(o){return az(o),t.mutation(e,o,{optimisticUpdate:n})}return s.withOptimisticUpdate=function(l){if(n!==void 0)throw new Error(`Already specified optimistic update for mutation ${nr(e)}`);return pN(e,t,l)},s}class nz{constructor(t,n){if(Ks(this,"address"),Ks(this,"cachedSync"),Ks(this,"cachedPaginatedQueryClient"),Ks(this,"listeners"),Ks(this,"options"),Ks(this,"closed",!1),Ks(this,"_logger"),Ks(this,"adminAuth"),Ks(this,"fakeUserIdentity"),t===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof t!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof t} instead.`);if(!t.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=t,this.listeners=new Map,this._logger=n?.logger===!1?uN({verbose:n?.verbose??!1}):n?.logger!==!0&&n?.logger?n.logger:cN({verbose:n?.verbose??!1}),this.options={...n,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new GD(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new KD(this.cachedSync,t=>this.handleTransition(t)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(t,n){if(typeof t=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(t,n??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(t,n){if(this.adminAuth=t,this.fakeUserIdentity=n,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(t,n)}watchQuery(t,...n){const[s,o]=n,l=nr(t);return{onUpdate:u=>{const{queryToken:d,unsubscribe:h}=this.sync.subscribe(l,s,o),m=this.listeners.get(d);return m!==void 0?m.add(u):this.listeners.set(d,new Set([u])),()=>{if(this.closed)return;const v=this.listeners.get(d);v.delete(u),v.size===0&&this.listeners.delete(d),h()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(l,s)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(l,s)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(l,s)}}}prewarmQuery(t){const n=t.extendSubscriptionFor??tz,o=this.watchQuery(t.query,t.args||{}).onUpdate(()=>{});setTimeout(o,n)}watchPaginatedQuery(t,n,s){const o=nr(t);return{onUpdate:l=>{const{paginatedQueryToken:u,unsubscribe:d}=this.paginatedQueryClient.subscribe(o,n||{},s),h=this.listeners.get(u);return h!==void 0?h.add(l):this.listeners.set(u,new Set([l])),()=>{if(this.closed)return;const m=this.listeners.get(u);m.delete(l),m.size===0&&this.listeners.delete(u),d()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(o,n,s)}}mutation(t,...n){const[s,o]=n,l=nr(t);return this.sync.mutation(l,s,o)}action(t,...n){const s=nr(t);return this.sync.action(s,...n)}query(t,...n){const s=this.watchQuery(t,...n),o=s.localQueryResult();return o!==void 0?Promise.resolve(o):new Promise((l,u)=>{const d=s.onUpdate(()=>{d();try{l(s.localQueryResult())}catch(h){u(h)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(t){return this.sync.subscribeToConnectionState(t)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const t=this.cachedSync;this.cachedSync=void 0,await t.close()}}handleTransition(t){const n=t.queries.map(o=>o.token),s=t.paginatedQueries.map(o=>o.token);this.transition([...n,...s])}transition(t){for(const n of t){const s=this.listeners.get(n);if(s)for(const o of s)o()}}}const Dx=ee.createContext(void 0);function rz(){return p.useContext(Dx)}const sz=({client:e,children:t})=>ee.createElement(Dx.Provider,{value:e},t);function Ye(e,...t){const n=t[0]==="skip",s=t[0]==="skip"?{}:ea(t[0]),o=typeof e=="string"?dN(e):e,l=nr(o),u=p.useMemo(()=>n?{}:{query:{query:o,args:s}},[JSON.stringify(ns(s)),l,n]),h=cz(u).query;if(h instanceof Error)throw h;return h}function Ke(e){const t=typeof e=="string"?dN(e):e,n=p.useContext(Dx);if(n===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return p.useMemo(()=>pN(t,n),[n,nr(t)])}function az(e){if(typeof e=="object"&&e!==null&&"bubbles"in e&&"persist"in e&&"isDefaultPrevented"in e)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var oz=Object.defineProperty,iz=(e,t,n)=>t in e?oz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bg=(e,t,n)=>iz(e,typeof t!="symbol"?t+"":t,n);class lz{constructor(t){Bg(this,"createWatch"),Bg(this,"queries"),Bg(this,"listeners"),this.createWatch=t,this.queries={},this.listeners=new Set}setQueries(t){for(const n of Object.keys(t)){const{query:s,args:o,paginationOptions:l}=t[n];if(nr(s),this.queries[n]===void 0)this.addQuery(n,s,o,l?{paginationOptions:l}:{});else{const u=this.queries[n];(nr(s)!==nr(u.query)||JSON.stringify(ns(o))!==JSON.stringify(ns(u.args))||JSON.stringify(l)!==JSON.stringify(u.paginationOptions))&&(this.removeQuery(n),this.addQuery(n,s,o,l?{paginationOptions:l}:{}))}}for(const n of Object.keys(this.queries))t[n]===void 0&&this.removeQuery(n)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getLocalResults(t){const n={};for(const s of Object.keys(t)){const{query:o,args:l}=t[s],u=t[s].paginationOptions;nr(o);const d=this.createWatch(o,l,u?{paginationOptions:u}:{});let h;try{h=d.localQueryResult()}catch(m){if(m instanceof Error)h=m;else throw m}n[s]=h}return n}setCreateWatch(t){this.createWatch=t;for(const n of Object.keys(this.queries)){const{query:s,args:o,watch:l,paginationOptions:u}=this.queries[n],d="journal"in l?l.journal():void 0;this.removeQuery(n),this.addQuery(n,s,o,{...d?{journal:d}:[],...u?{paginationOptions:u}:{}})}}destroy(){for(const t of Object.keys(this.queries))this.removeQuery(t);this.listeners=new Set}addQuery(t,n,s,{paginationOptions:o,journal:l}){if(this.queries[t]!==void 0)throw new Error(`Tried to add a new query with identifier ${t} when it already exists.`);const u=this.createWatch(n,s,{...l?{journal:l}:[],...o?{paginationOptions:o}:{}}),d=u.onUpdate(()=>this.notifyListeners());this.queries[t]={query:n,args:s,watch:u,unsubscribe:d,...o?{paginationOptions:o}:{}}}removeQuery(t){const n=this.queries[t];if(n===void 0)throw new Error(`No query found with identifier ${t}.`);n.unsubscribe(),delete this.queries[t]}notifyListeners(){for(const t of this.listeners)t()}}function cz(e){const t=rz();if(t===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const n=p.useMemo(()=>(s,o,{journal:l,paginationOptions:u})=>u?t.watchPaginatedQuery(s,o,u):t.watchQuery(s,o,l?{journal:l}:{}),[t]);return uz(e,n)}function uz(e,t){const[n]=p.useState(()=>new lz(t));n.createWatch!==t&&n.setCreateWatch(t),p.useEffect(()=>()=>n.destroy(),[n]);const s=p.useMemo(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:o=>(n.setQueries(e),n.subscribe(o))}),[n,e]);return XD(s)}const qv=new WeakMap,dz=new WeakMap,Qf={current:[]};let Ug=!1,au=0;const Zc=new Set,xf=new Map;function gN(e){for(const t of e){if(Qf.current.includes(t))continue;Qf.current.push(t),t.recompute();const n=dz.get(t);if(n)for(const s of n){const o=qv.get(s);o?.length&&gN(o)}}}function fz(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function hz(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function vN(e){if(au>0&&!xf.has(e)&&xf.set(e,e.prevState),Zc.add(e),!(au>0)&&!Ug)try{for(Ug=!0;Zc.size>0;){const t=Array.from(Zc);Zc.clear();for(const n of t){const s=xf.get(n)??n.prevState;n.prevState=s,fz(n)}for(const n of t){const s=qv.get(n);s&&(Qf.current.push(n),gN(s))}for(const n of t){const s=qv.get(n);if(s)for(const o of s)hz(o)}}}finally{Ug=!1,Qf.current=[],xf.clear()}}function mz(e){au++;try{e()}finally{if(au--,au===0){const t=Zc.values().next().value;t&&vN(t)}}}function pz(e){return typeof e=="function"}class gz{constructor(t,n){this.listeners=new Set,this.subscribe=s=>{var o,l;this.listeners.add(s);const u=(l=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:l.call(o,s,this);return()=>{this.listeners.delete(s),u?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,s,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):pz(t)?this.state=t(this.prevState):this.state=t,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),vN(this)}}const Va="__TSR_index",A1="popstate",O1="beforeunload";function vz(e){let t=e.getLocation();const n=new Set,s=u=>{t=e.getLocation(),n.forEach(d=>d({location:t,action:u}))},o=u=>{e.notifyOnIndexChange??!0?s(u):t=e.getLocation()},l=async({task:u,navigateOpts:d,...h})=>{if(d?.ignoreBlocker??!1){u();return}const v=e.getBlockers?.()??[],g=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&v.length&&g)for(const y of v){const w=Kf(h.path,h.state);if(await y.blockerFn({currentLocation:t,nextLocation:w,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,d,h)=>{const m=t.state[Va];d=D1(m+1,d),l({task:()=>{e.pushState(u,d),s({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:d})},replace:(u,d,h)=>{const m=t.state[Va];d=D1(m,d),l({task:()=>{e.replaceState(u,d),s({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:d})},go:(u,d)=>{l({task:()=>{e.go(u),o({type:"GO",index:u})},navigateOpts:d,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Va]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const d=e.getBlockers?.()??[];return e.setBlockers([...d,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(m=>m!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function D1(e,t){t||(t={});const n=zx();return{...t,key:n,__TSR_key:n,[Va]:e}}function xz(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let o=[];const l=()=>o,u=O=>o=O,d=(O=>O),h=(()=>Kf(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const O=zx();t.history.replaceState({[Va]:0,key:O,__TSR_key:O},"")}let m=h(),v,g=!1,y=!1,w=!1,S=!1;const j=()=>m;let N,C;const _=()=>{N&&(T._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),T._ignoreSubscribers=!1,N=void 0,C=void 0,v=void 0)},E=(O,D,z)=>{const B=d(D);C||(v=m),m=Kf(D,z),N={href:B,state:z,isPush:N?.isPush||O==="push"},C||(C=Promise.resolve().then(()=>_()))},M=O=>{m=h(),T.notify({type:O})},A=async()=>{if(y){y=!1;return}const O=h(),D=O.state[Va]-m.state[Va],z=D===1,B=D===-1,q=!z&&!B||g;g=!1;const Y=q?"GO":B?"BACK":"FORWARD",G=q?{type:"GO",index:D}:{type:B?"BACK":"FORWARD"};if(w)w=!1;else{const ae=l();if(typeof document<"u"&&ae.length){for(const L of ae)if(await L.blockerFn({currentLocation:m,nextLocation:O,action:Y})){y=!0,t.history.go(1),T.notify(G);return}}}m=h(),T.notify(G)},R=O=>{if(S){S=!1;return}let D=!1;const z=l();if(typeof document<"u"&&z.length)for(const B of z){const q=B.enableBeforeUnload??!0;if(q===!0){D=!0;break}if(typeof q=="function"&&q()===!0){D=!0;break}}if(D)return O.preventDefault(),O.returnValue=""},T=vz({getLocation:j,getLength:()=>t.history.length,pushState:(O,D)=>E("push",O,D),replaceState:(O,D)=>E("replace",O,D),back:O=>(O&&(w=!0),S=!0,t.history.back()),forward:O=>{O&&(w=!0),S=!0,t.history.forward()},go:O=>{g=!0,t.history.go(O)},createHref:O=>d(O),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(O1,R,{capture:!0}),t.removeEventListener(A1,A)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(O1,R,{capture:!0}),t.addEventListener(A1,A),t.history.pushState=function(...O){const D=n.apply(t.history,O);return T._ignoreSubscribers||M("PUSH"),D},t.history.replaceState=function(...O){const D=s.apply(t.history,O);return T._ignoreSubscribers||M("REPLACE"),D},T}function yz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Kf(e,t){const n=yz(e),s=n.indexOf("#"),o=n.indexOf("?"),l=zx();return{href:n,pathname:n.substring(0,s>0?o>0?Math.min(s,o):s:o>0?o:n.length),hash:s>-1?n.substring(s):"",search:o>-1?n.slice(o,s===-1?void 0:s):"",state:t||{[Va]:0,key:l,__TSR_key:l}}}function zx(){return(Math.random()+1).toString(36).substring(7)}const bz=!1;function ou(e){let t;return mz(()=>{t=e()}),t}function hu(e){return e[e.length-1]}function wz(e){return typeof e=="function"}function Ba(e,t){return wz(e)?e(t):e}const Sz=Object.prototype.hasOwnProperty,z1=Object.prototype.propertyIsEnumerable;function er(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,o=I1(e)&&I1(s);if(!o&&!(Xf(e)&&Xf(s)))return s;const l=o?e:P1(e);if(!l)return s;const u=o?s:P1(s);if(!u)return s;const d=l.length,h=u.length,m=o?new Array(h):{};let v=0;for(let g=0;g<h;g++){const y=o?g:u[g],w=e[y],S=s[y];if(w===S){m[y]=w,(o?g<d:Sz.call(e,y))&&v++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){m[y]=S;continue}const j=er(w,S,n+1);m[y]=j,j===w&&v++}return d===h&&v===d?e:m}function P1(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!z1.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const s=t;for(const o of n){if(!z1.call(e,o))return!1;s.push(o)}return s}function Xf(e){if(!L1(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!L1(n)||!n.hasOwnProperty("isPrototypeOf"))}function L1(e){return Object.prototype.toString.call(e)==="[object Object]"}function I1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ao(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,o=e.length;s<o;s++)if(!Ao(e[s],t[s],n))return!1;return!0}if(Xf(e)&&Xf(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!s||t[u]!==void 0)&&!Ao(e[u],t[u],n))return!1;return!0}let o=0;if(!s)o=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&o++;let l=0;for(const u in t)if((!s||t[u]!==void 0)&&(l++,l>o||!Ao(e[u],t[u],n)))return!1;return o===l}return!1}function hl(e){let t,n;const s=new Promise((o,l)=>{t=o,n=l});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,t(o),e?.(o)},s.reject=o=>{s.status="rejected",n(o)},s}function rl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function jz(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function $1(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return jz(t)}const xN=["http:","https:","mailto:","tel:"];function Jf(e){if(!e)return!1;try{const t=new URL(e);return!xN.includes(t.protocol)}catch{return!1}}function Lc(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let s=0,o="",l;for(;(l=n.exec(e))!==null;)o+=$1(e.slice(s,l.index))+l[0],s=n.lastIndex;return o=o+$1(s?e.slice(s):e),o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}function Cz(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var Nz="Invariant failed";function ca(e,t){if(!e)throw new Error(Nz)}function eh(e){const t=new Map;let n,s;const o=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,s&&(s.next=l,l.prev=s)):(l.next.prev=void 0,n=l.next,l.next=void 0,s&&(l.prev=s,s.next=l)),s=l)};return{get(l){const u=t.get(l);if(u)return o(u),u.value},set(l,u){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===s&&(s=void 0)}const d=t.get(l);if(d)d.value=u,o(d);else{const h={key:l,value:u,prev:s};s&&(s.next=h),s=h,n||(n=h),t.set(l,h)}},clear(){t.clear(),n=void 0,s=void 0}}}const ml=0,Po=1,Lo=2,mu=3,_o=4,yN=5;function kz(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Px(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),o=s===-1?e.length:s,l=e.substring(t,o);if(!l||!l.includes("$"))return n[0]=ml,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(l==="$"){const d=e.length;return n[0]=Lo,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(l.charCodeAt(0)===36)return n[0]=Po,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const u=kz(l);if(u){const[d,h]=u,m=l.charCodeAt(d+1);if(m===45){if(d+2<l.length&&l.charCodeAt(d+2)===36){const v=d+3,g=h;if(v<g)return n[0]=mu,n[1]=t+d,n[2]=t+v,n[3]=t+g,n[4]=t+h+1,n[5]=o,n}}else if(m===36){const v=d+1,g=d+2;return g===h?(n[0]=Lo,n[1]=t+d,n[2]=t+v,n[3]=t+g,n[4]=t+h+1,n[5]=e.length,n):(n[0]=Po,n[1]=t+d,n[2]=t+g,n[3]=t+h,n[4]=t+h+1,n[5]=o,n)}}return n[0]=ml,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function Th(e,t,n,s,o,l,u){u?.(n);let d=s;{const h=n.fullPath??n.from,m=h.length,v=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;d<m;){const w=Px(h,d,t);let S;const j=d,N=w[5];switch(d=N+1,l++,w[0]){case ml:{const _=h.substring(w[2],w[3]);if(v){const E=o.static?.get(_);if(E)S=E;else{o.static??=new Map;const M=Eo(n.fullPath??n.from);M.parent=o,M.depth=l,S=M,o.static.set(_,M)}}else{const E=_.toLowerCase(),M=o.staticInsensitive?.get(E);if(M)S=M;else{o.staticInsensitive??=new Map;const A=Eo(n.fullPath??n.from);A.parent=o,A.depth=l,S=A,o.staticInsensitive.set(E,A)}}break}case Po:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=!g&&o.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===M&&O.prefix===A&&O.suffix===R);if(T)S=T;else{const O=qg(Po,n.fullPath??n.from,M,A,R);S=O,O.depth=l,O.parent=o,o.dynamic??=[],o.dynamic.push(O)}break}case mu:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=!g&&o.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===M&&O.prefix===A&&O.suffix===R);if(T)S=T;else{const O=qg(mu,n.fullPath??n.from,M,A,R);S=O,O.parent=o,O.depth=l,o.optional??=[],o.optional.push(O)}break}case Lo:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=qg(Lo,n.fullPath??n.from,M,A,R);S=T,T.parent=o,T.depth=l,o.wildcard??=[],o.wildcard.push(T)}}o=S}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const w=Eo(n.fullPath??n.from);w.kind=yN,w.parent=o,l++,w.depth=l,o.pathless??=[],o.pathless.push(w),o=w}const y=(n.path||!n.children)&&!n.isRoot;if(y&&h.endsWith("/")){const w=Eo(n.fullPath??n.from);w.kind=_o,w.parent=o,l++,w.depth=l,o.index=w,o=w}o.parse=n.options?.params?.parse??null,o.skipOnParamError=g,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const h of n.children)Th(e,t,h,d,o,l,u)}function Vg(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Fa(e){if(e.pathless)for(const t of e.pathless)Fa(t);if(e.static)for(const t of e.static.values())Fa(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Fa(t);if(e.dynamic?.length){e.dynamic.sort(Vg);for(const t of e.dynamic)Fa(t)}if(e.optional?.length){e.optional.sort(Vg);for(const t of e.optional)Fa(t)}if(e.wildcard?.length){e.wildcard.sort(Vg);for(const t of e.wildcard)Fa(t)}}function Eo(e){return{kind:ml,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function qg(e,t,n,s,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:s,suffix:o}}function _z(e,t){const n=Eo("/"),s=new Uint16Array(6);for(const o of e)Th(!1,s,o,1,n,0);Fa(n),t.masksTree=n,t.flatCache=eh(1e3)}function Ez(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=Lx(e,t.masksTree);return t.flatCache.set(e,s),s}function Tz(e,t,n,s,o){e||="/",s||="/";const l=t?`case\0${e}`:e;let u=o.singleCache.get(l);if(!u){u=Eo("/");const d=new Uint16Array(6);Th(t,d,{from:e},1,u,0),o.singleCache.set(l,u)}return Lx(s,u,n)}function Mz(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,o=t.matchCache.get(s);if(o!==void 0)return o;e||="/";let l;try{l=Lx(e,t.segmentTree,n)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=Oz(l.route)),t.matchCache.set(s,l),l}function Rz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Az(e,t=!1,n){const s=Eo(e.fullPath),o=new Uint16Array(6),l={},u={};let d=0;return Th(t,o,e,1,s,0,m=>{if(n?.(m,d),ca(!(m.id in l),`Duplicate routes found with id: ${String(m.id)}`),l[m.id]=m,d!==0&&m.path){const v=Rz(m.fullPath);(!u[v]||m.fullPath.endsWith("/"))&&(u[v]=m)}d++}),Fa(s),{processedTree:{segmentTree:s,singleCache:eh(1e3),matchCache:eh(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Lx(e,t,n=!1){const s=e.split("/"),o=zz(e,s,t,n);if(!o)return null;const[l]=bN(e,s,o);return{route:o.node.route,rawParams:l,parsedParams:o.parsedParams}}function bN(e,t,n){const s=Dz(n.node);let o=null;const l={};let u=n.extract?.part??0,d=n.extract?.node??0,h=n.extract?.path??0,m=n.extract?.segment??0;for(;d<s.length;u++,d++,h++,m++){const v=s[d];if(v.kind===_o)break;if(v.kind===yN){m--,u--,h--;continue}const g=t[u],y=h;if(g&&(h+=g.length),v.kind===Po){o??=n.node.fullPath.split("/");const w=o[m],S=v.prefix?.length??0;if(w.charCodeAt(S)===123){const N=v.suffix?.length??0,C=w.substring(S+2,w.length-N-1),_=g.substring(S,g.length-N);l[C]=decodeURIComponent(_)}else{const N=w.substring(1);l[N]=decodeURIComponent(g)}}else if(v.kind===mu){if(n.skipped&1<<d){u--,h=y-1;continue}o??=n.node.fullPath.split("/");const w=o[m],S=v.prefix?.length??0,j=v.suffix?.length??0,N=w.substring(S+3,w.length-j-1),C=v.suffix||v.prefix?g.substring(S,g.length-j):g;C&&(l[N]=decodeURIComponent(C))}else if(v.kind===Lo){const w=v,S=e.substring(y+(w.prefix?.length??0),e.length-(w.suffix?.length??0)),j=decodeURIComponent(S);l["*"]=j,l._splat=j;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:u,node:d,path:h,segment:m}]}function Oz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Dz(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function zz(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!hu(t),l=o&&e!=="/",u=t.length-(o?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,m=null,v=null;for(;d.length;){const g=d.pop(),{node:y,index:w,skipped:S,depth:j,statics:N,dynamics:C,optionals:_}=g;let{extract:E,rawParams:M,parsedParams:A}=g;if(y.skipOnParamError){if(!Hg(e,t,g))continue;M=g.rawParams,E=g.extract,A=g.parsedParams}s&&y.route&&y.kind!==_o&&Ic(m,g)&&(m=g);const R=w===u;if(R&&(y.route&&!l&&Ic(v,g)&&(v=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const T=R?void 0:t[w];let O;if(R&&y.index){const D={node:y.index,index:w,skipped:S,depth:j+1,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A};let z=!0;if(y.index.skipOnParamError&&(Hg(e,t,D)||(z=!1)),z){if(N===u&&!C&&!_&&!S)return D;Ic(v,D)&&(v=D)}}if(y.wildcard&&Ic(h,g))for(const D of y.wildcard){const{prefix:z,suffix:B}=D;if(z&&(R||!(D.caseSensitive?T:O??=T.toLowerCase()).startsWith(z)))continue;if(B){if(R)continue;const Y=t.slice(w).join("/").slice(-B.length);if((D.caseSensitive?Y:Y.toLowerCase())!==B)continue}const q={node:D,index:u,skipped:S,depth:j,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A};if(!(D.skipOnParamError&&!Hg(e,t,q))){h=q;break}}if(y.optional){const D=S|1<<j,z=j+1;for(let B=y.optional.length-1;B>=0;B--){const q=y.optional[B];d.push({node:q,index:w,skipped:D,depth:z,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R)for(let B=y.optional.length-1;B>=0;B--){const q=y.optional[B],{prefix:Y,suffix:G}=q;if(Y||G){const ae=q.caseSensitive?T:O??=T.toLowerCase();if(Y&&!ae.startsWith(Y)||G&&!ae.endsWith(G))continue}d.push({node:q,index:w+1,skipped:S,depth:z,statics:N,dynamics:C,optionals:_+1,extract:E,rawParams:M,parsedParams:A})}}if(!R&&y.dynamic&&T)for(let D=y.dynamic.length-1;D>=0;D--){const z=y.dynamic[D],{prefix:B,suffix:q}=z;if(B||q){const Y=z.caseSensitive?T:O??=T.toLowerCase();if(B&&!Y.startsWith(B)||q&&!Y.endsWith(q))continue}d.push({node:z,index:w+1,skipped:S,depth:j+1,statics:N,dynamics:C+1,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R&&y.staticInsensitive){const D=y.staticInsensitive.get(O??=T.toLowerCase());D&&d.push({node:D,index:w+1,skipped:S,depth:j+1,statics:N+1,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R&&y.static){const D=y.static.get(T);D&&d.push({node:D,index:w+1,skipped:S,depth:j+1,statics:N+1,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(y.pathless){const D=j+1;for(let z=y.pathless.length-1;z>=0;z--){const B=y.pathless[z];d.push({node:B,index:w,skipped:S,depth:D,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}}}if(v&&h)return Ic(h,v)?v:h;if(v)return v;if(h)return h;if(s&&m){let g=m.index;for(let w=0;w<m.index;w++)g+=t[w].length;const y=g===e.length?"/":e.slice(g);return m.rawParams??={},m.rawParams["**"]=decodeURIComponent(y),m}return null}function Hg(e,t,n){try{const[s,o]=bN(e,t,n);n.rawParams=s,n.extract=o;const l=n.node.parse(s);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch{return null}}function Ic(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===_o)>(e.node.kind===_o)||t.node.kind===_o==(e.node.kind===_o)&&t.depth>e.depth))):!0}function If(e){return Ix(e.filter(t=>t!==void 0).join("/"))}function Ix(e){return e.replace(/\/{2,}/g,"/")}function wN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ta(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function SN(e){return ta(wN(e))}function th(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Pz(e,t,n){return th(e,n)===th(t,n)}function Lz({base:e,to:t,trailingSlash:n="never",cache:s}){const o=t.startsWith("/"),l=!o&&t===".";let u;if(s){u=o?t:l?e:e+"\0"+t;const g=s.get(u);if(g)return g}let d;if(l)d=e.split("/");else if(o)d=t.split("/");else{for(d=e.split("/");d.length>1&&hu(d)==="";)d.pop();const g=t.split("/");for(let y=0,w=g.length;y<w;y++){const S=g[y];S===""?y?y===w-1&&d.push(S):d=[S]:S===".."?d.pop():S==="."||d.push(S)}}d.length>1&&(hu(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));let h,m="";for(let g=0;g<d.length;g++){g>0&&(m+="/");const y=d[g];if(!y)continue;h=Px(y,0,h);const w=h[0];if(w===ml){m+=y;continue}const S=h[5],j=y.substring(0,h[1]),N=y.substring(h[4],S),C=y.substring(h[2],h[3]);w===Po?m+=j||N?`${j}{$${C}}${N}`:`$${C}`:w===Lo?m+=j||N?`${j}{$}${N}`:"$":m+=`${j}{-$${C}}${N}`}m=Ix(m);const v=m||"/";return u&&s&&s.set(u,v),v}function Iz(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(n,"g");return o=>o.replace(s,l=>t.get(l)??l)}function Yg(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(o=>F1(o,n)).join("/"):F1(s,n)}function Wg({path:e,params:t,decoder:n,server:s}){let o=!1;const l={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:o};const u=e.length;let d=0,h,m="";for(;d<u;){const g=d;h=Px(e,g,h);const y=h[5];if(d=y+1,g===y)continue;const w=h[0];if(w===ml){m+="/"+e.substring(g,y);continue}if(w===Lo){const S=t._splat;l._splat=S,l["*"]=S;const j=e.substring(g,h[1]),N=e.substring(h[4],y);if(!S){o=!0,(j||N)&&(m+="/"+j+N);continue}const C=Yg("_splat",t,n);m+="/"+j+C+N;continue}if(w===Po){const S=e.substring(h[2],h[3]);!o&&!(S in t)&&(o=!0),l[S]=t[S];const j=e.substring(g,h[1]),N=e.substring(h[4],y),C=Yg(S,t,n)??"undefined";m+="/"+j+C+N;continue}if(w===mu){const S=e.substring(h[2],h[3]),j=t[S];if(j==null)continue;l[S]=j;const N=e.substring(g,h[1]),C=e.substring(h[4],y),_=Yg(S,t,n)??"";m+="/"+N+_+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:l,interpolatedPath:m||"/",isMissingParams:o}}function F1(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function br(e){return!!e?.isNotFound}function $z(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Hv="tsr-scroll-restoration-v1_3",Fz=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function Bz(){const e=$z();if(!e)return null;const t=e.getItem(Hv);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Ba(s,n)||n;try{e.setItem(Hv,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const yf=Bz(),Uz=e=>e.state.__TSR_key||e.href;function Vz(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let nh=!1;function qz({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:o,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const d=t||window.history.state?.__TSR_key,h=u[d];nh=!0;e:{if(s&&h&&Object.keys(h).length>0){for(const g in h){const y=h[g];if(g==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(g){const w=document.querySelector(g);w&&(w.scrollLeft=y.scrollX,w.scrollTop=y.scrollY)}}break e}const m=(l??window.location).hash.split("#",2)[1];if(m){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const y=document.getElementById(m);y&&y.scrollIntoView(g)}break e}const v={top:0,left:0,behavior:n};if(window.scrollTo(v),o)for(const g of o){if(g==="window")continue;const y=typeof g=="function"?g():document.querySelector(g);y&&y.scrollTo(v)}}nh=!1}function Hz(e,t){if(!yf||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!yf))return;e.isScrollRestorationSetup=!0,nh=!1;const s=e.options.getScrollRestorationKey||Uz;window.history.scrollRestoration="manual";const o=l=>{if(nh||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const h=l.target.getAttribute("data-scroll-restoration-id");h?u=`[data-scroll-restoration-id="${h}"]`:u=Vz(l.target)}const d=s(e.state.location);yf.set(h=>{const m=h[d]||={},v=m[u]||={};if(u==="window")v.scrollX=window.scrollX||0,v.scrollY=window.scrollY||0;else if(u){const g=document.querySelector(u);g&&(v.scrollX=g.scrollLeft||0,v.scrollY=g.scrollTop||0)}return h})};typeof document<"u"&&document.addEventListener("scroll",Fz(o,100),!0),e.subscribe("onRendered",l=>{const u=s(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(qz({storageKey:Hv,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&yf.set(d=>(d[u]||={},d)))})}function Yz(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function Wz(e,t=String){const n=new URLSearchParams;for(const s in e){const o=e[s];o!==void 0&&n.set(s,t(o))}return n.toString()}function Gg(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Gz(e){const t=new URLSearchParams(e),n={};for(const[s,o]of t.entries()){const l=n[s];l==null?n[s]=Gg(o):Array.isArray(l)?l.push(Gg(o)):n[s]=[l,Gg(o)]}return n}const Zz=Kz(JSON.parse),Qz=Xz(JSON.stringify,JSON.parse);function Kz(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Gz(t);for(const s in n){const o=n[s];if(typeof o=="string")try{n[s]=e(o)}catch{}}return n}}function Xz(e,t){const n=typeof t=="function";function s(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const l=Wz(o,s);return l?`?${l}`:""}}const Fr="__root__";function Jz(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&Jf(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${xN.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Br(e){return e instanceof Response&&!!e.options}const $f=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Mh=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),sl=(e,t,n=!0)=>{const s={...e.router.options.context??{}},o=n?t:t-1;for(let l=0;l<=o;l++){const u=e.matches[l];if(!u)continue;const d=e.router.getMatch(u.id);d&&Object.assign(s,d.__routeContext,d.__beforeLoadContext)}return s},jN=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ca(n.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===n.id);ca(s,"Could not find match for route: "+n.id),e.updateMatch(s.id,o=>({...o,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,jN(e,t))},Ua=(e,t,n)=>{if(!(!Br(n)&&!br(n))){if(Br(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const s=Br(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:s,context:sl(e,t.index),isFetching:!1,error:n})),br(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Br(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(jN(e,n),n)}},CN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,$c=(e,t,n,s)=>{const{id:o,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,Ua(e,e.router.getMatch(o),n);try{u.options.onError?.(n)}catch(d){n=d,Ua(e,e.router.getMatch(o),n)}e.updateMatch(o,d=>(d._nonReactive.beforeLoadPromise?.resolve(),d._nonReactive.beforeLoadPromise=void 0,d._nonReactive.loadPromise?.resolve(),{...d,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},NN=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Mh(e,t)&&(n.options.loader||n.options.beforeLoad||EN(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{$f(e)},o);s._nonReactive.pendingTimeout=u}},e4=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;NN(e,t,n,s);const o=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&Ua(e,l,l.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},t4=(e,t,n,s)=>{const o=e.router.getMatch(t),l=o._nonReactive.loadPromise;o._nonReactive.loadPromise=hl(()=>{l?.resolve()});const{paramsError:u,searchError:d}=o;u&&$c(e,n,u,"PARSE_PARAMS"),d&&$c(e,n,d,"VALIDATE_SEARCH"),NN(e,t,s,o);const h=new AbortController;let m=!1;const v=()=>{m||(m=!0,e.updateMatch(t,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:h})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,M=>({...M,isFetching:!1}))};if(!s.options.beforeLoad){ou(()=>{v(),g()});return}o._nonReactive.beforeLoadPromise=hl();const y={...sl(e,n,!1),...o.__routeContext},{search:w,params:S,cause:j}=o,N=Mh(e,t),C={search:w,abortController:h,params:S,preload:N,context:y,location:e.location,navigate:M=>e.router.navigate({...M,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":j,matches:e.matches,...e.router.options.additionalContext},_=M=>{if(M===void 0){ou(()=>{v(),g()});return}(Br(M)||br(M))&&(v(),$c(e,n,M,"BEFORE_LOAD")),ou(()=>{v(),e.updateMatch(t,A=>({...A,__beforeLoadContext:M})),g()})};let E;try{if(E=s.options.beforeLoad(C),rl(E))return v(),E.catch(M=>{$c(e,n,M,"BEFORE_LOAD")}).then(_)}catch(M){v(),$c(e,n,M,"BEFORE_LOAD")}_(E)},n4=(e,t)=>{const{id:n,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],l=()=>d(),u=()=>t4(e,n,t,o),d=()=>{if(CN(e,n))return;const h=e4(e,n,o);return rl(h)?h.then(u):u()};return l()},r4=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([l,u,d])=>{const h=l?.meta,m=l?.links,v=l?.scripts,g=l?.styles;return{meta:h,links:m,headScripts:v,headers:d,scripts:u,styles:g}})},kN=(e,t,n,s)=>{const o=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:d,cause:h}=e.router.getMatch(t),m=sl(e,n),v=Mh(e,t);return{params:l,deps:u,preload:!!v,parentMatchPromise:o,abortController:d,context:m,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:v?"preload":h,route:s,...e.router.options.additionalContext}},B1=async(e,t,n,s)=>{try{const o=e.router.getMatch(t);try{(!(bz??e.router.isServer)||o.ssr===!0)&&_N(s);const l=s.options.loader?.(kN(e,t,n,s)),u=s.options.loader&&rl(l);if((u||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,m=>({...m,isFetching:"loader"})),s.options.loader){const m=u?await l:l;Ua(e,e.router.getMatch(t),m),m!==void 0&&e.updateMatch(t,v=>({...v,loaderData:m}))}s._lazyPromise&&await s._lazyPromise;const h=o._nonReactive.minPendingPromise;h&&await h,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,m=>({...m,error:void 0,context:sl(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){e.updateMatch(t,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:sl(e,n)}));return}const d=o._nonReactive.minPendingPromise;d&&await d,br(l)&&await s.options.notFoundComponent?.preload?.(),Ua(e,e.router.getMatch(t),l);try{s.options.onError?.(l)}catch(h){u=h,Ua(e,e.router.getMatch(t),h)}e.updateMatch(t,h=>({...h,error:u,context:sl(e,n),status:"error",isFetching:!1}))}}catch(o){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),Ua(e,l,o)}},s4=async(e,t)=>{const{id:n,routeId:s}=e.matches[t];let o=!1,l=!1;const u=e.router.looseRoutesById[s];if(!CN(e,n)){const m=e.router.getMatch(n);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!e.sync&&!m.preload)return m;await m._nonReactive.loaderPromise;const v=e.router.getMatch(n),g=v._nonReactive.error||v.error;g&&Ua(e,v,g)}else{const v=Date.now()-m.updatedAt,g=Mh(e,n),y=g?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,w=u.options.shouldReload,S=typeof w=="function"?w(kN(e,n,t,u)):w,j=!!g&&!e.router.state.matches.some(E=>E.id===n),N=e.router.getMatch(n);N._nonReactive.loaderPromise=hl(),j!==N.preload&&e.updateMatch(n,E=>({...E,preload:j}));const{status:C,invalid:_}=N;o=C==="success"&&(_||(S??v>y)),g&&u.options.preload===!1||(o&&!e.sync?(l=!0,(async()=>{try{await B1(e,n,t,u);const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){Br(E)&&await e.router.navigate(E.options)}})()):(C!=="success"||o&&e.sync)&&await B1(e,n,t,u))}}const d=e.router.getMatch(n);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(n,m=>({...m,isFetching:h,invalid:!1})),e.router.getMatch(n)):d};async function U1(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&$f(t);try{for(let d=0;d<t.matches.length;d++){const h=n4(t,d);rl(h)&&await h}const n=t.firstBadMatchIndex??t.matches.length;for(let d=0;d<n;d++)t.matchPromises.push(s4(t,d));const o=(await Promise.allSettled(t.matchPromises)).filter(d=>d.status==="rejected").map(d=>d.reason);let l;for(const d of o){if(Br(d))throw d;!l&&br(d)&&(l=d)}for(const d of t.matches){const{id:h,routeId:m}=d,v=t.router.looseRoutesById[m];try{const g=r4(t,h,v);if(g){const y=await g;t.updateMatch(h,w=>({...w,...y}))}}catch(g){console.error(`Error executing head for route ${m}:`,g)}}if(l)throw l;const u=$f(t);rl(u)&&await u}catch(n){if(br(n)&&!t.preload){const s=$f(t);throw rl(s)&&await s,n}if(Br(n))throw n}return t.matches}async function _N(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of TN){const o=e.options[s]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function EN(e){for(const t of TN)if(e.options[t]?.preload)return!0;return!1}const TN=["component","errorComponent","pendingComponent","notFoundComponent"];function a4(e){return{input:({url:t})=>{for(const n of e)t=Yv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=MN(e[n],t);return t}}}function o4(e){const t=SN(e.basepath),n=`/${t}`,s=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?s:s.toLowerCase();return{input:({url:u})=>{const d=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return d===o?u.pathname="/":d.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=If(["/",t,u.pathname]),u)}}function Yv(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function MN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Oo(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,o=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:o,hashChanged:l}}class i4{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,o=this.basepath??s?.basepath??"/",l=this.basepath===void 0,u=s?.rewrite;if(this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Iz(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=xz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let y;this.resolvePathCache=eh(1e3),y=this.buildRouteTree(),this.setRoutes(y)}!this.__store&&this.latestLocation&&(this.__store=new gz(c4(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(y=>!["redirected"].includes(y.status))}}}),Hz(this));let d=!1;const h=this.options.basepath??"/",m=this.options.rewrite;if(l||o!==h||u!==m){this.basepath=h;const y=[],w=SN(h);w&&w!=="/"&&y.push(o4({basepath:h})),m&&y.push(m),this.rewrite=y.length===0?void 0:y.length===1?y[0]:a4(y),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Az(this.routeTree,this.options.caseSensitive,(s,o)=>{s.init({originalIndex:o})});return this.options.routeMasks&&_z(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,s)=>{const o={eventType:n,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const o=({pathname:h,search:m,hash:v,href:g,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const _=this.options.parseSearch(m),E=this.options.stringifySearch(_);return{href:h+E+v,publicHref:g,pathname:Lc(h),external:!1,searchStr:E,search:er(s?.search,_),hash:Lc(v.slice(1)),state:er(s?.state,y)}}const w=new URL(g,this.origin),S=Yv(this.rewrite,w),j=this.options.parseSearch(S.search),N=this.options.stringifySearch(j);return S.search=N,{href:S.href.replace(S.origin,""),publicHref:g,pathname:Lc(S.pathname),external:!!this.rewrite&&S.origin!==this.origin,searchStr:N,search:er(s?.search,j),hash:Lc(S.hash.slice(1)),state:er(s?.state,y)}},l=o(n),{__tempLocation:u,__tempKey:d}=l.state;if(u&&(!d||d===this.tempLocationKey)){const h=o(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(n,s)=>Lz({base:n,to:Ix(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},o):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>u4({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),s=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const s=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??d.fullPath,m=this.resolvePathWithBase(h,"."),v=d.search,g={...d.params},y=l.to?this.resolvePathWithBase(m,`${l.to}`):this.resolvePathWithBase(m,"."),w=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,Ba(l.params,g)),S=Wg({path:y,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,j=this.getMatchedRoutes(S);let N=j.matchedRoutes;(j.foundRoute?j.foundRoute.path!=="/"&&j.routeParams["**"]:ta(S))&&this.options.notFoundRoute&&(N=[...N,this.options.notFoundRoute]);let _=!1;if(Object.keys(w).length>0)for(const Y of N){const G=Y.options.params?.stringify??Y.options.stringifyParams;G&&(_=!0,Object.assign(w,G(w)))}const E=n.leaveParams?y:Lc(_?Wg({path:y,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:S);let M=v;if(n._includeValidateSearch&&this.options.search?.strict){const Y={};N.forEach(G=>{if(G.options.validateSearch)try{Object.assign(Y,Ff(G.options.validateSearch,{...Y,...M}))}catch{}}),M=Y}M=d4({search:M,dest:l,destRoutes:N,_includeValidateSearch:n._includeValidateSearch}),M=er(v,M);const A=this.options.stringifySearch(M),R=l.hash===!0?u.hash:l.hash?Ba(l.hash,u.hash):void 0,T=R?`#${R}`:"";let O=l.state===!0?u.state:l.state?Ba(l.state,u.state):{};O=er(u.state,O);const D=`${E}${A}${T}`;let z,B,q=!1;if(this.rewrite){const Y=new URL(D,this.origin),G=MN(this.rewrite,Y);z=Y.href.replace(Y.origin,""),G.origin!==this.origin?(B=G.href,q=!0):B=G.pathname+G.search+G.hash}else z=Cz(D),B=z;return{publicHref:B,href:z,pathname:E,search:M,searchStr:A,state:O,hash:R??"",external:q,unmaskOnReload:l.unmaskOnReload}},o=(l={},u)=>{const d=s(l);let h=u?s(u):void 0;if(!h){const m={};if(this.options.routeMasks){const v=Ez(d.pathname,this.processedTree);if(v){Object.assign(m,v.rawParams);const{from:g,params:y,...w}=v.route,S=y===!1||y===null?{}:(y??!0)===!0?m:Object.assign(m,Ba(y,m));u={from:n.from,...w,params:S},h=s(u)}}}return h&&(d.maskedLocation=h),d};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:s,...o})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(v=>{o.state[v]=this.latestLocation.state[v]});const m=Ao(o.state,this.latestLocation.state);return h.forEach(v=>{delete o.state[v]}),m},u=ta(this.latestLocation.href)===ta(o.href),d=this.commitLocationPromise;if(this.commitLocationPromise=hl(()=>{d?.resolve()}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:m,...v}=o;h&&(v={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...v,search:v.searchStr,state:{...v.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(v.unmaskOnReload??this.options.unmaskOnReload??!1)&&(v.state.__tempKey=this.tempLocationKey)),v.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](v.publicHref,v.state,{ignoreBlocker:s})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:o,viewTransition:l,ignoreBlocker:u,href:d,...h}={})=>{if(d){const g=this.history.location.state.__TSR_index,y=Kf(d,{__TSR_index:n?g:g+1}),w=new URL(y.pathname,this.origin),S=Yv(this.rewrite,w);h.to=S.pathname,h.search=this.options.parseSearch(y.search),h.hash=y.hash.slice(1)}const m=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const v=this.commitLocation({...m,viewTransition:l,replace:n,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),v},this.navigate=async({to:n,reloadDocument:s,href:o,publicHref:l,...u})=>{let d=!1;if(o)try{new URL(`${o}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(n!==void 0||!o){const m=this.buildLocation({to:n,...u});o=o??m.publicHref,l=l??m.publicHref}const h=!d&&l?l:o;if(Jf(h))return Promise.resolve();if(!u.ignoreBlocker){const v=this.history.getBlockers?.()??[];for(const g of v)if(g?.blockerFn&&await g.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(o=>!n.some(l=>l.id===o.id))}))},this.load=async n=>{let s,o,l;for(l=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad();const h=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Oo({resolvedLocation:m,location:h})}),this.emit({type:"onBeforeLoad",...Oo({resolvedLocation:m,location:h})}),await U1({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],g=[],y=[];ou(()=>{this.__store.setState(w=>{const S=w.matches,j=w.pendingMatches||w.matches;return v=S.filter(N=>!j.some(C=>C.id===N.id)),g=j.filter(N=>!S.some(C=>C.id===N.id)),y=j.filter(N=>S.some(C=>C.id===N.id)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(N=>N.status!=="error"&&N.status!=="notFound")]}}),this.clearExpiredCache()}),[[v,"onLeave"],[g,"onEnter"],[y,"onStay"]].forEach(([w,S])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[S]?.(j)})})})})}})}catch(h){Br(h)?(s=h,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):br(h)&&(o=h),this.__store.setState(m=>({...m,statusCode:s?s.status:o?404:m.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(d=>d.status==="error")&&(u=500),u!==void 0&&this.__store.setState(d=>({...d,statusCode:u}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(Oo({resolvedLocation:u,location:l})):s.types;if(d===!1){n();return}o={update:n,types:d}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";o&&this.__store.setState(l=>({...l,[o]:l[o]?.map(u=>u.id===n?s(u):u)}))})},this.getMatch=n=>{const s=o=>o.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(s),cachedMatches:o.cachedMatches.map(s),pendingMatches:o.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const s=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),l=this.getParsedLocationHref(o);n.options.href=l,n.headers.set("Location",l)}else if(s)try{const o=new URL(s);if(this.origin&&o.origin===this.origin){const l=o.pathname+o.search+o.hash;n.options.href=l,n.headers.set("Location",l)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const s=n?.filter;s!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(l=>!s(l))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const l=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=_N,this.preloadRoute=async n=>{const s=this.buildLocation(n);let o=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),u=new Set([...l,...this.state.cachedMatches.map(d=>d.id)]);ou(()=>{o.forEach(d=>{u.has(d.id)||this.__store.setState(h=>({...h,cachedMatches:[...h.cachedMatches,d]}))})});try{return o=await U1({router:this,matches:o,location:s,preload:!0,updateMatch:(d,h)=>{l.has(d)?o=o.map(m=>m.id===d?h(m):m):this.updateMatch(d,h)}}),o}catch(d){if(Br(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});br(d)||console.error(d);return}},this.matchRoute=(n,s)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(o);if(s?.pending&&this.state.status!=="pending")return!1;const d=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,h=Tz(l.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,d.pathname,this.processedTree);return!h||n.params&&!Ao(h.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?Ao(d.search,l.search,{partial:!0})?h.rawParams:!1:h.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Qz,parseSearch:t.parseSearch??Zz}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:s}){this.routesById=t,this.routesByPath=n,this.processedTree=s;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const s=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:l,parsedParams:u}=s;let{matchedRoutes:d}=s,h=!1;(o?o.path!=="/"&&l["**"]:ta(t.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:h=!0);const m=h?h4(this.options.notFoundMode,d):void 0,v=[],g=y=>y?.id?y.context??this.options.context??void 0:this.options.context??void 0;return d.forEach((y,w)=>{const S=v[w-1],[j,N,C]=(()=>{const G=S?.search??t.search,ae=S?._strictSearch??void 0;try{const L=Ff(y.options.validateSearch,{...G})??void 0;return[{...G,...L},{...ae,...L},void 0]}catch(L){let $=L;if(L instanceof rh||($=new rh(L.message,{cause:L})),n?.throwOnError)throw $;return[G,{},$]}})(),_=y.options.loaderDeps?.({search:j})??"",E=_?JSON.stringify(_):"",{interpolatedPath:M,usedParams:A}=Wg({path:y.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),R=y.id+M+E,T=this.getMatch(R),O=this.state.matches.find(G=>G.routeId===y.id),D=T?._strictParams??A;let z;if(!T)try{V1(y,A,u,D)}catch(G){if(br(G)||Br(G)?z=G:z=new l4(G.message,{cause:G}),n?.throwOnError)throw z}Object.assign(l,D);const B=O?"stay":"enter";let q;if(T)q={...T,cause:B,params:O?er(O.params,l):l,_strictParams:D,search:er(O?O.search:T.search,j),_strictSearch:N};else{const G=y.options.loader||y.options.beforeLoad||y.lazyFn||EN(y)?"pending":"success";q={id:R,ssr:y.options.ssr,index:w,routeId:y.id,params:O?er(O.params,l):l,_strictParams:D,pathname:M,updatedAt:Date.now(),search:O?er(O.search,j):j,_strictSearch:N,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:z,__routeContext:void 0,_nonReactive:{loadPromise:hl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:O?er(O.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}n?.preload||(q.globalNotFound=m===y.id),q.searchError=C;const Y=g(S);q.context={...Y,...q.__routeContext,...q.__beforeLoadContext},v.push(q)}),v.forEach((y,w)=>{const S=this.looseRoutesById[y.routeId];if(!this.getMatch(y.id)){const N=v[w-1],C=g(N);if(S.options.context){const _={deps:y.loaderDeps,params:y.params,context:C??{},location:t,navigate:E=>this.navigate({...E,_fromLocation:t}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:v};y.__routeContext=S.options.context(_)??void 0}y.context={...C,...y.__routeContext,...y.__beforeLoadContext}}}),v}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:s,parsedParams:o}=this.getMatchedRoutes(t.pathname),l=hu(n),u={...t.search};for(const v of n)try{Object.assign(u,Ff(v.options.validateSearch,u))}catch{}const d=hu(this.state.matches),h=d&&d.routeId===l.id&&t.pathname===this.state.location.pathname;let m;if(h)m=d.params;else{const v={...s};for(const g of n)try{V1(g,s,o??{},v)}catch{}m=v}return{matchedRoutes:n,fullPath:l.fullPath,search:u,params:m}}}class rh extends Error{}class l4 extends Error{}function c4(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ff(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new rh("Async validation not supported");if(n.issues)throw new rh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function u4({pathname:e,routesById:t,processedTree:n}){const s={},o=ta(e);let l,u;const d=Mz(o,n,!0);return d&&(l=d.route,Object.assign(s,d.rawParams),u=Object.assign({},d.parsedParams)),{matchedRoutes:d?.branch||[t[Fr]],routeParams:s,foundRoute:l,parsedParams:u}}function d4({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return f4(n)(e,t,s??!1)}function f4(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const l=({search:u,next:d})=>{let h=u;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(h=o.options.preSearchFilters.reduce((v,g)=>g(v),u));const m=d(h);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((v,g)=>g(v),m):m};t.middlewares.push(l)}if(o.options.validateSearch){const l=({search:u,next:d})=>{const h=d(u);if(!t._includeValidateSearch)return h;try{return{...h,...Ff(o.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const n=({search:o})=>{const l=t.dest;return l.search?l.search===!0?o:Ba(l.search,o):{}};t.middlewares.push(n);const s=(o,l,u)=>{if(o>=u.length)return l;const d=u[o];return d({search:l,next:m=>s(o+1,m,u)})};return function(l,u,d){return t.dest=u,t._includeValidateSearch=d,s(0,l,t.middlewares)}}function h4(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const s=t[n];if(s.children)return s.id}return Fr}function V1(e,t,n,s){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const l in t)l in n&&(s[l]=n[l]);else{const l=o(s);Object.assign(s,l)}}const m4="Error preloading route! ☝️";class RN{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,o=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=Fr:this.parentRoute||ca(!1);let l=o?Fr:s?.path;l&&l!=="/"&&(l=wN(l));const u=s?.id||l;let d=o?Fr:If([this.parentRoute.id===Fr?"":this.parentRoute.id,u]);l===Fr&&(l="/"),d!==Fr&&(d=If(["/",d]));const h=d===Fr?"/":If([this.parentRoute.fullPath,l]);this._path=l,this._id=d,this._fullPath=h,this._to=ta(h)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Jz({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class p4 extends RN{constructor(t){super(t)}}const bf=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Zg(e){const t=p.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function g4(e,t,n={},s={}){p.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([l])=>{t(l)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,s.disabled,e])}function v4(e){const t=p.useRef(null);return p.useImperativeHandle(e,()=>t.current,[]),t}function $x(e){const t=e.errorComponent??Fx;return i.jsx(x4,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?p.createElement(t,{error:n,reset:s}):e.children})}class x4 extends p.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Fx({error:e}){const[t,n]=p.useState(!1);return i.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[i.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),i.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),i.jsx("div",{style:{height:".25rem"}}),t?i.jsx("div",{children:i.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?i.jsx("code",{children:e.message}):null})}):null]})}function y4({children:e,fallback:t=null}){return AN()?i.jsx(ee.Fragment,{children:e}):i.jsx(ee.Fragment,{children:t})}function AN(){return ee.useSyncExternalStore(b4,()=>!0,()=>!1)}function b4(){return()=>{}}var Qg={exports:{}},Kg={},Xg={exports:{}},Jg={};var q1;function w4(){if(q1)return Jg;q1=1;var e=Du();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(g,y){var w=y(),S=s({inst:{value:w,getSnapshot:y}}),j=S[0].inst,N=S[1];return l(function(){j.value=w,j.getSnapshot=y,h(j)&&N({inst:j})},[g,w,y]),o(function(){return h(j)&&N({inst:j}),g(function(){h(j)&&N({inst:j})})},[g]),u(w),w}function h(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!n(g,w)}catch{return!0}}function m(g,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Jg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Jg}var H1;function ON(){return H1||(H1=1,Xg.exports=w4()),Xg.exports}var Y1;function S4(){if(Y1)return Kg;Y1=1;var e=Du(),t=ON();function n(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,d=e.useMemo,h=e.useDebugValue;return Kg.useSyncExternalStoreWithSelector=function(m,v,g,y,w){var S=l(null);if(S.current===null){var j={hasValue:!1,value:null};S.current=j}else j=S.current;S=d(function(){function C(R){if(!_){if(_=!0,E=R,R=y(R),w!==void 0&&j.hasValue){var T=j.value;if(w(T,R))return M=T}return M=R}if(T=M,s(E,R))return T;var O=y(R);return w!==void 0&&w(T,O)?(E=R,T):(E=R,M=O)}var _=!1,E,M,A=g===void 0?null:g;return[function(){return C(v())},A===null?void 0:function(){return C(A())}]},[v,g,y,w]);var N=o(m,S[0],S[1]);return u(function(){j.hasValue=!0,j.value=N},[N]),h(N),N},Kg}var W1;function j4(){return W1||(W1=1,Qg.exports=S4()),Qg.exports}var C4=j4();function N4(e,t=s=>s,n={}){const s=n.equal??k4;return C4.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function k4(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!t.has(s)||!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=G1(e);if(n.length!==G1(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}function G1(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const ev=p.createContext(null);function DN(){return typeof document>"u"?ev:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ev,ev)}function Vr(e){const t=p.useContext(DN());return e?.warn,t}function $n(e){const t=Vr({warn:e?.router===void 0}),n=e?.router||t,s=p.useRef(void 0);return N4(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=er(s.current,e.select(o));return s.current=l,l}return e.select(o)}return o})}const Rh=p.createContext(void 0),_4=p.createContext(void 0);function ks(e){const t=p.useContext(e.from?_4:Rh);return $n({select:s=>{const o=s.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(ca(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Bx(e){return ks({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ux(e){const{select:t,...n}=e;return ks({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Yo(e){return ks({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Vx(e){return ks({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Qa(e){const t=Vr();return p.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Ml=tN();const E4=eN(Ml);function T4(e,t){const n=Vr(),s=v4(t),{activeProps:o,inactiveProps:l,activeOptions:u,to:d,preload:h,preloadDelay:m,hashScrollIntoView:v,replace:g,startTransition:y,resetScroll:w,viewTransition:S,children:j,target:N,disabled:C,style:_,className:E,onClick:M,onFocus:A,onMouseEnter:R,onMouseLeave:T,onTouchStart:O,ignoreBlocker:D,params:z,search:B,hash:q,state:Y,mask:G,reloadDocument:ae,unsafeRelative:L,from:$,_fromLocation:U,...H}=e,le=AN(),I=$n({select:Xe=>Xe.location.search,structuralSharing:!0}),F=e.from,K=p.useMemo(()=>({...e,from:F}),[n,I,F,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ne=p.useMemo(()=>n.buildLocation({...K}),[n,K]),X=ne.maskedLocation?ne.maskedLocation.publicHref:ne.publicHref,ue=ne.maskedLocation?ne.maskedLocation.external:ne.external,te=p.useMemo(()=>z4(X,ue,n.history,C),[C,ue,X,n.history]),ye=p.useMemo(()=>{if(te?.external)return Jf(te.href)?void 0:te.href;if(!P4(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),Jf(d)?void 0:d}catch{}},[d,te]),Ce=$n({select:Xe=>{if(ye)return!1;if(u?.exact){if(!Pz(Xe.location.pathname,ne.pathname,n.basepath))return!1}else{const wt=th(Xe.location.pathname,n.basepath),gt=th(ne.pathname,n.basepath);if(!(wt.startsWith(gt)&&(wt.length===gt.length||wt[gt.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Ao(Xe.location.search,ne.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?le&&Xe.location.hash===ne.hash:!0}}),_e=Ce?Ba(o,{})??M4:tv,Re=Ce?tv:Ba(l,{})??tv,ge=[E,_e.className,Re.className].filter(Boolean).join(" "),Be=(_||_e.style||Re.style)&&{..._,..._e.style,...Re.style},[be,Ue]=p.useState(!1),rt=p.useRef(!1),it=e.reloadDocument||ye?!1:h??n.options.defaultPreload,bt=m??n.options.defaultPreloadDelay??0,pe=p.useCallback(()=>{n.preloadRoute({...K}).catch(Xe=>{console.warn(Xe),console.warn(m4)})},[n,K]),Le=p.useCallback(Xe=>{Xe?.isIntersecting&&pe()},[pe]);g4(s,Le,D4,{disabled:!!C||it!=="viewport"}),p.useEffect(()=>{rt.current||!C&&it==="render"&&(pe(),rt.current=!0)},[C,pe,it]);const We=Xe=>{const wt=Xe.currentTarget.getAttribute("target"),gt=N!==void 0?N:wt;if(!C&&!L4(Xe)&&!Xe.defaultPrevented&&(!gt||gt==="_self")&&Xe.button===0){Xe.preventDefault(),Ml.flushSync(()=>{Ue(!0)});const qn=n.subscribe("onResolved",()=>{qn(),Ue(!1)});n.navigate({...K,replace:g,resetScroll:w,hashScrollIntoView:v,startTransition:y,viewTransition:S,ignoreBlocker:D})}};if(ye)return{...H,ref:s,href:ye,...j&&{children:j},...N&&{target:N},...C&&{disabled:C},..._&&{style:_},...E&&{className:E},...M&&{onClick:M},...A&&{onFocus:A},...R&&{onMouseEnter:R},...T&&{onMouseLeave:T},...O&&{onTouchStart:O}};const Oe=Xe=>{C||it&&pe()},ft=Oe,ut=Xe=>{if(!(C||!it))if(!bt)pe();else{const wt=Xe.target;if(Fc.has(wt))return;const gt=setTimeout(()=>{Fc.delete(wt),pe()},bt);Fc.set(wt,gt)}},Mn=Xe=>{if(C||!it||!bt)return;const wt=Xe.target,gt=Fc.get(wt);gt&&(clearTimeout(gt),Fc.delete(wt))};return{...H,..._e,...Re,href:te?.href,ref:s,onClick:Bc([M,We]),onFocus:Bc([A,Oe]),onMouseEnter:Bc([R,ut]),onMouseLeave:Bc([T,Mn]),onTouchStart:Bc([O,ft]),disabled:!!C,target:N,...Be&&{style:Be},...ge&&{className:ge},...C&&R4,...Ce&&A4,...le&&be&&O4}}const tv={},M4={className:"active"},R4={role:"link","aria-disabled":!0},A4={"data-status":"active","aria-current":"page"},O4={"data-transitioning":"transitioning"},Fc=new WeakMap,D4={rootMargin:"100px"},Bc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function z4(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function P4(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Ss=p.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:o,...l}=T4(s,t),u=typeof s.children=="function"?s.children({isActive:l["data-status"]==="active"}):s.children;if(!n){const{disabled:d,...h}=l;return p.createElement("a",h,u)}return p.createElement(n,l,u)});function L4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class I4 extends RN{constructor(t){super(t),this.useMatch=n=>ks({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ks({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Vx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Yo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ux({...n,from:this.id}),this.useLoaderData=n=>Bx({...n,from:this.id}),this.useNavigate=()=>Qa({from:this.fullPath}),this.Link=ee.forwardRef((n,s)=>i.jsx(Ss,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function is(e){return new I4(e)}class $4 extends p4{constructor(t){super(t),this.useMatch=n=>ks({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ks({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Vx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Yo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ux({...n,from:this.id}),this.useLoaderData=n=>Bx({...n,from:this.id}),this.useNavigate=()=>Qa({from:this.fullPath}),this.Link=ee.forwardRef((n,s)=>i.jsx(Ss,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function F4(e){return new $4(e)}function Z1(e){return typeof e=="object"?new Q1(e,{silent:!0}).createRoute(e):new Q1(e,{silent:!0}).createRoute}class Q1{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const o=is(s);return o.isRoot=!1,o},this.silent=n?.silent}}class K1{constructor(t){this.useMatch=n=>ks({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ks({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Vx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Yo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Ux({...n,from:this.options.id}),this.useLoaderData=n=>Bx({...n,from:this.options.id}),this.useNavigate=()=>{const n=Vr();return Qa({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function X1(e){return typeof e=="object"?new K1(e):t=>new K1({id:e,...t})}function B4(){const e=Vr(),t=p.useRef({router:e,mounted:!1}),[n,s]=p.useState(!1),{hasPendingMatches:o,isLoading:l}=$n({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),u=Zg(l),d=l||n||o,h=Zg(d),m=l||o,v=Zg(m);return e.startTransition=g=>{s(!0),p.startTransition(()=>{g(),s(!1)})},p.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ta(e.latestLocation.publicHref)!==ta(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),bf(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),bf(()=>{u&&!l&&e.emit({type:"onLoad",...Oo(e.state)})},[u,e,l]),bf(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...Oo(e.state)})},[m,v,e]),bf(()=>{if(h&&!d){const g=Oo(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),g.hrefChanged&&Yz(e)}},[d,h,e]),null}function U4(e){const t=$n({select:n=>`not-found-${n.location.pathname}-${n.status}`});return i.jsx($x,{getResetKey:()=>t,onCatch:(n,s)=>{if(br(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(br(n))return e.fallback?.(n);throw n},children:e.children})}function V4(){return i.jsx("p",{children:"Not Found"})}function Wi(e){return i.jsx(i.Fragment,{children:e.children})}function zN(e,t,n){return t.options.notFoundComponent?i.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?i.jsx(e.options.defaultNotFoundComponent,{...n}):i.jsx(V4,{})}function q4(){return Vr().isScrollRestoring,null}const PN=p.memo(function({matchId:t}){const n=Vr(),s=$n({select:j=>{const N=j.matches.findIndex(_=>_.id===t),C=j.matches[N];return ca(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[N-1]?.routeId}},structuralSharing:!0}),o=n.routesById[s.routeId],l=o.options.pendingComponent??n.options.defaultPendingComponent,u=l?i.jsx(l,{}):null,d=o.options.errorComponent??n.options.defaultErrorComponent,h=o.options.onCatch??n.options.defaultOnCatch,m=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,v=s.ssr===!1||s.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||v)&&(o.options.wrapInSuspense??l??(o.options.errorComponent?.preload||v))?p.Suspense:Wi,y=d?$x:Wi,w=m?U4:Wi,S=o.isRoot?o.options.shellComponent??Wi:Wi;return i.jsxs(S,{children:[i.jsx(Rh.Provider,{value:t,children:i.jsx(g,{fallback:u,children:i.jsx(y,{getResetKey:()=>s.resetKey,errorComponent:d||Fx,onCatch:(j,N)=>{if(br(j))throw j;h?.(j,N)},children:i.jsx(w,{fallback:j=>{if(!m||j.routeId&&j.routeId!==s.routeId||!j.routeId&&!o.isRoot)throw j;return p.createElement(m,j)},children:v||s._displayPending?i.jsx(y4,{fallback:u,children:i.jsx(J1,{matchId:t})}):i.jsx(J1,{matchId:t})})})})}),s.parentRouteId===Fr&&n.options.scrollRestoration?i.jsxs(i.Fragment,{children:[i.jsx(H4,{}),i.jsx(q4,{})]}):null]})});function H4(){const e=Vr(),t=p.useRef(void 0);return i.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Oo(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const J1=p.memo(function({matchId:t}){const n=Vr(),{match:s,key:o,routeId:l}=$n({select:h=>{const m=h.matches.find(S=>S.id===t),v=m.routeId,y=(n.routesById[v].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:m.id,status:m.status,error:m.error,invalid:m.invalid,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),u=n.routesById[l],d=p.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?i.jsx(h,{},o):i.jsx(LN,{})},[o,u.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const m=n.getMatch(s.id);if(m&&!m._nonReactive.minPendingPromise){const v=hl();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},h)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return ca(br(s.error)),zN(n,u,s.error);if(s.status==="redirected")throw ca(Br(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return d}),LN=p.memo(function(){const t=Vr(),n=p.useContext(Rh),s=$n({select:m=>m.matches.find(v=>v.id===n)?.routeId}),o=t.routesById[s],l=$n({select:m=>{const g=m.matches.find(y=>y.id===n);return ca(g),g.globalNotFound}}),u=$n({select:m=>{const v=m.matches,g=v.findIndex(y=>y.id===n);return v[g+1]?.id}}),d=t.options.defaultPendingComponent?i.jsx(t.options.defaultPendingComponent,{}):null;if(l)return zN(t,o,void 0);if(!u)return null;const h=i.jsx(PN,{matchId:u});return s===Fr?i.jsx(p.Suspense,{fallback:d,children:h}):h});function Y4(){const e=Vr(),n=e.routesById[Fr].options.pendingComponent??e.options.defaultPendingComponent,s=n?i.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?Wi:p.Suspense,l=i.jsxs(o,{fallback:s,children:[i.jsx(B4,{}),i.jsx(W4,{})]});return e.options.InnerWrap?i.jsx(e.options.InnerWrap,{children:l}):l}function W4(){const e=Vr(),t=$n({select:o=>o.matches[0]?.id}),n=$n({select:o=>o.loadedAt}),s=t?i.jsx(PN,{matchId:t}):null;return i.jsx(Rh.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:i.jsx($x,{getResetKey:()=>n,errorComponent:Fx,onCatch:o=>{o.message||o.toString()},children:s})})}const G4=e=>new Z4(e);class Z4 extends i4{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Z1,globalThis.createLazyFileRoute=X1):typeof window<"u"&&(window.createFileRoute=Z1,window.createLazyFileRoute=X1);function Q4({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=DN(),o=i.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?i.jsx(e.options.Wrap,{children:o}):o}function K4({router:e,...t}){return i.jsx(Q4,{router:e,...t,children:i.jsx(Y4,{})})}function X4(e){return $n({select:t=>t.location})}const J4="0.0.17";const IN=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const e3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const t3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const ej=e=>{const t=t3(e);return t.charAt(0).toUpperCase()+t.slice(1)};var n3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const s3=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:u,...d},h)=>p.createElement("svg",{ref:h,...n3,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:IN("lucide",o),...!l&&!r3(d)&&{"aria-hidden":"true"},...d},[...u.map(([m,v])=>p.createElement(m,v)),...Array.isArray(l)?l:[l]]));const ve=(e,t)=>{const n=p.forwardRef(({className:s,...o},l)=>p.createElement(s3,{ref:l,iconNode:t,className:IN(`lucide-${e3(ej(e))}`,`lucide-${e}`,s),...o}));return n.displayName=ej(e),n};const a3=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],$N=ve("archive",a3);const o3=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],i3=ve("arrow-down",o3);const l3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],FN=ve("arrow-left",l3);const c3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],u3=ve("arrow-right",c3);const d3=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],f3=ve("arrow-up-down",d3);const h3=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],m3=ve("arrow-up",h3);const p3=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Wv=ve("bell",p3);const g3=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],v3=ve("bold",g3);const x3=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],y3=ve("book",x3);const b3=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],w3=ve("bookmark",b3);const S3=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],qx=ve("braces",S3);const j3=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],pl=ve("calendar",j3);const C3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ts=ve("check",C3);const N3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vn=ve("chevron-down",N3);const k3=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hx=ve("chevron-left",k3);const _3=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Rl=ve("chevron-right",_3);const E3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zu=ve("chevron-up",E3);const T3=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],M3=ve("chevrons-up-down",T3);const R3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Pu=ve("circle-alert",R3);const A3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Yx=ve("circle-check-big",A3);const O3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],BN=ve("circle-question-mark",O3);const D3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],z3=ve("circle-x",D3);const P3=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],sh=ve("clock",P3);const L3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Gv=ve("code-xml",L3);const I3=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],UN=ve("code",I3);const $3=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],VN=ve("copy",$3);const F3=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],qN=ve("dollar-sign",F3);const B3=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Zv=ve("download",B3);const U3=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],V3=ve("ellipsis-vertical",U3);const q3=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],HN=ve("ellipsis",q3);const H3=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Y3=ve("expand",H3);const W3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],G3=ve("external-link",W3);const Z3=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ah=ve("eye",Z3);const Q3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],K3=ve("file-code",Q3);const X3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],jr=ve("file-text",X3);const J3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],oh=ve("file-type",J3);const eP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Wx=ve("file",eP);const tP=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],nP=ve("flag",tP);const rP=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Gx=ve("folder-input",rP);const sP=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Zx=ve("folder-open",sP);const aP=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],oP=ve("folder-plus",aP);const iP=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],lP=ve("folder-tree",iP);const cP=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ih=ve("folder",cP);const uP=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],dP=ve("git-compare",uP);const fP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],hP=ve("globe",fP);const mP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],pP=ve("grid-3x3",mP);const gP=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Qx=ve("hash",gP);const vP=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],xP=ve("heading-2",vP);const yP=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],bP=ve("heart",yP);const wP=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],YN=ve("history",wP);const SP=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Ah=ve("house",SP);const jP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],rs=ve("image",jP);const CP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],NP=ve("info",CP);const kP=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],_P=ve("italic",kP);const EP=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Kx=ve("layers",EP);const TP=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],MP=ve("layout-dashboard",TP);const RP=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],pu=ve("link-2",RP);const AP=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],WN=ve("link",AP);const OP=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],gu=ve("list",OP);const DP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],vu=ve("loader-circle",DP);const zP=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Xx=ve("lock",zP);const PP=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],LP=ve("log-out",PP);const IP=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],$P=ve("mail",IP);const FP=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],BP=ve("map-pin",FP);const UP=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],VP=ve("message-square",UP);const qP=[["path",{d:"M5 12h14",key:"1ays0h"}]],HP=ve("minus",qP);const YP=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],WP=ve("monitor",YP);const GP=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ZP=ve("moon",GP);const QP=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Jx=ve("music",QP);const KP=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],XP=ve("package",KP);const JP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],e5=ve("panel-left",JP);const t5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ua=ve("pencil",t5);const n5=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],r5=ve("phone",n5);const s5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Un=ve("plus",s5);const a5=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],o5=ve("quote",a5);const i5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ey=ve("refresh-cw",i5);const l5=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],xu=ve("rotate-ccw",l5);const c5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Al=ve("search",c5);const u5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],d5=ve("settings-2",u5);const f5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],GN=ve("settings",f5);const h5=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],m5=ve("square-check-big",h5);const p5=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],g5=ve("square-pen",p5);const v5=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],x5=ve("star",v5);const y5=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],b5=ve("sun",y5);const w5=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Do=ve("tag",w5);const S5=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],ty=ve("tags",S5);const j5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],ny=ve("text-align-start",j5);const C5=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],ry=ve("toggle-left",C5);const N5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Fn=ve("trash-2",N5);const k5=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],_5=ve("trending-up",k5);const E5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Io=ve("triangle-alert",E5);const T5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],sy=ve("upload",T5);const M5=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ZN=ve("user",M5);const R5=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],A5=ve("users",R5);const O5=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ay=ve("video",O5);const D5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],At=ve("x",D5);Fe.union(Fe.literal("admin"),Fe.literal("editor"),Fe.literal("author"),Fe.literal("viewer"));const z5=Fe.union(Fe.literal("contentTypes"),Fe.literal("contentEntries"),Fe.literal("mediaItems"),Fe.literal("settings"),Fe.literal("users")),P5=Fe.union(Fe.literal("create"),Fe.literal("read"),Fe.literal("update"),Fe.literal("delete"),Fe.literal("publish"),Fe.literal("unpublish"),Fe.literal("restore"),Fe.literal("manage"),Fe.literal("move"));Fe.object({resource:z5,action:P5,scope:Fe.optional(Fe.union(Fe.literal("all"),Fe.literal("own")))});function Xi(e,t="all"){return[{resource:e,action:"create",scope:t},{resource:e,action:"read",scope:t},{resource:e,action:"update",scope:t},{resource:e,action:"delete",scope:t}]}function al(e,t="all"){return[{resource:e,action:"read",scope:t}]}function QN(e="all"){return[{resource:"contentEntries",action:"publish",scope:e},{resource:"contentEntries",action:"unpublish",scope:e}]}const L5={name:"admin",displayName:"Administrator",description:"Full access to all CMS features including settings and content type management",isSystem:!0,permissions:[...Xi("contentTypes"),...Xi("contentEntries"),...QN(),{resource:"contentEntries",action:"restore"},...Xi("mediaItems"),{resource:"settings",action:"manage"},...al("settings"),...Xi("users"),{resource:"users",action:"manage"}]},I5={name:"editor",displayName:"Editor",description:"Can manage all content and media, but cannot modify settings or content types",isSystem:!0,permissions:[...al("contentTypes"),...Xi("contentEntries"),...QN(),{resource:"contentEntries",action:"restore"},...Xi("mediaItems")]},$5={name:"author",displayName:"Author",description:"Can create and manage own content and media",isSystem:!0,permissions:[...al("contentTypes"),{resource:"contentEntries",action:"create"},{resource:"contentEntries",action:"read",scope:"own"},{resource:"contentEntries",action:"update",scope:"own"},{resource:"contentEntries",action:"delete",scope:"own"},{resource:"contentEntries",action:"publish",scope:"own"},{resource:"contentEntries",action:"unpublish",scope:"own"},{resource:"mediaItems",action:"create"},{resource:"mediaItems",action:"read",scope:"all"},{resource:"mediaItems",action:"update",scope:"own"},{resource:"mediaItems",action:"delete",scope:"own"}]},F5={name:"viewer",displayName:"Viewer",description:"Read-only access to published content and media",isSystem:!0,permissions:[...al("contentTypes"),...al("contentEntries"),...al("mediaItems")]},KN={admin:L5,editor:I5,author:$5,viewer:F5};function B5(e,t){if(e.resource!==t.resource||e.action!==t.action)return!1;const n=e.scope??"all",s=t.scope??"all";return n==="all"?!0:s==="own"}function XN(e,t,n){const s=KN[e]??n?.[e];return s?s.permissions.some(o=>B5(o,t)):!1}function U5(e,t){return(KN[e]??t?.[e])?.permissions??[]}function JN(e,t,n){return U5(e,n).filter(s=>s.resource===t)}function V5(e,t,n){return JN(e,t,n).length>0}const ek=p.createContext(null);function q5({children:e,getUser:t,getUserRole:n,onLogout:s,autoRedirectToLogin:o=!1,loginUrl:l="/login"}){const[u,d]=p.useState(null),[h,m]=p.useState(null),[v,g]=p.useState("loading"),[y,w]=p.useState(null),S=p.useCallback(async()=>{g("loading"),w(null);try{const E=await t();if(!E){d(null),m(null),g("unauthenticated"),o&&typeof window<"u"&&(window.location.href=l);return}const M=await n({userId:E.id});d(E),m(M),g("authenticated")}catch(E){console.error("Authentication error:",E),d(null),m(null),w(E instanceof Error?E.message:"Authentication failed"),g("error")}},[t,n,o,l]);p.useEffect(()=>{S()},[S]);const j=p.useCallback(E=>h?XN(h,E):!1,[h]),N=p.useCallback(async()=>{try{s&&await s(),d(null),m(null),g("unauthenticated"),o&&typeof window<"u"&&(window.location.href=l)}catch(E){console.error("Logout error:",E),w(E instanceof Error?E.message:"Logout failed")}},[s,o,l]),C=p.useCallback(async()=>{await S()},[S]),_={user:u,role:h,authState:v,isLoading:v==="loading",isAuthenticated:v==="authenticated",error:y,checkPermission:j,logout:N,refresh:C};return i.jsx(ek.Provider,{value:_,children:e})}function oy(){const e=p.useContext(ek);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const tk=p.createContext(null),nk="convex-cms-theme";function tj(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function nj(){if(typeof window>"u")return"system";const e=localStorage.getItem(nk);return e==="light"||e==="dark"||e==="system"?e:"system"}function nv(){return typeof window>"u"?!1:document.documentElement.classList.contains("dark")}function H5({children:e,themeMode:t="isolated",darkModeControl:n="independent"}){const s=t==="isolated"||n==="independent",o=t==="inherit"&&n==="follow-parent",[l,u]=p.useState(()=>o?nv()?"dark":"light":nj()),[d,h]=p.useState(()=>{if(o)return nv()?"dark":"light";const g=nj();return g==="system"?tj():g}),m=p.useCallback(g=>{const y=g==="system"?tj():g;if(h(y),s){const w=document.documentElement;w.classList.remove("light","dark"),w.classList.add(y)}},[s]),v=p.useCallback(g=>{s&&(u(g),localStorage.setItem(nk,g),m(g))},[m,s]);return p.useEffect(()=>{o||m(l)},[l,m,o]),p.useEffect(()=>{if(!o){const g=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{l==="system"&&m("system")};return g.addEventListener("change",y),()=>g.removeEventListener("change",y)}},[l,m,o]),p.useEffect(()=>{if(!o)return;const g=()=>{const S=nv()?"dark":"light";u(S),h(S)};g();const y=new MutationObserver(w=>{for(const S of w)if(S.type==="attributes"&&S.attributeName==="class"){g();break}});return y.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>y.disconnect()},[o]),i.jsx(tk.Provider,{value:{theme:l,resolvedTheme:d,setTheme:v,canToggleDarkMode:s},children:e})}function Y5(){const e=p.useContext(tk);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function fe(e,t,n){function s(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=u.prototype,v=Object.keys(m);for(let g=0;g<v.length;g++){const y=v[g];y in d||(d[y]=m[y].bind(d))}}const o=n?.Parent??Object;class l extends o{}Object.defineProperty(l,"name",{value:e});function u(d){var h;const m=n?.Parent?new l:this;s(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(u,"init",{value:s}),Object.defineProperty(u,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class ol extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rk extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const sk={};function Ha(e){return sk}function ak(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,o])=>t.indexOf(+s)===-1).map(([s,o])=>o)}function Qv(e,t){return typeof t=="bigint"?t.toString():t}function iy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ly(e){return e==null}function cy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function W5(e,t){const n=(e.toString().split(".")[1]||"").length,s=t.toString();let o=(s.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(s)){const h=s.match(/\d?e-(\d?)/);h?.[1]&&(o=Number.parseInt(h[1]))}const l=n>o?n:o,u=Number.parseInt(e.toFixed(l).replace(".","")),d=Number.parseInt(t.toFixed(l).replace(".",""));return u%d/10**l}const rj=Symbol("evaluating");function kt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==rj)return s===void 0&&(s=rj,s=n()),s},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Wo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ka(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function sj(e){return JSON.stringify(e)}function G5(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ok="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function lh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Z5=iy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function gl(e){if(lh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(lh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ik(e){return gl(e)?{...e}:Array.isArray(e)?[...e]:e}const Q5=new Set(["string","number","symbol"]);function Oh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xa(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(s._zod.parent=e),s}function $e(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function K5(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const X5={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function J5(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Ka(e._zod.def,{get shape(){const u={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(u[d]=n.shape[d])}return Wo(this,"shape",u),u},checks:[]});return Xa(e,l)}function eL(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Ka(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete u[d]}return Wo(this,"shape",u),u},checks:[]});return Xa(e,l)}function tL(e,t){if(!gl(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const l=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ka(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return Wo(this,"shape",l),l}});return Xa(e,o)}function nL(e,t){if(!gl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ka(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Wo(this,"shape",s),s}});return Xa(e,n)}function rL(e,t){const n=Ka(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return Wo(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return Xa(e,n)}function sL(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ka(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Wo(this,"shape",h),h},checks:[]});return Xa(t,u)}function aL(e,t,n){const s=Ka(t._zod.def,{get shape(){const o=t._zod.def.shape,l={...o};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)l[u]=new e({type:"nonoptional",innerType:o[u]});return Wo(this,"shape",l),l}});return Xa(t,s)}function Ji(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function el(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function wf(e){return typeof e=="string"?e:e?.message}function Ya(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const o=wf(e.inst?._zod.def?.error?.(e))??wf(t?.error?.(e))??wf(n.customError?.(e))??wf(n.localeError?.(e))??"Invalid input";s.message=o}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function uy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function yu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const lk=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ck=fe("$ZodError",lk),uk=fe("$ZodError",lk,{Parent:Error});function oL(e,t=n=>n.message){const n={},s=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):s.push(t(o));return{formErrors:s,fieldErrors:n}}function iL(e,t=n=>n.message){const n={_errors:[]},s=o=>{for(const l of o.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>s({issues:u}));else if(l.code==="invalid_key")s({issues:l.issues});else if(l.code==="invalid_element")s({issues:l.issues});else if(l.path.length===0)n._errors.push(t(l));else{let u=n,d=0;for(;d<l.path.length;){const h=l.path[d];d===l.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(l))):u[h]=u[h]||{_errors:[]},u=u[h],d++}}};return s(e),n}const dy=e=>(t,n,s,o)=>{const l=s?Object.assign(s,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise)throw new ol;if(u.issues.length){const d=new(o?.Err??e)(u.issues.map(h=>Ya(h,l,Ha())));throw ok(d,o?.callee),d}return u.value},fy=e=>async(t,n,s,o)=>{const l=s?Object.assign(s,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(o?.Err??e)(u.issues.map(h=>Ya(h,l,Ha())));throw ok(d,o?.callee),d}return u.value},Dh=e=>(t,n,s)=>{const o=s?{...s,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new ol;return l.issues.length?{success:!1,error:new(e??ck)(l.issues.map(u=>Ya(u,o,Ha())))}:{success:!0,data:l.value}},lL=Dh(uk),zh=e=>async(t,n,s)=>{const o=s?Object.assign(s,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},o);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>Ya(u,o,Ha())))}:{success:!0,data:l.value}},cL=zh(uk),uL=e=>(t,n,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return dy(e)(t,n,o)},dL=e=>(t,n,s)=>dy(e)(t,n,s),fL=e=>async(t,n,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return fy(e)(t,n,o)},hL=e=>async(t,n,s)=>fy(e)(t,n,s),mL=e=>(t,n,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Dh(e)(t,n,o)},pL=e=>(t,n,s)=>Dh(e)(t,n,s),gL=e=>async(t,n,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return zh(e)(t,n,o)},vL=e=>async(t,n,s)=>zh(e)(t,n,s),xL=/^[cC][^\s-]{8,}$/,yL=/^[0-9a-z]+$/,bL=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wL=/^[0-9a-vA-V]{20}$/,SL=/^[A-Za-z0-9]{27}$/,jL=/^[a-zA-Z0-9_-]{21}$/,CL=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,NL=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,aj=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,kL=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_L="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function EL(){return new RegExp(_L,"u")}const TL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ML=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,RL=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,AL=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OL=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dk=/^[A-Za-z0-9_-]*$/,DL=/^\+[1-9]\d{6,14}$/,fk="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",zL=new RegExp(`^${fk}$`);function hk(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function PL(e){return new RegExp(`^${hk(e)}$`)}function LL(e){const t=hk({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${n.join("|")})`;return new RegExp(`^${fk}T(?:${s})$`)}const IL=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$L=/^-?\d+$/,mk=/^-?\d+(?:\.\d+)?$/,FL=/^(?:true|false)$/i,BL=/^[^A-Z]*$/,UL=/^[^a-z]*$/,sr=fe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),pk={number:"number",bigint:"bigint",object:"date"},gk=fe("$ZodCheckLessThan",(e,t)=>{sr.init(e,t);const n=pk[typeof t.value];e._zod.onattach.push(s=>{const o=s._zod.bag,l=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<l&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vk=fe("$ZodCheckGreaterThan",(e,t)=>{sr.init(e,t);const n=pk[typeof t.value];e._zod.onattach.push(s=>{const o=s._zod.bag,l=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>l&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),VL=fe("$ZodCheckMultipleOf",(e,t)=>{sr.init(e,t),e._zod.onattach.push(n=>{var s;(s=n._zod.bag).multipleOf??(s.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):W5(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),qL=fe("$ZodCheckNumberFormat",(e,t)=>{sr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[o,l]=X5[t.format];e._zod.onattach.push(u=>{const d=u._zod.bag;d.format=t.format,d.minimum=o,d.maximum=l,n&&(d.pattern=$L)}),e._zod.check=u=>{const d=u.value;if(n){if(!Number.isInteger(d)){u.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?u.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):u.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort});return}}d<o&&u.issues.push({origin:"number",input:d,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),d>l&&u.issues.push({origin:"number",input:d,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}}),HL=fe("$ZodCheckMaxLength",(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=s=>{const o=s.value;return!ly(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const o=s.value;if(o.length<=t.maximum)return;const u=uy(o);s.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),YL=fe("$ZodCheckMinLength",(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=s=>{const o=s.value;return!ly(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const o=s.value;if(o.length>=t.minimum)return;const u=uy(o);s.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),WL=fe("$ZodCheckLengthEquals",(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=s=>{const o=s.value;return!ly(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=s=>{const o=s.value,l=o.length;if(l===t.length)return;const u=uy(o),d=l>t.length;s.issues.push({origin:u,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),Ph=fe("$ZodCheckStringFormat",(e,t)=>{var n,s;sr.init(e,t),e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),GL=fe("$ZodCheckRegex",(e,t)=>{Ph.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ZL=fe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=BL),Ph.init(e,t)}),QL=fe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=UL),Ph.init(e,t)}),KL=fe("$ZodCheckIncludes",(e,t)=>{sr.init(e,t);const n=Oh(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(o=>{const l=o._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(s)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),XL=fe("$ZodCheckStartsWith",(e,t)=>{sr.init(e,t);const n=new RegExp(`^${Oh(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),JL=fe("$ZodCheckEndsWith",(e,t)=>{sr.init(e,t);const n=new RegExp(`.*${Oh(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),eI=fe("$ZodCheckOverwrite",(e,t)=>{sr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tI{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
11
11
  `).filter(u=>u),o=Math.min(...s.map(u=>u.length-u.trimStart().length)),l=s.map(u=>u.slice(o)).map(u=>" ".repeat(this.indent*2)+u);for(const u of l)this.content.push(u)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(l=>` ${l}`)];return new t(...n,o.join(`
12
12
  `))}}const nI={major:4,minor:3,patch:6},Yt=fe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nI;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const o of s)for(const l of o._zod.onattach)l(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,d,h)=>{let m=Ji(u),v;for(const g of d){if(g._zod.def.when){if(!g._zod.def.when(u))continue}else if(m)continue;const y=u.issues.length,w=g._zod.check(u);if(w instanceof Promise&&h?.async===!1)throw new ol;if(v||w instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await w,u.issues.length!==y&&(m||(m=Ji(u,y)))});else{if(u.issues.length===y)continue;m||(m=Ji(u,y))}}return v?v.then(()=>u):u},l=(u,d,h)=>{if(Ji(u))return u.aborted=!0,u;const m=o(d,s,h);if(m instanceof Promise){if(h.async===!1)throw new ol;return m.then(v=>e._zod.parse(v,h))}return e._zod.parse(m,h)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const m=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(v=>l(v,u,d)):l(m,u,d)}const h=e._zod.parse(u,d);if(h instanceof Promise){if(d.async===!1)throw new ol;return h.then(m=>o(m,s,d))}return o(h,s,d)}}kt(e,"~standard",()=>({validate:o=>{try{const l=lL(e,o);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return cL(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),hy=fe("$ZodString",(e,t)=>{Yt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??IL(e._zod.bag),e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),It=fe("$ZodStringFormat",(e,t)=>{Ph.init(e,t),hy.init(e,t)}),rI=fe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=NL),It.init(e,t)}),sI=fe("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=aj(s))}else t.pattern??(t.pattern=aj());It.init(e,t)}),aI=fe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=kL),It.init(e,t)}),oI=fe("$ZodURL",(e,t)=>{It.init(e,t),e._zod.check=n=>{try{const s=n.value.trim(),o=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),iI=fe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=EL()),It.init(e,t)}),lI=fe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=jL),It.init(e,t)}),cI=fe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=xL),It.init(e,t)}),uI=fe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yL),It.init(e,t)}),dI=fe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bL),It.init(e,t)}),fI=fe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wL),It.init(e,t)}),hI=fe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=SL),It.init(e,t)}),mI=fe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=LL(t)),It.init(e,t)}),pI=fe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zL),It.init(e,t)}),gI=fe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=PL(t)),It.init(e,t)}),vI=fe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=CL),It.init(e,t)}),xI=fe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=TL),It.init(e,t),e._zod.bag.format="ipv4"}),yI=fe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ML),It.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),bI=fe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=RL),It.init(e,t)}),wI=fe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=AL),It.init(e,t),e._zod.check=n=>{const s=n.value.split("/");try{if(s.length!==2)throw new Error;const[o,l]=s;if(!l)throw new Error;const u=Number(l);if(`${u}`!==l)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function xk(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const SI=fe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=OL),It.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{xk(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function jI(e){if(!dk.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return xk(n)}const CI=fe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=dk),It.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{jI(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),NI=fe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=DL),It.init(e,t)});function kI(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[s]=n;if(!s)return!1;const o=JSON.parse(atob(s));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const _I=fe("$ZodJWT",(e,t)=>{It.init(e,t),e._zod.check=n=>{kI(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),yk=fe("$ZodNumber",(e,t)=>{Yt.init(e,t),e._zod.pattern=e._zod.bag.pattern??mk,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const l=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...l?{received:l}:{}}),n}}),EI=fe("$ZodNumberFormat",(e,t)=>{qL.init(e,t),yk.init(e,t)}),TI=fe("$ZodBoolean",(e,t)=>{Yt.init(e,t),e._zod.pattern=FL,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),MI=fe("$ZodUnknown",(e,t)=>{Yt.init(e,t),e._zod.parse=n=>n}),RI=fe("$ZodNever",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,s)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function oj(e,t,n){e.issues.length&&t.issues.push(...el(n,e.issues)),t.value[n]=e.value}const AI=fe("$ZodArray",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,s)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const l=[];for(let u=0;u<o.length;u++){const d=o[u],h=t.element._zod.run({value:d,issues:[]},s);h instanceof Promise?l.push(h.then(m=>oj(m,n,u))):oj(h,n,u)}return l.length?Promise.all(l).then(()=>n):n}});function ch(e,t,n,s,o){if(e.issues.length){if(o&&!(n in s))return;t.issues.push(...el(n,e.issues))}e.value===void 0?n in s&&(t.value[n]=void 0):t.value[n]=e.value}function bk(e){const t=Object.keys(e.shape);for(const s of t)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const n=K5(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function wk(e,t,n,s,o,l){const u=[],d=o.keySet,h=o.catchall._zod,m=h.def.type,v=h.optout==="optional";for(const g in t){if(d.has(g))continue;if(m==="never"){u.push(g);continue}const y=h.run({value:t[g],issues:[]},s);y instanceof Promise?e.push(y.then(w=>ch(w,n,g,t,v))):ch(y,n,g,t,v)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:l}),e.length?Promise.all(e).then(()=>n):n}const OI=fe("$ZodObject",(e,t)=>{if(Yt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const s=iy(()=>bk(t));kt(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const v=d[m]._zod;if(v.values){h[m]??(h[m]=new Set);for(const g of v.values)h[m].add(g)}}return h});const o=lh,l=t.catchall;let u;e._zod.parse=(d,h)=>{u??(u=s.value);const m=d.value;if(!o(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const v=[],g=u.shape;for(const y of u.keys){const w=g[y],S=w._zod.optout==="optional",j=w._zod.run({value:m[y],issues:[]},h);j instanceof Promise?v.push(j.then(N=>ch(N,d,y,m,S))):ch(j,d,y,m,S)}return l?wk(v,m,d,h,s.value,e):v.length?Promise.all(v).then(()=>d):d}}),DI=fe("$ZodObjectJIT",(e,t)=>{OI.init(e,t);const n=e._zod.parse,s=iy(()=>bk(t)),o=y=>{const w=new tI(["shape","payload","ctx"]),S=s.value,j=E=>{const M=sj(E);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};w.write("const input = payload.value;");const N=Object.create(null);let C=0;for(const E of S.keys)N[E]=`key_${C++}`;w.write("const newResult = {};");for(const E of S.keys){const M=N[E],A=sj(E),T=y[E]?._zod?.optout==="optional";w.write(`const ${M} = ${j(E)};`),T?w.write(`
13
13
  if (${M}.issues.length) {